@fileverse-dev/ddoc 7.1.6-pages.0 → 7.1.6-pages.1

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/index.es.js CHANGED
@@ -2,16 +2,16 @@ var Td = Object.defineProperty;
2
2
  var Ed = (e, t, n) => t in e ? Td(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
3
3
  var ne = (e, t, n) => Ed(e, typeof t != "symbol" ? t + "" : t, n);
4
4
  import { jsx as r, jsxs as v, Fragment as nt } from "react/jsx-runtime";
5
- import { P as os, a as rs, i as Ya, p as Xa, N as Ad, C as Rd, E as is, g as Id, b as Dd, u as Qa, l as Md, d as xt, e as z, f as Qt, r as Za, n as as, h as Eo, j as Fd, k as Bs, F as Bd, L as Od, m as Ja, o as Ld, q as Os, s as gr, I as We, S as _d, t as yr, v as Pd, T as it, w as el, x as Ud, y as Di, z as Hd, A as tl, B as zd, D as Kd, G as nl, H as es, J as sl, K as Br, M as jd, O as Or, Q as ol, R as Pn, U as rl, V as Vd, W as Lr, X as Wd, Y as $d, Z as qd, _ as Gd, $ as il, a0 as Yd, a1 as Xd, a2 as Qd, a3 as oo, a4 as Zd, a5 as Xo, a6 as Jd, a7 as eu, a8 as gt, a9 as tu, aa as Mi, ab as nu, ac as su, ad as ou, ae as ru, af as Fn, ag as al, ah as iu, ai as Es, aj as au, ak as Ao, al as lu, am as cu, an as du, ao as uu, ap as hu, aq as ll, ar as Ls, as as cl, at as dl, au as kn, av as mu, aw as xr, ax as Fi, ay as Bi, az as pu, aA as fu, aB as gu, aC as ul, aD as yu, aE as xu, aF as wu, aG as bu, aH as Cu, aI as vu, aJ as ku, aK as Su, aL as Nu, aM as Tu, aN as Eu, aO as Au, aP as Ru, aQ as Iu, aR as Du, aS as Qo, aT as hl, aU as Mu, aV as ml, aW as Fu, aX as Bu, aY as Ou, aZ as Lu, a_ as pn, a$ as _u, b0 as Oi, b1 as As, b2 as _r, b3 as Pu, b4 as Pr, b5 as Uu, b6 as Zo, b7 as Hu, b8 as pl, b9 as dt, ba as zu, bb as Li, bc as Ku, bd as ju, be as fl, bf as Vu, bg as ws, bh as Wu, bi as $u, bj as qu, bk as Gu, bl as Yu, bm as Xu, bn as Qu, bo as Zu, bp as Ju, bq as eh, br as th, bs as wr, bt as br, bu as nh, bv as Jo, bw as sh, bx as oh, by as rh, bz as ih, bA as ah, bB as _i, bC as lh, bD as ch, bE as Pi, bF as dh, bG as uh, bH as hh, bI as mh, bJ as ph, bK as Ui, bL as Cr, bM as Hi, bN as fh, bO as gh, bP as yh, bQ as xh, bR as wh, bS as gl, bT as zi, bU as Ki, bV as bh, bW as Ch, bX as vh, bY as ji, bZ as kh, b_ as Sh, b$ as Nh, c0 as Th, c1 as Eh } from "./use-headless-editor-TswbjzW2.mjs";
6
- import { c2 as yx, c3 as xx } from "./use-headless-editor-TswbjzW2.mjs";
5
+ import { P as os, a as rs, i as Ya, p as Xa, N as Ad, C as Rd, E as is, g as Id, b as Dd, u as Qa, l as Md, d as wt, e as z, f as Zt, r as Za, n as as, h as Eo, j as Fd, k as Bs, F as Bd, L as Od, m as Ja, o as Ld, q as Os, s as gr, I as We, S as _d, t as yr, v as Pd, T as it, w as el, x as Ud, y as Di, z as Hd, A as tl, B as zd, D as Kd, G as nl, H as es, J as sl, K as Br, M as jd, O as Or, Q as ol, R as Pn, U as rl, V as Vd, W as Lr, X as Wd, Y as $d, Z as qd, _ as Gd, $ as il, a0 as Yd, a1 as Xd, a2 as Qd, a3 as oo, a4 as Zd, a5 as Xo, a6 as Jd, a7 as eu, a8 as gt, a9 as tu, aa as Mi, ab as nu, ac as su, ad as ou, ae as ru, af as Fn, ag as al, ah as iu, ai as Es, aj as au, ak as Ao, al as lu, am as cu, an as du, ao as uu, ap as hu, aq as ll, ar as Ls, as as cl, at as dl, au as Sn, av as mu, aw as xr, ax as Fi, ay as Bi, az as pu, aA as fu, aB as gu, aC as ul, aD as yu, aE as xu, aF as wu, aG as bu, aH as Cu, aI as vu, aJ as ku, aK as Su, aL as Nu, aM as Tu, aN as Eu, aO as Au, aP as Ru, aQ as Iu, aR as Du, aS as Qo, aT as hl, aU as Mu, aV as ml, aW as Fu, aX as Bu, aY as Ou, aZ as Lu, a_ as fn, a$ as _u, b0 as Oi, b1 as As, b2 as _r, b3 as Pu, b4 as Pr, b5 as Uu, b6 as Zo, b7 as Hu, b8 as pl, b9 as dt, ba as zu, bb as Li, bc as Ku, bd as ju, be as fl, bf as Vu, bg as ws, bh as Wu, bi as $u, bj as qu, bk as Gu, bl as Yu, bm as Xu, bn as Qu, bo as Zu, bp as Ju, bq as eh, br as th, bs as wr, bt as br, bu as nh, bv as Jo, bw as sh, bx as oh, by as rh, bz as ih, bA as ah, bB as _i, bC as lh, bD as ch, bE as Pi, bF as dh, bG as uh, bH as hh, bI as mh, bJ as ph, bK as Ui, bL as Cr, bM as Hi, bN as fh, bO as gh, bP as yh, bQ as xh, bR as wh, bS as gl, bT as zi, bU as Ki, bV as bh, bW as Ch, bX as vh, bY as ji, bZ as kh, b_ as Sh, b$ as Nh, c0 as Th, c1 as Eh } from "./use-headless-editor-DfHwB1_9.mjs";
6
+ import { c2 as yx, c3 as xx } from "./use-headless-editor-DfHwB1_9.mjs";
7
7
  import { flip as yl, shift as xl, offset as wl, arrow as bl, size as Cl, autoPlacement as vl, hide as kl, inline as Sl, computePosition as Ur, platform as bs } from "@floating-ui/dom";
8
- import Qe, { useRef as F, useEffect as j, useState as Y, useCallback as M, createContext as Ah, useContext as Rh, useMemo as ve, forwardRef as wt, useReducer as Ih, useLayoutEffect as yt, memo as Ro, createElement as vr, lazy as Nl, Suspense as Vi, useSyncExternalStore as Wi, useImperativeHandle as Tl } from "react";
9
- import { createPortal as Nn } from "react-dom";
8
+ import Ze, { useRef as F, useEffect as j, useState as Y, useCallback as M, createContext as Ah, useContext as Rh, useMemo as ve, forwardRef as bt, useReducer as Ih, useLayoutEffect as yt, memo as Ro, createElement as vr, lazy as Nl, Suspense as Vi, useSyncExternalStore as Wi, useImperativeHandle as Tl } from "react";
9
+ import { createPortal as Tn } from "react-dom";
10
10
  import ye from "classnames";
11
- import { DynamicDropdown as Ct, LucideIcon as he, Dialog as Hr, DialogContent as zr, cn as ae, DialogHeader as Kr, DialogTitle as jr, DialogFooter as Vr, DialogClose as go, Button as Ne, Tooltip as Ye, IconButton as be, Skeleton as yo, Avatar as Zt, PopoverClose as Io, TextAreaFieldV2 as Sn, DynamicModal as Wr, Select as Rs, SelectTrigger as Is, SelectValue as Ds, SelectContent as Ms, SelectItem as Fs, DropdownMenu as Un, DropdownMenuTrigger as Hn, DropdownMenuContent as zn, DropdownMenuSub as $i, DropdownMenuSubTrigger as qi, DropdownMenuSubContent as Gi, DropdownMenuItem as Lt, useTheme as Dh, Popover as ls, PopoverTrigger as _s, PopoverContent as cs, SelectGroup as Mh, Checkbox as Fh, toast as xo, Drawer as Bh, DrawerTrigger as Oh, TextField as Xt, AnimatedLoader as Lh, Label as po, DynamicDropdownV2 as El, DynamicDrawerV2 as _h, BottomDrawer as Ph, ButtonGroup as Uh, Divider as Al, UltimateIcons as Hh, PopoverAnchor as zh, Tag as wo, TagInput as Rl } from "@fileverse/ui";
11
+ import { DynamicDropdown as vt, LucideIcon as he, Dialog as Hr, DialogContent as zr, cn as ae, DialogHeader as Kr, DialogTitle as jr, DialogFooter as Vr, DialogClose as go, Button as Ne, Tooltip as Ge, IconButton as be, Skeleton as yo, Avatar as Jt, PopoverClose as Io, TextAreaFieldV2 as Nn, DynamicModal as Wr, Select as Rs, SelectTrigger as Is, SelectValue as Ds, SelectContent as Ms, SelectItem as Fs, DropdownMenu as Un, DropdownMenuTrigger as Hn, DropdownMenuContent as zn, DropdownMenuSub as $i, DropdownMenuSubTrigger as qi, DropdownMenuSubContent as Gi, DropdownMenuItem as Lt, useTheme as Dh, Popover as ls, PopoverTrigger as _s, PopoverContent as cs, SelectGroup as Mh, Checkbox as Fh, toast as xo, Drawer as Bh, DrawerTrigger as Oh, TextField as Qt, AnimatedLoader as Lh, Label as po, DynamicDropdownV2 as El, DynamicDrawerV2 as _h, BottomDrawer as Ph, ButtonGroup as Uh, Divider as Al, UltimateIcons as Hh, PopoverAnchor as zh, Tag as wo, TagInput as Rl } from "@fileverse/ui";
12
12
  import { create as Kh } from "zustand";
13
13
  import jh from "react-uuid";
14
- import { g as Cs, a as vt, b as ds, c as ns, d as bo, D as tt, e as Yi, M as Co, f as $r, s as Xi, L as Vh, h as vo, A as Wh, m as $h } from "./tab-utils-Cvs3qmhi.mjs";
14
+ import { g as Cs, a as kt, b as ds, c as ns, d as bo, D as tt, e as Yi, M as Co, f as $r, s as Xi, L as Vh, h as vo, A as Wh, m as $h } from "./tab-utils-Cvs3qmhi.mjs";
15
15
  import { htmlToOdt as qh } from "odf-kit";
16
16
  import "lib0/mutex";
17
17
  import "lib0/math";
@@ -25,7 +25,7 @@ import "lib0/environment";
25
25
  import "lib0/dom";
26
26
  import "lib0/eventloop";
27
27
  import "lib0/map";
28
- import { toUint8Array as lt, fromUint8Array as _t } from "js-base64";
28
+ import { toUint8Array as at, fromUint8Array as _t } from "js-base64";
29
29
  import { Ollama as Yh } from "ollama/browser";
30
30
  import { AnimatePresence as Ps, motion as Pt, MotionConfig as Xh } from "framer-motion";
31
31
  import qr from "markdown-it";
@@ -33,7 +33,7 @@ import { generateRandomBytes as kr } from "@fileverse/crypto/utils";
33
33
  import { IndexeddbPersistence as Qh } from "y-indexeddb";
34
34
  import { applyAwarenessUpdate as Zh, removeAwarenessStates as On, encodeAwarenessUpdate as Jh, Awareness as em } from "y-protocols/awareness.js";
35
35
  import { io as tm } from "socket.io-client";
36
- import * as an from "@ucans/ucans";
36
+ import * as rn from "@ucans/ucans";
37
37
  import { generateKeyPairFromSeed as er } from "@stablelib/ed25519";
38
38
  import { eciesDecrypt as nm, eciesEncrypt as sm, generateECKeyPair as om } from "@fileverse/crypto/ecies";
39
39
  import { deriveHKDFKey as rm } from "@fileverse/crypto/kdf";
@@ -382,7 +382,7 @@ is.create({
382
382
  ] : [];
383
383
  }
384
384
  });
385
- var Do = Qe.forwardRef(
385
+ var Do = Ze.forwardRef(
386
386
  ({
387
387
  pluginKey: e = "bubbleMenu",
388
388
  editor: t,
@@ -427,10 +427,10 @@ var Do = Qe.forwardRef(
427
427
  g.parentNode && g.parentNode.removeChild(g);
428
428
  });
429
429
  };
430
- }, [p]), Nn(/* @__PURE__ */ r("div", { ...u, children: c }), h.current);
430
+ }, [p]), Tn(/* @__PURE__ */ r("div", { ...u, children: c }), h.current);
431
431
  }
432
432
  );
433
- Qe.forwardRef(
433
+ Ze.forwardRef(
434
434
  ({ pluginKey: e = "floatingMenu", editor: t, appendTo: n, shouldShow: s = null, options: o, children: i, ...a }, l) => {
435
435
  const c = F(document.createElement("div"));
436
436
  typeof l == "function" ? l(c.current) : l && (l.current = c.current);
@@ -459,7 +459,7 @@ Qe.forwardRef(
459
459
  d.parentNode && d.parentNode.removeChild(d);
460
460
  });
461
461
  };
462
- }, [t, u, n, e, s, o]), Nn(/* @__PURE__ */ r("div", { ...a, children: i }), c.current);
462
+ }, [t, u, n, e, s, o]), Tn(/* @__PURE__ */ r("div", { ...a, children: i }), c.current);
463
463
  }
464
464
  );
