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