@pixelmatters/markup 1.27.1 → 1.27.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/widget.js CHANGED
@@ -4941,29 +4941,85 @@ var pc = {
4941
4941
  "--markup-pop-leave": "140ms",
4942
4942
  "--markup-menu-leave": "120ms",
4943
4943
  "--markup-lightbox-leave": "160ms"
4944
- };
4944
+ }, mc = /* @__PURE__ */ new Set([
4945
+ "pointerdown",
4946
+ "mousedown",
4947
+ "touchstart"
4948
+ ]), hc = /* @__PURE__ */ new Set([
4949
+ "pointerup",
4950
+ "mouseup",
4951
+ "touchend"
4952
+ ]), gc = [
4953
+ ...mc,
4954
+ ...hc,
4955
+ "click"
4956
+ ], _c = ".markup-tb-btn", vc = /* @__PURE__ */ new WeakSet();
4957
+ function yc(e) {
4958
+ let t = !1;
4959
+ function n(n) {
4960
+ let r = n.composedPath()[0], i = r instanceof Element ? r.closest(_c) : null, a = i !== null && e.contains(i);
4961
+ if (mc.has(n.type) && (t = a), !(!a || hc.has(n.type) && !t) && (n.stopPropagation(), n.type === "mousedown" && n.preventDefault(), n.type === "click" && n instanceof MouseEvent)) {
4962
+ let e = xc(n);
4963
+ vc.add(e), r?.dispatchEvent(e);
4964
+ }
4965
+ }
4966
+ let r = { capture: !0 };
4967
+ for (let e of gc) window.addEventListener(e, n, r);
4968
+ return () => {
4969
+ for (let e of gc) window.removeEventListener(e, n, r);
4970
+ };
4971
+ }
4972
+ function bc(e, t) {
4973
+ let n = e.getRootNode(), r = (e) => {
4974
+ vc.has(e) && t(e);
4975
+ };
4976
+ return document.addEventListener("click", t, !0), n instanceof ShadowRoot && n.addEventListener("click", r, !0), () => {
4977
+ document.removeEventListener("click", t, !0), n instanceof ShadowRoot && n.removeEventListener("click", r, !0);
4978
+ };
4979
+ }
4980
+ function xc(e) {
4981
+ return new MouseEvent(e.type, {
4982
+ bubbles: !0,
4983
+ cancelable: !0,
4984
+ composed: !1,
4985
+ view: e.view,
4986
+ detail: e.detail,
4987
+ screenX: e.screenX,
4988
+ screenY: e.screenY,
4989
+ clientX: e.clientX,
4990
+ clientY: e.clientY,
4991
+ ctrlKey: e.ctrlKey,
4992
+ shiftKey: e.shiftKey,
4993
+ altKey: e.altKey,
4994
+ metaKey: e.metaKey,
4995
+ button: e.button,
4996
+ buttons: e.buttons
4997
+ });
4998
+ }
4945
4999
  //#endregion
4946
5000
  //#region src/runtime/ui/identity-menu.tsx
