@bcc-code/vue-bcc-chat-ui 7.0.14 → 7.0.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/style.css +1 -1
- package/dist/vue-bcc-chat-ui.js +774 -776
- package/dist/vue-bcc-chat-ui.js.map +1 -1
- package/package.json +1 -1
package/dist/vue-bcc-chat-ui.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
var Ii = Object.defineProperty;
|
|
2
2
|
var Fi = (e, t, u) => t in e ? Ii(e, t, { enumerable: !0, configurable: !0, writable: !0, value: u }) : e[t] = u;
|
|
3
3
|
var ia = (e, t, u) => Fi(e, typeof t != "symbol" ? t + "" : t, u);
|
|
4
|
-
import { ref as U, computed as N, toValue as Ri, shallowRef as Ma, isRef as qi, watch as Ke, provide as Ju, inject as en, onUnmounted as oo, onMounted as io, nextTick as Xt, openBlock as M, createElementBlock as F, createElementVNode as T, onBeforeUnmount as so, defineComponent as be, createBlock as ne, unref as v, withCtx as
|
|
5
|
-
import { BccPopover as Bi, BccButton as
|
|
4
|
+
import { ref as U, computed as N, toValue as Ri, shallowRef as Ma, isRef as qi, watch as Ke, provide as Ju, inject as en, onUnmounted as oo, onMounted as io, nextTick as Xt, openBlock as M, createElementBlock as F, createElementVNode as T, onBeforeUnmount as so, defineComponent as be, createBlock as ne, unref as v, withCtx as He, Fragment as je, renderList as ht, resolveDynamicComponent as at, toDisplayString as Z, normalizeClass as Ce, createVNode as ie, normalizeStyle as zn, withModifiers as Vu, createCommentVNode as ae, withDirectives as In, vModelText as Fn, renderSlot as Jt, createTextVNode as lo, Teleport as Oi, createSlots as Li, normalizeProps as Pi, guardReactiveProps as $i } from "vue";
|
|
5
|
+
import { BccPopover as Bi, BccButton as rt, BccDialog as La, BccInputText as mr, BccTag as St, BccAvatar as Pa, BccProgressSpinner as co, BccMessage as Ni } from "@bcc-code/component-library-vue";
|
|
6
6
|
import { CometChat as j } from "@cometchat/chat-sdk-javascript";
|
|
7
7
|
const Ui = {
|
|
8
8
|
prod: {
|
|
@@ -20,7 +20,7 @@ let wa = null;
|
|
|
20
20
|
function $a(e) {
|
|
21
21
|
wa = e;
|
|
22
22
|
}
|
|
23
|
-
function
|
|
23
|
+
function Be() {
|
|
24
24
|
if (!wa)
|
|
25
25
|
throw new Error(
|
|
26
26
|
"Environment has not been set yet. Call setCurrentEnvironment(...) first."
|
|
@@ -30,7 +30,7 @@ function Ne() {
|
|
|
30
30
|
const fo = ":loginAccessToken", Ba = ":token";
|
|
31
31
|
let Uu;
|
|
32
32
|
function tn(e) {
|
|
33
|
-
return `${
|
|
33
|
+
return `${Be().appId}${e}`;
|
|
34
34
|
}
|
|
35
35
|
function Gu() {
|
|
36
36
|
return Uu !== void 0 || (Uu = localStorage.getItem(tn(fo))), Uu;
|
|
@@ -69,7 +69,7 @@ function eu(e) {
|
|
|
69
69
|
try {
|
|
70
70
|
const n = new URL(u);
|
|
71
71
|
if (ji(n))
|
|
72
|
-
return `${
|
|
72
|
+
return `${Be().chatApiBaseUrl}/file-proxy?uri=${encodeURIComponent(u)}`;
|
|
73
73
|
} catch {
|
|
74
74
|
}
|
|
75
75
|
return u;
|
|
@@ -103,13 +103,13 @@ function po(e) {
|
|
|
103
103
|
return po(n);
|
|
104
104
|
}
|
|
105
105
|
function ji(e) {
|
|
106
|
-
const { appId: t, region: u } =
|
|
106
|
+
const { appId: t, region: u } = Be(), n = `data-${u}.cometchat.io`, a = `/${t}/`;
|
|
107
107
|
return e.hostname.toLowerCase() === n.toLowerCase() && e.pathname.startsWith(a);
|
|
108
108
|
}
|
|
109
109
|
const mo = ":chatCacheScope", go = ":chatCacheOwner";
|
|
110
110
|
let zu, Hu;
|
|
111
111
|
function Rn(e) {
|
|
112
|
-
return `${
|
|
112
|
+
return `${Be().appId}${e}`;
|
|
113
113
|
}
|
|
114
114
|
function Vi() {
|
|
115
115
|
return typeof crypto < "u" && typeof crypto.randomUUID == "function" ? crypto.randomUUID() : `${Date.now()}-${Math.random().toString(36).slice(2)}`;
|
|
@@ -377,19 +377,19 @@ function za() {
|
|
|
377
377
|
function Ha(e) {
|
|
378
378
|
un.value = e;
|
|
379
379
|
}
|
|
380
|
-
function
|
|
380
|
+
function Ne(e, t, u) {
|
|
381
381
|
const n = bo(
|
|
382
382
|
u ?? un.value
|
|
383
383
|
), a = br[n][e] ?? br.en[e];
|
|
384
384
|
return typeof a == "function" ? a(t ?? {}) : a;
|
|
385
385
|
}
|
|
386
|
-
function
|
|
386
|
+
function Oe(e) {
|
|
387
387
|
const t = N(
|
|
388
388
|
() => Ri(e) ?? un.value
|
|
389
389
|
);
|
|
390
390
|
return {
|
|
391
391
|
locale: N(() => Ki(t.value)),
|
|
392
|
-
t: (n, a) =>
|
|
392
|
+
t: (n, a) => Ne(n, a, t.value)
|
|
393
393
|
};
|
|
394
394
|
}
|
|
395
395
|
/*! @license DOMPurify 3.4.1 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.1/LICENSE */
|
|
@@ -424,8 +424,8 @@ Ea || (Ea = function(t) {
|
|
|
424
424
|
n[a - 1] = arguments[a];
|
|
425
425
|
return new t(...n);
|
|
426
426
|
});
|
|
427
|
-
const Pu =
|
|
428
|
-
function
|
|
427
|
+
const Pu = qe(Array.prototype.forEach), es = qe(Array.prototype.lastIndexOf), xr = qe(Array.prototype.pop), $u = qe(Array.prototype.push), ts = qe(Array.prototype.splice), Je = Array.isArray, Zu = qe(String.prototype.toLowerCase), sa = qe(String.prototype.toString), yr = qe(String.prototype.match), lu = qe(String.prototype.replace), _r = qe(String.prototype.indexOf), us = qe(String.prototype.trim), ns = qe(Number.prototype.toString), as = qe(Boolean.prototype.toString), Cr = typeof BigInt > "u" ? null : qe(BigInt.prototype.toString), Tr = typeof Symbol > "u" ? null : qe(Symbol.prototype.toString), Ee = qe(Object.prototype.hasOwnProperty), Bu = qe(Object.prototype.toString), Ve = qe(RegExp.prototype.test), xn = rs(TypeError);
|
|
428
|
+
function qe(e) {
|
|
429
429
|
return function(t) {
|
|
430
430
|
t instanceof RegExp && (t.lastIndex = 0);
|
|
431
431
|
for (var u = arguments.length, n = new Array(u > 1 ? u - 1 : 0), a = 1; a < u; a++)
|
|
@@ -460,10 +460,10 @@ function os(e) {
|
|
|
460
460
|
Ee(e, t) || (e[t] = null);
|
|
461
461
|
return e;
|
|
462
462
|
}
|
|
463
|
-
function
|
|
463
|
+
function nt(e) {
|
|
464
464
|
const t = du(null);
|
|
465
465
|
for (const [u, n] of vo(e))
|
|
466
|
-
Ee(e, u) && (Je(n) ? t[u] = os(n) : n && typeof n == "object" && n.constructor === Object ? t[u] =
|
|
466
|
+
Ee(e, u) && (Je(n) ? t[u] = os(n) : n && typeof n == "object" && n.constructor === Object ? t[u] = nt(n) : t[u] = n);
|
|
467
467
|
return t;
|
|
468
468
|
}
|
|
469
469
|
function is(e) {
|
|
@@ -500,9 +500,9 @@ function fu(e, t) {
|
|
|
500
500
|
const n = Ji(e, t);
|
|
501
501
|
if (n) {
|
|
502
502
|
if (n.get)
|
|
503
|
-
return
|
|
503
|
+
return qe(n.get);
|
|
504
504
|
if (typeof n.value == "function")
|
|
505
|
-
return
|
|
505
|
+
return qe(n.value);
|
|
506
506
|
}
|
|
507
507
|
e = Xi(e);
|
|
508
508
|
}
|
|
@@ -513,7 +513,7 @@ function fu(e, t) {
|
|
|
513
513
|
}
|
|
514
514
|
function ss(e) {
|
|
515
515
|
try {
|
|
516
|
-
return
|
|
516
|
+
return Ve(e, ""), !0;
|
|
517
517
|
} catch {
|
|
518
518
|
return !1;
|
|
519
519
|
}
|
|
@@ -581,7 +581,7 @@ const Nu = {
|
|
|
581
581
|
};
|
|
582
582
|
function _o() {
|
|
583
583
|
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : xs();
|
|
584
|
-
const t = (
|
|
584
|
+
const t = (J) => _o(J);
|
|
585
585
|
if (t.version = "3.4.1", t.removed = [], !e || !e.document || e.document.nodeType !== Nu.document || !e.Element)
|
|
586
586
|
return t.isSupported = !1, t;
|
|
587
587
|
let {
|
|
@@ -599,37 +599,37 @@ function _o() {
|
|
|
599
599
|
trustedTypes: m
|
|
600
600
|
} = e, g = s.prototype, w = fu(g, "cloneNode"), _ = fu(g, "remove"), D = fu(g, "nextSibling"), y = fu(g, "childNodes"), E = fu(g, "parentNode");
|
|
601
601
|
if (typeof o == "function") {
|
|
602
|
-
const
|
|
603
|
-
|
|
602
|
+
const J = u.createElement("template");
|
|
603
|
+
J.content && J.content.ownerDocument && (u = J.content.ownerDocument);
|
|
604
604
|
}
|
|
605
605
|
let C, I = "";
|
|
606
606
|
const {
|
|
607
607
|
implementation: S,
|
|
608
608
|
createNodeIterator: k,
|
|
609
|
-
createDocumentFragment:
|
|
609
|
+
createDocumentFragment: O,
|
|
610
610
|
getElementsByTagName: z
|
|
611
611
|
} = u, {
|
|
612
612
|
importNode: Q
|
|
613
613
|
} = n;
|
|
614
|
-
let
|
|
614
|
+
let W = Er();
|
|
615
615
|
t.isSupported = typeof vo == "function" && typeof E == "function" && S && S.createHTMLDocument !== void 0;
|
|
616
616
|
const {
|
|
617
617
|
MUSTACHE_EXPR: le,
|
|
618
618
|
ERB_EXPR: L,
|
|
619
619
|
TMPLIT_EXPR: B,
|
|
620
|
-
DATA_ATTR:
|
|
621
|
-
ARIA_ATTR:
|
|
620
|
+
DATA_ATTR: Y,
|
|
621
|
+
ARIA_ATTR: ee,
|
|
622
622
|
IS_SCRIPT_OR_DATA: ue,
|
|
623
623
|
ATTR_WHITESPACE: ve,
|
|
624
624
|
CUSTOM_ELEMENT: De
|
|
625
625
|
} = Dr;
|
|
626
626
|
let {
|
|
627
|
-
IS_ALLOWED_URI:
|
|
628
|
-
} = Dr,
|
|
629
|
-
const
|
|
630
|
-
let
|
|
631
|
-
const
|
|
632
|
-
let
|
|
627
|
+
IS_ALLOWED_URI: Le
|
|
628
|
+
} = Dr, me = null;
|
|
629
|
+
const it = ce({}, [...kr, ...la, ...ca, ...da, ...Mr]);
|
|
630
|
+
let xe = null;
|
|
631
|
+
const G = ce({}, [...wr, ...fa, ...Ar, ...yn]);
|
|
632
|
+
let X = Object.seal(du(null, {
|
|
633
633
|
tagNameCheck: {
|
|
634
634
|
writable: !0,
|
|
635
635
|
configurable: !1,
|
|
@@ -648,8 +648,8 @@ function _o() {
|
|
|
648
648
|
enumerable: !0,
|
|
649
649
|
value: !1
|
|
650
650
|
}
|
|
651
|
-
})),
|
|
652
|
-
const
|
|
651
|
+
})), q = null, Ge = null;
|
|
652
|
+
const ge = Object.seal(du(null, {
|
|
653
653
|
tagCheck: {
|
|
654
654
|
writable: !0,
|
|
655
655
|
configurable: !1,
|
|
@@ -663,9 +663,9 @@ function _o() {
|
|
|
663
663
|
value: null
|
|
664
664
|
}
|
|
665
665
|
}));
|
|
666
|
-
let Qe = !0,
|
|
666
|
+
let Qe = !0, Fe = !0, vt = !1, Te = !0, se = !1, ye = !0, gt = !1, yu = !1, _u = !1, It = !1, uu = !1, xt = !1, Cu = !0, Gt = !1;
|
|
667
667
|
const nu = "user-content-";
|
|
668
|
-
let Ft = !0, Rt = !1, Mt = {},
|
|
668
|
+
let Ft = !0, Rt = !1, Mt = {}, tt = null;
|
|
669
669
|
const Tu = ce({}, ["annotation-xml", "audio", "colgroup", "desc", "foreignobject", "head", "iframe", "math", "mi", "mn", "mo", "ms", "mtext", "noembed", "noframes", "noscript", "plaintext", "script", "style", "svg", "template", "thead", "title", "video", "xmp"]);
|
|
670
670
|
let sn = null;
|
|
671
671
|
const Wt = ce({}, ["audio", "video", "img", "source", "image", "track"]);
|
|
@@ -684,10 +684,10 @@ function _o() {
|
|
|
684
684
|
let p = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
685
685
|
if (Lt && Lt === p)
|
|
686
686
|
return;
|
|
687
|
-
(!p || typeof p != "object") && (p = {}), p =
|
|
688
|
-
ua.indexOf(p.PARSER_MEDIA_TYPE) === -1 ? Du : p.PARSER_MEDIA_TYPE, Se = Yt === "application/xhtml+xml" ? sa : Zu,
|
|
689
|
-
const P = Ee(p, "CUSTOM_ELEMENT_HANDLING") && p.CUSTOM_ELEMENT_HANDLING && typeof p.CUSTOM_ELEMENT_HANDLING == "object" ?
|
|
690
|
-
if (
|
|
687
|
+
(!p || typeof p != "object") && (p = {}), p = nt(p), Yt = // eslint-disable-next-line unicorn/prefer-includes
|
|
688
|
+
ua.indexOf(p.PARSER_MEDIA_TYPE) === -1 ? Du : p.PARSER_MEDIA_TYPE, Se = Yt === "application/xhtml+xml" ? sa : Zu, me = Ee(p, "ALLOWED_TAGS") && Je(p.ALLOWED_TAGS) ? ce({}, p.ALLOWED_TAGS, Se) : it, xe = Ee(p, "ALLOWED_ATTR") && Je(p.ALLOWED_ATTR) ? ce({}, p.ALLOWED_ATTR, Se) : G, Mu = Ee(p, "ALLOWED_NAMESPACES") && Je(p.ALLOWED_NAMESPACES) ? ce({}, p.ALLOWED_NAMESPACES, sa) : ea, qt = Ee(p, "ADD_URI_SAFE_ATTR") && Je(p.ADD_URI_SAFE_ATTR) ? ce(nt(ln), p.ADD_URI_SAFE_ATTR, Se) : ln, sn = Ee(p, "ADD_DATA_URI_TAGS") && Je(p.ADD_DATA_URI_TAGS) ? ce(nt(Wt), p.ADD_DATA_URI_TAGS, Se) : Wt, tt = Ee(p, "FORBID_CONTENTS") && Je(p.FORBID_CONTENTS) ? ce({}, p.FORBID_CONTENTS, Se) : Tu, q = Ee(p, "FORBID_TAGS") && Je(p.FORBID_TAGS) ? ce({}, p.FORBID_TAGS, Se) : nt({}), Ge = Ee(p, "FORBID_ATTR") && Je(p.FORBID_ATTR) ? ce({}, p.FORBID_ATTR, Se) : nt({}), Mt = Ee(p, "USE_PROFILES") ? p.USE_PROFILES && typeof p.USE_PROFILES == "object" ? nt(p.USE_PROFILES) : p.USE_PROFILES : !1, Qe = p.ALLOW_ARIA_ATTR !== !1, Fe = p.ALLOW_DATA_ATTR !== !1, vt = p.ALLOW_UNKNOWN_PROTOCOLS || !1, Te = p.ALLOW_SELF_CLOSE_IN_ATTR !== !1, se = p.SAFE_FOR_TEMPLATES || !1, ye = p.SAFE_FOR_XML !== !1, gt = p.WHOLE_DOCUMENT || !1, It = p.RETURN_DOM || !1, uu = p.RETURN_DOM_FRAGMENT || !1, xt = p.RETURN_TRUSTED_TYPE || !1, _u = p.FORCE_BODY || !1, Cu = p.SANITIZE_DOM !== !1, Gt = p.SANITIZE_NAMED_PROPS || !1, Ft = p.KEEP_CONTENT !== !1, Rt = p.IN_PLACE || !1, Le = ss(p.ALLOWED_URI_REGEXP) ? p.ALLOWED_URI_REGEXP : xo, Ot = typeof p.NAMESPACE == "string" ? p.NAMESPACE : ct, wu = Ee(p, "MATHML_TEXT_INTEGRATION_POINTS") && p.MATHML_TEXT_INTEGRATION_POINTS && typeof p.MATHML_TEXT_INTEGRATION_POINTS == "object" ? nt(p.MATHML_TEXT_INTEGRATION_POINTS) : ce({}, ["mi", "mo", "mn", "ms", "mtext"]), Au = Ee(p, "HTML_INTEGRATION_POINTS") && p.HTML_INTEGRATION_POINTS && typeof p.HTML_INTEGRATION_POINTS == "object" ? nt(p.HTML_INTEGRATION_POINTS) : ce({}, ["annotation-xml"]);
|
|
689
|
+
const P = Ee(p, "CUSTOM_ELEMENT_HANDLING") && p.CUSTOM_ELEMENT_HANDLING && typeof p.CUSTOM_ELEMENT_HANDLING == "object" ? nt(p.CUSTOM_ELEMENT_HANDLING) : du(null);
|
|
690
|
+
if (X = du(null), Ee(P, "tagNameCheck") && cn(P.tagNameCheck) && (X.tagNameCheck = P.tagNameCheck), Ee(P, "attributeNameCheck") && cn(P.attributeNameCheck) && (X.attributeNameCheck = P.attributeNameCheck), Ee(P, "allowCustomizedBuiltInElements") && typeof P.allowCustomizedBuiltInElements == "boolean" && (X.allowCustomizedBuiltInElements = P.allowCustomizedBuiltInElements), se && (Fe = !1), uu && (It = !0), Mt && (me = ce({}, Mr), xe = du(null), Mt.html === !0 && (ce(me, kr), ce(xe, wr)), Mt.svg === !0 && (ce(me, la), ce(xe, fa), ce(xe, yn)), Mt.svgFilters === !0 && (ce(me, ca), ce(xe, fa), ce(xe, yn)), Mt.mathMl === !0 && (ce(me, da), ce(xe, Ar), ce(xe, yn))), ge.tagCheck = null, ge.attributeCheck = null, Ee(p, "ADD_TAGS") && (typeof p.ADD_TAGS == "function" ? ge.tagCheck = p.ADD_TAGS : Je(p.ADD_TAGS) && (me === it && (me = nt(me)), ce(me, p.ADD_TAGS, Se))), Ee(p, "ADD_ATTR") && (typeof p.ADD_ATTR == "function" ? ge.attributeCheck = p.ADD_ATTR : Je(p.ADD_ATTR) && (xe === G && (xe = nt(xe)), ce(xe, p.ADD_ATTR, Se))), Ee(p, "ADD_URI_SAFE_ATTR") && Je(p.ADD_URI_SAFE_ATTR) && ce(qt, p.ADD_URI_SAFE_ATTR, Se), Ee(p, "FORBID_CONTENTS") && Je(p.FORBID_CONTENTS) && (tt === Tu && (tt = nt(tt)), ce(tt, p.FORBID_CONTENTS, Se)), Ee(p, "ADD_FORBID_CONTENTS") && Je(p.ADD_FORBID_CONTENTS) && (tt === Tu && (tt = nt(tt)), ce(tt, p.ADD_FORBID_CONTENTS, Se)), Ft && (me["#text"] = !0), gt && ce(me, ["html", "head", "body"]), me.table && (ce(me, ["tbody"]), delete q.tbody), p.TRUSTED_TYPES_POLICY) {
|
|
691
691
|
if (typeof p.TRUSTED_TYPES_POLICY.createHTML != "function")
|
|
692
692
|
throw xn('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
|
|
693
693
|
if (typeof p.TRUSTED_TYPES_POLICY.createScriptURL != "function")
|
|
@@ -702,9 +702,9 @@ function _o() {
|
|
|
702
702
|
namespaceURI: Ot,
|
|
703
703
|
tagName: "template"
|
|
704
704
|
});
|
|
705
|
-
const V = Zu(p.tagName),
|
|
706
|
-
return Mu[p.namespaceURI] ? p.namespaceURI === ru ? P.namespaceURI === ct ? V === "svg" : P.namespaceURI === au ? V === "svg" && (
|
|
707
|
-
},
|
|
705
|
+
const V = Zu(p.tagName), fe = Zu(P.tagName);
|
|
706
|
+
return Mu[p.namespaceURI] ? p.namespaceURI === ru ? P.namespaceURI === ct ? V === "svg" : P.namespaceURI === au ? V === "svg" && (fe === "annotation-xml" || wu[fe]) : !!Su[V] : p.namespaceURI === au ? P.namespaceURI === ct ? V === "math" : P.namespaceURI === ru ? V === "math" && Au[fe] : !!Kt[V] : p.namespaceURI === ct ? P.namespaceURI === ru && !Au[fe] || P.namespaceURI === au && !wu[fe] ? !1 : !Kt[V] && (ta[V] || !Su[V]) : !!(Yt === "application/xhtml+xml" && Mu[p.namespaceURI]) : !1;
|
|
707
|
+
}, ut = function(p) {
|
|
708
708
|
$u(t.removed, {
|
|
709
709
|
element: p
|
|
710
710
|
});
|
|
@@ -728,7 +728,7 @@ function _o() {
|
|
|
728
728
|
if (P.removeAttribute(p), p === "is")
|
|
729
729
|
if (It || uu)
|
|
730
730
|
try {
|
|
731
|
-
|
|
731
|
+
ut(P);
|
|
732
732
|
} catch {
|
|
733
733
|
}
|
|
734
734
|
else
|
|
@@ -745,21 +745,21 @@ function _o() {
|
|
|
745
745
|
V = we && we[0];
|
|
746
746
|
}
|
|
747
747
|
Yt === "application/xhtml+xml" && Ot === ct && (p = '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' + p + "</body></html>");
|
|
748
|
-
const
|
|
748
|
+
const fe = C ? C.createHTML(p) : p;
|
|
749
749
|
if (Ot === ct)
|
|
750
750
|
try {
|
|
751
|
-
P = new x().parseFromString(
|
|
751
|
+
P = new x().parseFromString(fe, Yt);
|
|
752
752
|
} catch {
|
|
753
753
|
}
|
|
754
754
|
if (!P || !P.documentElement) {
|
|
755
755
|
P = S.createDocument(Ot, "template", null);
|
|
756
756
|
try {
|
|
757
|
-
P.documentElement.innerHTML = ku ? I :
|
|
757
|
+
P.documentElement.innerHTML = ku ? I : fe;
|
|
758
758
|
} catch {
|
|
759
759
|
}
|
|
760
760
|
}
|
|
761
|
-
const
|
|
762
|
-
return p && V &&
|
|
761
|
+
const Pe = P.body || P.documentElement;
|
|
762
|
+
return p && V && Pe.insertBefore(u.createTextNode(V), Pe.childNodes[0] || null), Ot === ct ? z.call(P, gt ? "html" : "body")[0] : gt ? P.documentElement : Pe;
|
|
763
763
|
}, fn = function(p) {
|
|
764
764
|
return k.call(
|
|
765
765
|
p.ownerDocument || p,
|
|
@@ -773,60 +773,60 @@ function _o() {
|
|
|
773
773
|
}, Ru = function(p) {
|
|
774
774
|
return typeof i == "function" && p instanceof i;
|
|
775
775
|
};
|
|
776
|
-
function st(
|
|
777
|
-
Pu(
|
|
776
|
+
function st(J, p, P) {
|
|
777
|
+
Pu(J, (V) => {
|
|
778
778
|
V.call(t, p, P, Lt);
|
|
779
779
|
});
|
|
780
780
|
}
|
|
781
781
|
const hn = function(p) {
|
|
782
782
|
let P = null;
|
|
783
|
-
if (st(
|
|
784
|
-
return
|
|
783
|
+
if (st(W.beforeSanitizeElements, p, null), Fu(p))
|
|
784
|
+
return ut(p), !0;
|
|
785
785
|
const V = Se(p.nodeName);
|
|
786
|
-
if (st(
|
|
786
|
+
if (st(W.uponSanitizeElement, p, {
|
|
787
787
|
tagName: V,
|
|
788
|
-
allowedTags:
|
|
789
|
-
}), ye && p.hasChildNodes() && !Ru(p.firstElementChild) &&
|
|
790
|
-
return
|
|
791
|
-
if (
|
|
792
|
-
if (!
|
|
788
|
+
allowedTags: me
|
|
789
|
+
}), ye && p.hasChildNodes() && !Ru(p.firstElementChild) && Ve(/<[/\w!]/g, p.innerHTML) && Ve(/<[/\w!]/g, p.textContent) || ye && p.namespaceURI === ct && V === "style" && Ru(p.firstElementChild) || p.nodeType === Nu.progressingInstruction || ye && p.nodeType === Nu.comment && Ve(/<[/\w]/g, p.data))
|
|
790
|
+
return ut(p), !0;
|
|
791
|
+
if (q[V] || !(ge.tagCheck instanceof Function && ge.tagCheck(V)) && !me[V]) {
|
|
792
|
+
if (!q[V] && qu(V) && (X.tagNameCheck instanceof RegExp && Ve(X.tagNameCheck, V) || X.tagNameCheck instanceof Function && X.tagNameCheck(V)))
|
|
793
793
|
return !1;
|
|
794
|
-
if (Ft && !
|
|
795
|
-
const
|
|
796
|
-
if (
|
|
797
|
-
const we =
|
|
794
|
+
if (Ft && !tt[V]) {
|
|
795
|
+
const fe = E(p) || p.parentNode, Pe = y(p) || p.childNodes;
|
|
796
|
+
if (Pe && fe) {
|
|
797
|
+
const we = Pe.length;
|
|
798
798
|
for (let We = we - 1; We >= 0; --We) {
|
|
799
|
-
const Ye = w(
|
|
800
|
-
|
|
799
|
+
const Ye = w(Pe[We], !0);
|
|
800
|
+
fe.insertBefore(Ye, D(p));
|
|
801
801
|
}
|
|
802
802
|
}
|
|
803
803
|
}
|
|
804
|
-
return
|
|
804
|
+
return ut(p), !0;
|
|
805
805
|
}
|
|
806
|
-
return p instanceof s && !dn(p) || (V === "noscript" || V === "noembed" || V === "noframes") &&
|
|
807
|
-
P = lu(P,
|
|
806
|
+
return p instanceof s && !dn(p) || (V === "noscript" || V === "noembed" || V === "noframes") && Ve(/<\/no(script|embed|frames)/i, p.innerHTML) ? (ut(p), !0) : (se && p.nodeType === Nu.text && (P = p.textContent, Pu([le, L, B], (fe) => {
|
|
807
|
+
P = lu(P, fe, " ");
|
|
808
808
|
}), p.textContent !== P && ($u(t.removed, {
|
|
809
809
|
element: p.cloneNode()
|
|
810
|
-
}), p.textContent = P)), st(
|
|
810
|
+
}), p.textContent = P)), st(W.afterSanitizeElements, p, null), !1);
|
|
811
811
|
}, pn = function(p, P, V) {
|
|
812
|
-
if (
|
|
812
|
+
if (Ge[P] || Cu && (P === "id" || P === "name") && (V in u || V in ou))
|
|
813
813
|
return !1;
|
|
814
|
-
if (!(
|
|
815
|
-
if (!(Qe &&
|
|
816
|
-
if (!(
|
|
817
|
-
if (!
|
|
814
|
+
if (!(Fe && !Ge[P] && Ve(Y, P))) {
|
|
815
|
+
if (!(Qe && Ve(ee, P))) {
|
|
816
|
+
if (!(ge.attributeCheck instanceof Function && ge.attributeCheck(P, p))) {
|
|
817
|
+
if (!xe[P] || Ge[P]) {
|
|
818
818
|
if (
|
|
819
819
|
// First condition does a very basic check if a) it's basically a valid custom element tagname AND
|
|
820
820
|
// b) if the tagName passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
|
|
821
821
|
// and c) if the attribute name passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.attributeNameCheck
|
|
822
|
-
!(qu(p) && (
|
|
822
|
+
!(qu(p) && (X.tagNameCheck instanceof RegExp && Ve(X.tagNameCheck, p) || X.tagNameCheck instanceof Function && X.tagNameCheck(p)) && (X.attributeNameCheck instanceof RegExp && Ve(X.attributeNameCheck, P) || X.attributeNameCheck instanceof Function && X.attributeNameCheck(P, p)) || // Alternative, second condition checks if it's an `is`-attribute, AND
|
|
823
823
|
// the value passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
|
|
824
|
-
P === "is" &&
|
|
824
|
+
P === "is" && X.allowCustomizedBuiltInElements && (X.tagNameCheck instanceof RegExp && Ve(X.tagNameCheck, V) || X.tagNameCheck instanceof Function && X.tagNameCheck(V)))
|
|
825
825
|
) return !1;
|
|
826
826
|
} else if (!qt[P]) {
|
|
827
|
-
if (!
|
|
827
|
+
if (!Ve(Le, lu(V, ve, ""))) {
|
|
828
828
|
if (!((P === "src" || P === "xlink:href" || P === "href") && p !== "script" && _r(V, "data:") === 0 && sn[p])) {
|
|
829
|
-
if (!(vt && !
|
|
829
|
+
if (!(vt && !Ve(ue, lu(V, ve, "")))) {
|
|
830
830
|
if (V)
|
|
831
831
|
return !1;
|
|
832
832
|
}
|
|
@@ -838,9 +838,9 @@ function _o() {
|
|
|
838
838
|
}
|
|
839
839
|
return !0;
|
|
840
840
|
}, Pt = ce({}, ["annotation-xml", "color-profile", "font-face", "font-face-format", "font-face-name", "font-face-src", "font-face-uri", "missing-glyph"]), qu = function(p) {
|
|
841
|
-
return !Pt[Zu(p)] &&
|
|
841
|
+
return !Pt[Zu(p)] && Ve(De, p);
|
|
842
842
|
}, mn = function(p) {
|
|
843
|
-
st(
|
|
843
|
+
st(W.beforeSanitizeAttributes, p, null);
|
|
844
844
|
const {
|
|
845
845
|
attributes: P
|
|
846
846
|
} = p;
|
|
@@ -850,22 +850,22 @@ function _o() {
|
|
|
850
850
|
attrName: "",
|
|
851
851
|
attrValue: "",
|
|
852
852
|
keepAttr: !0,
|
|
853
|
-
allowedAttributes:
|
|
853
|
+
allowedAttributes: xe,
|
|
854
854
|
forceKeepAttr: void 0
|
|
855
855
|
};
|
|
856
|
-
let
|
|
857
|
-
for (;
|
|
858
|
-
const
|
|
856
|
+
let fe = P.length;
|
|
857
|
+
for (; fe--; ) {
|
|
858
|
+
const Pe = P[fe], {
|
|
859
859
|
name: we,
|
|
860
860
|
namespaceURI: We,
|
|
861
861
|
value: Ye
|
|
862
|
-
} = $e
|
|
862
|
+
} = Pe, $e = Se(we), At = Ye;
|
|
863
863
|
let Ie = we === "value" ? At : us(At);
|
|
864
|
-
if (V.attrName =
|
|
864
|
+
if (V.attrName = $e, V.attrValue = Ie, V.keepAttr = !0, V.forceKeepAttr = void 0, st(W.uponSanitizeAttribute, p, V), Ie = V.attrValue, Gt && ($e === "id" || $e === "name") && _r(Ie, nu) !== 0 && (yt(we, p), Ie = nu + Ie), ye && Ve(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, Ie)) {
|
|
865
865
|
yt(we, p);
|
|
866
866
|
continue;
|
|
867
867
|
}
|
|
868
|
-
if (
|
|
868
|
+
if ($e === "attributename" && yr(Ie, "href")) {
|
|
869
869
|
yt(we, p);
|
|
870
870
|
continue;
|
|
871
871
|
}
|
|
@@ -875,7 +875,7 @@ function _o() {
|
|
|
875
875
|
yt(we, p);
|
|
876
876
|
continue;
|
|
877
877
|
}
|
|
878
|
-
if (!Te &&
|
|
878
|
+
if (!Te && Ve(/\/>/i, Ie)) {
|
|
879
879
|
yt(we, p);
|
|
880
880
|
continue;
|
|
881
881
|
}
|
|
@@ -883,12 +883,12 @@ function _o() {
|
|
|
883
883
|
Ie = lu(Ie, bn, " ");
|
|
884
884
|
});
|
|
885
885
|
const gn = Se(p.nodeName);
|
|
886
|
-
if (!pn(gn,
|
|
886
|
+
if (!pn(gn, $e, Ie)) {
|
|
887
887
|
yt(we, p);
|
|
888
888
|
continue;
|
|
889
889
|
}
|
|
890
890
|
if (C && typeof m == "object" && typeof m.getAttributeType == "function" && !We)
|
|
891
|
-
switch (m.getAttributeType(gn,
|
|
891
|
+
switch (m.getAttributeType(gn, $e)) {
|
|
892
892
|
case "TrustedHTML": {
|
|
893
893
|
Ie = C.createHTML(Ie);
|
|
894
894
|
break;
|
|
@@ -900,88 +900,88 @@ function _o() {
|
|
|
900
900
|
}
|
|
901
901
|
if (Ie !== At)
|
|
902
902
|
try {
|
|
903
|
-
We ? p.setAttributeNS(We, we, Ie) : p.setAttribute(we, Ie), Fu(p) ?
|
|
903
|
+
We ? p.setAttributeNS(We, we, Ie) : p.setAttribute(we, Ie), Fu(p) ? ut(p) : xr(t.removed);
|
|
904
904
|
} catch {
|
|
905
905
|
yt(we, p);
|
|
906
906
|
}
|
|
907
907
|
}
|
|
908
|
-
st(
|
|
908
|
+
st(W.afterSanitizeAttributes, p, null);
|
|
909
909
|
}, wt = function(p) {
|
|
910
910
|
let P = null;
|
|
911
911
|
const V = fn(p);
|
|
912
|
-
for (st(
|
|
913
|
-
st(
|
|
914
|
-
st(
|
|
912
|
+
for (st(W.beforeSanitizeShadowDOM, p, null); P = V.nextNode(); )
|
|
913
|
+
st(W.uponSanitizeShadowNode, P, null), hn(P), mn(P), P.content instanceof r && wt(P.content);
|
|
914
|
+
st(W.afterSanitizeShadowDOM, p, null);
|
|
915
915
|
};
|
|
916
|
-
return t.sanitize = function(
|
|
917
|
-
let p = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, P = null, V = null,
|
|
918
|
-
if (ku = !
|
|
916
|
+
return t.sanitize = function(J) {
|
|
917
|
+
let p = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, P = null, V = null, fe = null, Pe = null;
|
|
918
|
+
if (ku = !J, ku && (J = "<!-->"), typeof J != "string" && !Ru(J) && (J = is(J), typeof J != "string"))
|
|
919
919
|
throw xn("dirty is not a string, aborting");
|
|
920
920
|
if (!t.isSupported)
|
|
921
|
-
return
|
|
922
|
-
if (yu || Eu(p), t.removed = [], typeof
|
|
923
|
-
const Ye =
|
|
921
|
+
return J;
|
|
922
|
+
if (yu || Eu(p), t.removed = [], typeof J == "string" && (Rt = !1), Rt) {
|
|
923
|
+
const Ye = J.nodeName;
|
|
924
924
|
if (typeof Ye == "string") {
|
|
925
|
-
const
|
|
926
|
-
if (!
|
|
925
|
+
const $e = Se(Ye);
|
|
926
|
+
if (!me[$e] || q[$e])
|
|
927
927
|
throw xn("root node is forbidden and cannot be sanitized in-place");
|
|
928
928
|
}
|
|
929
|
-
} else if (
|
|
930
|
-
P = Iu("<!---->"), V = P.ownerDocument.importNode(
|
|
929
|
+
} else if (J instanceof i)
|
|
930
|
+
P = Iu("<!---->"), V = P.ownerDocument.importNode(J, !0), V.nodeType === Nu.element && V.nodeName === "BODY" || V.nodeName === "HTML" ? P = V : P.appendChild(V);
|
|
931
931
|
else {
|
|
932
932
|
if (!It && !se && !gt && // eslint-disable-next-line unicorn/prefer-includes
|
|
933
|
-
|
|
934
|
-
return C && xt ? C.createHTML(
|
|
935
|
-
if (P = Iu(
|
|
933
|
+
J.indexOf("<") === -1)
|
|
934
|
+
return C && xt ? C.createHTML(J) : J;
|
|
935
|
+
if (P = Iu(J), !P)
|
|
936
936
|
return It ? null : xt ? I : "";
|
|
937
937
|
}
|
|
938
|
-
P && _u &&
|
|
939
|
-
const we = fn(Rt ?
|
|
940
|
-
for (;
|
|
941
|
-
hn(
|
|
938
|
+
P && _u && ut(P.firstChild);
|
|
939
|
+
const we = fn(Rt ? J : P);
|
|
940
|
+
for (; fe = we.nextNode(); )
|
|
941
|
+
hn(fe), mn(fe), fe.content instanceof r && wt(fe.content);
|
|
942
942
|
if (Rt)
|
|
943
|
-
return
|
|
943
|
+
return J;
|
|
944
944
|
if (It) {
|
|
945
945
|
if (se) {
|
|
946
946
|
P.normalize();
|
|
947
947
|
let Ye = P.innerHTML;
|
|
948
|
-
Pu([le, L, B], (
|
|
949
|
-
Ye = lu(Ye,
|
|
948
|
+
Pu([le, L, B], ($e) => {
|
|
949
|
+
Ye = lu(Ye, $e, " ");
|
|
950
950
|
}), P.innerHTML = Ye;
|
|
951
951
|
}
|
|
952
952
|
if (uu)
|
|
953
|
-
for (
|
|
954
|
-
|
|
953
|
+
for (Pe = O.call(P.ownerDocument); P.firstChild; )
|
|
954
|
+
Pe.appendChild(P.firstChild);
|
|
955
955
|
else
|
|
956
|
-
|
|
957
|
-
return (
|
|
956
|
+
Pe = P;
|
|
957
|
+
return (xe.shadowroot || xe.shadowrootmode) && (Pe = Q.call(n, Pe, !0)), Pe;
|
|
958
958
|
}
|
|
959
959
|
let We = gt ? P.outerHTML : P.innerHTML;
|
|
960
|
-
return gt &&
|
|
960
|
+
return gt && me["!doctype"] && P.ownerDocument && P.ownerDocument.doctype && P.ownerDocument.doctype.name && Ve(yo, P.ownerDocument.doctype.name) && (We = "<!DOCTYPE " + P.ownerDocument.doctype.name + `>
|
|
961
961
|
` + We), se && Pu([le, L, B], (Ye) => {
|
|
962
962
|
We = lu(We, Ye, " ");
|
|
963
963
|
}), C && xt ? C.createHTML(We) : We;
|
|
964
964
|
}, t.setConfig = function() {
|
|
965
|
-
let
|
|
966
|
-
Eu(
|
|
965
|
+
let J = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
966
|
+
Eu(J), yu = !0;
|
|
967
967
|
}, t.clearConfig = function() {
|
|
968
968
|
Lt = null, yu = !1;
|
|
969
|
-
}, t.isValidAttribute = function(
|
|
969
|
+
}, t.isValidAttribute = function(J, p, P) {
|
|
970
970
|
Lt || Eu({});
|
|
971
|
-
const V = Se(
|
|
972
|
-
return pn(V,
|
|
973
|
-
}, t.addHook = function(
|
|
974
|
-
typeof p == "function" && $u(
|
|
975
|
-
}, t.removeHook = function(
|
|
971
|
+
const V = Se(J), fe = Se(p);
|
|
972
|
+
return pn(V, fe, P);
|
|
973
|
+
}, t.addHook = function(J, p) {
|
|
974
|
+
typeof p == "function" && $u(W[J], p);
|
|
975
|
+
}, t.removeHook = function(J, p) {
|
|
976
976
|
if (p !== void 0) {
|
|
977
|
-
const P = es(
|
|
978
|
-
return P === -1 ? void 0 : ts(
|
|
977
|
+
const P = es(W[J], p);
|
|
978
|
+
return P === -1 ? void 0 : ts(W[J], P, 1)[0];
|
|
979
979
|
}
|
|
980
|
-
return xr(
|
|
981
|
-
}, t.removeHooks = function(
|
|
982
|
-
|
|
980
|
+
return xr(W[J]);
|
|
981
|
+
}, t.removeHooks = function(J) {
|
|
982
|
+
W[J] = [];
|
|
983
983
|
}, t.removeAllHooks = function() {
|
|
984
|
-
|
|
984
|
+
W = Er();
|
|
985
985
|
}, t;
|
|
986
986
|
}
|
|
987
987
|
var Co = _o();
|
|
@@ -1226,42 +1226,42 @@ function $s(e) {
|
|
|
1226
1226
|
var t;
|
|
1227
1227
|
return e >= 55296 && e <= 57343 || e > 1114111 ? 65533 : (t = Ls.get(e)) !== null && t !== void 0 ? t : e;
|
|
1228
1228
|
}
|
|
1229
|
-
var
|
|
1229
|
+
var Ze;
|
|
1230
1230
|
(function(e) {
|
|
1231
1231
|
e[e.NUM = 35] = "NUM", e[e.SEMI = 59] = "SEMI", e[e.EQUALS = 61] = "EQUALS", e[e.ZERO = 48] = "ZERO", e[e.NINE = 57] = "NINE", e[e.LOWER_A = 97] = "LOWER_A", e[e.LOWER_F = 102] = "LOWER_F", e[e.LOWER_X = 120] = "LOWER_X", e[e.LOWER_Z = 122] = "LOWER_Z", e[e.UPPER_A = 65] = "UPPER_A", e[e.UPPER_F = 70] = "UPPER_F", e[e.UPPER_Z = 90] = "UPPER_Z";
|
|
1232
|
-
})(
|
|
1232
|
+
})(Ze || (Ze = {}));
|
|
1233
1233
|
const Bs = 32;
|
|
1234
1234
|
var Zt;
|
|
1235
1235
|
(function(e) {
|
|
1236
1236
|
e[e.VALUE_LENGTH = 49152] = "VALUE_LENGTH", e[e.BRANCH_LENGTH = 16256] = "BRANCH_LENGTH", e[e.JUMP_TABLE = 127] = "JUMP_TABLE";
|
|
1237
1237
|
})(Zt || (Zt = {}));
|
|
1238
1238
|
function Sa(e) {
|
|
1239
|
-
return e >=
|
|
1239
|
+
return e >= Ze.ZERO && e <= Ze.NINE;
|
|
1240
1240
|
}
|
|
1241
1241
|
function Ns(e) {
|
|
1242
|
-
return e >=
|
|
1242
|
+
return e >= Ze.UPPER_A && e <= Ze.UPPER_F || e >= Ze.LOWER_A && e <= Ze.LOWER_F;
|
|
1243
1243
|
}
|
|
1244
1244
|
function Us(e) {
|
|
1245
|
-
return e >=
|
|
1245
|
+
return e >= Ze.UPPER_A && e <= Ze.UPPER_Z || e >= Ze.LOWER_A && e <= Ze.LOWER_Z || Sa(e);
|
|
1246
1246
|
}
|
|
1247
1247
|
function zs(e) {
|
|
1248
|
-
return e ===
|
|
1248
|
+
return e === Ze.EQUALS || Us(e);
|
|
1249
1249
|
}
|
|
1250
|
-
var
|
|
1250
|
+
var Ue;
|
|
1251
1251
|
(function(e) {
|
|
1252
1252
|
e[e.EntityStart = 0] = "EntityStart", e[e.NumericStart = 1] = "NumericStart", e[e.NumericDecimal = 2] = "NumericDecimal", e[e.NumericHex = 3] = "NumericHex", e[e.NamedEntity = 4] = "NamedEntity";
|
|
1253
|
-
})(
|
|
1253
|
+
})(Ue || (Ue = {}));
|
|
1254
1254
|
var Ht;
|
|
1255
1255
|
(function(e) {
|
|
1256
1256
|
e[e.Legacy = 0] = "Legacy", e[e.Strict = 1] = "Strict", e[e.Attribute = 2] = "Attribute";
|
|
1257
1257
|
})(Ht || (Ht = {}));
|
|
1258
1258
|
class Hs {
|
|
1259
1259
|
constructor(t, u, n) {
|
|
1260
|
-
this.decodeTree = t, this.emitCodePoint = u, this.errors = n, this.state =
|
|
1260
|
+
this.decodeTree = t, this.emitCodePoint = u, this.errors = n, this.state = Ue.EntityStart, this.consumed = 1, this.result = 0, this.treeIndex = 0, this.excess = 1, this.decodeMode = Ht.Strict;
|
|
1261
1261
|
}
|
|
1262
1262
|
/** Resets the instance to make it reusable. */
|
|
1263
1263
|
startEntity(t) {
|
|
1264
|
-
this.decodeMode = t, this.state =
|
|
1264
|
+
this.decodeMode = t, this.state = Ue.EntityStart, this.result = 0, this.treeIndex = 0, this.excess = 1, this.consumed = 1;
|
|
1265
1265
|
}
|
|
1266
1266
|
/**
|
|
1267
1267
|
* Write an entity to the decoder. This can be called multiple times with partial entities.
|
|
@@ -1276,15 +1276,15 @@ class Hs {
|
|
|
1276
1276
|
*/
|
|
1277
1277
|
write(t, u) {
|
|
1278
1278
|
switch (this.state) {
|
|
1279
|
-
case
|
|
1280
|
-
return t.charCodeAt(u) ===
|
|
1281
|
-
case
|
|
1279
|
+
case Ue.EntityStart:
|
|
1280
|
+
return t.charCodeAt(u) === Ze.NUM ? (this.state = Ue.NumericStart, this.consumed += 1, this.stateNumericStart(t, u + 1)) : (this.state = Ue.NamedEntity, this.stateNamedEntity(t, u));
|
|
1281
|
+
case Ue.NumericStart:
|
|
1282
1282
|
return this.stateNumericStart(t, u);
|
|
1283
|
-
case
|
|
1283
|
+
case Ue.NumericDecimal:
|
|
1284
1284
|
return this.stateNumericDecimal(t, u);
|
|
1285
|
-
case
|
|
1285
|
+
case Ue.NumericHex:
|
|
1286
1286
|
return this.stateNumericHex(t, u);
|
|
1287
|
-
case
|
|
1287
|
+
case Ue.NamedEntity:
|
|
1288
1288
|
return this.stateNamedEntity(t, u);
|
|
1289
1289
|
}
|
|
1290
1290
|
}
|
|
@@ -1298,7 +1298,7 @@ class Hs {
|
|
|
1298
1298
|
* @returns The number of characters that were consumed, or -1 if the entity is incomplete.
|
|
1299
1299
|
*/
|
|
1300
1300
|
stateNumericStart(t, u) {
|
|
1301
|
-
return u >= t.length ? -1 : (t.charCodeAt(u) | Bs) ===
|
|
1301
|
+
return u >= t.length ? -1 : (t.charCodeAt(u) | Bs) === Ze.LOWER_X ? (this.state = Ue.NumericHex, this.consumed += 1, this.stateNumericHex(t, u + 1)) : (this.state = Ue.NumericDecimal, this.stateNumericDecimal(t, u));
|
|
1302
1302
|
}
|
|
1303
1303
|
addToNumericResult(t, u, n, a) {
|
|
1304
1304
|
if (u !== n) {
|
|
@@ -1363,11 +1363,11 @@ class Hs {
|
|
|
1363
1363
|
var n;
|
|
1364
1364
|
if (this.consumed <= u)
|
|
1365
1365
|
return (n = this.errors) === null || n === void 0 || n.absenceOfDigitsInNumericCharacterReference(this.consumed), 0;
|
|
1366
|
-
if (t ===
|
|
1366
|
+
if (t === Ze.SEMI)
|
|
1367
1367
|
this.consumed += 1;
|
|
1368
1368
|
else if (this.decodeMode === Ht.Strict)
|
|
1369
1369
|
return 0;
|
|
1370
|
-
return this.emitCodePoint($s(this.result), this.consumed), this.errors && (t !==
|
|
1370
|
+
return this.emitCodePoint($s(this.result), this.consumed), this.errors && (t !== Ze.SEMI && this.errors.missingSemicolonAfterCharacterReference(), this.errors.validateNumericCharacterReference(this.result)), this.consumed;
|
|
1371
1371
|
}
|
|
1372
1372
|
/**
|
|
1373
1373
|
* Parses a named entity.
|
|
@@ -1389,7 +1389,7 @@ class Hs {
|
|
|
1389
1389
|
(r === 0 || // And there should be no invalid characters.
|
|
1390
1390
|
zs(o)) ? 0 : this.emitNotTerminatedNamedEntity();
|
|
1391
1391
|
if (a = n[this.treeIndex], r = (a & Zt.VALUE_LENGTH) >> 14, r !== 0) {
|
|
1392
|
-
if (o ===
|
|
1392
|
+
if (o === Ze.SEMI)
|
|
1393
1393
|
return this.emitNamedEntityData(this.treeIndex, r, this.consumed + this.excess);
|
|
1394
1394
|
this.decodeMode !== Ht.Strict && (this.result = this.treeIndex, this.consumed += this.excess, this.excess = 0);
|
|
1395
1395
|
}
|
|
@@ -1429,15 +1429,15 @@ class Hs {
|
|
|
1429
1429
|
end() {
|
|
1430
1430
|
var t;
|
|
1431
1431
|
switch (this.state) {
|
|
1432
|
-
case
|
|
1432
|
+
case Ue.NamedEntity:
|
|
1433
1433
|
return this.result !== 0 && (this.decodeMode !== Ht.Attribute || this.result === this.treeIndex) ? this.emitNotTerminatedNamedEntity() : 0;
|
|
1434
|
-
case
|
|
1434
|
+
case Ue.NumericDecimal:
|
|
1435
1435
|
return this.emitNumericEntity(0, 2);
|
|
1436
|
-
case
|
|
1436
|
+
case Ue.NumericHex:
|
|
1437
1437
|
return this.emitNumericEntity(0, 3);
|
|
1438
|
-
case
|
|
1438
|
+
case Ue.NumericStart:
|
|
1439
1439
|
return (t = this.errors) === null || t === void 0 || t.absenceOfDigitsInNumericCharacterReference(this.consumed), 0;
|
|
1440
|
-
case
|
|
1440
|
+
case Ue.EntityStart:
|
|
1441
1441
|
return 0;
|
|
1442
1442
|
}
|
|
1443
1443
|
}
|
|
@@ -1867,16 +1867,16 @@ bu.prototype.render = function(e, t, u) {
|
|
|
1867
1867
|
}
|
|
1868
1868
|
return n;
|
|
1869
1869
|
};
|
|
1870
|
-
function
|
|
1870
|
+
function ot() {
|
|
1871
1871
|
this.__rules__ = [], this.__cache__ = null;
|
|
1872
1872
|
}
|
|
1873
|
-
|
|
1873
|
+
ot.prototype.__find__ = function(e) {
|
|
1874
1874
|
for (let t = 0; t < this.__rules__.length; t++)
|
|
1875
1875
|
if (this.__rules__[t].name === e)
|
|
1876
1876
|
return t;
|
|
1877
1877
|
return -1;
|
|
1878
1878
|
};
|
|
1879
|
-
|
|
1879
|
+
ot.prototype.__compile__ = function() {
|
|
1880
1880
|
const e = this, t = [""];
|
|
1881
1881
|
e.__rules__.forEach(function(u) {
|
|
1882
1882
|
u.enabled && u.alt.forEach(function(n) {
|
|
@@ -1888,13 +1888,13 @@ it.prototype.__compile__ = function() {
|
|
|
1888
1888
|
});
|
|
1889
1889
|
});
|
|
1890
1890
|
};
|
|
1891
|
-
|
|
1891
|
+
ot.prototype.at = function(e, t, u) {
|
|
1892
1892
|
const n = this.__find__(e), a = u || {};
|
|
1893
1893
|
if (n === -1)
|
|
1894
1894
|
throw new Error("Parser rule not found: " + e);
|
|
1895
1895
|
this.__rules__[n].fn = t, this.__rules__[n].alt = a.alt || [], this.__cache__ = null;
|
|
1896
1896
|
};
|
|
1897
|
-
|
|
1897
|
+
ot.prototype.before = function(e, t, u, n) {
|
|
1898
1898
|
const a = this.__find__(e), r = n || {};
|
|
1899
1899
|
if (a === -1)
|
|
1900
1900
|
throw new Error("Parser rule not found: " + e);
|
|
@@ -1905,7 +1905,7 @@ it.prototype.before = function(e, t, u, n) {
|
|
|
1905
1905
|
alt: r.alt || []
|
|
1906
1906
|
}), this.__cache__ = null;
|
|
1907
1907
|
};
|
|
1908
|
-
|
|
1908
|
+
ot.prototype.after = function(e, t, u, n) {
|
|
1909
1909
|
const a = this.__find__(e), r = n || {};
|
|
1910
1910
|
if (a === -1)
|
|
1911
1911
|
throw new Error("Parser rule not found: " + e);
|
|
@@ -1916,7 +1916,7 @@ it.prototype.after = function(e, t, u, n) {
|
|
|
1916
1916
|
alt: r.alt || []
|
|
1917
1917
|
}), this.__cache__ = null;
|
|
1918
1918
|
};
|
|
1919
|
-
|
|
1919
|
+
ot.prototype.push = function(e, t, u) {
|
|
1920
1920
|
const n = u || {};
|
|
1921
1921
|
this.__rules__.push({
|
|
1922
1922
|
name: e,
|
|
@@ -1925,7 +1925,7 @@ it.prototype.push = function(e, t, u) {
|
|
|
1925
1925
|
alt: n.alt || []
|
|
1926
1926
|
}), this.__cache__ = null;
|
|
1927
1927
|
};
|
|
1928
|
-
|
|
1928
|
+
ot.prototype.enable = function(e, t) {
|
|
1929
1929
|
Array.isArray(e) || (e = [e]);
|
|
1930
1930
|
const u = [];
|
|
1931
1931
|
return e.forEach(function(n) {
|
|
@@ -1938,12 +1938,12 @@ it.prototype.enable = function(e, t) {
|
|
|
1938
1938
|
this.__rules__[a].enabled = !0, u.push(n);
|
|
1939
1939
|
}, this), this.__cache__ = null, u;
|
|
1940
1940
|
};
|
|
1941
|
-
|
|
1941
|
+
ot.prototype.enableOnly = function(e, t) {
|
|
1942
1942
|
Array.isArray(e) || (e = [e]), this.__rules__.forEach(function(u) {
|
|
1943
1943
|
u.enabled = !1;
|
|
1944
1944
|
}), this.enable(e, t);
|
|
1945
1945
|
};
|
|
1946
|
-
|
|
1946
|
+
ot.prototype.disable = function(e, t) {
|
|
1947
1947
|
Array.isArray(e) || (e = [e]);
|
|
1948
1948
|
const u = [];
|
|
1949
1949
|
return e.forEach(function(n) {
|
|
@@ -1956,7 +1956,7 @@ it.prototype.disable = function(e, t) {
|
|
|
1956
1956
|
this.__rules__[a].enabled = !1, u.push(n);
|
|
1957
1957
|
}, this), this.__cache__ = null, u;
|
|
1958
1958
|
};
|
|
1959
|
-
|
|
1959
|
+
ot.prototype.getRules = function(e) {
|
|
1960
1960
|
return this.__cache__ === null && this.__compile__(), this.__cache__[e] || [];
|
|
1961
1961
|
};
|
|
1962
1962
|
function bt(e, t, u) {
|
|
@@ -2190,7 +2190,7 @@ const pa = [
|
|
|
2190
2190
|
["text_join", Sl]
|
|
2191
2191
|
];
|
|
2192
2192
|
function Ya() {
|
|
2193
|
-
this.ruler = new
|
|
2193
|
+
this.ruler = new ot();
|
|
2194
2194
|
for (let e = 0; e < pa.length; e++)
|
|
2195
2195
|
this.ruler.push(pa[e][0], pa[e][1]);
|
|
2196
2196
|
}
|
|
@@ -2367,8 +2367,8 @@ function Fl(e, t, u, n) {
|
|
|
2367
2367
|
for (let S = 0; S < f; S++) {
|
|
2368
2368
|
const k = e.push("td_open", "td", 1);
|
|
2369
2369
|
d[S] && (k.attrs = [["style", "text-align:" + d[S]]]);
|
|
2370
|
-
const
|
|
2371
|
-
|
|
2370
|
+
const O = e.push("inline", "", 0);
|
|
2371
|
+
O.content = l[S] ? l[S].trim() : "", O.children = [], e.push("td_close", "td", -1);
|
|
2372
2372
|
}
|
|
2373
2373
|
e.push("tr_close", "tr", -1);
|
|
2374
2374
|
}
|
|
@@ -2438,16 +2438,16 @@ function Ol(e, t, u, n) {
|
|
|
2438
2438
|
if (e.src.charCodeAt(a++) === 62 && !E) {
|
|
2439
2439
|
let I = e.sCount[g] + 1, S, k;
|
|
2440
2440
|
e.src.charCodeAt(a) === 32 ? (a++, I++, k = !1, S = !0) : e.src.charCodeAt(a) === 9 ? (S = !0, (e.bsCount[g] + I) % 4 === 3 ? (a++, I++, k = !1) : k = !0) : S = !1;
|
|
2441
|
-
let
|
|
2441
|
+
let O = I;
|
|
2442
2442
|
for (i.push(e.bMarks[g]), e.bMarks[g] = a; a < r; ) {
|
|
2443
2443
|
const z = e.src.charCodeAt(a);
|
|
2444
2444
|
if (ke(z))
|
|
2445
|
-
z === 9 ?
|
|
2445
|
+
z === 9 ? O += 4 - (O + e.bsCount[g] + (k ? 1 : 0)) % 4 : O++;
|
|
2446
2446
|
else
|
|
2447
2447
|
break;
|
|
2448
2448
|
a++;
|
|
2449
2449
|
}
|
|
2450
|
-
m = a >= r, s.push(e.bsCount[g]), e.bsCount[g] = e.sCount[g] + 1 + (S ? 1 : 0), l.push(e.sCount[g]), e.sCount[g] =
|
|
2450
|
+
m = a >= r, s.push(e.bsCount[g]), e.bsCount[g] = e.sCount[g] + 1 + (S ? 1 : 0), l.push(e.sCount[g]), e.sCount[g] = O - I, d.push(e.tShift[g]), e.tShift[g] = a - e.bMarks[g];
|
|
2451
2451
|
continue;
|
|
2452
2452
|
}
|
|
2453
2453
|
if (m)
|
|
@@ -2567,10 +2567,10 @@ function $l(e, t, u, n) {
|
|
|
2567
2567
|
const C = e.sCount[s] + m - (e.bMarks[s] + e.tShift[s]);
|
|
2568
2568
|
let I = C;
|
|
2569
2569
|
for (; r < a; ) {
|
|
2570
|
-
const
|
|
2571
|
-
if (
|
|
2570
|
+
const Y = e.src.charCodeAt(r);
|
|
2571
|
+
if (Y === 9)
|
|
2572
2572
|
I += 4 - (I + e.bsCount[s]) % 4;
|
|
2573
|
-
else if (
|
|
2573
|
+
else if (Y === 32)
|
|
2574
2574
|
I++;
|
|
2575
2575
|
else
|
|
2576
2576
|
break;
|
|
@@ -2579,16 +2579,16 @@ function $l(e, t, u, n) {
|
|
|
2579
2579
|
const S = r;
|
|
2580
2580
|
let k;
|
|
2581
2581
|
S >= a ? k = 1 : k = I - C, k > 4 && (k = 1);
|
|
2582
|
-
const
|
|
2582
|
+
const O = C + k;
|
|
2583
2583
|
i = e.push("list_item_open", "li", 1), i.markup = String.fromCharCode(g);
|
|
2584
2584
|
const z = [s, 0];
|
|
2585
2585
|
i.map = z, f && (i.info = e.src.slice(o, m - 1));
|
|
2586
|
-
const Q = e.tight,
|
|
2587
|
-
if (e.listIndent = e.blkIndent, e.blkIndent =
|
|
2586
|
+
const Q = e.tight, W = e.tShift[s], le = e.sCount[s], L = e.listIndent;
|
|
2587
|
+
if (e.listIndent = e.blkIndent, e.blkIndent = O, e.tight = !0, e.tShift[s] = S - e.bMarks[s], e.sCount[s] = I, S >= a && e.isEmpty(s + 1) ? e.line = Math.min(e.line + 2, u) : e.md.block.tokenize(e, s, u, !0), (!e.tight || D) && (l = !1), D = e.line - s > 1 && e.isEmpty(e.line - 1), e.blkIndent = e.listIndent, e.listIndent = L, e.tShift[s] = W, e.sCount[s] = le, e.tight = Q, i = e.push("list_item_close", "li", -1), i.markup = String.fromCharCode(g), s = e.line, z[1] = s, s >= u || e.sCount[s] < e.blkIndent || e.sCount[s] - e.blkIndent >= 4)
|
|
2588
2588
|
break;
|
|
2589
2589
|
let B = !1;
|
|
2590
|
-
for (let
|
|
2591
|
-
if (y[
|
|
2590
|
+
for (let Y = 0, ee = y.length; Y < ee; Y++)
|
|
2591
|
+
if (y[Y](e, s, u, !0)) {
|
|
2592
2592
|
B = !0;
|
|
2593
2593
|
break;
|
|
2594
2594
|
}
|
|
@@ -2615,15 +2615,15 @@ function Bl(e, t, u, n) {
|
|
|
2615
2615
|
return null;
|
|
2616
2616
|
let C = !1;
|
|
2617
2617
|
if (e.sCount[y] - e.blkIndent > 3 && (C = !0), e.sCount[y] < 0 && (C = !0), !C) {
|
|
2618
|
-
const k = e.md.block.ruler.getRules("reference"),
|
|
2618
|
+
const k = e.md.block.ruler.getRules("reference"), O = e.parentType;
|
|
2619
2619
|
e.parentType = "reference";
|
|
2620
2620
|
let z = !1;
|
|
2621
|
-
for (let Q = 0,
|
|
2621
|
+
for (let Q = 0, W = k.length; Q < W; Q++)
|
|
2622
2622
|
if (k[Q](e, y, E, !0)) {
|
|
2623
2623
|
z = !0;
|
|
2624
2624
|
break;
|
|
2625
2625
|
}
|
|
2626
|
-
if (e.parentType =
|
|
2626
|
+
if (e.parentType = O, z)
|
|
2627
2627
|
return null;
|
|
2628
2628
|
}
|
|
2629
2629
|
const I = e.bMarks[y] + e.tShift[y], S = e.eMarks[y];
|
|
@@ -2893,7 +2893,7 @@ const Cn = [
|
|
|
2893
2893
|
["paragraph", uc]
|
|
2894
2894
|
];
|
|
2895
2895
|
function jn() {
|
|
2896
|
-
this.ruler = new
|
|
2896
|
+
this.ruler = new ot();
|
|
2897
2897
|
for (let e = 0; e < Cn.length; e++)
|
|
2898
2898
|
this.ruler.push(Cn[e][0], Cn[e][1], { alt: (Cn[e][2] || []).slice() });
|
|
2899
2899
|
}
|
|
@@ -3429,10 +3429,10 @@ const ga = [
|
|
|
3429
3429
|
["fragments_join", Ac]
|
|
3430
3430
|
];
|
|
3431
3431
|
function rn() {
|
|
3432
|
-
this.ruler = new
|
|
3432
|
+
this.ruler = new ot();
|
|
3433
3433
|
for (let e = 0; e < ga.length; e++)
|
|
3434
3434
|
this.ruler.push(ga[e][0], ga[e][1]);
|
|
3435
|
-
this.ruler2 = new
|
|
3435
|
+
this.ruler2 = new ot();
|
|
3436
3436
|
for (let e = 0; e < ba.length; e++)
|
|
3437
3437
|
this.ruler2.push(ba[e][0], ba[e][1]);
|
|
3438
3438
|
}
|
|
@@ -4216,18 +4216,18 @@ function _0(e, t) {
|
|
|
4216
4216
|
return t;
|
|
4217
4217
|
switch (e.kind) {
|
|
4218
4218
|
case "image":
|
|
4219
|
-
return
|
|
4219
|
+
return Ne("photo");
|
|
4220
4220
|
case "video":
|
|
4221
|
-
return
|
|
4221
|
+
return Ne("video");
|
|
4222
4222
|
case "audio":
|
|
4223
|
-
return
|
|
4223
|
+
return Ne("audio");
|
|
4224
4224
|
case "file":
|
|
4225
4225
|
return e.name || t;
|
|
4226
4226
|
default:
|
|
4227
4227
|
return t;
|
|
4228
4228
|
}
|
|
4229
4229
|
}
|
|
4230
|
-
function Ja(e, t =
|
|
4230
|
+
function Ja(e, t = Ne("attachment")) {
|
|
4231
4231
|
return _0(e[0], t);
|
|
4232
4232
|
}
|
|
4233
4233
|
function Qt(e) {
|
|
@@ -4239,7 +4239,7 @@ function jt(e) {
|
|
|
4239
4239
|
function vu(e) {
|
|
4240
4240
|
return Xa(e);
|
|
4241
4241
|
}
|
|
4242
|
-
function xu(e, t =
|
|
4242
|
+
function xu(e, t = Ne("message")) {
|
|
4243
4243
|
if (e.kind === "poll" && e.poll)
|
|
4244
4244
|
return e.poll.question;
|
|
4245
4245
|
const u = vu(e.text);
|
|
@@ -4248,7 +4248,7 @@ function xu(e, t = Ue("message")) {
|
|
|
4248
4248
|
function C0(e) {
|
|
4249
4249
|
return xu(
|
|
4250
4250
|
e,
|
|
4251
|
-
e.attachments.length > 0 ?
|
|
4251
|
+
e.attachments.length > 0 ? Ne("attachment") : Ne("message")
|
|
4252
4252
|
);
|
|
4253
4253
|
}
|
|
4254
4254
|
function T0(e, t = !1, u = !0) {
|
|
@@ -4264,8 +4264,8 @@ function T0(e, t = !1, u = !0) {
|
|
|
4264
4264
|
return k === "image" ? `${t ? "🖼️ " : ""}${S || "Photo"}` : k === "video" ? `${t ? "🎥 " : ""}${S || I || "Video"}` : k === "audio" ? `${t ? "🎤 " : ""}${I || "Audio message"}` : k === "file" ? `${t ? "📄 " : ""}${S || I || "File"}` : `${t ? "🖼️ " : ""}${S || I || "Media message"}`;
|
|
4265
4265
|
}
|
|
4266
4266
|
if (e instanceof j.Action) {
|
|
4267
|
-
const S = (((g = (m = (x = e.getActionFor) == null ? void 0 : x.call(e)) == null ? void 0 : m.getMetadata) == null ? void 0 : g.call(m)) ?? ((D = (_ = (w = e.getReceiver) == null ? void 0 : w.call(e)) == null ? void 0 : _.getMetadata) == null ? void 0 : D.call(_)) ?? {}).systemDisplayName, k = (y = e.getActionBy) == null ? void 0 : y.call(e),
|
|
4268
|
-
return typeof S == "string" && S.trim() &&
|
|
4267
|
+
const S = (((g = (m = (x = e.getActionFor) == null ? void 0 : x.call(e)) == null ? void 0 : m.getMetadata) == null ? void 0 : g.call(m)) ?? ((D = (_ = (w = e.getReceiver) == null ? void 0 : w.call(e)) == null ? void 0 : _.getMetadata) == null ? void 0 : D.call(_)) ?? {}).systemDisplayName, k = (y = e.getActionBy) == null ? void 0 : y.call(e), O = ((E = k == null ? void 0 : k.getName) == null ? void 0 : E.call(k)) ?? "", z = ((C = e.getMessage) == null ? void 0 : C.call(e)) ?? "";
|
|
4268
|
+
return typeof S == "string" && S.trim() && O ? z.replace(O, S.trim()) : z;
|
|
4269
4269
|
}
|
|
4270
4270
|
return "Custom message";
|
|
4271
4271
|
}
|
|
@@ -4294,9 +4294,9 @@ function w0(e) {
|
|
|
4294
4294
|
`).trim();
|
|
4295
4295
|
}
|
|
4296
4296
|
function Xo(e) {
|
|
4297
|
-
return e.kind === "poll" && e.poll ?
|
|
4297
|
+
return e.kind === "poll" && e.poll ? Ne("pollPrefix", { question: e.poll.question }) : xu(
|
|
4298
4298
|
e,
|
|
4299
|
-
e.attachments.length > 0 ?
|
|
4299
|
+
e.attachments.length > 0 ? Ne("sentAnAttachment") : Ne("youSentAMessage")
|
|
4300
4300
|
);
|
|
4301
4301
|
}
|
|
4302
4302
|
const ya = {
|
|
@@ -4575,14 +4575,14 @@ function S0({
|
|
|
4575
4575
|
$a(e);
|
|
4576
4576
|
const t = U(!1), u = U(!1), n = U(!1), a = U(!1), r = U(!1), o = U(!1), i = U(!1), s = U(!1), l = U(!1), d = U(!1), f = U(!1), x = U(!1), m = U(
|
|
4577
4577
|
typeof navigator < "u" ? !navigator.onLine : !1
|
|
4578
|
-
), g = U(!1), w = U(null), _ = U(null), D = U([]), y = U([]), E = U([]), C = U([]), I = U(!1), S = U(!1), k = U(null),
|
|
4578
|
+
), g = U(!1), w = U(null), _ = U(null), D = U([]), y = U([]), E = U([]), C = U([]), I = U(!1), S = U(!1), k = U(null), O = U(null), z = U(null), Q = U(null), W = U([]), le = N(() => W.value.length), L = N(() => D.value.find(
|
|
4579
4579
|
(c) => c.id === k.value
|
|
4580
|
-
) ?? null), B = `bcc-ui-connection-${crypto.randomUUID()}`,
|
|
4581
|
-
let
|
|
4582
|
-
const
|
|
4583
|
-
let Qe = null,
|
|
4580
|
+
) ?? null), B = `bcc-ui-connection-${crypto.randomUUID()}`, Y = `bcc-ui-message-${crypto.randomUUID()}`;
|
|
4581
|
+
let ee = !1, ue = !1, ve = null, De = null, Le = null, me = null, it = 0, xe = 0, G = !1, X = !1, q = null;
|
|
4582
|
+
const Ge = /* @__PURE__ */ new Map(), ge = /* @__PURE__ */ new Set();
|
|
4583
|
+
let Qe = null, Fe = null, vt = 0;
|
|
4584
4584
|
async function Te() {
|
|
4585
|
-
await I0(e), !t.value && (_u(), Ru(), t.value = !0, await Fu(), _.value && (gr(_.value.uid), gt(), Mt(), !m.value && !
|
|
4585
|
+
await I0(e), !t.value && (_u(), Ru(), t.value = !0, await Fu(), _.value && (gr(_.value.uid), gt(), Mt(), !m.value && !X && Ft()));
|
|
4586
4586
|
}
|
|
4587
4587
|
async function se(c) {
|
|
4588
4588
|
w.value = null, u.value = !0;
|
|
@@ -4591,9 +4591,9 @@ function S0({
|
|
|
4591
4591
|
const h = Gu();
|
|
4592
4592
|
await j.getLoggedinUser() && h !== c && await j.logout(), Aa(c);
|
|
4593
4593
|
const A = await Kr(c), R = await j.login(A);
|
|
4594
|
-
_.value = An(R), gr(_.value.uid), g.value = !0, m.value = typeof navigator < "u" ? !navigator.onLine : !1, gt(), Mt(),
|
|
4594
|
+
_.value = An(R), gr(_.value.uid), g.value = !0, m.value = typeof navigator < "u" ? !navigator.onLine : !1, gt(), Mt(), X || await Ft(), await Wt(), oa();
|
|
4595
4595
|
} catch (h) {
|
|
4596
|
-
throw P(), w.value =
|
|
4596
|
+
throw P(), w.value = Re(h, "Unable to sign in to chat."), h;
|
|
4597
4597
|
} finally {
|
|
4598
4598
|
u.value = !1;
|
|
4599
4599
|
}
|
|
@@ -4609,16 +4609,16 @@ function S0({
|
|
|
4609
4609
|
function gt() {
|
|
4610
4610
|
const c = Ua();
|
|
4611
4611
|
if (!c) {
|
|
4612
|
-
|
|
4612
|
+
q = null, W.value = [];
|
|
4613
4613
|
return;
|
|
4614
4614
|
}
|
|
4615
|
-
const h = `bcc-chat:${
|
|
4616
|
-
yu(h),
|
|
4615
|
+
const h = `bcc-chat:${Be().appId}:${c}`;
|
|
4616
|
+
yu(h), q = new er(h), W.value = q.getQueue();
|
|
4617
4617
|
}
|
|
4618
4618
|
function yu(c) {
|
|
4619
4619
|
if (typeof window > "u")
|
|
4620
4620
|
return;
|
|
4621
|
-
const h = `bcc-chat:${
|
|
4621
|
+
const h = `bcc-chat:${Be().appId}:`, b = [];
|
|
4622
4622
|
for (let A = 0; A < window.localStorage.length; A += 1) {
|
|
4623
4623
|
const R = window.localStorage.key(A);
|
|
4624
4624
|
R && R.startsWith(h) && R !== c && b.push(R);
|
|
@@ -4629,7 +4629,7 @@ function S0({
|
|
|
4629
4629
|
ue || typeof window > "u" || (window.addEventListener("online", It), window.addEventListener("offline", uu), ue = !0);
|
|
4630
4630
|
}
|
|
4631
4631
|
function It() {
|
|
4632
|
-
m.value = !1,
|
|
4632
|
+
m.value = !1, G = !0, X || nu(!0);
|
|
4633
4633
|
}
|
|
4634
4634
|
function uu() {
|
|
4635
4635
|
m.value = !0, x.value = !1, xt();
|
|
@@ -4638,21 +4638,21 @@ function S0({
|
|
|
4638
4638
|
ve !== null && (clearTimeout(ve), ve = null);
|
|
4639
4639
|
}
|
|
4640
4640
|
function Cu() {
|
|
4641
|
-
|
|
4641
|
+
it = Date.now() + 1500;
|
|
4642
4642
|
}
|
|
4643
4643
|
function Gt() {
|
|
4644
|
-
return Date.now() <
|
|
4644
|
+
return Date.now() < it;
|
|
4645
4645
|
}
|
|
4646
4646
|
function nu(c = !1) {
|
|
4647
|
-
if (ve !== null || De || m.value || !g.value ||
|
|
4647
|
+
if (ve !== null || De || m.value || !g.value || X)
|
|
4648
4648
|
return;
|
|
4649
|
-
const h = c ? 0 : Math.min(3e4, 1e3 * 2 ** Math.min(
|
|
4649
|
+
const h = c ? 0 : Math.min(3e4, 1e3 * 2 ** Math.min(xe, 4));
|
|
4650
4650
|
ve = setTimeout(() => {
|
|
4651
4651
|
ve = null, Ft();
|
|
4652
4652
|
}, h);
|
|
4653
4653
|
}
|
|
4654
4654
|
async function Ft() {
|
|
4655
|
-
if (!(m.value || !g.value ||
|
|
4655
|
+
if (!(m.value || !g.value || X))
|
|
4656
4656
|
return De || (De = (async () => {
|
|
4657
4657
|
xt();
|
|
4658
4658
|
try {
|
|
@@ -4666,9 +4666,9 @@ function S0({
|
|
|
4666
4666
|
}
|
|
4667
4667
|
_.value = An(c), g.value = !0, gt();
|
|
4668
4668
|
const h = j.connect;
|
|
4669
|
-
typeof h == "function" && (await h.call(j), x.value = !0),
|
|
4669
|
+
typeof h == "function" && (await h.call(j), x.value = !0), xe = 0, G && await Rt();
|
|
4670
4670
|
} catch (c) {
|
|
4671
|
-
x.value = !1,
|
|
4671
|
+
x.value = !1, xe += 1, Ou(c) || (w.value = Re(
|
|
4672
4672
|
c,
|
|
4673
4673
|
"Unable to reconnect to chat."
|
|
4674
4674
|
)), nu();
|
|
@@ -4678,38 +4678,38 @@ function S0({
|
|
|
4678
4678
|
})(), De);
|
|
4679
4679
|
}
|
|
4680
4680
|
async function Rt() {
|
|
4681
|
-
return
|
|
4682
|
-
|
|
4681
|
+
return Le || m.value || !g.value || X || (Le = (async () => {
|
|
4682
|
+
G = !1, w.value = null;
|
|
4683
4683
|
try {
|
|
4684
4684
|
await Wt(), oa();
|
|
4685
4685
|
} finally {
|
|
4686
|
-
|
|
4686
|
+
Le = null;
|
|
4687
4687
|
}
|
|
4688
|
-
})()),
|
|
4688
|
+
})()), Le;
|
|
4689
4689
|
}
|
|
4690
4690
|
function Mt() {
|
|
4691
|
-
if (!
|
|
4691
|
+
if (!q || D.value.length > 0)
|
|
4692
4692
|
return;
|
|
4693
|
-
const c =
|
|
4694
|
-
c.length !== 0 && (D.value = $t(c), !k.value && D.value.length > 0 && (k.value = D.value[0].id,
|
|
4693
|
+
const c = q.getConversations();
|
|
4694
|
+
c.length !== 0 && (D.value = $t(c), !k.value && D.value.length > 0 && (k.value = D.value[0].id, tt(k.value)));
|
|
4695
4695
|
}
|
|
4696
|
-
function
|
|
4697
|
-
if (!
|
|
4696
|
+
function tt(c) {
|
|
4697
|
+
if (!q)
|
|
4698
4698
|
return y.value = [], !1;
|
|
4699
|
-
const h =
|
|
4699
|
+
const h = q.getMessages(c).sort(zt);
|
|
4700
4700
|
return y.value = h, h.length > 0;
|
|
4701
4701
|
}
|
|
4702
4702
|
async function Tu() {
|
|
4703
|
-
|
|
4703
|
+
X = !1, G = !0, await Ft();
|
|
4704
4704
|
}
|
|
4705
4705
|
async function sn() {
|
|
4706
|
-
|
|
4706
|
+
X = !0, G = !1, xt();
|
|
4707
4707
|
const c = j.disconnect;
|
|
4708
4708
|
typeof c == "function" && await c.call(j), x.value = !1;
|
|
4709
4709
|
}
|
|
4710
4710
|
async function Wt() {
|
|
4711
|
-
if (await Te(), n.value = !0, w.value = null, m.value &&
|
|
4712
|
-
const c =
|
|
4711
|
+
if (await Te(), n.value = !0, w.value = null, m.value && q) {
|
|
4712
|
+
const c = q.getConversations();
|
|
4713
4713
|
D.value = $t(c), !k.value && D.value.length > 0 ? await qt(D.value[0].id) : L.value && await Kt(), n.value = !1;
|
|
4714
4714
|
return;
|
|
4715
4715
|
}
|
|
@@ -4735,14 +4735,14 @@ function S0({
|
|
|
4735
4735
|
}
|
|
4736
4736
|
D.value = $t(
|
|
4737
4737
|
await hn(h)
|
|
4738
|
-
),
|
|
4738
|
+
), q == null || q.setConversations(D.value), !k.value && D.value.length > 0 ? await qt(D.value[0].id) : L.value && await Kt();
|
|
4739
4739
|
} catch (c) {
|
|
4740
|
-
const h = (
|
|
4740
|
+
const h = (q == null ? void 0 : q.getConversations()) ?? [];
|
|
4741
4741
|
if (h.length > 0) {
|
|
4742
4742
|
D.value = $t(h), !k.value && D.value.length > 0 && await qt(D.value[0].id);
|
|
4743
4743
|
return;
|
|
4744
4744
|
}
|
|
4745
|
-
throw w.value =
|
|
4745
|
+
throw w.value = Re(
|
|
4746
4746
|
c,
|
|
4747
4747
|
"Unable to load conversations."
|
|
4748
4748
|
), c;
|
|
@@ -4751,7 +4751,7 @@ function S0({
|
|
|
4751
4751
|
}
|
|
4752
4752
|
}
|
|
4753
4753
|
async function qt(c) {
|
|
4754
|
-
k.value = c,
|
|
4754
|
+
k.value = c, O.value = null, E.value = [], Fe = null, S.value = !1, z.value = null, Q.value = null, tt(c), await Kt();
|
|
4755
4755
|
}
|
|
4756
4756
|
function ln(c) {
|
|
4757
4757
|
c && (Q.value = null), z.value = c;
|
|
@@ -4760,13 +4760,13 @@ function S0({
|
|
|
4760
4760
|
c && (z.value = null), Q.value = c;
|
|
4761
4761
|
}
|
|
4762
4762
|
async function ru(c) {
|
|
4763
|
-
|
|
4763
|
+
O.value = c, Fe = null, S.value = !1, z.value = null, Q.value = null, await ut(c.id);
|
|
4764
4764
|
}
|
|
4765
4765
|
function ct() {
|
|
4766
|
-
|
|
4766
|
+
O.value = null, E.value = [], Fe = null, S.value = !1, z.value = null, Q.value = null;
|
|
4767
4767
|
}
|
|
4768
4768
|
async function Ot(c, h) {
|
|
4769
|
-
var
|
|
4769
|
+
var te, oe, K, de, he, re;
|
|
4770
4770
|
if (l.value)
|
|
4771
4771
|
return;
|
|
4772
4772
|
const b = L.value;
|
|
@@ -4779,7 +4779,7 @@ function S0({
|
|
|
4779
4779
|
await ku(Q.value, A);
|
|
4780
4780
|
return;
|
|
4781
4781
|
}
|
|
4782
|
-
const R = (
|
|
4782
|
+
const R = (te = O.value) == null ? void 0 : te.id, $ = crypto.randomUUID(), H = Ta(
|
|
4783
4783
|
na(z.value, h),
|
|
4784
4784
|
$
|
|
4785
4785
|
);
|
|
@@ -4811,27 +4811,27 @@ function S0({
|
|
|
4811
4811
|
A,
|
|
4812
4812
|
ju(b)
|
|
4813
4813
|
);
|
|
4814
|
-
(oe = _e.setMuid) == null || oe.call(_e, $), Object.keys(H).length > 0 && ((
|
|
4814
|
+
(oe = _e.setMuid) == null || oe.call(_e, $), Object.keys(H).length > 0 && ((K = _e.setMetadata) == null || K.call(_e, H)), R && ((de = _e.setParentMessageId) == null || de.call(_e, Number(R)));
|
|
4815
4815
|
const dt = await j.sendMessage(_e);
|
|
4816
|
-
|
|
4816
|
+
fe(Xe(dt, (he = _.value) == null ? void 0 : he.uid)), Pt(dt), await wt(dt), z.value = null;
|
|
4817
4817
|
} catch (_e) {
|
|
4818
4818
|
if (Ou(_e)) {
|
|
4819
4819
|
su("queued", $), dr(
|
|
4820
4820
|
b,
|
|
4821
4821
|
A,
|
|
4822
4822
|
H,
|
|
4823
|
-
(re =
|
|
4823
|
+
(re = O.value) == null ? void 0 : re.id,
|
|
4824
4824
|
$
|
|
4825
4825
|
), z.value = null;
|
|
4826
4826
|
return;
|
|
4827
4827
|
}
|
|
4828
|
-
throw su("failed", $), w.value =
|
|
4828
|
+
throw su("failed", $), w.value = Re(_e, "Unable to send the message."), _e;
|
|
4829
4829
|
} finally {
|
|
4830
4830
|
l.value = !1;
|
|
4831
4831
|
}
|
|
4832
4832
|
}
|
|
4833
4833
|
async function ku(c, h) {
|
|
4834
|
-
var R, $, H,
|
|
4834
|
+
var R, $, H, te, oe, K, de, he, re, _e, dt, Ae, Dt, Lu;
|
|
4835
4835
|
const b = L.value;
|
|
4836
4836
|
if (!b || m.value)
|
|
4837
4837
|
return;
|
|
@@ -4846,27 +4846,27 @@ function S0({
|
|
|
4846
4846
|
ju(b)
|
|
4847
4847
|
) : (ft = new j.MediaMessage(
|
|
4848
4848
|
b.targetId,
|
|
4849
|
-
((
|
|
4849
|
+
((te = (H = ($ = (R = c.source) == null ? void 0 : R.getAttachment) == null ? void 0 : $.call(R)) == null ? void 0 : H.getFileUrl) == null ? void 0 : te.call(H)) ?? ((he = (de = (K = (oe = c.source) == null ? void 0 : oe.getAttachment) == null ? void 0 : K.call(oe)) == null ? void 0 : de.getUrl) == null ? void 0 : he.call(de)) ?? ((re = c.attachments[0]) == null ? void 0 : re.url) ?? "",
|
|
4850
4850
|
((dt = (_e = c.source) == null ? void 0 : _e.getType) == null ? void 0 : dt.call(_e)) ?? c.type ?? c.kind,
|
|
4851
4851
|
ju(b)
|
|
4852
4852
|
), (Ae = ft.setCaption) == null || Ae.call(ft, A)), (Dt = ft.setId) == null || Dt.call(ft, Number(c.id));
|
|
4853
4853
|
const pr = await j.editMessage(ft);
|
|
4854
|
-
|
|
4854
|
+
fe(Xe(pr, (Lu = _.value) == null ? void 0 : Lu.uid)), Pt(pr), Q.value = null;
|
|
4855
4855
|
} catch (ft) {
|
|
4856
|
-
throw w.value =
|
|
4856
|
+
throw w.value = Re(ft, "Unable to edit the message."), ft;
|
|
4857
4857
|
} finally {
|
|
4858
4858
|
l.value = !1;
|
|
4859
4859
|
}
|
|
4860
4860
|
}
|
|
4861
4861
|
}
|
|
4862
4862
|
async function Mu(c, h) {
|
|
4863
|
-
var
|
|
4863
|
+
var te, oe, K, de, he, re, _e, dt;
|
|
4864
4864
|
if (l.value)
|
|
4865
4865
|
return;
|
|
4866
4866
|
const b = L.value;
|
|
4867
4867
|
if (!b)
|
|
4868
4868
|
return;
|
|
4869
|
-
const A = (
|
|
4869
|
+
const A = (te = O.value) == null ? void 0 : te.id, R = crypto.randomUUID(), $ = Ta(
|
|
4870
4870
|
na(z.value, h),
|
|
4871
4871
|
R
|
|
4872
4872
|
), H = qa(c.file);
|
|
@@ -4907,9 +4907,9 @@ function S0({
|
|
|
4907
4907
|
H,
|
|
4908
4908
|
ju(b)
|
|
4909
4909
|
);
|
|
4910
|
-
(
|
|
4910
|
+
(K = Ae.setMuid) == null || K.call(Ae, R), Object.keys($).length > 0 && ((de = Ae.setMetadata) == null || de.call(Ae, $)), A && ((he = Ae.setParentMessageId) == null || he.call(Ae, Number(A))), (re = c.caption) != null && re.trim() && ((_e = Ae.setCaption) == null || _e.call(Ae, c.caption.trim()));
|
|
4911
4911
|
const Dt = await j.sendMediaMessage(Ae);
|
|
4912
|
-
|
|
4912
|
+
fe(Xe(Dt, (dt = _.value) == null ? void 0 : dt.uid)), Pt(Dt), await wt(Dt), z.value = null;
|
|
4913
4913
|
} catch (Ae) {
|
|
4914
4914
|
if (Ou(Ae)) {
|
|
4915
4915
|
su("queued", R), await hr(
|
|
@@ -4921,7 +4921,7 @@ function S0({
|
|
|
4921
4921
|
), z.value = null;
|
|
4922
4922
|
return;
|
|
4923
4923
|
}
|
|
4924
|
-
throw su("failed", R), w.value =
|
|
4924
|
+
throw su("failed", R), w.value = Re(
|
|
4925
4925
|
Ae,
|
|
4926
4926
|
"Unable to send the attachment."
|
|
4927
4927
|
), Ae;
|
|
@@ -4930,16 +4930,16 @@ function S0({
|
|
|
4930
4930
|
}
|
|
4931
4931
|
}
|
|
4932
4932
|
async function ea(c, h) {
|
|
4933
|
-
var oe,
|
|
4933
|
+
var oe, K, de;
|
|
4934
4934
|
if (l.value)
|
|
4935
4935
|
return;
|
|
4936
4936
|
const b = L.value;
|
|
4937
4937
|
if (!b)
|
|
4938
4938
|
return;
|
|
4939
|
-
const A = c.question.trim(), R = c.options.map((
|
|
4939
|
+
const A = c.question.trim(), R = c.options.map((he) => he.trim()).filter(Boolean);
|
|
4940
4940
|
if (!A || R.length < 2)
|
|
4941
4941
|
return;
|
|
4942
|
-
const $ = (oe =
|
|
4942
|
+
const $ = (oe = O.value) == null ? void 0 : oe.id, H = crypto.randomUUID(), te = Ta(
|
|
4943
4943
|
na(z.value, h),
|
|
4944
4944
|
H
|
|
4945
4945
|
);
|
|
@@ -4952,7 +4952,7 @@ function S0({
|
|
|
4952
4952
|
question: A,
|
|
4953
4953
|
options: R
|
|
4954
4954
|
},
|
|
4955
|
-
|
|
4955
|
+
te,
|
|
4956
4956
|
$,
|
|
4957
4957
|
H
|
|
4958
4958
|
), z.value = null;
|
|
@@ -4967,57 +4967,57 @@ function S0({
|
|
|
4967
4967
|
question: A,
|
|
4968
4968
|
options: R
|
|
4969
4969
|
},
|
|
4970
|
-
metadata:
|
|
4970
|
+
metadata: te,
|
|
4971
4971
|
parentMessageId: $,
|
|
4972
4972
|
muid: H,
|
|
4973
4973
|
deliveryState: "sending"
|
|
4974
4974
|
})
|
|
4975
4975
|
);
|
|
4976
|
-
const
|
|
4976
|
+
const he = {
|
|
4977
4977
|
question: A,
|
|
4978
4978
|
options: R,
|
|
4979
4979
|
receiver: b.targetId,
|
|
4980
4980
|
receiverType: b.type === "group" ? j.RECEIVER_TYPE.GROUP : j.RECEIVER_TYPE.USER
|
|
4981
4981
|
};
|
|
4982
|
-
$ && (
|
|
4982
|
+
$ && (he.parentMessageId = Number($)), Object.keys(te).length > 0 && (he.metadata = te);
|
|
4983
4983
|
const re = await j.callExtension(
|
|
4984
4984
|
"polls",
|
|
4985
4985
|
"POST",
|
|
4986
4986
|
"v2/create",
|
|
4987
|
-
|
|
4988
|
-
), _e = (re == null ? void 0 : re.message) ?? (re == null ? void 0 : re.custom_message) ?? ((
|
|
4989
|
-
_e ? (ra(H),
|
|
4990
|
-
Xe(_e, (
|
|
4987
|
+
he
|
|
4988
|
+
), _e = (re == null ? void 0 : re.message) ?? (re == null ? void 0 : re.custom_message) ?? ((K = re == null ? void 0 : re.data) == null ? void 0 : K.message) ?? null;
|
|
4989
|
+
_e ? (ra(H), fe(
|
|
4990
|
+
Xe(_e, (de = _.value) == null ? void 0 : de.uid)
|
|
4991
4991
|
), Pt(_e), await wt(_e)) : (ra(H), await V()), z.value = null;
|
|
4992
|
-
} catch (
|
|
4993
|
-
if (Ou(
|
|
4992
|
+
} catch (he) {
|
|
4993
|
+
if (Ou(he)) {
|
|
4994
4994
|
su("queued", H), fr(
|
|
4995
4995
|
b,
|
|
4996
4996
|
{
|
|
4997
4997
|
question: A,
|
|
4998
4998
|
options: R
|
|
4999
4999
|
},
|
|
5000
|
-
|
|
5000
|
+
te,
|
|
5001
5001
|
$,
|
|
5002
5002
|
H
|
|
5003
5003
|
), z.value = null;
|
|
5004
5004
|
return;
|
|
5005
5005
|
}
|
|
5006
|
-
throw su("failed", H), w.value =
|
|
5006
|
+
throw su("failed", H), w.value = Re(he, "Unable to send the poll."), he;
|
|
5007
5007
|
} finally {
|
|
5008
5008
|
l.value = !1;
|
|
5009
5009
|
}
|
|
5010
5010
|
}
|
|
5011
5011
|
async function wu(c, h) {
|
|
5012
|
-
var H,
|
|
5013
|
-
const b = ((H = c.poll) == null ? void 0 : H.id) ?? c.id, A = (
|
|
5012
|
+
var H, te;
|
|
5013
|
+
const b = ((H = c.poll) == null ? void 0 : H.id) ?? c.id, A = (te = _.value) == null ? void 0 : te.uid;
|
|
5014
5014
|
if (!b || !h || m.value)
|
|
5015
5015
|
return;
|
|
5016
5016
|
const R = we(c.id, c.parentMessageId) ?? c;
|
|
5017
5017
|
if (!(!R.poll || R.poll.options.some(
|
|
5018
5018
|
(oe) => oe.id === h && oe.voters.includes(A ?? "")
|
|
5019
5019
|
))) {
|
|
5020
|
-
w.value = null, A &&
|
|
5020
|
+
w.value = null, A && fe(
|
|
5021
5021
|
Au(R, h, A)
|
|
5022
5022
|
);
|
|
5023
5023
|
try {
|
|
@@ -5026,27 +5026,27 @@ function S0({
|
|
|
5026
5026
|
vote: h
|
|
5027
5027
|
});
|
|
5028
5028
|
} catch (oe) {
|
|
5029
|
-
throw
|
|
5029
|
+
throw fe(R), w.value = Re(oe, "Unable to cast the vote."), oe;
|
|
5030
5030
|
}
|
|
5031
5031
|
}
|
|
5032
5032
|
}
|
|
5033
5033
|
function Au(c, h, b) {
|
|
5034
5034
|
if (!c.poll)
|
|
5035
5035
|
return c;
|
|
5036
|
-
const A = c.poll, R = A.allowsMultipleAnswers, $ = A.options.filter((
|
|
5037
|
-
...
|
|
5038
|
-
voteCount: Math.max(
|
|
5039
|
-
voters:
|
|
5040
|
-
} :
|
|
5041
|
-
...
|
|
5042
|
-
voteCount:
|
|
5043
|
-
voters: [...
|
|
5044
|
-
} :
|
|
5036
|
+
const A = c.poll, R = A.allowsMultipleAnswers, $ = A.options.filter((K) => K.voters.includes(b)).map((K) => K.id), H = !R && $.length > 0, te = A.options.map((K) => H && K.voters.includes(b) && K.id !== h ? {
|
|
5037
|
+
...K,
|
|
5038
|
+
voteCount: Math.max(K.voteCount - 1, 0),
|
|
5039
|
+
voters: K.voters.filter((de) => de !== b)
|
|
5040
|
+
} : K.id === h && !K.voters.includes(b) ? {
|
|
5041
|
+
...K,
|
|
5042
|
+
voteCount: K.voteCount + 1,
|
|
5043
|
+
voters: [...K.voters, b]
|
|
5044
|
+
} : K), oe = H ? A.totalVotes : A.totalVotes + 1;
|
|
5045
5045
|
return {
|
|
5046
5046
|
...c,
|
|
5047
5047
|
poll: {
|
|
5048
5048
|
...A,
|
|
5049
|
-
options:
|
|
5049
|
+
options: te,
|
|
5050
5050
|
totalVotes: oe
|
|
5051
5051
|
}
|
|
5052
5052
|
};
|
|
@@ -5057,12 +5057,12 @@ function S0({
|
|
|
5057
5057
|
const b = we(c.id, c.parentMessageId) ?? c, A = b.reactions.find(
|
|
5058
5058
|
($) => $.emoji === h && $.reactedByMe
|
|
5059
5059
|
);
|
|
5060
|
-
|
|
5060
|
+
fe(We(b, h));
|
|
5061
5061
|
try {
|
|
5062
5062
|
const $ = A ? await j.removeReaction(Number(c.id), h) : await j.addReaction(Number(c.id), h);
|
|
5063
|
-
|
|
5063
|
+
fe(Xe($, (R = _.value) == null ? void 0 : R.uid));
|
|
5064
5064
|
} catch ($) {
|
|
5065
|
-
throw
|
|
5065
|
+
throw fe(b), w.value = Re(
|
|
5066
5066
|
$,
|
|
5067
5067
|
"Unable to update the reaction."
|
|
5068
5068
|
), $;
|
|
@@ -5082,7 +5082,7 @@ function S0({
|
|
|
5082
5082
|
);
|
|
5083
5083
|
At(A), Ie(A);
|
|
5084
5084
|
} catch (b) {
|
|
5085
|
-
throw w.value =
|
|
5085
|
+
throw w.value = Re(
|
|
5086
5086
|
b,
|
|
5087
5087
|
"Unable to delete the message."
|
|
5088
5088
|
), b;
|
|
@@ -5106,7 +5106,7 @@ function S0({
|
|
|
5106
5106
|
)).translations) == null ? void 0 : R[0]) == null ? void 0 : $.message_translated) == null ? void 0 : H.trim();
|
|
5107
5107
|
if (!oe)
|
|
5108
5108
|
return;
|
|
5109
|
-
const
|
|
5109
|
+
const K = {
|
|
5110
5110
|
...c,
|
|
5111
5111
|
translatedText: oe,
|
|
5112
5112
|
metadata: {
|
|
@@ -5114,12 +5114,12 @@ function S0({
|
|
|
5114
5114
|
translated_message: oe
|
|
5115
5115
|
}
|
|
5116
5116
|
};
|
|
5117
|
-
|
|
5118
|
-
} catch (
|
|
5119
|
-
throw w.value =
|
|
5120
|
-
|
|
5117
|
+
Pe(K), $e();
|
|
5118
|
+
} catch (te) {
|
|
5119
|
+
throw w.value = Re(
|
|
5120
|
+
te,
|
|
5121
5121
|
"Unable to translate the message."
|
|
5122
|
-
),
|
|
5122
|
+
), te;
|
|
5123
5123
|
}
|
|
5124
5124
|
}
|
|
5125
5125
|
}
|
|
@@ -5132,35 +5132,35 @@ function S0({
|
|
|
5132
5132
|
}
|
|
5133
5133
|
s.value = !0, w.value = null;
|
|
5134
5134
|
try {
|
|
5135
|
-
const H = new j.MessagesRequestBuilder().setLimit(50).setGUID(b).withTags(!0).setTags([h]).build(),
|
|
5135
|
+
const H = new j.MessagesRequestBuilder().setLimit(50).setGUID(b).withTags(!0).setTags([h]).build(), te = [];
|
|
5136
5136
|
let oe = [];
|
|
5137
5137
|
do
|
|
5138
|
-
oe = await H.fetchPrevious(),
|
|
5138
|
+
oe = await H.fetchPrevious(), te.push(
|
|
5139
5139
|
...oe.map(
|
|
5140
|
-
(
|
|
5141
|
-
var
|
|
5142
|
-
return Xe(
|
|
5140
|
+
(de) => {
|
|
5141
|
+
var he;
|
|
5142
|
+
return Xe(de, (he = _.value) == null ? void 0 : he.uid);
|
|
5143
5143
|
}
|
|
5144
5144
|
)
|
|
5145
5145
|
);
|
|
5146
5146
|
while (oe.length === 50);
|
|
5147
|
-
const
|
|
5148
|
-
var
|
|
5149
|
-
return !(
|
|
5150
|
-
}).sort((
|
|
5147
|
+
const K = te.filter((de) => {
|
|
5148
|
+
var he;
|
|
5149
|
+
return !(de.isDeleted || !((he = de.scheduled) != null && he.scheduleDate) || h && de.scheduled.originalChatUid && de.scheduled.originalChatUid !== h);
|
|
5150
|
+
}).sort((de, he) => {
|
|
5151
5151
|
var dt, Ae, Dt, Lu;
|
|
5152
|
-
const re = ((Ae = (dt =
|
|
5152
|
+
const re = ((Ae = (dt = de.scheduled) == null ? void 0 : dt.scheduleDate) == null ? void 0 : Ae.getTime()) ?? de.sentAt.getTime(), _e = ((Lu = (Dt = he.scheduled) == null ? void 0 : Dt.scheduleDate) == null ? void 0 : Lu.getTime()) ?? he.sentAt.getTime();
|
|
5153
5153
|
return re - _e;
|
|
5154
5154
|
});
|
|
5155
5155
|
if (A !== vt)
|
|
5156
5156
|
return;
|
|
5157
|
-
C.value =
|
|
5157
|
+
C.value = K;
|
|
5158
5158
|
} catch (H) {
|
|
5159
5159
|
if (A !== vt)
|
|
5160
5160
|
return;
|
|
5161
|
-
throw w.value =
|
|
5161
|
+
throw w.value = Re(
|
|
5162
5162
|
H,
|
|
5163
|
-
|
|
5163
|
+
Ne("loadScheduledMessagesError")
|
|
5164
5164
|
), H;
|
|
5165
5165
|
} finally {
|
|
5166
5166
|
A === vt && (s.value = !1);
|
|
@@ -5173,7 +5173,7 @@ function S0({
|
|
|
5173
5173
|
try {
|
|
5174
5174
|
c.file ? await B0(b, c, h) : await $0(b, c, h), await Du(b.targetId);
|
|
5175
5175
|
} catch (A) {
|
|
5176
|
-
throw w.value =
|
|
5176
|
+
throw w.value = Re(
|
|
5177
5177
|
A,
|
|
5178
5178
|
"Unable to schedule the message."
|
|
5179
5179
|
), A;
|
|
@@ -5186,7 +5186,7 @@ function S0({
|
|
|
5186
5186
|
d.value = !0, w.value = null;
|
|
5187
5187
|
try {
|
|
5188
5188
|
const h = tr(), b = await fetch(
|
|
5189
|
-
`${
|
|
5189
|
+
`${Be().chatApiBaseUrl}/chats/rescheduleMessage`,
|
|
5190
5190
|
{
|
|
5191
5191
|
method: "POST",
|
|
5192
5192
|
headers: {
|
|
@@ -5205,7 +5205,7 @@ function S0({
|
|
|
5205
5205
|
throw new Error(`Reschedule failed with status ${b.status}.`);
|
|
5206
5206
|
await Du(c.originalChatUid);
|
|
5207
5207
|
} catch (h) {
|
|
5208
|
-
throw w.value =
|
|
5208
|
+
throw w.value = Re(
|
|
5209
5209
|
h,
|
|
5210
5210
|
"Unable to reschedule the message."
|
|
5211
5211
|
), h;
|
|
@@ -5239,9 +5239,9 @@ function S0({
|
|
|
5239
5239
|
($) => $.conversationId === h.id && Qr($)
|
|
5240
5240
|
),
|
|
5241
5241
|
A
|
|
5242
|
-
) : kn(y.value, A), I.value = b.length === ou,
|
|
5242
|
+
) : kn(y.value, A), I.value = b.length === ou, q == null || q.setMessages(h.id, y.value);
|
|
5243
5243
|
const R = b[b.length - 1];
|
|
5244
|
-
return R && (await
|
|
5244
|
+
return R && (await J(R), await wt(R)), b.length > 0;
|
|
5245
5245
|
}
|
|
5246
5246
|
async function Kt() {
|
|
5247
5247
|
const c = L.value;
|
|
@@ -5249,8 +5249,8 @@ function S0({
|
|
|
5249
5249
|
y.value = [], I.value = !1, Qe = null;
|
|
5250
5250
|
return;
|
|
5251
5251
|
}
|
|
5252
|
-
const h =
|
|
5253
|
-
if (a.value = !0, m.value &&
|
|
5252
|
+
const h = tt(c.id);
|
|
5253
|
+
if (a.value = !0, m.value && q) {
|
|
5254
5254
|
I.value = !1, Qe = null, a.value = !1;
|
|
5255
5255
|
return;
|
|
5256
5256
|
}
|
|
@@ -5258,55 +5258,55 @@ function S0({
|
|
|
5258
5258
|
await Su({ reset: !0 }), D.value = D.value.map((b) => b.id !== c.id ? b : {
|
|
5259
5259
|
...b,
|
|
5260
5260
|
unreadCount: 0
|
|
5261
|
-
}),
|
|
5261
|
+
}), q == null || q.setConversations(D.value);
|
|
5262
5262
|
} catch (b) {
|
|
5263
|
-
const A = (
|
|
5263
|
+
const A = (q == null ? void 0 : q.getMessages(c.id)) ?? [];
|
|
5264
5264
|
if (A.length > 0) {
|
|
5265
5265
|
h || (y.value = A.sort(zt));
|
|
5266
5266
|
return;
|
|
5267
5267
|
}
|
|
5268
|
-
throw w.value =
|
|
5268
|
+
throw w.value = Re(b, "Unable to load messages."), b;
|
|
5269
5269
|
} finally {
|
|
5270
5270
|
a.value = !1;
|
|
5271
5271
|
}
|
|
5272
5272
|
}
|
|
5273
5273
|
async function dn(c) {
|
|
5274
5274
|
var $;
|
|
5275
|
-
const h = ($ =
|
|
5275
|
+
const h = ($ = O.value) == null ? void 0 : $.id;
|
|
5276
5276
|
if (!h)
|
|
5277
5277
|
return E.value = [], S.value = !1, !1;
|
|
5278
|
-
if ((c != null && c.reset || (
|
|
5278
|
+
if ((c != null && c.reset || (Fe == null ? void 0 : Fe.parentMessageId) !== h) && (Fe = {
|
|
5279
5279
|
parentMessageId: h,
|
|
5280
5280
|
request: Eu(h)
|
|
5281
|
-
}, S.value = !0), !
|
|
5281
|
+
}, S.value = !0), !Fe)
|
|
5282
5282
|
return !1;
|
|
5283
|
-
const b = await
|
|
5284
|
-
var
|
|
5285
|
-
return Xe(H, (
|
|
5283
|
+
const b = await Fe.request.fetchPrevious(), A = b.map((H) => {
|
|
5284
|
+
var te;
|
|
5285
|
+
return Xe(H, (te = _.value) == null ? void 0 : te.uid);
|
|
5286
5286
|
}).filter(Et).sort(zt);
|
|
5287
5287
|
E.value = c != null && c.reset ? kn(
|
|
5288
5288
|
E.value.filter(
|
|
5289
5289
|
(H) => H.parentMessageId === h && Qr(H)
|
|
5290
5290
|
),
|
|
5291
5291
|
A
|
|
5292
|
-
) : kn(E.value, A), S.value = b.length === ou,
|
|
5292
|
+
) : kn(E.value, A), S.value = b.length === ou, q == null || q.setThreadMessages(h, E.value);
|
|
5293
5293
|
const R = b[b.length - 1];
|
|
5294
|
-
return R && (await
|
|
5294
|
+
return R && (await J(R), await wt(R)), b.length > 0;
|
|
5295
5295
|
}
|
|
5296
|
-
async function
|
|
5297
|
-
if (r.value = !0, m.value &&
|
|
5298
|
-
E.value =
|
|
5296
|
+
async function ut(c) {
|
|
5297
|
+
if (r.value = !0, m.value && q) {
|
|
5298
|
+
E.value = q.getThreadMessages(c).sort(zt), S.value = !1, Fe = null, r.value = !1;
|
|
5299
5299
|
return;
|
|
5300
5300
|
}
|
|
5301
5301
|
try {
|
|
5302
5302
|
await dn({ reset: !0 });
|
|
5303
5303
|
} catch (h) {
|
|
5304
|
-
const b = (
|
|
5304
|
+
const b = (q == null ? void 0 : q.getThreadMessages(c)) ?? [];
|
|
5305
5305
|
if (b.length > 0) {
|
|
5306
5306
|
E.value = b.sort(zt);
|
|
5307
5307
|
return;
|
|
5308
5308
|
}
|
|
5309
|
-
throw w.value =
|
|
5309
|
+
throw w.value = Re(h, "Unable to load thread."), h;
|
|
5310
5310
|
} finally {
|
|
5311
5311
|
r.value = !1;
|
|
5312
5312
|
}
|
|
@@ -5318,7 +5318,7 @@ function S0({
|
|
|
5318
5318
|
try {
|
|
5319
5319
|
return await Su();
|
|
5320
5320
|
} catch (c) {
|
|
5321
|
-
throw w.value =
|
|
5321
|
+
throw w.value = Re(c, "Unable to load messages."), c;
|
|
5322
5322
|
} finally {
|
|
5323
5323
|
o.value = !1;
|
|
5324
5324
|
}
|
|
@@ -5330,7 +5330,7 @@ function S0({
|
|
|
5330
5330
|
try {
|
|
5331
5331
|
return await dn();
|
|
5332
5332
|
} catch (c) {
|
|
5333
|
-
throw w.value =
|
|
5333
|
+
throw w.value = Re(c, "Unable to load thread."), c;
|
|
5334
5334
|
} finally {
|
|
5335
5335
|
i.value = !1;
|
|
5336
5336
|
}
|
|
@@ -5343,12 +5343,12 @@ function S0({
|
|
|
5343
5343
|
var R;
|
|
5344
5344
|
return y.value.some(($) => $.id === h) || E.value.some(
|
|
5345
5345
|
($) => $.id === h
|
|
5346
|
-
) || ((R =
|
|
5346
|
+
) || ((R = O.value) == null ? void 0 : R.id) === h;
|
|
5347
5347
|
};
|
|
5348
5348
|
if (b())
|
|
5349
5349
|
return !0;
|
|
5350
5350
|
let A = 0;
|
|
5351
|
-
for (; S.value &&
|
|
5351
|
+
for (; S.value && O.value && A < 100; ) {
|
|
5352
5352
|
A += 1;
|
|
5353
5353
|
const R = await Iu();
|
|
5354
5354
|
if (b())
|
|
@@ -5371,22 +5371,22 @@ function S0({
|
|
|
5371
5371
|
_.value = c ? An(c) : null, g.value = !!c;
|
|
5372
5372
|
}
|
|
5373
5373
|
function Ru() {
|
|
5374
|
-
|
|
5374
|
+
ee || (j.addConnectionListener(
|
|
5375
5375
|
B,
|
|
5376
5376
|
new j.ConnectionListener({
|
|
5377
5377
|
onConnected: () => {
|
|
5378
|
-
if (x.value = !0,
|
|
5378
|
+
if (x.value = !0, xe = 0, xt(), G) {
|
|
5379
5379
|
Rt();
|
|
5380
5380
|
return;
|
|
5381
5381
|
}
|
|
5382
5382
|
oa();
|
|
5383
5383
|
},
|
|
5384
5384
|
onDisconnected: () => {
|
|
5385
|
-
x.value = !1, !m.value && g.value && !
|
|
5385
|
+
x.value = !1, !m.value && g.value && !X && (G = !0, nu(!0));
|
|
5386
5386
|
}
|
|
5387
5387
|
})
|
|
5388
5388
|
), j.addMessageListener(
|
|
5389
|
-
|
|
5389
|
+
Y,
|
|
5390
5390
|
new j.MessageListener({
|
|
5391
5391
|
onTextMessageReceived: (c) => {
|
|
5392
5392
|
st(c);
|
|
@@ -5411,7 +5411,7 @@ function S0({
|
|
|
5411
5411
|
onMessageDeleted: (c) => {
|
|
5412
5412
|
var b;
|
|
5413
5413
|
const h = Xe(c, (b = _.value) == null ? void 0 : b.uid);
|
|
5414
|
-
h.parentMessageId ? At(h) : (At(h), Ie(h)),
|
|
5414
|
+
h.parentMessageId ? At(h) : (At(h), Ie(h)), $e();
|
|
5415
5415
|
},
|
|
5416
5416
|
onMessageReactionAdded: () => {
|
|
5417
5417
|
V();
|
|
@@ -5426,17 +5426,17 @@ function S0({
|
|
|
5426
5426
|
Gt() || V({ includeThread: !1 });
|
|
5427
5427
|
}
|
|
5428
5428
|
})
|
|
5429
|
-
),
|
|
5429
|
+
), ee = !0);
|
|
5430
5430
|
}
|
|
5431
5431
|
async function st(c) {
|
|
5432
5432
|
var b;
|
|
5433
5433
|
const h = Xe(c, (b = _.value) == null ? void 0 : b.uid);
|
|
5434
5434
|
if (Et(h)) {
|
|
5435
|
-
if (Pt(c), await
|
|
5436
|
-
mn(h), Ye(h.parentMessageId),
|
|
5435
|
+
if (Pt(c), await J(c), h.parentMessageId) {
|
|
5436
|
+
mn(h), Ye(h.parentMessageId), $e();
|
|
5437
5437
|
return;
|
|
5438
5438
|
}
|
|
5439
|
-
h.conversationId === k.value && (qu(h),
|
|
5439
|
+
h.conversationId === k.value && (qu(h), $e(), await wt(c));
|
|
5440
5440
|
}
|
|
5441
5441
|
}
|
|
5442
5442
|
async function hn(c) {
|
|
@@ -5452,7 +5452,7 @@ function S0({
|
|
|
5452
5452
|
}
|
|
5453
5453
|
async function pn(c) {
|
|
5454
5454
|
var A;
|
|
5455
|
-
const h =
|
|
5455
|
+
const h = q == null ? void 0 : q.getParticipantSettings(c), b = h != null && h.lastUpdated ? Date.now() - h.lastUpdated > 24 * 60 * 60 * 1e3 : !0;
|
|
5456
5456
|
if (h && (m.value || !b))
|
|
5457
5457
|
return h.mutedUntil;
|
|
5458
5458
|
if (m.value || !g.value)
|
|
@@ -5464,8 +5464,8 @@ function S0({
|
|
|
5464
5464
|
const H = Gu();
|
|
5465
5465
|
if (!H)
|
|
5466
5466
|
return (h == null ? void 0 : h.mutedUntil) ?? null;
|
|
5467
|
-
const
|
|
5468
|
-
`${
|
|
5467
|
+
const te = await fetch(
|
|
5468
|
+
`${Be().chatApiBaseUrl}/chats/${c}/settings/${$}`,
|
|
5469
5469
|
{
|
|
5470
5470
|
method: "GET",
|
|
5471
5471
|
headers: {
|
|
@@ -5474,10 +5474,10 @@ function S0({
|
|
|
5474
5474
|
}
|
|
5475
5475
|
}
|
|
5476
5476
|
);
|
|
5477
|
-
if (!
|
|
5477
|
+
if (!te.ok)
|
|
5478
5478
|
return (h == null ? void 0 : h.mutedUntil) ?? null;
|
|
5479
|
-
const oe = await
|
|
5480
|
-
return
|
|
5479
|
+
const oe = await te.json();
|
|
5480
|
+
return q == null || q.storeParticipantSettings({
|
|
5481
5481
|
chatUid: c,
|
|
5482
5482
|
mutedUntil: oe.mutedUntil ?? null,
|
|
5483
5483
|
lastUpdated: Date.now()
|
|
@@ -5492,7 +5492,7 @@ function S0({
|
|
|
5492
5492
|
if (!Et(h) || h.isDeleted)
|
|
5493
5493
|
return;
|
|
5494
5494
|
const b = c.getConversationId(), A = D.value.find(
|
|
5495
|
-
(
|
|
5495
|
+
(te) => te.id === b
|
|
5496
5496
|
);
|
|
5497
5497
|
if (!A) {
|
|
5498
5498
|
Wt();
|
|
@@ -5506,19 +5506,19 @@ function S0({
|
|
|
5506
5506
|
};
|
|
5507
5507
|
D.value = $t(
|
|
5508
5508
|
D.value.map(
|
|
5509
|
-
(
|
|
5509
|
+
(te) => te.id === b ? R : te
|
|
5510
5510
|
)
|
|
5511
|
-
),
|
|
5511
|
+
), q == null || q.setConversations(D.value);
|
|
5512
5512
|
}
|
|
5513
5513
|
function qu(c) {
|
|
5514
|
-
y.value = Bt(y.value, c), k.value && (
|
|
5514
|
+
y.value = Bt(y.value, c), k.value && (q == null || q.setMessages(k.value, y.value));
|
|
5515
5515
|
}
|
|
5516
5516
|
function mn(c) {
|
|
5517
5517
|
var h;
|
|
5518
|
-
c.parentMessageId === ((h =
|
|
5518
|
+
c.parentMessageId === ((h = O.value) == null ? void 0 : h.id) && (E.value = Bt(
|
|
5519
5519
|
E.value,
|
|
5520
5520
|
c
|
|
5521
|
-
), c.parentMessageId && (
|
|
5521
|
+
), c.parentMessageId && (q == null || q.setThreadMessages(
|
|
5522
5522
|
c.parentMessageId,
|
|
5523
5523
|
E.value
|
|
5524
5524
|
)));
|
|
@@ -5530,7 +5530,7 @@ function S0({
|
|
|
5530
5530
|
const h = (R = (A = (b = c.getSender) == null ? void 0 : b.call(c)) == null ? void 0 : A.getUid) == null ? void 0 : R.call(A);
|
|
5531
5531
|
!h || h === (($ = _.value) == null ? void 0 : $.uid) || (H = c.getReadByMeAt) != null && H.call(c) || (Cu(), await j.markAsRead(c));
|
|
5532
5532
|
}
|
|
5533
|
-
async function
|
|
5533
|
+
async function J(c) {
|
|
5534
5534
|
var b, A, R, $, H;
|
|
5535
5535
|
if (m.value)
|
|
5536
5536
|
return;
|
|
@@ -5544,38 +5544,38 @@ function S0({
|
|
|
5544
5544
|
return R0(h);
|
|
5545
5545
|
}
|
|
5546
5546
|
function P() {
|
|
5547
|
-
u.value = !1, n.value = !1, a.value = !1, r.value = !1, o.value = !1, i.value = !1, s.value = !1, l.value = !1, d.value = !1, f.value = !1, x.value = !1, xt(),
|
|
5547
|
+
u.value = !1, n.value = !1, a.value = !1, r.value = !1, o.value = !1, i.value = !1, s.value = !1, l.value = !1, d.value = !1, f.value = !1, x.value = !1, xt(), xe = 0, G = !1, X = !1, g.value = !1, _.value = null, D.value = [], y.value = [], E.value = [], C.value = [], O.value = null, z.value = null, Q.value = null, W.value = [], k.value = null, I.value = !1, S.value = !1, Qe = null, Fe = null, ge.clear();
|
|
5548
5548
|
}
|
|
5549
5549
|
async function V(c) {
|
|
5550
|
-
if (
|
|
5551
|
-
return
|
|
5550
|
+
if (me)
|
|
5551
|
+
return me;
|
|
5552
5552
|
const h = (c == null ? void 0 : c.includeThread) ?? !0;
|
|
5553
|
-
|
|
5554
|
-
L.value && await Kt(), h &&
|
|
5553
|
+
me = (async () => {
|
|
5554
|
+
L.value && await Kt(), h && O.value && await ut(O.value.id);
|
|
5555
5555
|
})();
|
|
5556
5556
|
try {
|
|
5557
|
-
await
|
|
5557
|
+
await me;
|
|
5558
5558
|
} finally {
|
|
5559
|
-
|
|
5559
|
+
me = null;
|
|
5560
5560
|
}
|
|
5561
5561
|
}
|
|
5562
|
-
function
|
|
5563
|
-
|
|
5562
|
+
function fe(c) {
|
|
5563
|
+
Pe(c), c.parentMessageId && Ye(c.parentMessageId, c.replyCount), $e();
|
|
5564
5564
|
}
|
|
5565
|
-
function
|
|
5565
|
+
function Pe(c) {
|
|
5566
5566
|
var h, b;
|
|
5567
5567
|
if (c.parentMessageId) {
|
|
5568
|
-
((h =
|
|
5568
|
+
((h = O.value) == null ? void 0 : h.id) === c.parentMessageId && (E.value = Bt(
|
|
5569
5569
|
E.value,
|
|
5570
5570
|
c
|
|
5571
5571
|
));
|
|
5572
5572
|
return;
|
|
5573
5573
|
}
|
|
5574
|
-
y.value = Bt(y.value, c), ((b =
|
|
5574
|
+
y.value = Bt(y.value, c), ((b = O.value) == null ? void 0 : b.id) === c.id && (O.value = c);
|
|
5575
5575
|
}
|
|
5576
5576
|
function we(c, h) {
|
|
5577
5577
|
var b;
|
|
5578
|
-
return h ? E.value.find((A) => A.id === c) ?? null : ((b =
|
|
5578
|
+
return h ? E.value.find((A) => A.id === c) ?? null : ((b = O.value) == null ? void 0 : b.id) === c ? O.value : y.value.find((A) => A.id === c) ?? null;
|
|
5579
5579
|
}
|
|
5580
5580
|
function We(c, h) {
|
|
5581
5581
|
const b = c.reactions.find(
|
|
@@ -5610,63 +5610,63 @@ function S0({
|
|
|
5610
5610
|
...b,
|
|
5611
5611
|
replyCount: typeof h == "number" ? h : Math.max(b.replyCount + 1, 1)
|
|
5612
5612
|
};
|
|
5613
|
-
y.value = Bt(y.value, A), ((R =
|
|
5613
|
+
y.value = Bt(y.value, A), ((R = O.value) == null ? void 0 : R.id) === c && (O.value = A);
|
|
5614
5614
|
}
|
|
5615
|
-
function
|
|
5616
|
-
k.value && (
|
|
5617
|
-
|
|
5615
|
+
function $e() {
|
|
5616
|
+
k.value && (q == null || q.setMessages(k.value, y.value)), O.value && (q == null || q.setThreadMessages(
|
|
5617
|
+
O.value.id,
|
|
5618
5618
|
E.value
|
|
5619
5619
|
));
|
|
5620
5620
|
}
|
|
5621
5621
|
function At(c) {
|
|
5622
5622
|
if (c.parentMessageId ? (E.value = E.value.filter(
|
|
5623
5623
|
(h) => h.id !== c.id
|
|
5624
|
-
),
|
|
5624
|
+
), q == null || q.setThreadMessages(
|
|
5625
5625
|
c.parentMessageId,
|
|
5626
5626
|
E.value
|
|
5627
|
-
)) : (y.value = y.value.filter((h) => h.id !== c.id), k.value && (
|
|
5628
|
-
|
|
5627
|
+
)) : (y.value = y.value.filter((h) => h.id !== c.id), k.value && (q == null || q.setMessages(k.value, y.value))), c.muid) {
|
|
5628
|
+
W.value = W.value.filter(
|
|
5629
5629
|
(b) => b.muid !== c.muid
|
|
5630
5630
|
);
|
|
5631
|
-
const h = (
|
|
5631
|
+
const h = (q == null ? void 0 : q.getQueue().filter((b) => b.muid === c.muid)) ?? [];
|
|
5632
5632
|
for (const b of h)
|
|
5633
|
-
|
|
5633
|
+
q == null || q.dequeue(b.id), Ge.delete(b.id), b.kind === "attachment" && (q == null || q.deleteQueuedAttachment(b.id));
|
|
5634
5634
|
}
|
|
5635
5635
|
c.parentMessageId || gn(c.conversationId);
|
|
5636
5636
|
}
|
|
5637
5637
|
function Ie(c) {
|
|
5638
|
-
var
|
|
5638
|
+
var te, oe;
|
|
5639
5639
|
if (c.parentMessageId)
|
|
5640
5640
|
return;
|
|
5641
5641
|
const h = c.conversationId, b = D.value.find(
|
|
5642
|
-
(
|
|
5642
|
+
(K) => K.id === h
|
|
5643
5643
|
);
|
|
5644
5644
|
if (!b)
|
|
5645
5645
|
return;
|
|
5646
|
-
const A = (
|
|
5646
|
+
const A = (te = b.lastMessageAt) == null ? void 0 : te.getTime(), R = (oe = c.sentAt) == null ? void 0 : oe.getTime();
|
|
5647
5647
|
if (A != null && R != null && A > R)
|
|
5648
5648
|
return;
|
|
5649
5649
|
const $ = h === k.value;
|
|
5650
5650
|
let H;
|
|
5651
5651
|
if ($)
|
|
5652
|
-
for (let
|
|
5653
|
-
const
|
|
5654
|
-
if (!
|
|
5655
|
-
H =
|
|
5652
|
+
for (let K = y.value.length - 1; K >= 0; K--) {
|
|
5653
|
+
const de = y.value[K];
|
|
5654
|
+
if (!de.parentMessageId && de.id !== c.id && !de.isDeleted) {
|
|
5655
|
+
H = de;
|
|
5656
5656
|
break;
|
|
5657
5657
|
}
|
|
5658
5658
|
}
|
|
5659
5659
|
D.value = $t(
|
|
5660
|
-
D.value.map((
|
|
5661
|
-
...
|
|
5660
|
+
D.value.map((K) => K.id !== h ? K : H ? {
|
|
5661
|
+
...K,
|
|
5662
5662
|
subtitle: Dn(H),
|
|
5663
5663
|
lastMessageAt: H.sentAt
|
|
5664
5664
|
} : $ ? {
|
|
5665
|
-
...
|
|
5665
|
+
...K,
|
|
5666
5666
|
subtitle: "No messages yet",
|
|
5667
5667
|
lastMessageAt: void 0
|
|
5668
|
-
} :
|
|
5669
|
-
),
|
|
5668
|
+
} : K)
|
|
5669
|
+
), q == null || q.setConversations(D.value);
|
|
5670
5670
|
}
|
|
5671
5671
|
function gn(c, h) {
|
|
5672
5672
|
const A = y.value.length > 0 ? y.value[y.value.length - 1] : null;
|
|
@@ -5676,7 +5676,7 @@ function S0({
|
|
|
5676
5676
|
subtitle: A ? Dn(A) : "No messages yet",
|
|
5677
5677
|
lastMessageAt: A == null ? void 0 : A.sentAt
|
|
5678
5678
|
})
|
|
5679
|
-
),
|
|
5679
|
+
), q == null || q.setConversations(D.value);
|
|
5680
5680
|
}
|
|
5681
5681
|
function bn(c) {
|
|
5682
5682
|
D.value = $t(
|
|
@@ -5686,7 +5686,7 @@ function S0({
|
|
|
5686
5686
|
lastMessageAt: c.sentAt,
|
|
5687
5687
|
unreadCount: 0
|
|
5688
5688
|
})
|
|
5689
|
-
),
|
|
5689
|
+
), q == null || q.setConversations(D.value);
|
|
5690
5690
|
}
|
|
5691
5691
|
function iu(c) {
|
|
5692
5692
|
var A, R;
|
|
@@ -5749,7 +5749,7 @@ function S0({
|
|
|
5749
5749
|
function Ou(c) {
|
|
5750
5750
|
if (typeof navigator < "u" && !navigator.onLine)
|
|
5751
5751
|
return !0;
|
|
5752
|
-
const h =
|
|
5752
|
+
const h = Re(c, "").toLowerCase();
|
|
5753
5753
|
return h.includes("network") || h.includes("failed to fetch") || h.includes("socket") || h.includes("offline");
|
|
5754
5754
|
}
|
|
5755
5755
|
function dr(c, h, b, A, R) {
|
|
@@ -5802,16 +5802,16 @@ function S0({
|
|
|
5802
5802
|
aa($, H);
|
|
5803
5803
|
}
|
|
5804
5804
|
function Ei(c, h, b) {
|
|
5805
|
-
const R = Date.now(), $ = (
|
|
5806
|
-
return
|
|
5807
|
-
if (
|
|
5805
|
+
const R = Date.now(), $ = (K) => K.trim().toLowerCase(), H = (K) => K.map((de) => $(de)).filter(Boolean).join("\0"), te = $(h.question), oe = H(h.options);
|
|
5806
|
+
return W.value.some((K) => {
|
|
5807
|
+
if (K.kind !== "poll" || !K.poll || K.conversationId !== c.id || K.targetId !== c.targetId || K.parentMessageId !== b)
|
|
5808
5808
|
return !1;
|
|
5809
|
-
const
|
|
5810
|
-
return Number.isNaN(
|
|
5809
|
+
const de = new Date(K.createdAt).getTime();
|
|
5810
|
+
return Number.isNaN(de) || R - de > 5e3 ? !1 : $(K.poll.question) === te && H(K.poll.options) === oe;
|
|
5811
5811
|
});
|
|
5812
5812
|
}
|
|
5813
5813
|
async function hr(c, h, b, A, R) {
|
|
5814
|
-
var oe,
|
|
5814
|
+
var oe, K;
|
|
5815
5815
|
const $ = qa(h.file), H = iu({
|
|
5816
5816
|
conversation: c,
|
|
5817
5817
|
kind: $,
|
|
@@ -5828,7 +5828,7 @@ function S0({
|
|
|
5828
5828
|
parentMessageId: A,
|
|
5829
5829
|
muid: R,
|
|
5830
5830
|
deliveryState: "queued"
|
|
5831
|
-
}),
|
|
5831
|
+
}), te = {
|
|
5832
5832
|
id: H.id,
|
|
5833
5833
|
muid: R,
|
|
5834
5834
|
conversationId: c.id,
|
|
@@ -5840,28 +5840,28 @@ function S0({
|
|
|
5840
5840
|
name: h.file.name,
|
|
5841
5841
|
type: En(h.file),
|
|
5842
5842
|
size: h.file.size,
|
|
5843
|
-
caption: ((
|
|
5843
|
+
caption: ((K = h.caption) == null ? void 0 : K.trim()) || void 0
|
|
5844
5844
|
},
|
|
5845
5845
|
metadata: b,
|
|
5846
5846
|
parentMessageId: A,
|
|
5847
5847
|
createdAt: H.sentAt.toISOString()
|
|
5848
5848
|
};
|
|
5849
|
-
|
|
5849
|
+
Ge.set(te.id, h.file);
|
|
5850
5850
|
try {
|
|
5851
|
-
await (
|
|
5851
|
+
await (q == null ? void 0 : q.storeQueuedAttachment(te.id, h.file));
|
|
5852
5852
|
} catch {
|
|
5853
5853
|
}
|
|
5854
|
-
aa(H,
|
|
5854
|
+
aa(H, te);
|
|
5855
5855
|
}
|
|
5856
5856
|
function aa(c, h) {
|
|
5857
|
-
|
|
5857
|
+
W.value = [...W.value, h], q == null || q.enqueue(h), vn(c);
|
|
5858
5858
|
}
|
|
5859
5859
|
function vn(c) {
|
|
5860
5860
|
var h;
|
|
5861
|
-
c.parentMessageId ? (((h =
|
|
5861
|
+
c.parentMessageId ? (((h = O.value) == null ? void 0 : h.id) === c.parentMessageId && (E.value = Bt(
|
|
5862
5862
|
E.value,
|
|
5863
5863
|
c
|
|
5864
|
-
)), Ye(c.parentMessageId)) : y.value = Bt(y.value, c), bn(c),
|
|
5864
|
+
)), Ye(c.parentMessageId)) : y.value = Bt(y.value, c), bn(c), $e();
|
|
5865
5865
|
}
|
|
5866
5866
|
function su(c, h) {
|
|
5867
5867
|
const b = (A) => A.map((R) => {
|
|
@@ -5871,7 +5871,7 @@ function S0({
|
|
|
5871
5871
|
deliveryState: c
|
|
5872
5872
|
};
|
|
5873
5873
|
});
|
|
5874
|
-
y.value = b(y.value), E.value = b(E.value),
|
|
5874
|
+
y.value = b(y.value), E.value = b(E.value), $e();
|
|
5875
5875
|
}
|
|
5876
5876
|
function ra(c) {
|
|
5877
5877
|
if (!c)
|
|
@@ -5889,26 +5889,26 @@ function S0({
|
|
|
5889
5889
|
}
|
|
5890
5890
|
async function oa() {
|
|
5891
5891
|
var c;
|
|
5892
|
-
if (!(f.value ||
|
|
5892
|
+
if (!(f.value || W.value.length === 0 || !g.value || m.value)) {
|
|
5893
5893
|
f.value = !0;
|
|
5894
5894
|
try {
|
|
5895
|
-
const h = [...
|
|
5895
|
+
const h = [...W.value].filter((b) => !ge.has(b.id)).sort((b, A) => b.createdAt.localeCompare(A.createdAt));
|
|
5896
5896
|
for (const b of h)
|
|
5897
|
-
if (!
|
|
5898
|
-
|
|
5897
|
+
if (!ge.has(b.id)) {
|
|
5898
|
+
ge.add(b.id);
|
|
5899
5899
|
try {
|
|
5900
5900
|
const A = await Si(b);
|
|
5901
|
-
|
|
5901
|
+
W.value = W.value.filter(
|
|
5902
5902
|
(R) => R.id !== b.id
|
|
5903
|
-
),
|
|
5903
|
+
), q == null || q.dequeue(b.id), Ge.delete(b.id), b.kind === "attachment" && await (q == null ? void 0 : q.deleteQueuedAttachment(b.id)), ra(b.muid), A ? fe(
|
|
5904
5904
|
Xe(A, (c = _.value) == null ? void 0 : c.uid)
|
|
5905
5905
|
) : await V();
|
|
5906
5906
|
} finally {
|
|
5907
|
-
|
|
5907
|
+
ge.delete(b.id);
|
|
5908
5908
|
}
|
|
5909
5909
|
}
|
|
5910
5910
|
} catch (h) {
|
|
5911
|
-
Ou(h) || (w.value =
|
|
5911
|
+
Ou(h) || (w.value = Re(
|
|
5912
5912
|
h,
|
|
5913
5913
|
"Unable to sync queued messages."
|
|
5914
5914
|
));
|
|
@@ -5918,44 +5918,44 @@ function S0({
|
|
|
5918
5918
|
}
|
|
5919
5919
|
}
|
|
5920
5920
|
async function Si(c) {
|
|
5921
|
-
var A, R, $, H,
|
|
5921
|
+
var A, R, $, H, te, oe, K, de;
|
|
5922
5922
|
const h = c.receiverType === "group" ? j.RECEIVER_TYPE.GROUP : j.RECEIVER_TYPE.USER;
|
|
5923
5923
|
if (c.kind === "poll" && c.poll) {
|
|
5924
|
-
const
|
|
5924
|
+
const he = {
|
|
5925
5925
|
question: c.poll.question,
|
|
5926
5926
|
options: c.poll.options,
|
|
5927
5927
|
receiver: c.targetId,
|
|
5928
5928
|
receiverType: h
|
|
5929
5929
|
};
|
|
5930
|
-
c.parentMessageId && (
|
|
5930
|
+
c.parentMessageId && (he.parentMessageId = Number(c.parentMessageId)), c.metadata && Object.keys(c.metadata).length > 0 && (he.metadata = c.metadata);
|
|
5931
5931
|
const re = await j.callExtension(
|
|
5932
5932
|
"polls",
|
|
5933
5933
|
"POST",
|
|
5934
5934
|
"v2/create",
|
|
5935
|
-
|
|
5935
|
+
he
|
|
5936
5936
|
);
|
|
5937
5937
|
return (re == null ? void 0 : re.message) ?? (re == null ? void 0 : re.custom_message) ?? ((A = re == null ? void 0 : re.data) == null ? void 0 : A.message) ?? null;
|
|
5938
5938
|
}
|
|
5939
5939
|
if (c.kind === "attachment" && c.attachment) {
|
|
5940
|
-
const
|
|
5941
|
-
if (!
|
|
5940
|
+
const he = Ge.get(c.id) ?? await (q == null ? void 0 : q.getQueuedAttachment(c.id)) ?? null;
|
|
5941
|
+
if (!he)
|
|
5942
5942
|
throw new Error(
|
|
5943
5943
|
`Queued attachment ${c.attachment.name} is no longer available for upload.`
|
|
5944
5944
|
);
|
|
5945
5945
|
const re = new j.MediaMessage(
|
|
5946
5946
|
c.targetId,
|
|
5947
|
-
|
|
5947
|
+
he,
|
|
5948
5948
|
c.attachment.kind,
|
|
5949
5949
|
h
|
|
5950
5950
|
);
|
|
5951
|
-
return (R = re.setMuid) == null || R.call(re, c.muid), c.metadata && Object.keys(c.metadata).length > 0 && (($ = re.setMetadata) == null || $.call(re, c.metadata)), c.parentMessageId && ((H = re.setParentMessageId) == null || H.call(re, Number(c.parentMessageId))), c.attachment.caption && ((
|
|
5951
|
+
return (R = re.setMuid) == null || R.call(re, c.muid), c.metadata && Object.keys(c.metadata).length > 0 && (($ = re.setMetadata) == null || $.call(re, c.metadata)), c.parentMessageId && ((H = re.setParentMessageId) == null || H.call(re, Number(c.parentMessageId))), c.attachment.caption && ((te = re.setCaption) == null || te.call(re, c.attachment.caption)), j.sendMediaMessage(re);
|
|
5952
5952
|
}
|
|
5953
5953
|
const b = new j.TextMessage(
|
|
5954
5954
|
c.targetId,
|
|
5955
5955
|
c.text ?? "",
|
|
5956
5956
|
h
|
|
5957
5957
|
);
|
|
5958
|
-
return (oe = b.setMuid) == null || oe.call(b, c.muid), c.metadata && Object.keys(c.metadata).length > 0 && ((
|
|
5958
|
+
return (oe = b.setMuid) == null || oe.call(b, c.muid), c.metadata && Object.keys(c.metadata).length > 0 && ((K = b.setMetadata) == null || K.call(b, c.metadata)), c.parentMessageId && ((de = b.setParentMessageId) == null || de.call(b, Number(c.parentMessageId))), j.sendMessage(b);
|
|
5959
5959
|
}
|
|
5960
5960
|
return {
|
|
5961
5961
|
initialized: t,
|
|
@@ -5983,7 +5983,7 @@ function S0({
|
|
|
5983
5983
|
pendingQueueCount: le,
|
|
5984
5984
|
activeConversationId: k,
|
|
5985
5985
|
activeConversation: L,
|
|
5986
|
-
activeThreadParentMessage:
|
|
5986
|
+
activeThreadParentMessage: O,
|
|
5987
5987
|
replyToMessage: z,
|
|
5988
5988
|
editingMessage: Q,
|
|
5989
5989
|
init: Te,
|
|
@@ -6015,7 +6015,7 @@ function S0({
|
|
|
6015
6015
|
}
|
|
6016
6016
|
async function I0(e) {
|
|
6017
6017
|
return $a(e), Yr === e && Tn || (Tn = (async () => {
|
|
6018
|
-
const t =
|
|
6018
|
+
const t = Be(), u = new j.AppSettingsBuilder().subscribePresenceForAllUsers().setRegion(t.region).autoEstablishSocketConnection(!0).setStorageMode(j.StorageMode.SESSION).build();
|
|
6019
6019
|
await j.init(t.appId, u), Yr = e;
|
|
6020
6020
|
})()), Tn;
|
|
6021
6021
|
}
|
|
@@ -6027,7 +6027,7 @@ async function Kr(e) {
|
|
|
6027
6027
|
if (u && u.sub === t.sub && u.token)
|
|
6028
6028
|
return u.token;
|
|
6029
6029
|
const n = await fetch(
|
|
6030
|
-
`${
|
|
6030
|
+
`${Be().chatApiBaseUrl}/chats/token`,
|
|
6031
6031
|
{
|
|
6032
6032
|
method: "POST",
|
|
6033
6033
|
headers: new Headers([["Authorization", `Bearer ${e}`]])
|
|
@@ -6051,8 +6051,8 @@ function F0(e, t) {
|
|
|
6051
6051
|
id: e.getConversationId(),
|
|
6052
6052
|
targetId: a,
|
|
6053
6053
|
type: n,
|
|
6054
|
-
title:
|
|
6055
|
-
subtitle:
|
|
6054
|
+
title: Ne("scheduledMessages"),
|
|
6055
|
+
subtitle: Ne("hiddenHelperConversation"),
|
|
6056
6056
|
unreadCount: 0,
|
|
6057
6057
|
tags: [],
|
|
6058
6058
|
source: e
|
|
@@ -6168,7 +6168,7 @@ function L0(e, t) {
|
|
|
6168
6168
|
"Sent an attachment"
|
|
6169
6169
|
);
|
|
6170
6170
|
}
|
|
6171
|
-
return ((g = (m = (x = e.getSender) == null ? void 0 : x.call(e)) == null ? void 0 : m.getUid) == null ? void 0 : g.call(m)) === t ?
|
|
6171
|
+
return ((g = (m = (x = e.getSender) == null ? void 0 : x.call(e)) == null ? void 0 : m.getUid) == null ? void 0 : g.call(m)) === t ? Ne("youSentAMessage") : Ne("unsupportedMessageType");
|
|
6172
6172
|
}
|
|
6173
6173
|
function P0(e, t) {
|
|
6174
6174
|
var r, o, i, s, l, d, f, x;
|
|
@@ -6194,10 +6194,10 @@ function P0(e, t) {
|
|
|
6194
6194
|
"Sent an attachment"
|
|
6195
6195
|
);
|
|
6196
6196
|
}
|
|
6197
|
-
return ((x = (f = (d = e.getSender) == null ? void 0 : d.call(e)) == null ? void 0 : f.getUid) == null ? void 0 : x.call(f)) === t ?
|
|
6197
|
+
return ((x = (f = (d = e.getSender) == null ? void 0 : d.call(e)) == null ? void 0 : f.getUid) == null ? void 0 : x.call(f)) === t ? Ne("youSentAMessage") : Ne("unsupportedMessageType");
|
|
6198
6198
|
}
|
|
6199
6199
|
function $t(e) {
|
|
6200
|
-
return [...e].filter((t) => t.title !==
|
|
6200
|
+
return [...e].filter((t) => t.title !== Ne("scheduledMessages")).sort((t, u) => {
|
|
6201
6201
|
var r, o;
|
|
6202
6202
|
const n = ((r = t.lastMessageAt) == null ? void 0 : r.getTime()) ?? 0;
|
|
6203
6203
|
return (((o = u.lastMessageAt) == null ? void 0 : o.getTime()) ?? 0) - n;
|
|
@@ -6237,7 +6237,7 @@ function Ta(e, t) {
|
|
|
6237
6237
|
function Dn(e) {
|
|
6238
6238
|
return Xo(e);
|
|
6239
6239
|
}
|
|
6240
|
-
function
|
|
6240
|
+
function Re(e, t) {
|
|
6241
6241
|
return e instanceof Error && e.message ? e.message : t;
|
|
6242
6242
|
}
|
|
6243
6243
|
function ju(e) {
|
|
@@ -6255,7 +6255,7 @@ async function $0(e, t, u) {
|
|
|
6255
6255
|
if (!n)
|
|
6256
6256
|
return;
|
|
6257
6257
|
const a = tr(), r = await fetch(
|
|
6258
|
-
`${
|
|
6258
|
+
`${Be().chatApiBaseUrl}/chats/scheduledMessages`,
|
|
6259
6259
|
{
|
|
6260
6260
|
method: "POST",
|
|
6261
6261
|
headers: {
|
|
@@ -6291,7 +6291,7 @@ async function B0(e, t, u) {
|
|
|
6291
6291
|
t.scheduleDate,
|
|
6292
6292
|
u
|
|
6293
6293
|
), s = await fetch(
|
|
6294
|
-
`${
|
|
6294
|
+
`${Be().chatApiBaseUrl}/chats/scheduledMediaMessages`,
|
|
6295
6295
|
{
|
|
6296
6296
|
method: "POST",
|
|
6297
6297
|
headers: {
|
|
@@ -6615,7 +6615,7 @@ function ar(e) {
|
|
|
6615
6615
|
}
|
|
6616
6616
|
U([]);
|
|
6617
6617
|
function td(e, t) {
|
|
6618
|
-
var o, i, s, l, d, f, x, m, g, w, _, D, y, E, C, I, S, k,
|
|
6618
|
+
var o, i, s, l, d, f, x, m, g, w, _, D, y, E, C, I, S, k, O, z;
|
|
6619
6619
|
const u = ((i = (o = t == null ? void 0 : t.value) == null ? void 0 : o.getMetadata) == null ? void 0 : i.call(o)) ?? {};
|
|
6620
6620
|
if (!((s = e == null ? void 0 : e.getSender) != null && s.call(e)) || u.isChannel)
|
|
6621
6621
|
return "";
|
|
@@ -6623,7 +6623,7 @@ function td(e, t) {
|
|
|
6623
6623
|
let a = ((_ = (w = (g = e == null ? void 0 : e.getReceiver) == null ? void 0 : g.call(e)) == null ? void 0 : w.getMetadata) == null ? void 0 : _.call(w)) ?? {};
|
|
6624
6624
|
e instanceof j.Action && (a = ((E = (y = (D = e == null ? void 0 : e.getActionFor) == null ? void 0 : D.call(e)) == null ? void 0 : y.getMetadata) == null ? void 0 : E.call(y)) ?? {});
|
|
6625
6625
|
const r = a.systemDisplayName;
|
|
6626
|
-
return (S = (I = (C = e == null ? void 0 : e.getData) == null ? void 0 : C.call(e)) == null ? void 0 : I.metadata) != null && S.senderDisplayName && (n == "moderator" || n === void 0) ? e.getData().metadata.senderDisplayName : r && (e instanceof j.Action || n == "admin") ? r : (z = (
|
|
6626
|
+
return (S = (I = (C = e == null ? void 0 : e.getData) == null ? void 0 : C.call(e)) == null ? void 0 : I.metadata) != null && S.senderDisplayName && (n == "moderator" || n === void 0) ? e.getData().metadata.senderDisplayName : r && (e instanceof j.Action || n == "admin") ? r : (z = (O = (k = e == null ? void 0 : e.getSender) == null ? void 0 : k.call(e)) == null ? void 0 : O.getName) == null ? void 0 : z.call(O);
|
|
6627
6627
|
}
|
|
6628
6628
|
function ud(e, t = 25, u) {
|
|
6629
6629
|
const n = e.trim();
|
|
@@ -6679,7 +6679,7 @@ async function ad(e) {
|
|
|
6679
6679
|
var u, n, a;
|
|
6680
6680
|
await Yn("failed to get muted setting. User not logged in");
|
|
6681
6681
|
const t = await Kn(
|
|
6682
|
-
`${
|
|
6682
|
+
`${Be().chatApiBaseUrl}/chats/${e}/settings/${(n = (u = await j.getLoggedinUser()) == null ? void 0 : u.getUid) == null ? void 0 : n.call(u)}`,
|
|
6683
6683
|
{ method: "GET" }
|
|
6684
6684
|
);
|
|
6685
6685
|
return (a = ii()) == null || a.storeParticipantSettings({
|
|
@@ -6692,7 +6692,7 @@ async function rd(e, t) {
|
|
|
6692
6692
|
var n, a, r;
|
|
6693
6693
|
await Yn("failed to mute chat. User not logged in");
|
|
6694
6694
|
const u = await Kn(
|
|
6695
|
-
`${
|
|
6695
|
+
`${Be().chatApiBaseUrl}/chats/${e}/settings/${(a = (n = await j.getLoggedinUser()) == null ? void 0 : n.getUid) == null ? void 0 : a.call(n)}`,
|
|
6696
6696
|
{
|
|
6697
6697
|
method: "PATCH",
|
|
6698
6698
|
body: JSON.stringify({ mutedUntil: t })
|
|
@@ -6708,7 +6708,7 @@ async function ni() {
|
|
|
6708
6708
|
return await Yn(
|
|
6709
6709
|
"failed to get muted all setting. User not logged in"
|
|
6710
6710
|
), Kn(
|
|
6711
|
-
`${
|
|
6711
|
+
`${Be().chatApiBaseUrl}/person/settings`,
|
|
6712
6712
|
{ method: "GET" }
|
|
6713
6713
|
);
|
|
6714
6714
|
}
|
|
@@ -6716,7 +6716,7 @@ async function ai(e) {
|
|
|
6716
6716
|
return await Yn(
|
|
6717
6717
|
"failed to update person settings. User not logged in"
|
|
6718
6718
|
), Kn(
|
|
6719
|
-
`${
|
|
6719
|
+
`${Be().chatApiBaseUrl}/person/settings`,
|
|
6720
6720
|
{
|
|
6721
6721
|
method: "PATCH",
|
|
6722
6722
|
body: JSON.stringify(e)
|
|
@@ -6745,7 +6745,7 @@ function ii() {
|
|
|
6745
6745
|
}
|
|
6746
6746
|
function si() {
|
|
6747
6747
|
const e = Ua();
|
|
6748
|
-
return e ? `bcc-chat:${
|
|
6748
|
+
return e ? `bcc-chat:${Be().appId}:${e}` : null;
|
|
6749
6749
|
}
|
|
6750
6750
|
function id() {
|
|
6751
6751
|
return j.__bccCompatLoggedInUser ?? null;
|
|
@@ -6788,7 +6788,7 @@ function Xr(e, t) {
|
|
|
6788
6788
|
}
|
|
6789
6789
|
return n;
|
|
6790
6790
|
}
|
|
6791
|
-
const
|
|
6791
|
+
const pe = Ma(null);
|
|
6792
6792
|
function sd(e) {
|
|
6793
6793
|
const t = {
|
|
6794
6794
|
palette: {
|
|
@@ -6821,14 +6821,14 @@ function fi(e) {
|
|
|
6821
6821
|
li.value = e, ld(e), !(typeof document > "u") && document.documentElement.classList.toggle("dark", e === "dark");
|
|
6822
6822
|
}
|
|
6823
6823
|
function Qn(e) {
|
|
6824
|
-
if (
|
|
6825
|
-
return
|
|
6824
|
+
if (pe.value && !e && !Mn.value)
|
|
6825
|
+
return pe.value;
|
|
6826
6826
|
const t = e ?? Mn.value;
|
|
6827
6827
|
if (!t)
|
|
6828
6828
|
throw new Error(
|
|
6829
6829
|
"Environment has not been set yet. Call app.use(chat, { environment: ... }) first."
|
|
6830
6830
|
);
|
|
6831
|
-
return (!
|
|
6831
|
+
return (!pe.value || Mn.value !== t) && (Mn.value = t, $a(t), pe.value = S0({ environment: t })), pe.value;
|
|
6832
6832
|
}
|
|
6833
6833
|
function dd(e) {
|
|
6834
6834
|
var u, n, a, r, o, i, s;
|
|
@@ -6844,24 +6844,24 @@ function dd(e) {
|
|
|
6844
6844
|
}
|
|
6845
6845
|
const hi = N(() => {
|
|
6846
6846
|
var e;
|
|
6847
|
-
return ((e =
|
|
6847
|
+
return ((e = pe.value) == null ? void 0 : e.connected.value) ?? !1;
|
|
6848
6848
|
}), fd = N(() => or.value && !hi.value), ir = N(() => {
|
|
6849
6849
|
var e;
|
|
6850
|
-
return ((e =
|
|
6850
|
+
return ((e = pe.value) == null ? void 0 : e.loggedIn.value) ?? !1;
|
|
6851
6851
|
}), ka = {
|
|
6852
6852
|
onlineMode: N({
|
|
6853
6853
|
get: () => {
|
|
6854
6854
|
var e;
|
|
6855
|
-
return (e =
|
|
6855
|
+
return (e = pe.value) != null && e.offlineMode.value ? "offline" : "online";
|
|
6856
6856
|
},
|
|
6857
6857
|
set: (e) => {
|
|
6858
|
-
|
|
6858
|
+
pe.value && (pe.value.offlineMode.value = e === "offline");
|
|
6859
6859
|
}
|
|
6860
6860
|
}),
|
|
6861
|
-
onlineStatus: N(() =>
|
|
6861
|
+
onlineStatus: N(() => pe.value ? pe.value.offlineMode.value || !pe.value.connected.value ? "offline" : "online" : "offline")
|
|
6862
6862
|
}, pi = N(() => {
|
|
6863
6863
|
var e, t;
|
|
6864
|
-
return (((t = (e =
|
|
6864
|
+
return (((t = (e = pe.value) == null ? void 0 : e.conversations) == null ? void 0 : t.value) ?? []).map((u) => ({
|
|
6865
6865
|
chatUid: u.targetId,
|
|
6866
6866
|
name: u.title,
|
|
6867
6867
|
unreadMessageCount: u.unreadCount,
|
|
@@ -6887,7 +6887,7 @@ async function hd(e, t) {
|
|
|
6887
6887
|
},
|
|
6888
6888
|
{ immediate: !0 }
|
|
6889
6889
|
) : t.accessToken && await Nn(t.accessToken), Bn(Xu.INFO, "Chat initialized", {
|
|
6890
|
-
environment:
|
|
6890
|
+
environment: Be().appId
|
|
6891
6891
|
});
|
|
6892
6892
|
}
|
|
6893
6893
|
async function Nn(e) {
|
|
@@ -6897,7 +6897,7 @@ async function Nn(e) {
|
|
|
6897
6897
|
Bn(Xu.INFO, "Signing in to chat"), await t.login(e);
|
|
6898
6898
|
}
|
|
6899
6899
|
async function Xn() {
|
|
6900
|
-
|
|
6900
|
+
pe.value && (Bn(Xu.INFO, "Signing out from chat"), await pe.value.logout());
|
|
6901
6901
|
}
|
|
6902
6902
|
async function pd(e) {
|
|
6903
6903
|
const t = e ?? "default";
|
|
@@ -6906,13 +6906,13 @@ async function pd(e) {
|
|
|
6906
6906
|
await u.init(), await u.connectRealtime(), await mi();
|
|
6907
6907
|
}
|
|
6908
6908
|
async function md(e) {
|
|
6909
|
-
if (!
|
|
6909
|
+
if (!pe.value)
|
|
6910
6910
|
return;
|
|
6911
6911
|
const t = e ?? "default";
|
|
6912
|
-
$n.delete(t), !($n.size > 0) && (await
|
|
6912
|
+
$n.delete(t), !($n.size > 0) && (await pe.value.disconnectRealtime(), pe.value.closeThread());
|
|
6913
6913
|
}
|
|
6914
6914
|
async function gd() {
|
|
6915
|
-
$n.clear(),
|
|
6915
|
+
$n.clear(), pe.value && (await pe.value.disconnectRealtime(), pe.value.closeThread());
|
|
6916
6916
|
}
|
|
6917
6917
|
function bd(e) {
|
|
6918
6918
|
ci.value = e;
|
|
@@ -6939,12 +6939,12 @@ async function Cd(e) {
|
|
|
6939
6939
|
}
|
|
6940
6940
|
}
|
|
6941
6941
|
async function mi() {
|
|
6942
|
-
return
|
|
6942
|
+
return pe.value ? (await pe.value.fetchConversations(), pi.value) : [];
|
|
6943
6943
|
}
|
|
6944
6944
|
async function Td(e) {
|
|
6945
|
-
if (!
|
|
6945
|
+
if (!pe.value)
|
|
6946
6946
|
return;
|
|
6947
|
-
const t =
|
|
6947
|
+
const t = pe.value.conversations.value.find(
|
|
6948
6948
|
(u) => u.targetId === e || u.id === e
|
|
6949
6949
|
);
|
|
6950
6950
|
t && (t.unreadCount = 0);
|
|
@@ -6960,16 +6960,16 @@ async function kd(e) {
|
|
|
6960
6960
|
}
|
|
6961
6961
|
async function Md(e, t) {
|
|
6962
6962
|
const u = await rd(e, t);
|
|
6963
|
-
return
|
|
6964
|
-
|
|
6963
|
+
return pe.value && (pe.value.conversations.value = oi(
|
|
6964
|
+
pe.value.conversations.value,
|
|
6965
6965
|
e,
|
|
6966
6966
|
u
|
|
6967
6967
|
)), u;
|
|
6968
6968
|
}
|
|
6969
6969
|
async function wd(e) {
|
|
6970
6970
|
const t = await ad(e);
|
|
6971
|
-
return
|
|
6972
|
-
|
|
6971
|
+
return pe.value && (pe.value.conversations.value = oi(
|
|
6972
|
+
pe.value.conversations.value,
|
|
6973
6973
|
e,
|
|
6974
6974
|
t
|
|
6975
6975
|
)), t;
|
|
@@ -6977,7 +6977,7 @@ async function wd(e) {
|
|
|
6977
6977
|
function Ad(e) {
|
|
6978
6978
|
di.value = e;
|
|
6979
6979
|
}
|
|
6980
|
-
const
|
|
6980
|
+
const ze = {
|
|
6981
6981
|
install: hd,
|
|
6982
6982
|
setGetChatMessagesCallback: bd,
|
|
6983
6983
|
initialized: or,
|
|
@@ -6992,7 +6992,7 @@ const He = {
|
|
|
6992
6992
|
login: Nn,
|
|
6993
6993
|
logout: Xn,
|
|
6994
6994
|
setCurrentEnvironment: _d,
|
|
6995
|
-
getCurrentEnvironment:
|
|
6995
|
+
getCurrentEnvironment: Be,
|
|
6996
6996
|
setThemeMode: xd,
|
|
6997
6997
|
setLanguage: vd,
|
|
6998
6998
|
getGroup: Cd,
|
|
@@ -7005,7 +7005,7 @@ const He = {
|
|
|
7005
7005
|
return ud(
|
|
7006
7006
|
e,
|
|
7007
7007
|
t,
|
|
7008
|
-
(n = (u =
|
|
7008
|
+
(n = (u = pe.value) == null ? void 0 : u.currentUser.value) == null ? void 0 : n.uid
|
|
7009
7009
|
);
|
|
7010
7010
|
},
|
|
7011
7011
|
getSenderDisplayName: td,
|
|
@@ -7213,16 +7213,16 @@ function Bd(e) {
|
|
|
7213
7213
|
(S = o.value) == null || S.focusEditor();
|
|
7214
7214
|
}
|
|
7215
7215
|
function f(S) {
|
|
7216
|
-
const k = e.getClient(),
|
|
7217
|
-
return
|
|
7216
|
+
const k = e.getClient(), O = k == null ? void 0 : k.activeThreadParentMessage.value;
|
|
7217
|
+
return O ? String(S.id) === String(O.id) || String(S.parentMessageId ?? "") === String(O.id) : !1;
|
|
7218
7218
|
}
|
|
7219
7219
|
function x(S) {
|
|
7220
|
-
var k,
|
|
7220
|
+
var k, O, z, Q, W, le;
|
|
7221
7221
|
if (["image", "video", "audio", "file"].includes(S.kind)) {
|
|
7222
|
-
const L = (Q = (z = (
|
|
7222
|
+
const L = (Q = (z = (O = (k = S.source) == null ? void 0 : k.getCaption) == null ? void 0 : O.call(k)) == null ? void 0 : z.trim) == null ? void 0 : Q.call(z);
|
|
7223
7223
|
return L || (S.source ? "" : S.text);
|
|
7224
7224
|
}
|
|
7225
|
-
return ((le = (
|
|
7225
|
+
return ((le = (W = S.source) == null ? void 0 : W.getText) == null ? void 0 : le.call(W)) || S.text;
|
|
7226
7226
|
}
|
|
7227
7227
|
function m(S) {
|
|
7228
7228
|
t.value = x(S);
|
|
@@ -7503,7 +7503,7 @@ function Gd({
|
|
|
7503
7503
|
const { message: s, optionId: l } = i, d = e.client.value;
|
|
7504
7504
|
d && await d.votePoll(s, l);
|
|
7505
7505
|
}), r("message:openReference", (i) => {
|
|
7506
|
-
|
|
7506
|
+
ze.scrollToMessage(i);
|
|
7507
7507
|
}), r("composer:send", (i) => {
|
|
7508
7508
|
const { target: s } = i;
|
|
7509
7509
|
s === "thread" ? t.sendThreadMessage() : t.sendMessage();
|
|
@@ -7640,22 +7640,22 @@ function Kd(e) {
|
|
|
7640
7640
|
function Qd(e) {
|
|
7641
7641
|
async function t() {
|
|
7642
7642
|
var o;
|
|
7643
|
-
const n =
|
|
7643
|
+
const n = ze.scrollToMessageId.value ?? ze.loadMessageId.value ?? e.getPropLoadMessageId();
|
|
7644
7644
|
if (!n)
|
|
7645
7645
|
return;
|
|
7646
7646
|
const a = e.getClient();
|
|
7647
7647
|
if (a && !await a.ensureMessageLoaded(n)) {
|
|
7648
|
-
|
|
7648
|
+
ze.scrollToMessageId.value === n && (ze.scrollToMessageId.value = void 0), ze.loadMessageId.value === n && (ze.loadMessageId.value = void 0);
|
|
7649
7649
|
return;
|
|
7650
7650
|
}
|
|
7651
7651
|
await Xt();
|
|
7652
7652
|
const r = (o = e.chatRootRef.value) == null ? void 0 : o.querySelector(
|
|
7653
7653
|
`[data-message-id="${n}"]`
|
|
7654
7654
|
);
|
|
7655
|
-
r && (r.scrollIntoView({ behavior: "smooth", block: "center", inline: "nearest" }),
|
|
7655
|
+
r && (r.scrollIntoView({ behavior: "smooth", block: "center", inline: "nearest" }), ze.scrollToMessageId.value === n && (ze.scrollToMessageId.value = void 0), ze.loadMessageId.value === n && (ze.loadMessageId.value = void 0));
|
|
7656
7656
|
}
|
|
7657
7657
|
function u(n) {
|
|
7658
|
-
|
|
7658
|
+
ze.scrollToMessage(n);
|
|
7659
7659
|
}
|
|
7660
7660
|
return { scrollToRequestedMessage: t, handleOpenReferencedMessage: u };
|
|
7661
7661
|
}
|
|
@@ -8016,9 +8016,9 @@ function Tf(e) {
|
|
|
8016
8016
|
C.key === "Escape" && d();
|
|
8017
8017
|
}
|
|
8018
8018
|
function w(C) {
|
|
8019
|
-
var k,
|
|
8019
|
+
var k, O;
|
|
8020
8020
|
C.preventDefault();
|
|
8021
|
-
const I = ((k = C.clipboardData) == null ? void 0 : k.getData("text/html")) ?? "", S = ((
|
|
8021
|
+
const I = ((k = C.clipboardData) == null ? void 0 : k.getData("text/html")) ?? "", S = ((O = C.clipboardData) == null ? void 0 : O.getData("text/plain")) ?? "";
|
|
8022
8022
|
if (document.execCommand("styleWithCSS", !1, "false"), I) {
|
|
8023
8023
|
const z = Ut(I);
|
|
8024
8024
|
if (z) {
|
|
@@ -8081,7 +8081,7 @@ const kf = {
|
|
|
8081
8081
|
__name: "ComposerActionsPopover",
|
|
8082
8082
|
emits: ["pickFile", "openPoll"],
|
|
8083
8083
|
setup(e, { expose: t, emit: u }) {
|
|
8084
|
-
const n = u, a = U(null), { t: r } =
|
|
8084
|
+
const n = u, a = U(null), { t: r } = Oe(), o = [
|
|
8085
8085
|
{ kind: "image", label: "attachImage", icon: hf, testId: "composer-attach-image" },
|
|
8086
8086
|
{ kind: "video", label: "attachVideo", icon: Cf, testId: "composer-attach-video" },
|
|
8087
8087
|
{ kind: "audio", label: "attachAudio", icon: mf, testId: "composer-attach-audio" },
|
|
@@ -8105,9 +8105,9 @@ const kf = {
|
|
|
8105
8105
|
ref_key: "popoverRef",
|
|
8106
8106
|
ref: a
|
|
8107
8107
|
}, {
|
|
8108
|
-
default:
|
|
8108
|
+
default: He(() => [
|
|
8109
8109
|
T("div", kf, [
|
|
8110
|
-
(M(), F(
|
|
8110
|
+
(M(), F(je, null, ht(o, (m) => T("button", {
|
|
8111
8111
|
key: m.kind,
|
|
8112
8112
|
type: "button",
|
|
8113
8113
|
class: "composer-actions-menu__item",
|
|
@@ -8115,7 +8115,7 @@ const kf = {
|
|
|
8115
8115
|
onClick: (g) => l(m.kind)
|
|
8116
8116
|
}, [
|
|
8117
8117
|
T("span", wf, [
|
|
8118
|
-
(M(), ne(
|
|
8118
|
+
(M(), ne(at(m.icon), { class: "size-5" }))
|
|
8119
8119
|
]),
|
|
8120
8120
|
T("span", null, Z(v(r)(m.label)), 1)
|
|
8121
8121
|
], 8, Mf)), 64)),
|
|
@@ -8126,7 +8126,7 @@ const kf = {
|
|
|
8126
8126
|
onClick: d
|
|
8127
8127
|
}, [
|
|
8128
8128
|
T("span", Af, [
|
|
8129
|
-
(M(), ne(
|
|
8129
|
+
(M(), ne(at(v(Jd)), { class: "size-5" }))
|
|
8130
8130
|
]),
|
|
8131
8131
|
T("span", null, Z(v(r)("createPoll")), 1)
|
|
8132
8132
|
])
|
|
@@ -8149,7 +8149,7 @@ const kf = {
|
|
|
8149
8149
|
},
|
|
8150
8150
|
emits: ["cancel"],
|
|
8151
8151
|
setup(e, { emit: t }) {
|
|
8152
|
-
const u = t, { t: n } =
|
|
8152
|
+
const u = t, { t: n } = Oe();
|
|
8153
8153
|
return (a, r) => (M(), F("div", {
|
|
8154
8154
|
class: Ce(["context-banner", `context-banner--${e.variant}`])
|
|
8155
8155
|
}, [
|
|
@@ -8158,7 +8158,7 @@ const kf = {
|
|
|
8158
8158
|
T("p", Ff, Z(e.message.senderName), 1),
|
|
8159
8159
|
T("p", Rf, Z(v(xu)(e.message)), 1)
|
|
8160
8160
|
]),
|
|
8161
|
-
ie(v(
|
|
8161
|
+
ie(v(rt), {
|
|
8162
8162
|
icon: v(cr),
|
|
8163
8163
|
text: "",
|
|
8164
8164
|
rounded: "",
|
|
@@ -8175,7 +8175,7 @@ const kf = {
|
|
|
8175
8175
|
},
|
|
8176
8176
|
emits: ["format"],
|
|
8177
8177
|
setup(e, { emit: t }) {
|
|
8178
|
-
const u = t, { t: n } =
|
|
8178
|
+
const u = t, { t: n } = Oe();
|
|
8179
8179
|
return (a, r) => e.visible ? (M(), F("div", {
|
|
8180
8180
|
key: 0,
|
|
8181
8181
|
class: "format-menu",
|
|
@@ -8221,7 +8221,7 @@ const kf = {
|
|
|
8221
8221
|
},
|
|
8222
8222
|
emits: ["update:visible", "send"],
|
|
8223
8223
|
setup(e, { expose: t, emit: u }) {
|
|
8224
|
-
const n = e, a = u, { t: r } =
|
|
8224
|
+
const n = e, a = u, { t: r } = Oe(), o = U(""), i = U(["", ""]), s = N(() => {
|
|
8225
8225
|
const g = o.value.trim(), w = i.value.map((_) => _.trim()).filter(Boolean);
|
|
8226
8226
|
return !!g && w.length >= 2;
|
|
8227
8227
|
});
|
|
@@ -8251,7 +8251,7 @@ const kf = {
|
|
|
8251
8251
|
draggable: !1,
|
|
8252
8252
|
"onUpdate:visible": m
|
|
8253
8253
|
}, {
|
|
8254
|
-
default:
|
|
8254
|
+
default: He(() => [
|
|
8255
8255
|
T("div", Pf, [
|
|
8256
8256
|
T("div", $f, [
|
|
8257
8257
|
T("label", Bf, Z(v(r)("question")), 1),
|
|
@@ -8266,7 +8266,7 @@ const kf = {
|
|
|
8266
8266
|
]),
|
|
8267
8267
|
T("div", Uf, [
|
|
8268
8268
|
T("label", zf, Z(v(r)("options")), 1),
|
|
8269
|
-
(M(!0), F(
|
|
8269
|
+
(M(!0), F(je, null, ht(i.value, (_, D) => (M(), F("div", {
|
|
8270
8270
|
key: D,
|
|
8271
8271
|
class: "poll-dialog-option-row"
|
|
8272
8272
|
}, [
|
|
@@ -8278,7 +8278,7 @@ const kf = {
|
|
|
8278
8278
|
"onUpdate:modelValue": (y) => i.value[D] = String(y)
|
|
8279
8279
|
}, null, 8, ["model-value", "placeholder", "onUpdate:modelValue"])
|
|
8280
8280
|
]),
|
|
8281
|
-
ie(v(
|
|
8281
|
+
ie(v(rt), {
|
|
8282
8282
|
icon: v(cr),
|
|
8283
8283
|
text: "",
|
|
8284
8284
|
rounded: "",
|
|
@@ -8287,7 +8287,7 @@ const kf = {
|
|
|
8287
8287
|
onClick: (y) => d(D)
|
|
8288
8288
|
}, null, 8, ["icon", "disabled", "onClick"])
|
|
8289
8289
|
]))), 128)),
|
|
8290
|
-
ie(v(
|
|
8290
|
+
ie(v(rt), {
|
|
8291
8291
|
label: v(r)("addOption"),
|
|
8292
8292
|
icon: v(ki),
|
|
8293
8293
|
text: "",
|
|
@@ -8295,12 +8295,12 @@ const kf = {
|
|
|
8295
8295
|
}, null, 8, ["label", "icon"])
|
|
8296
8296
|
]),
|
|
8297
8297
|
T("div", Zf, [
|
|
8298
|
-
ie(v(
|
|
8298
|
+
ie(v(rt), {
|
|
8299
8299
|
label: v(r)("cancel"),
|
|
8300
8300
|
text: "",
|
|
8301
8301
|
onClick: m
|
|
8302
8302
|
}, null, 8, ["label"]),
|
|
8303
|
-
ie(v(
|
|
8303
|
+
ie(v(rt), {
|
|
8304
8304
|
label: v(r)("sendPoll"),
|
|
8305
8305
|
icon: v(Ai),
|
|
8306
8306
|
disabled: n.disabled || !s.value,
|
|
@@ -8322,7 +8322,7 @@ const kf = {
|
|
|
8322
8322
|
},
|
|
8323
8323
|
emits: ["update:visible", "schedule"],
|
|
8324
8324
|
setup(e, { expose: t, emit: u }) {
|
|
8325
|
-
const n = e, a = u, { t: r } =
|
|
8325
|
+
const n = e, a = u, { t: r } = Oe(), o = U(l()), i = U(d());
|
|
8326
8326
|
function s() {
|
|
8327
8327
|
return new Date(Date.now() + 60 * 60 * 1e3);
|
|
8328
8328
|
}
|
|
@@ -8356,7 +8356,7 @@ const kf = {
|
|
|
8356
8356
|
draggable: !1,
|
|
8357
8357
|
"onUpdate:visible": _
|
|
8358
8358
|
}, {
|
|
8359
|
-
default:
|
|
8359
|
+
default: He(() => [
|
|
8360
8360
|
T("div", Gf, [
|
|
8361
8361
|
T("div", Wf, [
|
|
8362
8362
|
T("label", Yf, Z(v(r)("sendAt")), 1),
|
|
@@ -8383,12 +8383,12 @@ const kf = {
|
|
|
8383
8383
|
]),
|
|
8384
8384
|
T("div", Qf, Z(e.contentPreview), 1),
|
|
8385
8385
|
T("div", Xf, [
|
|
8386
|
-
ie(v(
|
|
8386
|
+
ie(v(rt), {
|
|
8387
8387
|
label: v(r)("cancel"),
|
|
8388
8388
|
text: "",
|
|
8389
8389
|
onClick: _
|
|
8390
8390
|
}, null, 8, ["label"]),
|
|
8391
|
-
ie(v(
|
|
8391
|
+
ie(v(rt), {
|
|
8392
8392
|
label: v(r)("schedule"),
|
|
8393
8393
|
icon: v(Mi),
|
|
8394
8394
|
disabled: n.disabled || !x.value,
|
|
@@ -8439,7 +8439,7 @@ const kf = {
|
|
|
8439
8439
|
video: "video/*",
|
|
8440
8440
|
audio: "audio/*",
|
|
8441
8441
|
file: "*/*"
|
|
8442
|
-
}, a = e, r = u, o = U(null), i = U(null), s = U(null), l = U("file"), d = U(!1), f = U(!1), x = U(!1), { t: m } =
|
|
8442
|
+
}, a = e, r = u, o = U(null), i = U(null), s = U(null), l = U("file"), d = U(!1), f = U(!1), x = U(!1), { t: m } = Oe();
|
|
8443
8443
|
let g = null;
|
|
8444
8444
|
const {
|
|
8445
8445
|
applyFormat: w,
|
|
@@ -8451,14 +8451,14 @@ const kf = {
|
|
|
8451
8451
|
handleContextMenu: I,
|
|
8452
8452
|
handleInput: S,
|
|
8453
8453
|
handleKeydown: k,
|
|
8454
|
-
handlePaste:
|
|
8454
|
+
handlePaste: O,
|
|
8455
8455
|
hideFormatMenu: z,
|
|
8456
8456
|
resetEditor: Q,
|
|
8457
|
-
showFormatMenu:
|
|
8457
|
+
showFormatMenu: W
|
|
8458
8458
|
} = Tf({
|
|
8459
8459
|
getModelValue: () => a.modelValue,
|
|
8460
8460
|
updateModelValue: (Te) => r("update:modelValue", Te),
|
|
8461
|
-
submit: () =>
|
|
8461
|
+
submit: () => G()
|
|
8462
8462
|
}), le = N(() => n[l.value]), L = N(() => {
|
|
8463
8463
|
if (!s.value) return null;
|
|
8464
8464
|
const Te = s.value.type;
|
|
@@ -8476,7 +8476,7 @@ const kf = {
|
|
|
8476
8476
|
default:
|
|
8477
8477
|
return m("attachment");
|
|
8478
8478
|
}
|
|
8479
|
-
}),
|
|
8479
|
+
}), Y = N(() => !a.editingMessage && !a.replyToMessage ? "" : a.compact ? "pt-1" : "pt-1.5"), ee = N(() => jt(a.modelValue) || !!s.value), ue = N(() => ee.value && L.value !== "file"), ve = N(() => s.value ? m("attachmentSummary", { name: s.value.name }) : vu(a.modelValue) || m("currentDraftWillBeScheduled"));
|
|
8480
8480
|
Ke(
|
|
8481
8481
|
() => a.resetSignal,
|
|
8482
8482
|
() => {
|
|
@@ -8487,24 +8487,24 @@ const kf = {
|
|
|
8487
8487
|
await Xt(), C();
|
|
8488
8488
|
}
|
|
8489
8489
|
t({ focusEditor: De });
|
|
8490
|
-
function
|
|
8490
|
+
function Le(Te = "file") {
|
|
8491
8491
|
var se;
|
|
8492
8492
|
l.value = Te, (se = o.value) == null || se.click();
|
|
8493
8493
|
}
|
|
8494
|
-
function
|
|
8494
|
+
function me(Te) {
|
|
8495
8495
|
var ye;
|
|
8496
8496
|
const se = Te.target;
|
|
8497
8497
|
s.value = ((ye = se.files) == null ? void 0 : ye[0]) ?? null;
|
|
8498
8498
|
}
|
|
8499
|
-
function
|
|
8499
|
+
function it() {
|
|
8500
8500
|
s.value = null, o.value && (o.value.value = "");
|
|
8501
8501
|
}
|
|
8502
|
-
function
|
|
8502
|
+
function xe(Te) {
|
|
8503
8503
|
var se;
|
|
8504
8504
|
(se = i.value) == null || se.toggle(Te);
|
|
8505
8505
|
}
|
|
8506
|
-
function
|
|
8507
|
-
if (!(a.disabled || !
|
|
8506
|
+
function G() {
|
|
8507
|
+
if (!(a.disabled || !ee.value)) {
|
|
8508
8508
|
if (s.value) {
|
|
8509
8509
|
r("sendAttachment", {
|
|
8510
8510
|
file: s.value,
|
|
@@ -8515,10 +8515,10 @@ const kf = {
|
|
|
8515
8515
|
r("sendText");
|
|
8516
8516
|
}
|
|
8517
8517
|
}
|
|
8518
|
-
function
|
|
8518
|
+
function X(Te) {
|
|
8519
8519
|
r("sendPoll", Te);
|
|
8520
8520
|
}
|
|
8521
|
-
function
|
|
8521
|
+
function q(Te) {
|
|
8522
8522
|
r("scheduleMessage", {
|
|
8523
8523
|
...Te,
|
|
8524
8524
|
text: s.value ? void 0 : Qt(a.modelValue),
|
|
@@ -8526,33 +8526,33 @@ const kf = {
|
|
|
8526
8526
|
caption: s.value ? Qt(a.modelValue) : void 0
|
|
8527
8527
|
});
|
|
8528
8528
|
}
|
|
8529
|
-
function
|
|
8529
|
+
function Ge() {
|
|
8530
8530
|
r("openScheduled");
|
|
8531
8531
|
}
|
|
8532
|
-
function
|
|
8532
|
+
function ge() {
|
|
8533
8533
|
g !== null && (clearTimeout(g), g = null);
|
|
8534
8534
|
}
|
|
8535
8535
|
function Qe(Te) {
|
|
8536
|
-
a.disabled || !ue.value || Te instanceof MouseEvent && Te.button !== 0 || (x.value = !1,
|
|
8536
|
+
a.disabled || !ue.value || Te instanceof MouseEvent && Te.button !== 0 || (x.value = !1, ge(), g = setTimeout(() => {
|
|
8537
8537
|
g = null, x.value = !0, f.value = !0;
|
|
8538
8538
|
}, f1));
|
|
8539
8539
|
}
|
|
8540
|
-
function
|
|
8541
|
-
|
|
8540
|
+
function Fe() {
|
|
8541
|
+
ge();
|
|
8542
8542
|
}
|
|
8543
8543
|
function vt() {
|
|
8544
|
-
if (!(a.disabled || !
|
|
8544
|
+
if (!(a.disabled || !ee.value)) {
|
|
8545
8545
|
if (x.value) {
|
|
8546
8546
|
x.value = !1;
|
|
8547
8547
|
return;
|
|
8548
8548
|
}
|
|
8549
|
-
|
|
8549
|
+
G();
|
|
8550
8550
|
}
|
|
8551
8551
|
}
|
|
8552
8552
|
return (Te, se) => (M(), F("div", {
|
|
8553
8553
|
class: Ce([
|
|
8554
8554
|
a.compact ? "space-y-1 px-1 pb-1.5" : "space-y-1.5 px-1 pb-1.5",
|
|
8555
|
-
|
|
8555
|
+
Y.value
|
|
8556
8556
|
])
|
|
8557
8557
|
}, [
|
|
8558
8558
|
T("input", {
|
|
@@ -8562,7 +8562,7 @@ const kf = {
|
|
|
8562
8562
|
class: "hidden",
|
|
8563
8563
|
accept: le.value,
|
|
8564
8564
|
disabled: e.disabled,
|
|
8565
|
-
onChange:
|
|
8565
|
+
onChange: me
|
|
8566
8566
|
}, null, 40, t1),
|
|
8567
8567
|
e.editingMessage ? (M(), ne(to, {
|
|
8568
8568
|
key: 0,
|
|
@@ -8584,12 +8584,12 @@ const kf = {
|
|
|
8584
8584
|
T("p", a1, Z(s.value.name), 1),
|
|
8585
8585
|
T("p", r1, Z(s.value.type || B.value), 1)
|
|
8586
8586
|
]),
|
|
8587
|
-
ie(v(
|
|
8587
|
+
ie(v(rt), {
|
|
8588
8588
|
icon: v(cr),
|
|
8589
8589
|
text: "",
|
|
8590
8590
|
rounded: "",
|
|
8591
8591
|
severity: "secondary",
|
|
8592
|
-
onClick:
|
|
8592
|
+
onClick: it
|
|
8593
8593
|
}, null, 8, ["icon"])
|
|
8594
8594
|
])) : ae("", !0),
|
|
8595
8595
|
T("div", {
|
|
@@ -8597,7 +8597,7 @@ const kf = {
|
|
|
8597
8597
|
ref: D,
|
|
8598
8598
|
class: Ce(["composer-shell w-full", a.compact ? "composer-shell--compact" : "composer-shell--default"])
|
|
8599
8599
|
}, [
|
|
8600
|
-
ie(v(
|
|
8600
|
+
ie(v(rt), {
|
|
8601
8601
|
text: "",
|
|
8602
8602
|
rounded: "",
|
|
8603
8603
|
severity: "secondary",
|
|
@@ -8605,11 +8605,11 @@ const kf = {
|
|
|
8605
8605
|
disabled: e.disabled || !!e.editingMessage,
|
|
8606
8606
|
"aria-label": v(m)("addToMessage"),
|
|
8607
8607
|
"data-testid": "composer-actions-button",
|
|
8608
|
-
onClick:
|
|
8608
|
+
onClick: xe
|
|
8609
8609
|
}, {
|
|
8610
|
-
default:
|
|
8610
|
+
default: He(() => [
|
|
8611
8611
|
T("span", o1, [
|
|
8612
|
-
(M(), ne(
|
|
8612
|
+
(M(), ne(at(v(ki)), { class: "size-7" }))
|
|
8613
8613
|
])
|
|
8614
8614
|
]),
|
|
8615
8615
|
_: 1
|
|
@@ -8630,7 +8630,7 @@ const kf = {
|
|
|
8630
8630
|
onKeydown: se[4] || (se[4] = //@ts-ignore
|
|
8631
8631
|
(...ye) => v(k) && v(k)(...ye)),
|
|
8632
8632
|
onPaste: se[5] || (se[5] = //@ts-ignore
|
|
8633
|
-
(...ye) => v(
|
|
8633
|
+
(...ye) => v(O) && v(O)(...ye)),
|
|
8634
8634
|
onContextmenu: se[6] || (se[6] = //@ts-ignore
|
|
8635
8635
|
(...ye) => v(I) && v(I)(...ye))
|
|
8636
8636
|
}, null, 42, i1)),
|
|
@@ -8653,45 +8653,45 @@ const kf = {
|
|
|
8653
8653
|
}, null, 8, ["text"])) : ae("", !0),
|
|
8654
8654
|
e.offlineMode ? (M(), F("p", l1, Z(e.pendingQueueCount ? v(m)("offlineQueued", { count: e.pendingQueueCount }) : v(m)("offline")), 1)) : ae("", !0)
|
|
8655
8655
|
])) : ae("", !0),
|
|
8656
|
-
e.showScheduledButton ? (M(), ne(v(
|
|
8656
|
+
e.showScheduledButton ? (M(), ne(v(rt), {
|
|
8657
8657
|
key: 1,
|
|
8658
8658
|
rounded: "",
|
|
8659
8659
|
outlined: "",
|
|
8660
8660
|
class: Ce(["composer-schedule-button shrink-0 self-end", a.compact ? "h-9 w-9" : "h-10 w-10 max-md:h-9 max-md:w-9"]),
|
|
8661
8661
|
disabled: e.disabled,
|
|
8662
8662
|
"aria-label": v(m)("scheduledMessages"),
|
|
8663
|
-
onClick:
|
|
8663
|
+
onClick: Ge
|
|
8664
8664
|
}, {
|
|
8665
|
-
default:
|
|
8665
|
+
default: He(() => [
|
|
8666
8666
|
T("span", c1, [
|
|
8667
|
-
(M(), ne(
|
|
8667
|
+
(M(), ne(at(v(rf)), { class: "size-7" }))
|
|
8668
8668
|
])
|
|
8669
8669
|
]),
|
|
8670
8670
|
_: 1
|
|
8671
8671
|
}, 8, ["class", "disabled", "aria-label"])) : ae("", !0),
|
|
8672
|
-
ie(v(
|
|
8672
|
+
ie(v(rt), {
|
|
8673
8673
|
rounded: "",
|
|
8674
8674
|
severity: "primary",
|
|
8675
8675
|
text: "",
|
|
8676
8676
|
class: Ce(["composer-send-button shrink-0 self-end", a.compact ? "h-9 w-9" : "h-10 w-10 max-md:h-9 max-md:w-9"]),
|
|
8677
|
-
disabled: e.disabled || !
|
|
8677
|
+
disabled: e.disabled || !ee.value,
|
|
8678
8678
|
"aria-label": e.editingMessage ? v(m)("saveMessage") : s.value ? v(m)("sendAttachment") : v(m)("sendMessage"),
|
|
8679
8679
|
onMousedown: Qe,
|
|
8680
|
-
onMouseup:
|
|
8681
|
-
onMouseleave:
|
|
8680
|
+
onMouseup: Fe,
|
|
8681
|
+
onMouseleave: Fe,
|
|
8682
8682
|
onTouchstart: Qe,
|
|
8683
|
-
onTouchend:
|
|
8684
|
-
onTouchcancel:
|
|
8683
|
+
onTouchend: Fe,
|
|
8684
|
+
onTouchcancel: Fe,
|
|
8685
8685
|
onContextmenu: se[7] || (se[7] = Vu(() => {
|
|
8686
8686
|
}, ["prevent"])),
|
|
8687
8687
|
onClick: vt
|
|
8688
8688
|
}, {
|
|
8689
|
-
default:
|
|
8689
|
+
default: He(() => [
|
|
8690
8690
|
T("span", d1, [
|
|
8691
|
-
e.editingMessage ? (M(), ne(
|
|
8691
|
+
e.editingMessage ? (M(), ne(at(v(Un)), {
|
|
8692
8692
|
key: 0,
|
|
8693
8693
|
class: "size-7"
|
|
8694
|
-
})) : (M(), ne(
|
|
8694
|
+
})) : (M(), ne(at(v(Ai)), {
|
|
8695
8695
|
key: 1,
|
|
8696
8696
|
class: "size-7"
|
|
8697
8697
|
}))
|
|
@@ -8701,21 +8701,21 @@ const kf = {
|
|
|
8701
8701
|
}, 8, ["class", "disabled", "aria-label"])
|
|
8702
8702
|
], 2),
|
|
8703
8703
|
ie(Lf, {
|
|
8704
|
-
visible: v(
|
|
8704
|
+
visible: v(W),
|
|
8705
8705
|
position: v(E),
|
|
8706
8706
|
onFormat: se[8] || (se[8] = (ye) => v(w)(ye))
|
|
8707
8707
|
}, null, 8, ["visible", "position"]),
|
|
8708
8708
|
ie(Ef, {
|
|
8709
8709
|
ref_key: "composerActionsRef",
|
|
8710
8710
|
ref: i,
|
|
8711
|
-
onPickFile:
|
|
8711
|
+
onPickFile: Le,
|
|
8712
8712
|
onOpenPoll: se[9] || (se[9] = (ye) => d.value = !0)
|
|
8713
8713
|
}, null, 512),
|
|
8714
8714
|
ie(Vf, {
|
|
8715
8715
|
visible: d.value,
|
|
8716
8716
|
"onUpdate:visible": se[10] || (se[10] = (ye) => d.value = ye),
|
|
8717
8717
|
disabled: e.disabled,
|
|
8718
|
-
onSend:
|
|
8718
|
+
onSend: X
|
|
8719
8719
|
}, null, 8, ["visible", "disabled"]),
|
|
8720
8720
|
ie(e1, {
|
|
8721
8721
|
visible: f.value,
|
|
@@ -8723,7 +8723,7 @@ const kf = {
|
|
|
8723
8723
|
disabled: e.disabled,
|
|
8724
8724
|
"can-schedule": ue.value,
|
|
8725
8725
|
"content-preview": ve.value,
|
|
8726
|
-
onSchedule:
|
|
8726
|
+
onSchedule: q
|
|
8727
8727
|
}, null, 8, ["visible", "disabled", "can-schedule", "content-preview"])
|
|
8728
8728
|
], 2));
|
|
8729
8729
|
}
|
|
@@ -8736,7 +8736,7 @@ const kf = {
|
|
|
8736
8736
|
target: {}
|
|
8737
8737
|
},
|
|
8738
8738
|
setup(e, { expose: t }) {
|
|
8739
|
-
const u = e, { t: n } =
|
|
8739
|
+
const u = e, { t: n } = Oe(), a = bi(), r = xi(), o = zd(), i = Vd(), s = Ti(), l = N(() => u.target === "thread"), d = N({
|
|
8740
8740
|
get: () => l.value ? o.threadDraft.value : o.draft.value,
|
|
8741
8741
|
set: (Q) => {
|
|
8742
8742
|
l.value ? o.threadDraft.value = Q : o.draft.value = Q;
|
|
@@ -8770,15 +8770,15 @@ const kf = {
|
|
|
8770
8770
|
function k() {
|
|
8771
8771
|
s.emit("composer:cancelEdit");
|
|
8772
8772
|
}
|
|
8773
|
-
const
|
|
8773
|
+
const O = U(null);
|
|
8774
8774
|
async function z() {
|
|
8775
8775
|
var Q;
|
|
8776
|
-
await ((Q =
|
|
8776
|
+
await ((Q = O.value) == null ? void 0 : Q.focusEditor());
|
|
8777
8777
|
}
|
|
8778
|
-
return t({ focusEditor: z }), (Q,
|
|
8778
|
+
return t({ focusEditor: z }), (Q, W) => w.value ? (M(), ne(p1, {
|
|
8779
8779
|
key: 0,
|
|
8780
8780
|
ref_key: "composerRef",
|
|
8781
|
-
ref:
|
|
8781
|
+
ref: O,
|
|
8782
8782
|
"model-value": d.value,
|
|
8783
8783
|
disabled: g.value,
|
|
8784
8784
|
"reset-signal": f.value,
|
|
@@ -8788,7 +8788,7 @@ const kf = {
|
|
|
8788
8788
|
"editing-message": v(o).messageBeingEdited.value,
|
|
8789
8789
|
"offline-mode": v(o).offlineMode.value,
|
|
8790
8790
|
"pending-queue-count": v(o).pendingQueueCount.value,
|
|
8791
|
-
"onUpdate:modelValue":
|
|
8791
|
+
"onUpdate:modelValue": W[0] || (W[0] = (le) => d.value = le),
|
|
8792
8792
|
onSendText: D,
|
|
8793
8793
|
onSendAttachment: y,
|
|
8794
8794
|
onSendPoll: E,
|
|
@@ -8827,22 +8827,22 @@ function v1(e) {
|
|
|
8827
8827
|
const B = f(L);
|
|
8828
8828
|
if (!(B != null && B.url) || typeof navigator > "u" || !((De = navigator.clipboard) != null && De.write) || typeof ClipboardItem > "u")
|
|
8829
8829
|
return !1;
|
|
8830
|
-
const
|
|
8831
|
-
if (!
|
|
8830
|
+
const Y = await fetch(B.url);
|
|
8831
|
+
if (!Y.ok)
|
|
8832
8832
|
return !1;
|
|
8833
|
-
const
|
|
8834
|
-
if (!
|
|
8833
|
+
const ee = await Y.blob();
|
|
8834
|
+
if (!ee.type.startsWith("image/"))
|
|
8835
8835
|
return !1;
|
|
8836
|
-
const ue = { [
|
|
8836
|
+
const ue = { [ee.type]: ee }, ve = d(L);
|
|
8837
8837
|
return ve && (ue["text/plain"] = new Blob([ve], { type: "text/plain" })), await navigator.clipboard.write([new ClipboardItem(ue)]), !0;
|
|
8838
8838
|
}
|
|
8839
8839
|
function m(L) {
|
|
8840
|
-
const B = Number.isFinite(L.clientX) ? L.clientX : 0,
|
|
8841
|
-
if (B > 0 ||
|
|
8842
|
-
return { x: B, y:
|
|
8843
|
-
const
|
|
8844
|
-
if (
|
|
8845
|
-
const ue =
|
|
8840
|
+
const B = Number.isFinite(L.clientX) ? L.clientX : 0, Y = Number.isFinite(L.clientY) ? L.clientY : 0;
|
|
8841
|
+
if (B > 0 || Y > 0)
|
|
8842
|
+
return { x: B, y: Y };
|
|
8843
|
+
const ee = L.currentTarget ?? L.target;
|
|
8844
|
+
if (ee instanceof HTMLElement) {
|
|
8845
|
+
const ue = ee.getBoundingClientRect();
|
|
8846
8846
|
return {
|
|
8847
8847
|
x: ue.left + ue.width / 2,
|
|
8848
8848
|
y: ue.top + Math.min(ue.height / 2, 32)
|
|
@@ -8850,13 +8850,13 @@ function v1(e) {
|
|
|
8850
8850
|
}
|
|
8851
8851
|
return { x: 0, y: 0 };
|
|
8852
8852
|
}
|
|
8853
|
-
async function g(L, B,
|
|
8853
|
+
async function g(L, B, Y) {
|
|
8854
8854
|
var ue;
|
|
8855
|
-
if (!e.canUseMessageActions() ||
|
|
8855
|
+
if (!e.canUseMessageActions() || Y === "contextmenu" && !a || Y === "tap" && a)
|
|
8856
8856
|
return;
|
|
8857
8857
|
B.preventDefault(), B.stopPropagation(), u.value = L;
|
|
8858
|
-
const
|
|
8859
|
-
await Xt(), (ue = t.value) == null || ue.show(B, { x:
|
|
8858
|
+
const ee = m(B);
|
|
8859
|
+
await Xt(), (ue = t.value) == null || ue.show(B, { x: ee.x + 2, y: ee.y + 2 });
|
|
8860
8860
|
}
|
|
8861
8861
|
function w(L, B) {
|
|
8862
8862
|
g(L, B, "contextmenu");
|
|
@@ -8882,7 +8882,7 @@ function v1(e) {
|
|
|
8882
8882
|
e.canReact() && e.emit.toggleReaction(L, B);
|
|
8883
8883
|
}
|
|
8884
8884
|
async function I(L) {
|
|
8885
|
-
var
|
|
8885
|
+
var Y;
|
|
8886
8886
|
if (typeof navigator > "u")
|
|
8887
8887
|
return;
|
|
8888
8888
|
let B = !1;
|
|
@@ -8892,10 +8892,10 @@ function v1(e) {
|
|
|
8892
8892
|
B = !1;
|
|
8893
8893
|
}
|
|
8894
8894
|
if (!B) {
|
|
8895
|
-
const
|
|
8896
|
-
if (!
|
|
8895
|
+
const ee = d(L);
|
|
8896
|
+
if (!ee || !((Y = navigator.clipboard) != null && Y.writeText))
|
|
8897
8897
|
return;
|
|
8898
|
-
await navigator.clipboard.writeText(
|
|
8898
|
+
await navigator.clipboard.writeText(ee);
|
|
8899
8899
|
}
|
|
8900
8900
|
n.value = L.id, r && clearTimeout(r), r = setTimeout(() => {
|
|
8901
8901
|
n.value = null;
|
|
@@ -8907,7 +8907,7 @@ function v1(e) {
|
|
|
8907
8907
|
function k(L) {
|
|
8908
8908
|
e.emit.edit(L), D();
|
|
8909
8909
|
}
|
|
8910
|
-
function
|
|
8910
|
+
function O(L) {
|
|
8911
8911
|
e.canOpenThread() && (e.emit.openThread(L), D());
|
|
8912
8912
|
}
|
|
8913
8913
|
function z(L) {
|
|
@@ -8916,7 +8916,7 @@ function v1(e) {
|
|
|
8916
8916
|
function Q(L) {
|
|
8917
8917
|
e.emit.info(L), D();
|
|
8918
8918
|
}
|
|
8919
|
-
function
|
|
8919
|
+
function W(L) {
|
|
8920
8920
|
e.emit.delete(L), D();
|
|
8921
8921
|
}
|
|
8922
8922
|
function le(L) {
|
|
@@ -8954,14 +8954,14 @@ function v1(e) {
|
|
|
8954
8954
|
label: e.t("threadWithCount", { count: L.replyCount }),
|
|
8955
8955
|
icon: ff,
|
|
8956
8956
|
visible: !e.isInThread() && e.canOpenThread(),
|
|
8957
|
-
action: () =>
|
|
8957
|
+
action: () => O(L)
|
|
8958
8958
|
},
|
|
8959
8959
|
{
|
|
8960
8960
|
key: "delete",
|
|
8961
8961
|
label: e.t("delete"),
|
|
8962
8962
|
icon: uf,
|
|
8963
8963
|
visible: l(L),
|
|
8964
|
-
action: () =>
|
|
8964
|
+
action: () => W(L)
|
|
8965
8965
|
},
|
|
8966
8966
|
{
|
|
8967
8967
|
key: "translate",
|
|
@@ -9037,66 +9037,66 @@ const T1 = 1, k1 = 4;
|
|
|
9037
9037
|
function M1(e) {
|
|
9038
9038
|
const t = U(1), u = U(0), n = U(0), a = U(!1), r = /* @__PURE__ */ new Map();
|
|
9039
9039
|
let o = null, i = 0, s = 0, l = 0, d = 0, f = 0, x = 1, m = 0, g = 0;
|
|
9040
|
-
function w(B,
|
|
9041
|
-
return Math.min(Math.max(B,
|
|
9040
|
+
function w(B, Y, ee) {
|
|
9041
|
+
return Math.min(Math.max(B, Y), ee);
|
|
9042
9042
|
}
|
|
9043
9043
|
function _(B) {
|
|
9044
9044
|
return w(B, T1, k1);
|
|
9045
9045
|
}
|
|
9046
|
-
function D(B,
|
|
9047
|
-
var
|
|
9048
|
-
const ue = ((
|
|
9046
|
+
function D(B, Y, ee = t.value) {
|
|
9047
|
+
var X, q, Ge, ge;
|
|
9048
|
+
const ue = ((X = e.viewportRef.value) == null ? void 0 : X.clientWidth) ?? 0, ve = ((q = e.viewportRef.value) == null ? void 0 : q.clientHeight) ?? 0, De = ((Ge = e.imageRef.value) == null ? void 0 : Ge.clientWidth) ?? ue, Le = ((ge = e.imageRef.value) == null ? void 0 : ge.clientHeight) ?? ve, me = De * ee, it = Le * ee, xe = Math.max(0, (me - ue) / 2), G = Math.max(0, (it - ve) / 2);
|
|
9049
9049
|
return {
|
|
9050
|
-
x: w(B, -
|
|
9051
|
-
y: w(
|
|
9050
|
+
x: w(B, -xe, xe),
|
|
9051
|
+
y: w(Y, -G, G)
|
|
9052
9052
|
};
|
|
9053
9053
|
}
|
|
9054
|
-
function y(B,
|
|
9055
|
-
const ue = _(B), ve = D(
|
|
9054
|
+
function y(B, Y = u.value, ee = n.value) {
|
|
9055
|
+
const ue = _(B), ve = D(Y, ee, ue);
|
|
9056
9056
|
t.value = ue, u.value = ve.x, n.value = ve.y, ue === 1 && (u.value = 0, n.value = 0);
|
|
9057
9057
|
}
|
|
9058
9058
|
function E() {
|
|
9059
9059
|
t.value = 1, u.value = 0, n.value = 0, a.value = !1, r.clear(), o = null, f = 0, x = 1, m = 0, g = 0;
|
|
9060
9060
|
}
|
|
9061
9061
|
function C(B) {
|
|
9062
|
-
var
|
|
9063
|
-
const
|
|
9064
|
-
return
|
|
9065
|
-
x: B.clientX -
|
|
9066
|
-
y: B.clientY -
|
|
9062
|
+
var ee;
|
|
9063
|
+
const Y = (ee = e.viewportRef.value) == null ? void 0 : ee.getBoundingClientRect();
|
|
9064
|
+
return Y ? {
|
|
9065
|
+
x: B.clientX - Y.left,
|
|
9066
|
+
y: B.clientY - Y.top
|
|
9067
9067
|
} : { x: B.clientX, y: B.clientY };
|
|
9068
9068
|
}
|
|
9069
|
-
function I(B,
|
|
9070
|
-
return Math.hypot(
|
|
9069
|
+
function I(B, Y) {
|
|
9070
|
+
return Math.hypot(Y.x - B.x, Y.y - B.y);
|
|
9071
9071
|
}
|
|
9072
|
-
function S(B,
|
|
9072
|
+
function S(B, Y) {
|
|
9073
9073
|
return {
|
|
9074
|
-
x: (B.x +
|
|
9075
|
-
y: (B.y +
|
|
9074
|
+
x: (B.x + Y.x) / 2,
|
|
9075
|
+
y: (B.y + Y.y) / 2
|
|
9076
9076
|
};
|
|
9077
9077
|
}
|
|
9078
9078
|
function k(B) {
|
|
9079
|
-
var
|
|
9079
|
+
var ee, ue;
|
|
9080
9080
|
if (!e.isImage() || B.pointerType === "mouse" && B.button !== 0)
|
|
9081
9081
|
return;
|
|
9082
|
-
const
|
|
9083
|
-
if (r.set(B.pointerId,
|
|
9084
|
-
const [ve, De] = Array.from(r.values()),
|
|
9085
|
-
o = null, f = I(ve, De) || 1, x = t.value, m =
|
|
9082
|
+
const Y = C(B);
|
|
9083
|
+
if (r.set(B.pointerId, Y), (ue = (ee = B.currentTarget) == null ? void 0 : ee.setPointerCapture) == null || ue.call(ee, B.pointerId), r.size === 1 && (o = B.pointerId, i = Y.x, s = Y.y, l = u.value, d = n.value), r.size === 2) {
|
|
9084
|
+
const [ve, De] = Array.from(r.values()), Le = S(ve, De);
|
|
9085
|
+
o = null, f = I(ve, De) || 1, x = t.value, m = Le.x, g = Le.y, l = u.value, d = n.value;
|
|
9086
9086
|
}
|
|
9087
9087
|
}
|
|
9088
|
-
function
|
|
9088
|
+
function O(B) {
|
|
9089
9089
|
if (!e.isImage() || !r.has(B.pointerId))
|
|
9090
9090
|
return;
|
|
9091
|
-
const
|
|
9092
|
-
if (r.set(B.pointerId,
|
|
9093
|
-
const [
|
|
9094
|
-
y(
|
|
9091
|
+
const Y = C(B);
|
|
9092
|
+
if (r.set(B.pointerId, Y), r.size === 2) {
|
|
9093
|
+
const [ee, ue] = Array.from(r.values()), ve = S(ee, ue), De = I(ee, ue), Le = x * (De / (f || 1)), me = l + (ve.x - m), it = d + (ve.y - g);
|
|
9094
|
+
y(Le, me, it), a.value = t.value > 1, B.preventDefault();
|
|
9095
9095
|
return;
|
|
9096
9096
|
}
|
|
9097
9097
|
if (o === B.pointerId && t.value > 1) {
|
|
9098
|
-
const
|
|
9099
|
-
y(t.value, l +
|
|
9098
|
+
const ee = Y.x - i, ue = Y.y - s;
|
|
9099
|
+
y(t.value, l + ee, d + ue), a.value = !0, B.preventDefault();
|
|
9100
9100
|
}
|
|
9101
9101
|
}
|
|
9102
9102
|
function z(B) {
|
|
@@ -9105,15 +9105,15 @@ function M1(e) {
|
|
|
9105
9105
|
function Q(B) {
|
|
9106
9106
|
z(B.pointerId);
|
|
9107
9107
|
}
|
|
9108
|
-
function
|
|
9108
|
+
function W(B) {
|
|
9109
9109
|
z(B.pointerId);
|
|
9110
9110
|
}
|
|
9111
9111
|
function le(B) {
|
|
9112
9112
|
if (!e.isImage())
|
|
9113
9113
|
return;
|
|
9114
9114
|
B.preventDefault();
|
|
9115
|
-
const
|
|
9116
|
-
y(t.value +
|
|
9115
|
+
const Y = B.deltaY < 0 ? 0.25 : -0.25;
|
|
9116
|
+
y(t.value + Y);
|
|
9117
9117
|
}
|
|
9118
9118
|
function L() {
|
|
9119
9119
|
e.isImage() && y(t.value > 1 ? 1 : 2.5, 0, 0);
|
|
@@ -9125,9 +9125,9 @@ function M1(e) {
|
|
|
9125
9125
|
isDragging: a,
|
|
9126
9126
|
resetTransform: E,
|
|
9127
9127
|
handlePointerDown: k,
|
|
9128
|
-
handlePointerMove:
|
|
9128
|
+
handlePointerMove: O,
|
|
9129
9129
|
handlePointerUp: Q,
|
|
9130
|
-
handlePointerCancel:
|
|
9130
|
+
handlePointerCancel: W,
|
|
9131
9131
|
handleWheel: le,
|
|
9132
9132
|
handleDoubleClick: L
|
|
9133
9133
|
};
|
|
@@ -9161,7 +9161,7 @@ const w1 = { class: "fullscreen-dialog__content" }, A1 = {
|
|
|
9161
9161
|
closable: !0,
|
|
9162
9162
|
"onUpdate:visible": n
|
|
9163
9163
|
}, {
|
|
9164
|
-
default:
|
|
9164
|
+
default: He(() => [
|
|
9165
9165
|
T("div", w1, [
|
|
9166
9166
|
Jt(a.$slots, "default")
|
|
9167
9167
|
]),
|
|
@@ -9209,7 +9209,7 @@ const w1 = { class: "fullscreen-dialog__content" }, A1 = {
|
|
|
9209
9209
|
}), l = N(() => {
|
|
9210
9210
|
var k;
|
|
9211
9211
|
return ((k = u.attachment) == null ? void 0 : k.kind) === "audio";
|
|
9212
|
-
}), { t: d } =
|
|
9212
|
+
}), { t: d } = Oe(), {
|
|
9213
9213
|
scale: f,
|
|
9214
9214
|
translateX: x,
|
|
9215
9215
|
translateY: m,
|
|
@@ -9238,7 +9238,7 @@ const w1 = { class: "fullscreen-dialog__content" }, A1 = {
|
|
|
9238
9238
|
function S() {
|
|
9239
9239
|
n("close");
|
|
9240
9240
|
}
|
|
9241
|
-
return (k,
|
|
9241
|
+
return (k, O) => {
|
|
9242
9242
|
var z, Q;
|
|
9243
9243
|
return M(), ne(Jn, {
|
|
9244
9244
|
open: o.value,
|
|
@@ -9248,17 +9248,17 @@ const w1 = { class: "fullscreen-dialog__content" }, A1 = {
|
|
|
9248
9248
|
"close-aria-label": v(d)("closeMediaViewer"),
|
|
9249
9249
|
onClose: S
|
|
9250
9250
|
}, {
|
|
9251
|
-
actions:
|
|
9252
|
-
var
|
|
9251
|
+
actions: He(() => {
|
|
9252
|
+
var W;
|
|
9253
9253
|
return [
|
|
9254
|
-
(
|
|
9254
|
+
(W = e.attachment) != null && W.url ? (M(), F("a", {
|
|
9255
9255
|
key: 0,
|
|
9256
9256
|
href: e.attachment.url,
|
|
9257
9257
|
target: "_blank",
|
|
9258
9258
|
rel: "noreferrer",
|
|
9259
9259
|
class: "media-viewer-link-action"
|
|
9260
9260
|
}, [
|
|
9261
|
-
(M(), ne(
|
|
9261
|
+
(M(), ne(at(v(bf)), {
|
|
9262
9262
|
class: "size-4",
|
|
9263
9263
|
"aria-hidden": "true"
|
|
9264
9264
|
})),
|
|
@@ -9266,7 +9266,7 @@ const w1 = { class: "fullscreen-dialog__content" }, A1 = {
|
|
|
9266
9266
|
], 8, D1)) : ae("", !0)
|
|
9267
9267
|
];
|
|
9268
9268
|
}),
|
|
9269
|
-
footer:
|
|
9269
|
+
footer: He(() => [
|
|
9270
9270
|
e.attachment ? (M(), F("div", P1, [
|
|
9271
9271
|
T("div", $1, [
|
|
9272
9272
|
T("p", B1, Z(e.attachment.name), 1),
|
|
@@ -9274,29 +9274,29 @@ const w1 = { class: "fullscreen-dialog__content" }, A1 = {
|
|
|
9274
9274
|
])
|
|
9275
9275
|
])) : ae("", !0)
|
|
9276
9276
|
]),
|
|
9277
|
-
default:
|
|
9278
|
-
var
|
|
9277
|
+
default: He(() => {
|
|
9278
|
+
var W;
|
|
9279
9279
|
return [
|
|
9280
9280
|
T("div", E1, [
|
|
9281
|
-
(
|
|
9281
|
+
(W = e.attachment) != null && W.url ? (M(), F(je, { key: 0 }, [
|
|
9282
9282
|
i.value ? (M(), F("div", {
|
|
9283
9283
|
key: 0,
|
|
9284
9284
|
ref_key: "viewportRef",
|
|
9285
9285
|
ref: a,
|
|
9286
9286
|
class: "media-viewer-stage media-viewer-stage-image flex h-full w-full items-center justify-center overflow-hidden touch-none",
|
|
9287
|
-
onPointerdown:
|
|
9287
|
+
onPointerdown: O[0] || (O[0] = //@ts-ignore
|
|
9288
9288
|
(...le) => v(_) && v(_)(...le)),
|
|
9289
|
-
onPointermove:
|
|
9289
|
+
onPointermove: O[1] || (O[1] = //@ts-ignore
|
|
9290
9290
|
(...le) => v(D) && v(D)(...le)),
|
|
9291
|
-
onPointerup:
|
|
9291
|
+
onPointerup: O[2] || (O[2] = //@ts-ignore
|
|
9292
9292
|
(...le) => v(y) && v(y)(...le)),
|
|
9293
|
-
onPointercancel:
|
|
9293
|
+
onPointercancel: O[3] || (O[3] = //@ts-ignore
|
|
9294
9294
|
(...le) => v(E) && v(E)(...le)),
|
|
9295
|
-
onPointerleave:
|
|
9295
|
+
onPointerleave: O[4] || (O[4] = //@ts-ignore
|
|
9296
9296
|
(...le) => v(y) && v(y)(...le)),
|
|
9297
|
-
onWheel:
|
|
9297
|
+
onWheel: O[5] || (O[5] = //@ts-ignore
|
|
9298
9298
|
(...le) => v(C) && v(C)(...le)),
|
|
9299
|
-
onDblclick:
|
|
9299
|
+
onDblclick: O[6] || (O[6] = //@ts-ignore
|
|
9300
9300
|
(...le) => v(I) && v(I)(...le))
|
|
9301
9301
|
}, [
|
|
9302
9302
|
T("img", {
|
|
@@ -9340,7 +9340,7 @@ const w1 = { class: "fullscreen-dialog__content" }, A1 = {
|
|
|
9340
9340
|
date: {}
|
|
9341
9341
|
},
|
|
9342
9342
|
setup(e) {
|
|
9343
|
-
const t = e, { locale: u, t: n } =
|
|
9343
|
+
const t = e, { locale: u, t: n } = Oe(), a = N(() => {
|
|
9344
9344
|
const r = /* @__PURE__ */ new Date(), o = t.date, i = new Date(r.getFullYear(), r.getMonth(), r.getDate()), s = new Date(i);
|
|
9345
9345
|
s.setDate(s.getDate() - 1);
|
|
9346
9346
|
const l = new Date(i);
|
|
@@ -9380,7 +9380,7 @@ const w1 = { class: "fullscreen-dialog__content" }, A1 = {
|
|
|
9380
9380
|
isOwn: { type: Boolean }
|
|
9381
9381
|
},
|
|
9382
9382
|
setup(e) {
|
|
9383
|
-
const t = e, u = U(null), n = U(!1), { t: a } =
|
|
9383
|
+
const t = e, u = U(null), n = U(!1), { t: a } = Oe(), r = N(() => {
|
|
9384
9384
|
try {
|
|
9385
9385
|
return new URL(t.url).hostname.replace(/^www\./, "");
|
|
9386
9386
|
} catch {
|
|
@@ -9511,7 +9511,7 @@ const w1 = { class: "fullscreen-dialog__content" }, A1 = {
|
|
|
9511
9511
|
},
|
|
9512
9512
|
emits: ["openMedia"],
|
|
9513
9513
|
setup(e, { emit: t }) {
|
|
9514
|
-
const u = t, { t: n } =
|
|
9514
|
+
const u = t, { t: n } = Oe();
|
|
9515
9515
|
function a(s) {
|
|
9516
9516
|
return !s || Number.isNaN(s) ? "" : s < 1024 * 1024 ? `${Math.round(s / 1024)} KB` : `${(s / (1024 * 1024)).toFixed(1)} MB`;
|
|
9517
9517
|
}
|
|
@@ -9535,7 +9535,7 @@ const w1 = { class: "fullscreen-dialog__content" }, A1 = {
|
|
|
9535
9535
|
return d ? l.localeCompare(d, void 0, { sensitivity: "accent" }) !== 0 : !0;
|
|
9536
9536
|
}
|
|
9537
9537
|
return (s, l) => (M(), F("div", s2, [
|
|
9538
|
-
(M(!0), F(
|
|
9538
|
+
(M(!0), F(je, null, ht(e.message.attachments, (d) => (M(), F("div", {
|
|
9539
9539
|
key: `${e.message.id}-${d.name}`,
|
|
9540
9540
|
class: "w-full"
|
|
9541
9541
|
}, [
|
|
@@ -9563,7 +9563,7 @@ const w1 = { class: "fullscreen-dialog__content" }, A1 = {
|
|
|
9563
9563
|
"aria-label": v(n)("openVideoViewer"),
|
|
9564
9564
|
onClick: (f) => u("openMedia", d)
|
|
9565
9565
|
}, [
|
|
9566
|
-
(M(), ne(
|
|
9566
|
+
(M(), ne(at(v(gf)), {
|
|
9567
9567
|
class: "size-5",
|
|
9568
9568
|
"aria-hidden": "true"
|
|
9569
9569
|
}))
|
|
@@ -9587,7 +9587,7 @@ const w1 = { class: "fullscreen-dialog__content" }, A1 = {
|
|
|
9587
9587
|
}, [
|
|
9588
9588
|
T("span", v2, [
|
|
9589
9589
|
T("span", x2, [
|
|
9590
|
-
(M(), ne(
|
|
9590
|
+
(M(), ne(at(o(d)), {
|
|
9591
9591
|
class: "size-5",
|
|
9592
9592
|
"aria-hidden": "true"
|
|
9593
9593
|
}))
|
|
@@ -9601,7 +9601,7 @@ const w1 = { class: "fullscreen-dialog__content" }, A1 = {
|
|
|
9601
9601
|
}, [
|
|
9602
9602
|
T("span", C2, [
|
|
9603
9603
|
T("span", T2, [
|
|
9604
|
-
(M(), ne(
|
|
9604
|
+
(M(), ne(at(o(d)), {
|
|
9605
9605
|
class: "size-5",
|
|
9606
9606
|
"aria-hidden": "true"
|
|
9607
9607
|
}))
|
|
@@ -9625,7 +9625,7 @@ const w1 = { class: "fullscreen-dialog__content" }, A1 = {
|
|
|
9625
9625
|
message: {}
|
|
9626
9626
|
},
|
|
9627
9627
|
setup(e) {
|
|
9628
|
-
const t = e, { locale: u, t: n } =
|
|
9628
|
+
const t = e, { locale: u, t: n } = Oe();
|
|
9629
9629
|
function a(o) {
|
|
9630
9630
|
return new Intl.DateTimeFormat(u.value, { timeStyle: "short", hourCycle: za() }).format(o);
|
|
9631
9631
|
}
|
|
@@ -9674,7 +9674,7 @@ const w1 = { class: "fullscreen-dialog__content" }, A1 = {
|
|
|
9674
9674
|
return (o, i) => (M(), F("div", D2, [
|
|
9675
9675
|
e.message.isEdited && e.message.kind !== "poll" ? (M(), F("span", E2, Z(v(n)("edited")), 1)) : ae("", !0),
|
|
9676
9676
|
T("span", null, Z(a(e.message.sentAt)), 1),
|
|
9677
|
-
r.value ? (M(), ne(
|
|
9677
|
+
r.value ? (M(), ne(at(r.value.icon), {
|
|
9678
9678
|
key: 1,
|
|
9679
9679
|
class: Ce(["size-3 shrink-0", r.value.state === "read" ? "text-success" : e.message.deliveryState === "failed" ? "text-danger" : "text-subtlest"]),
|
|
9680
9680
|
"aria-label": r.value.label,
|
|
@@ -9689,7 +9689,7 @@ const w1 = { class: "fullscreen-dialog__content" }, A1 = {
|
|
|
9689
9689
|
message: {}
|
|
9690
9690
|
},
|
|
9691
9691
|
setup(e) {
|
|
9692
|
-
const t = e, { locale: u, t: n } =
|
|
9692
|
+
const t = e, { locale: u, t: n } = Oe();
|
|
9693
9693
|
function a(o) {
|
|
9694
9694
|
return o ? new Intl.DateTimeFormat(u.value, {
|
|
9695
9695
|
month: "short",
|
|
@@ -9732,7 +9732,7 @@ const w1 = { class: "fullscreen-dialog__content" }, A1 = {
|
|
|
9732
9732
|
key: 0,
|
|
9733
9733
|
class: Ce(["message-reaction-list flex flex-wrap items-center gap-1 body-sm", e.compact ? "" : "mt-1 px-1"])
|
|
9734
9734
|
}, [
|
|
9735
|
-
(M(!0), F(
|
|
9735
|
+
(M(!0), F(je, null, ht(e.message.reactions ?? [], (o) => (M(), F("button", {
|
|
9736
9736
|
key: `${e.message.id}-${o.emoji}`,
|
|
9737
9737
|
type: "button",
|
|
9738
9738
|
class: Ce(["message-reaction-list__item rounded-full px-2 py-0.75 leading-none transition", o.reactedByMe ? "reaction-chip-selected" : e.message.isOwn ? "reaction-chip-own" : "reaction-chip-other"]),
|
|
@@ -9751,13 +9751,7 @@ const w1 = { class: "fullscreen-dialog__content" }, A1 = {
|
|
|
9751
9751
|
},
|
|
9752
9752
|
emits: ["toggleReaction", "openThread"],
|
|
9753
9753
|
setup(e, { emit: t }) {
|
|
9754
|
-
const u = e, n = t, { t: a } =
|
|
9755
|
-
function r() {
|
|
9756
|
-
return a("threadReplies", { count: u.message.replyCount });
|
|
9757
|
-
}
|
|
9758
|
-
function o() {
|
|
9759
|
-
return u.canOpenThread !== !1 && u.message.replyCount > 0;
|
|
9760
|
-
}
|
|
9754
|
+
const u = e, n = t, { t: a } = Oe(), r = N(() => a("threadReplies", { count: u.message.replyCount })), o = N(() => u.canOpenThread !== !1 && u.message.replyCount > 0);
|
|
9761
9755
|
return (i, s) => (M(), F("div", $2, [
|
|
9762
9756
|
ie(P2, {
|
|
9763
9757
|
message: e.message,
|
|
@@ -9765,15 +9759,15 @@ const w1 = { class: "fullscreen-dialog__content" }, A1 = {
|
|
|
9765
9759
|
compact: "",
|
|
9766
9760
|
onToggle: s[0] || (s[0] = (l) => n("toggleReaction", l))
|
|
9767
9761
|
}, null, 8, ["message", "disabled"]),
|
|
9768
|
-
o
|
|
9762
|
+
o.value ? (M(), F("button", {
|
|
9769
9763
|
key: 0,
|
|
9770
9764
|
type: "button",
|
|
9771
9765
|
class: "message-reactions__thread-button inline-flex items-center gap-1 rounded-full px-1 py-0 font-medium text-subtle transition hover:text-default",
|
|
9772
|
-
"aria-label": r
|
|
9773
|
-
title: r
|
|
9766
|
+
"aria-label": r.value,
|
|
9767
|
+
title: r.value,
|
|
9774
9768
|
onClick: s[1] || (s[1] = Vu((l) => n("openThread"), ["stop"]))
|
|
9775
9769
|
}, [
|
|
9776
|
-
(M(), ne(
|
|
9770
|
+
(M(), ne(at(v(wi)), {
|
|
9777
9771
|
class: "size-4",
|
|
9778
9772
|
"aria-hidden": "true"
|
|
9779
9773
|
})),
|
|
@@ -9793,7 +9787,7 @@ const w1 = { class: "fullscreen-dialog__content" }, A1 = {
|
|
|
9793
9787
|
},
|
|
9794
9788
|
emits: ["vote"],
|
|
9795
9789
|
setup(e, { emit: t }) {
|
|
9796
|
-
const u = e, n = t, { t: a } =
|
|
9790
|
+
const u = e, n = t, { t: a } = Oe();
|
|
9797
9791
|
function r(i) {
|
|
9798
9792
|
const s = u.currentUserId;
|
|
9799
9793
|
return !s || !u.message.poll ? !1 : u.message.poll.options.some(
|
|
@@ -9810,7 +9804,7 @@ const w1 = { class: "fullscreen-dialog__content" }, A1 = {
|
|
|
9810
9804
|
T("p", H2, Z(e.message.poll.question), 1),
|
|
9811
9805
|
T("p", Z2, Z(v(a)("voteCount", { count: e.message.poll.totalVotes })), 1),
|
|
9812
9806
|
T("div", j2, [
|
|
9813
|
-
(M(!0), F(
|
|
9807
|
+
(M(!0), F(je, null, ht(e.message.poll.options, (l) => (M(), F("div", {
|
|
9814
9808
|
key: l.id,
|
|
9815
9809
|
class: "poll-option overflow-hidden rounded-2xl"
|
|
9816
9810
|
}, [
|
|
@@ -9914,7 +9908,7 @@ const w1 = { class: "fullscreen-dialog__content" }, A1 = {
|
|
|
9914
9908
|
e.message.kind === "action" ? (M(), ne(Y1, {
|
|
9915
9909
|
key: 0,
|
|
9916
9910
|
text: e.message.text
|
|
9917
|
-
}, null, 8, ["text"])) : (M(), F(
|
|
9911
|
+
}, null, 8, ["text"])) : (M(), F(je, { key: 1 }, [
|
|
9918
9912
|
e.canShowSenderAvatar && !e.message.isOwn ? (M(), ne(v(Pa), {
|
|
9919
9913
|
key: 0,
|
|
9920
9914
|
image: e.message.senderAvatar,
|
|
@@ -10027,9 +10021,9 @@ const w1 = { class: "fullscreen-dialog__content" }, A1 = {
|
|
|
10027
10021
|
function i() {
|
|
10028
10022
|
u.canReact && (a.value = !a.value);
|
|
10029
10023
|
}
|
|
10030
|
-
return (s, l) => (M(), F(
|
|
10024
|
+
return (s, l) => (M(), F(je, null, [
|
|
10031
10025
|
T("div", dh, [
|
|
10032
|
-
(M(!0), F(
|
|
10026
|
+
(M(!0), F(je, null, ht(v(lh), (d) => (M(), F("button", {
|
|
10033
10027
|
key: `${e.message.id}-${d}-common`,
|
|
10034
10028
|
type: "button",
|
|
10035
10029
|
class: Ce(["message-reaction-button", o(d) ? "message-reaction-button-active" : "message-reaction-button-idle"]),
|
|
@@ -10042,14 +10036,14 @@ const w1 = { class: "fullscreen-dialog__content" }, A1 = {
|
|
|
10042
10036
|
disabled: !e.canReact,
|
|
10043
10037
|
onClick: i
|
|
10044
10038
|
}, [
|
|
10045
|
-
(M(), ne(
|
|
10039
|
+
(M(), ne(at(a.value ? v(sf) : v(lf)), {
|
|
10046
10040
|
class: "size-7",
|
|
10047
10041
|
"aria-hidden": "true"
|
|
10048
10042
|
}))
|
|
10049
10043
|
], 8, hh)
|
|
10050
10044
|
]),
|
|
10051
10045
|
a.value && e.canReact ? (M(), F("div", ph, [
|
|
10052
|
-
(M(!0), F(
|
|
10046
|
+
(M(!0), F(je, null, ht(r.value, (d) => (M(), F("button", {
|
|
10053
10047
|
key: `${e.message.id}-${d}-extended`,
|
|
10054
10048
|
type: "button",
|
|
10055
10049
|
class: Ce(["message-expanded-reaction-button", o(d) ? "message-reaction-button-active" : "message-reaction-button-idle"]),
|
|
@@ -10079,20 +10073,20 @@ const w1 = { class: "fullscreen-dialog__content" }, A1 = {
|
|
|
10079
10073
|
async function d() {
|
|
10080
10074
|
if (typeof window > "u" || !a.value)
|
|
10081
10075
|
return;
|
|
10082
|
-
const _ = window.visualViewport, D = (_ == null ? void 0 : _.offsetLeft) ?? 0, y = (_ == null ? void 0 : _.offsetTop) ?? 0, E = (_ == null ? void 0 : _.width) ?? window.innerWidth, C = (_ == null ? void 0 : _.height) ?? window.innerHeight, I = a.value.getBoundingClientRect(), S = 12, k = 10,
|
|
10083
|
-
let L =
|
|
10076
|
+
const _ = window.visualViewport, D = (_ == null ? void 0 : _.offsetLeft) ?? 0, y = (_ == null ? void 0 : _.offsetTop) ?? 0, E = (_ == null ? void 0 : _.width) ?? window.innerWidth, C = (_ == null ? void 0 : _.height) ?? window.innerHeight, I = a.value.getBoundingClientRect(), S = 12, k = 10, O = D + S, z = D + E - I.width - S, Q = y + S, W = y + C - I.height - S, le = Math.max(O, z);
|
|
10077
|
+
let L = O, B = Q;
|
|
10084
10078
|
if (s) {
|
|
10085
|
-
const
|
|
10079
|
+
const Y = s.y + k + I.height <= y + C - S;
|
|
10086
10080
|
L = Math.min(
|
|
10087
|
-
Math.max(s.x - I.width / 2,
|
|
10081
|
+
Math.max(s.x - I.width / 2, O),
|
|
10088
10082
|
le
|
|
10089
|
-
), B =
|
|
10083
|
+
), B = Y ? Math.min(s.y + k, W) : Math.max(s.y - I.height - k, Q);
|
|
10090
10084
|
} else if (i) {
|
|
10091
|
-
const
|
|
10085
|
+
const Y = i.getBoundingClientRect(), ee = Y.left + Y.width / 2, ue = Y.top + Math.min(Y.height / 2, 32), ve = ue + k + I.height <= y + C - S;
|
|
10092
10086
|
L = Math.min(
|
|
10093
|
-
Math.max(
|
|
10087
|
+
Math.max(ee - I.width / 2, O),
|
|
10094
10088
|
le
|
|
10095
|
-
), B = ve ? Math.min(ue + k,
|
|
10089
|
+
), B = ve ? Math.min(ue + k, W) : Math.max(ue - I.height - k, Q);
|
|
10096
10090
|
}
|
|
10097
10091
|
o.value = { left: L, top: B };
|
|
10098
10092
|
}
|
|
@@ -10135,14 +10129,14 @@ const w1 = { class: "fullscreen-dialog__content" }, A1 = {
|
|
|
10135
10129
|
onReact: D[0] || (D[0] = (y) => n("react", y))
|
|
10136
10130
|
}, null, 8, ["message", "can-react"]),
|
|
10137
10131
|
T("div", vh, [
|
|
10138
|
-
(M(!0), F(
|
|
10132
|
+
(M(!0), F(je, null, ht(e.actionItems, (y) => (M(), F("button", {
|
|
10139
10133
|
key: y.key,
|
|
10140
10134
|
type: "button",
|
|
10141
10135
|
class: "message-action-row",
|
|
10142
10136
|
onClick: (E) => y.action()
|
|
10143
10137
|
}, [
|
|
10144
10138
|
T("span", yh, [
|
|
10145
|
-
(M(), ne(
|
|
10139
|
+
(M(), ne(at(y.icon), { class: "size-5" }))
|
|
10146
10140
|
]),
|
|
10147
10141
|
T("span", _h, Z(y.label), 1)
|
|
10148
10142
|
], 8, xh))), 128))
|
|
@@ -10163,7 +10157,7 @@ const w1 = { class: "fullscreen-dialog__content" }, A1 = {
|
|
|
10163
10157
|
parentMessage: {}
|
|
10164
10158
|
},
|
|
10165
10159
|
setup(e) {
|
|
10166
|
-
const { t } =
|
|
10160
|
+
const { t } = Oe();
|
|
10167
10161
|
return (u, n) => {
|
|
10168
10162
|
var a, r;
|
|
10169
10163
|
return M(), F("header", kh, [
|
|
@@ -10183,7 +10177,7 @@ const w1 = { class: "fullscreen-dialog__content" }, A1 = {
|
|
|
10183
10177
|
])) : ae("", !0),
|
|
10184
10178
|
T("div", Ih, [
|
|
10185
10179
|
(r = (a = e.conversation) == null ? void 0 : a.tags) != null && r.length ? (M(), F("div", Fh, [
|
|
10186
|
-
(M(!0), F(
|
|
10180
|
+
(M(!0), F(je, null, ht(e.conversation.tags.slice(0, 3), (o) => (M(), ne(v(St), {
|
|
10187
10181
|
key: o,
|
|
10188
10182
|
text: o,
|
|
10189
10183
|
context: "secondary",
|
|
@@ -10210,7 +10204,7 @@ const w1 = { class: "fullscreen-dialog__content" }, A1 = {
|
|
|
10210
10204
|
showHeader: { type: Boolean }
|
|
10211
10205
|
},
|
|
10212
10206
|
setup(e) {
|
|
10213
|
-
const t = e, { t: u } =
|
|
10207
|
+
const t = e, { t: u } = Oe(), n = bi(), a = xi(), r = Ti(), o = N(() => t.target === "thread"), i = N(
|
|
10214
10208
|
() => o.value ? a.threadMessages.value : a.messages.value
|
|
10215
10209
|
), s = N(
|
|
10216
10210
|
() => o.value ? a.loadingThreadMessages.value : a.loadingMessages.value
|
|
@@ -10225,16 +10219,17 @@ const w1 = { class: "fullscreen-dialog__content" }, A1 = {
|
|
|
10225
10219
|
), g = N(
|
|
10226
10220
|
() => o.value ? !0 : a.showDefaultEmptyState.value
|
|
10227
10221
|
), w = N(() => {
|
|
10228
|
-
const
|
|
10229
|
-
return
|
|
10222
|
+
const G = n.conversation.value;
|
|
10223
|
+
return G ? l.value ? u("thread") : G.title : "";
|
|
10230
10224
|
}), _ = N(() => {
|
|
10231
|
-
const
|
|
10232
|
-
return
|
|
10225
|
+
const G = n.conversation.value;
|
|
10226
|
+
return G ? l.value ? l.value.senderName : G.memberCount ? u("members", { count: G.memberCount }) : u("groupChat") : "";
|
|
10233
10227
|
}), D = N(() => {
|
|
10234
|
-
var
|
|
10235
|
-
return ((
|
|
10228
|
+
var G;
|
|
10229
|
+
return ((G = n.conversation.value) == null ? void 0 : G.memberCount) ?? 0;
|
|
10236
10230
|
}), y = U(null), E = U(null), C = N(() => !!l.value), I = N(() => C.value && !f.value), S = N(() => Rd(n.conversation.value)), {
|
|
10237
|
-
|
|
10231
|
+
threadRef: k,
|
|
10232
|
+
handleThreadScroll: O
|
|
10238
10233
|
} = C1({
|
|
10239
10234
|
getConversation: () => n.conversation.value,
|
|
10240
10235
|
getParentMessage: () => l.value,
|
|
@@ -10244,13 +10239,14 @@ const w1 = { class: "fullscreen-dialog__content" }, A1 = {
|
|
|
10244
10239
|
canLoadOlder: () => x.value,
|
|
10245
10240
|
onLoadOlder: () => r.emit("list:loadOlder", { target: t.target })
|
|
10246
10241
|
}), {
|
|
10247
|
-
|
|
10248
|
-
|
|
10249
|
-
|
|
10250
|
-
|
|
10251
|
-
|
|
10252
|
-
|
|
10253
|
-
|
|
10242
|
+
actionMenuRef: z,
|
|
10243
|
+
activeActionMessage: Q,
|
|
10244
|
+
handleMessageContextMenu: W,
|
|
10245
|
+
handleMessageTap: le,
|
|
10246
|
+
resetActionMenuState: L,
|
|
10247
|
+
reactToMessage: B,
|
|
10248
|
+
toggleInlineReaction: Y,
|
|
10249
|
+
getActionItems: ee
|
|
10254
10250
|
} = v1({
|
|
10255
10251
|
canUseMessageActions: () => n.canUseMessageActions.value,
|
|
10256
10252
|
canReact: () => n.canReact.value,
|
|
@@ -10259,52 +10255,52 @@ const w1 = { class: "fullscreen-dialog__content" }, A1 = {
|
|
|
10259
10255
|
isInThread: () => o.value,
|
|
10260
10256
|
t: u,
|
|
10261
10257
|
emit: {
|
|
10262
|
-
reply: (
|
|
10263
|
-
edit: (
|
|
10264
|
-
info: (
|
|
10265
|
-
openThread: (
|
|
10266
|
-
delete: (
|
|
10267
|
-
translate: (
|
|
10268
|
-
toggleReaction: (
|
|
10258
|
+
reply: (G) => r.emit("message:reply", G),
|
|
10259
|
+
edit: (G) => r.emit("message:edit", G),
|
|
10260
|
+
info: (G) => r.emit("message:info", G),
|
|
10261
|
+
openThread: (G) => r.emit("message:openThread", G),
|
|
10262
|
+
delete: (G) => r.emit("message:delete", G),
|
|
10263
|
+
translate: (G) => r.emit("message:translate", G),
|
|
10264
|
+
toggleReaction: (G, X) => r.emit("message:toggleReaction", { message: G, emoji: X })
|
|
10269
10265
|
}
|
|
10270
10266
|
});
|
|
10271
|
-
function
|
|
10272
|
-
return !!
|
|
10267
|
+
function ue(G) {
|
|
10268
|
+
return !!G.url && ["image", "video", "audio"].includes(G.kind);
|
|
10273
10269
|
}
|
|
10274
|
-
function
|
|
10275
|
-
|
|
10270
|
+
function ve(G) {
|
|
10271
|
+
ue(G) && (y.value = G);
|
|
10276
10272
|
}
|
|
10277
|
-
function
|
|
10273
|
+
function De() {
|
|
10278
10274
|
y.value = null;
|
|
10279
10275
|
}
|
|
10280
|
-
async function
|
|
10281
|
-
E.value = `${
|
|
10276
|
+
async function Le(G, X) {
|
|
10277
|
+
E.value = `${G.id}:${X}`;
|
|
10282
10278
|
try {
|
|
10283
|
-
r.emit("message:votePoll", { message:
|
|
10279
|
+
r.emit("message:votePoll", { message: G, optionId: X });
|
|
10284
10280
|
} finally {
|
|
10285
10281
|
window.setTimeout(() => {
|
|
10286
|
-
E.value === `${
|
|
10282
|
+
E.value === `${G.id}:${X}` && (E.value = null);
|
|
10287
10283
|
}, 300);
|
|
10288
10284
|
}
|
|
10289
10285
|
}
|
|
10290
|
-
function
|
|
10291
|
-
d.value && r.emit("message:openThread",
|
|
10286
|
+
function me(G) {
|
|
10287
|
+
d.value && r.emit("message:openThread", G);
|
|
10292
10288
|
}
|
|
10293
|
-
function
|
|
10294
|
-
return
|
|
10289
|
+
function it(G, X) {
|
|
10290
|
+
return G.getFullYear() !== X.getFullYear() || G.getMonth() !== X.getMonth() || G.getDate() !== X.getDate();
|
|
10295
10291
|
}
|
|
10296
|
-
function
|
|
10297
|
-
const
|
|
10298
|
-
return
|
|
10292
|
+
function xe(G) {
|
|
10293
|
+
const X = i.value;
|
|
10294
|
+
return G === 0 ? !0 : it(X[G].sentAt, X[G - 1].sentAt);
|
|
10299
10295
|
}
|
|
10300
|
-
return (
|
|
10296
|
+
return (G, X) => (M(), F(je, null, [
|
|
10301
10297
|
T("section", {
|
|
10302
10298
|
class: Ce(["message-list-root", [
|
|
10303
|
-
|
|
10299
|
+
G.$attrs.class,
|
|
10304
10300
|
I.value ? "message-list--embedded-thread" : C.value ? "message-list--thread" : "message-list--main"
|
|
10305
10301
|
]])
|
|
10306
10302
|
}, [
|
|
10307
|
-
f.value ? Jt(
|
|
10303
|
+
f.value ? Jt(G.$slots, "header", {
|
|
10308
10304
|
key: 0,
|
|
10309
10305
|
conversation: v(n).conversation.value,
|
|
10310
10306
|
parentMessage: l.value,
|
|
@@ -10323,37 +10319,38 @@ const w1 = { class: "fullscreen-dialog__content" }, A1 = {
|
|
|
10323
10319
|
class: Ce(["message-list__body", I.value || C.value ? "bg-elevation-surface-overlay" : ""])
|
|
10324
10320
|
}, [
|
|
10325
10321
|
T("div", {
|
|
10326
|
-
|
|
10322
|
+
ref_key: "threadRef",
|
|
10323
|
+
ref: k,
|
|
10327
10324
|
class: Ce(["message-list__scroll", I.value ? "p-0" : C.value ? "message-list__scroll--thread" : "message-list__scroll--main"]),
|
|
10328
|
-
onScroll:
|
|
10329
|
-
(...
|
|
10325
|
+
onScroll: X[1] || (X[1] = //@ts-ignore
|
|
10326
|
+
(...q) => v(O) && v(O)(...q))
|
|
10330
10327
|
}, [
|
|
10331
10328
|
T("div", Oh, [
|
|
10332
10329
|
l.value ? (M(), F("div", Lh, [
|
|
10333
10330
|
T("p", Ph, Z(l.value.senderName), 1),
|
|
10334
10331
|
T("p", $h, Z(v(xu)(l.value)), 1)
|
|
10335
10332
|
])) : ae("", !0),
|
|
10336
|
-
(M(!0), F(
|
|
10337
|
-
key:
|
|
10333
|
+
(M(!0), F(je, null, ht(i.value, (q, Ge) => (M(), F(je, {
|
|
10334
|
+
key: q.id
|
|
10338
10335
|
}, [
|
|
10339
|
-
|
|
10336
|
+
xe(Ge) ? (M(), ne(V1, {
|
|
10340
10337
|
key: 0,
|
|
10341
|
-
date:
|
|
10338
|
+
date: q.sentAt
|
|
10342
10339
|
}, null, 8, ["date"])) : ae("", !0),
|
|
10343
10340
|
ie(sh, {
|
|
10344
|
-
message:
|
|
10341
|
+
message: q,
|
|
10345
10342
|
"current-user-id": v(n).currentUserId.value,
|
|
10346
10343
|
"can-react": v(n).canReact.value,
|
|
10347
10344
|
"can-open-thread": !l.value && d.value,
|
|
10348
10345
|
"can-show-sender-avatar": S.value,
|
|
10349
10346
|
"pending-option-key": E.value,
|
|
10350
|
-
onContextmenu: (
|
|
10351
|
-
onTap: (
|
|
10352
|
-
onOpenMedia:
|
|
10353
|
-
onVotePoll: (
|
|
10354
|
-
onToggleReaction: (
|
|
10355
|
-
onOpenThread: (
|
|
10356
|
-
onOpenReferencedMessage:
|
|
10347
|
+
onContextmenu: (ge) => v(W)(q, ge),
|
|
10348
|
+
onTap: (ge) => v(le)(q, ge),
|
|
10349
|
+
onOpenMedia: ve,
|
|
10350
|
+
onVotePoll: (ge) => Le(q, ge),
|
|
10351
|
+
onToggleReaction: (ge) => v(Y)(q, ge),
|
|
10352
|
+
onOpenThread: (ge) => me(q),
|
|
10353
|
+
onOpenReferencedMessage: X[0] || (X[0] = (ge) => v(r).emit("message:openReference", ge))
|
|
10357
10354
|
}, null, 8, ["message", "current-user-id", "can-react", "can-open-thread", "can-show-sender-avatar", "pending-option-key", "onContextmenu", "onTap", "onVotePoll", "onToggleReaction", "onOpenThread"])
|
|
10358
10355
|
], 64))), 128)),
|
|
10359
10356
|
i.value.length === 0 && g.value && !s.value ? (M(), F("div", Bh, Z(v(u)("noMessagesYetInThisGroup")), 1)) : ae("", !0)
|
|
@@ -10362,25 +10359,26 @@ const w1 = { class: "fullscreen-dialog__content" }, A1 = {
|
|
|
10362
10359
|
T("footer", {
|
|
10363
10360
|
class: Ce(["message-list__composer", C.value ? I.value ? "bg-transparent p-0" : "message-list__composer--thread" : "bg-transparent p-0"])
|
|
10364
10361
|
}, [
|
|
10365
|
-
Jt(
|
|
10362
|
+
Jt(G.$slots, "composer", {}, void 0, !0)
|
|
10366
10363
|
], 2)
|
|
10367
10364
|
], 2)) : (M(), F("div", qh, Z(v(u)("selectConversationToStart")), 1))
|
|
10368
10365
|
], 2),
|
|
10369
10366
|
ie(z1, {
|
|
10370
10367
|
attachment: y.value,
|
|
10371
|
-
onClose:
|
|
10368
|
+
onClose: De
|
|
10372
10369
|
}, null, 8, ["attachment"]),
|
|
10373
10370
|
ie(Th, {
|
|
10374
|
-
|
|
10375
|
-
|
|
10371
|
+
ref_key: "actionMenuRef",
|
|
10372
|
+
ref: z,
|
|
10373
|
+
message: v(Q),
|
|
10376
10374
|
"can-react": v(n).canReact.value,
|
|
10377
|
-
"action-items": v(
|
|
10378
|
-
onHide: v(
|
|
10379
|
-
onReact:
|
|
10375
|
+
"action-items": v(Q) ? v(ee)(v(Q)) : [],
|
|
10376
|
+
onHide: v(L),
|
|
10377
|
+
onReact: X[2] || (X[2] = (q) => v(B)(v(Q), q))
|
|
10380
10378
|
}, null, 8, ["message", "can-react", "action-items", "onHide"])
|
|
10381
10379
|
], 64));
|
|
10382
10380
|
}
|
|
10383
|
-
}), no = /* @__PURE__ */ Me(Nh, [["__scopeId", "data-v-
|
|
10381
|
+
}), no = /* @__PURE__ */ Me(Nh, [["__scopeId", "data-v-8d7a6a2b"]]), Uh = { class: "receipt-section" }, zh = { class: "receipt-section__header" }, Hh = { class: "text-heading-sm text-default" }, Zh = { class: "body-sm text-subtlest" }, jh = {
|
|
10384
10382
|
key: 0,
|
|
10385
10383
|
class: "space-y-2"
|
|
10386
10384
|
}, Vh = { class: "flex min-w-0 items-center gap-3" }, Gh = { class: "min-w-0" }, Wh = { class: "truncate heading-sm text-default" }, Yh = { class: "truncate body-sm text-subtle" }, Kh = { class: "shrink-0 body-sm text-subtle" }, Qh = {
|
|
@@ -10401,7 +10399,7 @@ const w1 = { class: "fullscreen-dialog__content" }, A1 = {
|
|
|
10401
10399
|
T("span", Zh, Z(e.receipts.length), 1)
|
|
10402
10400
|
]),
|
|
10403
10401
|
e.receipts.length ? (M(), F("div", jh, [
|
|
10404
|
-
(M(!0), F(
|
|
10402
|
+
(M(!0), F(je, null, ht(e.receipts, (n) => (M(), F("div", {
|
|
10405
10403
|
key: `${n.kind}-${n.user.uid}`,
|
|
10406
10404
|
class: "receipt-section__row"
|
|
10407
10405
|
}, [
|
|
@@ -10445,7 +10443,7 @@ const w1 = { class: "fullscreen-dialog__content" }, A1 = {
|
|
|
10445
10443
|
},
|
|
10446
10444
|
emits: ["close"],
|
|
10447
10445
|
setup(e, { emit: t }) {
|
|
10448
|
-
const u = e, n = t, { locale: a, t: r } =
|
|
10446
|
+
const u = e, n = t, { locale: a, t: r } = Oe(), o = N(() => u.receipts.filter((f) => f.kind === "delivered")), i = N(() => u.receipts.filter((f) => f.kind === "read")), s = N(() => u.receipts.filter(
|
|
10449
10447
|
(f) => f.kind === "delivered" || f.kind === "read"
|
|
10450
10448
|
));
|
|
10451
10449
|
function l(f) {
|
|
@@ -10461,7 +10459,7 @@ const w1 = { class: "fullscreen-dialog__content" }, A1 = {
|
|
|
10461
10459
|
"close-label": v(r)("close"),
|
|
10462
10460
|
onClose: x[0] || (x[0] = (m) => n("close"))
|
|
10463
10461
|
}, {
|
|
10464
|
-
default:
|
|
10462
|
+
default: He(() => [
|
|
10465
10463
|
e.message ? (M(), F("div", Jh, [
|
|
10466
10464
|
T("div", ep, [
|
|
10467
10465
|
T("p", tp, Z(v(xu)(e.message)), 1),
|
|
@@ -10554,7 +10552,7 @@ const w1 = { class: "fullscreen-dialog__content" }, A1 = {
|
|
|
10554
10552
|
},
|
|
10555
10553
|
emits: ["close", "reschedule"],
|
|
10556
10554
|
setup(e, { emit: t }) {
|
|
10557
|
-
const u = e, n = t, a = U(null), r = U(""), o = U(""), { locale: i, t: s } =
|
|
10555
|
+
const u = e, n = t, a = U(null), r = U(""), o = U(""), { locale: i, t: s } = Oe(), l = N(() => u.messages.filter((y) => {
|
|
10558
10556
|
var E;
|
|
10559
10557
|
return !y.isDeleted && !!((E = y.scheduled) != null && E.scheduleDate);
|
|
10560
10558
|
})), d = N(() => /^([01]\d|2[0-3]):([0-5]\d)$/.test(o.value));
|
|
@@ -10586,15 +10584,15 @@ const w1 = { class: "fullscreen-dialog__content" }, A1 = {
|
|
|
10586
10584
|
a.value = null, r.value = "", o.value = "";
|
|
10587
10585
|
}
|
|
10588
10586
|
function D(y) {
|
|
10589
|
-
var z, Q,
|
|
10590
|
-
if (!((z = y.scheduled) != null && z.messageId) || !((Q = y.scheduled) != null && Q.muid) || !((
|
|
10587
|
+
var z, Q, W;
|
|
10588
|
+
if (!((z = y.scheduled) != null && z.messageId) || !((Q = y.scheduled) != null && Q.muid) || !((W = y.scheduled) != null && W.originalChatUid) || !r.value || !d.value)
|
|
10591
10589
|
return;
|
|
10592
|
-
const [E, C, I] = r.value.split("-").map(Number), [S, k] = o.value.split(":").map(Number),
|
|
10590
|
+
const [E, C, I] = r.value.split("-").map(Number), [S, k] = o.value.split(":").map(Number), O = new Date(E, C - 1, I, S, k, 0, 0);
|
|
10593
10591
|
n("reschedule", {
|
|
10594
10592
|
messageId: y.scheduled.messageId,
|
|
10595
10593
|
muid: y.scheduled.muid,
|
|
10596
10594
|
originalChatUid: y.scheduled.originalChatUid,
|
|
10597
|
-
scheduleDate:
|
|
10595
|
+
scheduleDate: O.toISOString()
|
|
10598
10596
|
}), _();
|
|
10599
10597
|
}
|
|
10600
10598
|
return (y, E) => (M(), ne(Jn, {
|
|
@@ -10605,7 +10603,7 @@ const w1 = { class: "fullscreen-dialog__content" }, A1 = {
|
|
|
10605
10603
|
"body-class": "px-4 py-4 sm:px-6 sm:py-5",
|
|
10606
10604
|
onClose: E[2] || (E[2] = (C) => n("close"))
|
|
10607
10605
|
}, {
|
|
10608
|
-
default:
|
|
10606
|
+
default: He(() => [
|
|
10609
10607
|
T("div", xp, [
|
|
10610
10608
|
e.loading ? (M(), F("div", yp, [
|
|
10611
10609
|
ie(v(co), {
|
|
@@ -10613,8 +10611,8 @@ const w1 = { class: "fullscreen-dialog__content" }, A1 = {
|
|
|
10613
10611
|
strokeWidth: "6"
|
|
10614
10612
|
})
|
|
10615
10613
|
])) : l.value.length === 0 ? (M(), F("div", _p, Z(v(s)("noScheduledMessagesForConversation")), 1)) : (M(), F("div", Cp, [
|
|
10616
|
-
(M(!0), F(
|
|
10617
|
-
var I, S, k,
|
|
10614
|
+
(M(!0), F(je, null, ht(l.value, (C) => {
|
|
10615
|
+
var I, S, k, O;
|
|
10618
10616
|
return M(), F("article", {
|
|
10619
10617
|
key: C.id,
|
|
10620
10618
|
class: "scheduled-message-row px-1 py-4"
|
|
@@ -10644,7 +10642,7 @@ const w1 = { class: "fullscreen-dialog__content" }, A1 = {
|
|
|
10644
10642
|
C.kind === "poll" && C.poll ? (M(), F("p", Dp, Z(C.poll.question), 1)) : (M(), F("p", Ep, Z(v(xu)(C, v(s)("attachment"))), 1))
|
|
10645
10643
|
])
|
|
10646
10644
|
]),
|
|
10647
|
-
(S = C.scheduled) != null && S.messageId && ((k = C.scheduled) != null && k.muid) && ((
|
|
10645
|
+
(S = C.scheduled) != null && S.messageId && ((k = C.scheduled) != null && k.muid) && ((O = C.scheduled) != null && O.originalChatUid) ? (M(), ne(v(rt), {
|
|
10648
10646
|
key: 0,
|
|
10649
10647
|
label: v(s)("reschedule"),
|
|
10650
10648
|
icon: v(Mi),
|
|
@@ -10675,13 +10673,13 @@ const w1 = { class: "fullscreen-dialog__content" }, A1 = {
|
|
|
10675
10673
|
])
|
|
10676
10674
|
]),
|
|
10677
10675
|
T("div", Fp, [
|
|
10678
|
-
ie(v(
|
|
10676
|
+
ie(v(rt), {
|
|
10679
10677
|
label: v(s)("save"),
|
|
10680
10678
|
size: "small",
|
|
10681
10679
|
disabled: !r.value || !d.value,
|
|
10682
10680
|
onClick: (z) => D(C)
|
|
10683
10681
|
}, null, 8, ["label", "disabled", "onClick"]),
|
|
10684
|
-
ie(v(
|
|
10682
|
+
ie(v(rt), {
|
|
10685
10683
|
label: v(s)("cancel"),
|
|
10686
10684
|
size: "small",
|
|
10687
10685
|
text: "",
|
|
@@ -10747,11 +10745,11 @@ const w1 = { class: "fullscreen-dialog__content" }, A1 = {
|
|
|
10747
10745
|
},
|
|
10748
10746
|
emits: ["chatMembersFetched", "chatEmpty"],
|
|
10749
10747
|
setup(e, { emit: t }) {
|
|
10750
|
-
const u = e, n = t, { t: a } =
|
|
10748
|
+
const u = e, n = t, { t: a } = Oe(() => u.language), r = U(null), o = U(!1), i = U(!1), s = N(() => u.client ?? pe.value ?? null), l = N(() => !!u.chatUid), d = N(() => {
|
|
10751
10749
|
if (u.conversation !== void 0) return u.conversation;
|
|
10752
10750
|
const k = s.value;
|
|
10753
10751
|
return k ? u.chatUid ? k.conversations.value.find(
|
|
10754
|
-
(
|
|
10752
|
+
(O) => O.targetId === u.chatUid || O.id === u.chatUid
|
|
10755
10753
|
) ?? null : k.activeConversation.value : null;
|
|
10756
10754
|
}), f = Od({
|
|
10757
10755
|
chatClient: s,
|
|
@@ -10826,13 +10824,13 @@ const w1 = { class: "fullscreen-dialog__content" }, A1 = {
|
|
|
10826
10824
|
), Ke(
|
|
10827
10825
|
() => u.chatMessageGetter,
|
|
10828
10826
|
(k) => {
|
|
10829
|
-
|
|
10827
|
+
ze.setGetChatMessagesCallback(k);
|
|
10830
10828
|
},
|
|
10831
10829
|
{ immediate: !0 }
|
|
10832
10830
|
), Ke(
|
|
10833
10831
|
() => u.loadMessageId,
|
|
10834
10832
|
(k) => {
|
|
10835
|
-
|
|
10833
|
+
ze.loadMessageId.value = k || void 0;
|
|
10836
10834
|
},
|
|
10837
10835
|
{ immediate: !0 }
|
|
10838
10836
|
), Ke(
|
|
@@ -10846,15 +10844,15 @@ const w1 = { class: "fullscreen-dialog__content" }, A1 = {
|
|
|
10846
10844
|
}), Ke(
|
|
10847
10845
|
[
|
|
10848
10846
|
() => u.chatUid,
|
|
10849
|
-
() => u.client ? u.client.initialized.value :
|
|
10850
|
-
() => u.client ? u.client.loggedIn.value :
|
|
10847
|
+
() => u.client ? u.client.initialized.value : ze.initialized.value,
|
|
10848
|
+
() => u.client ? u.client.loggedIn.value : ze.loggedIn.value,
|
|
10851
10849
|
() => {
|
|
10852
10850
|
var k;
|
|
10853
10851
|
return ((k = s.value) == null ? void 0 : k.conversations.value.length) ?? 0;
|
|
10854
10852
|
}
|
|
10855
10853
|
],
|
|
10856
|
-
async ([k,
|
|
10857
|
-
!l.value || !k || !
|
|
10854
|
+
async ([k, O, z]) => {
|
|
10855
|
+
!l.value || !k || !O || !z || !s.value || await S();
|
|
10858
10856
|
},
|
|
10859
10857
|
{ immediate: !0 }
|
|
10860
10858
|
), Ke(
|
|
@@ -10862,8 +10860,8 @@ const w1 = { class: "fullscreen-dialog__content" }, A1 = {
|
|
|
10862
10860
|
() => x.messages.value.length,
|
|
10863
10861
|
() => x.threadMessages.value.length,
|
|
10864
10862
|
() => u.loadMessageId,
|
|
10865
|
-
() =>
|
|
10866
|
-
() =>
|
|
10863
|
+
() => ze.loadMessageId.value,
|
|
10864
|
+
() => ze.scrollToMessageId.value
|
|
10867
10865
|
],
|
|
10868
10866
|
async () => {
|
|
10869
10867
|
await I();
|
|
@@ -10875,21 +10873,21 @@ const w1 = { class: "fullscreen-dialog__content" }, A1 = {
|
|
|
10875
10873
|
i.value = !0, o.value = !1;
|
|
10876
10874
|
try {
|
|
10877
10875
|
k.conversations.value.length === 0 && await k.fetchConversations();
|
|
10878
|
-
const
|
|
10876
|
+
const O = k.conversations.value.find(
|
|
10879
10877
|
(z) => z.targetId === u.chatUid || z.id === u.chatUid
|
|
10880
10878
|
) ?? null;
|
|
10881
|
-
if (!
|
|
10879
|
+
if (!O) {
|
|
10882
10880
|
o.value = !0, n("chatMembersFetched", []);
|
|
10883
10881
|
return;
|
|
10884
10882
|
}
|
|
10885
|
-
k.activeConversationId.value !==
|
|
10883
|
+
k.activeConversationId.value !== O.id && await k.selectConversation(O.id), await C(O.targetId);
|
|
10886
10884
|
} finally {
|
|
10887
10885
|
i.value = !1;
|
|
10888
10886
|
}
|
|
10889
10887
|
}
|
|
10890
10888
|
}
|
|
10891
|
-
return (k,
|
|
10892
|
-
var z, Q,
|
|
10889
|
+
return (k, O) => {
|
|
10890
|
+
var z, Q, W, le, L, B, Y, ee;
|
|
10893
10891
|
return M(), F("div", {
|
|
10894
10892
|
ref_key: "chatRootRef",
|
|
10895
10893
|
ref: r,
|
|
@@ -10901,18 +10899,18 @@ const w1 = { class: "fullscreen-dialog__content" }, A1 = {
|
|
|
10901
10899
|
closable: !1,
|
|
10902
10900
|
class: "pointer-events-auto absolute inset-x-2 top-2 z-20 shadow-lg"
|
|
10903
10901
|
}, {
|
|
10904
|
-
default:
|
|
10902
|
+
default: He(() => [
|
|
10905
10903
|
lo(Z(s.value.error.value), 1)
|
|
10906
10904
|
]),
|
|
10907
10905
|
_: 1
|
|
10908
10906
|
})) : ae("", !0),
|
|
10909
|
-
s.value ? (M(), F(
|
|
10907
|
+
s.value ? (M(), F(je, { key: 1 }, [
|
|
10910
10908
|
ie(no, {
|
|
10911
10909
|
target: "main",
|
|
10912
10910
|
class: Ce(["h-full", e.containerClass]),
|
|
10913
10911
|
"show-header": g.value
|
|
10914
10912
|
}, Li({
|
|
10915
|
-
composer:
|
|
10913
|
+
composer: He(() => [
|
|
10916
10914
|
ie(uo, {
|
|
10917
10915
|
ref_key: "mainComposerRef",
|
|
10918
10916
|
ref: D,
|
|
@@ -10923,7 +10921,7 @@ const w1 = { class: "fullscreen-dialog__content" }, A1 = {
|
|
|
10923
10921
|
}, [
|
|
10924
10922
|
k.$slots["message-header"] ? {
|
|
10925
10923
|
name: "header",
|
|
10926
|
-
fn:
|
|
10924
|
+
fn: He((ue) => [
|
|
10927
10925
|
Jt(k.$slots, "message-header", Pi($i(ue)), void 0, !0)
|
|
10928
10926
|
]),
|
|
10929
10927
|
key: "0"
|
|
@@ -10932,17 +10930,17 @@ const w1 = { class: "fullscreen-dialog__content" }, A1 = {
|
|
|
10932
10930
|
ie(Jn, {
|
|
10933
10931
|
open: !!v(x).activeThreadParentMessage.value,
|
|
10934
10932
|
title: v(a)("threadWithCount", { count: ((Q = v(x).activeThreadParentMessage.value) == null ? void 0 : Q.replyCount) ?? 0 }),
|
|
10935
|
-
subtitle: ((
|
|
10933
|
+
subtitle: ((W = d.value) == null ? void 0 : W.title) ?? "",
|
|
10936
10934
|
"close-label": v(a)("close"),
|
|
10937
10935
|
"close-aria-label": v(a)("closeThread"),
|
|
10938
|
-
onClose:
|
|
10936
|
+
onClose: O[0] || (O[0] = (ue) => v(E).emit("ui:closeThread"))
|
|
10939
10937
|
}, {
|
|
10940
|
-
default:
|
|
10938
|
+
default: He(() => [
|
|
10941
10939
|
ie(no, {
|
|
10942
10940
|
target: "thread",
|
|
10943
10941
|
class: "min-h-0 flex-1"
|
|
10944
10942
|
}, {
|
|
10945
|
-
composer:
|
|
10943
|
+
composer: He(() => [
|
|
10946
10944
|
ie(uo, {
|
|
10947
10945
|
ref_key: "threadComposerRef",
|
|
10948
10946
|
ref: y,
|
|
@@ -10959,8 +10957,8 @@ const w1 = { class: "fullscreen-dialog__content" }, A1 = {
|
|
|
10959
10957
|
loading: v(w).loadingScheduledMessages.value,
|
|
10960
10958
|
messages: v(w).scheduledMessages.value,
|
|
10961
10959
|
"conversation-title": (le = d.value) == null ? void 0 : le.title,
|
|
10962
|
-
onClose:
|
|
10963
|
-
onReschedule:
|
|
10960
|
+
onClose: O[1] || (O[1] = (ue) => v(w).showScheduledMessages.value = !1),
|
|
10961
|
+
onReschedule: O[2] || (O[2] = (ue) => v(E).emit("ui:reschedule", ue))
|
|
10964
10962
|
}, null, 8, ["open", "loading", "messages", "conversation-title"]),
|
|
10965
10963
|
ie(vp, {
|
|
10966
10964
|
open: !!v(w).infoMessage.value,
|
|
@@ -10968,13 +10966,13 @@ const w1 = { class: "fullscreen-dialog__content" }, A1 = {
|
|
|
10968
10966
|
receipts: v(w).infoMessageReceipts.value,
|
|
10969
10967
|
loading: v(w).loadingMessageReceipts.value,
|
|
10970
10968
|
error: v(w).messageReceiptsError.value,
|
|
10971
|
-
onClose:
|
|
10969
|
+
onClose: O[3] || (O[3] = (ue) => v(w).closeMessageInfo())
|
|
10972
10970
|
}, null, 8, ["open", "message", "receipts", "loading", "error"])
|
|
10973
10971
|
], 64)) : ae("", !0),
|
|
10974
10972
|
ie(zp, {
|
|
10975
10973
|
visible: l.value && (((L = s.value) == null ? void 0 : L.offlineMode.value) || !((B = s.value) != null && B.connected.value) || i.value && !m.value || o.value || e.displayNoMessagesText && v(x).isChatEmpty.value),
|
|
10976
|
-
"offline-mode": !!((
|
|
10977
|
-
connected: !!((
|
|
10974
|
+
"offline-mode": !!((Y = s.value) != null && Y.offlineMode.value && !d.value),
|
|
10975
|
+
connected: !!((ee = s.value) != null && ee.connected.value || d.value),
|
|
10978
10976
|
loading: i.value,
|
|
10979
10977
|
"not-found": o.value,
|
|
10980
10978
|
"is-empty": v(x).isChatEmpty.value,
|
|
@@ -10987,7 +10985,7 @@ const w1 = { class: "fullscreen-dialog__content" }, A1 = {
|
|
|
10987
10985
|
noMessages: v(a)("noMessagesHaveBeenSentYet")
|
|
10988
10986
|
}
|
|
10989
10987
|
}, {
|
|
10990
|
-
"no-messages":
|
|
10988
|
+
"no-messages": He(() => [
|
|
10991
10989
|
Jt(k.$slots, "no-messages", {}, void 0, !0)
|
|
10992
10990
|
]),
|
|
10993
10991
|
_: 3
|
|
@@ -11000,8 +10998,8 @@ export {
|
|
|
11000
10998
|
ro as BccChat,
|
|
11001
10999
|
ro as BccChatMessageList,
|
|
11002
11000
|
Xu as LogSeverity,
|
|
11003
|
-
|
|
11001
|
+
ze as chat,
|
|
11004
11002
|
S0 as createChatClient,
|
|
11005
|
-
|
|
11003
|
+
ze as default
|
|
11006
11004
|
};
|
|
11007
11005
|
//# sourceMappingURL=vue-bcc-chat-ui.js.map
|