zs_library 0.4.2 → 0.4.4

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
@@ -7,46 +7,46 @@ import { initReactI18next as Li } from "react-i18next";
7
7
  import { jsx as h, jsxs as x, Fragment as rt } from "react/jsx-runtime";
8
8
  import { cx as D, css as S } from "@emotion/css";
9
9
  import * as ne from "react";
10
- import { createContext as Qo, useMemo as pt, useContext as er, useState as J, useRef as mt, useEffect as $e, Fragment as Vi, forwardRef as Fi } from "react";
11
- import $i from "react-slick";
10
+ import { createContext as Qo, useMemo as pt, useContext as er, useState as J, useRef as mt, useCallback as Vi, useEffect as $e, Fragment as Fi, forwardRef as $i } from "react";
11
+ import Hi from "react-slick";
12
12
  import { ReactSortable as Ln } from "react-sortablejs";
13
- import { AnimatePresence as Vn, motion as B, useMotionValue as Hi, useTransform as kt, useSpring as Ht } from "framer-motion";
14
- import { useLocalStorageState as qi, useDebounceEffect as Wi } from "ahooks";
13
+ import { AnimatePresence as Vn, motion as B, useMotionValue as qi, useTransform as kt, useSpring as Ht } from "framer-motion";
14
+ import { useLocalStorageState as Wi, useDebounceEffect as Ji } from "ahooks";
15
15
  import { v4 as no } from "uuid";
16
16
  import tr from "rc-tooltip";
17
- import { RiPencilRuler2Line as Ji, RiShareLine as Ki, RiInformationLine as Ui, RiCloseCircleLine as ji, RiArrowUpDownLine as Yi, RiArrowLeftRightLine as Gi, RiArrowRightLine as Xi, RiArrowLeftLine as _i, RiCloseLine as Zi, RiZoomOutLine as Qi, RiZoomInLine as es, RiClockwise2Line as ts, RiAnticlockwise2Line as ns, RiMoreLine as os, RiArrowDropDownLine as nr, RiCheckLine as Tt, RiLink as rs, RiDeleteBinLine as or, RiText as rr, RiH1 as ir, RiH2 as sr, RiH3 as lr, RiListCheck as ar, RiListUnordered as cr, RiListOrdered as dr, RiQuoteText as ur, RiCodeLine as hr, RiSparklingFill as Fn, RiImageLine as is, RiArrowRightSLine as ss, RiRepeatLine as ls, RiFileCopyLine as as, RiAddLine as cs, RiDraggable as ds } from "@remixicon/react";
17
+ import { RiPencilRuler2Line as Ki, RiShareLine as Ui, RiInformationLine as ji, RiCloseCircleLine as Yi, RiArrowUpDownLine as Gi, RiArrowLeftRightLine as Xi, RiArrowRightLine as _i, RiArrowLeftLine as Zi, RiCloseLine as Qi, RiZoomOutLine as es, RiZoomInLine as ts, RiClockwise2Line as ns, RiAnticlockwise2Line as os, RiMoreLine as rs, RiArrowDropDownLine as nr, RiCheckLine as Tt, RiLink as is, RiDeleteBinLine as or, RiText as rr, RiH1 as ir, RiH2 as sr, RiH3 as lr, RiListCheck as ar, RiListUnordered as cr, RiListOrdered as dr, RiQuoteText as ur, RiCodeLine as hr, RiSparklingFill as Fn, RiImageLine as ss, RiArrowRightSLine as ls, RiRepeatLine as as, RiFileCopyLine as cs, RiAddLine as ds, RiDraggable as us } from "@remixicon/react";
18
18
  import fr from "rc-dialog";
19
- import us from "react-json-view";
20
- import { AdmonitionDirectiveDescriptor as hs, MDXEditor as fs, toolbarPlugin as ps, diffSourcePlugin as ms, listsPlugin as gs, quotePlugin as bs, headingsPlugin as ys, linkPlugin as ks, linkDialogPlugin as xs, imagePlugin as Cs, tablePlugin as Ss, thematicBreakPlugin as Ns, frontmatterPlugin as Ts, codeBlockPlugin as ws, codeMirrorPlugin as Ds, markdownShortcutPlugin as Ms, directivesPlugin as Os, DiffSourceToggleWrapper as vs, UndoRedo as Is, Separator as Ke, BoldItalicUnderlineToggles as As, CodeToggle as Es, StrikeThroughSupSubToggles as Rs, ListsToggle as Ps, CreateLink as zs, InsertImage as Bs, InsertTable as Ls, InsertThematicBreak as Vs, InsertCodeBlock as Fs, InsertFrontmatter as $s } from "@mdxeditor/editor";
19
+ import hs from "react-json-view";
20
+ import { AdmonitionDirectiveDescriptor as fs, MDXEditor as ps, toolbarPlugin as ms, diffSourcePlugin as gs, listsPlugin as bs, quotePlugin as ys, headingsPlugin as ks, linkPlugin as xs, linkDialogPlugin as Cs, imagePlugin as Ss, tablePlugin as Ns, thematicBreakPlugin as Ts, frontmatterPlugin as ws, codeBlockPlugin as Ds, codeMirrorPlugin as Ms, markdownShortcutPlugin as Os, directivesPlugin as vs, DiffSourceToggleWrapper as Is, UndoRedo as As, Separator as Ke, BoldItalicUnderlineToggles as Es, CodeToggle as Rs, StrikeThroughSupSubToggles as Ps, ListsToggle as zs, CreateLink as Bs, InsertImage as Ls, InsertTable as Vs, InsertThematicBreak as Fs, InsertCodeBlock as $s, InsertFrontmatter as Hs } from "@mdxeditor/editor";
21
21
  import pr from "react-markdown";
22
- import Hs from "remark-gfm";
23
- import qs from "remark-emoji";
24
- import Ws from "rehype-raw";
25
- import { Prism as Js } from "react-syntax-highlighter";
26
- import Ks from "rc-image";
27
- import { clsx as Us } from "clsx";
28
- import { twMerge as js } from "tailwind-merge";
29
- import { Placeholder as Ys, TiptapLink as Gs, TiptapImage as Xs, UploadImagesPlugin as _s, UpdatedImage as Zs, TaskList as Qs, TaskItem as el, HorizontalRule as tl, StarterKit as nl, CodeBlockLowlight as ol, Mathematics as rl, CharacterCount as il, AIHighlight as sl, TiptapUnderline as ll, HighlightExtension as al, TextStyle as cl, Color as dl, CustomKeymap as ul, useEditor as xe, EditorBubbleItem as Xt, getPrevText as hl, addAIHighlight as fl, removeAIHighlight as pl, EditorBubble as ml, createImageUpload as mr, Command as gl, createSuggestionItems as bl, renderItems as yl, EditorRoot as kl, EditorContent as xl, handleImageDrop as Cl, handleImagePaste as Sl, handleCommandNavigation as Nl, EditorCommand as Tl, EditorCommandEmpty as wl, EditorCommandList as Dl, EditorCommandItem as Ml, ImageResizer as Ol } from "novel";
30
- import { useDebouncedCallback as vl } from "use-debounce";
31
- import { Markdown as Il } from "tiptap-markdown";
32
- import { cx as le, cva as Al } from "class-variance-authority";
33
- import { createLowlight as El, common as Rl } from "lowlight";
34
- import { Extension as Pl } from "@tiptap/core";
22
+ import qs from "remark-gfm";
23
+ import Ws from "remark-emoji";
24
+ import Js from "rehype-raw";
25
+ import { Prism as Ks } from "react-syntax-highlighter";
26
+ import Us from "rc-image";
27
+ import { clsx as js } from "clsx";
28
+ import { twMerge as Ys } from "tailwind-merge";
29
+ import { Placeholder as Gs, TiptapLink as Xs, TiptapImage as _s, UploadImagesPlugin as Zs, UpdatedImage as Qs, TaskList as el, TaskItem as tl, HorizontalRule as nl, StarterKit as ol, CodeBlockLowlight as rl, Mathematics as il, CharacterCount as sl, AIHighlight as ll, TiptapUnderline as al, HighlightExtension as cl, TextStyle as dl, Color as ul, CustomKeymap as hl, useEditor as xe, EditorBubbleItem as Xt, getPrevText as fl, addAIHighlight as pl, removeAIHighlight as ml, EditorBubble as gl, createImageUpload as mr, Command as bl, createSuggestionItems as yl, renderItems as kl, EditorRoot as xl, EditorContent as Cl, handleImageDrop as Sl, handleImagePaste as Nl, handleCommandNavigation as Tl, EditorCommand as wl, EditorCommandEmpty as Dl, EditorCommandList as Ml, EditorCommandItem as Ol, ImageResizer as vl } from "novel";
30
+ import { useDebouncedCallback as Il } from "use-debounce";
31
+ import { Markdown as Al } from "tiptap-markdown";
32
+ import { cx as le, cva as El } from "class-variance-authority";
33
+ import { createLowlight as Rl, common as Pl } from "lowlight";
34
+ import { Extension as zl } from "@tiptap/core";
35
35
  import * as wt from "@radix-ui/react-popover";
36
- import { Popover as gr, PopoverTrigger as zl } from "@radix-ui/react-popover";
37
- import { Slot as Bl } from "@radix-ui/react-slot";
38
- import { SigmaIcon as Ll, X as Vl, Check as Fl, TextQuote as $l, TrashIcon as Hl, RefreshCcwDot as ql, CheckCheck as Wl, ArrowDownWideNarrow as Jl, WrapText as Kl, StepForward as Ul, ArrowUp as jl, BoldIcon as Yl, ItalicIcon as Gl, UnderlineIcon as Xl, StrikethroughIcon as _l, CodeIcon as Zl } from "lucide-react";
36
+ import { Popover as gr, PopoverTrigger as Bl } from "@radix-ui/react-popover";
37
+ import { Slot as Ll } from "@radix-ui/react-slot";
38
+ import { SigmaIcon as Vl, X as Fl, Check as $l, TextQuote as Hl, TrashIcon as ql, RefreshCcwDot as Wl, CheckCheck as Jl, ArrowDownWideNarrow as Kl, WrapText as Ul, StepForward as jl, ArrowUp as Yl, BoldIcon as Gl, ItalicIcon as Xl, UnderlineIcon as _l, StrikethroughIcon as Zl, CodeIcon as Ql } from "lucide-react";
39
39
  import * as br from "@radix-ui/react-separator";
40
- import { useCompletion as Ql } from "@ai-sdk/react";
40
+ import { useCompletion as ea } from "@ai-sdk/react";
41
41
  import { toast as Dt } from "sonner";
42
42
  import * as Ze from "@radix-ui/react-scroll-area";
43
43
  import { Command as ce } from "cmdk";
44
- import * as Te from "@radix-ui/react-dialog";
45
- import ea from "highlight.js";
46
- import ta from "rc-dropdown";
44
+ import * as we from "@radix-ui/react-dialog";
45
+ import ta from "highlight.js";
46
+ import na from "rc-dropdown";
47
47
  import qt from "rc-menu";
