@ethora/chat-component 26.3.23 → 26.3.24

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
@@ -1,6 +1,6 @@
1
1
  import { jsx as g, jsxs as U, Fragment as je } from "react/jsx-runtime";
2
2
  import * as Pt from "react";
3
- import Ge, { useRef as be, useState as le, useCallback as de, useEffect as ge, createContext as JA, useContext as Kd, createElement as j6, useMemo as qe, Fragment as Ku, forwardRef as W6, PureComponent as Y6 } from "react";
3
+ import Ge, { useRef as be, useState as le, useCallback as de, useEffect as ge, createContext as JA, useContext as Kd, createElement as j6, useMemo as Ve, Fragment as Ku, forwardRef as W6, PureComponent as Y6 } from "react";
4
4
  function ci(e) {
5
5
  return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
6
6
  }
@@ -2918,11 +2918,11 @@ function BC() {
2918
2918
  y[16] = this.block, y[S >>> 2] |= u[S & 3], this.block = y[16], S >= 56 && (this.hashed || this.hash(), y[0] = this.block, y[16] = y[1] = y[2] = y[3] = y[4] = y[5] = y[6] = y[7] = y[8] = y[9] = y[10] = y[11] = y[12] = y[13] = y[14] = y[15] = 0), y[14] = this.hBytes << 3 | this.bytes >>> 29, y[15] = this.bytes << 3, this.hash();
2919
2919
  }
2920
2920
  }, w.prototype.hash = function() {
2921
- var y = this.h0, S = this.h1, D = this.h2, P = this.h3, x = this.h4, _ = this.h5, I = this.h6, N = this.h7, B = this.blocks, O, Y, G, X, $, R, j, W, T, H, K;
2921
+ var y = this.h0, S = this.h1, D = this.h2, P = this.h3, x = this.h4, _ = this.h5, I = this.h6, N = this.h7, B = this.blocks, O, Y, G, X, $, R, j, W, T, H, Z;
2922
2922
  for (O = 16; O < 64; ++O)
2923
2923
  $ = B[O - 15], Y = ($ >>> 7 | $ << 25) ^ ($ >>> 18 | $ << 14) ^ $ >>> 3, $ = B[O - 2], G = ($ >>> 17 | $ << 15) ^ ($ >>> 19 | $ << 13) ^ $ >>> 10, B[O] = B[O - 16] + Y + B[O - 7] + G << 0;
2924
- for (K = S & D, O = 0; O < 64; O += 4)
2925
- this.first ? (this.is224 ? (W = 300032, $ = B[0] - 1413257819, N = $ - 150054599 << 0, P = $ + 24177077 << 0) : (W = 704751109, $ = B[0] - 210244248, N = $ - 1521486534 << 0, P = $ + 143694565 << 0), this.first = !1) : (Y = (y >>> 2 | y << 30) ^ (y >>> 13 | y << 19) ^ (y >>> 22 | y << 10), G = (x >>> 6 | x << 26) ^ (x >>> 11 | x << 21) ^ (x >>> 25 | x << 7), W = y & S, X = W ^ y & D ^ K, j = x & _ ^ ~x & I, $ = N + G + j + l[O] + B[O], R = Y + X, N = P + $ << 0, P = $ + R << 0), Y = (P >>> 2 | P << 30) ^ (P >>> 13 | P << 19) ^ (P >>> 22 | P << 10), G = (N >>> 6 | N << 26) ^ (N >>> 11 | N << 21) ^ (N >>> 25 | N << 7), T = P & y, X = T ^ P & S ^ W, j = N & x ^ ~N & _, $ = I + G + j + l[O + 1] + B[O + 1], R = Y + X, I = D + $ << 0, D = $ + R << 0, Y = (D >>> 2 | D << 30) ^ (D >>> 13 | D << 19) ^ (D >>> 22 | D << 10), G = (I >>> 6 | I << 26) ^ (I >>> 11 | I << 21) ^ (I >>> 25 | I << 7), H = D & P, X = H ^ D & y ^ T, j = I & N ^ ~I & x, $ = _ + G + j + l[O + 2] + B[O + 2], R = Y + X, _ = S + $ << 0, S = $ + R << 0, Y = (S >>> 2 | S << 30) ^ (S >>> 13 | S << 19) ^ (S >>> 22 | S << 10), G = (_ >>> 6 | _ << 26) ^ (_ >>> 11 | _ << 21) ^ (_ >>> 25 | _ << 7), K = S & D, X = K ^ S & P ^ H, j = _ & I ^ ~_ & N, $ = x + G + j + l[O + 3] + B[O + 3], R = Y + X, x = y + $ << 0, y = $ + R << 0, this.chromeBugWorkAround = !0;
2924
+ for (Z = S & D, O = 0; O < 64; O += 4)
2925
+ this.first ? (this.is224 ? (W = 300032, $ = B[0] - 1413257819, N = $ - 150054599 << 0, P = $ + 24177077 << 0) : (W = 704751109, $ = B[0] - 210244248, N = $ - 1521486534 << 0, P = $ + 143694565 << 0), this.first = !1) : (Y = (y >>> 2 | y << 30) ^ (y >>> 13 | y << 19) ^ (y >>> 22 | y << 10), G = (x >>> 6 | x << 26) ^ (x >>> 11 | x << 21) ^ (x >>> 25 | x << 7), W = y & S, X = W ^ y & D ^ Z, j = x & _ ^ ~x & I, $ = N + G + j + l[O] + B[O], R = Y + X, N = P + $ << 0, P = $ + R << 0), Y = (P >>> 2 | P << 30) ^ (P >>> 13 | P << 19) ^ (P >>> 22 | P << 10), G = (N >>> 6 | N << 26) ^ (N >>> 11 | N << 21) ^ (N >>> 25 | N << 7), T = P & y, X = T ^ P & S ^ W, j = N & x ^ ~N & _, $ = I + G + j + l[O + 1] + B[O + 1], R = Y + X, I = D + $ << 0, D = $ + R << 0, Y = (D >>> 2 | D << 30) ^ (D >>> 13 | D << 19) ^ (D >>> 22 | D << 10), G = (I >>> 6 | I << 26) ^ (I >>> 11 | I << 21) ^ (I >>> 25 | I << 7), H = D & P, X = H ^ D & y ^ T, j = I & N ^ ~I & x, $ = _ + G + j + l[O + 2] + B[O + 2], R = Y + X, _ = S + $ << 0, S = $ + R << 0, Y = (S >>> 2 | S << 30) ^ (S >>> 13 | S << 19) ^ (S >>> 22 | S << 10), G = (_ >>> 6 | _ << 26) ^ (_ >>> 11 | _ << 21) ^ (_ >>> 25 | _ << 7), Z = S & D, X = Z ^ S & P ^ H, j = _ & I ^ ~_ & N, $ = x + G + j + l[O + 3] + B[O + 3], R = Y + X, x = y + $ << 0, y = $ + R << 0, this.chromeBugWorkAround = !0;
2926
2926
  this.h0 = this.h0 + y << 0, this.h1 = this.h1 + S << 0, this.h2 = this.h2 + D << 0, this.h3 = this.h3 + P << 0, this.h4 = this.h4 + x << 0, this.h5 = this.h5 + _ << 0, this.h6 = this.h6 + I << 0, this.h7 = this.h7 + N << 0;
2927
2927
  }, w.prototype.hex = function() {
2928
2928
  this.finalize();
@@ -4908,7 +4908,7 @@ function V9(e) {
4908
4908
  set: r
4909
4909
  };
4910
4910
  }