465
465
  const Mm = ({ editor: e, elementRef: t }) => {
@@ -525,7 +525,7 @@ const Mm = ({ editor: e, elementRef: t }) => {
525
525
  name: "Multiple"
526
526
  };
527
527
  return /* @__PURE__ */ r(
528
- Ct,
528
+ vt,
529
529
  {
530
530
  sideOffset: 15,
531
531
  anchorTrigger: /* @__PURE__ */ v(
@@ -592,7 +592,7 @@ const Mm = ({ editor: e, elementRef: t }) => {
592
592
  description: a,
593
593
  confirmLabel: l = "Delete"
594
594
  }) => {
595
- const c = xt("(max-width: 1000px)"), u = a ?? "Do you really want to delete this comment?";
595
+ const c = wt("(max-width: 1000px)"), u = a ?? "Do you really want to delete this comment?";
596
596
  return e ? c ? /* @__PURE__ */ r(
597
597
  Hr,
598
598
  {
@@ -683,7 +683,7 @@ const Mm = ({ editor: e, elementRef: t }) => {
683
683
  ]
684
684
  }
685
685
  ) : null;
686
- }, Jt = (e) => {
686
+ }, en = (e) => {
687
687
  const t = z((i) => i.getEnsStatus), n = z(
688
688
  (i) => e ? i.ensCache[e] : void 0
689
689
  ), [s, o] = Y(() => ({
@@ -716,7 +716,7 @@ const Mm = ({ editor: e, elementRef: t }) => {
716
716
  id: h,
717
717
  isFocused: m
718
718
  }) => {
719
- const p = F(null), f = F(null), [x, g] = Y(!1), [y, A] = Y(!1), E = z((L) => L.openReplyId), k = z((L) => L.setOpenReplyId), R = z((L) => L.requestEditComment), C = z((L) => L.username), { isBelow1280px: T } = Qt(), S = Jt(e), w = () => {
719
+ const p = F(null), f = F(null), [x, g] = Y(!1), [y, A] = Y(!1), E = z((L) => L.openReplyId), k = z((L) => L.setOpenReplyId), R = z((L) => L.requestEditComment), C = z((L) => L.username), { isBelow1280px: T } = Zt(), S = en(e), w = () => {
720
720
  var L;
721
721
  if ((L = p.current) != null && L.parentElement) {
722
722
  const G = p.current.closest('[role="dialog"]');
@@ -824,10 +824,10 @@ const Mm = ({ editor: e, elementRef: t }) => {
824
824
  ] })
825
825
  ] }) : s ? /* @__PURE__ */ r("p", { className: ae(i, "color-text-secondary italic"), children: s }) : null;
826
826
  }, Fl = ({ username: e, createdAt: t }) => {
827
- const n = Jt(e);
827
+ const n = en(e);
828
828
  return /* @__PURE__ */ v("div", { className: "flex justify-start items-center gap-2", children: [
829
829
  /* @__PURE__ */ r(
830
- Zt,
830
+ Jt,
831
831
  {
832
832
  src: n.isEns ? Ut : `https://api.dicebear.com/9.x/identicon/svg?seed=${encodeURIComponent(
833
833
  n.name
@@ -837,7 +837,7 @@ const Mm = ({ editor: e, elementRef: t }) => {
837
837
  }
838
838
  ),
839
839
  /* @__PURE__ */ v("div", { className: "flex items-center gap-[8px] flex-wrap", children: [
840
- /* @__PURE__ */ r(Ye, { text: n.name, children: /* @__PURE__ */ v("span", { className: "text-body-sm-bold flex items-center gap-1 whitespace-nowrap", children: [
840
+ /* @__PURE__ */ r(Ge, { text: n.name, children: /* @__PURE__ */ v("span", { className: "text-body-sm-bold flex items-center gap-1 whitespace-nowrap", children: [
841
841
  /* @__PURE__ */ r("p", { className: "truncate max-w-[100px]", children: as(n.name) }),
842
842
  n.isEns && /* @__PURE__ */ r("img", { src: us, alt: "verified", className: "w-3.5 h-3.5" })
843
843
  ] }) }),
@@ -875,7 +875,7 @@ const Mm = ({ editor: e, elementRef: t }) => {
875
875
  className: "opacity-0 group-hover:opacity-100",
876
876
  onClick: (k) => k.stopPropagation(),
877
877
  children: /* @__PURE__ */ r(
878
- Ct,
878
+ vt,
879
879
  {
880
880
  align: "end",
881
881
  sideOffset: 4,
@@ -977,7 +977,7 @@ const Mm = ({ editor: e, elementRef: t }) => {
977
977
  }
978
978
  ),
979
979
  !d && /* @__PURE__ */ r("div", { className: "flex items-center -space-x-1", children: h.slice(0, 2).map((m) => /* @__PURE__ */ r(
980
- Zt,
980
+ Jt,
981
981
  {
982
982
  src: n.isEns ? Ut : `https://api.dicebear.com/9.x/identicon/svg?seed=${encodeURIComponent(
983
983
  m.username || ""
@@ -1082,7 +1082,7 @@ const Mm = ({ editor: e, elementRef: t }) => {
1082
1082
  /* @__PURE__ */ v("div", { className: "flex justify-between items-center", children: [
1083
1083
  /* @__PURE__ */ r(Fl, { username: t, createdAt: s }),
1084
1084
  i === "2" ? /* @__PURE__ */ r(
1085
- Ye,
1085
+ Ge,
1086
1086
  {
1087
1087
  text: c ? "Available in a moment" : "",
1088
1088
  sideOffset: 0,
@@ -1096,7 +1096,7 @@ const Mm = ({ editor: e, elementRef: t }) => {
1096
1096
  ),
1097
1097
  children: [
1098
1098
  oe && !o && /* @__PURE__ */ r(
1099
- Ye,
1099
+ Ge,
1100
1100
  {
1101
1101
  text: !c && (p ? "Accept suggestion" : "Mark as resolved"),
1102
1102
  position: "bottom",
@@ -1113,7 +1113,7 @@ const Mm = ({ editor: e, elementRef: t }) => {
1113
1113
  }
1114
1114
  ),
1115
1115
  u && /* @__PURE__ */ r("div", { onClick: (le) => le.stopPropagation(), children: /* @__PURE__ */ r(
1116
- Ct,
1116
+ vt,
1117
1117
  {
1118
1118
  align: "end",
1119
1119
  sideOffset: 4,
@@ -1173,7 +1173,7 @@ const Mm = ({ editor: e, elementRef: t }) => {
1173
1173
  }
1174
1174
  )
1175
1175
  }
1176
- ) : /* @__PURE__ */ r(Ye, { text: "Actions are not supported for old comments", children: /* @__PURE__ */ r(
1176
+ ) : /* @__PURE__ */ r(Ge, { text: "Actions are not supported for old comments", children: /* @__PURE__ */ r(
1177
1177
  be,
1178
1178
  {
1179
1179
  icon: "Info",
@@ -1398,7 +1398,7 @@ const Mm = ({ editor: e, elementRef: t }) => {
1398
1398
  }, [e, R, C]);
1399
1399
  const G = () => /* @__PURE__ */ v("div", { className: "p-3 flex flex-col gap-2 color-bg-secondary rounded-md", children: [
1400
1400
  /* @__PURE__ */ r(
1401
- Sn,
1401
+ Nn,
1402
1402
  {
1403
1403
  "data-testid": "comment-dropdown-input",
1404
1404
  value: (d == null ? void 0 : d.text) || "",
@@ -1442,14 +1442,14 @@ const Mm = ({ editor: e, elementRef: t }) => {
1442
1442
  ")"
1443
1443
  ] }),
1444
1444
  /* @__PURE__ */ r("div", { className: "relative flex items-center gap-1", children: (I || s) && !P && /* @__PURE__ */ v(
1445
- Ye,
1445
+ Ge,
1446
1446
  {
1447
1447
  text: n ? "Available in a moment" : "",
1448
1448
  sideOffset: 0,
1449
1449
  position: "top",
1450
1450
  children: [
1451
1451
  /* @__PURE__ */ r(
1452
- Ct,
1452
+ vt,
1453
1453
  {
1454
1454
  align: "end",
1455
1455
  sideOffset: 4,
@@ -1489,7 +1489,7 @@ const Mm = ({ editor: e, elementRef: t }) => {
1489
1489
  "more-actions"
1490
1490
  ),
1491
1491
  /* @__PURE__ */ r(
1492
- Ye,
1492
+ Ge,
1493
1493
  {
1494
1494
  text: n ? "" : m != null && m.resolved ? "Unresolve" : "Resolve",
1495
1495
  sideOffset: 5,
@@ -1537,7 +1537,7 @@ const Mm = ({ editor: e, elementRef: t }) => {
1537
1537
  ),
1538
1538
  /* @__PURE__ */ v("div", { className: "color-bg-secondary border-t color-border-default p-3 rounded-b", children: [
1539
1539
  /* @__PURE__ */ r(
1540
- Sn,
1540
+ Nn,
1541
1541
  {
1542
1542
  value: o,
1543
1543
  onChange: me,
@@ -1605,7 +1605,7 @@ const Mm = ({ editor: e, elementRef: t }) => {
1605
1605
  [e, t, n, s]
1606
1606
  );
1607
1607
  return /* @__PURE__ */ r(Ul.Provider, { value: i, children: o });
1608
- }, hs = () => Rh(Ul), jm = Qe.memo(Bd), Vm = Qe.memo(Od), Wm = "61", $m = (e) => {
1608
+ }, hs = () => Rh(Ul), jm = Ze.memo(Bd), Vm = Ze.memo(Od), Wm = "61", $m = (e) => {
1609
1609
  const {
1610
1610
  editor: t,
1611
1611
  onError: n,
@@ -1620,7 +1620,7 @@ const Mm = ({ editor: e, elementRef: t }) => {
1620
1620
  fetchV1ImageFn: h
1621
1621
  } = e, m = Ja(t), p = t ? m.currentSize : void 0, f = t ? m.currentLineHeight : void 0, x = t ? m.onSetFontSize : () => {
1622
1622
  }, g = t ? m.onSetLineHeight : () => {
1623
- }, { isBelow1280px: y, isNativeMobile: A } = Qt(), { isFocusMode: E } = Ld(), { scale: k } = hs(), R = F({ isBelow1280px: y, scale: k });
1623
+ }, { isBelow1280px: y, isNativeMobile: A } = Zt(), { isFocusMode: E } = Ld(), { scale: k } = hs(), R = F({ isBelow1280px: y, scale: k });
1624
1624
  R.current = { isBelow1280px: y, scale: k };
1625
1625
  const C = () => R.current.isBelow1280px ? R.current.scale : 1, T = !y && !A, { toolRef: S, setToolVisibility: w, toolVisibility: b } = Os({
1626
1626
  editor: t ?? null,
@@ -1762,7 +1762,7 @@ const Mm = ({ editor: e, elementRef: t }) => {
1762
1762
  ]
1763
1763
  ), U = M(() => {
1764
1764
  o == null || o(!0), B();
1765
- }, [B, o]), ce = /* @__PURE__ */ r(Qe.Fragment, { children: /* @__PURE__ */ r(
1765
+ }, [B, o]), ce = /* @__PURE__ */ r(Ze.Fragment, { children: /* @__PURE__ */ r(
1766
1766
  it,
1767
1767
  {
1768
1768
  ref: ee,
@@ -1827,7 +1827,7 @@ const Mm = ({ editor: e, elementRef: t }) => {
1827
1827
  ),
1828
1828
  children: ce
1829
1829
  }
1830
- ) : /* @__PURE__ */ r(Qe.Fragment, { children: s ? T ? /* @__PURE__ */ r(
1830
+ ) : /* @__PURE__ */ r(Ze.Fragment, { children: s ? T ? /* @__PURE__ */ r(
1831
1831
  it,
1832
1832
  {
1833
1833
  ref: ee,
@@ -1840,7 +1840,7 @@ const Mm = ({ editor: e, elementRef: t }) => {
1840
1840
  classNames: "disabled:!bg-transparent"
1841
1841
  }
1842
1842
  ) : /* @__PURE__ */ r(
1843
- Ct,
1843
+ vt,
1844
1844
  {
1845
1845
  side: "bottom",
1846
1846
  sideOffset: 15,
@@ -1865,8 +1865,8 @@ const Mm = ({ editor: e, elementRef: t }) => {
1865
1865
  }) : null
1866
1866
  },
1867
1867
  "Comment"
1868
- ) : q ? /* @__PURE__ */ r(Qe.Fragment, { children: /* @__PURE__ */ r(
1869
- Ct,
1868
+ ) : q ? /* @__PURE__ */ r(Ze.Fragment, { children: /* @__PURE__ */ r(
1869
+ vt,
1870
1870
  {
1871
1871
  sideOffset: 15,
1872
1872
  anchorTrigger: /* @__PURE__ */ r(
@@ -1890,11 +1890,11 @@ const Mm = ({ editor: e, elementRef: t }) => {
1890
1890
  }
1891
1891
  )
1892
1892
  }
1893
- ) }) : /* @__PURE__ */ v(Qe.Fragment, { children: [
1893
+ ) }) : /* @__PURE__ */ v(Ze.Fragment, { children: [
1894
1894
  /* @__PURE__ */ r(Mm, { editor: t, elementRef: S }),
1895
1895
  /* @__PURE__ */ r("div", { className: "w-[1px] h-4 vertical-divider" }),
1896
1896
  /* @__PURE__ */ r(
1897
- Ct,
1897
+ vt,
1898
1898
  {
1899
1899
  sideOffset: 8,
1900
1900
  anchorTrigger: /* @__PURE__ */ v(
@@ -1926,7 +1926,7 @@ const Mm = ({ editor: e, elementRef: t }) => {
1926
1926
  We.FONT_SIZE
1927
1927
  ),
1928
1928
  /* @__PURE__ */ r(
1929
- Ct,
1929
+ vt,
1930
1930
  {
1931
1931
  sideOffset: 15,
1932
1932
  anchorTrigger: /* @__PURE__ */ r(
@@ -1963,9 +1963,9 @@ const Mm = ({ editor: e, elementRef: t }) => {
1963
1963
  }
1964
1964
  ),
1965
1965
  G === 3 && /* @__PURE__ */ r("div", { className: "w-[1px] h-4 vertical-divider ml-2" })
1966
- ] }, G) : L.name === "Alignment" ? /* @__PURE__ */ v(Qe.Fragment, { children: [
1966
+ ] }, G) : L.name === "Alignment" ? /* @__PURE__ */ v(Ze.Fragment, { children: [
1967
1967
  /* @__PURE__ */ r(
1968
- Ct,
1968
+ vt,
1969
1969
  {
1970
1970
  sideOffset: 15,
1971
1971
  anchorTrigger: /* @__PURE__ */ r(
@@ -1988,7 +1988,7 @@ const Mm = ({ editor: e, elementRef: t }) => {
1988
1988
  We.TEXT_COLOR
1989
1989
  ),
1990
1990
  /* @__PURE__ */ r(
1991
- Ct,
1991
+ vt,
1992
1992
  {
1993
1993
  sideOffset: 15,
1994
1994
  anchorTrigger: /* @__PURE__ */ r(
@@ -2012,7 +2012,7 @@ const Mm = ({ editor: e, elementRef: t }) => {
2012
2012
  ),
2013
2013
  /* @__PURE__ */ r("div", { className: "w-[1px] h-4 vertical-divider" }),
2014
2014
  /* @__PURE__ */ r(
2015
- Ct,
2015
+ vt,
2016
2016
  {
2017
2017
  sideOffset: 15,
2018
2018
  anchorTrigger: /* @__PURE__ */ r(
@@ -2029,8 +2029,8 @@ const Mm = ({ editor: e, elementRef: t }) => {
2029
2029
  },
2030
2030
  L.name
2031
2031
  )
2032
- ] }, G) : L.name === "Link" || L.name === "Scripts" ? /* @__PURE__ */ r(Qe.Fragment, { children: /* @__PURE__ */ r(
2033
- Ct,
2032
+ ] }, G) : L.name === "Link" || L.name === "Scripts" ? /* @__PURE__ */ r(Ze.Fragment, { children: /* @__PURE__ */ r(
2033
+ vt,
2034
2034
  {
2035
2035
  sideOffset: 15,
2036
2036
  anchorTrigger: /* @__PURE__ */ r(
@@ -2060,7 +2060,7 @@ const Mm = ({ editor: e, elementRef: t }) => {
2060
2060
  },
2061
2061
  "Comment"
2062
2062
  ) : /* @__PURE__ */ r(
2063
- Ct,
2063
+ vt,
2064
2064
  {
2065
2065
  side: "bottom",
2066
2066
  sideOffset: 15,
@@ -2094,7 +2094,7 @@ const Mm = ({ editor: e, elementRef: t }) => {
2094
2094
  ] }) })
2095
2095
  }
2096
2096
  ) : null;
2097
- }, Hl = Qe.memo($m);
2097
+ }, Hl = Ze.memo($m);
2098
2098
  Hl.displayName = "EditorBubbleMenu";
2099
2099
  const zl = (e, t) => e ? async (n) => {
2100
2100
  const { encryptionKey: s, nonce: o, authTag: i, url: a, contentRef: l } = await e(n);
@@ -2126,7 +2126,7 @@ const zl = (e, t) => e ? async (n) => {
2126
2126
  for (u.tagName || (u = c.parentElement); u && !(u.getAttribute("data-type") && u.getAttribute("data-type") === t) && !u.classList.contains(t); )
2127
2127
  u = u.parentElement;
2128
2128
  return u;
2129
- }, Xr = wt(
2129
+ }, Xr = bt(
2130
2130
  ({ children: e, className: t, withShadow: n = !0, withBorder: s = !1, ...o }, i) => {
2131
2131
  const a = ae(
2132
2132
  t,
@@ -2138,7 +2138,7 @@ const zl = (e, t) => e ? async (n) => {
2138
2138
  }
2139
2139
  );
2140
2140
  Xr.displayName = "Surface";
2141
- const jl = wt(
2141
+ const jl = bt(
2142
2142
  ({
2143
2143
  shouldShowContent: e = !0,
2144
2144
  children: t,
@@ -2155,7 +2155,7 @@ const jl = wt(
2155
2155
  }
2156
2156
  );
2157
2157
  jl.displayName = "Toolbar";
2158
- const Gm = wt(
2158
+ const Gm = bt(
2159
2159
  ({ horizontal: e, className: t, ...n }, s) => {
2160
2160
  const o = ye(
2161
2161
  "bg-neutral-200",
@@ -3179,7 +3179,7 @@ ${te.getHTML()}`
3179
3179
  onDocxImport: x,
3180
3180
  fetchV1ImageFn: y
3181
3181
  }), P = Ja(e), Q = M(() => {
3182
- }, []), ee = e ? P.currentSize : void 0, me = e ? P.onSetFontSize : Q, W = e ? P.currentLineHeight : void 0, oe = e ? P.onSetLineHeight : Q, le = xt("(max-width: 1560px)"), O = xt("(max-width: 1370px)"), H = xt("(max-width: 1270px)"), U = xt("(max-width: 1160px)"), ce = xt("(max-width: 1030px)"), q = ve(() => {
3182
+ }, []), ee = e ? P.currentSize : void 0, me = e ? P.onSetFontSize : Q, W = e ? P.currentLineHeight : void 0, oe = e ? P.onSetLineHeight : Q, le = wt("(max-width: 1560px)"), O = wt("(max-width: 1370px)"), H = wt("(max-width: 1270px)"), U = wt("(max-width: 1160px)"), ce = wt("(max-width: 1030px)"), q = ve(() => {
3183
3183
  switch (!0) {
3184
3184
  case ce:
3185
3185
  return 1030;
@@ -3229,7 +3229,7 @@ ${te.getHTML()}`
3229
3229
  }
3230
3230
  ),
3231
3231
  /* @__PURE__ */ r("div", { className: "w-[1px] h-4 vertical-divider mx-1" }),
3232
- /* @__PURE__ */ r("div", { className: "flex gap-1 justify-center items-center", children: I.map((K, V) => K ? /* @__PURE__ */ r(Ye, { text: K.title, asTriggerChild: !0, children: /* @__PURE__ */ r(
3232
+ /* @__PURE__ */ r("div", { className: "flex gap-1 justify-center items-center", children: I.map((K, V) => K ? /* @__PURE__ */ r(Ge, { text: K.title, asTriggerChild: !0, children: /* @__PURE__ */ r(
3233
3233
  be,
3234
3234
  {
3235
3235
  className: "disabled:bg-transparent",
@@ -3369,7 +3369,7 @@ ${te.getHTML()}`
3369
3369
  onError: t
3370
3370
  },
3371
3371
  K.title
3372
- ) : /* @__PURE__ */ r(Ye, { text: K.title, asTriggerChild: !0, children: /* @__PURE__ */ r(
3372
+ ) : /* @__PURE__ */ r(Ge, { text: K.title, asTriggerChild: !0, children: /* @__PURE__ */ r(
3373
3373
  it,
3374
3374
  {
3375
3375
  icon: K.icon,
@@ -3390,7 +3390,7 @@ ${te.getHTML()}`
3390
3390
  /* @__PURE__ */ v("div", { className: "flex items-center gap-1", children: [
3391
3391
  /* @__PURE__ */ r("div", { className: "w-[1px] h-4 vertical-divider mx-2" }),
3392
3392
  S && /* @__PURE__ */ r(
3393
- Ye,
3393
+ Ge,
3394
3394
  {
3395
3395
  text: T ? "Back to editor" : "Markdown view",
3396
3396
  asTriggerChild: !0,
@@ -3406,7 +3406,7 @@ ${te.getHTML()}`
3406
3406
  )
3407
3407
  }
3408
3408
  ),
3409
- /* @__PURE__ */ r(Ye, { text: "Enter focus mode", asTriggerChild: !0, children: /* @__PURE__ */ r(
3409
+ /* @__PURE__ */ r(Ge, { text: "Enter focus mode", asTriggerChild: !0, children: /* @__PURE__ */ r(
3410
3410
  be,
3411
3411
  {
3412
3412
  icon: "Focus",
@@ -3429,7 +3429,7 @@ ${te.getHTML()}`
3429
3429
  ]
3430
3430
  }
3431
3431
  ) : null;
3432
- }, $l = Qe.memo(cp);
3432
+ }, $l = Ze.memo(cp);
3433
3433
  $l.displayName = "TiptapToolBar";
3434
3434
  const dp = ({
3435
3435
  ydoc: e,
@@ -3769,7 +3769,7 @@ const dp = ({
3769
3769
  command: t,
3770
3770
  editor: n
3771
3771
  }) => {
3772
- const [s, o] = Y(0), [i, a] = Y(e), l = xt("(max-width: 640px)"), c = io(n, "callout"), u = io(n, "codeBlock"), d = io(n, "column"), h = io(n, "table"), m = M(
3772
+ const [s, o] = Y(0), [i, a] = Y(e), l = wt("(max-width: 640px)"), c = io(n, "callout"), u = io(n, "codeBlock"), d = io(n, "column"), h = io(n, "table"), m = M(
3773
3773
  (f) => {
3774
3774
  const x = i[f];
3775
3775
  x && (x.title === "Continue writing" || t(x));
@@ -4086,7 +4086,7 @@ const ra = () => {
4086
4086
  var Se;
4087
4087
  const [i, a] = Y(!1), [l, c] = Y(!1), [u, d] = Y(e.attrs.prompt), [h, m] = Y(!!e.attrs.content), [p, f] = Y(""), [x, g] = Y(!1), [y, A] = Y(!1), [E, k] = Y([]), [R, C] = Y(
4088
4088
  !!localStorage.getItem("include-ddoc-context")
4089
- ), [T, S] = Y(!0), { prompt: w, content: b } = e.attrs, N = F(null), I = F(null), B = F(null), { isSuggestionMode: _ } = nl(), X = !t.isEditable || !!_, { isWindows: $ } = Qt(), te = $ ? "Ctrl" : "Cmd", P = window.__MODEL_CONTEXT__, Q = F(null), [ee, me] = Y(
4089
+ ), [T, S] = Y(!0), { prompt: w, content: b } = e.attrs, N = F(null), I = F(null), B = F(null), { isSuggestionMode: _ } = nl(), X = !t.isEditable || !!_, { isWindows: $ } = Zt(), te = $ ? "Ctrl" : "Cmd", P = window.__MODEL_CONTEXT__, Q = F(null), [ee, me] = Y(
4090
4090
  ra()
4091
4091
  ), W = iu({
4092
4092
  extensions: [lu, ...cu],
@@ -4123,9 +4123,9 @@ const ra = () => {
4123
4123
  (async () => {
4124
4124
  if (P != null && P.defaultModels)
4125
4125
  try {
4126
- const ue = P.defaultModels.map((Re) => ({
4127
- value: Re.modelName,
4128
- label: Re.label
4126
+ const ue = P.defaultModels.map((De) => ({
4127
+ value: De.modelName,
4128
+ label: De.label
4129
4129
  }));
4130
4130
  k(ue);
4131
4131
  } catch (ue) {
@@ -4142,39 +4142,39 @@ const ra = () => {
4142
4142
  if (!R) return "";
4143
4143
  const J = t.getJSON();
4144
4144
  if (typeof n() != "number") return "";
4145
- const Re = 2e3;
4145
+ const De = 2e3;
4146
4146
  let Ee = "";
4147
- const He = (Xe) => Xe ? Xe.text ? Xe.text : Xe.content ? Xe.content.map((et) => He(et)).join(" ") : "" : "";
4148
- let ze = "", Ge = 0;
4149
- const kt = ((je = J.content) == null ? void 0 : je.slice(0, -1)) || [];
4150
- for (let Xe = kt.length - 1; Xe >= 0; Xe--) {
4151
- const et = He(kt[Xe]);
4152
- if (Ge + et.length > Re) {
4153
- ze = et.slice(-(Re - Ge)) + ze;
4147
+ const He = (Xe) => Xe ? Xe.text ? Xe.text : Xe.content ? Xe.content.map((Qe) => He(Qe)).join(" ") : "" : "";
4148
+ let ze = "", Ye = 0;
4149
+ const xt = ((je = J.content) == null ? void 0 : je.slice(0, -1)) || [];
4150
+ for (let Xe = xt.length - 1; Xe >= 0; Xe--) {
4151
+ const Qe = He(xt[Xe]);
4152
+ if (Ye + Qe.length > De) {
4153
+ ze = Qe.slice(-(De - Ye)) + ze;
4154
4154
  break;
4155
4155
  }
4156
- ze = et + `
4157
- ` + ze, Ge += et.length;
4156
+ ze = Qe + `
4157
+ ` + ze, Ye += Qe.length;
4158
4158
  }
4159
- let Ke = "", ht = 0;
4160
- const at = ((Ht = J.content) == null ? void 0 : Ht.slice(-1)) || [];
4161
- for (const Xe of at) {
4162
- const et = He(Xe);
4163
- if (ht + et.length > Re) {
4164
- Ke += et.slice(0, Re - ht);
4159
+ let ht = "", Ke = 0;
4160
+ const lt = ((Ht = J.content) == null ? void 0 : Ht.slice(-1)) || [];
4161
+ for (const Xe of lt) {
4162
+ const Qe = He(Xe);
4163
+ if (Ke + Qe.length > De) {
4164
+ ht += Qe.slice(0, De - Ke);
4165
4165
  break;
4166
4166
  }
4167
- Ke += et + `
4168
- `, ht += et.length;
4167
+ ht += Qe + `
4168
+ `, Ke += Qe.length;
4169
4169
  }
4170
- return Ee = (ze + Ke).trim(), Ee && (Ee = `Document context (${Ge} chars before, ${ht} chars after):
4170
+ return Ee = (ze + ht).trim(), Ee && (Ee = `Document context (${Ye} chars before, ${Ke} chars after):
4171
4171
  ${Ee}`), Ee;
4172
4172
  }, [t, n, R]), le = M(async () => {
4173
4173
  var J;
4174
4174
  if (u.trim())
4175
4175
  try {
4176
4176
  a(!0), c(!0), f(""), m(!1), (J = P == null ? void 0 : P.onPromptUsage) == null || J.call(P);
4177
- const ue = oe(), Re = R ? `Context from document:
4177
+ const ue = oe(), De = R ? `Context from document:
4178
4178
  ${ue}
4179
4179
 
4180
4180
  User prompt: ${u} /no_think` : `${u} /no_think`;
@@ -4184,7 +4184,7 @@ User prompt: ${u} /no_think` : `${u} /no_think`;
4184
4184
  let He = "";
4185
4185
  try {
4186
4186
  await Ee.streamModel(
4187
- Re,
4187
+ De,
4188
4188
  P.activeModel.modelName,
4189
4189
  (ze) => {
4190
4190
  He += ze, f(He);
@@ -4205,7 +4205,7 @@ User prompt: ${u} /no_think` : `${u} /no_think`;
4205
4205
  }
4206
4206
  } else if (Ee != null && Ee.callModel) {
4207
4207
  const He = await Ee.callModel(
4208
- Re,
4208
+ De,
4209
4209
  P.activeModel.modelName
4210
4210
  );
4211
4211
  s == null || s({
@@ -4242,8 +4242,8 @@ User prompt: ${u} /no_think` : `${u} /no_think`;
4242
4242
  if (typeof n == "function") {
4243
4243
  g(!0);
4244
4244
  const J = setTimeout(() => {
4245
- t.commands.command(({ tr: ue, dispatch: Re }) => {
4246
- if (Re) {
4245
+ t.commands.command(({ tr: ue, dispatch: De }) => {
4246
+ if (De) {
4247
4247
  const Ee = n();
4248
4248
  if (Ee !== void 0) {
4249
4249
  ue.delete(Ee, Ee + e.nodeSize);
@@ -4261,8 +4261,8 @@ User prompt: ${u} /no_think` : `${u} /no_think`;
4261
4261
  if (typeof n == "function") {
4262
4262
  g(!0);
4263
4263
  const J = setTimeout(() => {
4264
- t.commands.command(({ tr: ue, dispatch: Re }) => {
4265
- if (Re) {
4264
+ t.commands.command(({ tr: ue, dispatch: De }) => {
4265
+ if (De) {
4266
4266
  const Ee = n();
4267
4267
  if (Ee !== void 0) {
4268
4268
  ue.delete(Ee, Ee + e.nodeSize);
@@ -4287,17 +4287,17 @@ User prompt: ${u} /no_think` : `${u} /no_think`;
4287
4287
  (J) => {
4288
4288
  s == null || s({ model: J });
4289
4289
  const ue = P == null ? void 0 : P.defaultModels.find(
4290
- (Re) => Re.modelName === J
4290
+ (De) => De.modelName === J
4291
4291
  );
4292
4292
  ue && (P != null && P.setActiveModel) && P.setActiveModel(ue);
4293
4293
  },
4294
4294
  [s, P]
4295
4295
  ), G = M(() => {
4296
- var ue, Re;
4296
+ var ue, De;
4297
4297
  if (s == null || s({ content: "" }), m(!1), f(""), !N.current) return;
4298
4298
  (ue = N.current) == null || ue.focus();
4299
4299
  const J = N.current.value.length;
4300
- (Re = N.current) == null || Re.setSelectionRange(J, J), N.current.scrollTop = N.current.scrollHeight;
4300
+ (De = N.current) == null || De.setSelectionRange(J, J), N.current.scrollTop = N.current.scrollHeight;
4301
4301
  }, [s]), K = M(() => {
4302
4302
  A(!0);
4303
4303
  }, []), V = M(() => {
@@ -4662,7 +4662,7 @@ User prompt: ${u} /no_think` : `${u} /no_think`;
4662
4662
  })
4663
4663
  };
4664
4664
  }
4665
- }), Yt = (e) => {
4665
+ }), Xt = (e) => {
4666
4666
  try {
4667
4667
  e();
4668
4668
  } catch {
@@ -4684,37 +4684,37 @@ User prompt: ${u} /no_think` : `${u} /no_think`;
4684
4684
  if (!e)
4685
4685
  return;
4686
4686
  const t = Rp(e);
4687
- t && (Yt(() => {
4687
+ t && (Xt(() => {
4688
4688
  var n;
4689
4689
  return (n = t.destroy) == null ? void 0 : n.call(t);
4690
- }), Yt(() => {
4690
+ }), Xt(() => {
4691
4691
  var n, s;
4692
4692
  return (s = (n = t.mapping) == null ? void 0 : n.clear) == null ? void 0 : s.call(n);
4693
- }), Yt(() => {
4693
+ }), Xt(() => {
4694
4694
  var n, s;
4695
4695
  return (s = (n = t.isOMark) == null ? void 0 : n.clear) == null ? void 0 : s.call(n);
4696
- }), Yt(() => {
4696
+ }), Xt(() => {
4697
4697
  t.beforeTransactionSelection = null;
4698
- }), Yt(() => {
4698
+ }), Xt(() => {
4699
4699
  t._domSelectionInView = null;
4700
4700
  }));
4701
4701
  }, la = (e) => {
4702
4702
  if (!e)
4703
4703
  return;
4704
4704
  const t = Ap(e), n = t == null ? void 0 : t.undoManager;
4705
- n && (Yt(() => {
4705
+ n && (Xt(() => {
4706
4706
  var s;
4707
4707
  return (s = n.clear) == null ? void 0 : s.call(n, !0, !0);
4708
- }), Yt(() => {
4708
+ }), Xt(() => {
4709
4709
  var s;
4710
4710
  return (s = n.destroy) == null ? void 0 : s.call(n);
4711
- }), Yt(() => {
4711
+ }), Xt(() => {
4712
4712
  n.restore = null;
4713
- }), Yt(() => {
4713
+ }), Xt(() => {
4714
4714
  n.undoStack = [];
4715
- }), Yt(() => {
4715
+ }), Xt(() => {
4716
4716
  n.redoStack = [];
4717
- }), Yt(() => {
4717
+ }), Xt(() => {
4718
4718
  t.prevSel = null;
4719
4719
  }));
4720
4720
  }, Ip = (e) => {
@@ -4984,18 +4984,18 @@ const _p = (e, t, n) => t ? ml(n) : Fu(e).then(
4984
4984
  }) => {
4985
4985
  const V = (c == null ? void 0 : c.enabled) === !0, D = V ? c.connection : null, { activeCommentId: se, setActiveCommentId: fe, focusCommentWithActiveId: re } = Wp(), Se = F(H);
4986
4986
  Se.current = H;
4987
- const J = F(null), ue = !!(R && T), { tocItems: Re, setTocItems: Ee, handleTocUpdateForTab: He } = $p(H), ze = !!(i && a === "suggest"), Ge = F(cl), kt = G ?? Ge, Ke = M(
4987
+ const J = F(null), ue = !!(R && T), { tocItems: De, setTocItems: Ee, handleTocUpdateForTab: He } = $p(H), ze = !!(i && a === "suggest"), Ye = F(cl), xt = G ?? Ye, ht = M(
4988
4988
  (we, pe) => {
4989
4989
  Se.current === we && (fe(pe || null), pe && setTimeout(() => re(pe)));
4990
4990
  },
4991
4991
  [re, fe]
4992
- ), ht = M(
4992
+ ), Ke = M(
4993
4993
  (we, pe, Te) => {
4994
4994
  Se.current === we && He(we, pe, Te);
4995
4995
  },
4996
4996
  [He]
4997
4997
  ), {
4998
- buildExtensionsForTab: at,
4998
+ buildExtensionsForTab: lt,
4999
4999
  commentAnchorsRef: je,
5000
5000
  draftAnchorsRef: Ht,
5001
5001
  storeApiRef: Xe
@@ -5014,24 +5014,24 @@ const _p = (e, t, n) => t ? ml(n) : Fu(e).then(
5014
5014
  maxTokens: C,
5015
5015
  hasAvailableModels: ue,
5016
5016
  activeCommentId: se,
5017
- onCommentActivated: Ke,
5018
- onTocUpdateForTab: ht,
5017
+ onCommentActivated: ht,
5018
+ onTocUpdateForTab: Ke,
5019
5019
  externalExtensions: le,
5020
5020
  initialCommentAnchors: L,
5021
5021
  isSuggestionMode: ze,
5022
- dBlockRuntimeStateRef: kt,
5022
+ dBlockRuntimeStateRef: xt,
5023
5023
  docSchemaVersion: K
5024
- }), { handleCommentInteraction: et, handleCommentClick: St } = Gp({
5024
+ }), { handleCommentInteraction: Qe, handleCommentClick: St } = Gp({
5025
5025
  isFocusMode: m,
5026
5026
  onCommentInteraction: p
5027
- }), ln = F(m);
5027
+ }), an = F(m);
5028
5028
  j(() => {
5029
- ln.current = m;
5029
+ an.current = m;
5030
5030
  }, [m]);
5031
- const en = M(
5031
+ const ln = M(
5032
5032
  (we, pe) => {
5033
5033
  var Ae;
5034
- if (!vs(we, J.current) || ln.current)
5034
+ if (!vs(we, J.current) || an.current)
5035
5035
  return !1;
5036
5036
  const Te = nr(pe.target), ge = Te == null ? void 0 : Te.closest(
5037
5037
  "[data-suggestion-id][data-comment-id]"
@@ -5039,14 +5039,14 @@ const _p = (e, t, n) => t ? ml(n) : Fu(e).then(
5039
5039
  return !Fe || !(((Ae = Xe.current) == null ? void 0 : Ae.getState().focusSubmittedSuggestionFromEditor(Fe)) ?? !1) ? !1 : (pe.preventDefault(), pe.stopPropagation(), we.dom.blur(), !0);
5040
5040
  },
5041
5041
  [Xe]
5042
- ), tn = F(!0), [Tn, ms] = Y([]), fn = F(X);
5043
- fn.current = X, j(() => {
5042
+ ), zt = F(!0), [cn, ms] = Y([]), gn = F(X);
5043
+ gn.current = X, j(() => {
5044
5044
  H && fe(null);
5045
5045
  }, [H, fe]);
5046
5046
  const ps = M(
5047
5047
  (we) => {
5048
- const pe = !fn.current && tn.current && Se.current === we, Te = new dl({
5049
- extensions: at(we),
5048
+ const pe = !gn.current && zt.current && Se.current === we, Te = new dl({
5049
+ extensions: lt(we),
5050
5050
  editorProps: {
5051
5051
  clipboardTextSerializer(ge) {
5052
5052
  return ge.content.textBetween(0, ge.content.size, `
@@ -5055,13 +5055,13 @@ const _p = (e, t, n) => t ? ml(n) : Fu(e).then(
5055
5055
  },
5056
5056
  ...ql,
5057
5057
  handleDOMEvents: {
5058
- mousedown: en,
5059
- mouseover: (ge, Fe) => vs(ge, J.current) ? et(ge, Fe) : !1,
5058
+ mousedown: ln,
5059
+ mouseover: (ge, Fe) => vs(ge, J.current) ? Qe(ge, Fe) : !1,
5060
5060
  keydown: (ge, Fe) => {
5061
5061
  if (!vs(ge, J.current))
5062
5062
  return !1;
5063
5063
  if (["ArrowUp", "ArrowDown", "Enter"].includes(Fe.key)) {
5064
- const De = ge.dom.ownerDocument, Ae = De.getElementById("slash-command"), _e = De.getElementById("emoji-list");
5064
+ const Ie = ge.dom.ownerDocument, Ae = Ie.getElementById("slash-command"), _e = Ie.getElementById("emoji-list");
5065
5065
  if (Ae || _e)
5066
5066
  return !0;
5067
5067
  }
@@ -5076,33 +5076,33 @@ const _p = (e, t, n) => t ? ml(n) : Fu(e).then(
5076
5076
  });
5077
5077
  }), !1)
5078
5078
  },
5079
- handleClick: (ge, Fe, De) => {
5079
+ handleClick: (ge, Fe, Ie) => {
5080
5080
  var Ce;
5081
5081
  if (!vs(ge, J.current))
5082
5082
  return !1;
5083
- const Ae = De.metaKey || De.ctrlKey, _e = nr(De.target), Oe = _e == null ? void 0 : _e.closest("a");
5083
+ const Ae = Ie.metaKey || Ie.ctrlKey, _e = nr(Ie.target), Oe = _e == null ? void 0 : _e.closest("a");
5084
5084
  if (Oe != null && Oe.href) {
5085
5085
  const Tt = new URL(Oe.href, window.location.href);
5086
5086
  if (Tt.hash && Tt.origin === window.location.origin) {
5087
5087
  const Dt = decodeURIComponent(Tt.hash.slice(1)), Et = new URLSearchParams(Dt).get("heading");
5088
5088
  if (Et) {
5089
- De.preventDefault();
5090
- const $t = Et.split("-").pop();
5091
- if ($t) {
5089
+ Ie.preventDefault();
5090
+ const qt = Et.split("-").pop();
5091
+ if (qt) {
5092
5092
  const Yn = ge.dom.querySelectorAll("[data-toc-id]"), Vs = Array.from(Yn).find(
5093
- (wn) => {
5093
+ (bn) => {
5094
5094
  var Rn;
5095
- return (Rn = wn.dataset.tocId) == null ? void 0 : Rn.includes($t);
5095
+ return (Rn = bn.dataset.tocId) == null ? void 0 : Rn.includes(qt);
5096
5096
  }
5097
5097
  );
5098
5098
  if (Vs) {
5099
- const wn = kn({
5099
+ const bn = Sn({
5100
5100
  targetElement: Vs,
5101
5101
  editorRoot: ge.dom
5102
5102
  });
5103
- return wn && requestAnimationFrame(() => {
5104
- const Rn = wn.getBoundingClientRect(), Ws = Vs.getBoundingClientRect();
5105
- wn.scrollBy({
5103
+ return bn && requestAnimationFrame(() => {
5104
+ const Rn = bn.getBoundingClientRect(), Ws = Vs.getBoundingClientRect();
5105
+ bn.scrollBy({
5106
5106
  top: Ws.top - Rn.top,
5107
5107
  behavior: "smooth"
5108
5108
  });
@@ -5115,11 +5115,11 @@ const _p = (e, t, n) => t ? ml(n) : Fu(e).then(
5115
5115
  return !1;
5116
5116
  if (((Ce = Oe == null ? void 0 : Oe.textContent) == null ? void 0 : Ce.match(mu)) ?? !1) {
5117
5117
  if (Ae)
5118
- return De.preventDefault(), window.open(Oe.href, "_blank"), !0;
5118
+ return Ie.preventDefault(), window.open(Oe.href, "_blank"), !0;
5119
5119
  } else
5120
- return De.preventDefault(), window.open(Oe.href, "_blank"), !0;
5120
+ return Ie.preventDefault(), window.open(Oe.href, "_blank"), !0;
5121
5121
  }
5122
- return St ? St(ge, Fe, De) : !1;
5122
+ return St ? St(ge, Fe, Ie) : !1;
5123
5123
  },
5124
5124
  // `...DdocEditorProps` above already sets `attributes` as ONE key
5125
5125
  // inside this same object literal — a later `attributes:` key
@@ -5136,18 +5136,18 @@ const _p = (e, t, n) => t ? ml(n) : Fu(e).then(
5136
5136
  textDirection: "auto",
5137
5137
  autofocus: pe ? "start" : !1
5138
5138
  });
5139
- return tn.current = !1, Te;
5139
+ return zt.current = !1, Te;
5140
5140
  },
5141
5141
  [
5142
- at,
5143
- en,
5142
+ lt,
5143
+ ln,
5144
5144
  St,
5145
- et,
5145
+ Qe,
5146
5146
  K
5147
5147
  ]
5148
- ), Kn = ve(() => V, [V]), En = ve(() => !(i && !ze), [i, ze]), gn = M((we) => {
5148
+ ), Kn = ve(() => V, [V]), En = ve(() => !(i && !ze), [i, ze]), yn = M((we) => {
5149
5149
  Fi(we), Ip(we), Fi(we);
5150
- }, []), { editor: ie, cachedEditorEntries: yn } = Fp({
5150
+ }, []), { editor: ie, cachedEditorEntries: xn } = Fp({
5151
5151
  activeTabId: H,
5152
5152
  tabIds: U,
5153
5153
  activeTabIdRef: Se,
@@ -5155,23 +5155,23 @@ const _p = (e, t, n) => t ? ml(n) : Fu(e).then(
5155
5155
  editorRef: q,
5156
5156
  readyState: En,
5157
5157
  createEditorForTab: ps,
5158
- destroyEditor: gn
5158
+ destroyEditor: yn
5159
5159
  });
5160
5160
  j(() => {
5161
- ie && (tn.current = !1);
5161
+ ie && (zt.current = !1);
5162
5162
  }, [ie]), j(() => {
5163
5163
  var pe;
5164
5164
  if (!ie || ie.isDestroyed) return;
5165
5165
  const we = (pe = ie.view) == null ? void 0 : pe.dom;
5166
5166
  we && (ze ? we.setAttribute("data-suggestion-mode", "true") : we.removeAttribute("data-suggestion-mode"));
5167
5167
  }, [ie, ze]);
5168
- const At = F(null), nn = F(null), Pe = F(0), Me = F(""), st = M(
5168
+ const At = F(null), tn = F(null), Pe = F(0), Me = F(""), st = M(
5169
5169
  (we) => {
5170
5170
  !ie || ie.isDestroyed || (At.current && clearTimeout(At.current), At.current = setTimeout(() => {
5171
5171
  At.current = null;
5172
5172
  const pe = ++Pe.current;
5173
- ao(nn.current), nn.current = ha(() => {
5174
- nn.current = null, pe === Pe.current && J.current === ie && !ie.isDestroyed && ie.commands.updateTableOfContents();
5173
+ ao(tn.current), tn.current = ha(() => {
5174
+ tn.current = null, pe === Pe.current && J.current === ie && !ie.isDestroyed && ie.commands.updateTableOfContents();
5175
5175
  });
5176
5176
  }, we));
5177
5177
  },
@@ -5189,13 +5189,13 @@ const _p = (e, t, n) => t ? ml(n) : Fu(e).then(
5189
5189
  Te !== Me.current && (Me.current = Te, st(300));
5190
5190
  };
5191
5191
  return ie.on("transaction", we), () => {
5192
- ie.off("transaction", we), At.current && clearTimeout(At.current), ao(nn.current), nn.current = null, Pe.current += 1;
5192
+ ie.off("transaction", we), At.current && clearTimeout(At.current), ao(tn.current), tn.current = null, Pe.current += 1;
5193
5193
  };
5194
5194
  }, [ie, st]), j(() => {
5195
5195
  if (!i) return;
5196
5196
  const we = (pe) => {
5197
- var De;
5198
- const Te = nr(pe.target), ge = (De = J.current) == null ? void 0 : De.view.dom;
5197
+ var Ie;
5198
+ const Te = nr(pe.target), ge = (Ie = J.current) == null ? void 0 : Ie.view.dom;
5199
5199
  if (!ge || !Te || !ge.contains(Te))
5200
5200
  return;
5201
5201
  const Fe = Te.closest("a");
@@ -5210,19 +5210,19 @@ const _p = (e, t, n) => t ? ml(n) : Fu(e).then(
5210
5210
  const It = Array.from(
5211
5211
  ge.querySelectorAll("[data-toc-id]")
5212
5212
  ).find((Dt) => {
5213
- var un;
5214
- return (un = Dt.dataset.tocId) == null ? void 0 : un.includes(Tt);
5213
+ var hn;
5214
+ return (hn = Dt.dataset.tocId) == null ? void 0 : hn.includes(Tt);
5215
5215
  });
5216
5216
  if (It) {
5217
5217
  pe.preventDefault(), pe.stopPropagation();
5218
- const Dt = kn({
5218
+ const Dt = Sn({
5219
5219
  targetElement: It,
5220
5220
  editorRoot: ge
5221
5221
  });
5222
5222
  Dt && requestAnimationFrame(() => {
5223
- const un = Dt.getBoundingClientRect(), Et = It.getBoundingClientRect();
5223
+ const hn = Dt.getBoundingClientRect(), Et = It.getBoundingClientRect();
5224
5224
  Dt.scrollBy({
5225
- top: Et.top - un.top,
5225
+ top: Et.top - hn.top,
5226
5226
  behavior: "smooth"
5227
5227
  });
5228
5228
  });
@@ -5236,9 +5236,9 @@ const _p = (e, t, n) => t ? ml(n) : Fu(e).then(
5236
5236
  }, [i]), j(() => {
5237
5237
  Kn && _(!u && !W);
5238
5238
  }, [Kn, u, W]);
5239
- const Ie = F(!1), zt = F(null), rt = M(
5239
+ const Re = F(!1), Kt = F(null), rt = M(
5240
5240
  (we) => {
5241
- const pe = we.map((Te) => lt(Te));
5241
+ const pe = we.map((Te) => at(Te));
5242
5242
  qe.applyUpdate(e, qe.mergeUpdates(pe), "self");
5243
5243
  },
5244
5244
  [e]
@@ -5258,16 +5258,16 @@ const _p = (e, t, n) => t ? ml(n) : Fu(e).then(
5258
5258
  return;
5259
5259
  }
5260
5260
  const pe = `${o || "no-version-id"}:${H || "default"}`;
5261
- if (!n && Ie.current) {
5261
+ if (!n && Re.current) {
5262
5262
  B(!1);
5263
5263
  return;
5264
5264
  }
5265
- if (n && zt.current === pe) {
5265
+ if (n && Kt.current === pe) {
5266
5266
  B(!1);
5267
5267
  return;
5268
5268
  }
5269
5269
  B(!0), queueMicrotask(() => {
5270
- if (l !== "" && l !== void 0 && (ct(l) ? Array.isArray(l) ? rt(l) : qe.applyUpdate(e, lt(l), "self") : ie.commands.setContent(
5270
+ if (l !== "" && l !== void 0 && (ct(l) ? Array.isArray(l) ? rt(l) : qe.applyUpdate(e, at(l), "self") : ie.commands.setContent(
5271
5271
  fu({
5272
5272
  data: l,
5273
5273
  ignoreCorruptedData: P,
@@ -5275,7 +5275,7 @@ const _p = (e, t, n) => t ? ml(n) : Fu(e).then(
5275
5275
  wrapInDBlock: !!ie.schema.nodes.dBlock
5276
5276
  })
5277
5277
  )), n) {
5278
- zt.current = pe, B(!1);
5278
+ Kt.current = pe, B(!1);
5279
5279
  return;
5280
5280
  }
5281
5281
  const Te = l === void 0 && ie.isEmpty;
@@ -5283,7 +5283,7 @@ const _p = (e, t, n) => t ? ml(n) : Fu(e).then(
5283
5283
  }).finally(() => {
5284
5284
  Te && B(!1);
5285
5285
  });
5286
- }), Ie.current = !0;
5286
+ }), Re.current = !0;
5287
5287
  }, [
5288
5288
  l,
5289
5289
  V,
@@ -5301,7 +5301,7 @@ const _p = (e, t, n) => t ? ml(n) : Fu(e).then(
5301
5301
  oe
5302
5302
  ]);
5303
5303
  const mt = F(() => {
5304
- }), jn = F(null), An = 3e4, Kt = F(null), sn = F(!1);
5304
+ }), jn = F(null), An = 3e4, jt = F(null), nn = F(!1);
5305
5305
  Yp({
5306
5306
  editor: ie,
5307
5307
  isReady: u,
@@ -5317,18 +5317,18 @@ const _p = (e, t, n) => t ? ml(n) : Fu(e).then(
5317
5317
  pe.state.doc.nodesBetween(
5318
5318
  Te,
5319
5319
  ge,
5320
- (De, Ae) => {
5321
- De.marks && De.marks.forEach((_e) => {
5320
+ (Ie, Ae) => {
5321
+ Ie.marks && Ie.marks.forEach((_e) => {
5322
5322
  _e.type.name === "textStyle" && _e.attrs.color && Fe.push({
5323
5323
  from: Ae,
5324
- to: Ae + De.nodeSize,
5324
+ to: Ae + Ie.nodeSize,
5325
5325
  mark: _e
5326
5326
  });
5327
5327
  });
5328
5328
  }
5329
- ), pe.chain().setTextSelection({ from: Te, to: ge }).setColor("").run(), Fe.forEach(({ from: De, to: Ae, mark: _e }) => {
5329
+ ), pe.chain().setTextSelection({ from: Te, to: ge }).setColor("").run(), Fe.forEach(({ from: Ie, to: Ae, mark: _e }) => {
5330
5330
  const Oe = _e.attrs.color;
5331
- hl(Oe) || pe.chain().setTextSelection({ from: De, to: Ae }).setColor(Oe).run();
5331
+ hl(Oe) || pe.chain().setTextSelection({ from: Ie, to: Ae }).setColor(Oe).run();
5332
5332
  }), pe.commands.setTextSelection(ge);
5333
5333
  }, 0);
5334
5334
  };
@@ -5336,9 +5336,9 @@ const _p = (e, t, n) => t ? ml(n) : Fu(e).then(
5336
5336
  ie.off("paste", we);
5337
5337
  };
5338
5338
  }, [ie]);
5339
- const jt = F(null), Nt = F(null), pt = F(0), Vt = F(
5339
+ const Vt = F(null), Nt = F(null), pt = F(0), Wt = F(
5340
5340
  null
5341
- ), Rt = F({}), xn = F(0), Vn = F(I);
5341
+ ), Rt = F({}), wn = F(0), Vn = F(I);
5342
5342
  j(() => {
5343
5343
  Vn.current = I;
5344
5344
  });
@@ -5349,22 +5349,22 @@ const _p = (e, t, n) => t ? ml(n) : Fu(e).then(
5349
5349
  return (pe = Vn.current) == null ? void 0 : pe.call(Vn, we);
5350
5350
  }
5351
5351
  ));
5352
- const xe = Wn.current, Wt = !!I;
5352
+ const xe = Wn.current, $t = !!I;
5353
5353
  j(() => {
5354
- if (!N && !Wt)
5354
+ if (!N && !$t)
5355
5355
  return;
5356
5356
  const we = gu();
5357
- return Vt.current = we, () => {
5358
- Vt.current === we && (Vt.current = null), we.destroy();
5357
+ return Wt.current = we, () => {
5358
+ Wt.current === we && (Wt.current = null), we.destroy();
5359
5359
  };
5360
- }, [N, Wt]), j(() => {
5361
- if (!ie || !S && !w && !b && !N && !Wt)
5360
+ }, [N, $t]), j(() => {
5361
+ if (!ie || !S && !w && !b && !N && !$t)
5362
5362
  return;
5363
5363
  const we = () => {
5364
- if (!b && !Wt || J.current !== ie || ie.isDestroyed)
5364
+ if (!b && !$t || J.current !== ie || ie.isDestroyed)
5365
5365
  return;
5366
- const { from: ge, to: Fe, empty: De } = ie.state.selection;
5367
- if (De) {
5366
+ const { from: ge, to: Fe, empty: Ie } = ie.state.selection;
5367
+ if (Ie) {
5368
5368
  b == null || b(0), xe.publish({ selectedWords: 0 });
5369
5369
  return;
5370
5370
  }
@@ -5375,23 +5375,23 @@ const _p = (e, t, n) => t ? ml(n) : Fu(e).then(
5375
5375
  ge ? [
5376
5376
  ...ge.transaction ? [ge.transaction] : [],
5377
5377
  ...ge.appendedTransactions ?? []
5378
- ].some(Kp) && (xn.current += 1) : (xn.current += 1, xe.beginTab(
5378
+ ].some(Kp) && (wn.current += 1) : (wn.current += 1, xe.beginTab(
5379
5379
  ((Fe = Rt.current[H]) == null ? void 0 : Fe.pageCount) ?? null
5380
- )), jt.current && clearTimeout(jt.current), jt.current = setTimeout(() => {
5381
- if (jt.current = null, ie && J.current === ie && !ie.isDestroyed) {
5382
- const De = ie.storage.characterCount.characters() ?? 0;
5383
- S == null || S(De);
5380
+ )), Vt.current && clearTimeout(Vt.current), Vt.current = setTimeout(() => {
5381
+ if (Vt.current = null, ie && J.current === ie && !ie.isDestroyed) {
5382
+ const Ie = ie.storage.characterCount.characters() ?? 0;
5383
+ S == null || S(Ie);
5384
5384
  const Ae = ie.storage.characterCount.words() ?? 0;
5385
- if (w == null || w(Ae), xe.publish({ characters: De, words: Ae }, { tick: !0 }), (N || Wt) && Gl(ie) === null) {
5386
- const _e = Vt.current;
5385
+ if (w == null || w(Ae), xe.publish({ characters: Ie, words: Ae }, { tick: !0 }), (N || $t) && Gl(ie) === null) {
5386
+ const _e = Wt.current;
5387
5387
  if (!_e)
5388
5388
  return;
5389
5389
  const Oe = Rt.current[H];
5390
- if (Oe && De > Up && Oe.structuralVersion === xn.current && Math.abs(De - Oe.characters) < Oe.characters * Hp && Date.now() - Oe.at < zp) {
5390
+ if (Oe && Ie > Up && Oe.structuralVersion === wn.current && Math.abs(Ie - Oe.characters) < Oe.characters * Hp && Date.now() - Oe.at < zp) {
5391
5391
  const It = Math.max(
5392
5392
  1,
5393
5393
  Math.round(
5394
- Oe.pageCount * De / Oe.characters
5394
+ Oe.pageCount * Ie / Oe.characters
5395
5395
  )
5396
5396
  );
5397
5397
  N == null || N(It), xe.publish({ pages: It });
@@ -5401,19 +5401,19 @@ const _p = (e, t, n) => t ? ml(n) : Fu(e).then(
5401
5401
  ao(Nt.current), Nt.current = ha(() => {
5402
5402
  if (Nt.current = null, Ce !== pt.current || J.current !== ie || ie.isDestroyed)
5403
5403
  return;
5404
- const It = ie.getHTML(), Dt = ie.state.doc === Tt ? De : ie.storage.characterCount.characters() ?? 0, un = xn.current;
5404
+ const It = ie.getHTML(), Dt = ie.state.doc === Tt ? Ie : ie.storage.characterCount.characters() ?? 0, hn = wn.current;
5405
5405
  _e.getPageCount(It).then((Et) => {
5406
5406
  Ce === pt.current && J.current === ie && ie && !ie.isDestroyed && (Rt.current[H] = {
5407
5407
  characters: Dt,
5408
5408
  pageCount: Et,
5409
5409
  at: Date.now(),
5410
- structuralVersion: un
5410
+ structuralVersion: hn
5411
5411
  }, N == null || N(Et), xe.publish({ pages: Et }));
5412
5412
  }).catch(() => {
5413
5413
  var Et;
5414
5414
  if (Ce === pt.current && J.current === ie && ie && !ie.isDestroyed) {
5415
- const $t = ((Et = Rt.current[H]) == null ? void 0 : Et.pageCount) ?? 1;
5416
- N == null || N($t), xe.publish({ pages: $t });
5415
+ const qt = ((Et = Rt.current[H]) == null ? void 0 : Et.pageCount) ?? 1;
5416
+ N == null || N(qt), xe.publish({ pages: qt });
5417
5417
  }
5418
5418
  });
5419
5419
  });
@@ -5422,17 +5422,17 @@ const _p = (e, t, n) => t ? ml(n) : Fu(e).then(
5422
5422
  }, 500);
5423
5423
  };
5424
5424
  pe(), we();
5425
- const Te = N || Wt ? Lp(
5425
+ const Te = N || $t ? Lp(
5426
5426
  ie,
5427
5427
  (ge) => {
5428
5428
  J.current === ie && (N == null || N(ge), xe.publish({ pages: ge }));
5429
5429
  },
5430
5430
  () => {
5431
- xn.current += 1, pe({});
5431
+ wn.current += 1, pe({});
5432
5432
  }
5433
5433
  ) : void 0;
5434
5434
  return ie.on("update", pe), ie.on("selectionUpdate", we), () => {
5435
- Te == null || Te(), ie.off("update", pe), ie.off("selectionUpdate", we), jt.current && clearTimeout(jt.current), ao(Nt.current), Nt.current = null, pt.current += 1;
5435
+ Te == null || Te(), ie.off("update", pe), ie.off("selectionUpdate", we), Vt.current && clearTimeout(Vt.current), ao(Nt.current), Nt.current = null, pt.current += 1;
5436
5436
  };
5437
5437
  }, [
5438
5438
  H,
@@ -5441,32 +5441,32 @@ const _p = (e, t, n) => t ? ml(n) : Fu(e).then(
5441
5441
  N,
5442
5442
  w,
5443
5443
  b,
5444
- Wt,
5444
+ $t,
5445
5445
  xe
5446
5446
  ]), j(() => {
5447
5447
  const we = (pe) => {
5448
- (pe.ctrlKey || pe.metaKey) && pe.key === "p" && (pe.preventDefault(), ie && _p(ie, $, Tn));
5448
+ (pe.ctrlKey || pe.metaKey) && pe.key === "p" && (pe.preventDefault(), ie && _p(ie, $, cn));
5449
5449
  };
5450
5450
  return window.addEventListener("keydown", we), () => {
5451
5451
  window.removeEventListener("keydown", we);
5452
5452
  };
5453
- }, [ie, $, Tn]), j(() => {
5453
+ }, [ie, $, cn]), j(() => {
5454
5454
  if (!V || !D) return;
5455
5455
  const we = D.livePresence === !0 || D.connectOnOpen === !0, pe = () => {
5456
- sn.current || (sn.current = !0, Q(D));
5456
+ nn.current || (nn.current = !0, Q(D));
5457
5457
  }, Te = () => {
5458
- sn.current && (sn.current = !1, ee());
5458
+ nn.current && (nn.current = !1, ee());
5459
5459
  }, ge = () => {
5460
- Kt.current && clearTimeout(Kt.current), Kt.current = setTimeout(() => {
5461
- Kt.current = null, D.livePresence !== !0 && D.connectOnOpen !== !0 && Te();
5460
+ jt.current && clearTimeout(jt.current), jt.current = setTimeout(() => {
5461
+ jt.current = null, D.livePresence !== !0 && D.connectOnOpen !== !0 && Te();
5462
5462
  }, An);
5463
5463
  };
5464
5464
  we && pe();
5465
- const Fe = (De, Ae) => {
5465
+ const Fe = (Ie, Ae) => {
5466
5466
  Ae === "self" || Ae === "remote" || !me || (pe(), ge());
5467
5467
  };
5468
5468
  return e == null || e.on("update", Fe), () => {
5469
- e == null || e.off("update", Fe), Kt.current && (clearTimeout(Kt.current), Kt.current = null);
5469
+ e == null || e.off("update", Fe), jt.current && (clearTimeout(jt.current), jt.current = null);
5470
5470
  };
5471
5471
  }, [
5472
5472
  V,
@@ -5480,7 +5480,7 @@ const _p = (e, t, n) => t ? ml(n) : Fu(e).then(
5480
5480
  ee,
5481
5481
  me
5482
5482
  ]);
5483
- const $n = window.location.hash.startsWith("#") ? window.location.hash.substring(1) : window.location.hash, { isNativeMobile: qn } = Qt(t), fs = new URLSearchParams($n), cn = fs.get("heading"), ft = cn == null ? void 0 : cn.split("-").pop(), Gn = M(
5483
+ const $n = window.location.hash.startsWith("#") ? window.location.hash.substring(1) : window.location.hash, { isNativeMobile: qn } = Zt(t), fs = new URLSearchParams($n), dn = fs.get("heading"), ft = dn == null ? void 0 : dn.split("-").pop(), Gn = M(
5484
5484
  (we) => {
5485
5485
  if (ie)
5486
5486
  try {
@@ -5493,11 +5493,11 @@ const _p = (e, t, n) => t ? ml(n) : Fu(e).then(
5493
5493
  if (!Te) return;
5494
5494
  const ge = ul(
5495
5495
  Te == null ? void 0 : Te.textContent
5496
- ), Fe = cn == null ? void 0 : cn.split("-").slice(0, -1).join("-");
5496
+ ), Fe = dn == null ? void 0 : dn.split("-").slice(0, -1).join("-");
5497
5497
  ge !== Fe && (fs.set("heading", `${ge}-${we}`), window.location.hash = fs.toString());
5498
- const De = ie.view.posAtDOM(Te, 0), Ae = ie.view.state.tr;
5499
- Ae.setSelection(new Es(Ae.doc.resolve(De))), ie.view.dispatch(Ae);
5500
- const _e = kn({
5498
+ const Ie = ie.view.posAtDOM(Te, 0), Ae = ie.view.state.tr;
5499
+ Ae.setSelection(new Es(Ae.doc.resolve(Ie))), ie.view.dispatch(Ae);
5500
+ const _e = Sn({
5501
5501
  targetElement: Te,
5502
5502
  editorRoot: ie.view.dom
5503
5503
  });
@@ -5531,7 +5531,7 @@ const _p = (e, t, n) => t ? ml(n) : Fu(e).then(
5531
5531
  const we = setTimeout(() => {
5532
5532
  const { tr: pe, doc: Te } = ie.state;
5533
5533
  let ge = !1;
5534
- Te.descendants((Fe, De) => {
5534
+ Te.descendants((Fe, Ie) => {
5535
5535
  if (!Fe.marks || Fe.marks.length === 0) return;
5536
5536
  const Ae = Fe.marks.find(
5537
5537
  (Ce) => Ce.type.name === "textStyle" && Ce.attrs.color
@@ -5548,22 +5548,22 @@ const _p = (e, t, n) => t ? ml(n) : Fu(e).then(
5548
5548
  color: Oe,
5549
5549
  "data-original-color": _e
5550
5550
  });
5551
- pe.removeMark(De, De + Fe.nodeSize, Ae), pe.addMark(De, De + Fe.nodeSize, Ce);
5551
+ pe.removeMark(Ie, Ie + Fe.nodeSize, Ae), pe.addMark(Ie, Ie + Fe.nodeSize, Ce);
5552
5552
  }
5553
5553
  }), ge && (pe.setMeta("addToHistory", !1), ie.view.dispatch(pe));
5554
5554
  }, 0);
5555
5555
  return () => clearTimeout(we);
5556
5556
  }, [ie, l, O, ce]), Xp(ie, l, !1);
5557
- const dn = F(null);
5557
+ const un = F(null);
5558
5558
  return j(() => {
5559
- ie && dn.current !== se && (dn.current = se, xu(ie));
5559
+ ie && un.current !== se && (un.current = se, xu(ie));
5560
5560
  }, [se, ie]), {
5561
5561
  editor: ie,
5562
- cachedEditorEntries: yn,
5562
+ cachedEditorEntries: xn,
5563
5563
  ref: jn,
5564
- slides: Tn,
5564
+ slides: cn,
5565
5565
  setSlides: ms,
5566
- tocItems: Re,
5566
+ tocItems: De,
5567
5567
  setTocItems: Ee,
5568
5568
  activeCommentId: se,
5569
5569
  setActiveCommentId: fe,
@@ -5964,7 +5964,7 @@ const _p = (e, t, n) => t ? ml(n) : Fu(e).then(
5964
5964
  }, 100);
5965
5965
  return () => window.clearTimeout(i);
5966
5966
  }, [e, t, n]);
5967
- }, Zr = (e) => vt(e).parentById.size > 0, Nr = (e) => (e == null ? void 0 : e.depth) ?? 1, ss = (e, t) => {
5967
+ }, Zr = (e) => kt(e).parentById.size > 0, Nr = (e) => (e == null ? void 0 : e.depth) ?? 1, ss = (e, t) => {
5968
5968
  const n = e.findIndex((i) => i.id === t);
5969
5969
  if (n === -1) return [];
5970
5970
  const s = Nr(e[n]), o = [t];
@@ -5978,7 +5978,7 @@ const _p = (e, t, n) => t ? ml(n) : Fu(e).then(
5978
5978
  const n = e.toArray(), s = Math.max(-1, ...t.map((o) => n.indexOf(o)));
5979
5979
  return s === -1 ? n.length : s + 1;
5980
5980
  }, Zp = (e, t, n) => {
5981
- const s = vt(e), o = s.parentById.get(t);
5981
+ const s = kt(e), o = s.parentById.get(t);
5982
5982
  e.transact(() => {
5983
5983
  if (o === void 0) {
5984
5984
  s.order.push(n);
@@ -5988,7 +5988,7 @@ const _p = (e, t, n) => t ? ml(n) : Fu(e).then(
5988
5988
  n.forEach((a) => s.parentById.set(a, o)), s.order.insert(Fo(s.order, i), n);
5989
5989
  });
5990
5990
  }, Jp = (e, t, n, s) => {
5991
- const o = vt(e), i = ds(o), a = i.find((u) => u.id === t);
5991
+ const o = kt(e), i = ds(o), a = i.find((u) => u.id === t);
5992
5992
  if (!a || !Qp(a)) return null;
5993
5993
  const l = ss(i, t), c = i.filter((u) => u.parentId === t).length;
5994
5994
  return e.transact(() => {
@@ -5997,7 +5997,7 @@ const _p = (e, t, n) => t ? ml(n) : Fu(e).then(
5997
5997
  ]);
5998
5998
  }), n;
5999
5999
  }, ef = (e, t, n) => {
6000
- const s = vt(e), { order: o } = s;
6000
+ const s = kt(e), { order: o } = s;
6001
6001
  if (!Zr(e)) {
6002
6002
  const h = o.toArray(), m = h.indexOf(n), p = h.indexOf(t);
6003
6003
  return m === -1 || p === -1 ? !1 : (e.transact(() => {
@@ -6013,7 +6013,7 @@ const _p = (e, t, n) => t ? ml(n) : Fu(e).then(
6013
6013
  o.insert(h, c);
6014
6014
  }), !0;
6015
6015
  }, tf = (e, t, n, s) => {
6016
- const o = vt(e), { order: i } = o, a = ns(o, t);
6016
+ const o = kt(e), { order: i } = o, a = ns(o, t);
6017
6017
  if (!a) return;
6018
6018
  if (!Zr(e)) {
6019
6019
  const m = n();
@@ -6043,7 +6043,7 @@ const _p = (e, t, n) => t ? ml(n) : Fu(e).then(
6043
6043
  }), h;
6044
6044
  }, nf = (e, t, n, s) => {
6045
6045
  var f, x;
6046
- const o = vt(e), { order: i } = o;
6046
+ const o = kt(e), { order: i } = o;
6047
6047
  if (!Zr(e)) {
6048
6048
  if (i.length <= 1)
6049
6049
  throw new Error("Cannot delete the last remaining tab");
@@ -6085,7 +6085,7 @@ const _p = (e, t, n) => t ? ml(n) : Fu(e).then(
6085
6085
  }), p && s && o.tabState.set("activeTabId", p), Yl(i, u);
6086
6086
  }), { snapshots: h, fallbackId: p };
6087
6087
  }, sf = (e, t, n) => {
6088
- const s = vt(e), { order: o } = s, i = t.filter(
6088
+ const s = kt(e), { order: o } = s, i = t.filter(
6089
6089
  (l) => !s.nameById.has(l.tabId)
6090
6090
  );
6091
6091
  if (i.length === 0) return !1;
@@ -6103,7 +6103,7 @@ const _p = (e, t, n) => t ? ml(n) : Fu(e).then(
6103
6103
  }, of = (e) => {
6104
6104
  const t = F([]), n = F([]), s = F(!1), o = M(
6105
6105
  (c, u) => {
6106
- const d = vt(e);
6106
+ const d = kt(e);
6107
6107
  if (!ns(d, c.tabId))
6108
6108
  return !1;
6109
6109
  const m = u === "undo" ? c.previousName : c.nextName, p = u === "undo" ? c.previousEmoji : c.nextEmoji;
@@ -6128,7 +6128,7 @@ const _p = (e, t, n) => t ? ml(n) : Fu(e).then(
6128
6128
  return {
6129
6129
  applyRename: M(
6130
6130
  ({ tabId: c, newName: u, emoji: d }) => {
6131
- const h = vt(e), m = ns(h, c);
6131
+ const h = kt(e), m = ns(h, c);
6132
6132
  if (!m)
6133
6133
  return { tabNotFound: !0 };
6134
6134
  const p = m.name, f = m.emoji, x = u ?? p, g = d ?? f, y = u !== void 0 && x !== p, A = d !== void 0 && g !== f;
@@ -6250,7 +6250,7 @@ const _p = (e, t, n) => t ? ml(n) : Fu(e).then(
6250
6250
  k(O);
6251
6251
  return;
6252
6252
  }
6253
- const H = vt(e);
6253
+ const H = kt(e);
6254
6254
  e.transact(() => {
6255
6255
  H.tabState.set("activeTabId", O);
6256
6256
  }, "self"), k(O);
@@ -6265,40 +6265,40 @@ const _p = (e, t, n) => t ? ml(n) : Fu(e).then(
6265
6265
  O.didWrite && x(), a && bo(O) !== w.current && e.transact(() => {
6266
6266
  O.tabState.set("activeTabId", w.current);
6267
6267
  }, "self");
6268
- const H = vt(e), U = (G = O, K = !1) => {
6268
+ const H = kt(e), U = (G = O, K = !1) => {
6269
6269
  var ue;
6270
- const V = ds(G), D = G.order.toArray(), se = new Set(V.map((Re) => Re.id)), fe = b.current;
6270
+ const V = ds(G), D = G.order.toArray(), se = new Set(V.map((De) => De.id)), fe = b.current;
6271
6271
  b.current = se;
6272
6272
  const re = l ? se.has(l) : !1;
6273
6273
  C(V);
6274
6274
  const Se = bo(G), J = ((ue = V[0]) == null ? void 0 : ue.id) ?? (D.length > 0 ? D[0] : tt);
6275
6275
  if (a) {
6276
- const Re = Se && se.has(Se) ? Se : J;
6276
+ const De = Se && se.has(Se) ? Se : J;
6277
6277
  k(
6278
- (Ee) => Ee === Re ? Ee : Re
6278
+ (Ee) => Ee === De ? Ee : De
6279
6279
  );
6280
6280
  } else if (l && re && A.current !== l)
6281
6281
  A.current = l, k(
6282
- (Re) => Re === l ? Re : l
6282
+ (De) => De === l ? De : l
6283
6283
  );
6284
6284
  else {
6285
- const Re = (He) => {
6285
+ const De = (He) => {
6286
6286
  if (se.has(He)) return He;
6287
6287
  const ze = /* @__PURE__ */ new Set([He]);
6288
- let Ge = G.parentById.get(He);
6289
- for (; Ge && !ze.has(Ge); ) {
6290
- if (se.has(Ge)) return Ge;
6291
- ze.add(Ge), Ge = G.parentById.get(Ge);
6288
+ let Ye = G.parentById.get(He);
6289
+ for (; Ye && !ze.has(Ye); ) {
6290
+ if (se.has(Ye)) return Ye;
6291
+ ze.add(Ye), Ye = G.parentById.get(Ye);
6292
6292
  }
6293
6293
  return J;
6294
6294
  }, Ee = w.current;
6295
- K && G.parentById.size > 0 && fe.has(Ee) && Re(Ee) !== Ee && xo({
6295
+ K && G.parentById.size > 0 && fe.has(Ee) && De(Ee) !== Ee && xo({
6296
6296
  title: "This tab was deleted",
6297
6297
  description: "Someone else deleted the tab you were in."
6298
- }), k(Re);
6298
+ }), k(De);
6299
6299
  }
6300
6300
  }, ce = (G, K) => {
6301
- U(vt(e), !K.local);
6301
+ U(kt(e), !K.local);
6302
6302
  }, q = e.getMap(Vh), L = () => {
6303
6303
  const G = Xi(
6304
6304
  e,
@@ -6322,7 +6322,7 @@ const _p = (e, t, n) => t ? ml(n) : Fu(e).then(
6322
6322
  d
6323
6323
  ]);
6324
6324
  const $ = M(() => {
6325
- const O = vt(e), H = O.order, U = sr(), ce = {
6325
+ const O = kt(e), H = O.order, U = sr(), ce = {
6326
6326
  name: `Tab ${H.length + 1}`,
6327
6327
  emoji: null,
6328
6328
  id: U
@@ -6434,7 +6434,7 @@ const _p = (e, t, n) => t ? ml(n) : Fu(e).then(
6434
6434
  orderTab: oe
6435
6435
  };
6436
6436
  };
6437
- var Gt = /* @__PURE__ */ ((e) => (e.AUTH_TOKEN_MISSING = "AUTH_TOKEN_MISSING", e.AUTH_TOKEN_INVALID = "AUTH_TOKEN_INVALID", e.SESSION_NOT_FOUND = "SESSION_NOT_FOUND", e.SESSION_TERMINATED = "SESSION_TERMINATED", e.SESSION_DID_MISSING = "SESSION_DID_MISSING", e.DOCUMENT_ID_MISSING = "DOCUMENT_ID_MISSING", e.UPDATE_DATA_MISSING = "UPDATE_DATA_MISSING", e.COMMIT_UNAUTHORIZED = "COMMIT_UNAUTHORIZED", e.COMMIT_MISSING_DATA = "COMMIT_MISSING_DATA", e.INVALID_ADDRESS = "INVALID_ADDRESS", e.NOT_AUTHENTICATED = "NOT_AUTHENTICATED", e.DB_ERROR = "DB_ERROR", e.INTERNAL_ERROR = "INTERNAL_ERROR", e.JOIN_DISABLED = "JOIN_DISABLED", e.EDIT_REVOKED = "EDIT_REVOKED", e.ROOM_NOT_ESTABLISHED = "ROOM_NOT_ESTABLISHED", e.WIRE_FORMAT_UNSUPPORTED = "WIRE_FORMAT_UNSUPPORTED", e))(Gt || {}), ot = /* @__PURE__ */ ((e) => (e.CLOSED = "CLOSED", e.CONNECTED = "CONNECTED", e.CONNECTING = "CONNECTING", e.DISCONNECTING = "DISCONNECTING", e.DISCONNECTED = "DISCONNECTED", e))(ot || {});
6437
+ var Yt = /* @__PURE__ */ ((e) => (e.AUTH_TOKEN_MISSING = "AUTH_TOKEN_MISSING", e.AUTH_TOKEN_INVALID = "AUTH_TOKEN_INVALID", e.SESSION_NOT_FOUND = "SESSION_NOT_FOUND", e.SESSION_TERMINATED = "SESSION_TERMINATED", e.SESSION_DID_MISSING = "SESSION_DID_MISSING", e.DOCUMENT_ID_MISSING = "DOCUMENT_ID_MISSING", e.UPDATE_DATA_MISSING = "UPDATE_DATA_MISSING", e.COMMIT_UNAUTHORIZED = "COMMIT_UNAUTHORIZED", e.COMMIT_MISSING_DATA = "COMMIT_MISSING_DATA", e.INVALID_ADDRESS = "INVALID_ADDRESS", e.NOT_AUTHENTICATED = "NOT_AUTHENTICATED", e.DB_ERROR = "DB_ERROR", e.INTERNAL_ERROR = "INTERNAL_ERROR", e.JOIN_DISABLED = "JOIN_DISABLED", e.EDIT_REVOKED = "EDIT_REVOKED", e.ROOM_NOT_ESTABLISHED = "ROOM_NOT_ESTABLISHED", e.WIRE_FORMAT_UNSUPPORTED = "WIRE_FORMAT_UNSUPPORTED", e))(Yt || {}), ot = /* @__PURE__ */ ((e) => (e.CLOSED = "CLOSED", e.CONNECTED = "CONNECTED", e.CONNECTING = "CONNECTING", e.DISCONNECTING = "DISCONNECTING", e.DISCONNECTED = "DISCONNECTED", e))(ot || {});
6438
6438
  const Xl = "#9CA3AF", or = [
6439
6439
  "#30bced",
6440
6440
  "#6eeb83",
@@ -6523,11 +6523,11 @@ const uf = "FVXC1", Tr = "__n__", Ql = uf + Tr, hf = new TextEncoder().encode(
6523
6523
  const n = t.split(Tr);
6524
6524
  if (n.length !== 3 || !n[1] || !n[2])
6525
6525
  throw new Error("Invalid FVXC1 wire format");
6526
- const s = lt(n[1]);
6526
+ const s = at(n[1]);
6527
6527
  if (s.length !== fa)
6528
6528
  throw new Error("Invalid FVXC1 nonce length");
6529
6529
  return Qi(ga(e), s).decrypt(
6530
- lt(n[2])
6530
+ at(n[2])
6531
6531
  );
6532
6532
  }
6533
6533
  return nm(e, t);
@@ -6665,9 +6665,9 @@ class Jr {
6665
6665
  "SocketClient: Server did not response with the server DID"
6666
6666
  );
6667
6667
  if (this.collaborationUcan && this.serverClock.isUsable(this.collaborationUcan))
6668
- return this._lastSessionToken = an.encode(this.collaborationUcan), this._lastSessionToken;
6668
+ return this._lastSessionToken = rn.encode(this.collaborationUcan), this._lastSessionToken;
6669
6669
  const t = this.getCollaborationKeyPair();
6670
- return this.collaborationUcan = await an.build({
6670
+ return this.collaborationUcan = await rn.build({
6671
6671
  audience: this._websocketServiceDid,
6672
6672
  issuer: t,
6673
6673
  ...this.serverClock.ucanWindow(),
@@ -6680,7 +6680,7 @@ class Jr {
6680
6680
  can: { namespace: "collaboration", segments: ["COLLABORATE"] }
6681
6681
  }
6682
6682
  ]
6683
- }), this._lastSessionToken = an.encode(this.collaborationUcan), this._lastSessionToken;
6683
+ }), this._lastSessionToken = rn.encode(this.collaborationUcan), this._lastSessionToken;
6684
6684
  });
6685
6685
  // Builds the /auth args and emits, shared by the initial handshake and rekey's in-place
6686
6686
  // re-auth (rotationCutover: true) on an already-connected socket.
@@ -6693,7 +6693,7 @@ class Jr {
6693
6693
  wireFormats: ["ecies", "xchacha"]
6694
6694
  };
6695
6695
  this.roomInfo && (s.roomInfo = Ot.encryptData(
6696
- lt(this.roomKey),
6696
+ at(this.roomKey),
6697
6697
  new TextEncoder().encode(JSON.stringify(this.roomInfo)),
6698
6698
  this.wireFormat
6699
6699
  )), this.ownerKeyPair && (s.ownerToken = await this.getOwnerToken()), this.ownerAddress && (s.ownerAddress = this.ownerAddress), this.contractAddress && (s.contractAddress = this.contractAddress), this.ddocId && (s.ddocId = this.ddocId), this.identityToken && (s.identityToken = this.identityToken);
@@ -6734,7 +6734,7 @@ class Jr {
6734
6734
  if (n)
6735
6735
  try {
6736
6736
  const o = Ot.decryptData(
6737
- lt(n),
6737
+ at(n),
6738
6738
  s
6739
6739
  );
6740
6740
  Zh(
@@ -6757,11 +6757,11 @@ class Jr {
6757
6757
  });
6758
6758
  this._socketUrl = t.wsUrl || "ws://localhost:5000", this._restBase = (t.wsUrl || "http://localhost:5000").replace(/^ws(s?):\/\//, "http$1://").replace(/\/+$/, "");
6759
6759
  const { secretKey: n } = er(
6760
- lt(t.roomKey)
6760
+ at(t.roomKey)
6761
6761
  );
6762
- this.roomKey = t.roomKey, this.roomId = t.roomId, this.collaborationKeyPair = an.EdKeypair.fromSecretKey(
6762
+ this.roomKey = t.roomKey, this.roomId = t.roomId, this.collaborationKeyPair = rn.EdKeypair.fromSecretKey(
6763
6763
  _t(n)
6764
- ), t.ownerEdSecret && (this.ownerKeyPair = an.EdKeypair.fromSecretKey(t.ownerEdSecret)), t.contractAddress && (this.contractAddress = t.contractAddress), t.ownerAddress && (this.ownerAddress = t.ownerAddress), t.ddocId && (this.ddocId = t.ddocId), t.editLock && (this.editLock = t.editLock), t.identityToken && (this.identityToken = t.identityToken), t.editUcan && (this.editUcan = t.editUcan), this.lastGoodEditUcan = t.editUcan, t.refreshEditClaim && (this.refreshEditClaim = t.refreshEditClaim), t.actorHandle && (this.actorHandle = t.actorHandle), t.joinOnly && (this.joinOnly = t.joinOnly), t.encryptedTitle && (this.encryptedTitle = t.encryptedTitle), t.onHandshakeData && (this._onHandshakeData = t.onHandshakeData), t.onEpochAvailable && (this._onEpochAvailable = t.onEpochAvailable), t.onCutover && (this._onCutover = t.onCutover), t.roomInfo && (this.roomInfo = t.roomInfo);
6764
+ ), t.ownerEdSecret && (this.ownerKeyPair = rn.EdKeypair.fromSecretKey(t.ownerEdSecret)), t.contractAddress && (this.contractAddress = t.contractAddress), t.ownerAddress && (this.ownerAddress = t.ownerAddress), t.ddocId && (this.ddocId = t.ddocId), t.editLock && (this.editLock = t.editLock), t.identityToken && (this.identityToken = t.identityToken), t.editUcan && (this.editUcan = t.editUcan), this.lastGoodEditUcan = t.editUcan, t.refreshEditClaim && (this.refreshEditClaim = t.refreshEditClaim), t.actorHandle && (this.actorHandle = t.actorHandle), t.joinOnly && (this.joinOnly = t.joinOnly), t.encryptedTitle && (this.encryptedTitle = t.encryptedTitle), t.onHandshakeData && (this._onHandshakeData = t.onHandshakeData), t.onEpochAvailable && (this._onEpochAvailable = t.onEpochAvailable), t.onCutover && (this._onCutover = t.onCutover), t.roomInfo && (this.roomInfo = t.roomInfo);
6765
6765
  }
6766
6766
  get isConnected() {
6767
6767
  return this._webSocketStatus === ot.CONNECTED;
@@ -6909,8 +6909,8 @@ class Jr {
6909
6909
  const o = this.roomKey, i = this.editLock;
6910
6910
  try {
6911
6911
  s && (this.lastGoodEditUcan = s), this.roomKey = t;
6912
- const { secretKey: a } = er(lt(t));
6913
- this.collaborationKeyPair = an.EdKeypair.fromSecretKey(
6912
+ const { secretKey: a } = er(at(t));
6913
+ this.collaborationKeyPair = rn.EdKeypair.fromSecretKey(
6914
6914
  _t(a)
6915
6915
  ), this.collaborationUcan = void 0, n !== void 0 && (this.editLock = n);
6916
6916
  const l = await this._authenticate({ rotationCutover: !0 });
@@ -6921,8 +6921,8 @@ class Jr {
6921
6921
  this._webSocketStatus = ot.CONNECTED;
6922
6922
  } catch (a) {
6923
6923
  this.roomKey = o;
6924
- const { secretKey: l } = er(lt(o));
6925
- throw this.collaborationKeyPair = an.EdKeypair.fromSecretKey(
6924
+ const { secretKey: l } = er(at(o));
6925
+ throw this.collaborationKeyPair = rn.EdKeypair.fromSecretKey(
6926
6926
  _t(l)
6927
6927
  ), this.collaborationUcan = void 0, this.editLock = i, a;
6928
6928
  } finally {
@@ -6962,7 +6962,7 @@ class Jr {
6962
6962
  async getOwnerToken() {
6963
6963
  if (!this.ownerKeyPair || !this.contractAddress)
6964
6964
  throw new Error("SocketClient: No owner key pair or contract address");
6965
- return this.ownerUcan && this.serverClock.isUsable(this.ownerUcan) ? an.encode(this.ownerUcan) : (this.ownerUcan = await an.build({
6965
+ return this.ownerUcan && this.serverClock.isUsable(this.ownerUcan) ? rn.encode(this.ownerUcan) : (this.ownerUcan = await rn.build({
6966
6966
  audience: this._websocketServiceDid,
6967
6967
  issuer: this.ownerKeyPair,
6968
6968
  ...this.serverClock.ucanWindow(),
@@ -6975,7 +6975,7 @@ class Jr {
6975
6975
  can: { namespace: "collaboration", segments: ["CREATE"] }
6976
6976
  }
6977
6977
  ]
6978
- }), an.encode(this.ownerUcan));
6978
+ }), rn.encode(this.ownerUcan));
6979
6979
  }
6980
6980
  connectSocket(t) {
6981
6981
  return this._webSocketStatus === ot.CONNECTED || this._webSocketStatus === ot.CONNECTING ? Promise.resolve() : (this._webSocketStatus = ot.CONNECTING, new Promise((n, s) => {
@@ -7078,7 +7078,7 @@ class Jr {
7078
7078
  ]), u = this.roomKey;
7079
7079
  if (u) {
7080
7080
  const d = Ot.encryptData(
7081
- lt(u),
7081
+ at(u),
7082
7082
  c,
7083
7083
  this.wireFormat
7084
7084
  );
@@ -7098,7 +7098,7 @@ const wa = (e, t, n, s) => {
7098
7098
  const u = am(e, c);
7099
7099
  if (t.isConnected) {
7100
7100
  const d = Ot.encryptData(
7101
- lt(n),
7101
+ at(n),
7102
7102
  u,
7103
7103
  s()
7104
7104
  );
@@ -7140,7 +7140,7 @@ function Nf(e, t) {
7140
7140
  o.decrypted || (s = !0), !s && o.isTail && typeof o.seq == "number" && n.push(o.seq);
7141
7141
  return { seqs: n, incomplete: s };
7142
7142
  }
7143
- const vn = {
7143
+ const kn = {
7144
7144
  hasUnmergedPeerUpdates: !1,
7145
7145
  reconnectAttempt: 0,
7146
7146
  maxReconnectAttempts: 3,
@@ -7162,7 +7162,7 @@ function Tf(e, t, n) {
7162
7162
  } : s === "SESSION_TERMINATED" ? {
7163
7163
  status: "terminated",
7164
7164
  context: { terminationReason: t.reason }
7165
- } : s === "RESET" ? { status: "idle", context: { ...vn } } : null;
7165
+ } : s === "RESET" ? { status: "idle", context: { ...kn } } : null;
7166
7166
  case "syncing":
7167
7167
  return s === "SYNC_COMPLETE" ? { status: "ready", context: { hasUnmergedPeerUpdates: !1 } } : s === "SOCKET_DROPPED" ? {
7168
7168
  status: "reconnecting",
@@ -7179,7 +7179,7 @@ function Tf(e, t, n) {
7179
7179
  } : s === "SESSION_TERMINATED" ? {
7180
7180
  status: "terminated",
7181
7181
  context: { terminationReason: t.reason }
7182
- } : s === "CUTOVER" ? { status: e, context: {} } : s === "RESET" ? { status: "idle", context: { ...vn } } : null;
7182
+ } : s === "CUTOVER" ? { status: e, context: {} } : s === "RESET" ? { status: "idle", context: { ...kn } } : null;
7183
7183
  case "ready":
7184
7184
  return s === "SOCKET_DROPPED" ? {
7185
7185
  status: "reconnecting",
@@ -7190,7 +7190,7 @@ function Tf(e, t, n) {
7190
7190
  } : s === "ERROR" ? {
7191
7191
  status: "error",
7192
7192
  context: { error: t.error }
7193
- } : s === "CUTOVER" ? { status: e, context: {} } : s === "RESET" ? { status: "idle", context: { ...vn } } : null;
7193
+ } : s === "CUTOVER" ? { status: e, context: {} } : s === "RESET" ? { status: "idle", context: { ...kn } } : null;
7194
7194
  case "reconnecting":
7195
7195
  return s === "RECONNECTED" ? {
7196
7196
  status: "syncing",
@@ -7215,11 +7215,11 @@ function Tf(e, t, n) {
7215
7215
  } : s === "SESSION_TERMINATED" ? {
7216
7216
  status: "terminated",
7217
7217
  context: { terminationReason: t.reason }
7218
- } : s === "RESET" ? { status: "idle", context: { ...vn } } : null;
7218
+ } : s === "RESET" ? { status: "idle", context: { ...kn } } : null;
7219
7219
  case "error":
7220
- return s === "RESET" ? { status: "idle", context: { ...vn } } : null;
7220
+ return s === "RESET" ? { status: "idle", context: { ...kn } } : null;
7221
7221
  case "terminated":
7222
- return s === "RESET" ? { status: "idle", context: { ...vn } } : null;
7222
+ return s === "RESET" ? { status: "idle", context: { ...kn } } : null;
7223
7223
  default:
7224
7224
  return null;
7225
7225
  }
@@ -7274,7 +7274,7 @@ class Mf {
7274
7274
  constructor(t, n) {
7275
7275
  // --- State machine ---
7276
7276
  ne(this, "_status", "idle");
7277
- ne(this, "_context", { ...vn });
7277
+ ne(this, "_context", { ...kn });
7278
7278
  ne(this, "_awareness", null);
7279
7279
  // --- Internal state ---
7280
7280
  ne(this, "socketClient", null);
@@ -7455,7 +7455,7 @@ class Mf {
7455
7455
  var o, i;
7456
7456
  if (this._status !== "idle") return;
7457
7457
  const n = ++this.sessionGen;
7458
- this.resuming || (this.updateQueue = []), this.resumable = !1, this.lastConnectConfig = t, this.roomKey = t.roomKey, this.roomKeyBytes = lt(t.roomKey), this.isOwner = t.isOwner, this.joinOnly = t.joinOnly ?? !1, this.encryptMirror = t.encryptMirror ?? null, this.fileKeyEpoch = t.fileKeyEpoch ?? 0, this.socketClient = new Jr({
7458
+ this.resuming || (this.updateQueue = []), this.resumable = !1, this.lastConnectConfig = t, this.roomKey = t.roomKey, this.roomKeyBytes = at(t.roomKey), this.isOwner = t.isOwner, this.joinOnly = t.joinOnly ?? !1, this.encryptMirror = t.encryptMirror ?? null, this.fileKeyEpoch = t.fileKeyEpoch ?? 0, this.socketClient = new Jr({
7459
7459
  wsUrl: t.wsUrl,
7460
7460
  roomKey: t.roomKey,
7461
7461
  roomId: t.roomId,
@@ -7603,7 +7603,7 @@ class Mf {
7603
7603
  return;
7604
7604
  this.rotating = !0;
7605
7605
  const o = this.sessionGen, i = this.roomKey;
7606
- this.roomKeyBytesPrev = this.roomKeyBytes, this.roomKey = t, this.roomKeyBytes = lt(t);
7606
+ this.roomKeyBytesPrev = this.roomKeyBytes, this.roomKey = t, this.roomKeyBytes = at(t);
7607
7607
  try {
7608
7608
  if (await ((a = this.socketClient) == null ? void 0 : a.rekey(t, n, s)), o === this.sessionGen && this.lastConnectConfig && (this.lastConnectConfig = {
7609
7609
  ...this.lastConnectConfig,
@@ -7644,7 +7644,7 @@ class Mf {
7644
7644
  return this.rotating || !t ? Promise.resolve("failed") : (this.healingPromise = (async () => {
7645
7645
  try {
7646
7646
  const s = await t();
7647
- return s ? this.roomKeyBytes && Df(lt(s), this.roomKeyBytes) ? "current-key-ok" : (await this.rekey(s), this.healBackoffUntil = 0, "rekeyed") : (console.warn(
7647
+ return s ? this.roomKeyBytes && Df(at(s), this.roomKeyBytes) ? "current-key-ok" : (await this.rekey(s), this.healBackoffUntil = 0, "rekeyed") : (console.warn(
7648
7648
  "SyncManager: rotation self-heal yielded no key (post-rotation blob may not be anchored yet)"
7649
7649
  ), this.healBackoffUntil = Date.now() + lo, "failed");
7650
7650
  } catch (s) {
@@ -7822,13 +7822,13 @@ class Mf {
7822
7822
  }
7823
7823
  }
7824
7824
  isRevocationResponse(t) {
7825
- return (t == null ? void 0 : t.statusCode) === 403 && (t.errorCode === Gt.JOIN_DISABLED || t.errorCode === Gt.EDIT_REVOKED);
7825
+ return (t == null ? void 0 : t.statusCode) === 403 && (t.errorCode === Yt.JOIN_DISABLED || t.errorCode === Yt.EDIT_REVOKED);
7826
7826
  }
7827
7827
  // A write ack'd 409/SESSION_TERMINATED means this session's old sessionDid was cut over
7828
7828
  // out from under an in-flight write — distinct from isRevocationResponse's 403s, and the
7829
7829
  // fix is a decrypt-miss self-heal, not a reconnect.
7830
7830
  isSessionTerminatedResponse(t) {
7831
- return (t == null ? void 0 : t.statusCode) === 409 && t.errorCode === Gt.SESSION_TERMINATED;
7831
+ return (t == null ? void 0 : t.statusCode) === 409 && t.errorCode === Yt.SESSION_TERMINATED;
7832
7832
  }
7833
7833
  // A write ack'd 404/SESSION_NOT_FOUND means the server has no runtime session for this
7834
7834
  // sessionDid: a live editor whose OLD session was terminated by a rotation drain it never
@@ -7836,7 +7836,7 @@ class Mf {
7836
7836
  // resolve the current-epoch roomKey and rekey — NOT a plain reconnect, which would just
7837
7837
  // re-auth back into the same dead sessionDid.
7838
7838
  isSessionNotFoundResponse(t) {
7839
- return (t == null ? void 0 : t.statusCode) === 404 && t.errorCode === Gt.SESSION_NOT_FOUND;
7839
+ return (t == null ? void 0 : t.statusCode) === 404 && t.errorCode === Yt.SESSION_NOT_FOUND;
7840
7840
  }
7841
7841
  classifyRevocation() {
7842
7842
  return "soft";
@@ -7903,7 +7903,7 @@ class Mf {
7903
7903
  }
7904
7904
  forceCleanup() {
7905
7905
  var n;
7906
- this.resumable = !1, this.resuming = !1, this.flushTimer && (clearTimeout(this.flushTimer), this.flushTimer = null), this.mirrorIdleTimer && (clearTimeout(this.mirrorIdleTimer), this.mirrorIdleTimer = null), this.fireBeacon(), this.updateQueue = [], this._awareness && On(this._awareness, [this.ydoc.clientID], "cleanup"), this.cleanupAwareness(), (n = this.socketClient) == null || n.disconnect(), this.resetInternalState(), this._status = "idle", this._context = { ...vn };
7906
+ this.resumable = !1, this.resuming = !1, this.flushTimer && (clearTimeout(this.flushTimer), this.flushTimer = null), this.mirrorIdleTimer && (clearTimeout(this.mirrorIdleTimer), this.mirrorIdleTimer = null), this.fireBeacon(), this.updateQueue = [], this._awareness && On(this._awareness, [this.ydoc.clientID], "cleanup"), this.cleanupAwareness(), (n = this.socketClient) == null || n.disconnect(), this.resetInternalState(), this._status = "idle", this._context = { ...kn };
7907
7907
  const t = rr(this._status, this._context);
7908
7908
  this.onCollabStateChange(t);
7909
7909
  }
@@ -7963,7 +7963,7 @@ class Mf {
7963
7963
  onHandShakeError: (c, u, d) => {
7964
7964
  var h, m, p, f, x;
7965
7965
  if (!a() && !(u === void 0 && !((h = this.socketClient) != null && h.isSocketOpen))) {
7966
- if (d === Gt.WIRE_FORMAT_UNSUPPORTED) {
7966
+ if (d === Yt.WIRE_FORMAT_UNSUPPORTED) {
7967
7967
  s || (s = !0, t()), this.emitWireTelemetry({ type: "refused" }), (m = this.socketClient) == null || m.disconnect(), this.resetInternalState(), this.send({
7968
7968
  type: "SESSION_TERMINATED",
7969
7969
  reason: "WIRE_FORMAT_UNSUPPORTED"
@@ -7973,7 +7973,7 @@ class Mf {
7973
7973
  if (this.joinOnly) {
7974
7974
  (p = this.socketClient) == null || p.disconnect(), this.resetInternalState(), this.send({
7975
7975
  type: "SESSION_TERMINATED",
7976
- reason: d === Gt.ROOM_NOT_ESTABLISHED ? "ROOM_NOT_ESTABLISHED" : u === 403 && (d === Gt.JOIN_DISABLED || d === Gt.EDIT_REVOKED) ? "WORKSPACE_EDIT_DISABLED" : "JOIN_REJECTED"
7976
+ reason: d === Yt.ROOM_NOT_ESTABLISHED ? "ROOM_NOT_ESTABLISHED" : u === 403 && (d === Yt.JOIN_DISABLED || d === Yt.EDIT_REVOKED) ? "WORKSPACE_EDIT_DISABLED" : "JOIN_REJECTED"
7977
7977
  }), s || (s = !0, t());
7978
7978
  return;
7979
7979
  }
@@ -8005,7 +8005,7 @@ class Mf {
8005
8005
  g();
8006
8006
  return;
8007
8007
  }
8008
- if (u === 403 && (d === Gt.JOIN_DISABLED || d === Gt.EDIT_REVOKED)) {
8008
+ if (u === 403 && (d === Yt.JOIN_DISABLED || d === Yt.EDIT_REVOKED)) {
8009
8009
  (x = this.socketClient) == null || x.disconnect(), this.resetInternalState(), this.send({ type: "SESSION_TERMINATED", reason: "EDIT_REVOKED" }), s || (s = !0, t());
8010
8010
  return;
8011
8011
  }
@@ -8227,7 +8227,7 @@ class Mf {
8227
8227
  var a;
8228
8228
  const s = () => this.isCurrentSyncAttempt(n);
8229
8229
  if (!t) return;
8230
- const o = this.encryptForWire(lt(t));
8230
+ const o = this.encryptForWire(at(t));
8231
8231
  if (!s()) return;
8232
8232
  const i = await ((a = this.socketClient) == null ? void 0 : a.sendUpdate({
8233
8233
  update: o
@@ -8855,7 +8855,7 @@ const Ff = { status: "idle" }, Bf = (e) => {
8855
8855
  onSchemaStampGuard: O,
8856
8856
  ...H
8857
8857
  }) => {
8858
- var en;
8858
+ var zt;
8859
8859
  j(() => {
8860
8860
  Bu(W ?? []);
8861
8861
  }, [W]);
@@ -8886,54 +8886,54 @@ const Ff = { status: "idle" }, Bf = (e) => {
8886
8886
  collaboration: o,
8887
8887
  onCollaboratorChange: c,
8888
8888
  onIndexedDbError: P
8889
- }), { initialiseYjsIndexedDbProvider: J } = Se, ue = !!(A && y && !D && !K && V !== null && !V && !Se.isIndexeddbSynced), Re = F(!1);
8889
+ }), { initialiseYjsIndexedDbProvider: J } = Se, ue = !!(A && y && !D && !K && V !== null && !V && !Se.isIndexeddbSynced), De = K ? !V : V === null, Ee = F(!1);
8890
8890
  j(() => {
8891
- !ue || Re.current || (Re.current = !0, J());
8891
+ !ue || Ee.current || (Ee.current = !0, J());
8892
8892
  }, [ue, J]);
8893
- const Ee = M(
8894
- () => Re.current ? Promise.resolve() : J(),
8893
+ const He = M(
8894
+ () => Ee.current ? Promise.resolve() : J(),
8895
8895
  [J]
8896
- ), He = !!(A && !D && H.isDDocOwner && !K && !e && !V), ze = !!(!K && !e && !D && H.isDDocOwner), Ge = l === !0, kt = !!(H.isDDocOwner && !D && !V), Ke = rf({
8896
+ ), ze = !!(A && !D && H.isDDocOwner && !K && !e && !V), Ye = !!(!K && !e && !D && H.isDDocOwner), xt = l === !0, ht = !!(H.isDDocOwner && !D && !V), Ke = rf({
8897
8897
  ydoc: Se.ydoc,
8898
8898
  initialContent: V,
8899
- isNewDocument: Ge,
8899
+ isNewDocument: xt,
8900
8900
  enableCollaboration: D,
8901
8901
  isDDocOwner: H.isDDocOwner || !1,
8902
8902
  createDefaultTabIfMissing: !!(!K && !e && H.isDDocOwner && !D && // Wait for y-indexedDB sync before deciding whether an unsaved local doc
8903
8903
  // still needs a default tab, otherwise refresh keeps bootstrapping one.
8904
- (!He || Se.isIndexeddbSynced)),
8905
- defaultTabId: (en = H.tabConfig) == null ? void 0 : en.defaultTabId,
8906
- shouldSyncActiveTab: ze,
8904
+ (!ze || Se.isIndexeddbSynced)),
8905
+ defaultTabId: (zt = H.tabConfig) == null ? void 0 : zt.defaultTabId,
8906
+ shouldSyncActiveTab: Ye,
8907
8907
  // Viewers (non-owners) should land on the first tab, not whatever the
8908
8908
  // owner last selected, since active-tab is persisted in the shared Yjs doc.
8909
8909
  preferFirstTabOnInit: !H.isDDocOwner,
8910
8910
  onVersionHistoryActiveTabChange: s == null ? void 0 : s.onActiveTabChange,
8911
8911
  getEditor: () => G.current,
8912
8912
  flushPendingUpdate: Se.flushPendingUpdate
8913
- }), ht = ve(
8914
- () => Ke.tabs.map((tn) => tn.id),
8913
+ }), lt = ve(
8914
+ () => Ke.tabs.map((cn) => cn.id),
8915
8915
  [Ke.tabs]
8916
- ), at = F(!1);
8916
+ ), je = F(!1);
8917
8917
  j(() => {
8918
- Ge || !kt || at.current || K || e || (at.current = !0, O == null || O({
8918
+ xt || !ht || je.current || K || e || (je.current = !0, O == null || O({
8919
8919
  kind: "unasserted-new",
8920
8920
  preferredSchemaVersion: oe ?? 1
8921
8921
  }));
8922
8922
  }, [
8923
- Ge,
8924
- kt,
8923
+ xt,
8924
+ ht,
8925
8925
  K,
8926
8926
  e,
8927
8927
  O,
8928
8928
  oe
8929
8929
  ]);
8930
- const { docSchemaVersion: je, isSchemaUnsupported: Ht } = dp({
8930
+ const { docSchemaVersion: Ht, isSchemaUnsupported: Xe } = dp({
8931
8931
  ydoc: Se.ydoc,
8932
- isNewDdoc: Ge,
8933
- isContentResolved: !He || Se.isIndexeddbSynced,
8932
+ isNewDdoc: xt,
8933
+ isContentResolved: !ze || Se.isIndexeddbSynced,
8934
8934
  preferredSchemaVersion: oe,
8935
8935
  onSchemaStampGuard: O
8936
- }), Xe = Vp({
8936
+ }), Qe = Vp({
8937
8937
  ydoc: Se.ydoc,
8938
8938
  editorWidthStore: le,
8939
8939
  isPreviewMode: e,
@@ -8972,32 +8972,33 @@ const Ff = { status: "idle" }, Bf = (e) => {
8972
8972
  onDisconnect: Se.onDisconnect,
8973
8973
  isIndexeddbSynced: Se.isIndexeddbSynced,
8974
8974
  hasCollabContentInitialised: Se.hasCollabContentInitialised,
8975
- initialiseYjsIndexedDbProvider: Ee,
8975
+ initialiseYjsIndexedDbProvider: He,
8976
8976
  externalExtensions: b,
8977
8977
  // An empty activeTabId makes useTabEditorCache destroy every editor and
8978
8978
  // create none, so this build never binds y-sync to a newer-schema doc,
8979
8979
  // nor to a doc whose store has not loaded yet (isAwaitingStore, which
8980
- // starts the store load itself so holding the editor cannot deadlock).
8981
- activeTabId: Ht || ue ? "" : Ke.activeTabId,
8982
- tabIds: ht,
8983
- docSchemaVersion: je,
8980
+ // starts the store load itself so holding the editor cannot deadlock),
8981
+ // nor before a body the host has promised (isAwaitingBody).
8982
+ activeTabId: Xe || ue || De ? "" : Ke.activeTabId,
8983
+ tabIds: lt,
8984
+ docSchemaVersion: Ht,
8984
8985
  hasTabState: Ke.hasTabState,
8985
8986
  isVersionMode: K,
8986
8987
  theme: R,
8987
8988
  editorRef: G,
8988
8989
  initialCommentAnchors: ee,
8989
8990
  dBlockRuntimeStateRef: re
8990
- }), et = !!(A && !Se.isIndexeddbSynced && ze && Ke.tabs.length > 1), St = D ? o.connection.isOwner : !0, ln = (D && !St ? Xe.isContentLoading || q : Xe.isContentLoading) || et;
8991
+ }), St = !!(A && !Se.isIndexeddbSynced && Ye && Ke.tabs.length > 1), an = D ? o.connection.isOwner : !0, ln = (D && !an ? Qe.isContentLoading || q : Qe.isContentLoading) || St;
8991
8992
  return {
8992
- ...Xe,
8993
+ ...Qe,
8993
8994
  ...Se,
8994
8995
  ydoc: Se.ydoc,
8995
8996
  awareness: Se.awareness,
8996
8997
  refreshYjsIndexedDbProvider: Se.refreshYjsIndexedDbProvider,
8997
8998
  terminateSession: Se.terminateSession,
8998
8999
  isContentLoading: !!ln,
8999
- isSchemaUnsupported: Ht,
9000
- docSchemaVersion: je,
9000
+ isSchemaUnsupported: Xe,
9001
+ docSchemaVersion: Ht,
9001
9002
  tabs: Ke.tabs,
9002
9003
  hasTabState: Ke.hasTabState,
9003
9004
  dBlockRuntimeState: fe,
@@ -9161,7 +9162,7 @@ const Ff = { status: "idle" }, Bf = (e) => {
9161
9162
  title: "Link",
9162
9163
  content: /* @__PURE__ */ v("div", { className: "flex flex-col gap-4 w-full h-full text-base", children: [
9163
9164
  /* @__PURE__ */ r(
9164
- Xt,
9165
+ Qt,
9165
9166
  {
9166
9167
  label: "Text",
9167
9168
  placeholder: "Link text",
@@ -9175,7 +9176,7 @@ const Ff = { status: "idle" }, Bf = (e) => {
9175
9176
  }
9176
9177
  ),
9177
9178
  /* @__PURE__ */ r(
9178
- Xt,
9179
+ Qt,
9179
9180
  {
9180
9181
  label: "Link",
9181
9182
  placeholder: "Paste URL",
@@ -9208,14 +9209,14 @@ const Ff = { status: "idle" }, Bf = (e) => {
9208
9209
  }
9209
9210
  )
9210
9211
  ] });
9211
- }, tc = Qe.memo(Wf);
9212
+ }, tc = Ze.memo(Wf);
9212
9213
  tc.displayName = "MobileToolbar";
9213
9214
  new qr({
9214
9215
  html: !0,
9215
9216
  linkify: !0,
9216
9217
  typographer: !0
9217
9218
  }).enable("table");
9218
- pn.addRule("pageBreak", {
9219
+ fn.addRule("pageBreak", {
9219
9220
  filter: function(e) {
9220
9221
  return e.nodeName === "BR" && e.getAttribute("data-page-break") === "true";
9221
9222
  },
@@ -9240,29 +9241,29 @@ const $f = (e) => {
9240
9241
  return "";
9241
9242
  }
9242
9243
  };
9243
- pn.addRule("heading", {
9244
+ fn.addRule("heading", {
9244
9245
  filter: ["h1", "h2", "h3"],
9245
9246
  replacement: function(e, t) {
9246
9247
  const n = $f(t), s = e.replace(/\n\n===\n\n/g, "<br>");
9247
9248
  return `${n} ${s}`;
9248
9249
  }
9249
9250
  });
9250
- pn.addRule("superscript", {
9251
+ fn.addRule("superscript", {
9251
9252
  filter: "sup",
9252
9253
  replacement: function(e) {
9253
9254
  return `<sup>${e}</sup>`;
9254
9255
  }
9255
9256
  });
9256
- pn.addRule("subscript", {
9257
+ fn.addRule("subscript", {
9257
9258
  filter: "sub",
9258
9259
  replacement: function(e) {
9259
9260
  return `<sub>${e}</sub>`;
9260
9261
  }
9261
9262
  });
9262
- pn.addRule("table", {
9263
+ fn.addRule("table", {
9263
9264
  filter: "table",
9264
9265
  replacement: function(e, t) {
9265
- const n = t, s = Array.from(n.rows), o = Array.from(s[0].cells).map((h) => pn.turndown(h.innerHTML).trim()), i = o.map((h) => h.length), a = s.slice(1).map((h) => Array.from(h.cells).map((m, p) => {
9266
+ const n = t, s = Array.from(n.rows), o = Array.from(s[0].cells).map((h) => fn.turndown(h.innerHTML).trim()), i = o.map((h) => h.length), a = s.slice(1).map((h) => Array.from(h.cells).map((m, p) => {
9266
9267
  let f = m.innerHTML.trim();
9267
9268
  if (m.querySelector("ul, ol")) {
9268
9269
  const x = m.querySelector("ul") ? "ul" : "ol", g = Array.from(m.querySelectorAll("li")).map(
@@ -9275,7 +9276,7 @@ pn.addRule("table", {
9275
9276
  "</li><li>"
9276
9277
  )}</li></${x}>`;
9277
9278
  } else
9278
- f = pn.turndown(f);
9279
+ f = fn.turndown(f);
9279
9280
  return i[p] = Math.max(
9280
9281
  i[p],
9281
9282
  f.length
@@ -9298,7 +9299,7 @@ ${d.join(
9298
9299
  `;
9299
9300
  }
9300
9301
  });
9301
- pn.addRule("taskListItem", {
9302
+ fn.addRule("taskListItem", {
9302
9303
  filter: (e) => {
9303
9304
  const t = e.parentElement;
9304
9305
  return e.nodeName === "LI" && (t == null ? void 0 : t.getAttribute("data-type")) === "taskList";
@@ -9322,7 +9323,7 @@ const qf = async (e, t, n) => {
9322
9323
  ), a = i.getHTML();
9323
9324
  Oi(!0);
9324
9325
  try {
9325
- return pn.turndown(a);
9326
+ return fn.turndown(a);
9326
9327
  } finally {
9327
9328
  Oi(!1), i.destroy();
9328
9329
  }
@@ -9333,7 +9334,7 @@ const qf = async (e, t, n) => {
9333
9334
  documentStyling: s,
9334
9335
  theme: o = "light"
9335
9336
  }) => {
9336
- const i = F({}), a = F(null), { isNativeMobile: l } = Qt(), c = Us("(max-width: 1279px)");
9337
+ const i = F({}), a = F(null), { isNativeMobile: l } = Zt(), c = Us("(max-width: 1279px)");
9337
9338
  j(() => {
9338
9339
  var m;
9339
9340
  !c && i.current[t] && ((m = i.current[t]) == null || m.scrollIntoView({
@@ -9417,12 +9418,12 @@ const qf = async (e, t, n) => {
9417
9418
  ]
9418
9419
  }
9419
9420
  );
9420
- }, bt = new qr({
9421
+ }, Ct = new qr({
9421
9422
  html: !0,
9422
9423
  linkify: !0,
9423
9424
  typographer: !0
9424
9425
  }).use(pm).enable(["table", "list"]);
9425
- bt.renderer.rules.list_item_open = (e, t) => {
9426
+ Ct.renderer.rules.list_item_open = (e, t) => {
9426
9427
  const n = e[t + 2];
9427
9428
  if (n && n.content) {
9428
9429
  const s = n.content.match(/^\[([ xX])\]\s*(.*)$/);
@@ -9531,13 +9532,13 @@ function e0(e, t = {}) {
9531
9532
  const N = va(C, w);
9532
9533
  T.push({
9533
9534
  type: "content",
9534
- content: bt.render(N[0])
9535
+ content: Ct.render(N[0])
9535
9536
  });
9536
9537
  for (let I = 1; I < N.length; I++)
9537
9538
  l.push(T), T = [
9538
9539
  {
9539
9540
  type: "content",
9540
- content: bt.render(N[I])
9541
+ content: Ct.render(N[I])
9541
9542
  }
9542
9543
  ];
9543
9544
  return T;
@@ -9557,7 +9558,7 @@ function e0(e, t = {}) {
9557
9558
  va(C, w).forEach((I, B) => {
9558
9559
  (B > 0 || m(I, T)) && T.length > 0 && (l.push(T), T = []), T.push({
9559
9560
  type: "content",
9560
- content: bt.render(I)
9561
+ content: Ct.render(I)
9561
9562
  });
9562
9563
  });
9563
9564
  return T;
@@ -9589,7 +9590,7 @@ function e0(e, t = {}) {
9589
9590
  const T = C.filter((I) => I.trim().length > 0);
9590
9591
  if (T.length < 2) return [""];
9591
9592
  const S = T[0].split("|").map((I) => I.trim()).filter(Boolean), w = T[1], b = T.slice(2);
9592
- return T.length <= a ? [`<div class="table-wrapper">${bt.render(C.join(`
9593
+ return T.length <= a ? [`<div class="table-wrapper">${Ct.render(C.join(`
9593
9594
  `))}</div>`] : Yf(S, b, a).map((I) => {
9594
9595
  const B = [
9595
9596
  `|${S.join("|")}|`,
@@ -9597,7 +9598,7 @@ function e0(e, t = {}) {
9597
9598
  ...I.rows
9598
9599
  ].join(`
9599
9600
  `);
9600
- return `<div class="table-wrapper">${bt.render(B)}</div>`;
9601
+ return `<div class="table-wrapper">${Ct.render(B)}</div>`;
9601
9602
  });
9602
9603
  }, y = e.split(`
9603
9604
  `);
@@ -9612,16 +9613,16 @@ function e0(e, t = {}) {
9612
9613
  b.length > 10 ? ka(S).forEach((B, _) => {
9613
9614
  (_ > 0 || m(B, c)) && f(), c.push({
9614
9615
  type: "content",
9615
- content: bt.render(B)
9616
+ content: Ct.render(B)
9616
9617
  });
9617
9618
  }) : b.length < 10 && N > 50 ? ka(S, 6).forEach((B, _) => {
9618
9619
  (_ > 0 || m(B, c)) && f(), c.push({
9619
9620
  type: "content",
9620
- content: bt.render(B)
9621
+ content: Ct.render(B)
9621
9622
  });
9622
9623
  }) : (m(S, c) && f(), c.push({
9623
9624
  type: "content",
9624
- content: bt.render(S)
9625
+ content: Ct.render(S)
9625
9626
  })), C = w;
9626
9627
  continue;
9627
9628
  }
@@ -9647,7 +9648,7 @@ function e0(e, t = {}) {
9647
9648
  u = [];
9648
9649
  }
9649
9650
  f();
9650
- const S = T.substring(2), w = bt.renderInline(S);
9651
+ const S = T.substring(2), w = Ct.renderInline(S);
9651
9652
  l.push([{ type: "h1", content: w }]);
9652
9653
  continue;
9653
9654
  }
@@ -9662,7 +9663,7 @@ function e0(e, t = {}) {
9662
9663
  }
9663
9664
  f();
9664
9665
  const S = T.substring(3);
9665
- c = [{ type: "h2", content: bt.renderInline(S) }];
9666
+ c = [{ type: "h2", content: Ct.renderInline(S) }];
9666
9667
  continue;
9667
9668
  }
9668
9669
  if (T.startsWith("|") || T.match(/^\s*[-|]+\s*$/)) {
@@ -9684,7 +9685,7 @@ function e0(e, t = {}) {
9684
9685
  Xf(d, 23).forEach((w, b) => {
9685
9686
  (b > 0 || m(w, c)) && f(), c.push({
9686
9687
  type: "content",
9687
- content: bt.render(w)
9688
+ content: Ct.render(w)
9688
9689
  });
9689
9690
  });
9690
9691
  else {
@@ -9692,7 +9693,7 @@ function e0(e, t = {}) {
9692
9693
  `);
9693
9694
  m(S, c) && f(), c.push({
9694
9695
  type: "content",
9695
- content: bt.render(S)
9696
+ content: Ct.render(S)
9696
9697
  });
9697
9698
  }
9698
9699
  d = [];
@@ -9751,7 +9752,7 @@ function e0(e, t = {}) {
9751
9752
  case "table":
9752
9753
  return T.content;
9753
9754
  default:
9754
- return bt.render(T.content);
9755
+ return Ct.render(T.content);
9755
9756
  }
9756
9757
  }).filter(Boolean).join(`
9757
9758
  `)).filter(Boolean).join(`
@@ -9825,7 +9826,7 @@ const t0 = ({
9825
9826
  fetchV1ImageFn: g,
9826
9827
  theme: y = "light"
9827
9828
  }) => {
9828
- const [A, E] = Y(!1), [k, R] = Y(0), [C, T] = Y(!0), { isNativeMobile: S } = Qt(), [w, b] = Y(null), [N, I] = Y(null), B = 50, [_, X] = Y(
9829
+ const [A, E] = Y(!1), [k, R] = Y(0), [C, T] = Y(!0), { isNativeMobile: S } = Zt(), [w, b] = Y(null), [N, I] = Y(null), B = 50, [_, X] = Y(
9829
9830
  "forward"
9830
9831
  ), $ = As(
9831
9832
  x == null ? void 0 : x.canvasBackground,
@@ -9977,7 +9978,7 @@ const t0 = ({
9977
9978
  ] }),
9978
9979
  /* @__PURE__ */ v("div", { className: "flex justify-center items-center gap-2", children: [
9979
9980
  m == null ? void 0 : m(),
9980
- !l && /* @__PURE__ */ r(Ye, { text: "Download", sideOffset: 10, children: /* @__PURE__ */ r(
9981
+ !l && /* @__PURE__ */ r(Ge, { text: "Download", sideOffset: 10, children: /* @__PURE__ */ r(
9981
9982
  be,
9982
9983
  {
9983
9984
  variant: "ghost",
@@ -9986,7 +9987,7 @@ const t0 = ({
9986
9987
  size: "md"
9987
9988
  }
9988
9989
  ) }),
9989
- /* @__PURE__ */ r(Ye, { text: "Comments", sideOffset: 10, children: /* @__PURE__ */ r(
9990
+ /* @__PURE__ */ r(Ge, { text: "Comments", sideOffset: 10, children: /* @__PURE__ */ r(
9990
9991
  be,
9991
9992
  {
9992
9993
  variant: "ghost",
@@ -9996,7 +9997,7 @@ const t0 = ({
9996
9997
  }
9997
9998
  ) }),
9998
9999
  !l && /* @__PURE__ */ v(
9999
- Ye,
10000
+ Ge,
10000
10001
  {
10001
10002
  text: a ? "Copy to Share" : "Link is preparing...",
10002
10003
  sideOffset: 10,
@@ -10027,7 +10028,7 @@ const t0 = ({
10027
10028
  ]
10028
10029
  }
10029
10030
  ),
10030
- /* @__PURE__ */ r(Ye, { text: "Press F to toggle fullscreen", sideOffset: 10, children: /* @__PURE__ */ r(
10031
+ /* @__PURE__ */ r(Ge, { text: "Press F to toggle fullscreen", sideOffset: 10, children: /* @__PURE__ */ r(
10031
10032
  be,
10032
10033
  {
10033
10034
  variant: "ghost",
@@ -10158,7 +10159,7 @@ const t0 = ({
10158
10159
  /* @__PURE__ */ v("div", { className: "flex flex-col gap-2", children: [
10159
10160
  /* @__PURE__ */ v("div", { className: "flex gap-3 mt-2", children: [
10160
10161
  /* @__PURE__ */ r(
10161
- Xt,
10162
+ Qt,
10162
10163
  {
10163
10164
  "data-testid": "comment-name-input",
10164
10165
  type: "text",
@@ -10243,7 +10244,7 @@ const t0 = ({
10243
10244
  replyCount: t,
10244
10245
  commentUsername: n
10245
10246
  }) => {
10246
- const s = z((R) => R.reply), o = z((R) => R.replyEditTarget), i = z((R) => R.editRequest), a = z((R) => R.clearEditRequest), l = z((R) => R.setReply), c = z((R) => R.setReplyEditTarget), u = z((R) => R.cancelReplyEdit), d = z((R) => R.handleReplyChange), h = z((R) => R.handleReplyKeyDown), m = z((R) => R.handleReplySubmit), p = z((R) => R.setOpenReplyId), f = z((R) => R.username), { isBelow1280px: x } = Qt(), g = !!s.trim(), y = !!o, A = !!(!s.trim() || !f || y && s.trim() === ((o == null ? void 0 : o.originalText) ?? "").trim()), E = F(null), k = Jt(f);
10247
+ const s = z((R) => R.reply), o = z((R) => R.replyEditTarget), i = z((R) => R.editRequest), a = z((R) => R.clearEditRequest), l = z((R) => R.setReply), c = z((R) => R.setReplyEditTarget), u = z((R) => R.cancelReplyEdit), d = z((R) => R.handleReplyChange), h = z((R) => R.handleReplyKeyDown), m = z((R) => R.handleReplySubmit), p = z((R) => R.setOpenReplyId), f = z((R) => R.username), { isBelow1280px: x } = Zt(), g = !!s.trim(), y = !!o, A = !!(!s.trim() || !f || y && s.trim() === ((o == null ? void 0 : o.originalText) ?? "").trim()), E = F(null), k = en(f);
10247
10248
  return j(() => {
10248
10249
  var R;
10249
10250
  !i || i.commentId !== e || (l(i.text), c({
@@ -10265,7 +10266,7 @@ const t0 = ({
10265
10266
  ),
10266
10267
  children: [
10267
10268
  /* @__PURE__ */ r(
10268
- Zt,
10269
+ Jt,
10269
10270
  {
10270
10271
  src: k.isEns ? Ut : `https://api.dicebear.com/9.x/identicon/svg?seed=${encodeURIComponent(
10271
10272
  k.name || ""
@@ -10274,7 +10275,7 @@ const t0 = ({
10274
10275
  }
10275
10276
  ),
10276
10277
  /* @__PURE__ */ r(
10277
- Sn,
10278
+ Nn,
10278
10279
  {
10279
10280
  ref: E,
10280
10281
  "data-testid": "comment-reply-input",
@@ -10342,7 +10343,7 @@ const t0 = ({
10342
10343
  )
10343
10344
  ] });
10344
10345
  }, c0 = ({ tabId: e }) => {
10345
- const t = z((c) => c.comment), n = z((c) => c.username), s = z((c) => c.handleCommentChange), o = z((c) => c.handleCommentKeyDown), i = z((c) => c.handleCommentSubmit), a = F(null), l = Jt(n);
10346
+ const t = z((c) => c.comment), n = z((c) => c.username), s = z((c) => c.handleCommentChange), o = z((c) => c.handleCommentKeyDown), i = z((c) => c.handleCommentSubmit), a = F(null), l = en(n);
10346
10347
  return j(() => {
10347
10348
  a.current && ut(a.current, 96);
10348
10349
  }, [t]), /* @__PURE__ */ v("div", { className: "flex flex-col gap-3 color-bg-default border-t color-border-default pt-[20px] rounded-b-lg", children: [
@@ -10354,7 +10355,7 @@ const t0 = ({
10354
10355
  ),
10355
10356
  children: [
10356
10357
  /* @__PURE__ */ r(
10357
- Zt,
10358
+ Jt,
10358
10359
  {
10359
10360
  src: l.isEns ? Ut : `https://api.dicebear.com/9.x/identicon/svg?seed=${encodeURIComponent(
10360
10361
  l.name
@@ -10363,7 +10364,7 @@ const t0 = ({
10363
10364
  }
10364
10365
  ),
10365
10366
  /* @__PURE__ */ r(
10366
- Sn,
10367
+ Nn,
10367
10368
  {
10368
10369
  ref: a,
10369
10370
  "data-testid": "comment-section-input",
@@ -10423,7 +10424,7 @@ const sc = ({
10423
10424
  onCommentFocus: d,
10424
10425
  onReset: h
10425
10426
  }) => {
10426
- const m = z((U) => U.tabComments), p = z((U) => U.username), f = z((U) => U.setUsername), x = z((U) => U.focusCommentInEditor), g = z((U) => U.setActiveCommentId), y = z((U) => U.setOpenReplyId), A = z((U) => U.openReplyId), E = z((U) => U.resolveComment), k = z((U) => U.unresolveComment), R = z((U) => U.deleteComment), C = z((U) => U.acceptSuggestion), T = z((U) => U.isConnected), S = z((U) => U.connectViaWallet), w = z((U) => U.isLoading), b = z((U) => U.connectViaUsername), N = z((U) => U.isDDocOwner), { commentsSectionRef: I, replySectionRef: B } = Bs(), { isBelow1280px: _ } = Qt(), X = s && !!A, [$, te] = Y(null), [P, Q] = Y(null), ee = (o ?? m).filter((U) => !U.deleted).sort(
10427
+ const m = z((U) => U.tabComments), p = z((U) => U.username), f = z((U) => U.setUsername), x = z((U) => U.focusCommentInEditor), g = z((U) => U.setActiveCommentId), y = z((U) => U.setOpenReplyId), A = z((U) => U.openReplyId), E = z((U) => U.resolveComment), k = z((U) => U.unresolveComment), R = z((U) => U.deleteComment), C = z((U) => U.acceptSuggestion), T = z((U) => U.isConnected), S = z((U) => U.connectViaWallet), w = z((U) => U.isLoading), b = z((U) => U.connectViaUsername), N = z((U) => U.isDDocOwner), { commentsSectionRef: I, replySectionRef: B } = Bs(), { isBelow1280px: _ } = Zt(), X = s && !!A, [$, te] = Y(null), [P, Q] = Y(null), ee = (o ?? m).filter((U) => !U.deleted).sort(
10427
10428
  (U, ce) => new Date(ce.createdAt).getTime() - new Date(U.createdAt).getTime()
10428
10429
  ), me = ee.filter(
10429
10430
  (U) => !U.resolved
@@ -10591,7 +10592,7 @@ const sc = ({
10591
10592
  onSetOpenReplyId: p
10592
10593
  }) => {
10593
10594
  var E, k;
10594
- const [f, x] = Y(!1), { isBelow1280px: g } = Qt(), y = d0(
10595
+ const [f, x] = Y(!1), { isBelow1280px: g } = Zt(), y = d0(
10595
10596
  e.id,
10596
10597
  e.selectedContent,
10597
10598
  e.tabId,
@@ -10841,7 +10842,7 @@ const sc = ({
10841
10842
  onSubmit: c,
10842
10843
  onUpdateDraftText: u
10843
10844
  }) => {
10844
- const d = F(null), h = z((g) => g.username), m = Jt(h), { handleDraftBlur: p, handleDraftFocus: f, submitLabel: x } = Yr({
10845
+ const d = F(null), h = z((g) => g.username), m = en(h), { handleDraftBlur: p, handleDraftFocus: f, submitLabel: x } = Yr({
10845
10846
  draftId: t,
10846
10847
  canAutoSubmit: n && !!t && !!(e != null && e.text.trim()) && !s,
10847
10848
  onSubmit: c
@@ -10867,7 +10868,7 @@ const sc = ({
10867
10868
  ] }),
10868
10869
  /* @__PURE__ */ v("div", { className: "border flex px-[12px] items-center justify-between py-[8px] gap-[8px] rounded-[4px]", children: [
10869
10870
  /* @__PURE__ */ r(
10870
- Zt,
10871
+ Jt,
10871
10872
  {
10872
10873
  src: m.isEns ? Ut : `https://api.dicebear.com/9.x/identicon/svg?seed=${encodeURIComponent(
10873
10874
  m.name
@@ -10876,7 +10877,7 @@ const sc = ({
10876
10877
  }
10877
10878
  ),
10878
10879
  /* @__PURE__ */ r(
10879
- Sn,
10880
+ Nn,
10880
10881
  {
10881
10882
  ref: d,
10882
10883
  value: (e == null ? void 0 : e.text) || "",
@@ -10937,7 +10938,7 @@ const sc = ({
10937
10938
  children: [
10938
10939
  /* @__PURE__ */ v("div", { className: "flex flex-col gap-2", children: [
10939
10940
  /* @__PURE__ */ r(
10940
- Xt,
10941
+ Qt,
10941
10942
  {
10942
10943
  type: "text",
10943
10944
  value: o,
@@ -11003,7 +11004,7 @@ const sc = ({
11003
11004
  onFocusSuggestionText: l,
11004
11005
  onSubmit: c
11005
11006
  }) => {
11006
- const u = Jt(s), d = !!e.selectedText, h = !!e.insertedText, m = !!e.linkHref, p = d || h || m, { submitLabel: f } = oc({
11007
+ const u = en(s), d = !!e.selectedText, h = !!e.insertedText, m = !!e.linkHref, p = d || h || m, { submitLabel: f } = oc({
11007
11008
  suggestionId: e.suggestionId,
11008
11009
  canAutoSubmit: t && p && !n,
11009
11010
  onSubmit: c
@@ -11032,7 +11033,7 @@ const sc = ({
11032
11033
  t ? /* @__PURE__ */ v("div", { className: "flex flex-col gap-[8px]", children: [
11033
11034
  /* @__PURE__ */ v("div", { className: "flex items-center gap-2", children: [
11034
11035
  /* @__PURE__ */ r(
11035
- Zt,
11036
+ Jt,
11036
11037
  {
11037
11038
  src: u.isEns ? Ut : `https://api.dicebear.com/9.x/identicon/svg?seed=${encodeURIComponent(
11038
11039
  u.name
@@ -11518,7 +11519,7 @@ const sc = ({
11518
11519
  }) => {
11519
11520
  const d = z((je) => je.initialComments), h = z((je) => je.isConnected), m = z((je) => je.focusCommentInEditor), p = z(
11520
11521
  (je) => je.focusSuggestionDraftInEditor
11521
- ), f = z((je) => je.isCommentOpen), x = z((je) => je.openReplyId), g = z((je) => je.setOpenReplyId), y = z((je) => je.setIsCommentOpen), A = z((je) => je.username), { isBelow1280px: E } = Qt(), k = F(null), { mobileDraftRef: R } = Bs(), C = E && !!x, {
11522
+ ), f = z((je) => je.isCommentOpen), x = z((je) => je.openReplyId), g = z((je) => je.setOpenReplyId), y = z((je) => je.setIsCommentOpen), A = z((je) => je.username), { isBelow1280px: E } = Zt(), k = F(null), { mobileDraftRef: R } = Bs(), C = E && !!x, {
11522
11523
  closeFilterSelects: T,
11523
11524
  commentType: S,
11524
11525
  commentTypeOptions: w,
@@ -11558,13 +11559,13 @@ const sc = ({
11558
11559
  onTabChange: a,
11559
11560
  setOpenReplyId: g
11560
11561
  }), {
11561
- canGoToNextMobileComment: Re,
11562
+ canGoToNextMobileComment: De,
11562
11563
  canGoToPreviousMobileComment: Ee,
11563
11564
  handleNextMobileComment: He,
11564
11565
  handlePreviousMobileComment: ze,
11565
- handleViewAllComments: Ge,
11566
- mobileActiveCommentsCount: kt,
11567
- mobileFocusedCommentIndex: Ke
11566
+ handleViewAllComments: Ye,
11567
+ mobileActiveCommentsCount: xt,
11568
+ mobileFocusedCommentIndex: ht
11568
11569
  } = k0({
11569
11570
  comments: d,
11570
11571
  mobileDrawerRef: k,
@@ -11583,14 +11584,14 @@ const sc = ({
11583
11584
  setIsDiscardCommentOverlayVisible: D,
11584
11585
  setIsDiscardSuggestionOverlayVisible: se
11585
11586
  });
11586
- const at = /* @__PURE__ */ r("div", { ref: k, "data-testid": "comment-drawer", children: E ? /* @__PURE__ */ r(
11587
+ const lt = /* @__PURE__ */ r("div", { ref: k, "data-testid": "comment-drawer", children: E ? /* @__PURE__ */ r(
11587
11588
  y0,
11588
11589
  {
11589
11590
  activeCommentId: o,
11590
11591
  activeDraft: le,
11591
11592
  activeDraftId: O,
11592
11593
  activeSuggestionDraftCard: H,
11593
- canGoToNextMobileComment: Re,
11594
+ canGoToNextMobileComment: De,
11594
11595
  canGoToPreviousMobileComment: Ee,
11595
11596
  comments: d,
11596
11597
  isCommentMobileFocused: C,
@@ -11601,9 +11602,9 @@ const sc = ({
11601
11602
  isMobileDrawerVisible: Se,
11602
11603
  isNavbarVisible: n,
11603
11604
  isPresentationMode: s,
11604
- mobileActiveCommentsCount: kt,
11605
+ mobileActiveCommentsCount: xt,
11605
11606
  mobileDraftRef: R,
11606
- mobileFocusedCommentIndex: Ke,
11607
+ mobileFocusedCommentIndex: ht,
11607
11608
  onAttemptCloseNewComment: () => D(!0),
11608
11609
  onAttemptCloseSuggestionDraft: () => se(!0),
11609
11610
  onCancelDiscardComment: () => D(!1),
@@ -11624,7 +11625,7 @@ const sc = ({
11624
11625
  onStartNewMobileComment: q,
11625
11626
  onSubmitSuggestionDraft: L,
11626
11627
  onUpdateInlineDraftText: fe,
11627
- onViewAllComments: Ge,
11628
+ onViewAllComments: Ye,
11628
11629
  tabNameById: oe,
11629
11630
  username: A
11630
11631
  }
@@ -11657,7 +11658,7 @@ const sc = ({
11657
11658
  tabNameById: oe
11658
11659
  }
11659
11660
  ) });
11660
- return E && u ? Nn(at, u) : at;
11661
+ return E && u ? Tn(lt, u) : lt;
11661
11662
  }, N0 = (e) => {
11662
11663
  const [t, n] = Y(!1);
11663
11664
  return j(() => {
@@ -12224,7 +12225,7 @@ const sc = ({
12224
12225
  );
12225
12226
  const K = M(() => {
12226
12227
  G.current.rafId === null && (G.current.rafId = window.requestAnimationFrame(() => {
12227
- var nn;
12228
+ var tn;
12228
12229
  G.current.rafId = null;
12229
12230
  const D = Q.current, se = cr(n), fe = u.current, re = P.current;
12230
12231
  if (!se || !fe || !re || !D.length || !l) {
@@ -12240,7 +12241,7 @@ const sc = ({
12240
12241
  activeFloatingCards: Ee,
12241
12242
  activeFloatingCardMap: He,
12242
12243
  floatingCardIdsToClose: ze,
12243
- shouldScheduleFollowUp: Ge
12244
+ shouldScheduleFollowUp: Ye
12244
12245
  } = g({
12245
12246
  currentCycle: Se,
12246
12247
  currentDocVersion: J,
@@ -12254,93 +12255,93 @@ const sc = ({
12254
12255
  markRecomputeFromIndex: b,
12255
12256
  getOrderedFloatingCardIndex: k
12256
12257
  });
12257
- ue || (ue = Ge);
12258
- const { orderedFloatingCardIds: kt, firstChangedIndex: Ke } = _(Ee);
12259
- if (Ke !== null) {
12260
- b(Ke);
12261
- const Pe = kt[Ke];
12258
+ ue || (ue = Ye);
12259
+ const { orderedFloatingCardIds: xt, firstChangedIndex: ht } = _(Ee);
12260
+ if (ht !== null) {
12261
+ b(ht);
12262
+ const Pe = xt[ht];
12262
12263
  Pe && S(
12263
12264
  Pe,
12264
12265
  dt.Anchor
12265
12266
  );
12266
12267
  }
12267
12268
  B(new Set(He.keys()));
12268
- const ht = fe.getBoundingClientRect(), at = re.getBoundingClientRect(), je = (nn = s.current) == null ? void 0 : nn.getBoundingClientRect(), Ht = je !== void 0 ? Math.max(
12269
+ const Ke = fe.getBoundingClientRect(), lt = re.getBoundingClientRect(), je = (tn = s.current) == null ? void 0 : tn.getBoundingClientRect(), Ht = je !== void 0 ? Math.max(
12269
12270
  0,
12270
- je.bottom - at.top
12271
+ je.bottom - lt.top
12271
12272
  ) : 0;
12272
12273
  ce.current !== re && (ce.current = re, q.current = null), (U.current === null || Math.abs(
12273
- U.current - at.top
12274
- ) > 0.5) && (U.current = at.top, L.current.containerOffset += 1);
12275
- const Xe = ht.height, et = ht.top - at.top, St = et + Xe, ln = L.current.appliedScroll !== L.current.scroll, en = L.current.appliedContainerOffset !== L.current.containerOffset;
12274
+ U.current - lt.top
12275
+ ) > 0.5) && (U.current = lt.top, L.current.containerOffset += 1);
12276
+ const Xe = Ke.height, Qe = Ke.top - lt.top, St = Qe + Xe, an = L.current.appliedScroll !== L.current.scroll, ln = L.current.appliedContainerOffset !== L.current.containerOffset;
12276
12277
  I.current.forEach((Pe, Me) => {
12277
12278
  const st = He.get(Pe);
12278
12279
  if (!st)
12279
12280
  return;
12280
- const Ie = R(Pe), { anchorId: zt } = So(st), rt = m.current.get(zt);
12281
+ const Re = R(Pe), { anchorId: Kt } = So(st), rt = m.current.get(Kt);
12281
12282
  if (!rt) {
12282
- Ie.isInViewport && (Ie.isInViewport = !1, S(
12283
+ Re.isInViewport && (Re.isInViewport = !1, S(
12283
12284
  Pe,
12284
12285
  dt.Visibility
12285
- ), b(Me)), Ie.anchorTop = null, Ie.anchorHeight = 0;
12286
+ ), b(Me)), Re.anchorTop = null, Re.anchorHeight = 0;
12286
12287
  return;
12287
12288
  }
12288
12289
  let ct = rt.cachedRect ? B0({
12289
12290
  cachedRect: rt.cachedRect,
12290
12291
  scrollTop: fe.scrollTop,
12291
- containerTop: at.top
12292
+ containerTop: lt.top
12292
12293
  }) : null;
12293
- ct && (Ie.anchorTop = ct.top, Ie.anchorHeight = ct.height);
12294
+ ct && (Re.anchorTop = ct.top, Re.anchorHeight = ct.height);
12294
12295
  const mt = ct !== null && dr({
12295
12296
  top: ct.top,
12296
12297
  bottom: ct.top + ct.height,
12297
- viewportTop: et,
12298
+ viewportTop: Qe,
12298
12299
  viewportBottom: St,
12299
12300
  viewportHeight: Xe
12300
- }), jn = Ie.anchorVersion !== rt.anchorVersion;
12301
- if ((!rt.cachedRect || Ie.isInViewport || mt || jn || !Ie.isMeasured || en && mt || ln && Ie.isInViewport) && Sa(rt, se)) {
12301
+ }), jn = Re.anchorVersion !== rt.anchorVersion;
12302
+ if ((!rt.cachedRect || Re.isInViewport || mt || jn || !Re.isMeasured || ln && mt || an && Re.isInViewport) && Sa(rt, se)) {
12302
12303
  const pt = O0({
12303
12304
  elements: rt.elements,
12304
- viewportTop: ht.top,
12305
- viewportBottom: ht.bottom
12305
+ viewportTop: Ke.top,
12306
+ viewportBottom: Ke.bottom
12306
12307
  });
12307
12308
  if (pt) {
12308
- const Vt = pt.top - at.top;
12309
- Ie.anchorTop = Vt, Ie.anchorHeight = pt.height, rt.cachedRect = {
12310
- top: Vt,
12309
+ const Wt = pt.top - lt.top;
12310
+ Re.anchorTop = Wt, Re.anchorHeight = pt.height, rt.cachedRect = {
12311
+ top: Wt,
12311
12312
  height: pt.height,
12312
12313
  scrollTop: fe.scrollTop,
12313
- containerTop: at.top
12314
- }, ct = { top: Vt, height: pt.height };
12315
- } else ct && (Ie.anchorTop = ct.top, Ie.anchorHeight = ct.height);
12314
+ containerTop: lt.top
12315
+ }, ct = { top: Wt, height: pt.height };
12316
+ } else ct && (Re.anchorTop = ct.top, Re.anchorHeight = ct.height);
12316
12317
  }
12317
- Ie.anchorVersion = rt.anchorVersion;
12318
- const Kt = Ie.anchorTop !== null && dr({
12319
- top: Ie.anchorTop,
12320
- bottom: Ie.anchorTop + Math.max(Ie.anchorHeight, 1),
12321
- viewportTop: et,
12318
+ Re.anchorVersion = rt.anchorVersion;
12319
+ const jt = Re.anchorTop !== null && dr({
12320
+ top: Re.anchorTop,
12321
+ bottom: Re.anchorTop + Math.max(Re.anchorHeight, 1),
12322
+ viewportTop: Qe,
12322
12323
  viewportBottom: St,
12323
12324
  viewportHeight: Xe
12324
- }), sn = Ie.translateY ?? Ie.lastCommittedTranslateY, jt = Ie.isMeasured && sn !== null && dr({
12325
- top: sn,
12326
- bottom: sn + Ie.height,
12327
- viewportTop: et,
12325
+ }), nn = Re.translateY ?? Re.lastCommittedTranslateY, Vt = Re.isMeasured && nn !== null && dr({
12326
+ top: nn,
12327
+ bottom: nn + Re.height,
12328
+ viewportTop: Qe,
12328
12329
  viewportBottom: St,
12329
12330
  viewportHeight: Xe
12330
- }), Nt = Kt || jt;
12331
- if (Ie.isInViewport !== Nt) {
12332
- const pt = Ie.isInViewport;
12333
- Ie.isInViewport = Nt, S(
12331
+ }), Nt = jt || Vt;
12332
+ if (Re.isInViewport !== Nt) {
12333
+ const pt = Re.isInViewport;
12334
+ Re.isInViewport = Nt, S(
12334
12335
  Pe,
12335
12336
  dt.Visibility
12336
- ), b(Me), !pt && Nt && (Ie.needsTransformSync = !0, C.current.add(Pe), ue = !0);
12337
+ ), b(Me), !pt && Nt && (Re.needsTransformSync = !0, C.current.add(Pe), ue = !0);
12337
12338
  }
12338
12339
  }), L.current.appliedScroll = L.current.scroll, L.current.appliedContainerOffset = L.current.containerOffset;
12339
- const tn = I.current.filter((Pe) => {
12340
+ const zt = I.current.filter((Pe) => {
12340
12341
  const Me = A.current.get(Pe);
12341
12342
  return !!(Me != null && Me.isInViewport);
12342
- }), { didChange: Tn, previousMountedFloatingCardIds: ms } = $(tn);
12343
- Tn && tn.forEach((Pe) => {
12343
+ }), { didChange: cn, previousMountedFloatingCardIds: ms } = $(zt);
12344
+ cn && zt.forEach((Pe) => {
12344
12345
  if (ms.has(Pe))
12345
12346
  return;
12346
12347
  C.current.add(Pe);
@@ -12353,46 +12354,46 @@ const sc = ({
12353
12354
  const Me = W.current.cardNodes.get(Pe), st = A.current.get(Pe);
12354
12355
  if (!Me || !st)
12355
12356
  return;
12356
- const Ie = Math.round(Me.offsetHeight);
12357
- if (Ie > 0 && (!st.isMeasured || st.height !== Ie)) {
12358
- st.height = Ie, st.isMeasured = !0;
12359
- const zt = k(Pe);
12357
+ const Re = Math.round(Me.offsetHeight);
12358
+ if (Re > 0 && (!st.isMeasured || st.height !== Re)) {
12359
+ st.height = Re, st.isMeasured = !0;
12360
+ const Kt = k(Pe);
12360
12361
  S(
12361
12362
  Pe,
12362
12363
  dt.Height
12363
- ), b(zt ?? 0);
12364
+ ), b(Kt ?? 0);
12364
12365
  }
12365
12366
  }), C.current.clear();
12366
- let fn = Number.POSITIVE_INFINITY;
12367
+ let gn = Number.POSITIVE_INFINITY;
12367
12368
  const ps = I.current.reduce(
12368
12369
  (Pe, Me, st) => {
12369
- const Ie = A.current.get(Me);
12370
- return !Ie || Ie.invalidationFlags === dt.None ? Pe : (fn = Math.min(fn, st), st);
12370
+ const Re = A.current.get(Me);
12371
+ return !Re || Re.invalidationFlags === dt.None ? Pe : (gn = Math.min(gn, st), st);
12371
12372
  },
12372
12373
  -1
12373
12374
  ), Kn = Math.min(
12374
12375
  T.current.recomputeFromIndex,
12375
12376
  Math.max(I.current.length - 1, 0)
12376
- ), En = !!me.current && O.current && I.current.length > 0, gn = zu({
12377
+ ), En = !!me.current && O.current && I.current.length > 0, yn = zu({
12377
12378
  floatingCards: E(),
12378
12379
  recomputeStartIndex: Kn,
12379
- firstInvalidatedIndex: En ? 0 : fn,
12380
+ firstInvalidatedIndex: En ? 0 : gn,
12380
12381
  lastInvalidatedIndex: En ? I.current.length - 1 : ps,
12381
12382
  gap: Ku,
12382
12383
  focusedFloatingCardId: me.current
12383
12384
  });
12384
- En && gn.usedFocusedLayout && (O.current = !1);
12385
+ En && yn.usedFocusedLayout && (O.current = !1);
12385
12386
  let ie = 0;
12386
12387
  I.current.forEach((Pe) => {
12387
12388
  const Me = A.current.get(Pe), st = W.current.cardNodes.get(Pe);
12388
12389
  if (!Me)
12389
12390
  return;
12390
- const Ie = gn.placements.get(Pe) ?? {
12391
+ const Re = yn.placements.get(Pe) ?? {
12391
12392
  translateY: Me.translateY,
12392
12393
  isVisible: Me.lastCommittedVisible
12393
- }, zt = Ie.translateY ?? Me.translateY ?? Me.lastCommittedTranslateY;
12394
- if (!c && Me.isMeasured && zt !== null) {
12395
- const An = Li(zt);
12394
+ }, Kt = Re.translateY ?? Me.translateY ?? Me.lastCommittedTranslateY;
12395
+ if (!c && Me.isMeasured && Kt !== null) {
12396
+ const An = Li(Kt);
12396
12397
  An !== null && (ie = Math.max(
12397
12398
  ie,
12398
12399
  An + Me.height
@@ -12400,19 +12401,19 @@ const sc = ({
12400
12401
  }
12401
12402
  if (!st)
12402
12403
  return;
12403
- gn.placements.has(Pe) && (Me.translateY = Ie.translateY);
12404
- const rt = Li(Ie.translateY);
12404
+ yn.placements.has(Pe) && (Me.translateY = Re.translateY);
12405
+ const rt = Li(Re.translateY);
12405
12406
  (Me.needsTransformSync && rt !== null || rt !== Me.lastCommittedTranslateY) && rt !== null && (st.style.transform = `translateY(${rt}px)`, Me.lastCommittedTranslateY = rt, Me.needsTransformSync = !1);
12406
- const mt = !!Ie.isVisible && Me.isMeasured && Me.anchorTop !== null && !c;
12407
+ const mt = !!Re.isVisible && Me.isMeasured && Me.anchorTop !== null && !c;
12407
12408
  (mt !== Me.lastCommittedVisible || (Me.invalidationFlags & (dt.Visibility | dt.Height)) !== 0) && (st.style.visibility = mt ? "visible" : "hidden", st.style.opacity = mt ? "1" : "0", Me.lastCommittedVisible = mt);
12408
12409
  });
12409
- const yn = ie > 0 ? ie + ju : 0, At = Math.ceil(
12410
- Math.max(Ht, yn)
12410
+ const xn = ie > 0 ? ie + ju : 0, At = Math.ceil(
12411
+ Math.max(Ht, xn)
12411
12412
  );
12412
12413
  q.current !== At && (re.style.setProperty(
12413
12414
  K0,
12414
12415
  `${At}px`
12415
- ), q.current = At), y(gn.stopIndex), T.current.recomputeFromIndex = I.current.length, ze.size > 0 && ze.forEach((Pe) => {
12416
+ ), q.current = At), y(yn.stopIndex), T.current.recomputeFromIndex = I.current.length, ze.size > 0 && ze.forEach((Pe) => {
12416
12417
  t(Pe);
12417
12418
  }), ue && Ee.length > 0 && K();
12418
12419
  }));
@@ -12600,7 +12601,7 @@ const sc = ({
12600
12601
  const ue = ee.current.get(J);
12601
12602
  if (!ue)
12602
12603
  return;
12603
- const { anchorId: Re } = So(ue), Ee = m.current.get(Re);
12604
+ const { anchorId: De } = So(ue), Ee = m.current.get(De);
12604
12605
  (!Ee || !Sa(Ee, re)) && (p(J), Se = !0);
12605
12606
  }), Se && K();
12606
12607
  };
@@ -12767,7 +12768,7 @@ const sc = ({
12767
12768
  };
12768
12769
  }, Y0 = (e) => e instanceof Element ? !!e.closest(
12769
12770
  'button, [role="button"], a, [data-inline-comment-actions-menu], [data-radix-popper-content-wrapper]'
12770
- ) : !1, js = wt(({ floatingCardId: e, isHidden: t, isFocused: n, onFocus: s, children: o }, i) => /* @__PURE__ */ r(
12771
+ ) : !1, js = bt(({ floatingCardId: e, isHidden: t, isFocused: n, onFocus: s, children: o }, i) => /* @__PURE__ */ r(
12771
12772
  "div",
12772
12773
  {
12773
12774
  ref: i,
@@ -12794,7 +12795,7 @@ const X0 = ({
12794
12795
  isHidden: t,
12795
12796
  registerCardNode: n
12796
12797
  }) => {
12797
- const s = z((d) => d.focusFloatingCard), o = z((d) => d.inlineDrafts[e.draftId]), i = z((d) => d.username), a = z((d) => d.isConnected), l = F(null), c = Jt(i), u = M(
12798
+ const s = z((d) => d.focusFloatingCard), o = z((d) => d.inlineDrafts[e.draftId]), i = z((d) => d.username), a = z((d) => d.isConnected), l = F(null), c = en(i), u = M(
12798
12799
  (d) => {
12799
12800
  l.current = d, n(e.floatingCardId, d);
12800
12801
  },
@@ -12822,7 +12823,7 @@ const X0 = ({
12822
12823
  children: a ? /* @__PURE__ */ v(nt, { children: [
12823
12824
  /* @__PURE__ */ v("div", { className: "flex justify-start items-center gap-2 color-border-default px-3 pb-2 pt-3", children: [
12824
12825
  /* @__PURE__ */ r(
12825
- Zt,
12826
+ Jt,
12826
12827
  {
12827
12828
  src: c.isEns ? Ut : `https://api.dicebear.com/9.x/identicon/svg?seed=${encodeURIComponent(
12828
12829
  c.name
@@ -12862,7 +12863,7 @@ const X0 = ({
12862
12863
  a.current && ut(a.current);
12863
12864
  }, [e == null ? void 0 : e.text]), /* @__PURE__ */ v("div", { className: "flex flex-col gap-3 p-3 pb-0 pt-0", children: [
12864
12865
  /* @__PURE__ */ r("div", { className: "border flex px-[12px] py-[8px] gap-[8px] rounded-[4px]", children: /* @__PURE__ */ r(
12865
- Sn,
12866
+ Nn,
12866
12867
  {
12867
12868
  ref: a,
12868
12869
  value: e.text,
@@ -12905,7 +12906,7 @@ const X0 = ({
12905
12906
  isHidden: t,
12906
12907
  registerCardNode: n
12907
12908
  }) => {
12908
- const s = z((y) => y.focusFloatingCard), o = z((y) => y.submitDraft), i = z((y) => y.discardDraft), a = z((y) => y.isConnected), l = !!e.selectedText, c = !!e.insertedText, u = !!e.linkHref, d = l || c || u, h = z((y) => y.username), m = Jt(h), p = M(() => {
12909
+ const s = z((y) => y.focusFloatingCard), o = z((y) => y.submitDraft), i = z((y) => y.discardDraft), a = z((y) => y.isConnected), l = !!e.selectedText, c = !!e.insertedText, u = !!e.linkHref, d = l || c || u, h = z((y) => y.username), m = en(h), p = M(() => {
12909
12910
  o(e.suggestionId);
12910
12911
  }, [e.suggestionId, o]), { submitLabel: f } = oc({
12911
12912
  suggestionId: e.suggestionId,
@@ -12928,7 +12929,7 @@ const X0 = ({
12928
12929
  children: a ? /* @__PURE__ */ v("div", { className: "flex flex-col gap-2 p-3 pb-0", children: [
12929
12930
  /* @__PURE__ */ v("div", { className: "flex items-center gap-2", children: [
12930
12931
  /* @__PURE__ */ r(
12931
- Zt,
12932
+ Jt,
12932
12933
  {
12933
12934
  src: m.isEns ? Ut : `https://api.dicebear.com/9.x/identicon/svg?seed=${encodeURIComponent(
12934
12935
  m.name
@@ -13052,10 +13053,10 @@ const X0 = ({
13052
13053
  onAccept: i,
13053
13054
  onReject: a
13054
13055
  }) => {
13055
- const l = Jt(e);
13056
+ const l = en(e);
13056
13057
  return /* @__PURE__ */ v("div", { className: "flex items-center gap-2", children: [
13057
13058
  /* @__PURE__ */ r(
13058
- Zt,
13059
+ Jt,
13059
13060
  {
13060
13061
  src: l.isEns ? Ut : `https://api.dicebear.com/9.x/identicon/svg?seed=${encodeURIComponent(
13061
13062
  l.name
@@ -13159,7 +13160,7 @@ const X0 = ({
13159
13160
  thread: e,
13160
13161
  comment: t
13161
13162
  }) => {
13162
- const n = z((g) => g.username), s = z((g) => g.isConnected), o = z((g) => g.handleAddReply), i = z((g) => g.setCommentDrawerOpen), [a, l] = Y(""), [c, u] = Y(!1), d = F(null), h = !t.resolved && !t.deleted, m = !!a.trim(), p = s && (e.isFocused || m), f = Jt(n);
13163
+ const n = z((g) => g.username), s = z((g) => g.isConnected), o = z((g) => g.handleAddReply), i = z((g) => g.setCommentDrawerOpen), [a, l] = Y(""), [c, u] = Y(!1), d = F(null), h = !t.resolved && !t.deleted, m = !!a.trim(), p = s && (e.isFocused || m), f = en(n);
13163
13164
  j(() => {
13164
13165
  d.current && ut(d.current);
13165
13166
  }, [a]);
@@ -13182,7 +13183,7 @@ const X0 = ({
13182
13183
  ),
13183
13184
  children: [
13184
13185
  /* @__PURE__ */ r(
13185
- Zt,
13186
+ Jt,
13186
13187
  {
13187
13188
  src: f.isEns ? Ut : `https://api.dicebear.com/9.x/identicon/svg?seed=${encodeURIComponent(
13188
13189
  f.name || ""
@@ -13191,7 +13192,7 @@ const X0 = ({
13191
13192
  }
13192
13193
  ),
13193
13194
  /* @__PURE__ */ r(
13194
- Sn,
13195
+ Nn,
13195
13196
  {
13196
13197
  ref: d,
13197
13198
  value: a,
@@ -13317,7 +13318,7 @@ const X0 = ({
13317
13318
  comment: e,
13318
13319
  thread: t
13319
13320
  }) => {
13320
- const n = z((b) => b.username), [s, o] = Y(!1), i = !(e != null && e.resolved) && !!e, a = z((b) => b.setCommentDrawerOpen), l = z((b) => b.handleAddReply), c = z((b) => b.editRequest), u = z((b) => b.clearEditRequest), d = z((b) => b.replyEditTarget), h = z((b) => b.setReplyEditTarget), m = z((b) => b.cancelReplyEdit), p = z((b) => b.editCompletion), f = z((b) => b.editCommentContent), x = z((b) => b.editReplyContent), g = F(null), [y, A] = Y(""), E = z((b) => b.isConnected), k = Jt(n), R = () => {
13321
+ const n = z((b) => b.username), [s, o] = Y(!1), i = !(e != null && e.resolved) && !!e, a = z((b) => b.setCommentDrawerOpen), l = z((b) => b.handleAddReply), c = z((b) => b.editRequest), u = z((b) => b.clearEditRequest), d = z((b) => b.replyEditTarget), h = z((b) => b.setReplyEditTarget), m = z((b) => b.cancelReplyEdit), p = z((b) => b.editCompletion), f = z((b) => b.editCommentContent), x = z((b) => b.editReplyContent), g = F(null), [y, A] = Y(""), E = z((b) => b.isConnected), k = en(n), R = () => {
13321
13322
  if (!(!t.commentId || !y.trim())) {
13322
13323
  if (!E) {
13323
13324
  a == null || a(!0);
@@ -13357,7 +13358,7 @@ const X0 = ({
13357
13358
  ),
13358
13359
  children: [
13359
13360
  /* @__PURE__ */ r(
13360
- Zt,
13361
+ Jt,
13361
13362
  {
13362
13363
  src: k.isEns ? Ut : `https://api.dicebear.com/9.x/identicon/svg?seed=${encodeURIComponent(
13363
13364
  k.name
@@ -13366,7 +13367,7 @@ const X0 = ({
13366
13367
  }
13367
13368
  ),
13368
13369
  /* @__PURE__ */ r(
13369
- Sn,
13370
+ Nn,
13370
13371
  {
13371
13372
  ref: g,
13372
13373
  value: y,
@@ -13559,7 +13560,7 @@ const X0 = ({
13559
13560
  children: [
13560
13561
  /* @__PURE__ */ r("span", { className: "truncate", children: e.textContent }),
13561
13562
  /* @__PURE__ */ r(
13562
- Ye,
13563
+ Ge,
13563
13564
  {
13564
13565
  text: l ? "Heading link copied" : "Copy heading link",
13565
13566
  position: "right",
@@ -13590,7 +13591,7 @@ const ac = Ro(() => /* @__PURE__ */ r("p", { className: "text-helper-text-sm px-
13590
13591
  ac.displayName = "ToCEmptyState";
13591
13592
  const lc = Ro(
13592
13593
  ({ items: e = [], editor: t, setItems: n, orientation: s }) => {
13593
- const [o, i] = Y(null), a = xt("(max-width: 1280px)"), l = xt("(min-width: 1280px)"), c = F(null), u = F(0), d = F(null), h = ve(() => e.map((y) => ({
13594
+ const [o, i] = Y(null), a = wt("(max-width: 1280px)"), l = wt("(min-width: 1280px)"), c = F(null), u = F(0), d = F(null), h = ve(() => e.map((y) => ({
13594
13595
  ...y,
13595
13596
  isActive: Bn(y.id) && y.id === o
13596
13597
  })), [e, o]), m = M(() => {
@@ -13674,7 +13675,7 @@ const lc = Ro(
13674
13675
  const C = setTimeout(() => {
13675
13676
  const T = t.view.posAtDOM(R, 0), S = t.view.state.tr;
13676
13677
  S.setSelection(new Es(S.doc.resolve(T))), t.view.dispatch(S);
13677
- const w = kn({
13678
+ const w = Sn({
13678
13679
  targetElement: R,
13679
13680
  editorRoot: t.view.dom
13680
13681
  });
@@ -13728,7 +13729,7 @@ const lc = Ro(
13728
13729
  }
13729
13730
  );
13730
13731
  lc.displayName = "ToC";
13731
- const No = Qe.memo(lc), Ar = ({
13732
+ const No = Ze.memo(lc), Ar = ({
13732
13733
  emoji: e,
13733
13734
  setEmoji: t,
13734
13735
  isEditing: n,
@@ -13845,7 +13846,7 @@ const No = Qe.memo(lc), Ar = ({
13845
13846
  ref: (x) => {
13846
13847
  c.current = x;
13847
13848
  },
13848
- children: /* @__PURE__ */ r(Ye, { position: "top", text: "Choose emoji", children: /* @__PURE__ */ r(
13849
+ children: /* @__PURE__ */ r(Ge, { position: "top", text: "Choose emoji", children: /* @__PURE__ */ r(
13849
13850
  he,
13850
13851
  {
13851
13852
  onClick: () => {
@@ -14288,7 +14289,7 @@ const mg = "space-xsm gap-xsm hover:color-bg-default-hover cursor-pointer h-[30p
14288
14289
  }
14289
14290
  ),
14290
14291
  e ? /* @__PURE__ */ r(
14291
- Xt,
14292
+ Qt,
14292
14293
  {
14293
14294
  "data-testid": "tab-rename-input",
14294
14295
  ref: W,
@@ -14309,7 +14310,7 @@ const mg = "space-xsm gap-xsm hover:color-bg-default-hover cursor-pointer h-[30p
14309
14310
  },
14310
14311
  className: "h-[24px] px-[6px] py-0 rounded-[6px] text-heading-xsm border-transparent focus-visible:ring-2 focus-visible:ring-[hsl(var(--color-border-focused))]"
14311
14312
  }
14312
- ) : /* @__PURE__ */ r("div", { className: "min-w-0 flex [&>*]:w-full", children: /* @__PURE__ */ r(Ye, { text: Q, position: "bottom", children: /* @__PURE__ */ r(
14313
+ ) : /* @__PURE__ */ r("div", { className: "min-w-0 flex [&>*]:w-full", children: /* @__PURE__ */ r(Ge, { text: Q, position: "bottom", children: /* @__PURE__ */ r(
14313
14314
  "span",
14314
14315
  {
14315
14316
  "data-testid": `tab-name-${n}`,
@@ -14394,7 +14395,7 @@ const mg = "space-xsm gap-xsm hover:color-bg-default-hover cursor-pointer h-[30p
14394
14395
  onMouseEnter: () => n(!0),
14395
14396
  onMouseLeave: () => n(!1),
14396
14397
  className: "[&_[data-testid='tooltip-trigger']]:w-full [&_[data-testid='tooltip-trigger']]:block",
14397
- children: /* @__PURE__ */ r(Ye, { text: e.tooltipText, position: "top", open: t, children: o })
14398
+ children: /* @__PURE__ */ r(Ge, { text: e.tooltipText, position: "top", open: t, children: o })
14398
14399
  }
14399
14400
  ) : o;
14400
14401
  }, dc = ({
@@ -14598,7 +14599,7 @@ const mg = "space-xsm gap-xsm hover:color-bg-default-hover cursor-pointer h-[30p
14598
14599
  } : { title: void 0, text: void 0 }, wg = 24, bg = ({
14599
14600
  tabSectionContainer: e,
14600
14601
  ...t
14601
- }) => !e && t.isVersionHistoryMode ? null : e ? Nn(/* @__PURE__ */ r(Aa, { ...t }), e) : /* @__PURE__ */ r(Aa, { ...t }), Aa = ({
14602
+ }) => !e && t.isVersionHistoryMode ? null : e ? Tn(/* @__PURE__ */ r(Aa, { ...t }), e) : /* @__PURE__ */ r(Aa, { ...t }), Aa = ({
14602
14603
  tabs: e,
14603
14604
  activeTabId: t,
14604
14605
  setActiveTabId: n,
@@ -14771,7 +14772,7 @@ const mg = "space-xsm gap-xsm hover:color-bg-default-hover cursor-pointer h-[30p
14771
14772
  ),
14772
14773
  children: [
14773
14774
  (!R || s) && /* @__PURE__ */ r(
14774
- Ye,
14775
+ Ge,
14775
14776
  {
14776
14777
  text: s ? "Hide tabs and outlines" : "Show tabs and outlines",
14777
14778
  position: "right",
@@ -14991,7 +14992,7 @@ const mg = "space-xsm gap-xsm hover:color-bg-default-hover cursor-pointer h-[30p
14991
14992
  ) }),
14992
14993
  /* @__PURE__ */ r(Kr, { className: "border-b px-4 py-3", children: /* @__PURE__ */ r(jr, { children: /* @__PURE__ */ r("p", { className: "text-heading-sm", children: "Rename tab" }) }) }),
14993
14994
  /* @__PURE__ */ r("div", { className: "space-x-md", children: /* @__PURE__ */ r(
14994
- Xt,
14995
+ Qt,
14995
14996
  {
14996
14997
  "data-testid": "tab-rename-modal-input",
14997
14998
  autoFocus: !0,
@@ -15417,7 +15418,7 @@ const mg = "space-xsm gap-xsm hover:color-bg-default-hover cursor-pointer h-[30p
15417
15418
  ]
15418
15419
  }
15419
15420
  );
15420
- return H ? k ? Nn(U, k) : null : U;
15421
+ return H ? k ? Tn(U, k) : null : U;
15421
15422
  }, Ng = ({
15422
15423
  editor: e,
15423
15424
  hasToC: t,
@@ -15427,7 +15428,7 @@ const mg = "space-xsm gap-xsm hover:color-bg-default-hover cursor-pointer h-[30p
15427
15428
  setShowTOC: i,
15428
15429
  orientation: a
15429
15430
  }) => {
15430
- const l = xt("(max-width:1280px)"), c = n.length < 2;
15431
+ const l = wt("(max-width:1280px)"), c = n.length < 2;
15431
15432
  return l ? /* @__PURE__ */ r(
15432
15433
  Ph,
15433
15434
  {
@@ -15461,7 +15462,7 @@ const mg = "space-xsm gap-xsm hover:color-bg-default-hover cursor-pointer h-[30p
15461
15462
  ),
15462
15463
  children: [
15463
15464
  /* @__PURE__ */ r(
15464
- Ye,
15465
+ Ge,
15465
15466
  {
15466
15467
  text: o ? "Hide document outline" : "Show document outline",
15467
15468
  position: "right",
@@ -15528,7 +15529,7 @@ const mg = "space-xsm gap-xsm hover:color-bg-default-hover cursor-pointer h-[30p
15528
15529
  tabPanelSlot: b,
15529
15530
  ddocId: N
15530
15531
  }) => {
15531
- const I = xt("(max-width:1280px)");
15532
+ const I = wt("(max-width:1280px)");
15532
15533
  return c.length ? !I || E ? /* @__PURE__ */ r(
15533
15534
  bg,
15534
15535
  {
@@ -15865,7 +15866,7 @@ const mg = "space-xsm gap-xsm hover:color-bg-default-hover cursor-pointer h-[30p
15865
15866
  }
15866
15867
  ),
15867
15868
  /* @__PURE__ */ r(
15868
- Xt,
15869
+ Qt,
15869
15870
  {
15870
15871
  type: "number",
15871
15872
  id: "lineHeight",
@@ -15895,7 +15896,7 @@ const mg = "space-xsm gap-xsm hover:color-bg-default-hover cursor-pointer h-[30p
15895
15896
  }
15896
15897
  ),
15897
15898
  /* @__PURE__ */ r(
15898
- Xt,
15899
+ Qt,
15899
15900
  {
15900
15901
  type: "number",
15901
15902
  min: 0,
@@ -15927,7 +15928,7 @@ const mg = "space-xsm gap-xsm hover:color-bg-default-hover cursor-pointer h-[30p
15927
15928
  }
15928
15929
  ),
15929
15930
  /* @__PURE__ */ r(
15930
- Xt,
15931
+ Qt,
15931
15932
  {
15932
15933
  type: "number",
15933
15934
  id: "spaceAfter",
@@ -16098,7 +16099,7 @@ const mg = "space-xsm gap-xsm hover:color-bg-default-hover cursor-pointer h-[30p
16098
16099
  "zoom-levels"
16099
16100
  ),
16100
16101
  /* @__PURE__ */ r(
16101
- Ye,
16102
+ Ge,
16102
16103
  {
16103
16104
  text: n ? "Hide tabs and outlines sidebar" : "Show tabs and outlines sidebar",
16104
16105
  position: "bottom",
@@ -16115,7 +16116,7 @@ const mg = "space-xsm gap-xsm hover:color-bg-default-hover cursor-pointer h-[30p
16115
16116
  )
16116
16117
  }
16117
16118
  ),
16118
- /* @__PURE__ */ r(Ye, { text: "Exit focus mode", children: /* @__PURE__ */ r(
16119
+ /* @__PURE__ */ r(Ge, { text: "Exit focus mode", children: /* @__PURE__ */ r(
16119
16120
  be,
16120
16121
  {
16121
16122
  icon: "Minimize",
@@ -18921,7 +18922,7 @@ const mg = "space-xsm gap-xsm hover:color-bg-default-hover cursor-pointer h-[30p
18921
18922
  type: "heading",
18922
18923
  attrs: { textAlign: "left", level: e },
18923
18924
  content: t
18924
- }), Je = (e) => ({
18925
+ }), et = (e) => ({
18925
18926
  type: "dBlock",
18926
18927
  content: [e]
18927
18928
  }), Le = (e) => Be(e, [{ type: "bold" }]), $e = (e) => Be(e, [{ type: "italic" }]), Hg = (e) => ({
@@ -18934,7 +18935,7 @@ const mg = "space-xsm gap-xsm hover:color-bg-default-hover cursor-pointer h-[30p
18934
18935
  }), zg = {
18935
18936
  type: "doc",
18936
18937
  content: [
18937
- Je(
18938
+ et(
18938
18939
  _n(1, [
18939
18940
  Be("Fanfic Planner ⋆⁺₊✧", [
18940
18941
  {
@@ -18944,7 +18945,7 @@ const mg = "space-xsm gap-xsm hover:color-bg-default-hover cursor-pointer h-[30p
18944
18945
  ])
18945
18946
  ])
18946
18947
  ),
18947
- Je({
18948
+ et({
18948
18949
  type: "callout",
18949
18950
  content: [
18950
18951
  Bt([
@@ -18956,9 +18957,9 @@ const mg = "space-xsm gap-xsm hover:color-bg-default-hover cursor-pointer h-[30p
18956
18957
  ])
18957
18958
  ]
18958
18959
  }),
18959
- Je(Bt([])),
18960
- Je(_n(1, [Be("☾ Ship Basis")])),
18961
- Je(
18960
+ et(Bt([])),
18961
+ et(_n(1, [Be("☾ Ship Basis")])),
18962
+ et(
18962
18963
  ts([
18963
18964
  [Le("Title"), Be(":")],
18964
18965
  [Le("Fandom:")],
@@ -18970,20 +18971,20 @@ const mg = "space-xsm gap-xsm hover:color-bg-default-hover cursor-pointer h-[30p
18970
18971
  [Le("Length:")]
18971
18972
  ])
18972
18973
  ),
18973
- Je(_n(3, [Be("Premise")])),
18974
- Je(
18974
+ et(_n(3, [Be("Premise")])),
18975
+ et(
18975
18976
  Bt([$e("[The idea that made you open this cute dDoc]")])
18976
18977
  ),
18977
- Je(_n(3, [Be("Summary")])),
18978
- Je(
18978
+ et(_n(3, [Be("Summary")])),
18979
+ et(
18979
18980
  Bt([$e("[A little spicy blurb to hook your readers in]")])
18980
18981
  )
18981
18982
  ]
18982
18983
  }, Kg = {
18983
18984
  type: "doc",
18984
18985
  content: [
18985
- Je(_n(1, [Be("★Plot & outline")])),
18986
- Je(
18986
+ et(_n(1, [Be("★Plot & outline")])),
18987
+ et(
18987
18988
  Bt([
18988
18989
  Le("Brain dump"),
18989
18990
  Be(" "),
@@ -18992,8 +18993,8 @@ const mg = "space-xsm gap-xsm hover:color-bg-default-hover cursor-pointer h-[30p
18992
18993
  )
18993
18994
  ])
18994
18995
  ),
18995
- Je(Bt([Le("The spine")])),
18996
- Je(
18996
+ et(Bt([Le("The spine")])),
18997
+ et(
18997
18998
  ts([
18998
18999
  [
18999
19000
  Le("Hook"),
@@ -19014,8 +19015,8 @@ const mg = "space-xsm gap-xsm hover:color-bg-default-hover cursor-pointer h-[30p
19014
19015
  ]
19015
19016
  ])
19016
19017
  ),
19017
- Je(Bt([Le("The skeleton")])),
19018
- Je(
19018
+ et(Bt([Le("The skeleton")])),
19019
+ et(
19019
19020
  ts([
19020
19021
  [
19021
19022
  Le("Beginning"),
@@ -19034,7 +19035,7 @@ const mg = "space-xsm gap-xsm hover:color-bg-default-hover cursor-pointer h-[30p
19034
19035
  ]
19035
19036
  ])
19036
19037
  ),
19037
- Je(
19038
+ et(
19038
19039
  Bt([
19039
19040
  Le("Scenes in order"),
19040
19041
  Be(" "),
@@ -19043,14 +19044,14 @@ const mg = "space-xsm gap-xsm hover:color-bg-default-hover cursor-pointer h-[30p
19043
19044
  )
19044
19045
  ])
19045
19046
  ),
19046
- Je(
19047
+ et(
19047
19048
  Bt([
19048
19049
  Le("Chapter breakdown"),
19049
19050
  Be(" "),
19050
19051
  $e("(if multichap)")
19051
19052
  ])
19052
19053
  ),
19053
- Je(
19054
+ et(
19054
19055
  ts([
19055
19056
  [Le("Chapter 1"), Be(": "), $e("[beat + hook]")],
19056
19057
  [Le("Chapter 2"), Be(": "), $e("[beat + hook]")]
@@ -19060,9 +19061,9 @@ const mg = "space-xsm gap-xsm hover:color-bg-default-hover cursor-pointer h-[30p
19060
19061
  }, jg = {
19061
19062
  type: "doc",
19062
19063
  content: [
19063
- Je(_n(1, [Be("𖠋 Characters")])),
19064
- Je(Bt([$e("[Copy this block for each character]")])),
19065
- Je(
19064
+ et(_n(1, [Be("𖠋 Characters")])),
19065
+ et(Bt([$e("[Copy this block for each character]")])),
19066
+ et(
19066
19067
  ts([
19067
19068
  [Le("name / role"), Be(":")],
19068
19069
  [
@@ -19108,15 +19109,15 @@ const mg = "space-xsm gap-xsm hover:color-bg-default-hover cursor-pointer h-[30p
19108
19109
  }, Vg = {
19109
19110
  type: "doc",
19110
19111
  content: [
19111
- Je(_n(1, [Be("꩜ World & Canon")])),
19112
- Je(
19112
+ et(_n(1, [Be("꩜ World & Canon")])),
19113
+ et(
19113
19114
  Bt([
19114
19115
  $e(
19115
19116
  "[for AUs, canon-divergence, and fix-its. Skip if canon-compliant]"
19116
19117
  )
19117
19118
  ])
19118
19119
  ),
19119
- Je(
19120
+ et(
19120
19121
  ts([
19121
19122
  [
19122
19123
  Le("Divergence"),
@@ -19236,7 +19237,7 @@ const mg = "space-xsm gap-xsm hover:color-bg-default-hover cursor-pointer h-[30p
19236
19237
  u
19237
19238
  )),
19238
19239
  /* @__PURE__ */ r(
19239
- Ct,
19240
+ vt,
19240
19241
  {
19241
19242
  align: "end",
19242
19243
  sideOffset: 10,
@@ -19321,9 +19322,9 @@ var Xg = class wc {
19321
19322
  }
19322
19323
  resolve(t) {
19323
19324
  const n = t.resolve(this.anchor), s = t.resolve(this.head);
19324
- return new mn(n, s);
19325
+ return new pn(n, s);
19325
19326
  }
19326
- }, mn = class Cn extends Zu {
19327
+ }, pn = class vn extends Zu {
19327
19328
  constructor(t, n, s, o = 1) {
19328
19329
  const { doc: i } = t, a = t === n, l = t.pos === i.content.size && n.pos === i.content.size, c = a && !l ? i.resolve(n.pos + (o > 0 ? 1 : -1)) : n, u = a && l ? i.resolve(t.pos - (o > 0 ? 1 : -1)) : t, d = Bo(u.min(c), u.max(c), s), h = c.pos >= t.pos ? d[0].$from : d[d.length - 1].$to, m = c.pos >= t.pos ? d[d.length - 1].$to : d[0].$from;
19329
19330
  super(h, m, d), this.depth = s;
@@ -19334,11 +19335,11 @@ var Xg = class wc {
19334
19335
  return this.ranges[this.ranges.length - 1].$to;
19335
19336
  }
19336
19337
  eq(t) {
19337
- return t instanceof Cn && t.$from.pos === this.$from.pos && t.$to.pos === this.$to.pos;
19338
+ return t instanceof vn && t.$from.pos === this.$from.pos && t.$to.pos === this.$to.pos;
19338
19339
  }
19339
19340
  map(t, n) {
19340
19341
  const s = t.resolve(n.map(this.anchor)), o = t.resolve(n.map(this.head));
19341
- return new Cn(s, o);
19342
+ return new vn(s, o);
19342
19343
  }
19343
19344
  toJSON() {
19344
19345
  return {
@@ -19357,22 +19358,22 @@ var Xg = class wc {
19357
19358
  const { doc: t } = this.$from;
19358
19359
  if (this.isForwards && this.ranges.length > 1) {
19359
19360
  const o = this.ranges.slice(0, -1), i = o[0].$from, a = o[o.length - 1].$to;
19360
- return new Cn(i, a, this.depth);
19361
+ return new vn(i, a, this.depth);
19361
19362
  }
19362
19363
  const n = this.ranges[0], s = t.resolve(Math.max(0, n.$from.pos - 1));
19363
- return new Cn(this.$anchor, s, this.depth);
19364
+ return new vn(this.$anchor, s, this.depth);
19364
19365
  }
19365
19366
  extendForwards() {
19366
19367
  const { doc: t } = this.$from;
19367
19368
  if (this.isBackwards && this.ranges.length > 1) {
19368
19369
  const o = this.ranges.slice(1), i = o[0].$from, a = o[o.length - 1].$to;
19369
- return new Cn(a, i, this.depth);
19370
+ return new vn(a, i, this.depth);
19370
19371
  }
19371
19372
  const n = this.ranges[this.ranges.length - 1], s = t.resolve(Math.min(t.content.size, n.$to.pos + 1));
19372
- return new Cn(this.$anchor, s, this.depth);
19373
+ return new vn(this.$anchor, s, this.depth);
19373
19374
  }
19374
19375
  static fromJSON(t, n) {
19375
- return new Cn(t.resolve(n.anchor), t.resolve(n.head));
19376
+ return new vn(t.resolve(n.anchor), t.resolve(n.head));
19376
19377
  }
19377
19378
  static create(t, n, s, o, i = 1) {
19378
19379
  return new this(t.resolve(n), t.resolve(s), o, i);
@@ -19381,9 +19382,9 @@ var Xg = class wc {
19381
19382
  return new Xg(this.anchor, this.head);
19382
19383
  }
19383
19384
  };
19384
- mn.prototype.visible = !1;
19385
+ pn.prototype.visible = !1;
19385
19386
  function co(e) {
19386
- return e instanceof mn;
19387
+ return e instanceof pn;
19387
19388
  }
19388
19389
  is.create({
19389
19390
  name: "nodeRange",
@@ -19399,7 +19400,7 @@ is.create({
19399
19400
  "Shift-ArrowUp": ({ editor: e }) => {
19400
19401
  const { depth: t } = this.options, { view: n, state: s } = e, { doc: o, selection: i, tr: a } = s, { anchor: l, head: c } = i;
19401
19402
  if (!co(i)) {
19402
- const d = mn.create(o, l, c, t, -1);
19403
+ const d = pn.create(o, l, c, t, -1);
19403
19404
  return a.setSelection(d), n.dispatch(a), !0;
19404
19405
  }
19405
19406
  const u = i.extendBackwards();
@@ -19409,7 +19410,7 @@ is.create({
19409
19410
  "Shift-ArrowDown": ({ editor: e }) => {
19410
19411
  const { depth: t } = this.options, { view: n, state: s } = e, { doc: o, selection: i, tr: a } = s, { anchor: l, head: c } = i;
19411
19412
  if (!co(i)) {
19412
- const d = mn.create(o, l, c, t);
19413
+ const d = pn.create(o, l, c, t);
19413
19414
  return a.setSelection(d), n.dispatch(a), !0;
19414
19415
  }
19415
19416
  const u = i.extendForwards();
@@ -19417,7 +19418,7 @@ is.create({
19417
19418
  },
19418
19419
  // add `NodeRangeSelection` to all nodes
19419
19420
  "Mod-a": ({ editor: e }) => {
19420
- const { depth: t } = this.options, { view: n, state: s } = e, { doc: o, tr: i } = s, a = mn.create(o, 0, o.content.size, t);
19421
+ const { depth: t } = this.options, { view: n, state: s } = e, { doc: o, tr: i } = s, a = pn.create(o, 0, o.content.size, t);
19421
19422
  return i.setSelection(a), n.dispatch(i), !0;
19422
19423
  }
19423
19424
  };
@@ -19445,7 +19446,7 @@ is.create({
19445
19446
  const { state: h } = n, { doc: m, selection: p, tr: f } = h, { $anchor: x, $head: g } = p;
19446
19447
  if (x.sameParent(g))
19447
19448
  return;
19448
- const y = mn.create(m, x.pos, g.pos, this.options.depth);
19449
+ const y = pn.create(m, x.pos, g.pos, this.options.depth);
19449
19450
  f.setSelection(y), n.dispatch(f);
19450
19451
  },
19451
19452
  { once: !0 }
@@ -19560,7 +19561,7 @@ function o2(e, t) {
19560
19561
  const { empty: s, $from: o, $to: i } = n.state.selection, a = s2(e, t), l = Bo(o, i, 0), c = l.some((g) => a.find((y) => y.$from === g.$from && y.$to === g.$to)), u = s || !c ? a : l;
19561
19562
  if (!u.length)
19562
19563
  return;
19563
- const { tr: d } = n.state, h = document.createElement("div"), m = u[0].$from.pos, p = u[u.length - 1].$to.pos, f = mn.create(n.state.doc, m, p), x = f.content();
19564
+ const { tr: d } = n.state, h = document.createElement("div"), m = u[0].$from.pos, p = u[u.length - 1].$to.pos, f = pn.create(n.state.doc, m, p), x = f.content();
19564
19565
  u.forEach((g) => {
19565
19566
  const y = n.nodeDOM(g.$from.pos), A = Zg(y);
19566
19567
  h.append(A);
@@ -19857,8 +19858,8 @@ const l2 = (e, t) => {
19857
19858
  copyNodeToClipboard: i,
19858
19859
  deleteNode: a
19859
19860
  };
19860
- }, Ts = Qe.memo(
19861
- wt(({ onClick: e, icon: t, text: n, variant: s = "ghost", className: o = "" }, i) => /* @__PURE__ */ r(Io, { asChild: !0, children: /* @__PURE__ */ v(
19861
+ }, Ts = Ze.memo(
19862
+ bt(({ onClick: e, icon: t, text: n, variant: s = "ghost", className: o = "" }, i) => /* @__PURE__ */ r(Io, { asChild: !0, children: /* @__PURE__ */ v(
19862
19863
  Ne,
19863
19864
  {
19864
19865
  ref: i,
@@ -19873,8 +19874,8 @@ const l2 = (e, t) => {
19873
19874
  ) }))
19874
19875
  );
19875
19876
  Ts.displayName = "ActionButton";
19876
- const Sc = Qe.memo(
19877
- wt(({ onClick: e, className: t, ...n }, s) => /* @__PURE__ */ r(
19877
+ const Sc = Ze.memo(
19878
+ bt(({ onClick: e, className: t, ...n }, s) => /* @__PURE__ */ r(
19878
19879
  be,
19879
19880
  {
19880
19881
  icon: "GripVertical",
@@ -19891,8 +19892,8 @@ const Sc = Qe.memo(
19891
19892
  ))
19892
19893
  );
19893
19894
  Sc.displayName = "GripButton";
19894
- const Nc = Qe.memo(
19895
- wt(({ onClick: e, className: t, ...n }, s) => /* @__PURE__ */ r(
19895
+ const Nc = Ze.memo(
19896
+ bt(({ onClick: e, className: t, ...n }, s) => /* @__PURE__ */ r(
19896
19897
  be,
19897
19898
  {
19898
19899
  icon: "Plus",
@@ -19906,8 +19907,8 @@ const Nc = Qe.memo(
19906
19907
  ))
19907
19908
  );
19908
19909
  Nc.displayName = "PlusButton";
19909
- const Tc = Qe.memo(
19910
- wt(({ isCollapsed: e, onToggle: t, className: n, ...s }, o) => /* @__PURE__ */ r(
19910
+ const Tc = Ze.memo(
19911
+ bt(({ isCollapsed: e, onToggle: t, className: n, ...s }, o) => /* @__PURE__ */ r(
19911
19912
  be,
19912
19913
  {
19913
19914
  variant: "ghost",
@@ -19922,8 +19923,8 @@ const Tc = Qe.memo(
19922
19923
  ))
19923
19924
  );
19924
19925
  Tc.displayName = "CollapseButton";
19925
- const Ec = Qe.memo(
19926
- wt(({ onClick: e, className: t, ...n }, s) => /* @__PURE__ */ r(
19926
+ const Ec = Ze.memo(
19927
+ bt(({ onClick: e, className: t, ...n }, s) => /* @__PURE__ */ r(
19927
19928
  be,
19928
19929
  {
19929
19930
  variant: "ghost",
@@ -19938,14 +19939,14 @@ const Ec = Qe.memo(
19938
19939
  ))
19939
19940
  );
19940
19941
  Ec.displayName = "CopyLinkButton";
19941
- const Ac = wt(
19942
+ const Ac = bt(
19942
19943
  // flex kills the inherited line-box height (24px) that otherwise makes
19943
19944
  // this wrapper taller than the 20px grip button and top-aligns it 2px
19944
19945
  // above its sibling buttons in the cluster row.
19945
19946
  (e, t) => /* @__PURE__ */ r("div", { ref: t, className: "flex items-center", children: e.children })
19946
19947
  );
19947
19948
  Ac.displayName = "MenuTrigger";
19948
- const c2 = Qe.memo(
19949
+ const c2 = Ze.memo(
19949
19950
  ({ isOpen: e, onOpenChange: t, trigger: n, actions: s }) => /* @__PURE__ */ r(Tm, { onMountAutoFocus: (o) => o.preventDefault(), trapped: !1, children: /* @__PURE__ */ v(ls, { open: e, onOpenChange: t, children: [
19950
19951
  /* @__PURE__ */ r(_s, { asChild: !0, children: /* @__PURE__ */ r(Ac, { children: n }) }),
19951
19952
  /* @__PURE__ */ r(
@@ -20014,13 +20015,13 @@ const c2 = Qe.memo(
20014
20015
  }
20015
20016
  };
20016
20017
  }
20017
- }, Oo = Qe.memo(
20018
+ }, Oo = Ze.memo(
20018
20019
  ({
20019
20020
  text: e,
20020
20021
  position: t = "bottom",
20021
20022
  children: n
20022
- }) => /* @__PURE__ */ r(Ye, { text: e, position: t, asTriggerChild: !0, children: n })
20023
- ), u2 = Qe.memo(
20023
+ }) => /* @__PURE__ */ r(Ge, { text: e, position: t, asTriggerChild: !0, children: n })
20024
+ ), u2 = Ze.memo(
20024
20025
  ({ children: e }) => /* @__PURE__ */ r(
20025
20026
  Oo,
20026
20027
  {
@@ -20032,7 +20033,7 @@ const c2 = Qe.memo(
20032
20033
  children: e
20033
20034
  }
20034
20035
  )
20035
- ), h2 = Qe.memo(
20036
+ ), h2 = Ze.memo(
20036
20037
  ({ children: e }) => /* @__PURE__ */ r(
20037
20038
  Oo,
20038
20039
  {
@@ -20044,7 +20045,7 @@ const c2 = Qe.memo(
20044
20045
  children: e
20045
20046
  }
20046
20047
  )
20047
- ), m2 = Qe.memo(
20048
+ ), m2 = Ze.memo(
20048
20049
  ({
20049
20050
  isCollapsed: e,
20050
20051
  children: t
@@ -20056,7 +20057,7 @@ const c2 = Qe.memo(
20056
20057
  children: t
20057
20058
  }
20058
20059
  )
20059
- ), p2 = Qe.memo(
20060
+ ), p2 = Ze.memo(
20060
20061
  ({ children: e }) => /* @__PURE__ */ r(Oo, { text: "Copy link to heading", position: "bottom", children: e })
20061
20062
  ), f2 = 24, Ua = (e, t) => {
20062
20063
  try {
@@ -20080,7 +20081,7 @@ const c2 = Qe.memo(
20080
20081
  return o ? { editor: e, node: o, pos: t } : null;
20081
20082
  }, y2 = (e, t, n, s) => {
20082
20083
  if (n.childCount > 0 || !s.dataTransfer) return !1;
20083
- const { view: o } = e, i = mn.create(
20084
+ const { view: o } = e, i = pn.create(
20084
20085
  o.state.doc,
20085
20086
  t,
20086
20087
  t + n.nodeSize
@@ -20105,7 +20106,7 @@ const c2 = Qe.memo(
20105
20106
  }) => {
20106
20107
  const [s, o] = Y(null), [i, a] = Y(!1), l = F(null), { scale: c } = hs(), u = F(c);
20107
20108
  u.current = c;
20108
- const d = xt("(max-width: 767px)"), h = M(
20109
+ const d = wt("(max-width: 767px)"), h = M(
20109
20110
  () => s ? g2(e, s.pos) : null,
20110
20111
  [e, s]
20111
20112
  ), m = l2(e, h), p = M(
@@ -20350,7 +20351,7 @@ const c2 = Qe.memo(
20350
20351
  ), g = M(() => {
20351
20352
  i((E) => (l(E ? 2 : x.length), !E));
20352
20353
  }, [x.length]), y = e && !e.isDestroyed ? e.view.dom.closest("[data-ddoc-editor-panel]") : null;
20353
- return !m || h || !y || !(e == null ? void 0 : e.view.dom.firstElementChild) ? null : Nn(
20354
+ return !m || h || !y || !(e == null ? void 0 : e.view.dom.firstElementChild) ? null : Tn(
20354
20355
  /* @__PURE__ */ r(
20355
20356
  "div",
20356
20357
  {
@@ -20499,7 +20500,7 @@ const c2 = Qe.memo(
20499
20500
  children: /* @__PURE__ */ v(Pt.div, { className: "p-2 border color-border-default w-80 max-w-full rounded-lg space-y-2 color-bg-default", children: [
20500
20501
  /* @__PURE__ */ v("div", { className: "flex items-center gap-2 pr-1 pl-2 border rounded-md", children: [
20501
20502
  /* @__PURE__ */ r(
20502
- Xt,
20503
+ Qt,
20503
20504
  {
20504
20505
  placeholder: "Search text...",
20505
20506
  value: s,
@@ -20511,7 +20512,7 @@ const c2 = Qe.memo(
20511
20512
  p !== void 0 && /* @__PURE__ */ r(nt, { children: p > 0 ? /* @__PURE__ */ r("span", { className: "color-text-secondary text-sm", children: `${typeof f == "number" ? f + 1 : "?"}/${p}` }) : s !== "" ? /* @__PURE__ */ r("span", { className: "color-text-secondary text-sm", children: "0/0" }) : null }),
20512
20513
  p !== void 0 && /* @__PURE__ */ v("div", { className: "flex items-center", children: [
20513
20514
  /* @__PURE__ */ v("div", { className: "flex items-center", children: [
20514
- /* @__PURE__ */ r(Ye, { text: "Previous", asTriggerChild: !0, children: /* @__PURE__ */ r(
20515
+ /* @__PURE__ */ r(Ge, { text: "Previous", asTriggerChild: !0, children: /* @__PURE__ */ r(
20515
20516
  be,
20516
20517
  {
20517
20518
  icon: "ArrowUp",
@@ -20522,7 +20523,7 @@ const c2 = Qe.memo(
20522
20523
  onClick: w
20523
20524
  }
20524
20525
  ) }),
20525
- /* @__PURE__ */ r(Ye, { text: "Next", asTriggerChild: !0, children: /* @__PURE__ */ r(
20526
+ /* @__PURE__ */ r(Ge, { text: "Next", asTriggerChild: !0, children: /* @__PURE__ */ r(
20526
20527
  be,
20527
20528
  {
20528
20529
  icon: "ArrowDown",
@@ -20534,7 +20535,7 @@ const c2 = Qe.memo(
20534
20535
  }
20535
20536
  ) })
20536
20537
  ] }),
20537
- !n && /* @__PURE__ */ r(Ye, { text: "Replace", children: /* @__PURE__ */ r(
20538
+ !n && /* @__PURE__ */ r(Ge, { text: "Replace", children: /* @__PURE__ */ r(
20538
20539
  be,
20539
20540
  {
20540
20541
  icon: "Replace",
@@ -20557,7 +20558,7 @@ const c2 = Qe.memo(
20557
20558
  layout: "size",
20558
20559
  children: [
20559
20560
  /* @__PURE__ */ r("div", { className: "flex items-center gap-2 px-2 border rounded-md", children: /* @__PURE__ */ r(
20560
- Xt,
20561
+ Qt,
20561
20562
  {
20562
20563
  placeholder: "Replace with...",
20563
20564
  value: o,
@@ -20628,7 +20629,7 @@ var N2 = {
20628
20629
  * This source code is licensed under the ISC license.
20629
20630
  * See the LICENSE file in the root directory of this source tree.
20630
20631
  */
20631
- const T2 = wt(
20632
+ const T2 = bt(
20632
20633
  ({
20633
20634
  color: e = "currentColor",
20634
20635
  size: t = 24,
@@ -20663,7 +20664,7 @@ const T2 = wt(
20663
20664
  * See the LICENSE file in the root directory of this source tree.
20664
20665
  */
20665
20666
  const E2 = (e, t) => {
20666
- const n = wt(
20667
+ const n = bt(
20667
20668
  ({ className: s, ...o }, i) => vr(T2, {
20668
20669
  ref: i,
20669
20670
  iconNode: t,
@@ -20813,7 +20814,7 @@ const A2 = [["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }]], R2 = E2("ChevronRi
20813
20814
  ),
20814
20815
  /* @__PURE__ */ v("div", { className: "flex items-center pl-1 shrink-0", children: [
20815
20816
  /* @__PURE__ */ r(Al, { className: "mr-1", direction: "vertical" }),
20816
- /* @__PURE__ */ r(Ye, { text: "Back to editor", asTriggerChild: !0, children: /* @__PURE__ */ r(
20817
+ /* @__PURE__ */ r(Ge, { text: "Back to editor", asTriggerChild: !0, children: /* @__PURE__ */ r(
20817
20818
  be,
20818
20819
  {
20819
20820
  variant: "ghost",
@@ -20956,7 +20957,7 @@ const A2 = [["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }]], R2 = E2("ChevronRi
20956
20957
  ydoc: o
20957
20958
  });
20958
20959
  }), mh(s.tabs[0].content, t);
20959
- const l = vt(o);
20960
+ const l = kt(o);
20960
20961
  return o.transact(() => {
20961
20962
  s.tabs.forEach((u, d) => {
20962
20963
  const h = a[d];
@@ -21040,7 +21041,7 @@ const A2 = [["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }]], R2 = E2("ChevronRi
21040
21041
  }, ja = (e) => {
21041
21042
  var n;
21042
21043
  const t = e && !e.isDestroyed ? (n = e.view) == null ? void 0 : n.dom : null;
21043
- return t ? kn({ targetElement: t, editorRoot: t }) : document.querySelector($2);
21044
+ return t ? Sn({ targetElement: t, editorRoot: t }) : document.querySelector($2);
21044
21045
  }, q2 = ({
21045
21046
  editor: e,
21046
21047
  activeTabId: t,
@@ -21331,7 +21332,7 @@ function oy({
21331
21332
  const H = Ga(me, P);
21332
21333
  x(H.top), y(H.left);
21333
21334
  }
21334
- const W = kn({ targetElement: Q });
21335
+ const W = Sn({ targetElement: Q });
21335
21336
  if (T && $a(u.current, W, l), !W) {
21336
21337
  E(0), R(i - 1);
21337
21338
  return;
@@ -21350,7 +21351,7 @@ function oy({
21350
21351
  var le;
21351
21352
  if (!i || !e || e.isDestroyed) return;
21352
21353
  w();
21353
- const P = e.view.dom, Q = kn({ targetElement: P });
21354
+ const P = e.view.dom, Q = Sn({ targetElement: P });
21354
21355
  let ee = 0;
21355
21356
  const me = () => {
21356
21357
  ee || (ee = requestAnimationFrame(() => {
@@ -21369,7 +21370,7 @@ function oy({
21369
21370
  const P = e.view.dom;
21370
21371
  $a(
21371
21372
  u.current,
21372
- kn({ targetElement: P }),
21373
+ Sn({ targetElement: P }),
21373
21374
  l
21374
21375
  );
21375
21376
  }, [S, e, l, A, k, d, m, f, a]), !e || !i) return null;
@@ -21427,7 +21428,7 @@ function oy({
21427
21428
  ));
21428
21429
  return /* @__PURE__ */ v(nt, { children: [
21429
21430
  /* @__PURE__ */ r("div", { ref: c, className: "ddoc-page-sheets", "aria-hidden": "true", children: B }),
21430
- m && Nn(
21431
+ m && Tn(
21431
21432
  /* @__PURE__ */ r("div", { ref: u, className: "ddoc-page-masks", "aria-hidden": "true", children: $ }),
21432
21433
  m
21433
21434
  )
@@ -21473,14 +21474,14 @@ const iy = () => {
21473
21474
  },
21474
21475
  liveEditor: e
21475
21476
  });
21476
- return n ? s ? null : Nn(o, n) : /* @__PURE__ */ r(
21477
+ return n ? s ? null : Tn(o, n) : /* @__PURE__ */ r(
21477
21478
  "div",
21478
21479
  {
21479
21480
  className: ye("ddoc-navbar-row", s && "ddoc-navbar-row--hidden"),
21480
21481
  children: o
21481
21482
  }
21482
21483
  );
21483
- }, pr = (e) => !!(e != null && e.enabled && (e.connection.livePresence ?? !0)), ax = wt(
21484
+ }, pr = (e) => !!(e != null && e.enabled && (e.connection.livePresence ?? !0)), ax = bt(
21484
21485
  ({
21485
21486
  isPreviewMode: e = !1,
21486
21487
  viewerMode: t,
@@ -21539,61 +21540,61 @@ const iy = () => {
21539
21540
  onFocusModeChange: Se,
21540
21541
  onMarkdownExport: J,
21541
21542
  onMarkdownImport: ue,
21542
- onPdfExport: Re,
21543
+ onPdfExport: De,
21543
21544
  onHtmlExport: Ee,
21544
21545
  onTxtExport: He,
21545
21546
  onOdtExport: ze,
21546
- onDocxImport: Ge,
21547
- editorCanvasClassNames: kt,
21548
- sharedSlidesLink: Ke,
21549
- documentName: ht,
21550
- onInvalidContentError: at,
21547
+ onDocxImport: Ye,
21548
+ editorCanvasClassNames: xt,
21549
+ sharedSlidesLink: ht,
21550
+ documentName: Ke,
21551
+ onInvalidContentError: lt,
21551
21552
  ignoreCorruptedData: je,
21552
21553
  commentDrawerOpen: Ht,
21553
21554
  setCommentDrawerOpen: Xe,
21554
- onCommentDrawerOpenChange: et,
21555
+ onCommentDrawerOpenChange: Qe,
21555
21556
  initialComments: St = [],
21556
- initialCommentAnchors: ln,
21557
- onNewComment: en,
21558
- onEditComment: tn,
21559
- onEditReply: Tn,
21557
+ initialCommentAnchors: an,
21558
+ onNewComment: ln,
21559
+ onEditComment: zt,
21560
+ onEditReply: cn,
21560
21561
  onCommentReply: ms,
21561
- setInitialComments: fn,
21562
+ setInitialComments: gn,
21562
21563
  onSlidesShare: ps,
21563
21564
  onResolveComment: Kn,
21564
21565
  onUnresolveComment: En,
21565
- onDeleteComment: gn,
21566
+ onDeleteComment: yn,
21566
21567
  onDeleteReply: ie,
21567
- theme: yn,
21568
+ theme: xn,
21568
21569
  showTOC: At,
21569
- setShowTOC: nn,
21570
+ setShowTOC: tn,
21570
21571
  onShowTOCChange: Pe,
21571
21572
  isConnected: Me,
21572
21573
  connectViaWallet: st,
21573
- isLoading: Ie,
21574
- connectViaUsername: zt,
21574
+ isLoading: Re,
21575
+ connectViaUsername: Kt,
21575
21576
  isDDocOwner: rt,
21576
21577
  isCollabDocumentPublished: ct = !0,
21577
21578
  disableInlineComment: mt,
21578
21579
  renderThemeToggle: jn,
21579
21580
  renderToolbarLeading: An,
21580
- metadataProxyUrl: Kt,
21581
- extensions: sn,
21582
- onCopyHeadingLink: jt,
21581
+ metadataProxyUrl: jt,
21582
+ extensions: nn,
21583
+ onCopyHeadingLink: Vt,
21583
21584
  tabConfig: Nt,
21584
21585
  imageFetchFn: pt,
21585
- ipfsImageFetchFn: Vt,
21586
+ ipfsImageFetchFn: Wt,
21586
21587
  fetchV1ImageFn: Rt,
21587
- activeModel: xn,
21588
+ activeModel: wn,
21588
21589
  maxTokens: Vn,
21589
21590
  isAIAgentEnabled: Wn,
21590
21591
  // Document styling object
21591
21592
  documentStyling: xe,
21592
- fonts: Wt,
21593
+ fonts: $t,
21593
21594
  ...$n
21594
21595
  }, qn) => {
21595
21596
  var Ai, Ri, Ii;
21596
- const [fs, cn] = Mn(
21597
+ const [fs, dn] = Mn(
21597
21598
  W,
21598
21599
  "1",
21599
21600
  le,
@@ -21603,22 +21604,22 @@ const iy = () => {
21603
21604
  !0,
21604
21605
  V,
21605
21606
  K
21606
- ), [dn, we] = Mn(
21607
+ ), [un, we] = Mn(
21607
21608
  At,
21608
21609
  !1,
21609
21610
  Pe,
21610
- nn
21611
+ tn
21611
21612
  ), [pe, Te] = Mn(
21612
21613
  Ht,
21613
21614
  !1,
21614
- et,
21615
+ Qe,
21615
21616
  Xe
21616
21617
  ), [ge, Fe] = Mn(
21617
21618
  O,
21618
21619
  !1,
21619
21620
  U,
21620
21621
  H
21621
- ), [De, Ae] = Mn(
21622
+ ), [Ie, Ae] = Mn(
21622
21623
  ce,
21623
21624
  !1,
21624
21625
  L,
@@ -21627,44 +21628,44 @@ const iy = () => {
21627
21628
  () => zl(A, E),
21628
21629
  [A, E]
21629
21630
  ), Oe = ve(
21630
- () => Kl(pt, Vt),
21631
- [pt, Vt]
21631
+ () => Kl(pt, Wt),
21632
+ [pt, Wt]
21632
21633
  ), { isFocusMode: Ce, toggleFocusMode: Tt } = Og({
21633
21634
  isFocusMode: re,
21634
21635
  onFocusModeChange: Se,
21635
21636
  onFocusMode: (Z) => {
21636
21637
  pe && (Te == null || Te(!1)), fe == null || fe(Z);
21637
21638
  }
21638
- }), [It, Dt] = Y(!1), [un, Et] = Y(!1), $t = F(null), Yn = F({ isPagesActive: !1 }), wn = (() => {
21639
+ }), [It, Dt] = Y(!1), [hn, Et] = Y(!1), qt = F(null), Yn = F({ isPagesActive: !1 }), bn = (() => {
21639
21640
  if (!xe)
21640
21641
  return { canvas: void 0, background: void 0 };
21641
- const Z = {}, ke = {}, Ve = yn ?? "light";
21642
+ const Z = {}, ke = {}, Ve = xn ?? "light";
21642
21643
  if (xe.canvasBackground) {
21643
- const Ze = As(
21644
+ const Je = As(
21644
21645
  xe.canvasBackground,
21645
21646
  Ve
21646
21647
  );
21647
- Z.backgroundColor = Ze;
21648
+ Z.backgroundColor = Je;
21648
21649
  }
21649
21650
  if (xe.textColor) {
21650
- const Ze = _r(
21651
+ const Je = _r(
21651
21652
  xe.textColor,
21652
21653
  Ve
21653
21654
  );
21654
- Ze && (Z.color = Ze);
21655
+ Je && (Z.color = Je);
21655
21656
  }
21656
21657
  if (xe.fontFamily && (Z.fontFamily = xe.fontFamily), xe.background) {
21657
- const Ze = As(
21658
+ const Je = As(
21658
21659
  xe.background,
21659
21660
  Ve
21660
21661
  );
21661
- ke.background = Ze;
21662
+ ke.background = Je;
21662
21663
  }
21663
21664
  return {
21664
21665
  canvas: Object.keys(Z).length > 0 ? Z : void 0,
21665
21666
  background: Object.keys(ke).length > 0 ? ke : void 0
21666
21667
  };
21667
- })(), Rn = () => wn.canvas, Ws = () => wn.background, Oc = F(null), ti = F(null), ni = F(null), Lo = F(null), [si, Lc] = Y(
21668
+ })(), Rn = () => bn.canvas, Ws = () => bn.background, Oc = F(null), ti = F(null), ni = F(null), Lo = F(null), [si, Lc] = Y(
21668
21669
  null
21669
21670
  ), [_c, Pc] = Y(null), _o = F(null), Po = F(null);
21670
21671
  Po.current || (Po.current = ry());
@@ -21672,7 +21673,7 @@ const iy = () => {
21672
21673
  yt(() => {
21673
21674
  Uc(iy());
21674
21675
  }, []);
21675
- const { isBelow1280px: $s, isNativeMobile: Xn } = Qt(In), [ri, Uo] = Y(!1), ii = F(null), Hc = (_ == null ? void 0 : _.slice(0, 4)) || [], ai = _ ? Math.max(0, _.length - 4) : 0;
21676
+ const { isBelow1280px: $s, isNativeMobile: Xn } = Zt(In), [ri, Uo] = Y(!1), ii = F(null), Hc = (_ == null ? void 0 : _.slice(0, 4)) || [], ai = _ ? Math.max(0, _.length - 4) : 0;
21676
21677
  Hs(ii, () => {
21677
21678
  Uo(!1);
21678
21679
  }), j(() => {
@@ -21683,7 +21684,7 @@ const iy = () => {
21683
21684
  cachedEditorEntries: qs,
21684
21685
  ref: Qn,
21685
21686
  isContentLoading: Gs,
21686
- ydoc: hn,
21687
+ ydoc: mn,
21687
21688
  awareness: Ys,
21688
21689
  refreshYjsIndexedDbProvider: jc,
21689
21690
  activeCommentId: Xs,
@@ -21695,7 +21696,7 @@ const iy = () => {
21695
21696
  setTocItems: li,
21696
21697
  terminateSession: Gc,
21697
21698
  updateTitle: Yc,
21698
- tabs: bn,
21699
+ tabs: Cn,
21699
21700
  setTabs: ci,
21700
21701
  activeTabId: Mt,
21701
21702
  setActiveTabId: Xc,
@@ -21741,34 +21742,34 @@ const iy = () => {
21741
21742
  setIsCommentSectionOpen: te,
21742
21743
  setInlineCommentData: P,
21743
21744
  inlineCommentData: Q,
21744
- initialCommentAnchors: ln,
21745
- theme: yn,
21745
+ initialCommentAnchors: an,
21746
+ theme: xn,
21746
21747
  isNavbarVisible: ft,
21747
21748
  setIsNavbarVisible: Gn,
21748
- onDocxImport: Ge,
21749
- onInvalidContentError: at,
21749
+ onDocxImport: Ye,
21750
+ onInvalidContentError: lt,
21750
21751
  ignoreCorruptedData: je,
21751
21752
  isPresentationMode: ge,
21752
- metadataProxyUrl: Kt,
21753
- extensions: sn,
21754
- onCopyHeadingLink: jt,
21753
+ metadataProxyUrl: jt,
21754
+ extensions: nn,
21755
+ onCopyHeadingLink: Vt,
21755
21756
  disableInlineComment: mt,
21756
21757
  isFocusMode: Ce,
21757
21758
  isConnected: Me,
21758
- activeModel: xn,
21759
+ activeModel: wn,
21759
21760
  maxTokens: Vn,
21760
21761
  isAIAgentEnabled: Wn,
21761
21762
  isDDocOwner: rt,
21762
21763
  tabConfig: Nt,
21763
- onNewComment: en,
21764
- fonts: Wt,
21764
+ onNewComment: ln,
21765
+ fonts: $t,
21765
21766
  ...$n
21766
21767
  }), ed = ve(
21767
21768
  () => {
21768
21769
  var Z;
21769
- return ((Z = bn.find((ke) => ke.id === (Mt || tt))) == null ? void 0 : Z.name) || vo;
21770
+ return ((Z = Cn.find((ke) => ke.id === (Mt || tt))) == null ? void 0 : Z.name) || vo;
21770
21771
  },
21771
- [Mt, bn]
21772
+ [Mt, Cn]
21772
21773
  ), td = M(
21773
21774
  (Z) => {
21774
21775
  !de || de.isDestroyed || !Mt || P2({
@@ -21776,10 +21777,10 @@ const iy = () => {
21776
21777
  editor: de,
21777
21778
  flushPendingUpdate: yi,
21778
21779
  template: Z,
21779
- ydoc: hn
21780
+ ydoc: mn
21780
21781
  });
21781
21782
  },
21782
- [Mt, de, yi, hn]
21783
+ [Mt, de, yi, mn]
21783
21784
  ), { switchTab: Ko } = q2({
21784
21785
  editor: de,
21785
21786
  activeTabId: Mt,
@@ -21788,13 +21789,13 @@ const iy = () => {
21788
21789
  isContentLoading: Gs,
21789
21790
  isNativeMobile: Xn,
21790
21791
  disabled: !!((Ai = $n.versionHistoryState) != null && Ai.enabled) || !!ge
21791
- }), Qs = xt(
21792
+ }), Qs = wt(
21792
21793
  "(min-width: 960px)",
21793
21794
  In
21794
- ), gs = pr(s), Ue = !!De && !e && Qs && !gs;
21795
+ ), gs = pr(s), Ue = !!Ie && !e && Qs && !gs;
21795
21796
  j(() => {
21796
- (!Qs || gs) && De && (Ae == null || Ae(!1));
21797
- }, [Qs, gs, De, Ae]);
21797
+ (!Qs || gs) && Ie && (Ae == null || Ae(!1));
21798
+ }, [Qs, gs, Ie, Ae]);
21798
21799
  const nd = ve(
21799
21800
  () => ({ ...gi, isSplitView: Ue }),
21800
21801
  [gi, Ue]
@@ -21832,14 +21833,14 @@ const iy = () => {
21832
21833
  qn,
21833
21834
  () => ({
21834
21835
  getEditor: () => de,
21835
- getYdoc: () => hn,
21836
+ getYdoc: () => mn,
21836
21837
  createTab: zo,
21837
21838
  refreshYjsIndexedDbProvider: jc,
21838
21839
  mergeYjsContents: (Z) => {
21839
21840
  const ke = $h(Z);
21840
21841
  return qe.applyUpdate(
21841
- hn,
21842
- lt(ke),
21842
+ mn,
21843
+ at(ke),
21843
21844
  "self"
21844
21845
  ), ke;
21845
21846
  },
@@ -21847,8 +21848,8 @@ const iy = () => {
21847
21848
  if (de) {
21848
21849
  const ke = await de.commands.exportMarkdownFile();
21849
21850
  if (ke) {
21850
- const Ve = ke, Ze = document.createElement("a");
21851
- Ze.href = Ve, Ze.download = Z, document.body.appendChild(Ze), Ze.click(), document.body.removeChild(Ze), URL.revokeObjectURL(Ve);
21851
+ const Ve = ke, Je = document.createElement("a");
21852
+ Je.href = Ve, Je.download = Z, document.body.appendChild(Je), Je.click(), document.body.removeChild(Je), URL.revokeObjectURL(Ve);
21852
21853
  }
21853
21854
  }
21854
21855
  },
@@ -21857,16 +21858,16 @@ const iy = () => {
21857
21858
  console.debug("collab: cannot find editor or awareness");
21858
21859
  return;
21859
21860
  }
21860
- const ke = Ys.getLocalState(), Ve = ke == null ? void 0 : ke.user, Ze = {
21861
+ const ke = Ys.getLocalState(), Ve = ke == null ? void 0 : ke.user, Je = {
21861
21862
  name: Z,
21862
21863
  color: Ve == null ? void 0 : Ve.color,
21863
21864
  isEns: Ve == null ? void 0 : Ve.isEns
21864
21865
  };
21865
- Ys.setLocalStateField("user", Ze), de.setEditable(!0);
21866
+ Ys.setLocalStateField("user", Je), de.setEditable(!0);
21866
21867
  },
21867
21868
  exportCurrentTabOrOpenExportModal: (Z = "pdf", ke) => {
21868
21869
  var Ve;
21869
- (Ve = $t.current) == null || Ve.call($t, Z, ke);
21870
+ (Ve = qt.current) == null || Ve.call(qt, Z, ke);
21870
21871
  },
21871
21872
  printCurrentTab: async () => {
21872
21873
  if (!de) return;
@@ -21897,12 +21898,12 @@ const iy = () => {
21897
21898
  return (B == null ? void 0 : B.find(
21898
21899
  (Nd) => Nd.name.toLowerCase() === so.toLowerCase()
21899
21900
  )) || { name: so, color: Z.color };
21900
- }), Ze = [...ke];
21901
+ }), Je = [...ke];
21901
21902
  return Ve.forEach((no) => {
21902
- Ze.some(
21903
+ Je.some(
21903
21904
  (so) => so.name.toLowerCase() === no.name.toLowerCase()
21904
- ) || Ze.push(no);
21905
- }), Ze.slice(0, 6);
21905
+ ) || Je.push(no);
21906
+ }), Je.slice(0, 6);
21906
21907
  });
21907
21908
  }, bi = (Z) => {
21908
21909
  X == null || X(
@@ -21910,8 +21911,8 @@ const iy = () => {
21910
21911
  );
21911
21912
  }, dd = () => {
21912
21913
  Fe == null || Fe(!1);
21913
- const Z = new URL(window.location.href), ke = Z.hash, [Ve, Ze] = ke.split("&");
21914
- Ze && Ze.startsWith("slides=") && (Z.hash = Ve, window.history.replaceState({}, "", Z.toString()));
21914
+ const Z = new URL(window.location.href), ke = Z.hash, [Ve, Je] = ke.split("&");
21915
+ Je && Je.startsWith("slides=") && (Z.hash = Ve, window.history.replaceState({}, "", Z.toString()));
21915
21916
  }, ud = () => {
21916
21917
  Fe == null || Fe(!0), pe && (Te == null || Te(!1));
21917
21918
  };
@@ -21919,11 +21920,11 @@ const iy = () => {
21919
21920
  if (de && Xn) {
21920
21921
  const { selection: Z } = de.state, ke = Ya(Z), Ve = () => {
21921
21922
  Dt(!0);
21922
- }, Ze = () => {
21923
+ }, Je = () => {
21923
21924
  Dt(!1);
21924
21925
  };
21925
- return !ke && de.on("focus", Ve), ke && de.on("blur", Ze), () => {
21926
- de.off("focus", Ve), de.off("blur", Ze);
21926
+ return !ke && de.on("focus", Ve), ke && de.on("blur", Je), () => {
21927
+ de.off("focus", Ve), de.off("blur", Je);
21927
21928
  };
21928
21929
  }
21929
21930
  }, [Xn, de]), j(() => {
@@ -21957,7 +21958,7 @@ const iy = () => {
21957
21958
  }, [de, Qn, Xn]), j(() => {
21958
21959
  !Ce || !de || de.isDestroyed || de.commands.focus();
21959
21960
  }, [Ce, de]);
21960
- const on = xt(
21961
+ const sn = wt(
21961
21962
  "(max-width: 850px)",
21962
21963
  In
21963
21964
  ), Ci = ve(() => (St || []).reduce(
@@ -21967,32 +21968,32 @@ const iy = () => {
21967
21968
  return Z[Ve] = (Z[Ve] || 0) + 1, Z;
21968
21969
  },
21969
21970
  {}
21970
- ), [St]), hd = N0(fi), Vo = !!pe || !!mt, vi = hd && !Vo, Zs = (xe == null ? void 0 : xe.orientation) === "landscape", md = xt(
21971
+ ), [St]), hd = N0(fi), Vo = !!pe || !!mt, vi = hd && !Vo, Zs = (xe == null ? void 0 : xe.orientation) === "landscape", md = wt(
21971
21972
  "(min-width: 1024px)",
21972
21973
  In
21973
- ), rn = xe == null ? void 0 : xe.pageSetup, qt = yh({
21974
- pageSetup: rn,
21974
+ ), on = xe == null ? void 0 : xe.pageSetup, Gt = yh({
21975
+ pageSetup: on,
21975
21976
  isWideEnough: md,
21976
21977
  isSplitViewActive: Ue,
21977
21978
  isVersionHistory: !!((Ri = $n.versionHistoryState) != null && Ri.enabled)
21978
21979
  });
21979
21980
  Yn.current = {
21980
- pageSetup: rn,
21981
+ pageSetup: on,
21981
21982
  orientation: xe == null ? void 0 : xe.orientation,
21982
- isPagesActive: qt,
21983
+ isPagesActive: Gt,
21983
21984
  ipfsImageFetchFn: Oe,
21984
21985
  fetchV1ImageFn: Rt
21985
21986
  };
21986
- const Js = qt && rn ? xh(rn, xe == null ? void 0 : xe.orientation) : Zs ? 1190 : 850, Zn = bh(fs), ys = Qs && !Ue, Wo = ys && Zn === "fit", xs = (
21987
+ const Js = Gt && on ? xh(on, xe == null ? void 0 : xe.orientation) : Zs ? 1190 : 850, Zn = bh(fs), ys = Qs && !Ue, Wo = ys && Zn === "fit", xs = (
21987
21988
  // Hidden in Split View — the right pane has its own tabs panel (the
21988
21989
  // List button in the split header), so the editor's native left rail
21989
21990
  // would just duplicate it.
21990
- !Ue && (bn.length > 0 || Ho.length > 0 && !((Ii = $n.versionHistoryState) != null && Ii.enabled)) && (!Ce || dn)
21991
+ !Ue && (Cn.length > 0 || Ho.length > 0 && !((Ii = $n.versionHistoryState) != null && Ii.enabled)) && (!Ce || un)
21991
21992
  ), pd = xs ? 148 : 0, ki = xs && !$s, fd = vh({
21992
21993
  hasLeftRail: ki,
21993
21994
  isCommentColumnVisible: vi,
21994
21995
  isLandscape: Zs,
21995
- isPagesMode: qt
21996
+ isPagesMode: Gt
21996
21997
  }), { shouldHideRight: Si, shouldScroll: gd, fitScale: $o } = Y2({
21997
21998
  canvasRef: Lo,
21998
21999
  rootRef: ni,
@@ -22007,10 +22008,10 @@ const iy = () => {
22007
22008
  enabled: ys && !ge && Nh(W, le, oe),
22008
22009
  onStep: (Z) => {
22009
22010
  const ke = Th(Zn, Z, $o);
22010
- ke !== Zn && cn(ke);
22011
+ ke !== Zn && dn(ke);
22011
22012
  }
22012
22013
  });
22013
- const Ni = Js * Dn, qo = rn == null ? void 0 : rn.mode, Jn = rn == null ? void 0 : rn.paper, Go = xe == null ? void 0 : xe.orientation, yd = ve(
22014
+ const Ni = Js * Dn, qo = on == null ? void 0 : on.mode, Jn = on == null ? void 0 : on.paper, Go = xe == null ? void 0 : xe.orientation, yd = ve(
22014
22015
  () => qo && Jn ? { mode: qo, paper: Jn } : void 0,
22015
22016
  [qo, Jn]
22016
22017
  ), eo = ve(
@@ -22021,13 +22022,13 @@ const iy = () => {
22021
22022
  pageSetup: yd,
22022
22023
  orientation: Go,
22023
22024
  zoom: Dn,
22024
- isPagesMode: qt,
22025
+ isPagesMode: Gt,
22025
22026
  onPagesError: T,
22026
22027
  printInputs: () => Yn.current
22027
22028
  });
22028
22029
  const Yo = (() => {
22029
22030
  const Z = Rn();
22030
- return qt && Z ? { ...Z, backgroundColor: void 0 } : Z;
22031
+ return Gt && Z ? { ...Z, backgroundColor: void 0 } : Z;
22031
22032
  })(), Ti = Ue ? ti : Lo;
22032
22033
  Q2({
22033
22034
  wrapperRef: _o,
@@ -22081,18 +22082,18 @@ const iy = () => {
22081
22082
  ipfsImageUploadFn: _e,
22082
22083
  onMarkdownExport: J,
22083
22084
  onMarkdownImport: ue,
22084
- onPdfExport: Re,
22085
+ onPdfExport: De,
22085
22086
  onHtmlExport: Ee,
22086
22087
  onTxtExport: He,
22087
22088
  onOdtExport: ze,
22088
- onDocxImport: Ge,
22089
+ onDocxImport: Ye,
22089
22090
  ipfsImageFetchFn: Oe,
22090
22091
  fetchV1ImageFn: Rt,
22091
22092
  isConnected: Me,
22092
- tabs: bn,
22093
- ydoc: hn,
22093
+ tabs: Cn,
22094
+ ydoc: mn,
22094
22095
  toggleFocusMode: Tt,
22095
- isSplitView: De,
22096
+ isSplitView: Ie,
22096
22097
  onToggleSplitView: (
22097
22098
  // Hidden during collaboration (Split View is solo-only in v1)
22098
22099
  // and when the host fixed `isSplitView` with no callback: the
@@ -22100,9 +22101,9 @@ const iy = () => {
22100
22101
  !gs && (ce === void 0 || L || q) ? () => Ae((Z) => !Z) : void 0
22101
22102
  ),
22102
22103
  onRegisterExportTrigger: (Z) => {
22103
- $t.current = Z;
22104
+ qt.current = Z;
22104
22105
  },
22105
- fonts: Wt,
22106
+ fonts: $t,
22106
22107
  renderToolbarLeading: An
22107
22108
  }
22108
22109
  ) })
@@ -22133,7 +22134,7 @@ const iy = () => {
22133
22134
  ipfsImageUploadFn: _e,
22134
22135
  ipfsImageFetchFn: Oe,
22135
22136
  fetchV1ImageFn: Rt,
22136
- fonts: Wt
22137
+ fonts: $t
22137
22138
  }
22138
22139
  )
22139
22140
  }
@@ -22144,21 +22145,21 @@ const iy = () => {
22144
22145
  Bg,
22145
22146
  {
22146
22147
  editor: de,
22147
- ydoc: hn,
22148
- tabs: bn,
22148
+ ydoc: mn,
22149
+ tabs: Cn,
22149
22150
  onRegisterExportTrigger: (Z) => {
22150
- $t.current = Z;
22151
+ qt.current = Z;
22151
22152
  },
22152
22153
  onError: C,
22153
22154
  ipfsImageUploadFn: _e,
22154
22155
  onMarkdownExport: J,
22155
22156
  onMarkdownImport: ue,
22156
- onPdfExport: Re,
22157
+ onPdfExport: De,
22157
22158
  onHtmlExport: Ee,
22158
22159
  onTxtExport: He,
22159
22160
  onOdtExport: ze,
22160
22161
  ipfsImageFetchFn: Oe,
22161
- onDocxImport: Ge,
22162
+ onDocxImport: Ye,
22162
22163
  fetchV1ImageFn: Rt,
22163
22164
  isConnected: Me
22164
22165
  }
@@ -22169,13 +22170,13 @@ const iy = () => {
22169
22170
  {
22170
22171
  editor: de,
22171
22172
  onClose: dd,
22172
- isFullscreen: un,
22173
+ isFullscreen: hn,
22173
22174
  setIsFullscreen: Et,
22174
22175
  onError: C,
22175
22176
  setCommentDrawerOpen: Te,
22176
- sharedSlidesLink: Ke,
22177
+ sharedSlidesLink: ht,
22177
22178
  isPreviewMode: e,
22178
- documentName: ht,
22179
+ documentName: Ke,
22179
22180
  onSlidesShare: ps,
22180
22181
  slides: $c,
22181
22182
  setSlides: qc,
@@ -22184,7 +22185,7 @@ const iy = () => {
22184
22185
  ipfsImageFetchFn: Oe,
22185
22186
  documentStyling: xe,
22186
22187
  fetchV1ImageFn: Rt,
22187
- theme: yn ?? "light"
22188
+ theme: xn ?? "light"
22188
22189
  }
22189
22190
  ) }),
22190
22191
  /* @__PURE__ */ v(
@@ -22206,7 +22207,7 @@ const iy = () => {
22206
22207
  className: ye(
22207
22208
  "editor-left-rail",
22208
22209
  xs && "editor-left-rail-has-outline",
22209
- !on && "max-w-[263px] w-full sticky top-0 self-start z-[2]",
22210
+ !sn && "max-w-[263px] w-full sticky top-0 self-start z-[2]",
22210
22211
  // The top gap is padding, not margin: a sticky rail with a
22211
22212
  // margin rests below top-0 and jumps up when the page scrolls.
22212
22213
  !e && !Ce && ft && "-mt-[1.5rem] ddoc-md:mt-0 ddoc-md:pt-[0.8rem]",
@@ -22216,7 +22217,7 @@ const iy = () => {
22216
22217
  "-mt-[1.5rem] ddoc-md:mt-0 ddoc-md:pt-[0.7rem]": !ft && !e
22217
22218
  },
22218
22219
  Ce && "pt-[48px]",
22219
- Ce && !dn && Si && "hidden"
22220
+ Ce && !un && Si && "hidden"
22220
22221
  ),
22221
22222
  children: de && xs && /* @__PURE__ */ r(
22222
22223
  Dr,
@@ -22225,11 +22226,11 @@ const iy = () => {
22225
22226
  hasToC: !0,
22226
22227
  items: Ho,
22227
22228
  setItems: li,
22228
- showTOC: dn,
22229
+ showTOC: un,
22229
22230
  setShowTOC: we,
22230
22231
  isPreviewMode: e || !ft,
22231
22232
  orientation: xe == null ? void 0 : xe.orientation,
22232
- tabs: bn,
22233
+ tabs: Cn,
22233
22234
  setTabs: ci,
22234
22235
  activeTabId: Mt,
22235
22236
  setActiveTabId: Ko,
@@ -22239,7 +22240,7 @@ const iy = () => {
22239
22240
  duplicateTab: hi,
22240
22241
  orderTab: mi,
22241
22242
  deleteTab: pi,
22242
- ydoc: hn,
22243
+ ydoc: mn,
22243
22244
  tabCommentCounts: Ci,
22244
22245
  tabConfig: Nt,
22245
22246
  isConnected: Me,
@@ -22262,7 +22263,7 @@ const iy = () => {
22262
22263
  "flex min-h-full items-start",
22263
22264
  // Split View: wrap to the right pane's width (no min-w-max),
22264
22265
  // so there's no horizontal scroll.
22265
- !on && !Ue && "min-w-max"
22266
+ !sn && !Ue && "min-w-max"
22266
22267
  ),
22267
22268
  children: /* @__PURE__ */ r(
22268
22269
  "div",
@@ -22271,7 +22272,7 @@ const iy = () => {
22271
22272
  "editor-main-lane flex-grow min-w-0 flex overflow-visible items-stretch",
22272
22273
  !Ue && "mb-12",
22273
22274
  gd ? "justify-start" : "justify-center",
22274
- on && "w-full",
22275
+ sn && "w-full",
22275
22276
  !Ue && !e && !Ce && (ft ? "ddoc-md:mt-[0.8rem]" : null),
22276
22277
  !Ue && e && "ddoc-md:mt-[1rem]",
22277
22278
  {
@@ -22294,7 +22295,7 @@ const iy = () => {
22294
22295
  {
22295
22296
  className: ye(
22296
22297
  "editor-comment-layout relative shrink-0 overflow-visible",
22297
- on && "w-full"
22298
+ sn && "w-full"
22298
22299
  ),
22299
22300
  style: {
22300
22301
  ...$s && {
@@ -22303,12 +22304,12 @@ const iy = () => {
22303
22304
  // The rail absorbs the left gutter; this keeps the right
22304
22305
  // one. With no rail, the left gutter is a margin too.
22305
22306
  ...Wo && {
22306
- marginRight: ji + (qt ? kh : 0) + (vi ? Sh : 0),
22307
+ marginRight: ji + (Gt ? kh : 0) + (vi ? Sh : 0),
22307
22308
  marginLeft: ki ? void 0 : ji
22308
22309
  }
22309
22310
  },
22310
22311
  children: [
22311
- on && e && /* @__PURE__ */ v("p", { className: "text-center color-text-secondary text-helper-text-sm flex gap-2 items-center justify-center py-1.5", children: [
22312
+ sn && e && /* @__PURE__ */ v("p", { className: "text-center color-text-secondary text-helper-text-sm flex gap-2 items-center justify-center py-1.5", children: [
22312
22313
  /* @__PURE__ */ r(
22313
22314
  he,
22314
22315
  {
@@ -22326,10 +22327,10 @@ const iy = () => {
22326
22327
  className: ye(
22327
22328
  "w-full flex-grow min-w-0 no-scrollbar rounded mx-auto",
22328
22329
  !Wo && "transition-[width,max-width] duration-300 ease-in-out",
22329
- !(xe != null && xe.canvasBackground) && !Ce && !qt && "color-bg-default"
22330
+ !(xe != null && xe.canvasBackground) && !Ce && !Gt && "color-bg-default"
22330
22331
  ),
22331
22332
  style: {
22332
- ...on ? {} : {
22333
+ ...sn ? {} : {
22333
22334
  width: `${Ni}px`,
22334
22335
  maxWidth: `${Ni}px`
22335
22336
  },
@@ -22348,11 +22349,11 @@ const iy = () => {
22348
22349
  className: ye(
22349
22350
  "w-full",
22350
22351
  e && "pt-3",
22351
- qt && "relative isolate"
22352
+ Gt && "relative isolate"
22352
22353
  ),
22353
22354
  "data-ddoc-zoom-layer": "",
22354
22355
  "data-ddoc-zoom": String(Dn),
22355
- style: on ? {} : Ue ? (
22356
+ style: sn ? {} : Ue ? (
22356
22357
  // Split View: fill the pane, no page width / zoom.
22357
22358
  { width: "100%" }
22358
22359
  ) : {
@@ -22361,7 +22362,7 @@ const iy = () => {
22361
22362
  transformOrigin: "top left"
22362
22363
  },
22363
22364
  children: [
22364
- qt && eo && /* @__PURE__ */ r(
22365
+ Gt && eo && /* @__PURE__ */ r(
22365
22366
  oy,
22366
22367
  {
22367
22368
  editor: de,
@@ -22412,11 +22413,11 @@ const iy = () => {
22412
22413
  /* @__PURE__ */ r(
22413
22414
  "div",
22414
22415
  {
22415
- className: `${on ? "px-9 pt-6" : "p-20"}`,
22416
+ className: `${sn ? "px-9 pt-6" : "p-20"}`,
22416
22417
  children: e ? /* @__PURE__ */ r(gc, {}) : /* @__PURE__ */ r(
22417
22418
  yo,
22418
22419
  {
22419
- className: `${on ? "w-full" : "w-[400px]"} h-[32px] rounded-sm mb-4`
22420
+ className: `${sn ? "w-full" : "w-[400px]"} h-[32px] rounded-sm mb-4`
22420
22421
  }
22421
22422
  )
22422
22423
  }
@@ -22512,7 +22513,7 @@ const iy = () => {
22512
22513
  enableFanficTemplate: R,
22513
22514
  runtimeState: nd,
22514
22515
  onApplyTabbedTemplate: td,
22515
- onCopyHeadingLink: jt,
22516
+ onCopyHeadingLink: Vt,
22516
22517
  children: /* @__PURE__ */ r("div", { className: "grammarly-wrapper", children: (qs != null && qs.length ? qs : de ? [
22517
22518
  {
22518
22519
  tabId: Mt,
@@ -22556,7 +22557,7 @@ const iy = () => {
22556
22557
  className: ye(
22557
22558
  "w-full h-auto",
22558
22559
  e && "preview-mode",
22559
- xn !== void 0 && Wn && "has-available-models",
22560
+ wn !== void 0 && Wn && "has-available-models",
22560
22561
  mt && "hide-inline-comments"
22561
22562
  )
22562
22563
  }
@@ -22611,7 +22612,7 @@ const iy = () => {
22611
22612
  {
22612
22613
  className: ye(
22613
22614
  "editor-right-rail",
22614
- !on && "max-w-[263px] w-full ddoc-xl:shrink-[2]",
22615
+ !sn && "max-w-[263px] w-full ddoc-xl:shrink-[2]",
22615
22616
  !e && !Ce && ft && "-mt-[1.5rem] ddoc-md:mt-[0.8rem]",
22616
22617
  e && "ddoc-md:mt-[1rem]",
22617
22618
  { "ddoc-md:mt-[0.7rem]": !e && !Ce },
@@ -22619,7 +22620,7 @@ const iy = () => {
22619
22620
  "-mt-[1.5rem] ddoc-md:mt-[0.7rem]": !ft && !e
22620
22621
  },
22621
22622
  Ce && "mt-[48px]",
22622
- Ce && !dn && Si && "hidden"
22623
+ Ce && !un && Si && "hidden"
22623
22624
  )
22624
22625
  }
22625
22626
  )
@@ -22662,7 +22663,7 @@ const iy = () => {
22662
22663
  gl,
22663
22664
  {
22664
22665
  documentStyling: xe,
22665
- theme: yn ?? "light",
22666
+ theme: xn ?? "light",
22666
22667
  isFocusMode: Ce,
22667
22668
  children: /* @__PURE__ */ r(
22668
22669
  "div",
@@ -22673,8 +22674,8 @@ const iy = () => {
22673
22674
  ge ? "color-bg-default" : "color-bg-secondary",
22674
22675
  oi && "ddoc-editor-cq"
22675
22676
  ),
22676
- "data-page-mode": qt ? "pages" : void 0,
22677
- style: qt && eo ? {
22677
+ "data-page-mode": Gt ? "pages" : void 0,
22678
+ style: Gt && eo ? {
22678
22679
  "--ddoc-page-text-h": `${eo.textHeight}px`
22679
22680
  } : void 0,
22680
22681
  children: /* @__PURE__ */ r(zi.Provider, { value: In, children: /* @__PURE__ */ v(
@@ -22683,7 +22684,7 @@ const iy = () => {
22683
22684
  zoomLevel: Zn,
22684
22685
  scale: Dn,
22685
22686
  fitScale: $o,
22686
- setZoomLevel: cn,
22687
+ setZoomLevel: dn,
22687
22688
  children: [
22688
22689
  wi ? /* @__PURE__ */ r("style", { dangerouslySetInnerHTML: { __html: wi } }) : null,
22689
22690
  /* @__PURE__ */ v(
@@ -22691,7 +22692,7 @@ const iy = () => {
22691
22692
  {
22692
22693
  isInlineCommentAvailable: !gs && !mt && ct,
22693
22694
  editor: de ?? null,
22694
- ydoc: hn,
22695
+ ydoc: mn,
22695
22696
  isFocusMode: Ce,
22696
22697
  username: o,
22697
22698
  setUsername: i,
@@ -22700,20 +22701,20 @@ const iy = () => {
22700
22701
  activeTabId: Mt,
22701
22702
  focusCommentWithActiveId: Wc,
22702
22703
  initialComments: St,
22703
- setInitialComments: fn,
22704
- onNewComment: en,
22705
- onEditComment: tn,
22706
- onEditReply: Tn,
22704
+ setInitialComments: gn,
22705
+ onNewComment: ln,
22706
+ onEditComment: zt,
22707
+ onEditReply: cn,
22707
22708
  onCommentReply: ms,
22708
22709
  onResolveComment: Kn,
22709
22710
  onUnresolveComment: En,
22710
- onDeleteComment: gn,
22711
+ onDeleteComment: yn,
22711
22712
  onDeleteReply: ie,
22712
22713
  ensResolutionUrl: y,
22713
22714
  isConnected: Me,
22714
22715
  connectViaWallet: st,
22715
- isLoading: Ie,
22716
- connectViaUsername: zt,
22716
+ isLoading: Re,
22717
+ connectViaUsername: Kt,
22717
22718
  isDDocOwner: rt,
22718
22719
  onInlineComment: se,
22719
22720
  onComment: D,
@@ -22721,7 +22722,7 @@ const iy = () => {
22721
22722
  commentAnchorsRef: Qc,
22722
22723
  draftAnchorsRef: Zc,
22723
22724
  storeApiRef: fi,
22724
- initialCommentAnchors: ln,
22725
+ initialCommentAnchors: an,
22725
22726
  children: [
22726
22727
  /* @__PURE__ */ r(
22727
22728
  ay,
@@ -22739,7 +22740,7 @@ const iy = () => {
22739
22740
  {
22740
22741
  dropdownOpen: zc,
22741
22742
  setDropdownOpen: Kc,
22742
- showTOC: dn,
22743
+ showTOC: un,
22743
22744
  setShowTOC: we,
22744
22745
  toggleFocusMode: Tt
22745
22746
  }
@@ -22758,7 +22759,7 @@ const iy = () => {
22758
22759
  // Split View: the right-pane wrapper owns the scroll.
22759
22760
  Ue ? "overflow-hidden" : "overflow-auto",
22760
22761
  ge ? "color-bg-default" : "color-bg-secondary",
22761
- kt
22762
+ xt
22762
22763
  ),
22763
22764
  style: Ce ? void 0 : Ws(),
22764
22765
  children: [
@@ -22782,7 +22783,7 @@ const iy = () => {
22782
22783
  activeTabId: Mt,
22783
22784
  onTabChange: Ko,
22784
22785
  isPreviewMode: e,
22785
- tabs: bn,
22786
+ tabs: Cn,
22786
22787
  mobileContainer: _c
22787
22788
  }
22788
22789
  ) })
@@ -22863,11 +22864,11 @@ const iy = () => {
22863
22864
  hasToC: !0,
22864
22865
  items: Ho,
22865
22866
  setItems: li,
22866
- showTOC: dn,
22867
+ showTOC: un,
22867
22868
  setShowTOC: we,
22868
22869
  isPreviewMode: !1,
22869
22870
  orientation: xe == null ? void 0 : xe.orientation,
22870
- tabs: bn,
22871
+ tabs: Cn,
22871
22872
  setTabs: ci,
22872
22873
  activeTabId: Mt,
22873
22874
  setActiveTabId: Ko,
@@ -22877,7 +22878,7 @@ const iy = () => {
22877
22878
  duplicateTab: hi,
22878
22879
  orderTab: mi,
22879
22880
  deleteTab: pi,
22880
- ydoc: hn,
22881
+ ydoc: mn,
22881
22882
  tabCommentCounts: Ci,
22882
22883
  tabConfig: Nt,
22883
22884
  isConnected: Me,
@@ -22930,7 +22931,7 @@ const iy = () => {
22930
22931
  }
22931
22932
  );
22932
22933
  }
22933
- ), ly = wt(
22934
+ ), ly = bt(
22934
22935
  ({
22935
22936
  isPreviewMode: e = !1,
22936
22937
  initialContent: t,
@@ -23190,7 +23191,7 @@ const iy = () => {
23190
23191
  )
23191
23192
  ] });
23192
23193
  }
23193
- ), lx = wt(
23194
+ ), lx = bt(
23194
23195
  (e, t) => {
23195
23196
  var i, a;
23196
23197
  const n = !!((i = e.versionHistoryState) != null && i.enabled), s = ((a = e.versionHistoryState) == null ? void 0 : a.versionId) || "default", o = n ? s : "default";
@@ -23511,7 +23512,7 @@ function dx(e) {
23511
23512
  t.isDestroyed || t.destroy();
23512
23513
  }
23513
23514
  }
23514
- const ux = (e, t, n = "ecies") => Ot.encryptData(lt(e), t, n), hx = (e, t) => Ot.decryptData(lt(e), t);
23515
+ const ux = (e, t, n = "ecies") => Ot.encryptData(at(e), t, n), hx = (e, t) => Ot.decryptData(at(e), t);
23515
23516
  function Fc(e, t, n, s) {
23516
23517
  return {
23517
23518
  wsUrl: e.wsUrl,
@@ -23565,7 +23566,7 @@ async function mx(e) {
23565
23566
  );
23566
23567
  try {
23567
23568
  await Bc(t);
23568
- const n = lt(e.roomKey), s = [];
23569
+ const n = at(e.roomKey), s = [];
23569
23570
  let o;
23570
23571
  for (; ; ) {
23571
23572
  const i = await t.fetchHydrationRange(o);
@@ -23598,7 +23599,7 @@ async function px(e) {
23598
23599
  try {
23599
23600
  await Bc(t);
23600
23601
  const n = Ot.encryptData(
23601
- lt(e.newRoomKey),
23602
+ at(e.newRoomKey),
23602
23603
  e.state,
23603
23604
  t.getWireFormat()
23604
23605
  ), s = await t.sendSnapshot({ data: n, floorSeq: 0 });