@gamention/pulse-elements 0.1.9 → 0.1.11
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/pulse-elements.cjs +94 -99
- package/dist/pulse-elements.js +327 -307
- package/package.json +3 -3
package/dist/pulse-elements.js
CHANGED
|
@@ -157,11 +157,11 @@ function pe({ context: s, subscribe: e }) {
|
|
|
157
157
|
}));
|
|
158
158
|
};
|
|
159
159
|
}
|
|
160
|
-
var Ot = Object.defineProperty, Rt = (s, e, t) => e in s ? Ot(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t,
|
|
160
|
+
var Ot = Object.defineProperty, Rt = (s, e, t) => e in s ? Ot(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t, x = (s, e, t) => Rt(s, typeof e != "symbol" ? e + "" : e, t);
|
|
161
161
|
const Lt = "ws://localhost:4567";
|
|
162
162
|
let je = class {
|
|
163
163
|
constructor() {
|
|
164
|
-
|
|
164
|
+
x(this, "handlers", /* @__PURE__ */ new Map());
|
|
165
165
|
}
|
|
166
166
|
on(e, t) {
|
|
167
167
|
this.handlers.has(e) || this.handlers.set(e, /* @__PURE__ */ new Set());
|
|
@@ -181,7 +181,7 @@ let je = class {
|
|
|
181
181
|
}
|
|
182
182
|
}, jt = class extends je {
|
|
183
183
|
constructor(e) {
|
|
184
|
-
super(),
|
|
184
|
+
super(), x(this, "ws", null), x(this, "endpoint"), x(this, "reconnectAttempt", 0), x(this, "reconnectTimer", null), x(this, "_state", "disconnected"), this.endpoint = e ?? Lt;
|
|
185
185
|
}
|
|
186
186
|
get state() {
|
|
187
187
|
return this._state;
|
|
@@ -218,7 +218,7 @@ let je = class {
|
|
|
218
218
|
}
|
|
219
219
|
}, zt = class extends je {
|
|
220
220
|
constructor() {
|
|
221
|
-
super(...arguments),
|
|
221
|
+
super(...arguments), x(this, "baseUrl", ""), x(this, "_user", null), x(this, "_users", /* @__PURE__ */ new Map()), x(this, "_presence", /* @__PURE__ */ new Map()), x(this, "_threads", /* @__PURE__ */ new Map()), x(this, "_reactions", /* @__PURE__ */ new Map()), x(this, "_notifications", []), x(this, "_activityLogs", []), x(this, "_typing", /* @__PURE__ */ new Map()), x(this, "_viewports", /* @__PURE__ */ new Map()), x(this, "_selections", /* @__PURE__ */ new Map());
|
|
222
222
|
}
|
|
223
223
|
get user() {
|
|
224
224
|
return this._user;
|
|
@@ -261,6 +261,26 @@ let je = class {
|
|
|
261
261
|
get selections() {
|
|
262
262
|
return this._selections;
|
|
263
263
|
}
|
|
264
|
+
/** Resolve a relative URL to absolute using baseUrl. */
|
|
265
|
+
resolveUrl(e) {
|
|
266
|
+
return !this.baseUrl || !e || e.startsWith("http://") || e.startsWith("https://") ? e : `${this.baseUrl}${e}`;
|
|
267
|
+
}
|
|
268
|
+
resolveAttachments(e) {
|
|
269
|
+
return e.map((t) => ({
|
|
270
|
+
...t,
|
|
271
|
+
url: this.resolveUrl(t.url),
|
|
272
|
+
thumbnailUrl: t.thumbnailUrl ? this.resolveUrl(t.thumbnailUrl) : void 0
|
|
273
|
+
}));
|
|
274
|
+
}
|
|
275
|
+
resolveComment(e) {
|
|
276
|
+
return !e.attachments || e.attachments.length === 0 ? e : { ...e, attachments: this.resolveAttachments(e.attachments) };
|
|
277
|
+
}
|
|
278
|
+
resolveThread(e) {
|
|
279
|
+
return {
|
|
280
|
+
...e,
|
|
281
|
+
comments: e.comments.map((t) => this.resolveComment(t))
|
|
282
|
+
};
|
|
283
|
+
}
|
|
264
284
|
handleMessage(e) {
|
|
265
285
|
switch (e.type) {
|
|
266
286
|
case "auth:ok":
|
|
@@ -270,7 +290,7 @@ let je = class {
|
|
|
270
290
|
for (const t of e.presence)
|
|
271
291
|
this._presence.set(t.user.id, t), this._users.set(t.user.id, t.user);
|
|
272
292
|
this._users.set(e.user.id, e.user), this._threads.clear();
|
|
273
|
-
for (const t of e.threads) this._threads.set(t.id, t);
|
|
293
|
+
for (const t of e.threads) this._threads.set(t.id, this.resolveThread(t));
|
|
274
294
|
this._notifications = e.notifications, this._reactions.clear();
|
|
275
295
|
for (const t of e.reactions) {
|
|
276
296
|
const i = this._reactions.get(t.targetId) ?? [];
|
|
@@ -299,18 +319,18 @@ let je = class {
|
|
|
299
319
|
this.emit("click", { userId: e.userId, position: e.position });
|
|
300
320
|
break;
|
|
301
321
|
case "thread:created":
|
|
302
|
-
this._threads.set(e.thread.id, e.thread), this.emit("threads", this.threads);
|
|
322
|
+
this._threads.set(e.thread.id, this.resolveThread(e.thread)), this.emit("threads", this.threads);
|
|
303
323
|
break;
|
|
304
324
|
case "comment:created": {
|
|
305
325
|
const t = this._threads.get(e.threadId);
|
|
306
|
-
t && (t.comments.push(e.comment), t.updatedAt = e.comment.createdAt, this.emit("threads", this.threads));
|
|
326
|
+
t && (t.comments.push(this.resolveComment(e.comment)), t.updatedAt = e.comment.createdAt, this.emit("threads", this.threads));
|
|
307
327
|
break;
|
|
308
328
|
}
|
|
309
329
|
case "comment:edited": {
|
|
310
330
|
const t = this._threads.get(e.threadId);
|
|
311
331
|
if (t) {
|
|
312
332
|
const i = t.comments.findIndex((n) => n.id === e.comment.id);
|
|
313
|
-
i !== -1 && (t.comments[i] = e.comment), this.emit("threads", this.threads);
|
|
333
|
+
i !== -1 && (t.comments[i] = this.resolveComment(e.comment)), this.emit("threads", this.threads);
|
|
314
334
|
}
|
|
315
335
|
break;
|
|
316
336
|
}
|
|
@@ -399,7 +419,7 @@ let je = class {
|
|
|
399
419
|
}, xt = class extends je {
|
|
400
420
|
constructor(e) {
|
|
401
421
|
var t;
|
|
402
|
-
super(),
|
|
422
|
+
super(), x(this, "state"), x(this, "connection"), x(this, "config"), x(this, "heartbeatTimer", null), x(this, "lastCursorSend", 0), x(this, "pendingCursor", null), x(this, "cursorTimer", null), this.config = e, this.state = new zt(), this.state.baseUrl = (e.endpoint ?? "").replace(/^ws(s?):/, "http$1:").replace(/\/$/, "");
|
|
403
423
|
const i = ((t = e.endpoint) == null ? void 0 : t.replace(/^http/, "ws")) ?? void 0;
|
|
404
424
|
this.connection = new jt(i), this.connection.on("message", (n) => {
|
|
405
425
|
this.state.handleMessage(n), this.emit(n.type, n);
|
|
@@ -529,10 +549,11 @@ let je = class {
|
|
|
529
549
|
body: i
|
|
530
550
|
});
|
|
531
551
|
if (!n.ok) {
|
|
532
|
-
const
|
|
533
|
-
throw new Error(
|
|
552
|
+
const r = await n.json().catch(() => ({ error: "Upload failed" }));
|
|
553
|
+
throw new Error(r.error ?? "Upload failed");
|
|
534
554
|
}
|
|
535
|
-
|
|
555
|
+
const o = await n.json();
|
|
556
|
+
return o.url && !o.url.startsWith("http") && (o.url = `${t}${o.url}`), o.thumbnailUrl && !o.thumbnailUrl.startsWith("http") && (o.thumbnailUrl = `${t}${o.thumbnailUrl}`), o;
|
|
536
557
|
}
|
|
537
558
|
// ── Presence control ──
|
|
538
559
|
setAppearOffline(e) {
|
|
@@ -563,7 +584,7 @@ let yt = class {
|
|
|
563
584
|
return this.cssText;
|
|
564
585
|
}
|
|
565
586
|
};
|
|
566
|
-
const Ut = (s) => new yt(typeof s == "string" ? s : s + "", void 0, Ue),
|
|
587
|
+
const Ut = (s) => new yt(typeof s == "string" ? s : s + "", void 0, Ue), A = (s, ...e) => {
|
|
567
588
|
const t = s.length === 1 ? s[0] : e.reduce((i, n, o) => i + ((r) => {
|
|
568
589
|
if (r._$cssResult$ === !0) return r.cssText;
|
|
569
590
|
if (typeof r == "number") return r;
|
|
@@ -586,7 +607,7 @@ const Ut = (s) => new yt(typeof s == "string" ? s : s + "", void 0, Ue), I = (s,
|
|
|
586
607
|
* Copyright 2017 Google LLC
|
|
587
608
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
588
609
|
*/
|
|
589
|
-
const { is: Ht, defineProperty:
|
|
610
|
+
const { is: Ht, defineProperty: Nt, getOwnPropertyDescriptor: Bt, getOwnPropertyNames: Ft, getOwnPropertySymbols: Vt, getPrototypeOf: qt } = Object, U = globalThis, Ge = U.trustedTypes, Wt = Ge ? Ge.emptyScript : "", Te = U.reactiveElementPolyfillSupport, ie = (s, e) => s, we = { toAttribute(s, e) {
|
|
590
611
|
switch (e) {
|
|
591
612
|
case Boolean:
|
|
592
613
|
s = s ? Wt : null;
|
|
@@ -626,11 +647,11 @@ let Y = class extends HTMLElement {
|
|
|
626
647
|
static createProperty(e, t = Ze) {
|
|
627
648
|
if (t.state && (t.attribute = !1), this._$Ei(), this.prototype.hasOwnProperty(e) && ((t = Object.create(t)).wrapped = !0), this.elementProperties.set(e, t), !t.noAccessor) {
|
|
628
649
|
const i = Symbol(), n = this.getPropertyDescriptor(e, i, t);
|
|
629
|
-
n !== void 0 &&
|
|
650
|
+
n !== void 0 && Nt(this.prototype, e, n);
|
|
630
651
|
}
|
|
631
652
|
}
|
|
632
653
|
static getPropertyDescriptor(e, t, i) {
|
|
633
|
-
const { get: n, set: o } =
|
|
654
|
+
const { get: n, set: o } = Bt(this.prototype, e) ?? { get() {
|
|
634
655
|
return this[t];
|
|
635
656
|
}, set(r) {
|
|
636
657
|
this[t] = r;
|
|
@@ -645,13 +666,13 @@ let Y = class extends HTMLElement {
|
|
|
645
666
|
}
|
|
646
667
|
static _$Ei() {
|
|
647
668
|
if (this.hasOwnProperty(ie("elementProperties"))) return;
|
|
648
|
-
const e =
|
|
669
|
+
const e = qt(this);
|
|
649
670
|
e.finalize(), e.l !== void 0 && (this.l = [...e.l]), this.elementProperties = new Map(e.elementProperties);
|
|
650
671
|
}
|
|
651
672
|
static finalize() {
|
|
652
673
|
if (this.hasOwnProperty(ie("finalized"))) return;
|
|
653
674
|
if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(ie("properties"))) {
|
|
654
|
-
const t = this.properties, i = [...Ft(t), ...
|
|
675
|
+
const t = this.properties, i = [...Ft(t), ...Vt(t)];
|
|
655
676
|
for (const n of i) this.createProperty(n, t[n]);
|
|
656
677
|
}
|
|
657
678
|
const e = this[Symbol.metadata];
|
|
@@ -827,7 +848,7 @@ Y.elementStyles = [], Y.shadowRootOptions = { mode: "open" }, Y[ie("elementPrope
|
|
|
827
848
|
*/
|
|
828
849
|
const se = globalThis, Je = (s) => s, $e = se.trustedTypes, Qe = $e ? $e.createPolicy("lit-html", { createHTML: (s) => s }) : void 0, wt = "$lit$", z = `lit$${Math.random().toFixed(9).slice(2)}$`, $t = "?" + z, Xt = `<${$t}>`, F = document, oe = () => F.createComment(""), re = (s) => s === null || typeof s != "object" && typeof s != "function", He = Array.isArray, Yt = (s) => He(s) || typeof (s == null ? void 0 : s[Symbol.iterator]) == "function", Se = `[
|
|
829
850
|
\f\r]`, te = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, et = /-->/g, tt = />/g, H = RegExp(`>|${Se}(?:([^\\s"'>=/]+)(${Se}*=${Se}*(?:[^
|
|
830
|
-
\f\r"'\`<>=]|("|')|))|$)`, "g"), it = /'/g, st = /"/g, kt = /^(?:script|style|textarea|title)$/i, Et = (s) => (e, ...t) => ({ _$litType$: s, strings: e, values: t }), h = Et(1), Kt = Et(2),
|
|
851
|
+
\f\r"'\`<>=]|("|')|))|$)`, "g"), it = /'/g, st = /"/g, kt = /^(?:script|style|textarea|title)$/i, Et = (s) => (e, ...t) => ({ _$litType$: s, strings: e, values: t }), h = Et(1), Kt = Et(2), V = Symbol.for("lit-noChange"), f = Symbol.for("lit-nothing"), nt = /* @__PURE__ */ new WeakMap(), N = F.createTreeWalker(F, 129);
|
|
831
852
|
function Ct(s, e) {
|
|
832
853
|
if (!He(s) || !s.hasOwnProperty("raw")) throw Error("invalid template strings array");
|
|
833
854
|
return Qe !== void 0 ? Qe.createHTML(e) : e;
|
|
@@ -839,8 +860,8 @@ const Gt = (s, e) => {
|
|
|
839
860
|
const a = s[l];
|
|
840
861
|
let c, p, d = -1, u = 0;
|
|
841
862
|
for (; u < a.length && (r.lastIndex = u, p = r.exec(a), p !== null); ) u = r.lastIndex, r === te ? p[1] === "!--" ? r = et : p[1] !== void 0 ? r = tt : p[2] !== void 0 ? (kt.test(p[2]) && (n = RegExp("</" + p[2], "g")), r = H) : p[3] !== void 0 && (r = H) : r === H ? p[0] === ">" ? (r = n ?? te, d = -1) : p[1] === void 0 ? d = -2 : (d = r.lastIndex - p[2].length, c = p[1], r = p[3] === void 0 ? H : p[3] === '"' ? st : it) : r === st || r === it ? r = H : r === et || r === tt ? r = te : (r = H, n = void 0);
|
|
842
|
-
const
|
|
843
|
-
o += r === te ? a + Xt : d >= 0 ? (i.push(c), a.slice(0, d) + wt + a.slice(d) + z +
|
|
863
|
+
const m = r === H && s[l + 1].startsWith("/>") ? " " : "";
|
|
864
|
+
o += r === te ? a + Xt : d >= 0 ? (i.push(c), a.slice(0, d) + wt + a.slice(d) + z + m) : a + z + (d === -2 ? l : m);
|
|
844
865
|
}
|
|
845
866
|
return [Ct(s, o + (s[t] || "<?>") + (e === 2 ? "</svg>" : e === 3 ? "</math>" : "")), i];
|
|
846
867
|
};
|
|
@@ -850,21 +871,21 @@ class ae {
|
|
|
850
871
|
this.parts = [];
|
|
851
872
|
let o = 0, r = 0;
|
|
852
873
|
const l = e.length - 1, a = this.parts, [c, p] = Gt(e, t);
|
|
853
|
-
if (this.el = ae.createElement(c, i),
|
|
874
|
+
if (this.el = ae.createElement(c, i), N.currentNode = this.el.content, t === 2 || t === 3) {
|
|
854
875
|
const d = this.el.content.firstChild;
|
|
855
876
|
d.replaceWith(...d.childNodes);
|
|
856
877
|
}
|
|
857
|
-
for (; (n =
|
|
878
|
+
for (; (n = N.nextNode()) !== null && a.length < l; ) {
|
|
858
879
|
if (n.nodeType === 1) {
|
|
859
880
|
if (n.hasAttributes()) for (const d of n.getAttributeNames()) if (d.endsWith(wt)) {
|
|
860
|
-
const u = p[r++],
|
|
861
|
-
a.push({ type: 1, index: o, name: b[2], strings:
|
|
881
|
+
const u = p[r++], m = n.getAttribute(d).split(z), b = /([.?@])?(.*)/.exec(u);
|
|
882
|
+
a.push({ type: 1, index: o, name: b[2], strings: m, ctor: b[1] === "." ? Jt : b[1] === "?" ? Qt : b[1] === "@" ? ei : Ee }), n.removeAttribute(d);
|
|
862
883
|
} else d.startsWith(z) && (a.push({ type: 6, index: o }), n.removeAttribute(d));
|
|
863
884
|
if (kt.test(n.tagName)) {
|
|
864
885
|
const d = n.textContent.split(z), u = d.length - 1;
|
|
865
886
|
if (u > 0) {
|
|
866
887
|
n.textContent = $e ? $e.emptyScript : "";
|
|
867
|
-
for (let
|
|
888
|
+
for (let m = 0; m < u; m++) n.append(d[m], oe()), N.nextNode(), a.push({ type: 2, index: ++o });
|
|
868
889
|
n.append(d[u], oe());
|
|
869
890
|
}
|
|
870
891
|
}
|
|
@@ -883,7 +904,7 @@ class ae {
|
|
|
883
904
|
}
|
|
884
905
|
function K(s, e, t = s, i) {
|
|
885
906
|
var r, l;
|
|
886
|
-
if (e ===
|
|
907
|
+
if (e === V) return e;
|
|
887
908
|
let n = i !== void 0 ? (r = t._$Co) == null ? void 0 : r[i] : t._$Cl;
|
|
888
909
|
const o = re(e) ? void 0 : e._$litDirective$;
|
|
889
910
|
return (n == null ? void 0 : n.constructor) !== o && ((l = n == null ? void 0 : n._$AO) == null || l.call(n, !1), o === void 0 ? n = void 0 : (n = new o(s), n._$AT(s, t, i)), i !== void 0 ? (t._$Co ?? (t._$Co = []))[i] = n : t._$Cl = n), n !== void 0 && (e = K(s, n._$AS(s, e.values), n, i)), e;
|
|
@@ -900,16 +921,16 @@ class Zt {
|
|
|
900
921
|
}
|
|
901
922
|
u(e) {
|
|
902
923
|
const { el: { content: t }, parts: i } = this._$AD, n = ((e == null ? void 0 : e.creationScope) ?? F).importNode(t, !0);
|
|
903
|
-
|
|
904
|
-
let o =
|
|
924
|
+
N.currentNode = n;
|
|
925
|
+
let o = N.nextNode(), r = 0, l = 0, a = i[0];
|
|
905
926
|
for (; a !== void 0; ) {
|
|
906
927
|
if (r === a.index) {
|
|
907
928
|
let c;
|
|
908
929
|
a.type === 2 ? c = new ue(o, o.nextSibling, this, e) : a.type === 1 ? c = new a.ctor(o, a.name, a.strings, this, e) : a.type === 6 && (c = new ti(o, this, e)), this._$AV.push(c), a = i[++l];
|
|
909
930
|
}
|
|
910
|
-
r !== (a == null ? void 0 : a.index) && (o =
|
|
931
|
+
r !== (a == null ? void 0 : a.index) && (o = N.nextNode(), r++);
|
|
911
932
|
}
|
|
912
|
-
return
|
|
933
|
+
return N.currentNode = F, n;
|
|
913
934
|
}
|
|
914
935
|
p(e) {
|
|
915
936
|
let t = 0;
|
|
@@ -922,7 +943,7 @@ class ue {
|
|
|
922
943
|
return ((e = this._$AM) == null ? void 0 : e._$AU) ?? this._$Cv;
|
|
923
944
|
}
|
|
924
945
|
constructor(e, t, i, n) {
|
|
925
|
-
this.type = 2, this._$AH =
|
|
946
|
+
this.type = 2, this._$AH = f, this._$AN = void 0, this._$AA = e, this._$AB = t, this._$AM = i, this.options = n, this._$Cv = (n == null ? void 0 : n.isConnected) ?? !0;
|
|
926
947
|
}
|
|
927
948
|
get parentNode() {
|
|
928
949
|
let e = this._$AA.parentNode;
|
|
@@ -936,7 +957,7 @@ class ue {
|
|
|
936
957
|
return this._$AB;
|
|
937
958
|
}
|
|
938
959
|
_$AI(e, t = this) {
|
|
939
|
-
e = K(this, e, t), re(e) ? e ===
|
|
960
|
+
e = K(this, e, t), re(e) ? e === f || e == null || e === "" ? (this._$AH !== f && this._$AR(), this._$AH = f) : e !== this._$AH && e !== V && this._(e) : e._$litType$ !== void 0 ? this.$(e) : e.nodeType !== void 0 ? this.T(e) : Yt(e) ? this.k(e) : this._(e);
|
|
940
961
|
}
|
|
941
962
|
O(e) {
|
|
942
963
|
return this._$AA.parentNode.insertBefore(e, this._$AB);
|
|
@@ -945,7 +966,7 @@ class ue {
|
|
|
945
966
|
this._$AH !== e && (this._$AR(), this._$AH = this.O(e));
|
|
946
967
|
}
|
|
947
968
|
_(e) {
|
|
948
|
-
this._$AH !==
|
|
969
|
+
this._$AH !== f && re(this._$AH) ? this._$AA.nextSibling.data = e : this.T(F.createTextNode(e)), this._$AH = e;
|
|
949
970
|
}
|
|
950
971
|
$(e) {
|
|
951
972
|
var o;
|
|
@@ -987,21 +1008,21 @@ class Ee {
|
|
|
987
1008
|
return this._$AM._$AU;
|
|
988
1009
|
}
|
|
989
1010
|
constructor(e, t, i, n, o) {
|
|
990
|
-
this.type = 1, this._$AH =
|
|
1011
|
+
this.type = 1, this._$AH = f, this._$AN = void 0, this.element = e, this.name = t, this._$AM = n, this.options = o, i.length > 2 || i[0] !== "" || i[1] !== "" ? (this._$AH = Array(i.length - 1).fill(new String()), this.strings = i) : this._$AH = f;
|
|
991
1012
|
}
|
|
992
1013
|
_$AI(e, t = this, i, n) {
|
|
993
1014
|
const o = this.strings;
|
|
994
1015
|
let r = !1;
|
|
995
|
-
if (o === void 0) e = K(this, e, t, 0), r = !re(e) || e !== this._$AH && e !==
|
|
1016
|
+
if (o === void 0) e = K(this, e, t, 0), r = !re(e) || e !== this._$AH && e !== V, r && (this._$AH = e);
|
|
996
1017
|
else {
|
|
997
1018
|
const l = e;
|
|
998
1019
|
let a, c;
|
|
999
|
-
for (e = o[0], a = 0; a < o.length - 1; a++) c = K(this, l[i + a], t, a), c ===
|
|
1020
|
+
for (e = o[0], a = 0; a < o.length - 1; a++) c = K(this, l[i + a], t, a), c === V && (c = this._$AH[a]), r || (r = !re(c) || c !== this._$AH[a]), c === f ? e = f : e !== f && (e += (c ?? "") + o[a + 1]), this._$AH[a] = c;
|
|
1000
1021
|
}
|
|
1001
1022
|
r && !n && this.j(e);
|
|
1002
1023
|
}
|
|
1003
1024
|
j(e) {
|
|
1004
|
-
e ===
|
|
1025
|
+
e === f ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, e ?? "");
|
|
1005
1026
|
}
|
|
1006
1027
|
}
|
|
1007
1028
|
class Jt extends Ee {
|
|
@@ -1009,7 +1030,7 @@ class Jt extends Ee {
|
|
|
1009
1030
|
super(...arguments), this.type = 3;
|
|
1010
1031
|
}
|
|
1011
1032
|
j(e) {
|
|
1012
|
-
this.element[this.name] = e ===
|
|
1033
|
+
this.element[this.name] = e === f ? void 0 : e;
|
|
1013
1034
|
}
|
|
1014
1035
|
}
|
|
1015
1036
|
class Qt extends Ee {
|
|
@@ -1017,7 +1038,7 @@ class Qt extends Ee {
|
|
|
1017
1038
|
super(...arguments), this.type = 4;
|
|
1018
1039
|
}
|
|
1019
1040
|
j(e) {
|
|
1020
|
-
this.element.toggleAttribute(this.name, !!e && e !==
|
|
1041
|
+
this.element.toggleAttribute(this.name, !!e && e !== f);
|
|
1021
1042
|
}
|
|
1022
1043
|
}
|
|
1023
1044
|
class ei extends Ee {
|
|
@@ -1025,8 +1046,8 @@ class ei extends Ee {
|
|
|
1025
1046
|
super(e, t, i, n, o), this.type = 5;
|
|
1026
1047
|
}
|
|
1027
1048
|
_$AI(e, t = this) {
|
|
1028
|
-
if ((e = K(this, e, t, 0) ??
|
|
1029
|
-
const i = this._$AH, n = e ===
|
|
1049
|
+
if ((e = K(this, e, t, 0) ?? f) === V) return;
|
|
1050
|
+
const i = this._$AH, n = e === f && i !== f || e.capture !== i.capture || e.once !== i.once || e.passive !== i.passive, o = e !== f && (i === f || n);
|
|
1030
1051
|
n && this.element.removeEventListener(this.name, this, i), o && this.element.addEventListener(this.name, this, e), this._$AH = e;
|
|
1031
1052
|
}
|
|
1032
1053
|
handleEvent(e) {
|
|
@@ -1061,8 +1082,8 @@ const ii = (s, e, t) => {
|
|
|
1061
1082
|
* Copyright 2017 Google LLC
|
|
1062
1083
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
1063
1084
|
*/
|
|
1064
|
-
const
|
|
1065
|
-
let
|
|
1085
|
+
const B = globalThis;
|
|
1086
|
+
let T = class extends Y {
|
|
1066
1087
|
constructor() {
|
|
1067
1088
|
super(...arguments), this.renderOptions = { host: this }, this._$Do = void 0;
|
|
1068
1089
|
}
|
|
@@ -1084,14 +1105,14 @@ let S = class extends Y {
|
|
|
1084
1105
|
super.disconnectedCallback(), (e = this._$Do) == null || e.setConnected(!1);
|
|
1085
1106
|
}
|
|
1086
1107
|
render() {
|
|
1087
|
-
return
|
|
1108
|
+
return V;
|
|
1088
1109
|
}
|
|
1089
1110
|
};
|
|
1090
1111
|
var bt;
|
|
1091
|
-
|
|
1092
|
-
const Ae =
|
|
1093
|
-
Ae == null || Ae({ LitElement:
|
|
1094
|
-
(
|
|
1112
|
+
T._$litElement$ = !0, T.finalized = !0, (bt = B.litElementHydrateSupport) == null || bt.call(B, { LitElement: T });
|
|
1113
|
+
const Ae = B.litElementPolyfillSupport;
|
|
1114
|
+
Ae == null || Ae({ LitElement: T });
|
|
1115
|
+
(B.litElementVersions ?? (B.litElementVersions = [])).push("4.2.2");
|
|
1095
1116
|
/**
|
|
1096
1117
|
* @license
|
|
1097
1118
|
* Copyright 2017 Google LLC
|
|
@@ -1148,7 +1169,7 @@ var oi = Object.defineProperty, ri = Object.getOwnPropertyDescriptor, J = (s, e,
|
|
|
1148
1169
|
(r = s[o]) && (n = (i ? r(e, t, n) : r(n)) || n);
|
|
1149
1170
|
return i && n && oi(e, t, n), n;
|
|
1150
1171
|
};
|
|
1151
|
-
let
|
|
1172
|
+
let q = class extends T {
|
|
1152
1173
|
constructor() {
|
|
1153
1174
|
super(...arguments), this.apiKey = "", this.token = "", this.room = "";
|
|
1154
1175
|
}
|
|
@@ -1172,28 +1193,28 @@ let V = class extends S {
|
|
|
1172
1193
|
};
|
|
1173
1194
|
J([
|
|
1174
1195
|
g({ attribute: "api-key" })
|
|
1175
|
-
],
|
|
1196
|
+
], q.prototype, "apiKey", 2);
|
|
1176
1197
|
J([
|
|
1177
1198
|
g()
|
|
1178
|
-
],
|
|
1199
|
+
], q.prototype, "token", 2);
|
|
1179
1200
|
J([
|
|
1180
1201
|
g()
|
|
1181
|
-
],
|
|
1202
|
+
], q.prototype, "room", 2);
|
|
1182
1203
|
J([
|
|
1183
1204
|
g()
|
|
1184
|
-
],
|
|
1205
|
+
], q.prototype, "endpoint", 2);
|
|
1185
1206
|
J([
|
|
1186
1207
|
Mt({ context: Z })
|
|
1187
|
-
],
|
|
1188
|
-
|
|
1208
|
+
], q.prototype, "client", 2);
|
|
1209
|
+
q = J([
|
|
1189
1210
|
R("pulse-provider")
|
|
1190
|
-
],
|
|
1211
|
+
], q);
|
|
1191
1212
|
var ai = Object.defineProperty, li = Object.getOwnPropertyDescriptor, Ce = (s, e, t, i) => {
|
|
1192
1213
|
for (var n = i > 1 ? void 0 : i ? li(e, t) : e, o = s.length - 1, r; o >= 0; o--)
|
|
1193
1214
|
(r = s[o]) && (n = (i ? r(e, t, n) : r(n)) || n);
|
|
1194
1215
|
return i && n && ai(e, t, n), n;
|
|
1195
1216
|
};
|
|
1196
|
-
let G = class extends
|
|
1217
|
+
let G = class extends T {
|
|
1197
1218
|
constructor() {
|
|
1198
1219
|
super(...arguments), this.maxVisible = 5, this.users = [];
|
|
1199
1220
|
}
|
|
@@ -1237,7 +1258,7 @@ let G = class extends S {
|
|
|
1237
1258
|
`;
|
|
1238
1259
|
}
|
|
1239
1260
|
};
|
|
1240
|
-
G.styles =
|
|
1261
|
+
G.styles = A`
|
|
1241
1262
|
:host {
|
|
1242
1263
|
display: inline-flex;
|
|
1243
1264
|
align-items: center;
|
|
@@ -1354,12 +1375,12 @@ Ce([
|
|
|
1354
1375
|
G = Ce([
|
|
1355
1376
|
R("pulse-presence")
|
|
1356
1377
|
], G);
|
|
1357
|
-
var ci = Object.defineProperty, di = Object.getOwnPropertyDescriptor,
|
|
1378
|
+
var ci = Object.defineProperty, di = Object.getOwnPropertyDescriptor, Ne = (s, e, t, i) => {
|
|
1358
1379
|
for (var n = i > 1 ? void 0 : i ? di(e, t) : e, o = s.length - 1, r; o >= 0; o--)
|
|
1359
1380
|
(r = s[o]) && (n = (i ? r(e, t, n) : r(n)) || n);
|
|
1360
1381
|
return i && n && ci(e, t, n), n;
|
|
1361
1382
|
};
|
|
1362
|
-
let le = class extends
|
|
1383
|
+
let le = class extends T {
|
|
1363
1384
|
constructor() {
|
|
1364
1385
|
super(...arguments), this.cursors = /* @__PURE__ */ new Map(), this.unsubs = [], this.handleLocalCursor = (s) => {
|
|
1365
1386
|
var e;
|
|
@@ -1436,7 +1457,7 @@ let le = class extends S {
|
|
|
1436
1457
|
`;
|
|
1437
1458
|
}
|
|
1438
1459
|
};
|
|
1439
|
-
le.styles =
|
|
1460
|
+
le.styles = A`
|
|
1440
1461
|
:host {
|
|
1441
1462
|
position: fixed;
|
|
1442
1463
|
top: 0;
|
|
@@ -1473,14 +1494,14 @@ le.styles = I`
|
|
|
1473
1494
|
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
|
|
1474
1495
|
}
|
|
1475
1496
|
`;
|
|
1476
|
-
|
|
1497
|
+
Ne([
|
|
1477
1498
|
pe({ context: Z, subscribe: !0 }),
|
|
1478
1499
|
g({ attribute: !1 })
|
|
1479
1500
|
], le.prototype, "client", 2);
|
|
1480
|
-
|
|
1501
|
+
Ne([
|
|
1481
1502
|
v()
|
|
1482
1503
|
], le.prototype, "cursors", 2);
|
|
1483
|
-
le =
|
|
1504
|
+
le = Ne([
|
|
1484
1505
|
R("pulse-cursors")
|
|
1485
1506
|
], le);
|
|
1486
1507
|
var hi = Object.defineProperty, pi = Object.getOwnPropertyDescriptor, fe = (s, e, t, i) => {
|
|
@@ -1488,7 +1509,7 @@ var hi = Object.defineProperty, pi = Object.getOwnPropertyDescriptor, fe = (s, e
|
|
|
1488
1509
|
(r = s[o]) && (n = (i ? r(e, t, n) : r(n)) || n);
|
|
1489
1510
|
return i && n && hi(e, t, n), n;
|
|
1490
1511
|
};
|
|
1491
|
-
let W = class extends
|
|
1512
|
+
let W = class extends T {
|
|
1492
1513
|
constructor() {
|
|
1493
1514
|
super(...arguments), this.showResolved = !1, this.threads = [], this.replyingTo = null;
|
|
1494
1515
|
}
|
|
@@ -1557,7 +1578,7 @@ let W = class extends S {
|
|
|
1557
1578
|
${s.comments.map((e, t) => {
|
|
1558
1579
|
const i = this.getUserForComment(e.userId);
|
|
1559
1580
|
return h`
|
|
1560
|
-
${t > 0 ? h`<div class="divider"></div>` :
|
|
1581
|
+
${t > 0 ? h`<div class="divider"></div>` : f}
|
|
1561
1582
|
<div class="comment">
|
|
1562
1583
|
<div class="comment-header">
|
|
1563
1584
|
<div
|
|
@@ -1594,7 +1615,7 @@ let W = class extends S {
|
|
|
1594
1615
|
<input type="text" placeholder="Write a reply..." />
|
|
1595
1616
|
<button type="submit">Send</button>
|
|
1596
1617
|
</form>
|
|
1597
|
-
` :
|
|
1618
|
+
` : f}
|
|
1598
1619
|
</div>
|
|
1599
1620
|
`;
|
|
1600
1621
|
}
|
|
@@ -1606,7 +1627,7 @@ let W = class extends S {
|
|
|
1606
1627
|
return o < 24 ? `${o}h ago` : e.toLocaleDateString();
|
|
1607
1628
|
}
|
|
1608
1629
|
};
|
|
1609
|
-
W.styles =
|
|
1630
|
+
W.styles = A`
|
|
1610
1631
|
:host {
|
|
1611
1632
|
display: block;
|
|
1612
1633
|
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
|
|
@@ -1834,7 +1855,7 @@ fe([
|
|
|
1834
1855
|
W = fe([
|
|
1835
1856
|
R("pulse-comments")
|
|
1836
1857
|
], W);
|
|
1837
|
-
var ui = Object.defineProperty, fi = Object.getOwnPropertyDescriptor,
|
|
1858
|
+
var ui = Object.defineProperty, fi = Object.getOwnPropertyDescriptor, Be = (s, e, t, i) => {
|
|
1838
1859
|
for (var n = i > 1 ? void 0 : i ? fi(e, t) : e, o = s.length - 1, r; o >= 0; o--)
|
|
1839
1860
|
(r = s[o]) && (n = (i ? r(e, t, n) : r(n)) || n);
|
|
1840
1861
|
return i && n && ui(e, t, n), n;
|
|
@@ -1852,7 +1873,7 @@ const mi = {
|
|
|
1852
1873
|
"thread:resolved": "✅",
|
|
1853
1874
|
"reaction:added": "🎉"
|
|
1854
1875
|
};
|
|
1855
|
-
let ce = class extends
|
|
1876
|
+
let ce = class extends T {
|
|
1856
1877
|
constructor() {
|
|
1857
1878
|
super(...arguments), this.notifications = [];
|
|
1858
1879
|
}
|
|
@@ -1903,11 +1924,11 @@ let ce = class extends S {
|
|
|
1903
1924
|
<div class="header">
|
|
1904
1925
|
<span class="title">
|
|
1905
1926
|
Notifications
|
|
1906
|
-
${s > 0 ? h`<span class="badge">${s}</span>` :
|
|
1927
|
+
${s > 0 ? h`<span class="badge">${s}</span>` : f}
|
|
1907
1928
|
</span>
|
|
1908
1929
|
${s > 0 ? h`<button class="mark-all" @click=${() => this.client.markAllRead()}>
|
|
1909
1930
|
Mark all read
|
|
1910
|
-
</button>` :
|
|
1931
|
+
</button>` : f}
|
|
1911
1932
|
</div>
|
|
1912
1933
|
<div class="list">
|
|
1913
1934
|
${this.notifications.length === 0 ? h`<div class="empty">
|
|
@@ -1935,7 +1956,7 @@ let ce = class extends S {
|
|
|
1935
1956
|
`;
|
|
1936
1957
|
}
|
|
1937
1958
|
};
|
|
1938
|
-
ce.styles =
|
|
1959
|
+
ce.styles = A`
|
|
1939
1960
|
:host {
|
|
1940
1961
|
display: block;
|
|
1941
1962
|
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
|
|
@@ -2076,14 +2097,14 @@ ce.styles = I`
|
|
|
2076
2097
|
opacity: 0.4;
|
|
2077
2098
|
}
|
|
2078
2099
|
`;
|
|
2079
|
-
|
|
2100
|
+
Be([
|
|
2080
2101
|
pe({ context: Z, subscribe: !0 }),
|
|
2081
2102
|
g({ attribute: !1 })
|
|
2082
2103
|
], ce.prototype, "client", 2);
|
|
2083
|
-
|
|
2104
|
+
Be([
|
|
2084
2105
|
v()
|
|
2085
2106
|
], ce.prototype, "notifications", 2);
|
|
2086
|
-
ce =
|
|
2107
|
+
ce = Be([
|
|
2087
2108
|
R("pulse-notifications")
|
|
2088
2109
|
], ce);
|
|
2089
2110
|
var bi = Object.defineProperty, vi = Object.getOwnPropertyDescriptor, Q = (s, e, t, i) => {
|
|
@@ -2092,7 +2113,7 @@ var bi = Object.defineProperty, vi = Object.getOwnPropertyDescriptor, Q = (s, e,
|
|
|
2092
2113
|
return i && n && bi(e, t, n), n;
|
|
2093
2114
|
};
|
|
2094
2115
|
const xi = ["👍", "👎", "❤️", "🎉", "👀", "🚀"];
|
|
2095
|
-
let D = class extends
|
|
2116
|
+
let D = class extends T {
|
|
2096
2117
|
constructor() {
|
|
2097
2118
|
super(...arguments), this.targetId = "", this.targetType = "comment", this.reactions = [], this.showPicker = !1;
|
|
2098
2119
|
}
|
|
@@ -2161,12 +2182,12 @@ let D = class extends S {
|
|
|
2161
2182
|
`
|
|
2162
2183
|
)}
|
|
2163
2184
|
</div>
|
|
2164
|
-
` :
|
|
2185
|
+
` : f}
|
|
2165
2186
|
</div>
|
|
2166
2187
|
`;
|
|
2167
2188
|
}
|
|
2168
2189
|
};
|
|
2169
|
-
D.styles =
|
|
2190
|
+
D.styles = A`
|
|
2170
2191
|
:host {
|
|
2171
2192
|
display: inline-flex;
|
|
2172
2193
|
align-items: center;
|
|
@@ -2326,11 +2347,11 @@ class $i {
|
|
|
2326
2347
|
*/
|
|
2327
2348
|
class Ie extends $i {
|
|
2328
2349
|
constructor(e) {
|
|
2329
|
-
if (super(e), this.it =
|
|
2350
|
+
if (super(e), this.it = f, e.type !== yi.CHILD) throw Error(this.constructor.directiveName + "() can only be used in child bindings");
|
|
2330
2351
|
}
|
|
2331
2352
|
render(e) {
|
|
2332
|
-
if (e ===
|
|
2333
|
-
if (e ===
|
|
2353
|
+
if (e === f || e == null) return this._t = void 0, this.it = e;
|
|
2354
|
+
if (e === V) return e;
|
|
2334
2355
|
if (typeof e != "string") throw Error(this.constructor.directiveName + "() called with a non-string value");
|
|
2335
2356
|
if (e === this.it) return this._t;
|
|
2336
2357
|
this.it = e;
|
|
@@ -2532,7 +2553,7 @@ function Li(s) {
|
|
|
2532
2553
|
return `<${e} ${i}/>`;
|
|
2533
2554
|
}).join("");
|
|
2534
2555
|
}
|
|
2535
|
-
function
|
|
2556
|
+
function k(s, e = 18) {
|
|
2536
2557
|
return Kt`<svg
|
|
2537
2558
|
xmlns="http://www.w3.org/2000/svg"
|
|
2538
2559
|
width="${e}"
|
|
@@ -2545,7 +2566,7 @@ function E(s, e = 18) {
|
|
|
2545
2566
|
stroke-linejoin="round"
|
|
2546
2567
|
>${ki(Li(s))}</svg>`;
|
|
2547
2568
|
}
|
|
2548
|
-
const ee =
|
|
2569
|
+
const ee = A`
|
|
2549
2570
|
* {
|
|
2550
2571
|
box-sizing: border-box;
|
|
2551
2572
|
margin: 0;
|
|
@@ -2588,7 +2609,7 @@ const ee = I`
|
|
|
2588
2609
|
--pw-shadow: var(--pulse-shadow);
|
|
2589
2610
|
--pw-shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.16), 0 2px 8px rgba(0, 0, 0, 0.08);
|
|
2590
2611
|
}
|
|
2591
|
-
`, ge =
|
|
2612
|
+
`, ge = A`
|
|
2592
2613
|
.pw-btn {
|
|
2593
2614
|
display: inline-flex;
|
|
2594
2615
|
align-items: center;
|
|
@@ -2632,7 +2653,7 @@ const ee = I`
|
|
|
2632
2653
|
width: 18px;
|
|
2633
2654
|
height: 18px;
|
|
2634
2655
|
}
|
|
2635
|
-
`, _e =
|
|
2656
|
+
`, _e = A`
|
|
2636
2657
|
.pw-scrollable::-webkit-scrollbar {
|
|
2637
2658
|
width: 4px;
|
|
2638
2659
|
}
|
|
@@ -2649,7 +2670,7 @@ var ji = Object.defineProperty, zi = Object.getOwnPropertyDescriptor, Fe = (s, e
|
|
|
2649
2670
|
(r = s[o]) && (n = (i ? r(e, t, n) : r(n)) || n);
|
|
2650
2671
|
return i && n && ji(e, t, n), n;
|
|
2651
2672
|
};
|
|
2652
|
-
let X = class extends
|
|
2673
|
+
let X = class extends T {
|
|
2653
2674
|
constructor() {
|
|
2654
2675
|
super(...arguments), this.items = [], this.unsubs = [], this.counter = 0;
|
|
2655
2676
|
}
|
|
@@ -2700,7 +2721,7 @@ let X = class extends S {
|
|
|
2700
2721
|
<div class="panel-header">
|
|
2701
2722
|
<span class="panel-title">Activity</span>
|
|
2702
2723
|
<button class="close-btn" @click=${this.fireClose} title="Close">
|
|
2703
|
-
${
|
|
2724
|
+
${k(me, 16)}
|
|
2704
2725
|
</button>
|
|
2705
2726
|
</div>
|
|
2706
2727
|
|
|
@@ -2735,7 +2756,7 @@ X.styles = [
|
|
|
2735
2756
|
ee,
|
|
2736
2757
|
ge,
|
|
2737
2758
|
_e,
|
|
2738
|
-
|
|
2759
|
+
A`
|
|
2739
2760
|
:host {
|
|
2740
2761
|
display: block;
|
|
2741
2762
|
}
|
|
@@ -2869,7 +2890,7 @@ Fe([
|
|
|
2869
2890
|
X = Fe([
|
|
2870
2891
|
R("pulse-widget-activity-panel")
|
|
2871
2892
|
], X);
|
|
2872
|
-
const Ui = "-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif", ot = "#6366f1", rt = "#e2e8f0", Di = "#f8fafc", Hi = "#e2e8f0", at = "#64748b", xe = 28,
|
|
2893
|
+
const Ui = "-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif", ot = "#6366f1", rt = "#e2e8f0", Di = "#f8fafc", Hi = "#e2e8f0", at = "#64748b", xe = 28, Ni = Array.from({ length: xe }, (s, e) => 0.2 + Math.abs(Math.sin(e * 12.9898 + 78.233) * 43758.5453) % 1 * 0.8);
|
|
2873
2894
|
function lt(s) {
|
|
2874
2895
|
const e = Math.max(0, Math.floor(s)), t = Math.floor(e / 60), i = e % 60;
|
|
2875
2896
|
return `${t}:${i.toString().padStart(2, "0")}`;
|
|
@@ -2948,8 +2969,8 @@ class Oe {
|
|
|
2948
2969
|
overflow: "hidden",
|
|
2949
2970
|
minWidth: "0"
|
|
2950
2971
|
});
|
|
2951
|
-
const
|
|
2952
|
-
Object.assign(
|
|
2972
|
+
const m = document.createElement("div");
|
|
2973
|
+
Object.assign(m.style, {
|
|
2953
2974
|
display: "flex",
|
|
2954
2975
|
alignItems: "center",
|
|
2955
2976
|
gap: "1.5px",
|
|
@@ -2957,41 +2978,41 @@ class Oe {
|
|
|
2957
2978
|
cursor: "pointer"
|
|
2958
2979
|
});
|
|
2959
2980
|
const b = [];
|
|
2960
|
-
for (let
|
|
2961
|
-
const
|
|
2962
|
-
Object.assign(
|
|
2981
|
+
for (let $ = 0; $ < xe; $++) {
|
|
2982
|
+
const P = document.createElement("div"), y = Math.round(Ni[$] * 20);
|
|
2983
|
+
Object.assign(P.style, {
|
|
2963
2984
|
flex: "1",
|
|
2964
|
-
height: `${Math.max(3,
|
|
2985
|
+
height: `${Math.max(3, y)}px`,
|
|
2965
2986
|
borderRadius: "1px",
|
|
2966
2987
|
background: rt,
|
|
2967
2988
|
transition: "background 0.1s ease",
|
|
2968
2989
|
minWidth: "0"
|
|
2969
|
-
}), b.push(
|
|
2990
|
+
}), b.push(P), m.appendChild(P);
|
|
2970
2991
|
}
|
|
2971
|
-
const
|
|
2972
|
-
Object.assign(
|
|
2992
|
+
const I = document.createElement("div");
|
|
2993
|
+
Object.assign(I.style, {
|
|
2973
2994
|
fontSize: "10px",
|
|
2974
2995
|
color: at,
|
|
2975
2996
|
whiteSpace: "nowrap",
|
|
2976
2997
|
lineHeight: "1"
|
|
2977
2998
|
});
|
|
2978
|
-
function
|
|
2979
|
-
const
|
|
2980
|
-
|
|
2999
|
+
function C() {
|
|
3000
|
+
const $ = lt(o), P = lt(n);
|
|
3001
|
+
I.textContent = `${$} / ${P}`;
|
|
2981
3002
|
}
|
|
2982
|
-
|
|
2983
|
-
function
|
|
2984
|
-
const
|
|
2985
|
-
for (let
|
|
2986
|
-
b[
|
|
3003
|
+
C(), u.appendChild(m), u.appendChild(I), l.appendChild(a), l.appendChild(u);
|
|
3004
|
+
function w() {
|
|
3005
|
+
const $ = n > 0 ? o / n : 0, P = Math.floor($ * xe);
|
|
3006
|
+
for (let y = 0; y < xe; y++)
|
|
3007
|
+
b[y].style.background = y <= P ? ot : rt;
|
|
2987
3008
|
}
|
|
2988
|
-
return
|
|
3009
|
+
return m.addEventListener("click", ($) => {
|
|
2989
3010
|
if (n <= 0) return;
|
|
2990
|
-
const
|
|
3011
|
+
const P = m.getBoundingClientRect(), y = Math.min(
|
|
2991
3012
|
1,
|
|
2992
|
-
Math.max(0, (
|
|
3013
|
+
Math.max(0, ($.clientX - P.left) / P.width)
|
|
2993
3014
|
);
|
|
2994
|
-
r.currentTime =
|
|
3015
|
+
r.currentTime = y * n, o = r.currentTime, w(), C();
|
|
2995
3016
|
}), a.addEventListener("click", () => {
|
|
2996
3017
|
i ? r.pause() : r.play().catch(() => {
|
|
2997
3018
|
});
|
|
@@ -3000,13 +3021,13 @@ class Oe {
|
|
|
3000
3021
|
}), r.addEventListener("pause", () => {
|
|
3001
3022
|
i = !1, p();
|
|
3002
3023
|
}), r.addEventListener("ended", () => {
|
|
3003
|
-
i = !1, p(), o = 0,
|
|
3024
|
+
i = !1, p(), o = 0, w(), C();
|
|
3004
3025
|
}), r.addEventListener("timeupdate", () => {
|
|
3005
|
-
o = r.currentTime,
|
|
3026
|
+
o = r.currentTime, w(), C();
|
|
3006
3027
|
}), r.addEventListener("loadedmetadata", () => {
|
|
3007
|
-
r.duration && isFinite(r.duration) && (n = r.duration,
|
|
3028
|
+
r.duration && isFinite(r.duration) && (n = r.duration, C());
|
|
3008
3029
|
}), r.addEventListener("durationchange", () => {
|
|
3009
|
-
r.duration && isFinite(r.duration) && (n = r.duration,
|
|
3030
|
+
r.duration && isFinite(r.duration) && (n = r.duration, C());
|
|
3010
3031
|
}), l;
|
|
3011
3032
|
}
|
|
3012
3033
|
}
|
|
@@ -3141,8 +3162,8 @@ class Re {
|
|
|
3141
3162
|
this.analyser.getByteFrequencyData(o), e.clearRect(0, 0, t, i);
|
|
3142
3163
|
const r = n, l = Math.max(2, t / r * 0.7), a = (t - l * r) / (r - 1 || 1);
|
|
3143
3164
|
for (let c = 0; c < r; c++) {
|
|
3144
|
-
const p = o[c] / 255, d = Math.max(2, p * i * 0.85), u = c * (l + a),
|
|
3145
|
-
e.fillStyle = `rgba(99, 102, 241, ${b})`, e.beginPath(), e.roundRect(u,
|
|
3165
|
+
const p = o[c] / 255, d = Math.max(2, p * i * 0.85), u = c * (l + a), m = (i - d) / 2, b = 0.4 + p * 0.6;
|
|
3166
|
+
e.fillStyle = `rgba(99, 102, 241, ${b})`, e.beginPath(), e.roundRect(u, m, l, d, 1), e.fill();
|
|
3146
3167
|
}
|
|
3147
3168
|
}
|
|
3148
3169
|
updateTimer() {
|
|
@@ -3160,7 +3181,7 @@ class Re {
|
|
|
3160
3181
|
this.recorder = null, this.container && (this.container.remove(), this.container = null), this.canvas = null, this.timerEl = null;
|
|
3161
3182
|
}
|
|
3162
3183
|
}
|
|
3163
|
-
const ct = 80,
|
|
3184
|
+
const ct = 80, Bi = "#e2e8f0", Fi = `
|
|
3164
3185
|
<svg width="28" height="28" viewBox="0 0 28 28" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
3165
3186
|
<circle cx="14" cy="14" r="14" fill="rgba(0,0,0,0.35)"/>
|
|
3166
3187
|
<polygon points="11,8 22,14 11,20" fill="rgba(255,255,255,0.9)"/>
|
|
@@ -3169,7 +3190,7 @@ const ct = 80, Ni = "#e2e8f0", Fi = `
|
|
|
3169
3190
|
<polygon points="11,5 6,9 2,9 2,15 6,15 11,19"/>
|
|
3170
3191
|
<line x1="23" y1="9" x2="17" y2="15"/>
|
|
3171
3192
|
<line x1="17" y1="9" x2="23" y2="15"/>
|
|
3172
|
-
</svg>`,
|
|
3193
|
+
</svg>`, Vi = `
|
|
3173
3194
|
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="rgba(255,255,255,0.9)" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg">
|
|
3174
3195
|
<polygon points="11,5 6,9 2,9 2,15 6,15 11,19"/>
|
|
3175
3196
|
<path d="M19.07 4.93a10 10 0 0 1 0 14.14"/>
|
|
@@ -3190,7 +3211,7 @@ class Tt {
|
|
|
3190
3211
|
width: `${ct}px`,
|
|
3191
3212
|
height: `${ct}px`,
|
|
3192
3213
|
borderRadius: "50%",
|
|
3193
|
-
border: `2px solid ${
|
|
3214
|
+
border: `2px solid ${Bi}`,
|
|
3194
3215
|
boxShadow: "0 2px 8px rgba(0,0,0,0.1)",
|
|
3195
3216
|
overflow: "hidden",
|
|
3196
3217
|
cursor: "pointer",
|
|
@@ -3240,7 +3261,7 @@ class Tt {
|
|
|
3240
3261
|
l.style.opacity = i ? "0" : "1";
|
|
3241
3262
|
}
|
|
3242
3263
|
function p() {
|
|
3243
|
-
a.style.display = i ? "flex" : "none", a.innerHTML = n ? dt :
|
|
3264
|
+
a.style.display = i ? "flex" : "none", a.innerHTML = n ? dt : Vi;
|
|
3244
3265
|
}
|
|
3245
3266
|
return o.addEventListener("click", (d) => {
|
|
3246
3267
|
d.stopPropagation(), i ? n ? (r.muted = !1, n = !1) : (r.pause(), i = !1, n = !0, r.muted = !0) : (r.muted = !0, n = !0, r.play().catch(() => {
|
|
@@ -3250,7 +3271,7 @@ class Tt {
|
|
|
3250
3271
|
}), o;
|
|
3251
3272
|
}
|
|
3252
3273
|
}
|
|
3253
|
-
const ht = 60,
|
|
3274
|
+
const ht = 60, qi = `
|
|
3254
3275
|
.vr-overlay {
|
|
3255
3276
|
display: flex;
|
|
3256
3277
|
flex-direction: column;
|
|
@@ -3436,7 +3457,7 @@ class Le {
|
|
|
3436
3457
|
}
|
|
3437
3458
|
// ── Private ──
|
|
3438
3459
|
buildUI(e) {
|
|
3439
|
-
this.styleEl = document.createElement("style"), this.styleEl.textContent =
|
|
3460
|
+
this.styleEl = document.createElement("style"), this.styleEl.textContent = qi, document.head.appendChild(this.styleEl), this.root = document.createElement("div"), this.root.className = "vr-overlay";
|
|
3440
3461
|
const t = document.createElement("div");
|
|
3441
3462
|
t.className = "vr-circle-wrapper";
|
|
3442
3463
|
const i = document.createElement("div");
|
|
@@ -3483,10 +3504,10 @@ class Le {
|
|
|
3483
3504
|
this.videoEl && (this.videoEl.srcObject = null, this.videoEl = null), this.root && this.root.parentElement && this.root.parentElement.removeChild(this.root), this.root = null, this.styleEl && this.styleEl.parentElement && this.styleEl.parentElement.removeChild(this.styleEl), this.styleEl = null, this.chunks = [], this.elapsed = 0;
|
|
3484
3505
|
}
|
|
3485
3506
|
}
|
|
3486
|
-
const
|
|
3507
|
+
const _ = class _ {
|
|
3487
3508
|
/** Opens a fullscreen lightbox overlay showing the image. */
|
|
3488
3509
|
static open(e) {
|
|
3489
|
-
|
|
3510
|
+
_.close();
|
|
3490
3511
|
const t = document.createElement("div");
|
|
3491
3512
|
t.id = "pulse-widget-lightbox", Object.assign(t.style, {
|
|
3492
3513
|
position: "fixed",
|
|
@@ -3530,7 +3551,7 @@ const T = class T {
|
|
|
3530
3551
|
}), i.addEventListener("mouseleave", () => {
|
|
3531
3552
|
i.style.background = "rgba(255,255,255,0.15)";
|
|
3532
3553
|
}), i.addEventListener("click", (r) => {
|
|
3533
|
-
r.stopPropagation(),
|
|
3554
|
+
r.stopPropagation(), _.close();
|
|
3534
3555
|
});
|
|
3535
3556
|
const n = document.createElement("img");
|
|
3536
3557
|
n.src = e, n.alt = "Lightbox image", Object.assign(n.style, {
|
|
@@ -3543,26 +3564,26 @@ const T = class T {
|
|
|
3543
3564
|
}), n.addEventListener("click", (r) => {
|
|
3544
3565
|
r.stopPropagation();
|
|
3545
3566
|
}), t.appendChild(i), t.appendChild(n), t.addEventListener("click", () => {
|
|
3546
|
-
|
|
3567
|
+
_.close();
|
|
3547
3568
|
});
|
|
3548
3569
|
const o = (r) => {
|
|
3549
|
-
r.key === "Escape" &&
|
|
3570
|
+
r.key === "Escape" && _.close();
|
|
3550
3571
|
};
|
|
3551
|
-
document.addEventListener("keydown", o),
|
|
3572
|
+
document.addEventListener("keydown", o), _.overlay = t, _.onKeyDown = o, document.body.appendChild(t), requestAnimationFrame(() => {
|
|
3552
3573
|
t.style.opacity = "1";
|
|
3553
3574
|
});
|
|
3554
3575
|
}
|
|
3555
3576
|
/** Closes the lightbox if open. */
|
|
3556
3577
|
static close() {
|
|
3557
|
-
if (!
|
|
3558
|
-
const e =
|
|
3559
|
-
|
|
3578
|
+
if (!_.overlay) return;
|
|
3579
|
+
const e = _.overlay;
|
|
3580
|
+
_.onKeyDown && (document.removeEventListener("keydown", _.onKeyDown), _.onKeyDown = null), e.style.opacity = "0", e.addEventListener("transitionend", () => {
|
|
3560
3581
|
e.remove();
|
|
3561
|
-
}),
|
|
3582
|
+
}), _.overlay = null;
|
|
3562
3583
|
}
|
|
3563
3584
|
};
|
|
3564
|
-
|
|
3565
|
-
let ke =
|
|
3585
|
+
_.overlay = null, _.onKeyDown = null;
|
|
3586
|
+
let ke = _;
|
|
3566
3587
|
class ne {
|
|
3567
3588
|
constructor(e) {
|
|
3568
3589
|
this.uploading = !1, this.client = e, this.input = document.createElement("input"), this.input.type = "file", this.input.style.display = "none", document.body.appendChild(this.input);
|
|
@@ -3790,11 +3811,6 @@ class Ji {
|
|
|
3790
3811
|
</button>
|
|
3791
3812
|
</div>
|
|
3792
3813
|
<div style="display:flex;gap:6px;">
|
|
3793
|
-
<button class="pin-cancel" style="
|
|
3794
|
-
padding:6px 14px;border:1px solid #e2e8f0;border-radius:6px;
|
|
3795
|
-
font-size:12px;font-weight:500;cursor:pointer;background:#fff;
|
|
3796
|
-
font-family:inherit;color:#64748b;
|
|
3797
|
-
">Cancel</button>
|
|
3798
3814
|
<button class="pin-submit" style="
|
|
3799
3815
|
padding:6px 14px;background:#6366f1;color:#fff;border:none;
|
|
3800
3816
|
border-radius:6px;font-size:12px;font-weight:600;cursor:pointer;
|
|
@@ -3804,45 +3820,45 @@ class Ji {
|
|
|
3804
3820
|
</div>
|
|
3805
3821
|
<div class="pin-attachments-preview" style="margin-top:6px;"></div>
|
|
3806
3822
|
`;
|
|
3807
|
-
const a = this.form.querySelector("textarea"), c = this.form.querySelector(".pulse-close-btn"), p = this.form.querySelector(".pin-
|
|
3808
|
-
c.addEventListener("click", () => this.exitPinMode()),
|
|
3809
|
-
const
|
|
3823
|
+
const a = this.form.querySelector("textarea"), c = this.form.querySelector(".pulse-close-btn"), p = this.form.querySelector(".pin-submit");
|
|
3824
|
+
c.addEventListener("click", () => this.exitPinMode()), this.pendingAttachmentIds = [], this.upload || (this.upload = new ne(this.client));
|
|
3825
|
+
const d = this.form.querySelector(".pin-attachments-preview");
|
|
3810
3826
|
this.form.querySelector(".attach-img").addEventListener("click", async () => {
|
|
3811
|
-
const
|
|
3812
|
-
if (
|
|
3813
|
-
this.pendingAttachmentIds.push(
|
|
3814
|
-
const
|
|
3815
|
-
|
|
3827
|
+
const u = await this.upload.pickFile("image/*");
|
|
3828
|
+
if (u) {
|
|
3829
|
+
this.pendingAttachmentIds.push(u.id);
|
|
3830
|
+
const m = document.createElement("img");
|
|
3831
|
+
m.src = u.thumbnailUrl || u.url, Object.assign(m.style, { width: "48px", height: "48px", borderRadius: "6px", objectFit: "cover", border: "1px solid #e2e8f0" }), d.appendChild(m);
|
|
3816
3832
|
}
|
|
3817
3833
|
}), this.form.querySelector(".attach-mic").addEventListener("click", async () => {
|
|
3818
3834
|
this.audioRecorder || (this.audioRecorder = new Re());
|
|
3819
|
-
const
|
|
3820
|
-
if (
|
|
3821
|
-
const
|
|
3822
|
-
if (
|
|
3823
|
-
this.pendingAttachmentIds.push(
|
|
3824
|
-
const
|
|
3825
|
-
Object.assign(
|
|
3835
|
+
const u = await this.audioRecorder.startRecording(d);
|
|
3836
|
+
if (u) {
|
|
3837
|
+
const m = await this.upload.uploadBlob(u, "audio.webm");
|
|
3838
|
+
if (m) {
|
|
3839
|
+
this.pendingAttachmentIds.push(m.id);
|
|
3840
|
+
const b = document.createElement("span");
|
|
3841
|
+
Object.assign(b.style, { display: "inline-block", padding: "4px 10px", borderRadius: "6px", background: "#f1f5f9", fontSize: "11px", color: "#64748b" }), b.textContent = "🎤 Audio attached", d.appendChild(b);
|
|
3826
3842
|
}
|
|
3827
3843
|
}
|
|
3828
3844
|
}), this.form.querySelector(".attach-video").addEventListener("click", async () => {
|
|
3829
3845
|
this.videoRecorder || (this.videoRecorder = new Le());
|
|
3830
|
-
const
|
|
3831
|
-
if (
|
|
3832
|
-
const
|
|
3833
|
-
if (
|
|
3834
|
-
this.pendingAttachmentIds.push(
|
|
3835
|
-
const
|
|
3836
|
-
Object.assign(
|
|
3846
|
+
const u = await this.videoRecorder.startRecording(d);
|
|
3847
|
+
if (u) {
|
|
3848
|
+
const m = await this.upload.uploadBlob(u.blob, "video.webm");
|
|
3849
|
+
if (m) {
|
|
3850
|
+
this.pendingAttachmentIds.push(m.id);
|
|
3851
|
+
const b = document.createElement("span");
|
|
3852
|
+
Object.assign(b.style, { display: "inline-block", padding: "4px 10px", borderRadius: "6px", background: "#f1f5f9", fontSize: "11px", color: "#64748b" }), b.textContent = "🎥 Video attached", d.appendChild(b);
|
|
3837
3853
|
}
|
|
3838
3854
|
}
|
|
3839
|
-
}),
|
|
3840
|
-
const
|
|
3841
|
-
if (!
|
|
3842
|
-
const
|
|
3843
|
-
this.client.createThread(
|
|
3844
|
-
}), a.addEventListener("keydown", (
|
|
3845
|
-
|
|
3855
|
+
}), p.addEventListener("click", () => {
|
|
3856
|
+
const u = a.value.trim();
|
|
3857
|
+
if (!u && this.pendingAttachmentIds.length === 0) return;
|
|
3858
|
+
const m = [...(u || "").matchAll(/@(\w+)/g)].map((b) => b[1]);
|
|
3859
|
+
this.client.createThread(u, { position: i, mentions: m, attachmentIds: this.pendingAttachmentIds.length > 0 ? [...this.pendingAttachmentIds] : void 0 }), this.pendingAttachmentIds = [], this.exitPinMode();
|
|
3860
|
+
}), a.addEventListener("keydown", (u) => {
|
|
3861
|
+
u.key === "Escape" && this.exitPinMode(), u.stopPropagation();
|
|
3846
3862
|
}), document.body.appendChild(this.form), requestAnimationFrame(() => a.focus());
|
|
3847
3863
|
}
|
|
3848
3864
|
// ── Inline thread popover (shown when a pin dot is clicked) ──
|
|
@@ -3906,7 +3922,7 @@ class Ji {
|
|
|
3906
3922
|
}
|
|
3907
3923
|
const i = (l = this.client.state.user) == null ? void 0 : l.id;
|
|
3908
3924
|
t.innerHTML = e.comments.map((a) => {
|
|
3909
|
-
const c = this.client.state.getUser(a.userId), p = c ? c.name.split(" ").map((
|
|
3925
|
+
const c = this.client.state.getUser(a.userId), p = c ? c.name.split(" ").map((y) => y[0]).join("").toUpperCase().slice(0, 2) : "?", d = (c == null ? void 0 : c.color) ?? "#94a3b8", u = this.escapeHtml((c == null ? void 0 : c.name) ?? "Unknown"), m = this.formatTime(a.createdAt), b = i === a.userId, I = a.editedAt ? '<span style="font-size:10px;color:#94a3b8;font-style:italic;">(edited)</span>' : "";
|
|
3910
3926
|
if (this.editingPopoverCommentId === a.id)
|
|
3911
3927
|
return `
|
|
3912
3928
|
<div style="margin-bottom:10px;" data-comment-id="${a.id}">
|
|
@@ -3923,37 +3939,37 @@ class Ji {
|
|
|
3923
3939
|
</div>
|
|
3924
3940
|
</div>
|
|
3925
3941
|
`;
|
|
3926
|
-
const
|
|
3942
|
+
const C = a.body && a.body !== "(attachment)" ? a.body.replace(
|
|
3927
3943
|
/@(\w+)/g,
|
|
3928
3944
|
'<span style="color:#6366f1;font-weight:600;background:#eef2ff;padding:0 3px;border-radius:3px;">@$1</span>'
|
|
3929
|
-
),
|
|
3930
|
-
if (
|
|
3931
|
-
const Pt =
|
|
3932
|
-
return `<div class="popover-attachment-img" data-full-url="${this.escapeHtml(
|
|
3933
|
-
<img src="${this.escapeHtml(Pt)}" alt="${this.escapeHtml(
|
|
3945
|
+
) : "", w = (a.attachments ?? []).map((y) => {
|
|
3946
|
+
if (y.type === "image") {
|
|
3947
|
+
const Pt = y.thumbnailUrl || y.url;
|
|
3948
|
+
return `<div class="popover-attachment-img" data-full-url="${this.escapeHtml(y.url)}" style="margin:4px 0 4px 29px;cursor:pointer;">
|
|
3949
|
+
<img src="${this.escapeHtml(Pt)}" alt="${this.escapeHtml(y.filename)}" style="max-width:180px;max-height:120px;border-radius:8px;border:1px solid #e2e8f0;display:block;" />
|
|
3934
3950
|
</div>`;
|
|
3935
3951
|
}
|
|
3936
|
-
return
|
|
3937
|
-
}).join(""),
|
|
3952
|
+
return y.type === "audio" ? `<div class="popover-attachment-audio" data-url="${this.escapeHtml(y.url)}" data-duration="${y.durationMs ?? ""}" style="margin:4px 0 4px 29px;"></div>` : y.type === "video" ? `<div class="popover-attachment-video" data-url="${this.escapeHtml(y.url)}" data-poster="${this.escapeHtml(y.thumbnailUrl ?? "")}" style="margin:4px 0 4px 29px;"></div>` : "";
|
|
3953
|
+
}).join(""), $ = b ? `<div class="popover-comment-actions" style="display:flex;gap:2px;margin-top:2px;margin-left:29px;">
|
|
3938
3954
|
<button class="edit-btn" data-comment-id="${a.id}" style="border:none;background:none;cursor:pointer;color:#94a3b8;padding:3px;border-radius:4px;display:flex;align-items:center;transition:all 0.15s;" title="Edit"
|
|
3939
3955
|
onmouseover="this.style.color='#6366f1';this.style.background='#eef2ff'"
|
|
3940
3956
|
onmouseout="this.style.color='#94a3b8';this.style.background='none'">${Gi}</button>
|
|
3941
3957
|
<button class="delete-btn" data-comment-id="${a.id}" style="border:none;background:none;cursor:pointer;color:#94a3b8;padding:3px;border-radius:4px;display:flex;align-items:center;transition:all 0.15s;" title="Delete"
|
|
3942
3958
|
onmouseover="this.style.color='#ef4444';this.style.background='#fef2f2'"
|
|
3943
3959
|
onmouseout="this.style.color='#94a3b8';this.style.background='none'">${Zi}</button>
|
|
3944
|
-
</div>` : "",
|
|
3960
|
+
</div>` : "", P = this.buildReactionPillsHtml(a.id);
|
|
3945
3961
|
return `
|
|
3946
3962
|
<div class="popover-comment" style="margin-bottom:10px;" data-comment-id="${a.id}">
|
|
3947
3963
|
<div style="display:flex;align-items:center;gap:7px;margin-bottom:2px;">
|
|
3948
3964
|
<div style="width:22px;height:22px;border-radius:50%;background:${d};color:#fff;display:flex;align-items:center;justify-content:center;font-size:9px;font-weight:700;flex-shrink:0;">${p}</div>
|
|
3949
3965
|
<span style="font-size:12px;font-weight:600;color:#0f172a;">${u}</span>
|
|
3950
|
-
<span style="font-size:10px;color:#94a3b8;">${
|
|
3951
|
-
${
|
|
3966
|
+
<span style="font-size:10px;color:#94a3b8;">${m}</span>
|
|
3967
|
+
${I}
|
|
3952
3968
|
</div>
|
|
3953
|
-
|
|
3969
|
+
${C ? `<div style="font-size:13px;color:#334155;line-height:1.45;margin-left:29px;word-wrap:break-word;">${C}</div>` : ""}
|
|
3970
|
+
${w}
|
|
3954
3971
|
${$}
|
|
3955
|
-
${
|
|
3956
|
-
${A}
|
|
3972
|
+
${P}
|
|
3957
3973
|
</div>
|
|
3958
3974
|
`;
|
|
3959
3975
|
}).join(""), t.querySelectorAll(".edit-btn").forEach((a) => {
|
|
@@ -4064,8 +4080,8 @@ class Ji {
|
|
|
4064
4080
|
const p = () => {
|
|
4065
4081
|
const d = o.value.trim();
|
|
4066
4082
|
if (!d && a.length === 0) return;
|
|
4067
|
-
const u = [...(d || "").matchAll(/@(\w+)/g)].map((
|
|
4068
|
-
this.client.reply(e.id, d
|
|
4083
|
+
const u = [...(d || "").matchAll(/@(\w+)/g)].map((m) => m[1]);
|
|
4084
|
+
this.client.reply(e.id, d, u, a.length > 0 ? [...a] : void 0), o.value = "", a.length = 0, l.innerHTML = "";
|
|
4069
4085
|
};
|
|
4070
4086
|
r.addEventListener("click", p), o.addEventListener("input", () => {
|
|
4071
4087
|
const d = Date.now(), u = this.lastTypingSendPins.get(e.id) ?? 0;
|
|
@@ -4237,9 +4253,13 @@ var Qi = Object.defineProperty, es = Object.getOwnPropertyDescriptor, j = (s, e,
|
|
|
4237
4253
|
return i && n && Qi(e, t, n), n;
|
|
4238
4254
|
};
|
|
4239
4255
|
const ts = ["👍", "👎", "❤️", "🎉", "👀", "🚀"];
|
|
4240
|
-
let O = class extends
|
|
4256
|
+
let O = class extends T {
|
|
4241
4257
|
constructor() {
|
|
4242
|
-
super(...arguments), this.highlightThreadId = null, this.
|
|
4258
|
+
super(...arguments), this.highlightThreadId = null, this.threadsVersion = 0, this.replyingTo = null, this.editingCommentId = null, this.editBody = "", this.pickerOpenForComment = null, this.typingByThread = /* @__PURE__ */ new Map(), this.reactionsVersion = 0, this.typingTimers = /* @__PURE__ */ new Map(), this.lastTypingSend = /* @__PURE__ */ new Map(), this.replyAttachmentIds = [];
|
|
4259
|
+
}
|
|
4260
|
+
/** Read threads directly from state — threadsVersion triggers re-renders. */
|
|
4261
|
+
get threads() {
|
|
4262
|
+
return this.threadsVersion, this.client ? [...this.client.state.threads] : [];
|
|
4243
4263
|
}
|
|
4244
4264
|
connectedCallback() {
|
|
4245
4265
|
super.connectedCallback(), this.ensureListener();
|
|
@@ -4272,11 +4292,11 @@ let O = class extends S {
|
|
|
4272
4292
|
this.typingTimers.clear();
|
|
4273
4293
|
}
|
|
4274
4294
|
ensureListener() {
|
|
4275
|
-
this.client && (this.teardownListeners(), this.
|
|
4295
|
+
this.client && (this.teardownListeners(), this.threadsVersion++, this.setupListener());
|
|
4276
4296
|
}
|
|
4277
4297
|
setupListener() {
|
|
4278
|
-
this.client && (this.
|
|
4279
|
-
this.
|
|
4298
|
+
this.client && (this.unsub = this.client.state.on("threads", () => {
|
|
4299
|
+
this.threadsVersion++;
|
|
4280
4300
|
}), this.reactionUnsub = this.client.state.on("reactions", () => {
|
|
4281
4301
|
this.reactionsVersion++;
|
|
4282
4302
|
}), this.typingUnsub = this.client.state.on(
|
|
@@ -4372,7 +4392,7 @@ let O = class extends S {
|
|
|
4372
4392
|
const i = e.target.querySelector("input"), n = i.value.trim();
|
|
4373
4393
|
if (!n && this.replyAttachmentIds.length === 0) return;
|
|
4374
4394
|
const o = [...(n || "").matchAll(/@(\w+)/g)].map((r) => r[1]);
|
|
4375
|
-
this.client.reply(s, n
|
|
4395
|
+
this.client.reply(s, n, o, this.replyAttachmentIds.length > 0 ? [...this.replyAttachmentIds] : void 0), i.value = "", this.replyAttachmentIds = [], this.replyingTo = null;
|
|
4376
4396
|
}
|
|
4377
4397
|
isOwnComment(s) {
|
|
4378
4398
|
var e, t;
|
|
@@ -4449,14 +4469,14 @@ let O = class extends S {
|
|
|
4449
4469
|
`
|
|
4450
4470
|
)}
|
|
4451
4471
|
</div>
|
|
4452
|
-
` :
|
|
4472
|
+
` : f}
|
|
4453
4473
|
</button>
|
|
4454
4474
|
</div>
|
|
4455
4475
|
`;
|
|
4456
4476
|
}
|
|
4457
4477
|
renderTypingIndicator(s) {
|
|
4458
4478
|
const e = this.typingByThread.get(s) ?? [];
|
|
4459
|
-
if (e.length === 0) return
|
|
4479
|
+
if (e.length === 0) return f;
|
|
4460
4480
|
const t = e.length === 1 ? `${e[0]} is typing...` : `${e.join(", ")} are typing...`;
|
|
4461
4481
|
return h`<div class="typing-indicator">${t}</div>`;
|
|
4462
4482
|
}
|
|
@@ -4477,7 +4497,7 @@ let O = class extends S {
|
|
|
4477
4497
|
<span class="thread-count">${this.threads.length}</span>
|
|
4478
4498
|
</span>
|
|
4479
4499
|
<button class="close-btn" @click=${this.fireClose} title="Close">
|
|
4480
|
-
${
|
|
4500
|
+
${k(me, 16)}
|
|
4481
4501
|
</button>
|
|
4482
4502
|
</div>
|
|
4483
4503
|
|
|
@@ -4495,7 +4515,7 @@ let O = class extends S {
|
|
|
4495
4515
|
`;
|
|
4496
4516
|
}
|
|
4497
4517
|
renderAttachments(s) {
|
|
4498
|
-
return !s || s.length === 0 ?
|
|
4518
|
+
return !s || s.length === 0 ? f : h`
|
|
4499
4519
|
${s.map((e) => {
|
|
4500
4520
|
if (e.type === "image") {
|
|
4501
4521
|
const t = e.thumbnailUrl || e.url;
|
|
@@ -4518,7 +4538,7 @@ let O = class extends S {
|
|
|
4518
4538
|
<div class="comment-attachment-media" id="video-${e.id}">
|
|
4519
4539
|
${this.renderVideoPlayer(e)}
|
|
4520
4540
|
</div>
|
|
4521
|
-
` :
|
|
4541
|
+
` : f;
|
|
4522
4542
|
})}
|
|
4523
4543
|
`;
|
|
4524
4544
|
}
|
|
@@ -4537,13 +4557,13 @@ let O = class extends S {
|
|
|
4537
4557
|
data-thread-id=${s.id}
|
|
4538
4558
|
>
|
|
4539
4559
|
${s.position ? h`<div class="pin-badge">
|
|
4540
|
-
${
|
|
4560
|
+
${k(_t, 12)}
|
|
4541
4561
|
Pinned
|
|
4542
|
-
</div>` :
|
|
4562
|
+
</div>` : f}
|
|
4543
4563
|
${s.comments.map((t, i) => {
|
|
4544
4564
|
const n = this.getUserForComment(t.userId), o = this.isOwnComment(t), r = this.editingCommentId === t.id;
|
|
4545
4565
|
return h`
|
|
4546
|
-
${i > 0 ? h`<div class="comment-divider"></div>` :
|
|
4566
|
+
${i > 0 ? h`<div class="comment-divider"></div>` : f}
|
|
4547
4567
|
<div class="comment">
|
|
4548
4568
|
<div class="comment-header">
|
|
4549
4569
|
<div
|
|
@@ -4554,16 +4574,16 @@ let O = class extends S {
|
|
|
4554
4574
|
</div>
|
|
4555
4575
|
<span class="comment-author">${(n == null ? void 0 : n.name) ?? "Unknown"}</span>
|
|
4556
4576
|
<span class="comment-time">${this.formatTime(t.createdAt)}</span>
|
|
4557
|
-
${t.editedAt ? h`<span class="edited-badge">(edited)</span>` :
|
|
4577
|
+
${t.editedAt ? h`<span class="edited-badge">(edited)</span>` : f}
|
|
4558
4578
|
</div>
|
|
4559
4579
|
${r ? this.renderEditForm(t) : h`
|
|
4560
|
-
|
|
4580
|
+
${t.body && t.body !== "(attachment)" ? h`<div class="comment-body">${this.parseMentions(t.body)}</div>` : f}
|
|
4561
4581
|
${this.renderAttachments(t.attachments ?? [])}
|
|
4562
4582
|
`}
|
|
4563
4583
|
${o && !r ? h`<div class="comment-actions">
|
|
4564
|
-
<button @click=${() => this.startEdit(t)} title="Edit">${
|
|
4565
|
-
<button class="danger" @click=${() => this.deleteComment(t.id)} title="Delete">${
|
|
4566
|
-
</div>` :
|
|
4584
|
+
<button @click=${() => this.startEdit(t)} title="Edit">${k(Ai, 14)}</button>
|
|
4585
|
+
<button class="danger" @click=${() => this.deleteComment(t.id)} title="Delete">${k(Mi, 14)}</button>
|
|
4586
|
+
</div>` : f}
|
|
4567
4587
|
${this.renderReactions(t)}
|
|
4568
4588
|
</div>
|
|
4569
4589
|
`;
|
|
@@ -4603,19 +4623,19 @@ let O = class extends S {
|
|
|
4603
4623
|
class="reply-media-btn"
|
|
4604
4624
|
title="Attach image"
|
|
4605
4625
|
@click=${() => this.handleAttachImage()}
|
|
4606
|
-
>${
|
|
4626
|
+
>${k(Si, 16)}</button>
|
|
4607
4627
|
<button
|
|
4608
4628
|
type="button"
|
|
4609
4629
|
class="reply-media-btn"
|
|
4610
4630
|
title="Record audio"
|
|
4611
4631
|
@click=${() => this.handleRecordAudio(s.id)}
|
|
4612
|
-
>${
|
|
4632
|
+
>${k(Ti, 16)}</button>
|
|
4613
4633
|
<button
|
|
4614
4634
|
type="button"
|
|
4615
4635
|
class="reply-media-btn"
|
|
4616
4636
|
title="Record video"
|
|
4617
4637
|
@click=${() => this.handleRecordVideo(s.id)}
|
|
4618
|
-
>${
|
|
4638
|
+
>${k(Oi, 16)}</button>
|
|
4619
4639
|
<div class="reply-preview">
|
|
4620
4640
|
${this.replyAttachmentIds.map(
|
|
4621
4641
|
(t, i) => h`<span class="reply-preview-badge">Attached #${i + 1}</span>`
|
|
@@ -4623,7 +4643,7 @@ let O = class extends S {
|
|
|
4623
4643
|
</div>
|
|
4624
4644
|
</div>
|
|
4625
4645
|
</form>
|
|
4626
|
-
` :
|
|
4646
|
+
` : f}
|
|
4627
4647
|
</div>
|
|
4628
4648
|
`;
|
|
4629
4649
|
}
|
|
@@ -4632,7 +4652,7 @@ O.styles = [
|
|
|
4632
4652
|
ee,
|
|
4633
4653
|
ge,
|
|
4634
4654
|
_e,
|
|
4635
|
-
|
|
4655
|
+
A`
|
|
4636
4656
|
:host {
|
|
4637
4657
|
display: block;
|
|
4638
4658
|
}
|
|
@@ -5159,7 +5179,7 @@ j([
|
|
|
5159
5179
|
], O.prototype, "highlightThreadId", 2);
|
|
5160
5180
|
j([
|
|
5161
5181
|
v()
|
|
5162
|
-
], O.prototype, "
|
|
5182
|
+
], O.prototype, "threadsVersion", 2);
|
|
5163
5183
|
j([
|
|
5164
5184
|
v()
|
|
5165
5185
|
], O.prototype, "replyingTo", 2);
|
|
@@ -5181,7 +5201,7 @@ j([
|
|
|
5181
5201
|
O = j([
|
|
5182
5202
|
R("pulse-widget-comments-panel")
|
|
5183
5203
|
], O);
|
|
5184
|
-
var is = Object.defineProperty, ss = Object.getOwnPropertyDescriptor,
|
|
5204
|
+
var is = Object.defineProperty, ss = Object.getOwnPropertyDescriptor, Ve = (s, e, t, i) => {
|
|
5185
5205
|
for (var n = i > 1 ? void 0 : i ? ss(e, t) : e, o = s.length - 1, r; o >= 0; o--)
|
|
5186
5206
|
(r = s[o]) && (n = (i ? r(e, t, n) : r(n)) || n);
|
|
5187
5207
|
return i && n && is(e, t, n), n;
|
|
@@ -5199,7 +5219,7 @@ const ns = {
|
|
|
5199
5219
|
"thread:resolved": "✅",
|
|
5200
5220
|
"reaction:added": "🎉"
|
|
5201
5221
|
};
|
|
5202
|
-
let de = class extends
|
|
5222
|
+
let de = class extends T {
|
|
5203
5223
|
constructor() {
|
|
5204
5224
|
super(...arguments), this.notifications = [];
|
|
5205
5225
|
}
|
|
@@ -5248,14 +5268,14 @@ let de = class extends S {
|
|
|
5248
5268
|
<div class="panel-header">
|
|
5249
5269
|
<span class="panel-title">
|
|
5250
5270
|
Notifications
|
|
5251
|
-
${s > 0 ? h`<span class="unread-badge">${s}</span>` :
|
|
5271
|
+
${s > 0 ? h`<span class="unread-badge">${s}</span>` : f}
|
|
5252
5272
|
</span>
|
|
5253
5273
|
<div style="display:flex;align-items:center;gap:4px;">
|
|
5254
5274
|
${s > 0 ? h`<button class="mark-all" @click=${() => this.client.markAllRead()}>
|
|
5255
5275
|
Mark all read
|
|
5256
|
-
</button>` :
|
|
5276
|
+
</button>` : f}
|
|
5257
5277
|
<button class="close-btn" @click=${this.fireClose} title="Close">
|
|
5258
|
-
${
|
|
5278
|
+
${k(me, 16)}
|
|
5259
5279
|
</button>
|
|
5260
5280
|
</div>
|
|
5261
5281
|
</div>
|
|
@@ -5291,7 +5311,7 @@ de.styles = [
|
|
|
5291
5311
|
ee,
|
|
5292
5312
|
ge,
|
|
5293
5313
|
_e,
|
|
5294
|
-
|
|
5314
|
+
A`
|
|
5295
5315
|
:host {
|
|
5296
5316
|
display: block;
|
|
5297
5317
|
}
|
|
@@ -5484,13 +5504,13 @@ de.styles = [
|
|
|
5484
5504
|
}
|
|
5485
5505
|
`
|
|
5486
5506
|
];
|
|
5487
|
-
|
|
5507
|
+
Ve([
|
|
5488
5508
|
g({ attribute: !1 })
|
|
5489
5509
|
], de.prototype, "client", 2);
|
|
5490
|
-
|
|
5510
|
+
Ve([
|
|
5491
5511
|
v()
|
|
5492
5512
|
], de.prototype, "notifications", 2);
|
|
5493
|
-
de =
|
|
5513
|
+
de = Ve([
|
|
5494
5514
|
R("pulse-widget-notifications-panel")
|
|
5495
5515
|
], de);
|
|
5496
5516
|
const rs = 3e3;
|
|
@@ -5883,12 +5903,12 @@ class hs {
|
|
|
5883
5903
|
}
|
|
5884
5904
|
}
|
|
5885
5905
|
}
|
|
5886
|
-
var ps = Object.defineProperty, us = Object.getOwnPropertyDescriptor,
|
|
5906
|
+
var ps = Object.defineProperty, us = Object.getOwnPropertyDescriptor, qe = (s, e, t, i) => {
|
|
5887
5907
|
for (var n = i > 1 ? void 0 : i ? us(e, t) : e, o = s.length - 1, r; o >= 0; o--)
|
|
5888
5908
|
(r = s[o]) && (n = (i ? r(e, t, n) : r(n)) || n);
|
|
5889
5909
|
return i && n && ps(e, t, n), n;
|
|
5890
5910
|
};
|
|
5891
|
-
let he = class extends
|
|
5911
|
+
let he = class extends T {
|
|
5892
5912
|
constructor() {
|
|
5893
5913
|
super(...arguments), this.roomId = "";
|
|
5894
5914
|
}
|
|
@@ -5929,7 +5949,7 @@ let he = class extends S {
|
|
|
5929
5949
|
<div class="panel-header">
|
|
5930
5950
|
<span class="panel-title">Settings</span>
|
|
5931
5951
|
<button class="close-btn" @click=${this.fireClose} title="Close">
|
|
5932
|
-
${
|
|
5952
|
+
${k(me, 16)}
|
|
5933
5953
|
</button>
|
|
5934
5954
|
</div>
|
|
5935
5955
|
|
|
@@ -5978,7 +5998,7 @@ he.styles = [
|
|
|
5978
5998
|
ee,
|
|
5979
5999
|
ge,
|
|
5980
6000
|
_e,
|
|
5981
|
-
|
|
6001
|
+
A`
|
|
5982
6002
|
:host {
|
|
5983
6003
|
display: block;
|
|
5984
6004
|
}
|
|
@@ -6149,13 +6169,13 @@ he.styles = [
|
|
|
6149
6169
|
}
|
|
6150
6170
|
`
|
|
6151
6171
|
];
|
|
6152
|
-
|
|
6172
|
+
qe([
|
|
6153
6173
|
g({ attribute: !1 })
|
|
6154
6174
|
], he.prototype, "settings", 2);
|
|
6155
|
-
|
|
6175
|
+
qe([
|
|
6156
6176
|
g()
|
|
6157
6177
|
], he.prototype, "roomId", 2);
|
|
6158
|
-
he =
|
|
6178
|
+
he = qe([
|
|
6159
6179
|
R("pulse-widget-settings-panel")
|
|
6160
6180
|
], he);
|
|
6161
6181
|
const ye = {
|
|
@@ -6186,7 +6206,7 @@ var gs = Object.defineProperty, bs = Object.getOwnPropertyDescriptor, L = (s, e,
|
|
|
6186
6206
|
(r = s[o]) && (n = (i ? r(e, t, n) : r(n)) || n);
|
|
6187
6207
|
return i && n && gs(e, t, n), n;
|
|
6188
6208
|
};
|
|
6189
|
-
let M = class extends
|
|
6209
|
+
let M = class extends T {
|
|
6190
6210
|
constructor() {
|
|
6191
6211
|
super(...arguments), this.collapsed = !1, this.activePanel = null, this.pinModeActive = !1, this.featuresDisabled = !1, this.drawModeActive = !1, this.followingUserId = null, this.display = "floating", this.users = [], this.unreadCount = 0;
|
|
6192
6212
|
}
|
|
@@ -6239,7 +6259,7 @@ let M = class extends S {
|
|
|
6239
6259
|
if (this.collapsed)
|
|
6240
6260
|
return h`
|
|
6241
6261
|
<div class="toolbar collapsed ${s ? "inline" : ""}" @click=${this.fireToggle}>
|
|
6242
|
-
<span class="fab-icon">${
|
|
6262
|
+
<span class="fab-icon">${k(Ri, s ? 18 : 24)}</span>
|
|
6243
6263
|
</div>
|
|
6244
6264
|
`;
|
|
6245
6265
|
const e = this.users.slice(0, 3), t = this.users.length - 3;
|
|
@@ -6248,7 +6268,7 @@ let M = class extends S {
|
|
|
6248
6268
|
<!-- Presence avatars -->
|
|
6249
6269
|
${this.users.length > 0 ? h`
|
|
6250
6270
|
<div class="presence">
|
|
6251
|
-
${t > 0 ? h`<div class="presence-overflow">+${t}</div>` :
|
|
6271
|
+
${t > 0 ? h`<div class="presence-overflow">+${t}</div>` : f}
|
|
6252
6272
|
${e.map(
|
|
6253
6273
|
(i) => h`
|
|
6254
6274
|
<div
|
|
@@ -6259,13 +6279,13 @@ let M = class extends S {
|
|
|
6259
6279
|
>
|
|
6260
6280
|
${i.user.avatar ? h`<img src="${i.user.avatar}" alt="${i.user.name}" />` : this.getInitials(i.user.name)}
|
|
6261
6281
|
<span class="presence-tooltip">${i.user.name}</span>
|
|
6262
|
-
${i.deviceType && i.deviceType !== "desktop" ? h`<span class="device-icon">${i.deviceType === "mobile" ? "📱" : "📲"}</span>` :
|
|
6282
|
+
${i.deviceType && i.deviceType !== "desktop" ? h`<span class="device-icon">${i.deviceType === "mobile" ? "📱" : "📲"}</span>` : f}
|
|
6263
6283
|
</div>
|
|
6264
6284
|
`
|
|
6265
6285
|
)}
|
|
6266
6286
|
</div>
|
|
6267
6287
|
<div class="separator"></div>
|
|
6268
|
-
` :
|
|
6288
|
+
` : f}
|
|
6269
6289
|
|
|
6270
6290
|
<!-- Pin comment (primary) -->
|
|
6271
6291
|
<button
|
|
@@ -6275,7 +6295,7 @@ let M = class extends S {
|
|
|
6275
6295
|
?disabled=${this.featuresDisabled}
|
|
6276
6296
|
style="${this.featuresDisabled ? "opacity:0.35;pointer-events:none" : ""}"
|
|
6277
6297
|
>
|
|
6278
|
-
${
|
|
6298
|
+
${k(_t)}
|
|
6279
6299
|
</button>
|
|
6280
6300
|
|
|
6281
6301
|
<!-- View comments -->
|
|
@@ -6286,7 +6306,7 @@ let M = class extends S {
|
|
|
6286
6306
|
?disabled=${this.featuresDisabled}
|
|
6287
6307
|
style="${this.featuresDisabled ? "opacity:0.35;pointer-events:none" : ""}"
|
|
6288
6308
|
>
|
|
6289
|
-
${
|
|
6309
|
+
${k(_i)}
|
|
6290
6310
|
</button>
|
|
6291
6311
|
|
|
6292
6312
|
<!-- Activity feed -->
|
|
@@ -6297,7 +6317,7 @@ let M = class extends S {
|
|
|
6297
6317
|
?disabled=${this.featuresDisabled}
|
|
6298
6318
|
style="${this.featuresDisabled ? "opacity:0.35;pointer-events:none" : ""}"
|
|
6299
6319
|
>
|
|
6300
|
-
${
|
|
6320
|
+
${k(Ci)}
|
|
6301
6321
|
</button>
|
|
6302
6322
|
|
|
6303
6323
|
<!-- Draw mode -->
|
|
@@ -6308,7 +6328,7 @@ let M = class extends S {
|
|
|
6308
6328
|
?disabled=${this.featuresDisabled}
|
|
6309
6329
|
style="${this.featuresDisabled ? "opacity:0.35;pointer-events:none" : ""}"
|
|
6310
6330
|
>
|
|
6311
|
-
${
|
|
6331
|
+
${k(Pi)}
|
|
6312
6332
|
</button>
|
|
6313
6333
|
|
|
6314
6334
|
<!-- Notifications -->
|
|
@@ -6319,8 +6339,8 @@ let M = class extends S {
|
|
|
6319
6339
|
?disabled=${this.featuresDisabled}
|
|
6320
6340
|
style="${this.featuresDisabled ? "opacity:0.35;pointer-events:none" : "position:relative"}"
|
|
6321
6341
|
>
|
|
6322
|
-
${
|
|
6323
|
-
${this.unreadCount > 0 ? h`<span class="badge">${this.unreadCount > 9 ? "9+" : this.unreadCount}</span>` :
|
|
6342
|
+
${k(Ei)}
|
|
6343
|
+
${this.unreadCount > 0 ? h`<span class="badge">${this.unreadCount > 9 ? "9+" : this.unreadCount}</span>` : f}
|
|
6324
6344
|
</button>
|
|
6325
6345
|
|
|
6326
6346
|
<!-- Settings -->
|
|
@@ -6329,7 +6349,7 @@ let M = class extends S {
|
|
|
6329
6349
|
@click=${() => this.fire("settings")}
|
|
6330
6350
|
title="Settings"
|
|
6331
6351
|
>
|
|
6332
|
-
${
|
|
6352
|
+
${k(Ii)}
|
|
6333
6353
|
</button>
|
|
6334
6354
|
|
|
6335
6355
|
<div class="separator"></div>
|
|
@@ -6340,7 +6360,7 @@ let M = class extends S {
|
|
|
6340
6360
|
@click=${this.fireToggle}
|
|
6341
6361
|
title="Collapse"
|
|
6342
6362
|
>
|
|
6343
|
-
${
|
|
6363
|
+
${k(me, 14)}
|
|
6344
6364
|
</button>
|
|
6345
6365
|
</div>
|
|
6346
6366
|
`;
|
|
@@ -6349,7 +6369,7 @@ let M = class extends S {
|
|
|
6349
6369
|
M.styles = [
|
|
6350
6370
|
ee,
|
|
6351
6371
|
ge,
|
|
6352
|
-
|
|
6372
|
+
A`
|
|
6353
6373
|
:host {
|
|
6354
6374
|
display: block;
|
|
6355
6375
|
}
|
|
@@ -6637,21 +6657,21 @@ class vs {
|
|
|
6637
6657
|
if (l === n) continue;
|
|
6638
6658
|
const c = a.scrollY, p = a.scrollY + a.viewportHeight, d = e, u = e + t;
|
|
6639
6659
|
if (c >= d && p <= u) {
|
|
6640
|
-
const
|
|
6641
|
-
|
|
6660
|
+
const $ = this.pillEls.get(l);
|
|
6661
|
+
$ && ($.style.display = "none");
|
|
6642
6662
|
continue;
|
|
6643
6663
|
}
|
|
6644
6664
|
o.add(l);
|
|
6645
|
-
const
|
|
6646
|
-
(
|
|
6665
|
+
const m = this.client.state.presence.find(
|
|
6666
|
+
($) => $.user.id === l
|
|
6647
6667
|
);
|
|
6648
|
-
if (!
|
|
6649
|
-
const b = a.scrollY + a.viewportHeight / 2,
|
|
6668
|
+
if (!m) continue;
|
|
6669
|
+
const b = a.scrollY + a.viewportHeight / 2, I = i > 0 ? b / i : 0, C = Math.max(
|
|
6650
6670
|
8,
|
|
6651
|
-
Math.min(t - 28,
|
|
6671
|
+
Math.min(t - 28, I * t)
|
|
6652
6672
|
);
|
|
6653
|
-
let
|
|
6654
|
-
|
|
6673
|
+
let w = this.pillEls.get(l);
|
|
6674
|
+
w || (w = document.createElement("div"), Object.assign(w.style, {
|
|
6655
6675
|
position: "absolute",
|
|
6656
6676
|
right: "8px",
|
|
6657
6677
|
padding: "2px 6px",
|
|
@@ -6663,7 +6683,7 @@ class vs {
|
|
|
6663
6683
|
whiteSpace: "nowrap",
|
|
6664
6684
|
pointerEvents: "none",
|
|
6665
6685
|
transition: "top 0.3s ease"
|
|
6666
|
-
}), this.container.appendChild(
|
|
6686
|
+
}), this.container.appendChild(w), this.pillEls.set(l, w)), w.style.display = "", w.style.background = m.user.color, w.style.top = `${C}px`, w.textContent = this.getInitials(m.user.name);
|
|
6667
6687
|
}
|
|
6668
6688
|
for (const [l, a] of this.pillEls)
|
|
6669
6689
|
!o.has(l) && !this.client.state.viewports.has(l) && (a.remove(), this.pillEls.delete(l));
|
|
@@ -6672,12 +6692,12 @@ class vs {
|
|
|
6672
6692
|
return e.split(" ").map((t) => t[0]).join("").toUpperCase().slice(0, 2);
|
|
6673
6693
|
}
|
|
6674
6694
|
}
|
|
6675
|
-
var xs = Object.defineProperty, ys = Object.getOwnPropertyDescriptor,
|
|
6695
|
+
var xs = Object.defineProperty, ys = Object.getOwnPropertyDescriptor, S = (s, e, t, i) => {
|
|
6676
6696
|
for (var n = i > 1 ? void 0 : i ? ys(e, t) : e, o = s.length - 1, r; o >= 0; o--)
|
|
6677
6697
|
(r = s[o]) && (n = (i ? r(e, t, n) : r(n)) || n);
|
|
6678
6698
|
return i && n && xs(e, t, n), n;
|
|
6679
6699
|
};
|
|
6680
|
-
let
|
|
6700
|
+
let E = class extends T {
|
|
6681
6701
|
constructor() {
|
|
6682
6702
|
super(...arguments), this.apiKey = "", this.token = "", this.room = "", this.position = "bottom-right", this.display = "floating", this.collapsed = !0, this.activePanel = null, this.pinModeActive = !1, this.highlightThreadId = null, this.settings = { ...ye }, this.followingUserId = null, this.drawModeActive = !1, this.connectionState = "disconnected", this.showConnectedFlash = !1, this.unsubs = [], this.clientConfigKey = "", this._isFollowScrolling = !1, this._viewportThrottleTimer = null, this._selectionThrottleTimer = null, this._connectedFlashTimer = null, this._wasDisconnected = !1, this.handleScroll = () => {
|
|
6683
6703
|
!this.settings.enabled || !this.client || this._isFollowScrolling || (this.followingUserId && (this.followingUserId = null), !this._viewportThrottleTimer && (this._viewportThrottleTimer = setTimeout(() => {
|
|
@@ -6806,12 +6826,12 @@ let C = class extends S {
|
|
|
6806
6826
|
this.settings = e, ms(this.room, e), this.applySettings(e);
|
|
6807
6827
|
}
|
|
6808
6828
|
applySettings(s) {
|
|
6809
|
-
var e, t, i, n, o, r, l, a, c, p, d, u,
|
|
6829
|
+
var e, t, i, n, o, r, l, a, c, p, d, u, m, b, I, C, w;
|
|
6810
6830
|
if (!s.enabled) {
|
|
6811
6831
|
(e = this.cursorOverlay) == null || e.disable(), (t = this.viewportOverlay) == null || t.disable(), (i = this.selectionOverlay) == null || i.disable(), (n = this.drawingOverlay) == null || n.disable(), this.drawModeActive && ((o = this.drawingOverlay) == null || o.disableDrawMode(), this.drawModeActive = !1), (r = this.client) == null || r.setAppearOffline(!0), (l = this.commentPins) == null || l.setVisible(!1), this.followingUserId = null, this.pinModeActive && ((a = this.commentPins) == null || a.exitPinMode(), this.pinModeActive = !1), this.activePanel = this.activePanel === "settings" ? "settings" : null, this.highlightThreadId = null;
|
|
6812
6832
|
return;
|
|
6813
6833
|
}
|
|
6814
|
-
this.applyCursorSettings(s), (c = this.client) == null || c.setAppearOffline(s.appearOffline), (p = this.commentPins) == null || p.setVisible(s.showCommentPins), s.showViewportIndicators ? (d = this.viewportOverlay) == null || d.enable() : (u = this.viewportOverlay) == null || u.disable(), s.showSelections ? (
|
|
6834
|
+
this.applyCursorSettings(s), (c = this.client) == null || c.setAppearOffline(s.appearOffline), (p = this.commentPins) == null || p.setVisible(s.showCommentPins), s.showViewportIndicators ? (d = this.viewportOverlay) == null || d.enable() : (u = this.viewportOverlay) == null || u.disable(), s.showSelections ? (m = this.selectionOverlay) == null || m.enable() : (b = this.selectionOverlay) == null || b.disable(), s.showDrawings ? (I = this.drawingOverlay) == null || I.enable() : ((C = this.drawingOverlay) == null || C.disable(), this.drawModeActive && ((w = this.drawingOverlay) == null || w.disableDrawMode(), this.drawModeActive = !1));
|
|
6815
6835
|
}
|
|
6816
6836
|
applyCursorSettings(s) {
|
|
6817
6837
|
if (!this.cursorOverlay) return;
|
|
@@ -6825,22 +6845,22 @@ let C = class extends S {
|
|
|
6825
6845
|
* the trigger element, flipping vertically/horizontally as needed.
|
|
6826
6846
|
*/
|
|
6827
6847
|
positionPopups() {
|
|
6828
|
-
var b,
|
|
6829
|
-
const s = this.display === "inline", e = (b = this.shadowRoot) == null ? void 0 : b.querySelector(".inline-trigger"), t = (
|
|
6848
|
+
var b, I, C, w;
|
|
6849
|
+
const s = this.display === "inline", e = (b = this.shadowRoot) == null ? void 0 : b.querySelector(".inline-trigger"), t = (I = this.shadowRoot) == null ? void 0 : I.querySelector("pulse-widget-toolbar"), i = s ? e : t;
|
|
6830
6850
|
if (!i) return;
|
|
6831
|
-
const n = i.getBoundingClientRect(), o = window.innerWidth, r = window.innerHeight, l = 8, a = (
|
|
6851
|
+
const n = i.getBoundingClientRect(), o = window.innerWidth, r = window.innerHeight, l = 8, a = (C = this.shadowRoot) == null ? void 0 : C.querySelector(".toolbar-popover");
|
|
6832
6852
|
if (a) {
|
|
6833
6853
|
Object.assign(a.style, { top: "auto", left: "auto" });
|
|
6834
|
-
const
|
|
6835
|
-
a.style.top = `${
|
|
6854
|
+
const $ = a.getBoundingClientRect(), P = this.computePosition(n, $, o, r, l);
|
|
6855
|
+
a.style.top = `${P.top}px`, a.style.left = `${P.left}px`;
|
|
6836
6856
|
}
|
|
6837
|
-
const c = (
|
|
6857
|
+
const c = (w = this.shadowRoot) == null ? void 0 : w.querySelector(".panel-container");
|
|
6838
6858
|
if (!c) return;
|
|
6839
6859
|
Object.assign(c.style, { top: "auto", left: "auto" });
|
|
6840
6860
|
const p = a ?? t;
|
|
6841
6861
|
if (!p) return;
|
|
6842
|
-
const d = p.getBoundingClientRect(), u = c.getBoundingClientRect(),
|
|
6843
|
-
c.style.top = `${
|
|
6862
|
+
const d = p.getBoundingClientRect(), u = c.getBoundingClientRect(), m = this.computePosition(d, u, o, r, l);
|
|
6863
|
+
c.style.top = `${m.top}px`, c.style.left = `${m.left}px`;
|
|
6844
6864
|
}
|
|
6845
6865
|
computePosition(s, e, t, i, n) {
|
|
6846
6866
|
const o = s.top, r = i - s.bottom;
|
|
@@ -6865,7 +6885,7 @@ let C = class extends S {
|
|
|
6865
6885
|
<span class="connection-dot"></span>Reconnecting...
|
|
6866
6886
|
</div>` : this.connectionState === "disconnected" && this.client ? h`<div class="connection-banner disconnected">
|
|
6867
6887
|
<span class="connection-dot"></span>Disconnected
|
|
6868
|
-
</div>` :
|
|
6888
|
+
</div>` : f;
|
|
6869
6889
|
}
|
|
6870
6890
|
handleToolbarToggle() {
|
|
6871
6891
|
this.collapsed = !this.collapsed, this.collapsed && (this.activePanel = null, this.highlightThreadId = null);
|
|
@@ -6885,25 +6905,25 @@ let C = class extends S {
|
|
|
6885
6905
|
${this.activePanel === "comments" ? h`<pulse-widget-comments-panel
|
|
6886
6906
|
.client=${this.client}
|
|
6887
6907
|
.highlightThreadId=${this.highlightThreadId}
|
|
6888
|
-
></pulse-widget-comments-panel>` :
|
|
6908
|
+
></pulse-widget-comments-panel>` : f}
|
|
6889
6909
|
${this.activePanel === "settings" ? h`<pulse-widget-settings-panel
|
|
6890
6910
|
.settings=${this.settings}
|
|
6891
6911
|
.roomId=${this.room}
|
|
6892
6912
|
@settings-change=${this.handleSettingsChange}
|
|
6893
|
-
></pulse-widget-settings-panel>` :
|
|
6913
|
+
></pulse-widget-settings-panel>` : f}
|
|
6894
6914
|
${this.activePanel === "notifications" ? h`<pulse-widget-notifications-panel
|
|
6895
6915
|
.client=${this.client}
|
|
6896
|
-
></pulse-widget-notifications-panel>` :
|
|
6916
|
+
></pulse-widget-notifications-panel>` : f}
|
|
6897
6917
|
${this.activePanel === "activity" ? h`<pulse-widget-activity-panel
|
|
6898
6918
|
.client=${this.client}
|
|
6899
|
-
></pulse-widget-activity-panel>` :
|
|
6919
|
+
></pulse-widget-activity-panel>` : f}
|
|
6900
6920
|
</div>
|
|
6901
|
-
` :
|
|
6921
|
+
` : f, t = this.followingUserId ? h`<div class="follow-banner">
|
|
6902
6922
|
Following ${this.getFollowUserName()}
|
|
6903
6923
|
<button @click=${() => {
|
|
6904
6924
|
this.followingUserId = null;
|
|
6905
6925
|
}}>Stop</button>
|
|
6906
|
-
</div>` :
|
|
6926
|
+
</div>` : f;
|
|
6907
6927
|
return s ? h`
|
|
6908
6928
|
${t}
|
|
6909
6929
|
<div class="widget-root">
|
|
@@ -6950,9 +6970,9 @@ let C = class extends S {
|
|
|
6950
6970
|
`;
|
|
6951
6971
|
}
|
|
6952
6972
|
};
|
|
6953
|
-
|
|
6973
|
+
E.styles = [
|
|
6954
6974
|
ee,
|
|
6955
|
-
|
|
6975
|
+
A`
|
|
6956
6976
|
:host {
|
|
6957
6977
|
display: block;
|
|
6958
6978
|
}
|
|
@@ -7128,60 +7148,60 @@ C.styles = [
|
|
|
7128
7148
|
}
|
|
7129
7149
|
`
|
|
7130
7150
|
];
|
|
7131
|
-
|
|
7151
|
+
S([
|
|
7132
7152
|
g({ attribute: "api-key" })
|
|
7133
|
-
],
|
|
7134
|
-
|
|
7153
|
+
], E.prototype, "apiKey", 2);
|
|
7154
|
+
S([
|
|
7135
7155
|
g()
|
|
7136
|
-
],
|
|
7137
|
-
|
|
7156
|
+
], E.prototype, "token", 2);
|
|
7157
|
+
S([
|
|
7138
7158
|
g()
|
|
7139
|
-
],
|
|
7140
|
-
|
|
7159
|
+
], E.prototype, "room", 2);
|
|
7160
|
+
S([
|
|
7141
7161
|
g()
|
|
7142
|
-
],
|
|
7143
|
-
|
|
7162
|
+
], E.prototype, "endpoint", 2);
|
|
7163
|
+
S([
|
|
7144
7164
|
g({ reflect: !0 })
|
|
7145
|
-
],
|
|
7146
|
-
|
|
7165
|
+
], E.prototype, "position", 2);
|
|
7166
|
+
S([
|
|
7147
7167
|
g({ reflect: !0 })
|
|
7148
|
-
],
|
|
7149
|
-
|
|
7168
|
+
], E.prototype, "display", 2);
|
|
7169
|
+
S([
|
|
7150
7170
|
v()
|
|
7151
|
-
],
|
|
7152
|
-
|
|
7171
|
+
], E.prototype, "collapsed", 2);
|
|
7172
|
+
S([
|
|
7153
7173
|
v()
|
|
7154
|
-
],
|
|
7155
|
-
|
|
7174
|
+
], E.prototype, "activePanel", 2);
|
|
7175
|
+
S([
|
|
7156
7176
|
v()
|
|
7157
|
-
],
|
|
7158
|
-
|
|
7177
|
+
], E.prototype, "pinModeActive", 2);
|
|
7178
|
+
S([
|
|
7159
7179
|
v()
|
|
7160
|
-
],
|
|
7161
|
-
|
|
7180
|
+
], E.prototype, "highlightThreadId", 2);
|
|
7181
|
+
S([
|
|
7162
7182
|
v()
|
|
7163
|
-
],
|
|
7164
|
-
|
|
7183
|
+
], E.prototype, "settings", 2);
|
|
7184
|
+
S([
|
|
7165
7185
|
v()
|
|
7166
|
-
],
|
|
7167
|
-
|
|
7186
|
+
], E.prototype, "followingUserId", 2);
|
|
7187
|
+
S([
|
|
7168
7188
|
v()
|
|
7169
|
-
],
|
|
7170
|
-
|
|
7189
|
+
], E.prototype, "drawModeActive", 2);
|
|
7190
|
+
S([
|
|
7171
7191
|
v()
|
|
7172
|
-
],
|
|
7173
|
-
|
|
7192
|
+
], E.prototype, "connectionState", 2);
|
|
7193
|
+
S([
|
|
7174
7194
|
v()
|
|
7175
|
-
],
|
|
7176
|
-
|
|
7195
|
+
], E.prototype, "showConnectedFlash", 2);
|
|
7196
|
+
E = S([
|
|
7177
7197
|
R("pulse-widget")
|
|
7178
|
-
],
|
|
7198
|
+
], E);
|
|
7179
7199
|
export {
|
|
7180
7200
|
W as PulseComments,
|
|
7181
7201
|
le as PulseCursors,
|
|
7182
7202
|
ce as PulseNotifications,
|
|
7183
7203
|
G as PulsePresence,
|
|
7184
|
-
|
|
7204
|
+
q as PulseProvider,
|
|
7185
7205
|
D as PulseReactions,
|
|
7186
|
-
|
|
7206
|
+
E as PulseWidget
|
|
7187
7207
|
};
|