@ethora/chat-component 26.10.5 → 26.10.7
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/README.md +32 -1
- package/dist/{ChatProfileModal-Dw7pPDv8.js → ChatProfileModal-BDZvd0rm.js} +145 -145
- package/dist/{FilePreviewModal-CEcb5HZ2.js → FilePreviewModal-DlOjnYzv.js} +79 -79
- package/dist/{ManageDataModal-Qma0dQja.js → ManageDataModal-BZLGJZze.js} +16 -16
- package/dist/{MarkdownBody-DiVdEIJH.js → MarkdownBody-CtArwCDa.js} +1 -1
- package/dist/{MessageSearchModal-DVJTW9WM.js → MessageSearchModal-CcUnfZlU.js} +46 -46
- package/dist/{PublicChatsModal-CX1qZbEc.js → PublicChatsModal-BWn0NXVo.js} +10 -10
- package/dist/{SideDrawer-BzfNGNbq.js → SideDrawer-CqZl9sxK.js} +28 -28
- package/dist/UserProfileModal-D0JZ3-uy.js +635 -0
- package/dist/{UserSettingsModal-DdbURRR3.js → UserSettingsModal-OvykYDsT.js} +4 -4
- package/dist/{VideoCallOverlay-D1lGzbw3.js → VideoCallOverlay-DrvO2v_g.js} +4616 -4477
- package/dist/{VisibilityModal-yGZ0eOJx.js → VisibilityModal-pOF9-UXR.js} +11 -11
- package/dist/components/Modals/styledModalComponents.d.ts +4 -4
- package/dist/components/VideoCalls/VideoCallSession.d.ts +2 -0
- package/dist/components/styled/SendInput.d.ts +3 -2
- package/dist/firebase-messaging-sw.js +918 -96
- package/dist/{handleCopyClick-C-w304_U.js → handleCopyClick-BUbVvd2G.js} +1 -1
- package/dist/helpers/callClaim.d.ts +17 -0
- package/dist/helpers/callOutcomeSync.d.ts +23 -0
- package/dist/helpers/callPush.d.ts +23 -0
- package/dist/helpers/incomingCallPush.d.ts +89 -0
- package/dist/helpers/pushRoomHandoff.d.ts +13 -0
- package/dist/hooks/useChatSettingState.d.ts +1 -0
- package/dist/hooks/usePushNotifications.d.ts +2 -0
- package/dist/{main-Cdwk7Rjj.js → main-CpHMnydn.js} +12241 -11463
- package/dist/main.js +17 -17
- package/dist/networking/api-requests/rooms.api.d.ts +9 -0
- package/dist/networking/xmpp/sendMessageReaction.xmpp.d.ts +13 -1
- package/dist/networking/xmppClient.d.ts +2 -1
- package/dist/roomStore/Middleware/blockedHydrationMiddleware.d.ts +2 -0
- package/dist/roomStore/chatSettingsSlice.d.ts +2 -1
- package/dist/types/models/config.model.d.ts +42 -0
- package/dist/types/models/xmpp.model.d.ts +2 -1
- package/dist/utils/callAuthMirror.d.ts +1 -0
- package/dist/utils/callBroadcast.d.ts +12 -0
- package/dist/utils/callNotifications.d.ts +67 -0
- package/dist/utils/firebasePushNotifications.d.ts +14 -0
- package/dist/utils/handledCalls.d.ts +5 -0
- package/dist/utils/pushServiceWorkerBridge.d.ts +19 -0
- package/dist/utils/webLock.d.ts +13 -0
- package/package.json +1 -1
- package/public/firebase-messaging-sw.js +918 -96
- package/dist/UserProfileModal-DdW_nEsM.js +0 -594
|
@@ -0,0 +1,635 @@
|
|
|
1
|
+
import { jsxs as g, Fragment as T, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as Ce, useState as D, useCallback as b, useImperativeHandle as Se, useRef as ie, useMemo as X } from "react";
|
|
3
|
+
import { a as De, M as _, Q as Ie, R as ke, S as le, P as ce, T as W, U as I, W as Ue, X as Ne, Y as Pe, Z as de, _ as Re, $ as Fe, a0 as je, a1 as Ae, u as O, a2 as Be, a3 as ze, a4 as $e, a5 as Ee, a6 as re, N as K, a7 as Oe, a8 as Te, a9 as Le, o as Me, aa as He, ab as Je, ac as Xe, ad as te, I as V, ae as We, af as Ke, ag as Ve, ah as ne, ai as F, aj as Ge, ak as _e, V as qe, G as Qe, al as Ye, am as Ze, an as eo, ao as oo } from "./main-CpHMnydn.js";
|
|
4
|
+
import { D as L, a as G, b as ao, e as ro, f as to, S as no } from "./SideDrawer-CqZl9sxK.js";
|
|
5
|
+
import { P as pe, a as so, D as io, b as lo, h as co } from "./handleCopyClick-BUbVvd2G.js";
|
|
6
|
+
const po = (p, t) => {
|
|
7
|
+
const l = atob(p.split(",")[1]), f = new ArrayBuffer(l.length), e = new Uint8Array(f);
|
|
8
|
+
for (let n = 0; n < l.length; n++)
|
|
9
|
+
e[n] = l.charCodeAt(n);
|
|
10
|
+
const i = new Blob([e], { type: "image/jpeg" });
|
|
11
|
+
return new File([i], t, { type: "image/jpeg" });
|
|
12
|
+
}, mo = I.div`
|
|
13
|
+
display: flex;
|
|
14
|
+
flex-direction: column;
|
|
15
|
+
gap: var(--ethora-space-4, 16px);
|
|
16
|
+
width: 100%;
|
|
17
|
+
`, me = Ce(
|
|
18
|
+
({ setIsEditing: p, modalUser: t, config: l }, f) => {
|
|
19
|
+
const e = De(), i = _(), [n, a] = D(t?.firstName || ""), [h, j] = D(t?.lastName || ""), [y, k] = D(t?.description || ""), [v, C] = D(
|
|
20
|
+
t?.profileImage
|
|
21
|
+
), S = b(async () => {
|
|
22
|
+
try {
|
|
23
|
+
let c = new FormData();
|
|
24
|
+
if (typeof v == "string" && v.startsWith("data:image/")) {
|
|
25
|
+
const N = po(v, "profileImage.jpg");
|
|
26
|
+
c.append("file", N);
|
|
27
|
+
} else v instanceof File && c.append("file", v);
|
|
28
|
+
c.append("firstName", n), c.append("lastName", h), c.append("description", y);
|
|
29
|
+
const { user: U } = await Ie(c);
|
|
30
|
+
e(
|
|
31
|
+
ke({
|
|
32
|
+
updates: {
|
|
33
|
+
firstName: n,
|
|
34
|
+
lastName: h,
|
|
35
|
+
description: y,
|
|
36
|
+
profileImage: U?.profileImage
|
|
37
|
+
}
|
|
38
|
+
})
|
|
39
|
+
), p(!1);
|
|
40
|
+
} catch (c) {
|
|
41
|
+
le.log("error", c);
|
|
42
|
+
}
|
|
43
|
+
}, [
|
|
44
|
+
e,
|
|
45
|
+
y,
|
|
46
|
+
n,
|
|
47
|
+
h,
|
|
48
|
+
v,
|
|
49
|
+
p
|
|
50
|
+
]);
|
|
51
|
+
Se(f, () => ({ save: S }), [S]);
|
|
52
|
+
const x = (c) => {
|
|
53
|
+
C(c);
|
|
54
|
+
};
|
|
55
|
+
return /* @__PURE__ */ g(T, { children: [
|
|
56
|
+
/* @__PURE__ */ o(pe, { children: /* @__PURE__ */ o(
|
|
57
|
+
ce,
|
|
58
|
+
{
|
|
59
|
+
icon: v,
|
|
60
|
+
name: `${n} ${h}`,
|
|
61
|
+
size: 96,
|
|
62
|
+
upload: {
|
|
63
|
+
onUpload: x,
|
|
64
|
+
active: !0
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
) }),
|
|
68
|
+
/* @__PURE__ */ o(L, { children: /* @__PURE__ */ g(mo, { children: [
|
|
69
|
+
/* @__PURE__ */ o(
|
|
70
|
+
W,
|
|
71
|
+
{
|
|
72
|
+
color: l?.colors?.primary,
|
|
73
|
+
colorBg: l?.colors?.colorInput,
|
|
74
|
+
placeholder: i("field.firstName"),
|
|
75
|
+
label: i("field.firstName"),
|
|
76
|
+
value: n,
|
|
77
|
+
onChange: (c) => a(c.target.value)
|
|
78
|
+
}
|
|
79
|
+
),
|
|
80
|
+
/* @__PURE__ */ o(
|
|
81
|
+
W,
|
|
82
|
+
{
|
|
83
|
+
color: l?.colors?.primary,
|
|
84
|
+
colorBg: l?.colors?.colorInput,
|
|
85
|
+
placeholder: i("field.lastName"),
|
|
86
|
+
label: i("field.lastName"),
|
|
87
|
+
value: h,
|
|
88
|
+
onChange: (c) => j(c.target.value)
|
|
89
|
+
}
|
|
90
|
+
),
|
|
91
|
+
/* @__PURE__ */ o(
|
|
92
|
+
W,
|
|
93
|
+
{
|
|
94
|
+
color: l?.colors?.primary,
|
|
95
|
+
colorBg: l?.colors?.colorInput,
|
|
96
|
+
placeholder: i("modal.profile.about"),
|
|
97
|
+
label: i("modal.profile.about"),
|
|
98
|
+
value: y,
|
|
99
|
+
onChange: (c) => k(c.target.value)
|
|
100
|
+
}
|
|
101
|
+
)
|
|
102
|
+
] }) })
|
|
103
|
+
] });
|
|
104
|
+
}
|
|
105
|
+
);
|
|
106
|
+
me.displayName = "EditUserModal";
|
|
107
|
+
const fo = de`
|
|
108
|
+
from {
|
|
109
|
+
transform: rotate(0deg);
|
|
110
|
+
}
|
|
111
|
+
to {
|
|
112
|
+
transform: rotate(180deg);
|
|
113
|
+
}
|
|
114
|
+
`, uo = de`
|
|
115
|
+
from {
|
|
116
|
+
transform: rotate(180deg);
|
|
117
|
+
}
|
|
118
|
+
to {
|
|
119
|
+
transform: rotate(0deg);
|
|
120
|
+
}
|
|
121
|
+
`, ho = I.div`
|
|
122
|
+
position: relative;
|
|
123
|
+
width: 100%;
|
|
124
|
+
`, go = I.div`
|
|
125
|
+
border: 1px solid
|
|
126
|
+
${({ $borderColor: p, $isOpen: t }) => t ? p || "var(--ethora-color-primary, #0052cd)" : p || "var(--ethora-color-border, #e6e8ec)"};
|
|
127
|
+
padding: 0 16px;
|
|
128
|
+
height: 48px;
|
|
129
|
+
box-sizing: border-box;
|
|
130
|
+
display: flex;
|
|
131
|
+
justify-content: space-between;
|
|
132
|
+
align-items: center;
|
|
133
|
+
cursor: pointer;
|
|
134
|
+
background-color: var(--ethora-color-bg, #fff);
|
|
135
|
+
color: var(--ethora-color-text, #141414);
|
|
136
|
+
font-size: var(--ethora-font-size, 16px);
|
|
137
|
+
border-radius: var(--ethora-radius-md, 16px);
|
|
138
|
+
transition:
|
|
139
|
+
border-color var(--ethora-motion-fast, 150ms) var(--ethora-motion-ease, ease),
|
|
140
|
+
box-shadow var(--ethora-motion-fast, 150ms) var(--ethora-motion-ease, ease);
|
|
141
|
+
|
|
142
|
+
${({ $isOpen: p }) => p && Ne`
|
|
143
|
+
outline: 2px solid var(--ethora-color-primary, #0052cd);
|
|
144
|
+
outline-offset: 1px;
|
|
145
|
+
`}
|
|
146
|
+
|
|
147
|
+
&:focus-visible {
|
|
148
|
+
outline: 2px solid var(--ethora-color-primary, #0052cd);
|
|
149
|
+
outline-offset: 1px;
|
|
150
|
+
}
|
|
151
|
+
`, vo = I.span`
|
|
152
|
+
color: var(--ethora-color-text-muted, #8c8c8c);
|
|
153
|
+
`, bo = I.span`
|
|
154
|
+
margin-left: 10px;
|
|
155
|
+
display: inline-block;
|
|
156
|
+
color: var(--ethora-color-text-muted, #8c8c8c);
|
|
157
|
+
font-size: 12px;
|
|
158
|
+
animation: ${(p) => p.$isOpen ? fo : uo} 0.3s ease
|
|
159
|
+
forwards;
|
|
160
|
+
`, yo = I.div`
|
|
161
|
+
position: absolute;
|
|
162
|
+
top: 100%;
|
|
163
|
+
left: 0;
|
|
164
|
+
right: 0;
|
|
165
|
+
border: 1px solid var(--ethora-color-border, #e6e8ec);
|
|
166
|
+
background-color: var(--ethora-color-bg, #fff);
|
|
167
|
+
max-height: 200px;
|
|
168
|
+
overflow-y: auto;
|
|
169
|
+
margin-top: 4px;
|
|
170
|
+
border-radius: var(--ethora-radius-md, 16px);
|
|
171
|
+
box-shadow: var(--ethora-shadow-md, 0 4px 12px rgba(16, 24, 40, 0.1));
|
|
172
|
+
z-index: 100;
|
|
173
|
+
${Pe}
|
|
174
|
+
`, wo = I.input`
|
|
175
|
+
width: 100%;
|
|
176
|
+
padding: 12px 16px;
|
|
177
|
+
border: none;
|
|
178
|
+
border-bottom: 1px solid var(--ethora-color-border, #e6e8ec);
|
|
179
|
+
outline: none;
|
|
180
|
+
box-sizing: border-box;
|
|
181
|
+
font-size: var(--ethora-font-size-sm, 14px);
|
|
182
|
+
background: transparent;
|
|
183
|
+
color: var(--ethora-color-text, #141414);
|
|
184
|
+
|
|
185
|
+
&::placeholder {
|
|
186
|
+
color: var(--ethora-color-text-muted, #8c8c8c);
|
|
187
|
+
}
|
|
188
|
+
`, se = I.div`
|
|
189
|
+
padding: 12px 16px;
|
|
190
|
+
cursor: pointer;
|
|
191
|
+
font-size: var(--ethora-font-size-sm, 14px);
|
|
192
|
+
color: var(--ethora-color-text, #141414);
|
|
193
|
+
background-color: ${({ $selected: p }) => p ? "var(--ethora-color-primary-soft, #e7edf9)" : "transparent"};
|
|
194
|
+
transition: background-color var(--ethora-motion-fast, 150ms);
|
|
195
|
+
|
|
196
|
+
&:hover {
|
|
197
|
+
background-color: ${({ $selected: p }) => p ? "var(--ethora-color-primary-soft, #e7edf9)" : "var(--ethora-color-bg-hover, #f0f2f5)"};
|
|
198
|
+
}
|
|
199
|
+
`, xo = ({
|
|
200
|
+
options: p,
|
|
201
|
+
placeholder: t,
|
|
202
|
+
onSelect: l,
|
|
203
|
+
accentColor: f,
|
|
204
|
+
selectedValue: e
|
|
205
|
+
}) => {
|
|
206
|
+
const i = _(), [n, a] = D(!1), [h, j] = D(
|
|
207
|
+
e
|
|
208
|
+
), [y, k] = D(""), v = ie(null), C = () => a((r) => !r), S = (r) => {
|
|
209
|
+
j(r), l(r), a(!1), k("");
|
|
210
|
+
}, x = p.filter(
|
|
211
|
+
(r) => r.name.toLowerCase().includes(y.toLowerCase())
|
|
212
|
+
), c = b(() => a(!1), []);
|
|
213
|
+
Ue({
|
|
214
|
+
enabled: n,
|
|
215
|
+
onClose: c,
|
|
216
|
+
kind: "menu",
|
|
217
|
+
insideRefs: [v],
|
|
218
|
+
closeOnOutsidePress: !0
|
|
219
|
+
});
|
|
220
|
+
const U = (r) => {
|
|
221
|
+
r.key === "Enter" || r.key === " " ? (r.preventDefault(), C()) : r.key === "Escape" && n && a(!1);
|
|
222
|
+
}, N = (r, A) => {
|
|
223
|
+
(r.key === "Enter" || r.key === " ") && (r.preventDefault(), S(A));
|
|
224
|
+
};
|
|
225
|
+
return /* @__PURE__ */ g(ho, { ref: v, children: [
|
|
226
|
+
/* @__PURE__ */ g(
|
|
227
|
+
go,
|
|
228
|
+
{
|
|
229
|
+
$isOpen: n,
|
|
230
|
+
onClick: C,
|
|
231
|
+
onKeyDown: U,
|
|
232
|
+
$borderColor: f,
|
|
233
|
+
role: "button",
|
|
234
|
+
tabIndex: 0,
|
|
235
|
+
"aria-haspopup": "listbox",
|
|
236
|
+
"aria-expanded": n,
|
|
237
|
+
children: [
|
|
238
|
+
h ? /* @__PURE__ */ o("span", { children: h.name }) : /* @__PURE__ */ o(vo, { children: t }),
|
|
239
|
+
/* @__PURE__ */ o(bo, { style: { color: f }, $isOpen: n, children: "▼" })
|
|
240
|
+
]
|
|
241
|
+
}
|
|
242
|
+
),
|
|
243
|
+
n && /* @__PURE__ */ g(yo, { role: "listbox", children: [
|
|
244
|
+
/* @__PURE__ */ o(
|
|
245
|
+
wo,
|
|
246
|
+
{
|
|
247
|
+
type: "text",
|
|
248
|
+
placeholder: i("search.placeholder"),
|
|
249
|
+
value: y,
|
|
250
|
+
onChange: (r) => k(r.target.value)
|
|
251
|
+
}
|
|
252
|
+
),
|
|
253
|
+
x.length > 0 ? x.map((r) => /* @__PURE__ */ o(
|
|
254
|
+
se,
|
|
255
|
+
{
|
|
256
|
+
onClick: () => S(r),
|
|
257
|
+
onKeyDown: (A) => N(A, r),
|
|
258
|
+
role: "option",
|
|
259
|
+
tabIndex: 0,
|
|
260
|
+
"aria-selected": h?.id === r.id,
|
|
261
|
+
$selected: h?.id === r.id,
|
|
262
|
+
children: r.name
|
|
263
|
+
},
|
|
264
|
+
r.id
|
|
265
|
+
)) : /* @__PURE__ */ o(se, { children: i("select.noOptions") })
|
|
266
|
+
] })
|
|
267
|
+
] });
|
|
268
|
+
}, Uo = ({
|
|
269
|
+
handleCloseModal: p
|
|
270
|
+
}) => {
|
|
271
|
+
const t = Re(), { client: l } = Fe();
|
|
272
|
+
je();
|
|
273
|
+
const { showToast: f } = Ae(), e = _(), { config: i, user: n, selectedUser: a, langSource: h } = O(
|
|
274
|
+
(s) => s.chatSettingStore
|
|
275
|
+
), j = O((s) => s.call.phase), y = O((s) => s.rooms.rooms), k = O(
|
|
276
|
+
(s) => s.rooms.activeRoomJID
|
|
277
|
+
), [v, C] = D(!1), S = ie(null), x = i?.videoCalls, c = i?.e2ee?.enabled === !0, U = x?.enabled === !0 && !!x?.livekitUrl?.trim() && (x?.allowedRoomTypes || ["private"]).includes("private"), N = U && x?.enableAudioCalls === !0, r = j !== "idle", A = b(() => {
|
|
278
|
+
t(Be()), p();
|
|
279
|
+
}, []), q = b(() => {
|
|
280
|
+
ze.performLogout();
|
|
281
|
+
}, []), fe = X(
|
|
282
|
+
() => [
|
|
283
|
+
{
|
|
284
|
+
label: e("action.logOut"),
|
|
285
|
+
icon: /* @__PURE__ */ o($e, {}),
|
|
286
|
+
onClick: () => {
|
|
287
|
+
q();
|
|
288
|
+
},
|
|
289
|
+
styles: { color: "var(--ethora-color-danger, #D92D20)" }
|
|
290
|
+
}
|
|
291
|
+
],
|
|
292
|
+
[q, e]
|
|
293
|
+
), ue = (s) => {
|
|
294
|
+
t(oo(s.id));
|
|
295
|
+
}, he = b(() => {
|
|
296
|
+
C(!0);
|
|
297
|
+
}, []), ge = async (s, d) => {
|
|
298
|
+
try {
|
|
299
|
+
const m = Ze(
|
|
300
|
+
s,
|
|
301
|
+
i?.xmppSettings?.conference,
|
|
302
|
+
d
|
|
303
|
+
);
|
|
304
|
+
if (!m || !m.jid)
|
|
305
|
+
return console.error(
|
|
306
|
+
"handleRoomCreation: failed to normalize new private room",
|
|
307
|
+
s
|
|
308
|
+
), f({
|
|
309
|
+
id: Date.now().toString(),
|
|
310
|
+
title: e("toast.error"),
|
|
311
|
+
message: e("toast.couldNotOpenPrivateChat"),
|
|
312
|
+
type: "error",
|
|
313
|
+
duration: 4e3
|
|
314
|
+
}), null;
|
|
315
|
+
if (t(
|
|
316
|
+
eo({
|
|
317
|
+
room: m,
|
|
318
|
+
xmpp: l
|
|
319
|
+
})
|
|
320
|
+
), l && m.jid) {
|
|
321
|
+
try {
|
|
322
|
+
await l.presenceInRoomStanza(m.jid);
|
|
323
|
+
} catch (w) {
|
|
324
|
+
console.warn("presenceInRoomStanza failed (non-fatal):", w);
|
|
325
|
+
}
|
|
326
|
+
try {
|
|
327
|
+
l.getHistoryStanza(m.jid, 10);
|
|
328
|
+
} catch (w) {
|
|
329
|
+
console.warn("getHistoryStanza failed (non-fatal):", w);
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
return t(te({ roomJID: m.jid })), f({
|
|
333
|
+
id: Date.now().toString(),
|
|
334
|
+
title: e("toast.success"),
|
|
335
|
+
message: e("toast.roomCreatedSuccess"),
|
|
336
|
+
type: "success",
|
|
337
|
+
duration: 3e3
|
|
338
|
+
}), { jid: m.jid };
|
|
339
|
+
} catch (m) {
|
|
340
|
+
return console.error("Error handling room creation:", m), null;
|
|
341
|
+
}
|
|
342
|
+
}, z = b(async (s = !1) => {
|
|
343
|
+
const d = String(
|
|
344
|
+
a?.name || `${a?.firstName || ""} ${a?.lastName || ""}`
|
|
345
|
+
).trim() || "";
|
|
346
|
+
if (i?.newArch !== !1) {
|
|
347
|
+
const H = a?.xmppUsername || a?.userJID || a?.id;
|
|
348
|
+
if (!H)
|
|
349
|
+
return f({
|
|
350
|
+
id: Date.now().toString(),
|
|
351
|
+
title: e("toast.error"),
|
|
352
|
+
message: e("toast.couldNotResolveRecipient"),
|
|
353
|
+
type: "error",
|
|
354
|
+
duration: 4e3
|
|
355
|
+
}), null;
|
|
356
|
+
try {
|
|
357
|
+
const E = await Ee(H, s), J = await ge(E, 2);
|
|
358
|
+
return J?.jid ? {
|
|
359
|
+
jid: J.jid,
|
|
360
|
+
bareName: J.jid.split("@")[0],
|
|
361
|
+
peerXmppUsername: String(H).split("@")[0],
|
|
362
|
+
peerDisplay: d
|
|
363
|
+
} : null;
|
|
364
|
+
} catch (E) {
|
|
365
|
+
return console.error("postPrivateRoom failed:", E), f({
|
|
366
|
+
id: Date.now().toString(),
|
|
367
|
+
title: e("toast.error"),
|
|
368
|
+
message: E?.message || e("toast.failedToCreatePrivateChat"),
|
|
369
|
+
type: "error",
|
|
370
|
+
duration: 4e3
|
|
371
|
+
}), null;
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
const m = re(a.id), ae = [re(n.defaultWallet.walletAddress), m].sort().join(".").toLowerCase(), R = [n.firstName, a.name?.split(" ")?.[0]].sort().join(" and "), B = await l.createPrivateRoomStanza(
|
|
375
|
+
R,
|
|
376
|
+
`Private chat ${R}`,
|
|
377
|
+
ae
|
|
378
|
+
);
|
|
379
|
+
return B && (await l.inviteRoomRequestStanza(m, B), await l.getRoomsStanza()), B ? {
|
|
380
|
+
jid: B,
|
|
381
|
+
bareName: String(B).split("@")[0],
|
|
382
|
+
peerXmppUsername: m,
|
|
383
|
+
peerDisplay: d
|
|
384
|
+
} : null;
|
|
385
|
+
}, [a, i?.newArch, l, n]), $ = b(
|
|
386
|
+
async (s) => {
|
|
387
|
+
f({
|
|
388
|
+
id: Date.now().toString(),
|
|
389
|
+
title: e("toast.roomCreationTitle"),
|
|
390
|
+
message: e("toast.roomCreating"),
|
|
391
|
+
type: "info",
|
|
392
|
+
duration: 3e3
|
|
393
|
+
}), await z(s), t(K());
|
|
394
|
+
},
|
|
395
|
+
[z, t, f, e]
|
|
396
|
+
), Q = b(
|
|
397
|
+
() => $(!1),
|
|
398
|
+
[$]
|
|
399
|
+
), Y = b(
|
|
400
|
+
() => $(!0),
|
|
401
|
+
[$]
|
|
402
|
+
), M = b(
|
|
403
|
+
async (s) => {
|
|
404
|
+
const d = await z();
|
|
405
|
+
if (!d) return;
|
|
406
|
+
const m = d.peerDisplay || d.bareName;
|
|
407
|
+
t(
|
|
408
|
+
Oe({
|
|
409
|
+
roomJid: d.jid,
|
|
410
|
+
roomName: m,
|
|
411
|
+
roomBareName: d.bareName,
|
|
412
|
+
kind: s,
|
|
413
|
+
peerXmppUsername: d.peerXmppUsername || null
|
|
414
|
+
})
|
|
415
|
+
), d.peerXmppUsername && Te(s, {
|
|
416
|
+
peerXmppUsername: d.peerXmppUsername,
|
|
417
|
+
roomBareName: d.bareName
|
|
418
|
+
}), t(K());
|
|
419
|
+
try {
|
|
420
|
+
await Le(d.bareName, { kind: s });
|
|
421
|
+
} catch (w) {
|
|
422
|
+
const P = w instanceof Error ? w.message : e("toast.failedToCreateCall");
|
|
423
|
+
t(Me(P));
|
|
424
|
+
}
|
|
425
|
+
},
|
|
426
|
+
[z, t, e]
|
|
427
|
+
), Z = !!a && i?.features?.userBlock === !0 && !i?.disableUserBlock, ee = b(async () => {
|
|
428
|
+
const s = a?.xmppUsername || a?.userJID || a?.id;
|
|
429
|
+
if (s)
|
|
430
|
+
try {
|
|
431
|
+
await He(s);
|
|
432
|
+
const d = String(s).split("@")[0];
|
|
433
|
+
t(Je(d));
|
|
434
|
+
const m = n?.xmppUsername || "";
|
|
435
|
+
let w = !1;
|
|
436
|
+
Object.values(y || {}).forEach((P) => {
|
|
437
|
+
P.type !== "private" || !(P.members || []).some(
|
|
438
|
+
(R) => R.xmppUsername && R.xmppUsername !== m && R.xmppUsername.split("@")[0] === d
|
|
439
|
+
) || (t(Xe({ jid: P.jid })), P.jid === k && (w = !0));
|
|
440
|
+
}), w && (typeof window < "u" && window.history.pushState(null, "", window.location.pathname), t(te({ roomJID: null }))), t(K()), f({
|
|
441
|
+
id: Date.now().toString(),
|
|
442
|
+
title: e("toast.success"),
|
|
443
|
+
message: e("toast.blockedSuccess"),
|
|
444
|
+
type: "success"
|
|
445
|
+
});
|
|
446
|
+
} catch (d) {
|
|
447
|
+
le.log("Block user failed", d), f({
|
|
448
|
+
id: Date.now().toString(),
|
|
449
|
+
title: e("toast.error"),
|
|
450
|
+
message: e("toast.blockFailed"),
|
|
451
|
+
type: "error"
|
|
452
|
+
});
|
|
453
|
+
}
|
|
454
|
+
}, [a, t, f, e, n?.xmppUsername, y, k]), u = a ?? n, ve = () => {
|
|
455
|
+
if (h)
|
|
456
|
+
return ne.find((s) => s.id === h);
|
|
457
|
+
}, be = a ? void 0 : /* @__PURE__ */ g(T, { children: [
|
|
458
|
+
/* @__PURE__ */ o(V, { onClick: he, "aria-label": e("action.editProfile"), children: /* @__PURE__ */ o(We, { color: "var(--ethora-color-text-muted, #8C8C8C)" }) }),
|
|
459
|
+
/* @__PURE__ */ o(
|
|
460
|
+
Ke,
|
|
461
|
+
{
|
|
462
|
+
options: fe,
|
|
463
|
+
position: "left",
|
|
464
|
+
menuIcon: /* @__PURE__ */ o(Ve, {})
|
|
465
|
+
}
|
|
466
|
+
)
|
|
467
|
+
] }), ye = /* @__PURE__ */ g(T, { children: [
|
|
468
|
+
/* @__PURE__ */ o(
|
|
469
|
+
V,
|
|
470
|
+
{
|
|
471
|
+
variant: "ghost",
|
|
472
|
+
onClick: () => C(!1),
|
|
473
|
+
style: { width: "auto", padding: "0 var(--ethora-space-3, 12px)" },
|
|
474
|
+
children: e("action.cancel")
|
|
475
|
+
}
|
|
476
|
+
),
|
|
477
|
+
/* @__PURE__ */ o(
|
|
478
|
+
V,
|
|
479
|
+
{
|
|
480
|
+
variant: "filled",
|
|
481
|
+
onClick: () => {
|
|
482
|
+
S.current?.save();
|
|
483
|
+
},
|
|
484
|
+
style: { width: "auto", padding: "0 var(--ethora-space-4, 16px)" },
|
|
485
|
+
children: e("action.save")
|
|
486
|
+
}
|
|
487
|
+
)
|
|
488
|
+
] }), oe = a && a.xmppUsername !== n.xmppUsername && !i?.disableProfilesInteractions, we = X(
|
|
489
|
+
() => /* @__PURE__ */ g(T, { children: [
|
|
490
|
+
/* @__PURE__ */ g(pe, { children: [
|
|
491
|
+
/* @__PURE__ */ o(
|
|
492
|
+
ce,
|
|
493
|
+
{
|
|
494
|
+
icon: u?.profileImage ?? null,
|
|
495
|
+
name: u?.name ?? u?.firstName,
|
|
496
|
+
size: 96
|
|
497
|
+
}
|
|
498
|
+
),
|
|
499
|
+
/* @__PURE__ */ o(so, { children: u?.name ? `${u?.name}` : `${u?.firstName} ${u?.lastName}` })
|
|
500
|
+
] }),
|
|
501
|
+
/* @__PURE__ */ g(L, { children: [
|
|
502
|
+
/* @__PURE__ */ o(G, { children: e("modal.profile.about") }),
|
|
503
|
+
/* @__PURE__ */ o(
|
|
504
|
+
io,
|
|
505
|
+
{
|
|
506
|
+
$empty: !(u?.description && u?.description?.length > 4),
|
|
507
|
+
children: u?.description && u?.description?.length > 4 ? u.description : e("modal.profile.noDescription")
|
|
508
|
+
}
|
|
509
|
+
)
|
|
510
|
+
] }),
|
|
511
|
+
!a && i?.translates?.enabled && /* @__PURE__ */ g(L, { children: [
|
|
512
|
+
/* @__PURE__ */ o(G, { children: e("modal.profile.preferences") }),
|
|
513
|
+
/* @__PURE__ */ o(ao, { children: /* @__PURE__ */ g(ro, { children: [
|
|
514
|
+
/* @__PURE__ */ o(to, { children: e("modal.profile.languageHint") }),
|
|
515
|
+
/* @__PURE__ */ o(
|
|
516
|
+
xo,
|
|
517
|
+
{
|
|
518
|
+
options: ne,
|
|
519
|
+
placeholder: e("language.select"),
|
|
520
|
+
onSelect: ue,
|
|
521
|
+
accentColor: i?.colors?.primary,
|
|
522
|
+
selectedValue: ve()
|
|
523
|
+
}
|
|
524
|
+
)
|
|
525
|
+
] }) })
|
|
526
|
+
] }),
|
|
527
|
+
oe && /* @__PURE__ */ g(L, { children: [
|
|
528
|
+
/* @__PURE__ */ o(G, { children: e("modal.profile.actions") }),
|
|
529
|
+
/* @__PURE__ */ g(lo, { children: [
|
|
530
|
+
/* @__PURE__ */ o(
|
|
531
|
+
F,
|
|
532
|
+
{
|
|
533
|
+
StartIcon: /* @__PURE__ */ o(Ge, {}),
|
|
534
|
+
onClick: Q,
|
|
535
|
+
variant: "filled",
|
|
536
|
+
children: e("action.message")
|
|
537
|
+
}
|
|
538
|
+
),
|
|
539
|
+
c && /* @__PURE__ */ o(
|
|
540
|
+
F,
|
|
541
|
+
{
|
|
542
|
+
StartIcon: /* @__PURE__ */ o(_e, { color: "var(--ethora-color-text-on-primary, #FFFFFF)" }),
|
|
543
|
+
onClick: Y,
|
|
544
|
+
variant: "filled",
|
|
545
|
+
children: e("action.encryptedMessage")
|
|
546
|
+
}
|
|
547
|
+
),
|
|
548
|
+
U && /* @__PURE__ */ o(
|
|
549
|
+
F,
|
|
550
|
+
{
|
|
551
|
+
StartIcon: /* @__PURE__ */ o(qe, { color: "var(--ethora-color-text-on-primary, #FFFFFF)" }),
|
|
552
|
+
onClick: () => {
|
|
553
|
+
M("video");
|
|
554
|
+
},
|
|
555
|
+
disabled: r,
|
|
556
|
+
variant: "filled",
|
|
557
|
+
children: e(N ? "action.videoCall" : "action.call")
|
|
558
|
+
}
|
|
559
|
+
),
|
|
560
|
+
N && /* @__PURE__ */ o(
|
|
561
|
+
F,
|
|
562
|
+
{
|
|
563
|
+
StartIcon: /* @__PURE__ */ o(Qe, { color: "var(--ethora-color-text-on-primary, #FFFFFF)" }),
|
|
564
|
+
onClick: () => {
|
|
565
|
+
M("audio");
|
|
566
|
+
},
|
|
567
|
+
disabled: r,
|
|
568
|
+
variant: "filled",
|
|
569
|
+
children: e("action.audioCall")
|
|
570
|
+
}
|
|
571
|
+
),
|
|
572
|
+
/* @__PURE__ */ o(
|
|
573
|
+
F,
|
|
574
|
+
{
|
|
575
|
+
onClick: () => co(a.id),
|
|
576
|
+
variant: "outlined",
|
|
577
|
+
children: e("action.copyUserId")
|
|
578
|
+
}
|
|
579
|
+
),
|
|
580
|
+
Z && /* @__PURE__ */ o(
|
|
581
|
+
F,
|
|
582
|
+
{
|
|
583
|
+
StartIcon: /* @__PURE__ */ o(Ye, {}),
|
|
584
|
+
onClick: ee,
|
|
585
|
+
variant: "outlined",
|
|
586
|
+
style: { color: "var(--ethora-color-danger, #D92D20)", borderColor: "var(--ethora-color-danger, #D92D20)" },
|
|
587
|
+
children: e("action.block")
|
|
588
|
+
}
|
|
589
|
+
)
|
|
590
|
+
] })
|
|
591
|
+
] })
|
|
592
|
+
] }),
|
|
593
|
+
[
|
|
594
|
+
u,
|
|
595
|
+
U,
|
|
596
|
+
Z,
|
|
597
|
+
N,
|
|
598
|
+
r,
|
|
599
|
+
M,
|
|
600
|
+
ee,
|
|
601
|
+
Q,
|
|
602
|
+
Y,
|
|
603
|
+
c,
|
|
604
|
+
a,
|
|
605
|
+
oe,
|
|
606
|
+
n,
|
|
607
|
+
i,
|
|
608
|
+
h,
|
|
609
|
+
e
|
|
610
|
+
]
|
|
611
|
+
), xe = X(
|
|
612
|
+
() => /* @__PURE__ */ o(
|
|
613
|
+
me,
|
|
614
|
+
{
|
|
615
|
+
ref: S,
|
|
616
|
+
setIsEditing: C,
|
|
617
|
+
modalUser: u,
|
|
618
|
+
config: i
|
|
619
|
+
}
|
|
620
|
+
),
|
|
621
|
+
[u]
|
|
622
|
+
);
|
|
623
|
+
return /* @__PURE__ */ o(
|
|
624
|
+
no,
|
|
625
|
+
{
|
|
626
|
+
title: e("modal.profile.title"),
|
|
627
|
+
onClose: A,
|
|
628
|
+
headerActions: v ? ye : be,
|
|
629
|
+
children: v ? xe : we
|
|
630
|
+
}
|
|
631
|
+
);
|
|
632
|
+
};
|
|
633
|
+
export {
|
|
634
|
+
Uo as default
|
|
635
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as i, jsxs as r } from "react/jsx-runtime";
|
|
2
2
|
import m, { useCallback as D, useMemo as h } from "react";
|
|
3
|
-
import {
|
|
4
|
-
import { S as b, D as u, a as
|
|
3
|
+
import { M as g, a as p, N as w, O as l } from "./main-CpHMnydn.js";
|
|
4
|
+
import { S as b, D as u, a as k, b as y, c as S, d as f } from "./SideDrawer-CqZl9sxK.js";
|
|
5
5
|
const T = ({
|
|
6
6
|
handleCloseModal: n
|
|
7
7
|
}) => {
|
|
@@ -31,8 +31,8 @@ const T = ({
|
|
|
31
31
|
[t]
|
|
32
32
|
);
|
|
33
33
|
return /* @__PURE__ */ i(b, { title: t("settings.menu.title"), onClose: n, children: c.map((e) => /* @__PURE__ */ r(u, { children: [
|
|
34
|
-
/* @__PURE__ */ i(
|
|
35
|
-
/* @__PURE__ */ i(
|
|
34
|
+
/* @__PURE__ */ i(k, { children: e.title }),
|
|
35
|
+
/* @__PURE__ */ i(y, { children: e.rows.map((a, d) => /* @__PURE__ */ r(m.Fragment, { children: [
|
|
36
36
|
d > 0 && /* @__PURE__ */ i(S, {}),
|
|
37
37
|
/* @__PURE__ */ i(
|
|
38
38
|
f,
|