@linktr.ee/messaging-react 1.30.0 → 1.31.0-rc-1776677746
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/{Creator-77XnrIxc.js → Creator-DGe3CQ_j.js} +131 -138
- package/dist/Creator-DGe3CQ_j.js.map +1 -0
- package/dist/{MediaPlayer-Bf-xPB8Z.js → MediaPlayer-BCsdmsON.js} +83 -89
- package/dist/MediaPlayer-BCsdmsON.js.map +1 -0
- package/dist/Visitor-DyJTWB2_.js +204 -0
- package/dist/Visitor-DyJTWB2_.js.map +1 -0
- package/dist/index.d.ts +33 -19
- package/dist/index.js +775 -767
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/ChannelView.tsx +15 -13
- package/src/components/CustomMessage/CustomMessage.stories.tsx +12 -20
- package/src/components/CustomMessage/index.tsx +20 -18
- package/src/components/LockedAttachment/LockedAttachment.stories.tsx +49 -140
- package/src/components/LockedAttachment/components/Creator.tsx +45 -58
- package/src/components/LockedAttachment/components/MediaPlayer.tsx +7 -17
- package/src/components/LockedAttachment/components/Visitor.tsx +99 -88
- package/src/components/LockedAttachment/index.tsx +4 -4
- package/src/components/LockedAttachment/types.ts +9 -4
- package/src/components/MessagingShell/index.tsx +6 -4
- package/src/types.ts +18 -13
- package/dist/Creator-77XnrIxc.js.map +0 -1
- package/dist/MediaPlayer-Bf-xPB8Z.js.map +0 -1
- package/dist/Visitor-C9HSYm3D.js +0 -196
- package/dist/Visitor-C9HSYm3D.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { jsx as e, jsxs as i, Fragment as he } from "react/jsx-runtime";
|
|
2
2
|
import A from "classnames";
|
|
3
|
-
import F, { createContext as
|
|
4
|
-
import { StreamChatService as
|
|
5
|
-
import { Chat as
|
|
6
|
-
import { StarIcon as
|
|
7
|
-
import { LinkPreviewsManager as
|
|
8
|
-
const
|
|
3
|
+
import F, { createContext as gt, useContext as xt, useCallback as U, useState as T, useRef as ee, useEffect as X, useMemo as Ue, Suspense as ze } from "react";
|
|
4
|
+
import { StreamChatService as bt } from "@linktr.ee/messaging-core";
|
|
5
|
+
import { Chat as Ct, ChannelList as Nt, DateSeparator as yt, useChannelStateContext as ke, useChatContext as Qe, areMessageUIPropsEqual as pt, useMessageReminder as vt, useComponentContext as wt, Attachment as _t, EditMessageModal as Et, MessageBlocked as St, MessageBouncePrompt as It, MessageDeleted as kt, MessageIsThreadReplyInChannelButtonIndicator as Mt, MessageRepliesCountButton as Tt, ReminderNotification as Dt, StreamedMessageText as Rt, messageHasAttachments as At, messageHasReactions as Lt, isDateSeparatorMessage as Ut, isMessageBlocked as Pt, isMessageBounced as Ft, MessageBounceModal as Ot, MessageText as He, Poll as Bt, MessageErrorIcon as Gt, useMessageContext as et, useMessageComposer as jt, useStateStore as $t, MessageInput as zt, useMessageInputContext as Ht, useMessageComposerHasSendableData as Vt, SimpleAttachmentSelector as Yt, QuotedMessagePreview as Wt, AttachmentPreviewList as qt, TextareaComposer as Zt, MessageTimestamp as Re, Channel as Jt, WithComponents as Xt, Window as Kt, MessageList as Qt } from "stream-chat-react";
|
|
6
|
+
import { StarIcon as Pe, GiftIcon as es, XIcon as Be, SpinnerGapIcon as Ee, SignOutIcon as ts, ProhibitInsetIcon as Ve, FlagIcon as ss, ArrowUpIcon as ns, SparkleIcon as as, ProhibitIcon as rs, ArrowLeftIcon as Ye, DotsThreeIcon as We, MagnifyingGlassIcon as os, ChatCircleDotsIcon as qe } from "@phosphor-icons/react";
|
|
7
|
+
import { LinkPreviewsManager as Ze } from "stream-chat";
|
|
8
|
+
const tt = gt({
|
|
9
9
|
service: null,
|
|
10
10
|
client: null,
|
|
11
11
|
isConnected: !1,
|
|
@@ -15,7 +15,7 @@ const et = ft({
|
|
|
15
15
|
refreshConnection: async () => {
|
|
16
16
|
},
|
|
17
17
|
debug: !1
|
|
18
|
-
}), Me = () =>
|
|
18
|
+
}), Me = () => xt(tt), dn = ({
|
|
19
19
|
children: t,
|
|
20
20
|
user: s,
|
|
21
21
|
serviceConfig: n,
|
|
@@ -24,8 +24,8 @@ const et = ft({
|
|
|
24
24
|
debug: d = !1
|
|
25
25
|
}) => {
|
|
26
26
|
const a = U(
|
|
27
|
-
(
|
|
28
|
-
d && console.log(`🔥 [MessagingProvider] ${
|
|
27
|
+
(m, ...y) => {
|
|
28
|
+
d && console.log(`🔥 [MessagingProvider] ${m}`, ...y);
|
|
29
29
|
},
|
|
30
30
|
[d]
|
|
31
31
|
);
|
|
@@ -35,68 +35,68 @@ const et = ft({
|
|
|
35
35
|
serviceConfig: !!n,
|
|
36
36
|
capabilities: Object.keys(l)
|
|
37
37
|
});
|
|
38
|
-
const [c,
|
|
38
|
+
const [c, f] = T(null), [u, x] = T(null), [C, E] = T(!1), [h, p] = T(!1), [v, r] = T(null), M = ee(!1), S = ee({
|
|
39
39
|
userId: s == null ? void 0 : s.id,
|
|
40
40
|
apiKey: o,
|
|
41
41
|
serviceConfig: n,
|
|
42
42
|
capabilities: l
|
|
43
|
-
}),
|
|
44
|
-
|
|
45
|
-
renderCount:
|
|
43
|
+
}), N = ee(0);
|
|
44
|
+
N.current++, a("📊 RENDER INFO", {
|
|
45
|
+
renderCount: N.current,
|
|
46
46
|
currentProps: { userId: s == null ? void 0 : s.id, apiKey: (o == null ? void 0 : o.substring(0, 8)) + "..." },
|
|
47
47
|
propChanges: {
|
|
48
|
-
userChanged:
|
|
49
|
-
apiKeyChanged:
|
|
50
|
-
serviceConfigChanged:
|
|
51
|
-
capabilitiesChanged:
|
|
48
|
+
userChanged: S.current.userId !== (s == null ? void 0 : s.id),
|
|
49
|
+
apiKeyChanged: S.current.apiKey !== o,
|
|
50
|
+
serviceConfigChanged: S.current.serviceConfig !== n,
|
|
51
|
+
capabilitiesChanged: S.current.capabilities !== l
|
|
52
52
|
}
|
|
53
|
-
}),
|
|
53
|
+
}), S.current = {
|
|
54
54
|
userId: s == null ? void 0 : s.id,
|
|
55
55
|
apiKey: o,
|
|
56
56
|
serviceConfig: n,
|
|
57
57
|
capabilities: l
|
|
58
58
|
}, X(() => {
|
|
59
|
-
const
|
|
59
|
+
const m = N.current;
|
|
60
60
|
if (a("🔧 SERVICE INIT EFFECT TRIGGERED", {
|
|
61
|
-
renderCount:
|
|
61
|
+
renderCount: m,
|
|
62
62
|
apiKey: !!o,
|
|
63
63
|
serviceConfig: !!n,
|
|
64
64
|
dependencies: {
|
|
65
65
|
apiKey: (o == null ? void 0 : o.substring(0, 8)) + "...",
|
|
66
66
|
serviceConfigRef: n,
|
|
67
|
-
serviceConfigStable:
|
|
68
|
-
apiKeyStable:
|
|
67
|
+
serviceConfigStable: S.current.serviceConfig === n,
|
|
68
|
+
apiKeyStable: S.current.apiKey === o
|
|
69
69
|
}
|
|
70
70
|
}), !o || !n) {
|
|
71
71
|
a("⚠️ SERVICE INIT SKIPPED", {
|
|
72
|
-
renderCount:
|
|
72
|
+
renderCount: m,
|
|
73
73
|
reason: "Missing apiKey or serviceConfig"
|
|
74
74
|
});
|
|
75
75
|
return;
|
|
76
76
|
}
|
|
77
77
|
a("🚀 CREATING NEW SERVICE", {
|
|
78
|
-
renderCount:
|
|
78
|
+
renderCount: m,
|
|
79
79
|
apiKey: (o == null ? void 0 : o.substring(0, 8)) + "...",
|
|
80
|
-
serviceConfigChanged:
|
|
80
|
+
serviceConfigChanged: S.current.serviceConfig !== n
|
|
81
81
|
});
|
|
82
|
-
const
|
|
82
|
+
const y = new bt({
|
|
83
83
|
...n,
|
|
84
84
|
apiKey: o,
|
|
85
85
|
debug: d
|
|
86
86
|
});
|
|
87
|
-
return
|
|
88
|
-
renderCount:
|
|
89
|
-
serviceInstance: !!
|
|
87
|
+
return f(y), a("✅ SERVICE SET", {
|
|
88
|
+
renderCount: m,
|
|
89
|
+
serviceInstance: !!y
|
|
90
90
|
}), () => {
|
|
91
91
|
a("🧹 SERVICE CLEANUP", {
|
|
92
|
-
renderCount:
|
|
92
|
+
renderCount: m,
|
|
93
93
|
reason: "Effect cleanup"
|
|
94
|
-
}),
|
|
94
|
+
}), y.disconnectUser().catch(console.error);
|
|
95
95
|
};
|
|
96
96
|
}, [o, n, d, a]);
|
|
97
|
-
const
|
|
97
|
+
const w = ee(null);
|
|
98
98
|
X(() => {
|
|
99
|
-
var
|
|
99
|
+
var y, b;
|
|
100
100
|
if (a("🔗 USER CONNECTION EFFECT TRIGGERED", {
|
|
101
101
|
hasService: !!c,
|
|
102
102
|
hasUser: !!s,
|
|
@@ -112,7 +112,7 @@ const et = ft({
|
|
|
112
112
|
a("⚠️ USER CONNECTION SKIPPED", "Already connecting");
|
|
113
113
|
return;
|
|
114
114
|
}
|
|
115
|
-
if (((
|
|
115
|
+
if (((y = w.current) == null ? void 0 : y.serviceId) === c && ((b = w.current) == null ? void 0 : b.userId) === s.id) {
|
|
116
116
|
a(
|
|
117
117
|
"⚠️ USER CONNECTION SKIPPED",
|
|
118
118
|
"Already connected this user with this service"
|
|
@@ -120,22 +120,22 @@ const et = ft({
|
|
|
120
120
|
return;
|
|
121
121
|
}
|
|
122
122
|
(async () => {
|
|
123
|
-
a("🚀 STARTING USER CONNECTION", { userId: s.id }), M.current = !0,
|
|
123
|
+
a("🚀 STARTING USER CONNECTION", { userId: s.id }), M.current = !0, p(!0), r(null);
|
|
124
124
|
try {
|
|
125
125
|
a("📞 CALLING SERVICE.CONNECTUSER", { userId: s.id });
|
|
126
|
-
const
|
|
127
|
-
|
|
126
|
+
const _ = await c.connectUser(s);
|
|
127
|
+
x(_), E(!0), w.current = { serviceId: c, userId: s.id }, a("✅ USER CONNECTION SUCCESS", {
|
|
128
128
|
userId: s.id,
|
|
129
|
-
clientId:
|
|
129
|
+
clientId: _.userID
|
|
130
130
|
});
|
|
131
|
-
} catch (
|
|
132
|
-
const
|
|
133
|
-
|
|
131
|
+
} catch (_) {
|
|
132
|
+
const k = _ instanceof Error ? _.message : "Connection failed";
|
|
133
|
+
r(k), a("❌ USER CONNECTION ERROR", {
|
|
134
134
|
userId: s.id,
|
|
135
|
-
error:
|
|
135
|
+
error: k
|
|
136
136
|
});
|
|
137
137
|
} finally {
|
|
138
|
-
|
|
138
|
+
p(!1), M.current = !1, a("🔄 USER CONNECTION FINISHED", {
|
|
139
139
|
userId: s.id,
|
|
140
140
|
isConnected: C
|
|
141
141
|
});
|
|
@@ -148,12 +148,12 @@ const et = ft({
|
|
|
148
148
|
c && C ? (a(
|
|
149
149
|
"🧹 CLEANUP EFFECT TRIGGERED",
|
|
150
150
|
"Cleaning up connection on unmount"
|
|
151
|
-
),
|
|
151
|
+
), w.current = null, c.disconnectUser().catch(console.error)) : a("🔇 CLEANUP EFFECT SKIPPED", {
|
|
152
152
|
hasService: !!c,
|
|
153
153
|
isConnected: C
|
|
154
154
|
});
|
|
155
155
|
}), [c, C, a]);
|
|
156
|
-
const
|
|
156
|
+
const R = U(async () => {
|
|
157
157
|
if (a("🔄 REFRESH CONNECTION CALLED", {
|
|
158
158
|
hasService: !!c,
|
|
159
159
|
hasUser: !!s
|
|
@@ -161,77 +161,77 @@ const et = ft({
|
|
|
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
166
|
a("🔌 DISCONNECTING FOR REFRESH"), await c.disconnectUser(), a("📞 RECONNECTING FOR REFRESH");
|
|
167
|
-
const
|
|
168
|
-
|
|
169
|
-
} catch (
|
|
170
|
-
const
|
|
171
|
-
|
|
167
|
+
const m = await c.connectUser(s);
|
|
168
|
+
x(m), E(!0), r(null), a("✅ CONNECTION REFRESH SUCCESS", { userId: s.id });
|
|
169
|
+
} catch (m) {
|
|
170
|
+
const y = m instanceof Error ? m.message : "Refresh failed";
|
|
171
|
+
r(y), a("❌ CONNECTION REFRESH ERROR", {
|
|
172
172
|
userId: s.id,
|
|
173
|
-
error:
|
|
173
|
+
error: y
|
|
174
174
|
});
|
|
175
175
|
} finally {
|
|
176
|
-
|
|
176
|
+
p(!1), a("🔄 CONNECTION REFRESH FINISHED", { userId: s.id });
|
|
177
177
|
}
|
|
178
|
-
}, [c, s, a]),
|
|
178
|
+
}, [c, s, a]), g = F.useMemo(() => (a("💫 CONTEXT VALUE MEMOIZATION", {
|
|
179
179
|
hasService: !!c,
|
|
180
|
-
hasClient: !!
|
|
180
|
+
hasClient: !!u,
|
|
181
181
|
isConnected: C,
|
|
182
|
-
isLoading:
|
|
183
|
-
hasError: !!
|
|
182
|
+
isLoading: h,
|
|
183
|
+
hasError: !!v,
|
|
184
184
|
capabilitiesKeys: Object.keys(l)
|
|
185
185
|
}), {
|
|
186
186
|
service: c,
|
|
187
|
-
client:
|
|
187
|
+
client: u,
|
|
188
188
|
isConnected: C,
|
|
189
|
-
isLoading:
|
|
190
|
-
error:
|
|
189
|
+
isLoading: h,
|
|
190
|
+
error: v,
|
|
191
191
|
capabilities: l,
|
|
192
|
-
refreshConnection:
|
|
192
|
+
refreshConnection: R,
|
|
193
193
|
debug: d
|
|
194
194
|
}), [
|
|
195
195
|
c,
|
|
196
|
-
|
|
196
|
+
u,
|
|
197
197
|
C,
|
|
198
|
-
|
|
199
|
-
|
|
198
|
+
h,
|
|
199
|
+
v,
|
|
200
200
|
l,
|
|
201
|
-
|
|
201
|
+
R,
|
|
202
202
|
d,
|
|
203
203
|
a
|
|
204
204
|
]);
|
|
205
205
|
return a("🔄 RENDER END", {
|
|
206
|
-
renderCount:
|
|
207
|
-
willRenderChat: !!(
|
|
208
|
-
contextValueReady: !!
|
|
209
|
-
}), /* @__PURE__ */ e(
|
|
210
|
-
|
|
206
|
+
renderCount: N.current,
|
|
207
|
+
willRenderChat: !!(u && C),
|
|
208
|
+
contextValueReady: !!g
|
|
209
|
+
}), /* @__PURE__ */ e(tt.Provider, { value: g, children: u && C ? /* @__PURE__ */ e(
|
|
210
|
+
Ct,
|
|
211
211
|
{
|
|
212
|
-
client:
|
|
212
|
+
client: u,
|
|
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
|
-
},
|
|
220
|
-
function
|
|
219
|
+
}, ls = () => Me();
|
|
220
|
+
function is(t) {
|
|
221
221
|
const s = t.state.pending_messages;
|
|
222
222
|
if (s != null && s.length)
|
|
223
223
|
for (const n of s)
|
|
224
224
|
t.state.addMessageSorted(n.message);
|
|
225
225
|
}
|
|
226
|
-
const
|
|
226
|
+
const st = F.createContext({
|
|
227
227
|
selectedChannel: void 0,
|
|
228
228
|
onChannelSelect: () => {
|
|
229
229
|
},
|
|
230
230
|
debug: !1,
|
|
231
231
|
renderMessagePreview: void 0
|
|
232
|
-
}),
|
|
232
|
+
}), cs = st.Provider, ds = () => F.useContext(st), nt = (t) => {
|
|
233
233
|
var o, l;
|
|
234
|
-
const [s, n] =
|
|
234
|
+
const [s, n] = T(
|
|
235
235
|
!!((l = (o = t == null ? void 0 : t.state) == null ? void 0 : o.membership) != null && l.pinned_at)
|
|
236
236
|
);
|
|
237
237
|
return X(() => {
|
|
@@ -242,27 +242,27 @@ const tt = F.createContext({
|
|
|
242
242
|
}
|
|
243
243
|
n(!!((a = t.state.membership) != null && a.pinned_at));
|
|
244
244
|
const d = (c) => {
|
|
245
|
-
var
|
|
245
|
+
var f;
|
|
246
246
|
n(
|
|
247
|
-
c != null && c.member ? !!c.member.pinned_at : !!((
|
|
247
|
+
c != null && c.member ? !!c.member.pinned_at : !!((f = t.state.membership) != null && f.pinned_at)
|
|
248
248
|
);
|
|
249
249
|
};
|
|
250
250
|
return t.on("member.updated", d), () => {
|
|
251
251
|
t.off("member.updated", d);
|
|
252
252
|
};
|
|
253
253
|
}, [t]), s;
|
|
254
|
-
},
|
|
254
|
+
}, ms = (t, s) => {
|
|
255
255
|
const n = new Date(
|
|
256
256
|
Date.UTC(t.getUTCFullYear(), t.getUTCMonth(), t.getUTCDate())
|
|
257
257
|
), l = new Date(
|
|
258
258
|
Date.UTC(s.getUTCFullYear(), s.getUTCMonth(), s.getUTCDate())
|
|
259
259
|
).getTime() - n.getTime();
|
|
260
260
|
return Math.floor(l / (1e3 * 60 * 60 * 24));
|
|
261
|
-
},
|
|
261
|
+
}, us = (t) => {
|
|
262
262
|
const s = /* @__PURE__ */ new Date();
|
|
263
263
|
if (Math.floor((s.getTime() - t.getTime()) / 1e3) < 60)
|
|
264
264
|
return "Just now";
|
|
265
|
-
const o =
|
|
265
|
+
const o = ms(t, s);
|
|
266
266
|
return o === 0 ? t.toLocaleTimeString([], {
|
|
267
267
|
hour: "numeric",
|
|
268
268
|
minute: "2-digit",
|
|
@@ -272,7 +272,7 @@ const tt = F.createContext({
|
|
|
272
272
|
day: "numeric",
|
|
273
273
|
year: "2-digit"
|
|
274
274
|
});
|
|
275
|
-
},
|
|
275
|
+
}, Je = [
|
|
276
276
|
"🍎",
|
|
277
277
|
// Apple
|
|
278
278
|
"🍌",
|
|
@@ -300,7 +300,7 @@ const tt = F.createContext({
|
|
|
300
300
|
"🍈"
|
|
301
301
|
// Melon
|
|
302
302
|
];
|
|
303
|
-
function
|
|
303
|
+
function hs(t) {
|
|
304
304
|
let s = 0;
|
|
305
305
|
for (let n = 0; n < t.length; n++) {
|
|
306
306
|
const o = t.charCodeAt(n);
|
|
@@ -308,11 +308,11 @@ function us(t) {
|
|
|
308
308
|
}
|
|
309
309
|
return Math.abs(s);
|
|
310
310
|
}
|
|
311
|
-
function
|
|
312
|
-
const n =
|
|
313
|
-
return
|
|
311
|
+
function fs(t) {
|
|
312
|
+
const n = hs(t) % Je.length;
|
|
313
|
+
return Je[n];
|
|
314
314
|
}
|
|
315
|
-
const
|
|
315
|
+
const ce = ({
|
|
316
316
|
id: t,
|
|
317
317
|
image: s,
|
|
318
318
|
size: n = 40,
|
|
@@ -320,7 +320,7 @@ const ie = ({
|
|
|
320
320
|
starred: l = !1,
|
|
321
321
|
shape: d = "squircle"
|
|
322
322
|
}) => {
|
|
323
|
-
const a =
|
|
323
|
+
const a = fs(t), f = n < 32 ? "text-xs" : n < 56 ? "text-sm" : n < 120 ? "text-lg" : "text-4xl", u = d === "circle" ? { borderRadius: "50%" } : {
|
|
324
324
|
borderRadius: "33%",
|
|
325
325
|
"corner-shape": "superellipse(1.3)"
|
|
326
326
|
};
|
|
@@ -338,10 +338,10 @@ const ie = ({
|
|
|
338
338
|
{
|
|
339
339
|
"aria-hidden": "true",
|
|
340
340
|
className: "absolute -left-1.5 -top-1.5 z-10 flex size-5 items-center justify-center rounded-full bg-white shadow-[0_0_0_1px_rgba(0,0,0,0.04),0_4px_8px_rgba(0,0,0,0.06)]",
|
|
341
|
-
children: /* @__PURE__ */ e(
|
|
341
|
+
children: /* @__PURE__ */ e(Pe, { className: "size-3 text-yellow-600", weight: "duotone" })
|
|
342
342
|
}
|
|
343
343
|
),
|
|
344
|
-
/* @__PURE__ */ e("div", { className: "h-full w-full overflow-hidden", style:
|
|
344
|
+
/* @__PURE__ */ e("div", { className: "h-full w-full overflow-hidden", style: u, children: s ? /* @__PURE__ */ e(
|
|
345
345
|
"img",
|
|
346
346
|
{
|
|
347
347
|
src: s,
|
|
@@ -354,7 +354,7 @@ const ie = ({
|
|
|
354
354
|
"aria-hidden": "true",
|
|
355
355
|
className: A(
|
|
356
356
|
"avatar-fallback flex h-full w-full items-center justify-center bg-[#E6E5E3] font-semibold select-none transition-colors",
|
|
357
|
-
|
|
357
|
+
f
|
|
358
358
|
),
|
|
359
359
|
children: a
|
|
360
360
|
}
|
|
@@ -362,7 +362,7 @@ const ie = ({
|
|
|
362
362
|
]
|
|
363
363
|
}
|
|
364
364
|
);
|
|
365
|
-
},
|
|
365
|
+
}, gs = ({ size: t = 15 }) => /* @__PURE__ */ e(
|
|
366
366
|
"svg",
|
|
367
367
|
{
|
|
368
368
|
width: t,
|
|
@@ -379,92 +379,92 @@ const ie = ({
|
|
|
379
379
|
}
|
|
380
380
|
)
|
|
381
381
|
}
|
|
382
|
-
),
|
|
382
|
+
), xs = (t) => {
|
|
383
383
|
var s;
|
|
384
384
|
return ((s = t.metadata) == null ? void 0 : s.custom_type) === "MESSAGE_TIP";
|
|
385
|
-
},
|
|
385
|
+
}, bs = (t) => {
|
|
386
386
|
var s;
|
|
387
387
|
return ((s = t.metadata) == null ? void 0 : s.custom_type) === "MESSAGE_PAID";
|
|
388
|
-
},
|
|
388
|
+
}, Ge = (t) => {
|
|
389
389
|
var s;
|
|
390
390
|
return ((s = t.metadata) == null ? void 0 : s.custom_type) === "MESSAGE_CHATBOT";
|
|
391
|
-
},
|
|
391
|
+
}, Cs = (t) => {
|
|
392
392
|
var s;
|
|
393
393
|
return ((s = t.metadata) == null ? void 0 : s.custom_type) === "MESSAGE_ATTACHMENT";
|
|
394
|
-
},
|
|
394
|
+
}, at = (t) => xs(t) || bs(t), Ns = (t) => {
|
|
395
395
|
var s;
|
|
396
|
-
return
|
|
397
|
-
},
|
|
396
|
+
return at(t) && !((s = t.text) != null && s.trim());
|
|
397
|
+
}, Ae = ({
|
|
398
398
|
message: t,
|
|
399
399
|
standalone: s = !1,
|
|
400
400
|
isMyMessage: n = !1,
|
|
401
401
|
hasAttachment: o = !1
|
|
402
402
|
}) => {
|
|
403
403
|
var C;
|
|
404
|
-
const l =
|
|
404
|
+
const l = at(t), d = Ge(t);
|
|
405
405
|
if (!l && !d)
|
|
406
406
|
return null;
|
|
407
407
|
if (l) {
|
|
408
|
-
const
|
|
409
|
-
if (!
|
|
410
|
-
const
|
|
411
|
-
return /* @__PURE__ */ i("div", { className:
|
|
412
|
-
/* @__PURE__ */ e(
|
|
413
|
-
/* @__PURE__ */ e("span", { children:
|
|
408
|
+
const E = (C = t.metadata) == null ? void 0 : C.amount_text;
|
|
409
|
+
if (!E) return null;
|
|
410
|
+
const h = s ? "message-tip-standalone" : "message-tag message-tag--tip", p = s ? `${E} tip` : `Delivered with ${E} tip`;
|
|
411
|
+
return /* @__PURE__ */ i("div", { className: h, children: [
|
|
412
|
+
/* @__PURE__ */ e(es, { size: s ? 14 : 12 }),
|
|
413
|
+
/* @__PURE__ */ e("span", { children: p })
|
|
414
414
|
] });
|
|
415
415
|
}
|
|
416
|
-
const a = n && o, c = a ? "Sent with AI" : "Sent with DM Agent",
|
|
416
|
+
const a = n && o, c = a ? "Sent with AI" : "Sent with DM Agent", f = [
|
|
417
417
|
"message-chatbot-indicator",
|
|
418
418
|
n ? "message-chatbot-indicator--sender" : "message-chatbot-indicator--receiver",
|
|
419
419
|
a ? "message-chatbot-indicator--attachment" : "message-chatbot-indicator--text"
|
|
420
|
-
].join(" "),
|
|
421
|
-
return /* @__PURE__ */ e("div", { className:
|
|
422
|
-
|
|
423
|
-
|
|
420
|
+
].join(" "), u = /* @__PURE__ */ e("span", { className: "message-chatbot-indicator__label", children: c }), x = /* @__PURE__ */ e("span", { className: "message-chatbot-indicator__icon", children: /* @__PURE__ */ e(gs, { size: a ? 12 : 15 }) });
|
|
421
|
+
return /* @__PURE__ */ e("div", { className: f, "data-testid": "message-chatbot-indicator", children: n && !a ? /* @__PURE__ */ i(he, { children: [
|
|
422
|
+
u,
|
|
423
|
+
x
|
|
424
424
|
] }) : /* @__PURE__ */ i(he, { children: [
|
|
425
|
-
|
|
426
|
-
|
|
425
|
+
x,
|
|
426
|
+
u
|
|
427
427
|
] }) });
|
|
428
|
-
},
|
|
428
|
+
}, rt = F.memo(
|
|
429
429
|
({ channel: t, unread: s }) => {
|
|
430
|
-
var
|
|
431
|
-
const { selectedChannel: n, onChannelSelect: o, debug: l, renderMessagePreview: d } =
|
|
430
|
+
var R, g, m, y;
|
|
431
|
+
const { selectedChannel: n, onChannelSelect: o, debug: l, renderMessagePreview: d } = ds(), a = (n == null ? void 0 : n.id) === (t == null ? void 0 : t.id), c = () => {
|
|
432
432
|
t && o(t);
|
|
433
|
-
},
|
|
434
|
-
const
|
|
435
|
-
!
|
|
436
|
-
},
|
|
437
|
-
(
|
|
438
|
-
var
|
|
439
|
-
return ((
|
|
433
|
+
}, f = (b) => {
|
|
434
|
+
const _ = b.key === "Enter" || b.key === " ", k = b.repeat;
|
|
435
|
+
!_ || k || (b.preventDefault(), c());
|
|
436
|
+
}, x = Object.values(((R = t == null ? void 0 : t.state) == null ? void 0 : R.members) || {}).find(
|
|
437
|
+
(b) => {
|
|
438
|
+
var _, k;
|
|
439
|
+
return ((_ = b.user) == null ? void 0 : _.id) && b.user.id !== ((k = t == null ? void 0 : t._client) == null ? void 0 : k.userID);
|
|
440
440
|
}
|
|
441
|
-
), C = ((
|
|
442
|
-
var
|
|
443
|
-
const
|
|
444
|
-
if (
|
|
445
|
-
for (let
|
|
446
|
-
if (
|
|
441
|
+
), C = ((g = x == null ? void 0 : x.user) == null ? void 0 : g.name) || "Conversation", E = (m = x == null ? void 0 : x.user) == null ? void 0 : m.image, h = (() => {
|
|
442
|
+
var _;
|
|
443
|
+
const b = (_ = t == null ? void 0 : t.state) == null ? void 0 : _.messages;
|
|
444
|
+
if (b != null && b.length) {
|
|
445
|
+
for (let k = b.length - 1; k >= 0; k--)
|
|
446
|
+
if (b[k].type !== "system") return b[k];
|
|
447
447
|
}
|
|
448
|
-
})(),
|
|
449
|
-
var
|
|
450
|
-
if (
|
|
451
|
-
if (((
|
|
452
|
-
const
|
|
453
|
-
return
|
|
454
|
-
})(),
|
|
448
|
+
})(), v = (() => {
|
|
449
|
+
var k, Y;
|
|
450
|
+
if (h != null && h.text) return h.text;
|
|
451
|
+
if (((k = h == null ? void 0 : h.metadata) == null ? void 0 : k.custom_type) === "MESSAGE_TIP") return "💵 Sent a tip";
|
|
452
|
+
const _ = (Y = h == null ? void 0 : h.attachments) == null ? void 0 : Y[0];
|
|
453
|
+
return _ ? _.og_scrape_url ? _.og_scrape_url : _.type === "image" ? "📷 Sent an image" : _.type === "video" ? "🎥 Sent a video" : _.type === "audio" ? "🎵 Sent audio" : _.type === "file" ? "📎 Sent a file" : "📎 Sent an attachment" : "No messages yet";
|
|
454
|
+
})(), r = h != null && h.created_at ? us(new Date(h.created_at)) : "", M = h ? Ge(h) : !1, S = d ? d(h, v) : `${M ? "✨ " : ""}${v}`, N = nt(t), w = s ?? 0;
|
|
455
455
|
return l && console.log("📺 [ChannelList] 📋 CHANNEL PREVIEW RENDER", {
|
|
456
456
|
channelId: t == null ? void 0 : t.id,
|
|
457
457
|
isSelected: a,
|
|
458
458
|
participantName: C,
|
|
459
|
-
unreadCount:
|
|
460
|
-
hasTimestamp: !!
|
|
459
|
+
unreadCount: w,
|
|
460
|
+
hasTimestamp: !!r
|
|
461
461
|
}), /* @__PURE__ */ e(
|
|
462
462
|
"div",
|
|
463
463
|
{
|
|
464
464
|
role: "button",
|
|
465
465
|
tabIndex: 0,
|
|
466
466
|
onClick: c,
|
|
467
|
-
onKeyDown:
|
|
467
|
+
onKeyDown: f,
|
|
468
468
|
className: A(
|
|
469
469
|
"group w-full px-4 py-3 transition-colors text-left max-w-full overflow-hidden focus-ring",
|
|
470
470
|
{
|
|
@@ -474,13 +474,13 @@ const ie = ({
|
|
|
474
474
|
),
|
|
475
475
|
children: /* @__PURE__ */ i("div", { className: "flex items-start gap-3", children: [
|
|
476
476
|
/* @__PURE__ */ e(
|
|
477
|
-
|
|
477
|
+
ce,
|
|
478
478
|
{
|
|
479
|
-
id: ((
|
|
479
|
+
id: ((y = x == null ? void 0 : x.user) == null ? void 0 : y.id) || t.id || "unknown",
|
|
480
480
|
name: C,
|
|
481
|
-
image:
|
|
481
|
+
image: E,
|
|
482
482
|
size: 44,
|
|
483
|
-
starred:
|
|
483
|
+
starred: N,
|
|
484
484
|
className: "[&_.avatar-fallback]:group-hover:bg-[#eeeeee]"
|
|
485
485
|
}
|
|
486
486
|
),
|
|
@@ -494,16 +494,16 @@ const ie = ({
|
|
|
494
494
|
a ? "text-primary" : "text-charcoal"
|
|
495
495
|
),
|
|
496
496
|
children: [
|
|
497
|
-
|
|
497
|
+
N && /* @__PURE__ */ e("span", { className: "sr-only", children: "Starred conversation. " }),
|
|
498
498
|
C
|
|
499
499
|
]
|
|
500
500
|
}
|
|
501
501
|
),
|
|
502
|
-
|
|
502
|
+
r && /* @__PURE__ */ e("span", { className: "text-xs text-stone flex-shrink-0", children: r })
|
|
503
503
|
] }),
|
|
504
504
|
/* @__PURE__ */ i("div", { className: "flex items-center justify-between gap-2 min-w-0", children: [
|
|
505
|
-
/* @__PURE__ */ e("p", { className: "text-xs text-stone flex-1 line-clamp-1", children:
|
|
506
|
-
|
|
505
|
+
/* @__PURE__ */ e("p", { className: "text-xs text-stone flex-1 line-clamp-1", children: S }),
|
|
506
|
+
w > 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: w > 99 ? "99+" : w })
|
|
507
507
|
] })
|
|
508
508
|
] })
|
|
509
509
|
] })
|
|
@@ -511,8 +511,8 @@ const ie = ({
|
|
|
511
511
|
);
|
|
512
512
|
}
|
|
513
513
|
);
|
|
514
|
-
|
|
515
|
-
const
|
|
514
|
+
rt.displayName = "CustomChannelPreview";
|
|
515
|
+
const ys = { last_message_at: -1 }, ot = F.memo(
|
|
516
516
|
({
|
|
517
517
|
onChannelSelect: t,
|
|
518
518
|
selectedChannel: s,
|
|
@@ -521,44 +521,44 @@ const Ns = { last_message_at: -1 }, rt = F.memo(
|
|
|
521
521
|
onMessageNew: l,
|
|
522
522
|
onAddedToChannel: d,
|
|
523
523
|
channelRenderFilterFn: a,
|
|
524
|
-
sort: c =
|
|
525
|
-
className:
|
|
526
|
-
customEmptyStateIndicator:
|
|
527
|
-
renderMessagePreview:
|
|
524
|
+
sort: c = ys,
|
|
525
|
+
className: f,
|
|
526
|
+
customEmptyStateIndicator: u,
|
|
527
|
+
renderMessagePreview: x
|
|
528
528
|
}) => {
|
|
529
529
|
const C = F.useRef(0);
|
|
530
530
|
C.current++;
|
|
531
|
-
const { debug:
|
|
532
|
-
(
|
|
533
|
-
for (const
|
|
534
|
-
|
|
535
|
-
return a ? a(
|
|
531
|
+
const { debug: E = !1 } = Me(), h = F.useCallback(
|
|
532
|
+
(v) => {
|
|
533
|
+
for (const r of v)
|
|
534
|
+
is(r);
|
|
535
|
+
return a ? a(v) : v;
|
|
536
536
|
},
|
|
537
537
|
[a]
|
|
538
538
|
);
|
|
539
|
-
|
|
539
|
+
E && console.log("📺 [ChannelList] 🔄 RENDER START", {
|
|
540
540
|
renderCount: C.current,
|
|
541
541
|
selectedChannelId: s == null ? void 0 : s.id,
|
|
542
542
|
filters: n
|
|
543
543
|
});
|
|
544
|
-
const
|
|
544
|
+
const p = F.useMemo(
|
|
545
545
|
() => ({
|
|
546
546
|
selectedChannel: s,
|
|
547
547
|
onChannelSelect: t,
|
|
548
|
-
debug:
|
|
549
|
-
renderMessagePreview:
|
|
548
|
+
debug: E,
|
|
549
|
+
renderMessagePreview: x
|
|
550
550
|
}),
|
|
551
|
-
[s, t,
|
|
551
|
+
[s, t, E, x]
|
|
552
552
|
);
|
|
553
553
|
return /* @__PURE__ */ e(
|
|
554
554
|
"div",
|
|
555
555
|
{
|
|
556
556
|
className: A(
|
|
557
557
|
"messaging-channel-list h-full flex flex-col min-w-0 overflow-hidden",
|
|
558
|
-
|
|
558
|
+
f
|
|
559
559
|
),
|
|
560
|
-
children: /* @__PURE__ */ e("div", { className: "flex-1 overflow-hidden min-w-0", children: /* @__PURE__ */ e(
|
|
561
|
-
|
|
560
|
+
children: /* @__PURE__ */ e("div", { className: "flex-1 overflow-hidden min-w-0", children: /* @__PURE__ */ e(cs, { value: p, children: /* @__PURE__ */ e(
|
|
561
|
+
Nt,
|
|
562
562
|
{
|
|
563
563
|
filters: n,
|
|
564
564
|
sort: c,
|
|
@@ -566,9 +566,9 @@ const Ns = { last_message_at: -1 }, rt = F.memo(
|
|
|
566
566
|
allowNewMessagesFromUnfilteredChannels: o,
|
|
567
567
|
onMessageNew: l,
|
|
568
568
|
onAddedToChannel: d,
|
|
569
|
-
channelRenderFilterFn:
|
|
570
|
-
Preview:
|
|
571
|
-
EmptyStateIndicator:
|
|
569
|
+
channelRenderFilterFn: h,
|
|
570
|
+
Preview: rt,
|
|
571
|
+
EmptyStateIndicator: u
|
|
572
572
|
},
|
|
573
573
|
`${JSON.stringify(n)}:${JSON.stringify(c)}`
|
|
574
574
|
) }) })
|
|
@@ -576,8 +576,8 @@ const Ns = { last_message_at: -1 }, rt = F.memo(
|
|
|
576
576
|
);
|
|
577
577
|
}
|
|
578
578
|
);
|
|
579
|
-
|
|
580
|
-
const
|
|
579
|
+
ot.displayName = "ChannelList";
|
|
580
|
+
const _e = ({
|
|
581
581
|
variant: t = "default",
|
|
582
582
|
className: s,
|
|
583
583
|
children: n,
|
|
@@ -595,7 +595,7 @@ const we = ({
|
|
|
595
595
|
children: n
|
|
596
596
|
}
|
|
597
597
|
);
|
|
598
|
-
function
|
|
598
|
+
function lt({ label: t, className: s, children: n, ...o }) {
|
|
599
599
|
return /* @__PURE__ */ i(
|
|
600
600
|
"button",
|
|
601
601
|
{
|
|
@@ -616,8 +616,8 @@ function ot({ label: t, className: s, children: n, ...o }) {
|
|
|
616
616
|
}
|
|
617
617
|
);
|
|
618
618
|
}
|
|
619
|
-
function
|
|
620
|
-
return /* @__PURE__ */ e(
|
|
619
|
+
function it({ onClick: t }) {
|
|
620
|
+
return /* @__PURE__ */ e(lt, { label: "Close", onClick: t, className: "p-1", children: /* @__PURE__ */ e(Be, { className: "h-5 w-5 text-stone", weight: "bold" }) });
|
|
621
621
|
}
|
|
622
622
|
const ps = ({
|
|
623
623
|
dialogRef: t,
|
|
@@ -628,80 +628,80 @@ const ps = ({
|
|
|
628
628
|
onLeaveConversation: d,
|
|
629
629
|
onBlockParticipant: a,
|
|
630
630
|
showDeleteConversation: c = !0,
|
|
631
|
-
onDeleteConversationClick:
|
|
632
|
-
onBlockParticipantClick:
|
|
633
|
-
onReportParticipantClick:
|
|
631
|
+
onDeleteConversationClick: f,
|
|
632
|
+
onBlockParticipantClick: u,
|
|
633
|
+
onReportParticipantClick: x,
|
|
634
634
|
customProfileContent: C,
|
|
635
|
-
customChannelActions:
|
|
635
|
+
customChannelActions: E
|
|
636
636
|
}) => {
|
|
637
|
-
var Z, J, P,
|
|
638
|
-
const { service:
|
|
639
|
-
var
|
|
640
|
-
if (!(!
|
|
637
|
+
var te, Z, J, P, W, z, de;
|
|
638
|
+
const { service: h, debug: p } = Me(), [v, r] = T(!1), [M, S] = T(!1), [N, w] = T(!1), R = U(async () => {
|
|
639
|
+
var O;
|
|
640
|
+
if (!(!h || !((O = n == null ? void 0 : n.user) != null && O.id)))
|
|
641
641
|
try {
|
|
642
|
-
const
|
|
643
|
-
(
|
|
644
|
-
var
|
|
645
|
-
return
|
|
642
|
+
const H = (await h.getBlockedUsers()).some(
|
|
643
|
+
(K) => {
|
|
644
|
+
var se;
|
|
645
|
+
return K.blocked_user_id === ((se = n == null ? void 0 : n.user) == null ? void 0 : se.id);
|
|
646
646
|
}
|
|
647
647
|
);
|
|
648
|
-
|
|
649
|
-
} catch (
|
|
648
|
+
r(H);
|
|
649
|
+
} catch (L) {
|
|
650
650
|
console.error(
|
|
651
651
|
"[ChannelInfoDialog] Failed to check blocked status:",
|
|
652
|
-
|
|
652
|
+
L
|
|
653
653
|
);
|
|
654
654
|
}
|
|
655
|
-
}, [
|
|
655
|
+
}, [h, (te = n == null ? void 0 : n.user) == null ? void 0 : te.id]);
|
|
656
656
|
X(() => {
|
|
657
|
-
|
|
658
|
-
}, [
|
|
659
|
-
const
|
|
660
|
-
var
|
|
657
|
+
R();
|
|
658
|
+
}, [R]);
|
|
659
|
+
const g = async () => {
|
|
660
|
+
var O;
|
|
661
661
|
if (!M) {
|
|
662
|
-
|
|
662
|
+
f == null || f(), p && console.log("[ChannelInfoDialog] Leave conversation", o.cid), S(!0);
|
|
663
663
|
try {
|
|
664
|
-
const
|
|
665
|
-
await o.hide(
|
|
666
|
-
} catch (
|
|
667
|
-
console.error("[ChannelInfoDialog] Failed to leave conversation",
|
|
664
|
+
const L = ((O = o._client) == null ? void 0 : O.userID) ?? null;
|
|
665
|
+
await o.hide(L, !1), d && await d(o), s();
|
|
666
|
+
} catch (L) {
|
|
667
|
+
console.error("[ChannelInfoDialog] Failed to leave conversation", L);
|
|
668
668
|
} finally {
|
|
669
|
-
|
|
669
|
+
S(!1);
|
|
670
670
|
}
|
|
671
671
|
}
|
|
672
|
-
},
|
|
673
|
-
var
|
|
674
|
-
if (!(
|
|
675
|
-
|
|
672
|
+
}, m = async () => {
|
|
673
|
+
var O, L, H;
|
|
674
|
+
if (!(N || !h)) {
|
|
675
|
+
u == null || u(), p && console.log("[ChannelInfoDialog] Block member", (O = n == null ? void 0 : n.user) == null ? void 0 : O.id), w(!0);
|
|
676
676
|
try {
|
|
677
|
-
await
|
|
678
|
-
} catch (
|
|
679
|
-
console.error("[ChannelInfoDialog] Failed to block member",
|
|
677
|
+
await h.blockUser((L = n == null ? void 0 : n.user) == null ? void 0 : L.id), a && await a((H = n == null ? void 0 : n.user) == null ? void 0 : H.id), s();
|
|
678
|
+
} catch (K) {
|
|
679
|
+
console.error("[ChannelInfoDialog] Failed to block member", K);
|
|
680
680
|
} finally {
|
|
681
|
-
|
|
681
|
+
w(!1);
|
|
682
682
|
}
|
|
683
683
|
}
|
|
684
|
-
},
|
|
685
|
-
var
|
|
686
|
-
if (!(
|
|
687
|
-
|
|
684
|
+
}, y = async () => {
|
|
685
|
+
var O, L, H;
|
|
686
|
+
if (!(N || !h)) {
|
|
687
|
+
u == null || u(), p && console.log("[ChannelInfoDialog] Unblock member", (O = n == null ? void 0 : n.user) == null ? void 0 : O.id), w(!0);
|
|
688
688
|
try {
|
|
689
|
-
await
|
|
690
|
-
} catch (
|
|
691
|
-
console.error("[ChannelInfoDialog] Failed to unblock member",
|
|
689
|
+
await h.unBlockUser((L = n == null ? void 0 : n.user) == null ? void 0 : L.id), a && await a((H = n == null ? void 0 : n.user) == null ? void 0 : H.id), s();
|
|
690
|
+
} catch (K) {
|
|
691
|
+
console.error("[ChannelInfoDialog] Failed to unblock member", K);
|
|
692
692
|
} finally {
|
|
693
|
-
|
|
693
|
+
w(!1);
|
|
694
694
|
}
|
|
695
695
|
}
|
|
696
|
-
},
|
|
697
|
-
|
|
696
|
+
}, b = () => {
|
|
697
|
+
x == null || x(), s(), window.open(
|
|
698
698
|
"https://linktr.ee/s/about/trust-center/report",
|
|
699
699
|
"_blank",
|
|
700
700
|
"noopener,noreferrer"
|
|
701
701
|
);
|
|
702
702
|
};
|
|
703
703
|
if (!n) return null;
|
|
704
|
-
const
|
|
704
|
+
const _ = ((Z = n.user) == null ? void 0 : Z.name) || ((J = n.user) == null ? void 0 : J.id) || "Unknown member", k = (P = n.user) == null ? void 0 : P.image, Y = (W = n.user) == null ? void 0 : W.email, G = (z = n.user) == null ? void 0 : z.username, D = Y || (G ? `linktr.ee/${G}` : void 0), j = ((de = n.user) == null ? void 0 : de.id) || "unknown";
|
|
705
705
|
return (
|
|
706
706
|
// eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-noninteractive-element-interactions
|
|
707
707
|
/* @__PURE__ */ e(
|
|
@@ -710,13 +710,13 @@ const ps = ({
|
|
|
710
710
|
ref: t,
|
|
711
711
|
className: "mes-dialog group",
|
|
712
712
|
onClose: s,
|
|
713
|
-
onClick: (
|
|
714
|
-
|
|
713
|
+
onClick: (O) => {
|
|
714
|
+
O.target === t.current && s();
|
|
715
715
|
},
|
|
716
716
|
children: /* @__PURE__ */ i("div", { className: "ml-auto flex h-full w-full flex-col bg-white shadow-none transition-shadow duration-200 group-open:shadow-max-elevation-light", children: [
|
|
717
717
|
/* @__PURE__ */ i("div", { className: "flex items-center justify-between border-b border-sand px-4 py-3", children: [
|
|
718
718
|
/* @__PURE__ */ e("h2", { className: "text-base font-semibold text-charcoal", children: "Chat info" }),
|
|
719
|
-
/* @__PURE__ */ e(
|
|
719
|
+
/* @__PURE__ */ e(it, { onClick: s })
|
|
720
720
|
] }),
|
|
721
721
|
/* @__PURE__ */ i("div", { className: "flex-1 px-2 overflow-y-auto w-full", children: [
|
|
722
722
|
/* @__PURE__ */ e(
|
|
@@ -726,18 +726,18 @@ const ps = ({
|
|
|
726
726
|
style: { backgroundColor: "#FBFAF9" },
|
|
727
727
|
children: /* @__PURE__ */ i("div", { className: "flex items-center gap-3 w-full", children: [
|
|
728
728
|
/* @__PURE__ */ e(
|
|
729
|
-
|
|
729
|
+
ce,
|
|
730
730
|
{
|
|
731
|
-
id:
|
|
732
|
-
name:
|
|
733
|
-
image:
|
|
731
|
+
id: j,
|
|
732
|
+
name: _,
|
|
733
|
+
image: k,
|
|
734
734
|
size: 88,
|
|
735
735
|
shape: "circle"
|
|
736
736
|
}
|
|
737
737
|
),
|
|
738
738
|
/* @__PURE__ */ i("div", { className: "flex flex-col min-w-0 flex-1", children: [
|
|
739
|
-
/* @__PURE__ */ e("p", { className: "truncate text-base font-semibold text-charcoal", children:
|
|
740
|
-
|
|
739
|
+
/* @__PURE__ */ e("p", { className: "truncate text-base font-semibold text-charcoal", children: _ }),
|
|
740
|
+
D && /* @__PURE__ */ e("p", { className: "truncate text-sm text-[#00000055]", children: D }),
|
|
741
741
|
l && !C && /* @__PURE__ */ e(
|
|
742
742
|
"span",
|
|
743
743
|
{
|
|
@@ -759,65 +759,65 @@ const ps = ({
|
|
|
759
759
|
),
|
|
760
760
|
/* @__PURE__ */ i("ul", { className: "flex flex-col gap-2 mt-2", children: [
|
|
761
761
|
c && /* @__PURE__ */ e("li", { children: /* @__PURE__ */ i(
|
|
762
|
-
|
|
762
|
+
_e,
|
|
763
763
|
{
|
|
764
|
-
onClick:
|
|
764
|
+
onClick: g,
|
|
765
765
|
disabled: M,
|
|
766
766
|
"aria-busy": M,
|
|
767
767
|
children: [
|
|
768
|
-
M ? /* @__PURE__ */ e(
|
|
768
|
+
M ? /* @__PURE__ */ e(Ee, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(ts, { className: "h-5 w-5" }),
|
|
769
769
|
/* @__PURE__ */ e("span", { children: "Delete Conversation" })
|
|
770
770
|
]
|
|
771
771
|
}
|
|
772
772
|
) }),
|
|
773
|
-
/* @__PURE__ */ e("li", { children:
|
|
774
|
-
|
|
773
|
+
/* @__PURE__ */ e("li", { children: v ? /* @__PURE__ */ i(
|
|
774
|
+
_e,
|
|
775
775
|
{
|
|
776
|
-
onClick:
|
|
777
|
-
disabled:
|
|
778
|
-
"aria-busy":
|
|
776
|
+
onClick: y,
|
|
777
|
+
disabled: N,
|
|
778
|
+
"aria-busy": N,
|
|
779
779
|
children: [
|
|
780
|
-
|
|
780
|
+
N ? /* @__PURE__ */ e(Ee, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(Ve, { className: "h-5 w-5" }),
|
|
781
781
|
/* @__PURE__ */ e("span", { children: "Unblock" })
|
|
782
782
|
]
|
|
783
783
|
}
|
|
784
784
|
) : /* @__PURE__ */ i(
|
|
785
|
-
|
|
785
|
+
_e,
|
|
786
786
|
{
|
|
787
|
-
onClick:
|
|
788
|
-
disabled:
|
|
789
|
-
"aria-busy":
|
|
787
|
+
onClick: m,
|
|
788
|
+
disabled: N,
|
|
789
|
+
"aria-busy": N,
|
|
790
790
|
children: [
|
|
791
|
-
|
|
791
|
+
N ? /* @__PURE__ */ e(Ee, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(Ve, { className: "h-5 w-5" }),
|
|
792
792
|
/* @__PURE__ */ e("span", { children: "Block" })
|
|
793
793
|
]
|
|
794
794
|
}
|
|
795
795
|
) }),
|
|
796
|
-
/* @__PURE__ */ e("li", { children: /* @__PURE__ */ i(
|
|
797
|
-
/* @__PURE__ */ e(
|
|
796
|
+
/* @__PURE__ */ e("li", { children: /* @__PURE__ */ i(_e, { variant: "danger", onClick: b, children: [
|
|
797
|
+
/* @__PURE__ */ e(ss, { className: "h-5 w-5" }),
|
|
798
798
|
/* @__PURE__ */ e("span", { children: "Report" })
|
|
799
799
|
] }) }),
|
|
800
|
-
|
|
800
|
+
E
|
|
801
801
|
] })
|
|
802
802
|
] })
|
|
803
803
|
] })
|
|
804
804
|
}
|
|
805
805
|
)
|
|
806
806
|
);
|
|
807
|
-
},
|
|
808
|
-
function vs(t) {
|
|
809
|
-
return t != null && t.length ? t.some((s) => s.type === Fe) ? "down" : t.some((s) => s.type === Pe) ? "up" : null : null;
|
|
810
|
-
}
|
|
807
|
+
}, vs = (t) => /* @__PURE__ */ e(yt, { ...t, position: "center" }), Fe = "vote_up", Oe = "vote_down";
|
|
811
808
|
function ws(t) {
|
|
812
|
-
|
|
813
|
-
|
|
809
|
+
return t != null && t.length ? t.some((s) => s.type === Oe) ? "down" : t.some((s) => s.type === Fe) ? "up" : null : null;
|
|
810
|
+
}
|
|
811
|
+
function _s(t) {
|
|
812
|
+
const { channel: s } = ke(), { client: n } = Qe("useMessageVote"), o = Ue(
|
|
813
|
+
() => ws(t.own_reactions),
|
|
814
814
|
[t.own_reactions]
|
|
815
815
|
), l = U(async () => {
|
|
816
816
|
if (n != null && n.userID)
|
|
817
817
|
try {
|
|
818
|
-
o === "up" ? await s.deleteReaction(t.id,
|
|
818
|
+
o === "up" ? await s.deleteReaction(t.id, Fe) : await s.sendReaction(
|
|
819
819
|
t.id,
|
|
820
|
-
{ type:
|
|
820
|
+
{ type: Fe },
|
|
821
821
|
{ enforce_unique: !0, skip_push: !0 }
|
|
822
822
|
);
|
|
823
823
|
} catch {
|
|
@@ -825,9 +825,9 @@ function ws(t) {
|
|
|
825
825
|
}, [s, n == null ? void 0 : n.userID, t.id, o]), d = U(async () => {
|
|
826
826
|
if (n != null && n.userID)
|
|
827
827
|
try {
|
|
828
|
-
o === "down" ? await s.deleteReaction(t.id,
|
|
828
|
+
o === "down" ? await s.deleteReaction(t.id, Oe) : await s.sendReaction(
|
|
829
829
|
t.id,
|
|
830
|
-
{ type:
|
|
830
|
+
{ type: Oe },
|
|
831
831
|
{ enforce_unique: !0, skip_push: !0 }
|
|
832
832
|
);
|
|
833
833
|
} catch {
|
|
@@ -835,13 +835,13 @@ function ws(t) {
|
|
|
835
835
|
}, [s, n == null ? void 0 : n.userID, t.id, o]);
|
|
836
836
|
return { selected: o, voteUp: l, voteDown: d };
|
|
837
837
|
}
|
|
838
|
-
const
|
|
838
|
+
const Es = F.lazy(() => import("./Creator-DGe3CQ_j.js")), Ss = F.lazy(() => import("./Visitor-DyJTWB2_.js")), Xe = () => /* @__PURE__ */ e(
|
|
839
839
|
"div",
|
|
840
840
|
{
|
|
841
|
-
className: "w-[280px] min-h-[200px] animate-pulse rounded-[24px] bg-black/[0.06] shadow-[
|
|
841
|
+
className: "w-[280px] min-h-[200px] animate-pulse rounded-[24px] bg-black/[0.06] shadow-[0_0_0_1px_rgba(0,0,0,0.04),0_4px_8px_rgba(0,0,0,0.06)]",
|
|
842
842
|
"aria-hidden": !0
|
|
843
843
|
}
|
|
844
|
-
),
|
|
844
|
+
), Is = (t) => t.onUnlockClick != null || t.onDownloadClick != null || t.onUnlocked != null ? /* @__PURE__ */ e(ze, { fallback: /* @__PURE__ */ e(Xe, {}), children: /* @__PURE__ */ e(Ss, { ...t }) }) : /* @__PURE__ */ e(ze, { fallback: /* @__PURE__ */ e(Xe, {}), children: /* @__PURE__ */ e(Es, { ...t }) }), ks = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", children: /* @__PURE__ */ e(
|
|
845
845
|
"path",
|
|
846
846
|
{
|
|
847
847
|
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",
|
|
@@ -861,7 +861,7 @@ const _s = F.lazy(() => import("./Creator-77XnrIxc.js")), Es = F.lazy(() => impo
|
|
|
861
861
|
strokeLinejoin: "round",
|
|
862
862
|
fill: t ? "currentColor" : "none"
|
|
863
863
|
}
|
|
864
|
-
) }),
|
|
864
|
+
) }), Ts = ({
|
|
865
865
|
selected: t,
|
|
866
866
|
onVoteUp: s,
|
|
867
867
|
onVoteDown: n
|
|
@@ -874,7 +874,7 @@ const _s = F.lazy(() => import("./Creator-77XnrIxc.js")), Es = F.lazy(() => impo
|
|
|
874
874
|
onClick: s,
|
|
875
875
|
"aria-label": "Helpful",
|
|
876
876
|
"aria-pressed": t === "up",
|
|
877
|
-
children: /* @__PURE__ */ e(
|
|
877
|
+
children: /* @__PURE__ */ e(ks, { filled: t === "up" })
|
|
878
878
|
}
|
|
879
879
|
),
|
|
880
880
|
/* @__PURE__ */ e(
|
|
@@ -888,91 +888,92 @@ const _s = F.lazy(() => import("./Creator-77XnrIxc.js")), Es = F.lazy(() => impo
|
|
|
888
888
|
children: /* @__PURE__ */ e(Ms, { filled: t === "down" })
|
|
889
889
|
}
|
|
890
890
|
)
|
|
891
|
-
] }),
|
|
892
|
-
var ge,
|
|
891
|
+
] }), Ds = (t) => {
|
|
892
|
+
var ge, be, Ce, ie, Q, Ne, ye, pe;
|
|
893
893
|
const {
|
|
894
894
|
additionalMessageInputProps: s,
|
|
895
895
|
chatbotVotingEnabled: n,
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
896
|
+
onAttachmentUnlockClick: o,
|
|
897
|
+
onAttachmentDownloadClick: l,
|
|
898
|
+
onAttachmentUnlocked: d,
|
|
899
|
+
editing: a,
|
|
900
|
+
endOfGroup: c,
|
|
901
|
+
firstOfGroup: f,
|
|
902
|
+
groupedByUser: u,
|
|
903
|
+
handleAction: x,
|
|
904
|
+
handleOpenThread: C,
|
|
905
|
+
handleRetry: E,
|
|
906
|
+
highlighted: h,
|
|
907
|
+
isMessageAIGenerated: p,
|
|
907
908
|
isMyMessage: v,
|
|
908
909
|
message: r,
|
|
909
|
-
renderText:
|
|
910
|
-
threadList:
|
|
911
|
-
} = t, { client: N } =
|
|
912
|
-
Attachment:
|
|
913
|
-
EditMessageModal:
|
|
914
|
-
MessageBlocked: G =
|
|
915
|
-
MessageBouncePrompt:
|
|
916
|
-
MessageDeleted: j =
|
|
917
|
-
MessageIsThreadReplyInChannelButtonIndicator:
|
|
918
|
-
MessageRepliesCountButton: Z =
|
|
919
|
-
ReminderNotification: J =
|
|
920
|
-
StreamedMessageText: P =
|
|
921
|
-
PinIndicator:
|
|
922
|
-
} =
|
|
923
|
-
() =>
|
|
924
|
-
[
|
|
925
|
-
),
|
|
910
|
+
renderText: M,
|
|
911
|
+
threadList: S
|
|
912
|
+
} = t, { client: N } = Qe("CustomMessage"), { channel: w } = ke("CustomMessage"), [R, g] = T(!1), m = vt(r.id), { selected: y, voteUp: b, voteDown: _ } = _s(r), {
|
|
913
|
+
Attachment: k = _t,
|
|
914
|
+
EditMessageModal: Y = Et,
|
|
915
|
+
MessageBlocked: G = St,
|
|
916
|
+
MessageBouncePrompt: D = It,
|
|
917
|
+
MessageDeleted: j = kt,
|
|
918
|
+
MessageIsThreadReplyInChannelButtonIndicator: te = Mt,
|
|
919
|
+
MessageRepliesCountButton: Z = Tt,
|
|
920
|
+
ReminderNotification: J = Dt,
|
|
921
|
+
StreamedMessageText: P = Rt,
|
|
922
|
+
PinIndicator: W
|
|
923
|
+
} = wt("CustomMessage"), z = At(r), de = Lt(r), O = Ue(
|
|
924
|
+
() => p == null ? void 0 : p(r),
|
|
925
|
+
[p, r]
|
|
926
|
+
), L = Ue(
|
|
926
927
|
() => !r.shared_location && !r.attachments ? [] : r.shared_location ? [r.shared_location, ...r.attachments ?? []] : r.attachments,
|
|
927
928
|
[r]
|
|
928
929
|
);
|
|
929
|
-
if (
|
|
930
|
+
if (Ut(r))
|
|
930
931
|
return null;
|
|
931
932
|
if (r.deleted_at || r.type === "deleted")
|
|
932
933
|
return /* @__PURE__ */ e(j, { message: r });
|
|
933
|
-
if (
|
|
934
|
+
if (Pt(r))
|
|
934
935
|
return /* @__PURE__ */ e(G, {});
|
|
935
|
-
const
|
|
936
|
-
let
|
|
937
|
-
|
|
938
|
-
const
|
|
936
|
+
const H = !S && !!r.reply_count, K = !S && r.show_in_channel && r.parent_id, se = r.status === "failed" && ((ge = r.error) == null ? void 0 : ge.status) !== 403, xe = Ft(r);
|
|
937
|
+
let ne;
|
|
938
|
+
se ? ne = () => E(r) : xe && (ne = () => g(!0));
|
|
939
|
+
const re = v(), je = A(
|
|
939
940
|
"str-chat__message str-chat__message-simple",
|
|
940
941
|
`str-chat__message--${r.type}`,
|
|
941
942
|
`str-chat__message--${r.status}`,
|
|
942
|
-
|
|
943
|
+
re ? "str-chat__message--me str-chat__message-simple--me" : "str-chat__message--other",
|
|
943
944
|
r.text ? "str-chat__message--has-text" : "has-no-text",
|
|
944
945
|
{
|
|
945
946
|
"str-chat__message--has-attachment": z,
|
|
946
|
-
"str-chat__message--highlighted":
|
|
947
|
+
"str-chat__message--highlighted": h,
|
|
947
948
|
"str-chat__message--pinned pinned-message": r.pinned,
|
|
948
|
-
"str-chat__message--with-reactions":
|
|
949
|
-
"str-chat__message-send-can-be-retried": (r == null ? void 0 : r.status) === "failed" && ((
|
|
950
|
-
"str-chat__message-with-thread-link":
|
|
951
|
-
"str-chat__virtual-message__wrapper--end":
|
|
952
|
-
"str-chat__virtual-message__wrapper--first":
|
|
953
|
-
"str-chat__virtual-message__wrapper--group":
|
|
949
|
+
"str-chat__message--with-reactions": de,
|
|
950
|
+
"str-chat__message-send-can-be-retried": (r == null ? void 0 : r.status) === "failed" && ((be = r == null ? void 0 : r.error) == null ? void 0 : be.status) !== 403,
|
|
951
|
+
"str-chat__message-with-thread-link": H || K,
|
|
952
|
+
"str-chat__virtual-message__wrapper--end": c,
|
|
953
|
+
"str-chat__virtual-message__wrapper--first": f,
|
|
954
|
+
"str-chat__virtual-message__wrapper--group": u
|
|
954
955
|
}
|
|
955
|
-
), q = r.poll_id && N.polls.fromState(r.poll_id), me =
|
|
956
|
+
), q = r.poll_id && N.polls.fromState(r.poll_id), me = Ns(r), oe = Ge(r), le = Cs(r), ae = !!(L != null && L.length && !r.quoted_message), fe = oe && re && ae;
|
|
956
957
|
return /* @__PURE__ */ i(he, { children: [
|
|
957
|
-
|
|
958
|
-
|
|
958
|
+
a && /* @__PURE__ */ e(
|
|
959
|
+
Y,
|
|
959
960
|
{
|
|
960
961
|
additionalMessageInputProps: s
|
|
961
962
|
}
|
|
962
963
|
),
|
|
963
|
-
|
|
964
|
-
|
|
964
|
+
R && /* @__PURE__ */ e(
|
|
965
|
+
Ot,
|
|
965
966
|
{
|
|
966
|
-
MessageBouncePrompt:
|
|
967
|
-
onClose: () =>
|
|
968
|
-
open:
|
|
967
|
+
MessageBouncePrompt: D,
|
|
968
|
+
onClose: () => g(!1),
|
|
969
|
+
open: R
|
|
969
970
|
}
|
|
970
971
|
),
|
|
971
|
-
/* @__PURE__ */ i("div", { className:
|
|
972
|
-
|
|
973
|
-
!!
|
|
972
|
+
/* @__PURE__ */ i("div", { className: je, children: [
|
|
973
|
+
W && /* @__PURE__ */ e(W, {}),
|
|
974
|
+
!!m && /* @__PURE__ */ e(J, { reminder: m }),
|
|
974
975
|
r.user && /* @__PURE__ */ e(
|
|
975
|
-
|
|
976
|
+
ce,
|
|
976
977
|
{
|
|
977
978
|
className: "str-chat__avatar str-chat__message-sender-avatar",
|
|
978
979
|
id: r.user.id,
|
|
@@ -984,104 +985,105 @@ const _s = F.lazy(() => import("./Creator-77XnrIxc.js")), Es = F.lazy(() => impo
|
|
|
984
985
|
"div",
|
|
985
986
|
{
|
|
986
987
|
className: A("str-chat__message-inner", {
|
|
987
|
-
"str-chat__simple-message--error-failed":
|
|
988
|
+
"str-chat__simple-message--error-failed": se || xe
|
|
988
989
|
}),
|
|
989
990
|
"data-testid": "message-inner",
|
|
990
|
-
onClick:
|
|
991
|
-
onKeyDown:
|
|
992
|
-
role:
|
|
993
|
-
tabIndex:
|
|
991
|
+
onClick: ne,
|
|
992
|
+
onKeyDown: ne,
|
|
993
|
+
role: ne ? "button" : void 0,
|
|
994
|
+
tabIndex: ne ? 0 : void 0,
|
|
994
995
|
style: {
|
|
995
996
|
// Force margins to 0 to prevent hover layout shift
|
|
996
997
|
// Stream Chat CSS sets margin-inline-end/start to 78px, then 0 on hover
|
|
997
998
|
marginInlineEnd: 0,
|
|
998
999
|
marginInlineStart: 0
|
|
999
1000
|
},
|
|
1000
|
-
children:
|
|
1001
|
+
children: le ? /* @__PURE__ */ i("div", { className: A("flex flex-col gap-1", re ? "items-end" : "items-start"), children: [
|
|
1001
1002
|
/* @__PURE__ */ e(
|
|
1002
|
-
|
|
1003
|
+
Is,
|
|
1003
1004
|
{
|
|
1004
|
-
title: (
|
|
1005
|
-
mimeType: (
|
|
1006
|
-
|
|
1007
|
-
amountText: (
|
|
1008
|
-
detail: (
|
|
1005
|
+
title: (Ce = r.metadata) == null ? void 0 : Ce.attachment_title,
|
|
1006
|
+
mimeType: ((ie = r.metadata) == null ? void 0 : ie.attachment_mime_type) ?? "application/octet-stream",
|
|
1007
|
+
thumbnailUrl: (Q = r.metadata) == null ? void 0 : Q.attachment_thumbnail,
|
|
1008
|
+
amountText: (Ne = r.metadata) == null ? void 0 : Ne.amount_text,
|
|
1009
|
+
detail: (ye = r.metadata) == null ? void 0 : ye.attachment_detail,
|
|
1009
1010
|
paymentStatus: (pe = r.metadata) == null ? void 0 : pe.payment_status,
|
|
1010
|
-
|
|
1011
|
-
|
|
1011
|
+
onUnlockClick: o ? () => o(r, w) : void 0,
|
|
1012
|
+
onDownloadClick: l ? () => l(r, w) : void 0,
|
|
1013
|
+
onUnlocked: d ? () => d(r, w) : void 0
|
|
1012
1014
|
}
|
|
1013
1015
|
),
|
|
1014
|
-
r.text && /* @__PURE__ */ e("div", { className: "str-chat__message-bubble-wrapper", children: /* @__PURE__ */ e("div", { className: "str-chat__message-bubble", children: /* @__PURE__ */ e(
|
|
1016
|
+
r.text && /* @__PURE__ */ e("div", { className: "str-chat__message-bubble-wrapper", children: /* @__PURE__ */ e("div", { className: "str-chat__message-bubble", children: /* @__PURE__ */ e(He, { message: r, renderText: M }) }) })
|
|
1015
1017
|
] }) : me ? (
|
|
1016
1018
|
/* Tip-only messages render as a standalone bubble */
|
|
1017
|
-
/* @__PURE__ */ e(
|
|
1019
|
+
/* @__PURE__ */ e(Ae, { message: r, standalone: !0 })
|
|
1018
1020
|
) : /* @__PURE__ */ i("div", { className: "str-chat__message-bubble-wrapper", children: [
|
|
1019
1021
|
/* @__PURE__ */ i("div", { className: "str-chat__message-bubble", children: [
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
+
oe && !fe && /* @__PURE__ */ e(
|
|
1023
|
+
Ae,
|
|
1022
1024
|
{
|
|
1023
1025
|
message: r,
|
|
1024
|
-
hasAttachment:
|
|
1025
|
-
isMyMessage:
|
|
1026
|
+
hasAttachment: ae,
|
|
1027
|
+
isMyMessage: re
|
|
1026
1028
|
}
|
|
1027
1029
|
),
|
|
1028
|
-
q && /* @__PURE__ */ e(
|
|
1029
|
-
|
|
1030
|
-
|
|
1030
|
+
q && /* @__PURE__ */ e(Bt, { poll: q }),
|
|
1031
|
+
L != null && L.length && !r.quoted_message ? /* @__PURE__ */ e(
|
|
1032
|
+
k,
|
|
1031
1033
|
{
|
|
1032
|
-
actionHandler:
|
|
1033
|
-
attachments:
|
|
1034
|
+
actionHandler: x,
|
|
1035
|
+
attachments: L
|
|
1034
1036
|
}
|
|
1035
1037
|
) : null,
|
|
1036
|
-
|
|
1038
|
+
O ? /* @__PURE__ */ e(
|
|
1037
1039
|
P,
|
|
1038
1040
|
{
|
|
1039
1041
|
message: r,
|
|
1040
|
-
renderText:
|
|
1042
|
+
renderText: M
|
|
1041
1043
|
}
|
|
1042
|
-
) : /* @__PURE__ */ e(
|
|
1043
|
-
/* @__PURE__ */ e(
|
|
1044
|
+
) : /* @__PURE__ */ e(He, { message: r, renderText: M }),
|
|
1045
|
+
/* @__PURE__ */ e(Gt, {})
|
|
1044
1046
|
] }),
|
|
1045
|
-
(!
|
|
1046
|
-
|
|
1047
|
+
(!oe || fe) && /* @__PURE__ */ e(
|
|
1048
|
+
Ae,
|
|
1047
1049
|
{
|
|
1048
1050
|
message: r,
|
|
1049
|
-
hasAttachment:
|
|
1050
|
-
isMyMessage:
|
|
1051
|
+
hasAttachment: ae,
|
|
1052
|
+
isMyMessage: re
|
|
1051
1053
|
}
|
|
1052
1054
|
),
|
|
1053
|
-
n &&
|
|
1054
|
-
|
|
1055
|
+
n && oe && /* @__PURE__ */ e(
|
|
1056
|
+
Ts,
|
|
1055
1057
|
{
|
|
1056
|
-
selected:
|
|
1057
|
-
onVoteUp:
|
|
1058
|
-
onVoteDown:
|
|
1058
|
+
selected: y,
|
|
1059
|
+
onVoteUp: b,
|
|
1060
|
+
onVoteDown: _
|
|
1059
1061
|
}
|
|
1060
1062
|
)
|
|
1061
1063
|
] })
|
|
1062
1064
|
}
|
|
1063
1065
|
),
|
|
1064
|
-
|
|
1066
|
+
H && /* @__PURE__ */ e(
|
|
1065
1067
|
Z,
|
|
1066
1068
|
{
|
|
1067
|
-
onClick:
|
|
1069
|
+
onClick: C,
|
|
1068
1070
|
reply_count: r.reply_count
|
|
1069
1071
|
}
|
|
1070
1072
|
),
|
|
1071
|
-
|
|
1073
|
+
K && /* @__PURE__ */ e(te, {})
|
|
1072
1074
|
] }, r.id)
|
|
1073
1075
|
] });
|
|
1074
|
-
},
|
|
1075
|
-
|
|
1076
|
-
(t, s) => t.chatbotVotingEnabled !== s.chatbotVotingEnabled || t.
|
|
1077
|
-
),
|
|
1078
|
-
const s =
|
|
1079
|
-
return /* @__PURE__ */ e(
|
|
1080
|
-
},
|
|
1076
|
+
}, Rs = F.memo(
|
|
1077
|
+
Ds,
|
|
1078
|
+
(t, s) => t.chatbotVotingEnabled !== s.chatbotVotingEnabled || t.onAttachmentUnlockClick !== s.onAttachmentUnlockClick || t.onAttachmentDownloadClick !== s.onAttachmentDownloadClick || t.onAttachmentUnlocked !== s.onAttachmentUnlocked ? !1 : pt(t, s)
|
|
1079
|
+
), As = (t) => {
|
|
1080
|
+
const s = et("CustomMessage");
|
|
1081
|
+
return /* @__PURE__ */ e(Rs, { ...s, ...t });
|
|
1082
|
+
}, Ls = (t) => ({
|
|
1081
1083
|
linkPreviews: Array.from(t.previews.values()).filter(
|
|
1082
|
-
(s) =>
|
|
1084
|
+
(s) => Ze.previewIsLoaded(s) || Ze.previewIsLoading(s)
|
|
1083
1085
|
)
|
|
1084
|
-
}),
|
|
1086
|
+
}), Us = ({
|
|
1085
1087
|
link: t,
|
|
1086
1088
|
onDismiss: s
|
|
1087
1089
|
}) => {
|
|
@@ -1111,7 +1113,7 @@ const _s = F.lazy(() => import("./Creator-77XnrIxc.js")), Es = F.lazy(() => impo
|
|
|
1111
1113
|
},
|
|
1112
1114
|
className: "absolute right-4 top-4 flex size-6 items-center justify-center rounded-full border border-white/40 bg-white/70 backdrop-blur-2xl focus-ring",
|
|
1113
1115
|
"aria-label": "Close link preview",
|
|
1114
|
-
children: /* @__PURE__ */ e(
|
|
1116
|
+
children: /* @__PURE__ */ e(Be, { className: "size-4 text-black/90" })
|
|
1115
1117
|
}
|
|
1116
1118
|
),
|
|
1117
1119
|
/* @__PURE__ */ i("div", { className: "p-2", children: [
|
|
@@ -1121,32 +1123,32 @@ const _s = F.lazy(() => import("./Creator-77XnrIxc.js")), Es = F.lazy(() => impo
|
|
|
1121
1123
|
]
|
|
1122
1124
|
}
|
|
1123
1125
|
);
|
|
1124
|
-
},
|
|
1125
|
-
const { linkPreviewsManager: t } =
|
|
1126
|
+
}, Ps = () => {
|
|
1127
|
+
const { linkPreviewsManager: t } = jt(), { linkPreviews: s } = $t(
|
|
1126
1128
|
t.state,
|
|
1127
|
-
|
|
1129
|
+
Ls
|
|
1128
1130
|
), n = (l) => {
|
|
1129
1131
|
t.dismissPreview(l);
|
|
1130
1132
|
};
|
|
1131
1133
|
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(
|
|
1132
|
-
|
|
1134
|
+
Us,
|
|
1133
1135
|
{
|
|
1134
1136
|
link: l,
|
|
1135
1137
|
onDismiss: n
|
|
1136
1138
|
},
|
|
1137
1139
|
l.og_scrape_url
|
|
1138
1140
|
)) }) : null;
|
|
1139
|
-
},
|
|
1140
|
-
const { handleSubmit: t } =
|
|
1141
|
+
}, Fs = () => {
|
|
1142
|
+
const { handleSubmit: t } = Ht(), s = Vt();
|
|
1141
1143
|
return /* @__PURE__ */ i(he, { children: [
|
|
1142
|
-
/* @__PURE__ */ e("div", { className: "left-container", children: /* @__PURE__ */ e(
|
|
1144
|
+
/* @__PURE__ */ e("div", { className: "left-container", children: /* @__PURE__ */ e(Yt, {}) }),
|
|
1143
1145
|
/* @__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: [
|
|
1144
|
-
/* @__PURE__ */ e(Yt, {}),
|
|
1145
|
-
/* @__PURE__ */ e(Us, {}),
|
|
1146
1146
|
/* @__PURE__ */ e(Wt, {}),
|
|
1147
|
+
/* @__PURE__ */ e(Ps, {}),
|
|
1148
|
+
/* @__PURE__ */ e(qt, {}),
|
|
1147
1149
|
/* @__PURE__ */ i("div", { className: "flex", children: [
|
|
1148
1150
|
/* @__PURE__ */ e("div", { className: "w-full ml-2 mr-4 self-center leading-[0]", children: /* @__PURE__ */ e(
|
|
1149
|
-
|
|
1151
|
+
Zt,
|
|
1150
1152
|
{
|
|
1151
1153
|
className: "w-full resize-none outline-none leading-6",
|
|
1152
1154
|
autoFocus: !0,
|
|
@@ -1162,72 +1164,72 @@ const _s = F.lazy(() => import("./Creator-77XnrIxc.js")), Es = F.lazy(() => impo
|
|
|
1162
1164
|
disabled: !s,
|
|
1163
1165
|
onClick: t,
|
|
1164
1166
|
type: "button",
|
|
1165
|
-
children: /* @__PURE__ */ e(
|
|
1167
|
+
children: /* @__PURE__ */ e(ns, { className: "size-4" })
|
|
1166
1168
|
}
|
|
1167
1169
|
)
|
|
1168
1170
|
] })
|
|
1169
1171
|
] })
|
|
1170
1172
|
] });
|
|
1171
|
-
},
|
|
1173
|
+
}, Os = ({
|
|
1172
1174
|
renderActions: t
|
|
1173
1175
|
}) => /* @__PURE__ */ i("div", { className: "message-input flex items-center gap-2 p-4", children: [
|
|
1174
1176
|
t && (t == null ? void 0 : t()),
|
|
1175
|
-
/* @__PURE__ */ e(
|
|
1176
|
-
] }),
|
|
1177
|
+
/* @__PURE__ */ e(zt, { Input: Fs })
|
|
1178
|
+
] }), Bs = [
|
|
1177
1179
|
"SYSTEM_DM_AGENT_PAUSED",
|
|
1178
1180
|
"SYSTEM_DM_AGENT_RESUMED"
|
|
1179
|
-
],
|
|
1181
|
+
], Gs = {
|
|
1180
1182
|
SYSTEM_DM_AGENT_PAUSED: "DM Agent has left the conversation",
|
|
1181
1183
|
SYSTEM_DM_AGENT_RESUMED: "DM Agent has rejoined the conversation"
|
|
1182
|
-
},
|
|
1184
|
+
}, js = [
|
|
1183
1185
|
"SYSTEM_AGE_SAFETY_BLOCKED"
|
|
1184
|
-
],
|
|
1186
|
+
], $s = {
|
|
1185
1187
|
SYSTEM_AGE_SAFETY_BLOCKED: "This user isn’t able to reply because they don’t meet our age safety guidelines."
|
|
1186
|
-
},
|
|
1188
|
+
}, Le = "age safety guidelines.", zs = "https://linktr.ee/s/about/contact", Ke = (t) => Bs.includes(t), Hs = (t) => js.includes(t), Vs = (t) => {
|
|
1187
1189
|
var o;
|
|
1188
1190
|
const s = (o = t.metadata) == null ? void 0 : o.custom_type;
|
|
1189
|
-
if (
|
|
1191
|
+
if (Ke(s))
|
|
1190
1192
|
return {
|
|
1191
1193
|
kind: "dm-agent",
|
|
1192
1194
|
type: s
|
|
1193
1195
|
};
|
|
1194
|
-
if (
|
|
1196
|
+
if (Hs(s))
|
|
1195
1197
|
return {
|
|
1196
1198
|
kind: "age-safety",
|
|
1197
1199
|
type: s
|
|
1198
1200
|
};
|
|
1199
1201
|
const n = t.dm_agent_system_type;
|
|
1200
|
-
if (
|
|
1202
|
+
if (Ke(n))
|
|
1201
1203
|
return {
|
|
1202
1204
|
kind: "dm-agent",
|
|
1203
1205
|
type: n
|
|
1204
1206
|
};
|
|
1205
|
-
},
|
|
1206
|
-
const s = t.indexOf(
|
|
1207
|
+
}, Ys = (t) => {
|
|
1208
|
+
const s = t.indexOf(Le);
|
|
1207
1209
|
if (s === -1)
|
|
1208
1210
|
return t;
|
|
1209
|
-
const n = s +
|
|
1211
|
+
const n = s + Le.length;
|
|
1210
1212
|
return /* @__PURE__ */ i(he, { children: [
|
|
1211
1213
|
t.slice(0, s),
|
|
1212
1214
|
/* @__PURE__ */ e(
|
|
1213
1215
|
"a",
|
|
1214
1216
|
{
|
|
1215
|
-
href:
|
|
1217
|
+
href: zs,
|
|
1216
1218
|
target: "_blank",
|
|
1217
1219
|
rel: "noopener noreferrer",
|
|
1218
1220
|
className: "mes-age-safety-system-message__emphasis font-medium text-inherit underline",
|
|
1219
|
-
children:
|
|
1221
|
+
children: Le
|
|
1220
1222
|
}
|
|
1221
1223
|
),
|
|
1222
1224
|
t.slice(n)
|
|
1223
1225
|
] });
|
|
1224
|
-
},
|
|
1226
|
+
}, Ws = (t) => {
|
|
1225
1227
|
var o, l;
|
|
1226
|
-
const s = t.message.hide_date === !0, n =
|
|
1228
|
+
const s = t.message.hide_date === !0, n = Vs(
|
|
1227
1229
|
t.message
|
|
1228
1230
|
);
|
|
1229
1231
|
if ((n == null ? void 0 : n.kind) === "dm-agent") {
|
|
1230
|
-
const d = ((o = t.message.text) == null ? void 0 : o.trim()) ||
|
|
1232
|
+
const d = ((o = t.message.text) == null ? void 0 : o.trim()) || Gs[n.type];
|
|
1231
1233
|
return /* @__PURE__ */ i("div", { className: "str-chat__message--system", "data-testid": "message-system", children: [
|
|
1232
1234
|
/* @__PURE__ */ i(
|
|
1233
1235
|
"div",
|
|
@@ -1237,7 +1239,7 @@ const _s = F.lazy(() => import("./Creator-77XnrIxc.js")), Es = F.lazy(() => impo
|
|
|
1237
1239
|
"data-dm-agent-system-type": n.type,
|
|
1238
1240
|
children: [
|
|
1239
1241
|
/* @__PURE__ */ e(
|
|
1240
|
-
|
|
1242
|
+
as,
|
|
1241
1243
|
{
|
|
1242
1244
|
size: 16,
|
|
1243
1245
|
weight: "regular",
|
|
@@ -1249,11 +1251,11 @@ const _s = F.lazy(() => import("./Creator-77XnrIxc.js")), Es = F.lazy(() => impo
|
|
|
1249
1251
|
]
|
|
1250
1252
|
}
|
|
1251
1253
|
),
|
|
1252
|
-
!s && /* @__PURE__ */ e(
|
|
1254
|
+
!s && /* @__PURE__ */ e(Re, { message: t.message })
|
|
1253
1255
|
] });
|
|
1254
1256
|
}
|
|
1255
1257
|
if ((n == null ? void 0 : n.kind) === "age-safety") {
|
|
1256
|
-
const d = ((l = t.message.text) == null ? void 0 : l.trim()) ||
|
|
1258
|
+
const d = ((l = t.message.text) == null ? void 0 : l.trim()) || $s[n.type];
|
|
1257
1259
|
return /* @__PURE__ */ i("div", { className: "str-chat__message--system", "data-testid": "message-system", children: [
|
|
1258
1260
|
/* @__PURE__ */ i(
|
|
1259
1261
|
"div",
|
|
@@ -1263,7 +1265,7 @@ const _s = F.lazy(() => import("./Creator-77XnrIxc.js")), Es = F.lazy(() => impo
|
|
|
1263
1265
|
"data-age-safety-system-type": n.type,
|
|
1264
1266
|
children: [
|
|
1265
1267
|
/* @__PURE__ */ e(
|
|
1266
|
-
|
|
1268
|
+
rs,
|
|
1267
1269
|
{
|
|
1268
1270
|
size: 24,
|
|
1269
1271
|
weight: "duotone",
|
|
@@ -1272,11 +1274,11 @@ const _s = F.lazy(() => import("./Creator-77XnrIxc.js")), Es = F.lazy(() => impo
|
|
|
1272
1274
|
"data-testid": "age-safety-system-message-icon"
|
|
1273
1275
|
}
|
|
1274
1276
|
),
|
|
1275
|
-
/* @__PURE__ */ e("div", { className: "mes-age-safety-system-message__content min-w-0 flex-[1_0_0]", children: /* @__PURE__ */ e("p", { className: "m-0 text-balance text-left text-[12px] font-normal leading-4 tracking-[0.21px] text-[color:var(--text-warning-on-warning,#894b00)]", children:
|
|
1277
|
+
/* @__PURE__ */ e("div", { className: "mes-age-safety-system-message__content min-w-0 flex-[1_0_0]", children: /* @__PURE__ */ e("p", { className: "m-0 text-balance text-left text-[12px] font-normal leading-4 tracking-[0.21px] text-[color:var(--text-warning-on-warning,#894b00)]", children: Ys(d) }) })
|
|
1276
1278
|
]
|
|
1277
1279
|
}
|
|
1278
1280
|
),
|
|
1279
|
-
!s && /* @__PURE__ */ e(
|
|
1281
|
+
!s && /* @__PURE__ */ e(Re, { message: t.message })
|
|
1280
1282
|
] });
|
|
1281
1283
|
}
|
|
1282
1284
|
return /* @__PURE__ */ i("div", { className: "str-chat__message--system", "data-testid": "message-system", children: [
|
|
@@ -1285,9 +1287,9 @@ const _s = F.lazy(() => import("./Creator-77XnrIxc.js")), Es = F.lazy(() => impo
|
|
|
1285
1287
|
/* @__PURE__ */ e("p", { children: t.message.text }),
|
|
1286
1288
|
/* @__PURE__ */ e("div", { className: "str-chat__message--system__line" })
|
|
1287
1289
|
] }),
|
|
1288
|
-
!s && /* @__PURE__ */ e(
|
|
1290
|
+
!s && /* @__PURE__ */ e(Re, { message: t.message })
|
|
1289
1291
|
] });
|
|
1290
|
-
},
|
|
1292
|
+
}, qs = () => null, Zs = ({ className: t, message: s }) => /* @__PURE__ */ i(
|
|
1291
1293
|
"div",
|
|
1292
1294
|
{
|
|
1293
1295
|
className: A("flex items-center justify-center h-full", t),
|
|
@@ -1330,31 +1332,31 @@ const _s = F.lazy(() => import("./Creator-77XnrIxc.js")), Es = F.lazy(() => impo
|
|
|
1330
1332
|
s && /* @__PURE__ */ e("span", { className: "text-stone", children: s })
|
|
1331
1333
|
]
|
|
1332
1334
|
}
|
|
1333
|
-
),
|
|
1334
|
-
/* @__PURE__ */ e(
|
|
1335
|
+
), Ie = F.memo(() => /* @__PURE__ */ e("div", { className: "messaging-loading-state flex items-center justify-center h-full", children: /* @__PURE__ */ i("div", { className: "flex items-center", children: [
|
|
1336
|
+
/* @__PURE__ */ e(Zs, { className: "w-6 h-6" }),
|
|
1335
1337
|
/* @__PURE__ */ e("span", { className: "text-sm text-stone", children: "Loading messages" })
|
|
1336
1338
|
] }) }));
|
|
1337
|
-
|
|
1338
|
-
const ue = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-center justify-center transition-colors duration-150 focus-ring",
|
|
1339
|
+
Ie.displayName = "LoadingState";
|
|
1340
|
+
const ue = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-center justify-center transition-colors duration-150 focus-ring", Js = ({
|
|
1339
1341
|
onBack: t,
|
|
1340
1342
|
showBackButton: s,
|
|
1341
1343
|
onShowInfo: n,
|
|
1342
1344
|
canShowInfo: o,
|
|
1343
1345
|
showStarButton: l = !1
|
|
1344
1346
|
}) => {
|
|
1345
|
-
var C,
|
|
1346
|
-
const { channel: d } =
|
|
1347
|
+
var C, E, h, p, v;
|
|
1348
|
+
const { channel: d } = ke(), a = F.useMemo(() => Object.values(d.state.members || {}).find(
|
|
1347
1349
|
(M) => {
|
|
1348
|
-
var
|
|
1349
|
-
return ((
|
|
1350
|
+
var S;
|
|
1351
|
+
return ((S = M.user) == null ? void 0 : S.id) && M.user.id !== d._client.userID;
|
|
1350
1352
|
}
|
|
1351
|
-
), [d._client.userID, d.state.members]), c = ((C = a == null ? void 0 : a.user) == null ? void 0 : C.name) || ((
|
|
1353
|
+
), [d._client.userID, d.state.members]), c = ((C = a == null ? void 0 : a.user) == null ? void 0 : C.name) || ((E = a == null ? void 0 : a.user) == null ? void 0 : E.id) || "Unknown member", f = (h = a == null ? void 0 : a.user) == null ? void 0 : h.image, u = nt(d), x = async () => {
|
|
1352
1354
|
try {
|
|
1353
|
-
|
|
1354
|
-
} catch (
|
|
1355
|
+
u ? await d.unpin() : await d.pin();
|
|
1356
|
+
} catch (r) {
|
|
1355
1357
|
console.error(
|
|
1356
1358
|
"[CustomChannelHeader] Failed to update pinned status:",
|
|
1357
|
-
|
|
1359
|
+
r
|
|
1358
1360
|
);
|
|
1359
1361
|
}
|
|
1360
1362
|
};
|
|
@@ -1368,17 +1370,17 @@ const ue = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
1368
1370
|
}),
|
|
1369
1371
|
type: "button",
|
|
1370
1372
|
"aria-label": "Back to conversations",
|
|
1371
|
-
children: /* @__PURE__ */ e(
|
|
1373
|
+
children: /* @__PURE__ */ e(Ye, { className: "size-5 text-black/90" })
|
|
1372
1374
|
}
|
|
1373
1375
|
) }),
|
|
1374
1376
|
/* @__PURE__ */ i("div", { className: "flex flex-col gap-1 items-center", children: [
|
|
1375
1377
|
/* @__PURE__ */ e(
|
|
1376
|
-
|
|
1378
|
+
ce,
|
|
1377
1379
|
{
|
|
1378
|
-
id: ((
|
|
1380
|
+
id: ((p = a == null ? void 0 : a.user) == null ? void 0 : p.id) || d.id || "unknown",
|
|
1379
1381
|
name: c,
|
|
1380
|
-
image:
|
|
1381
|
-
starred: l &&
|
|
1382
|
+
image: f,
|
|
1383
|
+
starred: l && u,
|
|
1382
1384
|
size: 40
|
|
1383
1385
|
}
|
|
1384
1386
|
),
|
|
@@ -1389,17 +1391,17 @@ const ue = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
1389
1391
|
"button",
|
|
1390
1392
|
{
|
|
1391
1393
|
className: ue,
|
|
1392
|
-
onClick:
|
|
1394
|
+
onClick: x,
|
|
1393
1395
|
type: "button",
|
|
1394
|
-
"aria-label":
|
|
1396
|
+
"aria-label": u ? "Unstar conversation" : "Star conversation",
|
|
1395
1397
|
children: /* @__PURE__ */ e(
|
|
1396
|
-
|
|
1398
|
+
Pe,
|
|
1397
1399
|
{
|
|
1398
1400
|
className: A("size-5", {
|
|
1399
|
-
"text-yellow-600":
|
|
1400
|
-
"text-black/90": !
|
|
1401
|
+
"text-yellow-600": u,
|
|
1402
|
+
"text-black/90": !u
|
|
1401
1403
|
}),
|
|
1402
|
-
weight:
|
|
1404
|
+
weight: u ? "duotone" : "regular"
|
|
1403
1405
|
}
|
|
1404
1406
|
)
|
|
1405
1407
|
}
|
|
@@ -1411,7 +1413,7 @@ const ue = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
1411
1413
|
onClick: n,
|
|
1412
1414
|
type: "button",
|
|
1413
1415
|
"aria-label": "Show info",
|
|
1414
|
-
children: /* @__PURE__ */ e(
|
|
1416
|
+
children: /* @__PURE__ */ e(We, { className: "size-5 text-black/90" })
|
|
1415
1417
|
}
|
|
1416
1418
|
)
|
|
1417
1419
|
] })
|
|
@@ -1425,16 +1427,16 @@ const ue = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
1425
1427
|
onClick: t,
|
|
1426
1428
|
className: ue,
|
|
1427
1429
|
"aria-label": "Back to conversations",
|
|
1428
|
-
children: /* @__PURE__ */ e(
|
|
1430
|
+
children: /* @__PURE__ */ e(Ye, { className: "size-5 text-black/90" })
|
|
1429
1431
|
}
|
|
1430
1432
|
),
|
|
1431
1433
|
/* @__PURE__ */ e(
|
|
1432
|
-
|
|
1434
|
+
ce,
|
|
1433
1435
|
{
|
|
1434
|
-
id: ((
|
|
1436
|
+
id: ((v = a == null ? void 0 : a.user) == null ? void 0 : v.id) || d.id || "unknown",
|
|
1435
1437
|
name: c,
|
|
1436
|
-
image:
|
|
1437
|
-
starred: l &&
|
|
1438
|
+
image: f,
|
|
1439
|
+
starred: l && u,
|
|
1438
1440
|
size: 40
|
|
1439
1441
|
}
|
|
1440
1442
|
),
|
|
@@ -1445,17 +1447,17 @@ const ue = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
1445
1447
|
"button",
|
|
1446
1448
|
{
|
|
1447
1449
|
className: ue,
|
|
1448
|
-
onClick:
|
|
1450
|
+
onClick: x,
|
|
1449
1451
|
type: "button",
|
|
1450
|
-
"aria-label":
|
|
1452
|
+
"aria-label": u ? "Unstar conversation" : "Star conversation",
|
|
1451
1453
|
children: /* @__PURE__ */ e(
|
|
1452
|
-
|
|
1454
|
+
Pe,
|
|
1453
1455
|
{
|
|
1454
1456
|
className: A("size-5", {
|
|
1455
|
-
"text-yellow-600":
|
|
1456
|
-
"text-black/90": !
|
|
1457
|
+
"text-yellow-600": u,
|
|
1458
|
+
"text-black/90": !u
|
|
1457
1459
|
}),
|
|
1458
|
-
weight:
|
|
1460
|
+
weight: u ? "duotone" : "regular"
|
|
1459
1461
|
}
|
|
1460
1462
|
)
|
|
1461
1463
|
}
|
|
@@ -1467,13 +1469,13 @@ const ue = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
1467
1469
|
onClick: n,
|
|
1468
1470
|
type: "button",
|
|
1469
1471
|
"aria-label": "Show info",
|
|
1470
|
-
children: /* @__PURE__ */ e(
|
|
1472
|
+
children: /* @__PURE__ */ e(We, { className: "size-5 text-black/90" })
|
|
1471
1473
|
}
|
|
1472
1474
|
)
|
|
1473
1475
|
] })
|
|
1474
1476
|
] })
|
|
1475
1477
|
] });
|
|
1476
|
-
},
|
|
1478
|
+
}, Xs = ({
|
|
1477
1479
|
onBack: t,
|
|
1478
1480
|
showBackButton: s,
|
|
1479
1481
|
renderMessageInputActions: n,
|
|
@@ -1482,67 +1484,69 @@ const ue = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
1482
1484
|
onBlockParticipant: d,
|
|
1483
1485
|
showDeleteConversation: a = !0,
|
|
1484
1486
|
onDeleteConversationClick: c,
|
|
1485
|
-
onBlockParticipantClick:
|
|
1486
|
-
onReportParticipantClick:
|
|
1487
|
-
showStarButton:
|
|
1487
|
+
onBlockParticipantClick: f,
|
|
1488
|
+
onReportParticipantClick: u,
|
|
1489
|
+
showStarButton: x = !1,
|
|
1488
1490
|
chatbotVotingEnabled: C = !1,
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
+
onAttachmentUnlockClick: E,
|
|
1492
|
+
onAttachmentDownloadClick: h,
|
|
1493
|
+
onAttachmentUnlocked: p,
|
|
1491
1494
|
renderChannelBanner: v,
|
|
1492
1495
|
customProfileContent: r,
|
|
1493
|
-
customChannelActions:
|
|
1494
|
-
renderMessage:
|
|
1496
|
+
customChannelActions: M,
|
|
1497
|
+
renderMessage: S
|
|
1495
1498
|
}) => {
|
|
1496
|
-
const { channel: N } =
|
|
1497
|
-
(
|
|
1498
|
-
var
|
|
1499
|
-
return ((
|
|
1499
|
+
const { channel: N } = ke(), w = ee(null), R = F.useMemo(() => Object.values(N.state.members || {}).find(
|
|
1500
|
+
(_) => {
|
|
1501
|
+
var k;
|
|
1502
|
+
return ((k = _.user) == null ? void 0 : k.id) && _.user.id !== N._client.userID;
|
|
1500
1503
|
}
|
|
1501
|
-
), [N._client.userID, N.state.members]),
|
|
1502
|
-
const
|
|
1503
|
-
if (
|
|
1504
|
-
return String(
|
|
1505
|
-
if (
|
|
1506
|
-
return
|
|
1507
|
-
}, [N.data]),
|
|
1508
|
-
var
|
|
1509
|
-
(
|
|
1510
|
-
}, []),
|
|
1511
|
-
var
|
|
1512
|
-
(
|
|
1504
|
+
), [N._client.userID, N.state.members]), g = F.useMemo(() => {
|
|
1505
|
+
const b = N.data ?? {};
|
|
1506
|
+
if (b.followerStatus)
|
|
1507
|
+
return String(b.followerStatus);
|
|
1508
|
+
if (b.isFollower !== void 0)
|
|
1509
|
+
return b.isFollower ? "Subscribed to you" : "Not subscribed";
|
|
1510
|
+
}, [N.data]), m = U(() => {
|
|
1511
|
+
var b;
|
|
1512
|
+
(b = w.current) == null || b.showModal();
|
|
1513
|
+
}, []), y = U(() => {
|
|
1514
|
+
var b;
|
|
1515
|
+
(b = w.current) == null || b.close();
|
|
1513
1516
|
}, []);
|
|
1514
1517
|
return /* @__PURE__ */ i(he, { children: [
|
|
1515
1518
|
/* @__PURE__ */ e(
|
|
1516
|
-
|
|
1519
|
+
Xt,
|
|
1517
1520
|
{
|
|
1518
1521
|
overrides: {
|
|
1519
|
-
Message: (
|
|
1520
|
-
const { message:
|
|
1521
|
-
|
|
1522
|
+
Message: (b) => {
|
|
1523
|
+
const { message: _ } = et("ChannelView"), k = /* @__PURE__ */ e(
|
|
1524
|
+
As,
|
|
1522
1525
|
{
|
|
1523
|
-
...
|
|
1526
|
+
...b,
|
|
1524
1527
|
chatbotVotingEnabled: C,
|
|
1525
|
-
|
|
1526
|
-
|
|
1528
|
+
onAttachmentUnlockClick: E,
|
|
1529
|
+
onAttachmentDownloadClick: h,
|
|
1530
|
+
onAttachmentUnlocked: p
|
|
1527
1531
|
}
|
|
1528
1532
|
);
|
|
1529
|
-
return !
|
|
1533
|
+
return !S || !_ ? k : S(k, _);
|
|
1530
1534
|
}
|
|
1531
1535
|
},
|
|
1532
|
-
children: /* @__PURE__ */ i(
|
|
1536
|
+
children: /* @__PURE__ */ i(Kt, { children: [
|
|
1533
1537
|
/* @__PURE__ */ e("div", { className: "p-4", children: /* @__PURE__ */ e(
|
|
1534
|
-
|
|
1538
|
+
Js,
|
|
1535
1539
|
{
|
|
1536
1540
|
onBack: t,
|
|
1537
1541
|
showBackButton: s,
|
|
1538
|
-
onShowInfo:
|
|
1539
|
-
canShowInfo: !!
|
|
1540
|
-
showStarButton:
|
|
1542
|
+
onShowInfo: m,
|
|
1543
|
+
canShowInfo: !!R,
|
|
1544
|
+
showStarButton: x
|
|
1541
1545
|
}
|
|
1542
1546
|
) }),
|
|
1543
1547
|
v == null ? void 0 : v(),
|
|
1544
1548
|
/* @__PURE__ */ e("div", { className: "flex-1 overflow-hidden relative", children: /* @__PURE__ */ e(
|
|
1545
|
-
|
|
1549
|
+
Qt,
|
|
1546
1550
|
{
|
|
1547
1551
|
hideDeletedMessages: !0,
|
|
1548
1552
|
hideNewMessageSeparator: !1,
|
|
@@ -1551,7 +1555,7 @@ const ue = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
1551
1555
|
) }),
|
|
1552
1556
|
o == null ? void 0 : o(N),
|
|
1553
1557
|
/* @__PURE__ */ e(
|
|
1554
|
-
|
|
1558
|
+
Os,
|
|
1555
1559
|
{
|
|
1556
1560
|
renderActions: () => n == null ? void 0 : n(N)
|
|
1557
1561
|
}
|
|
@@ -1563,22 +1567,22 @@ const ue = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
1563
1567
|
ps,
|
|
1564
1568
|
{
|
|
1565
1569
|
dialogRef: w,
|
|
1566
|
-
onClose:
|
|
1567
|
-
participant:
|
|
1570
|
+
onClose: y,
|
|
1571
|
+
participant: R,
|
|
1568
1572
|
channel: N,
|
|
1569
|
-
followerStatusLabel:
|
|
1573
|
+
followerStatusLabel: g,
|
|
1570
1574
|
onLeaveConversation: l,
|
|
1571
1575
|
onBlockParticipant: d,
|
|
1572
1576
|
showDeleteConversation: a,
|
|
1573
1577
|
onDeleteConversationClick: c,
|
|
1574
|
-
onBlockParticipantClick:
|
|
1575
|
-
onReportParticipantClick:
|
|
1578
|
+
onBlockParticipantClick: f,
|
|
1579
|
+
onReportParticipantClick: u,
|
|
1576
1580
|
customProfileContent: r,
|
|
1577
|
-
customChannelActions:
|
|
1581
|
+
customChannelActions: M
|
|
1578
1582
|
}
|
|
1579
1583
|
)
|
|
1580
1584
|
] });
|
|
1581
|
-
},
|
|
1585
|
+
}, ct = F.memo(
|
|
1582
1586
|
({
|
|
1583
1587
|
channel: t,
|
|
1584
1588
|
onBack: s,
|
|
@@ -1588,42 +1592,43 @@ const ue = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
1588
1592
|
onLeaveConversation: d,
|
|
1589
1593
|
onBlockParticipant: a,
|
|
1590
1594
|
className: c,
|
|
1591
|
-
CustomChannelEmptyState:
|
|
1592
|
-
showDeleteConversation:
|
|
1593
|
-
onDeleteConversationClick:
|
|
1595
|
+
CustomChannelEmptyState: f = qs,
|
|
1596
|
+
showDeleteConversation: u = !0,
|
|
1597
|
+
onDeleteConversationClick: x,
|
|
1594
1598
|
onBlockParticipantClick: C,
|
|
1595
|
-
onReportParticipantClick:
|
|
1596
|
-
dmAgentEnabled:
|
|
1597
|
-
messageMetadata:
|
|
1598
|
-
onMessageSent:
|
|
1599
|
-
showStarButton:
|
|
1599
|
+
onReportParticipantClick: E,
|
|
1600
|
+
dmAgentEnabled: h,
|
|
1601
|
+
messageMetadata: p,
|
|
1602
|
+
onMessageSent: v,
|
|
1603
|
+
showStarButton: r = !1,
|
|
1600
1604
|
chatbotVotingEnabled: M = !1,
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1605
|
+
onAttachmentUnlockClick: S,
|
|
1606
|
+
onAttachmentDownloadClick: N,
|
|
1607
|
+
onAttachmentUnlocked: w,
|
|
1608
|
+
renderChannelBanner: R,
|
|
1609
|
+
customProfileContent: g,
|
|
1610
|
+
customChannelActions: m,
|
|
1611
|
+
renderMessage: y
|
|
1607
1612
|
}) => {
|
|
1608
|
-
const
|
|
1609
|
-
async (
|
|
1613
|
+
const b = U(
|
|
1614
|
+
async (_, k, Y) => {
|
|
1610
1615
|
var J;
|
|
1611
|
-
const G = ((J = t.data) == null ? void 0 : J.chatbot_paused) === !0,
|
|
1612
|
-
...
|
|
1613
|
-
...
|
|
1614
|
-
...
|
|
1616
|
+
const G = ((J = t.data) == null ? void 0 : J.chatbot_paused) === !0, D = h && !G, j = {
|
|
1617
|
+
...k,
|
|
1618
|
+
...D && { silent: !0 },
|
|
1619
|
+
...p && {
|
|
1615
1620
|
metadata: {
|
|
1616
|
-
...
|
|
1617
|
-
...
|
|
1621
|
+
...k.metadata ?? {},
|
|
1622
|
+
...p
|
|
1618
1623
|
}
|
|
1619
1624
|
}
|
|
1620
|
-
},
|
|
1621
|
-
...
|
|
1622
|
-
...
|
|
1623
|
-
}, Z = await t.sendMessage(j,
|
|
1624
|
-
return
|
|
1625
|
+
}, te = {
|
|
1626
|
+
...Y,
|
|
1627
|
+
...D && { skip_push: !0 }
|
|
1628
|
+
}, Z = await t.sendMessage(j, te);
|
|
1629
|
+
return v == null || v(Z), Z;
|
|
1625
1630
|
},
|
|
1626
|
-
[t,
|
|
1631
|
+
[t, h, p, v]
|
|
1627
1632
|
);
|
|
1628
1633
|
return /* @__PURE__ */ e(
|
|
1629
1634
|
"div",
|
|
@@ -1633,16 +1638,16 @@ const ue = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
1633
1638
|
c
|
|
1634
1639
|
),
|
|
1635
1640
|
children: /* @__PURE__ */ e(
|
|
1636
|
-
|
|
1641
|
+
Jt,
|
|
1637
1642
|
{
|
|
1638
1643
|
channel: t,
|
|
1639
|
-
MessageSystem:
|
|
1640
|
-
EmptyStateIndicator:
|
|
1641
|
-
LoadingIndicator:
|
|
1642
|
-
DateSeparator:
|
|
1643
|
-
doSendMessageRequest:
|
|
1644
|
+
MessageSystem: Ws,
|
|
1645
|
+
EmptyStateIndicator: f,
|
|
1646
|
+
LoadingIndicator: Ie,
|
|
1647
|
+
DateSeparator: vs,
|
|
1648
|
+
doSendMessageRequest: b,
|
|
1644
1649
|
children: /* @__PURE__ */ e(
|
|
1645
|
-
|
|
1650
|
+
Xs,
|
|
1646
1651
|
{
|
|
1647
1652
|
onBack: s,
|
|
1648
1653
|
showBackButton: n,
|
|
@@ -1650,19 +1655,20 @@ const ue = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
1650
1655
|
renderConversationFooter: l,
|
|
1651
1656
|
onLeaveConversation: d,
|
|
1652
1657
|
onBlockParticipant: a,
|
|
1653
|
-
CustomChannelEmptyState:
|
|
1654
|
-
showDeleteConversation:
|
|
1655
|
-
onDeleteConversationClick:
|
|
1658
|
+
CustomChannelEmptyState: f,
|
|
1659
|
+
showDeleteConversation: u,
|
|
1660
|
+
onDeleteConversationClick: x,
|
|
1656
1661
|
onBlockParticipantClick: C,
|
|
1657
|
-
onReportParticipantClick:
|
|
1658
|
-
showStarButton:
|
|
1662
|
+
onReportParticipantClick: E,
|
|
1663
|
+
showStarButton: r,
|
|
1659
1664
|
chatbotVotingEnabled: M,
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1665
|
+
onAttachmentUnlockClick: S,
|
|
1666
|
+
onAttachmentDownloadClick: N,
|
|
1667
|
+
onAttachmentUnlocked: w,
|
|
1668
|
+
renderChannelBanner: R,
|
|
1669
|
+
customProfileContent: g,
|
|
1670
|
+
customChannelActions: m,
|
|
1671
|
+
renderMessage: y
|
|
1666
1672
|
}
|
|
1667
1673
|
)
|
|
1668
1674
|
}
|
|
@@ -1671,16 +1677,16 @@ const ue = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
1671
1677
|
);
|
|
1672
1678
|
}
|
|
1673
1679
|
);
|
|
1674
|
-
|
|
1675
|
-
function
|
|
1680
|
+
ct.displayName = "ChannelView";
|
|
1681
|
+
function Ks({
|
|
1676
1682
|
searchQuery: t,
|
|
1677
1683
|
setSearchQuery: s,
|
|
1678
1684
|
placeholder: n
|
|
1679
1685
|
}) {
|
|
1680
|
-
const o =
|
|
1686
|
+
const o = ee(null);
|
|
1681
1687
|
return /* @__PURE__ */ i("div", { className: "relative", children: [
|
|
1682
1688
|
/* @__PURE__ */ e(
|
|
1683
|
-
|
|
1689
|
+
os,
|
|
1684
1690
|
{
|
|
1685
1691
|
className: "pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-stone",
|
|
1686
1692
|
weight: "bold"
|
|
@@ -1698,7 +1704,7 @@ function Xs({
|
|
|
1698
1704
|
}
|
|
1699
1705
|
),
|
|
1700
1706
|
t && /* @__PURE__ */ e(
|
|
1701
|
-
|
|
1707
|
+
lt,
|
|
1702
1708
|
{
|
|
1703
1709
|
label: "Clear search",
|
|
1704
1710
|
onClick: () => {
|
|
@@ -1706,12 +1712,12 @@ function Xs({
|
|
|
1706
1712
|
s(""), (l = o.current) == null || l.focus();
|
|
1707
1713
|
},
|
|
1708
1714
|
className: "absolute right-3 top-1/2 -translate-y-1/2 p-1 text-stone hover:text-charcoal",
|
|
1709
|
-
children: /* @__PURE__ */ e(
|
|
1715
|
+
children: /* @__PURE__ */ e(Be, { className: "h-4 w-4", weight: "bold" })
|
|
1710
1716
|
}
|
|
1711
1717
|
)
|
|
1712
1718
|
] });
|
|
1713
1719
|
}
|
|
1714
|
-
const
|
|
1720
|
+
const Qs = ({
|
|
1715
1721
|
participantSource: t,
|
|
1716
1722
|
onSelectParticipant: s,
|
|
1717
1723
|
onClose: n,
|
|
@@ -1720,11 +1726,11 @@ const Ks = ({
|
|
|
1720
1726
|
searchPlaceholder: d = "Search participants...",
|
|
1721
1727
|
className: a
|
|
1722
1728
|
}) => {
|
|
1723
|
-
const { debug: c } = Me(), [
|
|
1729
|
+
const { debug: c } = Me(), [f, u] = T(""), [x, C] = T([]), [E, h] = T(!1), [p, v] = T(null), [r, M] = T(
|
|
1724
1730
|
null
|
|
1725
|
-
),
|
|
1731
|
+
), S = ee(!1);
|
|
1726
1732
|
X(() => {
|
|
1727
|
-
|
|
1733
|
+
S.current = !1;
|
|
1728
1734
|
}, [t]), X(() => {
|
|
1729
1735
|
if (t.loading) {
|
|
1730
1736
|
c && console.log(
|
|
@@ -1732,125 +1738,125 @@ const Ks = ({
|
|
|
1732
1738
|
);
|
|
1733
1739
|
return;
|
|
1734
1740
|
}
|
|
1735
|
-
if (
|
|
1741
|
+
if (S.current) return;
|
|
1736
1742
|
(async () => {
|
|
1737
|
-
c && console.log("[ParticipantPicker] Loading initial participants..."),
|
|
1743
|
+
c && console.log("[ParticipantPicker] Loading initial participants..."), h(!0), v(null);
|
|
1738
1744
|
try {
|
|
1739
|
-
const
|
|
1745
|
+
const m = await t.loadParticipants({
|
|
1740
1746
|
search: "",
|
|
1741
1747
|
// Load all participants initially
|
|
1742
1748
|
limit: 100
|
|
1743
1749
|
});
|
|
1744
|
-
C(
|
|
1750
|
+
C(m.participants), S.current = !0, c && console.log(
|
|
1745
1751
|
"[ParticipantPicker] Participants loaded successfully:",
|
|
1746
|
-
|
|
1752
|
+
m.participants.length
|
|
1747
1753
|
);
|
|
1748
|
-
} catch (
|
|
1749
|
-
const
|
|
1750
|
-
|
|
1754
|
+
} catch (m) {
|
|
1755
|
+
const y = m instanceof Error ? m.message : "Failed to load participants";
|
|
1756
|
+
v(y), console.error("[ParticipantPicker] Failed to load participants:", m);
|
|
1751
1757
|
} finally {
|
|
1752
|
-
|
|
1758
|
+
h(!1);
|
|
1753
1759
|
}
|
|
1754
1760
|
})();
|
|
1755
1761
|
}, [t, c]);
|
|
1756
|
-
const
|
|
1757
|
-
var
|
|
1758
|
-
if (!
|
|
1759
|
-
const
|
|
1760
|
-
return
|
|
1761
|
-
}),
|
|
1762
|
-
async (
|
|
1763
|
-
if (!
|
|
1764
|
-
M(
|
|
1762
|
+
const N = x.filter((g) => !o.has(g.id)).filter((g) => {
|
|
1763
|
+
var y;
|
|
1764
|
+
if (!f) return !0;
|
|
1765
|
+
const m = f.toLowerCase();
|
|
1766
|
+
return g.name.toLowerCase().includes(m) || ((y = g.email) == null ? void 0 : y.toLowerCase().includes(m)) || !1;
|
|
1767
|
+
}), w = U(
|
|
1768
|
+
async (g) => {
|
|
1769
|
+
if (!r) {
|
|
1770
|
+
M(g.id);
|
|
1765
1771
|
try {
|
|
1766
|
-
await s(
|
|
1767
|
-
} catch (
|
|
1768
|
-
console.error("[ParticipantPicker] Failed to start chat:",
|
|
1772
|
+
await s(g);
|
|
1773
|
+
} catch (m) {
|
|
1774
|
+
console.error("[ParticipantPicker] Failed to start chat:", m), M(null);
|
|
1769
1775
|
}
|
|
1770
1776
|
}
|
|
1771
1777
|
},
|
|
1772
|
-
[s,
|
|
1773
|
-
),
|
|
1774
|
-
(
|
|
1778
|
+
[s, r]
|
|
1779
|
+
), R = (g, m) => {
|
|
1780
|
+
(g.key === "Enter" || g.key === " ") && (g.preventDefault(), w(m));
|
|
1775
1781
|
};
|
|
1776
1782
|
return /* @__PURE__ */ i("div", { className: A("flex flex-col h-full", a), children: [
|
|
1777
1783
|
/* @__PURE__ */ i("div", { className: "px-4 py-4 border-b border-sand bg-chalk", children: [
|
|
1778
1784
|
/* @__PURE__ */ i("div", { className: "flex items-center justify-between mb-3", children: [
|
|
1779
1785
|
/* @__PURE__ */ e("h2", { className: "text-lg font-semibold text-charcoal", children: "Start a new Conversation" }),
|
|
1780
|
-
/* @__PURE__ */ e(
|
|
1786
|
+
/* @__PURE__ */ e(it, { onClick: n })
|
|
1781
1787
|
] }),
|
|
1782
1788
|
/* @__PURE__ */ i("p", { className: "text-xs text-stone mb-3", children: [
|
|
1783
1789
|
"Select a ",
|
|
1784
1790
|
l.slice(0, -1),
|
|
1785
1791
|
" to start messaging (",
|
|
1786
|
-
|
|
1792
|
+
N.length,
|
|
1787
1793
|
" available)",
|
|
1788
1794
|
t.totalCount !== void 0 && ` • ${t.totalCount} ${l} total`
|
|
1789
1795
|
] }),
|
|
1790
1796
|
/* @__PURE__ */ e(
|
|
1791
|
-
|
|
1797
|
+
Ks,
|
|
1792
1798
|
{
|
|
1793
|
-
searchQuery:
|
|
1794
|
-
setSearchQuery:
|
|
1799
|
+
searchQuery: f,
|
|
1800
|
+
setSearchQuery: u,
|
|
1795
1801
|
placeholder: d
|
|
1796
1802
|
}
|
|
1797
1803
|
)
|
|
1798
1804
|
] }),
|
|
1799
|
-
|
|
1805
|
+
p && /* @__PURE__ */ i("div", { className: "p-4 text-sm text-danger bg-danger-alt", children: [
|
|
1800
1806
|
"Error loading ",
|
|
1801
1807
|
l,
|
|
1802
1808
|
": ",
|
|
1803
|
-
|
|
1809
|
+
p
|
|
1804
1810
|
] }),
|
|
1805
|
-
/* @__PURE__ */ e("div", { className: "flex-1 overflow-auto", children:
|
|
1811
|
+
/* @__PURE__ */ e("div", { className: "flex-1 overflow-auto", children: E && 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: [
|
|
1806
1812
|
/* @__PURE__ */ e("div", { className: "w-4 h-4 animate-spin rounded-full border-2 border-primary border-t-transparent" }),
|
|
1807
1813
|
/* @__PURE__ */ i("span", { className: "text-sm text-stone", children: [
|
|
1808
1814
|
"Loading ",
|
|
1809
1815
|
l,
|
|
1810
1816
|
"..."
|
|
1811
1817
|
] })
|
|
1812
|
-
] }) }) :
|
|
1813
|
-
/* @__PURE__ */ e("div", { className: "mx-auto mb-4 flex h-16 w-16 items-center justify-center rounded-full bg-sand", children: /* @__PURE__ */ e(
|
|
1814
|
-
/* @__PURE__ */ e("h3", { className: "text-sm font-semibold text-charcoal mb-2", children:
|
|
1815
|
-
/* @__PURE__ */ e("p", { className: "text-xs text-stone", children:
|
|
1818
|
+
] }) }) : N.length === 0 ? /* @__PURE__ */ i("div", { className: "p-6 text-center", children: [
|
|
1819
|
+
/* @__PURE__ */ e("div", { className: "mx-auto mb-4 flex h-16 w-16 items-center justify-center rounded-full bg-sand", children: /* @__PURE__ */ e(qe, { className: "h-8 w-8 text-charcoal" }) }),
|
|
1820
|
+
/* @__PURE__ */ e("h3", { className: "text-sm font-semibold text-charcoal mb-2", children: f ? `No ${l} found` : x.length > 0 ? `Already chatting with all ${l}` : `No ${l} yet` }),
|
|
1821
|
+
/* @__PURE__ */ e("p", { className: "text-xs text-stone", children: f ? "Try a different search term" : x.length > 0 ? `You have existing conversations with all your ${l}` : `${l.charAt(0).toUpperCase() + l.slice(1)} will appear here` })
|
|
1816
1822
|
] }) : /* @__PURE__ */ i("ul", { className: "space-y-0", children: [
|
|
1817
|
-
|
|
1818
|
-
const
|
|
1823
|
+
N.map((g) => {
|
|
1824
|
+
const m = g.name || g.email || g.id, y = g.email && g.name ? g.email : g.phone;
|
|
1819
1825
|
return /* @__PURE__ */ e("li", { children: /* @__PURE__ */ e(
|
|
1820
1826
|
"button",
|
|
1821
1827
|
{
|
|
1822
1828
|
type: "button",
|
|
1823
|
-
onClick: () =>
|
|
1824
|
-
onKeyDown: (
|
|
1829
|
+
onClick: () => w(g),
|
|
1830
|
+
onKeyDown: (b) => R(b, g),
|
|
1825
1831
|
className: "w-full px-4 py-3 hover:bg-sand transition-colors border-b border-sand text-left focus-ring",
|
|
1826
1832
|
children: /* @__PURE__ */ i("div", { className: "flex items-center justify-between", children: [
|
|
1827
1833
|
/* @__PURE__ */ i("div", { className: "flex items-center space-x-3 flex-1 min-w-0", children: [
|
|
1828
1834
|
/* @__PURE__ */ e(
|
|
1829
|
-
|
|
1835
|
+
ce,
|
|
1830
1836
|
{
|
|
1831
|
-
id:
|
|
1832
|
-
name:
|
|
1833
|
-
image:
|
|
1837
|
+
id: g.id,
|
|
1838
|
+
name: m,
|
|
1839
|
+
image: g.image,
|
|
1834
1840
|
size: 40
|
|
1835
1841
|
}
|
|
1836
1842
|
),
|
|
1837
1843
|
/* @__PURE__ */ i("div", { className: "flex-1 min-w-0", children: [
|
|
1838
|
-
/* @__PURE__ */ e("h4", { className: "text-sm font-medium text-charcoal truncate", children:
|
|
1839
|
-
|
|
1844
|
+
/* @__PURE__ */ e("h4", { className: "text-sm font-medium text-charcoal truncate", children: m }),
|
|
1845
|
+
y && /* @__PURE__ */ e("p", { className: "text-xs text-stone truncate", children: y })
|
|
1840
1846
|
] })
|
|
1841
1847
|
] }),
|
|
1842
|
-
/* @__PURE__ */ e("div", { className: "flex-shrink-0", children:
|
|
1848
|
+
/* @__PURE__ */ e("div", { className: "flex-shrink-0", children: r === g.id ? /* @__PURE__ */ e(Ee, { className: "h-5 w-5 text-primary animate-spin" }) : /* @__PURE__ */ e(qe, { className: "h-5 w-5 text-stone" }) })
|
|
1843
1849
|
] })
|
|
1844
1850
|
}
|
|
1845
|
-
) },
|
|
1851
|
+
) }, g.id);
|
|
1846
1852
|
}),
|
|
1847
|
-
|
|
1853
|
+
E && /* @__PURE__ */ e("li", { className: "p-4 flex justify-center", children: /* @__PURE__ */ i("div", { className: "flex items-center space-x-2", children: [
|
|
1848
1854
|
/* @__PURE__ */ e("div", { className: "w-4 h-4 animate-spin rounded-full border-2 border-primary border-t-transparent" }),
|
|
1849
1855
|
/* @__PURE__ */ e("span", { className: "text-sm text-stone", children: "Loading more..." })
|
|
1850
1856
|
] }) })
|
|
1851
1857
|
] }) })
|
|
1852
1858
|
] });
|
|
1853
|
-
},
|
|
1859
|
+
}, en = ({ className: t }) => /* @__PURE__ */ i(
|
|
1854
1860
|
"svg",
|
|
1855
1861
|
{
|
|
1856
1862
|
width: "140",
|
|
@@ -1984,17 +1990,17 @@ const Ks = ({
|
|
|
1984
1990
|
] })
|
|
1985
1991
|
]
|
|
1986
1992
|
}
|
|
1987
|
-
),
|
|
1993
|
+
), dt = F.memo(
|
|
1988
1994
|
({ 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: [
|
|
1989
|
-
/* @__PURE__ */ e(
|
|
1995
|
+
/* @__PURE__ */ e(en, {}),
|
|
1990
1996
|
s && !t && /* @__PURE__ */ i("div", { className: "mt-8", children: [
|
|
1991
1997
|
/* @__PURE__ */ e("h2", { className: "font-medium text-black text-[18px] mb-2", children: "Your inbox is empty" }),
|
|
1992
1998
|
/* @__PURE__ */ e("p", { className: "text-[#676B5F] text-sm mb-6", children: "Share with your followers to start receiving messages" })
|
|
1993
1999
|
] })
|
|
1994
2000
|
] }) })
|
|
1995
2001
|
);
|
|
1996
|
-
|
|
1997
|
-
const
|
|
2002
|
+
dt.displayName = "EmptyState";
|
|
2003
|
+
const Se = F.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: [
|
|
1998
2004
|
/* @__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: "⚠️" }) }),
|
|
1999
2005
|
/* @__PURE__ */ e("h2", { className: "font-semibold text-charcoal mb-2", children: "Oops!" }),
|
|
2000
2006
|
/* @__PURE__ */ e("p", { className: "text-stone text-sm mb-6", children: t }),
|
|
@@ -2008,8 +2014,8 @@ const Ee = F.memo(({ message: t, onBack: s }) => /* @__PURE__ */ e("div", { clas
|
|
|
2008
2014
|
}
|
|
2009
2015
|
)
|
|
2010
2016
|
] }) }));
|
|
2011
|
-
|
|
2012
|
-
const
|
|
2017
|
+
Se.displayName = "ErrorState";
|
|
2018
|
+
const mn = ({
|
|
2013
2019
|
capabilities: t = {},
|
|
2014
2020
|
className: s,
|
|
2015
2021
|
renderMessageInputActions: n,
|
|
@@ -2018,41 +2024,42 @@ const dn = ({
|
|
|
2018
2024
|
onParticipantSelect: d,
|
|
2019
2025
|
initialParticipantFilter: a,
|
|
2020
2026
|
initialParticipantData: c,
|
|
2021
|
-
CustomChannelEmptyState:
|
|
2022
|
-
showChannelList:
|
|
2023
|
-
filters:
|
|
2027
|
+
CustomChannelEmptyState: f,
|
|
2028
|
+
showChannelList: u = !0,
|
|
2029
|
+
filters: x,
|
|
2024
2030
|
channelRenderFilterFn: C,
|
|
2025
|
-
channelListCustomEmptyStateIndicator:
|
|
2026
|
-
onDeleteConversationClick:
|
|
2027
|
-
onBlockParticipantClick:
|
|
2028
|
-
onReportParticipantClick:
|
|
2029
|
-
dmAgentEnabled:
|
|
2031
|
+
channelListCustomEmptyStateIndicator: E,
|
|
2032
|
+
onDeleteConversationClick: h,
|
|
2033
|
+
onBlockParticipantClick: p,
|
|
2034
|
+
onReportParticipantClick: v,
|
|
2035
|
+
dmAgentEnabled: r,
|
|
2030
2036
|
messageMetadata: M,
|
|
2031
|
-
onMessageSent:
|
|
2032
|
-
showStarButton:
|
|
2033
|
-
chatbotVotingEnabled:
|
|
2034
|
-
renderMessagePreview:
|
|
2035
|
-
renderChannelBanner:
|
|
2036
|
-
customProfileContent:
|
|
2037
|
-
customChannelActions:
|
|
2038
|
-
renderMessage:
|
|
2039
|
-
|
|
2040
|
-
|
|
2037
|
+
onMessageSent: S,
|
|
2038
|
+
showStarButton: N = !1,
|
|
2039
|
+
chatbotVotingEnabled: w = !1,
|
|
2040
|
+
renderMessagePreview: R,
|
|
2041
|
+
renderChannelBanner: g,
|
|
2042
|
+
customProfileContent: m,
|
|
2043
|
+
customChannelActions: y,
|
|
2044
|
+
renderMessage: b,
|
|
2045
|
+
onAttachmentUnlockClick: _,
|
|
2046
|
+
onAttachmentDownloadClick: k,
|
|
2047
|
+
onAttachmentUnlocked: Y
|
|
2041
2048
|
}) => {
|
|
2042
2049
|
const {
|
|
2043
2050
|
service: G,
|
|
2044
|
-
client:
|
|
2051
|
+
client: D,
|
|
2045
2052
|
isConnected: j,
|
|
2046
|
-
isLoading:
|
|
2053
|
+
isLoading: te,
|
|
2047
2054
|
error: Z,
|
|
2048
2055
|
refreshConnection: J,
|
|
2049
2056
|
debug: P
|
|
2050
|
-
} =
|
|
2057
|
+
} = ls(), [W, z] = T(null), [de, O] = T(!1), [L, H] = T(!1), [K, se] = T(!1), [xe, ne] = T(/* @__PURE__ */ new Set()), [re, je] = T(0), [q, me] = T(!1), [oe, le] = T(null), ae = ee(null), {
|
|
2051
2058
|
participantSource: fe,
|
|
2052
2059
|
participantLabel: ge = "participants",
|
|
2053
|
-
showDeleteConversation:
|
|
2054
|
-
} = t,
|
|
2055
|
-
const I =
|
|
2060
|
+
showDeleteConversation: be = !0
|
|
2061
|
+
} = t, Ce = F.useMemo(() => {
|
|
2062
|
+
const I = D == null ? void 0 : D.userID;
|
|
2056
2063
|
return {
|
|
2057
2064
|
...{
|
|
2058
2065
|
type: "messaging",
|
|
@@ -2062,15 +2069,15 @@ const dn = ({
|
|
|
2062
2069
|
hidden: !1
|
|
2063
2070
|
}
|
|
2064
2071
|
},
|
|
2065
|
-
...
|
|
2072
|
+
...x
|
|
2066
2073
|
};
|
|
2067
|
-
}, [
|
|
2068
|
-
if (!
|
|
2069
|
-
const I =
|
|
2074
|
+
}, [x, D == null ? void 0 : D.userID]), ie = ee(null), Q = U(async () => {
|
|
2075
|
+
if (!D || !j) return;
|
|
2076
|
+
const I = D.userID;
|
|
2070
2077
|
if (I)
|
|
2071
2078
|
try {
|
|
2072
2079
|
P && console.log("[MessagingShell] Syncing channels for user:", I);
|
|
2073
|
-
const
|
|
2080
|
+
const V = await D.queryChannels(
|
|
2074
2081
|
{
|
|
2075
2082
|
type: "messaging",
|
|
2076
2083
|
members: { $in: [I] }
|
|
@@ -2078,45 +2085,45 @@ const dn = ({
|
|
|
2078
2085
|
{},
|
|
2079
2086
|
{ limit: 100 }
|
|
2080
2087
|
), B = /* @__PURE__ */ new Set();
|
|
2081
|
-
|
|
2082
|
-
const
|
|
2083
|
-
Object.values(
|
|
2084
|
-
var
|
|
2085
|
-
const
|
|
2086
|
-
|
|
2088
|
+
V.forEach(($) => {
|
|
2089
|
+
const Te = $.state.members;
|
|
2090
|
+
Object.values(Te).forEach((ft) => {
|
|
2091
|
+
var $e;
|
|
2092
|
+
const De = ($e = ft.user) == null ? void 0 : $e.id;
|
|
2093
|
+
De && De !== I && B.add(De);
|
|
2087
2094
|
});
|
|
2088
|
-
}),
|
|
2089
|
-
channelCount:
|
|
2095
|
+
}), ne(($) => $.size === B.size && [...$].every((Te) => B.has(Te)) ? $ : B), O(V.length > 0), H(!0), ie.current = I, P && console.log("[MessagingShell] Channels synced successfully:", {
|
|
2096
|
+
channelCount: V.length,
|
|
2090
2097
|
memberCount: B.size
|
|
2091
2098
|
});
|
|
2092
|
-
} catch (
|
|
2093
|
-
console.error("[MessagingShell] Failed to sync channels:",
|
|
2099
|
+
} catch (V) {
|
|
2100
|
+
console.error("[MessagingShell] Failed to sync channels:", V);
|
|
2094
2101
|
}
|
|
2095
|
-
}, [
|
|
2102
|
+
}, [D, j, P]);
|
|
2096
2103
|
X(() => {
|
|
2097
|
-
if (!
|
|
2098
|
-
const I =
|
|
2099
|
-
I &&
|
|
2100
|
-
}, [
|
|
2101
|
-
if (!a || !
|
|
2104
|
+
if (!D || !j) return;
|
|
2105
|
+
const I = D.userID;
|
|
2106
|
+
I && ie.current !== I && Q();
|
|
2107
|
+
}, [D, j, Q]), X(() => {
|
|
2108
|
+
if (!a || !D || !j) return;
|
|
2102
2109
|
(async () => {
|
|
2103
|
-
const
|
|
2104
|
-
if (
|
|
2110
|
+
const V = D.userID;
|
|
2111
|
+
if (V)
|
|
2105
2112
|
try {
|
|
2106
2113
|
P && console.log(
|
|
2107
2114
|
"[MessagingShell] Loading initial conversation with:",
|
|
2108
2115
|
a
|
|
2109
2116
|
);
|
|
2110
|
-
const B = await
|
|
2117
|
+
const B = await D.queryChannels(
|
|
2111
2118
|
{
|
|
2112
2119
|
type: "messaging",
|
|
2113
|
-
members: { $eq: [
|
|
2120
|
+
members: { $eq: [V, a] }
|
|
2114
2121
|
},
|
|
2115
2122
|
{},
|
|
2116
2123
|
{ limit: 1 }
|
|
2117
2124
|
);
|
|
2118
2125
|
if (B.length > 0)
|
|
2119
|
-
z(B[0]), me(!0),
|
|
2126
|
+
z(B[0]), me(!0), le(null), l && l(B[0]), P && console.log(
|
|
2120
2127
|
"[MessagingShell] Initial conversation loaded:",
|
|
2121
2128
|
B[0].id
|
|
2122
2129
|
);
|
|
@@ -2132,7 +2139,7 @@ const dn = ({
|
|
|
2132
2139
|
email: c.email,
|
|
2133
2140
|
phone: c.phone
|
|
2134
2141
|
});
|
|
2135
|
-
z($), me(!0),
|
|
2142
|
+
z($), me(!0), le(null), l && l($), P && console.log(
|
|
2136
2143
|
"[MessagingShell] Channel created and loaded:",
|
|
2137
2144
|
$.id
|
|
2138
2145
|
);
|
|
@@ -2140,10 +2147,10 @@ const dn = ({
|
|
|
2140
2147
|
console.error(
|
|
2141
2148
|
"[MessagingShell] Failed to create conversation:",
|
|
2142
2149
|
$
|
|
2143
|
-
),
|
|
2150
|
+
), le("Failed to create conversation");
|
|
2144
2151
|
}
|
|
2145
2152
|
} else
|
|
2146
|
-
|
|
2153
|
+
le(
|
|
2147
2154
|
"No conversation found with this account"
|
|
2148
2155
|
), P && console.log(
|
|
2149
2156
|
"[MessagingShell] No conversation found for:",
|
|
@@ -2153,28 +2160,28 @@ const dn = ({
|
|
|
2153
2160
|
console.error(
|
|
2154
2161
|
"[MessagingShell] Failed to load initial conversation:",
|
|
2155
2162
|
B
|
|
2156
|
-
),
|
|
2163
|
+
), le("Failed to load conversation");
|
|
2157
2164
|
}
|
|
2158
2165
|
})();
|
|
2159
2166
|
}, [
|
|
2160
2167
|
a,
|
|
2161
2168
|
c,
|
|
2162
|
-
|
|
2169
|
+
D,
|
|
2163
2170
|
j,
|
|
2164
2171
|
G,
|
|
2165
2172
|
P,
|
|
2166
2173
|
l
|
|
2167
2174
|
]);
|
|
2168
|
-
const
|
|
2175
|
+
const Ne = U(
|
|
2169
2176
|
(I) => {
|
|
2170
2177
|
z(I), l == null || l(I);
|
|
2171
2178
|
},
|
|
2172
2179
|
[l]
|
|
2173
|
-
),
|
|
2180
|
+
), ye = U(() => {
|
|
2174
2181
|
q || z(null);
|
|
2175
2182
|
}, [q]), pe = U(
|
|
2176
2183
|
async (I) => {
|
|
2177
|
-
var
|
|
2184
|
+
var V;
|
|
2178
2185
|
if (G)
|
|
2179
2186
|
try {
|
|
2180
2187
|
P && console.log(
|
|
@@ -2192,38 +2199,38 @@ const dn = ({
|
|
|
2192
2199
|
} catch ($) {
|
|
2193
2200
|
console.warn("[MessagingShell] Failed to unhide channel:", $);
|
|
2194
2201
|
}
|
|
2195
|
-
z(B),
|
|
2202
|
+
z(B), se(!1), (V = ae.current) == null || V.close(), d == null || d(I);
|
|
2196
2203
|
} catch (B) {
|
|
2197
2204
|
console.error("[MessagingShell] Failed to start conversation:", B);
|
|
2198
2205
|
}
|
|
2199
2206
|
},
|
|
2200
2207
|
[G, d, P]
|
|
2201
|
-
),
|
|
2208
|
+
), ve = U(() => {
|
|
2202
2209
|
var I;
|
|
2203
|
-
|
|
2204
|
-
}, []),
|
|
2210
|
+
se(!1), (I = ae.current) == null || I.close();
|
|
2211
|
+
}, []), mt = U(
|
|
2205
2212
|
(I) => {
|
|
2206
|
-
I.target ===
|
|
2213
|
+
I.target === ae.current && ve();
|
|
2207
2214
|
},
|
|
2208
|
-
[
|
|
2209
|
-
),
|
|
2215
|
+
[ve]
|
|
2216
|
+
), ut = U(
|
|
2210
2217
|
async (I) => {
|
|
2211
|
-
P && console.log("[MessagingShell] Leaving conversation:", I.id), z(null), me(!1),
|
|
2218
|
+
P && console.log("[MessagingShell] Leaving conversation:", I.id), z(null), me(!1), ie.current = null, await Q();
|
|
2212
2219
|
},
|
|
2213
|
-
[
|
|
2214
|
-
),
|
|
2220
|
+
[Q, P]
|
|
2221
|
+
), ht = U(
|
|
2215
2222
|
async (I) => {
|
|
2216
|
-
P && console.log("[MessagingShell] Blocking participant:", I), z(null), me(!1),
|
|
2223
|
+
P && console.log("[MessagingShell] Blocking participant:", I), z(null), me(!1), ie.current = null, await Q();
|
|
2217
2224
|
},
|
|
2218
|
-
[
|
|
2219
|
-
),
|
|
2220
|
-
return
|
|
2221
|
-
|
|
2225
|
+
[Q, P]
|
|
2226
|
+
), we = !!W;
|
|
2227
|
+
return te ? /* @__PURE__ */ e("div", { className: A("h-full", s), children: /* @__PURE__ */ e(Ie, {}) }) : Z ? /* @__PURE__ */ e("div", { className: A("h-full", s), children: /* @__PURE__ */ e(Se, { message: Z, onBack: J }) }) : !j || !D ? /* @__PURE__ */ e("div", { className: A("h-full", s), children: /* @__PURE__ */ e(
|
|
2228
|
+
Se,
|
|
2222
2229
|
{
|
|
2223
2230
|
message: "Not connected to messaging service",
|
|
2224
2231
|
onBack: J
|
|
2225
2232
|
}
|
|
2226
|
-
) }) :
|
|
2233
|
+
) }) : oe ? /* @__PURE__ */ e("div", { className: A("h-full", s), children: /* @__PURE__ */ e(Se, { message: oe }) }) : /* @__PURE__ */ i(
|
|
2227
2234
|
"div",
|
|
2228
2235
|
{
|
|
2229
2236
|
className: A(
|
|
@@ -2238,22 +2245,22 @@ const dn = ({
|
|
|
2238
2245
|
className: A(
|
|
2239
2246
|
"messaging-channel-list-sidebar min-h-0 min-w-0 lg:flex lg:flex-col",
|
|
2240
2247
|
{
|
|
2241
|
-
"!hidden":
|
|
2248
|
+
"!hidden": u === !1 || q,
|
|
2242
2249
|
// Hide on mobile when channel selected, show on desktop with consistent wide width
|
|
2243
|
-
"hidden lg:flex lg:flex-1 lg:max-w-2xl":
|
|
2250
|
+
"hidden lg:flex lg:flex-1 lg:max-w-2xl": u !== !1 && !q && we,
|
|
2244
2251
|
// Show on mobile when no channel selected, use same wide width on desktop
|
|
2245
|
-
"flex flex-col w-full lg:flex-1 lg:max-w-2xl":
|
|
2252
|
+
"flex flex-col w-full lg:flex-1 lg:max-w-2xl": u !== !1 && !q && !we
|
|
2246
2253
|
}
|
|
2247
2254
|
),
|
|
2248
2255
|
children: /* @__PURE__ */ e(
|
|
2249
|
-
|
|
2256
|
+
ot,
|
|
2250
2257
|
{
|
|
2251
|
-
onChannelSelect:
|
|
2252
|
-
selectedChannel:
|
|
2253
|
-
filters:
|
|
2258
|
+
onChannelSelect: Ne,
|
|
2259
|
+
selectedChannel: W || void 0,
|
|
2260
|
+
filters: Ce,
|
|
2254
2261
|
channelRenderFilterFn: C,
|
|
2255
|
-
customEmptyStateIndicator:
|
|
2256
|
-
renderMessagePreview:
|
|
2262
|
+
customEmptyStateIndicator: E,
|
|
2263
|
+
renderMessagePreview: R
|
|
2257
2264
|
}
|
|
2258
2265
|
)
|
|
2259
2266
|
}
|
|
@@ -2265,47 +2272,48 @@ const dn = ({
|
|
|
2265
2272
|
"messaging-conversation-view flex-1 flex-col min-w-0 min-h-0",
|
|
2266
2273
|
{
|
|
2267
2274
|
// In direct conversation mode (or waiting for it), always show (full width)
|
|
2268
|
-
flex: q ||
|
|
2275
|
+
flex: q || we || a,
|
|
2269
2276
|
// Normal mode: hide on mobile when no channel selected
|
|
2270
|
-
"hidden lg:flex": !q && !
|
|
2277
|
+
"hidden lg:flex": !q && !we && !a
|
|
2271
2278
|
}
|
|
2272
2279
|
),
|
|
2273
|
-
children:
|
|
2274
|
-
|
|
2280
|
+
children: W ? /* @__PURE__ */ e("div", { className: "flex-1 min-h-0 flex flex-col", children: /* @__PURE__ */ e(
|
|
2281
|
+
ct,
|
|
2275
2282
|
{
|
|
2276
|
-
channel:
|
|
2277
|
-
onBack:
|
|
2283
|
+
channel: W,
|
|
2284
|
+
onBack: ye,
|
|
2278
2285
|
showBackButton: !q,
|
|
2279
2286
|
renderMessageInputActions: n,
|
|
2280
2287
|
renderConversationFooter: o,
|
|
2281
|
-
renderChannelBanner:
|
|
2282
|
-
onLeaveConversation:
|
|
2283
|
-
onBlockParticipant:
|
|
2284
|
-
CustomChannelEmptyState:
|
|
2285
|
-
showDeleteConversation:
|
|
2286
|
-
onDeleteConversationClick:
|
|
2287
|
-
onBlockParticipantClick:
|
|
2288
|
-
onReportParticipantClick:
|
|
2289
|
-
dmAgentEnabled:
|
|
2288
|
+
renderChannelBanner: g,
|
|
2289
|
+
onLeaveConversation: ut,
|
|
2290
|
+
onBlockParticipant: ht,
|
|
2291
|
+
CustomChannelEmptyState: f,
|
|
2292
|
+
showDeleteConversation: be,
|
|
2293
|
+
onDeleteConversationClick: h,
|
|
2294
|
+
onBlockParticipantClick: p,
|
|
2295
|
+
onReportParticipantClick: v,
|
|
2296
|
+
dmAgentEnabled: r,
|
|
2290
2297
|
messageMetadata: M,
|
|
2291
|
-
onMessageSent:
|
|
2292
|
-
showStarButton:
|
|
2293
|
-
chatbotVotingEnabled:
|
|
2294
|
-
customProfileContent:
|
|
2295
|
-
customChannelActions:
|
|
2296
|
-
renderMessage:
|
|
2297
|
-
|
|
2298
|
-
|
|
2298
|
+
onMessageSent: S,
|
|
2299
|
+
showStarButton: N,
|
|
2300
|
+
chatbotVotingEnabled: w,
|
|
2301
|
+
customProfileContent: m,
|
|
2302
|
+
customChannelActions: y,
|
|
2303
|
+
renderMessage: b,
|
|
2304
|
+
onAttachmentUnlockClick: _,
|
|
2305
|
+
onAttachmentDownloadClick: k,
|
|
2306
|
+
onAttachmentUnlocked: Y
|
|
2299
2307
|
},
|
|
2300
|
-
|
|
2308
|
+
W.id
|
|
2301
2309
|
) }) : a ? (
|
|
2302
2310
|
// Show loading while creating/loading direct conversation channel
|
|
2303
|
-
/* @__PURE__ */ e(
|
|
2311
|
+
/* @__PURE__ */ e(Ie, {})
|
|
2304
2312
|
) : /* @__PURE__ */ e(
|
|
2305
|
-
|
|
2313
|
+
dt,
|
|
2306
2314
|
{
|
|
2307
|
-
hasChannels:
|
|
2308
|
-
channelsLoaded:
|
|
2315
|
+
hasChannels: de,
|
|
2316
|
+
channelsLoaded: L
|
|
2309
2317
|
}
|
|
2310
2318
|
)
|
|
2311
2319
|
}
|
|
@@ -2315,28 +2323,28 @@ const dn = ({
|
|
|
2315
2323
|
/* @__PURE__ */ e(
|
|
2316
2324
|
"dialog",
|
|
2317
2325
|
{
|
|
2318
|
-
ref:
|
|
2326
|
+
ref: ae,
|
|
2319
2327
|
className: "mes-dialog",
|
|
2320
|
-
onClick:
|
|
2321
|
-
onClose:
|
|
2328
|
+
onClick: mt,
|
|
2329
|
+
onClose: ve,
|
|
2322
2330
|
children: /* @__PURE__ */ e("div", { className: "h-full w-full bg-white shadow-max-elevation-light", children: /* @__PURE__ */ e(
|
|
2323
|
-
|
|
2331
|
+
Qs,
|
|
2324
2332
|
{
|
|
2325
2333
|
participantSource: fe,
|
|
2326
2334
|
onSelectParticipant: pe,
|
|
2327
|
-
onClose:
|
|
2328
|
-
existingParticipantIds:
|
|
2335
|
+
onClose: ve,
|
|
2336
|
+
existingParticipantIds: xe,
|
|
2329
2337
|
participantLabel: ge,
|
|
2330
2338
|
searchPlaceholder: `Search ${ge}...`
|
|
2331
2339
|
},
|
|
2332
|
-
|
|
2340
|
+
re
|
|
2333
2341
|
) })
|
|
2334
2342
|
}
|
|
2335
2343
|
)
|
|
2336
2344
|
]
|
|
2337
2345
|
}
|
|
2338
2346
|
);
|
|
2339
|
-
},
|
|
2347
|
+
}, tn = ({
|
|
2340
2348
|
question: t,
|
|
2341
2349
|
onClick: s,
|
|
2342
2350
|
loading: n = !1,
|
|
@@ -2358,7 +2366,7 @@ const dn = ({
|
|
|
2358
2366
|
),
|
|
2359
2367
|
children: t
|
|
2360
2368
|
}
|
|
2361
|
-
),
|
|
2369
|
+
), un = ({
|
|
2362
2370
|
faqs: t,
|
|
2363
2371
|
onFaqClick: s,
|
|
2364
2372
|
loadingFaqId: n,
|
|
@@ -2367,10 +2375,10 @@ const dn = ({
|
|
|
2367
2375
|
avatarImage: d,
|
|
2368
2376
|
avatarName: a
|
|
2369
2377
|
}) => {
|
|
2370
|
-
const c = t.filter((
|
|
2378
|
+
const c = t.filter((f) => f.enabled).sort((f, u) => (f.order ?? 0) - (u.order ?? 0));
|
|
2371
2379
|
return c.length === 0 ? null : /* @__PURE__ */ e("div", { className: l, children: /* @__PURE__ */ i("div", { className: "flex gap-3 items-end", children: [
|
|
2372
2380
|
(d || a) && /* @__PURE__ */ e("div", { className: "flex-none", children: /* @__PURE__ */ e(
|
|
2373
|
-
|
|
2381
|
+
ce,
|
|
2374
2382
|
{
|
|
2375
2383
|
id: a || "account",
|
|
2376
2384
|
name: a || "Account",
|
|
@@ -2386,76 +2394,76 @@ const dn = ({
|
|
|
2386
2394
|
style: { backgroundColor: "#F1F0EE" },
|
|
2387
2395
|
children: [
|
|
2388
2396
|
o && /* @__PURE__ */ e("p", { className: "text-md text-charcoal mb-4", children: o }),
|
|
2389
|
-
c.map((
|
|
2390
|
-
|
|
2397
|
+
c.map((f) => /* @__PURE__ */ e(
|
|
2398
|
+
tn,
|
|
2391
2399
|
{
|
|
2392
|
-
question:
|
|
2393
|
-
onClick: () => s(
|
|
2394
|
-
loading: n ===
|
|
2400
|
+
question: f.question,
|
|
2401
|
+
onClick: () => s(f.id),
|
|
2402
|
+
loading: n === f.id
|
|
2395
2403
|
},
|
|
2396
|
-
|
|
2404
|
+
f.id
|
|
2397
2405
|
))
|
|
2398
2406
|
]
|
|
2399
2407
|
}
|
|
2400
2408
|
)
|
|
2401
2409
|
] }) });
|
|
2402
|
-
},
|
|
2403
|
-
const { initialSearch: n = "", pageSize: o = 20 } = s, [l, d] =
|
|
2410
|
+
}, hn = (t, s = {}) => {
|
|
2411
|
+
const { initialSearch: n = "", pageSize: o = 20 } = s, [l, d] = T([]), [a, c] = T(!1), [f, u] = T(null), [x, C] = T(n), [E, h] = T(!0), [p, v] = T(), r = U(async (w = !1, R) => {
|
|
2404
2412
|
if (a) return;
|
|
2405
|
-
const
|
|
2406
|
-
c(!0),
|
|
2413
|
+
const g = R !== void 0 ? R : x;
|
|
2414
|
+
c(!0), u(null);
|
|
2407
2415
|
try {
|
|
2408
|
-
const
|
|
2409
|
-
search:
|
|
2416
|
+
const m = await t.loadParticipants({
|
|
2417
|
+
search: g || void 0,
|
|
2410
2418
|
limit: o,
|
|
2411
|
-
cursor:
|
|
2419
|
+
cursor: w ? void 0 : p
|
|
2412
2420
|
});
|
|
2413
2421
|
d(
|
|
2414
|
-
(
|
|
2415
|
-
), m
|
|
2416
|
-
} catch (
|
|
2417
|
-
const
|
|
2418
|
-
|
|
2422
|
+
(y) => w ? m.participants : [...y, ...m.participants]
|
|
2423
|
+
), h(m.hasMore), v(m.nextCursor);
|
|
2424
|
+
} catch (m) {
|
|
2425
|
+
const y = m instanceof Error ? m.message : "Failed to load participants";
|
|
2426
|
+
u(y), console.error("[useParticipants] Load error:", m);
|
|
2419
2427
|
} finally {
|
|
2420
2428
|
c(!1);
|
|
2421
2429
|
}
|
|
2422
|
-
}, [t,
|
|
2423
|
-
|
|
2424
|
-
}, [
|
|
2425
|
-
C(
|
|
2426
|
-
}, [
|
|
2427
|
-
|
|
2428
|
-
}, [
|
|
2430
|
+
}, [t, x, p, o, a]), M = U(() => {
|
|
2431
|
+
E && !a && r(!1);
|
|
2432
|
+
}, [E, a, r]), S = U((w) => {
|
|
2433
|
+
C(w), v(void 0), r(!0, w);
|
|
2434
|
+
}, [r]), N = U(() => {
|
|
2435
|
+
v(void 0), r(!0);
|
|
2436
|
+
}, [r]);
|
|
2429
2437
|
return X(() => {
|
|
2430
|
-
|
|
2438
|
+
r(!0);
|
|
2431
2439
|
}, [t.loadParticipants]), {
|
|
2432
2440
|
participants: l,
|
|
2433
2441
|
loading: a,
|
|
2434
|
-
error:
|
|
2435
|
-
searchQuery:
|
|
2436
|
-
hasMore:
|
|
2442
|
+
error: f,
|
|
2443
|
+
searchQuery: x,
|
|
2444
|
+
hasMore: E,
|
|
2437
2445
|
totalCount: t.totalCount,
|
|
2438
2446
|
loadMore: M,
|
|
2439
|
-
search:
|
|
2440
|
-
refresh:
|
|
2447
|
+
search: S,
|
|
2448
|
+
refresh: N
|
|
2441
2449
|
};
|
|
2442
2450
|
};
|
|
2443
2451
|
export {
|
|
2444
|
-
|
|
2445
|
-
|
|
2446
|
-
|
|
2447
|
-
|
|
2448
|
-
|
|
2449
|
-
|
|
2450
|
-
|
|
2451
|
-
|
|
2452
|
-
|
|
2453
|
-
|
|
2454
|
-
|
|
2455
|
-
|
|
2456
|
-
|
|
2457
|
-
|
|
2458
|
-
|
|
2459
|
-
|
|
2452
|
+
_e as ActionButton,
|
|
2453
|
+
ce as Avatar,
|
|
2454
|
+
qs as ChannelEmptyState,
|
|
2455
|
+
ot as ChannelList,
|
|
2456
|
+
ct as ChannelView,
|
|
2457
|
+
un as FaqList,
|
|
2458
|
+
tn as FaqListItem,
|
|
2459
|
+
Is as LockedAttachment,
|
|
2460
|
+
Ts as MessageVoteButtons,
|
|
2461
|
+
dn as MessagingProvider,
|
|
2462
|
+
mn as MessagingShell,
|
|
2463
|
+
Qs as ParticipantPicker,
|
|
2464
|
+
us as formatRelativeTime,
|
|
2465
|
+
_s as useMessageVote,
|
|
2466
|
+
ls as useMessaging,
|
|
2467
|
+
hn as useParticipants
|
|
2460
2468
|
};
|
|
2461
2469
|
//# sourceMappingURL=index.js.map
|