@linktr.ee/messaging-react 1.28.0-rc-1776231821 → 1.28.0
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-BFpHsh2u.js → Creator-VyMyIk2b.js} +126 -114
- package/dist/Creator-VyMyIk2b.js.map +1 -0
- package/dist/{MediaPlayer-DXz4IBLx.js → MediaPlayer-Bf-xPB8Z.js} +99 -94
- package/dist/MediaPlayer-Bf-xPB8Z.js.map +1 -0
- package/dist/Visitor-C4WqnN8H.js +218 -0
- package/dist/Visitor-C4WqnN8H.js.map +1 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.js +640 -636
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/LockedAttachment/LockedAttachment.stories.tsx +24 -7
- package/src/components/LockedAttachment/components/Creator.tsx +25 -5
- package/src/components/LockedAttachment/components/MediaPlayer.tsx +10 -2
- package/src/components/LockedAttachment/components/Visitor.tsx +75 -33
- package/src/components/MessagingShell/index.tsx +4 -0
- package/dist/Creator-BFpHsh2u.js.map +0 -1
- package/dist/MediaPlayer-DXz4IBLx.js.map +0 -1
- package/dist/Visitor-C1Fcrgd6.js +0 -199
- package/dist/Visitor-C1Fcrgd6.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 L from "classnames";
|
|
3
|
-
import F, { createContext as
|
|
4
|
-
import { StreamChatService as
|
|
5
|
-
import { Chat as
|
|
6
|
-
import { StarIcon as Ue, GiftIcon as
|
|
7
|
-
import { LinkPreviewsManager as
|
|
8
|
-
const
|
|
3
|
+
import F, { createContext as ft, useContext as gt, useCallback as U, useState as k, useRef as Q, useEffect as X, useMemo as Le, Suspense as je } from "react";
|
|
4
|
+
import { StreamChatService as xt } from "@linktr.ee/messaging-core";
|
|
5
|
+
import { Chat as bt, ChannelList as Ct, DateSeparator as Nt, useChannelStateContext as Ie, useChatContext as Ke, areMessageUIPropsEqual as pt, useMessageReminder as yt, useComponentContext as vt, Attachment as wt, EditMessageModal as _t, MessageBlocked as Et, MessageBouncePrompt as St, MessageDeleted as It, MessageIsThreadReplyInChannelButtonIndicator as Mt, MessageRepliesCountButton as kt, ReminderNotification as Tt, StreamedMessageText as Dt, messageHasAttachments as Rt, messageHasReactions as At, isDateSeparatorMessage as Lt, isMessageBlocked as Ut, isMessageBounced as Pt, MessageBounceModal as Ft, MessageText as ze, Poll as Ot, MessageErrorIcon as Bt, useMessageContext as Qe, useMessageComposer as Gt, useStateStore as $t, MessageInput as jt, useMessageInputContext as zt, useMessageComposerHasSendableData as Ht, SimpleAttachmentSelector as Vt, QuotedMessagePreview as Yt, AttachmentPreviewList as Wt, TextareaComposer as qt, MessageTimestamp as De, Channel as Zt, WithComponents as Jt, Window as Xt, MessageList as Kt } from "stream-chat-react";
|
|
6
|
+
import { StarIcon as Ue, GiftIcon as Qt, XIcon as Oe, SpinnerGapIcon as _e, SignOutIcon as es, ProhibitInsetIcon as He, FlagIcon as ts, ArrowUpIcon as ss, SparkleIcon as ns, ProhibitIcon as as, ArrowLeftIcon as Ve, DotsThreeIcon as Ye, MagnifyingGlassIcon as rs, ChatCircleDotsIcon as We } from "@phosphor-icons/react";
|
|
7
|
+
import { LinkPreviewsManager as qe } from "stream-chat";
|
|
8
|
+
const et = ft({
|
|
9
9
|
service: null,
|
|
10
10
|
client: null,
|
|
11
11
|
isConnected: !1,
|
|
@@ -15,7 +15,7 @@ const Qe = ut({
|
|
|
15
15
|
refreshConnection: async () => {
|
|
16
16
|
},
|
|
17
17
|
debug: !1
|
|
18
|
-
}), Me = () =>
|
|
18
|
+
}), Me = () => gt(et), ln = ({
|
|
19
19
|
children: t,
|
|
20
20
|
user: s,
|
|
21
21
|
serviceConfig: n,
|
|
@@ -35,28 +35,28 @@ const Qe = ut({
|
|
|
35
35
|
serviceConfig: !!n,
|
|
36
36
|
capabilities: Object.keys(l)
|
|
37
37
|
});
|
|
38
|
-
const [c, g] =
|
|
38
|
+
const [c, g] = k(null), [h, b] = k(null), [C, E] = k(!1), [m, S] = k(!1), [o, y] = k(null), M = Q(!1), N = Q({
|
|
39
39
|
userId: s == null ? void 0 : s.id,
|
|
40
40
|
apiKey: r,
|
|
41
41
|
serviceConfig: n,
|
|
42
42
|
capabilities: l
|
|
43
|
-
}),
|
|
44
|
-
|
|
45
|
-
renderCount:
|
|
43
|
+
}), v = Q(0);
|
|
44
|
+
v.current++, a("📊 RENDER INFO", {
|
|
45
|
+
renderCount: v.current,
|
|
46
46
|
currentProps: { userId: s == null ? void 0 : s.id, apiKey: (r == null ? void 0 : r.substring(0, 8)) + "..." },
|
|
47
47
|
propChanges: {
|
|
48
|
-
userChanged:
|
|
49
|
-
apiKeyChanged:
|
|
50
|
-
serviceConfigChanged:
|
|
51
|
-
capabilitiesChanged:
|
|
48
|
+
userChanged: N.current.userId !== (s == null ? void 0 : s.id),
|
|
49
|
+
apiKeyChanged: N.current.apiKey !== r,
|
|
50
|
+
serviceConfigChanged: N.current.serviceConfig !== n,
|
|
51
|
+
capabilitiesChanged: N.current.capabilities !== l
|
|
52
52
|
}
|
|
53
|
-
}),
|
|
53
|
+
}), N.current = {
|
|
54
54
|
userId: s == null ? void 0 : s.id,
|
|
55
55
|
apiKey: r,
|
|
56
56
|
serviceConfig: n,
|
|
57
57
|
capabilities: l
|
|
58
|
-
},
|
|
59
|
-
const u =
|
|
58
|
+
}, X(() => {
|
|
59
|
+
const u = v.current;
|
|
60
60
|
if (a("🔧 SERVICE INIT EFFECT TRIGGERED", {
|
|
61
61
|
renderCount: u,
|
|
62
62
|
apiKey: !!r,
|
|
@@ -64,8 +64,8 @@ const Qe = ut({
|
|
|
64
64
|
dependencies: {
|
|
65
65
|
apiKey: (r == null ? void 0 : r.substring(0, 8)) + "...",
|
|
66
66
|
serviceConfigRef: n,
|
|
67
|
-
serviceConfigStable:
|
|
68
|
-
apiKeyStable:
|
|
67
|
+
serviceConfigStable: N.current.serviceConfig === n,
|
|
68
|
+
apiKeyStable: N.current.apiKey === r
|
|
69
69
|
}
|
|
70
70
|
}), !r || !n) {
|
|
71
71
|
a("⚠️ SERVICE INIT SKIPPED", {
|
|
@@ -77,9 +77,9 @@ const Qe = ut({
|
|
|
77
77
|
a("🚀 CREATING NEW SERVICE", {
|
|
78
78
|
renderCount: u,
|
|
79
79
|
apiKey: (r == null ? void 0 : r.substring(0, 8)) + "...",
|
|
80
|
-
serviceConfigChanged:
|
|
80
|
+
serviceConfigChanged: N.current.serviceConfig !== n
|
|
81
81
|
});
|
|
82
|
-
const f = new
|
|
82
|
+
const f = new xt({
|
|
83
83
|
...n,
|
|
84
84
|
apiKey: r,
|
|
85
85
|
debug: d
|
|
@@ -94,25 +94,25 @@ const Qe = ut({
|
|
|
94
94
|
}), f.disconnectUser().catch(console.error);
|
|
95
95
|
};
|
|
96
96
|
}, [r, n, d, a]);
|
|
97
|
-
const
|
|
98
|
-
|
|
99
|
-
var f,
|
|
97
|
+
const w = Q(null);
|
|
98
|
+
X(() => {
|
|
99
|
+
var f, _;
|
|
100
100
|
if (a("🔗 USER CONNECTION EFFECT TRIGGERED", {
|
|
101
101
|
hasService: !!c,
|
|
102
102
|
hasUser: !!s,
|
|
103
103
|
userId: s == null ? void 0 : s.id,
|
|
104
|
-
isConnecting:
|
|
105
|
-
isConnected:
|
|
104
|
+
isConnecting: M.current,
|
|
105
|
+
isConnected: C,
|
|
106
106
|
dependencies: { service: !!c, userId: s == null ? void 0 : s.id }
|
|
107
107
|
}), !c || !s) {
|
|
108
108
|
a("⚠️ USER CONNECTION SKIPPED", "Missing service or user");
|
|
109
109
|
return;
|
|
110
110
|
}
|
|
111
|
-
if (
|
|
111
|
+
if (M.current) {
|
|
112
112
|
a("⚠️ USER CONNECTION SKIPPED", "Already connecting");
|
|
113
113
|
return;
|
|
114
114
|
}
|
|
115
|
-
if (((f =
|
|
115
|
+
if (((f = w.current) == null ? void 0 : f.serviceId) === c && ((_ = w.current) == null ? void 0 : _.userId) === s.id) {
|
|
116
116
|
a(
|
|
117
117
|
"⚠️ USER CONNECTION SKIPPED",
|
|
118
118
|
"Already connected this user with this service"
|
|
@@ -120,40 +120,40 @@ const Qe = ut({
|
|
|
120
120
|
return;
|
|
121
121
|
}
|
|
122
122
|
(async () => {
|
|
123
|
-
a("🚀 STARTING USER CONNECTION", { userId: s.id }),
|
|
123
|
+
a("🚀 STARTING USER CONNECTION", { userId: s.id }), M.current = !0, S(!0), y(null);
|
|
124
124
|
try {
|
|
125
125
|
a("📞 CALLING SERVICE.CONNECTUSER", { userId: s.id });
|
|
126
|
-
const
|
|
127
|
-
b(
|
|
126
|
+
const p = await c.connectUser(s);
|
|
127
|
+
b(p), E(!0), w.current = { serviceId: c, userId: s.id }, a("✅ USER CONNECTION SUCCESS", {
|
|
128
128
|
userId: s.id,
|
|
129
|
-
clientId:
|
|
129
|
+
clientId: p.userID
|
|
130
130
|
});
|
|
131
|
-
} catch (
|
|
132
|
-
const
|
|
133
|
-
|
|
131
|
+
} catch (p) {
|
|
132
|
+
const D = p instanceof Error ? p.message : "Connection failed";
|
|
133
|
+
y(D), a("❌ USER CONNECTION ERROR", {
|
|
134
134
|
userId: s.id,
|
|
135
|
-
error:
|
|
135
|
+
error: D
|
|
136
136
|
});
|
|
137
137
|
} finally {
|
|
138
|
-
|
|
138
|
+
S(!1), M.current = !1, a("🔄 USER CONNECTION FINISHED", {
|
|
139
139
|
userId: s.id,
|
|
140
|
-
isConnected:
|
|
140
|
+
isConnected: C
|
|
141
141
|
});
|
|
142
142
|
}
|
|
143
143
|
})();
|
|
144
|
-
}, [c, s, a,
|
|
144
|
+
}, [c, s, a, C]), X(() => (a("🔌 CLEANUP EFFECT REGISTERED", {
|
|
145
145
|
hasService: !!c,
|
|
146
|
-
isConnected:
|
|
146
|
+
isConnected: C
|
|
147
147
|
}), () => {
|
|
148
|
-
c &&
|
|
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
|
-
isConnected:
|
|
153
|
+
isConnected: C
|
|
154
154
|
});
|
|
155
|
-
}), [c,
|
|
156
|
-
const
|
|
155
|
+
}), [c, C, a]);
|
|
156
|
+
const A = U(async () => {
|
|
157
157
|
if (a("🔄 REFRESH CONNECTION CALLED", {
|
|
158
158
|
hasService: !!c,
|
|
159
159
|
hasUser: !!s
|
|
@@ -161,53 +161,53 @@ const Qe = ut({
|
|
|
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 }), S(!0);
|
|
165
165
|
try {
|
|
166
166
|
a("🔌 DISCONNECTING FOR REFRESH"), await c.disconnectUser(), a("📞 RECONNECTING FOR REFRESH");
|
|
167
167
|
const u = await c.connectUser(s);
|
|
168
|
-
b(u),
|
|
168
|
+
b(u), E(!0), y(null), a("✅ CONNECTION REFRESH SUCCESS", { userId: s.id });
|
|
169
169
|
} catch (u) {
|
|
170
170
|
const f = u instanceof Error ? u.message : "Refresh failed";
|
|
171
|
-
|
|
171
|
+
y(f), a("❌ CONNECTION REFRESH ERROR", {
|
|
172
172
|
userId: s.id,
|
|
173
173
|
error: f
|
|
174
174
|
});
|
|
175
175
|
} finally {
|
|
176
|
-
|
|
176
|
+
S(!1), a("🔄 CONNECTION REFRESH FINISHED", { userId: s.id });
|
|
177
177
|
}
|
|
178
178
|
}, [c, s, a]), x = F.useMemo(() => (a("💫 CONTEXT VALUE MEMOIZATION", {
|
|
179
179
|
hasService: !!c,
|
|
180
180
|
hasClient: !!h,
|
|
181
|
-
isConnected:
|
|
181
|
+
isConnected: C,
|
|
182
182
|
isLoading: m,
|
|
183
183
|
hasError: !!o,
|
|
184
184
|
capabilitiesKeys: Object.keys(l)
|
|
185
185
|
}), {
|
|
186
186
|
service: c,
|
|
187
187
|
client: h,
|
|
188
|
-
isConnected:
|
|
188
|
+
isConnected: C,
|
|
189
189
|
isLoading: m,
|
|
190
190
|
error: o,
|
|
191
191
|
capabilities: l,
|
|
192
|
-
refreshConnection:
|
|
192
|
+
refreshConnection: A,
|
|
193
193
|
debug: d
|
|
194
194
|
}), [
|
|
195
195
|
c,
|
|
196
196
|
h,
|
|
197
|
-
|
|
197
|
+
C,
|
|
198
198
|
m,
|
|
199
199
|
o,
|
|
200
200
|
l,
|
|
201
|
-
|
|
201
|
+
A,
|
|
202
202
|
d,
|
|
203
203
|
a
|
|
204
204
|
]);
|
|
205
205
|
return a("🔄 RENDER END", {
|
|
206
|
-
renderCount:
|
|
207
|
-
willRenderChat: !!(h &&
|
|
206
|
+
renderCount: v.current,
|
|
207
|
+
willRenderChat: !!(h && C),
|
|
208
208
|
contextValueReady: !!x
|
|
209
|
-
}), /* @__PURE__ */ e(
|
|
210
|
-
|
|
209
|
+
}), /* @__PURE__ */ e(et.Provider, { value: x, children: h && C ? /* @__PURE__ */ e(
|
|
210
|
+
bt,
|
|
211
211
|
{
|
|
212
212
|
client: h,
|
|
213
213
|
customClasses: {
|
|
@@ -216,18 +216,18 @@ const Qe = ut({
|
|
|
216
216
|
children: t
|
|
217
217
|
}
|
|
218
218
|
) : t });
|
|
219
|
-
},
|
|
219
|
+
}, os = () => Me(), tt = F.createContext({
|
|
220
220
|
selectedChannel: void 0,
|
|
221
221
|
onChannelSelect: () => {
|
|
222
222
|
},
|
|
223
223
|
debug: !1,
|
|
224
224
|
renderMessagePreview: void 0
|
|
225
|
-
}),
|
|
225
|
+
}), ls = tt.Provider, is = () => F.useContext(tt), st = (t) => {
|
|
226
226
|
var r, l;
|
|
227
|
-
const [s, n] =
|
|
227
|
+
const [s, n] = k(
|
|
228
228
|
!!((l = (r = t == null ? void 0 : t.state) == null ? void 0 : r.membership) != null && l.pinned_at)
|
|
229
229
|
);
|
|
230
|
-
return
|
|
230
|
+
return X(() => {
|
|
231
231
|
var a;
|
|
232
232
|
if (!t) {
|
|
233
233
|
n(!1);
|
|
@@ -244,18 +244,18 @@ const Qe = ut({
|
|
|
244
244
|
t.off("member.updated", d);
|
|
245
245
|
};
|
|
246
246
|
}, [t]), s;
|
|
247
|
-
},
|
|
247
|
+
}, cs = (t, s) => {
|
|
248
248
|
const n = new Date(
|
|
249
249
|
Date.UTC(t.getUTCFullYear(), t.getUTCMonth(), t.getUTCDate())
|
|
250
250
|
), l = new Date(
|
|
251
251
|
Date.UTC(s.getUTCFullYear(), s.getUTCMonth(), s.getUTCDate())
|
|
252
252
|
).getTime() - n.getTime();
|
|
253
253
|
return Math.floor(l / (1e3 * 60 * 60 * 24));
|
|
254
|
-
},
|
|
254
|
+
}, ds = (t) => {
|
|
255
255
|
const s = /* @__PURE__ */ new Date();
|
|
256
256
|
if (Math.floor((s.getTime() - t.getTime()) / 1e3) < 60)
|
|
257
257
|
return "Just now";
|
|
258
|
-
const r =
|
|
258
|
+
const r = cs(t, s);
|
|
259
259
|
return r === 0 ? t.toLocaleTimeString([], {
|
|
260
260
|
hour: "numeric",
|
|
261
261
|
minute: "2-digit",
|
|
@@ -265,7 +265,7 @@ const Qe = ut({
|
|
|
265
265
|
day: "numeric",
|
|
266
266
|
year: "2-digit"
|
|
267
267
|
});
|
|
268
|
-
},
|
|
268
|
+
}, Ze = [
|
|
269
269
|
"🍎",
|
|
270
270
|
// Apple
|
|
271
271
|
"🍌",
|
|
@@ -293,7 +293,7 @@ const Qe = ut({
|
|
|
293
293
|
"🍈"
|
|
294
294
|
// Melon
|
|
295
295
|
];
|
|
296
|
-
function
|
|
296
|
+
function ms(t) {
|
|
297
297
|
let s = 0;
|
|
298
298
|
for (let n = 0; n < t.length; n++) {
|
|
299
299
|
const r = t.charCodeAt(n);
|
|
@@ -301,11 +301,11 @@ function cs(t) {
|
|
|
301
301
|
}
|
|
302
302
|
return Math.abs(s);
|
|
303
303
|
}
|
|
304
|
-
function
|
|
305
|
-
const n =
|
|
306
|
-
return
|
|
304
|
+
function us(t) {
|
|
305
|
+
const n = ms(t) % Ze.length;
|
|
306
|
+
return Ze[n];
|
|
307
307
|
}
|
|
308
|
-
const
|
|
308
|
+
const le = ({
|
|
309
309
|
id: t,
|
|
310
310
|
image: s,
|
|
311
311
|
size: n = 40,
|
|
@@ -313,7 +313,7 @@ const oe = ({
|
|
|
313
313
|
starred: l = !1,
|
|
314
314
|
shape: d = "squircle"
|
|
315
315
|
}) => {
|
|
316
|
-
const a =
|
|
316
|
+
const a = us(t), g = n < 32 ? "text-xs" : n < 56 ? "text-sm" : n < 120 ? "text-lg" : "text-4xl", h = d === "circle" ? { borderRadius: "50%" } : {
|
|
317
317
|
borderRadius: "33%",
|
|
318
318
|
"corner-shape": "superellipse(1.3)"
|
|
319
319
|
};
|
|
@@ -355,7 +355,7 @@ const oe = ({
|
|
|
355
355
|
]
|
|
356
356
|
}
|
|
357
357
|
);
|
|
358
|
-
},
|
|
358
|
+
}, hs = ({ size: t = 15 }) => /* @__PURE__ */ e(
|
|
359
359
|
"svg",
|
|
360
360
|
{
|
|
361
361
|
width: t,
|
|
@@ -372,45 +372,45 @@ const oe = ({
|
|
|
372
372
|
}
|
|
373
373
|
)
|
|
374
374
|
}
|
|
375
|
-
),
|
|
375
|
+
), fs = (t) => {
|
|
376
376
|
var s;
|
|
377
377
|
return ((s = t.metadata) == null ? void 0 : s.custom_type) === "MESSAGE_TIP";
|
|
378
|
-
},
|
|
378
|
+
}, gs = (t) => {
|
|
379
379
|
var s;
|
|
380
380
|
return ((s = t.metadata) == null ? void 0 : s.custom_type) === "MESSAGE_PAID";
|
|
381
381
|
}, Be = (t) => {
|
|
382
382
|
var s;
|
|
383
383
|
return ((s = t.metadata) == null ? void 0 : s.custom_type) === "MESSAGE_CHATBOT";
|
|
384
|
-
},
|
|
384
|
+
}, xs = (t) => {
|
|
385
385
|
var s;
|
|
386
386
|
return ((s = t.metadata) == null ? void 0 : s.custom_type) === "MESSAGE_ATTACHMENT";
|
|
387
|
-
},
|
|
387
|
+
}, nt = (t) => fs(t) || gs(t), bs = (t) => {
|
|
388
388
|
var s;
|
|
389
|
-
return
|
|
389
|
+
return nt(t) && !((s = t.text) != null && s.trim());
|
|
390
390
|
}, Re = ({
|
|
391
391
|
message: t,
|
|
392
392
|
standalone: s = !1,
|
|
393
393
|
isMyMessage: n = !1,
|
|
394
394
|
hasAttachment: r = !1
|
|
395
395
|
}) => {
|
|
396
|
-
var
|
|
397
|
-
const l =
|
|
396
|
+
var C;
|
|
397
|
+
const l = nt(t), d = Be(t);
|
|
398
398
|
if (!l && !d)
|
|
399
399
|
return null;
|
|
400
400
|
if (l) {
|
|
401
|
-
const
|
|
402
|
-
if (!
|
|
403
|
-
const m = s ? "message-tip-standalone" : "message-tag message-tag--tip",
|
|
401
|
+
const E = (C = t.metadata) == null ? void 0 : C.amount_text;
|
|
402
|
+
if (!E) return null;
|
|
403
|
+
const m = s ? "message-tip-standalone" : "message-tag message-tag--tip", S = s ? `${E} tip` : `Delivered with ${E} tip`;
|
|
404
404
|
return /* @__PURE__ */ i("div", { className: m, children: [
|
|
405
|
-
/* @__PURE__ */ e(
|
|
406
|
-
/* @__PURE__ */ e("span", { children:
|
|
405
|
+
/* @__PURE__ */ e(Qt, { size: s ? 14 : 12 }),
|
|
406
|
+
/* @__PURE__ */ e("span", { children: S })
|
|
407
407
|
] });
|
|
408
408
|
}
|
|
409
409
|
const a = n && r, c = a ? "Sent with AI" : "Sent with DM Agent", g = [
|
|
410
410
|
"message-chatbot-indicator",
|
|
411
411
|
n ? "message-chatbot-indicator--sender" : "message-chatbot-indicator--receiver",
|
|
412
412
|
a ? "message-chatbot-indicator--attachment" : "message-chatbot-indicator--text"
|
|
413
|
-
].join(" "), h = /* @__PURE__ */ e("span", { className: "message-chatbot-indicator__label", children: c }), b = /* @__PURE__ */ e("span", { className: "message-chatbot-indicator__icon", children: /* @__PURE__ */ e(
|
|
413
|
+
].join(" "), h = /* @__PURE__ */ e("span", { className: "message-chatbot-indicator__label", children: c }), b = /* @__PURE__ */ e("span", { className: "message-chatbot-indicator__icon", children: /* @__PURE__ */ e(hs, { size: a ? 12 : 15 }) });
|
|
414
414
|
return /* @__PURE__ */ e("div", { className: g, "data-testid": "message-chatbot-indicator", children: n && !a ? /* @__PURE__ */ i(he, { children: [
|
|
415
415
|
h,
|
|
416
416
|
b
|
|
@@ -418,39 +418,39 @@ const oe = ({
|
|
|
418
418
|
b,
|
|
419
419
|
h
|
|
420
420
|
] }) });
|
|
421
|
-
},
|
|
421
|
+
}, at = F.memo(
|
|
422
422
|
({ channel: t, unread: s }) => {
|
|
423
|
-
var
|
|
424
|
-
const { selectedChannel: n, onChannelSelect: r, debug: l, renderMessagePreview: d } =
|
|
423
|
+
var A, x, u, f;
|
|
424
|
+
const { selectedChannel: n, onChannelSelect: r, debug: l, renderMessagePreview: d } = is(), a = (n == null ? void 0 : n.id) === (t == null ? void 0 : t.id), c = () => {
|
|
425
425
|
t && r(t);
|
|
426
|
-
}, g = (
|
|
427
|
-
const
|
|
428
|
-
!
|
|
429
|
-
}, b = Object.values(((
|
|
430
|
-
(
|
|
431
|
-
var
|
|
432
|
-
return ((
|
|
426
|
+
}, g = (_) => {
|
|
427
|
+
const p = _.key === "Enter" || _.key === " ", D = _.repeat;
|
|
428
|
+
!p || D || (_.preventDefault(), c());
|
|
429
|
+
}, b = Object.values(((A = t == null ? void 0 : t.state) == null ? void 0 : A.members) || {}).find(
|
|
430
|
+
(_) => {
|
|
431
|
+
var p, D;
|
|
432
|
+
return ((p = _.user) == null ? void 0 : p.id) && _.user.id !== ((D = t == null ? void 0 : t._client) == null ? void 0 : D.userID);
|
|
433
433
|
}
|
|
434
|
-
),
|
|
435
|
-
var
|
|
436
|
-
const
|
|
437
|
-
if (
|
|
438
|
-
for (let
|
|
439
|
-
if (
|
|
434
|
+
), C = ((x = b == null ? void 0 : b.user) == null ? void 0 : x.name) || "Conversation", E = (u = b == null ? void 0 : b.user) == null ? void 0 : u.image, m = (() => {
|
|
435
|
+
var p;
|
|
436
|
+
const _ = (p = t == null ? void 0 : t.state) == null ? void 0 : p.messages;
|
|
437
|
+
if (_ != null && _.length) {
|
|
438
|
+
for (let D = _.length - 1; D >= 0; D--)
|
|
439
|
+
if (_[D].type !== "system") return _[D];
|
|
440
440
|
}
|
|
441
441
|
})(), o = (() => {
|
|
442
|
-
var
|
|
442
|
+
var D, G;
|
|
443
443
|
if (m != null && m.text) return m.text;
|
|
444
|
-
if (((
|
|
445
|
-
const
|
|
446
|
-
return
|
|
447
|
-
})(),
|
|
444
|
+
if (((D = m == null ? void 0 : m.metadata) == null ? void 0 : D.custom_type) === "MESSAGE_TIP") return "💵 Sent a tip";
|
|
445
|
+
const p = (G = m == null ? void 0 : m.attachments) == null ? void 0 : G[0];
|
|
446
|
+
return p ? p.og_scrape_url ? p.og_scrape_url : p.type === "image" ? "📷 Sent an image" : p.type === "video" ? "🎥 Sent a video" : p.type === "audio" ? "🎵 Sent audio" : p.type === "file" ? "📎 Sent a file" : "📎 Sent an attachment" : "No messages yet";
|
|
447
|
+
})(), y = m != null && m.created_at ? ds(new Date(m.created_at)) : "", M = m ? Be(m) : !1, N = d ? d(m, o) : `${M ? "✨ " : ""}${o}`, v = st(t), w = s ?? 0;
|
|
448
448
|
return l && console.log("📺 [ChannelList] 📋 CHANNEL PREVIEW RENDER", {
|
|
449
449
|
channelId: t == null ? void 0 : t.id,
|
|
450
450
|
isSelected: a,
|
|
451
|
-
participantName:
|
|
452
|
-
unreadCount:
|
|
453
|
-
hasTimestamp: !!
|
|
451
|
+
participantName: C,
|
|
452
|
+
unreadCount: w,
|
|
453
|
+
hasTimestamp: !!y
|
|
454
454
|
}), /* @__PURE__ */ e(
|
|
455
455
|
"div",
|
|
456
456
|
{
|
|
@@ -467,13 +467,13 @@ const oe = ({
|
|
|
467
467
|
),
|
|
468
468
|
children: /* @__PURE__ */ i("div", { className: "flex items-start gap-3", children: [
|
|
469
469
|
/* @__PURE__ */ e(
|
|
470
|
-
|
|
470
|
+
le,
|
|
471
471
|
{
|
|
472
472
|
id: ((f = b == null ? void 0 : b.user) == null ? void 0 : f.id) || t.id || "unknown",
|
|
473
|
-
name:
|
|
474
|
-
image:
|
|
473
|
+
name: C,
|
|
474
|
+
image: E,
|
|
475
475
|
size: 44,
|
|
476
|
-
starred:
|
|
476
|
+
starred: v,
|
|
477
477
|
className: "[&_.avatar-fallback]:group-hover:bg-[#eeeeee]"
|
|
478
478
|
}
|
|
479
479
|
),
|
|
@@ -487,16 +487,16 @@ const oe = ({
|
|
|
487
487
|
a ? "text-primary" : "text-charcoal"
|
|
488
488
|
),
|
|
489
489
|
children: [
|
|
490
|
-
|
|
491
|
-
|
|
490
|
+
v && /* @__PURE__ */ e("span", { className: "sr-only", children: "Starred conversation. " }),
|
|
491
|
+
C
|
|
492
492
|
]
|
|
493
493
|
}
|
|
494
494
|
),
|
|
495
|
-
|
|
495
|
+
y && /* @__PURE__ */ e("span", { className: "text-xs text-stone flex-shrink-0", children: y })
|
|
496
496
|
] }),
|
|
497
497
|
/* @__PURE__ */ i("div", { className: "flex items-center justify-between gap-2 min-w-0", children: [
|
|
498
|
-
/* @__PURE__ */ e("p", { className: "text-xs text-stone flex-1 line-clamp-1", children:
|
|
499
|
-
|
|
498
|
+
/* @__PURE__ */ e("p", { className: "text-xs text-stone flex-1 line-clamp-1", children: N }),
|
|
499
|
+
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 })
|
|
500
500
|
] })
|
|
501
501
|
] })
|
|
502
502
|
] })
|
|
@@ -504,8 +504,8 @@ const oe = ({
|
|
|
504
504
|
);
|
|
505
505
|
}
|
|
506
506
|
);
|
|
507
|
-
|
|
508
|
-
const
|
|
507
|
+
at.displayName = "CustomChannelPreview";
|
|
508
|
+
const Cs = { last_message_at: -1 }, rt = F.memo(
|
|
509
509
|
({
|
|
510
510
|
onChannelSelect: t,
|
|
511
511
|
selectedChannel: s,
|
|
@@ -514,16 +514,16 @@ const xs = { last_message_at: -1 }, at = F.memo(
|
|
|
514
514
|
onMessageNew: l,
|
|
515
515
|
onAddedToChannel: d,
|
|
516
516
|
channelRenderFilterFn: a,
|
|
517
|
-
sort: c =
|
|
517
|
+
sort: c = Cs,
|
|
518
518
|
className: g,
|
|
519
519
|
customEmptyStateIndicator: h,
|
|
520
520
|
renderMessagePreview: b
|
|
521
521
|
}) => {
|
|
522
|
-
const
|
|
523
|
-
|
|
524
|
-
const { debug:
|
|
525
|
-
|
|
526
|
-
renderCount:
|
|
522
|
+
const C = F.useRef(0);
|
|
523
|
+
C.current++;
|
|
524
|
+
const { debug: E = !1 } = Me();
|
|
525
|
+
E && console.log("📺 [ChannelList] 🔄 RENDER START", {
|
|
526
|
+
renderCount: C.current,
|
|
527
527
|
selectedChannelId: s == null ? void 0 : s.id,
|
|
528
528
|
filters: n
|
|
529
529
|
});
|
|
@@ -531,10 +531,10 @@ const xs = { last_message_at: -1 }, at = F.memo(
|
|
|
531
531
|
() => ({
|
|
532
532
|
selectedChannel: s,
|
|
533
533
|
onChannelSelect: t,
|
|
534
|
-
debug:
|
|
534
|
+
debug: E,
|
|
535
535
|
renderMessagePreview: b
|
|
536
536
|
}),
|
|
537
|
-
[s, t,
|
|
537
|
+
[s, t, E, b]
|
|
538
538
|
);
|
|
539
539
|
return /* @__PURE__ */ e(
|
|
540
540
|
"div",
|
|
@@ -543,8 +543,8 @@ const xs = { last_message_at: -1 }, at = F.memo(
|
|
|
543
543
|
"messaging-channel-list h-full flex flex-col min-w-0 overflow-hidden",
|
|
544
544
|
g
|
|
545
545
|
),
|
|
546
|
-
children: /* @__PURE__ */ e("div", { className: "flex-1 overflow-hidden min-w-0", children: /* @__PURE__ */ e(
|
|
547
|
-
|
|
546
|
+
children: /* @__PURE__ */ e("div", { className: "flex-1 overflow-hidden min-w-0", children: /* @__PURE__ */ e(ls, { value: m, children: /* @__PURE__ */ e(
|
|
547
|
+
Ct,
|
|
548
548
|
{
|
|
549
549
|
filters: n,
|
|
550
550
|
sort: c,
|
|
@@ -553,7 +553,7 @@ const xs = { last_message_at: -1 }, at = F.memo(
|
|
|
553
553
|
onMessageNew: l,
|
|
554
554
|
onAddedToChannel: d,
|
|
555
555
|
channelRenderFilterFn: a,
|
|
556
|
-
Preview:
|
|
556
|
+
Preview: at,
|
|
557
557
|
EmptyStateIndicator: h
|
|
558
558
|
},
|
|
559
559
|
`${JSON.stringify(n)}:${JSON.stringify(c)}`
|
|
@@ -562,7 +562,7 @@ const xs = { last_message_at: -1 }, at = F.memo(
|
|
|
562
562
|
);
|
|
563
563
|
}
|
|
564
564
|
);
|
|
565
|
-
|
|
565
|
+
rt.displayName = "ChannelList";
|
|
566
566
|
const we = ({
|
|
567
567
|
variant: t = "default",
|
|
568
568
|
className: s,
|
|
@@ -581,7 +581,7 @@ const we = ({
|
|
|
581
581
|
children: n
|
|
582
582
|
}
|
|
583
583
|
);
|
|
584
|
-
function
|
|
584
|
+
function ot({ label: t, className: s, children: n, ...r }) {
|
|
585
585
|
return /* @__PURE__ */ i(
|
|
586
586
|
"button",
|
|
587
587
|
{
|
|
@@ -602,10 +602,10 @@ function rt({ label: t, className: s, children: n, ...r }) {
|
|
|
602
602
|
}
|
|
603
603
|
);
|
|
604
604
|
}
|
|
605
|
-
function
|
|
606
|
-
return /* @__PURE__ */ e(
|
|
605
|
+
function lt({ onClick: t }) {
|
|
606
|
+
return /* @__PURE__ */ e(ot, { label: "Close", onClick: t, className: "p-1", children: /* @__PURE__ */ e(Oe, { className: "h-5 w-5 text-stone", weight: "bold" }) });
|
|
607
607
|
}
|
|
608
|
-
const
|
|
608
|
+
const Ns = ({
|
|
609
609
|
dialogRef: t,
|
|
610
610
|
onClose: s,
|
|
611
611
|
participant: n,
|
|
@@ -617,69 +617,69 @@ const bs = ({
|
|
|
617
617
|
onDeleteConversationClick: g,
|
|
618
618
|
onBlockParticipantClick: h,
|
|
619
619
|
onReportParticipantClick: b,
|
|
620
|
-
customProfileContent:
|
|
621
|
-
customChannelActions:
|
|
620
|
+
customProfileContent: C,
|
|
621
|
+
customChannelActions: E
|
|
622
622
|
}) => {
|
|
623
|
-
var
|
|
624
|
-
const { service: m, debug:
|
|
625
|
-
var
|
|
626
|
-
if (!(!m || !((
|
|
623
|
+
var Z, J, P, V, z, ie, ce;
|
|
624
|
+
const { service: m, debug: S } = Me(), [o, y] = k(!1), [M, N] = k(!1), [v, w] = k(!1), A = U(async () => {
|
|
625
|
+
var R;
|
|
626
|
+
if (!(!m || !((R = n == null ? void 0 : n.user) != null && R.id)))
|
|
627
627
|
try {
|
|
628
|
-
const
|
|
629
|
-
(
|
|
630
|
-
var
|
|
631
|
-
return
|
|
628
|
+
const Y = (await m.getBlockedUsers()).some(
|
|
629
|
+
(W) => {
|
|
630
|
+
var ne;
|
|
631
|
+
return W.blocked_user_id === ((ne = n == null ? void 0 : n.user) == null ? void 0 : ne.id);
|
|
632
632
|
}
|
|
633
633
|
);
|
|
634
|
-
|
|
635
|
-
} catch (
|
|
634
|
+
y(Y);
|
|
635
|
+
} catch (O) {
|
|
636
636
|
console.error(
|
|
637
637
|
"[ChannelInfoDialog] Failed to check blocked status:",
|
|
638
|
-
|
|
638
|
+
O
|
|
639
639
|
);
|
|
640
640
|
}
|
|
641
|
-
}, [m, (
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
}, [
|
|
641
|
+
}, [m, (Z = n == null ? void 0 : n.user) == null ? void 0 : Z.id]);
|
|
642
|
+
X(() => {
|
|
643
|
+
A();
|
|
644
|
+
}, [A]);
|
|
645
645
|
const x = async () => {
|
|
646
|
-
var
|
|
647
|
-
if (!
|
|
648
|
-
g == null || g(),
|
|
646
|
+
var R;
|
|
647
|
+
if (!M) {
|
|
648
|
+
g == null || g(), S && console.log("[ChannelInfoDialog] Leave conversation", r.cid), N(!0);
|
|
649
649
|
try {
|
|
650
|
-
const
|
|
651
|
-
await r.hide(
|
|
652
|
-
} catch (
|
|
653
|
-
console.error("[ChannelInfoDialog] Failed to leave conversation",
|
|
650
|
+
const O = ((R = r._client) == null ? void 0 : R.userID) ?? null;
|
|
651
|
+
await r.hide(O, !1), d && await d(r), s();
|
|
652
|
+
} catch (O) {
|
|
653
|
+
console.error("[ChannelInfoDialog] Failed to leave conversation", O);
|
|
654
654
|
} finally {
|
|
655
|
-
|
|
655
|
+
N(!1);
|
|
656
656
|
}
|
|
657
657
|
}
|
|
658
658
|
}, u = async () => {
|
|
659
|
-
var
|
|
660
|
-
if (!(
|
|
661
|
-
h == null || h(),
|
|
659
|
+
var R, O, Y;
|
|
660
|
+
if (!(v || !m)) {
|
|
661
|
+
h == null || h(), S && console.log("[ChannelInfoDialog] Block member", (R = n == null ? void 0 : n.user) == null ? void 0 : R.id), w(!0);
|
|
662
662
|
try {
|
|
663
|
-
await m.blockUser((
|
|
664
|
-
} catch (
|
|
665
|
-
console.error("[ChannelInfoDialog] Failed to block member",
|
|
663
|
+
await m.blockUser((O = n == null ? void 0 : n.user) == null ? void 0 : O.id), a && await a((Y = n == null ? void 0 : n.user) == null ? void 0 : Y.id), s();
|
|
664
|
+
} catch (W) {
|
|
665
|
+
console.error("[ChannelInfoDialog] Failed to block member", W);
|
|
666
666
|
} finally {
|
|
667
|
-
|
|
667
|
+
w(!1);
|
|
668
668
|
}
|
|
669
669
|
}
|
|
670
670
|
}, f = async () => {
|
|
671
|
-
var
|
|
672
|
-
if (!(
|
|
673
|
-
h == null || h(),
|
|
671
|
+
var R, O, Y;
|
|
672
|
+
if (!(v || !m)) {
|
|
673
|
+
h == null || h(), S && console.log("[ChannelInfoDialog] Unblock member", (R = n == null ? void 0 : n.user) == null ? void 0 : R.id), w(!0);
|
|
674
674
|
try {
|
|
675
|
-
await m.unBlockUser((
|
|
676
|
-
} catch (
|
|
677
|
-
console.error("[ChannelInfoDialog] Failed to unblock member",
|
|
675
|
+
await m.unBlockUser((O = n == null ? void 0 : n.user) == null ? void 0 : O.id), a && await a((Y = n == null ? void 0 : n.user) == null ? void 0 : Y.id), s();
|
|
676
|
+
} catch (W) {
|
|
677
|
+
console.error("[ChannelInfoDialog] Failed to unblock member", W);
|
|
678
678
|
} finally {
|
|
679
|
-
|
|
679
|
+
w(!1);
|
|
680
680
|
}
|
|
681
681
|
}
|
|
682
|
-
},
|
|
682
|
+
}, _ = () => {
|
|
683
683
|
b == null || b(), s(), window.open(
|
|
684
684
|
"https://linktr.ee/s/about/trust-center/report",
|
|
685
685
|
"_blank",
|
|
@@ -687,7 +687,7 @@ const bs = ({
|
|
|
687
687
|
);
|
|
688
688
|
};
|
|
689
689
|
if (!n) return null;
|
|
690
|
-
const
|
|
690
|
+
const p = ((J = n.user) == null ? void 0 : J.name) || ((P = n.user) == null ? void 0 : P.id) || "Unknown member", D = (V = n.user) == null ? void 0 : V.image, G = (z = n.user) == null ? void 0 : z.email, T = (ie = n.user) == null ? void 0 : ie.username, $ = G || (T ? `linktr.ee/${T}` : void 0), se = ((ce = n.user) == null ? void 0 : ce.id) || "unknown";
|
|
691
691
|
return (
|
|
692
692
|
// eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-noninteractive-element-interactions
|
|
693
693
|
/* @__PURE__ */ e(
|
|
@@ -696,13 +696,13 @@ const bs = ({
|
|
|
696
696
|
ref: t,
|
|
697
697
|
className: "mes-dialog group",
|
|
698
698
|
onClose: s,
|
|
699
|
-
onClick: (
|
|
700
|
-
|
|
699
|
+
onClick: (R) => {
|
|
700
|
+
R.target === t.current && s();
|
|
701
701
|
},
|
|
702
702
|
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: [
|
|
703
703
|
/* @__PURE__ */ i("div", { className: "flex items-center justify-between border-b border-sand px-4 py-3", children: [
|
|
704
704
|
/* @__PURE__ */ e("h2", { className: "text-base font-semibold text-charcoal", children: "Chat info" }),
|
|
705
|
-
/* @__PURE__ */ e(
|
|
705
|
+
/* @__PURE__ */ e(lt, { onClick: s })
|
|
706
706
|
] }),
|
|
707
707
|
/* @__PURE__ */ i("div", { className: "flex-1 px-2 overflow-y-auto w-full", children: [
|
|
708
708
|
/* @__PURE__ */ e(
|
|
@@ -712,19 +712,19 @@ const bs = ({
|
|
|
712
712
|
style: { backgroundColor: "#FBFAF9" },
|
|
713
713
|
children: /* @__PURE__ */ i("div", { className: "flex items-center gap-3 w-full", children: [
|
|
714
714
|
/* @__PURE__ */ e(
|
|
715
|
-
|
|
715
|
+
le,
|
|
716
716
|
{
|
|
717
|
-
id:
|
|
718
|
-
name:
|
|
719
|
-
image:
|
|
717
|
+
id: se,
|
|
718
|
+
name: p,
|
|
719
|
+
image: D,
|
|
720
720
|
size: 88,
|
|
721
721
|
shape: "circle"
|
|
722
722
|
}
|
|
723
723
|
),
|
|
724
724
|
/* @__PURE__ */ i("div", { className: "flex flex-col min-w-0 flex-1", children: [
|
|
725
|
-
/* @__PURE__ */ e("p", { className: "truncate text-base font-semibold text-charcoal", children:
|
|
726
|
-
|
|
727
|
-
l && !
|
|
725
|
+
/* @__PURE__ */ e("p", { className: "truncate text-base font-semibold text-charcoal", children: p }),
|
|
726
|
+
$ && /* @__PURE__ */ e("p", { className: "truncate text-sm text-[#00000055]", children: $ }),
|
|
727
|
+
l && !C && /* @__PURE__ */ e(
|
|
728
728
|
"span",
|
|
729
729
|
{
|
|
730
730
|
className: "mt-1 rounded-full text-xs font-normal w-fit",
|
|
@@ -738,7 +738,7 @@ const bs = ({
|
|
|
738
738
|
children: l
|
|
739
739
|
}
|
|
740
740
|
),
|
|
741
|
-
|
|
741
|
+
C
|
|
742
742
|
] })
|
|
743
743
|
] })
|
|
744
744
|
}
|
|
@@ -748,10 +748,10 @@ const bs = ({
|
|
|
748
748
|
we,
|
|
749
749
|
{
|
|
750
750
|
onClick: x,
|
|
751
|
-
disabled:
|
|
752
|
-
"aria-busy":
|
|
751
|
+
disabled: M,
|
|
752
|
+
"aria-busy": M,
|
|
753
753
|
children: [
|
|
754
|
-
|
|
754
|
+
M ? /* @__PURE__ */ e(_e, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(es, { className: "h-5 w-5" }),
|
|
755
755
|
/* @__PURE__ */ e("span", { children: "Delete Conversation" })
|
|
756
756
|
]
|
|
757
757
|
}
|
|
@@ -760,10 +760,10 @@ const bs = ({
|
|
|
760
760
|
we,
|
|
761
761
|
{
|
|
762
762
|
onClick: f,
|
|
763
|
-
disabled:
|
|
764
|
-
"aria-busy":
|
|
763
|
+
disabled: v,
|
|
764
|
+
"aria-busy": v,
|
|
765
765
|
children: [
|
|
766
|
-
|
|
766
|
+
v ? /* @__PURE__ */ e(_e, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(He, { className: "h-5 w-5" }),
|
|
767
767
|
/* @__PURE__ */ e("span", { children: "Unblock" })
|
|
768
768
|
]
|
|
769
769
|
}
|
|
@@ -771,32 +771,32 @@ const bs = ({
|
|
|
771
771
|
we,
|
|
772
772
|
{
|
|
773
773
|
onClick: u,
|
|
774
|
-
disabled:
|
|
775
|
-
"aria-busy":
|
|
774
|
+
disabled: v,
|
|
775
|
+
"aria-busy": v,
|
|
776
776
|
children: [
|
|
777
|
-
|
|
777
|
+
v ? /* @__PURE__ */ e(_e, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(He, { className: "h-5 w-5" }),
|
|
778
778
|
/* @__PURE__ */ e("span", { children: "Block" })
|
|
779
779
|
]
|
|
780
780
|
}
|
|
781
781
|
) }),
|
|
782
|
-
/* @__PURE__ */ e("li", { children: /* @__PURE__ */ i(we, { variant: "danger", onClick:
|
|
783
|
-
/* @__PURE__ */ e(
|
|
782
|
+
/* @__PURE__ */ e("li", { children: /* @__PURE__ */ i(we, { variant: "danger", onClick: _, children: [
|
|
783
|
+
/* @__PURE__ */ e(ts, { className: "h-5 w-5" }),
|
|
784
784
|
/* @__PURE__ */ e("span", { children: "Report" })
|
|
785
785
|
] }) }),
|
|
786
|
-
|
|
786
|
+
E
|
|
787
787
|
] })
|
|
788
788
|
] })
|
|
789
789
|
] })
|
|
790
790
|
}
|
|
791
791
|
)
|
|
792
792
|
);
|
|
793
|
-
},
|
|
794
|
-
function
|
|
793
|
+
}, ps = (t) => /* @__PURE__ */ e(Nt, { ...t, position: "center" }), Pe = "vote_up", Fe = "vote_down";
|
|
794
|
+
function ys(t) {
|
|
795
795
|
return t != null && t.length ? t.some((s) => s.type === Fe) ? "down" : t.some((s) => s.type === Pe) ? "up" : null : null;
|
|
796
796
|
}
|
|
797
|
-
function
|
|
798
|
-
const { channel: s } = Ie(), { client: n } =
|
|
799
|
-
() =>
|
|
797
|
+
function vs(t) {
|
|
798
|
+
const { channel: s } = Ie(), { client: n } = Ke("useMessageVote"), r = Le(
|
|
799
|
+
() => ys(t.own_reactions),
|
|
800
800
|
[t.own_reactions]
|
|
801
801
|
), l = U(async () => {
|
|
802
802
|
if (n != null && n.userID)
|
|
@@ -821,13 +821,13 @@ function ps(t) {
|
|
|
821
821
|
}, [s, n == null ? void 0 : n.userID, t.id, r]);
|
|
822
822
|
return { selected: r, voteUp: l, voteDown: d };
|
|
823
823
|
}
|
|
824
|
-
const
|
|
824
|
+
const ws = F.lazy(() => import("./Creator-VyMyIk2b.js")), _s = F.lazy(() => import("./Visitor-C4WqnN8H.js")), Je = () => /* @__PURE__ */ e(
|
|
825
825
|
"div",
|
|
826
826
|
{
|
|
827
827
|
className: "w-[280px] min-h-[200px] animate-pulse rounded-3xl bg-black/[0.06] shadow-[0px_0px_0px_1px_rgba(0,0,0,0.04),0px_1px_2px_0px_rgba(0,0,0,0.04)]",
|
|
828
828
|
"aria-hidden": !0
|
|
829
829
|
}
|
|
830
|
-
),
|
|
830
|
+
), Es = (t) => t.onUnlock != null || t.onDownload != null ? /* @__PURE__ */ e(je, { fallback: /* @__PURE__ */ e(Je, {}), children: /* @__PURE__ */ e(_s, { ...t }) }) : /* @__PURE__ */ e(je, { fallback: /* @__PURE__ */ e(Je, {}), children: /* @__PURE__ */ e(ws, { ...t }) }), Ss = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", children: /* @__PURE__ */ e(
|
|
831
831
|
"path",
|
|
832
832
|
{
|
|
833
833
|
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",
|
|
@@ -837,7 +837,7 @@ const ys = F.lazy(() => import("./Creator-BFpHsh2u.js")), vs = F.lazy(() => impo
|
|
|
837
837
|
strokeLinejoin: "round",
|
|
838
838
|
fill: t ? "currentColor" : "none"
|
|
839
839
|
}
|
|
840
|
-
) }),
|
|
840
|
+
) }), Is = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", children: /* @__PURE__ */ e(
|
|
841
841
|
"path",
|
|
842
842
|
{
|
|
843
843
|
d: "M11.333 8.667l-2.666 6A1.333 1.333 0 017.333 14v-2.667a.667.667 0 00-.666-.666H2.903a1.334 1.334 0 01-1.192-1.93l2.333-4.666a1.333 1.333 0 011.193-.738h6.096m0 5.334V3.333m0 5.334h2a1.333 1.333 0 001.334-1.334V4.667a1.333 1.333 0 00-1.334-1.334h-2",
|
|
@@ -847,7 +847,7 @@ const ys = F.lazy(() => import("./Creator-BFpHsh2u.js")), vs = F.lazy(() => impo
|
|
|
847
847
|
strokeLinejoin: "round",
|
|
848
848
|
fill: t ? "currentColor" : "none"
|
|
849
849
|
}
|
|
850
|
-
) }),
|
|
850
|
+
) }), Ms = ({
|
|
851
851
|
selected: t,
|
|
852
852
|
onVoteUp: s,
|
|
853
853
|
onVoteDown: n
|
|
@@ -860,7 +860,7 @@ const ys = F.lazy(() => import("./Creator-BFpHsh2u.js")), vs = F.lazy(() => impo
|
|
|
860
860
|
onClick: s,
|
|
861
861
|
"aria-label": "Helpful",
|
|
862
862
|
"aria-pressed": t === "up",
|
|
863
|
-
children: /* @__PURE__ */ e(
|
|
863
|
+
children: /* @__PURE__ */ e(Ss, { filled: t === "up" })
|
|
864
864
|
}
|
|
865
865
|
),
|
|
866
866
|
/* @__PURE__ */ e(
|
|
@@ -871,11 +871,11 @@ const ys = F.lazy(() => import("./Creator-BFpHsh2u.js")), vs = F.lazy(() => impo
|
|
|
871
871
|
onClick: n,
|
|
872
872
|
"aria-label": "Not helpful",
|
|
873
873
|
"aria-pressed": t === "down",
|
|
874
|
-
children: /* @__PURE__ */ e(
|
|
874
|
+
children: /* @__PURE__ */ e(Is, { filled: t === "down" })
|
|
875
875
|
}
|
|
876
876
|
)
|
|
877
|
-
] }),
|
|
878
|
-
var be,
|
|
877
|
+
] }), ks = (t) => {
|
|
878
|
+
var ge, xe, be, oe, K, Ce, Ne, pe;
|
|
879
879
|
const {
|
|
880
880
|
additionalMessageInputProps: s,
|
|
881
881
|
chatbotVotingEnabled: n,
|
|
@@ -887,78 +887,78 @@ const ys = F.lazy(() => import("./Creator-BFpHsh2u.js")), vs = F.lazy(() => impo
|
|
|
887
887
|
groupedByUser: g,
|
|
888
888
|
handleAction: h,
|
|
889
889
|
handleOpenThread: b,
|
|
890
|
-
handleRetry:
|
|
891
|
-
highlighted:
|
|
890
|
+
handleRetry: C,
|
|
891
|
+
highlighted: E,
|
|
892
892
|
isMessageAIGenerated: m,
|
|
893
|
-
isMyMessage:
|
|
893
|
+
isMyMessage: S,
|
|
894
894
|
message: o,
|
|
895
|
-
renderText:
|
|
896
|
-
threadList:
|
|
897
|
-
} = t, { client:
|
|
898
|
-
Attachment:
|
|
899
|
-
EditMessageModal:
|
|
900
|
-
MessageBlocked:
|
|
901
|
-
MessageBouncePrompt:
|
|
902
|
-
MessageDeleted:
|
|
903
|
-
MessageIsThreadReplyInChannelButtonIndicator:
|
|
904
|
-
MessageRepliesCountButton:
|
|
905
|
-
ReminderNotification:
|
|
906
|
-
StreamedMessageText:
|
|
907
|
-
PinIndicator:
|
|
908
|
-
} =
|
|
895
|
+
renderText: y,
|
|
896
|
+
threadList: M
|
|
897
|
+
} = t, { client: N } = Ke("CustomMessage"), { channel: v } = Ie("CustomMessage"), [w, A] = k(!1), x = yt(o.id), { selected: u, voteUp: f, voteDown: _ } = vs(o), {
|
|
898
|
+
Attachment: p = wt,
|
|
899
|
+
EditMessageModal: D = _t,
|
|
900
|
+
MessageBlocked: G = Et,
|
|
901
|
+
MessageBouncePrompt: T = St,
|
|
902
|
+
MessageDeleted: $ = It,
|
|
903
|
+
MessageIsThreadReplyInChannelButtonIndicator: se = Mt,
|
|
904
|
+
MessageRepliesCountButton: Z = kt,
|
|
905
|
+
ReminderNotification: J = Tt,
|
|
906
|
+
StreamedMessageText: P = Dt,
|
|
907
|
+
PinIndicator: V
|
|
908
|
+
} = vt("CustomMessage"), z = Rt(o), ie = At(o), ce = Le(
|
|
909
909
|
() => m == null ? void 0 : m(o),
|
|
910
910
|
[m, o]
|
|
911
|
-
),
|
|
911
|
+
), R = Le(
|
|
912
912
|
() => !o.shared_location && !o.attachments ? [] : o.shared_location ? [o.shared_location, ...o.attachments ?? []] : o.attachments,
|
|
913
913
|
[o]
|
|
914
914
|
);
|
|
915
|
-
if (
|
|
915
|
+
if (Lt(o))
|
|
916
916
|
return null;
|
|
917
917
|
if (o.deleted_at || o.type === "deleted")
|
|
918
|
-
return /* @__PURE__ */ e(
|
|
919
|
-
if (
|
|
920
|
-
return /* @__PURE__ */ e(
|
|
921
|
-
const
|
|
922
|
-
let
|
|
923
|
-
|
|
924
|
-
const
|
|
918
|
+
return /* @__PURE__ */ e($, { message: o });
|
|
919
|
+
if (Ut(o))
|
|
920
|
+
return /* @__PURE__ */ e(G, {});
|
|
921
|
+
const O = !M && !!o.reply_count, Y = !M && o.show_in_channel && o.parent_id, W = o.status === "failed" && ((ge = o.error) == null ? void 0 : ge.status) !== 403, ne = Pt(o);
|
|
922
|
+
let ee;
|
|
923
|
+
W ? ee = () => C(o) : ne && (ee = () => A(!0));
|
|
924
|
+
const de = S(), Ge = L(
|
|
925
925
|
"str-chat__message str-chat__message-simple",
|
|
926
926
|
`str-chat__message--${o.type}`,
|
|
927
927
|
`str-chat__message--${o.status}`,
|
|
928
|
-
|
|
928
|
+
de ? "str-chat__message--me str-chat__message-simple--me" : "str-chat__message--other",
|
|
929
929
|
o.text ? "str-chat__message--has-text" : "has-no-text",
|
|
930
930
|
{
|
|
931
|
-
"str-chat__message--has-attachment":
|
|
932
|
-
"str-chat__message--highlighted":
|
|
931
|
+
"str-chat__message--has-attachment": z,
|
|
932
|
+
"str-chat__message--highlighted": E,
|
|
933
933
|
"str-chat__message--pinned pinned-message": o.pinned,
|
|
934
934
|
"str-chat__message--with-reactions": ie,
|
|
935
|
-
"str-chat__message-send-can-be-retried": (o == null ? void 0 : o.status) === "failed" && ((
|
|
936
|
-
"str-chat__message-with-thread-link":
|
|
935
|
+
"str-chat__message-send-can-be-retried": (o == null ? void 0 : o.status) === "failed" && ((xe = o == null ? void 0 : o.error) == null ? void 0 : xe.status) !== 403,
|
|
936
|
+
"str-chat__message-with-thread-link": O || Y,
|
|
937
937
|
"str-chat__virtual-message__wrapper--end": a,
|
|
938
938
|
"str-chat__virtual-message__wrapper--first": c,
|
|
939
939
|
"str-chat__virtual-message__wrapper--group": g
|
|
940
940
|
}
|
|
941
|
-
),
|
|
941
|
+
), q = o.poll_id && N.polls.fromState(o.poll_id), me = bs(o), ae = Be(o), re = xs(o), te = !!(R != null && R.length && !o.quoted_message), fe = ae && de && te;
|
|
942
942
|
return /* @__PURE__ */ i(he, { children: [
|
|
943
943
|
d && /* @__PURE__ */ e(
|
|
944
|
-
|
|
944
|
+
D,
|
|
945
945
|
{
|
|
946
946
|
additionalMessageInputProps: s
|
|
947
947
|
}
|
|
948
948
|
),
|
|
949
|
-
|
|
950
|
-
|
|
949
|
+
w && /* @__PURE__ */ e(
|
|
950
|
+
Ft,
|
|
951
951
|
{
|
|
952
|
-
MessageBouncePrompt:
|
|
953
|
-
onClose: () =>
|
|
954
|
-
open:
|
|
952
|
+
MessageBouncePrompt: T,
|
|
953
|
+
onClose: () => A(!1),
|
|
954
|
+
open: w
|
|
955
955
|
}
|
|
956
956
|
),
|
|
957
|
-
/* @__PURE__ */ i("div", { className:
|
|
958
|
-
|
|
959
|
-
!!x && /* @__PURE__ */ e(
|
|
957
|
+
/* @__PURE__ */ i("div", { className: Ge, children: [
|
|
958
|
+
V && /* @__PURE__ */ e(V, {}),
|
|
959
|
+
!!x && /* @__PURE__ */ e(J, { reminder: x }),
|
|
960
960
|
o.user && /* @__PURE__ */ e(
|
|
961
|
-
|
|
961
|
+
le,
|
|
962
962
|
{
|
|
963
963
|
className: "str-chat__avatar str-chat__message-sender-avatar",
|
|
964
964
|
id: o.user.id,
|
|
@@ -970,104 +970,104 @@ const ys = F.lazy(() => import("./Creator-BFpHsh2u.js")), vs = F.lazy(() => impo
|
|
|
970
970
|
"div",
|
|
971
971
|
{
|
|
972
972
|
className: L("str-chat__message-inner", {
|
|
973
|
-
"str-chat__simple-message--error-failed":
|
|
973
|
+
"str-chat__simple-message--error-failed": W || ne
|
|
974
974
|
}),
|
|
975
975
|
"data-testid": "message-inner",
|
|
976
|
-
onClick:
|
|
977
|
-
onKeyDown:
|
|
978
|
-
role:
|
|
979
|
-
tabIndex:
|
|
976
|
+
onClick: ee,
|
|
977
|
+
onKeyDown: ee,
|
|
978
|
+
role: ee ? "button" : void 0,
|
|
979
|
+
tabIndex: ee ? 0 : void 0,
|
|
980
980
|
style: {
|
|
981
981
|
// Force margins to 0 to prevent hover layout shift
|
|
982
982
|
// Stream Chat CSS sets margin-inline-end/start to 78px, then 0 on hover
|
|
983
983
|
marginInlineEnd: 0,
|
|
984
984
|
marginInlineStart: 0
|
|
985
985
|
},
|
|
986
|
-
children:
|
|
986
|
+
children: re ? /* @__PURE__ */ i("div", { className: "flex flex-col gap-2", children: [
|
|
987
987
|
/* @__PURE__ */ e(
|
|
988
|
-
|
|
988
|
+
Es,
|
|
989
989
|
{
|
|
990
|
-
title: (
|
|
991
|
-
mimeType: (
|
|
992
|
-
thumbnail: (
|
|
993
|
-
amountText: (
|
|
994
|
-
detail: (
|
|
995
|
-
paymentStatus: (
|
|
996
|
-
onUnlock: r ? () => r(o,
|
|
997
|
-
onDownload: l ? () => l(o,
|
|
990
|
+
title: (be = o.metadata) == null ? void 0 : be.attachment_title,
|
|
991
|
+
mimeType: (oe = o.metadata) == null ? void 0 : oe.attachment_mime_type,
|
|
992
|
+
thumbnail: (K = o.metadata) == null ? void 0 : K.attachment_thumbnail,
|
|
993
|
+
amountText: (Ce = o.metadata) == null ? void 0 : Ce.amount_text,
|
|
994
|
+
detail: (Ne = o.metadata) == null ? void 0 : Ne.attachment_detail,
|
|
995
|
+
paymentStatus: (pe = o.metadata) == null ? void 0 : pe.payment_status,
|
|
996
|
+
onUnlock: r ? () => r(o, v) : void 0,
|
|
997
|
+
onDownload: l ? () => l(o, v) : void 0
|
|
998
998
|
}
|
|
999
999
|
),
|
|
1000
|
-
o.text && /* @__PURE__ */ e("div", { className: "str-chat__message-bubble-wrapper", children: /* @__PURE__ */ e("div", { className: "str-chat__message-bubble", children: /* @__PURE__ */ e(
|
|
1001
|
-
] }) :
|
|
1000
|
+
o.text && /* @__PURE__ */ e("div", { className: "str-chat__message-bubble-wrapper", children: /* @__PURE__ */ e("div", { className: "str-chat__message-bubble", children: /* @__PURE__ */ e(ze, { message: o, renderText: y }) }) })
|
|
1001
|
+
] }) : me ? (
|
|
1002
1002
|
/* Tip-only messages render as a standalone bubble */
|
|
1003
1003
|
/* @__PURE__ */ e(Re, { message: o, standalone: !0 })
|
|
1004
1004
|
) : /* @__PURE__ */ i("div", { className: "str-chat__message-bubble-wrapper", children: [
|
|
1005
1005
|
/* @__PURE__ */ i("div", { className: "str-chat__message-bubble", children: [
|
|
1006
|
-
|
|
1006
|
+
ae && !fe && /* @__PURE__ */ e(
|
|
1007
1007
|
Re,
|
|
1008
1008
|
{
|
|
1009
1009
|
message: o,
|
|
1010
|
-
hasAttachment:
|
|
1011
|
-
isMyMessage:
|
|
1010
|
+
hasAttachment: te,
|
|
1011
|
+
isMyMessage: de
|
|
1012
1012
|
}
|
|
1013
1013
|
),
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1014
|
+
q && /* @__PURE__ */ e(Ot, { poll: q }),
|
|
1015
|
+
R != null && R.length && !o.quoted_message ? /* @__PURE__ */ e(
|
|
1016
|
+
p,
|
|
1017
1017
|
{
|
|
1018
1018
|
actionHandler: h,
|
|
1019
|
-
attachments:
|
|
1019
|
+
attachments: R
|
|
1020
1020
|
}
|
|
1021
1021
|
) : null,
|
|
1022
1022
|
ce ? /* @__PURE__ */ e(
|
|
1023
|
-
|
|
1023
|
+
P,
|
|
1024
1024
|
{
|
|
1025
1025
|
message: o,
|
|
1026
|
-
renderText:
|
|
1026
|
+
renderText: y
|
|
1027
1027
|
}
|
|
1028
|
-
) : /* @__PURE__ */ e(
|
|
1029
|
-
/* @__PURE__ */ e(
|
|
1028
|
+
) : /* @__PURE__ */ e(ze, { message: o, renderText: y }),
|
|
1029
|
+
/* @__PURE__ */ e(Bt, {})
|
|
1030
1030
|
] }),
|
|
1031
|
-
(!
|
|
1031
|
+
(!ae || fe) && /* @__PURE__ */ e(
|
|
1032
1032
|
Re,
|
|
1033
1033
|
{
|
|
1034
1034
|
message: o,
|
|
1035
|
-
hasAttachment:
|
|
1036
|
-
isMyMessage:
|
|
1035
|
+
hasAttachment: te,
|
|
1036
|
+
isMyMessage: de
|
|
1037
1037
|
}
|
|
1038
1038
|
),
|
|
1039
|
-
n &&
|
|
1040
|
-
|
|
1039
|
+
n && ae && /* @__PURE__ */ e(
|
|
1040
|
+
Ms,
|
|
1041
1041
|
{
|
|
1042
1042
|
selected: u,
|
|
1043
1043
|
onVoteUp: f,
|
|
1044
|
-
onVoteDown:
|
|
1044
|
+
onVoteDown: _
|
|
1045
1045
|
}
|
|
1046
1046
|
)
|
|
1047
1047
|
] })
|
|
1048
1048
|
}
|
|
1049
1049
|
),
|
|
1050
|
-
|
|
1051
|
-
|
|
1050
|
+
O && /* @__PURE__ */ e(
|
|
1051
|
+
Z,
|
|
1052
1052
|
{
|
|
1053
1053
|
onClick: b,
|
|
1054
1054
|
reply_count: o.reply_count
|
|
1055
1055
|
}
|
|
1056
1056
|
),
|
|
1057
|
-
|
|
1057
|
+
Y && /* @__PURE__ */ e(se, {})
|
|
1058
1058
|
] }, o.id)
|
|
1059
1059
|
] });
|
|
1060
|
-
},
|
|
1061
|
-
|
|
1062
|
-
(t, s) => t.chatbotVotingEnabled !== s.chatbotVotingEnabled || t.onAttachmentUnlock !== s.onAttachmentUnlock || t.onAttachmentDownload !== s.onAttachmentDownload ? !1 :
|
|
1063
|
-
),
|
|
1064
|
-
const s =
|
|
1065
|
-
return /* @__PURE__ */ e(
|
|
1066
|
-
},
|
|
1060
|
+
}, Ts = F.memo(
|
|
1061
|
+
ks,
|
|
1062
|
+
(t, s) => t.chatbotVotingEnabled !== s.chatbotVotingEnabled || t.onAttachmentUnlock !== s.onAttachmentUnlock || t.onAttachmentDownload !== s.onAttachmentDownload ? !1 : pt(t, s)
|
|
1063
|
+
), Ds = (t) => {
|
|
1064
|
+
const s = Qe("CustomMessage");
|
|
1065
|
+
return /* @__PURE__ */ e(Ts, { ...s, ...t });
|
|
1066
|
+
}, Rs = (t) => ({
|
|
1067
1067
|
linkPreviews: Array.from(t.previews.values()).filter(
|
|
1068
|
-
(s) =>
|
|
1068
|
+
(s) => qe.previewIsLoaded(s) || qe.previewIsLoading(s)
|
|
1069
1069
|
)
|
|
1070
|
-
}),
|
|
1070
|
+
}), As = ({
|
|
1071
1071
|
link: t,
|
|
1072
1072
|
onDismiss: s
|
|
1073
1073
|
}) => {
|
|
@@ -1107,32 +1107,32 @@ const ys = F.lazy(() => import("./Creator-BFpHsh2u.js")), vs = F.lazy(() => impo
|
|
|
1107
1107
|
]
|
|
1108
1108
|
}
|
|
1109
1109
|
);
|
|
1110
|
-
},
|
|
1111
|
-
const { linkPreviewsManager: t } =
|
|
1110
|
+
}, Ls = () => {
|
|
1111
|
+
const { linkPreviewsManager: t } = Gt(), { linkPreviews: s } = $t(
|
|
1112
1112
|
t.state,
|
|
1113
|
-
|
|
1113
|
+
Rs
|
|
1114
1114
|
), n = (l) => {
|
|
1115
1115
|
t.dismissPreview(l);
|
|
1116
1116
|
};
|
|
1117
1117
|
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(
|
|
1118
|
-
|
|
1118
|
+
As,
|
|
1119
1119
|
{
|
|
1120
1120
|
link: l,
|
|
1121
1121
|
onDismiss: n
|
|
1122
1122
|
},
|
|
1123
1123
|
l.og_scrape_url
|
|
1124
1124
|
)) }) : null;
|
|
1125
|
-
},
|
|
1126
|
-
const { handleSubmit: t } =
|
|
1125
|
+
}, Us = () => {
|
|
1126
|
+
const { handleSubmit: t } = zt(), s = Ht();
|
|
1127
1127
|
return /* @__PURE__ */ i(he, { children: [
|
|
1128
|
-
/* @__PURE__ */ e("div", { className: "left-container", children: /* @__PURE__ */ e(
|
|
1128
|
+
/* @__PURE__ */ e("div", { className: "left-container", children: /* @__PURE__ */ e(Vt, {}) }),
|
|
1129
1129
|
/* @__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: [
|
|
1130
|
-
/* @__PURE__ */ e(
|
|
1131
|
-
/* @__PURE__ */ e(
|
|
1132
|
-
/* @__PURE__ */ e(
|
|
1130
|
+
/* @__PURE__ */ e(Yt, {}),
|
|
1131
|
+
/* @__PURE__ */ e(Ls, {}),
|
|
1132
|
+
/* @__PURE__ */ e(Wt, {}),
|
|
1133
1133
|
/* @__PURE__ */ i("div", { className: "flex", children: [
|
|
1134
1134
|
/* @__PURE__ */ e("div", { className: "w-full ml-2 mr-4 self-center leading-[0]", children: /* @__PURE__ */ e(
|
|
1135
|
-
|
|
1135
|
+
qt,
|
|
1136
1136
|
{
|
|
1137
1137
|
className: "w-full resize-none outline-none leading-6",
|
|
1138
1138
|
autoFocus: !0,
|
|
@@ -1148,47 +1148,47 @@ const ys = F.lazy(() => import("./Creator-BFpHsh2u.js")), vs = F.lazy(() => impo
|
|
|
1148
1148
|
disabled: !s,
|
|
1149
1149
|
onClick: t,
|
|
1150
1150
|
type: "button",
|
|
1151
|
-
children: /* @__PURE__ */ e(
|
|
1151
|
+
children: /* @__PURE__ */ e(ss, { className: "size-4" })
|
|
1152
1152
|
}
|
|
1153
1153
|
)
|
|
1154
1154
|
] })
|
|
1155
1155
|
] })
|
|
1156
1156
|
] });
|
|
1157
|
-
},
|
|
1157
|
+
}, Ps = ({
|
|
1158
1158
|
renderActions: t
|
|
1159
1159
|
}) => /* @__PURE__ */ i("div", { className: "message-input flex items-center gap-2 p-4", children: [
|
|
1160
1160
|
t && (t == null ? void 0 : t()),
|
|
1161
|
-
/* @__PURE__ */ e(
|
|
1162
|
-
] }),
|
|
1161
|
+
/* @__PURE__ */ e(jt, { Input: Us })
|
|
1162
|
+
] }), Fs = [
|
|
1163
1163
|
"SYSTEM_DM_AGENT_PAUSED",
|
|
1164
1164
|
"SYSTEM_DM_AGENT_RESUMED"
|
|
1165
|
-
],
|
|
1165
|
+
], Os = {
|
|
1166
1166
|
SYSTEM_DM_AGENT_PAUSED: "DM Agent has left the conversation",
|
|
1167
1167
|
SYSTEM_DM_AGENT_RESUMED: "DM Agent has rejoined the conversation"
|
|
1168
|
-
},
|
|
1168
|
+
}, Bs = [
|
|
1169
1169
|
"SYSTEM_AGE_SAFETY_BLOCKED"
|
|
1170
|
-
],
|
|
1170
|
+
], Gs = {
|
|
1171
1171
|
SYSTEM_AGE_SAFETY_BLOCKED: "This user isn’t able to reply because they don’t meet our age safety guidelines."
|
|
1172
|
-
}, Ae = "age safety guidelines.",
|
|
1172
|
+
}, Ae = "age safety guidelines.", $s = "https://linktr.ee/s/about/contact", Xe = (t) => Fs.includes(t), js = (t) => Bs.includes(t), zs = (t) => {
|
|
1173
1173
|
var r;
|
|
1174
1174
|
const s = (r = t.metadata) == null ? void 0 : r.custom_type;
|
|
1175
|
-
if (
|
|
1175
|
+
if (Xe(s))
|
|
1176
1176
|
return {
|
|
1177
1177
|
kind: "dm-agent",
|
|
1178
1178
|
type: s
|
|
1179
1179
|
};
|
|
1180
|
-
if (
|
|
1180
|
+
if (js(s))
|
|
1181
1181
|
return {
|
|
1182
1182
|
kind: "age-safety",
|
|
1183
1183
|
type: s
|
|
1184
1184
|
};
|
|
1185
1185
|
const n = t.dm_agent_system_type;
|
|
1186
|
-
if (
|
|
1186
|
+
if (Xe(n))
|
|
1187
1187
|
return {
|
|
1188
1188
|
kind: "dm-agent",
|
|
1189
1189
|
type: n
|
|
1190
1190
|
};
|
|
1191
|
-
},
|
|
1191
|
+
}, Hs = (t) => {
|
|
1192
1192
|
const s = t.indexOf(Ae);
|
|
1193
1193
|
if (s === -1)
|
|
1194
1194
|
return t;
|
|
@@ -1198,7 +1198,7 @@ const ys = F.lazy(() => import("./Creator-BFpHsh2u.js")), vs = F.lazy(() => impo
|
|
|
1198
1198
|
/* @__PURE__ */ e(
|
|
1199
1199
|
"a",
|
|
1200
1200
|
{
|
|
1201
|
-
href:
|
|
1201
|
+
href: $s,
|
|
1202
1202
|
target: "_blank",
|
|
1203
1203
|
rel: "noopener noreferrer",
|
|
1204
1204
|
className: "mes-age-safety-system-message__emphasis font-medium text-inherit underline",
|
|
@@ -1207,13 +1207,13 @@ const ys = F.lazy(() => import("./Creator-BFpHsh2u.js")), vs = F.lazy(() => impo
|
|
|
1207
1207
|
),
|
|
1208
1208
|
t.slice(n)
|
|
1209
1209
|
] });
|
|
1210
|
-
},
|
|
1210
|
+
}, Vs = (t) => {
|
|
1211
1211
|
var r, l;
|
|
1212
|
-
const s = t.message.hide_date === !0, n =
|
|
1212
|
+
const s = t.message.hide_date === !0, n = zs(
|
|
1213
1213
|
t.message
|
|
1214
1214
|
);
|
|
1215
1215
|
if ((n == null ? void 0 : n.kind) === "dm-agent") {
|
|
1216
|
-
const d = ((r = t.message.text) == null ? void 0 : r.trim()) ||
|
|
1216
|
+
const d = ((r = t.message.text) == null ? void 0 : r.trim()) || Os[n.type];
|
|
1217
1217
|
return /* @__PURE__ */ i("div", { className: "str-chat__message--system", "data-testid": "message-system", children: [
|
|
1218
1218
|
/* @__PURE__ */ i(
|
|
1219
1219
|
"div",
|
|
@@ -1223,7 +1223,7 @@ const ys = F.lazy(() => import("./Creator-BFpHsh2u.js")), vs = F.lazy(() => impo
|
|
|
1223
1223
|
"data-dm-agent-system-type": n.type,
|
|
1224
1224
|
children: [
|
|
1225
1225
|
/* @__PURE__ */ e(
|
|
1226
|
-
|
|
1226
|
+
ns,
|
|
1227
1227
|
{
|
|
1228
1228
|
size: 16,
|
|
1229
1229
|
weight: "regular",
|
|
@@ -1239,7 +1239,7 @@ const ys = F.lazy(() => import("./Creator-BFpHsh2u.js")), vs = F.lazy(() => impo
|
|
|
1239
1239
|
] });
|
|
1240
1240
|
}
|
|
1241
1241
|
if ((n == null ? void 0 : n.kind) === "age-safety") {
|
|
1242
|
-
const d = ((l = t.message.text) == null ? void 0 : l.trim()) ||
|
|
1242
|
+
const d = ((l = t.message.text) == null ? void 0 : l.trim()) || Gs[n.type];
|
|
1243
1243
|
return /* @__PURE__ */ i("div", { className: "str-chat__message--system", "data-testid": "message-system", children: [
|
|
1244
1244
|
/* @__PURE__ */ i(
|
|
1245
1245
|
"div",
|
|
@@ -1249,7 +1249,7 @@ const ys = F.lazy(() => import("./Creator-BFpHsh2u.js")), vs = F.lazy(() => impo
|
|
|
1249
1249
|
"data-age-safety-system-type": n.type,
|
|
1250
1250
|
children: [
|
|
1251
1251
|
/* @__PURE__ */ e(
|
|
1252
|
-
|
|
1252
|
+
as,
|
|
1253
1253
|
{
|
|
1254
1254
|
size: 24,
|
|
1255
1255
|
weight: "duotone",
|
|
@@ -1258,7 +1258,7 @@ const ys = F.lazy(() => import("./Creator-BFpHsh2u.js")), vs = F.lazy(() => impo
|
|
|
1258
1258
|
"data-testid": "age-safety-system-message-icon"
|
|
1259
1259
|
}
|
|
1260
1260
|
),
|
|
1261
|
-
/* @__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:
|
|
1261
|
+
/* @__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: Hs(d) }) })
|
|
1262
1262
|
]
|
|
1263
1263
|
}
|
|
1264
1264
|
),
|
|
@@ -1273,7 +1273,7 @@ const ys = F.lazy(() => import("./Creator-BFpHsh2u.js")), vs = F.lazy(() => impo
|
|
|
1273
1273
|
] }),
|
|
1274
1274
|
!s && /* @__PURE__ */ e(De, { message: t.message })
|
|
1275
1275
|
] });
|
|
1276
|
-
},
|
|
1276
|
+
}, Ys = () => null, Ws = ({ className: t, message: s }) => /* @__PURE__ */ i(
|
|
1277
1277
|
"div",
|
|
1278
1278
|
{
|
|
1279
1279
|
className: L("flex items-center justify-center h-full", t),
|
|
@@ -1317,30 +1317,30 @@ const ys = F.lazy(() => import("./Creator-BFpHsh2u.js")), vs = F.lazy(() => impo
|
|
|
1317
1317
|
]
|
|
1318
1318
|
}
|
|
1319
1319
|
), Se = 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: [
|
|
1320
|
-
/* @__PURE__ */ e(
|
|
1320
|
+
/* @__PURE__ */ e(Ws, { className: "w-6 h-6" }),
|
|
1321
1321
|
/* @__PURE__ */ e("span", { className: "text-sm text-stone", children: "Loading messages" })
|
|
1322
1322
|
] }) }));
|
|
1323
1323
|
Se.displayName = "LoadingState";
|
|
1324
|
-
const ue = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-center justify-center transition-colors duration-150 focus-ring",
|
|
1324
|
+
const ue = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-center justify-center transition-colors duration-150 focus-ring", qs = ({
|
|
1325
1325
|
onBack: t,
|
|
1326
1326
|
showBackButton: s,
|
|
1327
1327
|
onShowInfo: n,
|
|
1328
1328
|
canShowInfo: r,
|
|
1329
1329
|
showStarButton: l = !1
|
|
1330
1330
|
}) => {
|
|
1331
|
-
var
|
|
1331
|
+
var C, E, m, S, o;
|
|
1332
1332
|
const { channel: d } = Ie(), a = F.useMemo(() => Object.values(d.state.members || {}).find(
|
|
1333
|
-
(
|
|
1334
|
-
var
|
|
1335
|
-
return ((
|
|
1333
|
+
(M) => {
|
|
1334
|
+
var N;
|
|
1335
|
+
return ((N = M.user) == null ? void 0 : N.id) && M.user.id !== d._client.userID;
|
|
1336
1336
|
}
|
|
1337
|
-
), [d._client.userID, d.state.members]), c = ((
|
|
1337
|
+
), [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", g = (m = a == null ? void 0 : a.user) == null ? void 0 : m.image, h = st(d), b = async () => {
|
|
1338
1338
|
try {
|
|
1339
1339
|
h ? await d.unpin() : await d.pin();
|
|
1340
|
-
} catch (
|
|
1340
|
+
} catch (y) {
|
|
1341
1341
|
console.error(
|
|
1342
1342
|
"[CustomChannelHeader] Failed to update pinned status:",
|
|
1343
|
-
|
|
1343
|
+
y
|
|
1344
1344
|
);
|
|
1345
1345
|
}
|
|
1346
1346
|
};
|
|
@@ -1354,14 +1354,14 @@ const ue = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
1354
1354
|
}),
|
|
1355
1355
|
type: "button",
|
|
1356
1356
|
"aria-label": "Back to conversations",
|
|
1357
|
-
children: /* @__PURE__ */ e(
|
|
1357
|
+
children: /* @__PURE__ */ e(Ve, { className: "size-5 text-black/90" })
|
|
1358
1358
|
}
|
|
1359
1359
|
) }),
|
|
1360
1360
|
/* @__PURE__ */ i("div", { className: "flex flex-col gap-1 items-center", children: [
|
|
1361
1361
|
/* @__PURE__ */ e(
|
|
1362
|
-
|
|
1362
|
+
le,
|
|
1363
1363
|
{
|
|
1364
|
-
id: ((
|
|
1364
|
+
id: ((S = a == null ? void 0 : a.user) == null ? void 0 : S.id) || d.id || "unknown",
|
|
1365
1365
|
name: c,
|
|
1366
1366
|
image: g,
|
|
1367
1367
|
starred: l && h,
|
|
@@ -1397,7 +1397,7 @@ const ue = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
1397
1397
|
onClick: n,
|
|
1398
1398
|
type: "button",
|
|
1399
1399
|
"aria-label": "Show info",
|
|
1400
|
-
children: /* @__PURE__ */ e(
|
|
1400
|
+
children: /* @__PURE__ */ e(Ye, { className: "size-5 text-black/90" })
|
|
1401
1401
|
}
|
|
1402
1402
|
)
|
|
1403
1403
|
] })
|
|
@@ -1411,11 +1411,11 @@ const ue = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
1411
1411
|
onClick: t,
|
|
1412
1412
|
className: ue,
|
|
1413
1413
|
"aria-label": "Back to conversations",
|
|
1414
|
-
children: /* @__PURE__ */ e(
|
|
1414
|
+
children: /* @__PURE__ */ e(Ve, { className: "size-5 text-black/90" })
|
|
1415
1415
|
}
|
|
1416
1416
|
),
|
|
1417
1417
|
/* @__PURE__ */ e(
|
|
1418
|
-
|
|
1418
|
+
le,
|
|
1419
1419
|
{
|
|
1420
1420
|
id: ((o = a == null ? void 0 : a.user) == null ? void 0 : o.id) || d.id || "unknown",
|
|
1421
1421
|
name: c,
|
|
@@ -1453,13 +1453,13 @@ const ue = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
1453
1453
|
onClick: n,
|
|
1454
1454
|
type: "button",
|
|
1455
1455
|
"aria-label": "Show info",
|
|
1456
|
-
children: /* @__PURE__ */ e(
|
|
1456
|
+
children: /* @__PURE__ */ e(Ye, { className: "size-5 text-black/90" })
|
|
1457
1457
|
}
|
|
1458
1458
|
)
|
|
1459
1459
|
] })
|
|
1460
1460
|
] })
|
|
1461
1461
|
] });
|
|
1462
|
-
},
|
|
1462
|
+
}, Zs = ({
|
|
1463
1463
|
onBack: t,
|
|
1464
1464
|
showBackButton: s,
|
|
1465
1465
|
renderMessageInputActions: n,
|
|
@@ -1471,88 +1471,88 @@ const ue = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
1471
1471
|
onBlockParticipantClick: g,
|
|
1472
1472
|
onReportParticipantClick: h,
|
|
1473
1473
|
showStarButton: b = !1,
|
|
1474
|
-
chatbotVotingEnabled:
|
|
1475
|
-
onAttachmentUnlock:
|
|
1474
|
+
chatbotVotingEnabled: C = !1,
|
|
1475
|
+
onAttachmentUnlock: E,
|
|
1476
1476
|
onAttachmentDownload: m,
|
|
1477
|
-
renderChannelBanner:
|
|
1477
|
+
renderChannelBanner: S,
|
|
1478
1478
|
customProfileContent: o,
|
|
1479
|
-
customChannelActions:
|
|
1480
|
-
renderMessage:
|
|
1479
|
+
customChannelActions: y,
|
|
1480
|
+
renderMessage: M
|
|
1481
1481
|
}) => {
|
|
1482
|
-
const { channel:
|
|
1483
|
-
(
|
|
1484
|
-
var
|
|
1485
|
-
return ((
|
|
1482
|
+
const { channel: N } = Ie(), v = Q(null), w = F.useMemo(() => Object.values(N.state.members || {}).find(
|
|
1483
|
+
(_) => {
|
|
1484
|
+
var p;
|
|
1485
|
+
return ((p = _.user) == null ? void 0 : p.id) && _.user.id !== N._client.userID;
|
|
1486
1486
|
}
|
|
1487
|
-
), [
|
|
1488
|
-
const f =
|
|
1487
|
+
), [N._client.userID, N.state.members]), A = F.useMemo(() => {
|
|
1488
|
+
const f = N.data ?? {};
|
|
1489
1489
|
if (f.followerStatus)
|
|
1490
1490
|
return String(f.followerStatus);
|
|
1491
1491
|
if (f.isFollower !== void 0)
|
|
1492
1492
|
return f.isFollower ? "Subscribed to you" : "Not subscribed";
|
|
1493
|
-
}, [
|
|
1493
|
+
}, [N.data]), x = U(() => {
|
|
1494
1494
|
var f;
|
|
1495
|
-
(f =
|
|
1495
|
+
(f = v.current) == null || f.showModal();
|
|
1496
1496
|
}, []), u = U(() => {
|
|
1497
1497
|
var f;
|
|
1498
|
-
(f =
|
|
1498
|
+
(f = v.current) == null || f.close();
|
|
1499
1499
|
}, []);
|
|
1500
1500
|
return /* @__PURE__ */ i(he, { children: [
|
|
1501
1501
|
/* @__PURE__ */ e(
|
|
1502
|
-
|
|
1502
|
+
Jt,
|
|
1503
1503
|
{
|
|
1504
1504
|
overrides: {
|
|
1505
1505
|
Message: (f) => {
|
|
1506
|
-
const { message:
|
|
1507
|
-
|
|
1506
|
+
const { message: _ } = Qe("ChannelView"), p = /* @__PURE__ */ e(
|
|
1507
|
+
Ds,
|
|
1508
1508
|
{
|
|
1509
1509
|
...f,
|
|
1510
|
-
chatbotVotingEnabled:
|
|
1511
|
-
onAttachmentUnlock:
|
|
1510
|
+
chatbotVotingEnabled: C,
|
|
1511
|
+
onAttachmentUnlock: E,
|
|
1512
1512
|
onAttachmentDownload: m
|
|
1513
1513
|
}
|
|
1514
1514
|
);
|
|
1515
|
-
return !
|
|
1515
|
+
return !M || !_ ? p : M(p, _);
|
|
1516
1516
|
}
|
|
1517
1517
|
},
|
|
1518
|
-
children: /* @__PURE__ */ i(
|
|
1518
|
+
children: /* @__PURE__ */ i(Xt, { children: [
|
|
1519
1519
|
/* @__PURE__ */ e("div", { className: "p-4", children: /* @__PURE__ */ e(
|
|
1520
|
-
|
|
1520
|
+
qs,
|
|
1521
1521
|
{
|
|
1522
1522
|
onBack: t,
|
|
1523
1523
|
showBackButton: s,
|
|
1524
1524
|
onShowInfo: x,
|
|
1525
|
-
canShowInfo: !!
|
|
1525
|
+
canShowInfo: !!w,
|
|
1526
1526
|
showStarButton: b
|
|
1527
1527
|
}
|
|
1528
1528
|
) }),
|
|
1529
|
-
|
|
1529
|
+
S == null ? void 0 : S(),
|
|
1530
1530
|
/* @__PURE__ */ e("div", { className: "flex-1 overflow-hidden relative", children: /* @__PURE__ */ e(
|
|
1531
|
-
|
|
1531
|
+
Kt,
|
|
1532
1532
|
{
|
|
1533
1533
|
hideDeletedMessages: !0,
|
|
1534
1534
|
hideNewMessageSeparator: !1,
|
|
1535
1535
|
messageActions: void 0
|
|
1536
1536
|
}
|
|
1537
1537
|
) }),
|
|
1538
|
-
r == null ? void 0 : r(
|
|
1538
|
+
r == null ? void 0 : r(N),
|
|
1539
1539
|
/* @__PURE__ */ e(
|
|
1540
|
-
|
|
1540
|
+
Ps,
|
|
1541
1541
|
{
|
|
1542
|
-
renderActions: () => n == null ? void 0 : n(
|
|
1542
|
+
renderActions: () => n == null ? void 0 : n(N)
|
|
1543
1543
|
}
|
|
1544
1544
|
)
|
|
1545
1545
|
] })
|
|
1546
1546
|
}
|
|
1547
1547
|
),
|
|
1548
1548
|
/* @__PURE__ */ e(
|
|
1549
|
-
|
|
1549
|
+
Ns,
|
|
1550
1550
|
{
|
|
1551
|
-
dialogRef:
|
|
1551
|
+
dialogRef: v,
|
|
1552
1552
|
onClose: u,
|
|
1553
|
-
participant:
|
|
1554
|
-
channel:
|
|
1555
|
-
followerStatusLabel:
|
|
1553
|
+
participant: w,
|
|
1554
|
+
channel: N,
|
|
1555
|
+
followerStatusLabel: A,
|
|
1556
1556
|
onLeaveConversation: l,
|
|
1557
1557
|
onBlockParticipant: d,
|
|
1558
1558
|
showDeleteConversation: a,
|
|
@@ -1560,11 +1560,11 @@ const ue = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
1560
1560
|
onBlockParticipantClick: g,
|
|
1561
1561
|
onReportParticipantClick: h,
|
|
1562
1562
|
customProfileContent: o,
|
|
1563
|
-
customChannelActions:
|
|
1563
|
+
customChannelActions: y
|
|
1564
1564
|
}
|
|
1565
1565
|
)
|
|
1566
1566
|
] });
|
|
1567
|
-
},
|
|
1567
|
+
}, it = F.memo(
|
|
1568
1568
|
({
|
|
1569
1569
|
channel: t,
|
|
1570
1570
|
onBack: s,
|
|
@@ -1574,42 +1574,42 @@ const ue = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
1574
1574
|
onLeaveConversation: d,
|
|
1575
1575
|
onBlockParticipant: a,
|
|
1576
1576
|
className: c,
|
|
1577
|
-
CustomChannelEmptyState: g =
|
|
1577
|
+
CustomChannelEmptyState: g = Ys,
|
|
1578
1578
|
showDeleteConversation: h = !0,
|
|
1579
1579
|
onDeleteConversationClick: b,
|
|
1580
|
-
onBlockParticipantClick:
|
|
1581
|
-
onReportParticipantClick:
|
|
1580
|
+
onBlockParticipantClick: C,
|
|
1581
|
+
onReportParticipantClick: E,
|
|
1582
1582
|
dmAgentEnabled: m,
|
|
1583
|
-
messageMetadata:
|
|
1583
|
+
messageMetadata: S,
|
|
1584
1584
|
onMessageSent: o,
|
|
1585
|
-
showStarButton:
|
|
1586
|
-
chatbotVotingEnabled:
|
|
1587
|
-
onAttachmentUnlock:
|
|
1588
|
-
onAttachmentDownload:
|
|
1589
|
-
renderChannelBanner:
|
|
1590
|
-
customProfileContent:
|
|
1585
|
+
showStarButton: y = !1,
|
|
1586
|
+
chatbotVotingEnabled: M = !1,
|
|
1587
|
+
onAttachmentUnlock: N,
|
|
1588
|
+
onAttachmentDownload: v,
|
|
1589
|
+
renderChannelBanner: w,
|
|
1590
|
+
customProfileContent: A,
|
|
1591
1591
|
customChannelActions: x,
|
|
1592
1592
|
renderMessage: u
|
|
1593
1593
|
}) => {
|
|
1594
1594
|
const f = U(
|
|
1595
|
-
async (
|
|
1596
|
-
var
|
|
1597
|
-
const
|
|
1598
|
-
...
|
|
1599
|
-
...
|
|
1600
|
-
...
|
|
1595
|
+
async (_, p, D) => {
|
|
1596
|
+
var J;
|
|
1597
|
+
const G = ((J = t.data) == null ? void 0 : J.chatbot_paused) === !0, T = m && !G, $ = {
|
|
1598
|
+
...p,
|
|
1599
|
+
...T && { silent: !0 },
|
|
1600
|
+
...S && {
|
|
1601
1601
|
metadata: {
|
|
1602
|
-
...
|
|
1603
|
-
...
|
|
1602
|
+
...p.metadata ?? {},
|
|
1603
|
+
...S
|
|
1604
1604
|
}
|
|
1605
1605
|
}
|
|
1606
|
-
},
|
|
1607
|
-
...
|
|
1608
|
-
...
|
|
1609
|
-
},
|
|
1610
|
-
return o == null || o(
|
|
1606
|
+
}, se = {
|
|
1607
|
+
...D,
|
|
1608
|
+
...T && { skip_push: !0 }
|
|
1609
|
+
}, Z = await t.sendMessage($, se);
|
|
1610
|
+
return o == null || o(Z), Z;
|
|
1611
1611
|
},
|
|
1612
|
-
[t, m,
|
|
1612
|
+
[t, m, S, o]
|
|
1613
1613
|
);
|
|
1614
1614
|
return /* @__PURE__ */ e(
|
|
1615
1615
|
"div",
|
|
@@ -1619,16 +1619,16 @@ const ue = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
1619
1619
|
c
|
|
1620
1620
|
),
|
|
1621
1621
|
children: /* @__PURE__ */ e(
|
|
1622
|
-
|
|
1622
|
+
Zt,
|
|
1623
1623
|
{
|
|
1624
1624
|
channel: t,
|
|
1625
|
-
MessageSystem:
|
|
1625
|
+
MessageSystem: Vs,
|
|
1626
1626
|
EmptyStateIndicator: g,
|
|
1627
1627
|
LoadingIndicator: Se,
|
|
1628
|
-
DateSeparator:
|
|
1628
|
+
DateSeparator: ps,
|
|
1629
1629
|
doSendMessageRequest: f,
|
|
1630
1630
|
children: /* @__PURE__ */ e(
|
|
1631
|
-
|
|
1631
|
+
Zs,
|
|
1632
1632
|
{
|
|
1633
1633
|
onBack: s,
|
|
1634
1634
|
showBackButton: n,
|
|
@@ -1639,14 +1639,14 @@ const ue = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
1639
1639
|
CustomChannelEmptyState: g,
|
|
1640
1640
|
showDeleteConversation: h,
|
|
1641
1641
|
onDeleteConversationClick: b,
|
|
1642
|
-
onBlockParticipantClick:
|
|
1643
|
-
onReportParticipantClick:
|
|
1644
|
-
showStarButton:
|
|
1645
|
-
chatbotVotingEnabled:
|
|
1646
|
-
onAttachmentUnlock:
|
|
1647
|
-
onAttachmentDownload:
|
|
1648
|
-
renderChannelBanner:
|
|
1649
|
-
customProfileContent:
|
|
1642
|
+
onBlockParticipantClick: C,
|
|
1643
|
+
onReportParticipantClick: E,
|
|
1644
|
+
showStarButton: y,
|
|
1645
|
+
chatbotVotingEnabled: M,
|
|
1646
|
+
onAttachmentUnlock: N,
|
|
1647
|
+
onAttachmentDownload: v,
|
|
1648
|
+
renderChannelBanner: w,
|
|
1649
|
+
customProfileContent: A,
|
|
1650
1650
|
customChannelActions: x,
|
|
1651
1651
|
renderMessage: u
|
|
1652
1652
|
}
|
|
@@ -1657,16 +1657,16 @@ const ue = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
1657
1657
|
);
|
|
1658
1658
|
}
|
|
1659
1659
|
);
|
|
1660
|
-
|
|
1661
|
-
function
|
|
1660
|
+
it.displayName = "ChannelView";
|
|
1661
|
+
function Js({
|
|
1662
1662
|
searchQuery: t,
|
|
1663
1663
|
setSearchQuery: s,
|
|
1664
1664
|
placeholder: n
|
|
1665
1665
|
}) {
|
|
1666
|
-
const r =
|
|
1666
|
+
const r = Q(null);
|
|
1667
1667
|
return /* @__PURE__ */ i("div", { className: "relative", children: [
|
|
1668
1668
|
/* @__PURE__ */ e(
|
|
1669
|
-
|
|
1669
|
+
rs,
|
|
1670
1670
|
{
|
|
1671
1671
|
className: "pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-stone",
|
|
1672
1672
|
weight: "bold"
|
|
@@ -1684,7 +1684,7 @@ function qs({
|
|
|
1684
1684
|
}
|
|
1685
1685
|
),
|
|
1686
1686
|
t && /* @__PURE__ */ e(
|
|
1687
|
-
|
|
1687
|
+
ot,
|
|
1688
1688
|
{
|
|
1689
1689
|
label: "Clear search",
|
|
1690
1690
|
onClick: () => {
|
|
@@ -1697,7 +1697,7 @@ function qs({
|
|
|
1697
1697
|
)
|
|
1698
1698
|
] });
|
|
1699
1699
|
}
|
|
1700
|
-
const
|
|
1700
|
+
const Xs = ({
|
|
1701
1701
|
participantSource: t,
|
|
1702
1702
|
onSelectParticipant: s,
|
|
1703
1703
|
onClose: n,
|
|
@@ -1706,19 +1706,19 @@ const Zs = ({
|
|
|
1706
1706
|
searchPlaceholder: d = "Search participants...",
|
|
1707
1707
|
className: a
|
|
1708
1708
|
}) => {
|
|
1709
|
-
const { debug: c } = Me(), [g, h] =
|
|
1709
|
+
const { debug: c } = Me(), [g, h] = k(""), [b, C] = k([]), [E, m] = k(!1), [S, o] = k(null), [y, M] = k(
|
|
1710
1710
|
null
|
|
1711
|
-
),
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
}, [t]),
|
|
1711
|
+
), N = Q(!1);
|
|
1712
|
+
X(() => {
|
|
1713
|
+
N.current = !1;
|
|
1714
|
+
}, [t]), X(() => {
|
|
1715
1715
|
if (t.loading) {
|
|
1716
1716
|
c && console.log(
|
|
1717
1717
|
"[ParticipantPicker] Waiting for participant source to finish loading..."
|
|
1718
1718
|
);
|
|
1719
1719
|
return;
|
|
1720
1720
|
}
|
|
1721
|
-
if (
|
|
1721
|
+
if (N.current) return;
|
|
1722
1722
|
(async () => {
|
|
1723
1723
|
c && console.log("[ParticipantPicker] Loading initial participants..."), m(!0), o(null);
|
|
1724
1724
|
try {
|
|
@@ -1727,7 +1727,7 @@ const Zs = ({
|
|
|
1727
1727
|
// Load all participants initially
|
|
1728
1728
|
limit: 100
|
|
1729
1729
|
});
|
|
1730
|
-
|
|
1730
|
+
C(u.participants), N.current = !0, c && console.log(
|
|
1731
1731
|
"[ParticipantPicker] Participants loaded successfully:",
|
|
1732
1732
|
u.participants.length
|
|
1733
1733
|
);
|
|
@@ -1739,42 +1739,42 @@ const Zs = ({
|
|
|
1739
1739
|
}
|
|
1740
1740
|
})();
|
|
1741
1741
|
}, [t, c]);
|
|
1742
|
-
const
|
|
1742
|
+
const v = b.filter((x) => !r.has(x.id)).filter((x) => {
|
|
1743
1743
|
var f;
|
|
1744
1744
|
if (!g) return !0;
|
|
1745
1745
|
const u = g.toLowerCase();
|
|
1746
1746
|
return x.name.toLowerCase().includes(u) || ((f = x.email) == null ? void 0 : f.toLowerCase().includes(u)) || !1;
|
|
1747
|
-
}),
|
|
1747
|
+
}), w = U(
|
|
1748
1748
|
async (x) => {
|
|
1749
|
-
if (!
|
|
1750
|
-
|
|
1749
|
+
if (!y) {
|
|
1750
|
+
M(x.id);
|
|
1751
1751
|
try {
|
|
1752
1752
|
await s(x);
|
|
1753
1753
|
} catch (u) {
|
|
1754
|
-
console.error("[ParticipantPicker] Failed to start chat:", u),
|
|
1754
|
+
console.error("[ParticipantPicker] Failed to start chat:", u), M(null);
|
|
1755
1755
|
}
|
|
1756
1756
|
}
|
|
1757
1757
|
},
|
|
1758
|
-
[s,
|
|
1759
|
-
),
|
|
1760
|
-
(x.key === "Enter" || x.key === " ") && (x.preventDefault(),
|
|
1758
|
+
[s, y]
|
|
1759
|
+
), A = (x, u) => {
|
|
1760
|
+
(x.key === "Enter" || x.key === " ") && (x.preventDefault(), w(u));
|
|
1761
1761
|
};
|
|
1762
1762
|
return /* @__PURE__ */ i("div", { className: L("flex flex-col h-full", a), children: [
|
|
1763
1763
|
/* @__PURE__ */ i("div", { className: "px-4 py-4 border-b border-sand bg-chalk", children: [
|
|
1764
1764
|
/* @__PURE__ */ i("div", { className: "flex items-center justify-between mb-3", children: [
|
|
1765
1765
|
/* @__PURE__ */ e("h2", { className: "text-lg font-semibold text-charcoal", children: "Start a new Conversation" }),
|
|
1766
|
-
/* @__PURE__ */ e(
|
|
1766
|
+
/* @__PURE__ */ e(lt, { onClick: n })
|
|
1767
1767
|
] }),
|
|
1768
1768
|
/* @__PURE__ */ i("p", { className: "text-xs text-stone mb-3", children: [
|
|
1769
1769
|
"Select a ",
|
|
1770
1770
|
l.slice(0, -1),
|
|
1771
1771
|
" to start messaging (",
|
|
1772
|
-
|
|
1772
|
+
v.length,
|
|
1773
1773
|
" available)",
|
|
1774
1774
|
t.totalCount !== void 0 && ` • ${t.totalCount} ${l} total`
|
|
1775
1775
|
] }),
|
|
1776
1776
|
/* @__PURE__ */ e(
|
|
1777
|
-
|
|
1777
|
+
Js,
|
|
1778
1778
|
{
|
|
1779
1779
|
searchQuery: g,
|
|
1780
1780
|
setSearchQuery: h,
|
|
@@ -1782,37 +1782,37 @@ const Zs = ({
|
|
|
1782
1782
|
}
|
|
1783
1783
|
)
|
|
1784
1784
|
] }),
|
|
1785
|
-
|
|
1785
|
+
S && /* @__PURE__ */ i("div", { className: "p-4 text-sm text-danger bg-danger-alt", children: [
|
|
1786
1786
|
"Error loading ",
|
|
1787
1787
|
l,
|
|
1788
1788
|
": ",
|
|
1789
|
-
|
|
1789
|
+
S
|
|
1790
1790
|
] }),
|
|
1791
|
-
/* @__PURE__ */ e("div", { className: "flex-1 overflow-auto", children:
|
|
1791
|
+
/* @__PURE__ */ e("div", { className: "flex-1 overflow-auto", children: E && v.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: [
|
|
1792
1792
|
/* @__PURE__ */ e("div", { className: "w-4 h-4 animate-spin rounded-full border-2 border-primary border-t-transparent" }),
|
|
1793
1793
|
/* @__PURE__ */ i("span", { className: "text-sm text-stone", children: [
|
|
1794
1794
|
"Loading ",
|
|
1795
1795
|
l,
|
|
1796
1796
|
"..."
|
|
1797
1797
|
] })
|
|
1798
|
-
] }) }) :
|
|
1799
|
-
/* @__PURE__ */ e("div", { className: "mx-auto mb-4 flex h-16 w-16 items-center justify-center rounded-full bg-sand", children: /* @__PURE__ */ e(
|
|
1798
|
+
] }) }) : v.length === 0 ? /* @__PURE__ */ i("div", { className: "p-6 text-center", children: [
|
|
1799
|
+
/* @__PURE__ */ e("div", { className: "mx-auto mb-4 flex h-16 w-16 items-center justify-center rounded-full bg-sand", children: /* @__PURE__ */ e(We, { className: "h-8 w-8 text-charcoal" }) }),
|
|
1800
1800
|
/* @__PURE__ */ e("h3", { className: "text-sm font-semibold text-charcoal mb-2", children: g ? `No ${l} found` : b.length > 0 ? `Already chatting with all ${l}` : `No ${l} yet` }),
|
|
1801
1801
|
/* @__PURE__ */ e("p", { className: "text-xs text-stone", children: g ? "Try a different search term" : b.length > 0 ? `You have existing conversations with all your ${l}` : `${l.charAt(0).toUpperCase() + l.slice(1)} will appear here` })
|
|
1802
1802
|
] }) : /* @__PURE__ */ i("ul", { className: "space-y-0", children: [
|
|
1803
|
-
|
|
1803
|
+
v.map((x) => {
|
|
1804
1804
|
const u = x.name || x.email || x.id, f = x.email && x.name ? x.email : x.phone;
|
|
1805
1805
|
return /* @__PURE__ */ e("li", { children: /* @__PURE__ */ e(
|
|
1806
1806
|
"button",
|
|
1807
1807
|
{
|
|
1808
1808
|
type: "button",
|
|
1809
|
-
onClick: () =>
|
|
1810
|
-
onKeyDown: (
|
|
1809
|
+
onClick: () => w(x),
|
|
1810
|
+
onKeyDown: (_) => A(_, x),
|
|
1811
1811
|
className: "w-full px-4 py-3 hover:bg-sand transition-colors border-b border-sand text-left focus-ring",
|
|
1812
1812
|
children: /* @__PURE__ */ i("div", { className: "flex items-center justify-between", children: [
|
|
1813
1813
|
/* @__PURE__ */ i("div", { className: "flex items-center space-x-3 flex-1 min-w-0", children: [
|
|
1814
1814
|
/* @__PURE__ */ e(
|
|
1815
|
-
|
|
1815
|
+
le,
|
|
1816
1816
|
{
|
|
1817
1817
|
id: x.id,
|
|
1818
1818
|
name: u,
|
|
@@ -1825,18 +1825,18 @@ const Zs = ({
|
|
|
1825
1825
|
f && /* @__PURE__ */ e("p", { className: "text-xs text-stone truncate", children: f })
|
|
1826
1826
|
] })
|
|
1827
1827
|
] }),
|
|
1828
|
-
/* @__PURE__ */ e("div", { className: "flex-shrink-0", children:
|
|
1828
|
+
/* @__PURE__ */ e("div", { className: "flex-shrink-0", children: y === x.id ? /* @__PURE__ */ e(_e, { className: "h-5 w-5 text-primary animate-spin" }) : /* @__PURE__ */ e(We, { className: "h-5 w-5 text-stone" }) })
|
|
1829
1829
|
] })
|
|
1830
1830
|
}
|
|
1831
1831
|
) }, x.id);
|
|
1832
1832
|
}),
|
|
1833
|
-
|
|
1833
|
+
E && /* @__PURE__ */ e("li", { className: "p-4 flex justify-center", children: /* @__PURE__ */ i("div", { className: "flex items-center space-x-2", children: [
|
|
1834
1834
|
/* @__PURE__ */ e("div", { className: "w-4 h-4 animate-spin rounded-full border-2 border-primary border-t-transparent" }),
|
|
1835
1835
|
/* @__PURE__ */ e("span", { className: "text-sm text-stone", children: "Loading more..." })
|
|
1836
1836
|
] }) })
|
|
1837
1837
|
] }) })
|
|
1838
1838
|
] });
|
|
1839
|
-
},
|
|
1839
|
+
}, Ks = ({ className: t }) => /* @__PURE__ */ i(
|
|
1840
1840
|
"svg",
|
|
1841
1841
|
{
|
|
1842
1842
|
width: "140",
|
|
@@ -1970,16 +1970,16 @@ const Zs = ({
|
|
|
1970
1970
|
] })
|
|
1971
1971
|
]
|
|
1972
1972
|
}
|
|
1973
|
-
),
|
|
1973
|
+
), ct = F.memo(
|
|
1974
1974
|
({ 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: [
|
|
1975
|
-
/* @__PURE__ */ e(
|
|
1975
|
+
/* @__PURE__ */ e(Ks, {}),
|
|
1976
1976
|
s && !t && /* @__PURE__ */ i("div", { className: "mt-8", children: [
|
|
1977
1977
|
/* @__PURE__ */ e("h2", { className: "font-medium text-black text-[18px] mb-2", children: "Your inbox is empty" }),
|
|
1978
1978
|
/* @__PURE__ */ e("p", { className: "text-[#676B5F] text-sm mb-6", children: "Share with your followers to start receiving messages" })
|
|
1979
1979
|
] })
|
|
1980
1980
|
] }) })
|
|
1981
1981
|
);
|
|
1982
|
-
|
|
1982
|
+
ct.displayName = "EmptyState";
|
|
1983
1983
|
const Ee = 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: [
|
|
1984
1984
|
/* @__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: "⚠️" }) }),
|
|
1985
1985
|
/* @__PURE__ */ e("h2", { className: "font-semibold text-charcoal mb-2", children: "Oops!" }),
|
|
@@ -1995,7 +1995,7 @@ const Ee = F.memo(({ message: t, onBack: s }) => /* @__PURE__ */ e("div", { clas
|
|
|
1995
1995
|
)
|
|
1996
1996
|
] }) }));
|
|
1997
1997
|
Ee.displayName = "ErrorState";
|
|
1998
|
-
const
|
|
1998
|
+
const cn = ({
|
|
1999
1999
|
capabilities: t = {},
|
|
2000
2000
|
className: s,
|
|
2001
2001
|
renderMessageInputActions: n,
|
|
@@ -2007,116 +2007,118 @@ const on = ({
|
|
|
2007
2007
|
CustomChannelEmptyState: g,
|
|
2008
2008
|
showChannelList: h = !0,
|
|
2009
2009
|
filters: b,
|
|
2010
|
-
channelRenderFilterFn:
|
|
2011
|
-
channelListCustomEmptyStateIndicator:
|
|
2010
|
+
channelRenderFilterFn: C,
|
|
2011
|
+
channelListCustomEmptyStateIndicator: E,
|
|
2012
2012
|
onDeleteConversationClick: m,
|
|
2013
|
-
onBlockParticipantClick:
|
|
2013
|
+
onBlockParticipantClick: S,
|
|
2014
2014
|
onReportParticipantClick: o,
|
|
2015
|
-
dmAgentEnabled:
|
|
2016
|
-
messageMetadata:
|
|
2017
|
-
onMessageSent:
|
|
2018
|
-
showStarButton:
|
|
2019
|
-
chatbotVotingEnabled:
|
|
2020
|
-
renderMessagePreview:
|
|
2015
|
+
dmAgentEnabled: y,
|
|
2016
|
+
messageMetadata: M,
|
|
2017
|
+
onMessageSent: N,
|
|
2018
|
+
showStarButton: v = !1,
|
|
2019
|
+
chatbotVotingEnabled: w = !1,
|
|
2020
|
+
renderMessagePreview: A,
|
|
2021
2021
|
renderChannelBanner: x,
|
|
2022
2022
|
customProfileContent: u,
|
|
2023
2023
|
customChannelActions: f,
|
|
2024
|
-
renderMessage:
|
|
2024
|
+
renderMessage: _,
|
|
2025
|
+
onAttachmentUnlock: p,
|
|
2026
|
+
onAttachmentDownload: D
|
|
2025
2027
|
}) => {
|
|
2026
2028
|
const {
|
|
2027
|
-
service:
|
|
2028
|
-
client:
|
|
2029
|
-
isConnected:
|
|
2030
|
-
isLoading:
|
|
2029
|
+
service: G,
|
|
2030
|
+
client: T,
|
|
2031
|
+
isConnected: $,
|
|
2032
|
+
isLoading: se,
|
|
2031
2033
|
error: Z,
|
|
2032
|
-
refreshConnection:
|
|
2033
|
-
debug:
|
|
2034
|
-
} =
|
|
2035
|
-
participantSource:
|
|
2036
|
-
participantLabel:
|
|
2034
|
+
refreshConnection: J,
|
|
2035
|
+
debug: P
|
|
2036
|
+
} = os(), [V, z] = k(null), [ie, ce] = k(!1), [R, O] = k(!1), [Y, W] = k(!1), [ne, ee] = k(/* @__PURE__ */ new Set()), [de, Ge] = k(0), [q, me] = k(!1), [ae, re] = k(null), te = Q(null), {
|
|
2037
|
+
participantSource: fe,
|
|
2038
|
+
participantLabel: ge = "participants",
|
|
2037
2039
|
showDeleteConversation: xe = !0
|
|
2038
2040
|
} = t, be = F.useMemo(() => {
|
|
2039
|
-
const
|
|
2041
|
+
const I = T == null ? void 0 : T.userID;
|
|
2040
2042
|
return {
|
|
2041
2043
|
...{
|
|
2042
2044
|
type: "messaging",
|
|
2043
2045
|
last_message_at: { $exists: !0 },
|
|
2044
|
-
...
|
|
2045
|
-
members: { $in: [
|
|
2046
|
+
...I && {
|
|
2047
|
+
members: { $in: [I] },
|
|
2046
2048
|
hidden: !1
|
|
2047
2049
|
}
|
|
2048
2050
|
},
|
|
2049
2051
|
...b
|
|
2050
2052
|
};
|
|
2051
|
-
}, [b,
|
|
2052
|
-
if (!
|
|
2053
|
-
const
|
|
2054
|
-
if (
|
|
2053
|
+
}, [b, T == null ? void 0 : T.userID]), oe = Q(null), K = U(async () => {
|
|
2054
|
+
if (!T || !$) return;
|
|
2055
|
+
const I = T.userID;
|
|
2056
|
+
if (I)
|
|
2055
2057
|
try {
|
|
2056
|
-
|
|
2057
|
-
const
|
|
2058
|
+
P && console.log("[MessagingShell] Syncing channels for user:", I);
|
|
2059
|
+
const H = await T.queryChannels(
|
|
2058
2060
|
{
|
|
2059
2061
|
type: "messaging",
|
|
2060
|
-
members: { $in: [
|
|
2062
|
+
members: { $in: [I] }
|
|
2061
2063
|
},
|
|
2062
2064
|
{},
|
|
2063
2065
|
{ limit: 100 }
|
|
2064
2066
|
), B = /* @__PURE__ */ new Set();
|
|
2065
|
-
|
|
2067
|
+
H.forEach((j) => {
|
|
2066
2068
|
const ke = j.state.members;
|
|
2067
|
-
Object.values(ke).forEach((
|
|
2068
|
-
var
|
|
2069
|
-
const Te = (
|
|
2070
|
-
Te && Te !==
|
|
2069
|
+
Object.values(ke).forEach((ht) => {
|
|
2070
|
+
var $e;
|
|
2071
|
+
const Te = ($e = ht.user) == null ? void 0 : $e.id;
|
|
2072
|
+
Te && Te !== I && B.add(Te);
|
|
2071
2073
|
});
|
|
2072
|
-
}),
|
|
2073
|
-
channelCount:
|
|
2074
|
+
}), ee((j) => j.size === B.size && [...j].every((ke) => B.has(ke)) ? j : B), ce(H.length > 0), O(!0), oe.current = I, P && console.log("[MessagingShell] Channels synced successfully:", {
|
|
2075
|
+
channelCount: H.length,
|
|
2074
2076
|
memberCount: B.size
|
|
2075
2077
|
});
|
|
2076
|
-
} catch (
|
|
2077
|
-
console.error("[MessagingShell] Failed to sync channels:",
|
|
2078
|
+
} catch (H) {
|
|
2079
|
+
console.error("[MessagingShell] Failed to sync channels:", H);
|
|
2078
2080
|
}
|
|
2079
|
-
}, [
|
|
2080
|
-
|
|
2081
|
-
if (!
|
|
2082
|
-
const
|
|
2083
|
-
|
|
2084
|
-
}, [
|
|
2085
|
-
if (!a || !
|
|
2081
|
+
}, [T, $, P]);
|
|
2082
|
+
X(() => {
|
|
2083
|
+
if (!T || !$) return;
|
|
2084
|
+
const I = T.userID;
|
|
2085
|
+
I && oe.current !== I && K();
|
|
2086
|
+
}, [T, $, K]), X(() => {
|
|
2087
|
+
if (!a || !T || !$) return;
|
|
2086
2088
|
(async () => {
|
|
2087
|
-
const
|
|
2088
|
-
if (
|
|
2089
|
+
const H = T.userID;
|
|
2090
|
+
if (H)
|
|
2089
2091
|
try {
|
|
2090
|
-
|
|
2092
|
+
P && console.log(
|
|
2091
2093
|
"[MessagingShell] Loading initial conversation with:",
|
|
2092
2094
|
a
|
|
2093
2095
|
);
|
|
2094
|
-
const B = await
|
|
2096
|
+
const B = await T.queryChannels(
|
|
2095
2097
|
{
|
|
2096
2098
|
type: "messaging",
|
|
2097
|
-
members: { $eq: [
|
|
2099
|
+
members: { $eq: [H, a] }
|
|
2098
2100
|
},
|
|
2099
2101
|
{},
|
|
2100
2102
|
{ limit: 1 }
|
|
2101
2103
|
);
|
|
2102
2104
|
if (B.length > 0)
|
|
2103
|
-
z(B[0]),
|
|
2105
|
+
z(B[0]), me(!0), re(null), l && l(B[0]), P && console.log(
|
|
2104
2106
|
"[MessagingShell] Initial conversation loaded:",
|
|
2105
2107
|
B[0].id
|
|
2106
2108
|
);
|
|
2107
|
-
else if (c &&
|
|
2108
|
-
|
|
2109
|
+
else if (c && G) {
|
|
2110
|
+
P && console.log(
|
|
2109
2111
|
"[MessagingShell] No conversation found, creating one for:",
|
|
2110
2112
|
c
|
|
2111
2113
|
);
|
|
2112
2114
|
try {
|
|
2113
|
-
const j = await
|
|
2115
|
+
const j = await G.startChannelWithParticipant({
|
|
2114
2116
|
id: c.id,
|
|
2115
2117
|
name: c.name,
|
|
2116
2118
|
email: c.email,
|
|
2117
2119
|
phone: c.phone
|
|
2118
2120
|
});
|
|
2119
|
-
z(j),
|
|
2121
|
+
z(j), me(!0), re(null), l && l(j), P && console.log(
|
|
2120
2122
|
"[MessagingShell] Channel created and loaded:",
|
|
2121
2123
|
j.id
|
|
2122
2124
|
);
|
|
@@ -2124,12 +2126,12 @@ const on = ({
|
|
|
2124
2126
|
console.error(
|
|
2125
2127
|
"[MessagingShell] Failed to create conversation:",
|
|
2126
2128
|
j
|
|
2127
|
-
),
|
|
2129
|
+
), re("Failed to create conversation");
|
|
2128
2130
|
}
|
|
2129
2131
|
} else
|
|
2130
|
-
|
|
2132
|
+
re(
|
|
2131
2133
|
"No conversation found with this account"
|
|
2132
|
-
),
|
|
2134
|
+
), P && console.log(
|
|
2133
2135
|
"[MessagingShell] No conversation found for:",
|
|
2134
2136
|
a
|
|
2135
2137
|
);
|
|
@@ -2137,77 +2139,77 @@ const on = ({
|
|
|
2137
2139
|
console.error(
|
|
2138
2140
|
"[MessagingShell] Failed to load initial conversation:",
|
|
2139
2141
|
B
|
|
2140
|
-
),
|
|
2142
|
+
), re("Failed to load conversation");
|
|
2141
2143
|
}
|
|
2142
2144
|
})();
|
|
2143
2145
|
}, [
|
|
2144
2146
|
a,
|
|
2145
2147
|
c,
|
|
2146
|
-
|
|
2147
|
-
|
|
2148
|
-
|
|
2149
|
-
|
|
2148
|
+
T,
|
|
2149
|
+
$,
|
|
2150
|
+
G,
|
|
2151
|
+
P,
|
|
2150
2152
|
l
|
|
2151
2153
|
]);
|
|
2152
2154
|
const Ce = U(
|
|
2153
|
-
(
|
|
2154
|
-
z(
|
|
2155
|
+
(I) => {
|
|
2156
|
+
z(I), l == null || l(I);
|
|
2155
2157
|
},
|
|
2156
2158
|
[l]
|
|
2157
2159
|
), Ne = U(() => {
|
|
2158
|
-
|
|
2159
|
-
}, [
|
|
2160
|
-
async (
|
|
2161
|
-
var
|
|
2162
|
-
if (
|
|
2160
|
+
q || z(null);
|
|
2161
|
+
}, [q]), pe = U(
|
|
2162
|
+
async (I) => {
|
|
2163
|
+
var H;
|
|
2164
|
+
if (G)
|
|
2163
2165
|
try {
|
|
2164
|
-
|
|
2166
|
+
P && console.log(
|
|
2165
2167
|
"[MessagingShell] Starting conversation with:",
|
|
2166
|
-
|
|
2168
|
+
I.id
|
|
2167
2169
|
);
|
|
2168
|
-
const B = await
|
|
2169
|
-
id:
|
|
2170
|
-
name:
|
|
2171
|
-
email:
|
|
2172
|
-
phone:
|
|
2170
|
+
const B = await G.startChannelWithParticipant({
|
|
2171
|
+
id: I.id,
|
|
2172
|
+
name: I.name,
|
|
2173
|
+
email: I.email,
|
|
2174
|
+
phone: I.phone
|
|
2173
2175
|
});
|
|
2174
2176
|
try {
|
|
2175
2177
|
await B.show();
|
|
2176
2178
|
} catch (j) {
|
|
2177
2179
|
console.warn("[MessagingShell] Failed to unhide channel:", j);
|
|
2178
2180
|
}
|
|
2179
|
-
z(B),
|
|
2181
|
+
z(B), W(!1), (H = te.current) == null || H.close(), d == null || d(I);
|
|
2180
2182
|
} catch (B) {
|
|
2181
2183
|
console.error("[MessagingShell] Failed to start conversation:", B);
|
|
2182
2184
|
}
|
|
2183
2185
|
},
|
|
2184
|
-
[
|
|
2185
|
-
),
|
|
2186
|
-
var
|
|
2187
|
-
|
|
2188
|
-
}, []),
|
|
2189
|
-
(
|
|
2190
|
-
|
|
2186
|
+
[G, d, P]
|
|
2187
|
+
), ye = U(() => {
|
|
2188
|
+
var I;
|
|
2189
|
+
W(!1), (I = te.current) == null || I.close();
|
|
2190
|
+
}, []), dt = U(
|
|
2191
|
+
(I) => {
|
|
2192
|
+
I.target === te.current && ye();
|
|
2191
2193
|
},
|
|
2192
|
-
[
|
|
2193
|
-
),
|
|
2194
|
-
async (
|
|
2195
|
-
|
|
2194
|
+
[ye]
|
|
2195
|
+
), mt = U(
|
|
2196
|
+
async (I) => {
|
|
2197
|
+
P && console.log("[MessagingShell] Leaving conversation:", I.id), z(null), me(!1), oe.current = null, await K();
|
|
2196
2198
|
},
|
|
2197
|
-
[
|
|
2198
|
-
),
|
|
2199
|
-
async (
|
|
2200
|
-
|
|
2199
|
+
[K, P]
|
|
2200
|
+
), ut = U(
|
|
2201
|
+
async (I) => {
|
|
2202
|
+
P && console.log("[MessagingShell] Blocking participant:", I), z(null), me(!1), oe.current = null, await K();
|
|
2201
2203
|
},
|
|
2202
|
-
[
|
|
2203
|
-
), ve = !!
|
|
2204
|
-
return
|
|
2204
|
+
[K, P]
|
|
2205
|
+
), ve = !!V;
|
|
2206
|
+
return se ? /* @__PURE__ */ e("div", { className: L("h-full", s), children: /* @__PURE__ */ e(Se, {}) }) : Z ? /* @__PURE__ */ e("div", { className: L("h-full", s), children: /* @__PURE__ */ e(Ee, { message: Z, onBack: J }) }) : !$ || !T ? /* @__PURE__ */ e("div", { className: L("h-full", s), children: /* @__PURE__ */ e(
|
|
2205
2207
|
Ee,
|
|
2206
2208
|
{
|
|
2207
2209
|
message: "Not connected to messaging service",
|
|
2208
|
-
onBack:
|
|
2210
|
+
onBack: J
|
|
2209
2211
|
}
|
|
2210
|
-
) }) :
|
|
2212
|
+
) }) : ae ? /* @__PURE__ */ e("div", { className: L("h-full", s), children: /* @__PURE__ */ e(Ee, { message: ae }) }) : /* @__PURE__ */ i(
|
|
2211
2213
|
"div",
|
|
2212
2214
|
{
|
|
2213
2215
|
className: L(
|
|
@@ -2222,22 +2224,22 @@ const on = ({
|
|
|
2222
2224
|
className: L(
|
|
2223
2225
|
"messaging-channel-list-sidebar min-h-0 min-w-0 lg:flex lg:flex-col",
|
|
2224
2226
|
{
|
|
2225
|
-
"!hidden": h === !1 ||
|
|
2227
|
+
"!hidden": h === !1 || q,
|
|
2226
2228
|
// Hide on mobile when channel selected, show on desktop with consistent wide width
|
|
2227
|
-
"hidden lg:flex lg:flex-1 lg:max-w-2xl": h !== !1 &&
|
|
2229
|
+
"hidden lg:flex lg:flex-1 lg:max-w-2xl": h !== !1 && !q && ve,
|
|
2228
2230
|
// Show on mobile when no channel selected, use same wide width on desktop
|
|
2229
|
-
"flex flex-col w-full lg:flex-1 lg:max-w-2xl": h !== !1 &&
|
|
2231
|
+
"flex flex-col w-full lg:flex-1 lg:max-w-2xl": h !== !1 && !q && !ve
|
|
2230
2232
|
}
|
|
2231
2233
|
),
|
|
2232
2234
|
children: /* @__PURE__ */ e(
|
|
2233
|
-
|
|
2235
|
+
rt,
|
|
2234
2236
|
{
|
|
2235
2237
|
onChannelSelect: Ce,
|
|
2236
|
-
selectedChannel:
|
|
2238
|
+
selectedChannel: V || void 0,
|
|
2237
2239
|
filters: be,
|
|
2238
|
-
channelRenderFilterFn:
|
|
2239
|
-
customEmptyStateIndicator:
|
|
2240
|
-
renderMessagePreview:
|
|
2240
|
+
channelRenderFilterFn: C,
|
|
2241
|
+
customEmptyStateIndicator: E,
|
|
2242
|
+
renderMessagePreview: A
|
|
2241
2243
|
}
|
|
2242
2244
|
)
|
|
2243
2245
|
}
|
|
@@ -2249,76 +2251,78 @@ const on = ({
|
|
|
2249
2251
|
"messaging-conversation-view flex-1 flex-col min-w-0 min-h-0",
|
|
2250
2252
|
{
|
|
2251
2253
|
// In direct conversation mode (or waiting for it), always show (full width)
|
|
2252
|
-
flex:
|
|
2254
|
+
flex: q || ve || a,
|
|
2253
2255
|
// Normal mode: hide on mobile when no channel selected
|
|
2254
|
-
"hidden lg:flex":
|
|
2256
|
+
"hidden lg:flex": !q && !ve && !a
|
|
2255
2257
|
}
|
|
2256
2258
|
),
|
|
2257
|
-
children:
|
|
2258
|
-
|
|
2259
|
+
children: V ? /* @__PURE__ */ e("div", { className: "flex-1 min-h-0 flex flex-col", children: /* @__PURE__ */ e(
|
|
2260
|
+
it,
|
|
2259
2261
|
{
|
|
2260
|
-
channel:
|
|
2262
|
+
channel: V,
|
|
2261
2263
|
onBack: Ne,
|
|
2262
|
-
showBackButton:
|
|
2264
|
+
showBackButton: !q,
|
|
2263
2265
|
renderMessageInputActions: n,
|
|
2264
2266
|
renderConversationFooter: r,
|
|
2265
2267
|
renderChannelBanner: x,
|
|
2266
|
-
onLeaveConversation:
|
|
2267
|
-
onBlockParticipant:
|
|
2268
|
+
onLeaveConversation: mt,
|
|
2269
|
+
onBlockParticipant: ut,
|
|
2268
2270
|
CustomChannelEmptyState: g,
|
|
2269
2271
|
showDeleteConversation: xe,
|
|
2270
2272
|
onDeleteConversationClick: m,
|
|
2271
|
-
onBlockParticipantClick:
|
|
2273
|
+
onBlockParticipantClick: S,
|
|
2272
2274
|
onReportParticipantClick: o,
|
|
2273
|
-
dmAgentEnabled:
|
|
2274
|
-
messageMetadata:
|
|
2275
|
-
onMessageSent:
|
|
2276
|
-
showStarButton:
|
|
2277
|
-
chatbotVotingEnabled:
|
|
2275
|
+
dmAgentEnabled: y,
|
|
2276
|
+
messageMetadata: M,
|
|
2277
|
+
onMessageSent: N,
|
|
2278
|
+
showStarButton: v,
|
|
2279
|
+
chatbotVotingEnabled: w,
|
|
2278
2280
|
customProfileContent: u,
|
|
2279
2281
|
customChannelActions: f,
|
|
2280
|
-
renderMessage:
|
|
2282
|
+
renderMessage: _,
|
|
2283
|
+
onAttachmentUnlock: p,
|
|
2284
|
+
onAttachmentDownload: D
|
|
2281
2285
|
},
|
|
2282
|
-
|
|
2286
|
+
V.id
|
|
2283
2287
|
) }) : a ? (
|
|
2284
2288
|
// Show loading while creating/loading direct conversation channel
|
|
2285
2289
|
/* @__PURE__ */ e(Se, {})
|
|
2286
2290
|
) : /* @__PURE__ */ e(
|
|
2287
|
-
|
|
2291
|
+
ct,
|
|
2288
2292
|
{
|
|
2289
|
-
hasChannels:
|
|
2290
|
-
channelsLoaded:
|
|
2293
|
+
hasChannels: ie,
|
|
2294
|
+
channelsLoaded: R
|
|
2291
2295
|
}
|
|
2292
2296
|
)
|
|
2293
2297
|
}
|
|
2294
2298
|
)
|
|
2295
2299
|
] }),
|
|
2296
|
-
|
|
2300
|
+
fe && // eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-noninteractive-element-interactions
|
|
2297
2301
|
/* @__PURE__ */ e(
|
|
2298
2302
|
"dialog",
|
|
2299
2303
|
{
|
|
2300
|
-
ref:
|
|
2304
|
+
ref: te,
|
|
2301
2305
|
className: "mes-dialog",
|
|
2302
|
-
onClick:
|
|
2303
|
-
onClose:
|
|
2306
|
+
onClick: dt,
|
|
2307
|
+
onClose: ye,
|
|
2304
2308
|
children: /* @__PURE__ */ e("div", { className: "h-full w-full bg-white shadow-max-elevation-light", children: /* @__PURE__ */ e(
|
|
2305
|
-
|
|
2309
|
+
Xs,
|
|
2306
2310
|
{
|
|
2307
|
-
participantSource:
|
|
2311
|
+
participantSource: fe,
|
|
2308
2312
|
onSelectParticipant: pe,
|
|
2309
|
-
onClose:
|
|
2310
|
-
existingParticipantIds:
|
|
2311
|
-
participantLabel:
|
|
2312
|
-
searchPlaceholder: `Search ${
|
|
2313
|
+
onClose: ye,
|
|
2314
|
+
existingParticipantIds: ne,
|
|
2315
|
+
participantLabel: ge,
|
|
2316
|
+
searchPlaceholder: `Search ${ge}...`
|
|
2313
2317
|
},
|
|
2314
|
-
|
|
2318
|
+
de
|
|
2315
2319
|
) })
|
|
2316
2320
|
}
|
|
2317
2321
|
)
|
|
2318
2322
|
]
|
|
2319
2323
|
}
|
|
2320
2324
|
);
|
|
2321
|
-
},
|
|
2325
|
+
}, Qs = ({
|
|
2322
2326
|
question: t,
|
|
2323
2327
|
onClick: s,
|
|
2324
2328
|
loading: n = !1,
|
|
@@ -2340,7 +2344,7 @@ const on = ({
|
|
|
2340
2344
|
),
|
|
2341
2345
|
children: t
|
|
2342
2346
|
}
|
|
2343
|
-
),
|
|
2347
|
+
), dn = ({
|
|
2344
2348
|
faqs: t,
|
|
2345
2349
|
onFaqClick: s,
|
|
2346
2350
|
loadingFaqId: n,
|
|
@@ -2352,7 +2356,7 @@ const on = ({
|
|
|
2352
2356
|
const c = t.filter((g) => g.enabled).sort((g, h) => (g.order ?? 0) - (h.order ?? 0));
|
|
2353
2357
|
return c.length === 0 ? null : /* @__PURE__ */ e("div", { className: l, children: /* @__PURE__ */ i("div", { className: "flex gap-3 items-end", children: [
|
|
2354
2358
|
(d || a) && /* @__PURE__ */ e("div", { className: "flex-none", children: /* @__PURE__ */ e(
|
|
2355
|
-
|
|
2359
|
+
le,
|
|
2356
2360
|
{
|
|
2357
2361
|
id: a || "account",
|
|
2358
2362
|
name: a || "Account",
|
|
@@ -2369,7 +2373,7 @@ const on = ({
|
|
|
2369
2373
|
children: [
|
|
2370
2374
|
r && /* @__PURE__ */ e("p", { className: "text-md text-charcoal mb-4", children: r }),
|
|
2371
2375
|
c.map((g) => /* @__PURE__ */ e(
|
|
2372
|
-
|
|
2376
|
+
Qs,
|
|
2373
2377
|
{
|
|
2374
2378
|
question: g.question,
|
|
2375
2379
|
onClick: () => s(g.id),
|
|
@@ -2381,19 +2385,19 @@ const on = ({
|
|
|
2381
2385
|
}
|
|
2382
2386
|
)
|
|
2383
2387
|
] }) });
|
|
2384
|
-
},
|
|
2385
|
-
const { initialSearch: n = "", pageSize: r = 20 } = s, [l, d] =
|
|
2388
|
+
}, mn = (t, s = {}) => {
|
|
2389
|
+
const { initialSearch: n = "", pageSize: r = 20 } = s, [l, d] = k([]), [a, c] = k(!1), [g, h] = k(null), [b, C] = k(n), [E, m] = k(!0), [S, o] = k(), y = U(async (w = !1, A) => {
|
|
2386
2390
|
if (a) return;
|
|
2387
|
-
const x =
|
|
2391
|
+
const x = A !== void 0 ? A : b;
|
|
2388
2392
|
c(!0), h(null);
|
|
2389
2393
|
try {
|
|
2390
2394
|
const u = await t.loadParticipants({
|
|
2391
2395
|
search: x || void 0,
|
|
2392
2396
|
limit: r,
|
|
2393
|
-
cursor:
|
|
2397
|
+
cursor: w ? void 0 : S
|
|
2394
2398
|
});
|
|
2395
2399
|
d(
|
|
2396
|
-
(f) =>
|
|
2400
|
+
(f) => w ? u.participants : [...f, ...u.participants]
|
|
2397
2401
|
), m(u.hasMore), o(u.nextCursor);
|
|
2398
2402
|
} catch (u) {
|
|
2399
2403
|
const f = u instanceof Error ? u.message : "Failed to load participants";
|
|
@@ -2401,43 +2405,43 @@ const on = ({
|
|
|
2401
2405
|
} finally {
|
|
2402
2406
|
c(!1);
|
|
2403
2407
|
}
|
|
2404
|
-
}, [t, b,
|
|
2405
|
-
|
|
2406
|
-
}, [
|
|
2407
|
-
|
|
2408
|
-
}, [
|
|
2409
|
-
o(void 0),
|
|
2410
|
-
}, [
|
|
2411
|
-
return
|
|
2412
|
-
|
|
2408
|
+
}, [t, b, S, r, a]), M = U(() => {
|
|
2409
|
+
E && !a && y(!1);
|
|
2410
|
+
}, [E, a, y]), N = U((w) => {
|
|
2411
|
+
C(w), o(void 0), y(!0, w);
|
|
2412
|
+
}, [y]), v = U(() => {
|
|
2413
|
+
o(void 0), y(!0);
|
|
2414
|
+
}, [y]);
|
|
2415
|
+
return X(() => {
|
|
2416
|
+
y(!0);
|
|
2413
2417
|
}, [t.loadParticipants]), {
|
|
2414
2418
|
participants: l,
|
|
2415
2419
|
loading: a,
|
|
2416
2420
|
error: g,
|
|
2417
2421
|
searchQuery: b,
|
|
2418
|
-
hasMore:
|
|
2422
|
+
hasMore: E,
|
|
2419
2423
|
totalCount: t.totalCount,
|
|
2420
|
-
loadMore:
|
|
2421
|
-
search:
|
|
2422
|
-
refresh:
|
|
2424
|
+
loadMore: M,
|
|
2425
|
+
search: N,
|
|
2426
|
+
refresh: v
|
|
2423
2427
|
};
|
|
2424
2428
|
};
|
|
2425
2429
|
export {
|
|
2426
2430
|
we as ActionButton,
|
|
2427
|
-
|
|
2428
|
-
|
|
2429
|
-
|
|
2430
|
-
|
|
2431
|
-
|
|
2432
|
-
|
|
2433
|
-
|
|
2434
|
-
|
|
2435
|
-
|
|
2436
|
-
|
|
2437
|
-
|
|
2438
|
-
|
|
2439
|
-
|
|
2440
|
-
|
|
2441
|
-
|
|
2431
|
+
le as Avatar,
|
|
2432
|
+
Ys as ChannelEmptyState,
|
|
2433
|
+
rt as ChannelList,
|
|
2434
|
+
it as ChannelView,
|
|
2435
|
+
dn as FaqList,
|
|
2436
|
+
Qs as FaqListItem,
|
|
2437
|
+
Es as LockedAttachment,
|
|
2438
|
+
Ms as MessageVoteButtons,
|
|
2439
|
+
ln as MessagingProvider,
|
|
2440
|
+
cn as MessagingShell,
|
|
2441
|
+
Xs as ParticipantPicker,
|
|
2442
|
+
ds as formatRelativeTime,
|
|
2443
|
+
vs as useMessageVote,
|
|
2444
|
+
os as useMessaging,
|
|
2445
|
+
mn as useParticipants
|
|
2442
2446
|
};
|
|
2443
2447
|
//# sourceMappingURL=index.js.map
|