@markweave/vue2 0.7.9 → 0.8.0

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.js CHANGED
@@ -23,50 +23,49 @@ import { saveMarkweaveBrowserFile as ue } from "markweave/internal/core/browser-
23
23
  import { createMarkweaveFrameScheduler as de } from "markweave/internal/editor-core/frame-scheduler";
24
24
  import { createMarkweaveEditorUpdatePayload as fe, getMarkweaveContentType as pe, isEditorContentCurrent as me, isMarkweaveControlledContentEchoCurrent as he, normalizeMarkweaveContentFormat as ge } from "markweave/internal/editor-core/editor-content";
25
25
  import { getCurrentFloatingToolbarBlockType as _e, getFloatingToolbarHighlightColorOptions as ve, getFloatingToolbarMoreActions as ye, getFloatingToolbarTextColorOptions as be, getFloatingToolbarTurnIntoOptions as xe, runFloatingToolbarMoreAction as Se, setFloatingToolbarTurnInto as Ce } from "markweave/internal/editor-core/floating-toolbar-model";
26
- import { openMarkweaveReadonlyLinkFromEvent as we } from "markweave/internal/editor-core/readonly-link";
27
- import { createMarkweaveEditorRuntimeSnapshot as Te } from "markweave/internal/editor-core/runtime-snapshot";
28
- import { areEditorSelectionSnapshotsEquivalent as Ee, calculateFloatingToolbarPopoverPlacement as De, createSelectionSnapshot as Oe, markweaveRuntimeProjectionDelayMs as ke, shouldShowFloatingToolbarForAiState as Ae } from "markweave/internal/editor-core/selection-state";
29
- import { normalizeMarkweaveCanvasColor as je, normalizeMarkweaveTheme as Me } from "markweave/internal/core/theme";
30
- import { createMarkweaveAiEditController as Ne } from "markweave/internal/plugins/ai-edit/ai-edit-controller";
31
- import { MarkweaveAskAiError as Pe, acceptMarkweaveAskAiResult as Fe, calculateMarkweaveAskAiPanelPosition as Ie, canStartMarkweaveAskAiTableTarget as Le, clearMarkweaveAskAiPreview as Re, clearMarkweaveAskAiTarget as ze, createMarkweaveAskAiRequest as Be, getMappedMarkweaveAskAiSelection as Ve, getMarkweaveAskAiSurfaceRect as He, getMarkweaveAskAiTarget as Ue, getMarkweaveAskAiTargetRect as We, hasMarkweaveAskAiPreview as Ge, isMarkweaveAskAiSelectionEligible as Ke, restoreMarkweaveAskAiTargetSelection as qe, runMarkweaveAskAiHandler as Je, setMarkweaveAskAiPreview as Ye, startMarkweaveAskAiTableTarget as Xe, startMarkweaveAskAiTarget as Ze } from "markweave/internal/plugins/ask-ai/ask-ai-session";
32
- import { createMarkweaveTocState as Qe, emptyMarkweaveTocState as $e, getActiveMarkweaveTocId as et, getMarkweaveInnerTocRailHeight as tt, getMarkweaveTocItemsFromState as nt, getValidMarkweaveTocActiveId as rt, normalizeMarkweaveInnerTocPlacement as it, observeMarkweaveInnerTocContainerPosition as at, observeMarkweaveInnerTocRailOverflow as ot, scrollToMarkweaveTocItem as st } from "markweave/internal/core/toc-state";
33
- import { codeBlockCollapsePluginKey as ct, copyActiveCodeBlock as lt, getActiveCodeBlockState as ut, getCodeBlockCopyFeedbackSnapshot as dt, markweaveCodeBlockBehavior as ft, setCodeBlockCollapsedAtPosition as pt, setCodeBlockLanguageAtPosition as mt, setCodeBlockMermaidPreviewModeAtPosition as ht } from "markweave/internal/plugins/codeblock/codeblock-behavior";
34
- import { calculateCodeBlockLanguageMenuPosition as gt, clampFullscreenScale as _t, codeBlockCopyFeedbackTimeoutMs as vt, copyCodeBlockText as yt, createCodeBlockLanguageMenuDomId as bt, createCodeBlockOverlayPosition as xt, createMermaidFullscreenViewerState as St, createMermaidTabPosition as Ct, focusCodeBlockTarget as wt, formatCodeBlockLanguageLabel as Tt, formatFullscreenZoom as Et, getActiveCodeBlockElement as Dt, getAnchoredRect as Ot, getCodeBlockLanguageItems as kt, getCodeBlockLanguageOptionDomId as At, getCodeBlockPositionFromEventTarget as jt, getCodeBlockStateAtPosition as Mt, getFrameElement as Nt, getInitialCodeBlockLanguageItemIndex as Pt, getMermaidCodeBlockTargets as Ft, getMermaidSvgMarkup as It, isCodeBlockTargetCollapsed as Lt, mergeStableMermaidTabPositions as Rt, mermaidFullscreenZoomStep as zt, moveCodeBlockLanguageItemIndex as Bt, moveMermaidFullscreenViewer as Vt, scrollCodeBlockLanguageItemIntoView as Ht } from "markweave/internal/plugins/codeblock/codeblock-ui-model";
35
- import { normalizeMarkdownLinkHref as Ut } from "markweave/internal/plugins/markdown/markdown-input";
36
- import { applyMarkweaveMathLatex as Wt, calculateMarkweaveMathPopoverPosition as Gt, getMarkweaveMathAnchorRect as Kt, getMarkweaveMathBlockIndex as qt, getMarkweaveMathRenderedHtml as Jt, getMarkweaveMathTargetAtPos as Yt, getMarkweaveMathTargetFromDomEvent as Xt, getMarkweaveMathTargetFromSelection as Zt, renderMarkweaveMathPreview as Qt, setMarkweaveMathEditingDomState as $t, setMarkweaveMathEditingDomStateInView as en, setMarkweaveMathSelectionInView as tn } from "markweave/internal/plugins/math/math-ui-model";
37
- import { isMermaidInlinePreviewTransaction as nn, setMarkweaveMermaidTheme as rn, setMermaidInlinePreviewEditorMode as an, setReadonlyMermaidPreviewMode as on } from "markweave/internal/plugins/mermaid/mermaid-inline-preview";
38
- import { getMermaidPreviewState as sn } from "markweave/internal/plugins/mermaid/mermaid-renderer";
39
- import { createResolvedSlashCommandSpecs as cn, getSlashCommandTextIconLength as ln, isExecutableSlashCommand as un } from "markweave/internal/plugins/slash-command/command-spec";
40
- import { getSlashCommandKeyboardAction as dn } from "markweave/internal/plugins/slash-command/slash-keyboard";
41
- import { scrollSlashCommandItemIntoView as fn } from "markweave/internal/plugins/slash-command/slash-menu-scroll";
42
- import { areSlashCommandMenuPositionsEquivalent as pn, getNextSlashCommandState as mn, getSlashCommandAnchoredMenuPosition as hn, getSlashCommandContext as gn, isMarkweaveSlashMenuScrollTarget as _n, isSlashCommandAnchorVisible as vn } from "markweave/internal/plugins/slash-command/slash-runtime";
43
- import { createMarkweaveCommandController as yn, executeMarkweaveSlashCommand as bn, setMarkweaveCommandContentFormat as xn, setMarkweaveCommandRegistry as Sn } from "markweave/internal/commands/command-runtime";
44
- import { createMarkweaveCommandRegistry as Cn } from "markweave/internal/commands/command-registry";
45
- import { initialSlashCommandState as wn, reduceSlashCommandState as Tn } from "markweave/internal/plugins/slash-command/slash-state";
46
- import { setMarkweaveTableMenuAxisTarget as En } from "markweave/internal/plugins/table/table-clipboard";
47
- import { isMarkweaveTableCapabilityAllowed as Dn } from "markweave/internal/plugins/table/table-capabilities";
48
- import { getFirstTableDebugSnapshot as On } from "markweave/internal/plugins/table/table-debug-snapshot";
49
- import { focusFirstTableBodyCell as kn } from "markweave/internal/plugins/table/table-focus-position";
50
- import { getTableFocusState as An } from "markweave/internal/plugins/table/table-focus-state";
51
- import { getTableSelectionOverlayState as jn, initialTableInteractionState as Mn, tableInteractionPluginKey as Nn } from "markweave/internal/plugins/table/table-interaction-layer";
52
- import { applyTableAxisAlignment as Pn, applyTableAxisBackgroundColor as Fn, applyTableAxisTextColor as In, calculateAnchoredTableMenuPosition as Ln, calculateAnchoredTableSubmenuPosition as Rn, calculateTableAxisHandleLayout as zn, calculateTableExtendButtonLayout as Bn, canRunTableCommand as Vn, executeTableMenuCommand as Hn, formatTableCopyFeedback as Un, getActiveTableElement as Wn, getAvailableCellMenuCommandSpecs as Gn, getTableAxisDropIndexAtPoint as Kn, getTableAxisFormattingState as qn, getTableAxisTargetRect as Jn, getTableControlAxisSelectionModel as Yn, getTableMenuBoundaryRect as Xn, getTableMenuItemGroup as Zn, getTableMenuItemLabel as Qn, getTableMenuItems as $n, getTableSelectionTargetRect as er, measureTableSelectionOverlay as tr, moveTargetedTableAxis as nr, selectTableAxisFromCell as rr, tableColorOptions as ir, tableCopyFeedbackTimeoutMs as ar, tableHorizontalAlignmentOptions as or, tableMenuLabel as sr, tableVerticalAlignmentOptions as cr, targetTableAxisFromCell as lr } from "markweave/internal/plugins/table/table-ui-model";
26
+ import { createMarkweaveEditorRuntimeSnapshot as we } from "markweave/internal/editor-core/runtime-snapshot";
27
+ import { areEditorSelectionSnapshotsEquivalent as Te, calculateFloatingToolbarPopoverPlacement as Ee, createSelectionSnapshot as De, markweaveRuntimeProjectionDelayMs as Oe, shouldShowFloatingToolbarForAiState as ke } from "markweave/internal/editor-core/selection-state";
28
+ import { normalizeMarkweaveCanvasColor as Ae, normalizeMarkweaveTheme as je } from "markweave/internal/core/theme";
29
+ import { createMarkweaveAiEditController as Me } from "markweave/internal/plugins/ai-edit/ai-edit-controller";
30
+ import { MarkweaveAskAiError as Ne, acceptMarkweaveAskAiResult as Pe, calculateMarkweaveAskAiPanelPosition as Fe, canStartMarkweaveAskAiTableTarget as Ie, clearMarkweaveAskAiPreview as Le, clearMarkweaveAskAiTarget as Re, createMarkweaveAskAiRequest as ze, getMappedMarkweaveAskAiSelection as Be, getMarkweaveAskAiSurfaceRect as Ve, getMarkweaveAskAiTarget as He, getMarkweaveAskAiTargetRect as Ue, hasMarkweaveAskAiPreview as We, isMarkweaveAskAiSelectionEligible as Ge, restoreMarkweaveAskAiTargetSelection as Ke, runMarkweaveAskAiHandler as qe, setMarkweaveAskAiPreview as Je, startMarkweaveAskAiTableTarget as Ye, startMarkweaveAskAiTarget as Xe } from "markweave/internal/plugins/ask-ai/ask-ai-session";
31
+ import { createMarkweaveTocState as Ze, emptyMarkweaveTocState as Qe, getActiveMarkweaveTocId as $e, getMarkweaveInnerTocRailHeight as et, getMarkweaveTocItemsFromState as tt, getValidMarkweaveTocActiveId as nt, normalizeMarkweaveInnerTocPlacement as rt, observeMarkweaveInnerTocContainerPosition as it, observeMarkweaveInnerTocRailOverflow as at, scrollToMarkweaveTocItem as ot } from "markweave/internal/core/toc-state";
32
+ import { codeBlockCollapsePluginKey as st, copyActiveCodeBlock as ct, getActiveCodeBlockState as lt, getCodeBlockCopyFeedbackSnapshot as ut, markweaveCodeBlockBehavior as dt, setCodeBlockCollapsedAtPosition as ft, setCodeBlockLanguageAtPosition as pt, setCodeBlockMermaidPreviewModeAtPosition as mt } from "markweave/internal/plugins/codeblock/codeblock-behavior";
33
+ import { calculateCodeBlockLanguageMenuPosition as ht, clampFullscreenScale as gt, codeBlockCopyFeedbackTimeoutMs as _t, copyCodeBlockText as vt, createCodeBlockLanguageMenuDomId as yt, createCodeBlockOverlayPosition as bt, createMermaidFullscreenViewerState as xt, createMermaidTabPosition as St, focusCodeBlockTarget as Ct, formatCodeBlockLanguageLabel as wt, formatFullscreenZoom as Tt, getActiveCodeBlockElement as Et, getAnchoredRect as Dt, getCodeBlockLanguageItems as Ot, getCodeBlockLanguageOptionDomId as kt, getCodeBlockPositionFromEventTarget as At, getCodeBlockStateAtPosition as jt, getFrameElement as Mt, getInitialCodeBlockLanguageItemIndex as Nt, getMermaidCodeBlockTargets as Pt, getMermaidSvgMarkup as Ft, isCodeBlockTargetCollapsed as It, mergeStableMermaidTabPositions as Lt, mermaidFullscreenZoomStep as Rt, moveCodeBlockLanguageItemIndex as zt, moveMermaidFullscreenViewer as Bt, scrollCodeBlockLanguageItemIntoView as Vt } from "markweave/internal/plugins/codeblock/codeblock-ui-model";
34
+ import { normalizeMarkdownLinkHref as Ht } from "markweave/internal/plugins/markdown/markdown-input";
35
+ import { applyMarkweaveMathLatex as Ut, calculateMarkweaveMathPopoverPosition as Wt, getMarkweaveMathAnchorRect as Gt, getMarkweaveMathBlockIndex as Kt, getMarkweaveMathRenderedHtml as qt, getMarkweaveMathTargetAtPos as Jt, getMarkweaveMathTargetFromDomEvent as Yt, getMarkweaveMathTargetFromSelection as Xt, renderMarkweaveMathPreview as Zt, setMarkweaveMathEditingDomState as Qt, setMarkweaveMathEditingDomStateInView as $t, setMarkweaveMathSelectionInView as en } from "markweave/internal/plugins/math/math-ui-model";
36
+ import { isMermaidInlinePreviewTransaction as tn, setMarkweaveMermaidTheme as nn, setMermaidInlinePreviewEditorMode as rn, setReadonlyMermaidPreviewMode as an } from "markweave/internal/plugins/mermaid/mermaid-inline-preview";
37
+ import { getMermaidPreviewState as on } from "markweave/internal/plugins/mermaid/mermaid-renderer";
38
+ import { createResolvedSlashCommandSpecs as sn, getSlashCommandTextIconLength as cn, isExecutableSlashCommand as ln } from "markweave/internal/plugins/slash-command/command-spec";
39
+ import { getSlashCommandKeyboardAction as un } from "markweave/internal/plugins/slash-command/slash-keyboard";
40
+ import { scrollSlashCommandItemIntoView as dn } from "markweave/internal/plugins/slash-command/slash-menu-scroll";
41
+ import { areSlashCommandMenuPositionsEquivalent as fn, getNextSlashCommandState as pn, getSlashCommandAnchoredMenuPosition as mn, getSlashCommandContext as hn, isMarkweaveSlashMenuScrollTarget as gn, isSlashCommandAnchorVisible as _n } from "markweave/internal/plugins/slash-command/slash-runtime";
42
+ import { createMarkweaveCommandController as vn, executeMarkweaveSlashCommand as yn, setMarkweaveCommandContentFormat as bn, setMarkweaveCommandRegistry as xn } from "markweave/internal/commands/command-runtime";
43
+ import { createMarkweaveCommandRegistry as Sn } from "markweave/internal/commands/command-registry";
44
+ import { initialSlashCommandState as Cn, reduceSlashCommandState as wn } from "markweave/internal/plugins/slash-command/slash-state";
45
+ import { setMarkweaveTableMenuAxisTarget as Tn } from "markweave/internal/plugins/table/table-clipboard";
46
+ import { isMarkweaveTableCapabilityAllowed as En } from "markweave/internal/plugins/table/table-capabilities";
47
+ import { getFirstTableDebugSnapshot as Dn } from "markweave/internal/plugins/table/table-debug-snapshot";
48
+ import { focusFirstTableBodyCell as On } from "markweave/internal/plugins/table/table-focus-position";
49
+ import { getTableFocusState as kn } from "markweave/internal/plugins/table/table-focus-state";
50
+ import { getTableSelectionOverlayState as An, initialTableInteractionState as jn, tableInteractionPluginKey as Mn } from "markweave/internal/plugins/table/table-interaction-layer";
51
+ import { applyTableAxisAlignment as Nn, applyTableAxisBackgroundColor as Pn, applyTableAxisTextColor as Fn, calculateAnchoredTableMenuPosition as In, calculateAnchoredTableSubmenuPosition as Ln, calculateTableAxisHandleLayout as Rn, calculateTableExtendButtonLayout as zn, canRunTableCommand as Bn, executeTableMenuCommand as Vn, formatTableCopyFeedback as Hn, getActiveTableElement as Un, getAvailableCellMenuCommandSpecs as Wn, getTableAxisDropIndexAtPoint as Gn, getTableAxisFormattingState as Kn, getTableAxisTargetRect as qn, getTableControlAxisSelectionModel as Jn, getTableMenuBoundaryRect as Yn, getTableMenuItemGroup as Xn, getTableMenuItemLabel as Zn, getTableMenuItems as Qn, getTableSelectionTargetRect as $n, measureTableSelectionOverlay as er, moveTargetedTableAxis as tr, selectTableAxisFromCell as nr, tableColorOptions as rr, tableCopyFeedbackTimeoutMs as ir, tableHorizontalAlignmentOptions as ar, tableMenuLabel as or, tableVerticalAlignmentOptions as sr, targetTableAxisFromCell as cr } from "markweave/internal/plugins/table/table-ui-model";
53
52
  //#region src/vue2-compat.ts
