@talkjs/web-components 0.1.3 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/default.cjs +9 -9
- package/default.d.ts +4 -1
- package/default.js +89 -86
- package/package.json +1 -1
package/default.d.ts
CHANGED
|
@@ -1367,6 +1367,7 @@ export { ParticipantSnapshot }
|
|
|
1367
1367
|
* PopoverButton component that renders a popover triggered by a button.
|
|
1368
1368
|
*
|
|
1369
1369
|
* Usage:
|
|
1370
|
+
* ```tsx
|
|
1370
1371
|
* <PopoverButton
|
|
1371
1372
|
* popoverComponent={YourMenuComponent}
|
|
1372
1373
|
* popoverProps={{ prop1: value1, prop2: value2 }}
|
|
@@ -1374,10 +1375,12 @@ export { ParticipantSnapshot }
|
|
|
1374
1375
|
* >
|
|
1375
1376
|
* <Icon type="horizontalDots" />
|
|
1376
1377
|
* </MenuButton>
|
|
1377
|
-
*
|
|
1378
|
+
* ```
|
|
1378
1379
|
* All props except for menuComponent and popoverProps are passed to the button element.
|
|
1379
1380
|
*
|
|
1380
1381
|
* the popoverComponent will also receive a closePopover prop. It's a function you can call to close the popover.
|
|
1382
|
+
*
|
|
1383
|
+
* @public
|
|
1381
1384
|
*/
|
|
1382
1385
|
export declare function PopoverButton<T extends object>(props: PopoverButtonProps<T>): JSX_2.Element;
|
|
1383
1386
|
|
package/default.js
CHANGED
|
@@ -1939,7 +1939,7 @@ function Ju(e) {
|
|
|
1939
1939
|
if (!pe.use) throw t;
|
|
1940
1940
|
pe.use(t);
|
|
1941
1941
|
}
|
|
1942
|
-
function
|
|
1942
|
+
function tt(e, t) {
|
|
1943
1943
|
let n;
|
|
1944
1944
|
if (dl.inObserver && Tt(e) && !(t != null && t.suspense)) return n = ze(e, t), t != null && t.suspense && n === void 0 && Ju(e), n;
|
|
1945
1945
|
try {
|
|
@@ -1986,10 +1986,10 @@ function xf(e, t, n, r, i) {
|
|
|
1986
1986
|
const A = E[0], _ = {}, O = Object.keys(A);
|
|
1987
1987
|
for (let S = 0; S < O.length; S++) {
|
|
1988
1988
|
const T = O[S], y = A[T], v = u && u.has(T);
|
|
1989
|
-
if (T === "children" && (K(y) || Tt(y))) _[T] =
|
|
1989
|
+
if (T === "children" && (K(y) || Tt(y))) _[T] = tt(y, { skipCheck: !0 });
|
|
1990
1990
|
else if (v || T.startsWith("$") || T.endsWith("$")) {
|
|
1991
1991
|
const I = v ? T : T.endsWith("$") ? T.slice(0, -1) : T.slice(1), g = i == null ? void 0 : i[I], D = g && Tt(y);
|
|
1992
|
-
if (_[I] = D && (g != null && g.selector) ? g.selector(_, y) :
|
|
1992
|
+
if (_[I] = D && (g != null && g.selector) ? g.selector(_, y) : tt(y), D && (g.defaultValue !== void 0 && _[I] === void 0 && (_[I] = g.defaultValue), g.handler && g.getValue)) {
|
|
1993
1993
|
const k = (C) => {
|
|
1994
1994
|
var w;
|
|
1995
1995
|
y.set(g.getValue(C)), (w = A[g.handler]) == null || w.call(A, C);
|
|
@@ -2001,7 +2001,7 @@ function xf(e, t, n, r, i) {
|
|
|
2001
2001
|
}
|
|
2002
2002
|
E[0] = _;
|
|
2003
2003
|
}
|
|
2004
|
-
return t ?
|
|
2004
|
+
return t ? tt(() => {
|
|
2005
2005
|
dl.inObserver = !0;
|
|
2006
2006
|
try {
|
|
2007
2007
|
return Reflect.apply(f, m, E);
|
|
@@ -2017,7 +2017,7 @@ var { findIDKey: F_, getNode: H_, optimized: U_ } = ks, Qu = /* @__PURE__ */ new
|
|
|
2017
2017
|
function hl({ each: e, optimized: t, item: n, itemProps: r, sortValues: i, children: o }) {
|
|
2018
2018
|
var s;
|
|
2019
2019
|
if (!e) return null;
|
|
2020
|
-
const a =
|
|
2020
|
+
const a = tt(() => e.get(!t || U_));
|
|
2021
2021
|
if (!n && o) {
|
|
2022
2022
|
const c = q();
|
|
2023
2023
|
c.current = o, n = J(() => {
|
|
@@ -2050,7 +2050,7 @@ function hl({ each: e, optimized: t, item: n, itemProps: r, sortValues: i, child
|
|
|
2050
2050
|
return l;
|
|
2051
2051
|
}
|
|
2052
2052
|
fn(function({ children: e }) {
|
|
2053
|
-
return
|
|
2053
|
+
return tt(() => ze(ze(e)), { skipCheck: !0 });
|
|
2054
2054
|
}, (e, t) => !t.scoped || e.children === t.children);
|
|
2055
2055
|
var td = /* @__PURE__ */ new Map(), ed = /* @__PURE__ */ new Map();
|
|
2056
2056
|
new Proxy({}, { get(e, t) {
|
|
@@ -10159,16 +10159,19 @@ const oS = En(/(?:^|\n)(?:\s*[-*+]\s+[^\n]+(?:\n|$))+/g, ([e]) => /* @__PURE__ *
|
|
|
10159
10159
|
return { type: "bulletlist", children: t };
|
|
10160
10160
|
}([e.startsWith(`
|
|
10161
10161
|
`) ? e.slice(1) : e])), sS = En(/^\s*[-*+]\s+([^\n]+)(?:\n|$)/gm, ([e, t]) => ({ type: "bulletpoint", children: [t] })), DE = (e) => {
|
|
10162
|
-
const t = /(?:^|[^-:/\w])([(+]?[0-9](?:[-_+ ().]?[0-9]){5,11}[0-9])(?:[^-:/\w]|$)/g
|
|
10163
|
-
let
|
|
10164
|
-
const
|
|
10165
|
-
for (const
|
|
10166
|
-
const
|
|
10167
|
-
|
|
10168
|
-
|
|
10169
|
-
|
|
10170
|
-
|
|
10171
|
-
|
|
10162
|
+
const t = /(?:^|[^-:/\w])([(+]?[0-9](?:[-_+ ().]?[0-9]){5,11}[0-9])(?:[^-:/\w]|$)/g, n = /^(\d{4})-(\d{4})$/;
|
|
10163
|
+
let r = 0;
|
|
10164
|
+
const i = [];
|
|
10165
|
+
for (const o of Us(e, t)) {
|
|
10166
|
+
const s = o[0], a = o[1], l = a.match(n);
|
|
10167
|
+
if (l && Number(l[1]) < Number(l[2]))
|
|
10168
|
+
continue;
|
|
10169
|
+
const c = s.startsWith(a) ? o.index : o.index + 1;
|
|
10170
|
+
c - r > 0 && i.push(e.substring(r, c));
|
|
10171
|
+
const u = AE("tel:" + a.replace(/[^0-9+]/g, ""), a);
|
|
10172
|
+
i.push(u), r = c + a.length;
|
|
10173
|
+
}
|
|
10174
|
+
return r < e.length && i.push(e.substring(r)), i;
|
|
10172
10175
|
}, OE = (e) => _E(e).flatMap((t) => typeof t == "string" ? Ua(t) : ["<", ...Ua(t.url), ...Ua("|" + t.children[0] + ">")]), Ua = (e) => {
|
|
10173
10176
|
const t = ZO.parse(e, { urls: !0, email: !0, phone: !1, hashtag: !1, mention: !1 }), n = [];
|
|
10174
10177
|
let r = 0;
|
|
@@ -10502,7 +10505,7 @@ function he(e) {
|
|
|
10502
10505
|
}, set value(r) {
|
|
10503
10506
|
n.current._value = r;
|
|
10504
10507
|
} });
|
|
10505
|
-
return
|
|
10508
|
+
return tt(() => {
|
|
10506
10509
|
if (!t.get()) return mS;
|
|
10507
10510
|
const r = typeof e == "function" ? e() : e.get();
|
|
10508
10511
|
return n.current.value = r, r;
|
|
@@ -10570,7 +10573,7 @@ const wl = "talkjs_drafts", AS = /* @__PURE__ */ function(e, t) {
|
|
|
10570
10573
|
s.match(/^\s*$/) ? delete o[i] : o[i] = s, qt.setItem(wl, JSON.stringify(o));
|
|
10571
10574
|
}), NE = (e, t, n) => `draft_${e}_${t}_${n}`;
|
|
10572
10575
|
function yE(e) {
|
|
10573
|
-
const t = ce(), n = lt(), r = An(), i =
|
|
10576
|
+
const t = ce(), n = lt(), r = An(), i = tt(n.referencedMessage$), o = tt(n.state$.userPermissions), s = ro(), { sendMessage: a } = z_(), l = tt(Ie(() => {
|
|
10574
10577
|
const u = s.state$.get();
|
|
10575
10578
|
return e.editMessageId === void 0 ? new id(u, a, e.attachFile, e.shareLocation, s.toggleEmojiPicker) : new id(u, e.onEditMessage, () => {
|
|
10576
10579
|
}, () => {
|
|
@@ -10588,7 +10591,7 @@ function yE(e) {
|
|
|
10588
10591
|
}({ appId: r.app.id, conversationId: r.conversation.id, meId: r.currentUser.id, setText: c, enabled: !e.editMessageId }), N(Gf.Provider, { value: { onClose: () => s.toggleEmojiPicker(!1), onEmojiSelected: (u) => s.selectEmoji(u) }, children: N(t.MessageField, { common: r, referencedMessage: i, permissions: o, editor: l, editMessageId: e.editMessageId }) });
|
|
10589
10592
|
}
|
|
10590
10593
|
function _S({ message: e }) {
|
|
10591
|
-
const t = lt(), n = oo(), r =
|
|
10594
|
+
const t = lt(), n = oo(), r = tt(t.state$.editingMessageId), i = J(() => He(e.content[0].children), [e]), o = Ie({ isEmpty: i.length === 0, isTyping: !1, atTextLimit: !1, characterCount: i.length, showEmojiPicker: !1, suggestEmojiQuery: void 0, suggestMentionQuery: void 0 }), s = J(() => new IE(o, t.device$, t.state$.userPermissions), [o, t]), a = Z(async () => {
|
|
10592
10595
|
const l = s.state$;
|
|
10593
10596
|
if (l.isEmpty.peek() || l.atTextLimit.peek()) return;
|
|
10594
10597
|
const c = s.getText();
|
|
@@ -10625,48 +10628,48 @@ function TS() {
|
|
|
10625
10628
|
return N(e.AfterMessages, { common: t });
|
|
10626
10629
|
}
|
|
10627
10630
|
function vS({ extConversationId: e }) {
|
|
10628
|
-
const t = io(), n = lt(), r = oo(), i = q(!0), o = q(null);
|
|
10631
|
+
const t = io(), n = lt(), r = oo(), i = q(!0), o = q(null), s = tt(() => !!n.state$.messages.child(e).loadedAll.get());
|
|
10629
10632
|
ge(() => {
|
|
10630
10633
|
i.current = o.current.scrollTop > -30;
|
|
10631
10634
|
}), z(() => {
|
|
10632
10635
|
i.current && (o.current.scrollTop = 0);
|
|
10633
10636
|
}), z(() => {
|
|
10634
|
-
const
|
|
10635
|
-
return
|
|
10637
|
+
const u = new IntersectionObserver((d) => n.state$.visibility.isInView.set(d[0].isIntersecting), { threshold: 0.9 });
|
|
10638
|
+
return u.observe(o.current), () => u.disconnect();
|
|
10636
10639
|
}, [n]), z(() => {
|
|
10637
|
-
const
|
|
10638
|
-
return document.addEventListener("visibilitychange",
|
|
10640
|
+
const u = () => n.state$.visibility.tabFocused.set(!document.hidden);
|
|
10641
|
+
return document.addEventListener("visibilitychange", u), () => document.removeEventListener("visibilitychange", u);
|
|
10639
10642
|
}, [n]);
|
|
10640
|
-
const [
|
|
10643
|
+
const [a, l] = it(!1);
|
|
10641
10644
|
z(() => {
|
|
10642
|
-
|
|
10643
|
-
const
|
|
10644
|
-
(
|
|
10645
|
-
Zo.warn("Could not mark conversation as read",
|
|
10645
|
+
l(!1);
|
|
10646
|
+
const u = n.state$.currentConversation.peek();
|
|
10647
|
+
(u == null ? void 0 : u.isUnread) === !0 && t.conversation(e).markAsRead().catch((d) => {
|
|
10648
|
+
Zo.warn("Could not mark conversation as read", d);
|
|
10646
10649
|
});
|
|
10647
|
-
}, [e, t, n]), Wr((
|
|
10650
|
+
}, [e, t, n]), Wr((u) => {
|
|
10648
10651
|
if (!o.current) return;
|
|
10649
|
-
const
|
|
10650
|
-
if (
|
|
10651
|
-
if (
|
|
10652
|
-
if (!
|
|
10653
|
-
const
|
|
10654
|
-
if (
|
|
10652
|
+
const d = n.state$.currentConversation.get(), h = !(!d || !d.isUnread), p = d == null ? void 0 : d.unreadMessageCount;
|
|
10653
|
+
if (h && p === 0) return void l(!0);
|
|
10654
|
+
if (h && a) return;
|
|
10655
|
+
if (!h) return void l(!1);
|
|
10656
|
+
const f = n.state$.visibility.tabFocused.get(), m = n.state$.visibility.isInView.get(), E = function(A) {
|
|
10657
|
+
if (A.checkVisibility) return A.checkVisibility({ contentVisibilityAuto: !0, opacityProperty: !0, visibilityProperty: !0, checkOpacity: !0, checkVisibilityCSS: !0 });
|
|
10655
10658
|
{
|
|
10656
|
-
const
|
|
10657
|
-
return !(
|
|
10659
|
+
const _ = window.getComputedStyle(A), O = _.visibility, S = _.opacity;
|
|
10660
|
+
return !(A.getClientRects().length === 0 || O === "hidden" || S === "0");
|
|
10658
10661
|
}
|
|
10659
10662
|
}(o.current);
|
|
10660
|
-
return
|
|
10663
|
+
return f && m && E ? t.conversation(d.id).markAsRead() : void 0;
|
|
10661
10664
|
});
|
|
10662
|
-
const
|
|
10663
|
-
const
|
|
10664
|
-
|
|
10665
|
+
const c = Z((u) => {
|
|
10666
|
+
const d = u.currentTarget;
|
|
10667
|
+
d.scrollHeight - d.clientHeight + d.scrollTop < 90 && n.messageSubscription && n.messageSubscription.loadMore(10);
|
|
10665
10668
|
}, [n.messageSubscription]);
|
|
10666
|
-
return N("div", { className: "t-message-list", ref: o, "t-menu-boundary": "", onScroll:
|
|
10669
|
+
return N("div", { className: "t-message-list", ref: o, "t-menu-boundary": "", onScroll: c, children: [N(TS, {}), N(hl, { each: n.chatItems$, children: (u) => N("div", { className: "t-message-group", children: N(hl, { each: u, item: RS, itemProps: { controller: r, extConversationId: e } }) }) }), s && N(SS, {})] });
|
|
10667
10670
|
}
|
|
10668
10671
|
function RS({ item$: e }) {
|
|
10669
|
-
const t = lt(), n =
|
|
10672
|
+
const t = lt(), n = tt(e), r = tt(t.state$.editingMessageId);
|
|
10670
10673
|
return n instanceof pl ? N(DS, { timestamp: n.timestamp, isReadMarker: n.isReadMarker, isDayMarker: n.isDayMarker }) : r === n.id ? N(_S, { message: n }) : N(OS, { message: n });
|
|
10671
10674
|
}
|
|
10672
10675
|
function ds(e) {
|
|
@@ -10681,7 +10684,7 @@ function CS(e) {
|
|
|
10681
10684
|
return N(t.Icon, { common: n, ...e });
|
|
10682
10685
|
}
|
|
10683
10686
|
function $c() {
|
|
10684
|
-
return N(ds, { type: "spinner", "aria-label":
|
|
10687
|
+
return N(ds, { type: "spinner", "aria-label": tt(lt().t$).LOADING, className: "t-loading-icon" });
|
|
10685
10688
|
}
|
|
10686
10689
|
const NS = /* @__PURE__ */ new Set(["ByV39eoc", "B1FxElnd", "aW4c49tW", "qGfuGtx", "SbERe5ee", "ilaVEa15", "FOlWOSaH", "dao5gGmT", "DLUgAhzL", "fqXFumr6", "FtiWHMYT", "66iWOyWt", "1375amYi", "mWbJgzpt", "jO7GqAvL", "SkFIKxo5", "2z4ILc3y", "aDr8oPL1", "Hku1c4Pt"]);
|
|
10687
10690
|
function $s({ appId: e, chatboxState: t }) {
|
|
@@ -10708,13 +10711,13 @@ function $s({ appId: e, chatboxState: t }) {
|
|
|
10708
10711
|
}, [t]), N("div", { className: "t-panel t-error-panel", children: [N("span", { className: "t-heading", children: "Something went wrong." }), N("p", { children: "Please reload the page and try again." }), N("p", n ? { style: { fontStyle: "italic" }, children: ["Developer note: check your browser's developer tools console for messages that may help solve the problem.", N("br", {}), N("small", { children: "This message only shows up in test mode." })] } : { className: "text-balance", children: "If things keep not working, do not hesitate to get in touch with us." })] });
|
|
10709
10712
|
}
|
|
10710
10713
|
function yS() {
|
|
10711
|
-
return N("div", { className: "t-panel t-error-panel", children: N("span", { className: "t-heading", style: { fontStyle: "italic" }, children:
|
|
10714
|
+
return N("div", { className: "t-panel t-error-panel", children: N("span", { className: "t-heading", style: { fontStyle: "italic" }, children: tt(lt().t$).CHAT_NOT_FOUND }) });
|
|
10712
10715
|
}
|
|
10713
10716
|
function bE() {
|
|
10714
10717
|
return N("div", { className: "t-panel t-loading-panel", children: N($c, {}) });
|
|
10715
10718
|
}
|
|
10716
10719
|
function kE() {
|
|
10717
|
-
const e =
|
|
10720
|
+
const e = tt(lt().t$);
|
|
10718
10721
|
return N("div", { className: "t-panel t-error-panel", children: [N("span", { className: "t-heading", style: { fontStyle: "italic" }, children: e.AUTH_EXPIRED_OVERLAY_TITLE }), N("p", { children: e.AUTH_EXPIRED_OVERLAY_DESCRIPTION })] });
|
|
10719
10722
|
}
|
|
10720
10723
|
const bS = () => !0;
|
|
@@ -12096,7 +12099,7 @@ class zi extends HS {
|
|
|
12096
12099
|
}
|
|
12097
12100
|
}
|
|
12098
12101
|
function Yc({ src: e, onError: t, filename: n, className: r = "" }) {
|
|
12099
|
-
const i = q(null), o = q(), s = q(), [a, l] = it(!1), [c, u] = it(0), [d, h] = it(1), p = q(), [f, m] = it(!1), E =
|
|
12102
|
+
const i = q(null), o = q(), s = q(), [a, l] = it(!1), [c, u] = it(0), [d, h] = it(1), p = q(), [f, m] = it(!1), E = tt(lt().t$);
|
|
12100
12103
|
z(() => {
|
|
12101
12104
|
o.current = new Audio();
|
|
12102
12105
|
const O = { normalize: !0, height: 50, container: i.current };
|
|
@@ -12268,13 +12271,13 @@ function zc(e) {
|
|
|
12268
12271
|
}
|
|
12269
12272
|
function t0({ id: e, text: t }) {
|
|
12270
12273
|
var i;
|
|
12271
|
-
const n = lt(), r =
|
|
12274
|
+
const n = lt(), r = tt(() => {
|
|
12272
12275
|
var a;
|
|
12273
12276
|
if (n.type === "ConversationListStore") return;
|
|
12274
12277
|
const o = n.state$.extCurrentConversationId.get(), s = o && n.state$.participants.child(o).get();
|
|
12275
12278
|
return (a = s == null ? void 0 : s.find((l) => l.user.id === e)) == null ? void 0 : a.user;
|
|
12276
12279
|
});
|
|
12277
|
-
return N("span", { className: "t-mention", "t-is-current-user":
|
|
12280
|
+
return N("span", { className: "t-mention", "t-is-current-user": tt(n.extUserId$) === e ? "" : void 0, children: `@${(i = r == null ? void 0 : r.name) != null ? i : t}` });
|
|
12278
12281
|
}
|
|
12279
12282
|
function e0({ message: e, type: t, action: n, params: r, children: i }) {
|
|
12280
12283
|
const o = oo(), s = Z((l) => {
|
|
@@ -12451,7 +12454,7 @@ function jh(e, t) {
|
|
|
12451
12454
|
function BE({ block: e, nonInteractive: t, message: n, className: r = "" }) {
|
|
12452
12455
|
const i = !t, { nodes: o, roleOptions: s } = function(l, c) {
|
|
12453
12456
|
var _;
|
|
12454
|
-
const u = lt(), d =
|
|
12457
|
+
const u = lt(), d = tt(u.app$.role);
|
|
12455
12458
|
rt.defined(d);
|
|
12456
12459
|
const h = c.type === "UserMessage", p = ((_ = c.sender) == null ? void 0 : _.id) === u.extUserId$.peek(), f = d.suppressContactInfo, m = h && f.shouldSuppress({ isContentBySender: p }), E = s0(l.children, { contactInfo: m ? "suppress" : "link", suppression: f }), A = { sameTabLinkRules: d.sameTabLinkRules, contactInfoHiddenText: d.suppressContactInfo.replacement || `(${u.t$.peek().CONTACT_INFORMATION_HIDDEN})` };
|
|
12457
12460
|
return { nodes: E, roleOptions: A };
|
|
@@ -12461,7 +12464,7 @@ function BE({ block: e, nonInteractive: t, message: n, className: r = "" }) {
|
|
|
12461
12464
|
return dt("span", { className: `t-text ${r}` }, ...a);
|
|
12462
12465
|
}
|
|
12463
12466
|
function a0(e) {
|
|
12464
|
-
const t = ce(), n = lt(), { className: r = "", ...i } = e, o =
|
|
12467
|
+
const t = ce(), n = lt(), { className: r = "", ...i } = e, o = tt(() => n.state$.messages.child(n.state$.extCurrentConversationId.get()).lookup.child(e.message.id).content.child(0).url.get());
|
|
12465
12468
|
return N("div", { className: `t-message-content ${r}`, children: e.message.content.map((s) => {
|
|
12466
12469
|
var a;
|
|
12467
12470
|
return N(l0, { block: s, theme: t, downloadUrl: o, ...i }, e.message.createdAt + ((a = e.message.editedAt) != null ? a : 0));
|
|
@@ -12555,7 +12558,7 @@ function Gc() {
|
|
|
12555
12558
|
}
|
|
12556
12559
|
const za = {};
|
|
12557
12560
|
function jE(e) {
|
|
12558
|
-
const { onClose: t, onEmojiSelected: n } = G_(), r = q(null), i =
|
|
12561
|
+
const { onClose: t, onEmojiSelected: n } = G_(), r = q(null), i = tt(lt().t$), o = Gc();
|
|
12559
12562
|
return z(() => {
|
|
12560
12563
|
if (!o) return;
|
|
12561
12564
|
rt.defined(r.current);
|
|
@@ -12806,7 +12809,7 @@ function XE({ focused: e, setFocused: t, buttonId: n }) {
|
|
|
12806
12809
|
return { containerProps: i, itemProps: o };
|
|
12807
12810
|
}
|
|
12808
12811
|
function m0(e) {
|
|
12809
|
-
const [t, n] = it([]), [r, i] = it([]), [o, s] = it(0), [a, l] = it(0), c = Gc(), u = J(() => (c == null ? void 0 : c.value) && new c.value.Database({ dataSource: c.value.dataSource }), [c]), d = ro(), h =
|
|
12812
|
+
const [t, n] = it([]), [r, i] = it([]), [o, s] = it(0), [a, l] = it(0), c = Gc(), u = J(() => (c == null ? void 0 : c.value) && new c.value.Database({ dataSource: c.value.dataSource }), [c]), d = ro(), h = tt(d.state$.suggestEmojiQuery);
|
|
12810
12813
|
z(() => {
|
|
12811
12814
|
u && (h ? async function() {
|
|
12812
12815
|
const _ = await u.getPreferredSkinTone();
|
|
@@ -14104,7 +14107,7 @@ function lp(e) {
|
|
|
14104
14107
|
return typeof e == "string" ? document.querySelector(e) : e;
|
|
14105
14108
|
}
|
|
14106
14109
|
function dT(e) {
|
|
14107
|
-
const t = lt(), n = ro(), r =
|
|
14110
|
+
const t = lt(), n = ro(), r = tt(n.state$.suggestMentionQuery), i = wE(tt(t.state$.extCurrentConversationId), r ? 1e3 : 0), o = J(() => (i != null ? i : []).map((E) => E.user), [i]), [s, a] = it(0), l = J(() => Object.fromEntries(o.map((E) => [E.id, mD(E.name)])), [o]), c = J(() => {
|
|
14108
14111
|
if (!r) return [];
|
|
14109
14112
|
const E = cp(r);
|
|
14110
14113
|
return E === "" ? o : o.filter((A) => l[A.id].some((_) => function(O, S) {
|
|
@@ -14330,11 +14333,11 @@ function DT({ uploadState: e }) {
|
|
|
14330
14333
|
z(() => {
|
|
14331
14334
|
t && r.current.focus();
|
|
14332
14335
|
}, [t]);
|
|
14333
|
-
const i =
|
|
14336
|
+
const i = tt(lt().t$);
|
|
14334
14337
|
return N(DA, { className: "t-upload-preview", children: N("div", { className: "t-preview", children: [!n && N(OT, { upload: e.upload, uploaded: t }), n && N("div", { className: "t-error-row", children: i.UPLOAD_ERROR }), N("div", { className: "t-send-row", children: [N("button", { className: "t-cancel", onClick: () => e.closePreview("cancel"), children: i.CANCEL }), !n && t && N("button", { className: "t-confirm-send test__confirm-upload-button", onClick: () => e.closePreview("send"), ref: r, children: i.SEND_BUTTON_TEXT })] })] }) });
|
|
14335
14338
|
}
|
|
14336
14339
|
function OT({ upload: e, uploaded: t }) {
|
|
14337
|
-
const n =
|
|
14340
|
+
const n = tt(lt().t$);
|
|
14338
14341
|
return e.type !== "location" ? N(Pt, { children: [N(TT, { upload: e }), N(vT, { upload: e, uploaded: t, t: n })] }) : t ? N(ST, { location: e.location }) : N("div", { className: "t-loading", children: N($c, {}) });
|
|
14339
14342
|
}
|
|
14340
14343
|
function ST({ location: e }) {
|
|
@@ -14360,7 +14363,7 @@ function RT(e) {
|
|
|
14360
14363
|
return N("video", { ...n });
|
|
14361
14364
|
}
|
|
14362
14365
|
function IT() {
|
|
14363
|
-
const e = ce(), t = lt(), n = An(), r =
|
|
14366
|
+
const e = ce(), t = lt(), n = An(), r = tt(t.state$.isUserConnected), i = tt(t.state$.userPermissions);
|
|
14364
14367
|
return N(e.ChatHeader, { common: n, isUserConnected: r, permissions: i });
|
|
14365
14368
|
}
|
|
14366
14369
|
function CT() {
|
|
@@ -14423,12 +14426,12 @@ function NT({ appId: e, chatHeaderVisible: t, messageFieldVisible: n }) {
|
|
|
14423
14426
|
clearTimeout(S);
|
|
14424
14427
|
};
|
|
14425
14428
|
} else _.set(A.get());
|
|
14426
|
-
}),
|
|
14429
|
+
}), tt(_);
|
|
14427
14430
|
}(), { attachFile: o, shareLocation: s, uploadState: a } = LS({ onClose: () => r.focus() });
|
|
14428
14431
|
z(() => {
|
|
14429
14432
|
r.uploadFile = o;
|
|
14430
14433
|
}, [r, o]);
|
|
14431
|
-
const [l, c] = it(!1), u = lt(), d =
|
|
14434
|
+
const [l, c] = it(!1), u = lt(), d = tt(() => u.app$.get() ? u.state$.userPermissions.canShareFile.get() : void 0), h = Z((m) => {
|
|
14432
14435
|
o(m.dataTransfer.files[0]), m.preventDefault(), c(!1);
|
|
14433
14436
|
}, [o]), p = Z((m) => {
|
|
14434
14437
|
m.preventDefault(), c(!0);
|
|
@@ -14742,11 +14745,11 @@ var Xl = { exports: {} };
|
|
|
14742
14745
|
this.size = L.size;
|
|
14743
14746
|
}
|
|
14744
14747
|
function mr(R, L) {
|
|
14745
|
-
var F = Js(R), j = !F && qs(R),
|
|
14748
|
+
var F = Js(R), j = !F && qs(R), et = !F && !j && nu(R), gt = !F && !j && !et && iu(R), mt = F || j || et || gt, Kt = mt ? function(Ft, en) {
|
|
14746
14749
|
for (var oe = -1, Er = Array(Ft); ++oe < Ft; ) Er[oe] = en(oe);
|
|
14747
14750
|
return Er;
|
|
14748
14751
|
}(R.length, String) : [], ie = Kt.length;
|
|
14749
|
-
for (var Dt in R) mt && (Dt == "length" ||
|
|
14752
|
+
for (var Dt in R) mt && (Dt == "length" || et && (Dt == "offset" || Dt == "parent") || gt && (Dt == "buffer" || Dt == "byteLength" || Dt == "byteOffset") || tu(Dt, ie)) || Kt.push(Dt);
|
|
14750
14753
|
return Kt;
|
|
14751
14754
|
}
|
|
14752
14755
|
function xe(R, L, F) {
|
|
@@ -14825,9 +14828,9 @@ var Xl = { exports: {} };
|
|
|
14825
14828
|
return F.set(R, L), this.size = F.size, this;
|
|
14826
14829
|
};
|
|
14827
14830
|
var bA = function(R, L, F) {
|
|
14828
|
-
for (var j = -1,
|
|
14831
|
+
for (var j = -1, et = Object(R), gt = F(R), mt = gt.length; mt--; ) {
|
|
14829
14832
|
var Kt = gt[++j];
|
|
14830
|
-
if (L(
|
|
14833
|
+
if (L(et[Kt], Kt, et) === !1) break;
|
|
14831
14834
|
}
|
|
14832
14835
|
return R;
|
|
14833
14836
|
};
|
|
@@ -14836,11 +14839,11 @@ var Xl = { exports: {} };
|
|
|
14836
14839
|
var F = g.call(L, Q), j = L[Q];
|
|
14837
14840
|
try {
|
|
14838
14841
|
L[Q] = void 0;
|
|
14839
|
-
var
|
|
14842
|
+
var et = !0;
|
|
14840
14843
|
} catch (mt) {
|
|
14841
14844
|
}
|
|
14842
14845
|
var gt = k.call(L);
|
|
14843
|
-
return
|
|
14846
|
+
return et && (F ? L[Q] = j : delete L[Q]), gt;
|
|
14844
14847
|
}(R) : function(L) {
|
|
14845
14848
|
return k.call(L);
|
|
14846
14849
|
}(R);
|
|
@@ -14866,18 +14869,18 @@ var Xl = { exports: {} };
|
|
|
14866
14869
|
}(R));
|
|
14867
14870
|
}
|
|
14868
14871
|
function LA(R) {
|
|
14869
|
-
if (!Fn(R)) return function(
|
|
14872
|
+
if (!Fn(R)) return function(et) {
|
|
14870
14873
|
var gt = [];
|
|
14871
|
-
if (
|
|
14874
|
+
if (et != null) for (var mt in Object(et)) gt.push(mt);
|
|
14872
14875
|
return gt;
|
|
14873
14876
|
}(R);
|
|
14874
14877
|
var L = eu(R), F = [];
|
|
14875
14878
|
for (var j in R) (j != "constructor" || !L && g.call(R, j)) && F.push(j);
|
|
14876
14879
|
return F;
|
|
14877
14880
|
}
|
|
14878
|
-
function Qc(R, L, F, j,
|
|
14881
|
+
function Qc(R, L, F, j, et) {
|
|
14879
14882
|
R !== L && bA(L, function(gt, mt) {
|
|
14880
|
-
if (
|
|
14883
|
+
if (et || (et = new _t()), Fn(gt)) (function(ie, Dt, Ft, en, oe, Er, oi) {
|
|
14881
14884
|
var Fe = Ks(ie, Ft), se = Ks(Dt, Ft), au = oi.get(se);
|
|
14882
14885
|
if (au) return void xe(ie, Ft, au);
|
|
14883
14886
|
var ue = Er ? Er(Fe, se, Ft + "", ie, Dt, oi) : void 0, si = ue === void 0;
|
|
@@ -14912,20 +14915,20 @@ var Xl = { exports: {} };
|
|
|
14912
14915
|
}
|
|
14913
14916
|
var cu;
|
|
14914
14917
|
si && (oi.set(se, ue), oe(ue, se, en, Er, oi), oi.delete(se)), xe(ie, Ft, ue);
|
|
14915
|
-
})(R, L, mt, F, Qc, j,
|
|
14918
|
+
})(R, L, mt, F, Qc, j, et);
|
|
14916
14919
|
else {
|
|
14917
|
-
var Kt = j ? j(Ks(R, mt), gt, mt + "", R, L,
|
|
14920
|
+
var Kt = j ? j(Ks(R, mt), gt, mt + "", R, L, et) : void 0;
|
|
14918
14921
|
Kt === void 0 && (Kt = gt), xe(R, mt, Kt);
|
|
14919
14922
|
}
|
|
14920
14923
|
}, ou);
|
|
14921
14924
|
}
|
|
14922
14925
|
function wA(R, L) {
|
|
14923
|
-
return PA(function(F, j,
|
|
14926
|
+
return PA(function(F, j, et) {
|
|
14924
14927
|
return j = re(j === void 0 ? F.length - 1 : j, 0), function() {
|
|
14925
14928
|
for (var gt = arguments, mt = -1, Kt = re(gt.length - j, 0), ie = Array(Kt); ++mt < Kt; ) ie[mt] = gt[j + mt];
|
|
14926
14929
|
mt = -1;
|
|
14927
14930
|
for (var Dt = Array(j + 1); ++mt < j; ) Dt[mt] = gt[mt];
|
|
14928
|
-
return Dt[j] =
|
|
14931
|
+
return Dt[j] = et(ie), function(Ft, en, oe) {
|
|
14929
14932
|
switch (oe.length) {
|
|
14930
14933
|
case 0:
|
|
14931
14934
|
return Ft.call(en);
|
|
@@ -14948,12 +14951,12 @@ var Xl = { exports: {} };
|
|
|
14948
14951
|
var F;
|
|
14949
14952
|
} : su;
|
|
14950
14953
|
function mo(R, L) {
|
|
14951
|
-
var F, j,
|
|
14952
|
-
return ((j = typeof (F = L)) == "string" || j == "number" || j == "symbol" || j == "boolean" ? F !== "__proto__" : F === null) ?
|
|
14954
|
+
var F, j, et = R.__data__;
|
|
14955
|
+
return ((j = typeof (F = L)) == "string" || j == "number" || j == "symbol" || j == "boolean" ? F !== "__proto__" : F === null) ? et[typeof L == "string" ? "string" : "hash"] : et.map;
|
|
14953
14956
|
}
|
|
14954
14957
|
function Xs(R, L) {
|
|
14955
|
-
var F = function(j,
|
|
14956
|
-
return j == null ? void 0 : j[
|
|
14958
|
+
var F = function(j, et) {
|
|
14959
|
+
return j == null ? void 0 : j[et];
|
|
14957
14960
|
}(R, L);
|
|
14958
14961
|
return kA(F) ? F : void 0;
|
|
14959
14962
|
}
|
|
@@ -14971,8 +14974,8 @@ var Xl = { exports: {} };
|
|
|
14971
14974
|
var PA = /* @__PURE__ */ function(R) {
|
|
14972
14975
|
var L = 0, F = 0;
|
|
14973
14976
|
return function() {
|
|
14974
|
-
var j = Me(),
|
|
14975
|
-
if (F = j,
|
|
14977
|
+
var j = Me(), et = 16 - (j - F);
|
|
14978
|
+
if (F = j, et > 0) {
|
|
14976
14979
|
if (++L >= 800) return arguments[0];
|
|
14977
14980
|
} else L = 0;
|
|
14978
14981
|
return R.apply(void 0, arguments);
|
|
@@ -15020,14 +15023,14 @@ var Xl = { exports: {} };
|
|
|
15020
15023
|
var ta, xA = (ta = function(R, L, F) {
|
|
15021
15024
|
Qc(R, L, F);
|
|
15022
15025
|
}, wA(function(R, L) {
|
|
15023
|
-
var F = -1, j = L.length,
|
|
15024
|
-
for (
|
|
15026
|
+
var F = -1, j = L.length, et = j > 1 ? L[j - 1] : void 0, gt = j > 2 ? L[2] : void 0;
|
|
15027
|
+
for (et = ta.length > 3 && typeof et == "function" ? (j--, et) : void 0, gt && function(Kt, ie, Dt) {
|
|
15025
15028
|
if (!Fn(Dt)) return !1;
|
|
15026
15029
|
var Ft = typeof ie;
|
|
15027
15030
|
return !!(Ft == "number" ? Zs(Dt) && tu(ie, Dt.length) : Ft == "string" && ie in Dt) && Eo(Dt[ie], Kt);
|
|
15028
|
-
}(L[0], L[1], gt) && (
|
|
15031
|
+
}(L[0], L[1], gt) && (et = j < 3 ? void 0 : et, j = 1), R = Object(R); ++F < j; ) {
|
|
15029
15032
|
var mt = L[F];
|
|
15030
|
-
mt && ta(R, mt, F,
|
|
15033
|
+
mt && ta(R, mt, F, et);
|
|
15031
15034
|
}
|
|
15032
15035
|
return R;
|
|
15033
15036
|
}));
|
|
@@ -15434,7 +15437,7 @@ Hr = new WeakMap(), Zt = new WeakSet(), on = function() {
|
|
|
15434
15437
|
return Gt(this, Hr).current.editorInternals;
|
|
15435
15438
|
};
|
|
15436
15439
|
function HT({ conversation: e }) {
|
|
15437
|
-
const t = lt(), n = io(), r = ce(), i = CE(), o =
|
|
15440
|
+
const t = lt(), n = io(), r = ce(), i = CE(), o = tt(t.extCurrentConversationId$), [s, a] = it([]);
|
|
15438
15441
|
return z(() => {
|
|
15439
15442
|
const l = n.conversation(e.id).subscribeParticipants(async (c) => {
|
|
15440
15443
|
c && a(c);
|
|
@@ -15514,7 +15517,7 @@ function BT({ appId: e }) {
|
|
|
15514
15517
|
clearTimeout(a);
|
|
15515
15518
|
};
|
|
15516
15519
|
} else o.set(i.get());
|
|
15517
|
-
}),
|
|
15520
|
+
}), tt(o);
|
|
15518
15521
|
}();
|
|
15519
15522
|
return t.type === "invisible-loading" ? N(Pt, {}) : t.type === "loading" ? N(bE, {}) : t.type === "unknown-user" || t.type === "auth-failed" || t.type === "wrong-app-id" || t.type === "server-error" || t.type === "unexpected-error" ? N($s, { appId: e, chatboxState: t }) : t.type == "expired-token" ? N(kE, {}) : t.type === "loaded" ? N(UT, {}) : N(Pt, {});
|
|
15520
15523
|
}
|