@easemob-community/uikit-sdk-websdk5 1.6.1 → 1.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/dist/adapter/conversation-adapter.d.ts.map +1 -1
  2. package/dist/adapter/internal-stores/group.d.ts.map +1 -1
  3. package/dist/adapter/internal-stores/user-info.d.ts.map +1 -1
  4. package/dist/adapter/repositories/user-info.d.ts.map +1 -1
  5. package/dist/adapter/user-info-cache.d.ts +10 -0
  6. package/dist/adapter/user-info-cache.d.ts.map +1 -0
  7. package/dist/adapter/user-info-cache.test.d.ts +2 -0
  8. package/dist/adapter/user-info-cache.test.d.ts.map +1 -0
  9. package/dist/adapter.d.ts.map +1 -1
  10. package/dist/client.d.ts +2 -0
  11. package/dist/client.d.ts.map +1 -1
  12. package/dist/domain/__tests__/group-members.test.d.ts +2 -0
  13. package/dist/domain/__tests__/group-members.test.d.ts.map +1 -0
  14. package/dist/domain/__tests__/presence-batching.test.d.ts +2 -0
  15. package/dist/domain/__tests__/presence-batching.test.d.ts.map +1 -0
  16. package/dist/domain/conversation-domain.d.ts +2 -0
  17. package/dist/domain/conversation-domain.d.ts.map +1 -1
  18. package/dist/domain/group-domain.d.ts +1 -0
  19. package/dist/domain/group-domain.d.ts.map +1 -1
  20. package/dist/domain/presence-domain.d.ts +12 -3
  21. package/dist/domain/presence-domain.d.ts.map +1 -1
  22. package/dist/domain/user-info-domain.d.ts +10 -7
  23. package/dist/domain/user-info-domain.d.ts.map +1 -1
  24. package/dist/easemob-uikit-sdk-websdk5.js +1287 -995
  25. package/dist/easemob-uikit-sdk-websdk5.umd.cjs +1 -1
  26. package/dist/event/__tests__/conversation-mute.test.d.ts +2 -0
  27. package/dist/event/__tests__/conversation-mute.test.d.ts.map +1 -0
  28. package/dist/event/chat-events.d.ts.map +1 -1
  29. package/dist/event/connection-events.d.ts +3 -0
  30. package/dist/event/connection-events.d.ts.map +1 -1
  31. package/dist/event/conversation-mute.d.ts +56 -0
  32. package/dist/event/conversation-mute.d.ts.map +1 -0
  33. package/dist/event/types.d.ts +2 -0
  34. package/dist/event/types.d.ts.map +1 -1
  35. package/dist/utils/__tests__/conversation-log.test.d.ts +2 -0
  36. package/dist/utils/__tests__/conversation-log.test.d.ts.map +1 -0
  37. package/dist/utils/conversation-log.d.ts +15 -0
  38. package/dist/utils/conversation-log.d.ts.map +1 -0
  39. package/package.json +2 -2