48
- import { generateHTML as na } from "@tiptap/html";
49
- const oa = {
48
+ import { generateHTML as oa } from "@tiptap/html";
49
+ const ra = {
50
50
  common: {
51
51
  ok: "确定",
52
52
  cancel: "取消",
@@ -71,7 +71,7 @@ const oa = {
71
71
  link: "链接",
72
72
  image: "图片"
73
73
  }
74
- }, ra = {
74
+ }, ia = {
75
75
  common: {
76
76
  ok: "OK",
77
77
  cancel: "Cancel",
@@ -96,15 +96,15 @@ const oa = {
96
96
  link: "Link",
97
97
  image: "Image"
98
98
  }
99
- }, ia = "common";
99
+ }, sa = "common";
100
100
  Bi.use(Li).init({
101
101
  resources: {
102
- "zh-CN": oa,
103
- "en-US": ra
102
+ "zh-CN": ra,
103
+ "en-US": ia
104
104
  },
105
105
  lng: "zh-CN",
106
106
  fallbackLng: "zh-CN",
107
- defaultNS: ia,
107
+ defaultNS: sa,
108
108
  interpolation: {
109
109
  escapeValue: !1
110
110
  }
@@ -137,17 +137,17 @@ const yr = {
137
137
  }
138
138
  }, xr = Qo(
139
139
  {}
140
- ), sa = (n) => {
140
+ ), la = (n) => {
141
141
  const { children: e, theme: t, ...o } = n, r = pt(() => t === "light" ? yr : t === "dark" ? kr : t, [t]);
142
142
  return /* @__PURE__ */ h(xr.Provider, { value: { theme: r, ...o }, children: e });
143
143
  }, it = () => er(xr), Cr = {
144
144
  maxRow: 2,
145
145
  maxCol: 2
146
- }, la = {
146
+ }, aa = {
147
147
  ...Cr
148
148
  }, Sr = {
149
149
  app: Cr,
150
- group: la
150
+ group: aa
151
151
  };
152
152
  class ye {
153
153
  }
@@ -191,7 +191,7 @@ const Nr = Qo({
191
191
  moveTargetId: null,
192
192
  setMoveTargetId: () => {
193
193
  }
194
- }), aa = (n) => {
194
+ }), ca = (n) => {
195
195
  const {
196
196
  children: e,
197
197
  list: t = [],
@@ -204,7 +204,7 @@ const Nr = Qo({
204
204
  null
205
205
  ), [I, M] = J(!1), [v, w] = J(null), [N, X] = J(
206
206
  null
207
- ), [K, Ce] = J(!1), [Me, R] = qi(r, {
207
+ ), [K, Ce] = J(!1), [Oe, R] = Wi(r, {
208
208
  defaultValue: [],
209
209
  listenStorageChange: !0
210
210
  }), U = () => {
@@ -232,38 +232,41 @@ const Nr = Qo({
232
232
  Q && (H.preventDefault(), V(H, P));
233
233
  }
234
234
  };
235
- }, Oe = (P, Q) => {
236
- const Y = [...Q || []];
237
- if (Y.length > 0)
238
- g((H) => {
239
- const L = [...H], F = (z) => {
240
- var eo, to;
241
- const W = Y.shift(), _ = z.find((ve) => ve.id === W), Se = z.findIndex((ve) => ve.id === W);
242
- if (Y.length && _) {
243
- if (((eo = _.children) == null ? void 0 : eo.filter(
244
- (ve) => !P.some((Ri) => Ri.id === ve.id)
245
- ).length) === 1 && P.length === 1) {
246
- const ve = { ...P[0] };
247
- return z.splice(Se, 1, ve), o == null || o(z), z;
235
+ }, Se = Vi(
236
+ (P, Q) => {
237
+ const Y = [...Q || []];
238
+ if (Y.length > 0)
239
+ g((H) => {
240
+ const L = [...H], F = (z) => {
241
+ var eo, to;
242
+ const W = Y.shift(), _ = z.find((ve) => ve.id === W), Ne = z.findIndex((ve) => ve.id === W);
243
+ if (Y.length && _) {
244
+ if (((eo = _.children) == null ? void 0 : eo.filter(
245
+ (ve) => !P.some((Ri) => Ri.id === ve.id)
246
+ ).length) === 1 && P.length === 1) {
247
+ const ve = { ...P[0] };
248
+ return z.splice(Ne, 1, ve), o == null || o(z), z;
249
+ }
250
+ return _.children = F(_.children || []), z.splice(Ne, 1, _), o == null || o(z), z;
248
251
  }
249
- return _.children = F(_.children || []), z.splice(Se, 1, _), o == null || o(z), z;
250
- }
251
- if (_) {
252
- if (!((to = _.children) != null && to.length) && P.length) {
253
- const ve = { ..._ };
254
- return _.data = { name: "文件夹" }, _.type = "group", _.children = [ve, ...P], _.id = no(), z.splice(Se, 1, _), o == null || o(z), z;
252
+ if (_) {
253
+ if (!((to = _.children) != null && to.length) && P.length) {
254
+ const ve = { ..._ };
255
+ return _.data = { name: "文件夹" }, _.type = "group", _.children = [ve, ...P], _.id = no(), z.splice(Ne, 1, _), o == null || o(z), z;
256
+ }
257
+ return _.children = ye.uniqueArray(P), z.splice(Ne, 1, _), o == null || o(z), z;
255
258
  }
256
- return _.children = ye.uniqueArray(P), z.splice(Se, 1, _), o == null || o(z), z;
257
- }
258
- return ye.uniqueArray(P);
259
- };
260
- return ye.uniqueArray(F(L));
261
- });
262
- else {
263
- const H = ye.uniqueArray(P);
264
- o == null || o(H), g(H);
265
- }
266
- }, an = (P, Q) => {
259
+ return ye.uniqueArray(P);
260
+ };
261
+ return ye.uniqueArray(F(L));
262
+ });
263
+ else {
264
+ const H = ye.uniqueArray(P);
265
+ o == null || o(H), g(H);
266
+ }
267
+ },
268
+ [o]
269
+ ), an = (P, Q) => {
267
270
  g((Y) => {
268
271
  const H = [...Y], L = (F) => {
269
272
  var z;
@@ -301,18 +304,18 @@ const Nr = Qo({
301
304
  });
302
305
  }, ze = (P, Q) => {
303
306
  const Y = [...b], H = (L, F) => {
304
- const z = F.shift(), W = L.find((Se) => Se.id === z), _ = L.findIndex((Se) => Se.id === z);
307
+ const z = F.shift(), W = L.find((Ne) => Ne.id === z), _ = L.findIndex((Ne) => Ne.id === z);
305
308
  if (W) {
306
309
  if (F.length)
307
310
  W.children = H(W.children || [], F);
308
311
  else {
309
- const Se = (P == null ? void 0 : P.type) ?? "app";
312
+ const Ne = (P == null ? void 0 : P.type) ?? "app";
310
313
  W.children = [
311
314
  ...W.children ?? [],
312
315
  {
313
316
  ...P,
314
317
  id: no(),
315
- config: (P == null ? void 0 : P.config) ?? Sr[Se]
318
+ config: (P == null ? void 0 : P.config) ?? Sr[Ne]
316
319
  }
317
320
  ];
318
321
  }
@@ -323,12 +326,12 @@ const Nr = Qo({
323
326
  g(H(Y, Q));
324
327
  };
325
328
  return $e(() => {
326
- (t == null ? void 0 : t.length) > 0 && b.length === 0 && Oe(t);
327
- }, [t]), $e(() => {
329
+ (t == null ? void 0 : t.length) > 0 && (b.length === 0 || JSON.stringify(b) !== JSON.stringify(t)) && Se(t);
330
+ }, [Se, b, t]), $e(() => {
328
331
  f.current = d, d !== null && U();
329
332
  }, [d]), $e(() => {
330
- i && Me != null && Me.length && !K && (Oe(Me), Ce(!0));
331
- }, [Me, K, i]), Wi(
333
+ i && Oe != null && Oe.length && !K && (Se(Oe), Ce(!0));
334
+ }, [Oe, K, i]), Ji(
332
335
  () => {
333
336
  i && R(b);
334
337
  },
@@ -341,7 +344,7 @@ const Nr = Qo({
341
344
  {
342
345
  value: {
343
346
  list: b,
344
- setList: Oe,
347
+ setList: Se,
345
348
  contextMenu: m,
346
349
  setContextMenu: p,
347
350
  listStatus: d,
@@ -365,7 +368,7 @@ const Nr = Qo({
365
368
  children: e
366
369
  }
367
370
  );
368
- }, bt = () => er(Nr), ca = {
371
+ }, bt = () => er(Nr), da = {
369
372
  menuShow: {
370
373
  opacity: 1,
371
374
  y: 0,
@@ -397,7 +400,7 @@ const Nr = Qo({
397
400
  onClick: (l) => {
398
401
  l.stopPropagation(), o == null || o();
399
402
  },
400
- variants: ca,
403
+ variants: da,
401
404
  children: /* @__PURE__ */ x(
402
405
  B.div,
403
406
  {
@@ -432,7 +435,7 @@ const Nr = Qo({
432
435
  )
433
436
  }
434
437
  );
435
- }, da = (n) => {
438
+ }, ua = (n) => {
436
439
  const {
437
440
  showInfoButton: e = !0,
438
441
  showRemoveButton: t = !0,
@@ -493,7 +496,7 @@ const Nr = Qo({
493
496
  {
494
497
  label: "修改大小",
495
498
  key: "size",
496
- icon: /* @__PURE__ */ h(Ji, { size: 14 }),
499
+ icon: /* @__PURE__ */ h(Ki, { size: 14 }),
497
500
  items: O().map((k) => ({
498
501
  label: k,
499
502
  key: k,
@@ -616,7 +619,7 @@ const Nr = Qo({
616
619
  o && /* @__PURE__ */ h(
617
620
  dn,
618
621
  {
619
- icon: /* @__PURE__ */ h(Ki, { size: 20 }),
622
+ icon: /* @__PURE__ */ h(Ui, { size: 20 }),
620
623
  title: "分享",
621
624
  onClick: () => {
622
625
  if (s) {
@@ -629,7 +632,7 @@ const Nr = Qo({
629
632
  e && /* @__PURE__ */ h(
630
633
  dn,
631
634
  {
632
- icon: /* @__PURE__ */ h(Ui, { size: 20 }),
635
+ icon: /* @__PURE__ */ h(ji, { size: 20 }),
633
636
  title: "信息",
634
637
  onClick: () => {
635
638
  if (i) {
@@ -647,7 +650,7 @@ const Nr = Qo({
647
650
  t && /* @__PURE__ */ h(
648
651
  dn,
649
652
  {
650
- icon: /* @__PURE__ */ h(ji, { size: 20 }),
653
+ icon: /* @__PURE__ */ h(Yi, { size: 20 }),
651
654
  title: "移除",
652
655
  onClick: () => {
653
656
  if (l) {
@@ -664,7 +667,7 @@ const Nr = Qo({
664
667
  ]
665
668
  }
666
669
  ) });
667
- }, ua = (n) => {
670
+ }, ha = (n) => {
668
671
  const { data: e, noLetters: t = !1 } = n, { contextMenuFuns: o } = bt(), { itemIconBuilder: r, theme: i, contextMenu: s } = it(), { light: l, dark: a } = ye.getTheme(i), { data: c = {} } = e, { name: d } = c;
669
672
  return /* @__PURE__ */ x(rt, { children: [
670
673
  /* @__PURE__ */ h(
@@ -749,7 +752,7 @@ const Nr = Qo({
749
752
  border: none;
750
753
  }
751
754
  `,
752
- overlay: /* @__PURE__ */ h(da, { ...u }),
755
+ overlay: /* @__PURE__ */ h(ua, { ...u }),
753
756
  visible: (c == null ? void 0 : c.data.id) === e.id,
754
757
  onVisibleChange: (f) => {
755
758
  f || d(null);
@@ -764,12 +767,12 @@ const Nr = Qo({
764
767
  "data-children-length": a,
765
768
  onClick: () => r == null ? void 0 : r(e),
766
769
  className: D(i && "drag-disabled", t),
767
- children: s ?? /* @__PURE__ */ h(ua, { ...n })
770
+ children: s ?? /* @__PURE__ */ h(ha, { ...n })
768
771
  }
769
772
  )
770
773
  }
771
774
  );
772
- }, ha = (n) => {
775
+ }, fa = (n) => {
773
776
  const {
774
777
  data: e,
775
778
  className: t,
@@ -789,7 +792,7 @@ const Nr = Qo({
789
792
  } = bt(), { itemIconBuilder: b, theme: g, contextMenu: y } = it(), { light: C, dark: O } = ye.getTheme(g), { children: k, data: I, config: M } = e, { row: v = 1, col: w = 1 } = M ?? {}, N = {
790
793
  visible: { opacity: 1, scale: 1 },
791
794
  hidden: { opacity: 0, scale: 0.95 }
792
- }, X = ((k == null ? void 0 : k.length) ?? 0) === 0, K = X ? [e] : [...k ?? []].slice(0, 9), Ce = pt(() => u === e.id.toString(), [e.id, u]), Me = pt(() => f === e.id, [e.id, f]), R = S`
795
+ }, X = ((k == null ? void 0 : k.length) ?? 0) === 0, K = X ? [e] : [...k ?? []].slice(0, 9), Ce = pt(() => u === e.id.toString(), [e.id, u]), Oe = pt(() => f === e.id, [e.id, f]), R = S`
793
796
  overflow: hidden;
794
797
  cursor: pointer;
795
798
  background-color: ${C.itemIconBackgroundColor};
@@ -893,8 +896,8 @@ const Nr = Qo({
893
896
  grid-row: span 2 / span 2;
894
897
  `
895
898
  ),
896
- onClick: (Oe) => {
897
- de > 2 || (Oe.stopPropagation(), i == null || i(V));
899
+ onClick: (Se) => {
900
+ de > 2 || (Se.stopPropagation(), i == null || i(V));
898
901
  },
899
902
  children: b == null ? void 0 : b(V)
900
903
  },
@@ -934,8 +937,8 @@ const Nr = Qo({
934
937
  grid-row: span 2 / span 2;
935
938
  `
936
939
  ),
937
- onClick: (Oe) => {
938
- de > 2 || (Oe.stopPropagation(), i == null || i(V));
940
+ onClick: (Se) => {
941
+ de > 2 || (Se.stopPropagation(), i == null || i(V));
939
942
  },
940
943
  children: b == null ? void 0 : b(V)
941
944
  },
@@ -964,7 +967,7 @@ const Nr = Qo({
964
967
  {
965
968
  whileTap: { scale: 0.9 },
966
969
  className: D(
967
- Me ? "!scale-110" : "",
970
+ Oe ? "!scale-110" : "",
968
971
  S`
969
972
  cursor: pointer;
970
973
  position: relative;
@@ -1072,7 +1075,7 @@ const Nr = Qo({
1072
1075
  transition: all 0.2s;
1073
1076
  }
1074
1077
  }
1075
- `, fa = (n) => {
1078
+ `, pa = (n) => {
1076
1079
  const { data: e, onClose: t, onItemClick: o } = n, {
1077
1080
  list: r,
1078
1081
  setList: i,
@@ -1215,7 +1218,7 @@ const Nr = Qo({
1215
1218
  )
1216
1219
  }
1217
1220
  );
1218
- }, pa = (n) => {
1221
+ }, ma = (n) => {
1219
1222
  var o;
1220
1223
  const { data: e, onClose: t } = n;
1221
1224
  return /* @__PURE__ */ h(
@@ -1235,11 +1238,11 @@ const Nr = Qo({
1235
1238
  title: ((o = e == null ? void 0 : e.data) == null ? void 0 : o.name) ?? "信息",
1236
1239
  children: e && /* @__PURE__ */ x("div", { children: [
1237
1240
  /* @__PURE__ */ h("div", { className: "mb-2", children: "开发者信息" }),
1238
- /* @__PURE__ */ h("div", { className: "p-2 rounded-md bg-[#272822]", children: /* @__PURE__ */ h(us, { src: e, theme: "monokai" }) })
1241
+ /* @__PURE__ */ h("div", { className: "p-2 rounded-md bg-[#272822]", children: /* @__PURE__ */ h(hs, { src: e, theme: "monokai" }) })
1239
1242
  ] })
1240
1243
  }
1241
1244
  );
1242
- }, ma = (n) => {
1245
+ }, ga = (n) => {
1243
1246
  const {
1244
1247
  pagination: e = { position: "bottom" },
1245
1248
  className: t,
@@ -1257,7 +1260,9 @@ const Nr = Qo({
1257
1260
  setMoveItemId: b,
1258
1261
  setMoveTargetId: g,
1259
1262
  addItem: y
1260
- } = bt(), { pagingDotBuilder: C, pagingDotsBuilder: O, itemBuilder: k } = it(), I = pt(() => e === !1 ? {} : {
1263
+ } = bt();
1264
+ console.log("🚀 ~ list:", a);
1265
+ const { pagingDotBuilder: C, pagingDotsBuilder: O, itemBuilder: k } = it(), I = pt(() => e === !1 ? {} : {
1261
1266
  top: S`
1262
1267
  display: flex;
1263
1268
  flex-direction: column;
@@ -1308,7 +1313,7 @@ const Nr = Qo({
1308
1313
  }[e.position ?? "bottom"], [e]);
1309
1314
  return /* @__PURE__ */ x(rt, { children: [
1310
1315
  /* @__PURE__ */ h(
1311
- $i,
1316
+ Hi,
1312
1317
  {
1313
1318
  useCSS: !0,
1314
1319
  useTransform: !0,
@@ -1441,7 +1446,7 @@ const Nr = Qo({
1441
1446
  case "group":
1442
1447
  case "app":
1443
1448
  N = /* @__PURE__ */ h(
1444
- ha,
1449
+ fa,
1445
1450
  {
1446
1451
  data: v,
1447
1452
  itemIndex: w,
@@ -1473,7 +1478,7 @@ const Nr = Qo({
1473
1478
  }
1474
1479
  ),
1475
1480
  /* @__PURE__ */ h(
1476
- pa,
1481
+ ma,
1477
1482
  {
1478
1483
  data: u,
1479
1484
  onClose: () => {
@@ -1482,7 +1487,7 @@ const Nr = Qo({
1482
1487
  }
1483
1488
  ),
1484
1489
  /* @__PURE__ */ h(
1485
- fa,
1490
+ pa,
1486
1491
  {
1487
1492
  data: m,
1488
1493
  onClose: () => {
@@ -1492,39 +1497,38 @@ const Nr = Qo({
1492
1497
  }
1493
1498
  )
1494
1499
  ] });
1495
- }, sh = (n) => {
1500
+ }, lh = (n) => {
1496
1501
  const {
1497
- className: e,
1498
- list: t,
1499
- onChange: o,
1500
- storageKey: r,
1501
- enableCaching: i,
1502
- theme: s,
1503
- noLetters: l,
1504
- contextMenu: a,
1505
- contextMenuBuilder: c,
1506
- itemBuilder: d,
1507
- itemIconBuilder: u,
1508
- pagingDotBuilder: f,
1509
- pagingDotsBuilder: m,
1510
- ...p
1502
+ list: e,
1503
+ onChange: t,
1504
+ storageKey: o,
1505
+ enableCaching: r,
1506
+ theme: i,
1507
+ noLetters: s,
1508
+ contextMenu: l,
1509
+ contextMenuBuilder: a,
1510
+ itemBuilder: c,
1511
+ itemIconBuilder: d,
1512
+ pagingDotBuilder: u,
1513
+ pagingDotsBuilder: f,
1514
+ ...m
1511
1515
  } = n;
1512
- return /* @__PURE__ */ h("div", { className: e, children: /* @__PURE__ */ h(aa, { ...{
1513
- list: t,
1514
- onChange: o,
1515
- storageKey: r,
1516
- enableCaching: i
1517
- }, children: /* @__PURE__ */ h(sa, { ...{
1518
- theme: s,
1519
- noLetters: l,
1520
- contextMenu: a,
1521
- pagingDotsBuilder: m,
1522
- pagingDotBuilder: f,
1523
- itemBuilder: d,
1524
- itemIconBuilder: u,
1525
- contextMenuBuilder: c
1526
- }, children: /* @__PURE__ */ h(ma, { ...p }) }) }) });
1527
- }, ga = {
1516
+ return /* @__PURE__ */ h(ca, { ...{
1517
+ list: e,
1518
+ onChange: t,
1519
+ storageKey: o,
1520
+ enableCaching: r
1521
+ }, children: /* @__PURE__ */ h(la, { ...{
1522
+ theme: i,
1523
+ noLetters: s,
1524
+ contextMenu: l,
1525
+ pagingDotsBuilder: f,
1526
+ pagingDotBuilder: u,
1527
+ itemBuilder: c,
1528
+ itemIconBuilder: d,
1529
+ contextMenuBuilder: a
1530
+ }, children: /* @__PURE__ */ h(ga, { ...m }) }) });
1531
+ }, ba = {
1528
1532
  frontmatterEditor: {
1529
1533
  title: "编辑前置元数据",
1530
1534
  key: "键",
@@ -1641,13 +1645,13 @@ const Nr = Qo({
1641
1645
  image: {
1642
1646
  delete: "删除图片"
1643
1647
  }
1644
- }, ba = (n, e, t) => {
1648
+ }, ya = (n, e, t) => {
1645
1649
  const r = n.split(".").reduce(
1646
1650
  (i, s) => typeof i == "string" ? i : i[s],
1647
- ga
1651
+ ba
1648
1652
  );
1649
1653
  return typeof r != "string" ? e : t ? r.replace(/{{(.*?)}}/g, (i, s) => t[s]) : r;
1650
- }, ya = S`
1654
+ }, ka = S`
1651
1655
  --accentBase: var(--tomato-1);
1652
1656
  --accentBgSubtle: var(--tomato-2);
1653
1657
  --accentBg: var(--tomato-3);
@@ -1701,7 +1705,7 @@ const Nr = Qo({
1701
1705
  rgba(255, 255, 255, 0.05),
1702
1706
  rgba(255, 255, 255, 0.05)
1703
1707
  );
1704
- `, ka = S`
1708
+ `, xa = S`
1705
1709
  [class*="_toolbarRoot"] {
1706
1710
  flex-wrap: wrap;
1707
1711
  transition: all 0.3s;
@@ -1907,7 +1911,7 @@ const Nr = Qo({
1907
1911
  `, Cn = (n) => {
1908
1912
  var e, t;
1909
1913
  return n === "dark" ? !0 : n === "light" ? !1 : (e = document.documentElement.getAttribute("style")) != null && e.includes("color-scheme: dark;") ? !0 : (t = document.documentElement.getAttribute("style")) != null && t.includes("color-scheme: light;") ? !1 : window.matchMedia("(prefers-color-scheme: dark)").matches;
1910
- }, xa = (n) => {
1914
+ }, Ca = (n) => {
1911
1915
  const {
1912
1916
  value: e,
1913
1917
  onChange: t,
@@ -1934,19 +1938,19 @@ const Nr = Qo({
1934
1938
  }
1935
1939
  },
1936
1940
  directives: b = {
1937
- directiveDescriptors: [hs]
1941
+ directiveDescriptors: [fs]
1938
1942
  }
1939
1943
  } = r ?? {}, [g, y] = J("");
1940
1944
  return $e(() => {
1941
1945
  var C;
1942
1946
  e !== void 0 && a.current && ((C = a.current) == null || C.setMarkdown(e), y(e));
1943
1947
  }, [e, a]), /* @__PURE__ */ h(
1944
- fs,
1948
+ ps,
1945
1949
  {
1946
1950
  ref: a,
1947
1951
  className: D(
1948
- ka,
1949
- Cn(s) ? ya : "",
1952
+ xa,
1953
+ Cn(s) ? ka : "",
1950
1954
  Cn(s) ? Mr : Dr,
1951
1955
  i
1952
1956
  ),
@@ -1955,49 +1959,49 @@ const Nr = Qo({
1955
1959
  onChange: (C) => {
1956
1960
  !e && !t && y(C), t && t(C);
1957
1961
  },
1958
- translation: o ?? ba,
1962
+ translation: o ?? ya,
1959
1963
  plugins: [
1960
- ps({
1961
- toolbarContents: () => /* @__PURE__ */ x(vs, { options: ["rich-text", "source"], children: [
1962
- /* @__PURE__ */ h(Is, {}),
1963
- /* @__PURE__ */ h(Ke, {}),
1964
+ ms({
1965
+ toolbarContents: () => /* @__PURE__ */ x(Is, { options: ["rich-text", "source"], children: [
1964
1966
  /* @__PURE__ */ h(As, {}),
1965
- /* @__PURE__ */ h(Es, {}),
1966
1967
  /* @__PURE__ */ h(Ke, {}),
1968
+ /* @__PURE__ */ h(Es, {}),
1967
1969
  /* @__PURE__ */ h(Rs, {}),
1968
1970
  /* @__PURE__ */ h(Ke, {}),
1969
1971
  /* @__PURE__ */ h(Ps, {}),
1970
1972
  /* @__PURE__ */ h(Ke, {}),
1971
1973
  /* @__PURE__ */ h(zs, {}),
1972
- /* @__PURE__ */ h(Bs, {}),
1973
1974
  /* @__PURE__ */ h(Ke, {}),
1975
+ /* @__PURE__ */ h(Bs, {}),
1974
1976
  /* @__PURE__ */ h(Ls, {}),
1975
- /* @__PURE__ */ h(Vs, {}),
1976
1977
  /* @__PURE__ */ h(Ke, {}),
1978
+ /* @__PURE__ */ h(Vs, {}),
1977
1979
  /* @__PURE__ */ h(Fs, {}),
1978
1980
  /* @__PURE__ */ h(Ke, {}),
1979
- /* @__PURE__ */ h($s, {})
1981
+ /* @__PURE__ */ h($s, {}),
1982
+ /* @__PURE__ */ h(Ke, {}),
1983
+ /* @__PURE__ */ h(Hs, {})
1980
1984
  ] })
1981
1985
  }),
1982
- ms(d),
1983
- gs(),
1986
+ gs(d),
1984
1987
  bs(),
1985
- ys(u),
1986
- ks(f),
1987
- xs(),
1988
- Cs(c),
1989
- Ss(),
1988
+ ys(),
1989
+ ks(u),
1990
+ xs(f),
1991
+ Cs(),
1992
+ Ss(c),
1990
1993
  Ns(),
1991
1994
  Ts(),
1992
- ws(m),
1993
- Ds(p),
1994
- Ms(),
1995
- Os(b)
1995
+ ws(),
1996
+ Ds(m),
1997
+ Ms(p),
1998
+ Os(),
1999
+ vs(b)
1996
2000
  ],
1997
2001
  ...l
1998
2002
  }
1999
2003
  );
2000
- }, Ca = {
2004
+ }, Sa = {
2001
2005
  'code[class*="language-"]': {
2002
2006
  background: "hsl(230, 1%, 98%)",
2003
2007
  color: "hsl(230, 8%, 24%)",
@@ -2485,7 +2489,7 @@ const Nr = Qo({
2485
2489
  ".prism-previewer-easing.prism-previewer-easing line": {
2486
2490
  stroke: "hsl(230, 8%, 24%)"
2487
2491
  }
2488
- }, Sa = (n) => {
2492
+ }, Na = (n) => {
2489
2493
  const { children: e = "", className: t, theme: o = "auto", imageProps: r } = n;
2490
2494
  return /* @__PURE__ */ h(
2491
2495
  "div",
@@ -2495,39 +2499,39 @@ const Nr = Qo({
2495
2499
  pr,
2496
2500
  {
2497
2501
  className: D(wr, t),
2498
- remarkPlugins: [Hs, qs],
2499
- rehypePlugins: [Ws],
2502
+ remarkPlugins: [qs, Ws],
2503
+ rehypePlugins: [Js],
2500
2504
  components: {
2501
2505
  code(i) {
2502
2506
  const { children: s, className: l, node: a, ref: c, ...d } = i, u = /language-(\w+)/.exec(l || "");
2503
2507
  return u ? /* @__PURE__ */ h(
2504
- Js,
2508
+ Ks,
2505
2509
  {
2506
2510
  ...d,
2507
2511
  PreTag: "div",
2508
2512
  children: String(s).replace(/\n$/, ""),
2509
2513
  language: u[1],
2510
- style: Ca
2514
+ style: Sa
2511
2515
  }
2512
2516
  ) : /* @__PURE__ */ h("code", { ...d, className: l, children: s });
2513
2517
  },
2514
2518
  img(i) {
2515
2519
  const { preview: s, ...l } = r ?? {};
2516
2520
  return /* @__PURE__ */ h(
2517
- Ks,
2521
+ Us,
2518
2522
  {
2519
2523
  ...i,
2520
2524
  preview: s instanceof Boolean ? s : {
2521
2525
  icons: {
2522
- rotateLeft: /* @__PURE__ */ h(ns, {}),
2523
- rotateRight: /* @__PURE__ */ h(ts, {}),
2524
- zoomIn: /* @__PURE__ */ h(es, {}),
2525
- zoomOut: /* @__PURE__ */ h(Qi, {}),
2526
- close: /* @__PURE__ */ h(Zi, {}),
2527
- left: /* @__PURE__ */ h(_i, {}),
2528
- right: /* @__PURE__ */ h(Xi, {}),
2529
- flipX: /* @__PURE__ */ h(Gi, {}),
2530
- flipY: /* @__PURE__ */ h(Yi, {})
2526
+ rotateLeft: /* @__PURE__ */ h(os, {}),
2527
+ rotateRight: /* @__PURE__ */ h(ns, {}),
2528
+ zoomIn: /* @__PURE__ */ h(ts, {}),
2529
+ zoomOut: /* @__PURE__ */ h(es, {}),
2530
+ close: /* @__PURE__ */ h(Qi, {}),
2531
+ left: /* @__PURE__ */ h(Zi, {}),
2532
+ right: /* @__PURE__ */ h(_i, {}),
2533
+ flipX: /* @__PURE__ */ h(Xi, {}),
2534
+ flipY: /* @__PURE__ */ h(Gi, {})
2531
2535
  },
2532
2536
  zIndex: 9999,
2533
2537
  mask: " ",
@@ -2546,12 +2550,12 @@ const Nr = Qo({
2546
2550
  )
2547
2551
  }
2548
2552
  );
2549
- }, Na = xa;
2550
- Na.Preview = Sa;
2553
+ }, Ta = Ca;
2554
+ Ta.Preview = Na;
2551
2555
  function Or(...n) {
2552
- return js(Us(n));
2556
+ return Ys(js(n));
2553
2557
  }
2554
- const Ta = (n) => {
2558
+ const wa = (n) => {
2555
2559
  const { mouseX: e, title: t, icon: o, href: r } = n, i = mt(null), s = kt(e, (y) => {
2556
2560
  var O;
2557
2561
  const C = ((O = i.current) == null ? void 0 : O.getBoundingClientRect()) ?? { x: 0, width: 0 };
@@ -2612,7 +2616,7 @@ const Ta = (n) => {
2612
2616
  }
2613
2617
  ) });
2614
2618
  }, vr = (n) => {
2615
- const { items: e, className: t } = n, o = Hi(1 / 0);
2619
+ const { items: e, className: t } = n, o = qi(1 / 0);
2616
2620
  return /* @__PURE__ */ h(
2617
2621
  B.div,
2618
2622
  {
@@ -2622,7 +2626,7 @@ const Ta = (n) => {
2622
2626
  "mx-auto hidden md:flex h-16 gap-4 items-end rounded-2xl bg-gray-50 dark:bg-neutral-900 px-4 pb-3",
2623
2627
  t
2624
2628
  ),
2625
- children: e.map((r) => /* @__PURE__ */ h(Ta, { mouseX: o, ...r }, r.title))
2629
+ children: e.map((r) => /* @__PURE__ */ h(wa, { mouseX: o, ...r }, r.title))
2626
2630
  }
2627
2631
  );
2628
2632
  }, Ir = (n) => {
@@ -2678,13 +2682,13 @@ const Ta = (n) => {
2678
2682
  {
2679
2683
  onClick: l,
2680
2684
  className: "h-10 w-10 rounded-full bg-gray-50 dark:bg-neutral-800 flex items-center justify-center",
2681
- children: o || /* @__PURE__ */ h(os, { className: "h-5 w-5 text-neutral-500 dark:text-neutral-400" })
2685
+ children: o || /* @__PURE__ */ h(rs, { className: "h-5 w-5 text-neutral-500 dark:text-neutral-400" })
2682
2686
  }
2683
2687
  )
2684
2688
  ]
2685
2689
  }
2686
2690
  );
2687
- }, wa = (n) => {
2691
+ }, Da = (n) => {
2688
2692
  const { items: e, desktopClassName: t, mobileClassName: o, ...r } = n;
2689
2693
  return /* @__PURE__ */ x(rt, { children: [
2690
2694
  /* @__PURE__ */ h(vr, { items: e, className: t, ...r }),
@@ -2698,7 +2702,7 @@ const Ta = (n) => {
2698
2702
  }
2699
2703
  )
2700
2704
  ] });
2701
- }, Ar = wa;
2705
+ }, Ar = Da;
2702
2706
  Ar.Desktop = vr;
2703
2707
  Ar.Mobile = Ir;
2704
2708
  function Er(n, e, t) {
@@ -3137,7 +3141,7 @@ class ue {
3137
3141
  }
3138
3142
  }
3139
3143
  ue.none = [];
3140
- class Da extends Error {
3144
+ class Ma extends Error {
3141
3145
  }
3142
3146
  class E {
3143
3147
  /**
@@ -3238,10 +3242,10 @@ function zr(n, e, t, o) {
3238
3242
  let l = zr(s.content, e - i - 1, t);
3239
3243
  return l && n.replaceChild(r, s.copy(l));
3240
3244
  }
3241
- function Ma(n) {
3245
+ function Oa(n) {
3242
3246
  return n.tag != null;
3243
3247
  }
3244
- function Oa(n) {
3248
+ function va(n) {
3245
3249
  return n.style != null;
3246
3250
  }
3247
3251
  let Br = class Nn {
@@ -3253,9 +3257,9 @@ let Br = class Nn {
3253
3257
  this.schema = e, this.rules = t, this.tags = [], this.styles = [];
3254
3258
  let o = this.matchedStyles = [];
3255
3259
  t.forEach((r) => {
3256
- if (Ma(r))
3260
+ if (Oa(r))
3257
3261
  this.tags.push(r);
3258
- else if (Oa(r)) {
3262
+ else if (va(r)) {
3259
3263
  let i = /[^=]*/.exec(r.style)[0];
3260
3264
  o.indexOf(i) < 0 && o.push(i), this.styles.push(r);
3261
3265
  }
@@ -3291,7 +3295,7 @@ let Br = class Nn {
3291
3295
  matchTag(e, t, o) {
3292
3296
  for (let r = o ? this.tags.indexOf(o) + 1 : 0; r < this.tags.length; r++) {
3293
3297
  let i = this.tags[r];
3294
- if (Aa(e, i.tag) && (i.namespace === void 0 || e.namespaceURI == i.namespace) && (!i.context || t.matchesContext(i.context))) {
3298
+ if (Ea(e, i.tag) && (i.namespace === void 0 || e.namespaceURI == i.namespace) && (!i.context || t.matchesContext(i.context))) {
3295
3299
  if (i.getAttrs) {
3296
3300
  let s = i.getAttrs(e);
3297
3301
  if (s === !1)
@@ -3392,7 +3396,7 @@ const Lr = {
3392
3396
  table: !0,
3393
3397
  tfoot: !0,
3394
3398
  ul: !0
3395
- }, va = {
3399
+ }, Ia = {
3396
3400
  head: !0,
3397
3401
  noscript: !0,
3398
3402
  object: !0,
@@ -3471,9 +3475,9 @@ class ro {
3471
3475
  let r = this.localPreserveWS, i = this.top;
3472
3476
  (e.tagName == "PRE" || /pre/.test(e.style && e.style.whiteSpace)) && (this.localPreserveWS = !0);
3473
3477
  let s = e.nodeName.toLowerCase(), l;
3474
- Vr.hasOwnProperty(s) && this.parser.normalizeLists && Ia(e);
3478
+ Vr.hasOwnProperty(s) && this.parser.normalizeLists && Aa(e);
3475
3479
  let a = this.options.ruleFromNode && this.options.ruleFromNode(e) || (l = this.parser.matchTag(e, this, o));
3476
- e: if (a ? a.ignore : va.hasOwnProperty(s))
3480
+ e: if (a ? a.ignore : Ia.hasOwnProperty(s))
3477
3481
  this.findInside(e), this.ignoreFallback(e, t);
3478
3482
  else if (!a || a.skip || a.closeParent) {
3479
3483
  a && a.closeParent ? this.open = Math.max(0, this.open - 1) : a && a.skip.nodeType && (e = a.skip);
@@ -3705,13 +3709,13 @@ class ro {
3705
3709
  }
3706
3710
  }
3707
3711
  }
3708
- function Ia(n) {
3712
+ function Aa(n) {
3709
3713
  for (let e = n.firstChild, t = null; e; e = e.nextSibling) {
3710
3714
  let o = e.nodeType == 1 ? e.nodeName.toLowerCase() : null;
3711
3715
  o && Vr.hasOwnProperty(o) && t ? (t.appendChild(e), e = t) : o == "li" ? t = e : o && (t = null);
3712
3716
  }
3713
3717
  }
3714
- function Aa(n, e) {
3718
+ function Ea(n, e) {
3715
3719
  return (n.matches || n.msMatchesSelector || n.webkitMatchesSelector || n.mozMatchesSelector).call(n, e);
3716
3720
  }
3717
3721
  function io(n) {
@@ -3854,11 +3858,11 @@ function hn(n) {
3854
3858
  return n.document || window.document;
3855
3859
  }
3856
3860
  const ao = /* @__PURE__ */ new WeakMap();
3857
- function Ea(n) {
3861
+ function Ra(n) {
3858
3862
  let e = ao.get(n);
3859
- return e === void 0 && ao.set(n, e = Ra(n)), e;
3863
+ return e === void 0 && ao.set(n, e = Pa(n)), e;
3860
3864
  }
3861
- function Ra(n) {
3865
+ function Pa(n) {
3862
3866
  let e = null;
3863
3867
  function t(o) {
3864
3868
  if (o && typeof o == "object")
@@ -3884,7 +3888,7 @@ function Yt(n, e, t, o) {
3884
3888
  let r = e[0], i;
3885
3889
  if (typeof r != "string")
3886
3890
  throw new RangeError("Invalid array passed to renderSpec");
3887
- if (o && (i = Ea(o)) && i.indexOf(e) > -1)
3891
+ if (o && (i = Ra(o)) && i.indexOf(e) > -1)
3888
3892
  throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");
3889
3893
  let s = r.indexOf(" ");
3890
3894
  s > 0 && (t = r.slice(0, s), r = r.slice(s + 1));
@@ -3915,13 +3919,13 @@ function Yt(n, e, t, o) {
3915
3919
  return { dom: a, contentDOM: l };
3916
3920
  }
3917
3921
  const Fr = 65535, $r = Math.pow(2, 16);
3918
- function Pa(n, e) {
3922
+ function za(n, e) {
3919
3923
  return n + e * $r;
3920
3924
  }
3921
3925
  function co(n) {
3922
3926
  return n & Fr;
3923
3927
  }
3924
- function za(n) {
3928
+ function Ba(n) {
3925
3929
  return (n - (n & Fr)) / $r;
3926
3930
  }
3927
3931
  const Hr = 1, qr = 2, Gt = 4, Wr = 8;
@@ -3979,7 +3983,7 @@ class he {
3979
3983
  if (!this.inverted)
3980
3984
  for (let r = 0; r < o; r++)
3981
3985
  t += this.ranges[r * 3 + 2] - this.ranges[r * 3 + 1];
3982
- return this.ranges[o * 3] + t + za(e);
3986
+ return this.ranges[o * 3] + t + Ba(e);
3983
3987
  }
3984
3988
  mapResult(e, t = 1) {
3985
3989
  return this._map(e, t, !1);
@@ -4001,7 +4005,7 @@ class he {
4001
4005
  let f = c ? e == a ? -1 : e == u ? 1 : t : t, m = a + r + (f < 0 ? 0 : d);
4002
4006
  if (o)
4003
4007
  return m;
4004
- let p = e == (t < 0 ? a : u) ? null : Pa(l / 3, e - a), b = e == a ? qr : e == u ? Hr : Gt;
4008
+ let p = e == (t < 0 ? a : u) ? null : za(l / 3, e - a), b = e == a ? qr : e == u ? Hr : Gt;
4005
4009
  return (t < 0 ? e != a : e != u) && (b |= Wr), new uo(m, b, p);
4006
4010
  }
4007
4011
  r += d - c;
@@ -4128,7 +4132,7 @@ class j {
4128
4132
  try {
4129
4133
  return j.ok(e.replace(t, o, r));
4130
4134
  } catch (i) {
4131
- if (i instanceof Da)
4135
+ if (i instanceof Ma)
4132
4136
  return j.fail(i.message);
4133
4137
  throw i;
4134
4138
  }
@@ -4423,7 +4427,7 @@ function wn(n, e, t) {
4423
4427
  }
4424
4428
  return !1;
4425
4429
  }
4426
- function Ba(n, e, t) {
4430
+ function La(n, e, t) {
4427
4431
  let o = n.resolve(e);
4428
4432
  if (!t.content.size)
4429
4433
  return e;
@@ -4533,7 +4537,7 @@ class q {
4533
4537
  `$head`.
4534
4538
  */
4535
4539
  constructor(e, t, o) {
4536
- this.$anchor = e, this.$head = t, this.ranges = o || [new La(e.min(t), e.max(t))];
4540
+ this.$anchor = e, this.$head = t, this.ranges = o || [new Va(e.min(t), e.max(t))];
4537
4541
  }
4538
4542
  /**
4539
4543
  The selection's anchor, as an unresolved position.
@@ -4636,7 +4640,7 @@ class q {
4636
4640
  negative, it will search backwards first.
4637
4641
  */
4638
4642
  static near(e, t = 1) {
4639
- return this.findFrom(e, t) || this.findFrom(e, -t) || new Ne(e.node(0));
4643
+ return this.findFrom(e, t) || this.findFrom(e, -t) || new Te(e.node(0));
4640
4644
  }
4641
4645
  /**
4642
4646
  Find the cursor or leaf node selection closest to the start of
@@ -4645,14 +4649,14 @@ class q {
4645
4649
  exists.
4646
4650
  */
4647
4651
  static atStart(e) {
4648
- return at(e, e, 0, 0, 1) || new Ne(e);
4652
+ return at(e, e, 0, 0, 1) || new Te(e);
4649
4653
  }
4650
4654
  /**
4651
4655
  Find the cursor or leaf node selection closest to the end of the
4652
4656
  given document.
4653
4657
  */
4654
4658
  static atEnd(e) {
4655
- return at(e, e, e.content.size, e.childCount, -1) || new Ne(e);
4659
+ return at(e, e, e.content.size, e.childCount, -1) || new Te(e);
4656
4660
  }
4657
4661
  /**
4658
4662
  Deserialize the JSON representation of a selection. Must be
@@ -4691,7 +4695,7 @@ class q {
4691
4695
  }
4692
4696
  }
4693
4697
  q.prototype.visible = !0;
4694
- class La {
4698
+ class Va {
4695
4699
  /**
4696
4700
  Create a range.
4697
4701
  */
@@ -4848,7 +4852,7 @@ class qn {
4848
4852
  return o && T.isSelectable(o) ? new T(t) : q.near(t);
4849
4853
  }
4850
4854
  }
4851
- class Ne extends q {
4855
+ class Te extends q {
4852
4856
  /**
4853
4857
  Create an all-selection over the given document.
4854
4858
  */
@@ -4870,25 +4874,25 @@ class Ne extends q {
4870
4874
  @internal
4871
4875
  */
4872
4876
  static fromJSON(e) {
4873
- return new Ne(e);
4877
+ return new Te(e);
4874
4878
  }
4875
4879
  map(e) {
4876
- return new Ne(e);
4880
+ return new Te(e);
4877
4881
  }
4878
4882
  eq(e) {
4879
- return e instanceof Ne;
4883
+ return e instanceof Te;
4880
4884
  }
4881
4885
  getBookmark() {
4882
- return Va;
4886
+ return Fa;
4883
4887
  }
4884
4888
  }
4885
- q.jsonID("all", Ne);
4886
- const Va = {
4889
+ q.jsonID("all", Te);
4890
+ const Fa = {
4887
4891
  map() {
4888
4892
  return this;
4889
4893
  },
4890
4894
  resolve(n) {
4891
- return new Ne(n);
4895
+ return new Te(n);
4892
4896
  }
4893
4897
  };
4894
4898
  function at(n, e, t, o, r, i = !1) {
@@ -4964,7 +4968,7 @@ function Jr(n, e, t) {
4964
4968
  }
4965
4969
  return t;
4966
4970
  }
4967
- class Fa {
4971
+ class $a {
4968
4972
  /**
4969
4973
  Create a plugin.
4970
4974
  */
@@ -4982,7 +4986,7 @@ const mn = /* @__PURE__ */ Object.create(null);
4982
4986
  function Kr(n) {
4983
4987
  return n in mn ? n + "$" + ++mn[n] : (mn[n] = 0, n + "$");
4984
4988
  }
4985
- class $a {
4989
+ class Ha {
4986
4990
  /**
4987
4991
  Create a plugin key.
4988
4992
  */
@@ -5015,18 +5019,18 @@ let Dn = null;
5015
5019
  const Ae = function(n, e, t) {
5016
5020
  let o = Dn || (Dn = document.createRange());
5017
5021
  return o.setEnd(n, t ?? n.nodeValue.length), o.setStart(n, e || 0), o;
5018
- }, Ha = function() {
5022
+ }, qa = function() {
5019
5023
  Dn = null;
5020
5024
  }, tt = function(n, e, t, o) {
5021
5025
  return t && (go(n, e, t, o, -1) || go(n, e, t, o, 1));
5022
- }, qa = /^(img|br|input|textarea|hr)$/i;
5026
+ }, Wa = /^(img|br|input|textarea|hr)$/i;
5023
5027
  function go(n, e, t, o, r) {
5024
5028
  for (; ; ) {
5025
5029
  if (n == t && e == o)
5026
5030
  return !0;
5027
5031
  if (e == (r < 0 ? 0 : pe(n))) {
5028
5032
  let i = n.parentNode;
5029
- if (!i || i.nodeType != 1 || Bt(n) || qa.test(n.nodeName) || n.contentEditable == "false")
5033
+ if (!i || i.nodeType != 1 || Bt(n) || Wa.test(n.nodeName) || n.contentEditable == "false")
5030
5034
  return !1;
5031
5035
  e = Z(n) + (r < 0 ? 0 : 1), n = i;
5032
5036
  } else if (n.nodeType == 1) {
@@ -5040,7 +5044,7 @@ function go(n, e, t, o, r) {
5040
5044
  function pe(n) {
5041
5045
  return n.nodeType == 3 ? n.nodeValue.length : n.childNodes.length;
5042
5046
  }
5043
- function Wa(n, e) {
5047
+ function Ja(n, e) {
5044
5048
  for (; ; ) {
5045
5049
  if (n.nodeType == 3 && e)
5046
5050
  return n;
@@ -5054,7 +5058,7 @@ function Wa(n, e) {
5054
5058
  return null;
5055
5059
  }
5056
5060
  }
5057
- function Ja(n, e) {
5061
+ function Ka(n, e) {
5058
5062
  for (; ; ) {
5059
5063
  if (n.nodeType == 3 && e < n.nodeValue.length)
5060
5064
  return n;
@@ -5068,7 +5072,7 @@ function Ja(n, e) {
5068
5072
  return null;
5069
5073
  }
5070
5074
  }
5071
- function Ka(n, e, t) {
5075
+ function Ua(n, e, t) {
5072
5076
  for (let o = e == 0, r = e == pe(n); o || r; ) {
5073
5077
  if (n == t)
5074
5078
  return !0;
@@ -5091,13 +5095,13 @@ function Ue(n, e) {
5091
5095
  let t = document.createEvent("Event");
5092
5096
  return t.initEvent("keydown", !0, !0), t.keyCode = n, t.key = t.code = e, t;
5093
5097
  }
5094
- function Ua(n) {
5098
+ function ja(n) {
5095
5099
  let e = n.activeElement;
5096
5100
  for (; e && e.shadowRoot; )
5097
5101
  e = e.shadowRoot.activeElement;
5098
5102
  return e;
5099
5103
  }
5100
- function ja(n, e, t) {
5104
+ function Ya(n, e, t) {
5101
5105
  if (n.caretPositionFromPoint)
5102
5106
  try {
5103
5107
  let o = n.caretPositionFromPoint(e, t);
@@ -5111,10 +5115,10 @@ function ja(n, e, t) {
5111
5115
  return { node: o.startContainer, offset: Math.min(pe(o.startContainer), o.startOffset) };
5112
5116
  }
5113
5117
  }
5114
- const we = typeof navigator < "u" ? navigator : null, bo = typeof document < "u" ? document : null, Je = we && we.userAgent || "", Mn = /Edge\/(\d+)/.exec(Je), Ur = /MSIE \d/.exec(Je), On = /Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Je), ae = !!(Ur || On || Mn), He = Ur ? document.documentMode : On ? +On[1] : Mn ? +Mn[1] : 0, ke = !ae && /gecko\/(\d+)/i.test(Je);
5118
+ const De = typeof navigator < "u" ? navigator : null, bo = typeof document < "u" ? document : null, Je = De && De.userAgent || "", Mn = /Edge\/(\d+)/.exec(Je), Ur = /MSIE \d/.exec(Je), On = /Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Je), ae = !!(Ur || On || Mn), He = Ur ? document.documentMode : On ? +On[1] : Mn ? +Mn[1] : 0, ke = !ae && /gecko\/(\d+)/i.test(Je);
5115
5119
  ke && +(/Firefox\/(\d+)/.exec(Je) || [0, 0])[1];
5116
- const vn = !ae && /Chrome\/(\d+)/.exec(Je), te = !!vn, jr = vn ? +vn[1] : 0, re = !ae && !!we && /Apple Computer/.test(we.vendor), gt = re && (/Mobile\/\w+/.test(Je) || !!we && we.maxTouchPoints > 2), fe = gt || (we ? /Mac/.test(we.platform) : !1), Ya = we ? /Win/.test(we.platform) : !1, Re = /Android \d/.test(Je), Lt = !!bo && "webkitFontSmoothing" in bo.documentElement.style, Ga = Lt ? +(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent) || [0, 0])[1] : 0;
5117
- function Xa(n) {
5120
+ const vn = !ae && /Chrome\/(\d+)/.exec(Je), te = !!vn, jr = vn ? +vn[1] : 0, re = !ae && !!De && /Apple Computer/.test(De.vendor), gt = re && (/Mobile\/\w+/.test(Je) || !!De && De.maxTouchPoints > 2), fe = gt || (De ? /Mac/.test(De.platform) : !1), Ga = De ? /Win/.test(De.platform) : !1, Re = /Android \d/.test(Je), Lt = !!bo && "webkitFontSmoothing" in bo.documentElement.style, Xa = Lt ? +(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent) || [0, 0])[1] : 0;
5121
+ function _a(n) {
5118
5122
  let e = n.defaultView && n.defaultView.visualViewport;
5119
5123
  return e ? {
5120
5124
  left: 0,
@@ -5131,7 +5135,7 @@ function Xa(n) {
5131
5135
  function Ie(n, e) {
5132
5136
  return typeof n == "number" ? n : n[e];
5133
5137
  }
5134
- function _a(n) {
5138
+ function Za(n) {
5135
5139
  let e = n.getBoundingClientRect(), t = e.width / n.offsetWidth || 1, o = e.height / n.offsetHeight || 1;
5136
5140
  return {
5137
5141
  left: e.left,
@@ -5145,7 +5149,7 @@ function yo(n, e, t) {
5145
5149
  for (let s = t || n.dom; s; s = It(s)) {
5146
5150
  if (s.nodeType != 1)
5147
5151
  continue;
5148
- let l = s, a = l == i.body, c = a ? Xa(i) : _a(l), d = 0, u = 0;
5152
+ let l = s, a = l == i.body, c = a ? _a(i) : Za(l), d = 0, u = 0;
5149
5153
  if (e.top < c.top + Ie(o, "top") ? u = -(c.top - e.top + Ie(r, "top")) : e.bottom > c.bottom - Ie(o, "bottom") && (u = e.bottom - e.top > c.bottom - c.top ? e.top + Ie(r, "top") - c.top : e.bottom - c.bottom + Ie(r, "bottom")), e.left < c.left + Ie(o, "left") ? d = -(c.left - e.left + Ie(r, "left")) : e.right > c.right - Ie(o, "right") && (d = e.right - c.right + Ie(r, "right")), d || u)
5150
5154
  if (a)
5151
5155
  i.defaultView.scrollBy(d, u);
@@ -5159,7 +5163,7 @@ function yo(n, e, t) {
5159
5163
  break;
5160
5164
  }
5161
5165
  }
5162
- function Za(n) {
5166
+ function Qa(n) {
5163
5167
  let e = n.dom.getBoundingClientRect(), t = Math.max(0, e.top), o, r;
5164
5168
  for (let i = (e.left + e.right) / 2, s = t + 1; s < Math.min(innerHeight, e.bottom); s += 5) {
5165
5169
  let l = n.root.elementFromPoint(i, s);
@@ -5179,7 +5183,7 @@ function Yr(n) {
5179
5183
  ;
5180
5184
  return e;
5181
5185
  }
5182
- function Qa({ refDOM: n, refTop: e, stack: t }) {
5186
+ function ec({ refDOM: n, refTop: e, stack: t }) {
5183
5187
  let o = n ? n.getBoundingClientRect().top : 0;
5184
5188
  Gr(t, o == 0 ? 0 : o - e);
5185
5189
  }
@@ -5190,7 +5194,7 @@ function Gr(n, e) {
5190
5194
  }
5191
5195
  }
5192
5196
  let st = null;
5193
- function ec(n) {
5197
+ function tc(n) {
5194
5198
  if (n.setActive)
5195
5199
  return n.setActive();
5196
5200
  if (st)
@@ -5228,9 +5232,9 @@ function Xr(n, e) {
5228
5232
  !t && (e.left >= p.right && e.top >= p.top || e.left >= p.left && e.top >= p.bottom) && (i = u + 1);
5229
5233
  }
5230
5234
  }
5231
- return !t && a && (t = a, r = c, o = 0), t && t.nodeType == 3 ? tc(t, r) : !t || o && t.nodeType == 1 ? { node: n, offset: i } : Xr(t, r);
5235
+ return !t && a && (t = a, r = c, o = 0), t && t.nodeType == 3 ? nc(t, r) : !t || o && t.nodeType == 1 ? { node: n, offset: i } : Xr(t, r);
5232
5236
  }
5233
- function tc(n, e) {
5237
+ function nc(n, e) {
5234
5238
  let t = n.nodeValue.length, o = document.createRange();
5235
5239
  for (let r = 0; r < t; r++) {
5236
5240
  o.setEnd(n, r + 1), o.setStart(n, r);
@@ -5243,11 +5247,11 @@ function tc(n, e) {
5243
5247
  function Wn(n, e) {
5244
5248
  return n.left >= e.left - 1 && n.left <= e.right + 1 && n.top >= e.top - 1 && n.top <= e.bottom + 1;
5245
5249
  }
5246
- function nc(n, e) {
5250
+ function oc(n, e) {
5247
5251
  let t = n.parentNode;
5248
5252
  return t && /^li$/i.test(t.nodeName) && e.left < n.getBoundingClientRect().left ? t : n;
5249
5253
  }
5250
- function oc(n, e, t) {
5254
+ function rc(n, e, t) {
5251
5255
  let { node: o, offset: r } = Xr(e, t), i = -1;
5252
5256
  if (o.nodeType == 1 && !o.firstChild) {
5253
5257
  let s = o.getBoundingClientRect();
@@ -5255,7 +5259,7 @@ function oc(n, e, t) {
5255
5259
  }
5256
5260
  return n.docView.posFromDOM(o, r, i);
5257
5261
  }
5258
- function rc(n, e, t, o) {
5262
+ function ic(n, e, t, o) {
5259
5263
  let r = -1;
5260
5264
  for (let i = e, s = !1; i != n.dom; ) {
5261
5265
  let l = n.docView.nearestDesc(i, !0), a;
@@ -5286,8 +5290,8 @@ function _r(n, e, t) {
5286
5290
  }
5287
5291
  return n;
5288
5292
  }
5289
- function ic(n, e) {
5290
- let t = n.dom.ownerDocument, o, r = 0, i = ja(t, e.left, e.top);
5293
+ function sc(n, e) {
5294
+ let t = n.dom.ownerDocument, o, r = 0, i = Ya(t, e.left, e.top);
5291
5295
  i && ({ node: o, offset: r } = i);
5292
5296
  let s = (n.root.elementFromPoint ? n.root : t).elementFromPoint(e.left, e.top), l;
5293
5297
  if (!s || !n.dom.contains(s.nodeType != 1 ? s.parentNode : s)) {
@@ -5298,15 +5302,15 @@ function ic(n, e) {
5298
5302
  if (re)
5299
5303
  for (let c = s; o && c; c = It(c))
5300
5304
  c.draggable && (o = void 0);
5301
- if (s = nc(s, e), o) {
5305
+ if (s = oc(s, e), o) {
5302
5306
  if (ke && o.nodeType == 1 && (r = Math.min(r, o.childNodes.length), r < o.childNodes.length)) {
5303
5307
  let d = o.childNodes[r], u;
5304
5308
  d.nodeName == "IMG" && (u = d.getBoundingClientRect()).right <= e.left && u.bottom > e.top && r++;
5305
5309
  }
5306
5310
  let c;
5307
- Lt && r && o.nodeType == 1 && (c = o.childNodes[r - 1]).nodeType == 1 && c.contentEditable == "false" && c.getBoundingClientRect().top >= e.top && r--, o == n.dom && r == o.childNodes.length - 1 && o.lastChild.nodeType == 1 && e.top > o.lastChild.getBoundingClientRect().bottom ? l = n.state.doc.content.size : (r == 0 || o.nodeType != 1 || o.childNodes[r - 1].nodeName != "BR") && (l = rc(n, o, r, e));
5311
+ Lt && r && o.nodeType == 1 && (c = o.childNodes[r - 1]).nodeType == 1 && c.contentEditable == "false" && c.getBoundingClientRect().top >= e.top && r--, o == n.dom && r == o.childNodes.length - 1 && o.lastChild.nodeType == 1 && e.top > o.lastChild.getBoundingClientRect().bottom ? l = n.state.doc.content.size : (r == 0 || o.nodeType != 1 || o.childNodes[r - 1].nodeName != "BR") && (l = ic(n, o, r, e));
5308
5312
  }
5309
- l == null && (l = oc(n, s, e));
5313
+ l == null && (l = rc(n, s, e));
5310
5314
  let a = n.docView.nearestDesc(s, !0);
5311
5315
  return { pos: l, inside: a ? a.posAtStart - a.border : -1 };
5312
5316
  }
@@ -5322,11 +5326,11 @@ function Be(n, e) {
5322
5326
  }
5323
5327
  return Array.prototype.find.call(t, ko) || n.getBoundingClientRect();
5324
5328
  }
5325
- const sc = /[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;
5329
+ const lc = /[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;
5326
5330
  function Zr(n, e, t) {
5327
5331
  let { node: o, offset: r, atom: i } = n.docView.domFromPos(e, t < 0 ? -1 : 1), s = Lt || ke;
5328
5332
  if (o.nodeType == 3)
5329
- if (s && (sc.test(o.nodeValue) || (t < 0 ? !r : r == o.nodeValue.length))) {
5333
+ if (s && (lc.test(o.nodeValue) || (t < 0 ? !r : r == o.nodeValue.length))) {
5330
5334
  let a = Be(Ae(o, r, r), t);
5331
5335
  if (ke && r && /\s/.test(o.nodeValue[r - 1]) && r < o.nodeValue.length) {
5332
5336
  let c = Be(Ae(o, r - 1, r - 1), -1);
@@ -5390,7 +5394,7 @@ function Qr(n, e, t) {
5390
5394
  o != e && n.updateState(o), r != n.dom && r && r.focus();
5391
5395
  }
5392
5396
  }
5393
- function lc(n, e, t) {
5397
+ function ac(n, e, t) {
5394
5398
  let o = e.selection, r = t == "up" ? o.$from : o.$to;
5395
5399
  return Qr(n, e, () => {
5396
5400
  let { node: i } = n.docView.domFromPos(r.pos, t == "up" ? -1 : 1);
@@ -5422,13 +5426,13 @@ function lc(n, e, t) {
5422
5426
  return !0;
5423
5427
  });
5424
5428
  }
5425
- const ac = /[\u0590-\u08ac]/;
5426
- function cc(n, e, t) {
5429
+ const cc = /[\u0590-\u08ac]/;
5430
+ function dc(n, e, t) {
5427
5431
  let { $head: o } = e.selection;
5428
5432
  if (!o.parent.isTextblock)
5429
5433
  return !1;
5430
5434
  let r = o.parentOffset, i = !r, s = r == o.parent.content.size, l = n.domSelection();
5431
- return l ? !ac.test(o.parent.textContent) || !l.modify ? t == "left" || t == "backward" ? i : s : Qr(n, e, () => {
5435
+ return l ? !cc.test(o.parent.textContent) || !l.modify ? t == "left" || t == "backward" ? i : s : Qr(n, e, () => {
5432
5436
  let { focusNode: a, focusOffset: c, anchorNode: d, anchorOffset: u } = n.domSelectionRange(), f = l.caretBidiLevel;
5433
5437
  l.modify("move", t, "character");
5434
5438
  let m = o.depth ? n.docView.domAfterPos(o.before()) : n.dom, { focusNode: p, focusOffset: b } = n.domSelectionRange(), g = p && !m.contains(p.nodeType == 1 ? p : p.parentNode) || a == p && c == b;
@@ -5440,10 +5444,10 @@ function cc(n, e, t) {
5440
5444
  }) : o.pos == o.start() || o.pos == o.end();
5441
5445
  }
5442
5446
  let xo = null, Co = null, So = !1;
5443
- function dc(n, e, t) {
5444
- return xo == e && Co == t ? So : (xo = e, Co = t, So = t == "up" || t == "down" ? lc(n, e, t) : cc(n, e, t));
5447
+ function uc(n, e, t) {
5448
+ return xo == e && Co == t ? So : (xo = e, Co = t, So = t == "up" || t == "down" ? ac(n, e, t) : dc(n, e, t));
5445
5449
  }
5446
- const ge = 0, No = 1, Xe = 2, De = 3;
5450
+ const ge = 0, No = 1, Xe = 2, Me = 3;
5447
5451
  class Vt {
5448
5452
  constructor(e, t, o, r) {
5449
5453
  this.parent = e, this.children = t, this.dom = o, this.contentDOM = r, this.dirty = ge, o.pmViewDesc = this;
@@ -5759,10 +5763,10 @@ class Vt {
5759
5763
  if (o == s ? e <= s && t >= o : e < s && t > o) {
5760
5764
  let l = o + i.border, a = s - i.border;
5761
5765
  if (e >= l && t <= a) {
5762
- this.dirty = e == o || t == s ? Xe : No, e == l && t == a && (i.contentLost || i.dom.parentNode != this.contentDOM) ? i.dirty = De : i.markDirty(e - l, t - l);
5766
+ this.dirty = e == o || t == s ? Xe : No, e == l && t == a && (i.contentLost || i.dom.parentNode != this.contentDOM) ? i.dirty = Me : i.markDirty(e - l, t - l);
5763
5767
  return;
5764
5768
  } else
5765
- i.dirty = i.dom == i.contentDOM && i.dom.parentNode == this.contentDOM && !i.children.length ? Xe : De;
5769
+ i.dirty = i.dom == i.contentDOM && i.dom.parentNode == this.contentDOM && !i.children.length ? Xe : Me;
5766
5770
  }
5767
5771
  o = s;
5768
5772
  }
@@ -5825,7 +5829,7 @@ class ei extends Vt {
5825
5829
  return this.widget.type.side;
5826
5830
  }
5827
5831
  }
5828
- class uc extends Vt {
5832
+ class hc extends Vt {
5829
5833
  constructor(e, t, o, r) {
5830
5834
  super(e, [], t, null), this.textDOM = o, this.text = r;
5831
5835
  }
@@ -5851,10 +5855,10 @@ class nt extends Vt {
5851
5855
  return (!s || !s.dom) && (s = yt.renderSpec(document, t.type.spec.toDOM(t, o), null, t.attrs)), new nt(e, t, s.dom, s.contentDOM || s.dom, s);
5852
5856
  }
5853
5857
  parseRule() {
5854
- return this.dirty & De || this.mark.type.spec.reparseInView ? null : { mark: this.mark.type.name, attrs: this.mark.attrs, contentElement: this.contentDOM };
5858
+ return this.dirty & Me || this.mark.type.spec.reparseInView ? null : { mark: this.mark.type.name, attrs: this.mark.attrs, contentElement: this.contentDOM };
5855
5859
  }
5856
5860
  matchesMark(e) {
5857
- return this.dirty != De && this.mark.eq(e);
5861
+ return this.dirty != Me && this.mark.eq(e);
5858
5862
  }
5859
5863
  markDirty(e, t) {
5860
5864
  if (super.markDirty(e, t), this.dirty != ge) {
@@ -5906,7 +5910,7 @@ class qe extends Vt {
5906
5910
  } else d || ({ dom: d, contentDOM: u } = yt.renderSpec(document, t.type.spec.toDOM(t), null, t.attrs));
5907
5911
  !u && !t.isText && d.nodeName != "BR" && (d.hasAttribute("contenteditable") || (d.contentEditable = "false"), t.type.spec.draggable && (d.draggable = !0));
5908
5912
  let f = d;
5909
- return d = ri(d, o, t), c ? a = new hc(e, t, o, r, d, u || null, f, c, i, s + 1) : t.isText ? new rn(e, t, o, r, d, f, i) : new qe(e, t, o, r, d, u || null, f, i, s + 1);
5913
+ return d = ri(d, o, t), c ? a = new fc(e, t, o, r, d, u || null, f, c, i, s + 1) : t.isText ? new rn(e, t, o, r, d, f, i) : new qe(e, t, o, r, d, u || null, f, i, s + 1);
5910
5914
  }
5911
5915
  parseRule() {
5912
5916
  if (this.node.type.spec.reparseInView)
@@ -5942,14 +5946,14 @@ class qe extends Vt {
5942
5946
  // separate step, syncs the DOM inside `this.contentDOM` to
5943
5947
  // `this.children`.
5944
5948
  updateChildren(e, t) {
5945
- let o = this.node.inlineContent, r = t, i = e.composing ? this.localCompositionInfo(e, t) : null, s = i && i.pos > -1 ? i : null, l = i && i.pos < 0, a = new pc(this, s && s.node, e);
5946
- bc(this.node, this.innerDeco, (c, d, u) => {
5949
+ let o = this.node.inlineContent, r = t, i = e.composing ? this.localCompositionInfo(e, t) : null, s = i && i.pos > -1 ? i : null, l = i && i.pos < 0, a = new mc(this, s && s.node, e);
5950
+ yc(this.node, this.innerDeco, (c, d, u) => {
5947
5951
  c.spec.marks ? a.syncToMarks(c.spec.marks, o, e) : c.type.side >= 0 && !u && a.syncToMarks(d == this.node.childCount ? ue.none : this.node.child(d).marks, o, e), a.placeWidget(c, e, r);
5948
5952
  }, (c, d, u, f) => {
5949
5953
  a.syncToMarks(c.marks, o, e);
5950
5954
  let m;
5951
5955
  a.findNodeMatch(c, d, u, f) || l && e.state.selection.from > r && e.state.selection.to < r + c.nodeSize && (m = a.findIndexWithChild(i.node)) > -1 && a.updateNodeAt(c, d, u, m, e) || a.updateNextNode(c, d, u, e, f, r) || a.addNode(c, d, u, e, r), r += c.nodeSize;
5952
- }), a.syncToMarks([], o, e), this.node.isTextblock && a.addTextblockHacks(), a.destroyRest(), (a.changed || this.dirty == Xe) && (s && this.protectLocalComposition(e, s), ni(this.contentDOM, this.children, e), gt && yc(this.dom));
5956
+ }), a.syncToMarks([], o, e), this.node.isTextblock && a.addTextblockHacks(), a.destroyRest(), (a.changed || this.dirty == Xe) && (s && this.protectLocalComposition(e, s), ni(this.contentDOM, this.children, e), gt && kc(this.dom));
5953
5957
  }
5954
5958
  localCompositionInfo(e, t) {
5955
5959
  let { from: o, to: r } = e.state.selection;
@@ -5959,7 +5963,7 @@ class qe extends Vt {
5959
5963
  if (!i || !this.dom.contains(i.parentNode))
5960
5964
  return null;
5961
5965
  if (this.node.inlineContent) {
5962
- let s = i.nodeValue, l = kc(this.node.content, s, o - t, r - t);
5966
+ let s = i.nodeValue, l = xc(this.node.content, s, o - t, r - t);
5963
5967
  return l < 0 ? null : { node: i, pos: l, text: s };
5964
5968
  } else
5965
5969
  return { node: i, pos: -1, text: "" };
@@ -5975,13 +5979,13 @@ class qe extends Vt {
5975
5979
  i.parentNode.removeChild(i.nextSibling);
5976
5980
  i.pmViewDesc && (i.pmViewDesc = void 0);
5977
5981
  }
5978
- let s = new uc(this, i, t, r);
5982
+ let s = new hc(this, i, t, r);
5979
5983
  e.input.compositionNodes.push(s), this.children = An(this.children, o, o + r.length, e, s);
5980
5984
  }
5981
5985
  // If this desc must be updated to match the given node decoration,
5982
5986
  // do so and return true.
5983
5987
  update(e, t, o, r) {
5984
- return this.dirty == De || !e.sameMarkup(this.node) ? !1 : (this.updateInner(e, t, o, r), !0);
5988
+ return this.dirty == Me || !e.sameMarkup(this.node) ? !1 : (this.updateInner(e, t, o, r), !0);
5985
5989
  }
5986
5990
  updateInner(e, t, o, r) {
5987
5991
  this.updateOuterDeco(t), this.node = e, this.innerDeco = o, this.contentDOM && this.updateChildren(r, this.posAtStart), this.dirty = ge;
@@ -6020,7 +6024,7 @@ class rn extends qe {
6020
6024
  return { skip: e || !0 };
6021
6025
  }
6022
6026
  update(e, t, o, r) {
6023
- return this.dirty == De || this.dirty != ge && !this.inParent() || !e.sameMarkup(this.node) ? !1 : (this.updateOuterDeco(t), (this.dirty != ge || e.text != this.node.text) && e.text != this.nodeDOM.nodeValue && (this.nodeDOM.nodeValue = e.text, r.trackWrites == this.nodeDOM && (r.trackWrites = null)), this.node = e, this.dirty = ge, !0);
6027
+ return this.dirty == Me || this.dirty != ge && !this.inParent() || !e.sameMarkup(this.node) ? !1 : (this.updateOuterDeco(t), (this.dirty != ge || e.text != this.node.text) && e.text != this.nodeDOM.nodeValue && (this.nodeDOM.nodeValue = e.text, r.trackWrites == this.nodeDOM && (r.trackWrites = null)), this.node = e, this.dirty = ge, !0);
6024
6028
  }
6025
6029
  inParent() {
6026
6030
  let e = this.parent.contentDOM;
@@ -6043,7 +6047,7 @@ class rn extends qe {
6043
6047
  return new rn(this.parent, r, this.outerDeco, this.innerDeco, i, i, o);
6044
6048
  }
6045
6049
  markDirty(e, t) {
6046
- super.markDirty(e, t), this.dom != this.nodeDOM && (e == 0 || t == this.nodeDOM.nodeValue.length) && (this.dirty = De);
6050
+ super.markDirty(e, t), this.dom != this.nodeDOM && (e == 0 || t == this.nodeDOM.nodeValue.length) && (this.dirty = Me);
6047
6051
  }
6048
6052
  get domAtom() {
6049
6053
  return !1;
@@ -6066,7 +6070,7 @@ class ti extends Vt {
6066
6070
  return this.dom.nodeName == "IMG";
6067
6071
  }
6068
6072
  }
6069
- class hc extends qe {
6073
+ class fc extends qe {
6070
6074
  constructor(e, t, o, r, i, s, l, a, c, d) {
6071
6075
  super(e, t, o, r, i, s, l, c, d), this.spec = a;
6072
6076
  }
@@ -6074,7 +6078,7 @@ class hc extends qe {
6074
6078
  // through. If it does, and there's a `contentDOM` node, our logic
6075
6079
  // updates the children.
6076
6080
  update(e, t, o, r) {
6077
- if (this.dirty == De)
6081
+ if (this.dirty == Me)
6078
6082
  return !1;
6079
6083
  if (this.spec.update && (this.node.type == e.type || this.spec.multiType)) {
6080
6084
  let i = this.spec.update(e, t, o);
@@ -6150,11 +6154,11 @@ function oi(n, e, t, o) {
6150
6154
  let a;
6151
6155
  l && l.nodeName == s.nodeName && r != n && (a = r.parentNode) && a.nodeName.toLowerCase() == s.nodeName || (a = document.createElement(s.nodeName), a.pmIsDeco = !0, a.appendChild(r), l = _e[0]), r = a;
6152
6156
  }
6153
- fc(r, l || _e[0], s);
6157
+ pc(r, l || _e[0], s);
6154
6158
  }
6155
6159
  return r;
6156
6160
  }
6157
- function fc(n, e, t) {
6161
+ function pc(n, e, t) {
6158
6162
  for (let o in e)
6159
6163
  o != "class" && o != "style" && o != "nodeName" && !(o in t) && n.removeAttribute(o);
6160
6164
  for (let o in t)
@@ -6191,9 +6195,9 @@ function wo(n) {
6191
6195
  let e = n.nextSibling;
6192
6196
  return n.parentNode.removeChild(n), e;
6193
6197
  }
6194
- class pc {
6198
+ class mc {
6195
6199
  constructor(e, t, o) {
6196
- this.lock = t, this.view = o, this.index = 0, this.stack = [], this.changed = !1, this.top = e, this.preMatch = mc(e.node.content, e);
6200
+ this.lock = t, this.view = o, this.index = 0, this.stack = [], this.changed = !1, this.top = e, this.preMatch = gc(e.node.content, e);
6197
6201
  }
6198
6202
  // Destroy and remove the children between the given indices in
6199
6203
  // `this.top`.
@@ -6253,7 +6257,7 @@ class pc {
6253
6257
  }
6254
6258
  updateNodeAt(e, t, o, r, i) {
6255
6259
  let s = this.top.children[r];
6256
- return s.dirty == De && s.dom == s.contentDOM && (s.dirty = Xe), s.update(e, t, o, i) ? (this.destroyBetween(this.index, r), this.index++, !0) : !1;
6260
+ return s.dirty == Me && s.dom == s.contentDOM && (s.dirty = Xe), s.update(e, t, o, i) ? (this.destroyBetween(this.index, r), this.index++, !0) : !1;
6257
6261
  }
6258
6262
  findIndexWithChild(e) {
6259
6263
  for (; ; ) {
@@ -6281,7 +6285,7 @@ class pc {
6281
6285
  let c = this.preMatch.matched.get(a);
6282
6286
  if (c != null && c != i)
6283
6287
  return !1;
6284
- let d = a.dom, u, f = this.isLocked(d) && !(e.isText && a.node && a.node.isText && a.nodeDOM.nodeValue == e.text && a.dirty != De && Zt(t, a.outerDeco));
6288
+ let d = a.dom, u, f = this.isLocked(d) && !(e.isText && a.node && a.node.isText && a.nodeDOM.nodeValue == e.text && a.dirty != Me && Zt(t, a.outerDeco));
6285
6289
  if (!f && a.update(e, t, o, r))
6286
6290
  return this.destroyBetween(this.index, l), a.dom != d && (this.changed = !0), this.index++, !0;
6287
6291
  if (!f && (u = this.recreateWrapper(a, e, t, o, r, s)))
@@ -6341,7 +6345,7 @@ class pc {
6341
6345
  return this.lock && (e == this.lock || e.nodeType == 1 && e.contains(this.lock.parentNode));
6342
6346
  }
6343
6347
  }
6344
- function mc(n, e) {
6348
+ function gc(n, e) {
6345
6349
  let t = e, o = t.children.length, r = n.childCount, i = /* @__PURE__ */ new Map(), s = [];
6346
6350
  e: for (; r > 0; ) {
6347
6351
  let l;
@@ -6368,10 +6372,10 @@ function mc(n, e) {
6368
6372
  }
6369
6373
  return { index: r, matched: i, matches: s.reverse() };
6370
6374
  }
6371
- function gc(n, e) {
6375
+ function bc(n, e) {
6372
6376
  return n.type.side - e.type.side;
6373
6377
  }
6374
- function bc(n, e, t, o) {
6378
+ function yc(n, e, t, o) {
6375
6379
  let r = e.locals(n), i = 0;
6376
6380
  if (r.length == 0) {
6377
6381
  for (let c = 0; c < n.childCount; c++) {
@@ -6389,7 +6393,7 @@ function bc(n, e, t, o) {
6389
6393
  }
6390
6394
  if (d)
6391
6395
  if (u) {
6392
- u.sort(gc);
6396
+ u.sort(bc);
6393
6397
  for (let g = 0; g < u.length; g++)
6394
6398
  t(u[g], c, !!a);
6395
6399
  } else
@@ -6419,13 +6423,13 @@ function bc(n, e, t, o) {
6419
6423
  o(f, b, e.forChild(i, f), m), i = p;
6420
6424
  }
6421
6425
  }
6422
- function yc(n) {
6426
+ function kc(n) {
6423
6427
  if (n.nodeName == "UL" || n.nodeName == "OL") {
6424
6428
  let e = n.style.cssText;
6425
6429
  n.style.cssText = e + "; list-style: square !important", window.getComputedStyle(n).listStyle, n.style.cssText = e;
6426
6430
  }
6427
6431
  }
6428
- function kc(n, e, t, o) {
6432
+ function xc(n, e, t, o) {
6429
6433
  for (let r = 0, i = 0; r < n.childCount && i <= o; ) {
6430
6434
  let s = n.child(r++), l = i;
6431
6435
  if (i += s.nodeSize, !s.isText)
@@ -6469,7 +6473,7 @@ function Jn(n, e = null) {
6469
6473
  for (a = s; r && !r.node; )
6470
6474
  r = r.parent;
6471
6475
  let u = r.node;
6472
- if (r && u.isAtom && T.isSelectable(u) && r.parent && !(u.isInline && Ka(t.focusNode, t.focusOffset, r.dom))) {
6476
+ if (r && u.isAtom && T.isSelectable(u) && r.parent && !(u.isInline && Ua(t.focusNode, t.focusOffset, r.dom))) {
6473
6477
  let f = r.posBefore;
6474
6478
  c = new T(s == f ? l : o.resolve(f));
6475
6479
  }
@@ -6509,10 +6513,10 @@ function Pe(n, e = !1) {
6509
6513
  }
6510
6514
  }
6511
6515
  if (n.domObserver.disconnectSelection(), n.cursorWrapper)
6512
- Cc(n);
6516
+ Sc(n);
6513
6517
  else {
6514
6518
  let { anchor: o, head: r } = t, i, s;
6515
- Do && !(t instanceof $) && (t.$from.parent.inlineContent || (i = Mo(n, t.from)), !t.empty && !t.$from.parent.inlineContent && (s = Mo(n, t.to))), n.docView.setSelection(o, r, n, e), Do && (i && Oo(i), s && Oo(s)), t.visible ? n.dom.classList.remove("ProseMirror-hideselection") : (n.dom.classList.add("ProseMirror-hideselection"), "onselectionchange" in document && xc(n));
6519
+ Do && !(t instanceof $) && (t.$from.parent.inlineContent || (i = Mo(n, t.from)), !t.empty && !t.$from.parent.inlineContent && (s = Mo(n, t.to))), n.docView.setSelection(o, r, n, e), Do && (i && Oo(i), s && Oo(s)), t.visible ? n.dom.classList.remove("ProseMirror-hideselection") : (n.dom.classList.add("ProseMirror-hideselection"), "onselectionchange" in document && Cc(n));
6516
6520
  }
6517
6521
  n.domObserver.setCurSelection(), n.domObserver.connectSelection();
6518
6522
  }
@@ -6535,7 +6539,7 @@ function bn(n) {
6535
6539
  function Oo(n) {
6536
6540
  n.contentEditable = "false", n.wasDraggable && (n.draggable = !0, n.wasDraggable = null);
6537
6541
  }
6538
- function xc(n) {
6542
+ function Cc(n) {
6539
6543
  let e = n.dom.ownerDocument;
6540
6544
  e.removeEventListener("selectionchange", n.input.hideSelectionGuard);
6541
6545
  let t = n.domSelectionRange(), o = t.anchorNode, r = t.anchorOffset;
@@ -6545,7 +6549,7 @@ function xc(n) {
6545
6549
  }, 20));
6546
6550
  });
6547
6551
  }
6548
- function Cc(n) {
6552
+ function Sc(n) {
6549
6553
  let e = n.domSelection(), t = document.createRange();
6550
6554
  if (!e)
6551
6555
  return;
@@ -6578,7 +6582,7 @@ function li(n) {
6578
6582
  return !1;
6579
6583
  }
6580
6584
  }
6581
- function Sc(n) {
6585
+ function Nc(n) {
6582
6586
  let e = n.docView.domFromPos(n.state.selection.anchor, 0), t = n.domSelectionRange();
6583
6587
  return tt(e.node, e.offset, t.anchorNode, t.anchorOffset);
6584
6588
  }
@@ -6627,9 +6631,9 @@ function Nt(n, e) {
6627
6631
  return t && t.size == 0 && (e < 0 || n.nextSibling || n.nodeName != "BR");
6628
6632
  }
6629
6633
  function lt(n, e) {
6630
- return e < 0 ? Nc(n) : Tc(n);
6634
+ return e < 0 ? Tc(n) : wc(n);
6631
6635
  }
6632
- function Nc(n) {
6636
+ function Tc(n) {
6633
6637
  let e = n.domSelectionRange(), t = e.focusNode, o = e.focusOffset;
6634
6638
  if (!t)
6635
6639
  return;
@@ -6665,7 +6669,7 @@ function Nc(n) {
6665
6669
  }
6666
6670
  s ? Rn(n, t, o) : r && Rn(n, r, i);
6667
6671
  }
6668
- function Tc(n) {
6672
+ function wc(n) {
6669
6673
  let e = n.domSelectionRange(), t = e.focusNode, o = e.focusOffset;
6670
6674
  if (!t)
6671
6675
  return;
@@ -6701,7 +6705,7 @@ function ai(n) {
6701
6705
  let e = n.pmViewDesc;
6702
6706
  return e && e.node && e.node.isBlock;
6703
6707
  }
6704
- function wc(n, e) {
6708
+ function Dc(n, e) {
6705
6709
  for (; n && e == n.childNodes.length && !Bt(n); )
6706
6710
  e = Z(n) + 1, n = n.parentNode;
6707
6711
  for (; n && e < n.childNodes.length; ) {
@@ -6713,7 +6717,7 @@ function wc(n, e) {
6713
6717
  n = t, e = 0;
6714
6718
  }
6715
6719
  }
6716
- function Dc(n, e) {
6720
+ function Mc(n, e) {
6717
6721
  for (; n && !e && !Bt(n); )
6718
6722
  e = Z(n), n = n.parentNode;
6719
6723
  for (; n && e; ) {
@@ -6728,7 +6732,7 @@ function Dc(n, e) {
6728
6732
  function Rn(n, e, t) {
6729
6733
  if (e.nodeType != 3) {
6730
6734
  let i, s;
6731
- (s = wc(e, t)) ? (e = s, t = 0) : (i = Dc(e, t)) && (e = i, t = i.nodeValue.length);
6735
+ (s = Dc(e, t)) ? (e = s, t = 0) : (i = Mc(e, t)) && (e = i, t = i.nodeValue.length);
6732
6736
  }
6733
6737
  let o = n.domSelection();
6734
6738
  if (!o)
@@ -6745,7 +6749,7 @@ function Rn(n, e, t) {
6745
6749
  }
6746
6750
  function Eo(n, e) {
6747
6751
  let t = n.state.doc.resolve(e);
6748
- if (!(te || Ya) && t.parent.inlineContent) {
6752
+ if (!(te || Ga) && t.parent.inlineContent) {
6749
6753
  let r = n.coordsAtPos(e);
6750
6754
  if (e > t.start()) {
6751
6755
  let i = n.coordsAtPos(e - 1), s = (i.top + i.bottom) / 2;
@@ -6771,7 +6775,7 @@ function Ro(n, e, t) {
6771
6775
  return Le(n, s);
6772
6776
  }
6773
6777
  if (!r.parent.inlineContent) {
6774
- let s = e < 0 ? r : i, l = o instanceof Ne ? q.near(s, e) : q.findFrom(s, e);
6778
+ let s = e < 0 ? r : i, l = o instanceof Te ? q.near(s, e) : q.findFrom(s, e);
6775
6779
  return l ? Le(n, l) : !1;
6776
6780
  }
6777
6781
  return !1;
@@ -6796,7 +6800,7 @@ function Po(n, e) {
6796
6800
  function zo(n, e, t) {
6797
6801
  n.domObserver.stop(), e.contentEditable = t, n.domObserver.start();
6798
6802
  }
6799
- function Mc(n) {
6803
+ function Oc(n) {
6800
6804
  if (!re || n.state.selection.$head.parentOffset > 0)
6801
6805
  return !1;
6802
6806
  let { focusNode: e, focusOffset: t } = n.domSelectionRange();
@@ -6806,12 +6810,12 @@ function Mc(n) {
6806
6810
  }
6807
6811
  return !1;
6808
6812
  }
6809
- function Oc(n) {
6813
+ function vc(n) {
6810
6814
  let e = "";
6811
6815
  return n.ctrlKey && (e += "c"), n.metaKey && (e += "m"), n.altKey && (e += "a"), n.shiftKey && (e += "s"), e;
6812
6816
  }
6813
- function vc(n, e) {
6814
- let t = e.keyCode, o = Oc(e);
6817
+ function Ic(n, e) {
6818
+ let t = e.keyCode, o = vc(e);
6815
6819
  if (t == 8 || fe && t == 72 && o == "c")
6816
6820
  return Po(n, -1) || lt(n, -1);
6817
6821
  if (t == 46 && !e.shiftKey || fe && t == 68 && o == "c")
@@ -6828,7 +6832,7 @@ function vc(n, e) {
6828
6832
  if (t == 38 || fe && t == 80 && o == "c")
6829
6833
  return Ro(n, -1, o) || lt(n, -1);
6830
6834
  if (t == 40 || fe && t == 78 && o == "c")
6831
- return Mc(n) || Ro(n, 1, o) || lt(n, 1);
6835
+ return Oc(n) || Ro(n, 1, o) || lt(n, 1);
6832
6836
  if (o == (fe ? "m" : "c") && (t == 66 || t == 73 || t == 89 || t == 90))
6833
6837
  return !0;
6834
6838
  }
@@ -6886,7 +6890,7 @@ function jn(n, e, t, o, r) {
6886
6890
  } else
6887
6891
  n.someProp("transformPastedHTML", (u) => {
6888
6892
  t = u(t, n);
6889
- }), s = Rc(t), Lt && Pc(s);
6893
+ }), s = Pc(t), Lt && zc(s);
6890
6894
  let c = s && s.querySelector("[data-pm-slice]"), d = c && /^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(c.getAttribute("data-pm-slice") || "");
6891
6895
  if (d && d[3])
6892
6896
  for (let u = +d[3]; u > 0; u--) {
@@ -6901,11 +6905,11 @@ function jn(n, e, t, o, r) {
6901
6905
  preserveWhitespace: !!(a || d),
6902
6906
  context: r,
6903
6907
  ruleFromNode(f) {
6904
- return f.nodeName == "BR" && !f.nextSibling && f.parentNode && !Ic.test(f.parentNode.nodeName) ? { ignore: !0 } : null;
6908
+ return f.nodeName == "BR" && !f.nextSibling && f.parentNode && !Ac.test(f.parentNode.nodeName) ? { ignore: !0 } : null;
6905
6909
  }
6906
6910
  })), d)
6907
- l = zc(Bo(l, +d[1], +d[2]), d[4]);
6908
- else if (l = E.maxOpen(Ac(l.content, r), !0), l.openStart || l.openEnd) {
6911
+ l = Bc(Bo(l, +d[1], +d[2]), d[4]);
6912
+ else if (l = E.maxOpen(Ec(l.content, r), !0), l.openStart || l.openEnd) {
6909
6913
  let u = 0, f = 0;
6910
6914
  for (let m = l.content.firstChild; u < l.openStart && !m.type.spec.isolating; u++, m = m.firstChild)
6911
6915
  ;
@@ -6917,8 +6921,8 @@ function jn(n, e, t, o, r) {
6917
6921
  l = u(l, n);
6918
6922
  }), l;
6919
6923
  }
6920
- const Ic = /^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;
6921
- function Ac(n, e) {
6924
+ const Ac = /^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;
6925
+ function Ec(n, e) {
6922
6926
  if (n.childCount < 2)
6923
6927
  return n;
6924
6928
  for (let t = e.depth; t >= 0; t--) {
@@ -6984,27 +6988,27 @@ function fi() {
6984
6988
  return Lo || (Lo = document.implementation.createHTMLDocument("title"));
6985
6989
  }
6986
6990
  let yn = null;
6987
- function Ec(n) {
6991
+ function Rc(n) {
6988
6992
  let e = window.trustedTypes;
6989
6993
  return e ? (yn || (yn = e.createPolicy("ProseMirrorClipboard", { createHTML: (t) => t })), yn.createHTML(n)) : n;
6990
6994
  }
6991
- function Rc(n) {
6995
+ function Pc(n) {
6992
6996
  let e = /^(\s*<meta [^>]*>)*/.exec(n);
6993
6997
  e && (n = n.slice(e[0].length));
6994
6998
  let t = fi().createElement("div"), o = /<([a-z][^>\s]+)/i.exec(n), r;
6995
- if ((r = o && hi[o[1].toLowerCase()]) && (n = r.map((i) => "<" + i + ">").join("") + n + r.map((i) => "</" + i + ">").reverse().join("")), t.innerHTML = Ec(n), r)
6999
+ if ((r = o && hi[o[1].toLowerCase()]) && (n = r.map((i) => "<" + i + ">").join("") + n + r.map((i) => "</" + i + ">").reverse().join("")), t.innerHTML = Rc(n), r)
6996
7000
  for (let i = 0; i < r.length; i++)
6997
7001
  t = t.querySelector(r[i]) || t;
6998
7002
  return t;
6999
7003
  }
7000
- function Pc(n) {
7004
+ function zc(n) {
7001
7005
  let e = n.querySelectorAll(te ? "span:not([class]):not([style])" : "span.Apple-converted-space");
7002
7006
  for (let t = 0; t < e.length; t++) {
7003
7007
  let o = e[t];
7004
7008
  o.childNodes.length == 1 && o.textContent == " " && o.parentNode && o.parentNode.replaceChild(n.ownerDocument.createTextNode(" "), o);
7005
7009
  }
7006
7010
  }
7007
- function zc(n, e) {
7011
+ function Bc(n, e) {
7008
7012
  if (!n.size)
7009
7013
  return n;
7010
7014
  let t = n.content.firstChild.type.schema, o;
@@ -7022,25 +7026,25 @@ function zc(n, e) {
7022
7026
  }
7023
7027
  return new E(r, i, s);
7024
7028
  }
7025
- const ie = {}, se = {}, Bc = { touchstart: !0, touchmove: !0 };
7026
- class Lc {
7029
+ const ie = {}, se = {}, Lc = { touchstart: !0, touchmove: !0 };
7030
+ class Vc {
7027
7031
  constructor() {
7028
7032
  this.shiftKey = !1, this.mouseDown = null, this.lastKeyCode = null, this.lastKeyCodeTime = 0, this.lastClick = { time: 0, x: 0, y: 0, type: "" }, this.lastSelectionOrigin = null, this.lastSelectionTime = 0, this.lastIOSEnter = 0, this.lastIOSEnterFallbackTimeout = -1, this.lastFocus = 0, this.lastTouch = 0, this.lastChromeDelete = 0, this.composing = !1, this.compositionNode = null, this.composingTimeout = -1, this.compositionNodes = [], this.compositionEndedAt = -2e8, this.compositionID = 1, this.compositionPendingChanges = 0, this.domChangeCount = 0, this.eventHandlers = /* @__PURE__ */ Object.create(null), this.hideSelectionGuard = null;
7029
7033
  }
7030
7034
  }
7031
- function Vc(n) {
7035
+ function Fc(n) {
7032
7036
  for (let e in ie) {
7033
7037
  let t = ie[e];
7034
7038
  n.dom.addEventListener(e, n.input.eventHandlers[e] = (o) => {
7035
- $c(n, o) && !Yn(n, o) && (n.editable || !(o.type in se)) && t(n, o);
7036
- }, Bc[e] ? { passive: !0 } : void 0);
7039
+ Hc(n, o) && !Yn(n, o) && (n.editable || !(o.type in se)) && t(n, o);
7040
+ }, Lc[e] ? { passive: !0 } : void 0);
7037
7041
  }
7038
7042
  re && n.dom.addEventListener("input", () => null), zn(n);
7039
7043
  }
7040
7044
  function Fe(n, e) {
7041
7045
  n.input.lastSelectionOrigin = e, n.input.lastSelectionTime = Date.now();
7042
7046
  }
7043
- function Fc(n) {
7047
+ function $c(n) {
7044
7048
  n.domObserver.stop();
7045
7049
  for (let e in n.input.eventHandlers)
7046
7050
  n.dom.removeEventListener(e, n.input.eventHandlers[e]);
@@ -7058,7 +7062,7 @@ function Yn(n, e) {
7058
7062
  return o ? o(n, e) || e.defaultPrevented : !1;
7059
7063
  });
7060
7064
  }
7061
- function $c(n, e) {
7065
+ function Hc(n, e) {
7062
7066
  if (!e.bubbles)
7063
7067
  return !0;
7064
7068
  if (e.defaultPrevented)
@@ -7068,7 +7072,7 @@ function $c(n, e) {
7068
7072
  return !1;
7069
7073
  return !0;
7070
7074
  }
7071
- function Hc(n, e) {
7075
+ function qc(n, e) {
7072
7076
  !Yn(n, e) && ie[e.type] && (n.editable || !(e.type in se)) && ie[e.type](n, e);
7073
7077
  }
7074
7078
  se.keydown = (n, e) => {
@@ -7079,7 +7083,7 @@ se.keydown = (n, e) => {
7079
7083
  n.input.lastIOSEnter = o, n.input.lastIOSEnterFallbackTimeout = setTimeout(() => {
7080
7084
  n.input.lastIOSEnter == o && (n.someProp("handleKeyDown", (r) => r(n, Ue(13, "Enter"))), n.input.lastIOSEnter = 0);
7081
7085
  }, 200);
7082
- } else n.someProp("handleKeyDown", (o) => o(n, t)) || vc(n, t) ? t.preventDefault() : Fe(n, "key");
7086
+ } else n.someProp("handleKeyDown", (o) => o(n, t)) || Ic(n, t) ? t.preventDefault() : Fe(n, "key");
7083
7087
  };
7084
7088
  se.keyup = (n, e) => {
7085
7089
  e.keyCode == 16 && (n.input.shiftKey = !1);
@@ -7101,7 +7105,7 @@ se.keypress = (n, e) => {
7101
7105
  function sn(n) {
7102
7106
  return { left: n.clientX, top: n.clientY };
7103
7107
  }
7104
- function qc(n, e) {
7108
+ function Wc(n, e) {
7105
7109
  let t = e.x - n.clientX, o = e.y - n.clientY;
7106
7110
  return t * t + o * o < 100;
7107
7111
  }
@@ -7120,13 +7124,13 @@ function ht(n, e, t) {
7120
7124
  let o = n.state.tr.setSelection(e);
7121
7125
  o.setMeta("pointer", !0), n.dispatch(o);
7122
7126
  }
7123
- function Wc(n, e) {
7127
+ function Jc(n, e) {
7124
7128
  if (e == -1)
7125
7129
  return !1;
7126
7130
  let t = n.state.doc.resolve(e), o = t.nodeAfter;
7127
7131
  return o && o.isAtom && T.isSelectable(o) ? (ht(n, new T(t)), !0) : !1;
7128
7132
  }
7129
- function Jc(n, e) {
7133
+ function Kc(n, e) {
7130
7134
  if (e == -1)
7131
7135
  return !1;
7132
7136
  let t = n.state.selection, o, r;
@@ -7141,16 +7145,16 @@ function Jc(n, e) {
7141
7145
  }
7142
7146
  return r != null ? (ht(n, T.create(n.state.doc, r)), !0) : !1;
7143
7147
  }
7144
- function Kc(n, e, t, o, r) {
7145
- return Gn(n, "handleClickOn", e, t, o) || n.someProp("handleClick", (i) => i(n, e, o)) || (r ? Jc(n, t) : Wc(n, t));
7148
+ function Uc(n, e, t, o, r) {
7149
+ return Gn(n, "handleClickOn", e, t, o) || n.someProp("handleClick", (i) => i(n, e, o)) || (r ? Kc(n, t) : Jc(n, t));
7146
7150
  }
7147
- function Uc(n, e, t, o) {
7151
+ function jc(n, e, t, o) {
7148
7152
  return Gn(n, "handleDoubleClickOn", e, t, o) || n.someProp("handleDoubleClick", (r) => r(n, e, o));
7149
7153
  }
7150
- function jc(n, e, t, o) {
7151
- return Gn(n, "handleTripleClickOn", e, t, o) || n.someProp("handleTripleClick", (r) => r(n, e, o)) || Yc(n, t, o);
7154
+ function Yc(n, e, t, o) {
7155
+ return Gn(n, "handleTripleClickOn", e, t, o) || n.someProp("handleTripleClick", (r) => r(n, e, o)) || Gc(n, t, o);
7152
7156
  }
7153
- function Yc(n, e, t) {
7157
+ function Gc(n, e, t) {
7154
7158
  if (t.button != 0)
7155
7159
  return !1;
7156
7160
  let o = n.state.doc;
@@ -7176,11 +7180,11 @@ ie.mousedown = (n, e) => {
7176
7180
  let t = e;
7177
7181
  n.input.shiftKey = t.shiftKey;
7178
7182
  let o = Xn(n), r = Date.now(), i = "singleClick";
7179
- r - n.input.lastClick.time < 500 && qc(t, n.input.lastClick) && !t[pi] && (n.input.lastClick.type == "singleClick" ? i = "doubleClick" : n.input.lastClick.type == "doubleClick" && (i = "tripleClick")), n.input.lastClick = { time: r, x: t.clientX, y: t.clientY, type: i };
7183
+ r - n.input.lastClick.time < 500 && Wc(t, n.input.lastClick) && !t[pi] && (n.input.lastClick.type == "singleClick" ? i = "doubleClick" : n.input.lastClick.type == "doubleClick" && (i = "tripleClick")), n.input.lastClick = { time: r, x: t.clientX, y: t.clientY, type: i };
7180
7184
  let s = n.posAtCoords(sn(t));
7181
- s && (i == "singleClick" ? (n.input.mouseDown && n.input.mouseDown.done(), n.input.mouseDown = new Gc(n, s, t, !!o)) : (i == "doubleClick" ? Uc : jc)(n, s.pos, s.inside, t) ? t.preventDefault() : Fe(n, "pointer"));
7185
+ s && (i == "singleClick" ? (n.input.mouseDown && n.input.mouseDown.done(), n.input.mouseDown = new Xc(n, s, t, !!o)) : (i == "doubleClick" ? jc : Yc)(n, s.pos, s.inside, t) ? t.preventDefault() : Fe(n, "pointer"));
7182
7186
  };
7183
- class Gc {
7187
+ class Xc {
7184
7188
  constructor(e, t, o, r) {
7185
7189
  this.view = e, this.pos = t, this.event = o, this.flushed = r, this.delayedSelectionSync = !1, this.mightDrag = null, this.startDoc = e.state.doc, this.selectNode = !!o[pi], this.allowDefault = o.shiftKey;
7186
7190
  let i, s;
@@ -7209,7 +7213,7 @@ class Gc {
7209
7213
  if (this.done(), !this.view.dom.contains(e.target))
7210
7214
  return;
7211
7215
  let t = this.pos;
7212
- this.view.state.doc != this.startDoc && (t = this.view.posAtCoords(sn(e))), this.updateAllowDefault(e), this.allowDefault || !t ? Fe(this.view, "pointer") : Kc(this.view, t.pos, t.inside, e, this.selectNode) ? e.preventDefault() : e.button == 0 && (this.flushed || // Safari ignores clicks on draggable elements
7216
+ this.view.state.doc != this.startDoc && (t = this.view.posAtCoords(sn(e))), this.updateAllowDefault(e), this.allowDefault || !t ? Fe(this.view, "pointer") : Uc(this.view, t.pos, t.inside, e, this.selectNode) ? e.preventDefault() : e.button == 0 && (this.flushed || // Safari ignores clicks on draggable elements
7213
7217
  re && this.mightDrag && !this.mightDrag.node.isAtom || // Chrome will sometimes treat a node selection as a
7214
7218
  // cursor, but still report that the node is selected
7215
7219
  // when asked through getSelection. You'll then get a
@@ -7236,7 +7240,7 @@ ie.contextmenu = (n) => Xn(n);
7236
7240
  function mi(n, e) {
7237
7241
  return n.composing ? !0 : re && Math.abs(e.timeStamp - n.input.compositionEndedAt) < 500 ? (n.input.compositionEndedAt = -2e8, !0) : !1;
7238
7242
  }
7239
- const Xc = Re ? 5e3 : -1;
7243
+ const _c = Re ? 5e3 : -1;
7240
7244
  se.compositionstart = se.compositionupdate = (n) => {
7241
7245
  if (!n.composing) {
7242
7246
  n.domObserver.flush();
@@ -7259,7 +7263,7 @@ se.compositionstart = se.compositionupdate = (n) => {
7259
7263
  }
7260
7264
  n.input.composing = !0;
7261
7265
  }
7262
- gi(n, Xc);
7266
+ gi(n, _c);
7263
7267
  };
7264
7268
  se.compositionend = (n, e) => {
7265
7269
  n.composing && (n.input.composing = !1, n.input.compositionEndedAt = e.timeStamp, n.input.compositionPendingChanges = n.domObserver.pendingRecords().length ? n.input.compositionID : 0, n.input.compositionNode = null, n.input.compositionPendingChanges && Promise.resolve().then(() => n.domObserver.flush()), n.input.compositionID++, gi(n, 20));
@@ -7268,14 +7272,14 @@ function gi(n, e) {
7268
7272
  clearTimeout(n.input.composingTimeout), e > -1 && (n.input.composingTimeout = setTimeout(() => At(n), e));
7269
7273
  }
7270
7274
  function bi(n) {
7271
- for (n.composing && (n.input.composing = !1, n.input.compositionEndedAt = Zc()); n.input.compositionNodes.length > 0; )
7275
+ for (n.composing && (n.input.composing = !1, n.input.compositionEndedAt = Qc()); n.input.compositionNodes.length > 0; )
7272
7276
  n.input.compositionNodes.pop().markParentsDirty();
7273
7277
  }
7274
- function _c(n) {
7278
+ function Zc(n) {
7275
7279
  let e = n.domSelectionRange();
7276
7280
  if (!e.focusNode)
7277
7281
  return null;
7278
- let t = Wa(e.focusNode, e.focusOffset), o = Ja(e.focusNode, e.focusOffset);
7282
+ let t = Ja(e.focusNode, e.focusOffset), o = Ka(e.focusNode, e.focusOffset);
7279
7283
  if (t && o && t != o) {
7280
7284
  let r = o.pmViewDesc, i = n.domObserver.lastChangedTextNode;
7281
7285
  if (t == i || o == i)
@@ -7290,7 +7294,7 @@ function _c(n) {
7290
7294
  }
7291
7295
  return t || o;
7292
7296
  }
7293
- function Zc() {
7297
+ function Qc() {
7294
7298
  let n = document.createEvent("Event");
7295
7299
  return n.initEvent("event", !0, !0), n.timeStamp;
7296
7300
  }
@@ -7303,7 +7307,7 @@ function At(n, e = !1) {
7303
7307
  return !1;
7304
7308
  }
7305
7309
  }
7306
- function Qc(n, e) {
7310
+ function ed(n, e) {
7307
7311
  if (!n.dom.parentNode)
7308
7312
  return;
7309
7313
  let t = n.dom.parentNode.appendChild(document.createElement("div"));
@@ -7313,18 +7317,18 @@ function Qc(n, e) {
7313
7317
  t.parentNode && t.parentNode.removeChild(t), n.focus();
7314
7318
  }, 50);
7315
7319
  }
7316
- const Et = ae && He < 15 || gt && Ga < 604;
7320
+ const Et = ae && He < 15 || gt && Xa < 604;
7317
7321
  ie.copy = se.cut = (n, e) => {
7318
7322
  let t = e, o = n.state.selection, r = t.type == "cut";
7319
7323
  if (o.empty)
7320
7324
  return;
7321
7325
  let i = Et ? null : t.clipboardData, s = o.content(), { dom: l, text: a } = Un(n, s);
7322
- i ? (t.preventDefault(), i.clearData(), i.setData("text/html", l.innerHTML), i.setData("text/plain", a)) : Qc(n, l), r && n.dispatch(n.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent", "cut"));
7326
+ i ? (t.preventDefault(), i.clearData(), i.setData("text/html", l.innerHTML), i.setData("text/plain", a)) : ed(n, l), r && n.dispatch(n.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent", "cut"));
7323
7327
  };
7324
- function ed(n) {
7328
+ function td(n) {
7325
7329
  return n.openStart == 0 && n.openEnd == 0 && n.content.childCount == 1 ? n.content.firstChild : null;
7326
7330
  }
7327
- function td(n, e) {
7331
+ function nd(n, e) {
7328
7332
  if (!n.dom.parentNode)
7329
7333
  return;
7330
7334
  let t = n.input.shiftKey || n.state.selection.$from.parent.type.spec.code, o = n.dom.parentNode.appendChild(document.createElement(t ? "textarea" : "div"));
@@ -7340,7 +7344,7 @@ function Rt(n, e, t, o, r) {
7340
7344
  return !0;
7341
7345
  if (!i)
7342
7346
  return !1;
7343
- let s = ed(i), l = s ? n.state.tr.replaceSelectionWith(s, o) : n.state.tr.replaceSelection(i);
7347
+ let s = td(i), l = s ? n.state.tr.replaceSelectionWith(s, o) : n.state.tr.replaceSelection(i);
7344
7348
  return n.dispatch(l.scrollIntoView().setMeta("paste", !0).setMeta("uiEvent", "paste")), !0;
7345
7349
  }
7346
7350
  function yi(n) {
@@ -7355,7 +7359,7 @@ se.paste = (n, e) => {
7355
7359
  if (n.composing && !Re)
7356
7360
  return;
7357
7361
  let o = Et ? null : t.clipboardData, r = n.input.shiftKey && n.input.lastKeyCode != 45;
7358
- o && Rt(n, yi(o), o.getData("text/html"), r, t) ? t.preventDefault() : td(n, t);
7362
+ o && Rt(n, yi(o), o.getData("text/html"), r, t) ? t.preventDefault() : nd(n, t);
7359
7363
  };
7360
7364
  class ki {
7361
7365
  constructor(e, t, o) {
@@ -7405,7 +7409,7 @@ se.drop = (n, e) => {
7405
7409
  if (!s)
7406
7410
  return;
7407
7411
  t.preventDefault();
7408
- let a = s ? Ba(n.state.doc, i.pos, s) : i.pos;
7412
+ let a = s ? La(n.state.doc, i.pos, s) : i.pos;
7409
7413
  a == null && (a = i.pos);
7410
7414
  let c = n.state.tr;
7411
7415
  if (l) {
@@ -7643,7 +7647,7 @@ class G {
7643
7647
  let a = this.local[l].map(e, o, r);
7644
7648
  a && a.type.valid(t, a) ? (s || (s = [])).push(a) : i.onRemove && i.onRemove(this.local[l].spec);
7645
7649
  }
7646
- return this.children.length ? nd(this.children, s || [], e, t, o, r, i) : s ? new G(s.sort(et), ct) : ee;
7650
+ return this.children.length ? od(this.children, s || [], e, t, o, r, i) : s ? new G(s.sort(et), ct) : ee;
7647
7651
  }
7648
7652
  /**
7649
7653
  Add the given array of decorations to the ones in the set,
@@ -7821,7 +7825,7 @@ class Ve {
7821
7825
  this.members[t].forEachSet(e);
7822
7826
  }
7823
7827
  }
7824
- function nd(n, e, t, o, r, i, s) {
7828
+ function od(n, e, t, o, r, i, s) {
7825
7829
  let l = n.slice();
7826
7830
  for (let c = 0, d = i; c < t.maps.length; c++) {
7827
7831
  let u = 0;
@@ -7857,7 +7861,7 @@ function nd(n, e, t, o, r, i, s) {
7857
7861
  a = !0;
7858
7862
  }
7859
7863
  if (a) {
7860
- let c = od(l, n, e, t, r, i, s), d = tn(c, o, 0, s);
7864
+ let c = rd(l, n, e, t, r, i, s), d = tn(c, o, 0, s);
7861
7865
  e = d.local;
7862
7866
  for (let u = 0; u < l.length; u += 3)
7863
7867
  l[u + 1] < 0 && (l.splice(u, 3), u -= 3);
@@ -7880,7 +7884,7 @@ function Ci(n, e) {
7880
7884
  }
7881
7885
  return t;
7882
7886
  }
7883
- function od(n, e, t, o, r, i, s) {
7887
+ function rd(n, e, t, o, r, i, s) {
7884
7888
  function l(a, c) {
7885
7889
  for (let d = 0; d < a.local.length; d++) {
7886
7890
  let u = a.local[d].map(o, r, c);
@@ -7955,15 +7959,15 @@ function kn(n) {
7955
7959
  o && o != ee && e.push(o);
7956
7960
  }), n.cursorWrapper && e.push(G.create(n.state.doc, [n.cursorWrapper.deco])), Ve.from(e);
7957
7961
  }
7958
- const rd = {
7962
+ const id = {
7959
7963
  childList: !0,
7960
7964
  characterData: !0,
7961
7965
  characterDataOldValue: !0,
7962
7966
  attributes: !0,
7963
7967
  attributeOldValue: !0,
7964
7968
  subtree: !0
7965
- }, id = ae && He <= 11;
7966
- class sd {
7969
+ }, sd = ae && He <= 11;
7970
+ class ld {
7967
7971
  constructor() {
7968
7972
  this.anchorNode = null, this.anchorOffset = 0, this.focusNode = null, this.focusOffset = 0;
7969
7973
  }
@@ -7977,13 +7981,13 @@ class sd {
7977
7981
  return e.anchorNode == this.anchorNode && e.anchorOffset == this.anchorOffset && e.focusNode == this.focusNode && e.focusOffset == this.focusOffset;
7978
7982
  }
7979
7983
  }
7980
- class ld {
7984
+ class ad {
7981
7985
  constructor(e, t) {
7982
- this.view = e, this.handleDOMChange = t, this.queue = [], this.flushingSoon = -1, this.observer = null, this.currentSelection = new sd(), this.onCharData = null, this.suppressingSelectionUpdates = !1, this.lastChangedTextNode = null, this.observer = window.MutationObserver && new window.MutationObserver((o) => {
7986
+ this.view = e, this.handleDOMChange = t, this.queue = [], this.flushingSoon = -1, this.observer = null, this.currentSelection = new ld(), this.onCharData = null, this.suppressingSelectionUpdates = !1, this.lastChangedTextNode = null, this.observer = window.MutationObserver && new window.MutationObserver((o) => {
7983
7987
  for (let r = 0; r < o.length; r++)
7984
7988
  this.queue.push(o[r]);
7985
7989
  ae && He <= 11 && o.some((r) => r.type == "childList" && r.removedNodes.length || r.type == "characterData" && r.oldValue.length > r.target.nodeValue.length) ? this.flushSoon() : this.flush();
7986
- }), id && (this.onCharData = (o) => {
7990
+ }), sd && (this.onCharData = (o) => {
7987
7991
  this.queue.push({ target: o.target, type: "characterData", oldValue: o.prevValue }), this.flushSoon();
7988
7992
  }), this.onSelectionChange = this.onSelectionChange.bind(this);
7989
7993
  }
@@ -7996,7 +8000,7 @@ class ld {
7996
8000
  this.flushingSoon > -1 && (window.clearTimeout(this.flushingSoon), this.flushingSoon = -1, this.flush());
7997
8001
  }
7998
8002
  start() {
7999
- this.observer && (this.observer.takeRecords(), this.observer.observe(this.view.dom, rd)), this.onCharData && this.view.dom.addEventListener("DOMCharacterDataModified", this.onCharData), this.connectSelection();
8003
+ this.observer && (this.observer.takeRecords(), this.observer.observe(this.view.dom, id)), this.onCharData && this.view.dom.addEventListener("DOMCharacterDataModified", this.onCharData), this.connectSelection();
8000
8004
  }
8001
8005
  stop() {
8002
8006
  if (this.observer) {
@@ -8079,12 +8083,12 @@ class ld {
8079
8083
  let { focusNode: u } = this.currentSelection;
8080
8084
  for (let f of d) {
8081
8085
  let m = f.parentNode;
8082
- m && m.nodeName == "LI" && (!u || dd(e, u) != m) && f.remove();
8086
+ m && m.nodeName == "LI" && (!u || ud(e, u) != m) && f.remove();
8083
8087
  }
8084
8088
  }
8085
8089
  }
8086
8090
  let c = null;
8087
- i < 0 && r && e.input.lastFocus > Date.now() - 200 && Math.max(e.input.lastTouch, e.input.lastClick.time) < Date.now() - 300 && on(o) && (c = Jn(e)) && c.eq(q.near(e.state.doc.resolve(0), 1)) ? (e.input.lastFocus = 0, Pe(e), this.currentSelection.set(o)) : (i > -1 || r) && (i > -1 && (e.docView.markDirty(i, s), ad(e)), this.handleDOMChange(i, s, l, a), e.docView && e.docView.dirty ? e.updateState(e.state) : this.currentSelection.eq(o) || Pe(e), this.currentSelection.set(o));
8091
+ i < 0 && r && e.input.lastFocus > Date.now() - 200 && Math.max(e.input.lastTouch, e.input.lastClick.time) < Date.now() - 300 && on(o) && (c = Jn(e)) && c.eq(q.near(e.state.doc.resolve(0), 1)) ? (e.input.lastFocus = 0, Pe(e), this.currentSelection.set(o)) : (i > -1 || r) && (i > -1 && (e.docView.markDirty(i, s), cd(e)), this.handleDOMChange(i, s, l, a), e.docView && e.docView.dirty ? e.updateState(e.state) : this.currentSelection.eq(o) || Pe(e), this.currentSelection.set(o));
8088
8092
  }
8089
8093
  registerMutation(e, t) {
8090
8094
  if (t.indexOf(e.target) > -1)
@@ -8120,7 +8124,7 @@ class ld {
8120
8124
  }
8121
8125
  }
8122
8126
  let Fo = /* @__PURE__ */ new WeakMap(), $o = !1;
8123
- function ad(n) {
8127
+ function cd(n) {
8124
8128
  if (!Fo.has(n) && (Fo.set(n, null), ["normal", "nowrap", "pre-line"].indexOf(getComputedStyle(n.dom).whiteSpace) !== -1)) {
8125
8129
  if (n.requiresGeckoHackNode = ke, $o)
8126
8130
  return;
@@ -8131,7 +8135,7 @@ function Ho(n, e) {
8131
8135
  let t = e.startContainer, o = e.startOffset, r = e.endContainer, i = e.endOffset, s = n.domAtPos(n.state.selection.anchor);
8132
8136
  return tt(s.node, s.offset, r, i) && ([t, o, r, i] = [r, i, t, o]), { anchorNode: t, anchorOffset: o, focusNode: r, focusOffset: i };
8133
8137
  }
8134
- function cd(n, e) {
8138
+ function dd(n, e) {
8135
8139
  if (e.getComposedRanges) {
8136
8140
  let r = e.getComposedRanges(n.root)[0];
8137
8141
  if (r)
@@ -8143,7 +8147,7 @@ function cd(n, e) {
8143
8147
  }
8144
8148
  return n.dom.addEventListener("beforeinput", o, !0), document.execCommand("indent"), n.dom.removeEventListener("beforeinput", o, !0), t ? Ho(n, t) : null;
8145
8149
  }
8146
- function dd(n, e) {
8150
+ function ud(n, e) {
8147
8151
  for (let t = e.parentNode; t && t != n.dom; t = t.parentNode) {
8148
8152
  let o = n.docView.nearestDesc(t, !0);
8149
8153
  if (o && o.node.isBlock)
@@ -8151,7 +8155,7 @@ function dd(n, e) {
8151
8155
  }
8152
8156
  return null;
8153
8157
  }
8154
- function ud(n, e, t) {
8158
+ function hd(n, e, t) {
8155
8159
  let { node: o, fromOffset: r, toOffset: i, from: s, to: l } = n.docView.parseRange(e, t), a = n.domSelectionRange(), c, d = a.anchorNode;
8156
8160
  if (d && n.dom.contains(d.nodeType == 1 ? d : d.parentNode) && (c = [{ node: d, offset: a.anchorOffset }], on(a) || c.push({ node: a.focusNode, offset: a.focusOffset })), te && n.input.lastKeyCode === 8)
8157
8161
  for (let g = i; g > r; g--) {
@@ -8171,7 +8175,7 @@ function ud(n, e, t) {
8171
8175
  to: i,
8172
8176
  preserveWhitespace: m.parent.type.whitespace == "pre" ? "full" : !0,
8173
8177
  findPositions: c,
8174
- ruleFromNode: hd,
8178
+ ruleFromNode: fd,
8175
8179
  context: m
8176
8180
  });
8177
8181
  if (c && c[0].pos != null) {
@@ -8180,7 +8184,7 @@ function ud(n, e, t) {
8180
8184
  }
8181
8185
  return { doc: b, sel: p, from: s, to: l };
8182
8186
  }
8183
- function hd(n) {
8187
+ function fd(n) {
8184
8188
  let e = n.pmViewDesc;
8185
8189
  if (e)
8186
8190
  return e.parseRule();
@@ -8194,8 +8198,8 @@ function hd(n) {
8194
8198
  return { ignore: !0 };
8195
8199
  return null;
8196
8200
  }
8197
- const fd = /^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;
8198
- function pd(n, e, t, o, r) {
8201
+ const pd = /^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;
8202
+ function md(n, e, t, o, r) {
8199
8203
  let i = n.input.compositionPendingChanges || (n.composing ? n.input.compositionID : 0);
8200
8204
  if (n.input.compositionPendingChanges = 0, e < 0) {
8201
8205
  let N = n.input.lastSelectionTime > Date.now() - 50 ? n.input.lastSelectionOrigin : null, X = Jn(n, N);
@@ -8209,10 +8213,10 @@ function pd(n, e, t, o, r) {
8209
8213
  }
8210
8214
  let s = n.state.doc.resolve(e), l = s.sharedDepth(t);
8211
8215
  e = s.before(l + 1), t = n.state.doc.resolve(t).after(l + 1);
8212
- let a = n.state.selection, c = ud(n, e, t), d = n.state.doc, u = d.slice(c.from, c.to), f, m;
8216
+ let a = n.state.selection, c = hd(n, e, t), d = n.state.doc, u = d.slice(c.from, c.to), f, m;
8213
8217
  n.input.lastKeyCode === 8 && Date.now() - 100 < n.input.lastKeyCodeTime ? (f = n.state.selection.to, m = "end") : (f = n.state.selection.from, m = "start"), n.input.lastKeyCode = null;
8214
- let p = bd(u.content, c.doc.content, c.from, f, m);
8215
- if (p && n.input.domChangeCount++, (gt && n.input.lastIOSEnter > Date.now() - 225 || Re) && r.some((N) => N.nodeType == 1 && !fd.test(N.nodeName)) && (!p || p.endA >= p.endB) && n.someProp("handleKeyDown", (N) => N(n, Ue(13, "Enter")))) {
8218
+ let p = yd(u.content, c.doc.content, c.from, f, m);
8219
+ if (p && n.input.domChangeCount++, (gt && n.input.lastIOSEnter > Date.now() - 225 || Re) && r.some((N) => N.nodeType == 1 && !pd.test(N.nodeName)) && (!p || p.endA >= p.endB) && n.someProp("handleKeyDown", (N) => N(n, Ue(13, "Enter")))) {
8216
8220
  n.input.lastIOSEnter = 0;
8217
8221
  return;
8218
8222
  }
@@ -8235,7 +8239,7 @@ function pd(n, e, t, o, r) {
8235
8239
  n.input.lastIOSEnter = 0;
8236
8240
  return;
8237
8241
  }
8238
- if (n.state.selection.anchor > p.start && gd(d, p.start, p.endA, b, g) && n.someProp("handleKeyDown", (N) => N(n, Ue(8, "Backspace")))) {
8242
+ if (n.state.selection.anchor > p.start && bd(d, p.start, p.endA, b, g) && n.someProp("handleKeyDown", (N) => N(n, Ue(8, "Backspace")))) {
8239
8243
  Re && te && n.domObserver.suppressSelectionUpdates();
8240
8244
  return;
8241
8245
  }
@@ -8250,7 +8254,7 @@ function pd(n, e, t, o, r) {
8250
8254
  ae && He <= 11 && b.parentOffset == 0 && (n.domObserver.suppressSelectionUpdates(), setTimeout(() => Pe(n), 20)), M = n.state.tr.delete(k, I), v = d.resolve(p.start).marksAcross(d.resolve(p.endA));
8251
8255
  else if (
8252
8256
  // Adding or removing a mark
8253
- p.endA == p.endB && (w = md(b.parent.content.cut(b.parentOffset, g.parentOffset), y.parent.content.cut(y.parentOffset, p.endA - y.start())))
8257
+ p.endA == p.endB && (w = gd(b.parent.content.cut(b.parentOffset, g.parentOffset), y.parent.content.cut(y.parentOffset, p.endA - y.start())))
8254
8258
  )
8255
8259
  M = n.state.tr, w.type == "add" ? M.addMark(k, I, w.mark) : M.removeMark(k, I, w.mark);
8256
8260
  else if (b.parent.child(b.index()).isText && b.index() == g.index() - (g.textOffset ? 0 : 1)) {
@@ -8269,7 +8273,7 @@ function pd(n, e, t, o, r) {
8269
8273
  function qo(n, e, t) {
8270
8274
  return Math.max(t.anchor, t.head) > e.content.size ? null : Kn(n, e.resolve(t.anchor), e.resolve(t.head));
8271
8275
  }
8272
- function md(n, e) {
8276
+ function gd(n, e) {
8273
8277
  let t = n.firstChild.marks, o = e.firstChild.marks, r = t, i = o, s, l, a;
8274
8278
  for (let d = 0; d < o.length; d++)
8275
8279
  r = o[d].removeFromSet(r);
@@ -8287,7 +8291,7 @@ function md(n, e) {
8287
8291
  if (A.from(c).eq(n))
8288
8292
  return { mark: l, type: s };
8289
8293
  }
8290
- function gd(n, e, t, o, r) {
8294
+ function bd(n, e, t, o, r) {
8291
8295
  if (
8292
8296
  // The content must have shrunk
8293
8297
  t - e <= r.pos - o.pos || // newEnd must point directly at or after the end of the block that newStart points into
@@ -8315,7 +8319,7 @@ function xn(n, e, t) {
8315
8319
  }
8316
8320
  return r;
8317
8321
  }
8318
- function bd(n, e, t, o, r) {
8322
+ function yd(n, e, t, o, r) {
8319
8323
  let i = n.findDiffStart(e, t);
8320
8324
  if (i == null)
8321
8325
  return null;
@@ -8339,8 +8343,8 @@ function Wo(n) {
8339
8343
  let e = n.charCodeAt(0), t = n.charCodeAt(1);
8340
8344
  return e >= 56320 && e <= 57343 && t >= 55296 && t <= 56319;
8341
8345
  }
8342
- const yd = jn, kd = At;
8343
- class xd {
8346
+ const kd = jn, xd = At;
8347
+ class Cd {
8344
8348
  /**
8345
8349
  Create a view. `place` may be a DOM node that the editor should
8346
8350
  be appended to, a function that will place it into the document,
@@ -8349,7 +8353,7 @@ class xd {
8349
8353
  added to the document.
8350
8354
  */
8351
8355
  constructor(e, t) {
8352
- this._root = null, this.focused = !1, this.trackWrites = null, this.mounted = !1, this.markCursor = null, this.cursorWrapper = null, this.lastSelectedViewDesc = void 0, this.input = new Lc(), this.prevDirectPlugins = [], this.pluginViews = [], this.requiresGeckoHackNode = !1, this.dragging = null, this._props = t, this.state = t.state, this.directPlugins = t.plugins || [], this.directPlugins.forEach(Yo), this.dispatch = this.dispatch.bind(this), this.dom = e && e.mount || document.createElement("div"), e && (e.appendChild ? e.appendChild(this.dom) : typeof e == "function" ? e(this.dom) : e.mount && (this.mounted = !0)), this.editable = Uo(this), Ko(this), this.nodeViews = jo(this), this.docView = To(this.state.doc, Jo(this), kn(this), this.dom, this), this.domObserver = new ld(this, (o, r, i, s) => pd(this, o, r, i, s)), this.domObserver.start(), Vc(this), this.updatePluginViews();
8356
+ this._root = null, this.focused = !1, this.trackWrites = null, this.mounted = !1, this.markCursor = null, this.cursorWrapper = null, this.lastSelectedViewDesc = void 0, this.input = new Vc(), this.prevDirectPlugins = [], this.pluginViews = [], this.requiresGeckoHackNode = !1, this.dragging = null, this._props = t, this.state = t.state, this.directPlugins = t.plugins || [], this.directPlugins.forEach(Yo), this.dispatch = this.dispatch.bind(this), this.dom = e && e.mount || document.createElement("div"), e && (e.appendChild ? e.appendChild(this.dom) : typeof e == "function" ? e(this.dom) : e.mount && (this.mounted = !0)), this.editable = Uo(this), Ko(this), this.nodeViews = jo(this), this.docView = To(this.state.doc, Jo(this), kn(this), this.dom, this), this.domObserver = new ad(this, (o, r, i, s) => md(this, o, r, i, s)), this.domObserver.start(), Fc(this), this.updatePluginViews();
8353
8357
  }
8354
8358
  /**
8355
8359
  Holds `true` when a
@@ -8409,22 +8413,22 @@ class xd {
8409
8413
  let l = r.plugins != e.plugins || this._props.plugins != t.plugins;
8410
8414
  if (l || this._props.plugins != t.plugins || this._props.nodeViews != t.nodeViews) {
8411
8415
  let m = jo(this);
8412
- Sd(m, this.nodeViews) && (this.nodeViews = m, i = !0);
8416
+ Nd(m, this.nodeViews) && (this.nodeViews = m, i = !0);
8413
8417
  }
8414
8418
  (l || t.handleDOMEvents != this._props.handleDOMEvents) && zn(this), this.editable = Uo(this), Ko(this);
8415
8419
  let a = kn(this), c = Jo(this), d = r.plugins != e.plugins && !r.doc.eq(e.doc) ? "reset" : e.scrollToSelection > r.scrollToSelection ? "to selection" : "preserve", u = i || !this.docView.matchesNode(e.doc, c, a);
8416
8420
  (u || !e.selection.eq(r.selection)) && (s = !0);
8417
- let f = d == "preserve" && s && this.dom.style.overflowAnchor == null && Za(this);
8421
+ let f = d == "preserve" && s && this.dom.style.overflowAnchor == null && Qa(this);
8418
8422
  if (s) {
8419
8423
  this.domObserver.stop();
8420
- let m = u && (ae || te) && !this.composing && !r.selection.empty && !e.selection.empty && Cd(r.selection, e.selection);
8424
+ let m = u && (ae || te) && !this.composing && !r.selection.empty && !e.selection.empty && Sd(r.selection, e.selection);
8421
8425
  if (u) {
8422
8426
  let p = te ? this.trackWrites = this.domSelectionRange().focusNode : null;
8423
- this.composing && (this.input.compositionNode = _c(this)), (i || !this.docView.update(e.doc, c, a, this)) && (this.docView.updateOuterDeco(c), this.docView.destroy(), this.docView = To(e.doc, c, a, this.dom, this)), p && !this.trackWrites && (m = !0);
8427
+ this.composing && (this.input.compositionNode = Zc(this)), (i || !this.docView.update(e.doc, c, a, this)) && (this.docView.updateOuterDeco(c), this.docView.destroy(), this.docView = To(e.doc, c, a, this.dom, this)), p && !this.trackWrites && (m = !0);
8424
8428
  }
8425
- m || !(this.input.mouseDown && this.domObserver.currentSelection.eq(this.domSelectionRange()) && Sc(this)) ? Pe(this, m) : (si(this, e.selection), this.domObserver.setCurSelection()), this.domObserver.start();
8429
+ m || !(this.input.mouseDown && this.domObserver.currentSelection.eq(this.domSelectionRange()) && Nc(this)) ? Pe(this, m) : (si(this, e.selection), this.domObserver.setCurSelection()), this.domObserver.start();
8426
8430
  }
8427
- this.updatePluginViews(r), !((o = this.dragging) === null || o === void 0) && o.node && !r.doc.eq(e.doc) && this.updateDraggedNode(this.dragging, r), d == "reset" ? this.dom.scrollTop = 0 : d == "to selection" ? this.scrollToSelection() : f && Qa(f);
8431
+ this.updatePluginViews(r), !((o = this.dragging) === null || o === void 0) && o.node && !r.doc.eq(e.doc) && this.updateDraggedNode(this.dragging, r), d == "reset" ? this.dom.scrollTop = 0 : d == "to selection" ? this.scrollToSelection() : f && ec(f);
8428
8432
  }
8429
8433
  /**
8430
8434
  @internal
@@ -8511,7 +8515,7 @@ class xd {
8511
8515
  Focus the editor.
8512
8516
  */
8513
8517
  focus() {
8514
- this.domObserver.stop(), this.editable && ec(this.dom), Pe(this), this.domObserver.start();
8518
+ this.domObserver.stop(), this.editable && tc(this.dom), Pe(this), this.domObserver.start();
8515
8519
  }
8516
8520
  /**
8517
8521
  Get the document root in which the editor exists. This will
@@ -8545,7 +8549,7 @@ class xd {
8545
8549
  the top level, not in any node.
8546
8550
  */
8547
8551
  posAtCoords(e) {
8548
- return ic(this, e);
8552
+ return sc(this, e);
8549
8553
  }
8550
8554
  /**
8551
8555
  Returns the viewport rectangle at a given document position.
@@ -8610,7 +8614,7 @@ class xd {
8610
8614
  pass a different state.
8611
8615
  */
8612
8616
  endOfTextblock(e, t) {
8613
- return dc(this, t || this.state, e);
8617
+ return uc(this, t || this.state, e);
8614
8618
  }
8615
8619
  /**
8616
8620
  Run the editor's paste logic with the given HTML string. The
@@ -8642,7 +8646,7 @@ class xd {
8642
8646
  views](https://prosemirror.net/docs/ref/#view.NodeView).
8643
8647
  */
8644
8648
  destroy() {
8645
- this.docView && (Fc(this), this.destroyPluginViews(), this.mounted ? (this.docView.update(this.state.doc, [], kn(this), this), this.dom.textContent = "") : this.dom.parentNode && this.dom.parentNode.removeChild(this.dom), this.docView.destroy(), this.docView = null, Ha());
8649
+ this.docView && ($c(this), this.destroyPluginViews(), this.mounted ? (this.docView.update(this.state.doc, [], kn(this), this), this.dom.textContent = "") : this.dom.parentNode && this.dom.parentNode.removeChild(this.dom), this.docView.destroy(), this.docView = null, qa());
8646
8650
  }
8647
8651
  /**
8648
8652
  This is true when the view has been
@@ -8656,7 +8660,7 @@ class xd {
8656
8660
  Used for testing.
8657
8661
  */
8658
8662
  dispatchEvent(e) {
8659
- return Hc(this, e);
8663
+ return qc(this, e);
8660
8664
  }
8661
8665
  /**
8662
8666
  Dispatch a transaction. Will call
@@ -8676,7 +8680,7 @@ class xd {
8676
8680
  */
8677
8681
  domSelectionRange() {
8678
8682
  let e = this.domSelection();
8679
- return e ? re && this.root.nodeType === 11 && Ua(this.dom.ownerDocument) == this.dom && cd(this, e) || e : { focusNode: null, focusOffset: 0, anchorNode: null, anchorOffset: 0 };
8683
+ return e ? re && this.root.nodeType === 11 && ja(this.dom.ownerDocument) == this.dom && dd(this, e) || e : { focusNode: null, focusOffset: 0, anchorNode: null, anchorOffset: 0 };
8680
8684
  }
8681
8685
  /**
8682
8686
  @internal
@@ -8703,7 +8707,7 @@ function Ko(n) {
8703
8707
  function Uo(n) {
8704
8708
  return !n.someProp("editable", (e) => e(n.state) === !1);
8705
8709
  }
8706
- function Cd(n, e) {
8710
+ function Sd(n, e) {
8707
8711
  let t = Math.min(n.$anchor.sharedDepth(n.head), e.$anchor.sharedDepth(e.head));
8708
8712
  return n.$anchor.start(t) != e.$anchor.start(t);
8709
8713
  }
@@ -8715,7 +8719,7 @@ function jo(n) {
8715
8719
  }
8716
8720
  return n.someProp("nodeViews", t), n.someProp("markViews", t), e;
8717
8721
  }
8718
- function Sd(n, e) {
8722
+ function Nd(n, e) {
8719
8723
  let t = 0, o = 0;
8720
8724
  for (let r in n) {
8721
8725
  if (n[r] != e[r])
@@ -8730,30 +8734,30 @@ function Yo(n) {
8730
8734
  if (n.spec.state || n.spec.filterTransaction || n.spec.appendTransaction)
8731
8735
  throw new RangeError("Plugins passed directly to the view must not have a state component");
8732
8736
  }
8733
- const Nd = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
8737
+ const Td = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
8734
8738
  __proto__: null,
8735
8739
  Decoration: me,
8736
8740
  DecorationSet: G,
8737
- EditorView: xd,
8738
- __endComposition: kd,
8739
- __parseFromClipboard: yd
8741
+ EditorView: Cd,
8742
+ __endComposition: xd,
8743
+ __parseFromClipboard: kd
8740
8744
  }, Symbol.toStringTag, { value: "Module" }));
8741
- function Td() {
8745
+ function wd() {
8742
8746
  try {
8743
- return Nd;
8747
+ return Td;
8744
8748
  } catch {
8745
8749
  return null;
8746
8750
  }
8747
8751
  }
8748
- function wd(n, e) {
8752
+ function Dd(n, e) {
8749
8753
  if (n && typeof n.serializeForClipboard == "function")
8750
8754
  return n.serializeForClipboard(e);
8751
- const t = Td();
8755
+ const t = wd();
8752
8756
  if (t && typeof (t == null ? void 0 : t.__serializeForClipboard) == "function")
8753
8757
  return t.__serializeForClipboard(n, e);
8754
8758
  throw new Error("No supported clipboard serialization method found.");
8755
8759
  }
8756
- function Dd(n) {
8760
+ function Md(n) {
8757
8761
  const e = n.getBoundingClientRect(), t = n.closest('[role="dialog"]'), o = n.closest(".ProseMirror"), r = o == null ? void 0 : o.getBoundingClientRect(), i = window.pageXOffset || document.documentElement.scrollLeft, s = window.pageYOffset || document.documentElement.scrollTop;
8758
8762
  if (t && window.getComputedStyle(t).transform !== "none") {
8759
8763
  const l = t.getBoundingClientRect();
@@ -8802,7 +8806,7 @@ function Ut(n, e) {
8802
8806
  const t = e.state.doc.resolve(n);
8803
8807
  return t.depth > 1 ? t.before(t.depth) : n;
8804
8808
  }
8805
- function Md(n) {
8809
+ function Od(n) {
8806
8810
  let e = "", t = !1;
8807
8811
  function o(d, u) {
8808
8812
  if (u.focus(), !d.dataTransfer) return;
@@ -8841,7 +8845,7 @@ function Md(n) {
8841
8845
  k = T.create(u.state.doc, w.before());
8842
8846
  }
8843
8847
  u.dispatch(u.state.tr.setSelection(k)), u.state.selection instanceof T && u.state.selection.node.type.name === "listItem" && (e = f.parentElement.tagName);
8844
- const I = u.state.selection.content(), { dom: M, text: v } = wd(u, I);
8848
+ const I = u.state.selection.content(), { dom: M, text: v } = Dd(u, I);
8845
8849
  d.dataTransfer.clearData(), d.dataTransfer.setData("text/html", M.innerHTML), d.dataTransfer.setData("text/plain", v), d.dataTransfer.effectAllowed = "copyMove", d.dataTransfer.setDragImage(f, 0, 0), u.dragging = { slice: I, move: d.ctrlKey };
8846
8850
  }
8847
8851
  let r = null;
@@ -8877,8 +8881,8 @@ function Md(n) {
8877
8881
  const f = u.closest(".drag-handle") || u.classList.contains("drag-handle"), m = u.closest(".tiptap") || u.classList.contains("tiptap");
8878
8882
  !f && !m && !t && i();
8879
8883
  }
8880
- return new Fa({
8881
- key: new $a(n.pluginKey),
8884
+ return new $a({
8885
+ key: new Ha(n.pluginKey),
8882
8886
  view: (d) => {
8883
8887
  var b, g, y, C;
8884
8888
  const u = n.dragHandleSelector ? document.querySelector(n.dragHandleSelector) : null;
@@ -8934,7 +8938,7 @@ function Md(n) {
8934
8938
  b != null && b >= 0 && (r.dataset.nodePos = String(
8935
8939
  Ut(b, d)
8936
8940
  ));
8937
- const g = window.getComputedStyle(f), y = parseInt(g.lineHeight, 10), C = isNaN(y) ? parseInt(g.fontSize) * 1.2 : y, O = parseInt(g.paddingTop, 10), k = Dd(f);
8941
+ const g = window.getComputedStyle(f), y = parseInt(g.lineHeight, 10), C = isNaN(y) ? parseInt(g.fontSize) * 1.2 : y, O = parseInt(g.paddingTop, 10), k = Md(f);
8938
8942
  k.top += (C - 24) / 2, k.top += O, f.matches("ul:not([data-type=taskList]) li, ol li") && (k.left -= n.dragHandleWidth - 28), k.width = n.dragHandleWidth, r && (r.style.position = "absolute", r.style.left = `${k.left - k.width}px`, r.style.top = `${k.top}px`, s());
8939
8943
  },
8940
8944
  keydown: () => {
@@ -8994,7 +8998,7 @@ function Md(n) {
8994
8998
  }
8995
8999
  });
8996
9000
  }
8997
- const Od = Pl.create({
9001
+ const vd = zl.create({
8998
9002
  name: "globalDragHandle",
8999
9003
  addOptions() {
9000
9004
  return {
@@ -9006,7 +9010,7 @@ const Od = Pl.create({
9006
9010
  },
9007
9011
  addProseMirrorPlugins() {
9008
9012
  return [
9009
- Md({
9013
+ Od({
9010
9014
  pluginKey: "globalDragHandle",
9011
9015
  dragHandleWidth: this.options.dragHandleWidth,
9012
9016
  scrollTreshold: this.options.scrollTreshold,
@@ -9016,18 +9020,18 @@ const Od = Pl.create({
9016
9020
  })
9017
9021
  ];
9018
9022
  }
9019
- }), vd = sl, Id = Ys.configure({
9023
+ }), Id = ll, Ad = Gs.configure({
9020
9024
  placeholder: "撰写任何内容,或者按“/”输入命令..."
9021
- }), Ad = Gs.configure({
9025
+ }), Ed = Xs.configure({
9022
9026
  HTMLAttributes: {
9023
9027
  class: le(
9024
9028
  "text-muted-foreground underline underline-offset-[3px] hover:text-primary transition-colors cursor-pointer"
9025
9029
  )
9026
9030
  }
9027
- }), Ed = Xs.extend({
9031
+ }), Rd = _s.extend({
9028
9032
  addProseMirrorPlugins() {
9029
9033
  return [
9030
- _s({
9034
+ Zs({
9031
9035
  imageClass: le("opacity-40 rounded-lg border border-stone-200")
9032
9036
  })
9033
9037
  ];
@@ -9037,24 +9041,24 @@ const Od = Pl.create({
9037
9041
  HTMLAttributes: {
9038
9042
  class: le("rounded-lg border border-muted")
9039
9043
  }
9040
- }), Rd = Zs.configure({
9044
+ }), Pd = Qs.configure({
9041
9045
  HTMLAttributes: {
9042
9046
  class: le("rounded-lg border border-muted")
9043
9047
  }
9044
- }), Pd = Qs.configure({
9048
+ }), zd = el.configure({
9045
9049
  HTMLAttributes: {
9046
9050
  class: le("not-prose pl-2 ")
9047
9051
  }
9048
- }), zd = el.configure({
9052
+ }), Bd = tl.configure({
9049
9053
  HTMLAttributes: {
9050
9054
  class: le("flex gap-2 items-start my-4")
9051
9055
  },
9052
9056
  nested: !0
9053
- }), Bd = tl.configure({
9057
+ }), Ld = nl.configure({
9054
9058
  HTMLAttributes: {
9055
9059
  class: le("mt-4 mb-6 border-t border-muted-foreground")
9056
9060
  }
9057
- }), Ld = nl.configure({
9061
+ }), Vd = ol.configure({
9058
9062
  bulletList: {
9059
9063
  HTMLAttributes: {
9060
9064
  class: le("list-disc list-outside leading-3 -mt-2")
@@ -9094,18 +9098,18 @@ const Od = Pl.create({
9094
9098
  width: 4
9095
9099
  },
9096
9100
  gapcursor: !1
9097
- }), Vd = ol.configure({
9101
+ }), Fd = rl.configure({
9098
9102
  // configure lowlight: common / all / use highlightJS in case there is a need to specify certain language grammars only
9099
9103
  // common: covers 37 language grammars which should be good enough in most cases
9100
- lowlight: El(Rl)
9101
- }), Fd = rl.configure({
9104
+ lowlight: Rl(Pl)
9105
+ }), $d = il.configure({
9102
9106
  HTMLAttributes: {
9103
9107
  class: le("text-foreground rounded p-1 hover:bg-accent cursor-pointer")
9104
9108
  },
9105
9109
  katexOptions: {
9106
9110
  throwOnError: !1
9107
9111
  }
9108
- }), $d = il.configure(), Hd = Il.configure({
9112
+ }), Hd = sl.configure(), qd = Al.configure({
9109
9113
  html: !0,
9110
9114
  tightLists: !0,
9111
9115
  tightListClass: "tight",
@@ -9114,30 +9118,30 @@ const Od = Pl.create({
9114
9118
  breaks: !1,
9115
9119
  transformPastedText: !1,
9116
9120
  transformCopiedText: !1
9117
- }), qd = Od.configure({
9121
+ }), Wd = vd.configure({
9118
9122
  dragHandleWidth: 56,
9119
9123
  dragHandleSelector: ".custom-drag-handle"
9120
9124
  }), Ti = [
9121
- Ld,
9122
- Id,
9125
+ Vd,
9123
9126
  Ad,
9124
9127
  Ed,
9125
9128
  Rd,
9126
9129
  Pd,
9127
9130
  zd,
9128
9131
  Bd,
9129
- vd,
9130
- Vd,
9132
+ Ld,
9133
+ Id,
9131
9134
  Fd,
9132
9135
  $d,
9133
- ll,
9134
9136
  Hd,
9135
9137
  al,
9138
+ qd,
9136
9139
  cl,
9137
9140
  dl,
9138
9141
  ul,
9139
- qd
9140
- ], Wd = wt.Root, wi = wt.Trigger, ln = ne.forwardRef(({ className: n, align: e = "center", sideOffset: t = 4, ...o }, r) => /* @__PURE__ */ h(wt.Portal, { children: /* @__PURE__ */ h(
9142
+ hl,
9143
+ Wd
9144
+ ], Jd = wt.Root, wi = wt.Trigger, ln = ne.forwardRef(({ className: n, align: e = "center", sideOffset: t = 4, ...o }, r) => /* @__PURE__ */ h(wt.Portal, { children: /* @__PURE__ */ h(
9141
9145
  wt.Content,
9142
9146
  {
9143
9147
  ref: r,
@@ -9151,7 +9155,7 @@ const Od = Pl.create({
9151
9155
  }
9152
9156
  ) }));
9153
9157
  ln.displayName = wt.Content.displayName;
9154
- const Jd = Al(
9158
+ const Kd = El(
9155
9159
  "inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",
9156
9160
  {
9157
9161
  variants: {
@@ -9177,9 +9181,9 @@ const Jd = Al(
9177
9181
  }
9178
9182
  ), be = ne.forwardRef(
9179
9183
  ({ className: n, variant: e, size: t, asChild: o = !1, ...r }, i) => /* @__PURE__ */ h(
9180
- o ? Bl : "button",
9184
+ o ? Ll : "button",
9181
9185
  {
9182
- className: D(Jd({ variant: e, size: t, className: n })),
9186
+ className: D(Kd({ variant: e, size: t, className: n })),
9183
9187
  ref: i,
9184
9188
  ...r
9185
9189
  }
@@ -9294,7 +9298,7 @@ const _o = [
9294
9298
  showArrow: !1,
9295
9299
  ...n
9296
9300
  }
9297
- ), Kd = ({ open: n, onOpenChange: e }) => {
9301
+ ), Ud = ({ open: n, onOpenChange: e }) => {
9298
9302
  const { editor: t } = xe();
9299
9303
  if (!t) return null;
9300
9304
  const o = _o.find(
@@ -9302,7 +9306,7 @@ const _o = [
9302
9306
  ), r = Zo.find(
9303
9307
  ({ color: i }) => t.isActive("highlight", { color: i })
9304
9308
  );
9305
- return /* @__PURE__ */ x(Wd, { modal: !0, open: n, onOpenChange: e, children: [
9309
+ return /* @__PURE__ */ x(Jd, { modal: !0, open: n, onOpenChange: e, children: [
9306
9310
  /* @__PURE__ */ h(ot, { overlay: "文本颜色", placement: "top", children: /* @__PURE__ */ h(wi, { asChild: !0, children: /* @__PURE__ */ x(be, { size: "sm", className: "gap-1 rounded-md pr-0", variant: "ghost", children: [
9307
9311
  /* @__PURE__ */ h(
9308
9312
  "span",
@@ -9383,15 +9387,15 @@ const _o = [
9383
9387
  )
9384
9388
  ] });
9385
9389
  };
9386
- function Ud(n) {
9390
+ function jd(n) {
9387
9391
  try {
9388
9392
  return new URL(n), !0;
9389
9393
  } catch {
9390
9394
  return !1;
9391
9395
  }
9392
9396
  }
9393
- function jd(n) {
9394
- if (Ud(n)) return n;
9397
+ function Yd(n) {
9398
+ if (jd(n)) return n;
9395
9399
  try {
9396
9400
  if (n.includes(".") && !n.includes(" "))
9397
9401
  return new URL(`https://${n}`).toString();
@@ -9399,20 +9403,20 @@ function jd(n) {
9399
9403
  return null;
9400
9404
  }
9401
9405
  }
9402
- const Yd = ({ open: n, onOpenChange: e }) => {
9406
+ const Gd = ({ open: n, onOpenChange: e }) => {
9403
9407
  const t = mt(null), { editor: o } = xe();
9404
9408
  return $e(() => {
9405
9409
  var r;
9406
9410
  (r = t.current) == null || r.focus();
9407
9411
  }), o ? /* @__PURE__ */ x(gr, { modal: !0, open: n, onOpenChange: e, children: [
9408
- /* @__PURE__ */ h(ot, { overlay: "添加链接", placement: "top", children: /* @__PURE__ */ h(zl, { asChild: !0, children: /* @__PURE__ */ x(
9412
+ /* @__PURE__ */ h(ot, { overlay: "添加链接", placement: "top", children: /* @__PURE__ */ h(Bl, { asChild: !0, children: /* @__PURE__ */ x(
9409
9413
  be,
9410
9414
  {
9411
9415
  size: "sm",
9412
9416
  variant: "ghost",
9413
9417
  className: "gap-2 rounded-md border-none",
9414
9418
  children: [
9415
- /* @__PURE__ */ h("p", { className: "text-base", children: /* @__PURE__ */ h(rs, { size: 16 }) }),
9419
+ /* @__PURE__ */ h("p", { className: "text-base", children: /* @__PURE__ */ h(is, { size: 16 }) }),
9416
9420
  /* @__PURE__ */ h(
9417
9421
  "p",
9418
9422
  {
@@ -9434,7 +9438,7 @@ const Yd = ({ open: n, onOpenChange: e }) => {
9434
9438
  onSubmit: (r) => {
9435
9439
  const i = r.currentTarget;
9436
9440
  r.preventDefault();
9437
- const s = i[0], l = jd(s.value);
9441
+ const s = i[0], l = Yd(s.value);
9438
9442
  l && (o.chain().focus().setLink({ href: l }).run(), e(!1));
9439
9443
  },
9440
9444
  className: "flex p-1 ",
@@ -9466,7 +9470,7 @@ const Yd = ({ open: n, onOpenChange: e }) => {
9466
9470
  }
9467
9471
  ) })
9468
9472
  ] }) : null;
9469
- }, Gd = () => {
9473
+ }, Xd = () => {
9470
9474
  const { editor: n } = xe();
9471
9475
  return n ? /* @__PURE__ */ h(ot, { overlay: "标记为公式", placement: "top", children: /* @__PURE__ */ h(
9472
9476
  be,
@@ -9484,7 +9488,7 @@ const Yd = ({ open: n, onOpenChange: e }) => {
9484
9488
  }
9485
9489
  },
9486
9490
  children: /* @__PURE__ */ h(
9487
- Ll,
9491
+ Vl,
9488
9492
  {
9489
9493
  className: D("size-4", { "text-blue-500": n.isActive("math") }),
9490
9494
  strokeWidth: 2.3
@@ -9556,7 +9560,7 @@ const Yd = ({ open: n, onOpenChange: e }) => {
9556
9560
  command: (n) => n.chain().focus().clearNodes().toggleCodeBlock().run(),
9557
9561
  isActive: (n) => n.isActive("codeBlock")
9558
9562
  }
9559
- ], Xd = ({ open: n, onOpenChange: e }) => {
9563
+ ], _d = ({ open: n, onOpenChange: e }) => {
9560
9564
  const { editor: t } = xe();
9561
9565
  if (!t) return null;
9562
9566
  const o = Bn.filter(
@@ -9616,7 +9620,7 @@ const Yd = ({ open: n, onOpenChange: e }) => {
9616
9620
  )
9617
9621
  );
9618
9622
  dt.displayName = br.Root.displayName;
9619
- const _d = () => /* @__PURE__ */ x("div", { className: "flex items-center justify-center gap-0.5", children: [
9623
+ const Zd = () => /* @__PURE__ */ x("div", { className: "flex items-center justify-center gap-0.5", children: [
9620
9624
  /* @__PURE__ */ h("div", { className: "h-1.5 w-1.5 animate-bounce rounded-full bg-purple-500 [animation-delay:-0.3s]" }),
9621
9625
  /* @__PURE__ */ h("div", { className: "h-1.5 w-1.5 animate-bounce rounded-full bg-purple-500 [animation-delay:-0.15s]" }),
9622
9626
  /* @__PURE__ */ h("div", { className: "h-1.5 w-1.5 animate-bounce rounded-full bg-purple-500" })
@@ -9650,8 +9654,8 @@ const Mi = ne.forwardRef(({ className: n, orientation: e = "vertical", ...t }, o
9650
9654
  }
9651
9655
  ));
9652
9656
  Mi.displayName = Ze.ScrollAreaScrollbar.displayName;
9653
- const Zd = Te.Portal, Oi = ne.forwardRef(({ className: n, ...e }, t) => /* @__PURE__ */ h(
9654
- Te.Overlay,
9657
+ const Qd = we.Portal, Oi = ne.forwardRef(({ className: n, ...e }, t) => /* @__PURE__ */ h(
9658
+ we.Overlay,
9655
9659
  {
9656
9660
  ref: t,
9657
9661
  className: D(
@@ -9661,11 +9665,11 @@ const Zd = Te.Portal, Oi = ne.forwardRef(({ className: n, ...e }, t) => /* @__PU
9661
9665
  ...e
9662
9666
  }
9663
9667
  ));
9664
- Oi.displayName = Te.Overlay.displayName;
9665
- const Qd = ne.forwardRef(({ className: n, children: e, ...t }, o) => /* @__PURE__ */ x(Zd, { children: [
9668
+ Oi.displayName = we.Overlay.displayName;
9669
+ const eu = ne.forwardRef(({ className: n, children: e, ...t }, o) => /* @__PURE__ */ x(Qd, { children: [
9666
9670
  /* @__PURE__ */ h(Oi, {}),
9667
9671
  /* @__PURE__ */ x(
9668
- Te.Content,
9672
+ we.Content,
9669
9673
  {
9670
9674
  ref: o,
9671
9675
  className: D(
@@ -9675,17 +9679,17 @@ const Qd = ne.forwardRef(({ className: n, children: e, ...t }, o) => /* @__PURE_
9675
9679
  ...t,
9676
9680
  children: [
9677
9681
  e,
9678
- /* @__PURE__ */ x(Te.Close, { className: "absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground", children: [
9679
- /* @__PURE__ */ h(Vl, { className: "h-4 w-4" }),
9682
+ /* @__PURE__ */ x(we.Close, { className: "absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground", children: [
9683
+ /* @__PURE__ */ h(Fl, { className: "h-4 w-4" }),
9680
9684
  /* @__PURE__ */ h("span", { className: "sr-only", children: "Close" })
9681
9685
  ] })
9682
9686
  ]
9683
9687
  }
9684
9688
  )
9685
9689
  ] }));
9686
- Qd.displayName = Te.Content.displayName;
9687
- const eu = ne.forwardRef(({ className: n, ...e }, t) => /* @__PURE__ */ h(
9688
- Te.Title,
9690
+ eu.displayName = we.Content.displayName;
9691
+ const tu = ne.forwardRef(({ className: n, ...e }, t) => /* @__PURE__ */ h(
9692
+ we.Title,
9689
9693
  {
9690
9694
  ref: t,
9691
9695
  className: D(
@@ -9695,16 +9699,16 @@ const eu = ne.forwardRef(({ className: n, ...e }, t) => /* @__PURE__ */ h(
9695
9699
  ...e
9696
9700
  }
9697
9701
  ));
9698
- eu.displayName = Te.Title.displayName;
9699
- const tu = ne.forwardRef(({ className: n, ...e }, t) => /* @__PURE__ */ h(
9700
- Te.Description,
9702
+ tu.displayName = we.Title.displayName;
9703
+ const nu = ne.forwardRef(({ className: n, ...e }, t) => /* @__PURE__ */ h(
9704
+ we.Description,
9701
9705
  {
9702
9706
  ref: t,
9703
9707
  className: D("text-sm text-muted-foreground", n),
9704
9708
  ...e
9705
9709
  }
9706
9710
  ));
9707
- tu.displayName = Te.Description.displayName;
9711
+ nu.displayName = we.Description.displayName;
9708
9712
  const vi = ne.forwardRef(({ className: n, ...e }, t) => /* @__PURE__ */ h(
9709
9713
  ce,
9710
9714
  {
@@ -9732,7 +9736,7 @@ const Ii = ne.forwardRef(({ className: n, ...e }, t) => /* @__PURE__ */ x("div",
9732
9736
  )
9733
9737
  ] }));
9734
9738
  Ii.displayName = ce.Input.displayName;
9735
- const nu = ne.forwardRef(({ className: n, ...e }, t) => /* @__PURE__ */ h(
9739
+ const ou = ne.forwardRef(({ className: n, ...e }, t) => /* @__PURE__ */ h(
9736
9740
  ce.List,
9737
9741
  {
9738
9742
  ref: t,
@@ -9740,8 +9744,8 @@ const nu = ne.forwardRef(({ className: n, ...e }, t) => /* @__PURE__ */ h(
9740
9744
  ...e
9741
9745
  }
9742
9746
  ));
9743
- nu.displayName = ce.List.displayName;
9744
- const ou = ne.forwardRef((n, e) => /* @__PURE__ */ h(
9747
+ ou.displayName = ce.List.displayName;
9748
+ const ru = ne.forwardRef((n, e) => /* @__PURE__ */ h(
9745
9749
  ce.Empty,
9746
9750
  {
9747
9751
  ref: e,
@@ -9749,7 +9753,7 @@ const ou = ne.forwardRef((n, e) => /* @__PURE__ */ h(
9749
9753
  ...n
9750
9754
  }
9751
9755
  ));
9752
- ou.displayName = ce.Empty.displayName;
9756
+ ru.displayName = ce.Empty.displayName;
9753
9757
  const zt = ne.forwardRef(({ className: n, ...e }, t) => /* @__PURE__ */ h(
9754
9758
  ce.Group,
9755
9759
  {
@@ -9783,7 +9787,7 @@ const ft = ne.forwardRef(({ className: n, ...e }, t) => /* @__PURE__ */ h(
9783
9787
  }
9784
9788
  ));
9785
9789
  ft.displayName = ce.Item.displayName;
9786
- const ru = ({
9790
+ const iu = ({
9787
9791
  completion: n,
9788
9792
  onDiscard: e
9789
9793
  }) => {
@@ -9806,7 +9810,7 @@ const ru = ({
9806
9810
  ).run();
9807
9811
  },
9808
9812
  children: [
9809
- /* @__PURE__ */ h(Fl, { className: "h-4 w-4 text-muted-foreground" }),
9813
+ /* @__PURE__ */ h($l, { className: "h-4 w-4 text-muted-foreground" }),
9810
9814
  "替换选择"
9811
9815
  ]
9812
9816
  }
@@ -9821,7 +9825,7 @@ const ru = ({
9821
9825
  t.chain().focus().insertContentAt(o.to + 1, n).run();
9822
9826
  },
9823
9827
  children: [
9824
- /* @__PURE__ */ h($l, { className: "h-4 w-4 text-muted-foreground" }),
9828
+ /* @__PURE__ */ h(Hl, { className: "h-4 w-4 text-muted-foreground" }),
9825
9829
  "在下面插入"
9826
9830
  ]
9827
9831
  }
@@ -9829,41 +9833,41 @@ const ru = ({
9829
9833
  ] }),
9830
9834
  /* @__PURE__ */ h(Qn, {}),
9831
9835
  /* @__PURE__ */ h(zt, { children: /* @__PURE__ */ x(ft, { onSelect: e, value: "thrash", className: "gap-2 px-4", children: [
9832
- /* @__PURE__ */ h(Hl, { className: "h-4 w-4 text-muted-foreground" }),
9836
+ /* @__PURE__ */ h(ql, { className: "h-4 w-4 text-muted-foreground" }),
9833
9837
  "丢弃"
9834
9838
  ] }) })
9835
9839
  ] });
9836
- }, iu = [
9840
+ }, su = [
9837
9841
  {
9838
9842
  value: "improve",
9839
9843
  label: "改进写作",
9840
9844
  // Improve writing
9841
- icon: ql
9845
+ icon: Wl
9842
9846
  },
9843
9847
  {
9844
9848
  value: "fix",
9845
9849
  label: "修正语法",
9846
9850
  // Fix grammar
9847
- icon: Wl
9851
+ icon: Jl
9848
9852
  },
9849
9853
  {
9850
9854
  value: "shorter",
9851
9855
  label: "缩短文本",
9852
9856
  // Make shorter
9853
- icon: Jl
9857
+ icon: Kl
9854
9858
  },
9855
9859
  {
9856
9860
  value: "longer",
9857
9861
  label: "扩展文本",
9858
9862
  // Make longer
9859
- icon: Kl
9863
+ icon: Ul
9860
9864
  }
9861
- ], su = ({ onSelect: n }) => {
9865
+ ], lu = ({ onSelect: n }) => {
9862
9866
  const { editor: e } = xe();
9863
9867
  return /* @__PURE__ */ x(rt, { children: [
9864
9868
  /* @__PURE__ */ x(zt, { heading: "编辑或校对选中文本", children: [
9865
9869
  " ",
9866
- iu.map((t) => /* @__PURE__ */ x(
9870
+ su.map((t) => /* @__PURE__ */ x(
9867
9871
  ft,
9868
9872
  {
9869
9873
  onSelect: (o) => {
@@ -9889,13 +9893,13 @@ const ru = ({
9889
9893
  ft,
9890
9894
  {
9891
9895
  onSelect: () => {
9892
- const t = e.state.selection.from, o = hl(e, t);
9896
+ const t = e.state.selection.from, o = fl(e, t);
9893
9897
  n(o, "continue");
9894
9898
  },
9895
9899
  value: "continue",
9896
9900
  className: "gap-2 px-4",
9897
9901
  children: [
9898
- /* @__PURE__ */ h(Ul, { className: "h-4 w-4 text-purple-500" }),
9902
+ /* @__PURE__ */ h(jl, { className: "h-4 w-4 text-purple-500" }),
9899
9903
  "继续写作"
9900
9904
  ]
9901
9905
  }
@@ -9903,8 +9907,8 @@ const ru = ({
9903
9907
  ] })
9904
9908
  ] });
9905
9909
  };
9906
- function lu({ onOpenChange: n, options: e }) {
9907
- const { editor: t } = xe(), [o, r] = J(""), { completion: i, complete: s, isLoading: l } = Ql({
9910
+ function au({ onOpenChange: n, options: e }) {
9911
+ const { editor: t } = xe(), [o, r] = J(""), { completion: i, complete: s, isLoading: l } = ea({
9908
9912
  // id: "novel",
9909
9913
  api: "/api/generate",
9910
9914
  onResponse: (c) => {
@@ -9923,7 +9927,7 @@ function lu({ onOpenChange: n, options: e }) {
9923
9927
  l && /* @__PURE__ */ x("div", { className: "flex h-12 w-full items-center px-4 text-sm font-medium text-muted-foreground text-purple-500", children: [
9924
9928
  /* @__PURE__ */ h(Fn, { size: 14, className: "mr-2 shrink-0" }),
9925
9929
  "AI正在思考",
9926
- /* @__PURE__ */ h("div", { className: "ml-2 mt-1", children: /* @__PURE__ */ h(_d, {}) })
9930
+ /* @__PURE__ */ h("div", { className: "ml-2 mt-1", children: /* @__PURE__ */ h(Zd, {}) })
9927
9931
  ] }),
9928
9932
  !l && /* @__PURE__ */ x(rt, { children: [
9929
9933
  /* @__PURE__ */ x("div", { className: "relative", children: [
@@ -9934,7 +9938,7 @@ function lu({ onOpenChange: n, options: e }) {
9934
9938
  onValueChange: r,
9935
9939
  autoFocus: !0,
9936
9940
  placeholder: a ? "告诉AI下一步该怎么做" : "要求AI编辑或生成……",
9937
- onFocus: () => fl(t)
9941
+ onFocus: () => pl(t)
9938
9942
  }
9939
9943
  ),
9940
9944
  /* @__PURE__ */ h(
@@ -9954,12 +9958,12 @@ function lu({ onOpenChange: n, options: e }) {
9954
9958
  body: { option: "zap", command: o }
9955
9959
  }).then(() => r(""));
9956
9960
  },
9957
- children: /* @__PURE__ */ h(jl, { className: "h-4 w-4" })
9961
+ children: /* @__PURE__ */ h(Yl, { className: "h-4 w-4" })
9958
9962
  }
9959
9963
  )
9960
9964
  ] }),
9961
9965
  a ? /* @__PURE__ */ h(
9962
- ru,
9966
+ iu,
9963
9967
  {
9964
9968
  onDiscard: () => {
9965
9969
  t.chain().unsetHighlight().focus().run(), n(!1);
@@ -9967,7 +9971,7 @@ function lu({ onOpenChange: n, options: e }) {
9967
9971
  completion: i
9968
9972
  }
9969
9973
  ) : /* @__PURE__ */ h(
9970
- su,
9974
+ lu,
9971
9975
  {
9972
9976
  onSelect: (c, d) => s(c, { body: { option: d } })
9973
9977
  }
@@ -9975,7 +9979,7 @@ function lu({ onOpenChange: n, options: e }) {
9975
9979
  ] })
9976
9980
  ] });
9977
9981
  }
9978
- const au = ({
9982
+ const cu = ({
9979
9983
  children: n,
9980
9984
  open: e,
9981
9985
  onOpenChange: t,
@@ -9984,9 +9988,9 @@ const au = ({
9984
9988
  }) => {
9985
9989
  const { editor: i } = xe();
9986
9990
  return $e(() => {
9987
- e || pl(i);
9991
+ e || ml(i);
9988
9992
  }, [e]), /* @__PURE__ */ x(
9989
- ml,
9993
+ gl,
9990
9994
  {
9991
9995
  tippyOptions: {
9992
9996
  placement: e ? "bottom-start" : "top",
@@ -9997,14 +10001,14 @@ const au = ({
9997
10001
  className: "flex w-fit max-w-[90vw] overflow-hidden rounded-lg border border-muted bg-background shadow-xl p-1 gap-1",
9998
10002
  children: [
9999
10003
  e && o && /* @__PURE__ */ h(
10000
- lu,
10004
+ au,
10001
10005
  {
10002
10006
  open: e,
10003
10007
  onOpenChange: t,
10004
10008
  options: r
10005
10009
  }
10006
10010
  ),
10007
- !e && /* @__PURE__ */ x(Vi, { children: [
10011
+ !e && /* @__PURE__ */ x(Fi, { children: [
10008
10012
  o && /* @__PURE__ */ x(
10009
10013
  be,
10010
10014
  {
@@ -10023,7 +10027,7 @@ const au = ({
10023
10027
  ]
10024
10028
  }
10025
10029
  );
10026
- }, cu = (n) => {
10030
+ }, du = (n) => {
10027
10031
  const e = fetch("/api/upload", {
10028
10032
  method: "POST",
10029
10033
  headers: {
@@ -10049,10 +10053,10 @@ const au = ({
10049
10053
  }
10050
10054
  );
10051
10055
  });
10052
- }, du = mr({
10053
- onUpload: cu,
10056
+ }, uu = mr({
10057
+ onUpload: du,
10054
10058
  validateFn: (n) => n.type.includes("image/") ? n.size / 1024 / 1024 > 20 ? (Dt.error("File size too big (max 20MB)."), !1) : !0 : (Dt.error("File type not supported."), !1)
10055
- }), uu = () => {
10059
+ }), hu = () => {
10056
10060
  const { editor: n } = xe();
10057
10061
  return n ? /* @__PURE__ */ h("div", { className: "flex", children: [
10058
10062
  {
@@ -10060,35 +10064,35 @@ const au = ({
10060
10064
  // bold
10061
10065
  isActive: (t) => t.isActive("bold"),
10062
10066
  command: (t) => t.chain().focus().toggleBold().run(),
10063
- icon: Yl
10067
+ icon: Gl
10064
10068
  },
10065
10069
  {
10066
10070
  name: "斜体",
10067
10071
  // italic
10068
10072
  isActive: (t) => t.isActive("italic"),
10069
10073
  command: (t) => t.chain().focus().toggleItalic().run(),
10070
- icon: Gl
10074
+ icon: Xl
10071
10075
  },
10072
10076
  {
10073
10077
  name: "下划线",
10074
10078
  // underline
10075
10079
  isActive: (t) => t.isActive("underline"),
10076
10080
  command: (t) => t.chain().focus().toggleUnderline().run(),
10077
- icon: Xl
10081
+ icon: _l
10078
10082
  },
10079
10083
  {
10080
10084
  name: "删除线",
10081
10085
  // strike
10082
10086
  isActive: (t) => t.isActive("strike"),
10083
10087
  command: (t) => t.chain().focus().toggleStrike().run(),
10084
- icon: _l
10088
+ icon: Zl
10085
10089
  },
10086
10090
  {
10087
10091
  name: "代码",
10088
10092
  // code
10089
10093
  isActive: (t) => t.isActive("code"),
10090
10094
  command: (t) => t.chain().focus().toggleCode().run(),
10091
- icon: Zl
10095
+ icon: Ql
10092
10096
  }
10093
10097
  ].map((t) => /* @__PURE__ */ h(
10094
10098
  Xt,
@@ -10116,7 +10120,7 @@ const au = ({
10116
10120
  },
10117
10121
  t.name
10118
10122
  )) }) : null;
10119
- }, Ai = ({ uploadFn: n }) => bl([
10123
+ }, Ai = ({ uploadFn: n }) => yl([
10120
10124
  {
10121
10125
  title: "文本",
10122
10126
  // "Text",
@@ -10218,7 +10222,7 @@ const au = ({
10218
10222
  description: "从您的计算机上传图像。",
10219
10223
  // "Upload an image from your computer.",
10220
10224
  searchTerms: ["photo", "picture", "media"],
10221
- icon: /* @__PURE__ */ h(is, { size: 18 }),
10225
+ icon: /* @__PURE__ */ h(ss, { size: 18 }),
10222
10226
  command: ({ editor: e, range: t }) => {
10223
10227
  e.chain().focus().deleteRange(t).run();
10224
10228
  const o = document.createElement("input");
@@ -10231,15 +10235,15 @@ const au = ({
10231
10235
  }, o.click();
10232
10236
  }
10233
10237
  }
10234
- ]), hu = (n) => gl.configure({
10238
+ ]), fu = (n) => bl.configure({
10235
10239
  suggestion: {
10236
10240
  items: () => Ai(n),
10237
- render: yl
10241
+ render: kl
10238
10242
  }
10239
- }), fu = {
10243
+ }), pu = {
10240
10244
  type: "doc",
10241
10245
  content: []
10242
- }, Ei = Fi(({ children: n, items: e, ...t }, o) => {
10246
+ }, Ei = $i(({ children: n, items: e, ...t }, o) => {
10243
10247
  const r = (s) => /* @__PURE__ */ x(
10244
10248
  qt.Item,
10245
10249
  {
@@ -10261,7 +10265,7 @@ const au = ({
10261
10265
  return /* @__PURE__ */ h(
10262
10266
  qt.SubMenu,
10263
10267
  {
10264
- expandIcon: /* @__PURE__ */ h(ss, { size: 16 }),
10268
+ expandIcon: /* @__PURE__ */ h(ls, { size: 16 }),
10265
10269
  popupClassName: D(
10266
10270
  "!rounded-lg border border-muted bg-background shadow-xl !p-2 min-w-48 !m-0 z-[1080]",
10267
10271
  S`
@@ -10299,7 +10303,7 @@ const au = ({
10299
10303
  );
10300
10304
  };
10301
10305
  return /* @__PURE__ */ h(
10302
- ta,
10306
+ na,
10303
10307
  {
10304
10308
  ref: o,
10305
10309
  trigger: "click",
@@ -10326,7 +10330,7 @@ const au = ({
10326
10330
  );
10327
10331
  });
10328
10332
  Ei.displayName = "DropdownMenu";
10329
- const pu = ({ children: n, ...e }) => {
10333
+ const mu = ({ children: n, ...e }) => {
10330
10334
  const { editor: t } = xe(), o = () => {
10331
10335
  t && t.state.selection instanceof T && (t.commands.deleteSelection(), t.commands.focus());
10332
10336
  }, r = () => {
@@ -10351,13 +10355,13 @@ const pu = ({ children: n, ...e }) => {
10351
10355
  {
10352
10356
  key: "transform",
10353
10357
  type: "submenu",
10354
- icon: /* @__PURE__ */ h(ls, { size: 16 }),
10358
+ icon: /* @__PURE__ */ h(as, { size: 16 }),
10355
10359
  label: "转换成",
10356
10360
  children: i
10357
10361
  },
10358
10362
  {
10359
10363
  key: "duplicate",
10360
- icon: /* @__PURE__ */ h(as, { size: 16 }),
10364
+ icon: /* @__PURE__ */ h(cs, { size: 16 }),
10361
10365
  label: "创建副本",
10362
10366
  onClick: r
10363
10367
  },
@@ -10370,7 +10374,7 @@ const pu = ({ children: n, ...e }) => {
10370
10374
  onClick: o
10371
10375
  }
10372
10376
  ], ...e, children: n });
10373
- }, mu = () => {
10377
+ }, gu = () => {
10374
10378
  const { editor: n } = xe(), e = (t) => {
10375
10379
  if (!n) return;
10376
10380
  const o = t.target.closest(".custom-drag-handle");
@@ -10409,12 +10413,12 @@ const pu = ({ children: n, ...e }) => {
10409
10413
  variant: "ghost",
10410
10414
  className: "w-auto h-auto p-0.5",
10411
10415
  onClick: e,
10412
- children: /* @__PURE__ */ h(cs, { className: "cursor-pointer", size: 22 })
10416
+ children: /* @__PURE__ */ h(ds, { className: "cursor-pointer", size: 22 })
10413
10417
  }
10414
10418
  )
10415
10419
  }
10416
10420
  ),
10417
- /* @__PURE__ */ h(pu, { children: /* @__PURE__ */ h(
10421
+ /* @__PURE__ */ h(mu, { children: /* @__PURE__ */ h(
10418
10422
  ot,
10419
10423
  {
10420
10424
  placement: "bottom",
@@ -10422,13 +10426,13 @@ const pu = ({ children: n, ...e }) => {
10422
10426
  "拖动",
10423
10427
  /* @__PURE__ */ h("span", { className: "text-muted-foreground", children: "以移动" })
10424
10428
  ] }) }),
10425
- children: /* @__PURE__ */ h(be, { size: "icon", variant: "ghost", className: "w-auto h-auto p-0.5", children: /* @__PURE__ */ h(ds, { size: 22 }) })
10429
+ children: /* @__PURE__ */ h(be, { size: "icon", variant: "ghost", className: "w-auto h-auto p-0.5", children: /* @__PURE__ */ h(us, { size: 22 }) })
10426
10430
  }
10427
10431
  ) })
10428
10432
  ]
10429
10433
  }
10430
10434
  );
10431
- }, gu = (n) => {
10435
+ }, bu = (n) => {
10432
10436
  const {
10433
10437
  className: e,
10434
10438
  initialContent: t = {},
@@ -10446,9 +10450,9 @@ const pu = ({ children: n, ...e }) => {
10446
10450
  ), [p, b] = J("Saved"), [g, y] = J(), [C, O] = J(!1), [k, I] = J(!1), [M, v] = J(!1), [w, N] = J(!1), X = (R) => {
10447
10451
  const U = new DOMParser().parseFromString(R, "text/html");
10448
10452
  return U.querySelectorAll("pre code").forEach((V) => {
10449
- ea.highlightElement(V);
10453
+ ta.highlightElement(V);
10450
10454
  }), new XMLSerializer().serializeToString(U);
10451
- }, K = vl(
10455
+ }, K = Il(
10452
10456
  async (R) => {
10453
10457
  const U = R.getJSON();
10454
10458
  y(R.storage.characterCount.words()), o == null || o(U), i && (window.localStorage.setItem(
@@ -10461,13 +10465,13 @@ const pu = ({ children: n, ...e }) => {
10461
10465
  },
10462
10466
  500
10463
10467
  ), Ce = pt(() => {
10464
- if (!a) return du;
10468
+ if (!a) return uu;
10465
10469
  const {
10466
10470
  beforeUpload: R,
10467
10471
  maxSize: U,
10468
10472
  action: V,
10469
10473
  headers: de,
10470
- method: Oe,
10474
+ method: Se,
10471
10475
  name: an,
10472
10476
  onSuccess: Ft,
10473
10477
  onError: $t
@@ -10477,7 +10481,7 @@ const pu = ({ children: n, ...e }) => {
10477
10481
  const P = new FormData();
10478
10482
  P.append(an || "file", ze);
10479
10483
  const Q = fetch(V, {
10480
- method: Oe || "POST",
10484
+ method: Se || "POST",
10481
10485
  headers: {
10482
10486
  ...de
10483
10487
  },
@@ -10509,11 +10513,11 @@ const pu = ({ children: n, ...e }) => {
10509
10513
  if ($e(() => {
10510
10514
  if (!i) return;
10511
10515
  const R = window.localStorage.getItem(r);
10512
- m(R ? JSON.parse(R) : fu);
10516
+ m(R ? JSON.parse(R) : pu);
10513
10517
  }, [r, i]), !f) return null;
10514
- const Me = [
10518
+ const Oe = [
10515
10519
  ...Ti,
10516
- hu({
10520
+ fu({
10517
10521
  uploadFn: Ce
10518
10522
  })
10519
10523
  ];
@@ -10531,21 +10535,21 @@ const pu = ({ children: n, ...e }) => {
10531
10535
  }
10532
10536
  )
10533
10537
  ] }),
10534
- /* @__PURE__ */ h(kl, { children: /* @__PURE__ */ x(
10535
- xl,
10538
+ /* @__PURE__ */ h(xl, { children: /* @__PURE__ */ x(
10539
+ Cl,
10536
10540
  {
10537
10541
  onCreate: ({ editor: R }) => {
10538
10542
  c && (c.current = R);
10539
10543
  },
10540
10544
  initialContent: f,
10541
- extensions: Me,
10545
+ extensions: Oe,
10542
10546
  className: "relative min-h-[500px] w-full max-w-screen-lg border-muted bg-background sm:mb-[calc(20vh)] sm:rounded-lg sm:border sm:shadow-lg editor-content",
10543
10547
  editorProps: {
10544
10548
  handleDOMEvents: {
10545
- keydown: (R, U) => Nl(U)
10549
+ keydown: (R, U) => Tl(U)
10546
10550
  },
10547
- handlePaste: (R, U) => Sl(R, U, Ce),
10548
- handleDrop: (R, U, V, de) => Cl(R, U, de, Ce),
10551
+ handlePaste: (R, U) => Nl(R, U, Ce),
10552
+ handleDrop: (R, U, V, de) => Sl(R, U, de, Ce),
10549
10553
  attributes: {
10550
10554
  class: "prose prose-lg dark:prose-invert prose-headings:font-title font-default focus:outline-none max-w-full"
10551
10555
  }
@@ -10553,14 +10557,14 @@ const pu = ({ children: n, ...e }) => {
10553
10557
  onUpdate: ({ editor: R }) => {
10554
10558
  K(R), b("Unsaved");
10555
10559
  },
10556
- slotAfter: /* @__PURE__ */ h(Ol, {}),
10560
+ slotAfter: /* @__PURE__ */ h(vl, {}),
10557
10561
  children: [
10558
- /* @__PURE__ */ x(Tl, { className: "z-50 h-auto max-h-[330px] overflow-y-auto rounded-md border border-muted bg-background px-1 py-2 shadow-md transition-all", children: [
10559
- /* @__PURE__ */ h(wl, { className: "px-2 text-muted-foreground", children: "没有结果" }),
10560
- /* @__PURE__ */ h(Dl, { children: Ai({
10562
+ /* @__PURE__ */ x(wl, { className: "z-50 h-auto max-h-[330px] overflow-y-auto rounded-md border border-muted bg-background px-1 py-2 shadow-md transition-all", children: [
10563
+ /* @__PURE__ */ h(Dl, { className: "px-2 text-muted-foreground", children: "没有结果" }),
10564
+ /* @__PURE__ */ h(Ml, { children: Ai({
10561
10565
  uploadFn: Ce
10562
10566
  }).map((R) => /* @__PURE__ */ x(
10563
- Ml,
10567
+ Ol,
10564
10568
  {
10565
10569
  value: R.title,
10566
10570
  onCommand: (U) => R.command(U),
@@ -10577,7 +10581,7 @@ const pu = ({ children: n, ...e }) => {
10577
10581
  )) })
10578
10582
  ] }),
10579
10583
  /* @__PURE__ */ x(
10580
- au,
10584
+ cu,
10581
10585
  {
10582
10586
  open: w,
10583
10587
  onOpenChange: N,
@@ -10585,32 +10589,32 @@ const pu = ({ children: n, ...e }) => {
10585
10589
  aiOptions: u,
10586
10590
  children: [
10587
10591
  d && /* @__PURE__ */ h(dt, { orientation: "vertical" }),
10588
- /* @__PURE__ */ h(Xd, { open: C, onOpenChange: O }),
10592
+ /* @__PURE__ */ h(_d, { open: C, onOpenChange: O }),
10589
10593
  /* @__PURE__ */ h(dt, { orientation: "vertical" }),
10590
- /* @__PURE__ */ h(Yd, { open: M, onOpenChange: v }),
10594
+ /* @__PURE__ */ h(Gd, { open: M, onOpenChange: v }),
10591
10595
  /* @__PURE__ */ h(dt, { orientation: "vertical" }),
10592
- /* @__PURE__ */ h(Gd, {}),
10596
+ /* @__PURE__ */ h(Xd, {}),
10593
10597
  /* @__PURE__ */ h(dt, { orientation: "vertical" }),
10594
- /* @__PURE__ */ h(uu, {}),
10598
+ /* @__PURE__ */ h(hu, {}),
10595
10599
  /* @__PURE__ */ h(dt, { orientation: "vertical" }),
10596
- /* @__PURE__ */ h(Kd, { open: k, onOpenChange: I })
10600
+ /* @__PURE__ */ h(Ud, { open: k, onOpenChange: I })
10597
10601
  ]
10598
10602
  }
10599
10603
  ),
10600
- /* @__PURE__ */ h(mu, {})
10604
+ /* @__PURE__ */ h(gu, {})
10601
10605
  ]
10602
10606
  }
10603
10607
  ) })
10604
10608
  ] });
10605
- }, bu = ({ json: n }) => {
10606
- const e = pt(() => na(n ?? {}, Ti), [n]);
10609
+ }, yu = ({ json: n }) => {
10610
+ const e = pt(() => oa(n ?? {}, Ti), [n]);
10607
10611
  return /* @__PURE__ */ h("div", { className: "tiptap ProseMirror prose prose-lg dark:prose-invert prose-headings:font-title font-default focus:outline-none max-w-full", children: /* @__PURE__ */ h("div", { dangerouslySetInnerHTML: { __html: e } }) });
10608
- }, yu = gu;
10609
- yu.Preview = bu;
10612
+ }, ku = bu;
10613
+ ku.Preview = yu;
10610
10614
  export {
10611
- sh as Desktop,
10615
+ lh as Desktop,
10612
10616
  Ar as Dock,
10613
- yu as Editor,
10614
- Sa as Markdown,
10615
- Na as MdEditor
10617
+ ku as Editor,
10618
+ Na as Markdown,
10619
+ Ta as MdEditor
10616
10620
  };