@bcc-code/vue-bcc-chat-ui 7.1.6 → 7.1.8
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 +4 -1
- package/dist/style.css +1 -1
- package/dist/vue-bcc-chat-ui.js +920 -837
- package/dist/vue-bcc-chat-ui.js.map +1 -1
- package/package.json +1 -1
package/dist/vue-bcc-chat-ui.js
CHANGED
|
@@ -101,28 +101,28 @@ function Te(e) {
|
|
|
101
101
|
}
|
|
102
102
|
//#endregion
|
|
103
103
|
//#region src/chat/cacheScope.ts
|
|
104
|
-
var Ee = ":chatCacheScope", De = ":chatCacheOwner",
|
|
105
|
-
function
|
|
104
|
+
var Ee = ":chatCacheScope", De = ":chatCacheOwner", G, Oe;
|
|
105
|
+
function ke(e) {
|
|
106
106
|
return `${W().appId}${e}`;
|
|
107
107
|
}
|
|
108
|
-
function
|
|
108
|
+
function Ae() {
|
|
109
109
|
return typeof crypto < "u" && typeof crypto.randomUUID == "function" ? crypto.randomUUID() : `${Date.now()}-${Math.random().toString(36).slice(2)}`;
|
|
110
110
|
}
|
|
111
|
-
function
|
|
112
|
-
return
|
|
111
|
+
function je() {
|
|
112
|
+
return G === void 0 && (G = localStorage.getItem(ke(Ee))), G;
|
|
113
113
|
}
|
|
114
|
-
function
|
|
115
|
-
return
|
|
114
|
+
function Me() {
|
|
115
|
+
return Oe === void 0 && (Oe = localStorage.getItem(ke(De))), Oe;
|
|
116
116
|
}
|
|
117
|
-
function
|
|
118
|
-
let t =
|
|
117
|
+
function Ne(e) {
|
|
118
|
+
let t = je(), n = Me();
|
|
119
119
|
if (t && n === e) return t;
|
|
120
|
-
let r =
|
|
121
|
-
return
|
|
120
|
+
let r = Ae();
|
|
121
|
+
return G = r, Oe = e, localStorage.setItem(ke(Ee), r), localStorage.setItem(ke(De), e), r;
|
|
122
122
|
}
|
|
123
123
|
//#endregion
|
|
124
124
|
//#region src/chat/localization.ts
|
|
125
|
-
var
|
|
125
|
+
var Pe = {
|
|
126
126
|
en: {
|
|
127
127
|
addOption: "Add option",
|
|
128
128
|
addToMessage: "Add to message",
|
|
@@ -361,134 +361,134 @@ var Fe = {
|
|
|
361
361
|
you: "Du",
|
|
362
362
|
youSentAMessage: "Du sendte en melding"
|
|
363
363
|
}
|
|
364
|
-
},
|
|
365
|
-
function
|
|
364
|
+
}, Fe = w("en");
|
|
365
|
+
function Ie(e) {
|
|
366
366
|
return e === "nb" || e === "no" ? "nb" : "en";
|
|
367
367
|
}
|
|
368
|
-
function
|
|
369
|
-
return
|
|
368
|
+
function K(e) {
|
|
369
|
+
return Ie(e) === "nb" ? "nb-NO" : "en-US";
|
|
370
370
|
}
|
|
371
|
-
function
|
|
371
|
+
function Le() {
|
|
372
372
|
return "h23";
|
|
373
373
|
}
|
|
374
|
-
function
|
|
375
|
-
|
|
374
|
+
function Re(e) {
|
|
375
|
+
Fe.value = e;
|
|
376
376
|
}
|
|
377
|
-
function
|
|
378
|
-
let r =
|
|
377
|
+
function ze(e, t, n) {
|
|
378
|
+
let r = Pe[Ie(n ?? Fe.value)][e] ?? Pe.en[e];
|
|
379
379
|
return typeof r == "function" ? r(t ?? {}) : r;
|
|
380
380
|
}
|
|
381
|
-
function
|
|
382
|
-
let t = n(() => A(e) ??
|
|
381
|
+
function q(e) {
|
|
382
|
+
let t = n(() => A(e) ?? Fe.value);
|
|
383
383
|
return {
|
|
384
|
-
locale: n(() =>
|
|
385
|
-
t: (e, n) =>
|
|
384
|
+
locale: n(() => K(t.value)),
|
|
385
|
+
t: (e, n) => ze(e, n, t.value)
|
|
386
386
|
};
|
|
387
387
|
}
|
|
388
388
|
//#endregion
|
|
389
389
|
//#region src/chat/mentions.ts
|
|
390
|
-
var
|
|
391
|
-
function
|
|
390
|
+
var Be = /<@uid:([^>]+)>/g, Ve = /<@uid:([^&]+)>/g, He = "mention:", Ue = "", We = "data-mention-uid", Ge = "composer-mention", Ke = "message-mention";
|
|
391
|
+
function qe(e) {
|
|
392
392
|
return {
|
|
393
393
|
uid: e.uid,
|
|
394
394
|
displayName: e.displayName,
|
|
395
395
|
avatar: e.avatar
|
|
396
396
|
};
|
|
397
397
|
}
|
|
398
|
-
function
|
|
398
|
+
function Je(e) {
|
|
399
399
|
let t = {};
|
|
400
400
|
for (let n of e) t[n.uid] = n.displayName;
|
|
401
401
|
return t;
|
|
402
402
|
}
|
|
403
|
-
function
|
|
403
|
+
function Ye(e, t, n = 8) {
|
|
404
404
|
let r = t.trim().toLowerCase(), i = e.filter((e) => e.displayName.trim().length > 0);
|
|
405
405
|
return r ? i.filter((e) => {
|
|
406
406
|
let t = e.displayName.toLowerCase(), n = e.uid.toLowerCase();
|
|
407
407
|
return t.includes(r) || n.includes(r);
|
|
408
408
|
}).slice(0, n) : i.slice(0, n);
|
|
409
409
|
}
|
|
410
|
-
function
|
|
410
|
+
function Xe(e) {
|
|
411
411
|
return `<@uid:${e}>`;
|
|
412
412
|
}
|
|
413
|
+
function Ze(e) {
|
|
414
|
+
return e.replace(Ve, (e, t) => Xe(t));
|
|
415
|
+
}
|
|
413
416
|
function Qe(e) {
|
|
414
|
-
return
|
|
417
|
+
return Be.lastIndex = 0, Ve.lastIndex = 0, Be.test(e) || Ve.test(e);
|
|
415
418
|
}
|
|
416
419
|
function $e(e) {
|
|
417
|
-
return Ve.lastIndex = 0, He.lastIndex = 0, Ve.test(e) || He.test(e);
|
|
418
|
-
}
|
|
419
|
-
function et(e) {
|
|
420
420
|
let t = [];
|
|
421
421
|
return {
|
|
422
|
-
shielded:
|
|
422
|
+
shielded: Ze(e).replace(Be, (e) => `${He}${t.push(e) - 1}${Ue}`),
|
|
423
423
|
tokens: t
|
|
424
424
|
};
|
|
425
425
|
}
|
|
426
|
-
function
|
|
427
|
-
let n = RegExp(`${
|
|
426
|
+
function et(e, t) {
|
|
427
|
+
let n = RegExp(`${He.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")}(\\d+)${Ue.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")}`, "g");
|
|
428
428
|
return e.replace(n, (e, n) => t[Number(n)] ?? "");
|
|
429
429
|
}
|
|
430
|
-
function
|
|
431
|
-
return e.replace(
|
|
430
|
+
function tt(e, t, n = Ke) {
|
|
431
|
+
return e.replace(Be, (e, r) => {
|
|
432
432
|
let i = t(r).trim() || r;
|
|
433
|
-
return `<span class="${n}" ${
|
|
433
|
+
return `<span class="${n}" ${We}="${dt(r)}">@${ft(i)}</span>`;
|
|
434
434
|
});
|
|
435
435
|
}
|
|
436
|
-
function
|
|
437
|
-
return
|
|
436
|
+
function nt(e, t = {}) {
|
|
437
|
+
return tt(e, (e) => t[e] ?? e, Ge);
|
|
438
438
|
}
|
|
439
|
-
function
|
|
440
|
-
return
|
|
439
|
+
function rt(e, t = {}) {
|
|
440
|
+
return tt(e, (e) => t[e] ?? e, Ke);
|
|
441
441
|
}
|
|
442
|
-
function
|
|
442
|
+
function it(e) {
|
|
443
443
|
if (!e) return "";
|
|
444
444
|
let t = new DOMParser().parseFromString(`<div>${e}</div>`, "text/html"), n = t.body.firstElementChild;
|
|
445
445
|
if (!n) return e;
|
|
446
|
-
for (let e of [...n.querySelectorAll(`span[${
|
|
447
|
-
let n = e.getAttribute(
|
|
448
|
-
n && e.replaceWith(t.createTextNode(
|
|
446
|
+
for (let e of [...n.querySelectorAll(`span[${We}]`)]) {
|
|
447
|
+
let n = e.getAttribute(We);
|
|
448
|
+
n && e.replaceWith(t.createTextNode(Xe(n)));
|
|
449
449
|
}
|
|
450
|
-
return
|
|
450
|
+
return at(n.innerHTML);
|
|
451
451
|
}
|
|
452
|
-
function
|
|
452
|
+
function at(e) {
|
|
453
453
|
return e.replace(/<@uid:([^&]+)>/g, "<@uid:$1>");
|
|
454
454
|
}
|
|
455
|
-
var
|
|
456
|
-
function
|
|
455
|
+
var ot = /@([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})/gi;
|
|
456
|
+
function st(e, t, n = "member") {
|
|
457
457
|
return t[e]?.trim() || n;
|
|
458
458
|
}
|
|
459
|
-
function
|
|
460
|
-
let t =
|
|
461
|
-
for (let
|
|
462
|
-
let
|
|
463
|
-
|
|
459
|
+
function ct(e) {
|
|
460
|
+
let t = {};
|
|
461
|
+
for (let n of e?.getMentionedUsers?.() ?? []) {
|
|
462
|
+
let e = n.getUid?.(), r = n.getName?.()?.trim();
|
|
463
|
+
e && r && (t[e] = r);
|
|
464
464
|
}
|
|
465
|
-
return
|
|
465
|
+
return t;
|
|
466
466
|
}
|
|
467
|
-
function
|
|
467
|
+
function lt(...e) {
|
|
468
468
|
let t = {};
|
|
469
469
|
for (let n of e) Object.assign(t, n);
|
|
470
470
|
return t;
|
|
471
471
|
}
|
|
472
|
-
function
|
|
473
|
-
return
|
|
472
|
+
function ut(e, t = {}) {
|
|
473
|
+
return Ze(e).replace(Be, (e, n) => `@${st(n, t)}`).replace(ot, (e, n) => `@${st(n, t)}`);
|
|
474
474
|
}
|
|
475
|
-
function
|
|
475
|
+
function dt(e) {
|
|
476
476
|
return e.replace(/&/g, "&").replace(/"/g, """).replace(/</g, "<");
|
|
477
477
|
}
|
|
478
|
-
function
|
|
478
|
+
function ft(e) {
|
|
479
479
|
return e.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">");
|
|
480
480
|
}
|
|
481
481
|
//#endregion
|
|
482
482
|
//#region node_modules/dompurify/dist/purify.es.mjs
|
|
483
|
-
function
|
|
483
|
+
function pt(e, t) {
|
|
484
484
|
(t == null || t > e.length) && (t = e.length);
|
|
485
485
|
for (var n = 0, r = Array(t); n < t; n++) r[n] = e[n];
|
|
486
486
|
return r;
|
|
487
487
|
}
|
|
488
|
-
function
|
|
488
|
+
function mt(e) {
|
|
489
489
|
if (Array.isArray(e)) return e;
|
|
490
490
|
}
|
|
491
|
-
function
|
|
491
|
+
function ht(e, t) {
|
|
492
492
|
var n = e == null ? null : typeof Symbol < "u" && e[Symbol.iterator] || e["@@iterator"];
|
|
493
493
|
if (n != null) {
|
|
494
494
|
var r, i, a, o, s = [], c = !0, l = !1;
|
|
@@ -506,99 +506,99 @@ function gt(e, t) {
|
|
|
506
506
|
return s;
|
|
507
507
|
}
|
|
508
508
|
}
|
|
509
|
-
function
|
|
509
|
+
function gt() {
|
|
510
510
|
throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
511
511
|
}
|
|
512
|
-
function
|
|
513
|
-
return
|
|
512
|
+
function _t(e, t) {
|
|
513
|
+
return mt(e) || ht(e, t) || vt(e, t) || gt();
|
|
514
514
|
}
|
|
515
|
-
function
|
|
515
|
+
function vt(e, t) {
|
|
516
516
|
if (e) {
|
|
517
|
-
if (typeof e == "string") return
|
|
517
|
+
if (typeof e == "string") return pt(e, t);
|
|
518
518
|
var n = {}.toString.call(e).slice(8, -1);
|
|
519
|
-
return n === "Object" && e.constructor && (n = e.constructor.name), n === "Map" || n === "Set" ? Array.from(e) : n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) ?
|
|
519
|
+
return n === "Object" && e.constructor && (n = e.constructor.name), n === "Map" || n === "Set" ? Array.from(e) : n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) ? pt(e, t) : void 0;
|
|
520
520
|
}
|
|
521
521
|
}
|
|
522
|
-
var
|
|
523
|
-
|
|
522
|
+
var yt = Object.entries, bt = Object.setPrototypeOf, xt = Object.isFrozen, St = Object.getPrototypeOf, Ct = Object.getOwnPropertyDescriptor, wt = Object.freeze, Tt = Object.seal, Et = Object.create, Dt = typeof Reflect < "u" && Reflect, Ot = Dt.apply, kt = Dt.construct;
|
|
523
|
+
wt ||= function(e) {
|
|
524
524
|
return e;
|
|
525
|
-
},
|
|
525
|
+
}, Tt ||= function(e) {
|
|
526
526
|
return e;
|
|
527
|
-
},
|
|
527
|
+
}, Ot ||= function(e, t) {
|
|
528
528
|
var n = [...arguments].slice(2);
|
|
529
529
|
return e.apply(t, n);
|
|
530
|
-
},
|
|
530
|
+
}, kt ||= function(e) {
|
|
531
531
|
return new e(...[...arguments].slice(1));
|
|
532
532
|
};
|
|
533
|
-
var
|
|
534
|
-
function
|
|
533
|
+
var At = Jt(Array.prototype.forEach), jt = Jt(Array.prototype.lastIndexOf), Mt = Jt(Array.prototype.pop), Nt = Jt(Array.prototype.push), Pt = Jt(Array.prototype.splice), J = Array.isArray, Ft = Jt(String.prototype.toLowerCase), It = Jt(String.prototype.toString), Lt = Jt(String.prototype.match), Rt = Jt(String.prototype.replace), zt = Jt(String.prototype.indexOf), Bt = Jt(String.prototype.trim), Vt = Jt(Number.prototype.toString), Ht = Jt(Boolean.prototype.toString), Ut = typeof BigInt > "u" ? null : Jt(BigInt.prototype.toString), Wt = typeof Symbol > "u" ? null : Jt(Symbol.prototype.toString), Y = Jt(Object.prototype.hasOwnProperty), Gt = Jt(Object.prototype.toString), Kt = Jt(RegExp.prototype.test), qt = Yt(TypeError);
|
|
534
|
+
function Jt(e) {
|
|
535
535
|
return function(t) {
|
|
536
536
|
t instanceof RegExp && (t.lastIndex = 0);
|
|
537
537
|
var n = [...arguments].slice(1);
|
|
538
|
-
return
|
|
538
|
+
return Ot(e, t, n);
|
|
539
539
|
};
|
|
540
540
|
}
|
|
541
541
|
function Yt(e) {
|
|
542
542
|
return function() {
|
|
543
|
-
return
|
|
543
|
+
return kt(e, [...arguments]);
|
|
544
544
|
};
|
|
545
545
|
}
|
|
546
546
|
function X(e, t) {
|
|
547
|
-
let n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] :
|
|
548
|
-
if (
|
|
547
|
+
let n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : Ft;
|
|
548
|
+
if (bt && bt(e, null), !J(t)) return e;
|
|
549
549
|
let r = t.length;
|
|
550
550
|
for (; r--;) {
|
|
551
551
|
let i = t[r];
|
|
552
552
|
if (typeof i == "string") {
|
|
553
553
|
let e = n(i);
|
|
554
|
-
e !== i && (
|
|
554
|
+
e !== i && (xt(t) || (t[r] = e), i = e);
|
|
555
555
|
}
|
|
556
556
|
e[i] = !0;
|
|
557
557
|
}
|
|
558
558
|
return e;
|
|
559
559
|
}
|
|
560
560
|
function Xt(e) {
|
|
561
|
-
for (let t = 0; t < e.length; t++)
|
|
561
|
+
for (let t = 0; t < e.length; t++) Y(e, t) || (e[t] = null);
|
|
562
562
|
return e;
|
|
563
563
|
}
|
|
564
564
|
function Zt(e) {
|
|
565
|
-
let t =
|
|
566
|
-
for (let r of
|
|
567
|
-
var n =
|
|
565
|
+
let t = Et(null);
|
|
566
|
+
for (let r of yt(e)) {
|
|
567
|
+
var n = _t(r, 2);
|
|
568
568
|
let i = n[0], a = n[1];
|
|
569
|
-
|
|
569
|
+
Y(e, i) && (J(a) ? t[i] = Xt(a) : a && typeof a == "object" && a.constructor === Object ? t[i] = Zt(a) : t[i] = a);
|
|
570
570
|
}
|
|
571
571
|
return t;
|
|
572
572
|
}
|
|
573
573
|
function Qt(e) {
|
|
574
574
|
switch (typeof e) {
|
|
575
575
|
case "string": return e;
|
|
576
|
-
case "number": return
|
|
577
|
-
case "boolean": return
|
|
578
|
-
case "bigint": return
|
|
579
|
-
case "symbol": return
|
|
580
|
-
case "undefined": return
|
|
576
|
+
case "number": return Vt(e);
|
|
577
|
+
case "boolean": return Ht(e);
|
|
578
|
+
case "bigint": return Ut ? Ut(e) : "0";
|
|
579
|
+
case "symbol": return Wt ? Wt(e) : "Symbol()";
|
|
580
|
+
case "undefined": return Gt(e);
|
|
581
581
|
case "function":
|
|
582
582
|
case "object": {
|
|
583
|
-
if (e === null) return
|
|
583
|
+
if (e === null) return Gt(e);
|
|
584
584
|
let t = e, n = $t(t, "toString");
|
|
585
585
|
if (typeof n == "function") {
|
|
586
586
|
let e = n(t);
|
|
587
|
-
return typeof e == "string" ? e :
|
|
587
|
+
return typeof e == "string" ? e : Gt(e);
|
|
588
588
|
}
|
|
589
|
-
return
|
|
589
|
+
return Gt(e);
|
|
590
590
|
}
|
|
591
|
-
default: return
|
|
591
|
+
default: return Gt(e);
|
|
592
592
|
}
|
|
593
593
|
}
|
|
594
594
|
function $t(e, t) {
|
|
595
595
|
for (; e !== null;) {
|
|
596
|
-
let n =
|
|
596
|
+
let n = Ct(e, t);
|
|
597
597
|
if (n) {
|
|
598
|
-
if (n.get) return
|
|
599
|
-
if (typeof n.value == "function") return
|
|
598
|
+
if (n.get) return Jt(n.get);
|
|
599
|
+
if (typeof n.value == "function") return Jt(n.value);
|
|
600
600
|
}
|
|
601
|
-
e =
|
|
601
|
+
e = St(e);
|
|
602
602
|
}
|
|
603
603
|
function n() {
|
|
604
604
|
return null;
|
|
@@ -607,12 +607,12 @@ function $t(e, t) {
|
|
|
607
607
|
}
|
|
608
608
|
function en(e) {
|
|
609
609
|
try {
|
|
610
|
-
return
|
|
610
|
+
return Kt(e, ""), !0;
|
|
611
611
|
} catch {
|
|
612
612
|
return !1;
|
|
613
613
|
}
|
|
614
614
|
}
|
|
615
|
-
var tn =
|
|
615
|
+
var tn = wt(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bdi.bdo.big.blink.blockquote.body.br.button.canvas.caption.center.cite.code.col.colgroup.content.data.datalist.dd.decorator.del.details.dfn.dialog.dir.div.dl.dt.element.em.fieldset.figcaption.figure.font.footer.form.h1.h2.h3.h4.h5.h6.head.header.hgroup.hr.html.i.img.input.ins.kbd.label.legend.li.main.map.mark.marquee.menu.menuitem.meter.nav.nobr.ol.optgroup.option.output.p.picture.pre.progress.q.rp.rt.ruby.s.samp.search.section.select.shadow.slot.small.source.spacer.span.strike.strong.style.sub.summary.sup.table.tbody.td.template.textarea.tfoot.th.thead.time.tr.track.tt.u.ul.var.video.wbr".split(".")), nn = wt(/* @__PURE__ */ "svg.a.altglyph.altglyphdef.altglyphitem.animatecolor.animatemotion.animatetransform.circle.clippath.defs.desc.ellipse.enterkeyhint.exportparts.filter.font.g.glyph.glyphref.hkern.image.inputmode.line.lineargradient.marker.mask.metadata.mpath.part.path.pattern.polygon.polyline.radialgradient.rect.stop.style.switch.symbol.text.textpath.title.tref.tspan.view.vkern".split(".")), rn = wt([
|
|
616
616
|
"feBlend",
|
|
617
617
|
"feColorMatrix",
|
|
618
618
|
"feComponentTransfer",
|
|
@@ -638,7 +638,7 @@ var tn = Tt(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.b
|
|
|
638
638
|
"feSpotLight",
|
|
639
639
|
"feTile",
|
|
640
640
|
"feTurbulence"
|
|
641
|
-
]), an =
|
|
641
|
+
]), an = wt([
|
|
642
642
|
"animate",
|
|
643
643
|
"color-profile",
|
|
644
644
|
"cursor",
|
|
@@ -661,7 +661,7 @@ var tn = Tt(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.b
|
|
|
661
661
|
"solidcolor",
|
|
662
662
|
"unknown",
|
|
663
663
|
"use"
|
|
664
|
-
]), on =
|
|
664
|
+
]), on = wt(/* @__PURE__ */ "math.menclose.merror.mfenced.mfrac.mglyph.mi.mlabeledtr.mmultiscripts.mn.mo.mover.mpadded.mphantom.mroot.mrow.ms.mspace.msqrt.mstyle.msub.msup.msubsup.mtable.mtd.mtext.mtr.munder.munderover.mprescripts".split(".")), sn = wt([
|
|
665
665
|
"maction",
|
|
666
666
|
"maligngroup",
|
|
667
667
|
"malignmark",
|
|
@@ -677,13 +677,13 @@ var tn = Tt(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.b
|
|
|
677
677
|
"annotation-xml",
|
|
678
678
|
"mprescripts",
|
|
679
679
|
"none"
|
|
680
|
-
]), cn =
|
|
680
|
+
]), cn = wt(["#text"]), ln = wt(/* @__PURE__ */ "accept.action.align.alt.autocapitalize.autocomplete.autopictureinpicture.autoplay.background.bgcolor.border.capture.cellpadding.cellspacing.checked.cite.class.clear.color.cols.colspan.controls.controlslist.coords.crossorigin.datetime.decoding.default.dir.disabled.disablepictureinpicture.disableremoteplayback.download.draggable.enctype.enterkeyhint.exportparts.face.for.headers.height.hidden.high.href.hreflang.id.inert.inputmode.integrity.ismap.kind.label.lang.list.loading.loop.low.max.maxlength.media.method.min.minlength.multiple.muted.name.nonce.noshade.novalidate.nowrap.open.optimum.part.pattern.placeholder.playsinline.popover.popovertarget.popovertargetaction.poster.preload.pubdate.radiogroup.readonly.rel.required.rev.reversed.role.rows.rowspan.spellcheck.scope.selected.shape.size.sizes.slot.span.srclang.start.src.srcset.step.style.summary.tabindex.title.translate.type.usemap.valign.value.width.wrap.xmlns".split(".")), un = wt(/* @__PURE__ */ "accent-height.accumulate.additive.alignment-baseline.amplitude.ascent.attributename.attributetype.azimuth.basefrequency.baseline-shift.begin.bias.by.class.clip.clippathunits.clip-path.clip-rule.color.color-interpolation.color-interpolation-filters.color-profile.color-rendering.cx.cy.d.dx.dy.diffuseconstant.direction.display.divisor.dur.edgemode.elevation.end.exponent.fill.fill-opacity.fill-rule.filter.filterunits.flood-color.flood-opacity.font-family.font-size.font-size-adjust.font-stretch.font-style.font-variant.font-weight.fx.fy.g1.g2.glyph-name.glyphref.gradientunits.gradienttransform.height.href.id.image-rendering.in.in2.intercept.k.k1.k2.k3.k4.kerning.keypoints.keysplines.keytimes.lang.lengthadjust.letter-spacing.kernelmatrix.kernelunitlength.lighting-color.local.marker-end.marker-mid.marker-start.markerheight.markerunits.markerwidth.maskcontentunits.maskunits.max.mask.mask-type.media.method.mode.min.name.numoctaves.offset.operator.opacity.order.orient.orientation.origin.overflow.paint-order.path.pathlength.patterncontentunits.patterntransform.patternunits.points.preservealpha.preserveaspectratio.primitiveunits.r.rx.ry.radius.refx.refy.repeatcount.repeatdur.restart.result.rotate.scale.seed.shape-rendering.slope.specularconstant.specularexponent.spreadmethod.startoffset.stddeviation.stitchtiles.stop-color.stop-opacity.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke.stroke-width.style.surfacescale.systemlanguage.tabindex.tablevalues.targetx.targety.transform.transform-origin.text-anchor.text-decoration.text-rendering.textlength.type.u1.u2.unicode.values.viewbox.visibility.version.vert-adv-y.vert-origin-x.vert-origin-y.width.word-spacing.wrap.writing-mode.xchannelselector.ychannelselector.x.x1.x2.xmlns.y.y1.y2.z.zoomandpan".split(".")), dn = wt(/* @__PURE__ */ "accent.accentunder.align.bevelled.close.columnalign.columnlines.columnspacing.columnspan.denomalign.depth.dir.display.displaystyle.encoding.fence.frame.height.href.id.largeop.length.linethickness.lquote.lspace.mathbackground.mathcolor.mathsize.mathvariant.maxsize.minsize.movablelimits.notation.numalign.open.rowalign.rowlines.rowspacing.rowspan.rspace.rquote.scriptlevel.scriptminsize.scriptsizemultiplier.selection.separator.separators.stretchy.subscriptshift.supscriptshift.symmetric.voffset.width.xmlns".split(".")), fn = wt([
|
|
681
681
|
"xlink:href",
|
|
682
682
|
"xml:id",
|
|
683
683
|
"xlink:title",
|
|
684
684
|
"xml:space",
|
|
685
685
|
"xmlns:xlink"
|
|
686
|
-
]), pn =
|
|
686
|
+
]), pn = Tt(/{{[\w\W]*|^[\w\W]*}}/g), mn = Tt(/<%[\w\W]*|^[\w\W]*%>/g), hn = Tt(/\${[\w\W]*/g), gn = Tt(/^data-[\-\w.\u00B7-\uFFFF]+$/), _n = Tt(/^aria-[\-\w]+$/), vn = Tt(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i), yn = Tt(/^(?:\w+script|data):/i), bn = Tt(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g), xn = Tt(/^html$/i), Sn = Tt(/^[a-z][.\w]*(-[.\w]+)+$/i), Cn = {
|
|
687
687
|
element: 1,
|
|
688
688
|
text: 3,
|
|
689
689
|
progressingInstruction: 7,
|
|
@@ -730,7 +730,7 @@ function Dn() {
|
|
|
730
730
|
e.content && e.content.ownerDocument && (n = e.content.ownerDocument);
|
|
731
731
|
}
|
|
732
732
|
let x, S = "", C = n, w = C.implementation, T = C.createNodeIterator, E = C.createDocumentFragment, D = C.getElementsByTagName, O = r.importNode, k = En();
|
|
733
|
-
t.isSupported = typeof
|
|
733
|
+
t.isSupported = typeof yt == "function" && typeof b == "function" && w && w.createHTMLDocument !== void 0;
|
|
734
734
|
let A = pn, j = mn, M = hn, ee = gn, N = _n, P = yn, F = bn, I = Sn, te = vn, L = null, R = X({}, [
|
|
735
735
|
...tn,
|
|
736
736
|
...nn,
|
|
@@ -742,7 +742,7 @@ function Dn() {
|
|
|
742
742
|
...un,
|
|
743
743
|
...dn,
|
|
744
744
|
...fn
|
|
745
|
-
]), B = Object.seal(
|
|
745
|
+
]), B = Object.seal(Et(null, {
|
|
746
746
|
tagNameCheck: {
|
|
747
747
|
writable: !0,
|
|
748
748
|
configurable: !1,
|
|
@@ -761,7 +761,7 @@ function Dn() {
|
|
|
761
761
|
enumerable: !0,
|
|
762
762
|
value: !1
|
|
763
763
|
}
|
|
764
|
-
})), re = null, ie = null, V = Object.seal(
|
|
764
|
+
})), re = null, ie = null, V = Object.seal(Et(null, {
|
|
765
765
|
tagCheck: {
|
|
766
766
|
writable: !0,
|
|
767
767
|
configurable: !1,
|
|
@@ -822,124 +822,124 @@ function Dn() {
|
|
|
822
822
|
"value",
|
|
823
823
|
"style",
|
|
824
824
|
"xmlns"
|
|
825
|
-
]), Ee = "http://www.w3.org/1998/Math/MathML", De = "http://www.w3.org/2000/svg",
|
|
825
|
+
]), Ee = "http://www.w3.org/1998/Math/MathML", De = "http://www.w3.org/2000/svg", G = "http://www.w3.org/1999/xhtml", Oe = G, ke = !1, Ae = null, je = X({}, [
|
|
826
826
|
Ee,
|
|
827
827
|
De,
|
|
828
|
-
|
|
829
|
-
],
|
|
828
|
+
G
|
|
829
|
+
], It), Me = X({}, [
|
|
830
830
|
"mi",
|
|
831
831
|
"mo",
|
|
832
832
|
"mn",
|
|
833
833
|
"ms",
|
|
834
834
|
"mtext"
|
|
835
|
-
]),
|
|
835
|
+
]), Ne = X({}, ["annotation-xml"]), Pe = X({}, [
|
|
836
836
|
"title",
|
|
837
837
|
"style",
|
|
838
838
|
"font",
|
|
839
839
|
"a",
|
|
840
840
|
"script"
|
|
841
|
-
]),
|
|
841
|
+
]), Fe = null, Ie = ["application/xhtml+xml", "text/html"], K = null, Le = null, Re = n.createElement("form"), ze = function(e) {
|
|
842
842
|
return e instanceof RegExp || e instanceof Function;
|
|
843
|
-
},
|
|
843
|
+
}, q = function() {
|
|
844
844
|
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
845
|
-
if (
|
|
846
|
-
(!e || typeof e != "object") && (e = {}), e = Zt(e),
|
|
845
|
+
if (Le && Le === e) return;
|
|
846
|
+
(!e || typeof e != "object") && (e = {}), e = Zt(e), Fe = Ie.indexOf(e.PARSER_MEDIA_TYPE) === -1 ? "text/html" : e.PARSER_MEDIA_TYPE, K = Fe === "application/xhtml+xml" ? It : Ft, L = Y(e, "ALLOWED_TAGS") && J(e.ALLOWED_TAGS) ? X({}, e.ALLOWED_TAGS, K) : R, z = Y(e, "ALLOWED_ATTR") && J(e.ALLOWED_ATTR) ? X({}, e.ALLOWED_ATTR, K) : ne, Ae = Y(e, "ALLOWED_NAMESPACES") && J(e.ALLOWED_NAMESPACES) ? X({}, e.ALLOWED_NAMESPACES, It) : je, we = Y(e, "ADD_URI_SAFE_ATTR") && J(e.ADD_URI_SAFE_ATTR) ? X(Zt(Te), e.ADD_URI_SAFE_ATTR, K) : Te, Se = Y(e, "ADD_DATA_URI_TAGS") && J(e.ADD_DATA_URI_TAGS) ? X(Zt(Ce), e.ADD_DATA_URI_TAGS, K) : Ce, be = Y(e, "FORBID_CONTENTS") && J(e.FORBID_CONTENTS) ? X({}, e.FORBID_CONTENTS, K) : xe, re = Y(e, "FORBID_TAGS") && J(e.FORBID_TAGS) ? X({}, e.FORBID_TAGS, K) : Zt({}), ie = Y(e, "FORBID_ATTR") && J(e.FORBID_ATTR) ? X({}, e.FORBID_ATTR, K) : Zt({}), ye = Y(e, "USE_PROFILES") ? e.USE_PROFILES && typeof e.USE_PROFILES == "object" ? Zt(e.USE_PROFILES) : e.USE_PROFILES : !1, ae = e.ALLOW_ARIA_ATTR !== !1, H = e.ALLOW_DATA_ATTR !== !1, oe = e.ALLOW_UNKNOWN_PROTOCOLS || !1, U = e.ALLOW_SELF_CLOSE_IN_ATTR !== !1, se = e.SAFE_FOR_TEMPLATES || !1, ce = e.SAFE_FOR_XML !== !1, le = e.WHOLE_DOCUMENT || !1, W = e.RETURN_DOM || !1, fe = e.RETURN_DOM_FRAGMENT || !1, pe = e.RETURN_TRUSTED_TYPE || !1, de = e.FORCE_BODY || !1, me = e.SANITIZE_DOM !== !1, he = e.SANITIZE_NAMED_PROPS || !1, _e = e.KEEP_CONTENT !== !1, ve = e.IN_PLACE || !1, te = en(e.ALLOWED_URI_REGEXP) ? e.ALLOWED_URI_REGEXP : vn, Oe = typeof e.NAMESPACE == "string" ? e.NAMESPACE : G, Me = Y(e, "MATHML_TEXT_INTEGRATION_POINTS") && e.MATHML_TEXT_INTEGRATION_POINTS && typeof e.MATHML_TEXT_INTEGRATION_POINTS == "object" ? Zt(e.MATHML_TEXT_INTEGRATION_POINTS) : X({}, [
|
|
847
847
|
"mi",
|
|
848
848
|
"mo",
|
|
849
849
|
"mn",
|
|
850
850
|
"ms",
|
|
851
851
|
"mtext"
|
|
852
|
-
]),
|
|
853
|
-
let t =
|
|
854
|
-
if (B =
|
|
852
|
+
]), Ne = Y(e, "HTML_INTEGRATION_POINTS") && e.HTML_INTEGRATION_POINTS && typeof e.HTML_INTEGRATION_POINTS == "object" ? Zt(e.HTML_INTEGRATION_POINTS) : X({}, ["annotation-xml"]);
|
|
853
|
+
let t = Y(e, "CUSTOM_ELEMENT_HANDLING") && e.CUSTOM_ELEMENT_HANDLING && typeof e.CUSTOM_ELEMENT_HANDLING == "object" ? Zt(e.CUSTOM_ELEMENT_HANDLING) : Et(null);
|
|
854
|
+
if (B = Et(null), Y(t, "tagNameCheck") && ze(t.tagNameCheck) && (B.tagNameCheck = t.tagNameCheck), Y(t, "attributeNameCheck") && ze(t.attributeNameCheck) && (B.attributeNameCheck = t.attributeNameCheck), Y(t, "allowCustomizedBuiltInElements") && typeof t.allowCustomizedBuiltInElements == "boolean" && (B.allowCustomizedBuiltInElements = t.allowCustomizedBuiltInElements), se && (H = !1), fe && (W = !0), ye && (L = X({}, cn), z = Et(null), ye.html === !0 && (X(L, tn), X(z, ln)), ye.svg === !0 && (X(L, nn), X(z, un), X(z, fn)), ye.svgFilters === !0 && (X(L, rn), X(z, un), X(z, fn)), ye.mathMl === !0 && (X(L, on), X(z, dn), X(z, fn))), V.tagCheck = null, V.attributeCheck = null, Y(e, "ADD_TAGS") && (typeof e.ADD_TAGS == "function" ? V.tagCheck = e.ADD_TAGS : J(e.ADD_TAGS) && (L === R && (L = Zt(L)), X(L, e.ADD_TAGS, K))), Y(e, "ADD_ATTR") && (typeof e.ADD_ATTR == "function" ? V.attributeCheck = e.ADD_ATTR : J(e.ADD_ATTR) && (z === ne && (z = Zt(z)), X(z, e.ADD_ATTR, K))), Y(e, "ADD_URI_SAFE_ATTR") && J(e.ADD_URI_SAFE_ATTR) && X(we, e.ADD_URI_SAFE_ATTR, K), Y(e, "FORBID_CONTENTS") && J(e.FORBID_CONTENTS) && (be === xe && (be = Zt(be)), X(be, e.FORBID_CONTENTS, K)), Y(e, "ADD_FORBID_CONTENTS") && J(e.ADD_FORBID_CONTENTS) && (be === xe && (be = Zt(be)), X(be, e.ADD_FORBID_CONTENTS, K)), _e && (L["#text"] = !0), le && X(L, [
|
|
855
855
|
"html",
|
|
856
856
|
"head",
|
|
857
857
|
"body"
|
|
858
858
|
]), L.table && (X(L, ["tbody"]), delete re.tbody), e.TRUSTED_TYPES_POLICY) {
|
|
859
|
-
if (typeof e.TRUSTED_TYPES_POLICY.createHTML != "function") throw
|
|
860
|
-
if (typeof e.TRUSTED_TYPES_POLICY.createScriptURL != "function") throw
|
|
859
|
+
if (typeof e.TRUSTED_TYPES_POLICY.createHTML != "function") throw qt("TRUSTED_TYPES_POLICY configuration option must provide a \"createHTML\" hook.");
|
|
860
|
+
if (typeof e.TRUSTED_TYPES_POLICY.createScriptURL != "function") throw qt("TRUSTED_TYPES_POLICY configuration option must provide a \"createScriptURL\" hook.");
|
|
861
861
|
x = e.TRUSTED_TYPES_POLICY, S = x.createHTML("");
|
|
862
862
|
} else x === void 0 && (x = Tn(m, i)), x !== null && typeof S == "string" && (S = x.createHTML(""));
|
|
863
|
-
|
|
864
|
-
},
|
|
863
|
+
wt && wt(e), Le = e;
|
|
864
|
+
}, Be = X({}, [
|
|
865
865
|
...nn,
|
|
866
866
|
...rn,
|
|
867
867
|
...an
|
|
868
|
-
]),
|
|
868
|
+
]), Ve = X({}, [...on, ...sn]), He = function(e) {
|
|
869
869
|
let t = b(e);
|
|
870
870
|
(!t || !t.tagName) && (t = {
|
|
871
|
-
namespaceURI:
|
|
871
|
+
namespaceURI: Oe,
|
|
872
872
|
tagName: "template"
|
|
873
873
|
});
|
|
874
|
-
let n =
|
|
875
|
-
return
|
|
876
|
-
},
|
|
877
|
-
|
|
874
|
+
let n = Ft(e.tagName), r = Ft(t.tagName);
|
|
875
|
+
return Ae[e.namespaceURI] ? e.namespaceURI === De ? t.namespaceURI === G ? n === "svg" : t.namespaceURI === Ee ? n === "svg" && (r === "annotation-xml" || Me[r]) : !!Be[n] : e.namespaceURI === Ee ? t.namespaceURI === G ? n === "math" : t.namespaceURI === De ? n === "math" && Ne[r] : !!Ve[n] : e.namespaceURI === G ? t.namespaceURI === De && !Ne[r] || t.namespaceURI === Ee && !Me[r] ? !1 : !Ve[n] && (Pe[n] || !Be[n]) : !!(Fe === "application/xhtml+xml" && Ae[e.namespaceURI]) : !1;
|
|
876
|
+
}, Ue = function(e) {
|
|
877
|
+
Nt(t.removed, { element: e });
|
|
878
878
|
try {
|
|
879
879
|
b(e).removeChild(e);
|
|
880
880
|
} catch {
|
|
881
881
|
_(e);
|
|
882
882
|
}
|
|
883
|
-
},
|
|
883
|
+
}, We = function(e, n) {
|
|
884
884
|
try {
|
|
885
|
-
|
|
885
|
+
Nt(t.removed, {
|
|
886
886
|
attribute: n.getAttributeNode(e),
|
|
887
887
|
from: n
|
|
888
888
|
});
|
|
889
889
|
} catch {
|
|
890
|
-
|
|
890
|
+
Nt(t.removed, {
|
|
891
891
|
attribute: null,
|
|
892
892
|
from: n
|
|
893
893
|
});
|
|
894
894
|
}
|
|
895
895
|
if (n.removeAttribute(e), e === "is") if (W || fe) try {
|
|
896
|
-
|
|
896
|
+
Ue(n);
|
|
897
897
|
} catch {}
|
|
898
898
|
else try {
|
|
899
899
|
n.setAttribute(e, "");
|
|
900
900
|
} catch {}
|
|
901
|
-
},
|
|
901
|
+
}, Ge = function(e) {
|
|
902
902
|
let t = null, r = null;
|
|
903
903
|
if (de) e = "<remove></remove>" + e;
|
|
904
904
|
else {
|
|
905
|
-
let t =
|
|
905
|
+
let t = Lt(e, /^[\r\n\t ]+/);
|
|
906
906
|
r = t && t[0];
|
|
907
907
|
}
|
|
908
|
-
|
|
908
|
+
Fe === "application/xhtml+xml" && Oe === G && (e = "<html xmlns=\"http://www.w3.org/1999/xhtml\"><head></head><body>" + e + "</body></html>");
|
|
909
909
|
let i = x ? x.createHTML(e) : e;
|
|
910
|
-
if (
|
|
911
|
-
t = new p().parseFromString(i,
|
|
910
|
+
if (Oe === G) try {
|
|
911
|
+
t = new p().parseFromString(i, Fe);
|
|
912
912
|
} catch {}
|
|
913
913
|
if (!t || !t.documentElement) {
|
|
914
|
-
t = w.createDocument(
|
|
914
|
+
t = w.createDocument(Oe, "template", null);
|
|
915
915
|
try {
|
|
916
|
-
t.documentElement.innerHTML =
|
|
916
|
+
t.documentElement.innerHTML = ke ? S : i;
|
|
917
917
|
} catch {}
|
|
918
918
|
}
|
|
919
919
|
let a = t.body || t.documentElement;
|
|
920
|
-
return e && r && a.insertBefore(n.createTextNode(r), a.childNodes[0] || null),
|
|
921
|
-
},
|
|
920
|
+
return e && r && a.insertBefore(n.createTextNode(r), a.childNodes[0] || null), Oe === G ? D.call(t, le ? "html" : "body")[0] : le ? t.documentElement : a;
|
|
921
|
+
}, Ke = function(e) {
|
|
922
922
|
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);
|
|
923
|
-
},
|
|
923
|
+
}, qe = function(e) {
|
|
924
924
|
return e instanceof f && (typeof e.nodeName != "string" || typeof e.textContent != "string" || typeof e.removeChild != "function" || !(e.attributes instanceof d) || typeof e.removeAttribute != "function" || typeof e.setAttribute != "function" || typeof e.namespaceURI != "string" || typeof e.insertBefore != "function" || typeof e.hasChildNodes != "function");
|
|
925
|
-
},
|
|
925
|
+
}, Je = function(e) {
|
|
926
926
|
return typeof s == "function" && e instanceof s;
|
|
927
927
|
};
|
|
928
|
-
function
|
|
929
|
-
|
|
930
|
-
e.call(t, n, r,
|
|
928
|
+
function Ye(e, n, r) {
|
|
929
|
+
At(e, (e) => {
|
|
930
|
+
e.call(t, n, r, Le);
|
|
931
931
|
});
|
|
932
932
|
}
|
|
933
|
-
let
|
|
933
|
+
let Xe = function(e) {
|
|
934
934
|
let n = null;
|
|
935
|
-
if (
|
|
936
|
-
let r =
|
|
937
|
-
if (
|
|
935
|
+
if (Ye(k.beforeSanitizeElements, e, null), qe(e)) return Ue(e), !0;
|
|
936
|
+
let r = K(e.nodeName);
|
|
937
|
+
if (Ye(k.uponSanitizeElement, e, {
|
|
938
938
|
tagName: r,
|
|
939
939
|
allowedTags: L
|
|
940
|
-
}), ce && e.hasChildNodes() && !
|
|
940
|
+
}), ce && e.hasChildNodes() && !Je(e.firstElementChild) && Kt(/<[/\w!]/g, e.innerHTML) && Kt(/<[/\w!]/g, e.textContent) || ce && e.namespaceURI === G && r === "style" && Je(e.firstElementChild) || e.nodeType === Cn.progressingInstruction || ce && e.nodeType === Cn.comment && Kt(/<[/\w]/g, e.data)) return Ue(e), !0;
|
|
941
941
|
if (re[r] || !(V.tagCheck instanceof Function && V.tagCheck(r)) && !L[r]) {
|
|
942
|
-
if (!re[r] &&
|
|
942
|
+
if (!re[r] && $e(r) && (B.tagNameCheck instanceof RegExp && Kt(B.tagNameCheck, r) || B.tagNameCheck instanceof Function && B.tagNameCheck(r))) return !1;
|
|
943
943
|
if (_e && !be[r]) {
|
|
944
944
|
let t = b(e) || e.parentNode, n = y(e) || e.childNodes;
|
|
945
945
|
if (n && t) {
|
|
@@ -950,25 +950,25 @@ function Dn() {
|
|
|
950
950
|
}
|
|
951
951
|
}
|
|
952
952
|
}
|
|
953
|
-
return
|
|
953
|
+
return Ue(e), !0;
|
|
954
954
|
}
|
|
955
|
-
return e instanceof c && !
|
|
955
|
+
return e instanceof c && !He(e) || (r === "noscript" || r === "noembed" || r === "noframes") && Kt(/<\/no(script|embed|frames)/i, e.innerHTML) ? (Ue(e), !0) : (se && e.nodeType === Cn.text && (n = e.textContent, At([
|
|
956
956
|
A,
|
|
957
957
|
j,
|
|
958
958
|
M
|
|
959
959
|
], (e) => {
|
|
960
|
-
n =
|
|
961
|
-
}), e.textContent !== n && (
|
|
962
|
-
},
|
|
963
|
-
if (ie[t] || me && (t === "id" || t === "name") && (r in n || r in
|
|
960
|
+
n = Rt(n, e, " ");
|
|
961
|
+
}), e.textContent !== n && (Nt(t.removed, { element: e.cloneNode() }), e.textContent = n)), Ye(k.afterSanitizeElements, e, null), !1);
|
|
962
|
+
}, Ze = function(e, t, r) {
|
|
963
|
+
if (ie[t] || me && (t === "id" || t === "name") && (r in n || r in Re)) return !1;
|
|
964
964
|
let i = z[t] || V.attributeCheck instanceof Function && V.attributeCheck(t, e);
|
|
965
|
-
if (!(H && !ie[t] &&
|
|
965
|
+
if (!(H && !ie[t] && Kt(ee, t)) && !(ae && Kt(N, t))) {
|
|
966
966
|
if (!i || ie[t]) {
|
|
967
|
-
if (!(
|
|
968
|
-
} else if (!we[t] && !
|
|
967
|
+
if (!($e(e) && (B.tagNameCheck instanceof RegExp && Kt(B.tagNameCheck, e) || B.tagNameCheck instanceof Function && B.tagNameCheck(e)) && (B.attributeNameCheck instanceof RegExp && Kt(B.attributeNameCheck, t) || B.attributeNameCheck instanceof Function && B.attributeNameCheck(t, e)) || t === "is" && B.allowCustomizedBuiltInElements && (B.tagNameCheck instanceof RegExp && Kt(B.tagNameCheck, r) || B.tagNameCheck instanceof Function && B.tagNameCheck(r)))) return !1;
|
|
968
|
+
} else if (!we[t] && !Kt(te, Rt(r, F, "")) && !((t === "src" || t === "xlink:href" || t === "href") && e !== "script" && zt(r, "data:") === 0 && Se[e]) && !(oe && !Kt(P, Rt(r, F, ""))) && r) return !1;
|
|
969
969
|
}
|
|
970
970
|
return !0;
|
|
971
|
-
},
|
|
971
|
+
}, Qe = X({}, [
|
|
972
972
|
"annotation-xml",
|
|
973
973
|
"color-profile",
|
|
974
974
|
"font-face",
|
|
@@ -977,12 +977,12 @@ function Dn() {
|
|
|
977
977
|
"font-face-src",
|
|
978
978
|
"font-face-uri",
|
|
979
979
|
"missing-glyph"
|
|
980
|
-
]),
|
|
981
|
-
return
|
|
982
|
-
},
|
|
983
|
-
|
|
980
|
+
]), $e = function(e) {
|
|
981
|
+
return !Qe[Ft(e)] && Kt(I, e);
|
|
982
|
+
}, et = function(e) {
|
|
983
|
+
Ye(k.beforeSanitizeAttributes, e, null);
|
|
984
984
|
let n = e.attributes;
|
|
985
|
-
if (!n ||
|
|
985
|
+
if (!n || qe(e)) return;
|
|
986
986
|
let r = {
|
|
987
987
|
attrName: "",
|
|
988
988
|
attrValue: "",
|
|
@@ -991,34 +991,34 @@ function Dn() {
|
|
|
991
991
|
forceKeepAttr: void 0
|
|
992
992
|
}, i = n.length;
|
|
993
993
|
for (; i--;) {
|
|
994
|
-
let a = n[i], o = a.name, s = a.namespaceURI, c = a.value, l =
|
|
995
|
-
if (r.attrName = l, r.attrValue = d, r.keepAttr = !0, r.forceKeepAttr = void 0,
|
|
996
|
-
|
|
994
|
+
let a = n[i], o = a.name, s = a.namespaceURI, c = a.value, l = K(o), u = c, d = o === "value" ? u : Bt(u);
|
|
995
|
+
if (r.attrName = l, r.attrValue = d, r.keepAttr = !0, r.forceKeepAttr = void 0, Ye(k.uponSanitizeAttribute, e, r), d = r.attrValue, he && (l === "id" || l === "name") && zt(d, ge) !== 0 && (We(o, e), d = ge + d), ce && Kt(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, d)) {
|
|
996
|
+
We(o, e);
|
|
997
997
|
continue;
|
|
998
998
|
}
|
|
999
|
-
if (l === "attributename" &&
|
|
1000
|
-
|
|
999
|
+
if (l === "attributename" && Lt(d, "href")) {
|
|
1000
|
+
We(o, e);
|
|
1001
1001
|
continue;
|
|
1002
1002
|
}
|
|
1003
1003
|
if (r.forceKeepAttr) continue;
|
|
1004
1004
|
if (!r.keepAttr) {
|
|
1005
|
-
|
|
1005
|
+
We(o, e);
|
|
1006
1006
|
continue;
|
|
1007
1007
|
}
|
|
1008
|
-
if (!U &&
|
|
1009
|
-
|
|
1008
|
+
if (!U && Kt(/\/>/i, d)) {
|
|
1009
|
+
We(o, e);
|
|
1010
1010
|
continue;
|
|
1011
1011
|
}
|
|
1012
|
-
se &&
|
|
1012
|
+
se && At([
|
|
1013
1013
|
A,
|
|
1014
1014
|
j,
|
|
1015
1015
|
M
|
|
1016
1016
|
], (e) => {
|
|
1017
|
-
d =
|
|
1017
|
+
d = Rt(d, e, " ");
|
|
1018
1018
|
});
|
|
1019
|
-
let f =
|
|
1020
|
-
if (!
|
|
1021
|
-
|
|
1019
|
+
let f = K(e.nodeName);
|
|
1020
|
+
if (!Ze(f, l, d)) {
|
|
1021
|
+
We(o, e);
|
|
1022
1022
|
continue;
|
|
1023
1023
|
}
|
|
1024
1024
|
if (x && typeof m == "object" && typeof m.getAttributeType == "function" && !s) switch (m.getAttributeType(f, l)) {
|
|
@@ -1030,59 +1030,59 @@ function Dn() {
|
|
|
1030
1030
|
break;
|
|
1031
1031
|
}
|
|
1032
1032
|
if (d !== u) try {
|
|
1033
|
-
s ? e.setAttributeNS(s, o, d) : e.setAttribute(o, d),
|
|
1033
|
+
s ? e.setAttributeNS(s, o, d) : e.setAttribute(o, d), qe(e) ? Ue(e) : Mt(t.removed);
|
|
1034
1034
|
} catch {
|
|
1035
|
-
|
|
1035
|
+
We(o, e);
|
|
1036
1036
|
}
|
|
1037
1037
|
}
|
|
1038
|
-
|
|
1038
|
+
Ye(k.afterSanitizeAttributes, e, null);
|
|
1039
|
+
}, tt = function(e) {
|
|
1040
|
+
let t = null, n = Ke(e);
|
|
1041
|
+
for (Ye(k.beforeSanitizeShadowDOM, e, null); t = n.nextNode();) Ye(k.uponSanitizeShadowNode, t, null), Xe(t), et(t), t.content instanceof a && tt(t.content);
|
|
1042
|
+
Ye(k.afterSanitizeShadowDOM, e, null);
|
|
1039
1043
|
}, nt = function(e) {
|
|
1040
|
-
let t = null, n = qe(e);
|
|
1041
|
-
for (Xe(k.beforeSanitizeShadowDOM, e, null); t = n.nextNode();) Xe(k.uponSanitizeShadowNode, t, null), Ze(t), tt(t), t.content instanceof a && nt(t.content);
|
|
1042
|
-
Xe(k.afterSanitizeShadowDOM, e, null);
|
|
1043
|
-
}, rt = function(e) {
|
|
1044
1044
|
if (e.nodeType === Cn.element && e.shadowRoot instanceof a) {
|
|
1045
1045
|
let t = e.shadowRoot;
|
|
1046
|
-
|
|
1046
|
+
nt(t), tt(t);
|
|
1047
1047
|
}
|
|
1048
1048
|
let t = e.childNodes;
|
|
1049
1049
|
if (!t) return;
|
|
1050
1050
|
let n = [];
|
|
1051
|
-
|
|
1052
|
-
|
|
1051
|
+
At(t, (e) => {
|
|
1052
|
+
Nt(n, e);
|
|
1053
1053
|
});
|
|
1054
|
-
for (let e of n)
|
|
1054
|
+
for (let e of n) nt(e);
|
|
1055
1055
|
};
|
|
1056
1056
|
return t.sanitize = function(e) {
|
|
1057
1057
|
let n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, i = null, o = null, c = null, l = null;
|
|
1058
|
-
if (
|
|
1058
|
+
if (ke = !e, ke && (e = "<!-->"), typeof e != "string" && !Je(e) && (e = Qt(e), typeof e != "string")) throw qt("dirty is not a string, aborting");
|
|
1059
1059
|
if (!t.isSupported) return e;
|
|
1060
|
-
if (ue ||
|
|
1060
|
+
if (ue || q(n), t.removed = [], typeof e == "string" && (ve = !1), ve) {
|
|
1061
1061
|
let t = e.nodeName;
|
|
1062
1062
|
if (typeof t == "string") {
|
|
1063
|
-
let e =
|
|
1064
|
-
if (!L[e] || re[e]) throw
|
|
1063
|
+
let e = K(t);
|
|
1064
|
+
if (!L[e] || re[e]) throw qt("root node is forbidden and cannot be sanitized in-place");
|
|
1065
1065
|
}
|
|
1066
|
-
|
|
1067
|
-
} else if (e instanceof s) i =
|
|
1066
|
+
nt(e);
|
|
1067
|
+
} else if (e instanceof s) i = Ge("<!---->"), o = i.ownerDocument.importNode(e, !0), o.nodeType === Cn.element && o.nodeName === "BODY" || o.nodeName === "HTML" ? i = o : i.appendChild(o), nt(o);
|
|
1068
1068
|
else {
|
|
1069
1069
|
if (!W && !se && !le && e.indexOf("<") === -1) return x && pe ? x.createHTML(e) : e;
|
|
1070
|
-
if (i =
|
|
1070
|
+
if (i = Ge(e), !i) return W ? null : pe ? S : "";
|
|
1071
1071
|
}
|
|
1072
|
-
i && de &&
|
|
1073
|
-
let u =
|
|
1074
|
-
for (; c = u.nextNode();)
|
|
1072
|
+
i && de && Ue(i.firstChild);
|
|
1073
|
+
let u = Ke(ve ? e : i);
|
|
1074
|
+
for (; c = u.nextNode();) Xe(c), et(c), c.content instanceof a && tt(c.content);
|
|
1075
1075
|
if (ve) return e;
|
|
1076
1076
|
if (W) {
|
|
1077
1077
|
if (se) {
|
|
1078
1078
|
i.normalize();
|
|
1079
1079
|
let e = i.innerHTML;
|
|
1080
|
-
|
|
1080
|
+
At([
|
|
1081
1081
|
A,
|
|
1082
1082
|
j,
|
|
1083
1083
|
M
|
|
1084
1084
|
], (t) => {
|
|
1085
|
-
e =
|
|
1085
|
+
e = Rt(e, t, " ");
|
|
1086
1086
|
}), i.innerHTML = e;
|
|
1087
1087
|
}
|
|
1088
1088
|
if (fe) for (l = E.call(i.ownerDocument); i.firstChild;) l.appendChild(i.firstChild);
|
|
@@ -1090,27 +1090,27 @@ function Dn() {
|
|
|
1090
1090
|
return (z.shadowroot || z.shadowrootmode) && (l = O.call(r, l, !0)), l;
|
|
1091
1091
|
}
|
|
1092
1092
|
let d = le ? i.outerHTML : i.innerHTML;
|
|
1093
|
-
return le && L["!doctype"] && i.ownerDocument && i.ownerDocument.doctype && i.ownerDocument.doctype.name &&
|
|
1093
|
+
return le && L["!doctype"] && i.ownerDocument && i.ownerDocument.doctype && i.ownerDocument.doctype.name && Kt(xn, i.ownerDocument.doctype.name) && (d = "<!DOCTYPE " + i.ownerDocument.doctype.name + ">\n" + d), se && At([
|
|
1094
1094
|
A,
|
|
1095
1095
|
j,
|
|
1096
1096
|
M
|
|
1097
1097
|
], (e) => {
|
|
1098
|
-
d =
|
|
1098
|
+
d = Rt(d, e, " ");
|
|
1099
1099
|
}), x && pe ? x.createHTML(d) : d;
|
|
1100
1100
|
}, t.setConfig = function() {
|
|
1101
|
-
|
|
1101
|
+
q(arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}), ue = !0;
|
|
1102
1102
|
}, t.clearConfig = function() {
|
|
1103
|
-
|
|
1103
|
+
Le = null, ue = !1;
|
|
1104
1104
|
}, t.isValidAttribute = function(e, t, n) {
|
|
1105
|
-
return
|
|
1105
|
+
return Le || q({}), Ze(K(e), K(t), n);
|
|
1106
1106
|
}, t.addHook = function(e, t) {
|
|
1107
|
-
typeof t == "function" &&
|
|
1107
|
+
typeof t == "function" && Nt(k[e], t);
|
|
1108
1108
|
}, t.removeHook = function(e, t) {
|
|
1109
1109
|
if (t !== void 0) {
|
|
1110
|
-
let n =
|
|
1111
|
-
return n === -1 ? void 0 :
|
|
1110
|
+
let n = jt(k[e], t);
|
|
1111
|
+
return n === -1 ? void 0 : Pt(k[e], n, 1)[0];
|
|
1112
1112
|
}
|
|
1113
|
-
return
|
|
1113
|
+
return Mt(k[e]);
|
|
1114
1114
|
}, t.removeHooks = function(e) {
|
|
1115
1115
|
k[e] = [];
|
|
1116
1116
|
}, t.removeAllHooks = function() {
|
|
@@ -3732,7 +3732,7 @@ var Io = new Fo({
|
|
|
3732
3732
|
"href",
|
|
3733
3733
|
"target",
|
|
3734
3734
|
"rel",
|
|
3735
|
-
|
|
3735
|
+
We,
|
|
3736
3736
|
"class"
|
|
3737
3737
|
], zo = [
|
|
3738
3738
|
"br",
|
|
@@ -3746,8 +3746,8 @@ var Io = new Fo({
|
|
|
3746
3746
|
], Bo = /<(?:\/)?(?:div|p|li|h[1-6]|blockquote|pre)[^>]*>/gi, Vo = /<\/(?:div|p|li|h[1-6]|blockquote|pre)>/gi, Ho = /<(?:div|p|li|h[1-6]|blockquote|pre)[^>]*>/gi, Uo = / /gi, Wo = /https?:\/\/[^\s<>()]+[^\s<>().,!?;:]/i, Go = /(^|[\s([{"'`])((?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\.)+[a-z]{2,}(?:\/[^\s<]*)?)/gi, Ko = /[),.!?;:]+$/;
|
|
3747
3747
|
function qo(e) {
|
|
3748
3748
|
if (!e) return "";
|
|
3749
|
-
let { shielded: t, tokens: n } =
|
|
3750
|
-
return
|
|
3749
|
+
let { shielded: t, tokens: n } = $e(e), r = t.replace(/\r\n?/g, "\n").replace(Ho, "").replace(Vo, "<br>").replace(Uo, " ");
|
|
3750
|
+
return et(On.sanitize(r, {
|
|
3751
3751
|
ALLOWED_TAGS: zo,
|
|
3752
3752
|
ALLOWED_ATTR: Ro,
|
|
3753
3753
|
ALLOW_DATA_ATTR: !1
|
|
@@ -3755,12 +3755,12 @@ function qo(e) {
|
|
|
3755
3755
|
}
|
|
3756
3756
|
function Jo(e, t) {
|
|
3757
3757
|
if (!e) return "";
|
|
3758
|
-
let n =
|
|
3758
|
+
let n = ut(Ze(e), t ?? {}).replace(/<br\s*\/?>/gi, "\n").replace(Bo, (e) => e.startsWith("</") ? "\n" : "");
|
|
3759
3759
|
return (new DOMParser().parseFromString(`<div>${n}</div>`, "text/html").body.textContent ?? "").replace(/\u00a0/g, " ").replace(/\n{3,}/g, "\n\n").trim();
|
|
3760
3760
|
}
|
|
3761
3761
|
function Yo(e, t) {
|
|
3762
3762
|
if (!e) return "";
|
|
3763
|
-
let n =
|
|
3763
|
+
let n = Ze(e), r = qo(Qe(n) ? rt(n, t?.mentionNameByUid ?? {}) : n);
|
|
3764
3764
|
if (!r) return "";
|
|
3765
3765
|
let i = Io.render(ts(r));
|
|
3766
3766
|
return On.sanitize(i, {
|
|
@@ -3785,7 +3785,7 @@ function $o(e) {
|
|
|
3785
3785
|
return e.replace(/\n{2,}/g, (e) => "\n" + "<br>".repeat(e.length - 1));
|
|
3786
3786
|
}
|
|
3787
3787
|
function es(e, t) {
|
|
3788
|
-
return e.replace(
|
|
3788
|
+
return e.replace(Be, (e, n) => `<span class="${Ke}">@${(t ?? []).find((e) => e.getUid?.() === n)?.getName?.() ?? n}</span>`);
|
|
3789
3789
|
}
|
|
3790
3790
|
function ts(e) {
|
|
3791
3791
|
let t = new DOMParser().parseFromString(`<div>${e}</div>`, "text/html"), n = t.body.firstElementChild;
|
|
@@ -3835,23 +3835,23 @@ function is(e) {
|
|
|
3835
3835
|
function as(e, t) {
|
|
3836
3836
|
if (!e) return t;
|
|
3837
3837
|
switch (e.kind) {
|
|
3838
|
-
case "image": return
|
|
3839
|
-
case "video": return
|
|
3840
|
-
case "audio": return
|
|
3838
|
+
case "image": return ze("photo");
|
|
3839
|
+
case "video": return ze("video");
|
|
3840
|
+
case "audio": return ze("audio");
|
|
3841
3841
|
case "file": return e.name || t;
|
|
3842
3842
|
default: return t;
|
|
3843
3843
|
}
|
|
3844
3844
|
}
|
|
3845
|
-
function os(e, t =
|
|
3845
|
+
function os(e, t = ze("attachment")) {
|
|
3846
3846
|
return as(e[0], t);
|
|
3847
3847
|
}
|
|
3848
3848
|
function ss(e, t) {
|
|
3849
|
-
let n =
|
|
3850
|
-
return n ?
|
|
3849
|
+
let n = Ze(e ?? "");
|
|
3850
|
+
return n ? Qe(n) && t ? qo(nt(n, t)) : qo(n) : "";
|
|
3851
3851
|
}
|
|
3852
3852
|
function cs(e) {
|
|
3853
3853
|
let t = qo(e);
|
|
3854
|
-
return t ?
|
|
3854
|
+
return t ? it(t) : "";
|
|
3855
3855
|
}
|
|
3856
3856
|
function ls(e) {
|
|
3857
3857
|
return Jo(e).length > 0;
|
|
@@ -3859,16 +3859,16 @@ function ls(e) {
|
|
|
3859
3859
|
function us(e, t) {
|
|
3860
3860
|
return Jo(e, t);
|
|
3861
3861
|
}
|
|
3862
|
-
function ds(e, t =
|
|
3862
|
+
function ds(e, t = ze("message"), n) {
|
|
3863
3863
|
if (e.kind === "poll" && e.poll) return e.poll.question;
|
|
3864
3864
|
let r = us(e.text, n);
|
|
3865
3865
|
return e.attachments.length > 0 ? r || os(e.attachments, t) : r || t;
|
|
3866
3866
|
}
|
|
3867
3867
|
function fs(e, t = {}) {
|
|
3868
|
-
return
|
|
3868
|
+
return ut(e, t);
|
|
3869
3869
|
}
|
|
3870
3870
|
function ps(e) {
|
|
3871
|
-
return e.source?.getText?.() ||
|
|
3871
|
+
return e.source?.getText?.() || Ze(e.text);
|
|
3872
3872
|
}
|
|
3873
3873
|
function ms(e, t = !1, n = !0) {
|
|
3874
3874
|
if (!e) return "";
|
|
@@ -3908,9 +3908,9 @@ function _s(e) {
|
|
|
3908
3908
|
return gs(e).join("\n").trim();
|
|
3909
3909
|
}
|
|
3910
3910
|
function vs(e) {
|
|
3911
|
-
if (e.kind === "poll" && e.poll) return
|
|
3912
|
-
let t =
|
|
3913
|
-
return ds(e, e.attachments.length > 0 ?
|
|
3911
|
+
if (e.kind === "poll" && e.poll) return ze("pollPrefix", { question: e.poll.question });
|
|
3912
|
+
let t = ct(e.source);
|
|
3913
|
+
return ds(e, e.attachments.length > 0 ? ze("sentAnAttachment") : ze("youSentAMessage"), t);
|
|
3914
3914
|
}
|
|
3915
3915
|
//#endregion
|
|
3916
3916
|
//#region src/chat/offlineStore.ts
|
|
@@ -4167,7 +4167,7 @@ function ks({ environment: e }) {
|
|
|
4167
4167
|
A.value = t;
|
|
4168
4168
|
}
|
|
4169
4169
|
function ee(e) {
|
|
4170
|
-
M(Object.entries(
|
|
4170
|
+
M(Object.entries(ct(e)).map(([e, t]) => ({
|
|
4171
4171
|
uid: e,
|
|
4172
4172
|
displayName: t
|
|
4173
4173
|
})));
|
|
@@ -4177,7 +4177,7 @@ function ks({ environment: e }) {
|
|
|
4177
4177
|
}
|
|
4178
4178
|
let P = n(() => v.value.find((e) => e.id === T.value) ?? null), F = `bcc-ui-connection-${crypto.randomUUID()}`, I = `bcc-ui-message-${crypto.randomUUID()}`, te = !1, L = !1, R = null, z = null, ne = null, B = null, re = 0, ie = 0, V = !1, ae = !1, H = null, oe = /* @__PURE__ */ new Map(), se = /* @__PURE__ */ new Set(), ce = null, le = null, ue = 0;
|
|
4179
4179
|
async function fe() {
|
|
4180
|
-
await As(e), !t.value && (ye(),
|
|
4180
|
+
await As(e), !t.value && (ye(), ut(), t.value = !0, await lt(), _.value && (Ne(_.value.uid), he(), Oe(), !m.value && !ae && De()));
|
|
4181
4181
|
}
|
|
4182
4182
|
async function pe(e) {
|
|
4183
4183
|
g.value = null, r.value = !0;
|
|
@@ -4186,9 +4186,9 @@ function ks({ environment: e }) {
|
|
|
4186
4186
|
let t = ge();
|
|
4187
4187
|
await U.getLoggedinUser() && t !== e && await U.logout(), _e(e);
|
|
4188
4188
|
let n = await js(e);
|
|
4189
|
-
_.value = Is(await U.login(n)),
|
|
4189
|
+
_.value = Is(await U.login(n)), Ne(_.value.uid), h.value = !0, m.value = typeof navigator < "u" ? !navigator.onLine : !1, he(), Oe(), ae || await De(), await Pe(), Ut();
|
|
4190
4190
|
} catch (e) {
|
|
4191
|
-
throw
|
|
4191
|
+
throw bt(), g.value = Q(e, "Unable to sign in to chat."), e;
|
|
4192
4192
|
} finally {
|
|
4193
4193
|
r.value = !1;
|
|
4194
4194
|
}
|
|
@@ -4198,11 +4198,11 @@ function ks({ environment: e }) {
|
|
|
4198
4198
|
try {
|
|
4199
4199
|
_e(null), xe(), await U.getLoggedinUser() && await U.logout();
|
|
4200
4200
|
} finally {
|
|
4201
|
-
|
|
4201
|
+
bt();
|
|
4202
4202
|
}
|
|
4203
4203
|
}
|
|
4204
4204
|
function he() {
|
|
4205
|
-
let e =
|
|
4205
|
+
let e = je();
|
|
4206
4206
|
if (!e) {
|
|
4207
4207
|
H = null, k.value = [];
|
|
4208
4208
|
return;
|
|
@@ -4257,45 +4257,45 @@ function ks({ environment: e }) {
|
|
|
4257
4257
|
}
|
|
4258
4258
|
_.value = Is(e), h.value = !0, he();
|
|
4259
4259
|
let t = U.connect;
|
|
4260
|
-
typeof t == "function" && (await t.call(U), p.value = !0), ie = 0, V && await
|
|
4260
|
+
typeof t == "function" && (await t.call(U), p.value = !0), ie = 0, V && await G();
|
|
4261
4261
|
} catch (e) {
|
|
4262
|
-
p.value = !1, ie += 1,
|
|
4262
|
+
p.value = !1, ie += 1, J(e) || (g.value = Q(e, "Unable to reconnect to chat.")), Ee();
|
|
4263
4263
|
} finally {
|
|
4264
4264
|
z = null;
|
|
4265
4265
|
}
|
|
4266
4266
|
})(), z);
|
|
4267
4267
|
}
|
|
4268
|
-
async function
|
|
4268
|
+
async function G() {
|
|
4269
4269
|
return ne || m.value || !h.value || ae || (ne = (async () => {
|
|
4270
4270
|
V = !1, g.value = null;
|
|
4271
4271
|
try {
|
|
4272
|
-
await
|
|
4272
|
+
await Pe(), Ut();
|
|
4273
4273
|
} finally {
|
|
4274
4274
|
ne = null;
|
|
4275
4275
|
}
|
|
4276
4276
|
})()), ne;
|
|
4277
4277
|
}
|
|
4278
|
-
function
|
|
4278
|
+
function Oe() {
|
|
4279
4279
|
if (!H || v.value.length > 0) return;
|
|
4280
4280
|
let e = H.getConversations();
|
|
4281
|
-
e.length !== 0 && (v.value = Vs(e), !T.value && v.value.length > 0 &&
|
|
4281
|
+
e.length !== 0 && (v.value = Vs(e), !T.value && v.value.length > 0 && ke(T.value));
|
|
4282
4282
|
}
|
|
4283
|
-
function
|
|
4283
|
+
function ke(e) {
|
|
4284
4284
|
if (!H || !e) return y.value = [], !1;
|
|
4285
4285
|
let t = H.getMessages(e).sort(Hs);
|
|
4286
4286
|
return y.value = t, t.length > 0;
|
|
4287
4287
|
}
|
|
4288
|
-
async function
|
|
4288
|
+
async function Ae() {
|
|
4289
4289
|
ae = !1, V = !0, await De();
|
|
4290
4290
|
}
|
|
4291
|
-
async function
|
|
4291
|
+
async function Me() {
|
|
4292
4292
|
ae = !0, V = !1, Ce();
|
|
4293
4293
|
let e = U.disconnect;
|
|
4294
4294
|
typeof e == "function" && await e.call(U), p.value = !1;
|
|
4295
4295
|
}
|
|
4296
|
-
async function
|
|
4296
|
+
async function Pe() {
|
|
4297
4297
|
if (await fe(), i.value = !0, g.value = null, m.value && H) {
|
|
4298
|
-
v.value = Vs(H.getConversations()), P.value && await
|
|
4298
|
+
v.value = Vs(H.getConversations()), P.value && await nt(), i.value = !1;
|
|
4299
4299
|
return;
|
|
4300
4300
|
}
|
|
4301
4301
|
try {
|
|
@@ -4308,7 +4308,7 @@ function ks({ environment: e }) {
|
|
|
4308
4308
|
let t = r.get(e.id);
|
|
4309
4309
|
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));
|
|
4310
4310
|
}
|
|
4311
|
-
v.value = Vs(await
|
|
4311
|
+
v.value = Vs(await ft(t)), H?.setConversations(v.value), P.value && await nt();
|
|
4312
4312
|
} catch (e) {
|
|
4313
4313
|
let t = H?.getConversations() ?? [];
|
|
4314
4314
|
if (t.length > 0) {
|
|
@@ -4320,39 +4320,39 @@ function ks({ environment: e }) {
|
|
|
4320
4320
|
i.value = !1;
|
|
4321
4321
|
}
|
|
4322
4322
|
}
|
|
4323
|
-
async function
|
|
4324
|
-
T.value = e, E.value = null, b.value = [], le = null, C.value = !1, D.value = null, O.value = null,
|
|
4323
|
+
async function Fe(e) {
|
|
4324
|
+
T.value = e, E.value = null, b.value = [], le = null, C.value = !1, D.value = null, O.value = null, ke(e), await nt();
|
|
4325
4325
|
}
|
|
4326
|
-
function
|
|
4326
|
+
function Ie(e) {
|
|
4327
4327
|
e && (O.value = null), D.value = e;
|
|
4328
4328
|
}
|
|
4329
|
-
function
|
|
4329
|
+
function K(e) {
|
|
4330
4330
|
e && (D.value = null), O.value = e;
|
|
4331
4331
|
}
|
|
4332
|
-
async function
|
|
4333
|
-
E.value = e, le = null, C.value = !1, D.value = null, O.value = null, await
|
|
4332
|
+
async function Le(e) {
|
|
4333
|
+
E.value = e, le = null, C.value = !1, D.value = null, O.value = null, await it(e.id);
|
|
4334
4334
|
}
|
|
4335
|
-
function
|
|
4335
|
+
function Re() {
|
|
4336
4336
|
E.value = null, b.value = [], le = null, C.value = !1, D.value = null, O.value = null;
|
|
4337
4337
|
}
|
|
4338
|
-
async function
|
|
4338
|
+
async function q(e, t) {
|
|
4339
4339
|
if (u.value) return;
|
|
4340
4340
|
let n = P.value;
|
|
4341
4341
|
if (!n) return;
|
|
4342
4342
|
let r = cs(e);
|
|
4343
4343
|
if (!ls(r)) return;
|
|
4344
4344
|
if (O.value) {
|
|
4345
|
-
await
|
|
4345
|
+
await Be(O.value, r);
|
|
4346
4346
|
return;
|
|
4347
4347
|
}
|
|
4348
|
-
let i = E.value?.id, a = crypto.randomUUID(), o = Js(
|
|
4348
|
+
let i = E.value?.id, a = crypto.randomUUID(), o = Js(Nt(D.value, t), a);
|
|
4349
4349
|
u.value = !0, g.value = null;
|
|
4350
4350
|
try {
|
|
4351
4351
|
if (m.value) {
|
|
4352
|
-
|
|
4352
|
+
Ft(n, r, o, i, a), D.value = null;
|
|
4353
4353
|
return;
|
|
4354
4354
|
}
|
|
4355
|
-
|
|
4355
|
+
Bt(Mt({
|
|
4356
4356
|
conversation: n,
|
|
4357
4357
|
kind: "text",
|
|
4358
4358
|
text: r,
|
|
@@ -4364,18 +4364,18 @@ function ks({ environment: e }) {
|
|
|
4364
4364
|
let e = new U.TextMessage(n.targetId, r, Xs(n));
|
|
4365
4365
|
e.setMuid?.(a), Object.keys(o).length > 0 && e.setMetadata?.(o), i && e.setParentMessageId?.(Number(i));
|
|
4366
4366
|
let t = await U.sendMessage(e);
|
|
4367
|
-
|
|
4367
|
+
St(N(t, _.value?.uid)), mt(t), await _t(t), D.value = null;
|
|
4368
4368
|
} catch (e) {
|
|
4369
|
-
if (
|
|
4370
|
-
|
|
4369
|
+
if (J(e)) {
|
|
4370
|
+
Vt("queued", a), Ft(n, r, o, E.value?.id, a), D.value = null;
|
|
4371
4371
|
return;
|
|
4372
4372
|
}
|
|
4373
|
-
throw
|
|
4373
|
+
throw Vt("failed", a), g.value = Q(e, "Unable to send the message."), e;
|
|
4374
4374
|
} finally {
|
|
4375
4375
|
u.value = !1;
|
|
4376
4376
|
}
|
|
4377
4377
|
}
|
|
4378
|
-
async function
|
|
4378
|
+
async function Be(e, t) {
|
|
4379
4379
|
let n = P.value;
|
|
4380
4380
|
if (!n || m.value) return;
|
|
4381
4381
|
let r = cs(t);
|
|
@@ -4385,7 +4385,7 @@ function ks({ environment: e }) {
|
|
|
4385
4385
|
let t;
|
|
4386
4386
|
e.kind === "text" ? t = new U.TextMessage(n.targetId, r, Xs(n)) : (t = new U.MediaMessage(n.targetId, e.source?.getAttachment?.()?.getFileUrl?.() ?? e.source?.getAttachment?.()?.getUrl?.() ?? e.attachments[0]?.url ?? "", e.source?.getType?.() ?? e.type ?? e.kind, Xs(n)), t.setCaption(r)), t.setId(Number(e.id));
|
|
4387
4387
|
let i = await U.editMessage(t);
|
|
4388
|
-
|
|
4388
|
+
St(N(i, _.value?.uid)), mt(i), O.value = null;
|
|
4389
4389
|
} catch (e) {
|
|
4390
4390
|
throw g.value = Q(e, "Unable to edit the message."), e;
|
|
4391
4391
|
} finally {
|
|
@@ -4393,18 +4393,18 @@ function ks({ environment: e }) {
|
|
|
4393
4393
|
}
|
|
4394
4394
|
}
|
|
4395
4395
|
}
|
|
4396
|
-
async function
|
|
4396
|
+
async function Ve(e, t) {
|
|
4397
4397
|
if (u.value) return;
|
|
4398
4398
|
let n = P.value;
|
|
4399
4399
|
if (!n) return;
|
|
4400
|
-
let r = E.value?.id, i = crypto.randomUUID(), a = Js(
|
|
4400
|
+
let r = E.value?.id, i = crypto.randomUUID(), a = Js(Nt(D.value, t), i), o = ec(e.file);
|
|
4401
4401
|
u.value = !0, g.value = null;
|
|
4402
4402
|
try {
|
|
4403
4403
|
if (m.value) {
|
|
4404
|
-
await
|
|
4404
|
+
await Rt(n, e, a, r, i), D.value = null;
|
|
4405
4405
|
return;
|
|
4406
4406
|
}
|
|
4407
|
-
|
|
4407
|
+
Bt(Mt({
|
|
4408
4408
|
conversation: n,
|
|
4409
4409
|
kind: o,
|
|
4410
4410
|
text: e.caption?.trim() ?? "",
|
|
@@ -4422,34 +4422,34 @@ function ks({ environment: e }) {
|
|
|
4422
4422
|
let t = new U.MediaMessage(n.targetId, e.file, o, Xs(n));
|
|
4423
4423
|
t.setMuid?.(i), Object.keys(a).length > 0 && t.setMetadata?.(a), r && t.setParentMessageId?.(Number(r)), e.caption?.trim() && t.setCaption?.(e.caption.trim());
|
|
4424
4424
|
let s = await U.sendMediaMessage(t);
|
|
4425
|
-
|
|
4425
|
+
St(N(s, _.value?.uid)), mt(s), await _t(s), D.value = null;
|
|
4426
4426
|
} catch (t) {
|
|
4427
|
-
if (
|
|
4428
|
-
|
|
4427
|
+
if (J(t)) {
|
|
4428
|
+
Vt("queued", i), await Rt(n, e, a, r, i), D.value = null;
|
|
4429
4429
|
return;
|
|
4430
4430
|
}
|
|
4431
|
-
throw
|
|
4431
|
+
throw Vt("failed", i), g.value = Q(t, "Unable to send the attachment."), t;
|
|
4432
4432
|
} finally {
|
|
4433
4433
|
u.value = !1;
|
|
4434
4434
|
}
|
|
4435
4435
|
}
|
|
4436
|
-
async function
|
|
4436
|
+
async function He(e, t) {
|
|
4437
4437
|
if (u.value) return;
|
|
4438
4438
|
let n = P.value;
|
|
4439
4439
|
if (!n) return;
|
|
4440
4440
|
let r = e.question.trim(), i = e.options.map((e) => e.trim()).filter(Boolean);
|
|
4441
4441
|
if (!r || i.length < 2) return;
|
|
4442
|
-
let a = E.value?.id, o = crypto.randomUUID(), s = Js(
|
|
4442
|
+
let a = E.value?.id, o = crypto.randomUUID(), s = Js(Nt(D.value, t), o);
|
|
4443
4443
|
u.value = !0, g.value = null;
|
|
4444
4444
|
try {
|
|
4445
4445
|
if (m.value) {
|
|
4446
|
-
|
|
4446
|
+
It(n, {
|
|
4447
4447
|
question: r,
|
|
4448
4448
|
options: i
|
|
4449
4449
|
}, s, a, o), D.value = null;
|
|
4450
4450
|
return;
|
|
4451
4451
|
}
|
|
4452
|
-
|
|
4452
|
+
Bt(Mt({
|
|
4453
4453
|
conversation: n,
|
|
4454
4454
|
kind: "poll",
|
|
4455
4455
|
text: `Poll: ${r}`,
|
|
@@ -4470,37 +4470,37 @@ function ks({ environment: e }) {
|
|
|
4470
4470
|
};
|
|
4471
4471
|
a && (e.parentMessageId = Number(a)), Object.keys(s).length > 0 && (e.metadata = s);
|
|
4472
4472
|
let t = await U.callExtension("polls", "POST", "v2/create", e), c = t?.message ?? t?.custom_message ?? t?.data?.message ?? null;
|
|
4473
|
-
c ? (
|
|
4473
|
+
c ? (Ht(o), St(N(c, _.value?.uid)), mt(c), await _t(c)) : (Ht(o), await xt()), D.value = null;
|
|
4474
4474
|
} catch (e) {
|
|
4475
|
-
if (
|
|
4476
|
-
|
|
4475
|
+
if (J(e)) {
|
|
4476
|
+
Vt("queued", o), It(n, {
|
|
4477
4477
|
question: r,
|
|
4478
4478
|
options: i
|
|
4479
4479
|
}, s, a, o), D.value = null;
|
|
4480
4480
|
return;
|
|
4481
4481
|
}
|
|
4482
|
-
throw
|
|
4482
|
+
throw Vt("failed", o), g.value = Q(e, "Unable to send the poll."), e;
|
|
4483
4483
|
} finally {
|
|
4484
4484
|
u.value = !1;
|
|
4485
4485
|
}
|
|
4486
4486
|
}
|
|
4487
|
-
async function
|
|
4487
|
+
async function Ue(e, t) {
|
|
4488
4488
|
let n = e.poll?.id ?? e.id, r = _.value?.uid;
|
|
4489
4489
|
if (!n || !t || m.value) return;
|
|
4490
|
-
let i =
|
|
4490
|
+
let i = wt(e.id, e.parentMessageId) ?? e;
|
|
4491
4491
|
if (i.poll && !i.poll.options.some((e) => e.id === t && e.voters.includes(r ?? ""))) {
|
|
4492
|
-
g.value = null, r &&
|
|
4492
|
+
g.value = null, r && St(We(i, t, r));
|
|
4493
4493
|
try {
|
|
4494
4494
|
await U.callExtension("polls", "POST", "v2/vote", {
|
|
4495
4495
|
id: n,
|
|
4496
4496
|
vote: t
|
|
4497
4497
|
});
|
|
4498
4498
|
} catch (e) {
|
|
4499
|
-
throw
|
|
4499
|
+
throw St(i), g.value = Q(e, "Unable to cast the vote."), e;
|
|
4500
4500
|
}
|
|
4501
4501
|
}
|
|
4502
4502
|
}
|
|
4503
|
-
function
|
|
4503
|
+
function We(e, t, n) {
|
|
4504
4504
|
if (!e.poll) return e;
|
|
4505
4505
|
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 ? {
|
|
4506
4506
|
...e,
|
|
@@ -4520,29 +4520,29 @@ function ks({ environment: e }) {
|
|
|
4520
4520
|
}
|
|
4521
4521
|
};
|
|
4522
4522
|
}
|
|
4523
|
-
async function
|
|
4523
|
+
async function Ge(e, t) {
|
|
4524
4524
|
g.value = null;
|
|
4525
|
-
let n =
|
|
4526
|
-
|
|
4525
|
+
let n = wt(e.id, e.parentMessageId) ?? e, r = n.reactions.find((e) => e.emoji === t && e.reactedByMe);
|
|
4526
|
+
St(Tt(n, t));
|
|
4527
4527
|
try {
|
|
4528
|
-
|
|
4528
|
+
St(N(r ? await U.removeReaction(Number(e.id), t) : await U.addReaction(Number(e.id), t), _.value?.uid));
|
|
4529
4529
|
} catch (e) {
|
|
4530
|
-
throw
|
|
4530
|
+
throw St(n), g.value = Q(e, "Unable to update the reaction."), e;
|
|
4531
4531
|
}
|
|
4532
4532
|
}
|
|
4533
|
-
async function
|
|
4533
|
+
async function Ke(e) {
|
|
4534
4534
|
if (g.value = null, e.deliveryState === "queued" || e.deliveryState === "failed") {
|
|
4535
|
-
|
|
4535
|
+
Ot(e);
|
|
4536
4536
|
return;
|
|
4537
4537
|
}
|
|
4538
4538
|
if (!m.value) try {
|
|
4539
4539
|
let t = N(await U.deleteMessage(String(e.id)), _.value?.uid);
|
|
4540
|
-
|
|
4540
|
+
Ot(t), kt(t);
|
|
4541
4541
|
} catch (e) {
|
|
4542
4542
|
throw g.value = Q(e, "Unable to delete the message."), e;
|
|
4543
4543
|
}
|
|
4544
4544
|
}
|
|
4545
|
-
async function
|
|
4545
|
+
async function qe(e) {
|
|
4546
4546
|
let t = e.source?.getText?.() ?? e.text;
|
|
4547
4547
|
if (ls(t)) {
|
|
4548
4548
|
g.value = null;
|
|
@@ -4553,20 +4553,20 @@ function ks({ environment: e }) {
|
|
|
4553
4553
|
languages: typeof navigator < "u" ? navigator.languages : ["en"]
|
|
4554
4554
|
})).translations?.[0]?.message_translated?.trim();
|
|
4555
4555
|
if (!n) return;
|
|
4556
|
-
|
|
4556
|
+
Ct({
|
|
4557
4557
|
...e,
|
|
4558
4558
|
translatedText: n,
|
|
4559
4559
|
metadata: {
|
|
4560
4560
|
...e.metadata ?? {},
|
|
4561
4561
|
translated_message: n
|
|
4562
4562
|
}
|
|
4563
|
-
}),
|
|
4563
|
+
}), Dt();
|
|
4564
4564
|
} catch (e) {
|
|
4565
4565
|
throw g.value = Q(e, "Unable to translate the message."), e;
|
|
4566
4566
|
}
|
|
4567
4567
|
}
|
|
4568
4568
|
}
|
|
4569
|
-
async function
|
|
4569
|
+
async function Je(e) {
|
|
4570
4570
|
let t = e ?? P.value?.targetId, n = _.value?.uid, r = ++ue;
|
|
4571
4571
|
if (!t || !n) {
|
|
4572
4572
|
r === ue && (x.value = []);
|
|
@@ -4583,17 +4583,17 @@ function ks({ environment: e }) {
|
|
|
4583
4583
|
x.value = o;
|
|
4584
4584
|
} catch (e) {
|
|
4585
4585
|
if (r !== ue) return;
|
|
4586
|
-
throw g.value = Q(e,
|
|
4586
|
+
throw g.value = Q(e, ze("loadScheduledMessagesError")), e;
|
|
4587
4587
|
} finally {
|
|
4588
4588
|
r === ue && (l.value = !1);
|
|
4589
4589
|
}
|
|
4590
4590
|
}
|
|
4591
|
-
async function
|
|
4591
|
+
async function Ye(e, t) {
|
|
4592
4592
|
let n = P.value;
|
|
4593
4593
|
if (n) {
|
|
4594
4594
|
d.value = !0, g.value = null;
|
|
4595
4595
|
try {
|
|
4596
|
-
e.file ? await $s(n, e, t) : await Qs(n, e, t), await
|
|
4596
|
+
e.file ? await $s(n, e, t) : await Qs(n, e, t), await Je(n.targetId);
|
|
4597
4597
|
} catch (e) {
|
|
4598
4598
|
throw g.value = Q(e, "Unable to schedule the message."), e;
|
|
4599
4599
|
} finally {
|
|
@@ -4601,16 +4601,16 @@ function ks({ environment: e }) {
|
|
|
4601
4601
|
}
|
|
4602
4602
|
}
|
|
4603
4603
|
}
|
|
4604
|
-
async function
|
|
4605
|
-
if (g.value = null, !e.scheduled
|
|
4604
|
+
async function Xe(e) {
|
|
4605
|
+
if (g.value = null, !e.scheduled) return;
|
|
4606
4606
|
let t = e.scheduled.originalChatUid;
|
|
4607
4607
|
try {
|
|
4608
|
-
await U.deleteMessage(String(e.id)), x.value = x.value.filter((t) => t.id !== e.id), await
|
|
4608
|
+
await U.deleteMessage(String(e.id)), x.value = x.value.filter((t) => t.id !== e.id), await Je(t);
|
|
4609
4609
|
} catch (e) {
|
|
4610
4610
|
throw g.value = Q(e, "Unable to remove the scheduled message."), e;
|
|
4611
4611
|
}
|
|
4612
4612
|
}
|
|
4613
|
-
async function
|
|
4613
|
+
async function Ze(e, t) {
|
|
4614
4614
|
g.value = null;
|
|
4615
4615
|
let n = _.value?.uid;
|
|
4616
4616
|
if (!n || !e.scheduled?.muid || e.kind === "poll") return;
|
|
@@ -4625,14 +4625,14 @@ function ks({ environment: e }) {
|
|
|
4625
4625
|
let i = e.source?.getAttachment?.()?.getFileUrl?.() ?? e.source?.getAttachment?.()?.getUrl?.() ?? e.attachments[0]?.url ?? "";
|
|
4626
4626
|
t = new U.MediaMessage(n, i, e.source?.getType?.() ?? e.type ?? e.kind, U.RECEIVER_TYPE.GROUP), t.setCaption(r);
|
|
4627
4627
|
}
|
|
4628
|
-
Object.keys(i).length > 0 && t.setMetadata(i), t.setId(Number(e.id)), await U.editMessage(t), await
|
|
4628
|
+
Object.keys(i).length > 0 && t.setMetadata(i), t.setId(Number(e.id)), await U.editMessage(t), await Je(e.scheduled.originalChatUid);
|
|
4629
4629
|
} catch (e) {
|
|
4630
4630
|
throw g.value = Q(e, "Unable to edit the scheduled message."), e;
|
|
4631
4631
|
} finally {
|
|
4632
4632
|
d.value = !1;
|
|
4633
4633
|
}
|
|
4634
4634
|
}
|
|
4635
|
-
async function
|
|
4635
|
+
async function Qe(e) {
|
|
4636
4636
|
d.value = !0, g.value = null;
|
|
4637
4637
|
try {
|
|
4638
4638
|
let t = Zs(), n = await fetch(`${W().chatApiBaseUrl}/chats/rescheduleMessage`, {
|
|
@@ -4649,45 +4649,45 @@ function ks({ environment: e }) {
|
|
|
4649
4649
|
})
|
|
4650
4650
|
});
|
|
4651
4651
|
if (!n.ok) throw Error(`Reschedule failed with status ${n.status}.`);
|
|
4652
|
-
await
|
|
4652
|
+
await Je(e.originalChatUid);
|
|
4653
4653
|
} catch (e) {
|
|
4654
4654
|
throw g.value = Q(e, "Unable to reschedule the message."), e;
|
|
4655
4655
|
} finally {
|
|
4656
4656
|
d.value = !1;
|
|
4657
4657
|
}
|
|
4658
4658
|
}
|
|
4659
|
-
function
|
|
4659
|
+
function $e(e) {
|
|
4660
4660
|
let t = new U.MessagesRequestBuilder().setLimit(50).hideReplies(!0).hideDeletedMessages(!0);
|
|
4661
4661
|
return e.type === "group" ? t.setGUID(e.targetId) : t.setUID(e.targetId), t.build();
|
|
4662
4662
|
}
|
|
4663
|
-
function
|
|
4663
|
+
function et(e) {
|
|
4664
4664
|
return new U.MessagesRequestBuilder().setLimit(50).setParentMessageId(Number(e)).hideDeletedMessages(!0).build();
|
|
4665
4665
|
}
|
|
4666
|
-
async function
|
|
4666
|
+
async function tt(e) {
|
|
4667
4667
|
let t = P.value;
|
|
4668
4668
|
if (!t) return y.value = [], S.value = !1, !1;
|
|
4669
4669
|
if ((e?.reset || ce?.conversationId !== t.id) && (ce = {
|
|
4670
4670
|
conversationId: t.id,
|
|
4671
|
-
request:
|
|
4671
|
+
request: $e(t)
|
|
4672
4672
|
}, S.value = !0), !ce) return !1;
|
|
4673
4673
|
let n = await ce.request.fetchPrevious(), r = n.map((e) => N(e, _.value?.uid)).filter(Ks).sort(Hs);
|
|
4674
4674
|
y.value = e?.reset ? Ws(y.value.filter((e) => e.conversationId === t.id && Gs(e)), r) : Ws(y.value, r), S.value = n.length === 50, H?.setMessages(t.id, y.value);
|
|
4675
4675
|
let i = n[n.length - 1];
|
|
4676
|
-
return i && (await
|
|
4676
|
+
return i && (await vt(i), await _t(i)), n.length > 0;
|
|
4677
4677
|
}
|
|
4678
|
-
async function
|
|
4678
|
+
async function nt() {
|
|
4679
4679
|
let e = P.value;
|
|
4680
4680
|
if (!e) {
|
|
4681
4681
|
y.value = [], S.value = !1, ce = null;
|
|
4682
4682
|
return;
|
|
4683
4683
|
}
|
|
4684
|
-
let t =
|
|
4684
|
+
let t = ke(e.id);
|
|
4685
4685
|
if (a.value = !0, m.value && H) {
|
|
4686
4686
|
S.value = !1, ce = null, a.value = !1;
|
|
4687
4687
|
return;
|
|
4688
4688
|
}
|
|
4689
4689
|
try {
|
|
4690
|
-
await
|
|
4690
|
+
await tt({ reset: !0 }), v.value = v.value.map((t) => t.id === e.id ? {
|
|
4691
4691
|
...t,
|
|
4692
4692
|
unreadCount: 0
|
|
4693
4693
|
} : t), H?.setConversations(v.value);
|
|
@@ -4702,25 +4702,25 @@ function ks({ environment: e }) {
|
|
|
4702
4702
|
a.value = !1;
|
|
4703
4703
|
}
|
|
4704
4704
|
}
|
|
4705
|
-
async function
|
|
4705
|
+
async function rt(e) {
|
|
4706
4706
|
let t = E.value?.id;
|
|
4707
4707
|
if (!t) return b.value = [], C.value = !1, !1;
|
|
4708
4708
|
if ((e?.reset || le?.parentMessageId !== t) && (le = {
|
|
4709
4709
|
parentMessageId: t,
|
|
4710
|
-
request:
|
|
4710
|
+
request: et(t)
|
|
4711
4711
|
}, C.value = !0), !le) return !1;
|
|
4712
4712
|
let n = await le.request.fetchPrevious(), r = n.map((e) => N(e, _.value?.uid)).filter(Ks).sort(Hs);
|
|
4713
4713
|
b.value = e?.reset ? Ws(b.value.filter((e) => e.parentMessageId === t && Gs(e)), r) : Ws(b.value, r), C.value = n.length === 50, H?.setThreadMessages(t, b.value);
|
|
4714
4714
|
let i = n[n.length - 1];
|
|
4715
|
-
return i && (await
|
|
4715
|
+
return i && (await vt(i), await _t(i)), n.length > 0;
|
|
4716
4716
|
}
|
|
4717
|
-
async function
|
|
4717
|
+
async function it(e) {
|
|
4718
4718
|
if (o.value = !0, m.value && H) {
|
|
4719
4719
|
b.value = H.getThreadMessages(e).sort(Hs), C.value = !1, le = null, o.value = !1;
|
|
4720
4720
|
return;
|
|
4721
4721
|
}
|
|
4722
4722
|
try {
|
|
4723
|
-
await
|
|
4723
|
+
await rt({ reset: !0 });
|
|
4724
4724
|
} catch (t) {
|
|
4725
4725
|
let n = H?.getThreadMessages(e) ?? [];
|
|
4726
4726
|
if (n.length > 0) {
|
|
@@ -4732,29 +4732,29 @@ function ks({ environment: e }) {
|
|
|
4732
4732
|
o.value = !1;
|
|
4733
4733
|
}
|
|
4734
4734
|
}
|
|
4735
|
-
async function
|
|
4735
|
+
async function at() {
|
|
4736
4736
|
if (a.value || s.value || !S.value) return !1;
|
|
4737
4737
|
s.value = !0, g.value = null;
|
|
4738
4738
|
try {
|
|
4739
|
-
return await
|
|
4739
|
+
return await tt();
|
|
4740
4740
|
} catch (e) {
|
|
4741
4741
|
throw g.value = Q(e, "Unable to load messages."), e;
|
|
4742
4742
|
} finally {
|
|
4743
4743
|
s.value = !1;
|
|
4744
4744
|
}
|
|
4745
4745
|
}
|
|
4746
|
-
async function
|
|
4746
|
+
async function ot() {
|
|
4747
4747
|
if (o.value || c.value || !C.value) return !1;
|
|
4748
4748
|
c.value = !0, g.value = null;
|
|
4749
4749
|
try {
|
|
4750
|
-
return await
|
|
4750
|
+
return await rt();
|
|
4751
4751
|
} catch (e) {
|
|
4752
4752
|
throw g.value = Q(e, "Unable to load thread."), e;
|
|
4753
4753
|
} finally {
|
|
4754
4754
|
c.value = !1;
|
|
4755
4755
|
}
|
|
4756
4756
|
}
|
|
4757
|
-
async function
|
|
4757
|
+
async function st(e) {
|
|
4758
4758
|
let t = e.trim();
|
|
4759
4759
|
if (!t) return !1;
|
|
4760
4760
|
let n = () => y.value.some((e) => e.id === t) || b.value.some((e) => e.id === t) || E.value?.id === t;
|
|
@@ -4762,92 +4762,92 @@ function ks({ environment: e }) {
|
|
|
4762
4762
|
let r = 0;
|
|
4763
4763
|
for (; C.value && E.value && r < 100;) {
|
|
4764
4764
|
r += 1;
|
|
4765
|
-
let e = await
|
|
4765
|
+
let e = await ot();
|
|
4766
4766
|
if (n()) return !0;
|
|
4767
4767
|
if (!e) break;
|
|
4768
4768
|
}
|
|
4769
4769
|
for (; S.value && P.value && r < 100;) {
|
|
4770
4770
|
r += 1;
|
|
4771
|
-
let e = await
|
|
4771
|
+
let e = await at();
|
|
4772
4772
|
if (n()) return !0;
|
|
4773
4773
|
if (!e) break;
|
|
4774
4774
|
}
|
|
4775
4775
|
return n();
|
|
4776
4776
|
}
|
|
4777
|
-
async function
|
|
4777
|
+
async function lt() {
|
|
4778
4778
|
let e = await U.getLoggedinUser();
|
|
4779
4779
|
_.value = e ? Is(e) : null, h.value = !!e;
|
|
4780
4780
|
}
|
|
4781
|
-
function
|
|
4781
|
+
function ut() {
|
|
4782
4782
|
te ||= (U.addConnectionListener(F, new U.ConnectionListener({
|
|
4783
4783
|
onConnected: () => {
|
|
4784
4784
|
if (p.value = !0, ie = 0, Ce(), V) {
|
|
4785
|
-
|
|
4785
|
+
G();
|
|
4786
4786
|
return;
|
|
4787
4787
|
}
|
|
4788
|
-
|
|
4788
|
+
Ut();
|
|
4789
4789
|
},
|
|
4790
4790
|
onDisconnected: () => {
|
|
4791
4791
|
p.value = !1, !m.value && h.value && !ae && (V = !0, Ee(!0));
|
|
4792
4792
|
}
|
|
4793
4793
|
})), U.addMessageListener(I, new U.MessageListener({
|
|
4794
4794
|
onTextMessageReceived: (e) => {
|
|
4795
|
-
|
|
4795
|
+
dt(e);
|
|
4796
4796
|
},
|
|
4797
4797
|
onMediaMessageReceived: (e) => {
|
|
4798
|
-
|
|
4798
|
+
dt(e);
|
|
4799
4799
|
},
|
|
4800
4800
|
onCustomMessageReceived: (e) => {
|
|
4801
|
-
|
|
4801
|
+
dt(e);
|
|
4802
4802
|
},
|
|
4803
4803
|
onMessagesDelivered: () => {
|
|
4804
|
-
Te() ||
|
|
4804
|
+
Te() || xt({ includeThread: !1 });
|
|
4805
4805
|
},
|
|
4806
4806
|
onMessagesRead: () => {
|
|
4807
|
-
Te() ||
|
|
4807
|
+
Te() || xt({ includeThread: !1 });
|
|
4808
4808
|
},
|
|
4809
4809
|
onMessageEdited: (e) => {
|
|
4810
4810
|
let t = N(e, _.value?.uid);
|
|
4811
|
-
Ks(t) && (
|
|
4811
|
+
Ks(t) && (ht(t), mt(e));
|
|
4812
4812
|
},
|
|
4813
4813
|
onMessageDeleted: (e) => {
|
|
4814
4814
|
let t = N(e, _.value?.uid);
|
|
4815
|
-
t.parentMessageId ?
|
|
4815
|
+
t.parentMessageId ? Ot(t) : (Ot(t), kt(t)), Dt();
|
|
4816
4816
|
},
|
|
4817
4817
|
onMessageReactionAdded: () => {
|
|
4818
|
-
|
|
4818
|
+
xt();
|
|
4819
4819
|
},
|
|
4820
4820
|
onMessageReactionRemoved: () => {
|
|
4821
|
-
|
|
4821
|
+
xt();
|
|
4822
4822
|
},
|
|
4823
4823
|
onMessagesDeliveredToAll: () => {
|
|
4824
|
-
Te() ||
|
|
4824
|
+
Te() || xt({ includeThread: !1 });
|
|
4825
4825
|
},
|
|
4826
4826
|
onMessagesReadByAll: () => {
|
|
4827
|
-
Te() ||
|
|
4827
|
+
Te() || xt({ includeThread: !1 });
|
|
4828
4828
|
}
|
|
4829
4829
|
})), !0);
|
|
4830
4830
|
}
|
|
4831
|
-
async function
|
|
4831
|
+
async function dt(e) {
|
|
4832
4832
|
let t = N(e, _.value?.uid);
|
|
4833
4833
|
if (Ks(t)) {
|
|
4834
|
-
if (
|
|
4835
|
-
|
|
4834
|
+
if (mt(e), await vt(e), t.parentMessageId) {
|
|
4835
|
+
gt(t), Et(t.parentMessageId), Dt();
|
|
4836
4836
|
return;
|
|
4837
4837
|
}
|
|
4838
|
-
t.conversationId === T.value && (
|
|
4838
|
+
t.conversationId === T.value && (ht(t), Dt(), await _t(e));
|
|
4839
4839
|
}
|
|
4840
4840
|
}
|
|
4841
|
-
async function
|
|
4841
|
+
async function ft(e) {
|
|
4842
4842
|
return await Promise.all(e.map(async (e) => {
|
|
4843
|
-
let t = await
|
|
4843
|
+
let t = await pt(e.targetId);
|
|
4844
4844
|
return {
|
|
4845
4845
|
...e,
|
|
4846
4846
|
muteSettings: t ? new Date(t) : null
|
|
4847
4847
|
};
|
|
4848
4848
|
}));
|
|
4849
4849
|
}
|
|
4850
|
-
async function
|
|
4850
|
+
async function pt(e) {
|
|
4851
4851
|
let t = H?.getParticipantSettings(e), n = t?.lastUpdated ? Date.now() - t.lastUpdated > 1440 * 60 * 1e3 : !0;
|
|
4852
4852
|
if (t && (m.value || !n)) return t.mutedUntil;
|
|
4853
4853
|
if (m.value || !h.value) return t?.mutedUntil ?? null;
|
|
@@ -4874,12 +4874,12 @@ function ks({ environment: e }) {
|
|
|
4874
4874
|
return t?.mutedUntil ?? null;
|
|
4875
4875
|
}
|
|
4876
4876
|
}
|
|
4877
|
-
function
|
|
4877
|
+
function mt(e) {
|
|
4878
4878
|
let t = N(e, _.value?.uid);
|
|
4879
4879
|
if (!Ks(t) || t.isDeleted) return;
|
|
4880
4880
|
let n = e.getConversationId(), r = v.value.find((e) => e.id === n);
|
|
4881
4881
|
if (!r) {
|
|
4882
|
-
|
|
4882
|
+
Pe();
|
|
4883
4883
|
return;
|
|
4884
4884
|
}
|
|
4885
4885
|
let i = {
|
|
@@ -4890,33 +4890,33 @@ function ks({ environment: e }) {
|
|
|
4890
4890
|
};
|
|
4891
4891
|
v.value = Vs(v.value.map((e) => e.id === n ? i : e)), H?.setConversations(v.value);
|
|
4892
4892
|
}
|
|
4893
|
-
function
|
|
4893
|
+
function ht(e) {
|
|
4894
4894
|
y.value = Us(y.value, e), T.value && H?.setMessages(T.value, y.value);
|
|
4895
4895
|
}
|
|
4896
|
-
function
|
|
4896
|
+
function gt(e) {
|
|
4897
4897
|
e.parentMessageId === E.value?.id && (b.value = Us(b.value, e), e.parentMessageId && H?.setThreadMessages(e.parentMessageId, b.value));
|
|
4898
4898
|
}
|
|
4899
|
-
async function
|
|
4899
|
+
async function _t(e) {
|
|
4900
4900
|
if (m.value) return;
|
|
4901
4901
|
let t = e.getSender?.()?.getUid?.();
|
|
4902
4902
|
!t || t === _.value?.uid || e.getReadByMeAt?.() || (we(), await U.markAsRead(e));
|
|
4903
4903
|
}
|
|
4904
|
-
async function
|
|
4904
|
+
async function vt(e) {
|
|
4905
4905
|
if (m.value) return;
|
|
4906
4906
|
let t = e.getSender?.()?.getUid?.();
|
|
4907
4907
|
!t || t === _.value?.uid || e.getDeliveredToMeAt?.() || (we(), await U.markAsDelivered(e));
|
|
4908
4908
|
}
|
|
4909
|
-
async function
|
|
4909
|
+
async function yt(e) {
|
|
4910
4910
|
return m.value ? [] : Ps(await U.getMessageReceipts(String(e.id)));
|
|
4911
4911
|
}
|
|
4912
|
-
function
|
|
4912
|
+
function bt() {
|
|
4913
4913
|
r.value = !1, i.value = !1, a.value = !1, o.value = !1, s.value = !1, c.value = !1, l.value = !1, u.value = !1, d.value = !1, f.value = !1, p.value = !1, Ce(), ie = 0, V = !1, ae = !1, h.value = !1, _.value = null, v.value = [], y.value = [], b.value = [], x.value = [], E.value = null, D.value = null, O.value = null, k.value = [], T.value = null, S.value = !1, C.value = !1, ce = null, le = null, se.clear();
|
|
4914
4914
|
}
|
|
4915
|
-
async function
|
|
4915
|
+
async function xt(e) {
|
|
4916
4916
|
if (B) return B;
|
|
4917
4917
|
let t = e?.includeThread ?? !0;
|
|
4918
4918
|
B = (async () => {
|
|
4919
|
-
P.value && await
|
|
4919
|
+
P.value && await nt(), t && E.value && await it(E.value.id);
|
|
4920
4920
|
})();
|
|
4921
4921
|
try {
|
|
4922
4922
|
await B;
|
|
@@ -4924,20 +4924,20 @@ function ks({ environment: e }) {
|
|
|
4924
4924
|
B = null;
|
|
4925
4925
|
}
|
|
4926
4926
|
}
|
|
4927
|
-
function
|
|
4928
|
-
|
|
4927
|
+
function St(e) {
|
|
4928
|
+
Ct(e), e.parentMessageId && Et(e.parentMessageId, e.replyCount), Dt();
|
|
4929
4929
|
}
|
|
4930
|
-
function
|
|
4930
|
+
function Ct(e) {
|
|
4931
4931
|
if (e.parentMessageId) {
|
|
4932
4932
|
E.value?.id === e.parentMessageId && (b.value = Us(b.value, e));
|
|
4933
4933
|
return;
|
|
4934
4934
|
}
|
|
4935
4935
|
y.value = Us(y.value, e), E.value?.id === e.id && (E.value = e);
|
|
4936
4936
|
}
|
|
4937
|
-
function
|
|
4937
|
+
function wt(e, t) {
|
|
4938
4938
|
return t ? b.value.find((t) => t.id === e) ?? null : E.value?.id === e ? E.value : y.value.find((t) => t.id === e) ?? null;
|
|
4939
4939
|
}
|
|
4940
|
-
function
|
|
4940
|
+
function Tt(e, t) {
|
|
4941
4941
|
let n = e.reactions.find((e) => e.emoji === t);
|
|
4942
4942
|
return n ? n.reactedByMe && n.count === 1 ? {
|
|
4943
4943
|
...e,
|
|
@@ -4958,7 +4958,7 @@ function ks({ environment: e }) {
|
|
|
4958
4958
|
}]
|
|
4959
4959
|
};
|
|
4960
4960
|
}
|
|
4961
|
-
function
|
|
4961
|
+
function Et(e, t) {
|
|
4962
4962
|
let n = y.value.find((t) => t.id === e);
|
|
4963
4963
|
if (!n) return;
|
|
4964
4964
|
let r = {
|
|
@@ -4967,18 +4967,18 @@ function ks({ environment: e }) {
|
|
|
4967
4967
|
};
|
|
4968
4968
|
y.value = Us(y.value, r), E.value?.id === e && (E.value = r);
|
|
4969
4969
|
}
|
|
4970
|
-
function
|
|
4970
|
+
function Dt() {
|
|
4971
4971
|
T.value && H?.setMessages(T.value, y.value), E.value && H?.setThreadMessages(E.value.id, b.value);
|
|
4972
4972
|
}
|
|
4973
|
-
function
|
|
4973
|
+
function Ot(e) {
|
|
4974
4974
|
if (e.parentMessageId ? (b.value = b.value.filter((t) => t.id !== e.id), H?.setThreadMessages(e.parentMessageId, b.value)) : (y.value = y.value.filter((t) => t.id !== e.id), T.value && H?.setMessages(T.value, y.value)), e.muid) {
|
|
4975
4975
|
k.value = k.value.filter((t) => t.muid !== e.muid);
|
|
4976
4976
|
let t = H?.getQueue().filter((t) => t.muid === e.muid) ?? [];
|
|
4977
4977
|
for (let e of t) H?.dequeue(e.id), oe.delete(e.id), e.kind === "attachment" && H?.deleteQueuedAttachment(e.id);
|
|
4978
4978
|
}
|
|
4979
|
-
e.parentMessageId ||
|
|
4979
|
+
e.parentMessageId || At(e.conversationId);
|
|
4980
4980
|
}
|
|
4981
|
-
function
|
|
4981
|
+
function kt(e) {
|
|
4982
4982
|
if (e.parentMessageId) return;
|
|
4983
4983
|
let t = e.conversationId, n = v.value.find((e) => e.id === t);
|
|
4984
4984
|
if (!n) return;
|
|
@@ -5002,7 +5002,7 @@ function ks({ environment: e }) {
|
|
|
5002
5002
|
lastMessageAt: void 0
|
|
5003
5003
|
} : e : e)), H?.setConversations(v.value);
|
|
5004
5004
|
}
|
|
5005
|
-
function
|
|
5005
|
+
function At(e, t) {
|
|
5006
5006
|
let n = y.value.length > 0 ? y.value[y.value.length - 1] : null, r = t ?? n;
|
|
5007
5007
|
v.value = Vs(v.value.map((t) => t.id === e ? {
|
|
5008
5008
|
...t,
|
|
@@ -5010,7 +5010,7 @@ function ks({ environment: e }) {
|
|
|
5010
5010
|
lastMessageAt: r?.sentAt
|
|
5011
5011
|
} : t)), H?.setConversations(v.value);
|
|
5012
5012
|
}
|
|
5013
|
-
function
|
|
5013
|
+
function jt(e) {
|
|
5014
5014
|
v.value = Vs(v.value.map((t) => t.id === e.conversationId ? {
|
|
5015
5015
|
...t,
|
|
5016
5016
|
subtitle: Ys(e),
|
|
@@ -5018,8 +5018,8 @@ function ks({ environment: e }) {
|
|
|
5018
5018
|
unreadCount: 0
|
|
5019
5019
|
} : t)), H?.setConversations(v.value);
|
|
5020
5020
|
}
|
|
5021
|
-
function
|
|
5022
|
-
let t = /* @__PURE__ */ new Date(), n =
|
|
5021
|
+
function Mt(e) {
|
|
5022
|
+
let t = /* @__PURE__ */ new Date(), n = Pt(e.metadata);
|
|
5023
5023
|
return {
|
|
5024
5024
|
id: `local-${e.muid}`,
|
|
5025
5025
|
muid: e.muid,
|
|
@@ -5058,11 +5058,11 @@ function ks({ environment: e }) {
|
|
|
5058
5058
|
source: null
|
|
5059
5059
|
};
|
|
5060
5060
|
}
|
|
5061
|
-
function
|
|
5061
|
+
function Nt(e, t) {
|
|
5062
5062
|
let n = {};
|
|
5063
5063
|
return t?.senderDisplayName?.trim() && (n.senderDisplayName = t.senderDisplayName.trim()), e ? (n.replyToMessageId = e.id, n.replyPreview = hs(e), n) : n;
|
|
5064
5064
|
}
|
|
5065
|
-
function
|
|
5065
|
+
function Pt(e) {
|
|
5066
5066
|
let t = e.replyPreview;
|
|
5067
5067
|
if (!t || typeof t != "object") return;
|
|
5068
5068
|
let n = t;
|
|
@@ -5073,13 +5073,13 @@ function ks({ environment: e }) {
|
|
|
5073
5073
|
kind: n.kind ?? "text"
|
|
5074
5074
|
};
|
|
5075
5075
|
}
|
|
5076
|
-
function
|
|
5076
|
+
function J(e) {
|
|
5077
5077
|
if (typeof navigator < "u" && !navigator.onLine) return !0;
|
|
5078
5078
|
let t = Q(e, "").toLowerCase();
|
|
5079
5079
|
return t.includes("network") || t.includes("failed to fetch") || t.includes("socket") || t.includes("offline");
|
|
5080
5080
|
}
|
|
5081
|
-
function
|
|
5082
|
-
let a =
|
|
5081
|
+
function Ft(e, t, n, r, i) {
|
|
5082
|
+
let a = Mt({
|
|
5083
5083
|
conversation: e,
|
|
5084
5084
|
kind: "text",
|
|
5085
5085
|
text: t,
|
|
@@ -5088,7 +5088,7 @@ function ks({ environment: e }) {
|
|
|
5088
5088
|
muid: i,
|
|
5089
5089
|
deliveryState: "queued"
|
|
5090
5090
|
});
|
|
5091
|
-
|
|
5091
|
+
zt(a, {
|
|
5092
5092
|
id: a.id,
|
|
5093
5093
|
muid: i,
|
|
5094
5094
|
conversationId: e.id,
|
|
@@ -5101,9 +5101,9 @@ function ks({ environment: e }) {
|
|
|
5101
5101
|
createdAt: a.sentAt.toISOString()
|
|
5102
5102
|
});
|
|
5103
5103
|
}
|
|
5104
|
-
function
|
|
5105
|
-
if (
|
|
5106
|
-
let a =
|
|
5104
|
+
function It(e, t, n, r, i) {
|
|
5105
|
+
if (Lt(e, t, r)) return;
|
|
5106
|
+
let a = Mt({
|
|
5107
5107
|
conversation: e,
|
|
5108
5108
|
kind: "poll",
|
|
5109
5109
|
text: `Poll: ${t.question}`,
|
|
@@ -5113,7 +5113,7 @@ function ks({ environment: e }) {
|
|
|
5113
5113
|
muid: i,
|
|
5114
5114
|
deliveryState: "queued"
|
|
5115
5115
|
});
|
|
5116
|
-
|
|
5116
|
+
zt(a, {
|
|
5117
5117
|
id: a.id,
|
|
5118
5118
|
muid: i,
|
|
5119
5119
|
conversationId: e.id,
|
|
@@ -5126,7 +5126,7 @@ function ks({ environment: e }) {
|
|
|
5126
5126
|
createdAt: a.sentAt.toISOString()
|
|
5127
5127
|
});
|
|
5128
5128
|
}
|
|
5129
|
-
function
|
|
5129
|
+
function Lt(e, t, n) {
|
|
5130
5130
|
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);
|
|
5131
5131
|
return k.value.some((t) => {
|
|
5132
5132
|
if (t.kind !== "poll" || !t.poll || t.conversationId !== e.id || t.targetId !== e.targetId || t.parentMessageId !== n) return !1;
|
|
@@ -5134,8 +5134,8 @@ function ks({ environment: e }) {
|
|
|
5134
5134
|
return Number.isNaN(c) || r - c > 5e3 ? !1 : i(t.poll.question) === o && a(t.poll.options) === s;
|
|
5135
5135
|
});
|
|
5136
5136
|
}
|
|
5137
|
-
async function
|
|
5138
|
-
let a = ec(t.file), o =
|
|
5137
|
+
async function Rt(e, t, n, r, i) {
|
|
5138
|
+
let a = ec(t.file), o = Mt({
|
|
5139
5139
|
conversation: e,
|
|
5140
5140
|
kind: a,
|
|
5141
5141
|
text: t.caption?.trim() ?? "",
|
|
@@ -5171,15 +5171,15 @@ function ks({ environment: e }) {
|
|
|
5171
5171
|
try {
|
|
5172
5172
|
await H?.storeQueuedAttachment(s.id, t.file);
|
|
5173
5173
|
} catch {}
|
|
5174
|
-
|
|
5174
|
+
zt(o, s);
|
|
5175
5175
|
}
|
|
5176
|
-
function
|
|
5177
|
-
k.value = [...k.value, t], H?.enqueue(t),
|
|
5176
|
+
function zt(e, t) {
|
|
5177
|
+
k.value = [...k.value, t], H?.enqueue(t), Bt(e);
|
|
5178
5178
|
}
|
|
5179
|
-
function
|
|
5180
|
-
e.parentMessageId ? (E.value?.id === e.parentMessageId && (b.value = Us(b.value, e)),
|
|
5179
|
+
function Bt(e) {
|
|
5180
|
+
e.parentMessageId ? (E.value?.id === e.parentMessageId && (b.value = Us(b.value, e)), Et(e.parentMessageId)) : y.value = Us(y.value, e), jt(e), Dt();
|
|
5181
5181
|
}
|
|
5182
|
-
function
|
|
5182
|
+
function Vt(e, t) {
|
|
5183
5183
|
let n = (n) => n.map((n) => {
|
|
5184
5184
|
let r = qs(n);
|
|
5185
5185
|
return n.muid !== t && r !== t ? n : {
|
|
@@ -5187,18 +5187,18 @@ function ks({ environment: e }) {
|
|
|
5187
5187
|
deliveryState: e
|
|
5188
5188
|
};
|
|
5189
5189
|
});
|
|
5190
|
-
y.value = n(y.value), b.value = n(b.value),
|
|
5190
|
+
y.value = n(y.value), b.value = n(b.value), Dt();
|
|
5191
5191
|
}
|
|
5192
|
-
function
|
|
5192
|
+
function Ht(e) {
|
|
5193
5193
|
if (!e) return;
|
|
5194
5194
|
let t = [...y.value, ...b.value].filter((t) => {
|
|
5195
5195
|
if (!t.id.startsWith("local-")) return !1;
|
|
5196
5196
|
let n = qs(t);
|
|
5197
5197
|
return t.muid === e || n === e;
|
|
5198
5198
|
});
|
|
5199
|
-
for (let e of t)
|
|
5199
|
+
for (let e of t) Ot(e);
|
|
5200
5200
|
}
|
|
5201
|
-
async function
|
|
5201
|
+
async function Ut() {
|
|
5202
5202
|
if (!(f.value || k.value.length === 0 || !h.value || m.value)) {
|
|
5203
5203
|
f.value = !0;
|
|
5204
5204
|
try {
|
|
@@ -5206,20 +5206,20 @@ function ks({ environment: e }) {
|
|
|
5206
5206
|
for (let t of e) if (!se.has(t.id)) {
|
|
5207
5207
|
se.add(t.id);
|
|
5208
5208
|
try {
|
|
5209
|
-
let e = await
|
|
5210
|
-
k.value = k.value.filter((e) => e.id !== t.id), H?.dequeue(t.id), oe.delete(t.id), t.kind === "attachment" && await H?.deleteQueuedAttachment(t.id),
|
|
5209
|
+
let e = await Wt(t);
|
|
5210
|
+
k.value = k.value.filter((e) => e.id !== t.id), H?.dequeue(t.id), oe.delete(t.id), t.kind === "attachment" && await H?.deleteQueuedAttachment(t.id), Ht(t.muid), e ? St(N(e, _.value?.uid)) : await xt();
|
|
5211
5211
|
} finally {
|
|
5212
5212
|
se.delete(t.id);
|
|
5213
5213
|
}
|
|
5214
5214
|
}
|
|
5215
5215
|
} catch (e) {
|
|
5216
|
-
|
|
5216
|
+
J(e) || (g.value = Q(e, "Unable to sync queued messages."));
|
|
5217
5217
|
} finally {
|
|
5218
5218
|
f.value = !1;
|
|
5219
5219
|
}
|
|
5220
5220
|
}
|
|
5221
5221
|
}
|
|
5222
|
-
async function
|
|
5222
|
+
async function Wt(e) {
|
|
5223
5223
|
let t = e.receiverType === "group" ? U.RECEIVER_TYPE.GROUP : U.RECEIVER_TYPE.USER;
|
|
5224
5224
|
if (e.kind === "poll" && e.poll) {
|
|
5225
5225
|
let n = {
|
|
@@ -5271,32 +5271,32 @@ function ks({ environment: e }) {
|
|
|
5271
5271
|
replyToMessage: D,
|
|
5272
5272
|
editingMessage: O,
|
|
5273
5273
|
init: fe,
|
|
5274
|
-
connectRealtime:
|
|
5275
|
-
disconnectRealtime:
|
|
5274
|
+
connectRealtime: Ae,
|
|
5275
|
+
disconnectRealtime: Me,
|
|
5276
5276
|
login: pe,
|
|
5277
5277
|
logout: me,
|
|
5278
|
-
fetchConversations:
|
|
5279
|
-
selectConversation:
|
|
5280
|
-
sendTextMessage:
|
|
5281
|
-
sendAttachmentMessage:
|
|
5282
|
-
sendPollMessage:
|
|
5283
|
-
fetchScheduledMessages:
|
|
5284
|
-
loadOlderMessages:
|
|
5285
|
-
loadOlderThreadMessages:
|
|
5286
|
-
ensureMessageLoaded:
|
|
5287
|
-
scheduleMessage:
|
|
5288
|
-
rescheduleMessage:
|
|
5289
|
-
removeScheduledMessage:
|
|
5290
|
-
editScheduledMessage:
|
|
5291
|
-
setReplyToMessage:
|
|
5292
|
-
setEditingMessage:
|
|
5293
|
-
openThread:
|
|
5294
|
-
closeThread:
|
|
5295
|
-
fetchMessageReceipts:
|
|
5296
|
-
deleteMessage:
|
|
5297
|
-
votePoll:
|
|
5298
|
-
toggleReaction:
|
|
5299
|
-
translateMessage:
|
|
5278
|
+
fetchConversations: Pe,
|
|
5279
|
+
selectConversation: Fe,
|
|
5280
|
+
sendTextMessage: q,
|
|
5281
|
+
sendAttachmentMessage: Ve,
|
|
5282
|
+
sendPollMessage: He,
|
|
5283
|
+
fetchScheduledMessages: Je,
|
|
5284
|
+
loadOlderMessages: at,
|
|
5285
|
+
loadOlderThreadMessages: ot,
|
|
5286
|
+
ensureMessageLoaded: st,
|
|
5287
|
+
scheduleMessage: Ye,
|
|
5288
|
+
rescheduleMessage: Qe,
|
|
5289
|
+
removeScheduledMessage: Xe,
|
|
5290
|
+
editScheduledMessage: Ze,
|
|
5291
|
+
setReplyToMessage: Ie,
|
|
5292
|
+
setEditingMessage: K,
|
|
5293
|
+
openThread: Le,
|
|
5294
|
+
closeThread: Re,
|
|
5295
|
+
fetchMessageReceipts: yt,
|
|
5296
|
+
deleteMessage: Ke,
|
|
5297
|
+
votePoll: Ue,
|
|
5298
|
+
toggleReaction: Ge,
|
|
5299
|
+
translateMessage: qe,
|
|
5300
5300
|
mentionDisplayNamesByUid: A,
|
|
5301
5301
|
rememberMentionDisplayNames: M
|
|
5302
5302
|
};
|
|
@@ -5330,8 +5330,8 @@ function Ms(e, t) {
|
|
|
5330
5330
|
id: e.getConversationId(),
|
|
5331
5331
|
targetId: o,
|
|
5332
5332
|
type: r,
|
|
5333
|
-
title:
|
|
5334
|
-
subtitle:
|
|
5333
|
+
title: ze("scheduledMessages"),
|
|
5334
|
+
subtitle: ze("hiddenHelperConversation"),
|
|
5335
5335
|
unreadCount: 0,
|
|
5336
5336
|
tags: [],
|
|
5337
5337
|
source: e
|
|
@@ -5423,14 +5423,14 @@ function zs(e, t) {
|
|
|
5423
5423
|
if (String(r).toLowerCase() === "action") return uc(e);
|
|
5424
5424
|
if (i) return `Poll: ${i.question}`;
|
|
5425
5425
|
if (n === U.MESSAGE_TYPE.TEXT || typeof e.getText == "function") {
|
|
5426
|
-
let t = us(e.getText
|
|
5426
|
+
let t = us(e.getText());
|
|
5427
5427
|
if (t) return t;
|
|
5428
5428
|
}
|
|
5429
5429
|
if (String(r).toLowerCase() === "message" && mc(n)) {
|
|
5430
5430
|
let t = gc(e, pc(e))[0];
|
|
5431
5431
|
return e.getCaption?.()?.trim?.() || os(t ? [t] : [], "Sent an attachment");
|
|
5432
5432
|
}
|
|
5433
|
-
return e.getSender?.()?.getUid?.() === t ?
|
|
5433
|
+
return e.getSender?.()?.getUid?.() === t ? ze("youSentAMessage") : ze("unsupportedMessageType");
|
|
5434
5434
|
}
|
|
5435
5435
|
function Bs(e, t) {
|
|
5436
5436
|
if (e.getDeletedAt?.()) return "Message removed";
|
|
@@ -5447,10 +5447,10 @@ function Bs(e, t) {
|
|
|
5447
5447
|
let n = gc(e, pc(e))[0];
|
|
5448
5448
|
return os(n ? [n] : [], "Sent an attachment");
|
|
5449
5449
|
}
|
|
5450
|
-
return e.getSender?.()?.getUid?.() === t ?
|
|
5450
|
+
return e.getSender?.()?.getUid?.() === t ? ze("youSentAMessage") : ze("unsupportedMessageType");
|
|
5451
5451
|
}
|
|
5452
5452
|
function Vs(e) {
|
|
5453
|
-
return [...e].filter((e) => e.title !==
|
|
5453
|
+
return [...e].filter((e) => e.title !== ze("scheduledMessages")).sort((e, t) => {
|
|
5454
5454
|
let n = e.lastMessageAt?.getTime() ?? 0;
|
|
5455
5455
|
return (t.lastMessageAt?.getTime() ?? 0) - n;
|
|
5456
5456
|
});
|
|
@@ -5649,18 +5649,18 @@ function hc(e) {
|
|
|
5649
5649
|
return String(t).startsWith("image/") ? "image" : String(t).startsWith("video/") ? "video" : String(t).startsWith("audio/") ? "audio" : "file";
|
|
5650
5650
|
}
|
|
5651
5651
|
function gc(e, t) {
|
|
5652
|
-
let n = e.getAttachment?.(), r = e
|
|
5653
|
-
if (!n && !r) return [];
|
|
5654
|
-
let
|
|
5652
|
+
let n = e.getAttachment?.(), r = Dc(e), i = r?.attachments?.[0] ?? null;
|
|
5653
|
+
if (!n && !i && !r?.url) return [];
|
|
5654
|
+
let a = t === "image" || t === "video" || t === "audio" || t === "file" ? t : hc(e), o = _c(e, n, i);
|
|
5655
5655
|
return [{
|
|
5656
|
-
kind:
|
|
5657
|
-
name: n?.getName?.() ??
|
|
5658
|
-
url: n?.getUrl?.() ?? n?.getFileUrl?.() ??
|
|
5659
|
-
mimeType: n?.getMimeType?.() ??
|
|
5660
|
-
extension: n?.getExtension?.() ??
|
|
5661
|
-
size: n?.getSize?.() ??
|
|
5662
|
-
width:
|
|
5663
|
-
height:
|
|
5656
|
+
kind: a,
|
|
5657
|
+
name: n?.getName?.() ?? i?.name ?? i?.fileName ?? "Attachment",
|
|
5658
|
+
url: n?.getUrl?.() ?? n?.getFileUrl?.() ?? i?.url ?? i?.fileUrl ?? (typeof r?.url == "string" ? r.url : void 0) ?? void 0,
|
|
5659
|
+
mimeType: n?.getMimeType?.() ?? i?.mimeType ?? void 0,
|
|
5660
|
+
extension: n?.getExtension?.() ?? i?.extension ?? void 0,
|
|
5661
|
+
size: n?.getSize?.() ?? i?.size ?? void 0,
|
|
5662
|
+
width: o?.width,
|
|
5663
|
+
height: o?.height
|
|
5664
5664
|
}];
|
|
5665
5665
|
}
|
|
5666
5666
|
function _c(e, t, n) {
|
|
@@ -5919,7 +5919,7 @@ function Bc() {
|
|
|
5919
5919
|
return e ? new bs(e) : null;
|
|
5920
5920
|
}
|
|
5921
5921
|
function Vc() {
|
|
5922
|
-
let e =
|
|
5922
|
+
let e = je();
|
|
5923
5923
|
return e ? `bcc-chat:${W().appId}:${e}` : null;
|
|
5924
5924
|
}
|
|
5925
5925
|
function Hc() {
|
|
@@ -6002,8 +6002,10 @@ function sl(e) {
|
|
|
6002
6002
|
if (t) return {
|
|
6003
6003
|
text: e.subtitle,
|
|
6004
6004
|
type: t.getType?.() ?? "text",
|
|
6005
|
+
senderUid: t.getSender?.()?.getUid?.() ?? "",
|
|
6005
6006
|
senderName: t.getSender?.()?.getName?.() ?? "System",
|
|
6006
6007
|
sentAt: /* @__PURE__ */ new Date((t.getSentAt?.() ?? 0) * 1e3),
|
|
6008
|
+
readAt: t.getReadAt?.() ? /* @__PURE__ */ new Date(t.getReadAt() * 1e3) : void 0,
|
|
6007
6009
|
messageReceipts: void 0
|
|
6008
6010
|
};
|
|
6009
6011
|
}
|
|
@@ -6025,13 +6027,13 @@ var cl = n(() => $.value?.connected.value ?? !1), ll = n(() => Xc.value && !cl.v
|
|
|
6025
6027
|
muteSettings: e.muteSettings ?? null
|
|
6026
6028
|
})));
|
|
6027
6029
|
async function pl(e, t) {
|
|
6028
|
-
tl.value = t.loggerCallback,
|
|
6030
|
+
tl.value = t.loggerCallback, Re(t.language ?? "en"), al(t.themeMode);
|
|
6029
6031
|
let n = e.config.globalProperties.$primevue;
|
|
6030
|
-
n && (n.config.ripple = !0, n.config.inputVariant = "filled"), e.component("BccChat",
|
|
6032
|
+
n && (n.config.ripple = !0, n.config.inputVariant = "filled"), e.component("BccChat", ph), e.component("BccChatMessageList", ph), e.provide("theme", { theme: qc });
|
|
6031
6033
|
let r = ol(t.environment);
|
|
6032
6034
|
il(Yc.INFO, "Initializing chat", {
|
|
6033
6035
|
environment: t.environment,
|
|
6034
|
-
language:
|
|
6036
|
+
language: Fe.value,
|
|
6035
6037
|
themeMode: t.themeMode
|
|
6036
6038
|
}), await r.init(), Xc.value = !0, rl?.(), p(t.accessToken) ? rl = F(t.accessToken, async (e) => {
|
|
6037
6039
|
e ? await ml(e) : await hl();
|
|
@@ -6063,7 +6065,7 @@ function yl(e) {
|
|
|
6063
6065
|
$c.value = e;
|
|
6064
6066
|
}
|
|
6065
6067
|
function bl(e) {
|
|
6066
|
-
|
|
6068
|
+
Re(e);
|
|
6067
6069
|
}
|
|
6068
6070
|
function xl(e) {
|
|
6069
6071
|
al(e);
|
|
@@ -6151,7 +6153,7 @@ var jl = {
|
|
|
6151
6153
|
onlineStatus: dl.onlineStatus,
|
|
6152
6154
|
theme: qc,
|
|
6153
6155
|
themeMode: Qc,
|
|
6154
|
-
language:
|
|
6156
|
+
language: Fe
|
|
6155
6157
|
};
|
|
6156
6158
|
//#endregion
|
|
6157
6159
|
//#region src/chat/conversationState.ts
|
|
@@ -6202,7 +6204,7 @@ function Ul(e) {
|
|
|
6202
6204
|
uid: t.targetId,
|
|
6203
6205
|
displayName: t.title,
|
|
6204
6206
|
avatar: t.avatar
|
|
6205
|
-
}] : a.filter((e) => e.uid !== n).map(
|
|
6207
|
+
}] : a.filter((e) => e.uid !== n).map(qe) : [];
|
|
6206
6208
|
});
|
|
6207
6209
|
return {
|
|
6208
6210
|
client: t,
|
|
@@ -6216,7 +6218,7 @@ function Ul(e) {
|
|
|
6216
6218
|
isChannel: u,
|
|
6217
6219
|
sendOptions: d,
|
|
6218
6220
|
mentionCandidates: f,
|
|
6219
|
-
mentionNameByUid: n(() =>
|
|
6221
|
+
mentionNameByUid: n(() => lt(Je(f.value), t.value?.mentionDisplayNamesByUid.value ?? {}))
|
|
6220
6222
|
};
|
|
6221
6223
|
}
|
|
6222
6224
|
var Wl = Symbol("conversationCtx");
|
|
@@ -6967,14 +6969,52 @@ function Gu(e, t) {
|
|
|
6967
6969
|
}, [o("path", { d: "M160-160q-33 0-56.5-23.5T80-240v-480q0-33 23.5-56.5T160-800h480q33 0 56.5 23.5T720-720v180l126-126q10-10 22-5t12 19v344q0 14-12 19t-22-5L720-420v180q0 33-23.5 56.5T640-160H160Zm0-80h480v-480H160v480Zm0 0v-480 480Z" })]);
|
|
6968
6970
|
}
|
|
6969
6971
|
//#endregion
|
|
6972
|
+
//#region src/chat/clipboardFiles.ts
|
|
6973
|
+
var Ku = new Set([
|
|
6974
|
+
"",
|
|
6975
|
+
"image.png",
|
|
6976
|
+
"image.jpeg",
|
|
6977
|
+
"image.jpg",
|
|
6978
|
+
"image.gif",
|
|
6979
|
+
"image.webp",
|
|
6980
|
+
"blob"
|
|
6981
|
+
]), qu = {
|
|
6982
|
+
"image/png": "png",
|
|
6983
|
+
"image/jpeg": "jpg",
|
|
6984
|
+
"image/jpg": "jpg",
|
|
6985
|
+
"image/gif": "gif",
|
|
6986
|
+
"image/webp": "webp",
|
|
6987
|
+
"image/bmp": "bmp",
|
|
6988
|
+
"image/svg+xml": "svg"
|
|
6989
|
+
};
|
|
6990
|
+
function Ju(e) {
|
|
6991
|
+
let t = e.name.trim(), n = t.toLowerCase();
|
|
6992
|
+
return Ku.has(n) ? `pasted-image.${qu[e.type] ?? "png"}` : t;
|
|
6993
|
+
}
|
|
6994
|
+
function Yu(e) {
|
|
6995
|
+
let t = e.clipboardData?.items;
|
|
6996
|
+
if (!t) return null;
|
|
6997
|
+
for (let e of t) {
|
|
6998
|
+
if (e.kind !== "file" || !e.type.startsWith("image/")) continue;
|
|
6999
|
+
let t = e.getAsFile();
|
|
7000
|
+
if (!t) continue;
|
|
7001
|
+
let n = Ju(t);
|
|
7002
|
+
return n === t.name ? t : new File([t], n, {
|
|
7003
|
+
type: t.type,
|
|
7004
|
+
lastModified: t.lastModified
|
|
7005
|
+
});
|
|
7006
|
+
}
|
|
7007
|
+
return null;
|
|
7008
|
+
}
|
|
7009
|
+
//#endregion
|
|
6970
7010
|
//#region src/composables/useComposerTriggers.ts
|
|
6971
|
-
function
|
|
7011
|
+
function Xu(e) {
|
|
6972
7012
|
return {
|
|
6973
7013
|
id: "mention",
|
|
6974
7014
|
triggerChar: "@",
|
|
6975
7015
|
enabled: e.enabled,
|
|
6976
7016
|
maxSuggestions: e.maxSuggestions ?? 8,
|
|
6977
|
-
getCandidates: (t) =>
|
|
7017
|
+
getCandidates: (t) => Ye(e.getMentionCandidates(), t, e.maxSuggestions ?? 8).map((e) => ({
|
|
6978
7018
|
id: e.uid,
|
|
6979
7019
|
label: e.displayName,
|
|
6980
7020
|
avatar: e.avatar
|
|
@@ -6985,7 +7025,7 @@ function Ku(e) {
|
|
|
6985
7025
|
}
|
|
6986
7026
|
};
|
|
6987
7027
|
}
|
|
6988
|
-
function
|
|
7028
|
+
function Zu(e) {
|
|
6989
7029
|
let t = w(null), r = w([]), i = w({
|
|
6990
7030
|
x: 0,
|
|
6991
7031
|
y: 0,
|
|
@@ -7018,7 +7058,7 @@ function qu(e) {
|
|
|
7018
7058
|
}
|
|
7019
7059
|
for (let i of e.getTriggers()) {
|
|
7020
7060
|
if (!i.enabled()) continue;
|
|
7021
|
-
let e =
|
|
7061
|
+
let e = Qu(n, i.triggerChar);
|
|
7022
7062
|
if (!e) continue;
|
|
7023
7063
|
let c = i.getCandidates(e.query).slice(0, i.maxSuggestions ?? 8);
|
|
7024
7064
|
if (!c.length) {
|
|
@@ -7063,7 +7103,7 @@ function qu(e) {
|
|
|
7063
7103
|
refreshActiveTrigger: c
|
|
7064
7104
|
};
|
|
7065
7105
|
}
|
|
7066
|
-
function
|
|
7106
|
+
function Qu(e, t) {
|
|
7067
7107
|
let n = window.getSelection();
|
|
7068
7108
|
if (!n || n.rangeCount === 0 || !n.isCollapsed) return null;
|
|
7069
7109
|
let r = n.getRangeAt(0);
|
|
@@ -7074,13 +7114,13 @@ function Ju(e, t) {
|
|
|
7074
7114
|
if (o === -1 || o > 0 && !/\s/.test(a[o - 1] ?? "")) return null;
|
|
7075
7115
|
let s = a.slice(o + 1);
|
|
7076
7116
|
if (/\s/.test(s)) return null;
|
|
7077
|
-
let c =
|
|
7117
|
+
let c = ed(e, o, a.length) ?? $u(r, t);
|
|
7078
7118
|
return c ? {
|
|
7079
7119
|
query: s,
|
|
7080
7120
|
range: c
|
|
7081
7121
|
} : null;
|
|
7082
7122
|
}
|
|
7083
|
-
function
|
|
7123
|
+
function $u(e, t) {
|
|
7084
7124
|
let n = e.endContainer;
|
|
7085
7125
|
n.nodeType !== Node.TEXT_NODE && (n = e.endContainer.childNodes[e.endOffset - 1] ?? e.endContainer.childNodes[0] ?? null);
|
|
7086
7126
|
for (let r = 0; r < 4 && n; r += 1) {
|
|
@@ -7096,7 +7136,7 @@ function Yu(e, t) {
|
|
|
7096
7136
|
}
|
|
7097
7137
|
return null;
|
|
7098
7138
|
}
|
|
7099
|
-
function
|
|
7139
|
+
function ed(e, t, n) {
|
|
7100
7140
|
let r = document.createTreeWalker(e, NodeFilter.SHOW_TEXT), i = 0, a = null, o = 0, s = null, c = 0;
|
|
7101
7141
|
for (let e = r.nextNode(); e; e = r.nextNode()) {
|
|
7102
7142
|
let r = e.textContent?.length ?? 0, l = i + r;
|
|
@@ -7110,7 +7150,7 @@ function Xu(e, t, n) {
|
|
|
7110
7150
|
let l = document.createRange();
|
|
7111
7151
|
return l.setStart(a, o), l.setEnd(s, c), l;
|
|
7112
7152
|
}
|
|
7113
|
-
function
|
|
7153
|
+
function td(e, t) {
|
|
7114
7154
|
e.deleteContents();
|
|
7115
7155
|
let n = document.createElement("span");
|
|
7116
7156
|
n.className = "composer-mention", n.setAttribute("data-mention-uid", t.uid), n.contentEditable = "false", n.textContent = `@${t.displayName}`;
|
|
@@ -7121,20 +7161,20 @@ function Zu(e, t) {
|
|
|
7121
7161
|
}
|
|
7122
7162
|
//#endregion
|
|
7123
7163
|
//#region src/composables/useRichTextComposer.ts
|
|
7124
|
-
function
|
|
7164
|
+
function nd(e, t, r, i) {
|
|
7125
7165
|
let a = w(null), o = w(0), s = w(!1), c = w({
|
|
7126
7166
|
x: 0,
|
|
7127
7167
|
y: 0
|
|
7128
7168
|
}), l = w(qo(i.getModelValue())), u = n(() => {
|
|
7129
7169
|
let e = [...i.extraTriggers ?? []];
|
|
7130
|
-
return i.getMentionCandidates && e.unshift(
|
|
7170
|
+
return i.getMentionCandidates && e.unshift(Xu({
|
|
7131
7171
|
enabled: () => i.mentionsEnabled?.() ?? !0,
|
|
7132
7172
|
getMentionCandidates: () => i.getMentionCandidates?.() ?? [],
|
|
7133
7173
|
insertMention: (e, t) => {
|
|
7134
|
-
|
|
7174
|
+
td(t, e), E(), D();
|
|
7135
7175
|
}
|
|
7136
7176
|
})), e;
|
|
7137
|
-
}), { triggerCandidates: d, triggerMenuPosition: f, highlightedTriggerIndex: p, showTriggerMenu: m, hideTriggerMenu: g, handleInput: _, handleKeydown: v, selectTriggerCandidate: x, refreshActiveTrigger: S } =
|
|
7177
|
+
}), { triggerCandidates: d, triggerMenuPosition: f, highlightedTriggerIndex: p, showTriggerMenu: m, hideTriggerMenu: g, handleInput: _, handleKeydown: v, selectTriggerCandidate: x, refreshActiveTrigger: S } = Zu({
|
|
7138
7178
|
editorRef: t,
|
|
7139
7179
|
getTriggers: () => u.value,
|
|
7140
7180
|
onChange: () => E()
|
|
@@ -7144,7 +7184,7 @@ function Qu(e, t, r, i) {
|
|
|
7144
7184
|
}, { deep: !0 });
|
|
7145
7185
|
function C(e) {
|
|
7146
7186
|
let t = qo(e);
|
|
7147
|
-
return t.includes("<@uid:") ? qo(
|
|
7187
|
+
return t.includes("<@uid:") ? qo(nt(t, i.getMentionNameByUid?.() ?? {})) : t;
|
|
7148
7188
|
}
|
|
7149
7189
|
F(() => i.getModelValue(), (e) => {
|
|
7150
7190
|
let n = t.value, r = C(e);
|
|
@@ -7273,11 +7313,11 @@ function Qu(e, t, r, i) {
|
|
|
7273
7313
|
}
|
|
7274
7314
|
//#endregion
|
|
7275
7315
|
//#region src/components/messages/ComposerActionsPopover.vue?vue&type=script&setup=true&lang.ts
|
|
7276
|
-
var
|
|
7316
|
+
var rd = ["data-testid", "onClick"], id = { class: "composer-actions-menu__icon" }, ad = { class: "composer-actions-menu__icon" }, od = /* @__PURE__ */ u({
|
|
7277
7317
|
__name: "ComposerActionsPopover",
|
|
7278
7318
|
emits: ["pickFile", "openPoll"],
|
|
7279
7319
|
setup(t, { expose: n, emit: i }) {
|
|
7280
|
-
let s = i, c = w(!1), l = w(null), { t: u } =
|
|
7320
|
+
let s = i, c = w(!1), l = w(null), { t: u } = q(), d = typeof navigator < "u" && (/iPad|iPhone|iPod/.test(navigator.userAgent) || navigator.platform === "MacIntel" && navigator.maxTouchPoints > 1), f = [
|
|
7281
7321
|
{
|
|
7282
7322
|
kind: "image",
|
|
7283
7323
|
label: "attachImage",
|
|
@@ -7338,18 +7378,18 @@ var $u = ["data-testid", "onClick"], ed = { class: "composer-actions-menu__icon"
|
|
|
7338
7378
|
class: "composer-actions-menu__item",
|
|
7339
7379
|
"data-testid": e.testId,
|
|
7340
7380
|
onClick: (t) => h(e.kind)
|
|
7341
|
-
}, [o("span",
|
|
7381
|
+
}, [o("span", id, [(S(), r(D(e.icon), { class: "size-5" }))]), o("span", null, k(j(u)(e.label)), 1)], 8, rd)), 64)), o("button", {
|
|
7342
7382
|
type: "button",
|
|
7343
7383
|
class: "composer-actions-menu__item",
|
|
7344
7384
|
"data-testid": "composer-create-poll",
|
|
7345
7385
|
onClick: g
|
|
7346
|
-
}, [o("span",
|
|
7386
|
+
}, [o("span", ad, [(S(), r(D(j(_u)), { class: "size-5" }))]), o("span", null, k(j(u)("createPoll")), 1)])], 512)), [[P, c.value]]);
|
|
7347
7387
|
}
|
|
7348
|
-
}),
|
|
7388
|
+
}), sd = (e, t) => {
|
|
7349
7389
|
let n = e.__vccOpts || e;
|
|
7350
7390
|
for (let [e, r] of t) n[e] = r;
|
|
7351
7391
|
return n;
|
|
7352
|
-
},
|
|
7392
|
+
}, cd = /* @__PURE__ */ sd(od, [["__scopeId", "data-v-28efbfda"]]), ld = { class: "min-w-0" }, ud = { class: "context-banner__kind" }, dd = { class: "context-banner__sender" }, fd = { class: "context-banner__preview" }, pd = /* @__PURE__ */ sd(/* @__PURE__ */ u({
|
|
7353
7393
|
__name: "ComposerContextBanner",
|
|
7354
7394
|
props: {
|
|
7355
7395
|
message: {},
|
|
@@ -7358,11 +7398,11 @@ var $u = ["data-testid", "onClick"], ed = { class: "composer-actions-menu__icon"
|
|
|
7358
7398
|
},
|
|
7359
7399
|
emits: ["cancel"],
|
|
7360
7400
|
setup(e, { emit: t }) {
|
|
7361
|
-
let r = e, i = t, { t: s } =
|
|
7362
|
-
return (t, n) => (S(), a("div", { class: g(["context-banner", `context-banner--${e.variant}`]) }, [o("div",
|
|
7363
|
-
o("p",
|
|
7364
|
-
o("p",
|
|
7365
|
-
o("p",
|
|
7401
|
+
let r = e, i = t, { t: s } = q(), c = Kl(), u = n(() => ds(r.message, s("message"), c.mentionNameByUid.value));
|
|
7402
|
+
return (t, n) => (S(), a("div", { class: g(["context-banner", `context-banner--${e.variant}`]) }, [o("div", ld, [
|
|
7403
|
+
o("p", ud, k(e.variant === "editing" ? j(s)("editingInContext", { context: e.contextLabel }) : j(s)("replyingInContext", { context: e.contextLabel })), 1),
|
|
7404
|
+
o("p", dd, k(e.message.senderName), 1),
|
|
7405
|
+
o("p", fd, k(u.value), 1)
|
|
7366
7406
|
]), l(j(z), {
|
|
7367
7407
|
icon: j(bu),
|
|
7368
7408
|
text: "",
|
|
@@ -7371,7 +7411,7 @@ var $u = ["data-testid", "onClick"], ed = { class: "composer-actions-menu__icon"
|
|
|
7371
7411
|
onClick: n[0] ||= (e) => i("cancel")
|
|
7372
7412
|
}, null, 8, ["icon"])], 2));
|
|
7373
7413
|
}
|
|
7374
|
-
}), [["__scopeId", "data-v-
|
|
7414
|
+
}), [["__scopeId", "data-v-f496c16b"]]), md = /* @__PURE__ */ sd(/* @__PURE__ */ u({
|
|
7375
7415
|
__name: "ComposerFormatMenu",
|
|
7376
7416
|
props: {
|
|
7377
7417
|
visible: { type: Boolean },
|
|
@@ -7379,7 +7419,7 @@ var $u = ["data-testid", "onClick"], ed = { class: "composer-actions-menu__icon"
|
|
|
7379
7419
|
},
|
|
7380
7420
|
emits: ["format"],
|
|
7381
7421
|
setup(e, { emit: t }) {
|
|
7382
|
-
let n = t, { t: r } =
|
|
7422
|
+
let n = t, { t: r } = q();
|
|
7383
7423
|
return (t, s) => e.visible ? (S(), a("div", {
|
|
7384
7424
|
key: 0,
|
|
7385
7425
|
class: "format-menu",
|
|
@@ -7408,7 +7448,7 @@ var $u = ["data-testid", "onClick"], ed = { class: "composer-actions-menu__icon"
|
|
|
7408
7448
|
}, [s[8] ||= o("span", { class: "format-menu__icon underline" }, "U", -1), o("span", null, k(j(r)("underline")), 1)], 32)
|
|
7409
7449
|
], 4)) : i("", !0);
|
|
7410
7450
|
}
|
|
7411
|
-
}), [["__scopeId", "data-v-c9a1b3d8"]]),
|
|
7451
|
+
}), [["__scopeId", "data-v-c9a1b3d8"]]), hd = { class: "space-y-6" }, gd = { class: "space-y-2" }, _d = { class: "heading-sm text-subtle block font-medium!" }, vd = { class: "space-y-2" }, yd = { class: "heading-sm text-subtle block font-medium!" }, bd = /* @__PURE__ */ u({
|
|
7412
7452
|
__name: "ComposerPollDialog",
|
|
7413
7453
|
props: {
|
|
7414
7454
|
visible: { type: Boolean },
|
|
@@ -7416,7 +7456,7 @@ var $u = ["data-testid", "onClick"], ed = { class: "composer-actions-menu__icon"
|
|
|
7416
7456
|
},
|
|
7417
7457
|
emits: ["update:visible", "send"],
|
|
7418
7458
|
setup(t, { expose: i, emit: s }) {
|
|
7419
|
-
let c = t, u = s, { t: d } =
|
|
7459
|
+
let c = t, u = s, { t: d } = q(), f = w(""), p = w(["", ""]), m = n(() => {
|
|
7420
7460
|
let e = f.value.trim(), t = p.value.map((e) => e.trim()).filter(Boolean);
|
|
7421
7461
|
return !!e && t.length >= 2;
|
|
7422
7462
|
});
|
|
@@ -7460,13 +7500,13 @@ var $u = ["data-testid", "onClick"], ed = { class: "composer-actions-menu__icon"
|
|
|
7460
7500
|
"icon",
|
|
7461
7501
|
"disabled"
|
|
7462
7502
|
])]),
|
|
7463
|
-
default: I(() => [o("div",
|
|
7503
|
+
default: I(() => [o("div", hd, [o("div", gd, [o("label", _d, k(j(d)("question")), 1), l(j(ie), {
|
|
7464
7504
|
modelValue: f.value,
|
|
7465
7505
|
"onUpdate:modelValue": i[0] ||= (e) => f.value = e,
|
|
7466
7506
|
fluid: "",
|
|
7467
7507
|
placeholder: j(d)("pollQuestionPlaceholder")
|
|
7468
|
-
}, null, 8, ["modelValue", "placeholder"])]), o("div",
|
|
7469
|
-
o("label",
|
|
7508
|
+
}, null, 8, ["modelValue", "placeholder"])]), o("div", vd, [
|
|
7509
|
+
o("label", yd, k(j(d)("options")), 1),
|
|
7470
7510
|
(S(!0), a(e, null, T(p.value, (e, t) => (S(), a("div", {
|
|
7471
7511
|
key: t,
|
|
7472
7512
|
class: "center"
|
|
@@ -7501,7 +7541,7 @@ var $u = ["data-testid", "onClick"], ed = { class: "composer-actions-menu__icon"
|
|
|
7501
7541
|
_: 1
|
|
7502
7542
|
}, 8, ["visible", "header"]));
|
|
7503
7543
|
}
|
|
7504
|
-
}),
|
|
7544
|
+
}), xd = { class: "w-full space-y-6" }, Sd = { class: "w-full space-y-2" }, Cd = { class: "heading-sm text-subtle block font-medium!" }, wd = { class: "center left w-full gap-2" }, Td = { class: "body-md bg-elevation-surface-sunken-default rounded-lg px-4 py-3" }, Ed = /* @__PURE__ */ u({
|
|
7505
7545
|
__name: "ComposerScheduleDialog",
|
|
7506
7546
|
props: {
|
|
7507
7547
|
visible: { type: Boolean },
|
|
@@ -7511,7 +7551,7 @@ var $u = ["data-testid", "onClick"], ed = { class: "composer-actions-menu__icon"
|
|
|
7511
7551
|
},
|
|
7512
7552
|
emits: ["update:visible", "schedule"],
|
|
7513
7553
|
setup(e, { expose: t, emit: i }) {
|
|
7514
|
-
let a = e, s = i, { t: c } =
|
|
7554
|
+
let a = e, s = i, { t: c } = q(), u = w(p()), d = w(m());
|
|
7515
7555
|
function f() {
|
|
7516
7556
|
return new Date(Date.now() + 3600 * 1e3);
|
|
7517
7557
|
}
|
|
@@ -7559,7 +7599,7 @@ var $u = ["data-testid", "onClick"], ed = { class: "composer-actions-menu__icon"
|
|
|
7559
7599
|
"icon",
|
|
7560
7600
|
"disabled"
|
|
7561
7601
|
])]),
|
|
7562
|
-
default: I(() => [o("div",
|
|
7602
|
+
default: I(() => [o("div", xd, [o("div", Sd, [o("label", Cd, k(j(c)("sendAt")), 1), o("div", wd, [l(j(re), {
|
|
7563
7603
|
modelValue: u.value,
|
|
7564
7604
|
"onUpdate:modelValue": n[0] ||= (e) => u.value = e,
|
|
7565
7605
|
class: "w-full flex-1",
|
|
@@ -7573,22 +7613,22 @@ var $u = ["data-testid", "onClick"], ed = { class: "composer-actions-menu__icon"
|
|
|
7573
7613
|
mask: "##:##",
|
|
7574
7614
|
pattern: "^([01]\\d|2[0-3]):([0-5]\\d)$",
|
|
7575
7615
|
"aria-label": "Time (24-hour)"
|
|
7576
|
-
}, null, 8, ["modelValue"])])]), o("div",
|
|
7616
|
+
}, null, 8, ["modelValue"])])]), o("div", Td, k(e.contentPreview), 1)])]),
|
|
7577
7617
|
_: 1
|
|
7578
7618
|
}, 8, ["visible", "header"]));
|
|
7579
7619
|
}
|
|
7580
|
-
}),
|
|
7620
|
+
}), Dd = [
|
|
7581
7621
|
"aria-selected",
|
|
7582
7622
|
"onMouseover",
|
|
7583
7623
|
"onMousedown"
|
|
7584
|
-
],
|
|
7624
|
+
], Od = {
|
|
7585
7625
|
key: 1,
|
|
7586
7626
|
class: "trigger-menu__avatar-fallback",
|
|
7587
7627
|
"aria-hidden": "true"
|
|
7588
|
-
},
|
|
7628
|
+
}, kd = { class: "min-w-0" }, Ad = { class: "trigger-menu__label" }, jd = {
|
|
7589
7629
|
key: 0,
|
|
7590
7630
|
class: "trigger-menu__subtitle"
|
|
7591
|
-
},
|
|
7631
|
+
}, Md = /* @__PURE__ */ sd(/* @__PURE__ */ u({
|
|
7592
7632
|
__name: "ComposerTriggerMenu",
|
|
7593
7633
|
props: /* @__PURE__ */ m({
|
|
7594
7634
|
visible: { type: Boolean },
|
|
@@ -7623,27 +7663,27 @@ var $u = ["data-testid", "onClick"], ed = { class: "composer-actions-menu__icon"
|
|
|
7623
7663
|
src: e.avatar,
|
|
7624
7664
|
name: e.label,
|
|
7625
7665
|
size: "sm"
|
|
7626
|
-
}, null, 8, ["src", "name"])) : (S(), a("span",
|
|
7666
|
+
}, null, 8, ["src", "name"])) : (S(), a("span", Od, k(e.label.charAt(0)), 1)), o("span", kd, [o("span", Ad, k(e.label), 1), e.subtitle ? (S(), a("span", jd, k(e.subtitle), 1)) : i("", !0)])], 42, Dd))), 128))], 38)) : i("", !0);
|
|
7627
7667
|
}
|
|
7628
|
-
}), [["__scopeId", "data-v-3f395457"]]),
|
|
7668
|
+
}), [["__scopeId", "data-v-3f395457"]]), Nd = ["accept", "disabled"], Pd = {
|
|
7629
7669
|
key: 2,
|
|
7630
7670
|
class: "composer-file-preview"
|
|
7631
|
-
},
|
|
7671
|
+
}, Fd = { class: "min-w-0" }, Id = { class: "heading-sm text-default truncate" }, Ld = { class: "body-sm text-subtle" }, Rd = {
|
|
7632
7672
|
class: "composer-button-icon",
|
|
7633
7673
|
"aria-hidden": "true"
|
|
7634
|
-
},
|
|
7674
|
+
}, zd = ["data-placeholder"], Bd = {
|
|
7635
7675
|
key: 0,
|
|
7636
7676
|
class: "body-sm text-subtle flex items-center gap-2 px-0.5"
|
|
7637
|
-
},
|
|
7677
|
+
}, Vd = {
|
|
7638
7678
|
key: 2,
|
|
7639
7679
|
class: "ml-auto"
|
|
7640
|
-
},
|
|
7680
|
+
}, Hd = {
|
|
7641
7681
|
class: "composer-button-icon",
|
|
7642
7682
|
"aria-hidden": "true"
|
|
7643
|
-
},
|
|
7683
|
+
}, Ud = {
|
|
7644
7684
|
class: "composer-button-icon",
|
|
7645
7685
|
"aria-hidden": "true"
|
|
7646
|
-
},
|
|
7686
|
+
}, Wd = 450, Gd = /* @__PURE__ */ sd(/* @__PURE__ */ u({
|
|
7647
7687
|
__name: "MessageComposer",
|
|
7648
7688
|
props: {
|
|
7649
7689
|
modelValue: {},
|
|
@@ -7676,10 +7716,10 @@ var $u = ["data-testid", "onClick"], ed = { class: "composer-actions-menu__icon"
|
|
|
7676
7716
|
video: "video/*",
|
|
7677
7717
|
audio: "audio/*",
|
|
7678
7718
|
file: "*/*"
|
|
7679
|
-
}, u = e, d = s, f = w(null), m = w(null), _ = w(null), v = w("file"), y = w(!1), b = w(!1), x = w(!1), { t: C } =
|
|
7719
|
+
}, u = e, d = s, f = w(null), m = w(null), _ = w(null), v = w("file"), y = w(!1), b = w(!1), x = w(!1), { t: C } = q(), T = null, E = w(null), O = w(null), A = w(null), { applyFormat: M, editorKey: ee, formatMenuPosition: N, focusEditor: P, handleContextMenu: te, handleInput: R, handleKeydown: ne, handlePaste: B, hideFormatMenu: re, resetEditor: ie, showFormatMenu: V, triggerCandidates: ae, triggerMenuPosition: H, highlightedTriggerIndex: U, showTriggerMenu: se, selectTriggerCandidate: ce } = nd(E, O, A, {
|
|
7680
7720
|
getModelValue: () => u.modelValue,
|
|
7681
7721
|
updateModelValue: (e) => d("update:modelValue", e),
|
|
7682
|
-
submit: () =>
|
|
7722
|
+
submit: () => Se(),
|
|
7683
7723
|
getMentionCandidates: () => u.mentionCandidates ?? [],
|
|
7684
7724
|
getMentionNameByUid: () => u.mentionNameByUid ?? {},
|
|
7685
7725
|
mentionsEnabled: () => u.mentionsEnabled ?? (u.mentionCandidates?.length ?? 0) > 0
|
|
@@ -7715,13 +7755,22 @@ var $u = ["data-testid", "onClick"], ed = { class: "composer-actions-menu__icon"
|
|
|
7715
7755
|
function ve(e) {
|
|
7716
7756
|
_.value = e.target.files?.[0] ?? null, ge();
|
|
7717
7757
|
}
|
|
7718
|
-
function ye() {
|
|
7758
|
+
function ye(e) {
|
|
7759
|
+
if (u.disabled) return;
|
|
7760
|
+
let t = Yu(e);
|
|
7761
|
+
if (t) {
|
|
7762
|
+
e.preventDefault(), _.value = t, ge();
|
|
7763
|
+
return;
|
|
7764
|
+
}
|
|
7765
|
+
B(e);
|
|
7766
|
+
}
|
|
7767
|
+
function be() {
|
|
7719
7768
|
_.value = null, f.value && (f.value.value = "");
|
|
7720
7769
|
}
|
|
7721
|
-
function
|
|
7770
|
+
function xe(e) {
|
|
7722
7771
|
m.value?.toggle(e);
|
|
7723
7772
|
}
|
|
7724
|
-
function
|
|
7773
|
+
function Se() {
|
|
7725
7774
|
if (!(u.disabled || !fe.value)) {
|
|
7726
7775
|
if (_.value) {
|
|
7727
7776
|
d("sendAttachment", {
|
|
@@ -7733,10 +7782,10 @@ var $u = ["data-testid", "onClick"], ed = { class: "composer-actions-menu__icon"
|
|
|
7733
7782
|
d("sendText");
|
|
7734
7783
|
}
|
|
7735
7784
|
}
|
|
7736
|
-
function
|
|
7785
|
+
function Ce(e) {
|
|
7737
7786
|
d("sendPoll", e);
|
|
7738
7787
|
}
|
|
7739
|
-
function
|
|
7788
|
+
function we(e) {
|
|
7740
7789
|
d("scheduleMessage", {
|
|
7741
7790
|
...e,
|
|
7742
7791
|
text: _.value ? void 0 : cs(u.modelValue),
|
|
@@ -7744,19 +7793,19 @@ var $u = ["data-testid", "onClick"], ed = { class: "composer-actions-menu__icon"
|
|
|
7744
7793
|
caption: _.value ? cs(u.modelValue) : void 0
|
|
7745
7794
|
});
|
|
7746
7795
|
}
|
|
7747
|
-
function
|
|
7796
|
+
function Te() {
|
|
7748
7797
|
d("openScheduled");
|
|
7749
7798
|
}
|
|
7750
|
-
function
|
|
7799
|
+
function Ee() {
|
|
7751
7800
|
T !== null && (clearTimeout(T), T = null);
|
|
7752
7801
|
}
|
|
7753
|
-
function
|
|
7754
|
-
u.disabled || !pe.value || e instanceof MouseEvent && e.button !== 0 || (x.value = !1,
|
|
7802
|
+
function De(e) {
|
|
7803
|
+
u.disabled || !pe.value || e instanceof MouseEvent && e.button !== 0 || (x.value = !1, Ee(), T = setTimeout(() => {
|
|
7755
7804
|
T = null, x.value = !0, b.value = !0;
|
|
7756
|
-
},
|
|
7805
|
+
}, Wd));
|
|
7757
7806
|
}
|
|
7758
|
-
function
|
|
7759
|
-
|
|
7807
|
+
function G() {
|
|
7808
|
+
Ee();
|
|
7760
7809
|
}
|
|
7761
7810
|
function Oe() {
|
|
7762
7811
|
if (!(u.disabled || !fe.value)) {
|
|
@@ -7764,7 +7813,7 @@ var $u = ["data-testid", "onClick"], ed = { class: "composer-actions-menu__icon"
|
|
|
7764
7813
|
x.value = !1;
|
|
7765
7814
|
return;
|
|
7766
7815
|
}
|
|
7767
|
-
|
|
7816
|
+
Se();
|
|
7768
7817
|
}
|
|
7769
7818
|
}
|
|
7770
7819
|
return (t, n) => (S(), a("div", { class: g([u.compact ? "space-y-1 px-1 pb-1.5" : "space-y-1.5 px-1 pb-1.5", W.value]) }, [
|
|
@@ -7777,15 +7826,15 @@ var $u = ["data-testid", "onClick"], ed = { class: "composer-actions-menu__icon"
|
|
|
7777
7826
|
disabled: e.disabled,
|
|
7778
7827
|
onChange: ve,
|
|
7779
7828
|
onCancel: ge
|
|
7780
|
-
}, null, 40,
|
|
7781
|
-
e.editingMessage ? (S(), r(
|
|
7829
|
+
}, null, 40, Nd),
|
|
7830
|
+
e.editingMessage ? (S(), r(pd, {
|
|
7782
7831
|
key: 0,
|
|
7783
7832
|
message: e.editingMessage,
|
|
7784
7833
|
variant: "editing",
|
|
7785
7834
|
"context-label": e.contextLabel,
|
|
7786
7835
|
onCancel: n[0] ||= (e) => d("cancelEdit")
|
|
7787
7836
|
}, null, 8, ["message", "context-label"])) : i("", !0),
|
|
7788
|
-
e.replyToMessage ? (S(), r(
|
|
7837
|
+
e.replyToMessage ? (S(), r(pd, {
|
|
7789
7838
|
key: 1,
|
|
7790
7839
|
message: e.replyToMessage,
|
|
7791
7840
|
variant: "replying",
|
|
@@ -7793,19 +7842,19 @@ var $u = ["data-testid", "onClick"], ed = { class: "composer-actions-menu__icon"
|
|
|
7793
7842
|
"data-testid": "composer-reply-context",
|
|
7794
7843
|
onCancel: n[1] ||= (e) => d("cancelReply")
|
|
7795
7844
|
}, null, 8, ["message", "context-label"])) : i("", !0),
|
|
7796
|
-
_.value ? (S(), a("div",
|
|
7845
|
+
_.value ? (S(), a("div", Pd, [o("div", Fd, [o("p", Id, k(_.value.name), 1), o("p", Ld, k(_.value.type || de.value), 1)]), l(j(z), {
|
|
7797
7846
|
icon: j(bu),
|
|
7798
7847
|
text: "",
|
|
7799
7848
|
rounded: "",
|
|
7800
7849
|
severity: "secondary",
|
|
7801
|
-
onClick:
|
|
7850
|
+
onClick: be
|
|
7802
7851
|
}, null, 8, ["icon"])])) : i("", !0),
|
|
7803
7852
|
o("div", {
|
|
7804
7853
|
ref_key: "composerShellRef",
|
|
7805
7854
|
ref: E,
|
|
7806
7855
|
class: g(["composer-shell w-full", u.compact ? "composer-shell--compact" : "composer-shell--default"])
|
|
7807
7856
|
}, [
|
|
7808
|
-
l(
|
|
7857
|
+
l(cd, {
|
|
7809
7858
|
ref_key: "composerActionsRef",
|
|
7810
7859
|
ref: m,
|
|
7811
7860
|
onPickFile: _e,
|
|
@@ -7819,9 +7868,9 @@ var $u = ["data-testid", "onClick"], ed = { class: "composer-actions-menu__icon"
|
|
|
7819
7868
|
disabled: e.disabled || !!e.editingMessage,
|
|
7820
7869
|
"aria-label": j(C)("addToMessage"),
|
|
7821
7870
|
"data-testid": "composer-actions-button",
|
|
7822
|
-
onClick:
|
|
7871
|
+
onClick: xe
|
|
7823
7872
|
}, {
|
|
7824
|
-
default: I(() => [o("span",
|
|
7873
|
+
default: I(() => [o("span", Rd, [(S(), r(D(j(hu)), { class: "size-7" }))])]),
|
|
7825
7874
|
_: 1
|
|
7826
7875
|
}, 8, [
|
|
7827
7876
|
"class",
|
|
@@ -7841,10 +7890,10 @@ var $u = ["data-testid", "onClick"], ed = { class: "composer-actions-menu__icon"
|
|
|
7841
7890
|
onInput: n[4] ||= (...e) => j(R) && j(R)(...e),
|
|
7842
7891
|
onKeyup: n[5] ||= (...e) => j(R) && j(R)(...e),
|
|
7843
7892
|
onKeydown: n[6] ||= (...e) => j(ne) && j(ne)(...e),
|
|
7844
|
-
onPaste:
|
|
7845
|
-
onContextmenu: n[
|
|
7846
|
-
}, null, 42,
|
|
7847
|
-
_.value || e.editingMessage || e.contextLabel || e.offlineMode ? (S(), a("div",
|
|
7893
|
+
onPaste: ye,
|
|
7894
|
+
onContextmenu: n[7] ||= (...e) => j(te) && j(te)(...e)
|
|
7895
|
+
}, null, 42, zd)),
|
|
7896
|
+
_.value || e.editingMessage || e.contextLabel || e.offlineMode ? (S(), a("div", Bd, [
|
|
7848
7897
|
e.editingMessage ? (S(), r(j(oe), {
|
|
7849
7898
|
key: 0,
|
|
7850
7899
|
text: j(C)("editing"),
|
|
@@ -7861,7 +7910,7 @@ var $u = ["data-testid", "onClick"], ed = { class: "composer-actions-menu__icon"
|
|
|
7861
7910
|
size: "sm",
|
|
7862
7911
|
class: "composer-meta-tag"
|
|
7863
7912
|
}, null, 8, ["text"])) : i("", !0),
|
|
7864
|
-
e.offlineMode ? (S(), a("p",
|
|
7913
|
+
e.offlineMode ? (S(), a("p", Vd, k(e.pendingQueueCount ? j(C)("offlineQueued", { count: e.pendingQueueCount }) : j(C)("offline")), 1)) : i("", !0)
|
|
7865
7914
|
])) : i("", !0),
|
|
7866
7915
|
e.showScheduledButton ? (S(), r(j(z), {
|
|
7867
7916
|
key: 1,
|
|
@@ -7870,9 +7919,9 @@ var $u = ["data-testid", "onClick"], ed = { class: "composer-actions-menu__icon"
|
|
|
7870
7919
|
class: g(["composer-schedule-button shrink-0 self-end", u.compact ? "h-9 w-9" : "h-10 w-10 max-md:h-9 max-md:w-9"]),
|
|
7871
7920
|
disabled: e.disabled,
|
|
7872
7921
|
"aria-label": j(C)("scheduledMessages"),
|
|
7873
|
-
onClick:
|
|
7922
|
+
onClick: Te
|
|
7874
7923
|
}, {
|
|
7875
|
-
default: I(() => [o("span",
|
|
7924
|
+
default: I(() => [o("span", Hd, [(S(), r(D(j(Du)), { class: "size-7" }))])]),
|
|
7876
7925
|
_: 1
|
|
7877
7926
|
}, 8, [
|
|
7878
7927
|
"class",
|
|
@@ -7886,16 +7935,16 @@ var $u = ["data-testid", "onClick"], ed = { class: "composer-actions-menu__icon"
|
|
|
7886
7935
|
class: g(["composer-send-button shrink-0 self-end", u.compact ? "h-9 w-9" : "h-10 w-10 max-md:h-9 max-md:w-9"]),
|
|
7887
7936
|
disabled: e.disabled || !fe.value,
|
|
7888
7937
|
"aria-label": e.editingMessage ? j(C)("saveMessage") : _.value ? j(C)("sendAttachment") : j(C)("sendMessage"),
|
|
7889
|
-
onMousedown:
|
|
7890
|
-
onMouseup:
|
|
7891
|
-
onMouseleave:
|
|
7892
|
-
onTouchstart:
|
|
7893
|
-
onTouchend:
|
|
7894
|
-
onTouchcancel:
|
|
7895
|
-
onContextmenu: n[
|
|
7938
|
+
onMousedown: De,
|
|
7939
|
+
onMouseup: G,
|
|
7940
|
+
onMouseleave: G,
|
|
7941
|
+
onTouchstart: De,
|
|
7942
|
+
onTouchend: G,
|
|
7943
|
+
onTouchcancel: G,
|
|
7944
|
+
onContextmenu: n[8] ||= L(() => {}, ["prevent"]),
|
|
7896
7945
|
onClick: Oe
|
|
7897
7946
|
}, {
|
|
7898
|
-
default: I(() => [o("span",
|
|
7947
|
+
default: I(() => [o("span", Ud, [e.editingMessage ? (S(), r(D(j(yu)), {
|
|
7899
7948
|
key: 0,
|
|
7900
7949
|
class: "size-7"
|
|
7901
7950
|
})) : (S(), r(D(j(Vu)), {
|
|
@@ -7909,39 +7958,39 @@ var $u = ["data-testid", "onClick"], ed = { class: "composer-actions-menu__icon"
|
|
|
7909
7958
|
"aria-label"
|
|
7910
7959
|
])
|
|
7911
7960
|
], 2),
|
|
7912
|
-
l(
|
|
7961
|
+
l(md, {
|
|
7913
7962
|
visible: j(V),
|
|
7914
7963
|
position: j(N),
|
|
7915
|
-
onFormat: n[
|
|
7964
|
+
onFormat: n[9] ||= (e) => j(M)(e)
|
|
7916
7965
|
}, null, 8, ["visible", "position"]),
|
|
7917
|
-
l(
|
|
7966
|
+
l(Md, {
|
|
7918
7967
|
ref_key: "triggerMenuRef",
|
|
7919
7968
|
ref: A,
|
|
7920
7969
|
"highlighted-index": j(U),
|
|
7921
|
-
"onUpdate:highlightedIndex": n[
|
|
7970
|
+
"onUpdate:highlightedIndex": n[10] ||= (e) => p(U) ? U.value = e : null,
|
|
7922
7971
|
visible: j(se),
|
|
7923
7972
|
position: j(H),
|
|
7924
7973
|
candidates: j(ae),
|
|
7925
|
-
onSelect: n[
|
|
7974
|
+
onSelect: n[11] ||= (e) => j(ce)(e)
|
|
7926
7975
|
}, null, 8, [
|
|
7927
7976
|
"highlighted-index",
|
|
7928
7977
|
"visible",
|
|
7929
7978
|
"position",
|
|
7930
7979
|
"candidates"
|
|
7931
7980
|
]),
|
|
7932
|
-
l(
|
|
7981
|
+
l(bd, {
|
|
7933
7982
|
visible: y.value,
|
|
7934
|
-
"onUpdate:visible": n[
|
|
7983
|
+
"onUpdate:visible": n[12] ||= (e) => y.value = e,
|
|
7935
7984
|
disabled: e.disabled,
|
|
7936
|
-
onSend:
|
|
7985
|
+
onSend: Ce
|
|
7937
7986
|
}, null, 8, ["visible", "disabled"]),
|
|
7938
|
-
l(
|
|
7987
|
+
l(Ed, {
|
|
7939
7988
|
visible: b.value,
|
|
7940
|
-
"onUpdate:visible": n[
|
|
7989
|
+
"onUpdate:visible": n[13] ||= (e) => b.value = e,
|
|
7941
7990
|
disabled: e.disabled,
|
|
7942
7991
|
"can-schedule": pe.value,
|
|
7943
7992
|
"content-preview": me.value,
|
|
7944
|
-
onSchedule:
|
|
7993
|
+
onSchedule: we
|
|
7945
7994
|
}, null, 8, [
|
|
7946
7995
|
"visible",
|
|
7947
7996
|
"disabled",
|
|
@@ -7950,14 +7999,14 @@ var $u = ["data-testid", "onClick"], ed = { class: "composer-actions-menu__icon"
|
|
|
7950
7999
|
])
|
|
7951
8000
|
], 2));
|
|
7952
8001
|
}
|
|
7953
|
-
}), [["__scopeId", "data-v-
|
|
8002
|
+
}), [["__scopeId", "data-v-cf9e887c"]]), Kd = {
|
|
7954
8003
|
key: 1,
|
|
7955
8004
|
class: "composer-readonly-notice"
|
|
7956
|
-
},
|
|
8005
|
+
}, qd = /* @__PURE__ */ sd(/* @__PURE__ */ u({
|
|
7957
8006
|
__name: "ConversationComposer",
|
|
7958
8007
|
props: { target: {} },
|
|
7959
8008
|
setup(e, { expose: t }) {
|
|
7960
|
-
let o = e, { t: s } =
|
|
8009
|
+
let o = e, { t: s } = q(), c = Kl(), l = Xl(), u = tu(), d = ou(), f = du(), p = n(() => o.target === "thread"), m = n({
|
|
7961
8010
|
get: () => p.value ? u.threadDraft.value : u.draft.value,
|
|
7962
8011
|
set: (e) => {
|
|
7963
8012
|
p.value ? u.threadDraft.value = e : u.draft.value = e;
|
|
@@ -8003,7 +8052,7 @@ var $u = ["data-testid", "onClick"], ed = { class: "composer-actions-menu__icon"
|
|
|
8003
8052
|
async function ee() {
|
|
8004
8053
|
await M.value?.focusEditor();
|
|
8005
8054
|
}
|
|
8006
|
-
return t({ focusEditor: ee }), (e, t) => y.value ? (S(), r(
|
|
8055
|
+
return t({ focusEditor: ee }), (e, t) => y.value ? (S(), r(Gd, {
|
|
8007
8056
|
key: 0,
|
|
8008
8057
|
ref_key: "composerRef",
|
|
8009
8058
|
ref: M,
|
|
@@ -8040,10 +8089,10 @@ var $u = ["data-testid", "onClick"], ed = { class: "composer-actions-menu__icon"
|
|
|
8040
8089
|
"mention-candidates",
|
|
8041
8090
|
"mention-name-by-uid",
|
|
8042
8091
|
"mentions-enabled"
|
|
8043
|
-
])) : b.value ? (S(), a("div",
|
|
8092
|
+
])) : b.value ? (S(), a("div", Kd, k(p.value ? j(s)("repliesDisabledInChannels") : j(s)("readOnlyChannel")), 1)) : i("", !0);
|
|
8044
8093
|
}
|
|
8045
|
-
}), [["__scopeId", "data-v-84a9e2b1"]]),
|
|
8046
|
-
function
|
|
8094
|
+
}), [["__scopeId", "data-v-84a9e2b1"]]), Jd = 1800;
|
|
8095
|
+
function Yd(e) {
|
|
8047
8096
|
let t = e.actionMenuRef, n = w(null), r = w(null), i = typeof window < "u" && window.matchMedia("(hover: hover) and (pointer: fine)").matches, a = null;
|
|
8048
8097
|
function o(e) {
|
|
8049
8098
|
return e.kind === "text" && ls(e.text);
|
|
@@ -8144,7 +8193,7 @@ function Gd(e) {
|
|
|
8144
8193
|
}
|
|
8145
8194
|
r.value = e.id, a && clearTimeout(a), a = setTimeout(() => {
|
|
8146
8195
|
r.value = null;
|
|
8147
|
-
},
|
|
8196
|
+
}, Jd), v();
|
|
8148
8197
|
}
|
|
8149
8198
|
function C(t) {
|
|
8150
8199
|
e.canReply() && (e.emit.reply(t), v());
|
|
@@ -8233,8 +8282,8 @@ function Gd(e) {
|
|
|
8233
8282
|
}
|
|
8234
8283
|
//#endregion
|
|
8235
8284
|
//#region src/composables/useMessageListScroll.ts
|
|
8236
|
-
var
|
|
8237
|
-
function
|
|
8285
|
+
var Xd = 1, Zd = 2, Qd = 80, $d = 1800, ef = 4;
|
|
8286
|
+
function tf(e) {
|
|
8238
8287
|
let t = e.threadRef, n = !0, r = 0, i = null, a = null, o = null, s = null;
|
|
8239
8288
|
function c() {
|
|
8240
8289
|
o != null && (cancelAnimationFrame(o), o = null);
|
|
@@ -8276,7 +8325,7 @@ function Zd(e) {
|
|
|
8276
8325
|
resizeObserver: o,
|
|
8277
8326
|
timeoutId: setTimeout(() => {
|
|
8278
8327
|
f();
|
|
8279
|
-
},
|
|
8328
|
+
}, $d)
|
|
8280
8329
|
}, a(), o.observe(e);
|
|
8281
8330
|
}
|
|
8282
8331
|
function m() {
|
|
@@ -8287,9 +8336,9 @@ function Zd(e) {
|
|
|
8287
8336
|
let a = t.value;
|
|
8288
8337
|
if (!a) return;
|
|
8289
8338
|
let o = a.scrollTop;
|
|
8290
|
-
i?.el === a && Math.abs(o - i.expectedScrollTop) >
|
|
8339
|
+
i?.el === a && Math.abs(o - i.expectedScrollTop) > ef && f();
|
|
8291
8340
|
let s = o < r, c = Math.max(0, a.scrollHeight - o - a.clientHeight);
|
|
8292
|
-
s && c >
|
|
8341
|
+
s && c > Xd ? n = !1 : c <= Zd && (n = !0), r = o, a.scrollTop <= Qd && !e.isLoading() && !e.isLoadingOlder() && e.canLoadOlder() && e.onLoadOlder();
|
|
8293
8342
|
}
|
|
8294
8343
|
return F(() => {
|
|
8295
8344
|
let t = e.getMessages();
|
|
@@ -8317,14 +8366,14 @@ function Zd(e) {
|
|
|
8317
8366
|
}
|
|
8318
8367
|
//#endregion
|
|
8319
8368
|
//#region src/composables/useImageZoom.ts
|
|
8320
|
-
var
|
|
8321
|
-
function
|
|
8369
|
+
var nf = 1, rf = 4;
|
|
8370
|
+
function af(e) {
|
|
8322
8371
|
let t = w(1), n = w(0), r = w(0), i = w(!1), a = /* @__PURE__ */ new Map(), o = null, s = 0, c = 0, l = 0, u = 0, d = 0, f = 1, p = 0, m = 0;
|
|
8323
8372
|
function h(e, t, n) {
|
|
8324
8373
|
return Math.min(Math.max(e, t), n);
|
|
8325
8374
|
}
|
|
8326
8375
|
function g(e) {
|
|
8327
|
-
return h(e,
|
|
8376
|
+
return h(e, nf, rf);
|
|
8328
8377
|
}
|
|
8329
8378
|
function _(n, r, i = t.value) {
|
|
8330
8379
|
let a = e.viewportRef.value?.clientWidth ?? 0, o = e.viewportRef.value?.clientHeight ?? 0, s = e.imageRef.value?.clientWidth ?? a, c = e.imageRef.value?.clientHeight ?? o, l = s * i, u = c * i, d = Math.max(0, (l - a) / 2), f = Math.max(0, (u - o) / 2);
|
|
@@ -8414,10 +8463,10 @@ function ef(e) {
|
|
|
8414
8463
|
}
|
|
8415
8464
|
//#endregion
|
|
8416
8465
|
//#region src/components/overlays/FullscreenDialog.vue?vue&type=script&setup=true&lang.ts
|
|
8417
|
-
var
|
|
8466
|
+
var of = { class: "w-full" }, sf = {
|
|
8418
8467
|
key: 0,
|
|
8419
8468
|
class: "fullscreen-dialog__footer"
|
|
8420
|
-
},
|
|
8469
|
+
}, cf = /* @__PURE__ */ u({
|
|
8421
8470
|
__name: "FullscreenDialog",
|
|
8422
8471
|
props: {
|
|
8423
8472
|
open: { type: Boolean },
|
|
@@ -8442,34 +8491,34 @@ var tf = { class: "w-full" }, nf = {
|
|
|
8442
8491
|
closable: !0,
|
|
8443
8492
|
"onUpdate:visible": s
|
|
8444
8493
|
}, {
|
|
8445
|
-
default: I(() => [o("div",
|
|
8494
|
+
default: I(() => [o("div", of, [E(t.$slots, "default")]), t.$slots.footer ? (S(), a("div", sf, [E(t.$slots, "footer")])) : i("", !0)]),
|
|
8446
8495
|
_: 3
|
|
8447
8496
|
}, 8, ["visible", "header"]));
|
|
8448
8497
|
}
|
|
8449
|
-
}),
|
|
8498
|
+
}), lf = ["href"], uf = { class: "media-viewer-shell flex min-h-0 flex-1 items-center justify-center overflow-hidden" }, df = ["src", "alt"], ff = {
|
|
8450
8499
|
key: 1,
|
|
8451
8500
|
class: "media-viewer-stage media-viewer-stage-video flex w-full items-center justify-center"
|
|
8452
|
-
},
|
|
8501
|
+
}, pf = {
|
|
8453
8502
|
class: "max-h-full w-full bg-black",
|
|
8454
8503
|
controls: "",
|
|
8455
8504
|
playsinline: "",
|
|
8456
8505
|
autoplay: ""
|
|
8457
|
-
},
|
|
8506
|
+
}, mf = ["src", "type"], hf = {
|
|
8458
8507
|
key: 2,
|
|
8459
8508
|
class: "media-viewer-stage media-viewer-audio-stage flex w-full items-center justify-center px-5 py-6"
|
|
8460
|
-
},
|
|
8509
|
+
}, gf = {
|
|
8461
8510
|
class: "w-full",
|
|
8462
8511
|
controls: "",
|
|
8463
8512
|
autoplay: ""
|
|
8464
|
-
},
|
|
8513
|
+
}, _f = ["src", "type"], vf = {
|
|
8465
8514
|
key: 0,
|
|
8466
8515
|
class: "media-viewer-footer flex min-w-0 items-center justify-between gap-3 px-4 py-3 max-md:px-3.5 max-md:py-3"
|
|
8467
|
-
},
|
|
8516
|
+
}, yf = { class: "min-w-0 flex-1" }, bf = { class: "heading-sm text-default truncate" }, xf = { class: "body-sm text-subtle" }, Sf = /* @__PURE__ */ sd(/* @__PURE__ */ u({
|
|
8468
8517
|
__name: "MediaViewerDialog",
|
|
8469
8518
|
props: { attachment: {} },
|
|
8470
8519
|
emits: ["close"],
|
|
8471
8520
|
setup(t, { emit: s }) {
|
|
8472
|
-
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: _ } =
|
|
8521
|
+
let c = t, l = s, u = w(null), d = w(null), f = n(() => !!c.attachment?.url), p = n(() => c.attachment?.kind === "image"), m = n(() => c.attachment?.kind === "video"), h = n(() => c.attachment?.kind === "audio"), { t: _ } = q(), { scale: y, translateX: b, translateY: x, isDragging: C, resetTransform: T, handlePointerDown: E, handlePointerMove: O, handlePointerUp: A, handlePointerCancel: M, handleWheel: ee, handleDoubleClick: N } = af({
|
|
8473
8522
|
viewportRef: u,
|
|
8474
8523
|
imageRef: d,
|
|
8475
8524
|
isImage: () => p.value
|
|
@@ -8480,7 +8529,7 @@ var tf = { class: "w-full" }, nf = {
|
|
|
8480
8529
|
function P() {
|
|
8481
8530
|
l("close");
|
|
8482
8531
|
}
|
|
8483
|
-
return (n, s) => (S(), r(
|
|
8532
|
+
return (n, s) => (S(), r(cf, {
|
|
8484
8533
|
open: f.value,
|
|
8485
8534
|
title: t.attachment?.name || j(_)("attachment"),
|
|
8486
8535
|
subtitle: t.attachment?.kind || "",
|
|
@@ -8497,9 +8546,9 @@ var tf = { class: "w-full" }, nf = {
|
|
|
8497
8546
|
}, [(S(), r(D(j(Lu)), {
|
|
8498
8547
|
class: "size-4",
|
|
8499
8548
|
"aria-hidden": "true"
|
|
8500
|
-
})), o("span", null, k(j(_)("openInNewTab")), 1)], 8,
|
|
8501
|
-
footer: I(() => [t.attachment ? (S(), a("div",
|
|
8502
|
-
default: I(() => [o("div",
|
|
8549
|
+
})), o("span", null, k(j(_)("openInNewTab")), 1)], 8, lf)) : i("", !0)]),
|
|
8550
|
+
footer: I(() => [t.attachment ? (S(), a("div", vf, [o("div", yf, [o("p", bf, k(t.attachment.name), 1), o("p", xf, k(t.attachment.kind), 1)])])) : i("", !0)]),
|
|
8551
|
+
default: I(() => [o("div", uf, [t.attachment?.url ? (S(), a(e, { key: 0 }, [p.value ? (S(), a("div", {
|
|
8503
8552
|
key: 0,
|
|
8504
8553
|
ref_key: "viewportRef",
|
|
8505
8554
|
ref: u,
|
|
@@ -8522,13 +8571,13 @@ var tf = { class: "w-full" }, nf = {
|
|
|
8522
8571
|
transform: `translate3d(${j(b)}px, ${j(x)}px, 0) scale(${j(y)})`,
|
|
8523
8572
|
transformOrigin: "center center"
|
|
8524
8573
|
})
|
|
8525
|
-
}, null, 14,
|
|
8574
|
+
}, null, 14, df)], 544)) : m.value ? (S(), a("div", ff, [o("video", pf, [o("source", {
|
|
8526
8575
|
src: t.attachment.url,
|
|
8527
8576
|
type: t.attachment.mimeType || void 0
|
|
8528
|
-
}, null, 8,
|
|
8577
|
+
}, null, 8, mf)])])) : h.value ? (S(), a("div", hf, [o("audio", gf, [o("source", {
|
|
8529
8578
|
src: t.attachment.url,
|
|
8530
8579
|
type: t.attachment.mimeType || void 0
|
|
8531
|
-
}, null, 8,
|
|
8580
|
+
}, null, 8, _f)])])) : i("", !0)], 64)) : i("", !0)])]),
|
|
8532
8581
|
_: 1
|
|
8533
8582
|
}, 8, [
|
|
8534
8583
|
"open",
|
|
@@ -8538,11 +8587,11 @@ var tf = { class: "w-full" }, nf = {
|
|
|
8538
8587
|
"close-aria-label"
|
|
8539
8588
|
]));
|
|
8540
8589
|
}
|
|
8541
|
-
}), [["__scopeId", "data-v-0e82cfd0"]]),
|
|
8590
|
+
}), [["__scopeId", "data-v-0e82cfd0"]]), Cf = { class: "date-separator" }, wf = { class: "date-separator__label" }, Tf = /* @__PURE__ */ sd(/* @__PURE__ */ u({
|
|
8542
8591
|
__name: "MessageDateSeparator",
|
|
8543
8592
|
props: { date: {} },
|
|
8544
8593
|
setup(e) {
|
|
8545
|
-
let t = e, { locale: r, t: i } =
|
|
8594
|
+
let t = e, { locale: r, t: i } = q(), s = n(() => {
|
|
8546
8595
|
let e = /* @__PURE__ */ new Date(), n = t.date, a = new Date(e.getFullYear(), e.getMonth(), e.getDate()), o = new Date(a);
|
|
8547
8596
|
o.setDate(o.getDate() - 1);
|
|
8548
8597
|
let s = new Date(a);
|
|
@@ -8552,31 +8601,31 @@ var tf = { class: "w-full" }, nf = {
|
|
|
8552
8601
|
year: "numeric"
|
|
8553
8602
|
}).format(n);
|
|
8554
8603
|
});
|
|
8555
|
-
return (e, t) => (S(), a("div",
|
|
8604
|
+
return (e, t) => (S(), a("div", Cf, [o("span", wf, k(s.value), 1)]));
|
|
8556
8605
|
}
|
|
8557
|
-
}), [["__scopeId", "data-v-49e72d67"]]),
|
|
8606
|
+
}), [["__scopeId", "data-v-49e72d67"]]), Ef = {
|
|
8558
8607
|
"data-testid": "action-message",
|
|
8559
8608
|
class: "message-action-row border-default bg-elevation-surface-default body-sm text-subtle max-w-4/5 rounded-full border px-3 py-1 text-center"
|
|
8560
|
-
},
|
|
8609
|
+
}, Df = { class: "message-action-row__text" }, Of = /* @__PURE__ */ u({
|
|
8561
8610
|
__name: "ActionMessageRow",
|
|
8562
8611
|
props: { text: {} },
|
|
8563
8612
|
setup(e) {
|
|
8564
|
-
return (t, n) => (S(), a("div",
|
|
8613
|
+
return (t, n) => (S(), a("div", Ef, [o("span", Df, k(e.text), 1)]));
|
|
8565
8614
|
}
|
|
8566
|
-
}),
|
|
8615
|
+
}), kf = ["href"], Af = {
|
|
8567
8616
|
key: 0,
|
|
8568
8617
|
class: "bg-elevation-surface-hovered aspect-[1.9/1] w-full overflow-hidden"
|
|
8569
|
-
},
|
|
8618
|
+
}, jf = ["src", "alt"], Mf = { class: "space-y-1.5 px-3 py-3" }, Nf = { class: "body-sm text-subtlest truncate font-semibold uppercase" }, Pf = { class: "heading-sm text-default line-clamp-2" }, Ff = { class: "body-md text-subtle line-clamp-2" }, If = {
|
|
8570
8619
|
key: 0,
|
|
8571
8620
|
class: "body-sm text-subtlest"
|
|
8572
|
-
},
|
|
8621
|
+
}, Lf = /* @__PURE__ */ u({
|
|
8573
8622
|
__name: "LinkPreviewCard",
|
|
8574
8623
|
props: {
|
|
8575
8624
|
url: {},
|
|
8576
8625
|
isOwn: { type: Boolean }
|
|
8577
8626
|
},
|
|
8578
8627
|
setup(e) {
|
|
8579
|
-
let t = e, r = w(null), s = w(!1), { t: c } =
|
|
8628
|
+
let t = e, r = w(null), s = w(!1), { t: c } = q(), l = n(() => {
|
|
8580
8629
|
try {
|
|
8581
8630
|
return new URL(t.url).hostname.replace(/^www\./, "");
|
|
8582
8631
|
} catch {
|
|
@@ -8636,18 +8685,18 @@ var tf = { class: "w-full" }, nf = {
|
|
|
8636
8685
|
target: "_blank",
|
|
8637
8686
|
rel: "noreferrer",
|
|
8638
8687
|
class: g(["media-surface mt-2 block rounded-xl no-underline transition hover:opacity-95", e.isOwn ? "bg-elevation-surface-default text-default" : "bg-elevation-surface-sunken text-default"])
|
|
8639
|
-
}, [r.value?.imageUrl ? (S(), a("div",
|
|
8688
|
+
}, [r.value?.imageUrl ? (S(), a("div", Af, [o("img", {
|
|
8640
8689
|
src: r.value.imageUrl,
|
|
8641
8690
|
alt: r.value.title || l.value,
|
|
8642
8691
|
class: "h-full w-full object-cover"
|
|
8643
|
-
}, null, 8,
|
|
8644
|
-
o("p",
|
|
8645
|
-
o("p",
|
|
8646
|
-
o("p",
|
|
8647
|
-
s.value && !r.value ? (S(), a("p",
|
|
8648
|
-
])], 10,
|
|
8649
|
-
}
|
|
8650
|
-
}),
|
|
8692
|
+
}, null, 8, jf)])) : i("", !0), o("div", Mf, [
|
|
8693
|
+
o("p", Nf, k(r.value?.siteName || l.value), 1),
|
|
8694
|
+
o("p", Pf, k(r.value?.title || l.value), 1),
|
|
8695
|
+
o("p", Ff, k(r.value?.description || u.value), 1),
|
|
8696
|
+
s.value && !r.value ? (S(), a("p", If, k(j(c)("loadingPreview")), 1)) : i("", !0)
|
|
8697
|
+
])], 10, kf));
|
|
8698
|
+
}
|
|
8699
|
+
}), Rf = { class: "linkified-text" }, zf = ["innerHTML"], Bf = /* @__PURE__ */ sd(/* @__PURE__ */ u({
|
|
8651
8700
|
__name: "LinkifiedText",
|
|
8652
8701
|
props: {
|
|
8653
8702
|
text: {},
|
|
@@ -8666,30 +8715,30 @@ var tf = { class: "w-full" }, nf = {
|
|
|
8666
8715
|
let t = e.target;
|
|
8667
8716
|
t.tagName === "A" && d(e, t);
|
|
8668
8717
|
}
|
|
8669
|
-
return (t, n) => (S(), a("div",
|
|
8718
|
+
return (t, n) => (S(), a("div", Rf, [o("div", {
|
|
8670
8719
|
class: g(["rich-text-content", e.textClass]),
|
|
8671
8720
|
onClick: f,
|
|
8672
8721
|
innerHTML: l.value
|
|
8673
|
-
}, null, 10,
|
|
8722
|
+
}, null, 10, zf), e.showPreview !== !1 && u.value ? (S(), r(Lf, {
|
|
8674
8723
|
key: 0,
|
|
8675
8724
|
url: u.value,
|
|
8676
8725
|
"is-own": e.isOwn
|
|
8677
8726
|
}, null, 8, ["url", "is-own"])) : i("", !0)]));
|
|
8678
8727
|
}
|
|
8679
|
-
}), [["__scopeId", "data-v-656b44e8"]]),
|
|
8728
|
+
}), [["__scopeId", "data-v-656b44e8"]]), Vf = { class: "w-full space-y-1" }, Hf = {
|
|
8680
8729
|
class: "attachment-video",
|
|
8681
8730
|
controls: "",
|
|
8682
8731
|
playsinline: "",
|
|
8683
8732
|
preload: "metadata"
|
|
8684
|
-
},
|
|
8733
|
+
}, Uf = ["src", "type"], Wf = ["onClick"], Gf = { class: "inline-flex items-center gap-2 truncate font-medium" }, Kf = ["href"], qf = { class: "flex min-w-0 items-center gap-2" }, Jf = { class: "bg-elevation-surface-hovered text-default inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-full" }, Yf = { class: "text-default truncate font-medium" }, Xf = { class: "body-sm text-subtle shrink-0" }, Zf = {
|
|
8685
8734
|
key: 4,
|
|
8686
8735
|
class: "flex items-center justify-between gap-3 rounded-2xl px-3 py-2 text-sm"
|
|
8687
|
-
},
|
|
8736
|
+
}, Qf = { class: "flex min-w-0 items-center gap-2" }, $f = { class: "bg-elevation-surface-hovered text-default inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-full" }, ep = { class: "text-default truncate font-medium" }, tp = { class: "body-sm text-subtle shrink-0" }, np = 4 / 3, rp = 16 / 9, ip = /* @__PURE__ */ sd(/* @__PURE__ */ u({
|
|
8688
8737
|
__name: "MessageAttachmentList",
|
|
8689
8738
|
props: { message: {} },
|
|
8690
8739
|
emits: ["openMedia"],
|
|
8691
8740
|
setup(t, { emit: n }) {
|
|
8692
|
-
let s = n, { t: l } =
|
|
8741
|
+
let s = n, { t: l } = q();
|
|
8693
8742
|
function u(e) {
|
|
8694
8743
|
return !e || Number.isNaN(e) ? "" : e < 1024 * 1024 ? `${Math.round(e / 1024)} KB` : `${(e / (1024 * 1024)).toFixed(1)} MB`;
|
|
8695
8744
|
}
|
|
@@ -8739,12 +8788,12 @@ var tf = { class: "w-full" }, nf = {
|
|
|
8739
8788
|
return n ? t.localeCompare(n, void 0, { sensitivity: "accent" }) !== 0 : !0;
|
|
8740
8789
|
}
|
|
8741
8790
|
function m(e) {
|
|
8742
|
-
return e.width && e.height && e.width > 0 && e.height > 0 ? e.width / e.height : e.kind === "video" ?
|
|
8791
|
+
return e.width && e.height && e.width > 0 && e.height > 0 ? e.width / e.height : e.kind === "video" ? rp : np;
|
|
8743
8792
|
}
|
|
8744
8793
|
function h(e) {
|
|
8745
8794
|
return { aspectRatio: String(m(e)) };
|
|
8746
8795
|
}
|
|
8747
|
-
return (n, d) => (S(), a("div",
|
|
8796
|
+
return (n, d) => (S(), a("div", Vf, [(S(!0), a(e, null, T(t.message.attachments, (n) => (S(), a(e, { key: `${t.message.id}-${n.name}` }, [n.kind === "image" && n.url ? (S(), r(j(B), {
|
|
8748
8797
|
key: 0,
|
|
8749
8798
|
preview: "",
|
|
8750
8799
|
src: n.url,
|
|
@@ -8754,8 +8803,8 @@ var tf = { class: "w-full" }, nf = {
|
|
|
8754
8803
|
type: e.kind
|
|
8755
8804
|
})),
|
|
8756
8805
|
alt: n.name,
|
|
8757
|
-
"image-class": "bg-elevation-surface-raised-default object-contain rounded-lg max-h-96 max-w-96",
|
|
8758
|
-
class: "mx-auto rounded-lg"
|
|
8806
|
+
"image-class": "w-full bg-elevation-surface-raised-default object-contain rounded-lg max-h-96 max-w-96",
|
|
8807
|
+
class: "attachment-media-bleed mx-auto rounded-lg"
|
|
8759
8808
|
}, null, 8, [
|
|
8760
8809
|
"src",
|
|
8761
8810
|
"imgs",
|
|
@@ -8764,42 +8813,42 @@ var tf = { class: "w-full" }, nf = {
|
|
|
8764
8813
|
key: 1,
|
|
8765
8814
|
class: "attachment-media-bleed media-surface attachment-media-frame group relative rounded-xl",
|
|
8766
8815
|
style: v(h(n))
|
|
8767
|
-
}, [o("video",
|
|
8816
|
+
}, [o("video", Hf, [o("source", {
|
|
8768
8817
|
src: n.url,
|
|
8769
8818
|
type: n.mimeType || void 0
|
|
8770
|
-
}, null, 8,
|
|
8819
|
+
}, null, 8, Uf)])], 4)) : n.kind === "audio" && n.url ? (S(), a("button", {
|
|
8771
8820
|
key: 2,
|
|
8772
8821
|
type: "button",
|
|
8773
8822
|
class: "flex w-full items-center justify-between gap-3 rounded-2xl px-3 py-2 text-left text-sm transition hover:opacity-90",
|
|
8774
8823
|
onClick: (e) => s("openMedia", n)
|
|
8775
|
-
}, [o("span",
|
|
8824
|
+
}, [o("span", Gf, [d[0] ||= o("span", { class: "bg-elevation-surface-hovered text-default inline-flex h-8 w-8 items-center justify-center rounded-full" }, " ♪ ", -1), c(" " + k(j(l)("audioMessage")), 1)])], 8, Wf)) : n.url ? (S(), a("a", {
|
|
8776
8825
|
key: 3,
|
|
8777
8826
|
href: n.url,
|
|
8778
8827
|
target: "_blank",
|
|
8779
8828
|
rel: "noreferrer",
|
|
8780
8829
|
class: "flex items-center justify-between gap-3 rounded-2xl px-3 py-2 text-sm no-underline transition hover:opacity-90"
|
|
8781
|
-
}, [o("span",
|
|
8830
|
+
}, [o("span", qf, [o("span", Jf, [(S(), r(D(f(n)), {
|
|
8782
8831
|
class: "size-5",
|
|
8783
8832
|
"aria-hidden": "true"
|
|
8784
|
-
}))]), o("span",
|
|
8833
|
+
}))]), o("span", Yf, k(n.name), 1)]), o("span", Xf, k(u(n.size)), 1)], 8, Kf)) : (S(), a("div", Zf, [o("span", Qf, [o("span", $f, [(S(), r(D(f(n)), {
|
|
8785
8834
|
class: "size-5",
|
|
8786
8835
|
"aria-hidden": "true"
|
|
8787
|
-
}))]), o("span",
|
|
8836
|
+
}))]), o("span", ep, k(n.name), 1)]), o("span", tp, k(u(n.size) || j(l)("queued")), 1)]))], 64))), 128)), p(t.message) ? (S(), r(Bf, {
|
|
8788
8837
|
key: 0,
|
|
8789
8838
|
text: t.message.text,
|
|
8790
8839
|
"is-own": t.message.isOwn,
|
|
8791
8840
|
"text-class": "whitespace-normal wrap-break-word body-md text-default"
|
|
8792
8841
|
}, null, 8, ["text", "is-own"])) : i("", !0)]));
|
|
8793
8842
|
}
|
|
8794
|
-
}), [["__scopeId", "data-v-
|
|
8843
|
+
}), [["__scopeId", "data-v-648a4774"]]), ap = { class: "message-status" }, op = { key: 0 }, sp = /* @__PURE__ */ sd(/* @__PURE__ */ u({
|
|
8795
8844
|
__name: "MessageDeliveryStatus",
|
|
8796
8845
|
props: { message: {} },
|
|
8797
8846
|
setup(e) {
|
|
8798
|
-
let t = e, { locale: s, t: c } =
|
|
8847
|
+
let t = e, { locale: s, t: c } = q();
|
|
8799
8848
|
function l(e) {
|
|
8800
8849
|
return new Intl.DateTimeFormat(s.value, {
|
|
8801
8850
|
timeStyle: "short",
|
|
8802
|
-
hourCycle:
|
|
8851
|
+
hourCycle: Le()
|
|
8803
8852
|
}).format(e);
|
|
8804
8853
|
}
|
|
8805
8854
|
let u = n(() => {
|
|
@@ -8838,8 +8887,8 @@ var tf = { class: "w-full" }, nf = {
|
|
|
8838
8887
|
};
|
|
8839
8888
|
}
|
|
8840
8889
|
});
|
|
8841
|
-
return (t, n) => (S(), a("div",
|
|
8842
|
-
e.message.isEdited && e.message.kind !== "poll" ? (S(), a("span",
|
|
8890
|
+
return (t, n) => (S(), a("div", ap, [
|
|
8891
|
+
e.message.isEdited && e.message.kind !== "poll" ? (S(), a("span", op, k(j(c)("edited")), 1)) : i("", !0),
|
|
8843
8892
|
o("span", null, k(l(e.message.sentAt)), 1),
|
|
8844
8893
|
u.value ? (S(), r(D(u.value.icon), {
|
|
8845
8894
|
key: 1,
|
|
@@ -8854,11 +8903,11 @@ var tf = { class: "w-full" }, nf = {
|
|
|
8854
8903
|
])) : i("", !0)
|
|
8855
8904
|
]));
|
|
8856
8905
|
}
|
|
8857
|
-
}), [["__scopeId", "data-v-20388b3b"]]),
|
|
8906
|
+
}), [["__scopeId", "data-v-20388b3b"]]), cp = { class: "mb-1 flex items-start justify-between gap-2" }, lp = { class: "body-sm text-subtlest truncate font-medium!" }, up = /* @__PURE__ */ u({
|
|
8858
8907
|
__name: "MessageItemHeader",
|
|
8859
8908
|
props: { message: {} },
|
|
8860
8909
|
setup(e) {
|
|
8861
|
-
let t = e, { locale: n, t: s } =
|
|
8910
|
+
let t = e, { locale: n, t: s } = q();
|
|
8862
8911
|
function c(e) {
|
|
8863
8912
|
return e ? new Intl.DateTimeFormat(n.value, {
|
|
8864
8913
|
month: "short",
|
|
@@ -8870,7 +8919,7 @@ var tf = { class: "w-full" }, nf = {
|
|
|
8870
8919
|
function l() {
|
|
8871
8920
|
return t.message.senderName?.trim() || (t.message.isOwn ? s("you") : s("system"));
|
|
8872
8921
|
}
|
|
8873
|
-
return (t, n) => (S(), a("div",
|
|
8922
|
+
return (t, n) => (S(), a("div", cp, [o("span", lp, k(l()), 1), e.message.scheduled?.scheduleDate ? (S(), r(j(oe), {
|
|
8874
8923
|
key: 0,
|
|
8875
8924
|
text: j(s)("scheduledDateLabel", { date: c(e.message.scheduled.scheduleDate) }),
|
|
8876
8925
|
context: "warn",
|
|
@@ -8879,7 +8928,7 @@ var tf = { class: "w-full" }, nf = {
|
|
|
8879
8928
|
class: "shrink-0"
|
|
8880
8929
|
}, null, 8, ["text"])) : i("", !0)]));
|
|
8881
8930
|
}
|
|
8882
|
-
}),
|
|
8931
|
+
}), dp = ["disabled", "onClick"], fp = /* @__PURE__ */ sd(/* @__PURE__ */ u({
|
|
8883
8932
|
__name: "MessageReactionList",
|
|
8884
8933
|
props: {
|
|
8885
8934
|
message: {},
|
|
@@ -8898,9 +8947,9 @@ var tf = { class: "w-full" }, nf = {
|
|
|
8898
8947
|
class: g(["message-reaction-list__item rounded-full px-2 py-0.75 leading-none transition", e.reactedByMe ? "reaction-chip-selected" : t.message.isOwn ? "reaction-chip-own" : "reaction-chip-other"]),
|
|
8899
8948
|
disabled: t.disabled,
|
|
8900
8949
|
onClick: (t) => r("toggle", e.emoji)
|
|
8901
|
-
}, k(e.emoji) + " " + k(e.count), 11,
|
|
8950
|
+
}, k(e.emoji) + " " + k(e.count), 11, dp))), 128))], 2)) : i("", !0);
|
|
8902
8951
|
}
|
|
8903
|
-
}), [["__scopeId", "data-v-c17c8bfd"]]),
|
|
8952
|
+
}), [["__scopeId", "data-v-c17c8bfd"]]), pp = { class: "message-reactions flex min-w-0 flex-1 flex-wrap items-center gap-1.5" }, mp = ["aria-label", "title"], hp = { class: "message-reactions__thread-count" }, gp = /* @__PURE__ */ u({
|
|
8904
8953
|
__name: "MessageItemReactions",
|
|
8905
8954
|
props: {
|
|
8906
8955
|
message: {},
|
|
@@ -8909,8 +8958,8 @@ var tf = { class: "w-full" }, nf = {
|
|
|
8909
8958
|
},
|
|
8910
8959
|
emits: ["toggleReaction", "openThread"],
|
|
8911
8960
|
setup(e, { emit: t }) {
|
|
8912
|
-
let s = e, c = t, { t: u } =
|
|
8913
|
-
return (t, n) => (S(), a("div",
|
|
8961
|
+
let s = e, c = t, { t: u } = q(), d = n(() => u("threadReplies", { count: s.message.replyCount })), f = n(() => s.canOpenThread !== !1 && s.message.replyCount > 0);
|
|
8962
|
+
return (t, n) => (S(), a("div", pp, [l(fp, {
|
|
8914
8963
|
message: e.message,
|
|
8915
8964
|
disabled: e.canReact === !1,
|
|
8916
8965
|
compact: "",
|
|
@@ -8925,12 +8974,12 @@ var tf = { class: "w-full" }, nf = {
|
|
|
8925
8974
|
}, [(S(), r(D(j(zu)), {
|
|
8926
8975
|
class: "size-4",
|
|
8927
8976
|
"aria-hidden": "true"
|
|
8928
|
-
})), o("span",
|
|
8977
|
+
})), o("span", hp, k(e.message.replyCount), 1)], 8, mp)) : i("", !0)]));
|
|
8929
8978
|
}
|
|
8930
|
-
}),
|
|
8979
|
+
}), _p = {
|
|
8931
8980
|
key: 0,
|
|
8932
8981
|
class: ""
|
|
8933
|
-
},
|
|
8982
|
+
}, vp = { class: "heading-sm text-default" }, yp = { class: "body-sm text-subtle" }, bp = { class: "space-y-2 py-3" }, xp = ["disabled", "onClick"], Sp = { class: "body-md flex items-center justify-between gap-3 px-3 py-1.5" }, Cp = { class: "body-sm text-subtle shrink-0" }, wp = { class: "bg-alpha-default h-1.5" }, Tp = /* @__PURE__ */ u({
|
|
8934
8983
|
__name: "MessagePollContent",
|
|
8935
8984
|
props: {
|
|
8936
8985
|
message: {},
|
|
@@ -8939,7 +8988,7 @@ var tf = { class: "w-full" }, nf = {
|
|
|
8939
8988
|
},
|
|
8940
8989
|
emits: ["vote"],
|
|
8941
8990
|
setup(t, { emit: n }) {
|
|
8942
|
-
let r = t, s = n, { t: c } =
|
|
8991
|
+
let r = t, s = n, { t: c } = q();
|
|
8943
8992
|
function l(e) {
|
|
8944
8993
|
let t = r.currentUserId;
|
|
8945
8994
|
return !t || !r.message.poll ? !1 : r.message.poll.options.some((n) => n.id === e && n.voters.includes(t));
|
|
@@ -8949,18 +8998,18 @@ var tf = { class: "w-full" }, nf = {
|
|
|
8949
8998
|
let t = r.currentUserId;
|
|
8950
8999
|
return !!(!t || r.pendingOptionKey === `${r.message.id}:${e}` || r.message.poll.options.some((n) => n.id === e && n.voters.includes(t)));
|
|
8951
9000
|
}
|
|
8952
|
-
return (n, r) => t.message.poll ? (S(), a("div",
|
|
9001
|
+
return (n, r) => t.message.poll ? (S(), a("div", _p, [o("div", null, [o("h4", vp, k(t.message.poll.question), 1), o("p", yp, k(j(c)("voteCount", { count: t.message.poll.totalVotes })), 1)]), o("div", bp, [(S(!0), a(e, null, T(t.message.poll.options, (e) => (S(), a("button", {
|
|
8953
9002
|
key: e.id,
|
|
8954
9003
|
type: "button",
|
|
8955
9004
|
class: "shadow-raised bg-elevation-surface-raised-default block w-full overflow-hidden rounded-lg text-left",
|
|
8956
9005
|
disabled: u(e.id),
|
|
8957
9006
|
onClick: (t) => s("vote", e.id)
|
|
8958
|
-
}, [o("div",
|
|
9007
|
+
}, [o("div", Sp, [o("span", { class: g(["truncate font-medium", l(e.id) ? "text-success" : ""]) }, k(e.text), 3), o("span", Cp, k(j(c)("voteCount", { count: e.voteCount })), 1)]), o("div", wp, [o("div", {
|
|
8959
9008
|
class: g(["h-full transition-all", l(e.id) ? "bg-accent-green-subtle-default" : "bg-accent-teal-subtle-default"]),
|
|
8960
9009
|
style: v({ width: `${t.message.poll.totalVotes ? e.voteCount / t.message.poll.totalVotes * 100 : 0}%` })
|
|
8961
|
-
}, null, 6)])], 8,
|
|
9010
|
+
}, null, 6)])], 8, xp))), 128))])])) : i("", !0);
|
|
8962
9011
|
}
|
|
8963
|
-
}),
|
|
9012
|
+
}), Ep = { class: "reply-quote__sender" }, Dp = { class: "reply-quote__text" }, Op = /* @__PURE__ */ sd(/* @__PURE__ */ u({
|
|
8964
9013
|
__name: "MessageReplyQuote",
|
|
8965
9014
|
props: { message: {} },
|
|
8966
9015
|
emits: ["open"],
|
|
@@ -8970,15 +9019,15 @@ var tf = { class: "w-full" }, nf = {
|
|
|
8970
9019
|
type: "button",
|
|
8971
9020
|
class: g(["reply-quote", e.message.isOwn ? "message-surface-subtle-own" : "message-surface-subtle-other"]),
|
|
8972
9021
|
onClick: n[0] ||= (e) => c("open")
|
|
8973
|
-
}, [o("p",
|
|
9022
|
+
}, [o("p", Ep, k(e.message.replyTo.senderName), 1), o("p", Dp, k(s.value), 1)], 2));
|
|
8974
9023
|
}
|
|
8975
|
-
}), [["__scopeId", "data-v-2a027d02"]]),
|
|
9024
|
+
}), [["__scopeId", "data-v-2a027d02"]]), kp = { class: "space-y-2" }, Ap = /* @__PURE__ */ u({
|
|
8976
9025
|
__name: "MessageTextContent",
|
|
8977
9026
|
props: { message: {} },
|
|
8978
9027
|
emits: ["anchorclick"],
|
|
8979
9028
|
setup(e) {
|
|
8980
9029
|
let t = Kl(), o = n(() => t.mentionNameByUid.value);
|
|
8981
|
-
return (t, n) => (S(), a("div",
|
|
9030
|
+
return (t, n) => (S(), a("div", kp, [e.message.translatedText ? (S(), r(Bf, {
|
|
8982
9031
|
key: 0,
|
|
8983
9032
|
text: e.message.translatedText,
|
|
8984
9033
|
"mention-name-by-uid": o.value,
|
|
@@ -8992,7 +9041,7 @@ var tf = { class: "w-full" }, nf = {
|
|
|
8992
9041
|
"mention-name-by-uid",
|
|
8993
9042
|
"is-own",
|
|
8994
9043
|
"class"
|
|
8995
|
-
])) : i("", !0), l(
|
|
9044
|
+
])) : i("", !0), l(Bf, {
|
|
8996
9045
|
text: e.message.text,
|
|
8997
9046
|
"mention-name-by-uid": o.value,
|
|
8998
9047
|
"is-own": e.message.isOwn,
|
|
@@ -9004,11 +9053,11 @@ var tf = { class: "w-full" }, nf = {
|
|
|
9004
9053
|
"is-own"
|
|
9005
9054
|
])]));
|
|
9006
9055
|
}
|
|
9007
|
-
}),
|
|
9056
|
+
}), jp = [
|
|
9008
9057
|
"id",
|
|
9009
9058
|
"data-message-id",
|
|
9010
9059
|
"data-message-kind"
|
|
9011
|
-
],
|
|
9060
|
+
], Mp = { class: "message-item__footer body-sm text-subtlest mt-0.5 flex items-end justify-between gap-2" }, Np = /* @__PURE__ */ sd(/* @__PURE__ */ u({
|
|
9012
9061
|
__name: "MessageItem",
|
|
9013
9062
|
props: {
|
|
9014
9063
|
message: {},
|
|
@@ -9050,7 +9099,7 @@ var tf = { class: "w-full" }, nf = {
|
|
|
9050
9099
|
"data-message-id": t.message.id,
|
|
9051
9100
|
"data-message-kind": t.message.kind,
|
|
9052
9101
|
class: g(["message-item group", d.value])
|
|
9053
|
-
}, [t.message.kind === "action" ? (S(), r(
|
|
9102
|
+
}, [t.message.kind === "action" ? (S(), r(Of, {
|
|
9054
9103
|
key: 0,
|
|
9055
9104
|
text: t.message.text,
|
|
9056
9105
|
class: g(f.value)
|
|
@@ -9066,16 +9115,16 @@ var tf = { class: "w-full" }, nf = {
|
|
|
9066
9115
|
onContextmenu: m,
|
|
9067
9116
|
onClick: h
|
|
9068
9117
|
}, [
|
|
9069
|
-
!t.message.isOwn || t.message.scheduled?.scheduleDate ? (S(), r(
|
|
9118
|
+
!t.message.isOwn || t.message.scheduled?.scheduleDate ? (S(), r(up, {
|
|
9070
9119
|
key: 0,
|
|
9071
9120
|
message: t.message
|
|
9072
9121
|
}, null, 8, ["message"])) : i("", !0),
|
|
9073
|
-
t.message.replyTo ? (S(), r(
|
|
9122
|
+
t.message.replyTo ? (S(), r(Op, {
|
|
9074
9123
|
key: 1,
|
|
9075
9124
|
message: t.message,
|
|
9076
9125
|
onOpen: _
|
|
9077
9126
|
}, null, 8, ["message"])) : i("", !0),
|
|
9078
|
-
t.message.kind === "poll" && t.message.poll ? (S(), r(
|
|
9127
|
+
t.message.kind === "poll" && t.message.poll ? (S(), r(Tp, {
|
|
9079
9128
|
key: 2,
|
|
9080
9129
|
message: t.message,
|
|
9081
9130
|
"current-user-id": t.currentUserId,
|
|
@@ -9085,16 +9134,16 @@ var tf = { class: "w-full" }, nf = {
|
|
|
9085
9134
|
"message",
|
|
9086
9135
|
"current-user-id",
|
|
9087
9136
|
"pending-option-key"
|
|
9088
|
-
])) : t.message.attachments?.length ? (S(), r(
|
|
9137
|
+
])) : t.message.attachments?.length ? (S(), r(ip, {
|
|
9089
9138
|
key: 3,
|
|
9090
9139
|
message: t.message,
|
|
9091
9140
|
onOpenMedia: s[1] ||= (e) => u("openMedia", e)
|
|
9092
|
-
}, null, 8, ["message"])) : (S(), r(
|
|
9141
|
+
}, null, 8, ["message"])) : (S(), r(Ap, {
|
|
9093
9142
|
key: 4,
|
|
9094
9143
|
message: t.message,
|
|
9095
9144
|
onAnchorclick: s[2] ||= (e, t) => n.$emit("anchorclick", e, t)
|
|
9096
9145
|
}, null, 8, ["message"])),
|
|
9097
|
-
o("div",
|
|
9146
|
+
o("div", Mp, [l(gp, {
|
|
9098
9147
|
message: t.message,
|
|
9099
9148
|
"can-react": t.canReact,
|
|
9100
9149
|
"can-open-thread": t.canOpenThread,
|
|
@@ -9104,20 +9153,20 @@ var tf = { class: "w-full" }, nf = {
|
|
|
9104
9153
|
"message",
|
|
9105
9154
|
"can-react",
|
|
9106
9155
|
"can-open-thread"
|
|
9107
|
-
]), l(
|
|
9108
|
-
], 34)], 64))], 10,
|
|
9156
|
+
]), l(sp, { message: t.message }, null, 8, ["message"])])
|
|
9157
|
+
], 34)], 64))], 10, jp));
|
|
9109
9158
|
}
|
|
9110
|
-
}), [["__scopeId", "data-v-cb4a4183"]]),
|
|
9159
|
+
}), [["__scopeId", "data-v-cb4a4183"]]), Pp = [
|
|
9111
9160
|
"👍",
|
|
9112
9161
|
"❤️",
|
|
9113
9162
|
"🔥",
|
|
9114
9163
|
"😂",
|
|
9115
9164
|
"🙏",
|
|
9116
9165
|
"🎉"
|
|
9117
|
-
],
|
|
9166
|
+
], Fp = /* @__PURE__ */ "👏.😍.🤯.😮.😢.😡.👀.✅.💯.🙌.🤝.👌.💪.🤔.🫶.😅.🥳.💛.🌟.🚀.💥.🎯.📌.💡.🕊️.☀️.🌈.🍀.🎶.🫡".split("."), Ip = { class: "message-reaction-pill" }, Lp = ["disabled", "onClick"], Rp = ["disabled"], zp = {
|
|
9118
9167
|
key: 0,
|
|
9119
9168
|
class: "message-expanded-reactions"
|
|
9120
|
-
},
|
|
9169
|
+
}, Bp = ["onClick"], Vp = /* @__PURE__ */ sd(/* @__PURE__ */ u({
|
|
9121
9170
|
__name: "MessageItemMenuReactions",
|
|
9122
9171
|
props: {
|
|
9123
9172
|
message: {},
|
|
@@ -9129,20 +9178,20 @@ var tf = { class: "w-full" }, nf = {
|
|
|
9129
9178
|
F(() => c.message.id, () => {
|
|
9130
9179
|
u.value = !1;
|
|
9131
9180
|
});
|
|
9132
|
-
let d = n(() =>
|
|
9181
|
+
let d = n(() => Fp);
|
|
9133
9182
|
function f(e) {
|
|
9134
9183
|
return (c.message.reactions ?? []).some((t) => t.emoji === e);
|
|
9135
9184
|
}
|
|
9136
9185
|
function p() {
|
|
9137
9186
|
c.canReact && (u.value = !u.value);
|
|
9138
9187
|
}
|
|
9139
|
-
return (n, s) => (S(), a(e, null, [o("div",
|
|
9188
|
+
return (n, s) => (S(), a(e, null, [o("div", Ip, [(S(!0), a(e, null, T(j(Pp), (e) => (S(), a("button", {
|
|
9140
9189
|
key: `${t.message.id}-${e}-common`,
|
|
9141
9190
|
type: "button",
|
|
9142
9191
|
class: g(["message-reaction-button", f(e) ? "message-reaction-button-active" : "message-reaction-button-idle"]),
|
|
9143
9192
|
disabled: !t.canReact,
|
|
9144
9193
|
onClick: (t) => l("react", e)
|
|
9145
|
-
}, k(e), 11,
|
|
9194
|
+
}, k(e), 11, Lp))), 128)), o("button", {
|
|
9146
9195
|
type: "button",
|
|
9147
9196
|
class: "message-reaction-more",
|
|
9148
9197
|
disabled: !t.canReact,
|
|
@@ -9150,14 +9199,14 @@ var tf = { class: "w-full" }, nf = {
|
|
|
9150
9199
|
}, [(S(), r(D(u.value ? j(Fu) : j(Pu)), {
|
|
9151
9200
|
class: "size-7",
|
|
9152
9201
|
"aria-hidden": "true"
|
|
9153
|
-
}))], 8,
|
|
9202
|
+
}))], 8, Rp)]), u.value && t.canReact ? (S(), a("div", zp, [(S(!0), a(e, null, T(d.value, (e) => (S(), a("button", {
|
|
9154
9203
|
key: `${t.message.id}-${e}-extended`,
|
|
9155
9204
|
type: "button",
|
|
9156
9205
|
class: g(["message-expanded-reaction-button", f(e) ? "message-reaction-button-active" : "message-reaction-button-idle"]),
|
|
9157
9206
|
onClick: (t) => l("react", e)
|
|
9158
|
-
}, k(e), 11,
|
|
9207
|
+
}, k(e), 11, Bp))), 128))])) : i("", !0)], 64));
|
|
9159
9208
|
}
|
|
9160
|
-
}), [["__scopeId", "data-v-696fe834"]]),
|
|
9209
|
+
}), [["__scopeId", "data-v-696fe834"]]), Hp = /* @__PURE__ */ sd(/* @__PURE__ */ u({
|
|
9161
9210
|
__name: "MessageItemMenu",
|
|
9162
9211
|
props: {
|
|
9163
9212
|
message: {},
|
|
@@ -9221,48 +9270,48 @@ var tf = { class: "w-full" }, nf = {
|
|
|
9221
9270
|
top: `${d.value.top}px`
|
|
9222
9271
|
}),
|
|
9223
9272
|
"data-testid": "message-action-popover-shell"
|
|
9224
|
-
}, [l(
|
|
9273
|
+
}, [l(Vp, {
|
|
9225
9274
|
message: e.message,
|
|
9226
9275
|
"can-react": e.canReact,
|
|
9227
9276
|
onReact: o[0] ||= (e) => s("react", e)
|
|
9228
9277
|
}, null, 8, ["message", "can-react"]), l(j(V), { model: e.actionItems }, null, 8, ["model"])], 4)) : i("", !0)]));
|
|
9229
9278
|
}
|
|
9230
|
-
}), [["__scopeId", "data-v-54f6bf5c"]]),
|
|
9279
|
+
}), [["__scopeId", "data-v-54f6bf5c"]]), Up = { 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" }, Wp = {
|
|
9231
9280
|
key: 0,
|
|
9232
9281
|
class: "chat-header__identity flex min-w-0 items-center gap-3"
|
|
9233
|
-
},
|
|
9282
|
+
}, Gp = { class: "chat-header__text min-w-0" }, Kp = { class: "chat-header__title heading-md text-default sm:heading-lg truncate" }, qp = { class: "chat-header__subtitle body-sm text-subtle sm:body-md truncate" }, Jp = { key: 0 }, Yp = { key: 1 }, Xp = { class: "chat-header__actions flex items-center gap-2" }, Zp = {
|
|
9234
9283
|
key: 0,
|
|
9235
9284
|
class: "chat-header__tags hidden flex-wrap gap-2 md:flex"
|
|
9236
|
-
},
|
|
9285
|
+
}, Qp = /* @__PURE__ */ u({
|
|
9237
9286
|
__name: "MessageListHeader",
|
|
9238
9287
|
props: {
|
|
9239
9288
|
conversation: {},
|
|
9240
9289
|
parentMessage: {}
|
|
9241
9290
|
},
|
|
9242
9291
|
setup(t) {
|
|
9243
|
-
let { t: n } =
|
|
9244
|
-
return (s, c) => (S(), a("header",
|
|
9292
|
+
let { t: n } = q();
|
|
9293
|
+
return (s, c) => (S(), a("header", Up, [t.conversation ? (S(), a("div", Wp, [l(j(R), {
|
|
9245
9294
|
image: t.conversation.avatar,
|
|
9246
9295
|
label: t.conversation.avatar ? void 0 : t.conversation.title.slice(0, 1).toUpperCase(),
|
|
9247
9296
|
shape: "circle",
|
|
9248
9297
|
class: "chat-header__avatar shrink-0"
|
|
9249
|
-
}, null, 8, ["image", "label"]), o("div",
|
|
9298
|
+
}, null, 8, ["image", "label"]), o("div", Gp, [o("p", Kp, k(t.parentMessage ? j(n)("thread") : t.conversation.title), 1), o("p", qp, [t.parentMessage ? (S(), a("span", Jp, k(t.parentMessage.senderName), 1)) : (S(), a("span", Yp, k(t.conversation.memberCount ? j(n)("members", { count: t.conversation.memberCount }) : j(n)("groupChat")), 1))])])])) : i("", !0), o("div", Xp, [t.conversation?.tags?.length ? (S(), a("div", Zp, [(S(!0), a(e, null, T(t.conversation.tags.slice(0, 3), (e) => (S(), r(j(oe), {
|
|
9250
9299
|
key: e,
|
|
9251
9300
|
text: e,
|
|
9252
9301
|
context: "secondary",
|
|
9253
9302
|
rounded: ""
|
|
9254
9303
|
}, null, 8, ["text"]))), 128))])) : i("", !0)])]));
|
|
9255
9304
|
}
|
|
9256
|
-
}),
|
|
9305
|
+
}), $p = {
|
|
9257
9306
|
key: 1,
|
|
9258
9307
|
class: "message-list__empty-state"
|
|
9259
|
-
},
|
|
9308
|
+
}, em = { class: "space-y-2" }, tm = {
|
|
9260
9309
|
key: 0,
|
|
9261
9310
|
class: "message-list__thread-root"
|
|
9262
|
-
},
|
|
9311
|
+
}, nm = { class: "body-sm text-subtlest truncate font-semibold uppercase" }, rm = { class: "body-md text-default mt-1 line-clamp-2" }, im = {
|
|
9263
9312
|
key: 1,
|
|
9264
9313
|
class: "surface-default text-subtle rounded-2xl p-5 text-center"
|
|
9265
|
-
},
|
|
9314
|
+
}, am = /* @__PURE__ */ sd(/* @__PURE__ */ u({
|
|
9266
9315
|
__name: "MessageList",
|
|
9267
9316
|
props: {
|
|
9268
9317
|
target: {},
|
|
@@ -9273,13 +9322,13 @@ var tf = { class: "w-full" }, nf = {
|
|
|
9273
9322
|
},
|
|
9274
9323
|
emits: ["anchorclick"],
|
|
9275
9324
|
setup(t) {
|
|
9276
|
-
let s = t, { t: c } =
|
|
9325
|
+
let s = t, { t: c } = q(), u = Kl(), d = Xl(), f = du(), p = n(() => s.target === "thread"), m = n(() => p.value ? d.threadMessages.value : s.hideGroupActions ? d.messages.value.filter((e) => e.kind !== "action") : d.messages.value), h = n(() => p.value ? d.loadingThreadMessages.value : d.loadingMessages.value), _ = n(() => p.value ? d.activeThreadParentMessage.value : null), v = n(() => p.value ? !1 : u.canOpenThread.value), y = n(() => s.showHeader ?? !p.value), b = n(() => p.value ? d.hasOlderThreadMessages.value : d.hasOlderMessages.value), x = n(() => p.value ? d.loadingOlderThreadMessages.value : d.loadingOlderMessages.value), C = n(() => p.value ? !0 : d.showDefaultEmptyState.value), D = n(() => {
|
|
9277
9326
|
let e = u.conversation.value;
|
|
9278
9327
|
return e ? _.value ? c("thread") : e.title : "";
|
|
9279
9328
|
}), O = n(() => {
|
|
9280
9329
|
let e = u.conversation.value;
|
|
9281
9330
|
return e ? _.value ? _.value.senderName : e.memberCount ? c("members", { count: e.memberCount }) : c("groupChat") : "";
|
|
9282
|
-
}), A = n(() => u.conversation.value?.memberCount ?? 0), M = w(null), N = w(null), P = n(() => !!_.value), F = n(() => P.value && !y.value), I = n(() => Vl(u.conversation.value)), te = ee("threadRef"), { handleThreadScroll: L } =
|
|
9331
|
+
}), A = n(() => u.conversation.value?.memberCount ?? 0), M = w(null), N = w(null), P = n(() => !!_.value), F = n(() => P.value && !y.value), I = n(() => Vl(u.conversation.value)), te = ee("threadRef"), { handleThreadScroll: L } = tf({
|
|
9283
9332
|
getConversation: () => u.conversation.value,
|
|
9284
9333
|
getParentMessage: () => _.value,
|
|
9285
9334
|
getMessages: () => m.value,
|
|
@@ -9288,7 +9337,7 @@ var tf = { class: "w-full" }, nf = {
|
|
|
9288
9337
|
canLoadOlder: () => b.value,
|
|
9289
9338
|
onLoadOlder: () => f.emit("list:loadOlder", { target: s.target }),
|
|
9290
9339
|
threadRef: te
|
|
9291
|
-
}), R = ee("actionMenuRef"), { activeActionMessage: z, handleMessageContextMenu: ne, handleMessageTap: B, resetActionMenuState: re, reactToMessage: ie, toggleInlineReaction: V, getActionItems: ae } =
|
|
9340
|
+
}), R = ee("actionMenuRef"), { activeActionMessage: z, handleMessageContextMenu: ne, handleMessageTap: B, resetActionMenuState: re, reactToMessage: ie, toggleInlineReaction: V, getActionItems: ae } = Yd({
|
|
9292
9341
|
canUseMessageActions: () => u.canUseMessageActions.value,
|
|
9293
9342
|
canReact: () => u.canReact.value,
|
|
9294
9343
|
canReply: () => u.canReply.value,
|
|
@@ -9355,7 +9404,7 @@ var tf = { class: "w-full" }, nf = {
|
|
|
9355
9404
|
title: D.value,
|
|
9356
9405
|
subtitle: O.value,
|
|
9357
9406
|
memberCount: A.value
|
|
9358
|
-
}, () => [l(
|
|
9407
|
+
}, () => [l(Qp, {
|
|
9359
9408
|
conversation: j(u).conversation.value,
|
|
9360
9409
|
"parent-message": _.value
|
|
9361
9410
|
}, null, 8, ["conversation", "parent-message"])], !0) : i("", !0), j(u).conversation.value ? (S(), a("div", {
|
|
@@ -9366,12 +9415,12 @@ var tf = { class: "w-full" }, nf = {
|
|
|
9366
9415
|
ref: te,
|
|
9367
9416
|
class: g(["message-list__scroll min-h-0 flex-1", F.value ? "p-0" : P.value ? "px-5 py-4" : "px-2 pt-2 pb-3"]),
|
|
9368
9417
|
onScroll: n[2] ||= (...e) => j(L) && j(L)(...e)
|
|
9369
|
-
}, [o("div",
|
|
9370
|
-
_.value ? (S(), a("div",
|
|
9371
|
-
(S(!0), a(e, null, T(m.value, (o, c) => (S(), a(e, { key: o.id }, [ue(c) ? (S(), r(
|
|
9418
|
+
}, [o("div", em, [
|
|
9419
|
+
_.value ? (S(), a("div", tm, [o("p", nm, k(_.value.senderName), 1), o("p", rm, k(j(ds)(_.value, j(c)("message"), j(u).mentionNameByUid.value)), 1)])) : i("", !0),
|
|
9420
|
+
(S(!0), a(e, null, T(m.value, (o, c) => (S(), a(e, { key: o.id }, [ue(c) ? (S(), r(Tf, {
|
|
9372
9421
|
key: 0,
|
|
9373
9422
|
date: o.sentAt
|
|
9374
|
-
}, null, 8, ["date"])) : i("", !0), l(
|
|
9423
|
+
}, null, 8, ["date"])) : i("", !0), l(Np, {
|
|
9375
9424
|
message: o,
|
|
9376
9425
|
"current-user-id": j(u).currentUserId.value,
|
|
9377
9426
|
"can-react": j(u).canReact.value,
|
|
@@ -9403,13 +9452,13 @@ var tf = { class: "w-full" }, nf = {
|
|
|
9403
9452
|
"onToggleReaction",
|
|
9404
9453
|
"onOpenThread"
|
|
9405
9454
|
])], 64))), 128)),
|
|
9406
|
-
m.value.length === 0 && C.value && !h.value ? (S(), a("div",
|
|
9407
|
-
])], 34), o("footer", { class: g(["message-list__composer flex shrink-0 flex-col", P.value ? F.value ? "bg-transparent p-0" : "message-list__composer--thread" : "bg-transparent p-0"]) }, [E(t.$slots, "composer", {}, void 0, !0)], 2)], 2)) : (S(), a("div",
|
|
9408
|
-
l(
|
|
9455
|
+
m.value.length === 0 && C.value && !h.value ? (S(), a("div", im, k(j(c)("noMessagesYetInThisGroup")), 1)) : i("", !0)
|
|
9456
|
+
])], 34), o("footer", { class: g(["message-list__composer flex shrink-0 flex-col", P.value ? F.value ? "bg-transparent p-0" : "message-list__composer--thread" : "bg-transparent p-0"]) }, [E(t.$slots, "composer", {}, void 0, !0)], 2)], 2)) : (S(), a("div", $p, k(j(c)("selectConversationToStart")), 1))], 2),
|
|
9457
|
+
l(Sf, {
|
|
9409
9458
|
attachment: M.value,
|
|
9410
9459
|
onClose: U
|
|
9411
9460
|
}, null, 8, ["attachment"]),
|
|
9412
|
-
l(
|
|
9461
|
+
l(Hp, {
|
|
9413
9462
|
ref_key: "actionMenuRef",
|
|
9414
9463
|
ref: R,
|
|
9415
9464
|
message: j(z),
|
|
@@ -9425,13 +9474,13 @@ var tf = { class: "w-full" }, nf = {
|
|
|
9425
9474
|
])
|
|
9426
9475
|
], 64));
|
|
9427
9476
|
}
|
|
9428
|
-
}), [["__scopeId", "data-v-bea26e53"]]),
|
|
9477
|
+
}), [["__scopeId", "data-v-bea26e53"]]), om = { class: "receipt-section" }, sm = { class: "receipt-section__header" }, cm = { class: "heading-sm text-default" }, lm = { class: "body-sm text-subtlest" }, um = {
|
|
9429
9478
|
key: 0,
|
|
9430
9479
|
class: "space-y-2"
|
|
9431
|
-
},
|
|
9480
|
+
}, dm = { class: "flex min-w-0 items-center gap-3" }, fm = { class: "min-w-0" }, pm = { class: "heading-sm text-default truncate" }, mm = { class: "body-sm text-subtle truncate" }, hm = { class: "body-sm text-subtle shrink-0" }, gm = {
|
|
9432
9481
|
key: 1,
|
|
9433
9482
|
class: "receipt-section__empty"
|
|
9434
|
-
},
|
|
9483
|
+
}, _m = /* @__PURE__ */ sd(/* @__PURE__ */ u({
|
|
9435
9484
|
__name: "ReceiptSection",
|
|
9436
9485
|
props: {
|
|
9437
9486
|
title: {},
|
|
@@ -9440,29 +9489,29 @@ var tf = { class: "w-full" }, nf = {
|
|
|
9440
9489
|
formatDateTime: { type: Function }
|
|
9441
9490
|
},
|
|
9442
9491
|
setup(t) {
|
|
9443
|
-
return (n, r) => (S(), a("section",
|
|
9492
|
+
return (n, r) => (S(), a("section", om, [o("div", sm, [o("p", cm, k(t.title), 1), o("span", lm, k(t.receipts.length), 1)]), t.receipts.length ? (S(), a("div", um, [(S(!0), a(e, null, T(t.receipts, (e) => (S(), a("div", {
|
|
9444
9493
|
key: `${e.kind}-${e.user.uid}`,
|
|
9445
9494
|
class: "receipt-section__row"
|
|
9446
|
-
}, [o("div",
|
|
9495
|
+
}, [o("div", dm, [l(j(R), {
|
|
9447
9496
|
image: e.user.avatar,
|
|
9448
9497
|
label: e.user.avatar ? void 0 : e.user.name.slice(0, 1).toUpperCase(),
|
|
9449
9498
|
shape: "circle",
|
|
9450
9499
|
class: "shrink-0"
|
|
9451
|
-
}, null, 8, ["image", "label"]), o("div",
|
|
9500
|
+
}, null, 8, ["image", "label"]), o("div", fm, [o("p", pm, k(e.user.name), 1), o("p", mm, k(e.user.uid), 1)])]), o("p", hm, k(t.formatDateTime(e.timestamp)), 1)]))), 128))])) : (S(), a("div", gm, k(t.emptyLabel), 1))]));
|
|
9452
9501
|
}
|
|
9453
|
-
}), [["__scopeId", "data-v-
|
|
9502
|
+
}), [["__scopeId", "data-v-2b2f0a3e"]]), vm = {
|
|
9454
9503
|
key: 0,
|
|
9455
9504
|
class: "message-info-dialog-content space-y-5 overflow-y-auto"
|
|
9456
|
-
},
|
|
9505
|
+
}, ym = { class: "message-info-summary px-4 py-4 sm:px-6 sm:py-5" }, bm = { class: "body-md text-default wrap-break-word whitespace-pre-wrap" }, xm = { class: "mt-4 grid gap-3 sm:grid-cols-3" }, Sm = { class: "message-info-metric px-3 py-3" }, Cm = { class: "body-sm text-subtlest font-semibold uppercase" }, wm = { class: "heading-sm text-default mt-1" }, Tm = { class: "message-info-metric px-3 py-3" }, Em = { class: "flex items-center gap-2" }, Dm = { class: "body-sm text-subtlest font-semibold uppercase" }, Om = { class: "heading-sm text-default mt-1" }, km = { class: "message-info-metric px-3 py-3" }, Am = { class: "flex items-center gap-2" }, jm = { class: "body-sm text-subtlest font-semibold uppercase" }, Mm = { class: "heading-sm text-default mt-1" }, Nm = {
|
|
9457
9506
|
key: 0,
|
|
9458
9507
|
class: "flex items-center justify-center px-4 py-8 sm:px-6"
|
|
9459
|
-
},
|
|
9508
|
+
}, Pm = {
|
|
9460
9509
|
key: 1,
|
|
9461
9510
|
class: "message-info-error body-md mx-4 rounded-xl px-4 py-3 sm:mx-6"
|
|
9462
|
-
},
|
|
9511
|
+
}, Fm = {
|
|
9463
9512
|
key: 2,
|
|
9464
9513
|
class: "space-y-4 pb-4 sm:pb-5"
|
|
9465
|
-
},
|
|
9514
|
+
}, Im = /* @__PURE__ */ sd(/* @__PURE__ */ u({
|
|
9466
9515
|
__name: "MessageInfoDialog",
|
|
9467
9516
|
props: {
|
|
9468
9517
|
open: { type: Boolean },
|
|
@@ -9473,45 +9522,45 @@ var tf = { class: "w-full" }, nf = {
|
|
|
9473
9522
|
},
|
|
9474
9523
|
emits: ["close"],
|
|
9475
9524
|
setup(e, { emit: t }) {
|
|
9476
|
-
let s = e, c = t, { locale: u, t: d } =
|
|
9525
|
+
let s = e, c = t, { locale: u, t: d } = q(), f = Kl(), p = n(() => s.receipts.filter((e) => e.kind === "delivered")), m = n(() => s.receipts.filter((e) => e.kind === "read")), h = n(() => s.receipts.filter((e) => e.kind === "delivered" || e.kind === "read"));
|
|
9477
9526
|
function g(e) {
|
|
9478
9527
|
return e ? new Intl.DateTimeFormat(u.value, {
|
|
9479
9528
|
dateStyle: "medium",
|
|
9480
9529
|
timeStyle: "short",
|
|
9481
|
-
hourCycle:
|
|
9530
|
+
hourCycle: Le()
|
|
9482
9531
|
}).format(e) : d("notYet");
|
|
9483
9532
|
}
|
|
9484
9533
|
function _(e, t) {
|
|
9485
9534
|
return e ? g(e) : d(t > 0 ? "someRecipients" : "notYet");
|
|
9486
9535
|
}
|
|
9487
|
-
return (t, n) => (S(), r(
|
|
9536
|
+
return (t, n) => (S(), r(cf, {
|
|
9488
9537
|
open: e.open,
|
|
9489
9538
|
title: j(d)("messageInfo"),
|
|
9490
9539
|
subtitle: j(d)("deliveryAndReadDetails"),
|
|
9491
9540
|
"close-label": j(d)("close"),
|
|
9492
9541
|
onClose: n[0] ||= (e) => c("close")
|
|
9493
9542
|
}, {
|
|
9494
|
-
default: I(() => [e.message ? (S(), a("div",
|
|
9495
|
-
o("div",
|
|
9496
|
-
o("div",
|
|
9543
|
+
default: I(() => [e.message ? (S(), a("div", vm, [o("div", ym, [o("p", bm, k(j(ds)(e.message, j(d)("message"), j(f).mentionNameByUid.value)), 1), o("div", xm, [
|
|
9544
|
+
o("div", Sm, [o("p", Cm, k(j(d)("sent")), 1), o("p", wm, k(g(e.message.sentAt)), 1)]),
|
|
9545
|
+
o("div", Tm, [o("div", Em, [o("p", Dm, k(j(d)("deliveredToAll")), 1), h.value.length ? (S(), r(j(oe), {
|
|
9497
9546
|
key: 0,
|
|
9498
9547
|
text: String(h.value.length),
|
|
9499
9548
|
context: "secondary",
|
|
9500
9549
|
rounded: ""
|
|
9501
|
-
}, null, 8, ["text"])) : i("", !0)]), o("p",
|
|
9502
|
-
o("div",
|
|
9550
|
+
}, null, 8, ["text"])) : i("", !0)]), o("p", Om, k(_(e.message.receipts.deliveredAt, h.value.length)), 1)]),
|
|
9551
|
+
o("div", km, [o("div", Am, [o("p", jm, k(j(d)("readByAll")), 1), m.value.length ? (S(), r(j(oe), {
|
|
9503
9552
|
key: 0,
|
|
9504
9553
|
text: String(m.value.length),
|
|
9505
9554
|
context: "success",
|
|
9506
9555
|
rounded: ""
|
|
9507
|
-
}, null, 8, ["text"])) : i("", !0)]), o("p",
|
|
9508
|
-
])]), e.loading ? (S(), a("div",
|
|
9556
|
+
}, null, 8, ["text"])) : i("", !0)]), o("p", Mm, k(_(e.message.receipts.readAt, m.value.length)), 1)])
|
|
9557
|
+
])]), e.loading ? (S(), a("div", Nm, [l(j(H), {
|
|
9509
9558
|
style: {
|
|
9510
9559
|
width: "2.5rem",
|
|
9511
9560
|
height: "2.5rem"
|
|
9512
9561
|
},
|
|
9513
9562
|
"stroke-width": "5"
|
|
9514
|
-
})])) : e.error ? (S(), a("div",
|
|
9563
|
+
})])) : e.error ? (S(), a("div", Pm, k(e.error), 1)) : (S(), a("div", Fm, [l(_m, {
|
|
9515
9564
|
title: j(d)("readBy"),
|
|
9516
9565
|
receipts: m.value,
|
|
9517
9566
|
"empty-label": j(d)("nobodyHasReadThisMessageYet"),
|
|
@@ -9520,7 +9569,7 @@ var tf = { class: "w-full" }, nf = {
|
|
|
9520
9569
|
"title",
|
|
9521
9570
|
"receipts",
|
|
9522
9571
|
"empty-label"
|
|
9523
|
-
]), l(
|
|
9572
|
+
]), l(_m, {
|
|
9524
9573
|
title: j(d)("deliveredNotYetRead"),
|
|
9525
9574
|
receipts: p.value,
|
|
9526
9575
|
"empty-label": j(d)("noRecipientsDeliveredStageYet"),
|
|
@@ -9538,28 +9587,34 @@ var tf = { class: "w-full" }, nf = {
|
|
|
9538
9587
|
"close-label"
|
|
9539
9588
|
]));
|
|
9540
9589
|
}
|
|
9541
|
-
}), [["__scopeId", "data-v-30ce65f1"]]),
|
|
9590
|
+
}), [["__scopeId", "data-v-30ce65f1"]]), Lm = { class: "min-h-0 flex-1 overflow-y-auto py-4 sm:py-5" }, Rm = {
|
|
9542
9591
|
key: 0,
|
|
9543
9592
|
class: "flex h-full min-h-64 items-center justify-center"
|
|
9544
|
-
},
|
|
9593
|
+
}, zm = {
|
|
9545
9594
|
key: 1,
|
|
9546
9595
|
class: "bg-elevation-surface-sunken-default body-md flex h-full min-h-64 items-center justify-center rounded-xl px-6 text-center"
|
|
9547
|
-
},
|
|
9596
|
+
}, Bm = {
|
|
9548
9597
|
key: 2,
|
|
9549
9598
|
class: "space-y-3"
|
|
9550
|
-
},
|
|
9599
|
+
}, Vm = { class: "flex flex-wrap items-start justify-between gap-3" }, Hm = { class: "w-full space-y-2" }, Um = { class: "center between gap-2" }, Wm = { class: "" }, Gm = { class: "space-y-1" }, Km = { class: "heading-sm text-default" }, qm = {
|
|
9551
9600
|
key: 0,
|
|
9552
9601
|
class: "body-md text-default"
|
|
9553
|
-
},
|
|
9602
|
+
}, Jm = {
|
|
9554
9603
|
key: 1,
|
|
9555
9604
|
class: "body-md text-default wrap-break-word whitespace-pre-wrap"
|
|
9556
|
-
},
|
|
9605
|
+
}, Ym = {
|
|
9606
|
+
key: 0,
|
|
9607
|
+
class: "max-w-sm"
|
|
9608
|
+
}, Xm = { class: "flex flex-wrap items-center gap-1" }, Zm = {
|
|
9557
9609
|
key: 0,
|
|
9558
9610
|
class: "bg-elevation-surface-sunken-default mt-4 flex flex-col gap-3 rounded-xl p-3 sm:flex-row sm:items-center"
|
|
9559
|
-
},
|
|
9611
|
+
}, Qm = { class: "grid w-full grid-cols-1 gap-2 sm:grid-cols-[1fr_8rem]" }, $m = { class: "flex items-center gap-2" }, eh = {
|
|
9560
9612
|
key: 1,
|
|
9561
9613
|
class: "bg-elevation-surface-sunken-default mt-4 flex flex-col gap-3 rounded-xl p-3"
|
|
9562
|
-
},
|
|
9614
|
+
}, th = {
|
|
9615
|
+
key: 0,
|
|
9616
|
+
class: "relative max-w-sm"
|
|
9617
|
+
}, nh = { class: "absolute top-2 right-2" }, rh = ["placeholder"], ih = { class: "flex items-center justify-end gap-2" }, ah = /* @__PURE__ */ u({
|
|
9563
9618
|
__name: "ScheduledMessagesDialog",
|
|
9564
9619
|
props: {
|
|
9565
9620
|
open: { type: Boolean },
|
|
@@ -9574,165 +9629,193 @@ var tf = { class: "w-full" }, nf = {
|
|
|
9574
9629
|
"editText"
|
|
9575
9630
|
],
|
|
9576
9631
|
setup(t, { emit: s }) {
|
|
9577
|
-
let c = t, u = s, d = w(null), f = w(null), p = w(
|
|
9632
|
+
let c = t, u = s, d = w(null), f = w(null), p = w(!1), m = w(""), h = w(""), g = w(""), { locale: _, t: v } = q(), y = n(() => c.messages.filter((e) => !e.isDeleted && !!e.scheduled?.scheduleDate)), b = n(() => /^([01]\d|2[0-3]):([0-5]\d)$/.test(h.value));
|
|
9578
9633
|
F(() => c.open, (e) => {
|
|
9579
|
-
e || (d.value = null, f.value = null, p.value =
|
|
9634
|
+
e || (d.value = null, f.value = null, p.value = !1, m.value = "", h.value = "", g.value = "");
|
|
9580
9635
|
});
|
|
9581
|
-
function
|
|
9582
|
-
return e ? new Intl.DateTimeFormat(
|
|
9636
|
+
function x(e) {
|
|
9637
|
+
return e ? new Intl.DateTimeFormat(_.value, {
|
|
9583
9638
|
dateStyle: "medium",
|
|
9584
9639
|
timeStyle: "short",
|
|
9585
|
-
hourCycle:
|
|
9586
|
-
}).format(e) :
|
|
9640
|
+
hourCycle: Le()
|
|
9641
|
+
}).format(e) : v("unscheduled");
|
|
9587
9642
|
}
|
|
9588
|
-
function
|
|
9643
|
+
function C(e) {
|
|
9589
9644
|
let t = e ?? new Date(Date.now() + 3600 * 1e3);
|
|
9590
9645
|
return `${t.getFullYear()}-${String(t.getMonth() + 1).padStart(2, "0")}-${String(t.getDate()).padStart(2, "0")}`;
|
|
9591
9646
|
}
|
|
9592
|
-
function
|
|
9647
|
+
function E(e) {
|
|
9593
9648
|
let t = e ?? new Date(Date.now() + 3600 * 1e3);
|
|
9594
9649
|
return `${String(t.getHours()).padStart(2, "0")}:${String(t.getMinutes()).padStart(2, "0")}`;
|
|
9595
9650
|
}
|
|
9596
|
-
function E(e) {
|
|
9597
|
-
return _(e === "image" ? "image" : e === "video" ? "video" : e === "audio" ? "audio" : e === "file" ? "file" : "attachment");
|
|
9598
|
-
}
|
|
9599
9651
|
function D(e) {
|
|
9600
|
-
|
|
9652
|
+
return v(e === "image" ? "image" : e === "video" ? "video" : e === "audio" ? "audio" : e === "file" ? "file" : "attachment");
|
|
9601
9653
|
}
|
|
9602
9654
|
function O(e) {
|
|
9603
|
-
d.value = e.id, f.value = "
|
|
9655
|
+
d.value = e.id, f.value = "reschedule", m.value = C(e.scheduled?.scheduleDate), h.value = E(e.scheduled?.scheduleDate), g.value = "";
|
|
9604
9656
|
}
|
|
9605
|
-
function A() {
|
|
9606
|
-
d.value =
|
|
9657
|
+
function A(e) {
|
|
9658
|
+
d.value = e.id, f.value = "text", p.value = !1, g.value = ds(e, ""), m.value = "", h.value = "";
|
|
9659
|
+
}
|
|
9660
|
+
function M() {
|
|
9661
|
+
d.value = null, f.value = null, p.value = !1, m.value = "", h.value = "", g.value = "";
|
|
9662
|
+
}
|
|
9663
|
+
function ee(e) {
|
|
9664
|
+
return {
|
|
9665
|
+
...e,
|
|
9666
|
+
text: ""
|
|
9667
|
+
};
|
|
9607
9668
|
}
|
|
9608
|
-
function
|
|
9609
|
-
|
|
9610
|
-
|
|
9669
|
+
function P() {
|
|
9670
|
+
p.value = !0;
|
|
9671
|
+
}
|
|
9672
|
+
function L(e) {
|
|
9673
|
+
return e.attachments.length ? !(d.value === e.id && p.value) : !1;
|
|
9674
|
+
}
|
|
9675
|
+
function R(e) {
|
|
9676
|
+
if (!e.scheduled?.messageId || !e.scheduled?.muid || !e.scheduled?.originalChatUid || !m.value || !b.value) return;
|
|
9677
|
+
let [t, n, r] = m.value.split("-").map(Number), [i, a] = h.value.split(":").map(Number), o = new Date(t, n - 1, r, i, a, 0, 0);
|
|
9611
9678
|
u("reschedule", {
|
|
9612
9679
|
messageId: e.scheduled.messageId,
|
|
9613
9680
|
muid: e.scheduled.muid,
|
|
9614
9681
|
originalChatUid: e.scheduled.originalChatUid,
|
|
9615
9682
|
scheduleDate: o.toISOString()
|
|
9616
|
-
}),
|
|
9683
|
+
}), M();
|
|
9617
9684
|
}
|
|
9618
|
-
function
|
|
9619
|
-
|
|
9685
|
+
function ne(e) {
|
|
9686
|
+
if (p.value && e.attachments.length > 0) {
|
|
9687
|
+
B(e);
|
|
9688
|
+
return;
|
|
9689
|
+
}
|
|
9690
|
+
let t = g.value.trim();
|
|
9620
9691
|
e.kind === "text" && !t || (u("editText", {
|
|
9621
9692
|
message: e,
|
|
9622
|
-
nextText:
|
|
9623
|
-
}),
|
|
9693
|
+
nextText: g.value
|
|
9694
|
+
}), M());
|
|
9624
9695
|
}
|
|
9625
|
-
function
|
|
9626
|
-
d.value === e.id &&
|
|
9696
|
+
function B(e) {
|
|
9697
|
+
d.value === e.id && M(), u("remove", e);
|
|
9627
9698
|
}
|
|
9628
|
-
return (n, s) => (S(), r(
|
|
9699
|
+
return (n, s) => (S(), r(cf, {
|
|
9629
9700
|
open: t.open,
|
|
9630
|
-
title: j(
|
|
9631
|
-
subtitle: t.conversationTitle ? j(
|
|
9632
|
-
"close-label": j(
|
|
9701
|
+
title: j(v)("scheduledMessages"),
|
|
9702
|
+
subtitle: t.conversationTitle ? j(v)("queuedForConversation", { title: t.conversationTitle }) : j(v)("queuedOutgoingMessagesForThisChat"),
|
|
9703
|
+
"close-label": j(v)("close"),
|
|
9633
9704
|
onClose: s[3] ||= (e) => u("close")
|
|
9634
9705
|
}, {
|
|
9635
|
-
default: I(() => [o("div",
|
|
9706
|
+
default: I(() => [o("div", Lm, [t.loading ? (S(), a("div", Rm, [l(j(H), {
|
|
9636
9707
|
style: {
|
|
9637
9708
|
width: "2.75rem",
|
|
9638
9709
|
height: "2.75rem"
|
|
9639
9710
|
},
|
|
9640
9711
|
"stroke-width": "6"
|
|
9641
|
-
})])) :
|
|
9712
|
+
})])) : y.value.length === 0 ? (S(), a("div", zm, k(j(v)("noScheduledMessagesForConversation")), 1)) : (S(), a("div", Bm, [(S(!0), a(e, null, T(y.value, (e) => (S(), a("article", {
|
|
9642
9713
|
key: e.id,
|
|
9643
9714
|
class: "border-default rounded-lg border px-4 py-3"
|
|
9644
|
-
}, [o("div",
|
|
9645
|
-
|
|
9646
|
-
text: j(_)("poll"),
|
|
9647
|
-
context: "info",
|
|
9648
|
-
rounded: ""
|
|
9649
|
-
}, null, 8, ["text"])) : e.attachments.length ? (S(), r(j(oe), {
|
|
9650
|
-
key: 1,
|
|
9651
|
-
text: E(e.attachments[0].kind),
|
|
9652
|
-
context: "secondary",
|
|
9653
|
-
rounded: ""
|
|
9654
|
-
}, null, 8, ["text"])) : i("", !0)]), o("div", Bm, [o("p", Vm, k(b(e.scheduled?.scheduleDate)), 1), e.kind === "poll" && e.poll ? (S(), a("p", Hm, k(e.poll.question), 1)) : (S(), a("p", Um, k(j(ds)(e, j(_)("attachment"))), 1))])]), o("div", Wm, [
|
|
9655
|
-
e.kind === "poll" ? i("", !0) : (S(), r(j(z), {
|
|
9715
|
+
}, [o("div", Vm, [o("div", Hm, [
|
|
9716
|
+
o("div", Um, [o("div", Wm, [e.kind === "poll" ? (S(), r(j(oe), {
|
|
9656
9717
|
key: 0,
|
|
9657
|
-
|
|
9658
|
-
|
|
9659
|
-
|
|
9660
|
-
|
|
9661
|
-
onClick: (t) => O(e)
|
|
9662
|
-
}, null, 8, [
|
|
9663
|
-
"label",
|
|
9664
|
-
"icon",
|
|
9665
|
-
"onClick"
|
|
9666
|
-
])),
|
|
9667
|
-
e.scheduled?.messageId && e.scheduled?.muid && e.scheduled?.originalChatUid ? (S(), r(j(z), {
|
|
9718
|
+
text: j(v)("poll"),
|
|
9719
|
+
context: "info",
|
|
9720
|
+
rounded: ""
|
|
9721
|
+
}, null, 8, ["text"])) : e.attachments.length ? (S(), r(j(oe), {
|
|
9668
9722
|
key: 1,
|
|
9669
|
-
|
|
9670
|
-
|
|
9671
|
-
|
|
9672
|
-
|
|
9673
|
-
|
|
9674
|
-
|
|
9675
|
-
"
|
|
9676
|
-
"
|
|
9677
|
-
|
|
9678
|
-
])) : i("", !0),
|
|
9679
|
-
l(j(z), {
|
|
9680
|
-
label: j(_)("remove"),
|
|
9723
|
+
text: D(e.attachments[0].kind),
|
|
9724
|
+
context: "info",
|
|
9725
|
+
rounded: ""
|
|
9726
|
+
}, null, 8, ["text"])) : (S(), r(j(oe), {
|
|
9727
|
+
key: 2,
|
|
9728
|
+
text: j(v)("message"),
|
|
9729
|
+
context: "info",
|
|
9730
|
+
rounded: ""
|
|
9731
|
+
}, null, 8, ["text"]))]), l(j(z), {
|
|
9681
9732
|
icon: j(Cu),
|
|
9682
9733
|
text: "",
|
|
9683
9734
|
size: "small",
|
|
9684
|
-
onClick: (t) =>
|
|
9685
|
-
}, null, 8, [
|
|
9686
|
-
|
|
9687
|
-
|
|
9688
|
-
|
|
9689
|
-
|
|
9690
|
-
|
|
9691
|
-
|
|
9735
|
+
onClick: (t) => B(e)
|
|
9736
|
+
}, null, 8, ["icon", "onClick"])]),
|
|
9737
|
+
o("div", Gm, [o("p", Km, k(x(e.scheduled?.scheduleDate)), 1), e.kind === "poll" && e.poll ? (S(), a("p", qm, k(e.poll.question), 1)) : (S(), a("p", Jm, k(j(ds)(e, j(v)("attachment"))), 1))]),
|
|
9738
|
+
L(e) && !(d.value === e.id && f.value === "text") ? (S(), a("div", Ym, [l(ip, { message: ee(e) }, null, 8, ["message"])])) : i("", !0)
|
|
9739
|
+
]), o("div", Xm, [e.kind === "poll" ? i("", !0) : (S(), r(j(z), {
|
|
9740
|
+
key: 0,
|
|
9741
|
+
label: j(v)("edit"),
|
|
9742
|
+
icon: j(Eu),
|
|
9743
|
+
severity: "secondary",
|
|
9744
|
+
size: "small",
|
|
9745
|
+
onClick: (t) => A(e)
|
|
9746
|
+
}, null, 8, [
|
|
9747
|
+
"label",
|
|
9748
|
+
"icon",
|
|
9749
|
+
"onClick"
|
|
9750
|
+
])), e.scheduled?.messageId && e.scheduled?.muid && e.scheduled?.originalChatUid ? (S(), r(j(z), {
|
|
9751
|
+
key: 1,
|
|
9752
|
+
label: j(v)("reschedule"),
|
|
9753
|
+
icon: j(vu),
|
|
9754
|
+
severity: "secondary",
|
|
9755
|
+
size: "small",
|
|
9756
|
+
onClick: (t) => O(e)
|
|
9757
|
+
}, null, 8, [
|
|
9758
|
+
"label",
|
|
9759
|
+
"icon",
|
|
9760
|
+
"onClick"
|
|
9761
|
+
])) : i("", !0)])]), d.value === e.id && f.value === "reschedule" ? (S(), a("div", Zm, [o("div", Qm, [te(o("input", {
|
|
9762
|
+
"onUpdate:modelValue": s[0] ||= (e) => m.value = e,
|
|
9692
9763
|
type: "date",
|
|
9693
9764
|
class: "surface-input body-md w-full rounded-xl p-2 ring-0 outline-none"
|
|
9694
|
-
}, null, 512), [[N,
|
|
9695
|
-
"onUpdate:modelValue": s[1] ||= (e) =>
|
|
9765
|
+
}, null, 512), [[N, m.value]]), te(o("input", {
|
|
9766
|
+
"onUpdate:modelValue": s[1] ||= (e) => h.value = e,
|
|
9696
9767
|
type: "time",
|
|
9697
9768
|
inputmode: "numeric",
|
|
9698
9769
|
placeholder: "HH:mm",
|
|
9699
9770
|
pattern: "^([01]\\d|2[0-3]):([0-5]\\d)$",
|
|
9700
9771
|
"aria-label": "Time (24-hour)",
|
|
9701
9772
|
class: "surface-input body-md w-full rounded-xl p-2 ring-0 outline-none"
|
|
9702
|
-
}, null, 512), [[N,
|
|
9703
|
-
label: j(
|
|
9773
|
+
}, null, 512), [[N, h.value]])]), o("div", $m, [l(j(z), {
|
|
9774
|
+
label: j(v)("save"),
|
|
9704
9775
|
size: "small",
|
|
9705
|
-
disabled: !
|
|
9706
|
-
onClick: (t) =>
|
|
9776
|
+
disabled: !m.value || !b.value,
|
|
9777
|
+
onClick: (t) => R(e)
|
|
9707
9778
|
}, null, 8, [
|
|
9708
9779
|
"label",
|
|
9709
9780
|
"disabled",
|
|
9710
9781
|
"onClick"
|
|
9711
9782
|
]), l(j(z), {
|
|
9712
|
-
label: j(
|
|
9713
|
-
size: "small",
|
|
9714
|
-
text: "",
|
|
9715
|
-
onClick: A
|
|
9716
|
-
}, null, 8, ["label"])])])) : d.value === e.id && f.value === "text" ? (S(), a("div", Jm, [te(o("textarea", {
|
|
9717
|
-
"onUpdate:modelValue": s[2] ||= (e) => h.value = e,
|
|
9718
|
-
rows: "3",
|
|
9719
|
-
class: "surface-input body-md w-full rounded-xl px-3 py-2 ring-0 outline-none",
|
|
9720
|
-
placeholder: j(_)("writeMessage")
|
|
9721
|
-
}, null, 8, Ym), [[N, h.value]]), o("div", Xm, [l(j(z), {
|
|
9722
|
-
label: j(_)("cancel"),
|
|
9783
|
+
label: j(v)("cancel"),
|
|
9723
9784
|
size: "small",
|
|
9724
9785
|
text: "",
|
|
9725
|
-
onClick:
|
|
9726
|
-
}, null, 8, ["label"])
|
|
9727
|
-
|
|
9728
|
-
|
|
9729
|
-
|
|
9730
|
-
|
|
9731
|
-
|
|
9732
|
-
|
|
9733
|
-
|
|
9734
|
-
|
|
9735
|
-
|
|
9786
|
+
onClick: M
|
|
9787
|
+
}, null, 8, ["label"])])])) : d.value === e.id && f.value === "text" ? (S(), a("div", eh, [
|
|
9788
|
+
L(e) ? (S(), a("div", th, [l(ip, { message: ee(e) }, null, 8, ["message"]), o("div", nh, [l(j(z), {
|
|
9789
|
+
icon: j(bu),
|
|
9790
|
+
"aria-label": j(v)("remove"),
|
|
9791
|
+
text: "",
|
|
9792
|
+
rounded: "",
|
|
9793
|
+
severity: "secondary",
|
|
9794
|
+
size: "small",
|
|
9795
|
+
onClick: P
|
|
9796
|
+
}, null, 8, ["icon", "aria-label"])])])) : i("", !0),
|
|
9797
|
+
te(o("textarea", {
|
|
9798
|
+
"onUpdate:modelValue": s[2] ||= (e) => g.value = e,
|
|
9799
|
+
rows: "3",
|
|
9800
|
+
class: "surface-input body-md w-full rounded-xl px-3 py-2 ring-0 outline-none",
|
|
9801
|
+
placeholder: j(v)("writeMessage")
|
|
9802
|
+
}, null, 8, rh), [[N, g.value]]),
|
|
9803
|
+
o("div", ih, [l(j(z), {
|
|
9804
|
+
label: j(v)("cancel"),
|
|
9805
|
+
size: "small",
|
|
9806
|
+
text: "",
|
|
9807
|
+
onClick: M
|
|
9808
|
+
}, null, 8, ["label"]), l(j(z), {
|
|
9809
|
+
label: j(v)("save"),
|
|
9810
|
+
size: "small",
|
|
9811
|
+
disabled: !p.value && e.kind === "text" && !g.value.trim(),
|
|
9812
|
+
onClick: (t) => ne(e)
|
|
9813
|
+
}, null, 8, [
|
|
9814
|
+
"label",
|
|
9815
|
+
"disabled",
|
|
9816
|
+
"onClick"
|
|
9817
|
+
])])
|
|
9818
|
+
])) : i("", !0)]))), 128))]))])]),
|
|
9736
9819
|
_: 1
|
|
9737
9820
|
}, 8, [
|
|
9738
9821
|
"open",
|
|
@@ -9741,10 +9824,10 @@ var tf = { class: "w-full" }, nf = {
|
|
|
9741
9824
|
"close-label"
|
|
9742
9825
|
]));
|
|
9743
9826
|
}
|
|
9744
|
-
}),
|
|
9827
|
+
}), oh = {
|
|
9745
9828
|
key: 0,
|
|
9746
9829
|
class: "chat-status-overlay"
|
|
9747
|
-
},
|
|
9830
|
+
}, sh = { class: "chat-status-overlay__card" }, ch = { key: 0 }, lh = { key: 1 }, uh = { key: 2 }, dh = { key: 3 }, fh = /* @__PURE__ */ sd(/* @__PURE__ */ u({
|
|
9748
9831
|
__name: "ChatStatusOverlay",
|
|
9749
9832
|
props: {
|
|
9750
9833
|
visible: { type: Boolean },
|
|
@@ -9757,9 +9840,9 @@ var tf = { class: "w-full" }, nf = {
|
|
|
9757
9840
|
messages: {}
|
|
9758
9841
|
},
|
|
9759
9842
|
setup(e) {
|
|
9760
|
-
return (t, n) => e.visible ? (S(), a("div",
|
|
9843
|
+
return (t, n) => e.visible ? (S(), a("div", oh, [o("div", sh, [e.offlineMode ? (S(), a("span", ch, k(e.messages.waitingForNetwork), 1)) : e.connected ? e.loading ? (S(), a("span", uh, k(e.messages.loading), 1)) : e.notFound ? (S(), a("span", dh, k(e.messages.notFound), 1)) : e.isEmpty && e.showEmptySlot ? E(t.$slots, "no-messages", { key: 4 }, () => [o("span", null, k(e.messages.noMessages), 1)], !0) : i("", !0) : (S(), a("span", lh, k(e.messages.connecting), 1))])])) : i("", !0);
|
|
9761
9844
|
}
|
|
9762
|
-
}), [["__scopeId", "data-v-20316f96"]]),
|
|
9845
|
+
}), [["__scopeId", "data-v-20316f96"]]), ph = /* @__PURE__ */ u({
|
|
9763
9846
|
__name: "BccChat",
|
|
9764
9847
|
props: {
|
|
9765
9848
|
client: { default: null },
|
|
@@ -9819,7 +9902,7 @@ var tf = { class: "w-full" }, nf = {
|
|
|
9819
9902
|
});
|
|
9820
9903
|
return n;
|
|
9821
9904
|
}
|
|
9822
|
-
let p = t, m = u, { t: h } =
|
|
9905
|
+
let p = t, m = u, { t: h } = q(() => p.language), v = w(null), x = w(!1), C = w(!1), T = n(() => p.client ?? $.value ?? null), D = n(() => !!p.chatUid), O = n(() => {
|
|
9823
9906
|
if (p.conversation !== void 0) return p.conversation;
|
|
9824
9907
|
let e = T.value;
|
|
9825
9908
|
return e ? p.chatUid ? e.conversations.value.find((e) => e.targetId === p.chatUid || e.id === p.chatUid) ?? null : e.activeConversation.value : null;
|
|
@@ -9891,7 +9974,7 @@ var tf = { class: "w-full" }, nf = {
|
|
|
9891
9974
|
}), F(() => p.chatMessageGetter, (e) => {
|
|
9892
9975
|
jl.setGetChatMessagesCallback(e);
|
|
9893
9976
|
}, { immediate: !0 }), F(() => p.language, (e) => {
|
|
9894
|
-
e &&
|
|
9977
|
+
e && Re(e);
|
|
9895
9978
|
}, { immediate: !0 }), F(P.isChatEmpty, (e) => {
|
|
9896
9979
|
e && m("chatEmpty");
|
|
9897
9980
|
}), F([
|
|
@@ -9955,7 +10038,7 @@ var tf = { class: "w-full" }, nf = {
|
|
|
9955
10038
|
_: 1
|
|
9956
10039
|
})) : i("", !0),
|
|
9957
10040
|
T.value ? (S(), a(e, { key: 1 }, [
|
|
9958
|
-
l(
|
|
10041
|
+
l(am, {
|
|
9959
10042
|
target: "main",
|
|
9960
10043
|
class: g(["h-full", t.containerClass]),
|
|
9961
10044
|
"hide-group-actions": t.hideGroupActions,
|
|
@@ -9964,7 +10047,7 @@ var tf = { class: "w-full" }, nf = {
|
|
|
9964
10047
|
"action-message-row-class": t.actionMessageRowClass,
|
|
9965
10048
|
onAnchorclick: H
|
|
9966
10049
|
}, s({
|
|
9967
|
-
composer: I(() => [l(
|
|
10050
|
+
composer: I(() => [l(qd, {
|
|
9968
10051
|
ref_key: "mainComposerRef",
|
|
9969
10052
|
ref: z,
|
|
9970
10053
|
target: "main"
|
|
@@ -9981,7 +10064,7 @@ var tf = { class: "w-full" }, nf = {
|
|
|
9981
10064
|
"action-message-class",
|
|
9982
10065
|
"action-message-row-class"
|
|
9983
10066
|
]),
|
|
9984
|
-
l(
|
|
10067
|
+
l(cf, {
|
|
9985
10068
|
open: !!j(P).activeThreadParentMessage.value,
|
|
9986
10069
|
title: j(h)("threadWithCount", { count: j(P).activeThreadParentMessage.value?.replyCount ?? 0 }),
|
|
9987
10070
|
subtitle: O.value?.title ?? "",
|
|
@@ -9989,13 +10072,13 @@ var tf = { class: "w-full" }, nf = {
|
|
|
9989
10072
|
"close-aria-label": j(h)("closeThread"),
|
|
9990
10073
|
onClose: o[0] ||= (e) => j(re).emit("ui:closeThread")
|
|
9991
10074
|
}, {
|
|
9992
|
-
default: I(() => [l(
|
|
10075
|
+
default: I(() => [l(am, {
|
|
9993
10076
|
target: "thread",
|
|
9994
10077
|
class: "min-h-0 flex-1",
|
|
9995
10078
|
"action-message-class": t.actionMessageClass,
|
|
9996
10079
|
"action-message-row-class": t.actionMessageRowClass
|
|
9997
10080
|
}, {
|
|
9998
|
-
composer: I(() => [l(
|
|
10081
|
+
composer: I(() => [l(qd, {
|
|
9999
10082
|
ref_key: "threadComposerRef",
|
|
10000
10083
|
ref: ne,
|
|
10001
10084
|
target: "thread"
|
|
@@ -10010,7 +10093,7 @@ var tf = { class: "w-full" }, nf = {
|
|
|
10010
10093
|
"close-label",
|
|
10011
10094
|
"close-aria-label"
|
|
10012
10095
|
]),
|
|
10013
|
-
l(
|
|
10096
|
+
l(ah, {
|
|
10014
10097
|
open: j(R).showScheduledMessages.value,
|
|
10015
10098
|
loading: j(R).loadingScheduledMessages.value,
|
|
10016
10099
|
messages: j(R).scheduledMessages.value,
|
|
@@ -10025,7 +10108,7 @@ var tf = { class: "w-full" }, nf = {
|
|
|
10025
10108
|
"messages",
|
|
10026
10109
|
"conversation-title"
|
|
10027
10110
|
]),
|
|
10028
|
-
l(
|
|
10111
|
+
l(Im, {
|
|
10029
10112
|
open: !!j(R).infoMessage.value,
|
|
10030
10113
|
message: j(R).infoMessage.value,
|
|
10031
10114
|
receipts: j(R).infoMessageReceipts.value,
|
|
@@ -10040,7 +10123,7 @@ var tf = { class: "w-full" }, nf = {
|
|
|
10040
10123
|
"error"
|
|
10041
10124
|
])
|
|
10042
10125
|
], 64)) : i("", !0),
|
|
10043
|
-
l(
|
|
10126
|
+
l(fh, {
|
|
10044
10127
|
visible: D.value && (T.value?.offlineMode.value || !T.value?.connected.value || C.value && !te.value || x.value || t.displayNoMessagesText && j(P).isChatEmpty.value),
|
|
10045
10128
|
"offline-mode": !!(T.value?.offlineMode.value && !O.value),
|
|
10046
10129
|
connected: !!(T.value?.connected.value || O.value),
|
|
@@ -10072,6 +10155,6 @@ var tf = { class: "w-full" }, nf = {
|
|
|
10072
10155
|
}
|
|
10073
10156
|
});
|
|
10074
10157
|
//#endregion
|
|
10075
|
-
export {
|
|
10158
|
+
export { ph as BccChat, ph as BccChatMessageList, Yc as LogSeverity, jl as chat, jl as default, ks as createChatClient };
|
|
10076
10159
|
|
|
10077
10160
|
//# sourceMappingURL=vue-bcc-chat-ui.js.map
|