@linktr.ee/messaging-react 1.35.0 → 1.36.0-rc-1777522205
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/{Card-DVzWMbDc.js → Card-BHrnmHeu.js} +2 -2
- package/dist/{Card-DVzWMbDc.js.map → Card-BHrnmHeu.js.map} +1 -1
- package/dist/{Card-lN2Z0Z5p.js → Card-D4vEgqWt.js} +2 -2
- package/dist/{Card-lN2Z0Z5p.js.map → Card-D4vEgqWt.js.map} +1 -1
- package/dist/{index-BsSqs61X.js → index-DOsC03ZN.js} +1266 -1240
- package/dist/index-DOsC03ZN.js.map +1 -0
- package/dist/index.d.ts +4 -2
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/src/components/Avatar/Avatar.stories.tsx +2 -2
- package/src/components/Avatar/index.tsx +13 -8
- package/src/components/ChannelView.stories.tsx +31 -2
- package/src/components/ChannelView.test.tsx +75 -4
- package/src/components/ChannelView.tsx +39 -0
- package/src/types.ts +2 -0
- package/dist/index-BsSqs61X.js.map +0 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { jsx as e, jsxs as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import { StreamChatService as
|
|
5
|
-
import { Chat as
|
|
6
|
-
import { StarIcon as je, GiftIcon as
|
|
7
|
-
import { LinkPreviewsManager as
|
|
8
|
-
const
|
|
1
|
+
import { jsx as e, jsxs as o, Fragment as se } from "react/jsx-runtime";
|
|
2
|
+
import $ from "classnames";
|
|
3
|
+
import j, { createContext as dt, useContext as ut, useCallback as O, useState as T, useRef as J, useEffect as Z, useMemo as Be, Suspense as mt } from "react";
|
|
4
|
+
import { StreamChatService as Pt } from "@linktr.ee/messaging-core";
|
|
5
|
+
import { Chat as Lt, ChannelList as Ft, DateSeparator as At, useChannelStateContext as me, useChatContext as We, areMessageUIPropsEqual as Ot, useMessageReminder as Ut, useComponentContext as ht, Attachment as $t, EditMessageModal as zt, MessageBlocked as Bt, MessageBouncePrompt as jt, MessageDeleted as Gt, MessageIsThreadReplyInChannelButtonIndicator as Ht, MessageRepliesCountButton as Vt, ReminderNotification as Yt, StreamedMessageText as Wt, messageHasAttachments as qt, messageHasReactions as Xt, isDateSeparatorMessage as Zt, isMessageBlocked as Kt, isMessageBounced as Jt, MessageBounceModal as Qt, MessageText as Je, Poll as es, MessageErrorIcon as ts, useMessageContext as ft, useMessageComposer as ss, useStateStore as ns, MessageInput as as, useMessageInputContext as rs, useMessageComposerHasSendableData as is, SimpleAttachmentSelector as ls, QuotedMessagePreview as os, AttachmentPreviewList as cs, TextareaComposer as ds, MessageTimestamp as Oe, useTypingContext as us, Channel as ms, WithComponents as hs, Window as fs, MessageList as gs } from "stream-chat-react";
|
|
6
|
+
import { StarIcon as je, GiftIcon as bs, XIcon as Re, SpinnerGapIcon as ke, SignOutIcon as xs, ProhibitInsetIcon as Qe, FlagIcon as ps, ArrowUpIcon as vs, SparkleIcon as Ge, ProhibitIcon as ws, ArrowLeftIcon as et, CaretRightIcon as tt, DotsThreeIcon as st, MagnifyingGlassIcon as Ns, ChatCircleDotsIcon as nt, FileIcon as gt, ImageIcon as ys, SpeakerHighIcon as Cs, VideoCameraIcon as _s, FileMdIcon as Es, FileTextIcon as Is, FileZipIcon as Ss, FilePptIcon as ks, FileCsvIcon as Ts, FileXlsIcon as Ms, FileDocIcon as Ds, FilePdfIcon as Rs, CircleNotchIcon as bt, PlayIcon as at, PauseIcon as Ps, LinkIcon as Ls, DownloadSimpleIcon as Fs } from "@phosphor-icons/react";
|
|
7
|
+
import { LinkPreviewsManager as rt } from "stream-chat";
|
|
8
|
+
const xt = dt({
|
|
9
9
|
service: null,
|
|
10
10
|
client: null,
|
|
11
11
|
isConnected: !1,
|
|
@@ -15,264 +15,264 @@ const gt = ot({
|
|
|
15
15
|
refreshConnection: async () => {
|
|
16
16
|
},
|
|
17
17
|
debug: !1
|
|
18
|
-
}), Pe = () =>
|
|
18
|
+
}), Pe = () => ut(xt), ia = ({
|
|
19
19
|
children: t,
|
|
20
20
|
user: s,
|
|
21
21
|
serviceConfig: n,
|
|
22
|
-
apiKey:
|
|
22
|
+
apiKey: r,
|
|
23
23
|
capabilities: l = {},
|
|
24
24
|
debug: u = !1
|
|
25
25
|
}) => {
|
|
26
|
-
const
|
|
27
|
-
(
|
|
28
|
-
u && console.log(`🔥 [MessagingProvider] ${
|
|
26
|
+
const i = O(
|
|
27
|
+
(g, ...x) => {
|
|
28
|
+
u && console.log(`🔥 [MessagingProvider] ${g}`, ...x);
|
|
29
29
|
},
|
|
30
30
|
[u]
|
|
31
31
|
);
|
|
32
|
-
|
|
32
|
+
i("🔄 RENDER START", {
|
|
33
33
|
userId: s == null ? void 0 : s.id,
|
|
34
|
-
apiKey: (
|
|
34
|
+
apiKey: (r == null ? void 0 : r.substring(0, 8)) + "...",
|
|
35
35
|
serviceConfig: !!n,
|
|
36
36
|
capabilities: Object.keys(l)
|
|
37
37
|
});
|
|
38
|
-
const [
|
|
38
|
+
const [c, f] = T(null), [d, m] = T(null), [h, C] = T(!1), [a, E] = T(!1), [y, w] = T(null), b = J(!1), S = J({
|
|
39
39
|
userId: s == null ? void 0 : s.id,
|
|
40
|
-
apiKey:
|
|
40
|
+
apiKey: r,
|
|
41
41
|
serviceConfig: n,
|
|
42
42
|
capabilities: l
|
|
43
|
-
}),
|
|
44
|
-
|
|
45
|
-
renderCount:
|
|
46
|
-
currentProps: { userId: s == null ? void 0 : s.id, apiKey: (
|
|
43
|
+
}), v = J(0);
|
|
44
|
+
v.current++, i("📊 RENDER INFO", {
|
|
45
|
+
renderCount: v.current,
|
|
46
|
+
currentProps: { userId: s == null ? void 0 : s.id, apiKey: (r == null ? void 0 : r.substring(0, 8)) + "..." },
|
|
47
47
|
propChanges: {
|
|
48
|
-
userChanged:
|
|
49
|
-
apiKeyChanged:
|
|
50
|
-
serviceConfigChanged:
|
|
51
|
-
capabilitiesChanged:
|
|
48
|
+
userChanged: S.current.userId !== (s == null ? void 0 : s.id),
|
|
49
|
+
apiKeyChanged: S.current.apiKey !== r,
|
|
50
|
+
serviceConfigChanged: S.current.serviceConfig !== n,
|
|
51
|
+
capabilitiesChanged: S.current.capabilities !== l
|
|
52
52
|
}
|
|
53
|
-
}),
|
|
53
|
+
}), S.current = {
|
|
54
54
|
userId: s == null ? void 0 : s.id,
|
|
55
|
-
apiKey:
|
|
55
|
+
apiKey: r,
|
|
56
56
|
serviceConfig: n,
|
|
57
57
|
capabilities: l
|
|
58
|
-
},
|
|
59
|
-
const
|
|
60
|
-
if (
|
|
61
|
-
renderCount:
|
|
62
|
-
apiKey: !!
|
|
58
|
+
}, Z(() => {
|
|
59
|
+
const g = v.current;
|
|
60
|
+
if (i("🔧 SERVICE INIT EFFECT TRIGGERED", {
|
|
61
|
+
renderCount: g,
|
|
62
|
+
apiKey: !!r,
|
|
63
63
|
serviceConfig: !!n,
|
|
64
64
|
dependencies: {
|
|
65
|
-
apiKey: (
|
|
65
|
+
apiKey: (r == null ? void 0 : r.substring(0, 8)) + "...",
|
|
66
66
|
serviceConfigRef: n,
|
|
67
|
-
serviceConfigStable:
|
|
68
|
-
apiKeyStable:
|
|
67
|
+
serviceConfigStable: S.current.serviceConfig === n,
|
|
68
|
+
apiKeyStable: S.current.apiKey === r
|
|
69
69
|
}
|
|
70
|
-
}), !
|
|
71
|
-
|
|
72
|
-
renderCount:
|
|
70
|
+
}), !r || !n) {
|
|
71
|
+
i("⚠️ SERVICE INIT SKIPPED", {
|
|
72
|
+
renderCount: g,
|
|
73
73
|
reason: "Missing apiKey or serviceConfig"
|
|
74
74
|
});
|
|
75
75
|
return;
|
|
76
76
|
}
|
|
77
|
-
|
|
78
|
-
renderCount:
|
|
79
|
-
apiKey: (
|
|
80
|
-
serviceConfigChanged:
|
|
77
|
+
i("🚀 CREATING NEW SERVICE", {
|
|
78
|
+
renderCount: g,
|
|
79
|
+
apiKey: (r == null ? void 0 : r.substring(0, 8)) + "...",
|
|
80
|
+
serviceConfigChanged: S.current.serviceConfig !== n
|
|
81
81
|
});
|
|
82
|
-
const
|
|
82
|
+
const x = new Pt({
|
|
83
83
|
...n,
|
|
84
|
-
apiKey:
|
|
84
|
+
apiKey: r,
|
|
85
85
|
debug: u
|
|
86
86
|
});
|
|
87
|
-
return x
|
|
88
|
-
renderCount:
|
|
89
|
-
serviceInstance: !!
|
|
87
|
+
return f(x), i("✅ SERVICE SET", {
|
|
88
|
+
renderCount: g,
|
|
89
|
+
serviceInstance: !!x
|
|
90
90
|
}), () => {
|
|
91
|
-
|
|
92
|
-
renderCount:
|
|
91
|
+
i("🧹 SERVICE CLEANUP", {
|
|
92
|
+
renderCount: g,
|
|
93
93
|
reason: "Effect cleanup"
|
|
94
|
-
}),
|
|
94
|
+
}), x.disconnectUser().catch(console.error);
|
|
95
95
|
};
|
|
96
|
-
}, [
|
|
97
|
-
const
|
|
98
|
-
|
|
99
|
-
var
|
|
100
|
-
if (
|
|
101
|
-
hasService: !!
|
|
96
|
+
}, [r, n, u, i]);
|
|
97
|
+
const _ = J(null);
|
|
98
|
+
Z(() => {
|
|
99
|
+
var x, R;
|
|
100
|
+
if (i("🔗 USER CONNECTION EFFECT TRIGGERED", {
|
|
101
|
+
hasService: !!c,
|
|
102
102
|
hasUser: !!s,
|
|
103
103
|
userId: s == null ? void 0 : s.id,
|
|
104
|
-
isConnecting:
|
|
105
|
-
isConnected:
|
|
106
|
-
dependencies: { service: !!
|
|
107
|
-
}), !
|
|
108
|
-
|
|
104
|
+
isConnecting: b.current,
|
|
105
|
+
isConnected: h,
|
|
106
|
+
dependencies: { service: !!c, userId: s == null ? void 0 : s.id }
|
|
107
|
+
}), !c || !s) {
|
|
108
|
+
i("⚠️ USER CONNECTION SKIPPED", "Missing service or user");
|
|
109
109
|
return;
|
|
110
110
|
}
|
|
111
|
-
if (
|
|
112
|
-
|
|
111
|
+
if (b.current) {
|
|
112
|
+
i("⚠️ USER CONNECTION SKIPPED", "Already connecting");
|
|
113
113
|
return;
|
|
114
114
|
}
|
|
115
|
-
if (((
|
|
116
|
-
|
|
115
|
+
if (((x = _.current) == null ? void 0 : x.serviceId) === c && ((R = _.current) == null ? void 0 : R.userId) === s.id) {
|
|
116
|
+
i(
|
|
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
|
+
i("🚀 STARTING USER CONNECTION", { userId: s.id }), b.current = !0, E(!0), w(null);
|
|
124
124
|
try {
|
|
125
|
-
|
|
126
|
-
const
|
|
127
|
-
|
|
125
|
+
i("📞 CALLING SERVICE.CONNECTUSER", { userId: s.id });
|
|
126
|
+
const k = await c.connectUser(s);
|
|
127
|
+
m(k), C(!0), _.current = { serviceId: c, userId: s.id }, i("✅ USER CONNECTION SUCCESS", {
|
|
128
128
|
userId: s.id,
|
|
129
|
-
clientId:
|
|
129
|
+
clientId: k.userID
|
|
130
130
|
});
|
|
131
|
-
} catch (
|
|
132
|
-
const P =
|
|
133
|
-
|
|
131
|
+
} catch (k) {
|
|
132
|
+
const P = k instanceof Error ? k.message : "Connection failed";
|
|
133
|
+
w(P), i("❌ USER CONNECTION ERROR", {
|
|
134
134
|
userId: s.id,
|
|
135
135
|
error: P
|
|
136
136
|
});
|
|
137
137
|
} finally {
|
|
138
|
-
|
|
138
|
+
E(!1), b.current = !1, i("🔄 USER CONNECTION FINISHED", {
|
|
139
139
|
userId: s.id,
|
|
140
|
-
isConnected:
|
|
140
|
+
isConnected: h
|
|
141
141
|
});
|
|
142
142
|
}
|
|
143
143
|
})();
|
|
144
|
-
}, [
|
|
145
|
-
hasService: !!
|
|
146
|
-
isConnected:
|
|
144
|
+
}, [c, s, i, h]), Z(() => (i("🔌 CLEANUP EFFECT REGISTERED", {
|
|
145
|
+
hasService: !!c,
|
|
146
|
+
isConnected: h
|
|
147
147
|
}), () => {
|
|
148
|
-
|
|
148
|
+
c && h ? (i(
|
|
149
149
|
"🧹 CLEANUP EFFECT TRIGGERED",
|
|
150
150
|
"Cleaning up connection on unmount"
|
|
151
|
-
),
|
|
152
|
-
hasService: !!
|
|
153
|
-
isConnected:
|
|
151
|
+
), _.current = null, c.disconnectUser().catch(console.error)) : i("🔇 CLEANUP EFFECT SKIPPED", {
|
|
152
|
+
hasService: !!c,
|
|
153
|
+
isConnected: h
|
|
154
154
|
});
|
|
155
|
-
}), [
|
|
156
|
-
const L =
|
|
157
|
-
if (
|
|
158
|
-
hasService: !!
|
|
155
|
+
}), [c, h, i]);
|
|
156
|
+
const L = O(async () => {
|
|
157
|
+
if (i("🔄 REFRESH CONNECTION CALLED", {
|
|
158
|
+
hasService: !!c,
|
|
159
159
|
hasUser: !!s
|
|
160
|
-
}), !
|
|
161
|
-
|
|
160
|
+
}), !c || !s) {
|
|
161
|
+
i("⚠️ REFRESH CONNECTION SKIPPED", "Missing service or user");
|
|
162
162
|
return;
|
|
163
163
|
}
|
|
164
|
-
|
|
164
|
+
i("🚀 STARTING CONNECTION REFRESH", { userId: s.id }), E(!0);
|
|
165
165
|
try {
|
|
166
|
-
|
|
167
|
-
const
|
|
168
|
-
|
|
169
|
-
} catch (
|
|
170
|
-
const
|
|
171
|
-
|
|
166
|
+
i("🔌 DISCONNECTING FOR REFRESH"), await c.disconnectUser(), i("📞 RECONNECTING FOR REFRESH");
|
|
167
|
+
const g = await c.connectUser(s);
|
|
168
|
+
m(g), C(!0), w(null), i("✅ CONNECTION REFRESH SUCCESS", { userId: s.id });
|
|
169
|
+
} catch (g) {
|
|
170
|
+
const x = g instanceof Error ? g.message : "Refresh failed";
|
|
171
|
+
w(x), i("❌ CONNECTION REFRESH ERROR", {
|
|
172
172
|
userId: s.id,
|
|
173
|
-
error:
|
|
173
|
+
error: x
|
|
174
174
|
});
|
|
175
175
|
} finally {
|
|
176
|
-
|
|
176
|
+
E(!1), i("🔄 CONNECTION REFRESH FINISHED", { userId: s.id });
|
|
177
177
|
}
|
|
178
|
-
}, [
|
|
179
|
-
hasService: !!
|
|
180
|
-
hasClient: !!
|
|
181
|
-
isConnected:
|
|
178
|
+
}, [c, s, i]), N = j.useMemo(() => (i("💫 CONTEXT VALUE MEMOIZATION", {
|
|
179
|
+
hasService: !!c,
|
|
180
|
+
hasClient: !!d,
|
|
181
|
+
isConnected: h,
|
|
182
182
|
isLoading: a,
|
|
183
|
-
hasError: !!
|
|
183
|
+
hasError: !!y,
|
|
184
184
|
capabilitiesKeys: Object.keys(l)
|
|
185
185
|
}), {
|
|
186
|
-
service:
|
|
187
|
-
client:
|
|
188
|
-
isConnected:
|
|
186
|
+
service: c,
|
|
187
|
+
client: d,
|
|
188
|
+
isConnected: h,
|
|
189
189
|
isLoading: a,
|
|
190
|
-
error:
|
|
190
|
+
error: y,
|
|
191
191
|
capabilities: l,
|
|
192
192
|
refreshConnection: L,
|
|
193
193
|
debug: u
|
|
194
194
|
}), [
|
|
195
|
+
c,
|
|
195
196
|
d,
|
|
196
|
-
|
|
197
|
-
f,
|
|
197
|
+
h,
|
|
198
198
|
a,
|
|
199
|
-
|
|
199
|
+
y,
|
|
200
200
|
l,
|
|
201
201
|
L,
|
|
202
202
|
u,
|
|
203
|
-
|
|
203
|
+
i
|
|
204
204
|
]);
|
|
205
|
-
return
|
|
206
|
-
renderCount:
|
|
207
|
-
willRenderChat: !!(
|
|
208
|
-
contextValueReady: !!
|
|
209
|
-
}), /* @__PURE__ */ e(
|
|
210
|
-
|
|
205
|
+
return i("🔄 RENDER END", {
|
|
206
|
+
renderCount: v.current,
|
|
207
|
+
willRenderChat: !!(d && h),
|
|
208
|
+
contextValueReady: !!N
|
|
209
|
+
}), /* @__PURE__ */ e(xt.Provider, { value: N, children: d && h ? /* @__PURE__ */ e(
|
|
210
|
+
Lt,
|
|
211
211
|
{
|
|
212
|
-
client:
|
|
212
|
+
client: d,
|
|
213
213
|
customClasses: {
|
|
214
214
|
channelList: "str-chat__channel-list str-chat__channel-list-react bg-transparent lg:border-r-2 border-r-0 border-[#0000000A]"
|
|
215
215
|
},
|
|
216
216
|
children: t
|
|
217
217
|
}
|
|
218
218
|
) : t });
|
|
219
|
-
},
|
|
220
|
-
function
|
|
219
|
+
}, As = () => Pe();
|
|
220
|
+
function Os(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 pt = j.createContext({
|
|
227
227
|
selectedChannel: void 0,
|
|
228
228
|
onChannelSelect: () => {
|
|
229
229
|
},
|
|
230
230
|
debug: !1,
|
|
231
231
|
renderMessagePreview: void 0
|
|
232
|
-
}),
|
|
233
|
-
var
|
|
234
|
-
const [s, n] =
|
|
235
|
-
!!((l = (
|
|
232
|
+
}), Us = pt.Provider, $s = () => j.useContext(pt), vt = (t) => {
|
|
233
|
+
var r, l;
|
|
234
|
+
const [s, n] = T(
|
|
235
|
+
!!((l = (r = t == null ? void 0 : t.state) == null ? void 0 : r.membership) != null && l.pinned_at)
|
|
236
236
|
);
|
|
237
|
-
return
|
|
238
|
-
var
|
|
237
|
+
return Z(() => {
|
|
238
|
+
var i;
|
|
239
239
|
if (!t) {
|
|
240
240
|
n(!1);
|
|
241
241
|
return;
|
|
242
242
|
}
|
|
243
|
-
n(!!((
|
|
244
|
-
const u = (
|
|
245
|
-
var
|
|
243
|
+
n(!!((i = t.state.membership) != null && i.pinned_at));
|
|
244
|
+
const u = (c) => {
|
|
245
|
+
var f;
|
|
246
246
|
n(
|
|
247
|
-
|
|
247
|
+
c != null && c.member ? !!c.member.pinned_at : !!((f = t.state.membership) != null && f.pinned_at)
|
|
248
248
|
);
|
|
249
249
|
};
|
|
250
250
|
return t.on("member.updated", u), () => {
|
|
251
251
|
t.off("member.updated", u);
|
|
252
252
|
};
|
|
253
253
|
}, [t]), s;
|
|
254
|
-
},
|
|
254
|
+
}, zs = (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
|
+
}, Bs = (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
|
|
266
|
-
return
|
|
265
|
+
const r = zs(t, s);
|
|
266
|
+
return r === 0 ? t.toLocaleTimeString([], {
|
|
267
267
|
hour: "numeric",
|
|
268
268
|
minute: "2-digit",
|
|
269
269
|
hour12: !0
|
|
270
|
-
}) :
|
|
270
|
+
}) : r === 1 ? "Yesterday" : r < 7 ? `${r}d` : r < 28 ? `${Math.floor(r / 7)}w` : t.toLocaleDateString("en-US", {
|
|
271
271
|
month: "numeric",
|
|
272
272
|
day: "numeric",
|
|
273
273
|
year: "2-digit"
|
|
274
274
|
});
|
|
275
|
-
},
|
|
275
|
+
}, it = [
|
|
276
276
|
"🍎",
|
|
277
277
|
// Apple
|
|
278
278
|
"🍌",
|
|
@@ -300,31 +300,31 @@ const bt = z.createContext({
|
|
|
300
300
|
"🍈"
|
|
301
301
|
// Melon
|
|
302
302
|
];
|
|
303
|
-
function
|
|
303
|
+
function js(t) {
|
|
304
304
|
let s = 0;
|
|
305
305
|
for (let n = 0; n < t.length; n++) {
|
|
306
|
-
const
|
|
307
|
-
s = (s << 5) - s +
|
|
306
|
+
const r = t.charCodeAt(n);
|
|
307
|
+
s = (s << 5) - s + r, s = s & s;
|
|
308
308
|
}
|
|
309
309
|
return Math.abs(s);
|
|
310
310
|
}
|
|
311
|
-
function
|
|
312
|
-
const n =
|
|
313
|
-
return
|
|
311
|
+
function Gs(t) {
|
|
312
|
+
const n = js(t) % it.length;
|
|
313
|
+
return it[n];
|
|
314
314
|
}
|
|
315
315
|
const ae = ({
|
|
316
316
|
id: t,
|
|
317
317
|
image: s,
|
|
318
318
|
size: n = 40,
|
|
319
|
-
className:
|
|
319
|
+
className: r,
|
|
320
320
|
starred: l = !1,
|
|
321
321
|
shape: u = "squircle",
|
|
322
|
-
|
|
322
|
+
dmAgentEnabled: i = !1
|
|
323
323
|
}) => {
|
|
324
|
-
const
|
|
324
|
+
const c = Gs(t), d = n < 32 ? "text-xs" : n < 56 ? "text-sm" : n < 120 ? "text-lg" : "text-4xl", m = n >= 40 ? 2 : 1, h = u === "circle" ? { borderRadius: "50%" } : {
|
|
325
325
|
borderRadius: "33%",
|
|
326
|
-
|
|
327
|
-
},
|
|
326
|
+
cornerShape: "superellipse(1.3)"
|
|
327
|
+
}, C = /* @__PURE__ */ e("div", { className: "h-full w-full overflow-hidden", style: h, children: s ? /* @__PURE__ */ e(
|
|
328
328
|
"img",
|
|
329
329
|
{
|
|
330
330
|
src: s,
|
|
@@ -335,19 +335,19 @@ const ae = ({
|
|
|
335
335
|
"div",
|
|
336
336
|
{
|
|
337
337
|
"aria-hidden": "true",
|
|
338
|
-
className:
|
|
338
|
+
className: $(
|
|
339
339
|
"avatar-fallback flex h-full w-full items-center justify-center bg-[#E6E5E3] font-semibold select-none transition-colors",
|
|
340
|
-
|
|
340
|
+
d
|
|
341
341
|
),
|
|
342
|
-
children:
|
|
342
|
+
children: c
|
|
343
343
|
}
|
|
344
344
|
) });
|
|
345
|
-
return /* @__PURE__ */
|
|
345
|
+
return /* @__PURE__ */ o(
|
|
346
346
|
"div",
|
|
347
347
|
{
|
|
348
|
-
className:
|
|
348
|
+
className: $(
|
|
349
349
|
"relative flex-shrink-0 !bg-transparent",
|
|
350
|
-
|
|
350
|
+
r
|
|
351
351
|
),
|
|
352
352
|
style: {
|
|
353
353
|
width: `${n}px`,
|
|
@@ -365,21 +365,27 @@ const ae = ({
|
|
|
365
365
|
/* @__PURE__ */ e(
|
|
366
366
|
"div",
|
|
367
367
|
{
|
|
368
|
-
|
|
368
|
+
"data-testid": "avatar-ring",
|
|
369
|
+
className: $(
|
|
369
370
|
"h-full w-full",
|
|
370
|
-
|
|
371
|
+
"bg-transparent"
|
|
371
372
|
),
|
|
372
373
|
style: {
|
|
373
|
-
...
|
|
374
|
-
...
|
|
374
|
+
...h,
|
|
375
|
+
...i && {
|
|
376
|
+
borderWidth: `${m}px`,
|
|
377
|
+
borderStyle: "solid",
|
|
378
|
+
borderColor: "var(--AI-Gradient, #7F22FE)",
|
|
379
|
+
boxShadow: "inset 0 1px 2px 0 rgba(255, 255, 255, 0.5)"
|
|
380
|
+
}
|
|
375
381
|
},
|
|
376
|
-
children:
|
|
382
|
+
children: C
|
|
377
383
|
}
|
|
378
384
|
)
|
|
379
385
|
]
|
|
380
386
|
}
|
|
381
387
|
);
|
|
382
|
-
},
|
|
388
|
+
}, Hs = ({ size: t = 15 }) => /* @__PURE__ */ e(
|
|
383
389
|
"svg",
|
|
384
390
|
{
|
|
385
391
|
width: t,
|
|
@@ -399,128 +405,128 @@ const ae = ({
|
|
|
399
405
|
), Vs = (t) => {
|
|
400
406
|
var s;
|
|
401
407
|
return ((s = t.metadata) == null ? void 0 : s.custom_type) === "MESSAGE_TIP";
|
|
402
|
-
},
|
|
408
|
+
}, Ys = (t) => {
|
|
403
409
|
var s;
|
|
404
410
|
return ((s = t.metadata) == null ? void 0 : s.custom_type) === "MESSAGE_PAID";
|
|
405
|
-
},
|
|
411
|
+
}, qe = (t) => {
|
|
406
412
|
var s;
|
|
407
413
|
return ((s = t.metadata) == null ? void 0 : s.custom_type) === "MESSAGE_CHATBOT";
|
|
408
|
-
},
|
|
414
|
+
}, Ws = (t) => {
|
|
409
415
|
var s;
|
|
410
416
|
return ((s = t.metadata) == null ? void 0 : s.custom_type) === "MESSAGE_ATTACHMENT";
|
|
411
|
-
},
|
|
417
|
+
}, wt = (t) => Vs(t) || Ys(t), qs = (t) => {
|
|
412
418
|
var s;
|
|
413
|
-
return
|
|
419
|
+
return wt(t) && !((s = t.text) != null && s.trim());
|
|
414
420
|
}, Ue = ({
|
|
415
421
|
message: t,
|
|
416
422
|
standalone: s = !1,
|
|
417
423
|
isMyMessage: n = !1,
|
|
418
|
-
hasAttachment:
|
|
424
|
+
hasAttachment: r = !1
|
|
419
425
|
}) => {
|
|
420
|
-
var
|
|
421
|
-
const l =
|
|
426
|
+
var h;
|
|
427
|
+
const l = wt(t), u = qe(t);
|
|
422
428
|
if (!l && !u)
|
|
423
429
|
return null;
|
|
424
430
|
if (l) {
|
|
425
|
-
const
|
|
426
|
-
if (!
|
|
427
|
-
const a = s ? "message-tip-standalone" : "message-tag message-tag--tip",
|
|
428
|
-
return /* @__PURE__ */
|
|
429
|
-
/* @__PURE__ */ e(
|
|
430
|
-
/* @__PURE__ */ e("span", { children:
|
|
431
|
+
const C = (h = t.metadata) == null ? void 0 : h.amount_text;
|
|
432
|
+
if (!C) return null;
|
|
433
|
+
const a = s ? "message-tip-standalone" : "message-tag message-tag--tip", E = s ? `${C} tip` : `Delivered with ${C} tip`;
|
|
434
|
+
return /* @__PURE__ */ o("div", { className: a, children: [
|
|
435
|
+
/* @__PURE__ */ e(bs, { size: s ? 14 : 12 }),
|
|
436
|
+
/* @__PURE__ */ e("span", { children: E })
|
|
431
437
|
] });
|
|
432
438
|
}
|
|
433
|
-
const
|
|
439
|
+
const i = n && r, c = i ? "Sent with AI" : "Sent with DM Agent", f = [
|
|
434
440
|
"message-chatbot-indicator",
|
|
435
441
|
n ? "message-chatbot-indicator--sender" : "message-chatbot-indicator--receiver",
|
|
436
|
-
|
|
437
|
-
].join(" "),
|
|
438
|
-
return /* @__PURE__ */ e("div", { className:
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
] }) : /* @__PURE__ */
|
|
442
|
-
|
|
443
|
-
|
|
442
|
+
i ? "message-chatbot-indicator--attachment" : "message-chatbot-indicator--text"
|
|
443
|
+
].join(" "), d = /* @__PURE__ */ e("span", { className: "message-chatbot-indicator__label", children: c }), m = /* @__PURE__ */ e("span", { className: "message-chatbot-indicator__icon", children: /* @__PURE__ */ e(Hs, { size: i ? 12 : 15 }) });
|
|
444
|
+
return /* @__PURE__ */ e("div", { className: f, "data-testid": "message-chatbot-indicator", children: n && !i ? /* @__PURE__ */ o(se, { children: [
|
|
445
|
+
d,
|
|
446
|
+
m
|
|
447
|
+
] }) : /* @__PURE__ */ o(se, { children: [
|
|
448
|
+
m,
|
|
449
|
+
d
|
|
444
450
|
] }) });
|
|
445
|
-
},
|
|
451
|
+
}, Nt = j.memo(
|
|
446
452
|
({ channel: t, unread: s }) => {
|
|
447
|
-
var L,
|
|
448
|
-
const { selectedChannel: n, onChannelSelect:
|
|
449
|
-
t &&
|
|
450
|
-
},
|
|
451
|
-
const
|
|
452
|
-
!
|
|
453
|
-
},
|
|
454
|
-
(
|
|
455
|
-
var
|
|
456
|
-
return ((
|
|
453
|
+
var L, N, g, x;
|
|
454
|
+
const { selectedChannel: n, onChannelSelect: r, debug: l, renderMessagePreview: u } = $s(), i = (n == null ? void 0 : n.id) === (t == null ? void 0 : t.id), c = () => {
|
|
455
|
+
t && r(t);
|
|
456
|
+
}, f = (R) => {
|
|
457
|
+
const k = R.key === "Enter" || R.key === " ", P = R.repeat;
|
|
458
|
+
!k || P || (R.preventDefault(), c());
|
|
459
|
+
}, m = Object.values(((L = t == null ? void 0 : t.state) == null ? void 0 : L.members) || {}).find(
|
|
460
|
+
(R) => {
|
|
461
|
+
var k, P;
|
|
462
|
+
return ((k = R.user) == null ? void 0 : k.id) && R.user.id !== ((P = t == null ? void 0 : t._client) == null ? void 0 : P.userID);
|
|
457
463
|
}
|
|
458
|
-
),
|
|
459
|
-
var
|
|
460
|
-
const
|
|
461
|
-
if (
|
|
462
|
-
for (let P =
|
|
463
|
-
if (
|
|
464
|
+
), h = ((N = m == null ? void 0 : m.user) == null ? void 0 : N.name) || "Conversation", C = (g = m == null ? void 0 : m.user) == null ? void 0 : g.image, a = (() => {
|
|
465
|
+
var k;
|
|
466
|
+
const R = (k = t == null ? void 0 : t.state) == null ? void 0 : k.messages;
|
|
467
|
+
if (R != null && R.length) {
|
|
468
|
+
for (let P = R.length - 1; P >= 0; P--)
|
|
469
|
+
if (R[P].type !== "system") return R[P];
|
|
464
470
|
}
|
|
465
|
-
})(),
|
|
466
|
-
var P,
|
|
471
|
+
})(), y = (() => {
|
|
472
|
+
var P, M;
|
|
467
473
|
if (a != null && a.text) return a.text;
|
|
468
474
|
if (((P = a == null ? void 0 : a.metadata) == null ? void 0 : P.custom_type) === "MESSAGE_TIP") return "💵 Sent a tip";
|
|
469
|
-
const
|
|
470
|
-
return
|
|
471
|
-
})(),
|
|
475
|
+
const k = (M = a == null ? void 0 : a.attachments) == null ? void 0 : M[0];
|
|
476
|
+
return k ? k.og_scrape_url ? k.og_scrape_url : k.type === "image" ? "📷 Sent an image" : k.type === "video" ? "🎥 Sent a video" : k.type === "audio" ? "🎵 Sent audio" : k.type === "file" ? "📎 Sent a file" : "📎 Sent an attachment" : "No messages yet";
|
|
477
|
+
})(), w = a != null && a.created_at ? Bs(new Date(a.created_at)) : "", b = a ? qe(a) : !1, S = u ? u(a, y) : `${b ? "✨ " : ""}${y}`, v = vt(t), _ = s ?? 0;
|
|
472
478
|
return l && console.log("📺 [ChannelList] 📋 CHANNEL PREVIEW RENDER", {
|
|
473
479
|
channelId: t == null ? void 0 : t.id,
|
|
474
|
-
isSelected:
|
|
475
|
-
participantName:
|
|
476
|
-
unreadCount:
|
|
477
|
-
hasTimestamp: !!
|
|
480
|
+
isSelected: i,
|
|
481
|
+
participantName: h,
|
|
482
|
+
unreadCount: _,
|
|
483
|
+
hasTimestamp: !!w
|
|
478
484
|
}), /* @__PURE__ */ e(
|
|
479
485
|
"div",
|
|
480
486
|
{
|
|
481
487
|
role: "button",
|
|
482
488
|
tabIndex: 0,
|
|
483
|
-
onClick:
|
|
484
|
-
onKeyDown:
|
|
485
|
-
className:
|
|
489
|
+
onClick: c,
|
|
490
|
+
onKeyDown: f,
|
|
491
|
+
className: $(
|
|
486
492
|
"group w-full px-4 py-3 transition-colors text-left max-w-full overflow-hidden focus-ring",
|
|
487
493
|
{
|
|
488
|
-
"bg-primary-alt/10 border-l-4 border-l-primary":
|
|
489
|
-
"hover:bg-sand": !
|
|
494
|
+
"bg-primary-alt/10 border-l-4 border-l-primary": i,
|
|
495
|
+
"hover:bg-sand": !i
|
|
490
496
|
}
|
|
491
497
|
),
|
|
492
|
-
children: /* @__PURE__ */
|
|
498
|
+
children: /* @__PURE__ */ o("div", { className: "flex items-start gap-3", children: [
|
|
493
499
|
/* @__PURE__ */ e(
|
|
494
500
|
ae,
|
|
495
501
|
{
|
|
496
|
-
id: ((
|
|
497
|
-
name:
|
|
498
|
-
image:
|
|
502
|
+
id: ((x = m == null ? void 0 : m.user) == null ? void 0 : x.id) || t.id || "unknown",
|
|
503
|
+
name: h,
|
|
504
|
+
image: C,
|
|
499
505
|
size: 44,
|
|
500
|
-
starred:
|
|
506
|
+
starred: v,
|
|
501
507
|
className: "[&_.avatar-fallback]:group-hover:bg-[#eeeeee]"
|
|
502
508
|
}
|
|
503
509
|
),
|
|
504
|
-
/* @__PURE__ */
|
|
505
|
-
/* @__PURE__ */
|
|
506
|
-
/* @__PURE__ */
|
|
510
|
+
/* @__PURE__ */ o("div", { className: "flex-1 min-w-0 flex flex-col gap-1", children: [
|
|
511
|
+
/* @__PURE__ */ o("div", { className: "flex items-center justify-between gap-2", children: [
|
|
512
|
+
/* @__PURE__ */ o(
|
|
507
513
|
"h3",
|
|
508
514
|
{
|
|
509
|
-
className:
|
|
515
|
+
className: $(
|
|
510
516
|
"text-sm font-medium truncate",
|
|
511
|
-
|
|
517
|
+
i ? "text-primary" : "text-charcoal"
|
|
512
518
|
),
|
|
513
519
|
children: [
|
|
514
|
-
|
|
515
|
-
|
|
520
|
+
v && /* @__PURE__ */ e("span", { className: "sr-only", children: "Starred conversation. " }),
|
|
521
|
+
h
|
|
516
522
|
]
|
|
517
523
|
}
|
|
518
524
|
),
|
|
519
|
-
|
|
525
|
+
w && /* @__PURE__ */ e("span", { className: "text-xs text-stone flex-shrink-0", children: w })
|
|
520
526
|
] }),
|
|
521
|
-
/* @__PURE__ */
|
|
522
|
-
/* @__PURE__ */ e("p", { className: "text-xs text-stone flex-1 line-clamp-1", children:
|
|
523
|
-
|
|
527
|
+
/* @__PURE__ */ o("div", { className: "flex items-center justify-between gap-2 min-w-0", children: [
|
|
528
|
+
/* @__PURE__ */ e("p", { className: "text-xs text-stone flex-1 line-clamp-1", children: S }),
|
|
529
|
+
_ > 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: _ > 99 ? "99+" : _ })
|
|
524
530
|
] })
|
|
525
531
|
] })
|
|
526
532
|
] })
|
|
@@ -528,104 +534,104 @@ const ae = ({
|
|
|
528
534
|
);
|
|
529
535
|
}
|
|
530
536
|
);
|
|
531
|
-
|
|
532
|
-
const
|
|
537
|
+
Nt.displayName = "CustomChannelPreview";
|
|
538
|
+
const Xs = { last_message_at: -1 }, yt = j.memo(
|
|
533
539
|
({
|
|
534
540
|
onChannelSelect: t,
|
|
535
541
|
selectedChannel: s,
|
|
536
542
|
filters: n,
|
|
537
|
-
allowNewMessagesFromUnfilteredChannels:
|
|
543
|
+
allowNewMessagesFromUnfilteredChannels: r = !1,
|
|
538
544
|
onMessageNew: l,
|
|
539
545
|
onAddedToChannel: u,
|
|
540
|
-
channelRenderFilterFn:
|
|
541
|
-
sort:
|
|
542
|
-
className:
|
|
543
|
-
customEmptyStateIndicator:
|
|
544
|
-
renderMessagePreview:
|
|
546
|
+
channelRenderFilterFn: i,
|
|
547
|
+
sort: c = Xs,
|
|
548
|
+
className: f,
|
|
549
|
+
customEmptyStateIndicator: d,
|
|
550
|
+
renderMessagePreview: m
|
|
545
551
|
}) => {
|
|
546
|
-
const
|
|
547
|
-
|
|
548
|
-
const { debug:
|
|
549
|
-
(
|
|
550
|
-
for (const
|
|
551
|
-
|
|
552
|
-
return
|
|
552
|
+
const h = j.useRef(0);
|
|
553
|
+
h.current++;
|
|
554
|
+
const { debug: C = !1 } = Pe(), a = j.useCallback(
|
|
555
|
+
(y) => {
|
|
556
|
+
for (const w of y)
|
|
557
|
+
Os(w);
|
|
558
|
+
return i ? i(y) : y;
|
|
553
559
|
},
|
|
554
|
-
[
|
|
560
|
+
[i]
|
|
555
561
|
);
|
|
556
|
-
|
|
557
|
-
renderCount:
|
|
562
|
+
C && console.log("📺 [ChannelList] 🔄 RENDER START", {
|
|
563
|
+
renderCount: h.current,
|
|
558
564
|
selectedChannelId: s == null ? void 0 : s.id,
|
|
559
565
|
filters: n
|
|
560
566
|
});
|
|
561
|
-
const
|
|
567
|
+
const E = j.useMemo(
|
|
562
568
|
() => ({
|
|
563
569
|
selectedChannel: s,
|
|
564
570
|
onChannelSelect: t,
|
|
565
|
-
debug:
|
|
566
|
-
renderMessagePreview:
|
|
571
|
+
debug: C,
|
|
572
|
+
renderMessagePreview: m
|
|
567
573
|
}),
|
|
568
|
-
[s, t,
|
|
574
|
+
[s, t, C, m]
|
|
569
575
|
);
|
|
570
576
|
return /* @__PURE__ */ e(
|
|
571
577
|
"div",
|
|
572
578
|
{
|
|
573
|
-
className:
|
|
579
|
+
className: $(
|
|
574
580
|
"messaging-channel-list h-full flex flex-col min-w-0 overflow-hidden",
|
|
575
|
-
|
|
581
|
+
f
|
|
576
582
|
),
|
|
577
|
-
children: /* @__PURE__ */ e("div", { className: "flex-1 overflow-hidden min-w-0", children: /* @__PURE__ */ e(
|
|
578
|
-
|
|
583
|
+
children: /* @__PURE__ */ e("div", { className: "flex-1 overflow-hidden min-w-0", children: /* @__PURE__ */ e(Us, { value: E, children: /* @__PURE__ */ e(
|
|
584
|
+
Ft,
|
|
579
585
|
{
|
|
580
586
|
filters: n,
|
|
581
|
-
sort:
|
|
587
|
+
sort: c,
|
|
582
588
|
options: { limit: 30 },
|
|
583
|
-
allowNewMessagesFromUnfilteredChannels:
|
|
589
|
+
allowNewMessagesFromUnfilteredChannels: r,
|
|
584
590
|
onMessageNew: l,
|
|
585
591
|
onAddedToChannel: u,
|
|
586
592
|
channelRenderFilterFn: a,
|
|
587
|
-
Preview:
|
|
588
|
-
EmptyStateIndicator:
|
|
593
|
+
Preview: Nt,
|
|
594
|
+
EmptyStateIndicator: d
|
|
589
595
|
},
|
|
590
|
-
`${JSON.stringify(n)}:${JSON.stringify(
|
|
596
|
+
`${JSON.stringify(n)}:${JSON.stringify(c)}`
|
|
591
597
|
) }) })
|
|
592
598
|
}
|
|
593
599
|
);
|
|
594
600
|
}
|
|
595
601
|
);
|
|
596
|
-
|
|
597
|
-
const
|
|
602
|
+
yt.displayName = "ChannelList";
|
|
603
|
+
const Se = ({
|
|
598
604
|
variant: t = "default",
|
|
599
605
|
className: s,
|
|
600
606
|
children: n,
|
|
601
|
-
...
|
|
607
|
+
...r
|
|
602
608
|
}) => /* @__PURE__ */ e(
|
|
603
609
|
"button",
|
|
604
610
|
{
|
|
605
611
|
type: "button",
|
|
606
|
-
className:
|
|
612
|
+
className: $(
|
|
607
613
|
"flex w-full items-center gap-3 rounded-lg px-4 py-3 text-left text-sm transition-colors focus-ring disabled:cursor-not-allowed disabled:opacity-60",
|
|
608
614
|
t === "danger" ? "text-danger hover:bg-danger/50" : "text-charcoal hover:bg-sand",
|
|
609
615
|
s
|
|
610
616
|
),
|
|
611
|
-
...
|
|
617
|
+
...r,
|
|
612
618
|
children: n
|
|
613
619
|
}
|
|
614
620
|
);
|
|
615
|
-
function
|
|
616
|
-
return /* @__PURE__ */
|
|
621
|
+
function Ct({ label: t, className: s, children: n, ...r }) {
|
|
622
|
+
return /* @__PURE__ */ o(
|
|
617
623
|
"button",
|
|
618
624
|
{
|
|
619
625
|
type: "button",
|
|
620
|
-
className:
|
|
626
|
+
className: $(
|
|
621
627
|
"inline-flex items-center justify-center rounded-full transition-colors focus-ring p-2",
|
|
622
628
|
{
|
|
623
|
-
"cursor-not-allowed opacity-50":
|
|
624
|
-
"hover:bg-sand": !
|
|
629
|
+
"cursor-not-allowed opacity-50": r.disabled,
|
|
630
|
+
"hover:bg-sand": !r.disabled
|
|
625
631
|
},
|
|
626
632
|
s
|
|
627
633
|
),
|
|
628
|
-
...
|
|
634
|
+
...r,
|
|
629
635
|
children: [
|
|
630
636
|
/* @__PURE__ */ e("span", { className: "sr-only", children: t }),
|
|
631
637
|
n
|
|
@@ -633,92 +639,92 @@ function Nt({ label: t, className: s, children: n, ...i }) {
|
|
|
633
639
|
}
|
|
634
640
|
);
|
|
635
641
|
}
|
|
636
|
-
function
|
|
637
|
-
return /* @__PURE__ */ e(
|
|
642
|
+
function _t({ onClick: t }) {
|
|
643
|
+
return /* @__PURE__ */ e(Ct, { label: "Close", onClick: t, className: "p-1", children: /* @__PURE__ */ e(Re, { className: "h-5 w-5 text-stone", weight: "bold" }) });
|
|
638
644
|
}
|
|
639
645
|
const Zs = ({
|
|
640
646
|
dialogRef: t,
|
|
641
647
|
onClose: s,
|
|
642
648
|
participant: n,
|
|
643
|
-
channel:
|
|
649
|
+
channel: r,
|
|
644
650
|
followerStatusLabel: l,
|
|
645
651
|
onLeaveConversation: u,
|
|
646
|
-
onBlockParticipant:
|
|
647
|
-
showDeleteConversation:
|
|
648
|
-
onDeleteConversationClick:
|
|
649
|
-
onBlockParticipantClick:
|
|
650
|
-
onReportParticipantClick:
|
|
651
|
-
customProfileContent:
|
|
652
|
-
customChannelActions:
|
|
652
|
+
onBlockParticipant: i,
|
|
653
|
+
showDeleteConversation: c = !0,
|
|
654
|
+
onDeleteConversationClick: f,
|
|
655
|
+
onBlockParticipantClick: d,
|
|
656
|
+
onReportParticipantClick: m,
|
|
657
|
+
customProfileContent: h,
|
|
658
|
+
customChannelActions: C
|
|
653
659
|
}) => {
|
|
654
|
-
var
|
|
655
|
-
const { service: a, debug:
|
|
656
|
-
var
|
|
657
|
-
if (!(!a || !((
|
|
660
|
+
var U, F, W, K, re, Q, p;
|
|
661
|
+
const { service: a, debug: E } = Pe(), [y, w] = T(!1), [b, S] = T(!1), [v, _] = T(!1), L = O(async () => {
|
|
662
|
+
var I;
|
|
663
|
+
if (!(!a || !((I = n == null ? void 0 : n.user) != null && I.id)))
|
|
658
664
|
try {
|
|
659
|
-
const
|
|
665
|
+
const V = (await a.getBlockedUsers()).some(
|
|
660
666
|
(ee) => {
|
|
661
667
|
var le;
|
|
662
668
|
return ee.blocked_user_id === ((le = n == null ? void 0 : n.user) == null ? void 0 : le.id);
|
|
663
669
|
}
|
|
664
670
|
);
|
|
665
|
-
|
|
666
|
-
} catch (
|
|
671
|
+
w(V);
|
|
672
|
+
} catch (z) {
|
|
667
673
|
console.error(
|
|
668
674
|
"[ChannelInfoDialog] Failed to check blocked status:",
|
|
669
|
-
|
|
675
|
+
z
|
|
670
676
|
);
|
|
671
677
|
}
|
|
672
|
-
}, [a, (
|
|
673
|
-
|
|
678
|
+
}, [a, (U = n == null ? void 0 : n.user) == null ? void 0 : U.id]);
|
|
679
|
+
Z(() => {
|
|
674
680
|
L();
|
|
675
681
|
}, [L]);
|
|
676
|
-
const
|
|
677
|
-
var
|
|
678
|
-
if (!
|
|
679
|
-
|
|
682
|
+
const N = async () => {
|
|
683
|
+
var I;
|
|
684
|
+
if (!b) {
|
|
685
|
+
f == null || f(), E && console.log("[ChannelInfoDialog] Leave conversation", r.cid), S(!0);
|
|
680
686
|
try {
|
|
681
|
-
const
|
|
682
|
-
await
|
|
683
|
-
} catch (
|
|
684
|
-
console.error("[ChannelInfoDialog] Failed to leave conversation",
|
|
687
|
+
const z = ((I = r._client) == null ? void 0 : I.userID) ?? null;
|
|
688
|
+
await r.hide(z, !1), u && await u(r), s();
|
|
689
|
+
} catch (z) {
|
|
690
|
+
console.error("[ChannelInfoDialog] Failed to leave conversation", z);
|
|
685
691
|
} finally {
|
|
686
|
-
|
|
692
|
+
S(!1);
|
|
687
693
|
}
|
|
688
694
|
}
|
|
689
|
-
},
|
|
690
|
-
var
|
|
691
|
-
if (!(
|
|
692
|
-
|
|
695
|
+
}, g = async () => {
|
|
696
|
+
var I, z, V;
|
|
697
|
+
if (!(v || !a)) {
|
|
698
|
+
d == null || d(), E && console.log("[ChannelInfoDialog] Block member", (I = n == null ? void 0 : n.user) == null ? void 0 : I.id), _(!0);
|
|
693
699
|
try {
|
|
694
|
-
await a.blockUser((
|
|
700
|
+
await a.blockUser((z = n == null ? void 0 : n.user) == null ? void 0 : z.id), i && await i((V = n == null ? void 0 : n.user) == null ? void 0 : V.id), s();
|
|
695
701
|
} catch (ee) {
|
|
696
702
|
console.error("[ChannelInfoDialog] Failed to block member", ee);
|
|
697
703
|
} finally {
|
|
698
|
-
|
|
704
|
+
_(!1);
|
|
699
705
|
}
|
|
700
706
|
}
|
|
701
|
-
},
|
|
702
|
-
var
|
|
703
|
-
if (!(
|
|
704
|
-
|
|
707
|
+
}, x = async () => {
|
|
708
|
+
var I, z, V;
|
|
709
|
+
if (!(v || !a)) {
|
|
710
|
+
d == null || d(), E && console.log("[ChannelInfoDialog] Unblock member", (I = n == null ? void 0 : n.user) == null ? void 0 : I.id), _(!0);
|
|
705
711
|
try {
|
|
706
|
-
await a.unBlockUser((
|
|
712
|
+
await a.unBlockUser((z = n == null ? void 0 : n.user) == null ? void 0 : z.id), i && await i((V = n == null ? void 0 : n.user) == null ? void 0 : V.id), s();
|
|
707
713
|
} catch (ee) {
|
|
708
714
|
console.error("[ChannelInfoDialog] Failed to unblock member", ee);
|
|
709
715
|
} finally {
|
|
710
|
-
|
|
716
|
+
_(!1);
|
|
711
717
|
}
|
|
712
718
|
}
|
|
713
|
-
},
|
|
714
|
-
|
|
719
|
+
}, R = () => {
|
|
720
|
+
m == null || m(), s(), window.open(
|
|
715
721
|
"https://linktr.ee/s/about/trust-center/report",
|
|
716
722
|
"_blank",
|
|
717
723
|
"noopener,noreferrer"
|
|
718
724
|
);
|
|
719
725
|
};
|
|
720
726
|
if (!n) return null;
|
|
721
|
-
const
|
|
727
|
+
const k = ((F = n.user) == null ? void 0 : F.name) || ((W = n.user) == null ? void 0 : W.id) || "Unknown member", P = (K = n.user) == null ? void 0 : K.image, M = (re = n.user) == null ? void 0 : re.email, B = (Q = n.user) == null ? void 0 : Q.username, A = M || (B ? `linktr.ee/${B}` : void 0), G = ((p = n.user) == null ? void 0 : p.id) || "unknown";
|
|
722
728
|
return (
|
|
723
729
|
// eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-noninteractive-element-interactions
|
|
724
730
|
/* @__PURE__ */ e(
|
|
@@ -727,36 +733,36 @@ const Zs = ({
|
|
|
727
733
|
ref: t,
|
|
728
734
|
className: "mes-dialog group",
|
|
729
735
|
onClose: s,
|
|
730
|
-
onClick: (
|
|
731
|
-
|
|
736
|
+
onClick: (I) => {
|
|
737
|
+
I.target === t.current && s();
|
|
732
738
|
},
|
|
733
|
-
children: /* @__PURE__ */
|
|
734
|
-
/* @__PURE__ */
|
|
739
|
+
children: /* @__PURE__ */ o("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: [
|
|
740
|
+
/* @__PURE__ */ o("div", { className: "flex items-center justify-between border-b border-sand px-4 py-3", children: [
|
|
735
741
|
/* @__PURE__ */ e("h2", { className: "text-base font-semibold text-charcoal", children: "Chat info" }),
|
|
736
|
-
/* @__PURE__ */ e(
|
|
742
|
+
/* @__PURE__ */ e(_t, { onClick: s })
|
|
737
743
|
] }),
|
|
738
|
-
/* @__PURE__ */
|
|
739
|
-
/* @__PURE__ */
|
|
744
|
+
/* @__PURE__ */ o("div", { className: "flex-1 px-2 overflow-y-auto w-full", children: [
|
|
745
|
+
/* @__PURE__ */ o(
|
|
740
746
|
"div",
|
|
741
747
|
{
|
|
742
748
|
className: "flex flex-col items-center gap-3 self-stretch px-4 py-2 mt-6 rounded-lg border border-black/[0.04]",
|
|
743
749
|
style: { backgroundColor: "#FBFAF9" },
|
|
744
750
|
children: [
|
|
745
|
-
/* @__PURE__ */
|
|
751
|
+
/* @__PURE__ */ o("div", { className: "flex items-center gap-3 w-full", children: [
|
|
746
752
|
/* @__PURE__ */ e(
|
|
747
753
|
ae,
|
|
748
754
|
{
|
|
749
|
-
id:
|
|
750
|
-
name:
|
|
755
|
+
id: G,
|
|
756
|
+
name: k,
|
|
751
757
|
image: P,
|
|
752
758
|
size: 88,
|
|
753
759
|
shape: "circle"
|
|
754
760
|
}
|
|
755
761
|
),
|
|
756
|
-
/* @__PURE__ */
|
|
757
|
-
/* @__PURE__ */ e("p", { className: "truncate text-base font-semibold text-charcoal", children:
|
|
758
|
-
|
|
759
|
-
l && !
|
|
762
|
+
/* @__PURE__ */ o("div", { className: "flex flex-col min-w-0 flex-1", children: [
|
|
763
|
+
/* @__PURE__ */ e("p", { className: "truncate text-base font-semibold text-charcoal", children: k }),
|
|
764
|
+
A && /* @__PURE__ */ e("p", { className: "truncate text-sm text-[#00000055]", children: A }),
|
|
765
|
+
l && !h && /* @__PURE__ */ e(
|
|
760
766
|
"span",
|
|
761
767
|
{
|
|
762
768
|
className: "mt-1 rounded-full text-xs font-normal w-fit",
|
|
@@ -772,103 +778,103 @@ const Zs = ({
|
|
|
772
778
|
)
|
|
773
779
|
] })
|
|
774
780
|
] }),
|
|
775
|
-
|
|
781
|
+
h && /* @__PURE__ */ e("div", { className: "w-full", children: h })
|
|
776
782
|
]
|
|
777
783
|
}
|
|
778
784
|
),
|
|
779
|
-
/* @__PURE__ */
|
|
780
|
-
|
|
781
|
-
|
|
785
|
+
/* @__PURE__ */ o("ul", { className: "flex flex-col gap-2 mt-2", children: [
|
|
786
|
+
c && /* @__PURE__ */ e("li", { children: /* @__PURE__ */ o(
|
|
787
|
+
Se,
|
|
782
788
|
{
|
|
783
|
-
onClick:
|
|
784
|
-
disabled:
|
|
785
|
-
"aria-busy":
|
|
789
|
+
onClick: N,
|
|
790
|
+
disabled: b,
|
|
791
|
+
"aria-busy": b,
|
|
786
792
|
children: [
|
|
787
|
-
|
|
793
|
+
b ? /* @__PURE__ */ e(ke, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(xs, { className: "h-5 w-5" }),
|
|
788
794
|
/* @__PURE__ */ e("span", { children: "Delete Conversation" })
|
|
789
795
|
]
|
|
790
796
|
}
|
|
791
797
|
) }),
|
|
792
|
-
/* @__PURE__ */ e("li", { children:
|
|
793
|
-
|
|
798
|
+
/* @__PURE__ */ e("li", { children: y ? /* @__PURE__ */ o(
|
|
799
|
+
Se,
|
|
794
800
|
{
|
|
795
|
-
onClick:
|
|
796
|
-
disabled:
|
|
797
|
-
"aria-busy":
|
|
801
|
+
onClick: x,
|
|
802
|
+
disabled: v,
|
|
803
|
+
"aria-busy": v,
|
|
798
804
|
children: [
|
|
799
|
-
|
|
805
|
+
v ? /* @__PURE__ */ e(ke, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(Qe, { className: "h-5 w-5" }),
|
|
800
806
|
/* @__PURE__ */ e("span", { children: "Unblock" })
|
|
801
807
|
]
|
|
802
808
|
}
|
|
803
|
-
) : /* @__PURE__ */
|
|
804
|
-
|
|
809
|
+
) : /* @__PURE__ */ o(
|
|
810
|
+
Se,
|
|
805
811
|
{
|
|
806
|
-
onClick:
|
|
807
|
-
disabled:
|
|
808
|
-
"aria-busy":
|
|
812
|
+
onClick: g,
|
|
813
|
+
disabled: v,
|
|
814
|
+
"aria-busy": v,
|
|
809
815
|
children: [
|
|
810
|
-
|
|
816
|
+
v ? /* @__PURE__ */ e(ke, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(Qe, { className: "h-5 w-5" }),
|
|
811
817
|
/* @__PURE__ */ e("span", { children: "Block" })
|
|
812
818
|
]
|
|
813
819
|
}
|
|
814
820
|
) }),
|
|
815
|
-
/* @__PURE__ */ e("li", { children: /* @__PURE__ */
|
|
816
|
-
/* @__PURE__ */ e(
|
|
821
|
+
/* @__PURE__ */ e("li", { children: /* @__PURE__ */ o(Se, { variant: "danger", onClick: R, children: [
|
|
822
|
+
/* @__PURE__ */ e(ps, { className: "h-5 w-5" }),
|
|
817
823
|
/* @__PURE__ */ e("span", { children: "Report" })
|
|
818
824
|
] }) }),
|
|
819
|
-
|
|
825
|
+
C
|
|
820
826
|
] })
|
|
821
827
|
] })
|
|
822
828
|
] })
|
|
823
829
|
}
|
|
824
830
|
)
|
|
825
831
|
);
|
|
826
|
-
},
|
|
827
|
-
function Ks(t) {
|
|
828
|
-
return t != null && t.length ? t.some((s) => s.type === Ve) ? "down" : t.some((s) => s.type === Ge) ? "up" : null : null;
|
|
829
|
-
}
|
|
832
|
+
}, Ks = (t) => /* @__PURE__ */ e(At, { ...t, position: "center" }), He = "vote_up", Ve = "vote_down";
|
|
830
833
|
function Js(t) {
|
|
831
|
-
|
|
832
|
-
|
|
834
|
+
return t != null && t.length ? t.some((s) => s.type === Ve) ? "down" : t.some((s) => s.type === He) ? "up" : null : null;
|
|
835
|
+
}
|
|
836
|
+
function Qs(t) {
|
|
837
|
+
const { channel: s } = me(), { client: n } = We("useMessageVote"), r = Be(
|
|
838
|
+
() => Js(t.own_reactions),
|
|
833
839
|
[t.own_reactions]
|
|
834
|
-
), l =
|
|
840
|
+
), l = O(async () => {
|
|
835
841
|
if (n != null && n.userID)
|
|
836
842
|
try {
|
|
837
|
-
|
|
843
|
+
r === "up" ? await s.deleteReaction(t.id, He) : await s.sendReaction(
|
|
838
844
|
t.id,
|
|
839
|
-
{ type:
|
|
845
|
+
{ type: He },
|
|
840
846
|
{ enforce_unique: !0, skip_push: !0 }
|
|
841
847
|
);
|
|
842
848
|
} catch {
|
|
843
849
|
}
|
|
844
|
-
}, [s, n == null ? void 0 : n.userID, t.id,
|
|
850
|
+
}, [s, n == null ? void 0 : n.userID, t.id, r]), u = O(async () => {
|
|
845
851
|
if (n != null && n.userID)
|
|
846
852
|
try {
|
|
847
|
-
|
|
853
|
+
r === "down" ? await s.deleteReaction(t.id, Ve) : await s.sendReaction(
|
|
848
854
|
t.id,
|
|
849
855
|
{ type: Ve },
|
|
850
856
|
{ enforce_unique: !0, skip_push: !0 }
|
|
851
857
|
);
|
|
852
858
|
} catch {
|
|
853
859
|
}
|
|
854
|
-
}, [s, n == null ? void 0 : n.userID, t.id,
|
|
855
|
-
return { selected:
|
|
860
|
+
}, [s, n == null ? void 0 : n.userID, t.id, r]);
|
|
861
|
+
return { selected: r, voteUp: l, voteDown: u };
|
|
856
862
|
}
|
|
857
|
-
const
|
|
863
|
+
const en = j.lazy(() => import("./Card-D4vEgqWt.js")), tn = j.lazy(() => import("./Card-BHrnmHeu.js")), Et = () => /* @__PURE__ */ e(
|
|
858
864
|
"div",
|
|
859
865
|
{
|
|
860
866
|
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)]",
|
|
861
867
|
"aria-hidden": !0
|
|
862
868
|
}
|
|
863
|
-
),
|
|
869
|
+
), sn = (t) => /* @__PURE__ */ e(mt, { fallback: /* @__PURE__ */ e(Et, {}), children: /* @__PURE__ */ e(en, { ...t }) }), nn = (t) => /* @__PURE__ */ e(mt, { fallback: /* @__PURE__ */ e(Et, {}), children: /* @__PURE__ */ e(tn, { ...t }) }), lt = { Creator: sn, Visitor: nn }, an = {
|
|
864
870
|
isUnlocking: () => !1
|
|
865
|
-
},
|
|
866
|
-
LockedAttachment:
|
|
867
|
-
},
|
|
868
|
-
function
|
|
869
|
-
return
|
|
871
|
+
}, rn = {
|
|
872
|
+
LockedAttachment: an
|
|
873
|
+
}, It = dt({}), la = It.Provider;
|
|
874
|
+
function ln(t) {
|
|
875
|
+
return ut(It)[t] ?? rn[t];
|
|
870
876
|
}
|
|
871
|
-
const
|
|
877
|
+
const on = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", children: /* @__PURE__ */ e(
|
|
872
878
|
"path",
|
|
873
879
|
{
|
|
874
880
|
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",
|
|
@@ -878,7 +884,7 @@ const ln = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
878
884
|
strokeLinejoin: "round",
|
|
879
885
|
fill: t ? "currentColor" : "none"
|
|
880
886
|
}
|
|
881
|
-
) }),
|
|
887
|
+
) }), cn = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", children: /* @__PURE__ */ e(
|
|
882
888
|
"path",
|
|
883
889
|
{
|
|
884
890
|
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",
|
|
@@ -888,11 +894,11 @@ const ln = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
888
894
|
strokeLinejoin: "round",
|
|
889
895
|
fill: t ? "currentColor" : "none"
|
|
890
896
|
}
|
|
891
|
-
) }),
|
|
897
|
+
) }), dn = ({
|
|
892
898
|
selected: t,
|
|
893
899
|
onVoteUp: s,
|
|
894
900
|
onVoteDown: n
|
|
895
|
-
}) => /* @__PURE__ */
|
|
901
|
+
}) => /* @__PURE__ */ o("div", { className: "message-vote-buttons", children: [
|
|
896
902
|
/* @__PURE__ */ e(
|
|
897
903
|
"button",
|
|
898
904
|
{
|
|
@@ -901,7 +907,7 @@ const ln = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
901
907
|
onClick: s,
|
|
902
908
|
"aria-label": "Helpful",
|
|
903
909
|
"aria-pressed": t === "up",
|
|
904
|
-
children: /* @__PURE__ */ e(
|
|
910
|
+
children: /* @__PURE__ */ e(on, { filled: t === "up" })
|
|
905
911
|
}
|
|
906
912
|
),
|
|
907
913
|
/* @__PURE__ */ e(
|
|
@@ -912,55 +918,55 @@ const ln = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
912
918
|
onClick: n,
|
|
913
919
|
"aria-label": "Not helpful",
|
|
914
920
|
"aria-pressed": t === "down",
|
|
915
|
-
children: /* @__PURE__ */ e(
|
|
921
|
+
children: /* @__PURE__ */ e(cn, { filled: t === "down" })
|
|
916
922
|
}
|
|
917
923
|
)
|
|
918
|
-
] }),
|
|
919
|
-
var ce, ne, Ne, ye, Ce, de, _e, Ee,
|
|
924
|
+
] }), un = (t) => {
|
|
925
|
+
var ce, ne, Ne, ye, Ce, de, _e, Ee, Ie, ue, D, X, H, Y;
|
|
920
926
|
const {
|
|
921
927
|
additionalMessageInputProps: s,
|
|
922
928
|
chatbotVotingEnabled: n,
|
|
923
|
-
editing:
|
|
929
|
+
editing: r,
|
|
924
930
|
endOfGroup: l,
|
|
925
931
|
firstOfGroup: u,
|
|
926
|
-
groupedByUser:
|
|
927
|
-
handleAction:
|
|
928
|
-
handleOpenThread:
|
|
929
|
-
handleRetry:
|
|
930
|
-
highlighted:
|
|
931
|
-
isMessageAIGenerated:
|
|
932
|
-
isMyMessage:
|
|
932
|
+
groupedByUser: i,
|
|
933
|
+
handleAction: c,
|
|
934
|
+
handleOpenThread: f,
|
|
935
|
+
handleRetry: d,
|
|
936
|
+
highlighted: m,
|
|
937
|
+
isMessageAIGenerated: h,
|
|
938
|
+
isMyMessage: C,
|
|
933
939
|
message: a,
|
|
934
|
-
renderText:
|
|
935
|
-
threadList:
|
|
936
|
-
} = t, { client:
|
|
937
|
-
Attachment:
|
|
938
|
-
EditMessageModal: B =
|
|
939
|
-
MessageBlocked:
|
|
940
|
-
MessageBouncePrompt:
|
|
941
|
-
MessageDeleted:
|
|
942
|
-
MessageIsThreadReplyInChannelButtonIndicator: F =
|
|
943
|
-
MessageRepliesCountButton:
|
|
944
|
-
ReminderNotification:
|
|
945
|
-
StreamedMessageText: re =
|
|
946
|
-
PinIndicator:
|
|
947
|
-
} =
|
|
948
|
-
() =>
|
|
949
|
-
[
|
|
950
|
-
),
|
|
940
|
+
renderText: E,
|
|
941
|
+
threadList: y
|
|
942
|
+
} = t, { client: w } = We("CustomMessage"), { channel: b } = me("CustomMessage"), { isUnlocking: S, onUnlockClick: v, onFetchSource: _, onDownloadClick: L } = ln("LockedAttachment"), [N, g] = T(!1), x = Ut(a.id), { selected: R, voteUp: k, voteDown: P } = Qs(a), {
|
|
943
|
+
Attachment: M = $t,
|
|
944
|
+
EditMessageModal: B = zt,
|
|
945
|
+
MessageBlocked: A = Bt,
|
|
946
|
+
MessageBouncePrompt: G = jt,
|
|
947
|
+
MessageDeleted: U = Gt,
|
|
948
|
+
MessageIsThreadReplyInChannelButtonIndicator: F = Ht,
|
|
949
|
+
MessageRepliesCountButton: W = Vt,
|
|
950
|
+
ReminderNotification: K = Yt,
|
|
951
|
+
StreamedMessageText: re = Wt,
|
|
952
|
+
PinIndicator: Q
|
|
953
|
+
} = ht("CustomMessage"), p = qt(a), I = Xt(a), z = Be(
|
|
954
|
+
() => h == null ? void 0 : h(a),
|
|
955
|
+
[h, a]
|
|
956
|
+
), V = Be(
|
|
951
957
|
() => !a.shared_location && !a.attachments ? [] : a.shared_location ? [a.shared_location, ...a.attachments ?? []] : a.attachments,
|
|
952
958
|
[a]
|
|
953
959
|
);
|
|
954
|
-
if (
|
|
960
|
+
if (Zt(a))
|
|
955
961
|
return null;
|
|
956
962
|
if (a.deleted_at || a.type === "deleted")
|
|
957
|
-
return /* @__PURE__ */ e(
|
|
958
|
-
if (
|
|
959
|
-
return /* @__PURE__ */ e(
|
|
960
|
-
const ee = !
|
|
961
|
-
let
|
|
962
|
-
|
|
963
|
-
const te =
|
|
963
|
+
return /* @__PURE__ */ e(U, { message: a });
|
|
964
|
+
if (Kt(a))
|
|
965
|
+
return /* @__PURE__ */ e(A, {});
|
|
966
|
+
const ee = !y && !!a.reply_count, le = !y && a.show_in_channel && a.parent_id, xe = a.status === "failed" && ((ce = a.error) == null ? void 0 : ce.status) !== 403, Le = Jt(a);
|
|
967
|
+
let q;
|
|
968
|
+
xe ? q = () => d(a) : Le && (q = () => g(!0));
|
|
969
|
+
const te = C(), pe = $(
|
|
964
970
|
"str-chat__message str-chat__message-simple",
|
|
965
971
|
`str-chat__message--${a.type}`,
|
|
966
972
|
`str-chat__message--${a.status}`,
|
|
@@ -968,34 +974,34 @@ const ln = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
968
974
|
a.text ? "str-chat__message--has-text" : "has-no-text",
|
|
969
975
|
{
|
|
970
976
|
"str-chat__message--has-attachment": p,
|
|
971
|
-
"str-chat__message--highlighted":
|
|
977
|
+
"str-chat__message--highlighted": m,
|
|
972
978
|
"str-chat__message--pinned pinned-message": a.pinned,
|
|
973
|
-
"str-chat__message--with-reactions":
|
|
979
|
+
"str-chat__message--with-reactions": I,
|
|
974
980
|
"str-chat__message-send-can-be-retried": (a == null ? void 0 : a.status) === "failed" && ((ne = a == null ? void 0 : a.error) == null ? void 0 : ne.status) !== 403,
|
|
975
981
|
"str-chat__message-with-thread-link": ee || le,
|
|
976
982
|
"str-chat__virtual-message__wrapper--end": l,
|
|
977
983
|
"str-chat__virtual-message__wrapper--first": u,
|
|
978
|
-
"str-chat__virtual-message__wrapper--group":
|
|
984
|
+
"str-chat__virtual-message__wrapper--group": i
|
|
979
985
|
}
|
|
980
|
-
), ie = a.poll_id &&
|
|
981
|
-
return /* @__PURE__ */
|
|
982
|
-
|
|
986
|
+
), ie = a.poll_id && w.polls.fromState(a.poll_id), he = qs(a), oe = qe(a), ve = Ws(a), ge = !!(V != null && V.length && !a.quoted_message), we = oe && te && ge;
|
|
987
|
+
return /* @__PURE__ */ o(se, { children: [
|
|
988
|
+
r && /* @__PURE__ */ e(
|
|
983
989
|
B,
|
|
984
990
|
{
|
|
985
991
|
additionalMessageInputProps: s
|
|
986
992
|
}
|
|
987
993
|
),
|
|
988
|
-
|
|
989
|
-
|
|
994
|
+
N && /* @__PURE__ */ e(
|
|
995
|
+
Qt,
|
|
990
996
|
{
|
|
991
|
-
MessageBouncePrompt:
|
|
992
|
-
onClose: () =>
|
|
993
|
-
open:
|
|
997
|
+
MessageBouncePrompt: G,
|
|
998
|
+
onClose: () => g(!1),
|
|
999
|
+
open: N
|
|
994
1000
|
}
|
|
995
1001
|
),
|
|
996
|
-
/* @__PURE__ */
|
|
997
|
-
|
|
998
|
-
!!
|
|
1002
|
+
/* @__PURE__ */ o("div", { className: pe, children: [
|
|
1003
|
+
Q && /* @__PURE__ */ e(Q, {}),
|
|
1004
|
+
!!x && /* @__PURE__ */ e(K, { reminder: x }),
|
|
999
1005
|
a.user && /* @__PURE__ */ e(
|
|
1000
1006
|
ae,
|
|
1001
1007
|
{
|
|
@@ -1008,23 +1014,23 @@ const ln = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
1008
1014
|
/* @__PURE__ */ e(
|
|
1009
1015
|
"div",
|
|
1010
1016
|
{
|
|
1011
|
-
className:
|
|
1012
|
-
"str-chat__simple-message--error-failed":
|
|
1017
|
+
className: $("str-chat__message-inner", {
|
|
1018
|
+
"str-chat__simple-message--error-failed": xe || Le
|
|
1013
1019
|
}),
|
|
1014
1020
|
"data-testid": "message-inner",
|
|
1015
|
-
onClick:
|
|
1016
|
-
onKeyDown:
|
|
1017
|
-
role:
|
|
1018
|
-
tabIndex:
|
|
1021
|
+
onClick: q,
|
|
1022
|
+
onKeyDown: q,
|
|
1023
|
+
role: q ? "button" : void 0,
|
|
1024
|
+
tabIndex: q ? 0 : void 0,
|
|
1019
1025
|
style: {
|
|
1020
1026
|
// Force margins to 0 to prevent hover layout shift
|
|
1021
1027
|
// Stream Chat CSS sets margin-inline-end/start to 78px, then 0 on hover
|
|
1022
1028
|
marginInlineEnd: 0,
|
|
1023
1029
|
marginInlineStart: 0
|
|
1024
1030
|
},
|
|
1025
|
-
children: ve ? /* @__PURE__ */
|
|
1031
|
+
children: ve ? /* @__PURE__ */ o("div", { className: "str-chat__message-bubble-wrapper", children: [
|
|
1026
1032
|
te ? /* @__PURE__ */ e(
|
|
1027
|
-
|
|
1033
|
+
lt.Creator,
|
|
1028
1034
|
{
|
|
1029
1035
|
title: (Ne = a.metadata) == null ? void 0 : Ne.attachment_title,
|
|
1030
1036
|
mimeType: (ye = a.metadata) == null ? void 0 : ye.attachment_mime_type,
|
|
@@ -1032,31 +1038,31 @@ const ln = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
1032
1038
|
amountText: (de = a.metadata) == null ? void 0 : de.amount_text,
|
|
1033
1039
|
detail: (_e = a.metadata) == null ? void 0 : _e.attachment_detail,
|
|
1034
1040
|
paymentStatus: (Ee = a.metadata) == null ? void 0 : Ee.payment_status,
|
|
1035
|
-
isUnlocking:
|
|
1036
|
-
onPreviewClick: () =>
|
|
1037
|
-
onFetchSource: async () => await (
|
|
1041
|
+
isUnlocking: S(a.id),
|
|
1042
|
+
onPreviewClick: () => v == null ? void 0 : v(a, b),
|
|
1043
|
+
onFetchSource: async () => await (_ == null ? void 0 : _(a, b))
|
|
1038
1044
|
}
|
|
1039
1045
|
) : /* @__PURE__ */ e(
|
|
1040
|
-
|
|
1046
|
+
lt.Visitor,
|
|
1041
1047
|
{
|
|
1042
|
-
title: (
|
|
1048
|
+
title: (Ie = a.metadata) == null ? void 0 : Ie.attachment_title,
|
|
1043
1049
|
mimeType: (ue = a.metadata) == null ? void 0 : ue.attachment_mime_type,
|
|
1044
1050
|
thumbnailUrl: (D = a.metadata) == null ? void 0 : D.attachment_thumbnail,
|
|
1045
|
-
amountText: (
|
|
1046
|
-
detail: (
|
|
1047
|
-
paymentStatus: (
|
|
1048
|
-
isUnlocking:
|
|
1049
|
-
onUnlockClick: () =>
|
|
1050
|
-
onFetchSource: async () => await (
|
|
1051
|
-
onDownloadClick: () => L == null ? void 0 : L(a,
|
|
1051
|
+
amountText: (X = a.metadata) == null ? void 0 : X.amount_text,
|
|
1052
|
+
detail: (H = a.metadata) == null ? void 0 : H.attachment_detail,
|
|
1053
|
+
paymentStatus: (Y = a.metadata) == null ? void 0 : Y.payment_status,
|
|
1054
|
+
isUnlocking: S(a.id),
|
|
1055
|
+
onUnlockClick: () => v == null ? void 0 : v(a, b),
|
|
1056
|
+
onFetchSource: async () => await (_ == null ? void 0 : _(a, b)),
|
|
1057
|
+
onDownloadClick: () => L == null ? void 0 : L(a, b)
|
|
1052
1058
|
}
|
|
1053
1059
|
),
|
|
1054
|
-
a.text && /* @__PURE__ */ e("div", { className: "str-chat__message-bubble", children: /* @__PURE__ */ e(
|
|
1060
|
+
a.text && /* @__PURE__ */ e("div", { className: "str-chat__message-bubble", children: /* @__PURE__ */ e(Je, { message: a, renderText: E }) })
|
|
1055
1061
|
] }) : he ? (
|
|
1056
1062
|
/* Tip-only messages render as a standalone bubble */
|
|
1057
1063
|
/* @__PURE__ */ e(Ue, { message: a, standalone: !0 })
|
|
1058
|
-
) : /* @__PURE__ */
|
|
1059
|
-
/* @__PURE__ */
|
|
1064
|
+
) : /* @__PURE__ */ o("div", { className: "str-chat__message-bubble-wrapper", children: [
|
|
1065
|
+
/* @__PURE__ */ o("div", { className: "str-chat__message-bubble", children: [
|
|
1060
1066
|
oe && !we && /* @__PURE__ */ e(
|
|
1061
1067
|
Ue,
|
|
1062
1068
|
{
|
|
@@ -1065,22 +1071,22 @@ const ln = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
1065
1071
|
isMyMessage: te
|
|
1066
1072
|
}
|
|
1067
1073
|
),
|
|
1068
|
-
ie && /* @__PURE__ */ e(
|
|
1069
|
-
|
|
1070
|
-
|
|
1074
|
+
ie && /* @__PURE__ */ e(es, { poll: ie }),
|
|
1075
|
+
V != null && V.length && !a.quoted_message ? /* @__PURE__ */ e(
|
|
1076
|
+
M,
|
|
1071
1077
|
{
|
|
1072
|
-
actionHandler:
|
|
1073
|
-
attachments:
|
|
1078
|
+
actionHandler: c,
|
|
1079
|
+
attachments: V
|
|
1074
1080
|
}
|
|
1075
1081
|
) : null,
|
|
1076
|
-
|
|
1082
|
+
z ? /* @__PURE__ */ e(
|
|
1077
1083
|
re,
|
|
1078
1084
|
{
|
|
1079
1085
|
message: a,
|
|
1080
|
-
renderText:
|
|
1086
|
+
renderText: E
|
|
1081
1087
|
}
|
|
1082
|
-
) : /* @__PURE__ */ e(
|
|
1083
|
-
/* @__PURE__ */ e(
|
|
1088
|
+
) : /* @__PURE__ */ e(Je, { message: a, renderText: E }),
|
|
1089
|
+
/* @__PURE__ */ e(ts, {})
|
|
1084
1090
|
] }),
|
|
1085
1091
|
(!oe || we) && /* @__PURE__ */ e(
|
|
1086
1092
|
Ue,
|
|
@@ -1091,10 +1097,10 @@ const ln = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
1091
1097
|
}
|
|
1092
1098
|
),
|
|
1093
1099
|
n && oe && /* @__PURE__ */ e(
|
|
1094
|
-
|
|
1100
|
+
dn,
|
|
1095
1101
|
{
|
|
1096
|
-
selected:
|
|
1097
|
-
onVoteUp:
|
|
1102
|
+
selected: R,
|
|
1103
|
+
onVoteUp: k,
|
|
1098
1104
|
onVoteDown: P
|
|
1099
1105
|
}
|
|
1100
1106
|
)
|
|
@@ -1102,31 +1108,31 @@ const ln = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
1102
1108
|
}
|
|
1103
1109
|
),
|
|
1104
1110
|
ee && /* @__PURE__ */ e(
|
|
1105
|
-
|
|
1111
|
+
W,
|
|
1106
1112
|
{
|
|
1107
|
-
onClick:
|
|
1113
|
+
onClick: f,
|
|
1108
1114
|
reply_count: a.reply_count
|
|
1109
1115
|
}
|
|
1110
1116
|
),
|
|
1111
1117
|
le && /* @__PURE__ */ e(F, {})
|
|
1112
1118
|
] }, a.id)
|
|
1113
1119
|
] });
|
|
1114
|
-
},
|
|
1115
|
-
|
|
1116
|
-
(t, s) => t.chatbotVotingEnabled !== s.chatbotVotingEnabled ? !1 :
|
|
1117
|
-
),
|
|
1118
|
-
const s =
|
|
1119
|
-
return /* @__PURE__ */ e(
|
|
1120
|
-
},
|
|
1120
|
+
}, mn = j.memo(
|
|
1121
|
+
un,
|
|
1122
|
+
(t, s) => t.chatbotVotingEnabled !== s.chatbotVotingEnabled ? !1 : Ot(t, s)
|
|
1123
|
+
), hn = (t) => {
|
|
1124
|
+
const s = ft("CustomMessage");
|
|
1125
|
+
return /* @__PURE__ */ e(mn, { ...s, ...t });
|
|
1126
|
+
}, fn = (t) => ({
|
|
1121
1127
|
linkPreviews: Array.from(t.previews.values()).filter(
|
|
1122
|
-
(s) =>
|
|
1128
|
+
(s) => rt.previewIsLoaded(s) || rt.previewIsLoading(s)
|
|
1123
1129
|
)
|
|
1124
|
-
}),
|
|
1130
|
+
}), gn = ({
|
|
1125
1131
|
link: t,
|
|
1126
1132
|
onDismiss: s
|
|
1127
1133
|
}) => {
|
|
1128
|
-
const { og_scrape_url: n, title:
|
|
1129
|
-
return /* @__PURE__ */
|
|
1134
|
+
const { og_scrape_url: n, title: r, image_url: l } = t;
|
|
1135
|
+
return /* @__PURE__ */ o(
|
|
1130
1136
|
"a",
|
|
1131
1137
|
{
|
|
1132
1138
|
href: n,
|
|
@@ -1138,7 +1144,7 @@ const ln = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
1138
1144
|
"img",
|
|
1139
1145
|
{
|
|
1140
1146
|
src: l,
|
|
1141
|
-
alt:
|
|
1147
|
+
alt: r || "",
|
|
1142
1148
|
className: "h-[148px] w-full rounded-[20px] object-cover"
|
|
1143
1149
|
}
|
|
1144
1150
|
),
|
|
@@ -1146,37 +1152,37 @@ const ln = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
1146
1152
|
"button",
|
|
1147
1153
|
{
|
|
1148
1154
|
type: "button",
|
|
1149
|
-
onClick: (
|
|
1150
|
-
|
|
1155
|
+
onClick: (i) => {
|
|
1156
|
+
i.preventDefault(), s(n);
|
|
1151
1157
|
},
|
|
1152
1158
|
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",
|
|
1153
1159
|
"aria-label": "Close link preview",
|
|
1154
1160
|
children: /* @__PURE__ */ e(Re, { className: "size-4 text-black/90" })
|
|
1155
1161
|
}
|
|
1156
1162
|
),
|
|
1157
|
-
/* @__PURE__ */
|
|
1158
|
-
|
|
1163
|
+
/* @__PURE__ */ o("div", { className: "p-2", children: [
|
|
1164
|
+
r && /* @__PURE__ */ e("div", { className: "text-[14px] font-medium leading-5 text-white", children: r }),
|
|
1159
1165
|
/* @__PURE__ */ e("div", { className: "text-[12px] leading-4 text-white/55", children: n })
|
|
1160
1166
|
] })
|
|
1161
1167
|
]
|
|
1162
1168
|
}
|
|
1163
1169
|
);
|
|
1164
|
-
},
|
|
1165
|
-
const { linkPreviewsManager: t } =
|
|
1170
|
+
}, bn = () => {
|
|
1171
|
+
const { linkPreviewsManager: t } = ss(), { linkPreviews: s } = ns(
|
|
1166
1172
|
t.state,
|
|
1167
|
-
|
|
1173
|
+
fn
|
|
1168
1174
|
), n = (l) => {
|
|
1169
1175
|
t.dismissPreview(l);
|
|
1170
1176
|
};
|
|
1171
1177
|
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(
|
|
1172
|
-
|
|
1178
|
+
gn,
|
|
1173
1179
|
{
|
|
1174
1180
|
link: l,
|
|
1175
1181
|
onDismiss: n
|
|
1176
1182
|
},
|
|
1177
1183
|
l.og_scrape_url
|
|
1178
1184
|
)) }) : null;
|
|
1179
|
-
},
|
|
1185
|
+
}, xn = ({ sendMessage: t, disabled: s, ...n }) => /* @__PURE__ */ e(
|
|
1180
1186
|
"button",
|
|
1181
1187
|
{
|
|
1182
1188
|
...n,
|
|
@@ -1184,22 +1190,22 @@ const ln = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
1184
1190
|
"aria-label": "Send",
|
|
1185
1191
|
disabled: s,
|
|
1186
1192
|
onClick: t,
|
|
1187
|
-
children: /* @__PURE__ */ e(
|
|
1193
|
+
children: /* @__PURE__ */ e(vs, { weight: "bold", className: "size-4" })
|
|
1188
1194
|
}
|
|
1189
1195
|
), pn = () => {
|
|
1190
|
-
var
|
|
1191
|
-
const { channel: t } = me(), s = ((
|
|
1196
|
+
var c;
|
|
1197
|
+
const { channel: t } = me(), s = ((c = t == null ? void 0 : t.data) == null ? void 0 : c.frozen) === !0, { handleSubmit: n } = rs(), { SendButton: r } = ht(
|
|
1192
1198
|
"CustomMessageInput"
|
|
1193
|
-
), l =
|
|
1194
|
-
return /* @__PURE__ */
|
|
1195
|
-
/* @__PURE__ */ e("div", { className: "left-container", children: /* @__PURE__ */ e(
|
|
1196
|
-
/* @__PURE__ */
|
|
1197
|
-
/* @__PURE__ */ e(
|
|
1198
|
-
/* @__PURE__ */ e(
|
|
1199
|
-
/* @__PURE__ */ e(
|
|
1200
|
-
/* @__PURE__ */
|
|
1199
|
+
), l = r ?? xn, u = is();
|
|
1200
|
+
return /* @__PURE__ */ o(se, { children: [
|
|
1201
|
+
/* @__PURE__ */ e("div", { className: "left-container", children: /* @__PURE__ */ e(ls, {}) }),
|
|
1202
|
+
/* @__PURE__ */ o("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: [
|
|
1203
|
+
/* @__PURE__ */ e(os, {}),
|
|
1204
|
+
/* @__PURE__ */ e(bn, {}),
|
|
1205
|
+
/* @__PURE__ */ e(cs, {}),
|
|
1206
|
+
/* @__PURE__ */ o("div", { className: "flex", children: [
|
|
1201
1207
|
/* @__PURE__ */ e("div", { className: "w-full ml-2 mr-4 self-center leading-[0]", children: /* @__PURE__ */ e(
|
|
1202
|
-
|
|
1208
|
+
ds,
|
|
1203
1209
|
{
|
|
1204
1210
|
"aria-disabled": s || void 0,
|
|
1205
1211
|
className: "w-full resize-none outline-none leading-6",
|
|
@@ -1223,12 +1229,12 @@ const ln = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
1223
1229
|
] })
|
|
1224
1230
|
] })
|
|
1225
1231
|
] });
|
|
1226
|
-
},
|
|
1232
|
+
}, vn = ({
|
|
1227
1233
|
renderActions: t
|
|
1228
1234
|
}) => {
|
|
1229
|
-
var
|
|
1230
|
-
const { channel: s } = me(), n = ((
|
|
1231
|
-
return /* @__PURE__ */
|
|
1235
|
+
var r;
|
|
1236
|
+
const { channel: s } = me(), n = ((r = s == null ? void 0 : s.data) == null ? void 0 : r.frozen) === !0;
|
|
1237
|
+
return /* @__PURE__ */ o(
|
|
1232
1238
|
"div",
|
|
1233
1239
|
{
|
|
1234
1240
|
inert: n ? "" : void 0,
|
|
@@ -1236,35 +1242,35 @@ const ln = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
1236
1242
|
className: "message-input flex items-center gap-2 p-4 aria-disabled:opacity-40",
|
|
1237
1243
|
children: [
|
|
1238
1244
|
t == null ? void 0 : t(),
|
|
1239
|
-
/* @__PURE__ */ e(
|
|
1245
|
+
/* @__PURE__ */ e(as, { Input: pn })
|
|
1240
1246
|
]
|
|
1241
1247
|
}
|
|
1242
1248
|
);
|
|
1243
|
-
},
|
|
1249
|
+
}, wn = [
|
|
1244
1250
|
"SYSTEM_DM_AGENT_PAUSED",
|
|
1245
1251
|
"SYSTEM_DM_AGENT_RESUMED"
|
|
1246
|
-
],
|
|
1252
|
+
], Nn = {
|
|
1247
1253
|
SYSTEM_DM_AGENT_PAUSED: "DM Agent has left the conversation",
|
|
1248
1254
|
SYSTEM_DM_AGENT_RESUMED: "DM Agent has rejoined the conversation"
|
|
1249
|
-
},
|
|
1255
|
+
}, yn = [
|
|
1250
1256
|
"SYSTEM_AGE_SAFETY_BLOCKED"
|
|
1251
|
-
],
|
|
1257
|
+
], Cn = {
|
|
1252
1258
|
SYSTEM_AGE_SAFETY_BLOCKED: "This user isn’t able to reply because they don’t meet our age safety guidelines."
|
|
1253
|
-
}, $e = "age safety guidelines.",
|
|
1254
|
-
var
|
|
1255
|
-
const s = (
|
|
1256
|
-
if (
|
|
1259
|
+
}, $e = "age safety guidelines.", _n = "https://linktr.ee/s/about/contact", ot = (t) => wn.includes(t), En = (t) => yn.includes(t), In = (t) => {
|
|
1260
|
+
var r;
|
|
1261
|
+
const s = (r = t.metadata) == null ? void 0 : r.custom_type;
|
|
1262
|
+
if (ot(s))
|
|
1257
1263
|
return {
|
|
1258
1264
|
kind: "dm-agent",
|
|
1259
1265
|
type: s
|
|
1260
1266
|
};
|
|
1261
|
-
if (
|
|
1267
|
+
if (En(s))
|
|
1262
1268
|
return {
|
|
1263
1269
|
kind: "age-safety",
|
|
1264
1270
|
type: s
|
|
1265
1271
|
};
|
|
1266
1272
|
const n = t.dm_agent_system_type;
|
|
1267
|
-
if (
|
|
1273
|
+
if (ot(n))
|
|
1268
1274
|
return {
|
|
1269
1275
|
kind: "dm-agent",
|
|
1270
1276
|
type: n
|
|
@@ -1274,12 +1280,12 @@ const ln = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
1274
1280
|
if (s === -1)
|
|
1275
1281
|
return t;
|
|
1276
1282
|
const n = s + $e.length;
|
|
1277
|
-
return /* @__PURE__ */
|
|
1283
|
+
return /* @__PURE__ */ o(se, { children: [
|
|
1278
1284
|
t.slice(0, s),
|
|
1279
1285
|
/* @__PURE__ */ e(
|
|
1280
1286
|
"a",
|
|
1281
1287
|
{
|
|
1282
|
-
href:
|
|
1288
|
+
href: _n,
|
|
1283
1289
|
target: "_blank",
|
|
1284
1290
|
rel: "noopener noreferrer",
|
|
1285
1291
|
className: "mes-age-safety-system-message__emphasis font-medium text-inherit underline",
|
|
@@ -1288,15 +1294,15 @@ const ln = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
1288
1294
|
),
|
|
1289
1295
|
t.slice(n)
|
|
1290
1296
|
] });
|
|
1291
|
-
},
|
|
1292
|
-
var
|
|
1293
|
-
const s = t.message.hide_date === !0, n =
|
|
1297
|
+
}, kn = (t) => {
|
|
1298
|
+
var r, l;
|
|
1299
|
+
const s = t.message.hide_date === !0, n = In(
|
|
1294
1300
|
t.message
|
|
1295
1301
|
);
|
|
1296
1302
|
if ((n == null ? void 0 : n.kind) === "dm-agent") {
|
|
1297
|
-
const u = ((
|
|
1298
|
-
return /* @__PURE__ */
|
|
1299
|
-
/* @__PURE__ */
|
|
1303
|
+
const u = ((r = t.message.text) == null ? void 0 : r.trim()) || Nn[n.type];
|
|
1304
|
+
return /* @__PURE__ */ o("div", { className: "str-chat__message--system", "data-testid": "message-system", children: [
|
|
1305
|
+
/* @__PURE__ */ o(
|
|
1300
1306
|
"div",
|
|
1301
1307
|
{
|
|
1302
1308
|
className: "mes-dm-agent-system-message mx-auto mb-2 inline-flex w-fit max-w-[min(100%,480px)] items-center justify-center gap-[10px] rounded-[12px] border border-[rgba(0,0,0,0.08)] p-3 text-[rgba(0,0,0,0.55)]",
|
|
@@ -1304,7 +1310,7 @@ const ln = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
1304
1310
|
"data-dm-agent-system-type": n.type,
|
|
1305
1311
|
children: [
|
|
1306
1312
|
/* @__PURE__ */ e(
|
|
1307
|
-
|
|
1313
|
+
Ge,
|
|
1308
1314
|
{
|
|
1309
1315
|
size: 16,
|
|
1310
1316
|
weight: "regular",
|
|
@@ -1320,9 +1326,9 @@ const ln = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
1320
1326
|
] });
|
|
1321
1327
|
}
|
|
1322
1328
|
if ((n == null ? void 0 : n.kind) === "age-safety") {
|
|
1323
|
-
const u = ((l = t.message.text) == null ? void 0 : l.trim()) ||
|
|
1324
|
-
return /* @__PURE__ */
|
|
1325
|
-
/* @__PURE__ */
|
|
1329
|
+
const u = ((l = t.message.text) == null ? void 0 : l.trim()) || Cn[n.type];
|
|
1330
|
+
return /* @__PURE__ */ o("div", { className: "str-chat__message--system", "data-testid": "message-system", children: [
|
|
1331
|
+
/* @__PURE__ */ o(
|
|
1326
1332
|
"div",
|
|
1327
1333
|
{
|
|
1328
1334
|
className: "mes-age-safety-system-message box-border mx-auto mb-2 flex w-full max-w-[329px] items-start justify-center gap-3 rounded-[12px] border border-[var(--border-secondary,rgba(0,0,0,0.08))] bg-[var(--bg-warning-subtle,#fef3c6)] px-2 py-4 pl-5 text-[color:var(--text-warning-on-warning,#894b00)]",
|
|
@@ -1330,7 +1336,7 @@ const ln = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
1330
1336
|
"data-age-safety-system-type": n.type,
|
|
1331
1337
|
children: [
|
|
1332
1338
|
/* @__PURE__ */ e(
|
|
1333
|
-
|
|
1339
|
+
ws,
|
|
1334
1340
|
{
|
|
1335
1341
|
size: 24,
|
|
1336
1342
|
weight: "duotone",
|
|
@@ -1346,8 +1352,8 @@ const ln = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
1346
1352
|
!s && /* @__PURE__ */ e(Oe, { message: t.message })
|
|
1347
1353
|
] });
|
|
1348
1354
|
}
|
|
1349
|
-
return /* @__PURE__ */
|
|
1350
|
-
/* @__PURE__ */
|
|
1355
|
+
return /* @__PURE__ */ o("div", { className: "str-chat__message--system", "data-testid": "message-system", children: [
|
|
1356
|
+
/* @__PURE__ */ o("div", { className: "str-chat__message--system__text", children: [
|
|
1351
1357
|
/* @__PURE__ */ e("div", { className: "str-chat__message--system__line" }),
|
|
1352
1358
|
/* @__PURE__ */ e("p", { children: t.message.text }),
|
|
1353
1359
|
/* @__PURE__ */ e("div", { className: "str-chat__message--system__line" })
|
|
@@ -1364,26 +1370,26 @@ const ln = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
1364
1370
|
begin: `${120 * s}ms`,
|
|
1365
1371
|
repeatCount: "indefinite"
|
|
1366
1372
|
}
|
|
1367
|
-
) }),
|
|
1368
|
-
var
|
|
1369
|
-
const { channel: s, channelConfig: n, thread:
|
|
1373
|
+
) }), Tn = ({ threadList: t }) => {
|
|
1374
|
+
var E;
|
|
1375
|
+
const { channel: s, channelConfig: n, thread: r } = me(), { client: l } = We(), { typing: u = {} } = us();
|
|
1370
1376
|
if ((n == null ? void 0 : n.typing_events) === !1)
|
|
1371
1377
|
return null;
|
|
1372
|
-
const
|
|
1373
|
-
({ parent_id:
|
|
1374
|
-
var
|
|
1375
|
-
return (
|
|
1378
|
+
const i = t ? [] : Object.values(u).filter(
|
|
1379
|
+
({ parent_id: y, user: w }) => {
|
|
1380
|
+
var b;
|
|
1381
|
+
return (w == null ? void 0 : w.id) !== ((b = l.user) == null ? void 0 : b.id) && !y;
|
|
1376
1382
|
}
|
|
1377
|
-
),
|
|
1378
|
-
({ parent_id:
|
|
1379
|
-
var
|
|
1380
|
-
return (
|
|
1383
|
+
), c = t ? Object.values(u).filter(
|
|
1384
|
+
({ parent_id: y, user: w }) => {
|
|
1385
|
+
var b;
|
|
1386
|
+
return (w == null ? void 0 : w.id) !== ((b = l.user) == null ? void 0 : b.id) && y === (r == null ? void 0 : r.id);
|
|
1381
1387
|
}
|
|
1382
|
-
) : [],
|
|
1383
|
-
if (!
|
|
1388
|
+
) : [], f = t ? c : i;
|
|
1389
|
+
if (!f.length)
|
|
1384
1390
|
return null;
|
|
1385
|
-
const
|
|
1386
|
-
return /* @__PURE__ */
|
|
1391
|
+
const d = (E = f[0]) == null ? void 0 : E.user, m = d != null && d.id && s.state.members[d.id] ? s.state.members[d.id].user : void 0, h = (d == null ? void 0 : d.id) ?? (m == null ? void 0 : m.id) ?? "typing-user", C = (d == null ? void 0 : d.name) ?? (m == null ? void 0 : m.name) ?? (d == null ? void 0 : d.id) ?? "Typing user", a = (d == null ? void 0 : d.image) ?? (m == null ? void 0 : m.image);
|
|
1392
|
+
return /* @__PURE__ */ o(
|
|
1387
1393
|
"div",
|
|
1388
1394
|
{
|
|
1389
1395
|
className: "str-chat__typing-indicator !items-end !bg-transparent",
|
|
@@ -1393,14 +1399,14 @@ const ln = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
1393
1399
|
/* @__PURE__ */ e("div", { className: "shrink-0", "aria-hidden": "true", children: /* @__PURE__ */ e(
|
|
1394
1400
|
ae,
|
|
1395
1401
|
{
|
|
1396
|
-
id:
|
|
1397
|
-
name:
|
|
1402
|
+
id: h,
|
|
1403
|
+
name: C,
|
|
1398
1404
|
image: a,
|
|
1399
1405
|
size: 24,
|
|
1400
1406
|
shape: "circle"
|
|
1401
1407
|
}
|
|
1402
1408
|
) }),
|
|
1403
|
-
/* @__PURE__ */ e("div", { className: "px-4 py-3 rounded-lg bg-[#E9EAED] h-12 flex flex-col justify-end", children: /* @__PURE__ */
|
|
1409
|
+
/* @__PURE__ */ e("div", { className: "px-4 py-3 rounded-lg bg-[#E9EAED] h-12 flex flex-col justify-end", children: /* @__PURE__ */ o(
|
|
1404
1410
|
"svg",
|
|
1405
1411
|
{
|
|
1406
1412
|
"aria-hidden": "true",
|
|
@@ -1419,12 +1425,12 @@ const ln = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
1419
1425
|
]
|
|
1420
1426
|
}
|
|
1421
1427
|
);
|
|
1422
|
-
},
|
|
1428
|
+
}, Mn = () => null, Dn = ({ className: t, message: s }) => /* @__PURE__ */ o(
|
|
1423
1429
|
"div",
|
|
1424
1430
|
{
|
|
1425
|
-
className:
|
|
1431
|
+
className: $("flex items-center justify-center h-full", t),
|
|
1426
1432
|
children: [
|
|
1427
|
-
/* @__PURE__ */
|
|
1433
|
+
/* @__PURE__ */ o("svg", { viewBox: "0 0 100 100", className: "size-8 fill-pebble", stroke: "none", children: [
|
|
1428
1434
|
/* @__PURE__ */ e("circle", { cx: "6", cy: "50", r: "6", children: /* @__PURE__ */ e(
|
|
1429
1435
|
"animateTransform",
|
|
1430
1436
|
{
|
|
@@ -1462,36 +1468,37 @@ const ln = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
1462
1468
|
s && /* @__PURE__ */ e("span", { className: "text-stone", children: s })
|
|
1463
1469
|
]
|
|
1464
1470
|
}
|
|
1465
|
-
), De =
|
|
1466
|
-
/* @__PURE__ */ e(
|
|
1471
|
+
), De = j.memo(() => /* @__PURE__ */ e("div", { className: "messaging-loading-state flex items-center justify-center h-full", children: /* @__PURE__ */ o("div", { className: "flex items-center", children: [
|
|
1472
|
+
/* @__PURE__ */ e(Dn, { className: "w-6 h-6" }),
|
|
1467
1473
|
/* @__PURE__ */ e("span", { className: "text-sm text-stone", children: "Loading messages" })
|
|
1468
1474
|
] }) }));
|
|
1469
1475
|
De.displayName = "LoadingState";
|
|
1470
|
-
const fe = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-center justify-center transition-colors duration-150 focus-ring",
|
|
1476
|
+
const fe = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-center justify-center transition-colors duration-150 focus-ring", ct = "Replies instantly with AI assistant", Rn = ({
|
|
1471
1477
|
onBack: t,
|
|
1472
1478
|
showBackButton: s,
|
|
1473
1479
|
onShowInfo: n,
|
|
1474
|
-
canShowInfo:
|
|
1475
|
-
showStarButton: l = !1
|
|
1480
|
+
canShowInfo: r,
|
|
1481
|
+
showStarButton: l = !1,
|
|
1482
|
+
dmAgentEnabled: u = !1
|
|
1476
1483
|
}) => {
|
|
1477
|
-
var
|
|
1478
|
-
const { channel:
|
|
1479
|
-
(
|
|
1480
|
-
var
|
|
1481
|
-
return ((
|
|
1484
|
+
var C, a, E, y, w;
|
|
1485
|
+
const { channel: i } = me(), c = j.useMemo(() => Object.values(i.state.members || {}).find(
|
|
1486
|
+
(S) => {
|
|
1487
|
+
var v;
|
|
1488
|
+
return ((v = S.user) == null ? void 0 : v.id) && S.user.id !== i._client.userID;
|
|
1482
1489
|
}
|
|
1483
|
-
), [
|
|
1490
|
+
), [i._client.userID, i.state.members]), f = ((C = c == null ? void 0 : c.user) == null ? void 0 : C.name) || ((a = c == null ? void 0 : c.user) == null ? void 0 : a.id) || "Unknown member", d = (E = c == null ? void 0 : c.user) == null ? void 0 : E.image, m = vt(i), h = async () => {
|
|
1484
1491
|
try {
|
|
1485
|
-
|
|
1486
|
-
} catch (
|
|
1492
|
+
m ? await i.unpin() : await i.pin();
|
|
1493
|
+
} catch (b) {
|
|
1487
1494
|
console.error(
|
|
1488
1495
|
"[CustomChannelHeader] Failed to update pinned status:",
|
|
1489
|
-
|
|
1496
|
+
b
|
|
1490
1497
|
);
|
|
1491
1498
|
}
|
|
1492
1499
|
};
|
|
1493
|
-
return /* @__PURE__ */
|
|
1494
|
-
/* @__PURE__ */
|
|
1500
|
+
return /* @__PURE__ */ o("div", { className: "@container", children: [
|
|
1501
|
+
/* @__PURE__ */ o("div", { className: "grid grid-cols-[1fr_auto_1fr] w-full items-center @lg:hidden", children: [
|
|
1495
1502
|
/* @__PURE__ */ e("div", { className: "flex items-center gap-2", children: s && /* @__PURE__ */ e(
|
|
1496
1503
|
"button",
|
|
1497
1504
|
{
|
|
@@ -1500,50 +1507,55 @@ const fe = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
1500
1507
|
}),
|
|
1501
1508
|
type: "button",
|
|
1502
1509
|
"aria-label": "Back to conversations",
|
|
1503
|
-
children: /* @__PURE__ */ e(
|
|
1510
|
+
children: /* @__PURE__ */ e(et, { className: "size-5 text-black/90" })
|
|
1504
1511
|
}
|
|
1505
1512
|
) }),
|
|
1506
|
-
/* @__PURE__ */
|
|
1513
|
+
/* @__PURE__ */ o("div", { className: "flex flex-col gap-1 items-center", children: [
|
|
1507
1514
|
/* @__PURE__ */ e(
|
|
1508
1515
|
ae,
|
|
1509
1516
|
{
|
|
1510
|
-
id: ((
|
|
1511
|
-
name:
|
|
1512
|
-
image:
|
|
1513
|
-
starred: l &&
|
|
1517
|
+
id: ((y = c == null ? void 0 : c.user) == null ? void 0 : y.id) || i.id || "unknown",
|
|
1518
|
+
name: f,
|
|
1519
|
+
image: d,
|
|
1520
|
+
starred: l && m,
|
|
1521
|
+
dmAgentEnabled: u,
|
|
1514
1522
|
size: 40
|
|
1515
1523
|
}
|
|
1516
1524
|
),
|
|
1517
|
-
/* @__PURE__ */
|
|
1525
|
+
/* @__PURE__ */ o(
|
|
1518
1526
|
"button",
|
|
1519
1527
|
{
|
|
1520
1528
|
type: "button",
|
|
1521
1529
|
onClick: n,
|
|
1522
1530
|
className: "flex items-center gap-0.5 rounded-full bg-black/[0.05] px-3 py-1 text-xs font-medium text-black/90 hover:bg-black/[0.08] transition-colors",
|
|
1523
|
-
"aria-label": `View info for ${
|
|
1531
|
+
"aria-label": `View info for ${f}`,
|
|
1524
1532
|
children: [
|
|
1525
|
-
|
|
1526
|
-
/* @__PURE__ */ e(
|
|
1533
|
+
f,
|
|
1534
|
+
/* @__PURE__ */ e(tt, { className: "size-3 shrink-0" })
|
|
1527
1535
|
]
|
|
1528
1536
|
}
|
|
1529
|
-
)
|
|
1537
|
+
),
|
|
1538
|
+
u && /* @__PURE__ */ o("div", { className: "flex items-center gap-1 text-[10px] leading-3 text-black/55", children: [
|
|
1539
|
+
/* @__PURE__ */ e(Ge, { className: "size-3 shrink-0 text-black/55" }),
|
|
1540
|
+
/* @__PURE__ */ e("span", { children: ct })
|
|
1541
|
+
] })
|
|
1530
1542
|
] }),
|
|
1531
|
-
/* @__PURE__ */
|
|
1543
|
+
/* @__PURE__ */ o("div", { className: "flex justify-end items-center gap-2", children: [
|
|
1532
1544
|
l && /* @__PURE__ */ e(
|
|
1533
1545
|
"button",
|
|
1534
1546
|
{
|
|
1535
1547
|
className: fe,
|
|
1536
1548
|
onClick: h,
|
|
1537
1549
|
type: "button",
|
|
1538
|
-
"aria-label":
|
|
1550
|
+
"aria-label": m ? "Unstar conversation" : "Star conversation",
|
|
1539
1551
|
children: /* @__PURE__ */ e(
|
|
1540
1552
|
je,
|
|
1541
1553
|
{
|
|
1542
|
-
className:
|
|
1543
|
-
"text-yellow-600":
|
|
1544
|
-
"text-black/90": !
|
|
1554
|
+
className: $("size-5", {
|
|
1555
|
+
"text-yellow-600": m,
|
|
1556
|
+
"text-black/90": !m
|
|
1545
1557
|
}),
|
|
1546
|
-
weight:
|
|
1558
|
+
weight: m ? "duotone" : "regular"
|
|
1547
1559
|
}
|
|
1548
1560
|
)
|
|
1549
1561
|
}
|
|
@@ -1555,13 +1567,13 @@ const fe = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
1555
1567
|
onClick: n,
|
|
1556
1568
|
type: "button",
|
|
1557
1569
|
"aria-label": "Show info",
|
|
1558
|
-
children: /* @__PURE__ */ e(
|
|
1570
|
+
children: /* @__PURE__ */ e(st, { className: "size-5 text-black/90" })
|
|
1559
1571
|
}
|
|
1560
1572
|
)
|
|
1561
1573
|
] })
|
|
1562
1574
|
] }),
|
|
1563
|
-
/* @__PURE__ */
|
|
1564
|
-
/* @__PURE__ */
|
|
1575
|
+
/* @__PURE__ */ o("div", { className: "hidden @lg:flex items-center justify-between gap-3 min-h-12", children: [
|
|
1576
|
+
/* @__PURE__ */ o("div", { className: "flex items-center gap-4 min-w-0", children: [
|
|
1565
1577
|
s && t && /* @__PURE__ */ e(
|
|
1566
1578
|
"button",
|
|
1567
1579
|
{
|
|
@@ -1569,239 +1581,253 @@ const fe = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
1569
1581
|
onClick: t,
|
|
1570
1582
|
className: fe,
|
|
1571
1583
|
"aria-label": "Back to conversations",
|
|
1572
|
-
children: /* @__PURE__ */ e(
|
|
1584
|
+
children: /* @__PURE__ */ e(et, { className: "size-5 text-black/90" })
|
|
1573
1585
|
}
|
|
1574
1586
|
),
|
|
1575
1587
|
/* @__PURE__ */ e(
|
|
1576
1588
|
ae,
|
|
1577
1589
|
{
|
|
1578
|
-
id: ((w =
|
|
1579
|
-
name:
|
|
1580
|
-
image:
|
|
1581
|
-
starred: l &&
|
|
1590
|
+
id: ((w = c == null ? void 0 : c.user) == null ? void 0 : w.id) || i.id || "unknown",
|
|
1591
|
+
name: f,
|
|
1592
|
+
image: d,
|
|
1593
|
+
starred: l && m,
|
|
1594
|
+
dmAgentEnabled: u,
|
|
1582
1595
|
size: 40
|
|
1583
1596
|
}
|
|
1584
1597
|
),
|
|
1585
|
-
/* @__PURE__ */
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
+
/* @__PURE__ */ o("div", { className: "min-w-0", children: [
|
|
1599
|
+
r ? /* @__PURE__ */ o(
|
|
1600
|
+
"button",
|
|
1601
|
+
{
|
|
1602
|
+
type: "button",
|
|
1603
|
+
onClick: n,
|
|
1604
|
+
className: "flex items-center gap-1 font-medium text-black/90 truncate hover:text-black/70 transition-colors",
|
|
1605
|
+
"aria-label": `View info for ${f}`,
|
|
1606
|
+
children: [
|
|
1607
|
+
/* @__PURE__ */ e("span", { className: "truncate", children: f }),
|
|
1608
|
+
/* @__PURE__ */ e(tt, { className: "size-4 shrink-0" })
|
|
1609
|
+
]
|
|
1610
|
+
}
|
|
1611
|
+
) : /* @__PURE__ */ e("h1", { className: "font-medium text-black/90 truncate", children: f }),
|
|
1612
|
+
u && /* @__PURE__ */ o("div", { className: "mt-0.5 flex items-center gap-1 text-[10px] leading-3 text-black/55", children: [
|
|
1613
|
+
/* @__PURE__ */ e(Ge, { className: "size-3 shrink-0 text-black/55" }),
|
|
1614
|
+
/* @__PURE__ */ e("span", { className: "truncate", children: ct })
|
|
1615
|
+
] })
|
|
1616
|
+
] })
|
|
1598
1617
|
] }),
|
|
1599
|
-
/* @__PURE__ */
|
|
1618
|
+
/* @__PURE__ */ o("div", { className: "flex items-center gap-2", children: [
|
|
1600
1619
|
l && /* @__PURE__ */ e(
|
|
1601
1620
|
"button",
|
|
1602
1621
|
{
|
|
1603
1622
|
className: fe,
|
|
1604
1623
|
onClick: h,
|
|
1605
1624
|
type: "button",
|
|
1606
|
-
"aria-label":
|
|
1625
|
+
"aria-label": m ? "Unstar conversation" : "Star conversation",
|
|
1607
1626
|
children: /* @__PURE__ */ e(
|
|
1608
1627
|
je,
|
|
1609
1628
|
{
|
|
1610
|
-
className:
|
|
1611
|
-
"text-yellow-600":
|
|
1612
|
-
"text-black/90": !
|
|
1629
|
+
className: $("size-5", {
|
|
1630
|
+
"text-yellow-600": m,
|
|
1631
|
+
"text-black/90": !m
|
|
1613
1632
|
}),
|
|
1614
|
-
weight:
|
|
1633
|
+
weight: m ? "duotone" : "regular"
|
|
1615
1634
|
}
|
|
1616
1635
|
)
|
|
1617
1636
|
}
|
|
1618
1637
|
),
|
|
1619
|
-
|
|
1638
|
+
r && n && /* @__PURE__ */ e(
|
|
1620
1639
|
"button",
|
|
1621
1640
|
{
|
|
1622
1641
|
className: fe,
|
|
1623
1642
|
onClick: n,
|
|
1624
1643
|
type: "button",
|
|
1625
1644
|
"aria-label": "Show info",
|
|
1626
|
-
children: /* @__PURE__ */ e(
|
|
1645
|
+
children: /* @__PURE__ */ e(st, { className: "size-5 text-black/90" })
|
|
1627
1646
|
}
|
|
1628
1647
|
)
|
|
1629
1648
|
] })
|
|
1630
1649
|
] })
|
|
1631
1650
|
] });
|
|
1632
|
-
},
|
|
1651
|
+
}, Pn = ({
|
|
1633
1652
|
onBack: t,
|
|
1634
1653
|
showBackButton: s,
|
|
1635
1654
|
renderMessageInputActions: n,
|
|
1636
|
-
renderConversationFooter:
|
|
1655
|
+
renderConversationFooter: r,
|
|
1637
1656
|
onLeaveConversation: l,
|
|
1638
1657
|
onBlockParticipant: u,
|
|
1639
|
-
showDeleteConversation:
|
|
1640
|
-
onDeleteConversationClick:
|
|
1641
|
-
onBlockParticipantClick:
|
|
1642
|
-
onReportParticipantClick:
|
|
1643
|
-
showStarButton:
|
|
1644
|
-
chatbotVotingEnabled:
|
|
1645
|
-
renderChannelBanner:
|
|
1658
|
+
showDeleteConversation: i = !0,
|
|
1659
|
+
onDeleteConversationClick: c,
|
|
1660
|
+
onBlockParticipantClick: f,
|
|
1661
|
+
onReportParticipantClick: d,
|
|
1662
|
+
showStarButton: m = !1,
|
|
1663
|
+
chatbotVotingEnabled: h = !1,
|
|
1664
|
+
renderChannelBanner: C,
|
|
1646
1665
|
customProfileContent: a,
|
|
1647
|
-
customChannelActions:
|
|
1648
|
-
renderMessage:
|
|
1666
|
+
customChannelActions: E,
|
|
1667
|
+
renderMessage: y,
|
|
1668
|
+
dmAgentEnabled: w = !1
|
|
1649
1669
|
}) => {
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1670
|
+
var M, B;
|
|
1671
|
+
const { channel: b } = me(), S = J(null), v = j.useMemo(() => Object.values(b.state.members || {}).find(
|
|
1672
|
+
(G) => {
|
|
1673
|
+
var U;
|
|
1674
|
+
return ((U = G.user) == null ? void 0 : U.id) && G.user.id !== b._client.userID;
|
|
1654
1675
|
}
|
|
1655
|
-
), [
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
}, []),
|
|
1665
|
-
var
|
|
1666
|
-
(
|
|
1667
|
-
}, []),
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1676
|
+
), [b._client.userID, b.state.members]), _ = j.useMemo(() => Object.values(b.state.members || {}).find((G) => {
|
|
1677
|
+
var U;
|
|
1678
|
+
return ((U = G.user) == null ? void 0 : U.id) === b._client.userID;
|
|
1679
|
+
}), [b._client.userID, b.state.members]), L = ((M = _ == null ? void 0 : _.user) == null ? void 0 : M.is_account) ?? (_ == null ? void 0 : _.is_account), N = ((B = v == null ? void 0 : v.user) == null ? void 0 : B.is_account) ?? (v == null ? void 0 : v.is_account), g = w && L === !1 && N === !0, x = j.useMemo(() => {
|
|
1680
|
+
const A = b.data ?? {};
|
|
1681
|
+
if (A.followerStatus)
|
|
1682
|
+
return String(A.followerStatus);
|
|
1683
|
+
if (A.isFollower !== void 0)
|
|
1684
|
+
return A.isFollower ? "Subscribed to you" : "Not subscribed";
|
|
1685
|
+
}, [b.data]), R = O(() => {
|
|
1686
|
+
var A;
|
|
1687
|
+
(A = S.current) == null || A.showModal();
|
|
1688
|
+
}, []), k = O(() => {
|
|
1689
|
+
var A;
|
|
1690
|
+
(A = S.current) == null || A.close();
|
|
1691
|
+
}, []), P = O(
|
|
1692
|
+
(A) => {
|
|
1693
|
+
const { message: G } = ft("ChannelView"), U = /* @__PURE__ */ e(hn, { ...A, chatbotVotingEnabled: h });
|
|
1694
|
+
return !y || !G ? U : y(U, G);
|
|
1671
1695
|
},
|
|
1672
|
-
[
|
|
1696
|
+
[h, y]
|
|
1673
1697
|
);
|
|
1674
|
-
return /* @__PURE__ */
|
|
1675
|
-
/* @__PURE__ */ e(
|
|
1698
|
+
return /* @__PURE__ */ o(se, { children: [
|
|
1699
|
+
/* @__PURE__ */ e(hs, { overrides: { Message: P }, children: /* @__PURE__ */ o(fs, { children: [
|
|
1676
1700
|
/* @__PURE__ */ e("div", { className: "p-4", children: /* @__PURE__ */ e(
|
|
1677
|
-
|
|
1701
|
+
Rn,
|
|
1678
1702
|
{
|
|
1679
1703
|
onBack: t,
|
|
1680
1704
|
showBackButton: s,
|
|
1681
|
-
onShowInfo:
|
|
1682
|
-
canShowInfo: !!
|
|
1683
|
-
showStarButton:
|
|
1705
|
+
onShowInfo: R,
|
|
1706
|
+
canShowInfo: !!v,
|
|
1707
|
+
showStarButton: m,
|
|
1708
|
+
dmAgentEnabled: g
|
|
1684
1709
|
}
|
|
1685
1710
|
) }),
|
|
1686
|
-
|
|
1711
|
+
C == null ? void 0 : C(),
|
|
1687
1712
|
/* @__PURE__ */ e("div", { className: "flex-1 overflow-hidden relative", children: /* @__PURE__ */ e(
|
|
1688
|
-
|
|
1713
|
+
gs,
|
|
1689
1714
|
{
|
|
1690
1715
|
hideDeletedMessages: !0,
|
|
1691
1716
|
hideNewMessageSeparator: !1,
|
|
1692
1717
|
messageActions: void 0
|
|
1693
1718
|
}
|
|
1694
1719
|
) }),
|
|
1695
|
-
|
|
1720
|
+
r == null ? void 0 : r(b),
|
|
1696
1721
|
/* @__PURE__ */ e(
|
|
1697
|
-
|
|
1722
|
+
vn,
|
|
1698
1723
|
{
|
|
1699
|
-
renderActions: () => n == null ? void 0 : n(
|
|
1724
|
+
renderActions: () => n == null ? void 0 : n(b)
|
|
1700
1725
|
}
|
|
1701
1726
|
)
|
|
1702
1727
|
] }) }),
|
|
1703
1728
|
/* @__PURE__ */ e(
|
|
1704
1729
|
Zs,
|
|
1705
1730
|
{
|
|
1706
|
-
dialogRef:
|
|
1707
|
-
onClose:
|
|
1708
|
-
participant:
|
|
1709
|
-
channel:
|
|
1710
|
-
followerStatusLabel:
|
|
1731
|
+
dialogRef: S,
|
|
1732
|
+
onClose: k,
|
|
1733
|
+
participant: v,
|
|
1734
|
+
channel: b,
|
|
1735
|
+
followerStatusLabel: x,
|
|
1711
1736
|
onLeaveConversation: l,
|
|
1712
1737
|
onBlockParticipant: u,
|
|
1713
|
-
showDeleteConversation:
|
|
1714
|
-
onDeleteConversationClick:
|
|
1715
|
-
onBlockParticipantClick:
|
|
1716
|
-
onReportParticipantClick:
|
|
1738
|
+
showDeleteConversation: i,
|
|
1739
|
+
onDeleteConversationClick: c,
|
|
1740
|
+
onBlockParticipantClick: f,
|
|
1741
|
+
onReportParticipantClick: d,
|
|
1717
1742
|
customProfileContent: a,
|
|
1718
|
-
customChannelActions:
|
|
1743
|
+
customChannelActions: E
|
|
1719
1744
|
}
|
|
1720
1745
|
)
|
|
1721
1746
|
] });
|
|
1722
|
-
},
|
|
1747
|
+
}, St = j.memo(
|
|
1723
1748
|
({
|
|
1724
1749
|
channel: t,
|
|
1725
1750
|
onBack: s,
|
|
1726
1751
|
showBackButton: n = !1,
|
|
1727
|
-
renderMessageInputActions:
|
|
1752
|
+
renderMessageInputActions: r,
|
|
1728
1753
|
renderConversationFooter: l,
|
|
1729
1754
|
onLeaveConversation: u,
|
|
1730
|
-
onBlockParticipant:
|
|
1731
|
-
className:
|
|
1732
|
-
CustomChannelEmptyState:
|
|
1733
|
-
showDeleteConversation:
|
|
1734
|
-
onDeleteConversationClick:
|
|
1735
|
-
onBlockParticipantClick:
|
|
1736
|
-
onReportParticipantClick:
|
|
1755
|
+
onBlockParticipant: i,
|
|
1756
|
+
className: c,
|
|
1757
|
+
CustomChannelEmptyState: f = Mn,
|
|
1758
|
+
showDeleteConversation: d = !0,
|
|
1759
|
+
onDeleteConversationClick: m,
|
|
1760
|
+
onBlockParticipantClick: h,
|
|
1761
|
+
onReportParticipantClick: C,
|
|
1737
1762
|
dmAgentEnabled: a,
|
|
1738
|
-
messageMetadata:
|
|
1739
|
-
onMessageSent:
|
|
1740
|
-
showStarButton:
|
|
1741
|
-
chatbotVotingEnabled:
|
|
1742
|
-
renderChannelBanner:
|
|
1743
|
-
customProfileContent:
|
|
1744
|
-
customChannelActions:
|
|
1763
|
+
messageMetadata: E,
|
|
1764
|
+
onMessageSent: y,
|
|
1765
|
+
showStarButton: w = !1,
|
|
1766
|
+
chatbotVotingEnabled: b = !1,
|
|
1767
|
+
renderChannelBanner: S,
|
|
1768
|
+
customProfileContent: v,
|
|
1769
|
+
customChannelActions: _,
|
|
1745
1770
|
renderMessage: L,
|
|
1746
|
-
sendButton:
|
|
1771
|
+
sendButton: N
|
|
1747
1772
|
}) => {
|
|
1748
|
-
const
|
|
1749
|
-
async (
|
|
1750
|
-
var
|
|
1751
|
-
const P = ((
|
|
1752
|
-
...
|
|
1753
|
-
...
|
|
1754
|
-
...
|
|
1773
|
+
const g = O(
|
|
1774
|
+
async (x, R, k) => {
|
|
1775
|
+
var U;
|
|
1776
|
+
const P = ((U = t.data) == null ? void 0 : U.chatbot_paused) === !0, M = a && !P, B = {
|
|
1777
|
+
...R,
|
|
1778
|
+
...M && { silent: !0 },
|
|
1779
|
+
...E && {
|
|
1755
1780
|
metadata: {
|
|
1756
|
-
...
|
|
1757
|
-
...
|
|
1781
|
+
...R.metadata ?? {},
|
|
1782
|
+
...E
|
|
1758
1783
|
}
|
|
1759
1784
|
}
|
|
1760
|
-
},
|
|
1761
|
-
...
|
|
1762
|
-
...
|
|
1763
|
-
},
|
|
1764
|
-
return
|
|
1785
|
+
}, A = {
|
|
1786
|
+
...k,
|
|
1787
|
+
...M && { skip_push: !0 }
|
|
1788
|
+
}, G = await t.sendMessage(B, A);
|
|
1789
|
+
return y == null || y(G), G;
|
|
1765
1790
|
},
|
|
1766
|
-
[t, a,
|
|
1791
|
+
[t, a, E, y]
|
|
1767
1792
|
);
|
|
1768
1793
|
return /* @__PURE__ */ e(
|
|
1769
1794
|
"div",
|
|
1770
1795
|
{
|
|
1771
|
-
className:
|
|
1796
|
+
className: $(
|
|
1772
1797
|
"messaging-channel-view h-full flex flex-col",
|
|
1773
|
-
|
|
1798
|
+
c
|
|
1774
1799
|
),
|
|
1775
1800
|
children: /* @__PURE__ */ e(
|
|
1776
|
-
|
|
1801
|
+
ms,
|
|
1777
1802
|
{
|
|
1778
1803
|
channel: t,
|
|
1779
|
-
MessageSystem:
|
|
1780
|
-
EmptyStateIndicator:
|
|
1804
|
+
MessageSystem: kn,
|
|
1805
|
+
EmptyStateIndicator: f,
|
|
1781
1806
|
LoadingIndicator: De,
|
|
1782
|
-
DateSeparator:
|
|
1783
|
-
TypingIndicator:
|
|
1784
|
-
doSendMessageRequest:
|
|
1785
|
-
...
|
|
1807
|
+
DateSeparator: Ks,
|
|
1808
|
+
TypingIndicator: Tn,
|
|
1809
|
+
doSendMessageRequest: g,
|
|
1810
|
+
...N ? { SendButton: N } : {},
|
|
1786
1811
|
children: /* @__PURE__ */ e(
|
|
1787
|
-
|
|
1812
|
+
Pn,
|
|
1788
1813
|
{
|
|
1789
1814
|
onBack: s,
|
|
1790
1815
|
showBackButton: n,
|
|
1791
|
-
renderMessageInputActions:
|
|
1816
|
+
renderMessageInputActions: r,
|
|
1792
1817
|
renderConversationFooter: l,
|
|
1793
1818
|
onLeaveConversation: u,
|
|
1794
|
-
onBlockParticipant:
|
|
1795
|
-
CustomChannelEmptyState:
|
|
1796
|
-
showDeleteConversation:
|
|
1797
|
-
onDeleteConversationClick:
|
|
1798
|
-
onBlockParticipantClick:
|
|
1799
|
-
onReportParticipantClick:
|
|
1800
|
-
showStarButton:
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1819
|
+
onBlockParticipant: i,
|
|
1820
|
+
CustomChannelEmptyState: f,
|
|
1821
|
+
showDeleteConversation: d,
|
|
1822
|
+
onDeleteConversationClick: m,
|
|
1823
|
+
onBlockParticipantClick: h,
|
|
1824
|
+
onReportParticipantClick: C,
|
|
1825
|
+
showStarButton: w,
|
|
1826
|
+
dmAgentEnabled: a,
|
|
1827
|
+
chatbotVotingEnabled: b,
|
|
1828
|
+
renderChannelBanner: S,
|
|
1829
|
+
customProfileContent: v,
|
|
1830
|
+
customChannelActions: _,
|
|
1805
1831
|
renderMessage: L
|
|
1806
1832
|
}
|
|
1807
1833
|
)
|
|
@@ -1811,16 +1837,16 @@ const fe = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
1811
1837
|
);
|
|
1812
1838
|
}
|
|
1813
1839
|
);
|
|
1814
|
-
|
|
1815
|
-
function
|
|
1840
|
+
St.displayName = "ChannelView";
|
|
1841
|
+
function Ln({
|
|
1816
1842
|
searchQuery: t,
|
|
1817
1843
|
setSearchQuery: s,
|
|
1818
1844
|
placeholder: n
|
|
1819
1845
|
}) {
|
|
1820
|
-
const
|
|
1821
|
-
return /* @__PURE__ */
|
|
1846
|
+
const r = J(null);
|
|
1847
|
+
return /* @__PURE__ */ o("div", { className: "relative", children: [
|
|
1822
1848
|
/* @__PURE__ */ e(
|
|
1823
|
-
|
|
1849
|
+
Ns,
|
|
1824
1850
|
{
|
|
1825
1851
|
className: "pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-stone",
|
|
1826
1852
|
weight: "bold"
|
|
@@ -1829,7 +1855,7 @@ function Pn({
|
|
|
1829
1855
|
/* @__PURE__ */ e(
|
|
1830
1856
|
"input",
|
|
1831
1857
|
{
|
|
1832
|
-
ref:
|
|
1858
|
+
ref: r,
|
|
1833
1859
|
type: "text",
|
|
1834
1860
|
placeholder: n,
|
|
1835
1861
|
value: t,
|
|
@@ -1838,12 +1864,12 @@ function Pn({
|
|
|
1838
1864
|
}
|
|
1839
1865
|
),
|
|
1840
1866
|
t && /* @__PURE__ */ e(
|
|
1841
|
-
|
|
1867
|
+
Ct,
|
|
1842
1868
|
{
|
|
1843
1869
|
label: "Clear search",
|
|
1844
1870
|
onClick: () => {
|
|
1845
1871
|
var l;
|
|
1846
|
-
s(""), (l =
|
|
1872
|
+
s(""), (l = r.current) == null || l.focus();
|
|
1847
1873
|
},
|
|
1848
1874
|
className: "absolute right-3 top-1/2 -translate-y-1/2 p-1 text-stone hover:text-charcoal",
|
|
1849
1875
|
children: /* @__PURE__ */ e(Re, { className: "h-4 w-4", weight: "bold" })
|
|
@@ -1851,146 +1877,146 @@ function Pn({
|
|
|
1851
1877
|
)
|
|
1852
1878
|
] });
|
|
1853
1879
|
}
|
|
1854
|
-
const
|
|
1880
|
+
const Fn = ({
|
|
1855
1881
|
participantSource: t,
|
|
1856
1882
|
onSelectParticipant: s,
|
|
1857
1883
|
onClose: n,
|
|
1858
|
-
existingParticipantIds:
|
|
1884
|
+
existingParticipantIds: r = /* @__PURE__ */ new Set(),
|
|
1859
1885
|
participantLabel: l = "participants",
|
|
1860
1886
|
searchPlaceholder: u = "Search participants...",
|
|
1861
|
-
className:
|
|
1887
|
+
className: i
|
|
1862
1888
|
}) => {
|
|
1863
|
-
const { debug:
|
|
1889
|
+
const { debug: c } = Pe(), [f, d] = T(""), [m, h] = T([]), [C, a] = T(!1), [E, y] = T(null), [w, b] = T(
|
|
1864
1890
|
null
|
|
1865
|
-
),
|
|
1866
|
-
|
|
1867
|
-
|
|
1868
|
-
}, [t]),
|
|
1891
|
+
), S = J(!1);
|
|
1892
|
+
Z(() => {
|
|
1893
|
+
S.current = !1;
|
|
1894
|
+
}, [t]), Z(() => {
|
|
1869
1895
|
if (t.loading) {
|
|
1870
|
-
|
|
1896
|
+
c && console.log(
|
|
1871
1897
|
"[ParticipantPicker] Waiting for participant source to finish loading..."
|
|
1872
1898
|
);
|
|
1873
1899
|
return;
|
|
1874
1900
|
}
|
|
1875
|
-
if (
|
|
1901
|
+
if (S.current) return;
|
|
1876
1902
|
(async () => {
|
|
1877
|
-
|
|
1903
|
+
c && console.log("[ParticipantPicker] Loading initial participants..."), a(!0), y(null);
|
|
1878
1904
|
try {
|
|
1879
|
-
const
|
|
1905
|
+
const g = await t.loadParticipants({
|
|
1880
1906
|
search: "",
|
|
1881
1907
|
// Load all participants initially
|
|
1882
1908
|
limit: 100
|
|
1883
1909
|
});
|
|
1884
|
-
|
|
1910
|
+
h(g.participants), S.current = !0, c && console.log(
|
|
1885
1911
|
"[ParticipantPicker] Participants loaded successfully:",
|
|
1886
|
-
|
|
1912
|
+
g.participants.length
|
|
1887
1913
|
);
|
|
1888
|
-
} catch (
|
|
1889
|
-
const
|
|
1890
|
-
|
|
1914
|
+
} catch (g) {
|
|
1915
|
+
const x = g instanceof Error ? g.message : "Failed to load participants";
|
|
1916
|
+
y(x), console.error("[ParticipantPicker] Failed to load participants:", g);
|
|
1891
1917
|
} finally {
|
|
1892
1918
|
a(!1);
|
|
1893
1919
|
}
|
|
1894
1920
|
})();
|
|
1895
|
-
}, [t,
|
|
1896
|
-
const
|
|
1897
|
-
var
|
|
1898
|
-
if (!
|
|
1899
|
-
const
|
|
1900
|
-
return
|
|
1901
|
-
}),
|
|
1902
|
-
async (
|
|
1903
|
-
if (!
|
|
1904
|
-
|
|
1921
|
+
}, [t, c]);
|
|
1922
|
+
const v = m.filter((N) => !r.has(N.id)).filter((N) => {
|
|
1923
|
+
var x;
|
|
1924
|
+
if (!f) return !0;
|
|
1925
|
+
const g = f.toLowerCase();
|
|
1926
|
+
return N.name.toLowerCase().includes(g) || ((x = N.email) == null ? void 0 : x.toLowerCase().includes(g)) || !1;
|
|
1927
|
+
}), _ = O(
|
|
1928
|
+
async (N) => {
|
|
1929
|
+
if (!w) {
|
|
1930
|
+
b(N.id);
|
|
1905
1931
|
try {
|
|
1906
|
-
await s(
|
|
1907
|
-
} catch (
|
|
1908
|
-
console.error("[ParticipantPicker] Failed to start chat:",
|
|
1932
|
+
await s(N);
|
|
1933
|
+
} catch (g) {
|
|
1934
|
+
console.error("[ParticipantPicker] Failed to start chat:", g), b(null);
|
|
1909
1935
|
}
|
|
1910
1936
|
}
|
|
1911
1937
|
},
|
|
1912
|
-
[s,
|
|
1913
|
-
), L = (
|
|
1914
|
-
(
|
|
1938
|
+
[s, w]
|
|
1939
|
+
), L = (N, g) => {
|
|
1940
|
+
(N.key === "Enter" || N.key === " ") && (N.preventDefault(), _(g));
|
|
1915
1941
|
};
|
|
1916
|
-
return /* @__PURE__ */
|
|
1917
|
-
/* @__PURE__ */
|
|
1918
|
-
/* @__PURE__ */
|
|
1942
|
+
return /* @__PURE__ */ o("div", { className: $("flex flex-col h-full", i), children: [
|
|
1943
|
+
/* @__PURE__ */ o("div", { className: "px-4 py-4 border-b border-sand bg-chalk", children: [
|
|
1944
|
+
/* @__PURE__ */ o("div", { className: "flex items-center justify-between mb-3", children: [
|
|
1919
1945
|
/* @__PURE__ */ e("h2", { className: "text-lg font-semibold text-charcoal", children: "Start a new Conversation" }),
|
|
1920
|
-
/* @__PURE__ */ e(
|
|
1946
|
+
/* @__PURE__ */ e(_t, { onClick: n })
|
|
1921
1947
|
] }),
|
|
1922
|
-
/* @__PURE__ */
|
|
1948
|
+
/* @__PURE__ */ o("p", { className: "text-xs text-stone mb-3", children: [
|
|
1923
1949
|
"Select a ",
|
|
1924
1950
|
l.slice(0, -1),
|
|
1925
1951
|
" to start messaging (",
|
|
1926
|
-
|
|
1952
|
+
v.length,
|
|
1927
1953
|
" available)",
|
|
1928
1954
|
t.totalCount !== void 0 && ` • ${t.totalCount} ${l} total`
|
|
1929
1955
|
] }),
|
|
1930
1956
|
/* @__PURE__ */ e(
|
|
1931
|
-
|
|
1957
|
+
Ln,
|
|
1932
1958
|
{
|
|
1933
|
-
searchQuery:
|
|
1934
|
-
setSearchQuery:
|
|
1959
|
+
searchQuery: f,
|
|
1960
|
+
setSearchQuery: d,
|
|
1935
1961
|
placeholder: u
|
|
1936
1962
|
}
|
|
1937
1963
|
)
|
|
1938
1964
|
] }),
|
|
1939
|
-
|
|
1965
|
+
E && /* @__PURE__ */ o("div", { className: "p-4 text-sm text-danger bg-danger-alt", children: [
|
|
1940
1966
|
"Error loading ",
|
|
1941
1967
|
l,
|
|
1942
1968
|
": ",
|
|
1943
|
-
|
|
1969
|
+
E
|
|
1944
1970
|
] }),
|
|
1945
|
-
/* @__PURE__ */ e("div", { className: "flex-1 overflow-auto", children:
|
|
1971
|
+
/* @__PURE__ */ e("div", { className: "flex-1 overflow-auto", children: C && v.length === 0 ? /* @__PURE__ */ e("div", { className: "h-32 flex items-center justify-center", children: /* @__PURE__ */ o("div", { className: "flex items-center space-x-2", children: [
|
|
1946
1972
|
/* @__PURE__ */ e("div", { className: "w-4 h-4 animate-spin rounded-full border-2 border-primary border-t-transparent" }),
|
|
1947
|
-
/* @__PURE__ */
|
|
1973
|
+
/* @__PURE__ */ o("span", { className: "text-sm text-stone", children: [
|
|
1948
1974
|
"Loading ",
|
|
1949
1975
|
l,
|
|
1950
1976
|
"..."
|
|
1951
1977
|
] })
|
|
1952
|
-
] }) }) :
|
|
1953
|
-
/* @__PURE__ */ e("div", { className: "mx-auto mb-4 flex h-16 w-16 items-center justify-center rounded-full bg-sand", children: /* @__PURE__ */ e(
|
|
1954
|
-
/* @__PURE__ */ e("h3", { className: "text-sm font-semibold text-charcoal mb-2", children:
|
|
1955
|
-
/* @__PURE__ */ e("p", { className: "text-xs text-stone", children:
|
|
1956
|
-
] }) : /* @__PURE__ */
|
|
1957
|
-
|
|
1958
|
-
const
|
|
1978
|
+
] }) }) : v.length === 0 ? /* @__PURE__ */ o("div", { className: "p-6 text-center", children: [
|
|
1979
|
+
/* @__PURE__ */ e("div", { className: "mx-auto mb-4 flex h-16 w-16 items-center justify-center rounded-full bg-sand", children: /* @__PURE__ */ e(nt, { className: "h-8 w-8 text-charcoal" }) }),
|
|
1980
|
+
/* @__PURE__ */ e("h3", { className: "text-sm font-semibold text-charcoal mb-2", children: f ? `No ${l} found` : m.length > 0 ? `Already chatting with all ${l}` : `No ${l} yet` }),
|
|
1981
|
+
/* @__PURE__ */ e("p", { className: "text-xs text-stone", children: f ? "Try a different search term" : m.length > 0 ? `You have existing conversations with all your ${l}` : `${l.charAt(0).toUpperCase() + l.slice(1)} will appear here` })
|
|
1982
|
+
] }) : /* @__PURE__ */ o("ul", { className: "space-y-0", children: [
|
|
1983
|
+
v.map((N) => {
|
|
1984
|
+
const g = N.name || N.email || N.id, x = N.email && N.name ? N.email : N.phone;
|
|
1959
1985
|
return /* @__PURE__ */ e("li", { children: /* @__PURE__ */ e(
|
|
1960
1986
|
"button",
|
|
1961
1987
|
{
|
|
1962
1988
|
type: "button",
|
|
1963
|
-
onClick: () =>
|
|
1964
|
-
onKeyDown: (
|
|
1989
|
+
onClick: () => _(N),
|
|
1990
|
+
onKeyDown: (R) => L(R, N),
|
|
1965
1991
|
className: "w-full px-4 py-3 hover:bg-sand transition-colors border-b border-sand text-left focus-ring",
|
|
1966
|
-
children: /* @__PURE__ */
|
|
1967
|
-
/* @__PURE__ */
|
|
1992
|
+
children: /* @__PURE__ */ o("div", { className: "flex items-center justify-between", children: [
|
|
1993
|
+
/* @__PURE__ */ o("div", { className: "flex items-center space-x-3 flex-1 min-w-0", children: [
|
|
1968
1994
|
/* @__PURE__ */ e(
|
|
1969
1995
|
ae,
|
|
1970
1996
|
{
|
|
1971
|
-
id:
|
|
1972
|
-
name:
|
|
1973
|
-
image:
|
|
1997
|
+
id: N.id,
|
|
1998
|
+
name: g,
|
|
1999
|
+
image: N.image,
|
|
1974
2000
|
size: 40
|
|
1975
2001
|
}
|
|
1976
2002
|
),
|
|
1977
|
-
/* @__PURE__ */
|
|
1978
|
-
/* @__PURE__ */ e("h4", { className: "text-sm font-medium text-charcoal truncate", children:
|
|
1979
|
-
|
|
2003
|
+
/* @__PURE__ */ o("div", { className: "flex-1 min-w-0", children: [
|
|
2004
|
+
/* @__PURE__ */ e("h4", { className: "text-sm font-medium text-charcoal truncate", children: g }),
|
|
2005
|
+
x && /* @__PURE__ */ e("p", { className: "text-xs text-stone truncate", children: x })
|
|
1980
2006
|
] })
|
|
1981
2007
|
] }),
|
|
1982
|
-
/* @__PURE__ */ e("div", { className: "flex-shrink-0", children:
|
|
2008
|
+
/* @__PURE__ */ e("div", { className: "flex-shrink-0", children: w === N.id ? /* @__PURE__ */ e(ke, { className: "h-5 w-5 text-primary animate-spin" }) : /* @__PURE__ */ e(nt, { className: "h-5 w-5 text-stone" }) })
|
|
1983
2009
|
] })
|
|
1984
2010
|
}
|
|
1985
|
-
) },
|
|
2011
|
+
) }, N.id);
|
|
1986
2012
|
}),
|
|
1987
|
-
|
|
2013
|
+
C && /* @__PURE__ */ e("li", { className: "p-4 flex justify-center", children: /* @__PURE__ */ o("div", { className: "flex items-center space-x-2", children: [
|
|
1988
2014
|
/* @__PURE__ */ e("div", { className: "w-4 h-4 animate-spin rounded-full border-2 border-primary border-t-transparent" }),
|
|
1989
2015
|
/* @__PURE__ */ e("span", { className: "text-sm text-stone", children: "Loading more..." })
|
|
1990
2016
|
] }) })
|
|
1991
2017
|
] }) })
|
|
1992
2018
|
] });
|
|
1993
|
-
},
|
|
2019
|
+
}, An = ({ className: t }) => /* @__PURE__ */ o(
|
|
1994
2020
|
"svg",
|
|
1995
2021
|
{
|
|
1996
2022
|
width: "140",
|
|
@@ -2000,7 +2026,7 @@ const Ln = ({
|
|
|
2000
2026
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2001
2027
|
className: t,
|
|
2002
2028
|
children: [
|
|
2003
|
-
/* @__PURE__ */
|
|
2029
|
+
/* @__PURE__ */ o("g", { clipPath: "url(#clip0_empty_state)", children: [
|
|
2004
2030
|
/* @__PURE__ */ e(
|
|
2005
2031
|
"path",
|
|
2006
2032
|
{
|
|
@@ -2029,7 +2055,7 @@ const Ln = ({
|
|
|
2029
2055
|
fill: "white"
|
|
2030
2056
|
}
|
|
2031
2057
|
),
|
|
2032
|
-
/* @__PURE__ */
|
|
2058
|
+
/* @__PURE__ */ o("g", { filter: "url(#filter0_empty_state)", children: [
|
|
2033
2059
|
/* @__PURE__ */ e(
|
|
2034
2060
|
"path",
|
|
2035
2061
|
{
|
|
@@ -2069,8 +2095,8 @@ const Ln = ({
|
|
|
2069
2095
|
}
|
|
2070
2096
|
)
|
|
2071
2097
|
] }),
|
|
2072
|
-
/* @__PURE__ */
|
|
2073
|
-
/* @__PURE__ */
|
|
2098
|
+
/* @__PURE__ */ o("defs", { children: [
|
|
2099
|
+
/* @__PURE__ */ o(
|
|
2074
2100
|
"filter",
|
|
2075
2101
|
{
|
|
2076
2102
|
id: "filter0_empty_state",
|
|
@@ -2124,17 +2150,17 @@ const Ln = ({
|
|
|
2124
2150
|
] })
|
|
2125
2151
|
]
|
|
2126
2152
|
}
|
|
2127
|
-
),
|
|
2128
|
-
({ hasChannels: t, channelsLoaded: s }) => /* @__PURE__ */ e("div", { className: "messaging-empty-state flex items-center justify-center h-full p-8 text-balance", children: /* @__PURE__ */
|
|
2129
|
-
/* @__PURE__ */ e(
|
|
2130
|
-
s && !t && /* @__PURE__ */
|
|
2153
|
+
), kt = j.memo(
|
|
2154
|
+
({ hasChannels: t, channelsLoaded: s }) => /* @__PURE__ */ e("div", { className: "messaging-empty-state flex items-center justify-center h-full p-8 text-balance", children: /* @__PURE__ */ o("div", { className: "flex flex-col items-center max-w-sm text-center", children: [
|
|
2155
|
+
/* @__PURE__ */ e(An, {}),
|
|
2156
|
+
s && !t && /* @__PURE__ */ o("div", { className: "mt-8", children: [
|
|
2131
2157
|
/* @__PURE__ */ e("h2", { className: "font-medium text-black text-[18px] mb-2", children: "Your inbox is empty" }),
|
|
2132
2158
|
/* @__PURE__ */ e("p", { className: "text-[#676B5F] text-sm mb-6", children: "Share with your followers to start receiving messages" })
|
|
2133
2159
|
] })
|
|
2134
2160
|
] }) })
|
|
2135
2161
|
);
|
|
2136
|
-
|
|
2137
|
-
const Te =
|
|
2162
|
+
kt.displayName = "EmptyState";
|
|
2163
|
+
const Te = j.memo(({ message: t, onBack: s }) => /* @__PURE__ */ e("div", { className: "messaging-error-state flex items-center justify-center h-full p-8", children: /* @__PURE__ */ o("div", { className: "text-center max-w-sm", children: [
|
|
2138
2164
|
/* @__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: "⚠️" }) }),
|
|
2139
2165
|
/* @__PURE__ */ e("h2", { className: "font-semibold text-charcoal mb-2", children: "Oops!" }),
|
|
2140
2166
|
/* @__PURE__ */ e("p", { className: "text-stone text-sm mb-6", children: t }),
|
|
@@ -2149,49 +2175,49 @@ const Te = z.memo(({ message: t, onBack: s }) => /* @__PURE__ */ e("div", { clas
|
|
|
2149
2175
|
)
|
|
2150
2176
|
] }) }));
|
|
2151
2177
|
Te.displayName = "ErrorState";
|
|
2152
|
-
const
|
|
2178
|
+
const oa = ({
|
|
2153
2179
|
capabilities: t = {},
|
|
2154
2180
|
className: s,
|
|
2155
2181
|
renderMessageInputActions: n,
|
|
2156
|
-
renderConversationFooter:
|
|
2182
|
+
renderConversationFooter: r,
|
|
2157
2183
|
onChannelSelect: l,
|
|
2158
2184
|
onParticipantSelect: u,
|
|
2159
|
-
initialParticipantFilter:
|
|
2160
|
-
initialParticipantData:
|
|
2161
|
-
CustomChannelEmptyState:
|
|
2162
|
-
showChannelList:
|
|
2163
|
-
filters:
|
|
2164
|
-
channelRenderFilterFn:
|
|
2165
|
-
channelListCustomEmptyStateIndicator:
|
|
2185
|
+
initialParticipantFilter: i,
|
|
2186
|
+
initialParticipantData: c,
|
|
2187
|
+
CustomChannelEmptyState: f,
|
|
2188
|
+
showChannelList: d = !0,
|
|
2189
|
+
filters: m,
|
|
2190
|
+
channelRenderFilterFn: h,
|
|
2191
|
+
channelListCustomEmptyStateIndicator: C,
|
|
2166
2192
|
onDeleteConversationClick: a,
|
|
2167
|
-
onBlockParticipantClick:
|
|
2168
|
-
onReportParticipantClick:
|
|
2169
|
-
dmAgentEnabled:
|
|
2170
|
-
messageMetadata:
|
|
2171
|
-
onMessageSent:
|
|
2172
|
-
showStarButton:
|
|
2173
|
-
chatbotVotingEnabled:
|
|
2193
|
+
onBlockParticipantClick: E,
|
|
2194
|
+
onReportParticipantClick: y,
|
|
2195
|
+
dmAgentEnabled: w,
|
|
2196
|
+
messageMetadata: b,
|
|
2197
|
+
onMessageSent: S,
|
|
2198
|
+
showStarButton: v = !1,
|
|
2199
|
+
chatbotVotingEnabled: _ = !1,
|
|
2174
2200
|
renderMessagePreview: L,
|
|
2175
|
-
renderChannelBanner:
|
|
2176
|
-
customProfileContent:
|
|
2177
|
-
customChannelActions:
|
|
2178
|
-
renderMessage:
|
|
2179
|
-
sendButton:
|
|
2201
|
+
renderChannelBanner: N,
|
|
2202
|
+
customProfileContent: g,
|
|
2203
|
+
customChannelActions: x,
|
|
2204
|
+
renderMessage: R,
|
|
2205
|
+
sendButton: k
|
|
2180
2206
|
}) => {
|
|
2181
2207
|
const {
|
|
2182
2208
|
service: P,
|
|
2183
|
-
client:
|
|
2209
|
+
client: M,
|
|
2184
2210
|
isConnected: B,
|
|
2185
|
-
isLoading:
|
|
2186
|
-
error:
|
|
2187
|
-
refreshConnection:
|
|
2211
|
+
isLoading: A,
|
|
2212
|
+
error: G,
|
|
2213
|
+
refreshConnection: U,
|
|
2188
2214
|
debug: F
|
|
2189
|
-
} =
|
|
2215
|
+
} = As(), [W, K] = T(null), [re, Q] = T(!1), [p, I] = T(!1), [z, V] = T(!1), [ee, le] = T(/* @__PURE__ */ new Set()), [xe, Le] = T(0), [q, te] = T(!1), [pe, ie] = T(null), he = J(null), {
|
|
2190
2216
|
participantSource: oe,
|
|
2191
2217
|
participantLabel: ve = "participants",
|
|
2192
2218
|
showDeleteConversation: ge = !0
|
|
2193
|
-
} = t, we =
|
|
2194
|
-
const D =
|
|
2219
|
+
} = t, we = j.useMemo(() => {
|
|
2220
|
+
const D = M == null ? void 0 : M.userID;
|
|
2195
2221
|
return {
|
|
2196
2222
|
...{
|
|
2197
2223
|
type: "messaging",
|
|
@@ -2201,84 +2227,84 @@ const la = ({
|
|
|
2201
2227
|
hidden: !1
|
|
2202
2228
|
}
|
|
2203
2229
|
},
|
|
2204
|
-
...
|
|
2230
|
+
...m
|
|
2205
2231
|
};
|
|
2206
|
-
}, [
|
|
2207
|
-
if (!
|
|
2208
|
-
const D =
|
|
2232
|
+
}, [m, M == null ? void 0 : M.userID]), ce = J(null), ne = O(async () => {
|
|
2233
|
+
if (!M || !B) return;
|
|
2234
|
+
const D = M.userID;
|
|
2209
2235
|
if (D)
|
|
2210
2236
|
try {
|
|
2211
2237
|
F && console.log("[MessagingShell] Syncing channels for user:", D);
|
|
2212
|
-
const
|
|
2238
|
+
const X = await M.queryChannels(
|
|
2213
2239
|
{
|
|
2214
2240
|
type: "messaging",
|
|
2215
2241
|
members: { $in: [D] }
|
|
2216
2242
|
},
|
|
2217
2243
|
{},
|
|
2218
2244
|
{ limit: 100 }
|
|
2219
|
-
),
|
|
2220
|
-
|
|
2221
|
-
const Fe =
|
|
2222
|
-
Object.values(Fe).forEach((
|
|
2223
|
-
var
|
|
2224
|
-
const Ae = (
|
|
2225
|
-
Ae && Ae !== D &&
|
|
2245
|
+
), H = /* @__PURE__ */ new Set();
|
|
2246
|
+
X.forEach((Y) => {
|
|
2247
|
+
const Fe = Y.state.members;
|
|
2248
|
+
Object.values(Fe).forEach((Rt) => {
|
|
2249
|
+
var Ke;
|
|
2250
|
+
const Ae = (Ke = Rt.user) == null ? void 0 : Ke.id;
|
|
2251
|
+
Ae && Ae !== D && H.add(Ae);
|
|
2226
2252
|
});
|
|
2227
|
-
}), le((
|
|
2228
|
-
channelCount:
|
|
2229
|
-
memberCount:
|
|
2253
|
+
}), le((Y) => Y.size === H.size && [...Y].every((Fe) => H.has(Fe)) ? Y : H), Q(X.length > 0), I(!0), ce.current = D, F && console.log("[MessagingShell] Channels synced successfully:", {
|
|
2254
|
+
channelCount: X.length,
|
|
2255
|
+
memberCount: H.size
|
|
2230
2256
|
});
|
|
2231
|
-
} catch (
|
|
2232
|
-
console.error("[MessagingShell] Failed to sync channels:",
|
|
2257
|
+
} catch (X) {
|
|
2258
|
+
console.error("[MessagingShell] Failed to sync channels:", X);
|
|
2233
2259
|
}
|
|
2234
|
-
}, [
|
|
2235
|
-
|
|
2236
|
-
if (!
|
|
2237
|
-
const D =
|
|
2260
|
+
}, [M, B, F]);
|
|
2261
|
+
Z(() => {
|
|
2262
|
+
if (!M || !B) return;
|
|
2263
|
+
const D = M.userID;
|
|
2238
2264
|
D && ce.current !== D && ne();
|
|
2239
|
-
}, [
|
|
2240
|
-
if (!
|
|
2265
|
+
}, [M, B, ne]), Z(() => {
|
|
2266
|
+
if (!i || !M || !B) return;
|
|
2241
2267
|
(async () => {
|
|
2242
|
-
const
|
|
2243
|
-
if (
|
|
2268
|
+
const X = M.userID;
|
|
2269
|
+
if (X)
|
|
2244
2270
|
try {
|
|
2245
2271
|
F && console.log(
|
|
2246
2272
|
"[MessagingShell] Loading initial conversation with:",
|
|
2247
|
-
|
|
2273
|
+
i
|
|
2248
2274
|
);
|
|
2249
|
-
const
|
|
2275
|
+
const H = await M.queryChannels(
|
|
2250
2276
|
{
|
|
2251
2277
|
type: "messaging",
|
|
2252
|
-
members: { $eq: [
|
|
2278
|
+
members: { $eq: [X, i] }
|
|
2253
2279
|
},
|
|
2254
2280
|
{},
|
|
2255
2281
|
{ limit: 1 }
|
|
2256
2282
|
);
|
|
2257
|
-
if (
|
|
2258
|
-
|
|
2283
|
+
if (H.length > 0)
|
|
2284
|
+
K(H[0]), te(!0), ie(null), l && l(H[0]), F && console.log(
|
|
2259
2285
|
"[MessagingShell] Initial conversation loaded:",
|
|
2260
|
-
|
|
2286
|
+
H[0].id
|
|
2261
2287
|
);
|
|
2262
|
-
else if (
|
|
2288
|
+
else if (c && P) {
|
|
2263
2289
|
F && console.log(
|
|
2264
2290
|
"[MessagingShell] No conversation found, creating one for:",
|
|
2265
|
-
|
|
2291
|
+
c
|
|
2266
2292
|
);
|
|
2267
2293
|
try {
|
|
2268
|
-
const
|
|
2269
|
-
id:
|
|
2270
|
-
name:
|
|
2271
|
-
email:
|
|
2272
|
-
phone:
|
|
2294
|
+
const Y = await P.startChannelWithParticipant({
|
|
2295
|
+
id: c.id,
|
|
2296
|
+
name: c.name,
|
|
2297
|
+
email: c.email,
|
|
2298
|
+
phone: c.phone
|
|
2273
2299
|
});
|
|
2274
|
-
|
|
2300
|
+
K(Y), te(!0), ie(null), l && l(Y), F && console.log(
|
|
2275
2301
|
"[MessagingShell] Channel created and loaded:",
|
|
2276
|
-
|
|
2302
|
+
Y.id
|
|
2277
2303
|
);
|
|
2278
|
-
} catch (
|
|
2304
|
+
} catch (Y) {
|
|
2279
2305
|
console.error(
|
|
2280
2306
|
"[MessagingShell] Failed to create conversation:",
|
|
2281
|
-
|
|
2307
|
+
Y
|
|
2282
2308
|
), ie("Failed to create conversation");
|
|
2283
2309
|
}
|
|
2284
2310
|
} else
|
|
@@ -2286,112 +2312,112 @@ const la = ({
|
|
|
2286
2312
|
"No conversation found with this account"
|
|
2287
2313
|
), F && console.log(
|
|
2288
2314
|
"[MessagingShell] No conversation found for:",
|
|
2289
|
-
|
|
2315
|
+
i
|
|
2290
2316
|
);
|
|
2291
|
-
} catch (
|
|
2317
|
+
} catch (H) {
|
|
2292
2318
|
console.error(
|
|
2293
2319
|
"[MessagingShell] Failed to load initial conversation:",
|
|
2294
|
-
|
|
2320
|
+
H
|
|
2295
2321
|
), ie("Failed to load conversation");
|
|
2296
2322
|
}
|
|
2297
2323
|
})();
|
|
2298
2324
|
}, [
|
|
2299
|
-
|
|
2300
|
-
|
|
2301
|
-
|
|
2325
|
+
i,
|
|
2326
|
+
c,
|
|
2327
|
+
M,
|
|
2302
2328
|
B,
|
|
2303
2329
|
P,
|
|
2304
2330
|
F,
|
|
2305
2331
|
l
|
|
2306
2332
|
]);
|
|
2307
|
-
const Ne =
|
|
2333
|
+
const Ne = O(
|
|
2308
2334
|
(D) => {
|
|
2309
|
-
|
|
2335
|
+
K(D), l == null || l(D);
|
|
2310
2336
|
},
|
|
2311
2337
|
[l]
|
|
2312
|
-
), ye =
|
|
2313
|
-
|
|
2314
|
-
}, [
|
|
2338
|
+
), ye = O(() => {
|
|
2339
|
+
q || K(null);
|
|
2340
|
+
}, [q]), Ce = O(
|
|
2315
2341
|
async (D) => {
|
|
2316
|
-
var
|
|
2342
|
+
var X;
|
|
2317
2343
|
if (P)
|
|
2318
2344
|
try {
|
|
2319
2345
|
F && console.log(
|
|
2320
2346
|
"[MessagingShell] Starting conversation with:",
|
|
2321
2347
|
D.id
|
|
2322
2348
|
);
|
|
2323
|
-
const
|
|
2349
|
+
const H = await P.startChannelWithParticipant({
|
|
2324
2350
|
id: D.id,
|
|
2325
2351
|
name: D.name,
|
|
2326
2352
|
email: D.email,
|
|
2327
2353
|
phone: D.phone
|
|
2328
2354
|
});
|
|
2329
2355
|
try {
|
|
2330
|
-
await
|
|
2331
|
-
} catch (
|
|
2332
|
-
console.warn("[MessagingShell] Failed to unhide channel:",
|
|
2356
|
+
await H.show();
|
|
2357
|
+
} catch (Y) {
|
|
2358
|
+
console.warn("[MessagingShell] Failed to unhide channel:", Y);
|
|
2333
2359
|
}
|
|
2334
|
-
|
|
2335
|
-
} catch (
|
|
2336
|
-
console.error("[MessagingShell] Failed to start conversation:",
|
|
2360
|
+
K(H), V(!1), (X = he.current) == null || X.close(), u == null || u(D);
|
|
2361
|
+
} catch (H) {
|
|
2362
|
+
console.error("[MessagingShell] Failed to start conversation:", H);
|
|
2337
2363
|
}
|
|
2338
2364
|
},
|
|
2339
2365
|
[P, u, F]
|
|
2340
|
-
), de =
|
|
2366
|
+
), de = O(() => {
|
|
2341
2367
|
var D;
|
|
2342
|
-
|
|
2343
|
-
}, []), _e =
|
|
2368
|
+
V(!1), (D = he.current) == null || D.close();
|
|
2369
|
+
}, []), _e = O(
|
|
2344
2370
|
(D) => {
|
|
2345
2371
|
D.target === he.current && de();
|
|
2346
2372
|
},
|
|
2347
2373
|
[de]
|
|
2348
|
-
), Ee =
|
|
2374
|
+
), Ee = O(
|
|
2349
2375
|
async (D) => {
|
|
2350
|
-
F && console.log("[MessagingShell] Leaving conversation:", D.id),
|
|
2376
|
+
F && console.log("[MessagingShell] Leaving conversation:", D.id), K(null), te(!1), ce.current = null, await ne();
|
|
2351
2377
|
},
|
|
2352
2378
|
[ne, F]
|
|
2353
|
-
),
|
|
2379
|
+
), Ie = O(
|
|
2354
2380
|
async (D) => {
|
|
2355
|
-
F && console.log("[MessagingShell] Blocking participant:", D),
|
|
2381
|
+
F && console.log("[MessagingShell] Blocking participant:", D), K(null), te(!1), ce.current = null, await ne();
|
|
2356
2382
|
},
|
|
2357
2383
|
[ne, F]
|
|
2358
|
-
), ue = !!
|
|
2359
|
-
return
|
|
2384
|
+
), ue = !!W;
|
|
2385
|
+
return A ? /* @__PURE__ */ e("div", { className: $("h-full", s), children: /* @__PURE__ */ e(De, {}) }) : G ? /* @__PURE__ */ e("div", { className: $("h-full", s), children: /* @__PURE__ */ e(Te, { message: G, onBack: U }) }) : !B || !M ? /* @__PURE__ */ e("div", { className: $("h-full", s), children: /* @__PURE__ */ e(
|
|
2360
2386
|
Te,
|
|
2361
2387
|
{
|
|
2362
2388
|
message: "Not connected to messaging service",
|
|
2363
|
-
onBack:
|
|
2389
|
+
onBack: U
|
|
2364
2390
|
}
|
|
2365
|
-
) }) :
|
|
2391
|
+
) }) : pe ? /* @__PURE__ */ e("div", { className: $("h-full", s), children: /* @__PURE__ */ e(Te, { message: pe }) }) : /* @__PURE__ */ o(
|
|
2366
2392
|
"div",
|
|
2367
2393
|
{
|
|
2368
|
-
className:
|
|
2394
|
+
className: $(
|
|
2369
2395
|
"messaging-shell h-full bg-background-primary overflow-hidden",
|
|
2370
2396
|
s
|
|
2371
2397
|
),
|
|
2372
2398
|
children: [
|
|
2373
|
-
/* @__PURE__ */
|
|
2399
|
+
/* @__PURE__ */ o("div", { className: "flex h-full min-h-0", children: [
|
|
2374
2400
|
/* @__PURE__ */ e(
|
|
2375
2401
|
"div",
|
|
2376
2402
|
{
|
|
2377
|
-
className:
|
|
2403
|
+
className: $(
|
|
2378
2404
|
"messaging-channel-list-sidebar min-h-0 min-w-0 lg:flex lg:flex-col",
|
|
2379
2405
|
{
|
|
2380
|
-
"!hidden":
|
|
2406
|
+
"!hidden": d === !1 || q,
|
|
2381
2407
|
// Hide on mobile when channel selected, show on desktop with consistent wide width
|
|
2382
|
-
"hidden lg:flex lg:flex-1 lg:max-w-2xl":
|
|
2408
|
+
"hidden lg:flex lg:flex-1 lg:max-w-2xl": d !== !1 && !q && ue,
|
|
2383
2409
|
// Show on mobile when no channel selected, use same wide width on desktop
|
|
2384
|
-
"flex flex-col w-full lg:flex-1 lg:max-w-2xl":
|
|
2410
|
+
"flex flex-col w-full lg:flex-1 lg:max-w-2xl": d !== !1 && !q && !ue
|
|
2385
2411
|
}
|
|
2386
2412
|
),
|
|
2387
2413
|
children: /* @__PURE__ */ e(
|
|
2388
|
-
|
|
2414
|
+
yt,
|
|
2389
2415
|
{
|
|
2390
2416
|
onChannelSelect: Ne,
|
|
2391
|
-
selectedChannel:
|
|
2417
|
+
selectedChannel: W || void 0,
|
|
2392
2418
|
filters: we,
|
|
2393
|
-
channelRenderFilterFn:
|
|
2394
|
-
customEmptyStateIndicator:
|
|
2419
|
+
channelRenderFilterFn: h,
|
|
2420
|
+
customEmptyStateIndicator: C,
|
|
2395
2421
|
renderMessagePreview: L
|
|
2396
2422
|
}
|
|
2397
2423
|
)
|
|
@@ -2400,47 +2426,47 @@ const la = ({
|
|
|
2400
2426
|
/* @__PURE__ */ e(
|
|
2401
2427
|
"div",
|
|
2402
2428
|
{
|
|
2403
|
-
className:
|
|
2429
|
+
className: $(
|
|
2404
2430
|
"messaging-conversation-view flex-1 flex-col min-w-0 min-h-0",
|
|
2405
2431
|
{
|
|
2406
2432
|
// In direct conversation mode (or waiting for it), always show (full width)
|
|
2407
|
-
flex:
|
|
2433
|
+
flex: q || ue || i,
|
|
2408
2434
|
// Normal mode: hide on mobile when no channel selected
|
|
2409
|
-
"hidden lg:flex": !
|
|
2435
|
+
"hidden lg:flex": !q && !ue && !i
|
|
2410
2436
|
}
|
|
2411
2437
|
),
|
|
2412
|
-
children:
|
|
2413
|
-
|
|
2438
|
+
children: W ? /* @__PURE__ */ e("div", { className: "flex-1 min-h-0 flex flex-col", children: /* @__PURE__ */ e(
|
|
2439
|
+
St,
|
|
2414
2440
|
{
|
|
2415
|
-
channel:
|
|
2441
|
+
channel: W,
|
|
2416
2442
|
onBack: ye,
|
|
2417
|
-
showBackButton: !
|
|
2443
|
+
showBackButton: !q,
|
|
2418
2444
|
renderMessageInputActions: n,
|
|
2419
|
-
renderConversationFooter:
|
|
2420
|
-
renderChannelBanner:
|
|
2445
|
+
renderConversationFooter: r,
|
|
2446
|
+
renderChannelBanner: N,
|
|
2421
2447
|
onLeaveConversation: Ee,
|
|
2422
|
-
onBlockParticipant:
|
|
2423
|
-
CustomChannelEmptyState:
|
|
2448
|
+
onBlockParticipant: Ie,
|
|
2449
|
+
CustomChannelEmptyState: f,
|
|
2424
2450
|
showDeleteConversation: ge,
|
|
2425
2451
|
onDeleteConversationClick: a,
|
|
2426
|
-
onBlockParticipantClick:
|
|
2427
|
-
onReportParticipantClick:
|
|
2428
|
-
dmAgentEnabled:
|
|
2429
|
-
messageMetadata:
|
|
2430
|
-
onMessageSent:
|
|
2431
|
-
showStarButton:
|
|
2432
|
-
chatbotVotingEnabled:
|
|
2433
|
-
customProfileContent:
|
|
2434
|
-
customChannelActions:
|
|
2435
|
-
renderMessage:
|
|
2436
|
-
sendButton:
|
|
2452
|
+
onBlockParticipantClick: E,
|
|
2453
|
+
onReportParticipantClick: y,
|
|
2454
|
+
dmAgentEnabled: w,
|
|
2455
|
+
messageMetadata: b,
|
|
2456
|
+
onMessageSent: S,
|
|
2457
|
+
showStarButton: v,
|
|
2458
|
+
chatbotVotingEnabled: _,
|
|
2459
|
+
customProfileContent: g,
|
|
2460
|
+
customChannelActions: x,
|
|
2461
|
+
renderMessage: R,
|
|
2462
|
+
sendButton: k
|
|
2437
2463
|
},
|
|
2438
|
-
|
|
2439
|
-
) }) :
|
|
2464
|
+
W.id
|
|
2465
|
+
) }) : i ? (
|
|
2440
2466
|
// Show loading while creating/loading direct conversation channel
|
|
2441
2467
|
/* @__PURE__ */ e(De, {})
|
|
2442
2468
|
) : /* @__PURE__ */ e(
|
|
2443
|
-
|
|
2469
|
+
kt,
|
|
2444
2470
|
{
|
|
2445
2471
|
hasChannels: re,
|
|
2446
2472
|
channelsLoaded: p
|
|
@@ -2458,7 +2484,7 @@ const la = ({
|
|
|
2458
2484
|
onClick: _e,
|
|
2459
2485
|
onClose: de,
|
|
2460
2486
|
children: /* @__PURE__ */ e("div", { className: "h-full w-full bg-white shadow-max-elevation-light", children: /* @__PURE__ */ e(
|
|
2461
|
-
|
|
2487
|
+
Fn,
|
|
2462
2488
|
{
|
|
2463
2489
|
participantSource: oe,
|
|
2464
2490
|
onSelectParticipant: Ce,
|
|
@@ -2467,18 +2493,18 @@ const la = ({
|
|
|
2467
2493
|
participantLabel: ve,
|
|
2468
2494
|
searchPlaceholder: `Search ${ve}...`
|
|
2469
2495
|
},
|
|
2470
|
-
|
|
2496
|
+
xe
|
|
2471
2497
|
) })
|
|
2472
2498
|
}
|
|
2473
2499
|
)
|
|
2474
2500
|
]
|
|
2475
2501
|
}
|
|
2476
2502
|
);
|
|
2477
|
-
},
|
|
2503
|
+
}, On = ({
|
|
2478
2504
|
question: t,
|
|
2479
2505
|
onClick: s,
|
|
2480
2506
|
loading: n = !1,
|
|
2481
|
-
className:
|
|
2507
|
+
className: r
|
|
2482
2508
|
}) => /* @__PURE__ */ e(
|
|
2483
2509
|
"button",
|
|
2484
2510
|
{
|
|
@@ -2486,58 +2512,58 @@ const la = ({
|
|
|
2486
2512
|
onClick: s,
|
|
2487
2513
|
disabled: n,
|
|
2488
2514
|
style: { backgroundColor: "#E6E5E3" },
|
|
2489
|
-
className:
|
|
2515
|
+
className: $(
|
|
2490
2516
|
"w-full text-center p-4 rounded-xl text-charcoal font-medium transition-colors focus-ring",
|
|
2491
2517
|
{
|
|
2492
2518
|
"hover:brightness-95 active:brightness-90": !n,
|
|
2493
2519
|
"opacity-50 cursor-not-allowed": n
|
|
2494
2520
|
},
|
|
2495
|
-
|
|
2521
|
+
r
|
|
2496
2522
|
),
|
|
2497
2523
|
children: t
|
|
2498
2524
|
}
|
|
2499
|
-
),
|
|
2525
|
+
), ca = ({
|
|
2500
2526
|
faqs: t,
|
|
2501
2527
|
onFaqClick: s,
|
|
2502
2528
|
loadingFaqId: n,
|
|
2503
|
-
headerText:
|
|
2529
|
+
headerText: r,
|
|
2504
2530
|
className: l,
|
|
2505
2531
|
avatarImage: u,
|
|
2506
|
-
avatarName:
|
|
2532
|
+
avatarName: i
|
|
2507
2533
|
}) => {
|
|
2508
|
-
const
|
|
2509
|
-
return
|
|
2510
|
-
(u ||
|
|
2534
|
+
const c = t.filter((f) => f.enabled).sort((f, d) => (f.order ?? 0) - (d.order ?? 0));
|
|
2535
|
+
return c.length === 0 ? null : /* @__PURE__ */ e("div", { className: l, children: /* @__PURE__ */ o("div", { className: "flex gap-3 items-end", children: [
|
|
2536
|
+
(u || i) && /* @__PURE__ */ e("div", { className: "flex-none", children: /* @__PURE__ */ e(
|
|
2511
2537
|
ae,
|
|
2512
2538
|
{
|
|
2513
|
-
id:
|
|
2514
|
-
name:
|
|
2539
|
+
id: i || "account",
|
|
2540
|
+
name: i || "Account",
|
|
2515
2541
|
image: u,
|
|
2516
2542
|
size: 24,
|
|
2517
2543
|
shape: "circle"
|
|
2518
2544
|
}
|
|
2519
2545
|
) }),
|
|
2520
|
-
/* @__PURE__ */
|
|
2546
|
+
/* @__PURE__ */ o(
|
|
2521
2547
|
"div",
|
|
2522
2548
|
{
|
|
2523
2549
|
className: "flex-1 flex flex-col gap-3 rounded-lg p-4",
|
|
2524
2550
|
style: { backgroundColor: "#F1F0EE" },
|
|
2525
2551
|
children: [
|
|
2526
|
-
|
|
2527
|
-
|
|
2528
|
-
|
|
2552
|
+
r && /* @__PURE__ */ e("p", { className: "text-md text-charcoal mb-4", children: r }),
|
|
2553
|
+
c.map((f) => /* @__PURE__ */ e(
|
|
2554
|
+
On,
|
|
2529
2555
|
{
|
|
2530
|
-
question:
|
|
2531
|
-
onClick: () => s(
|
|
2532
|
-
loading: n ===
|
|
2556
|
+
question: f.question,
|
|
2557
|
+
onClick: () => s(f.id),
|
|
2558
|
+
loading: n === f.id
|
|
2533
2559
|
},
|
|
2534
|
-
|
|
2560
|
+
f.id
|
|
2535
2561
|
))
|
|
2536
2562
|
]
|
|
2537
2563
|
}
|
|
2538
2564
|
)
|
|
2539
2565
|
] }) });
|
|
2540
|
-
},
|
|
2566
|
+
}, Un = [
|
|
2541
2567
|
[/pdf/, "pdf"],
|
|
2542
2568
|
[/wordprocessingml|msword|\.doc/, "doc"],
|
|
2543
2569
|
[/spreadsheetml|ms-excel|\.xls/, "xls"],
|
|
@@ -2547,125 +2573,125 @@ const la = ({
|
|
|
2547
2573
|
[/plain|rtf/, "text"],
|
|
2548
2574
|
[/markdown/, "markdown"]
|
|
2549
2575
|
];
|
|
2550
|
-
function
|
|
2576
|
+
function Xe(t) {
|
|
2551
2577
|
return t.startsWith("video/") ? "video" : t.startsWith("audio/") ? "audio" : t.startsWith("image/") ? "image" : "document";
|
|
2552
2578
|
}
|
|
2553
|
-
function
|
|
2554
|
-
const s =
|
|
2579
|
+
function $n(t) {
|
|
2580
|
+
const s = Un.find(
|
|
2555
2581
|
([n]) => n.test(t)
|
|
2556
2582
|
);
|
|
2557
2583
|
return s ? s[1] : "generic";
|
|
2558
2584
|
}
|
|
2559
|
-
const
|
|
2560
|
-
video:
|
|
2561
|
-
audio:
|
|
2562
|
-
image:
|
|
2563
|
-
document:
|
|
2564
|
-
},
|
|
2565
|
-
pdf:
|
|
2566
|
-
doc:
|
|
2567
|
-
xls:
|
|
2568
|
-
csv:
|
|
2569
|
-
ppt:
|
|
2585
|
+
const zn = {
|
|
2586
|
+
video: _s,
|
|
2587
|
+
audio: Cs,
|
|
2588
|
+
image: ys,
|
|
2589
|
+
document: gt
|
|
2590
|
+
}, Bn = {
|
|
2591
|
+
pdf: Rs,
|
|
2592
|
+
doc: Ds,
|
|
2593
|
+
xls: Ms,
|
|
2594
|
+
csv: Ts,
|
|
2595
|
+
ppt: ks,
|
|
2570
2596
|
zip: Ss,
|
|
2571
|
-
text:
|
|
2572
|
-
markdown:
|
|
2573
|
-
generic:
|
|
2597
|
+
text: Is,
|
|
2598
|
+
markdown: Es,
|
|
2599
|
+
generic: gt
|
|
2574
2600
|
};
|
|
2575
|
-
function
|
|
2576
|
-
const s =
|
|
2577
|
-
return s !== "document" ?
|
|
2601
|
+
function jn(t) {
|
|
2602
|
+
const s = Xe(t);
|
|
2603
|
+
return s !== "document" ? zn[s] : Bn[$n(t)];
|
|
2578
2604
|
}
|
|
2579
2605
|
function Ze(t, s) {
|
|
2580
|
-
return
|
|
2606
|
+
return j.createElement(jn(t), s);
|
|
2581
2607
|
}
|
|
2582
|
-
const
|
|
2608
|
+
const Gn = (t) => {
|
|
2583
2609
|
var s, n;
|
|
2584
2610
|
return "touches" in t ? ((s = t.touches[0]) == null ? void 0 : s.clientX) ?? ((n = t.changedTouches[0]) == null ? void 0 : n.clientX) ?? 0 : t.clientX;
|
|
2585
|
-
},
|
|
2611
|
+
}, Ye = ({
|
|
2586
2612
|
source: t,
|
|
2587
2613
|
mimeType: s,
|
|
2588
2614
|
poster: n,
|
|
2589
|
-
autoPlay:
|
|
2615
|
+
autoPlay: r = !1,
|
|
2590
2616
|
playing: l,
|
|
2591
2617
|
loop: u = !1,
|
|
2592
|
-
controls:
|
|
2593
|
-
showProgress:
|
|
2594
|
-
muted:
|
|
2595
|
-
onContainerClick:
|
|
2618
|
+
controls: i = !0,
|
|
2619
|
+
showProgress: c = !1,
|
|
2620
|
+
muted: f = !1,
|
|
2621
|
+
onContainerClick: d
|
|
2596
2622
|
}) => {
|
|
2597
|
-
const
|
|
2598
|
-
|
|
2599
|
-
}, []),
|
|
2600
|
-
const
|
|
2601
|
-
if (!
|
|
2602
|
-
const
|
|
2623
|
+
const m = Xe(s), h = J(null), C = J(null), a = J(null), E = J(l), [y, w] = T(r), [b, S] = T(0), [v, _] = T(!1), [L, N] = T(!1), [g, x] = T(!1), [R, k] = T(!1), [P, M] = T(!0), [B, A] = T(null), G = O(() => {
|
|
2624
|
+
x(!1), w(!0);
|
|
2625
|
+
}, []), U = O((p) => {
|
|
2626
|
+
const I = C.current;
|
|
2627
|
+
if (!I) return 0;
|
|
2628
|
+
const z = I.getBoundingClientRect();
|
|
2603
2629
|
return Math.max(
|
|
2604
2630
|
0,
|
|
2605
|
-
Math.min(1, (
|
|
2631
|
+
Math.min(1, (Gn(p) - z.left) / z.width)
|
|
2606
2632
|
);
|
|
2607
|
-
}, []), F =
|
|
2608
|
-
const
|
|
2609
|
-
|
|
2610
|
-
}, []),
|
|
2611
|
-
p.stopPropagation(),
|
|
2612
|
-
const
|
|
2613
|
-
I
|
|
2633
|
+
}, []), F = O((p) => {
|
|
2634
|
+
const I = h.current;
|
|
2635
|
+
I && I.duration && (I.currentTime = p * I.duration);
|
|
2636
|
+
}, []), W = (p) => {
|
|
2637
|
+
p.stopPropagation(), _(!0);
|
|
2638
|
+
const I = U(p);
|
|
2639
|
+
S(I), F(I);
|
|
2614
2640
|
};
|
|
2615
|
-
|
|
2616
|
-
l !== void 0 && l !==
|
|
2617
|
-
}, [l]),
|
|
2618
|
-
if (!
|
|
2641
|
+
Z(() => {
|
|
2642
|
+
l !== void 0 && l !== E.current && (E.current = l, w(l));
|
|
2643
|
+
}, [l]), Z(() => {
|
|
2644
|
+
if (!y) {
|
|
2619
2645
|
a.current !== null && (cancelAnimationFrame(a.current), a.current = null);
|
|
2620
2646
|
return;
|
|
2621
2647
|
}
|
|
2622
2648
|
const p = () => {
|
|
2623
|
-
const
|
|
2624
|
-
|
|
2649
|
+
const I = h.current;
|
|
2650
|
+
I && I.duration && !v && S(I.currentTime / I.duration), a.current = requestAnimationFrame(p);
|
|
2625
2651
|
};
|
|
2626
2652
|
return a.current = requestAnimationFrame(p), () => {
|
|
2627
2653
|
a.current !== null && cancelAnimationFrame(a.current);
|
|
2628
2654
|
};
|
|
2629
|
-
}, [
|
|
2630
|
-
const p =
|
|
2631
|
-
p && (
|
|
2632
|
-
|
|
2655
|
+
}, [y, v]), Z(() => {
|
|
2656
|
+
const p = h.current;
|
|
2657
|
+
p && (y ? p.play().catch((I) => {
|
|
2658
|
+
w(!1), x(!0);
|
|
2633
2659
|
}) : p.pause());
|
|
2634
|
-
}, [
|
|
2635
|
-
if (!
|
|
2636
|
-
const p = (
|
|
2637
|
-
|
|
2660
|
+
}, [y]), Z(() => {
|
|
2661
|
+
if (!v) return;
|
|
2662
|
+
const p = (z) => S(U(z)), I = (z) => {
|
|
2663
|
+
_(!1), F(U(z));
|
|
2638
2664
|
};
|
|
2639
|
-
return window.addEventListener("mousemove", p), window.addEventListener("mouseup",
|
|
2640
|
-
window.removeEventListener("mousemove", p), window.removeEventListener("mouseup",
|
|
2665
|
+
return window.addEventListener("mousemove", p), window.addEventListener("mouseup", I), window.addEventListener("touchmove", p, { passive: !0 }), window.addEventListener("touchend", I), () => {
|
|
2666
|
+
window.removeEventListener("mousemove", p), window.removeEventListener("mouseup", I), window.removeEventListener("touchmove", p), window.removeEventListener("touchend", I);
|
|
2641
2667
|
};
|
|
2642
|
-
}, [
|
|
2643
|
-
const
|
|
2644
|
-
return /* @__PURE__ */
|
|
2668
|
+
}, [v, U, F]);
|
|
2669
|
+
const K = B ? { aspectRatio: String(B) } : void 0, re = B ? "" : " aspect-video", Q = Math.round(b * 100);
|
|
2670
|
+
return /* @__PURE__ */ o(
|
|
2645
2671
|
"div",
|
|
2646
2672
|
{
|
|
2647
2673
|
role: "button",
|
|
2648
2674
|
tabIndex: 0,
|
|
2649
2675
|
className: `relative cursor-pointer overflow-hidden bg-black ${re}`,
|
|
2650
|
-
style:
|
|
2676
|
+
style: K,
|
|
2651
2677
|
onClick: (p) => {
|
|
2652
|
-
if (
|
|
2653
|
-
|
|
2678
|
+
if (d) {
|
|
2679
|
+
d(p);
|
|
2654
2680
|
return;
|
|
2655
2681
|
}
|
|
2656
|
-
|
|
2682
|
+
g || i && w((I) => !I);
|
|
2657
2683
|
},
|
|
2658
2684
|
onKeyDown: (p) => {
|
|
2659
2685
|
if (!(p.key !== "Enter" && p.key !== " ")) {
|
|
2660
|
-
if (p.preventDefault(),
|
|
2661
|
-
|
|
2686
|
+
if (p.preventDefault(), d) {
|
|
2687
|
+
d(p);
|
|
2662
2688
|
return;
|
|
2663
2689
|
}
|
|
2664
|
-
|
|
2690
|
+
g || i && w((I) => !I);
|
|
2665
2691
|
}
|
|
2666
2692
|
},
|
|
2667
2693
|
children: [
|
|
2668
|
-
n && (
|
|
2694
|
+
n && (m === "audio" || P) && /* @__PURE__ */ e(
|
|
2669
2695
|
"img",
|
|
2670
2696
|
{
|
|
2671
2697
|
src: n,
|
|
@@ -2673,62 +2699,62 @@ const jn = (t) => {
|
|
|
2673
2699
|
className: "absolute inset-0 h-full w-full object-cover"
|
|
2674
2700
|
}
|
|
2675
2701
|
),
|
|
2676
|
-
!n && (
|
|
2702
|
+
!n && (m === "audio" || P) && /* @__PURE__ */ e("div", { className: "absolute inset-0 flex items-center justify-center", children: Ze(s, {
|
|
2677
2703
|
className: "size-12 text-black/20",
|
|
2678
2704
|
weight: "regular"
|
|
2679
2705
|
}) }),
|
|
2680
|
-
/* @__PURE__ */ e("div", { className: "absolute inset-0", children:
|
|
2706
|
+
/* @__PURE__ */ e("div", { className: "absolute inset-0", children: m === "audio" ? /* @__PURE__ */ e(
|
|
2681
2707
|
"audio",
|
|
2682
2708
|
{
|
|
2683
|
-
ref:
|
|
2709
|
+
ref: h,
|
|
2684
2710
|
src: t,
|
|
2685
2711
|
loop: u,
|
|
2686
|
-
muted:
|
|
2712
|
+
muted: f,
|
|
2687
2713
|
style: { width: "100%", height: "100%" },
|
|
2688
|
-
onLoadStart: () =>
|
|
2714
|
+
onLoadStart: () => k(!0),
|
|
2689
2715
|
onCanPlay: () => {
|
|
2690
|
-
|
|
2716
|
+
k(!1), M(!1);
|
|
2691
2717
|
},
|
|
2692
|
-
onWaiting: () =>
|
|
2693
|
-
onPlay: () =>
|
|
2718
|
+
onWaiting: () => k(!0),
|
|
2719
|
+
onPlay: () => x(!1),
|
|
2694
2720
|
onEnded: () => {
|
|
2695
|
-
u || (
|
|
2721
|
+
u || (w(!1), S(0));
|
|
2696
2722
|
},
|
|
2697
2723
|
children: /* @__PURE__ */ e("track", { kind: "captions" })
|
|
2698
2724
|
}
|
|
2699
2725
|
) : /* @__PURE__ */ e(
|
|
2700
2726
|
"video",
|
|
2701
2727
|
{
|
|
2702
|
-
ref:
|
|
2728
|
+
ref: h,
|
|
2703
2729
|
src: t,
|
|
2704
2730
|
loop: u,
|
|
2705
|
-
muted:
|
|
2731
|
+
muted: f,
|
|
2706
2732
|
playsInline: !0,
|
|
2707
2733
|
style: { width: "100%", height: "100%" },
|
|
2708
|
-
onLoadStart: () =>
|
|
2734
|
+
onLoadStart: () => k(!0),
|
|
2709
2735
|
onCanPlay: () => {
|
|
2710
|
-
|
|
2736
|
+
k(!1), M(!1);
|
|
2711
2737
|
},
|
|
2712
|
-
onWaiting: () =>
|
|
2713
|
-
onPlay: () =>
|
|
2738
|
+
onWaiting: () => k(!0),
|
|
2739
|
+
onPlay: () => x(!1),
|
|
2714
2740
|
onLoadedMetadata: () => {
|
|
2715
|
-
const p =
|
|
2716
|
-
p instanceof HTMLVideoElement && p.videoWidth && p.videoHeight &&
|
|
2741
|
+
const p = h.current;
|
|
2742
|
+
p instanceof HTMLVideoElement && p.videoWidth && p.videoHeight && A(p.videoWidth / p.videoHeight);
|
|
2717
2743
|
},
|
|
2718
2744
|
onEnded: () => {
|
|
2719
|
-
u || (
|
|
2745
|
+
u || (w(!1), S(0));
|
|
2720
2746
|
},
|
|
2721
2747
|
children: /* @__PURE__ */ e("track", { kind: "captions" })
|
|
2722
2748
|
}
|
|
2723
2749
|
) }),
|
|
2724
|
-
|
|
2725
|
-
|
|
2750
|
+
R && !g && /* @__PURE__ */ e("div", { className: "absolute inset-0 z-10 flex items-center justify-center", children: /* @__PURE__ */ e(
|
|
2751
|
+
bt,
|
|
2726
2752
|
{
|
|
2727
2753
|
className: "size-8 animate-spin text-white/80",
|
|
2728
2754
|
weight: "bold"
|
|
2729
2755
|
}
|
|
2730
2756
|
) }),
|
|
2731
|
-
|
|
2757
|
+
g && !i && /* @__PURE__ */ e(
|
|
2732
2758
|
"div",
|
|
2733
2759
|
{
|
|
2734
2760
|
className: "absolute inset-0 z-30 flex cursor-pointer items-center justify-center bg-black/35",
|
|
@@ -2736,82 +2762,82 @@ const jn = (t) => {
|
|
|
2736
2762
|
tabIndex: 0,
|
|
2737
2763
|
"aria-label": "Play preview",
|
|
2738
2764
|
onClick: (p) => {
|
|
2739
|
-
p.stopPropagation(),
|
|
2765
|
+
p.stopPropagation(), G();
|
|
2740
2766
|
},
|
|
2741
2767
|
onKeyDown: (p) => {
|
|
2742
|
-
p.key !== "Enter" && p.key !== " " || (p.preventDefault(), p.stopPropagation(),
|
|
2768
|
+
p.key !== "Enter" && p.key !== " " || (p.preventDefault(), p.stopPropagation(), G());
|
|
2743
2769
|
},
|
|
2744
|
-
children: /* @__PURE__ */ e("span", { className: "flex size-16 items-center justify-center rounded-full bg-white/20 text-white backdrop-blur-sm", children: /* @__PURE__ */ e(
|
|
2770
|
+
children: /* @__PURE__ */ e("span", { className: "flex size-16 items-center justify-center rounded-full bg-white/20 text-white backdrop-blur-sm", children: /* @__PURE__ */ e(at, { className: "size-9 translate-x-0.5", weight: "fill" }) })
|
|
2745
2771
|
}
|
|
2746
2772
|
),
|
|
2747
|
-
|
|
2773
|
+
c && !i && /* @__PURE__ */ e("div", { className: "absolute inset-x-0 bottom-0 px-3 pb-2.5 pt-6 bg-gradient-to-t from-black/40 to-transparent", children: /* @__PURE__ */ e(
|
|
2748
2774
|
"div",
|
|
2749
2775
|
{
|
|
2750
2776
|
role: "slider",
|
|
2751
2777
|
"aria-label": "Playback position",
|
|
2752
|
-
"aria-valuenow":
|
|
2778
|
+
"aria-valuenow": Q,
|
|
2753
2779
|
"aria-valuemin": 0,
|
|
2754
2780
|
"aria-valuemax": 100,
|
|
2755
2781
|
tabIndex: 0,
|
|
2756
|
-
ref:
|
|
2782
|
+
ref: C,
|
|
2757
2783
|
className: "relative flex h-4 w-full cursor-pointer items-center",
|
|
2758
|
-
onMouseDown:
|
|
2759
|
-
onTouchStart:
|
|
2784
|
+
onMouseDown: W,
|
|
2785
|
+
onTouchStart: W,
|
|
2760
2786
|
onClick: (p) => p.stopPropagation(),
|
|
2761
2787
|
onKeyDown: (p) => {
|
|
2762
|
-
p.key === "ArrowRight" && F(Math.min(1,
|
|
2788
|
+
p.key === "ArrowRight" && F(Math.min(1, b + 0.05)), p.key === "ArrowLeft" && F(Math.max(0, b - 0.05));
|
|
2763
2789
|
},
|
|
2764
2790
|
children: /* @__PURE__ */ e("div", { className: "w-full overflow-hidden rounded-full bg-white/30 h-1", children: /* @__PURE__ */ e(
|
|
2765
2791
|
"div",
|
|
2766
2792
|
{
|
|
2767
2793
|
className: "h-full rounded-full bg-white",
|
|
2768
|
-
style: { width: `${
|
|
2794
|
+
style: { width: `${Q}%` }
|
|
2769
2795
|
}
|
|
2770
2796
|
) })
|
|
2771
2797
|
}
|
|
2772
2798
|
) }),
|
|
2773
|
-
|
|
2799
|
+
i && /* @__PURE__ */ o("div", { className: "absolute inset-x-0 bottom-0 flex items-center gap-2 bg-gradient-to-t from-black/60 to-transparent px-3 pb-2.5 pt-6 transition-all duration-200", children: [
|
|
2774
2800
|
/* @__PURE__ */ e(
|
|
2775
2801
|
"button",
|
|
2776
2802
|
{
|
|
2777
2803
|
type: "button",
|
|
2778
2804
|
onClick: (p) => {
|
|
2779
|
-
p.stopPropagation(),
|
|
2805
|
+
p.stopPropagation(), w((I) => !I);
|
|
2780
2806
|
},
|
|
2781
2807
|
className: "shrink-0 text-white",
|
|
2782
|
-
"aria-label":
|
|
2783
|
-
children:
|
|
2808
|
+
"aria-label": y ? "Pause" : "Play",
|
|
2809
|
+
children: y ? /* @__PURE__ */ e(Ps, { className: "size-5", weight: "fill" }) : /* @__PURE__ */ e(at, { className: "size-5 translate-x-px", weight: "fill" })
|
|
2784
2810
|
}
|
|
2785
2811
|
),
|
|
2786
|
-
/* @__PURE__ */
|
|
2812
|
+
/* @__PURE__ */ o(
|
|
2787
2813
|
"div",
|
|
2788
2814
|
{
|
|
2789
2815
|
role: "slider",
|
|
2790
2816
|
"aria-label": "Playback position",
|
|
2791
|
-
"aria-valuenow":
|
|
2817
|
+
"aria-valuenow": Q,
|
|
2792
2818
|
"aria-valuemin": 0,
|
|
2793
2819
|
"aria-valuemax": 100,
|
|
2794
2820
|
tabIndex: 0,
|
|
2795
|
-
ref:
|
|
2821
|
+
ref: C,
|
|
2796
2822
|
className: "relative flex h-4 w-full cursor-pointer items-center",
|
|
2797
|
-
onMouseDown:
|
|
2798
|
-
onTouchStart:
|
|
2823
|
+
onMouseDown: W,
|
|
2824
|
+
onTouchStart: W,
|
|
2799
2825
|
onClick: (p) => p.stopPropagation(),
|
|
2800
|
-
onMouseEnter: () =>
|
|
2801
|
-
onMouseLeave: () =>
|
|
2826
|
+
onMouseEnter: () => N(!0),
|
|
2827
|
+
onMouseLeave: () => N(!1),
|
|
2802
2828
|
onKeyDown: (p) => {
|
|
2803
|
-
p.key === "ArrowRight" && F(Math.min(1,
|
|
2829
|
+
p.key === "ArrowRight" && F(Math.min(1, b + 0.05)), p.key === "ArrowLeft" && F(Math.max(0, b - 0.05));
|
|
2804
2830
|
},
|
|
2805
2831
|
children: [
|
|
2806
2832
|
/* @__PURE__ */ e(
|
|
2807
2833
|
"div",
|
|
2808
2834
|
{
|
|
2809
|
-
className: `w-full overflow-hidden rounded-full bg-white/30 transition-all duration-200 ${L ||
|
|
2835
|
+
className: `w-full overflow-hidden rounded-full bg-white/30 transition-all duration-200 ${L || v ? "h-1.5" : "h-1"}`,
|
|
2810
2836
|
children: /* @__PURE__ */ e(
|
|
2811
2837
|
"div",
|
|
2812
2838
|
{
|
|
2813
2839
|
className: "h-full rounded-full bg-white",
|
|
2814
|
-
style: { width: `${
|
|
2840
|
+
style: { width: `${Q}%` }
|
|
2815
2841
|
}
|
|
2816
2842
|
)
|
|
2817
2843
|
}
|
|
@@ -2819,8 +2845,8 @@ const jn = (t) => {
|
|
|
2819
2845
|
/* @__PURE__ */ e(
|
|
2820
2846
|
"div",
|
|
2821
2847
|
{
|
|
2822
|
-
className: `absolute size-3 -translate-x-1/2 rounded-full bg-white shadow transition-[opacity,transform] duration-200 ${L ||
|
|
2823
|
-
style: { left: `${
|
|
2848
|
+
className: `absolute size-3 -translate-x-1/2 rounded-full bg-white shadow transition-[opacity,transform] duration-200 ${L || v ? "scale-100 opacity-100" : "scale-0 opacity-0"}`,
|
|
2849
|
+
style: { left: `${Q}%` }
|
|
2824
2850
|
}
|
|
2825
2851
|
)
|
|
2826
2852
|
]
|
|
@@ -2831,91 +2857,91 @@ const jn = (t) => {
|
|
|
2831
2857
|
}
|
|
2832
2858
|
);
|
|
2833
2859
|
};
|
|
2834
|
-
function
|
|
2860
|
+
function Hn(t) {
|
|
2835
2861
|
return t < 1024 ? `${t} B` : t < 1024 * 1024 ? `${(t / 1024).toFixed(1)} KB` : `${(t / (1024 * 1024)).toFixed(1)} MB`;
|
|
2836
2862
|
}
|
|
2837
2863
|
function Vn(t) {
|
|
2838
2864
|
return `w-[280px] select-none overflow-hidden rounded-[24px] ${t ? "bg-[#121110]" : "bg-[#F3F3F1]"} shadow-[0_0_0_1px_rgba(0,0,0,0.04),0_4px_8px_rgba(0,0,0,0.06)]`;
|
|
2839
2865
|
}
|
|
2840
|
-
function
|
|
2866
|
+
function Tt(t) {
|
|
2841
2867
|
return t ? "text-white" : "text-black";
|
|
2842
2868
|
}
|
|
2843
2869
|
function be(t) {
|
|
2844
2870
|
return t ? "text-white/55" : "text-black/55";
|
|
2845
2871
|
}
|
|
2846
|
-
function
|
|
2872
|
+
function Yn(t) {
|
|
2847
2873
|
return t ? "text-white/40" : "text-black/40";
|
|
2848
2874
|
}
|
|
2849
|
-
function
|
|
2875
|
+
function Mt(t) {
|
|
2850
2876
|
return t ? "bg-white/10" : "bg-black/5";
|
|
2851
2877
|
}
|
|
2852
|
-
function
|
|
2878
|
+
function Dt(t) {
|
|
2853
2879
|
return t ? "text-white/20" : "text-black/20";
|
|
2854
2880
|
}
|
|
2855
|
-
function
|
|
2881
|
+
function Wn(t) {
|
|
2856
2882
|
return t ? "bg-white/10 hover:bg-white/15" : "bg-black/[0.06] hover:bg-black/10";
|
|
2857
2883
|
}
|
|
2858
|
-
async function
|
|
2884
|
+
async function qn(t, s) {
|
|
2859
2885
|
let n;
|
|
2860
2886
|
try {
|
|
2861
2887
|
n = s ?? new URL(t).pathname.split("/").pop() ?? "download";
|
|
2862
2888
|
} catch {
|
|
2863
2889
|
n = s ?? "download";
|
|
2864
2890
|
}
|
|
2865
|
-
const
|
|
2866
|
-
if (!
|
|
2867
|
-
const l = await
|
|
2868
|
-
|
|
2891
|
+
const r = await fetch(t, { mode: "cors" });
|
|
2892
|
+
if (!r.ok) throw new Error(`HTTP ${r.status}`);
|
|
2893
|
+
const l = await r.blob(), u = URL.createObjectURL(l), i = document.createElement("a");
|
|
2894
|
+
i.href = u, i.download = n, i.style.display = "none", document.body.appendChild(i), i.click(), document.body.removeChild(i), URL.revokeObjectURL(u);
|
|
2869
2895
|
}
|
|
2870
|
-
const
|
|
2896
|
+
const Xn = ({
|
|
2871
2897
|
url: t,
|
|
2872
2898
|
filename: s,
|
|
2873
2899
|
isMyMessage: n
|
|
2874
2900
|
}) => {
|
|
2875
|
-
const [
|
|
2901
|
+
const [r, l] = T(!1);
|
|
2876
2902
|
return /* @__PURE__ */ e(
|
|
2877
2903
|
"button",
|
|
2878
2904
|
{
|
|
2879
2905
|
type: "button",
|
|
2880
|
-
onClick: (
|
|
2881
|
-
|
|
2882
|
-
const
|
|
2883
|
-
l(!0),
|
|
2884
|
-
|
|
2906
|
+
onClick: (i) => {
|
|
2907
|
+
i.stopPropagation();
|
|
2908
|
+
const c = window.open("", "_blank", "noopener,noreferrer");
|
|
2909
|
+
l(!0), qn(t, s).then(() => {
|
|
2910
|
+
c == null || c.close();
|
|
2885
2911
|
}).catch(() => {
|
|
2886
|
-
|
|
2912
|
+
c && (c.location.href = t);
|
|
2887
2913
|
}).finally(() => l(!1));
|
|
2888
2914
|
},
|
|
2889
|
-
disabled:
|
|
2890
|
-
className: `flex size-8 items-center justify-center rounded-full ${
|
|
2915
|
+
disabled: r,
|
|
2916
|
+
className: `flex size-8 items-center justify-center rounded-full ${Wn(n)} disabled:opacity-50`,
|
|
2891
2917
|
"aria-label": "Download",
|
|
2892
|
-
children:
|
|
2918
|
+
children: r ? /* @__PURE__ */ e(bt, { className: `size-4 animate-spin ${be(n)}`, weight: "bold" }) : /* @__PURE__ */ e(Fs, { className: `size-4 ${be(n)}`, weight: "bold" })
|
|
2893
2919
|
}
|
|
2894
2920
|
);
|
|
2895
|
-
}, Me = ({ mimeType: t, title: s, fileSize: n, url:
|
|
2896
|
-
/* @__PURE__ */
|
|
2897
|
-
s && /* @__PURE__ */ e("p", { className: `truncate text-base font-medium ${
|
|
2898
|
-
n !== void 0 && /* @__PURE__ */
|
|
2921
|
+
}, Me = ({ mimeType: t, title: s, fileSize: n, url: r, isMyMessage: l }) => /* @__PURE__ */ o("div", { className: "flex items-start gap-2 px-4 pb-3 pt-3", children: [
|
|
2922
|
+
/* @__PURE__ */ o("div", { className: "min-w-0 flex-1", children: [
|
|
2923
|
+
s && /* @__PURE__ */ e("p", { className: `truncate text-base font-medium ${Tt(l)}`, children: s }),
|
|
2924
|
+
n !== void 0 && /* @__PURE__ */ o("div", { className: "flex items-center gap-1", children: [
|
|
2899
2925
|
Ze(t, {
|
|
2900
2926
|
className: `size-5 shrink-0 ${be(l)}`,
|
|
2901
2927
|
weight: "regular"
|
|
2902
2928
|
}),
|
|
2903
|
-
/* @__PURE__ */ e("span", { className: `text-xs font-medium ${be(l)}`, children:
|
|
2929
|
+
/* @__PURE__ */ e("span", { className: `text-xs font-medium ${be(l)}`, children: Hn(n) })
|
|
2904
2930
|
] })
|
|
2905
2931
|
] }),
|
|
2906
|
-
/* @__PURE__ */ e("div", { className: "flex shrink-0 items-center gap-1 pt-0.5", children: /* @__PURE__ */ e(
|
|
2907
|
-
] }), Zn = ({ url: t, mimeType: s, title: n, fileSize:
|
|
2908
|
-
const
|
|
2932
|
+
/* @__PURE__ */ e("div", { className: "flex shrink-0 items-center gap-1 pt-0.5", children: /* @__PURE__ */ e(Xn, { url: r, filename: s, isMyMessage: l }) })
|
|
2933
|
+
] }), Zn = ({ url: t, mimeType: s, title: n, fileSize: r, isMyMessage: l, onExpand: u }) => {
|
|
2934
|
+
const i = /* @__PURE__ */ e(
|
|
2909
2935
|
"div",
|
|
2910
2936
|
{
|
|
2911
|
-
className: `aspect-video w-full ${
|
|
2937
|
+
className: `aspect-video w-full ${Mt(l)} flex items-center justify-center`,
|
|
2912
2938
|
children: Ze(s, {
|
|
2913
|
-
className: `size-12 ${
|
|
2939
|
+
className: `size-12 ${Dt(l)}`,
|
|
2914
2940
|
weight: "regular"
|
|
2915
2941
|
})
|
|
2916
2942
|
}
|
|
2917
2943
|
);
|
|
2918
|
-
return /* @__PURE__ */
|
|
2944
|
+
return /* @__PURE__ */ o("div", { children: [
|
|
2919
2945
|
u ? /* @__PURE__ */ e(
|
|
2920
2946
|
"button",
|
|
2921
2947
|
{
|
|
@@ -2923,23 +2949,23 @@ const qn = ({
|
|
|
2923
2949
|
onClick: u,
|
|
2924
2950
|
className: "block w-full",
|
|
2925
2951
|
"aria-label": "Open PDF viewer",
|
|
2926
|
-
children:
|
|
2952
|
+
children: i
|
|
2927
2953
|
}
|
|
2928
|
-
) : /* @__PURE__ */ e("a", { href: t, target: "_blank", rel: "noopener noreferrer", className: "block no-underline", children:
|
|
2954
|
+
) : /* @__PURE__ */ e("a", { href: t, target: "_blank", rel: "noopener noreferrer", className: "block no-underline", children: i }),
|
|
2929
2955
|
/* @__PURE__ */ e(
|
|
2930
2956
|
Me,
|
|
2931
2957
|
{
|
|
2932
2958
|
mimeType: s,
|
|
2933
2959
|
title: n,
|
|
2934
|
-
fileSize:
|
|
2960
|
+
fileSize: r,
|
|
2935
2961
|
url: t,
|
|
2936
2962
|
isMyMessage: l
|
|
2937
2963
|
}
|
|
2938
2964
|
)
|
|
2939
2965
|
] });
|
|
2940
|
-
},
|
|
2941
|
-
const { title: n, text:
|
|
2942
|
-
return /* @__PURE__ */
|
|
2966
|
+
}, Kn = ({ attachment: t, isMyMessage: s }) => {
|
|
2967
|
+
const { title: n, text: r, image_url: l, og_scrape_url: u, title_link: i } = t, c = u ?? i;
|
|
2968
|
+
return /* @__PURE__ */ o("a", { href: c, target: "_blank", rel: "noopener noreferrer", className: "block no-underline", children: [
|
|
2943
2969
|
/* @__PURE__ */ e("div", { className: "p-2", children: l ? /* @__PURE__ */ e(
|
|
2944
2970
|
"img",
|
|
2945
2971
|
{
|
|
@@ -2950,34 +2976,34 @@ const qn = ({
|
|
|
2950
2976
|
) : /* @__PURE__ */ e(
|
|
2951
2977
|
"div",
|
|
2952
2978
|
{
|
|
2953
|
-
className: `aspect-video w-full rounded-[20px] ${
|
|
2954
|
-
children: /* @__PURE__ */ e(
|
|
2979
|
+
className: `aspect-video w-full rounded-[20px] ${Mt(s)} flex items-center justify-center`,
|
|
2980
|
+
children: /* @__PURE__ */ e(Ls, { className: `size-12 ${Dt(s)}` })
|
|
2955
2981
|
}
|
|
2956
2982
|
) }),
|
|
2957
|
-
/* @__PURE__ */
|
|
2958
|
-
n && /* @__PURE__ */ e("p", { className: `truncate text-[14px] font-medium leading-5 ${
|
|
2959
|
-
|
|
2960
|
-
|
|
2983
|
+
/* @__PURE__ */ o("div", { className: "px-3 pb-3", children: [
|
|
2984
|
+
n && /* @__PURE__ */ e("p", { className: `truncate text-[14px] font-medium leading-5 ${Tt(s)}`, children: n }),
|
|
2985
|
+
r && /* @__PURE__ */ e("p", { className: `truncate text-[12px] leading-4 ${be(s)}`, children: r }),
|
|
2986
|
+
c && /* @__PURE__ */ e("p", { className: `mt-1 truncate text-[12px] leading-4 ${Yn(s)}`, children: c })
|
|
2961
2987
|
] })
|
|
2962
2988
|
] });
|
|
2963
|
-
},
|
|
2964
|
-
const
|
|
2965
|
-
return
|
|
2966
|
-
const
|
|
2967
|
-
return
|
|
2968
|
-
|
|
2989
|
+
}, Jn = ({ sourceType: t, url: s, mimeType: n, title: r, poster: l, onClose: u }) => {
|
|
2990
|
+
const i = J(null);
|
|
2991
|
+
return Z(() => {
|
|
2992
|
+
const d = i.current;
|
|
2993
|
+
return d == null || d.showModal(), () => {
|
|
2994
|
+
d != null && d.open && d.close();
|
|
2969
2995
|
};
|
|
2970
2996
|
}, []), // eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-noninteractive-element-interactions
|
|
2971
2997
|
/* @__PURE__ */ e(
|
|
2972
2998
|
"dialog",
|
|
2973
2999
|
{
|
|
2974
|
-
ref:
|
|
3000
|
+
ref: i,
|
|
2975
3001
|
className: "mes-media-viewer",
|
|
2976
3002
|
onClose: u,
|
|
2977
|
-
onClick: (
|
|
2978
|
-
|
|
3003
|
+
onClick: (d) => {
|
|
3004
|
+
d.target === i.current && u();
|
|
2979
3005
|
},
|
|
2980
|
-
children: /* @__PURE__ */
|
|
3006
|
+
children: /* @__PURE__ */ o("div", { className: "relative flex h-full w-full items-center justify-center p-6", children: [
|
|
2981
3007
|
/* @__PURE__ */ e(
|
|
2982
3008
|
"button",
|
|
2983
3009
|
{
|
|
@@ -2992,46 +3018,46 @@ const qn = ({
|
|
|
2992
3018
|
"img",
|
|
2993
3019
|
{
|
|
2994
3020
|
src: s,
|
|
2995
|
-
alt:
|
|
3021
|
+
alt: r ?? "",
|
|
2996
3022
|
className: "max-h-[90vh] max-w-[90vw] rounded-2xl object-contain"
|
|
2997
3023
|
}
|
|
2998
|
-
) : n === "application/pdf" ? /* @__PURE__ */
|
|
2999
|
-
|
|
3024
|
+
) : n === "application/pdf" ? /* @__PURE__ */ o("div", { className: "flex h-full w-full max-w-4xl flex-col pt-14", children: [
|
|
3025
|
+
r && /* @__PURE__ */ e("p", { className: "mb-2 shrink-0 truncate text-sm font-medium text-white/70", children: r }),
|
|
3000
3026
|
/* @__PURE__ */ e(
|
|
3001
3027
|
"iframe",
|
|
3002
3028
|
{
|
|
3003
3029
|
src: s,
|
|
3004
|
-
title:
|
|
3030
|
+
title: r ?? "Document",
|
|
3005
3031
|
className: "w-full flex-1 rounded-xl"
|
|
3006
3032
|
}
|
|
3007
3033
|
)
|
|
3008
|
-
] }) : /* @__PURE__ */
|
|
3009
|
-
|
|
3010
|
-
/* @__PURE__ */ e(
|
|
3034
|
+
] }) : /* @__PURE__ */ o("div", { className: "w-full max-w-2xl", children: [
|
|
3035
|
+
r && /* @__PURE__ */ e("p", { className: "mb-4 text-center text-sm font-medium text-white/70", children: r }),
|
|
3036
|
+
/* @__PURE__ */ e(Ye, { source: s, mimeType: n, poster: l, controls: !0 })
|
|
3011
3037
|
] })
|
|
3012
3038
|
] })
|
|
3013
3039
|
}
|
|
3014
3040
|
);
|
|
3015
|
-
},
|
|
3041
|
+
}, da = ({
|
|
3016
3042
|
message: t,
|
|
3017
3043
|
isMyMessage: s = !1
|
|
3018
3044
|
}) => {
|
|
3019
|
-
var
|
|
3020
|
-
const [n,
|
|
3021
|
-
(
|
|
3022
|
-
), u = (
|
|
3023
|
-
(
|
|
3024
|
-
),
|
|
3025
|
-
(
|
|
3026
|
-
),
|
|
3027
|
-
(
|
|
3028
|
-
),
|
|
3029
|
-
(
|
|
3030
|
-
),
|
|
3031
|
-
if (!l && !
|
|
3032
|
-
const
|
|
3033
|
-
return /* @__PURE__ */
|
|
3034
|
-
/* @__PURE__ */
|
|
3045
|
+
var v, _, L, N, g;
|
|
3046
|
+
const [n, r] = T(!1), l = (v = t.attachments) == null ? void 0 : v.find(
|
|
3047
|
+
(x) => x.type === "link" || x.og_scrape_url && !x.asset_url
|
|
3048
|
+
), u = (_ = t.attachments) == null ? void 0 : _.find(
|
|
3049
|
+
(x) => x.type === "video" && x.asset_url
|
|
3050
|
+
), i = (L = t.attachments) == null ? void 0 : L.find(
|
|
3051
|
+
(x) => x.type === "image" && x.image_url
|
|
3052
|
+
), c = (N = t.attachments) == null ? void 0 : N.find(
|
|
3053
|
+
(x) => x.type === "audio" && x.asset_url
|
|
3054
|
+
), f = (g = t.attachments) == null ? void 0 : g.find(
|
|
3055
|
+
(x) => x.type === "file" && x.asset_url
|
|
3056
|
+
), d = u ?? i ?? c ?? f, m = (u == null ? void 0 : u.asset_url) ?? (i == null ? void 0 : i.image_url) ?? (c == null ? void 0 : c.asset_url) ?? (f == null ? void 0 : f.asset_url), h = (d == null ? void 0 : d.mime_type) ?? ((d == null ? void 0 : d.type) === "image" ? "image/jpeg" : (d == null ? void 0 : d.type) === "video" ? "video/mp4" : (d == null ? void 0 : d.type) === "audio" ? "audio/mpeg" : "application/octet-stream");
|
|
3057
|
+
if (!l && !m) return null;
|
|
3058
|
+
const C = m ? Xe(h) : null, a = d == null ? void 0 : d.title, E = d == null ? void 0 : d.file_size, y = u == null ? void 0 : u.thumb_url, w = h === "application/pdf", b = s ? "str-chat__message str-chat__message-simple str-chat__message--me str-chat__message-simple--me" : "str-chat__message str-chat__message-simple str-chat__message--other", S = C === "image" || C === "video" || w;
|
|
3059
|
+
return /* @__PURE__ */ o(se, { children: [
|
|
3060
|
+
/* @__PURE__ */ o("div", { className: b, children: [
|
|
3035
3061
|
!s && t.user && /* @__PURE__ */ e(
|
|
3036
3062
|
ae,
|
|
3037
3063
|
{
|
|
@@ -3051,63 +3077,63 @@ const qn = ({
|
|
|
3051
3077
|
{
|
|
3052
3078
|
className: "str-chat__message-bubble",
|
|
3053
3079
|
style: { padding: 0, borderRadius: 0, overflow: "visible", background: "transparent" },
|
|
3054
|
-
children: /* @__PURE__ */ e("div", { className: Vn(s), children: l ? /* @__PURE__ */ e(
|
|
3080
|
+
children: /* @__PURE__ */ e("div", { className: Vn(s), children: l ? /* @__PURE__ */ e(Kn, { attachment: l, isMyMessage: s }) : C === "image" ? /* @__PURE__ */ o(se, { children: [
|
|
3055
3081
|
/* @__PURE__ */ e(
|
|
3056
3082
|
"button",
|
|
3057
3083
|
{
|
|
3058
3084
|
type: "button",
|
|
3059
|
-
onClick: () =>
|
|
3085
|
+
onClick: () => r(!0),
|
|
3060
3086
|
className: "block w-full cursor-zoom-in",
|
|
3061
|
-
children: /* @__PURE__ */ e("img", { src:
|
|
3087
|
+
children: /* @__PURE__ */ e("img", { src: m, alt: a ?? "", className: "block w-full" })
|
|
3062
3088
|
}
|
|
3063
3089
|
),
|
|
3064
3090
|
/* @__PURE__ */ e(
|
|
3065
3091
|
Me,
|
|
3066
3092
|
{
|
|
3067
|
-
mimeType:
|
|
3093
|
+
mimeType: h,
|
|
3068
3094
|
title: a,
|
|
3069
|
-
fileSize:
|
|
3070
|
-
url:
|
|
3095
|
+
fileSize: E,
|
|
3096
|
+
url: m,
|
|
3071
3097
|
isMyMessage: s
|
|
3072
3098
|
}
|
|
3073
3099
|
)
|
|
3074
|
-
] }) :
|
|
3100
|
+
] }) : C === "video" ? /* @__PURE__ */ o(se, { children: [
|
|
3075
3101
|
/* @__PURE__ */ e(
|
|
3076
|
-
|
|
3102
|
+
Ye,
|
|
3077
3103
|
{
|
|
3078
|
-
source:
|
|
3079
|
-
mimeType:
|
|
3080
|
-
poster:
|
|
3104
|
+
source: m,
|
|
3105
|
+
mimeType: h,
|
|
3106
|
+
poster: y,
|
|
3081
3107
|
controls: !0,
|
|
3082
|
-
onContainerClick: () =>
|
|
3108
|
+
onContainerClick: () => r(!0)
|
|
3083
3109
|
}
|
|
3084
3110
|
),
|
|
3085
3111
|
/* @__PURE__ */ e(
|
|
3086
3112
|
Me,
|
|
3087
3113
|
{
|
|
3088
|
-
mimeType:
|
|
3114
|
+
mimeType: h,
|
|
3089
3115
|
title: a,
|
|
3090
|
-
fileSize:
|
|
3091
|
-
url:
|
|
3116
|
+
fileSize: E,
|
|
3117
|
+
url: m,
|
|
3092
3118
|
isMyMessage: s
|
|
3093
3119
|
}
|
|
3094
3120
|
)
|
|
3095
|
-
] }) :
|
|
3121
|
+
] }) : C === "audio" ? /* @__PURE__ */ o(se, { children: [
|
|
3096
3122
|
/* @__PURE__ */ e(
|
|
3097
|
-
|
|
3123
|
+
Ye,
|
|
3098
3124
|
{
|
|
3099
|
-
source:
|
|
3100
|
-
mimeType:
|
|
3125
|
+
source: m,
|
|
3126
|
+
mimeType: h,
|
|
3101
3127
|
controls: !0
|
|
3102
3128
|
}
|
|
3103
3129
|
),
|
|
3104
3130
|
/* @__PURE__ */ e(
|
|
3105
3131
|
Me,
|
|
3106
3132
|
{
|
|
3107
|
-
mimeType:
|
|
3133
|
+
mimeType: h,
|
|
3108
3134
|
title: a,
|
|
3109
|
-
fileSize:
|
|
3110
|
-
url:
|
|
3135
|
+
fileSize: E,
|
|
3136
|
+
url: m,
|
|
3111
3137
|
isMyMessage: s
|
|
3112
3138
|
}
|
|
3113
3139
|
)
|
|
@@ -3116,12 +3142,12 @@ const qn = ({
|
|
|
3116
3142
|
/* @__PURE__ */ e(
|
|
3117
3143
|
Zn,
|
|
3118
3144
|
{
|
|
3119
|
-
url:
|
|
3120
|
-
mimeType:
|
|
3145
|
+
url: m,
|
|
3146
|
+
mimeType: h,
|
|
3121
3147
|
title: a,
|
|
3122
|
-
fileSize:
|
|
3148
|
+
fileSize: E,
|
|
3123
3149
|
isMyMessage: s,
|
|
3124
|
-
onExpand:
|
|
3150
|
+
onExpand: w ? () => r(!0) : void 0
|
|
3125
3151
|
}
|
|
3126
3152
|
)
|
|
3127
3153
|
) })
|
|
@@ -3130,81 +3156,81 @@ const qn = ({
|
|
|
3130
3156
|
}
|
|
3131
3157
|
)
|
|
3132
3158
|
] }),
|
|
3133
|
-
n &&
|
|
3134
|
-
|
|
3159
|
+
n && S && m && /* @__PURE__ */ e(
|
|
3160
|
+
Jn,
|
|
3135
3161
|
{
|
|
3136
|
-
sourceType:
|
|
3137
|
-
url:
|
|
3138
|
-
mimeType:
|
|
3162
|
+
sourceType: C,
|
|
3163
|
+
url: m,
|
|
3164
|
+
mimeType: h,
|
|
3139
3165
|
title: a,
|
|
3140
|
-
poster:
|
|
3141
|
-
onClose: () =>
|
|
3166
|
+
poster: y,
|
|
3167
|
+
onClose: () => r(!1)
|
|
3142
3168
|
}
|
|
3143
3169
|
)
|
|
3144
3170
|
] });
|
|
3145
|
-
},
|
|
3146
|
-
const { initialSearch: n = "", pageSize:
|
|
3147
|
-
if (
|
|
3148
|
-
const
|
|
3149
|
-
|
|
3171
|
+
}, ua = (t, s = {}) => {
|
|
3172
|
+
const { initialSearch: n = "", pageSize: r = 20 } = s, [l, u] = T([]), [i, c] = T(!1), [f, d] = T(null), [m, h] = T(n), [C, a] = T(!0), [E, y] = T(), w = O(async (_ = !1, L) => {
|
|
3173
|
+
if (i) return;
|
|
3174
|
+
const N = L !== void 0 ? L : m;
|
|
3175
|
+
c(!0), d(null);
|
|
3150
3176
|
try {
|
|
3151
|
-
const
|
|
3152
|
-
search:
|
|
3153
|
-
limit:
|
|
3154
|
-
cursor:
|
|
3177
|
+
const g = await t.loadParticipants({
|
|
3178
|
+
search: N || void 0,
|
|
3179
|
+
limit: r,
|
|
3180
|
+
cursor: _ ? void 0 : E
|
|
3155
3181
|
});
|
|
3156
3182
|
u(
|
|
3157
|
-
(
|
|
3158
|
-
), a(
|
|
3159
|
-
} catch (
|
|
3160
|
-
const
|
|
3161
|
-
|
|
3183
|
+
(x) => _ ? g.participants : [...x, ...g.participants]
|
|
3184
|
+
), a(g.hasMore), y(g.nextCursor);
|
|
3185
|
+
} catch (g) {
|
|
3186
|
+
const x = g instanceof Error ? g.message : "Failed to load participants";
|
|
3187
|
+
d(x), console.error("[useParticipants] Load error:", g);
|
|
3162
3188
|
} finally {
|
|
3163
|
-
|
|
3189
|
+
c(!1);
|
|
3164
3190
|
}
|
|
3165
|
-
}, [t,
|
|
3166
|
-
|
|
3167
|
-
}, [
|
|
3168
|
-
|
|
3169
|
-
}, [
|
|
3170
|
-
|
|
3171
|
-
}, [
|
|
3172
|
-
return
|
|
3173
|
-
|
|
3191
|
+
}, [t, m, E, r, i]), b = O(() => {
|
|
3192
|
+
C && !i && w(!1);
|
|
3193
|
+
}, [C, i, w]), S = O((_) => {
|
|
3194
|
+
h(_), y(void 0), w(!0, _);
|
|
3195
|
+
}, [w]), v = O(() => {
|
|
3196
|
+
y(void 0), w(!0);
|
|
3197
|
+
}, [w]);
|
|
3198
|
+
return Z(() => {
|
|
3199
|
+
w(!0);
|
|
3174
3200
|
}, [t.loadParticipants]), {
|
|
3175
3201
|
participants: l,
|
|
3176
|
-
loading:
|
|
3177
|
-
error:
|
|
3178
|
-
searchQuery:
|
|
3179
|
-
hasMore:
|
|
3202
|
+
loading: i,
|
|
3203
|
+
error: f,
|
|
3204
|
+
searchQuery: m,
|
|
3205
|
+
hasMore: C,
|
|
3180
3206
|
totalCount: t.totalCount,
|
|
3181
|
-
loadMore:
|
|
3182
|
-
search:
|
|
3183
|
-
refresh:
|
|
3207
|
+
loadMore: b,
|
|
3208
|
+
search: S,
|
|
3209
|
+
refresh: v
|
|
3184
3210
|
};
|
|
3185
3211
|
};
|
|
3186
3212
|
export {
|
|
3187
|
-
|
|
3188
|
-
|
|
3189
|
-
|
|
3190
|
-
|
|
3191
|
-
|
|
3192
|
-
|
|
3213
|
+
Se as A,
|
|
3214
|
+
Mn as C,
|
|
3215
|
+
ca as F,
|
|
3216
|
+
lt as L,
|
|
3217
|
+
Ye as M,
|
|
3218
|
+
Fn as P,
|
|
3193
3219
|
ae as a,
|
|
3194
|
-
|
|
3195
|
-
|
|
3196
|
-
|
|
3197
|
-
|
|
3198
|
-
|
|
3199
|
-
|
|
3200
|
-
|
|
3201
|
-
|
|
3202
|
-
|
|
3203
|
-
|
|
3204
|
-
|
|
3205
|
-
|
|
3206
|
-
|
|
3220
|
+
yt as b,
|
|
3221
|
+
St as c,
|
|
3222
|
+
la as d,
|
|
3223
|
+
On as e,
|
|
3224
|
+
da as f,
|
|
3225
|
+
Xe as g,
|
|
3226
|
+
dn as h,
|
|
3227
|
+
ia as i,
|
|
3228
|
+
oa as j,
|
|
3229
|
+
Bs as k,
|
|
3230
|
+
Qs as l,
|
|
3231
|
+
As as m,
|
|
3232
|
+
ua as n,
|
|
3207
3233
|
Ze as r,
|
|
3208
|
-
|
|
3234
|
+
ln as u
|
|
3209
3235
|
};
|
|
3210
|
-
//# sourceMappingURL=index-
|
|
3236
|
+
//# sourceMappingURL=index-DOsC03ZN.js.map
|