4947
- function mc({ identity: e, position: t, isSigningIn: n, isSigningOut: r, dashboardUrl: i, commentAccess: a = "anyone", onSignIn: o, onSignOut: s, onForgetMe: c }) {
5001
+ function Sc({ identity: e, position: t, isSigningIn: n, isSigningOut: r, dashboardUrl: i, commentAccess: a = "anyone", onSignIn: o, onSignOut: s, onForgetMe: c }) {
4948
5002
  let [l, u] = B(!1), d = ei(l || null, 140), f = d?.isLeaving ?? !1, [p, m] = B(!1), [h, g] = B(!1), _ = U(null);
4949
5003
  V(() => {
4950
5004
  if (!l) return;
4951
- function e(e) {
4952
- let t = _.current;
4953
- t && (e.composedPath().includes(t) || u(!1));
4954
- }
4955
- function t(e) {
5005
+ let e = _.current;
5006
+ if (!e) return;
5007
+ let t = (t) => {
5008
+ t.composedPath().includes(e) || u(!1);
5009
+ };
5010
+ function n(e) {
4956
5011
  e.key === "Escape" && u(!1);
4957
5012
  }
4958
- return document.addEventListener("click", e, !0), document.addEventListener("keydown", t), () => {
4959
- document.removeEventListener("click", e, !0), document.removeEventListener("keydown", t);
5013
+ let r = bc(e, t);
5014
+ return document.addEventListener("keydown", n), () => {
5015
+ r(), document.removeEventListener("keydown", n);
4960
5016
  };
4961
5017
  }, [l]);
4962
5018
  let v = d != null;
4963
5019
  V(() => {
4964
5020
  v || (m(!1), g(!1));
4965
5021
  }, [v]);
4966
- let y = aa(e), b = hc(y), x = e.kind === "verified", C = e.kind === "verified" ? e.identity.image : void 0, [w, ee] = B(null), T = x && C != null && w !== C, E = x ? e.identity.email : null, D = t === "bottom-left" ? "is-anchor-left" : t === "bottom-center" ? "is-anchor-center" : "is-anchor-right";
5022
+ let y = aa(e), b = Cc(y), x = e.kind === "verified", C = e.kind === "verified" ? e.identity.image : void 0, [w, ee] = B(null), T = x && C != null && w !== C, E = x ? e.identity.email : null, D = t === "bottom-left" ? "is-anchor-left" : t === "bottom-center" ? "is-anchor-center" : "is-anchor-right";
4967
5023
  return /* @__PURE__ */ Q("div", {
4968
5024
  ref: _,
4969
5025
  style: {
@@ -5084,12 +5140,12 @@ function mc({ identity: e, position: t, isSigningIn: n, isSigningOut: r, dashboa
5084
5140
  }) : null]
5085
5141
  });
5086
5142
  }
5087
- function hc(e) {
5143
+ function Cc(e) {
5088
5144
  return e && e.trim().split(/\s+/).slice(0, 2).map((e) => e[0]?.toUpperCase() ?? "").join("") || null;
5089
5145
  }
5090
5146
  //#endregion
5091
5147
  //#region src/runtime/use-drag.ts
5092
- function gc(e) {
5148
+ function wc(e) {
5093
5149
  let t = U(e);
5094
5150
  H(() => {
5095
5151
  t.current = e;
@@ -5119,8 +5175,8 @@ function gc(e) {
5119
5175
  h = !0, r(!0), t.current.onStart?.();
5120
5176
  }
5121
5177
  let a = Math.max(p, window.innerWidth - u - p), _ = Math.max(p, window.innerHeight - d - p), v = {
5122
- left: _c(c + n, p, a),
5123
- top: _c(l + i, p, _)
5178
+ left: Tc(c + n, p, a),
5179
+ top: Tc(l + i, p, _)
5124
5180
  };
5125
5181
  g = v, t.current.onMove(v);
5126
5182
  }
@@ -5135,12 +5191,12 @@ function gc(e) {
5135
5191
  isDragging: n
5136
5192
  };
5137
5193
  }
5138
- function _c(e, t, n) {
5194
+ function Tc(e, t, n) {
5139
5195
  return Math.max(t, Math.min(n, e));
5140
5196
  }
5141
5197
  //#endregion
5142
5198
  //#region src/runtime/use-focus-trap.ts
5143
- var vc = [
5199
+ var Ec = [
5144
5200
  "a[href]",
5145
5201
  "button:not([disabled])",
5146
5202
  "input:not([disabled])",
@@ -5148,14 +5204,14 @@ var vc = [
5148
5204
  "textarea:not([disabled])",
5149
5205
  "[tabindex]:not([tabindex=\"-1\"])"
5150
5206
  ].join(",");
5151
- function yc(e, t) {
5207
+ function Dc(e, t) {
5152
5208
  V(() => {
5153
5209
  if (!t) return;
5154
5210
  let n = e.current;
5155
5211
  if (!n) return;
5156
5212
  function r(e) {
5157
5213
  if (e.key !== "Tab") return;
5158
- let t = Array.from(n.querySelectorAll(vc)), r = t[0], i = t[t.length - 1];
5214
+ let t = Array.from(n.querySelectorAll(Ec)), r = t[0], i = t[t.length - 1];
5159
5215
  if (!r || !i) return;
5160
5216
  let a = n.getRootNode(), o = a instanceof ShadowRoot ? a.activeElement : document.activeElement;
5161
5217
  (e.shiftKey ? o === r : o === i) && (e.preventDefault(), (e.shiftKey ? i : r).focus());
@@ -5165,7 +5221,7 @@ function yc(e, t) {
5165
5221
  }
5166
5222
  //#endregion
5167
5223
  //#region src/runtime/use-object-url.ts
5168
- function bc(e) {
5224
+ function Oc(e) {
5169
5225
  let [t, n] = B(null);
5170
5226
  return V(() => {
5171
5227
  if (!e) {
@@ -5178,7 +5234,7 @@ function bc(e) {
5178
5234
  }
5179
5235
  //#endregion
5180
5236
  //#region src/runtime/ui/author-prompt.tsx
5181
- function xc({ mode: e = "guest-or-sign-in", isPending: t, isConnecting: n = !1, isSigningIn: r = !1, onSubmit: i, onCancel: a, onSignIn: o, onSignOut: s }) {
5237
+ function kc({ mode: e = "guest-or-sign-in", isPending: t, isConnecting: n = !1, isSigningIn: r = !1, onSubmit: i, onCancel: a, onSignIn: o, onSignOut: s }) {
5182
5238
  let [c, l] = B(""), [u, d] = B(""), f = U(null);
5183
5239
  V(() => {
5184
5240
  f.current?.focus();
@@ -5312,27 +5368,27 @@ function xc({ mode: e = "guest-or-sign-in", isPending: t, isConnecting: n = !1,
5312
5368
  }
5313
5369
  //#endregion
5314
5370
  //#region src/runtime/mention-input.ts
5315
- var Sc = "data-markup-mention", Cc = "data-markup-mention-name", wc = /* @__PURE__ */ new Set([
5371
+ var Ac = "data-markup-mention", jc = "data-markup-mention-name", Mc = /* @__PURE__ */ new Set([
5316
5372
  "DIV",
5317
5373
  "P",
5318
5374
  "LI",
5319
5375
  "BLOCKQUOTE",
5320
5376
  "PRE"
5321
- ]), Tc = 3, Ec = 1;
5322
- function Dc(e) {
5377
+ ]), Nc = 3, Pc = 1;
5378
+ function Fc(e) {
5323
5379
  let t = "", n = (r) => {
5324
5380
  let i = r.childNodes;
5325
5381
  for (let a = 0; a < i.length; a++) {
5326
5382
  let o = i[a];
5327
5383
  if (!o) continue;
5328
- if (o.nodeType === Tc) {
5384
+ if (o.nodeType === Nc) {
5329
5385
  t += o.data;
5330
5386
  continue;
5331
5387
  }
5332
- if (o.nodeType !== Ec) continue;
5333
- let s = o, c = s.getAttribute(Sc);
5388
+ if (o.nodeType !== Pc) continue;
5389
+ let s = o, c = s.getAttribute(Ac);
5334
5390
  if (c) {
5335
- let e = Oc(s);
5391
+ let e = Ic(s);
5336
5392
  t += qr({
5337
5393
  userId: c,
5338
5394
  name: e
@@ -5343,77 +5399,77 @@ function Dc(e) {
5343
5399
  (r !== e || a !== i.length - 1) && (t += "\n");
5344
5400
  continue;
5345
5401
  }
5346
- wc.has(s.tagName) && t !== "" && !t.endsWith("\n") && (t += "\n"), n(s);
5402
+ Mc.has(s.tagName) && t !== "" && !t.endsWith("\n") && (t += "\n"), n(s);
5347
5403
  }
5348
5404
  };
5349
5405
  return n(e), t;
5350
5406
  }
5351
- function Oc(e) {
5352
- return e.getAttribute(Cc) || (e.textContent ?? "").replace(/^@/, "");
5407
+ function Ic(e) {
5408
+ return e.getAttribute(jc) || (e.textContent ?? "").replace(/^@/, "");
5353
5409
  }
5354
- function kc(e, t, n) {
5410
+ function Lc(e, t, n) {
5355
5411
  let r = e.createElement("span");
5356
- return r.className = n, r.setAttribute("contenteditable", "false"), r.setAttribute(Sc, t.userId), r.setAttribute(Cc, t.name), r.textContent = `@${t.name}`, r;
5412
+ return r.className = n, r.setAttribute("contenteditable", "false"), r.setAttribute(Ac, t.userId), r.setAttribute(jc, t.name), r.textContent = `@${t.name}`, r;
5357
5413
  }
5358
- function Ac(e, t, n) {
5414
+ function Rc(e, t, n) {
5359
5415
  let r = e.createDocumentFragment();
5360
5416
  for (let i of Wr(t)) {
5361
5417
  if (i.type === "text") {
5362
5418
  i.value && r.appendChild(e.createTextNode(i.value));
5363
5419
  continue;
5364
5420
  }
5365
- r.appendChild(kc(e, {
5421
+ r.appendChild(Lc(e, {
5366
5422
  userId: i.userId,
5367
5423
  name: i.name
5368
5424
  }, n));
5369
5425
  }
5370
5426
  return r;
5371
5427
  }
5372
- function jc(e) {
5428
+ function zc(e) {
5373
5429
  let t = e.getRootNode();
5374
5430
  return typeof t.getSelection == "function" ? t.getSelection() : e.ownerDocument.getSelection();
5375
5431
  }
5376
- function Mc(e) {
5377
- let t = jc(e);
5432
+ function Bc(e) {
5433
+ let t = zc(e);
5378
5434
  if (!t || t.rangeCount === 0 || !t.isCollapsed) return null;
5379
5435
  let n = t.focusNode;
5380
- return !n || n.nodeType !== Tc || !e.contains(n) || Nc(n, e) ? null : {
5436
+ return !n || n.nodeType !== Nc || !e.contains(n) || Vc(n, e) ? null : {
5381
5437
  node: n,
5382
5438
  offset: t.focusOffset
5383
5439
  };
5384
5440
  }
5385
- function Nc(e, t) {
5441
+ function Vc(e, t) {
5386
5442
  let n = e;
5387
5443
  for (; n && n !== t;) {
5388
- if (n.nodeType === Ec && n.hasAttribute("data-markup-mention")) return n;
5444
+ if (n.nodeType === Pc && n.hasAttribute("data-markup-mention")) return n;
5389
5445
  n = n.parentNode;
5390
5446
  }
5391
5447
  return null;
5392
5448
  }
5393
- function Pc(e) {
5394
- let t = jc(e);
5449
+ function Hc(e) {
5450
+ let t = zc(e);
5395
5451
  if (!t || t.rangeCount === 0 || !t.isCollapsed) return;
5396
5452
  let n = t.focusNode;
5397
5453
  if (!n || !e.contains(n)) return;
5398
- let r = Nc(n, e);
5454
+ let r = Vc(n, e);
5399
5455
  if (!r) return;
5400
5456
  let i = r.nextSibling;
5401
- (!i || i.nodeType !== Tc) && (i = e.ownerDocument.createTextNode(""), r.parentNode?.insertBefore(i, r.nextSibling)), Fc(e, i, 0);
5457
+ (!i || i.nodeType !== Nc) && (i = e.ownerDocument.createTextNode(""), r.parentNode?.insertBefore(i, r.nextSibling)), Uc(e, i, 0);
5402
5458
  }
5403
- function Fc(e, t, n) {
5404
- let r = jc(e);
5459
+ function Uc(e, t, n) {
5460
+ let r = zc(e);
5405
5461
  if (!r) return;
5406
5462
  let i = e.ownerDocument.createRange();
5407
5463
  i.setStart(t, n), i.collapse(!0), r.removeAllRanges(), r.addRange(i);
5408
5464
  }
5409
- function Ic(e) {
5465
+ function Wc(e) {
5410
5466
  let t = Kr(e.node.data, e.offset);
5411
5467
  return t ? {
5412
5468
  ...t,
5413
5469
  textNode: e.node
5414
5470
  } : null;
5415
5471
  }
5416
- function Lc(e, t, n, r) {
5472
+ function Gc(e, t, n, r) {
5417
5473
  if (qr(n) == null) return !1;
5418
5474
  let i = t.textNode;
5419
5475
  if (!e.contains(i)) return !1;
@@ -5421,31 +5477,31 @@ function Lc(e, t, n, r) {
5421
5477
  if (!a || t.caret > i.data.length) return !1;
5422
5478
  i.deleteData(t.at, t.caret - t.at);
5423
5479
  let o = i.splitText(t.at);
5424
- return a.insertBefore(kc(e.ownerDocument, n, r), o), o.data.startsWith(" ") || o.insertData(0, " "), Fc(e, o, 1), !0;
5480
+ return a.insertBefore(Lc(e.ownerDocument, n, r), o), o.data.startsWith(" ") || o.insertData(0, " "), Uc(e, o, 1), !0;
5425
5481
  }
5426
- function Rc(e, t) {
5427
- let n = jc(e);
5482
+ function Kc(e, t) {
5483
+ let n = zc(e);
5428
5484
  if (!n || n.rangeCount === 0) return;
5429
5485
  let r = n.getRangeAt(0);
5430
5486
  if (!e.contains(r.commonAncestorContainer)) return;
5431
5487
  r.deleteContents();
5432
5488
  let { startContainer: i, startOffset: a } = r;
5433
- if (i.nodeType === Tc) {
5489
+ if (i.nodeType === Nc) {
5434
5490
  let n = i;
5435
- n.insertData(a, t), Fc(e, n, a + t.length);
5491
+ n.insertData(a, t), Uc(e, n, a + t.length);
5436
5492
  return;
5437
5493
  }
5438
5494
  let o = e.ownerDocument.createTextNode(t);
5439
- r.insertNode(o), Fc(e, o, o.data.length);
5495
+ r.insertNode(o), Uc(e, o, o.data.length);
5440
5496
  }
5441
- function zc(e, t) {
5497
+ function qc(e, t) {
5442
5498
  let n = e.ownerDocument, r = null, i = null, a = !0;
5443
5499
  function o(t) {
5444
5500
  let n = t.length === 0;
5445
5501
  (n !== a || e.hasAttribute("data-empty") !== n) && (a = n, e.toggleAttribute("data-empty", n));
5446
5502
  }
5447
5503
  function s() {
5448
- let n = Dc(e);
5504
+ let n = Fc(e);
5449
5505
  o(n), t.onChange(n);
5450
5506
  }
5451
5507
  function c(e) {
@@ -5461,7 +5517,7 @@ function zc(e, t) {
5461
5517
  c(null);
5462
5518
  return;
5463
5519
  }
5464
- let n = Mc(e), r = n ? Ic(n) : null;
5520
+ let n = Bc(e), r = n ? Wc(n) : null;
5465
5521
  if (r && i && r.textNode === i.node && r.at === i.at) {
5466
5522
  c(null);
5467
5523
  return;
@@ -5469,29 +5525,29 @@ function zc(e, t) {
5469
5525
  i = null, c(r);
5470
5526
  }
5471
5527
  function u(r) {
5472
- e.replaceChildren(Ac(n, r, t.chipClass)), o(Dc(e)), i = null, c(null);
5528
+ e.replaceChildren(Rc(n, r, t.chipClass)), o(Fc(e)), i = null, c(null);
5473
5529
  }
5474
5530
  let d = () => {
5475
5531
  s(), l();
5476
5532
  }, f = () => l(), p = () => {
5477
- Pc(e), l();
5533
+ Hc(e), l();
5478
5534
  }, m = (t) => {
5479
5535
  let n = t.clipboardData?.getData("text/plain");
5480
- t.preventDefault(), n && (Rc(e, n.replace(/\r\n?/g, "\n")), s(), l());
5536
+ t.preventDefault(), n && (Kc(e, n.replace(/\r\n?/g, "\n")), s(), l());
5481
5537
  }, h = (e) => {
5482
5538
  e.preventDefault();
5483
5539
  };
5484
5540
  return e.addEventListener("input", d), e.addEventListener("keyup", f), e.addEventListener("mouseup", p), e.addEventListener("focus", p), e.addEventListener("paste", m), e.addEventListener("drop", h), u(t.initialValue ?? ""), {
5485
- getValue: () => Dc(e),
5541
+ getValue: () => Fc(e),
5486
5542
  setValue: u,
5487
5543
  focus() {
5488
5544
  e.focus();
5489
5545
  let t = e.lastChild;
5490
- t && (t.nodeType === Tc ? Fc(e, t, t.data.length) : Fc(e, e, e.childNodes.length));
5546
+ t && (t.nodeType === Nc ? Uc(e, t, t.data.length) : Uc(e, e, e.childNodes.length));
5491
5547
  },
5492
5548
  insertMention(n) {
5493
- let a = Mc(e), o = (a ? Ic(a) : null) ?? r;
5494
- o && Lc(e, o, n, t.chipClass) && (s(), i = null, c(null));
5549
+ let a = Bc(e), o = (a ? Wc(a) : null) ?? r;
5550
+ o && Gc(e, o, n, t.chipClass) && (s(), i = null, c(null));
5495
5551
  },
5496
5552
  syncTrigger: l,
5497
5553
  clearTrigger: () => c(null),
@@ -5506,42 +5562,42 @@ function zc(e, t) {
5506
5562
  }
5507
5563
  };
5508
5564
  }
5509
- var Bc = null;
5510
- function Vc() {
5511
- if (Bc) return Bc;
5565
+ var Jc = null;
5566
+ function Yc() {
5567
+ if (Jc) return Jc;
5512
5568
  if (typeof document > "u") return "true";
5513
5569
  let e = document.createElement("div");
5514
5570
  try {
5515
- e.contentEditable = "plaintext-only", Bc = e.contentEditable === "plaintext-only" ? "plaintext-only" : "true";
5571
+ e.contentEditable = "plaintext-only", Jc = e.contentEditable === "plaintext-only" ? "plaintext-only" : "true";
5516
5572
  } catch {
5517
- Bc = "true";
5573
+ Jc = "true";
5518
5574
  }
5519
- return Bc;
5575
+ return Jc;
5520
5576
  }
5521
5577
  //#endregion
5522
5578
  //#region src/lib/linkify.ts
5523
- var Hc = /(^|[\s([{<'"])((?:https?:\/\/|www\.)[^\s<>'"]+)/gi, Uc = ".,;:!?", Wc = {
5579
+ var Xc = /(^|[\s([{<'"])((?:https?:\/\/|www\.)[^\s<>'"]+)/gi, Zc = ".,;:!?", Qc = {
5524
5580
  ")": "(",
5525
5581
  "]": "[",
5526
5582
  "}": "{"
5527
5583
  };
5528
- function Gc(e, t) {
5584
+ function $c(e, t) {
5529
5585
  let n = 0;
5530
5586
  for (let r of e) r === t && (n += 1);
5531
5587
  return n;
5532
5588
  }
5533
- function Kc(e) {
5589
+ function el(e) {
5534
5590
  let t = e.length;
5535
5591
  for (; t > 0;) {
5536
5592
  let n = e[t - 1] ?? "";
5537
- if (Uc.includes(n)) {
5593
+ if (Zc.includes(n)) {
5538
5594
  --t;
5539
5595
  continue;
5540
5596
  }
5541
- let r = Wc[n];
5597
+ let r = Qc[n];
5542
5598
  if (r !== void 0) {
5543
5599
  let i = e.slice(0, t);
5544
- if (Gc(i, n) > Gc(i, r)) {
5600
+ if ($c(i, n) > $c(i, r)) {
5545
5601
  --t;
5546
5602
  continue;
5547
5603
  }
@@ -5550,15 +5606,15 @@ function Kc(e) {
5550
5606
  }
5551
5607
  return e.slice(0, t);
5552
5608
  }
5553
- function qc(e) {
5609
+ function tl(e) {
5554
5610
  let t = /^https?:\/\//i.test(e) ? e : `https://${e}`, n = t.replace(/^https?:\/\//i, "").split(/[/?#]/, 1)[0] ?? "";
5555
5611
  return !n.includes(".") || n.startsWith(".") || n.endsWith(".") ? null : t;
5556
5612
  }
5557
- function Jc(e) {
5613
+ function nl(e) {
5558
5614
  if (!e) return [];
5559
- let t = [], n = 0, r = new RegExp(Hc.source, "gi");
5615
+ let t = [], n = 0, r = new RegExp(Xc.source, "gi");
5560
5616
  for (let i = r.exec(e); i !== null; i = r.exec(e)) {
5561
- let a = i[1] ?? "", o = Kc(i[2] ?? ""), s = o ? qc(o) : null;
5617
+ let a = i[1] ?? "", o = el(i[2] ?? ""), s = o ? tl(o) : null;
5562
5618
  if (!s) continue;
5563
5619
  let c = i.index + a.length;
5564
5620
  c > n && t.push({
@@ -5577,14 +5633,14 @@ function Jc(e) {
5577
5633
  }
5578
5634
  //#endregion
5579
5635
  //#region src/runtime/ui/mentions.tsx
5580
- function Yc({ body: e, mentions: t, trailing: n }) {
5636
+ function rl({ body: e, mentions: t, trailing: n }) {
5581
5637
  let r = rt(() => new Set(t), [t]);
5582
5638
  return /* @__PURE__ */ Q("p", {
5583
5639
  class: "markup-comment-body",
5584
5640
  children: [rt(() => Wr(e), [e]).map((e, t) => e.type === "mention" ? r.has(e.userId) ? /* @__PURE__ */ Q("span", {
5585
5641
  class: "markup-mention-chip",
5586
5642
  children: ["@", e.name]
5587
- }, t) : /* @__PURE__ */ Q("span", { children: ["@", e.name] }, t) : Jc(e.value).map((e, n) => e.type === "link" ? /* @__PURE__ */ Q("a", {
5643
+ }, t) : /* @__PURE__ */ Q("span", { children: ["@", e.name] }, t) : nl(e.value).map((e, n) => e.type === "link" ? /* @__PURE__ */ Q("a", {
5588
5644
  class: "markup-comment-link",
5589
5645
  href: e.href,
5590
5646
  target: "_blank",
@@ -5593,7 +5649,7 @@ function Yc({ body: e, mentions: t, trailing: n }) {
5593
5649
  }, `${t}-${n}`) : /* @__PURE__ */ Q("span", { children: e.value }, `${t}-${n}`))), n]
5594
5650
  });
5595
5651
  }
5596
- function Xc(e) {
5652
+ function il(e) {
5597
5653
  let { members: t, trigger: n, onSelect: r, onClose: i } = e, [a, o] = B(0), s = rt(() => {
5598
5654
  if (!n) return [];
5599
5655
  let e = n.query.toLowerCase();
@@ -5621,12 +5677,12 @@ function Xc(e) {
5621
5677
  handleKeyDown: c
5622
5678
  };
5623
5679
  }
5624
- function Zc({ items: e, highlight: t, setHighlight: n, onSelect: r, anchor: i }) {
5680
+ function al({ items: e, highlight: t, setHighlight: n, onSelect: r, anchor: i }) {
5625
5681
  let a = U(null);
5626
5682
  return H(() => {
5627
5683
  let e = null;
5628
5684
  function t() {
5629
- i.current && a.current && el(i.current, a.current);
5685
+ i.current && a.current && cl(i.current, a.current);
5630
5686
  }
5631
5687
  function n() {
5632
5688
  e ??= requestAnimationFrame(() => {
@@ -5668,16 +5724,16 @@ function Zc({ items: e, highlight: t, setHighlight: n, onSelect: r, anchor: i })
5668
5724
  }, e.userId))
5669
5725
  });
5670
5726
  }
5671
- var Qc = 4, $c = 8;
5672
- function el(e, t) {
5727
+ var ol = 4, sl = 8;
5728
+ function cl(e, t) {
5673
5729
  let n = e.getBoundingClientRect(), r = n.bottom > 0 && n.top < window.innerHeight && n.right > 0 && n.left < window.innerWidth;
5674
5730
  if (t.style.visibility = r ? "" : "hidden", !r) return;
5675
- let i = t.offsetHeight, a = n.top - $c, o = window.innerHeight - n.bottom - $c, s = a >= i + Qc || a >= o ? n.top - Qc - i : n.bottom + Qc, c = window.innerHeight - i - $c;
5676
- t.style.top = `${Math.max($c, Math.min(s, c))}px`, t.style.left = `${n.left}px`, t.style.width = `${n.width}px`;
5731
+ let i = t.offsetHeight, a = n.top - sl, o = window.innerHeight - n.bottom - sl, s = a >= i + ol || a >= o ? n.top - ol - i : n.bottom + ol, c = window.innerHeight - i - sl;
5732
+ t.style.top = `${Math.max(sl, Math.min(s, c))}px`, t.style.left = `${n.left}px`, t.style.width = `${n.width}px`;
5677
5733
  }
5678
5734
  //#endregion
5679
5735
  //#region src/runtime/ui/mention-input.tsx
5680
- function tl({ value: e, onChange: t, onKeyDown: n, members: r, label: i, placeholder: a, disabled: o = !1, autoFocus: s = !1, class: c, handle: l }) {
5736
+ function ll({ value: e, onChange: t, onKeyDown: n, members: r, label: i, placeholder: a, disabled: o = !1, autoFocus: s = !1, class: c, handle: l }) {
5681
5737
  let u = U(null), d = U(null), [f, p] = B(null), m = U(t), h = U(r);
5682
5738
  H(() => {
5683
5739
  m.current = t, h.current = r;
@@ -5686,7 +5742,7 @@ function tl({ value: e, onChange: t, onKeyDown: n, members: r, label: i, placeho
5686
5742
  H(() => {
5687
5743
  let e = u.current;
5688
5744
  if (!e) return;
5689
- let t = zc(e, {
5745
+ let t = qc(e, {
5690
5746
  chipClass: "markup-mention-chip",
5691
5747
  initialValue: g.current,
5692
5748
  onChange: (e) => m.current(e),
@@ -5706,7 +5762,7 @@ function tl({ value: e, onChange: t, onKeyDown: n, members: r, label: i, placeho
5706
5762
  let t = d.current;
5707
5763
  t && t.getValue() !== e && t.setValue(e);
5708
5764
  }, [e]);
5709
- let _ = Xc({
5765
+ let _ = il({
5710
5766
  members: r ?? [],
5711
5767
  trigger: f,
5712
5768
  onSelect: (e) => d.current?.insertMention(e),
@@ -5719,7 +5775,7 @@ function tl({ value: e, onChange: t, onKeyDown: n, members: r, label: i, placeho
5719
5775
  "aria-label": i,
5720
5776
  "aria-disabled": o || void 0,
5721
5777
  class: Z("markup-mention-input", c),
5722
- contentEditable: o ? "false" : Vc(),
5778
+ contentEditable: o ? "false" : Yc(),
5723
5779
  "data-placeholder": a,
5724
5780
  tabIndex: o ? -1 : 0,
5725
5781
  onKeyDown: (e) => {
@@ -5728,7 +5784,7 @@ function tl({ value: e, onChange: t, onKeyDown: n, members: r, label: i, placeho
5728
5784
  onBlur: () => {
5729
5785
  setTimeout(() => d.current?.clearTrigger(), 120);
5730
5786
  }
5731
- }), _.isOpen ? /* @__PURE__ */ Q(Zc, {
5787
+ }), _.isOpen ? /* @__PURE__ */ Q(al, {
5732
5788
  items: _.items,
5733
5789
  highlight: _.highlight,
5734
5790
  setHighlight: _.setHighlight,
@@ -5738,8 +5794,8 @@ function tl({ value: e, onChange: t, onKeyDown: n, members: r, label: i, placeho
5738
5794
  }
5739
5795
  //#endregion
5740
5796
  //#region src/runtime/ui/composer.tsx
5741
- var nl = 4e3;
5742
- function rl({ label: e, placeholder: t = "Leave feedback…", submitLabel: n = "Post", initialFocus: r = !0, isPending: i, error: a, onSubmit: o, onDirtyChange: s, members: c }) {
5797
+ var ul = 4e3;
5798
+ function dl({ label: e, placeholder: t = "Leave feedback…", submitLabel: n = "Post", initialFocus: r = !0, isPending: i, error: a, onSubmit: o, onDirtyChange: s, members: c }) {
5743
5799
  let [l, u] = B(""), d = U(null), f = U(!1);
5744
5800
  V(() => {
5745
5801
  f.current && !i && !a && (u(""), s?.(!1), d.current?.focus()), f.current = i;
@@ -5748,7 +5804,7 @@ function rl({ label: e, placeholder: t = "Leave feedback…", submitLabel: n = "
5748
5804
  a,
5749
5805
  s
5750
5806
  ]);
5751
- let p = nl - l.length, m = p < 0;
5807
+ let p = ul - l.length, m = p < 0;
5752
5808
  function h(e) {
5753
5809
  e?.preventDefault();
5754
5810
  let t = l.trim();
@@ -5773,7 +5829,7 @@ function rl({ label: e, placeholder: t = "Leave feedback…", submitLabel: n = "
5773
5829
  class: Z("markup-composer", _ && "is-filled"),
5774
5830
  onSubmit: h,
5775
5831
  children: [
5776
- /* @__PURE__ */ Q(tl, {
5832
+ /* @__PURE__ */ Q(ll, {
5777
5833
  class: "markup-composer-input",
5778
5834
  label: e,
5779
5835
  placeholder: t,
@@ -5829,17 +5885,17 @@ function rl({ label: e, placeholder: t = "Leave feedback…", submitLabel: n = "
5829
5885
  }
5830
5886
  //#endregion
5831
5887
  //#region src/runtime/ui/new-thread-popover.tsx
5832
- var il = [], al = "https://markup.pixelmatters.dev/docs/install#9-screenshots-privacy";
5833
- function ol({ pageX: e, pageY: t, authorName: n, authorPromptMode: r, isVerified: i, isIdentityResolving: a, isSigningIn: o, isPending: s, error: c, screenshot: l, isScreenshotCapturing: u, screenshotFailed: d, screenshotRedactedCount: f, screenshotRedactedSelectors: p, members: m = il, isLeaving: h = !1, onAuthor: g, onSignIn: _, onSignOut: v, onSubmit: y, onClose: b }) {
5888
+ var fl = [], pl = "https://markup.pixelmatters.dev/docs/install#9-screenshots-privacy";
5889
+ function ml({ pageX: e, pageY: t, authorName: n, authorPromptMode: r, isVerified: i, isIdentityResolving: a, isSigningIn: o, isPending: s, error: c, screenshot: l, isScreenshotCapturing: u, screenshotFailed: d, screenshotRedactedCount: f, screenshotRedactedSelectors: p, members: m = fl, isLeaving: h = !1, onAuthor: g, onSignIn: _, onSignOut: v, onSubmit: y, onClose: b }) {
5834
5890
  let x = U(null);
5835
- yc(x, !h);
5891
+ Dc(x, !h);
5836
5892
  let C = U(!1), w = U(!1), [ee, T] = B(!1), E = ei(ee || null, 120), D = W((e) => {
5837
5893
  w.current = e, T(e);
5838
5894
  }, []), te = W(() => {
5839
5895
  w.current || (C.current ? D(!0) : b());
5840
5896
  }, [b, D]), O = W(() => {
5841
5897
  D(!1), x.current?.querySelector(".markup-mention-input")?.focus();
5842
- }, [D]), [k, A] = B(!1), [j, M] = B(!1), N = bc(l), P = U(null), [ne, F] = B(null), { onPointerDown: re, isDragging: ie } = gc({
5898
+ }, [D]), [k, A] = B(!1), [j, M] = B(!1), N = Oc(l), P = U(null), [ne, F] = B(null), { onPointerDown: re, isDragging: ie } = wc({
5843
5899
  targetRef: x,
5844
5900
  shouldStart: (e) => !e.target?.closest("button, a, input, textarea, select"),
5845
5901
  onMove: F
@@ -5864,8 +5920,9 @@ function ol({ pageX: e, pageY: t, authorName: n, authorPromptMode: r, isVerified
5864
5920
  function n(e) {
5865
5921
  e.key !== "Escape" || e.defaultPrevented || P.current?.open || (e.preventDefault(), w.current ? O() : te());
5866
5922
  }
5867
- return document.addEventListener("click", t, !0), document.addEventListener("keydown", n), () => {
5868
- document.removeEventListener("click", t, !0), document.removeEventListener("keydown", n);
5923
+ let r = bc(e, t);
5924
+ return document.addEventListener("keydown", n), () => {
5925
+ r(), document.removeEventListener("keydown", n);
5869
5926
  };
5870
5927
  }, [
5871
5928
  te,
@@ -5874,7 +5931,7 @@ function ol({ pageX: e, pageY: t, authorName: n, authorPromptMode: r, isVerified
5874
5931
  ]), V(() => {
5875
5932
  ee && x.current?.querySelector(".markup-discard-confirm-keep")?.focus();
5876
5933
  }, [ee]);
5877
- let ae = sl(e - window.scrollX + 16, 12, window.innerWidth - 320 - 12), oe = sl(t - window.scrollY - 16, 12, window.innerHeight - 220), se = typeof window < "u" ? window.location.href : "", ce = l != null, le = u || ce || d, ue = k && ce;
5934
+ let ae = hl(e - window.scrollX + 16, 12, window.innerWidth - 320 - 12), oe = hl(t - window.scrollY - 16, 12, window.innerHeight - 220), se = typeof window < "u" ? window.location.href : "", ce = l != null, le = u || ce || d, ue = k && ce;
5878
5935
  return /* @__PURE__ */ Q("div", {
5879
5936
  ref: x,
5880
5937
  class: Z("markup-popover", ne && "is-floating", ie && "is-dragging", h && "is-leaving"),
@@ -5919,7 +5976,7 @@ function ol({ pageX: e, pageY: t, authorName: n, authorPromptMode: r, isVerified
5919
5976
  }) : null
5920
5977
  ]
5921
5978
  }),
5922
- /* @__PURE__ */ Q(rl, {
5979
+ /* @__PURE__ */ Q(dl, {
5923
5980
  label: "Feedback",
5924
5981
  placeholder: "What's wrong, missing, or worth noting?",
5925
5982
  submitLabel: "Post markup",
@@ -6011,7 +6068,7 @@ function ol({ pageX: e, pageY: t, authorName: n, authorPromptMode: r, isVerified
6011
6068
  " ",
6012
6069
  /* @__PURE__ */ Q("a", {
6013
6070
  class: "markup-screenshot-help-link",
6014
- href: al,
6071
+ href: pl,
6015
6072
  target: "_blank",
6016
6073
  rel: "noopener noreferrer",
6017
6074
  children: "More info here."
@@ -6020,7 +6077,7 @@ function ol({ pageX: e, pageY: t, authorName: n, authorPromptMode: r, isVerified
6020
6077
  })] }) : null]
6021
6078
  }) : null
6022
6079
  ]
6023
- }) : /* @__PURE__ */ Q(xc, {
6080
+ }) : /* @__PURE__ */ Q(kc, {
6024
6081
  mode: r,
6025
6082
  isPending: s,
6026
6083
  isConnecting: a,
@@ -6085,12 +6142,12 @@ function ol({ pageX: e, pageY: t, authorName: n, authorPromptMode: r, isVerified
6085
6142
  ]
6086
6143
  });
6087
6144
  }
6088
- function sl(e, t, n) {
6145
+ function hl(e, t, n) {
6089
6146
  return Math.max(t, Math.min(n, e));
6090
6147
  }
6091
6148
  //#endregion
6092
6149
  //#region src/runtime/ui/notifications-panel.tsx
6093
- function cl({ state: e, onBack: t, onItemClick: n, onMarkAllRead: r, isMarkingAll: i }) {
6150
+ function gl({ state: e, onBack: t, onItemClick: n, onMarkAllRead: r, isMarkingAll: i }) {
6094
6151
  let a = e.kind === "ready" && e.items.some((e) => e.readAt == null);
6095
6152
  return /* @__PURE__ */ Q("div", {
6096
6153
  class: "markup-notifications-panel",
@@ -6171,7 +6228,7 @@ function cl({ state: e, onBack: t, onItemClick: n, onMarkAllRead: r, isMarkingAl
6171
6228
  }),
6172
6229
  /* @__PURE__ */ Q("span", {
6173
6230
  class: "markup-notifications-panel-time",
6174
- children: ll(e.createdAt)
6231
+ children: _l(e.createdAt)
6175
6232
  })
6176
6233
  ]
6177
6234
  }),
@@ -6203,7 +6260,7 @@ function cl({ state: e, onBack: t, onItemClick: n, onMarkAllRead: r, isMarkingAl
6203
6260
  })]
6204
6261
  });
6205
6262
  }
6206
- function ll(e) {
6263
+ function _l(e) {
6207
6264
  let t = Date.now() - e, n = Math.floor(t / 1e3);
6208
6265
  if (n < 60) return "just now";
6209
6266
  let r = Math.floor(n / 60);
@@ -6215,7 +6272,7 @@ function ll(e) {
6215
6272
  }
6216
6273
  //#endregion
6217
6274
  //#region src/runtime/use-theme.ts
6218
- function ul() {
6275
+ function vl() {
6219
6276
  let [, e] = B(0);
6220
6277
  return V(() => He(() => e((e) => e + 1)), []), {
6221
6278
  mode: ze(),
@@ -6225,7 +6282,7 @@ function ul() {
6225
6282
  }
6226
6283
  //#endregion
6227
6284
  //#region src/runtime/ui/privacy-panel.tsx
6228
- function dl({ identity: e, apiUrl: t, commentAccess: n = "anyone", autoCapture: r, autoCaptureLocked: i, isForgettingMe: a, forgetMeError: o, onForgetMe: s, onBack: c }) {
6285
+ function yl({ identity: e, apiUrl: t, commentAccess: n = "anyone", autoCapture: r, autoCaptureLocked: i, isForgettingMe: a, forgetMeError: o, onForgetMe: s, onBack: c }) {
6229
6286
  let [l, u] = B(!1), d = aa(e), f = e.kind === "verified", p = f ? e.identity.email : void 0, m = e.kind === "anon";
6230
6287
  return /* @__PURE__ */ Q("div", {
6231
6288
  class: "markup-panel",
@@ -6327,7 +6384,7 @@ function dl({ identity: e, apiUrl: t, commentAccess: n = "anyone", autoCapture:
6327
6384
  "Only ",
6328
6385
  /* @__PURE__ */ Q("span", {
6329
6386
  class: "markup-panel-mono",
6330
- children: fl(t)
6387
+ children: bl(t)
6331
6388
  }),
6332
6389
  ". No analytics, no ad tech, no third-party requests from the widget. If the widget itself crashes it posts the error, this page's URL and your user-agent to that same host, never your identity or what you were writing."
6333
6390
  ]
@@ -6363,7 +6420,7 @@ function dl({ identity: e, apiUrl: t, commentAccess: n = "anyone", autoCapture:
6363
6420
  })]
6364
6421
  });
6365
6422
  }
6366
- function fl(e) {
6423
+ function bl(e) {
6367
6424
  try {
6368
6425
  return new URL(e).host;
6369
6426
  } catch {
@@ -6372,7 +6429,7 @@ function fl(e) {
6372
6429
  }
6373
6430
  //#endregion
6374
6431
  //#region src/runtime/ui/shortcuts-panel.tsx
6375
- function pl({ onBack: e }) {
6432
+ function xl({ onBack: e }) {
6376
6433
  let { mod: t, enter: n } = Vs();
6377
6434
  return /* @__PURE__ */ Q("div", {
6378
6435
  class: "markup-panel",
@@ -6469,15 +6526,15 @@ function pl({ onBack: e }) {
6469
6526
  }
6470
6527
  //#endregion
6471
6528
  //#region src/runtime/ui/overflow-menu.tsx
6472
- var ml = {
6529
+ var Sl = {
6473
6530
  menu: "More options",
6474
6531
  privacy: "Privacy and data",
6475
6532
  shortcuts: "Keyboard shortcuts"
6476
6533
  };
6477
- function hl({ position: e, onSetPosition: t, autoCapture: n, autoCaptureLocked: r = !1, onToggleAutoCapture: i, showResolved: a, onToggleShowResolved: o, isUrlScoped: s, hiddenByUrlScope: c, onToggleUrlScope: l, onHideForSession: u, identity: d, apiUrl: f, commentAccess: p, isForgettingMe: m, forgetMeError: h, onForgetMe: g, version: _, dashboardUrl: v }) {
6534
+ function Cl({ position: e, onSetPosition: t, autoCapture: n, autoCaptureLocked: r = !1, onToggleAutoCapture: i, showResolved: a, onToggleShowResolved: o, isUrlScoped: s, hiddenByUrlScope: c, onToggleUrlScope: l, onHideForSession: u, identity: d, apiUrl: f, commentAccess: p, isForgettingMe: m, forgetMeError: h, onForgetMe: g, version: _, dashboardUrl: v }) {
6478
6535
  let [y, b] = B(!1), [x, S] = B("menu"), C = ei(y || null, 140), w = C?.isLeaving ?? !1, ee = U(null), T = U(null), E = U(null), D = U(null), te = U("menu"), O = U(null), k = U(x);
6479
6536
  k.current = x;
6480
- let A = ul();
6537
+ let A = vl();
6481
6538
  V(() => {
6482
6539
  y && (S("menu"), te.current = "menu");
6483
6540
  }, [y]), H(() => {
@@ -6502,11 +6559,12 @@ function hl({ position: e, onSetPosition: t, autoCapture: n, autoCaptureLocked:
6502
6559
  };
6503
6560
  }, [x]), V(() => {
6504
6561
  if (!y) return;
6505
- function e(e) {
6506
- let t = ee.current;
6507
- t && (e.composedPath().includes(t) || b(!1));
6508
- }
6509
- function t(e) {
6562
+ let e = ee.current;
6563
+ if (!e) return;
6564
+ let t = (t) => {
6565
+ t.composedPath().includes(e) || b(!1);
6566
+ };
6567
+ function n(e) {
6510
6568
  if (e.key === "Escape") {
6511
6569
  if (k.current !== "menu") {
6512
6570
  j("menu");
@@ -6515,8 +6573,9 @@ function hl({ position: e, onSetPosition: t, autoCapture: n, autoCaptureLocked:
6515
6573
  b(!1);
6516
6574
  }
6517
6575
  }
6518
- return document.addEventListener("click", e, !0), document.addEventListener("keydown", t), () => {
6519
- document.removeEventListener("click", e, !0), document.removeEventListener("keydown", t);
6576
+ let r = bc(e, t);
6577
+ return document.addEventListener("keydown", n), () => {
6578
+ r(), document.removeEventListener("keydown", n);
6520
6579
  };
6521
6580
  }, [y]);
6522
6581
  function j(e) {
@@ -6553,10 +6612,10 @@ function hl({ position: e, onSetPosition: t, autoCapture: n, autoCaptureLocked:
6553
6612
  "data-pop": "overflow",
6554
6613
  "data-view": x,
6555
6614
  role: "dialog",
6556
- "aria-label": ml[x],
6615
+ "aria-label": Sl[x],
6557
6616
  tabIndex: -1,
6558
6617
  inert: w || void 0,
6559
- children: x === "privacy" ? /* @__PURE__ */ Q(dl, {
6618
+ children: x === "privacy" ? /* @__PURE__ */ Q(yl, {
6560
6619
  identity: d,
6561
6620
  apiUrl: f,
6562
6621
  commentAccess: p,
@@ -6570,7 +6629,7 @@ function hl({ position: e, onSetPosition: t, autoCapture: n, autoCaptureLocked:
6570
6629
  });
6571
6630
  },
6572
6631
  onBack: () => j("menu")
6573
- }) : x === "shortcuts" ? /* @__PURE__ */ Q(pl, { onBack: () => j("menu") }) : /* @__PURE__ */ Q("div", {
6632
+ }) : x === "shortcuts" ? /* @__PURE__ */ Q(xl, { onBack: () => j("menu") }) : /* @__PURE__ */ Q("div", {
6574
6633
  role: "menu",
6575
6634
  class: "markup-menu-view",
6576
6635
  children: [
@@ -6635,7 +6694,7 @@ function hl({ position: e, onSetPosition: t, autoCapture: n, autoCaptureLocked:
6635
6694
  title: "Bottom left",
6636
6695
  class: Z(e === "bottom-left" && "is-on"),
6637
6696
  onClick: () => t("bottom-left"),
6638
- children: /* @__PURE__ */ Q(gl, { side: "left" })
6697
+ children: /* @__PURE__ */ Q(wl, { side: "left" })
6639
6698
  }),
6640
6699
  /* @__PURE__ */ Q("button", {
6641
6700
  type: "button",
@@ -6645,7 +6704,7 @@ function hl({ position: e, onSetPosition: t, autoCapture: n, autoCaptureLocked:
6645
6704
  title: "Bottom center",
6646
6705
  class: Z(e === "bottom-center" && "is-on"),
6647
6706
  onClick: () => t("bottom-center"),
6648
- children: /* @__PURE__ */ Q(gl, { side: "center" })
6707
+ children: /* @__PURE__ */ Q(wl, { side: "center" })
6649
6708
  }),
6650
6709
  /* @__PURE__ */ Q("button", {
6651
6710
  type: "button",
@@ -6655,7 +6714,7 @@ function hl({ position: e, onSetPosition: t, autoCapture: n, autoCaptureLocked:
6655
6714
  title: "Bottom right",
6656
6715
  class: Z(e === "bottom-right" && "is-on"),
6657
6716
  onClick: () => t("bottom-right"),
6658
- children: /* @__PURE__ */ Q(gl, { side: "right" })
6717
+ children: /* @__PURE__ */ Q(wl, { side: "right" })
6659
6718
  })
6660
6719
  ]
6661
6720
  })]
@@ -6677,7 +6736,7 @@ function hl({ position: e, onSetPosition: t, autoCapture: n, autoCaptureLocked:
6677
6736
  children: [
6678
6737
  /* @__PURE__ */ Q("span", {
6679
6738
  class: "ic",
6680
- children: /* @__PURE__ */ Q(vl, {})
6739
+ children: /* @__PURE__ */ Q(El, {})
6681
6740
  }),
6682
6741
  /* @__PURE__ */ Q("span", {
6683
6742
  class: "lbl",
@@ -6704,7 +6763,7 @@ function hl({ position: e, onSetPosition: t, autoCapture: n, autoCaptureLocked:
6704
6763
  children: [
6705
6764
  /* @__PURE__ */ Q("span", {
6706
6765
  class: "ic",
6707
- children: /* @__PURE__ */ Q(_l, {})
6766
+ children: /* @__PURE__ */ Q(Tl, {})
6708
6767
  }),
6709
6768
  /* @__PURE__ */ Q("span", {
6710
6769
  class: "lbl",
@@ -6801,7 +6860,7 @@ function hl({ position: e, onSetPosition: t, autoCapture: n, autoCaptureLocked:
6801
6860
  children: [
6802
6861
  /* @__PURE__ */ Q("span", {
6803
6862
  class: "ic",
6804
- children: /* @__PURE__ */ Q(yl, {})
6863
+ children: /* @__PURE__ */ Q(Dl, {})
6805
6864
  }),
6806
6865
  /* @__PURE__ */ Q("span", {
6807
6866
  class: "lbl",
@@ -6832,7 +6891,7 @@ function hl({ position: e, onSetPosition: t, autoCapture: n, autoCaptureLocked:
6832
6891
  }) : null]
6833
6892
  });
6834
6893
  }
6835
- function gl({ side: e }) {
6894
+ function wl({ side: e }) {
6836
6895
  return /* @__PURE__ */ Q("svg", {
6837
6896
  width: 14,
6838
6897
  height: 14,
@@ -6858,7 +6917,7 @@ function gl({ side: e }) {
6858
6917
  })]
6859
6918
  });
6860
6919
  }
6861
- function _l() {
6920
+ function Tl() {
6862
6921
  return /* @__PURE__ */ Q("svg", {
6863
6922
  width: 16,
6864
6923
  height: 16,
@@ -6872,7 +6931,7 @@ function _l() {
6872
6931
  children: [/* @__PURE__ */ Q("path", { d: "M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71" }), /* @__PURE__ */ Q("path", { d: "M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71" })]
6873
6932
  });
6874
6933
  }
6875
- function vl() {
6934
+ function El() {
6876
6935
  return /* @__PURE__ */ Q("svg", {
6877
6936
  width: 16,
6878
6937
  height: 16,
@@ -6890,7 +6949,7 @@ function vl() {
6890
6949
  })]
6891
6950
  });
6892
6951
  }
6893
- function yl() {
6952
+ function Dl() {
6894
6953
  return /* @__PURE__ */ Q("svg", {
6895
6954
  width: 16,
6896
6955
  height: 16,
@@ -6911,21 +6970,22 @@ function yl() {
6911
6970
  }
6912
6971
  //#endregion
6913
6972
  //#region src/runtime/ui/panel-popover.tsx
6914
- function bl({ kind: e, label: t, position: n, ignoreToolbarKind: r, isLeaving: i = !1, onClose: a, children: o }) {
6973
+ function Ol({ kind: e, label: t, position: n, ignoreToolbarKind: r, isLeaving: i = !1, onClose: a, children: o }) {
6915
6974
  let s = U(null);
6916
6975
  return V(() => {
6917
6976
  if (i) return;
6918
- function e(e) {
6919
- let t = s.current;
6920
- if (!t) return;
6921
- let n = e.composedPath();
6922
- n.includes(t) || r != null && n.some((e) => e?.dataset?.kind === r) || a();
6923
- }
6924
- function t(e) {
6977
+ let e = s.current;
6978
+ if (!e) return;
6979
+ let t = (t) => {
6980
+ let n = t.composedPath();
6981
+ n.includes(e) || r != null && n.some((e) => e?.dataset?.kind === r) || a();
6982
+ };
6983
+ function n(e) {
6925
6984
  e.key === "Escape" && a();
6926
6985
  }
6927
- return document.addEventListener("click", e, !0), document.addEventListener("keydown", t), () => {
6928
- document.removeEventListener("click", e, !0), document.removeEventListener("keydown", t);
6986
+ let o = bc(e, t);
6987
+ return document.addEventListener("keydown", n), () => {
6988
+ o(), document.removeEventListener("keydown", n);
6929
6989
  };
6930
6990
  }, [
6931
6991
  a,
@@ -6947,7 +7007,7 @@ function bl({ kind: e, label: t, position: n, ignoreToolbarKind: r, isLeaving: i
6947
7007
  }
6948
7008
  //#endregion
6949
7009
  //#region src/runtime/ui/pin.tsx
6950
- function xl({ pageX: e, pageY: t, count: n, isActive: r, isUnresolved: i, isClosed: a = !1, isLeaving: o = !1, enterDelayMs: s = 0, otherLocation: c, onClick: l }) {
7010
+ function kl({ pageX: e, pageY: t, count: n, isActive: r, isUnresolved: i, isClosed: a = !1, isLeaving: o = !1, enterDelayMs: s = 0, otherLocation: c, onClick: l }) {
6951
7011
  let u = U(!r), d = `Open ${a ? "resolved " : ""}feedback thread (${n} comment${n === 1 ? "" : "s"})` + (c ? ` — left on ${c}` : ""), f = t - window.scrollY, p = e - window.scrollX;
6952
7012
  return /* @__PURE__ */ Q("button", {
6953
7013
  type: "button",
@@ -6970,7 +7030,7 @@ function xl({ pageX: e, pageY: t, count: n, isActive: r, isUnresolved: i, isClos
6970
7030
  })
6971
7031
  });
6972
7032
  }
6973
- function Sl({ pageX: e, pageY: t, isLeaving: n = !1 }) {
7033
+ function Al({ pageX: e, pageY: t, isLeaving: n = !1 }) {
6974
7034
  let r = t - window.scrollY, i = e - window.scrollX;
6975
7035
  return /* @__PURE__ */ Q("div", {
6976
7036
  class: Z("markup-pin", "markup-pin-ghost", "is-anchor", n && "is-leaving"),
@@ -6987,7 +7047,7 @@ function Sl({ pageX: e, pageY: t, isLeaving: n = !1 }) {
6987
7047
  }
6988
7048
  //#endregion
6989
7049
  //#region src/runtime/ui/placement-overlay.tsx
6990
- function Cl({ onPlace: e, onCancel: t }) {
7050
+ function jl({ onPlace: e, onCancel: t }) {
6991
7051
  let n = U(null);
6992
7052
  return H(() => {
6993
7053
  let r = n.current?.getRootNode() ?? null, i = (e) => r !== null && e.composedPath().includes(r);
@@ -7012,7 +7072,7 @@ function Cl({ onPlace: e, onCancel: t }) {
7012
7072
  window.addEventListener("keydown", a);
7013
7073
  for (let e of l) window.addEventListener(e, o, c);
7014
7074
  window.addEventListener("click", s, c);
7015
- let u = wl();
7075
+ let u = Ml();
7016
7076
  return () => {
7017
7077
  window.removeEventListener("keydown", a);
7018
7078
  for (let e of l) window.removeEventListener(e, o, c);
@@ -7028,7 +7088,7 @@ function Cl({ onPlace: e, onCancel: t }) {
7028
7088
  })
7029
7089
  });
7030
7090
  }
7031
- function wl() {
7091
+ function Ml() {
7032
7092
  let e = "html, html * { cursor: crosshair !important; }";
7033
7093
  if ("adoptedStyleSheets" in document && "replaceSync" in CSSStyleSheet.prototype) {
7034
7094
  let t = new CSSStyleSheet();
@@ -7041,14 +7101,14 @@ function wl() {
7041
7101
  }
7042
7102
  //#endregion
7043
7103
  //#region src/runtime/ui/thread-popover.tsx
7044
- var Tl = [], El = [
7104
+ var Nl = [], Pl = [
7045
7105
  "👍",
7046
7106
  "❤️",
7047
7107
  "🎉",
7048
7108
  "😮",
7049
7109
  "😄",
7050
7110
  "❓"
7051
- ], Dl = Vr({
7111
+ ], Fl = Vr({
7052
7112
  none: {
7053
7113
  "toggle-thread-menu": () => ({
7054
7114
  kind: "thread-menu",
@@ -7104,13 +7164,13 @@ var Tl = [], El = [
7104
7164
  dismiss: () => ({ kind: "none" })
7105
7165
  }
7106
7166
  });
7107
- function Ol({ thread: e, authorName: t, authorPromptMode: n, currentClientId: r, isVerified: i, isIdentityResolving: a, isSigningIn: o, canDelete: s, isPending: c, error: l, isHidden: u = !1, isLeaving: d = !1, members: f = Tl, onAuthor: p, onSignIn: m, onSignOut: h, onClose: g, onReply: _, onEditComment: v, onDeleteComment: y, onToggleReaction: b, onResolve: x, onDelete: S }) {
7108
- let C = U(null), w = U(null), ee = U(null), T = U(null), [E, D] = Hr(Dl, { kind: "none" }), te = ei(E.kind === "none" || E.kind === "editing" ? null : E, 120), O = te?.value ?? null, k = te?.isLeaving ?? !1, A = O?.kind === "thread-menu" ? O : null, [j, M] = B(null), { onPointerDown: N, isDragging: P } = gc({
7167
+ function Il({ thread: e, authorName: t, authorPromptMode: n, currentClientId: r, isVerified: i, isIdentityResolving: a, isSigningIn: o, canDelete: s, isPending: c, error: l, isHidden: u = !1, isLeaving: d = !1, members: f = Nl, onAuthor: p, onSignIn: m, onSignOut: h, onClose: g, onReply: _, onEditComment: v, onDeleteComment: y, onToggleReaction: b, onResolve: x, onDelete: S }) {
7168
+ let C = U(null), w = U(null), ee = U(null), T = U(null), [E, D] = Hr(Fl, { kind: "none" }), te = ei(E.kind === "none" || E.kind === "editing" ? null : E, 120), O = te?.value ?? null, k = te?.isLeaving ?? !1, A = O?.kind === "thread-menu" ? O : null, [j, M] = B(null), { onPointerDown: N, isDragging: P } = wc({
7109
7169
  targetRef: C,
7110
7170
  shouldStart: (e) => !e.target?.closest("button, a, input, textarea, select"),
7111
7171
  onMove: M
7112
7172
  });
7113
- yc(C, !d);
7173
+ Dc(C, !d);
7114
7174
  let ne = e.resolvedAt != null, F = rt(() => e.comments.filter((e) => !e.deleted), [e.comments]);
7115
7175
  V(() => {
7116
7176
  if (E.kind === "none" || E.kind === "editing") return;
@@ -7175,8 +7235,8 @@ function Ol({ thread: e, authorName: t, authorPromptMode: n, currentClientId: r,
7175
7235
  anchorText: e.anchorText
7176
7236
  });
7177
7237
  return {
7178
- left: Ml(t.pageX - window.scrollX + 16, 12, window.innerWidth - 320 - 12),
7179
- top: Ml(t.pageY - window.scrollY - 16, 12, window.innerHeight - 200)
7238
+ left: Bl(t.pageX - window.scrollX + 16, 12, window.innerWidth - 320 - 12),
7239
+ top: Bl(t.pageY - window.scrollY - 16, 12, window.innerHeight - 200)
7180
7240
  };
7181
7241
  }, [
7182
7242
  e.anchorX,
@@ -7267,10 +7327,10 @@ function Ol({ thread: e, authorName: t, authorPromptMode: n, currentClientId: r,
7267
7327
  return /* @__PURE__ */ Q("li", {
7268
7328
  class: Z("markup-comment", re.current != null && t.createdAt > re.current && "is-new"),
7269
7329
  children: [
7270
- /* @__PURE__ */ Q(Nl, {
7330
+ /* @__PURE__ */ Q(Vl, {
7271
7331
  name: t.authorName,
7272
7332
  image: t.authorImage,
7273
- tone: Fl(t.authorClientId ?? t.authorName)
7333
+ tone: Ul(t.authorClientId ?? t.authorName)
7274
7334
  }),
7275
7335
  /* @__PURE__ */ Q("div", {
7276
7336
  class: "markup-comment-meta",
@@ -7289,18 +7349,18 @@ function Ol({ thread: e, authorName: t, authorPromptMode: n, currentClientId: r,
7289
7349
  /* @__PURE__ */ Q("time", {
7290
7350
  class: "markup-comment-time",
7291
7351
  datetime: new Date(t.createdAt).toISOString(),
7292
- title: Ll(t.createdAt),
7293
- children: Il(t.createdAt)
7352
+ title: Gl(t.createdAt),
7353
+ children: Wl(t.createdAt)
7294
7354
  }),
7295
7355
  t.editedAt == null ? null : /* @__PURE__ */ Q("time", {
7296
7356
  class: "markup-comment-edited",
7297
7357
  datetime: new Date(t.editedAt).toISOString(),
7298
- title: Ll(t.editedAt),
7358
+ title: Gl(t.editedAt),
7299
7359
  children: "edited"
7300
7360
  }),
7301
7361
  /* @__PURE__ */ Q("div", {
7302
7362
  class: "markup-thread-actions",
7303
- children: [!ne && !l ? /* @__PURE__ */ Q(kl, {
7363
+ children: [!ne && !l ? /* @__PURE__ */ Q(Ll, {
7304
7364
  comment: t,
7305
7365
  pickerOpen: g,
7306
7366
  pickerLeaving: g && k,
@@ -7410,7 +7470,7 @@ function Ol({ thread: e, authorName: t, authorPromptMode: n, currentClientId: r,
7410
7470
  await v(t._id, n), D({ type: "dismiss" });
7411
7471
  } catch {}
7412
7472
  },
7413
- children: [/* @__PURE__ */ Q(tl, {
7473
+ children: [/* @__PURE__ */ Q(ll, {
7414
7474
  class: "markup-comment-edit-input",
7415
7475
  label: "Edit comment",
7416
7476
  value: E.draft,
@@ -7436,7 +7496,7 @@ function Ol({ thread: e, authorName: t, authorPromptMode: n, currentClientId: r,
7436
7496
  children: "Save"
7437
7497
  })]
7438
7498
  })]
7439
- }) : /* @__PURE__ */ Q(Yc, {
7499
+ }) : /* @__PURE__ */ Q(rl, {
7440
7500
  body: t.body,
7441
7501
  mentions: t.mentions
7442
7502
  }),
@@ -7449,7 +7509,7 @@ function Ol({ thread: e, authorName: t, authorPromptMode: n, currentClientId: r,
7449
7509
  alt: "Screenshot"
7450
7510
  })
7451
7511
  }) : null,
7452
- !l && t.reactions.length > 0 ? /* @__PURE__ */ Q(Al, {
7512
+ !l && t.reactions.length > 0 ? /* @__PURE__ */ Q(Rl, {
7453
7513
  comment: t,
7454
7514
  isResolved: ne,
7455
7515
  onToggle: (e) => b(t._id, e)
@@ -7492,7 +7552,7 @@ function Ol({ thread: e, authorName: t, authorPromptMode: n, currentClientId: r,
7492
7552
  children: "team"
7493
7553
  }) : null
7494
7554
  ]
7495
- }), /* @__PURE__ */ Q(rl, {
7555
+ }), /* @__PURE__ */ Q(dl, {
7496
7556
  label: "Reply",
7497
7557
  placeholder: "Write a reply…",
7498
7558
  submitLabel: "Reply",
@@ -7502,7 +7562,7 @@ function Ol({ thread: e, authorName: t, authorPromptMode: n, currentClientId: r,
7502
7562
  onSubmit: _,
7503
7563
  members: f
7504
7564
  })]
7505
- }) : /* @__PURE__ */ Q(xc, {
7565
+ }) : /* @__PURE__ */ Q(kc, {
7506
7566
  mode: n,
7507
7567
  isPending: c,
7508
7568
  isConnecting: a,
@@ -7515,7 +7575,7 @@ function Ol({ thread: e, authorName: t, authorPromptMode: n, currentClientId: r,
7515
7575
  ]
7516
7576
  });
7517
7577
  }
7518
- function kl({ comment: e, pickerOpen: t, pickerLeaving: n, pickerDirection: r, pickerSide: i, pickerRef: a, onPickerClick: o, onPickerSelect: s }) {
7578
+ function Ll({ comment: e, pickerOpen: t, pickerLeaving: n, pickerDirection: r, pickerSide: i, pickerRef: a, onPickerClick: o, onPickerSelect: s }) {
7519
7579
  return /* @__PURE__ */ Q("div", {
7520
7580
  class: Z("markup-reaction-picker-wrap", t && "is-open", t && r === "up" && "is-up", i && "is-side"),
7521
7581
  ref: a,
@@ -7530,7 +7590,7 @@ function kl({ comment: e, pickerOpen: t, pickerLeaving: n, pickerDirection: r, p
7530
7590
  class: Z("markup-reaction-picker", n && "is-leaving"),
7531
7591
  role: "menu",
7532
7592
  inert: n || void 0,
7533
- children: El.map((t) => /* @__PURE__ */ Q("button", {
7593
+ children: Pl.map((t) => /* @__PURE__ */ Q("button", {
7534
7594
  type: "button",
7535
7595
  role: "menuitem",
7536
7596
  class: Z("markup-reaction-picker-item", (e.reactions.find((e) => e.emoji === t)?.mine ?? !1) && "is-mine"),
@@ -7540,11 +7600,11 @@ function kl({ comment: e, pickerOpen: t, pickerLeaving: n, pickerDirection: r, p
7540
7600
  }) : null]
7541
7601
  });
7542
7602
  }
7543
- function Al({ comment: e, isResolved: t, onToggle: n }) {
7603
+ function Rl({ comment: e, isResolved: t, onToggle: n }) {
7544
7604
  return /* @__PURE__ */ Q("div", {
7545
7605
  class: "markup-reactions",
7546
7606
  children: e.reactions.map((e) => {
7547
- let r = jl(e.reactors, e.mine, e.count, e.emoji);
7607
+ let r = zl(e.reactors, e.mine, e.count, e.emoji);
7548
7608
  return /* @__PURE__ */ Q("button", {
7549
7609
  type: "button",
7550
7610
  class: Z("markup-reaction-chip", e.mine && "is-mine"),
@@ -7565,14 +7625,14 @@ function Al({ comment: e, isResolved: t, onToggle: n }) {
7565
7625
  })
7566
7626
  });
7567
7627
  }
7568
- function jl(e, t, n, r) {
7628
+ function zl(e, t, n, r) {
7569
7629
  let i = e.slice(), a = i.length + +!!t, o = Math.max(0, n - a);
7570
7630
  return o > 0 && i.push(`${o} other${o === 1 ? "" : "s"}`), t && i.push("you"), i.length === 0 ? `${n} reacted with ${r}` : `${i.length === 1 ? i[0] : `${i.slice(0, -1).join(", ")} and ${i[i.length - 1]}`} reacted with ${r}`;
7571
7631
  }
7572
- function Ml(e, t, n) {
7632
+ function Bl(e, t, n) {
7573
7633
  return Math.max(t, Math.min(n, e));
7574
7634
  }
7575
- function Nl({ name: e, image: t, tone: n }) {
7635
+ function Vl({ name: e, image: t, tone: n }) {
7576
7636
  let [r, i] = B(null);
7577
7637
  return /* @__PURE__ */ Q("span", {
7578
7638
  class: "markup-comment-avatar",
@@ -7588,11 +7648,11 @@ function Nl({ name: e, image: t, tone: n }) {
7588
7648
  onError: () => i(t)
7589
7649
  }) : /* @__PURE__ */ Q("span", {
7590
7650
  class: "markup-avatar-initials",
7591
- children: Pl(e)
7651
+ children: Hl(e)
7592
7652
  })
7593
7653
  });
7594
7654
  }
7595
- function Pl(e) {
7655
+ function Hl(e) {
7596
7656
  let t = e.trim();
7597
7657
  if (!t) return "??";
7598
7658
  let n = t.split(/\s+/).filter(Boolean), r = n[0] ?? "";
@@ -7600,12 +7660,12 @@ function Pl(e) {
7600
7660
  let i = n[n.length - 1] ?? "";
7601
7661
  return ((r[0] ?? "") + (i[0] ?? "")).toUpperCase();
7602
7662
  }
7603
- function Fl(e) {
7663
+ function Ul(e) {
7604
7664
  let t = 0;
7605
7665
  for (let n = 0; n < e.length; n++) t = t * 31 + e.charCodeAt(n) | 0;
7606
7666
  return Math.abs(t) % 5 + 1;
7607
7667
  }
7608
- function Il(e) {
7668
+ function Wl(e) {
7609
7669
  let t = Date.now() - e, n = Math.floor(t / 1e3);
7610
7670
  if (n < 60) return "just now";
7611
7671
  let r = Math.floor(n / 60);
@@ -7622,7 +7682,7 @@ function Il(e) {
7622
7682
  year: "numeric"
7623
7683
  });
7624
7684
  }
7625
- function Ll(e) {
7685
+ function Gl(e) {
7626
7686
  return new Date(e).toLocaleDateString([], {
7627
7687
  month: "long",
7628
7688
  day: "numeric",
@@ -7633,17 +7693,19 @@ function Ll(e) {
7633
7693
  }
7634
7694
  //#endregion
7635
7695
  //#region src/runtime/ui/toolbar.tsx
7636
- function Rl(e) {
7696
+ function Kl(e) {
7637
7697
  e.stopPropagation();
7638
7698
  }
7639
- function zl(e) {
7640
- Rl(e), e.target?.closest?.(".markup-tb-btn") && e.preventDefault();
7641
- }
7642
- function Bl({ isActive: e, onToggle: t, onHide: n, position: r = "bottom-right", unreadCount: i = 0, showInbox: a = !1, onOpenInbox: o, inboxOpen: s = !1, pinsVisible: c = !0, onTogglePins: l, identityButton: u, overflowButton: d, isLeaving: f = !1 }) {
7699
+ function ql({ isActive: e, onToggle: t, onHide: n, position: r = "bottom-right", unreadCount: i = 0, showInbox: a = !1, onOpenInbox: o, inboxOpen: s = !1, pinsVisible: c = !0, onTogglePins: l, identityButton: u, overflowButton: d, isLeaving: f = !1 }) {
7643
7700
  let p = U(0);
7644
7701
  i > 0 && (p.current = i);
7645
- let m = r === "bottom-left" ? "markup-toolbar-left" : r === "bottom-center" ? "markup-toolbar-center" : "markup-toolbar-right";
7646
- function h(e) {
7702
+ let m = U(null);
7703
+ H(() => {
7704
+ let e = m.current;
7705
+ return e ? yc(e) : void 0;
7706
+ }, []);
7707
+ let h = r === "bottom-left" ? "markup-toolbar-left" : r === "bottom-center" ? "markup-toolbar-center" : "markup-toolbar-right";
7708
+ function g(e) {
7647
7709
  if (e.preventDefault(), e.stopPropagation(), (e.metaKey || e.ctrlKey) && n) {
7648
7710
  n();
7649
7711
  return;
@@ -7651,15 +7713,16 @@ function Bl({ isActive: e, onToggle: t, onHide: n, position: r = "bottom-right",
7651
7713
  t();
7652
7714
  }
7653
7715
  return /* @__PURE__ */ Q("div", {
7654
- class: Z("markup-toolbar", m, f && "is-leaving"),
7716
+ ref: m,
7717
+ class: Z("markup-toolbar", h, f && "is-leaving"),
7655
7718
  role: "toolbar",
7656
7719
  "aria-label": "Markup feedback toolbar",
7657
7720
  "aria-hidden": f,
7658
7721
  inert: f ? "" : void 0,
7659
- onPointerDown: Rl,
7660
- onMouseDown: zl,
7661
- onPointerUp: Rl,
7662
- onMouseUp: Rl,
7722
+ onPointerDown: Kl,
7723
+ onMouseDown: Kl,
7724
+ onPointerUp: Kl,
7725
+ onMouseUp: Kl,
7663
7726
  children: [
7664
7727
  /* @__PURE__ */ Q("button", {
7665
7728
  type: "button",
@@ -7668,7 +7731,7 @@ function Bl({ isActive: e, onToggle: t, onHide: n, position: r = "bottom-right",
7668
7731
  "data-armed": e ? "true" : void 0,
7669
7732
  title: e ? "Cancel placing markup" : "Leave a markup",
7670
7733
  "aria-pressed": e,
7671
- onClick: h,
7734
+ onClick: g,
7672
7735
  children: Q(e ? Ws : Qs, { size: 16 })
7673
7736
  }),
7674
7737
  a ? /* @__PURE__ */ Q("button", {
@@ -7722,8 +7785,8 @@ function Bl({ isActive: e, onToggle: t, onHide: n, position: r = "bottom-right",
7722
7785
  }
7723
7786
  //#endregion
7724
7787
  //#region src/runtime/ui/app.tsx
7725
- var Vl = [], Hl = [], Ul = [], Wl = [{ key: "toolbar" }], Gl = [];
7726
- function Kl(e) {
7788
+ var Jl = [], Yl = [], Xl = [], Zl = [{ key: "toolbar" }], Ql = [];
7789
+ function $l(e) {
7727
7790
  let t = {
7728
7791
  clientId: `markup_user_${e.identity.id}`,
7729
7792
  name: e.identity.name,
@@ -7749,14 +7812,14 @@ function Kl(e) {
7749
7812
  } : {}
7750
7813
  };
7751
7814
  }
7752
- function ql() {
7815
+ function eu() {
7753
7816
  let e = document.activeElement;
7754
7817
  for (; e && e.shadowRoot && e.shadowRoot.activeElement;) e = e.shadowRoot.activeElement;
7755
7818
  if (!e) return !1;
7756
7819
  let t = e.tagName;
7757
7820
  return t === "INPUT" || t === "TEXTAREA" || t === "SELECT" || e.isContentEditable;
7758
7821
  }
7759
- var Jl = Vr({
7822
+ var tu = Vr({
7760
7823
  visible: {
7761
7824
  "hide-with-toast": () => ({ kind: "hidden-with-toast" }),
7762
7825
  toggle: () => ({ kind: "hidden" })
@@ -7767,26 +7830,26 @@ var Jl = Vr({
7767
7830
  },
7768
7831
  hidden: { toggle: () => ({ kind: "visible" }) }
7769
7832
  });
7770
- function Yl(e) {
7833
+ function nu(e) {
7771
7834
  return ra(e), e;
7772
7835
  }
7773
- var Xl = Vr({
7836
+ var ru = Vr({
7774
7837
  unresolved: {
7775
- "mint-success": (e, t) => Yl({
7838
+ "mint-success": (e, t) => nu({
7776
7839
  kind: "anon",
7777
7840
  identity: t.identity
7778
7841
  }),
7779
- "signed-in": (e, t) => Yl({
7842
+ "signed-in": (e, t) => nu({
7780
7843
  kind: "verified",
7781
7844
  identity: t.identity
7782
7845
  })
7783
7846
  },
7784
7847
  anon: {
7785
- "signed-in": (e, t) => Yl({
7848
+ "signed-in": (e, t) => nu({
7786
7849
  kind: "verified",
7787
7850
  identity: t.identity
7788
7851
  }),
7789
- "author-set": (e, t) => Yl({
7852
+ "author-set": (e, t) => nu({
7790
7853
  kind: "anon",
7791
7854
  identity: {
7792
7855
  ...e.identity,
@@ -7794,35 +7857,35 @@ var Xl = Vr({
7794
7857
  email: t.email
7795
7858
  }
7796
7859
  }),
7797
- "forget-me": () => Yl({ kind: "unresolved" })
7860
+ "forget-me": () => nu({ kind: "unresolved" })
7798
7861
  },
7799
7862
  verified: {
7800
- "signed-in": (e, t) => Yl({
7863
+ "signed-in": (e, t) => nu({
7801
7864
  kind: "verified",
7802
7865
  identity: t.identity
7803
7866
  }),
7804
- unauthorized: (e) => Yl({
7867
+ unauthorized: (e) => nu({
7805
7868
  kind: "recovering",
7806
7869
  preserved: {
7807
7870
  name: e.identity.name,
7808
7871
  email: e.identity.email
7809
7872
  }
7810
7873
  }),
7811
- "signed-out": () => Yl({ kind: "unresolved" })
7874
+ "signed-out": () => nu({ kind: "unresolved" })
7812
7875
  },
7813
7876
  recovering: {
7814
- "mint-success": (e, t) => Yl({
7877
+ "mint-success": (e, t) => nu({
7815
7878
  kind: "anon",
7816
7879
  identity: t.identity
7817
7880
  }),
7818
- "signed-in": (e, t) => Yl({
7881
+ "signed-in": (e, t) => nu({
7819
7882
  kind: "verified",
7820
7883
  identity: t.identity
7821
7884
  })
7822
7885
  }
7823
7886
  });
7824
- function Zl({ apiUrl: e, apiKey: t, position: n = "bottom-right", screenshots: r, dashboardUrl: i, routeParams: a = Vl }) {
7825
- let [o, s] = B(() => ya(a)), [c, l] = B(() => xa(a)), [u, d] = B([]), [f, p] = B(!1), m = rt(() => na(), []), [h, g] = Hr(Xl, m.state), [_, v] = B(null);
7887
+ function iu({ apiUrl: e, apiKey: t, position: n = "bottom-right", screenshots: r, dashboardUrl: i, routeParams: a = Jl }) {
7888
+ let [o, s] = B(() => ya(a)), [c, l] = B(() => xa(a)), [u, d] = B([]), [f, p] = B(!1), m = rt(() => na(), []), [h, g] = Hr(ru, m.state), [_, v] = B(null);
7826
7889
  V(() => {
7827
7890
  let n = !1;
7828
7891
  return Hi(e, t).then((e) => {
@@ -7888,7 +7951,7 @@ function Zl({ apiUrl: e, apiKey: t, position: n = "bottom-right", screenshots: r
7888
7951
  type: "patch",
7889
7952
  update: e
7890
7953
  });
7891
- }, [oe]), fe = Yr(), pe = Yr(), me = Yr(), he = Yr(), ge = Yr(), { run: _e, reset: ve } = fe, { run: ye } = pe, { run: xe, reset: Se } = me, { run: Ce } = he, { run: we } = ge, Te = ge.isPending, Ee = fe.isPending, De = fe.error ?? pe.error ?? me.error, [Oe, ke] = Hr(Jl, { kind: "visible" }), Ae = Oe.kind !== "visible", [je, I] = B(0), [Me, Ne] = B(0), L = U(null), Pe = aa(h), Fe = h.kind === "verified", Ie = h.kind === "unresolved" || h.kind === "recovering", Le = ia(h), [Re, ze] = B(Li), [Be, Ve] = B(null);
7954
+ }, [oe]), fe = Yr(), pe = Yr(), me = Yr(), he = Yr(), ge = Yr(), { run: _e, reset: ve } = fe, { run: ye } = pe, { run: xe, reset: Se } = me, { run: Ce } = he, { run: we } = ge, Te = ge.isPending, Ee = fe.isPending, De = fe.error ?? pe.error ?? me.error, [Oe, ke] = Hr(tu, { kind: "visible" }), Ae = Oe.kind !== "visible", [je, I] = B(0), [Me, Ne] = B(0), L = U(null), Pe = aa(h), Fe = h.kind === "verified", Ie = h.kind === "unresolved" || h.kind === "recovering", Le = ia(h), [Re, ze] = B(Li), [Be, Ve] = B(null);
7892
7955
  V(() => {
7893
7956
  Ve(null), le.current += 1, oe({ type: "reset" });
7894
7957
  }, [
@@ -8024,7 +8087,7 @@ function Zl({ apiUrl: e, apiKey: t, position: n = "bottom-right", screenshots: r
8024
8087
  }, [ve, Se]);
8025
8088
  V(() => {
8026
8089
  function e(e) {
8027
- e.key === "c" && (e.metaKey || e.ctrlKey || e.altKey || e.shiftKey || N.kind === "idle" && (Ae || ql() || (e.preventDefault(), z())));
8090
+ e.key === "c" && (e.metaKey || e.ctrlKey || e.altKey || e.shiftKey || N.kind === "idle" && (Ae || eu() || (e.preventDefault(), z())));
8028
8091
  }
8029
8092
  return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
8030
8093
  }, [
@@ -8088,7 +8151,7 @@ function Zl({ apiUrl: e, apiKey: t, position: n = "bottom-right", screenshots: r
8088
8151
  });
8089
8152
  }, [g]), $e = pe.isPending, et = W(async () => {
8090
8153
  be("sign_in_started"), await ye(async () => {
8091
- let n = Kl(await fa({
8154
+ let n = $l(await fa({
8092
8155
  apiUrl: e,
8093
8156
  apiKey: t,
8094
8157
  useCookies: _ === !0
@@ -8333,7 +8396,7 @@ function Zl({ apiUrl: e, apiKey: t, position: n = "bottom-right", screenshots: r
8333
8396
  elements: xt.flatMap((e) => e.point.element ? [e.point.element] : [])
8334
8397
  };
8335
8398
  }, [xt]);
8336
- let Ct = vt.some((e) => e.anchorSelector != null), wt = $r(N.kind !== "placing" && !Ae && x ? xt : Hl, (e) => e.thread._id, 140), Tt = $r(!Ae || N.kind === "placing" || N.kind === "composing-new" ? Wl : Gl, (e) => e.key, 160), Et = [];
8399
+ let Ct = vt.some((e) => e.anchorSelector != null), wt = $r(N.kind !== "placing" && !Ae && x ? xt : Yl, (e) => e.thread._id, 140), Tt = $r(!Ae || N.kind === "placing" || N.kind === "composing-new" ? Zl : Ql, (e) => e.key, 160), Et = [];
8337
8400
  Oe.kind === "hidden-with-toast" && Et.push({
8338
8401
  key: "hud-hidden",
8339
8402
  body: /* @__PURE__ */ Q(S, { children: [
@@ -8355,7 +8418,7 @@ function Zl({ apiUrl: e, apiKey: t, position: n = "bottom-right", screenshots: r
8355
8418
  key: "signed-out",
8356
8419
  body: "Signed out — commenting anonymously again."
8357
8420
  });
8358
- let Dt = $r(Et, (e) => e.key, 220), Ot = $r(N.kind === "thread" && ht ? [ht] : Ul, (e) => e._id, 160), K = ei(N.kind === "composing-new" ? N : null, 160), kt = ei(O, 140);
8421
+ let Dt = $r(Et, (e) => e.key, 220), Ot = $r(N.kind === "thread" && ht ? [ht] : Xl, (e) => e._id, 160), K = ei(N.kind === "composing-new" ? N : null, 160), kt = ei(O, 140);
8359
8422
  return V(() => {
8360
8423
  if (!Ct) return;
8361
8424
  let e = null, t = !1;
@@ -8389,7 +8452,7 @@ function Zl({ apiUrl: e, apiKey: t, position: n = "bottom-right", screenshots: r
8389
8452
  class: "markup-pins-layer",
8390
8453
  children: [wt.map(({ key: e, value: { thread: t, point: n }, isLeaving: r, enterDelayMs: i }) => {
8391
8454
  let o = !r && N.kind === "thread" && N.threadId === t._id, s = t.comments.reduce((e, t) => e + +!t.deleted, 0);
8392
- return /* @__PURE__ */ Q(xl, {
8455
+ return /* @__PURE__ */ Q(kl, {
8393
8456
  pageX: n.pageX,
8394
8457
  pageY: n.pageY,
8395
8458
  count: s,
@@ -8406,17 +8469,17 @@ function Zl({ apiUrl: e, apiKey: t, position: n = "bottom-right", screenshots: r
8406
8469
  });
8407
8470
  }
8408
8471
  }, e);
8409
- }), K ? /* @__PURE__ */ Q(Sl, {
8472
+ }), K ? /* @__PURE__ */ Q(Al, {
8410
8473
  pageX: K.value.pageX,
8411
8474
  pageY: K.value.pageY,
8412
8475
  isLeaving: K.isLeaving
8413
8476
  }) : null]
8414
8477
  }),
8415
- N.kind === "placing" ? /* @__PURE__ */ Q(Cl, {
8478
+ N.kind === "placing" ? /* @__PURE__ */ Q(jl, {
8416
8479
  onPlace: Ze,
8417
8480
  onCancel: Ye
8418
8481
  }) : null,
8419
- Ot.map(({ key: e, value: t, isLeaving: n }) => /* @__PURE__ */ Q(Ol, {
8482
+ Ot.map(({ key: e, value: t, isLeaving: n }) => /* @__PURE__ */ Q(Il, {
8420
8483
  thread: t,
8421
8484
  isLeaving: n,
8422
8485
  authorName: Pe,
@@ -8441,7 +8504,7 @@ function Zl({ apiUrl: e, apiKey: t, position: n = "bottom-right", screenshots: r
8441
8504
  onDelete: nt,
8442
8505
  onResolve: H
8443
8506
  }, e)),
8444
- K ? /* @__PURE__ */ Q(ol, {
8507
+ K ? /* @__PURE__ */ Q(ml, {
8445
8508
  isLeaving: K.isLeaving,
8446
8509
  pageX: K.value.pageX,
8447
8510
  pageY: K.value.pageY,
@@ -8464,7 +8527,7 @@ function Zl({ apiUrl: e, apiKey: t, position: n = "bottom-right", screenshots: r
8464
8527
  onSubmit: tt,
8465
8528
  onClose: Ye
8466
8529
  }) : null,
8467
- Tt.map((t) => /* @__PURE__ */ Q(Bl, {
8530
+ Tt.map((t) => /* @__PURE__ */ Q(ql, {
8468
8531
  isLeaving: t.isLeaving,
8469
8532
  isActive: N.kind === "placing",
8470
8533
  onToggle: () => N.kind === "placing" ? Ye() : z(),
@@ -8479,7 +8542,7 @@ function Zl({ apiUrl: e, apiKey: t, position: n = "bottom-right", screenshots: r
8479
8542
  },
8480
8543
  pinsVisible: x,
8481
8544
  onTogglePins: () => C((e) => !e),
8482
- identityButton: /* @__PURE__ */ Q(mc, {
8545
+ identityButton: /* @__PURE__ */ Q(Sc, {
8483
8546
  identity: h,
8484
8547
  position: y,
8485
8548
  isSigningIn: $e,
@@ -8490,7 +8553,7 @@ function Zl({ apiUrl: e, apiKey: t, position: n = "bottom-right", screenshots: r
8490
8553
  onSignOut: mt,
8491
8554
  onForgetMe: ft
8492
8555
  }),
8493
- overflowButton: /* @__PURE__ */ Q(hl, {
8556
+ overflowButton: /* @__PURE__ */ Q(Cl, {
8494
8557
  position: y,
8495
8558
  onSetPosition: b,
8496
8559
  autoCapture: T && r?.enabled !== !1,
@@ -8508,18 +8571,18 @@ function Zl({ apiUrl: e, apiKey: t, position: n = "bottom-right", screenshots: r
8508
8571
  isForgettingMe: he.isPending,
8509
8572
  forgetMeError: he.error,
8510
8573
  onForgetMe: ft,
8511
- version: "1.27.1",
8574
+ version: "1.27.2",
8512
8575
  dashboardUrl: i
8513
8576
  })
8514
8577
  }, t.key)),
8515
- kt?.value === "inbox" && Fe ? /* @__PURE__ */ Q(bl, {
8578
+ kt?.value === "inbox" && Fe ? /* @__PURE__ */ Q(Ol, {
8516
8579
  kind: "inbox",
8517
8580
  label: "Inbox",
8518
8581
  position: y,
8519
8582
  ignoreToolbarKind: "inbox",
8520
8583
  isLeaving: kt.isLeaving,
8521
8584
  onClose: A,
8522
- children: /* @__PURE__ */ Q(cl, {
8585
+ children: /* @__PURE__ */ Q(gl, {
8523
8586
  state: ae,
8524
8587
  isMarkingAll: se,
8525
8588
  onBack: A,
@@ -8529,7 +8592,7 @@ function Zl({ apiUrl: e, apiKey: t, position: n = "bottom-right", screenshots: r
8529
8592
  onMarkAllRead: at
8530
8593
  })
8531
8594
  }) : null,
8532
- Dt.map((e) => /* @__PURE__ */ Q(Ql, {
8595
+ Dt.map((e) => /* @__PURE__ */ Q(au, {
8533
8596
  position: y,
8534
8597
  isLeaving: e.isLeaving,
8535
8598
  children: e.value.body
@@ -8537,7 +8600,7 @@ function Zl({ apiUrl: e, apiKey: t, position: n = "bottom-right", screenshots: r
8537
8600
  ]
8538
8601
  });
8539
8602
  }
8540
- function Ql({ position: e, isLeaving: t, children: n }) {
8603
+ function au({ position: e, isLeaving: t, children: n }) {
8541
8604
  return /* @__PURE__ */ Q("div", {
8542
8605
  class: Z("markup-hud-hidden-toast", e === "bottom-left" ? "markup-hud-hidden-toast-left" : e === "bottom-center" ? "markup-hud-hidden-toast-center" : "markup-hud-hidden-toast-right", t && "is-leaving"),
8543
8606
  role: "status",
@@ -8548,7 +8611,7 @@ function Ql({ position: e, isLeaving: t, children: n }) {
8548
8611
  }
8549
8612
  //#endregion
8550
8613
  //#region src/runtime/mount.tsx
8551
- function $l(e, t) {
8614
+ function ou(e, t) {
8552
8615
  e.style.position = "fixed", e.style.inset = "0", e.style.zIndex = "2147483647", e.style.pointerEvents = "none", Re(e, t.theme ?? "auto");
8553
8616
  let n = Ue(), r = e.attachShadow({ mode: "open" }), i = document.createElement("style");
8554
8617
  i.textContent = le, r.appendChild(i);
@@ -8556,44 +8619,44 @@ function $l(e, t) {
8556
8619
  a.className = "markup-shadow-root", r.appendChild(a), je({
8557
8620
  apiUrl: t.apiUrl,
8558
8621
  apiKey: t.apiKey,
8559
- widgetVersion: "1.27.1"
8622
+ widgetVersion: "1.27.2"
8560
8623
  }), ye(t.analytics === !1 ? null : {
8561
8624
  apiUrl: t.apiUrl,
8562
8625
  apiKey: t.apiKey,
8563
- widgetVersion: "1.27.1"
8626
+ widgetVersion: "1.27.2"
8564
8627
  }), be("widget_loaded");
8565
8628
  let { theme: o, analytics: s, ...c } = t;
8566
8629
  return ce(/* @__PURE__ */ Q(Ce, {
8567
8630
  onError: (e) => I(e, { context: "render" }),
8568
- children: /* @__PURE__ */ Q(Zl, { ...c })
8631
+ children: /* @__PURE__ */ Q(iu, { ...c })
8569
8632
  }), a), () => {
8570
8633
  n(), je(null), ye(null), ce(null, a);
8571
8634
  };
8572
8635
  }
8573
8636
  //#endregion
8574
8637
  //#region src/widget.ts
8575
- var eu = null, tu = null, nu = null, ru = !1;
8576
- function iu(e) {
8638
+ var su = null, cu = null, lu = null, uu = !1;
8639
+ function du(e) {
8577
8640
  if (!e.apiUrl || !e.apiKey) return console.warn("[markup] init() requires both apiUrl and apiKey, so the widget was not mounted"), () => {};
8578
- e.fab != null && !ru && (ru = !0, console.warn("[markup] the `fab` option is ignored and will be removed in the next major. The toolbar replaced the floating action button. Remove it from your config.")), au();
8641
+ e.fab != null && !uu && (uu = !0, console.warn("[markup] the `fab` option is ignored and will be removed in the next major. The toolbar replaced the floating action button. Remove it from your config.")), fu();
8579
8642
  let t = () => {
8580
- if (nu = null, !document.body) return;
8643
+ if (lu = null, !document.body) return;
8581
8644
  let t = document.createElement("div");
8582
- t.id = "markup-widget", document.body.appendChild(t), tu = t, eu = $l(t, e);
8645
+ t.id = "markup-widget", document.body.appendChild(t), cu = t, su = ou(t, e);
8583
8646
  };
8584
8647
  if (document.readyState === "loading" || !document.body) {
8585
8648
  let e = () => t();
8586
- nu = () => document.removeEventListener("DOMContentLoaded", e), document.addEventListener("DOMContentLoaded", e, { once: !0 });
8649
+ lu = () => document.removeEventListener("DOMContentLoaded", e), document.addEventListener("DOMContentLoaded", e, { once: !0 });
8587
8650
  } else t();
8588
- return au;
8651
+ return fu;
8589
8652
  }
8590
- function au() {
8591
- nu &&= (nu(), null), eu &&= (eu(), null), tu?.parentNode && tu.parentNode.removeChild(tu), tu = null;
8653
+ function fu() {
8654
+ lu &&= (lu(), null), su &&= (su(), null), cu?.parentNode && cu.parentNode.removeChild(cu), cu = null;
8592
8655
  }
8593
8656
  if (typeof document < "u") {
8594
8657
  let e = document.currentScript ?? document.querySelector("script[data-markup-widget=\"true\"]"), t = e?.dataset.apiUrl, n = e?.dataset.apiKey;
8595
8658
  if (t && n) {
8596
- let r = e?.dataset.position, i = e?.dataset.theme, a = e?.dataset.fab, o = e?.dataset.dashboardUrl, s = e?.dataset.analytics !== "false", c = e?.dataset.routeParams?.split(",").map((e) => e.trim()).filter((e) => e !== ""), l = () => iu({
8659
+ let r = e?.dataset.position, i = e?.dataset.theme, a = e?.dataset.fab, o = e?.dataset.dashboardUrl, s = e?.dataset.analytics !== "false", c = e?.dataset.routeParams?.split(",").map((e) => e.trim()).filter((e) => e !== ""), l = () => du({
8597
8660
  apiUrl: t,
8598
8661
  apiKey: n,
8599
8662
  position: r,
@@ -8607,6 +8670,6 @@ if (typeof document < "u") {
8607
8670
  }
8608
8671
  }
8609
8672
  //#endregion
8610
- export { au as destroy, iu as init };
8673
+ export { fu as destroy, du as init };
8611
8674
 
8612
8675
  //# sourceMappingURL=widget.js.map