54
- var ur = c.default ?? c, dr = null, fr = null, pr = null;
55
- function mr(e) {
53
+ var lr = c.default ?? c, ur = null, dr = null, fr = null;
54
+ function pr(e) {
56
55
  return !!(e && typeof e == "object" && "value" in e);
57
56
  }
58
- function hr(e) {
57
+ function mr(e) {
59
58
  let t = e.slice(2);
60
59
  return t.endsWith("Capture") ? `!${t.slice(0, -7).replace(/^[A-Z]/, (e) => e.toLowerCase())}` : t.replace(/^[A-Z]/, (e) => e.toLowerCase());
61
60
  }
62
- function gr(e) {
61
+ function hr(e) {
63
62
  let t = {}, n = {}, r = {}, i = {}, a = {};
64
63
  for (let [o, s] of Object.entries(e)) if (s !== void 0) {
65
64
  if (o === "class" || o === "style" || o === "key") {
66
65
  t[o] = s;
67
66
  continue;
68
67
  }
69
- if (o === "ref" && mr(s)) {
68
+ if (o === "ref" && pr(s)) {
70
69
  a.insert = (e) => {
71
70
  s.value = e.elm;
72
71
  }, a.destroy = () => {
@@ -75,7 +74,7 @@ function gr(e) {
75
74
  continue;
76
75
  }
77
76
  if (/^on[A-Z]/.test(o)) {
78
- i[hr(o)] = s;
77
+ i[mr(o)] = s;
79
78
  continue;
80
79
  }
81
80
  if (o === "value" || o === "checked" || o === "innerHTML" || o === "textContent") {
@@ -86,14 +85,14 @@ function gr(e) {
86
85
  }
87
86
  return Object.keys(n).length && (t.attrs = n), Object.keys(r).length && (t.domProps = r), Object.keys(i).length && (t.on = i), Object.keys(a).length && (t.hook = a), t;
88
87
  }
89
- function _r(e) {
88
+ function gr(e) {
90
89
  let t = {}, n = {}, r = {}, i = {};
91
90
  for (let [a, o] of Object.entries(e)) if (o !== void 0) {
92
91
  if (a === "class" || a === "style" || a === "key") {
93
92
  t[a] = o;
94
93
  continue;
95
94
  }
96
- if (a === "ref" && mr(o)) {
95
+ if (a === "ref" && pr(o)) {
97
96
  i.insert = (e) => {
98
97
  o.value = e.componentInstance ?? e.elm;
99
98
  }, i.destroy = () => {
@@ -109,27 +108,27 @@ function _r(e) {
109
108
  }
110
109
  return Object.keys(n).length && (t.props = n), Object.keys(r).length && (t.attrs = r), Object.keys(i).length && (t.hook = i), t;
111
110
  }
112
- function vr(e) {
111
+ function _r(e) {
113
112
  return !!(e && typeof e == "object" && "default" in e && typeof e.default == "function");
114
113
  }
115
- function yr(e) {
114
+ function vr(e) {
116
115
  return !!(e && typeof e == "object" && ("tag" in e || "text" in e || "elm" in e || "componentOptions" in e || "componentInstance" in e));
117
116
  }
118
- function br(e) {
117
+ function yr(e) {
119
118
  return e == null || Array.isArray(e) ? e : [e];
120
119
  }
121
- function xr(e) {
122
- return typeof e == "function" ? br(e()) : vr(e) ? br(e.default()) : yr(e) ? [e] : e;
120
+ function br(e) {
121
+ return typeof e == "function" ? yr(e()) : _r(e) ? yr(e.default()) : vr(e) ? [e] : e;
123
122
  }
124
123
  function U(e, t, n) {
125
- if (!pr) throw Error("Vue 2 render context is not available.");
126
- let r = t && typeof t == "object" && !Array.isArray(t) ? t : {}, i = typeof e == "string" ? gr(r) : _r(r), a = arguments.length === 2 && (Array.isArray(t) || typeof t == "string") ? t : xr(n);
127
- return pr(e, i, a);
124
+ if (!fr) throw Error("Vue 2 render context is not available.");
125
+ let r = t && typeof t == "object" && !Array.isArray(t) ? t : {}, i = typeof e == "string" ? hr(r) : gr(r), a = arguments.length === 2 && (Array.isArray(t) || typeof t == "string") ? t : br(n);
126
+ return fr(e, i, a);
128
127
  }
129
128
  function W(e) {
130
- return ur.observable({ value: e });
129
+ return lr.observable({ value: e });
131
130
  }
132
- var Sr = W;
131
+ var xr = W;
133
132
  function G(e) {
134
133
  return { get value() {
135
134
  return e();
@@ -137,19 +136,19 @@ function G(e) {
137
136
  }
138
137
  function K(e, t, n) {
139
138
  let r = typeof e == "function" ? e : () => e.value;
140
- return dr?.$watch ? dr.$watch(r, t, n) : () => void 0;
139
+ return ur?.$watch ? ur.$watch(r, t, n) : () => void 0;
141
140
  }
142
- function Cr(e) {
143
- fr?.mounted.push(e);
141
+ function Sr(e) {
142
+ dr?.mounted.push(e);
144
143
  }
145
- function wr(e) {
146
- fr?.beforeUnmount.push(e);
144
+ function Cr(e) {
145
+ dr?.beforeUnmount.push(e);
147
146
  }
148
147
  function q(e) {
149
- return ur.nextTick(e);
148
+ return lr.nextTick(e);
150
149
  }
151
150
  function J(e) {
152
- return ur.extend({
151
+ return lr.extend({
153
152
  name: e.name,
154
153
  props: e.props,
155
154
  created() {
@@ -157,12 +156,12 @@ function J(e) {
157
156
  mounted: [],
158
157
  beforeUnmount: []
159
158
  };
160
- dr = this, fr = t;
159
+ ur = this, dr = t;
161
160
  try {
162
161
  let n = e.setup?.(this.$props ?? this) ?? null;
163
162
  this.__markweaveVue2Render = typeof n == "function" ? n : null, this.__markweaveVue2Lifecycle = t;
164
163
  } finally {
165
- dr = null, fr = null;
164
+ ur = null, dr = null;
166
165
  }
167
166
  },
168
167
  mounted() {
@@ -172,19 +171,19 @@ function J(e) {
172
171
  this.__markweaveVue2Lifecycle?.beforeUnmount.forEach((e) => e());
173
172
  },
174
173
  render(t) {
175
- pr = t;
174
+ fr = t;
176
175
  try {
177
176
  let n = this.__markweaveVue2Render;
178
177
  return n ? n() : e.render?.(t) ?? null;
179
178
  } finally {
180
- pr = null;
179
+ fr = null;
181
180
  }
182
181
  }
183
182
  });
184
183
  }
185
184
  //#endregion
186
185
  //#region src/vue2-icons.ts
187
- var Tr = {
186
+ var wr = {
188
187
  AlignVerticalJustifyCenter: {
189
188
  iconName: "align-vertical-justify-center",
190
189
  node: [
@@ -1506,7 +1505,7 @@ var Tr = {
1506
1505
  }]]
1507
1506
  }
1508
1507
  };
1509
- function Er(e) {
1508
+ function Tr(e) {
1510
1509
  return e.map(([e, t]) => U(e, t));
1511
1510
  }
1512
1511
  function Y(e) {
@@ -1527,7 +1526,7 @@ function Y(e) {
1527
1526
  }
1528
1527
  },
1529
1528
  setup(t) {
1530
- let n = Tr[e];
1529
+ let n = wr[e];
1531
1530
  return () => U("svg", {
1532
1531
  class: `lucide lucide-${n.iconName}`,
1533
1532
  viewBox: "0 0 24 24",
@@ -1540,12 +1539,12 @@ function Y(e) {
1540
1539
  "stroke-width": t.absoluteStrokeWidth && t.size ? Number(t.strokeWidth) * 24 / Number(t.size) : t.strokeWidth,
1541
1540
  "aria-hidden": "true",
1542
1541
  focusable: "false"
1543
- }, Er(n.node));
1542
+ }, Tr(n.node));
1544
1543
  }
1545
1544
  });
1546
1545
  }
1547
- var Dr = Y("AlignCenter"), Or = Y("AlignJustify"), kr = Y("AlignLeft"), Ar = Y("AlignRight"), jr = Y("AlignVerticalJustifyCenter"), Mr = Y("AlignVerticalJustifyEnd"), Nr = Y("AlignVerticalJustifyStart"), Pr = Y("AlertTriangle"), Fr = Y("ArrowDown"), Ir = Y("ArrowDownAZ"), Lr = Y("ArrowLeft"), Rr = Y("ArrowRight"), zr = Y("ArrowUp"), Br = Y("ArrowUpZA"), Vr = Y("BetweenHorizontalEnd"), Hr = Y("BetweenHorizontalStart"), Ur = Y("BetweenVerticalEnd"), Wr = Y("BetweenVerticalStart"), Gr = Y("Bold"), Kr = Y("Braces"), qr = Y("Captions"), Jr = Y("Check"), Yr = Y("CheckCircle2"), Xr = Y("ChevronDown"), Zr = Y("ChevronRight"), Qr = Y("ChevronUp"), $r = Y("CircleX"), ei = Y("Code2"), ti = Y("CornerDownLeft"), ni = Y("Copy"), ri = Y("Download"), ii = Y("Eye"), ai = Y("ExternalLink"), oi = Y("Heading1"), si = Y("Heading2"), ci = Y("Heading3"), li = Y("Image"), ui = Y("ImageUp"), di = Y("IndentDecrease"), fi = Y("IndentIncrease"), pi = Y("Info"), mi = Y("Italic"), hi = Y("Lightbulb"), gi = Y("Link2"), _i = Y("List"), vi = Y("ListChecks"), yi = Y("ListOrdered"), bi = Y("Minus"), xi = Y("MoreVertical"), Si = Y("PaintBucket"), Ci = Y("Paperclip"), wi = Y("PencilLine"), Ti = Y("Plus"), Ei = Y("Quote"), Di = Y("Replace"), Oi = Y("RotateCcw"), ki = Y("Sigma"), Ai = Y("SmilePlus"), ji = Y("Sparkles"), Mi = Y("Square"), Ni = Y("SquareX"), Pi = Y("Strikethrough"), Fi = Y("Subscript"), Ii = Y("Superscript"), Li = Y("Table2"), Ri = Y("TableCellsMerge"), zi = Y("TableCellsSplit"), Bi = Y("Text"), Vi = Y("Trash2"), Hi = Y("Type"), Ui = Y("Underline"), Wi = Y("Upload"), Gi = Y("Video"), Ki = Y("X"), qi = M;
1548
- function Ji(e) {
1546
+ var Er = Y("AlignCenter"), Dr = Y("AlignJustify"), Or = Y("AlignLeft"), kr = Y("AlignRight"), Ar = Y("AlignVerticalJustifyCenter"), jr = Y("AlignVerticalJustifyEnd"), Mr = Y("AlignVerticalJustifyStart"), Nr = Y("AlertTriangle"), Pr = Y("ArrowDown"), Fr = Y("ArrowDownAZ"), Ir = Y("ArrowLeft"), Lr = Y("ArrowRight"), Rr = Y("ArrowUp"), zr = Y("ArrowUpZA"), Br = Y("BetweenHorizontalEnd"), Vr = Y("BetweenHorizontalStart"), Hr = Y("BetweenVerticalEnd"), Ur = Y("BetweenVerticalStart"), Wr = Y("Bold"), Gr = Y("Braces"), Kr = Y("Captions"), qr = Y("Check"), Jr = Y("CheckCircle2"), Yr = Y("ChevronDown"), Xr = Y("ChevronRight"), Zr = Y("ChevronUp"), Qr = Y("CircleX"), $r = Y("Code2"), ei = Y("CornerDownLeft"), ti = Y("Copy"), ni = Y("Download"), ri = Y("Eye"), ii = Y("ExternalLink"), ai = Y("Heading1"), oi = Y("Heading2"), si = Y("Heading3"), ci = Y("Image"), li = Y("ImageUp"), ui = Y("IndentDecrease"), di = Y("IndentIncrease"), fi = Y("Info"), pi = Y("Italic"), mi = Y("Lightbulb"), hi = Y("Link2"), gi = Y("List"), _i = Y("ListChecks"), vi = Y("ListOrdered"), yi = Y("Minus"), bi = Y("MoreVertical"), xi = Y("PaintBucket"), Si = Y("Paperclip"), Ci = Y("PencilLine"), wi = Y("Plus"), Ti = Y("Quote"), Ei = Y("Replace"), Di = Y("RotateCcw"), Oi = Y("Sigma"), ki = Y("SmilePlus"), Ai = Y("Sparkles"), ji = Y("Square"), Mi = Y("SquareX"), Ni = Y("Strikethrough"), Pi = Y("Subscript"), Fi = Y("Superscript"), Ii = Y("Table2"), Li = Y("TableCellsMerge"), Ri = Y("TableCellsSplit"), zi = Y("Text"), Bi = Y("Trash2"), Vi = Y("Type"), Hi = Y("Underline"), Ui = Y("Upload"), Wi = Y("Video"), Gi = Y("X"), Ki = M;
1547
+ function qi(e) {
1549
1548
  let t = e.view.dom.closest(".markweave-editor-frame"), n = () => {
1550
1549
  let n = t?.getAttribute("data-markweave-mode");
1551
1550
  return n === "view" ? {
@@ -1563,27 +1562,27 @@ function Ji(e) {
1563
1562
  return a && t && a.observe(t, {
1564
1563
  attributes: !0,
1565
1564
  attributeFilter: ["data-markweave-mode"]
1566
- }), wr(() => {
1565
+ }), Cr(() => {
1567
1566
  i(), a?.disconnect();
1568
1567
  }), r;
1569
1568
  }
1570
- function Yi(e) {
1569
+ function Ji(e) {
1571
1570
  return e instanceof Element && !!e.closest("[data-markweave-image-ui=\"true\"]");
1572
1571
  }
1573
- function Xi(e) {
1572
+ function Yi(e) {
1574
1573
  return e instanceof Element && !!e.closest("[data-markweave-video-ui=\"true\"], iframe[data-markweave-video-embed], video[data-markweave-video]");
1575
1574
  }
1576
- function Zi(e) {
1575
+ function Xi(e) {
1577
1576
  return e instanceof Element && !!e.closest("[data-markweave-link-card-ui=\"true\"]");
1578
1577
  }
1579
- function Qi(e, t) {
1578
+ function Zi(e, t) {
1580
1579
  return U(e, {
1581
1580
  size: 18,
1582
1581
  strokeWidth: 1.8,
1583
1582
  "aria-hidden": "true"
1584
1583
  }, { default: () => t });
1585
1584
  }
1586
- function $i(e) {
1585
+ function Qi(e) {
1587
1586
  return U("button", {
1588
1587
  type: "button",
1589
1588
  "aria-label": e.label,
@@ -1592,12 +1591,12 @@ function $i(e) {
1592
1591
  "data-active": e.active ? "true" : "false",
1593
1592
  onMousedown: (e) => e.preventDefault(),
1594
1593
  onClick: e.onClick
1595
- }, [Qi(e.icon, e.label), U("span", {
1594
+ }, [Zi(e.icon, e.label), U("span", {
1596
1595
  class: "markweave-image-tooltip",
1597
1596
  role: "tooltip"
1598
1597
  }, e.label)]);
1599
1598
  }
1600
- function ea(e) {
1599
+ function $i(e) {
1601
1600
  let t = W(null), n = e.messages.image;
1602
1601
  return U("section", {
1603
1602
  class: "markweave-image-upload-placeholder",
@@ -1639,7 +1638,7 @@ function ea(e) {
1639
1638
  U("span", {
1640
1639
  class: "markweave-image-upload-icon",
1641
1640
  "aria-hidden": "true"
1642
- }, [U(ui, {
1641
+ }, [U(li, {
1643
1642
  size: 16,
1644
1643
  strokeWidth: 1.8
1645
1644
  })]),
@@ -1665,7 +1664,7 @@ function ea(e) {
1665
1664
  "data-testid": "markweave-image-upload-submit",
1666
1665
  disabled: e.isSubmitting || !e.inputValue.trim(),
1667
1666
  onClick: e.onSubmit
1668
- }, [U(ui, {
1667
+ }, [U(li, {
1669
1668
  size: 16,
1670
1669
  strokeWidth: 1.8
1671
1670
  }), e.messages.common.insert]),
@@ -1681,7 +1680,7 @@ function ea(e) {
1681
1680
  }, e.error) : null
1682
1681
  ]);
1683
1682
  }
1684
- function ta(e) {
1683
+ function ea(e) {
1685
1684
  let t = W(null), n = e.messages.video;
1686
1685
  return U("section", {
1687
1686
  class: "markweave-video-upload-placeholder",
@@ -1723,7 +1722,7 @@ function ta(e) {
1723
1722
  U("span", {
1724
1723
  class: "markweave-video-upload-icon",
1725
1724
  "aria-hidden": "true"
1726
- }, [U(Gi, {
1725
+ }, [U(Wi, {
1727
1726
  size: 16,
1728
1727
  strokeWidth: 1.8
1729
1728
  })]),
@@ -1749,7 +1748,7 @@ function ta(e) {
1749
1748
  "data-testid": "markweave-video-upload-submit",
1750
1749
  disabled: e.isSubmitting || !e.inputValue.trim(),
1751
1750
  onClick: e.onSubmit
1752
- }, [U(Wi, {
1751
+ }, [U(Ui, {
1753
1752
  size: 16,
1754
1753
  strokeWidth: 1.8
1755
1754
  }), e.messages.common.insert]),
@@ -1765,7 +1764,7 @@ function ta(e) {
1765
1764
  }, e.error) : null
1766
1765
  ]);
1767
1766
  }
1768
- var na = J({
1767
+ var ta = J({
1769
1768
  name: "MarkweaveVueImageNodeView",
1770
1769
  props: {
1771
1770
  editor: {
@@ -1798,7 +1797,7 @@ var na = J({
1798
1797
  }
1799
1798
  },
1800
1799
  setup(e) {
1801
- let n = W(null), r = W(!1), i = W(!1), a = W(!1), s = W(""), c = W(null), l = W(!1), d = G(() => e.node.attrs), f = W(!!F(d.value.caption)), p = W(F(d.value.caption) ?? ""), m = Ji(e.editor), h = G(() => u(m.value)), g = G(() => e.extension.options?.messages ?? t("zh")), _ = G(() => g.value.image), v = G(() => F(d.value.src)), b = G(() => e.extension.options?.resolveMediaSource), S = W(null), C = null;
1800
+ let n = W(null), r = W(!1), i = W(!1), a = W(!1), s = W(""), c = W(null), l = W(!1), d = G(() => e.node.attrs), f = W(!!F(d.value.caption)), p = W(F(d.value.caption) ?? ""), m = qi(e.editor), h = G(() => u(m.value)), g = G(() => e.extension.options?.messages ?? t("zh")), _ = G(() => g.value.image), v = G(() => F(d.value.src)), b = G(() => e.extension.options?.resolveMediaSource), S = W(null), C = null;
1802
1801
  K(v, (t) => {
1803
1802
  if (C?.abort(), C = null, !t) {
1804
1803
  S.value = null;
@@ -1818,8 +1817,8 @@ var na = J({
1818
1817
  }).then((e) => {
1819
1818
  r.signal.aborted || (S.value = e);
1820
1819
  });
1821
- }, { immediate: !0 }), wr(() => C?.abort());
1822
- let T = G(() => S.value?.src ?? (b.value ? null : v.value)), E = G(() => qi(d.value.align)), k = G(() => P(d.value.width)), j = G(() => F(d.value.caption)), M = G(() => h.value && (!v.value || i.value)), N = () => {
1820
+ }, { immediate: !0 }), Cr(() => C?.abort());
1821
+ let T = G(() => S.value?.src ?? (b.value ? null : v.value)), E = G(() => Ki(d.value.align)), k = G(() => P(d.value.width)), j = G(() => F(d.value.caption)), M = G(() => h.value && (!v.value || i.value)), N = () => {
1823
1822
  T.value && y({
1824
1823
  src: T.value,
1825
1824
  alt: F(d.value.alt) ?? "",
@@ -1892,7 +1891,7 @@ var na = J({
1892
1891
  "data-selected": "false",
1893
1892
  "data-hovered": "false",
1894
1893
  "data-empty": "true"
1895
- }, () => ea({
1894
+ }, () => $i({
1896
1895
  messages: g.value,
1897
1896
  inputValue: s.value,
1898
1897
  error: c.value,
@@ -1922,7 +1921,7 @@ var na = J({
1922
1921
  r.value = !1;
1923
1922
  },
1924
1923
  onMousedown: (e) => {
1925
- h.value && !Yi(e.target) && I();
1924
+ h.value && !Ji(e.target) && I();
1926
1925
  }
1927
1926
  }, () => [
1928
1927
  h.value ? U("div", {
@@ -1931,24 +1930,24 @@ var na = J({
1931
1930
  "data-markweave-image-ui": "true",
1932
1931
  "aria-label": _.value.toolsAriaLabel
1933
1932
  }, [
1934
- $i({
1933
+ Qi({
1935
1934
  testId: "markweave-image-align-left",
1936
1935
  label: _.value.alignLeft,
1937
- icon: kr,
1936
+ icon: Or,
1938
1937
  active: E.value === "left",
1939
1938
  onClick: () => e.updateAttributes({ align: "left" })
1940
1939
  }),
1941
- $i({
1940
+ Qi({
1942
1941
  testId: "markweave-image-align-center",
1943
1942
  label: _.value.alignCenter,
1944
- icon: Dr,
1943
+ icon: Er,
1945
1944
  active: E.value === "center",
1946
1945
  onClick: () => e.updateAttributes({ align: "center" })
1947
1946
  }),
1948
- $i({
1947
+ Qi({
1949
1948
  testId: "markweave-image-align-right",
1950
1949
  label: _.value.alignRight,
1951
- icon: Ar,
1950
+ icon: kr,
1952
1951
  active: E.value === "right",
1953
1952
  onClick: () => e.updateAttributes({ align: "right" })
1954
1953
  }),
@@ -1956,31 +1955,31 @@ var na = J({
1956
1955
  class: "markweave-image-toolbar-divider",
1957
1956
  "aria-hidden": "true"
1958
1957
  }),
1959
- $i({
1958
+ Qi({
1960
1959
  testId: "markweave-image-caption",
1961
1960
  label: _.value.caption,
1962
- icon: qr,
1961
+ icon: Kr,
1963
1962
  active: f.value || !!j.value,
1964
1963
  onClick: z
1965
1964
  }),
1966
- $i({
1965
+ Qi({
1967
1966
  testId: "markweave-image-preview",
1968
1967
  label: _.value.preview,
1969
- icon: ii,
1968
+ icon: ri,
1970
1969
  onClick: N
1971
1970
  }),
1972
- $i({
1971
+ Qi({
1973
1972
  testId: "markweave-image-download",
1974
1973
  label: _.value.download,
1975
- icon: ri,
1974
+ icon: ni,
1976
1975
  onClick: () => {
1977
1976
  T.value && A(T.value);
1978
1977
  }
1979
1978
  }),
1980
- $i({
1979
+ Qi({
1981
1980
  testId: "markweave-image-replace",
1982
1981
  label: _.value.replace,
1983
- icon: Di,
1982
+ icon: Ei,
1984
1983
  onClick: () => {
1985
1984
  s.value = "", c.value = null, i.value = !0;
1986
1985
  }
@@ -1989,10 +1988,10 @@ var na = J({
1989
1988
  class: "markweave-image-toolbar-divider",
1990
1989
  "aria-hidden": "true"
1991
1990
  }),
1992
- $i({
1991
+ Qi({
1993
1992
  testId: "markweave-image-delete",
1994
1993
  label: _.value.delete,
1995
- icon: Vi,
1994
+ icon: Bi,
1996
1995
  onClick: () => e.deleteNode()
1997
1996
  })
1998
1997
  ]) : null,
@@ -2028,7 +2027,7 @@ var na = J({
2028
2027
  title: _.value.preview,
2029
2028
  onMousedown: (e) => e.preventDefault(),
2030
2029
  onClick: N
2031
- }, [U(ii, {
2030
+ }, [U(ri, {
2032
2031
  size: 16,
2033
2032
  strokeWidth: 1.8
2034
2033
  }), U("span", {
@@ -2073,7 +2072,7 @@ var na = J({
2073
2072
  }, j.value) : null
2074
2073
  ]);
2075
2074
  }
2076
- }), ra = J({
2075
+ }), na = J({
2077
2076
  name: "MarkweaveVueVideoNodeView",
2078
2077
  props: {
2079
2078
  editor: {
@@ -2106,7 +2105,7 @@ var na = J({
2106
2105
  }
2107
2106
  },
2108
2107
  setup(e) {
2109
- let n = W(!1), r = W(""), i = W(null), a = W(!1), s = Ji(e.editor), c = G(() => u(s.value)), l = G(() => e.extension.options?.messages ?? t("zh")), d = G(() => l.value.video), f = G(() => e.node.attrs), p = G(() => F(f.value.src)), m = G(() => F(f.value.embedUrl)), h = G(() => F(f.value.provider)), g = G(() => m.value ? N(m.value, h.value) : null), _ = G(() => F(f.value.mimeType)), v = G(() => F(f.value.title)), y = () => {
2108
+ let n = W(!1), r = W(""), i = W(null), a = W(!1), s = qi(e.editor), c = G(() => u(s.value)), l = G(() => e.extension.options?.messages ?? t("zh")), d = G(() => l.value.video), f = G(() => e.node.attrs), p = G(() => F(f.value.src)), m = G(() => F(f.value.embedUrl)), h = G(() => F(f.value.provider)), g = G(() => m.value ? N(m.value, h.value) : null), _ = G(() => F(f.value.mimeType)), v = G(() => F(f.value.title)), y = () => {
2110
2109
  p.value || e.deleteNode(), r.value = "", i.value = null, n.value = !1;
2111
2110
  }, b = async (t) => {
2112
2111
  if (!c.value) return;
@@ -2147,7 +2146,7 @@ var na = J({
2147
2146
  "data-testid": "markweave-video-node",
2148
2147
  "data-empty": "true",
2149
2148
  "data-selected": "false"
2150
- }, () => ta({
2149
+ }, () => ea({
2151
2150
  messages: l.value,
2152
2151
  inputValue: r.value,
2153
2152
  error: i.value,
@@ -2174,7 +2173,7 @@ var na = J({
2174
2173
  onFocus: C,
2175
2174
  onKeydown: w,
2176
2175
  onMousedown: (e) => {
2177
- c.value && !Xi(e.target) && (e.preventDefault(), C());
2176
+ c.value && !Yi(e.target) && (e.preventDefault(), C());
2178
2177
  }
2179
2178
  }, () => [g.value ? U("div", { class: "markweave-video-embed" }, [U("iframe", {
2180
2179
  class: "markweave-video-iframe",
@@ -2197,6 +2196,7 @@ var na = J({
2197
2196
  src: p.value,
2198
2197
  title: v.value ?? void 0,
2199
2198
  preload: "metadata",
2199
+ autoplay: !1,
2200
2200
  controls: !0,
2201
2201
  "data-markweave-video": "true",
2202
2202
  "data-markweave-mime-type": _.value ?? void 0
@@ -2212,7 +2212,7 @@ var na = J({
2212
2212
  "aria-hidden": "true"
2213
2213
  })]);
2214
2214
  }
2215
- }), ia = S.extend({
2215
+ }), ra = S.extend({
2216
2216
  addOptions() {
2217
2217
  return {
2218
2218
  ...this.parent?.(),
@@ -2223,7 +2223,7 @@ var na = J({
2223
2223
  },
2224
2224
  addNodeView() {
2225
2225
  if (typeof document > "u") return null;
2226
- let e = s(na, { stopEvent: ({ event: e }) => Yi(e.target) }), n = this.options.resolveMediaSource;
2226
+ let e = s(ta, { stopEvent: ({ event: e }) => Ji(e.target) }), n = this.options.resolveMediaSource;
2227
2227
  if (!n) return e;
2228
2228
  let r = b({
2229
2229
  messages: this.options.messages ?? t("zh"),
@@ -2232,7 +2232,7 @@ var na = J({
2232
2232
  });
2233
2233
  return (t) => F(t.node.attrs.src) ? r(t) : e(t);
2234
2234
  }
2235
- }), aa = C.extend({
2235
+ }), ia = C.extend({
2236
2236
  addOptions() {
2237
2237
  return {
2238
2238
  ...this.parent?.(),
@@ -2242,16 +2242,16 @@ var na = J({
2242
2242
  };
2243
2243
  },
2244
2244
  addNodeView() {
2245
- return typeof document > "u" ? null : s(ra, { stopEvent: ({ event: e }) => Xi(e.target) });
2245
+ return typeof document > "u" ? null : s(na, { stopEvent: ({ event: e }) => Yi(e.target) });
2246
2246
  }
2247
2247
  });
2248
- function oa(e) {
2248
+ function aa(e) {
2249
2249
  return e instanceof Element && !!e.closest("[data-markweave-attachment-ui=\"true\"], .markweave-attachment-upload-placeholder, .markweave-attachment-uploading");
2250
2250
  }
2251
- function sa(e, t) {
2251
+ function oa(e, t) {
2252
2252
  return typeof t != "number" || !Number.isFinite(t) || t <= 0 ? null : Math.max(0, Math.min(100, Math.round(e / t * 100)));
2253
2253
  }
2254
- var ca = J({
2254
+ var sa = J({
2255
2255
  name: "MarkweaveVueAttachmentNodeView",
2256
2256
  props: {
2257
2257
  editor: {
@@ -2284,7 +2284,7 @@ var ca = J({
2284
2284
  }
2285
2285
  },
2286
2286
  setup(e) {
2287
- let n = G(() => e.extension.options), r = G(() => n.value?.messages ?? t("zh")), i = Ji(e.editor), a = G(() => u(i.value)), s = G(() => L(e.node.attrs ?? {})), c = G(() => s.value?.name ?? F(e.node.attrs?.src) ?? r.value.attachment.missingSrc), d = G(() => [F(e.node.attrs?.mimeType), te(typeof e.node.attrs?.size == "number" ? e.node.attrs.size : null)].filter(Boolean).join(" · ")), f = W(null), p = W(!1), m = W(!1), h = W(null), g = W(null), _ = W(null), v = W(null), y = () => {
2287
+ let n = G(() => e.extension.options), r = G(() => n.value?.messages ?? t("zh")), i = qi(e.editor), a = G(() => u(i.value)), s = G(() => L(e.node.attrs ?? {})), c = G(() => s.value?.name ?? F(e.node.attrs?.src) ?? r.value.attachment.missingSrc), d = G(() => [F(e.node.attrs?.mimeType), te(typeof e.node.attrs?.size == "number" ? e.node.attrs.size : null)].filter(Boolean).join(" · ")), f = W(null), p = W(!1), m = W(!1), h = W(null), g = W(null), _ = W(null), v = W(null), y = () => {
2288
2288
  if (!a.value) return;
2289
2289
  let t = e.getPos();
2290
2290
  typeof t == "number" && e.editor.chain().focus().setNodeSelection(t).run();
@@ -2301,7 +2301,7 @@ var ca = J({
2301
2301
  mimeType: t.type || void 0
2302
2302
  }),
2303
2303
  onProgress: (e) => {
2304
- v.value = sa(e.loaded, e.total);
2304
+ v.value = oa(e.loaded, e.total);
2305
2305
  }
2306
2306
  }, n.value?.onUpload);
2307
2307
  e.updateAttributes(ee(r));
@@ -2317,7 +2317,7 @@ var ca = J({
2317
2317
  event: t
2318
2318
  }, n.value?.onDownload);
2319
2319
  }, C = (e) => {
2320
- oa(e.target) || (e.preventDefault(), e.stopPropagation(), s.value && S(e));
2320
+ aa(e.target) || (e.preventDefault(), e.stopPropagation(), s.value && S(e));
2321
2321
  };
2322
2322
  return () => {
2323
2323
  let t = r.value.attachment, n = a.value && !s.value && !m.value, i = m.value, l = !!s.value && (p.value || e.selected), u = [te(_.value), v.value === null ? null : `${v.value}%`].filter(Boolean).join(" · ");
@@ -2353,7 +2353,7 @@ var ca = J({
2353
2353
  U("span", {
2354
2354
  class: "markweave-attachment-icon",
2355
2355
  "aria-hidden": "true"
2356
- }, [Qi(Wi, t.uploadLabel)]),
2356
+ }, [Zi(Ui, t.uploadLabel)]),
2357
2357
  U("span", { class: "markweave-attachment-upload-label" }, t.uploadLabel),
2358
2358
  h.value ? U("span", { class: "markweave-attachment-upload-error" }, h.value) : null
2359
2359
  ])]) : i ? U(o, {
@@ -2375,7 +2375,7 @@ var ca = J({
2375
2375
  }, [U("span", {
2376
2376
  class: "markweave-attachment-icon",
2377
2377
  "aria-hidden": "true"
2378
- }, [Qi(Wi, t.uploading)]), U("span", { class: "markweave-attachment-body" }, [U("span", { class: "markweave-attachment-name" }, g.value ?? t.uploading), U("span", { class: "markweave-attachment-meta" }, [U("span", {
2378
+ }, [Zi(Ui, t.uploading)]), U("span", { class: "markweave-attachment-body" }, [U("span", { class: "markweave-attachment-name" }, g.value ?? t.uploading), U("span", { class: "markweave-attachment-meta" }, [U("span", {
2379
2379
  class: "markweave-attachment-spinner",
2380
2380
  "aria-hidden": "true"
2381
2381
  }), u || t.uploading])])]) : U(o, {
@@ -2394,7 +2394,7 @@ var ca = J({
2394
2394
  p.value = !1;
2395
2395
  },
2396
2396
  onMousedown: (e) => {
2397
- !a.value || oa(e.target) || (e.preventDefault(), y());
2397
+ !a.value || aa(e.target) || (e.preventDefault(), y());
2398
2398
  },
2399
2399
  onKeydown: (t) => {
2400
2400
  a.value && e.selected && (t.key === "Delete" || t.key === "Backspace") && (t.preventDefault(), e.deleteNode());
@@ -2404,7 +2404,7 @@ var ca = J({
2404
2404
  U("span", {
2405
2405
  class: "markweave-attachment-icon",
2406
2406
  "aria-hidden": "true"
2407
- }, [Qi(Ci, t.nodeAriaLabel)]),
2407
+ }, [Zi(Si, t.nodeAriaLabel)]),
2408
2408
  U("span", { class: "markweave-attachment-body" }, [U("span", { class: "markweave-attachment-name" }, c.value), d.value ? U("span", { class: "markweave-attachment-meta" }, d.value) : null]),
2409
2409
  l ? U("span", {
2410
2410
  class: "markweave-attachment-actions",
@@ -2417,7 +2417,7 @@ var ca = J({
2417
2417
  "aria-label": t.downloadAriaLabel,
2418
2418
  onMousedown: (e) => e.preventDefault(),
2419
2419
  onClick: S
2420
- }, [Qi(ri, t.download), U("span", {
2420
+ }, [Zi(ni, t.download), U("span", {
2421
2421
  class: "markweave-attachment-tooltip",
2422
2422
  role: "tooltip"
2423
2423
  }, t.download)]), a.value ? U("button", {
@@ -2430,14 +2430,14 @@ var ca = J({
2430
2430
  onClick: (t) => {
2431
2431
  t.preventDefault(), t.stopPropagation(), e.deleteNode();
2432
2432
  }
2433
- }, [Qi(Vi, t.delete), U("span", {
2433
+ }, [Zi(Bi, t.delete), U("span", {
2434
2434
  class: "markweave-attachment-tooltip",
2435
2435
  role: "tooltip"
2436
2436
  }, t.delete)]) : null]) : null
2437
2437
  ]);
2438
2438
  };
2439
2439
  }
2440
- }), la = z.extend({
2440
+ }), ca = z.extend({
2441
2441
  addOptions() {
2442
2442
  return {
2443
2443
  ...this.parent?.(),
@@ -2448,9 +2448,9 @@ var ca = J({
2448
2448
  };
2449
2449
  },
2450
2450
  addNodeView() {
2451
- return typeof document > "u" ? null : s(ca, { stopEvent: ({ event: e }) => oa(e.target) });
2451
+ return typeof document > "u" ? null : s(sa, { stopEvent: ({ event: e }) => aa(e.target) });
2452
2452
  }
2453
- }), ua = J({
2453
+ }), la = J({
2454
2454
  name: "MarkweaveVueLinkCardNodeView",
2455
2455
  props: {
2456
2456
  editor: {
@@ -2483,7 +2483,7 @@ var ca = J({
2483
2483
  }
2484
2484
  },
2485
2485
  setup(e) {
2486
- let n = e.extension.options, r = n.messages ?? t("zh"), i = Ji(e.editor), a = W(!1), s = W(!1), c = W(!1), l = G(() => g(e.node.attrs ?? {})), d = W(l.value?.title ?? ""), f = W(l.value?.href ?? "");
2486
+ let n = e.extension.options, r = n.messages ?? t("zh"), i = qi(e.editor), a = W(!1), s = W(!1), c = W(!1), l = G(() => g(e.node.attrs ?? {})), d = W(l.value?.title ?? ""), f = W(l.value?.href ?? "");
2487
2487
  K(l, (e) => {
2488
2488
  d.value = e?.title ?? "", f.value = e?.href ?? "", c.value = !1;
2489
2489
  });
@@ -2518,7 +2518,7 @@ var ca = J({
2518
2518
  "data-testid": n,
2519
2519
  onMousedown: y,
2520
2520
  onClick: r
2521
- }, [Qi(t, e), U("span", { role: "tooltip" }, e)]);
2521
+ }, [Zi(t, e), U("span", { role: "tooltip" }, e)]);
2522
2522
  return () => {
2523
2523
  let t = l.value;
2524
2524
  if (!t) return null;
@@ -2554,10 +2554,10 @@ var ca = J({
2554
2554
  a.value = !1;
2555
2555
  },
2556
2556
  onMousedown: (e) => {
2557
- Zi(e.target) || e.preventDefault();
2557
+ Xi(e.target) || e.preventDefault();
2558
2558
  },
2559
2559
  onClick: (e) => {
2560
- Zi(e.target) || (e.preventDefault(), t.href && window.open(t.href, "_blank", "noopener,noreferrer"));
2560
+ Xi(e.target) || (e.preventDefault(), t.href && window.open(t.href, "_blank", "noopener,noreferrer"));
2561
2561
  }
2562
2562
  }, () => [
2563
2563
  U("a", {
@@ -2577,9 +2577,9 @@ var ca = J({
2577
2577
  "data-markweave-link-card-ui": "true",
2578
2578
  "aria-label": r.linkCard.toolsAriaLabel
2579
2579
  }, [
2580
- C(r.linkCard.convertToLink, gi, "markweave-link-card-convert", x),
2581
- C(r.linkCard.copyAddress, ri, "markweave-link-card-copy", () => b(t.href)),
2582
- C(r.linkCard.edit, wi, "markweave-link-card-edit", (i) => h({
2580
+ C(r.linkCard.convertToLink, hi, "markweave-link-card-convert", x),
2581
+ C(r.linkCard.copyAddress, ni, "markweave-link-card-copy", () => b(t.href)),
2582
+ C(r.linkCard.edit, Ci, "markweave-link-card-edit", (i) => h({
2583
2583
  anchor: i.currentTarget,
2584
2584
  editor: e.editor,
2585
2585
  messages: r,
@@ -2589,7 +2589,7 @@ var ca = J({
2589
2589
  attrs: t
2590
2590
  }
2591
2591
  })),
2592
- C(r.linkCard.delete, Vi, "markweave-link-card-delete", () => e.deleteNode())
2592
+ C(r.linkCard.delete, Bi, "markweave-link-card-delete", () => e.deleteNode())
2593
2593
  ]) : null,
2594
2594
  p.value && s.value ? U("form", {
2595
2595
  class: "markweave-link-card-editor",
@@ -2617,12 +2617,12 @@ var ca = J({
2617
2617
  type: "submit",
2618
2618
  disabled: !_(f.value),
2619
2619
  "aria-label": r.linkCard.edit
2620
- }, [Qi(gi, r.linkCard.edit)])
2620
+ }, [Zi(hi, r.linkCard.edit)])
2621
2621
  ]) : null
2622
2622
  ]);
2623
2623
  };
2624
2624
  }
2625
- }), da = m.extend({
2625
+ }), ua = m.extend({
2626
2626
  addOptions() {
2627
2627
  return {
2628
2628
  ...this.parent?.(),
@@ -2631,27 +2631,28 @@ var ca = J({
2631
2631
  };
2632
2632
  },
2633
2633
  addNodeView() {
2634
- return typeof document > "u" ? null : s(ua, { stopEvent: ({ event: e }) => Zi(e.target) });
2634
+ return typeof document > "u" ? null : s(la, { stopEvent: ({ event: e }) => Xi(e.target) });
2635
2635
  }
2636
2636
  });
2637
2637
  //#endregion
2638
2638
  //#region src/create-editor-extensions.ts
2639
- function fa(n = {}) {
2639
+ function da(n = {}) {
2640
2640
  return e({
2641
2641
  lang: n.lang,
2642
+ revealLinkMarkdown: n.revealLinkMarkdown,
2642
2643
  onImageUpload: n.onImageUpload,
2643
2644
  tableCapabilities: n.tableCapabilities,
2644
2645
  referenceSuggestion: n.referenceSuggestion,
2645
2646
  internalLinkCard: n.internalLinkCard,
2646
- linkCardExtension: da.configure({
2647
+ linkCardExtension: ua.configure({
2647
2648
  lang: n.lang,
2648
2649
  messages: t(n.lang),
2649
2650
  resolver: n.linkCardResolver
2650
2651
  }),
2651
2652
  mediaExtensions: r({
2652
- image: ia,
2653
- video: aa,
2654
- attachment: la,
2653
+ image: ra,
2654
+ video: ia,
2655
+ attachment: ca,
2655
2656
  lang: n.lang,
2656
2657
  onImageUpload: n.onImageUpload,
2657
2658
  onVideoUpload: n.onVideoUpload,
@@ -2664,64 +2665,64 @@ function fa(n = {}) {
2664
2665
  }
2665
2666
  //#endregion
2666
2667
  //#region ../../node_modules/.pnpm/@tiptap+vue-2@3.29.2_@floating-ui+dom@1.7.6_@tiptap+core@3.29.2_@tiptap+pm@3.29.2__@tiptap+pm@3.29.2_vue@2.6.12/node_modules/@tiptap/vue-2/dist/menus/index.js
2667
- var pa = [
2668
+ var fa = [
2668
2669
  "top",
2669
2670
  "right",
2670
2671
  "bottom",
2671
2672
  "left"
2672
- ], ma = ["start", "end"], ha = /* @__PURE__ */ pa.reduce((e, t) => e.concat(t, t + "-" + ma[0], t + "-" + ma[1]), []), ga = Math.min, X = Math.max, _a = Math.round, va = (e) => ({
2673
+ ], pa = ["start", "end"], ma = /* @__PURE__ */ fa.reduce((e, t) => e.concat(t, t + "-" + pa[0], t + "-" + pa[1]), []), ha = Math.min, X = Math.max, ga = Math.round, _a = (e) => ({
2673
2674
  x: e,
2674
2675
  y: e
2675
- }), ya = {
2676
+ }), va = {
2676
2677
  left: "right",
2677
2678
  right: "left",
2678
2679
  bottom: "top",
2679
2680
  top: "bottom"
2680
- }, ba = {
2681
+ }, ya = {
2681
2682
  start: "end",
2682
2683
  end: "start"
2683
2684
  };
2684
- function xa(e, t, n) {
2685
- return X(e, ga(t, n));
2685
+ function ba(e, t, n) {
2686
+ return X(e, ha(t, n));
2686
2687
  }
2687
- function Sa(e, t) {
2688
+ function xa(e, t) {
2688
2689
  return typeof e == "function" ? e(t) : e;
2689
2690
  }
2690
- function Ca(e) {
2691
+ function Sa(e) {
2691
2692
  return e.split("-")[0];
2692
2693
  }
2693
- function wa(e) {
2694
+ function Ca(e) {
2694
2695
  return e.split("-")[1];
2695
2696
  }
2696
- function Ta(e) {
2697
+ function wa(e) {
2697
2698
  return e === "x" ? "y" : "x";
2698
2699
  }
2699
- function Ea(e) {
2700
+ function Ta(e) {
2700
2701
  return e === "y" ? "height" : "width";
2701
2702
  }
2702
- function Da(e) {
2703
- return ["top", "bottom"].includes(Ca(e)) ? "y" : "x";
2703
+ function Ea(e) {
2704
+ return ["top", "bottom"].includes(Sa(e)) ? "y" : "x";
2704
2705
  }
2705
- function Oa(e) {
2706
- return Ta(Da(e));
2706
+ function Da(e) {
2707
+ return wa(Ea(e));
2707
2708
  }
2708
- function ka(e, t, n) {
2709
+ function Oa(e, t, n) {
2709
2710
  n === void 0 && (n = !1);
2710
- let r = wa(e), i = Oa(e), a = Ea(i), o = i === "x" ? r === (n ? "end" : "start") ? "right" : "left" : r === "start" ? "bottom" : "top";
2711
- return t.reference[a] > t.floating[a] && (o = Pa(o)), [o, Pa(o)];
2711
+ let r = Ca(e), i = Da(e), a = Ta(i), o = i === "x" ? r === (n ? "end" : "start") ? "right" : "left" : r === "start" ? "bottom" : "top";
2712
+ return t.reference[a] > t.floating[a] && (o = Na(o)), [o, Na(o)];
2712
2713
  }
2713
- function Aa(e) {
2714
- let t = Pa(e);
2714
+ function ka(e) {
2715
+ let t = Na(e);
2715
2716
  return [
2716
- ja(e),
2717
+ Aa(e),
2717
2718
  t,
2718
- ja(t)
2719
+ Aa(t)
2719
2720
  ];
2720
2721
  }
2721
- function ja(e) {
2722
- return e.replace(/start|end/g, (e) => ba[e]);
2722
+ function Aa(e) {
2723
+ return e.replace(/start|end/g, (e) => ya[e]);
2723
2724
  }
2724
- function Ma(e, t, n) {
2725
+ function ja(e, t, n) {
2725
2726
  let r = ["left", "right"], i = ["right", "left"], a = ["top", "bottom"], o = ["bottom", "top"];
2726
2727
  switch (e) {
2727
2728
  case "top":
@@ -2731,14 +2732,14 @@ function Ma(e, t, n) {
2731
2732
  default: return [];
2732
2733
  }
2733
2734
  }
2734
- function Na(e, t, n, r) {
2735
- let i = wa(e), a = Ma(Ca(e), n === "start", r);
2736
- return i && (a = a.map((e) => e + "-" + i), t && (a = a.concat(a.map(ja)))), a;
2735
+ function Ma(e, t, n, r) {
2736
+ let i = Ca(e), a = ja(Sa(e), n === "start", r);
2737
+ return i && (a = a.map((e) => e + "-" + i), t && (a = a.concat(a.map(Aa)))), a;
2737
2738
  }
2738
- function Pa(e) {
2739
- return e.replace(/left|right|bottom|top/g, (e) => ya[e]);
2739
+ function Na(e) {
2740
+ return e.replace(/left|right|bottom|top/g, (e) => va[e]);
2740
2741
  }
2741
- function Fa(e) {
2742
+ function Pa(e) {
2742
2743
  return {
2743
2744
  top: 0,
2744
2745
  right: 0,
@@ -2747,15 +2748,15 @@ function Fa(e) {
2747
2748
  ...e
2748
2749
  };
2749
2750
  }
2750
- function Ia(e) {
2751
+ function Fa(e) {
2751
2752
  return typeof e == "number" ? {
2752
2753
  top: e,
2753
2754
  right: e,
2754
2755
  bottom: e,
2755
2756
  left: e
2756
- } : Fa(e);
2757
+ } : Pa(e);
2757
2758
  }
2758
- function La(e) {
2759
+ function Ia(e) {
2759
2760
  let { x: t, y: n, width: r, height: i } = e;
2760
2761
  return {
2761
2762
  width: r,
@@ -2768,8 +2769,8 @@ function La(e) {
2768
2769
  y: n
2769
2770
  };
2770
2771
  }
2771
- function Ra(e, t, n) {
2772
- let { reference: r, floating: i } = e, a = Da(t), o = Oa(t), s = Ea(o), c = Ca(t), l = a === "y", u = r.x + r.width / 2 - i.width / 2, d = r.y + r.height / 2 - i.height / 2, f = r[s] / 2 - i[s] / 2, p;
2772
+ function La(e, t, n) {
2773
+ let { reference: r, floating: i } = e, a = Ea(t), o = Da(t), s = Ta(o), c = Sa(t), l = a === "y", u = r.x + r.width / 2 - i.width / 2, d = r.y + r.height / 2 - i.height / 2, f = r[s] / 2 - i[s] / 2, p;
2773
2774
  switch (c) {
2774
2775
  case "top":
2775
2776
  p = {
@@ -2800,7 +2801,7 @@ function Ra(e, t, n) {
2800
2801
  y: r.y
2801
2802
  };
2802
2803
  }
2803
- switch (wa(t)) {
2804
+ switch (Ca(t)) {
2804
2805
  case "start":
2805
2806
  p[o] -= f * (n && l ? -1 : 1);
2806
2807
  break;
@@ -2810,12 +2811,12 @@ function Ra(e, t, n) {
2810
2811
  }
2811
2812
  return p;
2812
2813
  }
2813
- var za = async (e, t, n) => {
2814
+ var Ra = async (e, t, n) => {
2814
2815
  let { placement: r = "bottom", strategy: i = "absolute", middleware: a = [], platform: o } = n, s = a.filter(Boolean), c = await (o.isRTL == null ? void 0 : o.isRTL(t)), l = await o.getElementRects({
2815
2816
  reference: e,
2816
2817
  floating: t,
2817
2818
  strategy: i
2818
- }), { x: u, y: d } = Ra(l, r, c), f = r, p = {}, m = 0;
2819
+ }), { x: u, y: d } = La(l, r, c), f = r, p = {}, m = 0;
2819
2820
  for (let n = 0; n < s.length; n++) {
2820
2821
  let { name: a, fn: h } = s[n], { x: g, y: _, data: v, reset: y } = await h({
2821
2822
  x: u,
@@ -2841,7 +2842,7 @@ var za = async (e, t, n) => {
2841
2842
  reference: e,
2842
2843
  floating: t,
2843
2844
  strategy: i
2844
- }) : y.rects), {x: u, y: d} = Ra(l, f, c)), n = -1);
2845
+ }) : y.rects), {x: u, y: d} = La(l, f, c)), n = -1);
2845
2846
  }
2846
2847
  return {
2847
2848
  x: u,
@@ -2851,9 +2852,9 @@ var za = async (e, t, n) => {
2851
2852
  middlewareData: p
2852
2853
  };
2853
2854
  };
2854
- async function Ba(e, t) {
2855
+ async function za(e, t) {
2855
2856
  t === void 0 && (t = {});
2856
- let { x: n, y: r, platform: i, rects: a, elements: o, strategy: s } = e, { boundary: c = "clippingAncestors", rootBoundary: l = "viewport", elementContext: u = "floating", altBoundary: d = !1, padding: f = 0 } = Sa(t, e), p = Ia(f), m = o[d ? u === "floating" ? "reference" : "floating" : u], h = La(await i.getClippingRect({
2857
+ let { x: n, y: r, platform: i, rects: a, elements: o, strategy: s } = e, { boundary: c = "clippingAncestors", rootBoundary: l = "viewport", elementContext: u = "floating", altBoundary: d = !1, padding: f = 0 } = xa(t, e), p = Fa(f), m = o[d ? u === "floating" ? "reference" : "floating" : u], h = Ia(await i.getClippingRect({
2857
2858
  element: await (i.isElement == null ? void 0 : i.isElement(m)) ?? !0 ? m : m.contextElement || await (i.getDocumentElement == null ? void 0 : i.getDocumentElement(o.floating)),
2858
2859
  boundary: c,
2859
2860
  rootBoundary: l,
@@ -2866,7 +2867,7 @@ async function Ba(e, t) {
2866
2867
  } : a.reference, _ = await (i.getOffsetParent == null ? void 0 : i.getOffsetParent(o.floating)), v = await (i.isElement == null ? void 0 : i.isElement(_)) && await (i.getScale == null ? void 0 : i.getScale(_)) || {
2867
2868
  x: 1,
2868
2869
  y: 1
2869
- }, y = La(i.convertOffsetParentRelativeRectToViewportRelativeRect ? await i.convertOffsetParentRelativeRectToViewportRelativeRect({
2870
+ }, y = Ia(i.convertOffsetParentRelativeRectToViewportRelativeRect ? await i.convertOffsetParentRelativeRectToViewportRelativeRect({
2870
2871
  elements: o,
2871
2872
  rect: g,
2872
2873
  offsetParent: _,
@@ -2879,18 +2880,18 @@ async function Ba(e, t) {
2879
2880
  right: (y.right - h.right + p.right) / v.x
2880
2881
  };
2881
2882
  }
2882
- var Va = (e) => ({
2883
+ var Ba = (e) => ({
2883
2884
  name: "arrow",
2884
2885
  options: e,
2885
2886
  async fn(t) {
2886
- let { x: n, y: r, placement: i, rects: a, platform: o, elements: s, middlewareData: c } = t, { element: l, padding: u = 0 } = Sa(e, t) || {};
2887
+ let { x: n, y: r, placement: i, rects: a, platform: o, elements: s, middlewareData: c } = t, { element: l, padding: u = 0 } = xa(e, t) || {};
2887
2888
  if (l == null) return {};
2888
- let d = Ia(u), f = {
2889
+ let d = Fa(u), f = {
2889
2890
  x: n,
2890
2891
  y: r
2891
- }, p = Oa(i), m = Ea(p), h = await o.getDimensions(l), g = p === "y", _ = g ? "top" : "left", v = g ? "bottom" : "right", y = g ? "clientHeight" : "clientWidth", b = a.reference[m] + a.reference[p] - f[p] - a.floating[m], x = f[p] - a.reference[p], S = await (o.getOffsetParent == null ? void 0 : o.getOffsetParent(l)), C = S ? S[y] : 0;
2892
+ }, p = Da(i), m = Ta(p), h = await o.getDimensions(l), g = p === "y", _ = g ? "top" : "left", v = g ? "bottom" : "right", y = g ? "clientHeight" : "clientWidth", b = a.reference[m] + a.reference[p] - f[p] - a.floating[m], x = f[p] - a.reference[p], S = await (o.getOffsetParent == null ? void 0 : o.getOffsetParent(l)), C = S ? S[y] : 0;
2892
2893
  (!C || !await (o.isElement == null ? void 0 : o.isElement(S))) && (C = s.floating[y] || a.floating[m]);
2893
- let w = b / 2 - x / 2, T = C / 2 - h[m] / 2 - 1, E = ga(d[_], T), D = ga(d[v], T), O = E, k = C - h[m] - D, A = C / 2 - h[m] / 2 + w, j = xa(O, A, k), M = !c.arrow && wa(i) != null && A !== j && a.reference[m] / 2 - (A < O ? E : D) - h[m] / 2 < 0, N = M ? A < O ? A - O : A - k : 0;
2894
+ let w = b / 2 - x / 2, T = C / 2 - h[m] / 2 - 1, E = ha(d[_], T), D = ha(d[v], T), O = E, k = C - h[m] - D, A = C / 2 - h[m] / 2 + w, j = ba(O, A, k), M = !c.arrow && Ca(i) != null && A !== j && a.reference[m] / 2 - (A < O ? E : D) - h[m] / 2 < 0, N = M ? A < O ? A - O : A - k : 0;
2894
2895
  return {
2895
2896
  [p]: f[p] + N,
2896
2897
  data: {
@@ -2902,20 +2903,20 @@ var Va = (e) => ({
2902
2903
  };
2903
2904
  }
2904
2905
  });
2905
- function Ha(e, t, n) {
2906
- return (e ? [...n.filter((t) => wa(t) === e), ...n.filter((t) => wa(t) !== e)] : n.filter((e) => Ca(e) === e)).filter((n) => e ? wa(n) === e || (t ? ja(n) !== n : !1) : !0);
2906
+ function Va(e, t, n) {
2907
+ return (e ? [...n.filter((t) => Ca(t) === e), ...n.filter((t) => Ca(t) !== e)] : n.filter((e) => Sa(e) === e)).filter((n) => e ? Ca(n) === e || (t ? Aa(n) !== n : !1) : !0);
2907
2908
  }
2908
- var Ua = function(e) {
2909
+ var Ha = function(e) {
2909
2910
  return e === void 0 && (e = {}), {
2910
2911
  name: "autoPlacement",
2911
2912
  options: e,
2912
2913
  async fn(t) {
2913
- let { rects: n, middlewareData: r, placement: i, platform: a, elements: o } = t, { crossAxis: s = !1, alignment: c, allowedPlacements: l = ha, autoAlignment: u = !0, ...d } = Sa(e, t), f = c !== void 0 || l === ha ? Ha(c || null, u, l) : l, p = await Ba(t, d), m = r.autoPlacement?.index || 0, h = f[m];
2914
+ let { rects: n, middlewareData: r, placement: i, platform: a, elements: o } = t, { crossAxis: s = !1, alignment: c, allowedPlacements: l = ma, autoAlignment: u = !0, ...d } = xa(e, t), f = c !== void 0 || l === ma ? Va(c || null, u, l) : l, p = await za(t, d), m = r.autoPlacement?.index || 0, h = f[m];
2914
2915
  if (h == null) return {};
2915
- let g = ka(h, n, await (a.isRTL == null ? void 0 : a.isRTL(o.floating)));
2916
+ let g = Oa(h, n, await (a.isRTL == null ? void 0 : a.isRTL(o.floating)));
2916
2917
  if (i !== h) return { reset: { placement: f[0] } };
2917
2918
  let _ = [
2918
- p[Ca(h)],
2919
+ p[Sa(h)],
2919
2920
  p[g[0]],
2920
2921
  p[g[1]]
2921
2922
  ], v = [...r.autoPlacement?.overflows || [], {
@@ -2930,13 +2931,13 @@ var Ua = function(e) {
2930
2931
  reset: { placement: y }
2931
2932
  };
2932
2933
  let b = v.map((e) => {
2933
- let t = wa(e.placement);
2934
+ let t = Ca(e.placement);
2934
2935
  return [
2935
2936
  e.placement,
2936
2937
  t && s ? e.overflows.slice(0, 2).reduce((e, t) => e + t, 0) : e.overflows[0],
2937
2938
  e.overflows
2938
2939
  ];
2939
- }).sort((e, t) => e[1] - t[1]), x = b.filter((e) => e[2].slice(0, wa(e[0]) ? 2 : 3).every((e) => e <= 0))[0]?.[0] || b[0][0];
2940
+ }).sort((e, t) => e[1] - t[1]), x = b.filter((e) => e[2].slice(0, Ca(e[0]) ? 2 : 3).every((e) => e <= 0))[0]?.[0] || b[0][0];
2940
2941
  return x === i ? {} : {
2941
2942
  data: {
2942
2943
  index: m + 1,
@@ -2946,19 +2947,19 @@ var Ua = function(e) {
2946
2947
  };
2947
2948
  }
2948
2949
  };
2949
- }, Wa = function(e) {
2950
+ }, Ua = function(e) {
2950
2951
  return e === void 0 && (e = {}), {
2951
2952
  name: "flip",
2952
2953
  options: e,
2953
2954
  async fn(t) {
2954
2955
  var n;
2955
- let { placement: r, middlewareData: i, rects: a, initialPlacement: o, platform: s, elements: c } = t, { mainAxis: l = !0, crossAxis: u = !0, fallbackPlacements: d, fallbackStrategy: f = "bestFit", fallbackAxisSideDirection: p = "none", flipAlignment: m = !0, ...h } = Sa(e, t);
2956
+ let { placement: r, middlewareData: i, rects: a, initialPlacement: o, platform: s, elements: c } = t, { mainAxis: l = !0, crossAxis: u = !0, fallbackPlacements: d, fallbackStrategy: f = "bestFit", fallbackAxisSideDirection: p = "none", flipAlignment: m = !0, ...h } = xa(e, t);
2956
2957
  if ((n = i.arrow) != null && n.alignmentOffset) return {};
2957
- let g = Ca(r), _ = Da(o), v = Ca(o) === o, y = await (s.isRTL == null ? void 0 : s.isRTL(c.floating)), b = d || (v || !m ? [Pa(o)] : Aa(o)), x = p !== "none";
2958
- !d && x && b.push(...Na(o, m, p, y));
2959
- let S = [o, ...b], C = await Ba(t, h), w = [], T = i.flip?.overflows || [];
2958
+ let g = Sa(r), _ = Ea(o), v = Sa(o) === o, y = await (s.isRTL == null ? void 0 : s.isRTL(c.floating)), b = d || (v || !m ? [Na(o)] : ka(o)), x = p !== "none";
2959
+ !d && x && b.push(...Ma(o, m, p, y));
2960
+ let S = [o, ...b], C = await za(t, h), w = [], T = i.flip?.overflows || [];
2960
2961
  if (l && w.push(C[g]), u) {
2961
- let e = ka(r, a, y);
2962
+ let e = Oa(r, a, y);
2962
2963
  w.push(C[e[0]], C[e[1]]);
2963
2964
  }
2964
2965
  if (T = [...T, {
@@ -2978,7 +2979,7 @@ var Ua = function(e) {
2978
2979
  case "bestFit": {
2979
2980
  let e = T.filter((e) => {
2980
2981
  if (x) {
2981
- let t = Da(e.placement);
2982
+ let t = Ea(e.placement);
2982
2983
  return t === _ || t === "y";
2983
2984
  }
2984
2985
  return !0;
@@ -2996,7 +2997,7 @@ var Ua = function(e) {
2996
2997
  }
2997
2998
  };
2998
2999
  };
2999
- function Ga(e, t) {
3000
+ function Wa(e, t) {
3000
3001
  return {
3001
3002
  top: e.top - t.height,
3002
3003
  right: e.right - t.width,
@@ -3004,34 +3005,34 @@ function Ga(e, t) {
3004
3005
  left: e.left - t.width
3005
3006
  };
3006
3007
  }
3007
- function Ka(e) {
3008
- return pa.some((t) => e[t] >= 0);
3008
+ function Ga(e) {
3009
+ return fa.some((t) => e[t] >= 0);
3009
3010
  }
3010
- var qa = function(e) {
3011
+ var Ka = function(e) {
3011
3012
  return e === void 0 && (e = {}), {
3012
3013
  name: "hide",
3013
3014
  options: e,
3014
3015
  async fn(t) {
3015
- let { rects: n } = t, { strategy: r = "referenceHidden", ...i } = Sa(e, t);
3016
+ let { rects: n } = t, { strategy: r = "referenceHidden", ...i } = xa(e, t);
3016
3017
  switch (r) {
3017
3018
  case "referenceHidden": {
3018
- let e = Ga(await Ba(t, {
3019
+ let e = Wa(await za(t, {
3019
3020
  ...i,
3020
3021
  elementContext: "reference"
3021
3022
  }), n.reference);
3022
3023
  return { data: {
3023
3024
  referenceHiddenOffsets: e,
3024
- referenceHidden: Ka(e)
3025
+ referenceHidden: Ga(e)
3025
3026
  } };
3026
3027
  }
3027
3028
  case "escaped": {
3028
- let e = Ga(await Ba(t, {
3029
+ let e = Wa(await za(t, {
3029
3030
  ...i,
3030
3031
  altBoundary: !0
3031
3032
  }), n.floating);
3032
3033
  return { data: {
3033
3034
  escapedOffsets: e,
3034
- escaped: Ka(e)
3035
+ escaped: Ga(e)
3035
3036
  } };
3036
3037
  }
3037
3038
  default: return {};
@@ -3039,8 +3040,8 @@ var qa = function(e) {
3039
3040
  }
3040
3041
  };
3041
3042
  };
3042
- function Ja(e) {
3043
- let t = ga(...e.map((e) => e.left)), n = ga(...e.map((e) => e.top)), r = X(...e.map((e) => e.right)), i = X(...e.map((e) => e.bottom));
3043
+ function qa(e) {
3044
+ let t = ha(...e.map((e) => e.left)), n = ha(...e.map((e) => e.top)), r = X(...e.map((e) => e.right)), i = X(...e.map((e) => e.bottom));
3044
3045
  return {
3045
3046
  x: t,
3046
3047
  y: n,
@@ -3048,25 +3049,25 @@ function Ja(e) {
3048
3049
  height: i - n
3049
3050
  };
3050
3051
  }
3051
- function Ya(e) {
3052
+ function Ja(e) {
3052
3053
  let t = e.slice().sort((e, t) => e.y - t.y), n = [], r = null;
3053
3054
  for (let e = 0; e < t.length; e++) {
3054
3055
  let i = t[e];
3055
3056
  !r || i.y - r.y > r.height / 2 ? n.push([i]) : n[n.length - 1].push(i), r = i;
3056
3057
  }
3057
- return n.map((e) => La(Ja(e)));
3058
+ return n.map((e) => Ia(qa(e)));
3058
3059
  }
3059
- var Xa = function(e) {
3060
+ var Ya = function(e) {
3060
3061
  return e === void 0 && (e = {}), {
3061
3062
  name: "inline",
3062
3063
  options: e,
3063
3064
  async fn(t) {
3064
- let { placement: n, elements: r, rects: i, platform: a, strategy: o } = t, { padding: s = 2, x: c, y: l } = Sa(e, t), u = Array.from(await (a.getClientRects == null ? void 0 : a.getClientRects(r.reference)) || []), d = Ya(u), f = La(Ja(u)), p = Ia(s);
3065
+ let { placement: n, elements: r, rects: i, platform: a, strategy: o } = t, { padding: s = 2, x: c, y: l } = xa(e, t), u = Array.from(await (a.getClientRects == null ? void 0 : a.getClientRects(r.reference)) || []), d = Ja(u), f = Ia(qa(u)), p = Fa(s);
3065
3066
  function m() {
3066
3067
  if (d.length === 2 && d[0].left > d[1].right && c != null && l != null) return d.find((e) => c > e.left - p.left && c < e.right + p.right && l > e.top - p.top && l < e.bottom + p.bottom) || f;
3067
3068
  if (d.length >= 2) {
3068
- if (Da(n) === "y") {
3069
- let e = d[0], t = d[d.length - 1], r = Ca(n) === "top", i = e.top, a = t.bottom, o = r ? e.left : t.left, s = r ? e.right : t.right;
3069
+ if (Ea(n) === "y") {
3070
+ let e = d[0], t = d[d.length - 1], r = Sa(n) === "top", i = e.top, a = t.bottom, o = r ? e.left : t.left, s = r ? e.right : t.right;
3070
3071
  return {
3071
3072
  top: i,
3072
3073
  bottom: a,
@@ -3078,7 +3079,7 @@ var Xa = function(e) {
3078
3079
  y: i
3079
3080
  };
3080
3081
  }
3081
- let e = Ca(n) === "left", t = X(...d.map((e) => e.right)), r = ga(...d.map((e) => e.left)), i = d.filter((n) => e ? n.left === r : n.right === t), a = i[0].top, o = i[i.length - 1].bottom, s = r, c = t;
3082
+ let e = Sa(n) === "left", t = X(...d.map((e) => e.right)), r = ha(...d.map((e) => e.left)), i = d.filter((n) => e ? n.left === r : n.right === t), a = i[0].top, o = i[i.length - 1].bottom, s = r, c = t;
3082
3083
  return {
3083
3084
  top: a,
3084
3085
  bottom: o,
@@ -3101,8 +3102,8 @@ var Xa = function(e) {
3101
3102
  }
3102
3103
  };
3103
3104
  };
3104
- async function Za(e, t) {
3105
- let { placement: n, platform: r, elements: i } = e, a = await (r.isRTL == null ? void 0 : r.isRTL(i.floating)), o = Ca(n), s = wa(n), c = Da(n) === "y", l = ["left", "top"].includes(o) ? -1 : 1, u = a && c ? -1 : 1, d = Sa(t, e), { mainAxis: f, crossAxis: p, alignmentAxis: m } = typeof d == "number" ? {
3105
+ async function Xa(e, t) {
3106
+ let { placement: n, platform: r, elements: i } = e, a = await (r.isRTL == null ? void 0 : r.isRTL(i.floating)), o = Sa(n), s = Ca(n), c = Ea(n) === "y", l = ["left", "top"].includes(o) ? -1 : 1, u = a && c ? -1 : 1, d = xa(t, e), { mainAxis: f, crossAxis: p, alignmentAxis: m } = typeof d == "number" ? {
3106
3107
  mainAxis: d,
3107
3108
  crossAxis: 0,
3108
3109
  alignmentAxis: null
@@ -3119,13 +3120,13 @@ async function Za(e, t) {
3119
3120
  y: p * u
3120
3121
  };
3121
3122
  }
3122
- var Qa = function(e) {
3123
+ var Za = function(e) {
3123
3124
  return e === void 0 && (e = 0), {
3124
3125
  name: "offset",
3125
3126
  options: e,
3126
3127
  async fn(t) {
3127
3128
  var n;
3128
- let { x: r, y: i, placement: a, middlewareData: o } = t, s = await Za(t, e);
3129
+ let { x: r, y: i, placement: a, middlewareData: o } = t, s = await Xa(t, e);
3129
3130
  return a === o.offset?.placement && (n = o.arrow) != null && n.alignmentOffset ? {} : {
3130
3131
  x: r + s.x,
3131
3132
  y: i + s.y,
@@ -3136,7 +3137,7 @@ var Qa = function(e) {
3136
3137
  };
3137
3138
  }
3138
3139
  };
3139
- }, $a = function(e) {
3140
+ }, Qa = function(e) {
3140
3141
  return e === void 0 && (e = {}), {
3141
3142
  name: "shift",
3142
3143
  options: e,
@@ -3147,17 +3148,17 @@ var Qa = function(e) {
3147
3148
  x: t,
3148
3149
  y: n
3149
3150
  };
3150
- } }, ...c } = Sa(e, t), l = {
3151
+ } }, ...c } = xa(e, t), l = {
3151
3152
  x: n,
3152
3153
  y: r
3153
- }, u = await Ba(t, c), d = Da(Ca(i)), f = Ta(d), p = l[f], m = l[d];
3154
+ }, u = await za(t, c), d = Ea(Sa(i)), f = wa(d), p = l[f], m = l[d];
3154
3155
  if (a) {
3155
3156
  let e = f === "y" ? "top" : "left", t = f === "y" ? "bottom" : "right", n = p + u[e], r = p - u[t];
3156
- p = xa(n, p, r);
3157
+ p = ba(n, p, r);
3157
3158
  }
3158
3159
  if (o) {
3159
3160
  let e = d === "y" ? "top" : "left", t = d === "y" ? "bottom" : "right", n = m + u[e], r = m - u[t];
3160
- m = xa(n, m, r);
3161
+ m = ba(n, m, r);
3161
3162
  }
3162
3163
  let h = s.fn({
3163
3164
  ...t,
@@ -3177,15 +3178,15 @@ var Qa = function(e) {
3177
3178
  };
3178
3179
  }
3179
3180
  };
3180
- }, eo = function(e) {
3181
+ }, $a = function(e) {
3181
3182
  return e === void 0 && (e = {}), {
3182
3183
  name: "size",
3183
3184
  options: e,
3184
3185
  async fn(t) {
3185
3186
  var n, r;
3186
- let { placement: i, rects: a, platform: o, elements: s } = t, { apply: c = () => {}, ...l } = Sa(e, t), u = await Ba(t, l), d = Ca(i), f = wa(i), p = Da(i) === "y", { width: m, height: h } = a.floating, g, _;
3187
+ let { placement: i, rects: a, platform: o, elements: s } = t, { apply: c = () => {}, ...l } = xa(e, t), u = await za(t, l), d = Sa(i), f = Ca(i), p = Ea(i) === "y", { width: m, height: h } = a.floating, g, _;
3187
3188
  d === "top" || d === "bottom" ? (g = d, _ = f === (await (o.isRTL == null ? void 0 : o.isRTL(s.floating)) ? "start" : "end") ? "left" : "right") : (_ = d, g = f === "end" ? "top" : "bottom");
3188
- let v = h - u.top - u.bottom, y = m - u.left - u.right, b = ga(h - u[g], v), x = ga(m - u[_], y), S = !t.middlewareData.shift, C = b, w = x;
3189
+ let v = h - u.top - u.bottom, y = m - u.left - u.right, b = ha(h - u[g], v), x = ha(m - u[_], y), S = !t.middlewareData.shift, C = b, w = x;
3189
3190
  if ((n = t.middlewareData.shift) != null && n.enabled.x && (w = y), (r = t.middlewareData.shift) != null && r.enabled.y && (C = v), S && !f) {
3190
3191
  let e = X(u.left, 0), t = X(u.right, 0), n = X(u.top, 0), r = X(u.bottom, 0);
3191
3192
  p ? w = m - 2 * (e !== 0 || t !== 0 ? e + t : X(u.left, u.right)) : C = h - 2 * (n !== 0 || r !== 0 ? n + r : X(u.top, u.bottom));
@@ -3200,43 +3201,43 @@ var Qa = function(e) {
3200
3201
  }
3201
3202
  };
3202
3203
  };
3203
- function to() {
3204
+ function eo() {
3204
3205
  return typeof window < "u";
3205
3206
  }
3206
- function no(e) {
3207
- return io(e) ? (e.nodeName || "").toLowerCase() : "#document";
3207
+ function to(e) {
3208
+ return ro(e) ? (e.nodeName || "").toLowerCase() : "#document";
3208
3209
  }
3209
3210
  function Z(e) {
3210
3211
  var t;
3211
3212
  return (e == null || (t = e.ownerDocument) == null ? void 0 : t.defaultView) || window;
3212
3213
  }
3214
+ function no(e) {
3215
+ return ((ro(e) ? e.ownerDocument : e.document) || window.document)?.documentElement;
3216
+ }
3213
3217
  function ro(e) {
3214
- return ((io(e) ? e.ownerDocument : e.document) || window.document)?.documentElement;
3218
+ return eo() ? e instanceof Node || e instanceof Z(e).Node : !1;
3215
3219
  }
3216
3220
  function io(e) {
3217
- return to() ? e instanceof Node || e instanceof Z(e).Node : !1;
3221
+ return eo() ? e instanceof Element || e instanceof Z(e).Element : !1;
3218
3222
  }
3219
3223
  function ao(e) {
3220
- return to() ? e instanceof Element || e instanceof Z(e).Element : !1;
3224
+ return eo() ? e instanceof HTMLElement || e instanceof Z(e).HTMLElement : !1;
3221
3225
  }
3222
3226
  function oo(e) {
3223
- return to() ? e instanceof HTMLElement || e instanceof Z(e).HTMLElement : !1;
3227
+ return !eo() || typeof ShadowRoot > "u" ? !1 : e instanceof ShadowRoot || e instanceof Z(e).ShadowRoot;
3224
3228
  }
3225
3229
  function so(e) {
3226
- return !to() || typeof ShadowRoot > "u" ? !1 : e instanceof ShadowRoot || e instanceof Z(e).ShadowRoot;
3227
- }
3228
- function co(e) {
3229
- let { overflow: t, overflowX: n, overflowY: r, display: i } = go(e);
3230
+ let { overflow: t, overflowX: n, overflowY: r, display: i } = ho(e);
3230
3231
  return /auto|scroll|overlay|hidden|clip/.test(t + r + n) && !["inline", "contents"].includes(i);
3231
3232
  }
3232
- function lo(e) {
3233
+ function co(e) {
3233
3234
  return [
3234
3235
  "table",
3235
3236
  "td",
3236
3237
  "th"
3237
- ].includes(no(e));
3238
+ ].includes(to(e));
3238
3239
  }
3239
- function uo(e) {
3240
+ function lo(e) {
3240
3241
  return [":popover-open", ":modal"].some((t) => {
3241
3242
  try {
3242
3243
  return e.matches(t);
@@ -3245,8 +3246,8 @@ function uo(e) {
3245
3246
  }
3246
3247
  });
3247
3248
  }
3248
- function fo(e) {
3249
- let t = mo(), n = ao(e) ? go(e) : e;
3249
+ function uo(e) {
3250
+ let t = po(), n = io(e) ? ho(e) : e;
3250
3251
  return [
3251
3252
  "transform",
3252
3253
  "translate",
@@ -3267,30 +3268,30 @@ function fo(e) {
3267
3268
  "content"
3268
3269
  ].some((e) => (n.contain || "").includes(e));
3269
3270
  }
3270
- function po(e) {
3271
- let t = vo(e);
3272
- for (; oo(t) && !ho(t);) {
3273
- if (fo(t)) return t;
3274
- if (uo(t)) return null;
3275
- t = vo(t);
3271
+ function fo(e) {
3272
+ let t = _o(e);
3273
+ for (; ao(t) && !mo(t);) {
3274
+ if (uo(t)) return t;
3275
+ if (lo(t)) return null;
3276
+ t = _o(t);
3276
3277
  }
3277
3278
  return null;
3278
3279
  }
3279
- function mo() {
3280
+ function po() {
3280
3281
  return typeof CSS > "u" || !CSS.supports ? !1 : CSS.supports("-webkit-backdrop-filter", "none");
3281
3282
  }
3282
- function ho(e) {
3283
+ function mo(e) {
3283
3284
  return [
3284
3285
  "html",
3285
3286
  "body",
3286
3287
  "#document"
3287
- ].includes(no(e));
3288
+ ].includes(to(e));
3288
3289
  }
3289
- function go(e) {
3290
+ function ho(e) {
3290
3291
  return Z(e).getComputedStyle(e);
3291
3292
  }
3292
- function _o(e) {
3293
- return ao(e) ? {
3293
+ function go(e) {
3294
+ return io(e) ? {
3294
3295
  scrollLeft: e.scrollLeft,
3295
3296
  scrollTop: e.scrollTop
3296
3297
  } : {
@@ -3298,101 +3299,101 @@ function _o(e) {
3298
3299
  scrollTop: e.scrollY
3299
3300
  };
3300
3301
  }
3301
- function vo(e) {
3302
- if (no(e) === "html") return e;
3303
- let t = e.assignedSlot || e.parentNode || so(e) && e.host || ro(e);
3304
- return so(t) ? t.host : t;
3302
+ function _o(e) {
3303
+ if (to(e) === "html") return e;
3304
+ let t = e.assignedSlot || e.parentNode || oo(e) && e.host || no(e);
3305
+ return oo(t) ? t.host : t;
3305
3306
  }
3306
- function yo(e) {
3307
- let t = vo(e);
3308
- return ho(t) ? e.ownerDocument ? e.ownerDocument.body : e.body : oo(t) && co(t) ? t : yo(t);
3307
+ function vo(e) {
3308
+ let t = _o(e);
3309
+ return mo(t) ? e.ownerDocument ? e.ownerDocument.body : e.body : ao(t) && so(t) ? t : vo(t);
3309
3310
  }
3310
- function bo(e, t, n) {
3311
+ function yo(e, t, n) {
3311
3312
  t === void 0 && (t = []), n === void 0 && (n = !0);
3312
- let r = yo(e), i = r === e.ownerDocument?.body, a = Z(r);
3313
+ let r = vo(e), i = r === e.ownerDocument?.body, a = Z(r);
3313
3314
  if (i) {
3314
- let e = xo(a);
3315
- return t.concat(a, a.visualViewport || [], co(r) ? r : [], e && n ? bo(e) : []);
3315
+ let e = bo(a);
3316
+ return t.concat(a, a.visualViewport || [], so(r) ? r : [], e && n ? yo(e) : []);
3316
3317
  }
3317
- return t.concat(r, bo(r, [], n));
3318
+ return t.concat(r, yo(r, [], n));
3318
3319
  }
3319
- function xo(e) {
3320
+ function bo(e) {
3320
3321
  return e.parent && Object.getPrototypeOf(e.parent) ? e.frameElement : null;
3321
3322
  }
3322
- function So(e) {
3323
- let t = go(e), n = parseFloat(t.width) || 0, r = parseFloat(t.height) || 0, i = oo(e), a = i ? e.offsetWidth : n, o = i ? e.offsetHeight : r, s = _a(n) !== a || _a(r) !== o;
3323
+ function xo(e) {
3324
+ let t = ho(e), n = parseFloat(t.width) || 0, r = parseFloat(t.height) || 0, i = ao(e), a = i ? e.offsetWidth : n, o = i ? e.offsetHeight : r, s = ga(n) !== a || ga(r) !== o;
3324
3325
  return s && (n = a, r = o), {
3325
3326
  width: n,
3326
3327
  height: r,
3327
3328
  $: s
3328
3329
  };
3329
3330
  }
3330
- function Co(e) {
3331
- return ao(e) ? e : e.contextElement;
3331
+ function So(e) {
3332
+ return io(e) ? e : e.contextElement;
3332
3333
  }
3333
- function wo(e) {
3334
- let t = Co(e);
3335
- if (!oo(t)) return va(1);
3336
- let n = t.getBoundingClientRect(), { width: r, height: i, $: a } = So(t), o = (a ? _a(n.width) : n.width) / r, s = (a ? _a(n.height) : n.height) / i;
3334
+ function Co(e) {
3335
+ let t = So(e);
3336
+ if (!ao(t)) return _a(1);
3337
+ let n = t.getBoundingClientRect(), { width: r, height: i, $: a } = xo(t), o = (a ? ga(n.width) : n.width) / r, s = (a ? ga(n.height) : n.height) / i;
3337
3338
  return (!o || !Number.isFinite(o)) && (o = 1), (!s || !Number.isFinite(s)) && (s = 1), {
3338
3339
  x: o,
3339
3340
  y: s
3340
3341
  };
3341
3342
  }
3342
- var To = /* @__PURE__ */ va(0);
3343
- function Eo(e) {
3343
+ var wo = /* @__PURE__ */ _a(0);
3344
+ function To(e) {
3344
3345
  let t = Z(e);
3345
- return !mo() || !t.visualViewport ? To : {
3346
+ return !po() || !t.visualViewport ? wo : {
3346
3347
  x: t.visualViewport.offsetLeft,
3347
3348
  y: t.visualViewport.offsetTop
3348
3349
  };
3349
3350
  }
3350
- function Do(e, t, n) {
3351
+ function Eo(e, t, n) {
3351
3352
  return t === void 0 && (t = !1), !n || t && n !== Z(e) ? !1 : t;
3352
3353
  }
3353
- function Oo(e, t, n, r) {
3354
+ function Do(e, t, n, r) {
3354
3355
  t === void 0 && (t = !1), n === void 0 && (n = !1);
3355
- let i = e.getBoundingClientRect(), a = Co(e), o = va(1);
3356
- t && (r ? ao(r) && (o = wo(r)) : o = wo(e));
3357
- let s = Do(a, n, r) ? Eo(a) : va(0), c = (i.left + s.x) / o.x, l = (i.top + s.y) / o.y, u = i.width / o.x, d = i.height / o.y;
3356
+ let i = e.getBoundingClientRect(), a = So(e), o = _a(1);
3357
+ t && (r ? io(r) && (o = Co(r)) : o = Co(e));
3358
+ let s = Eo(a, n, r) ? To(a) : _a(0), c = (i.left + s.x) / o.x, l = (i.top + s.y) / o.y, u = i.width / o.x, d = i.height / o.y;
3358
3359
  if (a) {
3359
- let e = Z(a), t = r && ao(r) ? Z(r) : r, n = e, i = xo(n);
3360
+ let e = Z(a), t = r && io(r) ? Z(r) : r, n = e, i = bo(n);
3360
3361
  for (; i && r && t !== n;) {
3361
- let e = wo(i), t = i.getBoundingClientRect(), r = go(i), a = t.left + (i.clientLeft + parseFloat(r.paddingLeft)) * e.x, o = t.top + (i.clientTop + parseFloat(r.paddingTop)) * e.y;
3362
- c *= e.x, l *= e.y, u *= e.x, d *= e.y, c += a, l += o, n = Z(i), i = xo(n);
3362
+ let e = Co(i), t = i.getBoundingClientRect(), r = ho(i), a = t.left + (i.clientLeft + parseFloat(r.paddingLeft)) * e.x, o = t.top + (i.clientTop + parseFloat(r.paddingTop)) * e.y;
3363
+ c *= e.x, l *= e.y, u *= e.x, d *= e.y, c += a, l += o, n = Z(i), i = bo(n);
3363
3364
  }
3364
3365
  }
3365
- return La({
3366
+ return Ia({
3366
3367
  width: u,
3367
3368
  height: d,
3368
3369
  x: c,
3369
3370
  y: l
3370
3371
  });
3371
3372
  }
3372
- function ko(e, t) {
3373
- let n = _o(e).scrollLeft;
3374
- return t ? t.left + n : Oo(ro(e)).left + n;
3373
+ function Oo(e, t) {
3374
+ let n = go(e).scrollLeft;
3375
+ return t ? t.left + n : Do(no(e)).left + n;
3375
3376
  }
3376
- function Ao(e, t, n) {
3377
+ function ko(e, t, n) {
3377
3378
  n === void 0 && (n = !1);
3378
3379
  let r = e.getBoundingClientRect();
3379
3380
  return {
3380
- x: r.left + t.scrollLeft - (n ? 0 : ko(e, r)),
3381
+ x: r.left + t.scrollLeft - (n ? 0 : Oo(e, r)),
3381
3382
  y: r.top + t.scrollTop
3382
3383
  };
3383
3384
  }
3384
- function jo(e) {
3385
- let { elements: t, rect: n, offsetParent: r, strategy: i } = e, a = i === "fixed", o = ro(r), s = t ? uo(t.floating) : !1;
3385
+ function Ao(e) {
3386
+ let { elements: t, rect: n, offsetParent: r, strategy: i } = e, a = i === "fixed", o = no(r), s = t ? lo(t.floating) : !1;
3386
3387
  if (r === o || s && a) return n;
3387
3388
  let c = {
3388
3389
  scrollLeft: 0,
3389
3390
  scrollTop: 0
3390
- }, l = va(1), u = va(0), d = oo(r);
3391
- if ((d || !d && !a) && ((no(r) !== "body" || co(o)) && (c = _o(r)), oo(r))) {
3392
- let e = Oo(r);
3393
- l = wo(r), u.x = e.x + r.clientLeft, u.y = e.y + r.clientTop;
3391
+ }, l = _a(1), u = _a(0), d = ao(r);
3392
+ if ((d || !d && !a) && ((to(r) !== "body" || so(o)) && (c = go(r)), ao(r))) {
3393
+ let e = Do(r);
3394
+ l = Co(r), u.x = e.x + r.clientLeft, u.y = e.y + r.clientTop;
3394
3395
  }
3395
- let f = o && !d && !a ? Ao(o, c, !0) : va(0);
3396
+ let f = o && !d && !a ? ko(o, c, !0) : _a(0);
3396
3397
  return {
3397
3398
  width: n.width * l.x,
3398
3399
  height: n.height * l.y,
@@ -3400,23 +3401,23 @@ function jo(e) {
3400
3401
  y: n.y * l.y - c.scrollTop * l.y + u.y + f.y
3401
3402
  };
3402
3403
  }
3403
- function Mo(e) {
3404
+ function jo(e) {
3404
3405
  return Array.from(e.getClientRects());
3405
3406
  }
3406
- function No(e) {
3407
- let t = ro(e), n = _o(e), r = e.ownerDocument.body, i = X(t.scrollWidth, t.clientWidth, r.scrollWidth, r.clientWidth), a = X(t.scrollHeight, t.clientHeight, r.scrollHeight, r.clientHeight), o = -n.scrollLeft + ko(e), s = -n.scrollTop;
3408
- return go(r).direction === "rtl" && (o += X(t.clientWidth, r.clientWidth) - i), {
3407
+ function Mo(e) {
3408
+ let t = no(e), n = go(e), r = e.ownerDocument.body, i = X(t.scrollWidth, t.clientWidth, r.scrollWidth, r.clientWidth), a = X(t.scrollHeight, t.clientHeight, r.scrollHeight, r.clientHeight), o = -n.scrollLeft + Oo(e), s = -n.scrollTop;
3409
+ return ho(r).direction === "rtl" && (o += X(t.clientWidth, r.clientWidth) - i), {
3409
3410
  width: i,
3410
3411
  height: a,
3411
3412
  x: o,
3412
3413
  y: s
3413
3414
  };
3414
3415
  }
3415
- function Po(e, t) {
3416
- let n = Z(e), r = ro(e), i = n.visualViewport, a = r.clientWidth, o = r.clientHeight, s = 0, c = 0;
3416
+ function No(e, t) {
3417
+ let n = Z(e), r = no(e), i = n.visualViewport, a = r.clientWidth, o = r.clientHeight, s = 0, c = 0;
3417
3418
  if (i) {
3418
3419
  a = i.width, o = i.height;
3419
- let e = mo();
3420
+ let e = po();
3420
3421
  (!e || e && t === "fixed") && (s = i.offsetLeft, c = i.offsetTop);
3421
3422
  }
3422
3423
  return {
@@ -3426,8 +3427,8 @@ function Po(e, t) {
3426
3427
  y: c
3427
3428
  };
3428
3429
  }
3429
- function Fo(e, t) {
3430
- let n = Oo(e, !0, t === "fixed"), r = n.top + e.clientTop, i = n.left + e.clientLeft, a = oo(e) ? wo(e) : va(1);
3430
+ function Po(e, t) {
3431
+ let n = Do(e, !0, t === "fixed"), r = n.top + e.clientTop, i = n.left + e.clientLeft, a = ao(e) ? Co(e) : _a(1);
3431
3432
  return {
3432
3433
  width: e.clientWidth * a.x,
3433
3434
  height: e.clientHeight * a.y,
@@ -3435,13 +3436,13 @@ function Fo(e, t) {
3435
3436
  y: r * a.y
3436
3437
  };
3437
3438
  }
3438
- function Io(e, t, n) {
3439
+ function Fo(e, t, n) {
3439
3440
  let r;
3440
- if (t === "viewport") r = Po(e, n);
3441
- else if (t === "document") r = No(ro(e));
3442
- else if (ao(t)) r = Fo(t, n);
3441
+ if (t === "viewport") r = No(e, n);
3442
+ else if (t === "document") r = Mo(no(e));
3443
+ else if (io(t)) r = Po(t, n);
3443
3444
  else {
3444
- let n = Eo(e);
3445
+ let n = To(e);
3445
3446
  r = {
3446
3447
  x: t.x - n.x,
3447
3448
  y: t.y - n.y,
@@ -3449,27 +3450,27 @@ function Io(e, t, n) {
3449
3450
  height: t.height
3450
3451
  };
3451
3452
  }
3452
- return La(r);
3453
+ return Ia(r);
3453
3454
  }
3454
- function Lo(e, t) {
3455
- let n = vo(e);
3456
- return n === t || !ao(n) || ho(n) ? !1 : go(n).position === "fixed" || Lo(n, t);
3455
+ function Io(e, t) {
3456
+ let n = _o(e);
3457
+ return n === t || !io(n) || mo(n) ? !1 : ho(n).position === "fixed" || Io(n, t);
3457
3458
  }
3458
- function Ro(e, t) {
3459
+ function Lo(e, t) {
3459
3460
  let n = t.get(e);
3460
3461
  if (n) return n;
3461
- let r = bo(e, [], !1).filter((e) => ao(e) && no(e) !== "body"), i = null, a = go(e).position === "fixed", o = a ? vo(e) : e;
3462
- for (; ao(o) && !ho(o);) {
3463
- let t = go(o), n = fo(o);
3464
- !n && t.position === "fixed" && (i = null), (a ? !n && !i : !n && t.position === "static" && i && ["absolute", "fixed"].includes(i.position) || co(o) && !n && Lo(e, o)) ? r = r.filter((e) => e !== o) : i = t, o = vo(o);
3462
+ let r = yo(e, [], !1).filter((e) => io(e) && to(e) !== "body"), i = null, a = ho(e).position === "fixed", o = a ? _o(e) : e;
3463
+ for (; io(o) && !mo(o);) {
3464
+ let t = ho(o), n = uo(o);
3465
+ !n && t.position === "fixed" && (i = null), (a ? !n && !i : !n && t.position === "static" && i && ["absolute", "fixed"].includes(i.position) || so(o) && !n && Io(e, o)) ? r = r.filter((e) => e !== o) : i = t, o = _o(o);
3465
3466
  }
3466
3467
  return t.set(e, r), r;
3467
3468
  }
3468
- function zo(e) {
3469
- let { element: t, boundary: n, rootBoundary: r, strategy: i } = e, a = [...n === "clippingAncestors" ? uo(t) ? [] : Ro(t, this._c) : [].concat(n), r], o = a[0], s = a.reduce((e, n) => {
3470
- let r = Io(t, n, i);
3471
- return e.top = X(r.top, e.top), e.right = ga(r.right, e.right), e.bottom = ga(r.bottom, e.bottom), e.left = X(r.left, e.left), e;
3472
- }, Io(t, o, i));
3469
+ function Ro(e) {
3470
+ let { element: t, boundary: n, rootBoundary: r, strategy: i } = e, a = [...n === "clippingAncestors" ? lo(t) ? [] : Lo(t, this._c) : [].concat(n), r], o = a[0], s = a.reduce((e, n) => {
3471
+ let r = Fo(t, n, i);
3472
+ return e.top = X(r.top, e.top), e.right = ha(r.right, e.right), e.bottom = ha(r.bottom, e.bottom), e.left = X(r.left, e.left), e;
3473
+ }, Fo(t, o, i));
3473
3474
  return {
3474
3475
  width: s.right - s.left,
3475
3476
  height: s.bottom - s.top,
@@ -3477,23 +3478,23 @@ function zo(e) {
3477
3478
  y: s.top
3478
3479
  };
3479
3480
  }
3480
- function Bo(e) {
3481
- let { width: t, height: n } = So(e);
3481
+ function zo(e) {
3482
+ let { width: t, height: n } = xo(e);
3482
3483
  return {
3483
3484
  width: t,
3484
3485
  height: n
3485
3486
  };
3486
3487
  }
3487
- function Vo(e, t, n) {
3488
- let r = oo(t), i = ro(t), a = n === "fixed", o = Oo(e, !0, a, t), s = {
3488
+ function Bo(e, t, n) {
3489
+ let r = ao(t), i = no(t), a = n === "fixed", o = Do(e, !0, a, t), s = {
3489
3490
  scrollLeft: 0,
3490
3491
  scrollTop: 0
3491
- }, c = va(0);
3492
- if (r || !r && !a) if ((no(t) !== "body" || co(i)) && (s = _o(t)), r) {
3493
- let e = Oo(t, !0, a, t);
3492
+ }, c = _a(0);
3493
+ if (r || !r && !a) if ((to(t) !== "body" || so(i)) && (s = go(t)), r) {
3494
+ let e = Do(t, !0, a, t);
3494
3495
  c.x = e.x + t.clientLeft, c.y = e.y + t.clientTop;
3495
- } else i && (c.x = ko(i));
3496
- let l = i && !r && !a ? Ao(i, s) : va(0);
3496
+ } else i && (c.x = Oo(i));
3497
+ let l = i && !r && !a ? ko(i, s) : _a(0);
3497
3498
  return {
3498
3499
  x: o.left + s.scrollLeft - c.x - l.x,
3499
3500
  y: o.top + s.scrollTop - c.y - l.y,
@@ -3501,34 +3502,34 @@ function Vo(e, t, n) {
3501
3502
  height: o.height
3502
3503
  };
3503
3504
  }
3504
- function Ho(e) {
3505
- return go(e).position === "static";
3505
+ function Vo(e) {
3506
+ return ho(e).position === "static";
3506
3507
  }
3507
- function Uo(e, t) {
3508
- if (!oo(e) || go(e).position === "fixed") return null;
3508
+ function Ho(e, t) {
3509
+ if (!ao(e) || ho(e).position === "fixed") return null;
3509
3510
  if (t) return t(e);
3510
3511
  let n = e.offsetParent;
3511
- return ro(e) === n && (n = n.ownerDocument.body), n;
3512
+ return no(e) === n && (n = n.ownerDocument.body), n;
3512
3513
  }
3513
- function Wo(e, t) {
3514
+ function Uo(e, t) {
3514
3515
  let n = Z(e);
3515
- if (uo(e)) return n;
3516
- if (!oo(e)) {
3517
- let t = vo(e);
3518
- for (; t && !ho(t);) {
3519
- if (ao(t) && !Ho(t)) return t;
3520
- t = vo(t);
3516
+ if (lo(e)) return n;
3517
+ if (!ao(e)) {
3518
+ let t = _o(e);
3519
+ for (; t && !mo(t);) {
3520
+ if (io(t) && !Vo(t)) return t;
3521
+ t = _o(t);
3521
3522
  }
3522
3523
  return n;
3523
3524
  }
3524
- let r = Uo(e, t);
3525
- for (; r && lo(r) && Ho(r);) r = Uo(r, t);
3526
- return r && ho(r) && Ho(r) && !fo(r) ? n : r || po(e) || n;
3525
+ let r = Ho(e, t);
3526
+ for (; r && co(r) && Vo(r);) r = Ho(r, t);
3527
+ return r && mo(r) && Vo(r) && !uo(r) ? n : r || fo(e) || n;
3527
3528
  }
3528
- var Go = async function(e) {
3529
- let t = this.getOffsetParent || Wo, n = this.getDimensions, r = await n(e.floating);
3529
+ var Wo = async function(e) {
3530
+ let t = this.getOffsetParent || Uo, n = this.getDimensions, r = await n(e.floating);
3530
3531
  return {
3531
- reference: Vo(e.reference, await t(e.floating), e.strategy),
3532
+ reference: Bo(e.reference, await t(e.floating), e.strategy),
3532
3533
  floating: {
3533
3534
  x: 0,
3534
3535
  y: 0,
@@ -3537,38 +3538,38 @@ var Go = async function(e) {
3537
3538
  }
3538
3539
  };
3539
3540
  };
3540
- function Ko(e) {
3541
- return go(e).direction === "rtl";
3541
+ function Go(e) {
3542
+ return ho(e).direction === "rtl";
3542
3543
  }
3543
- var qo = {
3544
- convertOffsetParentRelativeRectToViewportRelativeRect: jo,
3545
- getDocumentElement: ro,
3546
- getClippingRect: zo,
3547
- getOffsetParent: Wo,
3548
- getElementRects: Go,
3549
- getClientRects: Mo,
3550
- getDimensions: Bo,
3551
- getScale: wo,
3552
- isElement: ao,
3553
- isRTL: Ko
3554
- }, Jo = Qa, Yo = Ua, Xo = $a, Zo = Wa, Qo = eo, $o = qa, es = Va, ts = Xa, ns = (e, t, n) => {
3544
+ var Ko = {
3545
+ convertOffsetParentRelativeRectToViewportRelativeRect: Ao,
3546
+ getDocumentElement: no,
3547
+ getClippingRect: Ro,
3548
+ getOffsetParent: Uo,
3549
+ getElementRects: Wo,
3550
+ getClientRects: jo,
3551
+ getDimensions: zo,
3552
+ getScale: Co,
3553
+ isElement: io,
3554
+ isRTL: Go
3555
+ }, qo = Za, Jo = Ha, Yo = Qa, Xo = Ua, Zo = $a, Qo = Ka, $o = Ba, es = Ya, ts = (e, t, n) => {
3555
3556
  let r = /* @__PURE__ */ new Map(), i = {
3556
- platform: qo,
3557
+ platform: Ko,
3557
3558
  ...n
3558
3559
  }, a = {
3559
3560
  ...i.platform,
3560
3561
  _c: r
3561
3562
  };
3562
- return za(e, t, {
3563
+ return Ra(e, t, {
3563
3564
  ...i,
3564
3565
  platform: a
3565
3566
  });
3566
3567
  };
3567
- function rs(e, t) {
3568
+ function ns(e, t) {
3568
3569
  let n = Math.min(e.top, t.top), r = Math.max(e.bottom, t.bottom), i = Math.min(e.left, t.left), a = Math.max(e.right, t.right) - i, o = r - n;
3569
3570
  return new DOMRect(i, n, a, o);
3570
3571
  }
3571
- var is = class {
3572
+ var rs = class {
3572
3573
  constructor({ editor: e, element: t, view: n, pluginKey: r = "bubbleMenu", updateDelay: i = 250, resizeDelay: a = 60, shouldShow: o, appendTo: s, getReferencedVirtualElement: c, options: l }) {
3573
3574
  this.preventHide = !1, this.isVisible = !1, this.scrollTarget = window, this.floatingUIOptions = {
3574
3575
  strategy: "absolute",
@@ -3632,7 +3633,7 @@ var is = class {
3632
3633
  }
3633
3634
  get middlewares() {
3634
3635
  let e = [];
3635
- return this.floatingUIOptions.flip && e.push(Zo(typeof this.floatingUIOptions.flip == "boolean" ? void 0 : this.floatingUIOptions.flip)), this.floatingUIOptions.shift && e.push(Xo(typeof this.floatingUIOptions.shift == "boolean" ? void 0 : this.floatingUIOptions.shift)), this.floatingUIOptions.offset && e.push(Jo(typeof this.floatingUIOptions.offset == "boolean" ? void 0 : this.floatingUIOptions.offset)), this.floatingUIOptions.arrow && e.push(es(this.floatingUIOptions.arrow)), this.floatingUIOptions.size && e.push(Qo(typeof this.floatingUIOptions.size == "boolean" ? void 0 : this.floatingUIOptions.size)), this.floatingUIOptions.autoPlacement && e.push(Yo(typeof this.floatingUIOptions.autoPlacement == "boolean" ? void 0 : this.floatingUIOptions.autoPlacement)), this.floatingUIOptions.hide && e.push($o(typeof this.floatingUIOptions.hide == "boolean" ? void 0 : this.floatingUIOptions.hide)), this.floatingUIOptions.inline && e.push(ts(typeof this.floatingUIOptions.inline == "boolean" ? void 0 : this.floatingUIOptions.inline)), e;
3636
+ return this.floatingUIOptions.flip && e.push(Xo(typeof this.floatingUIOptions.flip == "boolean" ? void 0 : this.floatingUIOptions.flip)), this.floatingUIOptions.shift && e.push(Yo(typeof this.floatingUIOptions.shift == "boolean" ? void 0 : this.floatingUIOptions.shift)), this.floatingUIOptions.offset && e.push(qo(typeof this.floatingUIOptions.offset == "boolean" ? void 0 : this.floatingUIOptions.offset)), this.floatingUIOptions.arrow && e.push($o(this.floatingUIOptions.arrow)), this.floatingUIOptions.size && e.push(Zo(typeof this.floatingUIOptions.size == "boolean" ? void 0 : this.floatingUIOptions.size)), this.floatingUIOptions.autoPlacement && e.push(Jo(typeof this.floatingUIOptions.autoPlacement == "boolean" ? void 0 : this.floatingUIOptions.autoPlacement)), this.floatingUIOptions.hide && e.push(Qo(typeof this.floatingUIOptions.hide == "boolean" ? void 0 : this.floatingUIOptions.hide)), this.floatingUIOptions.inline && e.push(es(typeof this.floatingUIOptions.inline == "boolean" ? void 0 : this.floatingUIOptions.inline)), e;
3636
3637
  }
3637
3638
  get virtualElement() {
3638
3639
  let { selection: e } = this.editor.state, t = this.getReferencedVirtualElement?.call(this);
@@ -3652,7 +3653,7 @@ var is = class {
3652
3653
  if (e instanceof ce) {
3653
3654
  let { $anchorCell: t, $headCell: n } = e, i = t ? t.pos : n.pos, a = n ? n.pos : t.pos, o = this.view.nodeDOM(i), s = this.view.nodeDOM(a);
3654
3655
  if (!o || !s) return;
3655
- let c = o === s ? o.getBoundingClientRect() : rs(o.getBoundingClientRect(), s.getBoundingClientRect());
3656
+ let c = o === s ? o.getBoundingClientRect() : ns(o.getBoundingClientRect(), s.getBoundingClientRect());
3656
3657
  r = {
3657
3658
  getBoundingClientRect: () => c,
3658
3659
  getClientRects: () => [c]
@@ -3663,7 +3664,7 @@ var is = class {
3663
3664
  updatePosition() {
3664
3665
  if (!this.isVisible) return;
3665
3666
  let e = this.virtualElement;
3666
- e && ns(e, this.element, {
3667
+ e && ts(e, this.element, {
3667
3668
  placement: this.floatingUIOptions.placement,
3668
3669
  strategy: this.floatingUIOptions.strategy,
3669
3670
  middleware: this.middlewares
@@ -3717,13 +3718,13 @@ var is = class {
3717
3718
  destroy() {
3718
3719
  this.hide(), this.element.removeEventListener("mousedown", this.mousedownHandler, { capture: !0 }), this.view.dom.removeEventListener("dragstart", this.dragstartHandler), window.removeEventListener("resize", this.resizeHandler), this.scrollTarget.removeEventListener("scroll", this.resizeHandler), this.editor.off("focus", this.focusHandler), this.editor.off("blur", this.blurHandler), this.editor.off("transaction", this.transactionHandler), this.floatingUIOptions.onDestroy && this.floatingUIOptions.onDestroy();
3719
3720
  }
3720
- }, as = (e) => new oe({
3721
+ }, is = (e) => new oe({
3721
3722
  key: typeof e.pluginKey == "string" ? new se(e.pluginKey) : e.pluginKey,
3722
- view: (t) => new is({
3723
+ view: (t) => new rs({
3723
3724
  view: t,
3724
3725
  ...e
3725
3726
  })
3726
- }), os = {
3727
+ }), as = {
3727
3728
  name: "BubbleMenu",
3728
3729
  inheritAttrs: !1,
3729
3730
  props: {
@@ -3753,7 +3754,7 @@ var is = class {
3753
3754
  mounted() {
3754
3755
  let e = this.editor, t = this.$el;
3755
3756
  !e || !t || (t.style.visibility = "hidden", t.style.position = "absolute", t.remove(), this.$nextTick(() => {
3756
- e.registerPlugin(as({
3757
+ e.registerPlugin(is({
3757
3758
  updateDelay: this.updateDelay,
3758
3759
  resizeDelay: this.resizeDelay,
3759
3760
  options: this.options,
@@ -3781,7 +3782,7 @@ var is = class {
3781
3782
  methods: { getPluginKey() {
3782
3783
  return this.generatedPluginKey ||= this.pluginKey ?? new se("bubbleMenu"), this.generatedPluginKey;
3783
3784
  } }
3784
- }, ss = {
3785
+ }, os = {
3785
3786
  active: !1,
3786
3787
  mode: "outside",
3787
3788
  activeCellPos: null,
@@ -3789,17 +3790,17 @@ var is = class {
3789
3790
  selectedCellCount: 0,
3790
3791
  selectionFrom: 0,
3791
3792
  selectionTo: 0
3792
- }, cs = {
3793
+ }, ss = {
3793
3794
  active: !1,
3794
- language: ft.defaultLanguage,
3795
+ language: dt.defaultLanguage,
3795
3796
  mermaidPreviewMode: "code",
3796
3797
  pos: null,
3797
3798
  text: ""
3798
3799
  };
3799
- function ls(e) {
3800
- return Nn.getState(e.state) ?? Mn;
3800
+ function cs(e) {
3801
+ return Mn.getState(e.state) ?? jn;
3801
3802
  }
3802
- function us(e) {
3803
+ function ls(e) {
3803
3804
  if (!e || typeof window > "u") return null;
3804
3805
  let t = e.parentElement;
3805
3806
  for (; t;) {
@@ -3816,7 +3817,7 @@ function Q(e, t, n = 18, r = 1.8) {
3816
3817
  "aria-hidden": "true"
3817
3818
  }, { default: () => t });
3818
3819
  }
3819
- function ds(e) {
3820
+ function us(e) {
3820
3821
  return e === "clipboard" ? [U("path", { d: "M9 4.5h6a1.5 1.5 0 0 1 1.5 1.5v11A1.5 1.5 0 0 1 15 18.5H7A1.5 1.5 0 0 1 5.5 17V6A1.5 1.5 0 0 1 7 4.5h2" }), U("path", { d: "M8.5 5.5v-1A1.5 1.5 0 0 1 10 3h2a1.5 1.5 0 0 1 1.5 1.5v1h-5Z" })] : e === "search" ? [U("circle", {
3821
3822
  cx: "10",
3822
3823
  cy: "10",
@@ -3853,7 +3854,7 @@ function ds(e) {
3853
3854
  U("path", { d: "m14 14 4 4" })
3854
3855
  ] : e === "reset" ? [U("path", { d: "M6.5 8.5A6 6 0 1 1 6 15" }), U("path", { d: "M6.5 8.5H3.5v-3" })] : [U("path", { d: "m6 9 6 6 6-6" })];
3855
3856
  }
3856
- function fs(e) {
3857
+ function ds(e) {
3857
3858
  return U("svg", {
3858
3859
  viewBox: "0 0 24 24",
3859
3860
  "aria-hidden": "true",
@@ -3864,65 +3865,65 @@ function fs(e) {
3864
3865
  "stroke-linecap": "round",
3865
3866
  "stroke-linejoin": "round",
3866
3867
  "stroke-width": "1.8"
3867
- }, ds(e)));
3868
+ }, us(e)));
3868
3869
  }
3869
3870
  function $(e) {
3870
3871
  e.preventDefault();
3871
3872
  }
3872
- function ps(e) {
3873
- let t = Ut(e);
3873
+ function fs(e) {
3874
+ let t = Ht(e);
3874
3875
  return !t || typeof window > "u" || typeof window.open != "function" ? !1 : (window.open(t, "_blank", "noopener,noreferrer"), !0);
3875
3876
  }
3876
- var ms = {
3877
- bold: Gr,
3878
- italic: mi,
3879
- underline: Ui,
3880
- strike: Pi,
3881
- "inline-code": ei,
3882
- link: gi,
3883
- more: xi,
3884
- superscript: Ii,
3885
- subscript: Fi,
3886
- "inline-math": ki,
3887
- "align-left": kr,
3888
- "align-center": Dr,
3889
- "align-right": Ar,
3890
- "align-justify": Or,
3891
- "decrease-indent": di,
3892
- "increase-indent": fi
3893
- }, hs = {
3894
- type: Bi,
3895
- "heading-1": oi,
3896
- "heading-2": si,
3897
- "heading-3": ci,
3898
- "bullet-list": _i,
3899
- "ordered-list": yi,
3900
- "task-list": vi,
3901
- blockquote: Ei,
3902
- "code-block": Kr,
3903
- info: pi,
3904
- tip: hi,
3905
- warning: Pr,
3906
- error: $r,
3907
- success: Yr,
3908
- emoji: Ai,
3909
- math: ki,
3910
- table: Li,
3911
- separator: bi,
3912
- image: li,
3913
- video: Gi,
3914
- attachment: Ci
3877
+ var ps = {
3878
+ bold: Wr,
3879
+ italic: pi,
3880
+ underline: Hi,
3881
+ strike: Ni,
3882
+ "inline-code": $r,
3883
+ link: hi,
3884
+ more: bi,
3885
+ superscript: Fi,
3886
+ subscript: Pi,
3887
+ "inline-math": Oi,
3888
+ "align-left": Or,
3889
+ "align-center": Er,
3890
+ "align-right": kr,
3891
+ "align-justify": Dr,
3892
+ "decrease-indent": ui,
3893
+ "increase-indent": di
3894
+ }, ms = {
3895
+ type: zi,
3896
+ "heading-1": ai,
3897
+ "heading-2": oi,
3898
+ "heading-3": si,
3899
+ "bullet-list": gi,
3900
+ "ordered-list": vi,
3901
+ "task-list": _i,
3902
+ blockquote: Ti,
3903
+ "code-block": Gr,
3904
+ info: fi,
3905
+ tip: mi,
3906
+ warning: Nr,
3907
+ error: Qr,
3908
+ success: Jr,
3909
+ emoji: ki,
3910
+ math: Oi,
3911
+ table: Ii,
3912
+ separator: yi,
3913
+ image: ci,
3914
+ video: Wi,
3915
+ attachment: Si
3915
3916
  };
3916
- function gs(e) {
3917
+ function hs(e) {
3917
3918
  if (typeof e != "string") {
3918
3919
  if (e.kind === "text") return U("span", {
3919
3920
  class: "markweave-slash-command-text-icon",
3920
- "data-icon-length": ln(e),
3921
+ "data-icon-length": cn(e),
3921
3922
  "aria-hidden": "true"
3922
3923
  }, e.text);
3923
3924
  e = e.name;
3924
3925
  }
3925
- let t = hs[e];
3926
+ let t = ms[e];
3926
3927
  return U(t, {
3927
3928
  size: 18,
3928
3929
  strokeWidth: 1.6,
@@ -3930,21 +3931,21 @@ function gs(e) {
3930
3931
  "aria-hidden": "true"
3931
3932
  });
3932
3933
  }
3933
- var _s = {
3934
- paragraph: Hi,
3935
- "heading-1": oi,
3936
- "heading-2": si,
3937
- "heading-3": ci,
3938
- "bullet-list": _i,
3939
- "numbered-list": yi,
3940
- "todo-list": vi,
3941
- quote: Ei,
3942
- "code-block": Kr
3934
+ var gs = {
3935
+ paragraph: Vi,
3936
+ "heading-1": ai,
3937
+ "heading-2": oi,
3938
+ "heading-3": si,
3939
+ "bullet-list": gi,
3940
+ "numbered-list": vi,
3941
+ "todo-list": _i,
3942
+ quote: Ti,
3943
+ "code-block": Gr
3943
3944
  };
3944
- function vs(e, t) {
3945
+ function _s(e, t) {
3945
3946
  return _e(e, t).label;
3946
3947
  }
3947
- var ys = J({
3948
+ var vs = J({
3948
3949
  name: "MarkweaveVueFloatingToolbar",
3949
3950
  props: {
3950
3951
  editor: {
@@ -3969,10 +3970,10 @@ var ys = J({
3969
3970
  }
3970
3971
  },
3971
3972
  setup(e) {
3972
- let t = W(null), n = W("input"), r = W(""), i = W(""), a = W(""), o = W(""), s = Sr(null), c = Sr(null), l = W(null), u = W(null), d = "", f = G(() => e.askAi?.enabled === !0 && typeof e.askAi.handler == "function"), p = W(""), m = W(null), h = W(null), g = W("bottom"), _ = W(null), v = W(null), y = W(null), b = G(() => Ut(p.value.trim())), x = G(() => e.messages.floatingToolbar), S = G(() => xe(e.messages).map((e) => [
3973
+ let t = W(null), n = W("input"), r = W(""), i = W(""), a = W(""), o = W(""), s = xr(null), c = xr(null), l = W(null), u = W(null), d = "", f = G(() => e.askAi?.enabled === !0 && typeof e.askAi.handler == "function"), p = W(""), m = W(null), h = W(null), g = W("bottom"), _ = W(null), v = W(null), y = W(null), b = G(() => Ht(p.value.trim())), x = G(() => e.messages.floatingToolbar), S = G(() => xe(e.messages).map((e) => [
3973
3974
  e.id,
3974
3975
  e.label,
3975
- _s[e.id]
3976
+ gs[e.id]
3976
3977
  ])), C = G(() => be(e.messages).map((e) => [
3977
3978
  e.id,
3978
3979
  e.value,
@@ -3988,12 +3989,12 @@ var ys = J({
3988
3989
  }, O = (n) => {
3989
3990
  t.value = t.value === n ? null : n, n === "link" && (p.value = e.editor.getAttributes("link").href ?? "");
3990
3991
  }, k = de(() => {
3991
- Ye(e.editor, d), a.value = d;
3992
+ Je(e.editor, d), a.value = d;
3992
3993
  }), A = (n = !0) => {
3993
- c.value?.abort(), k.cancel(), d = "", c.value = null, l.value = null, n && qe(e.editor), ze(e.editor), t.value = null, n && e.editor.commands.focus();
3994
+ c.value?.abort(), k.cancel(), d = "", c.value = null, l.value = null, n && Ke(e.editor), Re(e.editor), t.value = null, n && e.editor.commands.focus();
3994
3995
  }, j = () => {
3995
3996
  if (!f.value) return;
3996
- let r = Ze(e.editor);
3997
+ let r = Xe(e.editor);
3997
3998
  r && (s.value = r, n.value = "input", a.value = "", o.value = "", i.value = "", t.value = "ask-ai", q(() => u.value?.focus()));
3998
3999
  }, M = async (t) => {
3999
4000
  if (!f.value || e.askAi?.enabled !== !0 || !s.value) return;
@@ -4002,40 +4003,40 @@ var ys = J({
4002
4003
  o.value = e.messages.askAi.emptyPrompt, n.value = "error";
4003
4004
  return;
4004
4005
  }
4005
- let p = Ve(e.editor, s.value);
4006
+ let p = Be(e.editor, s.value);
4006
4007
  if (!p) {
4007
4008
  n.value = "conflict";
4008
4009
  return;
4009
4010
  }
4010
- s.value = p, c.value?.abort(), Re(e.editor);
4011
- let m = new AbortController(), h = Be(p, u, e.lang, m.signal, void 0, Ue(e.editor)?.target);
4011
+ s.value = p, c.value?.abort(), Le(e.editor);
4012
+ let m = new AbortController(), h = ze(p, u, e.lang, m.signal, void 0, He(e.editor)?.target);
4012
4013
  c.value = m, l.value = h.id, i.value = u, k.cancel(), d = "", a.value = "", o.value = "", n.value = "generating";
4013
4014
  try {
4014
- let t = await Je(e.askAi.handler, h, (e) => {
4015
+ let t = await qe(e.askAi.handler, h, (e) => {
4015
4016
  l.value === h.id && !m.signal.aborted && (d = e, k.schedule());
4016
4017
  });
4017
4018
  if (l.value !== h.id || m.signal.aborted) return;
4018
- if (k.cancel(), d = t, !Ye(e.editor, t)) throw new Pe("invalid-output", "Ask AI output is incompatible with the selected content.");
4019
- a.value = t, r.value = "", n.value = Ue(e.editor)?.status === "target" ? "result" : "conflict";
4019
+ if (k.cancel(), d = t, !Je(e.editor, t)) throw new Ne("invalid-output", "Ask AI output is incompatible with the selected content.");
4020
+ a.value = t, r.value = "", n.value = He(e.editor)?.status === "target" ? "result" : "conflict";
4020
4021
  } catch (t) {
4021
4022
  if (l.value !== h.id) return;
4022
4023
  if (k.cancel(), m.signal.aborted) {
4023
- Re(e.editor), n.value = Ue(e.editor)?.status === "conflict" ? "conflict" : "input";
4024
+ Le(e.editor), n.value = He(e.editor)?.status === "conflict" ? "conflict" : "input";
4024
4025
  return;
4025
4026
  }
4026
- Re(e.editor), o.value = t instanceof Pe ? t.code === "empty-result" ? e.messages.askAi.emptyResult : e.messages.askAi.errorFallback : t instanceof Error && t.message ? t.message : e.messages.askAi.errorFallback, n.value = "error";
4027
+ Le(e.editor), o.value = t instanceof Ne ? t.code === "empty-result" ? e.messages.askAi.emptyResult : e.messages.askAi.errorFallback : t instanceof Error && t.message ? t.message : e.messages.askAi.errorFallback, n.value = "error";
4027
4028
  }
4028
4029
  }, N = () => {
4029
- if (!Fe(e.editor, a.value)) {
4030
- n.value = Ue(e.editor)?.status === "conflict" ? "conflict" : "error", o.value = e.messages.askAi.errorFallback;
4030
+ if (!Pe(e.editor, a.value)) {
4031
+ n.value = He(e.editor)?.status === "conflict" ? "conflict" : "error", o.value = e.messages.askAi.errorFallback;
4031
4032
  return;
4032
4033
  }
4033
- t.value = null, window.setTimeout(() => ze(e.editor), 560), e.editor.commands.focus();
4034
+ t.value = null, window.setTimeout(() => Re(e.editor), 560), e.editor.commands.focus();
4034
4035
  }, P = de(() => {
4035
4036
  let n = _.value, r = y.value, i = e.editor.view.dom.closest(".markweave-editor-frame");
4036
4037
  if (!t.value || !n || !r) return;
4037
4038
  if (t.value === "ask-ai") {
4038
- let t = We(e.editor), n = v.value?.getBoundingClientRect();
4039
+ let t = Ue(e.editor), n = v.value?.getBoundingClientRect();
4039
4040
  if (!t || !n) return;
4040
4041
  let a = {
4041
4042
  anchorRect: n,
@@ -4045,18 +4046,18 @@ var ys = J({
4045
4046
  height: window.innerHeight
4046
4047
  },
4047
4048
  frameRect: i?.getBoundingClientRect() ?? null,
4048
- surfaceRect: He(e.editor.view.dom)
4049
- }, o = Ie({
4049
+ surfaceRect: Ve(e.editor.view.dom)
4050
+ }, o = Fe({
4050
4051
  ...a,
4051
4052
  panelSize: r.getBoundingClientRect()
4052
4053
  }), s = `${o.width}px`;
4053
- r.style.width !== s && (r.style.width = s, o = Ie({
4054
+ r.style.width !== s && (r.style.width = s, o = Fe({
4054
4055
  ...a,
4055
4056
  panelSize: r.getBoundingClientRect()
4056
4057
  })), r.style.left = `${o.left}px`, r.style.top = `${o.top}px`, r.style.bottom = "auto", r.style.maxWidth = `${o.maxWidth}px`, r.style.maxHeight = `${Math.max(0, o.maxHeight)}px`, r.dataset.positioned = "true", g.value = o.placement;
4057
4058
  return;
4058
4059
  }
4059
- let a = De({
4060
+ let a = Ee({
4060
4061
  toolbarRect: n.getBoundingClientRect(),
4061
4062
  popoverSize: r.getBoundingClientRect(),
4062
4063
  viewport: {
@@ -4068,7 +4069,7 @@ var ys = J({
4068
4069
  });
4069
4070
  g.value = a.placement;
4070
4071
  }), F = () => {
4071
- let l = Ue(e.editor);
4072
+ let l = He(e.editor);
4072
4073
  if (l?.target.kind === "table" && l.status === "target" && t.value !== "ask-ai") {
4073
4074
  s.value = l.selection, n.value = "input", r.value = "", a.value = "", o.value = "", i.value = "", t.value = "ask-ai", q(() => u.value?.focus());
4074
4075
  return;
@@ -4092,10 +4093,10 @@ var ys = J({
4092
4093
  o.value
4093
4094
  ], ([e]) => {
4094
4095
  e && q(P.schedule);
4095
- }), Cr(() => {
4096
+ }), Sr(() => {
4096
4097
  window.addEventListener("resize", P.schedule), window.addEventListener("scroll", P.schedule, !0), e.editor.on("transaction", F), document.addEventListener("pointerdown", ee, !0), document.addEventListener("keydown", I, !0);
4097
- }), wr(() => {
4098
- P.cancel(), k.cancel(), window.removeEventListener("resize", P.schedule), window.removeEventListener("scroll", P.schedule, !0), e.editor.off("transaction", F), document.removeEventListener("pointerdown", ee, !0), document.removeEventListener("keydown", I, !0), c.value?.abort(), ze(e.editor);
4098
+ }), Cr(() => {
4099
+ P.cancel(), k.cancel(), window.removeEventListener("resize", P.schedule), window.removeEventListener("scroll", P.schedule, !0), e.editor.off("transaction", F), document.removeEventListener("pointerdown", ee, !0), document.removeEventListener("keydown", I, !0), c.value?.abort(), Re(e.editor);
4099
4100
  });
4100
4101
  let L = (n) => n === "block-type" || n === "color" || n === "more" ? t.value === n : n === "bold" ? e.editor.isActive("bold") : n === "italic" ? e.editor.isActive("italic") : n === "underline" ? e.editor.isActive("underline") : n === "strike" ? e.editor.isActive("strike") : n === "inline-code" ? e.editor.isActive("code") : n === "link" ? e.editor.isActive("link") : !1, R = (e, t) => {
4101
4102
  if (m.value = e, !e || !(t instanceof HTMLElement) || !v.value) {
@@ -4136,7 +4137,7 @@ var ys = J({
4136
4137
  onMouseenter: (e) => R(n, e.currentTarget),
4137
4138
  onMouseleave: () => R(null),
4138
4139
  onClick: a
4139
- }, n === "ask-ai" ? [U("span", { class: "markweave-floating-toolbar-button-inner" }, [Q(i, r), U("span", null, s ?? r)])] : n === "block-type" ? [U("span", { class: "markweave-floating-toolbar-button-inner" }, [U("span", { class: "markweave-floating-toolbar-block-label" }, vs(e.editor, e.messages)), Q(t.value === "block-type" ? Qr : Xr, r)])] : n === "color" ? [U("span", { class: "markweave-floating-toolbar-button-inner markweave-floating-toolbar-button-inner--color" }, [U("span", { class: "markweave-floating-toolbar-color-trigger" }, "A"), Q(t.value === "color" ? Qr : Xr, r)])] : [Q(i, r)]), B = () => U("span", {
4140
+ }, n === "ask-ai" ? [U("span", { class: "markweave-floating-toolbar-button-inner" }, [Q(i, r), U("span", null, s ?? r)])] : n === "block-type" ? [U("span", { class: "markweave-floating-toolbar-button-inner" }, [U("span", { class: "markweave-floating-toolbar-block-label" }, _s(e.editor, e.messages)), Q(t.value === "block-type" ? Zr : Yr, r)])] : n === "color" ? [U("span", { class: "markweave-floating-toolbar-button-inner markweave-floating-toolbar-button-inner--color" }, [U("span", { class: "markweave-floating-toolbar-color-trigger" }, "A"), Q(t.value === "color" ? Zr : Yr, r)])] : [Q(i, r)]), B = () => U("span", {
4140
4141
  class: "markweave-floating-toolbar-divider",
4141
4142
  "aria-hidden": "true"
4142
4143
  }), V = (n, r, i) => U("section", {
@@ -4190,7 +4191,7 @@ var ys = J({
4190
4191
  onClick: () => {
4191
4192
  M();
4192
4193
  }
4193
- }, [Q(zr, e.messages.askAi.send)])]) : null;
4194
+ }, [Q(Rr, e.messages.askAi.send)])]) : null;
4194
4195
  return U("section", {
4195
4196
  ref: y,
4196
4197
  class: "markweave-floating-toolbar-popover markweave-ask-ai-popover",
@@ -4206,7 +4207,7 @@ var ys = J({
4206
4207
  U("span", {
4207
4208
  class: "markweave-ask-ai-sparkles",
4208
4209
  "aria-hidden": "true"
4209
- }, [Q(ji, "")]),
4210
+ }, [Q(Ai, "")]),
4210
4211
  U("span", { class: "markweave-ask-ai-progress-label" }, a.value ? e.messages.askAi.streaming : e.messages.askAi.generating),
4211
4212
  U("button", {
4212
4213
  type: "button",
@@ -4214,17 +4215,17 @@ var ys = J({
4214
4215
  "aria-label": e.messages.askAi.stop,
4215
4216
  onMousedown: $,
4216
4217
  onClick: () => {
4217
- c.value?.abort(), k.cancel(), Re(e.editor), n.value = "input";
4218
+ c.value?.abort(), k.cancel(), Le(e.editor), n.value = "input";
4218
4219
  }
4219
- }, [Q(Mi, e.messages.askAi.stop)])
4220
+ }, [Q(ji, e.messages.askAi.stop)])
4220
4221
  ]) : null,
4221
4222
  n.value === "result" ? U("div", { class: "markweave-ask-ai-action-bar" }, [
4222
4223
  t(e.messages.askAi.retry, () => {
4223
4224
  M(i.value);
4224
- }, "markweave-ask-ai-retry", Oi),
4225
+ }, "markweave-ask-ai-retry", Di),
4225
4226
  U("span", { class: "markweave-ask-ai-action-spacer" }),
4226
- t(e.messages.askAi.discard, () => A(!0), "markweave-ask-ai-discard", Ki),
4227
- t(e.messages.askAi.accept, N, "markweave-ask-ai-accept", Jr)
4227
+ t(e.messages.askAi.discard, () => A(!0), "markweave-ask-ai-discard", Gi),
4228
+ t(e.messages.askAi.accept, N, "markweave-ask-ai-accept", qr)
4228
4229
  ]) : null,
4229
4230
  n.value === "error" || n.value === "conflict" ? U("div", {
4230
4231
  class: "markweave-ask-ai-error",
@@ -4232,9 +4233,9 @@ var ys = J({
4232
4233
  }, [n.value === "conflict" ? e.messages.askAi.conflict : o.value || e.messages.askAi.errorFallback, U("div", { class: "markweave-ask-ai-action-bar" }, [
4233
4234
  n.value === "error" ? t(e.messages.askAi.retry, () => {
4234
4235
  M(i.value);
4235
- }, "markweave-ask-ai-retry", Oi) : null,
4236
+ }, "markweave-ask-ai-retry", Di) : null,
4236
4237
  U("span", { class: "markweave-ask-ai-action-spacer" }),
4237
- t(e.messages.askAi.discard, () => A(!0), "markweave-ask-ai-discard", Ki)
4238
+ t(e.messages.askAi.discard, () => A(!0), "markweave-ask-ai-discard", Gi)
4238
4239
  ])]) : null
4239
4240
  ]);
4240
4241
  }
@@ -4272,7 +4273,7 @@ var ys = J({
4272
4273
  "aria-label": x.value.applyLink,
4273
4274
  "data-testid": "markweave-floating-toolbar-link-apply",
4274
4275
  onMousedown: $
4275
- }, [Q(ti, x.value.applyLink)]),
4276
+ }, [Q(ei, x.value.applyLink)]),
4276
4277
  U("span", {
4277
4278
  class: "markweave-floating-toolbar-link-divider",
4278
4279
  "aria-hidden": "true"
@@ -4283,15 +4284,15 @@ var ys = J({
4283
4284
  "aria-label": x.value.openLink,
4284
4285
  "data-testid": "markweave-floating-toolbar-link-open",
4285
4286
  onMousedown: $,
4286
- onClick: () => ps(p.value)
4287
- }, [Q(ai, x.value.openLink)]),
4287
+ onClick: () => fs(p.value)
4288
+ }, [Q(ii, x.value.openLink)]),
4288
4289
  U("button", {
4289
4290
  type: "button",
4290
4291
  "aria-label": x.value.removeLink,
4291
4292
  "data-testid": "markweave-floating-toolbar-link-remove",
4292
4293
  onMousedown: $,
4293
4294
  onClick: D
4294
- }, [Q(Vi, x.value.removeLink)])
4295
+ }, [Q(Bi, x.value.removeLink)])
4295
4296
  ])]) : t.value === "color" ? U("div", {
4296
4297
  ref: y,
4297
4298
  class: "markweave-floating-toolbar-popover markweave-floating-toolbar-color-popover",
@@ -4318,23 +4319,23 @@ var ys = J({
4318
4319
  onClick: () => {
4319
4320
  Se(e.editor, n), t.value = null;
4320
4321
  }
4321
- }, [Q(ms[n], x.value.moreActions[n])]), m.value === n ? U("div", {
4322
+ }, [Q(ps[n], x.value.moreActions[n])]), m.value === n ? U("div", {
4322
4323
  class: "markweave-floating-toolbar-tooltip markweave-floating-toolbar-tooltip--more",
4323
4324
  role: "tooltip"
4324
4325
  }, x.value.moreActions[n]) : null]))) : null;
4325
4326
  };
4326
- return () => U(os, {
4327
+ return () => U(as, {
4327
4328
  editor: e.editor,
4328
4329
  shouldShow: ({ editor: e }) => {
4329
- let t = Ue(e);
4330
- return Ae(Oe(e), {
4330
+ let t = He(e);
4331
+ return ke(De(e), {
4331
4332
  editable: e.isEditable,
4332
- hasAskAiPreview: Ge(e.state),
4333
+ hasAskAiPreview: We(e.state),
4333
4334
  hasActiveAskAiTableTarget: t?.target.kind === "table" && t.status === "target"
4334
4335
  });
4335
4336
  },
4336
4337
  getReferencedVirtualElement: () => {
4337
- let t = Ue(e.editor)?.target.kind === "table" ? We(e.editor) : null;
4338
+ let t = He(e.editor)?.target.kind === "table" ? Ue(e.editor) : null;
4338
4339
  return t ? {
4339
4340
  getBoundingClientRect: () => new DOMRect(t.left, t.top, t.width, t.height),
4340
4341
  getClientRects: () => [new DOMRect(t.left, t.top, t.width, t.height)]
@@ -4352,25 +4353,25 @@ var ys = J({
4352
4353
  class: "markweave-floating-toolbar-content",
4353
4354
  "data-menu": t.value ?? "none"
4354
4355
  }, [
4355
- f.value && Ke(e.editor) ? z("ask-ai", x.value.buttons["ask-ai"], ji, j, t.value === "ask-ai", x.value.buttons["ask-ai"]) : null,
4356
- f.value && Ke(e.editor) ? B() : null,
4357
- z("block-type", x.value.buttons["block-type"], Hi, () => O("block-type"), t.value === "block-type"),
4356
+ f.value && Ge(e.editor) ? z("ask-ai", x.value.buttons["ask-ai"], Ai, j, t.value === "ask-ai", x.value.buttons["ask-ai"]) : null,
4357
+ f.value && Ge(e.editor) ? B() : null,
4358
+ z("block-type", x.value.buttons["block-type"], Vi, () => O("block-type"), t.value === "block-type"),
4358
4359
  B(),
4359
- z("bold", x.value.buttons.bold, Gr, () => e.editor.chain().focus().toggleBold().run(), e.editor.isActive("bold")),
4360
- z("italic", x.value.buttons.italic, mi, () => e.editor.chain().focus().toggleItalic().run(), e.editor.isActive("italic")),
4361
- z("underline", x.value.buttons.underline, Ui, () => e.editor.chain().focus().toggleUnderline().run(), e.editor.isActive("underline")),
4362
- z("strike", x.value.buttons.strike, Pi, () => e.editor.chain().focus().toggleStrike().run(), e.editor.isActive("strike")),
4363
- z("inline-code", x.value.buttons["inline-code"], ei, () => e.editor.chain().focus().toggleCode().run(), e.editor.isActive("code")),
4360
+ z("bold", x.value.buttons.bold, Wr, () => e.editor.chain().focus().toggleBold().run(), e.editor.isActive("bold")),
4361
+ z("italic", x.value.buttons.italic, pi, () => e.editor.chain().focus().toggleItalic().run(), e.editor.isActive("italic")),
4362
+ z("underline", x.value.buttons.underline, Hi, () => e.editor.chain().focus().toggleUnderline().run(), e.editor.isActive("underline")),
4363
+ z("strike", x.value.buttons.strike, Ni, () => e.editor.chain().focus().toggleStrike().run(), e.editor.isActive("strike")),
4364
+ z("inline-code", x.value.buttons["inline-code"], $r, () => e.editor.chain().focus().toggleCode().run(), e.editor.isActive("code")),
4364
4365
  B(),
4365
- z("link", x.value.buttons.link, gi, () => O("link"), e.editor.isActive("link")),
4366
- z("color", x.value.buttons.color, Hi, () => O("color"), t.value === "color"),
4366
+ z("link", x.value.buttons.link, hi, () => O("link"), e.editor.isActive("link")),
4367
+ z("color", x.value.buttons.color, Vi, () => O("color"), t.value === "color"),
4367
4368
  B(),
4368
- z("more", x.value.buttons.more, xi, () => O("more"), t.value === "more"),
4369
+ z("more", x.value.buttons.more, bi, () => O("more"), t.value === "more"),
4369
4370
  H(),
4370
4371
  te()
4371
4372
  ])]) });
4372
4373
  }
4373
- }), bs = J({
4374
+ }), ys = J({
4374
4375
  name: "MarkweaveVueMathEditorPopover",
4375
4376
  props: {
4376
4377
  editor: {
@@ -4391,17 +4392,17 @@ var ys = J({
4391
4392
  }
4392
4393
  },
4393
4394
  setup(e) {
4394
- let t = W(e.target.latex), n = Sr(null), r = W(null), i = W(null), a = Sr(Jt(e.editor, e.target)), o = G(() => t.value === e.target.latex && a.value ? {
4395
+ let t = W(e.target.latex), n = xr(null), r = W(null), i = W(null), a = xr(qt(e.editor, e.target)), o = G(() => t.value === e.target.latex && a.value ? {
4395
4396
  html: a.value,
4396
4397
  error: !1
4397
- } : Qt(t.value, e.target.kind, e.editor)), s = G(() => t.value.trim().length > 0), c = G(() => e.messages.math), l = G(() => qt(e.editor, e.target) ?? 1), u = () => {
4398
+ } : Zt(t.value, e.target.kind, e.editor)), s = G(() => t.value.trim().length > 0), c = G(() => e.messages.math), l = G(() => Kt(e.editor, e.target) ?? 1), u = () => {
4398
4399
  if (typeof window > "u") return;
4399
- let r = Kt(e.editor, e.target), i = e.editor.view.dom.closest(".markweave-editor-frame")?.getBoundingClientRect();
4400
+ let r = Gt(e.editor, e.target), i = e.editor.view.dom.closest(".markweave-editor-frame")?.getBoundingClientRect();
4400
4401
  if (!r || !i) {
4401
4402
  e.onClose();
4402
4403
  return;
4403
4404
  }
4404
- n.value = Gt({
4405
+ n.value = Wt({
4405
4406
  anchorRect: r,
4406
4407
  frameRect: i,
4407
4408
  kind: e.target.kind,
@@ -4410,7 +4411,7 @@ var ys = J({
4410
4411
  viewportWidth: window.innerWidth
4411
4412
  });
4412
4413
  }, d = () => {
4413
- s.value && Wt(e.editor, e.target, t.value) && e.onClose();
4414
+ s.value && Ut(e.editor, e.target, t.value) && e.onClose();
4414
4415
  }, f = (t) => {
4415
4416
  if (t.key === "Escape") {
4416
4417
  t.preventDefault(), e.onClose(), e.editor.commands.focus();
@@ -4422,13 +4423,13 @@ var ys = J({
4422
4423
  n instanceof Node && (r.value?.contains(n) || n instanceof Element && n.closest(".tiptap-mathematics-render") || e.onClose());
4423
4424
  };
4424
4425
  return K(() => [e.target.pos, e.target.latex], () => {
4425
- t.value = e.target.latex, a.value = Jt(e.editor, e.target), q(u);
4426
- }), Cr(() => {
4427
- $t(e.editor, e.target, !0), u(), q(() => {
4426
+ t.value = e.target.latex, a.value = qt(e.editor, e.target), q(u);
4427
+ }), Sr(() => {
4428
+ Qt(e.editor, e.target, !0), u(), q(() => {
4428
4429
  i.value?.focus({ preventScroll: !0 }), i.value?.select(), u();
4429
4430
  }), window.addEventListener("resize", u), window.addEventListener("scroll", u, !0), document.addEventListener("mousedown", p);
4430
- }), wr(() => {
4431
- $t(e.editor, e.target, !1), window.removeEventListener("resize", u), window.removeEventListener("scroll", u, !0), document.removeEventListener("mousedown", p);
4431
+ }), Cr(() => {
4432
+ Qt(e.editor, e.target, !1), window.removeEventListener("resize", u), window.removeEventListener("scroll", u, !0), document.removeEventListener("mousedown", p);
4432
4433
  }), () => {
4433
4434
  let a = e.target.kind === "block" ? c.value.blockTitle : c.value.inlineTitle, u = {
4434
4435
  ref: i,
@@ -4489,14 +4490,14 @@ var ys = J({
4489
4490
  }, [
4490
4491
  U("div", { class: "markweave-math-block-toolbar" }, [
4491
4492
  U("span", null, c.value.label),
4492
- Q(ei, c.value.label, 15, 1.75),
4493
+ Q($r, c.value.label, 15, 1.75),
4493
4494
  U("button", {
4494
4495
  type: "submit",
4495
4496
  title: c.value.apply,
4496
4497
  "aria-label": c.value.apply,
4497
4498
  disabled: !s.value,
4498
4499
  "data-testid": "markweave-math-editor-apply"
4499
- }, [Q(Yr, c.value.apply, 16, 2)])
4500
+ }, [Q(Jr, c.value.apply, 16, 2)])
4500
4501
  ]),
4501
4502
  U("label", {
4502
4503
  class: "markweave-math-block-source",
@@ -4519,7 +4520,7 @@ var ys = J({
4519
4520
  ]);
4520
4521
  };
4521
4522
  }
4522
- }), xs = J({
4523
+ }), bs = J({
4523
4524
  name: "MarkweaveVueSlashCommandMenu",
4524
4525
  props: {
4525
4526
  commands: {
@@ -4577,7 +4578,7 @@ var ys = J({
4577
4578
  if (e.state.name !== "keyboard-selecting" || e.inputCommand || !e.commands.length) return;
4578
4579
  await q();
4579
4580
  let t = s.value, n = t?.querySelector("[data-active=\"true\"]");
4580
- t && n && fn(t, n);
4581
+ t && n && dn(t, n);
4581
4582
  }, { flush: "post" });
4582
4583
  let l = async () => {
4583
4584
  if (e.inputCommand) {
@@ -4721,7 +4722,7 @@ var ys = J({
4721
4722
  class: "markweave-slash-group",
4722
4723
  "aria-label": t.group
4723
4724
  }, [U("div", { class: "markweave-slash-group-title" }, t.group), ...t.commands.map((t) => {
4724
- let n = e.commands.indexOf(t), r = n === e.state.activeIndex, i = un(t);
4725
+ let n = e.commands.indexOf(t), r = n === e.state.activeIndex, i = ln(t);
4725
4726
  return U("button", {
4726
4727
  key: t.id,
4727
4728
  id: `markweave-slash-command-option-${n}`,
@@ -4732,7 +4733,7 @@ var ys = J({
4732
4733
  "data-active": r,
4733
4734
  "data-disabled": t.disabled ? "true" : "false",
4734
4735
  "data-execution-kind": t.executionKind,
4735
- "data-text-icon-length": ln(t.icon) ?? void 0,
4736
+ "data-text-icon-length": cn(t.icon) ?? void 0,
4736
4737
  "data-testid": `markweave-slash-command-${t.id}`,
4737
4738
  title: t.disabledReason,
4738
4739
  onMousedown: $,
@@ -4746,7 +4747,7 @@ var ys = J({
4746
4747
  }
4747
4748
  }
4748
4749
  }, [
4749
- gs(t.icon),
4750
+ hs(t.icon),
4750
4751
  U("span", null, t.label),
4751
4752
  t.disabledReason ? U("small", null, t.disabledReason) : null
4752
4753
  ]);
@@ -4762,34 +4763,34 @@ var ys = J({
4762
4763
  }, e.errorMessage ?? "")]);
4763
4764
  };
4764
4765
  }
4765
- }), Ss = {
4766
- "ask-ai": ji,
4767
- "move-left": Lr,
4768
- "move-right": Rr,
4769
- "move-up": zr,
4770
- "move-down": Fr,
4771
- "insert-left": Wr,
4772
- "insert-right": Ur,
4773
- "insert-above": Hr,
4774
- "insert-below": Vr,
4775
- "sort-asc": Ir,
4776
- "sort-desc": Br,
4777
- color: Si,
4778
- alignment: kr,
4779
- clear: Ni,
4780
- duplicate: ni,
4781
- copy: ni,
4782
- merge: Ri,
4783
- split: zi,
4784
- delete: Vi
4785
- }, Cs = {
4786
- left: kr,
4787
- center: Dr,
4788
- right: Ar,
4789
- top: Nr,
4790
- middle: jr,
4791
- bottom: Mr
4792
- }, ws = J({
4766
+ }), xs = {
4767
+ "ask-ai": Ai,
4768
+ "move-left": Ir,
4769
+ "move-right": Lr,
4770
+ "move-up": Rr,
4771
+ "move-down": Pr,
4772
+ "insert-left": Ur,
4773
+ "insert-right": Hr,
4774
+ "insert-above": Vr,
4775
+ "insert-below": Br,
4776
+ "sort-asc": Fr,
4777
+ "sort-desc": zr,
4778
+ color: xi,
4779
+ alignment: Or,
4780
+ clear: Mi,
4781
+ duplicate: ti,
4782
+ copy: ti,
4783
+ merge: Li,
4784
+ split: Ri,
4785
+ delete: Bi
4786
+ }, Ss = {
4787
+ left: Or,
4788
+ center: Er,
4789
+ right: kr,
4790
+ top: Mr,
4791
+ middle: Ar,
4792
+ bottom: jr
4793
+ }, Cs = J({
4793
4794
  name: "MarkweaveVueTableControls",
4794
4795
  props: {
4795
4796
  editor: {
@@ -4826,12 +4827,12 @@ var ys = J({
4826
4827
  }
4827
4828
  },
4828
4829
  setup(e) {
4829
- let t = W(null), n = W(null), r = W("row-edge"), i = W(null), a = W(null), o = W(null), s = W(null), c = W(null), l = W(null), u = W(null), d = W(null), f = W(0), p = W(null), m = W(null), h = W(null), g = W(null), _ = W(null), v = W(null), y = W(null), b = null, x = null, S = null, C = G(() => e.askAi?.enabled === !0 && typeof e.askAi.handler == "function"), w = () => Dn(e.editor.state, "structure"), T = G(() => e.active ? An(e.editor.state) : ss), E = G(() => Yn(e.editor, e.interactionState, "row", T.value.activeCellPos)), D = G(() => Yn(e.editor, e.interactionState, "column", T.value.activeCellPos)), O = G(() => Gn(e.editor)), k = G(() => (O.value, T.value.active && $n(e.editor, "selection", { askAiEnabled: C.value }).length > 0)), A = G(() => t.value ? $n(e.editor, t.value, { askAiEnabled: C.value }) : []), j = () => {
4830
+ let t = W(null), n = W(null), r = W("row-edge"), i = W(null), a = W(null), o = W(null), s = W(null), c = W(null), l = W(null), u = W(null), d = W(null), f = W(0), p = W(null), m = W(null), h = W(null), g = W(null), _ = W(null), v = W(null), y = W(null), b = null, x = null, S = null, C = G(() => e.askAi?.enabled === !0 && typeof e.askAi.handler == "function"), w = () => En(e.editor.state, "structure"), T = G(() => e.active ? kn(e.editor.state) : os), E = G(() => Jn(e.editor, e.interactionState, "row", T.value.activeCellPos)), D = G(() => Jn(e.editor, e.interactionState, "column", T.value.activeCellPos)), O = G(() => Wn(e.editor)), k = G(() => (O.value, T.value.active && Qn(e.editor, "selection", { askAiEnabled: C.value }).length > 0)), A = G(() => t.value ? Qn(e.editor, t.value, { askAiEnabled: C.value }) : []), j = () => {
4830
4831
  b === null || typeof window > "u" || (window.clearTimeout(b), b = null);
4831
4832
  }, M = (e) => {
4832
4833
  j(), d.value = e, !(!e || typeof window > "u") && (b = window.setTimeout(() => {
4833
4834
  d.value = null, b = null;
4834
- }, ar));
4835
+ }, ir));
4835
4836
  }, N = () => {
4836
4837
  if (!e.active) {
4837
4838
  i.value = null, a.value = null, o.value = null, s.value = null, c.value = null, M(null);
@@ -4842,26 +4843,26 @@ var ys = J({
4842
4843
  i.value = null, a.value = null, o.value = null, s.value = null, c.value = null;
4843
4844
  return;
4844
4845
  }
4845
- let l = n.getBoundingClientRect(), u = E.value ? Jn(e.editor, E.value) : null, d = D.value ? Jn(e.editor, D.value) : null, f = k.value ? er(e.editor) : null, p = Wn(e.editor)?.getBoundingClientRect() ?? null;
4846
- u ? i.value = zn({
4846
+ let l = n.getBoundingClientRect(), u = E.value ? qn(e.editor, E.value) : null, d = D.value ? qn(e.editor, D.value) : null, f = k.value ? $n(e.editor) : null, p = Un(e.editor)?.getBoundingClientRect() ?? null;
4847
+ u ? i.value = Rn({
4847
4848
  targetRect: u,
4848
4849
  frameRect: l,
4849
4850
  kind: "row"
4850
- }) : t.value === "row" && r.value === "row-edge" || (i.value = null), d ? a.value = zn({
4851
+ }) : t.value === "row" && r.value === "row-edge" || (i.value = null), d ? a.value = Rn({
4851
4852
  targetRect: d,
4852
4853
  frameRect: l,
4853
4854
  kind: "column"
4854
- }) : t.value === "column" && r.value === "column-edge" || (a.value = null), f ? o.value = zn({
4855
+ }) : t.value === "column" && r.value === "column-edge" || (a.value = null), f ? o.value = Rn({
4855
4856
  targetRect: f,
4856
4857
  frameRect: l,
4857
4858
  kind: "selection"
4858
4859
  }) : t.value === "selection" && r.value === "selection-edge" || (o.value = null);
4859
4860
  let m = e.interactionState.hoverCellPos !== null && !!(E.value && E.value.index === E.value.visualHeight - 1), h = e.interactionState.hoverCellPos !== null && !!(D.value && D.value.index === D.value.visualWidth - 1);
4860
- s.value = p && m ? Bn({
4861
+ s.value = p && m ? zn({
4861
4862
  tableRect: p,
4862
4863
  frameRect: l,
4863
4864
  kind: "row"
4864
- }) : null, c.value = p && h ? Bn({
4865
+ }) : null, c.value = p && h ? zn({
4865
4866
  tableRect: p,
4866
4867
  frameRect: l,
4867
4868
  kind: "column"
@@ -4876,16 +4877,16 @@ var ys = J({
4876
4877
  l.value = null;
4877
4878
  return;
4878
4879
  }
4879
- let a = i.getBoundingClientRect(), o = t.value === "row" ? Wn(e.editor)?.getBoundingClientRect() : null, s = o ? {
4880
+ let a = i.getBoundingClientRect(), o = t.value === "row" ? Un(e.editor)?.getBoundingClientRect() : null, s = o ? {
4880
4881
  left: a.left,
4881
4882
  top: o.top,
4882
4883
  width: a.width,
4883
4884
  height: a.height
4884
4885
  } : a, c = n.getBoundingClientRect(), u = _.value.getBoundingClientRect(), d = v.value?.scrollHeight ?? 0, f = d > 0 ? d + 12 : 0;
4885
- l.value = Ln({
4886
+ l.value = In({
4886
4887
  anchorRect: s,
4887
4888
  frameRect: c,
4888
- boundaryRect: Xn(n),
4889
+ boundaryRect: Yn(n),
4889
4890
  menuSize: {
4890
4891
  width: u.width || 254,
4891
4892
  height: f || u.height || 410
@@ -4903,10 +4904,10 @@ var ys = J({
4903
4904
  return;
4904
4905
  }
4905
4906
  let a = y.value.getBoundingClientRect(), o = Math.max(y.value.scrollHeight + 2, a.height);
4906
- u.value = Rn({
4907
+ u.value = Ln({
4907
4908
  triggerRect: i.getBoundingClientRect(),
4908
4909
  parentMenuRect: _.value.getBoundingClientRect(),
4909
- boundaryRect: Xn(r),
4910
+ boundaryRect: Yn(r),
4910
4911
  submenuSize: {
4911
4912
  width: a.width || 238,
4912
4913
  height: o || 410
@@ -4920,16 +4921,16 @@ var ys = J({
4920
4921
  let a = t.value === e && r.value === i;
4921
4922
  r.value = i, t.value = a ? null : e, n.value = null, u.value = null, ee();
4922
4923
  }, R = () => {
4923
- e.editor.view.dispatch(En(e.editor.state.tr, null));
4924
+ e.editor.view.dispatch(Tn(e.editor.state.tr, null));
4924
4925
  }, te = (t, n) => {
4925
4926
  let r = e.interactionState.hoverCellPos ?? T.value.activeCellPos, i = e.interactionState.hoverCellPos === null ? null : t === "row" ? e.interactionState.hoverVisualRowIndex : e.interactionState.hoverVisualColumnIndex;
4926
- r !== null && rr(e.editor, r, t, { visualIndex: i }), L(t, n);
4927
+ r !== null && nr(e.editor, r, t, { visualIndex: i }), L(t, n);
4927
4928
  }, z = () => {
4928
4929
  R(), L("selection", "selection-edge");
4929
4930
  }, B = (r = !1) => {
4930
4931
  t.value = null, n.value = null, l.value = null, u.value = null, r && e.editor.view.focus();
4931
4932
  }, V = async (n, r) => {
4932
- let i = await Hn({
4933
+ let i = await Vn({
4933
4934
  editor: e.editor,
4934
4935
  commandId: n,
4935
4936
  menu: r ?? t.value ?? "selection",
@@ -4937,12 +4938,12 @@ var ys = J({
4937
4938
  });
4938
4939
  return i.copyFeedback ? (M(i.copyFeedback), i.copyPayload && e.onCopyPayload?.(i.copyPayload)) : M(null), e.onCommandResult?.(i.commandResult), i.success;
4939
4940
  }, H = (t) => {
4940
- C.value && (Xe(e.editor, t), B(!1));
4941
+ C.value && (Ye(e.editor, t), B(!1));
4941
4942
  }, ne = (e) => {
4942
4943
  t.value !== "row" && t.value !== "column" || e(t.value) && (f.value += 1, ee());
4943
4944
  }, re = (t) => {
4944
4945
  let n = t === "row" ? E.value : D.value, r = e.interactionState.hoverCellPos ?? T.value.activeCellPos;
4945
- !n || r === null || lr(e.editor, r, t, { visualIndex: n.index }) && V(t === "row" ? "add-row-after" : "add-column-after", t);
4946
+ !n || r === null || cr(e.editor, r, t, { visualIndex: n.index }) && V(t === "row" ? "add-row-after" : "add-column-after", t);
4946
4947
  }, ie = (e, t, n) => {
4947
4948
  if (!w()) {
4948
4949
  n.preventDefault();
@@ -4954,14 +4955,14 @@ var ys = J({
4954
4955
  }, S = t, n.dataTransfer?.setData("application/x-markweave-table-axis", `${e}:${t}`), n.dataTransfer && (n.dataTransfer.effectAllowed = "move");
4955
4956
  }, ae = (t) => {
4956
4957
  if (!x) return;
4957
- let n = Kn(e.editor, x.axis, t.clientX, t.clientY);
4958
+ let n = Gn(e.editor, x.axis, t.clientX, t.clientY);
4958
4959
  n !== null && (t.preventDefault(), S = n, t.dataTransfer && (t.dataTransfer.dropEffect = "move"));
4959
4960
  }, oe = (t) => {
4960
4961
  let n = x;
4961
4962
  if (!n) return;
4962
- let r = Kn(e.editor, n.axis, t.clientX, t.clientY) ?? S;
4963
- t.preventDefault(), x = null, S = null, r !== null && nr(e.editor, n.axis, n.index, r);
4964
- }, se = G(() => (f.value, t.value === "row" || t.value === "column" ? qn(e.editor, t.value) : null)), ce = (e) => {
4963
+ let r = Gn(e.editor, n.axis, t.clientX, t.clientY) ?? S;
4964
+ t.preventDefault(), x = null, S = null, r !== null && tr(e.editor, n.axis, n.index, r);
4965
+ }, se = G(() => (f.value, t.value === "row" || t.value === "column" ? Kn(e.editor, t.value) : null)), ce = (e) => {
4965
4966
  if (!(!t.value || e.key !== "Escape")) {
4966
4967
  if (n.value) {
4967
4968
  n.value = null;
@@ -4978,9 +4979,9 @@ var ys = J({
4978
4979
  }, ue = (e) => {
4979
4980
  t.value && (e.target instanceof Node && p.value?.contains(e.target) || B());
4980
4981
  };
4981
- Cr(() => {
4982
+ Sr(() => {
4982
4983
  I(), window.addEventListener("resize", I), window.addEventListener("scroll", I, !0), document.addEventListener("keydown", ce), document.addEventListener("mousedown", ue), document.addEventListener("dragover", ae), document.addEventListener("drop", oe);
4983
- }), wr(() => {
4984
+ }), Cr(() => {
4984
4985
  j(), window.removeEventListener("resize", I), window.removeEventListener("scroll", I, !0), document.removeEventListener("keydown", ce), document.removeEventListener("mousedown", ue), document.removeEventListener("dragover", ae), document.removeEventListener("drop", oe);
4985
4986
  }), K(() => [
4986
4987
  e.active,
@@ -4997,7 +4998,7 @@ var ys = J({
4997
4998
  let de = () => {
4998
4999
  if (!t.value) return null;
4999
5000
  let r = A.value.map((r, i) => {
5000
- let a = Zn(r), o = i === 0 ? a : Zn(A.value[i - 1]), s = i > 0 && o !== a, c = t.value === "row" || t.value === "column" ? t.value : "selection", l = r.submenuId ? !0 : r.commandId === null ? C.value && Le(e.editor, c) : Vn(e.editor, r.commandId), u = Qn(r, e.messages), d = Ss[r.icon];
5001
+ let a = Xn(r), o = i === 0 ? a : Xn(A.value[i - 1]), s = i > 0 && o !== a, c = t.value === "row" || t.value === "column" ? t.value : "selection", l = r.submenuId ? !0 : r.commandId === null ? C.value && Ie(e.editor, c) : Bn(e.editor, r.commandId), u = Zn(r, e.messages), d = xs[r.icon];
5001
5002
  return U("button", {
5002
5003
  key: `${r.id}-${i}`,
5003
5004
  type: "button",
@@ -5041,7 +5042,7 @@ var ys = J({
5041
5042
  strokeWidth: 1.8
5042
5043
  })]),
5043
5044
  U("span", { class: "markweave-table-menu-item-label" }, u),
5044
- r.submenuId ? U(Zr, {
5045
+ r.submenuId ? U(Xr, {
5045
5046
  class: "markweave-table-menu-chevron",
5046
5047
  size: 16,
5047
5048
  "aria-hidden": "true"
@@ -5068,7 +5069,7 @@ var ys = J({
5068
5069
  onKeydown: le
5069
5070
  }, [
5070
5071
  U("div", { class: "markweave-table-submenu-title" }, e.messages.table.submenus.textColor),
5071
- ...ir.map((t) => U("button", {
5072
+ ...rr.map((t) => U("button", {
5072
5073
  key: `text-${t.id}`,
5073
5074
  type: "button",
5074
5075
  role: "menuitemradio",
@@ -5076,7 +5077,7 @@ var ys = J({
5076
5077
  "data-active": se.value?.textColorId === t.id ? "true" : "false",
5077
5078
  "data-testid": `markweave-table-text-color-${t.id}`,
5078
5079
  onMousedown: $,
5079
- onClick: () => ne((n) => In(e.editor, n, t.id))
5080
+ onClick: () => ne((n) => Fn(e.editor, n, t.id))
5080
5081
  }, [U("span", {
5081
5082
  class: "markweave-table-color-swatch markweave-table-text-color-swatch",
5082
5083
  "aria-hidden": "true",
@@ -5084,7 +5085,7 @@ var ys = J({
5084
5085
  }), U("span", null, e.messages.table.colors[t.id].text)])),
5085
5086
  U("div", { class: "markweave-table-submenu-separator" }),
5086
5087
  U("div", { class: "markweave-table-submenu-title" }, e.messages.table.submenus.backgroundColor),
5087
- ...ir.map((t) => U("button", {
5088
+ ...rr.map((t) => U("button", {
5088
5089
  key: `background-${t.id}`,
5089
5090
  type: "button",
5090
5091
  role: "menuitemradio",
@@ -5092,7 +5093,7 @@ var ys = J({
5092
5093
  "data-active": se.value?.backgroundColorId === t.id ? "true" : "false",
5093
5094
  "data-testid": `markweave-table-background-color-${t.id}`,
5094
5095
  onMousedown: $,
5095
- onClick: () => ne((n) => Fn(e.editor, n, t.id))
5096
+ onClick: () => ne((n) => Pn(e.editor, n, t.id))
5096
5097
  }, [U("span", {
5097
5098
  class: "markweave-table-color-swatch",
5098
5099
  "aria-hidden": "true",
@@ -5100,7 +5101,7 @@ var ys = J({
5100
5101
  }), U("span", null, e.messages.table.colors[t.id].background)]))
5101
5102
  ])), n.value === "alignment" && (t.value === "row" || t.value === "column")) {
5102
5103
  let t = (t, n) => {
5103
- let r = Cs[t];
5104
+ let r = Ss[t];
5104
5105
  return U("button", {
5105
5106
  key: t,
5106
5107
  type: "button",
@@ -5109,7 +5110,7 @@ var ys = J({
5109
5110
  "data-active": n ? "true" : "false",
5110
5111
  "data-testid": `markweave-table-alignment-${t}`,
5111
5112
  onMousedown: $,
5112
- onClick: () => ne((n) => Pn(e.editor, n, t))
5113
+ onClick: () => ne((n) => Nn(e.editor, n, t))
5113
5114
  }, [U(r, {
5114
5115
  size: 18,
5115
5116
  strokeWidth: 1.8,
@@ -5131,16 +5132,16 @@ var ys = J({
5131
5132
  } : void 0,
5132
5133
  onKeydown: le
5133
5134
  }, [
5134
- ...or.map((e) => t(e, se.value?.textAlign === e)),
5135
+ ...ar.map((e) => t(e, se.value?.textAlign === e)),
5135
5136
  U("div", { class: "markweave-table-submenu-separator" }),
5136
- ...cr.map((e) => t(e, se.value?.verticalAlign === e))
5137
+ ...sr.map((e) => t(e, se.value?.verticalAlign === e))
5137
5138
  ]));
5138
5139
  }
5139
5140
  return U("div", {
5140
5141
  ref: _,
5141
5142
  class: "markweave-table-menu",
5142
5143
  role: "menu",
5143
- "aria-label": sr(t.value, e.messages),
5144
+ "aria-label": or(t.value, e.messages),
5144
5145
  "data-testid": "markweave-table-menu",
5145
5146
  "data-positioned": l.value ? "true" : "false",
5146
5147
  "data-placement": l.value?.placement,
@@ -5159,7 +5160,7 @@ var ys = J({
5159
5160
  "aria-label": e.messages.table.controlsAriaLabel,
5160
5161
  "data-open-menu": t.value ?? "none",
5161
5162
  "data-positioned": i.value || a.value || o.value ? "true" : "false",
5162
- onMouseleave: () => e.editor.view.dispatch(e.editor.state.tr.setMeta(Nn, { type: "clear-hover" }))
5163
+ onMouseleave: () => e.editor.view.dispatch(e.editor.state.tr.setMeta(Mn, { type: "clear-hover" }))
5163
5164
  }, [
5164
5165
  d.value ? U("div", {
5165
5166
  class: "markweave-table-copy-feedback",
@@ -5169,7 +5170,7 @@ var ys = J({
5169
5170
  "data-copy-kind": d.value.kind,
5170
5171
  "data-text-length": d.value.textLength,
5171
5172
  "data-html-length": d.value.htmlLength
5172
- }, Un(d.value)) : null,
5173
+ }, Hn(d.value)) : null,
5173
5174
  i.value ? U("button", {
5174
5175
  ref: m,
5175
5176
  type: "button",
@@ -5196,7 +5197,7 @@ var ys = J({
5196
5197
  onDragend: () => {
5197
5198
  x = null, S = null;
5198
5199
  }
5199
- }, [U(xi, {
5200
+ }, [U(bi, {
5200
5201
  size: 14,
5201
5202
  "aria-hidden": "true"
5202
5203
  })]) : null,
@@ -5226,7 +5227,7 @@ var ys = J({
5226
5227
  onDragend: () => {
5227
5228
  x = null, S = null;
5228
5229
  }
5229
- }, [U(xi, {
5230
+ }, [U(bi, {
5230
5231
  size: 14,
5231
5232
  "aria-hidden": "true"
5232
5233
  })]) : null,
@@ -5247,7 +5248,7 @@ var ys = J({
5247
5248
  },
5248
5249
  onMousedown: $,
5249
5250
  onClick: z
5250
- }, [U(xi, {
5251
+ }, [U(bi, {
5251
5252
  size: 14,
5252
5253
  "aria-hidden": "true"
5253
5254
  })]) : null,
@@ -5265,7 +5266,7 @@ var ys = J({
5265
5266
  },
5266
5267
  onMousedown: $,
5267
5268
  onClick: () => re("row")
5268
- }, [U(Ti, {
5269
+ }, [U(wi, {
5269
5270
  size: 14,
5270
5271
  "aria-hidden": "true"
5271
5272
  })]) : null,
@@ -5283,14 +5284,14 @@ var ys = J({
5283
5284
  },
5284
5285
  onMousedown: $,
5285
5286
  onClick: () => re("column")
5286
- }, [U(Ti, {
5287
+ }, [U(wi, {
5287
5288
  size: 14,
5288
5289
  "aria-hidden": "true"
5289
5290
  })]) : null,
5290
5291
  de()
5291
5292
  ]) : null;
5292
5293
  }
5293
- }), Ts = J({
5294
+ }), ws = J({
5294
5295
  name: "MarkweaveVueTableSelectionOverlay",
5295
5296
  props: {
5296
5297
  editor: {
@@ -5308,11 +5309,11 @@ var ys = J({
5308
5309
  t.value = null;
5309
5310
  return;
5310
5311
  }
5311
- t.value = tr(e.editor, jn(e.editor.state));
5312
+ t.value = er(e.editor, An(e.editor.state));
5312
5313
  };
5313
- return Cr(() => {
5314
+ return Sr(() => {
5314
5315
  n(), window.addEventListener("resize", n), window.addEventListener("scroll", n, !0);
5315
- }), wr(() => {
5316
+ }), Cr(() => {
5316
5317
  window.removeEventListener("resize", n), window.removeEventListener("scroll", n, !0);
5317
5318
  }), K(() => [
5318
5319
  e.focusState.activeCellPos,
@@ -5347,7 +5348,7 @@ var ys = J({
5347
5348
  }) : null;
5348
5349
  };
5349
5350
  }
5350
- }), Es = J({
5351
+ }), Ts = J({
5351
5352
  name: "MarkweaveVueCodeBlockControls",
5352
5353
  props: {
5353
5354
  editor: {
@@ -5380,16 +5381,16 @@ var ys = J({
5380
5381
  active: !1,
5381
5382
  lastX: 0,
5382
5383
  lastY: 0
5383
- }), b = W(0), x = W(0), S = W(0), C = null, w = G(() => (S.value, Mt(e.editor, s.value))), T = G(() => !e.readOnly && e.active && e.state.active && e.state.pos !== null ? {
5384
+ }), b = W(0), x = W(0), S = W(0), C = null, w = G(() => (S.value, jt(e.editor, s.value))), T = G(() => !e.readOnly && e.active && e.state.active && e.state.pos !== null ? {
5384
5385
  ...e.state,
5385
5386
  pos: e.state.pos,
5386
5387
  active: !0
5387
- } : null), E = G(() => w.value ?? T.value), D = G(() => E.value !== null), O = G(() => E.value?.language === "mermaid"), k = G(() => Lt(e.editor, E.value)), A = G(() => D.value && E.value !== null && !k.value), j = G(() => !e.readOnly), M = G(() => E.value ? Tt(E.value.language) : Tt("text")), N = G(() => m.value?.status ?? "idle"), P = G(() => E.value?.mermaidPreviewMode ?? e.mermaidMode), F = G(() => O.value && P.value === "preview"), I = G(() => (S.value, b.value, x.value, Ft(e.editor))), ee = G(() => `${x.value}|${I.value.map((e) => `${e.pos}:${e.mermaidPreviewMode}:${e.text.length}`).join("|")}`), L = G(() => kt(f.value)), R = G(() => E.value ? `${E.value.pos}:${E.value.language}:${E.value.text}` : "none"), te = () => {
5388
+ } : null), E = G(() => w.value ?? T.value), D = G(() => E.value !== null), O = G(() => E.value?.language === "mermaid"), k = G(() => It(e.editor, E.value)), A = G(() => D.value && E.value !== null && !k.value), j = G(() => !e.readOnly), M = G(() => E.value ? wt(E.value.language) : wt("text")), N = G(() => m.value?.status ?? "idle"), P = G(() => E.value?.mermaidPreviewMode ?? e.mermaidMode), F = G(() => O.value && P.value === "preview"), I = G(() => (S.value, b.value, x.value, Pt(e.editor))), ee = G(() => `${x.value}|${I.value.map((e) => `${e.pos}:${e.mermaidPreviewMode}:${e.text.length}`).join("|")}`), L = G(() => Ot(f.value)), R = G(() => E.value ? `${E.value.pos}:${E.value.language}:${E.value.text}` : "none"), te = () => {
5388
5389
  C !== null && (window.clearTimeout(C), C = null);
5389
5390
  }, z = (e) => {
5390
5391
  te(), m.value = e, e && (C = window.setTimeout(() => {
5391
5392
  m.value = null, C = null;
5392
- }, vt));
5393
+ }, _t));
5393
5394
  }, B = () => {
5394
5395
  g.value = null, _.value = null, v.value = !1, y.value = {
5395
5396
  active: !1,
@@ -5399,15 +5400,15 @@ var ys = J({
5399
5400
  }, V = () => {
5400
5401
  let n = t.value;
5401
5402
  if (!n) return;
5402
- if (!Nt(n) || I.value.length === 0) {
5403
+ if (!Mt(n) || I.value.length === 0) {
5403
5404
  l.value = [];
5404
5405
  return;
5405
5406
  }
5406
5407
  let r = n.getBoundingClientRect(), i = I.value.flatMap((t) => {
5407
- let n = Ot(Dt(e.editor, t.pos, t.mermaidPreviewMode), r);
5408
- return n ? [Ct(t, n, r)] : [];
5408
+ let n = Dt(Et(e.editor, t.pos, t.mermaidPreviewMode), r);
5409
+ return n ? [St(t, n, r)] : [];
5409
5410
  });
5410
- l.value = Rt(l.value, i, I.value.map((e) => e.pos));
5411
+ l.value = Lt(l.value, i, I.value.map((e) => e.pos));
5411
5412
  }, H = () => {
5412
5413
  if (!A.value || !E.value) {
5413
5414
  c.value = null, u.value = null;
@@ -5415,14 +5416,14 @@ var ys = J({
5415
5416
  }
5416
5417
  let i = t.value;
5417
5418
  if (!i) return;
5418
- let a = Dt(e.editor, E.value.pos, P.value), o = i.getBoundingClientRect(), s = Ot(a, o);
5419
+ let a = Et(e.editor, E.value.pos, P.value), o = i.getBoundingClientRect(), s = Dt(a, o);
5419
5420
  if (!s) {
5420
5421
  c.value = c.value?.pos === E.value.pos ? c.value : null, u.value = d.value ? u.value : null;
5421
5422
  return;
5422
5423
  }
5423
- if (c.value = xt(E.value.pos, s, o), d.value && n.value) {
5424
+ if (c.value = bt(E.value.pos, s, o), d.value && n.value) {
5424
5425
  let e = n.value.getBoundingClientRect(), t = r.value?.getBoundingClientRect().height;
5425
- u.value = gt({
5426
+ u.value = ht({
5426
5427
  overlayRect: o,
5427
5428
  buttonRect: e,
5428
5429
  menuHeight: t,
@@ -5433,33 +5434,33 @@ var ys = J({
5433
5434
  }, ne = async () => {
5434
5435
  if (e.readOnly) {
5435
5436
  if (!E.value) return;
5436
- let e = await yt(E.value.text);
5437
- z(dt(E.value, e ? "copied" : "failed"));
5437
+ let e = await vt(E.value.text);
5438
+ z(ut(E.value, e ? "copied" : "failed"));
5438
5439
  return;
5439
5440
  }
5440
- if (!wt(e.editor, E.value)) return;
5441
- let t = await lt(e.editor);
5442
- z(dt(ut(e.editor), t ? "copied" : "failed")), e.editor.view.focus();
5441
+ if (!Ct(e.editor, E.value)) return;
5442
+ let t = await ct(e.editor);
5443
+ z(ut(lt(e.editor), t ? "copied" : "failed")), e.editor.view.focus();
5443
5444
  }, re = (t, n) => {
5444
5445
  if (e.readOnly) {
5445
- on(e.editor, t.pos, n) && (x.value += 1, S.value += 1);
5446
+ an(e.editor, t.pos, n) && (x.value += 1, S.value += 1);
5446
5447
  return;
5447
5448
  }
5448
5449
  let r = e.state.active && e.state.pos === t.pos;
5449
- ht(e.editor, t.pos, n) && (e.onMermaidModeChange(n), S.value += 1, r && e.editor.view.focus());
5450
+ mt(e.editor, t.pos, n) && (e.onMermaidModeChange(n), S.value += 1, r && e.editor.view.focus());
5450
5451
  }, ie = (t) => {
5451
5452
  if (e.readOnly || !E.value) return;
5452
5453
  let n = e.state.active && e.state.pos === E.value.pos;
5453
- mt(e.editor, E.value.pos, t) && (t === "mermaid" && ht(e.editor, E.value.pos, "preview") && e.onMermaidModeChange("preview"), d.value = !1, f.value = "", p.value = -1, S.value += 1, n && e.editor.view.focus());
5454
+ pt(e.editor, E.value.pos, t) && (t === "mermaid" && mt(e.editor, E.value.pos, "preview") && e.onMermaidModeChange("preview"), d.value = !1, f.value = "", p.value = -1, S.value += 1, n && e.editor.view.focus());
5454
5455
  }, ae = () => {
5455
- d.value = !d.value, d.value && o.value === null && (o.value = bt()), p.value = d.value ? Pt(L.value, E.value?.language ?? null) : -1;
5456
+ d.value = !d.value, d.value && o.value === null && (o.value = yt()), p.value = d.value ? Nt(L.value, E.value?.language ?? null) : -1;
5456
5457
  }, oe = (e) => {
5457
- let t = kt(e);
5458
- f.value = e, p.value = Pt(t, e.trim() ? null : E.value?.language ?? null);
5458
+ let t = Ot(e);
5459
+ f.value = e, p.value = Nt(t, e.trim() ? null : E.value?.language ?? null);
5459
5460
  }, se = (t) => {
5460
5461
  if (!t.isComposing) {
5461
5462
  if (t.key === "ArrowDown" || t.key === "ArrowUp") {
5462
- t.preventDefault(), p.value = Bt(p.value, L.value.length, t.key === "ArrowUp" ? "previous" : "next");
5463
+ t.preventDefault(), p.value = zt(p.value, L.value.length, t.key === "ArrowUp" ? "previous" : "next");
5463
5464
  return;
5464
5465
  }
5465
5466
  if (t.key === "Enter") {
@@ -5470,10 +5471,10 @@ var ys = J({
5470
5471
  t.key === "Escape" && (t.preventDefault(), d.value = !1, p.value = -1, e.editor.view.focus());
5471
5472
  }
5472
5473
  }, ce = () => {
5473
- e.readOnly || !E.value || pt(e.editor, E.value.pos, !k.value) && (b.value += 1, S.value += 1, s.value = null);
5474
+ e.readOnly || !E.value || ft(e.editor, E.value.pos, !k.value) && (b.value += 1, S.value += 1, s.value = null);
5474
5475
  }, le = () => {
5475
5476
  if (!E.value) return;
5476
- let t = It(e.editor, E.value.pos);
5477
+ let t = Ft(e.editor, E.value.pos);
5477
5478
  t && ue({
5478
5479
  data: new Blob([t], { type: "image/svg+xml" }),
5479
5480
  fileName: "markweave-mermaid.svg",
@@ -5482,8 +5483,8 @@ var ys = J({
5482
5483
  });
5483
5484
  }, de = () => {
5484
5485
  if (!E.value) return;
5485
- let t = It(e.editor, E.value.pos);
5486
- t && (g.value = St(t), _.value = null, v.value = !1, y.value = {
5486
+ let t = Ft(e.editor, E.value.pos);
5487
+ t && (g.value = xt(t), _.value = null, v.value = !1, y.value = {
5487
5488
  active: !1,
5488
5489
  lastX: 0,
5489
5490
  lastY: 0
@@ -5491,16 +5492,16 @@ var ys = J({
5491
5492
  }, fe = (e) => {
5492
5493
  g.value = g.value ? {
5493
5494
  ...g.value,
5494
- scale: _t(g.value.scale + e)
5495
+ scale: gt(g.value.scale + e)
5495
5496
  } : null;
5496
5497
  }, pe = () => {
5497
- g.value = g.value ? St(g.value.svg) : null, y.value = {
5498
+ g.value = g.value ? xt(g.value.svg) : null, y.value = {
5498
5499
  active: !1,
5499
5500
  lastX: 0,
5500
5501
  lastY: 0
5501
5502
  }, v.value = !1;
5502
5503
  }, me = (e) => {
5503
- e.preventDefault(), fe(e.deltaY < 0 ? zt : -zt);
5504
+ e.preventDefault(), fe(e.deltaY < 0 ? Rt : -Rt);
5504
5505
  }, he = (e) => {
5505
5506
  e.button === 0 && (e.preventDefault(), y.value = {
5506
5507
  active: !0,
@@ -5515,7 +5516,7 @@ var ys = J({
5515
5516
  active: !0,
5516
5517
  lastX: e.clientX,
5517
5518
  lastY: e.clientY
5518
- }, g.value = Vt(g.value, n, r);
5519
+ }, g.value = Bt(g.value, n, r);
5519
5520
  }, _e = () => {
5520
5521
  y.value = {
5521
5522
  active: !1,
@@ -5541,7 +5542,7 @@ var ys = J({
5541
5542
  if (!d.value || p.value < 0) return;
5542
5543
  await q();
5543
5544
  let e = a.value, t = e?.querySelector(`[data-language-index="${p.value}"]`);
5544
- e && t && Ht(e, t);
5545
+ e && t && Vt(e, t);
5545
5546
  }, { flush: "post" }), K(() => [
5546
5547
  A.value,
5547
5548
  b.value,
@@ -5561,11 +5562,11 @@ var ys = J({
5561
5562
  immediate: !0
5562
5563
  });
5563
5564
  let ve = null;
5564
- return Cr(() => {
5565
+ return Sr(() => {
5565
5566
  q(() => {
5566
5567
  let n = e.editor.view.dom.closest(".markweave-editor-frame"), r = (n) => {
5567
5568
  if (n.target instanceof Node && t.value?.contains(n.target) || d.value) return;
5568
- let r = jt(e.editor, n.target), i = Mt(e.editor, r), a = i && !Lt(e.editor, i) ? i.pos : null;
5569
+ let r = At(e.editor, n.target), i = jt(e.editor, r), a = i && !It(e.editor, i) ? i.pos : null;
5569
5570
  s.value = s.value === a ? s.value : a;
5570
5571
  }, i = () => {
5571
5572
  d.value || (s.value = null);
@@ -5580,13 +5581,13 @@ var ys = J({
5580
5581
  }, o = (e) => {
5581
5582
  d.value && (e.target instanceof Node && t.value?.contains(e.target) || (d.value = !1, p.value = -1));
5582
5583
  }, c = ({ transaction: e }) => {
5583
- e.getMeta(ct) && (b.value += 1), (e.docChanged || e.selectionSet || e.getMeta(ct) || nn(e)) && (S.value += 1);
5584
+ e.getMeta(st) && (b.value += 1), (e.docChanged || e.selectionSet || e.getMeta(st) || tn(e)) && (S.value += 1);
5584
5585
  };
5585
5586
  n?.addEventListener("mousemove", r), n?.addEventListener("mouseleave", i), window.addEventListener("resize", H), window.addEventListener("scroll", H, !0), window.addEventListener("resize", V), window.addEventListener("scroll", V, !0), document.addEventListener("keydown", a), document.addEventListener("mousedown", o), e.editor.on("transaction", c), ve = () => {
5586
5587
  n?.removeEventListener("mousemove", r), n?.removeEventListener("mouseleave", i), window.removeEventListener("resize", H), window.removeEventListener("scroll", H, !0), window.removeEventListener("resize", V), window.removeEventListener("scroll", V, !0), document.removeEventListener("keydown", a), document.removeEventListener("mousedown", o), e.editor.off("transaction", c), te();
5587
5588
  };
5588
5589
  });
5589
- }), wr(() => {
5590
+ }), Cr(() => {
5590
5591
  ve?.(), ve = null, te();
5591
5592
  }), () => {
5592
5593
  if (!A.value && I.value.length === 0 && !g.value) return null;
@@ -5647,7 +5648,7 @@ var ys = J({
5647
5648
  "data-testid": "markweave-codeblock-language",
5648
5649
  onMousedown: $,
5649
5650
  onClick: ae
5650
- }, [U("span", null, M.value), fs("chevron")]),
5651
+ }, [U("span", null, M.value), ds("chevron")]),
5651
5652
  j.value ? U("button", {
5652
5653
  type: "button",
5653
5654
  class: "markweave-codeblock-icon-button markweave-codeblock-collapse-button",
@@ -5657,7 +5658,7 @@ var ys = J({
5657
5658
  "data-collapsed": k.value ? "true" : "false",
5658
5659
  onMousedown: $,
5659
5660
  onClick: ce
5660
- }, [fs("chevron")]) : null,
5661
+ }, [ds("chevron")]) : null,
5661
5662
  U("span", { class: "markweave-codeblock-copy-wrap" }, [U("button", {
5662
5663
  type: "button",
5663
5664
  class: "markweave-codeblock-icon-button",
@@ -5680,7 +5681,7 @@ var ys = J({
5680
5681
  onClick: () => {
5681
5682
  ne();
5682
5683
  }
5683
- }, [fs(N.value === "copied" ? "check" : "clipboard")]), h.value ? U("span", {
5684
+ }, [ds(N.value === "copied" ? "check" : "clipboard")]), h.value ? U("span", {
5684
5685
  class: "markweave-codeblock-tooltip",
5685
5686
  role: "tooltip",
5686
5687
  "data-testid": "markweave-codeblock-copy-tooltip"
@@ -5696,7 +5697,7 @@ var ys = J({
5696
5697
  disabled: !F.value,
5697
5698
  onMousedown: $,
5698
5699
  onClick: de
5699
- }, [fs("expand")]), U("button", {
5700
+ }, [ds("expand")]), U("button", {
5700
5701
  type: "button",
5701
5702
  class: "markweave-codeblock-icon-button",
5702
5703
  "aria-label": "Download Mermaid SVG",
@@ -5704,7 +5705,7 @@ var ys = J({
5704
5705
  disabled: !F.value,
5705
5706
  onMousedown: $,
5706
5707
  onClick: le
5707
- }, [fs("download")])]) : null
5708
+ }, [ds("download")])]) : null
5708
5709
  ]) : null,
5709
5710
  j.value && A.value && d.value && E.value ? U("div", {
5710
5711
  ref: r,
@@ -5718,7 +5719,7 @@ var ys = J({
5718
5719
  "aria-autocomplete": "list",
5719
5720
  "aria-controls": o.value ?? void 0,
5720
5721
  "aria-expanded": "true",
5721
- "aria-activedescendant": o.value && L.value[p.value] ? At(o.value, L.value[p.value].language) : void 0,
5722
+ "aria-activedescendant": o.value && L.value[p.value] ? kt(o.value, L.value[p.value].language) : void 0,
5722
5723
  "aria-label": "Search code block languages",
5723
5724
  value: f.value,
5724
5725
  placeholder: "Search...",
@@ -5727,7 +5728,7 @@ var ys = J({
5727
5728
  oe(e.target.value);
5728
5729
  },
5729
5730
  onKeydown: se
5730
- }), fs("search")]), U("div", {
5731
+ }), ds("search")]), U("div", {
5731
5732
  ref: a,
5732
5733
  id: o.value ?? void 0,
5733
5734
  class: "markweave-codeblock-language-list",
@@ -5737,7 +5738,7 @@ var ys = J({
5737
5738
  let n = E.value?.language === e.language, r = t === p.value;
5738
5739
  return U("button", {
5739
5740
  key: e.language,
5740
- id: o.value ? At(o.value, e.language) : void 0,
5741
+ id: o.value ? kt(o.value, e.language) : void 0,
5741
5742
  type: "button",
5742
5743
  role: "option",
5743
5744
  "aria-selected": n ? "true" : "false",
@@ -5750,7 +5751,7 @@ var ys = J({
5750
5751
  p.value = t;
5751
5752
  },
5752
5753
  onClick: () => ie(e.language)
5753
- }, [U("span", null, e.label), n ? fs("check") : null]);
5754
+ }, [U("span", null, e.label), n ? ds("check") : null]);
5754
5755
  }))]) : null,
5755
5756
  g.value ? U("div", {
5756
5757
  class: "markweave-mermaid-fullscreen-layer",
@@ -5780,12 +5781,12 @@ var ys = J({
5780
5781
  onBlur: () => {
5781
5782
  _.value = null;
5782
5783
  },
5783
- onClick: () => fe(-zt)
5784
- }, [fs("zoomOut")]),
5784
+ onClick: () => fe(-Rt)
5785
+ }, [ds("zoomOut")]),
5785
5786
  U("span", {
5786
5787
  class: "markweave-mermaid-fullscreen-zoom-label",
5787
5788
  "data-testid": "markweave-mermaid-fullscreen-zoom-label"
5788
- }, Et(g.value.scale)),
5789
+ }, Tt(g.value.scale)),
5789
5790
  U("button", {
5790
5791
  type: "button",
5791
5792
  class: "markweave-mermaid-fullscreen-control",
@@ -5803,8 +5804,8 @@ var ys = J({
5803
5804
  onBlur: () => {
5804
5805
  _.value = null;
5805
5806
  },
5806
- onClick: () => fe(zt)
5807
- }, [fs("zoomIn")]),
5807
+ onClick: () => fe(Rt)
5808
+ }, [ds("zoomIn")]),
5808
5809
  U("button", {
5809
5810
  type: "button",
5810
5811
  class: "markweave-mermaid-fullscreen-control",
@@ -5823,7 +5824,7 @@ var ys = J({
5823
5824
  _.value = null;
5824
5825
  },
5825
5826
  onClick: pe
5826
- }, [fs("reset")]),
5827
+ }, [ds("reset")]),
5827
5828
  _.value ? U("span", {
5828
5829
  class: "markweave-mermaid-fullscreen-tooltip",
5829
5830
  role: "tooltip",
@@ -5836,7 +5837,7 @@ var ys = J({
5836
5837
  "aria-label": "Close fullscreen Mermaid preview",
5837
5838
  "data-testid": "markweave-mermaid-fullscreen-close",
5838
5839
  onClick: B
5839
- }, [fs("close")]),
5840
+ }, [ds("close")]),
5840
5841
  U("div", {
5841
5842
  class: "markweave-mermaid-fullscreen-viewport",
5842
5843
  "data-testid": "markweave-mermaid-fullscreen-viewport",
@@ -5862,7 +5863,7 @@ var ys = J({
5862
5863
  ]);
5863
5864
  };
5864
5865
  }
5865
- }), Ds = J({
5866
+ }), Es = J({
5866
5867
  name: "MarkweaveVueInnerToc",
5867
5868
  props: {
5868
5869
  editor: {
@@ -5888,20 +5889,20 @@ var ys = J({
5888
5889
  },
5889
5890
  setup(e) {
5890
5891
  let t = W(null), n, r, i = () => {
5891
- n?.(), n = e.placement === "container" && t.value ? at(t.value) : void 0;
5892
+ n?.(), n = e.placement === "container" && t.value ? it(t.value) : void 0;
5892
5893
  }, a = () => {
5893
- r?.(), r = t.value && e.state.items.length ? ot(t.value, e.state.items.length) : void 0;
5894
+ r?.(), r = t.value && e.state.items.length ? at(t.value, e.state.items.length) : void 0;
5894
5895
  };
5895
- return Cr(() => {
5896
+ return Sr(() => {
5896
5897
  i(), a();
5897
- }), wr(() => {
5898
+ }), Cr(() => {
5898
5899
  n?.(), r?.();
5899
5900
  }), K(() => e.placement, i), K(() => e.state.items.length, a, { flush: "post" }), () => e.state.items.length ? U("nav", {
5900
5901
  ref: t,
5901
5902
  class: "markweave-inner-toc",
5902
5903
  "data-testid": "markweave-inner-toc",
5903
5904
  "aria-label": e.messages.toc.ariaLabel,
5904
- style: { "--markweave-inner-toc-rail-height": tt(e.state.items.length) }
5905
+ style: { "--markweave-inner-toc-rail-height": et(e.state.items.length) }
5905
5906
  }, [U("div", {
5906
5907
  class: "markweave-inner-toc-rail",
5907
5908
  "aria-hidden": "true"
@@ -5918,32 +5919,33 @@ var ys = J({
5918
5919
  "aria-current": t.active ? "location" : void 0,
5919
5920
  "aria-label": `${e.messages.toc.itemAriaLabel}: ${t.text}`,
5920
5921
  title: t.text,
5921
- onClick: () => st(e.editor, t, {
5922
+ onClick: () => ot(e.editor, t, {
5922
5923
  behavior: "smooth",
5923
5924
  focus: e.editable
5924
5925
  })
5925
5926
  }, t.text)))])]) : null;
5926
5927
  }
5927
5928
  });
5928
- function Os(e = {}) {
5929
- let r = n(e.lang), a = t(r), o = G(() => Cn({
5929
+ function Ds(e = {}) {
5930
+ let r = n(e.lang), a = t(r), o = G(() => Sn({
5930
5931
  lang: r,
5931
5932
  commandGroups: e.commandGroups,
5932
5933
  commands: e.commands,
5933
5934
  builtinCommands: e.builtinCommands
5934
- })), s = W(d(e.mode)), c = G(() => Me(e.theme)), l = G(() => s.value === "live" && e.editable !== !1), u = W(0), p = Sr(null), m = W(wn), h = Sr(null), g = Sr(null), _ = W(null), v = W("code"), y = Sr(null), b = Sr(Mn), x = W(null), S = W(!1), C = Sr(null), w = ge(e.content === void 0 ? e.defaultContentFormat : e.contentFormat), T = e.content ?? e.defaultContent ?? "", E = typeof T == "string" && T.length >= 2e5, D = null;
5935
+ })), s = W(d(e.mode)), c = G(() => je(e.theme)), l = G(() => s.value === "live" && e.editable !== !1), u = W(0), p = xr(null), m = W(Cn), h = xr(null), g = xr(null), _ = W(null), v = W("code"), y = xr(null), b = xr(jn), x = W(null), S = W(!1), C = xr(null), w = ge(e.content === void 0 ? e.defaultContentFormat : e.contentFormat), T = e.content ?? e.defaultContent ?? "", E = typeof T == "string" && T.length >= 2e5, D = null;
5935
5936
  function O() {
5936
5937
  D !== null && (window.clearTimeout(D), D = null), u.value += 1;
5937
5938
  }
5938
5939
  function k() {
5939
5940
  D !== null && window.clearTimeout(D), D = window.setTimeout(() => {
5940
5941
  D = null, u.value += 1;
5941
- }, ke);
5942
+ }, Oe);
5942
5943
  }
5943
- let A = e.onSlashCommandUpload, j = Sr(null), M = !1;
5944
+ let A = e.onSlashCommandUpload, j = xr(null), M = !1;
5944
5945
  j.value = new i({
5945
- extensions: fa({
5946
+ extensions: da({
5946
5947
  lang: r,
5948
+ revealLinkMarkdown: e.revealLinkMarkdown !== !1,
5947
5949
  linkCardResolver: e.linkCardResolver,
5948
5950
  onImageUpload: (e) => A?.(e) ?? V(e) ?? Promise.reject(/* @__PURE__ */ Error("File upload requires an upload handler.")),
5949
5951
  onVideoUpload: (e) => A?.(e) ?? V(e) ?? Promise.reject(/* @__PURE__ */ Error("File upload requires an upload handler.")),
@@ -5968,32 +5970,32 @@ function Os(e = {}) {
5968
5970
  translate: "no"
5969
5971
  },
5970
5972
  handleClick: (e, t, n) => {
5971
- if (!l.value) return we(n);
5972
- let r = Xt(e, n);
5973
- return r ? (n.preventDefault(), n.stopPropagation(), R(), en(e, r, !0), tn(e, r), y.value = r, !0) : (y.value = null, !1);
5973
+ if (!l.value) return !1;
5974
+ let r = Yt(e, n);
5975
+ return r ? (n.preventDefault(), n.stopPropagation(), R(), $t(e, r, !0), en(e, r), y.value = r, !0) : (y.value = null, !1);
5974
5976
  },
5975
5977
  handleDOMEvents: {
5976
- compositionstart: () => l.value ? (m.value = Tn(m.value, { type: "composition-start" }), h.value = null, !1) : !1,
5978
+ compositionstart: () => l.value ? (m.value = wn(m.value, { type: "composition-start" }), h.value = null, !1) : !1,
5977
5979
  compositionend: (e) => (l.value && window.setTimeout(() => te(e), 0), !1),
5978
5980
  click: (e, t) => {
5979
- if (!l.value) return we(t);
5980
- let n = Xt(e, t);
5981
- return n ? (t.preventDefault(), t.stopPropagation(), R(), en(e, n, !0), tn(e, n), y.value = n, !0) : (y.value = null, !1);
5981
+ if (!l.value) return !1;
5982
+ let n = Yt(e, t);
5983
+ return n ? (t.preventDefault(), t.stopPropagation(), R(), $t(e, n, !0), en(e, n), y.value = n, !0) : (y.value = null, !1);
5982
5984
  }
5983
5985
  }
5984
5986
  },
5985
5987
  onSelectionUpdate: ({ editor: e }) => B(e),
5986
5988
  onCreate: ({ editor: t }) => {
5987
- Sn(t, o.value, (t) => {
5989
+ xn(t, o.value, (t) => {
5988
5990
  _.value = t.message, e.onCommandError?.(t);
5989
- }), xn(t, w), M = !0, e.onCommandControllerChange?.(yn(t)), f(t, {
5991
+ }), bn(t, w), M = !0, e.onCommandControllerChange?.(vn(t)), f(t, {
5990
5992
  mode: s.value,
5991
5993
  editable: l.value
5992
- }), rn(t, c.value), an(t, l.value ? "live" : "view"), e.autoFocusFirstTableBodyCell && l.value && kn(t), H(t), B(t), O();
5994
+ }), nn(t, c.value), rn(t, l.value ? "live" : "view"), e.autoFocusFirstTableBodyCell && l.value && On(t), H(t), B(t), O();
5993
5995
  },
5994
5996
  onTransaction: ({ editor: e, transaction: t }) => {
5995
- if (H(e), (t.docChanged || nn(t)) && k(), t.docChanged && y.value) {
5996
- let t = Yt(e, y.value.pos);
5997
+ if (H(e), (t.docChanged || tn(t)) && k(), t.docChanged && y.value) {
5998
+ let t = Jt(e, y.value.pos);
5997
5999
  y.value = t?.kind === y.value.kind ? t : null;
5998
6000
  }
5999
6001
  },
@@ -6009,70 +6011,70 @@ function Os(e = {}) {
6009
6011
  }
6010
6012
  });
6011
6013
  let N = j.value;
6012
- Sn(N, o.value, (t) => {
6014
+ xn(N, o.value, (t) => {
6013
6015
  _.value = t.message, e.onCommandError?.(t);
6014
- }), xn(N, w), K(o, (t) => {
6015
- j.value && Sn(j.value, t, (t) => {
6016
+ }), bn(N, w), K(o, (t) => {
6017
+ j.value && xn(j.value, t, (t) => {
6016
6018
  _.value = t.message, e.onCommandError?.(t);
6017
6019
  });
6018
6020
  }), K(() => [e.content === void 0 ? e.defaultContentFormat : e.contentFormat, e.content], () => {
6019
- j.value && xn(j.value, ge(e.content === void 0 ? e.defaultContentFormat : e.contentFormat));
6021
+ j.value && bn(j.value, ge(e.content === void 0 ? e.defaultContentFormat : e.contentFormat));
6020
6022
  });
6021
- let P = j.value, F = Ne(P), I = !1, ee = !1;
6023
+ let P = j.value, F = Me(P), I = !1, ee = !1;
6022
6024
  q(() => {
6023
6025
  I || j.value !== P || (ee = !0, e.onAiEditControllerChange?.(F));
6024
6026
  });
6025
6027
  let L = G(() => j.value ?? null);
6026
6028
  function R() {
6027
- h.value = null, g.value = null, m.value = wn;
6029
+ h.value = null, g.value = null, m.value = Cn;
6028
6030
  }
6029
6031
  function te(e) {
6030
- let t = gn(e.state);
6032
+ let t = hn(e.state);
6031
6033
  if (!t) {
6032
- m.value = m.value.name === "idle" ? m.value : wn, h.value = null, g.value = null;
6034
+ m.value = m.value.name === "idle" ? m.value : Cn, h.value = null, g.value = null;
6033
6035
  return;
6034
6036
  }
6035
6037
  let n = e.coordsAtPos(t.cursor), r = e.coordsAtPos(t.triggerFrom), i = e.dom.closest(".markweave-editor-frame")?.getBoundingClientRect();
6036
- if (!vn(r, { frameRect: i })) {
6038
+ if (!_n(r, { frameRect: i })) {
6037
6039
  R();
6038
6040
  return;
6039
6041
  }
6040
- let a = hn(n, {
6042
+ let a = mn(n, {
6041
6043
  frameRect: i,
6042
6044
  triggerRect: r
6043
6045
  });
6044
- pn(h.value, a) || (h.value = a), m.value = mn(m.value, t);
6046
+ fn(h.value, a) || (h.value = a), m.value = pn(m.value, t);
6045
6047
  }
6046
6048
  function z(e) {
6047
6049
  te(e.view);
6048
6050
  }
6049
6051
  function B(e) {
6050
- let t = Oe(e);
6051
- Ee(p.value, t) || (p.value = t);
6052
- let n = Zt(e);
6053
- n && ($t(e, n, !0), y.value = n);
6054
- let r = ut(e);
6052
+ let t = De(e);
6053
+ Te(p.value, t) || (p.value = t);
6054
+ let n = Xt(e);
6055
+ n && (Qt(e, n, !0), y.value = n);
6056
+ let r = lt(e);
6055
6057
  r.active && r.language === "mermaid" && (v.value = r.mermaidPreviewMode);
6056
6058
  }
6057
6059
  function H(e) {
6058
- b.value = ls(e);
6060
+ b.value = cs(e);
6059
6061
  }
6060
- let ne = G(() => L.value ? ut(L.value) : cs), re = G(() => L.value ? An(L.value.state) : ss), ie = G(() => p.value?.currentNode === "codeBlock"), ae = G(() => ie.value && ne.value.language === "mermaid"), oe = G(() => L.value ? sn({
6062
+ let ne = G(() => L.value ? lt(L.value) : ss), re = G(() => L.value ? kn(L.value.state) : os), ie = G(() => p.value?.currentNode === "codeBlock"), ae = G(() => ie.value && ne.value.language === "mermaid"), oe = G(() => L.value ? on({
6061
6063
  active: ae.value,
6062
6064
  mode: v.value,
6063
6065
  source: ne.value.text
6064
- }) : sn({
6066
+ }) : on({
6065
6067
  active: !1,
6066
6068
  mode: "code",
6067
6069
  source: ""
6068
- })), se = G(() => L.value && e.onRuntimeStateChange ? On(L.value.state) : null), ce = G(() => L.value ? nt(L.value.state) : $e.items), ue = G(() => rt(ce.value, x.value)), _e = G(() => Qe(ce.value, ue.value)), ve = G(() => {
6070
+ })), se = G(() => L.value && e.onRuntimeStateChange ? Dn(L.value.state) : null), ce = G(() => L.value ? tt(L.value.state) : Qe.items), ue = G(() => nt(ce.value, x.value)), _e = G(() => Ze(ce.value, ue.value)), ve = G(() => {
6069
6071
  u.value, p.value, l.value;
6070
6072
  let e = L.value;
6071
- return cn(e ? yn(e).getCommands({
6073
+ return sn(e ? vn(e).getCommands({
6072
6074
  surface: "slash",
6073
6075
  query: m.value.query
6074
6076
  }) : o.value.commands, r);
6075
- }), ye = G(() => Te({
6077
+ }), ye = G(() => we({
6076
6078
  revision: u.value,
6077
6079
  mode: s.value,
6078
6080
  editable: l.value,
@@ -6086,27 +6088,27 @@ function Os(e = {}) {
6086
6088
  tableDebugSnapshot: se.value
6087
6089
  })), be = {
6088
6090
  closeSlashMenu: R,
6089
- focusFirstTableBodyCell: () => L.value ? kn(L.value) : !1,
6091
+ focusFirstTableBodyCell: () => L.value ? On(L.value) : !1,
6090
6092
  setContent: (e, t = {}) => {
6091
6093
  if (!L.value) return !1;
6092
6094
  let n = ge(t.format);
6093
6095
  return L.value.commands.setContent(e, {
6094
6096
  contentType: pe(n),
6095
6097
  emitUpdate: t.emitUpdate ?? !1
6096
- }), t.focusFirstTableBodyCell && kn(L.value), B(L.value), l.value && z(L.value), H(L.value), O(), !0;
6098
+ }), t.focusFirstTableBodyCell && On(L.value), B(L.value), l.value && z(L.value), H(L.value), O(), !0;
6097
6099
  }
6098
6100
  };
6099
6101
  function xe(e, t) {
6100
- if (!L.value || !l.value || !un(e)) return;
6102
+ if (!L.value || !l.value || !ln(e)) return;
6101
6103
  if (e.inputKind && !t?.emoji && !t?.uploadResult) {
6102
6104
  g.value = e;
6103
6105
  return;
6104
6106
  }
6105
- let n = gn(L.value.state);
6107
+ let n = hn(L.value.state);
6106
6108
  if (!n) return;
6107
- _.value = null, m.value = Tn(m.value, { type: "execute" }), g.value = null;
6109
+ _.value = null, m.value = wn(m.value, { type: "execute" }), g.value = null;
6108
6110
  let r = L.value;
6109
- bn(r, e.id, n, t).then((e) => {
6111
+ yn(r, e.id, n, t).then((e) => {
6110
6112
  if (e.ok && e.outcome === "applied") {
6111
6113
  R();
6112
6114
  return;
@@ -6117,17 +6119,17 @@ function Os(e = {}) {
6117
6119
  function Se(e) {
6118
6120
  if (!L.value || g.value || !l.value) return;
6119
6121
  if (m.value.name === "executing" && e.key === "Escape") {
6120
- e.preventDefault(), yn(L.value).cancel(), R();
6122
+ e.preventDefault(), vn(L.value).cancel(), R();
6121
6123
  return;
6122
6124
  }
6123
- let t = dn(m.value, ve.value, e.key, { isComposing: e.isComposing || le(L.value.state) });
6125
+ let t = un(m.value, ve.value, e.key, { isComposing: e.isComposing || le(L.value.state) });
6124
6126
  if (t.type !== "ignore") {
6125
6127
  if (e.preventDefault(), t.type === "close") {
6126
- yn(L.value).cancel(), m.value = Tn(m.value, { type: "escape" }), R();
6128
+ vn(L.value).cancel(), m.value = wn(m.value, { type: "escape" }), R();
6127
6129
  return;
6128
6130
  }
6129
6131
  if (t.type === "move-active") {
6130
- m.value = Tn(m.value, {
6132
+ m.value = wn(m.value, {
6131
6133
  type: "move-active",
6132
6134
  delta: t.delta,
6133
6135
  optionCount: t.optionCount
@@ -6135,7 +6137,7 @@ function Os(e = {}) {
6135
6137
  return;
6136
6138
  }
6137
6139
  if (t.type === "set-active") {
6138
- m.value = Tn(m.value, t);
6140
+ m.value = wn(m.value, t);
6139
6141
  return;
6140
6142
  }
6141
6143
  xe(t.command);
@@ -6145,9 +6147,9 @@ function Os(e = {}) {
6145
6147
  s.value = d(e.mode), L.value && (L.value.setEditable(l.value), f(L.value, {
6146
6148
  mode: s.value,
6147
6149
  editable: l.value
6148
- }), an(L.value, l.value ? "live" : "view"), O(), l.value || R());
6150
+ }), rn(L.value, l.value ? "live" : "view"), O(), l.value || R());
6149
6151
  }, { immediate: !0 }), K(() => e.theme, () => {
6150
- L.value && rn(L.value, c.value);
6152
+ L.value && nn(L.value, c.value);
6151
6153
  }, { immediate: !0 }), K(() => e.content, (t) => {
6152
6154
  let n = ge(e.contentFormat);
6153
6155
  if (!(!L.value || t === void 0)) {
@@ -6161,25 +6163,25 @@ function Os(e = {}) {
6161
6163
  }), S.value = !1, B(L.value), l.value && z(L.value), H(L.value), O());
6162
6164
  }
6163
6165
  }), K(ye, (t) => e.onRuntimeStateChange?.(t), { immediate: !0 }), K(_e, (t) => e.onTocChange?.(t), { immediate: !0 }), K(ce, (e) => {
6164
- let t = rt(e, x.value);
6166
+ let t = nt(e, x.value);
6165
6167
  x.value !== t && (x.value = t);
6166
6168
  });
6167
6169
  let Ce = de(() => {
6168
6170
  L.value && h.value && te(L.value.view);
6169
- }), De = (e) => {
6170
- e?.type === "scroll" && _n(e.target) || h.value && Ce.schedule();
6171
+ }), Ee = (e) => {
6172
+ e?.type === "scroll" && gn(e.target) || h.value && Ce.schedule();
6171
6173
  };
6172
6174
  K(h, (e) => {
6173
- e ? De() : Ce.cancel();
6175
+ e ? Ee() : Ce.cancel();
6176
+ }), Sr(() => {
6177
+ window.addEventListener("resize", Ee), window.addEventListener("scroll", Ee, !0);
6174
6178
  }), Cr(() => {
6175
- window.addEventListener("resize", De), window.addEventListener("scroll", De, !0);
6176
- }), wr(() => {
6177
- Ce.cancel(), window.removeEventListener("resize", De), window.removeEventListener("scroll", De, !0);
6179
+ Ce.cancel(), window.removeEventListener("resize", Ee), window.removeEventListener("scroll", Ee, !0);
6178
6180
  });
6179
- let Ae = null;
6180
- return wr(() => {
6181
+ let ke = null;
6182
+ return Cr(() => {
6181
6183
  D !== null && window.clearTimeout(D);
6182
- }), Cr(() => {
6184
+ }), Sr(() => {
6183
6185
  let e = () => {
6184
6186
  if (!L.value || !ce.value.length) {
6185
6187
  x.value = null;
@@ -6187,17 +6189,17 @@ function Os(e = {}) {
6187
6189
  }
6188
6190
  let e = null;
6189
6191
  try {
6190
- e = et(L.value, ce.value);
6192
+ e = $e(L.value, ce.value);
6191
6193
  } catch {
6192
6194
  return;
6193
6195
  }
6194
6196
  x.value !== e && (x.value = e);
6195
- }, t = () => window.requestAnimationFrame(e), n = us(L.value?.view.dom ?? null);
6196
- window.addEventListener("scroll", t, { passive: !0 }), window.addEventListener("resize", t), n?.addEventListener("scroll", t, { passive: !0 }), t(), Ae = () => {
6197
+ }, t = () => window.requestAnimationFrame(e), n = ls(L.value?.view.dom ?? null);
6198
+ window.addEventListener("scroll", t, { passive: !0 }), window.addEventListener("resize", t), n?.addEventListener("scroll", t, { passive: !0 }), t(), ke = () => {
6197
6199
  window.removeEventListener("scroll", t), window.removeEventListener("resize", t), n?.removeEventListener("scroll", t);
6198
6200
  };
6199
- }), wr(() => {
6200
- Ae?.(), I = !0, ee && e.onAiEditControllerChange?.(null), M && e.onCommandControllerChange?.(null);
6201
+ }), Cr(() => {
6202
+ ke?.(), I = !0, ee && e.onAiEditControllerChange?.(null), M && e.onCommandControllerChange?.(null);
6201
6203
  let t = j.value;
6202
6204
  j.value = null, q(() => t?.destroy());
6203
6205
  }), {
@@ -6230,7 +6232,7 @@ function Os(e = {}) {
6230
6232
  }
6231
6233
  };
6232
6234
  }
6233
- var ks = J({
6235
+ var Os = J({
6234
6236
  name: "MarkweaveEditor",
6235
6237
  props: {
6236
6238
  defaultContent: {
@@ -6285,6 +6287,10 @@ var ks = J({
6285
6287
  type: String,
6286
6288
  default: void 0
6287
6289
  },
6290
+ revealLinkMarkdown: {
6291
+ type: Boolean,
6292
+ default: !0
6293
+ },
6288
6294
  autoFocusFirstTableBodyCell: {
6289
6295
  type: Boolean,
6290
6296
  default: !1
@@ -6379,11 +6385,11 @@ var ks = J({
6379
6385
  }
6380
6386
  },
6381
6387
  setup(e) {
6382
- let t = Os(e);
6388
+ let t = Ds(e);
6383
6389
  return () => {
6384
6390
  let r = t.editor.value;
6385
6391
  if (!r) return null;
6386
- let i = t.__render, o = ["markweave-editor-frame", e.className].filter(Boolean).join(" "), s = je(e.canvasColor);
6392
+ let i = t.__render, o = ["markweave-editor-frame", e.className].filter(Boolean).join(" "), s = Ae(e.canvasColor);
6387
6393
  return U("section", {
6388
6394
  class: o,
6389
6395
  role: "combobox",
@@ -6394,21 +6400,21 @@ var ks = J({
6394
6400
  "aria-busy": i.slashState.value.name === "executing",
6395
6401
  "data-testid": "markweave-editor-frame",
6396
6402
  "data-markweave-mode": t.runtimeSnapshot.value.mode,
6397
- "data-markweave-theme": Me(e.theme),
6403
+ "data-markweave-theme": je(e.theme),
6398
6404
  style: s ? { "--markweave-canvas": s } : void 0,
6399
6405
  "data-markweave-inner-toc": e.innerToc ? "true" : "false",
6400
- "data-markweave-inner-toc-placement": it(e.innerTocPlacement),
6406
+ "data-markweave-inner-toc-placement": rt(e.innerTocPlacement),
6401
6407
  "data-mermaid-mode": t.runtimeSnapshot.value.mermaid.mode,
6402
6408
  "data-table-focus-mode": i.tableFocusState.value.mode,
6403
6409
  onKeydownCapture: i.handleEditorKeyDown
6404
6410
  }, [
6405
- i.effectiveEditable.value ? U(ys, {
6411
+ i.effectiveEditable.value ? U(vs, {
6406
6412
  editor: r,
6407
6413
  lang: n(e.lang),
6408
6414
  messages: i.messages,
6409
6415
  askAi: e.askAi
6410
6416
  }) : null,
6411
- i.effectiveEditable.value ? U(xs, {
6417
+ i.effectiveEditable.value ? U(bs, {
6412
6418
  commands: i.filteredSlashCommands.value,
6413
6419
  state: i.slashState.value,
6414
6420
  position: i.slashMenuPosition.value,
@@ -6419,7 +6425,7 @@ var ks = J({
6419
6425
  onInputCommandChange: i.setSlashInputCommand,
6420
6426
  onUpload: e.onSlashCommandUpload
6421
6427
  }) : null,
6422
- i.effectiveEditable.value ? U(ws, {
6428
+ i.effectiveEditable.value ? U(Cs, {
6423
6429
  editor: r,
6424
6430
  active: i.tableFocusState.value.active,
6425
6431
  interactionState: i.tableInteractionState.value,
@@ -6429,11 +6435,11 @@ var ks = J({
6429
6435
  onCommandResult: e.onTableCommandResult,
6430
6436
  onEditWithAi: e.onEditWithAi
6431
6437
  }) : null,
6432
- i.effectiveEditable.value ? U(Ts, {
6438
+ i.effectiveEditable.value ? U(ws, {
6433
6439
  editor: r,
6434
6440
  focusState: i.tableFocusState.value
6435
6441
  }) : null,
6436
- U(Es, {
6442
+ U(Ts, {
6437
6443
  editor: r,
6438
6444
  state: i.codeBlockState.value,
6439
6445
  active: i.effectiveEditable.value && i.isCodeBlockActive.value,
@@ -6441,14 +6447,14 @@ var ks = J({
6441
6447
  onMermaidModeChange: i.setMermaidMode,
6442
6448
  readOnly: !i.effectiveEditable.value
6443
6449
  }),
6444
- e.innerToc && i.tocState.value.items.length ? U(Ds, {
6450
+ e.innerToc && i.tocState.value.items.length ? U(Es, {
6445
6451
  editor: r,
6446
6452
  state: i.tocState.value,
6447
6453
  messages: i.messages,
6448
6454
  editable: i.effectiveEditable.value,
6449
- placement: it(e.innerTocPlacement)
6455
+ placement: rt(e.innerTocPlacement)
6450
6456
  }) : null,
6451
- i.effectiveEditable.value && i.mathTarget.value ? U(bs, {
6457
+ i.effectiveEditable.value && i.mathTarget.value ? U(ys, {
6452
6458
  editor: r,
6453
6459
  messages: i.messages,
6454
6460
  target: i.mathTarget.value,
@@ -6460,4 +6466,4 @@ var ks = J({
6460
6466
  }
6461
6467
  });
6462
6468
  //#endregion
6463
- export { ks as MarkweaveEditor, ne as createMarkweaveAiEditController, fa as createMarkweaveEditorExtensions, fa as createMarkweaveVue2EditorExtensions, Os as useMarkweaveEditorController };
6469
+ export { Os as MarkweaveEditor, ne as createMarkweaveAiEditController, da as createMarkweaveEditorExtensions, da as createMarkweaveVue2EditorExtensions, Ds as useMarkweaveEditorController };