@bcc-code/vue-bcc-chat-ui 7.1.57 → 7.1.59
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/index.d.ts +6 -5
- package/dist/vue-bcc-chat-ui.js +734 -737
- package/dist/vue-bcc-chat-ui.js.map +1 -1
- package/package.json +1 -1
package/dist/vue-bcc-chat-ui.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Fragment as e, Teleport as t, computed as n, createBlock as r, createCommentVNode as i, createElementBlock as a, createElementVNode as o, createSlots as s, createTextVNode as c, createVNode as l, defineComponent as u, guardReactiveProps as d, inject as f, isRef as p, mergeModels as m, nextTick as h, normalizeClass as g, normalizeProps as _, normalizeStyle as v, onBeforeUnmount as y, onMounted as b, onUnmounted as x, openBlock as S, provide as C, ref as w, renderList as T, renderSlot as E, resolveDynamicComponent as D, shallowRef as O, toDisplayString as k, toValue as A, unref as j, useModel as M, useTemplateRef as
|
|
2
|
-
import { BccAvatar as B, BccButton as V, BccComponentLibrary as H, BccDialog as U, BccImage as te, BccInput as
|
|
3
|
-
import { CometChat as
|
|
4
|
-
import { AddIcon as
|
|
1
|
+
import { Fragment as e, Teleport as t, computed as n, createBlock as r, createCommentVNode as i, createElementBlock as a, createElementVNode as o, createSlots as s, createTextVNode as c, createVNode as l, defineComponent as u, guardReactiveProps as d, inject as f, isRef as p, mergeModels as m, nextTick as h, normalizeClass as g, normalizeProps as _, normalizeStyle as v, onBeforeUnmount as y, onMounted as b, onUnmounted as x, openBlock as S, provide as C, ref as w, renderList as T, renderSlot as E, resolveDynamicComponent as D, shallowRef as O, toDisplayString as k, toValue as A, unref as j, useModel as M, useTemplateRef as ee, vModelText as N, vShow as P, watch as F, withCtx as I, withDirectives as L, withKeys as R, withModifiers as z } from "vue";
|
|
2
|
+
import { BccAvatar as B, BccButton as V, BccComponentLibrary as H, BccDialog as U, BccImage as te, BccInput as W, BccInputText as ne, BccMenu as re, BccMessage as ie, BccProgressSpinner as G, BccTag as K } from "@bcc-code/component-library-vue";
|
|
3
|
+
import { CometChat as q } from "@cometchat/chat-sdk-javascript";
|
|
4
|
+
import { AddIcon as ae, ArrowBackIcon as oe, AttachFileIcon as se, BarChartIcon as ce, CalendarAddOnIcon as le, CheckIcon as ue, CloseIcon as de, CodeBlocksIcon as fe, ContentCopyIcon as pe, DeleteIcon as me, DescriptionIcon as he, DoneAllIcon as ge, EditCalendarIcon as _e, EditIcon as ve, ErrorIcon as ye, FilePresentIcon as be, FolderZipIcon as xe, ForumIcon as Se, ImageIcon as Ce, KeyboardArrowDownIcon as we, KeyboardArrowUpIcon as Te, LinkIcon as Ee, MicIcon as De, OpenInNewIcon as Oe, PendingIcon as ke, PictureAsPdfIcon as Ae, ReplyIcon as je, ScheduleIcon as Me, SendIcon as Ne, TableChartIcon as Pe, TextSnippetIcon as J, TranslateIcon as Fe, VideocamIcon as Ie } from "@bcc-code/icons-vue";
|
|
5
5
|
//#region \0rolldown/runtime.js
|
|
6
6
|
var Le = Object.defineProperty, Re = (e, t) => {
|
|
7
7
|
let n = {};
|
|
@@ -547,7 +547,7 @@ function Qt(e) {
|
|
|
547
547
|
}
|
|
548
548
|
async function $t(e) {
|
|
549
549
|
try {
|
|
550
|
-
let t = await
|
|
550
|
+
let t = await q.getGroup(e), n = t?.getMetadata?.(), r = t?.getHasJoined?.() ?? !1;
|
|
551
551
|
return n?.isChannel === !0 && !r;
|
|
552
552
|
} catch {
|
|
553
553
|
return !1;
|
|
@@ -806,7 +806,7 @@ function gr() {
|
|
|
806
806
|
}
|
|
807
807
|
let x, S = "", C = n, w = C.implementation, T = C.createNodeIterator, E = C.createDocumentFragment, D = C.getElementsByTagName, O = r.importNode, k = hr();
|
|
808
808
|
t.isSupported = typeof sn == "function" && typeof b == "function" && w && w.createHTMLDocument !== void 0;
|
|
809
|
-
let A = nr, j = rr, M = ir,
|
|
809
|
+
let A = nr, j = rr, M = ir, ee = ar, N = or, P = cr, F = lr, I = dr, L = sr, R = null, z = Z({}, [
|
|
810
810
|
...Gn,
|
|
811
811
|
...Kn,
|
|
812
812
|
...qn,
|
|
@@ -836,7 +836,7 @@ function gr() {
|
|
|
836
836
|
enumerable: !0,
|
|
837
837
|
value: !1
|
|
838
838
|
}
|
|
839
|
-
})), U = null, te = null,
|
|
839
|
+
})), U = null, te = null, W = Object.seal(mn(null, {
|
|
840
840
|
tagCheck: {
|
|
841
841
|
writable: !0,
|
|
842
842
|
configurable: !1,
|
|
@@ -849,7 +849,7 @@ function gr() {
|
|
|
849
849
|
enumerable: !0,
|
|
850
850
|
value: null
|
|
851
851
|
}
|
|
852
|
-
})),
|
|
852
|
+
})), ne = !0, re = !0, ie = !1, G = !0, K = !1, q = !0, ae = !1, oe = !1, se = !1, ce = !1, le = !1, ue = !1, de = !0, fe = !1, pe = "user-content-", me = !0, he = !1, ge = {}, _e = null, ve = Z({}, [
|
|
853
853
|
"annotation-xml",
|
|
854
854
|
"audio",
|
|
855
855
|
"colgroup",
|
|
@@ -918,7 +918,7 @@ function gr() {
|
|
|
918
918
|
}, Re = function() {
|
|
919
919
|
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
920
920
|
if (Fe && Fe === e) return;
|
|
921
|
-
(!e || typeof e != "object") && (e = {}), e = Vn(e), Ne = Pe.indexOf(e.PARSER_MEDIA_TYPE) === -1 ? "text/html" : e.PARSER_MEDIA_TYPE, J = Ne === "application/xhtml+xml" ? Tn : wn, R = Pn(e, "ALLOWED_TAGS") && Cn(e.ALLOWED_TAGS) ? Z({}, e.ALLOWED_TAGS, J) : z, B = Pn(e, "ALLOWED_ATTR") && Cn(e.ALLOWED_ATTR) ? Z({}, e.ALLOWED_ATTR, J) : V, Oe = Pn(e, "ALLOWED_NAMESPACES") && Cn(e.ALLOWED_NAMESPACES) ? Z({}, e.ALLOWED_NAMESPACES, Tn) : ke, xe = Pn(e, "ADD_URI_SAFE_ATTR") && Cn(e.ADD_URI_SAFE_ATTR) ? Z(Vn(Se), e.ADD_URI_SAFE_ATTR, J) : Se, ye = Pn(e, "ADD_DATA_URI_TAGS") && Cn(e.ADD_DATA_URI_TAGS) ? Z(Vn(be), e.ADD_DATA_URI_TAGS, J) : be, _e = Pn(e, "FORBID_CONTENTS") && Cn(e.FORBID_CONTENTS) ? Z({}, e.FORBID_CONTENTS, J) : ve, U = Pn(e, "FORBID_TAGS") && Cn(e.FORBID_TAGS) ? Z({}, e.FORBID_TAGS, J) : Vn({}), te = Pn(e, "FORBID_ATTR") && Cn(e.FORBID_ATTR) ? Z({}, e.FORBID_ATTR, J) : Vn({}), ge = Pn(e, "USE_PROFILES") ? e.USE_PROFILES && typeof e.USE_PROFILES == "object" ? Vn(e.USE_PROFILES) : e.USE_PROFILES : !1,
|
|
921
|
+
(!e || typeof e != "object") && (e = {}), e = Vn(e), Ne = Pe.indexOf(e.PARSER_MEDIA_TYPE) === -1 ? "text/html" : e.PARSER_MEDIA_TYPE, J = Ne === "application/xhtml+xml" ? Tn : wn, R = Pn(e, "ALLOWED_TAGS") && Cn(e.ALLOWED_TAGS) ? Z({}, e.ALLOWED_TAGS, J) : z, B = Pn(e, "ALLOWED_ATTR") && Cn(e.ALLOWED_ATTR) ? Z({}, e.ALLOWED_ATTR, J) : V, Oe = Pn(e, "ALLOWED_NAMESPACES") && Cn(e.ALLOWED_NAMESPACES) ? Z({}, e.ALLOWED_NAMESPACES, Tn) : ke, xe = Pn(e, "ADD_URI_SAFE_ATTR") && Cn(e.ADD_URI_SAFE_ATTR) ? Z(Vn(Se), e.ADD_URI_SAFE_ATTR, J) : Se, ye = Pn(e, "ADD_DATA_URI_TAGS") && Cn(e.ADD_DATA_URI_TAGS) ? Z(Vn(be), e.ADD_DATA_URI_TAGS, J) : be, _e = Pn(e, "FORBID_CONTENTS") && Cn(e.FORBID_CONTENTS) ? Z({}, e.FORBID_CONTENTS, J) : ve, U = Pn(e, "FORBID_TAGS") && Cn(e.FORBID_TAGS) ? Z({}, e.FORBID_TAGS, J) : Vn({}), te = Pn(e, "FORBID_ATTR") && Cn(e.FORBID_ATTR) ? Z({}, e.FORBID_ATTR, J) : Vn({}), ge = Pn(e, "USE_PROFILES") ? e.USE_PROFILES && typeof e.USE_PROFILES == "object" ? Vn(e.USE_PROFILES) : e.USE_PROFILES : !1, ne = e.ALLOW_ARIA_ATTR !== !1, re = e.ALLOW_DATA_ATTR !== !1, ie = e.ALLOW_UNKNOWN_PROTOCOLS || !1, G = e.ALLOW_SELF_CLOSE_IN_ATTR !== !1, K = e.SAFE_FOR_TEMPLATES || !1, q = e.SAFE_FOR_XML !== !1, ae = e.WHOLE_DOCUMENT || !1, ce = e.RETURN_DOM || !1, le = e.RETURN_DOM_FRAGMENT || !1, ue = e.RETURN_TRUSTED_TYPE || !1, se = e.FORCE_BODY || !1, de = e.SANITIZE_DOM !== !1, fe = e.SANITIZE_NAMED_PROPS || !1, me = e.KEEP_CONTENT !== !1, he = e.IN_PLACE || !1, L = Wn(e.ALLOWED_URI_REGEXP) ? e.ALLOWED_URI_REGEXP : sr, Ee = typeof e.NAMESPACE == "string" ? e.NAMESPACE : Te, Ae = Pn(e, "MATHML_TEXT_INTEGRATION_POINTS") && e.MATHML_TEXT_INTEGRATION_POINTS && typeof e.MATHML_TEXT_INTEGRATION_POINTS == "object" ? Vn(e.MATHML_TEXT_INTEGRATION_POINTS) : Z({}, [
|
|
922
922
|
"mi",
|
|
923
923
|
"mo",
|
|
924
924
|
"mn",
|
|
@@ -926,7 +926,7 @@ function gr() {
|
|
|
926
926
|
"mtext"
|
|
927
927
|
]), je = Pn(e, "HTML_INTEGRATION_POINTS") && e.HTML_INTEGRATION_POINTS && typeof e.HTML_INTEGRATION_POINTS == "object" ? Vn(e.HTML_INTEGRATION_POINTS) : Z({}, ["annotation-xml"]);
|
|
928
928
|
let t = Pn(e, "CUSTOM_ELEMENT_HANDLING") && e.CUSTOM_ELEMENT_HANDLING && typeof e.CUSTOM_ELEMENT_HANDLING == "object" ? Vn(e.CUSTOM_ELEMENT_HANDLING) : mn(null);
|
|
929
|
-
if (H = mn(null), Pn(t, "tagNameCheck") && Le(t.tagNameCheck) && (H.tagNameCheck = t.tagNameCheck), Pn(t, "attributeNameCheck") && Le(t.attributeNameCheck) && (H.attributeNameCheck = t.attributeNameCheck), Pn(t, "allowCustomizedBuiltInElements") && typeof t.allowCustomizedBuiltInElements == "boolean" && (H.allowCustomizedBuiltInElements = t.allowCustomizedBuiltInElements),
|
|
929
|
+
if (H = mn(null), Pn(t, "tagNameCheck") && Le(t.tagNameCheck) && (H.tagNameCheck = t.tagNameCheck), Pn(t, "attributeNameCheck") && Le(t.attributeNameCheck) && (H.attributeNameCheck = t.attributeNameCheck), Pn(t, "allowCustomizedBuiltInElements") && typeof t.allowCustomizedBuiltInElements == "boolean" && (H.allowCustomizedBuiltInElements = t.allowCustomizedBuiltInElements), K && (re = !1), le && (ce = !0), ge && (R = Z({}, Zn), B = mn(null), ge.html === !0 && (Z(R, Gn), Z(B, Qn)), ge.svg === !0 && (Z(R, Kn), Z(B, $n), Z(B, tr)), ge.svgFilters === !0 && (Z(R, qn), Z(B, $n), Z(B, tr)), ge.mathMl === !0 && (Z(R, Yn), Z(B, er), Z(B, tr))), W.tagCheck = null, W.attributeCheck = null, Pn(e, "ADD_TAGS") && (typeof e.ADD_TAGS == "function" ? W.tagCheck = e.ADD_TAGS : Cn(e.ADD_TAGS) && (R === z && (R = Vn(R)), Z(R, e.ADD_TAGS, J))), Pn(e, "ADD_ATTR") && (typeof e.ADD_ATTR == "function" ? W.attributeCheck = e.ADD_ATTR : Cn(e.ADD_ATTR) && (B === V && (B = Vn(B)), Z(B, e.ADD_ATTR, J))), Pn(e, "ADD_URI_SAFE_ATTR") && Cn(e.ADD_URI_SAFE_ATTR) && Z(xe, e.ADD_URI_SAFE_ATTR, J), Pn(e, "FORBID_CONTENTS") && Cn(e.FORBID_CONTENTS) && (_e === ve && (_e = Vn(_e)), Z(_e, e.FORBID_CONTENTS, J)), Pn(e, "ADD_FORBID_CONTENTS") && Cn(e.ADD_FORBID_CONTENTS) && (_e === ve && (_e = Vn(_e)), Z(_e, e.ADD_FORBID_CONTENTS, J)), me && (R["#text"] = !0), ae && Z(R, [
|
|
930
930
|
"html",
|
|
931
931
|
"head",
|
|
932
932
|
"body"
|
|
@@ -992,7 +992,7 @@ function gr() {
|
|
|
992
992
|
} catch {}
|
|
993
993
|
}
|
|
994
994
|
let a = t.body || t.documentElement;
|
|
995
|
-
return e && r && a.insertBefore(n.createTextNode(r), a.childNodes[0] || null), Ee === Te ? D.call(t,
|
|
995
|
+
return e && r && a.insertBefore(n.createTextNode(r), a.childNodes[0] || null), Ee === Te ? D.call(t, ae ? "html" : "body")[0] : ae ? t.documentElement : a;
|
|
996
996
|
}, We = function(e) {
|
|
997
997
|
return T.call(e.ownerDocument || e, e, l.SHOW_ELEMENT | l.SHOW_COMMENT | l.SHOW_TEXT | l.SHOW_PROCESSING_INSTRUCTION | l.SHOW_CDATA_SECTION, null);
|
|
998
998
|
}, Ge = function(e) {
|
|
@@ -1012,8 +1012,8 @@ function gr() {
|
|
|
1012
1012
|
if (qe(k.uponSanitizeElement, e, {
|
|
1013
1013
|
tagName: r,
|
|
1014
1014
|
allowedTags: R
|
|
1015
|
-
}),
|
|
1016
|
-
if (U[r] || !(
|
|
1015
|
+
}), q && e.hasChildNodes() && !Ke(e.firstElementChild) && In(/<[/\w!]/g, e.innerHTML) && In(/<[/\w!]/g, e.textContent) || q && e.namespaceURI === Te && r === "style" && Ke(e.firstElementChild) || e.nodeType === fr.progressingInstruction || q && e.nodeType === fr.comment && In(/<[/\w]/g, e.data)) return Y(e), !0;
|
|
1016
|
+
if (U[r] || !(W.tagCheck instanceof Function && W.tagCheck(r)) && !R[r]) {
|
|
1017
1017
|
if (!U[r] && Ze(r) && (H.tagNameCheck instanceof RegExp && In(H.tagNameCheck, r) || H.tagNameCheck instanceof Function && H.tagNameCheck(r))) return !1;
|
|
1018
1018
|
if (me && !_e[r]) {
|
|
1019
1019
|
let t = b(e) || e.parentNode, n = y(e) || e.childNodes;
|
|
@@ -1027,7 +1027,7 @@ function gr() {
|
|
|
1027
1027
|
}
|
|
1028
1028
|
return Y(e), !0;
|
|
1029
1029
|
}
|
|
1030
|
-
return e instanceof c && !Ve(e) || (r === "noscript" || r === "noembed" || r === "noframes") && In(/<\/no(script|embed|frames)/i, e.innerHTML) ? (Y(e), !0) : (
|
|
1030
|
+
return e instanceof c && !Ve(e) || (r === "noscript" || r === "noembed" || r === "noframes") && In(/<\/no(script|embed|frames)/i, e.innerHTML) ? (Y(e), !0) : (K && e.nodeType === fr.text && (n = e.textContent, vn([
|
|
1031
1031
|
A,
|
|
1032
1032
|
j,
|
|
1033
1033
|
M
|
|
@@ -1036,11 +1036,11 @@ function gr() {
|
|
|
1036
1036
|
}), e.textContent !== n && (xn(t.removed, { element: e.cloneNode() }), e.textContent = n)), qe(k.afterSanitizeElements, e, null), !1);
|
|
1037
1037
|
}, Ye = function(e, t, r) {
|
|
1038
1038
|
if (te[t] || de && (t === "id" || t === "name") && (r in n || r in Ie)) return !1;
|
|
1039
|
-
let i = B[t] ||
|
|
1040
|
-
if (!(
|
|
1039
|
+
let i = B[t] || W.attributeCheck instanceof Function && W.attributeCheck(t, e);
|
|
1040
|
+
if (!(re && !te[t] && In(ee, t)) && !(ne && In(N, t))) {
|
|
1041
1041
|
if (!i || te[t]) {
|
|
1042
1042
|
if (!(Ze(e) && (H.tagNameCheck instanceof RegExp && In(H.tagNameCheck, e) || H.tagNameCheck instanceof Function && H.tagNameCheck(e)) && (H.attributeNameCheck instanceof RegExp && In(H.attributeNameCheck, t) || H.attributeNameCheck instanceof Function && H.attributeNameCheck(t, e)) || t === "is" && H.allowCustomizedBuiltInElements && (H.tagNameCheck instanceof RegExp && In(H.tagNameCheck, r) || H.tagNameCheck instanceof Function && H.tagNameCheck(r)))) return !1;
|
|
1043
|
-
} else if (!xe[t] && !In(
|
|
1043
|
+
} else if (!xe[t] && !In(L, Dn(r, F, "")) && !((t === "src" || t === "xlink:href" || t === "href") && e !== "script" && On(r, "data:") === 0 && ye[e]) && !(ie && !In(P, Dn(r, F, ""))) && r) return !1;
|
|
1044
1044
|
}
|
|
1045
1045
|
return !0;
|
|
1046
1046
|
}, Xe = Z({}, [
|
|
@@ -1053,7 +1053,7 @@ function gr() {
|
|
|
1053
1053
|
"font-face-uri",
|
|
1054
1054
|
"missing-glyph"
|
|
1055
1055
|
]), Ze = function(e) {
|
|
1056
|
-
return !Xe[wn(e)] && In(
|
|
1056
|
+
return !Xe[wn(e)] && In(I, e);
|
|
1057
1057
|
}, Qe = function(e) {
|
|
1058
1058
|
qe(k.beforeSanitizeAttributes, e, null);
|
|
1059
1059
|
let n = e.attributes;
|
|
@@ -1067,7 +1067,7 @@ function gr() {
|
|
|
1067
1067
|
}, i = n.length;
|
|
1068
1068
|
for (; i--;) {
|
|
1069
1069
|
let a = n[i], o = a.name, s = a.namespaceURI, c = a.value, l = J(o), u = c, d = o === "value" ? u : kn(u);
|
|
1070
|
-
if (r.attrName = l, r.attrValue = d, r.keepAttr = !0, r.forceKeepAttr = void 0, qe(k.uponSanitizeAttribute, e, r), d = r.attrValue, fe && (l === "id" || l === "name") && On(d, pe) !== 0 && (He(o, e), d = pe + d),
|
|
1070
|
+
if (r.attrName = l, r.attrValue = d, r.keepAttr = !0, r.forceKeepAttr = void 0, qe(k.uponSanitizeAttribute, e, r), d = r.attrValue, fe && (l === "id" || l === "name") && On(d, pe) !== 0 && (He(o, e), d = pe + d), q && In(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, d)) {
|
|
1071
1071
|
He(o, e);
|
|
1072
1072
|
continue;
|
|
1073
1073
|
}
|
|
@@ -1080,11 +1080,11 @@ function gr() {
|
|
|
1080
1080
|
He(o, e);
|
|
1081
1081
|
continue;
|
|
1082
1082
|
}
|
|
1083
|
-
if (!
|
|
1083
|
+
if (!G && In(/\/>/i, d)) {
|
|
1084
1084
|
He(o, e);
|
|
1085
1085
|
continue;
|
|
1086
1086
|
}
|
|
1087
|
-
|
|
1087
|
+
K && vn([
|
|
1088
1088
|
A,
|
|
1089
1089
|
j,
|
|
1090
1090
|
M
|
|
@@ -1132,7 +1132,7 @@ function gr() {
|
|
|
1132
1132
|
let n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, i = null, o = null, c = null, l = null;
|
|
1133
1133
|
if (De = !e, De && (e = "<!-->"), typeof e != "string" && !Ke(e) && (e = Hn(e), typeof e != "string")) throw Ln("dirty is not a string, aborting");
|
|
1134
1134
|
if (!t.isSupported) return e;
|
|
1135
|
-
if (
|
|
1135
|
+
if (oe || Re(n), t.removed = [], typeof e == "string" && (he = !1), he) {
|
|
1136
1136
|
let t = e.nodeName;
|
|
1137
1137
|
if (typeof t == "string") {
|
|
1138
1138
|
let e = J(t);
|
|
@@ -1141,7 +1141,7 @@ function gr() {
|
|
|
1141
1141
|
et(e);
|
|
1142
1142
|
} else if (e instanceof s) i = Ue("<!---->"), o = i.ownerDocument.importNode(e, !0), o.nodeType === fr.element && o.nodeName === "BODY" || o.nodeName === "HTML" ? i = o : i.appendChild(o), et(o);
|
|
1143
1143
|
else {
|
|
1144
|
-
if (!ce && !
|
|
1144
|
+
if (!ce && !K && !ae && e.indexOf("<") === -1) return x && ue ? x.createHTML(e) : e;
|
|
1145
1145
|
if (i = Ue(e), !i) return ce ? null : ue ? S : "";
|
|
1146
1146
|
}
|
|
1147
1147
|
i && se && Y(i.firstChild);
|
|
@@ -1149,7 +1149,7 @@ function gr() {
|
|
|
1149
1149
|
for (; c = u.nextNode();) Je(c), Qe(c), c.content instanceof a && $e(c.content);
|
|
1150
1150
|
if (he) return e;
|
|
1151
1151
|
if (ce) {
|
|
1152
|
-
if (
|
|
1152
|
+
if (K) {
|
|
1153
1153
|
i.normalize();
|
|
1154
1154
|
let e = i.innerHTML;
|
|
1155
1155
|
vn([
|
|
@@ -1164,8 +1164,8 @@ function gr() {
|
|
|
1164
1164
|
else l = i;
|
|
1165
1165
|
return (B.shadowroot || B.shadowrootmode) && (l = O.call(r, l, !0)), l;
|
|
1166
1166
|
}
|
|
1167
|
-
let d =
|
|
1168
|
-
return
|
|
1167
|
+
let d = ae ? i.outerHTML : i.innerHTML;
|
|
1168
|
+
return ae && R["!doctype"] && i.ownerDocument && i.ownerDocument.doctype && i.ownerDocument.doctype.name && In(ur, i.ownerDocument.doctype.name) && (d = "<!DOCTYPE " + i.ownerDocument.doctype.name + ">\n" + d), K && vn([
|
|
1169
1169
|
A,
|
|
1170
1170
|
j,
|
|
1171
1171
|
M
|
|
@@ -1173,9 +1173,9 @@ function gr() {
|
|
|
1173
1173
|
d = Dn(d, e, " ");
|
|
1174
1174
|
}), x && ue ? x.createHTML(d) : d;
|
|
1175
1175
|
}, t.setConfig = function() {
|
|
1176
|
-
Re(arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}),
|
|
1176
|
+
Re(arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}), oe = !0;
|
|
1177
1177
|
}, t.clearConfig = function() {
|
|
1178
|
-
Fe = null,
|
|
1178
|
+
Fe = null, oe = !1;
|
|
1179
1179
|
}, t.isValidAttribute = function(e, t, n) {
|
|
1180
1180
|
return Fe || Re({}), Ye(J(e), J(t), n);
|
|
1181
1181
|
}, t.addHook = function(e, t) {
|
|
@@ -3826,12 +3826,12 @@ function Is(e) {
|
|
|
3826
3826
|
ALLOWED_TAGS: Os,
|
|
3827
3827
|
ALLOWED_ATTR: Ds,
|
|
3828
3828
|
ALLOW_DATA_ATTR: !1
|
|
3829
|
-
}).replace(
|
|
3829
|
+
}).replace(/^(<br\s*\/?>\s*)+|(<br\s*\/?>\s*)+$/gi, "").trim(), n);
|
|
3830
3830
|
}
|
|
3831
3831
|
function Ls(e, t) {
|
|
3832
3832
|
if (!e) return "";
|
|
3833
3833
|
let n = Ht(kt(e), t ?? {}).replace(/<br\s*\/?>/gi, "\n").replace(ks, (e) => e.startsWith("</") ? "\n" : "");
|
|
3834
|
-
return (new DOMParser().parseFromString(`<div>${n}</div>`, "text/html").body.textContent ?? "").replace(/\u00a0/g, " ").
|
|
3834
|
+
return (new DOMParser().parseFromString(`<div>${n}</div>`, "text/html").body.textContent ?? "").replace(/\u00a0/g, " ").trim();
|
|
3835
3835
|
}
|
|
3836
3836
|
function Rs(e, t) {
|
|
3837
3837
|
if (!e) return "";
|
|
@@ -3957,12 +3957,12 @@ function ic(e) {
|
|
|
3957
3957
|
function ac(e, t = !1, n = !0) {
|
|
3958
3958
|
if (!e) return "";
|
|
3959
3959
|
if (e.getDeletedAt?.() != null) return "(Message removed)";
|
|
3960
|
-
if (e instanceof
|
|
3961
|
-
if (e instanceof
|
|
3960
|
+
if (e instanceof q.TextMessage) return e.getText?.() ?? "";
|
|
3961
|
+
if (e instanceof q.MediaMessage) {
|
|
3962
3962
|
let r = n ? e.getAttachment?.()?.getName?.() ?? "" : "", i = e.getCaption?.()?.trim?.() ?? "", a = e.getType?.();
|
|
3963
3963
|
return a === "image" ? `${t ? "🖼️ " : ""}${i || "Photo"}` : a === "video" ? `${t ? "🎥 " : ""}${i || r || "Video"}` : a === "audio" ? `${t ? "🎤 " : ""}${r || "Audio message"}` : a === "file" ? `${t ? "📄 " : ""}${i || r || "File"}` : `${t ? "🖼️ " : ""}${i || r || "Media message"}`;
|
|
3964
3964
|
}
|
|
3965
|
-
if (e instanceof
|
|
3965
|
+
if (e instanceof q.Action) {
|
|
3966
3966
|
let t = (e.getActionFor?.()?.getMetadata?.() ?? e.getReceiver?.()?.getMetadata?.() ?? {}).systemDisplayName, n = (e.getActionBy?.())?.getName?.() ?? "", r = e.getMessage?.() ?? "";
|
|
3967
3967
|
return typeof t == "string" && t.trim() && n ? r.replace(n, t.trim()) : r;
|
|
3968
3968
|
}
|
|
@@ -4243,25 +4243,25 @@ function _c(e) {
|
|
|
4243
4243
|
var vc = null, yc = null;
|
|
4244
4244
|
function bc({ environment: e }) {
|
|
4245
4245
|
Ve(e);
|
|
4246
|
-
let t = w(!1), r = w(!1), i = w(!1), a = w(!1), o = w(!1), s = w(!1), c = w(!1), l = w(!1), u = w(!1), d = w(!1), f = w(!1), p = w(!1), m = w(typeof navigator < "u" ? !navigator.onLine : !1), h = w(!1), g = w(
|
|
4247
|
-
function
|
|
4246
|
+
let t = w(!1), r = w(!1), i = w(!1), a = w(!1), o = w(!1), s = w(!1), c = w(!1), l = w(!1), u = w(!1), d = w(!1), f = w(!1), p = w(!1), m = w(typeof navigator < "u" ? !navigator.onLine : !1), h = w(!1), g = w(!1), _ = w(null), v = w(null), y = w([]), b = w([]), x = w([]), S = w([]), C = w(!1), T = w(!1), E = w(null), D = w(null), O = w(null), k = w(null), A = w([]), j = w({}), M = n(() => A.value.length);
|
|
4247
|
+
function ee() {
|
|
4248
4248
|
return typeof navigator < "u" ? !navigator.onLine : !1;
|
|
4249
4249
|
}
|
|
4250
4250
|
function N() {
|
|
4251
|
-
let e =
|
|
4251
|
+
let e = ee();
|
|
4252
4252
|
if (e !== m.value) {
|
|
4253
4253
|
if (m.value = e, e) {
|
|
4254
|
-
p.value = !1,
|
|
4254
|
+
p.value = !1, ge();
|
|
4255
4255
|
return;
|
|
4256
4256
|
}
|
|
4257
|
-
ie = !0,
|
|
4257
|
+
ie = !0, G || be(!0);
|
|
4258
4258
|
}
|
|
4259
4259
|
}
|
|
4260
4260
|
function P(e) {
|
|
4261
4261
|
if (!e.length) return;
|
|
4262
|
-
let t = { ...
|
|
4262
|
+
let t = { ...j.value };
|
|
4263
4263
|
for (let n of e) n.uid && n.displayName.trim() && (t[n.uid] = n.displayName);
|
|
4264
|
-
|
|
4264
|
+
j.value = t;
|
|
4265
4265
|
}
|
|
4266
4266
|
function F(e) {
|
|
4267
4267
|
P(Object.entries(Bt(e)).map(([e, t]) => ({
|
|
@@ -4272,46 +4272,46 @@ function bc({ environment: e }) {
|
|
|
4272
4272
|
function I(e, t) {
|
|
4273
4273
|
return F(e), wc(e, t);
|
|
4274
4274
|
}
|
|
4275
|
-
let L = n(() =>
|
|
4276
|
-
async function
|
|
4275
|
+
let L = n(() => y.value.find((e) => e.id === E.value) ?? null), R = `bcc-ui-connection-${crypto.randomUUID()}`, z = `bcc-ui-message-${crypto.randomUUID()}`, B = !1, V = !1, H = null, U = null, te = null, W = null, ne = 0, re = 0, ie = !1, G = !1, K = null, ae = /* @__PURE__ */ new Map(), oe = /* @__PURE__ */ new Set(), se = null, ce = null, le = 0;
|
|
4276
|
+
async function ue() {
|
|
4277
4277
|
if (await xc(e), Jt(), t.value) {
|
|
4278
|
-
await
|
|
4278
|
+
await st();
|
|
4279
4279
|
return;
|
|
4280
4280
|
}
|
|
4281
|
-
|
|
4281
|
+
he(), lt(), t.value = !0, await st(), v.value && (ut(v.value.uid), pe(), Ce(), !m.value && !G && xe());
|
|
4282
4282
|
}
|
|
4283
|
-
async function
|
|
4284
|
-
|
|
4283
|
+
async function de(e) {
|
|
4284
|
+
_.value = null, r.value = !0;
|
|
4285
4285
|
try {
|
|
4286
|
-
await
|
|
4286
|
+
await ue();
|
|
4287
4287
|
let t = Ke();
|
|
4288
|
-
await
|
|
4288
|
+
await q.getLoggedinUser() && t !== e && await q.logout(), qe(e);
|
|
4289
4289
|
let n = await Sc(e);
|
|
4290
|
-
|
|
4290
|
+
v.value = Dc(await q.login(n)), ut(v.value.uid), g.value = !0, m.value = typeof navigator < "u" ? !navigator.onLine : !1, pe(), Ce(), G || await xe(), await De(), Gt();
|
|
4291
4291
|
} catch (e) {
|
|
4292
|
-
throw
|
|
4292
|
+
throw bt(), _.value = Vc(e, "Unable to sign in to chat."), e;
|
|
4293
4293
|
} finally {
|
|
4294
4294
|
r.value = !1;
|
|
4295
4295
|
}
|
|
4296
4296
|
}
|
|
4297
|
-
async function
|
|
4298
|
-
|
|
4297
|
+
async function fe() {
|
|
4298
|
+
_.value = null;
|
|
4299
4299
|
try {
|
|
4300
|
-
qe(null), Ze(), await
|
|
4300
|
+
qe(null), Ze(), await q.getLoggedinUser() && await q.logout();
|
|
4301
4301
|
} finally {
|
|
4302
|
-
|
|
4302
|
+
bt();
|
|
4303
4303
|
}
|
|
4304
4304
|
}
|
|
4305
|
-
function
|
|
4305
|
+
function pe() {
|
|
4306
4306
|
let e = ct();
|
|
4307
4307
|
if (!e) {
|
|
4308
|
-
|
|
4308
|
+
K = null, A.value = [];
|
|
4309
4309
|
return;
|
|
4310
4310
|
}
|
|
4311
4311
|
let t = `bcc-chat:${Y().appId}:${e}`;
|
|
4312
|
-
|
|
4312
|
+
me(t), K = new dc(t), A.value = K.getQueue();
|
|
4313
4313
|
}
|
|
4314
|
-
function
|
|
4314
|
+
function me(e) {
|
|
4315
4315
|
if (typeof window > "u") return;
|
|
4316
4316
|
let t = `bcc-chat:${Y().appId}:`, n = [];
|
|
4317
4317
|
for (let r = 0; r < window.localStorage.length; r += 1) {
|
|
@@ -4320,139 +4320,139 @@ function bc({ environment: e }) {
|
|
|
4320
4320
|
}
|
|
4321
4321
|
n.forEach((e) => window.localStorage.removeItem(e));
|
|
4322
4322
|
}
|
|
4323
|
-
function me() {
|
|
4324
|
-
B || typeof window > "u" || (window.addEventListener("online", N), window.addEventListener("offline", N), window.addEventListener("focus", N), document.addEventListener("visibilitychange", N), B = !0, N());
|
|
4325
|
-
}
|
|
4326
4323
|
function he() {
|
|
4327
|
-
V
|
|
4324
|
+
V || typeof window > "u" || (window.addEventListener("online", N), window.addEventListener("offline", N), window.addEventListener("focus", N), document.addEventListener("visibilitychange", N), V = !0, N());
|
|
4328
4325
|
}
|
|
4329
4326
|
function ge() {
|
|
4330
|
-
|
|
4327
|
+
H !== null && (clearTimeout(H), H = null);
|
|
4331
4328
|
}
|
|
4332
4329
|
function _e() {
|
|
4333
|
-
|
|
4330
|
+
ne = Date.now() + 1500;
|
|
4334
4331
|
}
|
|
4335
4332
|
function ve() {
|
|
4333
|
+
return Date.now() < ne;
|
|
4334
|
+
}
|
|
4335
|
+
function ye() {
|
|
4336
4336
|
return !!Ke();
|
|
4337
4337
|
}
|
|
4338
|
-
function
|
|
4339
|
-
if (
|
|
4338
|
+
function be(e = !1) {
|
|
4339
|
+
if (H !== null || U || m.value || G || !g.value && !ye()) return;
|
|
4340
4340
|
let t = e ? 0 : Math.min(3e4, 1e3 * 2 ** Math.min(re, 4));
|
|
4341
|
-
|
|
4342
|
-
|
|
4341
|
+
H = setTimeout(() => {
|
|
4342
|
+
H = null, xe();
|
|
4343
4343
|
}, t);
|
|
4344
4344
|
}
|
|
4345
|
-
async function
|
|
4346
|
-
if (N(), !(m.value ||
|
|
4347
|
-
|
|
4345
|
+
async function xe() {
|
|
4346
|
+
if (N(), !(m.value || G || !g.value && !ye())) return U || (U = (async () => {
|
|
4347
|
+
ge();
|
|
4348
4348
|
let e = !1;
|
|
4349
4349
|
try {
|
|
4350
|
-
let e = await
|
|
4350
|
+
let e = await q.getLoggedinUser();
|
|
4351
4351
|
if (!e) {
|
|
4352
4352
|
let t = Ke();
|
|
4353
4353
|
if (!t) return;
|
|
4354
4354
|
let n = await Sc(t);
|
|
4355
|
-
e = await
|
|
4355
|
+
e = await q.login(n);
|
|
4356
4356
|
}
|
|
4357
|
-
|
|
4358
|
-
let t =
|
|
4359
|
-
typeof t == "function" && (await t.call(
|
|
4357
|
+
v.value = Dc(e), g.value = !0, pe();
|
|
4358
|
+
let t = q.connect;
|
|
4359
|
+
typeof t == "function" && (await t.call(q), p.value = !0), re = 0, ie && await Se();
|
|
4360
4360
|
} catch (t) {
|
|
4361
|
-
p.value = !1, re += 1,
|
|
4361
|
+
p.value = !1, re += 1, Ft(t) || (_.value = Vc(t, "Unable to reconnect to chat.")), e = !0;
|
|
4362
4362
|
} finally {
|
|
4363
|
-
|
|
4363
|
+
U = null;
|
|
4364
4364
|
}
|
|
4365
|
-
e &&
|
|
4366
|
-
})(),
|
|
4365
|
+
e && be();
|
|
4366
|
+
})(), U);
|
|
4367
4367
|
}
|
|
4368
|
-
async function
|
|
4369
|
-
return
|
|
4370
|
-
ie = !1,
|
|
4368
|
+
async function Se() {
|
|
4369
|
+
return te || m.value || G || !g.value && !ye() || (te = (async () => {
|
|
4370
|
+
ie = !1, _.value = null;
|
|
4371
4371
|
try {
|
|
4372
|
-
await
|
|
4372
|
+
await De(), Gt();
|
|
4373
4373
|
} finally {
|
|
4374
|
-
|
|
4374
|
+
te = null;
|
|
4375
4375
|
}
|
|
4376
|
-
})()),
|
|
4377
|
-
}
|
|
4378
|
-
function Se() {
|
|
4379
|
-
if (!W || v.value.length > 0) return;
|
|
4380
|
-
let e = W.getConversations();
|
|
4381
|
-
e.length !== 0 && (v.value = Mc(e), !T.value && v.value.length > 0 && Ce(T.value));
|
|
4376
|
+
})()), te;
|
|
4382
4377
|
}
|
|
4383
|
-
function Ce(
|
|
4384
|
-
if (!
|
|
4385
|
-
let
|
|
4386
|
-
|
|
4378
|
+
function Ce() {
|
|
4379
|
+
if (!K || y.value.length > 0) return;
|
|
4380
|
+
let e = K.getConversations();
|
|
4381
|
+
e.length !== 0 && (y.value = Mc(e), !E.value && y.value.length > 0 && we(E.value));
|
|
4387
4382
|
}
|
|
4388
|
-
|
|
4389
|
-
|
|
4383
|
+
function we(e) {
|
|
4384
|
+
if (!K || !e) return b.value = [], !1;
|
|
4385
|
+
let t = K.getMessages(e).sort(Nc);
|
|
4386
|
+
return b.value = t, t.length > 0;
|
|
4390
4387
|
}
|
|
4391
4388
|
async function Te() {
|
|
4392
|
-
|
|
4393
|
-
let e = K.disconnect;
|
|
4394
|
-
typeof e == "function" && await e.call(K), p.value = !1;
|
|
4389
|
+
G = !1, ie = !0, await xe();
|
|
4395
4390
|
}
|
|
4396
4391
|
async function Ee() {
|
|
4397
|
-
|
|
4398
|
-
|
|
4392
|
+
G = !0, ie = !1, ge();
|
|
4393
|
+
let e = q.disconnect;
|
|
4394
|
+
typeof e == "function" && await e.call(q), p.value = !1;
|
|
4395
|
+
}
|
|
4396
|
+
async function De() {
|
|
4397
|
+
if (await ue(), N(), i.value = !0, _.value = null, m.value) {
|
|
4398
|
+
y.value = Mc(K?.getConversations() ?? []), L.value && await tt(), i.value = !1;
|
|
4399
4399
|
return;
|
|
4400
4400
|
}
|
|
4401
4401
|
try {
|
|
4402
|
-
let e = new
|
|
4402
|
+
let e = new q.ConversationsRequestBuilder().setLimit(50).withTags(!0).setConversationType(q.RECEIVER_TYPE.GROUP).build(), t = [], n = [];
|
|
4403
4403
|
do
|
|
4404
|
-
n = await e.fetchNext(), t.push(...n.map((e) => Cc(e,
|
|
4404
|
+
n = await e.fetchNext(), t.push(...n.map((e) => Cc(e, v.value?.uid)));
|
|
4405
4405
|
while (n.length === 50);
|
|
4406
|
-
let r = new Map(
|
|
4406
|
+
let r = new Map(y.value.map((e) => [e.id, e]));
|
|
4407
4407
|
for (let e of t) {
|
|
4408
4408
|
let t = r.get(e.id);
|
|
4409
4409
|
t && (e.subtitle === "No messages yet" && t.subtitle && t.subtitle !== "No messages yet" && (e.subtitle = t.subtitle), !e.lastMessageAt && t.lastMessageAt && (e.lastMessageAt = t.lastMessageAt), !e.lastMessage && t.lastMessage && (e.lastMessage = t.lastMessage));
|
|
4410
4410
|
}
|
|
4411
|
-
|
|
4411
|
+
y.value = Mc(await ft(t)), K?.setConversations(y.value), L.value && await tt();
|
|
4412
4412
|
} catch (e) {
|
|
4413
|
-
let t =
|
|
4413
|
+
let t = K?.getConversations() ?? [];
|
|
4414
4414
|
if (t.length > 0) {
|
|
4415
|
-
|
|
4415
|
+
y.value = Mc(t);
|
|
4416
4416
|
return;
|
|
4417
4417
|
}
|
|
4418
|
-
throw
|
|
4418
|
+
throw _.value = Vc(e, "Unable to load conversations."), e;
|
|
4419
4419
|
} finally {
|
|
4420
4420
|
i.value = !1;
|
|
4421
4421
|
}
|
|
4422
4422
|
}
|
|
4423
|
-
async function
|
|
4424
|
-
|
|
4425
|
-
}
|
|
4426
|
-
function Oe(e) {
|
|
4427
|
-
e && (O.value = null), D.value = e;
|
|
4423
|
+
async function Oe(e) {
|
|
4424
|
+
E.value = e, D.value = null, x.value = [], ce = null, T.value = !1, O.value = null, k.value = null, we(e), await tt();
|
|
4428
4425
|
}
|
|
4429
4426
|
function ke(e) {
|
|
4430
|
-
e && (
|
|
4427
|
+
e && (k.value = null), O.value = e;
|
|
4431
4428
|
}
|
|
4432
|
-
|
|
4433
|
-
|
|
4429
|
+
function Ae(e) {
|
|
4430
|
+
e && (O.value = null), k.value = e;
|
|
4434
4431
|
}
|
|
4435
|
-
function je() {
|
|
4436
|
-
|
|
4432
|
+
async function je(e) {
|
|
4433
|
+
D.value = e, ce = null, T.value = !1, O.value = null, k.value = null, await rt(e.id);
|
|
4437
4434
|
}
|
|
4438
|
-
|
|
4435
|
+
function Me() {
|
|
4436
|
+
D.value = null, x.value = [], ce = null, T.value = !1, O.value = null, k.value = null;
|
|
4437
|
+
}
|
|
4438
|
+
async function Ne(e, t) {
|
|
4439
4439
|
if (u.value) return;
|
|
4440
4440
|
let n = L.value;
|
|
4441
4441
|
if (!n) return;
|
|
4442
4442
|
let r = $s(e);
|
|
4443
4443
|
if (!ec(r)) return;
|
|
4444
|
-
if (
|
|
4445
|
-
await
|
|
4444
|
+
if (k.value) {
|
|
4445
|
+
await Pe(k.value, r);
|
|
4446
4446
|
return;
|
|
4447
4447
|
}
|
|
4448
|
-
let i =
|
|
4449
|
-
u.value = !0,
|
|
4448
|
+
let i = D.value?.id, a = crypto.randomUUID(), o = zc(Nt(O.value, t), a);
|
|
4449
|
+
u.value = !0, _.value = null;
|
|
4450
4450
|
try {
|
|
4451
4451
|
if (m.value) {
|
|
4452
|
-
|
|
4452
|
+
It(n, r, o, i, a), O.value = null;
|
|
4453
4453
|
return;
|
|
4454
4454
|
}
|
|
4455
|
-
|
|
4455
|
+
Ht(Mt({
|
|
4456
4456
|
conversation: n,
|
|
4457
4457
|
kind: "text",
|
|
4458
4458
|
text: r,
|
|
@@ -4461,50 +4461,50 @@ function bc({ environment: e }) {
|
|
|
4461
4461
|
muid: a,
|
|
4462
4462
|
deliveryState: "sending"
|
|
4463
4463
|
}));
|
|
4464
|
-
let e = new
|
|
4464
|
+
let e = new q.TextMessage(n.targetId, r, Uc(n));
|
|
4465
4465
|
e.setMuid?.(a), Object.keys(o).length > 0 && e.setMetadata?.(o), i && e.setParentMessageId?.(Number(i));
|
|
4466
|
-
let t = await
|
|
4467
|
-
|
|
4466
|
+
let t = await q.sendMessage(e);
|
|
4467
|
+
St(I(t, v.value?.uid)), mt(t), await X(t), O.value = null;
|
|
4468
4468
|
} catch (e) {
|
|
4469
|
-
if (
|
|
4470
|
-
|
|
4469
|
+
if (Ft(e)) {
|
|
4470
|
+
Ut("queued", a), It(n, r, o, D.value?.id, a), O.value = null;
|
|
4471
4471
|
return;
|
|
4472
4472
|
}
|
|
4473
|
-
throw
|
|
4473
|
+
throw Ut("failed", a), _.value = Vc(e, "Unable to send the message."), e;
|
|
4474
4474
|
} finally {
|
|
4475
4475
|
u.value = !1;
|
|
4476
4476
|
}
|
|
4477
4477
|
}
|
|
4478
|
-
async function
|
|
4478
|
+
async function Pe(e, t) {
|
|
4479
4479
|
let n = L.value;
|
|
4480
4480
|
if (!n || m.value) return;
|
|
4481
4481
|
let r = $s(t);
|
|
4482
4482
|
if (ec(r)) {
|
|
4483
|
-
u.value = !0,
|
|
4483
|
+
u.value = !0, _.value = null;
|
|
4484
4484
|
try {
|
|
4485
4485
|
let t;
|
|
4486
|
-
e.kind === "text" ? t = new
|
|
4487
|
-
let i = await
|
|
4488
|
-
|
|
4486
|
+
e.kind === "text" ? t = new q.TextMessage(n.targetId, r, Uc(n)) : (t = new q.MediaMessage(n.targetId, e.source?.getAttachment?.()?.getFileUrl?.() ?? e.source?.getAttachment?.()?.getUrl?.() ?? e.attachments[0]?.url ?? "", e.source?.getType?.() ?? e.type ?? e.kind, Uc(n)), t.setCaption(r)), t.setId(Number(e.id));
|
|
4487
|
+
let i = await q.editMessage(t);
|
|
4488
|
+
St(I(i, v.value?.uid)), mt(i), k.value = null;
|
|
4489
4489
|
} catch (e) {
|
|
4490
|
-
throw
|
|
4490
|
+
throw _.value = Vc(e, "Unable to edit the message."), e;
|
|
4491
4491
|
} finally {
|
|
4492
4492
|
u.value = !1;
|
|
4493
4493
|
}
|
|
4494
4494
|
}
|
|
4495
4495
|
}
|
|
4496
|
-
async function
|
|
4496
|
+
async function J(e, t) {
|
|
4497
4497
|
if (u.value) return;
|
|
4498
4498
|
let n = L.value;
|
|
4499
4499
|
if (!n) return;
|
|
4500
|
-
let r =
|
|
4501
|
-
u.value = !0,
|
|
4500
|
+
let r = D.value?.id, i = crypto.randomUUID(), a = zc(Nt(O.value, t), i), o = qc(e.file);
|
|
4501
|
+
u.value = !0, _.value = null;
|
|
4502
4502
|
try {
|
|
4503
4503
|
if (m.value) {
|
|
4504
|
-
await
|
|
4504
|
+
await zt(n, e, a, r, i), O.value = null;
|
|
4505
4505
|
return;
|
|
4506
4506
|
}
|
|
4507
|
-
|
|
4507
|
+
Ht(Mt({
|
|
4508
4508
|
conversation: n,
|
|
4509
4509
|
kind: o,
|
|
4510
4510
|
text: e.caption?.trim() ?? "",
|
|
@@ -4519,37 +4519,37 @@ function bc({ environment: e }) {
|
|
|
4519
4519
|
muid: i,
|
|
4520
4520
|
deliveryState: "sending"
|
|
4521
4521
|
}));
|
|
4522
|
-
let t = new
|
|
4522
|
+
let t = new q.MediaMessage(n.targetId, e.file, o, Uc(n));
|
|
4523
4523
|
t.setMuid?.(i), Object.keys(a).length > 0 && t.setMetadata?.(a), r && t.setParentMessageId?.(Number(r)), e.caption?.trim() && t.setCaption?.(e.caption.trim());
|
|
4524
|
-
let s = await
|
|
4525
|
-
|
|
4524
|
+
let s = await q.sendMediaMessage(t);
|
|
4525
|
+
St(I(s, v.value?.uid)), mt(s), await X(s), O.value = null;
|
|
4526
4526
|
} catch (t) {
|
|
4527
|
-
if (
|
|
4528
|
-
|
|
4527
|
+
if (Ft(t)) {
|
|
4528
|
+
Ut("queued", i), await zt(n, e, a, r, i), O.value = null;
|
|
4529
4529
|
return;
|
|
4530
4530
|
}
|
|
4531
|
-
throw
|
|
4531
|
+
throw Ut("failed", i), _.value = Vc(t, "Unable to send the attachment."), t;
|
|
4532
4532
|
} finally {
|
|
4533
4533
|
u.value = !1;
|
|
4534
4534
|
}
|
|
4535
4535
|
}
|
|
4536
|
-
async function
|
|
4536
|
+
async function Fe(e, t) {
|
|
4537
4537
|
if (u.value) return;
|
|
4538
4538
|
let n = L.value;
|
|
4539
4539
|
if (!n) return;
|
|
4540
4540
|
let r = e.question.trim(), i = e.options.map((e) => e.trim()).filter(Boolean);
|
|
4541
4541
|
if (!r || i.length < 2) return;
|
|
4542
|
-
let a =
|
|
4543
|
-
u.value = !0,
|
|
4542
|
+
let a = D.value?.id, o = crypto.randomUUID(), s = zc(Nt(O.value, t), o);
|
|
4543
|
+
u.value = !0, _.value = null;
|
|
4544
4544
|
try {
|
|
4545
4545
|
if (m.value) {
|
|
4546
|
-
|
|
4546
|
+
Lt(n, {
|
|
4547
4547
|
question: r,
|
|
4548
4548
|
options: i
|
|
4549
|
-
}, s, a, o),
|
|
4549
|
+
}, s, a, o), O.value = null;
|
|
4550
4550
|
return;
|
|
4551
4551
|
}
|
|
4552
|
-
|
|
4552
|
+
Ht(Mt({
|
|
4553
4553
|
conversation: n,
|
|
4554
4554
|
kind: "poll",
|
|
4555
4555
|
text: `Poll: ${r}`,
|
|
@@ -4566,41 +4566,41 @@ function bc({ environment: e }) {
|
|
|
4566
4566
|
question: r,
|
|
4567
4567
|
options: i,
|
|
4568
4568
|
receiver: n.targetId,
|
|
4569
|
-
receiverType: n.type === "group" ?
|
|
4569
|
+
receiverType: n.type === "group" ? q.RECEIVER_TYPE.GROUP : q.RECEIVER_TYPE.USER
|
|
4570
4570
|
};
|
|
4571
4571
|
a && (e.parentMessageId = Number(a)), Object.keys(s).length > 0 && (e.metadata = s);
|
|
4572
|
-
let t = await
|
|
4573
|
-
c ? (
|
|
4572
|
+
let t = await q.callExtension("polls", "POST", "v2/create", e), c = t?.message ?? t?.custom_message ?? t?.data?.message ?? null;
|
|
4573
|
+
c ? (Wt(o), St(I(c, v.value?.uid)), mt(c), await X(c)) : (Wt(o), await xt()), O.value = null;
|
|
4574
4574
|
} catch (e) {
|
|
4575
|
-
if (
|
|
4576
|
-
|
|
4575
|
+
if (Ft(e)) {
|
|
4576
|
+
Ut("queued", o), Lt(n, {
|
|
4577
4577
|
question: r,
|
|
4578
4578
|
options: i
|
|
4579
|
-
}, s, a, o),
|
|
4579
|
+
}, s, a, o), O.value = null;
|
|
4580
4580
|
return;
|
|
4581
4581
|
}
|
|
4582
|
-
throw
|
|
4582
|
+
throw Ut("failed", o), _.value = Vc(e, "Unable to send the poll."), e;
|
|
4583
4583
|
} finally {
|
|
4584
4584
|
u.value = !1;
|
|
4585
4585
|
}
|
|
4586
4586
|
}
|
|
4587
|
-
async function
|
|
4588
|
-
let n = e.poll?.id ?? e.id, r =
|
|
4587
|
+
async function Ie(e, t) {
|
|
4588
|
+
let n = e.poll?.id ?? e.id, r = v.value?.uid;
|
|
4589
4589
|
if (!n || !t || m.value) return;
|
|
4590
|
-
let i =
|
|
4590
|
+
let i = wt(e.id, e.parentMessageId) ?? e;
|
|
4591
4591
|
if (i.poll && !i.poll.options.some((e) => e.id === t && e.voters.includes(r ?? ""))) {
|
|
4592
|
-
|
|
4592
|
+
_.value = null, r && St(Le(i, t, r));
|
|
4593
4593
|
try {
|
|
4594
|
-
await
|
|
4594
|
+
await q.callExtension("polls", "POST", "v2/vote", {
|
|
4595
4595
|
id: n,
|
|
4596
4596
|
vote: t
|
|
4597
4597
|
});
|
|
4598
4598
|
} catch (e) {
|
|
4599
|
-
throw
|
|
4599
|
+
throw St(i), _.value = Vc(e, "Unable to cast the vote."), e;
|
|
4600
4600
|
}
|
|
4601
4601
|
}
|
|
4602
4602
|
}
|
|
4603
|
-
function
|
|
4603
|
+
function Le(e, t, n) {
|
|
4604
4604
|
if (!e.poll) return e;
|
|
4605
4605
|
let r = e.poll, i = r.allowsMultipleAnswers, a = r.options.filter((e) => e.voters.includes(n)).map((e) => e.id), o = !i && a.length > 0, s = r.options.map((e) => o && e.voters.includes(n) && e.id !== t ? {
|
|
4606
4606
|
...e,
|
|
@@ -4620,105 +4620,105 @@ function bc({ environment: e }) {
|
|
|
4620
4620
|
}
|
|
4621
4621
|
};
|
|
4622
4622
|
}
|
|
4623
|
-
async function
|
|
4624
|
-
|
|
4625
|
-
let n =
|
|
4626
|
-
|
|
4623
|
+
async function Re(e, t) {
|
|
4624
|
+
_.value = null;
|
|
4625
|
+
let n = wt(e.id, e.parentMessageId) ?? e, r = n.reactions.find((e) => e.emoji === t && e.reactedByMe);
|
|
4626
|
+
St(Tt(n, t));
|
|
4627
4627
|
try {
|
|
4628
|
-
|
|
4628
|
+
St(I(r ? await q.removeReaction(Number(e.id), t) : await q.addReaction(Number(e.id), t), v.value?.uid));
|
|
4629
4629
|
} catch (e) {
|
|
4630
|
-
throw
|
|
4630
|
+
throw St(n), _.value = Vc(e, "Unable to update the reaction."), e;
|
|
4631
4631
|
}
|
|
4632
4632
|
}
|
|
4633
|
-
async function
|
|
4634
|
-
if (
|
|
4635
|
-
|
|
4633
|
+
async function ze(e) {
|
|
4634
|
+
if (_.value = null, e.deliveryState === "queued" || e.deliveryState === "failed") {
|
|
4635
|
+
Ot(e);
|
|
4636
4636
|
return;
|
|
4637
4637
|
}
|
|
4638
4638
|
if (!m.value) try {
|
|
4639
|
-
let t = I(await
|
|
4640
|
-
|
|
4639
|
+
let t = I(await q.deleteMessage(String(e.id)), v.value?.uid);
|
|
4640
|
+
Ot(t), kt(t);
|
|
4641
4641
|
} catch (e) {
|
|
4642
|
-
throw
|
|
4642
|
+
throw _.value = Vc(e, "Unable to delete the message."), e;
|
|
4643
4643
|
}
|
|
4644
4644
|
}
|
|
4645
|
-
async function
|
|
4645
|
+
async function Be(e) {
|
|
4646
4646
|
let t = e.source?.getText?.() ?? e.text;
|
|
4647
4647
|
if (ec(t)) {
|
|
4648
|
-
|
|
4648
|
+
_.value = null;
|
|
4649
4649
|
try {
|
|
4650
|
-
let n = (await
|
|
4650
|
+
let n = (await q.callExtension("message-translation", "POST", "v2/translate", {
|
|
4651
4651
|
msgId: Number(e.id),
|
|
4652
4652
|
text: t,
|
|
4653
4653
|
languages: typeof navigator < "u" ? navigator.languages : ["en"]
|
|
4654
4654
|
})).translations?.[0]?.message_translated?.trim();
|
|
4655
4655
|
if (!n) return;
|
|
4656
|
-
|
|
4656
|
+
Ct({
|
|
4657
4657
|
...e,
|
|
4658
4658
|
translatedText: n,
|
|
4659
4659
|
metadata: {
|
|
4660
4660
|
...e.metadata ?? {},
|
|
4661
4661
|
translated_message: n
|
|
4662
4662
|
}
|
|
4663
|
-
}),
|
|
4663
|
+
}), Dt();
|
|
4664
4664
|
} catch (e) {
|
|
4665
|
-
throw
|
|
4665
|
+
throw _.value = Vc(e, "Unable to translate the message."), e;
|
|
4666
4666
|
}
|
|
4667
4667
|
}
|
|
4668
4668
|
}
|
|
4669
|
-
async function
|
|
4670
|
-
let t = e ?? L.value?.targetId, n =
|
|
4669
|
+
async function He(e) {
|
|
4670
|
+
let t = e ?? L.value?.targetId, n = v.value?.uid, r = ++le;
|
|
4671
4671
|
if (!t || !n) {
|
|
4672
|
-
r ===
|
|
4672
|
+
r === le && (S.value = []);
|
|
4673
4673
|
return;
|
|
4674
4674
|
}
|
|
4675
4675
|
if (!m.value) {
|
|
4676
|
-
l.value = !0,
|
|
4676
|
+
l.value = !0, _.value = null;
|
|
4677
4677
|
try {
|
|
4678
|
-
let e = new
|
|
4678
|
+
let e = new q.MessagesRequestBuilder().setLimit(50).setGUID(n).withTags(!0).setTags([t]).build(), i = [], a = [];
|
|
4679
4679
|
do
|
|
4680
|
-
a = await e.fetchPrevious(), i.push(...a.map((e) => I(e,
|
|
4680
|
+
a = await e.fetchPrevious(), i.push(...a.map((e) => I(e, v.value?.uid)));
|
|
4681
4681
|
while (a.length === 50);
|
|
4682
4682
|
let o = i.filter((e) => !(e.isDeleted || !e.scheduled?.scheduleDate || t && e.scheduled.originalChatUid && e.scheduled.originalChatUid !== t)).sort((e, t) => (e.scheduled?.scheduleDate?.getTime() ?? e.sentAt.getTime()) - (t.scheduled?.scheduleDate?.getTime() ?? t.sentAt.getTime()));
|
|
4683
|
-
if (r !==
|
|
4684
|
-
|
|
4683
|
+
if (r !== le) return;
|
|
4684
|
+
S.value = o;
|
|
4685
4685
|
} catch (e) {
|
|
4686
|
-
if (r !==
|
|
4686
|
+
if (r !== le) return;
|
|
4687
4687
|
if (Hc(e)) {
|
|
4688
|
-
|
|
4688
|
+
S.value = [];
|
|
4689
4689
|
return;
|
|
4690
4690
|
}
|
|
4691
|
-
throw
|
|
4691
|
+
throw _.value = Vc(e, _t("loadScheduledMessagesError")), e;
|
|
4692
4692
|
} finally {
|
|
4693
|
-
r ===
|
|
4693
|
+
r === le && (l.value = !1);
|
|
4694
4694
|
}
|
|
4695
4695
|
}
|
|
4696
4696
|
}
|
|
4697
|
-
async function
|
|
4697
|
+
async function Ue(e, t) {
|
|
4698
4698
|
let n = L.value;
|
|
4699
4699
|
if (n) {
|
|
4700
|
-
d.value = !0,
|
|
4700
|
+
d.value = !0, _.value = null;
|
|
4701
4701
|
try {
|
|
4702
|
-
e.file ? await Kc(n, e, t) : await Gc(n, e, t), await
|
|
4702
|
+
e.file ? await Kc(n, e, t) : await Gc(n, e, t), await He(n.targetId);
|
|
4703
4703
|
} catch (e) {
|
|
4704
|
-
throw
|
|
4704
|
+
throw _.value = Vc(e, "Unable to schedule the message."), e;
|
|
4705
4705
|
} finally {
|
|
4706
4706
|
d.value = !1;
|
|
4707
4707
|
}
|
|
4708
4708
|
}
|
|
4709
4709
|
}
|
|
4710
|
-
async function
|
|
4711
|
-
if (
|
|
4710
|
+
async function We(e) {
|
|
4711
|
+
if (_.value = null, !e.scheduled) return;
|
|
4712
4712
|
let t = e.scheduled.originalChatUid;
|
|
4713
4713
|
try {
|
|
4714
|
-
await
|
|
4714
|
+
await q.deleteMessage(String(e.id)), S.value = S.value.filter((t) => t.id !== e.id), await He(t);
|
|
4715
4715
|
} catch (e) {
|
|
4716
|
-
throw
|
|
4716
|
+
throw _.value = Vc(e, "Unable to remove the scheduled message."), e;
|
|
4717
4717
|
}
|
|
4718
4718
|
}
|
|
4719
|
-
async function
|
|
4720
|
-
|
|
4721
|
-
let n =
|
|
4719
|
+
async function Ge(e, t) {
|
|
4720
|
+
_.value = null;
|
|
4721
|
+
let n = v.value?.uid;
|
|
4722
4722
|
if (!n || !e.scheduled?.muid || e.kind === "poll") return;
|
|
4723
4723
|
let r = Qs(t);
|
|
4724
4724
|
if (e.kind === "text" && !ec(r)) return;
|
|
@@ -4726,20 +4726,20 @@ function bc({ environment: e }) {
|
|
|
4726
4726
|
!i.scheduleDate && e.scheduled?.scheduleDate && (i.scheduleDate = e.scheduled.scheduleDate.toISOString()), !i.originalChatUid && e.scheduled?.originalChatUid && (i.originalChatUid = e.scheduled.originalChatUid), d.value = !0;
|
|
4727
4727
|
try {
|
|
4728
4728
|
let t;
|
|
4729
|
-
if (e.kind === "text") t = new
|
|
4729
|
+
if (e.kind === "text") t = new q.TextMessage(n, r, q.RECEIVER_TYPE.GROUP);
|
|
4730
4730
|
else {
|
|
4731
4731
|
let i = e.source?.getAttachment?.()?.getFileUrl?.() ?? e.source?.getAttachment?.()?.getUrl?.() ?? e.attachments[0]?.url ?? "";
|
|
4732
|
-
t = new
|
|
4732
|
+
t = new q.MediaMessage(n, i, e.source?.getType?.() ?? e.type ?? e.kind, q.RECEIVER_TYPE.GROUP), t.setCaption(r);
|
|
4733
4733
|
}
|
|
4734
|
-
Object.keys(i).length > 0 && t.setMetadata(i), t.setId(Number(e.id)), await
|
|
4734
|
+
Object.keys(i).length > 0 && t.setMetadata(i), t.setId(Number(e.id)), await q.editMessage(t), await He(e.scheduled.originalChatUid);
|
|
4735
4735
|
} catch (e) {
|
|
4736
|
-
throw
|
|
4736
|
+
throw _.value = Vc(e, "Unable to edit the scheduled message."), e;
|
|
4737
4737
|
} finally {
|
|
4738
4738
|
d.value = !1;
|
|
4739
4739
|
}
|
|
4740
4740
|
}
|
|
4741
|
-
async function
|
|
4742
|
-
d.value = !0,
|
|
4741
|
+
async function Je(e) {
|
|
4742
|
+
d.value = !0, _.value = null;
|
|
4743
4743
|
try {
|
|
4744
4744
|
let t = Wc(), n = await fetch(`${Y().chatApiBaseUrl}/chats/rescheduleMessage`, {
|
|
4745
4745
|
method: "POST",
|
|
@@ -4755,21 +4755,21 @@ function bc({ environment: e }) {
|
|
|
4755
4755
|
})
|
|
4756
4756
|
});
|
|
4757
4757
|
if (!n.ok) throw Error(`Reschedule failed with status ${n.status}.`);
|
|
4758
|
-
await
|
|
4758
|
+
await He(e.originalChatUid);
|
|
4759
4759
|
} catch (e) {
|
|
4760
|
-
throw
|
|
4760
|
+
throw _.value = Vc(e, "Unable to reschedule the message."), e;
|
|
4761
4761
|
} finally {
|
|
4762
4762
|
d.value = !1;
|
|
4763
4763
|
}
|
|
4764
4764
|
}
|
|
4765
|
-
function Je(e) {
|
|
4766
|
-
let t = new K.MessagesRequestBuilder().setLimit(50).hideReplies(!0).hideDeletedMessages(!0);
|
|
4767
|
-
return e.type === "group" ? t.setGUID(e.targetId) : t.setUID(e.targetId), t.build();
|
|
4768
|
-
}
|
|
4769
4765
|
function Ye(e) {
|
|
4770
|
-
|
|
4766
|
+
let t = new q.MessagesRequestBuilder().setLimit(50).hideReplies(!0).hideDeletedMessages(!0);
|
|
4767
|
+
return h.value && t.setCategories([q.CATEGORY_MESSAGE, q.CATEGORY_CALL]), e.type === "group" ? t.setGUID(e.targetId) : t.setUID(e.targetId), t.build();
|
|
4768
|
+
}
|
|
4769
|
+
function Xe(e) {
|
|
4770
|
+
return new q.MessagesRequestBuilder().setLimit(50).setParentMessageId(Number(e)).hideDeletedMessages(!0).build();
|
|
4771
4771
|
}
|
|
4772
|
-
async function
|
|
4772
|
+
async function Qe(e) {
|
|
4773
4773
|
if (!e.isOwn || e.receipts.readAt) return e;
|
|
4774
4774
|
let t = `bcc-chat:${Y().appId}:message_${e.id}_receiptStatus`;
|
|
4775
4775
|
try {
|
|
@@ -4779,7 +4779,7 @@ function bc({ environment: e }) {
|
|
|
4779
4779
|
if (!Number.isNaN(r.getTime()) && !Number.isNaN(i.getTime())) return e.receipts.readAt = r, e.receipts.deliveredAt = i, e;
|
|
4780
4780
|
}
|
|
4781
4781
|
} catch {}
|
|
4782
|
-
let n = await
|
|
4782
|
+
let n = await yt(e);
|
|
4783
4783
|
for (let t of n) t.kind === "read" && t.timestamp && (!e.receipts.readAt || t.timestamp > e.receipts.readAt) && (e.receipts.readAt = t.timestamp), t.kind === "delivered" && t.timestamp && (!e.receipts.deliveredAt || t.timestamp > e.receipts.deliveredAt) && (e.receipts.deliveredAt = t.timestamp);
|
|
4784
4784
|
if (e.receipts.readAt) try {
|
|
4785
4785
|
localStorage.setItem(t, JSON.stringify({
|
|
@@ -4789,7 +4789,7 @@ function bc({ environment: e }) {
|
|
|
4789
4789
|
} catch {}
|
|
4790
4790
|
return e;
|
|
4791
4791
|
}
|
|
4792
|
-
async function
|
|
4792
|
+
async function $e(e) {
|
|
4793
4793
|
try {
|
|
4794
4794
|
return await e.fetchPrevious();
|
|
4795
4795
|
} catch (e) {
|
|
@@ -4797,209 +4797,209 @@ function bc({ environment: e }) {
|
|
|
4797
4797
|
throw e;
|
|
4798
4798
|
}
|
|
4799
4799
|
}
|
|
4800
|
-
async function
|
|
4800
|
+
async function et(e) {
|
|
4801
4801
|
let t = L.value;
|
|
4802
|
-
if (!t || m.value) return
|
|
4803
|
-
if ((e?.reset ||
|
|
4802
|
+
if (!t || m.value) return b.value = [], C.value = !1, !1;
|
|
4803
|
+
if ((e?.reset || se?.conversationId !== t.id) && (se = {
|
|
4804
4804
|
conversationId: t.id,
|
|
4805
|
-
request:
|
|
4806
|
-
},
|
|
4807
|
-
let n = await
|
|
4808
|
-
e?.reset && n.length === 0 && !m.value && !
|
|
4805
|
+
request: Ye(t)
|
|
4806
|
+
}, C.value = !0), !se) return console.warn("No active messages request available for the conversation:", t.id), !1;
|
|
4807
|
+
let n = await $e(se.request);
|
|
4808
|
+
e?.reset && n.length === 0 && !m.value && !G && t.lastMessageAt && (ie = !0, await xe(), se = {
|
|
4809
4809
|
conversationId: t.id,
|
|
4810
|
-
request:
|
|
4811
|
-
}, n = await
|
|
4812
|
-
let r = await Promise.all(n.map((e) => I(e,
|
|
4813
|
-
|
|
4810
|
+
request: Ye(t)
|
|
4811
|
+
}, n = await $e(se.request));
|
|
4812
|
+
let r = await Promise.all(n.map((e) => I(e, v.value?.uid)).filter(Lc).sort(Nc).map(Qe));
|
|
4813
|
+
b.value = e?.reset ? Fc(b.value.filter((e) => e.conversationId === t.id && Ic(e)), r) : Fc(b.value, r), C.value = n.length === 50, K?.setMessages(t.id, b.value);
|
|
4814
4814
|
let i = n[n.length - 1];
|
|
4815
|
-
return i && (await
|
|
4815
|
+
return i && (await vt(i), await X(i)), n.length > 0;
|
|
4816
4816
|
}
|
|
4817
|
-
async function
|
|
4817
|
+
async function tt() {
|
|
4818
4818
|
N();
|
|
4819
4819
|
let e = L.value;
|
|
4820
4820
|
if (!e) {
|
|
4821
|
-
console.warn("No active conversation to refresh messages for."),
|
|
4821
|
+
console.warn("No active conversation to refresh messages for."), b.value = [], C.value = !1, se = null;
|
|
4822
4822
|
return;
|
|
4823
4823
|
}
|
|
4824
|
-
let t =
|
|
4824
|
+
let t = we(e.id);
|
|
4825
4825
|
if (a.value = !0, m.value) {
|
|
4826
|
-
|
|
4826
|
+
C.value = !1, se = null, a.value = !1;
|
|
4827
4827
|
return;
|
|
4828
4828
|
}
|
|
4829
4829
|
try {
|
|
4830
|
-
await
|
|
4830
|
+
await et({ reset: !0 }), y.value = y.value.map((t) => t.id === e.id ? {
|
|
4831
4831
|
...t,
|
|
4832
|
-
lastMessage:
|
|
4832
|
+
lastMessage: b.value.at(-1) ?? null,
|
|
4833
4833
|
unreadCount: 0
|
|
4834
|
-
} : t),
|
|
4834
|
+
} : t), K?.setConversations(y.value);
|
|
4835
4835
|
} catch (n) {
|
|
4836
|
-
let r =
|
|
4836
|
+
let r = K?.getMessages(e.id) ?? [];
|
|
4837
4837
|
if (r.length > 0) {
|
|
4838
|
-
t || (
|
|
4838
|
+
t || (b.value = r.sort(Nc));
|
|
4839
4839
|
return;
|
|
4840
4840
|
}
|
|
4841
|
-
throw
|
|
4841
|
+
throw _.value = Vc(n, "Unable to load messages."), n;
|
|
4842
4842
|
} finally {
|
|
4843
4843
|
a.value = !1;
|
|
4844
4844
|
}
|
|
4845
4845
|
}
|
|
4846
|
-
async function
|
|
4847
|
-
let t =
|
|
4848
|
-
if (!t) return
|
|
4849
|
-
if ((e?.reset ||
|
|
4846
|
+
async function nt(e) {
|
|
4847
|
+
let t = D.value?.id;
|
|
4848
|
+
if (!t) return x.value = [], T.value = !1, !1;
|
|
4849
|
+
if ((e?.reset || ce?.parentMessageId !== t) && (ce = {
|
|
4850
4850
|
parentMessageId: t,
|
|
4851
|
-
request:
|
|
4852
|
-
},
|
|
4853
|
-
let n = await
|
|
4854
|
-
|
|
4851
|
+
request: Xe(t)
|
|
4852
|
+
}, T.value = !0), !ce) return !1;
|
|
4853
|
+
let n = await ce.request.fetchPrevious(), r = await Promise.all(n.map((e) => I(e, v.value?.uid)).filter(Lc).sort(Nc).map(Qe));
|
|
4854
|
+
x.value = e?.reset ? Fc(x.value.filter((e) => e.parentMessageId === t && Ic(e)), r) : Fc(x.value, r), T.value = n.length === 50, K?.setThreadMessages(t, x.value);
|
|
4855
4855
|
let i = n[n.length - 1];
|
|
4856
|
-
return i && (await
|
|
4856
|
+
return i && (await vt(i), await X(i)), n.length > 0;
|
|
4857
4857
|
}
|
|
4858
|
-
async function
|
|
4858
|
+
async function rt(e) {
|
|
4859
4859
|
if (o.value = !0, m.value) {
|
|
4860
|
-
|
|
4860
|
+
x.value = (K?.getThreadMessages(e) ?? []).sort(Nc), T.value = !1, ce = null, o.value = !1;
|
|
4861
4861
|
return;
|
|
4862
4862
|
}
|
|
4863
4863
|
try {
|
|
4864
|
-
await
|
|
4864
|
+
await nt({ reset: !0 });
|
|
4865
4865
|
} catch (t) {
|
|
4866
|
-
let n =
|
|
4866
|
+
let n = K?.getThreadMessages(e) ?? [];
|
|
4867
4867
|
if (n.length > 0) {
|
|
4868
|
-
|
|
4868
|
+
x.value = n.sort(Nc);
|
|
4869
4869
|
return;
|
|
4870
4870
|
}
|
|
4871
|
-
throw
|
|
4871
|
+
throw _.value = Vc(t, "Unable to load thread."), t;
|
|
4872
4872
|
} finally {
|
|
4873
4873
|
o.value = !1;
|
|
4874
4874
|
}
|
|
4875
4875
|
}
|
|
4876
|
-
async function
|
|
4877
|
-
if (a.value || s.value || !
|
|
4878
|
-
s.value = !0,
|
|
4876
|
+
async function it() {
|
|
4877
|
+
if (a.value || s.value || !C.value) return !1;
|
|
4878
|
+
s.value = !0, _.value = null;
|
|
4879
4879
|
try {
|
|
4880
|
-
return await
|
|
4880
|
+
return await et();
|
|
4881
4881
|
} catch (e) {
|
|
4882
|
-
throw
|
|
4882
|
+
throw _.value = Vc(e, "Unable to load messages."), e;
|
|
4883
4883
|
} finally {
|
|
4884
4884
|
s.value = !1;
|
|
4885
4885
|
}
|
|
4886
4886
|
}
|
|
4887
|
-
async function
|
|
4888
|
-
if (o.value || c.value || !
|
|
4889
|
-
c.value = !0,
|
|
4887
|
+
async function at() {
|
|
4888
|
+
if (o.value || c.value || !T.value) return !1;
|
|
4889
|
+
c.value = !0, _.value = null;
|
|
4890
4890
|
try {
|
|
4891
|
-
return await
|
|
4891
|
+
return await nt();
|
|
4892
4892
|
} catch (e) {
|
|
4893
|
-
throw
|
|
4893
|
+
throw _.value = Vc(e, "Unable to load thread."), e;
|
|
4894
4894
|
} finally {
|
|
4895
4895
|
c.value = !1;
|
|
4896
4896
|
}
|
|
4897
4897
|
}
|
|
4898
|
-
async function
|
|
4898
|
+
async function ot(e) {
|
|
4899
4899
|
let t = e.trim();
|
|
4900
4900
|
if (!t) return !1;
|
|
4901
|
-
let n = () =>
|
|
4901
|
+
let n = () => b.value.some((e) => e.id === t) || x.value.some((e) => e.id === t) || D.value?.id === t;
|
|
4902
4902
|
if (n()) return !0;
|
|
4903
4903
|
let r = 0;
|
|
4904
|
-
for (;
|
|
4904
|
+
for (; T.value && D.value && r < 100;) {
|
|
4905
4905
|
r += 1;
|
|
4906
|
-
let e = await
|
|
4906
|
+
let e = await at();
|
|
4907
4907
|
if (n()) return !0;
|
|
4908
4908
|
if (!e) break;
|
|
4909
4909
|
}
|
|
4910
|
-
for (;
|
|
4910
|
+
for (; C.value && L.value && r < 100;) {
|
|
4911
4911
|
r += 1;
|
|
4912
|
-
let e = await
|
|
4912
|
+
let e = await it();
|
|
4913
4913
|
if (n()) return !0;
|
|
4914
4914
|
if (!e) break;
|
|
4915
4915
|
}
|
|
4916
4916
|
return n();
|
|
4917
4917
|
}
|
|
4918
|
-
async function
|
|
4919
|
-
let e = await
|
|
4918
|
+
async function st() {
|
|
4919
|
+
let e = await q.getLoggedinUser();
|
|
4920
4920
|
if (!e) try {
|
|
4921
|
-
e = await
|
|
4921
|
+
e = await q.getLoggedInUser();
|
|
4922
4922
|
} catch (e) {
|
|
4923
4923
|
if (e && typeof e == "object" && "code" in e && e.code === "USER_NOT_LOGED_IN") return;
|
|
4924
4924
|
console.error("Error fetching logged in user:", e);
|
|
4925
4925
|
}
|
|
4926
|
-
|
|
4926
|
+
v.value = e ? Dc(e) : null, g.value = !!e;
|
|
4927
4927
|
}
|
|
4928
|
-
function
|
|
4929
|
-
|
|
4928
|
+
function lt() {
|
|
4929
|
+
B ||= (q.addConnectionListener(R, new q.ConnectionListener({
|
|
4930
4930
|
onConnected: () => {
|
|
4931
|
-
if (p.value = !0, re = 0,
|
|
4932
|
-
|
|
4931
|
+
if (p.value = !0, re = 0, ge(), ie) {
|
|
4932
|
+
Se();
|
|
4933
4933
|
return;
|
|
4934
4934
|
}
|
|
4935
|
-
|
|
4935
|
+
Gt();
|
|
4936
4936
|
},
|
|
4937
4937
|
onDisconnected: () => {
|
|
4938
|
-
p.value = !1, !m.value && !
|
|
4938
|
+
p.value = !1, !m.value && !G && (g.value || ye()) && (ie = !0, be(!0));
|
|
4939
4939
|
}
|
|
4940
|
-
})),
|
|
4940
|
+
})), q.addMessageListener(z, new q.MessageListener({
|
|
4941
4941
|
onTextMessageReceived: (e) => {
|
|
4942
|
-
|
|
4942
|
+
dt(e);
|
|
4943
4943
|
},
|
|
4944
4944
|
onMediaMessageReceived: (e) => {
|
|
4945
|
-
|
|
4945
|
+
dt(e);
|
|
4946
4946
|
},
|
|
4947
4947
|
onCustomMessageReceived: (e) => {
|
|
4948
|
-
|
|
4948
|
+
dt(e);
|
|
4949
4949
|
},
|
|
4950
4950
|
onMessagesDelivered: () => {
|
|
4951
|
-
|
|
4951
|
+
ve() || xt({ includeThread: !1 });
|
|
4952
4952
|
},
|
|
4953
4953
|
onMessagesRead: () => {
|
|
4954
|
-
|
|
4954
|
+
ve() || xt({ includeThread: !1 });
|
|
4955
4955
|
},
|
|
4956
4956
|
onMessageEdited: (e) => {
|
|
4957
|
-
let t = I(e,
|
|
4958
|
-
Lc(t) && (
|
|
4957
|
+
let t = I(e, v.value?.uid);
|
|
4958
|
+
Lc(t) && (ht(t), mt(e));
|
|
4959
4959
|
},
|
|
4960
4960
|
onMessageDeleted: (e) => {
|
|
4961
|
-
let t = I(e,
|
|
4962
|
-
t.parentMessageId ?
|
|
4961
|
+
let t = I(e, v.value?.uid);
|
|
4962
|
+
t.parentMessageId ? Ot(t) : (Ot(t), kt(t)), Dt();
|
|
4963
4963
|
},
|
|
4964
4964
|
onMessageReactionAdded: () => {
|
|
4965
|
-
|
|
4965
|
+
xt();
|
|
4966
4966
|
},
|
|
4967
4967
|
onMessageReactionRemoved: () => {
|
|
4968
|
-
|
|
4968
|
+
xt();
|
|
4969
4969
|
},
|
|
4970
4970
|
onMessagesDeliveredToAll: () => {
|
|
4971
|
-
|
|
4971
|
+
ve() || xt({ includeThread: !1 });
|
|
4972
4972
|
},
|
|
4973
4973
|
onMessagesReadByAll: () => {
|
|
4974
|
-
|
|
4974
|
+
ve() || xt({ includeThread: !1 });
|
|
4975
4975
|
}
|
|
4976
4976
|
})), !0);
|
|
4977
4977
|
}
|
|
4978
|
-
async function
|
|
4979
|
-
let t = I(e,
|
|
4978
|
+
async function dt(e) {
|
|
4979
|
+
let t = I(e, v.value?.uid);
|
|
4980
4980
|
if (Lc(t)) {
|
|
4981
|
-
if (
|
|
4982
|
-
|
|
4981
|
+
if (mt(e), await vt(e), t.parentMessageId) {
|
|
4982
|
+
gt(t), Et(t.parentMessageId), Dt();
|
|
4983
4983
|
return;
|
|
4984
4984
|
}
|
|
4985
|
-
t.conversationId ===
|
|
4985
|
+
t.conversationId === E.value && (ht(t), Dt(), await X(e));
|
|
4986
4986
|
}
|
|
4987
4987
|
}
|
|
4988
|
-
async function
|
|
4988
|
+
async function ft(e) {
|
|
4989
4989
|
return await Promise.all(e.map(async (e) => {
|
|
4990
|
-
let t = await
|
|
4990
|
+
let t = await pt(e.targetId);
|
|
4991
4991
|
return {
|
|
4992
4992
|
...e,
|
|
4993
4993
|
muteSettings: t ? new Date(t) : null
|
|
4994
4994
|
};
|
|
4995
4995
|
}));
|
|
4996
4996
|
}
|
|
4997
|
-
async function
|
|
4998
|
-
let t =
|
|
4997
|
+
async function pt(e) {
|
|
4998
|
+
let t = K?.getParticipantSettings(e), n = t?.lastUpdated ? Date.now() - t.lastUpdated > 1440 * 60 * 1e3 : !0;
|
|
4999
4999
|
if (t && (m.value || !n)) return t.mutedUntil;
|
|
5000
|
-
if (m.value || !
|
|
5000
|
+
if (m.value || !g.value) return t?.mutedUntil ?? null;
|
|
5001
5001
|
try {
|
|
5002
|
-
let n = (await
|
|
5002
|
+
let n = (await q.getLoggedinUser())?.getUid?.();
|
|
5003
5003
|
if (!n || e === n) return t?.mutedUntil ?? null;
|
|
5004
5004
|
let r = Ke();
|
|
5005
5005
|
if (!r) return t?.mutedUntil ?? null;
|
|
@@ -5012,7 +5012,7 @@ function bc({ environment: e }) {
|
|
|
5012
5012
|
});
|
|
5013
5013
|
if (!i.ok) return t?.mutedUntil ?? null;
|
|
5014
5014
|
let a = await i.json();
|
|
5015
|
-
return
|
|
5015
|
+
return K?.storeParticipantSettings({
|
|
5016
5016
|
chatUid: e,
|
|
5017
5017
|
mutedUntil: a.mutedUntil ?? null,
|
|
5018
5018
|
lastUpdated: Date.now()
|
|
@@ -5021,71 +5021,71 @@ function bc({ environment: e }) {
|
|
|
5021
5021
|
return t?.mutedUntil ?? null;
|
|
5022
5022
|
}
|
|
5023
5023
|
}
|
|
5024
|
-
function
|
|
5025
|
-
let t = I(e,
|
|
5024
|
+
function mt(e) {
|
|
5025
|
+
let t = I(e, v.value?.uid);
|
|
5026
5026
|
if (!Lc(t) || t.isDeleted) return;
|
|
5027
|
-
let n = e.getConversationId(), r =
|
|
5027
|
+
let n = e.getConversationId(), r = y.value.find((e) => e.id === n);
|
|
5028
5028
|
if (!r) {
|
|
5029
|
-
|
|
5029
|
+
De();
|
|
5030
5030
|
return;
|
|
5031
5031
|
}
|
|
5032
5032
|
let i = {
|
|
5033
5033
|
...r,
|
|
5034
5034
|
subtitle: lc(t),
|
|
5035
5035
|
lastMessageAt: /* @__PURE__ */ new Date((e.getSentAt?.() ?? 0) * 1e3),
|
|
5036
|
-
unreadCount: n ===
|
|
5036
|
+
unreadCount: n === E.value ? 0 : r.unreadCount + 1,
|
|
5037
5037
|
lastMessage: t
|
|
5038
5038
|
};
|
|
5039
|
-
|
|
5040
|
-
}
|
|
5041
|
-
function mt(e) {
|
|
5042
|
-
y.value = Pc(y.value, e), T.value && W?.setMessages(T.value, y.value);
|
|
5039
|
+
y.value = Mc(y.value.map((e) => e.id === n ? i : e)), K?.setConversations(y.value);
|
|
5043
5040
|
}
|
|
5044
5041
|
function ht(e) {
|
|
5045
|
-
|
|
5042
|
+
b.value = Pc(b.value, e), E.value && K?.setMessages(E.value, b.value);
|
|
5046
5043
|
}
|
|
5047
|
-
|
|
5048
|
-
|
|
5049
|
-
let t = e.getSender?.()?.getUid?.();
|
|
5050
|
-
!t || t === _.value?.uid || e.getReadByMeAt?.() || (ge(), await K.markAsRead(e));
|
|
5044
|
+
function gt(e) {
|
|
5045
|
+
e.parentMessageId === D.value?.id && (x.value = Pc(x.value, e), e.parentMessageId && K?.setThreadMessages(e.parentMessageId, x.value));
|
|
5051
5046
|
}
|
|
5052
5047
|
async function X(e) {
|
|
5053
5048
|
if (m.value) return;
|
|
5054
5049
|
let t = e.getSender?.()?.getUid?.();
|
|
5055
|
-
!t || t ===
|
|
5050
|
+
!t || t === v.value?.uid || e.getReadByMeAt?.() || (_e(), await q.markAsRead(e));
|
|
5056
5051
|
}
|
|
5057
5052
|
async function vt(e) {
|
|
5058
|
-
|
|
5053
|
+
if (m.value) return;
|
|
5054
|
+
let t = e.getSender?.()?.getUid?.();
|
|
5055
|
+
!t || t === v.value?.uid || e.getDeliveredToMeAt?.() || (_e(), await q.markAsDelivered(e));
|
|
5056
|
+
}
|
|
5057
|
+
async function yt(e) {
|
|
5058
|
+
return m.value ? [] : Tc(await q.getMessageReceipts(String(e.id)));
|
|
5059
5059
|
}
|
|
5060
|
-
function
|
|
5061
|
-
r.value = !1, i.value = !1, a.value = !1, o.value = !1, s.value = !1, c.value = !1, l.value = !1, u.value = !1, d.value = !1, f.value = !1, p.value = !1,
|
|
5060
|
+
function bt() {
|
|
5061
|
+
r.value = !1, i.value = !1, a.value = !1, o.value = !1, s.value = !1, c.value = !1, l.value = !1, u.value = !1, d.value = !1, f.value = !1, p.value = !1, ge(), re = 0, ie = !1, G = !1, g.value = !1, v.value = null, y.value = [], b.value = [], x.value = [], S.value = [], D.value = null, O.value = null, k.value = null, A.value = [], E.value = null, C.value = !1, T.value = !1, se = null, ce = null, oe.clear();
|
|
5062
5062
|
}
|
|
5063
|
-
async function
|
|
5064
|
-
if (
|
|
5063
|
+
async function xt(e) {
|
|
5064
|
+
if (W) return W;
|
|
5065
5065
|
let t = e?.includeThread ?? !0;
|
|
5066
|
-
|
|
5067
|
-
L.value && await
|
|
5066
|
+
W = (async () => {
|
|
5067
|
+
L.value && await tt(), t && D.value && await rt(D.value.id);
|
|
5068
5068
|
})();
|
|
5069
5069
|
try {
|
|
5070
|
-
await
|
|
5070
|
+
await W;
|
|
5071
5071
|
} finally {
|
|
5072
|
-
|
|
5072
|
+
W = null;
|
|
5073
5073
|
}
|
|
5074
5074
|
}
|
|
5075
|
-
function xt(e) {
|
|
5076
|
-
St(e), e.parentMessageId && Tt(e.parentMessageId, e.replyCount), Et();
|
|
5077
|
-
}
|
|
5078
5075
|
function St(e) {
|
|
5076
|
+
Ct(e), e.parentMessageId && Et(e.parentMessageId, e.replyCount), Dt();
|
|
5077
|
+
}
|
|
5078
|
+
function Ct(e) {
|
|
5079
5079
|
if (e.parentMessageId) {
|
|
5080
|
-
|
|
5080
|
+
D.value?.id === e.parentMessageId && (x.value = Pc(x.value, e));
|
|
5081
5081
|
return;
|
|
5082
5082
|
}
|
|
5083
|
-
|
|
5084
|
-
}
|
|
5085
|
-
function Ct(e, t) {
|
|
5086
|
-
return t ? b.value.find((t) => t.id === e) ?? null : E.value?.id === e ? E.value : y.value.find((t) => t.id === e) ?? null;
|
|
5083
|
+
b.value = Pc(b.value, e), D.value?.id === e.id && (D.value = e);
|
|
5087
5084
|
}
|
|
5088
5085
|
function wt(e, t) {
|
|
5086
|
+
return t ? x.value.find((t) => t.id === e) ?? null : D.value?.id === e ? D.value : b.value.find((t) => t.id === e) ?? null;
|
|
5087
|
+
}
|
|
5088
|
+
function Tt(e, t) {
|
|
5089
5089
|
let n = e.reactions.find((e) => e.emoji === t);
|
|
5090
5090
|
return n ? n.reactedByMe && n.count === 1 ? {
|
|
5091
5091
|
...e,
|
|
@@ -5106,41 +5106,41 @@ function bc({ environment: e }) {
|
|
|
5106
5106
|
}]
|
|
5107
5107
|
};
|
|
5108
5108
|
}
|
|
5109
|
-
function
|
|
5110
|
-
let n =
|
|
5109
|
+
function Et(e, t) {
|
|
5110
|
+
let n = b.value.find((t) => t.id === e);
|
|
5111
5111
|
if (!n) return;
|
|
5112
5112
|
let r = {
|
|
5113
5113
|
...n,
|
|
5114
5114
|
replyCount: typeof t == "number" ? t : Math.max(n.replyCount + 1, 1)
|
|
5115
5115
|
};
|
|
5116
|
-
|
|
5116
|
+
b.value = Pc(b.value, r), D.value?.id === e && (D.value = r);
|
|
5117
5117
|
}
|
|
5118
|
-
function
|
|
5119
|
-
|
|
5118
|
+
function Dt() {
|
|
5119
|
+
E.value && K?.setMessages(E.value, b.value), D.value && K?.setThreadMessages(D.value.id, x.value);
|
|
5120
5120
|
}
|
|
5121
|
-
function
|
|
5122
|
-
if (e.parentMessageId ? (
|
|
5123
|
-
|
|
5124
|
-
let t =
|
|
5125
|
-
for (let e of t)
|
|
5121
|
+
function Ot(e) {
|
|
5122
|
+
if (e.parentMessageId ? (x.value = x.value.filter((t) => t.id !== e.id), K?.setThreadMessages(e.parentMessageId, x.value)) : (b.value = b.value.filter((t) => t.id !== e.id), E.value && K?.setMessages(E.value, b.value)), e.muid) {
|
|
5123
|
+
A.value = A.value.filter((t) => t.muid !== e.muid);
|
|
5124
|
+
let t = K?.getQueue().filter((t) => t.muid === e.muid) ?? [];
|
|
5125
|
+
for (let e of t) K?.dequeue(e.id), ae.delete(e.id), e.kind === "attachment" && K?.deleteQueuedAttachment(e.id);
|
|
5126
5126
|
}
|
|
5127
|
-
e.parentMessageId ||
|
|
5127
|
+
e.parentMessageId || At(e.conversationId);
|
|
5128
5128
|
}
|
|
5129
|
-
function
|
|
5129
|
+
function kt(e) {
|
|
5130
5130
|
if (e.parentMessageId) return;
|
|
5131
|
-
let t = e.conversationId, n =
|
|
5131
|
+
let t = e.conversationId, n = y.value.find((e) => e.id === t);
|
|
5132
5132
|
if (!n) return;
|
|
5133
5133
|
let r = n.lastMessageAt?.getTime(), i = e.sentAt?.getTime();
|
|
5134
5134
|
if (r != null && i != null && r > i) return;
|
|
5135
|
-
let a = t ===
|
|
5136
|
-
if (a) for (let t =
|
|
5137
|
-
let n =
|
|
5135
|
+
let a = t === E.value, o;
|
|
5136
|
+
if (a) for (let t = b.value.length - 1; t >= 0; t--) {
|
|
5137
|
+
let n = b.value[t];
|
|
5138
5138
|
if (!n.parentMessageId && n.id !== e.id && !n.isDeleted) {
|
|
5139
5139
|
o = n;
|
|
5140
5140
|
break;
|
|
5141
5141
|
}
|
|
5142
5142
|
}
|
|
5143
|
-
|
|
5143
|
+
y.value = Mc(y.value.map((e) => e.id === t ? o ? {
|
|
5144
5144
|
...e,
|
|
5145
5145
|
subtitle: Bc(o),
|
|
5146
5146
|
lastMessageAt: o.sentAt,
|
|
@@ -5149,35 +5149,35 @@ function bc({ environment: e }) {
|
|
|
5149
5149
|
...e,
|
|
5150
5150
|
subtitle: "No messages yet",
|
|
5151
5151
|
lastMessageAt: void 0
|
|
5152
|
-
} : e : e)),
|
|
5152
|
+
} : e : e)), K?.setConversations(y.value);
|
|
5153
5153
|
}
|
|
5154
|
-
function
|
|
5155
|
-
let n =
|
|
5156
|
-
|
|
5154
|
+
function At(e, t) {
|
|
5155
|
+
let n = b.value.length > 0 ? b.value[b.value.length - 1] : null, r = t ?? n;
|
|
5156
|
+
y.value = Mc(y.value.map((t) => t.id === e ? {
|
|
5157
5157
|
...t,
|
|
5158
5158
|
subtitle: r ? Bc(r) : "No messages yet",
|
|
5159
5159
|
lastMessageAt: r?.sentAt,
|
|
5160
5160
|
lastMessage: r
|
|
5161
|
-
} : t)),
|
|
5161
|
+
} : t)), K?.setConversations(y.value);
|
|
5162
5162
|
}
|
|
5163
|
-
function
|
|
5164
|
-
|
|
5163
|
+
function jt(e) {
|
|
5164
|
+
y.value = Mc(y.value.map((t) => t.id === e.conversationId ? {
|
|
5165
5165
|
...t,
|
|
5166
5166
|
subtitle: Bc(e),
|
|
5167
5167
|
lastMessageAt: e.sentAt,
|
|
5168
5168
|
lastMessage: e,
|
|
5169
5169
|
unreadCount: 0
|
|
5170
|
-
} : t)),
|
|
5170
|
+
} : t)), K?.setConversations(y.value);
|
|
5171
5171
|
}
|
|
5172
|
-
function
|
|
5173
|
-
let t = /* @__PURE__ */ new Date(), n =
|
|
5172
|
+
function Mt(e) {
|
|
5173
|
+
let t = /* @__PURE__ */ new Date(), n = Pt(e.metadata);
|
|
5174
5174
|
return {
|
|
5175
5175
|
id: `local-${e.muid}`,
|
|
5176
5176
|
muid: e.muid,
|
|
5177
5177
|
conversationId: e.conversation.id,
|
|
5178
|
-
senderId:
|
|
5179
|
-
senderName: Zc(
|
|
5180
|
-
senderAvatar:
|
|
5178
|
+
senderId: v.value?.uid ?? "me",
|
|
5179
|
+
senderName: Zc(v.value, e.metadata),
|
|
5180
|
+
senderAvatar: v.value?.avatar,
|
|
5181
5181
|
text: e.text,
|
|
5182
5182
|
kind: e.kind,
|
|
5183
5183
|
sentAt: t,
|
|
@@ -5209,11 +5209,11 @@ function bc({ environment: e }) {
|
|
|
5209
5209
|
source: null
|
|
5210
5210
|
};
|
|
5211
5211
|
}
|
|
5212
|
-
function
|
|
5212
|
+
function Nt(e, t) {
|
|
5213
5213
|
let n = {};
|
|
5214
5214
|
return t?.senderDisplayName?.trim() && (n.senderDisplayName = t.senderDisplayName.trim()), e ? (n.replyToMessageId = e.id, n.replyPreview = oc(e), n) : n;
|
|
5215
5215
|
}
|
|
5216
|
-
function
|
|
5216
|
+
function Pt(e) {
|
|
5217
5217
|
let t = e.replyPreview;
|
|
5218
5218
|
if (!t || typeof t != "object") return;
|
|
5219
5219
|
let n = t;
|
|
@@ -5224,13 +5224,13 @@ function bc({ environment: e }) {
|
|
|
5224
5224
|
kind: n.kind ?? "text"
|
|
5225
5225
|
};
|
|
5226
5226
|
}
|
|
5227
|
-
function
|
|
5228
|
-
if (
|
|
5227
|
+
function Ft(e) {
|
|
5228
|
+
if (ee() || m.value) return !0;
|
|
5229
5229
|
let t = Vc(e, "").toLowerCase();
|
|
5230
5230
|
return t.includes("network") || t.includes("failed to fetch") || t.includes("socket") || t.includes("offline");
|
|
5231
5231
|
}
|
|
5232
|
-
function
|
|
5233
|
-
let a =
|
|
5232
|
+
function It(e, t, n, r, i) {
|
|
5233
|
+
let a = Mt({
|
|
5234
5234
|
conversation: e,
|
|
5235
5235
|
kind: "text",
|
|
5236
5236
|
text: t,
|
|
@@ -5239,7 +5239,7 @@ function bc({ environment: e }) {
|
|
|
5239
5239
|
muid: i,
|
|
5240
5240
|
deliveryState: "queued"
|
|
5241
5241
|
});
|
|
5242
|
-
|
|
5242
|
+
Vt(a, {
|
|
5243
5243
|
id: a.id,
|
|
5244
5244
|
muid: i,
|
|
5245
5245
|
conversationId: e.id,
|
|
@@ -5252,9 +5252,9 @@ function bc({ environment: e }) {
|
|
|
5252
5252
|
createdAt: a.sentAt.toISOString()
|
|
5253
5253
|
});
|
|
5254
5254
|
}
|
|
5255
|
-
function
|
|
5256
|
-
if (
|
|
5257
|
-
let a =
|
|
5255
|
+
function Lt(e, t, n, r, i) {
|
|
5256
|
+
if (Rt(e, t, r)) return;
|
|
5257
|
+
let a = Mt({
|
|
5258
5258
|
conversation: e,
|
|
5259
5259
|
kind: "poll",
|
|
5260
5260
|
text: `Poll: ${t.question}`,
|
|
@@ -5264,7 +5264,7 @@ function bc({ environment: e }) {
|
|
|
5264
5264
|
muid: i,
|
|
5265
5265
|
deliveryState: "queued"
|
|
5266
5266
|
});
|
|
5267
|
-
|
|
5267
|
+
Vt(a, {
|
|
5268
5268
|
id: a.id,
|
|
5269
5269
|
muid: i,
|
|
5270
5270
|
conversationId: e.id,
|
|
@@ -5277,16 +5277,16 @@ function bc({ environment: e }) {
|
|
|
5277
5277
|
createdAt: a.sentAt.toISOString()
|
|
5278
5278
|
});
|
|
5279
5279
|
}
|
|
5280
|
-
function
|
|
5280
|
+
function Rt(e, t, n) {
|
|
5281
5281
|
let r = Date.now(), i = (e) => e.trim().toLowerCase(), a = (e) => e.map((e) => i(e)).filter(Boolean).join("\0"), o = i(t.question), s = a(t.options);
|
|
5282
|
-
return
|
|
5282
|
+
return A.value.some((t) => {
|
|
5283
5283
|
if (t.kind !== "poll" || !t.poll || t.conversationId !== e.id || t.targetId !== e.targetId || t.parentMessageId !== n) return !1;
|
|
5284
5284
|
let c = new Date(t.createdAt).getTime();
|
|
5285
5285
|
return Number.isNaN(c) || r - c > 5e3 ? !1 : i(t.poll.question) === o && a(t.poll.options) === s;
|
|
5286
5286
|
});
|
|
5287
5287
|
}
|
|
5288
|
-
async function
|
|
5289
|
-
let a = qc(t.file), o =
|
|
5288
|
+
async function zt(e, t, n, r, i) {
|
|
5289
|
+
let a = qc(t.file), o = Mt({
|
|
5290
5290
|
conversation: e,
|
|
5291
5291
|
kind: a,
|
|
5292
5292
|
text: t.caption?.trim() ?? "",
|
|
@@ -5318,19 +5318,19 @@ function bc({ environment: e }) {
|
|
|
5318
5318
|
parentMessageId: r,
|
|
5319
5319
|
createdAt: o.sentAt.toISOString()
|
|
5320
5320
|
};
|
|
5321
|
-
|
|
5321
|
+
ae.set(s.id, t.file);
|
|
5322
5322
|
try {
|
|
5323
|
-
await
|
|
5323
|
+
await K?.storeQueuedAttachment(s.id, t.file);
|
|
5324
5324
|
} catch {}
|
|
5325
|
-
|
|
5325
|
+
Vt(o, s);
|
|
5326
5326
|
}
|
|
5327
|
-
function
|
|
5328
|
-
|
|
5327
|
+
function Vt(e, t) {
|
|
5328
|
+
A.value = [...A.value, t], K?.enqueue(t), Ht(e);
|
|
5329
5329
|
}
|
|
5330
|
-
function
|
|
5331
|
-
e.parentMessageId ? (
|
|
5330
|
+
function Ht(e) {
|
|
5331
|
+
e.parentMessageId ? (D.value?.id === e.parentMessageId && (x.value = Pc(x.value, e)), Et(e.parentMessageId)) : b.value = Pc(b.value, e), jt(e), Dt();
|
|
5332
5332
|
}
|
|
5333
|
-
function
|
|
5333
|
+
function Ut(e, t) {
|
|
5334
5334
|
let n = (n) => n.map((n) => {
|
|
5335
5335
|
let r = Rc(n);
|
|
5336
5336
|
return n.muid !== t && r !== t ? n : {
|
|
@@ -5338,40 +5338,40 @@ function bc({ environment: e }) {
|
|
|
5338
5338
|
deliveryState: e
|
|
5339
5339
|
};
|
|
5340
5340
|
});
|
|
5341
|
-
|
|
5341
|
+
b.value = n(b.value), x.value = n(x.value), Dt();
|
|
5342
5342
|
}
|
|
5343
|
-
function
|
|
5343
|
+
function Wt(e) {
|
|
5344
5344
|
if (!e) return;
|
|
5345
|
-
let t = [...
|
|
5345
|
+
let t = [...b.value, ...x.value].filter((t) => {
|
|
5346
5346
|
if (!t.id.startsWith("local-")) return !1;
|
|
5347
5347
|
let n = Rc(t);
|
|
5348
5348
|
return t.muid === e || n === e;
|
|
5349
5349
|
});
|
|
5350
|
-
for (let e of t)
|
|
5350
|
+
for (let e of t) Ot(e);
|
|
5351
5351
|
}
|
|
5352
|
-
async function
|
|
5353
|
-
if (!(f.value ||
|
|
5352
|
+
async function Gt() {
|
|
5353
|
+
if (!(f.value || A.value.length === 0 || !g.value || m.value)) {
|
|
5354
5354
|
f.value = !0;
|
|
5355
5355
|
try {
|
|
5356
|
-
let e = [...
|
|
5356
|
+
let e = [...A.value].filter((e) => !oe.has(e.id)).sort((e, t) => e.createdAt.localeCompare(t.createdAt));
|
|
5357
5357
|
for (let t of e) if (!oe.has(t.id)) {
|
|
5358
5358
|
oe.add(t.id);
|
|
5359
5359
|
try {
|
|
5360
|
-
let e = await
|
|
5361
|
-
|
|
5360
|
+
let e = await Kt(t);
|
|
5361
|
+
A.value = A.value.filter((e) => e.id !== t.id), K?.dequeue(t.id), ae.delete(t.id), t.kind === "attachment" && await K?.deleteQueuedAttachment(t.id), Wt(t.muid), e ? St(I(e, v.value?.uid)) : await xt();
|
|
5362
5362
|
} finally {
|
|
5363
5363
|
oe.delete(t.id);
|
|
5364
5364
|
}
|
|
5365
5365
|
}
|
|
5366
5366
|
} catch (e) {
|
|
5367
|
-
|
|
5367
|
+
Ft(e) || (_.value = Vc(e, "Unable to sync queued messages."));
|
|
5368
5368
|
} finally {
|
|
5369
5369
|
f.value = !1;
|
|
5370
5370
|
}
|
|
5371
5371
|
}
|
|
5372
5372
|
}
|
|
5373
|
-
async function
|
|
5374
|
-
let t = e.receiverType === "group" ?
|
|
5373
|
+
async function Kt(e) {
|
|
5374
|
+
let t = e.receiverType === "group" ? q.RECEIVER_TYPE.GROUP : q.RECEIVER_TYPE.USER;
|
|
5375
5375
|
if (e.kind === "poll" && e.poll) {
|
|
5376
5376
|
let n = {
|
|
5377
5377
|
question: e.poll.question,
|
|
@@ -5380,17 +5380,17 @@ function bc({ environment: e }) {
|
|
|
5380
5380
|
receiverType: t
|
|
5381
5381
|
};
|
|
5382
5382
|
e.parentMessageId && (n.parentMessageId = Number(e.parentMessageId)), e.metadata && Object.keys(e.metadata).length > 0 && (n.metadata = e.metadata);
|
|
5383
|
-
let r = await
|
|
5383
|
+
let r = await q.callExtension("polls", "POST", "v2/create", n);
|
|
5384
5384
|
return r?.message ?? r?.custom_message ?? r?.data?.message ?? null;
|
|
5385
5385
|
}
|
|
5386
5386
|
if (e.kind === "attachment" && e.attachment) {
|
|
5387
|
-
let n =
|
|
5387
|
+
let n = ae.get(e.id) ?? await K?.getQueuedAttachment(e.id) ?? null;
|
|
5388
5388
|
if (!n) throw Error(`Queued attachment ${e.attachment.name} is no longer available for upload.`);
|
|
5389
|
-
let r = new
|
|
5390
|
-
return r.setMuid?.(e.muid), e.metadata && Object.keys(e.metadata).length > 0 && r.setMetadata?.(e.metadata), e.parentMessageId && r.setParentMessageId?.(Number(e.parentMessageId)), e.attachment.caption && r.setCaption?.(e.attachment.caption),
|
|
5389
|
+
let r = new q.MediaMessage(e.targetId, n, e.attachment.kind, t);
|
|
5390
|
+
return r.setMuid?.(e.muid), e.metadata && Object.keys(e.metadata).length > 0 && r.setMetadata?.(e.metadata), e.parentMessageId && r.setParentMessageId?.(Number(e.parentMessageId)), e.attachment.caption && r.setCaption?.(e.attachment.caption), q.sendMediaMessage(r);
|
|
5391
5391
|
}
|
|
5392
|
-
let n = new
|
|
5393
|
-
return n.setMuid?.(e.muid), e.metadata && Object.keys(e.metadata).length > 0 && n.setMetadata?.(e.metadata), e.parentMessageId && n.setParentMessageId?.(Number(e.parentMessageId)),
|
|
5392
|
+
let n = new q.TextMessage(e.targetId, e.text ?? "", t);
|
|
5393
|
+
return n.setMuid?.(e.muid), e.metadata && Object.keys(e.metadata).length > 0 && n.setMetadata?.(e.metadata), e.parentMessageId && n.setParentMessageId?.(Number(e.parentMessageId)), q.sendMessage(n);
|
|
5394
5394
|
}
|
|
5395
5395
|
return {
|
|
5396
5396
|
initialized: t,
|
|
@@ -5406,57 +5406,58 @@ function bc({ environment: e }) {
|
|
|
5406
5406
|
syncingQueue: f,
|
|
5407
5407
|
connected: p,
|
|
5408
5408
|
offlineMode: m,
|
|
5409
|
-
|
|
5410
|
-
|
|
5411
|
-
|
|
5412
|
-
|
|
5413
|
-
|
|
5414
|
-
|
|
5415
|
-
|
|
5416
|
-
|
|
5417
|
-
|
|
5418
|
-
|
|
5419
|
-
|
|
5409
|
+
hideGroupActions: h,
|
|
5410
|
+
loggedIn: g,
|
|
5411
|
+
error: _,
|
|
5412
|
+
currentUser: v,
|
|
5413
|
+
conversations: y,
|
|
5414
|
+
messages: b,
|
|
5415
|
+
threadMessages: x,
|
|
5416
|
+
scheduledMessages: S,
|
|
5417
|
+
hasOlderMessages: C,
|
|
5418
|
+
hasOlderThreadMessages: T,
|
|
5419
|
+
pendingQueueCount: M,
|
|
5420
|
+
activeConversationId: E,
|
|
5420
5421
|
activeConversation: L,
|
|
5421
|
-
activeThreadParentMessage:
|
|
5422
|
-
replyToMessage:
|
|
5423
|
-
editingMessage:
|
|
5424
|
-
init:
|
|
5425
|
-
connectRealtime:
|
|
5426
|
-
disconnectRealtime:
|
|
5427
|
-
login:
|
|
5428
|
-
logout:
|
|
5429
|
-
fetchConversations:
|
|
5430
|
-
selectConversation:
|
|
5431
|
-
sendTextMessage:
|
|
5432
|
-
sendAttachmentMessage:
|
|
5433
|
-
sendPollMessage:
|
|
5434
|
-
fetchScheduledMessages:
|
|
5435
|
-
loadOlderMessages:
|
|
5436
|
-
loadOlderThreadMessages:
|
|
5437
|
-
ensureMessageLoaded:
|
|
5438
|
-
scheduleMessage:
|
|
5439
|
-
rescheduleMessage:
|
|
5440
|
-
removeScheduledMessage:
|
|
5441
|
-
editScheduledMessage:
|
|
5442
|
-
setReplyToMessage:
|
|
5443
|
-
setEditingMessage:
|
|
5444
|
-
openThread:
|
|
5445
|
-
closeThread:
|
|
5446
|
-
refreshVisibleMessages:
|
|
5447
|
-
fetchMessageReceipts:
|
|
5448
|
-
deleteMessage:
|
|
5449
|
-
votePoll:
|
|
5450
|
-
toggleReaction:
|
|
5451
|
-
translateMessage:
|
|
5452
|
-
mentionDisplayNamesByUid:
|
|
5422
|
+
activeThreadParentMessage: D,
|
|
5423
|
+
replyToMessage: O,
|
|
5424
|
+
editingMessage: k,
|
|
5425
|
+
init: ue,
|
|
5426
|
+
connectRealtime: Te,
|
|
5427
|
+
disconnectRealtime: Ee,
|
|
5428
|
+
login: de,
|
|
5429
|
+
logout: fe,
|
|
5430
|
+
fetchConversations: De,
|
|
5431
|
+
selectConversation: Oe,
|
|
5432
|
+
sendTextMessage: Ne,
|
|
5433
|
+
sendAttachmentMessage: J,
|
|
5434
|
+
sendPollMessage: Fe,
|
|
5435
|
+
fetchScheduledMessages: He,
|
|
5436
|
+
loadOlderMessages: it,
|
|
5437
|
+
loadOlderThreadMessages: at,
|
|
5438
|
+
ensureMessageLoaded: ot,
|
|
5439
|
+
scheduleMessage: Ue,
|
|
5440
|
+
rescheduleMessage: Je,
|
|
5441
|
+
removeScheduledMessage: We,
|
|
5442
|
+
editScheduledMessage: Ge,
|
|
5443
|
+
setReplyToMessage: ke,
|
|
5444
|
+
setEditingMessage: Ae,
|
|
5445
|
+
openThread: je,
|
|
5446
|
+
closeThread: Me,
|
|
5447
|
+
refreshVisibleMessages: xt,
|
|
5448
|
+
fetchMessageReceipts: yt,
|
|
5449
|
+
deleteMessage: ze,
|
|
5450
|
+
votePoll: Ie,
|
|
5451
|
+
toggleReaction: Re,
|
|
5452
|
+
translateMessage: Be,
|
|
5453
|
+
mentionDisplayNamesByUid: j,
|
|
5453
5454
|
rememberMentionDisplayNames: P
|
|
5454
5455
|
};
|
|
5455
5456
|
}
|
|
5456
5457
|
async function xc(e) {
|
|
5457
5458
|
return Ve(e), vc === e && yc || (yc = (async () => {
|
|
5458
|
-
let t = Y(), n = new
|
|
5459
|
-
await
|
|
5459
|
+
let t = Y(), n = new q.AppSettingsBuilder().subscribePresenceForAllUsers().setRegion(t.region).autoEstablishSocketConnection(!0).setStorageMode(q.StorageMode.SESSION).build();
|
|
5460
|
+
await q.init(t.appId, n), vc = e;
|
|
5460
5461
|
})()), yc;
|
|
5461
5462
|
}
|
|
5462
5463
|
async function Sc(e) {
|
|
@@ -5477,7 +5478,7 @@ async function Sc(e) {
|
|
|
5477
5478
|
}), i.token;
|
|
5478
5479
|
}
|
|
5479
5480
|
function Cc(e, t) {
|
|
5480
|
-
let n = e.getConversationWith(), r = e.getConversationType() ===
|
|
5481
|
+
let n = e.getConversationWith(), r = e.getConversationType() === q.RECEIVER_TYPE.GROUP ? "group" : "user", i = r === "user" ? n : null, a = r === "group" ? n : null, o = r === "group" ? a.getGuid() : i.getUid(), s = e.getLastMessage(), c = t ? `group_${t}` : null;
|
|
5481
5482
|
if (c && e.getConversationId() === c) return {
|
|
5482
5483
|
id: e.getConversationId(),
|
|
5483
5484
|
targetId: o,
|
|
@@ -5576,7 +5577,7 @@ function Ac(e, t) {
|
|
|
5576
5577
|
let n = e.getType?.(), r = e.getCategory?.(), i = ml(e);
|
|
5577
5578
|
if (String(r).toLowerCase() === "action") return rl(e);
|
|
5578
5579
|
if (i) return `Poll: ${i.question}`;
|
|
5579
|
-
if (n ===
|
|
5580
|
+
if (n === q.MESSAGE_TYPE.TEXT || typeof e.getText == "function") {
|
|
5580
5581
|
let t = tc(e.getText());
|
|
5581
5582
|
if (t) return t;
|
|
5582
5583
|
}
|
|
@@ -5591,7 +5592,7 @@ function jc(e, t) {
|
|
|
5591
5592
|
let n = e.getType?.(), r = e.getCategory?.(), i = ml(e);
|
|
5592
5593
|
if (String(r).toLowerCase() === "action") return rl(e);
|
|
5593
5594
|
if (i) return `Poll: ${i.question}`;
|
|
5594
|
-
if (n ===
|
|
5595
|
+
if (n === q.MESSAGE_TYPE.TEXT || typeof e.getText == "function") {
|
|
5595
5596
|
let t = Qs(e.getText?.());
|
|
5596
5597
|
if (ec(t)) return t;
|
|
5597
5598
|
}
|
|
@@ -5651,7 +5652,7 @@ function Hc(e) {
|
|
|
5651
5652
|
return t.code === "ERR_GUID_NOT_FOUND" || t.status === 404 || t.statusCode === 404;
|
|
5652
5653
|
}
|
|
5653
5654
|
function Uc(e) {
|
|
5654
|
-
return e.type === "group" ?
|
|
5655
|
+
return e.type === "group" ? q.RECEIVER_TYPE.GROUP : q.RECEIVER_TYPE.USER;
|
|
5655
5656
|
}
|
|
5656
5657
|
function Wc() {
|
|
5657
5658
|
let e = Ke();
|
|
@@ -5704,7 +5705,7 @@ function Jc(e) {
|
|
|
5704
5705
|
return t;
|
|
5705
5706
|
}
|
|
5706
5707
|
function Yc(e, t, n, r, i, a) {
|
|
5707
|
-
let o = new
|
|
5708
|
+
let o = new q.MediaMessage(e.targetId, t, n, Uc(e));
|
|
5708
5709
|
return o.setSentAt(Math.floor(Date.now() / 1e3)), o.setMuid(globalThis.crypto?.randomUUID?.() ?? `${Date.now()}-${t.name}`), r && o.setCaption(r), o.setMetadata({
|
|
5709
5710
|
scheduleDate: i,
|
|
5710
5711
|
file: t,
|
|
@@ -5989,9 +5990,9 @@ function Cl(e, t) {
|
|
|
5989
5990
|
let n = t?.value?.getMetadata?.() ?? {};
|
|
5990
5991
|
if (!e?.getSender?.() || n.isChannel) return "";
|
|
5991
5992
|
let r = e?.getData?.()?.entities?.receiver?.entity?.scope, i = e?.getReceiver?.()?.getMetadata?.() ?? {};
|
|
5992
|
-
e instanceof
|
|
5993
|
+
e instanceof q.Action && (i = e?.getActionFor?.()?.getMetadata?.() ?? {});
|
|
5993
5994
|
let a = i.systemDisplayName;
|
|
5994
|
-
return e?.getData?.()?.metadata?.senderDisplayName && (r == "moderator" || r === void 0) ? e.getData().metadata.senderDisplayName : a && (e instanceof
|
|
5995
|
+
return e?.getData?.()?.metadata?.senderDisplayName && (r == "moderator" || r === void 0) ? e.getData().metadata.senderDisplayName : a && (e instanceof q.Action || r == "admin") ? a : e?.getSender?.()?.getName?.();
|
|
5995
5996
|
}
|
|
5996
5997
|
function wl(e, t = 25, n) {
|
|
5997
5998
|
let r = e.trim();
|
|
@@ -6014,7 +6015,7 @@ function wl(e, t = 25, n) {
|
|
|
6014
6015
|
};
|
|
6015
6016
|
}
|
|
6016
6017
|
async function Tl(e) {
|
|
6017
|
-
let t = new
|
|
6018
|
+
let t = new q.GroupMembersRequestBuilder(e).setLimit(50).build(), n = !0, r = [];
|
|
6018
6019
|
try {
|
|
6019
6020
|
for (; n;) {
|
|
6020
6021
|
let e = await t.fetchNext();
|
|
@@ -6033,7 +6034,7 @@ async function Tl(e) {
|
|
|
6033
6034
|
}
|
|
6034
6035
|
async function El(e) {
|
|
6035
6036
|
await Il("failed to get muted setting. User not logged in");
|
|
6036
|
-
let t = await Ll(`${Y().chatApiBaseUrl}/chats/${e}/settings/${(await
|
|
6037
|
+
let t = await Ll(`${Y().chatApiBaseUrl}/chats/${e}/settings/${(await q.getLoggedinUser())?.getUid?.()}`, { method: "GET" });
|
|
6037
6038
|
return Nl()?.storeParticipantSettings({
|
|
6038
6039
|
chatUid: e,
|
|
6039
6040
|
mutedUntil: t.mutedUntil,
|
|
@@ -6042,7 +6043,7 @@ async function El(e) {
|
|
|
6042
6043
|
}
|
|
6043
6044
|
async function Dl(e, t) {
|
|
6044
6045
|
await Il("failed to mute chat. User not logged in");
|
|
6045
|
-
let n = await Ll(`${Y().chatApiBaseUrl}/chats/${e}/settings/${(await
|
|
6046
|
+
let n = await Ll(`${Y().chatApiBaseUrl}/chats/${e}/settings/${(await q.getLoggedinUser())?.getUid?.()}`, {
|
|
6046
6047
|
method: "PATCH",
|
|
6047
6048
|
body: JSON.stringify({ mutedUntil: t })
|
|
6048
6049
|
});
|
|
@@ -6085,11 +6086,11 @@ function Pl() {
|
|
|
6085
6086
|
return e ? `bcc-chat:${Y().appId}:${e}` : null;
|
|
6086
6087
|
}
|
|
6087
6088
|
function Fl() {
|
|
6088
|
-
return
|
|
6089
|
+
return q.__bccCompatLoggedInUser ?? null;
|
|
6089
6090
|
}
|
|
6090
6091
|
async function Il(e) {
|
|
6091
|
-
let t = await
|
|
6092
|
-
if (
|
|
6092
|
+
let t = await q.getLoggedinUser();
|
|
6093
|
+
if (q.__bccCompatLoggedInUser = t ?? null, !t?.getUid?.()) throw Error(e);
|
|
6093
6094
|
return t;
|
|
6094
6095
|
}
|
|
6095
6096
|
async function Ll(e, t) {
|
|
@@ -6172,7 +6173,7 @@ async function iu(e) {
|
|
|
6172
6173
|
if (!Zl.has(e)) {
|
|
6173
6174
|
Zl.add(e);
|
|
6174
6175
|
try {
|
|
6175
|
-
let t = await
|
|
6176
|
+
let t = await q.getMessageReceipts(e);
|
|
6176
6177
|
Xl.value = {
|
|
6177
6178
|
...Xl.value,
|
|
6178
6179
|
[e]: ru(t)
|
|
@@ -6211,7 +6212,7 @@ var ou = n(() => $.value?.connected.value ?? !1), su = n(() => Ul.value && !ou.v
|
|
|
6211
6212
|
}),
|
|
6212
6213
|
onlineStatus: n(() => $.value ? $.value.offlineMode.value || !$.value.connected.value ? "offline" : "online" : "offline")
|
|
6213
6214
|
}, uu = w([]), du = "";
|
|
6214
|
-
|
|
6215
|
+
F([() => $.value?.conversations.value, () => nu.value], async () => {
|
|
6215
6216
|
let e = crypto.randomUUID();
|
|
6216
6217
|
du = e;
|
|
6217
6218
|
let t = nu.value;
|
|
@@ -6227,19 +6228,19 @@ I([() => $.value?.conversations.value, () => nu.value], async () => {
|
|
|
6227
6228
|
hasJoined: e.hasJoined ?? !0
|
|
6228
6229
|
})));
|
|
6229
6230
|
du === e && (uu.value = n);
|
|
6230
|
-
}),
|
|
6231
|
+
}), F(() => nu.value, () => {
|
|
6231
6232
|
Xl.value = {}, Zl.clear();
|
|
6232
6233
|
});
|
|
6233
6234
|
async function fu(e, t) {
|
|
6234
6235
|
Jl.value = t.loggerCallback, gt(t.language ?? "en"), eu(t.themeMode), e.use(H);
|
|
6235
6236
|
let n = e.config.globalProperties.$primevue;
|
|
6236
|
-
n && (n.config.ripple = !0, n.config.inputVariant = "filled"), e.
|
|
6237
|
+
n && (n.config.ripple = !0, n.config.inputVariant = "filled"), e.provide("theme", { theme: Bl });
|
|
6237
6238
|
let r = tu(t.environment);
|
|
6238
6239
|
$l(Hl.INFO, "Initializing chat", {
|
|
6239
6240
|
environment: t.environment,
|
|
6240
6241
|
language: ft.value,
|
|
6241
6242
|
themeMode: t.themeMode
|
|
6242
|
-
}), await r.init(), Ul.value = !0, Ql?.(), p(t.accessToken) ? Ql =
|
|
6243
|
+
}), await r.init(), Ul.value = !0, Ql?.(), p(t.accessToken) ? Ql = F(t.accessToken, async (e) => {
|
|
6243
6244
|
e ? await pu(e) : await mu();
|
|
6244
6245
|
}, { immediate: !0 }) : t.accessToken && await pu(t.accessToken), $l(Hl.INFO, "Chat initialized", { environment: Y().appId });
|
|
6245
6246
|
}
|
|
@@ -6283,7 +6284,7 @@ function Su(e) {
|
|
|
6283
6284
|
async function Cu(e, t = !1) {
|
|
6284
6285
|
if (!cu.value) return null;
|
|
6285
6286
|
try {
|
|
6286
|
-
return await
|
|
6287
|
+
return await q.getGroup(e);
|
|
6287
6288
|
} catch (e) {
|
|
6288
6289
|
if (e && typeof e == "object" && "code" in e && e.code === "ERR_GUID_NOT_FOUND") return;
|
|
6289
6290
|
if (t) throw e;
|
|
@@ -6300,7 +6301,7 @@ async function Tu(e) {
|
|
|
6300
6301
|
}
|
|
6301
6302
|
async function Eu(e) {
|
|
6302
6303
|
try {
|
|
6303
|
-
return cu.value && (await
|
|
6304
|
+
return cu.value && (await q.getOnlineGroupMemberCount([e]))[e] || 0;
|
|
6304
6305
|
} catch {
|
|
6305
6306
|
return 0;
|
|
6306
6307
|
}
|
|
@@ -6841,7 +6842,7 @@ function fd(e) {
|
|
|
6841
6842
|
return;
|
|
6842
6843
|
}
|
|
6843
6844
|
try {
|
|
6844
|
-
t.value = (await new
|
|
6845
|
+
t.value = (await new q.GroupMembersRequestBuilder(n).setLimit(50).build().fetchNext() ?? []).map((e) => ({
|
|
6845
6846
|
uid: e.getUid(),
|
|
6846
6847
|
displayName: e.getName(),
|
|
6847
6848
|
avatar: Qe(e.getAvatar?.()) ?? "",
|
|
@@ -6858,7 +6859,7 @@ function fd(e) {
|
|
|
6858
6859
|
uid: r.getUid(),
|
|
6859
6860
|
displayName: r.getName(),
|
|
6860
6861
|
avatar: Qe(r.getAvatar?.()) ?? "",
|
|
6861
|
-
role: a ?? r.getScope?.() ??
|
|
6862
|
+
role: a ?? r.getScope?.() ?? q.GROUP_MEMBER_SCOPE.PARTICIPANT
|
|
6862
6863
|
};
|
|
6863
6864
|
i === "add" ? t.value.some((e) => e.uid === c.uid) || (t.value = [...t.value, c]) : i === "remove" ? t.value = t.value.filter((e) => e.uid !== c.uid) : t.value = t.value.map((e) => e.uid === c.uid ? {
|
|
6864
6865
|
...e,
|
|
@@ -6866,7 +6867,7 @@ function fd(e) {
|
|
|
6866
6867
|
} : e), e.onMembersChanged(t.value);
|
|
6867
6868
|
}
|
|
6868
6869
|
return b(() => {
|
|
6869
|
-
|
|
6870
|
+
q.addGroupListener(n, new q.GroupListener({
|
|
6870
6871
|
onGroupMemberScopeChanged: (e, t, n, r, a) => {
|
|
6871
6872
|
i(a, t, "update", n);
|
|
6872
6873
|
},
|
|
@@ -6890,7 +6891,7 @@ function fd(e) {
|
|
|
6890
6891
|
}
|
|
6891
6892
|
}));
|
|
6892
6893
|
}), x(() => {
|
|
6893
|
-
|
|
6894
|
+
q.removeGroupListener(n);
|
|
6894
6895
|
}), {
|
|
6895
6896
|
groupMembers: t,
|
|
6896
6897
|
fetchGroupMembers: r
|
|
@@ -7148,14 +7149,14 @@ function Ed(e, t, r, i) {
|
|
|
7148
7149
|
getTriggers: () => f.value,
|
|
7149
7150
|
onChange: () => O()
|
|
7150
7151
|
});
|
|
7151
|
-
|
|
7152
|
+
F(() => i.getMentionCandidates?.(), () => {
|
|
7152
7153
|
T();
|
|
7153
7154
|
}, { deep: !0 });
|
|
7154
7155
|
function E(e) {
|
|
7155
7156
|
let t = Is(e);
|
|
7156
7157
|
return t.includes("<@uid:") ? Is(Pt(t, i.getMentionNameByUid?.() ?? {})) : t;
|
|
7157
7158
|
}
|
|
7158
|
-
|
|
7159
|
+
F(() => i.getModelValue(), (e) => {
|
|
7159
7160
|
let n = t.value, r = E(e);
|
|
7160
7161
|
if (r !== c.value) {
|
|
7161
7162
|
if (!n) {
|
|
@@ -7187,33 +7188,33 @@ function Ed(e, t, r, i) {
|
|
|
7187
7188
|
function M() {
|
|
7188
7189
|
return !j() || i.shouldClearSelectionOnLinkRequest?.();
|
|
7189
7190
|
}
|
|
7190
|
-
function
|
|
7191
|
+
function ee(e) {
|
|
7191
7192
|
let n = t.value;
|
|
7192
7193
|
return !!(e && n?.contains(e.commonAncestorContainer) && e.toString().trim());
|
|
7193
7194
|
}
|
|
7194
|
-
function
|
|
7195
|
+
function N(e) {
|
|
7195
7196
|
u = e.cloneRange();
|
|
7196
7197
|
}
|
|
7197
|
-
function
|
|
7198
|
+
function P() {
|
|
7198
7199
|
u = null;
|
|
7199
7200
|
}
|
|
7200
|
-
function
|
|
7201
|
-
return
|
|
7201
|
+
function I() {
|
|
7202
|
+
return ee(u) ? u?.cloneRange() ?? null : (P(), null);
|
|
7202
7203
|
}
|
|
7203
|
-
function
|
|
7204
|
+
function L() {
|
|
7204
7205
|
let e = window.getSelection(), n = t.value;
|
|
7205
7206
|
if (!e || !n || e.rangeCount === 0 || e.isCollapsed) return null;
|
|
7206
7207
|
let r = e.getRangeAt(0);
|
|
7207
|
-
return
|
|
7208
|
+
return ee(r) ? r : null;
|
|
7208
7209
|
}
|
|
7209
7210
|
function R() {
|
|
7210
|
-
return
|
|
7211
|
+
return L() ?? (M() ? I() : null);
|
|
7211
7212
|
}
|
|
7212
7213
|
function z(e) {
|
|
7213
7214
|
let t = window.getSelection();
|
|
7214
7215
|
t && (t.removeAllRanges(), t.addRange(e));
|
|
7215
7216
|
}
|
|
7216
|
-
function B(e =
|
|
7217
|
+
function B(e = L()) {
|
|
7217
7218
|
return e?.toString().trim() ?? "";
|
|
7218
7219
|
}
|
|
7219
7220
|
function V(e) {
|
|
@@ -7245,21 +7246,21 @@ function Ed(e, t, r, i) {
|
|
|
7245
7246
|
let n = e ? `${e.text}|${e.href ?? ""}|${e.rect.top}|${e.rect.left}|${e.rect.width}|${e.rect.height}` : "";
|
|
7246
7247
|
!t?.force && n === l.value || (l.value = n, i.onSelectionChange?.(e));
|
|
7247
7248
|
}
|
|
7248
|
-
function
|
|
7249
|
+
function W(e, t, n) {
|
|
7249
7250
|
return Math.min(Math.max(e, t), n);
|
|
7250
7251
|
}
|
|
7251
|
-
function
|
|
7252
|
+
function ne() {
|
|
7252
7253
|
return window.matchMedia?.("(pointer: coarse)").matches || window.matchMedia?.("(any-pointer: coarse)").matches || navigator.maxTouchPoints > 0;
|
|
7253
7254
|
}
|
|
7254
|
-
function
|
|
7255
|
+
function re(e, n) {
|
|
7255
7256
|
let r = t.value, i = e.getBoundingClientRect(), a = r?.getBoundingClientRect(), o = i.width || i.height ? i : a;
|
|
7256
7257
|
if (!o) return;
|
|
7257
|
-
let c =
|
|
7258
|
+
let c = ne(), l = c ? 248 : 176, u = c ? 48 : 180, d = c ? Td : 0, f = !c && !!n, p = f ? n.clientX : o.left + o.width / 2, m = f ? n.clientY : o.top, h = f ? n.clientY : o.bottom, g = l / 2 + 8, _ = W(p, g, Math.max(g, window.innerWidth - l / 2 - 8)), v = m - 6 - 8, y = window.innerHeight - h - 6 - 8;
|
|
7258
7259
|
if (!c && (y >= u || y >= v)) {
|
|
7259
7260
|
let e = Math.max(8, window.innerHeight - u - 8);
|
|
7260
7261
|
s.value = {
|
|
7261
7262
|
x: Math.round(_),
|
|
7262
|
-
y: Math.round(
|
|
7263
|
+
y: Math.round(W(h + 6, 8, e)),
|
|
7263
7264
|
placement: "below"
|
|
7264
7265
|
};
|
|
7265
7266
|
return;
|
|
@@ -7267,66 +7268,60 @@ function Ed(e, t, r, i) {
|
|
|
7267
7268
|
let b = u + 8, x = Math.max(b, window.innerHeight - 8 - d);
|
|
7268
7269
|
s.value = {
|
|
7269
7270
|
x: Math.round(_),
|
|
7270
|
-
y: Math.round(
|
|
7271
|
+
y: Math.round(W(m - 6 - d, b, x)),
|
|
7271
7272
|
placement: "above"
|
|
7272
7273
|
};
|
|
7273
7274
|
}
|
|
7274
|
-
function
|
|
7275
|
+
function ie(e) {
|
|
7275
7276
|
let n = R();
|
|
7276
|
-
return !t.value || !n ? !1 : (k(), z(n), document.execCommand("styleWithCSS", !1, "false"), document.execCommand(e, !1),
|
|
7277
|
+
return !t.value || !n ? !1 : (k(), z(n), document.execCommand("styleWithCSS", !1, "false"), document.execCommand(e, !1), N(n), O(), A(), !0);
|
|
7277
7278
|
}
|
|
7278
|
-
function
|
|
7279
|
+
function G() {
|
|
7279
7280
|
let e = R(), t = U(e);
|
|
7280
|
-
return !e || !t || !i.requestLink ? !1 : (d = e.cloneRange(), i.requestLink(t), (
|
|
7281
|
+
return !e || !t || !i.requestLink ? !1 : (d = e.cloneRange(), i.requestLink(t), (ne() || i.shouldClearSelectionOnLinkRequest?.()) && (window.getSelection()?.removeAllRanges(), te(null, { force: !0 })), A(), !0);
|
|
7281
7282
|
}
|
|
7282
|
-
function
|
|
7283
|
+
function K(e) {
|
|
7283
7284
|
for (let t of [...e.querySelectorAll("a")]) t.replaceWith(...t.childNodes);
|
|
7284
7285
|
}
|
|
7285
|
-
function
|
|
7286
|
+
function q(e) {
|
|
7286
7287
|
let t = window.getSelection();
|
|
7287
7288
|
if (!t) return;
|
|
7288
7289
|
let n = document.createRange();
|
|
7289
7290
|
n.setStartAfter(e), n.collapse(!0), t.removeAllRanges(), t.addRange(n);
|
|
7290
7291
|
}
|
|
7291
|
-
function
|
|
7292
|
+
function ae(e) {
|
|
7292
7293
|
let n = Vs(e), r = t.value, i = d ?? R();
|
|
7293
7294
|
if (!n || !r || !i || !r.contains(i.commonAncestorContainer)) return !1;
|
|
7294
7295
|
k(), z(i);
|
|
7295
7296
|
let a = document.createElement("a");
|
|
7296
7297
|
a.href = n, a.target = "_blank", a.rel = "noreferrer";
|
|
7297
7298
|
let o = i.extractContents();
|
|
7298
|
-
return
|
|
7299
|
+
return K(o), a.append(o), i.insertNode(a), q(a), d = null, P(), O(), A(), !0;
|
|
7299
7300
|
}
|
|
7300
|
-
function
|
|
7301
|
+
function oe() {
|
|
7301
7302
|
d = null;
|
|
7302
7303
|
}
|
|
7303
7304
|
function se() {
|
|
7304
|
-
x(),
|
|
7305
|
+
x(), P(), O();
|
|
7305
7306
|
}
|
|
7306
7307
|
function ce(e) {
|
|
7307
7308
|
if (!S(e)) {
|
|
7308
|
-
if (!i.isTouchUI?.()) {
|
|
7309
|
-
|
|
7310
|
-
|
|
7311
|
-
|
|
7312
|
-
|
|
7313
|
-
return;
|
|
7314
|
-
}
|
|
7315
|
-
if (t === "i") {
|
|
7316
|
-
e.preventDefault(), ae("italic");
|
|
7317
|
-
return;
|
|
7318
|
-
}
|
|
7319
|
-
if (t === "u") {
|
|
7320
|
-
e.preventDefault(), ae("underline");
|
|
7321
|
-
return;
|
|
7322
|
-
}
|
|
7323
|
-
if (t === "k") {
|
|
7324
|
-
e.preventDefault(), W();
|
|
7325
|
-
return;
|
|
7326
|
-
}
|
|
7309
|
+
if (!i.isTouchUI?.() && (e.ctrlKey || e.metaKey) && !e.shiftKey) {
|
|
7310
|
+
let t = e.key.toLowerCase();
|
|
7311
|
+
if (t === "b") {
|
|
7312
|
+
e.preventDefault(), ie("bold");
|
|
7313
|
+
return;
|
|
7327
7314
|
}
|
|
7328
|
-
if (
|
|
7329
|
-
e.preventDefault(),
|
|
7315
|
+
if (t === "i") {
|
|
7316
|
+
e.preventDefault(), ie("italic");
|
|
7317
|
+
return;
|
|
7318
|
+
}
|
|
7319
|
+
if (t === "u") {
|
|
7320
|
+
e.preventDefault(), ie("underline");
|
|
7321
|
+
return;
|
|
7322
|
+
}
|
|
7323
|
+
if (t === "k") {
|
|
7324
|
+
e.preventDefault(), G();
|
|
7330
7325
|
return;
|
|
7331
7326
|
}
|
|
7332
7327
|
}
|
|
@@ -7346,12 +7341,12 @@ function Ed(e, t, r, i) {
|
|
|
7346
7341
|
n && (document.execCommand("insertText", !1, n), O());
|
|
7347
7342
|
}
|
|
7348
7343
|
function ue(e) {
|
|
7349
|
-
let t =
|
|
7344
|
+
let t = L();
|
|
7350
7345
|
if (!t) {
|
|
7351
7346
|
A(), te(null);
|
|
7352
7347
|
return;
|
|
7353
7348
|
}
|
|
7354
|
-
|
|
7349
|
+
N(t), te(U(t)), j() && (e.button === 2 && e.preventDefault(), re(t, e), o.value = !0);
|
|
7355
7350
|
}
|
|
7356
7351
|
function de(t) {
|
|
7357
7352
|
let n = t.target;
|
|
@@ -7361,15 +7356,15 @@ function Ed(e, t, r, i) {
|
|
|
7361
7356
|
C(e), k();
|
|
7362
7357
|
}
|
|
7363
7358
|
function pe() {
|
|
7364
|
-
let e =
|
|
7359
|
+
let e = L();
|
|
7365
7360
|
if (!e) {
|
|
7366
7361
|
A(), te(null);
|
|
7367
7362
|
return;
|
|
7368
7363
|
}
|
|
7369
|
-
|
|
7364
|
+
N(e), te(U(e)), j() && (re(e), o.value = !0);
|
|
7370
7365
|
}
|
|
7371
7366
|
function me() {
|
|
7372
|
-
a.value += 1, A(), v(),
|
|
7367
|
+
a.value += 1, A(), v(), oe(), P(), c.value = "", i.updateModelValue("");
|
|
7373
7368
|
}
|
|
7374
7369
|
return b(() => {
|
|
7375
7370
|
document.addEventListener("pointerdown", de), document.addEventListener("selectionchange", pe), h(() => {
|
|
@@ -7381,9 +7376,9 @@ function Ed(e, t, r, i) {
|
|
|
7381
7376
|
}), y(() => {
|
|
7382
7377
|
document.removeEventListener("pointerdown", de), document.removeEventListener("selectionchange", pe);
|
|
7383
7378
|
}), {
|
|
7384
|
-
applyLink:
|
|
7385
|
-
applyFormat:
|
|
7386
|
-
cancelLink:
|
|
7379
|
+
applyLink: ae,
|
|
7380
|
+
applyFormat: ie,
|
|
7381
|
+
cancelLink: oe,
|
|
7387
7382
|
editorKey: a,
|
|
7388
7383
|
focusEditor: k,
|
|
7389
7384
|
formatMenuPosition: s,
|
|
@@ -7393,7 +7388,7 @@ function Ed(e, t, r, i) {
|
|
|
7393
7388
|
handlePaste: le,
|
|
7394
7389
|
hideFormatMenu: A,
|
|
7395
7390
|
resetEditor: me,
|
|
7396
|
-
requestLink:
|
|
7391
|
+
requestLink: G,
|
|
7397
7392
|
getSelectionState: U,
|
|
7398
7393
|
showFormatMenu: o,
|
|
7399
7394
|
triggerCandidates: p,
|
|
@@ -7459,7 +7454,7 @@ var Dd = ["data-testid", "onClick"], Od = { class: "composer-actions-menu__icon"
|
|
|
7459
7454
|
}), n({
|
|
7460
7455
|
toggle: p,
|
|
7461
7456
|
hide: m
|
|
7462
|
-
}), (t, n) =>
|
|
7457
|
+
}), (t, n) => L((S(), a("div", {
|
|
7463
7458
|
ref_key: "menuRef",
|
|
7464
7459
|
ref: l,
|
|
7465
7460
|
class: "composer-actions-menu",
|
|
@@ -7475,7 +7470,7 @@ var Dd = ["data-testid", "onClick"], Od = { class: "composer-actions-menu__icon"
|
|
|
7475
7470
|
class: "composer-actions-menu__item",
|
|
7476
7471
|
"data-testid": "composer-create-poll",
|
|
7477
7472
|
onClick: g
|
|
7478
|
-
}, [o("span", kd, [(S(), r(D(j(ce)), { class: "size-5" }))]), o("span", null, k(j(u)("createPoll")), 1)])], 512)), [[
|
|
7473
|
+
}, [o("span", kd, [(S(), r(D(j(ce)), { class: "size-5" }))]), o("span", null, k(j(u)("createPoll")), 1)])], 512)), [[P, c.value]]);
|
|
7479
7474
|
}
|
|
7480
7475
|
}), jd = (e, t) => {
|
|
7481
7476
|
let n = e.__vccOpts || e;
|
|
@@ -7587,9 +7582,9 @@ var Dd = ["data-testid", "onClick"], Od = { class: "composer-actions-menu__icon"
|
|
|
7587
7582
|
],
|
|
7588
7583
|
setup(e, { emit: t }) {
|
|
7589
7584
|
let s = 0, c = e, u = t, { t: d } = X(), f = `composer-link-url-${++s}`, p = w(""), m = w(!1), g = n(() => Vs(p.value)), _ = n(() => m.value && !g.value), v = n(() => !c.disabled && !!g.value);
|
|
7590
|
-
|
|
7585
|
+
F(() => c.visible, async (e) => {
|
|
7591
7586
|
e && (p.value = c.initialUrl ?? "", m.value = !1, await h(), document.querySelector(`[data-link-dialog-id="${f}"]`)?.focus());
|
|
7592
|
-
}),
|
|
7587
|
+
}), F(() => c.initialUrl, (e) => {
|
|
7593
7588
|
c.visible && (p.value = e ?? "", m.value = !1);
|
|
7594
7589
|
});
|
|
7595
7590
|
function y() {
|
|
@@ -7606,7 +7601,7 @@ var Dd = ["data-testid", "onClick"], Od = { class: "composer-actions-menu__icon"
|
|
|
7606
7601
|
draggable: !1,
|
|
7607
7602
|
"onUpdate:visible": b
|
|
7608
7603
|
}, {
|
|
7609
|
-
footer:
|
|
7604
|
+
footer: I(() => [l(j(V), {
|
|
7610
7605
|
label: j(d)("cancel"),
|
|
7611
7606
|
severity: "secondary",
|
|
7612
7607
|
onClick: b
|
|
@@ -7620,9 +7615,9 @@ var Dd = ["data-testid", "onClick"], Od = { class: "composer-actions-menu__icon"
|
|
|
7620
7615
|
"icon",
|
|
7621
7616
|
"disabled"
|
|
7622
7617
|
])]),
|
|
7623
|
-
default:
|
|
7618
|
+
default: I(() => [o("div", Jd, [e.selectedText ? (S(), a("p", Yd, k(e.selectedText), 1)) : i("", !0), o("div", Xd, [
|
|
7624
7619
|
o("label", Zd, k(j(d)("linkUrl")), 1),
|
|
7625
|
-
l(j(
|
|
7620
|
+
l(j(ne), {
|
|
7626
7621
|
modelValue: p.value,
|
|
7627
7622
|
"onUpdate:modelValue": n[0] ||= (e) => p.value = e,
|
|
7628
7623
|
type: "url",
|
|
@@ -7684,7 +7679,7 @@ var Dd = ["data-testid", "onClick"], Od = { class: "composer-actions-menu__icon"
|
|
|
7684
7679
|
draggable: !1,
|
|
7685
7680
|
"onUpdate:visible": y
|
|
7686
7681
|
}, {
|
|
7687
|
-
footer:
|
|
7682
|
+
footer: I(() => [l(j(V), {
|
|
7688
7683
|
label: j(d)("cancel"),
|
|
7689
7684
|
severity: "secondary",
|
|
7690
7685
|
onClick: y
|
|
@@ -7698,7 +7693,7 @@ var Dd = ["data-testid", "onClick"], Od = { class: "composer-actions-menu__icon"
|
|
|
7698
7693
|
"icon",
|
|
7699
7694
|
"disabled"
|
|
7700
7695
|
])]),
|
|
7701
|
-
default:
|
|
7696
|
+
default: I(() => [o("div", ef, [o("div", tf, [o("label", nf, k(j(d)("question")), 1), l(j(ne), {
|
|
7702
7697
|
modelValue: f.value,
|
|
7703
7698
|
"onUpdate:modelValue": i[0] ||= (e) => f.value = e,
|
|
7704
7699
|
fluid: "",
|
|
@@ -7708,7 +7703,7 @@ var Dd = ["data-testid", "onClick"], Od = { class: "composer-actions-menu__icon"
|
|
|
7708
7703
|
(S(!0), a(e, null, T(p.value, (e, t) => (S(), a("div", {
|
|
7709
7704
|
key: t,
|
|
7710
7705
|
class: "center"
|
|
7711
|
-
}, [l(j(
|
|
7706
|
+
}, [l(j(ne), {
|
|
7712
7707
|
"model-value": e,
|
|
7713
7708
|
class: "poll-dialog-input w-full",
|
|
7714
7709
|
placeholder: j(d)("option", { index: t + 1 }),
|
|
@@ -7731,7 +7726,7 @@ var Dd = ["data-testid", "onClick"], Od = { class: "composer-actions-menu__icon"
|
|
|
7731
7726
|
])]))), 128)),
|
|
7732
7727
|
l(j(V), {
|
|
7733
7728
|
label: j(d)("addOption"),
|
|
7734
|
-
icon: j(
|
|
7729
|
+
icon: j(ae),
|
|
7735
7730
|
text: "",
|
|
7736
7731
|
onClick: h
|
|
7737
7732
|
}, null, 8, ["label", "icon"])
|
|
@@ -7783,7 +7778,7 @@ var Dd = ["data-testid", "onClick"], Od = { class: "composer-actions-menu__icon"
|
|
|
7783
7778
|
draggable: !1,
|
|
7784
7779
|
"onUpdate:visible": b
|
|
7785
7780
|
}, {
|
|
7786
|
-
footer:
|
|
7781
|
+
footer: I(() => [l(j(V), {
|
|
7787
7782
|
label: j(c)("cancel"),
|
|
7788
7783
|
severity: "secondary",
|
|
7789
7784
|
onClick: b
|
|
@@ -7797,12 +7792,12 @@ var Dd = ["data-testid", "onClick"], Od = { class: "composer-actions-menu__icon"
|
|
|
7797
7792
|
"icon",
|
|
7798
7793
|
"disabled"
|
|
7799
7794
|
])]),
|
|
7800
|
-
default:
|
|
7795
|
+
default: I(() => [o("div", sf, [o("div", cf, [o("label", lf, k(j(c)("sendAt")), 1), o("div", uf, [l(j(W), {
|
|
7801
7796
|
modelValue: u.value,
|
|
7802
7797
|
"onUpdate:modelValue": n[0] ||= (e) => u.value = e,
|
|
7803
7798
|
class: "w-full flex-1",
|
|
7804
7799
|
type: "date"
|
|
7805
|
-
}, null, 8, ["modelValue"]), l(j(
|
|
7800
|
+
}, null, 8, ["modelValue"]), l(j(W), {
|
|
7806
7801
|
modelValue: d.value,
|
|
7807
7802
|
"onUpdate:modelValue": n[1] ||= (e) => d.value = e,
|
|
7808
7803
|
type: "time",
|
|
@@ -7908,7 +7903,7 @@ var Dd = ["data-testid", "onClick"], Od = { class: "composer-actions-menu__icon"
|
|
|
7908
7903
|
video: "video/*",
|
|
7909
7904
|
audio: "audio/*",
|
|
7910
7905
|
file: "*/*"
|
|
7911
|
-
}, u = e, d = s, f = w(null), m = w(null), _ = w(null), v = w("file"), y = w(!1), b = w(!1), x = w(!1), C = w(""), T = w(""), E = w(!1), { t: D } = X(), { isTouchUI: O } = vd(), A = null, M = w(null),
|
|
7906
|
+
}, u = e, d = s, f = w(null), m = w(null), _ = w(null), v = w("file"), y = w(!1), b = w(!1), x = w(!1), C = w(""), T = w(""), E = w(!1), { t: D } = X(), { isTouchUI: O } = vd(), A = null, M = w(null), ee = w(null), N = w(null), { applyLink: P, applyFormat: I, cancelLink: L, editorKey: R, formatMenuPosition: B, focusEditor: H, handleContextMenu: U, handleInput: te, handleKeydown: W, handlePaste: ne, hideFormatMenu: re, getSelectionState: ie, requestLink: G, resetEditor: q, showFormatMenu: oe, triggerCandidates: se, triggerMenuPosition: ce, highlightedTriggerIndex: le, showTriggerMenu: fe, selectTriggerCandidate: pe } = Ed(M, ee, N, {
|
|
7912
7907
|
getModelValue: () => u.modelValue,
|
|
7913
7908
|
updateModelValue: (e) => d("update:modelValue", e),
|
|
7914
7909
|
submit: () => Le(),
|
|
@@ -7933,8 +7928,8 @@ var Dd = ["data-testid", "onClick"], Od = { class: "composer-actions-menu__icon"
|
|
|
7933
7928
|
default: return D("attachment");
|
|
7934
7929
|
}
|
|
7935
7930
|
}), ve = n(() => !u.editingMessage && !u.replyToMessage ? "" : u.compact ? "pt-1" : "pt-1.5"), ye = n(() => ec(u.modelValue) || !!_.value), be = n(() => ye.value && he.value !== "file"), xe = n(() => _.value ? D("attachmentSummary", { name: _.value.name }) : tc(u.modelValue) || D("currentDraftWillBeScheduled"));
|
|
7936
|
-
|
|
7937
|
-
|
|
7931
|
+
F(() => u.resetSignal, () => {
|
|
7932
|
+
q(), _.value = null, y.value = !1, b.value = !1, x.value = !1, L(), f.value && (f.value.value = "");
|
|
7938
7933
|
});
|
|
7939
7934
|
async function Se() {
|
|
7940
7935
|
await h(), H();
|
|
@@ -7964,7 +7959,7 @@ var Dd = ["data-testid", "onClick"], Od = { class: "composer-actions-menu__icon"
|
|
|
7964
7959
|
e.preventDefault(), _.value = t, Ce();
|
|
7965
7960
|
return;
|
|
7966
7961
|
}
|
|
7967
|
-
|
|
7962
|
+
ne(e);
|
|
7968
7963
|
}
|
|
7969
7964
|
function De(e) {
|
|
7970
7965
|
if (u.formattingMode === "external") {
|
|
@@ -7974,25 +7969,25 @@ var Dd = ["data-testid", "onClick"], Od = { class: "composer-actions-menu__icon"
|
|
|
7974
7969
|
T.value = e.text, C.value = e.href ?? "", x.value = !0;
|
|
7975
7970
|
}
|
|
7976
7971
|
function Oe(e) {
|
|
7977
|
-
return
|
|
7972
|
+
return I(e);
|
|
7978
7973
|
}
|
|
7979
7974
|
function ke() {
|
|
7980
|
-
return
|
|
7975
|
+
return G();
|
|
7981
7976
|
}
|
|
7982
7977
|
function Ae(e) {
|
|
7983
|
-
return
|
|
7978
|
+
return P(e);
|
|
7984
7979
|
}
|
|
7985
7980
|
function je() {
|
|
7986
|
-
|
|
7981
|
+
L();
|
|
7987
7982
|
}
|
|
7988
7983
|
function Me() {
|
|
7989
|
-
return
|
|
7984
|
+
return ie();
|
|
7990
7985
|
}
|
|
7991
7986
|
function Pe(e) {
|
|
7992
|
-
|
|
7987
|
+
P(e) && (x.value = !1);
|
|
7993
7988
|
}
|
|
7994
7989
|
function J() {
|
|
7995
|
-
|
|
7990
|
+
L();
|
|
7996
7991
|
}
|
|
7997
7992
|
function Fe() {
|
|
7998
7993
|
_.value = null, f.value && (f.value.value = "");
|
|
@@ -8099,7 +8094,7 @@ var Dd = ["data-testid", "onClick"], Od = { class: "composer-actions-menu__icon"
|
|
|
8099
8094
|
disabled: e.disabled || !!e.editingMessage,
|
|
8100
8095
|
"aria-label": j(D)("addToMessage"),
|
|
8101
8096
|
"data-testid": "composer-actions-button",
|
|
8102
|
-
icon: j(
|
|
8097
|
+
icon: j(ae),
|
|
8103
8098
|
onClick: Ie
|
|
8104
8099
|
}, null, 8, [
|
|
8105
8100
|
"class",
|
|
@@ -8110,21 +8105,21 @@ var Dd = ["data-testid", "onClick"], Od = { class: "composer-actions-menu__icon"
|
|
|
8110
8105
|
(S(), a("div", {
|
|
8111
8106
|
key: j(R),
|
|
8112
8107
|
ref_key: "composerEditorRef",
|
|
8113
|
-
ref:
|
|
8108
|
+
ref: ee,
|
|
8114
8109
|
contenteditable: "true",
|
|
8115
8110
|
role: "textbox",
|
|
8116
8111
|
"aria-multiline": "true",
|
|
8117
8112
|
"data-placeholder": j(D)("writeMessage"),
|
|
8118
8113
|
class: g(["composer-editor", e.disabled ? "pointer-events-none opacity-60" : ""]),
|
|
8119
|
-
onFocus: n[3] ||= (...e) => j(
|
|
8114
|
+
onFocus: n[3] ||= (...e) => j(re) && j(re)(...e),
|
|
8120
8115
|
onInput: n[4] ||= (...e) => j(te) && j(te)(...e),
|
|
8121
8116
|
onKeyup: n[5] ||= (...e) => j(te) && j(te)(...e),
|
|
8122
|
-
onKeydown: n[6] ||= (...e) => j(
|
|
8117
|
+
onKeydown: n[6] ||= (...e) => j(W) && j(W)(...e),
|
|
8123
8118
|
onPaste: Ee,
|
|
8124
8119
|
onContextmenu: n[7] ||= (...e) => j(U) && j(U)(...e)
|
|
8125
8120
|
}, null, 42, Tf)),
|
|
8126
8121
|
_.value || e.editingMessage || e.contextLabel || e.offlineMode ? (S(), a("div", Ef, [
|
|
8127
|
-
e.editingMessage ? (S(), r(j(
|
|
8122
|
+
e.editingMessage ? (S(), r(j(K), {
|
|
8128
8123
|
key: 0,
|
|
8129
8124
|
text: j(D)("editing"),
|
|
8130
8125
|
context: "info",
|
|
@@ -8132,7 +8127,7 @@ var Dd = ["data-testid", "onClick"], Od = { class: "composer-actions-menu__icon"
|
|
|
8132
8127
|
size: "sm",
|
|
8133
8128
|
class: "composer-meta-tag"
|
|
8134
8129
|
}, null, 8, ["text"])) : i("", !0),
|
|
8135
|
-
e.contextLabel ? (S(), r(j(
|
|
8130
|
+
e.contextLabel ? (S(), r(j(K), {
|
|
8136
8131
|
key: 1,
|
|
8137
8132
|
text: e.contextLabel,
|
|
8138
8133
|
context: "contrast",
|
|
@@ -8182,10 +8177,10 @@ var Dd = ["data-testid", "onClick"], Od = { class: "composer-actions-menu__icon"
|
|
|
8182
8177
|
], 2),
|
|
8183
8178
|
e.formattingMode === "external" ? i("", !0) : (S(), r(qd, {
|
|
8184
8179
|
key: 1,
|
|
8185
|
-
visible: j(
|
|
8180
|
+
visible: j(oe),
|
|
8186
8181
|
position: j(B),
|
|
8187
|
-
onFormat: n[9] ||= (e) => j(
|
|
8188
|
-
onLink: j(
|
|
8182
|
+
onFormat: n[9] ||= (e) => j(I)(e),
|
|
8183
|
+
onLink: j(G)
|
|
8189
8184
|
}, null, 8, [
|
|
8190
8185
|
"visible",
|
|
8191
8186
|
"position",
|
|
@@ -8193,7 +8188,7 @@ var Dd = ["data-testid", "onClick"], Od = { class: "composer-actions-menu__icon"
|
|
|
8193
8188
|
])),
|
|
8194
8189
|
l(vf, {
|
|
8195
8190
|
ref_key: "triggerMenuRef",
|
|
8196
|
-
ref:
|
|
8191
|
+
ref: N,
|
|
8197
8192
|
"highlighted-index": j(le),
|
|
8198
8193
|
"onUpdate:highlightedIndex": n[10] ||= (e) => p(le) ? le.value = e : null,
|
|
8199
8194
|
visible: j(fe),
|
|
@@ -8290,55 +8285,55 @@ var Dd = ["data-testid", "onClick"], Od = { class: "composer-actions-menu__icon"
|
|
|
8290
8285
|
function M() {
|
|
8291
8286
|
m.emit("composer:cancelReply");
|
|
8292
8287
|
}
|
|
8293
|
-
function
|
|
8288
|
+
function ee() {
|
|
8294
8289
|
m.emit("composer:cancelEdit");
|
|
8295
8290
|
}
|
|
8296
|
-
function
|
|
8291
|
+
function N(e) {
|
|
8297
8292
|
return {
|
|
8298
8293
|
...e,
|
|
8299
8294
|
target: s.target
|
|
8300
8295
|
};
|
|
8301
8296
|
}
|
|
8302
|
-
function
|
|
8303
|
-
c("composerSelectionChange", e ?
|
|
8297
|
+
function P(e) {
|
|
8298
|
+
c("composerSelectionChange", e ? N(e) : null);
|
|
8304
8299
|
}
|
|
8305
|
-
function
|
|
8306
|
-
c("composerLinkRequest",
|
|
8300
|
+
function F(e) {
|
|
8301
|
+
c("composerLinkRequest", N(e));
|
|
8307
8302
|
}
|
|
8308
|
-
let
|
|
8303
|
+
let I = w(null);
|
|
8309
8304
|
dd(m, "ui:closeComposerActions", () => {
|
|
8310
|
-
|
|
8305
|
+
I.value?.hideComposerActions();
|
|
8311
8306
|
});
|
|
8312
|
-
async function
|
|
8313
|
-
await
|
|
8307
|
+
async function L() {
|
|
8308
|
+
await I.value?.focusEditor();
|
|
8314
8309
|
}
|
|
8315
8310
|
function R(e) {
|
|
8316
|
-
return
|
|
8311
|
+
return I.value?.applyComposerFormat(e) ?? !1;
|
|
8317
8312
|
}
|
|
8318
8313
|
function z() {
|
|
8319
|
-
return
|
|
8314
|
+
return I.value?.requestComposerLink() ?? !1;
|
|
8320
8315
|
}
|
|
8321
8316
|
function B(e) {
|
|
8322
|
-
return
|
|
8317
|
+
return I.value?.applyComposerLink(e) ?? !1;
|
|
8323
8318
|
}
|
|
8324
8319
|
function V() {
|
|
8325
|
-
|
|
8320
|
+
I.value?.cancelComposerLink();
|
|
8326
8321
|
}
|
|
8327
8322
|
function H() {
|
|
8328
|
-
let e =
|
|
8329
|
-
return e ?
|
|
8323
|
+
let e = I.value?.getComposerSelection() ?? null;
|
|
8324
|
+
return e ? N(e) : null;
|
|
8330
8325
|
}
|
|
8331
8326
|
return t({
|
|
8332
8327
|
applyComposerFormat: R,
|
|
8333
8328
|
applyComposerLink: B,
|
|
8334
8329
|
cancelComposerLink: V,
|
|
8335
|
-
focusEditor:
|
|
8330
|
+
focusEditor: L,
|
|
8336
8331
|
getComposerSelection: H,
|
|
8337
8332
|
requestComposerLink: z
|
|
8338
8333
|
}), (t, n) => x.value ? (S(), r(kf, {
|
|
8339
8334
|
key: 0,
|
|
8340
8335
|
ref_key: "composerRef",
|
|
8341
|
-
ref:
|
|
8336
|
+
ref: I,
|
|
8342
8337
|
"model-value": g.value,
|
|
8343
8338
|
disabled: b.value,
|
|
8344
8339
|
"reset-signal": _.value,
|
|
@@ -8359,9 +8354,9 @@ var Dd = ["data-testid", "onClick"], Od = { class: "composer-actions-menu__icon"
|
|
|
8359
8354
|
onScheduleMessage: O,
|
|
8360
8355
|
onOpenScheduled: A,
|
|
8361
8356
|
onCancelReply: M,
|
|
8362
|
-
onCancelEdit:
|
|
8363
|
-
onComposerSelectionChange:
|
|
8364
|
-
onComposerLinkRequest:
|
|
8357
|
+
onCancelEdit: ee,
|
|
8358
|
+
onComposerSelectionChange: P,
|
|
8359
|
+
onComposerLinkRequest: F
|
|
8365
8360
|
}, null, 8, [
|
|
8366
8361
|
"model-value",
|
|
8367
8362
|
"disabled",
|
|
@@ -8549,7 +8544,7 @@ function Nf(e) {
|
|
|
8549
8544
|
};
|
|
8550
8545
|
}
|
|
8551
8546
|
}
|
|
8552
|
-
function
|
|
8547
|
+
function ee(t) {
|
|
8553
8548
|
if (!l(t)) return null;
|
|
8554
8549
|
let n = j(t), r = e.isLoadingMessageReceipts?.(t) ?? !1;
|
|
8555
8550
|
if (!n) return !t.receipts.readAt || !r ? null : {
|
|
@@ -8564,7 +8559,7 @@ function Nf(e) {
|
|
|
8564
8559
|
loading: r
|
|
8565
8560
|
} : null;
|
|
8566
8561
|
}
|
|
8567
|
-
function
|
|
8562
|
+
function N(t) {
|
|
8568
8563
|
return [
|
|
8569
8564
|
{
|
|
8570
8565
|
key: "reply",
|
|
@@ -8622,8 +8617,8 @@ function Nf(e) {
|
|
|
8622
8617
|
reactToMessage: S,
|
|
8623
8618
|
toggleInlineReaction: C,
|
|
8624
8619
|
loadReceiptPreview: M,
|
|
8625
|
-
getReceiptSummaryAction:
|
|
8626
|
-
getActionItems:
|
|
8620
|
+
getReceiptSummaryAction: ee,
|
|
8621
|
+
getActionItems: N
|
|
8627
8622
|
};
|
|
8628
8623
|
}
|
|
8629
8624
|
//#endregion
|
|
@@ -8686,7 +8681,7 @@ function zf(e) {
|
|
|
8686
8681
|
let s = o < r, c = Math.max(0, a.scrollHeight - o - a.clientHeight);
|
|
8687
8682
|
s && c > Pf ? n = !1 : c <= Ff && (n = !0), r = o, a.scrollTop <= If && !e.isLoading() && !e.isLoadingOlder() && e.canLoadOlder() && e.onLoadOlder();
|
|
8688
8683
|
}
|
|
8689
|
-
return
|
|
8684
|
+
return F(() => {
|
|
8690
8685
|
let t = e.getMessages();
|
|
8691
8686
|
return {
|
|
8692
8687
|
conversationId: e.getConversation()?.id ?? null,
|
|
@@ -8837,7 +8832,7 @@ var Uf = { class: "w-full" }, Wf = {
|
|
|
8837
8832
|
closable: !0,
|
|
8838
8833
|
"onUpdate:visible": s
|
|
8839
8834
|
}, {
|
|
8840
|
-
default:
|
|
8835
|
+
default: I(() => [o("div", Uf, [E(t.$slots, "default")]), t.$slots.footer ? (S(), a("div", Wf, [E(t.$slots, "footer")])) : i("", !0)]),
|
|
8841
8836
|
_: 3
|
|
8842
8837
|
}, 8, ["visible", "header"]));
|
|
8843
8838
|
}
|
|
@@ -8864,15 +8859,15 @@ var Uf = { class: "w-full" }, Wf = {
|
|
|
8864
8859
|
props: { attachment: {} },
|
|
8865
8860
|
emits: ["close"],
|
|
8866
8861
|
setup(t, { emit: s }) {
|
|
8867
|
-
let c = t, l = s, u = w(null), d = w(null), f = n(() => !!c.attachment?.url), p = n(() => c.attachment?.kind === "image"), m = n(() => c.attachment?.kind === "video"), h = n(() => c.attachment?.kind === "audio"), { t: _ } = X(), { scale: y, translateX: b, translateY: x, isDragging: C, resetTransform: T, handlePointerDown: E, handlePointerMove: O, handlePointerUp: A, handlePointerCancel: M, handleWheel:
|
|
8862
|
+
let c = t, l = s, u = w(null), d = w(null), f = n(() => !!c.attachment?.url), p = n(() => c.attachment?.kind === "image"), m = n(() => c.attachment?.kind === "video"), h = n(() => c.attachment?.kind === "audio"), { t: _ } = X(), { scale: y, translateX: b, translateY: x, isDragging: C, resetTransform: T, handlePointerDown: E, handlePointerMove: O, handlePointerUp: A, handlePointerCancel: M, handleWheel: ee, handleDoubleClick: N } = Hf({
|
|
8868
8863
|
viewportRef: u,
|
|
8869
8864
|
imageRef: d,
|
|
8870
8865
|
isImage: () => p.value
|
|
8871
8866
|
});
|
|
8872
|
-
|
|
8867
|
+
F(() => c.attachment?.url, () => {
|
|
8873
8868
|
T();
|
|
8874
8869
|
});
|
|
8875
|
-
function
|
|
8870
|
+
function P() {
|
|
8876
8871
|
l("close");
|
|
8877
8872
|
}
|
|
8878
8873
|
return (n, s) => (S(), r(Gf, {
|
|
@@ -8881,9 +8876,9 @@ var Uf = { class: "w-full" }, Wf = {
|
|
|
8881
8876
|
subtitle: t.attachment?.kind || "",
|
|
8882
8877
|
"close-label": j(_)("close"),
|
|
8883
8878
|
"close-aria-label": j(_)("closeMediaViewer"),
|
|
8884
|
-
onClose:
|
|
8879
|
+
onClose: P
|
|
8885
8880
|
}, {
|
|
8886
|
-
actions:
|
|
8881
|
+
actions: I(() => [t.attachment?.url ? (S(), a("a", {
|
|
8887
8882
|
key: 0,
|
|
8888
8883
|
href: t.attachment.url,
|
|
8889
8884
|
target: "_blank",
|
|
@@ -8893,8 +8888,8 @@ var Uf = { class: "w-full" }, Wf = {
|
|
|
8893
8888
|
class: "size-4",
|
|
8894
8889
|
"aria-hidden": "true"
|
|
8895
8890
|
})), o("span", null, k(j(_)("openInNewTab")), 1)], 8, Kf)) : i("", !0)]),
|
|
8896
|
-
footer:
|
|
8897
|
-
default:
|
|
8891
|
+
footer: I(() => [t.attachment ? (S(), a("div", tp, [o("div", np, [o("p", rp, k(t.attachment.name), 1), o("p", ip, k(t.attachment.kind), 1)])])) : i("", !0)]),
|
|
8892
|
+
default: I(() => [o("div", qf, [t.attachment?.url ? (S(), a(e, { key: 0 }, [p.value ? (S(), a("div", {
|
|
8898
8893
|
key: 0,
|
|
8899
8894
|
ref_key: "viewportRef",
|
|
8900
8895
|
ref: u,
|
|
@@ -8904,8 +8899,8 @@ var Uf = { class: "w-full" }, Wf = {
|
|
|
8904
8899
|
onPointerup: s[2] ||= (...e) => j(A) && j(A)(...e),
|
|
8905
8900
|
onPointercancel: s[3] ||= (...e) => j(M) && j(M)(...e),
|
|
8906
8901
|
onPointerleave: s[4] ||= (...e) => j(A) && j(A)(...e),
|
|
8907
|
-
onWheel: s[5] ||= (...e) => j(
|
|
8908
|
-
onDblclick: s[6] ||= (...e) => j(
|
|
8902
|
+
onWheel: s[5] ||= (...e) => j(ee) && j(ee)(...e),
|
|
8903
|
+
onDblclick: s[6] ||= (...e) => j(N) && j(N)(...e)
|
|
8909
8904
|
}, [o("img", {
|
|
8910
8905
|
ref_key: "imageRef",
|
|
8911
8906
|
ref: d,
|
|
@@ -8985,7 +8980,7 @@ var Uf = { class: "w-full" }, Wf = {
|
|
|
8985
8980
|
return t.url;
|
|
8986
8981
|
}
|
|
8987
8982
|
});
|
|
8988
|
-
|
|
8983
|
+
F(() => t.url, async (e) => {
|
|
8989
8984
|
if (r.value = null, s.value = !1, !(!e || typeof window > "u")) {
|
|
8990
8985
|
if (p(e)) {
|
|
8991
8986
|
r.value = {
|
|
@@ -9267,7 +9262,7 @@ var Uf = { class: "w-full" }, Wf = {
|
|
|
9267
9262
|
function l() {
|
|
9268
9263
|
return t.message.senderName?.trim() || (t.message.isOwn ? s("you") : s("system"));
|
|
9269
9264
|
}
|
|
9270
|
-
return (t, n) => (S(), a("div", Gp, [o("span", Kp, k(l()), 1), e.message.scheduled?.scheduleDate ? (S(), r(j(
|
|
9265
|
+
return (t, n) => (S(), a("div", Gp, [o("span", Kp, k(l()), 1), e.message.scheduled?.scheduleDate ? (S(), r(j(K), {
|
|
9271
9266
|
key: 0,
|
|
9272
9267
|
text: j(s)("scheduledDateLabel", { date: c(e.message.scheduled.scheduleDate) }),
|
|
9273
9268
|
context: "warn",
|
|
@@ -9444,8 +9439,8 @@ var Uf = { class: "w-full" }, Wf = {
|
|
|
9444
9439
|
function y(e) {
|
|
9445
9440
|
m(e.target) || u("tap", e);
|
|
9446
9441
|
}
|
|
9447
|
-
let b =
|
|
9448
|
-
|
|
9442
|
+
let b = ee("originalBubble"), x = w("0px");
|
|
9443
|
+
F(() => c.contextMenuOpen && c.isTouchUi, async (e) => {
|
|
9449
9444
|
if (!e || (await h(), !b.value)) return;
|
|
9450
9445
|
let t = b.value.getBoundingClientRect(), n = Math.min(t.top, window.innerHeight - 50 - t.height);
|
|
9451
9446
|
x.value = `${Math.max(0, n - 32)}px`;
|
|
@@ -9586,7 +9581,7 @@ var Uf = { class: "w-full" }, Wf = {
|
|
|
9586
9581
|
emits: ["react"],
|
|
9587
9582
|
setup(t, { emit: s }) {
|
|
9588
9583
|
let c = t, l = s, u = w(!1);
|
|
9589
|
-
|
|
9584
|
+
F(() => c.message.id, () => {
|
|
9590
9585
|
u.value = !1;
|
|
9591
9586
|
});
|
|
9592
9587
|
let d = n(() => ym);
|
|
@@ -9661,53 +9656,53 @@ var Uf = { class: "w-full" }, Wf = {
|
|
|
9661
9656
|
top: f
|
|
9662
9657
|
};
|
|
9663
9658
|
}
|
|
9664
|
-
async function
|
|
9659
|
+
async function ee(e, t, n) {
|
|
9665
9660
|
D = n ?? A(e), O = t ?? null, !(!D && !O) && (C.value = "actions", x.value = !0, await h(), await M());
|
|
9666
9661
|
}
|
|
9667
|
-
function
|
|
9662
|
+
function N() {
|
|
9668
9663
|
x.value && (x.value = !1, C.value = "actions", D = null, O = null, _("hide"));
|
|
9669
9664
|
}
|
|
9670
|
-
async function
|
|
9665
|
+
async function P() {
|
|
9671
9666
|
!d.receiptSummaryAction || d.receiptSummaryAction.loading || !d.receiptSummaryAction.receipts.length || (C.value = "receipts", await h(), await M());
|
|
9672
9667
|
}
|
|
9673
|
-
async function
|
|
9668
|
+
async function F() {
|
|
9674
9669
|
C.value = "actions", await h(), await M();
|
|
9675
9670
|
}
|
|
9676
|
-
function
|
|
9671
|
+
function I(e) {
|
|
9677
9672
|
return e ? new Intl.DateTimeFormat(m.value, {
|
|
9678
9673
|
dateStyle: "medium",
|
|
9679
9674
|
timeStyle: "short",
|
|
9680
9675
|
hourCycle: ht()
|
|
9681
9676
|
}).format(e) : "";
|
|
9682
9677
|
}
|
|
9683
|
-
function
|
|
9678
|
+
function L(e) {
|
|
9684
9679
|
if (!x.value) return;
|
|
9685
9680
|
let t = e.target;
|
|
9686
9681
|
if (!b.value?.contains(t)) {
|
|
9687
9682
|
if (D) {
|
|
9688
9683
|
if (D.closest(".message-item")?.contains(t) && t instanceof HTMLElement && (t.classList.contains("message-bubble--spotlight") || t.classList.contains("message-bubble-wrapper"))) {
|
|
9689
9684
|
setTimeout(() => {
|
|
9690
|
-
|
|
9685
|
+
N();
|
|
9691
9686
|
}, 100);
|
|
9692
9687
|
return;
|
|
9693
9688
|
}
|
|
9694
9689
|
if (D?.contains(t) || D.closest(".message-item")?.contains(t)) return;
|
|
9695
9690
|
}
|
|
9696
|
-
|
|
9691
|
+
N();
|
|
9697
9692
|
}
|
|
9698
9693
|
}
|
|
9699
9694
|
function R(e) {
|
|
9700
|
-
e.key === "Escape" &&
|
|
9695
|
+
e.key === "Escape" && N();
|
|
9701
9696
|
}
|
|
9702
9697
|
function z(e) {
|
|
9703
9698
|
let t = e?.target;
|
|
9704
|
-
e?.type === "scroll" && t instanceof Node && b.value?.contains(t) ||
|
|
9699
|
+
e?.type === "scroll" && t instanceof Node && b.value?.contains(t) || N();
|
|
9705
9700
|
}
|
|
9706
|
-
return typeof window < "u" && (document.addEventListener("pointerdown",
|
|
9707
|
-
typeof window > "u" || (document.removeEventListener("pointerdown",
|
|
9701
|
+
return typeof window < "u" && (document.addEventListener("pointerdown", L, !0), document.addEventListener("keydown", R), window.addEventListener("resize", z), window.addEventListener("scroll", z, !0)), y(() => {
|
|
9702
|
+
typeof window > "u" || (document.removeEventListener("pointerdown", L, !0), document.removeEventListener("keydown", R), window.removeEventListener("resize", z), window.removeEventListener("scroll", z, !0));
|
|
9708
9703
|
}), c({
|
|
9709
|
-
show:
|
|
9710
|
-
hide:
|
|
9704
|
+
show: ee,
|
|
9705
|
+
hide: N,
|
|
9711
9706
|
visible: n(() => x.value)
|
|
9712
9707
|
}), (n, c) => (S(), r(t, { to: "body" }, [x.value && s.message ? (S(), a("div", {
|
|
9713
9708
|
key: 0,
|
|
@@ -9728,9 +9723,9 @@ var Uf = { class: "w-full" }, Wf = {
|
|
|
9728
9723
|
key: 0,
|
|
9729
9724
|
type: "button",
|
|
9730
9725
|
class: "message-receipt-summary",
|
|
9731
|
-
onClick:
|
|
9726
|
+
onClick: P
|
|
9732
9727
|
}, [
|
|
9733
|
-
o("span", Dm, [s.receiptSummaryAction.loading ? (S(), r(j(
|
|
9728
|
+
o("span", Dm, [s.receiptSummaryAction.loading ? (S(), r(j(G), {
|
|
9734
9729
|
key: 0,
|
|
9735
9730
|
style: {
|
|
9736
9731
|
width: "1rem",
|
|
@@ -9752,7 +9747,7 @@ var Uf = { class: "w-full" }, Wf = {
|
|
|
9752
9747
|
}, null, 8, ["image", "label"]))), 128))])) : i("", !0)
|
|
9753
9748
|
])) : i("", !0),
|
|
9754
9749
|
s.receiptSummaryAction ? (S(), a("div", Am)) : i("", !0),
|
|
9755
|
-
l(j(
|
|
9750
|
+
l(j(re), {
|
|
9756
9751
|
model: s.actionItems,
|
|
9757
9752
|
class: "message-action-list__menu"
|
|
9758
9753
|
}, null, 8, ["model"])
|
|
@@ -9760,8 +9755,8 @@ var Uf = { class: "w-full" }, Wf = {
|
|
|
9760
9755
|
o("button", {
|
|
9761
9756
|
type: "button",
|
|
9762
9757
|
class: "message-receipt-back",
|
|
9763
|
-
onClick:
|
|
9764
|
-
}, [l(j(
|
|
9758
|
+
onClick: F
|
|
9759
|
+
}, [l(j(oe), {
|
|
9765
9760
|
class: "size-5",
|
|
9766
9761
|
"aria-hidden": "true"
|
|
9767
9762
|
}), o("span", null, k(j(g)("back")), 1)]),
|
|
@@ -9780,7 +9775,7 @@ var Uf = { class: "w-full" }, Wf = {
|
|
|
9780
9775
|
}, null, 8, ["image", "label"]), o("div", Nm, [o("p", Pm, k(e.user.name), 1), o("p", Fm, [l(j(ge), {
|
|
9781
9776
|
class: "message-receipt-row__icon text-success",
|
|
9782
9777
|
"aria-hidden": "true"
|
|
9783
|
-
}), o("span", null, k(
|
|
9778
|
+
}), o("span", null, k(I(e.timestamp)), 1)])])]))), 128))])
|
|
9784
9779
|
]))], 4)) : i("", !0)]));
|
|
9785
9780
|
}
|
|
9786
9781
|
}), [["__scopeId", "data-v-c561963f"]]), Lm = { class: "chat-header border-default bg-elevation-surface-default sticky top-0 z-10 flex items-center justify-between gap-3 border-b px-4 py-3 max-md:px-4 max-md:pb-3 sm:px-5 sm:py-3.5" }, Rm = {
|
|
@@ -9802,7 +9797,7 @@ var Uf = { class: "w-full" }, Wf = {
|
|
|
9802
9797
|
label: t.conversation.avatar ? void 0 : t.conversation.title.slice(0, 1).toUpperCase(),
|
|
9803
9798
|
shape: "circle",
|
|
9804
9799
|
class: "chat-header__avatar shrink-0"
|
|
9805
|
-
}, null, 8, ["image", "label"]), o("div", zm, [o("p", Bm, k(t.parentMessage ? j(n)("thread") : t.conversation.title), 1), o("p", Vm, [t.parentMessage ? (S(), a("span", Hm, k(t.parentMessage.senderName), 1)) : (S(), a("span", Um, k(t.conversation.memberCount ? j(n)("members", { count: t.conversation.memberCount }) : j(n)("groupChat")), 1))])])])) : i("", !0), o("div", Wm, [t.conversation?.tags?.length ? (S(), a("div", Gm, [(S(!0), a(e, null, T(t.conversation.tags.slice(0, 3), (e) => (S(), r(j(
|
|
9800
|
+
}, null, 8, ["image", "label"]), o("div", zm, [o("p", Bm, k(t.parentMessage ? j(n)("thread") : t.conversation.title), 1), o("p", Vm, [t.parentMessage ? (S(), a("span", Hm, k(t.parentMessage.senderName), 1)) : (S(), a("span", Um, k(t.conversation.memberCount ? j(n)("members", { count: t.conversation.memberCount }) : j(n)("groupChat")), 1))])])])) : i("", !0), o("div", Wm, [t.conversation?.tags?.length ? (S(), a("div", Gm, [(S(!0), a(e, null, T(t.conversation.tags.slice(0, 3), (e) => (S(), r(j(K), {
|
|
9806
9801
|
key: e,
|
|
9807
9802
|
text: e,
|
|
9808
9803
|
context: "secondary",
|
|
@@ -9835,7 +9830,7 @@ var Uf = { class: "w-full" }, Wf = {
|
|
|
9835
9830
|
}), A = n(() => {
|
|
9836
9831
|
let e = u.conversation.value;
|
|
9837
9832
|
return e ? v.value ? v.value.senderName : e.memberCount ? c("members", { count: e.memberCount }) : c("groupChat") : "";
|
|
9838
|
-
}), M = n(() => u.conversation.value?.memberCount ?? 0),
|
|
9833
|
+
}), M = n(() => u.conversation.value?.memberCount ?? 0), N = w(null), P = w(null), F = n(() => !!v.value), I = n(() => F.value && !b.value), L = n(() => Bu(u.conversation.value)), R = ee("threadRef"), { handleThreadScroll: z } = zf({
|
|
9839
9834
|
getConversation: () => u.conversation.value,
|
|
9840
9835
|
getParentMessage: () => v.value,
|
|
9841
9836
|
getMessages: () => h.value,
|
|
@@ -9844,7 +9839,7 @@ var Uf = { class: "w-full" }, Wf = {
|
|
|
9844
9839
|
canLoadOlder: () => x.value,
|
|
9845
9840
|
onLoadOlder: () => p.emit("list:loadOlder", { target: s.target }),
|
|
9846
9841
|
threadRef: R
|
|
9847
|
-
}), B =
|
|
9842
|
+
}), B = ee("actionMenuRef"), { activeActionMessage: V, handleMessageContextMenu: H, handleMessageTap: U, resetActionMenuState: te, reactToMessage: W, toggleInlineReaction: ne, getReceiptSummaryAction: re, getActionItems: ie, isTouchUI: G } = Nf({
|
|
9848
9843
|
canUseMessageActions: () => u.canUseMessageActions.value,
|
|
9849
9844
|
canReact: () => u.canReact.value,
|
|
9850
9845
|
canReply: () => u.canReply.value,
|
|
@@ -9868,21 +9863,21 @@ var Uf = { class: "w-full" }, Wf = {
|
|
|
9868
9863
|
},
|
|
9869
9864
|
onMenuOpen: () => p.emit("ui:closeComposerActions")
|
|
9870
9865
|
});
|
|
9871
|
-
function
|
|
9866
|
+
function K(e) {
|
|
9872
9867
|
return !!e.url && [
|
|
9873
9868
|
"image",
|
|
9874
9869
|
"video",
|
|
9875
9870
|
"audio"
|
|
9876
9871
|
].includes(e.kind);
|
|
9877
9872
|
}
|
|
9878
|
-
function
|
|
9879
|
-
|
|
9873
|
+
function q(e) {
|
|
9874
|
+
K(e) && (N.value = e);
|
|
9880
9875
|
}
|
|
9881
|
-
function
|
|
9882
|
-
|
|
9876
|
+
function ae() {
|
|
9877
|
+
N.value = null;
|
|
9883
9878
|
}
|
|
9884
|
-
async function
|
|
9885
|
-
|
|
9879
|
+
async function oe(e, t) {
|
|
9880
|
+
P.value = `${e.id}:${t}`;
|
|
9886
9881
|
try {
|
|
9887
9882
|
p.emit("message:votePoll", {
|
|
9888
9883
|
message: e,
|
|
@@ -9890,7 +9885,7 @@ var Uf = { class: "w-full" }, Wf = {
|
|
|
9890
9885
|
});
|
|
9891
9886
|
} finally {
|
|
9892
9887
|
window.setTimeout(() => {
|
|
9893
|
-
|
|
9888
|
+
P.value === `${e.id}:${t}` && (P.value = null);
|
|
9894
9889
|
}, 300);
|
|
9895
9890
|
}
|
|
9896
9891
|
}
|
|
@@ -9905,7 +9900,7 @@ var Uf = { class: "w-full" }, Wf = {
|
|
|
9905
9900
|
return e === 0 ? !0 : ce(t[e].sentAt, t[e - 1].sentAt);
|
|
9906
9901
|
}
|
|
9907
9902
|
return (t, n) => (S(), a(e, null, [
|
|
9908
|
-
o("section", { class: g(["message-list-root", [t.$attrs.class,
|
|
9903
|
+
o("section", { class: g(["message-list-root", [t.$attrs.class, I.value ? "message-list--embedded-thread" : F.value ? "message-list--thread" : "message-list--main"]]) }, [b.value ? E(t.$slots, "header", {
|
|
9909
9904
|
key: 0,
|
|
9910
9905
|
conversation: j(u).conversation.value,
|
|
9911
9906
|
parentMessage: v.value,
|
|
@@ -9918,11 +9913,11 @@ var Uf = { class: "w-full" }, Wf = {
|
|
|
9918
9913
|
"parent-message": v.value
|
|
9919
9914
|
}, null, 8, ["conversation", "parent-message"])], !0) : i("", !0), j(u).conversation.value ? (S(), a("div", {
|
|
9920
9915
|
key: 2,
|
|
9921
|
-
class: g(["message-list__body",
|
|
9916
|
+
class: g(["message-list__body", I.value || F.value ? "bg-elevation-surface-overlay" : ""])
|
|
9922
9917
|
}, [o("div", {
|
|
9923
9918
|
ref_key: "threadRef",
|
|
9924
9919
|
ref: R,
|
|
9925
|
-
class: g(["message-list__scroll min-h-0 flex-1",
|
|
9920
|
+
class: g(["message-list__scroll min-h-0 flex-1", I.value ? "p-0" : F.value ? "px-5 py-4" : "px-2 pt-2 pb-3"]),
|
|
9926
9921
|
onScroll: n[2] ||= (...e) => j(z) && j(z)(...e)
|
|
9927
9922
|
}, [o("div", Jm, [
|
|
9928
9923
|
v.value ? (S(), a("div", Ym, [o("p", Xm, k(v.value.senderName), 1), o("p", Zm, k(j(nc)(v.value, j(c)("message"), j(u).mentionNameByUid.value)), 1)])) : i("", !0),
|
|
@@ -9934,17 +9929,17 @@ var Uf = { class: "w-full" }, Wf = {
|
|
|
9934
9929
|
"current-user-id": j(u).currentUserId.value,
|
|
9935
9930
|
"can-react": j(u).canReact.value,
|
|
9936
9931
|
"can-open-thread": !v.value && y.value,
|
|
9937
|
-
"can-show-sender-avatar":
|
|
9938
|
-
"pending-option-key":
|
|
9932
|
+
"can-show-sender-avatar": L.value,
|
|
9933
|
+
"pending-option-key": P.value,
|
|
9939
9934
|
"action-message-class": s.actionMessageClass,
|
|
9940
9935
|
"action-message-row-class": s.actionMessageRowClass,
|
|
9941
9936
|
"context-menu-open": j(V)?.id === o.id,
|
|
9942
|
-
"is-touch-ui": j(
|
|
9937
|
+
"is-touch-ui": j(G),
|
|
9943
9938
|
onContextmenu: (e) => j(H)(o, e),
|
|
9944
9939
|
onTap: (e) => j(U)(o, e),
|
|
9945
|
-
onOpenMedia:
|
|
9946
|
-
onVotePoll: (e) =>
|
|
9947
|
-
onToggleReaction: (e) => j(
|
|
9940
|
+
onOpenMedia: q,
|
|
9941
|
+
onVotePoll: (e) => oe(o, e),
|
|
9942
|
+
onToggleReaction: (e) => j(ne)(o, e),
|
|
9948
9943
|
onOpenThread: (e) => se(o),
|
|
9949
9944
|
onOpenReferencedMessage: n[0] ||= (e) => j(p).emit("message:openReference", e),
|
|
9950
9945
|
onAnchorclick: n[1] ||= (e, n) => t.$emit("anchorclick", e, n)
|
|
@@ -9966,20 +9961,20 @@ var Uf = { class: "w-full" }, Wf = {
|
|
|
9966
9961
|
"onOpenThread"
|
|
9967
9962
|
])], 64))), 128)),
|
|
9968
9963
|
h.value.length === 0 && D.value && !_.value ? (S(), a("div", Qm, k(j(c)("noMessagesYetInThisGroup")), 1)) : i("", !0)
|
|
9969
|
-
])], 34), o("footer", { class: g(["message-list__composer flex shrink-0 flex-col",
|
|
9964
|
+
])], 34), o("footer", { class: g(["message-list__composer flex shrink-0 flex-col", F.value ? I.value ? "bg-transparent p-0" : "message-list__composer--thread" : "bg-transparent p-0"]) }, [E(t.$slots, "composer", {}, void 0, !0)], 2)], 2)) : (S(), a("div", qm, k(j(c)("selectConversationToStart")), 1))], 2),
|
|
9970
9965
|
l(ap, {
|
|
9971
|
-
attachment:
|
|
9972
|
-
onClose:
|
|
9966
|
+
attachment: N.value,
|
|
9967
|
+
onClose: ae
|
|
9973
9968
|
}, null, 8, ["attachment"]),
|
|
9974
9969
|
l(Im, {
|
|
9975
9970
|
ref_key: "actionMenuRef",
|
|
9976
9971
|
ref: B,
|
|
9977
9972
|
message: j(V),
|
|
9978
9973
|
"can-react": j(u).canReact.value,
|
|
9979
|
-
"receipt-summary-action": j(V) ? j(
|
|
9980
|
-
"action-items": j(V) ? j(
|
|
9974
|
+
"receipt-summary-action": j(V) ? j(re)(j(V)) : null,
|
|
9975
|
+
"action-items": j(V) ? j(ie)(j(V)) : [],
|
|
9981
9976
|
onHide: j(te),
|
|
9982
|
-
onReact: n[3] ||= (e) => j(
|
|
9977
|
+
onReact: n[3] ||= (e) => j(W)(j(V), e)
|
|
9983
9978
|
}, null, 8, [
|
|
9984
9979
|
"message",
|
|
9985
9980
|
"can-react",
|
|
@@ -10067,7 +10062,7 @@ var Uf = { class: "w-full" }, Wf = {
|
|
|
10067
10062
|
"close-label": j(u)("close"),
|
|
10068
10063
|
onClose: n[0] ||= (e) => s("close")
|
|
10069
10064
|
}, {
|
|
10070
|
-
default:
|
|
10065
|
+
default: I(() => [e.message ? (S(), a("div", dh, [e.loading ? (S(), a("div", fh, [l(j(G), {
|
|
10071
10066
|
style: {
|
|
10072
10067
|
width: "2.5rem",
|
|
10073
10068
|
height: "2.5rem"
|
|
@@ -10130,7 +10125,7 @@ var Uf = { class: "w-full" }, Wf = {
|
|
|
10130
10125
|
],
|
|
10131
10126
|
setup(t, { emit: s }) {
|
|
10132
10127
|
let c = t, u = s, d = w(null), f = w(null), p = w(!1), m = w(""), h = w(""), g = w(""), { locale: _, t: v } = X(), y = n(() => c.messages.filter((e) => !e.isDeleted && !!e.scheduled?.scheduleDate)), b = n(() => /^([01]\d|2[0-3]):([0-5]\d)$/.test(h.value));
|
|
10133
|
-
|
|
10128
|
+
F(() => c.open, (e) => {
|
|
10134
10129
|
e || (d.value = null, f.value = null, p.value = !1, m.value = "", h.value = "", g.value = "");
|
|
10135
10130
|
});
|
|
10136
10131
|
function x(e) {
|
|
@@ -10160,13 +10155,13 @@ var Uf = { class: "w-full" }, Wf = {
|
|
|
10160
10155
|
function M() {
|
|
10161
10156
|
d.value = null, f.value = null, p.value = !1, m.value = "", h.value = "", g.value = "";
|
|
10162
10157
|
}
|
|
10163
|
-
function
|
|
10158
|
+
function ee(e) {
|
|
10164
10159
|
return {
|
|
10165
10160
|
...e,
|
|
10166
10161
|
text: ""
|
|
10167
10162
|
};
|
|
10168
10163
|
}
|
|
10169
|
-
function
|
|
10164
|
+
function P() {
|
|
10170
10165
|
p.value = !0;
|
|
10171
10166
|
}
|
|
10172
10167
|
function R(e) {
|
|
@@ -10203,7 +10198,7 @@ var Uf = { class: "w-full" }, Wf = {
|
|
|
10203
10198
|
"close-label": j(v)("close"),
|
|
10204
10199
|
onClose: s[3] ||= (e) => u("close")
|
|
10205
10200
|
}, {
|
|
10206
|
-
default:
|
|
10201
|
+
default: I(() => [o("div", _h, [t.loading ? (S(), a("div", vh, [l(j(G), {
|
|
10207
10202
|
style: {
|
|
10208
10203
|
width: "2.75rem",
|
|
10209
10204
|
height: "2.75rem"
|
|
@@ -10213,17 +10208,17 @@ var Uf = { class: "w-full" }, Wf = {
|
|
|
10213
10208
|
key: e.id,
|
|
10214
10209
|
class: "border-default rounded-lg border px-4 py-3"
|
|
10215
10210
|
}, [o("div", xh, [o("div", Sh, [
|
|
10216
|
-
o("div", Ch, [o("div", wh, [e.kind === "poll" ? (S(), r(j(
|
|
10211
|
+
o("div", Ch, [o("div", wh, [e.kind === "poll" ? (S(), r(j(K), {
|
|
10217
10212
|
key: 0,
|
|
10218
10213
|
text: j(v)("poll"),
|
|
10219
10214
|
context: "info",
|
|
10220
10215
|
rounded: ""
|
|
10221
|
-
}, null, 8, ["text"])) : e.attachments.length ? (S(), r(j(
|
|
10216
|
+
}, null, 8, ["text"])) : e.attachments.length ? (S(), r(j(K), {
|
|
10222
10217
|
key: 1,
|
|
10223
10218
|
text: D(e.attachments[0].kind),
|
|
10224
10219
|
context: "info",
|
|
10225
10220
|
rounded: ""
|
|
10226
|
-
}, null, 8, ["text"])) : (S(), r(j(
|
|
10221
|
+
}, null, 8, ["text"])) : (S(), r(j(K), {
|
|
10227
10222
|
key: 2,
|
|
10228
10223
|
text: j(v)("message"),
|
|
10229
10224
|
context: "info",
|
|
@@ -10235,7 +10230,7 @@ var Uf = { class: "w-full" }, Wf = {
|
|
|
10235
10230
|
onClick: (t) => H(e)
|
|
10236
10231
|
}, null, 8, ["icon", "onClick"])]),
|
|
10237
10232
|
o("div", Th, [o("p", Eh, k(x(e.scheduled?.scheduleDate)), 1), e.kind === "poll" && e.poll ? (S(), a("p", Dh, k(e.poll.question), 1)) : (S(), a("p", Oh, k(j(nc)(e, j(v)("attachment"))), 1))]),
|
|
10238
|
-
R(e) && !(d.value === e.id && f.value === "text") ? (S(), a("div", kh, [l(Vp, { message:
|
|
10233
|
+
R(e) && !(d.value === e.id && f.value === "text") ? (S(), a("div", kh, [l(Vp, { message: ee(e) }, null, 8, ["message"])])) : i("", !0)
|
|
10239
10234
|
]), o("div", Ah, [e.kind === "poll" ? i("", !0) : (S(), r(j(V), {
|
|
10240
10235
|
key: 0,
|
|
10241
10236
|
label: j(v)("edit"),
|
|
@@ -10258,11 +10253,11 @@ var Uf = { class: "w-full" }, Wf = {
|
|
|
10258
10253
|
"label",
|
|
10259
10254
|
"icon",
|
|
10260
10255
|
"onClick"
|
|
10261
|
-
])) : i("", !0)])]), d.value === e.id && f.value === "reschedule" ? (S(), a("div", jh, [o("div", Mh, [
|
|
10256
|
+
])) : i("", !0)])]), d.value === e.id && f.value === "reschedule" ? (S(), a("div", jh, [o("div", Mh, [L(o("input", {
|
|
10262
10257
|
"onUpdate:modelValue": s[0] ||= (e) => m.value = e,
|
|
10263
10258
|
type: "date",
|
|
10264
10259
|
class: "surface-input body-md w-full rounded-xl p-2 ring-0 outline-none"
|
|
10265
|
-
}, null, 512), [[
|
|
10260
|
+
}, null, 512), [[N, m.value]]), L(o("input", {
|
|
10266
10261
|
"onUpdate:modelValue": s[1] ||= (e) => h.value = e,
|
|
10267
10262
|
type: "time",
|
|
10268
10263
|
inputmode: "numeric",
|
|
@@ -10270,7 +10265,7 @@ var Uf = { class: "w-full" }, Wf = {
|
|
|
10270
10265
|
pattern: "^([01]\\d|2[0-3]):([0-5]\\d)$",
|
|
10271
10266
|
"aria-label": "Time (24-hour)",
|
|
10272
10267
|
class: "surface-input body-md w-full rounded-xl p-2 ring-0 outline-none"
|
|
10273
|
-
}, null, 512), [[
|
|
10268
|
+
}, null, 512), [[N, h.value]])]), o("div", Nh, [l(j(V), {
|
|
10274
10269
|
label: j(v)("save"),
|
|
10275
10270
|
size: "small",
|
|
10276
10271
|
disabled: !m.value || !b.value,
|
|
@@ -10285,21 +10280,21 @@ var Uf = { class: "w-full" }, Wf = {
|
|
|
10285
10280
|
text: "",
|
|
10286
10281
|
onClick: M
|
|
10287
10282
|
}, null, 8, ["label"])])])) : d.value === e.id && f.value === "text" ? (S(), a("div", Ph, [
|
|
10288
|
-
R(e) ? (S(), a("div", Fh, [l(Vp, { message:
|
|
10283
|
+
R(e) ? (S(), a("div", Fh, [l(Vp, { message: ee(e) }, null, 8, ["message"]), o("div", Ih, [l(j(V), {
|
|
10289
10284
|
icon: j(de),
|
|
10290
10285
|
"aria-label": j(v)("remove"),
|
|
10291
10286
|
text: "",
|
|
10292
10287
|
rounded: "",
|
|
10293
10288
|
severity: "secondary",
|
|
10294
10289
|
size: "small",
|
|
10295
|
-
onClick:
|
|
10290
|
+
onClick: P
|
|
10296
10291
|
}, null, 8, ["icon", "aria-label"])])])) : i("", !0),
|
|
10297
|
-
|
|
10292
|
+
L(o("textarea", {
|
|
10298
10293
|
"onUpdate:modelValue": s[2] ||= (e) => g.value = e,
|
|
10299
10294
|
rows: "3",
|
|
10300
10295
|
class: "surface-input body-md w-full rounded-xl px-3 py-2 ring-0 outline-none",
|
|
10301
10296
|
placeholder: j(v)("writeMessage")
|
|
10302
|
-
}, null, 8, Lh), [[
|
|
10297
|
+
}, null, 8, Lh), [[N, g.value]]),
|
|
10303
10298
|
o("div", Rh, [l(j(V), {
|
|
10304
10299
|
label: j(v)("cancel"),
|
|
10305
10300
|
size: "small",
|
|
@@ -10437,7 +10432,7 @@ var Uf = { class: "w-full" }, Wf = {
|
|
|
10437
10432
|
onMembersChanged: (e) => {
|
|
10438
10433
|
p("chatMembersFetched", e), T.value?.rememberMentionDisplayNames(e);
|
|
10439
10434
|
}
|
|
10440
|
-
}),
|
|
10435
|
+
}), N = Hu({
|
|
10441
10436
|
chatClient: T,
|
|
10442
10437
|
selectedConversation: O,
|
|
10443
10438
|
getPropIsReadOnly: () => f.isReadOnly,
|
|
@@ -10449,8 +10444,8 @@ var Uf = { class: "w-full" }, Wf = {
|
|
|
10449
10444
|
currentUserId: T.value?.currentUser.value?.uid
|
|
10450
10445
|
})
|
|
10451
10446
|
});
|
|
10452
|
-
Wu(
|
|
10453
|
-
let
|
|
10447
|
+
Wu(N);
|
|
10448
|
+
let P = Ku({
|
|
10454
10449
|
chatClient: T,
|
|
10455
10450
|
selectedConversation: O,
|
|
10456
10451
|
usesPublicContract: D,
|
|
@@ -10462,19 +10457,19 @@ var Uf = { class: "w-full" }, Wf = {
|
|
|
10462
10457
|
getPropShowDefaultEmptyState: () => f.showDefaultEmptyState,
|
|
10463
10458
|
getHideDeletedMessages: () => f.hideDeletedMessages
|
|
10464
10459
|
});
|
|
10465
|
-
Ju(
|
|
10466
|
-
let
|
|
10460
|
+
Ju(P);
|
|
10461
|
+
let L = n(() => P.messages.value.length > 0), R = n(() => f.showHeader ?? f.showMessageHeader), z = nd({
|
|
10467
10462
|
chatClient: T,
|
|
10468
10463
|
selectedConversation: O,
|
|
10469
|
-
canScheduleMessages: () => !
|
|
10464
|
+
canScheduleMessages: () => !N.isReadOnly.value,
|
|
10470
10465
|
getInitialScheduledMessagesOpen: () => !!f.initialScheduledMessagesOpen,
|
|
10471
10466
|
fetchErrorFallback: m("loadMessageReceiptsError")
|
|
10472
10467
|
});
|
|
10473
10468
|
id(z);
|
|
10474
|
-
let B =
|
|
10469
|
+
let B = ee("mainComposerRef"), V = ee("threadComposerRef"), H = Zu({
|
|
10475
10470
|
chatClient: T,
|
|
10476
|
-
sendOptions:
|
|
10477
|
-
mentionNameByUid:
|
|
10471
|
+
sendOptions: N.sendOptions,
|
|
10472
|
+
mentionNameByUid: N.mentionNameByUid,
|
|
10478
10473
|
afterSchedule: () => z.openScheduledMessages(),
|
|
10479
10474
|
mainComposerRef: B,
|
|
10480
10475
|
threadComposerRef: V
|
|
@@ -10482,7 +10477,7 @@ var Uf = { class: "w-full" }, Wf = {
|
|
|
10482
10477
|
$u(H);
|
|
10483
10478
|
let U = cd();
|
|
10484
10479
|
ld(U), od({
|
|
10485
|
-
conversation:
|
|
10480
|
+
conversation: N,
|
|
10486
10481
|
composer: H,
|
|
10487
10482
|
dialogs: z,
|
|
10488
10483
|
bus: U
|
|
@@ -10491,33 +10486,35 @@ var Uf = { class: "w-full" }, Wf = {
|
|
|
10491
10486
|
chatRootRef: h,
|
|
10492
10487
|
getClient: () => T.value
|
|
10493
10488
|
});
|
|
10494
|
-
|
|
10489
|
+
F(() => O.value?.targetId ?? null, () => {
|
|
10495
10490
|
z.refreshScheduledMessages();
|
|
10496
|
-
}, { immediate: !0 }),
|
|
10491
|
+
}, { immediate: !0 }), F(() => O.value?.targetId ?? null, async (e) => {
|
|
10497
10492
|
!e || O.value?.type !== "group" || await M(e);
|
|
10498
|
-
}, { immediate: !0 }),
|
|
10493
|
+
}, { immediate: !0 }), F(() => O.value?.id, () => {
|
|
10499
10494
|
H.resetMainComposer(), H.resetThreadComposer(), z.showScheduledMessages.value = !1, z.closeMessageInfo();
|
|
10500
|
-
}),
|
|
10495
|
+
}), F(() => f.chatMessageGetter, (e) => {
|
|
10501
10496
|
Au.setGetChatMessagesCallback(e);
|
|
10502
|
-
}, { immediate: !0 }),
|
|
10497
|
+
}, { immediate: !0 }), F(() => f.language, (e) => {
|
|
10503
10498
|
e && gt(e);
|
|
10504
|
-
}, { immediate: !0 }),
|
|
10499
|
+
}, { immediate: !0 }), F([() => f.hideGroupActions, T], ([e, t]) => {
|
|
10500
|
+
t && (t.hideGroupActions.value = e);
|
|
10501
|
+
}, { immediate: !0 }), F(P.isChatEmpty, (e) => {
|
|
10505
10502
|
e && p("chatEmpty");
|
|
10506
|
-
}),
|
|
10503
|
+
}), F([
|
|
10507
10504
|
() => f.chatUid,
|
|
10508
10505
|
() => f.client ? f.client.initialized.value : Au.initialized.value,
|
|
10509
10506
|
() => f.client ? f.client.loggedIn.value : Au.loggedIn.value,
|
|
10510
10507
|
() => T.value?.conversations.value.length ?? 0
|
|
10511
10508
|
], async ([e, t, n]) => {
|
|
10512
|
-
!D.value || !e || !t || !n || !T.value || await
|
|
10513
|
-
}, { immediate: !0 }),
|
|
10514
|
-
() =>
|
|
10515
|
-
() =>
|
|
10509
|
+
!D.value || !e || !t || !n || !T.value || await W();
|
|
10510
|
+
}, { immediate: !0 }), F([
|
|
10511
|
+
() => P.messages.value.length,
|
|
10512
|
+
() => P.threadMessages.value.length,
|
|
10516
10513
|
() => Au.scrollToMessageId.value
|
|
10517
10514
|
], async () => {
|
|
10518
10515
|
await te();
|
|
10519
10516
|
});
|
|
10520
|
-
async function
|
|
10517
|
+
async function W() {
|
|
10521
10518
|
let e = T.value;
|
|
10522
10519
|
if (!e) {
|
|
10523
10520
|
console.warn("No active client available.");
|
|
@@ -10528,7 +10525,7 @@ var Uf = { class: "w-full" }, Wf = {
|
|
|
10528
10525
|
e.conversations.value.length === 0 && await e.fetchConversations();
|
|
10529
10526
|
let t = e.conversations.value.find((e) => e.targetId === f.chatUid || e.id === f.chatUid) ?? null;
|
|
10530
10527
|
if (!t) try {
|
|
10531
|
-
t = await
|
|
10528
|
+
t = await ne(f.chatUid, e);
|
|
10532
10529
|
} catch (e) {
|
|
10533
10530
|
if (e && typeof e == "object" && "code" in e && e.code === "ERR_NOT_A_MEMBER") {
|
|
10534
10531
|
v.value = !1, C.value = !0, p("chatMembersFetched", []);
|
|
@@ -10544,7 +10541,7 @@ var Uf = { class: "w-full" }, Wf = {
|
|
|
10544
10541
|
x.value = !1;
|
|
10545
10542
|
}
|
|
10546
10543
|
}
|
|
10547
|
-
async function
|
|
10544
|
+
async function ne(e, t) {
|
|
10548
10545
|
let n = await Au.getGroup(e, !0);
|
|
10549
10546
|
if (!n || typeof n != "object") return null;
|
|
10550
10547
|
let r = String(n.getGuid());
|
|
@@ -10563,44 +10560,44 @@ var Uf = { class: "w-full" }, Wf = {
|
|
|
10563
10560
|
};
|
|
10564
10561
|
return t.conversations.value = [i, ...t.conversations.value.filter((e) => e.id !== i.id && e.targetId !== r)], i;
|
|
10565
10562
|
}
|
|
10566
|
-
function
|
|
10563
|
+
function re(e, t) {
|
|
10567
10564
|
p("linkClicked", e, t);
|
|
10568
10565
|
}
|
|
10569
|
-
let
|
|
10570
|
-
function
|
|
10571
|
-
e && (
|
|
10566
|
+
let G = w(!1), K = w("main");
|
|
10567
|
+
function q(e) {
|
|
10568
|
+
e && (K.value = e.target), p("composerSelectionChange", e);
|
|
10572
10569
|
}
|
|
10573
|
-
function
|
|
10574
|
-
|
|
10570
|
+
function ae(e) {
|
|
10571
|
+
K.value = e.target, p("composerLinkRequest", e);
|
|
10575
10572
|
}
|
|
10576
|
-
function
|
|
10573
|
+
function oe(e = K.value) {
|
|
10577
10574
|
return (e === "thread" ? V.value : B.value) ?? null;
|
|
10578
10575
|
}
|
|
10579
10576
|
function se(e, t) {
|
|
10580
|
-
return
|
|
10577
|
+
return oe(t)?.applyComposerFormat?.(e) ?? !1;
|
|
10581
10578
|
}
|
|
10582
10579
|
function ce(e) {
|
|
10583
|
-
return
|
|
10580
|
+
return oe(e)?.requestComposerLink?.() ?? !1;
|
|
10584
10581
|
}
|
|
10585
10582
|
function le(e, t) {
|
|
10586
|
-
return
|
|
10583
|
+
return oe(t)?.applyComposerLink?.(e) ?? !1;
|
|
10587
10584
|
}
|
|
10588
10585
|
function ue(e) {
|
|
10589
|
-
|
|
10586
|
+
oe(e)?.cancelComposerLink?.();
|
|
10590
10587
|
}
|
|
10591
10588
|
function de(e) {
|
|
10592
|
-
return
|
|
10589
|
+
return oe(e)?.getComposerSelection?.() ?? null;
|
|
10593
10590
|
}
|
|
10594
10591
|
b(() => {
|
|
10595
10592
|
setTimeout(() => {
|
|
10596
|
-
|
|
10593
|
+
G.value = !0;
|
|
10597
10594
|
}, 200);
|
|
10598
10595
|
}), y(() => {
|
|
10599
10596
|
let e = T.value;
|
|
10600
10597
|
e && e.activeConversation.value === O.value && e.selectConversation(null);
|
|
10601
10598
|
});
|
|
10602
10599
|
async function fe(e) {
|
|
10603
|
-
return await new Promise((e) => setTimeout(e, 100)),
|
|
10600
|
+
return await new Promise((e) => setTimeout(e, 100)), G.value ? te(e) : (await new Promise((e) => setTimeout(e, 110)), fe(e));
|
|
10604
10601
|
}
|
|
10605
10602
|
return r({
|
|
10606
10603
|
applyComposerFormat: se,
|
|
@@ -10618,12 +10615,12 @@ var Uf = { class: "w-full" }, Wf = {
|
|
|
10618
10615
|
D.value && T.value?.error.value ? E(n.$slots, "error-message", {
|
|
10619
10616
|
key: 0,
|
|
10620
10617
|
message: T.value.error.value
|
|
10621
|
-
}, () => [l(j(
|
|
10618
|
+
}, () => [l(j(ie), {
|
|
10622
10619
|
severity: "error",
|
|
10623
10620
|
closable: !1,
|
|
10624
10621
|
class: "pointer-events-auto absolute inset-x-2 top-2 z-20 shadow-lg"
|
|
10625
10622
|
}, {
|
|
10626
|
-
default:
|
|
10623
|
+
default: I(() => [c(k(T.value.error.value), 1)]),
|
|
10627
10624
|
_: 1
|
|
10628
10625
|
})]) : i("", !0),
|
|
10629
10626
|
T.value ? (S(), a(e, { key: 1 }, [
|
|
@@ -10634,20 +10631,20 @@ var Uf = { class: "w-full" }, Wf = {
|
|
|
10634
10631
|
"show-header": R.value,
|
|
10635
10632
|
"action-message-class": t.actionMessageClass,
|
|
10636
10633
|
"action-message-row-class": t.actionMessageRowClass,
|
|
10637
|
-
onAnchorclick:
|
|
10634
|
+
onAnchorclick: re
|
|
10638
10635
|
}, s({
|
|
10639
|
-
composer:
|
|
10636
|
+
composer: I(() => [l(jf, {
|
|
10640
10637
|
ref_key: "mainComposerRef",
|
|
10641
10638
|
ref: B,
|
|
10642
10639
|
target: "main",
|
|
10643
10640
|
"formatting-mode": t.composerFormattingMode,
|
|
10644
|
-
onComposerSelectionChange:
|
|
10645
|
-
onComposerLinkRequest:
|
|
10641
|
+
onComposerSelectionChange: q,
|
|
10642
|
+
onComposerLinkRequest: ae
|
|
10646
10643
|
}, null, 8, ["formatting-mode"])]),
|
|
10647
10644
|
_: 2
|
|
10648
10645
|
}, [n.$slots["message-header"] ? {
|
|
10649
10646
|
name: "header",
|
|
10650
|
-
fn:
|
|
10647
|
+
fn: I((e) => [E(n.$slots, "message-header", _(d(e)))]),
|
|
10651
10648
|
key: "0"
|
|
10652
10649
|
} : void 0]), 1032, [
|
|
10653
10650
|
"hide-group-actions",
|
|
@@ -10657,26 +10654,26 @@ var Uf = { class: "w-full" }, Wf = {
|
|
|
10657
10654
|
"action-message-row-class"
|
|
10658
10655
|
]),
|
|
10659
10656
|
l(Gf, {
|
|
10660
|
-
open: !!j(
|
|
10661
|
-
title: j(m)("threadWithCount", { count: j(
|
|
10657
|
+
open: !!j(P).activeThreadParentMessage.value,
|
|
10658
|
+
title: j(m)("threadWithCount", { count: j(P).activeThreadParentMessage.value?.replyCount ?? 0 }),
|
|
10662
10659
|
subtitle: O.value?.title ?? "",
|
|
10663
10660
|
"close-label": j(m)("close"),
|
|
10664
10661
|
"close-aria-label": j(m)("closeThread"),
|
|
10665
10662
|
onClose: r[0] ||= (e) => j(U).emit("ui:closeThread")
|
|
10666
10663
|
}, {
|
|
10667
|
-
default:
|
|
10664
|
+
default: I(() => [l($m, {
|
|
10668
10665
|
target: "thread",
|
|
10669
10666
|
class: "min-h-0 flex-1",
|
|
10670
10667
|
"action-message-class": t.actionMessageClass,
|
|
10671
10668
|
"action-message-row-class": t.actionMessageRowClass
|
|
10672
10669
|
}, {
|
|
10673
|
-
composer:
|
|
10670
|
+
composer: I(() => [l(jf, {
|
|
10674
10671
|
ref_key: "threadComposerRef",
|
|
10675
10672
|
ref: V,
|
|
10676
10673
|
target: "thread",
|
|
10677
10674
|
"formatting-mode": t.composerFormattingMode,
|
|
10678
|
-
onComposerSelectionChange:
|
|
10679
|
-
onComposerLinkRequest:
|
|
10675
|
+
onComposerSelectionChange: q,
|
|
10676
|
+
onComposerLinkRequest: ae
|
|
10680
10677
|
}, null, 8, ["formatting-mode"])]),
|
|
10681
10678
|
_: 1
|
|
10682
10679
|
}, 8, ["action-message-class", "action-message-row-class"])]),
|
|
@@ -10719,13 +10716,13 @@ var Uf = { class: "w-full" }, Wf = {
|
|
|
10719
10716
|
])
|
|
10720
10717
|
], 64)) : i("", !0),
|
|
10721
10718
|
l(Hh, {
|
|
10722
|
-
visible: D.value && (T.value?.offlineMode.value || !T.value?.connected.value || x.value && !
|
|
10719
|
+
visible: D.value && (T.value?.offlineMode.value || !T.value?.connected.value || x.value && !L.value || v.value || C.value || t.displayNoMessagesText && j(P).isChatEmpty.value),
|
|
10723
10720
|
"offline-mode": !!(T.value?.offlineMode.value && !O.value),
|
|
10724
10721
|
connected: !!(T.value?.connected.value || O.value),
|
|
10725
10722
|
loading: x.value,
|
|
10726
10723
|
"not-found": v.value,
|
|
10727
10724
|
"not-a-member": C.value,
|
|
10728
|
-
"is-empty": j(
|
|
10725
|
+
"is-empty": j(P).isChatEmpty.value,
|
|
10729
10726
|
"show-empty-slot": t.displayNoMessagesText,
|
|
10730
10727
|
messages: {
|
|
10731
10728
|
waitingForNetwork: j(m)("waitingForNetwork"),
|
|
@@ -10737,11 +10734,11 @@ var Uf = { class: "w-full" }, Wf = {
|
|
|
10737
10734
|
}
|
|
10738
10735
|
}, s({ _: 2 }, [n.$slots["no-messages"] ? {
|
|
10739
10736
|
name: "no-messages",
|
|
10740
|
-
fn:
|
|
10737
|
+
fn: I(() => [E(n.$slots, "no-messages")]),
|
|
10741
10738
|
key: "0"
|
|
10742
10739
|
} : void 0, n.$slots["not-a-member"] ? {
|
|
10743
10740
|
name: "not-a-member",
|
|
10744
|
-
fn:
|
|
10741
|
+
fn: I(() => [E(n.$slots, "not-a-member")]),
|
|
10745
10742
|
key: "1"
|
|
10746
10743
|
} : void 0]), 1032, [
|
|
10747
10744
|
"visible",
|