@gamention/pulse-elements 0.1.15 → 0.1.16

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.
@@ -3,7 +3,7 @@
3
3
  * Copyright 2021 Google LLC
4
4
  * SPDX-License-Identifier: BSD-3-Clause
5
5
  */
6
- let yt = class extends Event {
6
+ let wt = class extends Event {
7
7
  constructor(e, t, i, s) {
8
8
  super("context-request", { bubbles: !0, composed: !0 }), this.context = e, this.contextTarget = t, this.callback = i, this.subscribe = s ?? !1;
9
9
  }
@@ -18,7 +18,7 @@ let yt = class extends Event {
18
18
  * Copyright 2021 Google LLC
19
19
  * SPDX-License-Identifier: BSD-3-Clause
20
20
  */
21
- let Ye = class {
21
+ let Ke = class {
22
22
  constructor(e, t, i, s) {
23
23
  if (this.subscribe = !1, this.provided = !1, this.value = void 0, this.t = (o, r) => {
24
24
  this.unsubscribe && (this.unsubscribe !== r && (this.provided = !1, this.unsubscribe()), this.subscribe || this.unsubscribe()), this.value = o, this.host.requestUpdate(), this.provided && !this.subscribe || (this.provided = !0, this.callback && this.callback(o, r)), this.unsubscribe = r;
@@ -35,7 +35,7 @@ let Ye = class {
35
35
  this.unsubscribe && (this.unsubscribe(), this.unsubscribe = void 0);
36
36
  }
37
37
  dispatchRequest() {
38
- this.host.dispatchEvent(new yt(this.context, this.host, this.t, this.subscribe));
38
+ this.host.dispatchEvent(new wt(this.context, this.host, this.t, this.subscribe));
39
39
  }
40
40
  };
41
41
  /**
@@ -43,7 +43,7 @@ let Ye = class {
43
43
  * Copyright 2021 Google LLC
44
44
  * SPDX-License-Identifier: BSD-3-Clause
45
45
  */
46
- let It = class {
46
+ let Ot = class {
47
47
  get value() {
48
48
  return this.o;
49
49
  }
@@ -76,21 +76,21 @@ let It = class {
76
76
  * Copyright 2021 Google LLC
77
77
  * SPDX-License-Identifier: BSD-3-Clause
78
78
  */
79
- let Mt = class extends Event {
79
+ let Rt = 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
- }, Ke = class extends It {
83
+ }, Ge = class extends Ot {
84
84
  constructor(e, t, i) {
85
85
  var s, o;
86
86
  super(t.context !== void 0 ? t.initialValue : i), this.onContextRequest = (r) => {
87
87
  if (r.context !== this.context) return;
88
- const l = r.contextTarget ?? r.composedPath()[0];
89
- l !== this.host && (r.stopPropagation(), this.addCallback(r.callback, l, r.subscribe));
88
+ const a = r.contextTarget ?? r.composedPath()[0];
89
+ a !== this.host && (r.stopPropagation(), this.addCallback(r.callback, a, r.subscribe));
90
90
  }, this.onProviderRequest = (r) => {
91
91
  if (r.context !== this.context || (r.contextTarget ?? r.composedPath()[0]) === this.host) return;
92
- const l = /* @__PURE__ */ new Set();
93
- for (const [a, { consumerHost: c }] of this.subscriptions) l.has(a) || (l.add(a), c.dispatchEvent(new yt(this.context, c, a, !0)));
92
+ const a = /* @__PURE__ */ new Set();
93
+ for (const [l, { consumerHost: d }] of this.subscriptions) a.has(l) || (a.add(l), d.dispatchEvent(new wt(this.context, d, l, !0)));
94
94
  r.stopPropagation();
95
95
  }, this.host = e, t.context !== void 0 ? this.context = t.context : this.context = t, this.attachListeners(), (o = (s = this.host).addController) == null || o.call(s, this);
96
96
  }
@@ -98,7 +98,7 @@ let Mt = 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 Mt(this.context, this.host));
101
+ this.host.dispatchEvent(new Rt(this.context, this.host));
102
102
  }
103
103
  };
104
104
  /**
@@ -106,7 +106,7 @@ let Mt = class extends Event {
106
106
  * Copyright 2017 Google LLC
107
107
  * SPDX-License-Identifier: BSD-3-Clause
108
108
  */
109
- function Ot({ context: n }) {
109
+ function Lt({ context: n }) {
110
110
  return (e, t) => {
111
111
  const i = /* @__PURE__ */ new WeakMap();
112
112
  if (typeof t == "object") return { get() {
@@ -114,11 +114,11 @@ function Ot({ context: n }) {
114
114
  }, set(s) {
115
115
  return i.get(this).setValue(s), e.set.call(this, s);
116
116
  }, init(s) {
117
- return i.set(this, new Ke(this, { context: n, initialValue: s })), s;
117
+ return i.set(this, new Ge(this, { context: n, initialValue: s })), s;
118
118
  } };
119
119
  {
120
120
  e.constructor.addInitializer(((r) => {
121
- i.set(r, new Ke(r, { context: n }));
121
+ i.set(r, new Ge(r, { context: n }));
122
122
  }));
123
123
  const s = Object.getOwnPropertyDescriptor(e, t);
124
124
  let o;
@@ -126,13 +126,13 @@ function Ot({ context: n }) {
126
126
  const r = /* @__PURE__ */ new WeakMap();
127
127
  o = { get() {
128
128
  return r.get(this);
129
- }, set(l) {
130
- i.get(this).setValue(l), r.set(this, l);
129
+ }, set(a) {
130
+ i.get(this).setValue(a), r.set(this, a);
131
131
  }, configurable: !0, enumerable: !0 };
132
132
  } else {
133
133
  const r = s.set;
134
- o = { ...s, set(l) {
135
- i.get(this).setValue(l), r == null || r.call(this, l);
134
+ o = { ...s, set(a) {
135
+ i.get(this).setValue(a), r == null || r.call(this, a);
136
136
  } };
137
137
  }
138
138
  return void Object.defineProperty(e, t, o);
@@ -144,24 +144,24 @@ function Ot({ context: n }) {
144
144
  * Copyright 2022 Google LLC
145
145
  * SPDX-License-Identifier: BSD-3-Clause
146
146
  */
147
- function ue({ context: n, subscribe: e }) {
147
+ function fe({ context: n, subscribe: e }) {
148
148
  return (t, i) => {
149
149
  typeof i == "object" ? i.addInitializer((function() {
150
- new Ye(this, { context: n, callback: (s) => {
150
+ new Ke(this, { context: n, callback: (s) => {
151
151
  t.set.call(this, s);
152
152
  }, subscribe: e });
153
153
  })) : t.constructor.addInitializer(((s) => {
154
- new Ye(s, { context: n, callback: (o) => {
154
+ new Ke(s, { context: n, callback: (o) => {
155
155
  s[i] = o;
156
156
  }, subscribe: e });
157
157
  }));
158
158
  };
159
159
  }
160
- var Rt = Object.defineProperty, Lt = (n, e, t) => e in n ? Rt(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t, $ = (n, e, t) => Lt(n, typeof e != "symbol" ? e + "" : e, t);
161
- const jt = "ws://localhost:4567";
162
- let Ue = class {
160
+ var jt = Object.defineProperty, zt = (n, e, t) => e in n ? jt(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t, k = (n, e, t) => zt(n, typeof e != "symbol" ? e + "" : e, t);
161
+ const Ut = "ws://localhost:4567";
162
+ let De = class {
163
163
  constructor() {
164
- $(this, "handlers", /* @__PURE__ */ new Map());
164
+ k(this, "handlers", /* @__PURE__ */ new Map());
165
165
  }
166
166
  on(e, t) {
167
167
  this.handlers.has(e) || this.handlers.set(e, /* @__PURE__ */ new Set());
@@ -179,9 +179,9 @@ let Ue = class {
179
179
  removeAll() {
180
180
  this.handlers.clear();
181
181
  }
182
- }, zt = class extends Ue {
182
+ }, Dt = class extends De {
183
183
  constructor(e) {
184
- super(), $(this, "ws", null), $(this, "endpoint"), $(this, "reconnectAttempt", 0), $(this, "reconnectTimer", null), $(this, "_state", "disconnected"), this.endpoint = e ?? jt;
184
+ super(), k(this, "ws", null), k(this, "endpoint"), k(this, "reconnectAttempt", 0), k(this, "reconnectTimer", null), k(this, "_state", "disconnected"), this.endpoint = e ?? Ut;
185
185
  }
186
186
  get state() {
187
187
  return this._state;
@@ -216,9 +216,9 @@ let Ue = class {
216
216
  this.reconnectTimer = null, this.connect();
217
217
  }, e);
218
218
  }
219
- }, Ut = class extends Ue {
219
+ }, Ht = class extends De {
220
220
  constructor() {
221
- super(...arguments), $(this, "baseUrl", ""), $(this, "_user", null), $(this, "_users", /* @__PURE__ */ new Map()), $(this, "_presence", /* @__PURE__ */ new Map()), $(this, "_threads", /* @__PURE__ */ new Map()), $(this, "_reactions", /* @__PURE__ */ new Map()), $(this, "_notifications", []), $(this, "_activityLogs", []), $(this, "_typing", /* @__PURE__ */ new Map()), $(this, "_viewports", /* @__PURE__ */ new Map()), $(this, "_selections", /* @__PURE__ */ new Map());
221
+ super(...arguments), k(this, "baseUrl", ""), k(this, "_user", null), k(this, "_users", /* @__PURE__ */ new Map()), k(this, "_presence", /* @__PURE__ */ new Map()), k(this, "_threads", /* @__PURE__ */ new Map()), k(this, "_reactions", /* @__PURE__ */ new Map()), k(this, "_notifications", []), k(this, "_activityLogs", []), k(this, "_typing", /* @__PURE__ */ new Map()), k(this, "_viewports", /* @__PURE__ */ new Map()), k(this, "_selections", /* @__PURE__ */ new Map());
222
222
  }
223
223
  get user() {
224
224
  return this._user;
@@ -426,12 +426,12 @@ let Ue = class {
426
426
  reset() {
427
427
  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();
428
428
  }
429
- }, wt = class extends Ue {
429
+ }, $t = class extends De {
430
430
  constructor(e) {
431
431
  var t;
432
- super(), $(this, "state"), $(this, "connection"), $(this, "config"), $(this, "heartbeatTimer", null), $(this, "lastCursorSend", 0), $(this, "pendingCursor", null), $(this, "cursorTimer", null), this.config = e, this.state = new Ut(), this.state.baseUrl = (e.endpoint ?? "").replace(/^ws(s?):/, "http$1:").replace(/\/$/, "");
432
+ super(), k(this, "state"), k(this, "connection"), k(this, "config"), k(this, "heartbeatTimer", null), k(this, "lastCursorSend", 0), k(this, "pendingCursor", null), k(this, "cursorTimer", null), this.config = e, this.state = new Ht(), this.state.baseUrl = (e.endpoint ?? "").replace(/^ws(s?):/, "http$1:").replace(/\/$/, "");
433
433
  const i = ((t = e.endpoint) == null ? void 0 : t.replace(/^http/, "ws")) ?? void 0;
434
- this.connection = new zt(i), this.connection.on("message", (s) => {
434
+ this.connection = new Dt(i), this.connection.on("message", (s) => {
435
435
  this.state.handleMessage(s), this.emit(s.type, s);
436
436
  }), this.connection.on("state", (s) => {
437
437
  this.emit("connection", s), s === "connected" ? (this.authenticate(), this.startHeartbeat()) : s === "disconnected" && this.stopHeartbeat();
@@ -575,18 +575,18 @@ let Ue = class {
575
575
  * Copyright 2019 Google LLC
576
576
  * SPDX-License-Identifier: BSD-3-Clause
577
577
  */
578
- const xe = globalThis, De = xe.ShadowRoot && (xe.ShadyCSS === void 0 || xe.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, He = Symbol(), Ge = /* @__PURE__ */ new WeakMap();
579
- let $t = class {
578
+ const ye = globalThis, He = ye.ShadowRoot && (ye.ShadyCSS === void 0 || ye.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, Be = Symbol(), Je = /* @__PURE__ */ new WeakMap();
579
+ let kt = class {
580
580
  constructor(e, t, i) {
581
- if (this._$cssResult$ = !0, i !== He) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
581
+ if (this._$cssResult$ = !0, i !== Be) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
582
582
  this.cssText = e, this.t = t;
583
583
  }
584
584
  get styleSheet() {
585
585
  let e = this.o;
586
586
  const t = this.t;
587
- if (De && e === void 0) {
587
+ if (He && e === void 0) {
588
588
  const i = t !== void 0 && t.length === 1;
589
- i && (e = Ge.get(t)), e === void 0 && ((this.o = e = new CSSStyleSheet()).replaceSync(this.cssText), i && Ge.set(t, e));
589
+ i && (e = Je.get(t)), e === void 0 && ((this.o = e = new CSSStyleSheet()).replaceSync(this.cssText), i && Je.set(t, e));
590
590
  }
591
591
  return e;
592
592
  }
@@ -594,33 +594,33 @@ let $t = class {
594
594
  return this.cssText;
595
595
  }
596
596
  };
597
- const Dt = (n) => new $t(typeof n == "string" ? n : n + "", void 0, He), O = (n, ...e) => {
597
+ const Bt = (n) => new kt(typeof n == "string" ? n : n + "", void 0, Be), M = (n, ...e) => {
598
598
  const t = n.length === 1 ? n[0] : e.reduce((i, s, o) => i + ((r) => {
599
599
  if (r._$cssResult$ === !0) return r.cssText;
600
600
  if (typeof r == "number") return r;
601
601
  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.");
602
602
  })(s) + n[o + 1], n[0]);
603
- return new $t(t, n, He);
604
- }, Ht = (n, e) => {
605
- if (De) n.adoptedStyleSheets = e.map((t) => t instanceof CSSStyleSheet ? t : t.styleSheet);
603
+ return new kt(t, n, Be);
604
+ }, Nt = (n, e) => {
605
+ if (He) n.adoptedStyleSheets = e.map((t) => t instanceof CSSStyleSheet ? t : t.styleSheet);
606
606
  else for (const t of e) {
607
- const i = document.createElement("style"), s = xe.litNonce;
607
+ const i = document.createElement("style"), s = ye.litNonce;
608
608
  s !== void 0 && i.setAttribute("nonce", s), i.textContent = t.cssText, n.appendChild(i);
609
609
  }
610
- }, Ze = De ? (n) => n : (n) => n instanceof CSSStyleSheet ? ((e) => {
610
+ }, Ze = He ? (n) => n : (n) => n instanceof CSSStyleSheet ? ((e) => {
611
611
  let t = "";
612
612
  for (const i of e.cssRules) t += i.cssText;
613
- return Dt(t);
613
+ return Bt(t);
614
614
  })(n) : n;
615
615
  /**
616
616
  * @license
617
617
  * Copyright 2017 Google LLC
618
618
  * SPDX-License-Identifier: BSD-3-Clause
619
619
  */
620
- const { is: Nt, defineProperty: Ft, getOwnPropertyDescriptor: Bt, getOwnPropertyNames: qt, getOwnPropertySymbols: Vt, getPrototypeOf: Wt } = Object, D = globalThis, Je = D.trustedTypes, Xt = Je ? Je.emptyScript : "", Pe = D.reactiveElementPolyfillSupport, se = (n, e) => n, $e = { toAttribute(n, e) {
620
+ const { is: Ft, defineProperty: qt, getOwnPropertyDescriptor: Vt, getOwnPropertyNames: Wt, getOwnPropertySymbols: Xt, getPrototypeOf: Yt } = Object, H = globalThis, Qe = H.trustedTypes, Kt = Qe ? Qe.emptyScript : "", _e = H.reactiveElementPolyfillSupport, ne = (n, e) => n, ke = { toAttribute(n, e) {
621
621
  switch (e) {
622
622
  case Boolean:
623
- n = n ? Xt : null;
623
+ n = n ? Kt : null;
624
624
  break;
625
625
  case Object:
626
626
  case Array:
@@ -645,44 +645,44 @@ const { is: Nt, defineProperty: Ft, getOwnPropertyDescriptor: Bt, getOwnProperty
645
645
  }
646
646
  }
647
647
  return t;
648
- } }, Ne = (n, e) => !Nt(n, e), Qe = { attribute: !0, type: String, converter: $e, reflect: !1, useDefault: !1, hasChanged: Ne };
649
- Symbol.metadata ?? (Symbol.metadata = Symbol("metadata")), D.litPropertyMetadata ?? (D.litPropertyMetadata = /* @__PURE__ */ new WeakMap());
650
- let K = class extends HTMLElement {
648
+ } }, Ne = (n, e) => !Ft(n, e), et = { attribute: !0, type: String, converter: ke, reflect: !1, useDefault: !1, hasChanged: Ne };
649
+ Symbol.metadata ?? (Symbol.metadata = Symbol("metadata")), H.litPropertyMetadata ?? (H.litPropertyMetadata = /* @__PURE__ */ new WeakMap());
650
+ let G = class extends HTMLElement {
651
651
  static addInitializer(e) {
652
652
  this._$Ei(), (this.l ?? (this.l = [])).push(e);
653
653
  }
654
654
  static get observedAttributes() {
655
655
  return this.finalize(), this._$Eh && [...this._$Eh.keys()];
656
656
  }
657
- static createProperty(e, t = Qe) {
657
+ static createProperty(e, t = et) {
658
658
  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) {
659
659
  const i = Symbol(), s = this.getPropertyDescriptor(e, i, t);
660
- s !== void 0 && Ft(this.prototype, e, s);
660
+ s !== void 0 && qt(this.prototype, e, s);
661
661
  }
662
662
  }
663
663
  static getPropertyDescriptor(e, t, i) {
664
- const { get: s, set: o } = Bt(this.prototype, e) ?? { get() {
664
+ const { get: s, set: o } = Vt(this.prototype, e) ?? { get() {
665
665
  return this[t];
666
666
  }, set(r) {
667
667
  this[t] = r;
668
668
  } };
669
669
  return { get: s, set(r) {
670
- const l = s == null ? void 0 : s.call(this);
671
- o == null || o.call(this, r), this.requestUpdate(e, l, i);
670
+ const a = s == null ? void 0 : s.call(this);
671
+ o == null || o.call(this, r), this.requestUpdate(e, a, i);
672
672
  }, configurable: !0, enumerable: !0 };
673
673
  }
674
674
  static getPropertyOptions(e) {
675
- return this.elementProperties.get(e) ?? Qe;
675
+ return this.elementProperties.get(e) ?? et;
676
676
  }
677
677
  static _$Ei() {
678
- if (this.hasOwnProperty(se("elementProperties"))) return;
679
- const e = Wt(this);
678
+ if (this.hasOwnProperty(ne("elementProperties"))) return;
679
+ const e = Yt(this);
680
680
  e.finalize(), e.l !== void 0 && (this.l = [...e.l]), this.elementProperties = new Map(e.elementProperties);
681
681
  }
682
682
  static finalize() {
683
- if (this.hasOwnProperty(se("finalized"))) return;
684
- if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(se("properties"))) {
685
- const t = this.properties, i = [...qt(t), ...Vt(t)];
683
+ if (this.hasOwnProperty(ne("finalized"))) return;
684
+ if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(ne("properties"))) {
685
+ const t = this.properties, i = [...Wt(t), ...Xt(t)];
686
686
  for (const s of i) this.createProperty(s, t[s]);
687
687
  }
688
688
  const e = this[Symbol.metadata];
@@ -731,7 +731,7 @@ let K = class extends HTMLElement {
731
731
  }
732
732
  createRenderRoot() {
733
733
  const e = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions);
734
- return Ht(e, this.constructor.elementStyles), e;
734
+ return Nt(e, this.constructor.elementStyles), e;
735
735
  }
736
736
  connectedCallback() {
737
737
  var e;
@@ -756,7 +756,7 @@ let K = class extends HTMLElement {
756
756
  var o;
757
757
  const i = this.constructor.elementProperties.get(e), s = this.constructor._$Eu(e, i);
758
758
  if (s !== void 0 && i.reflect === !0) {
759
- const r = (((o = i.converter) == null ? void 0 : o.toAttribute) !== void 0 ? i.converter : $e).toAttribute(t, i.type);
759
+ const r = (((o = i.converter) == null ? void 0 : o.toAttribute) !== void 0 ? i.converter : ke).toAttribute(t, i.type);
760
760
  this._$Em = e, r == null ? this.removeAttribute(s) : this.setAttribute(s, r), this._$Em = null;
761
761
  }
762
762
  }
@@ -764,17 +764,17 @@ let K = class extends HTMLElement {
764
764
  var o, r;
765
765
  const i = this.constructor, s = i._$Eh.get(e);
766
766
  if (s !== void 0 && this._$Em !== s) {
767
- const l = i.getPropertyOptions(s), a = typeof l.converter == "function" ? { fromAttribute: l.converter } : ((o = l.converter) == null ? void 0 : o.fromAttribute) !== void 0 ? l.converter : $e;
767
+ const a = i.getPropertyOptions(s), l = typeof a.converter == "function" ? { fromAttribute: a.converter } : ((o = a.converter) == null ? void 0 : o.fromAttribute) !== void 0 ? a.converter : ke;
768
768
  this._$Em = s;
769
- const c = a.fromAttribute(t, l.type);
770
- this[s] = c ?? ((r = this._$Ej) == null ? void 0 : r.get(s)) ?? c, this._$Em = null;
769
+ const d = l.fromAttribute(t, a.type);
770
+ this[s] = d ?? ((r = this._$Ej) == null ? void 0 : r.get(s)) ?? d, this._$Em = null;
771
771
  }
772
772
  }
773
773
  requestUpdate(e, t, i, s = !1, o) {
774
774
  var r;
775
775
  if (e !== void 0) {
776
- const l = this.constructor;
777
- if (s === !1 && (o = this[e]), i ?? (i = l.getPropertyOptions(e)), !((i.hasChanged ?? Ne)(o, t) || i.useDefault && i.reflect && o === ((r = this._$Ej) == null ? void 0 : r.get(e)) && !this.hasAttribute(l._$Eu(e, i)))) return;
776
+ const a = this.constructor;
777
+ if (s === !1 && (o = this[e]), i ?? (i = a.getPropertyOptions(e)), !((i.hasChanged ?? Ne)(o, t) || i.useDefault && i.reflect && o === ((r = this._$Ej) == null ? void 0 : r.get(e)) && !this.hasAttribute(a._$Eu(e, i)))) return;
778
778
  this.C(e, t, i);
779
779
  }
780
780
  this.isUpdatePending === !1 && (this._$ES = this._$EP());
@@ -805,8 +805,8 @@ let K = class extends HTMLElement {
805
805
  }
806
806
  const s = this.constructor.elementProperties;
807
807
  if (s.size > 0) for (const [o, r] of s) {
808
- const { wrapped: l } = r, a = this[o];
809
- l !== !0 || this._$AL.has(o) || a === void 0 || this.C(o, void 0, r, a);
808
+ const { wrapped: a } = r, l = this[o];
809
+ a !== !0 || this._$AL.has(o) || l === void 0 || this.C(o, void 0, r, l);
810
810
  }
811
811
  }
812
812
  let e = !1;
@@ -850,76 +850,76 @@ let K = class extends HTMLElement {
850
850
  firstUpdated(e) {
851
851
  }
852
852
  };
853
- K.elementStyles = [], K.shadowRootOptions = { mode: "open" }, K[se("elementProperties")] = /* @__PURE__ */ new Map(), K[se("finalized")] = /* @__PURE__ */ new Map(), Pe == null || Pe({ ReactiveElement: K }), (D.reactiveElementVersions ?? (D.reactiveElementVersions = [])).push("2.1.2");
853
+ G.elementStyles = [], G.shadowRootOptions = { mode: "open" }, G[ne("elementProperties")] = /* @__PURE__ */ new Map(), G[ne("finalized")] = /* @__PURE__ */ new Map(), _e == null || _e({ ReactiveElement: G }), (H.reactiveElementVersions ?? (H.reactiveElementVersions = [])).push("2.1.2");
854
854
  /**
855
855
  * @license
856
856
  * Copyright 2017 Google LLC
857
857
  * SPDX-License-Identifier: BSD-3-Clause
858
858
  */
859
- const ne = globalThis, et = (n) => n, ke = ne.trustedTypes, tt = ke ? ke.createPolicy("lit-html", { createHTML: (n) => n }) : void 0, kt = "$lit$", U = `lit$${Math.random().toFixed(9).slice(2)}$`, Et = "?" + U, Yt = `<${Et}>`, q = document, re = () => q.createComment(""), ae = (n) => n === null || typeof n != "object" && typeof n != "function", Fe = Array.isArray, Kt = (n) => Fe(n) || typeof (n == null ? void 0 : n[Symbol.iterator]) == "function", Ae = `[
860
- \f\r]`, ie = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, it = /-->/g, st = />/g, N = RegExp(`>|${Ae}(?:([^\\s"'>=/]+)(${Ae}*=${Ae}*(?:[^
861
- \f\r"'\`<>=]|("|')|))|$)`, "g"), nt = /'/g, ot = /"/g, Ct = /^(?:script|style|textarea|title)$/i, Tt = (n) => (e, ...t) => ({ _$litType$: n, strings: e, values: t }), d = Tt(1), Gt = Tt(2), V = Symbol.for("lit-noChange"), g = Symbol.for("lit-nothing"), rt = /* @__PURE__ */ new WeakMap(), F = q.createTreeWalker(q, 129);
862
- function _t(n, e) {
859
+ const oe = globalThis, tt = (n) => n, Ee = oe.trustedTypes, it = Ee ? Ee.createPolicy("lit-html", { createHTML: (n) => n }) : void 0, Et = "$lit$", D = `lit$${Math.random().toFixed(9).slice(2)}$`, Ct = "?" + D, Gt = `<${Ct}>`, V = document, ae = () => V.createComment(""), le = (n) => n === null || typeof n != "object" && typeof n != "function", Fe = Array.isArray, Jt = (n) => Fe(n) || typeof (n == null ? void 0 : n[Symbol.iterator]) == "function", Ie = `[
860
+ \f\r]`, se = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, st = /-->/g, nt = />/g, N = RegExp(`>|${Ie}(?:([^\\s"'>=/]+)(${Ie}*=${Ie}*(?:[^
861
+ \f\r"'\`<>=]|("|')|))|$)`, "g"), ot = /'/g, rt = /"/g, Tt = /^(?:script|style|textarea|title)$/i, St = (n) => (e, ...t) => ({ _$litType$: n, strings: e, values: t }), u = St(1), Zt = St(2), W = Symbol.for("lit-noChange"), b = Symbol.for("lit-nothing"), at = /* @__PURE__ */ new WeakMap(), F = V.createTreeWalker(V, 129);
862
+ function Pt(n, e) {
863
863
  if (!Fe(n) || !n.hasOwnProperty("raw")) throw Error("invalid template strings array");
864
- return tt !== void 0 ? tt.createHTML(e) : e;
864
+ return it !== void 0 ? it.createHTML(e) : e;
865
865
  }
866
- const Zt = (n, e) => {
866
+ const Qt = (n, e) => {
867
867
  const t = n.length - 1, i = [];
868
- let s, o = e === 2 ? "<svg>" : e === 3 ? "<math>" : "", r = ie;
869
- for (let l = 0; l < t; l++) {
870
- const a = n[l];
871
- let c, h, p = -1, u = 0;
872
- for (; u < a.length && (r.lastIndex = u, h = r.exec(a), h !== null); ) u = r.lastIndex, r === ie ? h[1] === "!--" ? r = it : h[1] !== void 0 ? r = st : h[2] !== void 0 ? (Ct.test(h[2]) && (s = RegExp("</" + h[2], "g")), r = N) : h[3] !== void 0 && (r = N) : r === N ? h[0] === ">" ? (r = s ?? ie, p = -1) : h[1] === void 0 ? p = -2 : (p = r.lastIndex - h[2].length, c = h[1], r = h[3] === void 0 ? N : h[3] === '"' ? ot : nt) : r === ot || r === nt ? r = N : r === it || r === st ? r = ie : (r = N, s = void 0);
873
- const f = r === N && n[l + 1].startsWith("/>") ? " " : "";
874
- o += r === ie ? a + Yt : p >= 0 ? (i.push(c), a.slice(0, p) + kt + a.slice(p) + U + f) : a + U + (p === -2 ? l : f);
875
- }
876
- return [_t(n, o + (n[t] || "<?>") + (e === 2 ? "</svg>" : e === 3 ? "</math>" : "")), i];
868
+ let s, o = e === 2 ? "<svg>" : e === 3 ? "<math>" : "", r = se;
869
+ for (let a = 0; a < t; a++) {
870
+ const l = n[a];
871
+ let d, c, h = -1, p = 0;
872
+ for (; p < l.length && (r.lastIndex = p, c = r.exec(l), c !== null); ) p = r.lastIndex, r === se ? c[1] === "!--" ? r = st : c[1] !== void 0 ? r = nt : c[2] !== void 0 ? (Tt.test(c[2]) && (s = RegExp("</" + c[2], "g")), r = N) : c[3] !== void 0 && (r = N) : r === N ? c[0] === ">" ? (r = s ?? se, h = -1) : c[1] === void 0 ? h = -2 : (h = r.lastIndex - c[2].length, d = c[1], r = c[3] === void 0 ? N : c[3] === '"' ? rt : ot) : r === rt || r === ot ? r = N : r === st || r === nt ? r = se : (r = N, s = void 0);
873
+ const m = r === N && n[a + 1].startsWith("/>") ? " " : "";
874
+ o += r === se ? l + Gt : h >= 0 ? (i.push(d), l.slice(0, h) + Et + l.slice(h) + D + m) : l + D + (h === -2 ? a : m);
875
+ }
876
+ return [Pt(n, o + (n[t] || "<?>") + (e === 2 ? "</svg>" : e === 3 ? "</math>" : "")), i];
877
877
  };
878
- class le {
878
+ class ce {
879
879
  constructor({ strings: e, _$litType$: t }, i) {
880
880
  let s;
881
881
  this.parts = [];
882
882
  let o = 0, r = 0;
883
- const l = e.length - 1, a = this.parts, [c, h] = Zt(e, t);
884
- if (this.el = le.createElement(c, i), F.currentNode = this.el.content, t === 2 || t === 3) {
885
- const p = this.el.content.firstChild;
886
- p.replaceWith(...p.childNodes);
883
+ const a = e.length - 1, l = this.parts, [d, c] = Qt(e, t);
884
+ if (this.el = ce.createElement(d, i), F.currentNode = this.el.content, t === 2 || t === 3) {
885
+ const h = this.el.content.firstChild;
886
+ h.replaceWith(...h.childNodes);
887
887
  }
888
- for (; (s = F.nextNode()) !== null && a.length < l; ) {
888
+ for (; (s = F.nextNode()) !== null && l.length < a; ) {
889
889
  if (s.nodeType === 1) {
890
- if (s.hasAttributes()) for (const p of s.getAttributeNames()) if (p.endsWith(kt)) {
891
- const u = h[r++], f = s.getAttribute(p).split(U), m = /([.?@])?(.*)/.exec(u);
892
- a.push({ type: 1, index: o, name: m[2], strings: f, ctor: m[1] === "." ? Qt : m[1] === "?" ? ei : m[1] === "@" ? ti : Te }), s.removeAttribute(p);
893
- } else p.startsWith(U) && (a.push({ type: 6, index: o }), s.removeAttribute(p));
894
- if (Ct.test(s.tagName)) {
895
- const p = s.textContent.split(U), u = p.length - 1;
896
- if (u > 0) {
897
- s.textContent = ke ? ke.emptyScript : "";
898
- for (let f = 0; f < u; f++) s.append(p[f], re()), F.nextNode(), a.push({ type: 2, index: ++o });
899
- s.append(p[u], re());
890
+ if (s.hasAttributes()) for (const h of s.getAttributeNames()) if (h.endsWith(Et)) {
891
+ const p = c[r++], m = s.getAttribute(h).split(D), g = /([.?@])?(.*)/.exec(p);
892
+ l.push({ type: 1, index: o, name: g[2], strings: m, ctor: g[1] === "." ? ti : g[1] === "?" ? ii : g[1] === "@" ? si : Se }), s.removeAttribute(h);
893
+ } else h.startsWith(D) && (l.push({ type: 6, index: o }), s.removeAttribute(h));
894
+ if (Tt.test(s.tagName)) {
895
+ const h = s.textContent.split(D), p = h.length - 1;
896
+ if (p > 0) {
897
+ s.textContent = Ee ? Ee.emptyScript : "";
898
+ for (let m = 0; m < p; m++) s.append(h[m], ae()), F.nextNode(), l.push({ type: 2, index: ++o });
899
+ s.append(h[p], ae());
900
900
  }
901
901
  }
902
- } else if (s.nodeType === 8) if (s.data === Et) a.push({ type: 2, index: o });
902
+ } else if (s.nodeType === 8) if (s.data === Ct) l.push({ type: 2, index: o });
903
903
  else {
904
- let p = -1;
905
- for (; (p = s.data.indexOf(U, p + 1)) !== -1; ) a.push({ type: 7, index: o }), p += U.length - 1;
904
+ let h = -1;
905
+ for (; (h = s.data.indexOf(D, h + 1)) !== -1; ) l.push({ type: 7, index: o }), h += D.length - 1;
906
906
  }
907
907
  o++;
908
908
  }
909
909
  }
910
910
  static createElement(e, t) {
911
- const i = q.createElement("template");
911
+ const i = V.createElement("template");
912
912
  return i.innerHTML = e, i;
913
913
  }
914
914
  }
915
- function G(n, e, t = n, i) {
916
- var r, l;
917
- if (e === V) return e;
915
+ function J(n, e, t = n, i) {
916
+ var r, a;
917
+ if (e === W) return e;
918
918
  let s = i !== void 0 ? (r = t._$Co) == null ? void 0 : r[i] : t._$Cl;
919
- const o = ae(e) ? void 0 : e._$litDirective$;
920
- return (s == null ? void 0 : s.constructor) !== o && ((l = s == null ? void 0 : s._$AO) == null || l.call(s, !1), o === void 0 ? s = void 0 : (s = new o(n), s._$AT(n, t, i)), i !== void 0 ? (t._$Co ?? (t._$Co = []))[i] = s : t._$Cl = s), s !== void 0 && (e = G(n, s._$AS(n, e.values), s, i)), e;
919
+ const o = le(e) ? void 0 : e._$litDirective$;
920
+ return (s == null ? void 0 : s.constructor) !== o && ((a = s == null ? void 0 : s._$AO) == null || a.call(s, !1), o === void 0 ? s = void 0 : (s = new o(n), s._$AT(n, t, i)), i !== void 0 ? (t._$Co ?? (t._$Co = []))[i] = s : t._$Cl = s), s !== void 0 && (e = J(n, s._$AS(n, e.values), s, i)), e;
921
921
  }
922
- class Jt {
922
+ class ei {
923
923
  constructor(e, t) {
924
924
  this._$AV = [], this._$AN = void 0, this._$AD = e, this._$AM = t;
925
925
  }
@@ -930,30 +930,30 @@ class Jt {
930
930
  return this._$AM._$AU;
931
931
  }
932
932
  u(e) {
933
- const { el: { content: t }, parts: i } = this._$AD, s = ((e == null ? void 0 : e.creationScope) ?? q).importNode(t, !0);
933
+ const { el: { content: t }, parts: i } = this._$AD, s = ((e == null ? void 0 : e.creationScope) ?? V).importNode(t, !0);
934
934
  F.currentNode = s;
935
- let o = F.nextNode(), r = 0, l = 0, a = i[0];
936
- for (; a !== void 0; ) {
937
- if (r === a.index) {
938
- let c;
939
- a.type === 2 ? c = new fe(o, o.nextSibling, this, e) : a.type === 1 ? c = new a.ctor(o, a.name, a.strings, this, e) : a.type === 6 && (c = new ii(o, this, e)), this._$AV.push(c), a = i[++l];
935
+ let o = F.nextNode(), r = 0, a = 0, l = i[0];
936
+ for (; l !== void 0; ) {
937
+ if (r === l.index) {
938
+ let d;
939
+ l.type === 2 ? d = new me(o, o.nextSibling, this, e) : l.type === 1 ? d = new l.ctor(o, l.name, l.strings, this, e) : l.type === 6 && (d = new ni(o, this, e)), this._$AV.push(d), l = i[++a];
940
940
  }
941
- r !== (a == null ? void 0 : a.index) && (o = F.nextNode(), r++);
941
+ r !== (l == null ? void 0 : l.index) && (o = F.nextNode(), r++);
942
942
  }
943
- return F.currentNode = q, s;
943
+ return F.currentNode = V, s;
944
944
  }
945
945
  p(e) {
946
946
  let t = 0;
947
947
  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++;
948
948
  }
949
949
  }
950
- class fe {
950
+ class me {
951
951
  get _$AU() {
952
952
  var e;
953
953
  return ((e = this._$AM) == null ? void 0 : e._$AU) ?? this._$Cv;
954
954
  }
955
955
  constructor(e, t, i, s) {
956
- this.type = 2, this._$AH = g, this._$AN = void 0, this._$AA = e, this._$AB = t, this._$AM = i, this.options = s, this._$Cv = (s == null ? void 0 : s.isConnected) ?? !0;
956
+ this.type = 2, this._$AH = b, this._$AN = void 0, this._$AA = e, this._$AB = t, this._$AM = i, this.options = s, this._$Cv = (s == null ? void 0 : s.isConnected) ?? !0;
957
957
  }
958
958
  get parentNode() {
959
959
  let e = this._$AA.parentNode;
@@ -967,7 +967,7 @@ class fe {
967
967
  return this._$AB;
968
968
  }
969
969
  _$AI(e, t = this) {
970
- e = G(this, e, t), ae(e) ? e === g || e == null || e === "" ? (this._$AH !== g && this._$AR(), this._$AH = g) : e !== this._$AH && e !== V && this._(e) : e._$litType$ !== void 0 ? this.$(e) : e.nodeType !== void 0 ? this.T(e) : Kt(e) ? this.k(e) : this._(e);
970
+ e = J(this, e, t), le(e) ? e === b || e == null || e === "" ? (this._$AH !== b && this._$AR(), this._$AH = b) : e !== this._$AH && e !== W && this._(e) : e._$litType$ !== void 0 ? this.$(e) : e.nodeType !== void 0 ? this.T(e) : Jt(e) ? this.k(e) : this._(e);
971
971
  }
972
972
  O(e) {
973
973
  return this._$AA.parentNode.insertBefore(e, this._$AB);
@@ -976,33 +976,33 @@ class fe {
976
976
  this._$AH !== e && (this._$AR(), this._$AH = this.O(e));
977
977
  }
978
978
  _(e) {
979
- this._$AH !== g && ae(this._$AH) ? this._$AA.nextSibling.data = e : this.T(q.createTextNode(e)), this._$AH = e;
979
+ this._$AH !== b && le(this._$AH) ? this._$AA.nextSibling.data = e : this.T(V.createTextNode(e)), this._$AH = e;
980
980
  }
981
981
  $(e) {
982
982
  var o;
983
- const { values: t, _$litType$: i } = e, s = typeof i == "number" ? this._$AC(e) : (i.el === void 0 && (i.el = le.createElement(_t(i.h, i.h[0]), this.options)), i);
983
+ const { values: t, _$litType$: i } = e, s = typeof i == "number" ? this._$AC(e) : (i.el === void 0 && (i.el = ce.createElement(Pt(i.h, i.h[0]), this.options)), i);
984
984
  if (((o = this._$AH) == null ? void 0 : o._$AD) === s) this._$AH.p(t);
985
985
  else {
986
- const r = new Jt(s, this), l = r.u(this.options);
987
- r.p(t), this.T(l), this._$AH = r;
986
+ const r = new ei(s, this), a = r.u(this.options);
987
+ r.p(t), this.T(a), this._$AH = r;
988
988
  }
989
989
  }
990
990
  _$AC(e) {
991
- let t = rt.get(e.strings);
992
- return t === void 0 && rt.set(e.strings, t = new le(e)), t;
991
+ let t = at.get(e.strings);
992
+ return t === void 0 && at.set(e.strings, t = new ce(e)), t;
993
993
  }
994
994
  k(e) {
995
995
  Fe(this._$AH) || (this._$AH = [], this._$AR());
996
996
  const t = this._$AH;
997
997
  let i, s = 0;
998
- for (const o of e) s === t.length ? t.push(i = new fe(this.O(re()), this.O(re()), this, this.options)) : i = t[s], i._$AI(o), s++;
998
+ for (const o of e) s === t.length ? t.push(i = new me(this.O(ae()), this.O(ae()), this, this.options)) : i = t[s], i._$AI(o), s++;
999
999
  s < t.length && (this._$AR(i && i._$AB.nextSibling, s), t.length = s);
1000
1000
  }
1001
1001
  _$AR(e = this._$AA.nextSibling, t) {
1002
1002
  var i;
1003
1003
  for ((i = this._$AP) == null ? void 0 : i.call(this, !1, !0, t); e !== this._$AB; ) {
1004
- const s = et(e).nextSibling;
1005
- et(e).remove(), e = s;
1004
+ const s = tt(e).nextSibling;
1005
+ tt(e).remove(), e = s;
1006
1006
  }
1007
1007
  }
1008
1008
  setConnected(e) {
@@ -1010,7 +1010,7 @@ class fe {
1010
1010
  this._$AM === void 0 && (this._$Cv = e, (t = this._$AP) == null || t.call(this, e));
1011
1011
  }
1012
1012
  }
1013
- class Te {
1013
+ class Se {
1014
1014
  get tagName() {
1015
1015
  return this.element.tagName;
1016
1016
  }
@@ -1018,46 +1018,46 @@ class Te {
1018
1018
  return this._$AM._$AU;
1019
1019
  }
1020
1020
  constructor(e, t, i, s, o) {
1021
- this.type = 1, this._$AH = g, this._$AN = void 0, this.element = e, this.name = t, this._$AM = s, this.options = o, i.length > 2 || i[0] !== "" || i[1] !== "" ? (this._$AH = Array(i.length - 1).fill(new String()), this.strings = i) : this._$AH = g;
1021
+ this.type = 1, this._$AH = b, this._$AN = void 0, this.element = e, this.name = t, this._$AM = s, this.options = o, i.length > 2 || i[0] !== "" || i[1] !== "" ? (this._$AH = Array(i.length - 1).fill(new String()), this.strings = i) : this._$AH = b;
1022
1022
  }
1023
1023
  _$AI(e, t = this, i, s) {
1024
1024
  const o = this.strings;
1025
1025
  let r = !1;
1026
- if (o === void 0) e = G(this, e, t, 0), r = !ae(e) || e !== this._$AH && e !== V, r && (this._$AH = e);
1026
+ if (o === void 0) e = J(this, e, t, 0), r = !le(e) || e !== this._$AH && e !== W, r && (this._$AH = e);
1027
1027
  else {
1028
- const l = e;
1029
- let a, c;
1030
- for (e = o[0], a = 0; a < o.length - 1; a++) c = G(this, l[i + a], t, a), c === V && (c = this._$AH[a]), r || (r = !ae(c) || c !== this._$AH[a]), c === g ? e = g : e !== g && (e += (c ?? "") + o[a + 1]), this._$AH[a] = c;
1028
+ const a = e;
1029
+ let l, d;
1030
+ for (e = o[0], l = 0; l < o.length - 1; l++) d = J(this, a[i + l], t, l), d === W && (d = this._$AH[l]), r || (r = !le(d) || d !== this._$AH[l]), d === b ? e = b : e !== b && (e += (d ?? "") + o[l + 1]), this._$AH[l] = d;
1031
1031
  }
1032
1032
  r && !s && this.j(e);
1033
1033
  }
1034
1034
  j(e) {
1035
- e === g ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, e ?? "");
1035
+ e === b ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, e ?? "");
1036
1036
  }
1037
1037
  }
1038
- class Qt extends Te {
1038
+ class ti extends Se {
1039
1039
  constructor() {
1040
1040
  super(...arguments), this.type = 3;
1041
1041
  }
1042
1042
  j(e) {
1043
- this.element[this.name] = e === g ? void 0 : e;
1043
+ this.element[this.name] = e === b ? void 0 : e;
1044
1044
  }
1045
1045
  }
1046
- class ei extends Te {
1046
+ class ii extends Se {
1047
1047
  constructor() {
1048
1048
  super(...arguments), this.type = 4;
1049
1049
  }
1050
1050
  j(e) {
1051
- this.element.toggleAttribute(this.name, !!e && e !== g);
1051
+ this.element.toggleAttribute(this.name, !!e && e !== b);
1052
1052
  }
1053
1053
  }
1054
- class ti extends Te {
1054
+ class si extends Se {
1055
1055
  constructor(e, t, i, s, o) {
1056
1056
  super(e, t, i, s, o), this.type = 5;
1057
1057
  }
1058
1058
  _$AI(e, t = this) {
1059
- if ((e = G(this, e, t, 0) ?? g) === V) return;
1060
- const i = this._$AH, s = e === g && i !== g || e.capture !== i.capture || e.once !== i.once || e.passive !== i.passive, o = e !== g && (i === g || s);
1059
+ if ((e = J(this, e, t, 0) ?? b) === W) return;
1060
+ const i = this._$AH, s = e === b && i !== b || e.capture !== i.capture || e.once !== i.once || e.passive !== i.passive, o = e !== b && (i === b || s);
1061
1061
  s && this.element.removeEventListener(this.name, this, i), o && this.element.addEventListener(this.name, this, e), this._$AH = e;
1062
1062
  }
1063
1063
  handleEvent(e) {
@@ -1065,7 +1065,7 @@ class ti extends Te {
1065
1065
  typeof this._$AH == "function" ? this._$AH.call(((t = this.options) == null ? void 0 : t.host) ?? this.element, e) : this._$AH.handleEvent(e);
1066
1066
  }
1067
1067
  }
1068
- class ii {
1068
+ class ni {
1069
1069
  constructor(e, t, i) {
1070
1070
  this.element = e, this.type = 6, this._$AN = void 0, this._$AM = t, this.options = i;
1071
1071
  }
@@ -1073,17 +1073,17 @@ class ii {
1073
1073
  return this._$AM._$AU;
1074
1074
  }
1075
1075
  _$AI(e) {
1076
- G(this, e);
1076
+ J(this, e);
1077
1077
  }
1078
1078
  }
1079
- const Ie = ne.litHtmlPolyfillSupport;
1080
- Ie == null || Ie(le, fe), (ne.litHtmlVersions ?? (ne.litHtmlVersions = [])).push("3.3.2");
1081
- const si = (n, e, t) => {
1079
+ const Me = oe.litHtmlPolyfillSupport;
1080
+ Me == null || Me(ce, me), (oe.litHtmlVersions ?? (oe.litHtmlVersions = [])).push("3.3.2");
1081
+ const oi = (n, e, t) => {
1082
1082
  const i = (t == null ? void 0 : t.renderBefore) ?? e;
1083
1083
  let s = i._$litPart$;
1084
1084
  if (s === void 0) {
1085
1085
  const o = (t == null ? void 0 : t.renderBefore) ?? null;
1086
- i._$litPart$ = s = new fe(e.insertBefore(re(), o), o, void 0, t ?? {});
1086
+ i._$litPart$ = s = new me(e.insertBefore(ae(), o), o, void 0, t ?? {});
1087
1087
  }
1088
1088
  return s._$AI(n), s;
1089
1089
  };
@@ -1092,8 +1092,8 @@ const si = (n, e, t) => {
1092
1092
  * Copyright 2017 Google LLC
1093
1093
  * SPDX-License-Identifier: BSD-3-Clause
1094
1094
  */
1095
- const B = globalThis;
1096
- let P = class extends K {
1095
+ const q = globalThis;
1096
+ let P = class extends G {
1097
1097
  constructor() {
1098
1098
  super(...arguments), this.renderOptions = { host: this }, this._$Do = void 0;
1099
1099
  }
@@ -1104,7 +1104,7 @@ let P = class extends K {
1104
1104
  }
1105
1105
  update(e) {
1106
1106
  const t = this.render();
1107
- this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(e), this._$Do = si(t, this.renderRoot, this.renderOptions);
1107
+ this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(e), this._$Do = oi(t, this.renderRoot, this.renderOptions);
1108
1108
  }
1109
1109
  connectedCallback() {
1110
1110
  var e;
@@ -1115,14 +1115,14 @@ let P = class extends K {
1115
1115
  super.disconnectedCallback(), (e = this._$Do) == null || e.setConnected(!1);
1116
1116
  }
1117
1117
  render() {
1118
- return V;
1118
+ return W;
1119
1119
  }
1120
1120
  };
1121
- var xt;
1122
- P._$litElement$ = !0, P.finalized = !0, (xt = B.litElementHydrateSupport) == null || xt.call(B, { LitElement: P });
1123
- const Me = B.litElementPolyfillSupport;
1124
- Me == null || Me({ LitElement: P });
1125
- (B.litElementVersions ?? (B.litElementVersions = [])).push("4.2.2");
1121
+ var yt;
1122
+ P._$litElement$ = !0, P.finalized = !0, (yt = q.litElementHydrateSupport) == null || yt.call(q, { LitElement: P });
1123
+ const Oe = q.litElementPolyfillSupport;
1124
+ Oe == null || Oe({ LitElement: P });
1125
+ (q.litElementVersions ?? (q.litElementVersions = [])).push("4.2.2");
1126
1126
  /**
1127
1127
  * @license
1128
1128
  * Copyright 2017 Google LLC
@@ -1138,29 +1138,29 @@ const L = (n) => (e, t) => {
1138
1138
  * Copyright 2017 Google LLC
1139
1139
  * SPDX-License-Identifier: BSD-3-Clause
1140
1140
  */
1141
- const ni = { attribute: !0, type: String, converter: $e, reflect: !1, hasChanged: Ne }, oi = (n = ni, e, t) => {
1141
+ const ri = { attribute: !0, type: String, converter: ke, reflect: !1, hasChanged: Ne }, ai = (n = ri, e, t) => {
1142
1142
  const { kind: i, metadata: s } = t;
1143
1143
  let o = globalThis.litPropertyMetadata.get(s);
1144
1144
  if (o === void 0 && globalThis.litPropertyMetadata.set(s, o = /* @__PURE__ */ new Map()), i === "setter" && ((n = Object.create(n)).wrapped = !0), o.set(t.name, n), i === "accessor") {
1145
1145
  const { name: r } = t;
1146
- return { set(l) {
1147
- const a = e.get.call(this);
1148
- e.set.call(this, l), this.requestUpdate(r, a, n, !0, l);
1149
- }, init(l) {
1150
- return l !== void 0 && this.C(r, void 0, n, l), l;
1146
+ return { set(a) {
1147
+ const l = e.get.call(this);
1148
+ e.set.call(this, a), this.requestUpdate(r, l, n, !0, a);
1149
+ }, init(a) {
1150
+ return a !== void 0 && this.C(r, void 0, n, a), a;
1151
1151
  } };
1152
1152
  }
1153
1153
  if (i === "setter") {
1154
1154
  const { name: r } = t;
1155
- return function(l) {
1156
- const a = this[r];
1157
- e.call(this, l), this.requestUpdate(r, a, n, !0, l);
1155
+ return function(a) {
1156
+ const l = this[r];
1157
+ e.call(this, a), this.requestUpdate(r, l, n, !0, a);
1158
1158
  };
1159
1159
  }
1160
1160
  throw Error("Unsupported decorator location: " + i);
1161
1161
  };
1162
- function v(n) {
1163
- return (e, t) => typeof t == "object" ? oi(n, e, t) : ((i, s, o) => {
1162
+ function x(n) {
1163
+ return (e, t) => typeof t == "object" ? ai(n, e, t) : ((i, s, o) => {
1164
1164
  const r = s.hasOwnProperty(o);
1165
1165
  return s.constructor.createProperty(o, i), r ? Object.getOwnPropertyDescriptor(s, o) : void 0;
1166
1166
  })(n, e, t);
@@ -1170,16 +1170,16 @@ function v(n) {
1170
1170
  * Copyright 2017 Google LLC
1171
1171
  * SPDX-License-Identifier: BSD-3-Clause
1172
1172
  */
1173
- function w(n) {
1174
- return v({ ...n, state: !0, attribute: !1 });
1173
+ function $(n) {
1174
+ return x({ ...n, state: !0, attribute: !1 });
1175
1175
  }
1176
- const J = "pulse-client";
1177
- var ri = Object.defineProperty, ai = Object.getOwnPropertyDescriptor, Q = (n, e, t, i) => {
1178
- for (var s = i > 1 ? void 0 : i ? ai(e, t) : e, o = n.length - 1, r; o >= 0; o--)
1176
+ const Q = "pulse-client";
1177
+ var li = Object.defineProperty, ci = Object.getOwnPropertyDescriptor, ee = (n, e, t, i) => {
1178
+ for (var s = i > 1 ? void 0 : i ? ci(e, t) : e, o = n.length - 1, r; o >= 0; o--)
1179
1179
  (r = n[o]) && (s = (i ? r(e, t, s) : r(s)) || s);
1180
- return i && s && ri(e, t, s), s;
1180
+ return i && s && li(e, t, s), s;
1181
1181
  };
1182
- let W = class extends P {
1182
+ let X = class extends P {
1183
1183
  constructor() {
1184
1184
  super(...arguments), this.apiKey = "", this.token = "", this.room = "";
1185
1185
  }
@@ -1191,38 +1191,38 @@ let W = class extends P {
1191
1191
  room: this.room,
1192
1192
  endpoint: this.endpoint
1193
1193
  };
1194
- this.client = new wt(n), this.client.connect();
1194
+ this.client = new $t(n), this.client.connect();
1195
1195
  }
1196
1196
  disconnectedCallback() {
1197
1197
  var n;
1198
1198
  super.disconnectedCallback(), (n = this.client) == null || n.disconnect();
1199
1199
  }
1200
1200
  render() {
1201
- return d`<slot></slot>`;
1201
+ return u`<slot></slot>`;
1202
1202
  }
1203
1203
  };
1204
- Q([
1205
- v({ attribute: "api-key" })
1206
- ], W.prototype, "apiKey", 2);
1207
- Q([
1208
- v()
1209
- ], W.prototype, "token", 2);
1210
- Q([
1211
- v()
1212
- ], W.prototype, "room", 2);
1213
- Q([
1214
- v()
1215
- ], W.prototype, "endpoint", 2);
1216
- Q([
1217
- Ot({ context: J })
1218
- ], W.prototype, "client", 2);
1219
- W = Q([
1204
+ ee([
1205
+ x({ attribute: "api-key" })
1206
+ ], X.prototype, "apiKey", 2);
1207
+ ee([
1208
+ x()
1209
+ ], X.prototype, "token", 2);
1210
+ ee([
1211
+ x()
1212
+ ], X.prototype, "room", 2);
1213
+ ee([
1214
+ x()
1215
+ ], X.prototype, "endpoint", 2);
1216
+ ee([
1217
+ Lt({ context: Q })
1218
+ ], X.prototype, "client", 2);
1219
+ X = ee([
1220
1220
  L("pulse-provider")
1221
- ], W);
1222
- var li = Object.defineProperty, ci = Object.getOwnPropertyDescriptor, _e = (n, e, t, i) => {
1223
- for (var s = i > 1 ? void 0 : i ? ci(e, t) : e, o = n.length - 1, r; o >= 0; o--)
1221
+ ], X);
1222
+ var di = Object.defineProperty, hi = Object.getOwnPropertyDescriptor, Pe = (n, e, t, i) => {
1223
+ for (var s = i > 1 ? void 0 : i ? hi(e, t) : e, o = n.length - 1, r; o >= 0; o--)
1224
1224
  (r = n[o]) && (s = (i ? r(e, t, s) : r(s)) || s);
1225
- return i && s && li(e, t, s), s;
1225
+ return i && s && di(e, t, s), s;
1226
1226
  };
1227
1227
  let Z = class extends P {
1228
1228
  constructor() {
@@ -1249,16 +1249,16 @@ let Z = class extends P {
1249
1249
  }
1250
1250
  render() {
1251
1251
  const n = this.users.slice(0, this.maxVisible), e = this.users.length - this.maxVisible;
1252
- return d`
1252
+ return u`
1253
1253
  <div class="avatars">
1254
- ${e > 0 ? d`<div class="overflow">+${e}</div>` : null}
1254
+ ${e > 0 ? u`<div class="overflow">+${e}</div>` : null}
1255
1255
  ${n.map(
1256
- (t) => d`
1256
+ (t) => u`
1257
1257
  <div
1258
1258
  class="avatar"
1259
1259
  style="background:${t.user.color}"
1260
1260
  >
1261
- ${t.user.avatar ? d`<img src="${t.user.avatar}" alt="${t.user.name}" />` : this.getInitials(t.user.name)}
1261
+ ${t.user.avatar ? u`<img src="${t.user.avatar}" alt="${t.user.name}" />` : this.getInitials(t.user.name)}
1262
1262
  <span class="status-ring ${t.status}"></span>
1263
1263
  <span class="tooltip">${t.user.name}</span>
1264
1264
  </div>
@@ -1268,7 +1268,7 @@ let Z = class extends P {
1268
1268
  `;
1269
1269
  }
1270
1270
  };
1271
- Z.styles = O`
1271
+ Z.styles = M`
1272
1272
  :host {
1273
1273
  display: inline-flex;
1274
1274
  align-items: center;
@@ -1372,25 +1372,25 @@ Z.styles = O`
1372
1372
  opacity: 1;
1373
1373
  }
1374
1374
  `;
1375
- _e([
1376
- ue({ context: J, subscribe: !0 }),
1377
- v({ attribute: !1 })
1375
+ Pe([
1376
+ fe({ context: Q, subscribe: !0 }),
1377
+ x({ attribute: !1 })
1378
1378
  ], Z.prototype, "client", 2);
1379
- _e([
1380
- v({ type: Number, attribute: "max-visible" })
1379
+ Pe([
1380
+ x({ type: Number, attribute: "max-visible" })
1381
1381
  ], Z.prototype, "maxVisible", 2);
1382
- _e([
1383
- w()
1382
+ Pe([
1383
+ $()
1384
1384
  ], Z.prototype, "users", 2);
1385
- Z = _e([
1385
+ Z = Pe([
1386
1386
  L("pulse-presence")
1387
1387
  ], Z);
1388
- var di = Object.defineProperty, hi = Object.getOwnPropertyDescriptor, Be = (n, e, t, i) => {
1389
- for (var s = i > 1 ? void 0 : i ? hi(e, t) : e, o = n.length - 1, r; o >= 0; o--)
1388
+ var pi = Object.defineProperty, ui = Object.getOwnPropertyDescriptor, qe = (n, e, t, i) => {
1389
+ for (var s = i > 1 ? void 0 : i ? ui(e, t) : e, o = n.length - 1, r; o >= 0; o--)
1390
1390
  (r = n[o]) && (s = (i ? r(e, t, s) : r(s)) || s);
1391
- return i && s && di(e, t, s), s;
1391
+ return i && s && pi(e, t, s), s;
1392
1392
  };
1393
- let ce = class extends P {
1393
+ let de = class extends P {
1394
1394
  constructor() {
1395
1395
  super(...arguments), this.cursors = /* @__PURE__ */ new Map(), this.unsubs = [], this.handleLocalCursor = (n) => {
1396
1396
  var e;
@@ -1444,9 +1444,9 @@ let ce = class extends P {
1444
1444
  }
1445
1445
  render() {
1446
1446
  const n = [...this.cursors.values()];
1447
- return d`
1447
+ return u`
1448
1448
  ${n.map(
1449
- (e) => d`
1449
+ (e) => u`
1450
1450
  <div
1451
1451
  class="cursor"
1452
1452
  style="transform:translate(${e.position.x}px,${e.position.y}px)"
@@ -1467,7 +1467,7 @@ let ce = class extends P {
1467
1467
  `;
1468
1468
  }
1469
1469
  };
1470
- ce.styles = O`
1470
+ de.styles = M`
1471
1471
  :host {
1472
1472
  position: fixed;
1473
1473
  top: 0;
@@ -1504,22 +1504,22 @@ ce.styles = O`
1504
1504
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
1505
1505
  }
1506
1506
  `;
1507
- Be([
1508
- ue({ context: J, subscribe: !0 }),
1509
- v({ attribute: !1 })
1510
- ], ce.prototype, "client", 2);
1511
- Be([
1512
- w()
1513
- ], ce.prototype, "cursors", 2);
1514
- ce = Be([
1507
+ qe([
1508
+ fe({ context: Q, subscribe: !0 }),
1509
+ x({ attribute: !1 })
1510
+ ], de.prototype, "client", 2);
1511
+ qe([
1512
+ $()
1513
+ ], de.prototype, "cursors", 2);
1514
+ de = qe([
1515
1515
  L("pulse-cursors")
1516
- ], ce);
1517
- var pi = Object.defineProperty, ui = Object.getOwnPropertyDescriptor, me = (n, e, t, i) => {
1518
- for (var s = i > 1 ? void 0 : i ? ui(e, t) : e, o = n.length - 1, r; o >= 0; o--)
1516
+ ], de);
1517
+ var fi = Object.defineProperty, mi = Object.getOwnPropertyDescriptor, ge = (n, e, t, i) => {
1518
+ for (var s = i > 1 ? void 0 : i ? mi(e, t) : e, o = n.length - 1, r; o >= 0; o--)
1519
1519
  (r = n[o]) && (s = (i ? r(e, t, s) : r(s)) || s);
1520
- return i && s && pi(e, t, s), s;
1520
+ return i && s && fi(e, t, s), s;
1521
1521
  };
1522
- let X = class extends P {
1522
+ let Y = class extends P {
1523
1523
  constructor() {
1524
1524
  super(...arguments), this.showResolved = !1, this.threads = [], this.replyingTo = null;
1525
1525
  }
@@ -1541,7 +1541,7 @@ let X = class extends P {
1541
1541
  }
1542
1542
  parseMentions(n) {
1543
1543
  return n.split(/(@\w+)/g).map(
1544
- (t) => t.startsWith("@") ? d`<span class="mention">${t}</span>` : t
1544
+ (t) => t.startsWith("@") ? u`<span class="mention">${t}</span>` : t
1545
1545
  );
1546
1546
  }
1547
1547
  getInitials(n) {
@@ -1567,9 +1567,9 @@ let X = class extends P {
1567
1567
  }
1568
1568
  render() {
1569
1569
  const n = this.showResolved ? this.threads : this.threads.filter((e) => !e.resolved);
1570
- return d`
1570
+ return u`
1571
1571
  <div class="threads">
1572
- ${n.length === 0 ? d`<div class="empty">
1572
+ ${n.length === 0 ? u`<div class="empty">
1573
1573
  <div class="empty-icon">&#128172;</div>
1574
1574
  No comments yet.<br>Start a conversation below.
1575
1575
  </div>` : n.map((e) => this.renderThread(e))}
@@ -1583,12 +1583,12 @@ let X = class extends P {
1583
1583
  `;
1584
1584
  }
1585
1585
  renderThread(n) {
1586
- return d`
1586
+ return u`
1587
1587
  <div class="thread ${n.resolved ? "resolved" : ""}">
1588
1588
  ${n.comments.map((e, t) => {
1589
1589
  const i = this.getUserForComment(e.userId);
1590
- return d`
1591
- ${t > 0 ? d`<div class="divider"></div>` : g}
1590
+ return u`
1591
+ ${t > 0 ? u`<div class="divider"></div>` : b}
1592
1592
  <div class="comment">
1593
1593
  <div class="comment-header">
1594
1594
  <div
@@ -1620,12 +1620,12 @@ let X = class extends P {
1620
1620
  ${n.resolved ? "Reopen" : "Resolve"}
1621
1621
  </button>
1622
1622
  </div>
1623
- ${this.replyingTo === n.id ? d`
1623
+ ${this.replyingTo === n.id ? u`
1624
1624
  <form class="reply-form" @submit=${(e) => this.handleReply(n.id, e)}>
1625
1625
  <input type="text" placeholder="Write a reply..." />
1626
1626
  <button type="submit">Send</button>
1627
1627
  </form>
1628
- ` : g}
1628
+ ` : b}
1629
1629
  </div>
1630
1630
  `;
1631
1631
  }
@@ -1637,7 +1637,7 @@ let X = class extends P {
1637
1637
  return o < 24 ? `${o}h ago` : e.toLocaleDateString();
1638
1638
  }
1639
1639
  };
1640
- X.styles = O`
1640
+ Y.styles = M`
1641
1641
  :host {
1642
1642
  display: block;
1643
1643
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
@@ -1849,41 +1849,41 @@ X.styles = O`
1849
1849
  opacity: 0.4;
1850
1850
  }
1851
1851
  `;
1852
- me([
1853
- ue({ context: J, subscribe: !0 }),
1854
- v({ attribute: !1 })
1855
- ], X.prototype, "client", 2);
1856
- me([
1857
- v({ type: Boolean, attribute: "show-resolved" })
1858
- ], X.prototype, "showResolved", 2);
1859
- me([
1860
- w()
1861
- ], X.prototype, "threads", 2);
1862
- me([
1863
- w()
1864
- ], X.prototype, "replyingTo", 2);
1865
- X = me([
1852
+ ge([
1853
+ fe({ context: Q, subscribe: !0 }),
1854
+ x({ attribute: !1 })
1855
+ ], Y.prototype, "client", 2);
1856
+ ge([
1857
+ x({ type: Boolean, attribute: "show-resolved" })
1858
+ ], Y.prototype, "showResolved", 2);
1859
+ ge([
1860
+ $()
1861
+ ], Y.prototype, "threads", 2);
1862
+ ge([
1863
+ $()
1864
+ ], Y.prototype, "replyingTo", 2);
1865
+ Y = ge([
1866
1866
  L("pulse-comments")
1867
- ], X);
1868
- var fi = Object.defineProperty, mi = Object.getOwnPropertyDescriptor, qe = (n, e, t, i) => {
1869
- for (var s = i > 1 ? void 0 : i ? mi(e, t) : e, o = n.length - 1, r; o >= 0; o--)
1867
+ ], Y);
1868
+ var gi = Object.defineProperty, bi = Object.getOwnPropertyDescriptor, Ve = (n, e, t, i) => {
1869
+ for (var s = i > 1 ? void 0 : i ? bi(e, t) : e, o = n.length - 1, r; o >= 0; o--)
1870
1870
  (r = n[o]) && (s = (i ? r(e, t, s) : r(s)) || s);
1871
- return i && s && fi(e, t, s), s;
1871
+ return i && s && gi(e, t, s), s;
1872
1872
  };
1873
- const gi = {
1873
+ const vi = {
1874
1874
  "comment:created": "left a comment",
1875
1875
  "comment:mention": "mentioned you",
1876
1876
  "comment:reply": "replied to your comment",
1877
1877
  "thread:resolved": "resolved a thread",
1878
1878
  "reaction:added": "reacted to your comment"
1879
- }, bi = {
1879
+ }, xi = {
1880
1880
  "comment:created": "💬",
1881
1881
  "comment:mention": "📣",
1882
1882
  "comment:reply": "↩️",
1883
1883
  "thread:resolved": "✅",
1884
1884
  "reaction:added": "🎉"
1885
1885
  };
1886
- let de = class extends P {
1886
+ let he = class extends P {
1887
1887
  constructor() {
1888
1888
  super(...arguments), this.notifications = [];
1889
1889
  }
@@ -1930,31 +1930,31 @@ let de = class extends P {
1930
1930
  }
1931
1931
  render() {
1932
1932
  const n = this.notifications.filter((e) => !e.read).length;
1933
- return d`
1933
+ return u`
1934
1934
  <div class="header">
1935
1935
  <span class="title">
1936
1936
  Notifications
1937
- ${n > 0 ? d`<span class="badge">${n}</span>` : g}
1937
+ ${n > 0 ? u`<span class="badge">${n}</span>` : b}
1938
1938
  </span>
1939
- ${n > 0 ? d`<button class="mark-all" @click=${() => this.client.markAllRead()}>
1939
+ ${n > 0 ? u`<button class="mark-all" @click=${() => this.client.markAllRead()}>
1940
1940
  Mark all read
1941
- </button>` : g}
1941
+ </button>` : b}
1942
1942
  </div>
1943
1943
  <div class="list">
1944
- ${this.notifications.length === 0 ? d`<div class="empty">
1944
+ ${this.notifications.length === 0 ? u`<div class="empty">
1945
1945
  <div class="empty-icon">&#128276;</div>
1946
1946
  No notifications yet
1947
1947
  </div>` : this.notifications.map(
1948
- (e) => d`
1948
+ (e) => u`
1949
1949
  <div
1950
1950
  class="item ${e.read ? "" : "unread"}"
1951
1951
  @click=${() => this.handleClick(e)}
1952
1952
  >
1953
- <span class="icon">${bi[e.type] ?? "🔔"}</span>
1953
+ <span class="icon">${xi[e.type] ?? "🔔"}</span>
1954
1954
  <div class="content">
1955
1955
  <div class="text">
1956
1956
  <span class="actor">${this.getActorName(e.actorId)}</span>
1957
- ${gi[e.type] ?? e.type}
1957
+ ${vi[e.type] ?? e.type}
1958
1958
  </div>
1959
1959
  <div class="time">${this.formatTime(e.createdAt)}</div>
1960
1960
  </div>
@@ -1966,7 +1966,7 @@ let de = class extends P {
1966
1966
  `;
1967
1967
  }
1968
1968
  };
1969
- de.styles = O`
1969
+ he.styles = M`
1970
1970
  :host {
1971
1971
  display: block;
1972
1972
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
@@ -2107,23 +2107,23 @@ de.styles = O`
2107
2107
  opacity: 0.4;
2108
2108
  }
2109
2109
  `;
2110
- qe([
2111
- ue({ context: J, subscribe: !0 }),
2112
- v({ attribute: !1 })
2113
- ], de.prototype, "client", 2);
2114
- qe([
2115
- w()
2116
- ], de.prototype, "notifications", 2);
2117
- de = qe([
2110
+ Ve([
2111
+ fe({ context: Q, subscribe: !0 }),
2112
+ x({ attribute: !1 })
2113
+ ], he.prototype, "client", 2);
2114
+ Ve([
2115
+ $()
2116
+ ], he.prototype, "notifications", 2);
2117
+ he = Ve([
2118
2118
  L("pulse-notifications")
2119
- ], de);
2120
- var vi = Object.defineProperty, xi = Object.getOwnPropertyDescriptor, ee = (n, e, t, i) => {
2121
- for (var s = i > 1 ? void 0 : i ? xi(e, t) : e, o = n.length - 1, r; o >= 0; o--)
2119
+ ], he);
2120
+ var yi = Object.defineProperty, wi = Object.getOwnPropertyDescriptor, te = (n, e, t, i) => {
2121
+ for (var s = i > 1 ? void 0 : i ? wi(e, t) : e, o = n.length - 1, r; o >= 0; o--)
2122
2122
  (r = n[o]) && (s = (i ? r(e, t, s) : r(s)) || s);
2123
- return i && s && vi(e, t, s), s;
2123
+ return i && s && yi(e, t, s), s;
2124
2124
  };
2125
- const yi = ["👍", "👎", "❤️", "🎉", "👀", "🚀"];
2126
- let H = class extends P {
2125
+ const $i = ["👍", "👎", "❤️", "🎉", "👀", "🚀"];
2126
+ let B = class extends P {
2127
2127
  constructor() {
2128
2128
  super(...arguments), this.targetId = "", this.targetType = "comment", this.reactions = [], this.showPicker = !1;
2129
2129
  }
@@ -2163,9 +2163,9 @@ let H = class extends P {
2163
2163
  }
2164
2164
  render() {
2165
2165
  const n = this.groupReactions();
2166
- return d`
2166
+ return u`
2167
2167
  ${n.map(
2168
- (e) => d`
2168
+ (e) => u`
2169
2169
  <button
2170
2170
  class="reaction ${e.userReactionId ? "active" : ""}"
2171
2171
  @click=${() => this.toggleReaction(e)}
@@ -2182,22 +2182,22 @@ let H = class extends P {
2182
2182
  >
2183
2183
  +
2184
2184
  </button>
2185
- ${this.showPicker ? d`
2185
+ ${this.showPicker ? u`
2186
2186
  <div class="picker">
2187
- ${yi.map(
2188
- (e) => d`
2187
+ ${$i.map(
2188
+ (e) => u`
2189
2189
  <button @click=${() => this.addEmoji(e)}>
2190
2190
  ${e}
2191
2191
  </button>
2192
2192
  `
2193
2193
  )}
2194
2194
  </div>
2195
- ` : g}
2195
+ ` : b}
2196
2196
  </div>
2197
2197
  `;
2198
2198
  }
2199
2199
  };
2200
- H.styles = O`
2200
+ B.styles = M`
2201
2201
  :host {
2202
2202
  display: inline-flex;
2203
2203
  align-items: center;
@@ -2309,32 +2309,32 @@ H.styles = O`
2309
2309
  transform: scale(1.2);
2310
2310
  }
2311
2311
  `;
2312
- ee([
2313
- ue({ context: J, subscribe: !0 }),
2314
- v({ attribute: !1 })
2315
- ], H.prototype, "client", 2);
2316
- ee([
2317
- v({ attribute: "target-id" })
2318
- ], H.prototype, "targetId", 2);
2319
- ee([
2320
- v({ attribute: "target-type" })
2321
- ], H.prototype, "targetType", 2);
2322
- ee([
2323
- w()
2324
- ], H.prototype, "reactions", 2);
2325
- ee([
2326
- w()
2327
- ], H.prototype, "showPicker", 2);
2328
- H = ee([
2312
+ te([
2313
+ fe({ context: Q, subscribe: !0 }),
2314
+ x({ attribute: !1 })
2315
+ ], B.prototype, "client", 2);
2316
+ te([
2317
+ x({ attribute: "target-id" })
2318
+ ], B.prototype, "targetId", 2);
2319
+ te([
2320
+ x({ attribute: "target-type" })
2321
+ ], B.prototype, "targetType", 2);
2322
+ te([
2323
+ $()
2324
+ ], B.prototype, "reactions", 2);
2325
+ te([
2326
+ $()
2327
+ ], B.prototype, "showPicker", 2);
2328
+ B = te([
2329
2329
  L("pulse-reactions")
2330
- ], H);
2330
+ ], B);
2331
2331
  /**
2332
2332
  * @license
2333
2333
  * Copyright 2017 Google LLC
2334
2334
  * SPDX-License-Identifier: BSD-3-Clause
2335
2335
  */
2336
- const wi = { CHILD: 2 }, $i = (n) => (...e) => ({ _$litDirective$: n, values: e });
2337
- class ki {
2336
+ const ki = { CHILD: 2 }, Ei = (n) => (...e) => ({ _$litDirective$: n, values: e });
2337
+ class Ci {
2338
2338
  constructor(e) {
2339
2339
  }
2340
2340
  get _$AU() {
@@ -2355,13 +2355,13 @@ class ki {
2355
2355
  * Copyright 2017 Google LLC
2356
2356
  * SPDX-License-Identifier: BSD-3-Clause
2357
2357
  */
2358
- class Oe extends ki {
2358
+ class Re extends Ci {
2359
2359
  constructor(e) {
2360
- if (super(e), this.it = g, e.type !== wi.CHILD) throw Error(this.constructor.directiveName + "() can only be used in child bindings");
2360
+ if (super(e), this.it = b, e.type !== ki.CHILD) throw Error(this.constructor.directiveName + "() can only be used in child bindings");
2361
2361
  }
2362
2362
  render(e) {
2363
- if (e === g || e == null) return this._t = void 0, this.it = e;
2364
- if (e === V) return e;
2363
+ if (e === b || e == null) return this._t = void 0, this.it = e;
2364
+ if (e === W) return e;
2365
2365
  if (typeof e != "string") throw Error(this.constructor.directiveName + "() called with a non-string value");
2366
2366
  if (e === this.it) return this._t;
2367
2367
  this.it = e;
@@ -2369,23 +2369,23 @@ class Oe extends ki {
2369
2369
  return t.raw = t, this._t = { _$litType$: this.constructor.resultType, strings: t, values: [] };
2370
2370
  }
2371
2371
  }
2372
- Oe.directiveName = "unsafeHTML", Oe.resultType = 1;
2372
+ Re.directiveName = "unsafeHTML", Re.resultType = 1;
2373
2373
  /**
2374
2374
  * @license
2375
2375
  * Copyright 2017 Google LLC
2376
2376
  * SPDX-License-Identifier: BSD-3-Clause
2377
2377
  */
2378
- class Re extends Oe {
2378
+ class Le extends Re {
2379
2379
  }
2380
- Re.directiveName = "unsafeSVG", Re.resultType = 2;
2381
- const Ei = $i(Re);
2380
+ Le.directiveName = "unsafeSVG", Le.resultType = 2;
2381
+ const Ti = Ei(Le);
2382
2382
  /**
2383
2383
  * @license lucide v0.577.0 - ISC
2384
2384
  *
2385
2385
  * This source code is licensed under the ISC license.
2386
2386
  * See the LICENSE file in the root directory of this source tree.
2387
2387
  */
2388
- const Ci = [
2388
+ const Si = [
2389
2389
  ["path", { d: "M10.268 21a2 2 0 0 0 3.464 0" }],
2390
2390
  [
2391
2391
  "path",
@@ -2400,7 +2400,7 @@ const Ci = [
2400
2400
  * This source code is licensed under the ISC license.
2401
2401
  * See the LICENSE file in the root directory of this source tree.
2402
2402
  */
2403
- const Ti = [
2403
+ const Pi = [
2404
2404
  ["circle", { cx: "12", cy: "12", r: "10" }],
2405
2405
  ["path", { d: "M12 6v6l4 2" }]
2406
2406
  ];
@@ -2410,7 +2410,7 @@ const Ti = [
2410
2410
  * This source code is licensed under the ISC license.
2411
2411
  * See the LICENSE file in the root directory of this source tree.
2412
2412
  */
2413
- const _i = [
2413
+ const Ai = [
2414
2414
  [
2415
2415
  "path",
2416
2416
  {
@@ -2424,7 +2424,7 @@ const _i = [
2424
2424
  * This source code is licensed under the ISC license.
2425
2425
  * See the LICENSE file in the root directory of this source tree.
2426
2426
  */
2427
- const Si = [
2427
+ const _i = [
2428
2428
  ["path", { d: "M12 19v3" }],
2429
2429
  ["path", { d: "M19 10v2a7 7 0 0 1-14 0v-2" }],
2430
2430
  ["rect", { x: "9", y: "2", width: "6", height: "13", rx: "3" }]
@@ -2435,7 +2435,7 @@ const Si = [
2435
2435
  * This source code is licensed under the ISC license.
2436
2436
  * See the LICENSE file in the root directory of this source tree.
2437
2437
  */
2438
- const Pi = [
2438
+ const Ii = [
2439
2439
  [
2440
2440
  "path",
2441
2441
  {
@@ -2449,7 +2449,7 @@ const Pi = [
2449
2449
  * This source code is licensed under the ISC license.
2450
2450
  * See the LICENSE file in the root directory of this source tree.
2451
2451
  */
2452
- const Ai = [
2452
+ const Mi = [
2453
2453
  [
2454
2454
  "path",
2455
2455
  {
@@ -2471,7 +2471,7 @@ const Ai = [
2471
2471
  * This source code is licensed under the ISC license.
2472
2472
  * See the LICENSE file in the root directory of this source tree.
2473
2473
  */
2474
- const Ii = [
2474
+ const Oi = [
2475
2475
  [
2476
2476
  "path",
2477
2477
  {
@@ -2486,7 +2486,7 @@ const Ii = [
2486
2486
  * This source code is licensed under the ISC license.
2487
2487
  * See the LICENSE file in the root directory of this source tree.
2488
2488
  */
2489
- const St = [
2489
+ const At = [
2490
2490
  ["path", { d: "M12 17v5" }],
2491
2491
  [
2492
2492
  "path",
@@ -2501,7 +2501,7 @@ const St = [
2501
2501
  * This source code is licensed under the ISC license.
2502
2502
  * See the LICENSE file in the root directory of this source tree.
2503
2503
  */
2504
- const Mi = [
2504
+ const Ri = [
2505
2505
  [
2506
2506
  "path",
2507
2507
  {
@@ -2516,7 +2516,7 @@ const Mi = [
2516
2516
  * This source code is licensed under the ISC license.
2517
2517
  * See the LICENSE file in the root directory of this source tree.
2518
2518
  */
2519
- const Oi = [
2519
+ const Li = [
2520
2520
  ["path", { d: "M10 11v6" }],
2521
2521
  ["path", { d: "M14 11v6" }],
2522
2522
  ["path", { d: "M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6" }],
@@ -2529,7 +2529,7 @@ const Oi = [
2529
2529
  * This source code is licensed under the ISC license.
2530
2530
  * See the LICENSE file in the root directory of this source tree.
2531
2531
  */
2532
- const Ri = [
2532
+ const ji = [
2533
2533
  ["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" }],
2534
2534
  ["rect", { x: "2", y: "6", width: "14", height: "12", rx: "2" }]
2535
2535
  ];
@@ -2539,7 +2539,7 @@ const Ri = [
2539
2539
  * This source code is licensed under the ISC license.
2540
2540
  * See the LICENSE file in the root directory of this source tree.
2541
2541
  */
2542
- const ge = [
2542
+ const be = [
2543
2543
  ["path", { d: "M18 6 6 18" }],
2544
2544
  ["path", { d: "m6 6 12 12" }]
2545
2545
  ];
@@ -2549,7 +2549,7 @@ const ge = [
2549
2549
  * This source code is licensed under the ISC license.
2550
2550
  * See the LICENSE file in the root directory of this source tree.
2551
2551
  */
2552
- const Li = [
2552
+ const zi = [
2553
2553
  [
2554
2554
  "path",
2555
2555
  {
@@ -2557,14 +2557,14 @@ const Li = [
2557
2557
  }
2558
2558
  ]
2559
2559
  ];
2560
- function ji(n) {
2560
+ function Ui(n) {
2561
2561
  return n.map(([e, t]) => {
2562
2562
  const i = Object.entries(t).filter(([, s]) => s != null).map(([s, o]) => `${s}="${o}"`).join(" ");
2563
2563
  return `<${e} ${i}/>`;
2564
2564
  }).join("");
2565
2565
  }
2566
2566
  function C(n, e = 18) {
2567
- return Gt`<svg
2567
+ return Zt`<svg
2568
2568
  xmlns="http://www.w3.org/2000/svg"
2569
2569
  width="${e}"
2570
2570
  height="${e}"
@@ -2574,9 +2574,9 @@ function C(n, e = 18) {
2574
2574
  stroke-width="2"
2575
2575
  stroke-linecap="round"
2576
2576
  stroke-linejoin="round"
2577
- >${Ei(ji(n))}</svg>`;
2577
+ >${Ti(Ui(n))}</svg>`;
2578
2578
  }
2579
- const te = O`
2579
+ const ie = M`
2580
2580
  * {
2581
2581
  box-sizing: border-box;
2582
2582
  margin: 0;
@@ -2619,7 +2619,7 @@ const te = O`
2619
2619
  --pw-shadow: var(--pulse-shadow);
2620
2620
  --pw-shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.16), 0 2px 8px rgba(0, 0, 0, 0.08);
2621
2621
  }
2622
- `, be = O`
2622
+ `, ve = M`
2623
2623
  .pw-btn {
2624
2624
  display: inline-flex;
2625
2625
  align-items: center;
@@ -2663,7 +2663,7 @@ const te = O`
2663
2663
  width: 18px;
2664
2664
  height: 18px;
2665
2665
  }
2666
- `, Se = O`
2666
+ `, Ae = M`
2667
2667
  .pw-scrollable::-webkit-scrollbar {
2668
2668
  width: 4px;
2669
2669
  }
@@ -2675,12 +2675,12 @@ const te = O`
2675
2675
  background: transparent;
2676
2676
  }
2677
2677
  `;
2678
- var zi = Object.defineProperty, Ui = Object.getOwnPropertyDescriptor, Ve = (n, e, t, i) => {
2679
- for (var s = i > 1 ? void 0 : i ? Ui(e, t) : e, o = n.length - 1, r; o >= 0; o--)
2678
+ var Di = Object.defineProperty, Hi = Object.getOwnPropertyDescriptor, We = (n, e, t, i) => {
2679
+ for (var s = i > 1 ? void 0 : i ? Hi(e, t) : e, o = n.length - 1, r; o >= 0; o--)
2680
2680
  (r = n[o]) && (s = (i ? r(e, t, s) : r(s)) || s);
2681
- return i && s && zi(e, t, s), s;
2681
+ return i && s && Di(e, t, s), s;
2682
2682
  };
2683
- let Y = class extends P {
2683
+ let K = class extends P {
2684
2684
  constructor() {
2685
2685
  super(...arguments), this.items = [], this.unsubs = [], this.counter = 0;
2686
2686
  }
@@ -2709,7 +2709,7 @@ let Y = class extends P {
2709
2709
  userId: n.userId,
2710
2710
  description: n.description,
2711
2711
  timestamp: new Date(n.createdAt).getTime(),
2712
- color: Y.TYPE_COLORS[n.type] ?? "#94a3b8"
2712
+ color: K.TYPE_COLORS[n.type] ?? "#94a3b8"
2713
2713
  };
2714
2714
  }
2715
2715
  getUserName(n) {
@@ -2726,18 +2726,18 @@ let Y = class extends P {
2726
2726
  );
2727
2727
  }
2728
2728
  render() {
2729
- return d`
2729
+ return u`
2730
2730
  <div class="panel">
2731
2731
  <div class="panel-header">
2732
2732
  <span class="panel-title">Activity</span>
2733
2733
  <button class="close-btn" @click=${this.fireClose} title="Close">
2734
- ${C(ge, 16)}
2734
+ ${C(be, 16)}
2735
2735
  </button>
2736
2736
  </div>
2737
2737
 
2738
2738
  <div class="panel-body pw-scrollable">
2739
- ${this.items.length === 0 ? d`<div class="empty">No activity yet</div>` : this.items.map(
2740
- (n) => d`
2739
+ ${this.items.length === 0 ? u`<div class="empty">No activity yet</div>` : this.items.map(
2740
+ (n) => u`
2741
2741
  <div class="activity-item">
2742
2742
  <div
2743
2743
  class="activity-dot"
@@ -2745,7 +2745,7 @@ let Y = class extends P {
2745
2745
  ></div>
2746
2746
  <div class="activity-content">
2747
2747
  <div class="activity-text">
2748
- ${n.userId ? d`<span class="activity-user"
2748
+ ${n.userId ? u`<span class="activity-user"
2749
2749
  >${this.getUserName(n.userId)}</span
2750
2750
  >
2751
2751
  ${n.description}` : n.description}
@@ -2762,11 +2762,11 @@ let Y = class extends P {
2762
2762
  `;
2763
2763
  }
2764
2764
  };
2765
- Y.styles = [
2766
- te,
2767
- be,
2768
- Se,
2769
- O`
2765
+ K.styles = [
2766
+ ie,
2767
+ ve,
2768
+ Ae,
2769
+ M`
2770
2770
  :host {
2771
2771
  display: block;
2772
2772
  }
@@ -2884,28 +2884,28 @@ Y.styles = [
2884
2884
  }
2885
2885
  `
2886
2886
  ];
2887
- Y.TYPE_COLORS = {
2887
+ K.TYPE_COLORS = {
2888
2888
  join: "#22c55e",
2889
2889
  leave: "#94a3b8",
2890
2890
  thread: "var(--pw-accent, #6366f1)",
2891
2891
  comment: "#3b82f6",
2892
2892
  resolve: "#22c55e"
2893
2893
  };
2894
- Ve([
2895
- v({ attribute: !1 })
2896
- ], Y.prototype, "client", 2);
2897
- Ve([
2898
- w()
2899
- ], Y.prototype, "items", 2);
2900
- Y = Ve([
2894
+ We([
2895
+ x({ attribute: !1 })
2896
+ ], K.prototype, "client", 2);
2897
+ We([
2898
+ $()
2899
+ ], K.prototype, "items", 2);
2900
+ K = We([
2901
2901
  L("pulse-widget-activity-panel")
2902
- ], Y);
2903
- const Di = "-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif", at = "#6366f1", lt = "#e2e8f0", Hi = "#f8fafc", Ni = "#e2e8f0", ct = "#64748b", ye = 28, Fi = Array.from({ length: ye }, (n, e) => 0.2 + Math.abs(Math.sin(e * 12.9898 + 78.233) * 43758.5453) % 1 * 0.8);
2904
- function dt(n) {
2902
+ ], K);
2903
+ const Bi = "-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif", lt = "#6366f1", ct = "#e2e8f0", Ni = "#f8fafc", Fi = "#e2e8f0", dt = "#64748b", we = 28, qi = Array.from({ length: we }, (n, e) => 0.2 + Math.abs(Math.sin(e * 12.9898 + 78.233) * 43758.5453) % 1 * 0.8);
2904
+ function ht(n) {
2905
2905
  const e = Math.max(0, Math.floor(n)), t = Math.floor(e / 60), i = e % 60;
2906
2906
  return `${t}:${i.toString().padStart(2, "0")}`;
2907
2907
  }
2908
- class Le {
2908
+ class je {
2909
2909
  /**
2910
2910
  * Create and return a fully self-contained inline audio player element.
2911
2911
  *
@@ -2918,31 +2918,31 @@ class Le {
2918
2918
  let i = !1, s = t != null ? t / 1e3 : 0, o = 0;
2919
2919
  const r = document.createElement("audio");
2920
2920
  r.preload = "metadata", r.src = e;
2921
- const l = document.createElement("div");
2922
- Object.assign(l.style, {
2921
+ const a = document.createElement("div");
2922
+ Object.assign(a.style, {
2923
2923
  display: "inline-flex",
2924
2924
  alignItems: "center",
2925
2925
  gap: "10px",
2926
2926
  width: "220px",
2927
2927
  height: "44px",
2928
2928
  padding: "0 10px",
2929
- background: Hi,
2929
+ background: Ni,
2930
2930
  borderRadius: "12px",
2931
- border: `1px solid ${Ni}`,
2932
- fontFamily: Di,
2931
+ border: `1px solid ${Fi}`,
2932
+ fontFamily: Bi,
2933
2933
  fontSize: "11px",
2934
- color: ct,
2934
+ color: dt,
2935
2935
  userSelect: "none",
2936
2936
  boxSizing: "border-box"
2937
2937
  });
2938
- const a = document.createElement("button");
2939
- Object.assign(a.style, {
2938
+ const l = document.createElement("button");
2939
+ Object.assign(l.style, {
2940
2940
  width: "28px",
2941
2941
  height: "28px",
2942
2942
  minWidth: "28px",
2943
2943
  borderRadius: "50%",
2944
2944
  border: "none",
2945
- background: at,
2945
+ background: lt,
2946
2946
  cursor: "pointer",
2947
2947
  display: "flex",
2948
2948
  alignItems: "center",
@@ -2951,27 +2951,27 @@ class Le {
2951
2951
  outline: "none",
2952
2952
  flexShrink: "0"
2953
2953
  });
2954
- const c = document.createElement("span");
2955
- Object.assign(c.style, {
2954
+ const d = document.createElement("span");
2955
+ Object.assign(d.style, {
2956
2956
  display: "block",
2957
2957
  width: "10px",
2958
2958
  height: "12px",
2959
2959
  lineHeight: "0"
2960
2960
  });
2961
- function h() {
2962
- c.innerHTML = `<svg width="10" height="12" viewBox="0 0 10 12" fill="none" xmlns="http://www.w3.org/2000/svg">
2961
+ function c() {
2962
+ d.innerHTML = `<svg width="10" height="12" viewBox="0 0 10 12" fill="none" xmlns="http://www.w3.org/2000/svg">
2963
2963
  <path d="M1 1L9 6L1 11V1Z" fill="white" stroke="white" stroke-width="1" stroke-linejoin="round"/>
2964
2964
  </svg>`;
2965
2965
  }
2966
- function p() {
2967
- c.innerHTML = `<svg width="10" height="12" viewBox="0 0 10 12" fill="none" xmlns="http://www.w3.org/2000/svg">
2966
+ function h() {
2967
+ d.innerHTML = `<svg width="10" height="12" viewBox="0 0 10 12" fill="none" xmlns="http://www.w3.org/2000/svg">
2968
2968
  <rect x="1" y="1" width="2.5" height="10" rx="0.5" fill="white"/>
2969
2969
  <rect x="6.5" y="1" width="2.5" height="10" rx="0.5" fill="white"/>
2970
2970
  </svg>`;
2971
2971
  }
2972
- h(), a.appendChild(c);
2973
- const u = document.createElement("div");
2974
- Object.assign(u.style, {
2972
+ c(), l.appendChild(d);
2973
+ const p = document.createElement("div");
2974
+ Object.assign(p.style, {
2975
2975
  flex: "1",
2976
2976
  display: "flex",
2977
2977
  flexDirection: "column",
@@ -2979,69 +2979,69 @@ class Le {
2979
2979
  overflow: "hidden",
2980
2980
  minWidth: "0"
2981
2981
  });
2982
- const f = document.createElement("div");
2983
- Object.assign(f.style, {
2982
+ const m = document.createElement("div");
2983
+ Object.assign(m.style, {
2984
2984
  display: "flex",
2985
2985
  alignItems: "center",
2986
2986
  gap: "1.5px",
2987
2987
  height: "22px",
2988
2988
  cursor: "pointer"
2989
2989
  });
2990
- const m = [];
2991
- for (let E = 0; E < ye; E++) {
2992
- const M = document.createElement("div"), k = Math.round(Fi[E] * 20);
2993
- Object.assign(M.style, {
2990
+ const g = [];
2991
+ for (let E = 0; E < we; E++) {
2992
+ const I = document.createElement("div"), z = Math.round(qi[E] * 20);
2993
+ Object.assign(I.style, {
2994
2994
  flex: "1",
2995
- height: `${Math.max(3, k)}px`,
2995
+ height: `${Math.max(3, z)}px`,
2996
2996
  borderRadius: "1px",
2997
- background: lt,
2997
+ background: ct,
2998
2998
  transition: "background 0.1s ease",
2999
2999
  minWidth: "0"
3000
- }), m.push(M), f.appendChild(M);
3000
+ }), g.push(I), m.appendChild(I);
3001
3001
  }
3002
- const x = document.createElement("div");
3003
- Object.assign(x.style, {
3002
+ const y = document.createElement("div");
3003
+ Object.assign(y.style, {
3004
3004
  fontSize: "10px",
3005
- color: ct,
3005
+ color: dt,
3006
3006
  whiteSpace: "nowrap",
3007
3007
  lineHeight: "1"
3008
3008
  });
3009
- function b() {
3010
- const E = dt(o), M = dt(s);
3011
- x.textContent = `${E} / ${M}`;
3009
+ function v() {
3010
+ const E = ht(o), I = ht(s);
3011
+ y.textContent = `${E} / ${I}`;
3012
3012
  }
3013
- b(), u.appendChild(f), u.appendChild(x), l.appendChild(a), l.appendChild(u);
3014
- function y() {
3015
- const E = s > 0 ? o / s : 0, M = Math.floor(E * ye);
3016
- for (let k = 0; k < ye; k++)
3017
- m[k].style.background = k <= M ? at : lt;
3013
+ v(), p.appendChild(m), p.appendChild(y), a.appendChild(l), a.appendChild(p);
3014
+ function w() {
3015
+ const E = s > 0 ? o / s : 0, I = Math.floor(E * we);
3016
+ for (let z = 0; z < we; z++)
3017
+ g[z].style.background = z <= I ? lt : ct;
3018
3018
  }
3019
- return f.addEventListener("click", (E) => {
3019
+ return m.addEventListener("click", (E) => {
3020
3020
  if (s <= 0) return;
3021
- const M = f.getBoundingClientRect(), k = Math.min(
3021
+ const I = m.getBoundingClientRect(), z = Math.min(
3022
3022
  1,
3023
- Math.max(0, (E.clientX - M.left) / M.width)
3023
+ Math.max(0, (E.clientX - I.left) / I.width)
3024
3024
  );
3025
- r.currentTime = k * s, o = r.currentTime, y(), b();
3026
- }), a.addEventListener("click", () => {
3025
+ r.currentTime = z * s, o = r.currentTime, w(), v();
3026
+ }), l.addEventListener("click", () => {
3027
3027
  i ? r.pause() : r.play().catch(() => {
3028
3028
  });
3029
3029
  }), r.addEventListener("play", () => {
3030
- i = !0, p();
3030
+ i = !0, h();
3031
3031
  }), r.addEventListener("pause", () => {
3032
- i = !1, h();
3032
+ i = !1, c();
3033
3033
  }), r.addEventListener("ended", () => {
3034
- i = !1, h(), o = 0, y(), b();
3034
+ i = !1, c(), o = 0, w(), v();
3035
3035
  }), r.addEventListener("timeupdate", () => {
3036
- o = r.currentTime, y(), b();
3036
+ o = r.currentTime, w(), v();
3037
3037
  }), r.addEventListener("loadedmetadata", () => {
3038
- r.duration && isFinite(r.duration) && (s = r.duration, b());
3038
+ r.duration && isFinite(r.duration) && (s = r.duration, v());
3039
3039
  }), r.addEventListener("durationchange", () => {
3040
- r.duration && isFinite(r.duration) && (s = r.duration, b());
3041
- }), l;
3040
+ r.duration && isFinite(r.duration) && (s = r.duration, v());
3041
+ }), a;
3042
3042
  }
3043
3043
  }
3044
- class je {
3044
+ class ze {
3045
3045
  constructor() {
3046
3046
  this.container = null, this.stream = null, this.recorder = null, this.analyser = null, this.audioCtx = null, this.recording = !1, this.animFrame = null, this.startTime = 0, this.maxDuration = 12e4, this.maxTimer = null, this.canvas = null, this.timerEl = null, this.resolve = null, this.animate = () => {
3047
3047
  this.recording && (this.drawWaveform(), this.updateTimer(), this.animFrame = requestAnimationFrame(this.animate));
@@ -3058,16 +3058,16 @@ class je {
3058
3058
  const i = this.detectMimeType(), s = {};
3059
3059
  i && (s.mimeType = i), this.recorder = new MediaRecorder(this.stream, s);
3060
3060
  const o = [];
3061
- this.recorder.ondataavailable = (l) => {
3062
- l.data.size > 0 && o.push(l.data);
3061
+ this.recorder.ondataavailable = (a) => {
3062
+ a.data.size > 0 && o.push(a.data);
3063
3063
  }, this.buildUI(e);
3064
- const r = new Promise((l) => {
3065
- this.resolve = l;
3064
+ const r = new Promise((a) => {
3065
+ this.resolve = a;
3066
3066
  });
3067
3067
  return this.recorder.onstop = () => {
3068
- var c, h;
3069
- const l = ((c = this.recorder) == null ? void 0 : c.mimeType) || i || "audio/webm", a = new Blob(o, { type: l });
3070
- (h = this.resolve) == null || h.call(this, a), this.resolve = null, this.cleanupResources();
3068
+ var d, c;
3069
+ const a = ((d = this.recorder) == null ? void 0 : d.mimeType) || i || "audio/webm", l = new Blob(o, { type: a });
3070
+ (c = this.resolve) == null || c.call(this, l), this.resolve = null, this.cleanupResources();
3071
3071
  }, this.recorder.start(), this.recording = !0, this.startTime = Date.now(), this.maxTimer = setTimeout(() => {
3072
3072
  this.stopRecording();
3073
3073
  }, this.maxDuration), this.animate(), r;
@@ -3170,10 +3170,10 @@ class je {
3170
3170
  if (!e) return;
3171
3171
  const t = this.canvas.width, i = this.canvas.height, s = this.analyser.frequencyBinCount, o = new Uint8Array(s);
3172
3172
  this.analyser.getByteFrequencyData(o), e.clearRect(0, 0, t, i);
3173
- const r = s, l = Math.max(2, t / r * 0.7), a = (t - l * r) / (r - 1 || 1);
3174
- for (let c = 0; c < r; c++) {
3175
- const h = o[c] / 255, p = Math.max(2, h * i * 0.85), u = c * (l + a), f = (i - p) / 2, m = 0.4 + h * 0.6;
3176
- e.fillStyle = `rgba(99, 102, 241, ${m})`, e.beginPath(), e.roundRect(u, f, l, p, 1), e.fill();
3173
+ const r = s, a = Math.max(2, t / r * 0.7), l = (t - a * r) / (r - 1 || 1);
3174
+ for (let d = 0; d < r; d++) {
3175
+ const c = o[d] / 255, h = Math.max(2, c * i * 0.85), p = d * (a + l), m = (i - h) / 2, g = 0.4 + c * 0.6;
3176
+ e.fillStyle = `rgba(99, 102, 241, ${g})`, e.beginPath(), e.roundRect(p, m, a, h, 1), e.fill();
3177
3177
  }
3178
3178
  }
3179
3179
  updateTimer() {
@@ -3191,7 +3191,7 @@ class je {
3191
3191
  this.recorder = null, this.container && (this.container.remove(), this.container = null), this.canvas = null, this.timerEl = null;
3192
3192
  }
3193
3193
  }
3194
- const ht = 80, Bi = "#e2e8f0", qi = `
3194
+ const Vi = 180, Wi = 120, Xi = "#e2e8f0", Yi = `
3195
3195
  <svg width="28" height="28" viewBox="0 0 28 28" fill="none" xmlns="http://www.w3.org/2000/svg">
3196
3196
  <circle cx="14" cy="14" r="14" fill="rgba(0,0,0,0.35)"/>
3197
3197
  <polygon points="11,8 22,14 11,20" fill="rgba(255,255,255,0.9)"/>
@@ -3200,18 +3200,18 @@ const ht = 80, Bi = "#e2e8f0", qi = `
3200
3200
  <polygon points="11,5 6,9 2,9 2,15 6,15 11,19"/>
3201
3201
  <line x1="23" y1="9" x2="17" y2="15"/>
3202
3202
  <line x1="17" y1="9" x2="23" y2="15"/>
3203
- </svg>`, Vi = `
3203
+ </svg>`, Ki = `
3204
3204
  <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">
3205
3205
  <polygon points="11,5 6,9 2,9 2,15 6,15 11,19"/>
3206
3206
  <path d="M19.07 4.93a10 10 0 0 1 0 14.14"/>
3207
3207
  <path d="M15.54 8.46a5 5 0 0 1 0 7.07"/>
3208
- </svg>`, Wi = `
3208
+ </svg>`, Gi = `
3209
3209
  <svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="rgba(255,255,255,0.9)" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg">
3210
3210
  <polyline points="15,3 21,3 21,9"/><line x1="21" y1="3" x2="14" y2="10"/>
3211
3211
  <polyline points="9,21 3,21 3,15"/><line x1="3" y1="21" x2="10" y2="14"/>
3212
- </svg>`, _ = class _ {
3212
+ </svg>`, S = class S {
3213
3213
  /**
3214
- * Renders an inline circular video player and returns the root container.
3214
+ * Renders an inline rectangular video player and returns the root container.
3215
3215
  * @param url - Video source URL
3216
3216
  * @param posterUrl - Optional poster/thumbnail image URL
3217
3217
  */
@@ -3221,10 +3221,10 @@ const ht = 80, Bi = "#e2e8f0", qi = `
3221
3221
  Object.assign(o.style, {
3222
3222
  position: "relative",
3223
3223
  display: "inline-block",
3224
- width: `${ht}px`,
3225
- height: `${ht}px`,
3226
- borderRadius: "50%",
3227
- border: `2px solid ${Bi}`,
3224
+ width: `${Vi}px`,
3225
+ height: `${Wi}px`,
3226
+ borderRadius: "8px",
3227
+ border: `1px solid ${Xi}`,
3228
3228
  boxShadow: "0 2px 8px rgba(0,0,0,0.1)",
3229
3229
  overflow: "hidden",
3230
3230
  cursor: "pointer",
@@ -3238,10 +3238,10 @@ const ht = 80, Bi = "#e2e8f0", qi = `
3238
3238
  height: "100%",
3239
3239
  objectFit: "cover",
3240
3240
  display: "block",
3241
- borderRadius: "50%"
3241
+ borderRadius: "8px"
3242
3242
  }), r.src = e, r.loop = !0, r.muted = !0, r.playsInline = !0, r.preload = "metadata", t && (r.poster = t), o.appendChild(r);
3243
- const l = document.createElement("div");
3244
- Object.assign(l.style, {
3243
+ const a = document.createElement("div");
3244
+ Object.assign(a.style, {
3245
3245
  position: "absolute",
3246
3246
  top: "0",
3247
3247
  left: "0",
@@ -3250,13 +3250,13 @@ const ht = 80, Bi = "#e2e8f0", qi = `
3250
3250
  display: "flex",
3251
3251
  alignItems: "center",
3252
3252
  justifyContent: "center",
3253
- borderRadius: "50%",
3253
+ borderRadius: "8px",
3254
3254
  transition: "opacity 0.25s ease",
3255
3255
  opacity: "1",
3256
3256
  pointerEvents: "none"
3257
- }), l.innerHTML = qi, o.appendChild(l);
3258
- const a = document.createElement("div");
3259
- Object.assign(a.style, {
3257
+ }), a.innerHTML = Yi, o.appendChild(a);
3258
+ const l = document.createElement("div");
3259
+ Object.assign(l.style, {
3260
3260
  position: "absolute",
3261
3261
  bottom: "2px",
3262
3262
  right: "2px",
@@ -3269,9 +3269,9 @@ const ht = 80, Bi = "#e2e8f0", qi = `
3269
3269
  justifyContent: "center",
3270
3270
  pointerEvents: "none",
3271
3271
  transition: "opacity 0.2s ease"
3272
- }), a.innerHTML = pt, o.appendChild(a);
3273
- const c = document.createElement("div");
3274
- Object.assign(c.style, {
3272
+ }), l.innerHTML = pt, o.appendChild(l);
3273
+ const d = document.createElement("div");
3274
+ Object.assign(d.style, {
3275
3275
  position: "absolute",
3276
3276
  top: "2px",
3277
3277
  right: "2px",
@@ -3285,28 +3285,28 @@ const ht = 80, Bi = "#e2e8f0", qi = `
3285
3285
  cursor: "pointer",
3286
3286
  pointerEvents: "auto",
3287
3287
  transition: "opacity 0.2s ease, background 0.15s ease"
3288
- }), c.innerHTML = Wi, c.title = "Fullscreen", c.addEventListener("mouseenter", () => {
3289
- c.style.background = "rgba(0,0,0,0.7)";
3290
- }), c.addEventListener("mouseleave", () => {
3291
- c.style.background = "rgba(0,0,0,0.45)";
3292
- }), c.addEventListener("click", (u) => {
3293
- u.stopPropagation(), _.openFullscreen(e, t);
3294
- }), o.appendChild(c);
3295
- function h() {
3296
- l.style.opacity = i ? "0" : "1";
3288
+ }), d.innerHTML = Gi, d.title = "Fullscreen", d.addEventListener("mouseenter", () => {
3289
+ d.style.background = "rgba(0,0,0,0.7)";
3290
+ }), d.addEventListener("mouseleave", () => {
3291
+ d.style.background = "rgba(0,0,0,0.45)";
3292
+ }), d.addEventListener("click", (p) => {
3293
+ p.stopPropagation(), S.openFullscreen(e, t);
3294
+ }), o.appendChild(d);
3295
+ function c() {
3296
+ a.style.opacity = i ? "0" : "1";
3297
3297
  }
3298
- function p() {
3299
- a.style.display = i ? "flex" : "none", a.innerHTML = s ? pt : Vi, c.style.display = i ? "flex" : "none";
3298
+ function h() {
3299
+ l.style.display = i ? "flex" : "none", l.innerHTML = s ? pt : Ki, d.style.display = i ? "flex" : "none";
3300
3300
  }
3301
- return o.addEventListener("click", (u) => {
3302
- u.stopPropagation(), i ? s ? (r.muted = !1, s = !1) : (r.pause(), i = !1, s = !0, r.muted = !0) : (r.muted = !0, s = !0, r.play().catch(() => {
3303
- }), i = !0), h(), p();
3301
+ return o.addEventListener("click", (p) => {
3302
+ p.stopPropagation(), i ? s ? (r.muted = !1, s = !1) : (r.pause(), i = !1, s = !0, r.muted = !0) : (r.muted = !0, s = !0, r.play().catch(() => {
3303
+ }), i = !0), c(), h();
3304
3304
  }), r.addEventListener("pause", () => {
3305
- i && (i = !1, s = !0, r.muted = !0, h(), p());
3305
+ i && (i = !1, s = !0, r.muted = !0, c(), h());
3306
3306
  }), o;
3307
3307
  }
3308
3308
  static openFullscreen(e, t) {
3309
- _.closeFullscreen();
3309
+ S.closeFullscreen();
3310
3310
  const i = document.createElement("div");
3311
3311
  Object.assign(i.style, {
3312
3312
  position: "fixed",
@@ -3347,8 +3347,8 @@ const ht = 80, Bi = "#e2e8f0", qi = `
3347
3347
  s.style.background = "rgba(255,255,255,0.3)";
3348
3348
  }), s.addEventListener("mouseleave", () => {
3349
3349
  s.style.background = "rgba(255,255,255,0.15)";
3350
- }), s.addEventListener("click", (l) => {
3351
- l.stopPropagation(), _.closeFullscreen();
3350
+ }), s.addEventListener("click", (a) => {
3351
+ a.stopPropagation(), S.closeFullscreen();
3352
3352
  });
3353
3353
  const o = document.createElement("video");
3354
3354
  Object.assign(o.style, {
@@ -3357,25 +3357,25 @@ const ht = 80, Bi = "#e2e8f0", qi = `
3357
3357
  borderRadius: "8px",
3358
3358
  outline: "none",
3359
3359
  cursor: "default"
3360
- }), o.src = e, o.controls = !0, o.autoplay = !0, o.playsInline = !0, t && (o.poster = t), o.addEventListener("click", (l) => l.stopPropagation()), i.appendChild(s), i.appendChild(o), i.addEventListener("click", () => _.closeFullscreen());
3361
- const r = (l) => {
3362
- l.key === "Escape" && _.closeFullscreen();
3360
+ }), o.src = e, o.controls = !0, o.autoplay = !0, o.playsInline = !0, t && (o.poster = t), o.addEventListener("click", (a) => a.stopPropagation()), i.appendChild(s), i.appendChild(o), i.addEventListener("click", () => S.closeFullscreen());
3361
+ const r = (a) => {
3362
+ a.key === "Escape" && S.closeFullscreen();
3363
3363
  };
3364
- document.addEventListener("keydown", r), _.fullscreenOverlay = i, _.fullscreenKeyHandler = r, document.body.appendChild(i), requestAnimationFrame(() => {
3364
+ document.addEventListener("keydown", r), S.fullscreenOverlay = i, S.fullscreenKeyHandler = r, document.body.appendChild(i), requestAnimationFrame(() => {
3365
3365
  i.style.opacity = "1";
3366
3366
  });
3367
3367
  }
3368
3368
  static closeFullscreen() {
3369
- if (!_.fullscreenOverlay) return;
3370
- const e = _.fullscreenOverlay;
3371
- _.fullscreenKeyHandler && (document.removeEventListener("keydown", _.fullscreenKeyHandler), _.fullscreenKeyHandler = null);
3369
+ if (!S.fullscreenOverlay) return;
3370
+ const e = S.fullscreenOverlay;
3371
+ S.fullscreenKeyHandler && (document.removeEventListener("keydown", S.fullscreenKeyHandler), S.fullscreenKeyHandler = null);
3372
3372
  const t = e.querySelector("video");
3373
- t && t.pause(), e.style.opacity = "0", e.addEventListener("transitionend", () => e.remove()), _.fullscreenOverlay = null;
3373
+ t && t.pause(), e.style.opacity = "0", e.addEventListener("transitionend", () => e.remove()), S.fullscreenOverlay = null;
3374
3374
  }
3375
3375
  };
3376
- _.fullscreenOverlay = null, _.fullscreenKeyHandler = null;
3377
- let Ee = _;
3378
- const ut = 60, Xi = `
3376
+ S.fullscreenOverlay = null, S.fullscreenKeyHandler = null;
3377
+ let Ce = S;
3378
+ const ut = 60, Ji = `
3379
3379
  .vr-overlay {
3380
3380
  display: flex;
3381
3381
  flex-direction: column;
@@ -3485,11 +3485,11 @@ const ut = 60, Xi = `
3485
3485
  function ft(n) {
3486
3486
  return n.toString().padStart(2, "0");
3487
3487
  }
3488
- function Yi(n) {
3488
+ function Zi(n) {
3489
3489
  const e = Math.floor(n / 60), t = n % 60;
3490
3490
  return `${ft(e)}:${ft(t)}`;
3491
3491
  }
3492
- function Ki() {
3492
+ function Qi() {
3493
3493
  const n = [
3494
3494
  "video/webm;codecs=vp9,opus",
3495
3495
  "video/webm;codecs=vp8,opus",
@@ -3500,7 +3500,7 @@ function Ki() {
3500
3500
  if (MediaRecorder.isTypeSupported(e)) return e;
3501
3501
  return "";
3502
3502
  }
3503
- function Gi(n) {
3503
+ function es(n) {
3504
3504
  return new Promise((e, t) => {
3505
3505
  const i = URL.createObjectURL(n), s = document.createElement("video");
3506
3506
  s.muted = !0, s.playsInline = !0, s.preload = "auto", s.src = i, s.addEventListener("loadeddata", () => {
@@ -3508,8 +3508,8 @@ function Gi(n) {
3508
3508
  }), s.addEventListener("seeked", () => {
3509
3509
  const o = document.createElement("canvas");
3510
3510
  o.width = s.videoWidth || 240, o.height = s.videoHeight || 240, o.getContext("2d").drawImage(s, 0, 0, o.width, o.height), URL.revokeObjectURL(i), o.toBlob(
3511
- (l) => {
3512
- l ? e(l) : t(new Error("Failed to generate poster frame"));
3511
+ (a) => {
3512
+ a ? e(a) : t(new Error("Failed to generate poster frame"));
3513
3513
  },
3514
3514
  "image/jpeg",
3515
3515
  0.85
@@ -3519,7 +3519,7 @@ function Gi(n) {
3519
3519
  }), s.load();
3520
3520
  });
3521
3521
  }
3522
- class ze {
3522
+ class Ue {
3523
3523
  constructor() {
3524
3524
  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;
3525
3525
  }
@@ -3536,7 +3536,7 @@ class ze {
3536
3536
  }
3537
3537
  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(() => {
3538
3538
  }));
3539
- const i = Ki(), s = {};
3539
+ const i = Qi(), s = {};
3540
3540
  i && (s.mimeType = i);
3541
3541
  const o = new MediaRecorder(t, s);
3542
3542
  return this.mediaRecorder = o, o.ondataavailable = (r) => {
@@ -3561,7 +3561,7 @@ class ze {
3561
3561
  }
3562
3562
  // ── Private ──
3563
3563
  buildUI(e) {
3564
- this.styleEl = document.createElement("style"), this.styleEl.textContent = Xi, document.head.appendChild(this.styleEl), this.root = document.createElement("div"), this.root.className = "vr-overlay";
3564
+ this.styleEl = document.createElement("style"), this.styleEl.textContent = Ji, document.head.appendChild(this.styleEl), this.root = document.createElement("div"), this.root.className = "vr-overlay";
3565
3565
  const t = document.createElement("div");
3566
3566
  t.className = "vr-circle-wrapper";
3567
3567
  const i = document.createElement("div");
@@ -3572,24 +3572,24 @@ class ze {
3572
3572
  o.className = "vr-actions";
3573
3573
  const r = document.createElement("button");
3574
3574
  r.className = "vr-btn vr-btn-stop", r.textContent = "Stop", r.addEventListener("click", () => this.stopRecording()), o.appendChild(r);
3575
- const l = document.createElement("button");
3576
- l.className = "vr-btn vr-btn-cancel", l.textContent = "Cancel", l.addEventListener("click", () => this.cancelRecording()), o.appendChild(l), this.root.appendChild(o), e.appendChild(this.root);
3575
+ const a = document.createElement("button");
3576
+ a.className = "vr-btn vr-btn-cancel", a.textContent = "Cancel", a.addEventListener("click", () => this.cancelRecording()), o.appendChild(a), this.root.appendChild(o), e.appendChild(this.root);
3577
3577
  }
3578
3578
  updateTimer() {
3579
3579
  if (!this.timerEl) return;
3580
3580
  const e = ut - this.elapsed;
3581
- this.timerEl.textContent = Yi(this.elapsed), e <= 10 ? this.timerEl.classList.add("vr-countdown") : this.timerEl.classList.remove("vr-countdown");
3581
+ this.timerEl.textContent = Zi(this.elapsed), e <= 10 ? this.timerEl.classList.add("vr-countdown") : this.timerEl.classList.remove("vr-countdown");
3582
3582
  }
3583
3583
  async handleRecordingComplete() {
3584
3584
  var s, o;
3585
3585
  const e = ((s = this.mediaRecorder) == null ? void 0 : s.mimeType) || "video/webm", t = new Blob(this.chunks, { type: e });
3586
3586
  let i;
3587
3587
  try {
3588
- i = await Gi(t);
3588
+ i = await es(t);
3589
3589
  } catch {
3590
3590
  const r = document.createElement("canvas");
3591
- r.width = 1, r.height = 1, i = await new Promise((l) => {
3592
- r.toBlob((a) => l(a), "image/png");
3591
+ r.width = 1, r.height = 1, i = await new Promise((a) => {
3592
+ r.toBlob((l) => a(l), "image/png");
3593
3593
  });
3594
3594
  }
3595
3595
  this.cleanup(), (o = this.resolvePromise) == null || o.call(this, { blob: t, posterBlob: i }), this.resolvePromise = null;
@@ -3608,12 +3608,35 @@ class ze {
3608
3608
  this.videoEl && (this.videoEl.srcObject = null, this.videoEl = null), this.root && this.root.parentElement && this.root.parentElement.removeChild(this.root), this.root = null, this.styleEl && this.styleEl.parentElement && this.styleEl.parentElement.removeChild(this.styleEl), this.styleEl = null, this.chunks = [], this.elapsed = 0;
3609
3609
  }
3610
3610
  }
3611
- const S = class S {
3612
- /** Opens a fullscreen lightbox overlay showing the image. */
3613
- static open(e) {
3614
- S.close();
3615
- const t = document.createElement("div");
3616
- t.id = "pulse-widget-lightbox", Object.assign(t.style, {
3611
+ const mt = {
3612
+ position: "absolute",
3613
+ top: "50%",
3614
+ transform: "translateY(-50%)",
3615
+ width: "44px",
3616
+ height: "44px",
3617
+ border: "none",
3618
+ borderRadius: "50%",
3619
+ background: "rgba(255,255,255,0.15)",
3620
+ color: "#fff",
3621
+ fontSize: "22px",
3622
+ cursor: "pointer",
3623
+ padding: "0",
3624
+ display: "flex",
3625
+ alignItems: "center",
3626
+ justifyContent: "center",
3627
+ transition: "background 150ms ease",
3628
+ zIndex: "1"
3629
+ }, f = class f {
3630
+ /**
3631
+ * Opens a fullscreen lightbox overlay.
3632
+ * @param imageUrl - Single image URL (backwards-compatible)
3633
+ * @param allUrls - Optional array of all image URLs for navigation
3634
+ * @param startIndex - Index in allUrls to start at (default 0)
3635
+ */
3636
+ static open(e, t, i) {
3637
+ f.close(), f.urls = t && t.length > 1 ? t : [e], f.currentIndex = i ?? 0;
3638
+ const s = f.urls.length > 1, o = document.createElement("div");
3639
+ o.id = "pulse-widget-lightbox", Object.assign(o.style, {
3617
3640
  position: "fixed",
3618
3641
  top: "0",
3619
3642
  left: "0",
@@ -3629,8 +3652,8 @@ const S = class S {
3629
3652
  cursor: "pointer",
3630
3653
  fontFamily: "-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif"
3631
3654
  });
3632
- const i = document.createElement("button");
3633
- i.textContent = "×", Object.assign(i.style, {
3655
+ const r = document.createElement("button");
3656
+ r.textContent = "×", Object.assign(r.style, {
3634
3657
  position: "absolute",
3635
3658
  top: "16px",
3636
3659
  right: "16px",
@@ -3641,54 +3664,86 @@ const S = class S {
3641
3664
  background: "rgba(255,255,255,0.15)",
3642
3665
  color: "#fff",
3643
3666
  fontSize: "24px",
3644
- lineHeight: "40px",
3645
- textAlign: "center",
3646
3667
  cursor: "pointer",
3647
3668
  padding: "0",
3648
- fontFamily: "inherit",
3649
3669
  display: "flex",
3650
3670
  alignItems: "center",
3651
3671
  justifyContent: "center",
3652
- transition: "background 150ms ease"
3653
- }), i.addEventListener("mouseenter", () => {
3654
- i.style.background = "rgba(255,255,255,0.3)";
3655
- }), i.addEventListener("mouseleave", () => {
3656
- i.style.background = "rgba(255,255,255,0.15)";
3657
- }), i.addEventListener("click", (r) => {
3658
- r.stopPropagation(), S.close();
3659
- });
3660
- const s = document.createElement("img");
3661
- s.src = e, s.alt = "Lightbox image", Object.assign(s.style, {
3672
+ transition: "background 150ms ease",
3673
+ zIndex: "1"
3674
+ }), r.addEventListener("mouseenter", () => {
3675
+ r.style.background = "rgba(255,255,255,0.3)";
3676
+ }), r.addEventListener("mouseleave", () => {
3677
+ r.style.background = "rgba(255,255,255,0.15)";
3678
+ }), r.addEventListener("click", (d) => {
3679
+ d.stopPropagation(), f.close();
3680
+ }), o.appendChild(r);
3681
+ const a = document.createElement("img");
3682
+ if (a.src = f.urls[f.currentIndex], a.alt = "Lightbox image", Object.assign(a.style, {
3662
3683
  maxWidth: "90vw",
3663
- maxHeight: "90vh",
3684
+ maxHeight: "85vh",
3664
3685
  borderRadius: "8px",
3665
3686
  objectFit: "contain",
3666
3687
  cursor: "default",
3667
- userSelect: "none"
3668
- }), s.addEventListener("click", (r) => {
3669
- r.stopPropagation();
3670
- }), t.appendChild(i), t.appendChild(s), t.addEventListener("click", () => {
3671
- S.close();
3672
- });
3673
- const o = (r) => {
3674
- r.key === "Escape" && S.close();
3688
+ userSelect: "none",
3689
+ transition: "opacity 150ms ease"
3690
+ }), a.addEventListener("click", (d) => d.stopPropagation()), o.appendChild(a), f.imgEl = a, s) {
3691
+ const d = document.createElement("button");
3692
+ d.innerHTML = '<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><polyline points="15,18 9,12 15,6"/></svg>', Object.assign(d.style, { ...mt, left: "16px" }), d.addEventListener("mouseenter", () => {
3693
+ d.style.background = "rgba(255,255,255,0.3)";
3694
+ }), d.addEventListener("mouseleave", () => {
3695
+ d.style.background = "rgba(255,255,255,0.15)";
3696
+ }), d.addEventListener("click", (p) => {
3697
+ p.stopPropagation(), f.navigate(-1);
3698
+ }), o.appendChild(d), f.prevBtn = d;
3699
+ const c = document.createElement("button");
3700
+ c.innerHTML = '<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><polyline points="9,18 15,12 9,6"/></svg>', Object.assign(c.style, { ...mt, right: "16px" }), c.addEventListener("mouseenter", () => {
3701
+ c.style.background = "rgba(255,255,255,0.3)";
3702
+ }), c.addEventListener("mouseleave", () => {
3703
+ c.style.background = "rgba(255,255,255,0.15)";
3704
+ }), c.addEventListener("click", (p) => {
3705
+ p.stopPropagation(), f.navigate(1);
3706
+ }), o.appendChild(c), f.nextBtn = c;
3707
+ const h = document.createElement("span");
3708
+ Object.assign(h.style, {
3709
+ position: "absolute",
3710
+ bottom: "20px",
3711
+ left: "50%",
3712
+ transform: "translateX(-50%)",
3713
+ color: "rgba(255,255,255,0.7)",
3714
+ fontSize: "13px",
3715
+ fontWeight: "500",
3716
+ pointerEvents: "none"
3717
+ }), o.appendChild(h), f.counterEl = h, f.updateNav();
3718
+ }
3719
+ o.addEventListener("click", () => f.close());
3720
+ const l = (d) => {
3721
+ d.key === "Escape" && f.close(), s && d.key === "ArrowLeft" && f.navigate(-1), s && d.key === "ArrowRight" && f.navigate(1);
3675
3722
  };
3676
- document.addEventListener("keydown", o), S.overlay = t, S.onKeyDown = o, document.body.appendChild(t), requestAnimationFrame(() => {
3677
- t.style.opacity = "1";
3723
+ document.addEventListener("keydown", l), f.overlay = o, f.onKeyDown = l, document.body.appendChild(o), requestAnimationFrame(() => {
3724
+ o.style.opacity = "1";
3678
3725
  });
3679
3726
  }
3727
+ static navigate(e) {
3728
+ const t = f.urls.length;
3729
+ f.currentIndex = (f.currentIndex + e + t) % t, f.imgEl && (f.imgEl.style.opacity = "0", setTimeout(() => {
3730
+ f.imgEl && (f.imgEl.src = f.urls[f.currentIndex], f.imgEl.style.opacity = "1");
3731
+ }, 100)), f.updateNav();
3732
+ }
3733
+ static updateNav() {
3734
+ const e = f.currentIndex, t = f.urls.length;
3735
+ f.counterEl && (f.counterEl.textContent = `${e + 1} / ${t}`);
3736
+ }
3680
3737
  /** Closes the lightbox if open. */
3681
3738
  static close() {
3682
- if (!S.overlay) return;
3683
- const e = S.overlay;
3684
- S.onKeyDown && (document.removeEventListener("keydown", S.onKeyDown), S.onKeyDown = null), e.style.opacity = "0", e.addEventListener("transitionend", () => {
3685
- e.remove();
3686
- }), S.overlay = null;
3739
+ if (!f.overlay) return;
3740
+ const e = f.overlay;
3741
+ f.onKeyDown && (document.removeEventListener("keydown", f.onKeyDown), f.onKeyDown = null), e.style.opacity = "0", e.addEventListener("transitionend", () => e.remove()), f.overlay = null, f.imgEl = null, f.prevBtn = null, f.nextBtn = null, f.counterEl = null, f.urls = [], f.currentIndex = 0;
3687
3742
  }
3688
3743
  };
3689
- S.overlay = null, S.onKeyDown = null;
3690
- let Ce = S;
3691
- class oe {
3744
+ f.overlay = null, f.onKeyDown = null, f.urls = [], f.currentIndex = 0, f.imgEl = null, f.prevBtn = null, f.nextBtn = null, f.counterEl = null;
3745
+ let Te = f;
3746
+ class re {
3692
3747
  constructor(e) {
3693
3748
  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);
3694
3749
  }
@@ -3702,19 +3757,19 @@ class oe {
3702
3757
  const i = () => {
3703
3758
  o(), t(null);
3704
3759
  }, s = async () => {
3705
- var l;
3760
+ var a;
3706
3761
  o();
3707
- const r = (l = this.input.files) == null ? void 0 : l[0];
3762
+ const r = (a = this.input.files) == null ? void 0 : a[0];
3708
3763
  if (!r) {
3709
3764
  t(null);
3710
3765
  return;
3711
3766
  }
3712
3767
  this.uploading = !0;
3713
3768
  try {
3714
- const a = await this.client.uploadFile(r);
3715
- t(a);
3716
- } catch (a) {
3717
- console.error("[Pulse] File upload failed:", a), t(null);
3769
+ const l = await this.client.uploadFile(r);
3770
+ t(l);
3771
+ } catch (l) {
3772
+ console.error("[Pulse] File upload failed:", l), t(null);
3718
3773
  } finally {
3719
3774
  this.uploading = !1;
3720
3775
  }
@@ -3735,24 +3790,24 @@ class oe {
3735
3790
  r(), i([]);
3736
3791
  }, o = async () => {
3737
3792
  r();
3738
- const l = this.input.files;
3739
- if (!l || l.length === 0) {
3793
+ const a = this.input.files;
3794
+ if (!a || a.length === 0) {
3740
3795
  i([]);
3741
3796
  return;
3742
3797
  }
3743
- const a = Array.from(l).slice(0, t);
3798
+ const l = Array.from(a).slice(0, t);
3744
3799
  this.uploading = !0;
3745
3800
  try {
3746
- const c = await Promise.all(
3747
- a.map(async (h) => {
3801
+ const d = await Promise.all(
3802
+ l.map(async (c) => {
3748
3803
  try {
3749
- return await this.client.uploadFile(h);
3750
- } catch (p) {
3751
- return console.error("[Pulse] File upload failed:", p), null;
3804
+ return await this.client.uploadFile(c);
3805
+ } catch (h) {
3806
+ return console.error("[Pulse] File upload failed:", h), null;
3752
3807
  }
3753
3808
  })
3754
3809
  );
3755
- i(c.filter((h) => h !== null));
3810
+ i(d.filter((c) => c !== null));
3756
3811
  } finally {
3757
3812
  this.uploading = !1, this.input.multiple = !1;
3758
3813
  }
@@ -3782,7 +3837,7 @@ class oe {
3782
3837
  this.input.remove();
3783
3838
  }
3784
3839
  }
3785
- const Zi = ["👍", "👎", "❤️", "🎉", "👀", "🚀"], ve = "-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif", Ji = '<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>', Qi = '<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>', mt = `<button class="pulse-close-btn" style="
3840
+ const ts = ["👍", "👎", "❤️", "🎉", "👀", "🚀"], xe = "-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif", is = '<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>', ss = '<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>', gt = `<button class="pulse-close-btn" style="
3786
3841
  border:none;background:none;cursor:pointer;color:#94a3b8;padding:4px;
3787
3842
  border-radius:6px;display:flex;align-items:center;justify-content:center;
3788
3843
  transition:all 0.15s;flex-shrink:0;
@@ -3790,7 +3845,7 @@ const Zi = ["👍", "👎", "❤️", "🎉", "👀", "🚀"], ve = "-apple-syst
3790
3845
  onmouseout="this.style.background='none';this.style.color='#94a3b8'">
3791
3846
  <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="18" y1="6" x2="6" y2="18"/><line x1="6" y1="6" x2="18" y2="18"/></svg>
3792
3847
  </button>`;
3793
- class es {
3848
+ class ns {
3794
3849
  constructor(e, t = {}) {
3795
3850
  this.container = null, this.overlay = null, this.form = null, this.popover = null, this.threads = [], this.pinEls = /* @__PURE__ */ new Map(), this._pinModeActive = !1, this.editingPopoverCommentId = null, this.popoverPickerOpen = null, this.lastTypingSendPins = /* @__PURE__ */ new Map(), this.repositionDebounce = null, this.mutationObserver = null, this.upload = null, this.audioRecorder = null, this.videoRecorder = null, this.pendingAttachmentIds = [], this.handleReposition = () => {
3796
3851
  this.repositionDebounce || (this.repositionDebounce = setTimeout(() => {
@@ -3813,13 +3868,13 @@ class es {
3813
3868
  y: i.clientY / o,
3814
3869
  scrollX: window.scrollX,
3815
3870
  scrollY: window.scrollY
3816
- }, l = this.overlay.style.pointerEvents;
3871
+ }, a = this.overlay.style.pointerEvents;
3817
3872
  this.overlay.style.pointerEvents = "none";
3818
- const a = document.elementFromPoint(i.clientX, i.clientY);
3819
- if (this.overlay.style.pointerEvents = l, a) {
3820
- r.selector = this.getSelector(a);
3821
- const c = a.getBoundingClientRect();
3822
- c.width > 0 && c.height > 0 && (r.elementOffsetX = (i.clientX - c.left) / c.width, r.elementOffsetY = (i.clientY - c.top) / c.height);
3873
+ const l = document.elementFromPoint(i.clientX, i.clientY);
3874
+ if (this.overlay.style.pointerEvents = a, l) {
3875
+ r.selector = this.getSelector(l);
3876
+ const d = l.getBoundingClientRect();
3877
+ d.width > 0 && d.height > 0 && (r.elementOffsetX = (i.clientX - d.left) / d.width, r.elementOffsetY = (i.clientY - d.top) / d.height);
3823
3878
  }
3824
3879
  this.showPinForm(i.clientX, i.clientY, r);
3825
3880
  }, this.pickerEl = null, this.client = e, this.onPinModeExit = t.onPinModeExit, this.init();
@@ -3897,14 +3952,14 @@ class es {
3897
3952
  t.unshift(`#${i.id}`);
3898
3953
  break;
3899
3954
  }
3900
- const s = i.tagName.toLowerCase(), o = [...i.classList].filter((a) => !a.startsWith("pulse-")).slice(0, 2);
3955
+ const s = i.tagName.toLowerCase(), o = [...i.classList].filter((l) => !l.startsWith("pulse-")).slice(0, 2);
3901
3956
  let r = o.length > 0 ? `${s}.${o.join(".")}` : s;
3902
- const l = i.parentElement;
3903
- if (l) {
3904
- const a = [...l.children].filter((c) => c.tagName === i.tagName);
3905
- if (a.length > 1) {
3906
- const c = a.indexOf(i) + 1;
3907
- r += `:nth-child(${c})`;
3957
+ const a = i.parentElement;
3958
+ if (a) {
3959
+ const l = [...a.children].filter((d) => d.tagName === i.tagName);
3960
+ if (l.length > 1) {
3961
+ const d = l.indexOf(i) + 1;
3962
+ r += `:nth-child(${d})`;
3908
3963
  }
3909
3964
  }
3910
3965
  if (t.unshift(r), i = i.parentElement, t.length >= 4) break;
@@ -3914,11 +3969,11 @@ class es {
3914
3969
  showPinForm(e, t, i) {
3915
3970
  this.form = document.createElement("div");
3916
3971
  const s = Math.min(280, window.innerWidth - 32), o = 120;
3917
- let r = e + 16, l = t - 10;
3918
- r + s > window.innerWidth - 16 && (r = e - s - 16), l + o > window.innerHeight - 16 && (l = window.innerHeight - o - 16), l < 16 && (l = 16), Object.assign(this.form.style, {
3972
+ let r = e + 16, a = t - 10;
3973
+ r + s > window.innerWidth - 16 && (r = e - s - 16), a + o > window.innerHeight - 16 && (a = window.innerHeight - o - 16), a < 16 && (a = 16), Object.assign(this.form.style, {
3919
3974
  position: "fixed",
3920
3975
  left: `${r}px`,
3921
- top: `${l}px`,
3976
+ top: `${a}px`,
3922
3977
  width: `${s}px`,
3923
3978
  zIndex: "10001",
3924
3979
  background: "#fff",
@@ -3926,11 +3981,11 @@ class es {
3926
3981
  boxShadow: "0 8px 40px rgba(0,0,0,0.18), 0 2px 8px rgba(0,0,0,0.08)",
3927
3982
  border: "1px solid #e2e8f0",
3928
3983
  padding: "14px",
3929
- fontFamily: ve
3984
+ fontFamily: xe
3930
3985
  }), this.form.innerHTML = `
3931
3986
  <div style="display:flex;align-items:center;justify-content:space-between;margin-bottom:8px;">
3932
3987
  <span style="font-size:13px;font-weight:600;color:#0f172a;">Add a comment here</span>
3933
- ${mt}
3988
+ ${gt}
3934
3989
  </div>
3935
3990
  <textarea
3936
3991
  placeholder="Write a comment..."
@@ -3962,13 +4017,13 @@ class es {
3962
4017
  </div>
3963
4018
  <div class="pin-attachments-preview" style="margin-top:6px;display:flex;flex-wrap:wrap;gap:6px;"></div>
3964
4019
  `;
3965
- const a = this.form.querySelector("textarea"), c = this.form.querySelector(".pulse-close-btn"), h = this.form.querySelector(".pin-submit");
3966
- c.addEventListener("click", () => this.exitPinMode()), this.pendingAttachmentIds = [], this.upload || (this.upload = new oe(this.client));
3967
- const p = this.form.querySelector(".pin-attachments-preview"), u = (m, x) => {
3968
- const b = document.createElement("div");
3969
- Object.assign(b.style, { position: "relative", display: "inline-block" }), b.appendChild(x);
3970
- const y = document.createElement("button");
3971
- y.innerHTML = "×", Object.assign(y.style, {
4020
+ const l = this.form.querySelector("textarea"), d = this.form.querySelector(".pulse-close-btn"), c = this.form.querySelector(".pin-submit");
4021
+ d.addEventListener("click", () => this.exitPinMode()), this.pendingAttachmentIds = [], this.upload || (this.upload = new re(this.client));
4022
+ const h = this.form.querySelector(".pin-attachments-preview"), p = (g, y) => {
4023
+ const v = document.createElement("div");
4024
+ Object.assign(v.style, { position: "relative", display: "inline-block" }), v.appendChild(y);
4025
+ const w = document.createElement("button");
4026
+ w.innerHTML = "×", Object.assign(w.style, {
3972
4027
  position: "absolute",
3973
4028
  top: "-4px",
3974
4029
  right: "-4px",
@@ -3986,62 +4041,62 @@ class es {
3986
4041
  justifyContent: "center",
3987
4042
  padding: "0",
3988
4043
  fontWeight: "700"
3989
- }), y.addEventListener("click", () => {
3990
- const E = this.pendingAttachmentIds.indexOf(m);
3991
- E !== -1 && this.pendingAttachmentIds.splice(E, 1), b.remove();
3992
- }), b.appendChild(y), p.appendChild(b);
3993
- }, f = 5;
4044
+ }), w.addEventListener("click", () => {
4045
+ const E = this.pendingAttachmentIds.indexOf(g);
4046
+ E !== -1 && this.pendingAttachmentIds.splice(E, 1), v.remove();
4047
+ }), v.appendChild(w), h.appendChild(v);
4048
+ }, m = 5;
3994
4049
  this.form.querySelector(".attach-img").addEventListener("click", async () => {
3995
- const m = f - this.pendingAttachmentIds.length;
3996
- if (m <= 0) return;
3997
- const x = await this.upload.pickFiles("image/*", m);
3998
- for (const b of x) {
3999
- this.pendingAttachmentIds.push(b.id);
4000
- const y = document.createElement("img");
4001
- y.src = b.thumbnailUrl || b.url, Object.assign(y.style, { width: "48px", height: "48px", borderRadius: "6px", objectFit: "cover", border: "1px solid #e2e8f0", display: "block" }), u(b.id, y);
4050
+ const g = m - this.pendingAttachmentIds.length;
4051
+ if (g <= 0) return;
4052
+ const y = await this.upload.pickFiles("image/*", g);
4053
+ for (const v of y) {
4054
+ this.pendingAttachmentIds.push(v.id);
4055
+ const w = document.createElement("img");
4056
+ w.src = v.thumbnailUrl || v.url, Object.assign(w.style, { width: "48px", height: "48px", borderRadius: "6px", objectFit: "cover", border: "1px solid #e2e8f0", display: "block" }), p(v.id, w);
4002
4057
  }
4003
4058
  }), this.form.querySelector(".attach-mic").addEventListener("click", async () => {
4004
- if (this.pendingAttachmentIds.length >= f) return;
4005
- this.audioRecorder || (this.audioRecorder = new je());
4006
- const m = await this.audioRecorder.startRecording(p);
4007
- if (m) {
4008
- const x = await this.upload.uploadBlob(m, "audio.webm");
4009
- if (x) {
4010
- this.pendingAttachmentIds.push(x.id);
4011
- const b = document.createElement("span");
4012
- Object.assign(b.style, { display: "flex", alignItems: "center", padding: "4px 10px", borderRadius: "6px", background: "#f1f5f9", fontSize: "11px", color: "#64748b", height: "48px", boxSizing: "border-box" }), b.textContent = "🎤 Audio", u(x.id, b);
4059
+ if (this.pendingAttachmentIds.length >= m) return;
4060
+ this.audioRecorder || (this.audioRecorder = new ze());
4061
+ const g = await this.audioRecorder.startRecording(h);
4062
+ if (g) {
4063
+ const y = await this.upload.uploadBlob(g, "audio.webm");
4064
+ if (y) {
4065
+ this.pendingAttachmentIds.push(y.id);
4066
+ const v = document.createElement("span");
4067
+ Object.assign(v.style, { display: "flex", alignItems: "center", padding: "4px 10px", borderRadius: "6px", background: "#f1f5f9", fontSize: "11px", color: "#64748b", height: "48px", boxSizing: "border-box" }), v.textContent = "🎤 Audio", p(y.id, v);
4013
4068
  }
4014
4069
  }
4015
4070
  }), this.form.querySelector(".attach-video").addEventListener("click", async () => {
4016
- if (this.pendingAttachmentIds.length >= f) return;
4017
- this.videoRecorder || (this.videoRecorder = new ze());
4018
- const m = await this.videoRecorder.startRecording(p);
4019
- if (m) {
4020
- const x = await this.upload.uploadBlob(m.blob, "video.webm");
4021
- if (x) {
4022
- this.pendingAttachmentIds.push(x.id);
4023
- const b = document.createElement("span");
4024
- Object.assign(b.style, { display: "flex", alignItems: "center", padding: "4px 10px", borderRadius: "6px", background: "#f1f5f9", fontSize: "11px", color: "#64748b", height: "48px", boxSizing: "border-box" }), b.textContent = "🎥 Video", u(x.id, b);
4071
+ if (this.pendingAttachmentIds.length >= m) return;
4072
+ this.videoRecorder || (this.videoRecorder = new Ue());
4073
+ const g = await this.videoRecorder.startRecording(h);
4074
+ if (g) {
4075
+ const y = await this.upload.uploadBlob(g.blob, "video.webm");
4076
+ if (y) {
4077
+ this.pendingAttachmentIds.push(y.id);
4078
+ const v = document.createElement("span");
4079
+ Object.assign(v.style, { display: "flex", alignItems: "center", padding: "4px 10px", borderRadius: "6px", background: "#f1f5f9", fontSize: "11px", color: "#64748b", height: "48px", boxSizing: "border-box" }), v.textContent = "🎥 Video", p(y.id, v);
4025
4080
  }
4026
4081
  }
4027
- }), h.addEventListener("click", () => {
4028
- const m = a.value.trim();
4029
- if (!m && this.pendingAttachmentIds.length === 0) return;
4030
- const x = [...(m || "").matchAll(/@(\w+)/g)].map((b) => b[1]);
4031
- this.client.createThread(m, { position: i, mentions: x, attachmentIds: this.pendingAttachmentIds.length > 0 ? [...this.pendingAttachmentIds] : void 0 }), this.pendingAttachmentIds = [], this.exitPinMode();
4032
- }), a.addEventListener("keydown", (m) => {
4033
- m.key === "Escape" && this.exitPinMode(), m.stopPropagation();
4034
- }), document.body.appendChild(this.form), requestAnimationFrame(() => a.focus());
4082
+ }), c.addEventListener("click", () => {
4083
+ const g = l.value.trim();
4084
+ if (!g && this.pendingAttachmentIds.length === 0) return;
4085
+ const y = [...(g || "").matchAll(/@(\w+)/g)].map((v) => v[1]);
4086
+ this.client.createThread(g, { position: i, mentions: y, attachmentIds: this.pendingAttachmentIds.length > 0 ? [...this.pendingAttachmentIds] : void 0 }), this.pendingAttachmentIds = [], this.exitPinMode();
4087
+ }), l.addEventListener("keydown", (g) => {
4088
+ g.key === "Escape" && this.exitPinMode(), g.stopPropagation();
4089
+ }), document.body.appendChild(this.form), requestAnimationFrame(() => l.focus());
4035
4090
  }
4036
4091
  // ── Inline thread popover (shown when a pin dot is clicked) ──
4037
4092
  showThreadPopover(e, t) {
4038
4093
  this.closePopover(), this.popover = document.createElement("div"), this.popover.dataset.threadId = e.id;
4039
4094
  const i = window.innerWidth <= 480, s = i ? window.innerWidth : 300, o = t.getBoundingClientRect();
4040
- let r, l;
4041
- i ? (r = 0, l = window.innerHeight * 0.4) : (r = o.right + 10, l = o.top - 8, r + s > window.innerWidth - 16 && (r = o.left - s - 10), l < 16 && (l = 16)), Object.assign(this.popover.style, {
4095
+ let r, a;
4096
+ i ? (r = 0, a = window.innerHeight * 0.4) : (r = o.right + 10, a = o.top - 8, r + s > window.innerWidth - 16 && (r = o.left - s - 10), a < 16 && (a = 16)), Object.assign(this.popover.style, {
4042
4097
  position: "fixed",
4043
4098
  left: `${r}px`,
4044
- top: `${l}px`,
4099
+ top: `${a}px`,
4045
4100
  width: i ? "100vw" : `${s}px`,
4046
4101
  maxHeight: i ? "60vh" : "360px",
4047
4102
  zIndex: "10001",
@@ -4049,36 +4104,36 @@ class es {
4049
4104
  borderRadius: i ? "16px 16px 0 0" : "12px",
4050
4105
  boxShadow: "0 8px 40px rgba(0,0,0,0.18), 0 2px 8px rgba(0,0,0,0.08)",
4051
4106
  border: "1px solid #e2e8f0",
4052
- fontFamily: ve,
4107
+ fontFamily: xe,
4053
4108
  display: "flex",
4054
4109
  flexDirection: "column",
4055
4110
  overflow: "hidden",
4056
4111
  pointerEvents: "auto",
4057
4112
  ...i ? { bottom: "0", top: "auto" } : {}
4058
4113
  });
4059
- const a = document.createElement("div");
4060
- Object.assign(a.style, {
4114
+ const l = document.createElement("div");
4115
+ Object.assign(l.style, {
4061
4116
  display: "flex",
4062
4117
  alignItems: "center",
4063
4118
  justifyContent: "space-between",
4064
4119
  padding: "10px 14px",
4065
4120
  borderBottom: "1px solid #f1f5f9",
4066
4121
  flexShrink: "0"
4067
- }), a.innerHTML = `
4122
+ }), l.innerHTML = `
4068
4123
  <span style="font-size:13px;font-weight:700;color:#0f172a;">Thread</span>
4069
- ${mt}
4070
- `, a.querySelector(".pulse-close-btn").addEventListener("click", () => {
4124
+ ${gt}
4125
+ `, l.querySelector(".pulse-close-btn").addEventListener("click", () => {
4071
4126
  this.closePopover();
4072
- }), this.popover.appendChild(a), this.refreshPopoverComments(e), this.addPopoverReplyForm(e), document.body.appendChild(this.popover);
4073
- const c = this.popover.getBoundingClientRect();
4074
- c.bottom > window.innerHeight - 16 && (this.popover.style.top = `${Math.max(16, window.innerHeight - c.height - 16)}px`), requestAnimationFrame(() => {
4127
+ }), this.popover.appendChild(l), this.refreshPopoverComments(e), this.addPopoverReplyForm(e), document.body.appendChild(this.popover);
4128
+ const d = this.popover.getBoundingClientRect();
4129
+ d.bottom > window.innerHeight - 16 && (this.popover.style.top = `${Math.max(16, window.innerHeight - d.height - 16)}px`), requestAnimationFrame(() => {
4075
4130
  document.addEventListener("pointerdown", this.handlePopoverOutsideClick), document.addEventListener("keydown", this.handlePopoverEscape);
4076
4131
  });
4077
4132
  }
4078
4133
  refreshPopoverComments(e) {
4079
- var l;
4134
+ var d;
4080
4135
  if (!this.popover) return;
4081
- this.removePickerEl(), this.editingPopoverCommentId && !e.comments.find((a) => a.id === this.editingPopoverCommentId) && (this.editingPopoverCommentId = null);
4136
+ this.removePickerEl(), this.editingPopoverCommentId && !e.comments.find((c) => c.id === this.editingPopoverCommentId) && (this.editingPopoverCommentId = null);
4082
4137
  let t = this.popover.querySelector(
4083
4138
  ".popover-comments"
4084
4139
  );
@@ -4089,21 +4144,21 @@ class es {
4089
4144
  padding: "12px 14px",
4090
4145
  minHeight: "0"
4091
4146
  });
4092
- const a = this.popover.firstElementChild;
4093
- a && a.nextSibling ? this.popover.insertBefore(t, a.nextSibling) : this.popover.appendChild(t);
4147
+ const c = this.popover.firstElementChild;
4148
+ c && c.nextSibling ? this.popover.insertBefore(t, c.nextSibling) : this.popover.appendChild(t);
4094
4149
  }
4095
- const i = (l = this.client.state.user) == null ? void 0 : l.id;
4096
- t.innerHTML = e.comments.map((a) => {
4097
- const c = this.client.state.getUser(a.userId), h = c ? c.name.split(" ").map((k) => k[0]).join("").toUpperCase().slice(0, 2) : "?", p = (c == null ? void 0 : c.color) ?? "#94a3b8", u = this.escapeHtml((c == null ? void 0 : c.name) ?? "Unknown"), f = this.formatTime(a.createdAt), m = i === a.userId, x = a.editedAt ? '<span style="font-size:10px;color:#94a3b8;font-style:italic;">(edited)</span>' : "";
4098
- if (this.editingPopoverCommentId === a.id)
4150
+ const i = (d = this.client.state.user) == null ? void 0 : d.id;
4151
+ t.innerHTML = e.comments.map((c) => {
4152
+ const h = this.client.state.getUser(c.userId), p = h ? h.name.split(" ").map((O) => O[0]).join("").toUpperCase().slice(0, 2) : "?", m = (h == null ? void 0 : h.color) ?? "#94a3b8", g = this.escapeHtml((h == null ? void 0 : h.name) ?? "Unknown"), y = this.formatTime(c.createdAt), v = i === c.userId, w = c.editedAt ? '<span style="font-size:10px;color:#94a3b8;font-style:italic;">(edited)</span>' : "";
4153
+ if (this.editingPopoverCommentId === c.id)
4099
4154
  return `
4100
- <div style="margin-bottom:10px;" data-comment-id="${a.id}">
4155
+ <div style="margin-bottom:10px;" data-comment-id="${c.id}">
4101
4156
  <div style="display:flex;align-items:center;gap:7px;margin-bottom:4px;">
4102
- <div style="width:22px;height:22px;border-radius:50%;background:${p};color:#fff;display:flex;align-items:center;justify-content:center;font-size:9px;font-weight:700;flex-shrink:0;">${h}</div>
4103
- <span style="font-size:12px;font-weight:600;color:#0f172a;">${u}</span>
4157
+ <div style="width:22px;height:22px;border-radius:50%;background:${m};color:#fff;display:flex;align-items:center;justify-content:center;font-size:9px;font-weight:700;flex-shrink:0;">${p}</div>
4158
+ <span style="font-size:12px;font-weight:600;color:#0f172a;">${g}</span>
4104
4159
  </div>
4105
4160
  <div style="margin-left:29px;">
4106
- <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>
4161
+ <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(c.body)}</textarea>
4107
4162
  <div style="display:flex;gap:6px;margin-top:6px;">
4108
4163
  <button class="edit-save" style="padding:4px 10px;background:#6366f1;color:#fff;border:none;border-radius:6px;font-size:11px;font-weight:600;cursor:pointer;font-family:inherit;">Save</button>
4109
4164
  <button class="edit-cancel" style="padding:4px 10px;border:1px solid #e2e8f0;border-radius:6px;font-size:11px;font-weight:500;cursor:pointer;background:#fff;font-family:inherit;color:#64748b;">Cancel</button>
@@ -4111,90 +4166,92 @@ class es {
4111
4166
  </div>
4112
4167
  </div>
4113
4168
  `;
4114
- const b = a.body && a.body !== "(attachment)" ? a.body.replace(
4169
+ const E = c.body && c.body !== "(attachment)" ? c.body.replace(
4115
4170
  /@(\w+)/g,
4116
4171
  '<span style="color:#6366f1;font-weight:600;background:#eef2ff;padding:0 3px;border-radius:3px;">@$1</span>'
4117
- ) : "", y = (a.attachments ?? []).map((k) => {
4118
- if (k.type === "image") {
4119
- const At = k.thumbnailUrl || k.url;
4120
- return `<div class="popover-attachment-img" data-full-url="${this.escapeHtml(k.url)}" style="margin:4px 0 4px 29px;cursor:pointer;">
4121
- <img src="${this.escapeHtml(At)}" alt="${this.escapeHtml(k.filename)}" style="max-width:180px;max-height:120px;border-radius:8px;border:1px solid #e2e8f0;display:block;" />
4172
+ ) : "", I = (c.attachments ?? []).map((O) => {
4173
+ if (O.type === "image") {
4174
+ const Mt = O.thumbnailUrl || O.url;
4175
+ return `<div class="popover-attachment-img" data-full-url="${this.escapeHtml(O.url)}" style="margin:4px 0 4px 29px;cursor:pointer;">
4176
+ <img src="${this.escapeHtml(Mt)}" alt="${this.escapeHtml(O.filename)}" style="max-width:180px;max-height:120px;border-radius:8px;border:1px solid #e2e8f0;display:block;" />
4122
4177
  </div>`;
4123
4178
  }
4124
- return k.type === "audio" ? `<div class="popover-attachment-audio" data-url="${this.escapeHtml(k.url)}" data-duration="${k.durationMs ?? ""}" style="margin:4px 0 4px 29px;"></div>` : k.type === "video" ? `<div class="popover-attachment-video" data-url="${this.escapeHtml(k.url)}" data-poster="${this.escapeHtml(k.thumbnailUrl ?? "")}" style="margin:4px 0 4px 29px;"></div>` : "";
4125
- }).join(""), E = m ? `<div class="popover-comment-actions" style="display:flex;gap:2px;margin-top:2px;margin-left:29px;">
4126
- <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"
4179
+ return O.type === "audio" ? `<div class="popover-attachment-audio" data-url="${this.escapeHtml(O.url)}" data-duration="${O.durationMs ?? ""}" style="margin:4px 0 4px 29px;"></div>` : O.type === "video" ? `<div class="popover-attachment-video" data-url="${this.escapeHtml(O.url)}" data-poster="${this.escapeHtml(O.thumbnailUrl ?? "")}" style="margin:4px 0 4px 29px;"></div>` : "";
4180
+ }).join(""), z = v ? `<div class="popover-comment-actions" style="display:flex;gap:2px;margin-top:2px;margin-left:29px;">
4181
+ <button class="edit-btn" data-comment-id="${c.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"
4127
4182
  onmouseover="this.style.color='#6366f1';this.style.background='#eef2ff'"
4128
- onmouseout="this.style.color='#94a3b8';this.style.background='none'">${Ji}</button>
4129
- <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"
4183
+ onmouseout="this.style.color='#94a3b8';this.style.background='none'">${is}</button>
4184
+ <button class="delete-btn" data-comment-id="${c.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"
4130
4185
  onmouseover="this.style.color='#ef4444';this.style.background='#fef2f2'"
4131
- onmouseout="this.style.color='#94a3b8';this.style.background='none'">${Qi}</button>
4132
- </div>` : "", M = this.buildReactionPillsHtml(a.id);
4186
+ onmouseout="this.style.color='#94a3b8';this.style.background='none'">${ss}</button>
4187
+ </div>` : "", It = this.buildReactionPillsHtml(c.id);
4133
4188
  return `
4134
- <div class="popover-comment" style="margin-bottom:10px;" data-comment-id="${a.id}">
4189
+ <div class="popover-comment" style="margin-bottom:10px;" data-comment-id="${c.id}">
4135
4190
  <div style="display:flex;align-items:center;gap:7px;margin-bottom:2px;">
4136
- <div style="width:22px;height:22px;border-radius:50%;background:${p};color:#fff;display:flex;align-items:center;justify-content:center;font-size:9px;font-weight:700;flex-shrink:0;">${h}</div>
4137
- <span style="font-size:12px;font-weight:600;color:#0f172a;">${u}</span>
4138
- <span style="font-size:10px;color:#94a3b8;">${f}</span>
4139
- ${x}
4191
+ <div style="width:22px;height:22px;border-radius:50%;background:${m};color:#fff;display:flex;align-items:center;justify-content:center;font-size:9px;font-weight:700;flex-shrink:0;">${p}</div>
4192
+ <span style="font-size:12px;font-weight:600;color:#0f172a;">${g}</span>
4193
+ <span style="font-size:10px;color:#94a3b8;">${y}</span>
4194
+ ${w}
4140
4195
  </div>
4141
- ${b ? `<div style="font-size:13px;color:#334155;line-height:1.45;margin-left:29px;word-wrap:break-word;">${b}</div>` : ""}
4142
- ${y}
4143
- ${E}
4144
- ${M}
4196
+ ${E ? `<div style="font-size:13px;color:#334155;line-height:1.45;margin-left:29px;word-wrap:break-word;">${E}</div>` : ""}
4197
+ ${I}
4198
+ ${z}
4199
+ ${It}
4145
4200
  </div>
4146
4201
  `;
4147
- }).join(""), t.querySelectorAll(".edit-btn").forEach((a) => {
4148
- a.addEventListener("click", () => {
4149
- this.editingPopoverCommentId = a.dataset.commentId, this.refreshPopoverComments(e);
4202
+ }).join(""), t.querySelectorAll(".edit-btn").forEach((c) => {
4203
+ c.addEventListener("click", () => {
4204
+ this.editingPopoverCommentId = c.dataset.commentId, this.refreshPopoverComments(e);
4150
4205
  });
4151
- }), t.querySelectorAll(".delete-btn").forEach((a) => {
4152
- a.addEventListener("click", () => {
4153
- this.client.deleteComment(a.dataset.commentId);
4206
+ }), t.querySelectorAll(".delete-btn").forEach((c) => {
4207
+ c.addEventListener("click", () => {
4208
+ this.client.deleteComment(c.dataset.commentId);
4154
4209
  });
4155
4210
  });
4156
4211
  const s = t.querySelector(".edit-save"), o = t.querySelector(".edit-cancel"), r = t.querySelector(
4157
4212
  ".edit-textarea"
4158
4213
  );
4159
4214
  s && r && s.addEventListener("click", () => {
4160
- const a = r.value.trim();
4161
- if (!a) return;
4162
- const c = [...a.matchAll(/@(\w+)/g)].map((h) => h[1]);
4215
+ const c = r.value.trim();
4216
+ if (!c) return;
4217
+ const h = [...c.matchAll(/@(\w+)/g)].map((p) => p[1]);
4163
4218
  this.client.editComment(
4164
4219
  this.editingPopoverCommentId,
4165
- a,
4166
- c
4220
+ c,
4221
+ h
4167
4222
  ), this.editingPopoverCommentId = null;
4168
4223
  }), o && o.addEventListener("click", () => {
4169
4224
  this.editingPopoverCommentId = null, this.refreshPopoverComments(e);
4170
- }), t.querySelectorAll("[data-reaction-emoji]").forEach((a) => {
4171
- a.addEventListener("click", (c) => {
4172
- c.stopPropagation();
4173
- const h = a.dataset.reactionEmoji, p = a.dataset.reactionTarget, u = a.dataset.reactionId;
4174
- u ? this.client.removeReaction(u) : this.client.addReaction(p, "comment", h);
4225
+ }), t.querySelectorAll("[data-reaction-emoji]").forEach((c) => {
4226
+ c.addEventListener("click", (h) => {
4227
+ h.stopPropagation();
4228
+ const p = c.dataset.reactionEmoji, m = c.dataset.reactionTarget, g = c.dataset.reactionId;
4229
+ g ? this.client.removeReaction(g) : this.client.addReaction(m, "comment", p);
4175
4230
  });
4176
- }), t.querySelectorAll(".popover-reaction-add").forEach((a) => {
4177
- a.addEventListener("click", (c) => {
4178
- c.stopPropagation();
4179
- const h = a.dataset.commentId;
4180
- this.popoverPickerOpen === h ? (this.popoverPickerOpen = null, this.removePickerEl()) : (this.popoverPickerOpen = h, this.showPickerForButton(a, h));
4231
+ }), t.querySelectorAll(".popover-reaction-add").forEach((c) => {
4232
+ c.addEventListener("click", (h) => {
4233
+ h.stopPropagation();
4234
+ const p = c.dataset.commentId;
4235
+ this.popoverPickerOpen === p ? (this.popoverPickerOpen = null, this.removePickerEl()) : (this.popoverPickerOpen = p, this.showPickerForButton(c, p));
4181
4236
  });
4182
- }), t.querySelectorAll(".popover-attachment-img").forEach((a) => {
4183
- a.addEventListener("click", () => {
4184
- const c = a.dataset.fullUrl;
4185
- c && Ce.open(c);
4237
+ });
4238
+ const a = t.querySelectorAll(".popover-attachment-img"), l = Array.from(a).map((c) => c.dataset.fullUrl).filter(Boolean);
4239
+ a.forEach((c, h) => {
4240
+ c.addEventListener("click", () => {
4241
+ const p = c.dataset.fullUrl;
4242
+ p && Te.open(p, l, h);
4186
4243
  });
4187
- }), t.querySelectorAll(".popover-attachment-audio").forEach((a) => {
4188
- const c = a.dataset.url;
4189
- if (c) {
4190
- const h = a.dataset.duration ? parseInt(a.dataset.duration) : void 0, p = Le.render(c, h);
4191
- a.appendChild(p);
4192
- }
4193
- }), t.querySelectorAll(".popover-attachment-video").forEach((a) => {
4194
- const c = a.dataset.url;
4195
- if (c) {
4196
- const h = a.dataset.poster || void 0, p = Ee.render(c, h);
4197
- a.appendChild(p);
4244
+ }), t.querySelectorAll(".popover-attachment-audio").forEach((c) => {
4245
+ const h = c.dataset.url;
4246
+ if (h) {
4247
+ const p = c.dataset.duration ? parseInt(c.dataset.duration) : void 0, m = je.render(h, p);
4248
+ c.appendChild(m);
4249
+ }
4250
+ }), t.querySelectorAll(".popover-attachment-video").forEach((c) => {
4251
+ const h = c.dataset.url;
4252
+ if (h) {
4253
+ const p = c.dataset.poster || void 0, m = Ce.render(h, p);
4254
+ c.appendChild(m);
4198
4255
  }
4199
4256
  }), t.scrollTop = t.scrollHeight;
4200
4257
  }
@@ -4225,13 +4282,13 @@ class es {
4225
4282
  <div class="reply-attachments-preview" style="flex:1;display:flex;gap:4px;flex-wrap:wrap;margin-left:4px;"></div>
4226
4283
  </div>
4227
4284
  `;
4228
- const o = t.querySelector("input"), r = t.querySelector(".reply-send"), l = t.querySelector(".reply-attachments-preview");
4229
- this.upload || (this.upload = new oe(this.client));
4230
- const a = [], c = (u, f) => {
4231
- const m = document.createElement("span");
4232
- Object.assign(m.style, { position: "relative", display: "inline-flex", alignItems: "center", padding: "2px 18px 2px 8px", borderRadius: "4px", background: "#f1f5f9", fontSize: "10px", color: "#64748b" }), m.textContent = f;
4233
- const x = document.createElement("button");
4234
- x.innerHTML = "×", Object.assign(x.style, {
4285
+ const o = t.querySelector("input"), r = t.querySelector(".reply-send"), a = t.querySelector(".reply-attachments-preview");
4286
+ this.upload || (this.upload = new re(this.client));
4287
+ const l = [], d = (p, m) => {
4288
+ const g = document.createElement("span");
4289
+ Object.assign(g.style, { position: "relative", display: "inline-flex", alignItems: "center", padding: "2px 18px 2px 8px", borderRadius: "4px", background: "#f1f5f9", fontSize: "10px", color: "#64748b" }), g.textContent = m;
4290
+ const y = document.createElement("button");
4291
+ y.innerHTML = "×", Object.assign(y.style, {
4235
4292
  position: "absolute",
4236
4293
  top: "-3px",
4237
4294
  right: "-3px",
@@ -4249,45 +4306,45 @@ class es {
4249
4306
  justifyContent: "center",
4250
4307
  padding: "0",
4251
4308
  fontWeight: "700"
4252
- }), x.addEventListener("click", () => {
4253
- const b = a.indexOf(u);
4254
- b !== -1 && a.splice(b, 1), m.remove();
4255
- }), m.appendChild(x), l.appendChild(m);
4256
- }, h = 5;
4309
+ }), y.addEventListener("click", () => {
4310
+ const v = l.indexOf(p);
4311
+ v !== -1 && l.splice(v, 1), g.remove();
4312
+ }), g.appendChild(y), a.appendChild(g);
4313
+ }, c = 5;
4257
4314
  t.querySelector(".reply-attach-img").addEventListener("click", async () => {
4258
- const u = h - a.length;
4259
- if (u <= 0) return;
4260
- const f = await this.upload.pickFiles("image/*", u);
4261
- for (const m of f)
4262
- a.push(m.id), c(m.id, "📎 Image");
4315
+ const p = c - l.length;
4316
+ if (p <= 0) return;
4317
+ const m = await this.upload.pickFiles("image/*", p);
4318
+ for (const g of m)
4319
+ l.push(g.id), d(g.id, "📎 Image");
4263
4320
  }), t.querySelector(".reply-attach-mic").addEventListener("click", async () => {
4264
- if (a.length >= h) return;
4265
- this.audioRecorder || (this.audioRecorder = new je());
4266
- const u = await this.audioRecorder.startRecording(t);
4267
- if (u) {
4268
- const f = await this.upload.uploadBlob(u, "audio.webm");
4269
- f && (a.push(f.id), c(f.id, "🎤 Audio"));
4321
+ if (l.length >= c) return;
4322
+ this.audioRecorder || (this.audioRecorder = new ze());
4323
+ const p = await this.audioRecorder.startRecording(t);
4324
+ if (p) {
4325
+ const m = await this.upload.uploadBlob(p, "audio.webm");
4326
+ m && (l.push(m.id), d(m.id, "🎤 Audio"));
4270
4327
  }
4271
4328
  }), t.querySelector(".reply-attach-video").addEventListener("click", async () => {
4272
- if (a.length >= h) return;
4273
- this.videoRecorder || (this.videoRecorder = new ze());
4274
- const u = await this.videoRecorder.startRecording(t);
4275
- if (u) {
4276
- const f = await this.upload.uploadBlob(u.blob, "video.webm");
4277
- f && (a.push(f.id), c(f.id, "🎥 Video"));
4329
+ if (l.length >= c) return;
4330
+ this.videoRecorder || (this.videoRecorder = new Ue());
4331
+ const p = await this.videoRecorder.startRecording(t);
4332
+ if (p) {
4333
+ const m = await this.upload.uploadBlob(p.blob, "video.webm");
4334
+ m && (l.push(m.id), d(m.id, "🎥 Video"));
4278
4335
  }
4279
4336
  });
4280
- const p = () => {
4281
- const u = o.value.trim();
4282
- if (!u && a.length === 0) return;
4283
- const f = [...(u || "").matchAll(/@(\w+)/g)].map((m) => m[1]);
4284
- this.client.reply(e.id, u, f, a.length > 0 ? [...a] : void 0), o.value = "", a.length = 0, l.innerHTML = "";
4337
+ const h = () => {
4338
+ const p = o.value.trim();
4339
+ if (!p && l.length === 0) return;
4340
+ const m = [...(p || "").matchAll(/@(\w+)/g)].map((g) => g[1]);
4341
+ this.client.reply(e.id, p, m, l.length > 0 ? [...l] : void 0), o.value = "", l.length = 0, a.innerHTML = "";
4285
4342
  };
4286
- r.addEventListener("click", p), o.addEventListener("input", () => {
4287
- const u = Date.now(), f = this.lastTypingSendPins.get(e.id) ?? 0;
4288
- u - f >= 2e3 && (this.client.sendTyping(e.id), this.lastTypingSendPins.set(e.id, u));
4289
- }), o.addEventListener("keydown", (u) => {
4290
- u.key === "Enter" && (u.preventDefault(), p()), u.key === "Escape" && this.closePopover(), u.stopPropagation();
4343
+ r.addEventListener("click", h), o.addEventListener("input", () => {
4344
+ const p = Date.now(), m = this.lastTypingSendPins.get(e.id) ?? 0;
4345
+ p - m >= 2e3 && (this.client.sendTyping(e.id), this.lastTypingSendPins.set(e.id, p));
4346
+ }), o.addEventListener("keydown", (p) => {
4347
+ p.key === "Enter" && (p.preventDefault(), h()), p.key === "Escape" && this.closePopover(), p.stopPropagation();
4291
4348
  }), this.popover.appendChild(t);
4292
4349
  }
4293
4350
  removePickerEl() {
@@ -4310,9 +4367,9 @@ class es {
4310
4367
  borderRadius: "8px",
4311
4368
  boxShadow: "0 4px 24px rgba(0,0,0,0.12)",
4312
4369
  zIndex: "10002",
4313
- fontFamily: ve
4370
+ fontFamily: xe
4314
4371
  });
4315
- for (const s of Zi) {
4372
+ for (const s of ts) {
4316
4373
  const o = document.createElement("button");
4317
4374
  Object.assign(o.style, {
4318
4375
  border: "none",
@@ -4324,33 +4381,33 @@ class es {
4324
4381
  lineHeight: "1"
4325
4382
  }), o.textContent = s, o.addEventListener("click", (r) => {
4326
4383
  r.stopPropagation();
4327
- const a = this.client.state.getReactions(t).find(
4328
- (c) => {
4329
- var h;
4330
- return c.emoji === s && c.userId === ((h = this.client.state.user) == null ? void 0 : h.id);
4384
+ const l = this.client.state.getReactions(t).find(
4385
+ (d) => {
4386
+ var c;
4387
+ return d.emoji === s && d.userId === ((c = this.client.state.user) == null ? void 0 : c.id);
4331
4388
  }
4332
4389
  );
4333
- a ? this.client.removeReaction(a.id) : this.client.addReaction(t, "comment", s), this.popoverPickerOpen = null, this.removePickerEl();
4390
+ l ? this.client.removeReaction(l.id) : this.client.addReaction(t, "comment", s), this.popoverPickerOpen = null, this.removePickerEl();
4334
4391
  }), this.pickerEl.appendChild(o);
4335
4392
  }
4336
4393
  document.body.appendChild(this.pickerEl);
4337
4394
  }
4338
4395
  buildReactionPillsHtml(e) {
4339
- var a;
4340
- const t = this.client.state.getReactions(e), i = (a = this.client.state.user) == null ? void 0 : a.id, s = /* @__PURE__ */ new Map();
4341
- for (const c of t) {
4342
- const h = s.get(c.emoji) ?? { count: 0, ownId: null };
4343
- h.count++, c.userId === i && (h.ownId = c.id), s.set(c.emoji, h);
4396
+ var l;
4397
+ const t = this.client.state.getReactions(e), i = (l = this.client.state.user) == null ? void 0 : l.id, s = /* @__PURE__ */ new Map();
4398
+ for (const d of t) {
4399
+ const c = s.get(d.emoji) ?? { count: 0, ownId: null };
4400
+ c.count++, d.userId === i && (c.ownId = d.id), s.set(d.emoji, c);
4344
4401
  }
4345
4402
  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;";
4346
- let l = '<div style="margin-left:29px;display:flex;gap:4px;flex-wrap:wrap;margin-top:4px;">';
4347
- for (const [c, { count: h, ownId: p }] of s) {
4348
- const u = p ? r : o;
4349
- l += `<button data-reaction-emoji="${c}" data-reaction-target="${e}" ${p ? `data-reaction-id="${p}"` : ""} style="${u}">
4350
- <span>${c}</span><span style="font-size:11px;font-weight:600;color:#64748b;">${h}</span>
4403
+ let a = '<div style="margin-left:29px;display:flex;gap:4px;flex-wrap:wrap;margin-top:4px;">';
4404
+ for (const [d, { count: c, ownId: h }] of s) {
4405
+ const p = h ? r : o;
4406
+ a += `<button data-reaction-emoji="${d}" data-reaction-target="${e}" ${h ? `data-reaction-id="${h}"` : ""} style="${p}">
4407
+ <span>${d}</span><span style="font-size:11px;font-weight:600;color:#64748b;">${c}</span>
4351
4408
  </button>`;
4352
4409
  }
4353
- 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;
4410
+ return a += `<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>`, a += "</div>", a;
4354
4411
  }
4355
4412
  updatePopoverTyping(e) {
4356
4413
  if (!this.popover) return;
@@ -4422,7 +4479,7 @@ class es {
4422
4479
  justifyContent: "center",
4423
4480
  fontSize: "11px",
4424
4481
  fontWeight: "700",
4425
- fontFamily: ve,
4482
+ fontFamily: xe,
4426
4483
  cursor: "pointer",
4427
4484
  pointerEvents: "auto",
4428
4485
  boxShadow: "0 2px 8px rgba(99,102,241,0.4)",
@@ -4439,20 +4496,20 @@ class es {
4439
4496
  this.closePopover();
4440
4497
  return;
4441
4498
  }
4442
- const a = this.threads.find((c) => c.id === i.id);
4443
- a && this.showThreadPopover(a, r);
4499
+ const l = this.threads.find((d) => d.id === i.id);
4500
+ l && this.showThreadPopover(l, r);
4444
4501
  }), this.container.appendChild(r), this.pinEls.set(i.id, r)), r.textContent = `${s + 1}`;
4445
- const l = this.resolvePosition(o);
4446
- r.style.left = `${l.x}px`, r.style.top = `${l.y}px`;
4502
+ const a = this.resolvePosition(o);
4503
+ r.style.left = `${a.x}px`, r.style.top = `${a.y}px`;
4447
4504
  });
4448
4505
  }
4449
4506
  }
4450
- var ts = Object.defineProperty, is = Object.getOwnPropertyDescriptor, z = (n, e, t, i) => {
4451
- for (var s = i > 1 ? void 0 : i ? is(e, t) : e, o = n.length - 1, r; o >= 0; o--)
4507
+ var os = Object.defineProperty, rs = Object.getOwnPropertyDescriptor, U = (n, e, t, i) => {
4508
+ for (var s = i > 1 ? void 0 : i ? rs(e, t) : e, o = n.length - 1, r; o >= 0; o--)
4452
4509
  (r = n[o]) && (s = (i ? r(e, t, s) : r(s)) || s);
4453
- return i && s && ts(e, t, s), s;
4510
+ return i && s && os(e, t, s), s;
4454
4511
  };
4455
- const ss = ["👍", "👎", "❤️", "🎉", "👀", "🚀"];
4512
+ const as = ["👍", "👎", "❤️", "🎉", "👀", "🚀"];
4456
4513
  let A = class extends P {
4457
4514
  constructor() {
4458
4515
  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 = [];
@@ -4477,12 +4534,12 @@ let A = class extends P {
4477
4534
  const s = i.dataset.url;
4478
4535
  if (s) {
4479
4536
  const o = i.dataset.duration ? parseInt(i.dataset.duration) : void 0;
4480
- i.appendChild(Le.render(s, o));
4537
+ i.appendChild(je.render(s, o));
4481
4538
  }
4482
4539
  }), (t = this.shadowRoot) == null || t.querySelectorAll(".video-player-host").forEach((i) => {
4483
4540
  if (i.children.length > 0) return;
4484
4541
  const s = i.dataset.url;
4485
- s && i.appendChild(Ee.render(s, i.dataset.poster || void 0));
4542
+ s && i.appendChild(Ce.render(s, i.dataset.poster || void 0));
4486
4543
  });
4487
4544
  }
4488
4545
  teardownListeners() {
@@ -4550,7 +4607,7 @@ let A = class extends P {
4550
4607
  }
4551
4608
  parseMentions(n) {
4552
4609
  return n.split(/(@\w+)/g).map(
4553
- (t) => t.startsWith("@") ? d`<span class="mention">${t}</span>` : t
4610
+ (t) => t.startsWith("@") ? u`<span class="mention">${t}</span>` : t
4554
4611
  );
4555
4612
  }
4556
4613
  getInitials(n) {
@@ -4567,7 +4624,7 @@ let A = class extends P {
4567
4624
  return o < 24 ? `${o}h` : e.toLocaleDateString();
4568
4625
  }
4569
4626
  async handleAttachImage() {
4570
- this.upload || (this.upload = new oe(this.client));
4627
+ this.upload || (this.upload = new re(this.client));
4571
4628
  const n = A.MAX_ATTACHMENTS - this.replyAttachmentIds.length;
4572
4629
  if (n <= 0) return;
4573
4630
  const e = await this.upload.pickFiles("image/*", n);
@@ -4576,7 +4633,7 @@ let A = class extends P {
4576
4633
  async handleRecordAudio(n) {
4577
4634
  var i;
4578
4635
  if (this.replyAttachmentIds.length >= A.MAX_ATTACHMENTS) return;
4579
- this.upload || (this.upload = new oe(this.client)), this.audioRecorder || (this.audioRecorder = new je());
4636
+ this.upload || (this.upload = new re(this.client)), this.audioRecorder || (this.audioRecorder = new ze());
4580
4637
  const e = (i = this.shadowRoot) == null ? void 0 : i.querySelector(`[data-thread-id="${n}"]`), t = await this.audioRecorder.startRecording(e ?? document.body);
4581
4638
  if (t) {
4582
4639
  const s = await this.upload.uploadBlob(t, "audio.webm");
@@ -4586,7 +4643,7 @@ let A = class extends P {
4586
4643
  async handleRecordVideo(n) {
4587
4644
  var i;
4588
4645
  if (this.replyAttachmentIds.length >= A.MAX_ATTACHMENTS) return;
4589
- this.upload || (this.upload = new oe(this.client)), this.videoRecorder || (this.videoRecorder = new ze());
4646
+ this.upload || (this.upload = new re(this.client)), this.videoRecorder || (this.videoRecorder = new Ue());
4590
4647
  const e = (i = this.shadowRoot) == null ? void 0 : i.querySelector(`[data-thread-id="${n}"]`), t = await this.videoRecorder.startRecording(e ?? document.body);
4591
4648
  if (t) {
4592
4649
  const s = await this.upload.uploadBlob(t.blob, "video.webm");
@@ -4623,7 +4680,7 @@ let A = class extends P {
4623
4680
  this.client.deleteComment(n);
4624
4681
  }
4625
4682
  renderEditForm(n) {
4626
- return d`
4683
+ return u`
4627
4684
  <div class="edit-form">
4628
4685
  <textarea
4629
4686
  .value=${this.editBody}
@@ -4644,14 +4701,14 @@ let A = class extends P {
4644
4701
  const e = this.client.state.getReactions(n.id), t = (s = this.client.state.user) == null ? void 0 : s.id, i = /* @__PURE__ */ new Map();
4645
4702
  for (const o of e)
4646
4703
  i.has(o.emoji) || i.set(o.emoji, []), i.get(o.emoji).push(o);
4647
- return d`
4704
+ return u`
4648
4705
  <div class="comment-reactions">
4649
4706
  ${[...i.entries()].map(
4650
4707
  ([o, r]) => {
4651
- const l = r.some((a) => a.userId === t);
4652
- return d`
4708
+ const a = r.some((l) => l.userId === t);
4709
+ return u`
4653
4710
  <button
4654
- class="reaction-pill ${l ? "own" : ""}"
4711
+ class="reaction-pill ${a ? "own" : ""}"
4655
4712
  @click=${() => this.toggleReaction(n.id, o)}
4656
4713
  >
4657
4714
  <span>${o}</span>
@@ -4668,26 +4725,26 @@ let A = class extends P {
4668
4725
  title="Add reaction"
4669
4726
  >
4670
4727
  +
4671
- ${this.pickerOpenForComment === n.id ? d`
4728
+ ${this.pickerOpenForComment === n.id ? u`
4672
4729
  <div class="emoji-picker">
4673
- ${ss.map(
4674
- (o) => d`
4730
+ ${as.map(
4731
+ (o) => u`
4675
4732
  <button @click=${(r) => {
4676
4733
  r.stopPropagation(), this.toggleReaction(n.id, o);
4677
4734
  }}>${o}</button>
4678
4735
  `
4679
4736
  )}
4680
4737
  </div>
4681
- ` : g}
4738
+ ` : b}
4682
4739
  </button>
4683
4740
  </div>
4684
4741
  `;
4685
4742
  }
4686
4743
  renderTypingIndicator(n) {
4687
4744
  const e = this.typingByThread.get(n) ?? [];
4688
- if (e.length === 0) return g;
4745
+ if (e.length === 0) return b;
4689
4746
  const t = e.length === 1 ? `${e[0]} is typing...` : `${e.join(", ")} are typing...`;
4690
- return d`<div class="typing-indicator">${t}</div>`;
4747
+ return u`<div class="typing-indicator">${t}</div>`;
4691
4748
  }
4692
4749
  sortedThreads() {
4693
4750
  return [...this.threads].sort((n, e) => {
@@ -4698,7 +4755,7 @@ let A = class extends P {
4698
4755
  }
4699
4756
  render() {
4700
4757
  const n = this.sortedThreads();
4701
- return d`
4758
+ return u`
4702
4759
  <div class="panel">
4703
4760
  <div class="panel-header">
4704
4761
  <span class="panel-title">
@@ -4706,12 +4763,12 @@ let A = class extends P {
4706
4763
  <span class="thread-count">${this.threads.length}</span>
4707
4764
  </span>
4708
4765
  <button class="close-btn" @click=${this.fireClose} title="Close">
4709
- ${C(ge, 16)}
4766
+ ${C(be, 16)}
4710
4767
  </button>
4711
4768
  </div>
4712
4769
 
4713
4770
  <div class="panel-body pw-scrollable">
4714
- ${n.length === 0 ? d`<div class="empty">
4771
+ ${n.length === 0 ? u`<div class="empty">
4715
4772
  <div class="empty-icon">&#128172;</div>
4716
4773
  No comments yet
4717
4774
  </div>` : n.map((e) => this.renderThread(e))}
@@ -4724,55 +4781,57 @@ let A = class extends P {
4724
4781
  `;
4725
4782
  }
4726
4783
  renderAttachments(n) {
4727
- return !n || n.length === 0 ? g : d`
4728
- ${n.map((e) => {
4729
- if (e.type === "image") {
4730
- const t = e.thumbnailUrl || e.url;
4731
- return d`
4784
+ if (!n || n.length === 0) return b;
4785
+ const e = n.filter((t) => t.type === "image").map((t) => t.url);
4786
+ return u`
4787
+ ${n.map((t) => {
4788
+ if (t.type === "image") {
4789
+ const i = t.thumbnailUrl || t.url, s = e.indexOf(t.url);
4790
+ return u`
4732
4791
  <div class="comment-attachment-media">
4733
4792
  <img
4734
4793
  class="comment-attachment-img"
4735
- src=${t}
4736
- alt=${e.filename}
4737
- @click=${() => Ce.open(e.url)}
4794
+ src=${i}
4795
+ alt=${t.filename}
4796
+ @click=${() => Te.open(t.url, e, s)}
4738
4797
  />
4739
4798
  </div>
4740
4799
  `;
4741
4800
  }
4742
- return e.type === "audio" ? d`
4743
- <div class="comment-attachment-media" id="audio-${e.id}">
4744
- ${this.renderAudioPlayer(e)}
4801
+ return t.type === "audio" ? u`
4802
+ <div class="comment-attachment-media" id="audio-${t.id}">
4803
+ ${this.renderAudioPlayer(t)}
4745
4804
  </div>
4746
- ` : e.type === "video" ? d`
4747
- <div class="comment-attachment-media" id="video-${e.id}">
4748
- ${this.renderVideoPlayer(e)}
4805
+ ` : t.type === "video" ? u`
4806
+ <div class="comment-attachment-media" id="video-${t.id}">
4807
+ ${this.renderVideoPlayer(t)}
4749
4808
  </div>
4750
- ` : g;
4809
+ ` : b;
4751
4810
  })}
4752
4811
  `;
4753
4812
  }
4754
4813
  renderAudioPlayer(n) {
4755
- const e = document.createElement("div"), t = Le.render(n.url, n.durationMs);
4756
- return e.appendChild(t), d`<div class="audio-player-host" data-url=${n.url} data-duration=${n.durationMs ?? ""}></div>`;
4814
+ const e = document.createElement("div"), t = je.render(n.url, n.durationMs);
4815
+ return e.appendChild(t), u`<div class="audio-player-host" data-url=${n.url} data-duration=${n.durationMs ?? ""}></div>`;
4757
4816
  }
4758
4817
  renderVideoPlayer(n) {
4759
- return d`<div class="video-player-host" data-url=${n.url} data-poster=${n.thumbnailUrl ?? ""}></div>`;
4818
+ return u`<div class="video-player-host" data-url=${n.url} data-poster=${n.thumbnailUrl ?? ""}></div>`;
4760
4819
  }
4761
4820
  renderThread(n) {
4762
4821
  const e = this.highlightThreadId === n.id;
4763
- return d`
4822
+ return u`
4764
4823
  <div
4765
4824
  class="thread ${n.resolved ? "resolved" : ""} ${e ? "highlighted" : ""}"
4766
4825
  data-thread-id=${n.id}
4767
4826
  >
4768
- ${n.position ? d`<div class="pin-badge">
4769
- ${C(St, 12)}
4827
+ ${n.position ? u`<div class="pin-badge">
4828
+ ${C(At, 12)}
4770
4829
  Pinned
4771
- </div>` : g}
4830
+ </div>` : b}
4772
4831
  ${n.comments.map((t, i) => {
4773
4832
  const s = this.getUserForComment(t.userId), o = this.isOwnComment(t), r = this.editingCommentId === t.id;
4774
- return d`
4775
- ${i > 0 ? d`<div class="comment-divider"></div>` : g}
4833
+ return u`
4834
+ ${i > 0 ? u`<div class="comment-divider"></div>` : b}
4776
4835
  <div class="comment">
4777
4836
  <div class="comment-header">
4778
4837
  <div
@@ -4783,16 +4842,16 @@ let A = class extends P {
4783
4842
  </div>
4784
4843
  <span class="comment-author">${(s == null ? void 0 : s.name) ?? "Unknown"}</span>
4785
4844
  <span class="comment-time">${this.formatTime(t.createdAt)}</span>
4786
- ${t.editedAt ? d`<span class="edited-badge">(edited)</span>` : g}
4845
+ ${t.editedAt ? u`<span class="edited-badge">(edited)</span>` : b}
4787
4846
  </div>
4788
- ${r ? this.renderEditForm(t) : d`
4789
- ${t.body && t.body !== "(attachment)" ? d`<div class="comment-body">${this.parseMentions(t.body)}</div>` : g}
4847
+ ${r ? this.renderEditForm(t) : u`
4848
+ ${t.body && t.body !== "(attachment)" ? u`<div class="comment-body">${this.parseMentions(t.body)}</div>` : b}
4790
4849
  ${this.renderAttachments(t.attachments ?? [])}
4791
4850
  `}
4792
- ${o && !r ? d`<div class="comment-actions">
4793
- <button @click=${() => this.startEdit(t)} title="Edit">${C(Ii, 14)}</button>
4794
- <button class="danger" @click=${() => this.deleteComment(t.id)} title="Delete">${C(Oi, 14)}</button>
4795
- </div>` : g}
4851
+ ${o && !r ? u`<div class="comment-actions">
4852
+ <button @click=${() => this.startEdit(t)} title="Edit">${C(Oi, 14)}</button>
4853
+ <button class="danger" @click=${() => this.deleteComment(t.id)} title="Delete">${C(Li, 14)}</button>
4854
+ </div>` : b}
4796
4855
  ${this.renderReactions(t)}
4797
4856
  </div>
4798
4857
  `;
@@ -4813,7 +4872,7 @@ let A = class extends P {
4813
4872
 
4814
4873
  ${this.renderTypingIndicator(n.id)}
4815
4874
 
4816
- ${this.replyingTo === n.id ? d`
4875
+ ${this.replyingTo === n.id ? u`
4817
4876
  <form
4818
4877
  class="reply-form"
4819
4878
  @submit=${(t) => this.handleReply(n.id, t)}
@@ -4832,22 +4891,22 @@ let A = class extends P {
4832
4891
  class="reply-media-btn"
4833
4892
  title="Attach image"
4834
4893
  @click=${() => this.handleAttachImage()}
4835
- >${C(Pi, 16)}</button>
4894
+ >${C(Ii, 16)}</button>
4836
4895
  <button
4837
4896
  type="button"
4838
4897
  class="reply-media-btn"
4839
4898
  title="Record audio"
4840
4899
  @click=${() => this.handleRecordAudio(n.id)}
4841
- >${C(Si, 16)}</button>
4900
+ >${C(_i, 16)}</button>
4842
4901
  <button
4843
4902
  type="button"
4844
4903
  class="reply-media-btn"
4845
4904
  title="Record video"
4846
4905
  @click=${() => this.handleRecordVideo(n.id)}
4847
- >${C(Ri, 16)}</button>
4906
+ >${C(ji, 16)}</button>
4848
4907
  <div class="reply-preview">
4849
4908
  ${this.replyAttachmentIds.map(
4850
- (t, i) => d`<span class="reply-preview-badge">
4909
+ (t, i) => u`<span class="reply-preview-badge">
4851
4910
  Attached #${i + 1}
4852
4911
  <button
4853
4912
  type="button"
@@ -4859,16 +4918,16 @@ let A = class extends P {
4859
4918
  </div>
4860
4919
  </div>
4861
4920
  </form>
4862
- ` : g}
4921
+ ` : b}
4863
4922
  </div>
4864
4923
  `;
4865
4924
  }
4866
4925
  };
4867
4926
  A.styles = [
4868
- te,
4869
- be,
4870
- Se,
4871
- O`
4927
+ ie,
4928
+ ve,
4929
+ Ae,
4930
+ M`
4872
4931
  :host {
4873
4932
  display: block;
4874
4933
  }
@@ -5409,55 +5468,55 @@ A.styles = [
5409
5468
  `
5410
5469
  ];
5411
5470
  A.MAX_ATTACHMENTS = 5;
5412
- z([
5413
- v({ attribute: !1 })
5471
+ U([
5472
+ x({ attribute: !1 })
5414
5473
  ], A.prototype, "client", 2);
5415
- z([
5416
- v()
5474
+ U([
5475
+ x()
5417
5476
  ], A.prototype, "highlightThreadId", 2);
5418
- z([
5419
- w()
5477
+ U([
5478
+ $()
5420
5479
  ], A.prototype, "threadsVersion", 2);
5421
- z([
5422
- w()
5480
+ U([
5481
+ $()
5423
5482
  ], A.prototype, "replyingTo", 2);
5424
- z([
5425
- w()
5483
+ U([
5484
+ $()
5426
5485
  ], A.prototype, "editingCommentId", 2);
5427
- z([
5428
- w()
5486
+ U([
5487
+ $()
5429
5488
  ], A.prototype, "editBody", 2);
5430
- z([
5431
- w()
5489
+ U([
5490
+ $()
5432
5491
  ], A.prototype, "pickerOpenForComment", 2);
5433
- z([
5434
- w()
5492
+ U([
5493
+ $()
5435
5494
  ], A.prototype, "typingByThread", 2);
5436
- z([
5437
- w()
5495
+ U([
5496
+ $()
5438
5497
  ], A.prototype, "reactionsVersion", 2);
5439
- A = z([
5498
+ A = U([
5440
5499
  L("pulse-widget-comments-panel")
5441
5500
  ], A);
5442
- var ns = Object.defineProperty, os = Object.getOwnPropertyDescriptor, We = (n, e, t, i) => {
5443
- for (var s = i > 1 ? void 0 : i ? os(e, t) : e, o = n.length - 1, r; o >= 0; o--)
5501
+ var ls = Object.defineProperty, cs = Object.getOwnPropertyDescriptor, Xe = (n, e, t, i) => {
5502
+ for (var s = i > 1 ? void 0 : i ? cs(e, t) : e, o = n.length - 1, r; o >= 0; o--)
5444
5503
  (r = n[o]) && (s = (i ? r(e, t, s) : r(s)) || s);
5445
- return i && s && ns(e, t, s), s;
5504
+ return i && s && ls(e, t, s), s;
5446
5505
  };
5447
- const rs = {
5506
+ const ds = {
5448
5507
  "comment:created": "left a comment",
5449
5508
  "comment:mention": "mentioned you",
5450
5509
  "comment:reply": "replied to your comment",
5451
5510
  "thread:resolved": "resolved a thread",
5452
5511
  "reaction:added": "reacted to your comment"
5453
- }, as = {
5512
+ }, hs = {
5454
5513
  "comment:created": "💬",
5455
5514
  "comment:mention": "📣",
5456
5515
  "comment:reply": "↩️",
5457
5516
  "thread:resolved": "✅",
5458
5517
  "reaction:added": "🎉"
5459
5518
  };
5460
- let he = class extends P {
5519
+ let pe = class extends P {
5461
5520
  constructor() {
5462
5521
  super(...arguments), this.notifications = [];
5463
5522
  }
@@ -5501,38 +5560,38 @@ let he = class extends P {
5501
5560
  }
5502
5561
  render() {
5503
5562
  const n = this.notifications.filter((e) => !e.read).length;
5504
- return d`
5563
+ return u`
5505
5564
  <div class="panel">
5506
5565
  <div class="panel-header">
5507
5566
  <span class="panel-title">
5508
5567
  Notifications
5509
- ${n > 0 ? d`<span class="unread-badge">${n}</span>` : g}
5568
+ ${n > 0 ? u`<span class="unread-badge">${n}</span>` : b}
5510
5569
  </span>
5511
5570
  <div style="display:flex;align-items:center;gap:4px;">
5512
- ${n > 0 ? d`<button class="mark-all" @click=${() => this.client.markAllRead()}>
5571
+ ${n > 0 ? u`<button class="mark-all" @click=${() => this.client.markAllRead()}>
5513
5572
  Mark all read
5514
- </button>` : g}
5573
+ </button>` : b}
5515
5574
  <button class="close-btn" @click=${this.fireClose} title="Close">
5516
- ${C(ge, 16)}
5575
+ ${C(be, 16)}
5517
5576
  </button>
5518
5577
  </div>
5519
5578
  </div>
5520
5579
 
5521
5580
  <div class="panel-body pw-scrollable">
5522
- ${this.notifications.length === 0 ? d`<div class="empty">
5581
+ ${this.notifications.length === 0 ? u`<div class="empty">
5523
5582
  <div class="empty-icon">&#128276;</div>
5524
5583
  No notifications
5525
5584
  </div>` : this.notifications.map(
5526
- (e) => d`
5585
+ (e) => u`
5527
5586
  <div
5528
5587
  class="item ${e.read ? "" : "unread"}"
5529
5588
  @click=${() => this.handleClick(e)}
5530
5589
  >
5531
- <span class="icon">${as[e.type] ?? "🔔"}</span>
5590
+ <span class="icon">${hs[e.type] ?? "🔔"}</span>
5532
5591
  <div class="content">
5533
5592
  <div class="text">
5534
5593
  <span class="actor">${this.getActorName(e.actorId)}</span>
5535
- ${rs[e.type] ?? e.type}
5594
+ ${ds[e.type] ?? e.type}
5536
5595
  </div>
5537
5596
  <div class="time">${this.formatTime(e.createdAt)}</div>
5538
5597
  </div>
@@ -5545,11 +5604,11 @@ let he = class extends P {
5545
5604
  `;
5546
5605
  }
5547
5606
  };
5548
- he.styles = [
5549
- te,
5550
- be,
5551
- Se,
5552
- O`
5607
+ pe.styles = [
5608
+ ie,
5609
+ ve,
5610
+ Ae,
5611
+ M`
5553
5612
  :host {
5554
5613
  display: block;
5555
5614
  }
@@ -5742,17 +5801,17 @@ he.styles = [
5742
5801
  }
5743
5802
  `
5744
5803
  ];
5745
- We([
5746
- v({ attribute: !1 })
5747
- ], he.prototype, "client", 2);
5748
- We([
5749
- w()
5750
- ], he.prototype, "notifications", 2);
5751
- he = We([
5804
+ Xe([
5805
+ x({ attribute: !1 })
5806
+ ], pe.prototype, "client", 2);
5807
+ Xe([
5808
+ $()
5809
+ ], pe.prototype, "notifications", 2);
5810
+ pe = Xe([
5752
5811
  L("pulse-widget-notifications-panel")
5753
- ], he);
5754
- const ls = 3e3;
5755
- class cs {
5812
+ ], pe);
5813
+ const ps = 3e3;
5814
+ class us {
5756
5815
  constructor(e) {
5757
5816
  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) => {
5758
5817
  t.pointerType !== "touch" && this.client.moveCursor({
@@ -5804,7 +5863,7 @@ class cs {
5804
5863
  ), this.setSending(!0), this.staleTimer = setInterval(() => {
5805
5864
  const e = Date.now();
5806
5865
  for (const [t, i] of this.cursorLastSeen)
5807
- if (e - i > ls) {
5866
+ if (e - i > ps) {
5808
5867
  this.cursors.delete(t);
5809
5868
  const s = this.cursorEls.get(t);
5810
5869
  s && s.remove(), this.cursorEls.delete(t), this.cursorLastSeen.delete(t);
@@ -5900,11 +5959,11 @@ class cs {
5900
5959
  i.style.transform = `translate(${t.position.x}px, ${t.position.y}px)`;
5901
5960
  }
5902
5961
  }
5903
- class ds {
5962
+ class fs {
5904
5963
  constructor(e) {
5905
5964
  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) => {
5906
- var l, a, c;
5907
- t.preventDefault(), (a = (l = t.target) == null ? void 0 : l.setPointerCapture) == null || a.call(l, t.pointerId), this.currentPoints = [{ x: t.clientX, y: t.clientY }], this.lastPoint = { x: t.clientX, y: t.clientY };
5965
+ var a, l, d;
5966
+ t.preventDefault(), (l = (a = t.target) == null ? void 0 : a.setPointerCapture) == null || l.call(a, t.pointerId), this.currentPoints = [{ x: t.clientX, y: t.clientY }], this.lastPoint = { x: t.clientX, y: t.clientY };
5908
5967
  const i = this.client.state.user, s = (i == null ? void 0 : i.color) ?? "#6366f1", r = 2 + (t.pressure > 0 ? t.pressure : 0.5) * 4;
5909
5968
  this.currentPath = document.createElementNS(
5910
5969
  "http://www.w3.org/2000/svg",
@@ -5912,7 +5971,7 @@ class ds {
5912
5971
  ), this.currentPath.setAttribute("fill", "none"), this.currentPath.setAttribute("stroke", s), this.currentPath.setAttribute("stroke-width", String(r)), this.currentPath.setAttribute("stroke-linecap", "round"), this.currentPath.setAttribute("stroke-linejoin", "round"), this.currentPath.setAttribute(
5913
5972
  "points",
5914
5973
  `${t.clientX},${t.clientY}`
5915
- ), (c = this.container) == null || c.appendChild(this.currentPath), document.addEventListener("pointermove", this.handlePointerMove), document.addEventListener("pointerup", this.handlePointerUp);
5974
+ ), (d = this.container) == null || d.appendChild(this.currentPath), document.addEventListener("pointermove", this.handlePointerMove), document.addEventListener("pointerup", this.handlePointerUp);
5916
5975
  }, this.handlePointerMove = (t) => {
5917
5976
  if (!this.currentPath || !this.lastPoint) return;
5918
5977
  const i = t.clientX - this.lastPoint.x, s = t.clientY - this.lastPoint.y;
@@ -5983,9 +6042,9 @@ class ds {
5983
6042
  this.fadeTimers.set(e, t);
5984
6043
  }
5985
6044
  }
5986
- function hs(n) {
6045
+ function ms(n) {
5987
6046
  if (!n.rangeCount || n.isCollapsed) return null;
5988
- const e = n.getRangeAt(0), t = e.startContainer, i = e.endContainer, s = gt(t), o = gt(i);
6047
+ const e = n.getRangeAt(0), t = e.startContainer, i = e.endContainer, s = bt(t), o = bt(i);
5989
6048
  return !s || !o ? null : {
5990
6049
  startSelector: s,
5991
6050
  startOffset: e.startOffset,
@@ -5993,29 +6052,29 @@ function hs(n) {
5993
6052
  endOffset: e.endOffset
5994
6053
  };
5995
6054
  }
5996
- function ps(n) {
6055
+ function gs(n) {
5997
6056
  var e, t;
5998
6057
  try {
5999
- const i = vt(n.startSelector), s = vt(n.endSelector);
6058
+ const i = xt(n.startSelector), s = xt(n.endSelector);
6000
6059
  if (!i || !s) return null;
6001
- const o = document.createRange(), r = i.nodeType === Node.TEXT_NODE ? ((e = i.textContent) == null ? void 0 : e.length) ?? 0 : i.childNodes.length, l = s.nodeType === Node.TEXT_NODE ? ((t = s.textContent) == null ? void 0 : t.length) ?? 0 : s.childNodes.length;
6002
- return o.setStart(i, Math.min(n.startOffset, r)), o.setEnd(s, Math.min(n.endOffset, l)), o;
6060
+ const o = document.createRange(), r = i.nodeType === Node.TEXT_NODE ? ((e = i.textContent) == null ? void 0 : e.length) ?? 0 : i.childNodes.length, a = s.nodeType === Node.TEXT_NODE ? ((t = s.textContent) == null ? void 0 : t.length) ?? 0 : s.childNodes.length;
6061
+ return o.setStart(i, Math.min(n.startOffset, r)), o.setEnd(s, Math.min(n.endOffset, a)), o;
6003
6062
  } catch {
6004
6063
  return null;
6005
6064
  }
6006
6065
  }
6007
- function gt(n) {
6066
+ function bt(n) {
6008
6067
  if (n.nodeType === Node.TEXT_NODE) {
6009
6068
  const e = n.parentElement;
6010
6069
  if (!e) return null;
6011
- const t = bt(e);
6070
+ const t = vt(e);
6012
6071
  if (!t) return null;
6013
6072
  const i = Array.from(e.childNodes).indexOf(n);
6014
6073
  return `${t}::text(${i})`;
6015
6074
  }
6016
- return n.nodeType === Node.ELEMENT_NODE ? bt(n) : null;
6075
+ return n.nodeType === Node.ELEMENT_NODE ? vt(n) : null;
6017
6076
  }
6018
- function bt(n) {
6077
+ function vt(n) {
6019
6078
  if (!n || n === document.documentElement) return "html";
6020
6079
  if (n === document.body) return "body";
6021
6080
  if (n.id) return `#${CSS.escape(n.id)}`;
@@ -6024,14 +6083,14 @@ function bt(n) {
6024
6083
  for (; t && t !== document.body && i < 10; ) {
6025
6084
  const s = t.parentElement;
6026
6085
  if (!s) break;
6027
- const o = t.tagName.toLowerCase(), r = t.tagName, l = Array.from(s.children).filter(
6028
- (a) => a.tagName === r
6086
+ const o = t.tagName.toLowerCase(), r = t.tagName, a = Array.from(s.children).filter(
6087
+ (l) => l.tagName === r
6029
6088
  );
6030
- if (l.length === 1)
6089
+ if (a.length === 1)
6031
6090
  e.unshift(o);
6032
6091
  else {
6033
- const a = l.indexOf(t) + 1;
6034
- e.unshift(`${o}:nth-of-type(${a})`);
6092
+ const l = a.indexOf(t) + 1;
6093
+ e.unshift(`${o}:nth-of-type(${l})`);
6035
6094
  }
6036
6095
  if (s.id) {
6037
6096
  e.unshift(`#${CSS.escape(s.id)}`);
@@ -6041,7 +6100,7 @@ function bt(n) {
6041
6100
  }
6042
6101
  return e.length > 0 ? e.join(" > ") : null;
6043
6102
  }
6044
- function vt(n) {
6103
+ function xt(n) {
6045
6104
  const e = n.match(/^(.+)::text\((\d+)\)$/);
6046
6105
  if (e) {
6047
6106
  const t = e[1], i = parseInt(e[2], 10);
@@ -6058,7 +6117,7 @@ function vt(n) {
6058
6117
  return null;
6059
6118
  }
6060
6119
  }
6061
- class us {
6120
+ class bs {
6062
6121
  constructor(e) {
6063
6122
  this.container = null, this.unsubs = [], this.enabled = !1, this.selectionEls = /* @__PURE__ */ new Map(), this.clearTimers = /* @__PURE__ */ new Map(), this.client = e;
6064
6123
  }
@@ -6098,32 +6157,32 @@ class us {
6098
6157
  this.disable();
6099
6158
  }
6100
6159
  renderSelection(e, t) {
6101
- var l;
6160
+ var a;
6102
6161
  if (!this.container) return;
6103
- const i = (l = this.client.state.user) == null ? void 0 : l.id;
6162
+ const i = (a = this.client.state.user) == null ? void 0 : a.id;
6104
6163
  if (e === i || (this.clearSelection(e), !t)) return;
6105
- const s = ps(t);
6164
+ const s = gs(t);
6106
6165
  if (!s) return;
6107
6166
  const o = this.client.state.presence.find(
6108
- (a) => a.user.id === e
6167
+ (l) => l.user.id === e
6109
6168
  ), r = (o == null ? void 0 : o.user.color) ?? "#6366f1";
6110
6169
  try {
6111
- const a = s.getClientRects(), c = [];
6112
- for (let h = 0; h < a.length; h++) {
6113
- const p = a[h], u = document.createElement("div");
6114
- Object.assign(u.style, {
6170
+ const l = s.getClientRects(), d = [];
6171
+ for (let c = 0; c < l.length; c++) {
6172
+ const h = l[c], p = document.createElement("div");
6173
+ Object.assign(p.style, {
6115
6174
  position: "absolute",
6116
- left: `${p.left}px`,
6117
- top: `${p.top}px`,
6118
- width: `${p.width}px`,
6119
- height: `${p.height}px`,
6175
+ left: `${h.left}px`,
6176
+ top: `${h.top}px`,
6177
+ width: `${h.width}px`,
6178
+ height: `${h.height}px`,
6120
6179
  background: r,
6121
6180
  opacity: "0.2",
6122
6181
  borderRadius: "2px",
6123
6182
  pointerEvents: "none"
6124
- }), this.container.appendChild(u), c.push(u);
6183
+ }), this.container.appendChild(p), d.push(p);
6125
6184
  }
6126
- this.selectionEls.set(e, c);
6185
+ this.selectionEls.set(e, d);
6127
6186
  } catch {
6128
6187
  }
6129
6188
  this.clearTimers.has(e) && clearTimeout(this.clearTimers.get(e)), this.clearTimers.set(
@@ -6141,12 +6200,12 @@ class us {
6141
6200
  }
6142
6201
  }
6143
6202
  }
6144
- var fs = Object.defineProperty, ms = Object.getOwnPropertyDescriptor, Xe = (n, e, t, i) => {
6145
- for (var s = i > 1 ? void 0 : i ? ms(e, t) : e, o = n.length - 1, r; o >= 0; o--)
6203
+ var vs = Object.defineProperty, xs = Object.getOwnPropertyDescriptor, Ye = (n, e, t, i) => {
6204
+ for (var s = i > 1 ? void 0 : i ? xs(e, t) : e, o = n.length - 1, r; o >= 0; o--)
6146
6205
  (r = n[o]) && (s = (i ? r(e, t, s) : r(s)) || s);
6147
- return i && s && fs(e, t, s), s;
6206
+ return i && s && vs(e, t, s), s;
6148
6207
  };
6149
- let pe = class extends P {
6208
+ let ue = class extends P {
6150
6209
  constructor() {
6151
6210
  super(...arguments), this.roomId = "";
6152
6211
  }
@@ -6166,7 +6225,7 @@ let pe = class extends P {
6166
6225
  );
6167
6226
  }
6168
6227
  renderToggle(n, e) {
6169
- return d`
6228
+ return u`
6170
6229
  <div class="setting-row">
6171
6230
  <span class="setting-label">${n}</span>
6172
6231
  <label class="toggle">
@@ -6182,12 +6241,12 @@ let pe = class extends P {
6182
6241
  }
6183
6242
  render() {
6184
6243
  const n = !this.settings.enabled;
6185
- return d`
6244
+ return u`
6186
6245
  <div class="panel">
6187
6246
  <div class="panel-header">
6188
6247
  <span class="panel-title">Settings</span>
6189
6248
  <button class="close-btn" @click=${this.fireClose} title="Close">
6190
- ${C(ge, 16)}
6249
+ ${C(be, 16)}
6191
6250
  </button>
6192
6251
  </div>
6193
6252
 
@@ -6232,11 +6291,11 @@ let pe = class extends P {
6232
6291
  `;
6233
6292
  }
6234
6293
  };
6235
- pe.styles = [
6236
- te,
6237
- be,
6238
- Se,
6239
- O`
6294
+ ue.styles = [
6295
+ ie,
6296
+ ve,
6297
+ Ae,
6298
+ M`
6240
6299
  :host {
6241
6300
  display: block;
6242
6301
  }
@@ -6407,16 +6466,16 @@ pe.styles = [
6407
6466
  }
6408
6467
  `
6409
6468
  ];
6410
- Xe([
6411
- v({ attribute: !1 })
6412
- ], pe.prototype, "settings", 2);
6413
- Xe([
6414
- v()
6415
- ], pe.prototype, "roomId", 2);
6416
- pe = Xe([
6469
+ Ye([
6470
+ x({ attribute: !1 })
6471
+ ], ue.prototype, "settings", 2);
6472
+ Ye([
6473
+ x()
6474
+ ], ue.prototype, "roomId", 2);
6475
+ ue = Ye([
6417
6476
  L("pulse-widget-settings-panel")
6418
- ], pe);
6419
- const we = {
6477
+ ], ue);
6478
+ const $e = {
6420
6479
  enabled: !0,
6421
6480
  showMyCursor: !0,
6422
6481
  showOthersCursors: !0,
@@ -6427,22 +6486,22 @@ const we = {
6427
6486
  showViewportIndicators: !0,
6428
6487
  showSelections: !0,
6429
6488
  showDrawings: !0
6430
- }, Pt = "pulse:settings:";
6431
- function gs(n) {
6489
+ }, _t = "pulse:settings:";
6490
+ function ys(n) {
6432
6491
  try {
6433
- const e = localStorage.getItem(`${Pt}${n}`);
6434
- return e ? { ...we, ...JSON.parse(e) } : { ...we };
6492
+ const e = localStorage.getItem(`${_t}${n}`);
6493
+ return e ? { ...$e, ...JSON.parse(e) } : { ...$e };
6435
6494
  } catch {
6436
- return { ...we };
6495
+ return { ...$e };
6437
6496
  }
6438
6497
  }
6439
- function bs(n, e) {
6440
- localStorage.setItem(`${Pt}${n}`, JSON.stringify(e));
6498
+ function ws(n, e) {
6499
+ localStorage.setItem(`${_t}${n}`, JSON.stringify(e));
6441
6500
  }
6442
- var vs = Object.defineProperty, xs = Object.getOwnPropertyDescriptor, j = (n, e, t, i) => {
6443
- for (var s = i > 1 ? void 0 : i ? xs(e, t) : e, o = n.length - 1, r; o >= 0; o--)
6501
+ var $s = Object.defineProperty, ks = Object.getOwnPropertyDescriptor, j = (n, e, t, i) => {
6502
+ for (var s = i > 1 ? void 0 : i ? ks(e, t) : e, o = n.length - 1, r; o >= 0; o--)
6444
6503
  (r = n[o]) && (s = (i ? r(e, t, s) : r(s)) || s);
6445
- return i && s && vs(e, t, s), s;
6504
+ return i && s && $s(e, t, s), s;
6446
6505
  };
6447
6506
  let R = class extends P {
6448
6507
  constructor() {
@@ -6495,35 +6554,35 @@ let R = class extends P {
6495
6554
  render() {
6496
6555
  const n = this.display === "inline";
6497
6556
  if (this.collapsed)
6498
- return d`
6557
+ return u`
6499
6558
  <div class="toolbar collapsed ${n ? "inline" : ""}" @click=${this.fireToggle}>
6500
- <span class="fab-icon">${C(Li, n ? 18 : 24)}</span>
6559
+ <span class="fab-icon">${C(zi, n ? 18 : 24)}</span>
6501
6560
  </div>
6502
6561
  `;
6503
6562
  const e = this.users.slice(0, 3), t = this.users.length - 3;
6504
- return d`
6563
+ return u`
6505
6564
  <div class="toolbar ${n ? "inline" : ""}"
6506
6565
  <!-- Presence avatars -->
6507
- ${this.users.length > 0 ? d`
6566
+ ${this.users.length > 0 ? u`
6508
6567
  <div class="presence">
6509
- ${t > 0 ? d`<div class="presence-overflow">+${t}</div>` : g}
6568
+ ${t > 0 ? u`<div class="presence-overflow">+${t}</div>` : b}
6510
6569
  ${e.map(
6511
- (i) => d`
6570
+ (i) => u`
6512
6571
  <div
6513
6572
  class="presence-avatar clickable ${this.followingUserId === i.user.id ? "following" : ""}"
6514
6573
  style="background:${i.user.color}"
6515
6574
  @click=${() => this.fireFollow(i.user.id)}
6516
6575
  title="Click to follow ${i.user.name}"
6517
6576
  >
6518
- ${i.user.avatar ? d`<img src="${i.user.avatar}" alt="${i.user.name}" />` : this.getInitials(i.user.name)}
6577
+ ${i.user.avatar ? u`<img src="${i.user.avatar}" alt="${i.user.name}" />` : this.getInitials(i.user.name)}
6519
6578
  <span class="presence-tooltip">${i.user.name}</span>
6520
- ${i.deviceType && i.deviceType !== "desktop" ? d`<span class="device-icon">${i.deviceType === "mobile" ? "📱" : "📲"}</span>` : g}
6579
+ ${i.deviceType && i.deviceType !== "desktop" ? u`<span class="device-icon">${i.deviceType === "mobile" ? "📱" : "📲"}</span>` : b}
6521
6580
  </div>
6522
6581
  `
6523
6582
  )}
6524
6583
  </div>
6525
6584
  <div class="separator"></div>
6526
- ` : g}
6585
+ ` : b}
6527
6586
 
6528
6587
  <!-- Pin comment (primary) -->
6529
6588
  <button
@@ -6533,7 +6592,7 @@ let R = class extends P {
6533
6592
  ?disabled=${this.featuresDisabled}
6534
6593
  style="${this.featuresDisabled ? "opacity:0.35;pointer-events:none" : ""}"
6535
6594
  >
6536
- ${C(St)}
6595
+ ${C(At)}
6537
6596
  </button>
6538
6597
 
6539
6598
  <!-- View comments -->
@@ -6544,7 +6603,7 @@ let R = class extends P {
6544
6603
  ?disabled=${this.featuresDisabled}
6545
6604
  style="${this.featuresDisabled ? "opacity:0.35;pointer-events:none" : ""}"
6546
6605
  >
6547
- ${C(_i)}
6606
+ ${C(Ai)}
6548
6607
  </button>
6549
6608
 
6550
6609
  <!-- Activity feed -->
@@ -6555,7 +6614,7 @@ let R = class extends P {
6555
6614
  ?disabled=${this.featuresDisabled}
6556
6615
  style="${this.featuresDisabled ? "opacity:0.35;pointer-events:none" : ""}"
6557
6616
  >
6558
- ${C(Ti)}
6617
+ ${C(Pi)}
6559
6618
  </button>
6560
6619
 
6561
6620
  <!-- Draw mode -->
@@ -6566,7 +6625,7 @@ let R = class extends P {
6566
6625
  ?disabled=${this.featuresDisabled}
6567
6626
  style="${this.featuresDisabled ? "opacity:0.35;pointer-events:none" : ""}"
6568
6627
  >
6569
- ${C(Ai)}
6628
+ ${C(Mi)}
6570
6629
  </button>
6571
6630
 
6572
6631
  <!-- Notifications -->
@@ -6577,8 +6636,8 @@ let R = class extends P {
6577
6636
  ?disabled=${this.featuresDisabled}
6578
6637
  style="${this.featuresDisabled ? "opacity:0.35;pointer-events:none" : "position:relative"}"
6579
6638
  >
6580
- ${C(Ci)}
6581
- ${this.unreadCount > 0 ? d`<span class="badge">${this.unreadCount > 9 ? "9+" : this.unreadCount}</span>` : g}
6639
+ ${C(Si)}
6640
+ ${this.unreadCount > 0 ? u`<span class="badge">${this.unreadCount > 9 ? "9+" : this.unreadCount}</span>` : b}
6582
6641
  </button>
6583
6642
 
6584
6643
  <!-- Settings -->
@@ -6587,7 +6646,7 @@ let R = class extends P {
6587
6646
  @click=${() => this.fire("settings")}
6588
6647
  title="Settings"
6589
6648
  >
6590
- ${C(Mi)}
6649
+ ${C(Ri)}
6591
6650
  </button>
6592
6651
 
6593
6652
  <div class="separator"></div>
@@ -6598,16 +6657,16 @@ let R = class extends P {
6598
6657
  @click=${this.fireToggle}
6599
6658
  title="Collapse"
6600
6659
  >
6601
- ${C(ge, 14)}
6660
+ ${C(be, 14)}
6602
6661
  </button>
6603
6662
  </div>
6604
6663
  `;
6605
6664
  }
6606
6665
  };
6607
6666
  R.styles = [
6608
- te,
6609
- be,
6610
- O`
6667
+ ie,
6668
+ ve,
6669
+ M`
6611
6670
  :host {
6612
6671
  display: block;
6613
6672
  }
@@ -6820,39 +6879,39 @@ R.styles = [
6820
6879
  `
6821
6880
  ];
6822
6881
  j([
6823
- v({ attribute: !1 })
6882
+ x({ attribute: !1 })
6824
6883
  ], R.prototype, "client", 2);
6825
6884
  j([
6826
- v({ type: Boolean })
6885
+ x({ type: Boolean })
6827
6886
  ], R.prototype, "collapsed", 2);
6828
6887
  j([
6829
- v()
6888
+ x()
6830
6889
  ], R.prototype, "activePanel", 2);
6831
6890
  j([
6832
- v({ type: Boolean })
6891
+ x({ type: Boolean })
6833
6892
  ], R.prototype, "pinModeActive", 2);
6834
6893
  j([
6835
- v({ type: Boolean })
6894
+ x({ type: Boolean })
6836
6895
  ], R.prototype, "featuresDisabled", 2);
6837
6896
  j([
6838
- v({ type: Boolean })
6897
+ x({ type: Boolean })
6839
6898
  ], R.prototype, "drawModeActive", 2);
6840
6899
  j([
6841
- v()
6900
+ x()
6842
6901
  ], R.prototype, "followingUserId", 2);
6843
6902
  j([
6844
- v()
6903
+ x()
6845
6904
  ], R.prototype, "display", 2);
6846
6905
  j([
6847
- w()
6906
+ $()
6848
6907
  ], R.prototype, "users", 2);
6849
6908
  j([
6850
- w()
6909
+ $()
6851
6910
  ], R.prototype, "unreadCount", 2);
6852
6911
  R = j([
6853
6912
  L("pulse-widget-toolbar")
6854
6913
  ], R);
6855
- class ys {
6914
+ class Es {
6856
6915
  constructor(e) {
6857
6916
  this.container = null, this.unsubs = [], this.enabled = !1, this.pillEls = /* @__PURE__ */ new Map(), this.client = e;
6858
6917
  }
@@ -6886,30 +6945,30 @@ class ys {
6886
6945
  var r;
6887
6946
  if (!this.container) return;
6888
6947
  if (document.documentElement.scrollHeight <= window.innerHeight) {
6889
- for (const l of this.pillEls.values()) l.remove();
6948
+ for (const a of this.pillEls.values()) a.remove();
6890
6949
  this.pillEls.clear();
6891
6950
  return;
6892
6951
  }
6893
6952
  const e = window.scrollY, t = window.innerHeight, i = document.documentElement.scrollHeight, s = (r = this.client.state.user) == null ? void 0 : r.id, o = /* @__PURE__ */ new Set();
6894
- for (const [l, a] of this.client.state.viewports) {
6895
- if (l === s) continue;
6896
- const c = a.scrollY, h = a.scrollY + a.viewportHeight, p = e, u = e + t;
6897
- if (c >= p && h <= u) {
6898
- const E = this.pillEls.get(l);
6953
+ for (const [a, l] of this.client.state.viewports) {
6954
+ if (a === s) continue;
6955
+ const d = l.scrollY, c = l.scrollY + l.viewportHeight, h = e, p = e + t;
6956
+ if (d >= h && c <= p) {
6957
+ const E = this.pillEls.get(a);
6899
6958
  E && (E.style.display = "none");
6900
6959
  continue;
6901
6960
  }
6902
- o.add(l);
6903
- const f = this.client.state.presence.find(
6904
- (E) => E.user.id === l
6961
+ o.add(a);
6962
+ const m = this.client.state.presence.find(
6963
+ (E) => E.user.id === a
6905
6964
  );
6906
- if (!f) continue;
6907
- const m = a.scrollY + a.viewportHeight / 2, x = i > 0 ? m / i : 0, b = Math.max(
6965
+ if (!m) continue;
6966
+ const g = l.scrollY + l.viewportHeight / 2, y = i > 0 ? g / i : 0, v = Math.max(
6908
6967
  8,
6909
- Math.min(t - 28, x * t)
6968
+ Math.min(t - 28, y * t)
6910
6969
  );
6911
- let y = this.pillEls.get(l);
6912
- y || (y = document.createElement("div"), Object.assign(y.style, {
6970
+ let w = this.pillEls.get(a);
6971
+ w || (w = document.createElement("div"), Object.assign(w.style, {
6913
6972
  position: "absolute",
6914
6973
  right: "8px",
6915
6974
  padding: "2px 6px",
@@ -6921,23 +6980,23 @@ class ys {
6921
6980
  whiteSpace: "nowrap",
6922
6981
  pointerEvents: "none",
6923
6982
  transition: "top 0.3s ease"
6924
- }), this.container.appendChild(y), this.pillEls.set(l, y)), y.style.display = "", y.style.background = f.user.color, y.style.top = `${b}px`, y.textContent = this.getInitials(f.user.name);
6983
+ }), this.container.appendChild(w), this.pillEls.set(a, w)), w.style.display = "", w.style.background = m.user.color, w.style.top = `${v}px`, w.textContent = this.getInitials(m.user.name);
6925
6984
  }
6926
- for (const [l, a] of this.pillEls)
6927
- !o.has(l) && !this.client.state.viewports.has(l) && (a.remove(), this.pillEls.delete(l));
6985
+ for (const [a, l] of this.pillEls)
6986
+ !o.has(a) && !this.client.state.viewports.has(a) && (l.remove(), this.pillEls.delete(a));
6928
6987
  }
6929
6988
  getInitials(e) {
6930
6989
  return e.split(" ").map((t) => t[0]).join("").toUpperCase().slice(0, 2);
6931
6990
  }
6932
6991
  }
6933
- var ws = Object.defineProperty, $s = Object.getOwnPropertyDescriptor, I = (n, e, t, i) => {
6934
- for (var s = i > 1 ? void 0 : i ? $s(e, t) : e, o = n.length - 1, r; o >= 0; o--)
6992
+ var Cs = Object.defineProperty, Ts = Object.getOwnPropertyDescriptor, _ = (n, e, t, i) => {
6993
+ for (var s = i > 1 ? void 0 : i ? Ts(e, t) : e, o = n.length - 1, r; o >= 0; o--)
6935
6994
  (r = n[o]) && (s = (i ? r(e, t, s) : r(s)) || s);
6936
- return i && s && ws(e, t, s), s;
6995
+ return i && s && Cs(e, t, s), s;
6937
6996
  };
6938
6997
  let T = class extends P {
6939
6998
  constructor() {
6940
- 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 = { ...we }, 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 = () => {
6999
+ 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 = { ...$e }, 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 = () => {
6941
7000
  !this.settings.enabled || !this.client || this._isFollowScrolling || (this.followingUserId && (this.followingUserId = null), !this._viewportThrottleTimer && (this._viewportThrottleTimer = setTimeout(() => {
6942
7001
  var n;
6943
7002
  this._viewportThrottleTimer = null, (n = this.client) == null || n.updateViewport({
@@ -6958,7 +7017,7 @@ let T = class extends P {
6958
7017
  (t = this.client) == null || t.updateSelection(null);
6959
7018
  return;
6960
7019
  }
6961
- const e = hs(n);
7020
+ const e = ms(n);
6962
7021
  (i = this.client) == null || i.updateSelection(e);
6963
7022
  }, 500));
6964
7023
  }, this.handleDocumentClick = (n) => {
@@ -6990,11 +7049,11 @@ let T = class extends P {
6990
7049
  room: this.room,
6991
7050
  endpoint: this.endpoint
6992
7051
  };
6993
- this.client = new wt(n), this.clientConfigKey = this.getConfigKey(), this.cursorOverlay = new cs(this.client), this.commentPins = new es(this.client, {
7052
+ this.client = new $t(n), this.clientConfigKey = this.getConfigKey(), this.cursorOverlay = new us(this.client), this.commentPins = new ns(this.client, {
6994
7053
  onPinModeExit: () => {
6995
7054
  this.pinModeActive = !1;
6996
7055
  }
6997
- }), this.viewportOverlay = new ys(this.client), this.selectionOverlay = new us(this.client), this.drawingOverlay = new ds(this.client), this.settings = gs(this.room), this.applySettings(this.settings), this.unsubs.push(
7056
+ }), this.viewportOverlay = new Es(this.client), this.selectionOverlay = new bs(this.client), this.drawingOverlay = new fs(this.client), this.settings = ys(this.room), this.applySettings(this.settings), this.unsubs.push(
6998
7057
  this.client.on("connection", (e) => {
6999
7058
  this.connectionState = e, e === "connected" && this._wasDisconnected ? (this.showConnectedFlash = !0, this._connectedFlashTimer && clearTimeout(this._connectedFlashTimer), this._connectedFlashTimer = setTimeout(() => {
7000
7059
  this.showConnectedFlash = !1, this._connectedFlashTimer = null;
@@ -7061,15 +7120,15 @@ let T = class extends P {
7061
7120
  }
7062
7121
  handleSettingsChange(n) {
7063
7122
  const e = n.detail;
7064
- this.settings = e, bs(this.room, e), this.applySettings(e);
7123
+ this.settings = e, ws(this.room, e), this.applySettings(e);
7065
7124
  }
7066
7125
  applySettings(n) {
7067
- var e, t, i, s, o, r, l, a, c, h, p, u, f, m, x, b, y;
7126
+ var e, t, i, s, o, r, a, l, d, c, h, p, m, g, y, v, w;
7068
7127
  if (!n.enabled) {
7069
- (e = this.cursorOverlay) == null || e.disable(), (t = this.viewportOverlay) == null || t.disable(), (i = this.selectionOverlay) == null || i.disable(), (s = this.drawingOverlay) == null || s.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;
7128
+ (e = this.cursorOverlay) == null || e.disable(), (t = this.viewportOverlay) == null || t.disable(), (i = this.selectionOverlay) == null || i.disable(), (s = this.drawingOverlay) == null || s.disable(), this.drawModeActive && ((o = this.drawingOverlay) == null || o.disableDrawMode(), this.drawModeActive = !1), (r = this.client) == null || r.setAppearOffline(!0), (a = this.commentPins) == null || a.setVisible(!1), this.followingUserId = null, this.pinModeActive && ((l = this.commentPins) == null || l.exitPinMode(), this.pinModeActive = !1), this.activePanel = this.activePanel === "settings" ? "settings" : null, this.highlightThreadId = null;
7070
7129
  return;
7071
7130
  }
7072
- this.applyCursorSettings(n), (c = this.client) == null || c.setAppearOffline(n.appearOffline), (h = this.commentPins) == null || h.setVisible(n.showCommentPins), n.showViewportIndicators ? (p = this.viewportOverlay) == null || p.enable() : (u = this.viewportOverlay) == null || u.disable(), n.showSelections ? (f = this.selectionOverlay) == null || f.enable() : (m = this.selectionOverlay) == null || m.disable(), n.showDrawings ? (x = this.drawingOverlay) == null || x.enable() : ((b = this.drawingOverlay) == null || b.disable(), this.drawModeActive && ((y = this.drawingOverlay) == null || y.disableDrawMode(), this.drawModeActive = !1));
7131
+ this.applyCursorSettings(n), (d = this.client) == null || d.setAppearOffline(n.appearOffline), (c = this.commentPins) == null || c.setVisible(n.showCommentPins), n.showViewportIndicators ? (h = this.viewportOverlay) == null || h.enable() : (p = this.viewportOverlay) == null || p.disable(), n.showSelections ? (m = this.selectionOverlay) == null || m.enable() : (g = this.selectionOverlay) == null || g.disable(), n.showDrawings ? (y = this.drawingOverlay) == null || y.enable() : ((v = this.drawingOverlay) == null || v.disable(), this.drawModeActive && ((w = this.drawingOverlay) == null || w.disableDrawMode(), this.drawModeActive = !1));
7073
7132
  }
7074
7133
  applyCursorSettings(n) {
7075
7134
  if (!this.cursorOverlay) return;
@@ -7083,30 +7142,30 @@ let T = class extends P {
7083
7142
  * the trigger element, flipping vertically/horizontally as needed.
7084
7143
  */
7085
7144
  positionPopups() {
7086
- var m, x, b, y;
7087
- const n = this.display === "inline", e = (m = this.shadowRoot) == null ? void 0 : m.querySelector(".inline-trigger"), t = (x = this.shadowRoot) == null ? void 0 : x.querySelector("pulse-widget-toolbar"), i = n ? e : t;
7145
+ var g, y, v, w;
7146
+ const n = this.display === "inline", e = (g = this.shadowRoot) == null ? void 0 : g.querySelector(".inline-trigger"), t = (y = this.shadowRoot) == null ? void 0 : y.querySelector("pulse-widget-toolbar"), i = n ? e : t;
7088
7147
  if (!i) return;
7089
- const s = i.getBoundingClientRect(), o = window.innerWidth, r = window.innerHeight, l = 8, a = (b = this.shadowRoot) == null ? void 0 : b.querySelector(".toolbar-popover");
7090
- if (a) {
7091
- Object.assign(a.style, { top: "auto", left: "auto" });
7092
- const E = a.getBoundingClientRect(), M = this.computePosition(s, E, o, r, l);
7093
- a.style.top = `${M.top}px`, a.style.left = `${M.left}px`;
7094
- }
7095
- const c = (y = this.shadowRoot) == null ? void 0 : y.querySelector(".panel-container");
7148
+ const s = i.getBoundingClientRect(), o = window.innerWidth, r = window.innerHeight, a = 8, l = (v = this.shadowRoot) == null ? void 0 : v.querySelector(".toolbar-popover");
7149
+ if (l) {
7150
+ Object.assign(l.style, { top: "auto", left: "auto" });
7151
+ const E = l.getBoundingClientRect(), I = this.computePosition(s, E, o, r, a);
7152
+ l.style.top = `${I.top}px`, l.style.left = `${I.left}px`;
7153
+ }
7154
+ const d = (w = this.shadowRoot) == null ? void 0 : w.querySelector(".panel-container");
7155
+ if (!d) return;
7156
+ Object.assign(d.style, { top: "auto", left: "auto" });
7157
+ const c = l ?? t;
7096
7158
  if (!c) return;
7097
- Object.assign(c.style, { top: "auto", left: "auto" });
7098
- const h = a ?? t;
7099
- if (!h) return;
7100
- const p = h.getBoundingClientRect(), u = c.getBoundingClientRect(), f = this.computePosition(p, u, o, r, l);
7101
- c.style.top = `${f.top}px`, c.style.left = `${f.left}px`;
7159
+ const h = c.getBoundingClientRect(), p = d.getBoundingClientRect(), m = this.computePosition(h, p, o, r, a);
7160
+ d.style.top = `${m.top}px`, d.style.left = `${m.left}px`;
7102
7161
  }
7103
7162
  computePosition(n, e, t, i, s) {
7104
7163
  const o = n.top, r = i - n.bottom;
7105
- let l;
7106
- o >= e.height + s ? l = n.top - e.height - s : r >= e.height + s ? l = n.bottom + s : l = o >= r ? Math.max(s, n.top - e.height - s) : n.bottom + s;
7107
7164
  let a;
7108
- const c = n.right - e.width;
7109
- return c >= s ? a = c : n.left + e.width + s <= t ? a = n.left : a = Math.max(s, Math.min(t - e.width - s, n.left)), l = Math.max(s, Math.min(i - e.height - s, l)), a = Math.max(s, Math.min(t - e.width - s, a)), { top: l, left: a };
7165
+ o >= e.height + s ? a = n.top - e.height - s : r >= e.height + s ? a = n.bottom + s : a = o >= r ? Math.max(s, n.top - e.height - s) : n.bottom + s;
7166
+ let l;
7167
+ const d = n.right - e.width;
7168
+ return d >= s ? l = d : n.left + e.width + s <= t ? l = n.left : l = Math.max(s, Math.min(t - e.width - s, n.left)), a = Math.max(s, Math.min(i - e.height - s, a)), l = Math.max(s, Math.min(t - e.width - s, l)), { top: a, left: l };
7110
7169
  }
7111
7170
  getFollowUserName() {
7112
7171
  var e;
@@ -7117,13 +7176,13 @@ let T = class extends P {
7117
7176
  return (n == null ? void 0 : n.user.name) ?? "user";
7118
7177
  }
7119
7178
  renderConnectionBanner() {
7120
- return this.showConnectedFlash ? d`<div class="connection-banner connected">
7179
+ return this.showConnectedFlash ? u`<div class="connection-banner connected">
7121
7180
  <span class="connection-dot"></span>Connected
7122
- </div>` : this.connectionState === "connecting" ? d`<div class="connection-banner connecting">
7181
+ </div>` : this.connectionState === "connecting" ? u`<div class="connection-banner connecting">
7123
7182
  <span class="connection-dot"></span>Reconnecting...
7124
- </div>` : this.connectionState === "disconnected" && this.client ? d`<div class="connection-banner disconnected">
7183
+ </div>` : this.connectionState === "disconnected" && this.client ? u`<div class="connection-banner disconnected">
7125
7184
  <span class="connection-dot"></span>Disconnected
7126
- </div>` : g;
7185
+ </div>` : b;
7127
7186
  }
7128
7187
  handleToolbarToggle() {
7129
7188
  this.collapsed = !this.collapsed, this.collapsed && (this.activePanel = null, this.highlightThreadId = null);
@@ -7131,38 +7190,38 @@ let T = class extends P {
7131
7190
  render() {
7132
7191
  const n = this.display === "inline";
7133
7192
  if (n && this.collapsed)
7134
- return d`
7193
+ return u`
7135
7194
  <div class="widget-root">
7136
7195
  <div class="inline-trigger" @click=${this.handleToolbarToggle}>
7137
7196
  <slot>Collaborate</slot>
7138
7197
  </div>
7139
7198
  </div>
7140
7199
  `;
7141
- const e = this.activePanel ? d`
7200
+ const e = this.activePanel ? u`
7142
7201
  <div class="panel-container anchored" @panel-close=${this.handlePanelClose}>
7143
- ${this.activePanel === "comments" ? d`<pulse-widget-comments-panel
7202
+ ${this.activePanel === "comments" ? u`<pulse-widget-comments-panel
7144
7203
  .client=${this.client}
7145
7204
  .highlightThreadId=${this.highlightThreadId}
7146
- ></pulse-widget-comments-panel>` : g}
7147
- ${this.activePanel === "settings" ? d`<pulse-widget-settings-panel
7205
+ ></pulse-widget-comments-panel>` : b}
7206
+ ${this.activePanel === "settings" ? u`<pulse-widget-settings-panel
7148
7207
  .settings=${this.settings}
7149
7208
  .roomId=${this.room}
7150
7209
  @settings-change=${this.handleSettingsChange}
7151
- ></pulse-widget-settings-panel>` : g}
7152
- ${this.activePanel === "notifications" ? d`<pulse-widget-notifications-panel
7210
+ ></pulse-widget-settings-panel>` : b}
7211
+ ${this.activePanel === "notifications" ? u`<pulse-widget-notifications-panel
7153
7212
  .client=${this.client}
7154
- ></pulse-widget-notifications-panel>` : g}
7155
- ${this.activePanel === "activity" ? d`<pulse-widget-activity-panel
7213
+ ></pulse-widget-notifications-panel>` : b}
7214
+ ${this.activePanel === "activity" ? u`<pulse-widget-activity-panel
7156
7215
  .client=${this.client}
7157
- ></pulse-widget-activity-panel>` : g}
7216
+ ></pulse-widget-activity-panel>` : b}
7158
7217
  </div>
7159
- ` : g, t = this.followingUserId ? d`<div class="follow-banner">
7218
+ ` : b, t = this.followingUserId ? u`<div class="follow-banner">
7160
7219
  Following ${this.getFollowUserName()}
7161
7220
  <button @click=${() => {
7162
7221
  this.followingUserId = null;
7163
7222
  }}>Stop</button>
7164
- </div>` : g;
7165
- return n ? d`
7223
+ </div>` : b;
7224
+ return n ? u`
7166
7225
  ${t}
7167
7226
  <div class="widget-root">
7168
7227
  <div class="inline-trigger" @click=${this.handleToolbarToggle}>
@@ -7186,7 +7245,7 @@ let T = class extends P {
7186
7245
  </div>
7187
7246
  ${e}
7188
7247
  </div>
7189
- ` : d`
7248
+ ` : u`
7190
7249
  ${t}
7191
7250
  <div class="widget-root">
7192
7251
  ${e}
@@ -7209,8 +7268,8 @@ let T = class extends P {
7209
7268
  }
7210
7269
  };
7211
7270
  T.styles = [
7212
- te,
7213
- O`
7271
+ ie,
7272
+ M`
7214
7273
  :host {
7215
7274
  display: block;
7216
7275
  }
@@ -7386,60 +7445,60 @@ T.styles = [
7386
7445
  }
7387
7446
  `
7388
7447
  ];
7389
- I([
7390
- v({ attribute: "api-key" })
7448
+ _([
7449
+ x({ attribute: "api-key" })
7391
7450
  ], T.prototype, "apiKey", 2);
7392
- I([
7393
- v()
7451
+ _([
7452
+ x()
7394
7453
  ], T.prototype, "token", 2);
7395
- I([
7396
- v()
7454
+ _([
7455
+ x()
7397
7456
  ], T.prototype, "room", 2);
7398
- I([
7399
- v()
7457
+ _([
7458
+ x()
7400
7459
  ], T.prototype, "endpoint", 2);
7401
- I([
7402
- v({ reflect: !0 })
7460
+ _([
7461
+ x({ reflect: !0 })
7403
7462
  ], T.prototype, "position", 2);
7404
- I([
7405
- v({ reflect: !0 })
7463
+ _([
7464
+ x({ reflect: !0 })
7406
7465
  ], T.prototype, "display", 2);
7407
- I([
7408
- w()
7466
+ _([
7467
+ $()
7409
7468
  ], T.prototype, "collapsed", 2);
7410
- I([
7411
- w()
7469
+ _([
7470
+ $()
7412
7471
  ], T.prototype, "activePanel", 2);
7413
- I([
7414
- w()
7472
+ _([
7473
+ $()
7415
7474
  ], T.prototype, "pinModeActive", 2);
7416
- I([
7417
- w()
7475
+ _([
7476
+ $()
7418
7477
  ], T.prototype, "highlightThreadId", 2);
7419
- I([
7420
- w()
7478
+ _([
7479
+ $()
7421
7480
  ], T.prototype, "settings", 2);
7422
- I([
7423
- w()
7481
+ _([
7482
+ $()
7424
7483
  ], T.prototype, "followingUserId", 2);
7425
- I([
7426
- w()
7484
+ _([
7485
+ $()
7427
7486
  ], T.prototype, "drawModeActive", 2);
7428
- I([
7429
- w()
7487
+ _([
7488
+ $()
7430
7489
  ], T.prototype, "connectionState", 2);
7431
- I([
7432
- w()
7490
+ _([
7491
+ $()
7433
7492
  ], T.prototype, "showConnectedFlash", 2);
7434
- T = I([
7493
+ T = _([
7435
7494
  L("pulse-widget")
7436
7495
  ], T);
7437
7496
  export {
7438
- X as PulseComments,
7439
- ce as PulseCursors,
7440
- de as PulseNotifications,
7497
+ Y as PulseComments,
7498
+ de as PulseCursors,
7499
+ he as PulseNotifications,
7441
7500
  Z as PulsePresence,
7442
- W as PulseProvider,
7443
- H as PulseReactions,
7501
+ X as PulseProvider,
7502
+ B as PulseReactions,
7444
7503
  T as PulseWidget
7445
7504
  };