@bcc-code/vue-bcc-chat-ui 7.1.2 → 7.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,15 +1,15 @@
1
- import { Fragment as e, Teleport as t, computed as n, createBlock as r, createCommentVNode as i, createElementBlock as a, createElementVNode as o, createSlots as s, createTextVNode as c, createVNode as l, defineComponent as u, guardReactiveProps as d, inject as f, isRef as p, mergeModels as m, nextTick as h, normalizeClass as g, normalizeProps as _, normalizeStyle as v, onBeforeUnmount as y, onMounted as b, onUnmounted as x, openBlock as S, provide as C, ref as w, renderList as T, renderSlot as E, resolveDynamicComponent as D, shallowRef as O, toDisplayString as k, toValue as A, unref as j, useModel as ee, useTemplateRef as te, vModelText as M, vShow as N, watch as P, withCtx as F, withDirectives as ne, withModifiers as I } from "vue";
2
- import { BccAvatar as L, BccButton as R, BccDialog as re, BccImage as z, BccInput as ie, BccInputText as ae, BccMenu as B, BccMessage as oe, BccProgressSpinner as V, BccTag as se } from "@bcc-code/component-library-vue";
3
- import { CometChat as H } from "@cometchat/chat-sdk-javascript";
1
+ import { Fragment as e, Teleport as t, computed as n, createBlock as r, createCommentVNode as i, createElementBlock as a, createElementVNode as o, createSlots as s, createTextVNode as c, createVNode as l, defineComponent as u, guardReactiveProps as d, inject as f, isRef as p, mergeModels as m, nextTick as h, normalizeClass as g, normalizeProps as _, normalizeStyle as v, onBeforeUnmount as y, onMounted as b, onUnmounted as x, openBlock as S, provide as C, ref as w, renderList as T, renderSlot as E, resolveDynamicComponent as D, shallowRef as O, toDisplayString as k, toValue as A, unref as j, useModel as M, useTemplateRef as ee, vModelText as N, vShow as P, watch as F, withCtx as I, withDirectives as te, withModifiers as L } from "vue";
2
+ import { BccAvatar as R, BccButton as z, BccDialog as ne, BccImage as B, BccInput as re, BccInputText as ie, BccMenu as V, BccMessage as ae, BccProgressSpinner as H, BccTag as oe } from "@bcc-code/component-library-vue";
3
+ import { CometChat as U } from "@cometchat/chat-sdk-javascript";
4
4
  //#region \0rolldown/runtime.js