4911
- const J9 = 1e11, X9 = 1e14, K9 = 1e17, $c = (e) => !Number.isFinite(e) || e <= 0 ? 0 : e < J9 ? e * 1e3 : e > K9 ? Math.floor(e / 1e6) : e > X9 ? Math.floor(e / 1e3) : e, Xe = (e) => {
4911
+ const J9 = 1e11, X9 = 1e14, K9 = 1e17, $c = (e) => !Number.isFinite(e) || e <= 0 ? 0 : e < J9 ? e * 1e3 : e > K9 ? Math.floor(e / 1e6) : e > X9 ? Math.floor(e / 1e3) : e, qe = (e) => {
4912
4912
  if (e == null) return 0;
4913
4913
  if (e instanceof Date) {
4914
4914
  const t = e.getTime();
@@ -4948,7 +4948,7 @@ const J9 = 1e11, X9 = 1e14, K9 = 1e17, $c = (e) => !Number.isFinite(e) || e <= 0
4948
4948
  }, $9 = (e) => Array.isArray(e) ? e.filter((t) => typeof t == "string") : [], el = (e) => !(typeof e != "string" || !e || !e.includes("@")), jf = (e) => Object.prototype.hasOwnProperty.call(
4949
4949
  e || {},
4950
4950
  "messageTimestampMs"
4951
- ) ? Xe(e?.messageTimestampMs) : Xe(e?.date) || Xe(e?.timestamp) || Xe(e?.xmppId) || Xe(e?.id), eT = (e) => String(e?.xmppId || e?.id || ""), u0 = (e) => String(e?.xmppId || e?.id || ""), Wf = (e, t) => {
4951
+ ) ? qe(e?.messageTimestampMs) : qe(e?.date) || qe(e?.timestamp) || qe(e?.xmppId) || qe(e?.id), eT = (e) => String(e?.xmppId || e?.id || ""), u0 = (e) => String(e?.xmppId || e?.id || ""), Wf = (e, t) => {
4952
4952
  const n = jf(e), i = jf(t);
4953
4953
  if (n !== i)
4954
4954
  return n - i;
@@ -4976,7 +4976,7 @@ const J9 = 1e11, X9 = 1e14, K9 = 1e17, $c = (e) => !Number.isFinite(e) || e <= 0
4976
4976
  s && i.set(s, pA(r, n));
4977
4977
  }), [...i.values()].sort(Wf);
4978
4978
  }, ns = (e, t) => {
4979
- const n = (e || []).filter((a) => a?.id !== "delimiter-new"), i = Xe(t);
4979
+ const n = (e || []).filter((a) => a?.id !== "delimiter-new"), i = qe(t);
4980
4980
  if (i <= 0 || n.length === 0)
4981
4981
  return n;
4982
4982
  const r = n.findIndex((a) => !a || a.pending ? !1 : jf(a) > i);
@@ -5207,10 +5207,18 @@ const J9 = 1e11, X9 = 1e14, K9 = 1e17, $c = (e) => !Number.isFinite(e) || e <= 0
5207
5207
  setLastViewedTimestamp: (e, t) => {
5208
5208
  const { chatJID: n, timestamp: i } = t.payload;
5209
5209
  if (e.rooms[n]) {
5210
- const r = Xe(i);
5211
- e.rooms[n].lastViewedTimestamp = r, e.activeRoomJID === n && (e.rooms[n].unreadMessages = 0), e.rooms[n].messages = ns(
5210
+ const r = qe(
5211
+ e.rooms[n].lastViewedTimestamp
5212
+ ), s = qe(
5213
+ e.rooms[n].unreadBaselineTimestamp
5214
+ ), a = qe(i);
5215
+ e.rooms[n].lastViewedTimestamp = a;
5216
+ const o = e.activeRoomJID === n;
5217
+ o && (e.rooms[n].unreadMessages = 0);
5218
+ const A = o ? r > 0 ? r : s : a;
5219
+ e.rooms[n].messages = ns(
5212
5220
  e.rooms[n].messages,
5213
- e.activeRoomJID === n ? 0 : r
5221
+ A
5214
5222
  ), e.rooms[n].unreadCapped = !1;
5215
5223
  }
5216
5224
  },
@@ -5318,7 +5326,7 @@ const {
5318
5326
  setIsLoading: $e,
5319
5327
  setLastViewedTimestamp: Yf,
5320
5328
  setRoomNoMessages: iX,
5321
- setCurrentRoom: Ze,
5329
+ setCurrentRoom: Ke,
5322
5330
  setRoomRole: rT,
5323
5331
  setReactions: _v,
5324
5332
  setLogoutState: fh,
@@ -5355,7 +5363,7 @@ const {
5355
5363
  if (!e) return "";
5356
5364
  let t = String(e).trim();
5357
5365
  if (!t) return "";
5358
- const n = Z.getState().chatSettingStore?.appId || "";
5366
+ const n = K.getState().chatSettingStore?.appId || "";
5359
5367
  if (!n) return t;
5360
5368
  const i = `${n}_`;
5361
5369
  for (; t.startsWith(i + i); )
@@ -5364,12 +5372,12 @@ const {
5364
5372
  }, uT = (e, t) => {
5365
5373
  const n = gA(d0(e || "")), i = gA(d0(t || ""));
5366
5374
  return !n || !i ? !1 : n === i;
5367
- }, Fv = "roomMessages/", cT = /* @__PURE__ */ new Set(["roomMessages/insertUsers"]), lT = (e) => !!e && e.id !== "delimiter-new" && !e.pending && String(e?.isSystemMessage || "") !== "true", h0 = (e) => Xe(e?.date) || Xe(e?.timestamp) || Xe(e?.id), fT = (e, t, n, i) => {
5375
+ }, Fv = "roomMessages/", cT = /* @__PURE__ */ new Set(["roomMessages/insertUsers"]), lT = (e) => !!e && e.id !== "delimiter-new" && !e.pending && String(e?.isSystemMessage || "") !== "true", h0 = (e) => qe(e?.date) || qe(e?.timestamp) || qe(e?.id), fT = (e, t, n, i) => {
5368
5376
  if (!e)
5369
5377
  return { unread: 0, unreadCapped: !1 };
5370
5378
  if (n === t)
5371
5379
  return { unread: 0, unreadCapped: !1 };
5372
- const r = Xe(e.lastViewedTimestamp), s = Xe(e.unreadBaselineTimestamp), a = r > 0 ? r : s, o = (e.messages || []).filter((u) => {
5380
+ const r = qe(e.lastViewedTimestamp), s = qe(e.unreadBaselineTimestamp), a = r > 0 ? r : s, o = (e.messages || []).filter((u) => {
5373
5381
  if (!lT(u) || uT(
5374
5382
  u?.user?.id,
5375
5383
  i
@@ -7586,7 +7594,7 @@ const Ax = /* @__PURE__ */ ci(ox), is = (e) => new Error(`redux-persist-transfor
7586
7594
  }), vx = bx, ph = (e) => {
7587
7595
  const t = e.rooms;
7588
7596
  return t.activeRoomJID ? t.rooms[t.activeRoomJID] : null;
7589
- }, Z = b9({
7597
+ }, K = b9({
7590
7598
  reducer: vx,
7591
7599
  middleware: (e) => e({
7592
7600
  thunk: !0,
@@ -7618,7 +7626,7 @@ const Ax = /* @__PURE__ */ ci(ox), is = (e) => new Error(`redux-persist-transfor
7618
7626
  // .concat(testMiddleware)
7619
7627
  // .concat(debugMiddleware)
7620
7628
  // .concat(actionLoggerMiddleware),
7621
- }), dr = QT(Z);
7629
+ }), dr = QT(K);
7622
7630
  try {
7623
7631
  ee.always("[EthoraChatComponent] version:", lx);
7624
7632
  } catch {
@@ -7627,7 +7635,7 @@ const $a = () => {
7627
7635
  if (typeof window > "u")
7628
7636
  return !1;
7629
7637
  try {
7630
- return Z.getState().chatSettingStore?.config?.useStoreConsoleEnabled === !0;
7638
+ return K.getState().chatSettingStore?.config?.useStoreConsoleEnabled === !0;
7631
7639
  } catch {
7632
7640
  return !1;
7633
7641
  }
@@ -8245,7 +8253,7 @@ const gh = async (e) => (e?.body, e || ee.log("Invalid arguments: data, id, and
8245
8253
  {}
8246
8254
  ), c = t?.getChild("body")?.getText() || void 0, l = !!t?.getChild("deleted"), f = t?.getChild("translations")?.attrs?.value ? Px(
8247
8255
  Ox(u.translates)
8248
- ) : void 0, d = t?.getChild("translate")?.attrs?.source, h = t?.getChild("delay", "urn:xmpp:delay") || t?.getChild("x", "jabber:x:delay"), p = !!h, v = h?.attrs?.stamp, b = Xe(v) || Xe(o) || Xe(n) || Xe(A), k = new Date(
8256
+ ) : void 0, d = t?.getChild("translate")?.attrs?.source, h = t?.getChild("delay", "urn:xmpp:delay") || t?.getChild("x", "jabber:x:delay"), p = !!h, v = h?.attrs?.stamp, b = qe(v) || qe(o) || qe(n) || qe(A), k = new Date(
8249
8257
  b > 0 ? b : Date.now()
8250
8258
  ).toISOString(), w = t?.getChild("data") || e?.getChild("data"), C = w?.attrs?.photo, E = s || Mx(w?.attrs?.senderJID) || void 0, D = {
8251
8259
  id: gA(E) || E,
@@ -9797,9 +9805,9 @@ const wh = "1.16.0", K0 = 64 * 1024, { isFunction: eo } = q, Z0 = (e, ...t) => {
9797
9805
  credentials: T ? I : void 0
9798
9806
  };
9799
9807
  R = A && new s(k, H);
9800
- let K = await (A ? X(R, N) : X(k, H));
9808
+ let Z = await (A ? X(R, N) : X(k, H));
9801
9809
  if (Y) {
9802
- const ie = q.toFiniteNumber(K.headers.get("content-length"));
9810
+ const ie = q.toFiniteNumber(Z.headers.get("content-length"));
9803
9811
  if (ie != null && ie > B)
9804
9812
  throw new pe(
9805
9813
  "maxContentLength size of " + B + " exceeded",
@@ -9809,12 +9817,12 @@ const wh = "1.16.0", K0 = 64 * 1024, { isFunction: eo } = q, Z0 = (e, ...t) => {
9809
9817
  );
9810
9818
  }
9811
9819
  const te = d && (x === "stream" || x === "response");
9812
- if (d && K.body && (D || Y || te && j)) {
9820
+ if (d && Z.body && (D || Y || te && j)) {
9813
9821
  const ie = {};
9814
9822
  ["status", "statusText", "headers"].forEach((Pe) => {
9815
- ie[Pe] = K[Pe];
9823
+ ie[Pe] = Z[Pe];
9816
9824
  });
9817
- const ue = q.toFiniteNumber(K.headers.get("content-length")), [V, fe] = D && q0(
9825
+ const ue = q.toFiniteNumber(Z.headers.get("content-length")), [V, fe] = D && q0(
9818
9826
  ue,
9819
9827
  yA(V0(D), !0)
9820
9828
  ) || [];
@@ -9829,8 +9837,8 @@ const wh = "1.16.0", K0 = 64 * 1024, { isFunction: eo } = q, Z0 = (e, ...t) => {
9829
9837
  );
9830
9838
  V && V(Pe);
9831
9839
  };
9832
- K = new a(
9833
- X0(K.body, K0, De, () => {
9840
+ Z = new a(
9841
+ X0(Z.body, K0, De, () => {
9834
9842
  fe && fe(), j && j();
9835
9843
  }),
9836
9844
  ie
@@ -9838,7 +9846,7 @@ const wh = "1.16.0", K0 = 64 * 1024, { isFunction: eo } = q, Z0 = (e, ...t) => {
9838
9846
  }
9839
9847
  x = x || "text";
9840
9848
  let he = await h[q.findKey(h, x) || "text"](
9841
- K,
9849
+ Z,
9842
9850
  b
9843
9851
  );
9844
9852
  if (Y && !d && !te) {
@@ -9854,9 +9862,9 @@ const wh = "1.16.0", K0 = 64 * 1024, { isFunction: eo } = q, Z0 = (e, ...t) => {
9854
9862
  return !te && j && j(), await new Promise((ie, ue) => {
9855
9863
  py(ie, ue, {
9856
9864
  data: he,
9857
- headers: wt.from(K.headers),
9858
- status: K.status,
9859
- statusText: K.statusText,
9865
+ headers: wt.from(Z.headers),
9866
+ status: Z.status,
9867
+ statusText: Z.statusText,
9860
9868
  config: b,
9861
9869
  request: R
9862
9870
  });
@@ -10344,26 +10352,26 @@ function ky(e) {
10344
10352
  return ky(Li(e, r));
10345
10353
  }, n;
10346
10354
  }
10347
- const Ke = ky(wa);
10348
- Ke.Axios = Si;
10349
- Ke.CanceledError = ka;
10350
- Ke.CancelToken = wI;
10351
- Ke.isCancel = my;
10352
- Ke.VERSION = wh;
10353
- Ke.toFormData = fu;
10354
- Ke.AxiosError = pe;
10355
- Ke.Cancel = Ke.CanceledError;
10356
- Ke.all = function(t) {
10355
+ const Ze = ky(wa);
10356
+ Ze.Axios = Si;
10357
+ Ze.CanceledError = ka;
10358
+ Ze.CancelToken = wI;
10359
+ Ze.isCancel = my;
10360
+ Ze.VERSION = wh;
10361
+ Ze.toFormData = fu;
10362
+ Ze.AxiosError = pe;
10363
+ Ze.Cancel = Ze.CanceledError;
10364
+ Ze.all = function(t) {
10357
10365
  return Promise.all(t);
10358
10366
  };
10359
- Ke.spread = kI;
10360
- Ke.isAxiosError = EI;
10361
- Ke.mergeConfig = Li;
10362
- Ke.AxiosHeaders = wt;
10363
- Ke.formToJSON = (e) => hy(q.isHTMLForm(e) ? new FormData(e) : e);
10364
- Ke.getAdapter = yy.getAdapter;
10365
- Ke.HttpStatusCode = Xf;
10366
- Ke.default = Ke;
10367
+ Ze.spread = kI;
10368
+ Ze.isAxiosError = EI;
10369
+ Ze.mergeConfig = Li;
10370
+ Ze.AxiosHeaders = wt;
10371
+ Ze.formToJSON = (e) => hy(q.isHTMLForm(e) ? new FormData(e) : e);
10372
+ Ze.getAdapter = yy.getAdapter;
10373
+ Ze.HttpStatusCode = Xf;
10374
+ Ze.default = Ze;
10367
10375
  const {
10368
10376
  Axios: uX,
10369
10377
  AxiosError: cX,
@@ -10382,27 +10390,27 @@ const {
10382
10390
  getAdapter: EX,
10383
10391
  mergeConfig: CX,
10384
10392
  create: TX
10385
- } = Ke, CI = "JWT eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJkYXRhIjp7ImlzVXNlckRhdGFFbmNyeXB0ZWQiOmZhbHNlLCJwYXJlbnRBcHBJZCI6bnVsbCwiaXNBbGxvd2VkTmV3QXBwQ3JlYXRlIjp0cnVlLCJpc0Jhc2VBcHAiOnRydWUsIl9pZCI6IjY0NmNjOGRjOTZkNGE0ZGM4ZjdiMmYyZCIsImRpc3BsYXlOYW1lIjoiRXRob3JhIiwiZG9tYWluTmFtZSI6ImV0aG9yYSIsImNyZWF0b3JJZCI6IjY0NmNjOGQzOTZkNGE0ZGM4ZjdiMmYyNSIsInVzZXJzQ2FuRnJlZSI6dHJ1ZSwiZGVmYXVsdEFjY2Vzc0Fzc2V0c09wZW4iOnRydWUsImRlZmF1bHRBY2Nlc3NQcm9maWxlT3BlbiI6dHJ1ZSwiYnVuZGxlSWQiOiJjb20uZXRob3JhIiwicHJpbWFyeUNvbG9yIjoiIzAwM0U5QyIsInNlY29uZGFyeUNvbG9yIjoiIzI3NzVFQSIsImNvaW5TeW1ib2wiOiJFVE8iLCJjb2luTmFtZSI6IkV0aG9yYSBDb2luIiwiUkVBQ1RfQVBQX0ZJUkVCQVNFX0FQSV9LRVkiOiJBSXphU3lEUWRrdnZ4S0t4NC1XcmpMUW9ZZjA4R0ZBUmdpX3FPNGciLCJSRUFDVF9BUFBfRklSRUJBU0VfQVVUSF9ET01BSU4iOiJldGhvcmEtNjY4ZTkuZmlyZWJhc2VhcHAuY29tIiwiUkVBQ1RfQVBQX0ZJUkVCQVNFX1BST0pFQ1RfSUQiOiJldGhvcmEtNjY4ZTkiLCJSRUFDVF9BUFBfRklSRUJBU0VfU1RPUkFHRV9CVUNLRVQiOiJldGhvcmEtNjY4ZTkuYXBwc3BvdC5jb20iLCJSRUFDVF9BUFBfRklSRUJBU0VfTUVTU0FHSU5HX1NFTkRFUl9JRCI6Ijk3MjkzMzQ3MDA1NCIsIlJFQUNUX0FQUF9GSVJFQkFTRV9BUFBfSUQiOiIxOjk3MjkzMzQ3MDA1NDp3ZWI6ZDQ2ODJlNzZlZjAyZmQ5YjljZGFhNyIsIlJFQUNUX0FQUF9GSVJFQkFTRV9NRUFTVVJNRU5UX0lEIjoiRy1XSE03WFJaNEM4IiwiUkVBQ1RfQVBQX1NUUklQRV9QVUJMSVNIQUJMRV9LRVkiOiIiLCJSRUFDVF9BUFBfU1RSSVBFX1NFQ1JFVF9LRVkiOiIiLCJjcmVhdGVkQXQiOiIyMDIzLTA1LTIzVDE0OjA4OjI4LjEzNloiLCJ1cGRhdGVkQXQiOiIyMDIzLTA1LTIzVDE0OjA4OjI4LjEzNloiLCJfX3YiOjB9LCJpYXQiOjE2ODQ4NTA5MjV9.-IqNVMsf8GyS9Z-_yuNW7hpSmejajjAy-W0J8TadRIM";
10386
- let Ey = Z.getState().chatSettingStore?.config?.baseUrl || CC;
10387
- const Ve = Ke.create({
10393
+ } = Ze, CI = "JWT eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJkYXRhIjp7ImlzVXNlckRhdGFFbmNyeXB0ZWQiOmZhbHNlLCJwYXJlbnRBcHBJZCI6bnVsbCwiaXNBbGxvd2VkTmV3QXBwQ3JlYXRlIjp0cnVlLCJpc0Jhc2VBcHAiOnRydWUsIl9pZCI6IjY0NmNjOGRjOTZkNGE0ZGM4ZjdiMmYyZCIsImRpc3BsYXlOYW1lIjoiRXRob3JhIiwiZG9tYWluTmFtZSI6ImV0aG9yYSIsImNyZWF0b3JJZCI6IjY0NmNjOGQzOTZkNGE0ZGM4ZjdiMmYyNSIsInVzZXJzQ2FuRnJlZSI6dHJ1ZSwiZGVmYXVsdEFjY2Vzc0Fzc2V0c09wZW4iOnRydWUsImRlZmF1bHRBY2Nlc3NQcm9maWxlT3BlbiI6dHJ1ZSwiYnVuZGxlSWQiOiJjb20uZXRob3JhIiwicHJpbWFyeUNvbG9yIjoiIzAwM0U5QyIsInNlY29uZGFyeUNvbG9yIjoiIzI3NzVFQSIsImNvaW5TeW1ib2wiOiJFVE8iLCJjb2luTmFtZSI6IkV0aG9yYSBDb2luIiwiUkVBQ1RfQVBQX0ZJUkVCQVNFX0FQSV9LRVkiOiJBSXphU3lEUWRrdnZ4S0t4NC1XcmpMUW9ZZjA4R0ZBUmdpX3FPNGciLCJSRUFDVF9BUFBfRklSRUJBU0VfQVVUSF9ET01BSU4iOiJldGhvcmEtNjY4ZTkuZmlyZWJhc2VhcHAuY29tIiwiUkVBQ1RfQVBQX0ZJUkVCQVNFX1BST0pFQ1RfSUQiOiJldGhvcmEtNjY4ZTkiLCJSRUFDVF9BUFBfRklSRUJBU0VfU1RPUkFHRV9CVUNLRVQiOiJldGhvcmEtNjY4ZTkuYXBwc3BvdC5jb20iLCJSRUFDVF9BUFBfRklSRUJBU0VfTUVTU0FHSU5HX1NFTkRFUl9JRCI6Ijk3MjkzMzQ3MDA1NCIsIlJFQUNUX0FQUF9GSVJFQkFTRV9BUFBfSUQiOiIxOjk3MjkzMzQ3MDA1NDp3ZWI6ZDQ2ODJlNzZlZjAyZmQ5YjljZGFhNyIsIlJFQUNUX0FQUF9GSVJFQkFTRV9NRUFTVVJNRU5UX0lEIjoiRy1XSE03WFJaNEM4IiwiUkVBQ1RfQVBQX1NUUklQRV9QVUJMSVNIQUJMRV9LRVkiOiIiLCJSRUFDVF9BUFBfU1RSSVBFX1NFQ1JFVF9LRVkiOiIiLCJjcmVhdGVkQXQiOiIyMDIzLTA1LTIzVDE0OjA4OjI4LjEzNloiLCJ1cGRhdGVkQXQiOiIyMDIzLTA1LTIzVDE0OjA4OjI4LjEzNloiLCJfX3YiOjB9LCJpYXQiOjE2ODQ4NTA5MjV9.-IqNVMsf8GyS9Z-_yuNW7hpSmejajjAy-W0J8TadRIM";
10394
+ let Ey = K.getState().chatSettingStore?.config?.baseUrl || CC;
10395
+ const Je = Ze.create({
10388
10396
  baseURL: Ey
10389
10397
  });
10390
10398
  let Ea = CI;
10391
10399
  function Eh(e, t) {
10392
- e && (Ey = e, Ve.defaults.baseURL = e), t && (Ea = t);
10400
+ e && (Ey = e, Je.defaults.baseURL = e), t && (Ea = t);
10393
10401
  }
10394
10402
  function Kf() {
10395
- const e = Z.getState().chatSettingStore.user;
10396
- return e.refreshToken ? Ve.post(
10403
+ const e = K.getState().chatSettingStore.user;
10404
+ return e.refreshToken ? Je.post(
10397
10405
  "/users/login/refresh",
10398
10406
  {},
10399
10407
  { headers: { Authorization: e.refreshToken } }
10400
- ).then((t) => (Z.dispatch(
10408
+ ).then((t) => (K.dispatch(
10401
10409
  xv({
10402
10410
  token: t.data.token,
10403
10411
  refreshToken: t.data.refreshToken
10404
10412
  })
10405
- ), t)).catch((t) => (Z.dispatch(Ah()), Promise.reject(t))) : Promise.reject(new Error("Refresh token is missing"));
10413
+ ), t)).catch((t) => (K.dispatch(Ah()), Promise.reject(t))) : Promise.reject(new Error("Refresh token is missing"));
10406
10414
  }
10407
10415
  let ul = !1, Zf = [];
10408
10416
  const TI = (e) => new Promise((t, n) => {
@@ -10413,15 +10421,15 @@ const TI = (e) => new Promise((t, n) => {
10413
10421
  n.reject(e);
10414
10422
  continue;
10415
10423
  }
10416
- t && (n.config.headers.Authorization = t), n.resolve(Ve(n.config));
10424
+ t && (n.config.headers.Authorization = t), n.resolve(Je(n.config));
10417
10425
  }
10418
10426
  Zf = [];
10419
10427
  };
10420
- Ve.interceptors.response.use(
10428
+ Je.interceptors.response.use(
10421
10429
  (e) => e,
10422
10430
  async (e) => {
10423
- const t = e.config, n = Z.getState().chatSettingStore?.config?.refreshTokens;
10424
- if (!e.response || e.response.status !== 401 || !t || t._retry || t.url === "/users/login/refresh" || t.url === "/users/login" || t.url === "/users/login-with-email" || t.url === "/users/client" || t.url === "/users/my" || !n?.enabled || !!!(n.refreshFunction || Z.getState().chatSettingStore.user?.refreshToken))
10431
+ const t = e.config, n = K.getState().chatSettingStore?.config?.refreshTokens;
10432
+ if (!e.response || e.response.status !== 401 || !t || t._retry || t.url === "/users/login/refresh" || t.url === "/users/login" || t.url === "/users/login-with-email" || t.url === "/users/client" || t.url === "/users/my" || !n?.enabled || !!!(n.refreshFunction || K.getState().chatSettingStore.user?.refreshToken))
10425
10433
  return Promise.reject(e);
10426
10434
  if (t._retry = !0, ul)
10427
10435
  return TI(t);
@@ -10432,17 +10440,17 @@ Ve.interceptors.response.use(
10432
10440
  const s = await n.refreshFunction();
10433
10441
  if (!s?.accessToken)
10434
10442
  throw new Error("Custom refresh function did not return an access token");
10435
- Z.dispatch(
10443
+ K.dispatch(
10436
10444
  xv({
10437
10445
  token: s.accessToken,
10438
- refreshToken: s.refreshToken || Z.getState().chatSettingStore.user.refreshToken
10446
+ refreshToken: s.refreshToken || K.getState().chatSettingStore.user.refreshToken
10439
10447
  })
10440
10448
  ), r = s.accessToken;
10441
10449
  } else
10442
10450
  r = (await Kf()).data.token;
10443
- return t.headers = t.headers || {}, t.headers.Authorization = r, np(null, r), Ve(t);
10451
+ return t.headers = t.headers || {}, t.headers.Authorization = r, np(null, r), Je(t);
10444
10452
  } catch (r) {
10445
- return np(r), Z.dispatch(Ah()), Promise.reject(r);
10453
+ return np(r), K.dispatch(Ah()), Promise.reject(r);
10446
10454
  } finally {
10447
10455
  ul = !1;
10448
10456
  }
@@ -10451,13 +10459,13 @@ Ve.interceptors.response.use(
10451
10459
  const xI = 6e4;
10452
10460
  let ss = null, cl = "", ll = null, ip = 0, rp = "";
10453
10461
  async function hu() {
10454
- const e = Z.getState().chatSettingStore.user.token || "", t = Date.now();
10462
+ const e = K.getState().chatSettingStore.user.token || "", t = Date.now();
10455
10463
  if (ll && rp === e && t - ip < xI)
10456
10464
  return ll;
10457
10465
  if (ss && cl === e)
10458
10466
  return ss;
10459
10467
  cl = e, ss = (async () => {
10460
- const n = await Ve.get("/chats/my", {
10468
+ const n = await Je.get("/chats/my", {
10461
10469
  headers: {
10462
10470
  Authorization: e
10463
10471
  }
@@ -10473,9 +10481,9 @@ async function hu() {
10473
10481
  }
10474
10482
  }
10475
10483
  async function II(e) {
10476
- const t = Z.getState().chatSettingStore.user.token || "";
10484
+ const t = K.getState().chatSettingStore.user.token || "";
10477
10485
  try {
10478
- return (await Ve.post("/chats", e, {
10486
+ return (await Je.post("/chats", e, {
10479
10487
  headers: {
10480
10488
  Authorization: t
10481
10489
  }
@@ -10485,9 +10493,9 @@ async function II(e) {
10485
10493
  }
10486
10494
  }
10487
10495
  async function SI(e, t = "Private chat") {
10488
- const n = Z.getState().chatSettingStore.user.token || "";
10496
+ const n = K.getState().chatSettingStore.user.token || "";
10489
10497
  try {
10490
- return (await Ve.post(
10498
+ return (await Je.post(
10491
10499
  "/chats/private",
10492
10500
  { username: e },
10493
10501
  {
@@ -10501,9 +10509,9 @@ async function SI(e, t = "Private chat") {
10501
10509
  }
10502
10510
  }
10503
10511
  async function NI(e) {
10504
- const { chatName: t, category: n, text: i } = e, r = Z.getState().chatSettingStore.user.token || "";
10512
+ const { chatName: t, category: n, text: i } = e, r = K.getState().chatSettingStore.user.token || "";
10505
10513
  try {
10506
- return (await Ve.post(
10514
+ return (await Je.post(
10507
10515
  `/chats/reports/${t}`,
10508
10516
  { category: n, text: i },
10509
10517
  {
@@ -10517,9 +10525,9 @@ async function NI(e) {
10517
10525
  }
10518
10526
  }
10519
10527
  async function DI(e) {
10520
- const { chatName: t, members: n } = e, i = Z.getState().chatSettingStore.user.token || "";
10528
+ const { chatName: t, members: n } = e, i = K.getState().chatSettingStore.user.token || "";
10521
10529
  try {
10522
- return (await Ve.post(
10530
+ return (await Je.post(
10523
10531
  "/chats/users-access",
10524
10532
  { chatName: t, members: n },
10525
10533
  {
@@ -10533,9 +10541,9 @@ async function DI(e) {
10533
10541
  }
10534
10542
  }
10535
10543
  async function RI(e) {
10536
- const { roomId: t, members: n } = e, i = Z.getState().chatSettingStore.user.token || "";
10544
+ const { roomId: t, members: n } = e, i = K.getState().chatSettingStore.user.token || "";
10537
10545
  try {
10538
- return (await Ve.delete("/chats/users-access", {
10546
+ return (await Je.delete("/chats/users-access", {
10539
10547
  headers: {
10540
10548
  Authorization: i
10541
10549
  },
@@ -10549,9 +10557,9 @@ async function RI(e) {
10549
10557
  }
10550
10558
  }
10551
10559
  async function BI(e) {
10552
- const t = Z.getState().chatSettingStore.user.token || "";
10560
+ const t = K.getState().chatSettingStore.user.token || "";
10553
10561
  try {
10554
- return (await Ve.delete("/chats", {
10562
+ return (await Je.delete("/chats", {
10555
10563
  headers: {
10556
10564
  Authorization: t
10557
10565
  },
@@ -10585,7 +10593,7 @@ const Ca = (e, t = lr, n = 0) => {
10585
10593
  }
10586
10594
  }, as = /* @__PURE__ */ new Map(), fl = /* @__PURE__ */ new Map(), _I = (e) => {
10587
10595
  if (!e) return !1;
10588
- const t = Z.getState().chatSettingStore?.appId || "";
10596
+ const t = K.getState().chatSettingStore?.appId || "";
10589
10597
  return t ? !(e === t || e === `${t}_${t}`) : !0;
10590
10598
  };
10591
10599
  async function Cy(e, t) {
@@ -10601,7 +10609,7 @@ async function Cy(e, t) {
10601
10609
  if (r) return r;
10602
10610
  const s = (async () => {
10603
10611
  try {
10604
- const o = (await Ve.get(
10612
+ const o = (await Je.get(
10605
10613
  `/apps/users/${i}`,
10606
10614
  {
10607
10615
  headers: { Authorization: t }
@@ -10625,7 +10633,7 @@ function PI(e) {
10625
10633
  const MI = (e) => [...PI(e)].filter((n) => (typeof n?.name == "string" ? n.name.toLowerCase() : "").includes("deleted")), OI = async (e) => await Promise.all(
10626
10634
  e.map(async (n) => await Cy(
10627
10635
  n.id,
10628
- Z.getState().chatSettingStore.user.token
10636
+ K.getState().chatSettingStore.user.token
10629
10637
  ))
10630
10638
  ), sp = (e) => {
10631
10639
  const t = MI(e);
@@ -10633,7 +10641,7 @@ const MI = (e) => [...PI(e)].filter((n) => (typeof n?.name == "string" ? n.name.
10633
10641
  return (async () => await OI(t))();
10634
10642
  }, Ty = async (e, t) => t ? e[t] ? void 0 : await Cy(
10635
10643
  t,
10636
- Z.getState().chatSettingStore.user.token
10644
+ K.getState().chatSettingStore.user.token
10637
10645
  ) : null;
10638
10646
  class LI {
10639
10647
  callbacks = /* @__PURE__ */ new Set();
@@ -10766,18 +10774,18 @@ const wA = new LI(), Lo = (e) => e ? String(e).split("@")[0] : "", xy = (e) => {
10766
10774
  if (!A?.body || !String(A.body).trim())
10767
10775
  return;
10768
10776
  const u = await Ty(
10769
- Z.getState().rooms.usersSet,
10777
+ K.getState().rooms.usersSet,
10770
10778
  A.user.id
10771
10779
  );
10772
- u && Z.dispatch(kr({ newUsers: [u] })), Z.dispatch(
10780
+ u && K.dispatch(kr({ newUsers: [u] })), K.dispatch(
10773
10781
  fr({
10774
10782
  roomJID: e.attrs.from.split("/")[0],
10775
10783
  message: A
10776
10784
  })
10777
10785
  );
10778
- const c = A?.xmppId || A?.id, l = e.attrs.from.split("/")[0], f = Z.getState().roomHeapSlice.messageHeap, d = Array.isArray(f) ? f : [], h = !!(c && d?.some((N) => (N.xmppId || N.id) === c));
10779
- c && (Z.dispatch(Ov(c)), t?.acknowledgeSentMessage(l, c));
10780
- const p = Z.getState(), v = p.rooms.rooms[l], b = p.rooms.activeRoomJID, k = FI(b, l), w = p.chatSettingStore.user?.xmppUsername, C = e.attrs.from?.split("/")[1] || "", E = !!w && C === w, y = QI(
10786
+ const c = A?.xmppId || A?.id, l = e.attrs.from.split("/")[0], f = K.getState().roomHeapSlice.messageHeap, d = Array.isArray(f) ? f : [], h = !!(c && d?.some((N) => (N.xmppId || N.id) === c));
10787
+ c && (K.dispatch(Ov(c)), t?.acknowledgeSentMessage(l, c));
10788
+ const p = K.getState(), v = p.rooms.rooms[l], b = p.rooms.activeRoomJID, k = FI(b, l), w = p.chatSettingStore.user?.xmppUsername, C = e.attrs.from?.split("/")[1] || "", E = !!w && C === w, y = QI(
10781
10789
  A.user?.id,
10782
10790
  w
10783
10791
  ), S = E, D = A.isSystemMessage === "true", P = A.isHistory, x = window._ethoraAppLoadTime || Date.now(), _ = Date.now() - x < 2e3, I = UI({
@@ -10810,7 +10818,7 @@ const wA = new LI(), Lo = (e) => e ? String(e).split("@")[0] : "", xy = (e) => {
10810
10818
  }, YI = async (e) => {
10811
10819
  if (e?.attrs?.id?.includes("message-reaction")) {
10812
10820
  const t = e.getChild("reactions"), n = e.getChild("stanza-id"), i = n.attrs.by, r = n.attrs.id, s = e.getChild("data"), a = t.getChildren("reaction").map((A) => A.text()), o = t.attrs.from;
10813
- Z.dispatch(
10821
+ K.dispatch(
10814
10822
  _v({
10815
10823
  roomJID: i,
10816
10824
  messageId: t.attrs.id,
@@ -10826,19 +10834,19 @@ const wA = new LI(), Lo = (e) => e ? String(e).split("@")[0] : "", xy = (e) => {
10826
10834
  const t = e.getChild("delete"), n = e.getChild("stanza-id");
10827
10835
  if (!t)
10828
10836
  return;
10829
- Z.dispatch(
10837
+ K.dispatch(
10830
10838
  lh({
10831
10839
  roomJID: n.attrs.by,
10832
10840
  messageId: t.attrs.id
10833
10841
  })
10834
- ), Z.dispatch(mA({ isDeleteModal: !1 }));
10842
+ ), K.dispatch(mA({ isDeleteModal: !1 }));
10835
10843
  }
10836
10844
  }, zI = async (e) => {
10837
10845
  if (e?.attrs?.id?.includes("edit-message")) {
10838
10846
  const t = e.getChild("stanza-id"), n = e.getChild("replace");
10839
10847
  if (!t && !n)
10840
10848
  return;
10841
- Z.dispatch(
10849
+ K.dispatch(
10842
10850
  nT({
10843
10851
  roomJID: t.attrs.by,
10844
10852
  messageId: n.attrs.id,
@@ -10857,7 +10865,7 @@ const wA = new LI(), Lo = (e) => e ? String(e).split("@")[0] : "", xy = (e) => {
10857
10865
  senderFirstName: n.attrs.senderFirstName,
10858
10866
  senderLastName: n.attrs.senderLastName
10859
10867
  }, A = i.attrs.by, u = i.attrs.id;
10860
- Z.dispatch(
10868
+ K.dispatch(
10861
10869
  _v({
10862
10870
  roomJID: A,
10863
10871
  messageId: r,
@@ -10883,10 +10891,10 @@ const wA = new LI(), Lo = (e) => e ? String(e).split("@")[0] : "", xy = (e) => {
10883
10891
  body: i,
10884
10892
  ...r
10885
10893
  }), a = await Ty(
10886
- Z.getState().rooms.usersSet,
10894
+ K.getState().rooms.usersSet,
10887
10895
  s.user.id
10888
10896
  );
10889
- a && Z.dispatch(kr({ newUsers: [a] })), Z.dispatch(
10897
+ a && K.dispatch(kr({ newUsers: [a] })), K.dispatch(
10890
10898
  fr({
10891
10899
  roomJID: e.attrs.from,
10892
10900
  message: s
@@ -10899,7 +10907,7 @@ const wA = new LI(), Lo = (e) => e ? String(e).split("@")[0] : "", xy = (e) => {
10899
10907
  if (n && t?.toLowerCase()?.replace(/_/g, "") !== n?.replace(/_/g, "")) {
10900
10908
  const i = e.attrs?.from.split("/")[0];
10901
10909
  let r = [];
10902
- e?.getChild("composing") ? r.push(e.getChild("data").attrs?.fullName || "User") : r.pop(), Z.dispatch(
10910
+ e?.getChild("composing") ? r.push(e.getChild("data").attrs?.fullName || "User") : r.pop(), K.dispatch(
10903
10911
  iT({
10904
10912
  chatJID: i,
10905
10913
  composing: !!e?.getChild("composing"),
@@ -10912,7 +10920,7 @@ const wA = new LI(), Lo = (e) => e ? String(e).split("@")[0] : "", xy = (e) => {
10912
10920
  const t = e?.attrs?.id;
10913
10921
  if (typeof t == "string" && t.startsWith("presenceInRoom") && !e.getChild("error")) {
10914
10922
  const n = e.attrs.from.split("/")[0], i = e?.children[1]?.children[0]?.attrs.role;
10915
- Z.dispatch(rT({ chatJID: n, role: i }));
10923
+ K.dispatch(rT({ chatJID: n, role: i }));
10916
10924
  }
10917
10925
  }, XI = async (e, t) => {
10918
10926
  if (e.is("message")) {
@@ -10922,7 +10930,7 @@ const wA = new LI(), Lo = (e) => e ? String(e).split("@")[0] : "", xy = (e) => {
10922
10930
  try {
10923
10931
  for (const r of i)
10924
10932
  if (r.getChild("invite")) {
10925
- if (!Z.getState().rooms.rooms[n]) {
10933
+ if (!K.getState().rooms.rooms[n]) {
10926
10934
  const A = {
10927
10935
  jid: n,
10928
10936
  name: "",
@@ -10937,7 +10945,7 @@ const wA = new LI(), Lo = (e) => e ? String(e).split("@")[0] : "", xy = (e) => {
10937
10945
  lastViewedTimestamp: 0,
10938
10946
  historyPreloadState: "idle"
10939
10947
  };
10940
- Z.dispatch(Rv({ roomData: A })), Z.getState().rooms.activeRoomJID || Z.dispatch(Ze({ roomJID: n }));
10948
+ K.dispatch(Rv({ roomData: A })), K.getState().rooms.activeRoomJID || K.dispatch(Ke({ roomJID: n }));
10941
10949
  }
10942
10950
  await t.presenceInRoomStanza(n, 0, 1500, !0).catch(() => !1) || t.prioritizeRoomPresence(n).catch(() => {
10943
10951
  }), t.getHistoryStanza(n, 20, void 0, void 0, {
@@ -10946,13 +10954,13 @@ const wA = new LI(), Lo = (e) => e ? String(e).split("@")[0] : "", xy = (e) => {
10946
10954
  }), t.getRoomInfoStanza(n), hu().then((A) => {
10947
10955
  const u = A?.items || [];
10948
10956
  u.forEach((c) => {
10949
- Z.dispatch(
10957
+ K.dispatch(
10950
10958
  ga({
10951
10959
  room: Ca(c, t.conference),
10952
10960
  xmpp: t
10953
10961
  })
10954
10962
  );
10955
- }), Z.dispatch(dh({ rooms: u }));
10963
+ }), K.dispatch(dh({ rooms: u }));
10956
10964
  }).catch(() => {
10957
10965
  });
10958
10966
  }
@@ -10981,13 +10989,13 @@ const wA = new LI(), Lo = (e) => e ? String(e).split("@")[0] : "", xy = (e) => {
10981
10989
  c === "muc#roominfo_description" && l && (i.description = l);
10982
10990
  }
10983
10991
  }
10984
- Object.keys(i).length > 0 && Z.dispatch(lt({ jid: t, updates: i }));
10992
+ Object.keys(i).length > 0 && K.dispatch(lt({ jid: t, updates: i }));
10985
10993
  }, ZI = (e) => {
10986
10994
  if (e.attrs?.id && e.attrs?.id.toString().includes("get-history")) {
10987
10995
  const t = String(e?.attrs?.from || "").split("/")[0], n = e?.getChild("fin");
10988
10996
  if (!t || !n) return;
10989
10997
  const i = ty(n?.attrs?.complete), r = n.getChild("set"), s = r?.getChildText("first"), a = r?.getChildText("last"), o = Er(a), A = Er(s);
10990
- Z.dispatch(
10998
+ K.dispatch(
10991
10999
  lt({
10992
11000
  jid: t,
10993
11001
  updates: {
@@ -11003,10 +11011,10 @@ const wA = new LI(), Lo = (e) => e ? String(e).split("@")[0] : "", xy = (e) => {
11003
11011
  );
11004
11012
  }
11005
11013
  }, $I = (e, t) => {
11006
- Z.dispatch(Ze({ roomJID: e.attrs.from })), t.getRoomsStanza();
11014
+ K.dispatch(Ke({ roomJID: e.attrs.from })), t.getRoomsStanza();
11007
11015
  }, e8 = (e, t) => {
11008
11016
  e.attrs.id === "getUserRooms" && Array.isArray(e.getChild("query")?.children) && e.getChild("query")?.children.forEach(async (n) => {
11009
- const i = Z.getState().rooms.rooms;
11017
+ const i = K.getState().rooms.rooms;
11010
11018
  if (!Object.values(i).some((s) => s.jid === n?.attrs?.jid))
11011
11019
  try {
11012
11020
  const s = {
@@ -11023,21 +11031,21 @@ const wA = new LI(), Lo = (e) => e ? String(e).split("@")[0] : "", xy = (e) => {
11023
11031
  lastViewedTimestamp: 0,
11024
11032
  historyPreloadState: "idle"
11025
11033
  };
11026
- Z.dispatch(Rv({ roomData: { ...s } })), Z.getState().rooms.activeRoomJID || Z.dispatch(Ze({ roomJID: s.jid })), s.jid && t.presenceInRoomStanza(s.jid);
11034
+ K.dispatch(Rv({ roomData: { ...s } })), K.getState().rooms.activeRoomJID || K.dispatch(Ke({ roomJID: s.jid })), s.jid && t.presenceInRoomStanza(s.jid);
11027
11035
  } catch {
11028
11036
  }
11029
11037
  });
11030
11038
  }, t8 = (e) => {
11031
11039
  if (!e.is("message")) return;
11032
11040
  const t = String(e.attrs.from || "").split("/")[0];
11033
- if (!t || !Z.getState().rooms.rooms[t]) return;
11041
+ if (!t || !K.getState().rooms.rooms[t]) return;
11034
11042
  const n = (e.getChildren("x") || []).find(
11035
11043
  (l) => l.attrs?.xmlns === "http://jabber.org/protocol/muc#user"
11036
11044
  );
11037
11045
  if (!n || n.getChild("invite")) return;
11038
11046
  const i = n.getChild("item"), r = String(i?.attrs?.jid || "");
11039
11047
  if (!r) return;
11040
- const s = r.split("@")[0], a = String(i?.attrs?.affiliation || ""), o = Z.getState().rooms.rooms[t], A = Array.isArray(o.members) ? o.members : [], u = A.findIndex((l) => l.xmppUsername === s);
11048
+ const s = r.split("@")[0], a = String(i?.attrs?.affiliation || ""), o = K.getState().rooms.rooms[t], A = Array.isArray(o.members) ? o.members : [], u = A.findIndex((l) => l.xmppUsername === s);
11041
11049
  let c;
11042
11050
  if (a === "none" || a === "outcast") {
11043
11051
  if (u < 0) return;
@@ -11049,7 +11057,7 @@ const wA = new LI(), Lo = (e) => e ? String(e).split("@")[0] : "", xy = (e) => {
11049
11057
  { _id: "", firstName: "", lastName: "", xmppUsername: s, jid: r }
11050
11058
  ];
11051
11059
  }
11052
- Z.dispatch(
11060
+ K.dispatch(
11053
11061
  lt({
11054
11062
  jid: t,
11055
11063
  updates: { members: c, usersCnt: c.length }
@@ -11064,7 +11072,7 @@ const wA = new LI(), Lo = (e) => e ? String(e).split("@")[0] : "", xy = (e) => {
11064
11072
  const i = n.map((r) => r.attrs.code);
11065
11073
  if (i.includes("110") && i.includes("321")) {
11066
11074
  const r = e.attrs.from.split("/")[0];
11067
- Z.dispatch(au({ jid: r })), await hu();
11075
+ K.dispatch(au({ jid: r })), await hu();
11068
11076
  }
11069
11077
  }
11070
11078
  }, i8 = async (e, t) => {
@@ -11129,9 +11137,9 @@ const wA = new LI(), Lo = (e) => e ? String(e).split("@")[0] : "", xy = (e) => {
11129
11137
  }
11130
11138
  const s = {};
11131
11139
  n.firstName !== void 0 && (s.firstName = n.firstName), n.lastName !== void 0 && (s.lastName = n.lastName), n.photoURL !== void 0 && (s.profileImage = n.photoURL), n.description !== void 0 && (s.description = n.description);
11132
- const a = Z.getState(), o = a.rooms.usersSet, A = Object.entries(o).filter(([l]) => l === r || l.split("@")[0] === r).map(([, l]) => ({ ...l, ...s }));
11140
+ const a = K.getState(), o = a.rooms.usersSet, A = Object.entries(o).filter(([l]) => l === r || l.split("@")[0] === r).map(([, l]) => ({ ...l, ...s }));
11133
11141
  if (A.length > 0)
11134
- Z.dispatch(kr({ newUsers: A }));
11142
+ K.dispatch(kr({ newUsers: A }));
11135
11143
  else {
11136
11144
  const l = {
11137
11145
  firstName: n.firstName || "",
@@ -11140,7 +11148,7 @@ const wA = new LI(), Lo = (e) => e ? String(e).split("@")[0] : "", xy = (e) => {
11140
11148
  _id: r,
11141
11149
  ...s
11142
11150
  };
11143
- Z.dispatch(kr({ newUsers: [l] }));
11151
+ K.dispatch(kr({ newUsers: [l] }));
11144
11152
  }
11145
11153
  Object.values(a.rooms.rooms).forEach((l) => {
11146
11154
  if (!l.members?.length) return;
@@ -11151,14 +11159,14 @@ const wA = new LI(), Lo = (e) => e ? String(e).split("@")[0] : "", xy = (e) => {
11151
11159
  });
11152
11160
  d.some(
11153
11161
  (p, v) => p !== f[v]
11154
- ) && Z.dispatch(lt({ jid: l.jid, updates: { members: d } }));
11162
+ ) && K.dispatch(lt({ jid: l.jid, updates: { members: d } }));
11155
11163
  }), ee.log(
11156
11164
  `[UserUpdate] xmppUsername=${r} firstName=${n.firstName ?? "-"} lastName=${n.lastName ?? "-"} matched=${A.length}`
11157
11165
  );
11158
11166
  const c = a.chatSettingStore.user?.xmppUsername?.split("@")[0] ?? "";
11159
11167
  if (c && c === r) {
11160
11168
  const l = {};
11161
- n.firstName !== void 0 && (l.firstName = n.firstName), n.lastName !== void 0 && (l.lastName = n.lastName), n.photoURL !== void 0 && (l.profileImage = n.photoURL), n.description !== void 0 && (l.description = n.description), Object.keys(l).length > 0 && Z.dispatch(Iv({ updates: l }));
11169
+ n.firstName !== void 0 && (l.firstName = n.firstName), n.lastName !== void 0 && (l.lastName = n.lastName), n.photoURL !== void 0 && (l.profileImage = n.photoURL), n.description !== void 0 && (l.description = n.description), Object.keys(l).length > 0 && K.dispatch(Iv({ updates: l }));
11162
11170
  }
11163
11171
  } catch (n) {
11164
11172
  console.error("[UserUpdate] Error processing stanza:", n);
@@ -11169,7 +11177,7 @@ const wA = new LI(), Lo = (e) => e ? String(e).split("@")[0] : "", xy = (e) => {
11169
11177
  const t = e.getChild("chat-update");
11170
11178
  if (!(!t || t.attrs?.xmlns !== "your:custom:ns"))
11171
11179
  try {
11172
- const n = t.attrs, i = Z.getState(), r = [
11180
+ const n = t.attrs, i = K.getState(), r = [
11173
11181
  n.chatName,
11174
11182
  e.attrs?.to,
11175
11183
  e.attrs?.from
@@ -11186,7 +11194,7 @@ const wA = new LI(), Lo = (e) => e ? String(e).split("@")[0] : "", xy = (e) => {
11186
11194
  return;
11187
11195
  }
11188
11196
  const a = {};
11189
- n.title !== void 0 && (a.title = n.title, a.name = n.title), n.description !== void 0 && (a.description = n.description), n.picture !== void 0 && (a.icon = n.picture, a.picture = n.picture), n.usersCnt !== void 0 && (a.usersCnt = Er(n.usersCnt)), Object.keys(a).length > 0 && (Z.dispatch(lt({ jid: s.jid, updates: a })), ee.log(
11197
+ n.title !== void 0 && (a.title = n.title, a.name = n.title), n.description !== void 0 && (a.description = n.description), n.picture !== void 0 && (a.icon = n.picture, a.picture = n.picture), n.usersCnt !== void 0 && (a.usersCnt = Er(n.usersCnt)), Object.keys(a).length > 0 && (K.dispatch(lt({ jid: s.jid, updates: a })), ee.log(
11190
11198
  `[ChatUpdate] room=${s.jid} title=${n.title ?? "-"} description=${n.description ?? "-"}`
11191
11199
  ));
11192
11200
  } catch (n) {
@@ -11327,7 +11335,7 @@ const l8 = (e, t, n, i) => {
11327
11335
  return n.includes(".") && n.startsWith("conference.");
11328
11336
  };
11329
11337
  async function h8(e) {
11330
- const t = Z.getState().rooms.rooms, i = (t && typeof t == "object" ? Object.keys(t) : []).filter(d8);
11338
+ const t = K.getState().rooms.rooms, i = (t && typeof t == "object" ? Object.keys(t) : []).filter(d8);
11331
11339
  if (!i.length)
11332
11340
  return { total: 0, success: 0, failed: 0, failedRooms: [], failures: [] };
11333
11341
  const r = new Array(i.length), s = 3, a = i.map((l, f) => ({ roomJid: l, index: f })), o = async () => {
@@ -11378,7 +11386,7 @@ function ml(e, t) {
11378
11386
  const Ar = (e) => e ? Object.prototype.hasOwnProperty.call(
11379
11387
  e || {},
11380
11388
  "messageTimestampMs"
11381
- ) ? Xe(e?.messageTimestampMs) : Xe(e?.date) || Xe(e?.timestamp) || Xe(e?.id) : 0, m8 = (e) => {
11389
+ ) ? qe(e?.messageTimestampMs) : qe(e?.date) || qe(e?.timestamp) || qe(e?.id) : 0, m8 = (e) => {
11382
11390
  if (!e?.messages?.length) return 0;
11383
11391
  for (let t = e.messages.length - 1; t >= 0; t -= 1) {
11384
11392
  const n = e.messages[t];
@@ -11699,7 +11707,7 @@ class p8 {
11699
11707
  `[XMPP] allRoomPresences fallback reason=${Gt(i)}`
11700
11708
  );
11701
11709
  }
11702
- if (n.total > 0 && Object.keys(Z.getState().rooms.rooms || {}).forEach((r) => {
11710
+ if (n.total > 0 && Object.keys(K.getState().rooms.rooms || {}).forEach((r) => {
11703
11711
  n.failedRooms.includes(r) || this.joinedRooms.add(r);
11704
11712
  }), ee.log(`[InitTiming] xmpp:allRoomPresences ${Date.now() - t}ms`), ee.log(
11705
11713
  `[XMPP] allRoomPresences summary total=${n.total} success=${n.success} failed=${n.failed}`
@@ -11796,7 +11804,7 @@ class p8 {
11796
11804
  (a) => a.chatJID === i
11797
11805
  );
11798
11806
  if (s.length > 0) {
11799
- const a = Z.getState().rooms.rooms?.[i]?.messages || [];
11807
+ const a = K.getState().rooms.rooms?.[i]?.messages || [];
11800
11808
  s.forEach((o) => o.resolve(a)), this.historyQueue = this.historyQueue.filter(
11801
11809
  (o) => o.chatJID !== i
11802
11810
  );
@@ -11912,9 +11920,9 @@ class p8 {
11912
11920
  if (o.priority !== A.priority) return o.priority - A.priority;
11913
11921
  if (o.priority === 2 && A.priority === 2) {
11914
11922
  const u = Ni(
11915
- Z.getState().rooms.rooms?.[o.chatJID]
11923
+ K.getState().rooms.rooms?.[o.chatJID]
11916
11924
  ), c = Ni(
11917
- Z.getState().rooms.rooms?.[A.chatJID]
11925
+ K.getState().rooms.rooms?.[A.chatJID]
11918
11926
  );
11919
11927
  if (u !== c) return c - u;
11920
11928
  }
@@ -11977,11 +11985,11 @@ class p8 {
11977
11985
  t.priority === 0 ? 2800 : 1e4
11978
11986
  ), i = this.getRoomEpoch(t.chatJID);
11979
11987
  if (t.source === "background" && t.epoch !== i) {
11980
- const r = Z.getState().rooms.rooms?.[t.chatJID]?.messages || [];
11988
+ const r = K.getState().rooms.rooms?.[t.chatJID]?.messages || [];
11981
11989
  t.resolve(r);
11982
11990
  return;
11983
11991
  }
11984
- n && n.length > 0 && Z.dispatch(
11992
+ n && n.length > 0 && K.dispatch(
11985
11993
  Bv({
11986
11994
  roomJID: t.chatJID,
11987
11995
  messages: n
@@ -12026,7 +12034,7 @@ class p8 {
12026
12034
  const r = String(t?.attrs?.from || i.chatJID || "").split("/")[0], s = t.getChild("fin");
12027
12035
  if (r && s) {
12028
12036
  const a = ty(s?.attrs?.complete), o = s.getChild("set"), A = o?.getChildText("first"), u = o?.getChildText("last"), c = Er(A), l = Er(u);
12029
- Z.dispatch(
12037
+ K.dispatch(
12030
12038
  lt({
12031
12039
  jid: r,
12032
12040
  updates: {
@@ -12135,7 +12143,7 @@ class p8 {
12135
12143
  (A) => A.source === "background" && A.chatJID === t.chatJID
12136
12144
  );
12137
12145
  if (o.length) {
12138
- const A = Z.getState().rooms.rooms?.[t.chatJID]?.messages || [];
12146
+ const A = K.getState().rooms.rooms?.[t.chatJID]?.messages || [];
12139
12147
  o.forEach((u) => u.resolve(A)), this.historyQueue = this.historyQueue.filter(
12140
12148
  (u) => !(u.source === "background" && u.chatJID === t.chatJID)
12141
12149
  );
@@ -12155,7 +12163,7 @@ class p8 {
12155
12163
  const o = this.historyQueue.filter((A) => A.source === "background").map((A) => ({
12156
12164
  jid: A.chatJID,
12157
12165
  activityScore: Ni(
12158
- Z.getState().rooms.rooms?.[A.chatJID]
12166
+ K.getState().rooms.rooms?.[A.chatJID]
12159
12167
  )
12160
12168
  })).sort((A, u) => u.activityScore - A.activityScore);
12161
12169
  ee.log("[XMPP] history_queue_order", o);
@@ -12331,7 +12339,7 @@ class p8 {
12331
12339
  getHistoryStanza = async (t, n, i, r, s) => {
12332
12340
  const a = s?.source || "default", o = a === "active" || a === "send_ack" || s?.coalesceRoom, A = this.getHistoryInFlightKey(t, i), u = this.historyPreloadInFlight.get(A);
12333
12341
  if (s?.skipIfPreloaded) {
12334
- const l = Z.getState().rooms.rooms?.[t];
12342
+ const l = K.getState().rooms.rooms?.[t];
12335
12343
  if (l?.historyPreloadState === "done" && l?.messages?.length)
12336
12344
  return l.messages;
12337
12345
  }
@@ -12579,7 +12587,7 @@ class p8 {
12579
12587
  }
12580
12588
  async drainHeap() {
12581
12589
  try {
12582
- const t = Z.getState(), n = Array.isArray(t?.roomHeapSlice?.messageHeap) ? t.roomHeapSlice.messageHeap.filter(
12590
+ const t = K.getState(), n = Array.isArray(t?.roomHeapSlice?.messageHeap) ? t.roomHeapSlice.messageHeap.filter(
12583
12591
  (r) => !!r && typeof r == "object"
12584
12592
  ) : [];
12585
12593
  if (!n || n.length === 0) return;
@@ -12615,7 +12623,7 @@ class p8 {
12615
12623
  r.id
12616
12624
  ) === !1) break;
12617
12625
  }
12618
- Z.dispatch({ type: "roomHeapStore/clearHeap" }), ee.log(`[InitTiming] xmpp:drainHeap ${Date.now() - i}ms`);
12626
+ K.dispatch({ type: "roomHeapStore/clearHeap" }), ee.log(`[InitTiming] xmpp:drainHeap ${Date.now() - i}ms`);
12619
12627
  } catch {
12620
12628
  }
12621
12629
  }
@@ -15187,7 +15195,7 @@ async function YN(e) {
15187
15195
  ), Ad("");
15188
15196
  }
15189
15197
  async function GN(e) {
15190
- const t = Z.getState(), n = t.chatSettingStore.user.token || "", i = t.chatSettingStore.appId;
15198
+ const t = K.getState(), n = t.chatSettingStore.user.token || "", i = t.chatSettingStore.appId;
15191
15199
  if (!i)
15192
15200
  throw new Error("[PushNotifications] Cannot register push token: No app ID found in store.");
15193
15201
  const r = {
@@ -15199,7 +15207,7 @@ async function GN(e) {
15199
15207
  tokenLength: e.length
15200
15208
  });
15201
15209
  try {
15202
- return (await Ve.post(`/push/subscription/${i}`, r, {
15210
+ return (await Je.post(`/push/subscription/${i}`, r, {
15203
15211
  headers: {
15204
15212
  Authorization: n
15205
15213
  }
@@ -15361,7 +15369,7 @@ const pw = (e = {}) => {
15361
15369
  }
15362
15370
  return;
15363
15371
  }
15364
- Y && (u(Ze({ roomJID: Y })), D(Y, G ? String(G) : void 0));
15372
+ Y && (u(Ke({ roomJID: Y })), D(Y, G ? String(G) : void 0));
15365
15373
  },
15366
15374
  [o?.pushNotifications?.onClick, u, D, y, e.onClick]
15367
15375
  ), x = de(async () => {
@@ -15420,7 +15428,7 @@ const pw = (e = {}) => {
15420
15428
  return ge(() => {
15421
15429
  if (!n || typeof window > "u") return;
15422
15430
  const I = (N) => {
15423
- const B = N.data ?? {}, O = N.notification?.title || B.title || "New message", Y = N.notification?.body || B.body || "You have a new message.", G = y(B.jid || ""), X = B.userJid || "", $ = N.messageId || B.msgID || String(Date.now()), R = xy(N), j = document.visibilityState === "visible", W = Date.now(), T = N.messageId || B.msgID || `${G}|${X}|${O}|${Y}`, H = h.current.get(T), K = N.messageId || B.msgID, te = WI(a, K), he = !!(H && W - H < 3e4), ie = window._ethoraAppLoadTime || Date.now(), ue = Date.now() - ie < 2e3, V = R ? !1 : !!N.isHistory, fe = jI({
15431
+ const B = N.data ?? {}, O = N.notification?.title || B.title || "New message", Y = N.notification?.body || B.body || "You have a new message.", G = y(B.jid || ""), X = B.userJid || "", $ = N.messageId || B.msgID || String(Date.now()), R = xy(N), j = document.visibilityState === "visible", W = Date.now(), T = N.messageId || B.msgID || `${G}|${X}|${O}|${Y}`, H = h.current.get(T), Z = N.messageId || B.msgID, te = WI(a, Z), he = !!(H && W - H < 3e4), ie = window._ethoraAppLoadTime || Date.now(), ue = Date.now() - ie < 2e3, V = R ? !1 : !!N.isHistory, fe = jI({
15424
15432
  config: o,
15425
15433
  tabVisible: j,
15426
15434
  alreadyInStore: te,
@@ -15444,7 +15452,7 @@ const pw = (e = {}) => {
15444
15452
  Pe,
15445
15453
  Dt,
15446
15454
  G
15447
- ), h.current.set(T, W), G && !te && D(G, K), o?.useStoreConsoleEnabled) {
15455
+ ), h.current.set(T, W), G && !te && D(G, Z), o?.useStoreConsoleEnabled) {
15448
15456
  const Yn = Iy({ config: o, tabVisible: j });
15449
15457
  ee.log(`[NotifyPolicy] source=push action=check_os_delegated show=${Yn.show} reason=${Yn.reason} msgId=${$}`);
15450
15458
  }
@@ -15563,10 +15571,10 @@ const pw = (e = {}) => {
15563
15571
  );
15564
15572
  ee.log("getting roomTimestampArray", n), n.forEach(({ jid: i, timestamp: r }) => {
15565
15573
  if (i) {
15566
- const s = Xe(r);
15574
+ const s = qe(r);
15567
15575
  if (!s) return;
15568
- const a = Xe(
15569
- Z.getState().rooms.rooms?.[i]?.lastViewedTimestamp
15576
+ const a = qe(
15577
+ K.getState().rooms.rooms?.[i]?.lastViewedTimestamp
15570
15578
  ) || 0;
15571
15579
  if (a > 0 && s < a)
15572
15580
  return;
@@ -15585,7 +15593,7 @@ const pw = (e = {}) => {
15585
15593
  (a) => !!a && a.id !== "delimiter-new" && !a.pending
15586
15594
  );
15587
15595
  if (i.length < n) return !1;
15588
- const r = Xe(e.lastViewedTimestamp);
15596
+ const r = qe(e.lastViewedTimestamp);
15589
15597
  if (r <= 0)
15590
15598
  return !0;
15591
15599
  const s = i.reduce((a, o) => {
@@ -15606,7 +15614,7 @@ const pw = (e = {}) => {
15606
15614
  forceReload: u = !1
15607
15615
  } = e;
15608
15616
  if (n?.aborted) return;
15609
- const l = Z.getState().rooms.rooms || {}, f = new Set(A), d = Object.entries(l).map(([b, k]) => ({
15617
+ const l = K.getState().rooms.rooms || {}, f = new Set(A), d = Object.entries(l).map(([b, k]) => ({
15610
15618
  jid: b,
15611
15619
  priority: eD(b, k, o, f),
15612
15620
  activityScore: Ni(k),
@@ -15642,7 +15650,7 @@ const pw = (e = {}) => {
15642
15650
  continue;
15643
15651
  }
15644
15652
  const w = k.slice(0, Math.max(1, i));
15645
- Z.dispatch(
15653
+ K.dispatch(
15646
15654
  Va({
15647
15655
  rooms: w.map((C) => ({
15648
15656
  jid: C.jid,
@@ -15654,9 +15662,9 @@ const pw = (e = {}) => {
15654
15662
  const E = h.findIndex((S) => S.jid === C.jid);
15655
15663
  E !== -1 && h.splice(E, 1);
15656
15664
  const y = (async () => {
15657
- const S = Z.getState().rooms.rooms[C.jid];
15665
+ const S = K.getState().rooms.rooms[C.jid];
15658
15666
  if (!S || !u && S.historyPreloadState === "done") {
15659
- Z.dispatch(
15667
+ K.dispatch(
15660
15668
  Va({
15661
15669
  rooms: [
15662
15670
  {
@@ -15683,12 +15691,12 @@ const pw = (e = {}) => {
15683
15691
  if (n?.aborted) return;
15684
15692
  if (typeof D > "u")
15685
15693
  throw new Error("history_timeout");
15686
- const P = Z.getState().rooms.rooms[C.jid], x = $N(
15694
+ const P = K.getState().rooms.rooms[C.jid], x = $N(
15687
15695
  P,
15688
15696
  D,
15689
15697
  r
15690
15698
  );
15691
- Z.dispatch(
15699
+ K.dispatch(
15692
15700
  Va({
15693
15701
  rooms: [
15694
15702
  {
@@ -15711,7 +15719,7 @@ const pw = (e = {}) => {
15711
15719
  activityScore: C.activityScore
15712
15720
  });
15713
15721
  } else
15714
- Z.dispatch(
15722
+ K.dispatch(
15715
15723
  Va({
15716
15724
  rooms: [
15717
15725
  {
@@ -19069,8 +19077,8 @@ JR(
19069
19077
  /* ClientPlatform.BROWSER */
19070
19078
  );
19071
19079
  function tB() {
19072
- const e = Z.getState().chatSettingStore.user.token || "";
19073
- return Ve.get("/users/exportData", {
19080
+ const e = K.getState().chatSettingStore.user.token || "";
19081
+ return Je.get("/users/exportData", {
19074
19082
  headers: {
19075
19083
  Authorization: e,
19076
19084
  responseType: "arraybuffer"
@@ -19078,12 +19086,12 @@ function tB() {
19078
19086
  });
19079
19087
  }
19080
19088
  function zp(e) {
19081
- return Ve.put("/users", e);
19089
+ return Je.put("/users", e);
19082
19090
  }
19083
19091
  async function nB(e) {
19084
- const t = Z.getState().chatSettingStore.user.token || "";
19092
+ const t = K.getState().chatSettingStore.user.token || "";
19085
19093
  try {
19086
- return (await Ve.put("/users", e, {
19094
+ return (await Je.put("/users", e, {
19087
19095
  headers: {
19088
19096
  Authorization: t
19089
19097
  }
@@ -19093,7 +19101,7 @@ async function nB(e) {
19093
19101
  }
19094
19102
  }
19095
19103
  async function dd(e) {
19096
- const t = e?.token || Z.getState().chatSettingStore.user.token || "", n = e?.endpoint || "/users/my", i = await Ve.get(n, {
19104
+ const t = e?.token || K.getState().chatSettingStore.user.token || "", n = e?.endpoint || "/users/my", i = await Je.get(n, {
19097
19105
  headers: {
19098
19106
  Authorization: t
19099
19107
  }
@@ -19109,7 +19117,7 @@ async function Eu(e) {
19109
19117
  }
19110
19118
  }
19111
19119
  async function Vw(e, t) {
19112
- const n = await Ve.post(
19120
+ const n = await Je.post(
19113
19121
  "/users/login-with-email",
19114
19122
  {
19115
19123
  email: e,
@@ -19120,7 +19128,7 @@ async function Vw(e, t) {
19120
19128
  return i && (n.data.user = { ...n.data.user, ...i }), n;
19121
19129
  }
19122
19130
  async function qp(e, t, n, i = "authToken") {
19123
- const r = await Ve.post(
19131
+ const r = await Je.post(
19124
19132
  "/users/login",
19125
19133
  {
19126
19134
  idToken: e,
@@ -19133,7 +19141,7 @@ async function qp(e, t, n, i = "authToken") {
19133
19141
  return a && r?.data?.user && (r.data.user = { ...r.data.user, ...a }), r;
19134
19142
  }
19135
19143
  function iB(e, t, n, i, r) {
19136
- return Ve.post(
19144
+ return Je.post(
19137
19145
  "/users",
19138
19146
  {
19139
19147
  idToken: e,
@@ -19146,13 +19154,13 @@ function iB(e, t, n, i, r) {
19146
19154
  );
19147
19155
  }
19148
19156
  function rB(e) {
19149
- return Ve.get(
19157
+ return Je.get(
19150
19158
  "/users/checkEmail/" + e,
19151
19159
  { headers: { Authorization: Ea } }
19152
19160
  );
19153
19161
  }
19154
19162
  async function Jw(e) {
19155
- const t = await Ve.post("/users/client", null, { headers: { "x-custom-token": e } }), n = {
19163
+ const t = await Je.post("/users/client", null, { headers: { "x-custom-token": e } }), n = {
19156
19164
  ...t.data.user,
19157
19165
  refreshToken: t.data.refreshToken,
19158
19166
  token: t.data.token
@@ -19181,8 +19189,8 @@ const sB = async () => {
19181
19189
  }
19182
19190
  };
19183
19191
  function zh(e) {
19184
- const t = Z.getState().chatSettingStore.user.token;
19185
- return Ve.post("/files/", e, {
19192
+ const t = K.getState().chatSettingStore.user.token;
19193
+ return Je.post("/files/", e, {
19186
19194
  headers: {
19187
19195
  Authorization: t,
19188
19196
  Accept: "*/*"
@@ -19211,7 +19219,7 @@ const aB = (e) => {
19211
19219
  xmppUsername: t
19212
19220
  };
19213
19221
  }, oB = async (e) => {
19214
- const t = await Ve.post("/users/login/refresh", {}, {
19222
+ const t = await Je.post("/users/login/refresh", {}, {
19215
19223
  headers: {
19216
19224
  Authorization: e
19217
19225
  }
@@ -19302,7 +19310,7 @@ const aB = (e) => {
19302
19310
  return null;
19303
19311
  throw o;
19304
19312
  }
19305
- const s = Z.getState().chatSettingStore.user;
19313
+ const s = K.getState().chatSettingStore.user;
19306
19314
  if (s?.token || s?.refreshToken || s?.xmppPassword) {
19307
19315
  const o = await Dl(s, i, n).catch(() => null);
19308
19316
  if (o && ar(o))
@@ -19317,7 +19325,7 @@ const aB = (e) => {
19317
19325
  }
19318
19326
  return null;
19319
19327
  }, uB = (e) => {
19320
- e && Z.dispatch(An(e));
19328
+ e && K.dispatch(An(e));
19321
19329
  }, cB = "v3", Xw = [
19322
19330
  "persist:root",
19323
19331
  "persist:chatSettingStore",
@@ -19397,13 +19405,13 @@ const aB = (e) => {
19397
19405
  }, []), b = async (y, S) => {
19398
19406
  const P = (await hu().catch(() => ({ items: [] })))?.items || [];
19399
19407
  return P.length ? (P.forEach((x) => {
19400
- Z.dispatch(
19408
+ K.dispatch(
19401
19409
  ga({
19402
19410
  room: Ca(x, t?.xmppSettings?.conference),
19403
19411
  xmpp: y
19404
19412
  })
19405
19413
  );
19406
- }), Z.dispatch(dh({ rooms: P })), P) : [];
19414
+ }), K.dispatch(dh({ rooms: P })), P) : [];
19407
19415
  }, k = async (y, S, D) => {
19408
19416
  (D && D.length ? D : await b(y)).length && await y.sendAllPresencesAndMarkReady();
19409
19417
  }, w = (y, S = 3e4) => new Promise((D, P) => {
@@ -19478,7 +19486,7 @@ const aB = (e) => {
19478
19486
  };
19479
19487
  return ge(() => (i && (i.status === "offline" || i.status === "error") && l < 3 && E(), () => {
19480
19488
  }), [i?.status, l]), ge(() => {
19481
- Z.dispatch(Tv(t));
19489
+ K.dispatch(Tv(t));
19482
19490
  }, [t]), ge(() => {
19483
19491
  if (!t?.initBeforeLoad) {
19484
19492
  a("idle");
@@ -19548,14 +19556,14 @@ const aB = (e) => {
19548
19556
  const G = await B.getChatsPrivateStoreRequestStanza();
19549
19557
  gw(
19550
19558
  G,
19551
- Z.dispatch
19559
+ K.dispatch
19552
19560
  ), ud({
19553
19561
  client: B,
19554
19562
  // intentionally no signal — see comment above
19555
19563
  concurrency: 3,
19556
19564
  pageSize: 10,
19557
19565
  retryLimit: 2,
19558
- selectedRoomJid: Z.getState().rooms.activeRoomJID || null,
19566
+ selectedRoomJid: K.getState().rooms.activeRoomJID || null,
19559
19567
  defaultRoomJids: (t?.defaultRooms || []).map((X) => X.jid)
19560
19568
  }), P = !0, P && (h.current = y);
19561
19569
  };
@@ -19587,7 +19595,7 @@ const aB = (e) => {
19587
19595
  const S = i;
19588
19596
  v();
19589
19597
  try {
19590
- Z.dispatch(fh());
19598
+ K.dispatch(fh());
19591
19599
  } catch (D) {
19592
19600
  console.warn("XmppProvider: rooms state reset failed", D);
19593
19601
  }
@@ -19613,7 +19621,7 @@ const aB = (e) => {
19613
19621
  setClient: r
19614
19622
  },
19615
19623
  "data-xmpp-provider": "true",
19616
- children: /* @__PURE__ */ U(H2, { store: Z, children: [
19624
+ children: /* @__PURE__ */ U(H2, { store: K, children: [
19617
19625
  /* @__PURE__ */ g(
19618
19626
  dB,
19619
19627
  {
@@ -19629,14 +19637,14 @@ const aB = (e) => {
19629
19637
  if (!e)
19630
19638
  throw new Error("useXmppClient must be used within an XmppProvider");
19631
19639
  return e;
19632
- }, hB = () => Z.getState(), Jp = () => {
19640
+ }, hB = () => K.getState(), Jp = () => {
19633
19641
  if (!(typeof window > "u"))
19634
19642
  try {
19635
- Z.getState().chatSettingStore?.config?.useStoreConsoleEnabled === !0 ? window.useStoreConsole = hB : window.useStoreConsole && delete window.useStoreConsole;
19643
+ K.getState().chatSettingStore?.config?.useStoreConsoleEnabled === !0 ? window.useStoreConsole = hB : window.useStoreConsole && delete window.useStoreConsole;
19636
19644
  } catch {
19637
19645
  }
19638
19646
  };
19639
- typeof window < "u" && (Jp(), Z.subscribe(() => {
19647
+ typeof window < "u" && (Jp(), K.subscribe(() => {
19640
19648
  Jp();
19641
19649
  }));
19642
19650
  function mB(e) {
@@ -20777,21 +20785,21 @@ function E_(e, t, n) {
20777
20785
  {
20778
20786
  const $ = Ge.useRef(null), R = $.current;
20779
20787
  if (R !== null && R[1] === N && R[2] === _.styleSheet && R[3] === _.stylis && R[7] === E && (function(j, W, T) {
20780
- const H = j, K = W;
20788
+ const H = j, Z = W;
20781
20789
  let te = 0;
20782
- for (const he in K) if (Ag.call(K, he) && (te++, H[he] !== K[he])) return !1;
20790
+ for (const he in Z) if (Ag.call(Z, he) && (te++, H[he] !== Z[he])) return !1;
20783
20791
  return te === T;
20784
20792
  })(R[0], k, R[4])) B = R[5], O = R[6];
20785
20793
  else {
20786
20794
  B = (function(W, T, H) {
20787
- const K = Object.assign(Object.assign({}, T), { className: void 0, theme: H }), te = W.length > 1;
20795
+ const Z = Object.assign(Object.assign({}, T), { className: void 0, theme: H }), te = W.length > 1;
20788
20796
  for (let he = 0; he < W.length; he++) {
20789
- const ie = W[he], ue = Nu(ie) ? ie(te ? Object.assign({}, K) : K) : ie;
20790
- for (const V in ue) V === "className" ? K.className = Ns(K.className, ue[V]) : V === "style" ? K.style = Object.assign(Object.assign({}, K.style), ue[V]) : V in T && T[V] === void 0 || (K[V] = ue[V]);
20797
+ const ie = W[he], ue = Nu(ie) ? ie(te ? Object.assign({}, Z) : Z) : ie;
20798
+ for (const V in ue) V === "className" ? Z.className = Ns(Z.className, ue[V]) : V === "style" ? Z.style = Object.assign(Object.assign({}, Z.style), ue[V]) : V in T && T[V] === void 0 || (Z[V] = ue[V]);
20791
20799
  }
20792
- return "className" in T && typeof T.className == "string" && (K.className = Ns(K.className, T.className)), K;
20793
- })(C, k, N), O = (function(W, T, H, K) {
20794
- const te = W.generateAndInjectStyles(T, H, K);
20800
+ return "className" in T && typeof T.className == "string" && (Z.className = Ns(Z.className, T.className)), Z;
20801
+ })(C, k, N), O = (function(W, T, H, Z) {
20802
+ const te = W.generateAndInjectStyles(T, H, Z);
20795
20803
  return process.env.NODE_ENV !== "production" && Ge.useDebugValue && Ge.useDebugValue(te), te;
20796
20804
  })(E, B, _.styleSheet, _.stylis);
20797
20805
  let j = 0;
@@ -21541,7 +21549,7 @@ const sP = (e) => e.length === 0 ? "" : e.length === 1 ? `${e[0]} is typing` : e
21541
21549
  isReply: a,
21542
21550
  className: o
21543
21551
  }) => {
21544
- const { CustomDaySeparator: A, CustomNewMessageLabel: u } = Ru(), c = t.user.id === r, l = new Date(t.date), f = qe(() => {
21552
+ const { CustomDaySeparator: A, CustomNewMessageLabel: u } = Ru(), c = t.user.id === r, l = new Date(t.date), f = Ve(() => {
21545
21553
  try {
21546
21554
  return new Intl.DateTimeFormat(void 0, {
21547
21555
  weekday: "long",
@@ -21607,7 +21615,7 @@ const sP = (e) => e.length === 0 ? "" : e.length === 1 ? `${e[0]} is typing` : e
21607
21615
  (l) => (typeof l.rooms?.activeRoomJID == "string" ? l.rooms?.rooms?.[l.rooms.activeRoomJID]?.isLoading : !1) || !1
21608
21616
  ), A = we(
21609
21617
  (l) => l.rooms.loadingText
21610
- ), u = we((l) => l.rooms.usersSet), c = qe(
21618
+ ), u = we((l) => l.rooms.usersSet), c = Ve(
21611
21619
  () => r && Array.isArray(i[r]?.messages) ? i[r].messages : vP,
21612
21620
  [i, r]
21613
21621
  );
@@ -22584,16 +22592,16 @@ const sP = (e) => e.length === 0 ? "" : e.length === 1 ? `${e[0]} is typing` : e
22584
22592
  }) => {
22585
22593
  const { CustomScrollableArea: o, CustomNewMessageLabel: A } = Ru(), { composing: u, messages: c, composingList: l } = en(n).room, { user: f } = St();
22586
22594
  Dn("chat-room-load-more-loader", r);
22587
- const [d, h] = le(!1), [p, v] = le(0), [b, k] = le(null), w = be(c.length), C = be(null), E = be({}), y = be(!0), S = qe(() => c.map((V) => ({
22595
+ const [d, h] = le(!1), [p, v] = le(0), [b, k] = le(null), w = be(c.length), C = be(null), E = be({}), y = be(!0), S = Ve(() => c.map((V) => ({
22588
22596
  ...V,
22589
22597
  reply: c.filter(
22590
22598
  (ae) => PA(ae.mainMessage)?.id === V.id
22591
22599
  )
22592
- })), [c, c.length]), D = qe(() => s ? S.filter(
22600
+ })), [c, c.length]), D = Ve(() => s ? S.filter(
22593
22601
  (V) => V.roomJid === n && V.isReply && V.isReply === "true" && PA(V.mainMessage)?.id === a.id
22594
22602
  ) : S.filter(
22595
22603
  (V) => V.isSystemMessage === "true" || V.showInChannel === "true" || (!V.isReply || V.isReply === "false") && !V.mainMessage
22596
- ), [c, c.length]), P = qe(
22604
+ ), [c, c.length]), P = Ve(
22597
22605
  () => c.length && c[c.length - 1].user.id === f.xmppUsername,
22598
22606
  [c.length, f.xmppUsername]
22599
22607
  ), x = be(null), _ = be(null), I = be(
@@ -22669,15 +22677,15 @@ const sP = (e) => e.length === 0 ? "" : e.length === 1 ? `${e[0]} is typing` : e
22669
22677
  Y.current = Yn, G.current = !Dt, Pe > 150 ? h(!0) : Yn && (T(), h(!1), v(0)), w.current = c.length, W();
22670
22678
  } else
22671
22679
  B.current = null;
22672
- }, K = () => {
22680
+ }, Z = () => {
22673
22681
  typeof window < "u" && (window.clearTimeout(B.current), B.current = window.setTimeout(() => {
22674
22682
  H();
22675
22683
  }, 50));
22676
22684
  };
22677
22685
  ge(() => {
22678
22686
  const V = _.current;
22679
- return V && V.addEventListener("scroll", K, !0), () => {
22680
- V && V.removeEventListener("scroll", K, !0);
22687
+ return V && V.addEventListener("scroll", Z, !0), () => {
22688
+ V && V.removeEventListener("scroll", Z, !0);
22681
22689
  };
22682
22690
  }, []), ge(() => {
22683
22691
  if (D.length > 30) {
@@ -22705,7 +22713,7 @@ const sP = (e) => e.length === 0 ? "" : e.length === 1 ? `${e[0]} is typing` : e
22705
22713
  T,
22706
22714
  R
22707
22715
  ]);
22708
- const te = qe(() => {
22716
+ const te = Ve(() => {
22709
22717
  let V = null;
22710
22718
  return D.map((fe) => {
22711
22719
  const ae = new Date(fe.date).toDateString(), De = ae !== V;
@@ -22784,7 +22792,7 @@ const sP = (e) => e.length === 0 ? "" : e.length === 1 ? `${e[0]} is typing` : e
22784
22792
  S_,
22785
22793
  {
22786
22794
  ref: x,
22787
- onScroll: K,
22795
+ onScroll: Z,
22788
22796
  color: i?.colors?.primary,
22789
22797
  children: [
22790
22798
  r && /* @__PURE__ */ g(Xt, { color: i?.colors?.primary }),
@@ -26151,8 +26159,8 @@ function HO(e, t, n) {
26151
26159
  }
26152
26160
  function v(T) {
26153
26161
  if (T === null || T === 47 || T === 62 || We(T)) {
26154
- const H = T === 47, K = a.toLowerCase();
26155
- return !H && !s && Og.includes(K) ? (r = 1, i.interrupt ? t(T) : I(T)) : MO.includes(a.toLowerCase()) ? (r = 6, H ? (e.consume(T), b) : i.interrupt ? t(T) : I(T)) : (r = 7, i.interrupt && !i.parser.lazy[i.now().line] ? n(T) : s ? k(T) : w(T));
26162
+ const H = T === 47, Z = a.toLowerCase();
26163
+ return !H && !s && Og.includes(Z) ? (r = 1, i.interrupt ? t(T) : I(T)) : MO.includes(a.toLowerCase()) ? (r = 6, H ? (e.consume(T), b) : i.interrupt ? t(T) : I(T)) : (r = 7, i.interrupt && !i.parser.lazy[i.now().line] ? n(T) : s ? k(T) : w(T));
26156
26164
  }
26157
26165
  return T === 45 || mt(T) ? (e.consume(T), a += String.fromCharCode(T), v) : n(T);
26158
26166
  }
@@ -26987,21 +26995,21 @@ function RL(e, t, n) {
26987
26995
  function T(te) {
26988
26996
  return he;
26989
26997
  function he(ie) {
26990
- return R = P(), $ = te, te.partial || (u.currentConstruct = te), te.name && u.parser.constructs.disable.null.includes(te.name) ? K() : te.tokenize.call(
26998
+ return R = P(), $ = te, te.partial || (u.currentConstruct = te), te.name && u.parser.constructs.disable.null.includes(te.name) ? Z() : te.tokenize.call(
26991
26999
  // If we do have fields, create an object w/ `context` as its
26992
27000
  // prototype.
26993
27001
  // This allows a “live binding”, which is needed for `interrupt`.
26994
27002
  I ? Object.assign(Object.create(u), I) : u,
26995
27003
  A,
26996
27004
  H,
26997
- K
27005
+ Z
26998
27006
  )(ie);
26999
27007
  }
27000
27008
  }
27001
27009
  function H(te) {
27002
27010
  return _($, R), O;
27003
27011
  }
27004
- function K(te) {
27012
+ function Z(te) {
27005
27013
  return R.restore(), ++X < G.length ? T(G[X]) : Y;
27006
27014
  }
27007
27015
  }
@@ -27212,8 +27220,8 @@ function UL(e) {
27212
27220
  autolinkProtocol: ie,
27213
27221
  blockQuote: A(),
27214
27222
  characterEscapeValue: x,
27215
- characterReferenceMarkerHexadecimal: K,
27216
- characterReferenceMarkerNumeric: K,
27223
+ characterReferenceMarkerHexadecimal: Z,
27224
+ characterReferenceMarkerNumeric: Z,
27217
27225
  characterReferenceValue: te,
27218
27226
  characterReference: he,
27219
27227
  codeFenced: A(v),
@@ -27538,7 +27546,7 @@ function UL(e) {
27538
27546
  const me = this.resume(), Ee = this.stack[this.stack.length - 1];
27539
27547
  Ee.label = me, Ee.identifier = Kt(this.sliceSerialize(ne)).toLowerCase(), this.data.referenceType = "full";
27540
27548
  }
27541
- function K(ne) {
27549
+ function Z(ne) {
27542
27550
  this.data.characterReferenceType = ne.type;
27543
27551
  }
27544
27552
  function te(ne) {
@@ -32331,7 +32339,7 @@ const zU = [
32331
32339
  1048575,
32332
32340
  1114110,
32333
32341
  1114111
32334
- ]), Je = "�";
32342
+ ]), Xe = "�";
32335
32343
  var M;
32336
32344
  (function(e) {
32337
32345
  e[e.EOF = -1] = "EOF", e[e.NULL = 0] = "NULL", e[e.TABULATION = 9] = "TABULATION", e[e.CARRIAGE_RETURN = 13] = "CARRIAGE_RETURN", e[e.LINE_FEED = 10] = "LINE_FEED", e[e.FORM_FEED = 12] = "FORM_FEED", e[e.SPACE = 32] = "SPACE", e[e.EXCLAMATION_MARK = 33] = "EXCLAMATION_MARK", e[e.QUOTATION_MARK = 34] = "QUOTATION_MARK", e[e.AMPERSAND = 38] = "AMPERSAND", e[e.APOSTROPHE = 39] = "APOSTROPHE", e[e.HYPHEN_MINUS = 45] = "HYPHEN_MINUS", e[e.SOLIDUS = 47] = "SOLIDUS", e[e.DIGIT_0 = 48] = "DIGIT_0", e[e.DIGIT_9 = 57] = "DIGIT_9", e[e.SEMICOLON = 59] = "SEMICOLON", e[e.LESS_THAN_SIGN = 60] = "LESS_THAN_SIGN", e[e.EQUALS_SIGN = 61] = "EQUALS_SIGN", e[e.GREATER_THAN_SIGN = 62] = "GREATER_THAN_SIGN", e[e.QUESTION_MARK = 63] = "QUESTION_MARK", e[e.LATIN_CAPITAL_A = 65] = "LATIN_CAPITAL_A", e[e.LATIN_CAPITAL_Z = 90] = "LATIN_CAPITAL_Z", e[e.RIGHT_SQUARE_BRACKET = 93] = "RIGHT_SQUARE_BRACKET", e[e.GRAVE_ACCENT = 96] = "GRAVE_ACCENT", e[e.LATIN_SMALL_A = 97] = "LATIN_SMALL_A", e[e.LATIN_SMALL_Z = 122] = "LATIN_SMALL_Z";
@@ -33563,7 +33571,7 @@ class fj {
33563
33571
  break;
33564
33572
  }
33565
33573
  case M.NULL: {
33566
- this._err(J.unexpectedNullCharacter), this._emitChars(Je);
33574
+ this._err(J.unexpectedNullCharacter), this._emitChars(Xe);
33567
33575
  break;
33568
33576
  }
33569
33577
  case M.EOF: {
@@ -33583,7 +33591,7 @@ class fj {
33583
33591
  break;
33584
33592
  }
33585
33593
  case M.NULL: {
33586
- this._err(J.unexpectedNullCharacter), this._emitChars(Je);
33594
+ this._err(J.unexpectedNullCharacter), this._emitChars(Xe);
33587
33595
  break;
33588
33596
  }
33589
33597
  case M.EOF: {
@@ -33603,7 +33611,7 @@ class fj {
33603
33611
  break;
33604
33612
  }
33605
33613
  case M.NULL: {
33606
- this._err(J.unexpectedNullCharacter), this._emitChars(Je);
33614
+ this._err(J.unexpectedNullCharacter), this._emitChars(Xe);
33607
33615
  break;
33608
33616
  }
33609
33617
  case M.EOF: {
@@ -33619,7 +33627,7 @@ class fj {
33619
33627
  _statePlaintext(t) {
33620
33628
  switch (t) {
33621
33629
  case M.NULL: {
33622
- this._err(J.unexpectedNullCharacter), this._emitChars(Je);
33630
+ this._err(J.unexpectedNullCharacter), this._emitChars(Xe);
33623
33631
  break;
33624
33632
  }
33625
33633
  case M.EOF: {
@@ -33697,7 +33705,7 @@ class fj {
33697
33705
  break;
33698
33706
  }
33699
33707
  case M.NULL: {
33700
- this._err(J.unexpectedNullCharacter), n.tagName += Je;
33708
+ this._err(J.unexpectedNullCharacter), n.tagName += Xe;
33701
33709
  break;
33702
33710
  }
33703
33711
  case M.EOF: {
@@ -33806,7 +33814,7 @@ class fj {
33806
33814
  break;
33807
33815
  }
33808
33816
  case M.NULL: {
33809
- this._err(J.unexpectedNullCharacter), this._emitChars(Je);
33817
+ this._err(J.unexpectedNullCharacter), this._emitChars(Xe);
33810
33818
  break;
33811
33819
  }
33812
33820
  case M.EOF: {
@@ -33830,7 +33838,7 @@ class fj {
33830
33838
  break;
33831
33839
  }
33832
33840
  case M.NULL: {
33833
- this._err(J.unexpectedNullCharacter), this.state = L.SCRIPT_DATA_ESCAPED, this._emitChars(Je);
33841
+ this._err(J.unexpectedNullCharacter), this.state = L.SCRIPT_DATA_ESCAPED, this._emitChars(Xe);
33834
33842
  break;
33835
33843
  }
33836
33844
  case M.EOF: {
@@ -33858,7 +33866,7 @@ class fj {
33858
33866
  break;
33859
33867
  }
33860
33868
  case M.NULL: {
33861
- this._err(J.unexpectedNullCharacter), this.state = L.SCRIPT_DATA_ESCAPED, this._emitChars(Je);
33869
+ this._err(J.unexpectedNullCharacter), this.state = L.SCRIPT_DATA_ESCAPED, this._emitChars(Xe);
33862
33870
  break;
33863
33871
  }
33864
33872
  case M.EOF: {
@@ -33907,7 +33915,7 @@ class fj {
33907
33915
  break;
33908
33916
  }
33909
33917
  case M.NULL: {
33910
- this._err(J.unexpectedNullCharacter), this._emitChars(Je);
33918
+ this._err(J.unexpectedNullCharacter), this._emitChars(Xe);
33911
33919
  break;
33912
33920
  }
33913
33921
  case M.EOF: {
@@ -33931,7 +33939,7 @@ class fj {
33931
33939
  break;
33932
33940
  }
33933
33941
  case M.NULL: {
33934
- this._err(J.unexpectedNullCharacter), this.state = L.SCRIPT_DATA_DOUBLE_ESCAPED, this._emitChars(Je);
33942
+ this._err(J.unexpectedNullCharacter), this.state = L.SCRIPT_DATA_DOUBLE_ESCAPED, this._emitChars(Xe);
33935
33943
  break;
33936
33944
  }
33937
33945
  case M.EOF: {
@@ -33959,7 +33967,7 @@ class fj {
33959
33967
  break;
33960
33968
  }
33961
33969
  case M.NULL: {
33962
- this._err(J.unexpectedNullCharacter), this.state = L.SCRIPT_DATA_DOUBLE_ESCAPED, this._emitChars(Je);
33970
+ this._err(J.unexpectedNullCharacter), this.state = L.SCRIPT_DATA_DOUBLE_ESCAPED, this._emitChars(Xe);
33963
33971
  break;
33964
33972
  }
33965
33973
  case M.EOF: {
@@ -34033,7 +34041,7 @@ class fj {
34033
34041
  break;
34034
34042
  }
34035
34043
  case M.NULL: {
34036
- this._err(J.unexpectedNullCharacter), this.currentAttr.name += Je;
34044
+ this._err(J.unexpectedNullCharacter), this.currentAttr.name += Xe;
34037
34045
  break;
34038
34046
  }
34039
34047
  default:
@@ -34107,7 +34115,7 @@ class fj {
34107
34115
  break;
34108
34116
  }
34109
34117
  case M.NULL: {
34110
- this._err(J.unexpectedNullCharacter), this.currentAttr.value += Je;
34118
+ this._err(J.unexpectedNullCharacter), this.currentAttr.value += Xe;
34111
34119
  break;
34112
34120
  }
34113
34121
  case M.EOF: {
@@ -34131,7 +34139,7 @@ class fj {
34131
34139
  break;
34132
34140
  }
34133
34141
  case M.NULL: {
34134
- this._err(J.unexpectedNullCharacter), this.currentAttr.value += Je;
34142
+ this._err(J.unexpectedNullCharacter), this.currentAttr.value += Xe;
34135
34143
  break;
34136
34144
  }
34137
34145
  case M.EOF: {
@@ -34162,7 +34170,7 @@ class fj {
34162
34170
  break;
34163
34171
  }
34164
34172
  case M.NULL: {
34165
- this._err(J.unexpectedNullCharacter), this.currentAttr.value += Je;
34173
+ this._err(J.unexpectedNullCharacter), this.currentAttr.value += Xe;
34166
34174
  break;
34167
34175
  }
34168
34176
  case M.QUOTATION_MARK:
@@ -34239,7 +34247,7 @@ class fj {
34239
34247
  break;
34240
34248
  }
34241
34249
  case M.NULL: {
34242
- this._err(J.unexpectedNullCharacter), n.data += Je;
34250
+ this._err(J.unexpectedNullCharacter), n.data += Xe;
34243
34251
  break;
34244
34252
  }
34245
34253
  default:
@@ -34304,7 +34312,7 @@ class fj {
34304
34312
  break;
34305
34313
  }
34306
34314
  case M.NULL: {
34307
- this._err(J.unexpectedNullCharacter), n.data += Je;
34315
+ this._err(J.unexpectedNullCharacter), n.data += Xe;
34308
34316
  break;
34309
34317
  }
34310
34318
  case M.EOF: {
@@ -34448,7 +34456,7 @@ class fj {
34448
34456
  case M.FORM_FEED:
34449
34457
  break;
34450
34458
  case M.NULL: {
34451
- this._err(J.unexpectedNullCharacter), this._createDoctypeToken(Je), this.state = L.DOCTYPE_NAME;
34459
+ this._err(J.unexpectedNullCharacter), this._createDoctypeToken(Xe), this.state = L.DOCTYPE_NAME;
34452
34460
  break;
34453
34461
  }
34454
34462
  case M.GREATER_THAN_SIGN: {
@@ -34484,7 +34492,7 @@ class fj {
34484
34492
  break;
34485
34493
  }
34486
34494
  case M.NULL: {
34487
- this._err(J.unexpectedNullCharacter), n.name += Je;
34495
+ this._err(J.unexpectedNullCharacter), n.name += Xe;
34488
34496
  break;
34489
34497
  }
34490
34498
  case M.EOF: {
@@ -34589,7 +34597,7 @@ class fj {
34589
34597
  break;
34590
34598
  }
34591
34599
  case M.NULL: {
34592
- this._err(J.unexpectedNullCharacter), n.publicId += Je;
34600
+ this._err(J.unexpectedNullCharacter), n.publicId += Xe;
34593
34601
  break;
34594
34602
  }
34595
34603
  case M.GREATER_THAN_SIGN: {
@@ -34614,7 +34622,7 @@ class fj {
34614
34622
  break;
34615
34623
  }
34616
34624
  case M.NULL: {
34617
- this._err(J.unexpectedNullCharacter), n.publicId += Je;
34625
+ this._err(J.unexpectedNullCharacter), n.publicId += Xe;
34618
34626
  break;
34619
34627
  }
34620
34628
  case M.GREATER_THAN_SIGN: {
@@ -34763,7 +34771,7 @@ class fj {
34763
34771
  break;
34764
34772
  }
34765
34773
  case M.NULL: {
34766
- this._err(J.unexpectedNullCharacter), n.systemId += Je;
34774
+ this._err(J.unexpectedNullCharacter), n.systemId += Xe;
34767
34775
  break;
34768
34776
  }
34769
34777
  case M.GREATER_THAN_SIGN: {
@@ -34788,7 +34796,7 @@ class fj {
34788
34796
  break;
34789
34797
  }
34790
34798
  case M.NULL: {
34791
- this._err(J.unexpectedNullCharacter), n.systemId += Je;
34799
+ this._err(J.unexpectedNullCharacter), n.systemId += Xe;
34792
34800
  break;
34793
34801
  }
34794
34802
  case M.GREATER_THAN_SIGN: {
@@ -37890,7 +37898,7 @@ function pY(e, t) {
37890
37898
  }
37891
37899
  }
37892
37900
  function gY(e, t) {
37893
- t.chars = Je, e._insertCharacters(t);
37901
+ t.chars = Xe, e._insertCharacters(t);
37894
37902
  }
37895
37903
  function bY(e, t) {
37896
37904
  e._insertCharacters(t), e.framesetOk = !1;
@@ -38384,7 +38392,7 @@ const D4 = ({ text: e }) => e ? /* @__PURE__ */ g(
38384
38392
  r?.secondarySendButton?.messageEdit,
38385
38393
  A,
38386
38394
  W
38387
- ]), K = de(
38395
+ ]), Z = de(
38388
38396
  (ie) => {
38389
38397
  if (!(ie.key !== "Enter" || !(D.length > 0 || W(v)))) {
38390
38398
  if (u) {
@@ -38406,7 +38414,7 @@ const D4 = ({ text: e }) => e ? /* @__PURE__ */ g(
38406
38414
  ), te = de((ie) => {
38407
38415
  const ue = URL.createObjectURL(ie), V = ie.type.split("/")[0];
38408
38416
  return V === "image" ? /* @__PURE__ */ g(zP, { src: ue, alt: ie.name }) : V === "video" ? /* @__PURE__ */ g(qP, { src: ue, controls: !0 }) : /* @__PURE__ */ g(_u, { alt: ie.name });
38409
- }, []), he = qe(() => D.map(
38417
+ }, []), he = Ve(() => D.map(
38410
38418
  (ie, ue) => ue < 1 && /* @__PURE__ */ U(GP, { children: [
38411
38419
  te(ie),
38412
38420
  /* @__PURE__ */ g(
@@ -38450,7 +38458,7 @@ const D4 = ({ text: e }) => e ? /* @__PURE__ */ g(
38450
38458
  placeholder: "Type message",
38451
38459
  value: v,
38452
38460
  onChange: $,
38453
- onKeyDown: K,
38461
+ onKeyDown: Z,
38454
38462
  onFocus: B,
38455
38463
  onBlur: O,
38456
38464
  disabled: a || o,
@@ -38466,7 +38474,7 @@ const D4 = ({ text: e }) => e ? /* @__PURE__ */ g(
38466
38474
  placeholder: p || "Type message",
38467
38475
  value: v,
38468
38476
  onChange: $,
38469
- onKeyDown: K,
38477
+ onKeyDown: Z,
38470
38478
  onFocus: B,
38471
38479
  onBlur: O,
38472
38480
  disabled: a || o,
@@ -39138,7 +39146,7 @@ const F4 = ({
39138
39146
  }) => {
39139
39147
  const { usersSet: s } = en(), [a, o] = le(""), [A, u] = le([]), c = (f) => {
39140
39148
  n((d) => d.some((p) => p._id === f._id) ? d.filter((p) => p._id !== f._id) : [...d, f]);
39141
- }, l = qe(
39149
+ }, l = Ve(
39142
39150
  () => lG((f) => {
39143
39151
  const d = f.toLowerCase(), h = Object.values(s).filter(
39144
39152
  (p) => `${p.firstName} ${p.lastName}`.toLowerCase().includes(d)
@@ -39297,7 +39305,7 @@ const F4 = ({
39297
39305
  const [r, s] = le(!1), [a, o] = le(!1), [A, u] = le("0"), [c, l] = le(""), [f, d] = le(""), [h, p] = le({
39298
39306
  name: "Public",
39299
39307
  id: "public"
39300
- }), [v, b] = le(null), [k, w] = le({ name: "", description: "" }), [C, E] = le([]), y = qe(
39308
+ }), [v, b] = le(null), [k, w] = le({ name: "", description: "" }), [C, E] = le([]), y = Ve(
39301
39309
  // () => roomName.length >= 3 && roomDescription.length >= 5,
39302
39310
  () => c.length >= 3,
39303
39311
  [c, f]
@@ -39325,7 +39333,7 @@ const F4 = ({
39325
39333
  room: G,
39326
39334
  xmpp: n
39327
39335
  })
39328
- ), t(Ze({ roomJID: G.jid }));
39336
+ ), t(Ke({ roomJID: G.jid }));
39329
39337
  } catch (G) {
39330
39338
  console.error("Error handling room creation:", G);
39331
39339
  }
@@ -39354,7 +39362,7 @@ const F4 = ({
39354
39362
  c,
39355
39363
  f && f !== "" ? f : "No description"
39356
39364
  );
39357
- n.getRoomsStanza(), t(Ze({ roomJID: X })), G && (n.setRoomImageStanza(X, G, "icon", "none"), t(
39365
+ n.getRoomsStanza(), t(Ke({ roomJID: X })), G && (n.setRoomImageStanza(X, G, "icon", "none"), t(
39358
39366
  lt({ jid: X, updates: { icon: G } })
39359
39367
  ));
39360
39368
  }
@@ -39744,7 +39752,7 @@ function NG() {
39744
39752
  function H(ae) {
39745
39753
  return C(ae) === c;
39746
39754
  }
39747
- function K(ae) {
39755
+ function Z(ae) {
39748
39756
  return C(ae) === i;
39749
39757
  }
39750
39758
  function te(ae) {
@@ -39765,7 +39773,7 @@ function NG() {
39765
39773
  function fe(ae) {
39766
39774
  return C(ae) === l;
39767
39775
  }
39768
- Oe.AsyncMode = E, Oe.ConcurrentMode = y, Oe.ContextConsumer = S, Oe.ContextProvider = D, Oe.Element = P, Oe.ForwardRef = x, Oe.Fragment = _, Oe.Lazy = I, Oe.Memo = N, Oe.Portal = B, Oe.Profiler = O, Oe.StrictMode = Y, Oe.Suspense = G, Oe.isAsyncMode = $, Oe.isConcurrentMode = R, Oe.isContextConsumer = j, Oe.isContextProvider = W, Oe.isElement = T, Oe.isForwardRef = H, Oe.isFragment = K, Oe.isLazy = te, Oe.isMemo = he, Oe.isPortal = ie, Oe.isProfiler = ue, Oe.isStrictMode = V, Oe.isSuspense = fe, Oe.isValidElementType = w, Oe.typeOf = C;
39776
+ Oe.AsyncMode = E, Oe.ConcurrentMode = y, Oe.ContextConsumer = S, Oe.ContextProvider = D, Oe.Element = P, Oe.ForwardRef = x, Oe.Fragment = _, Oe.Lazy = I, Oe.Memo = N, Oe.Portal = B, Oe.Profiler = O, Oe.StrictMode = Y, Oe.Suspense = G, Oe.isAsyncMode = $, Oe.isConcurrentMode = R, Oe.isContextConsumer = j, Oe.isContextProvider = W, Oe.isElement = T, Oe.isForwardRef = H, Oe.isFragment = Z, Oe.isLazy = te, Oe.isMemo = he, Oe.isPortal = ie, Oe.isProfiler = ue, Oe.isStrictMode = V, Oe.isSuspense = fe, Oe.isValidElementType = w, Oe.typeOf = C;
39769
39777
  })()), Oe;
39770
39778
  }
39771
39779
  var Nb;
@@ -39933,7 +39941,7 @@ function BG() {
39933
39941
  function v(R) {
39934
39942
  if (process.env.NODE_ENV !== "production")
39935
39943
  var j = {}, W = 0;
39936
- function T(K, te, he, ie, ue, V, fe) {
39944
+ function T(Z, te, he, ie, ue, V, fe) {
39937
39945
  if (ie = ie || f, V = V || he, fe !== n) {
39938
39946
  if (A) {
39939
39947
  var ae = new Error(
@@ -39948,18 +39956,18 @@ function BG() {
39948
39956
  ), j[De] = !0, W++);
39949
39957
  }
39950
39958
  }
39951
- return te[he] == null ? K ? te[he] === null ? new p("The " + ue + " `" + V + "` is marked as required " + ("in `" + ie + "`, but its value is `null`.")) : new p("The " + ue + " `" + V + "` is marked as required in " + ("`" + ie + "`, but its value is `undefined`.")) : null : R(te, he, ie, ue, V);
39959
+ return te[he] == null ? Z ? te[he] === null ? new p("The " + ue + " `" + V + "` is marked as required " + ("in `" + ie + "`, but its value is `null`.")) : new p("The " + ue + " `" + V + "` is marked as required in " + ("`" + ie + "`, but its value is `undefined`.")) : null : R(te, he, ie, ue, V);
39952
39960
  }
39953
39961
  var H = T.bind(null, !1);
39954
39962
  return H.isRequired = T.bind(null, !0), H;
39955
39963
  }
39956
39964
  function b(R) {
39957
- function j(W, T, H, K, te, he) {
39965
+ function j(W, T, H, Z, te, he) {
39958
39966
  var ie = W[T], ue = Y(ie);
39959
39967
  if (ue !== R) {
39960
39968
  var V = G(ie);
39961
39969
  return new p(
39962
- "Invalid " + K + " `" + te + "` of type " + ("`" + V + "` supplied to `" + H + "`, expected ") + ("`" + R + "`."),
39970
+ "Invalid " + Z + " `" + te + "` of type " + ("`" + V + "` supplied to `" + H + "`, expected ") + ("`" + R + "`."),
39963
39971
  { expectedType: R }
39964
39972
  );
39965
39973
  }
@@ -39971,16 +39979,16 @@ function BG() {
39971
39979
  return v(a);
39972
39980
  }
39973
39981
  function w(R) {
39974
- function j(W, T, H, K, te) {
39982
+ function j(W, T, H, Z, te) {
39975
39983
  if (typeof R != "function")
39976
39984
  return new p("Property `" + te + "` of component `" + H + "` has invalid PropType notation inside arrayOf.");
39977
39985
  var he = W[T];
39978
39986
  if (!Array.isArray(he)) {
39979
39987
  var ie = Y(he);
39980
- return new p("Invalid " + K + " `" + te + "` of type " + ("`" + ie + "` supplied to `" + H + "`, expected an array."));
39988
+ return new p("Invalid " + Z + " `" + te + "` of type " + ("`" + ie + "` supplied to `" + H + "`, expected an array."));
39981
39989
  }
39982
39990
  for (var ue = 0; ue < he.length; ue++) {
39983
- var V = R(he, ue, H, K, te + "[" + ue + "]", n);
39991
+ var V = R(he, ue, H, Z, te + "[" + ue + "]", n);
39984
39992
  if (V instanceof Error)
39985
39993
  return V;
39986
39994
  }
@@ -39989,32 +39997,32 @@ function BG() {
39989
39997
  return v(j);
39990
39998
  }
39991
39999
  function C() {
39992
- function R(j, W, T, H, K) {
40000
+ function R(j, W, T, H, Z) {
39993
40001
  var te = j[W];
39994
40002
  if (!o(te)) {
39995
40003
  var he = Y(te);
39996
- return new p("Invalid " + H + " `" + K + "` of type " + ("`" + he + "` supplied to `" + T + "`, expected a single ReactElement."));
40004
+ return new p("Invalid " + H + " `" + Z + "` of type " + ("`" + he + "` supplied to `" + T + "`, expected a single ReactElement."));
39997
40005
  }
39998
40006
  return null;
39999
40007
  }
40000
40008
  return v(R);
40001
40009
  }
40002
40010
  function E() {
40003
- function R(j, W, T, H, K) {
40011
+ function R(j, W, T, H, Z) {
40004
40012
  var te = j[W];
40005
40013
  if (!e.isValidElementType(te)) {
40006
40014
  var he = Y(te);
40007
- return new p("Invalid " + H + " `" + K + "` of type " + ("`" + he + "` supplied to `" + T + "`, expected a single ReactElement type."));
40015
+ return new p("Invalid " + H + " `" + Z + "` of type " + ("`" + he + "` supplied to `" + T + "`, expected a single ReactElement type."));
40008
40016
  }
40009
40017
  return null;
40010
40018
  }
40011
40019
  return v(R);
40012
40020
  }
40013
40021
  function y(R) {
40014
- function j(W, T, H, K, te) {
40022
+ function j(W, T, H, Z, te) {
40015
40023
  if (!(W[T] instanceof R)) {
40016
40024
  var he = R.name || f, ie = $(W[T]);
40017
- return new p("Invalid " + K + " `" + te + "` of type " + ("`" + ie + "` supplied to `" + H + "`, expected ") + ("instance of `" + he + "`."));
40025
+ return new p("Invalid " + Z + " `" + te + "` of type " + ("`" + ie + "` supplied to `" + H + "`, expected ") + ("instance of `" + he + "`."));
40018
40026
  }
40019
40027
  return null;
40020
40028
  }
@@ -40025,7 +40033,7 @@ function BG() {
40025
40033
  return process.env.NODE_ENV !== "production" && (arguments.length > 1 ? s(
40026
40034
  "Invalid arguments supplied to oneOf, expected an array, got " + arguments.length + " arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."
40027
40035
  ) : s("Invalid argument supplied to oneOf, expected an array.")), a;
40028
- function j(W, T, H, K, te) {
40036
+ function j(W, T, H, Z, te) {
40029
40037
  for (var he = W[T], ie = 0; ie < R.length; ie++)
40030
40038
  if (h(he, R[ie]))
40031
40039
  return null;
@@ -40033,20 +40041,20 @@ function BG() {
40033
40041
  var De = G(ae);
40034
40042
  return De === "symbol" ? String(ae) : ae;
40035
40043
  });
40036
- return new p("Invalid " + K + " `" + te + "` of value `" + String(he) + "` " + ("supplied to `" + H + "`, expected one of " + ue + "."));
40044
+ return new p("Invalid " + Z + " `" + te + "` of value `" + String(he) + "` " + ("supplied to `" + H + "`, expected one of " + ue + "."));
40037
40045
  }
40038
40046
  return v(j);
40039
40047
  }
40040
40048
  function D(R) {
40041
- function j(W, T, H, K, te) {
40049
+ function j(W, T, H, Z, te) {
40042
40050
  if (typeof R != "function")
40043
40051
  return new p("Property `" + te + "` of component `" + H + "` has invalid PropType notation inside objectOf.");
40044
40052
  var he = W[T], ie = Y(he);
40045
40053
  if (ie !== "object")
40046
- return new p("Invalid " + K + " `" + te + "` of type " + ("`" + ie + "` supplied to `" + H + "`, expected an object."));
40054
+ return new p("Invalid " + Z + " `" + te + "` of type " + ("`" + ie + "` supplied to `" + H + "`, expected an object."));
40047
40055
  for (var ue in he)
40048
40056
  if (i(he, ue)) {
40049
- var V = R(he, ue, H, K, te + "." + ue, n);
40057
+ var V = R(he, ue, H, Z, te + "." + ue, n);
40050
40058
  if (V instanceof Error)
40051
40059
  return V;
40052
40060
  }
@@ -40064,9 +40072,9 @@ function BG() {
40064
40072
  "Invalid argument supplied to oneOfType. Expected an array of check functions, but received " + X(W) + " at index " + j + "."
40065
40073
  ), a;
40066
40074
  }
40067
- function T(H, K, te, he, ie) {
40075
+ function T(H, Z, te, he, ie) {
40068
40076
  for (var ue = [], V = 0; V < R.length; V++) {
40069
- var fe = R[V], ae = fe(H, K, te, he, ie, n);
40077
+ var fe = R[V], ae = fe(H, Z, te, he, ie, n);
40070
40078
  if (ae == null)
40071
40079
  return null;
40072
40080
  ae.data && i(ae.data, "expectedType") && ue.push(ae.data.expectedType);
@@ -40077,8 +40085,8 @@ function BG() {
40077
40085
  return v(T);
40078
40086
  }
40079
40087
  function x() {
40080
- function R(j, W, T, H, K) {
40081
- return B(j[W]) ? null : new p("Invalid " + H + " `" + K + "` supplied to " + ("`" + T + "`, expected a ReactNode."));
40088
+ function R(j, W, T, H, Z) {
40089
+ return B(j[W]) ? null : new p("Invalid " + H + " `" + Z + "` supplied to " + ("`" + T + "`, expected a ReactNode."));
40082
40090
  }
40083
40091
  return v(R);
40084
40092
  }
@@ -40088,15 +40096,15 @@ function BG() {
40088
40096
  );
40089
40097
  }
40090
40098
  function I(R) {
40091
- function j(W, T, H, K, te) {
40099
+ function j(W, T, H, Z, te) {
40092
40100
  var he = W[T], ie = Y(he);
40093
40101
  if (ie !== "object")
40094
- return new p("Invalid " + K + " `" + te + "` of type `" + ie + "` " + ("supplied to `" + H + "`, expected `object`."));
40102
+ return new p("Invalid " + Z + " `" + te + "` of type `" + ie + "` " + ("supplied to `" + H + "`, expected `object`."));
40095
40103
  for (var ue in R) {
40096
40104
  var V = R[ue];
40097
40105
  if (typeof V != "function")
40098
- return _(H, K, te, ue, G(V));
40099
- var fe = V(he, ue, H, K, te + "." + ue, n);
40106
+ return _(H, Z, te, ue, G(V));
40107
+ var fe = V(he, ue, H, Z, te + "." + ue, n);
40100
40108
  if (fe)
40101
40109
  return fe;
40102
40110
  }
@@ -40105,21 +40113,21 @@ function BG() {
40105
40113
  return v(j);
40106
40114
  }
40107
40115
  function N(R) {
40108
- function j(W, T, H, K, te) {
40116
+ function j(W, T, H, Z, te) {
40109
40117
  var he = W[T], ie = Y(he);
40110
40118
  if (ie !== "object")
40111
- return new p("Invalid " + K + " `" + te + "` of type `" + ie + "` " + ("supplied to `" + H + "`, expected `object`."));
40119
+ return new p("Invalid " + Z + " `" + te + "` of type `" + ie + "` " + ("supplied to `" + H + "`, expected `object`."));
40112
40120
  var ue = t({}, W[T], R);
40113
40121
  for (var V in ue) {
40114
40122
  var fe = R[V];
40115
40123
  if (i(R, V) && typeof fe != "function")
40116
- return _(H, K, te, V, G(fe));
40124
+ return _(H, Z, te, V, G(fe));
40117
40125
  if (!fe)
40118
40126
  return new p(
40119
- "Invalid " + K + " `" + te + "` key `" + V + "` supplied to `" + H + "`.\nBad object: " + JSON.stringify(W[T], null, " ") + `
40127
+ "Invalid " + Z + " `" + te + "` key `" + V + "` supplied to `" + H + "`.\nBad object: " + JSON.stringify(W[T], null, " ") + `
40120
40128
  Valid keys: ` + JSON.stringify(Object.keys(R), null, " ")
40121
40129
  );
40122
- var ae = fe(he, V, H, K, te + "." + V, n);
40130
+ var ae = fe(he, V, H, Z, te + "." + V, n);
40123
40131
  if (ae)
40124
40132
  return ae;
40125
40133
  }
@@ -41308,7 +41316,7 @@ const jG = /* @__PURE__ */ ci(UG), WG = Q.div`
41308
41316
  }, VG = ({
41309
41317
  handleCloseModal: e
41310
41318
  }) => {
41311
- const [t, n] = le(!1), [i, r] = le(!1), [s, a] = le(!1), { showToast: o } = Fa(), A = qe(
41319
+ const [t, n] = le(!1), [i, r] = le(!1), [s, a] = le(!1), { showToast: o } = Fa(), A = Ve(
41312
41320
  () => [
41313
41321
  {
41314
41322
  label: "Delete chat",
@@ -41371,7 +41379,7 @@ const jG = /* @__PURE__ */ ci(UG), WG = Q.div`
41371
41379
  userJID: w?.xmppUsername
41372
41380
  })
41373
41381
  );
41374
- }, k = qe(
41382
+ }, k = Ve(
41375
41383
  () => (w) => [
41376
41384
  {
41377
41385
  label: "Appoint as an admin",
@@ -41751,7 +41759,7 @@ const az = ({
41751
41759
  });
41752
41760
  }, r = () => {
41753
41761
  t(su(void 0)), e?.();
41754
- }, s = qe(() => {
41762
+ }, s = Ve(() => {
41755
41763
  switch (!0) {
41756
41764
  case n.mimetype.startsWith("image/"):
41757
41765
  return /* @__PURE__ */ g(
@@ -42380,7 +42388,7 @@ const Jb = Q.div`
42380
42388
  ]);
42381
42389
  }, K4 = {
42382
42390
  performLogout: async () => {
42383
- Z.getState().chatSettingStore.user.token;
42391
+ K.getState().chatSettingStore.user.token;
42384
42392
  const e = ea();
42385
42393
  try {
42386
42394
  e?.markIntentionalLogout?.();
@@ -42391,7 +42399,12 @@ const Jb = Q.div`
42391
42399
  window.dispatchEvent(new Event("ethora-xmpp-logout"));
42392
42400
  } catch {
42393
42401
  }
42394
- Z.dispatch(Ah()), Z.dispatch(fh()), Z.dispatch(Lv()), Zs(), Kw();
42402
+ K.dispatch(Ke({ roomJID: null }));
42403
+ try {
42404
+ e?.setActiveRoomJid?.(null);
42405
+ } catch {
42406
+ }
42407
+ K.dispatch(Ah()), K.dispatch(fh()), K.dispatch(Lv()), Zs(), Kw();
42395
42408
  const t = e ? wf(e.disconnect(), 1500) : Promise.resolve(), n = wf(
42396
42409
  YN(),
42397
42410
  2500
@@ -42414,7 +42427,7 @@ const Jb = Q.div`
42414
42427
  t(uh()), e();
42415
42428
  }, []), l = de(() => {
42416
42429
  K4.performLogout();
42417
- }, []), f = qe(
42430
+ }, []), f = Ve(
42418
42431
  () => [
42419
42432
  {
42420
42433
  label: "Log Out",
@@ -42467,7 +42480,7 @@ const Jb = Q.div`
42467
42480
  console.warn("getHistoryStanza failed (non-fatal):", D);
42468
42481
  }
42469
42482
  }
42470
- t(Ze({ roomJID: S.jid })), i({
42483
+ t(Ke({ roomJID: S.jid })), i({
42471
42484
  id: Date.now().toString(),
42472
42485
  title: "Success!",
42473
42486
  message: "Room created succusfully!",
@@ -42526,7 +42539,7 @@ const Jb = Q.div`
42526
42539
  }, [a]), b = a ?? s, k = () => {
42527
42540
  if (o)
42528
42541
  return Xb.find((E) => E.id === o);
42529
- }, w = qe(
42542
+ }, w = Ve(
42530
42543
  () => /* @__PURE__ */ U(je, { children: [
42531
42544
  /* @__PURE__ */ g(
42532
42545
  Wt,
@@ -42592,7 +42605,7 @@ const Jb = Q.div`
42592
42605
  ] })
42593
42606
  ] }),
42594
42607
  [b]
42595
- ), C = qe(
42608
+ ), C = Ve(
42596
42609
  () => /* @__PURE__ */ g(
42597
42610
  Ez,
42598
42611
  {
@@ -42607,7 +42620,7 @@ const Jb = Q.div`
42607
42620
  }, Tz = ({
42608
42621
  handleCloseModal: e
42609
42622
  }) => {
42610
- const t = qe(
42623
+ const t = Ve(
42611
42624
  () => [
42612
42625
  { value: "Manage Data", key: Le.MANAGE_DATA },
42613
42626
  { value: "Visiblility", key: Le.VISIBILITY }
@@ -42958,7 +42971,7 @@ const Jb = Q.div`
42958
42971
  name: d
42959
42972
  }
42960
42973
  };
42961
- }, []), o = e?.messages?.[(e?.messages?.length ?? 0) - 1], A = qe(
42974
+ }, []), o = e?.messages?.[(e?.messages?.length ?? 0) - 1], A = Ve(
42962
42975
  () => a(o),
42963
42976
  [e?.jid, o?.id, o?.body, a]
42964
42977
  ), u = (c) => {
@@ -43116,7 +43129,7 @@ const Jb = Q.div`
43116
43129
  const y = (e || []).find(
43117
43130
  (S) => Zb(S) && S.jid !== f
43118
43131
  )?.jid || null;
43119
- c(Ze({ roomJID: y }));
43132
+ c(Ke({ roomJID: y }));
43120
43133
  }
43121
43134
  }, [f, e, c]);
43122
43135
  const h = de((E) => {
@@ -43131,7 +43144,7 @@ const Jb = Q.div`
43131
43144
  u(E.target.value);
43132
43145
  },
43133
43146
  []
43134
- ), b = qe(() => {
43147
+ ), b = Ve(() => {
43135
43148
  const E = A.toLowerCase(), y = /* @__PURE__ */ new Map();
43136
43149
  if (!y.has(E)) {
43137
43150
  const D = (e || []).filter(
@@ -43157,7 +43170,7 @@ const Jb = Q.div`
43157
43170
  [f, i]
43158
43171
  ), w = de(async () => {
43159
43172
  r && (await r.close(), s(null)), await K4.performLogout();
43160
- }, [r, s]), C = qe(
43173
+ }, [r, s]), C = Ve(
43161
43174
  () => [
43162
43175
  {
43163
43176
  label: "Profile",
@@ -43237,7 +43250,7 @@ const Jb = Q.div`
43237
43250
  )
43238
43251
  ] });
43239
43252
  }, Gz = ({ handleLeaveClick: e, handleReportClick: t }) => {
43240
- const n = qe(
43253
+ const n = Ve(
43241
43254
  () => [
43242
43255
  {
43243
43256
  label: "Report",
@@ -43352,7 +43365,7 @@ const $4 = ({
43352
43365
  }, l = (p) => {
43353
43366
  n(
43354
43367
  lt({ jid: p.jid, updates: { ...p, unreadMessages: 0 } })
43355
- ), n(Ze({ roomJID: p.jid })), n($e({ chatJID: p.jid, loading: !0 }));
43368
+ ), n(Ke({ roomJID: p.jid })), n($e({ chatJID: p.jid, loading: !0 }));
43356
43369
  }, f = de(() => {
43357
43370
  s(!0);
43358
43371
  }, []), d = de(() => {
@@ -43369,10 +43382,10 @@ const $4 = ({
43369
43382
  const v = `${window.location.pathname}`;
43370
43383
  window.history.pushState(null, "", v);
43371
43384
  }
43372
- n(Ze({ roomJID: null })), s(!1);
43385
+ n(Ke({ roomJID: null })), s(!1);
43373
43386
  return;
43374
43387
  }
43375
- n(Ze({ roomJID: p })), s(!1);
43388
+ n(Ke({ roomJID: p })), s(!1);
43376
43389
  }, [o, a, n, i]);
43377
43390
  return /* @__PURE__ */ U(je, { children: [
43378
43391
  /* @__PURE__ */ U(x_, { children: [
@@ -43574,7 +43587,7 @@ const $4 = ({
43574
43587
  s.set("chatId", r);
43575
43588
  const a = `${window.location.pathname}?${s.toString()}`;
43576
43589
  window.history.pushState(null, "", a);
43577
- } else !e && Object.values(t).length > 0 && i(Ze({ roomJID: t[0]?.jid }));
43590
+ } else !e && Object.values(t).length > 0 && i(Ke({ roomJID: t[0]?.jid }));
43578
43591
  return () => {
43579
43592
  if (n?.setRoomJidInPath && typeof window < "u") {
43580
43593
  const r = new URLSearchParams(window.location.search);
@@ -43747,7 +43760,7 @@ const lq = (e) => {
43747
43760
  (I, N) => {
43748
43761
  if (!n || !I || !N) return;
43749
43762
  const B = Date.now(), O = () => {
43750
- const G = Z.getState().rooms.rooms?.[I]?.messages?.find(
43763
+ const G = K.getState().rooms.rooms?.[I]?.messages?.find(
43751
43764
  (X) => X.id === N || X.xmppId === N
43752
43765
  );
43753
43766
  G && G.pending === !1 || (n.presenceInRoomStanza(I, 0, 1200, !0).catch(() => {
@@ -44289,10 +44302,10 @@ const lq = (e) => {
44289
44302
  ), P = de(
44290
44303
  async (W, T, H) => {
44291
44304
  if (!o && !l?.[W]?.historyComplete) {
44292
- const K = typeof H != "string" ? H : Number(
44305
+ const Z = typeof H != "string" ? H : Number(
44293
44306
  l[W].messages[l[W].messages.length - 2].id
44294
44307
  );
44295
- A(!0), i?.getHistoryStanza(W, T, K, void 0, {
44308
+ A(!0), i?.getHistoryStanza(W, T, Z, void 0, {
44296
44309
  source: "active"
44297
44310
  }).then(() => {
44298
44311
  A(!1);
@@ -49080,7 +49093,7 @@ const kV = Q.div`
49080
49093
  color: n,
49081
49094
  onClick: i
49082
49095
  }) => {
49083
- const r = qe(() => {
49096
+ const r = Ve(() => {
49084
49097
  const s = /* @__PURE__ */ new Map();
49085
49098
  return t.forEach((a) => {
49086
49099
  s.has(a.user.id) || s.set(a.user.id, { ...a.user });
@@ -49208,7 +49221,7 @@ const kV = Q.div`
49208
49221
  const r = (a) => {
49209
49222
  const o = jA.emojis[a];
49210
49223
  return o ? o.skins[0].native : "";
49211
- }, s = qe(() => {
49224
+ }, s = Ve(() => {
49212
49225
  if (!e)
49213
49226
  return {};
49214
49227
  const a = {};
@@ -49297,7 +49310,7 @@ const kV = Q.div`
49297
49310
  const A = async () => {
49298
49311
  r(!0), a(null), n(null);
49299
49312
  try {
49300
- const u = "55b9e7f85f2b4e94505e96ef71c55a0e", c = await Ke.get(
49313
+ const u = "55b9e7f85f2b4e94505e96ef71c55a0e", c = await Ze.get(
49301
49314
  `https://api.linkpreview.net/?key=${u}&q=${encodeURIComponent(e)}`
49302
49315
  );
49303
49316
  c.data && (c.data.title || c.data.description || c.data.image) ? n({
@@ -49308,7 +49321,7 @@ const kV = Q.div`
49308
49321
  } catch (u) {
49309
49322
  console.error("Error fetching URL preview via linkpreview.net:", u);
49310
49323
  let c = "Could not load preview";
49311
- Ke.isAxiosError(u) ? c = u.response?.data?.description || u.message || c : u instanceof Error && (c = u.message), a(c), n(null);
49324
+ Ze.isAxiosError(u) ? c = u.response?.data?.description || u.message || c : u instanceof Error && (c = u.message), a(c), n(null);
49312
49325
  } finally {
49313
49326
  r(!1);
49314
49327
  }
@@ -50151,7 +50164,7 @@ const kV = Q.div`
50151
50164
  dispatch: i
50152
50165
  }) => {
50153
50166
  if (e) {
50154
- i(Ze({ roomJID: e }));
50167
+ i(Ke({ roomJID: e }));
50155
50168
  return;
50156
50169
  }
50157
50170
  if (!t && typeof window < "u") {
@@ -50159,7 +50172,7 @@ const kV = Q.div`
50159
50172
  if (s) {
50160
50173
  const o = n.xmppSettings?.conference ?? "", A = `${s}@${o}`;
50161
50174
  a && typeof localStorage < "u" && (localStorage.setItem(rJ, a), localStorage.setItem(sJ, A)), i(
50162
- Ze({
50175
+ Ke({
50163
50176
  roomJID: A
50164
50177
  })
50165
50178
  );
@@ -50189,7 +50202,7 @@ const kV = Q.div`
50189
50202
  Bf.delete(n);
50190
50203
  }
50191
50204
  }, AJ = async (e, t, n = 2) => {
50192
- const i = Date.now(), r = Z.getState().rooms.activeRoomJID, s = (l) => {
50205
+ const i = Date.now(), r = K.getState().rooms.activeRoomJID, s = (l) => {
50193
50206
  if (!l?.messages?.length) return null;
50194
50207
  for (let f = l.messages.length - 1; f >= 0; f -= 1) {
50195
50208
  const d = l.messages[f];
@@ -50200,7 +50213,7 @@ const kV = Q.div`
50200
50213
  }, a = async (l, f) => {
50201
50214
  if (!f?.length) return;
50202
50215
  const d = await sp(f);
50203
- d && d.length > 0 && Z.dispatch(kr({ newUsers: d })), Z.dispatch(
50216
+ d && d.length > 0 && K.dispatch(kr({ newUsers: d })), K.dispatch(
50204
50217
  Bv({
50205
50218
  roomJID: l,
50206
50219
  messages: f
@@ -50209,7 +50222,7 @@ const kV = Q.div`
50209
50222
  }, o = async (l, f) => {
50210
50223
  if (!f?.length) return;
50211
50224
  const d = await sp(f);
50212
- d && d.length > 0 && Z.dispatch(kr({ newUsers: d })), Z.dispatch(
50225
+ d && d.length > 0 && K.dispatch(kr({ newUsers: d })), K.dispatch(
50213
50226
  tT({
50214
50227
  roomJID: l,
50215
50228
  messages: f
@@ -50252,7 +50265,7 @@ const kV = Q.div`
50252
50265
  h.map(async (p, v) => {
50253
50266
  try {
50254
50267
  v > 0 && await new Promise((y) => setTimeout(y, 125));
50255
- const b = Z.getState().rooms.rooms?.[p], k = s(b), w = await t.getHistoryStanza(
50268
+ const b = K.getState().rooms.rooms?.[p], k = s(b), w = await t.getHistoryStanza(
50256
50269
  p,
50257
50270
  20,
50258
50271
  void 0,
@@ -50276,7 +50289,7 @@ const kV = Q.div`
50276
50289
  );
50277
50290
  return;
50278
50291
  }
50279
- ee.log(`[Catchup] anchor_missing room=${p} anchor=${C}`), t.promoteRoomHistory(p), Z.dispatch(
50292
+ ee.log(`[Catchup] anchor_missing room=${p} anchor=${C}`), t.promoteRoomHistory(p), K.dispatch(
50280
50293
  lt({
50281
50294
  jid: p,
50282
50295
  updates: {
@@ -50352,16 +50365,16 @@ const lJ = ({
50352
50365
  const { roomsList: S, activeRoomJID: D } = en(), { user: P } = St(), x = be({}), _ = be({}), I = (T) => {
50353
50366
  x.current[T] = Date.now();
50354
50367
  }, N = (T, H) => {
50355
- const K = x.current[H];
50356
- if (!K) return;
50357
- const te = Date.now() - K;
50368
+ const Z = x.current[H];
50369
+ if (!Z) return;
50370
+ const te = Date.now() - Z;
50358
50371
  _.current[T] = te, ee.log(`[InitTiming] ${T} ${te}ms`);
50359
50372
  }, B = () => {
50360
50373
  v.current || (v.current = setTimeout(() => {
50361
- const T = x.current, H = _.current, K = {};
50374
+ const T = x.current, H = _.current, Z = {};
50362
50375
  Object.keys(H).forEach((te) => {
50363
- K[te] = H[te];
50364
- }), Object.keys(K).length === 0 && [
50376
+ Z[te] = H[te];
50377
+ }), Object.keys(Z).length === 0 && [
50365
50378
  "xmpp:initClient:start",
50366
50379
  "initClient:create_instance:start",
50367
50380
  "initClient:wait_online:start",
@@ -50372,18 +50385,18 @@ const lJ = ({
50372
50385
  "bg:stagedPreload:start",
50373
50386
  "bg:updateMessagesTillLast:start"
50374
50387
  ].forEach((te) => {
50375
- T[te] && (K[te] = Date.now() - T[te]);
50376
- }), ee.log("[InitTiming] startup_summary", K);
50388
+ T[te] && (Z[te] = Date.now() - T[te]);
50389
+ }), ee.log("[InitTiming] startup_summary", Z);
50377
50390
  }, 1e4));
50378
50391
  }, O = async (T, H = 3e4) => {
50379
- const K = Date.now();
50392
+ const Z = Date.now();
50380
50393
  return new Promise((te) => {
50381
50394
  const he = () => {
50382
50395
  if (T?.checkOnline?.()) {
50383
50396
  te(!0);
50384
50397
  return;
50385
50398
  }
50386
- if (Date.now() - K > H) {
50399
+ if (Date.now() - Z > H) {
50387
50400
  te(!1);
50388
50401
  return;
50389
50402
  }
@@ -50392,14 +50405,14 @@ const lJ = ({
50392
50405
  he();
50393
50406
  });
50394
50407
  }, Y = async (T, H = 12e3) => {
50395
- const K = Date.now();
50408
+ const Z = Date.now();
50396
50409
  return new Promise((te) => {
50397
50410
  const he = () => {
50398
50411
  if (T.presencesReady) {
50399
50412
  te(!0);
50400
50413
  return;
50401
50414
  }
50402
- if (Date.now() - K > H) {
50415
+ if (Date.now() - Z > H) {
50403
50416
  te(!1);
50404
50417
  return;
50405
50418
  }
@@ -50409,20 +50422,20 @@ const lJ = ({
50409
50422
  });
50410
50423
  }, G = async (T = 6e3) => {
50411
50424
  const H = Date.now();
50412
- return new Promise((K) => {
50425
+ return new Promise((Z) => {
50413
50426
  const te = () => {
50414
- const he = Z.getState().rooms, ie = he.activeRoomJID, ue = ie ? he.rooms?.[ie] : null;
50427
+ const he = K.getState().rooms, ie = he.activeRoomJID, ue = ie ? he.rooms?.[ie] : null;
50415
50428
  if (!ie || !ue) {
50416
- K(!0);
50429
+ Z(!0);
50417
50430
  return;
50418
50431
  }
50419
50432
  const V = (ue.messages?.length || 0) > 0, fe = ue.historyPreloadState === "done" || ue.historyPreloadState === "error";
50420
50433
  if (!ue.isLoading || V || fe) {
50421
- K(!0);
50434
+ Z(!0);
50422
50435
  return;
50423
50436
  }
50424
50437
  if (Date.now() - H > T) {
50425
- K(!1);
50438
+ Z(!1);
50426
50439
  return;
50427
50440
  }
50428
50441
  setTimeout(te, 120);
@@ -50483,25 +50496,25 @@ const lJ = ({
50483
50496
  if (await G(), te) {
50484
50497
  const fe = (n?.defaultRooms || []).map(
50485
50498
  (Pe) => Pe.jid
50486
- ), De = !!Z.getState().rooms.activeRoomJID ? 1 : ue;
50499
+ ), De = !!K.getState().rooms.activeRoomJID ? 1 : ue;
50487
50500
  await ud({
50488
50501
  client: T,
50489
50502
  concurrency: De,
50490
50503
  pageSize: he,
50491
50504
  retryLimit: 2,
50492
50505
  roomLimit: V,
50493
- selectedRoomJid: Z.getState().rooms.activeRoomJID || null,
50506
+ selectedRoomJid: K.getState().rooms.activeRoomJID || null,
50494
50507
  defaultRoomJids: fe
50495
50508
  }), await ud({
50496
50509
  client: T,
50497
50510
  concurrency: ue,
50498
50511
  pageSize: ie,
50499
50512
  retryLimit: 2,
50500
- selectedRoomJid: Z.getState().rooms.activeRoomJID || null,
50513
+ selectedRoomJid: K.getState().rooms.activeRoomJID || null,
50501
50514
  defaultRoomJids: fe
50502
50515
  });
50503
50516
  } else {
50504
- const fe = Z.getState().rooms.rooms || {}, ae = Z.getState().rooms.activeRoomJID ? 1 : 2;
50517
+ const fe = K.getState().rooms.rooms || {}, ae = K.getState().rooms.activeRoomJID ? 1 : 2;
50505
50518
  await AJ(fe, T, ae);
50506
50519
  }
50507
50520
  f.current = !0, te ? N("bg:stagedPreload", "bg:stagedPreload:start") : N("bg:updateMessagesTillLast", "bg:updateMessagesTillLast:start");
@@ -50518,7 +50531,7 @@ const lJ = ({
50518
50531
  }, [b, w, P.xmppPassword]), ge(() => {
50519
50532
  i(Tv(n));
50520
50533
  const { changed: T } = Zw(n);
50521
- T && (f.current = !1, d.current.clear(), h.current.clear(), p.current.clear(), i(fh()), i(Lv()), i(Ze({ roomJID: null })), dr.pause(), dr.purge().catch((H) => {
50534
+ T && (f.current = !1, d.current.clear(), h.current.clear(), p.current.clear(), i(fh()), i(Lv()), i(Ke({ roomJID: null })), dr.pause(), dr.purge().catch((H) => {
50522
50535
  console.warn("[CacheScope] Persist purge failed", H);
50523
50536
  }).finally(() => {
50524
50537
  dr.persist();
@@ -50539,8 +50552,8 @@ const lJ = ({
50539
50552
  !H && i(
50540
50553
  $e({ loading: !0, loadingText: "Loading chats..." })
50541
50554
  ), I("loadRooms:start");
50542
- const K = await y(T, n);
50543
- return N("loadRooms", "loadRooms:start"), await T.sendAllPresencesAndMarkReady(), i($e({ loading: !1, loadingText: void 0 })), K;
50555
+ const Z = await y(T, n);
50556
+ return N("loadRooms", "loadRooms:start"), await T.sendAllPresencesAndMarkReady(), i($e({ loading: !1, loadingText: void 0 })), Z;
50544
50557
  }, j = de((T) => {
50545
50558
  if (!T) return "";
50546
50559
  if (T.jid) return T.jid;
@@ -50549,9 +50562,9 @@ const lJ = ({
50549
50562
  }, [n?.xmppSettings?.conference]), W = de((T) => {
50550
50563
  const H = (T || []).map(j).filter(Boolean);
50551
50564
  if (H.length === 0) return;
50552
- const K = e || null;
50553
- if (K && H.includes(K)) {
50554
- D !== K && i(Ze({ roomJID: K }));
50565
+ const Z = e || null;
50566
+ if (Z && H.includes(Z)) {
50567
+ D !== Z && i(Ke({ roomJID: Z }));
50555
50568
  return;
50556
50569
  }
50557
50570
  D && H.includes(D);
@@ -50564,18 +50577,18 @@ const lJ = ({
50564
50577
  if (P.xmppUsername)
50565
50578
  if (aJ({ roomJID: e, wasAutoSelected: t, config: n, dispatch: i }), b) {
50566
50579
  if (n?.newArch !== !1) {
50567
- let K = [];
50580
+ let Z = [];
50568
50581
  if (!S || Object.keys(S).length === 0) {
50569
50582
  s(!1);
50570
50583
  const te = await R(b);
50571
- W(te), K = Array.isArray(te) ? te : [];
50584
+ W(te), Z = Array.isArray(te) ? te : [];
50572
50585
  } else
50573
- W(Object.values(S)), K = Object.values(S), R(b, !0).catch((te) => {
50586
+ W(Object.values(S)), Z = Object.values(S), R(b, !0).catch((te) => {
50574
50587
  ee.log("background loadRooms failed", te);
50575
50588
  });
50576
50589
  n?.enableRoomsRetry?.enabled && (Vd(
50577
50590
  e,
50578
- K
50591
+ Z
50579
50592
  ) || await $());
50580
50593
  }
50581
50594
  s(!0), w(b), u(!1), i($e({ loading: !1 })), B(), X(b), n?.refreshTokens?.enabled && Kf();
@@ -50600,7 +50613,7 @@ const lJ = ({
50600
50613
  ), s(!1), o(!1), i(
50601
50614
  $e({ loading: !0, loadingText: "Connecting..." })
50602
50615
  ), ee.log("No client, so initing one"), I("xmpp:initClient:start"), I("initClient:create_instance:start"), I("initClient:wait_online:start");
50603
- const K = await k(
50616
+ const Z = await k(
50604
50617
  P.xmppUsername || P?.defaultWallet?.walletAddress,
50605
50618
  P?.xmppPassword,
50606
50619
  {
@@ -50611,21 +50624,21 @@ const lJ = ({
50611
50624
  S
50612
50625
  ).then((te) => te);
50613
50626
  if (N("xmpp:initClient", "xmpp:initClient:start"), N("initClient:create_instance", "initClient:create_instance:start"), S && Object.keys(S).length > 0)
50614
- s(!0), n?.newArch !== !1 && R(K, !0).catch((te) => {
50627
+ s(!0), n?.newArch !== !1 && R(Z, !0).catch((te) => {
50615
50628
  ee.log("background loadRooms failed", te);
50616
50629
  });
50617
50630
  else if (n?.newArch === !1)
50618
- I("xmpp:getRoomsStanza:start"), await K.getRoomsStanza(), N("xmpp:getRoomsStanza", "xmpp:getRoomsStanza:start");
50631
+ I("xmpp:getRoomsStanza:start"), await Z.getRoomsStanza(), N("xmpp:getRoomsStanza", "xmpp:getRoomsStanza:start");
50619
50632
  else {
50620
- const te = await R(K);
50633
+ const te = await R(Z);
50621
50634
  W(te), n?.enableRoomsRetry?.enabled && (Vd(
50622
50635
  e,
50623
50636
  te
50624
50637
  ) || await $()), s(!0);
50625
50638
  }
50626
- w(K), u(!1), i($e({ loading: !1 })), B(), X(K), n?.refreshTokens?.enabled && Kf();
50627
- } catch (K) {
50628
- ee.log("err", K), u(!0), T = setTimeout(H, 5e3);
50639
+ w(Z), u(!1), i($e({ loading: !1 })), B(), X(Z), n?.refreshTokens?.enabled && Kf();
50640
+ } catch (Z) {
50641
+ ee.log("err", Z), u(!0), T = setTimeout(H, 5e3);
50629
50642
  }
50630
50643
  }
50631
50644
  else {
@@ -50633,8 +50646,8 @@ const lJ = ({
50633
50646
  return;
50634
50647
  }
50635
50648
  i($e({ loading: !1 }));
50636
- } catch (K) {
50637
- o(!1), u(!0), s(!1), i($e({ loading: !1 })), ee.log(K), T = setTimeout(H, 5e3);
50649
+ } catch (Z) {
50650
+ o(!1), u(!0), s(!1), i($e({ loading: !1 })), ee.log(Z), T = setTimeout(H, 5e3);
50638
50651
  }
50639
50652
  };
50640
50653
  return H(), () => {
@@ -50718,7 +50731,7 @@ const lJ = ({
50718
50731
  roomJID: n
50719
50732
  }) => {
50720
50733
  const { CustomMessageComponent: i } = Ru(), r = i || VV, { user: s, activeModal: a, deleteModal: o } = St(), [A, u] = le(!1), [c, l] = le(!1), [f, d] = le(!0), h = t?.xmppSettings?.conference, p = Fe(), { wasAutoSelected: v } = iJ(
50721
- (T) => p(Ze(T)),
50734
+ (T) => p(Ke(T)),
50722
50735
  h
50723
50736
  );
50724
50737
  ge(() => {
@@ -50735,13 +50748,13 @@ const lJ = ({
50735
50748
  u(T);
50736
50749
  }, k = we((T) => T.rooms.rooms), w = we((T) => T.rooms.activeRoomJID), C = we((T) => T.rooms.isLoading), E = we(
50737
50750
  (T) => !!T.rooms?.reportRoom?.isOpen
50738
- ), { loadingText: y } = en(), S = qe(() => {
50751
+ ), { loadingText: y } = en(), S = Ve(() => {
50739
50752
  if (w)
50740
50753
  return k[w]?.messages?.find(
50741
50754
  (T) => T?.activeMessage
50742
50755
  );
50743
50756
  }, [k, w]), D = (T) => {
50744
- p(Ze({ roomJID: null })), p($e({ chatJID: T.jid, loading: !0 })), p(Ze({ roomJID: T.jid })), p(ui({ isEdit: !1 })), _?.promoteRoomHistory(T.jid), b(!0), !T?.historyComplete && T.messages?.length < 30 && _?.getHistoryStanza(T.jid, 30, void 0, void 0, {
50757
+ p(Ke({ roomJID: null })), p($e({ chatJID: T.jid, loading: !0 })), p(Ke({ roomJID: T.jid })), p(ui({ isEdit: !1 })), _?.promoteRoomHistory(T.jid), b(!0), !T?.historyComplete && T.messages?.length < 30 && _?.getHistoryStanza(T.jid, 30, void 0, void 0, {
50745
50758
  source: "active",
50746
50759
  coalesceRoom: !0,
50747
50760
  skipIfPreloaded: !0
@@ -50766,12 +50779,12 @@ const lJ = ({
50766
50779
  if (typeof window > "u") return;
50767
50780
  const T = window.location.pathname, H = () => {
50768
50781
  const te = window.location.pathname === T;
50769
- d(te), !te && w && p(Ze({ roomJID: null }));
50782
+ d(te), !te && w && p(Ke({ roomJID: null }));
50770
50783
  };
50771
50784
  H();
50772
- const K = window.setInterval(H, 250);
50785
+ const Z = window.setInterval(H, 250);
50773
50786
  return window.addEventListener("popstate", H), window.addEventListener("hashchange", H), () => {
50774
- window.clearInterval(K), window.removeEventListener("popstate", H), window.removeEventListener("hashchange", H);
50787
+ window.clearInterval(Z), window.removeEventListener("popstate", H), window.removeEventListener("hashchange", H);
50775
50788
  };
50776
50789
  }, [w, p]), B ? /* @__PURE__ */ g(
50777
50790
  P6,
@@ -51384,7 +51397,7 @@ const UJ = JA(void 0), jJ = 3, WJ = 3e4, YJ = ({ children: e, config: t }) => {
51384
51397
  });
51385
51398
  return;
51386
51399
  }
51387
- I && (s(Ze({ roomJID: I })), setTimeout(() => {
51400
+ I && (s(Ke({ roomJID: I })), setTimeout(() => {
51388
51401
  const X = document.querySelector(`[data-message-id="${N}"]`);
51389
51402
  X && (X.scrollIntoView({ behavior: "smooth", block: "center" }), X.classList.add("message-highlight"), setTimeout(() => X.classList.remove("message-highlight"), 2e3));
51390
51403
  }, 100));
@@ -51489,7 +51502,7 @@ const UJ = JA(void 0), jJ = 3, WJ = 3e4, YJ = ({ children: e, config: t }) => {
51489
51502
  return ge(() => () => {
51490
51503
  }, []), {
51491
51504
  navigateToMessage: (t, n) => {
51492
- e(Ze({ roomJID: t })), setTimeout(() => {
51505
+ e(Ke({ roomJID: t })), setTimeout(() => {
51493
51506
  const i = document.querySelector(
51494
51507
  `[data-message-id="${n}"]`
51495
51508
  );
@@ -51529,11 +51542,11 @@ const UJ = JA(void 0), jJ = 3, WJ = 3e4, YJ = ({ children: e, config: t }) => {
51529
51542
  CustomNewMessageLabel: r,
51530
51543
  ...s
51531
51544
  }) => {
51532
- const a = qe(() => s.config ? {
51545
+ const a = Ve(() => s.config ? {
51533
51546
  ...s.config,
51534
51547
  newArch: s.config.newArch ?? !0
51535
51548
  } : s.config, [s.config]);
51536
- return /* @__PURE__ */ g(H2, { store: Z, children: /* @__PURE__ */ g(M6, { loading: /* @__PURE__ */ g(Xt, {}), persistor: dr, children: /* @__PURE__ */ g(bG, { children: /* @__PURE__ */ U(YJ, { config: a, children: [
51549
+ return /* @__PURE__ */ g(H2, { store: K, children: /* @__PURE__ */ g(M6, { loading: /* @__PURE__ */ g(Xt, {}), persistor: dr, children: /* @__PURE__ */ g(bG, { children: /* @__PURE__ */ U(YJ, { config: a, children: [
51537
51550
  /* @__PURE__ */ g(zJ, {}),
51538
51551
  /* @__PURE__ */ g(qJ, { config: a }),
51539
51552
  /* @__PURE__ */ g(
@@ -51570,34 +51583,34 @@ const UJ = JA(void 0), jJ = 3, WJ = 3e4, YJ = ({ children: e, config: t }) => {
51570
51583
  };
51571
51584
  }, Q2 = (e) => Object.entries(e || {}).map(([n, i]) => `${n}:${Number(i?.unreadMessages || 0)}:${i?.unreadCapped ? 1 : 0}`).sort().join("|"), SX = () => {
51572
51585
  const [e, t] = le(
51573
- () => F2(Z.getState().rooms.rooms)
51586
+ () => F2(K.getState().rooms.rooms)
51574
51587
  ), n = be(
51575
- Q2(Z.getState().rooms.rooms)
51588
+ Q2(K.getState().rooms.rooms)
51576
51589
  );
51577
- return ge(() => Z.subscribe(() => {
51578
- const r = Z.getState().rooms.rooms, s = Q2(r);
51590
+ return ge(() => K.subscribe(() => {
51591
+ const r = K.getState().rooms.rooms, s = Q2(r);
51579
51592
  n.current !== s && (n.current = s, t(F2(r)));
51580
- }), []), qe(() => e, [e]);
51593
+ }), []), Ve(() => e, [e]);
51581
51594
  };
51582
51595
  async function NX(e, t = {}) {
51583
- const n = y8(), i = Z.getState(), r = i.chatSettingStore.user, s = i.chatSettingStore.config, a = e.roomJid, o = e.originalMessageId;
51596
+ const n = y8(), i = K.getState(), r = i.chatSettingStore.user, s = i.chatSettingStore.config, a = e.roomJid, o = e.originalMessageId;
51584
51597
  try {
51585
51598
  n.deleteMessageStanza(a, o);
51586
51599
  } catch (f) {
51587
51600
  console.warn("Failed to send delete stanza for original message:", f);
51588
51601
  }
51589
51602
  try {
51590
- Z.dispatch(
51603
+ K.dispatch(
51591
51604
  lh({ roomJID: a, messageId: o })
51592
51605
  );
51593
51606
  } catch {
51594
51607
  }
51595
51608
  try {
51596
- Z.dispatch(Ov(o));
51609
+ K.dispatch(Ov(o));
51597
51610
  } catch {
51598
51611
  }
51599
51612
  const A = `resend-text-message-${eA()}`, u = Date.now(), c = new Date(u).toISOString();
51600
- Z.dispatch(
51613
+ K.dispatch(
51601
51614
  fr({
51602
51615
  roomJID: a,
51603
51616
  message: {