@linktr.ee/messaging-react 3.4.2-rc-1782395074 → 3.4.2-rc-1782453401
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-mpVcQ8-W.js → Card-52LnCirC.js} +3 -3
- package/dist/{Card-mpVcQ8-W.js.map → Card-52LnCirC.js.map} +1 -1
- package/dist/{Card-V-bNUxcw.cjs → Card-BIa-47Ne.cjs} +2 -2
- package/dist/{Card-V-bNUxcw.cjs.map → Card-BIa-47Ne.cjs.map} +1 -1
- package/dist/{Card-CphU_jG-.js → Card-BaXLsSK2.js} +2 -2
- package/dist/{Card-CphU_jG-.js.map → Card-BaXLsSK2.js.map} +1 -1
- package/dist/{Card-DFy_ZvFH.cjs → Card-BkVj6kGN.cjs} +2 -2
- package/dist/{Card-DFy_ZvFH.cjs.map → Card-BkVj6kGN.cjs.map} +1 -1
- package/dist/{Card-DxroYNrS.cjs → Card-CcTyYY9N.cjs} +2 -2
- package/dist/{Card-DxroYNrS.cjs.map → Card-CcTyYY9N.cjs.map} +1 -1
- package/dist/{Card-BKalDyyu.js → Card-ql9pImRa.js} +2 -2
- package/dist/{Card-BKalDyyu.js.map → Card-ql9pImRa.js.map} +1 -1
- package/dist/{LockedThumbnail-BD7qtcso.js → LockedThumbnail-C3YOnS-o.js} +2 -2
- package/dist/{LockedThumbnail-BD7qtcso.js.map → LockedThumbnail-C3YOnS-o.js.map} +1 -1
- package/dist/{LockedThumbnail-B3W7upHs.cjs → LockedThumbnail-D0ASm7LP.cjs} +2 -2
- package/dist/{LockedThumbnail-B3W7upHs.cjs.map → LockedThumbnail-D0ASm7LP.cjs.map} +1 -1
- package/dist/{index-CjwQ2Hj3.js → index-CbWEp3Zs.js} +1136 -1093
- package/dist/index-CbWEp3Zs.js.map +1 -0
- package/dist/index-DkqM2z_j.cjs +2 -0
- package/dist/index-DkqM2z_j.cjs.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +13 -25
- package/dist/index.js +13 -14
- package/package.json +2 -2
- package/src/components/ChannelList/CustomChannelPreview.stories.tsx +63 -0
- package/src/components/ChannelList/CustomChannelPreview.test.tsx +56 -6
- package/src/components/ChannelList/CustomChannelPreview.tsx +7 -10
- package/src/components/ChannelView.stories.tsx +38 -7
- package/src/components/ChannelView.test.tsx +29 -15
- package/src/components/ChannelView.tsx +19 -9
- package/src/components/CustomMessageInput/CustomMessageInput.test.tsx +0 -34
- package/src/components/CustomMessageInput/index.tsx +1 -23
- package/src/components/MessagingShell/index.tsx +0 -2
- package/src/components/ParticipantBadges.tsx +39 -0
- package/src/hooks/useChannelStar.ts +9 -6
- package/src/index.ts +0 -1
- package/src/stream-custom-data.ts +16 -1
- package/src/types.ts +0 -18
- package/dist/index-CjwQ2Hj3.js.map +0 -1
- package/dist/index-tI-4cxV1.cjs +0 -2
- package/dist/index-tI-4cxV1.cjs.map +0 -1
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { jsx as n, jsxs as h, Fragment as ae } from "react/jsx-runtime";
|
|
2
|
-
import j, { createContext as qe, useContext as
|
|
3
|
-
import { StreamChatService as
|
|
4
|
-
import { StreamChat as
|
|
5
|
-
import { Chat as
|
|
6
|
-
import { StarIcon as
|
|
2
|
+
import j, { createContext as qe, useContext as Re, useCallback as K, useState as $, useRef as G, useEffect as X, useId as In, useMemo as se, Suspense as We } from "react";
|
|
3
|
+
import { StreamChatService as Tn } from "@linktr.ee/messaging-core";
|
|
4
|
+
import { StreamChat as An, LinkPreviewsManager as Mt } from "stream-chat";
|
|
5
|
+
import { Chat as Mn, DateSeparator as Rn, useChannelStateContext as ce, useChatContext as Xe, areMessageUIPropsEqual as Ln, useMessageReminder as Dn, useComponentContext as Vt, Attachment as Pn, EditMessageModal as On, MessageBlocked as zn, MessageBouncePrompt as $n, MessageDeleted as Fn, MessageIsThreadReplyInChannelButtonIndicator as Bn, MessageRepliesCountButton as Un, ReminderNotification as jn, StreamedMessageText as Vn, messageHasAttachments as Gn, messageHasReactions as Hn, isDateSeparatorMessage as Yn, isMessageBlocked as qn, isMessageBounced as Wn, MessageBounceModal as Xn, MessageText as Rt, Poll as Kn, MessageErrorIcon as Jn, useMessageContext as we, useMessageComposer as Zn, useStateStore as Qn, MessageInput as es, useMessageInputContext as ts, useMessageComposerHasSendableData as ns, AttachmentPreviewList as ss, QuotedMessagePreview as as, TextareaComposer as rs, MessageTimestamp as Oe, AIStates as ze, useTypingContext as is, useAIState as ls, Channel as os, WithComponents as cs, Window as ds, MessageList as us, ChannelList as ms, InfiniteScroll as hs } from "stream-chat-react";
|
|
6
|
+
import { StarIcon as Se, DotsThreeIcon as fs, SpinnerGapIcon as Ee, SignOutIcon as gs, ProhibitInsetIcon as Lt, FlagIcon as Gt, FileIcon as Ht, ImageIcon as bs, SpeakerHighIcon as ps, VideoCameraIcon as Yt, FileMdIcon as vs, FileTextIcon as xs, FileZipIcon as ws, FilePptIcon as Ns, FileCsvIcon as _s, FileXlsIcon as ys, FileDocIcon as Cs, FilePdfIcon as ks, CircleNotchIcon as ve, PlayIcon as je, PauseIcon as Es, LinkIcon as Ss, DownloadSimpleIcon as xe, GiftIcon as Is, ThumbsUpIcon as Ts, ThumbsDownIcon as As, TrashSimpleIcon as Ms, XIcon as Le, ArrowUpIcon as Rs, SparkleIcon as Ve, ProhibitIcon as Ls, CurrencyDollarIcon as Ds, ArrowLeftIcon as Dt, CaretRightIcon as Ge, PencilSimpleIcon as Ps, CaretLeftIcon as Os } from "@phosphor-icons/react";
|
|
7
7
|
import y from "classnames";
|
|
8
|
-
import { MessageActions as
|
|
9
|
-
const
|
|
8
|
+
import { MessageActions as zs, DefaultDropdownActionButton as qt } from "stream-chat-react/experimental";
|
|
9
|
+
const Wt = qe({
|
|
10
10
|
service: null,
|
|
11
11
|
client: null,
|
|
12
12
|
isConnected: !1,
|
|
@@ -16,7 +16,7 @@ const Xt = qe({
|
|
|
16
16
|
refreshConnection: async () => {
|
|
17
17
|
},
|
|
18
18
|
debug: !1
|
|
19
|
-
}), Ke = () =>
|
|
19
|
+
}), Ke = () => Re(Wt), Ci = ({
|
|
20
20
|
children: e,
|
|
21
21
|
user: t,
|
|
22
22
|
serviceConfig: s,
|
|
@@ -24,10 +24,10 @@ const Xt = qe({
|
|
|
24
24
|
capabilities: r = {},
|
|
25
25
|
debug: i = !1
|
|
26
26
|
}) => {
|
|
27
|
-
var
|
|
28
|
-
const l =
|
|
29
|
-
(
|
|
30
|
-
i && console.log(`🔥 [MessagingProvider] ${
|
|
27
|
+
var D, C;
|
|
28
|
+
const l = K(
|
|
29
|
+
(I, ...T) => {
|
|
30
|
+
i && console.log(`🔥 [MessagingProvider] ${I}`, ...T);
|
|
31
31
|
},
|
|
32
32
|
[i]
|
|
33
33
|
);
|
|
@@ -37,61 +37,61 @@ const Xt = qe({
|
|
|
37
37
|
serviceConfig: !!s,
|
|
38
38
|
capabilities: Object.keys(r)
|
|
39
39
|
});
|
|
40
|
-
const [o, d] =
|
|
40
|
+
const [o, d] = $(null), [m, g] = $(null), [u, f] = $(!1), [c, b] = $(!1), [N, x] = $(null), p = G(!1), v = G(null), A = G(s);
|
|
41
41
|
A.current = s;
|
|
42
|
-
const
|
|
43
|
-
|
|
44
|
-
const
|
|
42
|
+
const R = G(i);
|
|
43
|
+
R.current = i;
|
|
44
|
+
const _ = G({
|
|
45
45
|
userId: t == null ? void 0 : t.id,
|
|
46
46
|
apiKey: a,
|
|
47
47
|
serviceConfig: s,
|
|
48
48
|
capabilities: r
|
|
49
|
-
}),
|
|
50
|
-
|
|
51
|
-
renderCount:
|
|
49
|
+
}), M = G(0);
|
|
50
|
+
M.current++, l("📊 RENDER INFO", {
|
|
51
|
+
renderCount: M.current,
|
|
52
52
|
currentProps: { userId: t == null ? void 0 : t.id, apiKey: (a == null ? void 0 : a.substring(0, 8)) + "..." },
|
|
53
53
|
propChanges: {
|
|
54
|
-
userChanged:
|
|
55
|
-
apiKeyChanged:
|
|
56
|
-
serviceConfigChanged:
|
|
57
|
-
capabilitiesChanged:
|
|
54
|
+
userChanged: _.current.userId !== (t == null ? void 0 : t.id),
|
|
55
|
+
apiKeyChanged: _.current.apiKey !== a,
|
|
56
|
+
serviceConfigChanged: _.current.serviceConfig !== s,
|
|
57
|
+
capabilitiesChanged: _.current.capabilities !== r
|
|
58
58
|
}
|
|
59
|
-
}),
|
|
59
|
+
}), _.current = {
|
|
60
60
|
userId: t == null ? void 0 : t.id,
|
|
61
61
|
apiKey: a,
|
|
62
62
|
serviceConfig: s,
|
|
63
63
|
capabilities: r
|
|
64
64
|
};
|
|
65
|
-
const
|
|
66
|
-
a && ((
|
|
67
|
-
const
|
|
68
|
-
|
|
69
|
-
const
|
|
70
|
-
if (!a || !
|
|
65
|
+
const z = G(null);
|
|
66
|
+
a && ((D = z.current) == null ? void 0 : D.apiKey) !== a && (z.current = { apiKey: a, client: new An(a) });
|
|
67
|
+
const O = a ? ((C = z.current) == null ? void 0 : C.client) ?? null : null;
|
|
68
|
+
X(() => {
|
|
69
|
+
const I = M.current, T = A.current;
|
|
70
|
+
if (!a || !O || !T) {
|
|
71
71
|
l("⚠️ SERVICE INIT SKIPPED", {
|
|
72
|
-
renderCount:
|
|
72
|
+
renderCount: I,
|
|
73
73
|
reason: "Missing apiKey, client, or serviceConfig"
|
|
74
74
|
});
|
|
75
75
|
return;
|
|
76
76
|
}
|
|
77
77
|
l("🚀 CREATING SERVICE", {
|
|
78
|
-
renderCount:
|
|
78
|
+
renderCount: I,
|
|
79
79
|
apiKey: (a == null ? void 0 : a.substring(0, 8)) + "..."
|
|
80
80
|
});
|
|
81
|
-
const
|
|
82
|
-
...
|
|
81
|
+
const P = new Tn({
|
|
82
|
+
...T,
|
|
83
83
|
apiKey: a,
|
|
84
|
-
debug:
|
|
85
|
-
client:
|
|
84
|
+
debug: R.current,
|
|
85
|
+
client: O
|
|
86
86
|
});
|
|
87
|
-
|
|
88
|
-
renderCount:
|
|
89
|
-
serviceInstance:
|
|
87
|
+
v.current = P, d(P), l("✅ SERVICE SET", {
|
|
88
|
+
renderCount: I,
|
|
89
|
+
serviceInstance: !!P
|
|
90
90
|
});
|
|
91
|
-
}, [a,
|
|
92
|
-
const
|
|
93
|
-
|
|
94
|
-
var
|
|
91
|
+
}, [a, O]);
|
|
92
|
+
const S = G(null);
|
|
93
|
+
X(() => {
|
|
94
|
+
var T, P;
|
|
95
95
|
if (l("🔗 USER CONNECTION EFFECT TRIGGERED", {
|
|
96
96
|
hasService: !!o,
|
|
97
97
|
hasUser: !!t,
|
|
@@ -107,7 +107,7 @@ const Xt = qe({
|
|
|
107
107
|
l("⚠️ USER CONNECTION SKIPPED", "Already connecting");
|
|
108
108
|
return;
|
|
109
109
|
}
|
|
110
|
-
if (((
|
|
110
|
+
if (((T = S.current) == null ? void 0 : T.serviceId) === o && ((P = S.current) == null ? void 0 : P.userId) === t.id) {
|
|
111
111
|
l(
|
|
112
112
|
"⚠️ USER CONNECTION SKIPPED",
|
|
113
113
|
"Already connected this user with this service"
|
|
@@ -115,19 +115,19 @@ const Xt = qe({
|
|
|
115
115
|
return;
|
|
116
116
|
}
|
|
117
117
|
(async () => {
|
|
118
|
-
l("🚀 STARTING USER CONNECTION", { userId: t.id }), p.current = !0, b(!0),
|
|
118
|
+
l("🚀 STARTING USER CONNECTION", { userId: t.id }), p.current = !0, b(!0), x(null);
|
|
119
119
|
try {
|
|
120
120
|
l("📞 CALLING SERVICE.CONNECTUSER", { userId: t.id });
|
|
121
|
-
const
|
|
122
|
-
g(
|
|
121
|
+
const F = await o.connectUser(t);
|
|
122
|
+
g(F), f(!0), S.current = { serviceId: o, userId: t.id }, l("✅ USER CONNECTION SUCCESS", {
|
|
123
123
|
userId: t.id,
|
|
124
|
-
clientId:
|
|
124
|
+
clientId: F.userID
|
|
125
125
|
});
|
|
126
|
-
} catch (
|
|
127
|
-
const
|
|
128
|
-
|
|
126
|
+
} catch (F) {
|
|
127
|
+
const Y = F instanceof Error ? F.message : "Connection failed";
|
|
128
|
+
x(Y), l("❌ USER CONNECTION ERROR", {
|
|
129
129
|
userId: t.id,
|
|
130
|
-
error:
|
|
130
|
+
error: Y
|
|
131
131
|
});
|
|
132
132
|
} finally {
|
|
133
133
|
b(!1), p.current = !1, l("🔄 USER CONNECTION FINISHED", {
|
|
@@ -136,14 +136,14 @@ const Xt = qe({
|
|
|
136
136
|
});
|
|
137
137
|
}
|
|
138
138
|
})();
|
|
139
|
-
}, [o, t, l, u]),
|
|
140
|
-
const
|
|
139
|
+
}, [o, t, l, u]), X(() => {
|
|
140
|
+
const I = O;
|
|
141
141
|
return () => {
|
|
142
|
-
var
|
|
143
|
-
|
|
142
|
+
var T;
|
|
143
|
+
I && (S.current = null, (T = v.current) == null || T.disconnectUser().catch(console.error));
|
|
144
144
|
};
|
|
145
|
-
}, [
|
|
146
|
-
const
|
|
145
|
+
}, [O]);
|
|
146
|
+
const E = K(async () => {
|
|
147
147
|
if (l("🔄 REFRESH CONNECTION CALLED", {
|
|
148
148
|
hasService: !!o,
|
|
149
149
|
hasUser: !!t
|
|
@@ -154,92 +154,91 @@ const Xt = qe({
|
|
|
154
154
|
l("🚀 STARTING CONNECTION REFRESH", { userId: t.id }), b(!0);
|
|
155
155
|
try {
|
|
156
156
|
l("🔌 DISCONNECTING FOR REFRESH"), await o.disconnectUser(), l("📞 RECONNECTING FOR REFRESH");
|
|
157
|
-
const
|
|
158
|
-
g(
|
|
159
|
-
} catch (
|
|
160
|
-
const
|
|
161
|
-
|
|
157
|
+
const I = await o.connectUser(t);
|
|
158
|
+
g(I), f(!0), x(null), l("✅ CONNECTION REFRESH SUCCESS", { userId: t.id });
|
|
159
|
+
} catch (I) {
|
|
160
|
+
const T = I instanceof Error ? I.message : "Refresh failed";
|
|
161
|
+
x(T), l("❌ CONNECTION REFRESH ERROR", {
|
|
162
162
|
userId: t.id,
|
|
163
|
-
error:
|
|
163
|
+
error: T
|
|
164
164
|
});
|
|
165
165
|
} finally {
|
|
166
166
|
b(!1), l("🔄 CONNECTION REFRESH FINISHED", { userId: t.id });
|
|
167
167
|
}
|
|
168
|
-
}, [o, t, l]),
|
|
168
|
+
}, [o, t, l]), L = j.useMemo(() => (l("💫 CONTEXT VALUE MEMOIZATION", {
|
|
169
169
|
hasService: !!o,
|
|
170
170
|
hasClient: !!m,
|
|
171
171
|
isConnected: u,
|
|
172
172
|
isLoading: c,
|
|
173
|
-
hasError: !!
|
|
173
|
+
hasError: !!N,
|
|
174
174
|
capabilitiesKeys: Object.keys(r)
|
|
175
175
|
}), {
|
|
176
176
|
service: o,
|
|
177
177
|
client: m,
|
|
178
178
|
isConnected: u,
|
|
179
179
|
isLoading: c,
|
|
180
|
-
error:
|
|
180
|
+
error: N,
|
|
181
181
|
capabilities: r,
|
|
182
|
-
refreshConnection:
|
|
182
|
+
refreshConnection: E,
|
|
183
183
|
debug: i
|
|
184
184
|
}), [
|
|
185
185
|
o,
|
|
186
186
|
m,
|
|
187
187
|
u,
|
|
188
188
|
c,
|
|
189
|
-
|
|
189
|
+
N,
|
|
190
190
|
r,
|
|
191
|
-
|
|
191
|
+
E,
|
|
192
192
|
i,
|
|
193
193
|
l
|
|
194
194
|
]);
|
|
195
195
|
return l("🔄 RENDER END", {
|
|
196
|
-
renderCount:
|
|
197
|
-
willRenderChat: !!
|
|
198
|
-
contextValueReady: !!
|
|
199
|
-
}), /* @__PURE__ */ n(
|
|
200
|
-
|
|
196
|
+
renderCount: M.current,
|
|
197
|
+
willRenderChat: !!O,
|
|
198
|
+
contextValueReady: !!L
|
|
199
|
+
}), /* @__PURE__ */ n(Wt.Provider, { value: L, children: O ? /* @__PURE__ */ n(
|
|
200
|
+
Mn,
|
|
201
201
|
{
|
|
202
|
-
client:
|
|
202
|
+
client: O,
|
|
203
203
|
customClasses: {
|
|
204
204
|
channelList: "str-chat__channel-list str-chat__channel-list-react bg-transparent lg:border-r-2 border-r-0 border-[#0000000A]"
|
|
205
205
|
},
|
|
206
206
|
children: e
|
|
207
207
|
}
|
|
208
208
|
) : e });
|
|
209
|
-
},
|
|
209
|
+
}, $s = () => Ke(), Xt = (e) => {
|
|
210
210
|
var a, r;
|
|
211
|
-
const [t, s] =
|
|
211
|
+
const [t, s] = $(
|
|
212
212
|
!!((r = (a = e == null ? void 0 : e.state) == null ? void 0 : a.membership) != null && r.pinned_at)
|
|
213
213
|
);
|
|
214
|
-
return
|
|
215
|
-
var
|
|
214
|
+
return X(() => {
|
|
215
|
+
var o;
|
|
216
216
|
if (!e) {
|
|
217
217
|
s(!1);
|
|
218
218
|
return;
|
|
219
219
|
}
|
|
220
|
-
s(!!((
|
|
221
|
-
const i = (
|
|
222
|
-
var
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
e.off("member.updated", i);
|
|
220
|
+
s(!!((o = e.state.membership) != null && o.pinned_at));
|
|
221
|
+
const i = (d) => {
|
|
222
|
+
var u, f, c, b, N;
|
|
223
|
+
const m = (u = e._client) == null ? void 0 : u.userID, g = ((f = d.member) == null ? void 0 : f.user_id) ?? ((b = (c = d.member) == null ? void 0 : c.user) == null ? void 0 : b.id);
|
|
224
|
+
!m || g !== m || s(!!((N = d.member) != null && N.pinned_at));
|
|
225
|
+
}, l = e.on("member.updated", i);
|
|
226
|
+
return () => {
|
|
227
|
+
l.unsubscribe();
|
|
229
228
|
};
|
|
230
229
|
}, [e]), t;
|
|
231
|
-
},
|
|
232
|
-
function
|
|
233
|
-
return
|
|
230
|
+
}, Fs = /^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;
|
|
231
|
+
function Bs(e) {
|
|
232
|
+
return Fs.test(e.trim());
|
|
234
233
|
}
|
|
235
234
|
function Pt(e, t) {
|
|
236
235
|
const s = e == null ? void 0 : e.trim();
|
|
237
|
-
return !s || t && s === t ? !1 :
|
|
236
|
+
return !s || t && s === t ? !1 : !Bs(s);
|
|
238
237
|
}
|
|
239
|
-
function
|
|
238
|
+
function Kt(e) {
|
|
240
239
|
return Pt(e == null ? void 0 : e.name, e == null ? void 0 : e.id) ? e.name.trim() : Pt(e == null ? void 0 : e.username, e == null ? void 0 : e.id) ? e.username.trim() : "Unknown member";
|
|
241
240
|
}
|
|
242
|
-
const
|
|
241
|
+
const Ot = [
|
|
243
242
|
"🍎",
|
|
244
243
|
// Apple
|
|
245
244
|
"🍌",
|
|
@@ -267,7 +266,7 @@ const zt = [
|
|
|
267
266
|
"🍈"
|
|
268
267
|
// Melon
|
|
269
268
|
];
|
|
270
|
-
function
|
|
269
|
+
function Us(e) {
|
|
271
270
|
let t = 0;
|
|
272
271
|
for (let s = 0; s < e.length; s++) {
|
|
273
272
|
const a = e.charCodeAt(s);
|
|
@@ -275,11 +274,11 @@ function Fs(e) {
|
|
|
275
274
|
}
|
|
276
275
|
return Math.abs(t);
|
|
277
276
|
}
|
|
278
|
-
function
|
|
279
|
-
const s =
|
|
280
|
-
return
|
|
277
|
+
function js(e) {
|
|
278
|
+
const s = Us(e) % Ot.length;
|
|
279
|
+
return Ot[s];
|
|
281
280
|
}
|
|
282
|
-
const
|
|
281
|
+
const ie = ({
|
|
283
282
|
id: e,
|
|
284
283
|
image: t,
|
|
285
284
|
size: s = 40,
|
|
@@ -288,7 +287,7 @@ const oe = ({
|
|
|
288
287
|
shape: i = "squircle",
|
|
289
288
|
dmAgentEnabled: l = !1
|
|
290
289
|
}) => {
|
|
291
|
-
const o =
|
|
290
|
+
const o = js(e), m = s < 32 ? "text-xs" : s < 56 ? "text-sm" : s < 120 ? "text-lg" : "text-4xl", g = s >= 40 ? 2 : 1, u = i === "circle" ? { borderRadius: "50%" } : { borderRadius: "1rem" }, f = /* @__PURE__ */ n("div", { className: "h-full w-full overflow-hidden", style: u, children: t ? /* @__PURE__ */ n(
|
|
292
291
|
"img",
|
|
293
292
|
{
|
|
294
293
|
src: t,
|
|
@@ -324,7 +323,7 @@ const oe = ({
|
|
|
324
323
|
{
|
|
325
324
|
"aria-hidden": "true",
|
|
326
325
|
className: "absolute -left-1.5 -top-1.5 z-10 flex size-5 items-center justify-center rounded-full bg-white shadow-[0_0_0_1px_rgba(0,0,0,0.04),0_4px_8px_rgba(0,0,0,0.06)]",
|
|
327
|
-
children: /* @__PURE__ */ n(
|
|
326
|
+
children: /* @__PURE__ */ n(Se, { className: "size-3 text-yellow-600", weight: "duotone" })
|
|
328
327
|
}
|
|
329
328
|
),
|
|
330
329
|
/* @__PURE__ */ n(
|
|
@@ -350,7 +349,7 @@ const oe = ({
|
|
|
350
349
|
]
|
|
351
350
|
}
|
|
352
351
|
);
|
|
353
|
-
},
|
|
352
|
+
}, Vs = "https://linktr.ee/s/about/trust-center/report", Gs = ({
|
|
354
353
|
channel: e,
|
|
355
354
|
participant: t,
|
|
356
355
|
showBlockParticipant: s = !0,
|
|
@@ -363,81 +362,81 @@ const oe = ({
|
|
|
363
362
|
onActionComplete: m,
|
|
364
363
|
logLabel: g = "useChannelModerationActions"
|
|
365
364
|
}) => {
|
|
366
|
-
var
|
|
367
|
-
const { service: u, debug: f } = Ke(), c = (
|
|
368
|
-
return
|
|
365
|
+
var D;
|
|
366
|
+
const { service: u, debug: f } = Ke(), c = (D = t == null ? void 0 : t.user) == null ? void 0 : D.id, b = !!(a && s && u && c), [N, x] = $(!1), [p, v] = $(null), [A, R] = $(!1), [_, M] = $(!1), z = b && ((p == null ? void 0 : p.participantId) !== c || (p == null ? void 0 : p.service) !== u);
|
|
367
|
+
return X(() => {
|
|
369
368
|
if (!b || !u || !c) {
|
|
370
|
-
|
|
369
|
+
x(!1), v(null);
|
|
371
370
|
return;
|
|
372
371
|
}
|
|
373
|
-
let
|
|
372
|
+
let C = !1;
|
|
374
373
|
return (async () => {
|
|
375
374
|
try {
|
|
376
|
-
const
|
|
377
|
-
if (
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
(
|
|
375
|
+
const I = await u.getBlockedUsers();
|
|
376
|
+
if (C) return;
|
|
377
|
+
x(
|
|
378
|
+
I.some(
|
|
379
|
+
(T) => T.blocked_user_id === c
|
|
381
380
|
)
|
|
382
381
|
);
|
|
383
|
-
} catch (
|
|
384
|
-
|
|
382
|
+
} catch (I) {
|
|
383
|
+
C || console.error(`[${g}] Failed to check blocked status:`, I);
|
|
385
384
|
} finally {
|
|
386
|
-
|
|
385
|
+
C || v({ participantId: c, service: u });
|
|
387
386
|
}
|
|
388
387
|
})(), () => {
|
|
389
|
-
|
|
388
|
+
C = !0;
|
|
390
389
|
};
|
|
391
390
|
}, [b, u, c, g]), {
|
|
392
|
-
isParticipantBlocked:
|
|
393
|
-
isCheckingBlockedStatus:
|
|
391
|
+
isParticipantBlocked: N,
|
|
392
|
+
isCheckingBlockedStatus: z,
|
|
394
393
|
isLeaving: A,
|
|
395
|
-
isUpdatingBlockStatus:
|
|
394
|
+
isUpdatingBlockStatus: _,
|
|
396
395
|
handleLeaveConversation: async () => {
|
|
397
|
-
var
|
|
396
|
+
var C;
|
|
398
397
|
if (!A) {
|
|
399
|
-
l == null || l(), f && console.log(`[${g}] Leave conversation`, e.cid),
|
|
398
|
+
l == null || l(), f && console.log(`[${g}] Leave conversation`, e.cid), R(!0);
|
|
400
399
|
try {
|
|
401
|
-
const
|
|
402
|
-
await e.hide(
|
|
403
|
-
} catch (
|
|
404
|
-
console.error(`[${g}] Failed to leave conversation`,
|
|
400
|
+
const I = ((C = e._client) == null ? void 0 : C.userID) ?? null;
|
|
401
|
+
await e.hide(I, !1), r && await r(e), m == null || m();
|
|
402
|
+
} catch (I) {
|
|
403
|
+
console.error(`[${g}] Failed to leave conversation`, I);
|
|
405
404
|
} finally {
|
|
406
|
-
|
|
405
|
+
R(!1);
|
|
407
406
|
}
|
|
408
407
|
}
|
|
409
408
|
},
|
|
410
409
|
handleBlockUser: async () => {
|
|
411
|
-
var
|
|
412
|
-
if (!(
|
|
413
|
-
o == null || o(), f && console.log(`[${g}] Block member`, (
|
|
410
|
+
var C, I, T;
|
|
411
|
+
if (!(_ || !u)) {
|
|
412
|
+
o == null || o(), f && console.log(`[${g}] Block member`, (C = t == null ? void 0 : t.user) == null ? void 0 : C.id), M(!0);
|
|
414
413
|
try {
|
|
415
|
-
await u.blockUser((
|
|
416
|
-
} catch (
|
|
417
|
-
console.error(`[${g}] Failed to block member`,
|
|
414
|
+
await u.blockUser((I = t == null ? void 0 : t.user) == null ? void 0 : I.id), i && await i((T = t == null ? void 0 : t.user) == null ? void 0 : T.id), m == null || m();
|
|
415
|
+
} catch (P) {
|
|
416
|
+
console.error(`[${g}] Failed to block member`, P);
|
|
418
417
|
} finally {
|
|
419
|
-
|
|
418
|
+
M(!1);
|
|
420
419
|
}
|
|
421
420
|
}
|
|
422
421
|
},
|
|
423
422
|
handleUnblockUser: async () => {
|
|
424
|
-
var
|
|
425
|
-
if (!(
|
|
426
|
-
o == null || o(), f && console.log(`[${g}] Unblock member`, (
|
|
423
|
+
var C, I, T;
|
|
424
|
+
if (!(_ || !u)) {
|
|
425
|
+
o == null || o(), f && console.log(`[${g}] Unblock member`, (C = t == null ? void 0 : t.user) == null ? void 0 : C.id), M(!0);
|
|
427
426
|
try {
|
|
428
|
-
await u.unBlockUser((
|
|
429
|
-
} catch (
|
|
430
|
-
console.error(`[${g}] Failed to unblock member`,
|
|
427
|
+
await u.unBlockUser((I = t == null ? void 0 : t.user) == null ? void 0 : I.id), i && await i((T = t == null ? void 0 : t.user) == null ? void 0 : T.id), m == null || m();
|
|
428
|
+
} catch (P) {
|
|
429
|
+
console.error(`[${g}] Failed to unblock member`, P);
|
|
431
430
|
} finally {
|
|
432
|
-
|
|
431
|
+
M(!1);
|
|
433
432
|
}
|
|
434
433
|
}
|
|
435
434
|
},
|
|
436
435
|
handleReportUser: () => {
|
|
437
|
-
d == null || d(), m == null || m(), window.open(
|
|
436
|
+
d == null || d(), m == null || m(), window.open(Vs, "_blank", "noopener,noreferrer");
|
|
438
437
|
}
|
|
439
438
|
};
|
|
440
|
-
},
|
|
439
|
+
}, ge = ({
|
|
441
440
|
variant: e = "default",
|
|
442
441
|
className: t,
|
|
443
442
|
children: s,
|
|
@@ -454,7 +453,7 @@ const oe = ({
|
|
|
454
453
|
...a,
|
|
455
454
|
children: s
|
|
456
455
|
}
|
|
457
|
-
),
|
|
456
|
+
), zt = ({
|
|
458
457
|
channel: e,
|
|
459
458
|
participant: t,
|
|
460
459
|
showDeleteConversation: s = !0,
|
|
@@ -468,16 +467,16 @@ const oe = ({
|
|
|
468
467
|
customChannelActions: g,
|
|
469
468
|
triggerClassName: u
|
|
470
469
|
}) => {
|
|
471
|
-
const [f, c] =
|
|
470
|
+
const [f, c] = $(!1), b = G(null), N = In(), x = K(() => c(!1), []), {
|
|
472
471
|
isParticipantBlocked: p,
|
|
473
|
-
isCheckingBlockedStatus:
|
|
472
|
+
isCheckingBlockedStatus: v,
|
|
474
473
|
isLeaving: A,
|
|
475
|
-
isUpdatingBlockStatus:
|
|
476
|
-
handleLeaveConversation:
|
|
477
|
-
handleBlockUser:
|
|
478
|
-
handleUnblockUser:
|
|
479
|
-
handleReportUser:
|
|
480
|
-
} =
|
|
474
|
+
isUpdatingBlockStatus: R,
|
|
475
|
+
handleLeaveConversation: _,
|
|
476
|
+
handleBlockUser: M,
|
|
477
|
+
handleUnblockUser: z,
|
|
478
|
+
handleReportUser: O
|
|
479
|
+
} = Gs({
|
|
481
480
|
channel: e,
|
|
482
481
|
participant: t,
|
|
483
482
|
showBlockParticipant: a,
|
|
@@ -487,18 +486,18 @@ const oe = ({
|
|
|
487
486
|
onDeleteConversationClick: o,
|
|
488
487
|
onBlockParticipantClick: d,
|
|
489
488
|
onReportParticipantClick: m,
|
|
490
|
-
onActionComplete:
|
|
489
|
+
onActionComplete: x,
|
|
491
490
|
logLabel: "ChannelActionsMenu"
|
|
492
491
|
});
|
|
493
|
-
return
|
|
492
|
+
return X(() => {
|
|
494
493
|
if (!f) return;
|
|
495
|
-
const
|
|
496
|
-
b.current && !b.current.contains(
|
|
497
|
-
},
|
|
498
|
-
|
|
494
|
+
const E = (D) => {
|
|
495
|
+
b.current && !b.current.contains(D.target) && c(!1);
|
|
496
|
+
}, L = (D) => {
|
|
497
|
+
D.key === "Escape" && c(!1);
|
|
499
498
|
};
|
|
500
|
-
return document.addEventListener("mousedown",
|
|
501
|
-
document.removeEventListener("mousedown",
|
|
499
|
+
return document.addEventListener("mousedown", E), document.addEventListener("keydown", L), () => {
|
|
500
|
+
document.removeEventListener("mousedown", E), document.removeEventListener("keydown", L);
|
|
502
501
|
};
|
|
503
502
|
}, [f]), !t || !(s || a || r || !!g) ? null : /* @__PURE__ */ h("div", { ref: b, className: "relative", children: [
|
|
504
503
|
/* @__PURE__ */ h(
|
|
@@ -508,10 +507,10 @@ const oe = ({
|
|
|
508
507
|
type: "button",
|
|
509
508
|
"aria-haspopup": "true",
|
|
510
509
|
"aria-expanded": f,
|
|
511
|
-
"aria-controls": f ?
|
|
512
|
-
onClick: () => c((
|
|
510
|
+
"aria-controls": f ? N : void 0,
|
|
511
|
+
onClick: () => c((E) => !E),
|
|
513
512
|
children: [
|
|
514
|
-
/* @__PURE__ */ n(
|
|
513
|
+
/* @__PURE__ */ n(fs, { className: "size-5 text-black/90" }),
|
|
515
514
|
/* @__PURE__ */ n("span", { className: "sr-only", children: "More options" })
|
|
516
515
|
]
|
|
517
516
|
}
|
|
@@ -519,7 +518,7 @@ const oe = ({
|
|
|
519
518
|
f && /* @__PURE__ */ n(
|
|
520
519
|
"div",
|
|
521
520
|
{
|
|
522
|
-
id:
|
|
521
|
+
id: N,
|
|
523
522
|
"aria-label": "Conversation options",
|
|
524
523
|
className: y(
|
|
525
524
|
"absolute right-0 top-full z-50 mt-2 w-56 overflow-hidden",
|
|
@@ -527,49 +526,49 @@ const oe = ({
|
|
|
527
526
|
),
|
|
528
527
|
children: /* @__PURE__ */ h("ul", { className: "flex flex-col gap-1", children: [
|
|
529
528
|
s && /* @__PURE__ */ n("li", { children: /* @__PURE__ */ h(
|
|
530
|
-
|
|
529
|
+
ge,
|
|
531
530
|
{
|
|
532
|
-
onClick:
|
|
531
|
+
onClick: _,
|
|
533
532
|
disabled: A,
|
|
534
533
|
"aria-busy": A,
|
|
535
534
|
children: [
|
|
536
|
-
A ? /* @__PURE__ */ n(
|
|
535
|
+
A ? /* @__PURE__ */ n(Ee, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ n(gs, { className: "h-5 w-5" }),
|
|
537
536
|
/* @__PURE__ */ n("span", { children: "Delete Conversation" })
|
|
538
537
|
]
|
|
539
538
|
}
|
|
540
539
|
) }),
|
|
541
|
-
a && /* @__PURE__ */ n("li", { children:
|
|
540
|
+
a && /* @__PURE__ */ n("li", { children: v ? (
|
|
542
541
|
// Block status not yet resolved — show a disabled placeholder
|
|
543
542
|
// so a premature click can't act on a stale block state.
|
|
544
|
-
/* @__PURE__ */ h(
|
|
545
|
-
/* @__PURE__ */ n(
|
|
543
|
+
/* @__PURE__ */ h(ge, { disabled: !0, "aria-busy": !0, children: [
|
|
544
|
+
/* @__PURE__ */ n(Ee, { className: "h-5 w-5 animate-spin" }),
|
|
546
545
|
/* @__PURE__ */ n("span", { children: "Block" })
|
|
547
546
|
] })
|
|
548
547
|
) : p ? /* @__PURE__ */ h(
|
|
549
|
-
|
|
548
|
+
ge,
|
|
550
549
|
{
|
|
551
|
-
onClick:
|
|
552
|
-
disabled:
|
|
553
|
-
"aria-busy":
|
|
550
|
+
onClick: z,
|
|
551
|
+
disabled: R,
|
|
552
|
+
"aria-busy": R,
|
|
554
553
|
children: [
|
|
555
|
-
|
|
554
|
+
R ? /* @__PURE__ */ n(Ee, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ n(Lt, { className: "h-5 w-5" }),
|
|
556
555
|
/* @__PURE__ */ n("span", { children: "Unblock" })
|
|
557
556
|
]
|
|
558
557
|
}
|
|
559
558
|
) : /* @__PURE__ */ h(
|
|
560
|
-
|
|
559
|
+
ge,
|
|
561
560
|
{
|
|
562
|
-
onClick:
|
|
563
|
-
disabled:
|
|
564
|
-
"aria-busy":
|
|
561
|
+
onClick: M,
|
|
562
|
+
disabled: R,
|
|
563
|
+
"aria-busy": R,
|
|
565
564
|
children: [
|
|
566
|
-
|
|
565
|
+
R ? /* @__PURE__ */ n(Ee, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ n(Lt, { className: "h-5 w-5" }),
|
|
567
566
|
/* @__PURE__ */ n("span", { children: "Block" })
|
|
568
567
|
]
|
|
569
568
|
}
|
|
570
569
|
) }),
|
|
571
|
-
r && /* @__PURE__ */ n("li", { children: /* @__PURE__ */ h(
|
|
572
|
-
/* @__PURE__ */ n(
|
|
570
|
+
r && /* @__PURE__ */ n("li", { children: /* @__PURE__ */ h(ge, { variant: "danger", onClick: O, children: [
|
|
571
|
+
/* @__PURE__ */ n(Gt, { className: "h-5 w-5" }),
|
|
573
572
|
/* @__PURE__ */ n("span", { children: "Report" })
|
|
574
573
|
] }) }),
|
|
575
574
|
g
|
|
@@ -577,15 +576,15 @@ const oe = ({
|
|
|
577
576
|
}
|
|
578
577
|
)
|
|
579
578
|
] });
|
|
580
|
-
},
|
|
581
|
-
function
|
|
579
|
+
}, Hs = (e) => /* @__PURE__ */ n(Rn, { ...e, position: "center" }), He = "vote_up", Ye = "vote_down";
|
|
580
|
+
function Ys(e) {
|
|
582
581
|
return e != null && e.length ? e.some((t) => t.type === Ye) ? "down" : e.some((t) => t.type === He) ? "up" : null : null;
|
|
583
582
|
}
|
|
584
|
-
function
|
|
585
|
-
const { channel: t } =
|
|
586
|
-
() =>
|
|
583
|
+
function qs(e) {
|
|
584
|
+
const { channel: t } = ce(), { client: s } = Xe("useMessageVote"), a = se(
|
|
585
|
+
() => Ys(e.own_reactions),
|
|
587
586
|
[e.own_reactions]
|
|
588
|
-
), r =
|
|
587
|
+
), r = K(async () => {
|
|
589
588
|
if (s != null && s.userID)
|
|
590
589
|
try {
|
|
591
590
|
a === "up" ? await t.deleteReaction(e.id, He) : await t.sendReaction(
|
|
@@ -595,7 +594,7 @@ function Hs(e) {
|
|
|
595
594
|
);
|
|
596
595
|
} catch {
|
|
597
596
|
}
|
|
598
|
-
}, [t, s == null ? void 0 : s.userID, e.id, a]), i =
|
|
597
|
+
}, [t, s == null ? void 0 : s.userID, e.id, a]), i = K(async () => {
|
|
599
598
|
if (s != null && s.userID)
|
|
600
599
|
try {
|
|
601
600
|
a === "down" ? await t.deleteReaction(e.id, Ye) : await t.sendReaction(
|
|
@@ -608,24 +607,24 @@ function Hs(e) {
|
|
|
608
607
|
}, [t, s == null ? void 0 : s.userID, e.id, a]);
|
|
609
608
|
return { selected: a, voteUp: r, voteDown: i };
|
|
610
609
|
}
|
|
611
|
-
function
|
|
610
|
+
function Ws(e) {
|
|
612
611
|
return (e == null ? void 0 : e.trim().toLowerCase().split(/[-_]/)[0]) || void 0;
|
|
613
612
|
}
|
|
614
|
-
function
|
|
613
|
+
function Jt({
|
|
615
614
|
message: e,
|
|
616
615
|
viewerLanguage: t
|
|
617
616
|
}) {
|
|
618
617
|
var r;
|
|
619
|
-
const s = e == null ? void 0 : e.text, a =
|
|
618
|
+
const s = e == null ? void 0 : e.text, a = Ws(t);
|
|
620
619
|
return a ? ((r = e == null ? void 0 : e.i18n) == null ? void 0 : r[`${a}_text`]) ?? s : s;
|
|
621
620
|
}
|
|
622
|
-
const
|
|
621
|
+
const Xs = j.lazy(() => import("./Card-BaXLsSK2.js")), Ks = j.lazy(() => import("./Card-ql9pImRa.js")), Js = j.lazy(() => import("./Card-52LnCirC.js")), Je = () => /* @__PURE__ */ n(
|
|
623
622
|
"div",
|
|
624
623
|
{
|
|
625
624
|
className: "w-[280px] min-h-[200px] animate-pulse rounded-md bg-black/[0.06] shadow-[0_0_0_1px_rgba(0,0,0,0.04),0_1px_2px_rgba(0,0,0,0.04),0_8px_32px_rgba(0,0,0,0.1)]",
|
|
626
625
|
"aria-hidden": !0
|
|
627
626
|
}
|
|
628
|
-
),
|
|
627
|
+
), Zs = (e) => /* @__PURE__ */ n(We, { fallback: /* @__PURE__ */ n(Je, {}), children: /* @__PURE__ */ n(Xs, { ...e }) }), Zt = (e) => /* @__PURE__ */ n(We, { fallback: /* @__PURE__ */ n(Je, {}), children: /* @__PURE__ */ n(Ks, { ...e }) }), Qt = (e) => /* @__PURE__ */ n(We, { fallback: /* @__PURE__ */ n(Je, {}), children: /* @__PURE__ */ n(Js, { ...e }) }), Qs = Zt, ea = Qt, $t = { Composer: Zs, Sent: Zt, Received: Qt, Creator: Qs, Visitor: ea }, ta = [
|
|
629
628
|
[/pdf/, "pdf"],
|
|
630
629
|
[/wordprocessingml|msword|\.doc/, "doc"],
|
|
631
630
|
[/spreadsheetml|ms-excel|\.xls/, "xls"],
|
|
@@ -638,39 +637,39 @@ const qs = j.lazy(() => import("./Card-CphU_jG-.js")), Ws = j.lazy(() => import(
|
|
|
638
637
|
function re(e) {
|
|
639
638
|
return e.startsWith("video/") ? "video" : e.startsWith("audio/") ? "audio" : e.startsWith("image/") ? "image" : "document";
|
|
640
639
|
}
|
|
641
|
-
function
|
|
642
|
-
const t =
|
|
640
|
+
function en(e) {
|
|
641
|
+
const t = ta.find(
|
|
643
642
|
([s]) => s.test(e)
|
|
644
643
|
);
|
|
645
644
|
return t ? t[1] : "generic";
|
|
646
645
|
}
|
|
647
|
-
const
|
|
648
|
-
video:
|
|
649
|
-
audio:
|
|
650
|
-
image:
|
|
651
|
-
document:
|
|
652
|
-
},
|
|
653
|
-
pdf:
|
|
654
|
-
doc:
|
|
655
|
-
xls:
|
|
646
|
+
const na = {
|
|
647
|
+
video: Yt,
|
|
648
|
+
audio: ps,
|
|
649
|
+
image: bs,
|
|
650
|
+
document: Ht
|
|
651
|
+
}, sa = {
|
|
652
|
+
pdf: ks,
|
|
653
|
+
doc: Cs,
|
|
654
|
+
xls: ys,
|
|
656
655
|
csv: _s,
|
|
657
|
-
ppt:
|
|
658
|
-
zip:
|
|
659
|
-
text:
|
|
660
|
-
markdown:
|
|
661
|
-
generic:
|
|
656
|
+
ppt: Ns,
|
|
657
|
+
zip: ws,
|
|
658
|
+
text: xs,
|
|
659
|
+
markdown: vs,
|
|
660
|
+
generic: Ht
|
|
662
661
|
};
|
|
663
|
-
function
|
|
662
|
+
function aa(e) {
|
|
664
663
|
const t = re(e);
|
|
665
|
-
return t !== "document" ?
|
|
664
|
+
return t !== "document" ? na[t] : sa[en(e)];
|
|
666
665
|
}
|
|
667
|
-
function
|
|
668
|
-
return j.createElement(
|
|
666
|
+
function oe(e, t) {
|
|
667
|
+
return j.createElement(aa(e), t);
|
|
669
668
|
}
|
|
670
|
-
const
|
|
669
|
+
const ra = (e) => {
|
|
671
670
|
var t, s;
|
|
672
671
|
return "touches" in e ? ((t = e.touches[0]) == null ? void 0 : t.clientX) ?? ((s = e.changedTouches[0]) == null ? void 0 : s.clientX) ?? 0 : e.clientX;
|
|
673
|
-
},
|
|
672
|
+
}, ia = ({
|
|
674
673
|
source: e,
|
|
675
674
|
mimeType: t,
|
|
676
675
|
poster: s,
|
|
@@ -682,78 +681,78 @@ const sa = (e) => {
|
|
|
682
681
|
muted: d = !1,
|
|
683
682
|
onContainerClick: m
|
|
684
683
|
}) => {
|
|
685
|
-
const g = re(t), u = G(null), f = G(null), c = G(null), b = G(r), [
|
|
686
|
-
|
|
687
|
-
}, []),
|
|
688
|
-
const
|
|
689
|
-
if (!
|
|
690
|
-
const
|
|
684
|
+
const g = re(t), u = G(null), f = G(null), c = G(null), b = G(r), [N, x] = $(a), [p, v] = $(0), [A, R] = $(!1), [_, M] = $(!1), [z, O] = $(!1), [S, E] = $(!1), [L, D] = $(!0), [C, I] = $(null), T = K(() => {
|
|
685
|
+
O(!1), x(!0);
|
|
686
|
+
}, []), P = K((w) => {
|
|
687
|
+
const k = f.current;
|
|
688
|
+
if (!k) return 0;
|
|
689
|
+
const B = k.getBoundingClientRect();
|
|
691
690
|
return Math.max(
|
|
692
691
|
0,
|
|
693
|
-
Math.min(1, (
|
|
692
|
+
Math.min(1, (ra(w) - B.left) / B.width)
|
|
694
693
|
);
|
|
695
|
-
}, []),
|
|
696
|
-
const
|
|
697
|
-
|
|
698
|
-
}, []),
|
|
699
|
-
|
|
700
|
-
const
|
|
701
|
-
|
|
694
|
+
}, []), F = K((w) => {
|
|
695
|
+
const k = u.current;
|
|
696
|
+
k && k.duration && (k.currentTime = w * k.duration);
|
|
697
|
+
}, []), Y = (w) => {
|
|
698
|
+
w.stopPropagation(), R(!0);
|
|
699
|
+
const k = P(w);
|
|
700
|
+
v(k), F(k);
|
|
702
701
|
};
|
|
703
|
-
|
|
704
|
-
r !== void 0 && r !== b.current && (b.current = r,
|
|
705
|
-
}, [r]),
|
|
706
|
-
if (!
|
|
702
|
+
X(() => {
|
|
703
|
+
r !== void 0 && r !== b.current && (b.current = r, x(r));
|
|
704
|
+
}, [r]), X(() => {
|
|
705
|
+
if (!N) {
|
|
707
706
|
c.current !== null && (cancelAnimationFrame(c.current), c.current = null);
|
|
708
707
|
return;
|
|
709
708
|
}
|
|
710
|
-
const
|
|
711
|
-
const
|
|
712
|
-
|
|
709
|
+
const w = () => {
|
|
710
|
+
const k = u.current;
|
|
711
|
+
k && k.duration && !A && v(k.currentTime / k.duration), c.current = requestAnimationFrame(w);
|
|
713
712
|
};
|
|
714
|
-
return c.current = requestAnimationFrame(
|
|
713
|
+
return c.current = requestAnimationFrame(w), () => {
|
|
715
714
|
c.current !== null && cancelAnimationFrame(c.current);
|
|
716
715
|
};
|
|
717
|
-
}, [
|
|
718
|
-
const
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
}) :
|
|
722
|
-
}, [
|
|
716
|
+
}, [N, A]), X(() => {
|
|
717
|
+
const w = u.current;
|
|
718
|
+
w && (N ? w.play().catch((k) => {
|
|
719
|
+
x(!1), O(!0);
|
|
720
|
+
}) : w.pause());
|
|
721
|
+
}, [N]), X(() => {
|
|
723
722
|
if (!A) return;
|
|
724
|
-
const
|
|
725
|
-
|
|
723
|
+
const w = (B) => v(P(B)), k = (B) => {
|
|
724
|
+
R(!1), F(P(B));
|
|
726
725
|
};
|
|
727
|
-
return window.addEventListener("mousemove",
|
|
728
|
-
window.removeEventListener("mousemove",
|
|
726
|
+
return window.addEventListener("mousemove", w), window.addEventListener("mouseup", k), window.addEventListener("touchmove", w, { passive: !0 }), window.addEventListener("touchend", k), () => {
|
|
727
|
+
window.removeEventListener("mousemove", w), window.removeEventListener("mouseup", k), window.removeEventListener("touchmove", w), window.removeEventListener("touchend", k);
|
|
729
728
|
};
|
|
730
|
-
}, [A,
|
|
731
|
-
const
|
|
729
|
+
}, [A, P, F]);
|
|
730
|
+
const Z = C ? { aspectRatio: String(C) } : void 0, J = C ? "" : " aspect-video", U = Math.round(p * 100);
|
|
732
731
|
return /* @__PURE__ */ h(
|
|
733
732
|
"div",
|
|
734
733
|
{
|
|
735
734
|
role: "button",
|
|
736
735
|
tabIndex: 0,
|
|
737
|
-
className: `relative cursor-pointer overflow-hidden bg-black ${
|
|
738
|
-
style:
|
|
739
|
-
onClick: (
|
|
736
|
+
className: `relative cursor-pointer overflow-hidden bg-black ${J}`,
|
|
737
|
+
style: Z,
|
|
738
|
+
onClick: (w) => {
|
|
740
739
|
if (m) {
|
|
741
|
-
m(
|
|
740
|
+
m(w);
|
|
742
741
|
return;
|
|
743
742
|
}
|
|
744
|
-
|
|
743
|
+
z || l && x((k) => !k);
|
|
745
744
|
},
|
|
746
|
-
onKeyDown: (
|
|
747
|
-
if (!(
|
|
748
|
-
if (
|
|
749
|
-
m(
|
|
745
|
+
onKeyDown: (w) => {
|
|
746
|
+
if (!(w.key !== "Enter" && w.key !== " ")) {
|
|
747
|
+
if (w.preventDefault(), m) {
|
|
748
|
+
m(w);
|
|
750
749
|
return;
|
|
751
750
|
}
|
|
752
|
-
|
|
751
|
+
z || l && x((k) => !k);
|
|
753
752
|
}
|
|
754
753
|
},
|
|
755
754
|
children: [
|
|
756
|
-
s && (g === "audio" ||
|
|
755
|
+
s && (g === "audio" || L) && /* @__PURE__ */ n(
|
|
757
756
|
"img",
|
|
758
757
|
{
|
|
759
758
|
src: s,
|
|
@@ -761,7 +760,7 @@ const sa = (e) => {
|
|
|
761
760
|
className: "absolute inset-0 h-full w-full object-cover"
|
|
762
761
|
}
|
|
763
762
|
),
|
|
764
|
-
!s && (g === "audio" ||
|
|
763
|
+
!s && (g === "audio" || L) && /* @__PURE__ */ n("div", { className: "absolute inset-0 flex items-center justify-center", children: oe(t, {
|
|
765
764
|
className: "size-12 text-black/20",
|
|
766
765
|
weight: "regular"
|
|
767
766
|
}) }),
|
|
@@ -773,14 +772,14 @@ const sa = (e) => {
|
|
|
773
772
|
loop: i,
|
|
774
773
|
muted: d,
|
|
775
774
|
style: { width: "100%", height: "100%" },
|
|
776
|
-
onLoadStart: () =>
|
|
775
|
+
onLoadStart: () => E(!0),
|
|
777
776
|
onCanPlay: () => {
|
|
778
|
-
|
|
777
|
+
E(!1), D(!1);
|
|
779
778
|
},
|
|
780
|
-
onWaiting: () =>
|
|
781
|
-
onPlay: () =>
|
|
779
|
+
onWaiting: () => E(!0),
|
|
780
|
+
onPlay: () => O(!1),
|
|
782
781
|
onEnded: () => {
|
|
783
|
-
i || (
|
|
782
|
+
i || (x(!1), v(0));
|
|
784
783
|
},
|
|
785
784
|
children: /* @__PURE__ */ n("track", { kind: "captions" })
|
|
786
785
|
}
|
|
@@ -793,41 +792,41 @@ const sa = (e) => {
|
|
|
793
792
|
muted: d,
|
|
794
793
|
playsInline: !0,
|
|
795
794
|
style: { width: "100%", height: "100%" },
|
|
796
|
-
onLoadStart: () =>
|
|
795
|
+
onLoadStart: () => E(!0),
|
|
797
796
|
onCanPlay: () => {
|
|
798
|
-
|
|
797
|
+
E(!1), D(!1);
|
|
799
798
|
},
|
|
800
|
-
onWaiting: () =>
|
|
801
|
-
onPlay: () =>
|
|
799
|
+
onWaiting: () => E(!0),
|
|
800
|
+
onPlay: () => O(!1),
|
|
802
801
|
onLoadedMetadata: () => {
|
|
803
|
-
const
|
|
804
|
-
|
|
802
|
+
const w = u.current;
|
|
803
|
+
w instanceof HTMLVideoElement && w.videoWidth && w.videoHeight && I(w.videoWidth / w.videoHeight);
|
|
805
804
|
},
|
|
806
805
|
onEnded: () => {
|
|
807
|
-
i || (
|
|
806
|
+
i || (x(!1), v(0));
|
|
808
807
|
},
|
|
809
808
|
children: /* @__PURE__ */ n("track", { kind: "captions" })
|
|
810
809
|
}
|
|
811
810
|
) }),
|
|
812
|
-
|
|
811
|
+
S && !z && /* @__PURE__ */ n("div", { className: "absolute inset-0 z-10 flex items-center justify-center", children: /* @__PURE__ */ n(
|
|
813
812
|
ve,
|
|
814
813
|
{
|
|
815
814
|
className: "size-8 animate-spin text-white/80",
|
|
816
815
|
weight: "bold"
|
|
817
816
|
}
|
|
818
817
|
) }),
|
|
819
|
-
|
|
818
|
+
z && !l && /* @__PURE__ */ n(
|
|
820
819
|
"div",
|
|
821
820
|
{
|
|
822
821
|
className: "absolute inset-0 z-30 flex cursor-pointer items-center justify-center bg-black/35",
|
|
823
822
|
role: "button",
|
|
824
823
|
tabIndex: 0,
|
|
825
824
|
"aria-label": "Play preview",
|
|
826
|
-
onClick: (
|
|
827
|
-
|
|
825
|
+
onClick: (w) => {
|
|
826
|
+
w.stopPropagation(), T();
|
|
828
827
|
},
|
|
829
|
-
onKeyDown: (
|
|
830
|
-
|
|
828
|
+
onKeyDown: (w) => {
|
|
829
|
+
w.key !== "Enter" && w.key !== " " || (w.preventDefault(), w.stopPropagation(), T());
|
|
831
830
|
},
|
|
832
831
|
children: /* @__PURE__ */ n("span", { className: "flex size-16 items-center justify-center rounded-full bg-white/20 text-white backdrop-blur-sm", children: /* @__PURE__ */ n(je, { className: "size-9 translate-x-0.5", weight: "fill" }) })
|
|
833
832
|
}
|
|
@@ -837,23 +836,23 @@ const sa = (e) => {
|
|
|
837
836
|
{
|
|
838
837
|
role: "slider",
|
|
839
838
|
"aria-label": "Playback position",
|
|
840
|
-
"aria-valuenow":
|
|
839
|
+
"aria-valuenow": U,
|
|
841
840
|
"aria-valuemin": 0,
|
|
842
841
|
"aria-valuemax": 100,
|
|
843
842
|
tabIndex: 0,
|
|
844
843
|
ref: f,
|
|
845
844
|
className: "relative flex h-4 w-full cursor-pointer items-center",
|
|
846
|
-
onMouseDown:
|
|
847
|
-
onTouchStart:
|
|
848
|
-
onClick: (
|
|
849
|
-
onKeyDown: (
|
|
850
|
-
|
|
845
|
+
onMouseDown: Y,
|
|
846
|
+
onTouchStart: Y,
|
|
847
|
+
onClick: (w) => w.stopPropagation(),
|
|
848
|
+
onKeyDown: (w) => {
|
|
849
|
+
w.key === "ArrowRight" && F(Math.min(1, p + 0.05)), w.key === "ArrowLeft" && F(Math.max(0, p - 0.05));
|
|
851
850
|
},
|
|
852
851
|
children: /* @__PURE__ */ n("div", { className: "w-full overflow-hidden rounded-full bg-white/30 h-1", children: /* @__PURE__ */ n(
|
|
853
852
|
"div",
|
|
854
853
|
{
|
|
855
854
|
className: "h-full rounded-full bg-white",
|
|
856
|
-
style: { width: `${
|
|
855
|
+
style: { width: `${U}%` }
|
|
857
856
|
}
|
|
858
857
|
) })
|
|
859
858
|
}
|
|
@@ -863,12 +862,12 @@ const sa = (e) => {
|
|
|
863
862
|
"button",
|
|
864
863
|
{
|
|
865
864
|
type: "button",
|
|
866
|
-
onClick: (
|
|
867
|
-
|
|
865
|
+
onClick: (w) => {
|
|
866
|
+
w.stopPropagation(), x((k) => !k);
|
|
868
867
|
},
|
|
869
868
|
className: "shrink-0 text-white",
|
|
870
|
-
"aria-label":
|
|
871
|
-
children:
|
|
869
|
+
"aria-label": N ? "Pause" : "Play",
|
|
870
|
+
children: N ? /* @__PURE__ */ n(Es, { className: "size-5", weight: "fill" }) : /* @__PURE__ */ n(je, { className: "size-5 translate-x-px", weight: "fill" })
|
|
872
871
|
}
|
|
873
872
|
),
|
|
874
873
|
/* @__PURE__ */ h(
|
|
@@ -876,30 +875,30 @@ const sa = (e) => {
|
|
|
876
875
|
{
|
|
877
876
|
role: "slider",
|
|
878
877
|
"aria-label": "Playback position",
|
|
879
|
-
"aria-valuenow":
|
|
878
|
+
"aria-valuenow": U,
|
|
880
879
|
"aria-valuemin": 0,
|
|
881
880
|
"aria-valuemax": 100,
|
|
882
881
|
tabIndex: 0,
|
|
883
882
|
ref: f,
|
|
884
883
|
className: "relative flex h-4 w-full cursor-pointer items-center",
|
|
885
|
-
onMouseDown:
|
|
886
|
-
onTouchStart:
|
|
887
|
-
onClick: (
|
|
888
|
-
onMouseEnter: () =>
|
|
889
|
-
onMouseLeave: () =>
|
|
890
|
-
onKeyDown: (
|
|
891
|
-
|
|
884
|
+
onMouseDown: Y,
|
|
885
|
+
onTouchStart: Y,
|
|
886
|
+
onClick: (w) => w.stopPropagation(),
|
|
887
|
+
onMouseEnter: () => M(!0),
|
|
888
|
+
onMouseLeave: () => M(!1),
|
|
889
|
+
onKeyDown: (w) => {
|
|
890
|
+
w.key === "ArrowRight" && F(Math.min(1, p + 0.05)), w.key === "ArrowLeft" && F(Math.max(0, p - 0.05));
|
|
892
891
|
},
|
|
893
892
|
children: [
|
|
894
893
|
/* @__PURE__ */ n(
|
|
895
894
|
"div",
|
|
896
895
|
{
|
|
897
|
-
className: `w-full overflow-hidden rounded-full bg-white/30 transition-all duration-200 ${
|
|
896
|
+
className: `w-full overflow-hidden rounded-full bg-white/30 transition-all duration-200 ${_ || A ? "h-1.5" : "h-1"}`,
|
|
898
897
|
children: /* @__PURE__ */ n(
|
|
899
898
|
"div",
|
|
900
899
|
{
|
|
901
900
|
className: "h-full rounded-full bg-white",
|
|
902
|
-
style: { width: `${
|
|
901
|
+
style: { width: `${U}%` }
|
|
903
902
|
}
|
|
904
903
|
)
|
|
905
904
|
}
|
|
@@ -907,8 +906,8 @@ const sa = (e) => {
|
|
|
907
906
|
/* @__PURE__ */ n(
|
|
908
907
|
"div",
|
|
909
908
|
{
|
|
910
|
-
className: `absolute size-3 -translate-x-1/2 rounded-full bg-white shadow transition-[opacity,transform] duration-200 ${
|
|
911
|
-
style: { left: `${
|
|
909
|
+
className: `absolute size-3 -translate-x-1/2 rounded-full bg-white shadow transition-[opacity,transform] duration-200 ${_ || A ? "scale-100 opacity-100" : "scale-0 opacity-0"}`,
|
|
910
|
+
style: { left: `${U}%` }
|
|
912
911
|
}
|
|
913
912
|
)
|
|
914
913
|
]
|
|
@@ -918,7 +917,7 @@ const sa = (e) => {
|
|
|
918
917
|
]
|
|
919
918
|
}
|
|
920
919
|
);
|
|
921
|
-
},
|
|
920
|
+
}, Ft = (e) => e === "dark" ? "size-12 text-white/20" : "size-12 text-black/20", la = (e) => e === "dark" ? "aspect-video overflow-hidden bg-white/10" : "aspect-video overflow-hidden bg-black/5", tn = ({
|
|
922
921
|
mimeType: e,
|
|
923
922
|
sourceUrl: t,
|
|
924
923
|
thumbnailUrl: s,
|
|
@@ -927,9 +926,9 @@ const sa = (e) => {
|
|
|
927
926
|
mediaPlayerProps: i,
|
|
928
927
|
containedImage: l = !1
|
|
929
928
|
}) => {
|
|
930
|
-
const o = re(e), [d, m] =
|
|
929
|
+
const o = re(e), [d, m] = $(!1);
|
|
931
930
|
return t && (o === "video" || o === "audio") ? /* @__PURE__ */ n(
|
|
932
|
-
|
|
931
|
+
ia,
|
|
933
932
|
{
|
|
934
933
|
source: t,
|
|
935
934
|
mimeType: e,
|
|
@@ -975,12 +974,12 @@ const sa = (e) => {
|
|
|
975
974
|
"div",
|
|
976
975
|
{
|
|
977
976
|
className: `flex aspect-video w-full items-center justify-center ${r === "dark" ? "bg-white/10" : "bg-black/5"}`,
|
|
978
|
-
children:
|
|
979
|
-
className:
|
|
977
|
+
children: oe(e, {
|
|
978
|
+
className: Ft(r),
|
|
980
979
|
weight: "regular"
|
|
981
980
|
})
|
|
982
981
|
}
|
|
983
|
-
) : s ? /* @__PURE__ */ n("div", { className: `relative ${
|
|
982
|
+
) : s ? /* @__PURE__ */ n("div", { className: `relative ${la(r)}`, children: /* @__PURE__ */ n(
|
|
984
983
|
"img",
|
|
985
984
|
{
|
|
986
985
|
src: s,
|
|
@@ -992,13 +991,13 @@ const sa = (e) => {
|
|
|
992
991
|
"div",
|
|
993
992
|
{
|
|
994
993
|
className: `flex aspect-video w-full items-center justify-center ${r === "dark" ? "bg-white/10" : "bg-black/5"}`,
|
|
995
|
-
children:
|
|
996
|
-
className:
|
|
994
|
+
children: oe(e, {
|
|
995
|
+
className: Ft(r),
|
|
997
996
|
weight: "regular"
|
|
998
997
|
})
|
|
999
998
|
}
|
|
1000
999
|
);
|
|
1001
|
-
},
|
|
1000
|
+
}, nn = ({
|
|
1002
1001
|
variant: e,
|
|
1003
1002
|
thumbnail: t,
|
|
1004
1003
|
title: s,
|
|
@@ -1039,7 +1038,7 @@ const sa = (e) => {
|
|
|
1039
1038
|
}
|
|
1040
1039
|
),
|
|
1041
1040
|
/* @__PURE__ */ h("div", { className: "flex flex-wrap items-center gap-1", children: [
|
|
1042
|
-
|
|
1041
|
+
oe(r, {
|
|
1043
1042
|
className: y(
|
|
1044
1043
|
"size-5 shrink-0",
|
|
1045
1044
|
f ? "text-white/55" : "text-black/55"
|
|
@@ -1064,25 +1063,25 @@ const sa = (e) => {
|
|
|
1064
1063
|
}
|
|
1065
1064
|
);
|
|
1066
1065
|
};
|
|
1067
|
-
function
|
|
1066
|
+
function sn(e) {
|
|
1068
1067
|
return e < 1024 ? `${e} B` : e < 1024 * 1024 ? `${(e / 1024).toFixed(1)} KB` : `${(e / (1024 * 1024)).toFixed(1)} MB`;
|
|
1069
1068
|
}
|
|
1070
1069
|
function Ze(e) {
|
|
1071
1070
|
return `w-[280px] select-none overflow-hidden rounded-[24px] ${e ? "bg-[#121110]" : "bg-[#F3F3F1]"} shadow-[0_0_0_1px_rgba(0,0,0,0.04),0_4px_8px_rgba(0,0,0,0.06)]`;
|
|
1072
1071
|
}
|
|
1073
|
-
function
|
|
1072
|
+
function oa(e) {
|
|
1074
1073
|
return e ? "bg-white/10" : "bg-black/5";
|
|
1075
1074
|
}
|
|
1076
|
-
function
|
|
1075
|
+
function ca(e) {
|
|
1077
1076
|
return e ? "text-white" : "text-black";
|
|
1078
1077
|
}
|
|
1079
|
-
function
|
|
1078
|
+
function da(e) {
|
|
1080
1079
|
return e ? "text-white/55" : "text-black/55";
|
|
1081
1080
|
}
|
|
1082
|
-
function
|
|
1081
|
+
function ua(e) {
|
|
1083
1082
|
return e ? "text-white/40" : "text-black/40";
|
|
1084
1083
|
}
|
|
1085
|
-
function
|
|
1084
|
+
function ma(e) {
|
|
1086
1085
|
return e ? "text-white/20" : "text-black/20";
|
|
1087
1086
|
}
|
|
1088
1087
|
const Qe = ({ attachment: e, isMyMessage: t }) => {
|
|
@@ -1097,26 +1096,26 @@ const Qe = ({ attachment: e, isMyMessage: t }) => {
|
|
|
1097
1096
|
) : /* @__PURE__ */ n(
|
|
1098
1097
|
"div",
|
|
1099
1098
|
{
|
|
1100
|
-
className: `aspect-video w-full rounded-[20px] ${
|
|
1101
|
-
children: /* @__PURE__ */ n(
|
|
1099
|
+
className: `aspect-video w-full rounded-[20px] ${oa(t)} flex items-center justify-center`,
|
|
1100
|
+
children: /* @__PURE__ */ n(Ss, { className: `size-12 ${ma(t)}` })
|
|
1102
1101
|
}
|
|
1103
1102
|
) }),
|
|
1104
1103
|
/* @__PURE__ */ h("div", { className: "px-3 pb-3", children: [
|
|
1105
|
-
s && /* @__PURE__ */ n("p", { className: `truncate text-[14px] font-medium leading-5 ${
|
|
1106
|
-
a && /* @__PURE__ */ n("p", { className: `truncate text-[12px] leading-4 ${
|
|
1107
|
-
d && /* @__PURE__ */ n("p", { className: `mt-1 truncate text-[12px] leading-4 ${
|
|
1104
|
+
s && /* @__PURE__ */ n("p", { className: `truncate text-[14px] font-medium leading-5 ${ca(t)}`, children: s }),
|
|
1105
|
+
a && /* @__PURE__ */ n("p", { className: `truncate text-[12px] leading-4 ${da(t)}`, children: a }),
|
|
1106
|
+
d && /* @__PURE__ */ n("p", { className: `mt-1 truncate text-[12px] leading-4 ${ua(t)}`, children: d })
|
|
1108
1107
|
] })
|
|
1109
1108
|
] });
|
|
1110
1109
|
return d ? /* @__PURE__ */ n("a", { href: d, target: "_blank", rel: "noopener noreferrer", className: "block no-underline", children: m }) : /* @__PURE__ */ n("div", { className: "block", children: m });
|
|
1111
1110
|
};
|
|
1112
|
-
function
|
|
1111
|
+
function an(e) {
|
|
1113
1112
|
return e.type === "link" || !!e.og_scrape_url && !e.asset_url;
|
|
1114
1113
|
}
|
|
1115
1114
|
function et(e) {
|
|
1116
1115
|
var t;
|
|
1117
|
-
return (t = e.attachments) == null ? void 0 : t.find(
|
|
1116
|
+
return (t = e.attachments) == null ? void 0 : t.find(an);
|
|
1118
1117
|
}
|
|
1119
|
-
async function
|
|
1118
|
+
async function ha(e, t) {
|
|
1120
1119
|
let s;
|
|
1121
1120
|
try {
|
|
1122
1121
|
s = t ?? new URL(e).pathname.split("/").pop() ?? "download";
|
|
@@ -1128,11 +1127,11 @@ async function ua(e, t) {
|
|
|
1128
1127
|
const r = await a.blob(), i = URL.createObjectURL(r), l = document.createElement("a");
|
|
1129
1128
|
l.href = i, l.download = s, l.style.display = "none", document.body.appendChild(l), l.click(), document.body.removeChild(l), URL.revokeObjectURL(i);
|
|
1130
1129
|
}
|
|
1131
|
-
const
|
|
1130
|
+
const fa = ({
|
|
1132
1131
|
url: e,
|
|
1133
1132
|
filename: t
|
|
1134
1133
|
}) => {
|
|
1135
|
-
const [s, a] =
|
|
1134
|
+
const [s, a] = $(!1);
|
|
1136
1135
|
return /* @__PURE__ */ n(
|
|
1137
1136
|
"button",
|
|
1138
1137
|
{
|
|
@@ -1140,7 +1139,7 @@ const ma = ({
|
|
|
1140
1139
|
onClick: (i) => {
|
|
1141
1140
|
i.stopPropagation();
|
|
1142
1141
|
const l = window.open("", "_blank", "noopener,noreferrer");
|
|
1143
|
-
a(!0),
|
|
1142
|
+
a(!0), ha(e, t).then(() => {
|
|
1144
1143
|
l == null || l.close();
|
|
1145
1144
|
}).catch(() => {
|
|
1146
1145
|
l && (l.location.href = e);
|
|
@@ -1158,13 +1157,13 @@ const ma = ({
|
|
|
1158
1157
|
function tt(e) {
|
|
1159
1158
|
var u, f, c, b;
|
|
1160
1159
|
const t = (u = e.attachments) == null ? void 0 : u.find(
|
|
1161
|
-
(
|
|
1160
|
+
(N) => N.type === "video" && N.asset_url
|
|
1162
1161
|
), s = (f = e.attachments) == null ? void 0 : f.find(
|
|
1163
|
-
(
|
|
1162
|
+
(N) => N.type === "image" && N.image_url
|
|
1164
1163
|
), a = (c = e.attachments) == null ? void 0 : c.find(
|
|
1165
|
-
(
|
|
1164
|
+
(N) => N.type === "audio" && N.asset_url
|
|
1166
1165
|
), r = (b = e.attachments) == null ? void 0 : b.find(
|
|
1167
|
-
(
|
|
1166
|
+
(N) => N.type === "file" && N.asset_url
|
|
1168
1167
|
), i = t ?? s ?? a ?? r, l = (t == null ? void 0 : t.asset_url) ?? (s == null ? void 0 : s.image_url) ?? (a == null ? void 0 : a.asset_url) ?? (r == null ? void 0 : r.asset_url);
|
|
1169
1168
|
if (!l) return null;
|
|
1170
1169
|
const o = (i == null ? void 0 : i.mime_type) ?? ((i == null ? void 0 : i.type) === "image" ? "image/jpeg" : (i == null ? void 0 : i.type) === "video" ? "video/mp4" : (i == null ? void 0 : i.type) === "audio" ? "audio/mpeg" : "application/octet-stream"), d = i == null ? void 0 : i.title, m = i == null ? void 0 : i.file_size, g = t == null ? void 0 : t.thumb_url;
|
|
@@ -1176,16 +1175,16 @@ function tt(e) {
|
|
|
1176
1175
|
thumbnailUrl: g
|
|
1177
1176
|
};
|
|
1178
1177
|
}
|
|
1179
|
-
const
|
|
1178
|
+
const rn = ({
|
|
1180
1179
|
resolvedUrl: e,
|
|
1181
1180
|
resolvedType: t,
|
|
1182
1181
|
title: s,
|
|
1183
1182
|
fileSize: a,
|
|
1184
1183
|
thumbnailUrl: r
|
|
1185
1184
|
}) => {
|
|
1186
|
-
const i = a !== void 0 ?
|
|
1185
|
+
const i = a !== void 0 ? sn(a) : void 0;
|
|
1187
1186
|
return /* @__PURE__ */ n(
|
|
1188
|
-
|
|
1187
|
+
nn,
|
|
1189
1188
|
{
|
|
1190
1189
|
variant: "dark",
|
|
1191
1190
|
title: s,
|
|
@@ -1193,7 +1192,7 @@ const on = ({
|
|
|
1193
1192
|
mimeType: t,
|
|
1194
1193
|
detail: i,
|
|
1195
1194
|
thumbnail: /* @__PURE__ */ n(
|
|
1196
|
-
|
|
1195
|
+
tn,
|
|
1197
1196
|
{
|
|
1198
1197
|
mimeType: t,
|
|
1199
1198
|
sourceUrl: e,
|
|
@@ -1211,16 +1210,16 @@ const on = ({
|
|
|
1211
1210
|
fileSize: a,
|
|
1212
1211
|
thumbnailUrl: r
|
|
1213
1212
|
}) => {
|
|
1214
|
-
const i = re(t), l = a !== void 0 ?
|
|
1213
|
+
const i = re(t), l = a !== void 0 ? sn(a) : void 0;
|
|
1215
1214
|
return /* @__PURE__ */ n(
|
|
1216
|
-
|
|
1215
|
+
nn,
|
|
1217
1216
|
{
|
|
1218
1217
|
variant: "light",
|
|
1219
1218
|
title: s,
|
|
1220
1219
|
mimeType: t,
|
|
1221
1220
|
detail: l,
|
|
1222
1221
|
thumbnail: /* @__PURE__ */ n(
|
|
1223
|
-
|
|
1222
|
+
tn,
|
|
1224
1223
|
{
|
|
1225
1224
|
mimeType: t,
|
|
1226
1225
|
sourceUrl: e,
|
|
@@ -1230,17 +1229,17 @@ const on = ({
|
|
|
1230
1229
|
containedImage: i === "image" || i === "document"
|
|
1231
1230
|
}
|
|
1232
1231
|
),
|
|
1233
|
-
action: /* @__PURE__ */ n(
|
|
1232
|
+
action: /* @__PURE__ */ n(fa, { url: e, filename: s })
|
|
1234
1233
|
}
|
|
1235
1234
|
);
|
|
1236
|
-
},
|
|
1235
|
+
}, ga = ({
|
|
1237
1236
|
message: e,
|
|
1238
1237
|
isMyMessage: t = !1
|
|
1239
1238
|
}) => {
|
|
1240
1239
|
const s = et(e), a = tt(e);
|
|
1241
1240
|
return !s && !a ? null : /* @__PURE__ */ h("div", { className: t ? "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", children: [
|
|
1242
1241
|
!t && e.user && /* @__PURE__ */ n(
|
|
1243
|
-
|
|
1242
|
+
ie,
|
|
1244
1243
|
{
|
|
1245
1244
|
className: "str-chat__avatar str-chat__message-sender-avatar",
|
|
1246
1245
|
id: e.user.id,
|
|
@@ -1258,21 +1257,21 @@ const on = ({
|
|
|
1258
1257
|
{
|
|
1259
1258
|
className: "str-chat__message-bubble",
|
|
1260
1259
|
style: { padding: 0, borderRadius: 0, overflow: "visible", background: "transparent" },
|
|
1261
|
-
children: s ? /* @__PURE__ */ n("div", { className: Ze(t), children: /* @__PURE__ */ n(Qe, { attachment: s, isMyMessage: t }) }) : t ? /* @__PURE__ */ n(
|
|
1260
|
+
children: s ? /* @__PURE__ */ n("div", { className: Ze(t), children: /* @__PURE__ */ n(Qe, { attachment: s, isMyMessage: t }) }) : t ? /* @__PURE__ */ n(rn, { ...a }) : /* @__PURE__ */ n(ln, { ...a })
|
|
1262
1261
|
}
|
|
1263
1262
|
) })
|
|
1264
1263
|
}
|
|
1265
1264
|
)
|
|
1266
1265
|
] });
|
|
1267
|
-
},
|
|
1266
|
+
}, ba = ({
|
|
1268
1267
|
message: e
|
|
1269
1268
|
}) => {
|
|
1270
1269
|
const t = et(e);
|
|
1271
1270
|
if (t)
|
|
1272
1271
|
return /* @__PURE__ */ n("div", { className: Ze(!0), children: /* @__PURE__ */ n(Qe, { attachment: t, isMyMessage: !0 }) });
|
|
1273
1272
|
const s = tt(e);
|
|
1274
|
-
return s ? /* @__PURE__ */ n(
|
|
1275
|
-
},
|
|
1273
|
+
return s ? /* @__PURE__ */ n(rn, { ...s }) : null;
|
|
1274
|
+
}, pa = ({
|
|
1276
1275
|
message: e
|
|
1277
1276
|
}) => {
|
|
1278
1277
|
const t = et(e);
|
|
@@ -1280,18 +1279,18 @@ const on = ({
|
|
|
1280
1279
|
return /* @__PURE__ */ n("div", { className: Ze(!1), children: /* @__PURE__ */ n(Qe, { attachment: t, isMyMessage: !1 }) });
|
|
1281
1280
|
const s = tt(e);
|
|
1282
1281
|
return s ? /* @__PURE__ */ n(ln, { ...s }) : null;
|
|
1283
|
-
},
|
|
1284
|
-
Creator:
|
|
1285
|
-
Visitor:
|
|
1286
|
-
}),
|
|
1282
|
+
}, ki = Object.assign(ga, {
|
|
1283
|
+
Creator: ba,
|
|
1284
|
+
Visitor: pa
|
|
1285
|
+
}), va = {
|
|
1287
1286
|
isUnlocking: () => !1
|
|
1288
|
-
},
|
|
1289
|
-
LockedAttachment:
|
|
1290
|
-
},
|
|
1291
|
-
function
|
|
1292
|
-
return
|
|
1287
|
+
}, xa = {
|
|
1288
|
+
LockedAttachment: va
|
|
1289
|
+
}, on = qe({}), Ei = on.Provider;
|
|
1290
|
+
function wa(e) {
|
|
1291
|
+
return Re(on)[e] ?? xa[e];
|
|
1293
1292
|
}
|
|
1294
|
-
const
|
|
1293
|
+
const Na = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
1295
1294
|
"svg",
|
|
1296
1295
|
{
|
|
1297
1296
|
width: e,
|
|
@@ -1308,29 +1307,29 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1308
1307
|
}
|
|
1309
1308
|
)
|
|
1310
1309
|
}
|
|
1311
|
-
),
|
|
1310
|
+
), _a = (e) => {
|
|
1312
1311
|
var t;
|
|
1313
1312
|
return ((t = e.metadata) == null ? void 0 : t.custom_type) === "MESSAGE_TIP";
|
|
1314
|
-
},
|
|
1313
|
+
}, ya = (e) => {
|
|
1315
1314
|
var t;
|
|
1316
1315
|
return ((t = e.metadata) == null ? void 0 : t.custom_type) === "MESSAGE_PAID";
|
|
1317
1316
|
}, Ie = (e) => {
|
|
1318
1317
|
var t;
|
|
1319
1318
|
return ((t = e.metadata) == null ? void 0 : t.custom_type) === "MESSAGE_CHATBOT";
|
|
1320
|
-
},
|
|
1319
|
+
}, Ca = (e) => {
|
|
1321
1320
|
var t;
|
|
1322
1321
|
return ((t = e.metadata) == null ? void 0 : t.custom_type) === "MESSAGE_ATTACHMENT";
|
|
1323
|
-
},
|
|
1322
|
+
}, cn = (e) => _a(e) || ya(e), ka = (e) => {
|
|
1324
1323
|
var t;
|
|
1325
|
-
return
|
|
1326
|
-
},
|
|
1324
|
+
return cn(e) && !((t = e.text) != null && t.trim());
|
|
1325
|
+
}, $e = ({
|
|
1327
1326
|
message: e,
|
|
1328
1327
|
standalone: t = !1,
|
|
1329
1328
|
isMyMessage: s = !1,
|
|
1330
1329
|
hasAttachment: a = !1
|
|
1331
1330
|
}) => {
|
|
1332
1331
|
var u;
|
|
1333
|
-
const r =
|
|
1332
|
+
const r = cn(e), i = Ie(e);
|
|
1334
1333
|
if (!r && !i)
|
|
1335
1334
|
return null;
|
|
1336
1335
|
if (r) {
|
|
@@ -1338,7 +1337,7 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1338
1337
|
if (!f) return null;
|
|
1339
1338
|
const c = t ? "message-tip-standalone" : "message-tag message-tag--tip", b = t ? `${f} tip` : `Delivered with ${f} tip`;
|
|
1340
1339
|
return /* @__PURE__ */ h("div", { className: c, children: [
|
|
1341
|
-
/* @__PURE__ */ n(
|
|
1340
|
+
/* @__PURE__ */ n(Is, { size: t ? 14 : 12 }),
|
|
1342
1341
|
/* @__PURE__ */ n("span", { children: b })
|
|
1343
1342
|
] });
|
|
1344
1343
|
}
|
|
@@ -1346,7 +1345,7 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1346
1345
|
"message-chatbot-indicator",
|
|
1347
1346
|
s ? "message-chatbot-indicator--sender" : "message-chatbot-indicator--receiver",
|
|
1348
1347
|
l ? "message-chatbot-indicator--attachment" : "message-chatbot-indicator--text"
|
|
1349
|
-
].join(" "), m = /* @__PURE__ */ n("span", { className: "message-chatbot-indicator__label", children: o }), g = /* @__PURE__ */ n("span", { className: "message-chatbot-indicator__icon", children: /* @__PURE__ */ n(
|
|
1348
|
+
].join(" "), m = /* @__PURE__ */ n("span", { className: "message-chatbot-indicator__label", children: o }), g = /* @__PURE__ */ n("span", { className: "message-chatbot-indicator__icon", children: /* @__PURE__ */ n(Na, { size: l ? 12 : 15 }) });
|
|
1350
1349
|
return /* @__PURE__ */ n("div", { className: d, "data-testid": "message-chatbot-indicator", children: s && !l ? /* @__PURE__ */ h(ae, { children: [
|
|
1351
1350
|
m,
|
|
1352
1351
|
g
|
|
@@ -1354,7 +1353,7 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1354
1353
|
g,
|
|
1355
1354
|
m
|
|
1356
1355
|
] }) });
|
|
1357
|
-
},
|
|
1356
|
+
}, Ea = ({
|
|
1358
1357
|
selected: e,
|
|
1359
1358
|
onVoteUp: t,
|
|
1360
1359
|
onVoteDown: s
|
|
@@ -1370,7 +1369,7 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1370
1369
|
"aria-label": "Good response",
|
|
1371
1370
|
"aria-pressed": e === "up",
|
|
1372
1371
|
"data-tooltip": "Good response",
|
|
1373
|
-
children: /* @__PURE__ */ n(
|
|
1372
|
+
children: /* @__PURE__ */ n(Ts, { size: 16, weight: e === "up" ? "fill" : "regular" })
|
|
1374
1373
|
}
|
|
1375
1374
|
),
|
|
1376
1375
|
/* @__PURE__ */ n(
|
|
@@ -1384,11 +1383,11 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1384
1383
|
"aria-label": "Bad response",
|
|
1385
1384
|
"aria-pressed": e === "down",
|
|
1386
1385
|
"data-tooltip": "Bad response",
|
|
1387
|
-
children: /* @__PURE__ */ n(
|
|
1386
|
+
children: /* @__PURE__ */ n(As, { size: 16, weight: e === "down" ? "fill" : "regular" })
|
|
1388
1387
|
}
|
|
1389
1388
|
)
|
|
1390
|
-
] }),
|
|
1391
|
-
var bt, pt, vt, xt, wt,
|
|
1389
|
+
] }), Sa = (e) => {
|
|
1390
|
+
var gt, bt, pt, vt, xt, wt, Nt, _t, yt, Ct, kt, Et, St, It;
|
|
1392
1391
|
const {
|
|
1393
1392
|
additionalMessageInputProps: t,
|
|
1394
1393
|
chatbotVotingEnabled: s,
|
|
@@ -1404,84 +1403,84 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1404
1403
|
isMyMessage: f,
|
|
1405
1404
|
message: c,
|
|
1406
1405
|
renderText: b,
|
|
1407
|
-
threadList:
|
|
1408
|
-
viewerLanguage:
|
|
1409
|
-
} = e, { client: p } = Xe("CustomMessage"), { channel:
|
|
1410
|
-
Attachment:
|
|
1411
|
-
EditMessageModal:
|
|
1412
|
-
MessageActions:
|
|
1413
|
-
MessageBlocked:
|
|
1414
|
-
MessageBouncePrompt:
|
|
1415
|
-
MessageDeleted:
|
|
1416
|
-
MessageIsThreadReplyInChannelButtonIndicator:
|
|
1417
|
-
MessageRepliesCountButton:
|
|
1418
|
-
ReminderNotification:
|
|
1419
|
-
StreamedMessageText:
|
|
1420
|
-
PinIndicator:
|
|
1421
|
-
} =
|
|
1406
|
+
threadList: N,
|
|
1407
|
+
viewerLanguage: x
|
|
1408
|
+
} = e, { client: p } = Xe("CustomMessage"), { channel: v } = ce("CustomMessage"), { isUnlocking: A, onUnlockClick: R, onFetchSource: _, onDownloadClick: M } = wa("LockedAttachment"), [z, O] = $(!1), S = Dn(c.id), { selected: E, voteUp: L, voteDown: D } = qs(c), {
|
|
1409
|
+
Attachment: C = Pn,
|
|
1410
|
+
EditMessageModal: I = On,
|
|
1411
|
+
MessageActions: T,
|
|
1412
|
+
MessageBlocked: P = zn,
|
|
1413
|
+
MessageBouncePrompt: F = $n,
|
|
1414
|
+
MessageDeleted: Y = Fn,
|
|
1415
|
+
MessageIsThreadReplyInChannelButtonIndicator: Z = Bn,
|
|
1416
|
+
MessageRepliesCountButton: J = Un,
|
|
1417
|
+
ReminderNotification: U = jn,
|
|
1418
|
+
StreamedMessageText: w = Vn,
|
|
1419
|
+
PinIndicator: k
|
|
1420
|
+
} = Vt("CustomMessage"), B = Gn(c), q = Hn(c), H = se(
|
|
1422
1421
|
() => u == null ? void 0 : u(c),
|
|
1423
1422
|
[u, c]
|
|
1424
|
-
),
|
|
1425
|
-
const
|
|
1426
|
-
if (!Ie(c)) return
|
|
1427
|
-
const
|
|
1428
|
-
return
|
|
1423
|
+
), V = se(() => {
|
|
1424
|
+
const fe = c.attachments ?? [], ke = c.shared_location ? [c.shared_location, ...fe] : fe;
|
|
1425
|
+
if (!Ie(c)) return ke;
|
|
1426
|
+
const Tt = ke.filter((At) => !("type" in At) || !an(At));
|
|
1427
|
+
return Tt.length === ke.length ? ke : Tt;
|
|
1429
1428
|
}, [c]), W = se(() => {
|
|
1430
|
-
const
|
|
1431
|
-
return
|
|
1432
|
-
}, [c,
|
|
1433
|
-
if (
|
|
1429
|
+
const fe = Jt({ message: c, viewerLanguage: x });
|
|
1430
|
+
return fe === c.text ? c : { ...c, text: fe };
|
|
1431
|
+
}, [c, x]);
|
|
1432
|
+
if (Yn(c))
|
|
1434
1433
|
return null;
|
|
1435
1434
|
if (c.deleted_at || c.type === "deleted")
|
|
1436
|
-
return /* @__PURE__ */ n(
|
|
1437
|
-
if (
|
|
1438
|
-
return /* @__PURE__ */ n(
|
|
1439
|
-
const
|
|
1440
|
-
let
|
|
1441
|
-
me ?
|
|
1442
|
-
const
|
|
1435
|
+
return /* @__PURE__ */ n(Y, { message: c });
|
|
1436
|
+
if (qn(c))
|
|
1437
|
+
return /* @__PURE__ */ n(P, {});
|
|
1438
|
+
const de = !N && !!c.reply_count, ue = !N && c.show_in_channel && c.parent_id, me = c.status === "failed" && ((gt = c.error) == null ? void 0 : gt.status) !== 403, te = Wn(c);
|
|
1439
|
+
let Q;
|
|
1440
|
+
me ? Q = () => m(c) : te && (Q = () => O(!0));
|
|
1441
|
+
const ee = f(), Sn = y(
|
|
1443
1442
|
"str-chat__message str-chat__message-simple",
|
|
1444
1443
|
`str-chat__message--${c.type}`,
|
|
1445
1444
|
`str-chat__message--${c.status}`,
|
|
1446
|
-
|
|
1445
|
+
ee ? "str-chat__message--me str-chat__message-simple--me" : "str-chat__message--other",
|
|
1447
1446
|
c.text ? "str-chat__message--has-text" : "has-no-text",
|
|
1448
1447
|
{
|
|
1449
|
-
"str-chat__message--has-attachment":
|
|
1448
|
+
"str-chat__message--has-attachment": B,
|
|
1450
1449
|
"str-chat__message--highlighted": g,
|
|
1451
1450
|
"str-chat__message--pinned pinned-message": c.pinned,
|
|
1452
|
-
"str-chat__message--with-reactions":
|
|
1453
|
-
"str-chat__message-send-can-be-retried": (c == null ? void 0 : c.status) === "failed" && ((
|
|
1454
|
-
"str-chat__message-with-thread-link":
|
|
1451
|
+
"str-chat__message--with-reactions": q,
|
|
1452
|
+
"str-chat__message-send-can-be-retried": (c == null ? void 0 : c.status) === "failed" && ((bt = c == null ? void 0 : c.error) == null ? void 0 : bt.status) !== 403,
|
|
1453
|
+
"str-chat__message-with-thread-link": de || ue,
|
|
1455
1454
|
"str-chat__virtual-message__wrapper--end": r,
|
|
1456
1455
|
"str-chat__virtual-message__wrapper--first": i,
|
|
1457
1456
|
"str-chat__virtual-message__wrapper--group": l
|
|
1458
1457
|
}
|
|
1459
|
-
),
|
|
1458
|
+
), ut = c.poll_id && p.polls.fromState(c.poll_id), mt = ka(c), he = Ie(c), ht = Ca(c), Pe = !!(V != null && V.length && !c.quoted_message), ft = he && ee && Pe;
|
|
1460
1459
|
return /* @__PURE__ */ h(ae, { children: [
|
|
1461
1460
|
a && /* @__PURE__ */ n(
|
|
1462
|
-
|
|
1461
|
+
I,
|
|
1463
1462
|
{
|
|
1464
1463
|
additionalMessageInputProps: t
|
|
1465
1464
|
}
|
|
1466
1465
|
),
|
|
1467
|
-
|
|
1468
|
-
|
|
1466
|
+
z && /* @__PURE__ */ n(
|
|
1467
|
+
Xn,
|
|
1469
1468
|
{
|
|
1470
|
-
MessageBouncePrompt:
|
|
1471
|
-
onClose: () =>
|
|
1472
|
-
open:
|
|
1469
|
+
MessageBouncePrompt: F,
|
|
1470
|
+
onClose: () => O(!1),
|
|
1471
|
+
open: z
|
|
1473
1472
|
}
|
|
1474
1473
|
),
|
|
1475
1474
|
/* @__PURE__ */ h(
|
|
1476
1475
|
"div",
|
|
1477
1476
|
{
|
|
1478
|
-
className:
|
|
1477
|
+
className: Sn,
|
|
1479
1478
|
"data-message-id": c.id,
|
|
1480
1479
|
children: [
|
|
1481
|
-
|
|
1482
|
-
!!
|
|
1480
|
+
k && /* @__PURE__ */ n(k, {}),
|
|
1481
|
+
!!S && /* @__PURE__ */ n(U, { reminder: S }),
|
|
1483
1482
|
c.user && /* @__PURE__ */ n(
|
|
1484
|
-
|
|
1483
|
+
ie,
|
|
1485
1484
|
{
|
|
1486
1485
|
className: "str-chat__avatar str-chat__message-sender-avatar",
|
|
1487
1486
|
id: c.user.id,
|
|
@@ -1489,179 +1488,179 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1489
1488
|
name: c.user.name || c.user.id,
|
|
1490
1489
|
size: 24,
|
|
1491
1490
|
shape: "circle",
|
|
1492
|
-
dmAgentEnabled:
|
|
1491
|
+
dmAgentEnabled: he
|
|
1493
1492
|
}
|
|
1494
1493
|
),
|
|
1495
1494
|
/* @__PURE__ */ n(
|
|
1496
1495
|
"div",
|
|
1497
1496
|
{
|
|
1498
1497
|
className: y("str-chat__message-inner", {
|
|
1499
|
-
"str-chat__simple-message--error-failed": me ||
|
|
1498
|
+
"str-chat__simple-message--error-failed": me || te
|
|
1500
1499
|
}),
|
|
1501
1500
|
"data-testid": "message-inner",
|
|
1502
|
-
onClick:
|
|
1503
|
-
onKeyDown:
|
|
1504
|
-
role:
|
|
1505
|
-
tabIndex:
|
|
1501
|
+
onClick: Q,
|
|
1502
|
+
onKeyDown: Q,
|
|
1503
|
+
role: Q ? "button" : void 0,
|
|
1504
|
+
tabIndex: Q ? 0 : void 0,
|
|
1506
1505
|
style: {
|
|
1507
1506
|
// Force margins to 0 to prevent hover layout shift
|
|
1508
1507
|
// Stream Chat CSS sets margin-inline-end/start to 78px, then 0 on hover
|
|
1509
1508
|
marginInlineEnd: 0,
|
|
1510
1509
|
marginInlineStart: 0
|
|
1511
1510
|
},
|
|
1512
|
-
children:
|
|
1513
|
-
|
|
1514
|
-
|
|
1511
|
+
children: ht ? /* @__PURE__ */ h("div", { className: "str-chat__message-bubble-wrapper", children: [
|
|
1512
|
+
ee ? /* @__PURE__ */ h("div", { className: "flex items-center gap-2", children: [
|
|
1513
|
+
T && /* @__PURE__ */ n(T, {}),
|
|
1515
1514
|
/* @__PURE__ */ n(
|
|
1516
|
-
|
|
1515
|
+
$t.Sent,
|
|
1517
1516
|
{
|
|
1518
|
-
title: (
|
|
1519
|
-
mimeType: (
|
|
1520
|
-
thumbnailUrl: (
|
|
1521
|
-
amountText: (
|
|
1517
|
+
title: (pt = c.metadata) == null ? void 0 : pt.attachment_title,
|
|
1518
|
+
mimeType: (vt = c.metadata) == null ? void 0 : vt.attachment_mime_type,
|
|
1519
|
+
thumbnailUrl: (xt = c.metadata) == null ? void 0 : xt.attachment_thumbnail,
|
|
1520
|
+
amountText: (wt = c.metadata) == null ? void 0 : wt.amount_text,
|
|
1522
1521
|
detail: (Nt = c.metadata) == null ? void 0 : Nt.attachment_detail,
|
|
1523
|
-
paymentStatus: (
|
|
1524
|
-
onPreviewClick: () =>
|
|
1525
|
-
onFetchSource: async () => await (
|
|
1522
|
+
paymentStatus: (_t = c.metadata) == null ? void 0 : _t.payment_status,
|
|
1523
|
+
onPreviewClick: () => R == null ? void 0 : R(c, v),
|
|
1524
|
+
onFetchSource: async () => await (_ == null ? void 0 : _(c, v))
|
|
1526
1525
|
}
|
|
1527
1526
|
)
|
|
1528
1527
|
] }) : /* @__PURE__ */ h("div", { className: "flex items-center gap-2", children: [
|
|
1529
1528
|
/* @__PURE__ */ n(
|
|
1530
|
-
|
|
1529
|
+
$t.Received,
|
|
1531
1530
|
{
|
|
1532
|
-
title: (
|
|
1533
|
-
mimeType: (
|
|
1534
|
-
thumbnailUrl: (
|
|
1535
|
-
amountText: (
|
|
1536
|
-
detail: (
|
|
1537
|
-
paymentStatus: (
|
|
1531
|
+
title: (yt = c.metadata) == null ? void 0 : yt.attachment_title,
|
|
1532
|
+
mimeType: (Ct = c.metadata) == null ? void 0 : Ct.attachment_mime_type,
|
|
1533
|
+
thumbnailUrl: (kt = c.metadata) == null ? void 0 : kt.attachment_thumbnail,
|
|
1534
|
+
amountText: (Et = c.metadata) == null ? void 0 : Et.amount_text,
|
|
1535
|
+
detail: (St = c.metadata) == null ? void 0 : St.attachment_detail,
|
|
1536
|
+
paymentStatus: (It = c.metadata) == null ? void 0 : It.payment_status,
|
|
1538
1537
|
isUnlocking: A(c.id),
|
|
1539
|
-
onUnlockClick: () =>
|
|
1540
|
-
onFetchSource: async () => await (
|
|
1541
|
-
onDownloadClick: () =>
|
|
1538
|
+
onUnlockClick: () => R == null ? void 0 : R(c, v),
|
|
1539
|
+
onFetchSource: async () => await (_ == null ? void 0 : _(c, v)),
|
|
1540
|
+
onDownloadClick: () => M == null ? void 0 : M(c, v)
|
|
1542
1541
|
}
|
|
1543
1542
|
),
|
|
1544
|
-
|
|
1543
|
+
T && /* @__PURE__ */ n(T, {})
|
|
1545
1544
|
] }),
|
|
1546
1545
|
c.text && /* @__PURE__ */ n("div", { className: "str-chat__message-bubble", children: /* @__PURE__ */ n(
|
|
1547
|
-
|
|
1546
|
+
Rt,
|
|
1548
1547
|
{
|
|
1549
1548
|
message: W,
|
|
1550
1549
|
renderText: b
|
|
1551
1550
|
}
|
|
1552
1551
|
) })
|
|
1553
|
-
] }) :
|
|
1552
|
+
] }) : mt ? (
|
|
1554
1553
|
/* Tip-only messages render as a standalone bubble */
|
|
1555
|
-
/* @__PURE__ */ n(
|
|
1554
|
+
/* @__PURE__ */ n($e, { message: c, standalone: !0 })
|
|
1556
1555
|
) : /* @__PURE__ */ n("div", { className: "str-chat__message-bubble-wrapper", children: /* @__PURE__ */ h("div", { className: "str-chat__message-bubble", children: [
|
|
1557
|
-
|
|
1558
|
-
|
|
1556
|
+
he && !ft && /* @__PURE__ */ n(
|
|
1557
|
+
$e,
|
|
1559
1558
|
{
|
|
1560
1559
|
message: c,
|
|
1561
|
-
hasAttachment:
|
|
1562
|
-
isMyMessage:
|
|
1560
|
+
hasAttachment: Pe,
|
|
1561
|
+
isMyMessage: ee
|
|
1563
1562
|
}
|
|
1564
1563
|
),
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1564
|
+
ut && /* @__PURE__ */ n(Kn, { poll: ut }),
|
|
1565
|
+
V != null && V.length && !c.quoted_message ? /* @__PURE__ */ n(
|
|
1566
|
+
C,
|
|
1568
1567
|
{
|
|
1569
1568
|
actionHandler: o,
|
|
1570
|
-
attachments:
|
|
1569
|
+
attachments: V
|
|
1571
1570
|
}
|
|
1572
1571
|
) : null,
|
|
1573
|
-
|
|
1574
|
-
|
|
1572
|
+
H ? /* @__PURE__ */ n(
|
|
1573
|
+
w,
|
|
1575
1574
|
{
|
|
1576
1575
|
message: W,
|
|
1577
1576
|
renderText: b
|
|
1578
1577
|
}
|
|
1579
1578
|
) : /* @__PURE__ */ n(
|
|
1580
|
-
|
|
1579
|
+
Rt,
|
|
1581
1580
|
{
|
|
1582
1581
|
message: W,
|
|
1583
1582
|
renderText: b
|
|
1584
1583
|
}
|
|
1585
1584
|
),
|
|
1586
|
-
/* @__PURE__ */ n(
|
|
1585
|
+
/* @__PURE__ */ n(Jn, {})
|
|
1587
1586
|
] }) })
|
|
1588
1587
|
}
|
|
1589
1588
|
),
|
|
1590
|
-
!
|
|
1591
|
-
(!
|
|
1592
|
-
|
|
1589
|
+
!ht && !mt && /* @__PURE__ */ h("div", { className: "str-chat__message-footer", children: [
|
|
1590
|
+
(!he || ft) && /* @__PURE__ */ n(
|
|
1591
|
+
$e,
|
|
1593
1592
|
{
|
|
1594
1593
|
message: c,
|
|
1595
|
-
hasAttachment:
|
|
1596
|
-
isMyMessage:
|
|
1594
|
+
hasAttachment: Pe,
|
|
1595
|
+
isMyMessage: ee
|
|
1597
1596
|
}
|
|
1598
1597
|
),
|
|
1599
|
-
s &&
|
|
1600
|
-
|
|
1598
|
+
s && he && /* @__PURE__ */ n(
|
|
1599
|
+
Ea,
|
|
1601
1600
|
{
|
|
1602
|
-
selected:
|
|
1603
|
-
onVoteUp:
|
|
1604
|
-
onVoteDown:
|
|
1601
|
+
selected: E,
|
|
1602
|
+
onVoteUp: L,
|
|
1603
|
+
onVoteDown: D
|
|
1605
1604
|
}
|
|
1606
1605
|
)
|
|
1607
1606
|
] }),
|
|
1608
|
-
|
|
1609
|
-
|
|
1607
|
+
de && /* @__PURE__ */ n(
|
|
1608
|
+
J,
|
|
1610
1609
|
{
|
|
1611
1610
|
onClick: d,
|
|
1612
1611
|
reply_count: c.reply_count
|
|
1613
1612
|
}
|
|
1614
1613
|
),
|
|
1615
|
-
ue && /* @__PURE__ */ n(
|
|
1614
|
+
ue && /* @__PURE__ */ n(Z, {})
|
|
1616
1615
|
]
|
|
1617
1616
|
},
|
|
1618
1617
|
c.id
|
|
1619
1618
|
)
|
|
1620
1619
|
] });
|
|
1621
|
-
},
|
|
1622
|
-
|
|
1623
|
-
(e, t) => e.chatbotVotingEnabled !== t.chatbotVotingEnabled || e.viewerLanguage !== t.viewerLanguage ? !1 :
|
|
1624
|
-
),
|
|
1625
|
-
const t =
|
|
1626
|
-
return /* @__PURE__ */ n(
|
|
1627
|
-
},
|
|
1620
|
+
}, Ia = j.memo(
|
|
1621
|
+
Sa,
|
|
1622
|
+
(e, t) => e.chatbotVotingEnabled !== t.chatbotVotingEnabled || e.viewerLanguage !== t.viewerLanguage ? !1 : Ln(e, t)
|
|
1623
|
+
), Ta = (e) => {
|
|
1624
|
+
const t = we("CustomMessage");
|
|
1625
|
+
return /* @__PURE__ */ n(Ia, { ...t, ...e });
|
|
1626
|
+
}, Aa = () => {
|
|
1628
1627
|
var s;
|
|
1629
|
-
const { handleDelete: e, message: t } =
|
|
1628
|
+
const { handleDelete: e, message: t } = we("CustomMessageActions");
|
|
1630
1629
|
return ((s = t.metadata) == null ? void 0 : s.payment_status) === "paid" ? null : /* @__PURE__ */ n(
|
|
1631
|
-
|
|
1630
|
+
qt,
|
|
1632
1631
|
{
|
|
1633
1632
|
onClick: e,
|
|
1634
1633
|
"aria-label": "Delete",
|
|
1635
1634
|
title: "Delete",
|
|
1636
1635
|
className: "bg-marble rounded-full p-2 hover:bg-sand transition-all",
|
|
1637
|
-
children: /* @__PURE__ */ n(
|
|
1636
|
+
children: /* @__PURE__ */ n(Ms, { size: 16, weight: "light", "aria-hidden": !0 })
|
|
1638
1637
|
}
|
|
1639
1638
|
);
|
|
1640
|
-
},
|
|
1641
|
-
const { handleFlag: e } =
|
|
1639
|
+
}, Ma = () => {
|
|
1640
|
+
const { handleFlag: e } = we("CustomMessageActions");
|
|
1642
1641
|
return /* @__PURE__ */ n(
|
|
1643
|
-
|
|
1642
|
+
qt,
|
|
1644
1643
|
{
|
|
1645
1644
|
onClick: e,
|
|
1646
1645
|
"aria-label": "Report",
|
|
1647
1646
|
title: "Report",
|
|
1648
1647
|
className: "bg-marble rounded-full p-2 hover:bg-sand transition-all",
|
|
1649
|
-
children: /* @__PURE__ */ n(
|
|
1648
|
+
children: /* @__PURE__ */ n(Gt, { size: 16, weight: "light", "aria-hidden": !0 })
|
|
1650
1649
|
}
|
|
1651
1650
|
);
|
|
1652
|
-
},
|
|
1651
|
+
}, Ra = () => {
|
|
1653
1652
|
var t;
|
|
1654
|
-
const { message: e } =
|
|
1653
|
+
const { message: e } = we("CustomMessageActions");
|
|
1655
1654
|
return ((t = e.metadata) == null ? void 0 : t.custom_type) !== "MESSAGE_ATTACHMENT" ? null : /* @__PURE__ */ n(
|
|
1656
|
-
|
|
1655
|
+
zs,
|
|
1657
1656
|
{
|
|
1658
1657
|
messageActionSet: [
|
|
1659
|
-
{ Component:
|
|
1660
|
-
{ Component:
|
|
1658
|
+
{ Component: Aa, placement: "quick", type: "delete" },
|
|
1659
|
+
{ Component: Ma, placement: "quick", type: "flag" }
|
|
1661
1660
|
]
|
|
1662
1661
|
}
|
|
1663
1662
|
);
|
|
1664
|
-
},
|
|
1663
|
+
}, La = ({
|
|
1665
1664
|
link: e,
|
|
1666
1665
|
onDismiss: t
|
|
1667
1666
|
}) => {
|
|
@@ -1691,7 +1690,7 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1691
1690
|
},
|
|
1692
1691
|
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",
|
|
1693
1692
|
"aria-label": "Close link preview",
|
|
1694
|
-
children: /* @__PURE__ */ n(
|
|
1693
|
+
children: /* @__PURE__ */ n(Le, { className: "size-4 text-black/90" })
|
|
1695
1694
|
}
|
|
1696
1695
|
),
|
|
1697
1696
|
/* @__PURE__ */ h("div", { className: "p-2", children: [
|
|
@@ -1701,26 +1700,26 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1701
1700
|
]
|
|
1702
1701
|
}
|
|
1703
1702
|
);
|
|
1704
|
-
},
|
|
1703
|
+
}, Da = (e) => ({
|
|
1705
1704
|
linkPreviews: Array.from(e.previews.values()).filter(
|
|
1706
|
-
(t) =>
|
|
1705
|
+
(t) => Mt.previewIsLoaded(t) || Mt.previewIsLoading(t)
|
|
1707
1706
|
)
|
|
1708
|
-
}),
|
|
1709
|
-
const { linkPreviewsManager: e } =
|
|
1707
|
+
}), Pa = () => {
|
|
1708
|
+
const { linkPreviewsManager: e } = Zn(), { linkPreviews: t } = Qn(
|
|
1710
1709
|
e.state,
|
|
1711
|
-
|
|
1710
|
+
Da
|
|
1712
1711
|
), s = (r) => {
|
|
1713
1712
|
e.dismissPreview(r);
|
|
1714
1713
|
};
|
|
1715
1714
|
return t.length > 0 ? /* @__PURE__ */ n("div", { className: "flex flex-col items-stretch w-full gap-2 mb-4", children: t.map((r) => /* @__PURE__ */ n(
|
|
1716
|
-
|
|
1715
|
+
La,
|
|
1717
1716
|
{
|
|
1718
1717
|
link: r,
|
|
1719
1718
|
onDismiss: s
|
|
1720
1719
|
},
|
|
1721
1720
|
r.og_scrape_url
|
|
1722
1721
|
)) }) : null;
|
|
1723
|
-
},
|
|
1722
|
+
}, dn = j.createContext(!1), Oa = ({ sendMessage: e, disabled: t, ...s }) => /* @__PURE__ */ n(
|
|
1724
1723
|
"button",
|
|
1725
1724
|
{
|
|
1726
1725
|
...s,
|
|
@@ -1728,20 +1727,20 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1728
1727
|
"aria-label": "Send",
|
|
1729
1728
|
disabled: t,
|
|
1730
1729
|
onClick: e,
|
|
1731
|
-
children: /* @__PURE__ */ n(
|
|
1730
|
+
children: /* @__PURE__ */ n(Rs, { weight: "bold", className: "size-4" })
|
|
1732
1731
|
}
|
|
1733
|
-
),
|
|
1734
|
-
const e =
|
|
1735
|
-
SendButton: r =
|
|
1736
|
-
AttachmentPreviewList: i =
|
|
1737
|
-
} =
|
|
1732
|
+
), za = () => {
|
|
1733
|
+
const e = Re(dn), { handleSubmit: t } = ts(), s = ns(), a = e || !s, {
|
|
1734
|
+
SendButton: r = Oa,
|
|
1735
|
+
AttachmentPreviewList: i = ss
|
|
1736
|
+
} = Vt("CustomMessageInput");
|
|
1738
1737
|
return /* @__PURE__ */ h("div", { className: "central-container flex flex-col gap-2 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: [
|
|
1739
|
-
/* @__PURE__ */ n(
|
|
1740
|
-
/* @__PURE__ */ n(
|
|
1738
|
+
/* @__PURE__ */ n(as, {}),
|
|
1739
|
+
/* @__PURE__ */ n(Pa, {}),
|
|
1741
1740
|
/* @__PURE__ */ n(i, {}),
|
|
1742
1741
|
/* @__PURE__ */ h("div", { className: "flex", children: [
|
|
1743
1742
|
/* @__PURE__ */ n("div", { className: "w-full ml-2 mr-4 self-center leading-[0]", children: /* @__PURE__ */ n(
|
|
1744
|
-
|
|
1743
|
+
rs,
|
|
1745
1744
|
{
|
|
1746
1745
|
"aria-disabled": e || void 0,
|
|
1747
1746
|
className: "w-full resize-none outline-none leading-5 placeholder:text-black/30 text-sm",
|
|
@@ -1764,15 +1763,14 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1764
1763
|
)
|
|
1765
1764
|
] })
|
|
1766
1765
|
] });
|
|
1767
|
-
},
|
|
1766
|
+
}, $a = ({
|
|
1768
1767
|
renderActions: e,
|
|
1769
1768
|
renderFooter: t,
|
|
1770
1769
|
disabled: s = !1,
|
|
1771
|
-
disabledReason: a
|
|
1772
|
-
composerInput: r
|
|
1770
|
+
disabledReason: a
|
|
1773
1771
|
}) => {
|
|
1774
|
-
var
|
|
1775
|
-
const { channel:
|
|
1772
|
+
var l;
|
|
1773
|
+
const { channel: r } = ce(), i = ((l = r == null ? void 0 : r.data) == null ? void 0 : l.frozen) === !0;
|
|
1776
1774
|
return s ? /* @__PURE__ */ h(ae, { children: [
|
|
1777
1775
|
/* @__PURE__ */ n("div", { className: "messaging-composer-locked-panel flex w-full flex-col items-center justify-center gap-3 px-6 py-4", children: a ? /* @__PURE__ */ n("p", { className: "max-w-[345px] text-center text-xs font-normal leading-[1.3] tracking-[0.12px] text-black/40", children: a }) : null }),
|
|
1778
1776
|
t == null ? void 0 : t()
|
|
@@ -1780,72 +1778,72 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1780
1778
|
/* @__PURE__ */ h(
|
|
1781
1779
|
"div",
|
|
1782
1780
|
{
|
|
1783
|
-
inert:
|
|
1784
|
-
"aria-disabled":
|
|
1781
|
+
inert: i ? "" : void 0,
|
|
1782
|
+
"aria-disabled": i || void 0,
|
|
1785
1783
|
className: "message-input flex items-end gap-4 aria-disabled:opacity-40",
|
|
1786
1784
|
children: [
|
|
1787
1785
|
e && /* @__PURE__ */ n("div", { className: "flex h-12 shrink-0 items-center justify-center", children: e() }),
|
|
1788
|
-
/* @__PURE__ */ n(
|
|
1786
|
+
/* @__PURE__ */ n(dn.Provider, { value: i, children: /* @__PURE__ */ n(es, { Input: za }) })
|
|
1789
1787
|
]
|
|
1790
1788
|
}
|
|
1791
1789
|
),
|
|
1792
1790
|
t == null ? void 0 : t()
|
|
1793
1791
|
] });
|
|
1794
|
-
},
|
|
1792
|
+
}, Fa = [
|
|
1795
1793
|
"SYSTEM_DM_AGENT_PAUSED",
|
|
1796
1794
|
"SYSTEM_DM_AGENT_RESUMED"
|
|
1797
|
-
],
|
|
1795
|
+
], Ba = {
|
|
1798
1796
|
SYSTEM_DM_AGENT_PAUSED: "DM Agent has left the conversation",
|
|
1799
1797
|
SYSTEM_DM_AGENT_RESUMED: "DM Agent has rejoined the conversation"
|
|
1800
|
-
},
|
|
1798
|
+
}, Ua = [
|
|
1801
1799
|
"SYSTEM_AGE_SAFETY_BLOCKED"
|
|
1802
|
-
],
|
|
1800
|
+
], ja = {
|
|
1803
1801
|
SYSTEM_AGE_SAFETY_BLOCKED: "This user isn’t able to reply because they don’t meet our age safety guidelines."
|
|
1804
|
-
},
|
|
1802
|
+
}, Fe = "age safety guidelines.", Va = "https://linktr.ee/s/about/contact", Bt = (e) => Fa.includes(e), Ga = (e) => Ua.includes(e), Ha = (e) => {
|
|
1805
1803
|
var a;
|
|
1806
1804
|
const t = (a = e.metadata) == null ? void 0 : a.custom_type;
|
|
1807
|
-
if (
|
|
1805
|
+
if (Bt(t))
|
|
1808
1806
|
return {
|
|
1809
1807
|
kind: "dm-agent",
|
|
1810
1808
|
type: t
|
|
1811
1809
|
};
|
|
1812
|
-
if (
|
|
1810
|
+
if (Ga(t))
|
|
1813
1811
|
return {
|
|
1814
1812
|
kind: "age-safety",
|
|
1815
1813
|
type: t
|
|
1816
1814
|
};
|
|
1817
1815
|
const s = e.dm_agent_system_type;
|
|
1818
|
-
if (
|
|
1816
|
+
if (Bt(s))
|
|
1819
1817
|
return {
|
|
1820
1818
|
kind: "dm-agent",
|
|
1821
1819
|
type: s
|
|
1822
1820
|
};
|
|
1823
|
-
},
|
|
1824
|
-
const t = e.indexOf(
|
|
1821
|
+
}, Ya = (e) => {
|
|
1822
|
+
const t = e.indexOf(Fe);
|
|
1825
1823
|
if (t === -1)
|
|
1826
1824
|
return e;
|
|
1827
|
-
const s = t +
|
|
1825
|
+
const s = t + Fe.length;
|
|
1828
1826
|
return /* @__PURE__ */ h(ae, { children: [
|
|
1829
1827
|
e.slice(0, t),
|
|
1830
1828
|
/* @__PURE__ */ n(
|
|
1831
1829
|
"a",
|
|
1832
1830
|
{
|
|
1833
|
-
href:
|
|
1831
|
+
href: Va,
|
|
1834
1832
|
target: "_blank",
|
|
1835
1833
|
rel: "noopener noreferrer",
|
|
1836
1834
|
className: "mes-age-safety-system-message__emphasis font-medium text-inherit underline",
|
|
1837
|
-
children:
|
|
1835
|
+
children: Fe
|
|
1838
1836
|
}
|
|
1839
1837
|
),
|
|
1840
1838
|
e.slice(s)
|
|
1841
1839
|
] });
|
|
1842
|
-
},
|
|
1840
|
+
}, qa = (e) => {
|
|
1843
1841
|
var a, r;
|
|
1844
|
-
const t = e.message.hide_date === !0, s =
|
|
1842
|
+
const t = e.message.hide_date === !0, s = Ha(
|
|
1845
1843
|
e.message
|
|
1846
1844
|
);
|
|
1847
1845
|
if ((s == null ? void 0 : s.kind) === "dm-agent") {
|
|
1848
|
-
const i = ((a = e.message.text) == null ? void 0 : a.trim()) ||
|
|
1846
|
+
const i = ((a = e.message.text) == null ? void 0 : a.trim()) || Ba[s.type];
|
|
1849
1847
|
return /* @__PURE__ */ h("div", { className: "str-chat__message--system", "data-testid": "message-system", children: [
|
|
1850
1848
|
/* @__PURE__ */ h(
|
|
1851
1849
|
"div",
|
|
@@ -1871,7 +1869,7 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1871
1869
|
] });
|
|
1872
1870
|
}
|
|
1873
1871
|
if ((s == null ? void 0 : s.kind) === "age-safety") {
|
|
1874
|
-
const i = ((r = e.message.text) == null ? void 0 : r.trim()) ||
|
|
1872
|
+
const i = ((r = e.message.text) == null ? void 0 : r.trim()) || ja[s.type];
|
|
1875
1873
|
return /* @__PURE__ */ h("div", { className: "str-chat__message--system", "data-testid": "message-system", children: [
|
|
1876
1874
|
/* @__PURE__ */ h(
|
|
1877
1875
|
"div",
|
|
@@ -1881,7 +1879,7 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1881
1879
|
"data-age-safety-system-type": s.type,
|
|
1882
1880
|
children: [
|
|
1883
1881
|
/* @__PURE__ */ n(
|
|
1884
|
-
|
|
1882
|
+
Ls,
|
|
1885
1883
|
{
|
|
1886
1884
|
size: 24,
|
|
1887
1885
|
weight: "duotone",
|
|
@@ -1890,7 +1888,7 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1890
1888
|
"data-testid": "age-safety-system-message-icon"
|
|
1891
1889
|
}
|
|
1892
1890
|
),
|
|
1893
|
-
/* @__PURE__ */ n("div", { className: "mes-age-safety-system-message__content min-w-0 flex-[1_0_0]", children: /* @__PURE__ */ n("p", { className: "m-0 text-balance text-left text-[12px] font-normal leading-4 tracking-[0.21px] text-[color:var(--text-warning-on-warning,#894b00)]", children:
|
|
1891
|
+
/* @__PURE__ */ n("div", { className: "mes-age-safety-system-message__content min-w-0 flex-[1_0_0]", children: /* @__PURE__ */ n("p", { className: "m-0 text-balance text-left text-[12px] font-normal leading-4 tracking-[0.21px] text-[color:var(--text-warning-on-warning,#894b00)]", children: Ya(i) }) })
|
|
1894
1892
|
]
|
|
1895
1893
|
}
|
|
1896
1894
|
),
|
|
@@ -1905,7 +1903,7 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1905
1903
|
] }),
|
|
1906
1904
|
!t && /* @__PURE__ */ n(Oe, { message: e.message })
|
|
1907
1905
|
] });
|
|
1908
|
-
}, un = qe(!1),
|
|
1906
|
+
}, un = qe(!1), Be = ({ cx: e, index: t }) => /* @__PURE__ */ n("circle", { cx: e, cy: "6.15", r: "3.9", fill: "#A0A0A0", children: /* @__PURE__ */ n(
|
|
1909
1907
|
"animateTransform",
|
|
1910
1908
|
{
|
|
1911
1909
|
attributeName: "transform",
|
|
@@ -1915,21 +1913,21 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1915
1913
|
begin: `${120 * t}ms`,
|
|
1916
1914
|
repeatCount: "indefinite"
|
|
1917
1915
|
}
|
|
1918
|
-
) }),
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
]),
|
|
1923
|
-
var b,
|
|
1924
|
-
const { channel: t, channelConfig: s, thread: a } =
|
|
1925
|
-
if (!e && o &&
|
|
1926
|
-
const
|
|
1916
|
+
) }), Wa = /* @__PURE__ */ new Set([
|
|
1917
|
+
ze.Thinking,
|
|
1918
|
+
ze.Generating,
|
|
1919
|
+
ze.ExternalSources
|
|
1920
|
+
]), Xa = ({ threadList: e }) => {
|
|
1921
|
+
var b, N;
|
|
1922
|
+
const { channel: t, channelConfig: s, thread: a } = ce(), { client: r } = Xe(), { typing: i = {} } = is(), { aiState: l } = ls(t), o = Re(un);
|
|
1923
|
+
if (!e && o && Wa.has(l)) {
|
|
1924
|
+
const x = Ka(t, (b = r.user) == null ? void 0 : b.id);
|
|
1927
1925
|
return /* @__PURE__ */ n(
|
|
1928
|
-
|
|
1926
|
+
Ut,
|
|
1929
1927
|
{
|
|
1930
|
-
avatarId: (
|
|
1931
|
-
avatarName: (
|
|
1932
|
-
avatarImage:
|
|
1928
|
+
avatarId: (x == null ? void 0 : x.id) ?? "ai-agent",
|
|
1929
|
+
avatarName: (x == null ? void 0 : x.name) ?? (x == null ? void 0 : x.id) ?? "Agent",
|
|
1930
|
+
avatarImage: x == null ? void 0 : x.image,
|
|
1933
1931
|
testId: "typing-indicator-ai"
|
|
1934
1932
|
}
|
|
1935
1933
|
);
|
|
@@ -1937,21 +1935,21 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1937
1935
|
if ((s == null ? void 0 : s.typing_events) === !1)
|
|
1938
1936
|
return null;
|
|
1939
1937
|
const m = e ? [] : Object.values(i).filter(
|
|
1940
|
-
({ parent_id:
|
|
1941
|
-
var
|
|
1942
|
-
return (p == null ? void 0 : p.id) !== ((
|
|
1938
|
+
({ parent_id: x, user: p }) => {
|
|
1939
|
+
var v;
|
|
1940
|
+
return (p == null ? void 0 : p.id) !== ((v = r.user) == null ? void 0 : v.id) && !x;
|
|
1943
1941
|
}
|
|
1944
1942
|
), g = e ? Object.values(i).filter(
|
|
1945
|
-
({ parent_id:
|
|
1946
|
-
var
|
|
1947
|
-
return (p == null ? void 0 : p.id) !== ((
|
|
1943
|
+
({ parent_id: x, user: p }) => {
|
|
1944
|
+
var v;
|
|
1945
|
+
return (p == null ? void 0 : p.id) !== ((v = r.user) == null ? void 0 : v.id) && x === (a == null ? void 0 : a.id);
|
|
1948
1946
|
}
|
|
1949
1947
|
) : [], u = e ? g : m;
|
|
1950
1948
|
if (!u.length)
|
|
1951
1949
|
return null;
|
|
1952
|
-
const f = (
|
|
1950
|
+
const f = (N = u[0]) == null ? void 0 : N.user, c = f != null && f.id && t.state.members[f.id] ? t.state.members[f.id].user : void 0;
|
|
1953
1951
|
return /* @__PURE__ */ n(
|
|
1954
|
-
|
|
1952
|
+
Ut,
|
|
1955
1953
|
{
|
|
1956
1954
|
avatarId: (f == null ? void 0 : f.id) ?? (c == null ? void 0 : c.id) ?? "typing-user",
|
|
1957
1955
|
avatarName: (f == null ? void 0 : f.name) ?? (c == null ? void 0 : c.name) ?? (f == null ? void 0 : f.id) ?? "Typing user",
|
|
@@ -1959,7 +1957,7 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1959
1957
|
testId: "typing-indicator"
|
|
1960
1958
|
}
|
|
1961
1959
|
);
|
|
1962
|
-
},
|
|
1960
|
+
}, Ut = ({
|
|
1963
1961
|
avatarId: e,
|
|
1964
1962
|
avatarName: t,
|
|
1965
1963
|
avatarImage: s,
|
|
@@ -1974,7 +1972,7 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1974
1972
|
},
|
|
1975
1973
|
children: /* @__PURE__ */ h("div", { className: "str-chat__message str-chat__message-simple str-chat__message--regular str-chat__message--received str-chat__message--other str-chat__message--has-text", children: [
|
|
1976
1974
|
/* @__PURE__ */ n(
|
|
1977
|
-
|
|
1975
|
+
ie,
|
|
1978
1976
|
{
|
|
1979
1977
|
className: "str-chat__avatar str-chat__message-sender-avatar",
|
|
1980
1978
|
id: e,
|
|
@@ -1994,16 +1992,16 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1994
1992
|
height: "13",
|
|
1995
1993
|
overflow: "visible",
|
|
1996
1994
|
children: [
|
|
1997
|
-
/* @__PURE__ */ n(
|
|
1998
|
-
/* @__PURE__ */ n(
|
|
1999
|
-
/* @__PURE__ */ n(
|
|
1995
|
+
/* @__PURE__ */ n(Be, { cx: "4", index: 0 }),
|
|
1996
|
+
/* @__PURE__ */ n(Be, { cx: "16", index: 1 }),
|
|
1997
|
+
/* @__PURE__ */ n(Be, { cx: "28", index: 2 })
|
|
2000
1998
|
]
|
|
2001
1999
|
}
|
|
2002
2000
|
) }) }) }) }) })
|
|
2003
2001
|
] })
|
|
2004
2002
|
}
|
|
2005
2003
|
);
|
|
2006
|
-
function
|
|
2004
|
+
function Ka(e, t) {
|
|
2007
2005
|
var a;
|
|
2008
2006
|
const s = ((a = e == null ? void 0 : e.state) == null ? void 0 : a.members) ?? {};
|
|
2009
2007
|
for (const r of Object.values(s)) {
|
|
@@ -2012,7 +2010,7 @@ function Wa(e, t) {
|
|
|
2012
2010
|
return i;
|
|
2013
2011
|
}
|
|
2014
2012
|
}
|
|
2015
|
-
const
|
|
2013
|
+
const Ja = () => null, Za = ({ className: e, message: t }) => /* @__PURE__ */ h(
|
|
2016
2014
|
"div",
|
|
2017
2015
|
{
|
|
2018
2016
|
className: y("flex items-center justify-center h-full", e),
|
|
@@ -2056,11 +2054,40 @@ const Xa = () => null, Ka = ({ className: e, message: t }) => /* @__PURE__ */ h(
|
|
|
2056
2054
|
]
|
|
2057
2055
|
}
|
|
2058
2056
|
), Te = j.memo(() => /* @__PURE__ */ n("div", { className: "messaging-loading-state flex items-center justify-center h-full", children: /* @__PURE__ */ h("div", { className: "flex items-center", children: [
|
|
2059
|
-
/* @__PURE__ */ n(
|
|
2057
|
+
/* @__PURE__ */ n(Za, { className: "w-6 h-6" }),
|
|
2060
2058
|
/* @__PURE__ */ n("span", { className: "text-sm text-stone", children: "Loading messages" })
|
|
2061
2059
|
] }) }));
|
|
2062
2060
|
Te.displayName = "LoadingState";
|
|
2063
|
-
const
|
|
2061
|
+
const be = ({ participant: e, isStarred: t = !1 }) => {
|
|
2062
|
+
const s = (e == null ? void 0 : e.customer) === !0;
|
|
2063
|
+
return !s && !t ? null : /* @__PURE__ */ h("span", { className: "inline-flex shrink-0 items-center gap-1", children: [
|
|
2064
|
+
s && /* @__PURE__ */ n(
|
|
2065
|
+
"span",
|
|
2066
|
+
{
|
|
2067
|
+
role: "img",
|
|
2068
|
+
"aria-label": "Customer",
|
|
2069
|
+
className: "inline-flex size-4 items-center justify-center rounded-full bg-[#22C55E] text-white",
|
|
2070
|
+
children: /* @__PURE__ */ n(
|
|
2071
|
+
Ds,
|
|
2072
|
+
{
|
|
2073
|
+
"aria-hidden": "true",
|
|
2074
|
+
className: "size-3",
|
|
2075
|
+
weight: "bold"
|
|
2076
|
+
}
|
|
2077
|
+
)
|
|
2078
|
+
}
|
|
2079
|
+
),
|
|
2080
|
+
t && /* @__PURE__ */ n(
|
|
2081
|
+
"span",
|
|
2082
|
+
{
|
|
2083
|
+
role: "img",
|
|
2084
|
+
"aria-label": "Starred conversation",
|
|
2085
|
+
className: "inline-flex size-4 items-center justify-center rounded-full bg-[#F6C343] text-white",
|
|
2086
|
+
children: /* @__PURE__ */ n(Se, { "aria-hidden": "true", className: "size-3", weight: "fill" })
|
|
2087
|
+
}
|
|
2088
|
+
)
|
|
2089
|
+
] });
|
|
2090
|
+
}, le = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-center transition-colors duration-150 focus-ring", jt = "Replies instantly with AI assistant", Qa = ({
|
|
2064
2091
|
onBack: e,
|
|
2065
2092
|
showBackButton: t,
|
|
2066
2093
|
showStarButton: s = !1,
|
|
@@ -2076,29 +2103,29 @@ const le = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2076
2103
|
customChannelActions: f,
|
|
2077
2104
|
renderChannelActions: c,
|
|
2078
2105
|
showChannelInfo: b = !0,
|
|
2079
|
-
onParticipantNameClick:
|
|
2080
|
-
renderHeaderTitleBadges:
|
|
2106
|
+
onParticipantNameClick: N,
|
|
2107
|
+
renderHeaderTitleBadges: x
|
|
2081
2108
|
}) => {
|
|
2082
|
-
var
|
|
2083
|
-
const { channel: p } =
|
|
2084
|
-
var
|
|
2085
|
-
const
|
|
2086
|
-
return
|
|
2087
|
-
(
|
|
2088
|
-
var
|
|
2089
|
-
return ((
|
|
2109
|
+
var O, S, E, L, D;
|
|
2110
|
+
const { channel: p } = ce(), v = j.useMemo(() => {
|
|
2111
|
+
var T, P;
|
|
2112
|
+
const C = (T = p._client) == null ? void 0 : T.userID;
|
|
2113
|
+
return C ? Object.values(((P = p.state) == null ? void 0 : P.members) || {}).find(
|
|
2114
|
+
(F) => {
|
|
2115
|
+
var Y;
|
|
2116
|
+
return ((Y = F.user) == null ? void 0 : Y.id) && F.user.id !== C;
|
|
2090
2117
|
}
|
|
2091
2118
|
) : void 0;
|
|
2092
|
-
}, [(
|
|
2119
|
+
}, [(O = p._client) == null ? void 0 : O.userID, (S = p.state) == null ? void 0 : S.members]), A = Kt(v == null ? void 0 : v.user), R = (E = v == null ? void 0 : v.user) == null ? void 0 : E.image, _ = Xt(p), M = x == null ? void 0 : x({
|
|
2093
2120
|
channel: p,
|
|
2094
|
-
participant:
|
|
2095
|
-
}),
|
|
2121
|
+
participant: v
|
|
2122
|
+
}), z = async () => {
|
|
2096
2123
|
try {
|
|
2097
|
-
|
|
2098
|
-
} catch (
|
|
2124
|
+
_ ? await p.unpin() : await p.pin();
|
|
2125
|
+
} catch (C) {
|
|
2099
2126
|
console.error(
|
|
2100
2127
|
"[CustomChannelHeader] Failed to update pinned status:",
|
|
2101
|
-
|
|
2128
|
+
C
|
|
2102
2129
|
);
|
|
2103
2130
|
}
|
|
2104
2131
|
};
|
|
@@ -2115,41 +2142,54 @@ const le = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2115
2142
|
}),
|
|
2116
2143
|
type: "button",
|
|
2117
2144
|
"aria-label": "Back to conversations",
|
|
2118
|
-
children: /* @__PURE__ */ n(
|
|
2145
|
+
children: /* @__PURE__ */ n(Dt, { className: "size-5 text-black/90" })
|
|
2119
2146
|
}
|
|
2120
2147
|
) }),
|
|
2121
2148
|
/* @__PURE__ */ h("div", { className: "flex flex-col gap-1 items-center", children: [
|
|
2122
2149
|
/* @__PURE__ */ n(
|
|
2123
|
-
|
|
2150
|
+
ie,
|
|
2124
2151
|
{
|
|
2125
|
-
id: ((
|
|
2152
|
+
id: ((L = v == null ? void 0 : v.user) == null ? void 0 : L.id) || p.id || "unknown",
|
|
2126
2153
|
name: A,
|
|
2127
|
-
image:
|
|
2128
|
-
starred: s && C,
|
|
2154
|
+
image: R,
|
|
2129
2155
|
dmAgentEnabled: a,
|
|
2130
2156
|
size: 48
|
|
2131
2157
|
}
|
|
2132
2158
|
),
|
|
2133
|
-
|
|
2159
|
+
N ? /* @__PURE__ */ h(
|
|
2134
2160
|
"button",
|
|
2135
2161
|
{
|
|
2136
2162
|
type: "button",
|
|
2137
|
-
onClick:
|
|
2163
|
+
onClick: N,
|
|
2138
2164
|
"aria-label": `View details for ${A}`,
|
|
2139
2165
|
className: "flex max-w-full items-center gap-0.5 rounded text-center text-xs font-medium text-black/90 transition-opacity hover:opacity-70",
|
|
2140
2166
|
children: [
|
|
2141
2167
|
/* @__PURE__ */ n("span", { className: "min-w-0 truncate", children: A }),
|
|
2142
|
-
|
|
2168
|
+
/* @__PURE__ */ n(
|
|
2169
|
+
be,
|
|
2170
|
+
{
|
|
2171
|
+
participant: v,
|
|
2172
|
+
isStarred: _
|
|
2173
|
+
}
|
|
2174
|
+
),
|
|
2175
|
+
M && /* @__PURE__ */ n("span", { className: "shrink-0", children: M }),
|
|
2143
2176
|
/* @__PURE__ */ n(Ge, { className: "size-3 shrink-0", weight: "bold" })
|
|
2144
2177
|
]
|
|
2145
2178
|
}
|
|
2146
2179
|
) : /* @__PURE__ */ h("p", { className: "flex max-w-full items-center justify-center gap-1 text-center text-xs font-medium text-black/90", children: [
|
|
2147
2180
|
/* @__PURE__ */ n("span", { className: "min-w-0 truncate", children: A }),
|
|
2148
|
-
|
|
2181
|
+
/* @__PURE__ */ n(
|
|
2182
|
+
be,
|
|
2183
|
+
{
|
|
2184
|
+
participant: v,
|
|
2185
|
+
isStarred: _
|
|
2186
|
+
}
|
|
2187
|
+
),
|
|
2188
|
+
M && /* @__PURE__ */ n("span", { className: "shrink-0", children: M })
|
|
2149
2189
|
] }),
|
|
2150
2190
|
a && /* @__PURE__ */ h("div", { className: "flex items-center gap-1 text-[10px] leading-3 text-black/55", children: [
|
|
2151
2191
|
/* @__PURE__ */ n(Ve, { className: "size-3 shrink-0 text-black/55" }),
|
|
2152
|
-
/* @__PURE__ */ n("span", { children:
|
|
2192
|
+
/* @__PURE__ */ n("span", { children: jt })
|
|
2153
2193
|
] })
|
|
2154
2194
|
] }),
|
|
2155
2195
|
/* @__PURE__ */ h("div", { className: "flex justify-end items-center gap-2", children: [
|
|
@@ -2157,26 +2197,26 @@ const le = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2157
2197
|
"button",
|
|
2158
2198
|
{
|
|
2159
2199
|
className: le,
|
|
2160
|
-
onClick:
|
|
2200
|
+
onClick: z,
|
|
2161
2201
|
type: "button",
|
|
2162
|
-
"aria-label":
|
|
2202
|
+
"aria-label": _ ? "Unstar conversation" : "Star conversation",
|
|
2163
2203
|
children: /* @__PURE__ */ n(
|
|
2164
|
-
|
|
2204
|
+
Se,
|
|
2165
2205
|
{
|
|
2166
2206
|
className: y("size-5", {
|
|
2167
|
-
"text-yellow-600":
|
|
2168
|
-
"text-black/90": !
|
|
2207
|
+
"text-yellow-600": _,
|
|
2208
|
+
"text-black/90": !_
|
|
2169
2209
|
}),
|
|
2170
|
-
weight:
|
|
2210
|
+
weight: _ ? "duotone" : "regular"
|
|
2171
2211
|
}
|
|
2172
2212
|
)
|
|
2173
2213
|
}
|
|
2174
2214
|
),
|
|
2175
2215
|
b && (c !== void 0 ? c : /* @__PURE__ */ n(
|
|
2176
|
-
|
|
2216
|
+
zt,
|
|
2177
2217
|
{
|
|
2178
2218
|
channel: p,
|
|
2179
|
-
participant:
|
|
2219
|
+
participant: v,
|
|
2180
2220
|
showDeleteConversation: l,
|
|
2181
2221
|
showBlockParticipant: o,
|
|
2182
2222
|
showReportParticipant: d,
|
|
@@ -2203,41 +2243,54 @@ const le = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2203
2243
|
type: "button",
|
|
2204
2244
|
onClick: e,
|
|
2205
2245
|
"aria-label": "Back to conversations",
|
|
2206
|
-
children: /* @__PURE__ */ n(
|
|
2246
|
+
children: /* @__PURE__ */ n(Dt, { className: "size-5 text-black/90" })
|
|
2207
2247
|
}
|
|
2208
2248
|
),
|
|
2209
2249
|
/* @__PURE__ */ n(
|
|
2210
|
-
|
|
2250
|
+
ie,
|
|
2211
2251
|
{
|
|
2212
|
-
id: ((
|
|
2252
|
+
id: ((D = v == null ? void 0 : v.user) == null ? void 0 : D.id) || p.id || "unknown",
|
|
2213
2253
|
name: A,
|
|
2214
|
-
image:
|
|
2215
|
-
starred: s && C,
|
|
2254
|
+
image: R,
|
|
2216
2255
|
dmAgentEnabled: a,
|
|
2217
2256
|
size: 48
|
|
2218
2257
|
}
|
|
2219
2258
|
),
|
|
2220
2259
|
/* @__PURE__ */ h("div", { className: "min-w-0", children: [
|
|
2221
|
-
|
|
2260
|
+
N ? /* @__PURE__ */ h(
|
|
2222
2261
|
"button",
|
|
2223
2262
|
{
|
|
2224
2263
|
type: "button",
|
|
2225
|
-
onClick:
|
|
2264
|
+
onClick: N,
|
|
2226
2265
|
"aria-label": `View details for ${A}`,
|
|
2227
2266
|
className: "flex min-w-0 max-w-full items-center gap-1 rounded font-medium text-black/90 transition-opacity hover:opacity-70",
|
|
2228
2267
|
children: [
|
|
2229
2268
|
/* @__PURE__ */ n("span", { className: "min-w-0 truncate", children: A }),
|
|
2230
|
-
|
|
2269
|
+
/* @__PURE__ */ n(
|
|
2270
|
+
be,
|
|
2271
|
+
{
|
|
2272
|
+
participant: v,
|
|
2273
|
+
isStarred: _
|
|
2274
|
+
}
|
|
2275
|
+
),
|
|
2276
|
+
M && /* @__PURE__ */ n("span", { className: "shrink-0", children: M }),
|
|
2231
2277
|
/* @__PURE__ */ n(Ge, { className: "size-4 shrink-0", weight: "bold" })
|
|
2232
2278
|
]
|
|
2233
2279
|
}
|
|
2234
2280
|
) : /* @__PURE__ */ h("h1", { className: "flex min-w-0 items-center gap-1 font-medium text-black/90", children: [
|
|
2235
2281
|
/* @__PURE__ */ n("span", { className: "min-w-0 truncate", children: A }),
|
|
2236
|
-
|
|
2282
|
+
/* @__PURE__ */ n(
|
|
2283
|
+
be,
|
|
2284
|
+
{
|
|
2285
|
+
participant: v,
|
|
2286
|
+
isStarred: _
|
|
2287
|
+
}
|
|
2288
|
+
),
|
|
2289
|
+
M && /* @__PURE__ */ n("span", { className: "shrink-0", children: M })
|
|
2237
2290
|
] }),
|
|
2238
2291
|
a && /* @__PURE__ */ h("div", { className: "mt-0.5 flex items-center gap-1 text-[10px] leading-3 text-black/55", children: [
|
|
2239
2292
|
/* @__PURE__ */ n(Ve, { className: "size-3 shrink-0 text-black/55" }),
|
|
2240
|
-
/* @__PURE__ */ n("span", { className: "truncate", children:
|
|
2293
|
+
/* @__PURE__ */ n("span", { className: "truncate", children: jt })
|
|
2241
2294
|
] })
|
|
2242
2295
|
] })
|
|
2243
2296
|
] }),
|
|
@@ -2246,26 +2299,26 @@ const le = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2246
2299
|
"button",
|
|
2247
2300
|
{
|
|
2248
2301
|
className: le,
|
|
2249
|
-
onClick:
|
|
2302
|
+
onClick: z,
|
|
2250
2303
|
type: "button",
|
|
2251
|
-
"aria-label":
|
|
2304
|
+
"aria-label": _ ? "Unstar conversation" : "Star conversation",
|
|
2252
2305
|
children: /* @__PURE__ */ n(
|
|
2253
|
-
|
|
2306
|
+
Se,
|
|
2254
2307
|
{
|
|
2255
2308
|
className: y("size-6", {
|
|
2256
|
-
"text-yellow-600":
|
|
2257
|
-
"text-black/90": !
|
|
2309
|
+
"text-yellow-600": _,
|
|
2310
|
+
"text-black/90": !_
|
|
2258
2311
|
}),
|
|
2259
|
-
weight:
|
|
2312
|
+
weight: _ ? "duotone" : "regular"
|
|
2260
2313
|
}
|
|
2261
2314
|
)
|
|
2262
2315
|
}
|
|
2263
2316
|
),
|
|
2264
2317
|
b && (c !== void 0 ? c : /* @__PURE__ */ n(
|
|
2265
|
-
|
|
2318
|
+
zt,
|
|
2266
2319
|
{
|
|
2267
2320
|
channel: p,
|
|
2268
|
-
participant:
|
|
2321
|
+
participant: v,
|
|
2269
2322
|
showDeleteConversation: l,
|
|
2270
2323
|
showBlockParticipant: o,
|
|
2271
2324
|
showReportParticipant: d,
|
|
@@ -2281,7 +2334,7 @@ const le = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2281
2334
|
] })
|
|
2282
2335
|
] })
|
|
2283
2336
|
] });
|
|
2284
|
-
},
|
|
2337
|
+
}, er = ({
|
|
2285
2338
|
onBack: e,
|
|
2286
2339
|
showBackButton: t,
|
|
2287
2340
|
renderMessageInputActions: s,
|
|
@@ -2297,66 +2350,65 @@ const le = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2297
2350
|
showReportParticipant: f = !0,
|
|
2298
2351
|
composerDisabled: c = !1,
|
|
2299
2352
|
composerDisabledReason: b,
|
|
2300
|
-
showStarButton:
|
|
2301
|
-
chatbotVotingEnabled:
|
|
2353
|
+
showStarButton: N = !1,
|
|
2354
|
+
chatbotVotingEnabled: x = !1,
|
|
2302
2355
|
renderChannelBanner: p,
|
|
2303
|
-
renderHeaderTitleBadges:
|
|
2356
|
+
renderHeaderTitleBadges: v,
|
|
2304
2357
|
customChannelActions: A,
|
|
2305
|
-
renderChannelActions:
|
|
2306
|
-
renderMessage:
|
|
2307
|
-
dmAgentEnabled:
|
|
2308
|
-
viewerLanguage:
|
|
2309
|
-
showChannelInfo:
|
|
2310
|
-
onParticipantNameClick:
|
|
2311
|
-
composerInput: L
|
|
2358
|
+
renderChannelActions: R,
|
|
2359
|
+
renderMessage: _,
|
|
2360
|
+
dmAgentEnabled: M = !1,
|
|
2361
|
+
viewerLanguage: z,
|
|
2362
|
+
showChannelInfo: O = !0,
|
|
2363
|
+
onParticipantNameClick: S
|
|
2312
2364
|
}) => {
|
|
2313
|
-
var
|
|
2314
|
-
const { channel:
|
|
2315
|
-
var q,
|
|
2316
|
-
const
|
|
2317
|
-
return
|
|
2318
|
-
(
|
|
2319
|
-
var
|
|
2320
|
-
return ((
|
|
2365
|
+
var F, Y, Z, J, U, w;
|
|
2366
|
+
const { channel: E } = ce(), L = j.useMemo(() => {
|
|
2367
|
+
var q, H;
|
|
2368
|
+
const k = (q = E._client) == null ? void 0 : q.userID;
|
|
2369
|
+
return k ? Object.values(((H = E.state) == null ? void 0 : H.members) || {}).find(
|
|
2370
|
+
(V) => {
|
|
2371
|
+
var W;
|
|
2372
|
+
return ((W = V.user) == null ? void 0 : W.id) && V.user.id !== k;
|
|
2321
2373
|
}
|
|
2322
2374
|
) : void 0;
|
|
2323
|
-
}, [(
|
|
2324
|
-
var q,
|
|
2325
|
-
const
|
|
2326
|
-
return
|
|
2327
|
-
var
|
|
2328
|
-
return ((
|
|
2375
|
+
}, [(F = E._client) == null ? void 0 : F.userID, (Y = E.state) == null ? void 0 : Y.members]), D = j.useMemo(() => {
|
|
2376
|
+
var q, H;
|
|
2377
|
+
const k = (q = E._client) == null ? void 0 : q.userID;
|
|
2378
|
+
return k ? Object.values(((H = E.state) == null ? void 0 : H.members) || {}).find((V) => {
|
|
2379
|
+
var W;
|
|
2380
|
+
return ((W = V.user) == null ? void 0 : W.id) === k;
|
|
2329
2381
|
}) : void 0;
|
|
2330
|
-
}, [(
|
|
2331
|
-
(
|
|
2332
|
-
const { message:
|
|
2333
|
-
|
|
2382
|
+
}, [(Z = E._client) == null ? void 0 : Z.userID, (J = E.state) == null ? void 0 : J.members]), C = ((U = D == null ? void 0 : D.user) == null ? void 0 : U.is_account) ?? (D == null ? void 0 : D.is_account), I = ((w = L == null ? void 0 : L.user) == null ? void 0 : w.is_account) ?? (L == null ? void 0 : L.is_account), T = M && C === !1 && I === !0, P = K(
|
|
2383
|
+
(k) => {
|
|
2384
|
+
const { message: B } = we("ChannelView"), q = /* @__PURE__ */ n(
|
|
2385
|
+
Ta,
|
|
2334
2386
|
{
|
|
2335
|
-
...
|
|
2336
|
-
chatbotVotingEnabled:
|
|
2337
|
-
viewerLanguage:
|
|
2387
|
+
...k,
|
|
2388
|
+
chatbotVotingEnabled: x,
|
|
2389
|
+
viewerLanguage: z
|
|
2338
2390
|
}
|
|
2339
2391
|
);
|
|
2340
|
-
return !
|
|
2392
|
+
return !_ || !B ? q : _(q, B);
|
|
2341
2393
|
},
|
|
2342
|
-
[
|
|
2394
|
+
[x, _, z]
|
|
2343
2395
|
);
|
|
2344
2396
|
return /* @__PURE__ */ n(ae, { children: /* @__PURE__ */ n(
|
|
2345
|
-
|
|
2397
|
+
cs,
|
|
2346
2398
|
{
|
|
2347
2399
|
overrides: {
|
|
2348
|
-
Message:
|
|
2349
|
-
MessageActions:
|
|
2400
|
+
Message: P,
|
|
2401
|
+
MessageActions: Ra
|
|
2350
2402
|
},
|
|
2351
|
-
children: /* @__PURE__ */ h(
|
|
2403
|
+
children: /* @__PURE__ */ h(ds, { children: [
|
|
2352
2404
|
/* @__PURE__ */ n("div", { children: /* @__PURE__ */ n(
|
|
2353
|
-
|
|
2405
|
+
Qa,
|
|
2354
2406
|
{
|
|
2355
2407
|
onBack: e,
|
|
2356
2408
|
showBackButton: t,
|
|
2357
|
-
showChannelInfo:
|
|
2358
|
-
showStarButton:
|
|
2359
|
-
dmAgentEnabled:
|
|
2409
|
+
showChannelInfo: O,
|
|
2410
|
+
showStarButton: N,
|
|
2411
|
+
dmAgentEnabled: T,
|
|
2360
2412
|
onLeaveConversation: i,
|
|
2361
2413
|
onBlockParticipant: l,
|
|
2362
2414
|
showDeleteConversation: o,
|
|
@@ -2366,9 +2418,9 @@ const le = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2366
2418
|
onBlockParticipantClick: m,
|
|
2367
2419
|
onReportParticipantClick: g,
|
|
2368
2420
|
customChannelActions: A,
|
|
2369
|
-
renderChannelActions:
|
|
2370
|
-
onParticipantNameClick:
|
|
2371
|
-
renderHeaderTitleBadges:
|
|
2421
|
+
renderChannelActions: R,
|
|
2422
|
+
onParticipantNameClick: S,
|
|
2423
|
+
renderHeaderTitleBadges: v
|
|
2372
2424
|
}
|
|
2373
2425
|
) }, "lt-channel-header"),
|
|
2374
2426
|
p ? /* @__PURE__ */ n(j.Fragment, { children: p() }, "lt-channel-banner") : null,
|
|
@@ -2376,21 +2428,20 @@ const le = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2376
2428
|
"div",
|
|
2377
2429
|
{
|
|
2378
2430
|
className: "flex-1 overflow-hidden relative",
|
|
2379
|
-
children: /* @__PURE__ */ n(
|
|
2431
|
+
children: /* @__PURE__ */ n(us, { hideDeletedMessages: !0, hideNewMessageSeparator: !1 })
|
|
2380
2432
|
},
|
|
2381
2433
|
"lt-channel-message-list"
|
|
2382
2434
|
),
|
|
2383
|
-
r ? /* @__PURE__ */ n(j.Fragment, { children: r(
|
|
2435
|
+
r ? /* @__PURE__ */ n(j.Fragment, { children: r(E) }, "lt-channel-conversation-footer") : null,
|
|
2384
2436
|
/* @__PURE__ */ n(
|
|
2385
|
-
|
|
2437
|
+
$a,
|
|
2386
2438
|
{
|
|
2387
2439
|
...s && {
|
|
2388
|
-
renderActions: () => s == null ? void 0 : s(
|
|
2440
|
+
renderActions: () => s == null ? void 0 : s(E)
|
|
2389
2441
|
},
|
|
2390
|
-
renderFooter: () => a == null ? void 0 : a(
|
|
2442
|
+
renderFooter: () => a == null ? void 0 : a(E),
|
|
2391
2443
|
disabled: c,
|
|
2392
|
-
disabledReason: b
|
|
2393
|
-
composerInput: L
|
|
2444
|
+
disabledReason: b
|
|
2394
2445
|
},
|
|
2395
2446
|
"lt-channel-message-input"
|
|
2396
2447
|
)
|
|
@@ -2408,86 +2459,85 @@ const le = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2408
2459
|
onLeaveConversation: l,
|
|
2409
2460
|
onBlockParticipant: o,
|
|
2410
2461
|
className: d,
|
|
2411
|
-
CustomChannelEmptyState: m =
|
|
2462
|
+
CustomChannelEmptyState: m = Ja,
|
|
2412
2463
|
showDeleteConversation: g = !0,
|
|
2413
2464
|
onDeleteConversationClick: u,
|
|
2414
2465
|
onBlockParticipantClick: f,
|
|
2415
2466
|
onReportParticipantClick: c,
|
|
2416
2467
|
showBlockParticipant: b = !0,
|
|
2417
|
-
showReportParticipant:
|
|
2418
|
-
composerDisabled:
|
|
2468
|
+
showReportParticipant: N = !0,
|
|
2469
|
+
composerDisabled: x = !1,
|
|
2419
2470
|
composerDisabledReason: p,
|
|
2420
|
-
dmAgentEnabled:
|
|
2471
|
+
dmAgentEnabled: v,
|
|
2421
2472
|
messageMetadata: A,
|
|
2422
|
-
onMessageSent:
|
|
2423
|
-
showStarButton:
|
|
2424
|
-
chatbotVotingEnabled:
|
|
2425
|
-
renderChannelBanner:
|
|
2426
|
-
renderHeaderTitleBadges:
|
|
2427
|
-
customChannelActions:
|
|
2428
|
-
renderChannelActions:
|
|
2429
|
-
renderMessage:
|
|
2430
|
-
onMessageLinkClick:
|
|
2431
|
-
sendButton:
|
|
2432
|
-
attachmentPreviewList:
|
|
2433
|
-
viewerLanguage:
|
|
2434
|
-
showChannelInfo:
|
|
2435
|
-
onParticipantNameClick:
|
|
2436
|
-
composerInput: H
|
|
2473
|
+
onMessageSent: R,
|
|
2474
|
+
showStarButton: _ = !1,
|
|
2475
|
+
chatbotVotingEnabled: M = !1,
|
|
2476
|
+
renderChannelBanner: z,
|
|
2477
|
+
renderHeaderTitleBadges: O,
|
|
2478
|
+
customChannelActions: S,
|
|
2479
|
+
renderChannelActions: E,
|
|
2480
|
+
renderMessage: L,
|
|
2481
|
+
onMessageLinkClick: D,
|
|
2482
|
+
sendButton: C,
|
|
2483
|
+
attachmentPreviewList: I,
|
|
2484
|
+
viewerLanguage: T,
|
|
2485
|
+
showChannelInfo: P = !0,
|
|
2486
|
+
onParticipantNameClick: F
|
|
2437
2487
|
}) => {
|
|
2438
|
-
const
|
|
2439
|
-
async (
|
|
2440
|
-
var
|
|
2441
|
-
const
|
|
2442
|
-
...
|
|
2443
|
-
...
|
|
2488
|
+
const Y = K(
|
|
2489
|
+
async (J, U, w) => {
|
|
2490
|
+
var W;
|
|
2491
|
+
const k = ((W = e.data) == null ? void 0 : W.chatbot_paused) === !0, B = v && !k, q = {
|
|
2492
|
+
...U,
|
|
2493
|
+
...B && { silent: !0 },
|
|
2444
2494
|
...A && {
|
|
2445
2495
|
metadata: {
|
|
2446
|
-
...
|
|
2496
|
+
...U.metadata ?? {},
|
|
2447
2497
|
...A
|
|
2448
2498
|
}
|
|
2449
2499
|
}
|
|
2450
|
-
},
|
|
2451
|
-
...
|
|
2452
|
-
...
|
|
2453
|
-
},
|
|
2454
|
-
return
|
|
2500
|
+
}, H = {
|
|
2501
|
+
...w,
|
|
2502
|
+
...B && { skip_push: !0 }
|
|
2503
|
+
}, V = await e.sendMessage(q, H);
|
|
2504
|
+
return R == null || R(V), V;
|
|
2455
2505
|
},
|
|
2456
|
-
[e,
|
|
2457
|
-
),
|
|
2458
|
-
return
|
|
2459
|
-
if (!
|
|
2460
|
-
const
|
|
2461
|
-
if (!
|
|
2462
|
-
const
|
|
2463
|
-
const
|
|
2506
|
+
[e, v, A, R]
|
|
2507
|
+
), Z = G(null);
|
|
2508
|
+
return X(() => {
|
|
2509
|
+
if (!D) return;
|
|
2510
|
+
const J = Z.current;
|
|
2511
|
+
if (!J) return;
|
|
2512
|
+
const U = (w) => {
|
|
2513
|
+
const k = w.target, B = k == null ? void 0 : k.closest("a[href]"), q = B == null ? void 0 : B.getAttribute("href");
|
|
2464
2514
|
if (!q) return;
|
|
2465
|
-
const
|
|
2466
|
-
|
|
2515
|
+
const H = B == null ? void 0 : B.closest("[data-message-id]"), V = H == null ? void 0 : H.getAttribute("data-message-id"), W = V ? e.state.messages.find((de) => de.id === V) : void 0;
|
|
2516
|
+
D(q, W);
|
|
2467
2517
|
};
|
|
2468
|
-
return
|
|
2469
|
-
}, [
|
|
2518
|
+
return J.addEventListener("click", U), () => J.removeEventListener("click", U);
|
|
2519
|
+
}, [D, e]), /* @__PURE__ */ n(
|
|
2470
2520
|
"div",
|
|
2471
2521
|
{
|
|
2472
|
-
ref:
|
|
2522
|
+
ref: Z,
|
|
2473
2523
|
className: y(
|
|
2474
2524
|
"messaging-channel-view h-full flex flex-col",
|
|
2475
2525
|
d
|
|
2476
2526
|
),
|
|
2477
|
-
children: /* @__PURE__ */ n(un.Provider, { value:
|
|
2527
|
+
children: /* @__PURE__ */ n(un.Provider, { value: v ?? !1, children: /* @__PURE__ */ n(
|
|
2478
2528
|
os,
|
|
2479
2529
|
{
|
|
2480
2530
|
channel: e,
|
|
2481
|
-
MessageSystem:
|
|
2531
|
+
MessageSystem: qa,
|
|
2482
2532
|
EmptyStateIndicator: m,
|
|
2483
2533
|
LoadingIndicator: Te,
|
|
2484
|
-
DateSeparator:
|
|
2485
|
-
TypingIndicator:
|
|
2486
|
-
doSendMessageRequest:
|
|
2487
|
-
...
|
|
2488
|
-
...
|
|
2534
|
+
DateSeparator: Hs,
|
|
2535
|
+
TypingIndicator: Xa,
|
|
2536
|
+
doSendMessageRequest: Y,
|
|
2537
|
+
...C ? { SendButton: C } : {},
|
|
2538
|
+
...I ? { AttachmentPreviewList: I } : {},
|
|
2489
2539
|
children: /* @__PURE__ */ n(
|
|
2490
|
-
|
|
2540
|
+
er,
|
|
2491
2541
|
{
|
|
2492
2542
|
onBack: t,
|
|
2493
2543
|
showBackButton: s,
|
|
@@ -2502,21 +2552,20 @@ const le = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2502
2552
|
onBlockParticipantClick: f,
|
|
2503
2553
|
onReportParticipantClick: c,
|
|
2504
2554
|
showBlockParticipant: b,
|
|
2505
|
-
showReportParticipant:
|
|
2506
|
-
composerDisabled:
|
|
2555
|
+
showReportParticipant: N,
|
|
2556
|
+
composerDisabled: x,
|
|
2507
2557
|
composerDisabledReason: p,
|
|
2508
|
-
showStarButton:
|
|
2509
|
-
dmAgentEnabled:
|
|
2510
|
-
chatbotVotingEnabled:
|
|
2511
|
-
renderChannelBanner:
|
|
2512
|
-
renderHeaderTitleBadges:
|
|
2513
|
-
customChannelActions:
|
|
2514
|
-
renderChannelActions:
|
|
2515
|
-
renderMessage:
|
|
2516
|
-
viewerLanguage:
|
|
2517
|
-
showChannelInfo:
|
|
2518
|
-
onParticipantNameClick:
|
|
2519
|
-
composerInput: H
|
|
2558
|
+
showStarButton: _,
|
|
2559
|
+
dmAgentEnabled: v,
|
|
2560
|
+
chatbotVotingEnabled: M,
|
|
2561
|
+
renderChannelBanner: z,
|
|
2562
|
+
renderHeaderTitleBadges: O,
|
|
2563
|
+
customChannelActions: S,
|
|
2564
|
+
renderChannelActions: E,
|
|
2565
|
+
renderMessage: L,
|
|
2566
|
+
viewerLanguage: T,
|
|
2567
|
+
showChannelInfo: P,
|
|
2568
|
+
onParticipantNameClick: F
|
|
2520
2569
|
}
|
|
2521
2570
|
)
|
|
2522
2571
|
}
|
|
@@ -2541,7 +2590,7 @@ const pe = j.memo(({ message: e, onBack: t }) => /* @__PURE__ */ n("div", { clas
|
|
|
2541
2590
|
)
|
|
2542
2591
|
] }) }));
|
|
2543
2592
|
pe.displayName = "ErrorState";
|
|
2544
|
-
const
|
|
2593
|
+
const Si = ({
|
|
2545
2594
|
capabilities: e = {},
|
|
2546
2595
|
renderMessageInputActions: t,
|
|
2547
2596
|
renderConversationFooter: s,
|
|
@@ -2557,117 +2606,116 @@ const Ei = ({
|
|
|
2557
2606
|
chatbotVotingEnabled: f = !1,
|
|
2558
2607
|
viewerLanguage: c,
|
|
2559
2608
|
renderHeaderTitleBadges: b,
|
|
2560
|
-
renderChannelBanner:
|
|
2561
|
-
customChannelActions:
|
|
2609
|
+
renderChannelBanner: N,
|
|
2610
|
+
customChannelActions: x,
|
|
2562
2611
|
renderChannelActions: p,
|
|
2563
|
-
onParticipantNameClick:
|
|
2612
|
+
onParticipantNameClick: v,
|
|
2564
2613
|
renderMessage: A,
|
|
2565
|
-
onMessageLinkClick:
|
|
2566
|
-
showChannelInfo:
|
|
2567
|
-
composerInput: R
|
|
2614
|
+
onMessageLinkClick: R,
|
|
2615
|
+
showChannelInfo: _
|
|
2568
2616
|
}) => {
|
|
2569
2617
|
const {
|
|
2570
|
-
client:
|
|
2571
|
-
isConnected:
|
|
2572
|
-
isLoading:
|
|
2573
|
-
error:
|
|
2574
|
-
refreshConnection:
|
|
2575
|
-
service:
|
|
2576
|
-
debug:
|
|
2577
|
-
} =
|
|
2578
|
-
|
|
2579
|
-
const
|
|
2580
|
-
|
|
2581
|
-
const
|
|
2582
|
-
|
|
2583
|
-
|
|
2584
|
-
}, [
|
|
2585
|
-
if (!
|
|
2586
|
-
const
|
|
2587
|
-
if (!
|
|
2588
|
-
const
|
|
2589
|
-
if (
|
|
2590
|
-
|
|
2591
|
-
const
|
|
2592
|
-
|
|
2618
|
+
client: M,
|
|
2619
|
+
isConnected: z,
|
|
2620
|
+
isLoading: O,
|
|
2621
|
+
error: S,
|
|
2622
|
+
refreshConnection: E,
|
|
2623
|
+
service: L,
|
|
2624
|
+
debug: D
|
|
2625
|
+
} = $s(), [C, I] = $(null), [T, P] = $(null), [F, Y] = $(!1), { showDeleteConversation: Z = !0 } = e, J = G(l);
|
|
2626
|
+
J.current = l;
|
|
2627
|
+
const U = G(a);
|
|
2628
|
+
U.current = a;
|
|
2629
|
+
const w = G(null), k = G(null);
|
|
2630
|
+
X(() => {
|
|
2631
|
+
k.current = C;
|
|
2632
|
+
}, [C]), X(() => {
|
|
2633
|
+
if (!M || !z) return;
|
|
2634
|
+
const H = M.userID;
|
|
2635
|
+
if (!H) return;
|
|
2636
|
+
const V = `${H}::${i}`;
|
|
2637
|
+
if (w.current === V) return;
|
|
2638
|
+
w.current = V;
|
|
2639
|
+
const W = () => {
|
|
2640
|
+
w.current === V && (w.current = null);
|
|
2593
2641
|
};
|
|
2594
2642
|
(async () => {
|
|
2595
|
-
var
|
|
2643
|
+
var ue, me;
|
|
2596
2644
|
try {
|
|
2597
|
-
|
|
2645
|
+
D && console.log(
|
|
2598
2646
|
"[MessagingShell] Loading initial conversation with:",
|
|
2599
2647
|
i
|
|
2600
2648
|
);
|
|
2601
|
-
const
|
|
2649
|
+
const te = await M.queryChannels(
|
|
2602
2650
|
{
|
|
2603
2651
|
type: "messaging",
|
|
2604
|
-
members: { $eq: [
|
|
2652
|
+
members: { $eq: [H, i] }
|
|
2605
2653
|
},
|
|
2606
2654
|
{},
|
|
2607
2655
|
{ limit: 1 }
|
|
2608
2656
|
);
|
|
2609
|
-
if (
|
|
2610
|
-
|
|
2657
|
+
if (te.length > 0) {
|
|
2658
|
+
I(te[0]), P(null), (ue = U.current) == null || ue.call(U, te[0]), D && console.log(
|
|
2611
2659
|
"[MessagingShell] Initial conversation loaded:",
|
|
2612
|
-
|
|
2660
|
+
te[0].id
|
|
2613
2661
|
);
|
|
2614
2662
|
return;
|
|
2615
2663
|
}
|
|
2616
|
-
const
|
|
2617
|
-
if (!
|
|
2618
|
-
|
|
2664
|
+
const Q = J.current;
|
|
2665
|
+
if (!Q || !L) {
|
|
2666
|
+
W(), P("No conversation found with this account"), D && console.log(
|
|
2619
2667
|
"[MessagingShell] No conversation found for:",
|
|
2620
2668
|
i
|
|
2621
2669
|
);
|
|
2622
2670
|
return;
|
|
2623
2671
|
}
|
|
2624
2672
|
try {
|
|
2625
|
-
const
|
|
2626
|
-
id:
|
|
2627
|
-
name:
|
|
2628
|
-
phone:
|
|
2673
|
+
const ee = await L.startChannelWithParticipant({
|
|
2674
|
+
id: Q.id,
|
|
2675
|
+
name: Q.name,
|
|
2676
|
+
phone: Q.phone
|
|
2629
2677
|
});
|
|
2630
|
-
|
|
2678
|
+
I(ee), P(null), (me = U.current) == null || me.call(U, ee), D && console.log(
|
|
2631
2679
|
"[MessagingShell] Channel created and loaded:",
|
|
2632
|
-
|
|
2680
|
+
ee.id
|
|
2633
2681
|
);
|
|
2634
|
-
} catch (
|
|
2682
|
+
} catch (ee) {
|
|
2635
2683
|
console.error(
|
|
2636
2684
|
"[MessagingShell] Failed to create conversation:",
|
|
2637
|
-
|
|
2638
|
-
),
|
|
2685
|
+
ee
|
|
2686
|
+
), W(), P("Failed to create conversation");
|
|
2639
2687
|
}
|
|
2640
|
-
} catch (
|
|
2688
|
+
} catch (te) {
|
|
2641
2689
|
console.error(
|
|
2642
2690
|
"[MessagingShell] Failed to load initial conversation:",
|
|
2643
|
-
|
|
2644
|
-
),
|
|
2691
|
+
te
|
|
2692
|
+
), W(), k.current || P("Failed to load conversation");
|
|
2645
2693
|
}
|
|
2646
2694
|
})();
|
|
2647
|
-
}, [i,
|
|
2648
|
-
const
|
|
2649
|
-
|
|
2650
|
-
const q =
|
|
2651
|
-
var
|
|
2652
|
-
|
|
2695
|
+
}, [i, M, z, L, D]);
|
|
2696
|
+
const B = G(r);
|
|
2697
|
+
B.current = r;
|
|
2698
|
+
const q = K(() => {
|
|
2699
|
+
var H;
|
|
2700
|
+
I(null), Y(!0), (H = B.current) == null || H.call(B);
|
|
2653
2701
|
}, []);
|
|
2654
|
-
return
|
|
2702
|
+
return O ? /* @__PURE__ */ n(Te, {}) : S ? /* @__PURE__ */ n(pe, { message: S, onBack: E }) : !z || !M ? /* @__PURE__ */ n(
|
|
2655
2703
|
pe,
|
|
2656
2704
|
{
|
|
2657
2705
|
message: "Not connected to messaging service",
|
|
2658
|
-
onBack:
|
|
2706
|
+
onBack: E
|
|
2659
2707
|
}
|
|
2660
|
-
) :
|
|
2708
|
+
) : T ? /* @__PURE__ */ n(pe, { message: T }) : F && !C ? /* @__PURE__ */ n(pe, { message: "Conversation ended" }) : C ? /* @__PURE__ */ n("div", { className: "messaging-shell h-full bg-background-primary overflow-hidden", children: /* @__PURE__ */ n("div", { className: "flex h-full min-h-0 flex-col", children: /* @__PURE__ */ n(
|
|
2661
2709
|
mn,
|
|
2662
2710
|
{
|
|
2663
|
-
channel:
|
|
2711
|
+
channel: C,
|
|
2664
2712
|
renderMessageInputActions: t,
|
|
2665
2713
|
renderConversationFooter: s,
|
|
2666
|
-
renderChannelBanner:
|
|
2714
|
+
renderChannelBanner: N,
|
|
2667
2715
|
onLeaveConversation: q,
|
|
2668
2716
|
onBlockParticipant: q,
|
|
2669
2717
|
CustomChannelEmptyState: o,
|
|
2670
|
-
showDeleteConversation:
|
|
2718
|
+
showDeleteConversation: Z,
|
|
2671
2719
|
onBlockParticipantClick: d,
|
|
2672
2720
|
onReportParticipantClick: m,
|
|
2673
2721
|
dmAgentEnabled: g,
|
|
@@ -2675,18 +2723,17 @@ const Ei = ({
|
|
|
2675
2723
|
chatbotVotingEnabled: f,
|
|
2676
2724
|
viewerLanguage: c,
|
|
2677
2725
|
renderHeaderTitleBadges: b,
|
|
2678
|
-
customChannelActions:
|
|
2726
|
+
customChannelActions: x,
|
|
2679
2727
|
renderChannelActions: p,
|
|
2680
|
-
onParticipantNameClick:
|
|
2728
|
+
onParticipantNameClick: v,
|
|
2681
2729
|
renderMessage: A,
|
|
2682
|
-
onMessageLinkClick:
|
|
2683
|
-
showChannelInfo:
|
|
2684
|
-
composerInput: R
|
|
2730
|
+
onMessageLinkClick: R,
|
|
2731
|
+
showChannelInfo: _
|
|
2685
2732
|
},
|
|
2686
|
-
|
|
2733
|
+
C.id
|
|
2687
2734
|
) }) }) : /* @__PURE__ */ n(Te, {});
|
|
2688
2735
|
};
|
|
2689
|
-
function
|
|
2736
|
+
function tr(e) {
|
|
2690
2737
|
const t = e.state.pending_messages;
|
|
2691
2738
|
if (t != null && t.length)
|
|
2692
2739
|
for (const s of t)
|
|
@@ -2699,18 +2746,18 @@ const hn = j.createContext({
|
|
|
2699
2746
|
debug: !1,
|
|
2700
2747
|
renderMessagePreview: void 0,
|
|
2701
2748
|
viewerLanguage: void 0
|
|
2702
|
-
}),
|
|
2749
|
+
}), nr = hn.Provider, sr = () => j.useContext(hn), ar = (e, t) => {
|
|
2703
2750
|
const s = new Date(
|
|
2704
2751
|
Date.UTC(e.getUTCFullYear(), e.getUTCMonth(), e.getUTCDate())
|
|
2705
2752
|
), r = new Date(
|
|
2706
2753
|
Date.UTC(t.getUTCFullYear(), t.getUTCMonth(), t.getUTCDate())
|
|
2707
2754
|
).getTime() - s.getTime();
|
|
2708
2755
|
return Math.floor(r / (1e3 * 60 * 60 * 24));
|
|
2709
|
-
},
|
|
2756
|
+
}, rr = (e) => {
|
|
2710
2757
|
const t = /* @__PURE__ */ new Date();
|
|
2711
2758
|
if (Math.floor((t.getTime() - e.getTime()) / 1e3) < 60)
|
|
2712
2759
|
return "Just now";
|
|
2713
|
-
const a =
|
|
2760
|
+
const a = ar(e, t);
|
|
2714
2761
|
return a === 0 ? e.toLocaleTimeString([], {
|
|
2715
2762
|
hour: "numeric",
|
|
2716
2763
|
minute: "2-digit",
|
|
@@ -2722,48 +2769,48 @@ const hn = j.createContext({
|
|
|
2722
2769
|
});
|
|
2723
2770
|
}, fn = j.memo(
|
|
2724
2771
|
({ channel: e, unread: t }) => {
|
|
2725
|
-
var
|
|
2772
|
+
var M, z, O;
|
|
2726
2773
|
const {
|
|
2727
2774
|
selectedChannel: s,
|
|
2728
2775
|
onChannelSelect: a,
|
|
2729
2776
|
debug: r,
|
|
2730
2777
|
renderMessagePreview: i,
|
|
2731
2778
|
viewerLanguage: l
|
|
2732
|
-
} =
|
|
2779
|
+
} = sr(), o = (s == null ? void 0 : s.id) === (e == null ? void 0 : e.id), d = () => {
|
|
2733
2780
|
e && a(e);
|
|
2734
|
-
}, m = (
|
|
2735
|
-
const
|
|
2736
|
-
!
|
|
2737
|
-
}, u = Object.values(((
|
|
2738
|
-
(
|
|
2739
|
-
var
|
|
2740
|
-
return ((
|
|
2781
|
+
}, m = (S) => {
|
|
2782
|
+
const E = S.key === "Enter" || S.key === " ", L = S.repeat;
|
|
2783
|
+
!E || L || (S.preventDefault(), d());
|
|
2784
|
+
}, u = Object.values(((M = e == null ? void 0 : e.state) == null ? void 0 : M.members) || {}).find(
|
|
2785
|
+
(S) => {
|
|
2786
|
+
var E, L;
|
|
2787
|
+
return ((E = S.user) == null ? void 0 : E.id) && S.user.id !== ((L = e == null ? void 0 : e._client) == null ? void 0 : L.userID);
|
|
2741
2788
|
}
|
|
2742
|
-
), f =
|
|
2743
|
-
var
|
|
2744
|
-
const
|
|
2745
|
-
if (
|
|
2746
|
-
for (let
|
|
2747
|
-
if (
|
|
2789
|
+
), f = Kt(u == null ? void 0 : u.user), c = (z = u == null ? void 0 : u.user) == null ? void 0 : z.image, b = (() => {
|
|
2790
|
+
var E;
|
|
2791
|
+
const S = (E = e == null ? void 0 : e.state) == null ? void 0 : E.messages;
|
|
2792
|
+
if (S != null && S.length) {
|
|
2793
|
+
for (let L = S.length - 1; L >= 0; L--)
|
|
2794
|
+
if (S[L].type !== "system") return S[L];
|
|
2748
2795
|
}
|
|
2749
|
-
})(),
|
|
2750
|
-
var
|
|
2751
|
-
const
|
|
2796
|
+
})(), x = (() => {
|
|
2797
|
+
var I, T, P, F;
|
|
2798
|
+
const S = Jt({
|
|
2752
2799
|
message: b,
|
|
2753
2800
|
viewerLanguage: l
|
|
2754
2801
|
});
|
|
2755
|
-
if (((
|
|
2756
|
-
if (((
|
|
2757
|
-
if (((
|
|
2758
|
-
if (
|
|
2759
|
-
const
|
|
2760
|
-
return
|
|
2761
|
-
})(), p = b != null && b.created_at ?
|
|
2802
|
+
if (((I = b == null ? void 0 : b.metadata) == null ? void 0 : I.custom_type) === "MESSAGE_TIP") return S ? `💵 ${S}` : "💵 Sent a tip";
|
|
2803
|
+
if (((T = b == null ? void 0 : b.metadata) == null ? void 0 : T.custom_type) === "MESSAGE_PAID") return S ? `💰 ${S}` : "💰 Sent a message";
|
|
2804
|
+
if (((P = b == null ? void 0 : b.metadata) == null ? void 0 : P.custom_type) === "MESSAGE_ATTACHMENT") return S ? `📎 ${S}` : "📎 Sent an attachment";
|
|
2805
|
+
if (S) return S;
|
|
2806
|
+
const C = (F = b == null ? void 0 : b.attachments) == null ? void 0 : F[0];
|
|
2807
|
+
return C ? C.og_scrape_url ? C.og_scrape_url : C.type === "image" ? "📷 Sent an image" : C.type === "video" ? "🎥 Sent a video" : C.type === "audio" ? "🎵 Sent audio" : C.type === "file" ? "📎 Sent a file" : "📎 Sent an attachment" : "No messages yet";
|
|
2808
|
+
})(), p = b != null && b.created_at ? rr(new Date(b.created_at)) : "", v = b ? Ie(b) : !1, A = i ? i(b, x) : `${v ? "✨ " : ""}${x}`, R = Xt(e), _ = t ?? 0;
|
|
2762
2809
|
return r && console.log("📺 [ChannelList] 📋 CHANNEL PREVIEW RENDER", {
|
|
2763
2810
|
channelId: e == null ? void 0 : e.id,
|
|
2764
2811
|
isSelected: o,
|
|
2765
2812
|
participantName: f,
|
|
2766
|
-
unreadCount:
|
|
2813
|
+
unreadCount: _,
|
|
2767
2814
|
hasTimestamp: !!p
|
|
2768
2815
|
}), /* @__PURE__ */ n(
|
|
2769
2816
|
"div",
|
|
@@ -2781,34 +2828,31 @@ const hn = j.createContext({
|
|
|
2781
2828
|
),
|
|
2782
2829
|
children: /* @__PURE__ */ h("div", { className: "flex items-start gap-4", children: [
|
|
2783
2830
|
/* @__PURE__ */ n(
|
|
2784
|
-
|
|
2831
|
+
ie,
|
|
2785
2832
|
{
|
|
2786
|
-
id: ((
|
|
2833
|
+
id: ((O = u == null ? void 0 : u.user) == null ? void 0 : O.id) || e.id || "unknown",
|
|
2787
2834
|
name: f,
|
|
2788
2835
|
image: c,
|
|
2789
|
-
size: 48
|
|
2790
|
-
starred: M
|
|
2836
|
+
size: 48
|
|
2791
2837
|
}
|
|
2792
2838
|
),
|
|
2793
2839
|
/* @__PURE__ */ h("div", { className: "flex-1 min-w-0 flex flex-col gap-1", children: [
|
|
2794
2840
|
/* @__PURE__ */ h("div", { className: "flex items-center justify-between gap-2", children: [
|
|
2795
|
-
/* @__PURE__ */ h(
|
|
2796
|
-
"
|
|
2797
|
-
|
|
2798
|
-
|
|
2799
|
-
|
|
2800
|
-
|
|
2801
|
-
|
|
2802
|
-
|
|
2803
|
-
|
|
2804
|
-
|
|
2805
|
-
}
|
|
2806
|
-
),
|
|
2841
|
+
/* @__PURE__ */ h("h3", { className: "flex min-w-0 items-center gap-1 text-sm font-medium text-[#191918]", children: [
|
|
2842
|
+
/* @__PURE__ */ n("span", { className: "min-w-0 truncate", children: f }),
|
|
2843
|
+
/* @__PURE__ */ n(
|
|
2844
|
+
be,
|
|
2845
|
+
{
|
|
2846
|
+
participant: u,
|
|
2847
|
+
isStarred: R
|
|
2848
|
+
}
|
|
2849
|
+
)
|
|
2850
|
+
] }),
|
|
2807
2851
|
p && /* @__PURE__ */ n("span", { className: "text-xs text-[#717070] flex-shrink-0", children: p })
|
|
2808
2852
|
] }),
|
|
2809
2853
|
/* @__PURE__ */ h("div", { className: "flex items-center justify-between gap-2 min-w-0", children: [
|
|
2810
2854
|
/* @__PURE__ */ n("p", { className: "text-sm text-[#717070] flex-1 line-clamp-1", children: A }),
|
|
2811
|
-
|
|
2855
|
+
_ > 0 && /* @__PURE__ */ n("span", { className: "bg-[#7f22fe] text-white text-[10px] rounded-full h-4 flex items-center justify-center p-1 min-w-4 text-center flex-shrink-0", children: _ > 99 ? "99+" : _ })
|
|
2812
2856
|
] })
|
|
2813
2857
|
] })
|
|
2814
2858
|
] })
|
|
@@ -2817,14 +2861,14 @@ const hn = j.createContext({
|
|
|
2817
2861
|
}
|
|
2818
2862
|
);
|
|
2819
2863
|
fn.displayName = "CustomChannelPreview";
|
|
2820
|
-
const
|
|
2864
|
+
const ir = { last_message_at: -1 }, lr = j.memo(
|
|
2821
2865
|
({
|
|
2822
2866
|
onChannelSelect: e,
|
|
2823
2867
|
selectedChannel: t,
|
|
2824
2868
|
filters: s,
|
|
2825
2869
|
allowNewMessagesFromUnfilteredChannels: a = !1,
|
|
2826
2870
|
channelRenderFilterFn: r,
|
|
2827
|
-
sort: i =
|
|
2871
|
+
sort: i = ir,
|
|
2828
2872
|
className: l,
|
|
2829
2873
|
customEmptyStateIndicator: o,
|
|
2830
2874
|
renderMessagePreview: d,
|
|
@@ -2834,8 +2878,8 @@ const ar = { last_message_at: -1 }, rr = j.memo(
|
|
|
2834
2878
|
g.current++;
|
|
2835
2879
|
const { debug: u = !1 } = Ke(), f = j.useCallback(
|
|
2836
2880
|
(b) => {
|
|
2837
|
-
for (const
|
|
2838
|
-
|
|
2881
|
+
for (const N of b)
|
|
2882
|
+
tr(N);
|
|
2839
2883
|
return r ? r(b) : b;
|
|
2840
2884
|
},
|
|
2841
2885
|
[r]
|
|
@@ -2868,15 +2912,15 @@ const ar = { last_message_at: -1 }, rr = j.memo(
|
|
|
2868
2912
|
"messaging-channel-list h-full flex flex-col min-w-0 overflow-hidden",
|
|
2869
2913
|
l
|
|
2870
2914
|
),
|
|
2871
|
-
children: /* @__PURE__ */ n("div", { className: "flex-1 overflow-hidden min-w-0", children: /* @__PURE__ */ n(
|
|
2872
|
-
|
|
2915
|
+
children: /* @__PURE__ */ n("div", { className: "flex-1 overflow-hidden min-w-0", children: /* @__PURE__ */ n(nr, { value: c, children: /* @__PURE__ */ n(
|
|
2916
|
+
ms,
|
|
2873
2917
|
{
|
|
2874
2918
|
filters: s,
|
|
2875
2919
|
sort: i,
|
|
2876
2920
|
options: { limit: 30 },
|
|
2877
2921
|
allowNewMessagesFromUnfilteredChannels: a,
|
|
2878
2922
|
channelRenderFilterFn: f,
|
|
2879
|
-
Paginator:
|
|
2923
|
+
Paginator: hs,
|
|
2880
2924
|
Preview: fn,
|
|
2881
2925
|
EmptyStateIndicator: o
|
|
2882
2926
|
},
|
|
@@ -2886,27 +2930,27 @@ const ar = { last_message_at: -1 }, rr = j.memo(
|
|
|
2886
2930
|
);
|
|
2887
2931
|
}
|
|
2888
2932
|
);
|
|
2889
|
-
|
|
2890
|
-
const
|
|
2891
|
-
function
|
|
2933
|
+
lr.displayName = "ChannelList";
|
|
2934
|
+
const or = /^([a-z][a-z0-9+.-]*):/i, cr = /* @__PURE__ */ new Set(["http", "https", "mailto", "tel", "sms"]);
|
|
2935
|
+
function nt(e) {
|
|
2892
2936
|
if (typeof e != "string") return;
|
|
2893
2937
|
const t = e.trim();
|
|
2894
2938
|
if (t === "") return;
|
|
2895
|
-
const s =
|
|
2939
|
+
const s = or.exec(t);
|
|
2896
2940
|
if (s) {
|
|
2897
2941
|
const a = s[1].toLowerCase();
|
|
2898
|
-
return
|
|
2942
|
+
return cr.has(a) ? t : void 0;
|
|
2899
2943
|
}
|
|
2900
2944
|
return t.startsWith("//") || t.startsWith("/") ? t : `https://${t}`;
|
|
2901
2945
|
}
|
|
2902
|
-
const
|
|
2946
|
+
const dr = {
|
|
2903
2947
|
dark: "bg-white text-[#121110] hover:bg-white/90",
|
|
2904
2948
|
light: "bg-[#121110] text-white hover:bg-[#2a2928]"
|
|
2905
|
-
},
|
|
2949
|
+
}, ur = ({ variant: e, cta: t }) => {
|
|
2906
2950
|
const s = y(
|
|
2907
2951
|
"mt-2 inline-flex h-10 w-full items-center justify-center rounded-full px-4 text-sm font-medium leading-none transition-colors",
|
|
2908
|
-
|
|
2909
|
-
), a =
|
|
2952
|
+
dr[e]
|
|
2953
|
+
), a = nt(t.href);
|
|
2910
2954
|
return a ? /* @__PURE__ */ n(
|
|
2911
2955
|
"a",
|
|
2912
2956
|
{
|
|
@@ -2932,13 +2976,13 @@ const lr = {
|
|
|
2932
2976
|
children: t.label
|
|
2933
2977
|
}
|
|
2934
2978
|
);
|
|
2935
|
-
},
|
|
2979
|
+
}, mr = {
|
|
2936
2980
|
dark: "text-white",
|
|
2937
2981
|
light: "text-black/90"
|
|
2938
|
-
},
|
|
2982
|
+
}, hr = "text-white/30", fr = {
|
|
2939
2983
|
dark: "text-white/55",
|
|
2940
2984
|
light: "text-black/55"
|
|
2941
|
-
},
|
|
2985
|
+
}, st = ({
|
|
2942
2986
|
variant: e,
|
|
2943
2987
|
title: t,
|
|
2944
2988
|
placeholderTitle: s,
|
|
@@ -2950,12 +2994,12 @@ const lr = {
|
|
|
2950
2994
|
}) => {
|
|
2951
2995
|
const d = e === "dark", m = t ?? (d ? s : void 0) ?? "", g = m.trim() !== "", u = a != null && a.trim() !== "", f = typeof r == "string" ? r.trim() : "", c = f !== "", b = l != null;
|
|
2952
2996
|
if (!g && !u && !c && !b) return null;
|
|
2953
|
-
const
|
|
2997
|
+
const x = y(
|
|
2954
2998
|
"truncate text-base font-medium leading-6",
|
|
2955
|
-
d && !t ?
|
|
2999
|
+
d && !t ? hr : mr[e]
|
|
2956
3000
|
), p = y(
|
|
2957
3001
|
"truncate text-xs leading-4",
|
|
2958
|
-
|
|
3002
|
+
fr[e]
|
|
2959
3003
|
);
|
|
2960
3004
|
return /* @__PURE__ */ h("div", { className: "px-4 py-3", children: [
|
|
2961
3005
|
/* @__PURE__ */ h("div", { className: "flex items-end gap-3", children: [
|
|
@@ -2963,7 +3007,7 @@ const lr = {
|
|
|
2963
3007
|
/* @__PURE__ */ h("div", { className: "flex min-w-0 flex-col gap-1", children: [
|
|
2964
3008
|
g && /* @__PURE__ */ h("div", { className: "flex min-w-0 items-center gap-2", children: [
|
|
2965
3009
|
i ? /* @__PURE__ */ n("span", { className: "shrink-0", children: i }) : null,
|
|
2966
|
-
/* @__PURE__ */ n("p", { className: y("min-w-0",
|
|
3010
|
+
/* @__PURE__ */ n("p", { className: y("min-w-0", x), children: m })
|
|
2967
3011
|
] }),
|
|
2968
3012
|
u && /* @__PURE__ */ n("p", { className: p, children: a })
|
|
2969
3013
|
] }),
|
|
@@ -2971,9 +3015,9 @@ const lr = {
|
|
|
2971
3015
|
] }),
|
|
2972
3016
|
o && /* @__PURE__ */ n("div", { className: "shrink-0", children: o })
|
|
2973
3017
|
] }),
|
|
2974
|
-
l && /* @__PURE__ */ n(
|
|
3018
|
+
l && /* @__PURE__ */ n(ur, { variant: e, cta: l })
|
|
2975
3019
|
] });
|
|
2976
|
-
},
|
|
3020
|
+
}, gr = y(
|
|
2977
3021
|
"relative block w-[280px] select-none overflow-hidden rounded-md",
|
|
2978
3022
|
// 1px hairline border that sits flush with the card chrome — matches
|
|
2979
3023
|
// the messaging design system's "small border around link attachments"
|
|
@@ -2992,7 +3036,7 @@ const lr = {
|
|
|
2992
3036
|
"data-testid": d
|
|
2993
3037
|
}) => {
|
|
2994
3038
|
const m = s != null || a != null, g = y(
|
|
2995
|
-
|
|
3039
|
+
gr,
|
|
2996
3040
|
o ?? (e === "dark" ? "bg-[#121110]" : "bg-white"),
|
|
2997
3041
|
// `focus-ring` is a design-system utility from the component-library
|
|
2998
3042
|
// tailwind preset — outline-none + a black 2px focus-visible ring
|
|
@@ -3040,17 +3084,17 @@ const lr = {
|
|
|
3040
3084
|
]
|
|
3041
3085
|
}
|
|
3042
3086
|
);
|
|
3043
|
-
},
|
|
3087
|
+
}, br = {
|
|
3044
3088
|
dark: "bg-white/10",
|
|
3045
3089
|
light: "bg-black/5"
|
|
3046
|
-
},
|
|
3090
|
+
}, pr = {
|
|
3047
3091
|
dark: "size-16 text-white/25",
|
|
3048
3092
|
light: "size-16 text-black/25"
|
|
3049
|
-
},
|
|
3093
|
+
}, De = (e, t) => !!t && !!e && re(e) === "audio", gn = (e, t) => {
|
|
3050
3094
|
if (!t || !e) return !1;
|
|
3051
3095
|
const s = re(e);
|
|
3052
3096
|
return s === "video" || s === "audio";
|
|
3053
|
-
},
|
|
3097
|
+
}, at = "bg-[#F2F3F4]", Me = ({
|
|
3054
3098
|
variant: e,
|
|
3055
3099
|
thumbnailUrl: t,
|
|
3056
3100
|
sourceUrl: s,
|
|
@@ -3060,7 +3104,7 @@ const lr = {
|
|
|
3060
3104
|
topRight: l
|
|
3061
3105
|
}) => {
|
|
3062
3106
|
const o = re(r), d = !!s && o === "video";
|
|
3063
|
-
return
|
|
3107
|
+
return De(r, s) ? /* @__PURE__ */ n("div", { className: "p-3", children: /* @__PURE__ */ n(
|
|
3064
3108
|
"audio",
|
|
3065
3109
|
{
|
|
3066
3110
|
src: s,
|
|
@@ -3101,10 +3145,10 @@ const lr = {
|
|
|
3101
3145
|
{
|
|
3102
3146
|
className: y(
|
|
3103
3147
|
"flex h-full w-full items-center justify-center",
|
|
3104
|
-
|
|
3148
|
+
br[e]
|
|
3105
3149
|
),
|
|
3106
|
-
children:
|
|
3107
|
-
className:
|
|
3150
|
+
children: oe(r, {
|
|
3151
|
+
className: pr[e],
|
|
3108
3152
|
weight: "regular"
|
|
3109
3153
|
})
|
|
3110
3154
|
}
|
|
@@ -3114,7 +3158,7 @@ const lr = {
|
|
|
3114
3158
|
]
|
|
3115
3159
|
}
|
|
3116
3160
|
);
|
|
3117
|
-
},
|
|
3161
|
+
}, vr = ({
|
|
3118
3162
|
title: e,
|
|
3119
3163
|
placeholderTitle: t,
|
|
3120
3164
|
description: s,
|
|
@@ -3128,26 +3172,26 @@ const lr = {
|
|
|
3128
3172
|
onDismiss: g,
|
|
3129
3173
|
onEditClick: u
|
|
3130
3174
|
}) => {
|
|
3131
|
-
const f = o === "classic", c =
|
|
3175
|
+
const f = o === "classic", c = De(r, l), b = g ? /* @__PURE__ */ n(
|
|
3132
3176
|
"button",
|
|
3133
3177
|
{
|
|
3134
3178
|
type: "button",
|
|
3135
3179
|
onClick: g,
|
|
3136
3180
|
"aria-label": "Dismiss attachment",
|
|
3137
3181
|
className: "flex size-6 items-center justify-center rounded-full bg-[#121110] text-white",
|
|
3138
|
-
children: /* @__PURE__ */ n(
|
|
3182
|
+
children: /* @__PURE__ */ n(Le, { className: "size-3", weight: "bold" })
|
|
3139
3183
|
}
|
|
3140
|
-
) : void 0,
|
|
3184
|
+
) : void 0, N = u ? /* @__PURE__ */ n(
|
|
3141
3185
|
"button",
|
|
3142
3186
|
{
|
|
3143
3187
|
type: "button",
|
|
3144
3188
|
onClick: u,
|
|
3145
3189
|
"aria-label": "Edit attachment",
|
|
3146
3190
|
className: "flex size-10 items-center justify-center rounded-full bg-white/10 text-white hover:bg-white/15",
|
|
3147
|
-
children: /* @__PURE__ */ n(
|
|
3191
|
+
children: /* @__PURE__ */ n(Ps, { className: "size-5", weight: "regular" })
|
|
3148
3192
|
}
|
|
3149
3193
|
) : void 0;
|
|
3150
|
-
return c ? /* @__PURE__ */ n(Ae, { variant: "dark", bgClassName:
|
|
3194
|
+
return c ? /* @__PURE__ */ n(Ae, { variant: "dark", bgClassName: at, children: /* @__PURE__ */ h("div", { className: "flex items-center gap-2 pr-3", children: [
|
|
3151
3195
|
/* @__PURE__ */ n("div", { className: "min-w-0 flex-1", children: /* @__PURE__ */ n(
|
|
3152
3196
|
Me,
|
|
3153
3197
|
{
|
|
@@ -3176,7 +3220,7 @@ const lr = {
|
|
|
3176
3220
|
}
|
|
3177
3221
|
),
|
|
3178
3222
|
/* @__PURE__ */ n(
|
|
3179
|
-
|
|
3223
|
+
st,
|
|
3180
3224
|
{
|
|
3181
3225
|
variant: "dark",
|
|
3182
3226
|
title: e,
|
|
@@ -3185,13 +3229,13 @@ const lr = {
|
|
|
3185
3229
|
url: a,
|
|
3186
3230
|
appIcon: d,
|
|
3187
3231
|
cta: m,
|
|
3188
|
-
trailingAction:
|
|
3232
|
+
trailingAction: N
|
|
3189
3233
|
}
|
|
3190
3234
|
)
|
|
3191
3235
|
]
|
|
3192
3236
|
}
|
|
3193
3237
|
);
|
|
3194
|
-
},
|
|
3238
|
+
}, xr = ({
|
|
3195
3239
|
title: e,
|
|
3196
3240
|
description: t,
|
|
3197
3241
|
url: s,
|
|
@@ -3203,11 +3247,11 @@ const lr = {
|
|
|
3203
3247
|
cta: d,
|
|
3204
3248
|
onClick: m
|
|
3205
3249
|
}) => {
|
|
3206
|
-
const g = gn(a, i), u =
|
|
3250
|
+
const g = gn(a, i), u = nt(s), f = d == null && u != null && !g ? u : void 0, c = d == null && !g ? m : void 0, b = De(a, i) ? at : void 0, N = d && m ? {
|
|
3207
3251
|
...d,
|
|
3208
3252
|
onClick: () => {
|
|
3209
|
-
var
|
|
3210
|
-
m(), (
|
|
3253
|
+
var x;
|
|
3254
|
+
m(), (x = d.onClick) == null || x.call(d);
|
|
3211
3255
|
}
|
|
3212
3256
|
} : d;
|
|
3213
3257
|
return /* @__PURE__ */ h(
|
|
@@ -3231,20 +3275,20 @@ const lr = {
|
|
|
3231
3275
|
}
|
|
3232
3276
|
),
|
|
3233
3277
|
/* @__PURE__ */ n(
|
|
3234
|
-
|
|
3278
|
+
st,
|
|
3235
3279
|
{
|
|
3236
3280
|
variant: "light",
|
|
3237
3281
|
title: e,
|
|
3238
3282
|
description: t,
|
|
3239
3283
|
url: s,
|
|
3240
3284
|
appIcon: o,
|
|
3241
|
-
cta:
|
|
3285
|
+
cta: N
|
|
3242
3286
|
}
|
|
3243
3287
|
)
|
|
3244
3288
|
]
|
|
3245
3289
|
}
|
|
3246
3290
|
);
|
|
3247
|
-
},
|
|
3291
|
+
}, wr = ({
|
|
3248
3292
|
title: e,
|
|
3249
3293
|
placeholderTitle: t,
|
|
3250
3294
|
description: s,
|
|
@@ -3257,14 +3301,14 @@ const lr = {
|
|
|
3257
3301
|
cta: m,
|
|
3258
3302
|
onClick: g
|
|
3259
3303
|
}) => {
|
|
3260
|
-
const u = gn(r, l), f =
|
|
3304
|
+
const u = gn(r, l), f = nt(a), c = m == null && f != null && !u ? f : void 0, b = m == null && !u && c != null ? g : void 0;
|
|
3261
3305
|
return /* @__PURE__ */ h(
|
|
3262
3306
|
Ae,
|
|
3263
3307
|
{
|
|
3264
3308
|
variant: "dark",
|
|
3265
3309
|
href: c,
|
|
3266
3310
|
onClick: b,
|
|
3267
|
-
bgClassName:
|
|
3311
|
+
bgClassName: De(r, l) ? at : void 0,
|
|
3268
3312
|
children: [
|
|
3269
3313
|
o === "featured" && /* @__PURE__ */ n(
|
|
3270
3314
|
Me,
|
|
@@ -3277,7 +3321,7 @@ const lr = {
|
|
|
3277
3321
|
}
|
|
3278
3322
|
),
|
|
3279
3323
|
/* @__PURE__ */ n(
|
|
3280
|
-
|
|
3324
|
+
st,
|
|
3281
3325
|
{
|
|
3282
3326
|
variant: "dark",
|
|
3283
3327
|
title: e,
|
|
@@ -3291,20 +3335,20 @@ const lr = {
|
|
|
3291
3335
|
]
|
|
3292
3336
|
}
|
|
3293
3337
|
);
|
|
3294
|
-
},
|
|
3295
|
-
Composer:
|
|
3296
|
-
Sent:
|
|
3297
|
-
Received:
|
|
3298
|
-
},
|
|
3338
|
+
}, Ii = {
|
|
3339
|
+
Composer: vr,
|
|
3340
|
+
Sent: wr,
|
|
3341
|
+
Received: xr
|
|
3342
|
+
}, Nr = {
|
|
3299
3343
|
dark: "bg-[#121110]",
|
|
3300
3344
|
light: "bg-[#e9eaed]"
|
|
3301
|
-
},
|
|
3345
|
+
}, _r = {
|
|
3302
3346
|
dark: "text-white",
|
|
3303
3347
|
light: "text-[#080707]"
|
|
3304
|
-
},
|
|
3348
|
+
}, yr = {
|
|
3305
3349
|
dark: "border-white/[0.08]",
|
|
3306
3350
|
light: "border-black/[0.08]"
|
|
3307
|
-
},
|
|
3351
|
+
}, Cr = (e) => e === "dark" ? "sender" : "receiver", kr = {
|
|
3308
3352
|
sender: {
|
|
3309
3353
|
single: "rounded-tl-[18px] rounded-tr-[18px] rounded-bl-[18px] rounded-br-[18px]",
|
|
3310
3354
|
first: "rounded-tl-[18px] rounded-tr-[18px] rounded-bl-[18px] rounded-br-[4px]",
|
|
@@ -3326,7 +3370,7 @@ const lr = {
|
|
|
3326
3370
|
children: i,
|
|
3327
3371
|
"data-testid": l
|
|
3328
3372
|
}) => {
|
|
3329
|
-
const o = t != null && t !== "", d =
|
|
3373
|
+
const o = t != null && t !== "", d = kr[Cr(e)][a];
|
|
3330
3374
|
return /* @__PURE__ */ h(
|
|
3331
3375
|
"div",
|
|
3332
3376
|
{
|
|
@@ -3341,10 +3385,10 @@ const lr = {
|
|
|
3341
3385
|
// as the surrounding `CustomMessage` text bubbles.
|
|
3342
3386
|
"relative w-[280px] overflow-hidden px-2 py-2",
|
|
3343
3387
|
d,
|
|
3344
|
-
|
|
3345
|
-
|
|
3388
|
+
Nr[e],
|
|
3389
|
+
_r[e],
|
|
3346
3390
|
s && "border",
|
|
3347
|
-
s &&
|
|
3391
|
+
s && yr[e],
|
|
3348
3392
|
r
|
|
3349
3393
|
),
|
|
3350
3394
|
children: [
|
|
@@ -3369,7 +3413,7 @@ const lr = {
|
|
|
3369
3413
|
]
|
|
3370
3414
|
}
|
|
3371
3415
|
);
|
|
3372
|
-
},
|
|
3416
|
+
}, _e = ({
|
|
3373
3417
|
onClick: e,
|
|
3374
3418
|
variant: t = "overlay",
|
|
3375
3419
|
ariaLabel: s = "Dismiss attachment"
|
|
@@ -3385,18 +3429,18 @@ const lr = {
|
|
|
3385
3429
|
"flex size-6 items-center justify-center rounded-full text-white",
|
|
3386
3430
|
t === "overlay" ? "bg-[#121110]/85 backdrop-blur" : "bg-white/15 hover:bg-white/25"
|
|
3387
3431
|
),
|
|
3388
|
-
children: /* @__PURE__ */ n(
|
|
3432
|
+
children: /* @__PURE__ */ n(Le, { className: "size-3", weight: "bold" })
|
|
3389
3433
|
}
|
|
3390
|
-
),
|
|
3434
|
+
), ye = (e) => e === "received" ? "light" : "dark", Ti = ({
|
|
3391
3435
|
firstOfGroup: e,
|
|
3392
3436
|
endOfGroup: t,
|
|
3393
3437
|
groupedByUser: s
|
|
3394
|
-
}) => !s || e && t ? "single" : e ? "first" : t ? "end" : "middle",
|
|
3438
|
+
}) => !s || e && t ? "single" : e ? "first" : t ? "end" : "middle", Er = ({
|
|
3395
3439
|
src: e,
|
|
3396
3440
|
mimeType: t,
|
|
3397
3441
|
filename: s,
|
|
3398
3442
|
items: a
|
|
3399
|
-
}) => a && a.length > 0 ? a : e ? [{ src: e, mimeType: t, filename: s }] : [],
|
|
3443
|
+
}) => a && a.length > 0 ? a : e ? [{ src: e, mimeType: t, filename: s }] : [], Sr = ({ item: e, preload: t, trailingAction: s }) => /* @__PURE__ */ h("div", { className: "flex items-center gap-2", children: [
|
|
3400
3444
|
/* @__PURE__ */ n(
|
|
3401
3445
|
"audio",
|
|
3402
3446
|
{
|
|
@@ -3408,7 +3452,7 @@ const lr = {
|
|
|
3408
3452
|
}
|
|
3409
3453
|
),
|
|
3410
3454
|
s ?? null
|
|
3411
|
-
] }),
|
|
3455
|
+
] }), rt = ({
|
|
3412
3456
|
state: e,
|
|
3413
3457
|
src: t,
|
|
3414
3458
|
mimeType: s,
|
|
@@ -3419,7 +3463,7 @@ const lr = {
|
|
|
3419
3463
|
preload: o,
|
|
3420
3464
|
onDismiss: d
|
|
3421
3465
|
}) => {
|
|
3422
|
-
const m =
|
|
3466
|
+
const m = ye(e), g = e === "composer" && !!d, u = Er({ src: t, mimeType: s, filename: a, items: r });
|
|
3423
3467
|
if (u.length === 0)
|
|
3424
3468
|
return null;
|
|
3425
3469
|
const f = o ?? (u.length > 1 ? "none" : "metadata");
|
|
@@ -3431,29 +3475,29 @@ const lr = {
|
|
|
3431
3475
|
groupPosition: l,
|
|
3432
3476
|
"data-testid": "audio-attachment",
|
|
3433
3477
|
children: /* @__PURE__ */ n("div", { className: "flex flex-col gap-2", children: u.map((c, b) => /* @__PURE__ */ n(
|
|
3434
|
-
|
|
3478
|
+
Sr,
|
|
3435
3479
|
{
|
|
3436
3480
|
item: c,
|
|
3437
3481
|
preload: f,
|
|
3438
3482
|
trailingAction: (
|
|
3439
3483
|
// Composer only supports a single attachment, so the
|
|
3440
3484
|
// dismiss control sits on the only player.
|
|
3441
|
-
g && b === 0 ? /* @__PURE__ */ n(
|
|
3485
|
+
g && b === 0 ? /* @__PURE__ */ n(_e, { onClick: d, variant: "inline" }) : void 0
|
|
3442
3486
|
)
|
|
3443
3487
|
},
|
|
3444
3488
|
`${c.src}-${b}`
|
|
3445
3489
|
)) })
|
|
3446
3490
|
}
|
|
3447
3491
|
);
|
|
3448
|
-
},
|
|
3449
|
-
Composer:
|
|
3450
|
-
Sent:
|
|
3451
|
-
Received:
|
|
3492
|
+
}, Ir = (e) => /* @__PURE__ */ n(rt, { ...e, state: "composer" }), Tr = (e) => /* @__PURE__ */ n(rt, { ...e, state: "sent" }), Ar = (e) => /* @__PURE__ */ n(rt, { ...e, state: "received" }), Mr = {
|
|
3493
|
+
Composer: Ir,
|
|
3494
|
+
Sent: Tr,
|
|
3495
|
+
Received: Ar
|
|
3452
3496
|
};
|
|
3453
|
-
function
|
|
3497
|
+
function Rr(e) {
|
|
3454
3498
|
return !Number.isFinite(e) || e < 0 ? "" : e < 1024 ? `${e} B` : e < 1024 * 1024 ? `${(e / 1024).toFixed(1)} KB` : e < 1024 * 1024 * 1024 ? `${(e / (1024 * 1024)).toFixed(2)} MB` : `${(e / (1024 * 1024 * 1024)).toFixed(2)} GB`;
|
|
3455
3499
|
}
|
|
3456
|
-
const
|
|
3500
|
+
const Lr = {
|
|
3457
3501
|
pdf: "PDF",
|
|
3458
3502
|
doc: "DOC",
|
|
3459
3503
|
xls: "XLS",
|
|
@@ -3463,7 +3507,7 @@ const Mr = {
|
|
|
3463
3507
|
text: "TXT",
|
|
3464
3508
|
markdown: "MD"
|
|
3465
3509
|
};
|
|
3466
|
-
function
|
|
3510
|
+
function Dr(e, t) {
|
|
3467
3511
|
if (t) {
|
|
3468
3512
|
const r = t.lastIndexOf(".");
|
|
3469
3513
|
if (r > 0 && r < t.length - 1) {
|
|
@@ -3473,7 +3517,7 @@ function Rr(e, t) {
|
|
|
3473
3517
|
}
|
|
3474
3518
|
if (!e) return;
|
|
3475
3519
|
if (re(e) === "document") {
|
|
3476
|
-
const r =
|
|
3520
|
+
const r = en(e), i = Lr[r];
|
|
3477
3521
|
if (i) return i;
|
|
3478
3522
|
if (e === "application/octet-stream") return;
|
|
3479
3523
|
}
|
|
@@ -3481,8 +3525,8 @@ function Rr(e, t) {
|
|
|
3481
3525
|
if (!(!a || a === "*"))
|
|
3482
3526
|
return a.toUpperCase();
|
|
3483
3527
|
}
|
|
3484
|
-
function
|
|
3485
|
-
const a =
|
|
3528
|
+
function Pr(e, t, s) {
|
|
3529
|
+
const a = Dr(e, t), r = typeof s == "number" && s > 0 ? Rr(s) : void 0;
|
|
3486
3530
|
return [a, r].filter(Boolean).join(" · ") || void 0;
|
|
3487
3531
|
}
|
|
3488
3532
|
function ne(e) {
|
|
@@ -3493,13 +3537,13 @@ function ne(e) {
|
|
|
3493
3537
|
return "download";
|
|
3494
3538
|
}
|
|
3495
3539
|
}
|
|
3496
|
-
const
|
|
3540
|
+
const Or = {
|
|
3497
3541
|
dark: "text-white/55",
|
|
3498
3542
|
light: "text-black/65"
|
|
3499
|
-
},
|
|
3543
|
+
}, zr = {
|
|
3500
3544
|
dark: "bg-white/10",
|
|
3501
3545
|
light: "bg-black/5"
|
|
3502
|
-
},
|
|
3546
|
+
}, $r = {
|
|
3503
3547
|
dark: "text-white/85",
|
|
3504
3548
|
light: "text-black/85"
|
|
3505
3549
|
}, bn = ({
|
|
@@ -3512,16 +3556,16 @@ const Dr = {
|
|
|
3512
3556
|
activateLabel: l,
|
|
3513
3557
|
trailingAction: o
|
|
3514
3558
|
}) => {
|
|
3515
|
-
const d = s ?? t ?? "File", m =
|
|
3559
|
+
const d = s ?? t ?? "File", m = Pr(a, t, r), g = /* @__PURE__ */ n(
|
|
3516
3560
|
"div",
|
|
3517
3561
|
{
|
|
3518
3562
|
className: y(
|
|
3519
3563
|
"flex size-10 shrink-0 items-center justify-center rounded-sm",
|
|
3520
|
-
|
|
3564
|
+
zr[e]
|
|
3521
3565
|
),
|
|
3522
3566
|
"aria-hidden": !0,
|
|
3523
|
-
children:
|
|
3524
|
-
className: y("size-6",
|
|
3567
|
+
children: oe(a, {
|
|
3568
|
+
className: y("size-6", $r[e]),
|
|
3525
3569
|
weight: "regular"
|
|
3526
3570
|
})
|
|
3527
3571
|
}
|
|
@@ -3532,7 +3576,7 @@ const Dr = {
|
|
|
3532
3576
|
{
|
|
3533
3577
|
className: y(
|
|
3534
3578
|
"truncate text-xs leading-4",
|
|
3535
|
-
|
|
3579
|
+
Or[e]
|
|
3536
3580
|
),
|
|
3537
3581
|
children: m
|
|
3538
3582
|
}
|
|
@@ -3575,14 +3619,14 @@ async function pn(e, t) {
|
|
|
3575
3619
|
}
|
|
3576
3620
|
}
|
|
3577
3621
|
}
|
|
3578
|
-
const
|
|
3622
|
+
const Fr = ({
|
|
3579
3623
|
src: e,
|
|
3580
3624
|
filename: t,
|
|
3581
3625
|
fileSize: s,
|
|
3582
3626
|
mimeType: a,
|
|
3583
3627
|
title: r,
|
|
3584
3628
|
items: i
|
|
3585
|
-
}) => i && i.length > 0 ? i : e ? [{ src: e, filename: t, fileSize: s, mimeType: a, title: r }] : [],
|
|
3629
|
+
}) => i && i.length > 0 ? i : e ? [{ src: e, filename: t, fileSize: s, mimeType: a, title: r }] : [], Br = ({
|
|
3586
3630
|
variant: e,
|
|
3587
3631
|
item: t,
|
|
3588
3632
|
index: s,
|
|
@@ -3603,7 +3647,7 @@ const zr = ({
|
|
|
3603
3647
|
trailingAction: r
|
|
3604
3648
|
}
|
|
3605
3649
|
);
|
|
3606
|
-
},
|
|
3650
|
+
}, it = ({
|
|
3607
3651
|
state: e,
|
|
3608
3652
|
src: t,
|
|
3609
3653
|
filename: s,
|
|
@@ -3616,23 +3660,23 @@ const zr = ({
|
|
|
3616
3660
|
onClick: m,
|
|
3617
3661
|
onDismiss: g
|
|
3618
3662
|
}) => {
|
|
3619
|
-
const u =
|
|
3663
|
+
const u = ye(e), f = e === "composer" && !!g, c = Fr({
|
|
3620
3664
|
src: t,
|
|
3621
3665
|
filename: s,
|
|
3622
3666
|
fileSize: a,
|
|
3623
3667
|
mimeType: r,
|
|
3624
3668
|
title: i,
|
|
3625
3669
|
items: l
|
|
3626
|
-
}), b = (
|
|
3627
|
-
if ((m == null ? void 0 : m(
|
|
3628
|
-
const p = c[
|
|
3670
|
+
}), b = (x) => {
|
|
3671
|
+
if ((m == null ? void 0 : m(x)) === !1) return;
|
|
3672
|
+
const p = c[x];
|
|
3629
3673
|
if (!p) return;
|
|
3630
|
-
const
|
|
3631
|
-
pn(p.src,
|
|
3674
|
+
const v = p.filename ?? ne(p.src);
|
|
3675
|
+
pn(p.src, v);
|
|
3632
3676
|
};
|
|
3633
3677
|
if (c.length === 0)
|
|
3634
3678
|
return null;
|
|
3635
|
-
const
|
|
3679
|
+
const N = /* @__PURE__ */ n(
|
|
3636
3680
|
"span",
|
|
3637
3681
|
{
|
|
3638
3682
|
className: y(
|
|
@@ -3650,23 +3694,23 @@ const zr = ({
|
|
|
3650
3694
|
text: o,
|
|
3651
3695
|
groupPosition: d,
|
|
3652
3696
|
"data-testid": "file-attachment",
|
|
3653
|
-
children: /* @__PURE__ */ n("div", { className: "flex flex-col gap-2", children: c.map((
|
|
3654
|
-
|
|
3697
|
+
children: /* @__PURE__ */ n("div", { className: "flex flex-col gap-2", children: c.map((x, p) => /* @__PURE__ */ n(
|
|
3698
|
+
Br,
|
|
3655
3699
|
{
|
|
3656
3700
|
variant: u,
|
|
3657
|
-
item:
|
|
3701
|
+
item: x,
|
|
3658
3702
|
index: p,
|
|
3659
3703
|
onActivate: b,
|
|
3660
|
-
trailingAction: f && p === 0 ? /* @__PURE__ */ n(
|
|
3704
|
+
trailingAction: f && p === 0 ? /* @__PURE__ */ n(_e, { onClick: g, variant: "inline" }) : N
|
|
3661
3705
|
},
|
|
3662
|
-
`${
|
|
3706
|
+
`${x.src}-${p}`
|
|
3663
3707
|
)) })
|
|
3664
3708
|
}
|
|
3665
3709
|
);
|
|
3666
|
-
},
|
|
3667
|
-
Composer:
|
|
3668
|
-
Sent:
|
|
3669
|
-
Received:
|
|
3710
|
+
}, Ur = (e) => /* @__PURE__ */ n(it, { ...e, state: "composer" }), jr = (e) => /* @__PURE__ */ n(it, { ...e, state: "sent" }), Vr = (e) => /* @__PURE__ */ n(it, { ...e, state: "received" }), Gr = {
|
|
3711
|
+
Composer: Ur,
|
|
3712
|
+
Sent: jr,
|
|
3713
|
+
Received: Vr
|
|
3670
3714
|
}, lt = ({
|
|
3671
3715
|
onPrev: e,
|
|
3672
3716
|
onNext: t,
|
|
@@ -3680,7 +3724,7 @@ const zr = ({
|
|
|
3680
3724
|
onClick: e,
|
|
3681
3725
|
"aria-label": s,
|
|
3682
3726
|
className: "mes-media-viewer__nav mes-media-viewer__nav--prev",
|
|
3683
|
-
children: /* @__PURE__ */ n(
|
|
3727
|
+
children: /* @__PURE__ */ n(Os, { size: 20, weight: "bold", "aria-hidden": !0 })
|
|
3684
3728
|
}
|
|
3685
3729
|
),
|
|
3686
3730
|
/* @__PURE__ */ n(
|
|
@@ -3702,7 +3746,7 @@ const zr = ({
|
|
|
3702
3746
|
tone: i = "dark",
|
|
3703
3747
|
onTriggered: l
|
|
3704
3748
|
}) => {
|
|
3705
|
-
const [o, d] =
|
|
3749
|
+
const [o, d] = $(!1), m = K(
|
|
3706
3750
|
(c) => {
|
|
3707
3751
|
c.stopPropagation(), !o && (d(!0), pn(e, t).catch(() => {
|
|
3708
3752
|
}).finally(() => {
|
|
@@ -3778,23 +3822,23 @@ const zr = ({
|
|
|
3778
3822
|
]
|
|
3779
3823
|
}
|
|
3780
3824
|
);
|
|
3781
|
-
},
|
|
3825
|
+
}, Ue = (e, t, s) => Math.min(Math.max(e, t), s), ot = ({
|
|
3782
3826
|
length: e,
|
|
3783
3827
|
initialIndex: t,
|
|
3784
3828
|
open: s
|
|
3785
3829
|
}) => {
|
|
3786
|
-
const a =
|
|
3787
|
-
|
|
3788
|
-
s && i(
|
|
3789
|
-
}, [s, t, e]),
|
|
3790
|
-
i((d) =>
|
|
3830
|
+
const a = Ue(t, 0, Math.max(e - 1, 0)), [r, i] = $(a);
|
|
3831
|
+
X(() => {
|
|
3832
|
+
s && i(Ue(t, 0, Math.max(e - 1, 0)));
|
|
3833
|
+
}, [s, t, e]), X(() => {
|
|
3834
|
+
i((d) => Ue(d, 0, Math.max(e - 1, 0)));
|
|
3791
3835
|
}, [e]);
|
|
3792
|
-
const l =
|
|
3836
|
+
const l = K(() => {
|
|
3793
3837
|
e <= 1 || i((d) => d <= 0 ? e - 1 : d - 1);
|
|
3794
|
-
}, [e]), o =
|
|
3838
|
+
}, [e]), o = K(() => {
|
|
3795
3839
|
e <= 1 || i((d) => d >= e - 1 ? 0 : d + 1);
|
|
3796
3840
|
}, [e]);
|
|
3797
|
-
return
|
|
3841
|
+
return X(() => {
|
|
3798
3842
|
if (!s || e <= 1) return;
|
|
3799
3843
|
const d = (m) => {
|
|
3800
3844
|
if (m.key !== "ArrowLeft" && m.key !== "ArrowRight") return;
|
|
@@ -3803,7 +3847,7 @@ const zr = ({
|
|
|
3803
3847
|
};
|
|
3804
3848
|
return window.addEventListener("keydown", d), () => window.removeEventListener("keydown", d);
|
|
3805
3849
|
}, [s, e, l, o]), { index: r, prev: l, next: o };
|
|
3806
|
-
},
|
|
3850
|
+
}, ct = ({
|
|
3807
3851
|
open: e,
|
|
3808
3852
|
onClose: t,
|
|
3809
3853
|
ariaLabel: s,
|
|
@@ -3813,7 +3857,7 @@ const zr = ({
|
|
|
3813
3857
|
"data-testid": l
|
|
3814
3858
|
}) => {
|
|
3815
3859
|
const o = G(null), d = G(null);
|
|
3816
|
-
return
|
|
3860
|
+
return X(() => {
|
|
3817
3861
|
var f;
|
|
3818
3862
|
const u = o.current;
|
|
3819
3863
|
if (u) {
|
|
@@ -3884,7 +3928,7 @@ const zr = ({
|
|
|
3884
3928
|
onClick: t,
|
|
3885
3929
|
"aria-label": "Close viewer",
|
|
3886
3930
|
className: "mes-media-viewer__action",
|
|
3887
|
-
children: /* @__PURE__ */ n(
|
|
3931
|
+
children: /* @__PURE__ */ n(Le, { size: 20, weight: "bold", "aria-hidden": !0 })
|
|
3888
3932
|
}
|
|
3889
3933
|
)
|
|
3890
3934
|
] })
|
|
@@ -3899,7 +3943,7 @@ const zr = ({
|
|
|
3899
3943
|
initialIndex: s = 0,
|
|
3900
3944
|
onClose: a
|
|
3901
3945
|
}) => {
|
|
3902
|
-
const { index: r, prev: i, next: l } =
|
|
3946
|
+
const { index: r, prev: i, next: l } = ot({
|
|
3903
3947
|
length: t.length,
|
|
3904
3948
|
initialIndex: s,
|
|
3905
3949
|
open: e
|
|
@@ -3908,7 +3952,7 @@ const zr = ({
|
|
|
3908
3952
|
[o]
|
|
3909
3953
|
);
|
|
3910
3954
|
return o ? /* @__PURE__ */ h(
|
|
3911
|
-
|
|
3955
|
+
ct,
|
|
3912
3956
|
{
|
|
3913
3957
|
open: e,
|
|
3914
3958
|
onClose: a,
|
|
@@ -3949,7 +3993,7 @@ const zr = ({
|
|
|
3949
3993
|
]
|
|
3950
3994
|
}
|
|
3951
3995
|
) : null;
|
|
3952
|
-
},
|
|
3996
|
+
}, Hr = "relative block size-full overflow-hidden bg-black/5 outline-none focus-visible:ring-2 focus-visible:ring-white/80 focus-visible:ring-offset-2 focus-visible:ring-offset-black", wn = ({
|
|
3953
3997
|
tiles: e,
|
|
3954
3998
|
onTileActivate: t,
|
|
3955
3999
|
maxVisible: s = 4,
|
|
@@ -3958,7 +4002,7 @@ const zr = ({
|
|
|
3958
4002
|
const r = e.length;
|
|
3959
4003
|
if (r === 0) return null;
|
|
3960
4004
|
const i = e.slice(0, Math.min(r, s)), l = r - i.length, o = (d, m, g) => {
|
|
3961
|
-
const u = y(
|
|
4005
|
+
const u = y(Hr, "h-full w-full");
|
|
3962
4006
|
return t ? /* @__PURE__ */ h(
|
|
3963
4007
|
"button",
|
|
3964
4008
|
{
|
|
@@ -4019,15 +4063,15 @@ const zr = ({
|
|
|
4019
4063
|
})
|
|
4020
4064
|
}
|
|
4021
4065
|
);
|
|
4022
|
-
},
|
|
4023
|
-
const [t, s] =
|
|
4066
|
+
}, Ce = (e) => {
|
|
4067
|
+
const [t, s] = $(!1), [a, r] = $(0), i = K(
|
|
4024
4068
|
(o) => {
|
|
4025
4069
|
(e == null ? void 0 : e(o)) !== !1 && (r(o), s(!0));
|
|
4026
4070
|
},
|
|
4027
4071
|
[e]
|
|
4028
|
-
), l =
|
|
4072
|
+
), l = K(() => s(!1), []);
|
|
4029
4073
|
return { viewerOpen: t, viewerIndex: a, handleActivate: i, closeViewer: l };
|
|
4030
|
-
},
|
|
4074
|
+
}, Yr = (e, t, s, a) => ({
|
|
4031
4075
|
ariaLabel: `Open image ${t + 1} of ${s}`,
|
|
4032
4076
|
content: /* @__PURE__ */ n(
|
|
4033
4077
|
"img",
|
|
@@ -4042,16 +4086,16 @@ const zr = ({
|
|
|
4042
4086
|
className: "absolute inset-0 size-full rounded-md object-cover"
|
|
4043
4087
|
}
|
|
4044
4088
|
)
|
|
4045
|
-
}),
|
|
4089
|
+
}), qr = ({
|
|
4046
4090
|
src: e,
|
|
4047
4091
|
alt: t,
|
|
4048
4092
|
items: s
|
|
4049
|
-
}) => s && s.length > 0 ? s : e ? [{ src: e, alt: t }] : [],
|
|
4093
|
+
}) => s && s.length > 0 ? s : e ? [{ src: e, alt: t }] : [], Nn = (e, t) => e.map((s, a) => ({
|
|
4050
4094
|
src: s.src,
|
|
4051
4095
|
alt: s.alt,
|
|
4052
4096
|
filename: t && e.length === 1 ? t : t ? `${t} (${a + 1})` : void 0
|
|
4053
|
-
})),
|
|
4054
|
-
const { viewerOpen: l, viewerIndex: o, handleActivate: d, closeViewer: m } =
|
|
4097
|
+
})), Wr = ({ src: e, alt: t, filename: s, loading: a = "lazy", onClick: r, onDismiss: i }) => {
|
|
4098
|
+
const { viewerOpen: l, viewerIndex: o, handleActivate: d, closeViewer: m } = Ce(
|
|
4055
4099
|
r
|
|
4056
4100
|
);
|
|
4057
4101
|
return /* @__PURE__ */ h("div", { className: "relative w-fit", children: [
|
|
@@ -4075,18 +4119,18 @@ const zr = ({
|
|
|
4075
4119
|
)
|
|
4076
4120
|
}
|
|
4077
4121
|
),
|
|
4078
|
-
i ? /* @__PURE__ */ n("div", { className: "absolute right-2 top-2 z-10", children: /* @__PURE__ */ n(
|
|
4122
|
+
i ? /* @__PURE__ */ n("div", { className: "absolute right-2 top-2 z-10", children: /* @__PURE__ */ n(_e, { onClick: i }) }) : null,
|
|
4079
4123
|
/* @__PURE__ */ n(
|
|
4080
4124
|
xn,
|
|
4081
4125
|
{
|
|
4082
4126
|
open: l,
|
|
4083
|
-
items:
|
|
4127
|
+
items: Nn([{ src: e, alt: t }], s),
|
|
4084
4128
|
initialIndex: o,
|
|
4085
4129
|
onClose: m
|
|
4086
4130
|
}
|
|
4087
4131
|
)
|
|
4088
4132
|
] });
|
|
4089
|
-
},
|
|
4133
|
+
}, _n = ({
|
|
4090
4134
|
state: e,
|
|
4091
4135
|
src: t,
|
|
4092
4136
|
alt: s,
|
|
@@ -4097,13 +4141,13 @@ const zr = ({
|
|
|
4097
4141
|
loading: o = "lazy",
|
|
4098
4142
|
onClick: d
|
|
4099
4143
|
}) => {
|
|
4100
|
-
const m =
|
|
4144
|
+
const m = qr({ src: t, alt: s, items: r }), g = ye(e), { viewerOpen: u, viewerIndex: f, handleActivate: c, closeViewer: b } = Ce(
|
|
4101
4145
|
d
|
|
4102
4146
|
);
|
|
4103
4147
|
if (m.length === 0)
|
|
4104
4148
|
return null;
|
|
4105
|
-
const
|
|
4106
|
-
(
|
|
4149
|
+
const N = m.map(
|
|
4150
|
+
(x, p) => Yr(x, p, m.length, o)
|
|
4107
4151
|
);
|
|
4108
4152
|
return /* @__PURE__ */ h(
|
|
4109
4153
|
Ne,
|
|
@@ -4113,12 +4157,12 @@ const zr = ({
|
|
|
4113
4157
|
groupPosition: l,
|
|
4114
4158
|
"data-testid": "image-attachment",
|
|
4115
4159
|
children: [
|
|
4116
|
-
/* @__PURE__ */ n("div", { className: "relative", children: /* @__PURE__ */ n(wn, { tiles:
|
|
4160
|
+
/* @__PURE__ */ n("div", { className: "relative", children: /* @__PURE__ */ n(wn, { tiles: N, onTileActivate: c }) }),
|
|
4117
4161
|
/* @__PURE__ */ n(
|
|
4118
4162
|
xn,
|
|
4119
4163
|
{
|
|
4120
4164
|
open: u,
|
|
4121
|
-
items:
|
|
4165
|
+
items: Nn(m, a),
|
|
4122
4166
|
initialIndex: f,
|
|
4123
4167
|
onClose: b
|
|
4124
4168
|
}
|
|
@@ -4126,17 +4170,17 @@ const zr = ({
|
|
|
4126
4170
|
]
|
|
4127
4171
|
}
|
|
4128
4172
|
);
|
|
4129
|
-
},
|
|
4130
|
-
Composer:
|
|
4131
|
-
Sent:
|
|
4132
|
-
Received:
|
|
4133
|
-
},
|
|
4173
|
+
}, Xr = (e) => /* @__PURE__ */ n(Wr, { ...e }), Kr = (e) => /* @__PURE__ */ n(_n, { ...e, state: "sent" }), Jr = (e) => /* @__PURE__ */ n(_n, { ...e, state: "received" }), Zr = {
|
|
4174
|
+
Composer: Xr,
|
|
4175
|
+
Sent: Kr,
|
|
4176
|
+
Received: Jr
|
|
4177
|
+
}, Qr = ({
|
|
4134
4178
|
open: e,
|
|
4135
4179
|
items: t,
|
|
4136
4180
|
initialIndex: s = 0,
|
|
4137
4181
|
onClose: a
|
|
4138
4182
|
}) => {
|
|
4139
|
-
const { index: r, prev: i, next: l } =
|
|
4183
|
+
const { index: r, prev: i, next: l } = ot({
|
|
4140
4184
|
length: t.length,
|
|
4141
4185
|
initialIndex: s,
|
|
4142
4186
|
open: e
|
|
@@ -4144,11 +4188,11 @@ const zr = ({
|
|
|
4144
4188
|
() => (o == null ? void 0 : o.filename) ?? (o ? ne(o.src) : "document"),
|
|
4145
4189
|
[o]
|
|
4146
4190
|
), m = se(
|
|
4147
|
-
() => o ?
|
|
4191
|
+
() => o ? ei(o.src) : void 0,
|
|
4148
4192
|
[o]
|
|
4149
4193
|
);
|
|
4150
4194
|
return !o || !m ? null : /* @__PURE__ */ h(
|
|
4151
|
-
|
|
4195
|
+
ct,
|
|
4152
4196
|
{
|
|
4153
4197
|
open: e,
|
|
4154
4198
|
onClose: a,
|
|
@@ -4178,16 +4222,16 @@ const zr = ({
|
|
|
4178
4222
|
]
|
|
4179
4223
|
}
|
|
4180
4224
|
);
|
|
4181
|
-
},
|
|
4225
|
+
}, ei = (e) => {
|
|
4182
4226
|
const t = e.indexOf("#"), s = t === -1 ? e : e.slice(0, t), a = t === -1 ? "" : e.slice(t + 1), r = new URLSearchParams(a);
|
|
4183
4227
|
return r.has("toolbar") || r.set("toolbar", "0"), r.has("navpanes") || r.set("navpanes", "0"), `${s}#${r.toString()}`;
|
|
4184
|
-
},
|
|
4228
|
+
}, ti = ({
|
|
4185
4229
|
src: e,
|
|
4186
4230
|
filename: t,
|
|
4187
4231
|
fileSize: s,
|
|
4188
4232
|
title: a,
|
|
4189
4233
|
items: r
|
|
4190
|
-
}) => r && r.length > 0 ? r : e ? [{ src: e, filename: t, fileSize: s, title: a }] : [],
|
|
4234
|
+
}) => r && r.length > 0 ? r : e ? [{ src: e, filename: t, fileSize: s, title: a }] : [], ni = ({
|
|
4191
4235
|
variant: e,
|
|
4192
4236
|
item: t,
|
|
4193
4237
|
index: s,
|
|
@@ -4208,7 +4252,7 @@ const zr = ({
|
|
|
4208
4252
|
trailingAction: r
|
|
4209
4253
|
}
|
|
4210
4254
|
);
|
|
4211
|
-
},
|
|
4255
|
+
}, dt = ({
|
|
4212
4256
|
state: e,
|
|
4213
4257
|
src: t,
|
|
4214
4258
|
filename: s,
|
|
@@ -4220,14 +4264,14 @@ const zr = ({
|
|
|
4220
4264
|
onClick: d,
|
|
4221
4265
|
onDismiss: m
|
|
4222
4266
|
}) => {
|
|
4223
|
-
const g =
|
|
4267
|
+
const g = ye(e), u = ti({ src: t, filename: s, fileSize: a, title: r, items: i }), { viewerOpen: f, viewerIndex: c, handleActivate: b, closeViewer: N } = Ce(
|
|
4224
4268
|
d
|
|
4225
|
-
),
|
|
4269
|
+
), x = e === "composer" && !!m;
|
|
4226
4270
|
if (u.length === 0)
|
|
4227
4271
|
return null;
|
|
4228
|
-
const p = u.map((
|
|
4229
|
-
src:
|
|
4230
|
-
filename:
|
|
4272
|
+
const p = u.map((v) => ({
|
|
4273
|
+
src: v.src,
|
|
4274
|
+
filename: v.filename ?? ne(v.src)
|
|
4231
4275
|
}));
|
|
4232
4276
|
return /* @__PURE__ */ h(
|
|
4233
4277
|
Ne,
|
|
@@ -4237,52 +4281,52 @@ const zr = ({
|
|
|
4237
4281
|
groupPosition: o,
|
|
4238
4282
|
"data-testid": "pdf-attachment",
|
|
4239
4283
|
children: [
|
|
4240
|
-
/* @__PURE__ */ n("div", { className: "flex flex-col gap-2", children: u.map((
|
|
4241
|
-
const
|
|
4284
|
+
/* @__PURE__ */ n("div", { className: "flex flex-col gap-2", children: u.map((v, A) => {
|
|
4285
|
+
const R = v.filename ?? ne(v.src), _ = x && A === 0 ? /* @__PURE__ */ n(_e, { onClick: m, variant: "inline" }) : e === "composer" ? void 0 : /* @__PURE__ */ n(
|
|
4242
4286
|
vn,
|
|
4243
4287
|
{
|
|
4244
|
-
url:
|
|
4245
|
-
filename:
|
|
4288
|
+
url: v.src,
|
|
4289
|
+
filename: R,
|
|
4246
4290
|
variant: "inline",
|
|
4247
|
-
label: `Download ${
|
|
4291
|
+
label: `Download ${R}`,
|
|
4248
4292
|
tone: g
|
|
4249
4293
|
}
|
|
4250
4294
|
);
|
|
4251
4295
|
return /* @__PURE__ */ n(
|
|
4252
|
-
|
|
4296
|
+
ni,
|
|
4253
4297
|
{
|
|
4254
4298
|
variant: g,
|
|
4255
|
-
item:
|
|
4299
|
+
item: v,
|
|
4256
4300
|
index: A,
|
|
4257
4301
|
onActivate: b,
|
|
4258
|
-
trailingAction:
|
|
4302
|
+
trailingAction: _
|
|
4259
4303
|
},
|
|
4260
|
-
`${
|
|
4304
|
+
`${v.src}-${A}`
|
|
4261
4305
|
);
|
|
4262
4306
|
}) }),
|
|
4263
4307
|
/* @__PURE__ */ n(
|
|
4264
|
-
|
|
4308
|
+
Qr,
|
|
4265
4309
|
{
|
|
4266
4310
|
open: f,
|
|
4267
4311
|
items: p,
|
|
4268
4312
|
initialIndex: c,
|
|
4269
|
-
onClose:
|
|
4313
|
+
onClose: N
|
|
4270
4314
|
}
|
|
4271
4315
|
)
|
|
4272
4316
|
]
|
|
4273
4317
|
}
|
|
4274
4318
|
);
|
|
4275
|
-
},
|
|
4276
|
-
Composer:
|
|
4277
|
-
Sent:
|
|
4278
|
-
Received:
|
|
4319
|
+
}, si = (e) => /* @__PURE__ */ n(dt, { ...e, state: "composer" }), ai = (e) => /* @__PURE__ */ n(dt, { ...e, state: "sent" }), ri = (e) => /* @__PURE__ */ n(dt, { ...e, state: "received" }), ii = {
|
|
4320
|
+
Composer: si,
|
|
4321
|
+
Sent: ai,
|
|
4322
|
+
Received: ri
|
|
4279
4323
|
}, yn = ({
|
|
4280
4324
|
open: e,
|
|
4281
4325
|
items: t,
|
|
4282
4326
|
initialIndex: s = 0,
|
|
4283
4327
|
onClose: a
|
|
4284
4328
|
}) => {
|
|
4285
|
-
const { index: r, prev: i, next: l } =
|
|
4329
|
+
const { index: r, prev: i, next: l } = ot({
|
|
4286
4330
|
length: t.length,
|
|
4287
4331
|
initialIndex: s,
|
|
4288
4332
|
open: e
|
|
@@ -4291,7 +4335,7 @@ const zr = ({
|
|
|
4291
4335
|
[o]
|
|
4292
4336
|
);
|
|
4293
4337
|
return o ? /* @__PURE__ */ h(
|
|
4294
|
-
|
|
4338
|
+
ct,
|
|
4295
4339
|
{
|
|
4296
4340
|
open: e,
|
|
4297
4341
|
onClose: a,
|
|
@@ -4326,7 +4370,7 @@ const zr = ({
|
|
|
4326
4370
|
]
|
|
4327
4371
|
}
|
|
4328
4372
|
) : null;
|
|
4329
|
-
},
|
|
4373
|
+
}, li = () => /* @__PURE__ */ n("div", { className: "pointer-events-none absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ n("span", { className: "flex size-12 items-center justify-center rounded-full bg-black/55 text-white backdrop-blur", children: /* @__PURE__ */ n(je, { className: "size-6", weight: "fill", "aria-hidden": !0 }) }) }), Cn = ({
|
|
4330
4374
|
item: e,
|
|
4331
4375
|
index: t
|
|
4332
4376
|
}) => /* @__PURE__ */ h("div", { className: "absolute inset-0 size-full bg-[#0d0d0d]", children: [
|
|
@@ -4341,18 +4385,18 @@ const zr = ({
|
|
|
4341
4385
|
className: "absolute inset-0 size-full rounded-md object-cover"
|
|
4342
4386
|
}
|
|
4343
4387
|
) : /* @__PURE__ */ n("div", { className: "absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ n(
|
|
4344
|
-
|
|
4388
|
+
Yt,
|
|
4345
4389
|
{
|
|
4346
4390
|
className: "size-16 rounded-md text-white/30",
|
|
4347
4391
|
weight: "regular",
|
|
4348
4392
|
"aria-hidden": !0
|
|
4349
4393
|
}
|
|
4350
4394
|
) }),
|
|
4351
|
-
/* @__PURE__ */ n(
|
|
4352
|
-
] }),
|
|
4395
|
+
/* @__PURE__ */ n(li, {})
|
|
4396
|
+
] }), oi = (e, t, s) => ({
|
|
4353
4397
|
ariaLabel: `Play video ${t + 1} of ${s}`,
|
|
4354
4398
|
content: /* @__PURE__ */ n(Cn, { item: e, index: t })
|
|
4355
|
-
}),
|
|
4399
|
+
}), ci = ({
|
|
4356
4400
|
src: e,
|
|
4357
4401
|
poster: t,
|
|
4358
4402
|
mimeType: s,
|
|
@@ -4364,8 +4408,8 @@ const zr = ({
|
|
|
4364
4408
|
mimeType: s.mimeType,
|
|
4365
4409
|
preload: s.preload,
|
|
4366
4410
|
filename: t && e.length === 1 ? t : t ? `${t} (${a + 1})` : void 0
|
|
4367
|
-
})),
|
|
4368
|
-
const { viewerOpen: o, viewerIndex: d, handleActivate: m, closeViewer: g } =
|
|
4411
|
+
})), di = ({ src: e, poster: t, mimeType: s, filename: a, preload: r, onClick: i, onDismiss: l }) => {
|
|
4412
|
+
const { viewerOpen: o, viewerIndex: d, handleActivate: m, closeViewer: g } = Ce(
|
|
4369
4413
|
i
|
|
4370
4414
|
);
|
|
4371
4415
|
return /* @__PURE__ */ h("div", { className: "relative w-fit", children: [
|
|
@@ -4379,7 +4423,7 @@ const zr = ({
|
|
|
4379
4423
|
children: /* @__PURE__ */ n(Cn, { item: { src: e, poster: t, mimeType: s }, index: 0 })
|
|
4380
4424
|
}
|
|
4381
4425
|
),
|
|
4382
|
-
l ? /* @__PURE__ */ n("div", { className: "absolute right-2 top-2 z-10", children: /* @__PURE__ */ n(
|
|
4426
|
+
l ? /* @__PURE__ */ n("div", { className: "absolute right-2 top-2 z-10", children: /* @__PURE__ */ n(_e, { onClick: l }) }) : null,
|
|
4383
4427
|
/* @__PURE__ */ n(
|
|
4384
4428
|
yn,
|
|
4385
4429
|
{
|
|
@@ -4405,13 +4449,13 @@ const zr = ({
|
|
|
4405
4449
|
preload: d,
|
|
4406
4450
|
onClick: m
|
|
4407
4451
|
}) => {
|
|
4408
|
-
const g =
|
|
4452
|
+
const g = ci({ src: t, poster: s, mimeType: a, preload: d, items: i }), u = ye(e), { viewerOpen: f, viewerIndex: c, handleActivate: b, closeViewer: N } = Ce(
|
|
4409
4453
|
m
|
|
4410
4454
|
);
|
|
4411
4455
|
if (g.length === 0)
|
|
4412
4456
|
return null;
|
|
4413
|
-
const
|
|
4414
|
-
(p,
|
|
4457
|
+
const x = g.map(
|
|
4458
|
+
(p, v) => oi(p, v, g.length)
|
|
4415
4459
|
);
|
|
4416
4460
|
return /* @__PURE__ */ h(
|
|
4417
4461
|
Ne,
|
|
@@ -4424,7 +4468,7 @@ const zr = ({
|
|
|
4424
4468
|
/* @__PURE__ */ n("div", { className: "relative", children: /* @__PURE__ */ n(
|
|
4425
4469
|
wn,
|
|
4426
4470
|
{
|
|
4427
|
-
tiles:
|
|
4471
|
+
tiles: x,
|
|
4428
4472
|
onTileActivate: b,
|
|
4429
4473
|
className: "overflow-hidden rounded-md"
|
|
4430
4474
|
}
|
|
@@ -4435,23 +4479,23 @@ const zr = ({
|
|
|
4435
4479
|
open: f,
|
|
4436
4480
|
items: kn(g, r),
|
|
4437
4481
|
initialIndex: c,
|
|
4438
|
-
onClose:
|
|
4482
|
+
onClose: N
|
|
4439
4483
|
}
|
|
4440
4484
|
)
|
|
4441
4485
|
]
|
|
4442
4486
|
}
|
|
4443
4487
|
);
|
|
4444
|
-
},
|
|
4445
|
-
Composer:
|
|
4446
|
-
Sent:
|
|
4447
|
-
Received:
|
|
4448
|
-
},
|
|
4449
|
-
Image:
|
|
4450
|
-
Video:
|
|
4451
|
-
Audio:
|
|
4452
|
-
Pdf:
|
|
4453
|
-
File:
|
|
4454
|
-
},
|
|
4488
|
+
}, ui = (e) => /* @__PURE__ */ n(di, { ...e }), mi = (e) => /* @__PURE__ */ n(En, { ...e, state: "sent" }), hi = (e) => /* @__PURE__ */ n(En, { ...e, state: "received" }), fi = {
|
|
4489
|
+
Composer: ui,
|
|
4490
|
+
Sent: mi,
|
|
4491
|
+
Received: hi
|
|
4492
|
+
}, Ai = {
|
|
4493
|
+
Image: Zr,
|
|
4494
|
+
Video: fi,
|
|
4495
|
+
Audio: Mr,
|
|
4496
|
+
Pdf: ii,
|
|
4497
|
+
File: Gr
|
|
4498
|
+
}, gi = ({
|
|
4455
4499
|
question: e,
|
|
4456
4500
|
onClick: t,
|
|
4457
4501
|
loading: s = !1,
|
|
@@ -4473,7 +4517,7 @@ const zr = ({
|
|
|
4473
4517
|
),
|
|
4474
4518
|
children: e
|
|
4475
4519
|
}
|
|
4476
|
-
),
|
|
4520
|
+
), Mi = ({
|
|
4477
4521
|
faqs: e,
|
|
4478
4522
|
onFaqClick: t,
|
|
4479
4523
|
loadingFaqId: s,
|
|
@@ -4485,7 +4529,7 @@ const zr = ({
|
|
|
4485
4529
|
const o = e.filter((d) => d.enabled).sort((d, m) => (d.order ?? 0) - (m.order ?? 0));
|
|
4486
4530
|
return o.length === 0 ? null : /* @__PURE__ */ n("div", { className: r, children: /* @__PURE__ */ h("div", { className: "flex gap-3 items-end", children: [
|
|
4487
4531
|
(i || l) && /* @__PURE__ */ n("div", { className: "flex-none", children: /* @__PURE__ */ n(
|
|
4488
|
-
|
|
4532
|
+
ie,
|
|
4489
4533
|
{
|
|
4490
4534
|
id: l || "account",
|
|
4491
4535
|
name: l || "Account",
|
|
@@ -4502,7 +4546,7 @@ const zr = ({
|
|
|
4502
4546
|
children: [
|
|
4503
4547
|
a && /* @__PURE__ */ n("p", { className: "text-md text-charcoal mb-4", children: a }),
|
|
4504
4548
|
o.map((d) => /* @__PURE__ */ n(
|
|
4505
|
-
|
|
4549
|
+
gi,
|
|
4506
4550
|
{
|
|
4507
4551
|
question: d.question,
|
|
4508
4552
|
onClick: () => t(d.id),
|
|
@@ -4516,39 +4560,38 @@ const zr = ({
|
|
|
4516
4560
|
] }) });
|
|
4517
4561
|
};
|
|
4518
4562
|
export {
|
|
4519
|
-
|
|
4520
|
-
|
|
4521
|
-
|
|
4522
|
-
|
|
4523
|
-
|
|
4524
|
-
|
|
4525
|
-
|
|
4526
|
-
|
|
4527
|
-
|
|
4528
|
-
|
|
4529
|
-
rr as c,
|
|
4563
|
+
tn as A,
|
|
4564
|
+
qs as B,
|
|
4565
|
+
Ja as C,
|
|
4566
|
+
$s as D,
|
|
4567
|
+
Mi as F,
|
|
4568
|
+
Ii as L,
|
|
4569
|
+
ki as M,
|
|
4570
|
+
ge as a,
|
|
4571
|
+
ie as b,
|
|
4572
|
+
lr as c,
|
|
4530
4573
|
mn as d,
|
|
4531
|
-
|
|
4532
|
-
|
|
4574
|
+
Ei as e,
|
|
4575
|
+
gi as f,
|
|
4533
4576
|
re as g,
|
|
4534
|
-
|
|
4535
|
-
|
|
4536
|
-
|
|
4537
|
-
|
|
4538
|
-
|
|
4539
|
-
|
|
4540
|
-
|
|
4541
|
-
|
|
4542
|
-
|
|
4543
|
-
|
|
4544
|
-
|
|
4545
|
-
|
|
4546
|
-
|
|
4547
|
-
|
|
4548
|
-
|
|
4577
|
+
$t as h,
|
|
4578
|
+
Ai as i,
|
|
4579
|
+
Ea as j,
|
|
4580
|
+
Ci as k,
|
|
4581
|
+
Si as l,
|
|
4582
|
+
Pr as m,
|
|
4583
|
+
Rr as n,
|
|
4584
|
+
rr as o,
|
|
4585
|
+
Dr as p,
|
|
4586
|
+
Jt as q,
|
|
4587
|
+
oe as r,
|
|
4588
|
+
an as s,
|
|
4589
|
+
Bs as t,
|
|
4590
|
+
Ti as u,
|
|
4591
|
+
Ws as v,
|
|
4549
4592
|
et as w,
|
|
4550
4593
|
tt as x,
|
|
4551
|
-
|
|
4552
|
-
|
|
4594
|
+
Kt as y,
|
|
4595
|
+
wa as z
|
|
4553
4596
|
};
|
|
4554
|
-
//# sourceMappingURL=index-
|
|
4597
|
+
//# sourceMappingURL=index-CbWEp3Zs.js.map
|