5
- var ce = Object.defineProperty, le = (e, t) => {
5
+ var se = Object.defineProperty, ce = (e, t) => {
6
6
  let n = {};
7
- for (var r in e) ce(n, r, {
7
+ for (var r in e) se(n, r, {
8
8
  get: e[r],
9
9
  enumerable: !0
10
10
  });
11
- return t || ce(n, Symbol.toStringTag, { value: "Module" }), n;
12
- }, ue = {
11
+ return t || se(n, Symbol.toStringTag, { value: "Module" }), n;
12
+ }, le = {
13
13
  prod: {
14
14
  region: "eu",
15
15
  appId: "2520339d45a9d557",
@@ -20,62 +20,62 @@ var ce = Object.defineProperty, le = (e, t) => {
20
20
  appId: "24847302853e129f",
21
21
  chatApiBaseUrl: "https://chat.api.sandbox.bcc.no"
22
22
  }
23
- }, de = null;
24
- function fe(e) {
25
- de = e;
23
+ }, ue = null;
24
+ function de(e) {
25
+ ue = e;
26
26
  }
27
- function U() {
28
- if (!de) throw Error("Environment has not been set yet. Call setCurrentEnvironment(...) first.");
29
- return ue[de];
27
+ function W() {
28
+ if (!ue) throw Error("Environment has not been set yet. Call setCurrentEnvironment(...) first.");
29
+ return le[ue];
30
30
  }
31
31
  //#endregion
32
32
  //#region src/chat/accessToken.ts
33
- var pe = ":loginAccessToken", me = ":token", he = void 0;
34
- function ge(e) {
35
- return `${U().appId}${e}`;
33
+ var fe = ":loginAccessToken", pe = ":token", me = void 0;
34
+ function he(e) {
35
+ return `${W().appId}${e}`;
36
36
  }
37
- function _e() {
38
- return he === void 0 && (he = localStorage.getItem(ge(pe))), he;
37
+ function ge() {
38
+ return me === void 0 && (me = localStorage.getItem(he(fe))), me;
39
39
  }
40
- function ve(e) {
41
- he = e;
42
- let t = ge(pe);
40
+ function _e(e) {
41
+ me = e;
42
+ let t = he(fe);
43
43
  if (e) {
44
44
  localStorage.setItem(t, e);
45
45
  return;
46
46
  }
47
47
  localStorage.removeItem(t);
48
48
  }
49
- function ye() {
50
- let e = ge(me), t = localStorage.getItem(e);
49
+ function ve() {
50
+ let e = he(pe), t = localStorage.getItem(e);
51
51
  return t ? JSON.parse(t) : null;
52
52
  }
53
- function be() {
54
- return ye();
53
+ function ye() {
54
+ return ve();
55
55
  }
56
- function xe(e) {
57
- localStorage.setItem(ge(me), JSON.stringify(e));
56
+ function be(e) {
57
+ localStorage.setItem(he(pe), JSON.stringify(e));
58
58
  }
59
- function Se() {
60
- localStorage.removeItem(ge(me));
59
+ function xe() {
60
+ localStorage.removeItem(he(pe));
61
61
  }
62
62
  //#endregion
63
63
  //#region src/chat/avatar.ts
64
- function Ce(e) {
65
- let t = Te(e);
64
+ function Se(e) {
65
+ let t = we(e);
66
66
  if (!t) return;
67
67
  let n = t.trim();
68
68
  if (n) {
69
69
  try {
70
- if (Ee(new URL(n))) return `${U().chatApiBaseUrl}/file-proxy?uri=${encodeURIComponent(n)}`;
70
+ if (Te(new URL(n))) return `${W().chatApiBaseUrl}/file-proxy?uri=${encodeURIComponent(n)}`;
71
71
  } catch {}
72
72
  return n;
73
73
  }
74
74
  }
75
- function we(e) {
76
- return Ce(e) ?? e;
75
+ function Ce(e) {
76
+ return Se(e) ?? e;
77
77
  }
78
- function Te(e) {
78
+ function we(e) {
79
79
  if (typeof e == "string") return e;
80
80
  if (!e || typeof e != "object") return;
81
81
  let t = e, n = [
@@ -93,36 +93,36 @@ function Te(e) {
93
93
  t.avatar,
94
94
  t.image
95
95
  ].find((e) => e && typeof e == "object");
96
- if (r) return Te(r);
96
+ if (r) return we(r);
97
97
  }
98
- function Ee(e) {
99
- let { appId: t, region: n } = U(), r = `data-${n}.cometchat.io`, i = `/${t}/`;
98
+ function Te(e) {
99
+ let { appId: t, region: n } = W(), r = `data-${n}.cometchat.io`, i = `/${t}/`;
100
100
  return e.hostname.toLowerCase() === r.toLowerCase() && e.pathname.startsWith(i);
101
101
  }
102
102
  //#endregion
103
103
  //#region src/chat/cacheScope.ts
104
- var De = ":chatCacheScope", Oe = ":chatCacheOwner", ke, Ae;
105
- function je(e) {
106
- return `${U().appId}${e}`;
104
+ var Ee = ":chatCacheScope", De = ":chatCacheOwner", Oe, ke;
105
+ function Ae(e) {
106
+ return `${W().appId}${e}`;
107
107
  }
108
- function Me() {
108
+ function je() {
109
109
  return typeof crypto < "u" && typeof crypto.randomUUID == "function" ? crypto.randomUUID() : `${Date.now()}-${Math.random().toString(36).slice(2)}`;
110
110
  }
111
- function Ne() {
112
- return ke === void 0 && (ke = localStorage.getItem(je(De))), ke;
111
+ function Me() {
112
+ return Oe === void 0 && (Oe = localStorage.getItem(Ae(Ee))), Oe;
113
113
  }
114
- function Pe() {
115
- return Ae === void 0 && (Ae = localStorage.getItem(je(Oe))), Ae;
114
+ function Ne() {
115
+ return ke === void 0 && (ke = localStorage.getItem(Ae(De))), ke;
116
116
  }
117
- function Fe(e) {
118
- let t = Ne(), n = Pe();
117
+ function Pe(e) {
118
+ let t = Me(), n = Ne();
119
119
  if (t && n === e) return t;
120
- let r = Me();
121
- return ke = r, Ae = e, localStorage.setItem(je(De), r), localStorage.setItem(je(Oe), e), r;
120
+ let r = je();
121
+ return Oe = r, ke = e, localStorage.setItem(Ae(Ee), r), localStorage.setItem(Ae(De), e), r;
122
122
  }
123
123
  //#endregion
124
124
  //#region src/chat/localization.ts
125
- var Ie = {
125
+ var Fe = {
126
126
  en: {
127
127
  addOption: "Add option",
128
128
  addToMessage: "Add to message",
@@ -205,6 +205,7 @@ var Ie = {
205
205
  reply: "Reply",
206
206
  replying: "Replying",
207
207
  replyingInContext: ({ context: e }) => e ? `Replying in ${e}` : "Replying",
208
+ remove: "Remove",
208
209
  reschedule: "Reschedule",
209
210
  save: "Save",
210
211
  saveMessage: "Save message",
@@ -323,6 +324,7 @@ var Ie = {
323
324
  reply: "Svar",
324
325
  replying: "Svarer",
325
326
  replyingInContext: ({ context: e }) => e ? `Svarer i ${e}` : "Svarer",
327
+ remove: "Fjern",
326
328
  reschedule: "Planlegg på nytt",
327
329
  save: "Lagre",
328
330
  saveMessage: "Lagre melding",
@@ -359,102 +361,102 @@ var Ie = {
359
361
  you: "Du",
360
362
  youSentAMessage: "Du sendte en melding"
361
363
  }
362
- }, Le = w("en");
363
- function Re(e) {
364
+ }, Ie = w("en");
365
+ function Le(e) {
364
366
  return e === "nb" || e === "no" ? "nb" : "en";
365
367
  }
366
- function W(e) {
367
- return Re(e) === "nb" ? "nb-NO" : "en-US";
368
+ function G(e) {
369
+ return Le(e) === "nb" ? "nb-NO" : "en-US";
368
370
  }
369
- function ze() {
371
+ function Re() {
370
372
  return "h23";
371
373
  }
372
- function Be(e) {
373
- Le.value = e;
374
+ function ze(e) {
375
+ Ie.value = e;
374
376
  }
375
- function G(e, t, n) {
376
- let r = Ie[Re(n ?? Le.value)][e] ?? Ie.en[e];
377
+ function K(e, t, n) {
378
+ let r = Fe[Le(n ?? Ie.value)][e] ?? Fe.en[e];
377
379
  return typeof r == "function" ? r(t ?? {}) : r;
378
380
  }
379
- function K(e) {
380
- let t = n(() => A(e) ?? Le.value);
381
+ function q(e) {
382
+ let t = n(() => A(e) ?? Ie.value);
381
383
  return {
382
- locale: n(() => W(t.value)),
383
- t: (e, n) => G(e, n, t.value)
384
+ locale: n(() => G(t.value)),
385
+ t: (e, n) => K(e, n, t.value)
384
386
  };
385
387
  }
386
388
  //#endregion
387
389
  //#region src/chat/mentions.ts
388
- var Ve = /<@uid:([^>]+)>/g, He = /&lt;@uid:([^&]+)&gt;/g, Ue = "mention:", We = "", Ge = "data-mention-uid", Ke = "composer-mention", qe = "message-mention";
389
- function Je(e) {
390
+ var Be = /<@uid:([^>]+)>/g, Ve = /&lt;@uid:([^&]+)&gt;/g, He = "mention:", Ue = "", We = "data-mention-uid", Ge = "composer-mention", Ke = "message-mention";
391
+ function qe(e) {
390
392
  return {
391
393
  uid: e.uid,
392
394
  displayName: e.displayName,
393
395
  avatar: e.avatar
394
396
  };
395
397
  }
396
- function Ye(e) {
398
+ function Je(e) {
397
399
  let t = {};
398
400
  for (let n of e) t[n.uid] = n.displayName;
399
401
  return t;
400
402
  }
401
- function Xe(e, t, n = 8) {
403
+ function Ye(e, t, n = 8) {
402
404
  let r = t.trim().toLowerCase(), i = e.filter((e) => e.displayName.trim().length > 0);
403
405
  return r ? i.filter((e) => {
404
406
  let t = e.displayName.toLowerCase(), n = e.uid.toLowerCase();
405
407
  return t.includes(r) || n.includes(r);
406
408
  }).slice(0, n) : i.slice(0, n);
407
409
  }
408
- function Ze(e) {
410
+ function Xe(e) {
409
411
  return `<@uid:${e}>`;
410
412
  }
413
+ function Ze(e) {
414
+ return e.replace(Ve, (e, t) => Xe(t));
415
+ }
411
416
  function Qe(e) {
412
- return e.replace(He, (e, t) => Ze(t));
417
+ return Be.lastIndex = 0, Ve.lastIndex = 0, Be.test(e) || Ve.test(e);
413
418
  }
414
419
  function $e(e) {
415
- return Ve.lastIndex = 0, He.lastIndex = 0, Ve.test(e) || He.test(e);
416
- }
417
- function et(e) {
418
420
  let t = [];
419
421
  return {
420
- shielded: Qe(e).replace(Ve, (e) => `${Ue}${t.push(e) - 1}${We}`),
422
+ shielded: Ze(e).replace(Be, (e) => `${He}${t.push(e) - 1}${Ue}`),
421
423
  tokens: t
422
424
  };
423
425
  }
424
- function tt(e, t) {
425
- let n = RegExp(`${Ue.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")}(\\d+)${We.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")}`, "g");
426
+ function et(e, t) {
427
+ let n = RegExp(`${He.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")}(\\d+)${Ue.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")}`, "g");
426
428
  return e.replace(n, (e, n) => t[Number(n)] ?? "");
427
429
  }
428
- function nt(e, t, n = qe) {
429
- return e.replace(Ve, (e, r) => {
430
+ function tt(e, t, n = Ke) {
431
+ return e.replace(Be, (e, r) => {
430
432
  let i = t(r).trim() || r;
431
- return `<span class="${n}" ${Ge}="${dt(r)}">@${ft(i)}</span>`;
433
+ return `<span class="${n}" ${We}="${ut(r)}">@${dt(i)}</span>`;
432
434
  });
433
435
  }
434
- function rt(e, t = {}) {
435
- return nt(e, (e) => t[e] ?? e, Ke);
436
+ function nt(e, t = {}) {
437
+ return tt(e, (e) => t[e] ?? e, Ge);
436
438
  }
437
- function it(e, t = {}) {
438
- return nt(e, (e) => t[e] ?? e, qe);
439
+ function rt(e, t = {}) {
440
+ return tt(e, (e) => t[e] ?? e, Ke);
439
441
  }
440
- function at(e) {
442
+ function it(e) {
441
443
  if (!e) return "";
442
444
  let t = new DOMParser().parseFromString(`<div>${e}</div>`, "text/html"), n = t.body.firstElementChild;
443
445
  if (!n) return e;
444
- for (let e of [...n.querySelectorAll(`span[${Ge}]`)]) {
445
- let n = e.getAttribute(Ge);
446
- n && e.replaceWith(t.createTextNode(Ze(n)));
446
+ for (let e of [...n.querySelectorAll(`span[${We}]`)]) {
447
+ let n = e.getAttribute(We);
448
+ n && e.replaceWith(t.createTextNode(Xe(n)));
447
449
  }
448
- return ot(n.innerHTML);
450
+ return at(n.innerHTML);
449
451
  }
450
- function ot(e) {
452
+ function at(e) {
451
453
  return e.replace(/&lt;@uid:([^&]+)&gt;/g, "<@uid:$1>");
452
454
  }
453
- var st = /@([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})/gi;
454
- function ct(e, t, n = "member") {
455
+ var ot = /@([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})/gi;
456
+ function st(e, t, n = "member") {
455
457
  return t[e]?.trim() || n;
456
458
  }
457
- function lt(e) {
459
+ function ct(e) {
458
460
  let t = e, n = {};
459
461
  for (let e of t?.getMentionedUsers?.() ?? []) {
460
462
  let t = e.getUid?.(), r = e.getName?.()?.trim();
@@ -462,26 +464,26 @@ function lt(e) {
462
464
  }
463
465
  return n;
464
466
  }
465
- function ut(e, t = {}) {
466
- return Qe(e).replace(Ve, (e, n) => `@${ct(n, t)}`).replace(st, (e, n) => `@${ct(n, t)}`);
467
+ function lt(e, t = {}) {
468
+ return Ze(e).replace(Be, (e, n) => `@${st(n, t)}`).replace(ot, (e, n) => `@${st(n, t)}`);
467
469
  }
468
- function dt(e) {
470
+ function ut(e) {
469
471
  return e.replace(/&/g, "&amp;").replace(/"/g, "&quot;").replace(/</g, "&lt;");
470
472
  }
471
- function ft(e) {
473
+ function dt(e) {
472
474
  return e.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
473
475
  }
474
476
  //#endregion
475
477
  //#region node_modules/dompurify/dist/purify.es.mjs
476
- function pt(e, t) {
478
+ function ft(e, t) {
477
479
  (t == null || t > e.length) && (t = e.length);
478
480
  for (var n = 0, r = Array(t); n < t; n++) r[n] = e[n];
479
481
  return r;
480
482
  }
481
- function mt(e) {
483
+ function pt(e) {
482
484
  if (Array.isArray(e)) return e;
483
485
  }
484
- function ht(e, t) {
486
+ function mt(e, t) {
485
487
  var n = e == null ? null : typeof Symbol < "u" && e[Symbol.iterator] || e["@@iterator"];
486
488
  if (n != null) {
487
489
  var r, i, a, o, s = [], c = !0, l = !1;
@@ -499,99 +501,99 @@ function ht(e, t) {
499
501
  return s;
500
502
  }
501
503
  }
502
- function gt() {
504
+ function ht() {
503
505
  throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
504
506
  }
505
- function _t(e, t) {
506
- return mt(e) || ht(e, t) || vt(e, t) || gt();
507
+ function gt(e, t) {
508
+ return pt(e) || mt(e, t) || _t(e, t) || ht();
507
509
  }
508
- function vt(e, t) {
510
+ function _t(e, t) {
509
511
  if (e) {
510
- if (typeof e == "string") return pt(e, t);
512
+ if (typeof e == "string") return ft(e, t);
511
513
  var n = {}.toString.call(e).slice(8, -1);
512
- return n === "Object" && e.constructor && (n = e.constructor.name), n === "Map" || n === "Set" ? Array.from(e) : n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) ? pt(e, t) : void 0;
514
+ return n === "Object" && e.constructor && (n = e.constructor.name), n === "Map" || n === "Set" ? Array.from(e) : n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) ? ft(e, t) : void 0;
513
515
  }
514
516
  }
515
- var yt = Object.entries, bt = Object.setPrototypeOf, xt = Object.isFrozen, St = Object.getPrototypeOf, Ct = Object.getOwnPropertyDescriptor, wt = Object.freeze, Tt = Object.seal, Et = Object.create, Dt = typeof Reflect < "u" && Reflect, Ot = Dt.apply, kt = Dt.construct;
516
- wt ||= function(e) {
517
+ var vt = Object.entries, yt = Object.setPrototypeOf, bt = Object.isFrozen, xt = Object.getPrototypeOf, St = Object.getOwnPropertyDescriptor, Ct = Object.freeze, wt = Object.seal, Tt = Object.create, Et = typeof Reflect < "u" && Reflect, Dt = Et.apply, Ot = Et.construct;
518
+ Ct ||= function(e) {
517
519
  return e;
518
- }, Tt ||= function(e) {
520
+ }, wt ||= function(e) {
519
521
  return e;
520
- }, Ot ||= function(e, t) {
522
+ }, Dt ||= function(e, t) {
521
523
  var n = [...arguments].slice(2);
522
524
  return e.apply(t, n);
523
- }, kt ||= function(e) {
525
+ }, Ot ||= function(e) {
524
526
  return new e(...[...arguments].slice(1));
525
527
  };
526
- var At = J(Array.prototype.forEach), jt = J(Array.prototype.lastIndexOf), Mt = J(Array.prototype.pop), Nt = J(Array.prototype.push), Pt = J(Array.prototype.splice), Ft = Array.isArray, It = J(String.prototype.toLowerCase), Lt = J(String.prototype.toString), Rt = J(String.prototype.match), zt = J(String.prototype.replace), Bt = J(String.prototype.indexOf), Vt = J(String.prototype.trim), Ht = J(Number.prototype.toString), Ut = J(Boolean.prototype.toString), Wt = typeof BigInt > "u" ? null : J(BigInt.prototype.toString), Gt = typeof Symbol > "u" ? null : J(Symbol.prototype.toString), q = J(Object.prototype.hasOwnProperty), Kt = J(Object.prototype.toString), qt = J(RegExp.prototype.test), Jt = Yt(TypeError);
527
- function J(e) {
528
+ var kt = Jt(Array.prototype.forEach), At = Jt(Array.prototype.lastIndexOf), jt = Jt(Array.prototype.pop), Mt = Jt(Array.prototype.push), Nt = Jt(Array.prototype.splice), Pt = Array.isArray, Ft = Jt(String.prototype.toLowerCase), It = Jt(String.prototype.toString), Lt = Jt(String.prototype.match), Rt = Jt(String.prototype.replace), zt = Jt(String.prototype.indexOf), Bt = Jt(String.prototype.trim), Vt = Jt(Number.prototype.toString), Ht = Jt(Boolean.prototype.toString), Ut = typeof BigInt > "u" ? null : Jt(BigInt.prototype.toString), Wt = typeof Symbol > "u" ? null : Jt(Symbol.prototype.toString), J = Jt(Object.prototype.hasOwnProperty), Gt = Jt(Object.prototype.toString), Kt = Jt(RegExp.prototype.test), qt = Yt(TypeError);
529
+ function Jt(e) {
528
530
  return function(t) {
529
531
  t instanceof RegExp && (t.lastIndex = 0);
530
532
  var n = [...arguments].slice(1);
531
- return Ot(e, t, n);
533
+ return Dt(e, t, n);
532
534
  };
533
535
  }
534
536
  function Yt(e) {
535
537
  return function() {
536
- return kt(e, [...arguments]);
538
+ return Ot(e, [...arguments]);
537
539
  };
538
540
  }
539
541
  function Y(e, t) {
540
- let n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : It;
541
- if (bt && bt(e, null), !Ft(t)) return e;
542
+ let n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : Ft;
543
+ if (yt && yt(e, null), !Pt(t)) return e;
542
544
  let r = t.length;
543
545
  for (; r--;) {
544
546
  let i = t[r];
545
547
  if (typeof i == "string") {
546
548
  let e = n(i);
547
- e !== i && (xt(t) || (t[r] = e), i = e);
549
+ e !== i && (bt(t) || (t[r] = e), i = e);
548
550
  }
549
551
  e[i] = !0;
550
552
  }
551
553
  return e;
552
554
  }
553
555
  function Xt(e) {
554
- for (let t = 0; t < e.length; t++) q(e, t) || (e[t] = null);
556
+ for (let t = 0; t < e.length; t++) J(e, t) || (e[t] = null);
555
557
  return e;
556
558
  }
557
559
  function Zt(e) {
558
- let t = Et(null);
559
- for (let r of yt(e)) {
560
- var n = _t(r, 2);
560
+ let t = Tt(null);
561
+ for (let r of vt(e)) {
562
+ var n = gt(r, 2);
561
563
  let i = n[0], a = n[1];
562
- q(e, i) && (Ft(a) ? t[i] = Xt(a) : a && typeof a == "object" && a.constructor === Object ? t[i] = Zt(a) : t[i] = a);
564
+ J(e, i) && (Pt(a) ? t[i] = Xt(a) : a && typeof a == "object" && a.constructor === Object ? t[i] = Zt(a) : t[i] = a);
563
565
  }
564
566
  return t;
565
567
  }
566
568
  function Qt(e) {
567
569
  switch (typeof e) {
568
570
  case "string": return e;
569
- case "number": return Ht(e);
570
- case "boolean": return Ut(e);
571
- case "bigint": return Wt ? Wt(e) : "0";
572
- case "symbol": return Gt ? Gt(e) : "Symbol()";
573
- case "undefined": return Kt(e);
571
+ case "number": return Vt(e);
572
+ case "boolean": return Ht(e);
573
+ case "bigint": return Ut ? Ut(e) : "0";
574
+ case "symbol": return Wt ? Wt(e) : "Symbol()";
575
+ case "undefined": return Gt(e);
574
576
  case "function":
575
577
  case "object": {
576
- if (e === null) return Kt(e);
578
+ if (e === null) return Gt(e);
577
579
  let t = e, n = $t(t, "toString");
578
580
  if (typeof n == "function") {
579
581
  let e = n(t);
580
- return typeof e == "string" ? e : Kt(e);
582
+ return typeof e == "string" ? e : Gt(e);
581
583
  }
582
- return Kt(e);
584
+ return Gt(e);
583
585
  }
584
- default: return Kt(e);
586
+ default: return Gt(e);
585
587
  }
586
588
  }
587
589
  function $t(e, t) {
588
590
  for (; e !== null;) {
589
- let n = Ct(e, t);
591
+ let n = St(e, t);
590
592
  if (n) {
591
- if (n.get) return J(n.get);
592
- if (typeof n.value == "function") return J(n.value);
593
+ if (n.get) return Jt(n.get);
594
+ if (typeof n.value == "function") return Jt(n.value);
593
595
  }
594
- e = St(e);
596
+ e = xt(e);
595
597
  }
596
598
  function n() {
597
599
  return null;
@@ -600,12 +602,12 @@ function $t(e, t) {
600
602
  }
601
603
  function en(e) {
602
604
  try {
603
- return qt(e, ""), !0;
605
+ return Kt(e, ""), !0;
604
606
  } catch {
605
607
  return !1;
606
608
  }
607
609
  }
608
- var tn = wt(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bdi.bdo.big.blink.blockquote.body.br.button.canvas.caption.center.cite.code.col.colgroup.content.data.datalist.dd.decorator.del.details.dfn.dialog.dir.div.dl.dt.element.em.fieldset.figcaption.figure.font.footer.form.h1.h2.h3.h4.h5.h6.head.header.hgroup.hr.html.i.img.input.ins.kbd.label.legend.li.main.map.mark.marquee.menu.menuitem.meter.nav.nobr.ol.optgroup.option.output.p.picture.pre.progress.q.rp.rt.ruby.s.samp.search.section.select.shadow.slot.small.source.spacer.span.strike.strong.style.sub.summary.sup.table.tbody.td.template.textarea.tfoot.th.thead.time.tr.track.tt.u.ul.var.video.wbr".split(".")), nn = wt(/* @__PURE__ */ "svg.a.altglyph.altglyphdef.altglyphitem.animatecolor.animatemotion.animatetransform.circle.clippath.defs.desc.ellipse.enterkeyhint.exportparts.filter.font.g.glyph.glyphref.hkern.image.inputmode.line.lineargradient.marker.mask.metadata.mpath.part.path.pattern.polygon.polyline.radialgradient.rect.stop.style.switch.symbol.text.textpath.title.tref.tspan.view.vkern".split(".")), rn = wt([
610
+ var tn = Ct(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bdi.bdo.big.blink.blockquote.body.br.button.canvas.caption.center.cite.code.col.colgroup.content.data.datalist.dd.decorator.del.details.dfn.dialog.dir.div.dl.dt.element.em.fieldset.figcaption.figure.font.footer.form.h1.h2.h3.h4.h5.h6.head.header.hgroup.hr.html.i.img.input.ins.kbd.label.legend.li.main.map.mark.marquee.menu.menuitem.meter.nav.nobr.ol.optgroup.option.output.p.picture.pre.progress.q.rp.rt.ruby.s.samp.search.section.select.shadow.slot.small.source.spacer.span.strike.strong.style.sub.summary.sup.table.tbody.td.template.textarea.tfoot.th.thead.time.tr.track.tt.u.ul.var.video.wbr".split(".")), nn = Ct(/* @__PURE__ */ "svg.a.altglyph.altglyphdef.altglyphitem.animatecolor.animatemotion.animatetransform.circle.clippath.defs.desc.ellipse.enterkeyhint.exportparts.filter.font.g.glyph.glyphref.hkern.image.inputmode.line.lineargradient.marker.mask.metadata.mpath.part.path.pattern.polygon.polyline.radialgradient.rect.stop.style.switch.symbol.text.textpath.title.tref.tspan.view.vkern".split(".")), rn = Ct([
609
611
  "feBlend",
610
612
  "feColorMatrix",
611
613
  "feComponentTransfer",
@@ -631,7 +633,7 @@ var tn = wt(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.b
631
633
  "feSpotLight",
632
634
  "feTile",
633
635
  "feTurbulence"
634
- ]), an = wt([
636
+ ]), an = Ct([
635
637
  "animate",
636
638
  "color-profile",
637
639
  "cursor",
@@ -654,7 +656,7 @@ var tn = wt(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.b
654
656
  "solidcolor",
655
657
  "unknown",
656
658
  "use"
657
- ]), on = wt(/* @__PURE__ */ "math.menclose.merror.mfenced.mfrac.mglyph.mi.mlabeledtr.mmultiscripts.mn.mo.mover.mpadded.mphantom.mroot.mrow.ms.mspace.msqrt.mstyle.msub.msup.msubsup.mtable.mtd.mtext.mtr.munder.munderover.mprescripts".split(".")), sn = wt([
659
+ ]), on = Ct(/* @__PURE__ */ "math.menclose.merror.mfenced.mfrac.mglyph.mi.mlabeledtr.mmultiscripts.mn.mo.mover.mpadded.mphantom.mroot.mrow.ms.mspace.msqrt.mstyle.msub.msup.msubsup.mtable.mtd.mtext.mtr.munder.munderover.mprescripts".split(".")), sn = Ct([
658
660
  "maction",
659
661
  "maligngroup",
660
662
  "malignmark",
@@ -670,13 +672,13 @@ var tn = wt(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.b
670
672
  "annotation-xml",
671
673
  "mprescripts",
672
674
  "none"
673
- ]), cn = wt(["#text"]), ln = wt(/* @__PURE__ */ "accept.action.align.alt.autocapitalize.autocomplete.autopictureinpicture.autoplay.background.bgcolor.border.capture.cellpadding.cellspacing.checked.cite.class.clear.color.cols.colspan.controls.controlslist.coords.crossorigin.datetime.decoding.default.dir.disabled.disablepictureinpicture.disableremoteplayback.download.draggable.enctype.enterkeyhint.exportparts.face.for.headers.height.hidden.high.href.hreflang.id.inert.inputmode.integrity.ismap.kind.label.lang.list.loading.loop.low.max.maxlength.media.method.min.minlength.multiple.muted.name.nonce.noshade.novalidate.nowrap.open.optimum.part.pattern.placeholder.playsinline.popover.popovertarget.popovertargetaction.poster.preload.pubdate.radiogroup.readonly.rel.required.rev.reversed.role.rows.rowspan.spellcheck.scope.selected.shape.size.sizes.slot.span.srclang.start.src.srcset.step.style.summary.tabindex.title.translate.type.usemap.valign.value.width.wrap.xmlns".split(".")), un = wt(/* @__PURE__ */ "accent-height.accumulate.additive.alignment-baseline.amplitude.ascent.attributename.attributetype.azimuth.basefrequency.baseline-shift.begin.bias.by.class.clip.clippathunits.clip-path.clip-rule.color.color-interpolation.color-interpolation-filters.color-profile.color-rendering.cx.cy.d.dx.dy.diffuseconstant.direction.display.divisor.dur.edgemode.elevation.end.exponent.fill.fill-opacity.fill-rule.filter.filterunits.flood-color.flood-opacity.font-family.font-size.font-size-adjust.font-stretch.font-style.font-variant.font-weight.fx.fy.g1.g2.glyph-name.glyphref.gradientunits.gradienttransform.height.href.id.image-rendering.in.in2.intercept.k.k1.k2.k3.k4.kerning.keypoints.keysplines.keytimes.lang.lengthadjust.letter-spacing.kernelmatrix.kernelunitlength.lighting-color.local.marker-end.marker-mid.marker-start.markerheight.markerunits.markerwidth.maskcontentunits.maskunits.max.mask.mask-type.media.method.mode.min.name.numoctaves.offset.operator.opacity.order.orient.orientation.origin.overflow.paint-order.path.pathlength.patterncontentunits.patterntransform.patternunits.points.preservealpha.preserveaspectratio.primitiveunits.r.rx.ry.radius.refx.refy.repeatcount.repeatdur.restart.result.rotate.scale.seed.shape-rendering.slope.specularconstant.specularexponent.spreadmethod.startoffset.stddeviation.stitchtiles.stop-color.stop-opacity.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke.stroke-width.style.surfacescale.systemlanguage.tabindex.tablevalues.targetx.targety.transform.transform-origin.text-anchor.text-decoration.text-rendering.textlength.type.u1.u2.unicode.values.viewbox.visibility.version.vert-adv-y.vert-origin-x.vert-origin-y.width.word-spacing.wrap.writing-mode.xchannelselector.ychannelselector.x.x1.x2.xmlns.y.y1.y2.z.zoomandpan".split(".")), dn = wt(/* @__PURE__ */ "accent.accentunder.align.bevelled.close.columnalign.columnlines.columnspacing.columnspan.denomalign.depth.dir.display.displaystyle.encoding.fence.frame.height.href.id.largeop.length.linethickness.lquote.lspace.mathbackground.mathcolor.mathsize.mathvariant.maxsize.minsize.movablelimits.notation.numalign.open.rowalign.rowlines.rowspacing.rowspan.rspace.rquote.scriptlevel.scriptminsize.scriptsizemultiplier.selection.separator.separators.stretchy.subscriptshift.supscriptshift.symmetric.voffset.width.xmlns".split(".")), fn = wt([
675
+ ]), cn = Ct(["#text"]), ln = Ct(/* @__PURE__ */ "accept.action.align.alt.autocapitalize.autocomplete.autopictureinpicture.autoplay.background.bgcolor.border.capture.cellpadding.cellspacing.checked.cite.class.clear.color.cols.colspan.controls.controlslist.coords.crossorigin.datetime.decoding.default.dir.disabled.disablepictureinpicture.disableremoteplayback.download.draggable.enctype.enterkeyhint.exportparts.face.for.headers.height.hidden.high.href.hreflang.id.inert.inputmode.integrity.ismap.kind.label.lang.list.loading.loop.low.max.maxlength.media.method.min.minlength.multiple.muted.name.nonce.noshade.novalidate.nowrap.open.optimum.part.pattern.placeholder.playsinline.popover.popovertarget.popovertargetaction.poster.preload.pubdate.radiogroup.readonly.rel.required.rev.reversed.role.rows.rowspan.spellcheck.scope.selected.shape.size.sizes.slot.span.srclang.start.src.srcset.step.style.summary.tabindex.title.translate.type.usemap.valign.value.width.wrap.xmlns".split(".")), un = Ct(/* @__PURE__ */ "accent-height.accumulate.additive.alignment-baseline.amplitude.ascent.attributename.attributetype.azimuth.basefrequency.baseline-shift.begin.bias.by.class.clip.clippathunits.clip-path.clip-rule.color.color-interpolation.color-interpolation-filters.color-profile.color-rendering.cx.cy.d.dx.dy.diffuseconstant.direction.display.divisor.dur.edgemode.elevation.end.exponent.fill.fill-opacity.fill-rule.filter.filterunits.flood-color.flood-opacity.font-family.font-size.font-size-adjust.font-stretch.font-style.font-variant.font-weight.fx.fy.g1.g2.glyph-name.glyphref.gradientunits.gradienttransform.height.href.id.image-rendering.in.in2.intercept.k.k1.k2.k3.k4.kerning.keypoints.keysplines.keytimes.lang.lengthadjust.letter-spacing.kernelmatrix.kernelunitlength.lighting-color.local.marker-end.marker-mid.marker-start.markerheight.markerunits.markerwidth.maskcontentunits.maskunits.max.mask.mask-type.media.method.mode.min.name.numoctaves.offset.operator.opacity.order.orient.orientation.origin.overflow.paint-order.path.pathlength.patterncontentunits.patterntransform.patternunits.points.preservealpha.preserveaspectratio.primitiveunits.r.rx.ry.radius.refx.refy.repeatcount.repeatdur.restart.result.rotate.scale.seed.shape-rendering.slope.specularconstant.specularexponent.spreadmethod.startoffset.stddeviation.stitchtiles.stop-color.stop-opacity.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke.stroke-width.style.surfacescale.systemlanguage.tabindex.tablevalues.targetx.targety.transform.transform-origin.text-anchor.text-decoration.text-rendering.textlength.type.u1.u2.unicode.values.viewbox.visibility.version.vert-adv-y.vert-origin-x.vert-origin-y.width.word-spacing.wrap.writing-mode.xchannelselector.ychannelselector.x.x1.x2.xmlns.y.y1.y2.z.zoomandpan".split(".")), dn = Ct(/* @__PURE__ */ "accent.accentunder.align.bevelled.close.columnalign.columnlines.columnspacing.columnspan.denomalign.depth.dir.display.displaystyle.encoding.fence.frame.height.href.id.largeop.length.linethickness.lquote.lspace.mathbackground.mathcolor.mathsize.mathvariant.maxsize.minsize.movablelimits.notation.numalign.open.rowalign.rowlines.rowspacing.rowspan.rspace.rquote.scriptlevel.scriptminsize.scriptsizemultiplier.selection.separator.separators.stretchy.subscriptshift.supscriptshift.symmetric.voffset.width.xmlns".split(".")), fn = Ct([
674
676
  "xlink:href",
675
677
  "xml:id",
676
678
  "xlink:title",
677
679
  "xml:space",
678
680
  "xmlns:xlink"
679
- ]), pn = Tt(/{{[\w\W]*|^[\w\W]*}}/g), mn = Tt(/<%[\w\W]*|^[\w\W]*%>/g), hn = Tt(/\${[\w\W]*/g), gn = Tt(/^data-[\-\w.\u00B7-\uFFFF]+$/), _n = Tt(/^aria-[\-\w]+$/), vn = Tt(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i), yn = Tt(/^(?:\w+script|data):/i), bn = Tt(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g), xn = Tt(/^html$/i), Sn = Tt(/^[a-z][.\w]*(-[.\w]+)+$/i), Cn = {
681
+ ]), pn = wt(/{{[\w\W]*|^[\w\W]*}}/g), mn = wt(/<%[\w\W]*|^[\w\W]*%>/g), hn = wt(/\${[\w\W]*/g), gn = wt(/^data-[\-\w.\u00B7-\uFFFF]+$/), _n = wt(/^aria-[\-\w]+$/), vn = wt(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i), yn = wt(/^(?:\w+script|data):/i), bn = wt(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g), xn = wt(/^html$/i), Sn = wt(/^[a-z][.\w]*(-[.\w]+)+$/i), Cn = {
680
682
  element: 1,
681
683
  text: 3,
682
684
  progressingInstruction: 7,
@@ -723,19 +725,19 @@ function Dn() {
723
725
  e.content && e.content.ownerDocument && (n = e.content.ownerDocument);
724
726
  }
725
727
  let x, S = "", C = n, w = C.implementation, T = C.createNodeIterator, E = C.createDocumentFragment, D = C.getElementsByTagName, O = r.importNode, k = En();
726
- t.isSupported = typeof yt == "function" && typeof b == "function" && w && w.createHTMLDocument !== void 0;
727
- let A = pn, j = mn, ee = hn, te = gn, M = _n, N = yn, P = bn, F = Sn, ne = vn, I = null, L = Y({}, [
728
+ t.isSupported = typeof vt == "function" && typeof b == "function" && w && w.createHTMLDocument !== void 0;
729
+ let A = pn, j = mn, M = hn, ee = gn, N = _n, P = yn, F = bn, I = Sn, te = vn, L = null, R = Y({}, [
728
730
  ...tn,
729
731
  ...nn,
730
732
  ...rn,
731
733
  ...on,
732
734
  ...cn
733
- ]), R = null, re = Y({}, [
735
+ ]), z = null, ne = Y({}, [
734
736
  ...ln,
735
737
  ...un,
736
738
  ...dn,
737
739
  ...fn
738
- ]), z = Object.seal(Et(null, {
740
+ ]), B = Object.seal(Tt(null, {
739
741
  tagNameCheck: {
740
742
  writable: !0,
741
743
  configurable: !1,
@@ -754,7 +756,7 @@ function Dn() {
754
756
  enumerable: !0,
755
757
  value: !1
756
758
  }
757
- })), ie = null, ae = null, B = Object.seal(Et(null, {
759
+ })), re = null, ie = null, V = Object.seal(Tt(null, {
758
760
  tagCheck: {
759
761
  writable: !0,
760
762
  configurable: !1,
@@ -767,7 +769,7 @@ function Dn() {
767
769
  enumerable: !0,
768
770
  value: null
769
771
  }
770
- })), oe = !0, V = !0, se = !1, H = !0, ce = !1, le = !0, ue = !1, de = !1, fe = !1, U = !1, pe = !1, me = !1, he = !0, ge = !1, _e = "user-content-", ve = !0, ye = !1, be = {}, xe = null, Se = Y({}, [
772
+ })), ae = !0, H = !0, oe = !1, U = !0, se = !1, ce = !0, le = !1, ue = !1, de = !1, W = !1, fe = !1, pe = !1, me = !0, he = !1, ge = "user-content-", _e = !0, ve = !1, ye = {}, be = null, xe = Y({}, [
771
773
  "annotation-xml",
772
774
  "audio",
773
775
  "colgroup",
@@ -793,14 +795,14 @@ function Dn() {
793
795
  "title",
794
796
  "video",
795
797
  "xmp"
796
- ]), Ce = null, we = Y({}, [
798
+ ]), Se = null, Ce = Y({}, [
797
799
  "audio",
798
800
  "video",
799
801
  "img",
800
802
  "source",
801
803
  "image",
802
804
  "track"
803
- ]), Te = null, Ee = Y({}, [
805
+ ]), we = null, Te = Y({}, [
804
806
  "alt",
805
807
  "class",
806
808
  "for",
@@ -815,125 +817,125 @@ function Dn() {
815
817
  "value",
816
818
  "style",
817
819
  "xmlns"
818
- ]), De = "http://www.w3.org/1998/Math/MathML", Oe = "http://www.w3.org/2000/svg", ke = "http://www.w3.org/1999/xhtml", Ae = ke, je = !1, Me = null, Ne = Y({}, [
820
+ ]), Ee = "http://www.w3.org/1998/Math/MathML", De = "http://www.w3.org/2000/svg", Oe = "http://www.w3.org/1999/xhtml", ke = Oe, Ae = !1, je = null, Me = Y({}, [
821
+ Ee,
819
822
  De,
820
- Oe,
821
- ke
822
- ], Lt), Pe = Y({}, [
823
+ Oe
824
+ ], It), Ne = Y({}, [
823
825
  "mi",
824
826
  "mo",
825
827
  "mn",
826
828
  "ms",
827
829
  "mtext"
828
- ]), Fe = Y({}, ["annotation-xml"]), Ie = Y({}, [
830
+ ]), Pe = Y({}, ["annotation-xml"]), Fe = Y({}, [
829
831
  "title",
830
832
  "style",
831
833
  "font",
832
834
  "a",
833
835
  "script"
834
- ]), Le = null, Re = ["application/xhtml+xml", "text/html"], W = null, ze = null, Be = n.createElement("form"), G = function(e) {
836
+ ]), Ie = null, Le = ["application/xhtml+xml", "text/html"], G = null, Re = null, ze = n.createElement("form"), K = function(e) {
835
837
  return e instanceof RegExp || e instanceof Function;
836
- }, K = function() {
838
+ }, q = function() {
837
839
  let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
838
- if (ze && ze === e) return;
839
- (!e || typeof e != "object") && (e = {}), e = Zt(e), Le = Re.indexOf(e.PARSER_MEDIA_TYPE) === -1 ? "text/html" : e.PARSER_MEDIA_TYPE, W = Le === "application/xhtml+xml" ? Lt : It, I = q(e, "ALLOWED_TAGS") && Ft(e.ALLOWED_TAGS) ? Y({}, e.ALLOWED_TAGS, W) : L, R = q(e, "ALLOWED_ATTR") && Ft(e.ALLOWED_ATTR) ? Y({}, e.ALLOWED_ATTR, W) : re, Me = q(e, "ALLOWED_NAMESPACES") && Ft(e.ALLOWED_NAMESPACES) ? Y({}, e.ALLOWED_NAMESPACES, Lt) : Ne, Te = q(e, "ADD_URI_SAFE_ATTR") && Ft(e.ADD_URI_SAFE_ATTR) ? Y(Zt(Ee), e.ADD_URI_SAFE_ATTR, W) : Ee, Ce = q(e, "ADD_DATA_URI_TAGS") && Ft(e.ADD_DATA_URI_TAGS) ? Y(Zt(we), e.ADD_DATA_URI_TAGS, W) : we, xe = q(e, "FORBID_CONTENTS") && Ft(e.FORBID_CONTENTS) ? Y({}, e.FORBID_CONTENTS, W) : Se, ie = q(e, "FORBID_TAGS") && Ft(e.FORBID_TAGS) ? Y({}, e.FORBID_TAGS, W) : Zt({}), ae = q(e, "FORBID_ATTR") && Ft(e.FORBID_ATTR) ? Y({}, e.FORBID_ATTR, W) : Zt({}), be = q(e, "USE_PROFILES") ? e.USE_PROFILES && typeof e.USE_PROFILES == "object" ? Zt(e.USE_PROFILES) : e.USE_PROFILES : !1, oe = e.ALLOW_ARIA_ATTR !== !1, V = e.ALLOW_DATA_ATTR !== !1, se = e.ALLOW_UNKNOWN_PROTOCOLS || !1, H = e.ALLOW_SELF_CLOSE_IN_ATTR !== !1, ce = e.SAFE_FOR_TEMPLATES || !1, le = e.SAFE_FOR_XML !== !1, ue = e.WHOLE_DOCUMENT || !1, U = e.RETURN_DOM || !1, pe = e.RETURN_DOM_FRAGMENT || !1, me = e.RETURN_TRUSTED_TYPE || !1, fe = e.FORCE_BODY || !1, he = e.SANITIZE_DOM !== !1, ge = e.SANITIZE_NAMED_PROPS || !1, ve = e.KEEP_CONTENT !== !1, ye = e.IN_PLACE || !1, ne = en(e.ALLOWED_URI_REGEXP) ? e.ALLOWED_URI_REGEXP : vn, Ae = typeof e.NAMESPACE == "string" ? e.NAMESPACE : ke, Pe = q(e, "MATHML_TEXT_INTEGRATION_POINTS") && e.MATHML_TEXT_INTEGRATION_POINTS && typeof e.MATHML_TEXT_INTEGRATION_POINTS == "object" ? Zt(e.MATHML_TEXT_INTEGRATION_POINTS) : Y({}, [
840
+ if (Re && Re === e) return;
841
+ (!e || typeof e != "object") && (e = {}), e = Zt(e), Ie = Le.indexOf(e.PARSER_MEDIA_TYPE) === -1 ? "text/html" : e.PARSER_MEDIA_TYPE, G = Ie === "application/xhtml+xml" ? It : Ft, L = J(e, "ALLOWED_TAGS") && Pt(e.ALLOWED_TAGS) ? Y({}, e.ALLOWED_TAGS, G) : R, z = J(e, "ALLOWED_ATTR") && Pt(e.ALLOWED_ATTR) ? Y({}, e.ALLOWED_ATTR, G) : ne, je = J(e, "ALLOWED_NAMESPACES") && Pt(e.ALLOWED_NAMESPACES) ? Y({}, e.ALLOWED_NAMESPACES, It) : Me, we = J(e, "ADD_URI_SAFE_ATTR") && Pt(e.ADD_URI_SAFE_ATTR) ? Y(Zt(Te), e.ADD_URI_SAFE_ATTR, G) : Te, Se = J(e, "ADD_DATA_URI_TAGS") && Pt(e.ADD_DATA_URI_TAGS) ? Y(Zt(Ce), e.ADD_DATA_URI_TAGS, G) : Ce, be = J(e, "FORBID_CONTENTS") && Pt(e.FORBID_CONTENTS) ? Y({}, e.FORBID_CONTENTS, G) : xe, re = J(e, "FORBID_TAGS") && Pt(e.FORBID_TAGS) ? Y({}, e.FORBID_TAGS, G) : Zt({}), ie = J(e, "FORBID_ATTR") && Pt(e.FORBID_ATTR) ? Y({}, e.FORBID_ATTR, G) : Zt({}), ye = J(e, "USE_PROFILES") ? e.USE_PROFILES && typeof e.USE_PROFILES == "object" ? Zt(e.USE_PROFILES) : e.USE_PROFILES : !1, ae = e.ALLOW_ARIA_ATTR !== !1, H = e.ALLOW_DATA_ATTR !== !1, oe = e.ALLOW_UNKNOWN_PROTOCOLS || !1, U = e.ALLOW_SELF_CLOSE_IN_ATTR !== !1, se = e.SAFE_FOR_TEMPLATES || !1, ce = e.SAFE_FOR_XML !== !1, le = e.WHOLE_DOCUMENT || !1, W = e.RETURN_DOM || !1, fe = e.RETURN_DOM_FRAGMENT || !1, pe = e.RETURN_TRUSTED_TYPE || !1, de = e.FORCE_BODY || !1, me = e.SANITIZE_DOM !== !1, he = e.SANITIZE_NAMED_PROPS || !1, _e = e.KEEP_CONTENT !== !1, ve = e.IN_PLACE || !1, te = en(e.ALLOWED_URI_REGEXP) ? e.ALLOWED_URI_REGEXP : vn, ke = typeof e.NAMESPACE == "string" ? e.NAMESPACE : Oe, Ne = J(e, "MATHML_TEXT_INTEGRATION_POINTS") && e.MATHML_TEXT_INTEGRATION_POINTS && typeof e.MATHML_TEXT_INTEGRATION_POINTS == "object" ? Zt(e.MATHML_TEXT_INTEGRATION_POINTS) : Y({}, [
840
842
  "mi",
841
843
  "mo",
842
844
  "mn",
843
845
  "ms",
844
846
  "mtext"
845
- ]), Fe = q(e, "HTML_INTEGRATION_POINTS") && e.HTML_INTEGRATION_POINTS && typeof e.HTML_INTEGRATION_POINTS == "object" ? Zt(e.HTML_INTEGRATION_POINTS) : Y({}, ["annotation-xml"]);
846
- let t = q(e, "CUSTOM_ELEMENT_HANDLING") && e.CUSTOM_ELEMENT_HANDLING && typeof e.CUSTOM_ELEMENT_HANDLING == "object" ? Zt(e.CUSTOM_ELEMENT_HANDLING) : Et(null);
847
- if (z = Et(null), q(t, "tagNameCheck") && G(t.tagNameCheck) && (z.tagNameCheck = t.tagNameCheck), q(t, "attributeNameCheck") && G(t.attributeNameCheck) && (z.attributeNameCheck = t.attributeNameCheck), q(t, "allowCustomizedBuiltInElements") && typeof t.allowCustomizedBuiltInElements == "boolean" && (z.allowCustomizedBuiltInElements = t.allowCustomizedBuiltInElements), ce && (V = !1), pe && (U = !0), be && (I = Y({}, cn), R = Et(null), be.html === !0 && (Y(I, tn), Y(R, ln)), be.svg === !0 && (Y(I, nn), Y(R, un), Y(R, fn)), be.svgFilters === !0 && (Y(I, rn), Y(R, un), Y(R, fn)), be.mathMl === !0 && (Y(I, on), Y(R, dn), Y(R, fn))), B.tagCheck = null, B.attributeCheck = null, q(e, "ADD_TAGS") && (typeof e.ADD_TAGS == "function" ? B.tagCheck = e.ADD_TAGS : Ft(e.ADD_TAGS) && (I === L && (I = Zt(I)), Y(I, e.ADD_TAGS, W))), q(e, "ADD_ATTR") && (typeof e.ADD_ATTR == "function" ? B.attributeCheck = e.ADD_ATTR : Ft(e.ADD_ATTR) && (R === re && (R = Zt(R)), Y(R, e.ADD_ATTR, W))), q(e, "ADD_URI_SAFE_ATTR") && Ft(e.ADD_URI_SAFE_ATTR) && Y(Te, e.ADD_URI_SAFE_ATTR, W), q(e, "FORBID_CONTENTS") && Ft(e.FORBID_CONTENTS) && (xe === Se && (xe = Zt(xe)), Y(xe, e.FORBID_CONTENTS, W)), q(e, "ADD_FORBID_CONTENTS") && Ft(e.ADD_FORBID_CONTENTS) && (xe === Se && (xe = Zt(xe)), Y(xe, e.ADD_FORBID_CONTENTS, W)), ve && (I["#text"] = !0), ue && Y(I, [
847
+ ]), Pe = J(e, "HTML_INTEGRATION_POINTS") && e.HTML_INTEGRATION_POINTS && typeof e.HTML_INTEGRATION_POINTS == "object" ? Zt(e.HTML_INTEGRATION_POINTS) : Y({}, ["annotation-xml"]);
848
+ let t = J(e, "CUSTOM_ELEMENT_HANDLING") && e.CUSTOM_ELEMENT_HANDLING && typeof e.CUSTOM_ELEMENT_HANDLING == "object" ? Zt(e.CUSTOM_ELEMENT_HANDLING) : Tt(null);
849
+ if (B = Tt(null), J(t, "tagNameCheck") && K(t.tagNameCheck) && (B.tagNameCheck = t.tagNameCheck), J(t, "attributeNameCheck") && K(t.attributeNameCheck) && (B.attributeNameCheck = t.attributeNameCheck), J(t, "allowCustomizedBuiltInElements") && typeof t.allowCustomizedBuiltInElements == "boolean" && (B.allowCustomizedBuiltInElements = t.allowCustomizedBuiltInElements), se && (H = !1), fe && (W = !0), ye && (L = Y({}, cn), z = Tt(null), ye.html === !0 && (Y(L, tn), Y(z, ln)), ye.svg === !0 && (Y(L, nn), Y(z, un), Y(z, fn)), ye.svgFilters === !0 && (Y(L, rn), Y(z, un), Y(z, fn)), ye.mathMl === !0 && (Y(L, on), Y(z, dn), Y(z, fn))), V.tagCheck = null, V.attributeCheck = null, J(e, "ADD_TAGS") && (typeof e.ADD_TAGS == "function" ? V.tagCheck = e.ADD_TAGS : Pt(e.ADD_TAGS) && (L === R && (L = Zt(L)), Y(L, e.ADD_TAGS, G))), J(e, "ADD_ATTR") && (typeof e.ADD_ATTR == "function" ? V.attributeCheck = e.ADD_ATTR : Pt(e.ADD_ATTR) && (z === ne && (z = Zt(z)), Y(z, e.ADD_ATTR, G))), J(e, "ADD_URI_SAFE_ATTR") && Pt(e.ADD_URI_SAFE_ATTR) && Y(we, e.ADD_URI_SAFE_ATTR, G), J(e, "FORBID_CONTENTS") && Pt(e.FORBID_CONTENTS) && (be === xe && (be = Zt(be)), Y(be, e.FORBID_CONTENTS, G)), J(e, "ADD_FORBID_CONTENTS") && Pt(e.ADD_FORBID_CONTENTS) && (be === xe && (be = Zt(be)), Y(be, e.ADD_FORBID_CONTENTS, G)), _e && (L["#text"] = !0), le && Y(L, [
848
850
  "html",
849
851
  "head",
850
852
  "body"
851
- ]), I.table && (Y(I, ["tbody"]), delete ie.tbody), e.TRUSTED_TYPES_POLICY) {
852
- if (typeof e.TRUSTED_TYPES_POLICY.createHTML != "function") throw Jt("TRUSTED_TYPES_POLICY configuration option must provide a \"createHTML\" hook.");
853
- if (typeof e.TRUSTED_TYPES_POLICY.createScriptURL != "function") throw Jt("TRUSTED_TYPES_POLICY configuration option must provide a \"createScriptURL\" hook.");
853
+ ]), L.table && (Y(L, ["tbody"]), delete re.tbody), e.TRUSTED_TYPES_POLICY) {
854
+ if (typeof e.TRUSTED_TYPES_POLICY.createHTML != "function") throw qt("TRUSTED_TYPES_POLICY configuration option must provide a \"createHTML\" hook.");
855
+ if (typeof e.TRUSTED_TYPES_POLICY.createScriptURL != "function") throw qt("TRUSTED_TYPES_POLICY configuration option must provide a \"createScriptURL\" hook.");
854
856
  x = e.TRUSTED_TYPES_POLICY, S = x.createHTML("");
855
857
  } else x === void 0 && (x = Tn(m, i)), x !== null && typeof S == "string" && (S = x.createHTML(""));
856
- wt && wt(e), ze = e;
857
- }, Ve = Y({}, [
858
+ Ct && Ct(e), Re = e;
859
+ }, Be = Y({}, [
858
860
  ...nn,
859
861
  ...rn,
860
862
  ...an
861
- ]), He = Y({}, [...on, ...sn]), Ue = function(e) {
863
+ ]), Ve = Y({}, [...on, ...sn]), He = function(e) {
862
864
  let t = b(e);
863
865
  (!t || !t.tagName) && (t = {
864
- namespaceURI: Ae,
866
+ namespaceURI: ke,
865
867
  tagName: "template"
866
868
  });
867
- let n = It(e.tagName), r = It(t.tagName);
868
- return Me[e.namespaceURI] ? e.namespaceURI === Oe ? t.namespaceURI === ke ? n === "svg" : t.namespaceURI === De ? n === "svg" && (r === "annotation-xml" || Pe[r]) : !!Ve[n] : e.namespaceURI === De ? t.namespaceURI === ke ? n === "math" : t.namespaceURI === Oe ? n === "math" && Fe[r] : !!He[n] : e.namespaceURI === ke ? t.namespaceURI === Oe && !Fe[r] || t.namespaceURI === De && !Pe[r] ? !1 : !He[n] && (Ie[n] || !Ve[n]) : !!(Le === "application/xhtml+xml" && Me[e.namespaceURI]) : !1;
869
- }, We = function(e) {
870
- Nt(t.removed, { element: e });
869
+ let n = Ft(e.tagName), r = Ft(t.tagName);
870
+ return je[e.namespaceURI] ? e.namespaceURI === De ? t.namespaceURI === Oe ? n === "svg" : t.namespaceURI === Ee ? n === "svg" && (r === "annotation-xml" || Ne[r]) : !!Be[n] : e.namespaceURI === Ee ? t.namespaceURI === Oe ? n === "math" : t.namespaceURI === De ? n === "math" && Pe[r] : !!Ve[n] : e.namespaceURI === Oe ? t.namespaceURI === De && !Pe[r] || t.namespaceURI === Ee && !Ne[r] ? !1 : !Ve[n] && (Fe[n] || !Be[n]) : !!(Ie === "application/xhtml+xml" && je[e.namespaceURI]) : !1;
871
+ }, Ue = function(e) {
872
+ Mt(t.removed, { element: e });
871
873
  try {
872
874
  b(e).removeChild(e);
873
875
  } catch {
874
876
  _(e);
875
877
  }
876
- }, Ge = function(e, n) {
878
+ }, We = function(e, n) {
877
879
  try {
878
- Nt(t.removed, {
880
+ Mt(t.removed, {
879
881
  attribute: n.getAttributeNode(e),
880
882
  from: n
881
883
  });
882
884
  } catch {
883
- Nt(t.removed, {
885
+ Mt(t.removed, {
884
886
  attribute: null,
885
887
  from: n
886
888
  });
887
889
  }
888
- if (n.removeAttribute(e), e === "is") if (U || pe) try {
889
- We(n);
890
+ if (n.removeAttribute(e), e === "is") if (W || fe) try {
891
+ Ue(n);
890
892
  } catch {}
891
893
  else try {
892
894
  n.setAttribute(e, "");
893
895
  } catch {}
894
- }, Ke = function(e) {
896
+ }, Ge = function(e) {
895
897
  let t = null, r = null;
896
- if (fe) e = "<remove></remove>" + e;
898
+ if (de) e = "<remove></remove>" + e;
897
899
  else {
898
- let t = Rt(e, /^[\r\n\t ]+/);
900
+ let t = Lt(e, /^[\r\n\t ]+/);
899
901
  r = t && t[0];
900
902
  }
901
- Le === "application/xhtml+xml" && Ae === ke && (e = "<html xmlns=\"http://www.w3.org/1999/xhtml\"><head></head><body>" + e + "</body></html>");
903
+ Ie === "application/xhtml+xml" && ke === Oe && (e = "<html xmlns=\"http://www.w3.org/1999/xhtml\"><head></head><body>" + e + "</body></html>");
902
904
  let i = x ? x.createHTML(e) : e;
903
- if (Ae === ke) try {
904
- t = new p().parseFromString(i, Le);
905
+ if (ke === Oe) try {
906
+ t = new p().parseFromString(i, Ie);
905
907
  } catch {}
906
908
  if (!t || !t.documentElement) {
907
- t = w.createDocument(Ae, "template", null);
909
+ t = w.createDocument(ke, "template", null);
908
910
  try {
909
- t.documentElement.innerHTML = je ? S : i;
911
+ t.documentElement.innerHTML = Ae ? S : i;
910
912
  } catch {}
911
913
  }
912
914
  let a = t.body || t.documentElement;
913
- return e && r && a.insertBefore(n.createTextNode(r), a.childNodes[0] || null), Ae === ke ? D.call(t, ue ? "html" : "body")[0] : ue ? t.documentElement : a;
914
- }, qe = function(e) {
915
+ return e && r && a.insertBefore(n.createTextNode(r), a.childNodes[0] || null), ke === Oe ? D.call(t, le ? "html" : "body")[0] : le ? t.documentElement : a;
916
+ }, Ke = function(e) {
915
917
  return T.call(e.ownerDocument || e, e, l.SHOW_ELEMENT | l.SHOW_COMMENT | l.SHOW_TEXT | l.SHOW_PROCESSING_INSTRUCTION | l.SHOW_CDATA_SECTION, null);
916
- }, Je = function(e) {
918
+ }, qe = function(e) {
917
919
  return e instanceof f && (typeof e.nodeName != "string" || typeof e.textContent != "string" || typeof e.removeChild != "function" || !(e.attributes instanceof d) || typeof e.removeAttribute != "function" || typeof e.setAttribute != "function" || typeof e.namespaceURI != "string" || typeof e.insertBefore != "function" || typeof e.hasChildNodes != "function");
918
- }, Ye = function(e) {
920
+ }, Je = function(e) {
919
921
  return typeof s == "function" && e instanceof s;
920
922
  };
921
- function Xe(e, n, r) {
922
- At(e, (e) => {
923
- e.call(t, n, r, ze);
923
+ function Ye(e, n, r) {
924
+ kt(e, (e) => {
925
+ e.call(t, n, r, Re);
924
926
  });
925
927
  }
926
- let Ze = function(e) {
928
+ let Xe = function(e) {
927
929
  let n = null;
928
- if (Xe(k.beforeSanitizeElements, e, null), Je(e)) return We(e), !0;
929
- let r = W(e.nodeName);
930
- if (Xe(k.uponSanitizeElement, e, {
930
+ if (Ye(k.beforeSanitizeElements, e, null), qe(e)) return Ue(e), !0;
931
+ let r = G(e.nodeName);
932
+ if (Ye(k.uponSanitizeElement, e, {
931
933
  tagName: r,
932
- allowedTags: I
933
- }), le && e.hasChildNodes() && !Ye(e.firstElementChild) && qt(/<[/\w!]/g, e.innerHTML) && qt(/<[/\w!]/g, e.textContent) || le && e.namespaceURI === ke && r === "style" && Ye(e.firstElementChild) || e.nodeType === Cn.progressingInstruction || le && e.nodeType === Cn.comment && qt(/<[/\w]/g, e.data)) return We(e), !0;
934
- if (ie[r] || !(B.tagCheck instanceof Function && B.tagCheck(r)) && !I[r]) {
935
- if (!ie[r] && et(r) && (z.tagNameCheck instanceof RegExp && qt(z.tagNameCheck, r) || z.tagNameCheck instanceof Function && z.tagNameCheck(r))) return !1;
936
- if (ve && !xe[r]) {
934
+ allowedTags: L
935
+ }), ce && e.hasChildNodes() && !Je(e.firstElementChild) && Kt(/<[/\w!]/g, e.innerHTML) && Kt(/<[/\w!]/g, e.textContent) || ce && e.namespaceURI === Oe && r === "style" && Je(e.firstElementChild) || e.nodeType === Cn.progressingInstruction || ce && e.nodeType === Cn.comment && Kt(/<[/\w]/g, e.data)) return Ue(e), !0;
936
+ if (re[r] || !(V.tagCheck instanceof Function && V.tagCheck(r)) && !L[r]) {
937
+ if (!re[r] && $e(r) && (B.tagNameCheck instanceof RegExp && Kt(B.tagNameCheck, r) || B.tagNameCheck instanceof Function && B.tagNameCheck(r))) return !1;
938
+ if (_e && !be[r]) {
937
939
  let t = b(e) || e.parentNode, n = y(e) || e.childNodes;
938
940
  if (n && t) {
939
941
  let r = n.length;
@@ -943,25 +945,25 @@ function Dn() {
943
945
  }
944
946
  }
945
947
  }
946
- return We(e), !0;
948
+ return Ue(e), !0;
947
949
  }
948
- return e instanceof c && !Ue(e) || (r === "noscript" || r === "noembed" || r === "noframes") && qt(/<\/no(script|embed|frames)/i, e.innerHTML) ? (We(e), !0) : (ce && e.nodeType === Cn.text && (n = e.textContent, At([
950
+ return e instanceof c && !He(e) || (r === "noscript" || r === "noembed" || r === "noframes") && Kt(/<\/no(script|embed|frames)/i, e.innerHTML) ? (Ue(e), !0) : (se && e.nodeType === Cn.text && (n = e.textContent, kt([
949
951
  A,
950
952
  j,
951
- ee
953
+ M
952
954
  ], (e) => {
953
- n = zt(n, e, " ");
954
- }), e.textContent !== n && (Nt(t.removed, { element: e.cloneNode() }), e.textContent = n)), Xe(k.afterSanitizeElements, e, null), !1);
955
- }, Qe = function(e, t, r) {
956
- if (ae[t] || he && (t === "id" || t === "name") && (r in n || r in Be)) return !1;
957
- let i = R[t] || B.attributeCheck instanceof Function && B.attributeCheck(t, e);
958
- if (!(V && !ae[t] && qt(te, t)) && !(oe && qt(M, t))) {
959
- if (!i || ae[t]) {
960
- if (!(et(e) && (z.tagNameCheck instanceof RegExp && qt(z.tagNameCheck, e) || z.tagNameCheck instanceof Function && z.tagNameCheck(e)) && (z.attributeNameCheck instanceof RegExp && qt(z.attributeNameCheck, t) || z.attributeNameCheck instanceof Function && z.attributeNameCheck(t, e)) || t === "is" && z.allowCustomizedBuiltInElements && (z.tagNameCheck instanceof RegExp && qt(z.tagNameCheck, r) || z.tagNameCheck instanceof Function && z.tagNameCheck(r)))) return !1;
961
- } else if (!Te[t] && !qt(ne, zt(r, P, "")) && !((t === "src" || t === "xlink:href" || t === "href") && e !== "script" && Bt(r, "data:") === 0 && Ce[e]) && !(se && !qt(N, zt(r, P, ""))) && r) return !1;
955
+ n = Rt(n, e, " ");
956
+ }), e.textContent !== n && (Mt(t.removed, { element: e.cloneNode() }), e.textContent = n)), Ye(k.afterSanitizeElements, e, null), !1);
957
+ }, Ze = function(e, t, r) {
958
+ if (ie[t] || me && (t === "id" || t === "name") && (r in n || r in ze)) return !1;
959
+ let i = z[t] || V.attributeCheck instanceof Function && V.attributeCheck(t, e);
960
+ if (!(H && !ie[t] && Kt(ee, t)) && !(ae && Kt(N, t))) {
961
+ if (!i || ie[t]) {
962
+ if (!($e(e) && (B.tagNameCheck instanceof RegExp && Kt(B.tagNameCheck, e) || B.tagNameCheck instanceof Function && B.tagNameCheck(e)) && (B.attributeNameCheck instanceof RegExp && Kt(B.attributeNameCheck, t) || B.attributeNameCheck instanceof Function && B.attributeNameCheck(t, e)) || t === "is" && B.allowCustomizedBuiltInElements && (B.tagNameCheck instanceof RegExp && Kt(B.tagNameCheck, r) || B.tagNameCheck instanceof Function && B.tagNameCheck(r)))) return !1;
963
+ } else if (!we[t] && !Kt(te, Rt(r, F, "")) && !((t === "src" || t === "xlink:href" || t === "href") && e !== "script" && zt(r, "data:") === 0 && Se[e]) && !(oe && !Kt(P, Rt(r, F, ""))) && r) return !1;
962
964
  }
963
965
  return !0;
964
- }, $e = Y({}, [
966
+ }, Qe = Y({}, [
965
967
  "annotation-xml",
966
968
  "color-profile",
967
969
  "font-face",
@@ -970,48 +972,48 @@ function Dn() {
970
972
  "font-face-src",
971
973
  "font-face-uri",
972
974
  "missing-glyph"
973
- ]), et = function(e) {
974
- return !$e[It(e)] && qt(F, e);
975
- }, tt = function(e) {
976
- Xe(k.beforeSanitizeAttributes, e, null);
975
+ ]), $e = function(e) {
976
+ return !Qe[Ft(e)] && Kt(I, e);
977
+ }, et = function(e) {
978
+ Ye(k.beforeSanitizeAttributes, e, null);
977
979
  let n = e.attributes;
978
- if (!n || Je(e)) return;
980
+ if (!n || qe(e)) return;
979
981
  let r = {
980
982
  attrName: "",
981
983
  attrValue: "",
982
984
  keepAttr: !0,
983
- allowedAttributes: R,
985
+ allowedAttributes: z,
984
986
  forceKeepAttr: void 0
985
987
  }, i = n.length;
986
988
  for (; i--;) {
987
- let a = n[i], o = a.name, s = a.namespaceURI, c = a.value, l = W(o), u = c, d = o === "value" ? u : Vt(u);
988
- if (r.attrName = l, r.attrValue = d, r.keepAttr = !0, r.forceKeepAttr = void 0, Xe(k.uponSanitizeAttribute, e, r), d = r.attrValue, ge && (l === "id" || l === "name") && Bt(d, _e) !== 0 && (Ge(o, e), d = _e + d), le && qt(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, d)) {
989
- Ge(o, e);
989
+ let a = n[i], o = a.name, s = a.namespaceURI, c = a.value, l = G(o), u = c, d = o === "value" ? u : Bt(u);
990
+ if (r.attrName = l, r.attrValue = d, r.keepAttr = !0, r.forceKeepAttr = void 0, Ye(k.uponSanitizeAttribute, e, r), d = r.attrValue, he && (l === "id" || l === "name") && zt(d, ge) !== 0 && (We(o, e), d = ge + d), ce && Kt(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, d)) {
991
+ We(o, e);
990
992
  continue;
991
993
  }
992
- if (l === "attributename" && Rt(d, "href")) {
993
- Ge(o, e);
994
+ if (l === "attributename" && Lt(d, "href")) {
995
+ We(o, e);
994
996
  continue;
995
997
  }
996
998
  if (r.forceKeepAttr) continue;
997
999
  if (!r.keepAttr) {
998
- Ge(o, e);
1000
+ We(o, e);
999
1001
  continue;
1000
1002
  }
1001
- if (!H && qt(/\/>/i, d)) {
1002
- Ge(o, e);
1003
+ if (!U && Kt(/\/>/i, d)) {
1004
+ We(o, e);
1003
1005
  continue;
1004
1006
  }
1005
- ce && At([
1007
+ se && kt([
1006
1008
  A,
1007
1009
  j,
1008
- ee
1010
+ M
1009
1011
  ], (e) => {
1010
- d = zt(d, e, " ");
1012
+ d = Rt(d, e, " ");
1011
1013
  });
1012
- let f = W(e.nodeName);
1013
- if (!Qe(f, l, d)) {
1014
- Ge(o, e);
1014
+ let f = G(e.nodeName);
1015
+ if (!Ze(f, l, d)) {
1016
+ We(o, e);
1015
1017
  continue;
1016
1018
  }
1017
1019
  if (x && typeof m == "object" && typeof m.getAttributeType == "function" && !s) switch (m.getAttributeType(f, l)) {
@@ -1023,87 +1025,87 @@ function Dn() {
1023
1025
  break;
1024
1026
  }
1025
1027
  if (d !== u) try {
1026
- s ? e.setAttributeNS(s, o, d) : e.setAttribute(o, d), Je(e) ? We(e) : Mt(t.removed);
1028
+ s ? e.setAttributeNS(s, o, d) : e.setAttribute(o, d), qe(e) ? Ue(e) : jt(t.removed);
1027
1029
  } catch {
1028
- Ge(o, e);
1030
+ We(o, e);
1029
1031
  }
1030
1032
  }
1031
- Xe(k.afterSanitizeAttributes, e, null);
1033
+ Ye(k.afterSanitizeAttributes, e, null);
1034
+ }, tt = function(e) {
1035
+ let t = null, n = Ke(e);
1036
+ for (Ye(k.beforeSanitizeShadowDOM, e, null); t = n.nextNode();) Ye(k.uponSanitizeShadowNode, t, null), Xe(t), et(t), t.content instanceof a && tt(t.content);
1037
+ Ye(k.afterSanitizeShadowDOM, e, null);
1032
1038
  }, nt = function(e) {
1033
- let t = null, n = qe(e);
1034
- for (Xe(k.beforeSanitizeShadowDOM, e, null); t = n.nextNode();) Xe(k.uponSanitizeShadowNode, t, null), Ze(t), tt(t), t.content instanceof a && nt(t.content);
1035
- Xe(k.afterSanitizeShadowDOM, e, null);
1036
- }, rt = function(e) {
1037
1039
  if (e.nodeType === Cn.element && e.shadowRoot instanceof a) {
1038
1040
  let t = e.shadowRoot;
1039
- rt(t), nt(t);
1041
+ nt(t), tt(t);
1040
1042
  }
1041
1043
  let t = e.childNodes;
1042
1044
  if (!t) return;
1043
1045
  let n = [];
1044
- At(t, (e) => {
1045
- Nt(n, e);
1046
+ kt(t, (e) => {
1047
+ Mt(n, e);
1046
1048
  });
1047
- for (let e of n) rt(e);
1049
+ for (let e of n) nt(e);
1048
1050
  };
1049
1051
  return t.sanitize = function(e) {
1050
1052
  let n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, i = null, o = null, c = null, l = null;
1051
- if (je = !e, je && (e = "<!-->"), typeof e != "string" && !Ye(e) && (e = Qt(e), typeof e != "string")) throw Jt("dirty is not a string, aborting");
1053
+ if (Ae = !e, Ae && (e = "<!-->"), typeof e != "string" && !Je(e) && (e = Qt(e), typeof e != "string")) throw qt("dirty is not a string, aborting");
1052
1054
  if (!t.isSupported) return e;
1053
- if (de || K(n), t.removed = [], typeof e == "string" && (ye = !1), ye) {
1055
+ if (ue || q(n), t.removed = [], typeof e == "string" && (ve = !1), ve) {
1054
1056
  let t = e.nodeName;
1055
1057
  if (typeof t == "string") {
1056
- let e = W(t);
1057
- if (!I[e] || ie[e]) throw Jt("root node is forbidden and cannot be sanitized in-place");
1058
+ let e = G(t);
1059
+ if (!L[e] || re[e]) throw qt("root node is forbidden and cannot be sanitized in-place");
1058
1060
  }
1059
- rt(e);
1060
- } else if (e instanceof s) i = Ke("<!---->"), o = i.ownerDocument.importNode(e, !0), o.nodeType === Cn.element && o.nodeName === "BODY" || o.nodeName === "HTML" ? i = o : i.appendChild(o), rt(o);
1061
+ nt(e);
1062
+ } else if (e instanceof s) i = Ge("<!---->"), o = i.ownerDocument.importNode(e, !0), o.nodeType === Cn.element && o.nodeName === "BODY" || o.nodeName === "HTML" ? i = o : i.appendChild(o), nt(o);
1061
1063
  else {
1062
- if (!U && !ce && !ue && e.indexOf("<") === -1) return x && me ? x.createHTML(e) : e;
1063
- if (i = Ke(e), !i) return U ? null : me ? S : "";
1064
- }
1065
- i && fe && We(i.firstChild);
1066
- let u = qe(ye ? e : i);
1067
- for (; c = u.nextNode();) Ze(c), tt(c), c.content instanceof a && nt(c.content);
1068
- if (ye) return e;
1069
- if (U) {
1070
- if (ce) {
1064
+ if (!W && !se && !le && e.indexOf("<") === -1) return x && pe ? x.createHTML(e) : e;
1065
+ if (i = Ge(e), !i) return W ? null : pe ? S : "";
1066
+ }
1067
+ i && de && Ue(i.firstChild);
1068
+ let u = Ke(ve ? e : i);
1069
+ for (; c = u.nextNode();) Xe(c), et(c), c.content instanceof a && tt(c.content);
1070
+ if (ve) return e;
1071
+ if (W) {
1072
+ if (se) {
1071
1073
  i.normalize();
1072
1074
  let e = i.innerHTML;
1073
- At([
1075
+ kt([
1074
1076
  A,
1075
1077
  j,
1076
- ee
1078
+ M
1077
1079
  ], (t) => {
1078
- e = zt(e, t, " ");
1080
+ e = Rt(e, t, " ");
1079
1081
  }), i.innerHTML = e;
1080
1082
  }
1081
- if (pe) for (l = E.call(i.ownerDocument); i.firstChild;) l.appendChild(i.firstChild);
1083
+ if (fe) for (l = E.call(i.ownerDocument); i.firstChild;) l.appendChild(i.firstChild);
1082
1084
  else l = i;
1083
- return (R.shadowroot || R.shadowrootmode) && (l = O.call(r, l, !0)), l;
1085
+ return (z.shadowroot || z.shadowrootmode) && (l = O.call(r, l, !0)), l;
1084
1086
  }
1085
- let d = ue ? i.outerHTML : i.innerHTML;
1086
- return ue && I["!doctype"] && i.ownerDocument && i.ownerDocument.doctype && i.ownerDocument.doctype.name && qt(xn, i.ownerDocument.doctype.name) && (d = "<!DOCTYPE " + i.ownerDocument.doctype.name + ">\n" + d), ce && At([
1087
+ let d = le ? i.outerHTML : i.innerHTML;
1088
+ return le && L["!doctype"] && i.ownerDocument && i.ownerDocument.doctype && i.ownerDocument.doctype.name && Kt(xn, i.ownerDocument.doctype.name) && (d = "<!DOCTYPE " + i.ownerDocument.doctype.name + ">\n" + d), se && kt([
1087
1089
  A,
1088
1090
  j,
1089
- ee
1091
+ M
1090
1092
  ], (e) => {
1091
- d = zt(d, e, " ");
1092
- }), x && me ? x.createHTML(d) : d;
1093
+ d = Rt(d, e, " ");
1094
+ }), x && pe ? x.createHTML(d) : d;
1093
1095
  }, t.setConfig = function() {
1094
- K(arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}), de = !0;
1096
+ q(arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}), ue = !0;
1095
1097
  }, t.clearConfig = function() {
1096
- ze = null, de = !1;
1098
+ Re = null, ue = !1;
1097
1099
  }, t.isValidAttribute = function(e, t, n) {
1098
- return ze || K({}), Qe(W(e), W(t), n);
1100
+ return Re || q({}), Ze(G(e), G(t), n);
1099
1101
  }, t.addHook = function(e, t) {
1100
- typeof t == "function" && Nt(k[e], t);
1102
+ typeof t == "function" && Mt(k[e], t);
1101
1103
  }, t.removeHook = function(e, t) {
1102
1104
  if (t !== void 0) {
1103
- let n = jt(k[e], t);
1104
- return n === -1 ? void 0 : Pt(k[e], n, 1)[0];
1105
+ let n = At(k[e], t);
1106
+ return n === -1 ? void 0 : Nt(k[e], n, 1)[0];
1105
1107
  }
1106
- return Mt(k[e]);
1108
+ return jt(k[e]);
1107
1109
  }, t.removeHooks = function(e) {
1108
1110
  k[e] = [];
1109
1111
  }, t.removeAllHooks = function() {
@@ -1309,12 +1311,12 @@ In.prototype.parse = function(e, t) {
1309
1311
  };
1310
1312
  //#endregion
1311
1313
  //#region node_modules/mdurl/index.mjs
1312
- var Jn = /* @__PURE__ */ le({
1314
+ var Jn = /* @__PURE__ */ ce({
1313
1315
  decode: () => jn,
1314
1316
  encode: () => Pn,
1315
1317
  format: () => Fn,
1316
1318
  parse: () => qn
1317
- }), Yn = /[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/, Xn = /[\0-\x1F\x7F-\x9F]/, Zn = /[\xAD\u0600-\u0605\u061C\u06DD\u070F\u0890\u0891\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB]|\uD804[\uDCBD\uDCCD]|\uD80D[\uDC30-\uDC3F]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]/, Qn = /[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1B7D\u1B7E\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDEAD\uDF55-\uDF59\uDF86-\uDF89]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5A\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDEB9\uDF3C-\uDF3E]|\uD806[\uDC3B\uDD44-\uDD46\uDDE2\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2\uDF00-\uDF09]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8\uDF43-\uDF4F\uDFFF]|\uD809[\uDC70-\uDC74]|\uD80B[\uDFF1\uDFF2]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A\uDFE2]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]/, $n = /[\$\+<->\^`\|~\xA2-\xA6\xA8\xA9\xAC\xAE-\xB1\xB4\xB8\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0384\u0385\u03F6\u0482\u058D-\u058F\u0606-\u0608\u060B\u060E\u060F\u06DE\u06E9\u06FD\u06FE\u07F6\u07FE\u07FF\u0888\u09F2\u09F3\u09FA\u09FB\u0AF1\u0B70\u0BF3-\u0BFA\u0C7F\u0D4F\u0D79\u0E3F\u0F01-\u0F03\u0F13\u0F15-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE\u0FCF\u0FD5-\u0FD8\u109E\u109F\u1390-\u1399\u166D\u17DB\u1940\u19DE-\u19FF\u1B61-\u1B6A\u1B74-\u1B7C\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2044\u2052\u207A-\u207C\u208A-\u208C\u20A0-\u20C0\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2307\u230C-\u2328\u232B-\u2426\u2440-\u244A\u249C-\u24E9\u2500-\u2767\u2794-\u27C4\u27C7-\u27E5\u27F0-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2B73\u2B76-\u2B95\u2B97-\u2BFF\u2CE5-\u2CEA\u2E50\u2E51\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFF\u3004\u3012\u3013\u3020\u3036\u3037\u303E\u303F\u309B\u309C\u3190\u3191\u3196-\u319F\u31C0-\u31E3\u31EF\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uAA77-\uAA79\uAB5B\uAB6A\uAB6B\uFB29\uFBB2-\uFBC2\uFD40-\uFD4F\uFDCF\uFDFC-\uFDFF\uFE62\uFE64-\uFE66\uFE69\uFF04\uFF0B\uFF1C-\uFF1E\uFF3E\uFF40\uFF5C\uFF5E\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFFC\uFFFD]|\uD800[\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9C\uDDA0\uDDD0-\uDDFC]|\uD802[\uDC77\uDC78\uDEC8]|\uD805\uDF3F|\uD807[\uDFD5-\uDFF1]|\uD81A[\uDF3C-\uDF3F\uDF45]|\uD82F\uDC9C|\uD833[\uDF50-\uDFC3]|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDEA\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85\uDE86]|\uD838[\uDD4F\uDEFF]|\uD83B[\uDCAC\uDCB0\uDD2E\uDEF0\uDEF1]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD0D-\uDDAD\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED7\uDEDC-\uDEEC\uDEF0-\uDEFC\uDF00-\uDF76\uDF7B-\uDFD9\uDFE0-\uDFEB\uDFF0]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDCB0\uDCB1\uDD00-\uDE53\uDE60-\uDE6D\uDE70-\uDE7C\uDE80-\uDE88\uDE90-\uDEBD\uDEBF-\uDEC5\uDECE-\uDEDB\uDEE0-\uDEE8\uDEF0-\uDEF8\uDF00-\uDF92\uDF94-\uDFCA]/, er = /[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/, tr = /* @__PURE__ */ le({
1319
+ }), Yn = /[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/, Xn = /[\0-\x1F\x7F-\x9F]/, Zn = /[\xAD\u0600-\u0605\u061C\u06DD\u070F\u0890\u0891\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB]|\uD804[\uDCBD\uDCCD]|\uD80D[\uDC30-\uDC3F]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]/, Qn = /[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1B7D\u1B7E\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDEAD\uDF55-\uDF59\uDF86-\uDF89]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5A\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDEB9\uDF3C-\uDF3E]|\uD806[\uDC3B\uDD44-\uDD46\uDDE2\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2\uDF00-\uDF09]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8\uDF43-\uDF4F\uDFFF]|\uD809[\uDC70-\uDC74]|\uD80B[\uDFF1\uDFF2]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A\uDFE2]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]/, $n = /[\$\+<->\^`\|~\xA2-\xA6\xA8\xA9\xAC\xAE-\xB1\xB4\xB8\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0384\u0385\u03F6\u0482\u058D-\u058F\u0606-\u0608\u060B\u060E\u060F\u06DE\u06E9\u06FD\u06FE\u07F6\u07FE\u07FF\u0888\u09F2\u09F3\u09FA\u09FB\u0AF1\u0B70\u0BF3-\u0BFA\u0C7F\u0D4F\u0D79\u0E3F\u0F01-\u0F03\u0F13\u0F15-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE\u0FCF\u0FD5-\u0FD8\u109E\u109F\u1390-\u1399\u166D\u17DB\u1940\u19DE-\u19FF\u1B61-\u1B6A\u1B74-\u1B7C\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2044\u2052\u207A-\u207C\u208A-\u208C\u20A0-\u20C0\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2307\u230C-\u2328\u232B-\u2426\u2440-\u244A\u249C-\u24E9\u2500-\u2767\u2794-\u27C4\u27C7-\u27E5\u27F0-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2B73\u2B76-\u2B95\u2B97-\u2BFF\u2CE5-\u2CEA\u2E50\u2E51\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFF\u3004\u3012\u3013\u3020\u3036\u3037\u303E\u303F\u309B\u309C\u3190\u3191\u3196-\u319F\u31C0-\u31E3\u31EF\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uAA77-\uAA79\uAB5B\uAB6A\uAB6B\uFB29\uFBB2-\uFBC2\uFD40-\uFD4F\uFDCF\uFDFC-\uFDFF\uFE62\uFE64-\uFE66\uFE69\uFF04\uFF0B\uFF1C-\uFF1E\uFF3E\uFF40\uFF5C\uFF5E\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFFC\uFFFD]|\uD800[\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9C\uDDA0\uDDD0-\uDDFC]|\uD802[\uDC77\uDC78\uDEC8]|\uD805\uDF3F|\uD807[\uDFD5-\uDFF1]|\uD81A[\uDF3C-\uDF3F\uDF45]|\uD82F\uDC9C|\uD833[\uDF50-\uDFC3]|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDEA\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85\uDE86]|\uD838[\uDD4F\uDEFF]|\uD83B[\uDCAC\uDCB0\uDD2E\uDEF0\uDEF1]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD0D-\uDDAD\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED7\uDEDC-\uDEEC\uDEF0-\uDEFC\uDF00-\uDF76\uDF7B-\uDFD9\uDFE0-\uDFEB\uDFF0]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDCB0\uDCB1\uDD00-\uDE53\uDE60-\uDE6D\uDE70-\uDE7C\uDE80-\uDE88\uDE90-\uDEBD\uDEBF-\uDEC5\uDECE-\uDEDB\uDEE0-\uDEE8\uDEF0-\uDEF8\uDF00-\uDF92\uDF94-\uDFCA]/, er = /[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/, tr = /* @__PURE__ */ ce({
1318
1320
  Any: () => Yn,
1319
1321
  Cc: () => Xn,
1320
1322
  Cf: () => Zn,
@@ -1509,7 +1511,7 @@ function br(e, t = hr.Legacy) {
1509
1511
  }
1510
1512
  //#endregion
1511
1513
  //#region node_modules/markdown-it/lib/common/utils.mjs
1512
- var xr = /* @__PURE__ */ le({
1514
+ var xr = /* @__PURE__ */ ce({
1513
1515
  arrayReplaceAt: () => Dr,
1514
1516
  assign: () => Er,
1515
1517
  escapeHtml: () => Br,
@@ -1744,7 +1746,7 @@ function Xr(e, t, n, r) {
1744
1746
  }
1745
1747
  //#endregion
1746
1748
  //#region node_modules/markdown-it/lib/helpers/index.mjs
1747
- var Zr = /* @__PURE__ */ le({
1749
+ var Zr = /* @__PURE__ */ ce({
1748
1750
  parseLinkDestination: () => Yr,
1749
1751
  parseLinkLabel: () => Jr,
1750
1752
  parseLinkTitle: () => Xr
@@ -3725,7 +3727,7 @@ var Io = new Fo({
3725
3727
  "href",
3726
3728
  "target",
3727
3729
  "rel",
3728
- Ge,
3730
+ We,
3729
3731
  "class"
3730
3732
  ], zo = [
3731
3733
  "br",
@@ -3739,8 +3741,8 @@ var Io = new Fo({
3739
3741
  ], Bo = /<(?:\/)?(?:div|p|li|h[1-6]|blockquote|pre)[^>]*>/gi, Vo = /<\/(?:div|p|li|h[1-6]|blockquote|pre)>/gi, Ho = /<(?:div|p|li|h[1-6]|blockquote|pre)[^>]*>/gi, Uo = /&nbsp;/gi, Wo = /https?:\/\/[^\s<>()]+[^\s<>().,!?;:]/i, Go = /(^|[\s([{"'`])((?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\.)+[a-z]{2,}(?:\/[^\s<]*)?)/gi, Ko = /[),.!?;:]+$/;
3740
3742
  function qo(e) {
3741
3743
  if (!e) return "";
3742
- let { shielded: t, tokens: n } = et(e), r = t.replace(/\r\n?/g, "\n").replace(Ho, "").replace(Vo, "<br>").replace(Uo, " ");
3743
- return tt(On.sanitize(r, {
3744
+ let { shielded: t, tokens: n } = $e(e), r = t.replace(/\r\n?/g, "\n").replace(Ho, "").replace(Vo, "<br>").replace(Uo, " ");
3745
+ return et(On.sanitize(r, {
3744
3746
  ALLOWED_TAGS: zo,
3745
3747
  ALLOWED_ATTR: Ro,
3746
3748
  ALLOW_DATA_ATTR: !1
@@ -3748,12 +3750,12 @@ function qo(e) {
3748
3750
  }
3749
3751
  function Jo(e, t) {
3750
3752
  if (!e) return "";
3751
- let n = ut(Qe(e), t ?? {}).replace(/<br\s*\/?>/gi, "\n").replace(Bo, (e) => e.startsWith("</") ? "\n" : "");
3753
+ let n = lt(Ze(e), t ?? {}).replace(/<br\s*\/?>/gi, "\n").replace(Bo, (e) => e.startsWith("</") ? "\n" : "");
3752
3754
  return (new DOMParser().parseFromString(`<div>${n}</div>`, "text/html").body.textContent ?? "").replace(/\u00a0/g, " ").replace(/\n{3,}/g, "\n\n").trim();
3753
3755
  }
3754
3756
  function Yo(e, t) {
3755
3757
  if (!e) return "";
3756
- let n = Qe(e), r = qo($e(n) ? it(n, t?.mentionNameByUid ?? {}) : n);
3758
+ let n = Ze(e), r = qo(Qe(n) ? rt(n, t?.mentionNameByUid ?? {}) : n);
3757
3759
  if (!r) return "";
3758
3760
  let i = Io.render(ts(r));
3759
3761
  return On.sanitize(i, {
@@ -3778,7 +3780,7 @@ function $o(e) {
3778
3780
  return e.replace(/\n{2,}/g, (e) => "\n" + "<br>".repeat(e.length - 1));
3779
3781
  }
3780
3782
  function es(e, t) {
3781
- return e.replace(Ve, (e, n) => `<span class="${qe}">@${(t ?? []).find((e) => e.getUid?.() === n)?.getName?.() ?? n}</span>`);
3783
+ return e.replace(Be, (e, n) => `<span class="${Ke}">@${(t ?? []).find((e) => e.getUid?.() === n)?.getName?.() ?? n}</span>`);
3782
3784
  }
3783
3785
  function ts(e) {
3784
3786
  let t = new DOMParser().parseFromString(`<div>${e}</div>`, "text/html"), n = t.body.firstElementChild;
@@ -3828,23 +3830,23 @@ function is(e) {
3828
3830
  function as(e, t) {
3829
3831
  if (!e) return t;
3830
3832
  switch (e.kind) {
3831
- case "image": return G("photo");
3832
- case "video": return G("video");
3833
- case "audio": return G("audio");
3833
+ case "image": return K("photo");
3834
+ case "video": return K("video");
3835
+ case "audio": return K("audio");
3834
3836
  case "file": return e.name || t;
3835
3837
  default: return t;
3836
3838
  }
3837
3839
  }
3838
- function os(e, t = G("attachment")) {
3840
+ function os(e, t = K("attachment")) {
3839
3841
  return as(e[0], t);
3840
3842
  }
3841
3843
  function ss(e, t) {
3842
- let n = Qe(e ?? "");
3843
- return n ? $e(n) && t ? qo(rt(n, t)) : qo(n) : "";
3844
+ let n = Ze(e ?? "");
3845
+ return n ? Qe(n) && t ? qo(nt(n, t)) : qo(n) : "";
3844
3846
  }
3845
3847
  function cs(e) {
3846
3848
  let t = qo(e);
3847
- return t ? at(t) : "";
3849
+ return t ? it(t) : "";
3848
3850
  }
3849
3851
  function ls(e) {
3850
3852
  return Jo(e).length > 0;
@@ -3852,23 +3854,23 @@ function ls(e) {
3852
3854
  function us(e, t) {
3853
3855
  return Jo(e, t);
3854
3856
  }
3855
- function ds(e, t = G("message"), n) {
3857
+ function ds(e, t = K("message"), n) {
3856
3858
  if (e.kind === "poll" && e.poll) return e.poll.question;
3857
3859
  let r = us(e.text, n);
3858
3860
  return e.attachments.length > 0 ? r || os(e.attachments, t) : r || t;
3859
3861
  }
3860
3862
  function fs(e) {
3861
- return ds(e, e.attachments.length > 0 ? G("attachment") : G("message"));
3863
+ return ds(e, e.attachments.length > 0 ? K("attachment") : K("message"));
3862
3864
  }
3863
3865
  function ps(e, t = !1, n = !0) {
3864
3866
  if (!e) return "";
3865
3867
  if (e.getDeletedAt?.() != null) return "(Message removed)";
3866
- if (e instanceof H.TextMessage) return e.getText?.() ?? "";
3867
- if (e instanceof H.MediaMessage) {
3868
+ if (e instanceof U.TextMessage) return e.getText?.() ?? "";
3869
+ if (e instanceof U.MediaMessage) {
3868
3870
  let r = n ? e.getAttachment?.()?.getName?.() ?? "" : "", i = e.getCaption?.()?.trim?.() ?? "", a = e.getType?.();
3869
3871
  return a === "image" ? `${t ? "🖼️ " : ""}${i || "Photo"}` : a === "video" ? `${t ? "🎥 " : ""}${i || r || "Video"}` : a === "audio" ? `${t ? "🎤 " : ""}${r || "Audio message"}` : a === "file" ? `${t ? "📄 " : ""}${i || r || "File"}` : `${t ? "🖼️ " : ""}${i || r || "Media message"}`;
3870
3872
  }
3871
- if (e instanceof H.Action) {
3873
+ if (e instanceof U.Action) {
3872
3874
  let t = (e.getActionFor?.()?.getMetadata?.() ?? e.getReceiver?.()?.getMetadata?.() ?? {}).systemDisplayName, n = (e.getActionBy?.())?.getName?.() ?? "", r = e.getMessage?.() ?? "";
3873
3875
  return typeof t == "string" && t.trim() && n ? r.replace(n, t.trim()) : r;
3874
3876
  }
@@ -3898,9 +3900,9 @@ function gs(e) {
3898
3900
  return hs(e).join("\n").trim();
3899
3901
  }
3900
3902
  function _s(e) {
3901
- if (e.kind === "poll" && e.poll) return G("pollPrefix", { question: e.poll.question });
3902
- let t = lt(e.source);
3903
- return ds(e, e.attachments.length > 0 ? G("sentAnAttachment") : G("youSentAMessage"), t);
3903
+ if (e.kind === "poll" && e.poll) return K("pollPrefix", { question: e.poll.question });
3904
+ let t = ct(e.source);
3905
+ return ds(e, e.attachments.length > 0 ? K("sentAnAttachment") : K("youSentAMessage"), t);
3904
3906
  }
3905
3907
  //#endregion
3906
3908
  //#region src/chat/offlineStore.ts
@@ -4148,148 +4150,148 @@ function Ts(e) {
4148
4150
  //#region src/chat/client.ts
4149
4151
  var Es = null, Ds = null;
4150
4152
  function Os({ environment: e }) {
4151
- fe(e);
4153
+ de(e);
4152
4154
  let t = w(!1), r = w(!1), i = w(!1), a = w(!1), o = w(!1), s = w(!1), c = w(!1), l = w(!1), u = w(!1), d = w(!1), f = w(!1), p = w(!1), m = w(typeof navigator < "u" ? !navigator.onLine : !1), h = w(!1), g = w(null), _ = w(null), v = w([]), y = w([]), b = w([]), x = w([]), S = w(!1), C = w(!1), T = w(null), E = w(null), D = w(null), O = w(null), k = w([]), A = w({}), j = n(() => k.value.length);
4153
- function ee(e) {
4155
+ function M(e) {
4154
4156
  if (!e.length) return;
4155
4157
  let t = { ...A.value };
4156
4158
  for (let n of e) n.uid && n.displayName.trim() && (t[n.uid] = n.displayName);
4157
4159
  A.value = t;
4158
4160
  }
4159
- function te(e) {
4160
- ee(Object.entries(lt(e)).map(([e, t]) => ({
4161
+ function ee(e) {
4162
+ M(Object.entries(ct(e)).map(([e, t]) => ({
4161
4163
  uid: e,
4162
4164
  displayName: t
4163
4165
  })));
4164
4166
  }
4165
- function M(e, t) {
4166
- return te(e), Ms(e, t);
4167
+ function N(e, t) {
4168
+ return ee(e), Ms(e, t);
4167
4169
  }
4168
- let N = n(() => v.value.find((e) => e.id === T.value) ?? null), P = `bcc-ui-connection-${crypto.randomUUID()}`, F = `bcc-ui-message-${crypto.randomUUID()}`, ne = !1, I = !1, L = null, R = null, re = null, z = null, ie = 0, ae = 0, B = !1, oe = !1, V = null, se = /* @__PURE__ */ new Map(), ce = /* @__PURE__ */ new Set(), le = null, ue = null, de = 0;
4169
- async function pe() {
4170
- await ks(e), !t.value && (be(), ct(), t.value = !0, await st(), _.value && (Fe(_.value.uid), ge(), Ae(), !m.value && !oe && Oe()));
4170
+ let P = n(() => v.value.find((e) => e.id === T.value) ?? null), F = `bcc-ui-connection-${crypto.randomUUID()}`, I = `bcc-ui-message-${crypto.randomUUID()}`, te = !1, L = !1, R = null, z = null, ne = null, B = null, re = 0, ie = 0, V = !1, ae = !1, H = null, oe = /* @__PURE__ */ new Map(), se = /* @__PURE__ */ new Set(), ce = null, le = null, ue = 0;
4171
+ async function fe() {
4172
+ await ks(e), !t.value && (ye(), ut(), t.value = !0, await lt(), _.value && (Pe(_.value.uid), he(), ke(), !m.value && !ae && De()));
4171
4173
  }
4172
- async function me(e) {
4174
+ async function pe(e) {
4173
4175
  g.value = null, r.value = !0;
4174
4176
  try {
4175
- await pe();
4176
- let t = _e();
4177
- await H.getLoggedinUser() && t !== e && await H.logout(), ve(e);
4177
+ await fe();
4178
+ let t = ge();
4179
+ await U.getLoggedinUser() && t !== e && await U.logout(), _e(e);
4178
4180
  let n = await As(e);
4179
- _.value = Fs(await H.login(n)), Fe(_.value.uid), h.value = !0, m.value = typeof navigator < "u" ? !navigator.onLine : !1, ge(), Ae(), oe || await Oe(), await Ie(), Ut();
4181
+ _.value = Fs(await U.login(n)), Pe(_.value.uid), h.value = !0, m.value = typeof navigator < "u" ? !navigator.onLine : !1, he(), ke(), ae || await De(), await Fe(), Wt();
4180
4182
  } catch (e) {
4181
- throw yt(), g.value = Z(e, "Unable to sign in to chat."), e;
4183
+ throw bt(), g.value = Z(e, "Unable to sign in to chat."), e;
4182
4184
  } finally {
4183
4185
  r.value = !1;
4184
4186
  }
4185
4187
  }
4186
- async function he() {
4188
+ async function me() {
4187
4189
  g.value = null;
4188
4190
  try {
4189
- ve(null), Se(), await H.getLoggedinUser() && await H.logout();
4191
+ _e(null), xe(), await U.getLoggedinUser() && await U.logout();
4190
4192
  } finally {
4191
- yt();
4193
+ bt();
4192
4194
  }
4193
4195
  }
4194
- function ge() {
4195
- let e = Ne();
4196
+ function he() {
4197
+ let e = Me();
4196
4198
  if (!e) {
4197
- V = null, k.value = [];
4199
+ H = null, k.value = [];
4198
4200
  return;
4199
4201
  }
4200
- let t = `bcc-chat:${U().appId}:${e}`;
4201
- ye(t), V = new ys(t), k.value = V.getQueue();
4202
+ let t = `bcc-chat:${W().appId}:${e}`;
4203
+ ve(t), H = new ys(t), k.value = H.getQueue();
4202
4204
  }
4203
- function ye(e) {
4205
+ function ve(e) {
4204
4206
  if (typeof window > "u") return;
4205
- let t = `bcc-chat:${U().appId}:`, n = [];
4207
+ let t = `bcc-chat:${W().appId}:`, n = [];
4206
4208
  for (let r = 0; r < window.localStorage.length; r += 1) {
4207
4209
  let i = window.localStorage.key(r);
4208
4210
  i && i.startsWith(t) && i !== e && n.push(i);
4209
4211
  }
4210
4212
  n.forEach((e) => window.localStorage.removeItem(e));
4211
4213
  }
4214
+ function ye() {
4215
+ L || typeof window > "u" || (window.addEventListener("online", be), window.addEventListener("offline", Se), L = !0);
4216
+ }
4212
4217
  function be() {
4213
- I || typeof window > "u" || (window.addEventListener("online", xe), window.addEventListener("offline", Ce), I = !0);
4218
+ m.value = !1, V = !0, ae || Ee(!0);
4214
4219
  }
4215
- function xe() {
4216
- m.value = !1, B = !0, oe || De(!0);
4220
+ function Se() {
4221
+ m.value = !0, p.value = !1, Ce();
4217
4222
  }
4218
4223
  function Ce() {
4219
- m.value = !0, p.value = !1, we();
4224
+ R !== null && (clearTimeout(R), R = null);
4220
4225
  }
4221
4226
  function we() {
4222
- L !== null && (clearTimeout(L), L = null);
4227
+ re = Date.now() + 1500;
4223
4228
  }
4224
4229
  function Te() {
4225
- ie = Date.now() + 1500;
4226
- }
4227
- function Ee() {
4228
- return Date.now() < ie;
4230
+ return Date.now() < re;
4229
4231
  }
4230
- function De(e = !1) {
4231
- if (L !== null || R || m.value || !h.value || oe) return;
4232
- let t = e ? 0 : Math.min(3e4, 1e3 * 2 ** Math.min(ae, 4));
4233
- L = setTimeout(() => {
4234
- L = null, Oe();
4232
+ function Ee(e = !1) {
4233
+ if (R !== null || z || m.value || !h.value || ae) return;
4234
+ let t = e ? 0 : Math.min(3e4, 1e3 * 2 ** Math.min(ie, 4));
4235
+ R = setTimeout(() => {
4236
+ R = null, De();
4235
4237
  }, t);
4236
4238
  }
4237
- async function Oe() {
4238
- if (!(m.value || !h.value || oe)) return R || (R = (async () => {
4239
- we();
4239
+ async function De() {
4240
+ if (!(m.value || !h.value || ae)) return z || (z = (async () => {
4241
+ Ce();
4240
4242
  try {
4241
- let e = await H.getLoggedinUser();
4243
+ let e = await U.getLoggedinUser();
4242
4244
  if (!e) {
4243
- let t = _e();
4245
+ let t = ge();
4244
4246
  if (!t) return;
4245
4247
  let n = await As(t);
4246
- e = await H.login(n);
4248
+ e = await U.login(n);
4247
4249
  }
4248
- _.value = Fs(e), h.value = !0, ge();
4249
- let t = H.connect;
4250
- typeof t == "function" && (await t.call(H), p.value = !0), ae = 0, B && await ke();
4250
+ _.value = Fs(e), h.value = !0, he();
4251
+ let t = U.connect;
4252
+ typeof t == "function" && (await t.call(U), p.value = !0), ie = 0, V && await Oe();
4251
4253
  } catch (e) {
4252
- p.value = !1, ae += 1, Pt(e) || (g.value = Z(e, "Unable to reconnect to chat.")), De();
4254
+ p.value = !1, ie += 1, Ft(e) || (g.value = Z(e, "Unable to reconnect to chat.")), Ee();
4253
4255
  } finally {
4254
- R = null;
4256
+ z = null;
4255
4257
  }
4256
- })(), R);
4258
+ })(), z);
4257
4259
  }
4258
- async function ke() {
4259
- return re || m.value || !h.value || oe || (re = (async () => {
4260
- B = !1, g.value = null;
4260
+ async function Oe() {
4261
+ return ne || m.value || !h.value || ae || (ne = (async () => {
4262
+ V = !1, g.value = null;
4261
4263
  try {
4262
- await Ie(), Ut();
4264
+ await Fe(), Wt();
4263
4265
  } finally {
4264
- re = null;
4266
+ ne = null;
4265
4267
  }
4266
- })()), re;
4268
+ })()), ne;
4267
4269
  }
4268
- function Ae() {
4269
- if (!V || v.value.length > 0) return;
4270
- let e = V.getConversations();
4271
- e.length !== 0 && (v.value = Bs(e), !T.value && v.value.length > 0 && je(T.value));
4270
+ function ke() {
4271
+ if (!H || v.value.length > 0) return;
4272
+ let e = H.getConversations();
4273
+ e.length !== 0 && (v.value = Bs(e), !T.value && v.value.length > 0 && Ae(T.value));
4272
4274
  }
4273
- function je(e) {
4274
- if (!V || !e) return y.value = [], !1;
4275
- let t = V.getMessages(e).sort(Vs);
4275
+ function Ae(e) {
4276
+ if (!H || !e) return y.value = [], !1;
4277
+ let t = H.getMessages(e).sort(Vs);
4276
4278
  return y.value = t, t.length > 0;
4277
4279
  }
4278
- async function Me() {
4279
- oe = !1, B = !0, await Oe();
4280
+ async function je() {
4281
+ ae = !1, V = !0, await De();
4280
4282
  }
4281
- async function Pe() {
4282
- oe = !0, B = !1, we();
4283
- let e = H.disconnect;
4284
- typeof e == "function" && await e.call(H), p.value = !1;
4283
+ async function Ne() {
4284
+ ae = !0, V = !1, Ce();
4285
+ let e = U.disconnect;
4286
+ typeof e == "function" && await e.call(U), p.value = !1;
4285
4287
  }
4286
- async function Ie() {
4287
- if (await pe(), i.value = !0, g.value = null, m.value && V) {
4288
- v.value = Bs(V.getConversations()), N.value && await tt(), i.value = !1;
4288
+ async function Fe() {
4289
+ if (await fe(), i.value = !0, g.value = null, m.value && H) {
4290
+ v.value = Bs(H.getConversations()), P.value && await nt(), i.value = !1;
4289
4291
  return;
4290
4292
  }
4291
4293
  try {
4292
- let e = new H.ConversationsRequestBuilder().setLimit(50).withTags(!0).setConversationType(H.RECEIVER_TYPE.GROUP).build(), t = [], n = [];
4294
+ let e = new U.ConversationsRequestBuilder().setLimit(50).withTags(!0).setConversationType(U.RECEIVER_TYPE.GROUP).build(), t = [], n = [];
4293
4295
  do
4294
4296
  n = await e.fetchNext(), t.push(...n.map((e) => js(e, _.value?.uid)));
4295
4297
  while (n.length === 50);
@@ -4298,9 +4300,9 @@ function Os({ environment: e }) {
4298
4300
  let t = r.get(e.id);
4299
4301
  t && (e.subtitle === "No messages yet" && t.subtitle && t.subtitle !== "No messages yet" && (e.subtitle = t.subtitle), !e.lastMessageAt && t.lastMessageAt && (e.lastMessageAt = t.lastMessageAt));
4300
4302
  }
4301
- v.value = Bs(await dt(t)), V?.setConversations(v.value), N.value && await tt();
4303
+ v.value = Bs(await ft(t)), H?.setConversations(v.value), P.value && await nt();
4302
4304
  } catch (e) {
4303
- let t = V?.getConversations() ?? [];
4305
+ let t = H?.getConversations() ?? [];
4304
4306
  if (t.length > 0) {
4305
4307
  v.value = Bs(t);
4306
4308
  return;
@@ -4310,39 +4312,39 @@ function Os({ environment: e }) {
4310
4312
  i.value = !1;
4311
4313
  }
4312
4314
  }
4313
- async function Le(e) {
4314
- T.value = e, E.value = null, b.value = [], ue = null, C.value = !1, D.value = null, O.value = null, je(e), await tt();
4315
+ async function Ie(e) {
4316
+ T.value = e, E.value = null, b.value = [], le = null, C.value = !1, D.value = null, O.value = null, Ae(e), await nt();
4315
4317
  }
4316
- function Re(e) {
4318
+ function Le(e) {
4317
4319
  e && (O.value = null), D.value = e;
4318
4320
  }
4319
- function W(e) {
4321
+ function G(e) {
4320
4322
  e && (D.value = null), O.value = e;
4321
4323
  }
4322
- async function ze(e) {
4323
- E.value = e, ue = null, C.value = !1, D.value = null, O.value = null, await rt(e.id);
4324
+ async function Re(e) {
4325
+ E.value = e, le = null, C.value = !1, D.value = null, O.value = null, await it(e.id);
4324
4326
  }
4325
- function Be() {
4326
- E.value = null, b.value = [], ue = null, C.value = !1, D.value = null, O.value = null;
4327
+ function ze() {
4328
+ E.value = null, b.value = [], le = null, C.value = !1, D.value = null, O.value = null;
4327
4329
  }
4328
- async function K(e, t) {
4330
+ async function q(e, t) {
4329
4331
  if (u.value) return;
4330
- let n = N.value;
4332
+ let n = P.value;
4331
4333
  if (!n) return;
4332
4334
  let r = cs(e);
4333
4335
  if (!ls(r)) return;
4334
4336
  if (O.value) {
4335
- await Ve(O.value, r);
4337
+ await Be(O.value, r);
4336
4338
  return;
4337
4339
  }
4338
- let i = E.value?.id, a = crypto.randomUUID(), o = qs(Mt(D.value, t), a);
4340
+ let i = E.value?.id, a = crypto.randomUUID(), o = qs(Nt(D.value, t), a);
4339
4341
  u.value = !0, g.value = null;
4340
4342
  try {
4341
4343
  if (m.value) {
4342
- Ft(n, r, o, i, a), D.value = null;
4344
+ It(n, r, o, i, a), D.value = null;
4343
4345
  return;
4344
4346
  }
4345
- Bt(jt({
4347
+ Vt(Mt({
4346
4348
  conversation: n,
4347
4349
  kind: "text",
4348
4350
  text: r,
@@ -4351,31 +4353,31 @@ function Os({ environment: e }) {
4351
4353
  muid: a,
4352
4354
  deliveryState: "sending"
4353
4355
  }));
4354
- let e = new H.TextMessage(n.targetId, r, Ys(n));
4356
+ let e = new U.TextMessage(n.targetId, r, Ys(n));
4355
4357
  e.setMuid?.(a), Object.keys(o).length > 0 && e.setMetadata?.(o), i && e.setParentMessageId?.(Number(i));
4356
- let t = await H.sendMessage(e);
4357
- xt(M(t, _.value?.uid)), pt(t), await gt(t), D.value = null;
4358
+ let t = await U.sendMessage(e);
4359
+ St(N(t, _.value?.uid)), mt(t), await _t(t), D.value = null;
4358
4360
  } catch (e) {
4359
- if (Pt(e)) {
4360
- Vt("queued", a), Ft(n, r, o, E.value?.id, a), D.value = null;
4361
+ if (Ft(e)) {
4362
+ Ht("queued", a), It(n, r, o, E.value?.id, a), D.value = null;
4361
4363
  return;
4362
4364
  }
4363
- throw Vt("failed", a), g.value = Z(e, "Unable to send the message."), e;
4365
+ throw Ht("failed", a), g.value = Z(e, "Unable to send the message."), e;
4364
4366
  } finally {
4365
4367
  u.value = !1;
4366
4368
  }
4367
4369
  }
4368
- async function Ve(e, t) {
4369
- let n = N.value;
4370
+ async function Be(e, t) {
4371
+ let n = P.value;
4370
4372
  if (!n || m.value) return;
4371
4373
  let r = cs(t);
4372
4374
  if (ls(r)) {
4373
4375
  u.value = !0, g.value = null;
4374
4376
  try {
4375
4377
  let t;
4376
- e.kind === "text" ? t = new H.TextMessage(n.targetId, r, Ys(n)) : (t = new H.MediaMessage(n.targetId, e.source?.getAttachment?.()?.getFileUrl?.() ?? e.source?.getAttachment?.()?.getUrl?.() ?? e.attachments[0]?.url ?? "", e.source?.getType?.() ?? e.type ?? e.kind, Ys(n)), t.setCaption?.(r)), t.setId?.(Number(e.id));
4377
- let i = await H.editMessage(t);
4378
- xt(M(i, _.value?.uid)), pt(i), O.value = null;
4378
+ e.kind === "text" ? t = new U.TextMessage(n.targetId, r, Ys(n)) : (t = new U.MediaMessage(n.targetId, e.source?.getAttachment?.()?.getFileUrl?.() ?? e.source?.getAttachment?.()?.getUrl?.() ?? e.attachments[0]?.url ?? "", e.source?.getType?.() ?? e.type ?? e.kind, Ys(n)), t.setCaption?.(r)), t.setId?.(Number(e.id));
4379
+ let i = await U.editMessage(t);
4380
+ St(N(i, _.value?.uid)), mt(i), O.value = null;
4379
4381
  } catch (e) {
4380
4382
  throw g.value = Z(e, "Unable to edit the message."), e;
4381
4383
  } finally {
@@ -4383,18 +4385,18 @@ function Os({ environment: e }) {
4383
4385
  }
4384
4386
  }
4385
4387
  }
4386
- async function He(e, t) {
4388
+ async function Ve(e, t) {
4387
4389
  if (u.value) return;
4388
- let n = N.value;
4390
+ let n = P.value;
4389
4391
  if (!n) return;
4390
- let r = E.value?.id, i = crypto.randomUUID(), a = qs(Mt(D.value, t), i), o = $s(e.file);
4392
+ let r = E.value?.id, i = crypto.randomUUID(), a = qs(Nt(D.value, t), i), o = $s(e.file);
4391
4393
  u.value = !0, g.value = null;
4392
4394
  try {
4393
4395
  if (m.value) {
4394
- await Rt(n, e, a, r, i), D.value = null;
4396
+ await zt(n, e, a, r, i), D.value = null;
4395
4397
  return;
4396
4398
  }
4397
- Bt(jt({
4399
+ Vt(Mt({
4398
4400
  conversation: n,
4399
4401
  kind: o,
4400
4402
  text: e.caption?.trim() ?? "",
@@ -4409,37 +4411,37 @@ function Os({ environment: e }) {
4409
4411
  muid: i,
4410
4412
  deliveryState: "sending"
4411
4413
  }));
4412
- let t = new H.MediaMessage(n.targetId, e.file, o, Ys(n));
4414
+ let t = new U.MediaMessage(n.targetId, e.file, o, Ys(n));
4413
4415
  t.setMuid?.(i), Object.keys(a).length > 0 && t.setMetadata?.(a), r && t.setParentMessageId?.(Number(r)), e.caption?.trim() && t.setCaption?.(e.caption.trim());
4414
- let s = await H.sendMediaMessage(t);
4415
- xt(M(s, _.value?.uid)), pt(s), await gt(s), D.value = null;
4416
+ let s = await U.sendMediaMessage(t);
4417
+ St(N(s, _.value?.uid)), mt(s), await _t(s), D.value = null;
4416
4418
  } catch (t) {
4417
- if (Pt(t)) {
4418
- Vt("queued", i), await Rt(n, e, a, r, i), D.value = null;
4419
+ if (Ft(t)) {
4420
+ Ht("queued", i), await zt(n, e, a, r, i), D.value = null;
4419
4421
  return;
4420
4422
  }
4421
- throw Vt("failed", i), g.value = Z(t, "Unable to send the attachment."), t;
4423
+ throw Ht("failed", i), g.value = Z(t, "Unable to send the attachment."), t;
4422
4424
  } finally {
4423
4425
  u.value = !1;
4424
4426
  }
4425
4427
  }
4426
- async function Ue(e, t) {
4428
+ async function He(e, t) {
4427
4429
  if (u.value) return;
4428
- let n = N.value;
4430
+ let n = P.value;
4429
4431
  if (!n) return;
4430
4432
  let r = e.question.trim(), i = e.options.map((e) => e.trim()).filter(Boolean);
4431
4433
  if (!r || i.length < 2) return;
4432
- let a = E.value?.id, o = crypto.randomUUID(), s = qs(Mt(D.value, t), o);
4434
+ let a = E.value?.id, o = crypto.randomUUID(), s = qs(Nt(D.value, t), o);
4433
4435
  u.value = !0, g.value = null;
4434
4436
  try {
4435
4437
  if (m.value) {
4436
- It(n, {
4438
+ Lt(n, {
4437
4439
  question: r,
4438
4440
  options: i
4439
4441
  }, s, a, o), D.value = null;
4440
4442
  return;
4441
4443
  }
4442
- Bt(jt({
4444
+ Vt(Mt({
4443
4445
  conversation: n,
4444
4446
  kind: "poll",
4445
4447
  text: `Poll: ${r}`,
@@ -4456,41 +4458,41 @@ function Os({ environment: e }) {
4456
4458
  question: r,
4457
4459
  options: i,
4458
4460
  receiver: n.targetId,
4459
- receiverType: n.type === "group" ? H.RECEIVER_TYPE.GROUP : H.RECEIVER_TYPE.USER
4461
+ receiverType: n.type === "group" ? U.RECEIVER_TYPE.GROUP : U.RECEIVER_TYPE.USER
4460
4462
  };
4461
4463
  a && (e.parentMessageId = Number(a)), Object.keys(s).length > 0 && (e.metadata = s);
4462
- let t = await H.callExtension("polls", "POST", "v2/create", e), c = t?.message ?? t?.custom_message ?? t?.data?.message ?? null;
4463
- c ? (Ht(o), xt(M(c, _.value?.uid)), pt(c), await gt(c)) : (Ht(o), await bt()), D.value = null;
4464
+ let t = await U.callExtension("polls", "POST", "v2/create", e), c = t?.message ?? t?.custom_message ?? t?.data?.message ?? null;
4465
+ c ? (Ut(o), St(N(c, _.value?.uid)), mt(c), await _t(c)) : (Ut(o), await xt()), D.value = null;
4464
4466
  } catch (e) {
4465
- if (Pt(e)) {
4466
- Vt("queued", o), It(n, {
4467
+ if (Ft(e)) {
4468
+ Ht("queued", o), Lt(n, {
4467
4469
  question: r,
4468
4470
  options: i
4469
4471
  }, s, a, o), D.value = null;
4470
4472
  return;
4471
4473
  }
4472
- throw Vt("failed", o), g.value = Z(e, "Unable to send the poll."), e;
4474
+ throw Ht("failed", o), g.value = Z(e, "Unable to send the poll."), e;
4473
4475
  } finally {
4474
4476
  u.value = !1;
4475
4477
  }
4476
4478
  }
4477
- async function We(e, t) {
4479
+ async function Ue(e, t) {
4478
4480
  let n = e.poll?.id ?? e.id, r = _.value?.uid;
4479
4481
  if (!n || !t || m.value) return;
4480
- let i = Ct(e.id, e.parentMessageId) ?? e;
4482
+ let i = wt(e.id, e.parentMessageId) ?? e;
4481
4483
  if (i.poll && !i.poll.options.some((e) => e.id === t && e.voters.includes(r ?? ""))) {
4482
- g.value = null, r && xt(Ge(i, t, r));
4484
+ g.value = null, r && St(We(i, t, r));
4483
4485
  try {
4484
- await H.callExtension("polls", "POST", "v2/vote", {
4486
+ await U.callExtension("polls", "POST", "v2/vote", {
4485
4487
  id: n,
4486
4488
  vote: t
4487
4489
  });
4488
4490
  } catch (e) {
4489
- throw xt(i), g.value = Z(e, "Unable to cast the vote."), e;
4491
+ throw St(i), g.value = Z(e, "Unable to cast the vote."), e;
4490
4492
  }
4491
4493
  }
4492
4494
  }
4493
- function Ge(e, t, n) {
4495
+ function We(e, t, n) {
4494
4496
  if (!e.poll) return e;
4495
4497
  let r = e.poll, i = r.allowsMultipleAnswers, a = r.options.filter((e) => e.voters.includes(n)).map((e) => e.id), o = !i && a.length > 0, s = r.options.map((e) => o && e.voters.includes(n) && e.id !== t ? {
4496
4498
  ...e,
@@ -4510,80 +4512,80 @@ function Os({ environment: e }) {
4510
4512
  }
4511
4513
  };
4512
4514
  }
4513
- async function Ke(e, t) {
4515
+ async function Ge(e, t) {
4514
4516
  g.value = null;
4515
- let n = Ct(e.id, e.parentMessageId) ?? e, r = n.reactions.find((e) => e.emoji === t && e.reactedByMe);
4516
- xt(wt(n, t));
4517
+ let n = wt(e.id, e.parentMessageId) ?? e, r = n.reactions.find((e) => e.emoji === t && e.reactedByMe);
4518
+ St(Tt(n, t));
4517
4519
  try {
4518
- xt(M(r ? await H.removeReaction(Number(e.id), t) : await H.addReaction(Number(e.id), t), _.value?.uid));
4520
+ St(N(r ? await U.removeReaction(Number(e.id), t) : await U.addReaction(Number(e.id), t), _.value?.uid));
4519
4521
  } catch (e) {
4520
- throw xt(n), g.value = Z(e, "Unable to update the reaction."), e;
4522
+ throw St(n), g.value = Z(e, "Unable to update the reaction."), e;
4521
4523
  }
4522
4524
  }
4523
- async function qe(e) {
4525
+ async function Ke(e) {
4524
4526
  if (g.value = null, e.deliveryState === "queued" || e.deliveryState === "failed") {
4525
- Dt(e);
4527
+ Ot(e);
4526
4528
  return;
4527
4529
  }
4528
4530
  if (!m.value) try {
4529
- let t = M(await H.deleteMessage(String(e.id)), _.value?.uid);
4530
- Dt(t), Ot(t);
4531
+ let t = N(await U.deleteMessage(String(e.id)), _.value?.uid);
4532
+ Ot(t), kt(t);
4531
4533
  } catch (e) {
4532
4534
  throw g.value = Z(e, "Unable to delete the message."), e;
4533
4535
  }
4534
4536
  }
4535
- async function Je(e) {
4537
+ async function qe(e) {
4536
4538
  let t = e.source?.getText?.() ?? e.text;
4537
4539
  if (ls(t)) {
4538
4540
  g.value = null;
4539
4541
  try {
4540
- let n = (await H.callExtension("message-translation", "POST", "v2/translate", {
4542
+ let n = (await U.callExtension("message-translation", "POST", "v2/translate", {
4541
4543
  msgId: Number(e.id),
4542
4544
  text: t,
4543
4545
  languages: typeof navigator < "u" ? navigator.languages : ["en"]
4544
4546
  })).translations?.[0]?.message_translated?.trim();
4545
4547
  if (!n) return;
4546
- St({
4548
+ Ct({
4547
4549
  ...e,
4548
4550
  translatedText: n,
4549
4551
  metadata: {
4550
4552
  ...e.metadata ?? {},
4551
4553
  translated_message: n
4552
4554
  }
4553
- }), Et();
4555
+ }), Dt();
4554
4556
  } catch (e) {
4555
4557
  throw g.value = Z(e, "Unable to translate the message."), e;
4556
4558
  }
4557
4559
  }
4558
4560
  }
4559
- async function Ye(e) {
4560
- let t = e ?? N.value?.targetId, n = _.value?.uid, r = ++de;
4561
+ async function Je(e) {
4562
+ let t = e ?? P.value?.targetId, n = _.value?.uid, r = ++ue;
4561
4563
  if (!t || !n) {
4562
- r === de && (x.value = []);
4564
+ r === ue && (x.value = []);
4563
4565
  return;
4564
4566
  }
4565
4567
  l.value = !0, g.value = null;
4566
4568
  try {
4567
- let e = new H.MessagesRequestBuilder().setLimit(50).setGUID(n).withTags(!0).setTags([t]).build(), i = [], a = [];
4569
+ let e = new U.MessagesRequestBuilder().setLimit(50).setGUID(n).withTags(!0).setTags([t]).build(), i = [], a = [];
4568
4570
  do
4569
- a = await e.fetchPrevious(), i.push(...a.map((e) => M(e, _.value?.uid)));
4571
+ a = await e.fetchPrevious(), i.push(...a.map((e) => N(e, _.value?.uid)));
4570
4572
  while (a.length === 50);
4571
4573
  let o = i.filter((e) => !(e.isDeleted || !e.scheduled?.scheduleDate || t && e.scheduled.originalChatUid && e.scheduled.originalChatUid !== t)).sort((e, t) => (e.scheduled?.scheduleDate?.getTime() ?? e.sentAt.getTime()) - (t.scheduled?.scheduleDate?.getTime() ?? t.sentAt.getTime()));
4572
- if (r !== de) return;
4574
+ if (r !== ue) return;
4573
4575
  x.value = o;
4574
4576
  } catch (e) {
4575
- if (r !== de) return;
4576
- throw g.value = Z(e, G("loadScheduledMessagesError")), e;
4577
+ if (r !== ue) return;
4578
+ throw g.value = Z(e, K("loadScheduledMessagesError")), e;
4577
4579
  } finally {
4578
- r === de && (l.value = !1);
4580
+ r === ue && (l.value = !1);
4579
4581
  }
4580
4582
  }
4581
- async function Xe(e, t) {
4582
- let n = N.value;
4583
+ async function Ye(e, t) {
4584
+ let n = P.value;
4583
4585
  if (n) {
4584
4586
  d.value = !0, g.value = null;
4585
4587
  try {
4586
- e.file ? await Qs(n, e, t) : await Zs(n, e, t), await Ye(n.targetId);
4588
+ e.file ? await Qs(n, e, t) : await Zs(n, e, t), await Je(n.targetId);
4587
4589
  } catch (e) {
4588
4590
  throw g.value = Z(e, "Unable to schedule the message."), e;
4589
4591
  } finally {
@@ -4591,10 +4593,41 @@ function Os({ environment: e }) {
4591
4593
  }
4592
4594
  }
4593
4595
  }
4594
- async function Ze(e) {
4596
+ async function Xe(e) {
4597
+ if (g.value = null, !e.scheduled?.muid) return;
4598
+ let t = e.scheduled.originalChatUid;
4599
+ try {
4600
+ await U.deleteMessage(String(e.id)), x.value = x.value.filter((t) => t.id !== e.id), await Je(t);
4601
+ } catch (e) {
4602
+ throw g.value = Z(e, "Unable to remove the scheduled message."), e;
4603
+ }
4604
+ }
4605
+ async function Ze(e, t) {
4606
+ g.value = null;
4607
+ let n = _.value?.uid;
4608
+ if (!n || !e.scheduled?.muid || e.kind === "poll") return;
4609
+ let r = ss(t);
4610
+ if (!(e.kind === "text" && !ls(r))) {
4611
+ d.value = !0;
4612
+ try {
4613
+ let t;
4614
+ if (e.kind === "text") t = new U.TextMessage(n, r, U.RECEIVER_TYPE.GROUP);
4615
+ else {
4616
+ let i = e.source?.getAttachment?.()?.getFileUrl?.() ?? e.source?.getAttachment?.()?.getUrl?.() ?? e.attachments[0]?.url ?? "";
4617
+ t = new U.MediaMessage(n, i, e.source?.getType?.() ?? e.type ?? e.kind, U.RECEIVER_TYPE.GROUP), t.setCaption?.(r);
4618
+ }
4619
+ t.setId?.(Number(e.id)), await U.editMessage(t), await Je(e.scheduled.originalChatUid);
4620
+ } catch (e) {
4621
+ throw g.value = Z(e, "Unable to edit the scheduled message."), e;
4622
+ } finally {
4623
+ d.value = !1;
4624
+ }
4625
+ }
4626
+ }
4627
+ async function Qe(e) {
4595
4628
  d.value = !0, g.value = null;
4596
4629
  try {
4597
- let t = Xs(), n = await fetch(`${U().chatApiBaseUrl}/chats/rescheduleMessage`, {
4630
+ let t = Xs(), n = await fetch(`${W().chatApiBaseUrl}/chats/rescheduleMessage`, {
4598
4631
  method: "POST",
4599
4632
  headers: {
4600
4633
  "Content-Type": "application/json",
@@ -4608,50 +4641,50 @@ function Os({ environment: e }) {
4608
4641
  })
4609
4642
  });
4610
4643
  if (!n.ok) throw Error(`Reschedule failed with status ${n.status}.`);
4611
- await Ye(e.originalChatUid);
4644
+ await Je(e.originalChatUid);
4612
4645
  } catch (e) {
4613
4646
  throw g.value = Z(e, "Unable to reschedule the message."), e;
4614
4647
  } finally {
4615
4648
  d.value = !1;
4616
4649
  }
4617
4650
  }
4618
- function Qe(e) {
4619
- let t = new H.MessagesRequestBuilder().setLimit(50).hideReplies(!0).hideDeletedMessages(!0);
4651
+ function $e(e) {
4652
+ let t = new U.MessagesRequestBuilder().setLimit(50).hideReplies(!0).hideDeletedMessages(!0);
4620
4653
  return e.type === "group" ? t.setGUID(e.targetId) : t.setUID(e.targetId), t.build();
4621
4654
  }
4622
- function $e(e) {
4623
- return new H.MessagesRequestBuilder().setLimit(50).setParentMessageId(Number(e)).hideDeletedMessages(!0).build();
4655
+ function et(e) {
4656
+ return new U.MessagesRequestBuilder().setLimit(50).setParentMessageId(Number(e)).hideDeletedMessages(!0).build();
4624
4657
  }
4625
- async function et(e) {
4626
- let t = N.value;
4658
+ async function tt(e) {
4659
+ let t = P.value;
4627
4660
  if (!t) return y.value = [], S.value = !1, !1;
4628
- if ((e?.reset || le?.conversationId !== t.id) && (le = {
4661
+ if ((e?.reset || ce?.conversationId !== t.id) && (ce = {
4629
4662
  conversationId: t.id,
4630
- request: Qe(t)
4631
- }, S.value = !0), !le) return !1;
4632
- let n = await le.request.fetchPrevious(), r = n.map((e) => M(e, _.value?.uid)).filter(Gs).sort(Vs);
4633
- y.value = e?.reset ? Us(y.value.filter((e) => e.conversationId === t.id && Ws(e)), r) : Us(y.value, r), S.value = n.length === 50, V?.setMessages(t.id, y.value);
4663
+ request: $e(t)
4664
+ }, S.value = !0), !ce) return !1;
4665
+ let n = await ce.request.fetchPrevious(), r = n.map((e) => N(e, _.value?.uid)).filter(Gs).sort(Vs);
4666
+ y.value = e?.reset ? Us(y.value.filter((e) => e.conversationId === t.id && Ws(e)), r) : Us(y.value, r), S.value = n.length === 50, H?.setMessages(t.id, y.value);
4634
4667
  let i = n[n.length - 1];
4635
- return i && (await _t(i), await gt(i)), n.length > 0;
4668
+ return i && (await vt(i), await _t(i)), n.length > 0;
4636
4669
  }
4637
- async function tt() {
4638
- let e = N.value;
4670
+ async function nt() {
4671
+ let e = P.value;
4639
4672
  if (!e) {
4640
- y.value = [], S.value = !1, le = null;
4673
+ y.value = [], S.value = !1, ce = null;
4641
4674
  return;
4642
4675
  }
4643
- let t = je(e.id);
4644
- if (a.value = !0, m.value && V) {
4645
- S.value = !1, le = null, a.value = !1;
4676
+ let t = Ae(e.id);
4677
+ if (a.value = !0, m.value && H) {
4678
+ S.value = !1, ce = null, a.value = !1;
4646
4679
  return;
4647
4680
  }
4648
4681
  try {
4649
- await et({ reset: !0 }), v.value = v.value.map((t) => t.id === e.id ? {
4682
+ await tt({ reset: !0 }), v.value = v.value.map((t) => t.id === e.id ? {
4650
4683
  ...t,
4651
4684
  unreadCount: 0
4652
- } : t), V?.setConversations(v.value);
4685
+ } : t), H?.setConversations(v.value);
4653
4686
  } catch (n) {
4654
- let r = V?.getMessages(e.id) ?? [];
4687
+ let r = H?.getMessages(e.id) ?? [];
4655
4688
  if (r.length > 0) {
4656
4689
  t || (y.value = r.sort(Vs));
4657
4690
  return;
@@ -4661,27 +4694,27 @@ function Os({ environment: e }) {
4661
4694
  a.value = !1;
4662
4695
  }
4663
4696
  }
4664
- async function nt(e) {
4697
+ async function rt(e) {
4665
4698
  let t = E.value?.id;
4666
4699
  if (!t) return b.value = [], C.value = !1, !1;
4667
- if ((e?.reset || ue?.parentMessageId !== t) && (ue = {
4700
+ if ((e?.reset || le?.parentMessageId !== t) && (le = {
4668
4701
  parentMessageId: t,
4669
- request: $e(t)
4670
- }, C.value = !0), !ue) return !1;
4671
- let n = await ue.request.fetchPrevious(), r = n.map((e) => M(e, _.value?.uid)).filter(Gs).sort(Vs);
4672
- b.value = e?.reset ? Us(b.value.filter((e) => e.parentMessageId === t && Ws(e)), r) : Us(b.value, r), C.value = n.length === 50, V?.setThreadMessages(t, b.value);
4702
+ request: et(t)
4703
+ }, C.value = !0), !le) return !1;
4704
+ let n = await le.request.fetchPrevious(), r = n.map((e) => N(e, _.value?.uid)).filter(Gs).sort(Vs);
4705
+ b.value = e?.reset ? Us(b.value.filter((e) => e.parentMessageId === t && Ws(e)), r) : Us(b.value, r), C.value = n.length === 50, H?.setThreadMessages(t, b.value);
4673
4706
  let i = n[n.length - 1];
4674
- return i && (await _t(i), await gt(i)), n.length > 0;
4707
+ return i && (await vt(i), await _t(i)), n.length > 0;
4675
4708
  }
4676
- async function rt(e) {
4677
- if (o.value = !0, m.value && V) {
4678
- b.value = V.getThreadMessages(e).sort(Vs), C.value = !1, ue = null, o.value = !1;
4709
+ async function it(e) {
4710
+ if (o.value = !0, m.value && H) {
4711
+ b.value = H.getThreadMessages(e).sort(Vs), C.value = !1, le = null, o.value = !1;
4679
4712
  return;
4680
4713
  }
4681
4714
  try {
4682
- await nt({ reset: !0 });
4715
+ await rt({ reset: !0 });
4683
4716
  } catch (t) {
4684
- let n = V?.getThreadMessages(e) ?? [];
4717
+ let n = H?.getThreadMessages(e) ?? [];
4685
4718
  if (n.length > 0) {
4686
4719
  b.value = n.sort(Vs);
4687
4720
  return;
@@ -4691,29 +4724,29 @@ function Os({ environment: e }) {
4691
4724
  o.value = !1;
4692
4725
  }
4693
4726
  }
4694
- async function it() {
4727
+ async function at() {
4695
4728
  if (a.value || s.value || !S.value) return !1;
4696
4729
  s.value = !0, g.value = null;
4697
4730
  try {
4698
- return await et();
4731
+ return await tt();
4699
4732
  } catch (e) {
4700
4733
  throw g.value = Z(e, "Unable to load messages."), e;
4701
4734
  } finally {
4702
4735
  s.value = !1;
4703
4736
  }
4704
4737
  }
4705
- async function at() {
4738
+ async function ot() {
4706
4739
  if (o.value || c.value || !C.value) return !1;
4707
4740
  c.value = !0, g.value = null;
4708
4741
  try {
4709
- return await nt();
4742
+ return await rt();
4710
4743
  } catch (e) {
4711
4744
  throw g.value = Z(e, "Unable to load thread."), e;
4712
4745
  } finally {
4713
4746
  c.value = !1;
4714
4747
  }
4715
4748
  }
4716
- async function ot(e) {
4749
+ async function st(e) {
4717
4750
  let t = e.trim();
4718
4751
  if (!t) return !1;
4719
4752
  let n = () => y.value.some((e) => e.id === t) || b.value.some((e) => e.id === t) || E.value?.id === t;
@@ -4721,101 +4754,101 @@ function Os({ environment: e }) {
4721
4754
  let r = 0;
4722
4755
  for (; C.value && E.value && r < 100;) {
4723
4756
  r += 1;
4724
- let e = await at();
4757
+ let e = await ot();
4725
4758
  if (n()) return !0;
4726
4759
  if (!e) break;
4727
4760
  }
4728
- for (; S.value && N.value && r < 100;) {
4761
+ for (; S.value && P.value && r < 100;) {
4729
4762
  r += 1;
4730
- let e = await it();
4763
+ let e = await at();
4731
4764
  if (n()) return !0;
4732
4765
  if (!e) break;
4733
4766
  }
4734
4767
  return n();
4735
4768
  }
4736
- async function st() {
4737
- let e = await H.getLoggedinUser();
4769
+ async function lt() {
4770
+ let e = await U.getLoggedinUser();
4738
4771
  _.value = e ? Fs(e) : null, h.value = !!e;
4739
4772
  }
4740
- function ct() {
4741
- ne ||= (H.addConnectionListener(P, new H.ConnectionListener({
4773
+ function ut() {
4774
+ te ||= (U.addConnectionListener(F, new U.ConnectionListener({
4742
4775
  onConnected: () => {
4743
- if (p.value = !0, ae = 0, we(), B) {
4744
- ke();
4776
+ if (p.value = !0, ie = 0, Ce(), V) {
4777
+ Oe();
4745
4778
  return;
4746
4779
  }
4747
- Ut();
4780
+ Wt();
4748
4781
  },
4749
4782
  onDisconnected: () => {
4750
- p.value = !1, !m.value && h.value && !oe && (B = !0, De(!0));
4783
+ p.value = !1, !m.value && h.value && !ae && (V = !0, Ee(!0));
4751
4784
  }
4752
- })), H.addMessageListener(F, new H.MessageListener({
4785
+ })), U.addMessageListener(I, new U.MessageListener({
4753
4786
  onTextMessageReceived: (e) => {
4754
- ut(e);
4787
+ dt(e);
4755
4788
  },
4756
4789
  onMediaMessageReceived: (e) => {
4757
- ut(e);
4790
+ dt(e);
4758
4791
  },
4759
4792
  onCustomMessageReceived: (e) => {
4760
- ut(e);
4793
+ dt(e);
4761
4794
  },
4762
4795
  onMessagesDelivered: () => {
4763
- Ee() || bt({ includeThread: !1 });
4796
+ Te() || xt({ includeThread: !1 });
4764
4797
  },
4765
4798
  onMessagesRead: () => {
4766
- Ee() || bt({ includeThread: !1 });
4799
+ Te() || xt({ includeThread: !1 });
4767
4800
  },
4768
4801
  onMessageEdited: (e) => {
4769
- let t = M(e, _.value?.uid);
4770
- Gs(t) && (mt(t), pt(e));
4802
+ let t = N(e, _.value?.uid);
4803
+ Gs(t) && (ht(t), mt(e));
4771
4804
  },
4772
4805
  onMessageDeleted: (e) => {
4773
- let t = M(e, _.value?.uid);
4774
- t.parentMessageId ? Dt(t) : (Dt(t), Ot(t)), Et();
4806
+ let t = N(e, _.value?.uid);
4807
+ t.parentMessageId ? Ot(t) : (Ot(t), kt(t)), Dt();
4775
4808
  },
4776
4809
  onMessageReactionAdded: () => {
4777
- bt();
4810
+ xt();
4778
4811
  },
4779
4812
  onMessageReactionRemoved: () => {
4780
- bt();
4813
+ xt();
4781
4814
  },
4782
4815
  onMessagesDeliveredToAll: () => {
4783
- Ee() || bt({ includeThread: !1 });
4816
+ Te() || xt({ includeThread: !1 });
4784
4817
  },
4785
4818
  onMessagesReadByAll: () => {
4786
- Ee() || bt({ includeThread: !1 });
4819
+ Te() || xt({ includeThread: !1 });
4787
4820
  }
4788
4821
  })), !0);
4789
4822
  }
4790
- async function ut(e) {
4791
- let t = M(e, _.value?.uid);
4823
+ async function dt(e) {
4824
+ let t = N(e, _.value?.uid);
4792
4825
  if (Gs(t)) {
4793
- if (pt(e), await _t(e), t.parentMessageId) {
4794
- ht(t), Tt(t.parentMessageId), Et();
4826
+ if (mt(e), await vt(e), t.parentMessageId) {
4827
+ gt(t), Et(t.parentMessageId), Dt();
4795
4828
  return;
4796
4829
  }
4797
- t.conversationId === T.value && (mt(t), Et(), await gt(e));
4830
+ t.conversationId === T.value && (ht(t), Dt(), await _t(e));
4798
4831
  }
4799
4832
  }
4800
- async function dt(e) {
4833
+ async function ft(e) {
4801
4834
  return await Promise.all(e.map(async (e) => {
4802
- let t = await ft(e.targetId);
4835
+ let t = await pt(e.targetId);
4803
4836
  return {
4804
4837
  ...e,
4805
4838
  muteSettings: t ? new Date(t) : null
4806
4839
  };
4807
4840
  }));
4808
4841
  }
4809
- async function ft(e) {
4810
- let t = V?.getParticipantSettings(e), n = t?.lastUpdated ? Date.now() - t.lastUpdated > 1440 * 60 * 1e3 : !0;
4842
+ async function pt(e) {
4843
+ let t = H?.getParticipantSettings(e), n = t?.lastUpdated ? Date.now() - t.lastUpdated > 1440 * 60 * 1e3 : !0;
4811
4844
  if (t && (m.value || !n)) return t.mutedUntil;
4812
4845
  if (m.value || !h.value) return t?.mutedUntil ?? null;
4813
4846
  try {
4814
- let n = (await H.getLoggedinUser())?.getUid?.();
4847
+ let n = (await U.getLoggedinUser())?.getUid?.();
4815
4848
  if (!n || e === n) return t?.mutedUntil ?? null;
4816
- let r = _e();
4849
+ let r = ge();
4817
4850
  if (!r) return t?.mutedUntil ?? null;
4818
- let i = await fetch(`${U().chatApiBaseUrl}/chats/${e}/settings/${n}`, {
4851
+ let i = await fetch(`${W().chatApiBaseUrl}/chats/${e}/settings/${n}`, {
4819
4852
  method: "GET",
4820
4853
  headers: {
4821
4854
  "Content-Type": "application/json",
@@ -4824,7 +4857,7 @@ function Os({ environment: e }) {
4824
4857
  });
4825
4858
  if (!i.ok) return t?.mutedUntil ?? null;
4826
4859
  let a = await i.json();
4827
- return V?.storeParticipantSettings({
4860
+ return H?.storeParticipantSettings({
4828
4861
  chatUid: e,
4829
4862
  mutedUntil: a.mutedUntil ?? null,
4830
4863
  lastUpdated: Date.now()
@@ -4833,12 +4866,12 @@ function Os({ environment: e }) {
4833
4866
  return t?.mutedUntil ?? null;
4834
4867
  }
4835
4868
  }
4836
- function pt(e) {
4837
- let t = M(e, _.value?.uid);
4869
+ function mt(e) {
4870
+ let t = N(e, _.value?.uid);
4838
4871
  if (!Gs(t) || t.isDeleted) return;
4839
4872
  let n = e.getConversationId(), r = v.value.find((e) => e.id === n);
4840
4873
  if (!r) {
4841
- Ie();
4874
+ Fe();
4842
4875
  return;
4843
4876
  }
4844
4877
  let i = {
@@ -4847,56 +4880,56 @@ function Os({ environment: e }) {
4847
4880
  lastMessageAt: /* @__PURE__ */ new Date((e.getSentAt?.() ?? 0) * 1e3),
4848
4881
  unreadCount: n === T.value ? 0 : r.unreadCount + 1
4849
4882
  };
4850
- v.value = Bs(v.value.map((e) => e.id === n ? i : e)), V?.setConversations(v.value);
4851
- }
4852
- function mt(e) {
4853
- y.value = Hs(y.value, e), T.value && V?.setMessages(T.value, y.value);
4883
+ v.value = Bs(v.value.map((e) => e.id === n ? i : e)), H?.setConversations(v.value);
4854
4884
  }
4855
4885
  function ht(e) {
4856
- e.parentMessageId === E.value?.id && (b.value = Hs(b.value, e), e.parentMessageId && V?.setThreadMessages(e.parentMessageId, b.value));
4886
+ y.value = Hs(y.value, e), T.value && H?.setMessages(T.value, y.value);
4857
4887
  }
4858
- async function gt(e) {
4859
- if (m.value) return;
4860
- let t = e.getSender?.()?.getUid?.();
4861
- !t || t === _.value?.uid || e.getReadByMeAt?.() || (Te(), await H.markAsRead(e));
4888
+ function gt(e) {
4889
+ e.parentMessageId === E.value?.id && (b.value = Hs(b.value, e), e.parentMessageId && H?.setThreadMessages(e.parentMessageId, b.value));
4862
4890
  }
4863
4891
  async function _t(e) {
4864
4892
  if (m.value) return;
4865
4893
  let t = e.getSender?.()?.getUid?.();
4866
- !t || t === _.value?.uid || e.getDeliveredToMeAt?.() || (Te(), await H.markAsDelivered(e));
4894
+ !t || t === _.value?.uid || e.getReadByMeAt?.() || (we(), await U.markAsRead(e));
4867
4895
  }
4868
4896
  async function vt(e) {
4869
- return m.value ? [] : Ns(await H.getMessageReceipts(String(e.id)));
4897
+ if (m.value) return;
4898
+ let t = e.getSender?.()?.getUid?.();
4899
+ !t || t === _.value?.uid || e.getDeliveredToMeAt?.() || (we(), await U.markAsDelivered(e));
4870
4900
  }
4871
- function yt() {
4872
- r.value = !1, i.value = !1, a.value = !1, o.value = !1, s.value = !1, c.value = !1, l.value = !1, u.value = !1, d.value = !1, f.value = !1, p.value = !1, we(), ae = 0, B = !1, oe = !1, h.value = !1, _.value = null, v.value = [], y.value = [], b.value = [], x.value = [], E.value = null, D.value = null, O.value = null, k.value = [], T.value = null, S.value = !1, C.value = !1, le = null, ue = null, ce.clear();
4901
+ async function yt(e) {
4902
+ return m.value ? [] : Ns(await U.getMessageReceipts(String(e.id)));
4873
4903
  }
4874
- async function bt(e) {
4875
- if (z) return z;
4904
+ function bt() {
4905
+ r.value = !1, i.value = !1, a.value = !1, o.value = !1, s.value = !1, c.value = !1, l.value = !1, u.value = !1, d.value = !1, f.value = !1, p.value = !1, Ce(), ie = 0, V = !1, ae = !1, h.value = !1, _.value = null, v.value = [], y.value = [], b.value = [], x.value = [], E.value = null, D.value = null, O.value = null, k.value = [], T.value = null, S.value = !1, C.value = !1, ce = null, le = null, se.clear();
4906
+ }
4907
+ async function xt(e) {
4908
+ if (B) return B;
4876
4909
  let t = e?.includeThread ?? !0;
4877
- z = (async () => {
4878
- N.value && await tt(), t && E.value && await rt(E.value.id);
4910
+ B = (async () => {
4911
+ P.value && await nt(), t && E.value && await it(E.value.id);
4879
4912
  })();
4880
4913
  try {
4881
- await z;
4914
+ await B;
4882
4915
  } finally {
4883
- z = null;
4916
+ B = null;
4884
4917
  }
4885
4918
  }
4886
- function xt(e) {
4887
- St(e), e.parentMessageId && Tt(e.parentMessageId, e.replyCount), Et();
4888
- }
4889
4919
  function St(e) {
4920
+ Ct(e), e.parentMessageId && Et(e.parentMessageId, e.replyCount), Dt();
4921
+ }
4922
+ function Ct(e) {
4890
4923
  if (e.parentMessageId) {
4891
4924
  E.value?.id === e.parentMessageId && (b.value = Hs(b.value, e));
4892
4925
  return;
4893
4926
  }
4894
4927
  y.value = Hs(y.value, e), E.value?.id === e.id && (E.value = e);
4895
4928
  }
4896
- function Ct(e, t) {
4929
+ function wt(e, t) {
4897
4930
  return t ? b.value.find((t) => t.id === e) ?? null : E.value?.id === e ? E.value : y.value.find((t) => t.id === e) ?? null;
4898
4931
  }
4899
- function wt(e, t) {
4932
+ function Tt(e, t) {
4900
4933
  let n = e.reactions.find((e) => e.emoji === t);
4901
4934
  return n ? n.reactedByMe && n.count === 1 ? {
4902
4935
  ...e,
@@ -4917,7 +4950,7 @@ function Os({ environment: e }) {
4917
4950
  }]
4918
4951
  };
4919
4952
  }
4920
- function Tt(e, t) {
4953
+ function Et(e, t) {
4921
4954
  let n = y.value.find((t) => t.id === e);
4922
4955
  if (!n) return;
4923
4956
  let r = {
@@ -4926,18 +4959,18 @@ function Os({ environment: e }) {
4926
4959
  };
4927
4960
  y.value = Hs(y.value, r), E.value?.id === e && (E.value = r);
4928
4961
  }
4929
- function Et() {
4930
- T.value && V?.setMessages(T.value, y.value), E.value && V?.setThreadMessages(E.value.id, b.value);
4962
+ function Dt() {
4963
+ T.value && H?.setMessages(T.value, y.value), E.value && H?.setThreadMessages(E.value.id, b.value);
4931
4964
  }
4932
- function Dt(e) {
4933
- if (e.parentMessageId ? (b.value = b.value.filter((t) => t.id !== e.id), V?.setThreadMessages(e.parentMessageId, b.value)) : (y.value = y.value.filter((t) => t.id !== e.id), T.value && V?.setMessages(T.value, y.value)), e.muid) {
4965
+ function Ot(e) {
4966
+ if (e.parentMessageId ? (b.value = b.value.filter((t) => t.id !== e.id), H?.setThreadMessages(e.parentMessageId, b.value)) : (y.value = y.value.filter((t) => t.id !== e.id), T.value && H?.setMessages(T.value, y.value)), e.muid) {
4934
4967
  k.value = k.value.filter((t) => t.muid !== e.muid);
4935
- let t = V?.getQueue().filter((t) => t.muid === e.muid) ?? [];
4936
- for (let e of t) V?.dequeue(e.id), se.delete(e.id), e.kind === "attachment" && V?.deleteQueuedAttachment(e.id);
4968
+ let t = H?.getQueue().filter((t) => t.muid === e.muid) ?? [];
4969
+ for (let e of t) H?.dequeue(e.id), oe.delete(e.id), e.kind === "attachment" && H?.deleteQueuedAttachment(e.id);
4937
4970
  }
4938
- e.parentMessageId || kt(e.conversationId);
4971
+ e.parentMessageId || At(e.conversationId);
4939
4972
  }
4940
- function Ot(e) {
4973
+ function kt(e) {
4941
4974
  if (e.parentMessageId) return;
4942
4975
  let t = e.conversationId, n = v.value.find((e) => e.id === t);
4943
4976
  if (!n) return;
@@ -4959,26 +4992,26 @@ function Os({ environment: e }) {
4959
4992
  ...e,
4960
4993
  subtitle: "No messages yet",
4961
4994
  lastMessageAt: void 0
4962
- } : e : e)), V?.setConversations(v.value);
4995
+ } : e : e)), H?.setConversations(v.value);
4963
4996
  }
4964
- function kt(e, t) {
4997
+ function At(e, t) {
4965
4998
  let n = y.value.length > 0 ? y.value[y.value.length - 1] : null, r = t ?? n;
4966
4999
  v.value = Bs(v.value.map((t) => t.id === e ? {
4967
5000
  ...t,
4968
5001
  subtitle: r ? Js(r) : "No messages yet",
4969
5002
  lastMessageAt: r?.sentAt
4970
- } : t)), V?.setConversations(v.value);
5003
+ } : t)), H?.setConversations(v.value);
4971
5004
  }
4972
- function At(e) {
5005
+ function jt(e) {
4973
5006
  v.value = Bs(v.value.map((t) => t.id === e.conversationId ? {
4974
5007
  ...t,
4975
5008
  subtitle: Js(e),
4976
5009
  lastMessageAt: e.sentAt,
4977
5010
  unreadCount: 0
4978
- } : t)), V?.setConversations(v.value);
5011
+ } : t)), H?.setConversations(v.value);
4979
5012
  }
4980
- function jt(e) {
4981
- let t = /* @__PURE__ */ new Date(), n = Nt(e.metadata);
5013
+ function Mt(e) {
5014
+ let t = /* @__PURE__ */ new Date(), n = Pt(e.metadata);
4982
5015
  return {
4983
5016
  id: `local-${e.muid}`,
4984
5017
  muid: e.muid,
@@ -5017,11 +5050,11 @@ function Os({ environment: e }) {
5017
5050
  source: null
5018
5051
  };
5019
5052
  }
5020
- function Mt(e, t) {
5053
+ function Nt(e, t) {
5021
5054
  let n = {};
5022
5055
  return t?.senderDisplayName?.trim() && (n.senderDisplayName = t.senderDisplayName.trim()), e ? (n.replyToMessageId = e.id, n.replyPreview = ms(e), n) : n;
5023
5056
  }
5024
- function Nt(e) {
5057
+ function Pt(e) {
5025
5058
  let t = e.replyPreview;
5026
5059
  if (!t || typeof t != "object") return;
5027
5060
  let n = t;
@@ -5032,13 +5065,13 @@ function Os({ environment: e }) {
5032
5065
  kind: n.kind ?? "text"
5033
5066
  };
5034
5067
  }
5035
- function Pt(e) {
5068
+ function Ft(e) {
5036
5069
  if (typeof navigator < "u" && !navigator.onLine) return !0;
5037
5070
  let t = Z(e, "").toLowerCase();
5038
5071
  return t.includes("network") || t.includes("failed to fetch") || t.includes("socket") || t.includes("offline");
5039
5072
  }
5040
- function Ft(e, t, n, r, i) {
5041
- let a = jt({
5073
+ function It(e, t, n, r, i) {
5074
+ let a = Mt({
5042
5075
  conversation: e,
5043
5076
  kind: "text",
5044
5077
  text: t,
@@ -5047,7 +5080,7 @@ function Os({ environment: e }) {
5047
5080
  muid: i,
5048
5081
  deliveryState: "queued"
5049
5082
  });
5050
- zt(a, {
5083
+ Bt(a, {
5051
5084
  id: a.id,
5052
5085
  muid: i,
5053
5086
  conversationId: e.id,
@@ -5060,9 +5093,9 @@ function Os({ environment: e }) {
5060
5093
  createdAt: a.sentAt.toISOString()
5061
5094
  });
5062
5095
  }
5063
- function It(e, t, n, r, i) {
5064
- if (Lt(e, t, r)) return;
5065
- let a = jt({
5096
+ function Lt(e, t, n, r, i) {
5097
+ if (Rt(e, t, r)) return;
5098
+ let a = Mt({
5066
5099
  conversation: e,
5067
5100
  kind: "poll",
5068
5101
  text: `Poll: ${t.question}`,
@@ -5072,7 +5105,7 @@ function Os({ environment: e }) {
5072
5105
  muid: i,
5073
5106
  deliveryState: "queued"
5074
5107
  });
5075
- zt(a, {
5108
+ Bt(a, {
5076
5109
  id: a.id,
5077
5110
  muid: i,
5078
5111
  conversationId: e.id,
@@ -5085,7 +5118,7 @@ function Os({ environment: e }) {
5085
5118
  createdAt: a.sentAt.toISOString()
5086
5119
  });
5087
5120
  }
5088
- function Lt(e, t, n) {
5121
+ function Rt(e, t, n) {
5089
5122
  let r = Date.now(), i = (e) => e.trim().toLowerCase(), a = (e) => e.map((e) => i(e)).filter(Boolean).join("\0"), o = i(t.question), s = a(t.options);
5090
5123
  return k.value.some((t) => {
5091
5124
  if (t.kind !== "poll" || !t.poll || t.conversationId !== e.id || t.targetId !== e.targetId || t.parentMessageId !== n) return !1;
@@ -5093,8 +5126,8 @@ function Os({ environment: e }) {
5093
5126
  return Number.isNaN(c) || r - c > 5e3 ? !1 : i(t.poll.question) === o && a(t.poll.options) === s;
5094
5127
  });
5095
5128
  }
5096
- async function Rt(e, t, n, r, i) {
5097
- let a = $s(t.file), o = jt({
5129
+ async function zt(e, t, n, r, i) {
5130
+ let a = $s(t.file), o = Mt({
5098
5131
  conversation: e,
5099
5132
  kind: a,
5100
5133
  text: t.caption?.trim() ?? "",
@@ -5126,19 +5159,19 @@ function Os({ environment: e }) {
5126
5159
  parentMessageId: r,
5127
5160
  createdAt: o.sentAt.toISOString()
5128
5161
  };
5129
- se.set(s.id, t.file);
5162
+ oe.set(s.id, t.file);
5130
5163
  try {
5131
- await V?.storeQueuedAttachment(s.id, t.file);
5164
+ await H?.storeQueuedAttachment(s.id, t.file);
5132
5165
  } catch {}
5133
- zt(o, s);
5166
+ Bt(o, s);
5134
5167
  }
5135
- function zt(e, t) {
5136
- k.value = [...k.value, t], V?.enqueue(t), Bt(e);
5168
+ function Bt(e, t) {
5169
+ k.value = [...k.value, t], H?.enqueue(t), Vt(e);
5137
5170
  }
5138
- function Bt(e) {
5139
- e.parentMessageId ? (E.value?.id === e.parentMessageId && (b.value = Hs(b.value, e)), Tt(e.parentMessageId)) : y.value = Hs(y.value, e), At(e), Et();
5171
+ function Vt(e) {
5172
+ e.parentMessageId ? (E.value?.id === e.parentMessageId && (b.value = Hs(b.value, e)), Et(e.parentMessageId)) : y.value = Hs(y.value, e), jt(e), Dt();
5140
5173
  }
5141
- function Vt(e, t) {
5174
+ function Ht(e, t) {
5142
5175
  let n = (n) => n.map((n) => {
5143
5176
  let r = Ks(n);
5144
5177
  return n.muid !== t && r !== t ? n : {
@@ -5146,40 +5179,40 @@ function Os({ environment: e }) {
5146
5179
  deliveryState: e
5147
5180
  };
5148
5181
  });
5149
- y.value = n(y.value), b.value = n(b.value), Et();
5182
+ y.value = n(y.value), b.value = n(b.value), Dt();
5150
5183
  }
5151
- function Ht(e) {
5184
+ function Ut(e) {
5152
5185
  if (!e) return;
5153
5186
  let t = [...y.value, ...b.value].filter((t) => {
5154
5187
  if (!t.id.startsWith("local-")) return !1;
5155
5188
  let n = Ks(t);
5156
5189
  return t.muid === e || n === e;
5157
5190
  });
5158
- for (let e of t) Dt(e);
5191
+ for (let e of t) Ot(e);
5159
5192
  }
5160
- async function Ut() {
5193
+ async function Wt() {
5161
5194
  if (!(f.value || k.value.length === 0 || !h.value || m.value)) {
5162
5195
  f.value = !0;
5163
5196
  try {
5164
- let e = [...k.value].filter((e) => !ce.has(e.id)).sort((e, t) => e.createdAt.localeCompare(t.createdAt));
5165
- for (let t of e) if (!ce.has(t.id)) {
5166
- ce.add(t.id);
5197
+ let e = [...k.value].filter((e) => !se.has(e.id)).sort((e, t) => e.createdAt.localeCompare(t.createdAt));
5198
+ for (let t of e) if (!se.has(t.id)) {
5199
+ se.add(t.id);
5167
5200
  try {
5168
- let e = await Wt(t);
5169
- k.value = k.value.filter((e) => e.id !== t.id), V?.dequeue(t.id), se.delete(t.id), t.kind === "attachment" && await V?.deleteQueuedAttachment(t.id), Ht(t.muid), e ? xt(M(e, _.value?.uid)) : await bt();
5201
+ let e = await J(t);
5202
+ k.value = k.value.filter((e) => e.id !== t.id), H?.dequeue(t.id), oe.delete(t.id), t.kind === "attachment" && await H?.deleteQueuedAttachment(t.id), Ut(t.muid), e ? St(N(e, _.value?.uid)) : await xt();
5170
5203
  } finally {
5171
- ce.delete(t.id);
5204
+ se.delete(t.id);
5172
5205
  }
5173
5206
  }
5174
5207
  } catch (e) {
5175
- Pt(e) || (g.value = Z(e, "Unable to sync queued messages."));
5208
+ Ft(e) || (g.value = Z(e, "Unable to sync queued messages."));
5176
5209
  } finally {
5177
5210
  f.value = !1;
5178
5211
  }
5179
5212
  }
5180
5213
  }
5181
- async function Wt(e) {
5182
- let t = e.receiverType === "group" ? H.RECEIVER_TYPE.GROUP : H.RECEIVER_TYPE.USER;
5214
+ async function J(e) {
5215
+ let t = e.receiverType === "group" ? U.RECEIVER_TYPE.GROUP : U.RECEIVER_TYPE.USER;
5183
5216
  if (e.kind === "poll" && e.poll) {
5184
5217
  let n = {
5185
5218
  question: e.poll.question,
@@ -5188,17 +5221,17 @@ function Os({ environment: e }) {
5188
5221
  receiverType: t
5189
5222
  };
5190
5223
  e.parentMessageId && (n.parentMessageId = Number(e.parentMessageId)), e.metadata && Object.keys(e.metadata).length > 0 && (n.metadata = e.metadata);
5191
- let r = await H.callExtension("polls", "POST", "v2/create", n);
5224
+ let r = await U.callExtension("polls", "POST", "v2/create", n);
5192
5225
  return r?.message ?? r?.custom_message ?? r?.data?.message ?? null;
5193
5226
  }
5194
5227
  if (e.kind === "attachment" && e.attachment) {
5195
- let n = se.get(e.id) ?? await V?.getQueuedAttachment(e.id) ?? null;
5228
+ let n = oe.get(e.id) ?? await H?.getQueuedAttachment(e.id) ?? null;
5196
5229
  if (!n) throw Error(`Queued attachment ${e.attachment.name} is no longer available for upload.`);
5197
- let r = new H.MediaMessage(e.targetId, n, e.attachment.kind, t);
5198
- return r.setMuid?.(e.muid), e.metadata && Object.keys(e.metadata).length > 0 && r.setMetadata?.(e.metadata), e.parentMessageId && r.setParentMessageId?.(Number(e.parentMessageId)), e.attachment.caption && r.setCaption?.(e.attachment.caption), H.sendMediaMessage(r);
5230
+ let r = new U.MediaMessage(e.targetId, n, e.attachment.kind, t);
5231
+ return r.setMuid?.(e.muid), e.metadata && Object.keys(e.metadata).length > 0 && r.setMetadata?.(e.metadata), e.parentMessageId && r.setParentMessageId?.(Number(e.parentMessageId)), e.attachment.caption && r.setCaption?.(e.attachment.caption), U.sendMediaMessage(r);
5199
5232
  }
5200
- let n = new H.TextMessage(e.targetId, e.text ?? "", t);
5201
- return n.setMuid?.(e.muid), e.metadata && Object.keys(e.metadata).length > 0 && n.setMetadata?.(e.metadata), e.parentMessageId && n.setParentMessageId?.(Number(e.parentMessageId)), H.sendMessage(n);
5233
+ let n = new U.TextMessage(e.targetId, e.text ?? "", t);
5234
+ return n.setMuid?.(e.muid), e.metadata && Object.keys(e.metadata).length > 0 && n.setMetadata?.(e.metadata), e.parentMessageId && n.setParentMessageId?.(Number(e.parentMessageId)), U.sendMessage(n);
5202
5235
  }
5203
5236
  return {
5204
5237
  initialized: t,
@@ -5225,70 +5258,72 @@ function Os({ environment: e }) {
5225
5258
  hasOlderThreadMessages: C,
5226
5259
  pendingQueueCount: j,
5227
5260
  activeConversationId: T,
5228
- activeConversation: N,
5261
+ activeConversation: P,
5229
5262
  activeThreadParentMessage: E,
5230
5263
  replyToMessage: D,
5231
5264
  editingMessage: O,
5232
- init: pe,
5233
- connectRealtime: Me,
5234
- disconnectRealtime: Pe,
5235
- login: me,
5236
- logout: he,
5237
- fetchConversations: Ie,
5238
- selectConversation: Le,
5239
- sendTextMessage: K,
5240
- sendAttachmentMessage: He,
5241
- sendPollMessage: Ue,
5242
- fetchScheduledMessages: Ye,
5243
- loadOlderMessages: it,
5244
- loadOlderThreadMessages: at,
5245
- ensureMessageLoaded: ot,
5246
- scheduleMessage: Xe,
5247
- rescheduleMessage: Ze,
5248
- setReplyToMessage: Re,
5249
- setEditingMessage: W,
5250
- openThread: ze,
5251
- closeThread: Be,
5252
- fetchMessageReceipts: vt,
5253
- deleteMessage: qe,
5254
- votePoll: We,
5255
- toggleReaction: Ke,
5256
- translateMessage: Je,
5265
+ init: fe,
5266
+ connectRealtime: je,
5267
+ disconnectRealtime: Ne,
5268
+ login: pe,
5269
+ logout: me,
5270
+ fetchConversations: Fe,
5271
+ selectConversation: Ie,
5272
+ sendTextMessage: q,
5273
+ sendAttachmentMessage: Ve,
5274
+ sendPollMessage: He,
5275
+ fetchScheduledMessages: Je,
5276
+ loadOlderMessages: at,
5277
+ loadOlderThreadMessages: ot,
5278
+ ensureMessageLoaded: st,
5279
+ scheduleMessage: Ye,
5280
+ rescheduleMessage: Qe,
5281
+ removeScheduledMessage: Xe,
5282
+ editScheduledMessage: Ze,
5283
+ setReplyToMessage: Le,
5284
+ setEditingMessage: G,
5285
+ openThread: Re,
5286
+ closeThread: ze,
5287
+ fetchMessageReceipts: yt,
5288
+ deleteMessage: Ke,
5289
+ votePoll: Ue,
5290
+ toggleReaction: Ge,
5291
+ translateMessage: qe,
5257
5292
  mentionDisplayNamesByUid: A,
5258
- rememberMentionDisplayNames: ee
5293
+ rememberMentionDisplayNames: M
5259
5294
  };
5260
5295
  }
5261
5296
  async function ks(e) {
5262
- return fe(e), Es === e && Ds || (Ds = (async () => {
5263
- let t = U(), n = new H.AppSettingsBuilder().subscribePresenceForAllUsers().setRegion(t.region).autoEstablishSocketConnection(!0).setStorageMode(H.StorageMode.SESSION).build();
5264
- await H.init(t.appId, n), Es = e;
5297
+ return de(e), Es === e && Ds || (Ds = (async () => {
5298
+ let t = W(), n = new U.AppSettingsBuilder().subscribePresenceForAllUsers().setRegion(t.region).autoEstablishSocketConnection(!0).setStorageMode(U.StorageMode.SESSION).build();
5299
+ await U.init(t.appId, n), Es = e;
5265
5300
  })()), Ds;
5266
5301
  }
5267
5302
  async function As(e) {
5268
5303
  let t = JSON.parse(atob(e.split(".")[1]));
5269
5304
  if (!t.sub) throw Error("Cannot read JWT subject from access token.");
5270
- let n = ye();
5305
+ let n = ve();
5271
5306
  if (n && n.sub === t.sub && n.token) return n.token;
5272
- let r = await fetch(`${U().chatApiBaseUrl}/chats/token`, {
5307
+ let r = await fetch(`${W().chatApiBaseUrl}/chats/token`, {
5273
5308
  method: "POST",
5274
5309
  headers: new Headers([["Authorization", `Bearer ${e}`]])
5275
5310
  });
5276
- if (r.status === 401) throw ve(null), Se(), Error("Unauthorized while fetching CometChat token.");
5311
+ if (r.status === 401) throw _e(null), xe(), Error("Unauthorized while fetching CometChat token.");
5277
5312
  if (!r.ok) throw Error(`Token exchange failed with status ${r.status}.`);
5278
5313
  let i = await r.json();
5279
- return xe({
5314
+ return be({
5280
5315
  sub: t.sub,
5281
5316
  token: i.token
5282
5317
  }), i.token;
5283
5318
  }
5284
5319
  function js(e, t) {
5285
- let n = e.getConversationWith(), r = e.getConversationType() === H.RECEIVER_TYPE.GROUP ? "group" : "user", i = r === "user" ? n : null, a = r === "group" ? n : null, o = r === "group" ? a.getGuid() : i.getUid(), s = e.getLastMessage(), c = t ? `group_${t}` : null;
5320
+ let n = e.getConversationWith(), r = e.getConversationType() === U.RECEIVER_TYPE.GROUP ? "group" : "user", i = r === "user" ? n : null, a = r === "group" ? n : null, o = r === "group" ? a.getGuid() : i.getUid(), s = e.getLastMessage(), c = t ? `group_${t}` : null;
5286
5321
  if (c && e.getConversationId() === c) return {
5287
5322
  id: e.getConversationId(),
5288
5323
  targetId: o,
5289
5324
  type: r,
5290
- title: G("scheduledMessages"),
5291
- subtitle: G("hiddenHelperConversation"),
5325
+ title: K("scheduledMessages"),
5326
+ subtitle: K("hiddenHelperConversation"),
5292
5327
  unreadCount: 0,
5293
5328
  tags: [],
5294
5329
  source: e
@@ -5300,7 +5335,7 @@ function js(e, t) {
5300
5335
  type: r,
5301
5336
  title: n.getName() ?? o,
5302
5337
  subtitle: l && Gs(l) && !l.isDeleted ? Js(l) : "No messages yet",
5303
- avatar: i ? Ce(i.getAvatar()) : void 0,
5338
+ avatar: i ? Se(i.getAvatar()) : void 0,
5304
5339
  unreadCount: Number.isFinite(u) ? u : 0,
5305
5340
  lastMessageAt: s && !l?.isDeleted ? /* @__PURE__ */ new Date((s.getSentAt?.() ?? 0) * 1e3) : void 0,
5306
5341
  tags: (e.getTags() ?? []).map((e) => String(e)),
@@ -5359,7 +5394,7 @@ function Fs(e) {
5359
5394
  return {
5360
5395
  uid: e.getUid(),
5361
5396
  name: e.getName?.() ?? e.getUid(),
5362
- avatar: Ce(e.getAvatar?.()),
5397
+ avatar: Se(e.getAvatar?.()),
5363
5398
  status: e.getStatus?.() ?? void 0
5364
5399
  };
5365
5400
  }
@@ -5379,7 +5414,7 @@ function Rs(e, t) {
5379
5414
  let n = e.getType?.(), r = e.getCategory?.(), i = bc(e);
5380
5415
  if (String(r).toLowerCase() === "action") return lc(e);
5381
5416
  if (i) return `Poll: ${i.question}`;
5382
- if (n === H.MESSAGE_TYPE.TEXT || typeof e.getText == "function") {
5417
+ if (n === U.MESSAGE_TYPE.TEXT || typeof e.getText == "function") {
5383
5418
  let t = us(e.getText?.());
5384
5419
  if (t) return t;
5385
5420
  }
@@ -5387,14 +5422,14 @@ function Rs(e, t) {
5387
5422
  let t = hc(e, fc(e))[0];
5388
5423
  return e.getCaption?.()?.trim?.() || os(t ? [t] : [], "Sent an attachment");
5389
5424
  }
5390
- return e.getSender?.()?.getUid?.() === t ? G("youSentAMessage") : G("unsupportedMessageType");
5425
+ return e.getSender?.()?.getUid?.() === t ? K("youSentAMessage") : K("unsupportedMessageType");
5391
5426
  }
5392
5427
  function zs(e, t) {
5393
5428
  if (e.getDeletedAt?.()) return "Message removed";
5394
5429
  let n = e.getType?.(), r = e.getCategory?.(), i = bc(e);
5395
5430
  if (String(r).toLowerCase() === "action") return lc(e);
5396
5431
  if (i) return `Poll: ${i.question}`;
5397
- if (n === H.MESSAGE_TYPE.TEXT || typeof e.getText == "function") {
5432
+ if (n === U.MESSAGE_TYPE.TEXT || typeof e.getText == "function") {
5398
5433
  let t = ss(e.getText?.());
5399
5434
  if (ls(t)) return t;
5400
5435
  }
@@ -5404,10 +5439,10 @@ function zs(e, t) {
5404
5439
  let n = hc(e, fc(e))[0];
5405
5440
  return os(n ? [n] : [], "Sent an attachment");
5406
5441
  }
5407
- return e.getSender?.()?.getUid?.() === t ? G("youSentAMessage") : G("unsupportedMessageType");
5442
+ return e.getSender?.()?.getUid?.() === t ? K("youSentAMessage") : K("unsupportedMessageType");
5408
5443
  }
5409
5444
  function Bs(e) {
5410
- return [...e].filter((e) => e.title !== G("scheduledMessages")).sort((e, t) => {
5445
+ return [...e].filter((e) => e.title !== K("scheduledMessages")).sort((e, t) => {
5411
5446
  let n = e.lastMessageAt?.getTime() ?? 0;
5412
5447
  return (t.lastMessageAt?.getTime() ?? 0) - n;
5413
5448
  });
@@ -5446,17 +5481,17 @@ function Z(e, t) {
5446
5481
  return e instanceof Error && e.message ? e.message : t;
5447
5482
  }
5448
5483
  function Ys(e) {
5449
- return e.type === "group" ? H.RECEIVER_TYPE.GROUP : H.RECEIVER_TYPE.USER;
5484
+ return e.type === "group" ? U.RECEIVER_TYPE.GROUP : U.RECEIVER_TYPE.USER;
5450
5485
  }
5451
5486
  function Xs() {
5452
- let e = _e();
5487
+ let e = ge();
5453
5488
  if (!e) throw Error("Missing access token.");
5454
5489
  return e;
5455
5490
  }
5456
5491
  async function Zs(e, t, n) {
5457
5492
  let r = t.text?.trim();
5458
5493
  if (!r) return;
5459
- let i = Xs(), a = await fetch(`${U().chatApiBaseUrl}/chats/scheduledMessages`, {
5494
+ let i = Xs(), a = await fetch(`${W().chatApiBaseUrl}/chats/scheduledMessages`, {
5460
5495
  method: "POST",
5461
5496
  headers: {
5462
5497
  "Content-Type": "application/json",
@@ -5476,9 +5511,9 @@ async function Zs(e, t, n) {
5476
5511
  }
5477
5512
  async function Qs(e, t, n) {
5478
5513
  if (!t.file) return;
5479
- let r = Xs(), i = ye()?.token;
5514
+ let r = Xs(), i = ve()?.token;
5480
5515
  if (!i) throw Error("Missing CometChat auth token.");
5481
- let a = ec(t.file), o = t.caption?.trim() ?? "", s = tc(e, t.file, a, o, t.scheduleDate, n), c = await fetch(`${U().chatApiBaseUrl}/chats/scheduledMediaMessages`, {
5516
+ let a = ec(t.file), o = t.caption?.trim() ?? "", s = tc(e, t.file, a, o, t.scheduleDate, n), c = await fetch(`${W().chatApiBaseUrl}/chats/scheduledMediaMessages`, {
5482
5517
  method: "POST",
5483
5518
  headers: {
5484
5519
  Accept: "multipart/form-data",
@@ -5499,7 +5534,7 @@ function ec(e) {
5499
5534
  return t;
5500
5535
  }
5501
5536
  function tc(e, t, n, r, i, a) {
5502
- let o = new H.MediaMessage(e.targetId, t, n, Ys(e));
5537
+ let o = new U.MediaMessage(e.targetId, t, n, Ys(e));
5503
5538
  return o.setSentAt(Math.floor(Date.now() / 1e3)), o.setMuid(globalThis.crypto?.randomUUID?.() ?? `${Date.now()}-${t.name}`), r && o.setCaption(r), o.setMetadata({
5504
5539
  scheduleDate: i,
5505
5540
  file: t,
@@ -5532,11 +5567,11 @@ function ic(e, t) {
5532
5567
  return typeof n == "string" && n.trim() ? n.trim() : e?.getName?.() ?? "System";
5533
5568
  }
5534
5569
  function ac(e, t) {
5535
- return Ce(sc(t)) || (oc(e, "sender") ?? void 0);
5570
+ return Se(sc(t)) || (oc(e, "sender") ?? void 0);
5536
5571
  }
5537
5572
  function oc(e, t) {
5538
5573
  let n = Ec(e)?.entities?.[t]?.entity;
5539
- return Ce(sc(n));
5574
+ return Se(sc(n));
5540
5575
  }
5541
5576
  function sc(e) {
5542
5577
  if (!e || typeof e != "object") return e;
@@ -5784,9 +5819,9 @@ function kc(e, t) {
5784
5819
  let n = t?.value?.getMetadata?.() ?? {};
5785
5820
  if (!e?.getSender?.() || n.isChannel) return "";
5786
5821
  let r = e?.getData?.()?.entities?.receiver?.entity?.scope, i = e?.getReceiver?.()?.getMetadata?.() ?? {};
5787
- e instanceof H.Action && (i = e?.getActionFor?.()?.getMetadata?.() ?? {});
5822
+ e instanceof U.Action && (i = e?.getActionFor?.()?.getMetadata?.() ?? {});
5788
5823
  let a = i.systemDisplayName;
5789
- return e?.getData?.()?.metadata?.senderDisplayName && (r == "moderator" || r === void 0) ? e.getData().metadata.senderDisplayName : a && (e instanceof H.Action || r == "admin") ? a : e?.getSender?.()?.getName?.();
5824
+ return e?.getData?.()?.metadata?.senderDisplayName && (r == "moderator" || r === void 0) ? e.getData().metadata.senderDisplayName : a && (e instanceof U.Action || r == "admin") ? a : e?.getSender?.()?.getName?.();
5790
5825
  }
5791
5826
  function Ac(e, t = 25, n) {
5792
5827
  let r = e.trim();
@@ -5809,7 +5844,7 @@ function Ac(e, t = 25, n) {
5809
5844
  };
5810
5845
  }
5811
5846
  async function jc(e) {
5812
- let t = new H.GroupMembersRequestBuilder(e).setLimit(50).build(), n = !0, r = [];
5847
+ let t = new U.GroupMembersRequestBuilder(e).setLimit(50).build(), n = !0, r = [];
5813
5848
  try {
5814
5849
  for (; n;) {
5815
5850
  let e = await t.fetchNext();
@@ -5828,7 +5863,7 @@ async function jc(e) {
5828
5863
  }
5829
5864
  async function Mc(e) {
5830
5865
  await Hc("failed to get muted setting. User not logged in");
5831
- let t = await Uc(`${U().chatApiBaseUrl}/chats/${e}/settings/${(await H.getLoggedinUser())?.getUid?.()}`, { method: "GET" });
5866
+ let t = await Uc(`${W().chatApiBaseUrl}/chats/${e}/settings/${(await U.getLoggedinUser())?.getUid?.()}`, { method: "GET" });
5832
5867
  return zc()?.storeParticipantSettings({
5833
5868
  chatUid: e,
5834
5869
  mutedUntil: t.mutedUntil,
@@ -5837,7 +5872,7 @@ async function Mc(e) {
5837
5872
  }
5838
5873
  async function Nc(e, t) {
5839
5874
  await Hc("failed to mute chat. User not logged in");
5840
- let n = await Uc(`${U().chatApiBaseUrl}/chats/${e}/settings/${(await H.getLoggedinUser())?.getUid?.()}`, {
5875
+ let n = await Uc(`${W().chatApiBaseUrl}/chats/${e}/settings/${(await U.getLoggedinUser())?.getUid?.()}`, {
5841
5876
  method: "PATCH",
5842
5877
  body: JSON.stringify({ mutedUntil: t })
5843
5878
  });
@@ -5848,10 +5883,10 @@ async function Nc(e, t) {
5848
5883
  }), n.mutedUntil;
5849
5884
  }
5850
5885
  async function Pc() {
5851
- return await Hc("failed to get muted all setting. User not logged in"), Uc(`${U().chatApiBaseUrl}/person/settings`, { method: "GET" });
5886
+ return await Hc("failed to get muted all setting. User not logged in"), Uc(`${W().chatApiBaseUrl}/person/settings`, { method: "GET" });
5852
5887
  }
5853
5888
  async function Fc(e) {
5854
- return await Hc("failed to update person settings. User not logged in"), Uc(`${U().chatApiBaseUrl}/person/settings`, {
5889
+ return await Hc("failed to update person settings. User not logged in"), Uc(`${W().chatApiBaseUrl}/person/settings`, {
5855
5890
  method: "PATCH",
5856
5891
  body: JSON.stringify(e)
5857
5892
  });
@@ -5876,19 +5911,19 @@ function zc() {
5876
5911
  return e ? new ys(e) : null;
5877
5912
  }
5878
5913
  function Bc() {
5879
- let e = Ne();
5880
- return e ? `bcc-chat:${U().appId}:${e}` : null;
5914
+ let e = Me();
5915
+ return e ? `bcc-chat:${W().appId}:${e}` : null;
5881
5916
  }
5882
5917
  function Vc() {
5883
- return H.__bccCompatLoggedInUser ?? null;
5918
+ return U.__bccCompatLoggedInUser ?? null;
5884
5919
  }
5885
5920
  async function Hc(e) {
5886
- let t = await H.getLoggedinUser();
5887
- if (H.__bccCompatLoggedInUser = t ?? null, !t?.getUid?.()) throw Error(e);
5921
+ let t = await U.getLoggedinUser();
5922
+ if (U.__bccCompatLoggedInUser = t ?? null, !t?.getUid?.()) throw Error(e);
5888
5923
  return t;
5889
5924
  }
5890
5925
  async function Uc(e, t) {
5891
- let n = _e();
5926
+ let n = ge();
5892
5927
  if (!n) throw Error("Missing access token.");
5893
5928
  let r = await fetch(e, {
5894
5929
  ...t,
@@ -5952,7 +5987,7 @@ function al(e) {
5952
5987
  if (Q.value && !e && !Xc.value) return Q.value;
5953
5988
  let t = e ?? Xc.value;
5954
5989
  if (!t) throw Error("Environment has not been set yet. Call app.use(chat, { environment: ... }) first.");
5955
- return (!Q.value || Xc.value !== t) && (Xc.value = t, fe(t), Q.value = Os({ environment: t })), Q.value;
5990
+ return (!Q.value || Xc.value !== t) && (Xc.value = t, de(t), Q.value = Os({ environment: t })), Q.value;
5956
5991
  }
5957
5992
  function ol(e) {
5958
5993
  let t = e.source?.getLastMessage?.();
@@ -5982,17 +6017,17 @@ var sl = n(() => Q.value?.connected.value ?? !1), cl = n(() => Yc.value && !sl.v
5982
6017
  muteSettings: e.muteSettings ?? null
5983
6018
  })));
5984
6019
  async function fl(e, t) {
5985
- el.value = t.loggerCallback, Be(t.language ?? "en"), il(t.themeMode);
6020
+ el.value = t.loggerCallback, ze(t.language ?? "en"), il(t.themeMode);
5986
6021
  let n = e.config.globalProperties.$primevue;
5987
- n && (n.config.ripple = !0, n.config.inputVariant = "filled"), e.component("BccChat", th), e.component("BccChatMessageList", th), e.provide("theme", { theme: Kc });
6022
+ n && (n.config.ripple = !0, n.config.inputVariant = "filled"), e.component("BccChat", ah), e.component("BccChatMessageList", ah), e.provide("theme", { theme: Kc });
5988
6023
  let r = al(t.environment);
5989
6024
  rl(Jc.INFO, "Initializing chat", {
5990
6025
  environment: t.environment,
5991
- language: Le.value,
6026
+ language: Ie.value,
5992
6027
  themeMode: t.themeMode
5993
- }), await r.init(), Yc.value = !0, nl?.(), p(t.accessToken) ? nl = P(t.accessToken, async (e) => {
6028
+ }), await r.init(), Yc.value = !0, nl?.(), p(t.accessToken) ? nl = F(t.accessToken, async (e) => {
5994
6029
  e ? await pl(e) : await ml();
5995
- }, { immediate: !0 }) : t.accessToken && await pl(t.accessToken), rl(Jc.INFO, "Chat initialized", { environment: U().appId });
6030
+ }, { immediate: !0 }) : t.accessToken && await pl(t.accessToken), rl(Jc.INFO, "Chat initialized", { environment: W().appId });
5996
6031
  }
5997
6032
  async function pl(e) {
5998
6033
  if (!e) return ml();
@@ -6020,7 +6055,7 @@ function vl(e) {
6020
6055
  Qc.value = e;
6021
6056
  }
6022
6057
  function yl(e) {
6023
- Be(e);
6058
+ ze(e);
6024
6059
  }
6025
6060
  function bl(e) {
6026
6061
  il(e);
@@ -6034,7 +6069,7 @@ function Sl(e) {
6034
6069
  async function Cl(e) {
6035
6070
  if (!ll.value) return null;
6036
6071
  try {
6037
- return await H.getGroup(e);
6072
+ return await U.getGroup(e);
6038
6073
  } catch (e) {
6039
6074
  return e && typeof e == "object" && "code" in e && e.code === "ERR_GUID_NOT_FOUND" ? void 0 : null;
6040
6075
  }
@@ -6049,7 +6084,7 @@ async function Tl(e) {
6049
6084
  }
6050
6085
  async function El(e) {
6051
6086
  try {
6052
- return ll.value && (await H.getOnlineGroupMemberCount([e]))[e] || 0;
6087
+ return ll.value && (await U.getOnlineGroupMemberCount([e]))[e] || 0;
6053
6088
  } catch {
6054
6089
  return 0;
6055
6090
  }
@@ -6080,7 +6115,7 @@ var Al = {
6080
6115
  login: pl,
6081
6116
  logout: ml,
6082
6117
  setCurrentEnvironment: Sl,
6083
- getCurrentEnvironment: U,
6118
+ getCurrentEnvironment: W,
6084
6119
  setThemeMode: bl,
6085
6120
  setLanguage: yl,
6086
6121
  getGroup: Cl,
@@ -6091,7 +6126,7 @@ var Al = {
6091
6126
  searchChat: (e, t = 25) => Ac(e, t, Q.value?.currentUser.value?.uid),
6092
6127
  getSenderDisplayName: kc,
6093
6128
  getMessageTextPreview: ps,
6094
- proxyImage: we,
6129
+ proxyImage: Ce,
6095
6130
  getMutedUntil: Ol,
6096
6131
  muteChat: Dl,
6097
6132
  getMyChatSettings: Pc,
@@ -6099,7 +6134,7 @@ var Al = {
6099
6134
  setMuteAll: Ic,
6100
6135
  toggleMuteAll: Lc,
6101
6136
  toMarkdownHtml: Xo,
6102
- retrieveCcToken: be,
6137
+ retrieveCcToken: ye,
6103
6138
  getChatMessages: Qc,
6104
6139
  scrollToMessageId: $c,
6105
6140
  scrollToMessage: kl,
@@ -6108,7 +6143,7 @@ var Al = {
6108
6143
  onlineStatus: ul.onlineStatus,
6109
6144
  theme: Kc,
6110
6145
  themeMode: Zc,
6111
- language: Le
6146
+ language: Ie
6112
6147
  };
6113
6148
  //#endregion
6114
6149
  //#region src/chat/conversationState.ts
@@ -6159,7 +6194,7 @@ function Hl(e) {
6159
6194
  uid: t.targetId,
6160
6195
  displayName: t.title,
6161
6196
  avatar: t.avatar
6162
- }] : a.filter((e) => e.uid !== n).map(Je) : [];
6197
+ }] : a.filter((e) => e.uid !== n).map(qe) : [];
6163
6198
  });
6164
6199
  return {
6165
6200
  client: t,
@@ -6173,7 +6208,7 @@ function Hl(e) {
6173
6208
  isChannel: u,
6174
6209
  sendOptions: d,
6175
6210
  mentionCandidates: f,
6176
- mentionNameByUid: n(() => Ye(f.value))
6211
+ mentionNameByUid: n(() => Je(f.value))
6177
6212
  };
6178
6213
  }
6179
6214
  var Ul = Symbol("conversationCtx");
@@ -6505,6 +6540,12 @@ function ou({ conversation: e, composer: t, dialogs: n, bus: r }) {
6505
6540
  }), a("ui:reschedule", async (t) => {
6506
6541
  let n = t, r = e.client.value;
6507
6542
  r && await r.rescheduleMessage(n);
6543
+ }), a("ui:removeScheduled", async (t) => {
6544
+ let n = e.client.value;
6545
+ n && await n.removeScheduledMessage(t);
6546
+ }), a("ui:editScheduledText", async (t) => {
6547
+ let n = t, r = e.client.value;
6548
+ r && await r.editScheduledMessage(n.message, n.nextText);
6508
6549
  });
6509
6550
  function o() {
6510
6551
  for (let e of i) e();
@@ -6552,10 +6593,10 @@ function fu(e) {
6552
6593
  return;
6553
6594
  }
6554
6595
  try {
6555
- t.value = (await new H.GroupMembersRequestBuilder(n).setLimit(50).build().fetchNext() ?? []).map((e) => ({
6596
+ t.value = (await new U.GroupMembersRequestBuilder(n).setLimit(50).build().fetchNext() ?? []).map((e) => ({
6556
6597
  uid: e.getUid(),
6557
6598
  displayName: e.getName(),
6558
- avatar: Ce(e.getAvatar?.()) ?? "",
6599
+ avatar: Se(e.getAvatar?.()) ?? "",
6559
6600
  role: e.getScope()
6560
6601
  })), e.onMembersChanged(t.value);
6561
6602
  } catch {
@@ -6568,8 +6609,8 @@ function fu(e) {
6568
6609
  let c = {
6569
6610
  uid: r.getUid(),
6570
6611
  displayName: r.getName(),
6571
- avatar: Ce(r.getAvatar?.()) ?? "",
6572
- role: a ?? r.getScope?.() ?? H.GROUP_MEMBER_SCOPE.PARTICIPANT
6612
+ avatar: Se(r.getAvatar?.()) ?? "",
6613
+ role: a ?? r.getScope?.() ?? U.GROUP_MEMBER_SCOPE.PARTICIPANT
6573
6614
  };
6574
6615
  i === "add" ? t.value.some((e) => e.uid === c.uid) || (t.value = [...t.value, c]) : i === "remove" ? t.value = t.value.filter((e) => e.uid !== c.uid) : t.value = t.value.map((e) => e.uid === c.uid ? {
6575
6616
  ...e,
@@ -6577,7 +6618,7 @@ function fu(e) {
6577
6618
  } : e), e.onMembersChanged(t.value);
6578
6619
  }
6579
6620
  return b(() => {
6580
- H.addGroupListener(n, new H.GroupListener({
6621
+ U.addGroupListener(n, new U.GroupListener({
6581
6622
  onGroupMemberScopeChanged: (e, t, n, r, a) => {
6582
6623
  i(a, t, "update", n);
6583
6624
  },
@@ -6601,7 +6642,7 @@ function fu(e) {
6601
6642
  }
6602
6643
  }));
6603
6644
  }), x(() => {
6604
- H.removeGroupListener(n);
6645
+ U.removeGroupListener(n);
6605
6646
  }), {
6606
6647
  groupMembers: t,
6607
6648
  fetchGroupMembers: r
@@ -6934,7 +6975,7 @@ function Ku(e) {
6934
6975
  triggerChar: "@",
6935
6976
  enabled: e.enabled,
6936
6977
  maxSuggestions: e.maxSuggestions ?? 8,
6937
- getCandidates: (t) => Xe(e.getMentionCandidates(), t, e.maxSuggestions ?? 8).map((e) => ({
6978
+ getCandidates: (t) => Ye(e.getMentionCandidates(), t, e.maxSuggestions ?? 8).map((e) => ({
6938
6979
  id: e.uid,
6939
6980
  label: e.displayName,
6940
6981
  avatar: e.avatar
@@ -7099,14 +7140,14 @@ function Qu(e, t, r, i) {
7099
7140
  getTriggers: () => u.value,
7100
7141
  onChange: () => E()
7101
7142
  });
7102
- P(() => i.getMentionCandidates?.(), () => {
7143
+ F(() => i.getMentionCandidates?.(), () => {
7103
7144
  S();
7104
7145
  }, { deep: !0 });
7105
7146
  function C(e) {
7106
7147
  let t = qo(e);
7107
- return t.includes("<@uid:") ? qo(rt(t, i.getMentionNameByUid?.() ?? {})) : t;
7148
+ return t.includes("<@uid:") ? qo(nt(t, i.getMentionNameByUid?.() ?? {})) : t;
7108
7149
  }
7109
- P(() => i.getModelValue(), (e) => {
7150
+ F(() => i.getModelValue(), (e) => {
7110
7151
  let n = t.value, r = C(e);
7111
7152
  if (r !== l.value) {
7112
7153
  if (!n) {
@@ -7144,7 +7185,7 @@ function Qu(e, t, r, i) {
7144
7185
  function j() {
7145
7186
  _(), E();
7146
7187
  }
7147
- function ee(e) {
7188
+ function M(e) {
7148
7189
  if (!v(e)) {
7149
7190
  if ((e.ctrlKey || e.metaKey) && !e.shiftKey) {
7150
7191
  let t = e.key.toLowerCase();
@@ -7168,7 +7209,7 @@ function Qu(e, t, r, i) {
7168
7209
  e.key === "Escape" && (O(), g());
7169
7210
  }
7170
7211
  }
7171
- function te(e) {
7212
+ function ee(e) {
7172
7213
  e.preventDefault();
7173
7214
  let t = e.clipboardData?.getData("text/html") ?? "", n = e.clipboardData?.getData("text/plain") ?? "";
7174
7215
  if (document.execCommand("styleWithCSS", !1, "false"), t) {
@@ -7180,7 +7221,7 @@ function Qu(e, t, r, i) {
7180
7221
  }
7181
7222
  n && (document.execCommand("insertText", !1, n), E());
7182
7223
  }
7183
- function M(e) {
7224
+ function N(e) {
7184
7225
  if (!k()) {
7185
7226
  O();
7186
7227
  return;
@@ -7190,45 +7231,45 @@ function Qu(e, t, r, i) {
7190
7231
  y: e.clientY
7191
7232
  }, s.value = !0;
7192
7233
  }
7193
- function N(t) {
7234
+ function P(t) {
7194
7235
  let n = t.target;
7195
- n && (a.value?.contains(n) || r.value?.contains(n) || e.value?.contains(n)) || (O(), g());
7236
+ n && (a.value?.contains(n) || r.value?.$el.contains(n) || e.value?.contains(n)) || (O(), g());
7196
7237
  }
7197
- function F(e) {
7238
+ function I(e) {
7198
7239
  x(e), D();
7199
7240
  }
7200
- function ne() {
7241
+ function te() {
7201
7242
  k() || O();
7202
7243
  }
7203
- function I() {
7244
+ function L() {
7204
7245
  o.value += 1, O(), g(), l.value = "", i.updateModelValue("");
7205
7246
  }
7206
7247
  return b(() => {
7207
- document.addEventListener("pointerdown", N), document.addEventListener("selectionchange", ne), h(() => {
7248
+ document.addEventListener("pointerdown", P), document.addEventListener("selectionchange", te), h(() => {
7208
7249
  if (t.value) {
7209
7250
  let e = C(i.getModelValue());
7210
7251
  t.value.innerHTML = e, T(t.value), e ? delete t.value.dataset.empty : t.value.dataset.empty = "true", l.value = e;
7211
7252
  }
7212
7253
  });
7213
7254
  }), y(() => {
7214
- document.removeEventListener("pointerdown", N), document.removeEventListener("selectionchange", ne);
7255
+ document.removeEventListener("pointerdown", P), document.removeEventListener("selectionchange", te);
7215
7256
  }), {
7216
7257
  applyFormat: A,
7217
7258
  editorKey: o,
7218
7259
  focusEditor: D,
7219
7260
  formatMenuPosition: c,
7220
- handleContextMenu: M,
7261
+ handleContextMenu: N,
7221
7262
  handleInput: j,
7222
- handleKeydown: ee,
7223
- handlePaste: te,
7263
+ handleKeydown: M,
7264
+ handlePaste: ee,
7224
7265
  hideFormatMenu: O,
7225
- resetEditor: I,
7266
+ resetEditor: L,
7226
7267
  showFormatMenu: s,
7227
7268
  triggerCandidates: d,
7228
7269
  triggerMenuPosition: f,
7229
7270
  highlightedTriggerIndex: p,
7230
7271
  showTriggerMenu: m,
7231
- selectTriggerCandidate: F
7272
+ selectTriggerCandidate: I
7232
7273
  };
7233
7274
  }
7234
7275
  //#endregion
@@ -7237,7 +7278,7 @@ var $u = ["data-testid", "onClick"], ed = { class: "composer-actions-menu__icon"
7237
7278
  __name: "ComposerActionsPopover",
7238
7279
  emits: ["pickFile", "openPoll"],
7239
7280
  setup(t, { expose: n, emit: i }) {
7240
- let s = i, c = w(!1), l = w(null), { t: u } = K(), d = typeof navigator < "u" && (/iPad|iPhone|iPod/.test(navigator.userAgent) || navigator.platform === "MacIntel" && navigator.maxTouchPoints > 1), f = [
7281
+ let s = i, c = w(!1), l = w(null), { t: u } = q(), d = typeof navigator < "u" && (/iPad|iPhone|iPod/.test(navigator.userAgent) || navigator.platform === "MacIntel" && navigator.maxTouchPoints > 1), f = [
7241
7282
  {
7242
7283
  kind: "image",
7243
7284
  label: "attachImage",
@@ -7287,7 +7328,7 @@ var $u = ["data-testid", "onClick"], ed = { class: "composer-actions-menu__icon"
7287
7328
  }), n({
7288
7329
  toggle: p,
7289
7330
  hide: m
7290
- }), (t, n) => ne((S(), a("div", {
7331
+ }), (t, n) => te((S(), a("div", {
7291
7332
  ref_key: "menuRef",
7292
7333
  ref: l,
7293
7334
  class: "composer-actions-menu",
@@ -7303,7 +7344,7 @@ var $u = ["data-testid", "onClick"], ed = { class: "composer-actions-menu__icon"
7303
7344
  class: "composer-actions-menu__item",
7304
7345
  "data-testid": "composer-create-poll",
7305
7346
  onClick: g
7306
- }, [o("span", td, [(S(), r(D(j(gu)), { class: "size-5" }))]), o("span", null, k(j(u)("createPoll")), 1)])], 512)), [[N, c.value]]);
7347
+ }, [o("span", td, [(S(), r(D(j(gu)), { class: "size-5" }))]), o("span", null, k(j(u)("createPoll")), 1)])], 512)), [[P, c.value]]);
7307
7348
  }
7308
7349
  }), $ = (e, t) => {
7309
7350
  let n = e.__vccOpts || e;
@@ -7318,12 +7359,12 @@ var $u = ["data-testid", "onClick"], ed = { class: "composer-actions-menu__icon"
7318
7359
  },
7319
7360
  emits: ["cancel"],
7320
7361
  setup(e, { emit: t }) {
7321
- let n = t, { t: r } = K();
7362
+ let n = t, { t: r } = q();
7322
7363
  return (t, i) => (S(), a("div", { class: g(["context-banner", `context-banner--${e.variant}`]) }, [o("div", id, [
7323
7364
  o("p", ad, k(e.variant === "editing" ? j(r)("editingInContext", { context: e.contextLabel }) : j(r)("replyingInContext", { context: e.contextLabel })), 1),
7324
7365
  o("p", od, k(e.message.senderName), 1),
7325
7366
  o("p", sd, k(j(ds)(e.message)), 1)
7326
- ]), l(j(R), {
7367
+ ]), l(j(z), {
7327
7368
  icon: j(yu),
7328
7369
  text: "",
7329
7370
  rounded: "",
@@ -7339,7 +7380,7 @@ var $u = ["data-testid", "onClick"], ed = { class: "composer-actions-menu__icon"
7339
7380
  },
7340
7381
  emits: ["format"],
7341
7382
  setup(e, { emit: t }) {
7342
- let n = t, { t: r } = K();
7383
+ let n = t, { t: r } = q();
7343
7384
  return (t, s) => e.visible ? (S(), a("div", {
7344
7385
  key: 0,
7345
7386
  class: "format-menu",
@@ -7351,19 +7392,19 @@ var $u = ["data-testid", "onClick"], ed = { class: "composer-actions-menu__icon"
7351
7392
  o("button", {
7352
7393
  type: "button",
7353
7394
  class: "format-menu__item",
7354
- onMousedown: s[0] ||= I(() => {}, ["prevent"]),
7395
+ onMousedown: s[0] ||= L(() => {}, ["prevent"]),
7355
7396
  onClick: s[1] ||= (e) => n("format", "bold")
7356
7397
  }, [s[6] ||= o("span", { class: "format-menu__icon font-bold" }, "B", -1), o("span", null, k(j(r)("bold")), 1)], 32),
7357
7398
  o("button", {
7358
7399
  type: "button",
7359
7400
  class: "format-menu__item",
7360
- onMousedown: s[2] ||= I(() => {}, ["prevent"]),
7401
+ onMousedown: s[2] ||= L(() => {}, ["prevent"]),
7361
7402
  onClick: s[3] ||= (e) => n("format", "italic")
7362
7403
  }, [s[7] ||= o("span", { class: "format-menu__icon italic" }, "I", -1), o("span", null, k(j(r)("italic")), 1)], 32),
7363
7404
  o("button", {
7364
7405
  type: "button",
7365
7406
  class: "format-menu__item",
7366
- onMousedown: s[4] ||= I(() => {}, ["prevent"]),
7407
+ onMousedown: s[4] ||= L(() => {}, ["prevent"]),
7367
7408
  onClick: s[5] ||= (e) => n("format", "underline")
7368
7409
  }, [s[8] ||= o("span", { class: "format-menu__icon underline" }, "U", -1), o("span", null, k(j(r)("underline")), 1)], 32)
7369
7410
  ], 4)) : i("", !0);
@@ -7376,7 +7417,7 @@ var $u = ["data-testid", "onClick"], ed = { class: "composer-actions-menu__icon"
7376
7417
  },
7377
7418
  emits: ["update:visible", "send"],
7378
7419
  setup(t, { expose: i, emit: s }) {
7379
- let c = t, u = s, { t: d } = K(), f = w(""), p = w(["", ""]), m = n(() => {
7420
+ let c = t, u = s, { t: d } = q(), f = w(""), p = w(["", ""]), m = n(() => {
7380
7421
  let e = f.value.trim(), t = p.value.map((e) => e.trim()).filter(Boolean);
7381
7422
  return !!e && t.length >= 2;
7382
7423
  });
@@ -7398,7 +7439,7 @@ var $u = ["data-testid", "onClick"], ed = { class: "composer-actions-menu__icon"
7398
7439
  function y() {
7399
7440
  u("update:visible", !1), _();
7400
7441
  }
7401
- return i({ reset: _ }), (n, i) => (S(), r(j(re), {
7442
+ return i({ reset: _ }), (n, i) => (S(), r(j(ne), {
7402
7443
  visible: t.visible,
7403
7444
  modal: "",
7404
7445
  header: j(d)("createPollTitle"),
@@ -7406,11 +7447,11 @@ var $u = ["data-testid", "onClick"], ed = { class: "composer-actions-menu__icon"
7406
7447
  draggable: !1,
7407
7448
  "onUpdate:visible": y
7408
7449
  }, {
7409
- footer: F(() => [l(j(R), {
7450
+ footer: I(() => [l(j(z), {
7410
7451
  label: j(d)("cancel"),
7411
7452
  severity: "secondary",
7412
7453
  onClick: y
7413
- }, null, 8, ["label"]), l(j(R), {
7454
+ }, null, 8, ["label"]), l(j(z), {
7414
7455
  label: j(d)("sendPoll"),
7415
7456
  icon: j(Vu),
7416
7457
  disabled: c.disabled || !m.value,
@@ -7420,7 +7461,7 @@ var $u = ["data-testid", "onClick"], ed = { class: "composer-actions-menu__icon"
7420
7461
  "icon",
7421
7462
  "disabled"
7422
7463
  ])]),
7423
- default: F(() => [o("div", ud, [o("div", dd, [o("label", fd, k(j(d)("question")), 1), l(j(ae), {
7464
+ default: I(() => [o("div", ud, [o("div", dd, [o("label", fd, k(j(d)("question")), 1), l(j(ie), {
7424
7465
  modelValue: f.value,
7425
7466
  "onUpdate:modelValue": i[0] ||= (e) => f.value = e,
7426
7467
  fluid: "",
@@ -7430,7 +7471,7 @@ var $u = ["data-testid", "onClick"], ed = { class: "composer-actions-menu__icon"
7430
7471
  (S(!0), a(e, null, T(p.value, (e, t) => (S(), a("div", {
7431
7472
  key: t,
7432
7473
  class: "center"
7433
- }, [l(j(ae), {
7474
+ }, [l(j(ie), {
7434
7475
  "model-value": e,
7435
7476
  class: "poll-dialog-input w-full",
7436
7477
  placeholder: j(d)("option", { index: t + 1 }),
@@ -7439,7 +7480,7 @@ var $u = ["data-testid", "onClick"], ed = { class: "composer-actions-menu__icon"
7439
7480
  "model-value",
7440
7481
  "placeholder",
7441
7482
  "onUpdate:modelValue"
7442
- ]), l(j(R), {
7483
+ ]), l(j(z), {
7443
7484
  icon: j(yu),
7444
7485
  text: "",
7445
7486
  rounded: "",
@@ -7451,7 +7492,7 @@ var $u = ["data-testid", "onClick"], ed = { class: "composer-actions-menu__icon"
7451
7492
  "disabled",
7452
7493
  "onClick"
7453
7494
  ])]))), 128)),
7454
- l(j(R), {
7495
+ l(j(z), {
7455
7496
  label: j(d)("addOption"),
7456
7497
  icon: j(mu),
7457
7498
  text: "",
@@ -7471,7 +7512,7 @@ var $u = ["data-testid", "onClick"], ed = { class: "composer-actions-menu__icon"
7471
7512
  },
7472
7513
  emits: ["update:visible", "schedule"],
7473
7514
  setup(e, { expose: t, emit: i }) {
7474
- let a = e, s = i, { t: c } = K(), u = w(p()), d = w(m());
7515
+ let a = e, s = i, { t: c } = q(), u = w(p()), d = w(m());
7475
7516
  function f() {
7476
7517
  return new Date(Date.now() + 3600 * 1e3);
7477
7518
  }
@@ -7497,7 +7538,7 @@ var $u = ["data-testid", "onClick"], ed = { class: "composer-actions-menu__icon"
7497
7538
  function b() {
7498
7539
  s("update:visible", !1), v();
7499
7540
  }
7500
- return t({ reset: v }), (t, n) => (S(), r(j(re), {
7541
+ return t({ reset: v }), (t, n) => (S(), r(j(ne), {
7501
7542
  visible: e.visible,
7502
7543
  modal: "",
7503
7544
  header: j(c)("scheduleMessage"),
@@ -7505,11 +7546,11 @@ var $u = ["data-testid", "onClick"], ed = { class: "composer-actions-menu__icon"
7505
7546
  draggable: !1,
7506
7547
  "onUpdate:visible": b
7507
7548
  }, {
7508
- footer: F(() => [l(j(R), {
7549
+ footer: I(() => [l(j(z), {
7509
7550
  label: j(c)("cancel"),
7510
7551
  severity: "secondary",
7511
7552
  onClick: b
7512
- }, null, 8, ["label"]), l(j(R), {
7553
+ }, null, 8, ["label"]), l(j(z), {
7513
7554
  label: j(c)("schedule"),
7514
7555
  icon: j(_u),
7515
7556
  disabled: a.disabled || !g.value,
@@ -7519,12 +7560,12 @@ var $u = ["data-testid", "onClick"], ed = { class: "composer-actions-menu__icon"
7519
7560
  "icon",
7520
7561
  "disabled"
7521
7562
  ])]),
7522
- default: F(() => [o("div", gd, [o("div", _d, [o("label", vd, k(j(c)("sendAt")), 1), o("div", yd, [l(j(ie), {
7563
+ default: I(() => [o("div", gd, [o("div", _d, [o("label", vd, k(j(c)("sendAt")), 1), o("div", yd, [l(j(re), {
7523
7564
  modelValue: u.value,
7524
7565
  "onUpdate:modelValue": n[0] ||= (e) => u.value = e,
7525
7566
  class: "w-full flex-1",
7526
7567
  type: "date"
7527
- }, null, 8, ["modelValue"]), l(j(ie), {
7568
+ }, null, 8, ["modelValue"]), l(j(re), {
7528
7569
  modelValue: d.value,
7529
7570
  "onUpdate:modelValue": n[1] ||= (e) => d.value = e,
7530
7571
  type: "time",
@@ -7560,7 +7601,7 @@ var $u = ["data-testid", "onClick"], ed = { class: "composer-actions-menu__icon"
7560
7601
  }),
7561
7602
  emits: /* @__PURE__ */ m(["select"], ["update:highlightedIndex"]),
7562
7603
  setup(t, { emit: n }) {
7563
- let s = ee(t, "highlightedIndex"), c = n;
7604
+ let s = M(t, "highlightedIndex"), c = n;
7564
7605
  return (n, l) => t.visible && t.candidates.length ? (S(), a("div", {
7565
7606
  key: 0,
7566
7607
  class: g(["trigger-menu", t.position.placement === "below" ? "trigger-menu--below" : "trigger-menu--above"]),
@@ -7569,7 +7610,7 @@ var $u = ["data-testid", "onClick"], ed = { class: "composer-actions-menu__icon"
7569
7610
  top: `${t.position.y}px`
7570
7611
  }),
7571
7612
  role: "listbox",
7572
- onMousedown: l[0] ||= I(() => {}, ["stop"])
7613
+ onMousedown: l[0] ||= L(() => {}, ["stop"])
7573
7614
  }, [(S(!0), a(e, null, T(t.candidates, (e, t) => (S(), a("button", {
7574
7615
  key: e.id,
7575
7616
  type: "button",
@@ -7577,8 +7618,8 @@ var $u = ["data-testid", "onClick"], ed = { class: "composer-actions-menu__icon"
7577
7618
  role: "option",
7578
7619
  "aria-selected": t === s.value,
7579
7620
  onMouseover: (e) => s.value = t,
7580
- onMousedown: I((t) => c("select", e), ["stop", "prevent"])
7581
- }, [e.avatar ? (S(), r(j(L), {
7621
+ onMousedown: L((t) => c("select", e), ["stop", "prevent"])
7622
+ }, [e.avatar ? (S(), r(j(R), {
7582
7623
  key: 0,
7583
7624
  src: e.avatar,
7584
7625
  name: e.label,
@@ -7636,53 +7677,53 @@ var $u = ["data-testid", "onClick"], ed = { class: "composer-actions-menu__icon"
7636
7677
  video: "video/*",
7637
7678
  audio: "audio/*",
7638
7679
  file: "*/*"
7639
- }, u = e, d = s, f = w(null), m = w(null), _ = w(null), v = w("file"), y = w(!1), b = w(!1), x = w(!1), { t: C } = K(), T = null, E = w(null), O = w(null), A = w(null), { applyFormat: ee, editorKey: te, formatMenuPosition: M, focusEditor: N, handleContextMenu: ne, handleInput: L, handleKeydown: re, handlePaste: z, hideFormatMenu: ie, resetEditor: ae, showFormatMenu: B, triggerCandidates: oe, triggerMenuPosition: V, highlightedTriggerIndex: H, showTriggerMenu: ce, selectTriggerCandidate: le } = Qu(E, O, A, {
7680
+ }, u = e, d = s, f = w(null), m = w(null), _ = w(null), v = w("file"), y = w(!1), b = w(!1), x = w(!1), { t: C } = q(), T = null, E = w(null), O = w(null), A = w(null), { applyFormat: M, editorKey: ee, formatMenuPosition: N, focusEditor: P, handleContextMenu: te, handleInput: R, handleKeydown: ne, handlePaste: B, hideFormatMenu: re, resetEditor: ie, showFormatMenu: V, triggerCandidates: ae, triggerMenuPosition: H, highlightedTriggerIndex: U, showTriggerMenu: se, selectTriggerCandidate: ce } = Qu(E, O, A, {
7640
7681
  getModelValue: () => u.modelValue,
7641
7682
  updateModelValue: (e) => d("update:modelValue", e),
7642
- submit: () => Se(),
7683
+ submit: () => xe(),
7643
7684
  getMentionCandidates: () => u.mentionCandidates ?? [],
7644
7685
  getMentionNameByUid: () => u.mentionNameByUid ?? {},
7645
7686
  mentionsEnabled: () => u.mentionsEnabled ?? (u.mentionCandidates?.length ?? 0) > 0
7646
- }), ue = n(() => c[v.value]), de = n(() => {
7687
+ }), le = n(() => c[v.value]), ue = n(() => {
7647
7688
  if (!_.value) return null;
7648
7689
  let e = _.value.type;
7649
7690
  return e.startsWith("image/") ? "image" : e.startsWith("video/") ? "video" : e.startsWith("audio/") ? "audio" : "file";
7650
- }), fe = n(() => {
7651
- switch (de.value) {
7691
+ }), de = n(() => {
7692
+ switch (ue.value) {
7652
7693
  case "image": return C("image");
7653
7694
  case "video": return C("video");
7654
7695
  case "audio": return C("audio");
7655
7696
  case "file": return C("file");
7656
7697
  default: return C("attachment");
7657
7698
  }
7658
- }), U = n(() => !u.editingMessage && !u.replyToMessage ? "" : u.compact ? "pt-1" : "pt-1.5"), pe = n(() => ls(u.modelValue) || !!_.value), me = n(() => pe.value && de.value !== "file"), he = n(() => _.value ? C("attachmentSummary", { name: _.value.name }) : us(u.modelValue) || C("currentDraftWillBeScheduled"));
7659
- P(() => u.resetSignal, () => {
7660
- ae(), _.value = null, y.value = !1, b.value = !1, f.value && (f.value.value = "");
7699
+ }), W = n(() => !u.editingMessage && !u.replyToMessage ? "" : u.compact ? "pt-1" : "pt-1.5"), fe = n(() => ls(u.modelValue) || !!_.value), pe = n(() => fe.value && ue.value !== "file"), me = n(() => _.value ? C("attachmentSummary", { name: _.value.name }) : us(u.modelValue) || C("currentDraftWillBeScheduled"));
7700
+ F(() => u.resetSignal, () => {
7701
+ ie(), _.value = null, y.value = !1, b.value = !1, f.value && (f.value.value = "");
7661
7702
  });
7662
- async function ge() {
7663
- await h(), N();
7703
+ async function he() {
7704
+ await h(), P();
7664
7705
  }
7665
- function _e() {
7706
+ function ge() {
7666
7707
  m.value?.hide();
7667
7708
  }
7668
7709
  t({
7669
- focusEditor: ge,
7670
- hideComposerActions: _e
7710
+ focusEditor: he,
7711
+ hideComposerActions: ge
7671
7712
  });
7672
- async function ve(e = "file") {
7713
+ async function _e(e = "file") {
7673
7714
  v.value = e, await h(), f.value?.click();
7674
7715
  }
7675
- function ye(e) {
7676
- _.value = e.target.files?.[0] ?? null, _e();
7716
+ function ve(e) {
7717
+ _.value = e.target.files?.[0] ?? null, ge();
7677
7718
  }
7678
- function be() {
7719
+ function ye() {
7679
7720
  _.value = null, f.value && (f.value.value = "");
7680
7721
  }
7681
- function xe(e) {
7722
+ function be(e) {
7682
7723
  m.value?.toggle(e);
7683
7724
  }
7684
- function Se() {
7685
- if (!(u.disabled || !pe.value)) {
7725
+ function xe() {
7726
+ if (!(u.disabled || !fe.value)) {
7686
7727
  if (_.value) {
7687
7728
  d("sendAttachment", {
7688
7729
  file: _.value,
@@ -7693,10 +7734,10 @@ var $u = ["data-testid", "onClick"], ed = { class: "composer-actions-menu__icon"
7693
7734
  d("sendText");
7694
7735
  }
7695
7736
  }
7696
- function Ce(e) {
7737
+ function Se(e) {
7697
7738
  d("sendPoll", e);
7698
7739
  }
7699
- function we(e) {
7740
+ function Ce(e) {
7700
7741
  d("scheduleMessage", {
7701
7742
  ...e,
7702
7743
  text: _.value ? void 0 : cs(u.modelValue),
@@ -7704,39 +7745,39 @@ var $u = ["data-testid", "onClick"], ed = { class: "composer-actions-menu__icon"
7704
7745
  caption: _.value ? cs(u.modelValue) : void 0
7705
7746
  });
7706
7747
  }
7707
- function Te() {
7748
+ function we() {
7708
7749
  d("openScheduled");
7709
7750
  }
7710
- function Ee() {
7751
+ function Te() {
7711
7752
  T !== null && (clearTimeout(T), T = null);
7712
7753
  }
7713
- function De(e) {
7714
- u.disabled || !me.value || e instanceof MouseEvent && e.button !== 0 || (x.value = !1, Ee(), T = setTimeout(() => {
7754
+ function Ee(e) {
7755
+ u.disabled || !pe.value || e instanceof MouseEvent && e.button !== 0 || (x.value = !1, Te(), T = setTimeout(() => {
7715
7756
  T = null, x.value = !0, b.value = !0;
7716
7757
  }, zd));
7717
7758
  }
7718
- function Oe() {
7719
- Ee();
7759
+ function De() {
7760
+ Te();
7720
7761
  }
7721
- function ke() {
7722
- if (!(u.disabled || !pe.value)) {
7762
+ function Oe() {
7763
+ if (!(u.disabled || !fe.value)) {
7723
7764
  if (x.value) {
7724
7765
  x.value = !1;
7725
7766
  return;
7726
7767
  }
7727
- Se();
7768
+ xe();
7728
7769
  }
7729
7770
  }
7730
- return (t, n) => (S(), a("div", { class: g([u.compact ? "space-y-1 px-1 pb-1.5" : "space-y-1.5 px-1 pb-1.5", U.value]) }, [
7771
+ return (t, n) => (S(), a("div", { class: g([u.compact ? "space-y-1 px-1 pb-1.5" : "space-y-1.5 px-1 pb-1.5", W.value]) }, [
7731
7772
  o("input", {
7732
7773
  ref_key: "fileInputRef",
7733
7774
  ref: f,
7734
7775
  type: "file",
7735
7776
  class: "hidden",
7736
- accept: ue.value,
7777
+ accept: le.value,
7737
7778
  disabled: e.disabled,
7738
- onChange: ye,
7739
- onCancel: _e
7779
+ onChange: ve,
7780
+ onCancel: ge
7740
7781
  }, null, 40, Od),
7741
7782
  e.editingMessage ? (S(), r(cd, {
7742
7783
  key: 0,
@@ -7753,12 +7794,12 @@ var $u = ["data-testid", "onClick"], ed = { class: "composer-actions-menu__icon"
7753
7794
  "data-testid": "composer-reply-context",
7754
7795
  onCancel: n[1] ||= (e) => d("cancelReply")
7755
7796
  }, null, 8, ["message", "context-label"])) : i("", !0),
7756
- _.value ? (S(), a("div", kd, [o("div", Ad, [o("p", jd, k(_.value.name), 1), o("p", Md, k(_.value.type || fe.value), 1)]), l(j(R), {
7797
+ _.value ? (S(), a("div", kd, [o("div", Ad, [o("p", jd, k(_.value.name), 1), o("p", Md, k(_.value.type || de.value), 1)]), l(j(z), {
7757
7798
  icon: j(yu),
7758
7799
  text: "",
7759
7800
  rounded: "",
7760
7801
  severity: "secondary",
7761
- onClick: be
7802
+ onClick: ye
7762
7803
  }, null, 8, ["icon"])])) : i("", !0),
7763
7804
  o("div", {
7764
7805
  ref_key: "composerShellRef",
@@ -7768,10 +7809,10 @@ var $u = ["data-testid", "onClick"], ed = { class: "composer-actions-menu__icon"
7768
7809
  l(rd, {
7769
7810
  ref_key: "composerActionsRef",
7770
7811
  ref: m,
7771
- onPickFile: ve,
7812
+ onPickFile: _e,
7772
7813
  onOpenPoll: n[2] ||= (e) => y.value = !0
7773
7814
  }, null, 512),
7774
- l(j(R), {
7815
+ l(j(z), {
7775
7816
  text: "",
7776
7817
  rounded: "",
7777
7818
  severity: "secondary",
@@ -7779,9 +7820,9 @@ var $u = ["data-testid", "onClick"], ed = { class: "composer-actions-menu__icon"
7779
7820
  disabled: e.disabled || !!e.editingMessage,
7780
7821
  "aria-label": j(C)("addToMessage"),
7781
7822
  "data-testid": "composer-actions-button",
7782
- onClick: xe
7823
+ onClick: be
7783
7824
  }, {
7784
- default: F(() => [o("span", Nd, [(S(), r(D(j(mu)), { class: "size-7" }))])]),
7825
+ default: I(() => [o("span", Nd, [(S(), r(D(j(mu)), { class: "size-7" }))])]),
7785
7826
  _: 1
7786
7827
  }, 8, [
7787
7828
  "class",
@@ -7789,7 +7830,7 @@ var $u = ["data-testid", "onClick"], ed = { class: "composer-actions-menu__icon"
7789
7830
  "aria-label"
7790
7831
  ]),
7791
7832
  (S(), a("div", {
7792
- key: j(te),
7833
+ key: j(ee),
7793
7834
  ref_key: "composerEditorRef",
7794
7835
  ref: O,
7795
7836
  contenteditable: "true",
@@ -7797,15 +7838,15 @@ var $u = ["data-testid", "onClick"], ed = { class: "composer-actions-menu__icon"
7797
7838
  "aria-multiline": "true",
7798
7839
  "data-placeholder": j(C)("writeMessage"),
7799
7840
  class: g(["composer-editor", e.disabled ? "pointer-events-none opacity-60" : ""]),
7800
- onFocus: n[3] ||= (...e) => j(ie) && j(ie)(...e),
7801
- onInput: n[4] ||= (...e) => j(L) && j(L)(...e),
7802
- onKeyup: n[5] ||= (...e) => j(L) && j(L)(...e),
7803
- onKeydown: n[6] ||= (...e) => j(re) && j(re)(...e),
7804
- onPaste: n[7] ||= (...e) => j(z) && j(z)(...e),
7805
- onContextmenu: n[8] ||= (...e) => j(ne) && j(ne)(...e)
7841
+ onFocus: n[3] ||= (...e) => j(re) && j(re)(...e),
7842
+ onInput: n[4] ||= (...e) => j(R) && j(R)(...e),
7843
+ onKeyup: n[5] ||= (...e) => j(R) && j(R)(...e),
7844
+ onKeydown: n[6] ||= (...e) => j(ne) && j(ne)(...e),
7845
+ onPaste: n[7] ||= (...e) => j(B) && j(B)(...e),
7846
+ onContextmenu: n[8] ||= (...e) => j(te) && j(te)(...e)
7806
7847
  }, null, 42, Pd)),
7807
7848
  _.value || e.editingMessage || e.contextLabel || e.offlineMode ? (S(), a("div", Fd, [
7808
- e.editingMessage ? (S(), r(j(se), {
7849
+ e.editingMessage ? (S(), r(j(oe), {
7809
7850
  key: 0,
7810
7851
  text: j(C)("editing"),
7811
7852
  context: "info",
@@ -7813,7 +7854,7 @@ var $u = ["data-testid", "onClick"], ed = { class: "composer-actions-menu__icon"
7813
7854
  size: "sm",
7814
7855
  class: "composer-meta-tag"
7815
7856
  }, null, 8, ["text"])) : i("", !0),
7816
- e.contextLabel ? (S(), r(j(se), {
7857
+ e.contextLabel ? (S(), r(j(oe), {
7817
7858
  key: 1,
7818
7859
  text: e.contextLabel,
7819
7860
  context: "contrast",
@@ -7823,39 +7864,39 @@ var $u = ["data-testid", "onClick"], ed = { class: "composer-actions-menu__icon"
7823
7864
  }, null, 8, ["text"])) : i("", !0),
7824
7865
  e.offlineMode ? (S(), a("p", Id, k(e.pendingQueueCount ? j(C)("offlineQueued", { count: e.pendingQueueCount }) : j(C)("offline")), 1)) : i("", !0)
7825
7866
  ])) : i("", !0),
7826
- e.showScheduledButton ? (S(), r(j(R), {
7867
+ e.showScheduledButton ? (S(), r(j(z), {
7827
7868
  key: 1,
7828
7869
  rounded: "",
7829
7870
  outlined: "",
7830
7871
  class: g(["composer-schedule-button shrink-0 self-end", u.compact ? "h-9 w-9" : "h-10 w-10 max-md:h-9 max-md:w-9"]),
7831
7872
  disabled: e.disabled,
7832
7873
  "aria-label": j(C)("scheduledMessages"),
7833
- onClick: Te
7874
+ onClick: we
7834
7875
  }, {
7835
- default: F(() => [o("span", Ld, [(S(), r(D(j(Eu)), { class: "size-7" }))])]),
7876
+ default: I(() => [o("span", Ld, [(S(), r(D(j(Eu)), { class: "size-7" }))])]),
7836
7877
  _: 1
7837
7878
  }, 8, [
7838
7879
  "class",
7839
7880
  "disabled",
7840
7881
  "aria-label"
7841
7882
  ])) : i("", !0),
7842
- l(j(R), {
7883
+ l(j(z), {
7843
7884
  rounded: "",
7844
7885
  severity: "primary",
7845
7886
  text: "",
7846
7887
  class: g(["composer-send-button shrink-0 self-end", u.compact ? "h-9 w-9" : "h-10 w-10 max-md:h-9 max-md:w-9"]),
7847
- disabled: e.disabled || !pe.value,
7888
+ disabled: e.disabled || !fe.value,
7848
7889
  "aria-label": e.editingMessage ? j(C)("saveMessage") : _.value ? j(C)("sendAttachment") : j(C)("sendMessage"),
7849
- onMousedown: De,
7850
- onMouseup: Oe,
7851
- onMouseleave: Oe,
7852
- onTouchstart: De,
7853
- onTouchend: Oe,
7854
- onTouchcancel: Oe,
7855
- onContextmenu: n[9] ||= I(() => {}, ["prevent"]),
7856
- onClick: ke
7890
+ onMousedown: Ee,
7891
+ onMouseup: De,
7892
+ onMouseleave: De,
7893
+ onTouchstart: Ee,
7894
+ onTouchend: De,
7895
+ onTouchcancel: De,
7896
+ onContextmenu: n[9] ||= L(() => {}, ["prevent"]),
7897
+ onClick: Oe
7857
7898
  }, {
7858
- default: F(() => [o("span", Rd, [e.editingMessage ? (S(), r(D(j(vu)), {
7899
+ default: I(() => [o("span", Rd, [e.editingMessage ? (S(), r(D(j(vu)), {
7859
7900
  key: 0,
7860
7901
  class: "size-7"
7861
7902
  })) : (S(), r(D(j(Vu)), {
@@ -7870,19 +7911,19 @@ var $u = ["data-testid", "onClick"], ed = { class: "composer-actions-menu__icon"
7870
7911
  ])
7871
7912
  ], 2),
7872
7913
  l(ld, {
7873
- visible: j(B),
7874
- position: j(M),
7875
- onFormat: n[10] ||= (e) => j(ee)(e)
7914
+ visible: j(V),
7915
+ position: j(N),
7916
+ onFormat: n[10] ||= (e) => j(M)(e)
7876
7917
  }, null, 8, ["visible", "position"]),
7877
7918
  l(Dd, {
7878
7919
  ref_key: "triggerMenuRef",
7879
7920
  ref: A,
7880
- "highlighted-index": j(H),
7881
- "onUpdate:highlightedIndex": n[11] ||= (e) => p(H) ? H.value = e : null,
7882
- visible: j(ce),
7883
- position: j(V),
7884
- candidates: j(oe),
7885
- onSelect: n[12] ||= (e) => j(le)(e)
7921
+ "highlighted-index": j(U),
7922
+ "onUpdate:highlightedIndex": n[11] ||= (e) => p(U) ? U.value = e : null,
7923
+ visible: j(se),
7924
+ position: j(H),
7925
+ candidates: j(ae),
7926
+ onSelect: n[12] ||= (e) => j(ce)(e)
7886
7927
  }, null, 8, [
7887
7928
  "highlighted-index",
7888
7929
  "visible",
@@ -7893,15 +7934,15 @@ var $u = ["data-testid", "onClick"], ed = { class: "composer-actions-menu__icon"
7893
7934
  visible: y.value,
7894
7935
  "onUpdate:visible": n[13] ||= (e) => y.value = e,
7895
7936
  disabled: e.disabled,
7896
- onSend: Ce
7937
+ onSend: Se
7897
7938
  }, null, 8, ["visible", "disabled"]),
7898
7939
  l(xd, {
7899
7940
  visible: b.value,
7900
7941
  "onUpdate:visible": n[14] ||= (e) => b.value = e,
7901
7942
  disabled: e.disabled,
7902
- "can-schedule": me.value,
7903
- "content-preview": he.value,
7904
- onSchedule: we
7943
+ "can-schedule": pe.value,
7944
+ "content-preview": me.value,
7945
+ onSchedule: Ce
7905
7946
  }, null, 8, [
7906
7947
  "visible",
7907
7948
  "disabled",
@@ -7910,14 +7951,14 @@ var $u = ["data-testid", "onClick"], ed = { class: "composer-actions-menu__icon"
7910
7951
  ])
7911
7952
  ], 2));
7912
7953
  }
7913
- }), [["__scopeId", "data-v-59037084"]]), Vd = {
7954
+ }), [["__scopeId", "data-v-068e9241"]]), Vd = {
7914
7955
  key: 1,
7915
7956
  class: "composer-readonly-notice"
7916
7957
  }, Hd = /* @__PURE__ */ $(/* @__PURE__ */ u({
7917
7958
  __name: "ConversationComposer",
7918
7959
  props: { target: {} },
7919
7960
  setup(e, { expose: t }) {
7920
- let o = e, { t: s } = K(), c = Gl(), l = Yl(), u = eu(), d = au(), f = uu(), p = n(() => o.target === "thread"), m = n({
7961
+ let o = e, { t: s } = q(), c = Gl(), l = Yl(), u = eu(), d = au(), f = uu(), p = n(() => o.target === "thread"), m = n({
7921
7962
  get: () => p.value ? u.threadDraft.value : u.draft.value,
7922
7963
  set: (e) => {
7923
7964
  p.value ? u.threadDraft.value = e : u.draft.value = e;
@@ -7956,17 +7997,17 @@ var $u = ["data-testid", "onClick"], ed = { class: "composer-actions-menu__icon"
7956
7997
  function A() {
7957
7998
  f.emit("composer:cancelEdit");
7958
7999
  }
7959
- let ee = w(null);
8000
+ let M = w(null);
7960
8001
  du(f, "ui:closeComposerActions", () => {
7961
- ee.value?.hideComposerActions();
8002
+ M.value?.hideComposerActions();
7962
8003
  });
7963
- async function te() {
7964
- await ee.value?.focusEditor();
8004
+ async function ee() {
8005
+ await M.value?.focusEditor();
7965
8006
  }
7966
- return t({ focusEditor: te }), (e, t) => y.value ? (S(), r(Bd, {
8007
+ return t({ focusEditor: ee }), (e, t) => y.value ? (S(), r(Bd, {
7967
8008
  key: 0,
7968
8009
  ref_key: "composerRef",
7969
- ref: ee,
8010
+ ref: M,
7970
8011
  "model-value": m.value,
7971
8012
  disabled: v.value,
7972
8013
  "reset-signal": h.value,
@@ -8251,7 +8292,7 @@ function Xd(e) {
8251
8292
  let s = o < r, c = Math.max(0, a.scrollHeight - o - a.clientHeight);
8252
8293
  s && c > Gd ? n = !1 : c <= Kd && (n = !0), r = o, a.scrollTop <= qd && !e.isLoading() && !e.isLoadingOlder() && e.canLoadOlder() && e.onLoadOlder();
8253
8294
  }
8254
- return P(() => {
8295
+ return F(() => {
8255
8296
  let t = e.getMessages();
8256
8297
  return {
8257
8298
  conversationId: e.getConversation()?.id ?? null,
@@ -8392,7 +8433,7 @@ var ef = { class: "w-full" }, tf = {
8392
8433
  function s() {
8393
8434
  n("close");
8394
8435
  }
8395
- return (t, n) => (S(), r(j(re), {
8436
+ return (t, n) => (S(), r(j(ne), {
8396
8437
  class: "w-5/6 max-w-lg",
8397
8438
  visible: e.open,
8398
8439
  modal: "",
@@ -8402,7 +8443,7 @@ var ef = { class: "w-full" }, tf = {
8402
8443
  closable: !0,
8403
8444
  "onUpdate:visible": s
8404
8445
  }, {
8405
- default: F(() => [o("div", ef, [E(t.$slots, "default")]), t.$slots.footer ? (S(), a("div", tf, [E(t.$slots, "footer")])) : i("", !0)]),
8446
+ default: I(() => [o("div", ef, [E(t.$slots, "default")]), t.$slots.footer ? (S(), a("div", tf, [E(t.$slots, "footer")])) : i("", !0)]),
8406
8447
  _: 3
8407
8448
  }, 8, ["visible", "header"]));
8408
8449
  }
@@ -8429,15 +8470,15 @@ var ef = { class: "w-full" }, tf = {
8429
8470
  props: { attachment: {} },
8430
8471
  emits: ["close"],
8431
8472
  setup(t, { emit: s }) {
8432
- let c = t, l = s, u = w(null), d = w(null), f = n(() => !!c.attachment?.url), p = n(() => c.attachment?.kind === "image"), m = n(() => c.attachment?.kind === "video"), h = n(() => c.attachment?.kind === "audio"), { t: _ } = K(), { scale: y, translateX: b, translateY: x, isDragging: C, resetTransform: T, handlePointerDown: E, handlePointerMove: O, handlePointerUp: A, handlePointerCancel: ee, handleWheel: te, handleDoubleClick: M } = $d({
8473
+ let c = t, l = s, u = w(null), d = w(null), f = n(() => !!c.attachment?.url), p = n(() => c.attachment?.kind === "image"), m = n(() => c.attachment?.kind === "video"), h = n(() => c.attachment?.kind === "audio"), { t: _ } = q(), { scale: y, translateX: b, translateY: x, isDragging: C, resetTransform: T, handlePointerDown: E, handlePointerMove: O, handlePointerUp: A, handlePointerCancel: M, handleWheel: ee, handleDoubleClick: N } = $d({
8433
8474
  viewportRef: u,
8434
8475
  imageRef: d,
8435
8476
  isImage: () => p.value
8436
8477
  });
8437
- P(() => c.attachment?.url, () => {
8478
+ F(() => c.attachment?.url, () => {
8438
8479
  T();
8439
8480
  });
8440
- function N() {
8481
+ function P() {
8441
8482
  l("close");
8442
8483
  }
8443
8484
  return (n, s) => (S(), r(nf, {
@@ -8446,9 +8487,9 @@ var ef = { class: "w-full" }, tf = {
8446
8487
  subtitle: t.attachment?.kind || "",
8447
8488
  "close-label": j(_)("close"),
8448
8489
  "close-aria-label": j(_)("closeMediaViewer"),
8449
- onClose: N
8490
+ onClose: P
8450
8491
  }, {
8451
- actions: F(() => [t.attachment?.url ? (S(), a("a", {
8492
+ actions: I(() => [t.attachment?.url ? (S(), a("a", {
8452
8493
  key: 0,
8453
8494
  href: t.attachment.url,
8454
8495
  target: "_blank",
@@ -8458,8 +8499,8 @@ var ef = { class: "w-full" }, tf = {
8458
8499
  class: "size-4",
8459
8500
  "aria-hidden": "true"
8460
8501
  })), o("span", null, k(j(_)("openInNewTab")), 1)], 8, rf)) : i("", !0)]),
8461
- footer: F(() => [t.attachment ? (S(), a("div", pf, [o("div", mf, [o("p", hf, k(t.attachment.name), 1), o("p", gf, k(t.attachment.kind), 1)])])) : i("", !0)]),
8462
- default: F(() => [o("div", af, [t.attachment?.url ? (S(), a(e, { key: 0 }, [p.value ? (S(), a("div", {
8502
+ footer: I(() => [t.attachment ? (S(), a("div", pf, [o("div", mf, [o("p", hf, k(t.attachment.name), 1), o("p", gf, k(t.attachment.kind), 1)])])) : i("", !0)]),
8503
+ default: I(() => [o("div", af, [t.attachment?.url ? (S(), a(e, { key: 0 }, [p.value ? (S(), a("div", {
8463
8504
  key: 0,
8464
8505
  ref_key: "viewportRef",
8465
8506
  ref: u,
@@ -8467,10 +8508,10 @@ var ef = { class: "w-full" }, tf = {
8467
8508
  onPointerdown: s[0] ||= (...e) => j(E) && j(E)(...e),
8468
8509
  onPointermove: s[1] ||= (...e) => j(O) && j(O)(...e),
8469
8510
  onPointerup: s[2] ||= (...e) => j(A) && j(A)(...e),
8470
- onPointercancel: s[3] ||= (...e) => j(ee) && j(ee)(...e),
8511
+ onPointercancel: s[3] ||= (...e) => j(M) && j(M)(...e),
8471
8512
  onPointerleave: s[4] ||= (...e) => j(A) && j(A)(...e),
8472
- onWheel: s[5] ||= (...e) => j(te) && j(te)(...e),
8473
- onDblclick: s[6] ||= (...e) => j(M) && j(M)(...e)
8513
+ onWheel: s[5] ||= (...e) => j(ee) && j(ee)(...e),
8514
+ onDblclick: s[6] ||= (...e) => j(N) && j(N)(...e)
8474
8515
  }, [o("img", {
8475
8516
  ref_key: "imageRef",
8476
8517
  ref: d,
@@ -8502,7 +8543,7 @@ var ef = { class: "w-full" }, tf = {
8502
8543
  __name: "MessageDateSeparator",
8503
8544
  props: { date: {} },
8504
8545
  setup(e) {
8505
- let t = e, { locale: r, t: i } = K(), s = n(() => {
8546
+ let t = e, { locale: r, t: i } = q(), s = n(() => {
8506
8547
  let e = /* @__PURE__ */ new Date(), n = t.date, a = new Date(e.getFullYear(), e.getMonth(), e.getDate()), o = new Date(a);
8507
8548
  o.setDate(o.getDate() - 1);
8508
8549
  let s = new Date(a);
@@ -8536,7 +8577,7 @@ var ef = { class: "w-full" }, tf = {
8536
8577
  isOwn: { type: Boolean }
8537
8578
  },
8538
8579
  setup(e) {
8539
- let t = e, r = w(null), s = w(!1), { t: c } = K(), l = n(() => {
8580
+ let t = e, r = w(null), s = w(!1), { t: c } = q(), l = n(() => {
8540
8581
  try {
8541
8582
  return new URL(t.url).hostname.replace(/^www\./, "");
8542
8583
  } catch {
@@ -8550,7 +8591,7 @@ var ef = { class: "w-full" }, tf = {
8550
8591
  return t.url;
8551
8592
  }
8552
8593
  });
8553
- P(() => t.url, async (e) => {
8594
+ F(() => t.url, async (e) => {
8554
8595
  if (r.value = null, s.value = !1, !(!e || typeof window > "u")) {
8555
8596
  if (p(e)) {
8556
8597
  r.value = {
@@ -8649,7 +8690,7 @@ var ef = { class: "w-full" }, tf = {
8649
8690
  props: { message: {} },
8650
8691
  emits: ["openMedia"],
8651
8692
  setup(t, { emit: n }) {
8652
- let s = n, { t: l } = K();
8693
+ let s = n, { t: l } = q();
8653
8694
  function u(e) {
8654
8695
  return !e || Number.isNaN(e) ? "" : e < 1024 * 1024 ? `${Math.round(e / 1024)} KB` : `${(e / (1024 * 1024)).toFixed(1)} MB`;
8655
8696
  }
@@ -8704,7 +8745,7 @@ var ef = { class: "w-full" }, tf = {
8704
8745
  function h(e) {
8705
8746
  return { aspectRatio: String(m(e)) };
8706
8747
  }
8707
- return (n, d) => (S(), a("div", If, [(S(!0), a(e, null, T(t.message.attachments, (n) => (S(), a(e, { key: `${t.message.id}-${n.name}` }, [n.kind === "image" && n.url ? (S(), r(j(z), {
8748
+ return (n, d) => (S(), a("div", If, [(S(!0), a(e, null, T(t.message.attachments, (n) => (S(), a(e, { key: `${t.message.id}-${n.name}` }, [n.kind === "image" && n.url ? (S(), r(j(B), {
8708
8749
  key: 0,
8709
8750
  preview: "",
8710
8751
  src: n.url,
@@ -8764,11 +8805,11 @@ var ef = { class: "w-full" }, tf = {
8764
8805
  __name: "MessageDeliveryStatus",
8765
8806
  props: { message: {} },
8766
8807
  setup(e) {
8767
- let t = e, { locale: s, t: c } = K();
8808
+ let t = e, { locale: s, t: c } = q();
8768
8809
  function l(e) {
8769
8810
  return new Intl.DateTimeFormat(s.value, {
8770
8811
  timeStyle: "short",
8771
- hourCycle: ze()
8812
+ hourCycle: Re()
8772
8813
  }).format(e);
8773
8814
  }
8774
8815
  let u = n(() => {
@@ -8827,7 +8868,7 @@ var ef = { class: "w-full" }, tf = {
8827
8868
  __name: "MessageItemHeader",
8828
8869
  props: { message: {} },
8829
8870
  setup(e) {
8830
- let t = e, { locale: n, t: s } = K();
8871
+ let t = e, { locale: n, t: s } = q();
8831
8872
  function c(e) {
8832
8873
  return e ? new Intl.DateTimeFormat(n.value, {
8833
8874
  month: "short",
@@ -8839,7 +8880,7 @@ var ef = { class: "w-full" }, tf = {
8839
8880
  function l() {
8840
8881
  return t.message.senderName?.trim() || (t.message.isOwn ? s("you") : s("system"));
8841
8882
  }
8842
- return (t, n) => (S(), a("div", ip, [o("span", ap, k(l()), 1), e.message.scheduled?.scheduleDate ? (S(), r(j(se), {
8883
+ return (t, n) => (S(), a("div", ip, [o("span", ap, k(l()), 1), e.message.scheduled?.scheduleDate ? (S(), r(j(oe), {
8843
8884
  key: 0,
8844
8885
  text: j(s)("scheduledDateLabel", { date: c(e.message.scheduled.scheduleDate) }),
8845
8886
  context: "warn",
@@ -8877,7 +8918,7 @@ var ef = { class: "w-full" }, tf = {
8877
8918
  },
8878
8919
  emits: ["toggleReaction", "openThread"],
8879
8920
  setup(e, { emit: t }) {
8880
- let s = e, c = t, { t: u } = K(), d = n(() => u("threadReplies", { count: s.message.replyCount })), f = n(() => s.canOpenThread !== !1 && s.message.replyCount > 0);
8921
+ let s = e, c = t, { t: u } = q(), d = n(() => u("threadReplies", { count: s.message.replyCount })), f = n(() => s.canOpenThread !== !1 && s.message.replyCount > 0);
8881
8922
  return (t, n) => (S(), a("div", lp, [l(cp, {
8882
8923
  message: e.message,
8883
8924
  disabled: e.canReact === !1,
@@ -8889,7 +8930,7 @@ var ef = { class: "w-full" }, tf = {
8889
8930
  class: "message-reactions__thread-button text-subtle hover:text-default inline-flex items-center gap-1 rounded-full px-1 py-0 font-medium transition",
8890
8931
  "aria-label": d.value,
8891
8932
  title: d.value,
8892
- onClick: n[1] ||= I((e) => c("openThread"), ["stop"])
8933
+ onClick: n[1] ||= L((e) => c("openThread"), ["stop"])
8893
8934
  }, [(S(), r(D(j(zu)), {
8894
8935
  class: "size-4",
8895
8936
  "aria-hidden": "true"
@@ -8907,7 +8948,7 @@ var ef = { class: "w-full" }, tf = {
8907
8948
  },
8908
8949
  emits: ["vote"],
8909
8950
  setup(t, { emit: n }) {
8910
- let r = t, s = n, { t: c } = K();
8951
+ let r = t, s = n, { t: c } = q();
8911
8952
  function l(e) {
8912
8953
  let t = r.currentUserId;
8913
8954
  return !t || !r.message.poll ? !1 : r.message.poll.options.some((n) => n.id === e && n.voters.includes(t));
@@ -9022,7 +9063,7 @@ var ef = { class: "w-full" }, tf = {
9022
9063
  key: 0,
9023
9064
  text: t.message.text,
9024
9065
  class: g(f.value)
9025
- }, null, 8, ["text", "class"])) : (S(), a(e, { key: 1 }, [t.canShowSenderAvatar && !t.message.isOwn ? (S(), r(j(L), {
9066
+ }, null, 8, ["text", "class"])) : (S(), a(e, { key: 1 }, [t.canShowSenderAvatar && !t.message.isOwn ? (S(), r(j(R), {
9026
9067
  key: 0,
9027
9068
  image: t.message.senderAvatar,
9028
9069
  label: t.message.senderAvatar ? void 0 : t.message.senderName.slice(0, 1).toUpperCase(),
@@ -9094,7 +9135,7 @@ var ef = { class: "w-full" }, tf = {
9094
9135
  emits: ["react"],
9095
9136
  setup(t, { emit: s }) {
9096
9137
  let c = t, l = s, u = w(!1);
9097
- P(() => c.message.id, () => {
9138
+ F(() => c.message.id, () => {
9098
9139
  u.value = !1;
9099
9140
  });
9100
9141
  let d = n(() => jp);
@@ -9193,7 +9234,7 @@ var ef = { class: "w-full" }, tf = {
9193
9234
  message: e.message,
9194
9235
  "can-react": e.canReact,
9195
9236
  onReact: o[0] ||= (e) => s("react", e)
9196
- }, null, 8, ["message", "can-react"]), l(j(B), { model: e.actionItems }, null, 8, ["model"])], 4)) : i("", !0)]));
9237
+ }, null, 8, ["message", "can-react"]), l(j(V), { model: e.actionItems }, null, 8, ["model"])], 4)) : i("", !0)]));
9197
9238
  }
9198
9239
  }), [["__scopeId", "data-v-54f6bf5c"]]), zp = { class: "chat-header border-default bg-elevation-surface-default sticky top-0 z-10 flex items-center justify-between gap-3 border-b px-4 py-3 max-md:px-4 max-md:pb-3 sm:px-5 sm:py-3.5" }, Bp = {
9199
9240
  key: 0,
@@ -9208,13 +9249,13 @@ var ef = { class: "w-full" }, tf = {
9208
9249
  parentMessage: {}
9209
9250
  },
9210
9251
  setup(t) {
9211
- let { t: n } = K();
9212
- return (s, c) => (S(), a("header", zp, [t.conversation ? (S(), a("div", Bp, [l(j(L), {
9252
+ let { t: n } = q();
9253
+ return (s, c) => (S(), a("header", zp, [t.conversation ? (S(), a("div", Bp, [l(j(R), {
9213
9254
  image: t.conversation.avatar,
9214
9255
  label: t.conversation.avatar ? void 0 : t.conversation.title.slice(0, 1).toUpperCase(),
9215
9256
  shape: "circle",
9216
9257
  class: "chat-header__avatar shrink-0"
9217
- }, null, 8, ["image", "label"]), o("div", Vp, [o("p", Hp, k(t.parentMessage ? j(n)("thread") : t.conversation.title), 1), o("p", Up, [t.parentMessage ? (S(), a("span", Wp, k(t.parentMessage.senderName), 1)) : (S(), a("span", Gp, k(t.conversation.memberCount ? j(n)("members", { count: t.conversation.memberCount }) : j(n)("groupChat")), 1))])])])) : i("", !0), o("div", Kp, [t.conversation?.tags?.length ? (S(), a("div", qp, [(S(!0), a(e, null, T(t.conversation.tags.slice(0, 3), (e) => (S(), r(j(se), {
9258
+ }, null, 8, ["image", "label"]), o("div", Vp, [o("p", Hp, k(t.parentMessage ? j(n)("thread") : t.conversation.title), 1), o("p", Up, [t.parentMessage ? (S(), a("span", Wp, k(t.parentMessage.senderName), 1)) : (S(), a("span", Gp, k(t.conversation.memberCount ? j(n)("members", { count: t.conversation.memberCount }) : j(n)("groupChat")), 1))])])])) : i("", !0), o("div", Kp, [t.conversation?.tags?.length ? (S(), a("div", qp, [(S(!0), a(e, null, T(t.conversation.tags.slice(0, 3), (e) => (S(), r(j(oe), {
9218
9259
  key: e,
9219
9260
  text: e,
9220
9261
  context: "secondary",
@@ -9241,13 +9282,13 @@ var ef = { class: "w-full" }, tf = {
9241
9282
  },
9242
9283
  emits: ["anchorclick"],
9243
9284
  setup(t) {
9244
- let s = t, { t: c } = K(), u = Gl(), d = Yl(), f = uu(), p = n(() => s.target === "thread"), m = n(() => p.value ? d.threadMessages.value : s.hideGroupActions ? d.messages.value.filter((e) => e.kind !== "action") : d.messages.value), h = n(() => p.value ? d.loadingThreadMessages.value : d.loadingMessages.value), _ = n(() => p.value ? d.activeThreadParentMessage.value : null), v = n(() => p.value ? !1 : u.canOpenThread.value), y = n(() => s.showHeader ?? !p.value), b = n(() => p.value ? d.hasOlderThreadMessages.value : d.hasOlderMessages.value), x = n(() => p.value ? d.loadingOlderThreadMessages.value : d.loadingOlderMessages.value), C = n(() => p.value ? !0 : d.showDefaultEmptyState.value), D = n(() => {
9285
+ let s = t, { t: c } = q(), u = Gl(), d = Yl(), f = uu(), p = n(() => s.target === "thread"), m = n(() => p.value ? d.threadMessages.value : s.hideGroupActions ? d.messages.value.filter((e) => e.kind !== "action") : d.messages.value), h = n(() => p.value ? d.loadingThreadMessages.value : d.loadingMessages.value), _ = n(() => p.value ? d.activeThreadParentMessage.value : null), v = n(() => p.value ? !1 : u.canOpenThread.value), y = n(() => s.showHeader ?? !p.value), b = n(() => p.value ? d.hasOlderThreadMessages.value : d.hasOlderMessages.value), x = n(() => p.value ? d.loadingOlderThreadMessages.value : d.loadingOlderMessages.value), C = n(() => p.value ? !0 : d.showDefaultEmptyState.value), D = n(() => {
9245
9286
  let e = u.conversation.value;
9246
9287
  return e ? _.value ? c("thread") : e.title : "";
9247
9288
  }), O = n(() => {
9248
9289
  let e = u.conversation.value;
9249
9290
  return e ? _.value ? _.value.senderName : e.memberCount ? c("members", { count: e.memberCount }) : c("groupChat") : "";
9250
- }), A = n(() => u.conversation.value?.memberCount ?? 0), ee = w(null), M = w(null), N = n(() => !!_.value), P = n(() => N.value && !y.value), F = n(() => Bl(u.conversation.value)), ne = te("threadRef"), { handleThreadScroll: I } = Xd({
9291
+ }), A = n(() => u.conversation.value?.memberCount ?? 0), M = w(null), N = w(null), P = n(() => !!_.value), F = n(() => P.value && !y.value), I = n(() => Bl(u.conversation.value)), te = ee("threadRef"), { handleThreadScroll: L } = Xd({
9251
9292
  getConversation: () => u.conversation.value,
9252
9293
  getParentMessage: () => _.value,
9253
9294
  getMessages: () => m.value,
@@ -9255,14 +9296,14 @@ var ef = { class: "w-full" }, tf = {
9255
9296
  isLoadingOlder: () => x.value,
9256
9297
  canLoadOlder: () => b.value,
9257
9298
  onLoadOlder: () => f.emit("list:loadOlder", { target: s.target }),
9258
- threadRef: ne
9259
- }), L = te("actionMenuRef"), { activeActionMessage: R, handleMessageContextMenu: re, handleMessageTap: z, resetActionMenuState: ie, reactToMessage: ae, toggleInlineReaction: B, getActionItems: oe } = Wd({
9299
+ threadRef: te
9300
+ }), R = ee("actionMenuRef"), { activeActionMessage: z, handleMessageContextMenu: ne, handleMessageTap: B, resetActionMenuState: re, reactToMessage: ie, toggleInlineReaction: V, getActionItems: ae } = Wd({
9260
9301
  canUseMessageActions: () => u.canUseMessageActions.value,
9261
9302
  canReact: () => u.canReact.value,
9262
9303
  canReply: () => u.canReply.value,
9263
9304
  canOpenThread: () => v.value,
9264
9305
  isInThread: () => p.value,
9265
- actionMenuRef: L,
9306
+ actionMenuRef: R,
9266
9307
  t: c,
9267
9308
  emit: {
9268
9309
  reply: (e) => f.emit("message:reply", e),
@@ -9278,21 +9319,21 @@ var ef = { class: "w-full" }, tf = {
9278
9319
  },
9279
9320
  onMenuOpen: () => f.emit("ui:closeComposerActions")
9280
9321
  });
9281
- function V(e) {
9322
+ function H(e) {
9282
9323
  return !!e.url && [
9283
9324
  "image",
9284
9325
  "video",
9285
9326
  "audio"
9286
9327
  ].includes(e.kind);
9287
9328
  }
9288
- function se(e) {
9289
- V(e) && (ee.value = e);
9329
+ function oe(e) {
9330
+ H(e) && (M.value = e);
9290
9331
  }
9291
- function H() {
9292
- ee.value = null;
9332
+ function U() {
9333
+ M.value = null;
9293
9334
  }
9294
- async function ce(e, t) {
9295
- M.value = `${e.id}:${t}`;
9335
+ async function se(e, t) {
9336
+ N.value = `${e.id}:${t}`;
9296
9337
  try {
9297
9338
  f.emit("message:votePoll", {
9298
9339
  message: e,
@@ -9300,22 +9341,22 @@ var ef = { class: "w-full" }, tf = {
9300
9341
  });
9301
9342
  } finally {
9302
9343
  window.setTimeout(() => {
9303
- M.value === `${e.id}:${t}` && (M.value = null);
9344
+ N.value === `${e.id}:${t}` && (N.value = null);
9304
9345
  }, 300);
9305
9346
  }
9306
9347
  }
9307
- function le(e) {
9348
+ function ce(e) {
9308
9349
  v.value && f.emit("message:openThread", e);
9309
9350
  }
9310
- function ue(e, t) {
9351
+ function le(e, t) {
9311
9352
  return e.getFullYear() !== t.getFullYear() || e.getMonth() !== t.getMonth() || e.getDate() !== t.getDate();
9312
9353
  }
9313
- function de(e) {
9354
+ function ue(e) {
9314
9355
  let t = m.value;
9315
- return e === 0 ? !0 : ue(t[e].sentAt, t[e - 1].sentAt);
9356
+ return e === 0 ? !0 : le(t[e].sentAt, t[e - 1].sentAt);
9316
9357
  }
9317
9358
  return (t, n) => (S(), a(e, null, [
9318
- o("section", { class: g(["message-list-root", [t.$attrs.class, P.value ? "message-list--embedded-thread" : N.value ? "message-list--thread" : "message-list--main"]]) }, [y.value ? E(t.$slots, "header", {
9359
+ o("section", { class: g(["message-list-root", [t.$attrs.class, F.value ? "message-list--embedded-thread" : P.value ? "message-list--thread" : "message-list--main"]]) }, [y.value ? E(t.$slots, "header", {
9319
9360
  key: 0,
9320
9361
  conversation: j(u).conversation.value,
9321
9362
  parentMessage: _.value,
@@ -9328,15 +9369,15 @@ var ef = { class: "w-full" }, tf = {
9328
9369
  "parent-message": _.value
9329
9370
  }, null, 8, ["conversation", "parent-message"])], !0) : i("", !0), j(u).conversation.value ? (S(), a("div", {
9330
9371
  key: 2,
9331
- class: g(["message-list__body", P.value || N.value ? "bg-elevation-surface-overlay" : ""])
9372
+ class: g(["message-list__body", F.value || P.value ? "bg-elevation-surface-overlay" : ""])
9332
9373
  }, [o("div", {
9333
9374
  ref_key: "threadRef",
9334
- ref: ne,
9335
- class: g(["message-list__scroll min-h-0 flex-1", P.value ? "p-0" : N.value ? "px-5 py-4" : "px-2 pt-2 pb-3"]),
9336
- onScroll: n[2] ||= (...e) => j(I) && j(I)(...e)
9375
+ ref: te,
9376
+ class: g(["message-list__scroll min-h-0 flex-1", F.value ? "p-0" : P.value ? "px-5 py-4" : "px-2 pt-2 pb-3"]),
9377
+ onScroll: n[2] ||= (...e) => j(L) && j(L)(...e)
9337
9378
  }, [o("div", Xp, [
9338
9379
  _.value ? (S(), a("div", Zp, [o("p", Qp, k(_.value.senderName), 1), o("p", $p, k(j(ds)(_.value)), 1)])) : i("", !0),
9339
- (S(!0), a(e, null, T(m.value, (o, c) => (S(), a(e, { key: o.id }, [de(c) ? (S(), r(bf, {
9380
+ (S(!0), a(e, null, T(m.value, (o, c) => (S(), a(e, { key: o.id }, [ue(c) ? (S(), r(bf, {
9340
9381
  key: 0,
9341
9382
  date: o.sentAt
9342
9383
  }, null, 8, ["date"])) : i("", !0), l(kp, {
@@ -9344,16 +9385,16 @@ var ef = { class: "w-full" }, tf = {
9344
9385
  "current-user-id": j(u).currentUserId.value,
9345
9386
  "can-react": j(u).canReact.value,
9346
9387
  "can-open-thread": !_.value && v.value,
9347
- "can-show-sender-avatar": F.value,
9348
- "pending-option-key": M.value,
9388
+ "can-show-sender-avatar": I.value,
9389
+ "pending-option-key": N.value,
9349
9390
  "action-message-class": s.actionMessageClass,
9350
9391
  "action-message-row-class": s.actionMessageRowClass,
9351
- onContextmenu: (e) => j(re)(o, e),
9352
- onTap: (e) => j(z)(o, e),
9353
- onOpenMedia: se,
9354
- onVotePoll: (e) => ce(o, e),
9355
- onToggleReaction: (e) => j(B)(o, e),
9356
- onOpenThread: (e) => le(o),
9392
+ onContextmenu: (e) => j(ne)(o, e),
9393
+ onTap: (e) => j(B)(o, e),
9394
+ onOpenMedia: oe,
9395
+ onVotePoll: (e) => se(o, e),
9396
+ onToggleReaction: (e) => j(V)(o, e),
9397
+ onOpenThread: (e) => ce(o),
9357
9398
  onOpenReferencedMessage: n[0] ||= (e) => j(f).emit("message:openReference", e),
9358
9399
  onAnchorclick: n[1] ||= (e, n) => t.$emit("anchorclick", e, n)
9359
9400
  }, null, 8, [
@@ -9372,19 +9413,19 @@ var ef = { class: "w-full" }, tf = {
9372
9413
  "onOpenThread"
9373
9414
  ])], 64))), 128)),
9374
9415
  m.value.length === 0 && C.value && !h.value ? (S(), a("div", em, k(j(c)("noMessagesYetInThisGroup")), 1)) : i("", !0)
9375
- ])], 34), o("footer", { class: g(["message-list__composer flex shrink-0 flex-col", N.value ? P.value ? "bg-transparent p-0" : "message-list__composer--thread" : "bg-transparent p-0"]) }, [E(t.$slots, "composer", {}, void 0, !0)], 2)], 2)) : (S(), a("div", Yp, k(j(c)("selectConversationToStart")), 1))], 2),
9416
+ ])], 34), o("footer", { class: g(["message-list__composer flex shrink-0 flex-col", P.value ? F.value ? "bg-transparent p-0" : "message-list__composer--thread" : "bg-transparent p-0"]) }, [E(t.$slots, "composer", {}, void 0, !0)], 2)], 2)) : (S(), a("div", Yp, k(j(c)("selectConversationToStart")), 1))], 2),
9376
9417
  l(_f, {
9377
- attachment: ee.value,
9378
- onClose: H
9418
+ attachment: M.value,
9419
+ onClose: U
9379
9420
  }, null, 8, ["attachment"]),
9380
9421
  l(Rp, {
9381
9422
  ref_key: "actionMenuRef",
9382
- ref: L,
9383
- message: j(R),
9423
+ ref: R,
9424
+ message: j(z),
9384
9425
  "can-react": j(u).canReact.value,
9385
- "action-items": j(R) ? j(oe)(j(R)) : [],
9386
- onHide: j(ie),
9387
- onReact: n[3] ||= (e) => j(ae)(j(R), e)
9426
+ "action-items": j(z) ? j(ae)(j(z)) : [],
9427
+ onHide: j(re),
9428
+ onReact: n[3] ||= (e) => j(ie)(j(z), e)
9388
9429
  }, null, 8, [
9389
9430
  "message",
9390
9431
  "can-react",
@@ -9411,7 +9452,7 @@ var ef = { class: "w-full" }, tf = {
9411
9452
  return (n, r) => (S(), a("section", nm, [o("div", rm, [o("p", im, k(t.title), 1), o("span", am, k(t.receipts.length), 1)]), t.receipts.length ? (S(), a("div", om, [(S(!0), a(e, null, T(t.receipts, (e) => (S(), a("div", {
9412
9453
  key: `${e.kind}-${e.user.uid}`,
9413
9454
  class: "receipt-section__row"
9414
- }, [o("div", sm, [l(j(L), {
9455
+ }, [o("div", sm, [l(j(R), {
9415
9456
  image: e.user.avatar,
9416
9457
  label: e.user.avatar ? void 0 : e.user.name.slice(0, 1).toUpperCase(),
9417
9458
  shape: "circle",
@@ -9441,12 +9482,12 @@ var ef = { class: "w-full" }, tf = {
9441
9482
  },
9442
9483
  emits: ["close"],
9443
9484
  setup(e, { emit: t }) {
9444
- let s = e, c = t, { locale: u, t: d } = K(), f = n(() => s.receipts.filter((e) => e.kind === "delivered")), p = n(() => s.receipts.filter((e) => e.kind === "read")), m = n(() => s.receipts.filter((e) => e.kind === "delivered" || e.kind === "read"));
9485
+ let s = e, c = t, { locale: u, t: d } = q(), f = n(() => s.receipts.filter((e) => e.kind === "delivered")), p = n(() => s.receipts.filter((e) => e.kind === "read")), m = n(() => s.receipts.filter((e) => e.kind === "delivered" || e.kind === "read"));
9445
9486
  function h(e) {
9446
9487
  return e ? new Intl.DateTimeFormat(u.value, {
9447
9488
  dateStyle: "medium",
9448
9489
  timeStyle: "short",
9449
- hourCycle: ze()
9490
+ hourCycle: Re()
9450
9491
  }).format(e) : d("notYet");
9451
9492
  }
9452
9493
  function g(e, t) {
@@ -9459,21 +9500,21 @@ var ef = { class: "w-full" }, tf = {
9459
9500
  "close-label": j(d)("close"),
9460
9501
  onClose: n[0] ||= (e) => c("close")
9461
9502
  }, {
9462
- default: F(() => [e.message ? (S(), a("div", mm, [o("div", hm, [o("p", gm, k(j(ds)(e.message)), 1), o("div", _m, [
9503
+ default: I(() => [e.message ? (S(), a("div", mm, [o("div", hm, [o("p", gm, k(j(ds)(e.message)), 1), o("div", _m, [
9463
9504
  o("div", vm, [o("p", ym, k(j(d)("sent")), 1), o("p", bm, k(h(e.message.sentAt)), 1)]),
9464
- o("div", xm, [o("div", Sm, [o("p", Cm, k(j(d)("deliveredToAll")), 1), m.value.length ? (S(), r(j(se), {
9505
+ o("div", xm, [o("div", Sm, [o("p", Cm, k(j(d)("deliveredToAll")), 1), m.value.length ? (S(), r(j(oe), {
9465
9506
  key: 0,
9466
9507
  text: String(m.value.length),
9467
9508
  context: "secondary",
9468
9509
  rounded: ""
9469
9510
  }, null, 8, ["text"])) : i("", !0)]), o("p", wm, k(g(e.message.receipts.deliveredAt, m.value.length)), 1)]),
9470
- o("div", Tm, [o("div", Em, [o("p", Dm, k(j(d)("readByAll")), 1), p.value.length ? (S(), r(j(se), {
9511
+ o("div", Tm, [o("div", Em, [o("p", Dm, k(j(d)("readByAll")), 1), p.value.length ? (S(), r(j(oe), {
9471
9512
  key: 0,
9472
9513
  text: String(p.value.length),
9473
9514
  context: "success",
9474
9515
  rounded: ""
9475
9516
  }, null, 8, ["text"])) : i("", !0)]), o("p", Om, k(g(e.message.receipts.readAt, p.value.length)), 1)])
9476
- ])]), e.loading ? (S(), a("div", km, [l(j(V), {
9517
+ ])]), e.loading ? (S(), a("div", km, [l(j(H), {
9477
9518
  style: {
9478
9519
  width: "2.5rem",
9479
9520
  height: "2.5rem"
@@ -9521,10 +9562,13 @@ var ef = { class: "w-full" }, tf = {
9521
9562
  }, Um = {
9522
9563
  key: 1,
9523
9564
  class: "body-md text-default wrap-break-word whitespace-pre-wrap"
9524
- }, Wm = {
9565
+ }, Wm = { class: "flex flex-wrap items-center gap-1" }, Gm = {
9525
9566
  key: 0,
9526
9567
  class: "scheduled-message-edit mt-4 flex flex-col gap-3 rounded-xl p-3 sm:flex-row sm:items-center"
9527
- }, Gm = { class: "grid w-full grid-cols-1 gap-2 sm:grid-cols-[1fr_8rem]" }, Km = { class: "flex items-center gap-2" }, qm = /* @__PURE__ */ $(/* @__PURE__ */ u({
9568
+ }, Km = { class: "grid w-full grid-cols-1 gap-2 sm:grid-cols-[1fr_8rem]" }, qm = { class: "flex items-center gap-2" }, Jm = {
9569
+ key: 1,
9570
+ class: "scheduled-message-edit mt-4 flex flex-col gap-3 rounded-xl p-3"
9571
+ }, Ym = ["placeholder"], Xm = { class: "flex items-center justify-end gap-2" }, Zm = /* @__PURE__ */ $(/* @__PURE__ */ u({
9528
9572
  __name: "ScheduledMessagesDialog",
9529
9573
  props: {
9530
9574
  open: { type: Boolean },
@@ -9532,115 +9576,177 @@ var ef = { class: "w-full" }, tf = {
9532
9576
  messages: {},
9533
9577
  conversationTitle: {}
9534
9578
  },
9535
- emits: ["close", "reschedule"],
9579
+ emits: [
9580
+ "close",
9581
+ "reschedule",
9582
+ "remove",
9583
+ "editText"
9584
+ ],
9536
9585
  setup(t, { emit: s }) {
9537
- let c = t, u = s, d = w(null), f = w(""), p = w(""), { locale: m, t: h } = K(), g = n(() => c.messages.filter((e) => !e.isDeleted && !!e.scheduled?.scheduleDate)), _ = n(() => /^([01]\d|2[0-3]):([0-5]\d)$/.test(p.value));
9538
- P(() => c.open, (e) => {
9539
- e || (d.value = null, f.value = "", p.value = "");
9586
+ let c = t, u = s, d = w(null), f = w(null), p = w(""), m = w(""), h = w(""), { locale: g, t: _ } = q(), v = n(() => c.messages.filter((e) => !e.isDeleted && !!e.scheduled?.scheduleDate)), y = n(() => /^([01]\d|2[0-3]):([0-5]\d)$/.test(m.value));
9587
+ F(() => c.open, (e) => {
9588
+ e || (d.value = null, f.value = null, p.value = "", m.value = "", h.value = "");
9540
9589
  });
9541
- function v(e) {
9542
- return e ? new Intl.DateTimeFormat(m.value, {
9590
+ function b(e) {
9591
+ return e ? new Intl.DateTimeFormat(g.value, {
9543
9592
  dateStyle: "medium",
9544
9593
  timeStyle: "short",
9545
- hourCycle: ze()
9546
- }).format(e) : h("unscheduled");
9594
+ hourCycle: Re()
9595
+ }).format(e) : _("unscheduled");
9547
9596
  }
9548
- function y(e) {
9597
+ function x(e) {
9549
9598
  let t = e ?? new Date(Date.now() + 3600 * 1e3);
9550
9599
  return `${t.getFullYear()}-${String(t.getMonth() + 1).padStart(2, "0")}-${String(t.getDate()).padStart(2, "0")}`;
9551
9600
  }
9552
- function b(e) {
9601
+ function C(e) {
9553
9602
  let t = e ?? new Date(Date.now() + 3600 * 1e3);
9554
9603
  return `${String(t.getHours()).padStart(2, "0")}:${String(t.getMinutes()).padStart(2, "0")}`;
9555
9604
  }
9556
- function x(e) {
9557
- return h(e === "image" ? "image" : e === "video" ? "video" : e === "audio" ? "audio" : e === "file" ? "file" : "attachment");
9605
+ function E(e) {
9606
+ return _(e === "image" ? "image" : e === "video" ? "video" : e === "audio" ? "audio" : e === "file" ? "file" : "attachment");
9558
9607
  }
9559
- function C(e) {
9560
- d.value = e.id, f.value = y(e.scheduled?.scheduleDate), p.value = b(e.scheduled?.scheduleDate);
9608
+ function D(e) {
9609
+ d.value = e.id, f.value = "reschedule", p.value = x(e.scheduled?.scheduleDate), m.value = C(e.scheduled?.scheduleDate), h.value = "";
9561
9610
  }
9562
- function E() {
9563
- d.value = null, f.value = "", p.value = "";
9611
+ function O(e) {
9612
+ d.value = e.id, f.value = "text", h.value = ds(e, ""), p.value = "", m.value = "";
9564
9613
  }
9565
- function D(e) {
9566
- if (!e.scheduled?.messageId || !e.scheduled?.muid || !e.scheduled?.originalChatUid || !f.value || !_.value) return;
9567
- let [t, n, r] = f.value.split("-").map(Number), [i, a] = p.value.split(":").map(Number), o = new Date(t, n - 1, r, i, a, 0, 0);
9614
+ function A() {
9615
+ d.value = null, f.value = null, p.value = "", m.value = "", h.value = "";
9616
+ }
9617
+ function M(e) {
9618
+ if (!e.scheduled?.messageId || !e.scheduled?.muid || !e.scheduled?.originalChatUid || !p.value || !y.value) return;
9619
+ let [t, n, r] = p.value.split("-").map(Number), [i, a] = m.value.split(":").map(Number), o = new Date(t, n - 1, r, i, a, 0, 0);
9568
9620
  u("reschedule", {
9569
9621
  messageId: e.scheduled.messageId,
9570
9622
  muid: e.scheduled.muid,
9571
9623
  originalChatUid: e.scheduled.originalChatUid,
9572
9624
  scheduleDate: o.toISOString()
9573
- }), E();
9625
+ }), A();
9626
+ }
9627
+ function ee(e) {
9628
+ let t = h.value.trim();
9629
+ e.kind === "text" && !t || (u("editText", {
9630
+ message: e,
9631
+ nextText: h.value
9632
+ }), A());
9633
+ }
9634
+ function P(e) {
9635
+ d.value === e.id && A(), u("remove", e);
9574
9636
  }
9575
9637
  return (n, s) => (S(), r(nf, {
9576
9638
  open: t.open,
9577
- title: j(h)("scheduledMessages"),
9578
- subtitle: t.conversationTitle ? j(h)("queuedForConversation", { title: t.conversationTitle }) : j(h)("queuedOutgoingMessagesForThisChat"),
9579
- "close-label": j(h)("close"),
9639
+ title: j(_)("scheduledMessages"),
9640
+ subtitle: t.conversationTitle ? j(_)("queuedForConversation", { title: t.conversationTitle }) : j(_)("queuedOutgoingMessagesForThisChat"),
9641
+ "close-label": j(_)("close"),
9580
9642
  "body-class": "px-4 py-4 sm:px-6 sm:py-5",
9581
- onClose: s[2] ||= (e) => u("close")
9643
+ onClose: s[3] ||= (e) => u("close")
9582
9644
  }, {
9583
- default: F(() => [o("div", Nm, [t.loading ? (S(), a("div", Pm, [l(j(V), {
9645
+ default: I(() => [o("div", Nm, [t.loading ? (S(), a("div", Pm, [l(j(H), {
9584
9646
  style: {
9585
9647
  width: "2.75rem",
9586
9648
  height: "2.75rem"
9587
9649
  },
9588
9650
  "stroke-width": "6"
9589
- })])) : g.value.length === 0 ? (S(), a("div", Fm, k(j(h)("noScheduledMessagesForConversation")), 1)) : (S(), a("div", Im, [(S(!0), a(e, null, T(g.value, (e) => (S(), a("article", {
9651
+ })])) : v.value.length === 0 ? (S(), a("div", Fm, k(j(_)("noScheduledMessagesForConversation")), 1)) : (S(), a("div", Im, [(S(!0), a(e, null, T(v.value, (e) => (S(), a("article", {
9590
9652
  key: e.id,
9591
9653
  class: "scheduled-message-row px-1 py-4"
9592
- }, [o("div", Lm, [o("div", Rm, [o("div", zm, [l(j(se), {
9593
- text: j(h)("scheduled"),
9654
+ }, [o("div", Lm, [o("div", Rm, [o("div", zm, [l(j(oe), {
9655
+ text: j(_)("scheduled"),
9594
9656
  context: "warn",
9595
9657
  rounded: ""
9596
- }, null, 8, ["text"]), e.kind === "poll" ? (S(), r(j(se), {
9658
+ }, null, 8, ["text"]), e.kind === "poll" ? (S(), r(j(oe), {
9597
9659
  key: 0,
9598
- text: j(h)("poll"),
9660
+ text: j(_)("poll"),
9599
9661
  context: "info",
9600
9662
  rounded: ""
9601
- }, null, 8, ["text"])) : e.attachments.length ? (S(), r(j(se), {
9663
+ }, null, 8, ["text"])) : e.attachments.length ? (S(), r(j(oe), {
9602
9664
  key: 1,
9603
- text: x(e.attachments[0].kind),
9665
+ text: E(e.attachments[0].kind),
9604
9666
  context: "secondary",
9605
9667
  rounded: ""
9606
- }, null, 8, ["text"])) : i("", !0)]), o("div", Bm, [o("p", Vm, k(v(e.scheduled?.scheduleDate)), 1), e.kind === "poll" && e.poll ? (S(), a("p", Hm, k(e.poll.question), 1)) : (S(), a("p", Um, k(j(ds)(e, j(h)("attachment"))), 1))])]), e.scheduled?.messageId && e.scheduled?.muid && e.scheduled?.originalChatUid ? (S(), r(j(R), {
9607
- key: 0,
9608
- label: j(h)("reschedule"),
9609
- icon: j(_u),
9610
- text: "",
9611
- size: "small",
9612
- onClick: (t) => C(e)
9613
- }, null, 8, [
9614
- "label",
9615
- "icon",
9616
- "onClick"
9617
- ])) : i("", !0)]), d.value === e.id ? (S(), a("div", Wm, [o("div", Gm, [ne(o("input", {
9618
- "onUpdate:modelValue": s[0] ||= (e) => f.value = e,
9668
+ }, null, 8, ["text"])) : i("", !0)]), o("div", Bm, [o("p", Vm, k(b(e.scheduled?.scheduleDate)), 1), e.kind === "poll" && e.poll ? (S(), a("p", Hm, k(e.poll.question), 1)) : (S(), a("p", Um, k(j(ds)(e, j(_)("attachment"))), 1))])]), o("div", Wm, [
9669
+ e.kind === "poll" ? i("", !0) : (S(), r(j(z), {
9670
+ key: 0,
9671
+ label: j(_)("edit"),
9672
+ icon: j(Tu),
9673
+ text: "",
9674
+ size: "small",
9675
+ onClick: (t) => O(e)
9676
+ }, null, 8, [
9677
+ "label",
9678
+ "icon",
9679
+ "onClick"
9680
+ ])),
9681
+ e.scheduled?.messageId && e.scheduled?.muid && e.scheduled?.originalChatUid ? (S(), r(j(z), {
9682
+ key: 1,
9683
+ label: j(_)("reschedule"),
9684
+ icon: j(_u),
9685
+ text: "",
9686
+ size: "small",
9687
+ onClick: (t) => D(e)
9688
+ }, null, 8, [
9689
+ "label",
9690
+ "icon",
9691
+ "onClick"
9692
+ ])) : i("", !0),
9693
+ l(j(z), {
9694
+ label: j(_)("remove"),
9695
+ icon: j(Su),
9696
+ text: "",
9697
+ size: "small",
9698
+ onClick: (t) => P(e)
9699
+ }, null, 8, [
9700
+ "label",
9701
+ "icon",
9702
+ "onClick"
9703
+ ])
9704
+ ])]), d.value === e.id && f.value === "reschedule" ? (S(), a("div", Gm, [o("div", Km, [te(o("input", {
9705
+ "onUpdate:modelValue": s[0] ||= (e) => p.value = e,
9619
9706
  type: "date",
9620
9707
  class: "surface-input body-md w-full rounded-xl px-3 py-2 ring-0 outline-none"
9621
- }, null, 512), [[M, f.value]]), ne(o("input", {
9622
- "onUpdate:modelValue": s[1] ||= (e) => p.value = e,
9708
+ }, null, 512), [[N, p.value]]), te(o("input", {
9709
+ "onUpdate:modelValue": s[1] ||= (e) => m.value = e,
9623
9710
  type: "text",
9624
9711
  inputmode: "numeric",
9625
9712
  placeholder: "HH:mm",
9626
9713
  pattern: "^([01]\\d|2[0-3]):([0-5]\\d)$",
9627
9714
  "aria-label": "Time (24-hour)",
9628
9715
  class: "surface-input body-md w-full rounded-xl px-3 py-2 ring-0 outline-none"
9629
- }, null, 512), [[M, p.value]])]), o("div", Km, [l(j(R), {
9630
- label: j(h)("save"),
9716
+ }, null, 512), [[N, m.value]])]), o("div", qm, [l(j(z), {
9717
+ label: j(_)("save"),
9631
9718
  size: "small",
9632
- disabled: !f.value || !_.value,
9633
- onClick: (t) => D(e)
9719
+ disabled: !p.value || !y.value,
9720
+ onClick: (t) => M(e)
9634
9721
  }, null, 8, [
9635
9722
  "label",
9636
9723
  "disabled",
9637
9724
  "onClick"
9638
- ]), l(j(R), {
9639
- label: j(h)("cancel"),
9725
+ ]), l(j(z), {
9726
+ label: j(_)("cancel"),
9727
+ size: "small",
9728
+ text: "",
9729
+ onClick: A
9730
+ }, null, 8, ["label"])])])) : d.value === e.id && f.value === "text" ? (S(), a("div", Jm, [te(o("textarea", {
9731
+ "onUpdate:modelValue": s[2] ||= (e) => h.value = e,
9732
+ rows: "3",
9733
+ class: "surface-input body-md w-full rounded-xl px-3 py-2 ring-0 outline-none",
9734
+ placeholder: j(_)("writeMessage")
9735
+ }, null, 8, Ym), [[N, h.value]]), o("div", Xm, [l(j(z), {
9736
+ label: j(_)("cancel"),
9640
9737
  size: "small",
9641
9738
  text: "",
9642
- onClick: E
9643
- }, null, 8, ["label"])])])) : i("", !0)]))), 128))]))])]),
9739
+ onClick: A
9740
+ }, null, 8, ["label"]), l(j(z), {
9741
+ label: j(_)("save"),
9742
+ size: "small",
9743
+ disabled: e.kind === "text" && !h.value.trim(),
9744
+ onClick: (t) => ee(e)
9745
+ }, null, 8, [
9746
+ "label",
9747
+ "disabled",
9748
+ "onClick"
9749
+ ])])])) : i("", !0)]))), 128))]))])]),
9644
9750
  _: 1
9645
9751
  }, 8, [
9646
9752
  "open",
@@ -9649,10 +9755,10 @@ var ef = { class: "w-full" }, tf = {
9649
9755
  "close-label"
9650
9756
  ]));
9651
9757
  }
9652
- }), [["__scopeId", "data-v-20875b64"]]), Jm = {
9758
+ }), [["__scopeId", "data-v-3dd0bea6"]]), Qm = {
9653
9759
  key: 0,
9654
9760
  class: "chat-status-overlay"
9655
- }, Ym = { class: "chat-status-overlay__card" }, Xm = { key: 0 }, Zm = { key: 1 }, Qm = { key: 2 }, $m = { key: 3 }, eh = /* @__PURE__ */ $(/* @__PURE__ */ u({
9761
+ }, $m = { class: "chat-status-overlay__card" }, eh = { key: 0 }, th = { key: 1 }, nh = { key: 2 }, rh = { key: 3 }, ih = /* @__PURE__ */ $(/* @__PURE__ */ u({
9656
9762
  __name: "ChatStatusOverlay",
9657
9763
  props: {
9658
9764
  visible: { type: Boolean },
@@ -9665,9 +9771,9 @@ var ef = { class: "w-full" }, tf = {
9665
9771
  messages: {}
9666
9772
  },
9667
9773
  setup(e) {
9668
- return (t, n) => e.visible ? (S(), a("div", Jm, [o("div", Ym, [e.offlineMode ? (S(), a("span", Xm, k(e.messages.waitingForNetwork), 1)) : e.connected ? e.loading ? (S(), a("span", Qm, k(e.messages.loading), 1)) : e.notFound ? (S(), a("span", $m, k(e.messages.notFound), 1)) : e.isEmpty && e.showEmptySlot ? E(t.$slots, "no-messages", { key: 4 }, () => [o("span", null, k(e.messages.noMessages), 1)], !0) : i("", !0) : (S(), a("span", Zm, k(e.messages.connecting), 1))])])) : i("", !0);
9774
+ return (t, n) => e.visible ? (S(), a("div", Qm, [o("div", $m, [e.offlineMode ? (S(), a("span", eh, k(e.messages.waitingForNetwork), 1)) : e.connected ? e.loading ? (S(), a("span", nh, k(e.messages.loading), 1)) : e.notFound ? (S(), a("span", rh, k(e.messages.notFound), 1)) : e.isEmpty && e.showEmptySlot ? E(t.$slots, "no-messages", { key: 4 }, () => [o("span", null, k(e.messages.noMessages), 1)], !0) : i("", !0) : (S(), a("span", th, k(e.messages.connecting), 1))])])) : i("", !0);
9669
9775
  }
9670
- }), [["__scopeId", "data-v-20316f96"]]), th = /* @__PURE__ */ u({
9776
+ }), [["__scopeId", "data-v-20316f96"]]), ah = /* @__PURE__ */ u({
9671
9777
  __name: "BccChat",
9672
9778
  props: {
9673
9779
  client: { default: null },
@@ -9727,17 +9833,17 @@ var ef = { class: "w-full" }, tf = {
9727
9833
  });
9728
9834
  return n;
9729
9835
  }
9730
- let p = t, m = u, { t: h } = K(() => p.language), v = w(null), x = w(!1), C = w(!1), T = n(() => p.client ?? Q.value ?? null), D = n(() => !!p.chatUid), O = n(() => {
9836
+ let p = t, m = u, { t: h } = q(() => p.language), v = w(null), x = w(!1), C = w(!1), T = n(() => p.client ?? Q.value ?? null), D = n(() => !!p.chatUid), O = n(() => {
9731
9837
  if (p.conversation !== void 0) return p.conversation;
9732
9838
  let e = T.value;
9733
9839
  return e ? p.chatUid ? e.conversations.value.find((e) => e.targetId === p.chatUid || e.id === p.chatUid) ?? null : e.activeConversation.value : null;
9734
- }), { groupMembers: A, fetchGroupMembers: ee } = fu({
9840
+ }), { groupMembers: A, fetchGroupMembers: M } = fu({
9735
9841
  getConversationTargetId: () => O.value?.targetId,
9736
9842
  isChannel: () => Ml(O.value),
9737
9843
  onMembersChanged: (e) => {
9738
9844
  m("chatMembersFetched", e), T.value?.rememberMentionDisplayNames(e);
9739
9845
  }
9740
- }), M = Hl({
9846
+ }), N = Hl({
9741
9847
  chatClient: T,
9742
9848
  selectedConversation: O,
9743
9849
  getPropIsReadOnly: () => p.isReadOnly,
@@ -9749,8 +9855,8 @@ var ef = { class: "w-full" }, tf = {
9749
9855
  currentUserId: T.value?.currentUser.value?.uid
9750
9856
  })
9751
9857
  });
9752
- Wl(M);
9753
- let N = Kl({
9858
+ Wl(N);
9859
+ let P = Kl({
9754
9860
  chatClient: T,
9755
9861
  selectedConversation: O,
9756
9862
  usesPublicContract: D,
@@ -9762,61 +9868,61 @@ var ef = { class: "w-full" }, tf = {
9762
9868
  getPropShowDefaultEmptyState: () => p.showDefaultEmptyState,
9763
9869
  getHideDeletedMessages: () => p.hideDeletedMessages
9764
9870
  });
9765
- Jl(N);
9766
- let ne = n(() => N.messages.value.length > 0), I = n(() => p.showHeader ?? p.showMessageHeader), L = nu({
9871
+ Jl(P);
9872
+ let te = n(() => P.messages.value.length > 0), L = n(() => p.showHeader ?? p.showMessageHeader), R = nu({
9767
9873
  chatClient: T,
9768
9874
  selectedConversation: O,
9769
9875
  getInitialScheduledMessagesOpen: () => !!p.initialScheduledMessagesOpen,
9770
9876
  fetchErrorFallback: h("loadMessageReceiptsError")
9771
9877
  });
9772
- iu(L);
9773
- let R = te("mainComposerRef"), re = te("threadComposerRef"), z = Zl({
9878
+ iu(R);
9879
+ let z = ee("mainComposerRef"), ne = ee("threadComposerRef"), B = Zl({
9774
9880
  chatClient: T,
9775
- sendOptions: M.sendOptions,
9776
- mentionNameByUid: M.mentionNameByUid,
9777
- afterSchedule: () => L.openScheduledMessages(),
9778
- mainComposerRef: R,
9779
- threadComposerRef: re
9881
+ sendOptions: N.sendOptions,
9882
+ mentionNameByUid: N.mentionNameByUid,
9883
+ afterSchedule: () => R.openScheduledMessages(),
9884
+ mainComposerRef: z,
9885
+ threadComposerRef: ne
9780
9886
  });
9781
- $l(z);
9782
- let ie = cu();
9783
- lu(ie), ou({
9784
- conversation: M,
9785
- composer: z,
9786
- dialogs: L,
9787
- bus: ie
9887
+ $l(B);
9888
+ let re = cu();
9889
+ lu(re), ou({
9890
+ conversation: N,
9891
+ composer: B,
9892
+ dialogs: R,
9893
+ bus: re
9788
9894
  });
9789
- let { scrollToRequestedMessage: ae } = pu({
9895
+ let { scrollToRequestedMessage: ie } = pu({
9790
9896
  chatRootRef: v,
9791
9897
  getClient: () => T.value
9792
9898
  });
9793
- P(() => O.value?.targetId ?? null, () => {
9794
- L.refreshScheduledMessages();
9795
- }, { immediate: !0 }), P(() => O.value?.targetId ?? null, async (e) => {
9796
- !e || O.value?.type !== "group" || await ee(e);
9797
- }, { immediate: !0 }), P(() => O.value?.id, () => {
9798
- z.resetMainComposer(), z.resetThreadComposer(), L.showScheduledMessages.value = !1, L.closeMessageInfo();
9799
- }), P(() => p.chatMessageGetter, (e) => {
9899
+ F(() => O.value?.targetId ?? null, () => {
9900
+ R.refreshScheduledMessages();
9901
+ }, { immediate: !0 }), F(() => O.value?.targetId ?? null, async (e) => {
9902
+ !e || O.value?.type !== "group" || await M(e);
9903
+ }, { immediate: !0 }), F(() => O.value?.id, () => {
9904
+ B.resetMainComposer(), B.resetThreadComposer(), R.showScheduledMessages.value = !1, R.closeMessageInfo();
9905
+ }), F(() => p.chatMessageGetter, (e) => {
9800
9906
  Al.setGetChatMessagesCallback(e);
9801
- }, { immediate: !0 }), P(() => p.language, (e) => {
9802
- e && Be(e);
9803
- }, { immediate: !0 }), P(N.isChatEmpty, (e) => {
9907
+ }, { immediate: !0 }), F(() => p.language, (e) => {
9908
+ e && ze(e);
9909
+ }, { immediate: !0 }), F(P.isChatEmpty, (e) => {
9804
9910
  e && m("chatEmpty");
9805
- }), P([
9911
+ }), F([
9806
9912
  () => p.chatUid,
9807
9913
  () => p.client ? p.client.initialized.value : Al.initialized.value,
9808
9914
  () => p.client ? p.client.loggedIn.value : Al.loggedIn.value,
9809
9915
  () => T.value?.conversations.value.length ?? 0
9810
9916
  ], async ([e, t, n]) => {
9811
- !D.value || !e || !t || !n || !T.value || await B();
9812
- }, { immediate: !0 }), P([
9813
- () => N.messages.value.length,
9814
- () => N.threadMessages.value.length,
9917
+ !D.value || !e || !t || !n || !T.value || await V();
9918
+ }, { immediate: !0 }), F([
9919
+ () => P.messages.value.length,
9920
+ () => P.threadMessages.value.length,
9815
9921
  () => Al.scrollToMessageId.value
9816
9922
  ], async () => {
9817
- await ae();
9923
+ await ie();
9818
9924
  });
9819
- async function B() {
9925
+ async function V() {
9820
9926
  let e = T.value;
9821
9927
  if (e) {
9822
9928
  C.value = !0, x.value = !1;
@@ -9827,39 +9933,39 @@ var ef = { class: "w-full" }, tf = {
9827
9933
  x.value = !0, m("chatMembersFetched", []);
9828
9934
  return;
9829
9935
  }
9830
- e.activeConversationId.value !== t.id && await e.selectConversation(t.id), await ee(t.targetId);
9936
+ e.activeConversationId.value !== t.id && await e.selectConversation(t.id), await M(t.targetId);
9831
9937
  } finally {
9832
9938
  C.value = !1;
9833
9939
  }
9834
9940
  }
9835
9941
  }
9836
- function V(e, t) {
9942
+ function H(e, t) {
9837
9943
  m("linkClicked", e, t);
9838
9944
  }
9839
- let se = w(!1);
9945
+ let oe = w(!1);
9840
9946
  b(() => {
9841
9947
  setTimeout(() => {
9842
- se.value = !0;
9948
+ oe.value = !0;
9843
9949
  }, 200);
9844
9950
  }), y(() => {
9845
9951
  let e = T.value;
9846
9952
  e && e.activeConversation.value === O.value && e.selectConversation(null);
9847
9953
  });
9848
- async function H(e) {
9849
- return await new Promise((e) => setTimeout(e, 100)), se.value ? ae(e) : (await new Promise((e) => setTimeout(e, 110)), H(e));
9954
+ async function U(e) {
9955
+ return await new Promise((e) => setTimeout(e, 100)), oe.value ? ie(e) : (await new Promise((e) => setTimeout(e, 110)), U(e));
9850
9956
  }
9851
- return o({ scrollToMessage: H }), (n, o) => (S(), a("div", {
9957
+ return o({ scrollToMessage: U }), (n, o) => (S(), a("div", {
9852
9958
  ref_key: "chatRootRef",
9853
9959
  ref: v,
9854
9960
  class: "bcc-chat-message-list-wrapper relative h-full min-h-104"
9855
9961
  }, [
9856
- D.value && T.value?.error.value ? (S(), r(j(oe), {
9962
+ D.value && T.value?.error.value ? (S(), r(j(ae), {
9857
9963
  key: 0,
9858
9964
  severity: "error",
9859
9965
  closable: !1,
9860
9966
  class: "pointer-events-auto absolute inset-x-2 top-2 z-20 shadow-lg"
9861
9967
  }, {
9862
- default: F(() => [c(k(T.value.error.value), 1)]),
9968
+ default: I(() => [c(k(T.value.error.value), 1)]),
9863
9969
  _: 1
9864
9970
  })) : i("", !0),
9865
9971
  T.value ? (S(), a(e, { key: 1 }, [
@@ -9867,20 +9973,20 @@ var ef = { class: "w-full" }, tf = {
9867
9973
  target: "main",
9868
9974
  class: g(["h-full", t.containerClass]),
9869
9975
  "hide-group-actions": t.hideGroupActions,
9870
- "show-header": I.value,
9976
+ "show-header": L.value,
9871
9977
  "action-message-class": t.actionMessageClass,
9872
9978
  "action-message-row-class": t.actionMessageRowClass,
9873
- onAnchorclick: V
9979
+ onAnchorclick: H
9874
9980
  }, s({
9875
- composer: F(() => [l(Hd, {
9981
+ composer: I(() => [l(Hd, {
9876
9982
  ref_key: "mainComposerRef",
9877
- ref: R,
9983
+ ref: z,
9878
9984
  target: "main"
9879
9985
  }, null, 512)]),
9880
9986
  _: 2
9881
9987
  }, [n.$slots["message-header"] ? {
9882
9988
  name: "header",
9883
- fn: F((e) => [E(n.$slots, "message-header", _(d(e)))]),
9989
+ fn: I((e) => [E(n.$slots, "message-header", _(d(e)))]),
9884
9990
  key: "0"
9885
9991
  } : void 0]), 1032, [
9886
9992
  "hide-group-actions",
@@ -9890,22 +9996,22 @@ var ef = { class: "w-full" }, tf = {
9890
9996
  "action-message-row-class"
9891
9997
  ]),
9892
9998
  l(nf, {
9893
- open: !!j(N).activeThreadParentMessage.value,
9894
- title: j(h)("threadWithCount", { count: j(N).activeThreadParentMessage.value?.replyCount ?? 0 }),
9999
+ open: !!j(P).activeThreadParentMessage.value,
10000
+ title: j(h)("threadWithCount", { count: j(P).activeThreadParentMessage.value?.replyCount ?? 0 }),
9895
10001
  subtitle: O.value?.title ?? "",
9896
10002
  "close-label": j(h)("close"),
9897
10003
  "close-aria-label": j(h)("closeThread"),
9898
- onClose: o[0] ||= (e) => j(ie).emit("ui:closeThread")
10004
+ onClose: o[0] ||= (e) => j(re).emit("ui:closeThread")
9899
10005
  }, {
9900
- default: F(() => [l(tm, {
10006
+ default: I(() => [l(tm, {
9901
10007
  target: "thread",
9902
10008
  class: "min-h-0 flex-1",
9903
10009
  "action-message-class": t.actionMessageClass,
9904
10010
  "action-message-row-class": t.actionMessageRowClass
9905
10011
  }, {
9906
- composer: F(() => [l(Hd, {
10012
+ composer: I(() => [l(Hd, {
9907
10013
  ref_key: "threadComposerRef",
9908
- ref: re,
10014
+ ref: ne,
9909
10015
  target: "thread"
9910
10016
  }, null, 512)]),
9911
10017
  _: 1
@@ -9918,13 +10024,15 @@ var ef = { class: "w-full" }, tf = {
9918
10024
  "close-label",
9919
10025
  "close-aria-label"
9920
10026
  ]),
9921
- l(qm, {
9922
- open: j(L).showScheduledMessages.value,
9923
- loading: j(L).loadingScheduledMessages.value,
9924
- messages: j(L).scheduledMessages.value,
10027
+ l(Zm, {
10028
+ open: j(R).showScheduledMessages.value,
10029
+ loading: j(R).loadingScheduledMessages.value,
10030
+ messages: j(R).scheduledMessages.value,
9925
10031
  "conversation-title": O.value?.title,
9926
- onClose: o[1] ||= (e) => j(L).showScheduledMessages.value = !1,
9927
- onReschedule: o[2] ||= (e) => j(ie).emit("ui:reschedule", e)
10032
+ onClose: o[1] ||= (e) => j(R).showScheduledMessages.value = !1,
10033
+ onReschedule: o[2] ||= (e) => j(re).emit("ui:reschedule", e),
10034
+ onRemove: o[3] ||= (e) => j(re).emit("ui:removeScheduled", e),
10035
+ onEditText: o[4] ||= (e) => j(re).emit("ui:editScheduledText", e)
9928
10036
  }, null, 8, [
9929
10037
  "open",
9930
10038
  "loading",
@@ -9932,12 +10040,12 @@ var ef = { class: "w-full" }, tf = {
9932
10040
  "conversation-title"
9933
10041
  ]),
9934
10042
  l(Mm, {
9935
- open: !!j(L).infoMessage.value,
9936
- message: j(L).infoMessage.value,
9937
- receipts: j(L).infoMessageReceipts.value,
9938
- loading: j(L).loadingMessageReceipts.value,
9939
- error: j(L).messageReceiptsError.value,
9940
- onClose: o[3] ||= (e) => j(L).closeMessageInfo()
10043
+ open: !!j(R).infoMessage.value,
10044
+ message: j(R).infoMessage.value,
10045
+ receipts: j(R).infoMessageReceipts.value,
10046
+ loading: j(R).loadingMessageReceipts.value,
10047
+ error: j(R).messageReceiptsError.value,
10048
+ onClose: o[5] ||= (e) => j(R).closeMessageInfo()
9941
10049
  }, null, 8, [
9942
10050
  "open",
9943
10051
  "message",
@@ -9946,13 +10054,13 @@ var ef = { class: "w-full" }, tf = {
9946
10054
  "error"
9947
10055
  ])
9948
10056
  ], 64)) : i("", !0),
9949
- l(eh, {
9950
- visible: D.value && (T.value?.offlineMode.value || !T.value?.connected.value || C.value && !ne.value || x.value || t.displayNoMessagesText && j(N).isChatEmpty.value),
10057
+ l(ih, {
10058
+ visible: D.value && (T.value?.offlineMode.value || !T.value?.connected.value || C.value && !te.value || x.value || t.displayNoMessagesText && j(P).isChatEmpty.value),
9951
10059
  "offline-mode": !!(T.value?.offlineMode.value && !O.value),
9952
10060
  connected: !!(T.value?.connected.value || O.value),
9953
10061
  loading: C.value,
9954
10062
  "not-found": x.value,
9955
- "is-empty": j(N).isChatEmpty.value,
10063
+ "is-empty": j(P).isChatEmpty.value,
9956
10064
  "show-empty-slot": t.displayNoMessagesText,
9957
10065
  messages: {
9958
10066
  waitingForNetwork: j(h)("waitingForNetwork"),
@@ -9962,7 +10070,7 @@ var ef = { class: "w-full" }, tf = {
9962
10070
  noMessages: j(h)("noMessagesHaveBeenSentYet")
9963
10071
  }
9964
10072
  }, {
9965
- "no-messages": F(() => [E(n.$slots, "no-messages")]),
10073
+ "no-messages": I(() => [E(n.$slots, "no-messages")]),
9966
10074
  _: 3
9967
10075
  }, 8, [
9968
10076
  "visible",
@@ -9978,6 +10086,6 @@ var ef = { class: "w-full" }, tf = {
9978
10086
  }
9979
10087
  });
9980
10088
  //#endregion
9981
- export { th as BccChat, th as BccChatMessageList, Jc as LogSeverity, Al as chat, Al as default, Os as createChatClient };
10089
+ export { ah as BccChat, ah as BccChatMessageList, Jc as LogSeverity, Al as chat, Al as default, Os as createChatClient };
9982
10090
 
9983
10091
  //# sourceMappingURL=vue-bcc-chat-ui.js.map