@ethora/chat-component 26.4.2 → 26.4.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/main.js CHANGED
@@ -4845,7 +4845,7 @@ const O9 = 1e11, L9 = 1e14, F9 = 1e17, qc = (e) => !Number.isFinite(e) || e <= 0
4845
4845
  }, U9 = (e) => Array.isArray(e) ? e.filter((t) => typeof t == "string") : [], Vc = (e) => !(typeof e != "string" || !e || !e.includes("@")), Bf = (e) => Object.prototype.hasOwnProperty.call(
4846
4846
  e || {},
4847
4847
  "messageTimestampMs"
4848
- ) ? Xe(e?.messageTimestampMs) : Xe(e?.date) || Xe(e?.timestamp) || Xe(e?.xmppId) || Xe(e?.id), H9 = (e) => String(e?.xmppId || e?.id || ""), Jm = (e) => String(e?.xmppId || e?.id || ""), Rf = (e, t) => {
4848
+ ) ? Xe(e?.messageTimestampMs) : Xe(e?.date) || Xe(e?.timestamp) || Xe(e?.xmppId) || Xe(e?.id), H9 = (e) => String(e?.id || e?.xmppId || ""), Jm = (e) => String(e?.xmppId || e?.id || ""), Rf = (e, t) => {
4849
4849
  const n = Bf(e), i = Bf(t);
4850
4850
  if (n !== i)
4851
4851
  return n - i;
@@ -4866,12 +4866,17 @@ const O9 = 1e11, L9 = 1e14, F9 = 1e17, qc = (e) => !Number.isFinite(e) || e <= 0
4866
4866
  }, Km = (e, t, n) => {
4867
4867
  if (!t?.length) return e || [];
4868
4868
  if (!e?.length)
4869
- return t.map((r) => dA(r, n));
4870
- const i = /* @__PURE__ */ new Map();
4871
- return [...e, ...t].forEach((r) => {
4872
- const s = H9(r);
4873
- s && i.set(s, dA(r, n));
4874
- }), [...i.values()].sort(Rf);
4869
+ return t.map((a) => dA(a, n));
4870
+ const i = [...e, ...t], r = /* @__PURE__ */ new Set();
4871
+ i.forEach((a) => {
4872
+ a && !a.pending && a.xmppId && r.add(String(a.xmppId));
4873
+ });
4874
+ const s = /* @__PURE__ */ new Map();
4875
+ return i.forEach((a) => {
4876
+ if (!a || a.pending && r.has(String(a.id))) return;
4877
+ const o = H9(a);
4878
+ o && s.set(o, dA(a, n));
4879
+ }), [...s.values()].sort(Rf);
4875
4880
  }, fs = (e, t) => {
4876
4881
  const n = (e || []).filter((a) => a?.id !== "delimiter-new"), i = Xe(t);
4877
4882
  if (i <= 0 || n.length === 0)