@gamention/pulse-elements 0.1.8 → 0.1.10
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 +283 -203
- package/dist/pulse-elements.js +761 -639
- package/package.json +3 -3
package/dist/pulse-elements.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Copyright 2021 Google LLC
|
|
4
4
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
5
5
|
*/
|
|
6
|
-
let
|
|
6
|
+
let vt = class extends Event {
|
|
7
7
|
constructor(e, t, i, n) {
|
|
8
8
|
super("context-request", { bubbles: !0, composed: !0 }), this.context = e, this.contextTarget = t, this.callback = i, this.subscribe = n ?? !1;
|
|
9
9
|
}
|
|
@@ -35,7 +35,7 @@ let We = class {
|
|
|
35
35
|
this.unsubscribe && (this.unsubscribe(), this.unsubscribe = void 0);
|
|
36
36
|
}
|
|
37
37
|
dispatchRequest() {
|
|
38
|
-
this.host.dispatchEvent(new
|
|
38
|
+
this.host.dispatchEvent(new vt(this.context, this.host, this.t, this.subscribe));
|
|
39
39
|
}
|
|
40
40
|
};
|
|
41
41
|
/**
|
|
@@ -43,7 +43,7 @@ let We = class {
|
|
|
43
43
|
* Copyright 2021 Google LLC
|
|
44
44
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
45
45
|
*/
|
|
46
|
-
let
|
|
46
|
+
let At = class {
|
|
47
47
|
get value() {
|
|
48
48
|
return this.o;
|
|
49
49
|
}
|
|
@@ -76,11 +76,11 @@ let Pt = class {
|
|
|
76
76
|
* Copyright 2021 Google LLC
|
|
77
77
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
78
78
|
*/
|
|
79
|
-
let
|
|
79
|
+
let It = class extends Event {
|
|
80
80
|
constructor(e, t) {
|
|
81
81
|
super("context-provider", { bubbles: !0, composed: !0 }), this.context = e, this.contextTarget = t;
|
|
82
82
|
}
|
|
83
|
-
},
|
|
83
|
+
}, Xe = class extends At {
|
|
84
84
|
constructor(e, t, i) {
|
|
85
85
|
var n, o;
|
|
86
86
|
super(t.context !== void 0 ? t.initialValue : i), this.onContextRequest = (r) => {
|
|
@@ -90,7 +90,7 @@ let At = class extends Event {
|
|
|
90
90
|
}, this.onProviderRequest = (r) => {
|
|
91
91
|
if (r.context !== this.context || (r.contextTarget ?? r.composedPath()[0]) === this.host) return;
|
|
92
92
|
const l = /* @__PURE__ */ new Set();
|
|
93
|
-
for (const [a, { consumerHost: c }] of this.subscriptions) l.has(a) || (l.add(a), c.dispatchEvent(new
|
|
93
|
+
for (const [a, { consumerHost: c }] of this.subscriptions) l.has(a) || (l.add(a), c.dispatchEvent(new vt(this.context, c, a, !0)));
|
|
94
94
|
r.stopPropagation();
|
|
95
95
|
}, this.host = e, t.context !== void 0 ? this.context = t.context : this.context = t, this.attachListeners(), (o = (n = this.host).addController) == null || o.call(n, this);
|
|
96
96
|
}
|
|
@@ -98,7 +98,7 @@ let At = class extends Event {
|
|
|
98
98
|
this.host.addEventListener("context-request", this.onContextRequest), this.host.addEventListener("context-provider", this.onProviderRequest);
|
|
99
99
|
}
|
|
100
100
|
hostConnected() {
|
|
101
|
-
this.host.dispatchEvent(new
|
|
101
|
+
this.host.dispatchEvent(new It(this.context, this.host));
|
|
102
102
|
}
|
|
103
103
|
};
|
|
104
104
|
/**
|
|
@@ -114,11 +114,11 @@ function Mt({ context: s }) {
|
|
|
114
114
|
}, set(n) {
|
|
115
115
|
return i.get(this).setValue(n), e.set.call(this, n);
|
|
116
116
|
}, init(n) {
|
|
117
|
-
return i.set(this, new
|
|
117
|
+
return i.set(this, new Xe(this, { context: s, initialValue: n })), n;
|
|
118
118
|
} };
|
|
119
119
|
{
|
|
120
120
|
e.constructor.addInitializer(((r) => {
|
|
121
|
-
i.set(r, new
|
|
121
|
+
i.set(r, new Xe(r, { context: s }));
|
|
122
122
|
}));
|
|
123
123
|
const n = Object.getOwnPropertyDescriptor(e, t);
|
|
124
124
|
let o;
|
|
@@ -144,7 +144,7 @@ function Mt({ context: s }) {
|
|
|
144
144
|
* Copyright 2022 Google LLC
|
|
145
145
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
146
146
|
*/
|
|
147
|
-
function
|
|
147
|
+
function pe({ context: s, subscribe: e }) {
|
|
148
148
|
return (t, i) => {
|
|
149
149
|
typeof i == "object" ? i.addInitializer((function() {
|
|
150
150
|
new We(this, { context: s, callback: (n) => {
|
|
@@ -157,9 +157,9 @@ function he({ context: s, subscribe: e }) {
|
|
|
157
157
|
}));
|
|
158
158
|
};
|
|
159
159
|
}
|
|
160
|
-
var
|
|
161
|
-
const
|
|
162
|
-
let
|
|
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, y = (s, e, t) => Rt(s, typeof e != "symbol" ? e + "" : e, t);
|
|
161
|
+
const Lt = "ws://localhost:4567";
|
|
162
|
+
let je = class {
|
|
163
163
|
constructor() {
|
|
164
164
|
y(this, "handlers", /* @__PURE__ */ new Map());
|
|
165
165
|
}
|
|
@@ -179,9 +179,9 @@ let Le = class {
|
|
|
179
179
|
removeAll() {
|
|
180
180
|
this.handlers.clear();
|
|
181
181
|
}
|
|
182
|
-
},
|
|
182
|
+
}, jt = class extends je {
|
|
183
183
|
constructor(e) {
|
|
184
|
-
super(), y(this, "ws", null), y(this, "endpoint"), y(this, "reconnectAttempt", 0), y(this, "reconnectTimer", null), y(this, "_state", "disconnected"), this.endpoint = e ??
|
|
184
|
+
super(), y(this, "ws", null), y(this, "endpoint"), y(this, "reconnectAttempt", 0), y(this, "reconnectTimer", null), y(this, "_state", "disconnected"), this.endpoint = e ?? Lt;
|
|
185
185
|
}
|
|
186
186
|
get state() {
|
|
187
187
|
return this._state;
|
|
@@ -216,7 +216,7 @@ let Le = class {
|
|
|
216
216
|
this.reconnectTimer = null, this.connect();
|
|
217
217
|
}, e);
|
|
218
218
|
}
|
|
219
|
-
},
|
|
219
|
+
}, zt = class extends je {
|
|
220
220
|
constructor() {
|
|
221
221
|
super(...arguments), y(this, "_user", null), y(this, "_users", /* @__PURE__ */ new Map()), y(this, "_presence", /* @__PURE__ */ new Map()), y(this, "_threads", /* @__PURE__ */ new Map()), y(this, "_reactions", /* @__PURE__ */ new Map()), y(this, "_notifications", []), y(this, "_activityLogs", []), y(this, "_typing", /* @__PURE__ */ new Map()), y(this, "_viewports", /* @__PURE__ */ new Map()), y(this, "_selections", /* @__PURE__ */ new Map());
|
|
222
222
|
}
|
|
@@ -396,12 +396,12 @@ let Le = class {
|
|
|
396
396
|
reset() {
|
|
397
397
|
this._user = null, this._users.clear(), this._presence.clear(), this._threads.clear(), this._reactions.clear(), this._notifications = [], this._activityLogs = [], this._typing.clear(), this._viewports.clear(), this._selections.clear();
|
|
398
398
|
}
|
|
399
|
-
},
|
|
399
|
+
}, xt = class extends je {
|
|
400
400
|
constructor(e) {
|
|
401
401
|
var t;
|
|
402
|
-
super(), y(this, "state"), y(this, "connection"), y(this, "config"), y(this, "heartbeatTimer", null), y(this, "lastCursorSend", 0), y(this, "pendingCursor", null), y(this, "cursorTimer", null), this.config = e, this.state = new
|
|
402
|
+
super(), y(this, "state"), y(this, "connection"), y(this, "config"), y(this, "heartbeatTimer", null), y(this, "lastCursorSend", 0), y(this, "pendingCursor", null), y(this, "cursorTimer", null), this.config = e, this.state = new zt();
|
|
403
403
|
const i = ((t = e.endpoint) == null ? void 0 : t.replace(/^http/, "ws")) ?? void 0;
|
|
404
|
-
this.connection = new
|
|
404
|
+
this.connection = new jt(i), this.connection.on("message", (n) => {
|
|
405
405
|
this.state.handleMessage(n), this.emit(n.type, n);
|
|
406
406
|
}), this.connection.on("state", (n) => {
|
|
407
407
|
this.emit("connection", n), n === "connected" ? (this.authenticate(), this.startHeartbeat()) : n === "disconnected" && this.stopHeartbeat();
|
|
@@ -458,12 +458,13 @@ let Le = class {
|
|
|
458
458
|
id: i,
|
|
459
459
|
body: e,
|
|
460
460
|
mentions: t.mentions ?? [],
|
|
461
|
-
position: t.position ?? null
|
|
461
|
+
position: t.position ?? null,
|
|
462
|
+
attachmentIds: t.attachmentIds
|
|
462
463
|
}), i;
|
|
463
464
|
}
|
|
464
|
-
reply(e, t, i = []) {
|
|
465
|
-
const
|
|
466
|
-
return this.send({ type: "comment:create", threadId: e, id:
|
|
465
|
+
reply(e, t, i = [], n) {
|
|
466
|
+
const o = crypto.randomUUID();
|
|
467
|
+
return this.send({ type: "comment:create", threadId: e, id: o, body: t, mentions: i, attachmentIds: n }), o;
|
|
467
468
|
}
|
|
468
469
|
editComment(e, t, i = []) {
|
|
469
470
|
this.send({ type: "comment:edit", commentId: e, body: t, mentions: i });
|
|
@@ -543,18 +544,18 @@ let Le = class {
|
|
|
543
544
|
* Copyright 2019 Google LLC
|
|
544
545
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
545
546
|
*/
|
|
546
|
-
const
|
|
547
|
-
let
|
|
547
|
+
const ve = globalThis, ze = ve.ShadowRoot && (ve.ShadyCSS === void 0 || ve.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, Ue = Symbol(), Ye = /* @__PURE__ */ new WeakMap();
|
|
548
|
+
let yt = class {
|
|
548
549
|
constructor(e, t, i) {
|
|
549
|
-
if (this._$cssResult$ = !0, i !==
|
|
550
|
+
if (this._$cssResult$ = !0, i !== Ue) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
|
|
550
551
|
this.cssText = e, this.t = t;
|
|
551
552
|
}
|
|
552
553
|
get styleSheet() {
|
|
553
554
|
let e = this.o;
|
|
554
555
|
const t = this.t;
|
|
555
|
-
if (
|
|
556
|
+
if (ze && e === void 0) {
|
|
556
557
|
const i = t !== void 0 && t.length === 1;
|
|
557
|
-
i && (e =
|
|
558
|
+
i && (e = Ye.get(t)), e === void 0 && ((this.o = e = new CSSStyleSheet()).replaceSync(this.cssText), i && Ye.set(t, e));
|
|
558
559
|
}
|
|
559
560
|
return e;
|
|
560
561
|
}
|
|
@@ -562,30 +563,30 @@ let xt = class {
|
|
|
562
563
|
return this.cssText;
|
|
563
564
|
}
|
|
564
565
|
};
|
|
565
|
-
const
|
|
566
|
+
const Ut = (s) => new yt(typeof s == "string" ? s : s + "", void 0, Ue), I = (s, ...e) => {
|
|
566
567
|
const t = s.length === 1 ? s[0] : e.reduce((i, n, o) => i + ((r) => {
|
|
567
568
|
if (r._$cssResult$ === !0) return r.cssText;
|
|
568
569
|
if (typeof r == "number") return r;
|
|
569
570
|
throw Error("Value passed to 'css' function must be a 'css' function result: " + r + ". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.");
|
|
570
571
|
})(n) + s[o + 1], s[0]);
|
|
571
|
-
return new
|
|
572
|
-
},
|
|
573
|
-
if (
|
|
572
|
+
return new yt(t, s, Ue);
|
|
573
|
+
}, Dt = (s, e) => {
|
|
574
|
+
if (ze) s.adoptedStyleSheets = e.map((t) => t instanceof CSSStyleSheet ? t : t.styleSheet);
|
|
574
575
|
else for (const t of e) {
|
|
575
|
-
const i = document.createElement("style"), n =
|
|
576
|
+
const i = document.createElement("style"), n = ve.litNonce;
|
|
576
577
|
n !== void 0 && i.setAttribute("nonce", n), i.textContent = t.cssText, s.appendChild(i);
|
|
577
578
|
}
|
|
578
|
-
},
|
|
579
|
+
}, Ke = ze ? (s) => s : (s) => s instanceof CSSStyleSheet ? ((e) => {
|
|
579
580
|
let t = "";
|
|
580
581
|
for (const i of e.cssRules) t += i.cssText;
|
|
581
|
-
return
|
|
582
|
+
return Ut(t);
|
|
582
583
|
})(s) : s;
|
|
583
584
|
/**
|
|
584
585
|
* @license
|
|
585
586
|
* Copyright 2017 Google LLC
|
|
586
587
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
587
588
|
*/
|
|
588
|
-
const { is:
|
|
589
|
+
const { is: Ht, defineProperty: Bt, getOwnPropertyDescriptor: Nt, getOwnPropertyNames: Ft, getOwnPropertySymbols: qt, getPrototypeOf: Vt } = Object, U = globalThis, Ge = U.trustedTypes, Wt = Ge ? Ge.emptyScript : "", Te = U.reactiveElementPolyfillSupport, ie = (s, e) => s, we = { toAttribute(s, e) {
|
|
589
590
|
switch (e) {
|
|
590
591
|
case Boolean:
|
|
591
592
|
s = s ? Wt : null;
|
|
@@ -613,7 +614,7 @@ const { is: Dt, defineProperty: Ht, getOwnPropertyDescriptor: Nt, getOwnProperty
|
|
|
613
614
|
}
|
|
614
615
|
}
|
|
615
616
|
return t;
|
|
616
|
-
} },
|
|
617
|
+
} }, De = (s, e) => !Ht(s, e), Ze = { attribute: !0, type: String, converter: we, reflect: !1, useDefault: !1, hasChanged: De };
|
|
617
618
|
Symbol.metadata ?? (Symbol.metadata = Symbol("metadata")), U.litPropertyMetadata ?? (U.litPropertyMetadata = /* @__PURE__ */ new WeakMap());
|
|
618
619
|
let Y = class extends HTMLElement {
|
|
619
620
|
static addInitializer(e) {
|
|
@@ -622,10 +623,10 @@ let Y = class extends HTMLElement {
|
|
|
622
623
|
static get observedAttributes() {
|
|
623
624
|
return this.finalize(), this._$Eh && [...this._$Eh.keys()];
|
|
624
625
|
}
|
|
625
|
-
static createProperty(e, t =
|
|
626
|
+
static createProperty(e, t = Ze) {
|
|
626
627
|
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) {
|
|
627
628
|
const i = Symbol(), n = this.getPropertyDescriptor(e, i, t);
|
|
628
|
-
n !== void 0 &&
|
|
629
|
+
n !== void 0 && Bt(this.prototype, e, n);
|
|
629
630
|
}
|
|
630
631
|
}
|
|
631
632
|
static getPropertyDescriptor(e, t, i) {
|
|
@@ -640,17 +641,17 @@ let Y = class extends HTMLElement {
|
|
|
640
641
|
}, configurable: !0, enumerable: !0 };
|
|
641
642
|
}
|
|
642
643
|
static getPropertyOptions(e) {
|
|
643
|
-
return this.elementProperties.get(e) ??
|
|
644
|
+
return this.elementProperties.get(e) ?? Ze;
|
|
644
645
|
}
|
|
645
646
|
static _$Ei() {
|
|
646
647
|
if (this.hasOwnProperty(ie("elementProperties"))) return;
|
|
647
|
-
const e =
|
|
648
|
+
const e = Vt(this);
|
|
648
649
|
e.finalize(), e.l !== void 0 && (this.l = [...e.l]), this.elementProperties = new Map(e.elementProperties);
|
|
649
650
|
}
|
|
650
651
|
static finalize() {
|
|
651
652
|
if (this.hasOwnProperty(ie("finalized"))) return;
|
|
652
653
|
if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(ie("properties"))) {
|
|
653
|
-
const t = this.properties, i = [...
|
|
654
|
+
const t = this.properties, i = [...Ft(t), ...qt(t)];
|
|
654
655
|
for (const n of i) this.createProperty(n, t[n]);
|
|
655
656
|
}
|
|
656
657
|
const e = this[Symbol.metadata];
|
|
@@ -669,8 +670,8 @@ let Y = class extends HTMLElement {
|
|
|
669
670
|
const t = [];
|
|
670
671
|
if (Array.isArray(e)) {
|
|
671
672
|
const i = new Set(e.flat(1 / 0).reverse());
|
|
672
|
-
for (const n of i) t.unshift(
|
|
673
|
-
} else e !== void 0 && t.push(
|
|
673
|
+
for (const n of i) t.unshift(Ke(n));
|
|
674
|
+
} else e !== void 0 && t.push(Ke(e));
|
|
674
675
|
return t;
|
|
675
676
|
}
|
|
676
677
|
static _$Eu(e, t) {
|
|
@@ -699,7 +700,7 @@ let Y = class extends HTMLElement {
|
|
|
699
700
|
}
|
|
700
701
|
createRenderRoot() {
|
|
701
702
|
const e = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions);
|
|
702
|
-
return
|
|
703
|
+
return Dt(e, this.constructor.elementStyles), e;
|
|
703
704
|
}
|
|
704
705
|
connectedCallback() {
|
|
705
706
|
var e;
|
|
@@ -724,7 +725,7 @@ let Y = class extends HTMLElement {
|
|
|
724
725
|
var o;
|
|
725
726
|
const i = this.constructor.elementProperties.get(e), n = this.constructor._$Eu(e, i);
|
|
726
727
|
if (n !== void 0 && i.reflect === !0) {
|
|
727
|
-
const r = (((o = i.converter) == null ? void 0 : o.toAttribute) !== void 0 ? i.converter :
|
|
728
|
+
const r = (((o = i.converter) == null ? void 0 : o.toAttribute) !== void 0 ? i.converter : we).toAttribute(t, i.type);
|
|
728
729
|
this._$Em = e, r == null ? this.removeAttribute(n) : this.setAttribute(n, r), this._$Em = null;
|
|
729
730
|
}
|
|
730
731
|
}
|
|
@@ -732,7 +733,7 @@ let Y = class extends HTMLElement {
|
|
|
732
733
|
var o, r;
|
|
733
734
|
const i = this.constructor, n = i._$Eh.get(e);
|
|
734
735
|
if (n !== void 0 && this._$Em !== n) {
|
|
735
|
-
const l = i.getPropertyOptions(n), a = typeof l.converter == "function" ? { fromAttribute: l.converter } : ((o = l.converter) == null ? void 0 : o.fromAttribute) !== void 0 ? l.converter :
|
|
736
|
+
const l = i.getPropertyOptions(n), a = typeof l.converter == "function" ? { fromAttribute: l.converter } : ((o = l.converter) == null ? void 0 : o.fromAttribute) !== void 0 ? l.converter : we;
|
|
736
737
|
this._$Em = n;
|
|
737
738
|
const c = a.fromAttribute(t, l.type);
|
|
738
739
|
this[n] = c ?? ((r = this._$Ej) == null ? void 0 : r.get(n)) ?? c, this._$Em = null;
|
|
@@ -742,7 +743,7 @@ let Y = class extends HTMLElement {
|
|
|
742
743
|
var r;
|
|
743
744
|
if (e !== void 0) {
|
|
744
745
|
const l = this.constructor;
|
|
745
|
-
if (n === !1 && (o = this[e]), i ?? (i = l.getPropertyOptions(e)), !((i.hasChanged ??
|
|
746
|
+
if (n === !1 && (o = this[e]), i ?? (i = l.getPropertyOptions(e)), !((i.hasChanged ?? De)(o, t) || i.useDefault && i.reflect && o === ((r = this._$Ej) == null ? void 0 : r.get(e)) && !this.hasAttribute(l._$Eu(e, i)))) return;
|
|
746
747
|
this.C(e, t, i);
|
|
747
748
|
}
|
|
748
749
|
this.isUpdatePending === !1 && (this._$ES = this._$EP());
|
|
@@ -824,53 +825,53 @@ Y.elementStyles = [], Y.shadowRootOptions = { mode: "open" }, Y[ie("elementPrope
|
|
|
824
825
|
* Copyright 2017 Google LLC
|
|
825
826
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
826
827
|
*/
|
|
827
|
-
const se = globalThis, Je = (s) => s,
|
|
828
|
-
\f\r]`, te = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,
|
|
829
|
-
\f\r"'\`<>=]|("|')|))|$)`, "g"),
|
|
830
|
-
function
|
|
831
|
-
if (!
|
|
832
|
-
return
|
|
828
|
+
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
|
+
\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), q = Symbol.for("lit-noChange"), m = Symbol.for("lit-nothing"), nt = /* @__PURE__ */ new WeakMap(), B = F.createTreeWalker(F, 129);
|
|
831
|
+
function Ct(s, e) {
|
|
832
|
+
if (!He(s) || !s.hasOwnProperty("raw")) throw Error("invalid template strings array");
|
|
833
|
+
return Qe !== void 0 ? Qe.createHTML(e) : e;
|
|
833
834
|
}
|
|
834
|
-
const
|
|
835
|
+
const Gt = (s, e) => {
|
|
835
836
|
const t = s.length - 1, i = [];
|
|
836
837
|
let n, o = e === 2 ? "<svg>" : e === 3 ? "<math>" : "", r = te;
|
|
837
838
|
for (let l = 0; l < t; l++) {
|
|
838
839
|
const a = s[l];
|
|
839
|
-
let c,
|
|
840
|
-
for (;
|
|
840
|
+
let c, p, d = -1, u = 0;
|
|
841
|
+
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);
|
|
841
842
|
const f = r === H && s[l + 1].startsWith("/>") ? " " : "";
|
|
842
|
-
o += r === te ? a +
|
|
843
|
+
o += r === te ? a + Xt : d >= 0 ? (i.push(c), a.slice(0, d) + wt + a.slice(d) + z + f) : a + z + (d === -2 ? l : f);
|
|
843
844
|
}
|
|
844
|
-
return [
|
|
845
|
+
return [Ct(s, o + (s[t] || "<?>") + (e === 2 ? "</svg>" : e === 3 ? "</math>" : "")), i];
|
|
845
846
|
};
|
|
846
|
-
class
|
|
847
|
+
class ae {
|
|
847
848
|
constructor({ strings: e, _$litType$: t }, i) {
|
|
848
849
|
let n;
|
|
849
850
|
this.parts = [];
|
|
850
851
|
let o = 0, r = 0;
|
|
851
|
-
const l = e.length - 1, a = this.parts, [c,
|
|
852
|
-
if (this.el =
|
|
853
|
-
const
|
|
854
|
-
|
|
852
|
+
const l = e.length - 1, a = this.parts, [c, p] = Gt(e, t);
|
|
853
|
+
if (this.el = ae.createElement(c, i), B.currentNode = this.el.content, t === 2 || t === 3) {
|
|
854
|
+
const d = this.el.content.firstChild;
|
|
855
|
+
d.replaceWith(...d.childNodes);
|
|
855
856
|
}
|
|
856
|
-
for (; (n =
|
|
857
|
+
for (; (n = B.nextNode()) !== null && a.length < l; ) {
|
|
857
858
|
if (n.nodeType === 1) {
|
|
858
|
-
if (n.hasAttributes()) for (const
|
|
859
|
-
const
|
|
860
|
-
a.push({ type: 1, index: o, name: b[2], strings: f, ctor: b[1] === "." ? Jt : b[1] === "?" ?
|
|
861
|
-
} else
|
|
862
|
-
if (
|
|
863
|
-
const
|
|
864
|
-
if (
|
|
865
|
-
n.textContent =
|
|
866
|
-
for (let f = 0; f <
|
|
867
|
-
n.append(
|
|
859
|
+
if (n.hasAttributes()) for (const d of n.getAttributeNames()) if (d.endsWith(wt)) {
|
|
860
|
+
const u = p[r++], f = n.getAttribute(d).split(z), b = /([.?@])?(.*)/.exec(u);
|
|
861
|
+
a.push({ type: 1, index: o, name: b[2], strings: f, ctor: b[1] === "." ? Jt : b[1] === "?" ? Qt : b[1] === "@" ? ei : Ee }), n.removeAttribute(d);
|
|
862
|
+
} else d.startsWith(z) && (a.push({ type: 6, index: o }), n.removeAttribute(d));
|
|
863
|
+
if (kt.test(n.tagName)) {
|
|
864
|
+
const d = n.textContent.split(z), u = d.length - 1;
|
|
865
|
+
if (u > 0) {
|
|
866
|
+
n.textContent = $e ? $e.emptyScript : "";
|
|
867
|
+
for (let f = 0; f < u; f++) n.append(d[f], oe()), B.nextNode(), a.push({ type: 2, index: ++o });
|
|
868
|
+
n.append(d[u], oe());
|
|
868
869
|
}
|
|
869
870
|
}
|
|
870
|
-
} else if (n.nodeType === 8) if (n.data ===
|
|
871
|
+
} else if (n.nodeType === 8) if (n.data === $t) a.push({ type: 2, index: o });
|
|
871
872
|
else {
|
|
872
|
-
let
|
|
873
|
-
for (; (
|
|
873
|
+
let d = -1;
|
|
874
|
+
for (; (d = n.data.indexOf(z, d + 1)) !== -1; ) a.push({ type: 7, index: o }), d += z.length - 1;
|
|
874
875
|
}
|
|
875
876
|
o++;
|
|
876
877
|
}
|
|
@@ -884,10 +885,10 @@ function K(s, e, t = s, i) {
|
|
|
884
885
|
var r, l;
|
|
885
886
|
if (e === q) return e;
|
|
886
887
|
let n = i !== void 0 ? (r = t._$Co) == null ? void 0 : r[i] : t._$Cl;
|
|
887
|
-
const o =
|
|
888
|
+
const o = re(e) ? void 0 : e._$litDirective$;
|
|
888
889
|
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;
|
|
889
890
|
}
|
|
890
|
-
class
|
|
891
|
+
class Zt {
|
|
891
892
|
constructor(e, t) {
|
|
892
893
|
this._$AV = [], this._$AN = void 0, this._$AD = e, this._$AM = t;
|
|
893
894
|
}
|
|
@@ -899,29 +900,29 @@ class Gt {
|
|
|
899
900
|
}
|
|
900
901
|
u(e) {
|
|
901
902
|
const { el: { content: t }, parts: i } = this._$AD, n = ((e == null ? void 0 : e.creationScope) ?? F).importNode(t, !0);
|
|
902
|
-
|
|
903
|
-
let o =
|
|
903
|
+
B.currentNode = n;
|
|
904
|
+
let o = B.nextNode(), r = 0, l = 0, a = i[0];
|
|
904
905
|
for (; a !== void 0; ) {
|
|
905
906
|
if (r === a.index) {
|
|
906
907
|
let c;
|
|
907
|
-
a.type === 2 ? c = new
|
|
908
|
+
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];
|
|
908
909
|
}
|
|
909
|
-
r !== (a == null ? void 0 : a.index) && (o =
|
|
910
|
+
r !== (a == null ? void 0 : a.index) && (o = B.nextNode(), r++);
|
|
910
911
|
}
|
|
911
|
-
return
|
|
912
|
+
return B.currentNode = F, n;
|
|
912
913
|
}
|
|
913
914
|
p(e) {
|
|
914
915
|
let t = 0;
|
|
915
916
|
for (const i of this._$AV) i !== void 0 && (i.strings !== void 0 ? (i._$AI(e, i, t), t += i.strings.length - 2) : i._$AI(e[t])), t++;
|
|
916
917
|
}
|
|
917
918
|
}
|
|
918
|
-
class
|
|
919
|
+
class ue {
|
|
919
920
|
get _$AU() {
|
|
920
921
|
var e;
|
|
921
922
|
return ((e = this._$AM) == null ? void 0 : e._$AU) ?? this._$Cv;
|
|
922
923
|
}
|
|
923
924
|
constructor(e, t, i, n) {
|
|
924
|
-
this.type = 2, this._$AH =
|
|
925
|
+
this.type = 2, this._$AH = m, 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;
|
|
925
926
|
}
|
|
926
927
|
get parentNode() {
|
|
927
928
|
let e = this._$AA.parentNode;
|
|
@@ -935,7 +936,7 @@ class pe {
|
|
|
935
936
|
return this._$AB;
|
|
936
937
|
}
|
|
937
938
|
_$AI(e, t = this) {
|
|
938
|
-
e = K(this, e, t),
|
|
939
|
+
e = K(this, e, t), re(e) ? e === m || e == null || e === "" ? (this._$AH !== m && this._$AR(), this._$AH = m) : e !== this._$AH && e !== q && this._(e) : e._$litType$ !== void 0 ? this.$(e) : e.nodeType !== void 0 ? this.T(e) : Yt(e) ? this.k(e) : this._(e);
|
|
939
940
|
}
|
|
940
941
|
O(e) {
|
|
941
942
|
return this._$AA.parentNode.insertBefore(e, this._$AB);
|
|
@@ -944,26 +945,26 @@ class pe {
|
|
|
944
945
|
this._$AH !== e && (this._$AR(), this._$AH = this.O(e));
|
|
945
946
|
}
|
|
946
947
|
_(e) {
|
|
947
|
-
this._$AH !==
|
|
948
|
+
this._$AH !== m && re(this._$AH) ? this._$AA.nextSibling.data = e : this.T(F.createTextNode(e)), this._$AH = e;
|
|
948
949
|
}
|
|
949
950
|
$(e) {
|
|
950
951
|
var o;
|
|
951
|
-
const { values: t, _$litType$: i } = e, n = typeof i == "number" ? this._$AC(e) : (i.el === void 0 && (i.el =
|
|
952
|
+
const { values: t, _$litType$: i } = e, n = typeof i == "number" ? this._$AC(e) : (i.el === void 0 && (i.el = ae.createElement(Ct(i.h, i.h[0]), this.options)), i);
|
|
952
953
|
if (((o = this._$AH) == null ? void 0 : o._$AD) === n) this._$AH.p(t);
|
|
953
954
|
else {
|
|
954
|
-
const r = new
|
|
955
|
+
const r = new Zt(n, this), l = r.u(this.options);
|
|
955
956
|
r.p(t), this.T(l), this._$AH = r;
|
|
956
957
|
}
|
|
957
958
|
}
|
|
958
959
|
_$AC(e) {
|
|
959
|
-
let t =
|
|
960
|
-
return t === void 0 &&
|
|
960
|
+
let t = nt.get(e.strings);
|
|
961
|
+
return t === void 0 && nt.set(e.strings, t = new ae(e)), t;
|
|
961
962
|
}
|
|
962
963
|
k(e) {
|
|
963
|
-
|
|
964
|
+
He(this._$AH) || (this._$AH = [], this._$AR());
|
|
964
965
|
const t = this._$AH;
|
|
965
966
|
let i, n = 0;
|
|
966
|
-
for (const o of e) n === t.length ? t.push(i = new
|
|
967
|
+
for (const o of e) n === t.length ? t.push(i = new ue(this.O(oe()), this.O(oe()), this, this.options)) : i = t[n], i._$AI(o), n++;
|
|
967
968
|
n < t.length && (this._$AR(i && i._$AB.nextSibling, n), t.length = n);
|
|
968
969
|
}
|
|
969
970
|
_$AR(e = this._$AA.nextSibling, t) {
|
|
@@ -986,21 +987,21 @@ class Ee {
|
|
|
986
987
|
return this._$AM._$AU;
|
|
987
988
|
}
|
|
988
989
|
constructor(e, t, i, n, o) {
|
|
989
|
-
this.type = 1, this._$AH =
|
|
990
|
+
this.type = 1, this._$AH = m, 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 = m;
|
|
990
991
|
}
|
|
991
992
|
_$AI(e, t = this, i, n) {
|
|
992
993
|
const o = this.strings;
|
|
993
994
|
let r = !1;
|
|
994
|
-
if (o === void 0) e = K(this, e, t, 0), r = !
|
|
995
|
+
if (o === void 0) e = K(this, e, t, 0), r = !re(e) || e !== this._$AH && e !== q, r && (this._$AH = e);
|
|
995
996
|
else {
|
|
996
997
|
const l = e;
|
|
997
998
|
let a, c;
|
|
998
|
-
for (e = o[0], a = 0; a < o.length - 1; a++) c = K(this, l[i + a], t, a), c === q && (c = this._$AH[a]), r || (r = !
|
|
999
|
+
for (e = o[0], a = 0; a < o.length - 1; a++) c = K(this, l[i + a], t, a), c === q && (c = this._$AH[a]), r || (r = !re(c) || c !== this._$AH[a]), c === m ? e = m : e !== m && (e += (c ?? "") + o[a + 1]), this._$AH[a] = c;
|
|
999
1000
|
}
|
|
1000
1001
|
r && !n && this.j(e);
|
|
1001
1002
|
}
|
|
1002
1003
|
j(e) {
|
|
1003
|
-
e ===
|
|
1004
|
+
e === m ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, e ?? "");
|
|
1004
1005
|
}
|
|
1005
1006
|
}
|
|
1006
1007
|
class Jt extends Ee {
|
|
@@ -1008,24 +1009,24 @@ class Jt extends Ee {
|
|
|
1008
1009
|
super(...arguments), this.type = 3;
|
|
1009
1010
|
}
|
|
1010
1011
|
j(e) {
|
|
1011
|
-
this.element[this.name] = e ===
|
|
1012
|
+
this.element[this.name] = e === m ? void 0 : e;
|
|
1012
1013
|
}
|
|
1013
1014
|
}
|
|
1014
|
-
class
|
|
1015
|
+
class Qt extends Ee {
|
|
1015
1016
|
constructor() {
|
|
1016
1017
|
super(...arguments), this.type = 4;
|
|
1017
1018
|
}
|
|
1018
1019
|
j(e) {
|
|
1019
|
-
this.element.toggleAttribute(this.name, !!e && e !==
|
|
1020
|
+
this.element.toggleAttribute(this.name, !!e && e !== m);
|
|
1020
1021
|
}
|
|
1021
1022
|
}
|
|
1022
|
-
class
|
|
1023
|
+
class ei extends Ee {
|
|
1023
1024
|
constructor(e, t, i, n, o) {
|
|
1024
1025
|
super(e, t, i, n, o), this.type = 5;
|
|
1025
1026
|
}
|
|
1026
1027
|
_$AI(e, t = this) {
|
|
1027
|
-
if ((e = K(this, e, t, 0) ??
|
|
1028
|
-
const i = this._$AH, n = e ===
|
|
1028
|
+
if ((e = K(this, e, t, 0) ?? m) === q) return;
|
|
1029
|
+
const i = this._$AH, n = e === m && i !== m || e.capture !== i.capture || e.once !== i.once || e.passive !== i.passive, o = e !== m && (i === m || n);
|
|
1029
1030
|
n && this.element.removeEventListener(this.name, this, i), o && this.element.addEventListener(this.name, this, e), this._$AH = e;
|
|
1030
1031
|
}
|
|
1031
1032
|
handleEvent(e) {
|
|
@@ -1033,7 +1034,7 @@ class Qt extends Ee {
|
|
|
1033
1034
|
typeof this._$AH == "function" ? this._$AH.call(((t = this.options) == null ? void 0 : t.host) ?? this.element, e) : this._$AH.handleEvent(e);
|
|
1034
1035
|
}
|
|
1035
1036
|
}
|
|
1036
|
-
class
|
|
1037
|
+
class ti {
|
|
1037
1038
|
constructor(e, t, i) {
|
|
1038
1039
|
this.element = e, this.type = 6, this._$AN = void 0, this._$AM = t, this.options = i;
|
|
1039
1040
|
}
|
|
@@ -1045,13 +1046,13 @@ class ei {
|
|
|
1045
1046
|
}
|
|
1046
1047
|
}
|
|
1047
1048
|
const Pe = se.litHtmlPolyfillSupport;
|
|
1048
|
-
Pe == null || Pe(
|
|
1049
|
-
const
|
|
1049
|
+
Pe == null || Pe(ae, ue), (se.litHtmlVersions ?? (se.litHtmlVersions = [])).push("3.3.2");
|
|
1050
|
+
const ii = (s, e, t) => {
|
|
1050
1051
|
const i = (t == null ? void 0 : t.renderBefore) ?? e;
|
|
1051
1052
|
let n = i._$litPart$;
|
|
1052
1053
|
if (n === void 0) {
|
|
1053
1054
|
const o = (t == null ? void 0 : t.renderBefore) ?? null;
|
|
1054
|
-
i._$litPart$ = n = new
|
|
1055
|
+
i._$litPart$ = n = new ue(e.insertBefore(oe(), o), o, void 0, t ?? {});
|
|
1055
1056
|
}
|
|
1056
1057
|
return n._$AI(s), n;
|
|
1057
1058
|
};
|
|
@@ -1060,7 +1061,7 @@ const ti = (s, e, t) => {
|
|
|
1060
1061
|
* Copyright 2017 Google LLC
|
|
1061
1062
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
1062
1063
|
*/
|
|
1063
|
-
const
|
|
1064
|
+
const N = globalThis;
|
|
1064
1065
|
let S = class extends Y {
|
|
1065
1066
|
constructor() {
|
|
1066
1067
|
super(...arguments), this.renderOptions = { host: this }, this._$Do = void 0;
|
|
@@ -1072,7 +1073,7 @@ let S = class extends Y {
|
|
|
1072
1073
|
}
|
|
1073
1074
|
update(e) {
|
|
1074
1075
|
const t = this.render();
|
|
1075
|
-
this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(e), this._$Do =
|
|
1076
|
+
this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(e), this._$Do = ii(t, this.renderRoot, this.renderOptions);
|
|
1076
1077
|
}
|
|
1077
1078
|
connectedCallback() {
|
|
1078
1079
|
var e;
|
|
@@ -1086,11 +1087,11 @@ let S = class extends Y {
|
|
|
1086
1087
|
return q;
|
|
1087
1088
|
}
|
|
1088
1089
|
};
|
|
1089
|
-
var
|
|
1090
|
-
S._$litElement$ = !0, S.finalized = !0, (
|
|
1091
|
-
const Ae =
|
|
1090
|
+
var bt;
|
|
1091
|
+
S._$litElement$ = !0, S.finalized = !0, (bt = N.litElementHydrateSupport) == null || bt.call(N, { LitElement: S });
|
|
1092
|
+
const Ae = N.litElementPolyfillSupport;
|
|
1092
1093
|
Ae == null || Ae({ LitElement: S });
|
|
1093
|
-
(
|
|
1094
|
+
(N.litElementVersions ?? (N.litElementVersions = [])).push("4.2.2");
|
|
1094
1095
|
/**
|
|
1095
1096
|
* @license
|
|
1096
1097
|
* Copyright 2017 Google LLC
|
|
@@ -1106,7 +1107,7 @@ const R = (s) => (e, t) => {
|
|
|
1106
1107
|
* Copyright 2017 Google LLC
|
|
1107
1108
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
1108
1109
|
*/
|
|
1109
|
-
const
|
|
1110
|
+
const si = { attribute: !0, type: String, converter: we, reflect: !1, hasChanged: De }, ni = (s = si, e, t) => {
|
|
1110
1111
|
const { kind: i, metadata: n } = t;
|
|
1111
1112
|
let o = globalThis.litPropertyMetadata.get(n);
|
|
1112
1113
|
if (o === void 0 && globalThis.litPropertyMetadata.set(n, o = /* @__PURE__ */ new Map()), i === "setter" && ((s = Object.create(s)).wrapped = !0), o.set(t.name, s), i === "accessor") {
|
|
@@ -1128,7 +1129,7 @@ const ii = { attribute: !0, type: String, converter: ye, reflect: !1, hasChanged
|
|
|
1128
1129
|
throw Error("Unsupported decorator location: " + i);
|
|
1129
1130
|
};
|
|
1130
1131
|
function g(s) {
|
|
1131
|
-
return (e, t) => typeof t == "object" ?
|
|
1132
|
+
return (e, t) => typeof t == "object" ? ni(s, e, t) : ((i, n, o) => {
|
|
1132
1133
|
const r = n.hasOwnProperty(o);
|
|
1133
1134
|
return n.constructor.createProperty(o, i), r ? Object.getOwnPropertyDescriptor(n, o) : void 0;
|
|
1134
1135
|
})(s, e, t);
|
|
@@ -1141,13 +1142,13 @@ function g(s) {
|
|
|
1141
1142
|
function v(s) {
|
|
1142
1143
|
return g({ ...s, state: !0, attribute: !1 });
|
|
1143
1144
|
}
|
|
1144
|
-
const
|
|
1145
|
-
var
|
|
1146
|
-
for (var n = i > 1 ? void 0 : i ?
|
|
1145
|
+
const Z = "pulse-client";
|
|
1146
|
+
var oi = Object.defineProperty, ri = Object.getOwnPropertyDescriptor, J = (s, e, t, i) => {
|
|
1147
|
+
for (var n = i > 1 ? void 0 : i ? ri(e, t) : e, o = s.length - 1, r; o >= 0; o--)
|
|
1147
1148
|
(r = s[o]) && (n = (i ? r(e, t, n) : r(n)) || n);
|
|
1148
|
-
return i && n &&
|
|
1149
|
+
return i && n && oi(e, t, n), n;
|
|
1149
1150
|
};
|
|
1150
|
-
let
|
|
1151
|
+
let V = class extends S {
|
|
1151
1152
|
constructor() {
|
|
1152
1153
|
super(...arguments), this.apiKey = "", this.token = "", this.room = "";
|
|
1153
1154
|
}
|
|
@@ -1159,38 +1160,38 @@ let W = class extends S {
|
|
|
1159
1160
|
room: this.room,
|
|
1160
1161
|
endpoint: this.endpoint
|
|
1161
1162
|
};
|
|
1162
|
-
this.client = new
|
|
1163
|
+
this.client = new xt(s), this.client.connect();
|
|
1163
1164
|
}
|
|
1164
1165
|
disconnectedCallback() {
|
|
1165
1166
|
var s;
|
|
1166
1167
|
super.disconnectedCallback(), (s = this.client) == null || s.disconnect();
|
|
1167
1168
|
}
|
|
1168
1169
|
render() {
|
|
1169
|
-
return
|
|
1170
|
+
return h`<slot></slot>`;
|
|
1170
1171
|
}
|
|
1171
1172
|
};
|
|
1172
|
-
|
|
1173
|
+
J([
|
|
1173
1174
|
g({ attribute: "api-key" })
|
|
1174
|
-
],
|
|
1175
|
-
|
|
1175
|
+
], V.prototype, "apiKey", 2);
|
|
1176
|
+
J([
|
|
1176
1177
|
g()
|
|
1177
|
-
],
|
|
1178
|
-
|
|
1178
|
+
], V.prototype, "token", 2);
|
|
1179
|
+
J([
|
|
1179
1180
|
g()
|
|
1180
|
-
],
|
|
1181
|
-
|
|
1181
|
+
], V.prototype, "room", 2);
|
|
1182
|
+
J([
|
|
1182
1183
|
g()
|
|
1183
|
-
],
|
|
1184
|
-
|
|
1185
|
-
Mt({ context:
|
|
1186
|
-
],
|
|
1187
|
-
|
|
1184
|
+
], V.prototype, "endpoint", 2);
|
|
1185
|
+
J([
|
|
1186
|
+
Mt({ context: Z })
|
|
1187
|
+
], V.prototype, "client", 2);
|
|
1188
|
+
V = J([
|
|
1188
1189
|
R("pulse-provider")
|
|
1189
|
-
],
|
|
1190
|
-
var
|
|
1191
|
-
for (var n = i > 1 ? void 0 : i ?
|
|
1190
|
+
], V);
|
|
1191
|
+
var ai = Object.defineProperty, li = Object.getOwnPropertyDescriptor, Ce = (s, e, t, i) => {
|
|
1192
|
+
for (var n = i > 1 ? void 0 : i ? li(e, t) : e, o = s.length - 1, r; o >= 0; o--)
|
|
1192
1193
|
(r = s[o]) && (n = (i ? r(e, t, n) : r(n)) || n);
|
|
1193
|
-
return i && n &&
|
|
1194
|
+
return i && n && ai(e, t, n), n;
|
|
1194
1195
|
};
|
|
1195
1196
|
let G = class extends S {
|
|
1196
1197
|
constructor() {
|
|
@@ -1217,16 +1218,16 @@ let G = class extends S {
|
|
|
1217
1218
|
}
|
|
1218
1219
|
render() {
|
|
1219
1220
|
const s = this.users.slice(0, this.maxVisible), e = this.users.length - this.maxVisible;
|
|
1220
|
-
return
|
|
1221
|
+
return h`
|
|
1221
1222
|
<div class="avatars">
|
|
1222
|
-
${e > 0 ?
|
|
1223
|
+
${e > 0 ? h`<div class="overflow">+${e}</div>` : null}
|
|
1223
1224
|
${s.map(
|
|
1224
|
-
(t) =>
|
|
1225
|
+
(t) => h`
|
|
1225
1226
|
<div
|
|
1226
1227
|
class="avatar"
|
|
1227
1228
|
style="background:${t.user.color}"
|
|
1228
1229
|
>
|
|
1229
|
-
${t.user.avatar ?
|
|
1230
|
+
${t.user.avatar ? h`<img src="${t.user.avatar}" alt="${t.user.name}" />` : this.getInitials(t.user.name)}
|
|
1230
1231
|
<span class="status-ring ${t.status}"></span>
|
|
1231
1232
|
<span class="tooltip">${t.user.name}</span>
|
|
1232
1233
|
</div>
|
|
@@ -1236,7 +1237,7 @@ let G = class extends S {
|
|
|
1236
1237
|
`;
|
|
1237
1238
|
}
|
|
1238
1239
|
};
|
|
1239
|
-
G.styles =
|
|
1240
|
+
G.styles = I`
|
|
1240
1241
|
:host {
|
|
1241
1242
|
display: inline-flex;
|
|
1242
1243
|
align-items: center;
|
|
@@ -1341,7 +1342,7 @@ G.styles = M`
|
|
|
1341
1342
|
}
|
|
1342
1343
|
`;
|
|
1343
1344
|
Ce([
|
|
1344
|
-
|
|
1345
|
+
pe({ context: Z, subscribe: !0 }),
|
|
1345
1346
|
g({ attribute: !1 })
|
|
1346
1347
|
], G.prototype, "client", 2);
|
|
1347
1348
|
Ce([
|
|
@@ -1353,12 +1354,12 @@ Ce([
|
|
|
1353
1354
|
G = Ce([
|
|
1354
1355
|
R("pulse-presence")
|
|
1355
1356
|
], G);
|
|
1356
|
-
var
|
|
1357
|
-
for (var n = i > 1 ? void 0 : i ?
|
|
1357
|
+
var ci = Object.defineProperty, di = Object.getOwnPropertyDescriptor, Be = (s, e, t, i) => {
|
|
1358
|
+
for (var n = i > 1 ? void 0 : i ? di(e, t) : e, o = s.length - 1, r; o >= 0; o--)
|
|
1358
1359
|
(r = s[o]) && (n = (i ? r(e, t, n) : r(n)) || n);
|
|
1359
|
-
return i && n &&
|
|
1360
|
+
return i && n && ci(e, t, n), n;
|
|
1360
1361
|
};
|
|
1361
|
-
let
|
|
1362
|
+
let le = class extends S {
|
|
1362
1363
|
constructor() {
|
|
1363
1364
|
super(...arguments), this.cursors = /* @__PURE__ */ new Map(), this.unsubs = [], this.handleLocalCursor = (s) => {
|
|
1364
1365
|
var e;
|
|
@@ -1412,9 +1413,9 @@ let ae = class extends S {
|
|
|
1412
1413
|
}
|
|
1413
1414
|
render() {
|
|
1414
1415
|
const s = [...this.cursors.values()];
|
|
1415
|
-
return
|
|
1416
|
+
return h`
|
|
1416
1417
|
${s.map(
|
|
1417
|
-
(e) =>
|
|
1418
|
+
(e) => h`
|
|
1418
1419
|
<div
|
|
1419
1420
|
class="cursor"
|
|
1420
1421
|
style="transform:translate(${e.position.x}px,${e.position.y}px)"
|
|
@@ -1435,7 +1436,7 @@ let ae = class extends S {
|
|
|
1435
1436
|
`;
|
|
1436
1437
|
}
|
|
1437
1438
|
};
|
|
1438
|
-
|
|
1439
|
+
le.styles = I`
|
|
1439
1440
|
:host {
|
|
1440
1441
|
position: fixed;
|
|
1441
1442
|
top: 0;
|
|
@@ -1472,22 +1473,22 @@ ae.styles = M`
|
|
|
1472
1473
|
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
|
|
1473
1474
|
}
|
|
1474
1475
|
`;
|
|
1475
|
-
|
|
1476
|
-
|
|
1476
|
+
Be([
|
|
1477
|
+
pe({ context: Z, subscribe: !0 }),
|
|
1477
1478
|
g({ attribute: !1 })
|
|
1478
|
-
],
|
|
1479
|
-
|
|
1479
|
+
], le.prototype, "client", 2);
|
|
1480
|
+
Be([
|
|
1480
1481
|
v()
|
|
1481
|
-
],
|
|
1482
|
-
|
|
1482
|
+
], le.prototype, "cursors", 2);
|
|
1483
|
+
le = Be([
|
|
1483
1484
|
R("pulse-cursors")
|
|
1484
|
-
],
|
|
1485
|
-
var
|
|
1486
|
-
for (var n = i > 1 ? void 0 : i ?
|
|
1485
|
+
], le);
|
|
1486
|
+
var hi = Object.defineProperty, pi = Object.getOwnPropertyDescriptor, fe = (s, e, t, i) => {
|
|
1487
|
+
for (var n = i > 1 ? void 0 : i ? pi(e, t) : e, o = s.length - 1, r; o >= 0; o--)
|
|
1487
1488
|
(r = s[o]) && (n = (i ? r(e, t, n) : r(n)) || n);
|
|
1488
|
-
return i && n &&
|
|
1489
|
+
return i && n && hi(e, t, n), n;
|
|
1489
1490
|
};
|
|
1490
|
-
let
|
|
1491
|
+
let W = class extends S {
|
|
1491
1492
|
constructor() {
|
|
1492
1493
|
super(...arguments), this.showResolved = !1, this.threads = [], this.replyingTo = null;
|
|
1493
1494
|
}
|
|
@@ -1509,7 +1510,7 @@ let V = class extends S {
|
|
|
1509
1510
|
}
|
|
1510
1511
|
parseMentions(s) {
|
|
1511
1512
|
return s.split(/(@\w+)/g).map(
|
|
1512
|
-
(t) => t.startsWith("@") ?
|
|
1513
|
+
(t) => t.startsWith("@") ? h`<span class="mention">${t}</span>` : t
|
|
1513
1514
|
);
|
|
1514
1515
|
}
|
|
1515
1516
|
getInitials(s) {
|
|
@@ -1535,9 +1536,9 @@ let V = class extends S {
|
|
|
1535
1536
|
}
|
|
1536
1537
|
render() {
|
|
1537
1538
|
const s = this.showResolved ? this.threads : this.threads.filter((e) => !e.resolved);
|
|
1538
|
-
return
|
|
1539
|
+
return h`
|
|
1539
1540
|
<div class="threads">
|
|
1540
|
-
${s.length === 0 ?
|
|
1541
|
+
${s.length === 0 ? h`<div class="empty">
|
|
1541
1542
|
<div class="empty-icon">💬</div>
|
|
1542
1543
|
No comments yet.<br>Start a conversation below.
|
|
1543
1544
|
</div>` : s.map((e) => this.renderThread(e))}
|
|
@@ -1551,12 +1552,12 @@ let V = class extends S {
|
|
|
1551
1552
|
`;
|
|
1552
1553
|
}
|
|
1553
1554
|
renderThread(s) {
|
|
1554
|
-
return
|
|
1555
|
+
return h`
|
|
1555
1556
|
<div class="thread ${s.resolved ? "resolved" : ""}">
|
|
1556
1557
|
${s.comments.map((e, t) => {
|
|
1557
1558
|
const i = this.getUserForComment(e.userId);
|
|
1558
|
-
return
|
|
1559
|
-
${t > 0 ?
|
|
1559
|
+
return h`
|
|
1560
|
+
${t > 0 ? h`<div class="divider"></div>` : m}
|
|
1560
1561
|
<div class="comment">
|
|
1561
1562
|
<div class="comment-header">
|
|
1562
1563
|
<div
|
|
@@ -1588,12 +1589,12 @@ let V = class extends S {
|
|
|
1588
1589
|
${s.resolved ? "Reopen" : "Resolve"}
|
|
1589
1590
|
</button>
|
|
1590
1591
|
</div>
|
|
1591
|
-
${this.replyingTo === s.id ?
|
|
1592
|
+
${this.replyingTo === s.id ? h`
|
|
1592
1593
|
<form class="reply-form" @submit=${(e) => this.handleReply(s.id, e)}>
|
|
1593
1594
|
<input type="text" placeholder="Write a reply..." />
|
|
1594
1595
|
<button type="submit">Send</button>
|
|
1595
1596
|
</form>
|
|
1596
|
-
` :
|
|
1597
|
+
` : m}
|
|
1597
1598
|
</div>
|
|
1598
1599
|
`;
|
|
1599
1600
|
}
|
|
@@ -1605,7 +1606,7 @@ let V = class extends S {
|
|
|
1605
1606
|
return o < 24 ? `${o}h ago` : e.toLocaleDateString();
|
|
1606
1607
|
}
|
|
1607
1608
|
};
|
|
1608
|
-
|
|
1609
|
+
W.styles = I`
|
|
1609
1610
|
:host {
|
|
1610
1611
|
display: block;
|
|
1611
1612
|
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
|
|
@@ -1817,41 +1818,41 @@ V.styles = M`
|
|
|
1817
1818
|
opacity: 0.4;
|
|
1818
1819
|
}
|
|
1819
1820
|
`;
|
|
1820
|
-
|
|
1821
|
-
|
|
1821
|
+
fe([
|
|
1822
|
+
pe({ context: Z, subscribe: !0 }),
|
|
1822
1823
|
g({ attribute: !1 })
|
|
1823
|
-
],
|
|
1824
|
-
|
|
1824
|
+
], W.prototype, "client", 2);
|
|
1825
|
+
fe([
|
|
1825
1826
|
g({ type: Boolean, attribute: "show-resolved" })
|
|
1826
|
-
],
|
|
1827
|
-
|
|
1827
|
+
], W.prototype, "showResolved", 2);
|
|
1828
|
+
fe([
|
|
1828
1829
|
v()
|
|
1829
|
-
],
|
|
1830
|
-
|
|
1830
|
+
], W.prototype, "threads", 2);
|
|
1831
|
+
fe([
|
|
1831
1832
|
v()
|
|
1832
|
-
],
|
|
1833
|
-
|
|
1833
|
+
], W.prototype, "replyingTo", 2);
|
|
1834
|
+
W = fe([
|
|
1834
1835
|
R("pulse-comments")
|
|
1835
|
-
],
|
|
1836
|
-
var
|
|
1837
|
-
for (var n = i > 1 ? void 0 : i ?
|
|
1836
|
+
], W);
|
|
1837
|
+
var ui = Object.defineProperty, fi = Object.getOwnPropertyDescriptor, Ne = (s, e, t, i) => {
|
|
1838
|
+
for (var n = i > 1 ? void 0 : i ? fi(e, t) : e, o = s.length - 1, r; o >= 0; o--)
|
|
1838
1839
|
(r = s[o]) && (n = (i ? r(e, t, n) : r(n)) || n);
|
|
1839
|
-
return i && n &&
|
|
1840
|
+
return i && n && ui(e, t, n), n;
|
|
1840
1841
|
};
|
|
1841
|
-
const
|
|
1842
|
+
const mi = {
|
|
1842
1843
|
"comment:created": "left a comment",
|
|
1843
1844
|
"comment:mention": "mentioned you",
|
|
1844
1845
|
"comment:reply": "replied to your comment",
|
|
1845
1846
|
"thread:resolved": "resolved a thread",
|
|
1846
1847
|
"reaction:added": "reacted to your comment"
|
|
1847
|
-
},
|
|
1848
|
+
}, gi = {
|
|
1848
1849
|
"comment:created": "💬",
|
|
1849
1850
|
"comment:mention": "📣",
|
|
1850
1851
|
"comment:reply": "↩️",
|
|
1851
1852
|
"thread:resolved": "✅",
|
|
1852
1853
|
"reaction:added": "🎉"
|
|
1853
1854
|
};
|
|
1854
|
-
let
|
|
1855
|
+
let ce = class extends S {
|
|
1855
1856
|
constructor() {
|
|
1856
1857
|
super(...arguments), this.notifications = [];
|
|
1857
1858
|
}
|
|
@@ -1898,31 +1899,31 @@ let le = class extends S {
|
|
|
1898
1899
|
}
|
|
1899
1900
|
render() {
|
|
1900
1901
|
const s = this.notifications.filter((e) => !e.read).length;
|
|
1901
|
-
return
|
|
1902
|
+
return h`
|
|
1902
1903
|
<div class="header">
|
|
1903
1904
|
<span class="title">
|
|
1904
1905
|
Notifications
|
|
1905
|
-
${s > 0 ?
|
|
1906
|
+
${s > 0 ? h`<span class="badge">${s}</span>` : m}
|
|
1906
1907
|
</span>
|
|
1907
|
-
${s > 0 ?
|
|
1908
|
+
${s > 0 ? h`<button class="mark-all" @click=${() => this.client.markAllRead()}>
|
|
1908
1909
|
Mark all read
|
|
1909
|
-
</button>` :
|
|
1910
|
+
</button>` : m}
|
|
1910
1911
|
</div>
|
|
1911
1912
|
<div class="list">
|
|
1912
|
-
${this.notifications.length === 0 ?
|
|
1913
|
+
${this.notifications.length === 0 ? h`<div class="empty">
|
|
1913
1914
|
<div class="empty-icon">🔔</div>
|
|
1914
1915
|
No notifications yet
|
|
1915
1916
|
</div>` : this.notifications.map(
|
|
1916
|
-
(e) =>
|
|
1917
|
+
(e) => h`
|
|
1917
1918
|
<div
|
|
1918
1919
|
class="item ${e.read ? "" : "unread"}"
|
|
1919
1920
|
@click=${() => this.handleClick(e)}
|
|
1920
1921
|
>
|
|
1921
|
-
<span class="icon">${
|
|
1922
|
+
<span class="icon">${gi[e.type] ?? "🔔"}</span>
|
|
1922
1923
|
<div class="content">
|
|
1923
1924
|
<div class="text">
|
|
1924
1925
|
<span class="actor">${this.getActorName(e.actorId)}</span>
|
|
1925
|
-
${
|
|
1926
|
+
${mi[e.type] ?? e.type}
|
|
1926
1927
|
</div>
|
|
1927
1928
|
<div class="time">${this.formatTime(e.createdAt)}</div>
|
|
1928
1929
|
</div>
|
|
@@ -1934,7 +1935,7 @@ let le = class extends S {
|
|
|
1934
1935
|
`;
|
|
1935
1936
|
}
|
|
1936
1937
|
};
|
|
1937
|
-
|
|
1938
|
+
ce.styles = I`
|
|
1938
1939
|
:host {
|
|
1939
1940
|
display: block;
|
|
1940
1941
|
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
|
|
@@ -2076,21 +2077,21 @@ le.styles = M`
|
|
|
2076
2077
|
}
|
|
2077
2078
|
`;
|
|
2078
2079
|
Ne([
|
|
2079
|
-
|
|
2080
|
+
pe({ context: Z, subscribe: !0 }),
|
|
2080
2081
|
g({ attribute: !1 })
|
|
2081
|
-
],
|
|
2082
|
+
], ce.prototype, "client", 2);
|
|
2082
2083
|
Ne([
|
|
2083
2084
|
v()
|
|
2084
|
-
],
|
|
2085
|
-
|
|
2085
|
+
], ce.prototype, "notifications", 2);
|
|
2086
|
+
ce = Ne([
|
|
2086
2087
|
R("pulse-notifications")
|
|
2087
|
-
],
|
|
2088
|
-
var
|
|
2089
|
-
for (var n = i > 1 ? void 0 : i ?
|
|
2088
|
+
], ce);
|
|
2089
|
+
var bi = Object.defineProperty, vi = Object.getOwnPropertyDescriptor, Q = (s, e, t, i) => {
|
|
2090
|
+
for (var n = i > 1 ? void 0 : i ? vi(e, t) : e, o = s.length - 1, r; o >= 0; o--)
|
|
2090
2091
|
(r = s[o]) && (n = (i ? r(e, t, n) : r(n)) || n);
|
|
2091
|
-
return i && n &&
|
|
2092
|
+
return i && n && bi(e, t, n), n;
|
|
2092
2093
|
};
|
|
2093
|
-
const
|
|
2094
|
+
const xi = ["👍", "👎", "❤️", "🎉", "👀", "🚀"];
|
|
2094
2095
|
let D = class extends S {
|
|
2095
2096
|
constructor() {
|
|
2096
2097
|
super(...arguments), this.targetId = "", this.targetType = "comment", this.reactions = [], this.showPicker = !1;
|
|
@@ -2131,9 +2132,9 @@ let D = class extends S {
|
|
|
2131
2132
|
}
|
|
2132
2133
|
render() {
|
|
2133
2134
|
const s = this.groupReactions();
|
|
2134
|
-
return
|
|
2135
|
+
return h`
|
|
2135
2136
|
${s.map(
|
|
2136
|
-
(e) =>
|
|
2137
|
+
(e) => h`
|
|
2137
2138
|
<button
|
|
2138
2139
|
class="reaction ${e.userReactionId ? "active" : ""}"
|
|
2139
2140
|
@click=${() => this.toggleReaction(e)}
|
|
@@ -2150,22 +2151,22 @@ let D = class extends S {
|
|
|
2150
2151
|
>
|
|
2151
2152
|
+
|
|
2152
2153
|
</button>
|
|
2153
|
-
${this.showPicker ?
|
|
2154
|
+
${this.showPicker ? h`
|
|
2154
2155
|
<div class="picker">
|
|
2155
|
-
${
|
|
2156
|
-
(e) =>
|
|
2156
|
+
${xi.map(
|
|
2157
|
+
(e) => h`
|
|
2157
2158
|
<button @click=${() => this.addEmoji(e)}>
|
|
2158
2159
|
${e}
|
|
2159
2160
|
</button>
|
|
2160
2161
|
`
|
|
2161
2162
|
)}
|
|
2162
2163
|
</div>
|
|
2163
|
-
` :
|
|
2164
|
+
` : m}
|
|
2164
2165
|
</div>
|
|
2165
2166
|
`;
|
|
2166
2167
|
}
|
|
2167
2168
|
};
|
|
2168
|
-
D.styles =
|
|
2169
|
+
D.styles = I`
|
|
2169
2170
|
:host {
|
|
2170
2171
|
display: inline-flex;
|
|
2171
2172
|
align-items: center;
|
|
@@ -2278,7 +2279,7 @@ D.styles = M`
|
|
|
2278
2279
|
}
|
|
2279
2280
|
`;
|
|
2280
2281
|
Q([
|
|
2281
|
-
|
|
2282
|
+
pe({ context: Z, subscribe: !0 }),
|
|
2282
2283
|
g({ attribute: !1 })
|
|
2283
2284
|
], D.prototype, "client", 2);
|
|
2284
2285
|
Q([
|
|
@@ -2301,8 +2302,8 @@ D = Q([
|
|
|
2301
2302
|
* Copyright 2017 Google LLC
|
|
2302
2303
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
2303
2304
|
*/
|
|
2304
|
-
const
|
|
2305
|
-
class
|
|
2305
|
+
const yi = { CHILD: 2 }, wi = (s) => (...e) => ({ _$litDirective$: s, values: e });
|
|
2306
|
+
class $i {
|
|
2306
2307
|
constructor(e) {
|
|
2307
2308
|
}
|
|
2308
2309
|
get _$AU() {
|
|
@@ -2323,12 +2324,12 @@ class wi {
|
|
|
2323
2324
|
* Copyright 2017 Google LLC
|
|
2324
2325
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
2325
2326
|
*/
|
|
2326
|
-
class
|
|
2327
|
+
class Ie extends $i {
|
|
2327
2328
|
constructor(e) {
|
|
2328
|
-
if (super(e), this.it =
|
|
2329
|
+
if (super(e), this.it = m, e.type !== yi.CHILD) throw Error(this.constructor.directiveName + "() can only be used in child bindings");
|
|
2329
2330
|
}
|
|
2330
2331
|
render(e) {
|
|
2331
|
-
if (e ===
|
|
2332
|
+
if (e === m || e == null) return this._t = void 0, this.it = e;
|
|
2332
2333
|
if (e === q) return e;
|
|
2333
2334
|
if (typeof e != "string") throw Error(this.constructor.directiveName + "() called with a non-string value");
|
|
2334
2335
|
if (e === this.it) return this._t;
|
|
@@ -2337,23 +2338,23 @@ class Me extends wi {
|
|
|
2337
2338
|
return t.raw = t, this._t = { _$litType$: this.constructor.resultType, strings: t, values: [] };
|
|
2338
2339
|
}
|
|
2339
2340
|
}
|
|
2340
|
-
|
|
2341
|
+
Ie.directiveName = "unsafeHTML", Ie.resultType = 1;
|
|
2341
2342
|
/**
|
|
2342
2343
|
* @license
|
|
2343
2344
|
* Copyright 2017 Google LLC
|
|
2344
2345
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
2345
2346
|
*/
|
|
2346
|
-
class
|
|
2347
|
+
class Me extends Ie {
|
|
2347
2348
|
}
|
|
2348
|
-
|
|
2349
|
-
const
|
|
2349
|
+
Me.directiveName = "unsafeSVG", Me.resultType = 2;
|
|
2350
|
+
const ki = wi(Me);
|
|
2350
2351
|
/**
|
|
2351
2352
|
* @license lucide v0.577.0 - ISC
|
|
2352
2353
|
*
|
|
2353
2354
|
* This source code is licensed under the ISC license.
|
|
2354
2355
|
* See the LICENSE file in the root directory of this source tree.
|
|
2355
2356
|
*/
|
|
2356
|
-
const
|
|
2357
|
+
const Ei = [
|
|
2357
2358
|
["path", { d: "M10.268 21a2 2 0 0 0 3.464 0" }],
|
|
2358
2359
|
[
|
|
2359
2360
|
"path",
|
|
@@ -2368,7 +2369,7 @@ const ki = [
|
|
|
2368
2369
|
* This source code is licensed under the ISC license.
|
|
2369
2370
|
* See the LICENSE file in the root directory of this source tree.
|
|
2370
2371
|
*/
|
|
2371
|
-
const
|
|
2372
|
+
const Ci = [
|
|
2372
2373
|
["circle", { cx: "12", cy: "12", r: "10" }],
|
|
2373
2374
|
["path", { d: "M12 6v6l4 2" }]
|
|
2374
2375
|
];
|
|
@@ -2378,7 +2379,7 @@ const Ei = [
|
|
|
2378
2379
|
* This source code is licensed under the ISC license.
|
|
2379
2380
|
* See the LICENSE file in the root directory of this source tree.
|
|
2380
2381
|
*/
|
|
2381
|
-
const
|
|
2382
|
+
const _i = [
|
|
2382
2383
|
[
|
|
2383
2384
|
"path",
|
|
2384
2385
|
{
|
|
@@ -2392,7 +2393,7 @@ const Ci = [
|
|
|
2392
2393
|
* This source code is licensed under the ISC license.
|
|
2393
2394
|
* See the LICENSE file in the root directory of this source tree.
|
|
2394
2395
|
*/
|
|
2395
|
-
const
|
|
2396
|
+
const Ti = [
|
|
2396
2397
|
["path", { d: "M12 19v3" }],
|
|
2397
2398
|
["path", { d: "M19 10v2a7 7 0 0 1-14 0v-2" }],
|
|
2398
2399
|
["rect", { x: "9", y: "2", width: "6", height: "13", rx: "3" }]
|
|
@@ -2403,7 +2404,7 @@ const _i = [
|
|
|
2403
2404
|
* This source code is licensed under the ISC license.
|
|
2404
2405
|
* See the LICENSE file in the root directory of this source tree.
|
|
2405
2406
|
*/
|
|
2406
|
-
const
|
|
2407
|
+
const Si = [
|
|
2407
2408
|
[
|
|
2408
2409
|
"path",
|
|
2409
2410
|
{
|
|
@@ -2417,7 +2418,7 @@ const Ti = [
|
|
|
2417
2418
|
* This source code is licensed under the ISC license.
|
|
2418
2419
|
* See the LICENSE file in the root directory of this source tree.
|
|
2419
2420
|
*/
|
|
2420
|
-
const
|
|
2421
|
+
const Pi = [
|
|
2421
2422
|
[
|
|
2422
2423
|
"path",
|
|
2423
2424
|
{
|
|
@@ -2439,7 +2440,7 @@ const Si = [
|
|
|
2439
2440
|
* This source code is licensed under the ISC license.
|
|
2440
2441
|
* See the LICENSE file in the root directory of this source tree.
|
|
2441
2442
|
*/
|
|
2442
|
-
const
|
|
2443
|
+
const Ai = [
|
|
2443
2444
|
[
|
|
2444
2445
|
"path",
|
|
2445
2446
|
{
|
|
@@ -2454,7 +2455,7 @@ const Pi = [
|
|
|
2454
2455
|
* This source code is licensed under the ISC license.
|
|
2455
2456
|
* See the LICENSE file in the root directory of this source tree.
|
|
2456
2457
|
*/
|
|
2457
|
-
const
|
|
2458
|
+
const _t = [
|
|
2458
2459
|
["path", { d: "M12 17v5" }],
|
|
2459
2460
|
[
|
|
2460
2461
|
"path",
|
|
@@ -2469,7 +2470,7 @@ const Ct = [
|
|
|
2469
2470
|
* This source code is licensed under the ISC license.
|
|
2470
2471
|
* See the LICENSE file in the root directory of this source tree.
|
|
2471
2472
|
*/
|
|
2472
|
-
const
|
|
2473
|
+
const Ii = [
|
|
2473
2474
|
[
|
|
2474
2475
|
"path",
|
|
2475
2476
|
{
|
|
@@ -2497,7 +2498,17 @@ const Mi = [
|
|
|
2497
2498
|
* This source code is licensed under the ISC license.
|
|
2498
2499
|
* See the LICENSE file in the root directory of this source tree.
|
|
2499
2500
|
*/
|
|
2500
|
-
const
|
|
2501
|
+
const Oi = [
|
|
2502
|
+
["path", { d: "m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5" }],
|
|
2503
|
+
["rect", { x: "2", y: "6", width: "14", height: "12", rx: "2" }]
|
|
2504
|
+
];
|
|
2505
|
+
/**
|
|
2506
|
+
* @license lucide v0.577.0 - ISC
|
|
2507
|
+
*
|
|
2508
|
+
* This source code is licensed under the ISC license.
|
|
2509
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
2510
|
+
*/
|
|
2511
|
+
const me = [
|
|
2501
2512
|
["path", { d: "M18 6 6 18" }],
|
|
2502
2513
|
["path", { d: "m6 6 12 12" }]
|
|
2503
2514
|
];
|
|
@@ -2507,7 +2518,7 @@ const fe = [
|
|
|
2507
2518
|
* This source code is licensed under the ISC license.
|
|
2508
2519
|
* See the LICENSE file in the root directory of this source tree.
|
|
2509
2520
|
*/
|
|
2510
|
-
const
|
|
2521
|
+
const Ri = [
|
|
2511
2522
|
[
|
|
2512
2523
|
"path",
|
|
2513
2524
|
{
|
|
@@ -2515,14 +2526,14 @@ const Ii = [
|
|
|
2515
2526
|
}
|
|
2516
2527
|
]
|
|
2517
2528
|
];
|
|
2518
|
-
function
|
|
2529
|
+
function Li(s) {
|
|
2519
2530
|
return s.map(([e, t]) => {
|
|
2520
2531
|
const i = Object.entries(t).filter(([, n]) => n != null).map(([n, o]) => `${n}="${o}"`).join(" ");
|
|
2521
2532
|
return `<${e} ${i}/>`;
|
|
2522
2533
|
}).join("");
|
|
2523
2534
|
}
|
|
2524
|
-
function
|
|
2525
|
-
return
|
|
2535
|
+
function E(s, e = 18) {
|
|
2536
|
+
return Kt`<svg
|
|
2526
2537
|
xmlns="http://www.w3.org/2000/svg"
|
|
2527
2538
|
width="${e}"
|
|
2528
2539
|
height="${e}"
|
|
@@ -2532,9 +2543,9 @@ function C(s, e = 18) {
|
|
|
2532
2543
|
stroke-width="2"
|
|
2533
2544
|
stroke-linecap="round"
|
|
2534
2545
|
stroke-linejoin="round"
|
|
2535
|
-
>${
|
|
2546
|
+
>${ki(Li(s))}</svg>`;
|
|
2536
2547
|
}
|
|
2537
|
-
const ee =
|
|
2548
|
+
const ee = I`
|
|
2538
2549
|
* {
|
|
2539
2550
|
box-sizing: border-box;
|
|
2540
2551
|
margin: 0;
|
|
@@ -2577,7 +2588,7 @@ const ee = M`
|
|
|
2577
2588
|
--pw-shadow: var(--pulse-shadow);
|
|
2578
2589
|
--pw-shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.16), 0 2px 8px rgba(0, 0, 0, 0.08);
|
|
2579
2590
|
}
|
|
2580
|
-
`,
|
|
2591
|
+
`, ge = I`
|
|
2581
2592
|
.pw-btn {
|
|
2582
2593
|
display: inline-flex;
|
|
2583
2594
|
align-items: center;
|
|
@@ -2621,7 +2632,7 @@ const ee = M`
|
|
|
2621
2632
|
width: 18px;
|
|
2622
2633
|
height: 18px;
|
|
2623
2634
|
}
|
|
2624
|
-
`, _e =
|
|
2635
|
+
`, _e = I`
|
|
2625
2636
|
.pw-scrollable::-webkit-scrollbar {
|
|
2626
2637
|
width: 4px;
|
|
2627
2638
|
}
|
|
@@ -2633,10 +2644,10 @@ const ee = M`
|
|
|
2633
2644
|
background: transparent;
|
|
2634
2645
|
}
|
|
2635
2646
|
`;
|
|
2636
|
-
var
|
|
2637
|
-
for (var n = i > 1 ? void 0 : i ?
|
|
2647
|
+
var ji = Object.defineProperty, zi = Object.getOwnPropertyDescriptor, Fe = (s, e, t, i) => {
|
|
2648
|
+
for (var n = i > 1 ? void 0 : i ? zi(e, t) : e, o = s.length - 1, r; o >= 0; o--)
|
|
2638
2649
|
(r = s[o]) && (n = (i ? r(e, t, n) : r(n)) || n);
|
|
2639
|
-
return i && n &&
|
|
2650
|
+
return i && n && ji(e, t, n), n;
|
|
2640
2651
|
};
|
|
2641
2652
|
let X = class extends S {
|
|
2642
2653
|
constructor() {
|
|
@@ -2684,18 +2695,18 @@ let X = class extends S {
|
|
|
2684
2695
|
);
|
|
2685
2696
|
}
|
|
2686
2697
|
render() {
|
|
2687
|
-
return
|
|
2698
|
+
return h`
|
|
2688
2699
|
<div class="panel">
|
|
2689
2700
|
<div class="panel-header">
|
|
2690
2701
|
<span class="panel-title">Activity</span>
|
|
2691
2702
|
<button class="close-btn" @click=${this.fireClose} title="Close">
|
|
2692
|
-
${
|
|
2703
|
+
${E(me, 16)}
|
|
2693
2704
|
</button>
|
|
2694
2705
|
</div>
|
|
2695
2706
|
|
|
2696
2707
|
<div class="panel-body pw-scrollable">
|
|
2697
|
-
${this.items.length === 0 ?
|
|
2698
|
-
(s) =>
|
|
2708
|
+
${this.items.length === 0 ? h`<div class="empty">No activity yet</div>` : this.items.map(
|
|
2709
|
+
(s) => h`
|
|
2699
2710
|
<div class="activity-item">
|
|
2700
2711
|
<div
|
|
2701
2712
|
class="activity-dot"
|
|
@@ -2703,7 +2714,7 @@ let X = class extends S {
|
|
|
2703
2714
|
></div>
|
|
2704
2715
|
<div class="activity-content">
|
|
2705
2716
|
<div class="activity-text">
|
|
2706
|
-
${s.userId ?
|
|
2717
|
+
${s.userId ? h`<span class="activity-user"
|
|
2707
2718
|
>${this.getUserName(s.userId)}</span
|
|
2708
2719
|
>
|
|
2709
2720
|
${s.description}` : s.description}
|
|
@@ -2722,9 +2733,9 @@ let X = class extends S {
|
|
|
2722
2733
|
};
|
|
2723
2734
|
X.styles = [
|
|
2724
2735
|
ee,
|
|
2725
|
-
|
|
2736
|
+
ge,
|
|
2726
2737
|
_e,
|
|
2727
|
-
|
|
2738
|
+
I`
|
|
2728
2739
|
:host {
|
|
2729
2740
|
display: block;
|
|
2730
2741
|
}
|
|
@@ -2849,17 +2860,17 @@ X.TYPE_COLORS = {
|
|
|
2849
2860
|
comment: "#3b82f6",
|
|
2850
2861
|
resolve: "#22c55e"
|
|
2851
2862
|
};
|
|
2852
|
-
|
|
2863
|
+
Fe([
|
|
2853
2864
|
g({ attribute: !1 })
|
|
2854
2865
|
], X.prototype, "client", 2);
|
|
2855
|
-
|
|
2866
|
+
Fe([
|
|
2856
2867
|
v()
|
|
2857
2868
|
], X.prototype, "items", 2);
|
|
2858
|
-
X =
|
|
2869
|
+
X = Fe([
|
|
2859
2870
|
R("pulse-widget-activity-panel")
|
|
2860
2871
|
], X);
|
|
2861
|
-
const
|
|
2862
|
-
function
|
|
2872
|
+
const Ui = "-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif", ot = "#6366f1", rt = "#e2e8f0", Di = "#f8fafc", Hi = "#e2e8f0", at = "#64748b", xe = 28, Bi = Array.from({ length: xe }, (s, e) => 0.2 + Math.abs(Math.sin(e * 12.9898 + 78.233) * 43758.5453) % 1 * 0.8);
|
|
2873
|
+
function lt(s) {
|
|
2863
2874
|
const e = Math.max(0, Math.floor(s)), t = Math.floor(e / 60), i = e % 60;
|
|
2864
2875
|
return `${t}:${i.toString().padStart(2, "0")}`;
|
|
2865
2876
|
}
|
|
@@ -2884,12 +2895,12 @@ class Oe {
|
|
|
2884
2895
|
width: "220px",
|
|
2885
2896
|
height: "44px",
|
|
2886
2897
|
padding: "0 10px",
|
|
2887
|
-
background:
|
|
2898
|
+
background: Di,
|
|
2888
2899
|
borderRadius: "12px",
|
|
2889
|
-
border: `1px solid ${
|
|
2890
|
-
fontFamily:
|
|
2900
|
+
border: `1px solid ${Hi}`,
|
|
2901
|
+
fontFamily: Ui,
|
|
2891
2902
|
fontSize: "11px",
|
|
2892
|
-
color:
|
|
2903
|
+
color: at,
|
|
2893
2904
|
userSelect: "none",
|
|
2894
2905
|
boxSizing: "border-box"
|
|
2895
2906
|
});
|
|
@@ -2900,7 +2911,7 @@ class Oe {
|
|
|
2900
2911
|
minWidth: "28px",
|
|
2901
2912
|
borderRadius: "50%",
|
|
2902
2913
|
border: "none",
|
|
2903
|
-
background:
|
|
2914
|
+
background: ot,
|
|
2904
2915
|
cursor: "pointer",
|
|
2905
2916
|
display: "flex",
|
|
2906
2917
|
alignItems: "center",
|
|
@@ -2916,20 +2927,20 @@ class Oe {
|
|
|
2916
2927
|
height: "12px",
|
|
2917
2928
|
lineHeight: "0"
|
|
2918
2929
|
});
|
|
2919
|
-
function
|
|
2930
|
+
function p() {
|
|
2920
2931
|
c.innerHTML = `<svg width="10" height="12" viewBox="0 0 10 12" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2921
2932
|
<path d="M1 1L9 6L1 11V1Z" fill="white" stroke="white" stroke-width="1" stroke-linejoin="round"/>
|
|
2922
2933
|
</svg>`;
|
|
2923
2934
|
}
|
|
2924
|
-
function
|
|
2935
|
+
function d() {
|
|
2925
2936
|
c.innerHTML = `<svg width="10" height="12" viewBox="0 0 10 12" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2926
2937
|
<rect x="1" y="1" width="2.5" height="10" rx="0.5" fill="white"/>
|
|
2927
2938
|
<rect x="6.5" y="1" width="2.5" height="10" rx="0.5" fill="white"/>
|
|
2928
2939
|
</svg>`;
|
|
2929
2940
|
}
|
|
2930
|
-
|
|
2931
|
-
const
|
|
2932
|
-
Object.assign(
|
|
2941
|
+
p(), a.appendChild(c);
|
|
2942
|
+
const u = document.createElement("div");
|
|
2943
|
+
Object.assign(u.style, {
|
|
2933
2944
|
flex: "1",
|
|
2934
2945
|
display: "flex",
|
|
2935
2946
|
flexDirection: "column",
|
|
@@ -2946,13 +2957,13 @@ class Oe {
|
|
|
2946
2957
|
cursor: "pointer"
|
|
2947
2958
|
});
|
|
2948
2959
|
const b = [];
|
|
2949
|
-
for (let k = 0; k <
|
|
2950
|
-
const A = document.createElement("div"), w = Math.round(
|
|
2960
|
+
for (let k = 0; k < xe; k++) {
|
|
2961
|
+
const A = document.createElement("div"), w = Math.round(Bi[k] * 20);
|
|
2951
2962
|
Object.assign(A.style, {
|
|
2952
2963
|
flex: "1",
|
|
2953
2964
|
height: `${Math.max(3, w)}px`,
|
|
2954
2965
|
borderRadius: "1px",
|
|
2955
|
-
background:
|
|
2966
|
+
background: rt,
|
|
2956
2967
|
transition: "background 0.1s ease",
|
|
2957
2968
|
minWidth: "0"
|
|
2958
2969
|
}), b.push(A), f.appendChild(A);
|
|
@@ -2960,19 +2971,19 @@ class Oe {
|
|
|
2960
2971
|
const x = document.createElement("div");
|
|
2961
2972
|
Object.assign(x.style, {
|
|
2962
2973
|
fontSize: "10px",
|
|
2963
|
-
color:
|
|
2974
|
+
color: at,
|
|
2964
2975
|
whiteSpace: "nowrap",
|
|
2965
2976
|
lineHeight: "1"
|
|
2966
2977
|
});
|
|
2967
2978
|
function _() {
|
|
2968
|
-
const k =
|
|
2979
|
+
const k = lt(o), A = lt(n);
|
|
2969
2980
|
x.textContent = `${k} / ${A}`;
|
|
2970
2981
|
}
|
|
2971
|
-
_(),
|
|
2982
|
+
_(), u.appendChild(f), u.appendChild(x), l.appendChild(a), l.appendChild(u);
|
|
2972
2983
|
function $() {
|
|
2973
|
-
const k = n > 0 ? o / n : 0, A = Math.floor(k *
|
|
2974
|
-
for (let w = 0; w <
|
|
2975
|
-
b[w].style.background = w <= A ?
|
|
2984
|
+
const k = n > 0 ? o / n : 0, A = Math.floor(k * xe);
|
|
2985
|
+
for (let w = 0; w < xe; w++)
|
|
2986
|
+
b[w].style.background = w <= A ? ot : rt;
|
|
2976
2987
|
}
|
|
2977
2988
|
return f.addEventListener("click", (k) => {
|
|
2978
2989
|
if (n <= 0) return;
|
|
@@ -2985,11 +2996,11 @@ class Oe {
|
|
|
2985
2996
|
i ? r.pause() : r.play().catch(() => {
|
|
2986
2997
|
});
|
|
2987
2998
|
}), r.addEventListener("play", () => {
|
|
2988
|
-
i = !0,
|
|
2999
|
+
i = !0, d();
|
|
2989
3000
|
}), r.addEventListener("pause", () => {
|
|
2990
|
-
i = !1,
|
|
3001
|
+
i = !1, p();
|
|
2991
3002
|
}), r.addEventListener("ended", () => {
|
|
2992
|
-
i = !1,
|
|
3003
|
+
i = !1, p(), o = 0, $(), _();
|
|
2993
3004
|
}), r.addEventListener("timeupdate", () => {
|
|
2994
3005
|
o = r.currentTime, $(), _();
|
|
2995
3006
|
}), r.addEventListener("loadedmetadata", () => {
|
|
@@ -3023,9 +3034,9 @@ class Re {
|
|
|
3023
3034
|
this.resolve = l;
|
|
3024
3035
|
});
|
|
3025
3036
|
return this.recorder.onstop = () => {
|
|
3026
|
-
var c,
|
|
3037
|
+
var c, p;
|
|
3027
3038
|
const l = ((c = this.recorder) == null ? void 0 : c.mimeType) || i || "audio/webm", a = new Blob(o, { type: l });
|
|
3028
|
-
(
|
|
3039
|
+
(p = this.resolve) == null || p.call(this, a), this.resolve = null, this.cleanupResources();
|
|
3029
3040
|
}, this.recorder.start(), this.recording = !0, this.startTime = Date.now(), this.maxTimer = setTimeout(() => {
|
|
3030
3041
|
this.stopRecording();
|
|
3031
3042
|
}, this.maxDuration), this.animate(), r;
|
|
@@ -3130,8 +3141,8 @@ class Re {
|
|
|
3130
3141
|
this.analyser.getByteFrequencyData(o), e.clearRect(0, 0, t, i);
|
|
3131
3142
|
const r = n, l = Math.max(2, t / r * 0.7), a = (t - l * r) / (r - 1 || 1);
|
|
3132
3143
|
for (let c = 0; c < r; c++) {
|
|
3133
|
-
const
|
|
3134
|
-
e.fillStyle = `rgba(99, 102, 241, ${b})`, e.beginPath(), e.roundRect(
|
|
3144
|
+
const p = o[c] / 255, d = Math.max(2, p * i * 0.85), u = c * (l + a), f = (i - d) / 2, b = 0.4 + p * 0.6;
|
|
3145
|
+
e.fillStyle = `rgba(99, 102, 241, ${b})`, e.beginPath(), e.roundRect(u, f, l, d, 1), e.fill();
|
|
3135
3146
|
}
|
|
3136
3147
|
}
|
|
3137
3148
|
updateTimer() {
|
|
@@ -3149,22 +3160,22 @@ class Re {
|
|
|
3149
3160
|
this.recorder = null, this.container && (this.container.remove(), this.container = null), this.canvas = null, this.timerEl = null;
|
|
3150
3161
|
}
|
|
3151
3162
|
}
|
|
3152
|
-
const
|
|
3163
|
+
const ct = 80, Ni = "#e2e8f0", Fi = `
|
|
3153
3164
|
<svg width="28" height="28" viewBox="0 0 28 28" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
3154
3165
|
<circle cx="14" cy="14" r="14" fill="rgba(0,0,0,0.35)"/>
|
|
3155
3166
|
<polygon points="11,8 22,14 11,20" fill="rgba(255,255,255,0.9)"/>
|
|
3156
|
-
</svg>`,
|
|
3167
|
+
</svg>`, dt = `
|
|
3157
3168
|
<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">
|
|
3158
3169
|
<polygon points="11,5 6,9 2,9 2,15 6,15 11,19"/>
|
|
3159
3170
|
<line x1="23" y1="9" x2="17" y2="15"/>
|
|
3160
3171
|
<line x1="17" y1="9" x2="23" y2="15"/>
|
|
3161
|
-
</svg>`,
|
|
3172
|
+
</svg>`, qi = `
|
|
3162
3173
|
<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">
|
|
3163
3174
|
<polygon points="11,5 6,9 2,9 2,15 6,15 11,19"/>
|
|
3164
3175
|
<path d="M19.07 4.93a10 10 0 0 1 0 14.14"/>
|
|
3165
3176
|
<path d="M15.54 8.46a5 5 0 0 1 0 7.07"/>
|
|
3166
3177
|
</svg>`;
|
|
3167
|
-
class
|
|
3178
|
+
class Tt {
|
|
3168
3179
|
/**
|
|
3169
3180
|
* Renders an inline circular video player and returns the root container.
|
|
3170
3181
|
* @param url - Video source URL
|
|
@@ -3176,10 +3187,10 @@ class _t {
|
|
|
3176
3187
|
Object.assign(o.style, {
|
|
3177
3188
|
position: "relative",
|
|
3178
3189
|
display: "inline-block",
|
|
3179
|
-
width: `${
|
|
3180
|
-
height: `${
|
|
3190
|
+
width: `${ct}px`,
|
|
3191
|
+
height: `${ct}px`,
|
|
3181
3192
|
borderRadius: "50%",
|
|
3182
|
-
border: `2px solid ${
|
|
3193
|
+
border: `2px solid ${Ni}`,
|
|
3183
3194
|
boxShadow: "0 2px 8px rgba(0,0,0,0.1)",
|
|
3184
3195
|
overflow: "hidden",
|
|
3185
3196
|
cursor: "pointer",
|
|
@@ -3209,7 +3220,7 @@ class _t {
|
|
|
3209
3220
|
transition: "opacity 0.25s ease",
|
|
3210
3221
|
opacity: "1",
|
|
3211
3222
|
pointerEvents: "none"
|
|
3212
|
-
}), l.innerHTML =
|
|
3223
|
+
}), l.innerHTML = Fi, o.appendChild(l);
|
|
3213
3224
|
const a = document.createElement("div");
|
|
3214
3225
|
Object.assign(a.style, {
|
|
3215
3226
|
position: "absolute",
|
|
@@ -3224,22 +3235,22 @@ class _t {
|
|
|
3224
3235
|
justifyContent: "center",
|
|
3225
3236
|
pointerEvents: "none",
|
|
3226
3237
|
transition: "opacity 0.2s ease"
|
|
3227
|
-
}), a.innerHTML =
|
|
3238
|
+
}), a.innerHTML = dt, o.appendChild(a);
|
|
3228
3239
|
function c() {
|
|
3229
3240
|
l.style.opacity = i ? "0" : "1";
|
|
3230
3241
|
}
|
|
3231
|
-
function
|
|
3232
|
-
a.style.display = i ? "flex" : "none", a.innerHTML = n ?
|
|
3242
|
+
function p() {
|
|
3243
|
+
a.style.display = i ? "flex" : "none", a.innerHTML = n ? dt : qi;
|
|
3233
3244
|
}
|
|
3234
|
-
return o.addEventListener("click", (
|
|
3235
|
-
|
|
3236
|
-
}), i = !0), c(),
|
|
3245
|
+
return o.addEventListener("click", (d) => {
|
|
3246
|
+
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(() => {
|
|
3247
|
+
}), i = !0), c(), p();
|
|
3237
3248
|
}), r.addEventListener("pause", () => {
|
|
3238
|
-
i && (i = !1, n = !0, r.muted = !0, c(),
|
|
3249
|
+
i && (i = !1, n = !0, r.muted = !0, c(), p());
|
|
3239
3250
|
}), o;
|
|
3240
3251
|
}
|
|
3241
3252
|
}
|
|
3242
|
-
const
|
|
3253
|
+
const ht = 60, Vi = `
|
|
3243
3254
|
.vr-overlay {
|
|
3244
3255
|
display: flex;
|
|
3245
3256
|
flex-direction: column;
|
|
@@ -3346,14 +3357,14 @@ const dt = 60, Fi = `
|
|
|
3346
3357
|
color: #0f172a;
|
|
3347
3358
|
}
|
|
3348
3359
|
`;
|
|
3349
|
-
function
|
|
3360
|
+
function pt(s) {
|
|
3350
3361
|
return s.toString().padStart(2, "0");
|
|
3351
3362
|
}
|
|
3352
|
-
function
|
|
3363
|
+
function Wi(s) {
|
|
3353
3364
|
const e = Math.floor(s / 60), t = s % 60;
|
|
3354
|
-
return `${
|
|
3365
|
+
return `${pt(e)}:${pt(t)}`;
|
|
3355
3366
|
}
|
|
3356
|
-
function
|
|
3367
|
+
function Xi() {
|
|
3357
3368
|
const s = [
|
|
3358
3369
|
"video/webm;codecs=vp9,opus",
|
|
3359
3370
|
"video/webm;codecs=vp8,opus",
|
|
@@ -3364,7 +3375,7 @@ function Wi() {
|
|
|
3364
3375
|
if (MediaRecorder.isTypeSupported(e)) return e;
|
|
3365
3376
|
return "";
|
|
3366
3377
|
}
|
|
3367
|
-
function
|
|
3378
|
+
function Yi(s) {
|
|
3368
3379
|
return new Promise((e, t) => {
|
|
3369
3380
|
const i = URL.createObjectURL(s), n = document.createElement("video");
|
|
3370
3381
|
n.muted = !0, n.playsInline = !0, n.preload = "auto", n.src = i, n.addEventListener("loadeddata", () => {
|
|
@@ -3383,7 +3394,7 @@ function Vi(s) {
|
|
|
3383
3394
|
}), n.load();
|
|
3384
3395
|
});
|
|
3385
3396
|
}
|
|
3386
|
-
class
|
|
3397
|
+
class Le {
|
|
3387
3398
|
constructor() {
|
|
3388
3399
|
this.recording = !1, this.container = null, this.stream = null, this.mediaRecorder = null, this.chunks = [], this.timerInterval = null, this.elapsed = 0, this.resolvePromise = null, this.root = null, this.styleEl = null, this.videoEl = null, this.timerEl = null;
|
|
3389
3400
|
}
|
|
@@ -3400,7 +3411,7 @@ class Xi {
|
|
|
3400
3411
|
}
|
|
3401
3412
|
this.stream = t, this.container = e, this.recording = !0, this.elapsed = 0, this.chunks = [], this.buildUI(e), this.videoEl && (this.videoEl.srcObject = t, this.videoEl.play().catch(() => {
|
|
3402
3413
|
}));
|
|
3403
|
-
const i =
|
|
3414
|
+
const i = Xi(), n = {};
|
|
3404
3415
|
i && (n.mimeType = i);
|
|
3405
3416
|
const o = new MediaRecorder(t, n);
|
|
3406
3417
|
return this.mediaRecorder = o, o.ondataavailable = (r) => {
|
|
@@ -3408,7 +3419,7 @@ class Xi {
|
|
|
3408
3419
|
}, o.onstop = () => {
|
|
3409
3420
|
this.handleRecordingComplete();
|
|
3410
3421
|
}, o.start(), this.timerInterval = setInterval(() => {
|
|
3411
|
-
this.elapsed++, this.updateTimer(), this.elapsed >=
|
|
3422
|
+
this.elapsed++, this.updateTimer(), this.elapsed >= ht && this.stopRecording();
|
|
3412
3423
|
}, 1e3), new Promise((r) => {
|
|
3413
3424
|
this.resolvePromise = r;
|
|
3414
3425
|
});
|
|
@@ -3425,7 +3436,7 @@ class Xi {
|
|
|
3425
3436
|
}
|
|
3426
3437
|
// ── Private ──
|
|
3427
3438
|
buildUI(e) {
|
|
3428
|
-
this.styleEl = document.createElement("style"), this.styleEl.textContent =
|
|
3439
|
+
this.styleEl = document.createElement("style"), this.styleEl.textContent = Vi, document.head.appendChild(this.styleEl), this.root = document.createElement("div"), this.root.className = "vr-overlay";
|
|
3429
3440
|
const t = document.createElement("div");
|
|
3430
3441
|
t.className = "vr-circle-wrapper";
|
|
3431
3442
|
const i = document.createElement("div");
|
|
@@ -3441,15 +3452,15 @@ class Xi {
|
|
|
3441
3452
|
}
|
|
3442
3453
|
updateTimer() {
|
|
3443
3454
|
if (!this.timerEl) return;
|
|
3444
|
-
const e =
|
|
3445
|
-
this.timerEl.textContent =
|
|
3455
|
+
const e = ht - this.elapsed;
|
|
3456
|
+
this.timerEl.textContent = Wi(this.elapsed), e <= 10 ? this.timerEl.classList.add("vr-countdown") : this.timerEl.classList.remove("vr-countdown");
|
|
3446
3457
|
}
|
|
3447
3458
|
async handleRecordingComplete() {
|
|
3448
3459
|
var n, o;
|
|
3449
3460
|
const e = ((n = this.mediaRecorder) == null ? void 0 : n.mimeType) || "video/webm", t = new Blob(this.chunks, { type: e });
|
|
3450
3461
|
let i;
|
|
3451
3462
|
try {
|
|
3452
|
-
i = await
|
|
3463
|
+
i = await Yi(t);
|
|
3453
3464
|
} catch {
|
|
3454
3465
|
const r = document.createElement("canvas");
|
|
3455
3466
|
r.width = 1, r.height = 1, i = await new Promise((l) => {
|
|
@@ -3551,8 +3562,8 @@ const T = class T {
|
|
|
3551
3562
|
}
|
|
3552
3563
|
};
|
|
3553
3564
|
T.overlay = null, T.onKeyDown = null;
|
|
3554
|
-
let
|
|
3555
|
-
class
|
|
3565
|
+
let ke = T;
|
|
3566
|
+
class ne {
|
|
3556
3567
|
constructor(e) {
|
|
3557
3568
|
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);
|
|
3558
3569
|
}
|
|
@@ -3608,7 +3619,7 @@ class ke {
|
|
|
3608
3619
|
this.input.remove();
|
|
3609
3620
|
}
|
|
3610
3621
|
}
|
|
3611
|
-
const
|
|
3622
|
+
const Ki = ["👍", "👎", "❤️", "🎉", "👀", "🚀"], be = "-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif", Gi = '<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M17 3a2.85 2.83 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5Z"/><path d="m15 5 4 4"/></svg>', Zi = '<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M3 6h18"/><path d="M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6"/><path d="M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2"/><line x1="10" y1="11" x2="10" y2="17"/><line x1="14" y1="11" x2="14" y2="17"/></svg>', ut = `<button class="pulse-close-btn" style="
|
|
3612
3623
|
border:none;background:none;cursor:pointer;color:#94a3b8;padding:4px;
|
|
3613
3624
|
border-radius:6px;display:flex;align-items:center;justify-content:center;
|
|
3614
3625
|
transition:all 0.15s;flex-shrink:0;
|
|
@@ -3752,11 +3763,11 @@ class Ji {
|
|
|
3752
3763
|
boxShadow: "0 8px 40px rgba(0,0,0,0.18), 0 2px 8px rgba(0,0,0,0.08)",
|
|
3753
3764
|
border: "1px solid #e2e8f0",
|
|
3754
3765
|
padding: "14px",
|
|
3755
|
-
fontFamily:
|
|
3766
|
+
fontFamily: be
|
|
3756
3767
|
}), this.form.innerHTML = `
|
|
3757
3768
|
<div style="display:flex;align-items:center;justify-content:space-between;margin-bottom:8px;">
|
|
3758
3769
|
<span style="font-size:13px;font-weight:600;color:#0f172a;">Add a comment here</span>
|
|
3759
|
-
${
|
|
3770
|
+
${ut}
|
|
3760
3771
|
</div>
|
|
3761
3772
|
<textarea
|
|
3762
3773
|
placeholder="Write a comment..."
|
|
@@ -3793,43 +3804,43 @@ class Ji {
|
|
|
3793
3804
|
</div>
|
|
3794
3805
|
<div class="pin-attachments-preview" style="margin-top:6px;"></div>
|
|
3795
3806
|
`;
|
|
3796
|
-
const a = this.form.querySelector("textarea"), c = this.form.querySelector(".pulse-close-btn"),
|
|
3797
|
-
c.addEventListener("click", () => this.exitPinMode()),
|
|
3798
|
-
const
|
|
3807
|
+
const a = this.form.querySelector("textarea"), c = this.form.querySelector(".pulse-close-btn"), p = this.form.querySelector(".pin-cancel"), d = this.form.querySelector(".pin-submit");
|
|
3808
|
+
c.addEventListener("click", () => this.exitPinMode()), p.addEventListener("click", () => this.exitPinMode()), this.pendingAttachmentIds = [], this.upload || (this.upload = new ne(this.client));
|
|
3809
|
+
const u = this.form.querySelector(".pin-attachments-preview");
|
|
3799
3810
|
this.form.querySelector(".attach-img").addEventListener("click", async () => {
|
|
3800
3811
|
const f = await this.upload.pickFile("image/*");
|
|
3801
3812
|
if (f) {
|
|
3802
3813
|
this.pendingAttachmentIds.push(f.id);
|
|
3803
3814
|
const b = document.createElement("img");
|
|
3804
|
-
b.src = f.thumbnailUrl || f.url, Object.assign(b.style, { width: "48px", height: "48px", borderRadius: "6px", objectFit: "cover", border: "1px solid #e2e8f0" }),
|
|
3815
|
+
b.src = f.thumbnailUrl || f.url, Object.assign(b.style, { width: "48px", height: "48px", borderRadius: "6px", objectFit: "cover", border: "1px solid #e2e8f0" }), u.appendChild(b);
|
|
3805
3816
|
}
|
|
3806
3817
|
}), this.form.querySelector(".attach-mic").addEventListener("click", async () => {
|
|
3807
3818
|
this.audioRecorder || (this.audioRecorder = new Re());
|
|
3808
|
-
const f = await this.audioRecorder.startRecording(
|
|
3819
|
+
const f = await this.audioRecorder.startRecording(u);
|
|
3809
3820
|
if (f) {
|
|
3810
3821
|
const b = await this.upload.uploadBlob(f, "audio.webm");
|
|
3811
3822
|
if (b) {
|
|
3812
3823
|
this.pendingAttachmentIds.push(b.id);
|
|
3813
3824
|
const x = document.createElement("span");
|
|
3814
|
-
Object.assign(x.style, { display: "inline-block", padding: "4px 10px", borderRadius: "6px", background: "#f1f5f9", fontSize: "11px", color: "#64748b" }), x.textContent = "🎤 Audio attached",
|
|
3825
|
+
Object.assign(x.style, { display: "inline-block", padding: "4px 10px", borderRadius: "6px", background: "#f1f5f9", fontSize: "11px", color: "#64748b" }), x.textContent = "🎤 Audio attached", u.appendChild(x);
|
|
3815
3826
|
}
|
|
3816
3827
|
}
|
|
3817
3828
|
}), this.form.querySelector(".attach-video").addEventListener("click", async () => {
|
|
3818
|
-
this.videoRecorder || (this.videoRecorder = new
|
|
3819
|
-
const f = await this.videoRecorder.startRecording(
|
|
3829
|
+
this.videoRecorder || (this.videoRecorder = new Le());
|
|
3830
|
+
const f = await this.videoRecorder.startRecording(u);
|
|
3820
3831
|
if (f) {
|
|
3821
3832
|
const b = await this.upload.uploadBlob(f.blob, "video.webm");
|
|
3822
3833
|
if (b) {
|
|
3823
3834
|
this.pendingAttachmentIds.push(b.id);
|
|
3824
3835
|
const x = document.createElement("span");
|
|
3825
|
-
Object.assign(x.style, { display: "inline-block", padding: "4px 10px", borderRadius: "6px", background: "#f1f5f9", fontSize: "11px", color: "#64748b" }), x.textContent = "🎥 Video attached",
|
|
3836
|
+
Object.assign(x.style, { display: "inline-block", padding: "4px 10px", borderRadius: "6px", background: "#f1f5f9", fontSize: "11px", color: "#64748b" }), x.textContent = "🎥 Video attached", u.appendChild(x);
|
|
3826
3837
|
}
|
|
3827
3838
|
}
|
|
3828
|
-
}),
|
|
3839
|
+
}), d.addEventListener("click", () => {
|
|
3829
3840
|
const f = a.value.trim();
|
|
3830
3841
|
if (!f && this.pendingAttachmentIds.length === 0) return;
|
|
3831
3842
|
const b = [...(f || "").matchAll(/@(\w+)/g)].map((x) => x[1]);
|
|
3832
|
-
this.client.createThread(f || "(attachment)", { position: i, mentions: b }), this.pendingAttachmentIds = [], this.exitPinMode();
|
|
3843
|
+
this.client.createThread(f || "(attachment)", { position: i, mentions: b, attachmentIds: this.pendingAttachmentIds.length > 0 ? [...this.pendingAttachmentIds] : void 0 }), this.pendingAttachmentIds = [], this.exitPinMode();
|
|
3833
3844
|
}), a.addEventListener("keydown", (f) => {
|
|
3834
3845
|
f.key === "Escape" && this.exitPinMode(), f.stopPropagation();
|
|
3835
3846
|
}), document.body.appendChild(this.form), requestAnimationFrame(() => a.focus());
|
|
@@ -3850,7 +3861,7 @@ class Ji {
|
|
|
3850
3861
|
borderRadius: i ? "16px 16px 0 0" : "12px",
|
|
3851
3862
|
boxShadow: "0 8px 40px rgba(0,0,0,0.18), 0 2px 8px rgba(0,0,0,0.08)",
|
|
3852
3863
|
border: "1px solid #e2e8f0",
|
|
3853
|
-
fontFamily:
|
|
3864
|
+
fontFamily: be,
|
|
3854
3865
|
display: "flex",
|
|
3855
3866
|
flexDirection: "column",
|
|
3856
3867
|
overflow: "hidden",
|
|
@@ -3867,7 +3878,7 @@ class Ji {
|
|
|
3867
3878
|
flexShrink: "0"
|
|
3868
3879
|
}), a.innerHTML = `
|
|
3869
3880
|
<span style="font-size:13px;font-weight:700;color:#0f172a;">Thread</span>
|
|
3870
|
-
${
|
|
3881
|
+
${ut}
|
|
3871
3882
|
`, a.querySelector(".pulse-close-btn").addEventListener("click", () => {
|
|
3872
3883
|
this.closePopover();
|
|
3873
3884
|
}), this.popover.appendChild(a), this.refreshPopoverComments(e), this.addPopoverReplyForm(e), document.body.appendChild(this.popover);
|
|
@@ -3895,13 +3906,13 @@ class Ji {
|
|
|
3895
3906
|
}
|
|
3896
3907
|
const i = (l = this.client.state.user) == null ? void 0 : l.id;
|
|
3897
3908
|
t.innerHTML = e.comments.map((a) => {
|
|
3898
|
-
const c = this.client.state.getUser(a.userId),
|
|
3909
|
+
const c = this.client.state.getUser(a.userId), p = c ? c.name.split(" ").map((w) => w[0]).join("").toUpperCase().slice(0, 2) : "?", d = (c == null ? void 0 : c.color) ?? "#94a3b8", u = this.escapeHtml((c == null ? void 0 : c.name) ?? "Unknown"), f = this.formatTime(a.createdAt), b = i === a.userId, x = a.editedAt ? '<span style="font-size:10px;color:#94a3b8;font-style:italic;">(edited)</span>' : "";
|
|
3899
3910
|
if (this.editingPopoverCommentId === a.id)
|
|
3900
3911
|
return `
|
|
3901
3912
|
<div style="margin-bottom:10px;" data-comment-id="${a.id}">
|
|
3902
3913
|
<div style="display:flex;align-items:center;gap:7px;margin-bottom:4px;">
|
|
3903
|
-
<div style="width:22px;height:22px;border-radius:50%;background:${
|
|
3904
|
-
<span style="font-size:12px;font-weight:600;color:#0f172a;">${
|
|
3914
|
+
<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>
|
|
3915
|
+
<span style="font-size:12px;font-weight:600;color:#0f172a;">${u}</span>
|
|
3905
3916
|
</div>
|
|
3906
3917
|
<div style="margin-left:29px;">
|
|
3907
3918
|
<textarea class="edit-textarea" style="width:100%;padding:6px 10px;border:1.5px solid #e2e8f0;border-radius:6px;font-size:12px;font-family:inherit;outline:none;resize:vertical;min-height:48px;color:#0f172a;box-sizing:border-box;">${this.escapeHtml(a.body)}</textarea>
|
|
@@ -3917,25 +3928,25 @@ class Ji {
|
|
|
3917
3928
|
'<span style="color:#6366f1;font-weight:600;background:#eef2ff;padding:0 3px;border-radius:3px;">@$1</span>'
|
|
3918
3929
|
), $ = (a.attachments ?? []).map((w) => {
|
|
3919
3930
|
if (w.type === "image") {
|
|
3920
|
-
const
|
|
3931
|
+
const Pt = w.thumbnailUrl || w.url;
|
|
3921
3932
|
return `<div class="popover-attachment-img" data-full-url="${this.escapeHtml(w.url)}" style="margin:4px 0 4px 29px;cursor:pointer;">
|
|
3922
|
-
<img src="${this.escapeHtml(
|
|
3933
|
+
<img src="${this.escapeHtml(Pt)}" alt="${this.escapeHtml(w.filename)}" style="max-width:180px;max-height:120px;border-radius:8px;border:1px solid #e2e8f0;display:block;" />
|
|
3923
3934
|
</div>`;
|
|
3924
3935
|
}
|
|
3925
3936
|
return w.type === "audio" ? `<div class="popover-attachment-audio" data-url="${this.escapeHtml(w.url)}" data-duration="${w.durationMs ?? ""}" style="margin:4px 0 4px 29px;"></div>` : w.type === "video" ? `<div class="popover-attachment-video" data-url="${this.escapeHtml(w.url)}" data-poster="${this.escapeHtml(w.thumbnailUrl ?? "")}" style="margin:4px 0 4px 29px;"></div>` : "";
|
|
3926
3937
|
}).join(""), k = b ? `<div class="popover-comment-actions" style="display:flex;gap:2px;margin-top:2px;margin-left:29px;">
|
|
3927
3938
|
<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"
|
|
3928
3939
|
onmouseover="this.style.color='#6366f1';this.style.background='#eef2ff'"
|
|
3929
|
-
onmouseout="this.style.color='#94a3b8';this.style.background='none'">${
|
|
3940
|
+
onmouseout="this.style.color='#94a3b8';this.style.background='none'">${Gi}</button>
|
|
3930
3941
|
<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"
|
|
3931
3942
|
onmouseover="this.style.color='#ef4444';this.style.background='#fef2f2'"
|
|
3932
|
-
onmouseout="this.style.color='#94a3b8';this.style.background='none'">${
|
|
3943
|
+
onmouseout="this.style.color='#94a3b8';this.style.background='none'">${Zi}</button>
|
|
3933
3944
|
</div>` : "", A = this.buildReactionPillsHtml(a.id);
|
|
3934
3945
|
return `
|
|
3935
3946
|
<div class="popover-comment" style="margin-bottom:10px;" data-comment-id="${a.id}">
|
|
3936
3947
|
<div style="display:flex;align-items:center;gap:7px;margin-bottom:2px;">
|
|
3937
|
-
<div style="width:22px;height:22px;border-radius:50%;background:${
|
|
3938
|
-
<span style="font-size:12px;font-weight:600;color:#0f172a;">${
|
|
3948
|
+
<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
|
+
<span style="font-size:12px;font-weight:600;color:#0f172a;">${u}</span>
|
|
3939
3950
|
<span style="font-size:10px;color:#94a3b8;">${f}</span>
|
|
3940
3951
|
${x}
|
|
3941
3952
|
</div>
|
|
@@ -3960,7 +3971,7 @@ class Ji {
|
|
|
3960
3971
|
n && r && n.addEventListener("click", () => {
|
|
3961
3972
|
const a = r.value.trim();
|
|
3962
3973
|
if (!a) return;
|
|
3963
|
-
const c = [...a.matchAll(/@(\w+)/g)].map((
|
|
3974
|
+
const c = [...a.matchAll(/@(\w+)/g)].map((p) => p[1]);
|
|
3964
3975
|
this.client.editComment(
|
|
3965
3976
|
this.editingPopoverCommentId,
|
|
3966
3977
|
a,
|
|
@@ -3971,31 +3982,31 @@ class Ji {
|
|
|
3971
3982
|
}), t.querySelectorAll("[data-reaction-emoji]").forEach((a) => {
|
|
3972
3983
|
a.addEventListener("click", (c) => {
|
|
3973
3984
|
c.stopPropagation();
|
|
3974
|
-
const
|
|
3975
|
-
|
|
3985
|
+
const p = a.dataset.reactionEmoji, d = a.dataset.reactionTarget, u = a.dataset.reactionId;
|
|
3986
|
+
u ? this.client.removeReaction(u) : this.client.addReaction(d, "comment", p);
|
|
3976
3987
|
});
|
|
3977
3988
|
}), t.querySelectorAll(".popover-reaction-add").forEach((a) => {
|
|
3978
3989
|
a.addEventListener("click", (c) => {
|
|
3979
3990
|
c.stopPropagation();
|
|
3980
|
-
const
|
|
3981
|
-
this.popoverPickerOpen ===
|
|
3991
|
+
const p = a.dataset.commentId;
|
|
3992
|
+
this.popoverPickerOpen === p ? (this.popoverPickerOpen = null, this.removePickerEl()) : (this.popoverPickerOpen = p, this.showPickerForButton(a, p));
|
|
3982
3993
|
});
|
|
3983
3994
|
}), t.querySelectorAll(".popover-attachment-img").forEach((a) => {
|
|
3984
3995
|
a.addEventListener("click", () => {
|
|
3985
3996
|
const c = a.dataset.fullUrl;
|
|
3986
|
-
c &&
|
|
3997
|
+
c && ke.open(c);
|
|
3987
3998
|
});
|
|
3988
3999
|
}), t.querySelectorAll(".popover-attachment-audio").forEach((a) => {
|
|
3989
4000
|
const c = a.dataset.url;
|
|
3990
4001
|
if (c) {
|
|
3991
|
-
const
|
|
3992
|
-
a.appendChild(
|
|
4002
|
+
const p = a.dataset.duration ? parseInt(a.dataset.duration) : void 0, d = Oe.render(c, p);
|
|
4003
|
+
a.appendChild(d);
|
|
3993
4004
|
}
|
|
3994
4005
|
}), t.querySelectorAll(".popover-attachment-video").forEach((a) => {
|
|
3995
4006
|
const c = a.dataset.url;
|
|
3996
4007
|
if (c) {
|
|
3997
|
-
const
|
|
3998
|
-
a.appendChild(
|
|
4008
|
+
const p = a.dataset.poster || void 0, d = Tt.render(c, p);
|
|
4009
|
+
a.appendChild(d);
|
|
3999
4010
|
}
|
|
4000
4011
|
}), t.scrollTop = t.scrollHeight;
|
|
4001
4012
|
}
|
|
@@ -4004,43 +4015,63 @@ class Ji {
|
|
|
4004
4015
|
const t = document.createElement("div");
|
|
4005
4016
|
Object.assign(t.style, {
|
|
4006
4017
|
padding: "8px 14px 12px",
|
|
4007
|
-
borderTop: "1px solid #f1f5f9"
|
|
4008
|
-
|
|
4009
|
-
|
|
4010
|
-
|
|
4011
|
-
<div style="display:flex;gap:6px;
|
|
4018
|
+
borderTop: "1px solid #f1f5f9"
|
|
4019
|
+
});
|
|
4020
|
+
const i = "border:none;background:none;cursor:pointer;color:#94a3b8;padding:6px;border-radius:6px;display:flex;align-items:center;justify-content:center;min-width:32px;min-height:32px;transition:all 0.15s;", n = 'width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"';
|
|
4021
|
+
t.innerHTML = `
|
|
4022
|
+
<div style="display:flex;align-items:center;gap:4px;margin-bottom:6px;">
|
|
4012
4023
|
<input type="text" placeholder="Reply..."
|
|
4013
|
-
style="flex:1;padding:
|
|
4014
|
-
<
|
|
4015
|
-
|
|
4016
|
-
|
|
4017
|
-
|
|
4018
|
-
<
|
|
4019
|
-
|
|
4020
|
-
|
|
4021
|
-
|
|
4022
|
-
|
|
4024
|
+
style="flex:1;padding:8px 12px;border:1.5px solid #e2e8f0;border-radius:8px;font-size:13px;font-family:inherit;outline:none;color:#0f172a;min-width:0;min-height:36px;transition:border-color 0.15s;" />
|
|
4025
|
+
<button class="reply-send" style="padding:8px 14px;background:#6366f1;color:#fff;border:none;border-radius:8px;font-size:12px;font-weight:600;cursor:pointer;font-family:inherit;white-space:nowrap;flex-shrink:0;min-height:36px;transition:background 0.15s;" onmouseover="this.style.background='#4f46e5'" onmouseout="this.style.background='#6366f1'">Send</button>
|
|
4026
|
+
</div>
|
|
4027
|
+
<div style="display:flex;align-items:center;gap:2px;">
|
|
4028
|
+
<button class="reply-attach-img" title="Attach image" style="${i}" onmouseover="this.style.color='#6366f1';this.style.background='#eef2ff'" onmouseout="this.style.color='#94a3b8';this.style.background='none'">
|
|
4029
|
+
<svg ${n}><path d="m21.44 11.05-9.19 9.19a6 6 0 0 1-8.49-8.49l9.19-9.19a4 4 0 0 1 5.66 5.66l-9.2 9.19a2 2 0 0 1-2.83-2.83l8.49-8.48"/></svg>
|
|
4030
|
+
</button>
|
|
4031
|
+
<button class="reply-attach-mic" title="Record audio" style="${i}" onmouseover="this.style.color='#6366f1';this.style.background='#eef2ff'" onmouseout="this.style.color='#94a3b8';this.style.background='none'">
|
|
4032
|
+
<svg ${n}><path d="M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3Z"/><path d="M19 10v2a7 7 0 0 1-14 0v-2"/><line x1="12" x2="12" y1="19" y2="22"/></svg>
|
|
4033
|
+
</button>
|
|
4034
|
+
<button class="reply-attach-video" title="Record video" style="${i}" onmouseover="this.style.color='#6366f1';this.style.background='#eef2ff'" onmouseout="this.style.color='#94a3b8';this.style.background='none'">
|
|
4035
|
+
<svg ${n}><path d="m22 8-6 4 6 4V8Z"/><rect width="14" height="12" x="2" y="6" rx="2" ry="2"/></svg>
|
|
4036
|
+
</button>
|
|
4037
|
+
<div class="reply-attachments-preview" style="flex:1;display:flex;gap:4px;flex-wrap:wrap;margin-left:4px;"></div>
|
|
4023
4038
|
</div>
|
|
4024
4039
|
`;
|
|
4025
|
-
const
|
|
4026
|
-
this.upload || (this.upload = new
|
|
4027
|
-
|
|
4040
|
+
const o = t.querySelector("input"), r = t.querySelector(".reply-send"), l = t.querySelector(".reply-attachments-preview");
|
|
4041
|
+
this.upload || (this.upload = new ne(this.client));
|
|
4042
|
+
const a = [], c = (d) => {
|
|
4043
|
+
const u = document.createElement("span");
|
|
4044
|
+
Object.assign(u.style, { display: "inline-block", padding: "2px 8px", borderRadius: "4px", background: "#f1f5f9", fontSize: "10px", color: "#64748b" }), u.textContent = d, l.appendChild(u);
|
|
4045
|
+
};
|
|
4046
|
+
t.querySelector(".reply-attach-img").addEventListener("click", async () => {
|
|
4047
|
+
const d = await this.upload.pickFile("image/*");
|
|
4048
|
+
d && (a.push(d.id), c("📎 Image"));
|
|
4028
4049
|
}), t.querySelector(".reply-attach-mic").addEventListener("click", async () => {
|
|
4029
4050
|
this.audioRecorder || (this.audioRecorder = new Re());
|
|
4030
|
-
const
|
|
4031
|
-
|
|
4051
|
+
const d = await this.audioRecorder.startRecording(t);
|
|
4052
|
+
if (d) {
|
|
4053
|
+
const u = await this.upload.uploadBlob(d, "audio.webm");
|
|
4054
|
+
u && (a.push(u.id), c("🎤 Audio"));
|
|
4055
|
+
}
|
|
4056
|
+
}), t.querySelector(".reply-attach-video").addEventListener("click", async () => {
|
|
4057
|
+
this.videoRecorder || (this.videoRecorder = new Le());
|
|
4058
|
+
const d = await this.videoRecorder.startRecording(t);
|
|
4059
|
+
if (d) {
|
|
4060
|
+
const u = await this.upload.uploadBlob(d.blob, "video.webm");
|
|
4061
|
+
u && (a.push(u.id), c("🎥 Video"));
|
|
4062
|
+
}
|
|
4032
4063
|
});
|
|
4033
|
-
const
|
|
4034
|
-
const
|
|
4035
|
-
if (!
|
|
4036
|
-
const
|
|
4037
|
-
this.client.reply(e.id,
|
|
4064
|
+
const p = () => {
|
|
4065
|
+
const d = o.value.trim();
|
|
4066
|
+
if (!d && a.length === 0) return;
|
|
4067
|
+
const u = [...(d || "").matchAll(/@(\w+)/g)].map((f) => f[1]);
|
|
4068
|
+
this.client.reply(e.id, d || "(attachment)", u, a.length > 0 ? [...a] : void 0), o.value = "", a.length = 0, l.innerHTML = "";
|
|
4038
4069
|
};
|
|
4039
|
-
|
|
4040
|
-
const
|
|
4041
|
-
|
|
4042
|
-
}),
|
|
4043
|
-
|
|
4070
|
+
r.addEventListener("click", p), o.addEventListener("input", () => {
|
|
4071
|
+
const d = Date.now(), u = this.lastTypingSendPins.get(e.id) ?? 0;
|
|
4072
|
+
d - u >= 2e3 && (this.client.sendTyping(e.id), this.lastTypingSendPins.set(e.id, d));
|
|
4073
|
+
}), o.addEventListener("keydown", (d) => {
|
|
4074
|
+
d.key === "Enter" && (d.preventDefault(), p()), d.key === "Escape" && this.closePopover(), d.stopPropagation();
|
|
4044
4075
|
}), this.popover.appendChild(t);
|
|
4045
4076
|
}
|
|
4046
4077
|
removePickerEl() {
|
|
@@ -4063,9 +4094,9 @@ class Ji {
|
|
|
4063
4094
|
borderRadius: "8px",
|
|
4064
4095
|
boxShadow: "0 4px 24px rgba(0,0,0,0.12)",
|
|
4065
4096
|
zIndex: "10002",
|
|
4066
|
-
fontFamily:
|
|
4097
|
+
fontFamily: be
|
|
4067
4098
|
});
|
|
4068
|
-
for (const n of
|
|
4099
|
+
for (const n of Ki) {
|
|
4069
4100
|
const o = document.createElement("button");
|
|
4070
4101
|
Object.assign(o.style, {
|
|
4071
4102
|
border: "none",
|
|
@@ -4079,8 +4110,8 @@ class Ji {
|
|
|
4079
4110
|
r.stopPropagation();
|
|
4080
4111
|
const a = this.client.state.getReactions(t).find(
|
|
4081
4112
|
(c) => {
|
|
4082
|
-
var
|
|
4083
|
-
return c.emoji === n && c.userId === ((
|
|
4113
|
+
var p;
|
|
4114
|
+
return c.emoji === n && c.userId === ((p = this.client.state.user) == null ? void 0 : p.id);
|
|
4084
4115
|
}
|
|
4085
4116
|
);
|
|
4086
4117
|
a ? this.client.removeReaction(a.id) : this.client.addReaction(t, "comment", n), this.popoverPickerOpen = null, this.removePickerEl();
|
|
@@ -4092,15 +4123,15 @@ class Ji {
|
|
|
4092
4123
|
var a;
|
|
4093
4124
|
const t = this.client.state.getReactions(e), i = (a = this.client.state.user) == null ? void 0 : a.id, n = /* @__PURE__ */ new Map();
|
|
4094
4125
|
for (const c of t) {
|
|
4095
|
-
const
|
|
4096
|
-
|
|
4126
|
+
const p = n.get(c.emoji) ?? { count: 0, ownId: null };
|
|
4127
|
+
p.count++, c.userId === i && (p.ownId = c.id), n.set(c.emoji, p);
|
|
4097
4128
|
}
|
|
4098
4129
|
const o = "display:inline-flex;align-items:center;gap:3px;padding:2px 8px;border-radius:12px;border:1px solid #e2e8f0;background:#fff;font-size:12px;cursor:pointer;transition:all 0.15s;line-height:1.4;", r = o + "background:#eef2ff;border-color:#6366f1;";
|
|
4099
4130
|
let l = '<div style="margin-left:29px;display:flex;gap:4px;flex-wrap:wrap;margin-top:4px;">';
|
|
4100
|
-
for (const [c, { count:
|
|
4101
|
-
const
|
|
4102
|
-
l += `<button data-reaction-emoji="${c}" data-reaction-target="${e}" ${
|
|
4103
|
-
<span>${c}</span><span style="font-size:11px;font-weight:600;color:#64748b;">${
|
|
4131
|
+
for (const [c, { count: p, ownId: d }] of n) {
|
|
4132
|
+
const u = d ? r : o;
|
|
4133
|
+
l += `<button data-reaction-emoji="${c}" data-reaction-target="${e}" ${d ? `data-reaction-id="${d}"` : ""} style="${u}">
|
|
4134
|
+
<span>${c}</span><span style="font-size:11px;font-weight:600;color:#64748b;">${p}</span>
|
|
4104
4135
|
</button>`;
|
|
4105
4136
|
}
|
|
4106
4137
|
return l += `<button class="popover-reaction-add" data-comment-id="${e}" style="display:inline-flex;align-items:center;justify-content:center;width:26px;height:26px;border-radius:50%;border:1px dashed #e2e8f0;background:none;cursor:pointer;color:#94a3b8;font-size:14px;">+</button>`, l += "</div>", l;
|
|
@@ -4175,7 +4206,7 @@ class Ji {
|
|
|
4175
4206
|
justifyContent: "center",
|
|
4176
4207
|
fontSize: "11px",
|
|
4177
4208
|
fontWeight: "700",
|
|
4178
|
-
fontFamily:
|
|
4209
|
+
fontFamily: be,
|
|
4179
4210
|
cursor: "pointer",
|
|
4180
4211
|
pointerEvents: "auto",
|
|
4181
4212
|
boxShadow: "0 2px 8px rgba(99,102,241,0.4)",
|
|
@@ -4200,15 +4231,19 @@ class Ji {
|
|
|
4200
4231
|
});
|
|
4201
4232
|
}
|
|
4202
4233
|
}
|
|
4203
|
-
var
|
|
4204
|
-
for (var n = i > 1 ? void 0 : i ?
|
|
4234
|
+
var Qi = Object.defineProperty, es = Object.getOwnPropertyDescriptor, j = (s, e, t, i) => {
|
|
4235
|
+
for (var n = i > 1 ? void 0 : i ? es(e, t) : e, o = s.length - 1, r; o >= 0; o--)
|
|
4205
4236
|
(r = s[o]) && (n = (i ? r(e, t, n) : r(n)) || n);
|
|
4206
|
-
return i && n &&
|
|
4237
|
+
return i && n && Qi(e, t, n), n;
|
|
4207
4238
|
};
|
|
4208
|
-
const
|
|
4239
|
+
const ts = ["👍", "👎", "❤️", "🎉", "👀", "🚀"];
|
|
4209
4240
|
let O = class extends S {
|
|
4210
4241
|
constructor() {
|
|
4211
|
-
super(...arguments), this.highlightThreadId = null, this.
|
|
4242
|
+
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 = [];
|
|
4243
|
+
}
|
|
4244
|
+
/** Read threads directly from state — threadsVersion triggers re-renders. */
|
|
4245
|
+
get threads() {
|
|
4246
|
+
return this.threadsVersion, this.client ? [...this.client.state.threads] : [];
|
|
4212
4247
|
}
|
|
4213
4248
|
connectedCallback() {
|
|
4214
4249
|
super.connectedCallback(), this.ensureListener();
|
|
@@ -4231,7 +4266,7 @@ let O = class extends S {
|
|
|
4231
4266
|
}), (t = this.shadowRoot) == null || t.querySelectorAll(".video-player-host").forEach((i) => {
|
|
4232
4267
|
if (i.children.length > 0) return;
|
|
4233
4268
|
const n = i.dataset.url;
|
|
4234
|
-
n && i.appendChild(
|
|
4269
|
+
n && i.appendChild(Tt.render(n, i.dataset.poster || void 0));
|
|
4235
4270
|
});
|
|
4236
4271
|
}
|
|
4237
4272
|
teardownListeners() {
|
|
@@ -4241,11 +4276,11 @@ let O = class extends S {
|
|
|
4241
4276
|
this.typingTimers.clear();
|
|
4242
4277
|
}
|
|
4243
4278
|
ensureListener() {
|
|
4244
|
-
this.client && (this.teardownListeners(), this.
|
|
4279
|
+
this.client && (this.teardownListeners(), this.threadsVersion++, this.setupListener());
|
|
4245
4280
|
}
|
|
4246
4281
|
setupListener() {
|
|
4247
|
-
this.client && (this.
|
|
4248
|
-
this.
|
|
4282
|
+
this.client && (this.unsub = this.client.state.on("threads", () => {
|
|
4283
|
+
this.threadsVersion++;
|
|
4249
4284
|
}), this.reactionUnsub = this.client.state.on("reactions", () => {
|
|
4250
4285
|
this.reactionsVersion++;
|
|
4251
4286
|
}), this.typingUnsub = this.client.state.on(
|
|
@@ -4297,7 +4332,7 @@ let O = class extends S {
|
|
|
4297
4332
|
}
|
|
4298
4333
|
parseMentions(s) {
|
|
4299
4334
|
return s.split(/(@\w+)/g).map(
|
|
4300
|
-
(t) => t.startsWith("@") ?
|
|
4335
|
+
(t) => t.startsWith("@") ? h`<span class="mention">${t}</span>` : t
|
|
4301
4336
|
);
|
|
4302
4337
|
}
|
|
4303
4338
|
getInitials(s) {
|
|
@@ -4313,21 +4348,35 @@ let O = class extends S {
|
|
|
4313
4348
|
const o = Math.floor(n / 60);
|
|
4314
4349
|
return o < 24 ? `${o}h` : e.toLocaleDateString();
|
|
4315
4350
|
}
|
|
4316
|
-
async handleAttachImage(
|
|
4317
|
-
this.upload || (this.upload = new
|
|
4351
|
+
async handleAttachImage() {
|
|
4352
|
+
this.upload || (this.upload = new ne(this.client));
|
|
4353
|
+
const s = await this.upload.pickFile("image/*");
|
|
4354
|
+
s && (this.replyAttachmentIds.push(s.id), this.requestUpdate());
|
|
4318
4355
|
}
|
|
4319
4356
|
async handleRecordAudio(s) {
|
|
4320
4357
|
var i;
|
|
4321
|
-
this.upload || (this.upload = new
|
|
4358
|
+
this.upload || (this.upload = new ne(this.client)), this.audioRecorder || (this.audioRecorder = new Re());
|
|
4322
4359
|
const e = (i = this.shadowRoot) == null ? void 0 : i.querySelector(`[data-thread-id="${s}"]`), t = await this.audioRecorder.startRecording(e ?? document.body);
|
|
4323
|
-
|
|
4360
|
+
if (t) {
|
|
4361
|
+
const n = await this.upload.uploadBlob(t, "audio.webm");
|
|
4362
|
+
n && (this.replyAttachmentIds.push(n.id), this.requestUpdate());
|
|
4363
|
+
}
|
|
4364
|
+
}
|
|
4365
|
+
async handleRecordVideo(s) {
|
|
4366
|
+
var i;
|
|
4367
|
+
this.upload || (this.upload = new ne(this.client)), this.videoRecorder || (this.videoRecorder = new Le());
|
|
4368
|
+
const e = (i = this.shadowRoot) == null ? void 0 : i.querySelector(`[data-thread-id="${s}"]`), t = await this.videoRecorder.startRecording(e ?? document.body);
|
|
4369
|
+
if (t) {
|
|
4370
|
+
const n = await this.upload.uploadBlob(t.blob, "video.webm");
|
|
4371
|
+
n && (this.replyAttachmentIds.push(n.id), this.requestUpdate());
|
|
4372
|
+
}
|
|
4324
4373
|
}
|
|
4325
4374
|
handleReply(s, e) {
|
|
4326
4375
|
e.preventDefault();
|
|
4327
4376
|
const i = e.target.querySelector("input"), n = i.value.trim();
|
|
4328
|
-
if (!n) return;
|
|
4329
|
-
const o = [...n.matchAll(/@(\w+)/g)].map((r) => r[1]);
|
|
4330
|
-
this.client.reply(s, n, o), i.value = "", this.replyingTo = null;
|
|
4377
|
+
if (!n && this.replyAttachmentIds.length === 0) return;
|
|
4378
|
+
const o = [...(n || "").matchAll(/@(\w+)/g)].map((r) => r[1]);
|
|
4379
|
+
this.client.reply(s, n || "(attachment)", o, this.replyAttachmentIds.length > 0 ? [...this.replyAttachmentIds] : void 0), i.value = "", this.replyAttachmentIds = [], this.replyingTo = null;
|
|
4331
4380
|
}
|
|
4332
4381
|
isOwnComment(s) {
|
|
4333
4382
|
var e, t;
|
|
@@ -4349,7 +4398,7 @@ let O = class extends S {
|
|
|
4349
4398
|
this.client.deleteComment(s);
|
|
4350
4399
|
}
|
|
4351
4400
|
renderEditForm(s) {
|
|
4352
|
-
return
|
|
4401
|
+
return h`
|
|
4353
4402
|
<div class="edit-form">
|
|
4354
4403
|
<textarea
|
|
4355
4404
|
.value=${this.editBody}
|
|
@@ -4370,12 +4419,12 @@ let O = class extends S {
|
|
|
4370
4419
|
const e = this.client.state.getReactions(s.id), t = (n = this.client.state.user) == null ? void 0 : n.id, i = /* @__PURE__ */ new Map();
|
|
4371
4420
|
for (const o of e)
|
|
4372
4421
|
i.has(o.emoji) || i.set(o.emoji, []), i.get(o.emoji).push(o);
|
|
4373
|
-
return
|
|
4422
|
+
return h`
|
|
4374
4423
|
<div class="comment-reactions">
|
|
4375
4424
|
${[...i.entries()].map(
|
|
4376
4425
|
([o, r]) => {
|
|
4377
4426
|
const l = r.some((a) => a.userId === t);
|
|
4378
|
-
return
|
|
4427
|
+
return h`
|
|
4379
4428
|
<button
|
|
4380
4429
|
class="reaction-pill ${l ? "own" : ""}"
|
|
4381
4430
|
@click=${() => this.toggleReaction(s.id, o)}
|
|
@@ -4394,26 +4443,26 @@ let O = class extends S {
|
|
|
4394
4443
|
title="Add reaction"
|
|
4395
4444
|
>
|
|
4396
4445
|
+
|
|
4397
|
-
${this.pickerOpenForComment === s.id ?
|
|
4446
|
+
${this.pickerOpenForComment === s.id ? h`
|
|
4398
4447
|
<div class="emoji-picker">
|
|
4399
|
-
${
|
|
4400
|
-
(o) =>
|
|
4448
|
+
${ts.map(
|
|
4449
|
+
(o) => h`
|
|
4401
4450
|
<button @click=${(r) => {
|
|
4402
4451
|
r.stopPropagation(), this.toggleReaction(s.id, o);
|
|
4403
4452
|
}}>${o}</button>
|
|
4404
4453
|
`
|
|
4405
4454
|
)}
|
|
4406
4455
|
</div>
|
|
4407
|
-
` :
|
|
4456
|
+
` : m}
|
|
4408
4457
|
</button>
|
|
4409
4458
|
</div>
|
|
4410
4459
|
`;
|
|
4411
4460
|
}
|
|
4412
4461
|
renderTypingIndicator(s) {
|
|
4413
4462
|
const e = this.typingByThread.get(s) ?? [];
|
|
4414
|
-
if (e.length === 0) return
|
|
4463
|
+
if (e.length === 0) return m;
|
|
4415
4464
|
const t = e.length === 1 ? `${e[0]} is typing...` : `${e.join(", ")} are typing...`;
|
|
4416
|
-
return
|
|
4465
|
+
return h`<div class="typing-indicator">${t}</div>`;
|
|
4417
4466
|
}
|
|
4418
4467
|
sortedThreads() {
|
|
4419
4468
|
return [...this.threads].sort((s, e) => {
|
|
@@ -4424,7 +4473,7 @@ let O = class extends S {
|
|
|
4424
4473
|
}
|
|
4425
4474
|
render() {
|
|
4426
4475
|
const s = this.sortedThreads();
|
|
4427
|
-
return
|
|
4476
|
+
return h`
|
|
4428
4477
|
<div class="panel">
|
|
4429
4478
|
<div class="panel-header">
|
|
4430
4479
|
<span class="panel-title">
|
|
@@ -4432,12 +4481,12 @@ let O = class extends S {
|
|
|
4432
4481
|
<span class="thread-count">${this.threads.length}</span>
|
|
4433
4482
|
</span>
|
|
4434
4483
|
<button class="close-btn" @click=${this.fireClose} title="Close">
|
|
4435
|
-
${
|
|
4484
|
+
${E(me, 16)}
|
|
4436
4485
|
</button>
|
|
4437
4486
|
</div>
|
|
4438
4487
|
|
|
4439
4488
|
<div class="panel-body pw-scrollable">
|
|
4440
|
-
${s.length === 0 ?
|
|
4489
|
+
${s.length === 0 ? h`<div class="empty">
|
|
4441
4490
|
<div class="empty-icon">💬</div>
|
|
4442
4491
|
No comments yet
|
|
4443
4492
|
</div>` : s.map((e) => this.renderThread(e))}
|
|
@@ -4450,55 +4499,55 @@ let O = class extends S {
|
|
|
4450
4499
|
`;
|
|
4451
4500
|
}
|
|
4452
4501
|
renderAttachments(s) {
|
|
4453
|
-
return !s || s.length === 0 ?
|
|
4502
|
+
return !s || s.length === 0 ? m : h`
|
|
4454
4503
|
${s.map((e) => {
|
|
4455
4504
|
if (e.type === "image") {
|
|
4456
4505
|
const t = e.thumbnailUrl || e.url;
|
|
4457
|
-
return
|
|
4506
|
+
return h`
|
|
4458
4507
|
<div class="comment-attachment-media">
|
|
4459
4508
|
<img
|
|
4460
4509
|
class="comment-attachment-img"
|
|
4461
4510
|
src=${t}
|
|
4462
4511
|
alt=${e.filename}
|
|
4463
|
-
@click=${() =>
|
|
4512
|
+
@click=${() => ke.open(e.url)}
|
|
4464
4513
|
/>
|
|
4465
4514
|
</div>
|
|
4466
4515
|
`;
|
|
4467
4516
|
}
|
|
4468
|
-
return e.type === "audio" ?
|
|
4517
|
+
return e.type === "audio" ? h`
|
|
4469
4518
|
<div class="comment-attachment-media" id="audio-${e.id}">
|
|
4470
4519
|
${this.renderAudioPlayer(e)}
|
|
4471
4520
|
</div>
|
|
4472
|
-
` : e.type === "video" ?
|
|
4521
|
+
` : e.type === "video" ? h`
|
|
4473
4522
|
<div class="comment-attachment-media" id="video-${e.id}">
|
|
4474
4523
|
${this.renderVideoPlayer(e)}
|
|
4475
4524
|
</div>
|
|
4476
|
-
` :
|
|
4525
|
+
` : m;
|
|
4477
4526
|
})}
|
|
4478
4527
|
`;
|
|
4479
4528
|
}
|
|
4480
4529
|
renderAudioPlayer(s) {
|
|
4481
4530
|
const e = document.createElement("div"), t = Oe.render(s.url, s.durationMs);
|
|
4482
|
-
return e.appendChild(t),
|
|
4531
|
+
return e.appendChild(t), h`<div class="audio-player-host" data-url=${s.url} data-duration=${s.durationMs ?? ""}></div>`;
|
|
4483
4532
|
}
|
|
4484
4533
|
renderVideoPlayer(s) {
|
|
4485
|
-
return
|
|
4534
|
+
return h`<div class="video-player-host" data-url=${s.url} data-poster=${s.thumbnailUrl ?? ""}></div>`;
|
|
4486
4535
|
}
|
|
4487
4536
|
renderThread(s) {
|
|
4488
4537
|
const e = this.highlightThreadId === s.id;
|
|
4489
|
-
return
|
|
4538
|
+
return h`
|
|
4490
4539
|
<div
|
|
4491
4540
|
class="thread ${s.resolved ? "resolved" : ""} ${e ? "highlighted" : ""}"
|
|
4492
4541
|
data-thread-id=${s.id}
|
|
4493
4542
|
>
|
|
4494
|
-
${s.position ?
|
|
4495
|
-
${
|
|
4543
|
+
${s.position ? h`<div class="pin-badge">
|
|
4544
|
+
${E(_t, 12)}
|
|
4496
4545
|
Pinned
|
|
4497
|
-
</div>` :
|
|
4546
|
+
</div>` : m}
|
|
4498
4547
|
${s.comments.map((t, i) => {
|
|
4499
4548
|
const n = this.getUserForComment(t.userId), o = this.isOwnComment(t), r = this.editingCommentId === t.id;
|
|
4500
|
-
return
|
|
4501
|
-
${i > 0 ?
|
|
4549
|
+
return h`
|
|
4550
|
+
${i > 0 ? h`<div class="comment-divider"></div>` : m}
|
|
4502
4551
|
<div class="comment">
|
|
4503
4552
|
<div class="comment-header">
|
|
4504
4553
|
<div
|
|
@@ -4509,16 +4558,16 @@ let O = class extends S {
|
|
|
4509
4558
|
</div>
|
|
4510
4559
|
<span class="comment-author">${(n == null ? void 0 : n.name) ?? "Unknown"}</span>
|
|
4511
4560
|
<span class="comment-time">${this.formatTime(t.createdAt)}</span>
|
|
4512
|
-
${t.editedAt ?
|
|
4561
|
+
${t.editedAt ? h`<span class="edited-badge">(edited)</span>` : m}
|
|
4513
4562
|
</div>
|
|
4514
|
-
${r ? this.renderEditForm(t) :
|
|
4563
|
+
${r ? this.renderEditForm(t) : h`
|
|
4515
4564
|
<div class="comment-body">${this.parseMentions(t.body)}</div>
|
|
4516
4565
|
${this.renderAttachments(t.attachments ?? [])}
|
|
4517
4566
|
`}
|
|
4518
|
-
${o && !r ?
|
|
4519
|
-
<button @click=${() => this.startEdit(t)} title="Edit">${
|
|
4520
|
-
<button class="danger" @click=${() => this.deleteComment(t.id)} title="Delete">${
|
|
4521
|
-
</div>` :
|
|
4567
|
+
${o && !r ? h`<div class="comment-actions">
|
|
4568
|
+
<button @click=${() => this.startEdit(t)} title="Edit">${E(Ai, 14)}</button>
|
|
4569
|
+
<button class="danger" @click=${() => this.deleteComment(t.id)} title="Delete">${E(Mi, 14)}</button>
|
|
4570
|
+
</div>` : m}
|
|
4522
4571
|
${this.renderReactions(t)}
|
|
4523
4572
|
</div>
|
|
4524
4573
|
`;
|
|
@@ -4539,42 +4588,55 @@ let O = class extends S {
|
|
|
4539
4588
|
|
|
4540
4589
|
${this.renderTypingIndicator(s.id)}
|
|
4541
4590
|
|
|
4542
|
-
${this.replyingTo === s.id ?
|
|
4591
|
+
${this.replyingTo === s.id ? h`
|
|
4543
4592
|
<form
|
|
4544
4593
|
class="reply-form"
|
|
4545
4594
|
@submit=${(t) => this.handleReply(s.id, t)}
|
|
4546
4595
|
>
|
|
4547
|
-
<input
|
|
4548
|
-
|
|
4549
|
-
|
|
4550
|
-
|
|
4551
|
-
|
|
4552
|
-
|
|
4553
|
-
type="button
|
|
4554
|
-
|
|
4555
|
-
|
|
4556
|
-
|
|
4557
|
-
|
|
4558
|
-
|
|
4559
|
-
|
|
4560
|
-
|
|
4561
|
-
|
|
4562
|
-
|
|
4563
|
-
|
|
4564
|
-
|
|
4565
|
-
|
|
4566
|
-
|
|
4596
|
+
<div class="reply-input-row">
|
|
4597
|
+
<input
|
|
4598
|
+
type="text"
|
|
4599
|
+
placeholder="Reply..."
|
|
4600
|
+
@input=${() => this.handleTypingInput(s.id)}
|
|
4601
|
+
/>
|
|
4602
|
+
<button class="pw-btn pw-btn-primary" type="submit">Send</button>
|
|
4603
|
+
</div>
|
|
4604
|
+
<div class="reply-media-row">
|
|
4605
|
+
<button
|
|
4606
|
+
type="button"
|
|
4607
|
+
class="reply-media-btn"
|
|
4608
|
+
title="Attach image"
|
|
4609
|
+
@click=${() => this.handleAttachImage()}
|
|
4610
|
+
>${E(Si, 16)}</button>
|
|
4611
|
+
<button
|
|
4612
|
+
type="button"
|
|
4613
|
+
class="reply-media-btn"
|
|
4614
|
+
title="Record audio"
|
|
4615
|
+
@click=${() => this.handleRecordAudio(s.id)}
|
|
4616
|
+
>${E(Ti, 16)}</button>
|
|
4617
|
+
<button
|
|
4618
|
+
type="button"
|
|
4619
|
+
class="reply-media-btn"
|
|
4620
|
+
title="Record video"
|
|
4621
|
+
@click=${() => this.handleRecordVideo(s.id)}
|
|
4622
|
+
>${E(Oi, 16)}</button>
|
|
4623
|
+
<div class="reply-preview">
|
|
4624
|
+
${this.replyAttachmentIds.map(
|
|
4625
|
+
(t, i) => h`<span class="reply-preview-badge">Attached #${i + 1}</span>`
|
|
4626
|
+
)}
|
|
4627
|
+
</div>
|
|
4628
|
+
</div>
|
|
4567
4629
|
</form>
|
|
4568
|
-
` :
|
|
4630
|
+
` : m}
|
|
4569
4631
|
</div>
|
|
4570
4632
|
`;
|
|
4571
4633
|
}
|
|
4572
4634
|
};
|
|
4573
4635
|
O.styles = [
|
|
4574
4636
|
ee,
|
|
4575
|
-
|
|
4637
|
+
ge,
|
|
4576
4638
|
_e,
|
|
4577
|
-
|
|
4639
|
+
I`
|
|
4578
4640
|
:host {
|
|
4579
4641
|
display: block;
|
|
4580
4642
|
}
|
|
@@ -4749,23 +4811,29 @@ O.styles = [
|
|
|
4749
4811
|
|
|
4750
4812
|
/* Reply form */
|
|
4751
4813
|
.reply-form {
|
|
4752
|
-
display: flex;
|
|
4753
|
-
gap: 6px;
|
|
4754
4814
|
margin-top: 8px;
|
|
4755
4815
|
margin-left: 32px;
|
|
4756
4816
|
}
|
|
4757
4817
|
|
|
4818
|
+
.reply-input-row {
|
|
4819
|
+
display: flex;
|
|
4820
|
+
gap: 6px;
|
|
4821
|
+
align-items: center;
|
|
4822
|
+
}
|
|
4823
|
+
|
|
4758
4824
|
.reply-form input {
|
|
4759
4825
|
flex: 1;
|
|
4760
|
-
padding:
|
|
4826
|
+
padding: 8px 12px;
|
|
4761
4827
|
border: 1.5px solid var(--pw-border);
|
|
4762
|
-
border-radius:
|
|
4763
|
-
font-size:
|
|
4828
|
+
border-radius: 8px;
|
|
4829
|
+
font-size: 13px;
|
|
4764
4830
|
font-family: inherit;
|
|
4765
4831
|
outline: none;
|
|
4766
4832
|
transition: border-color 0.15s, box-shadow 0.15s;
|
|
4767
4833
|
color: var(--pw-text);
|
|
4768
4834
|
background: var(--pw-surface);
|
|
4835
|
+
min-height: 36px;
|
|
4836
|
+
min-width: 0;
|
|
4769
4837
|
}
|
|
4770
4838
|
|
|
4771
4839
|
.reply-form input:focus {
|
|
@@ -4773,9 +4841,54 @@ O.styles = [
|
|
|
4773
4841
|
box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.1);
|
|
4774
4842
|
}
|
|
4775
4843
|
|
|
4776
|
-
.reply-
|
|
4777
|
-
|
|
4844
|
+
.reply-media-row {
|
|
4845
|
+
display: flex;
|
|
4846
|
+
align-items: center;
|
|
4847
|
+
gap: 2px;
|
|
4848
|
+
margin-top: 6px;
|
|
4849
|
+
}
|
|
4850
|
+
|
|
4851
|
+
.reply-media-btn {
|
|
4852
|
+
border: none;
|
|
4853
|
+
background: none;
|
|
4854
|
+
cursor: pointer;
|
|
4855
|
+
color: var(--pw-text-muted);
|
|
4856
|
+
padding: 6px;
|
|
4857
|
+
border-radius: 6px;
|
|
4858
|
+
display: flex;
|
|
4859
|
+
align-items: center;
|
|
4860
|
+
justify-content: center;
|
|
4861
|
+
min-width: 32px;
|
|
4862
|
+
min-height: 32px;
|
|
4863
|
+
transition: all 0.15s;
|
|
4864
|
+
}
|
|
4865
|
+
|
|
4866
|
+
.reply-media-btn:hover {
|
|
4867
|
+
color: var(--pw-accent);
|
|
4868
|
+
background: var(--pw-accent-light);
|
|
4869
|
+
}
|
|
4870
|
+
|
|
4871
|
+
.reply-preview {
|
|
4872
|
+
flex: 1;
|
|
4873
|
+
display: flex;
|
|
4874
|
+
gap: 4px;
|
|
4875
|
+
flex-wrap: wrap;
|
|
4876
|
+
margin-left: 4px;
|
|
4877
|
+
}
|
|
4878
|
+
|
|
4879
|
+
.reply-preview-badge {
|
|
4880
|
+
display: inline-block;
|
|
4881
|
+
padding: 2px 8px;
|
|
4882
|
+
border-radius: 4px;
|
|
4883
|
+
background: var(--pw-surface-hover);
|
|
4884
|
+
font-size: 10px;
|
|
4885
|
+
color: var(--pw-text-muted);
|
|
4886
|
+
}
|
|
4887
|
+
|
|
4888
|
+
.reply-form .pw-btn-primary {
|
|
4889
|
+
padding: 8px 14px;
|
|
4778
4890
|
font-size: 12px;
|
|
4891
|
+
min-height: 36px;
|
|
4779
4892
|
}
|
|
4780
4893
|
|
|
4781
4894
|
.pin-hint {
|
|
@@ -4818,8 +4931,17 @@ O.styles = [
|
|
|
4818
4931
|
border-radius: 16px 16px 0 0;
|
|
4819
4932
|
}
|
|
4820
4933
|
|
|
4821
|
-
.reply-form input
|
|
4822
|
-
|
|
4934
|
+
.reply-form input {
|
|
4935
|
+
min-height: 44px;
|
|
4936
|
+
font-size: 16px; /* prevents zoom on iOS */
|
|
4937
|
+
}
|
|
4938
|
+
|
|
4939
|
+
.reply-form .pw-btn-primary {
|
|
4940
|
+
min-height: 44px;
|
|
4941
|
+
}
|
|
4942
|
+
|
|
4943
|
+
.reply-media-btn {
|
|
4944
|
+
min-width: 44px;
|
|
4823
4945
|
min-height: 44px;
|
|
4824
4946
|
}
|
|
4825
4947
|
|
|
@@ -5041,7 +5163,7 @@ j([
|
|
|
5041
5163
|
], O.prototype, "highlightThreadId", 2);
|
|
5042
5164
|
j([
|
|
5043
5165
|
v()
|
|
5044
|
-
], O.prototype, "
|
|
5166
|
+
], O.prototype, "threadsVersion", 2);
|
|
5045
5167
|
j([
|
|
5046
5168
|
v()
|
|
5047
5169
|
], O.prototype, "replyingTo", 2);
|
|
@@ -5063,25 +5185,25 @@ j([
|
|
|
5063
5185
|
O = j([
|
|
5064
5186
|
R("pulse-widget-comments-panel")
|
|
5065
5187
|
], O);
|
|
5066
|
-
var
|
|
5067
|
-
for (var n = i > 1 ? void 0 : i ?
|
|
5188
|
+
var is = Object.defineProperty, ss = Object.getOwnPropertyDescriptor, qe = (s, e, t, i) => {
|
|
5189
|
+
for (var n = i > 1 ? void 0 : i ? ss(e, t) : e, o = s.length - 1, r; o >= 0; o--)
|
|
5068
5190
|
(r = s[o]) && (n = (i ? r(e, t, n) : r(n)) || n);
|
|
5069
|
-
return i && n &&
|
|
5191
|
+
return i && n && is(e, t, n), n;
|
|
5070
5192
|
};
|
|
5071
|
-
const
|
|
5193
|
+
const ns = {
|
|
5072
5194
|
"comment:created": "left a comment",
|
|
5073
5195
|
"comment:mention": "mentioned you",
|
|
5074
5196
|
"comment:reply": "replied to your comment",
|
|
5075
5197
|
"thread:resolved": "resolved a thread",
|
|
5076
5198
|
"reaction:added": "reacted to your comment"
|
|
5077
|
-
},
|
|
5199
|
+
}, os = {
|
|
5078
5200
|
"comment:created": "💬",
|
|
5079
5201
|
"comment:mention": "📣",
|
|
5080
5202
|
"comment:reply": "↩️",
|
|
5081
5203
|
"thread:resolved": "✅",
|
|
5082
5204
|
"reaction:added": "🎉"
|
|
5083
5205
|
};
|
|
5084
|
-
let
|
|
5206
|
+
let de = class extends S {
|
|
5085
5207
|
constructor() {
|
|
5086
5208
|
super(...arguments), this.notifications = [];
|
|
5087
5209
|
}
|
|
@@ -5125,38 +5247,38 @@ let ce = class extends S {
|
|
|
5125
5247
|
}
|
|
5126
5248
|
render() {
|
|
5127
5249
|
const s = this.notifications.filter((e) => !e.read).length;
|
|
5128
|
-
return
|
|
5250
|
+
return h`
|
|
5129
5251
|
<div class="panel">
|
|
5130
5252
|
<div class="panel-header">
|
|
5131
5253
|
<span class="panel-title">
|
|
5132
5254
|
Notifications
|
|
5133
|
-
${s > 0 ?
|
|
5255
|
+
${s > 0 ? h`<span class="unread-badge">${s}</span>` : m}
|
|
5134
5256
|
</span>
|
|
5135
5257
|
<div style="display:flex;align-items:center;gap:4px;">
|
|
5136
|
-
${s > 0 ?
|
|
5258
|
+
${s > 0 ? h`<button class="mark-all" @click=${() => this.client.markAllRead()}>
|
|
5137
5259
|
Mark all read
|
|
5138
|
-
</button>` :
|
|
5260
|
+
</button>` : m}
|
|
5139
5261
|
<button class="close-btn" @click=${this.fireClose} title="Close">
|
|
5140
|
-
${
|
|
5262
|
+
${E(me, 16)}
|
|
5141
5263
|
</button>
|
|
5142
5264
|
</div>
|
|
5143
5265
|
</div>
|
|
5144
5266
|
|
|
5145
5267
|
<div class="panel-body pw-scrollable">
|
|
5146
|
-
${this.notifications.length === 0 ?
|
|
5268
|
+
${this.notifications.length === 0 ? h`<div class="empty">
|
|
5147
5269
|
<div class="empty-icon">🔔</div>
|
|
5148
5270
|
No notifications
|
|
5149
5271
|
</div>` : this.notifications.map(
|
|
5150
|
-
(e) =>
|
|
5272
|
+
(e) => h`
|
|
5151
5273
|
<div
|
|
5152
5274
|
class="item ${e.read ? "" : "unread"}"
|
|
5153
5275
|
@click=${() => this.handleClick(e)}
|
|
5154
5276
|
>
|
|
5155
|
-
<span class="icon">${
|
|
5277
|
+
<span class="icon">${os[e.type] ?? "🔔"}</span>
|
|
5156
5278
|
<div class="content">
|
|
5157
5279
|
<div class="text">
|
|
5158
5280
|
<span class="actor">${this.getActorName(e.actorId)}</span>
|
|
5159
|
-
${
|
|
5281
|
+
${ns[e.type] ?? e.type}
|
|
5160
5282
|
</div>
|
|
5161
5283
|
<div class="time">${this.formatTime(e.createdAt)}</div>
|
|
5162
5284
|
</div>
|
|
@@ -5169,11 +5291,11 @@ let ce = class extends S {
|
|
|
5169
5291
|
`;
|
|
5170
5292
|
}
|
|
5171
5293
|
};
|
|
5172
|
-
|
|
5294
|
+
de.styles = [
|
|
5173
5295
|
ee,
|
|
5174
|
-
|
|
5296
|
+
ge,
|
|
5175
5297
|
_e,
|
|
5176
|
-
|
|
5298
|
+
I`
|
|
5177
5299
|
:host {
|
|
5178
5300
|
display: block;
|
|
5179
5301
|
}
|
|
@@ -5366,17 +5488,17 @@ ce.styles = [
|
|
|
5366
5488
|
}
|
|
5367
5489
|
`
|
|
5368
5490
|
];
|
|
5369
|
-
|
|
5491
|
+
qe([
|
|
5370
5492
|
g({ attribute: !1 })
|
|
5371
|
-
],
|
|
5372
|
-
|
|
5493
|
+
], de.prototype, "client", 2);
|
|
5494
|
+
qe([
|
|
5373
5495
|
v()
|
|
5374
|
-
],
|
|
5375
|
-
|
|
5496
|
+
], de.prototype, "notifications", 2);
|
|
5497
|
+
de = qe([
|
|
5376
5498
|
R("pulse-widget-notifications-panel")
|
|
5377
|
-
],
|
|
5378
|
-
const
|
|
5379
|
-
class
|
|
5499
|
+
], de);
|
|
5500
|
+
const rs = 3e3;
|
|
5501
|
+
class as {
|
|
5380
5502
|
constructor(e) {
|
|
5381
5503
|
this.container = null, this.cursors = /* @__PURE__ */ new Map(), this.cursorEls = /* @__PURE__ */ new Map(), this.cursorLastSeen = /* @__PURE__ */ new Map(), this.unsubs = [], this.enabled = !1, this.sending = !1, this.staleTimer = null, this.handleLocalCursor = (t) => {
|
|
5382
5504
|
t.pointerType !== "touch" && this.client.moveCursor({
|
|
@@ -5428,7 +5550,7 @@ class rs {
|
|
|
5428
5550
|
), this.setSending(!0), this.staleTimer = setInterval(() => {
|
|
5429
5551
|
const e = Date.now();
|
|
5430
5552
|
for (const [t, i] of this.cursorLastSeen)
|
|
5431
|
-
if (e - i >
|
|
5553
|
+
if (e - i > rs) {
|
|
5432
5554
|
this.cursors.delete(t);
|
|
5433
5555
|
const n = this.cursorEls.get(t);
|
|
5434
5556
|
n && n.remove(), this.cursorEls.delete(t), this.cursorLastSeen.delete(t);
|
|
@@ -5524,7 +5646,7 @@ class rs {
|
|
|
5524
5646
|
i.style.transform = `translate(${t.position.x}px, ${t.position.y}px)`;
|
|
5525
5647
|
}
|
|
5526
5648
|
}
|
|
5527
|
-
class
|
|
5649
|
+
class ls {
|
|
5528
5650
|
constructor(e) {
|
|
5529
5651
|
this.container = null, this.unsubs = [], this.enabled = !1, this.drawMode = !1, this.currentPoints = [], this.currentPath = null, this.lastPoint = null, this.fadeTimers = /* @__PURE__ */ new Map(), this.handlePointerDown = (t) => {
|
|
5530
5652
|
var l, a, c;
|
|
@@ -5607,9 +5729,9 @@ class as {
|
|
|
5607
5729
|
this.fadeTimers.set(e, t);
|
|
5608
5730
|
}
|
|
5609
5731
|
}
|
|
5610
|
-
function
|
|
5732
|
+
function cs(s) {
|
|
5611
5733
|
if (!s.rangeCount || s.isCollapsed) return null;
|
|
5612
|
-
const e = s.getRangeAt(0), t = e.startContainer, i = e.endContainer, n =
|
|
5734
|
+
const e = s.getRangeAt(0), t = e.startContainer, i = e.endContainer, n = ft(t), o = ft(i);
|
|
5613
5735
|
return !n || !o ? null : {
|
|
5614
5736
|
startSelector: n,
|
|
5615
5737
|
startOffset: e.startOffset,
|
|
@@ -5617,10 +5739,10 @@ function ls(s) {
|
|
|
5617
5739
|
endOffset: e.endOffset
|
|
5618
5740
|
};
|
|
5619
5741
|
}
|
|
5620
|
-
function
|
|
5742
|
+
function ds(s) {
|
|
5621
5743
|
var e, t;
|
|
5622
5744
|
try {
|
|
5623
|
-
const i =
|
|
5745
|
+
const i = gt(s.startSelector), n = gt(s.endSelector);
|
|
5624
5746
|
if (!i || !n) return null;
|
|
5625
5747
|
const o = document.createRange(), r = i.nodeType === Node.TEXT_NODE ? ((e = i.textContent) == null ? void 0 : e.length) ?? 0 : i.childNodes.length, l = n.nodeType === Node.TEXT_NODE ? ((t = n.textContent) == null ? void 0 : t.length) ?? 0 : n.childNodes.length;
|
|
5626
5748
|
return o.setStart(i, Math.min(s.startOffset, r)), o.setEnd(n, Math.min(s.endOffset, l)), o;
|
|
@@ -5628,18 +5750,18 @@ function cs(s) {
|
|
|
5628
5750
|
return null;
|
|
5629
5751
|
}
|
|
5630
5752
|
}
|
|
5631
|
-
function
|
|
5753
|
+
function ft(s) {
|
|
5632
5754
|
if (s.nodeType === Node.TEXT_NODE) {
|
|
5633
5755
|
const e = s.parentElement;
|
|
5634
5756
|
if (!e) return null;
|
|
5635
|
-
const t =
|
|
5757
|
+
const t = mt(e);
|
|
5636
5758
|
if (!t) return null;
|
|
5637
5759
|
const i = Array.from(e.childNodes).indexOf(s);
|
|
5638
5760
|
return `${t}::text(${i})`;
|
|
5639
5761
|
}
|
|
5640
|
-
return s.nodeType === Node.ELEMENT_NODE ?
|
|
5762
|
+
return s.nodeType === Node.ELEMENT_NODE ? mt(s) : null;
|
|
5641
5763
|
}
|
|
5642
|
-
function
|
|
5764
|
+
function mt(s) {
|
|
5643
5765
|
if (!s || s === document.documentElement) return "html";
|
|
5644
5766
|
if (s === document.body) return "body";
|
|
5645
5767
|
if (s.id) return `#${CSS.escape(s.id)}`;
|
|
@@ -5665,7 +5787,7 @@ function ft(s) {
|
|
|
5665
5787
|
}
|
|
5666
5788
|
return e.length > 0 ? e.join(" > ") : null;
|
|
5667
5789
|
}
|
|
5668
|
-
function
|
|
5790
|
+
function gt(s) {
|
|
5669
5791
|
const e = s.match(/^(.+)::text\((\d+)\)$/);
|
|
5670
5792
|
if (e) {
|
|
5671
5793
|
const t = e[1], i = parseInt(e[2], 10);
|
|
@@ -5682,7 +5804,7 @@ function mt(s) {
|
|
|
5682
5804
|
return null;
|
|
5683
5805
|
}
|
|
5684
5806
|
}
|
|
5685
|
-
class
|
|
5807
|
+
class hs {
|
|
5686
5808
|
constructor(e) {
|
|
5687
5809
|
this.container = null, this.unsubs = [], this.enabled = !1, this.selectionEls = /* @__PURE__ */ new Map(), this.clearTimers = /* @__PURE__ */ new Map(), this.client = e;
|
|
5688
5810
|
}
|
|
@@ -5726,26 +5848,26 @@ class ds {
|
|
|
5726
5848
|
if (!this.container) return;
|
|
5727
5849
|
const i = (l = this.client.state.user) == null ? void 0 : l.id;
|
|
5728
5850
|
if (e === i || (this.clearSelection(e), !t)) return;
|
|
5729
|
-
const n =
|
|
5851
|
+
const n = ds(t);
|
|
5730
5852
|
if (!n) return;
|
|
5731
5853
|
const o = this.client.state.presence.find(
|
|
5732
5854
|
(a) => a.user.id === e
|
|
5733
5855
|
), r = (o == null ? void 0 : o.user.color) ?? "#6366f1";
|
|
5734
5856
|
try {
|
|
5735
5857
|
const a = n.getClientRects(), c = [];
|
|
5736
|
-
for (let
|
|
5737
|
-
const
|
|
5738
|
-
Object.assign(
|
|
5858
|
+
for (let p = 0; p < a.length; p++) {
|
|
5859
|
+
const d = a[p], u = document.createElement("div");
|
|
5860
|
+
Object.assign(u.style, {
|
|
5739
5861
|
position: "absolute",
|
|
5740
|
-
left: `${
|
|
5741
|
-
top: `${
|
|
5742
|
-
width: `${
|
|
5743
|
-
height: `${
|
|
5862
|
+
left: `${d.left}px`,
|
|
5863
|
+
top: `${d.top}px`,
|
|
5864
|
+
width: `${d.width}px`,
|
|
5865
|
+
height: `${d.height}px`,
|
|
5744
5866
|
background: r,
|
|
5745
5867
|
opacity: "0.2",
|
|
5746
5868
|
borderRadius: "2px",
|
|
5747
5869
|
pointerEvents: "none"
|
|
5748
|
-
}), this.container.appendChild(
|
|
5870
|
+
}), this.container.appendChild(u), c.push(u);
|
|
5749
5871
|
}
|
|
5750
5872
|
this.selectionEls.set(e, c);
|
|
5751
5873
|
} catch {
|
|
@@ -5765,12 +5887,12 @@ class ds {
|
|
|
5765
5887
|
}
|
|
5766
5888
|
}
|
|
5767
5889
|
}
|
|
5768
|
-
var
|
|
5769
|
-
for (var n = i > 1 ? void 0 : i ?
|
|
5890
|
+
var ps = Object.defineProperty, us = Object.getOwnPropertyDescriptor, Ve = (s, e, t, i) => {
|
|
5891
|
+
for (var n = i > 1 ? void 0 : i ? us(e, t) : e, o = s.length - 1, r; o >= 0; o--)
|
|
5770
5892
|
(r = s[o]) && (n = (i ? r(e, t, n) : r(n)) || n);
|
|
5771
|
-
return i && n &&
|
|
5893
|
+
return i && n && ps(e, t, n), n;
|
|
5772
5894
|
};
|
|
5773
|
-
let
|
|
5895
|
+
let he = class extends S {
|
|
5774
5896
|
constructor() {
|
|
5775
5897
|
super(...arguments), this.roomId = "";
|
|
5776
5898
|
}
|
|
@@ -5790,7 +5912,7 @@ let de = class extends S {
|
|
|
5790
5912
|
);
|
|
5791
5913
|
}
|
|
5792
5914
|
renderToggle(s, e) {
|
|
5793
|
-
return
|
|
5915
|
+
return h`
|
|
5794
5916
|
<div class="setting-row">
|
|
5795
5917
|
<span class="setting-label">${s}</span>
|
|
5796
5918
|
<label class="toggle">
|
|
@@ -5806,12 +5928,12 @@ let de = class extends S {
|
|
|
5806
5928
|
}
|
|
5807
5929
|
render() {
|
|
5808
5930
|
const s = !this.settings.enabled;
|
|
5809
|
-
return
|
|
5931
|
+
return h`
|
|
5810
5932
|
<div class="panel">
|
|
5811
5933
|
<div class="panel-header">
|
|
5812
5934
|
<span class="panel-title">Settings</span>
|
|
5813
5935
|
<button class="close-btn" @click=${this.fireClose} title="Close">
|
|
5814
|
-
${
|
|
5936
|
+
${E(me, 16)}
|
|
5815
5937
|
</button>
|
|
5816
5938
|
</div>
|
|
5817
5939
|
|
|
@@ -5856,11 +5978,11 @@ let de = class extends S {
|
|
|
5856
5978
|
`;
|
|
5857
5979
|
}
|
|
5858
5980
|
};
|
|
5859
|
-
|
|
5981
|
+
he.styles = [
|
|
5860
5982
|
ee,
|
|
5861
|
-
|
|
5983
|
+
ge,
|
|
5862
5984
|
_e,
|
|
5863
|
-
|
|
5985
|
+
I`
|
|
5864
5986
|
:host {
|
|
5865
5987
|
display: block;
|
|
5866
5988
|
}
|
|
@@ -6031,16 +6153,16 @@ de.styles = [
|
|
|
6031
6153
|
}
|
|
6032
6154
|
`
|
|
6033
6155
|
];
|
|
6034
|
-
|
|
6156
|
+
Ve([
|
|
6035
6157
|
g({ attribute: !1 })
|
|
6036
|
-
],
|
|
6037
|
-
|
|
6158
|
+
], he.prototype, "settings", 2);
|
|
6159
|
+
Ve([
|
|
6038
6160
|
g()
|
|
6039
|
-
],
|
|
6040
|
-
|
|
6161
|
+
], he.prototype, "roomId", 2);
|
|
6162
|
+
he = Ve([
|
|
6041
6163
|
R("pulse-widget-settings-panel")
|
|
6042
|
-
],
|
|
6043
|
-
const
|
|
6164
|
+
], he);
|
|
6165
|
+
const ye = {
|
|
6044
6166
|
enabled: !0,
|
|
6045
6167
|
showMyCursor: !0,
|
|
6046
6168
|
showOthersCursors: !0,
|
|
@@ -6051,24 +6173,24 @@ const xe = {
|
|
|
6051
6173
|
showViewportIndicators: !0,
|
|
6052
6174
|
showSelections: !0,
|
|
6053
6175
|
showDrawings: !0
|
|
6054
|
-
},
|
|
6055
|
-
function
|
|
6176
|
+
}, St = "pulse:settings:";
|
|
6177
|
+
function fs(s) {
|
|
6056
6178
|
try {
|
|
6057
|
-
const e = localStorage.getItem(`${
|
|
6058
|
-
return e ? { ...
|
|
6179
|
+
const e = localStorage.getItem(`${St}${s}`);
|
|
6180
|
+
return e ? { ...ye, ...JSON.parse(e) } : { ...ye };
|
|
6059
6181
|
} catch {
|
|
6060
|
-
return { ...
|
|
6182
|
+
return { ...ye };
|
|
6061
6183
|
}
|
|
6062
6184
|
}
|
|
6063
|
-
function
|
|
6064
|
-
localStorage.setItem(`${
|
|
6185
|
+
function ms(s, e) {
|
|
6186
|
+
localStorage.setItem(`${St}${s}`, JSON.stringify(e));
|
|
6065
6187
|
}
|
|
6066
|
-
var
|
|
6067
|
-
for (var n = i > 1 ? void 0 : i ?
|
|
6188
|
+
var gs = Object.defineProperty, bs = Object.getOwnPropertyDescriptor, L = (s, e, t, i) => {
|
|
6189
|
+
for (var n = i > 1 ? void 0 : i ? bs(e, t) : e, o = s.length - 1, r; o >= 0; o--)
|
|
6068
6190
|
(r = s[o]) && (n = (i ? r(e, t, n) : r(n)) || n);
|
|
6069
|
-
return i && n &&
|
|
6191
|
+
return i && n && gs(e, t, n), n;
|
|
6070
6192
|
};
|
|
6071
|
-
let
|
|
6193
|
+
let M = class extends S {
|
|
6072
6194
|
constructor() {
|
|
6073
6195
|
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;
|
|
6074
6196
|
}
|
|
@@ -6119,35 +6241,35 @@ let I = class extends S {
|
|
|
6119
6241
|
render() {
|
|
6120
6242
|
const s = this.display === "inline";
|
|
6121
6243
|
if (this.collapsed)
|
|
6122
|
-
return
|
|
6244
|
+
return h`
|
|
6123
6245
|
<div class="toolbar collapsed ${s ? "inline" : ""}" @click=${this.fireToggle}>
|
|
6124
|
-
<span class="fab-icon">${
|
|
6246
|
+
<span class="fab-icon">${E(Ri, s ? 18 : 24)}</span>
|
|
6125
6247
|
</div>
|
|
6126
6248
|
`;
|
|
6127
6249
|
const e = this.users.slice(0, 3), t = this.users.length - 3;
|
|
6128
|
-
return
|
|
6250
|
+
return h`
|
|
6129
6251
|
<div class="toolbar ${s ? "inline" : ""}"
|
|
6130
6252
|
<!-- Presence avatars -->
|
|
6131
|
-
${this.users.length > 0 ?
|
|
6253
|
+
${this.users.length > 0 ? h`
|
|
6132
6254
|
<div class="presence">
|
|
6133
|
-
${t > 0 ?
|
|
6255
|
+
${t > 0 ? h`<div class="presence-overflow">+${t}</div>` : m}
|
|
6134
6256
|
${e.map(
|
|
6135
|
-
(i) =>
|
|
6257
|
+
(i) => h`
|
|
6136
6258
|
<div
|
|
6137
6259
|
class="presence-avatar clickable ${this.followingUserId === i.user.id ? "following" : ""}"
|
|
6138
6260
|
style="background:${i.user.color}"
|
|
6139
6261
|
@click=${() => this.fireFollow(i.user.id)}
|
|
6140
6262
|
title="Click to follow ${i.user.name}"
|
|
6141
6263
|
>
|
|
6142
|
-
${i.user.avatar ?
|
|
6264
|
+
${i.user.avatar ? h`<img src="${i.user.avatar}" alt="${i.user.name}" />` : this.getInitials(i.user.name)}
|
|
6143
6265
|
<span class="presence-tooltip">${i.user.name}</span>
|
|
6144
|
-
${i.deviceType && i.deviceType !== "desktop" ?
|
|
6266
|
+
${i.deviceType && i.deviceType !== "desktop" ? h`<span class="device-icon">${i.deviceType === "mobile" ? "📱" : "📲"}</span>` : m}
|
|
6145
6267
|
</div>
|
|
6146
6268
|
`
|
|
6147
6269
|
)}
|
|
6148
6270
|
</div>
|
|
6149
6271
|
<div class="separator"></div>
|
|
6150
|
-
` :
|
|
6272
|
+
` : m}
|
|
6151
6273
|
|
|
6152
6274
|
<!-- Pin comment (primary) -->
|
|
6153
6275
|
<button
|
|
@@ -6157,7 +6279,7 @@ let I = class extends S {
|
|
|
6157
6279
|
?disabled=${this.featuresDisabled}
|
|
6158
6280
|
style="${this.featuresDisabled ? "opacity:0.35;pointer-events:none" : ""}"
|
|
6159
6281
|
>
|
|
6160
|
-
${
|
|
6282
|
+
${E(_t)}
|
|
6161
6283
|
</button>
|
|
6162
6284
|
|
|
6163
6285
|
<!-- View comments -->
|
|
@@ -6168,7 +6290,7 @@ let I = class extends S {
|
|
|
6168
6290
|
?disabled=${this.featuresDisabled}
|
|
6169
6291
|
style="${this.featuresDisabled ? "opacity:0.35;pointer-events:none" : ""}"
|
|
6170
6292
|
>
|
|
6171
|
-
${
|
|
6293
|
+
${E(_i)}
|
|
6172
6294
|
</button>
|
|
6173
6295
|
|
|
6174
6296
|
<!-- Activity feed -->
|
|
@@ -6179,7 +6301,7 @@ let I = class extends S {
|
|
|
6179
6301
|
?disabled=${this.featuresDisabled}
|
|
6180
6302
|
style="${this.featuresDisabled ? "opacity:0.35;pointer-events:none" : ""}"
|
|
6181
6303
|
>
|
|
6182
|
-
${
|
|
6304
|
+
${E(Ci)}
|
|
6183
6305
|
</button>
|
|
6184
6306
|
|
|
6185
6307
|
<!-- Draw mode -->
|
|
@@ -6190,7 +6312,7 @@ let I = class extends S {
|
|
|
6190
6312
|
?disabled=${this.featuresDisabled}
|
|
6191
6313
|
style="${this.featuresDisabled ? "opacity:0.35;pointer-events:none" : ""}"
|
|
6192
6314
|
>
|
|
6193
|
-
${
|
|
6315
|
+
${E(Pi)}
|
|
6194
6316
|
</button>
|
|
6195
6317
|
|
|
6196
6318
|
<!-- Notifications -->
|
|
@@ -6201,8 +6323,8 @@ let I = class extends S {
|
|
|
6201
6323
|
?disabled=${this.featuresDisabled}
|
|
6202
6324
|
style="${this.featuresDisabled ? "opacity:0.35;pointer-events:none" : "position:relative"}"
|
|
6203
6325
|
>
|
|
6204
|
-
${
|
|
6205
|
-
${this.unreadCount > 0 ?
|
|
6326
|
+
${E(Ei)}
|
|
6327
|
+
${this.unreadCount > 0 ? h`<span class="badge">${this.unreadCount > 9 ? "9+" : this.unreadCount}</span>` : m}
|
|
6206
6328
|
</button>
|
|
6207
6329
|
|
|
6208
6330
|
<!-- Settings -->
|
|
@@ -6211,7 +6333,7 @@ let I = class extends S {
|
|
|
6211
6333
|
@click=${() => this.fire("settings")}
|
|
6212
6334
|
title="Settings"
|
|
6213
6335
|
>
|
|
6214
|
-
${
|
|
6336
|
+
${E(Ii)}
|
|
6215
6337
|
</button>
|
|
6216
6338
|
|
|
6217
6339
|
<div class="separator"></div>
|
|
@@ -6222,16 +6344,16 @@ let I = class extends S {
|
|
|
6222
6344
|
@click=${this.fireToggle}
|
|
6223
6345
|
title="Collapse"
|
|
6224
6346
|
>
|
|
6225
|
-
${
|
|
6347
|
+
${E(me, 14)}
|
|
6226
6348
|
</button>
|
|
6227
6349
|
</div>
|
|
6228
6350
|
`;
|
|
6229
6351
|
}
|
|
6230
6352
|
};
|
|
6231
|
-
|
|
6353
|
+
M.styles = [
|
|
6232
6354
|
ee,
|
|
6233
|
-
|
|
6234
|
-
|
|
6355
|
+
ge,
|
|
6356
|
+
I`
|
|
6235
6357
|
:host {
|
|
6236
6358
|
display: block;
|
|
6237
6359
|
}
|
|
@@ -6445,38 +6567,38 @@ I.styles = [
|
|
|
6445
6567
|
];
|
|
6446
6568
|
L([
|
|
6447
6569
|
g({ attribute: !1 })
|
|
6448
|
-
],
|
|
6570
|
+
], M.prototype, "client", 2);
|
|
6449
6571
|
L([
|
|
6450
6572
|
g({ type: Boolean })
|
|
6451
|
-
],
|
|
6573
|
+
], M.prototype, "collapsed", 2);
|
|
6452
6574
|
L([
|
|
6453
6575
|
g()
|
|
6454
|
-
],
|
|
6576
|
+
], M.prototype, "activePanel", 2);
|
|
6455
6577
|
L([
|
|
6456
6578
|
g({ type: Boolean })
|
|
6457
|
-
],
|
|
6579
|
+
], M.prototype, "pinModeActive", 2);
|
|
6458
6580
|
L([
|
|
6459
6581
|
g({ type: Boolean })
|
|
6460
|
-
],
|
|
6582
|
+
], M.prototype, "featuresDisabled", 2);
|
|
6461
6583
|
L([
|
|
6462
6584
|
g({ type: Boolean })
|
|
6463
|
-
],
|
|
6585
|
+
], M.prototype, "drawModeActive", 2);
|
|
6464
6586
|
L([
|
|
6465
6587
|
g()
|
|
6466
|
-
],
|
|
6588
|
+
], M.prototype, "followingUserId", 2);
|
|
6467
6589
|
L([
|
|
6468
6590
|
g()
|
|
6469
|
-
],
|
|
6591
|
+
], M.prototype, "display", 2);
|
|
6470
6592
|
L([
|
|
6471
6593
|
v()
|
|
6472
|
-
],
|
|
6594
|
+
], M.prototype, "users", 2);
|
|
6473
6595
|
L([
|
|
6474
6596
|
v()
|
|
6475
|
-
],
|
|
6476
|
-
|
|
6597
|
+
], M.prototype, "unreadCount", 2);
|
|
6598
|
+
M = L([
|
|
6477
6599
|
R("pulse-widget-toolbar")
|
|
6478
|
-
],
|
|
6479
|
-
class
|
|
6600
|
+
], M);
|
|
6601
|
+
class vs {
|
|
6480
6602
|
constructor(e) {
|
|
6481
6603
|
this.container = null, this.unsubs = [], this.enabled = !1, this.pillEls = /* @__PURE__ */ new Map(), this.client = e;
|
|
6482
6604
|
}
|
|
@@ -6517,8 +6639,8 @@ class bs {
|
|
|
6517
6639
|
const e = window.scrollY, t = window.innerHeight, i = document.documentElement.scrollHeight, n = (r = this.client.state.user) == null ? void 0 : r.id, o = /* @__PURE__ */ new Set();
|
|
6518
6640
|
for (const [l, a] of this.client.state.viewports) {
|
|
6519
6641
|
if (l === n) continue;
|
|
6520
|
-
const c = a.scrollY,
|
|
6521
|
-
if (c >=
|
|
6642
|
+
const c = a.scrollY, p = a.scrollY + a.viewportHeight, d = e, u = e + t;
|
|
6643
|
+
if (c >= d && p <= u) {
|
|
6522
6644
|
const k = this.pillEls.get(l);
|
|
6523
6645
|
k && (k.style.display = "none");
|
|
6524
6646
|
continue;
|
|
@@ -6554,14 +6676,14 @@ class bs {
|
|
|
6554
6676
|
return e.split(" ").map((t) => t[0]).join("").toUpperCase().slice(0, 2);
|
|
6555
6677
|
}
|
|
6556
6678
|
}
|
|
6557
|
-
var
|
|
6558
|
-
for (var n = i > 1 ? void 0 : i ?
|
|
6679
|
+
var xs = Object.defineProperty, ys = Object.getOwnPropertyDescriptor, P = (s, e, t, i) => {
|
|
6680
|
+
for (var n = i > 1 ? void 0 : i ? ys(e, t) : e, o = s.length - 1, r; o >= 0; o--)
|
|
6559
6681
|
(r = s[o]) && (n = (i ? r(e, t, n) : r(n)) || n);
|
|
6560
|
-
return i && n &&
|
|
6682
|
+
return i && n && xs(e, t, n), n;
|
|
6561
6683
|
};
|
|
6562
|
-
let
|
|
6684
|
+
let C = class extends S {
|
|
6563
6685
|
constructor() {
|
|
6564
|
-
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 = { ...
|
|
6686
|
+
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 = () => {
|
|
6565
6687
|
!this.settings.enabled || !this.client || this._isFollowScrolling || (this.followingUserId && (this.followingUserId = null), !this._viewportThrottleTimer && (this._viewportThrottleTimer = setTimeout(() => {
|
|
6566
6688
|
var s;
|
|
6567
6689
|
this._viewportThrottleTimer = null, (s = this.client) == null || s.updateViewport({
|
|
@@ -6582,7 +6704,7 @@ let E = class extends S {
|
|
|
6582
6704
|
(t = this.client) == null || t.updateSelection(null);
|
|
6583
6705
|
return;
|
|
6584
6706
|
}
|
|
6585
|
-
const e =
|
|
6707
|
+
const e = cs(s);
|
|
6586
6708
|
(i = this.client) == null || i.updateSelection(e);
|
|
6587
6709
|
}, 500));
|
|
6588
6710
|
}, this.handleDocumentClick = (s) => {
|
|
@@ -6614,11 +6736,11 @@ let E = class extends S {
|
|
|
6614
6736
|
room: this.room,
|
|
6615
6737
|
endpoint: this.endpoint
|
|
6616
6738
|
};
|
|
6617
|
-
this.client = new
|
|
6739
|
+
this.client = new xt(s), this.clientConfigKey = this.getConfigKey(), this.cursorOverlay = new as(this.client), this.commentPins = new Ji(this.client, {
|
|
6618
6740
|
onPinModeExit: () => {
|
|
6619
6741
|
this.pinModeActive = !1;
|
|
6620
6742
|
}
|
|
6621
|
-
}), this.viewportOverlay = new
|
|
6743
|
+
}), this.viewportOverlay = new vs(this.client), this.selectionOverlay = new hs(this.client), this.drawingOverlay = new ls(this.client), this.settings = fs(this.room), this.applySettings(this.settings), this.unsubs.push(
|
|
6622
6744
|
this.client.on("connection", (e) => {
|
|
6623
6745
|
this.connectionState = e, e === "connected" && this._wasDisconnected ? (this.showConnectedFlash = !0, this._connectedFlashTimer && clearTimeout(this._connectedFlashTimer), this._connectedFlashTimer = setTimeout(() => {
|
|
6624
6746
|
this.showConnectedFlash = !1, this._connectedFlashTimer = null;
|
|
@@ -6685,15 +6807,15 @@ let E = class extends S {
|
|
|
6685
6807
|
}
|
|
6686
6808
|
handleSettingsChange(s) {
|
|
6687
6809
|
const e = s.detail;
|
|
6688
|
-
this.settings = e,
|
|
6810
|
+
this.settings = e, ms(this.room, e), this.applySettings(e);
|
|
6689
6811
|
}
|
|
6690
6812
|
applySettings(s) {
|
|
6691
|
-
var e, t, i, n, o, r, l, a, c,
|
|
6813
|
+
var e, t, i, n, o, r, l, a, c, p, d, u, f, b, x, _, $;
|
|
6692
6814
|
if (!s.enabled) {
|
|
6693
6815
|
(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;
|
|
6694
6816
|
return;
|
|
6695
6817
|
}
|
|
6696
|
-
this.applyCursorSettings(s), (c = this.client) == null || c.setAppearOffline(s.appearOffline), (
|
|
6818
|
+
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 ? (f = this.selectionOverlay) == null || f.enable() : (b = this.selectionOverlay) == null || b.disable(), s.showDrawings ? (x = this.drawingOverlay) == null || x.enable() : ((_ = this.drawingOverlay) == null || _.disable(), this.drawModeActive && (($ = this.drawingOverlay) == null || $.disableDrawMode(), this.drawModeActive = !1));
|
|
6697
6819
|
}
|
|
6698
6820
|
applyCursorSettings(s) {
|
|
6699
6821
|
if (!this.cursorOverlay) return;
|
|
@@ -6719,9 +6841,9 @@ let E = class extends S {
|
|
|
6719
6841
|
const c = ($ = this.shadowRoot) == null ? void 0 : $.querySelector(".panel-container");
|
|
6720
6842
|
if (!c) return;
|
|
6721
6843
|
Object.assign(c.style, { top: "auto", left: "auto" });
|
|
6722
|
-
const
|
|
6723
|
-
if (!
|
|
6724
|
-
const
|
|
6844
|
+
const p = a ?? t;
|
|
6845
|
+
if (!p) return;
|
|
6846
|
+
const d = p.getBoundingClientRect(), u = c.getBoundingClientRect(), f = this.computePosition(d, u, o, r, l);
|
|
6725
6847
|
c.style.top = `${f.top}px`, c.style.left = `${f.left}px`;
|
|
6726
6848
|
}
|
|
6727
6849
|
computePosition(s, e, t, i, n) {
|
|
@@ -6741,13 +6863,13 @@ let E = class extends S {
|
|
|
6741
6863
|
return (s == null ? void 0 : s.user.name) ?? "user";
|
|
6742
6864
|
}
|
|
6743
6865
|
renderConnectionBanner() {
|
|
6744
|
-
return this.showConnectedFlash ?
|
|
6866
|
+
return this.showConnectedFlash ? h`<div class="connection-banner connected">
|
|
6745
6867
|
<span class="connection-dot"></span>Connected
|
|
6746
|
-
</div>` : this.connectionState === "connecting" ?
|
|
6868
|
+
</div>` : this.connectionState === "connecting" ? h`<div class="connection-banner connecting">
|
|
6747
6869
|
<span class="connection-dot"></span>Reconnecting...
|
|
6748
|
-
</div>` : this.connectionState === "disconnected" && this.client ?
|
|
6870
|
+
</div>` : this.connectionState === "disconnected" && this.client ? h`<div class="connection-banner disconnected">
|
|
6749
6871
|
<span class="connection-dot"></span>Disconnected
|
|
6750
|
-
</div>` :
|
|
6872
|
+
</div>` : m;
|
|
6751
6873
|
}
|
|
6752
6874
|
handleToolbarToggle() {
|
|
6753
6875
|
this.collapsed = !this.collapsed, this.collapsed && (this.activePanel = null, this.highlightThreadId = null);
|
|
@@ -6755,38 +6877,38 @@ let E = class extends S {
|
|
|
6755
6877
|
render() {
|
|
6756
6878
|
const s = this.display === "inline";
|
|
6757
6879
|
if (s && this.collapsed)
|
|
6758
|
-
return
|
|
6880
|
+
return h`
|
|
6759
6881
|
<div class="widget-root">
|
|
6760
6882
|
<div class="inline-trigger" @click=${this.handleToolbarToggle}>
|
|
6761
6883
|
<slot>Collaborate</slot>
|
|
6762
6884
|
</div>
|
|
6763
6885
|
</div>
|
|
6764
6886
|
`;
|
|
6765
|
-
const e = this.activePanel ?
|
|
6887
|
+
const e = this.activePanel ? h`
|
|
6766
6888
|
<div class="panel-container anchored" @panel-close=${this.handlePanelClose}>
|
|
6767
|
-
${this.activePanel === "comments" ?
|
|
6889
|
+
${this.activePanel === "comments" ? h`<pulse-widget-comments-panel
|
|
6768
6890
|
.client=${this.client}
|
|
6769
6891
|
.highlightThreadId=${this.highlightThreadId}
|
|
6770
|
-
></pulse-widget-comments-panel>` :
|
|
6771
|
-
${this.activePanel === "settings" ?
|
|
6892
|
+
></pulse-widget-comments-panel>` : m}
|
|
6893
|
+
${this.activePanel === "settings" ? h`<pulse-widget-settings-panel
|
|
6772
6894
|
.settings=${this.settings}
|
|
6773
6895
|
.roomId=${this.room}
|
|
6774
6896
|
@settings-change=${this.handleSettingsChange}
|
|
6775
|
-
></pulse-widget-settings-panel>` :
|
|
6776
|
-
${this.activePanel === "notifications" ?
|
|
6897
|
+
></pulse-widget-settings-panel>` : m}
|
|
6898
|
+
${this.activePanel === "notifications" ? h`<pulse-widget-notifications-panel
|
|
6777
6899
|
.client=${this.client}
|
|
6778
|
-
></pulse-widget-notifications-panel>` :
|
|
6779
|
-
${this.activePanel === "activity" ?
|
|
6900
|
+
></pulse-widget-notifications-panel>` : m}
|
|
6901
|
+
${this.activePanel === "activity" ? h`<pulse-widget-activity-panel
|
|
6780
6902
|
.client=${this.client}
|
|
6781
|
-
></pulse-widget-activity-panel>` :
|
|
6903
|
+
></pulse-widget-activity-panel>` : m}
|
|
6782
6904
|
</div>
|
|
6783
|
-
` :
|
|
6905
|
+
` : m, t = this.followingUserId ? h`<div class="follow-banner">
|
|
6784
6906
|
Following ${this.getFollowUserName()}
|
|
6785
6907
|
<button @click=${() => {
|
|
6786
6908
|
this.followingUserId = null;
|
|
6787
6909
|
}}>Stop</button>
|
|
6788
|
-
</div>` :
|
|
6789
|
-
return s ?
|
|
6910
|
+
</div>` : m;
|
|
6911
|
+
return s ? h`
|
|
6790
6912
|
${t}
|
|
6791
6913
|
<div class="widget-root">
|
|
6792
6914
|
<div class="inline-trigger" @click=${this.handleToolbarToggle}>
|
|
@@ -6810,7 +6932,7 @@ let E = class extends S {
|
|
|
6810
6932
|
</div>
|
|
6811
6933
|
${e}
|
|
6812
6934
|
</div>
|
|
6813
|
-
` :
|
|
6935
|
+
` : h`
|
|
6814
6936
|
${t}
|
|
6815
6937
|
<div class="widget-root">
|
|
6816
6938
|
${e}
|
|
@@ -6832,9 +6954,9 @@ let E = class extends S {
|
|
|
6832
6954
|
`;
|
|
6833
6955
|
}
|
|
6834
6956
|
};
|
|
6835
|
-
|
|
6957
|
+
C.styles = [
|
|
6836
6958
|
ee,
|
|
6837
|
-
|
|
6959
|
+
I`
|
|
6838
6960
|
:host {
|
|
6839
6961
|
display: block;
|
|
6840
6962
|
}
|
|
@@ -7012,58 +7134,58 @@ E.styles = [
|
|
|
7012
7134
|
];
|
|
7013
7135
|
P([
|
|
7014
7136
|
g({ attribute: "api-key" })
|
|
7015
|
-
],
|
|
7137
|
+
], C.prototype, "apiKey", 2);
|
|
7016
7138
|
P([
|
|
7017
7139
|
g()
|
|
7018
|
-
],
|
|
7140
|
+
], C.prototype, "token", 2);
|
|
7019
7141
|
P([
|
|
7020
7142
|
g()
|
|
7021
|
-
],
|
|
7143
|
+
], C.prototype, "room", 2);
|
|
7022
7144
|
P([
|
|
7023
7145
|
g()
|
|
7024
|
-
],
|
|
7146
|
+
], C.prototype, "endpoint", 2);
|
|
7025
7147
|
P([
|
|
7026
7148
|
g({ reflect: !0 })
|
|
7027
|
-
],
|
|
7149
|
+
], C.prototype, "position", 2);
|
|
7028
7150
|
P([
|
|
7029
7151
|
g({ reflect: !0 })
|
|
7030
|
-
],
|
|
7152
|
+
], C.prototype, "display", 2);
|
|
7031
7153
|
P([
|
|
7032
7154
|
v()
|
|
7033
|
-
],
|
|
7155
|
+
], C.prototype, "collapsed", 2);
|
|
7034
7156
|
P([
|
|
7035
7157
|
v()
|
|
7036
|
-
],
|
|
7158
|
+
], C.prototype, "activePanel", 2);
|
|
7037
7159
|
P([
|
|
7038
7160
|
v()
|
|
7039
|
-
],
|
|
7161
|
+
], C.prototype, "pinModeActive", 2);
|
|
7040
7162
|
P([
|
|
7041
7163
|
v()
|
|
7042
|
-
],
|
|
7164
|
+
], C.prototype, "highlightThreadId", 2);
|
|
7043
7165
|
P([
|
|
7044
7166
|
v()
|
|
7045
|
-
],
|
|
7167
|
+
], C.prototype, "settings", 2);
|
|
7046
7168
|
P([
|
|
7047
7169
|
v()
|
|
7048
|
-
],
|
|
7170
|
+
], C.prototype, "followingUserId", 2);
|
|
7049
7171
|
P([
|
|
7050
7172
|
v()
|
|
7051
|
-
],
|
|
7173
|
+
], C.prototype, "drawModeActive", 2);
|
|
7052
7174
|
P([
|
|
7053
7175
|
v()
|
|
7054
|
-
],
|
|
7176
|
+
], C.prototype, "connectionState", 2);
|
|
7055
7177
|
P([
|
|
7056
7178
|
v()
|
|
7057
|
-
],
|
|
7058
|
-
|
|
7179
|
+
], C.prototype, "showConnectedFlash", 2);
|
|
7180
|
+
C = P([
|
|
7059
7181
|
R("pulse-widget")
|
|
7060
|
-
],
|
|
7182
|
+
], C);
|
|
7061
7183
|
export {
|
|
7062
|
-
|
|
7063
|
-
|
|
7064
|
-
|
|
7184
|
+
W as PulseComments,
|
|
7185
|
+
le as PulseCursors,
|
|
7186
|
+
ce as PulseNotifications,
|
|
7065
7187
|
G as PulsePresence,
|
|
7066
|
-
|
|
7188
|
+
V as PulseProvider,
|
|
7067
7189
|
D as PulseReactions,
|
|
7068
|
-
|
|
7190
|
+
C as PulseWidget
|
|
7069
7191
|
};
|