@@ -1,33 +1,33 @@
1
- import { ChatClient as it, isSDKError as Ve, ChatManager as qe, ChatRoomManager as at, UserInfoManager as We, ContactManager as ct, GroupManager as ut, PresenceManager as dt, PushManager as lt } from "easemob-websdk";
2
- import { log as Ce, customEventPreviewMap as gt, mergeMessagePreviewLabels as Je, MESSAGE_TYPE as b, resolveMultiBodyPreview as $e, isTextBody as ft, isImageBody as mt, MESSAGE_EXT_KEY as Qe, isVoiceBody as ze, isVideoBody as pt, isFileBody as ht, isLocationBody as vt, isCustomBody as It, isCmdBody as Mt, isCombineBody as Ye, CONVERSATION_TYPE as I, normalizeUserId as E, MESSAGE_STATUS as O, isMultiBody as yt, createLogger as T, toMessageRecord as we, formatConversationPreview as Xe, GROUP_MEMBER_ROLE as k, PRESENCE_STATUS as X, isKickErrorCode as bt, resolveLastMessageText as Ct, isStreamActive as wt, toConversationRecord as _e, NOTICE_EVENT_TYPE as A, SDK_CONTRACT_VERSION as St, normalizeLoginUserId as At } from "@easemob-community/uikit-sdk-contract";
3
- import { normalizeUserId as rs } from "@easemob-community/uikit-sdk-contract";
4
- import { markRaw as Ne, computed as me, reactive as Gt } from "vue";
5
- let ce = null;
6
- function qn(s) {
7
- ce = s;
1
+ import { ChatClient as It, isSDKError as et, ChatManager as tt, ChatRoomManager as Mt, UserInfoManager as nt, ContactManager as yt, GroupManager as Ct, PresenceManager as bt, PushManager as wt } from "easemob-websdk";
2
+ import { log as Le, GROUP_MEMBER_ROLE as R, customEventPreviewMap as St, mergeMessagePreviewLabels as st, MESSAGE_TYPE as b, resolveMultiBodyPreview as rt, isTextBody as At, isImageBody as Et, MESSAGE_EXT_KEY as ot, isVoiceBody as it, isVideoBody as Gt, isFileBody as Tt, isLocationBody as Ut, isCustomBody as Rt, isCmdBody as Lt, isCombineBody as at, CONVERSATION_TYPE as I, normalizeUserId as G, MESSAGE_STATUS as k, isMultiBody as _t, createLogger as T, toMessageRecord as _e, formatConversationPreview as ct, PRESENCE_STATUS as ee, isKickErrorCode as Dt, resolveLastMessageText as Nt, isStreamActive as kt, toConversationRecord as Ke, NOTICE_EVENT_TYPE as E, SDK_CONTRACT_VERSION as Ot, normalizeLoginUserId as xt } from "@easemob-community/uikit-sdk-contract";
3
+ import { normalizeUserId as Es } from "@easemob-community/uikit-sdk-contract";
4
+ import { markRaw as qe, computed as Me, reactive as Pt } from "vue";
5
+ let de = null;
6
+ function gs(s) {
7
+ de = s;
8
8
  }
9
- function Et(s) {
10
- ce == null || ce(s);
9
+ function Bt(s) {
10
+ de == null || de(s);
11
11
  }
12
- const Ze = "uikit-sdk-log-capture", Tt = /^%c\[Chat\]\[(DEBUG|WARN|ERROR)\]\[[^\]]*\]/, et = {
12
+ const ut = "uikit-sdk-log-capture", Ft = /^%c\[Chat\]\[(DEBUG|WARN|ERROR)\]\[[^\]]*\]/, dt = {
13
13
  DEBUG: "debug",
14
14
  WARN: "warn",
15
15
  ERROR: "error"
16
16
  };
17
- let Q = !1, K = null, V = null, ue = null, Se = !1, H = null, de = null;
18
- function Rt(s) {
19
- de = s;
17
+ let z = !1, j = null, W = null, le = null, De = !1, q = null, fe = null;
18
+ function Ht(s) {
19
+ fe = s;
20
20
  }
21
- function ee(s, e, t) {
22
- Q && Et({
23
- level: et[s],
21
+ function ne(s, e, t) {
22
+ z && Bt({
23
+ level: dt[s],
24
24
  source: "sdk",
25
25
  message: typeof e == "string" ? e : String(e),
26
26
  args: t
27
27
  });
28
28
  }
29
- function pe(s, e, t) {
30
- const n = V ?? console.log, o = (/* @__PURE__ */ new Date()).toISOString().slice(11, 23);
29
+ function ye(s, e, t) {
30
+ const n = W ?? console.log, o = (/* @__PURE__ */ new Date()).toISOString().slice(11, 23);
31
31
  n.call(
32
32
  console,
33
33
  `%c[Chat][${s}][${o}]`,
@@ -36,72 +36,72 @@ function pe(s, e, t) {
36
36
  ...t
37
37
  );
38
38
  }
39
- function Ut() {
40
- V || (V = console.log, console.log = (...s) => {
39
+ function Kt() {
40
+ W || (W = console.log, console.log = (...s) => {
41
41
  try {
42
42
  const e = s[0];
43
43
  if (typeof e == "string") {
44
- const t = e.match(Tt);
45
- t && ee(t[1], s[2], s.slice(3));
44
+ const t = e.match(Ft);
45
+ t && ne(t[1], s[2], s.slice(3));
46
46
  }
47
47
  } catch {
48
48
  }
49
- V.apply(console, s);
49
+ W.apply(console, s);
50
50
  });
51
51
  }
52
- function Lt() {
53
- V && (console.log = V, V = null);
52
+ function qt() {
53
+ W && (console.log = W, W = null);
54
54
  }
55
- async function Wn() {
55
+ async function ms() {
56
56
  var s;
57
- if (!Q) {
58
- Q = !0;
57
+ if (!z) {
58
+ z = !0;
59
59
  try {
60
60
  const e = await import("easemob-websdk");
61
- typeof e.setLogLevel == "function" && (e.setLogLevel("DEBUG"), Se = !0);
61
+ typeof e.setLogLevel == "function" && (e.setLogLevel("DEBUG"), De = !0);
62
62
  const t = e.LogEventName ? (s = e.ChatClient) == null ? void 0 : s.instance : null;
63
- t && typeof t.addEventHandler == "function" ? (t.addEventHandler(Ze, {
63
+ t && typeof t.addEventHandler == "function" ? (t.addEventHandler(ut, {
64
64
  onLog: (n) => {
65
65
  const o = n;
66
- o && typeof o.level == "string" && o.level in et && ee(o.level, o.message, [...o.args ?? []]);
66
+ o && typeof o.level == "string" && o.level in dt && ne(o.level, o.message, [...o.args ?? []]);
67
67
  }
68
- }), H = t, K = "onlog") : typeof e.setLogger == "function" ? (ue = typeof e.getLogger == "function" ? e.getLogger() : null, e.setLogger({
68
+ }), q = t, j = "onlog") : typeof e.setLogger == "function" ? (le = typeof e.getLogger == "function" ? e.getLogger() : null, e.setLogger({
69
69
  debug: (n, ...o) => {
70
- ee("DEBUG", n, o), pe("DEBUG", n, o);
70
+ ne("DEBUG", n, o), ye("DEBUG", n, o);
71
71
  },
72
72
  warn: (n, ...o) => {
73
- ee("WARN", n, o), pe("WARN", n, o);
73
+ ne("WARN", n, o), ye("WARN", n, o);
74
74
  },
75
75
  error: (n, ...o) => {
76
- ee("ERROR", n, o), pe("ERROR", n, o);
76
+ ne("ERROR", n, o), ye("ERROR", n, o);
77
77
  }
78
- }), K = "inject") : (Ut(), K = "console");
78
+ }), j = "inject") : (Kt(), j = "console");
79
79
  } catch (e) {
80
- Q = !1, console.warn("[UIKit:SdkLogCapture] failed to enable SDK log capture", e);
80
+ z = !1, console.warn("[UIKit:SdkLogCapture] failed to enable SDK log capture", e);
81
81
  }
82
82
  }
83
83
  }
84
- async function Jn() {
84
+ async function ps() {
85
85
  var s;
86
- if (Q) {
87
- Q = !1;
86
+ if (z) {
87
+ z = !1;
88
88
  try {
89
- K === "console" && Lt(), K === "onlog" && ((s = H == null ? void 0 : H.removeEventHandler) == null || s.call(H, Ze));
89
+ j === "console" && qt(), j === "onlog" && ((s = q == null ? void 0 : q.removeEventHandler) == null || s.call(q, ut));
90
90
  const e = await import("easemob-websdk");
91
- K === "inject" && typeof e.setLogger == "function" && ue && e.setLogger(ue), Se && !(de != null && de()) && typeof e.setLogLevel == "function" && e.setLogLevel("WARN");
91
+ j === "inject" && typeof e.setLogger == "function" && le && e.setLogger(le), De && !(fe != null && fe()) && typeof e.setLogLevel == "function" && e.setLogLevel("WARN");
92
92
  } catch {
93
93
  } finally {
94
- K = null, H = null, ue = null, Se = !1;
94
+ j = null, q = null, le = null, De = !1;
95
95
  }
96
96
  }
97
97
  }
98
- let Re = !1;
99
- function $n() {
100
- return Re;
98
+ let Pe = !1;
99
+ function hs() {
100
+ return Pe;
101
101
  }
102
- let tt = null;
103
- function Dt(s) {
104
- const e = tt;
102
+ let lt = null;
103
+ function jt(s) {
104
+ const e = lt;
105
105
  if (!e)
106
106
  return s;
107
107
  if (s.appKey !== e.appKey || s.appId !== e.appId)
@@ -111,13 +111,13 @@ function Dt(s) {
111
111
  const { managers: t, ...n } = s, o = [];
112
112
  for (const a of Object.keys(n))
113
113
  JSON.stringify(n[a]) !== JSON.stringify(e[a]) && o.push(a);
114
- return o.length > 0 && Ce(
114
+ return o.length > 0 && Le(
115
115
  "[UIKit] SDK 已初始化,本次 init 配置以首次初始化为准(忽略字段:%s)。",
116
116
  o.join(", ")
117
117
  ), { ...e, managers: t };
118
118
  }
119
- Rt(() => Re);
120
- class _t {
119
+ Ht(() => Pe);
120
+ class Vt {
121
121
  constructor(e) {
122
122
  var i;
123
123
  const { debug: t, clientName: n = "UIKit", clientVersion: o, ...a } = e;
@@ -125,25 +125,25 @@ class _t {
125
125
  throw new Error(
126
126
  "[UIKit] ClientConfig.managers 未注入:SDK manager 列表由 adapter 负责传入"
127
127
  );
128
- const r = Dt({
128
+ const r = jt({
129
129
  ...a,
130
130
  enableUserInfoSync: a.enableUserInfoSync ?? !0,
131
131
  managers: a.managers
132
132
  });
133
- this._deleteConversationOnGroupDestroyed = r.deleteConversationOnGroupDestroyed ?? !0, this._client = it.init(r), tt = r, t && (Re = !0, import("easemob-websdk").then(({ setLogLevel: c }) => {
133
+ this._deleteConversationOnGroupDestroyed = r.deleteConversationOnGroupDestroyed ?? !0, this._client = It.init(r), lt = r, t && (Pe = !0, import("easemob-websdk").then(({ setLogLevel: c }) => {
134
134
  c("DEBUG");
135
- })), o ? Ce(
135
+ })), o ? Le(
136
136
  "%c[Easemob] SDK version: %s, %s version: %s, Adapter version: %s",
137
137
  "color: green; font-weight: bold;",
138
- "5.2.0",
138
+ "5.2.1",
139
139
  n,
140
140
  o,
141
- "1.6.1"
142
- ) : Ce(
141
+ "1.7.0"
142
+ ) : Le(
143
143
  "%c[Easemob] SDK version: %s, Adapter version: %s",
144
144
  "color: green; font-weight: bold;",
145
- "5.2.0",
146
- "1.6.1"
145
+ "5.2.1",
146
+ "1.7.0"
147
147
  );
148
148
  }
149
149
  get chatManager() {
@@ -179,6 +179,12 @@ class _t {
179
179
  get currentUserId() {
180
180
  return this._client.getCurrentUserId();
181
181
  }
182
+ /** SDK internal 缓存入口的安全委托,由 adapter 内结构类型消费。 */
183
+ getCacheManager() {
184
+ var t;
185
+ const e = this._client;
186
+ return ((t = e.getCacheManager) == null ? void 0 : t.call(e)) ?? null;
187
+ }
182
188
  addEventHandler(e, t) {
183
189
  this._client.addEventHandler(e, t);
184
190
  }
@@ -192,10 +198,10 @@ class _t {
192
198
  return this._client.logout();
193
199
  }
194
200
  }
195
- function Nt(s) {
196
- return new _t(s);
201
+ function Wt(s) {
202
+ return new Vt(s);
197
203
  }
198
- function kt(s, e) {
204
+ function Jt(s, e) {
199
205
  let t = !1, n = !1, o = !1;
200
206
  function a() {
201
207
  return n ? "connecting" : t ? "connected" : o ? "reconnectFailed" : "disconnected";
@@ -225,7 +231,7 @@ function kt(s, e) {
225
231
  }
226
232
  };
227
233
  }
228
- function Ot(s) {
234
+ function $t(s) {
229
235
  let e = [], t = [];
230
236
  function o() {
231
237
  var r, i;
@@ -247,18 +253,18 @@ function Ot(s) {
247
253
  },
248
254
  addContact(r) {
249
255
  var c, u;
250
- const i = e.findIndex((f) => f.userId === r.userId);
256
+ const i = e.findIndex((l) => l.userId === r.userId);
251
257
  i >= 0 ? e[i] = { ...e[i], ...r } : e.push(r), o(), (u = (c = s()) == null ? void 0 : c.onContactUpdated) == null || u.call(c, r);
252
258
  },
253
259
  removeContact(r) {
254
260
  var c, u;
255
- const i = e.find((f) => f.userId === r);
256
- e = e.filter((f) => f.userId !== r), i && (o(), (u = (c = s()) == null ? void 0 : c.onContactUpdated) == null || u.call(c, i));
261
+ const i = e.find((l) => l.userId === r);
262
+ e = e.filter((l) => l.userId !== r), i && (o(), (u = (c = s()) == null ? void 0 : c.onContactUpdated) == null || u.call(c, i));
257
263
  },
258
264
  updateRemark(r, i) {
259
- var u, f;
260
- const c = e.findIndex((m) => m.userId === r);
261
- c < 0 || (e[c] = { ...e[c], remark: i, name: i || e[c].name }, o(), (f = (u = s()) == null ? void 0 : u.onContactUpdated) == null || f.call(u, e[c]));
265
+ var u, l;
266
+ const c = e.findIndex((g) => g.userId === r);
267
+ c < 0 || (e[c] = { ...e[c], remark: i, name: i || e[c].name }, o(), (l = (u = s()) == null ? void 0 : u.onContactUpdated) == null || l.call(u, e[c]));
262
268
  },
263
269
  setBlocklist(r) {
264
270
  },
@@ -287,7 +293,7 @@ function Ot(s) {
287
293
  }
288
294
  };
289
295
  }
290
- function xt(s) {
296
+ function Qt(s) {
291
297
  let e = [], t = null, n = !1;
292
298
  function o() {
293
299
  var a, r;
@@ -317,7 +323,7 @@ function xt(s) {
317
323
  },
318
324
  update(a, r) {
319
325
  var c, u;
320
- const i = e.findIndex((f) => f.id === a);
326
+ const i = e.findIndex((l) => l.id === a);
321
327
  i < 0 || (e[i] = { ...e[i], ...r }, o(), (u = (c = s()) == null ? void 0 : c.onConversationUpdated) == null || u.call(c, { id: a, conversation: r }));
322
328
  },
323
329
  setConversationList(a) {
@@ -349,148 +355,159 @@ function xt(s) {
349
355
  }
350
356
  };
351
357
  }
352
- function Pt(s) {
358
+ function zt(s) {
353
359
  let e = [];
354
- const t = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map(), c = /* @__PURE__ */ new Map(), u = /* @__PURE__ */ new Set(), f = !1;
355
- function m() {
356
- var g, d;
357
- (d = (g = s()) == null ? void 0 : g.onGroupChange) == null || d.call(g, e);
360
+ const t = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map(), c = /* @__PURE__ */ new Map(), u = /* @__PURE__ */ new Set(), l = !1;
361
+ function g() {
362
+ var d, f;
363
+ (f = (d = s()) == null ? void 0 : d.onGroupChange) == null || f.call(d, e);
364
+ }
365
+ function p(d, f) {
366
+ const m = new Map(d.map((h) => [h.userId, h.role]));
367
+ return f.map((h) => {
368
+ const v = m.get(h.userId);
369
+ return v === R.ADMIN && h.role === R.MEMBER ? { ...h, role: v } : h;
370
+ });
358
371
  }
359
372
  return {
360
373
  get groupList() {
361
374
  return e;
362
375
  },
363
376
  get loaded() {
364
- return f;
365
- },
366
- setList(g) {
367
- e = g, m();
368
- },
369
- addGroup(g) {
370
- var l, p;
371
- const d = e.findIndex((h) => h.groupId === g.groupId);
372
- d >= 0 ? e[d] = { ...e[d], ...g } : e.push(g), m(), (p = (l = s()) == null ? void 0 : l.onGroupUpdated) == null || p.call(l, g);
373
- },
374
- removeGroup(g) {
375
- var l, p;
376
- const d = e.find((h) => h.groupId === g);
377
- e = e.filter((h) => h.groupId !== g), d && (m(), (p = (l = s()) == null ? void 0 : l.onGroupUpdated) == null || p.call(l, d));
378
- },
379
- updateGroup(g, d) {
380
- var p, h;
381
- const l = e.findIndex((v) => v.groupId === g);
382
- l < 0 || (e[l] = { ...e[l], ...d }, m(), (h = (p = s()) == null ? void 0 : p.onGroupUpdated) == null || h.call(p, e[l]));
383
- },
384
- setGroupMembers(g, d) {
385
- var l, p;
386
- t.set(g, d), (p = (l = s()) == null ? void 0 : l.onGroupMembersChanged) == null || p.call(l, { groupId: g, members: d });
387
- },
388
- appendGroupMembers(g, d) {
389
- var v, S;
390
- const l = t.get(g) ?? [], p = new Map(l.map((C) => [C.userId, C]));
391
- for (const C of d)
392
- p.set(C.userId, C);
393
- const h = Array.from(p.values());
394
- t.set(g, h), (S = (v = s()) == null ? void 0 : v.onGroupMembersChanged) == null || S.call(v, { groupId: g, members: h });
395
- },
396
- removeGroupMembers(g, d) {
397
- var h, v;
398
- const l = new Set(d), p = (t.get(g) ?? []).filter((S) => !l.has(S.userId));
399
- t.set(g, p), (v = (h = s()) == null ? void 0 : h.onGroupMembersChanged) == null || v.call(h, { groupId: g, members: p });
400
- },
401
- updateGroupMemberRole(g, d, l) {
402
- var v, S;
403
- const p = t.get(g) ?? [], h = p.findIndex((C) => C.userId === d);
404
- h < 0 || (p[h] = { ...p[h], role: l }, t.set(g, p), (S = (v = s()) == null ? void 0 : v.onGroupMembersChanged) == null || S.call(v, { groupId: g, members: p }));
405
- },
406
- setGroupAnnouncement(g, d) {
407
- var l, p;
408
- n.set(g, d), (p = (l = s()) == null ? void 0 : l.onGroupAnnouncementChanged) == null || p.call(l, { groupId: g, announcement: d });
409
- },
410
- isGroupAdminSynced(g) {
411
- return u.has(g);
412
- },
413
- markGroupAdminSynced(g) {
414
- u.add(g);
415
- },
416
- setGroupMuteList(g, d) {
417
- o.set(g, d);
418
- },
419
- addGroupMuteMembers(g, d) {
420
- const l = o.get(g) ?? [], p = Array.isArray(d) && d.length > 0 && typeof d[0] == "string" ? d : d.map((h) => h.userId);
421
- for (const h of p)
422
- l.some((v) => v.userId === h) || l.push({ userId: h });
423
- o.set(g, l);
424
- },
425
- removeGroupMuteMembers(g, d) {
426
- const l = new Set(d);
427
- o.set(g, (o.get(g) ?? []).filter((p) => !l.has(p.userId)));
428
- },
429
- setGroupBlocklist(g, d) {
430
- a.set(g, d);
431
- },
432
- addGroupBlocklistMembers(g, d) {
433
- const l = a.get(g) ?? [];
434
- for (const p of d)
435
- l.some((h) => h.userId === p) || l.push({ userId: p });
436
- a.set(g, l);
437
- },
438
- removeGroupBlocklistMembers(g, d) {
439
- const l = new Set(d);
440
- a.set(g, (a.get(g) ?? []).filter((p) => !l.has(p.userId)));
377
+ return l;
441
378
  },
442
- setGroupAllowlist(g, d) {
443
- r.set(g, d);
379
+ setList(d) {
380
+ e = d, g();
444
381
  },
445
- addGroupAllowlistMembers(g, d) {
446
- const l = r.get(g) ?? [];
447
- for (const p of d)
448
- l.some((h) => h.userId === p) || l.push({ userId: p });
449
- r.set(g, l);
382
+ addGroup(d) {
383
+ var m, h;
384
+ const f = e.findIndex((v) => v.groupId === d.groupId);
385
+ f >= 0 ? e[f] = { ...e[f], ...d } : e.push(d), g(), (h = (m = s()) == null ? void 0 : m.onGroupUpdated) == null || h.call(m, d);
450
386
  },
451
- removeGroupAllowlistMembers(g, d) {
452
- const l = new Set(d);
453
- r.set(g, (r.get(g) ?? []).filter((p) => !l.has(p.userId)));
387
+ removeGroup(d) {
388
+ var m, h;
389
+ const f = e.find((v) => v.groupId === d);
390
+ e = e.filter((v) => v.groupId !== d), f && (g(), (h = (m = s()) == null ? void 0 : m.onGroupUpdated) == null || h.call(m, f));
454
391
  },
455
- setGroupList(g) {
456
- this.setList(g);
457
- },
458
- getGroupById(g) {
459
- return e.find((d) => d.groupId === g);
460
- },
461
- incrementMemberCount(g, d) {
462
- const l = this.getGroupById(g);
463
- l && this.updateGroup(g, { memberCount: (l.memberCount ?? 0) + d });
464
- },
465
- decrementMemberCount(g, d) {
466
- const l = this.getGroupById(g);
467
- l && this.updateGroup(g, { memberCount: Math.max(0, (l.memberCount ?? 0) - d) });
468
- },
469
- addGroupSharedFile(g, d) {
470
- const l = i.get(g) ?? [];
471
- l.push(d), i.set(g, l);
472
- },
473
- removeGroupSharedFile(g, d) {
474
- i.set(g, (i.get(g) ?? []).filter((l) => l.fileId !== d));
475
- },
476
- getGroupJoinRequests(g) {
477
- return c.get(g) ?? [];
392
+ updateGroup(d, f) {
393
+ var h, v;
394
+ const m = e.findIndex((C) => C.groupId === d);
395
+ m < 0 || (e[m] = { ...e[m], ...f }, g(), (v = (h = s()) == null ? void 0 : h.onGroupUpdated) == null || v.call(h, e[m]));
478
396
  },
479
- setGroupJoinRequests(g, d) {
480
- c.set(g, d);
397
+ setGroupMembers(d, f) {
398
+ var h, v;
399
+ const m = p(t.get(d) ?? [], f);
400
+ t.set(d, m), (v = (h = s()) == null ? void 0 : h.onGroupMembersChanged) == null || v.call(h, { groupId: d, members: m });
481
401
  },
482
- updateGroupJoinRequest(g, d, l) {
483
- const h = (c.get(g) ?? []).find(
484
- (v) => {
485
- var S;
486
- return v.applicantId === d || ((S = v.applicant) == null ? void 0 : S.userId) === d;
402
+ getGroupMembers(d) {
403
+ return t.get(d) ?? [];
404
+ },
405
+ appendGroupMembers(d, f) {
406
+ var C, w;
407
+ const m = t.get(d) ?? [], h = new Map(m.map((M) => [M.userId, M]));
408
+ for (const M of p(m, f))
409
+ h.set(M.userId, M);
410
+ const v = Array.from(h.values());
411
+ t.set(d, v), (w = (C = s()) == null ? void 0 : C.onGroupMembersChanged) == null || w.call(C, { groupId: d, members: v });
412
+ },
413
+ removeGroupMembers(d, f) {
414
+ var v, C;
415
+ const m = new Set(f), h = (t.get(d) ?? []).filter((w) => !m.has(w.userId));
416
+ t.set(d, h), (C = (v = s()) == null ? void 0 : v.onGroupMembersChanged) == null || C.call(v, { groupId: d, members: h });
417
+ },
418
+ updateGroupMemberRole(d, f, m) {
419
+ var C, w;
420
+ const h = t.get(d) ?? [], v = h.findIndex((M) => M.userId === f);
421
+ v < 0 || (h[v] = { ...h[v], role: m }, t.set(d, h), (w = (C = s()) == null ? void 0 : C.onGroupMembersChanged) == null || w.call(C, { groupId: d, members: h }));
422
+ },
423
+ setGroupAnnouncement(d, f) {
424
+ var m, h;
425
+ n.set(d, f), (h = (m = s()) == null ? void 0 : m.onGroupAnnouncementChanged) == null || h.call(m, { groupId: d, announcement: f });
426
+ },
427
+ isGroupAdminSynced(d) {
428
+ return u.has(d);
429
+ },
430
+ markGroupAdminSynced(d) {
431
+ u.add(d);
432
+ },
433
+ setGroupMuteList(d, f) {
434
+ o.set(d, f);
435
+ },
436
+ addGroupMuteMembers(d, f) {
437
+ const m = o.get(d) ?? [], h = Array.isArray(f) && f.length > 0 && typeof f[0] == "string" ? f : f.map((v) => v.userId);
438
+ for (const v of h)
439
+ m.some((C) => C.userId === v) || m.push({ userId: v });
440
+ o.set(d, m);
441
+ },
442
+ removeGroupMuteMembers(d, f) {
443
+ const m = new Set(f);
444
+ o.set(d, (o.get(d) ?? []).filter((h) => !m.has(h.userId)));
445
+ },
446
+ setGroupBlocklist(d, f) {
447
+ a.set(d, f);
448
+ },
449
+ addGroupBlocklistMembers(d, f) {
450
+ const m = a.get(d) ?? [];
451
+ for (const h of f)
452
+ m.some((v) => v.userId === h) || m.push({ userId: h });
453
+ a.set(d, m);
454
+ },
455
+ removeGroupBlocklistMembers(d, f) {
456
+ const m = new Set(f);
457
+ a.set(d, (a.get(d) ?? []).filter((h) => !m.has(h.userId)));
458
+ },
459
+ setGroupAllowlist(d, f) {
460
+ r.set(d, f);
461
+ },
462
+ addGroupAllowlistMembers(d, f) {
463
+ const m = r.get(d) ?? [];
464
+ for (const h of f)
465
+ m.some((v) => v.userId === h) || m.push({ userId: h });
466
+ r.set(d, m);
467
+ },
468
+ removeGroupAllowlistMembers(d, f) {
469
+ const m = new Set(f);
470
+ r.set(d, (r.get(d) ?? []).filter((h) => !m.has(h.userId)));
471
+ },
472
+ setGroupList(d) {
473
+ this.setList(d);
474
+ },
475
+ getGroupById(d) {
476
+ return e.find((f) => f.groupId === d);
477
+ },
478
+ incrementMemberCount(d, f) {
479
+ const m = this.getGroupById(d);
480
+ m && this.updateGroup(d, { memberCount: (m.memberCount ?? 0) + f });
481
+ },
482
+ decrementMemberCount(d, f) {
483
+ const m = this.getGroupById(d);
484
+ m && this.updateGroup(d, { memberCount: Math.max(0, (m.memberCount ?? 0) - f) });
485
+ },
486
+ addGroupSharedFile(d, f) {
487
+ const m = i.get(d) ?? [];
488
+ m.push(f), i.set(d, m);
489
+ },
490
+ removeGroupSharedFile(d, f) {
491
+ i.set(d, (i.get(d) ?? []).filter((m) => m.fileId !== f));
492
+ },
493
+ getGroupJoinRequests(d) {
494
+ return c.get(d) ?? [];
495
+ },
496
+ setGroupJoinRequests(d, f) {
497
+ c.set(d, f);
498
+ },
499
+ updateGroupJoinRequest(d, f, m) {
500
+ const v = (c.get(d) ?? []).find(
501
+ (C) => {
502
+ var w;
503
+ return C.applicantId === f || ((w = C.applicant) == null ? void 0 : w.userId) === f;
487
504
  }
488
505
  );
489
- h && (h.status = l);
506
+ v && (v.status = m);
490
507
  }
491
508
  };
492
509
  }
493
- function Bt(s) {
510
+ function Yt(s) {
494
511
  const e = /* @__PURE__ */ new Map(), t = /* @__PURE__ */ new Map();
495
512
  let n = !1;
496
513
  function o(i) {
@@ -498,17 +515,17 @@ function Bt(s) {
498
515
  }
499
516
  function a(i) {
500
517
  for (const [c, u] of e) {
501
- const f = u.findIndex((m) => m.msgServerId === i || m.msgLocalId === i);
502
- if (f >= 0)
503
- return { list: u, index: f, conversationId: c };
518
+ const l = u.findIndex((g) => g.msgServerId === i || g.msgLocalId === i);
519
+ if (l >= 0)
520
+ return { list: u, index: l, conversationId: c };
504
521
  }
505
522
  return null;
506
523
  }
507
524
  function r(i) {
508
- const c = i, u = e.get(c.conversationId) ?? [], f = u.findIndex(
509
- (m) => m.msgServerId && m.msgServerId === c.msgServerId
525
+ const c = i, u = e.get(c.conversationId) ?? [], l = u.findIndex(
526
+ (g) => g.msgServerId && g.msgServerId === c.msgServerId
510
527
  );
511
- f >= 0 ? u[f] = c : u.push(c), u.sort((m, g) => (m.timestamp ?? 0) - (g.timestamp ?? 0)), e.set(c.conversationId, u);
528
+ l >= 0 ? u[l] = c : u.push(c), u.sort((g, p) => (g.timestamp ?? 0) - (p.timestamp ?? 0)), e.set(c.conversationId, u);
512
529
  }
513
530
  return {
514
531
  getMessages: o,
@@ -520,69 +537,69 @@ function Bt(s) {
520
537
  t.set(i, c);
521
538
  },
522
539
  replaceWithSent(i, c) {
523
- var u, f;
524
- t.delete(i), r(c), (f = (u = s()) == null ? void 0 : u.onMessage) == null || f.call(u, c);
540
+ var u, l;
541
+ t.delete(i), r(c), (l = (u = s()) == null ? void 0 : u.onMessage) == null || l.call(u, c);
525
542
  },
526
543
  updateUploadProgress(i, c) {
527
544
  const u = t.get(i);
528
545
  if (!u)
529
546
  return;
530
- const f = a(u.msgLocalId || u.msgServerId || "");
531
- if (f) {
532
- const m = { ...f.list[f.index], progress: c };
533
- f.list[f.index] = m;
547
+ const l = a(u.msgLocalId || u.msgServerId || "");
548
+ if (l) {
549
+ const g = { ...l.list[l.index], progress: c };
550
+ l.list[l.index] = g;
534
551
  }
535
552
  },
536
553
  markFailed(i, c) {
537
554
  const u = t.get(i);
538
555
  t.delete(i);
539
- const f = (u == null ? void 0 : u.msgLocalId) || (u == null ? void 0 : u.msgServerId);
540
- if (!f)
556
+ const l = (u == null ? void 0 : u.msgLocalId) || (u == null ? void 0 : u.msgServerId);
557
+ if (!l)
541
558
  return;
542
- const m = a(f);
543
- if (m) {
544
- const g = { ...m.list[m.index], status: "failed", failReason: c };
545
- m.list[m.index] = g;
559
+ const g = a(l);
560
+ if (g) {
561
+ const p = { ...g.list[g.index], status: "failed", failReason: c };
562
+ g.list[g.index] = p;
546
563
  }
547
564
  },
548
565
  prependMessages(i, c) {
549
- const u = e.get(i) ?? [], f = /* @__PURE__ */ new Map();
550
- for (const g of c) {
551
- const d = g;
552
- d.msgServerId && f.set(d.msgServerId, d);
566
+ const u = e.get(i) ?? [], l = /* @__PURE__ */ new Map();
567
+ for (const p of c) {
568
+ const d = p;
569
+ d.msgServerId && l.set(d.msgServerId, d);
553
570
  }
554
- for (const g of u)
555
- g.msgServerId && !f.has(g.msgServerId) && f.set(g.msgServerId, g);
556
- const m = Array.from(f.values()).sort(
557
- (g, d) => (g.timestamp ?? 0) - (d.timestamp ?? 0)
571
+ for (const p of u)
572
+ p.msgServerId && !l.has(p.msgServerId) && l.set(p.msgServerId, p);
573
+ const g = Array.from(l.values()).sort(
574
+ (p, d) => (p.timestamp ?? 0) - (d.timestamp ?? 0)
558
575
  );
559
- e.set(i, m);
576
+ e.set(i, g);
560
577
  },
561
578
  updateStatusByServerId(i, c) {
562
- var f, m;
579
+ var l, g;
563
580
  const u = a(i);
564
- u && (u.list[u.index] = { ...u.list[u.index], status: c }, (m = (f = s()) == null ? void 0 : f.onMessageStatusChanged) == null || m.call(f, { messageId: i, status: c }));
581
+ u && (u.list[u.index] = { ...u.list[u.index], status: c }, (g = (l = s()) == null ? void 0 : l.onMessageStatusChanged) == null || g.call(l, { messageId: i, status: c }));
565
582
  },
566
583
  recallMessage(i, c) {
567
- var m, g;
584
+ var g, p;
568
585
  const u = a(i);
569
586
  if (!u)
570
587
  return;
571
- const f = u.list[u.index];
572
- f.recalled = !0, f.recalledBy = c, (g = (m = s()) == null ? void 0 : m.onMessagesRecalled) == null || g.call(m, {
588
+ const l = u.list[u.index];
589
+ l.recalled = !0, l.recalledBy = c, (p = (g = s()) == null ? void 0 : g.onMessagesRecalled) == null || p.call(g, {
573
590
  messageId: i,
574
591
  conversationId: u.conversationId,
575
- conversationType: f.conversationType,
592
+ conversationType: l.conversationType,
576
593
  operatorId: c
577
594
  });
578
595
  },
579
596
  updateMessage(i, c) {
580
- var m, g;
597
+ var g, p;
581
598
  const u = a(i);
582
599
  if (!u)
583
600
  return;
584
- const f = c;
585
- u.list[u.index] = f, f.modified && ((g = (m = s()) == null ? void 0 : m.onMessageUpdated) == null || g.call(m, f));
601
+ const l = c;
602
+ u.list[u.index] = l, l.modified && ((p = (g = s()) == null ? void 0 : g.onMessageUpdated) == null || p.call(g, l));
586
603
  },
587
604
  setPinnedMessages(i, c) {
588
605
  },
@@ -590,8 +607,8 @@ function Bt(s) {
590
607
  const u = a(i);
591
608
  if (!u)
592
609
  return;
593
- const f = u.list[u.index];
594
- f.translation = c, f.showTranslation = !0;
610
+ const l = u.list[u.index];
611
+ l.translation = c, l.showTranslation = !0;
595
612
  },
596
613
  setTranslating(i, c) {
597
614
  const u = a(i);
@@ -601,8 +618,8 @@ function Bt(s) {
601
618
  const u = a(i);
602
619
  if (!u)
603
620
  return;
604
- const f = u.list[u.index];
605
- f.voiceText = c, f.showVoiceText = !0;
621
+ const l = u.list[u.index];
622
+ l.voiceText = c, l.showVoiceText = !0;
606
623
  },
607
624
  setVoiceTranscribing(i, c) {
608
625
  const u = a(i);
@@ -612,39 +629,39 @@ function Bt(s) {
612
629
  e.delete(i);
613
630
  },
614
631
  updateMessageById(i, c) {
615
- var g, d, l, p;
632
+ var p, d, f, m;
616
633
  const u = a(i);
617
634
  if (!u)
618
635
  return;
619
- const f = u.list[u.index], m = { ...f, ...c };
620
- u.list[u.index] = m, (c.modified || c.modifiedInfo) && ((d = (g = s()) == null ? void 0 : g.onMessageUpdated) == null || d.call(g, m)), c.status && c.status !== f.status && ((p = (l = s()) == null ? void 0 : l.onMessageStatusChanged) == null || p.call(l, {
636
+ const l = u.list[u.index], g = { ...l, ...c };
637
+ u.list[u.index] = g, (c.modified || c.modifiedInfo) && ((d = (p = s()) == null ? void 0 : p.onMessageUpdated) == null || d.call(p, g)), c.status && c.status !== l.status && ((m = (f = s()) == null ? void 0 : f.onMessageStatusChanged) == null || m.call(f, {
621
638
  messageId: i,
622
639
  status: c.status
623
640
  }));
624
641
  },
625
642
  replaceMessageById(i, c) {
626
- var m, g;
643
+ var g, p;
627
644
  const u = a(i);
628
645
  if (!u)
629
646
  return;
630
- const f = c;
631
- u.list[u.index] = f, (g = (m = s()) == null ? void 0 : m.onMessageUpdated) == null || g.call(m, f);
647
+ const l = c;
648
+ u.list[u.index] = l, (p = (g = s()) == null ? void 0 : g.onMessageUpdated) == null || p.call(g, l);
632
649
  },
633
650
  addAtMeMessage(i, c) {
634
- var u, f;
635
- (f = (u = s()) == null ? void 0 : u.onAtMe) == null || f.call(u, { conversationId: i, messageId: c });
651
+ var u, l;
652
+ (l = (u = s()) == null ? void 0 : u.onAtMe) == null || l.call(u, { conversationId: i, messageId: c });
636
653
  },
637
654
  updateMessageStatus(i, c) {
638
- var f, m;
655
+ var l, g;
639
656
  const u = a(i);
640
- u && (u.list[u.index] = { ...u.list[u.index], status: c }, (m = (f = s()) == null ? void 0 : f.onMessageStatusChanged) == null || m.call(f, { messageId: i, status: c }));
657
+ u && (u.list[u.index] = { ...u.list[u.index], status: c }, (g = (l = s()) == null ? void 0 : l.onMessageStatusChanged) == null || g.call(l, { messageId: i, status: c }));
641
658
  },
642
659
  setMessagePinned(i, c) {
643
660
  const u = a(i);
644
661
  if (!u)
645
662
  return;
646
- const f = u.list[u.index];
647
- f.pinned = !0, f.pinTime = c.pinTime, f.pinOperatorId = c.operatorId;
663
+ const l = u.list[u.index];
664
+ l.pinned = !0, l.pinTime = c.pinTime, l.pinOperatorId = c.operatorId;
648
665
  },
649
666
  setMessageUnpinned(i) {
650
667
  const c = a(i);
@@ -654,22 +671,22 @@ function Bt(s) {
654
671
  u.pinned = !1;
655
672
  },
656
673
  deleteMessages(i) {
657
- var f, m;
674
+ var l, g;
658
675
  const c = new Set(i), u = /* @__PURE__ */ new Map();
659
- for (const [g, d] of e) {
660
- const l = [];
661
- for (const p of d) {
662
- const h = p.msgServerId || p.msgLocalId;
676
+ for (const [p, d] of e) {
677
+ const f = [];
678
+ for (const m of d) {
679
+ const h = m.msgServerId || m.msgLocalId;
663
680
  if (h && c.has(h)) {
664
- const v = u.get(g) ?? [];
665
- v.push(h), u.set(g, v);
681
+ const v = u.get(p) ?? [];
682
+ v.push(h), u.set(p, v);
666
683
  } else
667
- l.push(p);
684
+ f.push(m);
668
685
  }
669
- e.set(g, l);
686
+ e.set(p, f);
670
687
  }
671
- for (const [g, d] of u)
672
- (m = (f = s()) == null ? void 0 : f.onMessagesDeleted) == null || m.call(f, { messageIds: d, conversationId: g });
688
+ for (const [p, d] of u)
689
+ (g = (l = s()) == null ? void 0 : l.onMessagesDeleted) == null || g.call(l, { messageIds: d, conversationId: p });
673
690
  },
674
691
  setSyncingMessages(i) {
675
692
  var c, u;
@@ -680,7 +697,7 @@ function Bt(s) {
680
697
  }
681
698
  };
682
699
  }
683
- function Ft(s) {
700
+ function Xt(s) {
684
701
  let e = [];
685
702
  const t = /* @__PURE__ */ new Set();
686
703
  return {
@@ -697,7 +714,7 @@ function Ft(s) {
697
714
  }
698
715
  };
699
716
  }
700
- function Ht(s) {
717
+ function Zt(s) {
701
718
  const e = /* @__PURE__ */ new Map(), t = /* @__PURE__ */ new Set(), n = /* @__PURE__ */ new Set(), o = /* @__PURE__ */ new Set();
702
719
  let a = !1;
703
720
  const r = /* @__PURE__ */ new Map();
@@ -718,15 +735,15 @@ function Ht(s) {
718
735
  i();
719
736
  },
720
737
  areAttributesFetched(c, u) {
721
- const f = r.get(c);
722
- return f ? u.every((m) => f.has(m)) : !1;
738
+ const l = r.get(c);
739
+ return l ? u.every((g) => l.has(g)) : !1;
723
740
  },
724
741
  markFetchedAttributes(c, u) {
725
- for (const f of c) {
726
- const m = r.get(f) ?? /* @__PURE__ */ new Set();
727
- for (const g of u)
728
- m.add(g);
729
- r.set(f, m);
742
+ for (const l of c) {
743
+ const g = r.get(l) ?? /* @__PURE__ */ new Set();
744
+ for (const p of u)
745
+ g.add(p);
746
+ r.set(l, g);
730
747
  }
731
748
  },
732
749
  markLoading(c) {
@@ -744,6 +761,14 @@ function Ht(s) {
744
761
  isFetchFailed(c) {
745
762
  return n.has(c);
746
763
  },
764
+ clearFetchFailed(c) {
765
+ if (!c) {
766
+ n.clear();
767
+ return;
768
+ }
769
+ for (const u of c)
770
+ n.delete(u);
771
+ },
747
772
  markSubscribed(c) {
748
773
  for (const u of c)
749
774
  o.add(u);
@@ -773,18 +798,18 @@ function Ht(s) {
773
798
  }
774
799
  };
775
800
  }
776
- function Kt(s, e) {
801
+ function en(s, e) {
777
802
  return {
778
- client: kt(s, e),
779
- message: Bt(e),
780
- conversation: xt(e),
781
- contact: Ot(e),
782
- group: Pt(e),
783
- presence: Ft(e),
784
- userInfo: Ht(e)
803
+ client: Jt(s, e),
804
+ message: Yt(e),
805
+ conversation: Qt(e),
806
+ contact: $t(e),
807
+ group: zt(e),
808
+ presence: Xt(e),
809
+ userInfo: Zt(e)
785
810
  };
786
811
  }
787
- function jt() {
812
+ function tn() {
788
813
  return {
789
814
  enableContact: !0,
790
815
  enableBlocklist: !0,
@@ -803,11 +828,11 @@ function jt() {
803
828
  filterBlockedContacts: !0
804
829
  };
805
830
  }
806
- function Vt(s) {
831
+ function nn(s) {
807
832
  if (s != null && s.fetchUserInfos)
808
833
  return { fetchUserInfos: s.fetchUserInfos };
809
834
  }
810
- function qt(s) {
835
+ function sn(s) {
811
836
  const e = s;
812
837
  return {
813
838
  // 经 domain.fetchContacts 读取:注入 contact.fetchContacts 时由 domain 委托覆盖
@@ -830,13 +855,13 @@ function qt(s) {
830
855
  }
831
856
  };
832
857
  }
833
- function Wt(s) {
858
+ function rn(s) {
834
859
  const e = s;
835
860
  return {
836
861
  fetchConversations: async () => ({ list: e.syncLocal(), cursor: void 0, hasMore: !1 })
837
862
  };
838
863
  }
839
- function Jt(s) {
864
+ function on(s) {
840
865
  const e = s;
841
866
  return {
842
867
  // 经 domain.fetchGroups 读取:注入 group.fetchGroups 时由 domain 委托覆盖
@@ -903,7 +928,7 @@ function Jt(s) {
903
928
  }
904
929
  };
905
930
  }
906
- function $t(s) {
931
+ function an(s) {
907
932
  const e = s.message, t = s.conversation;
908
933
  return {
909
934
  loadMessages: async (n, o, a, r) => {
@@ -922,7 +947,7 @@ function $t(s) {
922
947
  // 契约的 needReadReceipt 未透传:domain sendLocation 无此参数(SDK 不支持位置消息回执)
923
948
  sendLocation: (n, o, a, r, i, c) => e.sendLocation(n, o, a, r, i, c),
924
949
  sendCustom: (n, o, a, r, i) => {
925
- const c = r ? Object.fromEntries(Object.entries(r).map(([u, f]) => [u, String(f)])) : void 0;
950
+ const c = r ? Object.fromEntries(Object.entries(r).map(([u, l]) => [u, String(l)])) : void 0;
926
951
  return e.sendCustom(n, o, a, c, i);
927
952
  },
928
953
  sendCmd: (n, o, a, r) => e.sendCmd(n, o, a, r),
@@ -942,7 +967,7 @@ function $t(s) {
942
967
  }
943
968
  };
944
969
  }
945
- function Qt(s) {
970
+ function cn(s) {
946
971
  const e = s;
947
972
  return {
948
973
  subscribe: async (t, n) => {
@@ -957,8 +982,9 @@ function Qt(s) {
957
982
  }
958
983
  };
959
984
  }
960
- function zt(s) {
985
+ function un(s) {
961
986
  return {
987
+ readCachedUserInfos: (e) => s.readCachedUserInfos(e),
962
988
  fetchUserInfos: async (e, t) => s.fetchUserInfos(e, t),
963
989
  updateOwnInfo: async (e) => {
964
990
  await s.updateOwnInfo(e);
@@ -975,7 +1001,41 @@ function zt(s) {
975
1001
  getSubscribedUsers: async () => s.getSubscribedUsers()
976
1002
  };
977
1003
  }
978
- const Yt = T("UIKit:MessageAdapter"), Ue = {
1004
+ function dn(s) {
1005
+ return Object.fromEntries(
1006
+ Object.entries({
1007
+ userId: s.userId,
1008
+ nickname: s.nickname,
1009
+ avatarUrl: s.avatarUrl,
1010
+ mail: s.mail,
1011
+ phone: s.phone,
1012
+ gender: s.gender,
1013
+ sign: s.sign,
1014
+ birth: s.birth,
1015
+ ext: s.ext
1016
+ }).filter(([, e]) => e !== void 0)
1017
+ );
1018
+ }
1019
+ function ln(s, e) {
1020
+ var t, n;
1021
+ try {
1022
+ const o = s.getCacheManager();
1023
+ if (!o)
1024
+ return [];
1025
+ const a = [], r = /* @__PURE__ */ new Map();
1026
+ for (const c of e) {
1027
+ const u = (t = o.getRuntimeUserInfo) == null ? void 0 : t.call(o, c, !1);
1028
+ u ? r.set(c, { ...u, userId: c }) : a.push(c);
1029
+ }
1030
+ const i = new Map(
1031
+ (((n = o.getUserInfoSummaries) == null ? void 0 : n.call(o, a, !1)) ?? []).map((c) => [c.userId, c])
1032
+ );
1033
+ return e.map((c) => r.get(c) ?? i.get(c)).filter((c) => !!c).map(dn);
1034
+ } catch {
1035
+ return [];
1036
+ }
1037
+ }
1038
+ const fn = T("UIKit:MessageAdapter"), Be = {
979
1039
  image: "[图片]",
980
1040
  sticker: "[表情]",
981
1041
  voice: "[语音]",
@@ -985,11 +1045,11 @@ const Yt = T("UIKit:MessageAdapter"), Ue = {
985
1045
  combine: "[聊天记录]",
986
1046
  multiBody: "[复合消息]",
987
1047
  multiBodyMore: "...",
988
- custom: gt,
1048
+ custom: St,
989
1049
  customFallback: "[自定义]",
990
1050
  unknown: ""
991
1051
  };
992
- function ke(s) {
1052
+ function je(s) {
993
1053
  if (s.event && typeof s.event == "string")
994
1054
  return s.event;
995
1055
  const e = s.params;
@@ -1000,35 +1060,35 @@ function ke(s) {
1000
1060
  }
1001
1061
  return "";
1002
1062
  }
1003
- function P(s, e) {
1004
- e || Yt.warn("[toUiMessage] currentUserId is empty, isSelf may be inaccurate", {
1063
+ function H(s, e) {
1064
+ e || fn.warn("[toUiMessage] currentUserId is empty, isSelf may be inaccurate", {
1005
1065
  from: s.from,
1006
1066
  conversationId: s.conversationId,
1007
1067
  type: s.type
1008
1068
  });
1009
- const t = E(s.from) === E(e), n = {
1069
+ const t = G(s.from) === G(e), n = {
1010
1070
  ...s,
1011
1071
  isSelf: t,
1012
1072
  localId: s.msgLocalId,
1013
- status: t && s.isPeerRead === !0 ? O.READ : s.sendStatus ?? O.SENT
1073
+ status: t && s.isPeerRead === !0 ? k.READ : s.sendStatus ?? k.SENT
1014
1074
  };
1015
- return Ye(n.body) && n.body.messageList ? n.body = {
1075
+ return at(n.body) && n.body.messageList ? n.body = {
1016
1076
  ...n.body,
1017
- messageList: Ne([...n.body.messageList])
1018
- } : yt(n.body) && (n.body = Ne([...n.body])), n;
1077
+ messageList: qe([...n.body.messageList])
1078
+ } : _t(n.body) && (n.body = qe([...n.body])), n;
1019
1079
  }
1020
- function Qn(s, e) {
1021
- return s.map((t) => P(t, e));
1080
+ function vs(s, e) {
1081
+ return s.map((t) => H(t, e));
1022
1082
  }
1023
- function Oe(s) {
1083
+ function Ve(s) {
1024
1084
  return {
1025
1085
  ...s,
1026
1086
  isSelf: !1,
1027
1087
  localId: s.msgLocalId,
1028
- status: s.sendStatus ?? O.SENT
1088
+ status: s.sendStatus ?? k.SENT
1029
1089
  };
1030
1090
  }
1031
- function xe(s, e) {
1091
+ function We(s, e) {
1032
1092
  const t = s.from || "";
1033
1093
  return {
1034
1094
  ...s,
@@ -1040,40 +1100,40 @@ function xe(s, e) {
1040
1100
  conversationId: s.conversationId || (e == null ? void 0 : e.conversationId) || "",
1041
1101
  conversationType: s.conversationType || (e == null ? void 0 : e.conversationType) || I.SINGLECHAT,
1042
1102
  type: s.type || "unknown",
1043
- sendStatus: s.sendStatus ?? O.SENT,
1103
+ sendStatus: s.sendStatus ?? k.SENT,
1044
1104
  ext: s.ext ?? {},
1045
1105
  timestamp: s.timestamp ?? 0,
1046
1106
  body: s.body || {},
1047
1107
  isSelf: !1,
1048
1108
  localId: s.msgLocalId || s.msgServerId,
1049
- status: s.sendStatus ?? O.SENT
1109
+ status: s.sendStatus ?? k.SENT
1050
1110
  };
1051
1111
  }
1052
- function zn(s, e, t) {
1112
+ function Is(s, e, t) {
1053
1113
  var r;
1054
1114
  if (!s)
1055
1115
  return "";
1056
- const n = t == null ? void 0 : t(Oe(s));
1116
+ const n = t == null ? void 0 : t(Ve(s));
1057
1117
  if (n !== void 0)
1058
1118
  return n;
1059
- const o = Je({ ...Ue, ...e }), { body: a } = s;
1060
- return s.type === b.MULTI_BODY ? $e(Oe(s), o) : ft(a) ? a.content || "" : mt(a) ? ((r = s.ext) == null ? void 0 : r[Qe.IS_STICKER]) === !0 ? o.sticker : o.image : ze(a) ? o.voice : pt(a) ? o.video : ht(a) ? a.filename || o.file : vt(a) ? o.location : It(a) ? o.custom[a.event || ""] || o.customFallback : Mt(a) ? "[命令]" : Ye(a) ? a.summary || o.combine : "";
1119
+ const o = st({ ...Be, ...e }), { body: a } = s;
1120
+ return s.type === b.MULTI_BODY ? rt(Ve(s), o) : At(a) ? a.content || "" : Et(a) ? ((r = s.ext) == null ? void 0 : r[ot.IS_STICKER]) === !0 ? o.sticker : o.image : it(a) ? o.voice : Gt(a) ? o.video : Tt(a) ? a.filename || o.file : Ut(a) ? o.location : Rt(a) ? o.custom[a.event || ""] || o.customFallback : Lt(a) ? "[命令]" : at(a) ? a.summary || o.combine : "";
1061
1121
  }
1062
- function Xt(s, e, t, n) {
1122
+ function gn(s, e, t, n) {
1063
1123
  var i;
1064
1124
  if (!s)
1065
1125
  return "";
1066
- const o = t == null ? void 0 : t(xe(s, n));
1126
+ const o = t == null ? void 0 : t(We(s, n));
1067
1127
  if (o !== void 0)
1068
1128
  return o;
1069
- const a = Je({ ...Ue, ...e }), r = Array.isArray(s.body) ? {} : s.body || {};
1129
+ const a = st({ ...Be, ...e }), r = Array.isArray(s.body) ? {} : s.body || {};
1070
1130
  switch (s.type) {
1071
1131
  case b.MULTI_BODY:
1072
- return $e(xe(s, n), a);
1132
+ return rt(We(s, n), a);
1073
1133
  case b.TEXT:
1074
1134
  return r.content || r.summary || "";
1075
1135
  case b.IMAGE:
1076
- return ((i = s.ext) == null ? void 0 : i[Qe.IS_STICKER]) === !0 ? a.sticker : a.image;
1136
+ return ((i = s.ext) == null ? void 0 : i[ot.IS_STICKER]) === !0 ? a.sticker : a.image;
1077
1137
  case b.VOICE:
1078
1138
  return a.voice;
1079
1139
  case b.VIDEO:
@@ -1083,7 +1143,7 @@ function Xt(s, e, t, n) {
1083
1143
  case b.LOCATION:
1084
1144
  return a.location;
1085
1145
  case b.CUSTOM: {
1086
- const c = ke(r);
1146
+ const c = je(r);
1087
1147
  return a.custom[c] || a.customFallback;
1088
1148
  }
1089
1149
  case b.CMD:
@@ -1091,21 +1151,21 @@ function Xt(s, e, t, n) {
1091
1151
  case b.COMBINE:
1092
1152
  return r.summary || a.combine;
1093
1153
  default: {
1094
- const c = ke(r);
1154
+ const c = je(r);
1095
1155
  return c ? a.custom[c] || a.customFallback : r.content || r.summary || r.msg || "";
1096
1156
  }
1097
1157
  }
1098
1158
  }
1099
- function Yn(s, e, t) {
1159
+ function Ms(s, e, t) {
1100
1160
  return s.conversationId === e && s.conversationType === t;
1101
1161
  }
1102
- function Xn(s, e) {
1103
- return s.conversationType === I.GROUPCHAT || E(s.from) === E(e) ? s.to : s.from;
1162
+ function ys(s, e) {
1163
+ return s.conversationType === I.GROUPCHAT || G(s.from) === G(e) ? s.to : s.from;
1104
1164
  }
1105
- function U(s) {
1106
- return Ve(s) ? s.toJSON() : s;
1165
+ function L(s) {
1166
+ return et(s) ? s.toJSON() : s;
1107
1167
  }
1108
- const Zt = {
1168
+ const mn = {
1109
1169
  // 连接 / 网络
1110
1170
  1: "error.unknown",
1111
1171
  2: "error.network",
@@ -1192,28 +1252,28 @@ const Zt = {
1192
1252
  1600: "error.userInfoSubscriptionLimitExceeded",
1193
1253
  1601: "error.userInfoSubscriptionTargetLimitExceeded"
1194
1254
  };
1195
- function en(s) {
1196
- return Ve(s) ? Zt[s.code] ?? null : null;
1255
+ function pn(s) {
1256
+ return et(s) ? mn[s.code] ?? null : null;
1197
1257
  }
1198
- function tn(s) {
1258
+ function hn(s) {
1199
1259
  return s instanceof Error ? s.message : typeof s == "string" ? s : s && typeof s == "object" && "reason" in s && typeof s.reason == "string" ? s.reason : String(s);
1200
1260
  }
1201
- function nn(s) {
1261
+ function vn(s) {
1202
1262
  const e = s.toLowerCase();
1203
1263
  return e.includes("not connected") || e.includes("disconnected") || e.includes("connection is closed") || e.includes("chatclient is not connected") ? "error.notConnected" : e.includes("network") || e.includes("net::err") || e.includes("failed to fetch") || e.includes("network request failed") ? "error.network" : e.includes("timeout") || e.includes("timed out") ? "error.timeout" : "error.unknown";
1204
1264
  }
1205
- function Zn(s, e, t) {
1206
- const n = en(s);
1265
+ function Cs(s, e, t) {
1266
+ const n = pn(s);
1207
1267
  if (n) {
1208
1268
  const r = t(n);
1209
1269
  if (r && r !== n)
1210
1270
  return r;
1211
1271
  }
1212
- const o = tn(s), a = nn(o);
1272
+ const o = hn(s), a = vn(o);
1213
1273
  return a !== "error.unknown" ? t(a) || t(e) || o : t(n || e) || o || "";
1214
1274
  }
1215
- const he = T("Combine"), ve = T("History"), N = T("MessageDomain"), sn = 150;
1216
- function rn(s) {
1275
+ const Ce = T("Combine"), be = T("History"), N = T("MessageDomain"), In = 150;
1276
+ function Mn(s) {
1217
1277
  return new Promise((e) => {
1218
1278
  if (typeof document > "u" || typeof URL.createObjectURL != "function") {
1219
1279
  e(void 0);
@@ -1231,27 +1291,27 @@ function rn(s) {
1231
1291
  }), n.addEventListener("error", () => a(void 0)), setTimeout(() => a(void 0), 5e3);
1232
1292
  });
1233
1293
  }
1234
- const j = /* @__PURE__ */ new Set(), on = 5e3;
1235
- function an(s) {
1294
+ const V = /* @__PURE__ */ new Set(), yn = 5e3;
1295
+ function Cn(s) {
1236
1296
  for (const e of s)
1237
- if (j.add(e), j.size > on) {
1238
- const t = j.values().next().value;
1239
- t !== void 0 && j.delete(t);
1297
+ if (V.add(e), V.size > yn) {
1298
+ const t = V.values().next().value;
1299
+ t !== void 0 && V.delete(t);
1240
1300
  }
1241
1301
  }
1242
- function se(s) {
1302
+ function oe(s) {
1243
1303
  Promise.resolve().then(s).catch((e) => N.warn("persistence 钩子执行失败(已忽略):", e));
1244
1304
  }
1245
- function cn(s, e) {
1246
- const t = E(s.from) === E(e);
1305
+ function bn(s, e) {
1306
+ const t = G(s.from) === G(e);
1247
1307
  return {
1248
1308
  ...s,
1249
1309
  isSelf: t,
1250
1310
  localId: s.msgLocalId,
1251
- status: t && s.isPeerRead === !0 ? O.READ : s.sendStatus ?? O.SENT
1311
+ status: t && s.isPeerRead === !0 ? k.READ : s.sendStatus ?? k.SENT
1252
1312
  };
1253
1313
  }
1254
- function un(s, e) {
1314
+ function wn(s, e) {
1255
1315
  switch (e.type) {
1256
1316
  case b.TEXT: {
1257
1317
  const { type: t, ...n } = e;
@@ -1283,7 +1343,7 @@ function un(s, e) {
1283
1343
  }
1284
1344
  }
1285
1345
  }
1286
- class dn {
1346
+ class Sn {
1287
1347
  constructor(e, t, n = {}) {
1288
1348
  this.client = e, this.store = t, this.options = n, this.failedMultiBodyMessages = /* @__PURE__ */ new Map();
1289
1349
  }
@@ -1331,7 +1391,7 @@ class dn {
1331
1391
  return this._send(i);
1332
1392
  }
1333
1393
  async sendVideo(e, t, n, o, a, r) {
1334
- const i = typeof n == "string" ? void 0 : await rn(n), c = this.client.chatManager.createVideoMessage({
1394
+ const i = typeof n == "string" ? void 0 : await Mn(n), c = this.client.chatManager.createVideoMessage({
1335
1395
  conversationId: e,
1336
1396
  conversationType: t,
1337
1397
  duration: o,
@@ -1384,13 +1444,13 @@ class dn {
1384
1444
  messageList: r,
1385
1445
  ext: i
1386
1446
  });
1387
- return he.info("createCombineMessage done", {
1447
+ return Ce.info("createCombineMessage done", {
1388
1448
  items: r.length,
1389
1449
  elapsedMs: Math.round(performance.now() - c)
1390
1450
  }), this._send(u);
1391
1451
  }
1392
1452
  async sendMultiBody(e, t, n, o, a) {
1393
- const r = n.map((c) => un(this.client.chatManager, c)), i = this.client.chatManager.createMultiBodyMessage({
1453
+ const r = n.map((c) => wn(this.client.chatManager, c)), i = this.client.chatManager.createMultiBodyMessage({
1394
1454
  conversationId: e,
1395
1455
  conversationType: t,
1396
1456
  bodies: r,
@@ -1435,22 +1495,22 @@ class dn {
1435
1495
  const r = performance.now();
1436
1496
  try {
1437
1497
  const c = await this.client.chatManager.sendMessage(e, {
1438
- onFileUploadProgress: (m) => {
1498
+ onFileUploadProgress: (g) => {
1439
1499
  o += 1;
1440
- const g = m.percent ?? 0, d = performance.now();
1441
- g < 100 && d - a < sn || (a = d, this.store.updateUploadProgress(t, g));
1500
+ const p = g.percent ?? 0, d = performance.now();
1501
+ p < 100 && d - a < In || (a = d, this.store.updateUploadProgress(t, p));
1442
1502
  }
1443
1503
  });
1444
- n && he.info("sendMessage done", {
1504
+ n && Ce.info("sendMessage done", {
1445
1505
  elapsedMs: Math.round(performance.now() - r),
1446
1506
  progressEvents: o
1447
1507
  });
1448
- const u = P(c, this.currentUserId);
1508
+ const u = H(c, this.currentUserId);
1449
1509
  this.store.replaceWithSent(t, u);
1450
- const f = (i = this.options.persistence) == null ? void 0 : i.saveMessage;
1451
- return f && se(() => f(we(c))), c;
1510
+ const l = (i = this.options.persistence) == null ? void 0 : i.saveMessage;
1511
+ return l && oe(() => l(_e(c))), c;
1452
1512
  } catch (c) {
1453
- n && he.warn("sendMessage failed", {
1513
+ n && Ce.warn("sendMessage failed", {
1454
1514
  elapsedMs: Math.round(performance.now() - r),
1455
1515
  progressEvents: o,
1456
1516
  error: c instanceof Error ? c.message : String(c)
@@ -1461,14 +1521,14 @@ class dn {
1461
1521
  }
1462
1522
  // ===== 历史消息 =====
1463
1523
  async fetchHistory(e, t, n, o = 20) {
1464
- var f, m;
1465
- const a = (f = this.options.messageRepository) == null ? void 0 : f.loadMessages;
1524
+ var l, g;
1525
+ const a = (l = this.options.messageRepository) == null ? void 0 : l.loadMessages;
1466
1526
  if (a) {
1467
- const g = await a(e, t, n, o), d = g.list.filter((l) => l.type !== b.CMD).map((l) => cn(l, this.currentUserId));
1527
+ const p = await a(e, t, n, o), d = p.list.filter((f) => f.type !== b.CMD).map((f) => bn(f, this.currentUserId));
1468
1528
  return this.store.prependMessages(e, d), t === I.GROUPCHAT && this.fillGroupReadCounts(d, e), {
1469
1529
  list: d,
1470
- cursor: g.cursor,
1471
- hasMore: g.hasMore
1530
+ cursor: p.cursor,
1531
+ hasMore: p.hasMore
1472
1532
  };
1473
1533
  }
1474
1534
  const r = await this.client.chatManager.getHistoryMessages({
@@ -1478,7 +1538,7 @@ class dn {
1478
1538
  cursor: n,
1479
1539
  searchDirection: "up"
1480
1540
  });
1481
- ve.info("fetchHistory response", {
1541
+ be.info("fetchHistory response", {
1482
1542
  conversationId: e,
1483
1543
  conversationType: t,
1484
1544
  cursor: n,
@@ -1486,12 +1546,12 @@ class dn {
1486
1546
  count: r.items.length,
1487
1547
  cursorReturned: r.cursor,
1488
1548
  hasMore: r.hasMore,
1489
- items: r.items.map((g) => `${g.msgServerId || g.msgLocalId}|${g.type}|${g.from}->${g.to}|${g.timestamp}`)
1549
+ items: r.items.map((p) => `${p.msgServerId || p.msgLocalId}|${p.type}|${p.from}->${p.to}|${p.timestamp}`)
1490
1550
  });
1491
- const i = r.items.filter((g) => g.type !== b.CMD), c = i.map((g) => P(g, this.currentUserId));
1551
+ const i = r.items.filter((p) => p.type !== b.CMD), c = i.map((p) => H(p, this.currentUserId));
1492
1552
  this.store.prependMessages(e, c);
1493
- const u = (m = this.options.persistence) == null ? void 0 : m.saveMessages;
1494
- return u && i.length > 0 && se(() => u(i.map((g) => we(g)))), t === I.GROUPCHAT && this.fillGroupReadCounts(c, e), {
1553
+ const u = (g = this.options.persistence) == null ? void 0 : g.saveMessages;
1554
+ return u && i.length > 0 && oe(() => u(i.map((p) => _e(p)))), t === I.GROUPCHAT && this.fillGroupReadCounts(c, e), {
1495
1555
  list: c,
1496
1556
  cursor: r.cursor,
1497
1557
  hasMore: r.hasMore
@@ -1508,7 +1568,7 @@ class dn {
1508
1568
  */
1509
1569
  async fillGroupReadCounts(e, t) {
1510
1570
  const n = e.filter((r) => r.isSelf && !(r.groupReadCount ?? 0)), o = n.map((r) => r.msgServerId).filter((r) => !!r);
1511
- if (ve.info("fillGroupReadCounts scan", {
1571
+ if (be.info("fillGroupReadCounts scan", {
1512
1572
  groupId: t,
1513
1573
  total: e.length,
1514
1574
  selfMissingCount: n.length,
@@ -1523,11 +1583,11 @@ class dn {
1523
1583
  groupId: t,
1524
1584
  messageIds: i
1525
1585
  });
1526
- ve.info("fillGroupReadCounts result", { groupId: t, batch: i, receipts: c });
1586
+ be.info("fillGroupReadCounts result", { groupId: t, batch: i, receipts: c });
1527
1587
  for (const u of c)
1528
1588
  u.count > 0 && this.store.updateMessageById(u.messageId, { groupReadCount: u.count });
1529
1589
  } catch (c) {
1530
- N.warn("[MessageDomain.fillGroupReadCounts] failed:", i, U(c));
1590
+ N.warn("[MessageDomain.fillGroupReadCounts] failed:", i, L(c));
1531
1591
  }
1532
1592
  }
1533
1593
  }
@@ -1540,7 +1600,7 @@ class dn {
1540
1600
  messageId: n
1541
1601
  });
1542
1602
  const o = (a = this.options.persistence) == null ? void 0 : a.markMessageRecalled;
1543
- o && se(() => o(n, this.currentUserId));
1603
+ o && oe(() => o(n, this.currentUserId));
1544
1604
  }
1545
1605
  /**
1546
1606
  * 删除消息:移除当前用户的服务端漫游历史(SDK5 `removeHistoryMessages`)。
@@ -1557,7 +1617,7 @@ class dn {
1557
1617
  messageIds: n
1558
1618
  });
1559
1619
  const o = (a = this.options.persistence) == null ? void 0 : a.deleteMessages;
1560
- o && se(() => o([...n]));
1620
+ o && oe(() => o([...n]));
1561
1621
  }
1562
1622
  /** 批量发送消息已读回执(统一 API,支持单聊/群聊) */
1563
1623
  async markMessagesRead(e, t, n) {
@@ -1583,17 +1643,17 @@ class dn {
1583
1643
  * 失败仅 warn 不阻塞进入会话(先标记后发送,失败回滚以便下次重试)。
1584
1644
  */
1585
1645
  async sendPendingReadReceipts(e, t) {
1586
- const o = this.store.getMessages(e).filter((a) => !a.isSelf && !j.has(a.msgServerId)).map((a) => a.msgServerId).filter((a) => !!a);
1646
+ const o = this.store.getMessages(e).filter((a) => !a.isSelf && !V.has(a.msgServerId)).map((a) => a.msgServerId).filter((a) => !!a);
1587
1647
  if (o.length !== 0) {
1588
1648
  N.info("[MessageDomain.sendPendingReadReceipts] 补发已读回执", { conversationId: e, conversationType: t, pendingCount: o.length, messageIds: o.slice(0, 5) });
1589
1649
  for (const a of o)
1590
- j.add(a);
1650
+ V.add(a);
1591
1651
  try {
1592
1652
  await this.markMessagesRead(e, t, o);
1593
1653
  } catch (a) {
1594
1654
  for (const r of o)
1595
- j.delete(r);
1596
- N.warn("[MessageDomain.sendPendingReadReceipts] failed:", e, U(a));
1655
+ V.delete(r);
1656
+ N.warn("[MessageDomain.sendPendingReadReceipts] failed:", e, L(a));
1597
1657
  }
1598
1658
  }
1599
1659
  }
@@ -1610,7 +1670,7 @@ class dn {
1610
1670
  const o = (await this.client.chatManager.getPinnedMessageList({
1611
1671
  conversationId: e,
1612
1672
  conversationType: t
1613
- })).items.map((a) => P(a.message, this.currentUserId));
1673
+ })).items.map((a) => H(a.message, this.currentUserId));
1614
1674
  return this.store.setPinnedMessages(e, o), o;
1615
1675
  }
1616
1676
  /** 翻译文本消息 */
@@ -1621,12 +1681,12 @@ class dn {
1621
1681
  targetLanguages: t
1622
1682
  });
1623
1683
  } catch (n) {
1624
- throw N.error("[MessageDomain.translateMessage] raw SDK error:", U(n)), n;
1684
+ throw N.error("[MessageDomain.translateMessage] raw SDK error:", L(n)), n;
1625
1685
  }
1626
1686
  }
1627
1687
  /** 语音消息转文字 */
1628
1688
  async transcribeVoiceMessage(e, t) {
1629
- if (!ze(e.body))
1689
+ if (!it(e.body))
1630
1690
  throw N.warn("[MessageDomain.transcribeVoiceMessage] not a voice message:", e), new Error("not a voice message");
1631
1691
  const n = {
1632
1692
  ...e.body,
@@ -1664,7 +1724,7 @@ class dn {
1664
1724
  messageIds: [n]
1665
1725
  }), N.info("[MessageDomain.markRead] 已读回执发送成功", { conversationId: e, conversationType: t, messageId: n });
1666
1726
  } catch (o) {
1667
- throw N.warn("[MessageDomain.markRead] 已读回执发送失败", { conversationId: e, conversationType: t, messageId: n, error: U(o) }), o;
1727
+ throw N.warn("[MessageDomain.markRead] 已读回执发送失败", { conversationId: e, conversationType: t, messageId: n, error: L(o) }), o;
1668
1728
  }
1669
1729
  }
1670
1730
  /** 获取群消息已读详情(自动翻页聚合全部已读成员) */
@@ -1702,12 +1762,12 @@ class dn {
1702
1762
  });
1703
1763
  }
1704
1764
  }
1705
- function ln(s, e) {
1706
- var u, f, m, g, d, l;
1707
- const t = Xt(s.lastMessage, void 0, e == null ? void 0 : e.lastMessageTextResolver, {
1765
+ function An(s, e) {
1766
+ var u, l, g, p, d, f;
1767
+ const t = gn(s.lastMessage, void 0, e == null ? void 0 : e.lastMessageTextResolver, {
1708
1768
  conversationId: s.conversationId,
1709
1769
  conversationType: s.conversationType
1710
- }), n = E(((u = s.lastMessage) == null ? void 0 : u.from) || ""), o = E(((m = (f = s.lastMessage) == null ? void 0 : f.sender) == null ? void 0 : m.userId) || ""), a = o || n, r = a ? (g = e == null ? void 0 : e.resolveSenderName) == null ? void 0 : g.call(e, a) : void 0, i = ((l = (d = s.lastMessage) == null ? void 0 : d.sender) == null ? void 0 : l.nickname) || r || o || n || "", c = Xe(s.conversationType, i, t);
1770
+ }), n = G(((u = s.lastMessage) == null ? void 0 : u.from) || ""), o = G(((g = (l = s.lastMessage) == null ? void 0 : l.sender) == null ? void 0 : g.userId) || ""), a = o || n, r = a ? (p = e == null ? void 0 : e.resolveSenderName) == null ? void 0 : p.call(e, a) : void 0, i = ((f = (d = s.lastMessage) == null ? void 0 : d.sender) == null ? void 0 : f.nickname) || r || o || n || "", c = ct(s.conversationType, i, t);
1711
1771
  return {
1712
1772
  id: s.conversationId,
1713
1773
  name: s.conversationName || s.conversationId,
@@ -1717,6 +1777,7 @@ function ln(s, e) {
1717
1777
  lastMessageText: c,
1718
1778
  // 保留群聊最后一条消息发送者 userId,供会话列表项在资料异步就绪后重新解析昵称
1719
1779
  lastMessageFrom: a || void 0,
1780
+ lastMessageSenderName: i || void 0,
1720
1781
  lastMessageTime: s.lastMessageAt,
1721
1782
  isPinned: s.isPinned ?? !1,
1722
1783
  pinnedTime: s.pinnedTimestamp,
@@ -1725,14 +1786,26 @@ function ln(s, e) {
1725
1786
  remindType: s.remindType
1726
1787
  };
1727
1788
  }
1728
- function te(s, e) {
1729
- return s.map((t) => ln(t, e));
1789
+ function se(s, e) {
1790
+ return s.map((t) => An(t, e));
1791
+ }
1792
+ const En = 20, Je = 3;
1793
+ function ve(s, e, t) {
1794
+ if (t.length <= En) {
1795
+ s.info(`getConversationList raw (${e})`, t);
1796
+ return;
1797
+ }
1798
+ s.info(`getConversationList raw (${e})`, {
1799
+ count: t.length,
1800
+ sampleSize: Je,
1801
+ sample: t.slice(0, Je)
1802
+ });
1730
1803
  }
1731
- const Ae = T("Conversation");
1732
- function gn(s) {
1804
+ const Ne = T("Conversation");
1805
+ function Gn(s) {
1733
1806
  return [...s].sort((e, t) => e.isPinned !== t.isPinned ? e.isPinned ? -1 : 1 : e.isPinned ? (t.pinnedTime ?? 0) - (e.pinnedTime ?? 0) : (t.lastMessageTime ?? 0) - (e.lastMessageTime ?? 0));
1734
1807
  }
1735
- function fn(s, e) {
1808
+ function Tn(s, e) {
1736
1809
  var o;
1737
1810
  const t = {}, n = [];
1738
1811
  for (const a of s) {
@@ -1742,10 +1815,10 @@ function fn(s, e) {
1742
1815
  lastMessage: a.lastMessage
1743
1816
  });
1744
1817
  }
1745
- n.length > 0 && Ae.info(`raw snippets (${e})`, { typeCount: t, suspects: n });
1818
+ n.length > 0 && Ne.info(`raw snippets (${e})`, { typeCount: t, suspects: n });
1746
1819
  }
1747
- const mn = 1e3;
1748
- class pn {
1820
+ const Un = 1e3;
1821
+ class Rn {
1749
1822
  constructor(e, t, n = {}) {
1750
1823
  this.client = e, this.store = t, this.hooks = n, this.channelAckSentAt = /* @__PURE__ */ new Map();
1751
1824
  }
@@ -1760,20 +1833,26 @@ class pn {
1760
1833
  }
1761
1834
  /** 从本地缓存读取会话列表 */
1762
1835
  syncLocal() {
1836
+ var o, a;
1763
1837
  const e = this.client.chatManager.getConversationList();
1764
- Ae.info("getConversationList raw (syncLocal)", e), fn(e, "syncLocal");
1765
- const t = te(e, {
1838
+ ve(Ne, "syncLocal", e), Tn(e, "syncLocal");
1839
+ const t = Array.from(new Set(e.filter((r) => r.conversationType === I.GROUPCHAT).map((r) => {
1840
+ var i, c, u;
1841
+ return G(((c = (i = r.lastMessage) == null ? void 0 : i.sender) == null ? void 0 : c.userId) || ((u = r.lastMessage) == null ? void 0 : u.from) || "");
1842
+ }).filter(Boolean)));
1843
+ (a = (o = this.hooks).prefillUserInfo) == null || a.call(o, t);
1844
+ const n = se(e, {
1766
1845
  resolveSenderName: this.hooks.resolveSenderName,
1767
1846
  lastMessageTextResolver: this.hooks.lastMessageTextResolver
1768
1847
  });
1769
- return this.store.setList(t), t;
1848
+ return this.store.setList(n), n;
1770
1849
  }
1771
1850
  /** 仅按原始快照重算现有会话摘要,保留本地字段和本地独有会话 */
1772
1851
  refreshPreviews() {
1773
1852
  const e = this.store.conversationList ?? [];
1774
1853
  if (e.length === 0)
1775
1854
  return;
1776
- const t = this.client.chatManager.getConversationList(), n = te(t, {
1855
+ const t = this.client.chatManager.getConversationList(), n = se(t, {
1777
1856
  resolveSenderName: this.hooks.resolveSenderName,
1778
1857
  lastMessageTextResolver: this.hooks.lastMessageTextResolver
1779
1858
  }), o = new Map(n.map((a) => [a.id, a.lastMessageText]));
@@ -1799,14 +1878,14 @@ class pn {
1799
1878
  } while (a);
1800
1879
  const r = this.store.conversationList ?? [], i = new Map(r.map((u) => [u.id, u])), c = /* @__PURE__ */ new Map();
1801
1880
  for (const u of o) {
1802
- const f = i.get(u.id);
1803
- c.set(u.id, f ? {
1881
+ const l = i.get(u.id);
1882
+ c.set(u.id, l ? {
1804
1883
  ...u,
1805
- name: (!u.name || u.name === u.id) && f.name && f.name !== f.id ? f.name : u.name,
1806
- avatar: u.avatar || f.avatar
1884
+ name: (!u.name || u.name === u.id) && l.name && l.name !== l.id ? l.name : u.name,
1885
+ avatar: u.avatar || l.avatar
1807
1886
  } : u);
1808
1887
  }
1809
- this.store.setList(gn(Array.from(c.values())));
1888
+ this.store.setList(Gn(Array.from(c.values())));
1810
1889
  return;
1811
1890
  }
1812
1891
  await this.client.chatManager.refreshSessionList({ includeEmpty: e });
@@ -1897,20 +1976,20 @@ class pn {
1897
1976
  if (n !== void 0 && n <= 0)
1898
1977
  return;
1899
1978
  const o = Date.now(), a = this.channelAckSentAt.get(e) || 0;
1900
- o - a < mn || (this.channelAckSentAt.set(e, o), await this.markRead(e, t));
1979
+ o - a < Un || (this.channelAckSentAt.set(e, o), await this.markRead(e, t));
1901
1980
  }
1902
1981
  /** 加载更多会话:SDK5 当前无分页游标,直接返回本地列表 */
1903
1982
  async loadMore(e) {
1904
1983
  const t = this.client.chatManager.getConversationList();
1905
- Ae.info("getConversationList raw (loadMore)", t);
1906
- const n = te(t, {
1984
+ ve(Ne, "loadMore", t);
1985
+ const n = se(t, {
1907
1986
  resolveSenderName: this.hooks.resolveSenderName,
1908
1987
  lastMessageTextResolver: this.hooks.lastMessageTextResolver
1909
1988
  });
1910
1989
  this.store.setList(n);
1911
1990
  }
1912
1991
  }
1913
- function hn(s) {
1992
+ function Ln(s) {
1914
1993
  if ("userId" in s && s.userId !== void 0) {
1915
1994
  const t = s;
1916
1995
  return {
@@ -1930,10 +2009,10 @@ function hn(s) {
1930
2009
  birth: e.birth,
1931
2010
  phone: e.phone,
1932
2011
  mail: e.mail,
1933
- ext: vn(e.ext)
2012
+ ext: _n(e.ext)
1934
2013
  };
1935
2014
  }
1936
- function vn(s) {
2015
+ function _n(s) {
1937
2016
  if (s)
1938
2017
  try {
1939
2018
  const e = JSON.parse(s);
@@ -1942,16 +2021,16 @@ function vn(s) {
1942
2021
  return;
1943
2022
  }
1944
2023
  }
1945
- function Ge(s) {
1946
- return s.map((e) => hn(e));
2024
+ function ke(s) {
2025
+ return s.map((e) => Ln(e));
1947
2026
  }
1948
- class In {
2027
+ class Dn {
1949
2028
  constructor(e, t, n = {}) {
1950
2029
  this.client = e, this.store = t, this.options = n;
1951
2030
  }
1952
2031
  /** 获取当前内存中的联系人列表 */
1953
2032
  syncLocal() {
1954
- const e = this.client.contactManager.getContacts(), t = Ge(e);
2033
+ const e = this.client.contactManager.getContacts(), t = ke(e);
1955
2034
  return this.store.setList(t), t;
1956
2035
  }
1957
2036
  /**
@@ -2007,7 +2086,7 @@ class In {
2007
2086
  const a = await e();
2008
2087
  return this.store.setBlocklist(a), a;
2009
2088
  }
2010
- const t = await this.client.contactManager.getBlocklist(), n = Ge(t);
2089
+ const t = await this.client.contactManager.getBlocklist(), n = ke(t);
2011
2090
  return this.store.setBlocklist(n), n;
2012
2091
  }
2013
2092
  /** 批量加入黑名单 */
@@ -2019,7 +2098,7 @@ class In {
2019
2098
  await this.client.contactManager.removeUserFromBlocklist({ userIds: e });
2020
2099
  }
2021
2100
  }
2022
- function Le(s) {
2101
+ function Fe(s) {
2023
2102
  const e = {
2024
2103
  groupId: s.groupId,
2025
2104
  groupName: s.name,
@@ -2033,10 +2112,10 @@ function Le(s) {
2033
2112
  };
2034
2113
  return s.role && (e.role = s.role), "avatarUrl" in s && (e.avatar = s.avatarUrl), "muteAllMembers" in s && (e.mute = s.muteAllMembers), "ownerId" in s && (e.owner = s.ownerId), "owner" in s && s.owner && (e.owner = s.owner.userId), "createdAt" in s && (e.created = s.createdAt), "messageBlocked" in s && (e.shieldgroup = s.messageBlocked), "ext" in s && (e.ext = s.ext), "inviteNeedConfirm" in s && (e.inviteNeedConfirm = s.inviteNeedConfirm), "joinedAt" in s && (e.joinedAt = s.joinedAt), e;
2035
2114
  }
2036
- function fe(s) {
2037
- return s.map((e) => Le(e));
2115
+ function Ie(s) {
2116
+ return s.map((e) => Fe(e));
2038
2117
  }
2039
- function Mn(s) {
2118
+ function Nn(s) {
2040
2119
  const e = s.user, t = {
2041
2120
  userId: e.userId,
2042
2121
  nickname: e.nickname,
@@ -2045,17 +2124,17 @@ function Mn(s) {
2045
2124
  };
2046
2125
  return "joinedAt" in s && (t.joinedAt = s.joinedAt), "muteExpire" in s && s.muteExpire !== void 0 && (t.muteExpire = s.muteExpire), "muteDuration" in s && s.muteDuration !== void 0 && (t.muteDuration = s.muteDuration), t;
2047
2126
  }
2048
- function Z(s) {
2049
- return s.map((e) => Mn(e));
2127
+ function te(s) {
2128
+ return s.map((e) => Nn(e));
2050
2129
  }
2051
- const re = T("UIKit:GroupDomain"), Ie = /* @__PURE__ */ new Map(), Me = /* @__PURE__ */ new Map(), ye = /* @__PURE__ */ new Map();
2052
- class yn {
2130
+ const ie = T("UIKit:GroupDomain"), we = /* @__PURE__ */ new Map(), Se = /* @__PURE__ */ new Map(), Ae = /* @__PURE__ */ new Map();
2131
+ class kn {
2053
2132
  constructor(e, t, n = {}) {
2054
2133
  this.client = e, this.store = t, this.options = n;
2055
2134
  }
2056
2135
  /** 获取已加入群组本地列表 */
2057
2136
  syncLocal() {
2058
- const e = this.client.groupManager.getJoinedGroupList(), t = fe(e);
2137
+ const e = this.client.groupManager.getJoinedGroupList(), t = Ie(e);
2059
2138
  return this.store.setList(t), t;
2060
2139
  }
2061
2140
  /**
@@ -2078,23 +2157,23 @@ class yn {
2078
2157
  }
2079
2158
  /** 获取单个群详情 */
2080
2159
  async fetchGroupInfo(e) {
2081
- const t = Ie.get(e);
2160
+ const t = we.get(e);
2082
2161
  if (t)
2083
2162
  return t;
2084
2163
  const n = (async () => {
2085
- const o = await this.client.groupManager.getGroupInfo({ groupId: e }), a = Le(o);
2164
+ const o = await this.client.groupManager.getGroupInfo({ groupId: e }), a = Fe(o);
2086
2165
  return this.store.updateGroup(e, a), a;
2087
2166
  })();
2088
- Ie.set(e, n);
2167
+ we.set(e, n);
2089
2168
  try {
2090
2169
  return await n;
2091
2170
  } finally {
2092
- Ie.delete(e);
2171
+ we.delete(e);
2093
2172
  }
2094
2173
  }
2095
2174
  /** 批量获取群详情 */
2096
2175
  async fetchGroupInfoList(e) {
2097
- const t = await this.client.groupManager.getGroupInfoList({ groupIds: e }), n = fe(t);
2176
+ const t = await this.client.groupManager.getGroupInfoList({ groupIds: e }), n = Ie(t);
2098
2177
  return n.forEach((o) => this.store.updateGroup(o.groupId, o)), n;
2099
2178
  }
2100
2179
  /** 创建群组(注入 createGroup 时整体委托业务接管:不调 SDK、不写本地缓存,权威数据由业务源负责) */
@@ -2117,7 +2196,7 @@ class yn {
2117
2196
  groupId: n.groupId,
2118
2197
  groupName: e.name,
2119
2198
  description: e.description,
2120
- role: k.OWNER,
2199
+ role: R.OWNER,
2121
2200
  memberCount: (((a = e.memberIds) == null ? void 0 : a.length) ?? 0) + 1,
2122
2201
  maxUsers: e.maxMembers,
2123
2202
  public: e.public ?? !1,
@@ -2147,7 +2226,7 @@ class yn {
2147
2226
  }
2148
2227
  /** 拉取群成员列表 */
2149
2228
  async fetchGroupMembers(e, t, n = 20) {
2150
- const o = await this.client.groupManager.getGroupMemberList({ groupId: e, cursor: t, pageSize: n }), a = Z(o.items);
2229
+ const o = await this.client.groupManager.getGroupMemberList({ groupId: e, cursor: t, pageSize: n }), a = te(o.items);
2151
2230
  if (t)
2152
2231
  this.store.appendGroupMembers(e, a);
2153
2232
  else {
@@ -2157,47 +2236,48 @@ class yn {
2157
2236
  } catch {
2158
2237
  }
2159
2238
  }
2160
- return { list: a, cursor: o.cursor, hasMore: o.hasMore ?? !1 };
2239
+ const r = new Map(this.store.getGroupMembers(e).map((c) => [c.userId, c]));
2240
+ return { list: a.map((c) => r.get(c.userId) ?? c), cursor: o.cursor, hasMore: o.hasMore ?? !1 };
2161
2241
  }
2162
2242
  /** 拉取并合并群管理员到成员缓存 */
2163
2243
  async syncGroupAdmins(e) {
2164
2244
  var o, a;
2165
- const t = Me.get(e);
2245
+ const t = Se.get(e);
2166
2246
  if (t)
2167
2247
  return t;
2168
2248
  if ((a = (o = this.store).isGroupAdminSynced) != null && a.call(o, e))
2169
2249
  return;
2170
2250
  const n = (async () => {
2171
2251
  var c, u;
2172
- const r = await this.client.groupManager.getGroup(e).getAdmins(), i = Z(
2173
- (r || []).map((f) => ({ user: f, role: k.ADMIN }))
2252
+ const r = await this.client.groupManager.getGroup(e).getAdmins(), i = te(
2253
+ (r || []).map((l) => ({ user: l, role: R.ADMIN }))
2174
2254
  );
2175
2255
  this.store.appendGroupMembers(e, i);
2176
- for (const f of i)
2177
- this.store.updateGroupMemberRole(e, f.userId, k.ADMIN);
2256
+ for (const l of i)
2257
+ this.store.updateGroupMemberRole(e, l.userId, R.ADMIN);
2178
2258
  (u = (c = this.store).markGroupAdminSynced) == null || u.call(c, e);
2179
2259
  })();
2180
- Me.set(e, n);
2260
+ Se.set(e, n);
2181
2261
  try {
2182
2262
  return await n;
2183
2263
  } finally {
2184
- Me.delete(e);
2264
+ Se.delete(e);
2185
2265
  }
2186
2266
  }
2187
2267
  /** 拉取群公告 */
2188
2268
  async fetchGroupAnnouncement(e) {
2189
- const t = ye.get(e);
2269
+ const t = Ae.get(e);
2190
2270
  if (t)
2191
2271
  return t;
2192
2272
  const n = (async () => {
2193
2273
  const a = (await this.client.groupManager.getGroupAnnouncement({ groupId: e })).announcement ?? "";
2194
2274
  return this.store.setGroupAnnouncement(e, a), a;
2195
2275
  })();
2196
- ye.set(e, n);
2276
+ Ae.set(e, n);
2197
2277
  try {
2198
2278
  return await n;
2199
2279
  } finally {
2200
- ye.delete(e);
2280
+ Ae.delete(e);
2201
2281
  }
2202
2282
  }
2203
2283
  /** 更新群公告 */
@@ -2218,11 +2298,11 @@ class yn {
2218
2298
  }
2219
2299
  /** 设置群管理员 */
2220
2300
  async addGroupAdmin(e, t) {
2221
- await this.client.groupManager.addGroupAdmin({ groupId: e, userId: t }), this.store.updateGroupMemberRole(e, t, k.ADMIN);
2301
+ await this.client.groupManager.addGroupAdmin({ groupId: e, userId: t }), this.store.updateGroupMemberRole(e, t, R.ADMIN);
2222
2302
  }
2223
2303
  /** 取消群管理员 */
2224
2304
  async removeGroupAdmin(e, t) {
2225
- await this.client.groupManager.removeGroupAdmin({ groupId: e, userId: t }), this.store.updateGroupMemberRole(e, t, k.MEMBER);
2305
+ await this.client.groupManager.removeGroupAdmin({ groupId: e, userId: t }), this.store.updateGroupMemberRole(e, t, R.MEMBER);
2226
2306
  }
2227
2307
  /** 接受群邀请 */
2228
2308
  async acceptGroupInvitation(e) {
@@ -2253,25 +2333,25 @@ class yn {
2253
2333
  * @param muteDuration 禁言时长,单位为毫秒;传 -1 表示永久禁言(SDK 5.0.0+ 语义)。
2254
2334
  */
2255
2335
  async muteGroupMembers(e, t, n) {
2256
- re.info("muteGroupMembers request raw", { groupId: e, userIds: t, muteDuration: n });
2336
+ ie.info("muteGroupMembers request raw", { groupId: e, userIds: t, muteDuration: n });
2257
2337
  const o = await this.client.groupManager.getGroup(e).muteMembers({ userIds: t, muteDuration: n });
2258
- re.info("muteGroupMembers response raw", o), this.store.addGroupMuteMembers(e, t);
2338
+ ie.info("muteGroupMembers response raw", o), this.store.addGroupMuteMembers(e, t);
2259
2339
  }
2260
2340
  /** 解除指定成员禁言 */
2261
2341
  async unmuteGroupMembers(e, t) {
2262
- re.info("unmuteGroupMembers request raw", { groupId: e, userIds: t });
2342
+ ie.info("unmuteGroupMembers request raw", { groupId: e, userIds: t });
2263
2343
  const n = await this.client.groupManager.getGroup(e).unmuteMembers({ userIds: t });
2264
- re.info("unmuteGroupMembers response raw", n), this.store.removeGroupMuteMembers(e, t);
2344
+ ie.info("unmuteGroupMembers response raw", n), this.store.removeGroupMuteMembers(e, t);
2265
2345
  }
2266
2346
  /** 获取群禁言列表 */
2267
2347
  async getGroupMuteList(e, t, n) {
2268
2348
  const o = await this.client.groupManager.getGroup(e).getMuteList({ pageNum: t, pageSize: n }), a = Array.isArray(o) ? o : (o == null ? void 0 : o.data) ?? [];
2269
- return this.store.setGroupMuteList(e, Z(a)), o;
2349
+ return this.store.setGroupMuteList(e, te(a)), o;
2270
2350
  }
2271
2351
  /** 获取群黑名单 */
2272
2352
  async getGroupBlocklist(e, t, n) {
2273
2353
  const o = await this.client.groupManager.getGroup(e).getBlocklist({ pageNum: t, pageSize: n }), a = Array.isArray(o) ? o : (o == null ? void 0 : o.data) ?? [];
2274
- return this.store.setGroupBlocklist(e, Z(a)), o;
2354
+ return this.store.setGroupBlocklist(e, te(a)), o;
2275
2355
  }
2276
2356
  /** 将成员加入群黑名单 */
2277
2357
  async blockGroupMembers(e, t) {
@@ -2284,7 +2364,7 @@ class yn {
2284
2364
  /** 获取群白名单 */
2285
2365
  async getGroupAllowlist(e) {
2286
2366
  const t = await this.client.groupManager.getGroup(e).getAllowlist(), n = Array.isArray(t) ? t : (t == null ? void 0 : t.data) ?? [];
2287
- return this.store.setGroupAllowlist(e, Z(n)), t;
2367
+ return this.store.setGroupAllowlist(e, te(n)), t;
2288
2368
  }
2289
2369
  /** 将成员加入群白名单 */
2290
2370
  async addUsersToGroupAllowlist(e, t) {
@@ -2349,75 +2429,162 @@ class yn {
2349
2429
  await this.client.groupManager.rejectInvitation({ groupId: e });
2350
2430
  }
2351
2431
  }
2352
- function nt(s, e) {
2432
+ const Ee = T("UIKit:PresenceDomain"), Ge = 100;
2433
+ function Te(s, e) {
2434
+ const t = [];
2435
+ for (let n = 0; n < s.length; n += e)
2436
+ t.push(s.slice(n, n + e));
2437
+ return t;
2438
+ }
2439
+ function ft(s, e) {
2353
2440
  if (!s)
2354
2441
  return "offline";
2355
2442
  if (!e)
2356
2443
  return "online";
2357
- const t = e.toLowerCase(), n = X.ONLINE.toLowerCase(), o = X.AWAY.toLowerCase(), a = X.BUSY.toLowerCase(), r = X.DO_NOT_DISTURB.toLowerCase(), i = X.OFFLINE.toLowerCase();
2444
+ const t = e.toLowerCase(), n = ee.ONLINE.toLowerCase(), o = ee.AWAY.toLowerCase(), a = ee.BUSY.toLowerCase(), r = ee.DO_NOT_DISTURB.toLowerCase(), i = ee.OFFLINE.toLowerCase();
2358
2445
  return t === n ? "online" : t === o ? "away" : t === a ? "busy" : t === r ? "doNotDisturb" : t === i ? "offline" : "custom";
2359
2446
  }
2360
- function Pe(s) {
2447
+ function $e(s) {
2361
2448
  const e = s.publisher || "";
2362
2449
  if (!e)
2363
2450
  return null;
2364
2451
  const t = s.statusList || {}, n = Object.values(t).some((a) => Number(a) === 1), o = s.ext || "";
2365
2452
  return {
2366
2453
  userId: e,
2367
- status: nt(n, o),
2454
+ status: ft(n, o),
2368
2455
  ext: o,
2369
2456
  lastTime: s.latestTime || Date.now()
2370
2457
  };
2371
2458
  }
2372
- class bn {
2459
+ class On {
2373
2460
  constructor(e, t, n = {}) {
2374
2461
  this.client = e, this.store = t, this.options = n;
2375
2462
  }
2376
- /** 订阅用户在线状态 */
2463
+ /** 订阅用户在线状态(>100 人自动分片;任一分片失败会在其余分片完成后抛出首个错误) */
2377
2464
  async subscribe(e, t = 7 * 24 * 60 * 60) {
2378
- var r;
2379
- const n = (r = this.options.presenceRepository) == null ? void 0 : r.subscribe;
2465
+ var c;
2466
+ const n = (c = this.options.presenceRepository) == null ? void 0 : c.subscribe;
2380
2467
  if (n)
2381
2468
  return await n(e, t), [];
2382
2469
  if (!this.client.isConnected)
2383
2470
  return [];
2384
- const o = await this.client.presenceManager.subscribePresence({
2385
- userIds: e,
2386
- expiry: t
2387
- });
2388
- this.store.setSubscribed(e);
2389
- const a = o.map(Pe).filter((i) => i !== null);
2390
- return this.store.updateBatch(a), a;
2471
+ const o = Array.from(new Set(e.filter(Boolean)));
2472
+ if (o.length === 0)
2473
+ return [];
2474
+ const a = [];
2475
+ let r;
2476
+ const i = Te(o, Ge);
2477
+ for (const u of i)
2478
+ try {
2479
+ const l = await this.client.presenceManager.subscribePresence({
2480
+ userIds: u,
2481
+ expiry: t
2482
+ });
2483
+ this.store.setSubscribed(u);
2484
+ const g = l.map($e).filter((p) => p !== null);
2485
+ this.store.updateBatch(g), a.push(...g);
2486
+ } catch (l) {
2487
+ r === void 0 && (r = l, Ee.warn("[PresenceDomain] subscribePresence chunk failed:", {
2488
+ chunkSize: u.length,
2489
+ chunks: i.length
2490
+ }));
2491
+ }
2492
+ if (r !== void 0)
2493
+ throw r;
2494
+ return a;
2391
2495
  }
2392
- /** 取消订阅 */
2496
+ /** 取消订阅(>100 人分片;清理语义,分片失败仅告警不抛出,避免调用方 void 时产生未处理拒绝) */
2393
2497
  async unsubscribe(e) {
2394
- var n;
2395
- const t = (n = this.options.presenceRepository) == null ? void 0 : n.unsubscribe;
2498
+ var o;
2499
+ const t = (o = this.options.presenceRepository) == null ? void 0 : o.unsubscribe;
2396
2500
  if (t) {
2397
2501
  await t(e);
2398
2502
  return;
2399
2503
  }
2400
- this.client.isConnected && await this.client.presenceManager.unsubscribePresence({ userIds: e });
2504
+ if (!this.client.isConnected)
2505
+ return;
2506
+ const n = Array.from(new Set(e.filter(Boolean)));
2507
+ for (const a of Te(n, Ge))
2508
+ try {
2509
+ await this.client.presenceManager.unsubscribePresence({ userIds: a });
2510
+ } catch (r) {
2511
+ Ee.warn("[PresenceDomain] unsubscribePresence chunk failed:", {
2512
+ chunkSize: a.length,
2513
+ err: r
2514
+ });
2515
+ }
2401
2516
  }
2402
- /** 主动查询在线状态 */
2517
+ /** 主动查询在线状态(>100 人分片;任一分片失败会在其余分片完成后抛出首个错误) */
2403
2518
  async fetchStatus(e) {
2404
- var a;
2405
- const t = (a = this.options.presenceRepository) == null ? void 0 : a.fetchStatus;
2519
+ var i;
2520
+ const t = (i = this.options.presenceRepository) == null ? void 0 : i.fetchStatus;
2406
2521
  if (t) {
2407
- const r = await t(e);
2408
- return this.store.updateBatch(r), r;
2522
+ const c = await t(e);
2523
+ return this.store.updateBatch(c), c;
2409
2524
  }
2410
2525
  if (!this.client.isConnected)
2411
2526
  return [];
2412
- const o = (await this.client.presenceManager.getPresenceStatus({ userIds: e })).map(Pe).filter((r) => r !== null);
2413
- return this.store.updateBatch(o), o;
2527
+ const n = Array.from(new Set(e.filter(Boolean)));
2528
+ if (n.length === 0)
2529
+ return [];
2530
+ const o = [];
2531
+ let a;
2532
+ const r = Te(n, Ge);
2533
+ for (const c of r)
2534
+ try {
2535
+ const l = (await this.client.presenceManager.getPresenceStatus({ userIds: c })).map($e).filter((g) => g !== null);
2536
+ this.store.updateBatch(l), o.push(...l);
2537
+ } catch (u) {
2538
+ a === void 0 && (a = u, Ee.warn("[PresenceDomain] getPresenceStatus chunk failed:", {
2539
+ chunkSize: c.length,
2540
+ chunks: r.length
2541
+ }));
2542
+ }
2543
+ if (a !== void 0)
2544
+ throw a;
2545
+ return o;
2414
2546
  }
2415
2547
  /** 发布自定义在线状态 */
2416
2548
  async publish(e) {
2417
2549
  this.client.isConnected && await this.client.presenceManager.publishPresence({ customStatus: e });
2418
2550
  }
2419
2551
  }
2420
- const F = T("UIKit:UserInfoDomain"), Be = [
2552
+ const P = T("UIKit:UserInfoDomain"), F = 100, xn = 300;
2553
+ function Pn(s) {
2554
+ var a;
2555
+ const e = s, t = ((a = e == null ? void 0 : e.details) == null ? void 0 : a.httpStatus) ?? (e == null ? void 0 : e.httpStatus);
2556
+ if (t === 429 || t !== void 0 && t >= 500)
2557
+ return !0;
2558
+ if (t !== void 0)
2559
+ return !1;
2560
+ const n = Number(e == null ? void 0 : e.code);
2561
+ if ([2, 301, 302, 303, 304].includes(n))
2562
+ return !0;
2563
+ if ((e == null ? void 0 : e.code) !== void 0)
2564
+ return !1;
2565
+ const o = s instanceof Error ? s.message : String(s ?? "");
2566
+ return /network|failed to fetch|timeout|timed out/i.test(o);
2567
+ }
2568
+ function Bn(s) {
2569
+ var t, n, o;
2570
+ const e = s;
2571
+ return {
2572
+ code: e == null ? void 0 : e.code,
2573
+ httpStatus: ((t = e == null ? void 0 : e.details) == null ? void 0 : t.httpStatus) ?? (e == null ? void 0 : e.httpStatus),
2574
+ reason: ((n = e == null ? void 0 : e.details) == null ? void 0 : n.reasonKey) ?? ((o = e == null ? void 0 : e.details) == null ? void 0 : o.reason) ?? (e == null ? void 0 : e.reason),
2575
+ message: e == null ? void 0 : e.message
2576
+ };
2577
+ }
2578
+ async function Fn(s) {
2579
+ try {
2580
+ return await s();
2581
+ } catch (e) {
2582
+ if (!Pn(e))
2583
+ throw e;
2584
+ return await new Promise((t) => setTimeout(t, xn)), s();
2585
+ }
2586
+ }
2587
+ const Ue = [
2421
2588
  "nickname",
2422
2589
  "avatarUrl",
2423
2590
  "mail",
@@ -2427,10 +2594,29 @@ const F = T("UIKit:UserInfoDomain"), Be = [
2427
2594
  "birth",
2428
2595
  "ext"
2429
2596
  ];
2430
- class Cn {
2597
+ class Hn {
2431
2598
  constructor(e, t, n = {}, o) {
2432
2599
  this.client = e, this.store = t, this.userInfoRepository = n, this.onSubscriptionPermissionError = o, this.handlerId = "uikit-user-info", this.subscribeQueue = [], this.subscribeFlushPromise = null, this.fetchQueue = [], this.fetchFlushPromise = null, this.hasLoggedPermissionError = !1;
2433
2600
  }
2601
+ readCachedUserInfos(e) {
2602
+ var t, n;
2603
+ try {
2604
+ return ((n = (t = this.userInfoRepository).readCachedUserInfos) == null ? void 0 : n.call(t, Array.from(new Set(e.filter(Boolean))))) ?? [];
2605
+ } catch {
2606
+ return [];
2607
+ }
2608
+ }
2609
+ prefillUserInfos(e) {
2610
+ const t = this.readCachedUserInfos(e);
2611
+ if (t.length === 0)
2612
+ return [];
2613
+ this.store.setUserInfos(t);
2614
+ for (const n of t) {
2615
+ const o = Ue.filter((a) => n[a] !== void 0);
2616
+ o.length > 0 && this.store.markFetchedAttributes([n.userId], o);
2617
+ }
2618
+ return t;
2619
+ }
2434
2620
  /**
2435
2621
  * 启动用户资料变更事件监听。应在 SDK 初始化完成后调用。
2436
2622
  */
@@ -2439,19 +2625,17 @@ class Cn {
2439
2625
  }
2440
2626
  /**
2441
2627
  * 批量获取用户资料;已缓存(且请求属性已覆盖)或正在加载中的 userId 会被跳过。
2442
- * 同一事件循环内的多次调用会合批为一次底层请求(微任务 flush,与 subscribe 合批同构):
2443
- * flush 时合并所有调用的 userIds(去重)与 attributes(并集),只发一次请求,
2628
+ * 同一事件循环内的多次调用会先微任务合批,再按 100 人顺序分片(与 subscribe 合批同构):
2629
+ * flush 时合并所有调用的 userIds(去重)与 attributes(并集),
2444
2630
  * 每个原始调用各自 resolve 回「自己请求的 userIds 对应的 UserInfo[]」(从 store 缓存读回)。
2445
2631
  * @param userIds 目标用户 ID 列表
2446
2632
  * @param attributes 需要查询的属性,默认全量 8 个属性
2447
2633
  */
2448
- async fetchUserInfos(e, t = Be) {
2449
- if (!this.client.isConnected)
2450
- return [];
2451
- const n = Array.from(new Set(e.filter(Boolean)));
2452
- return n.length === 0 ? [] : new Promise((o) => {
2453
- this.fetchQueue.push({ userIds: n, attributes: t, resolve: o }), this.scheduleFetchFlush();
2454
- });
2634
+ async fetchUserInfos(e, t = Ue, n) {
2635
+ const o = Array.from(new Set(e.filter(Boolean)));
2636
+ return o.length === 0 ? [] : this.client.isConnected ? new Promise((a) => {
2637
+ this.fetchQueue.push({ userIds: o, attributes: t, options: n, resolve: a }), this.scheduleFetchFlush();
2638
+ }) : (this.store.markFetchFailed(o), []);
2455
2639
  }
2456
2640
  scheduleFetchFlush() {
2457
2641
  this.fetchFlushPromise || (this.fetchFlushPromise = Promise.resolve().then(() => this.flushFetchQueue()));
@@ -2460,31 +2644,61 @@ class Cn {
2460
2644
  const e = this.fetchQueue;
2461
2645
  this.fetchQueue = [];
2462
2646
  try {
2463
- const t = e.map((a) => ({
2464
- ...a,
2465
- missingIds: a.userIds.filter(
2466
- (r) => !this.store.areAttributesFetched(r, a.attributes) && !this.store.isLoading(r) && !this.store.isFetchFailed(r)
2647
+ const t = Array.from(new Set(e.flatMap((l) => l.userIds.filter(
2648
+ (g) => !this.store.areAttributesFetched(g, l.attributes) && !this.store.isLoading(g) && !this.store.isFetchFailed(g)
2649
+ )))), n = this.prefillUserInfos(t).length, o = e.map((l) => ({
2650
+ ...l,
2651
+ missingIds: l.userIds.filter(
2652
+ (g) => !this.store.areAttributesFetched(g, l.attributes) && !this.store.isLoading(g) && !this.store.isFetchFailed(g)
2467
2653
  )
2468
- })), n = Array.from(new Set(t.flatMap((a) => a.missingIds))), o = Array.from(new Set(e.flatMap((a) => a.attributes)));
2469
- if (n.length > 0) {
2470
- this.store.markLoading(n);
2471
- try {
2472
- const a = this.userInfoRepository.fetchUserInfos ? await this.fetchFromRepository(n) : await this.fetchFromSdk(n, o), r = new Set(a.map((c) => c.userId).filter(Boolean)), i = n.filter((c) => !r.has(c));
2473
- i.length > 0 && this.store.markFetchFailed(i), this.store.setUserInfos(a), this.store.markFetchedAttributes(n, o);
2474
- } catch (a) {
2475
- F.warn("[UserInfoDomain] fetchUserInfos failed:", U(a)), this.store.markFetchFailed(n);
2476
- } finally {
2477
- this.store.markLoaded(n);
2478
- }
2479
- }
2480
- for (const a of t)
2481
- a.resolve(
2482
- a.userIds.map((r) => this.store.getUserInfo(r)).filter((r) => !!r)
2654
+ })), a = Array.from(new Set(o.flatMap((l) => l.missingIds))), r = Array.from(new Set(e.flatMap((l) => l.attributes))), i = Array.from(new Set(e.map((l) => {
2655
+ var g;
2656
+ return ((g = l.options) == null ? void 0 : g.source) ?? "unknown";
2657
+ }))), c = i.join(",");
2658
+ let u = 0;
2659
+ if (a.length > 0)
2660
+ for (let l = 0; l < a.length; l += F)
2661
+ await this.fetchChunk(
2662
+ a.slice(l, l + F),
2663
+ r,
2664
+ { source: c },
2665
+ () => {
2666
+ u += 1;
2667
+ }
2668
+ );
2669
+ P.info("[UserInfoDomain] fetch", {
2670
+ sources: i,
2671
+ prefilled: n,
2672
+ requested: new Set(e.flatMap((l) => l.userIds)).size,
2673
+ missing: a.length,
2674
+ chunks: Math.ceil(a.length / F),
2675
+ failedChunks: u
2676
+ });
2677
+ for (const l of o)
2678
+ l.resolve(
2679
+ l.userIds.map((g) => this.store.getUserInfo(g)).filter((g) => !!g)
2483
2680
  );
2484
2681
  } finally {
2485
2682
  this.fetchFlushPromise = null, this.fetchQueue.length > 0 && this.scheduleFetchFlush();
2486
2683
  }
2487
2684
  }
2685
+ async fetchChunk(e, t, n, o) {
2686
+ this.store.markLoading(e);
2687
+ try {
2688
+ const a = await Fn(() => this.userInfoRepository.fetchUserInfos ? this.fetchFromRepository(e) : this.fetchFromSdk(e, t)), r = new Set(a.map((u) => u.userId).filter(Boolean)), i = e.filter((u) => !r.has(u));
2689
+ i.length > 0 && this.store.markFetchFailed(i), this.store.setUserInfos(a);
2690
+ const c = e.filter((u) => r.has(u));
2691
+ return c.length > 0 && this.store.markFetchedAttributes(c, t), a;
2692
+ } catch (a) {
2693
+ return o == null || o(), P.warn("[UserInfoDomain] chunk failed", {
2694
+ source: (n == null ? void 0 : n.source) ?? "unknown",
2695
+ chunkSize: e.length,
2696
+ ...Bn(a)
2697
+ }), this.store.markFetchFailed(e), [];
2698
+ } finally {
2699
+ this.store.markLoaded(e);
2700
+ }
2701
+ }
2488
2702
  async fetchFromSdk(e, t) {
2489
2703
  const n = await this.client.userInfoManager.getUserInfoByAttribute({
2490
2704
  userIds: e,
@@ -2507,25 +2721,41 @@ class Cn {
2507
2721
  }
2508
2722
  /**
2509
2723
  * 批量订阅陌生人资料变更通知。
2510
- * 同一事件循环内的多次调用会合并为一次 SDK 请求;
2724
+ * 同一事件循环内的多次调用先合批,再按 100 人顺序分片;
2511
2725
  * 若服务端返回无权限,则自动熔断后续订阅并缓存失败用户,避免重复请求与控制台警告刷屏。
2512
2726
  */
2513
- async subscribeUserInfos(e) {
2727
+ async subscribeUserInfos(e, t) {
2514
2728
  if (!this.client.isConnected || this.store.isSubscriptionDisabled())
2515
2729
  return;
2516
- const t = Array.from(new Set(e.filter(Boolean))).filter(
2517
- (n) => !this.store.isSubscribed(n) && !this.store.isSubscribeFailed(n)
2730
+ const n = Array.from(new Set(e.filter(Boolean))).filter(
2731
+ (o) => !this.store.isSubscribed(o) && !this.store.isSubscribeFailed(o)
2518
2732
  );
2519
- if (t.length !== 0)
2520
- return this.subscribeQueue.push(...t), this.subscribeFlushPromise ? this.subscribeFlushPromise : (this.subscribeFlushPromise = Promise.resolve().then(() => this.flushSubscribeQueue()), this.subscribeFlushPromise);
2733
+ if (n.length !== 0)
2734
+ return this.subscribeQueue.push({ userIds: n, options: t }), this.subscribeFlushPromise ? this.subscribeFlushPromise : (this.subscribeFlushPromise = Promise.resolve().then(() => this.flushSubscribeQueue()), this.subscribeFlushPromise);
2521
2735
  }
2522
2736
  async flushSubscribeQueue() {
2523
- const e = Array.from(new Set(this.subscribeQueue));
2737
+ const e = this.subscribeQueue;
2524
2738
  this.subscribeQueue = [];
2739
+ const t = Array.from(new Set(e.flatMap((o) => o.userIds))), n = Array.from(new Set(e.map((o) => {
2740
+ var a;
2741
+ return ((a = o.options) == null ? void 0 : a.source) ?? "unknown";
2742
+ })));
2743
+ P.info("[UserInfoDomain] subscribe", {
2744
+ sources: n,
2745
+ requested: t.length,
2746
+ chunks: Math.ceil(t.length / F)
2747
+ });
2525
2748
  try {
2526
- await this.client.userInfoManager.subscribeUsersInfo({ userIds: e }), this.store.markSubscribed(e);
2527
- } catch (t) {
2528
- this.handleSubscribeError(t, e);
2749
+ for (let o = 0; o < t.length; o += F) {
2750
+ const a = t.slice(o, o + F);
2751
+ try {
2752
+ await this.client.userInfoManager.subscribeUsersInfo({ userIds: a }), this.store.markSubscribed(a);
2753
+ } catch (r) {
2754
+ const i = this.isPermissionError(r);
2755
+ if (this.handleSubscribeError(r, a), i)
2756
+ break;
2757
+ }
2758
+ }
2529
2759
  } finally {
2530
2760
  this.subscribeFlushPromise = null, this.subscribeQueue.length > 0 && (this.subscribeFlushPromise = Promise.resolve().then(() => this.flushSubscribeQueue()));
2531
2761
  }
@@ -2533,30 +2763,28 @@ class Cn {
2533
2763
  handleSubscribeError(e, t) {
2534
2764
  var n;
2535
2765
  if (this.isPermissionError(e)) {
2536
- this.store.markSubscribeFailed(t), this.store.disableSubscription(), this.hasLoggedPermissionError || (this.hasLoggedPermissionError = !0, F.warn(
2766
+ this.store.markSubscribeFailed(t), this.store.disableSubscription(), this.hasLoggedPermissionError || (this.hasLoggedPermissionError = !0, P.warn(
2537
2767
  "[UserInfoDomain] 用户资料订阅无权限或服务未开通,已自动关闭订阅。后续陌生人资料变更将不会实时推送,拉取到的资料仍可正常展示。",
2538
- U(e)
2768
+ L(e)
2539
2769
  ), (n = this.onSubscriptionPermissionError) == null || n.call(this));
2540
2770
  return;
2541
2771
  }
2542
- this.store.markSubscribeFailed(t), F.warn("[UserInfoDomain] subscribeUserInfos failed:", U(e));
2772
+ this.store.markSubscribeFailed(t), P.warn("[UserInfoDomain] subscribeUserInfos failed:", L(e));
2543
2773
  }
2544
2774
  isPermissionError(e) {
2545
2775
  var n, o;
2546
2776
  if (!e || typeof e != "object")
2547
2777
  return !1;
2548
2778
  const t = e;
2549
- return t.code === 210 || ((n = t.details) == null ? void 0 : n.httpStatus) === 403 || ((o = t.details) == null ? void 0 : o.reason) === "service_forbidden";
2779
+ return t.code === 210 || t.code === 1600 || ((n = t.details) == null ? void 0 : n.httpStatus) === 403 || ((o = t.details) == null ? void 0 : o.reason) === "service_forbidden";
2550
2780
  }
2551
2781
  /**
2552
2782
  * 获取当前登录用户自己的资料(默认全量属性,保证签名等登录后回显)。
2553
2783
  */
2554
- async fetchOwnInfo(e = Be) {
2555
- const t = this.client.currentUserId;
2556
- if (!t)
2557
- return;
2558
- const [n] = await this.fetchUserInfos([t], e);
2559
- return n;
2784
+ async fetchOwnInfo(e = Ue, t) {
2785
+ const n = this.client.currentUserId;
2786
+ if (n)
2787
+ return this.client.isConnected ? (!this.store.isLoading(n) && !this.store.isFetchFailed(n) && this.prefillUserInfos([n]), this.store.areAttributesFetched(n, e) || this.store.isLoading(n) || this.store.isFetchFailed(n) ? this.store.getUserInfo(n) : (await this.fetchChunk([n], e, t), this.store.getUserInfo(n))) : (this.store.markFetchFailed([n]), this.store.getUserInfo(n));
2560
2788
  }
2561
2789
  /**
2562
2790
  * 更新当前登录用户资料。
@@ -2567,7 +2795,7 @@ class Cn {
2567
2795
  const t = await this.client.userInfoManager.updateOwnInfo(e);
2568
2796
  return this.store.setUserInfo(t), t;
2569
2797
  } catch (t) {
2570
- F.warn("[UserInfoDomain] updateOwnInfo failed:", U(t));
2798
+ P.warn("[UserInfoDomain] updateOwnInfo failed:", L(t));
2571
2799
  return;
2572
2800
  }
2573
2801
  }
@@ -2580,7 +2808,7 @@ class Cn {
2580
2808
  const n = await this.client.userInfoManager.updateOwnInfoByAttribute(e, t);
2581
2809
  return this.store.setUserInfo(n), n;
2582
2810
  } catch (n) {
2583
- F.warn("[UserInfoDomain] updateOwnInfoByAttribute failed:", U(n));
2811
+ P.warn("[UserInfoDomain] updateOwnInfoByAttribute failed:", L(n));
2584
2812
  return;
2585
2813
  }
2586
2814
  }
@@ -2592,10 +2820,13 @@ class Cn {
2592
2820
  return;
2593
2821
  const t = Array.from(new Set(e.filter(Boolean)));
2594
2822
  if (t.length !== 0)
2595
- try {
2596
- await this.client.userInfoManager.unsubscribeUsersInfo({ userIds: t }), this.store.markUnsubscribed(t);
2597
- } catch (n) {
2598
- F.warn("[UserInfoDomain] unsubscribeUsersInfo failed:", U(n));
2823
+ for (let n = 0; n < t.length; n += F) {
2824
+ const o = t.slice(n, n + F);
2825
+ try {
2826
+ await this.client.userInfoManager.unsubscribeUsersInfo({ userIds: o }), this.store.markUnsubscribed(o);
2827
+ } catch (a) {
2828
+ P.warn("[UserInfoDomain] unsubscribeUsersInfo failed:", L(a));
2829
+ }
2599
2830
  }
2600
2831
  }
2601
2832
  /**
@@ -2607,7 +2838,7 @@ class Cn {
2607
2838
  try {
2608
2839
  return await this.client.userInfoManager.getSubscribedUsers();
2609
2840
  } catch (e) {
2610
- return F.warn("[UserInfoDomain] getSubscribedUsers failed:", U(e)), [];
2841
+ return P.warn("[UserInfoDomain] getSubscribedUsers failed:", L(e)), [];
2611
2842
  }
2612
2843
  }
2613
2844
  /**
@@ -2634,87 +2865,88 @@ class Cn {
2634
2865
  });
2635
2866
  }
2636
2867
  }
2637
- const _ = T("UIKit:ConnEvents");
2638
- function wn(s, e = {}) {
2868
+ const D = T("UIKit:ConnEvents");
2869
+ function Kn(s, e = {}) {
2639
2870
  return {
2640
2871
  onConnecting: () => {
2641
- _.info("onConnecting"), s.client.setConnecting(!0);
2872
+ D.info("onConnecting"), s.client.setConnecting(!0);
2642
2873
  },
2643
2874
  onConnected: () => {
2644
- _.info("onConnected"), s.client.setConnected(!0), s.client.setConnecting(!1), s.client.setHasConnectedOnce(!0);
2875
+ var t, n;
2876
+ D.info("onConnected"), s.client.setConnected(!0), s.client.setConnecting(!1), s.client.setHasConnectedOnce(!0), (n = (t = s.userInfo) == null ? void 0 : t.clearFetchFailed) == null || n.call(t);
2645
2877
  },
2646
2878
  onDisconnected: (t) => {
2647
- _.info("onDisconnected", t ? { reason: t.reason, errorCode: t.errorCode } : void 0), s.client.setConnected(!1), s.client.setConnecting(!1), bt(t == null ? void 0 : t.errorCode) && s.client.setKicked(t.errorCode);
2879
+ D.info("onDisconnected", t ? { reason: t.reason, errorCode: t.errorCode } : void 0), s.client.setConnected(!1), s.client.setConnecting(!1), Dt(t == null ? void 0 : t.errorCode) && s.client.setKicked(t.errorCode);
2648
2880
  },
2649
2881
  onReconnectFailed: () => {
2650
- _.info("onReconnectFailed"), s.client.setConnecting(!1), _.error("Auto-reconnect failed after max retries");
2882
+ D.info("onReconnectFailed"), s.client.setConnecting(!1), D.error("Auto-reconnect failed after max retries");
2651
2883
  },
2652
2884
  onTokenWillExpire: () => {
2653
2885
  var t;
2654
- _.info("onTokenWillExpire"), _.warn("Token will expire"), (t = e.onTokenWillExpire) == null || t.call(e);
2886
+ D.info("onTokenWillExpire"), D.warn("Token will expire"), (t = e.onTokenWillExpire) == null || t.call(e);
2655
2887
  },
2656
2888
  onTokenExpired: () => {
2657
2889
  var t;
2658
- _.info("onTokenExpired"), _.error("Token expired"), (t = e.onTokenExpired) == null || t.call(e);
2890
+ D.info("onTokenExpired"), D.error("Token expired"), (t = e.onTokenExpired) == null || t.call(e);
2659
2891
  },
2660
2892
  onOfflineMessageSyncStart: () => {
2661
- _.info("onOfflineMessageSyncStart"), s.conversation.conversationsLoaded || s.message.setSyncingMessages(!0);
2893
+ D.info("onOfflineMessageSyncStart"), s.conversation.conversationsLoaded || s.message.setSyncingMessages(!0);
2662
2894
  },
2663
2895
  onOfflineMessageSyncFinish: () => {
2664
- _.info("onOfflineMessageSyncFinish"), s.message.setSyncingMessages(!1);
2896
+ D.info("onOfflineMessageSyncFinish"), s.message.setSyncingMessages(!1);
2665
2897
  }
2666
2898
  };
2667
2899
  }
2668
- const st = T("UIKit:SyncStatus"), z = Gt({
2900
+ const gt = T("UIKit:SyncStatus"), Y = Pt({
2669
2901
  conversation: { status: "idle" },
2670
2902
  contact: { status: "idle" },
2671
2903
  group: { status: "idle" }
2672
2904
  });
2673
- let ne = null;
2674
- function Sn(s) {
2675
- return ne = s, () => {
2676
- ne = null;
2905
+ let re = null;
2906
+ function qn(s) {
2907
+ return re = s, () => {
2908
+ re = null;
2677
2909
  };
2678
2910
  }
2679
- function be(s, e) {
2680
- const t = z[s];
2681
- t.status = e.status, e.finishedAt !== void 0 && (t.finishedAt = e.finishedAt), e.error !== void 0 && (t.error = e.error), st.info(`sync ${s} -> ${e.status}`, e.error ? { stage: e.error.stage, retryable: e.error.retryable, message: e.error.message } : void 0), ne == null || ne({
2911
+ function Re(s, e) {
2912
+ const t = Y[s];
2913
+ t.status = e.status, e.finishedAt !== void 0 && (t.finishedAt = e.finishedAt), e.error !== void 0 && (t.error = e.error), gt.info(`sync ${s} -> ${e.status}`, e.error ? { stage: e.error.stage, retryable: e.error.retryable, message: e.error.message } : void 0), re == null || re({
2682
2914
  type: s,
2683
2915
  status: e.status === "idle" ? "syncing" : e.status,
2684
2916
  error: e.error
2685
2917
  });
2686
2918
  }
2687
- function An() {
2688
- const s = Object.keys(z);
2919
+ function jn() {
2920
+ const s = Object.keys(Y);
2689
2921
  for (const e of s)
2690
- z[e] = { status: "idle" };
2691
- st.info("sync status reset(事件反注册/登出)");
2692
- }
2693
- function es() {
2694
- const s = me(() => ({ ...z })), e = me(
2695
- () => Object.values(z).some((n) => n.status === "syncing")
2696
- ), t = me(
2697
- () => Object.values(z).every((n) => n.status === "success" || n.status === "failed")
2922
+ Y[e] = { status: "idle" };
2923
+ gt.info("sync status reset(事件反注册/登出)");
2924
+ }
2925
+ function bs() {
2926
+ const s = Me(() => ({ ...Y })), e = Me(
2927
+ () => Object.values(Y).some((n) => n.status === "syncing")
2928
+ ), t = Me(
2929
+ () => Object.values(Y).every((n) => n.status === "success" || n.status === "failed")
2698
2930
  );
2699
2931
  return { status: s, isSyncing: e, allFinished: t };
2700
2932
  }
2701
- let Ee = null;
2702
- function rt(s) {
2703
- Ee = s;
2933
+ let Oe = null;
2934
+ function mt(s) {
2935
+ Oe = s;
2704
2936
  }
2705
- function B() {
2706
- if (!Ee)
2937
+ function K() {
2938
+ if (!Oe)
2707
2939
  throw new Error(
2708
2940
  "[UIKit] 事件层依赖未注入:请在调用 registerEventHandlers 前先执行 setEventHandlerDeps()"
2709
2941
  );
2710
- return Ee;
2942
+ return Oe;
2711
2943
  }
2712
- const Gn = T("UIKit:Websdk5Adapter");
2713
- function En() {
2944
+ const Vn = T("UIKit:Websdk5Adapter");
2945
+ function Wn() {
2714
2946
  try {
2715
- B();
2947
+ K();
2716
2948
  } catch {
2717
- Gn.warn("[Websdk5Adapter] 事件层依赖未注入,使用最小兜底实现"), rt({
2949
+ Vn.warn("[Websdk5Adapter] 事件层依赖未注入,使用最小兜底实现"), mt({
2718
2950
  t: (s) => s,
2719
2951
  insertChatNotice: () => {
2720
2952
  },
@@ -2738,7 +2970,7 @@ function En() {
2738
2970
  });
2739
2971
  }
2740
2972
  }
2741
- function Tn(s, e) {
2973
+ function Jn(s, e) {
2742
2974
  const t = s.contact.getContact(e);
2743
2975
  if (t != null && t.remark)
2744
2976
  return t.remark;
@@ -2746,7 +2978,7 @@ function Tn(s, e) {
2746
2978
  if (n != null && n.nickname)
2747
2979
  return n.nickname;
2748
2980
  }
2749
- function ot(s, e) {
2981
+ function pt(s, e) {
2750
2982
  var r;
2751
2983
  const t = e.from || "", n = s.contact.getContact(t);
2752
2984
  if (n != null && n.remark)
@@ -2757,108 +2989,155 @@ function ot(s, e) {
2757
2989
  const a = (r = e.ext) == null ? void 0 : r.ease_chat_uikit_user_info;
2758
2990
  return a != null && a.nickname ? a.nickname : a != null && a.remark ? a.remark : t;
2759
2991
  }
2760
- function Rn(s, e) {
2992
+ function $n(s, e) {
2761
2993
  var d;
2762
- const { useNotification: t, emitNotificationDelivered: n } = B(), { state: o, notify: a, notifyBrowser: r } = t();
2763
- if (!o.value.enabled || E(e.from) === E(s.client.currentUser) || e.conversationId === s.conversation.currentConversationId)
2994
+ const { useNotification: t, emitNotificationDelivered: n } = K(), { state: o, notify: a, notifyBrowser: r } = t();
2995
+ if (!o.value.enabled || G(e.from) === G(s.client.currentUser) || e.conversationId === s.conversation.currentConversationId)
2764
2996
  return;
2765
- const i = s.conversation.conversationList.find((l) => l.id === e.conversationId);
2997
+ const i = s.conversation.conversationList.find((f) => f.id === e.conversationId);
2766
2998
  if (i != null && i.isMuted)
2767
2999
  return;
2768
3000
  const c = typeof document > "u" || document.visibilityState === "hidden";
2769
3001
  if (o.value.triggerMode === "background" && !c)
2770
3002
  return;
2771
- const u = P(e, s.client.currentUser), f = ot(s, u), m = u.conversationType === I.GROUPCHAT, g = {
3003
+ const u = H(e, s.client.currentUser), l = pt(s, u), g = u.conversationType === I.GROUPCHAT, p = {
2772
3004
  // 群聊标题为群名(正文含 "发送者: 内容" 前缀),单聊标题为发送者名
2773
- title: m && (i == null ? void 0 : i.name) || f,
2774
- body: Ct(u, void 0, f, void 0, Ue),
3005
+ title: g && (i == null ? void 0 : i.name) || l,
3006
+ body: Nt(u, void 0, l, void 0, Be),
2775
3007
  // 群聊用群头像,单聊用发送者头像
2776
- avatar: m ? i == null ? void 0 : i.avatar : (d = s.userInfo.getUserInfo(e.from)) == null ? void 0 : d.avatarUrl,
3008
+ avatar: g ? i == null ? void 0 : i.avatar : (d = s.userInfo.getUserInfo(e.from)) == null ? void 0 : d.avatarUrl,
2777
3009
  timestamp: u.timestamp || Date.now(),
2778
3010
  conversationId: e.conversationId,
2779
3011
  conversationType: u.conversationType
2780
3012
  };
2781
- c && o.value.browserEnabled ? r(g).then((l) => {
2782
- l ? n(g, "browser") : o.value.inAppEnabled && (a(g), n(g, "in-app"));
2783
- }) : o.value.inAppEnabled && (a(g), n(g, "in-app"));
3013
+ c && o.value.browserEnabled ? r(p).then((f) => {
3014
+ f ? n(p, "browser") : o.value.inAppEnabled && (a(p), n(p, "in-app"));
3015
+ }) : o.value.inAppEnabled && (a(p), n(p, "in-app"));
2784
3016
  }
2785
- function Fe(s, e, t) {
2786
- const { t: n, useNotification: o, emitNotificationDelivered: a, resolveNoticeUserName: r } = B(), { state: i, notify: c, notifyBrowser: u } = o();
3017
+ function Qe(s, e, t) {
3018
+ const { t: n, useNotification: o, emitNotificationDelivered: a, resolveNoticeUserName: r } = K(), { state: i, notify: c, notifyBrowser: u } = o();
2787
3019
  if (!i.value.enabled)
2788
3020
  return;
2789
- const f = s.userInfo.getUserInfo(e), m = {
2790
- title: r(f) || e,
3021
+ const l = s.userInfo.getUserInfo(e), g = {
3022
+ title: r(l) || e,
2791
3023
  body: n(t === "declined" ? "contact.inviteDeclinedByPeer" : "chat.notice.contactDeleted"),
2792
- avatar: f == null ? void 0 : f.avatarUrl,
3024
+ avatar: l == null ? void 0 : l.avatarUrl,
2793
3025
  timestamp: Date.now(),
2794
3026
  conversationId: e,
2795
3027
  conversationType: I.SINGLECHAT
2796
3028
  };
2797
- (typeof document > "u" || document.visibilityState === "hidden") && i.value.browserEnabled ? u(m).then((d) => {
2798
- d ? a(m, "browser") : i.value.inAppEnabled && (c(m), a(m, "in-app"));
2799
- }) : i.value.inAppEnabled && (c(m), a(m, "in-app"));
3029
+ (typeof document > "u" || document.visibilityState === "hidden") && i.value.browserEnabled ? u(g).then((d) => {
3030
+ d ? a(g, "browser") : i.value.inAppEnabled && (c(g), a(g, "in-app"));
3031
+ }) : i.value.inAppEnabled && (c(g), a(g, "in-app"));
3032
+ }
3033
+ const Qn = 20, zn = 2;
3034
+ function ze(s) {
3035
+ return `${s.conversationType}:${s.conversationId}`;
2800
3036
  }
2801
- const M = T("UIKit:ChatEvents"), le = /* @__PURE__ */ new Set(), Te = /* @__PURE__ */ new Set(), $ = /* @__PURE__ */ new Map();
2802
- let ge = !1;
2803
- function Un() {
2804
- le.clear(), Te.clear(), $.clear(), ge = !1;
3037
+ async function Yn(s) {
3038
+ const e = s.batchSize ?? Qn, t = Math.max(1, s.concurrency ?? zn), n = s.targets.filter((c) => !s.queried.has(ze(c)));
3039
+ if (n.length === 0 || e <= 0)
3040
+ return { queriedCount: 0, batchCount: 0, failedBatchCount: 0 };
3041
+ const o = [];
3042
+ for (let c = 0; c < n.length; c += e)
3043
+ o.push(n.slice(c, c + e));
3044
+ let a = 0, r = 0;
3045
+ async function i() {
3046
+ var c;
3047
+ for (; a < o.length; ) {
3048
+ const u = o[a];
3049
+ a += 1;
3050
+ try {
3051
+ const l = await s.query(u);
3052
+ for (const g of l)
3053
+ s.apply(g);
3054
+ for (const g of u)
3055
+ s.queried.add(ze(g));
3056
+ } catch (l) {
3057
+ r += 1, (c = s.onError) == null || c.call(s, l, u);
3058
+ }
3059
+ }
3060
+ }
3061
+ return await Promise.all(Array.from({ length: Math.min(t, o.length) }, () => i())), { queriedCount: n.length, batchCount: o.length, failedBatchCount: r };
2805
3062
  }
2806
- function Ln(s, e, t, n) {
3063
+ const y = T("UIKit:ChatEvents"), ge = /* @__PURE__ */ new Set(), xe = /* @__PURE__ */ new Set(), ht = /* @__PURE__ */ new Set();
3064
+ let me = !1, pe = !1;
3065
+ const Q = /* @__PURE__ */ new Map();
3066
+ let he = !1;
3067
+ function Xn() {
3068
+ ge.clear(), xe.clear(), ht.clear(), me = !1, pe = !1, Q.clear(), he = !1;
3069
+ }
3070
+ function Zn(s, e, t, n) {
2807
3071
  if (!n)
2808
3072
  return;
2809
- const o = `${e}:${t}`, a = $.get(o) || [];
2810
- a.push(n), $.set(o, a), !ge && (ge = !0, Promise.resolve().then(async () => {
2811
- for (ge = !1; $.size > 0; ) {
2812
- const r = Array.from($.entries());
2813
- $.clear();
3073
+ const o = `${e}:${t}`, a = Q.get(o) || [];
3074
+ a.push(n), Q.set(o, a), !he && (he = !0, Promise.resolve().then(async () => {
3075
+ for (he = !1; Q.size > 0; ) {
3076
+ const r = Array.from(Q.entries());
3077
+ Q.clear();
2814
3078
  for (const [i, c] of r) {
2815
- const [u, f] = i.split(":");
2816
- for (let m = 0; m < c.length; m += 50) {
2817
- const g = c.slice(m, m + 50);
2818
- M.info("[queueMessageReadReceipt] 批量发送已读回执", { conversationType: u, conversationId: f, batchSize: g.length, messageIds: g });
3079
+ const [u, l] = i.split(":");
3080
+ for (let g = 0; g < c.length; g += 50) {
3081
+ const p = c.slice(g, g + 50);
3082
+ y.info("[queueMessageReadReceipt] 批量发送已读回执", { conversationType: u, conversationId: l, batchSize: p.length, messageIds: p });
2819
3083
  try {
2820
3084
  await s.chatManager.sendMessageReadReceipts({
2821
- conversationId: f,
3085
+ conversationId: l,
2822
3086
  conversationType: u,
2823
- messageIds: g
2824
- }), an(g), M.info("[queueMessageReadReceipt] 已读回执发送成功", { conversationType: u, conversationId: f, messageIds: g });
3087
+ messageIds: p
3088
+ }), Cn(p), y.info("[queueMessageReadReceipt] 已读回执发送成功", { conversationType: u, conversationId: l, messageIds: p });
2825
3089
  } catch (d) {
2826
- M.warn("[queueMessageReadReceipt] sendMessageReadReceipts failed:", { conversationType: u, conversationId: f, messageIds: g, err: d });
3090
+ y.warn("[queueMessageReadReceipt] sendMessageReadReceipts failed:", { conversationType: u, conversationId: l, messageIds: p, err: d });
2827
3091
  }
2828
3092
  }
2829
3093
  }
2830
3094
  }
2831
3095
  }));
2832
3096
  }
2833
- async function Dn(s, e) {
2834
- const t = s.conversation.conversationList.map((n) => ({
2835
- conversationId: n.id,
2836
- conversationType: n.type
2837
- }));
2838
- if (t.length !== 0)
2839
- for (let n = 0; n < t.length; n += 20)
2840
- try {
2841
- const o = await e.pushManager.getConversationSilentModes({
2842
- conversationList: t.slice(n, n + 20)
2843
- });
2844
- for (const a of o.conversations) {
2845
- const r = a.rule.remindType === "NONE" || a.rule.expireTimestamp !== void 0 && a.rule.expireTimestamp > Date.now(), i = s.conversation.conversationList.find((c) => c.id === a.conversationId);
2846
- i && i.isMuted !== r && s.conversation.updateConversation(a.conversationId, {
2847
- isMuted: r,
2848
- remindType: a.rule.remindType ?? (r ? "NONE" : "DEFAULT")
3097
+ async function es(s, e) {
3098
+ if (me) {
3099
+ pe = !0;
3100
+ return;
3101
+ }
3102
+ me = !0;
3103
+ try {
3104
+ do {
3105
+ pe = !1;
3106
+ const t = Date.now(), n = [];
3107
+ for (const i of s.conversation.conversationList)
3108
+ i.type === I.SINGLECHAT ? n.push({ conversationId: i.id, conversationType: I.SINGLECHAT }) : i.type === I.GROUPCHAT && n.push({ conversationId: i.id, conversationType: I.GROUPCHAT });
3109
+ const { queriedCount: o, batchCount: a, failedBatchCount: r } = await Yn({
3110
+ targets: n,
3111
+ queried: ht,
3112
+ query: async (i) => (await e.pushManager.getConversationSilentModes({ conversationList: i })).conversations,
3113
+ apply: (i) => {
3114
+ const c = i.rule.remindType === "NONE" || i.rule.expireTimestamp !== void 0 && i.rule.expireTimestamp > Date.now(), u = s.conversation.conversationList.find((l) => l.id === i.conversationId);
3115
+ u && u.isMuted !== c && s.conversation.updateConversation(i.conversationId, {
3116
+ isMuted: c,
3117
+ remindType: i.rule.remindType ?? (c ? "NONE" : "DEFAULT")
2849
3118
  });
2850
- }
2851
- } catch (o) {
2852
- M.warn("patch conversation mute states failed:", o);
2853
- }
3119
+ },
3120
+ onError: (i) => y.warn("patch conversation mute states failed:", i)
3121
+ });
3122
+ a > 0 && y.info("patch conversation mute states", {
3123
+ conversations: n.length,
3124
+ queried: o,
3125
+ batches: a,
3126
+ failedBatches: r,
3127
+ durationMs: Date.now() - t
3128
+ });
3129
+ } while (pe);
3130
+ } finally {
3131
+ me = !1;
3132
+ }
2854
3133
  }
2855
- async function oe(s, e) {
3134
+ async function ae(s, e) {
2856
3135
  const t = new Map(s.group.groupList.map((o) => [o.groupId, o.groupName])), n = [];
2857
3136
  for (const o of s.conversation.conversationList)
2858
- if ((!o.name || o.name === o.id) && !Te.has(o.id)) {
3137
+ if ((!o.name || o.name === o.id) && !xe.has(o.id)) {
2859
3138
  if (o.type === I.GROUPCHAT) {
2860
3139
  const r = t.get(o.id);
2861
- r && r !== o.id ? s.conversation.updateConversation(o.id, { name: r }) : le.has(o.id) || n.push(o.id);
3140
+ r && r !== o.id ? s.conversation.updateConversation(o.id, { name: r }) : ge.has(o.id) || n.push(o.id);
2862
3141
  } else if (o.type === I.SINGLECHAT) {
2863
3142
  const r = s.contact.getContact(o.id), i = s.userInfo.getUserInfo(o.id), c = (r == null ? void 0 : r.remark) || (r == null ? void 0 : r.name) || (i == null ? void 0 : i.nickname);
2864
3143
  c && s.conversation.updateConversation(o.id, { name: c });
@@ -2866,42 +3145,43 @@ async function oe(s, e) {
2866
3145
  }
2867
3146
  if (n.length !== 0) {
2868
3147
  for (const o of n)
2869
- le.add(o), Te.add(o);
3148
+ ge.add(o), xe.add(o);
2870
3149
  try {
2871
- const o = await e.groupManager.getGroupInfoList({ groupIds: n }), a = fe(o);
3150
+ const o = await e.groupManager.getGroupInfoList({ groupIds: n }), a = Ie(o);
2872
3151
  for (const r of a)
2873
3152
  s.group.updateGroup(r.groupId, r), r.groupName && r.groupName !== r.groupId && s.conversation.updateConversation(r.groupId, { name: r.groupName });
2874
3153
  } catch (o) {
2875
- M.warn("fetch missing group names failed:", o);
3154
+ y.warn("fetch missing group names failed:", o);
2876
3155
  } finally {
2877
- for (const o of n) le.delete(o);
3156
+ for (const o of n) ge.delete(o);
2878
3157
  }
2879
3158
  }
2880
3159
  }
2881
- function _n(s, e, t, n) {
3160
+ function ts(s, e, t, n) {
2882
3161
  const o = s.message.getMessages(e), a = o.findIndex(
2883
- (m) => m.msgServerId === n || m.msgLocalId === n
3162
+ (p) => p.msgServerId === n || p.msgLocalId === n
2884
3163
  );
2885
3164
  if (a === -1 || a !== o.length - 1)
2886
3165
  return;
2887
- const r = o[a], i = s.conversation.conversationList.find((m) => m.id === e);
3166
+ const r = o[a], i = s.conversation.conversationList.find((p) => p.id === e);
2888
3167
  if (!i || i.lastMessageTime && r.timestamp < i.lastMessageTime - 1e3)
2889
3168
  return;
2890
- const u = t === I.GROUPCHAT ? ot(s, r) : void 0, { t: f } = B();
3169
+ const u = t === I.GROUPCHAT ? G(r.from || "") : "", l = u ? pt(s, { ...r, from: u }) : void 0, { t: g } = K();
2891
3170
  s.conversation.updateConversation(e, {
2892
- lastMessageText: Xe(
3171
+ lastMessageText: ct(
2893
3172
  t,
2894
- u,
2895
- f("message.recalledPreview")
2896
- )
3173
+ l,
3174
+ g("message.recalledPreview")
3175
+ ),
3176
+ ...u ? { lastMessageFrom: u, lastMessageSenderName: l } : {}
2897
3177
  });
2898
3178
  }
2899
- function x(s) {
2900
- Promise.resolve().then(s).catch((e) => M.warn("persistence 钩子执行失败(已忽略):", e));
3179
+ function B(s) {
3180
+ Promise.resolve().then(s).catch((e) => y.warn("persistence 钩子执行失败(已忽略):", e));
2901
3181
  }
2902
- function He(s, e) {
3182
+ function Ye(s, e) {
2903
3183
  const t = s.conversation.conversationList, n = new Set(e.map((r) => r.id)), o = e.map((r) => {
2904
- const i = t.find((f) => f.id === r.id);
3184
+ const i = t.find((l) => l.id === r.id);
2905
3185
  if (!i)
2906
3186
  return r;
2907
3187
  const c = (!r.name || r.name === r.id) && i.name && i.name !== i.id, u = !r.avatar && i.avatar;
@@ -2920,119 +3200,119 @@ function He(s, e) {
2920
3200
  }), a = t.filter((r) => !n.has(r.id)).sort((r, i) => (i.lastMessageTime ?? 0) - (r.lastMessageTime ?? 0));
2921
3201
  return [...o, ...a];
2922
3202
  }
2923
- function Nn(s, e, t, n, o) {
2924
- var g;
2925
- const a = (d) => Tn(e, d), {
3203
+ function ns(s, e, t, n, o) {
3204
+ var p;
3205
+ const a = (d) => Jn(e, d), {
2926
3206
  saveMessage: r,
2927
3207
  updateMessageStatus: i,
2928
3208
  markMessageRecalled: c,
2929
3209
  updateMessageContent: u,
2930
- deleteMessages: f
2931
- } = (n == null ? void 0 : n.message) ?? {}, m = (g = n == null ? void 0 : n.conversation) == null ? void 0 : g.saveConversations;
3210
+ deleteMessages: l
3211
+ } = (n == null ? void 0 : n.message) ?? {}, g = (p = n == null ? void 0 : n.conversation) == null ? void 0 : p.saveConversations;
2932
3212
  return {
2933
3213
  onSyncDataStart: (d) => {
2934
- M.info("onSyncDataStart", { dataType: d.dataType }), be(d.dataType, { status: "syncing" }), d.dataType === "conversation" && e.conversation.setSyncingConversations(!0);
3214
+ y.info("onSyncDataStart", { dataType: d.dataType }), Re(d.dataType, { status: "syncing" }), d.dataType === "conversation" && e.conversation.setSyncingConversations(!0);
2935
3215
  },
2936
3216
  onSyncDataFinished: (d) => {
2937
- if (M.info("onSyncDataFinished", { dataType: d.dataType, status: d.status }), d.status === "failed") {
2938
- const l = d.error;
2939
- be(d.dataType, {
3217
+ if (y.info("onSyncDataFinished", { dataType: d.dataType, status: d.status }), d.status === "failed") {
3218
+ const f = d.error;
3219
+ Re(d.dataType, {
2940
3220
  status: "failed",
2941
3221
  finishedAt: Date.now(),
2942
3222
  error: {
2943
- stage: l == null ? void 0 : l.stage,
2944
- retryable: l == null ? void 0 : l.retryable,
2945
- message: l == null ? void 0 : l.message
3223
+ stage: f == null ? void 0 : f.stage,
3224
+ retryable: f == null ? void 0 : f.retryable,
3225
+ message: f == null ? void 0 : f.message
2946
3226
  }
2947
- }), M.warn("[ChatEvents] 数据同步失败", {
3227
+ }), y.warn("[ChatEvents] 数据同步失败", {
2948
3228
  dataType: d.dataType,
2949
- stage: l == null ? void 0 : l.stage,
2950
- retryable: l == null ? void 0 : l.retryable,
2951
- message: l == null ? void 0 : l.message
2952
- }), d.dataType === "conversation" && (e.conversation.setSyncingConversations(!1), l != null && l.retryable && s.chatManager.refreshSessionList().catch((p) => {
2953
- M.warn("[ChatEvents] conversation 同步失败重试未成功:", U(p));
3229
+ stage: f == null ? void 0 : f.stage,
3230
+ retryable: f == null ? void 0 : f.retryable,
3231
+ message: f == null ? void 0 : f.message
3232
+ }), d.dataType === "conversation" && (e.conversation.setSyncingConversations(!1), f != null && f.retryable && s.chatManager.refreshSessionList().catch((m) => {
3233
+ y.warn("[ChatEvents] conversation 同步失败重试未成功:", L(m));
2954
3234
  }));
2955
3235
  return;
2956
3236
  }
2957
- switch (be(d.dataType, { status: "success", finishedAt: Date.now() }), d.dataType) {
3237
+ switch (Re(d.dataType, { status: "success", finishedAt: Date.now() }), d.dataType) {
2958
3238
  case "conversation":
2959
3239
  e.conversation.setSyncingConversations(!1);
2960
3240
  {
2961
- const l = s.chatManager.getConversationList().filter((v) => v.conversationType !== "chatRoom");
2962
- M.info("getConversationList raw (onSyncDataFinished)", l);
2963
- const p = te(l, { resolveSenderName: a, lastMessageTextResolver: o }), h = He(e, p);
2964
- e.conversation.setConversationList(h), M.info("conversation 同步回填", { count: h.length }), m && x(() => m(h.map(_e)));
3241
+ const f = s.chatManager.getConversationList().filter((v) => v.conversationType !== "chatRoom");
3242
+ ve(y, "onSyncDataFinished", f);
3243
+ const m = se(f, { resolveSenderName: a, lastMessageTextResolver: o }), h = Ye(e, m);
3244
+ e.conversation.setConversationList(h), y.info("conversation 同步回填", { count: h.length }), g && B(() => g(h.map(Ke)));
2965
3245
  }
2966
- e.conversation.setConversationsLoaded(!0), oe(e, s), Dn(e, s);
3246
+ e.conversation.setConversationsLoaded(!0), ae(e, s), es(e, s);
2967
3247
  break;
2968
3248
  case "contact":
2969
3249
  if (!e.contact.loaded || e.contact.contactList.length === 0) {
2970
- const l = s.contactManager.getContacts();
2971
- e.contact.setContactList(Ge(l)), M.info("contact 同步回填", { count: l.length });
3250
+ const f = s.contactManager.getContacts();
3251
+ e.contact.setContactList(ke(f)), y.info("contact 同步回填", { count: f.length });
2972
3252
  } else
2973
- M.info("contact 同步回填跳过(列表已由业务方填充)", { count: e.contact.contactList.length });
2974
- oe(e, s);
3253
+ y.info("contact 同步回填跳过(列表已由业务方填充)", { count: e.contact.contactList.length });
3254
+ ae(e, s);
2975
3255
  break;
2976
3256
  case "group":
2977
3257
  if (!e.group.loaded || e.group.groupList.length === 0) {
2978
- const l = s.groupManager.getJoinedGroupList();
2979
- e.group.setGroupList(fe(l)), M.info("group 同步回填", { count: l.length });
3258
+ const f = s.groupManager.getJoinedGroupList();
3259
+ e.group.setGroupList(Ie(f)), y.info("group 同步回填", { count: f.length });
2980
3260
  } else
2981
- M.info("group 同步回填跳过(列表已由业务方填充)", { count: e.group.groupList.length });
2982
- oe(e, s);
3261
+ y.info("group 同步回填跳过(列表已由业务方填充)", { count: e.group.groupList.length });
3262
+ ae(e, s);
2983
3263
  break;
2984
3264
  }
2985
3265
  },
2986
3266
  onConversationListUpdate: (d) => {
2987
- var C;
2988
- const l = d.items.filter((y) => y.conversationType !== "chatRoom");
2989
- M.info("onConversationListUpdate", { count: l.length, reset: d.patch.reset, removed: d.patch.removed.length }), M.info("getConversationList raw (onConversationListUpdate)", l);
3267
+ var w;
3268
+ const f = d.items.filter((M) => M.conversationType !== "chatRoom");
3269
+ y.info("onConversationListUpdate", { count: f.length, reset: d.patch.reset, removed: d.patch.removed.length }), ve(y, "onConversationListUpdate", f);
2990
3270
  {
2991
- const y = {}, G = [];
2992
- for (const q of l) {
2993
- const R = String(((C = q.lastMessage) == null ? void 0 : C.type) ?? "(null)");
2994
- y[R] = (y[R] ?? 0) + 1, (R === b.COMBINE || R === "unknown") && G.push({ conversationId: q.conversationId, lastMessage: q.lastMessage });
3271
+ const M = {}, A = [];
3272
+ for (const J of f) {
3273
+ const X = String(((w = J.lastMessage) == null ? void 0 : w.type) ?? "(null)");
3274
+ M[X] = (M[X] ?? 0) + 1, (X === b.COMBINE || X === "unknown") && A.push({ conversationId: J.conversationId, lastMessage: J.lastMessage });
2995
3275
  }
2996
- G.length > 0 && M.info("raw snippets (onConversationListUpdate)", { typeCount: y, suspects: G });
3276
+ A.length > 0 && y.info("raw snippets (onConversationListUpdate)", { typeCount: M, suspects: A });
2997
3277
  }
2998
- const p = te(l, { resolveSenderName: a, lastMessageTextResolver: o }), h = He(e, p), v = new Set(d.patch.removed.map((y) => y.conversationId)), S = v.size > 0 ? h.filter((y) => !v.has(y.id)) : h;
3278
+ const m = se(f, { resolveSenderName: a, lastMessageTextResolver: o }), h = Ye(e, m), v = new Set(d.patch.removed.map((M) => M.conversationId)), C = v.size > 0 ? h.filter((M) => !v.has(M.id)) : h;
2999
3279
  if (d.patch.reset || d.patch.removed.length > 0)
3000
- e.conversation.setConversationList(S);
3280
+ e.conversation.setConversationList(C);
3001
3281
  else
3002
- for (const y of S) {
3003
- const G = e.conversation.conversationList.find((q) => q.id === y.id);
3004
- G ? G !== y && e.conversation.updateConversation(y.id, y) : e.conversation.addConversation(y);
3282
+ for (const M of C) {
3283
+ const A = e.conversation.conversationList.find((J) => J.id === M.id);
3284
+ A ? A !== M && e.conversation.updateConversation(M.id, M) : e.conversation.addConversation(M);
3005
3285
  }
3006
- m && x(() => m(S.map(_e))), oe(e, s);
3286
+ g && B(() => g(C.map(Ke))), ae(e, s);
3007
3287
  },
3008
3288
  onMessage: (d) => {
3009
- var S, C, y;
3289
+ var C, w, M;
3010
3290
  if (d.conversationType === "chatRoom")
3011
3291
  return;
3012
3292
  if (d.type === b.CMD) {
3013
- const G = d.body.action;
3014
- M.info("[CMD received]", {
3293
+ const A = d.body.action;
3294
+ y.info("[CMD received]", {
3015
3295
  conversationId: d.conversationId,
3016
3296
  from: d.from,
3017
- action: G,
3297
+ action: A,
3018
3298
  ext: d.ext
3019
- }), G === "TypingBegin" && (t == null ? void 0 : t.enableTyping) !== !1 && d.conversationType === I.SINGLECHAT && E(d.from) !== E(e.client.currentUser) && e.conversation.setTyping(d.conversationId, d.from);
3299
+ }), A === "TypingBegin" && (t == null ? void 0 : t.enableTyping) !== !1 && d.conversationType === I.SINGLECHAT && G(d.from) !== G(e.client.currentUser) && e.conversation.setTyping(d.conversationId, d.from);
3020
3300
  return;
3021
3301
  }
3022
- M.info("onMessage", { conversationId: d.conversationId, from: d.from, type: d.type });
3023
- const l = P(d, e.client.currentUser), p = e.message.getMessages(d.conversationId).find((G) => G.msgServerId === d.msgServerId);
3024
- p != null && p.stream && wt(p.stream.status) ? e.message.replaceMessageById(d.msgServerId, l) : e.message.addMessage(l), l.type === b.VOICE && !l.isSelf && ((C = (S = e.message).markVoiceUnplayed) == null || C.call(S, l.msgServerId || l.msgLocalId)), r && x(() => r(we(d)));
3302
+ y.info("onMessage", { conversationId: d.conversationId, from: d.from, type: d.type });
3303
+ const f = H(d, e.client.currentUser), m = e.message.getMessages(d.conversationId).find((A) => A.msgServerId === d.msgServerId);
3304
+ m != null && m.stream && kt(m.stream.status) ? e.message.replaceMessageById(d.msgServerId, f) : e.message.addMessage(f), f.type === b.VOICE && !f.isSelf && ((w = (C = e.message).markVoiceUnplayed) == null || w.call(C, f.msgServerId || f.msgLocalId)), r && B(() => r(_e(d)));
3025
3305
  const h = e.conversation.currentConversationId, v = typeof document > "u" || document.visibilityState === "visible";
3026
- if (h && d.conversationId === h && E(d.from) !== E(e.client.currentUser) && v && (s.chatManager.clearConversationUnreadMessageCount({
3306
+ if (h && d.conversationId === h && G(d.from) !== G(e.client.currentUser) && v && (s.chatManager.clearConversationUnreadMessageCount({
3027
3307
  conversationId: d.conversationId,
3028
3308
  conversationType: d.conversationType
3029
- }).catch((G) => {
3030
- M.warn("[UIKit] auto clearConversationUnreadMessageCount failed:", U(G));
3031
- }), (t == null ? void 0 : t.enableReadReceipt) !== !1 && (d.conversationType === I.SINGLECHAT || d.conversationType === I.GROUPCHAT) && Ln(s, d.conversationType, d.conversationId, d.msgServerId)), (t == null ? void 0 : t.enableAtMe) !== !1 && d.conversationType === I.GROUPCHAT && E(d.from) !== E(e.client.currentUser)) {
3032
- const G = (y = d.ext) == null ? void 0 : y.em_at_list;
3033
- Array.isArray(G) && G.includes(e.client.currentUser) && (e.conversation.setAtMe(d.conversationId, !0), e.message.addAtMeMessage(d.conversationId, l.msgServerId || l.msgLocalId));
3309
+ }).catch((A) => {
3310
+ y.warn("[UIKit] auto clearConversationUnreadMessageCount failed:", L(A));
3311
+ }), (t == null ? void 0 : t.enableReadReceipt) !== !1 && (d.conversationType === I.SINGLECHAT || d.conversationType === I.GROUPCHAT) && Zn(s, d.conversationType, d.conversationId, d.msgServerId)), (t == null ? void 0 : t.enableAtMe) !== !1 && d.conversationType === I.GROUPCHAT && G(d.from) !== G(e.client.currentUser)) {
3312
+ const A = (M = d.ext) == null ? void 0 : M.em_at_list;
3313
+ Array.isArray(A) && A.includes(e.client.currentUser) && (e.conversation.setAtMe(d.conversationId, !0), e.message.addAtMeMessage(d.conversationId, f.msgServerId || f.msgLocalId));
3034
3314
  }
3035
- Rn(e, d);
3315
+ $n(e, d);
3036
3316
  },
3037
3317
  /**
3038
3318
  * 流式消息(边生成边下发,典型 AI 对话)分片合并。
@@ -3045,33 +3325,33 @@ function Nn(s, e, t, n, o) {
3045
3325
  onStreamMessage: (d) => {
3046
3326
  if (d.conversationType === "chatRoom")
3047
3327
  return;
3048
- const l = d.stream;
3049
- if (!l)
3328
+ const f = d.stream;
3329
+ if (!f)
3050
3330
  return;
3051
- M.info("onStreamMessage", {
3331
+ y.info("onStreamMessage", {
3052
3332
  conversationId: d.conversationId,
3053
3333
  from: d.from,
3054
3334
  msgServerId: d.msgServerId,
3055
- seq: l.seq,
3056
- status: l.status,
3057
- customType: l.customType
3335
+ seq: f.seq,
3336
+ status: f.status,
3337
+ customType: f.customType
3058
3338
  });
3059
- const p = d.msgServerId || d.msgLocalId;
3060
- if (!p)
3339
+ const m = d.msgServerId || d.msgLocalId;
3340
+ if (!m)
3061
3341
  return;
3062
3342
  if (!e.message.getMessages(d.conversationId).some(
3063
3343
  (v) => v.msgServerId === d.msgServerId || d.msgLocalId !== void 0 && v.msgLocalId === d.msgLocalId
3064
3344
  )) {
3065
- e.message.addMessage(P(d, e.client.currentUser));
3345
+ e.message.addMessage(H(d, e.client.currentUser));
3066
3346
  return;
3067
3347
  }
3068
- e.message.updateMessageById(p, {
3069
- body: { ...d.body, content: l.fullText },
3070
- stream: { ...l }
3348
+ e.message.updateMessageById(m, {
3349
+ body: { ...d.body, content: f.fullText },
3350
+ stream: { ...f }
3071
3351
  });
3072
3352
  },
3073
3353
  onMessageRecalled: (d) => {
3074
- d.conversationType !== "chatRoom" && (M.info("onMessageRecalled", { messageId: d.messageId }), e.message.recallMessage(d.messageId, e.client.currentUser), c && x(() => c(d.messageId, e.client.currentUser)), _n(
3354
+ d.conversationType !== "chatRoom" && (y.info("onMessageRecalled", { messageId: d.messageId }), e.message.recallMessage(d.messageId, e.client.currentUser), c && B(() => c(d.messageId, e.client.currentUser)), ts(
3075
3355
  e,
3076
3356
  d.conversationId,
3077
3357
  d.conversationType,
@@ -3079,34 +3359,34 @@ function Nn(s, e, t, n, o) {
3079
3359
  ));
3080
3360
  },
3081
3361
  onMessageDelivered: (d) => {
3082
- M.info("onMessageDelivered", { messageId: d.messageId }), e.message.updateMessageStatus(d.messageId, O.DELIVERED), i && x(() => i(d.messageId, O.DELIVERED));
3362
+ y.info("onMessageDelivered", { messageId: d.messageId }), e.message.updateMessageStatus(d.messageId, k.DELIVERED), i && B(() => i(d.messageId, k.DELIVERED));
3083
3363
  },
3084
3364
  onMessageReadReceipts: (d) => {
3085
- for (const l of d)
3086
- if (l.conversationType === I.GROUPCHAT) {
3087
- M.info("onMessageReadReceipts(group)", {
3088
- conversationId: l.conversationId,
3089
- details: l.receiptDetails.map((p) => ({ messageId: p.messageId, count: p.count }))
3365
+ for (const f of d)
3366
+ if (f.conversationType === I.GROUPCHAT) {
3367
+ y.info("onMessageReadReceipts(group)", {
3368
+ conversationId: f.conversationId,
3369
+ details: f.receiptDetails.map((m) => ({ messageId: m.messageId, count: m.count }))
3090
3370
  });
3091
- for (const p of l.receiptDetails)
3092
- e.message.updateMessageById(p.messageId, { groupReadCount: p.count });
3371
+ for (const m of f.receiptDetails)
3372
+ e.message.updateMessageById(m.messageId, { groupReadCount: m.count });
3093
3373
  } else {
3094
- M.info("onMessageReadReceipts(single)", {
3095
- conversationId: l.conversationId,
3096
- total: l.messageIds.length,
3097
- messageIds: l.messageIds.slice(0, 5)
3374
+ y.info("onMessageReadReceipts(single)", {
3375
+ conversationId: f.conversationId,
3376
+ total: f.messageIds.length,
3377
+ messageIds: f.messageIds.slice(0, 5)
3098
3378
  });
3099
- for (const p of l.messageIds)
3100
- e.message.updateMessageStatus(p, O.READ), i && x(() => i(p, O.READ));
3379
+ for (const m of f.messageIds)
3380
+ e.message.updateMessageStatus(m, k.READ), i && B(() => i(m, k.READ));
3101
3381
  }
3102
3382
  },
3103
3383
  onMessageUpdated: (d) => {
3104
- d.conversationType !== "chatRoom" && (M.info("onMessageUpdated", { messageId: d.messageId }), e.message.updateMessageById(d.messageId, {
3384
+ d.conversationType !== "chatRoom" && (y.info("onMessageUpdated", { messageId: d.messageId }), e.message.updateMessageById(d.messageId, {
3105
3385
  body: d.message.body,
3106
3386
  ext: d.message.ext,
3107
3387
  modifiedInfo: d.message.modifiedInfo,
3108
3388
  modified: !0
3109
- }), u && x(() => u(
3389
+ }), u && B(() => u(
3110
3390
  d.messageId,
3111
3391
  d.message.body,
3112
3392
  d.message.ext,
@@ -3114,69 +3394,69 @@ function Nn(s, e, t, n, o) {
3114
3394
  )));
3115
3395
  },
3116
3396
  onPinnedMessageChanged: async (d) => {
3117
- if (d.conversationType !== "chatRoom" && (M.info("onPinnedMessageChanged", { conversationId: d.conversationId, operation: d.operation }), !!d.messageId && (d.operation === "pin" ? e.message.setMessagePinned(d.messageId, {
3397
+ if (d.conversationType !== "chatRoom" && (y.info("onPinnedMessageChanged", { conversationId: d.conversationId, operation: d.operation }), !!d.messageId && (d.operation === "pin" ? e.message.setMessagePinned(d.messageId, {
3118
3398
  operatorId: d.operatorId || "",
3119
3399
  pinTime: d.pinTime || Date.now()
3120
3400
  }) : d.operation === "unpin" && e.message.setMessageUnpinned(d.messageId), d.conversationId && d.conversationType)))
3121
3401
  try {
3122
- const p = (await s.chatManager.getPinnedMessageList({
3402
+ const m = (await s.chatManager.getPinnedMessageList({
3123
3403
  conversationId: d.conversationId,
3124
3404
  conversationType: d.conversationType
3125
- })).items.map((h) => P(h.message, e.client.currentUser));
3126
- e.message.setPinnedMessages(d.conversationId, p);
3127
- } catch (l) {
3128
- M.warn("refresh pinned messages failed:", l);
3405
+ })).items.map((h) => H(h.message, e.client.currentUser));
3406
+ e.message.setPinnedMessages(d.conversationId, m);
3407
+ } catch (f) {
3408
+ y.warn("refresh pinned messages failed:", f);
3129
3409
  }
3130
3410
  },
3131
3411
  onMultiDeviceConversation: (d) => {
3132
- if (M.info("onMultiDeviceConversation", { operation: d.operation }), d.operation === "ALL_CONVERSATIONS_UNREAD_MESSAGE_COUNT_CLEARED") {
3412
+ if (y.info("onMultiDeviceConversation", { operation: d.operation }), d.operation === "ALL_CONVERSATIONS_UNREAD_MESSAGE_COUNT_CLEARED") {
3133
3413
  for (const h of e.conversation.conversationList)
3134
3414
  e.conversation.updateUnreadCount(h.id, 0);
3135
3415
  return;
3136
3416
  }
3137
- const { operation: l, conversationId: p } = d;
3138
- switch (l) {
3417
+ const { operation: f, conversationId: m } = d;
3418
+ switch (f) {
3139
3419
  case "CONVERSATION_DELETED":
3140
- e.conversation.deleteConversation(p);
3420
+ e.conversation.deleteConversation(m);
3141
3421
  break;
3142
3422
  case "CONVERSATION_PINNED":
3143
- e.conversation.updateConversation(p, { isPinned: !0 });
3423
+ e.conversation.updateConversation(m, { isPinned: !0 });
3144
3424
  break;
3145
3425
  case "CONVERSATION_UNPINNED":
3146
- e.conversation.updateConversation(p, { isPinned: !1 });
3426
+ e.conversation.updateConversation(m, { isPinned: !1 });
3147
3427
  break;
3148
3428
  case "CONVERSATION_UNREAD_MESSAGE_COUNT_CLEARED":
3149
- e.conversation.updateUnreadCount(p, 0);
3429
+ e.conversation.updateUnreadCount(m, 0);
3150
3430
  break;
3151
3431
  case "CONVERSATION_MARK":
3152
- d.mark !== void 0 && e.conversation.updateConversation(p, { marks: [d.mark] });
3432
+ d.mark !== void 0 && e.conversation.updateConversation(m, { marks: [d.mark] });
3153
3433
  break;
3154
3434
  case "CONVERSATION_MUTE_INFO_CHANGED":
3155
- d.remindType && e.conversation.updateConversation(p, {
3435
+ d.remindType && e.conversation.updateConversation(m, {
3156
3436
  isMuted: d.remindType === "NONE",
3157
3437
  remindType: d.remindType
3158
3438
  });
3159
3439
  break;
3160
3440
  default:
3161
- M.warn("onMultiDeviceConversation unhandled:", d);
3441
+ y.warn("onMultiDeviceConversation unhandled:", d);
3162
3442
  }
3163
3443
  },
3164
3444
  onMultiDeviceMessageRemoved: (d) => {
3165
- M.info("onMultiDeviceMessageRemoved", { conversationId: d.conversationId, operation: d.operation, messageIds: d.messageIds });
3166
- const { operation: l, conversationId: p, messageIds: h, beforeTimestamp: v } = d;
3167
- if (!(!p || l !== "MESSAGE_REMOVED")) {
3445
+ y.info("onMultiDeviceMessageRemoved", { conversationId: d.conversationId, operation: d.operation, messageIds: d.messageIds });
3446
+ const { operation: f, conversationId: m, messageIds: h, beforeTimestamp: v } = d;
3447
+ if (!(!m || f !== "MESSAGE_REMOVED")) {
3168
3448
  if (h && h.length > 0)
3169
- e.message.deleteMessages([...h]), f && x(() => f([...h]));
3449
+ e.message.deleteMessages([...h]), l && B(() => l([...h]));
3170
3450
  else if (v) {
3171
- const C = e.message.getMessages(p).filter((y) => y.timestamp && y.timestamp < v).map((y) => y.msgServerId || y.msgLocalId).filter((y) => !!y);
3172
- C.length > 0 && (e.message.deleteMessages(C), f && x(() => f(C)));
3451
+ const w = e.message.getMessages(m).filter((M) => M.timestamp && M.timestamp < v).map((M) => M.msgServerId || M.msgLocalId).filter((M) => !!M);
3452
+ w.length > 0 && (e.message.deleteMessages(w), l && B(() => l(w)));
3173
3453
  }
3174
3454
  }
3175
3455
  }
3176
3456
  };
3177
3457
  }
3178
- const J = T("UIKit:ContactEvents");
3179
- function Ke(s, e = "pending") {
3458
+ const $ = T("UIKit:ContactEvents");
3459
+ function Xe(s, e = "pending") {
3180
3460
  const t = s.userInfo, n = s.from;
3181
3461
  return {
3182
3462
  id: n,
@@ -3190,47 +3470,47 @@ function Ke(s, e = "pending") {
3190
3470
  timestamp: Date.now()
3191
3471
  };
3192
3472
  }
3193
- function kn(s) {
3194
- const { t: e, insertChatNotice: t } = B();
3473
+ function ss(s) {
3474
+ const { t: e, insertChatNotice: t } = K();
3195
3475
  return {
3196
3476
  onContactInvited: (n) => {
3197
- J.info("onContactInvited", { from: n.from });
3477
+ $.info("onContactInvited", { from: n.from });
3198
3478
  const o = n.from, a = o ? s.contact.getContact(o) : void 0;
3199
- s.contact.addInvite(Ke(n, a ? "accepted" : "pending"));
3479
+ s.contact.addInvite(Xe(n, a ? "accepted" : "pending"));
3200
3480
  },
3201
3481
  onContactAgreed: (n) => {
3202
- J.info("onContactAgreed", { from: n.from });
3482
+ $.info("onContactAgreed", { from: n.from });
3203
3483
  const o = n.from;
3204
3484
  if (!o)
3205
3485
  return;
3206
3486
  s.contact.getInvite(o) && s.contact.updateInviteStatus(o, "accepted"), s.contact.addContact({ userId: o, name: o });
3207
3487
  },
3208
3488
  onContactRefuse: (n) => {
3209
- J.info("onContactRefuse", { from: n.from });
3489
+ $.info("onContactRefuse", { from: n.from });
3210
3490
  const o = n.from;
3211
- o && (s.contact.getInvite(o) ? s.contact.updateInviteStatus(o, "declined") : s.contact.addInvite({ ...Ke(n, "declined"), outgoing: !0, unread: !0 }), Fe(s, o, "declined"));
3491
+ o && (s.contact.getInvite(o) ? s.contact.updateInviteStatus(o, "declined") : s.contact.addInvite({ ...Xe(n, "declined"), outgoing: !0, unread: !0 }), Qe(s, o, "declined"));
3212
3492
  },
3213
3493
  onContactDeleted: (n) => {
3214
- J.info("onContactDeleted", { from: n.from });
3494
+ $.info("onContactDeleted", { from: n.from });
3215
3495
  const o = n.from;
3216
3496
  o && (s.contact.removeContact(o), s.contact.removeInvite(o), t(s, o, I.SINGLECHAT, {
3217
- eventType: A.CONTACT_DELETED,
3497
+ eventType: E.CONTACT_DELETED,
3218
3498
  params: {},
3219
3499
  defaultText: e("chat.notice.contactDeleted")
3220
- }), Fe(s, o, "deleted"));
3500
+ }), Qe(s, o, "deleted"));
3221
3501
  },
3222
3502
  onContactAdded: (n) => {
3223
- J.info("onContactAdded", { from: n.from });
3503
+ $.info("onContactAdded", { from: n.from });
3224
3504
  const o = n.from;
3225
3505
  o && (s.contact.addContact({ userId: o, name: o }), s.contact.removeInvite(o), t(s, o, I.SINGLECHAT, {
3226
- eventType: A.CONTACT_ADDED,
3506
+ eventType: E.CONTACT_ADDED,
3227
3507
  params: {},
3228
3508
  defaultText: e("chat.notice.contactAdded")
3229
3509
  }));
3230
3510
  },
3231
3511
  onContactInfoUpdated: (n) => {
3232
3512
  var a, r;
3233
- J.info("onContactInfoUpdated", { userId: (a = n.contact) == null ? void 0 : a.userId });
3513
+ $.info("onContactInfoUpdated", { userId: (a = n.contact) == null ? void 0 : a.userId });
3234
3514
  const o = n.contact;
3235
3515
  if (o != null && o.userId && o.remark !== void 0) {
3236
3516
  s.contact.updateContactRemark(o.userId, o.remark);
@@ -3240,8 +3520,8 @@ function kn(s) {
3240
3520
  }
3241
3521
  };
3242
3522
  }
3243
- const w = T("UIKit:GroupEvents");
3244
- function je(s, e = "pending") {
3523
+ const S = T("UIKit:GroupEvents");
3524
+ function Ze(s, e = "pending") {
3245
3525
  const t = s.groupId, n = "inviter" in s ? s.inviter : void 0, o = "groupName" in s ? s.groupName : void 0;
3246
3526
  return {
3247
3527
  id: t,
@@ -3255,8 +3535,8 @@ function je(s, e = "pending") {
3255
3535
  timestamp: Date.now()
3256
3536
  };
3257
3537
  }
3258
- function ie(s, e, t, n) {
3259
- const { t: o, resolveNoticeUserName: a } = B();
3538
+ function ce(s, e, t, n) {
3539
+ const { t: o, resolveNoticeUserName: a } = K();
3260
3540
  if (s.length === 0)
3261
3541
  return "";
3262
3542
  const r = s[0];
@@ -3267,231 +3547,231 @@ function ie(s, e, t, n) {
3267
3547
  const i = s.find((u) => u.userId !== e), c = a(i || r);
3268
3548
  return o(n).replace("{name}", c).replace("{count}", String(s.length));
3269
3549
  }
3270
- function ae(s, e) {
3271
- const { t, resolveNoticeUserName: n } = B(), o = s.find((r) => r.userId !== e) ?? s[0];
3550
+ function ue(s, e) {
3551
+ const { t, resolveNoticeUserName: n } = K(), o = s.find((r) => r.userId !== e) ?? s[0];
3272
3552
  return {
3273
3553
  name: (o == null ? void 0 : o.userId) === e ? t("chat.notice.you") : n(o),
3274
3554
  count: s.length,
3275
3555
  userIds: s.map((r) => r.userId).join(",")
3276
3556
  };
3277
3557
  }
3278
- function On(s) {
3279
- const { t: e, insertChatNotice: t, buildAnnouncementNoticeText: n, resolveNoticeUserName: o } = B();
3558
+ function rs(s) {
3559
+ const { t: e, insertChatNotice: t, buildAnnouncementNoticeText: n, resolveNoticeUserName: o } = K();
3280
3560
  function a(r) {
3281
3561
  return s.group.groupList.some((i) => i.groupId === r);
3282
3562
  }
3283
3563
  return {
3284
3564
  onInvitationReceived: (r) => {
3285
- w.info("onInvitationReceived raw payload", r);
3286
- const i = je(r, a(r.groupId) ? "accepted" : "pending");
3565
+ S.info("onInvitationReceived raw payload", r);
3566
+ const i = Ze(r, a(r.groupId) ? "accepted" : "pending");
3287
3567
  s.contact.addInvite(i);
3288
3568
  },
3289
3569
  onInvitationAccepted: (r) => {
3290
- w.info("onInvitationAccepted raw payload", r), s.contact.updateInviteStatus(r.groupId, "accepted");
3570
+ S.info("onInvitationAccepted raw payload", r), s.contact.updateInviteStatus(r.groupId, "accepted");
3291
3571
  },
3292
3572
  onInvitationDeclined: (r) => {
3293
- w.info("onInvitationDeclined raw payload", r), s.contact.updateInviteStatus(r.groupId, "declined");
3573
+ S.info("onInvitationDeclined raw payload", r), s.contact.updateInviteStatus(r.groupId, "declined");
3294
3574
  },
3295
3575
  onAutoAcceptInvitationFromGroup: (r) => {
3296
- w.info("onAutoAcceptInvitationFromGroup raw payload", r), s.contact.addInvite(je(r, "accepted"));
3576
+ S.info("onAutoAcceptInvitationFromGroup raw payload", r), s.contact.addInvite(Ze(r, "accepted"));
3297
3577
  },
3298
3578
  onMembersJoined: (r) => {
3299
- w.info("onMembersJoined raw payload", r);
3579
+ S.info("onMembersJoined raw payload", r);
3300
3580
  const i = r.members || [], c = s.client.currentUser;
3301
- i.some((m) => m.userId === c) && (s.contact.getInvite(r.groupId) && s.contact.updateInviteStatus(r.groupId, "accepted"), s.group.getGroupById(r.groupId) || s.group.addGroup({ groupId: r.groupId, groupName: r.groupName })), s.group.incrementMemberCount(r.groupId, i.length);
3302
- const f = ie(
3581
+ i.some((g) => g.userId === c) && (s.contact.getInvite(r.groupId) && s.contact.updateInviteStatus(r.groupId, "accepted"), s.group.getGroupById(r.groupId) || s.group.addGroup({ groupId: r.groupId, groupName: r.groupName })), s.group.incrementMemberCount(r.groupId, i.length);
3582
+ const l = ce(
3303
3583
  i,
3304
3584
  c || "",
3305
3585
  "chat.notice.memberJoined",
3306
3586
  "chat.notice.memberJoinedMultiple"
3307
3587
  );
3308
3588
  t(s, r.groupId, I.GROUPCHAT, {
3309
- eventType: A.MEMBER_JOINED,
3310
- params: ae(i, c || ""),
3311
- defaultText: f
3589
+ eventType: E.MEMBER_JOINED,
3590
+ params: ue(i, c || ""),
3591
+ defaultText: l
3312
3592
  });
3313
3593
  },
3314
3594
  onMembersExited: (r) => {
3315
3595
  const i = r.members || [];
3316
- w.info("onMembersExited raw payload", r), s.group.decrementMemberCount(r.groupId, i.length);
3317
- const c = ie(
3596
+ S.info("onMembersExited raw payload", r), s.group.decrementMemberCount(r.groupId, i.length);
3597
+ const c = ce(
3318
3598
  i,
3319
3599
  s.client.currentUser || "",
3320
3600
  "chat.notice.memberExited",
3321
3601
  "chat.notice.memberExitedMultiple"
3322
3602
  );
3323
3603
  t(s, r.groupId, I.GROUPCHAT, {
3324
- eventType: A.MEMBER_EXITED,
3325
- params: ae(i, s.client.currentUser || ""),
3604
+ eventType: E.MEMBER_EXITED,
3605
+ params: ue(i, s.client.currentUser || ""),
3326
3606
  defaultText: c
3327
3607
  });
3328
3608
  },
3329
3609
  onGroupInfoChanged: (r) => {
3330
- w.info("onGroupInfoChanged raw payload", r);
3331
- const i = r.groupInfo ?? r, c = i.name ?? i.groupName, u = s.group.getGroupById(r.groupId), f = Le({
3610
+ S.info("onGroupInfoChanged raw payload", r);
3611
+ const i = r.groupInfo ?? r, c = i.name ?? i.groupName, u = s.group.getGroupById(r.groupId), l = Fe({
3332
3612
  ...i,
3333
3613
  groupId: r.groupId,
3334
3614
  name: c,
3335
3615
  avatarUrl: i.avatarUrl ?? i.avatar
3336
- }), g = !!r.groupInfo ? f : Object.fromEntries(Object.entries(f).filter(([, d]) => d !== void 0));
3337
- s.group.updateGroup(r.groupId, g), c && (u != null && u.groupName) && c !== u.groupName && (t(s, r.groupId, I.GROUPCHAT, {
3338
- eventType: A.GROUP_NAME_CHANGED,
3616
+ }), p = !!r.groupInfo ? l : Object.fromEntries(Object.entries(l).filter(([, d]) => d !== void 0));
3617
+ s.group.updateGroup(r.groupId, p), c && (u != null && u.groupName) && c !== u.groupName && (t(s, r.groupId, I.GROUPCHAT, {
3618
+ eventType: E.GROUP_NAME_CHANGED,
3339
3619
  params: { name: c },
3340
3620
  defaultText: e("chat.notice.groupNameChanged").replace("{name}", c)
3341
3621
  }), s.conversation.updateConversation(r.groupId, { name: c }));
3342
3622
  },
3343
3623
  onOwnerChanged: (r) => {
3344
- var l, p, h, v, S, C;
3345
- w.info("onOwnerChanged raw payload", r);
3346
- const i = (l = s.group.getGroupById(r.groupId)) == null ? void 0 : l.owner, c = (h = (p = s.group).getPendingOwnerTransfer) == null ? void 0 : h.call(p, r.groupId), u = c || ((v = r.newOwner) == null ? void 0 : v.userId) || "", f = { owner: u }, m = s.client.currentUser || "";
3347
- m && (m === u ? f.role = k.OWNER : m === i && (f.role = k.MEMBER)), s.group.updateGroup(r.groupId, f), u && s.group.updateGroupMemberRole(r.groupId, u, k.OWNER), i && i !== u && s.group.updateGroupMemberRole(r.groupId, i, k.MEMBER), c && ((C = (S = s.group).clearPendingOwnerTransfer) == null || C.call(S, r.groupId));
3348
- const g = u === m ? e("chat.notice.you") : o(r.newOwner), d = e("chat.notice.ownerChanged").replace("{name}", g);
3624
+ var f, m, h, v, C, w;
3625
+ S.info("onOwnerChanged raw payload", r);
3626
+ const i = (f = s.group.getGroupById(r.groupId)) == null ? void 0 : f.owner, c = (h = (m = s.group).getPendingOwnerTransfer) == null ? void 0 : h.call(m, r.groupId), u = c || ((v = r.newOwner) == null ? void 0 : v.userId) || "", l = { owner: u }, g = s.client.currentUser || "";
3627
+ g && (g === u ? l.role = R.OWNER : g === i && (l.role = R.MEMBER)), s.group.updateGroup(r.groupId, l), u && s.group.updateGroupMemberRole(r.groupId, u, R.OWNER), i && i !== u && s.group.updateGroupMemberRole(r.groupId, i, R.MEMBER), c && ((w = (C = s.group).clearPendingOwnerTransfer) == null || w.call(C, r.groupId));
3628
+ const p = u === g ? e("chat.notice.you") : o(r.newOwner), d = e("chat.notice.ownerChanged").replace("{name}", p);
3349
3629
  t(s, r.groupId, I.GROUPCHAT, {
3350
- eventType: A.OWNER_CHANGED,
3351
- params: { name: g, ownerId: u },
3630
+ eventType: E.OWNER_CHANGED,
3631
+ params: { name: p, ownerId: u },
3352
3632
  defaultText: d
3353
3633
  });
3354
3634
  },
3355
3635
  onAdminAdded: (r) => {
3356
- var m;
3357
- w.info("onAdminAdded raw payload", r);
3358
- const i = (m = r.administrator) == null ? void 0 : m.userId;
3359
- i && s.group.updateGroupMemberRole(r.groupId, i, k.ADMIN);
3360
- const c = s.client.currentUser || "", u = i === c ? e("chat.notice.you") : o(r.administrator), f = e("chat.notice.adminAdded").replace("{name}", u);
3636
+ var g;
3637
+ S.info("onAdminAdded raw payload", r);
3638
+ const i = (g = r.administrator) == null ? void 0 : g.userId;
3639
+ i && s.group.updateGroupMemberRole(r.groupId, i, R.ADMIN);
3640
+ const c = s.client.currentUser || "", u = i === c ? e("chat.notice.you") : o(r.administrator), l = e("chat.notice.adminAdded").replace("{name}", u);
3361
3641
  t(s, r.groupId, I.GROUPCHAT, {
3362
- eventType: A.ADMIN_ADDED,
3642
+ eventType: E.ADMIN_ADDED,
3363
3643
  params: { name: u, userId: i || "" },
3364
- defaultText: f
3644
+ defaultText: l
3365
3645
  });
3366
3646
  },
3367
3647
  onAdminRemoved: (r) => {
3368
- var m;
3369
- w.info("onAdminRemoved raw payload", r);
3370
- const i = (m = r.administrator) == null ? void 0 : m.userId;
3371
- i && s.group.updateGroupMemberRole(r.groupId, i, k.MEMBER);
3372
- const c = s.client.currentUser || "", u = i === c ? e("chat.notice.you") : o(r.administrator), f = e("chat.notice.adminRemoved").replace("{name}", u);
3648
+ var g;
3649
+ S.info("onAdminRemoved raw payload", r);
3650
+ const i = (g = r.administrator) == null ? void 0 : g.userId;
3651
+ i && s.group.updateGroupMemberRole(r.groupId, i, R.MEMBER);
3652
+ const c = s.client.currentUser || "", u = i === c ? e("chat.notice.you") : o(r.administrator), l = e("chat.notice.adminRemoved").replace("{name}", u);
3373
3653
  t(s, r.groupId, I.GROUPCHAT, {
3374
- eventType: A.ADMIN_REMOVED,
3654
+ eventType: E.ADMIN_REMOVED,
3375
3655
  params: { name: u, userId: i || "" },
3376
- defaultText: f
3656
+ defaultText: l
3377
3657
  });
3378
3658
  },
3379
3659
  onUserRemoved: (r) => {
3380
- w.info("onUserRemoved raw payload", r);
3660
+ S.info("onUserRemoved raw payload", r);
3381
3661
  const i = e("chat.notice.you");
3382
3662
  s.group.removeGroup(r.groupId), s.conversation.deleteConversation(r.groupId), s.message.clearConversationMessages(r.groupId);
3383
3663
  const c = e("chat.notice.userRemoved").replace("{name}", i);
3384
3664
  t(s, r.groupId, I.GROUPCHAT, {
3385
- eventType: A.USER_REMOVED,
3665
+ eventType: E.USER_REMOVED,
3386
3666
  params: { name: i },
3387
3667
  defaultText: c
3388
3668
  });
3389
3669
  },
3390
3670
  onGroupDestroyed: (r) => {
3391
3671
  var i;
3392
- w.info("onGroupDestroyed raw payload", r), s.group.removeGroup(r.groupId), (((i = s.client.client) == null ? void 0 : i.deleteConversationOnGroupDestroyed) ?? !0) && (s.conversation.deleteConversation(r.groupId), s.message.clearConversationMessages(r.groupId)), t(s, r.groupId, I.GROUPCHAT, {
3393
- eventType: A.GROUP_DESTROYED,
3672
+ S.info("onGroupDestroyed raw payload", r), s.group.removeGroup(r.groupId), (((i = s.client.client) == null ? void 0 : i.deleteConversationOnGroupDestroyed) ?? !0) && (s.conversation.deleteConversation(r.groupId), s.message.clearConversationMessages(r.groupId)), t(s, r.groupId, I.GROUPCHAT, {
3673
+ eventType: E.GROUP_DESTROYED,
3394
3674
  params: {},
3395
3675
  defaultText: e("chat.notice.groupDestroyed")
3396
3676
  });
3397
3677
  },
3398
3678
  onAnnouncementChanged: (r) => {
3399
- w.info("onAnnouncementChanged raw payload", r), s.group.updateGroup(r.groupId, { announcement: r.announcement }), s.group.setGroupAnnouncement(r.groupId, r.announcement), t(s, r.groupId, I.GROUPCHAT, {
3400
- eventType: A.ANNOUNCEMENT_CHANGED,
3679
+ S.info("onAnnouncementChanged raw payload", r), s.group.updateGroup(r.groupId, { announcement: r.announcement }), s.group.setGroupAnnouncement(r.groupId, r.announcement), t(s, r.groupId, I.GROUPCHAT, {
3680
+ eventType: E.ANNOUNCEMENT_CHANGED,
3401
3681
  params: { announcement: r.announcement || "" },
3402
3682
  defaultText: n(r.announcement)
3403
3683
  });
3404
3684
  },
3405
3685
  onMuteListAdded: (r) => {
3406
- w.info("onMuteListAdded raw payload", r);
3407
- const i = (r.mutes || []).map((f) => ({
3408
- userId: f.userId,
3686
+ S.info("onMuteListAdded raw payload", r);
3687
+ const i = (r.mutes || []).map((l) => ({
3688
+ userId: l.userId,
3409
3689
  muteExpire: r.muteExpire
3410
3690
  }));
3411
3691
  s.group.addGroupMuteMembers(r.groupId, i);
3412
- const c = (r.mutes || []).map((f) => f.nickname || f.userId || ""), u = c.map((f) => e("group.mutelist.muteNotice").replace("{name}", f)).join("、");
3692
+ const c = (r.mutes || []).map((l) => l.nickname || l.userId || ""), u = c.map((l) => e("group.mutelist.muteNotice").replace("{name}", l)).join("、");
3413
3693
  t(s, r.groupId, I.GROUPCHAT, {
3414
- eventType: A.MUTE_ADDED,
3694
+ eventType: E.MUTE_ADDED,
3415
3695
  params: { names: c.join("、"), count: c.length },
3416
3696
  defaultText: u
3417
3697
  });
3418
3698
  },
3419
3699
  onMuteListRemoved: (r) => {
3420
- w.info("onMuteListRemoved raw payload", r);
3421
- const i = (r.mutes || []).map((f) => f.userId);
3700
+ S.info("onMuteListRemoved raw payload", r);
3701
+ const i = (r.mutes || []).map((l) => l.userId);
3422
3702
  s.group.removeGroupMuteMembers(r.groupId, i);
3423
- const c = (r.mutes || []).map((f) => f.nickname || f.userId || ""), u = c.map((f) => e("group.mutelist.unmuteNotice").replace("{name}", f)).join("、");
3703
+ const c = (r.mutes || []).map((l) => l.nickname || l.userId || ""), u = c.map((l) => e("group.mutelist.unmuteNotice").replace("{name}", l)).join("、");
3424
3704
  t(s, r.groupId, I.GROUPCHAT, {
3425
- eventType: A.MUTE_REMOVED,
3705
+ eventType: E.MUTE_REMOVED,
3426
3706
  params: { names: c.join("、"), count: c.length },
3427
3707
  defaultText: u
3428
3708
  });
3429
3709
  },
3430
3710
  onAllMemberMuteStateChanged: (r) => {
3431
- w.info("onAllMemberMuteStateChanged raw payload", r), s.group.updateGroup(r.groupId, { mute: r.isMuted });
3711
+ S.info("onAllMemberMuteStateChanged raw payload", r), s.group.updateGroup(r.groupId, { mute: r.isMuted });
3432
3712
  const i = e(r.isMuted ? "group.mutelist.muteAllNotice" : "group.mutelist.unmuteAllNotice");
3433
3713
  t(s, r.groupId, I.GROUPCHAT, {
3434
- eventType: A.ALL_MEMBER_MUTE_CHANGED,
3714
+ eventType: E.ALL_MEMBER_MUTE_CHANGED,
3435
3715
  params: { muted: r.isMuted },
3436
3716
  defaultText: i
3437
3717
  });
3438
3718
  },
3439
3719
  onAllowListAdded: (r) => {
3440
- w.info("onAllowListAdded raw payload", r);
3720
+ S.info("onAllowListAdded raw payload", r);
3441
3721
  const i = (r.allowlist || []).map((u) => u.userId);
3442
3722
  s.group.addGroupAllowlistMembers(r.groupId, i);
3443
- const c = ie(
3723
+ const c = ce(
3444
3724
  r.allowlist || [],
3445
3725
  s.client.currentUser || "",
3446
3726
  "chat.notice.allowlistAdded",
3447
3727
  "chat.notice.allowlistAddedMultiple"
3448
3728
  );
3449
3729
  t(s, r.groupId, I.GROUPCHAT, {
3450
- eventType: A.ALLOWLIST_ADDED,
3451
- params: ae(r.allowlist || [], s.client.currentUser || ""),
3730
+ eventType: E.ALLOWLIST_ADDED,
3731
+ params: ue(r.allowlist || [], s.client.currentUser || ""),
3452
3732
  defaultText: c
3453
3733
  });
3454
3734
  },
3455
3735
  onAllowListRemoved: (r) => {
3456
- w.info("onAllowListRemoved raw payload", r);
3736
+ S.info("onAllowListRemoved raw payload", r);
3457
3737
  const i = (r.allowlist || []).map((u) => u.userId);
3458
3738
  s.group.removeGroupAllowlistMembers(r.groupId, i);
3459
- const c = ie(
3739
+ const c = ce(
3460
3740
  r.allowlist || [],
3461
3741
  s.client.currentUser || "",
3462
3742
  "chat.notice.allowlistRemoved",
3463
3743
  "chat.notice.allowlistRemovedMultiple"
3464
3744
  );
3465
3745
  t(s, r.groupId, I.GROUPCHAT, {
3466
- eventType: A.ALLOWLIST_REMOVED,
3467
- params: ae(r.allowlist || [], s.client.currentUser || ""),
3746
+ eventType: E.ALLOWLIST_REMOVED,
3747
+ params: ue(r.allowlist || [], s.client.currentUser || ""),
3468
3748
  defaultText: c
3469
3749
  });
3470
3750
  },
3471
3751
  onGroupDisabledChanged: (r) => {
3472
- w.info("onGroupDisabledChanged raw payload", r), s.group.updateGroup(r.groupId, { disabled: r.disabled }), t(s, r.groupId, I.GROUPCHAT, {
3473
- eventType: A.GROUP_DISABLED_CHANGED,
3752
+ S.info("onGroupDisabledChanged raw payload", r), s.group.updateGroup(r.groupId, { disabled: r.disabled }), t(s, r.groupId, I.GROUPCHAT, {
3753
+ eventType: E.GROUP_DISABLED_CHANGED,
3474
3754
  params: { disabled: r.disabled },
3475
3755
  defaultText: e(r.disabled ? "chat.notice.groupDisabled" : "chat.notice.groupEnabled")
3476
3756
  });
3477
3757
  },
3478
3758
  onSharedFileAdded: (r) => {
3479
- if (w.info("onSharedFileAdded raw payload", r), r.sharedFile) {
3759
+ if (S.info("onSharedFileAdded raw payload", r), r.sharedFile) {
3480
3760
  s.group.addGroupSharedFile(r.groupId, r.sharedFile);
3481
3761
  const i = r.sharedFile.fileOwner, c = (i == null ? void 0 : i.userId) === s.client.currentUser ? e("chat.notice.you") : o(i), u = e("chat.notice.sharedFileAdded").replace("{name}", c || (i == null ? void 0 : i.userId) || "").replace("{fileName}", r.sharedFile.fileName);
3482
3762
  t(s, r.groupId, I.GROUPCHAT, {
3483
- eventType: A.SHARED_FILE_ADDED,
3763
+ eventType: E.SHARED_FILE_ADDED,
3484
3764
  params: { name: c || (i == null ? void 0 : i.userId) || "", fileName: r.sharedFile.fileName },
3485
3765
  defaultText: u
3486
3766
  });
3487
3767
  }
3488
3768
  },
3489
3769
  onSharedFileDeleted: (r) => {
3490
- w.info("onSharedFileDeleted raw payload", r), s.group.removeGroupSharedFile(r.groupId, r.fileId);
3770
+ S.info("onSharedFileDeleted raw payload", r), s.group.removeGroupSharedFile(r.groupId, r.fileId);
3491
3771
  },
3492
3772
  onRequestToJoinReceived: (r) => {
3493
3773
  var c;
3494
- w.info("onRequestToJoinReceived raw payload", r);
3774
+ S.info("onRequestToJoinReceived raw payload", r);
3495
3775
  const i = s.group.getGroupJoinRequests(r.groupId);
3496
3776
  s.group.setGroupJoinRequests(r.groupId, [
3497
3777
  ...i,
@@ -3508,16 +3788,16 @@ function On(s) {
3508
3788
  ]);
3509
3789
  },
3510
3790
  onRequestToJoinAccepted: (r) => {
3511
- w.info("onRequestToJoinAccepted raw payload", r);
3791
+ S.info("onRequestToJoinAccepted raw payload", r);
3512
3792
  const i = s.client.currentUser, c = s.group.getGroupJoinRequests(r.groupId).filter((u) => {
3513
- var f;
3514
- return !(u.status === "pending" && (u.applicantId === i || ((f = u.applicant) == null ? void 0 : f.userId) === i));
3793
+ var l;
3794
+ return !(u.status === "pending" && (u.applicantId === i || ((l = u.applicant) == null ? void 0 : l.userId) === i));
3515
3795
  });
3516
3796
  s.group.setGroupJoinRequests(r.groupId, c);
3517
3797
  },
3518
3798
  onRequestToJoinDeclined: (r) => {
3519
3799
  var i;
3520
- w.info("onRequestToJoinDeclined raw payload", r), s.group.updateGroupJoinRequest(
3800
+ S.info("onRequestToJoinDeclined raw payload", r), s.group.updateGroupJoinRequest(
3521
3801
  r.groupId,
3522
3802
  ((i = r.applicant) == null ? void 0 : i.userId) || "",
3523
3803
  "declined"
@@ -3525,17 +3805,17 @@ function On(s) {
3525
3805
  }
3526
3806
  };
3527
3807
  }
3528
- const xn = T("UIKit:PresenceEvents");
3529
- function Pn(s) {
3808
+ const os = T("UIKit:PresenceEvents");
3809
+ function is(s) {
3530
3810
  return {
3531
3811
  onPresenceStatusChange: (e) => {
3532
- if (xn.info("onPresenceStatusChange", { count: Array.isArray(e) ? e.length : 0 }), !Array.isArray(e))
3812
+ if (os.info("onPresenceStatusChange", { count: Array.isArray(e) ? e.length : 0 }), !Array.isArray(e))
3533
3813
  return;
3534
3814
  const t = e.map((n) => {
3535
3815
  const o = n.userId || "", r = (Array.isArray(n.statusDetails) ? n.statusDetails : []).some((c) => Number(c == null ? void 0 : c.status) === 1), i = n.ext || "";
3536
3816
  return {
3537
3817
  userId: o,
3538
- status: nt(r, i),
3818
+ status: ft(r, i),
3539
3819
  ext: i,
3540
3820
  lastTime: n.lastTime || Date.now()
3541
3821
  };
@@ -3544,25 +3824,25 @@ function Pn(s) {
3544
3824
  }
3545
3825
  };
3546
3826
  }
3547
- function Bn(s, e, t = {}, n, o, a) {
3548
- const r = wn(e, t), i = Nn(s, e, n, o, a), c = kn(e), u = On(e), f = Pn(e);
3549
- return s.addEventHandler("uikit-conn", r), s.chatManager.addEventHandler("uikit-chat", i), s.contactManager.addEventHandler("uikit-contact", c), s.groupManager.addEventHandler("uikit-group", u), s.presenceManager.addEventHandler("uikit-presence", f), () => {
3550
- s.removeEventHandler("uikit-conn"), s.chatManager.removeEventHandler("uikit-chat"), s.contactManager.removeEventHandler("uikit-contact"), s.groupManager.removeEventHandler("uikit-group"), s.presenceManager.removeEventHandler("uikit-presence"), Un(), An();
3827
+ function as(s, e, t = {}, n, o, a) {
3828
+ const r = Kn(e, t), i = ns(s, e, n, o, a), c = ss(e), u = rs(e), l = is(e);
3829
+ return s.addEventHandler("uikit-conn", r), s.chatManager.addEventHandler("uikit-chat", i), s.contactManager.addEventHandler("uikit-contact", c), s.groupManager.addEventHandler("uikit-group", u), s.presenceManager.addEventHandler("uikit-presence", l), () => {
3830
+ s.removeEventHandler("uikit-conn"), s.chatManager.removeEventHandler("uikit-chat"), s.contactManager.removeEventHandler("uikit-contact"), s.groupManager.removeEventHandler("uikit-group"), s.presenceManager.removeEventHandler("uikit-presence"), Xn(), jn();
3551
3831
  };
3552
3832
  }
3553
- const D = T("UIKit:Websdk5Adapter"), Fn = [
3554
- qe,
3555
- ct,
3556
- ut,
3557
- dt,
3558
- lt,
3559
- We
3560
- ], Hn = [
3561
- qe,
3562
- at,
3563
- We
3833
+ const _ = T("UIKit:Websdk5Adapter"), cs = [
3834
+ tt,
3835
+ yt,
3836
+ Ct,
3837
+ bt,
3838
+ wt,
3839
+ nt
3840
+ ], us = [
3841
+ tt,
3842
+ Mt,
3843
+ nt
3564
3844
  ];
3565
- class ts {
3845
+ class ws {
3566
3846
  constructor(e) {
3567
3847
  this.injectedClient = e, this.capabilities = {
3568
3848
  combineMessage: !0,
@@ -3571,7 +3851,7 @@ class ts {
3571
3851
  streamingMessage: !0,
3572
3852
  groupReadReceipt: !0,
3573
3853
  // 本 adapter 遵循的契约版本(协商机制见 contract capabilities.ts)
3574
- contractVersion: St
3854
+ contractVersion: Ot
3575
3855
  }, this._client = null, this._handlersSet = /* @__PURE__ */ new Set(), this._eventsRegistered = !1, this._registerImEvents = !0;
3576
3856
  }
3577
3857
  /** 原生 SDK 客户端实例(UIKitClient 包装,可选) */
@@ -3603,97 +3883,108 @@ class ts {
3603
3883
  onUserInfoSubscriptionPermissionError: i,
3604
3884
  registerImEvents: c,
3605
3885
  managerPreset: u,
3606
- repositories: f,
3607
- persistence: m,
3608
- lastMessageTextResolver: g,
3886
+ repositories: l,
3887
+ persistence: g,
3888
+ lastMessageTextResolver: p,
3609
3889
  ...d
3610
- } = t, l = e.repositories ?? f, p = e.persistence ?? m;
3611
- this._persistence = p, this._lastMessageTextResolver = g, this._loginTimeoutMs = e.loginTimeoutMs;
3612
- const { appKey: h, appId: v, ...S } = d;
3613
- let C;
3890
+ } = t, f = e.repositories ?? l, m = e.persistence ?? g;
3891
+ this._persistence = m, this._lastMessageTextResolver = p, this._loginTimeoutMs = e.loginTimeoutMs;
3892
+ const { appKey: h, appId: v, ...C } = d;
3893
+ let w;
3614
3894
  if (e.appKey)
3615
- C = { appKey: e.appKey };
3895
+ w = { appKey: e.appKey };
3616
3896
  else if (e.appId)
3617
- C = { appId: e.appId };
3897
+ w = { appId: e.appId };
3618
3898
  else if (this.injectedClient)
3619
- C = { appKey: "" };
3899
+ w = { appKey: "" };
3620
3900
  else
3621
3901
  throw new Error("[Websdk5Adapter] 缺少应用身份:SdkConfig.appKey 与 SdkConfig.appId 必须提供其一");
3622
- this._client = this.injectedClient ?? Nt({
3902
+ const M = (n == null ? void 0 : n.enableUserInfo) === !1 ? !1 : C.enableUserInfoSync ?? !0;
3903
+ this._client = this.injectedClient ?? Wt({
3623
3904
  debug: e.debug,
3624
- managers: d.managers ?? (u === "chatroom" ? Hn : Fn),
3625
- ...S,
3626
- ...C
3627
- }), r && rt(r), this._features = n ?? jt(), this._registerImEvents = c !== !1;
3628
- const y = a ? Object.keys(a) : [];
3629
- if (D.info("[Websdk5Adapter] init 开始", {
3905
+ managers: d.managers ?? (u === "chatroom" ? us : cs),
3906
+ ...C,
3907
+ enableUserInfoSync: M,
3908
+ ...w
3909
+ }), r && mt(r), this._features = n ?? tn(), this._registerImEvents = c !== !1;
3910
+ const A = a ? Object.keys(a) : [];
3911
+ if (_.info("[Websdk5Adapter] init 开始", {
3630
3912
  mode: this.injectedClient ? "injected-client" : "builtin",
3631
3913
  managerPreset: u ?? "im",
3632
3914
  registerImEvents: this._registerImEvents,
3633
- injectedStores: y
3634
- }), y.length < 7) {
3635
- const W = ["client", "message", "conversation", "contact", "group", "presence", "userInfo"];
3636
- D.debug(
3915
+ injectedStores: A
3916
+ }), A.length < 7) {
3917
+ const O = ["client", "message", "conversation", "contact", "group", "presence", "userInfo"];
3918
+ _.debug(
3637
3919
  "[Websdk5Adapter] 以下 store 域未注入,回落 adapter 内置 store:",
3638
- W.filter((L) => !y.includes(L))
3920
+ O.filter((U) => !A.includes(U))
3639
3921
  );
3640
3922
  }
3641
- const R = { ...Kt(this, () => this._getFanout()), ...a };
3642
- this._stores = R, this._domains = {
3643
- message: new dn(this._client, R.message, {
3644
- messageRepository: l == null ? void 0 : l.message,
3645
- persistence: p == null ? void 0 : p.message
3923
+ const x = { ...en(this, () => this._getFanout()), ...a };
3924
+ this._stores = x, this._domains = {
3925
+ message: new Sn(this._client, x.message, {
3926
+ messageRepository: f == null ? void 0 : f.message,
3927
+ persistence: m == null ? void 0 : m.message
3646
3928
  }),
3647
- conversation: new pn(this._client, R.conversation, {
3648
- sendPendingReadReceipts: (W, L) => {
3649
- var Y, De;
3650
- ((Y = this._features) == null ? void 0 : Y.enableReadReceipt) !== !1 && ((De = this._domains) == null || De.message.sendPendingReadReceipts(W, L));
3929
+ conversation: new Rn(this._client, x.conversation, {
3930
+ sendPendingReadReceipts: (O, U) => {
3931
+ var Z, He;
3932
+ ((Z = this._features) == null ? void 0 : Z.enableReadReceipt) !== !1 && ((He = this._domains) == null || He.message.sendPendingReadReceipts(O, U));
3933
+ },
3934
+ resolveSenderName: (O) => {
3935
+ var Z;
3936
+ const U = x.contact.getContact(O);
3937
+ return U != null && U.remark || U != null && U.name ? U.remark || U.name : (Z = x.userInfo.getUserInfo(O)) == null ? void 0 : Z.nickname;
3651
3938
  },
3652
- resolveSenderName: (W) => {
3653
- var Y;
3654
- const L = R.contact.getContact(W);
3655
- return L != null && L.remark || L != null && L.name ? L.remark || L.name : (Y = R.userInfo.getUserInfo(W)) == null ? void 0 : Y.nickname;
3939
+ prefillUserInfo: (O) => {
3940
+ var U;
3941
+ return (U = this._userInfoDomain) == null ? void 0 : U.prefillUserInfos(O);
3656
3942
  },
3657
3943
  lastMessageTextResolver: this._lastMessageTextResolver,
3658
- conversationRepository: l == null ? void 0 : l.conversation,
3659
- persistence: p == null ? void 0 : p.conversation
3944
+ conversationRepository: f == null ? void 0 : f.conversation,
3945
+ persistence: m == null ? void 0 : m.conversation
3660
3946
  }),
3661
- contact: new In(this._client, R.contact, {
3662
- contactRepository: l == null ? void 0 : l.contact
3947
+ contact: new Dn(this._client, x.contact, {
3948
+ contactRepository: f == null ? void 0 : f.contact
3663
3949
  }),
3664
- group: new yn(this._client, R.group, {
3665
- groupRepository: l == null ? void 0 : l.group
3950
+ group: new kn(this._client, x.group, {
3951
+ groupRepository: f == null ? void 0 : f.group
3666
3952
  }),
3667
- presence: new bn(this._client, R.presence, {
3668
- presenceRepository: l == null ? void 0 : l.presence
3953
+ presence: new On(this._client, x.presence, {
3954
+ presenceRepository: f == null ? void 0 : f.presence
3669
3955
  })
3670
- }, this._userInfoDomain = new Cn(
3956
+ };
3957
+ const vt = (f == null ? void 0 : f.userInfo) ?? nn(o) ?? {};
3958
+ this._userInfoDomain = new Hn(
3671
3959
  this._client,
3672
- R.userInfo,
3673
- (l == null ? void 0 : l.userInfo) ?? Vt(o) ?? {},
3674
- i ?? (() => D.warn("[Websdk5Adapter] 用户资料订阅无权限,已自动熔断"))
3675
- ), this._userInfoDomain.listen(), this._setupEventHandlers(), D.info("[Websdk5Adapter] init 完成");
3960
+ x.userInfo,
3961
+ {
3962
+ readCachedUserInfos: (O) => ln(this._client, O),
3963
+ ...vt
3964
+ },
3965
+ i ?? (() => _.warn("[Websdk5Adapter] 用户资料订阅无权限,已自动熔断"))
3966
+ ), this._userInfoDomain.listen(), this._setupEventHandlers(), _.info("[Websdk5Adapter] init 完成");
3676
3967
  }
3677
3968
  async login(e, t) {
3678
- var o, a, r, i, c, u, f;
3969
+ var o, a, r, i, c, u, l;
3679
3970
  if (!this._client)
3680
3971
  throw new Error("[Websdk5Adapter] 尚未初始化,请先调用 init()");
3681
- this._eventsRegistered || (D.debug("[Websdk5Adapter] 登出后重新登录,恢复事件处理器与用户资料监听"), (o = this._userInfoDomain) == null || o.listen(), this._setupEventHandlers());
3682
- const n = At(e);
3683
- n !== e && D.warn("[Websdk5Adapter] 检测到登录 userId 包含大写字母,已强制转换为纯小写后继续登录", {
3972
+ this._eventsRegistered || (_.debug("[Websdk5Adapter] 登出后重新登录,恢复事件处理器与用户资料监听"), (o = this._userInfoDomain) == null || o.listen(), this._setupEventHandlers());
3973
+ const n = xt(e);
3974
+ n !== e && _.warn("[Websdk5Adapter] 检测到登录 userId 包含大写字母,已强制转换为纯小写后继续登录", {
3684
3975
  originalUserId: e,
3685
3976
  normalizedUserId: n
3686
- }), D.info("[Websdk5Adapter] login 开始", { user: n }), (i = (a = this._stores) == null ? void 0 : (r = a.client).setCurrentUser) == null || i.call(r, n);
3977
+ }), _.info("[Websdk5Adapter] login 开始", { user: n }), (i = (a = this._stores) == null ? void 0 : (r = a.client).setCurrentUser) == null || i.call(r, n);
3687
3978
  try {
3688
3979
  await this._client.login(n, t, this._loginTimeoutMs);
3689
- } catch (m) {
3690
- throw (f = (c = this._stores) == null ? void 0 : (u = c.client).setCurrentUser) == null || f.call(u, ""), D.error("[Websdk5Adapter] login 失败:", U(m)), m;
3980
+ } catch (g) {
3981
+ throw (l = (c = this._stores) == null ? void 0 : (u = c.client).setCurrentUser) == null || l.call(u, ""), _.error("[Websdk5Adapter] login 失败:", L(g)), g;
3691
3982
  }
3692
- D.info("[Websdk5Adapter] login 成功", { user: n });
3983
+ _.info("[Websdk5Adapter] login 成功", { user: n });
3693
3984
  }
3694
3985
  async logout() {
3695
3986
  var e, t, n, o, a;
3696
- D.info("[Websdk5Adapter] logout"), await ((e = this._client) == null ? void 0 : e.logout()), (t = this._domains) == null || t.message.clearMultiBodyRetryCache(), (n = this._disposeEventHandlers) == null || n.call(this), this._disposeEventHandlers = void 0, (o = this._disposeSyncListener) == null || o.call(this), this._disposeSyncListener = void 0, (a = this._userInfoDomain) == null || a.dispose(), this._eventsRegistered = !1;
3987
+ _.info("[Websdk5Adapter] logout"), await ((e = this._client) == null ? void 0 : e.logout()), (t = this._domains) == null || t.message.clearMultiBodyRetryCache(), (n = this._disposeEventHandlers) == null || n.call(this), this._disposeEventHandlers = void 0, (o = this._disposeSyncListener) == null || o.call(this), this._disposeSyncListener = void 0, (a = this._userInfoDomain) == null || a.dispose(), this._eventsRegistered = !1;
3697
3988
  }
3698
3989
  /** 订阅中立事件,返回取消订阅函数(支持多方订阅,内部扇出派发) */
3699
3990
  subscribe(e) {
@@ -3720,13 +4011,13 @@ class ts {
3720
4011
  var e, t;
3721
4012
  if (!(!this._client || !this._stores)) {
3722
4013
  if (!this._registerImEvents) {
3723
- D.debug("[Websdk5Adapter] IM 事件套件已关闭(registerImEvents=false),场景事件由业务经 onAdapterReady 自行注册");
4014
+ _.debug("[Websdk5Adapter] IM 事件套件已关闭(registerImEvents=false),场景事件由业务经 onAdapterReady 自行注册");
3724
4015
  return;
3725
4016
  }
3726
- En(), (e = this._disposeSyncListener) == null || e.call(this), this._disposeSyncListener = Sn((n) => {
4017
+ Wn(), (e = this._disposeSyncListener) == null || e.call(this), this._disposeSyncListener = qn((n) => {
3727
4018
  var o, a;
3728
4019
  (a = (o = this._getFanout()).onSyncStatus) == null || a.call(o, n);
3729
- }), (t = this._disposeEventHandlers) == null || t.call(this), this._disposeEventHandlers = Bn(
4020
+ }), (t = this._disposeEventHandlers) == null || t.call(this), this._disposeEventHandlers = as(
3730
4021
  this._client,
3731
4022
  this._stores,
3732
4023
  {
@@ -3742,95 +4033,96 @@ class ts {
3742
4033
  this._features,
3743
4034
  this._persistence,
3744
4035
  this._lastMessageTextResolver
3745
- ), this._eventsRegistered = !0, D.debug("[Websdk5Adapter] SDK 事件处理器已注册");
4036
+ ), this._eventsRegistered = !0, _.debug("[Websdk5Adapter] SDK 事件处理器已注册");
3746
4037
  }
3747
4038
  }
3748
4039
  get message() {
3749
4040
  if (!this._domains)
3750
4041
  throw new Error("[Websdk5Adapter] 尚未初始化,请先调用 init()");
3751
- return $t({ message: this._domains.message, conversation: this._domains.conversation });
4042
+ return an({ message: this._domains.message, conversation: this._domains.conversation });
3752
4043
  }
3753
4044
  get conversation() {
3754
4045
  if (!this._domains)
3755
4046
  throw new Error("[Websdk5Adapter] 尚未初始化,请先调用 init()");
3756
- return Wt(this._domains.conversation);
4047
+ return rn(this._domains.conversation);
3757
4048
  }
3758
4049
  get contact() {
3759
4050
  if (!this._domains)
3760
4051
  throw new Error("[Websdk5Adapter] 尚未初始化,请先调用 init()");
3761
- return qt(this._domains.contact);
4052
+ return sn(this._domains.contact);
3762
4053
  }
3763
4054
  get group() {
3764
4055
  if (!this._domains)
3765
4056
  throw new Error("[Websdk5Adapter] 尚未初始化,请先调用 init()");
3766
- return Jt(this._domains.group);
4057
+ return on(this._domains.group);
3767
4058
  }
3768
4059
  get presence() {
3769
4060
  if (!this._domains)
3770
4061
  throw new Error("[Websdk5Adapter] 尚未初始化,请先调用 init()");
3771
- return Qt(this._domains.presence);
4062
+ return cn(this._domains.presence);
3772
4063
  }
3773
4064
  get userInfo() {
3774
4065
  if (!this._userInfoDomain)
3775
4066
  throw new Error("[Websdk5Adapter] 尚未初始化,请先调用 init()");
3776
- return zt(this._userInfoDomain);
4067
+ return un(this._userInfoDomain);
3777
4068
  }
3778
4069
  }
3779
4070
  export {
3780
- Be as ALL_USER_INFO_ATTRIBUTES,
3781
- In as ContactDomain,
3782
- pn as ConversationDomain,
3783
- yn as GroupDomain,
3784
- dn as MessageDomain,
3785
- bn as PresenceDomain,
3786
- _t as UIKitClient,
3787
- Cn as UserInfoDomain,
3788
- Hn as WEBSDK5_CHATROOM_MANAGERS,
3789
- Fn as WEBSDK5_MANAGERS,
3790
- ts as Websdk5Adapter,
3791
- Nn as createChatHandlers,
3792
- Nt as createClient,
3793
- wn as createConnectionHandlers,
3794
- kn as createContactHandlers,
3795
- On as createGroupHandlers,
3796
- Pn as createPresenceHandlers,
3797
- Ue as defaultAdapterPreviewLabels,
3798
- Jn as disableSdkLogCapture,
3799
- Wn as enableSdkLogCapture,
3800
- zn as extractLastMessageText,
3801
- tn as extractSdkErrorReason,
3802
- Xt as extractSnippetText,
3803
- U as formatSdkError,
3804
- Yn as isMessageInConversation,
3805
- $n as isSdkDebugEnabled,
3806
- an as markReadReceiptSent,
3807
- rs as normalizeUserId,
3808
- Fe as notifyContactEvent,
3809
- Rn as notifyOnNewMessage,
3810
- nt as parsePresenceStatus,
3811
- Bn as registerEventHandlers,
3812
- Un as resetChatEventState,
3813
- An as resetSyncStatus,
3814
- Xn as resolvePeerUserId,
3815
- en as resolveSdkErrorCodeI18nKey,
3816
- nn as resolveSdkErrorI18nKey,
3817
- Zn as resolveSdkErrorMessage,
3818
- ot as resolveSenderDisplayName,
3819
- Tn as resolveUserDisplayName,
3820
- rt as setEventHandlerDeps,
3821
- Rt as setSdkDebugGuard,
3822
- qn as setSdkLogAppender,
3823
- be as setSyncStatus,
3824
- Sn as setSyncStatusListener,
3825
- hn as toUiContact,
3826
- Ge as toUiContacts,
3827
- ln as toUiConversation,
3828
- te as toUiConversations,
3829
- Le as toUiGroup,
3830
- Mn as toUiGroupMember,
3831
- Z as toUiGroupMembers,
3832
- fe as toUiGroups,
3833
- P as toUiMessage,
3834
- Qn as toUiMessages,
3835
- es as useSyncStatus
4071
+ Ue as ALL_USER_INFO_ATTRIBUTES,
4072
+ Dn as ContactDomain,
4073
+ Rn as ConversationDomain,
4074
+ kn as GroupDomain,
4075
+ Sn as MessageDomain,
4076
+ Ge as PRESENCE_REQUEST_BATCH_SIZE,
4077
+ On as PresenceDomain,
4078
+ Vt as UIKitClient,
4079
+ Hn as UserInfoDomain,
4080
+ us as WEBSDK5_CHATROOM_MANAGERS,
4081
+ cs as WEBSDK5_MANAGERS,
4082
+ ws as Websdk5Adapter,
4083
+ ns as createChatHandlers,
4084
+ Wt as createClient,
4085
+ Kn as createConnectionHandlers,
4086
+ ss as createContactHandlers,
4087
+ rs as createGroupHandlers,
4088
+ is as createPresenceHandlers,
4089
+ Be as defaultAdapterPreviewLabels,
4090
+ ps as disableSdkLogCapture,
4091
+ ms as enableSdkLogCapture,
4092
+ Is as extractLastMessageText,
4093
+ hn as extractSdkErrorReason,
4094
+ gn as extractSnippetText,
4095
+ L as formatSdkError,
4096
+ Ms as isMessageInConversation,
4097
+ hs as isSdkDebugEnabled,
4098
+ Cn as markReadReceiptSent,
4099
+ Es as normalizeUserId,
4100
+ Qe as notifyContactEvent,
4101
+ $n as notifyOnNewMessage,
4102
+ ft as parsePresenceStatus,
4103
+ as as registerEventHandlers,
4104
+ Xn as resetChatEventState,
4105
+ jn as resetSyncStatus,
4106
+ ys as resolvePeerUserId,
4107
+ pn as resolveSdkErrorCodeI18nKey,
4108
+ vn as resolveSdkErrorI18nKey,
4109
+ Cs as resolveSdkErrorMessage,
4110
+ pt as resolveSenderDisplayName,
4111
+ Jn as resolveUserDisplayName,
4112
+ mt as setEventHandlerDeps,
4113
+ Ht as setSdkDebugGuard,
4114
+ gs as setSdkLogAppender,
4115
+ Re as setSyncStatus,
4116
+ qn as setSyncStatusListener,
4117
+ Ln as toUiContact,
4118
+ ke as toUiContacts,
4119
+ An as toUiConversation,
4120
+ se as toUiConversations,
4121
+ Fe as toUiGroup,
4122
+ Nn as toUiGroupMember,
4123
+ te as toUiGroupMembers,
4124
+ Ie as toUiGroups,
4125
+ H as toUiMessage,
4126
+ vs as toUiMessages,
4127
+ bs as useSyncStatus
3836
4128
  };