@stll/folio-vue 0.4.0 → 0.6.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
@@ -1,26 +1,27 @@
1
- import { A as e, F as t, O as n, P as r, _ as i, d as a, f as o, g as s, j as c, k as l, m as u, p as d, u as f, y as p } from "./WatermarkDialog-D-uTab0-.js";
2
- import { D as m, O as h, T as g, a as _, b as v, f as y, i as b, n as x, p as ee, r as S, t as te, y as ne } from "./ListButtons-BaILr4AO.js";
3
- import { t as re } from "./zIndex-BY0qa8Au.js";
4
- import { a as ie, i as C, o as ae, r as oe, t as w } from "./useZoom-BR--m9w3.js";
5
- import { FindReplaceDialog as T, FootnotePropertiesDialog as se, HyperlinkDialog as ce, ImagePositionDialog as le, ImagePropertiesDialog as E, InsertImageDialog as D, InsertSymbolDialog as ue, InsertTableDialog as de, PageSetupDialog as fe, PasteSpecialDialog as O, SplitCellDialog as k, TablePropertiesDialog as A, WatermarkDialog as j } from "./dialogs.js";
6
- import { Fragment as M, Teleport as pe, computed as N, createApp as me, createBlock as P, createCommentVNode as F, createElementBlock as I, createElementVNode as L, createSlots as he, createStaticVNode as ge, createTextVNode as R, createVNode as z, defineComponent as B, h as _e, inject as ve, mergeProps as ye, nextTick as be, normalizeClass as V, normalizeStyle as H, onBeforeUnmount as xe, onMounted as Se, openBlock as U, provide as Ce, ref as W, renderList as G, renderSlot as we, shallowRef as Te, toDisplayString as K, unref as q, vModelText as Ee, watch as J, withCtx as De, withDirectives as Oe, withKeys as ke, withModifiers as Y } from "vue";
7
- import { createStyleResolver as Ae, extractSelectionState as je, getSelectedText as Me, insertImageFromFile as Ne, insertImageFromFile as Pe, insertPageBreakInView as X, insertPageBreakInView as Fe, insertTableInView as Ie, insertTableInView as Le, insertTableOfContentsInView as Re, insertTableOfContentsInView as ze } from "@stll/folio-core/prosemirror";
8
- import { extractSelectionContext as Be } from "@stll/folio-core/prosemirror/plugins/selectionTracker";
9
- import { inspectDocxCompatibility as Ve } from "@stll/folio-core/docx/compatibility";
10
- import { clearAllCaches as He, resetCanvasContext as Ue } from "@stll/folio-core/layout-bridge/engine/measuring";
11
- import { onFontsLoaded as We } from "@stll/folio-core/utils/fontLoader";
12
- import { twipsToPixels as Ge } from "@stll/folio-core/paged-layout/sectionGeometry";
13
- import { measureDirectiveGutter as Ke, projectRangesToRects as qe } from "@stll/folio-core/paged-layout/rangeProjection";
14
- import { prefersReducedMotionBehavior as Je } from "@stll/folio-core/paged-layout/scrollNavigation";
15
- import { anonymizationDecorationsKey as Ye, getAnonymizationMatches as Xe, getAnonymizationMatches as Ze, setAnonymizationTermsMeta as Qe, slugAnonymizationLabel as $e } from "@stll/folio-core/prosemirror/plugins/anonymizationDecorations";
16
- import { NodeSelection as Z, Selection as et, TextSelection as tt } from "prosemirror-state";
17
- import { pixelsToEmu as nt } from "@stll/folio-core/utils/units";
18
- import { IMAGE_LAYOUT_OPTIONS as rt, captureInlinePositionEmu as it, deriveLayoutChoice as at, findImageElement as ot, isImageLayoutOptionEnabled as st, toolbarValueToLayoutTarget as ct } from "@stll/folio-core/layout-painter/imageLayout";
19
- import { isTrackChangesMode as lt, toggledTrackChangesMode as ut } from "@stll/folio-core/managers/EditorModeManager";
20
- import { clickToPositionDom as dt } from "@stll/folio-core/layout-bridge/dom/clickToPositionDom";
21
- import { calculateResizedImageDimensions as ft, commitImageFloatMove as pt, commitImageInlineMove as mt, commitImageResize as ht, isFloatingImage as gt } from "@stll/folio-core/prosemirror/imageCommit";
22
- import { findBodyPmAnchor as _t, findBodyPmSpans as vt } from "@stll/folio-core/layout-bridge/dom/findBodyPmSpans";
23
- import { getTemplateDirectives as yt, getTemplateDirectives as bt, scanDirectives as xt } from "@stll/folio-core/prosemirror/plugins/templateDirectives";
1
+ import { A as e, F as t, O as n, P as r, _ as i, d as a, f as o, g as s, j as c, k as l, m as u, p as d, u as f, y as p } from "./WatermarkDialog-r4wmldt4.js";
2
+ import { D as m, E as h, d as g, f as _, i as v, n as y, r as b, t as x, v as ee, w as S, y as te } from "./ListButtons-DXqMvba3.js";
3
+ import { t as ne } from "./zIndex-BY0qa8Au.js";
4
+ import { a as re, i as ie, o as C, r as ae, t as oe } from "./useZoom-BxDANpqb.js";
5
+ import { FindReplaceDialog as w, FootnotePropertiesDialog as T, HyperlinkDialog as se, ImagePositionDialog as ce, ImagePropertiesDialog as le, InsertImageDialog as E, InsertSymbolDialog as D, InsertTableDialog as ue, PageSetupDialog as de, PasteSpecialDialog as fe, SplitCellDialog as O, TablePropertiesDialog as k, WatermarkDialog as A } from "./dialogs.js";
6
+ import { Fragment as j, Teleport as M, computed as N, createApp as pe, createBlock as P, createCommentVNode as F, createElementBlock as I, createElementVNode as L, createSlots as me, createStaticVNode as he, createTextVNode as ge, createVNode as R, defineComponent as z, h as B, inject as _e, mergeProps as ve, nextTick as ye, normalizeClass as V, normalizeStyle as H, onBeforeUnmount as be, onMounted as xe, openBlock as U, provide as Se, ref as W, renderList as G, renderSlot as Ce, shallowRef as we, toDisplayString as K, unref as q, vModelText as Te, watch as J, withCtx as Ee, withDirectives as De, withKeys as Oe, withModifiers as Y } from "vue";
7
+ import { createStyleResolver as ke, extractSelectionState as Ae, getSelectedText as je, insertImageFromFile as Me, insertImageFromFile as Ne, insertPageBreakInView as Pe, insertPageBreakInView as Fe, insertTableInView as X, insertTableInView as Ie, insertTableOfContentsInView as Le, insertTableOfContentsInView as Re } from "@stll/folio-core/prosemirror";
8
+ import { extractSelectionContext as ze } from "@stll/folio-core/prosemirror/plugins/selectionTracker";
9
+ import { inspectDocxCompatibility as Be } from "@stll/folio-core/docx/compatibility";
10
+ import { clearAllCaches as Ve, resetCanvasContext as He } from "@stll/folio-core/layout-bridge/engine/measuring";
11
+ import { onFontsLoaded as Ue } from "@stll/folio-core/utils/fontLoader";
12
+ import { twipsToPixels as We } from "@stll/folio-core/paged-layout/sectionGeometry";
13
+ import { measureDirectiveGutter as Ge, projectRangesToRects as Ke } from "@stll/folio-core/paged-layout/rangeProjection";
14
+ import { prefersReducedMotionBehavior as qe } from "@stll/folio-core/paged-layout/scrollNavigation";
15
+ import { anonymizationDecorationsKey as Je, getAnonymizationMatches as Ye, getAnonymizationMatches as Xe, setAnonymizationTermsMeta as Ze, slugAnonymizationLabel as Qe } from "@stll/folio-core/prosemirror/plugins/anonymizationDecorations";
16
+ import { NodeSelection as $e, Selection as et, TextSelection as Z } from "prosemirror-state";
17
+ import { pixelsToEmu as tt } from "@stll/folio-core/utils/units";
18
+ import { IMAGE_LAYOUT_OPTIONS as nt, captureInlinePositionEmu as rt, deriveLayoutChoice as it, findImageElement as at, isImageLayoutOptionEnabled as ot, toolbarValueToLayoutTarget as st } from "@stll/folio-core/layout-painter/imageLayout";
19
+ import { isTrackChangesMode as ct, toggledTrackChangesMode as lt } from "@stll/folio-core/managers/EditorModeManager";
20
+ import { clickToPositionDom as ut } from "@stll/folio-core/layout-bridge/dom/clickToPositionDom";
21
+ import { calculateResizedImageDimensions as dt, commitImageFloatMove as ft, commitImageInlineMove as pt, commitImageResize as mt, isFloatingImage as ht } from "@stll/folio-core/prosemirror/imageCommit";
22
+ import { findBodyPmAnchor as gt, findBodyPmSpans as _t } from "@stll/folio-core/layout-bridge/dom/findBodyPmSpans";
23
+ import { getTemplateDirectives as vt, getTemplateDirectives as yt, scanDirectives as bt } from "@stll/folio-core/prosemirror/plugins/templateDirectives";
24
+ import { closeHistory as xt } from "prosemirror-history";
24
25
  import { clearFormatting as St } from "@stll/folio-core/prosemirror/commands/formatting";
25
26
  import { getTableContext as Ct } from "@stll/folio-core/prosemirror/extensions/nodes/TableExtension";
26
27
  import { PENDING_COMMENT_ID as wt, createCommentIdAllocator as Tt, seedCommentAllocator as Et } from "@stll/folio-core/prosemirror/commentIdAllocator";
@@ -30,42 +31,42 @@ import { acceptAIEditRevision as kt, acceptChange as At, findAIEditRevisionRange
30
31
  import { makeRevisionInfo as Pt } from "@stll/folio-core/prosemirror/plugins/suggestionMode";
31
32
  import { setTemplatePreviewValues as Ft } from "@stll/folio-core/prosemirror/plugins/templatePreviewValues";
32
33
  import { clearTemplateSlashMenu as It, consumeTemplateSlashQuery as Lt, getTemplateSlashMenu as Rt, resetTemplateSlashQuery as Q, templateSlashMenuKey as zt } from "@stll/folio-core/prosemirror/plugins/templateSlashMenu";
33
- import { applyFolioAIEditOperations as $, applyFolioAIEditOperations as Bt, createFolioAIEditSnapshot as Vt, createFolioAIEditSnapshot as Ht, diffWordSegments as Ut, getCommentAnchorsFromDoc as Wt, getTrackedChangesFromDoc as Gt, hashFolioAIBlockText as Kt, normalizeFolioAIBlockText as qt } from "@stll/folio-core/ai-edits";
34
- import { findPageIndexContainingPmPos as Jt } from "@stll/folio-core/layout-engine";
35
- import { findParagraphFragmentsByParaId as Yt, flashParagraphElements as Xt } from "@stll/folio-core/paged-layout/paragraphFlash";
36
- import { blockSdtAttrsToSdtProperties as Zt, findBlockSdtMatch as Qt, findBlockSdtMatches as $t, removeContentControlTr as en, setContentControlContentTr as tn, setContentControlValueTr as nn } from "@stll/folio-core/prosemirror/commands/contentControls";
37
- import { setContentControlContentBlocksTr as rn } from "@stll/folio-core/prosemirror/commands/contentControlsBlockFill";
38
- import { createFolioAIEditSnapshot as an } from "@stll/folio-core/ai-edits/snapshot";
39
- import { findParagraphByParaId as on } from "@stll/folio-core/prosemirror/utils/findParagraphByParaId";
40
- import { deriveBlockId as sn, getFolioParaIdFromBlockId as cn, getFolioParaIdFromBlockId as ln, getSequentialFolioBlockIdIndex as un, isFolioBlockId as dn, isSequentialFolioBlockId as fn } from "@stll/folio-core/types/block-id";
41
- import { applyStyle as pn, removeTabStop as mn, setIndentFirstLine as hn, setIndentLeft as gn, setIndentRight as _n } from "@stll/folio-core/prosemirror/commands/paragraph";
42
- import { getCachedNumberingMap as vn } from "@stll/folio-core/docx";
43
- import { insertPageBreak as yn } from "@stll/folio-core/prosemirror/commands/pageBreak";
44
- import { insertSectionBreakContinuous as bn, insertSectionBreakNextPage as xn } from "@stll/folio-core/prosemirror/commands/sectionBreak";
45
- import { editHyperlinkAtCursor as Sn, removeHyperlinkAtCursor as Cn } from "@stll/folio-core/prosemirror/commands/hyperlink";
46
- import { collectHeadings as wn } from "@stll/folio-core/utils/headingCollector";
47
- import { TABLE_INSERT_HIDE_DELAY_MS as Tn, detectTableInsertHover as En } from "@stll/folio-core/layout-bridge/tableInsertHover";
48
- import { createCellDragTracker as Dn, findCellPosFromPmPos as On } from "@stll/folio-core/prosemirror/cellDragSelection";
49
- import { getDocumentWatermark as kn, setDocumentWatermark as An } from "@stll/folio-core/watermark";
50
- import { createEmptyDocument as jn } from "@stll/folio-core/utils/createDocument";
51
- import { createDocx as Mn } from "@stll/folio-core/docx/rezip";
52
- import { DEFAULT_AI_SUGGESTION_PRESETS as Nn } from "@stll/folio-core/ai-suggestions/types";
53
- import { applySuggestions as Pn } from "@stll/folio-core/ai-suggestions/apply";
54
- import { isSuggestionStale as Fn, resolveSuggestionAnchor as In } from "@stll/folio-core/ai-suggestions/conflict";
55
- import { buildPositionalText as Ln } from "@stll/folio-core/ai-suggestions/text-positions";
56
- import { setAISuggestionsMeta as Rn, setFocusedSuggestionMeta as zn } from "@stll/folio-core/prosemirror/plugins/aiSuggestionDecorations";
57
- import { scrollFolioPositionIntoView as Bn } from "@stll/folio-core/paged-layout/scrollToPmPosition";
58
- import { getFolioCaretViewportRect as Vn, getFolioSelectionViewportRect as Hn } from "@stll/folio-core/paged-layout/selectionViewportRect";
59
- import { createAICitationDecorationsPlugin as Un, setAICitationsMeta as Wn, setActiveCitationMeta as Gn } from "@stll/folio-core/prosemirror/plugins/aiCitationDecorations";
60
- import { DEFAULT_AUTOCOMPLETE_DEAD_ZONE_NODES as Kn, acceptAutocompleteSuggestion as qn, acceptAutocompleteWord as Jn, appendAutocompleteToken as Yn, autocompleteSuggestionKey as Xn, autocompleteSuggestionPlugin as Zn, clearAutocompleteSuggestion as Qn, finishAutocompleteSuggestion as $n, getAutocompleteSuggestion as er, shouldTriggerAutocomplete as tr, startAutocompleteSuggestion as nr } from "@stll/folio-core/prosemirror/plugins/autocompleteSuggestion";
61
- import { fromMarkdown as rr, toMarkdown as ir, toMarkdownResult as ar } from "@stll/folio-core/markdown";
34
+ import { FOLIO_DOCUMENT_OPERATION_CONTRACT_VERSION as $, applyFolioAIEditOperations as Bt, applyFolioAIEditOperations as Vt, applyFolioDocumentOperations as Ht, assertSupportedFolioDocumentOperationVersion as Ut, createFolioAIEditSnapshot as Wt, createFolioAIEditSnapshot as Gt, diffWordSegments as Kt, getCommentAnchorsFromDoc as qt, getFolioDocumentOperationIssues as Jt, getTrackedChangesFromDoc as Yt, hashFolioAIBlockText as Xt, normalizeFolioAIBlockText as Zt } from "@stll/folio-core/ai-edits";
35
+ import { findPageIndexContainingPmPos as Qt } from "@stll/folio-core/layout-engine";
36
+ import { findParagraphFragmentsByParaId as $t, flashParagraphElements as en } from "@stll/folio-core/paged-layout/paragraphFlash";
37
+ import { blockSdtAttrsToSdtProperties as tn, findBlockSdtMatch as nn, findBlockSdtMatches as rn, removeContentControlTr as an, setContentControlContentTr as on, setContentControlValueTr as sn } from "@stll/folio-core/prosemirror/commands/contentControls";
38
+ import { setContentControlContentBlocksTr as cn } from "@stll/folio-core/prosemirror/commands/contentControlsBlockFill";
39
+ import { clampRangeToDocSize as ln, resolveFolioAIBlockRange as un } from "@stll/folio-core/ai-edits/blockRange";
40
+ import { getPageTextFromLayout as dn } from "@stll/folio-core/paged-layout/pageText";
41
+ import { applyStyle as fn, removeTabStop as pn, setIndentFirstLine as mn, setIndentLeft as hn, setIndentRight as gn } from "@stll/folio-core/prosemirror/commands/paragraph";
42
+ import { getCachedNumberingMap as _n } from "@stll/folio-core/docx";
43
+ import { insertPageBreak as vn } from "@stll/folio-core/prosemirror/commands/pageBreak";
44
+ import { insertSectionBreakContinuous as yn, insertSectionBreakNextPage as bn } from "@stll/folio-core/prosemirror/commands/sectionBreak";
45
+ import { editHyperlinkAtCursor as xn, removeHyperlinkAtCursor as Sn } from "@stll/folio-core/prosemirror/commands/hyperlink";
46
+ import { collectHeadings as Cn } from "@stll/folio-core/utils/headingCollector";
47
+ import { TABLE_INSERT_HIDE_DELAY_MS as wn, detectTableInsertHover as Tn } from "@stll/folio-core/layout-bridge/tableInsertHover";
48
+ import { createCellDragTracker as En, findCellPosFromPmPos as Dn } from "@stll/folio-core/prosemirror/cellDragSelection";
49
+ import { getDocumentWatermark as On, setDocumentWatermark as kn } from "@stll/folio-core/watermark";
50
+ import { createEmptyDocument as An } from "@stll/folio-core/utils/createDocument";
51
+ import { createDocx as jn } from "@stll/folio-core/docx/rezip";
52
+ import { deriveBlockId as Mn, getFolioParaIdFromBlockId as Nn, isFolioBlockId as Pn, isSequentialFolioBlockId as Fn } from "@stll/folio-core/types/block-id";
53
+ import { DEFAULT_AI_SUGGESTION_PRESETS as In } from "@stll/folio-core/ai-suggestions/types";
54
+ import { applySuggestions as Ln } from "@stll/folio-core/ai-suggestions/apply";
55
+ import { isSuggestionStale as Rn, resolveSuggestionAnchor as zn } from "@stll/folio-core/ai-suggestions/conflict";
56
+ import { buildPositionalText as Bn } from "@stll/folio-core/ai-suggestions/text-positions";
57
+ import { setAISuggestionsMeta as Vn, setFocusedSuggestionMeta as Hn } from "@stll/folio-core/prosemirror/plugins/aiSuggestionDecorations";
58
+ import { scrollFolioPositionIntoView as Un } from "@stll/folio-core/paged-layout/scrollToPmPosition";
59
+ import { getFolioCaretViewportRect as Wn, getFolioSelectionViewportRect as Gn } from "@stll/folio-core/paged-layout/selectionViewportRect";
60
+ import { createAICitationDecorationsPlugin as Kn, setAICitationsMeta as qn, setActiveCitationMeta as Jn } from "@stll/folio-core/prosemirror/plugins/aiCitationDecorations";
61
+ import { DEFAULT_AUTOCOMPLETE_DEAD_ZONE_NODES as Yn, acceptAutocompleteSuggestion as Xn, acceptAutocompleteWord as Zn, appendAutocompleteToken as Qn, autocompleteSuggestionKey as $n, autocompleteSuggestionPlugin as er, clearAutocompleteSuggestion as tr, finishAutocompleteSuggestion as nr, getAutocompleteSuggestion as rr, shouldTriggerAutocomplete as ir, startAutocompleteSuggestion as ar } from "@stll/folio-core/prosemirror/plugins/autocompleteSuggestion";
62
+ import { fromMarkdown as or, toMarkdown as sr, toMarkdownResult as cr } from "@stll/folio-core/markdown";
62
63
  //#region src/components/AnonymizationRectsOverlay.vue?vue&type=script&setup=true&lang.ts
63
- var or = [
64
+ var lr = [
64
65
  "data-folio-anonymization-label",
65
66
  "data-folio-anonymization-canonical",
66
67
  "data-folio-anonymization-selected",
67
68
  "title"
68
- ], sr = /*#__PURE__*/ t(/* @__PURE__ */ B({
69
+ ], ur = /*#__PURE__*/ t(/* @__PURE__ */ z({
69
70
  __name: "AnonymizationRectsOverlay",
70
71
  props: {
71
72
  getView: { type: Function },
@@ -92,12 +93,12 @@ var or = [
92
93
  r.value = [];
93
94
  return;
94
95
  }
95
- let s = Ze(o);
96
+ let s = Xe(o);
96
97
  if (s.length === 0) {
97
98
  r.value = [];
98
99
  return;
99
100
  }
100
- let c = await qe(s, {
101
+ let c = await Ke(s, {
101
102
  pagesContainer: a,
102
103
  zoom: t.zoom,
103
104
  layout: t.layout,
@@ -139,7 +140,7 @@ var or = [
139
140
  index: a
140
141
  }, i.item(a)?.scrollIntoView({
141
142
  block: "center",
142
- behavior: Je()
143
+ behavior: qe()
143
144
  });
144
145
  }
145
146
  J(() => [t.selectedCanonical, t.selectionSeq], () => l(), { flush: "post" });
@@ -159,18 +160,18 @@ var or = [
159
160
  }
160
161
  }
161
162
  }
162
- return Se(() => {
163
+ return xe(() => {
163
164
  document.addEventListener("click", u), o();
164
- }), xe(() => {
165
+ }), be(() => {
165
166
  document.removeEventListener("click", u), a !== null && (cancelAnimationFrame(a), a = null);
166
167
  }), (t, i) => (U(), I("div", {
167
168
  ref_key: "rootRef",
168
169
  ref: n,
169
170
  class: "folio-anonymization-overlay",
170
171
  "data-folio-anonymization-overlay": ""
171
- }, [(U(!0), I(M, null, G(r.value, (t) => (U(), I(M, { key: `${t.label}:${t.canonical}` }, [(U(!0), I(M, null, G(t.rects, (n, r) => (U(), I("span", {
172
+ }, [(U(!0), I(j, null, G(r.value, (t) => (U(), I(j, { key: `${t.label}:${t.canonical}` }, [(U(!0), I(j, null, G(t.rects, (n, r) => (U(), I("span", {
172
173
  key: `${t.canonical}:${r}:${n.left}:${n.top}`,
173
- class: V(["folio-anonymization-term", `folio-anonymization-term--${q($e)(t.label)}`]),
174
+ class: V(["folio-anonymization-term", `folio-anonymization-term--${q(Qe)(t.label)}`]),
174
175
  "data-folio-anonymization-label": t.label,
175
176
  "data-folio-anonymization-canonical": t.canonical,
176
177
  "data-folio-anonymization-selected": t.canonical === e.selectedCanonical ? "true" : void 0,
@@ -182,12 +183,12 @@ var or = [
182
183
  width: `${n.width}px`,
183
184
  height: `${n.height}px`
184
185
  })
185
- }, null, 14, or))), 128))], 64))), 128))], 512));
186
+ }, null, 14, lr))), 128))], 64))), 128))], 512));
186
187
  }
187
- }), [["__scopeId", "data-v-c7db88e1"]]), cr = { class: "doc-outline__header" }, lr = { class: "doc-outline__body" }, ur = {
188
+ }), [["__scopeId", "data-v-c7db88e1"]]), dr = { class: "doc-outline__header" }, fr = { class: "doc-outline__body" }, pr = {
188
189
  key: 0,
189
190
  class: "doc-outline__empty"
190
- }, dr = /*#__PURE__*/ t(/* @__PURE__ */ B({
191
+ }, mr = /*#__PURE__*/ t(/* @__PURE__ */ z({
191
192
  __name: "DocumentOutline",
192
193
  props: {
193
194
  isOpen: { type: Boolean },
@@ -216,15 +217,15 @@ var or = [
216
217
  role: "navigation",
217
218
  "aria-label": "Document outline",
218
219
  onMousedown: n[1] ||= Y(() => {}, ["stop"])
219
- }, [L("div", cr, [L("button", {
220
+ }, [L("div", dr, [L("button", {
220
221
  class: "doc-outline__back",
221
222
  title: "Close outline",
222
223
  "aria-label": "Close outline",
223
224
  onClick: n[0] ||= (e) => t.$emit("close")
224
- }, [z(r, {
225
+ }, [R(r, {
225
226
  name: "arrow_back",
226
227
  size: 20
227
- })]), n[2] ||= L("span", { class: "doc-outline__title" }, "Document Outline", -1)]), L("div", lr, [e.headings.length === 0 ? (U(), I("div", ur, "No headings found")) : (U(), P(q(i), {
228
+ })]), n[2] ||= L("span", { class: "doc-outline__title" }, "Document Outline", -1)]), L("div", fr, [e.headings.length === 0 ? (U(), I("div", pr, "No headings found")) : (U(), P(q(i), {
228
229
  key: 1,
229
230
  items: o.value,
230
231
  "get-scroll-container": e.getScrollContainer ?? (() => null),
@@ -232,7 +233,7 @@ var or = [
232
233
  "aria-label": "Document outline"
233
234
  }, null, 8, ["items", "get-scroll-container"]))])], 36)) : F("", !0);
234
235
  }
235
- }), [["__scopeId", "data-v-92482e57"]]), fr = /* @__PURE__ */ B({
236
+ }), [["__scopeId", "data-v-0797b3b1"]]), hr = /* @__PURE__ */ z({
236
237
  __name: "DocxEditorDialogs",
237
238
  props: {
238
239
  view: {},
@@ -258,13 +259,13 @@ var or = [
258
259
  ],
259
260
  setup(e, { emit: t }) {
260
261
  let n = t;
261
- return (t, r) => (U(), I(M, null, [
262
- z(u, {
262
+ return (t, r) => (U(), I(j, null, [
263
+ R(u, {
263
264
  "is-open": e.showFindReplace,
264
265
  view: e.view,
265
266
  onClose: r[0] ||= (e) => n("update:showFindReplace", !1)
266
267
  }, null, 8, ["is-open", "view"]),
267
- z(d, {
268
+ R(d, {
268
269
  "is-open": e.showHyperlink,
269
270
  view: e.view,
270
271
  bookmarks: e.bookmarks,
@@ -276,12 +277,12 @@ var or = [
276
277
  "view",
277
278
  "bookmarks"
278
279
  ]),
279
- z(a, {
280
+ R(a, {
280
281
  "is-open": e.showInsertSymbol,
281
282
  onClose: r[4] ||= (e) => n("update:showInsertSymbol", !1),
282
283
  onInsert: r[5] ||= (e) => n("insert-symbol", e)
283
284
  }, null, 8, ["is-open"]),
284
- z(o, {
285
+ R(o, {
285
286
  "is-open": e.showImageProperties,
286
287
  view: e.view,
287
288
  "pm-pos": e.selectedImagePmPos,
@@ -291,7 +292,7 @@ var or = [
291
292
  "view",
292
293
  "pm-pos"
293
294
  ]),
294
- z(f, {
295
+ R(f, {
295
296
  "is-open": e.showPageSetup,
296
297
  "section-properties": e.sectionProperties,
297
298
  onClose: r[7] ||= (e) => n("update:showPageSetup", !1),
@@ -299,10 +300,10 @@ var or = [
299
300
  }, null, 8, ["is-open", "section-properties"])
300
301
  ], 64));
301
302
  }
302
- }), pr = {
303
+ }), gr = {
303
304
  key: 0,
304
305
  class: "docx-editor-vue__title-bar"
305
- }, mr = { class: "docx-editor-vue__title-bar-left" }, hr = { class: "docx-editor-vue__title-bar-center" }, gr = { class: "docx-editor-vue__title-bar-right" }, _r = /* @__PURE__ */ B({
306
+ }, _r = { class: "docx-editor-vue__title-bar-left" }, vr = { class: "docx-editor-vue__title-bar-center" }, yr = { class: "docx-editor-vue__title-bar-right" }, br = /* @__PURE__ */ z({
306
307
  __name: "DocxEditorMenuBar",
307
308
  props: {
308
309
  showMenuBar: {
@@ -334,13 +335,13 @@ var or = [
334
335
  ],
335
336
  setup(e, { emit: t }) {
336
337
  let n = t;
337
- return (t, r) => e.showMenuBar ? (U(), I("div", pr, [
338
- L("div", mr, [we(t.$slots, "title-bar-left")]),
339
- L("div", hr, [z(m, {
338
+ return (t, r) => e.showMenuBar ? (U(), I("div", gr, [
339
+ L("div", _r, [Ce(t.$slots, "title-bar-left")]),
340
+ L("div", vr, [R(h, {
340
341
  "model-value": e.documentName,
341
342
  editable: e.documentNameEditable,
342
343
  "onUpdate:modelValue": r[0] ||= (e) => n("rename", e)
343
- }, null, 8, ["model-value", "editable"]), z(g, {
344
+ }, null, 8, ["model-value", "editable"]), R(S, {
344
345
  "show-file-open": e.showFileOpen,
345
346
  "show-help-menu": e.showHelpMenu,
346
347
  "show-table-insert": e.showTableInsert,
@@ -351,40 +352,40 @@ var or = [
351
352
  "show-help-menu",
352
353
  "show-table-insert"
353
354
  ])]),
354
- L("div", gr, [we(t.$slots, "title-bar-right")])
355
+ L("div", yr, [Ce(t.$slots, "title-bar-right")])
355
356
  ])) : F("", !0);
356
357
  }
357
- }), vr = Symbol("docx-portal-class");
358
- function yr(e) {
359
- Ce(vr, N(() => ({
358
+ }), xr = Symbol("docx-portal-class");
359
+ function Sr(e) {
360
+ Se(xr, N(() => ({
360
361
  "ep-root": !0,
361
362
  dark: !!q(e)
362
363
  })));
363
364
  }
364
- function br() {
365
- return ve(vr, N(() => ({ "ep-root": !0 })));
365
+ function Cr() {
366
+ return _e(xr, N(() => ({ "ep-root": !0 })));
366
367
  }
367
368
  //#endregion
368
369
  //#region src/components/ImageContextMenu.vue?vue&type=script&setup=true&lang.ts
369
- var xr = ["aria-label"], Sr = { class: "image-ctx-menu__icon" }, Cr = { class: "image-ctx-menu__label" }, wr = {
370
+ var wr = ["aria-label"], Tr = { class: "image-ctx-menu__icon" }, Er = { class: "image-ctx-menu__label" }, Dr = {
370
371
  key: 1,
371
372
  class: "image-ctx-menu__divider",
372
373
  role: "separator"
373
- }, Tr = [
374
+ }, Or = [
374
375
  "data-wrap-type",
375
376
  "data-current",
376
377
  "data-disabled",
377
378
  "disabled",
378
379
  "title",
379
380
  "onClick"
380
- ], Er = { class: "image-ctx-menu__icon" }, Dr = { class: "image-ctx-menu__label" }, Or = ["aria-label"], kr = ["disabled", "onClick"], Ar = { class: "image-ctx-menu__label" }, jr = {
381
+ ], kr = { class: "image-ctx-menu__icon" }, Ar = { class: "image-ctx-menu__label" }, jr = ["aria-label"], Mr = ["disabled", "onClick"], Nr = { class: "image-ctx-menu__label" }, Pr = {
381
382
  key: 0,
382
383
  class: "image-ctx-menu__shortcut"
383
- }, Mr = {
384
+ }, Fr = {
384
385
  key: 0,
385
386
  class: "image-ctx-menu__divider",
386
387
  role: "separator"
387
- }, Nr = 18, Pr = 260, Fr = 10, Ir = /*#__PURE__*/ t(/* @__PURE__ */ B({
388
+ }, Ir = 18, Lr = 260, Rr = 10, zr = /*#__PURE__*/ t(/* @__PURE__ */ z({
388
389
  __name: "ImageContextMenu",
389
390
  props: {
390
391
  state: {},
@@ -405,7 +406,7 @@ var xr = ["aria-label"], Sr = { class: "image-ctx-menu__icon" }, Cr = { class: "
405
406
  function a() {
406
407
  i("open-properties"), i("close");
407
408
  }
408
- let { t: o } = c(), s = br(), l = rt, u = N(() => n.state ? at(n.state.currentWrapType, n.state.currentCssFloat ?? null) : null), d = {
409
+ let { t: o } = c(), s = Cr(), l = nt, u = N(() => n.state ? it(n.state.currentWrapType, n.state.currentCssFloat ?? null) : null), d = {
409
410
  inline: "wrap_text",
410
411
  squareLeft: "format_image_left",
411
412
  squareRight: "format_image_right",
@@ -417,17 +418,17 @@ var xr = ["aria-label"], Sr = { class: "image-ctx-menu__icon" }, Cr = { class: "
417
418
  }
418
419
  let p = N(() => {
419
420
  if (!n.state) return {};
420
- let e = rt.length * 36 + 16, t = n.state.position.x, r = n.state.position.y;
421
- return typeof window < "u" && (t + Pr > window.innerWidth && (t = window.innerWidth - Pr - Fr), r + e > window.innerHeight && (r = window.innerHeight - e - Fr), t < Fr && (t = Fr), r < Fr && (r = Fr)), {
421
+ let e = nt.length * 36 + 16, t = n.state.position.x, r = n.state.position.y;
422
+ return typeof window < "u" && (t + Lr > window.innerWidth && (t = window.innerWidth - Lr - Rr), r + e > window.innerHeight && (r = window.innerHeight - e - Rr), t < Rr && (t = Rr), r < Rr && (r = Rr)), {
422
423
  position: "fixed",
423
424
  left: `${t}px`,
424
425
  top: `${r}px`,
425
- minWidth: `${Pr}px`,
426
+ minWidth: `${Lr}px`,
426
427
  zIndex: 400
427
428
  };
428
429
  });
429
430
  function m(e) {
430
- return n.state ? st(e, n.state.currentWrapType) : !1;
431
+ return n.state ? ot(e, n.state.currentWrapType) : !1;
431
432
  }
432
433
  function h(e) {
433
434
  m(e) && (i("select", e.choice), i("close"));
@@ -441,7 +442,7 @@ var xr = ["aria-label"], Sr = { class: "image-ctx-menu__icon" }, Cr = { class: "
441
442
  function v(e) {
442
443
  e.key === "Escape" && (e.preventDefault(), i("close"));
443
444
  }
444
- return (t, n) => (U(), P(pe, { to: "body" }, [e.state && e.state.open ? (U(), I("div", {
445
+ return (t, n) => (U(), P(M, { to: "body" }, [e.state && e.state.open ? (U(), I("div", {
445
446
  key: 0,
446
447
  class: "image-ctx-menu-backdrop",
447
448
  onMousedown: _,
@@ -464,12 +465,12 @@ var xr = ["aria-label"], Sr = { class: "image-ctx-menu__icon" }, Cr = { class: "
464
465
  "data-action": "open-properties",
465
466
  onMousedown: n[1] ||= Y(() => {}, ["prevent"]),
466
467
  onClick: a
467
- }, [L("span", Sr, [z(r, {
468
+ }, [L("span", Tr, [R(r, {
468
469
  name: "settings",
469
- size: Nr
470
- })]), L("span", Cr, K(q(o)("imageWrap.menu.imageProperties")), 1)], 32)) : F("", !0),
471
- e.canOpenProperties ? (U(), I("div", wr)) : F("", !0),
472
- (U(!0), I(M, null, G(q(l), (e) => (U(), I("button", {
470
+ size: Ir
471
+ })]), L("span", Er, K(q(o)("imageWrap.menu.imageProperties")), 1)], 32)) : F("", !0),
472
+ e.canOpenProperties ? (U(), I("div", Dr)) : F("", !0),
473
+ (U(!0), I(j, null, G(q(l), (e) => (U(), I("button", {
473
474
  key: e.choice,
474
475
  type: "button",
475
476
  role: "menuitem",
@@ -482,37 +483,37 @@ var xr = ["aria-label"], Sr = { class: "image-ctx-menu__icon" }, Cr = { class: "
482
483
  onMousedown: n[2] ||= Y(() => {}, ["prevent"]),
483
484
  onClick: (t) => h(e)
484
485
  }, [
485
- L("span", Er, [z(r, {
486
+ L("span", kr, [R(r, {
486
487
  name: f(e.iconHint),
487
- size: Nr
488
+ size: Ir
488
489
  }, null, 8, ["name"])]),
489
- L("span", Dr, K(q(o)(`imageWrap.menu.${e.i18nLabelKey}`)), 1),
490
+ L("span", Ar, K(q(o)(`imageWrap.menu.${e.i18nLabelKey}`)), 1),
490
491
  e.choice === u.value ? (U(), I("span", {
491
492
  key: 0,
492
493
  class: "image-ctx-menu__current-dot",
493
494
  "aria-label": q(o)("imageWrap.menu.ariaLabel")
494
- }, "●", 8, Or)) : F("", !0)
495
- ], 42, Tr))), 128)),
496
- e.textActions && e.textActions.length > 0 ? (U(), I(M, { key: 2 }, [n[5] ||= L("div", {
495
+ }, "●", 8, jr)) : F("", !0)
496
+ ], 42, Or))), 128)),
497
+ e.textActions && e.textActions.length > 0 ? (U(), I(j, { key: 2 }, [n[5] ||= L("div", {
497
498
  class: "image-ctx-menu__divider",
498
499
  role: "separator"
499
- }, null, -1), (U(!0), I(M, null, G(e.textActions, (e, t) => (U(), I(M, { key: `${e.action}-${t}` }, [L("button", {
500
+ }, null, -1), (U(!0), I(j, null, G(e.textActions, (e, t) => (U(), I(j, { key: `${e.action}-${t}` }, [L("button", {
500
501
  type: "button",
501
502
  role: "menuitem",
502
503
  class: "image-ctx-menu__item image-ctx-menu__item--text",
503
504
  disabled: e.disabled,
504
505
  onMousedown: n[3] ||= Y(() => {}, ["prevent"]),
505
506
  onClick: (t) => g(e)
506
- }, [L("span", Ar, K(e.label), 1), e.shortcut ? (U(), I("span", jr, K(e.shortcut), 1)) : F("", !0)], 40, kr), e.dividerAfter ? (U(), I("div", Mr)) : F("", !0)], 64))), 128))], 64)) : F("", !0)
507
- ], 46, xr)) : F("", !0)]));
507
+ }, [L("span", Nr, K(e.label), 1), e.shortcut ? (U(), I("span", Pr, K(e.shortcut), 1)) : F("", !0)], 40, Mr), e.dividerAfter ? (U(), I("div", Fr)) : F("", !0)], 64))), 128))], 64)) : F("", !0)
508
+ ], 46, wr)) : F("", !0)]));
508
509
  }
509
- }), [["__scopeId", "data-v-37e33eb5"]]), Lr = ["disabled", "onMousedown"], Rr = {
510
+ }), [["__scopeId", "data-v-fc8f35bc"]]), Br = ["disabled", "onMousedown"], Vr = {
510
511
  key: 0,
511
512
  class: "ctx-menu__icon"
512
- }, zr = { class: "ctx-menu__label" }, Br = {
513
+ }, Hr = { class: "ctx-menu__label" }, Ur = {
513
514
  key: 1,
514
515
  class: "ctx-menu__shortcut"
515
- }, Vr = 220, Hr = 32, Ur = 10, Wr = /*#__PURE__*/ t(/* @__PURE__ */ B({
516
+ }, Wr = 220, Gr = 32, Kr = 10, qr = /*#__PURE__*/ t(/* @__PURE__ */ z({
516
517
  __name: "TextContextMenu",
517
518
  props: {
518
519
  isOpen: { type: Boolean },
@@ -529,7 +530,7 @@ var xr = ["aria-label"], Sr = { class: "image-ctx-menu__icon" }, Cr = { class: "
529
530
  setup(e, { emit: t }) {
530
531
  let n = e, r = ({ node: e }) => e;
531
532
  r.props = ["node"];
532
- let i = t, { t: a } = c(), o = br(), s = W(null), l = N(() => {
533
+ let i = t, { t: a } = c(), o = Cr(), s = W(null), l = N(() => {
533
534
  let e = [], t = n.customItems ?? [];
534
535
  for (let [n, r] of t.entries()) e.push({
535
536
  id: `custom-${r.id}`,
@@ -665,8 +666,8 @@ var xr = ["aria-label"], Sr = { class: "image-ctx-menu__icon" }, Cr = { class: "
665
666
  action: "deleteTable"
666
667
  }), e;
667
668
  }), u = N(() => {
668
- let e = n.position.x, t = n.position.y, r = l.value.filter((e) => !e.divider).length, i = l.value.filter((e) => e.divider).length, a = r * Hr + i * 9;
669
- return typeof window < "u" && (e + Vr + Ur > window.innerWidth && (e = window.innerWidth - Vr - Ur), t + a + Ur > window.innerHeight && (t = window.innerHeight - a - Ur)), {
669
+ let e = n.position.x, t = n.position.y, r = l.value.filter((e) => !e.divider).length, i = l.value.filter((e) => e.divider).length, a = r * Gr + i * 9;
670
+ return typeof window < "u" && (e + Wr + Kr > window.innerWidth && (e = window.innerWidth - Wr - Kr), t + a + Kr > window.innerHeight && (t = window.innerHeight - a - Kr)), {
670
671
  position: "fixed",
671
672
  left: `${e}px`,
672
673
  top: `${t}px`,
@@ -680,8 +681,8 @@ var xr = ["aria-label"], Sr = { class: "image-ctx-menu__icon" }, Cr = { class: "
680
681
  e.key === "Escape" && i("close");
681
682
  }
682
683
  return J(() => n.isOpen, (e) => {
683
- e && be(() => s.value?.focus());
684
- }), (t, n) => (U(), P(pe, { to: "body" }, [e.isOpen ? (U(), I("div", {
684
+ e && ye(() => s.value?.focus());
685
+ }), (t, n) => (U(), P(M, { to: "body" }, [e.isOpen ? (U(), I("div", {
685
686
  key: 0,
686
687
  class: "ctx-menu-backdrop",
687
688
  onMousedown: n[0] ||= (e) => t.$emit("close"),
@@ -694,7 +695,7 @@ var xr = ["aria-label"], Sr = { class: "image-ctx-menu__icon" }, Cr = { class: "
694
695
  style: H(u.value),
695
696
  onContextmenu: n[2] ||= Y(() => {}, ["prevent"]),
696
697
  onKeydown: f
697
- }, [(U(!0), I(M, null, G(l.value, (e, t) => (U(), I("button", {
698
+ }, [(U(!0), I(j, null, G(l.value, (e, t) => (U(), I("button", {
698
699
  key: e.id || t,
699
700
  class: V(["ctx-menu__item", {
700
701
  "ctx-menu__item--disabled": e.disabled,
@@ -704,12 +705,12 @@ var xr = ["aria-label"], Sr = { class: "image-ctx-menu__icon" }, Cr = { class: "
704
705
  disabled: e.disabled,
705
706
  onMousedown: Y((t) => d(e.action), ["prevent"])
706
707
  }, [
707
- e.icon ? (U(), I("span", Rr, [z(r, { node: e.icon }, null, 8, ["node"])])) : F("", !0),
708
- L("span", zr, K(e.label), 1),
709
- e.shortcut ? (U(), I("span", Br, K(e.shortcut), 1)) : F("", !0)
710
- ], 42, Lr))), 128))], 38)) : F("", !0)]));
708
+ e.icon ? (U(), I("span", Vr, [R(r, { node: e.icon }, null, 8, ["node"])])) : F("", !0),
709
+ L("span", Hr, K(e.label), 1),
710
+ e.shortcut ? (U(), I("span", Ur, K(e.shortcut), 1)) : F("", !0)
711
+ ], 42, Br))), 128))], 38)) : F("", !0)]));
711
712
  }
712
- }), [["__scopeId", "data-v-f7db4540"]]), Gr = /* @__PURE__ */ B({
713
+ }), [["__scopeId", "data-v-c1416e84"]]), Jr = /* @__PURE__ */ z({
713
714
  __name: "DocxEditorOverlays",
714
715
  props: {
715
716
  readOnly: { type: Boolean },
@@ -728,7 +729,7 @@ var xr = ["aria-label"], Sr = { class: "image-ctx-menu__icon" }, Cr = { class: "
728
729
  ],
729
730
  setup(e, { emit: t }) {
730
731
  let n = t;
731
- return (t, r) => (U(), I(M, null, [z(Wr, {
732
+ return (t, r) => (U(), I(j, null, [R(qr, {
732
733
  "is-open": e.contextMenu.isOpen,
733
734
  position: e.contextMenu.position,
734
735
  "has-selection": e.contextMenu.hasSelection,
@@ -750,7 +751,7 @@ var xr = ["aria-label"], Sr = { class: "image-ctx-menu__icon" }, Cr = { class: "
750
751
  "can-merge-cells",
751
752
  "can-split-cell",
752
753
  "custom-items"
753
- ]), z(Ir, {
754
+ ]), R(zr, {
754
755
  state: e.imageContextMenu,
755
756
  "text-actions": e.imageContextMenuTextActions,
756
757
  "can-open-properties": e.canOpenImageProperties,
@@ -767,7 +768,7 @@ var xr = ["aria-label"], Sr = { class: "image-ctx-menu__icon" }, Cr = { class: "
767
768
  });
768
769
  //#endregion
769
770
  //#region src/composables/imageOverlayRect.ts
770
- function Kr(e) {
771
+ function Yr(e) {
771
772
  let t = Math.max(0, e.parentOffsetWidth - e.parentClientWidth) / 2, n = e.zoom || 1;
772
773
  return {
773
774
  left: (e.imageRect.left - e.parentRect.left - t + e.scrollLeft) / n,
@@ -778,13 +779,13 @@ function Kr(e) {
778
779
  }
779
780
  //#endregion
780
781
  //#region src/components/ImageSelectionOverlay.vue?vue&type=script&setup=true&lang.ts
781
- var qr = ["data-handle", "onMousedown"], Jr = ["title"], Yr = {
782
+ var Xr = ["data-handle", "onMousedown"], Zr = ["title"], Qr = {
782
783
  key: 0,
783
784
  class: "image-overlay__dim"
784
- }, Xr = {
785
+ }, $r = {
785
786
  key: 1,
786
787
  class: "image-overlay__dim image-overlay__dim--rotate"
787
- }, Zr = 4, Qr = 15, $r = 250, ei = 700, ti = /*#__PURE__*/ t(/* @__PURE__ */ B({
788
+ }, ei = 4, ti = 15, ni = 250, ri = 700, ii = /*#__PURE__*/ t(/* @__PURE__ */ z({
788
789
  __name: "ImageSelectionOverlay",
789
790
  props: {
790
791
  imageInfo: {},
@@ -813,17 +814,17 @@ var qr = ["data-handle", "onMousedown"], Jr = ["title"], Yr = {
813
814
  let t = e.attrs.transform;
814
815
  return typeof t == "string" ? t : null;
815
816
  }
816
- function ne() {
817
+ function re() {
817
818
  return a.value?.closest(".docx-editor-vue__pages-viewport")?.querySelector(".docx-editor-vue__pages") ?? null;
818
819
  }
819
820
  function ie() {
820
821
  let e = r.imageInfo;
821
822
  if (!e) return null;
822
823
  if (e.element.isConnected) return e.element;
823
- let t = ne();
824
+ let t = re();
824
825
  if (!t) return null;
825
- let n = _t(t, e.pmPos);
826
- return n ? ot(n) : null;
826
+ let n = gt(t, e.pmPos);
827
+ return n ? at(n) : null;
827
828
  }
828
829
  function C() {
829
830
  let e = ie();
@@ -836,9 +837,9 @@ var qr = ["data-handle", "onMousedown"], Jr = ["title"], Yr = {
836
837
  p.value = null;
837
838
  return;
838
839
  }
839
- let n = t.getBoundingClientRect();
840
- p.value = Kr({
841
- imageRect: e.getBoundingClientRect(),
840
+ let n = t.getBoundingClientRect(), i = e.getBoundingClientRect();
841
+ p.value = Yr({
842
+ imageRect: i,
842
843
  parentRect: n,
843
844
  scrollLeft: t.scrollLeft,
844
845
  scrollTop: t.scrollTop,
@@ -855,10 +856,10 @@ var qr = ["data-handle", "onMousedown"], Jr = ["title"], Yr = {
855
856
  let o = a - r;
856
857
  C();
857
858
  let s = p.value, c = s ? `${s.left}|${s.top}|${s.width}|${s.height}` : "";
858
- n = c === t ? n + 1 : 0, t = c, !(o >= $r && n >= 2) && o < ei && (e = requestAnimationFrame(i));
859
+ n = c === t ? n + 1 : 0, t = c, !(o >= ni && n >= 2) && o < ri && (e = requestAnimationFrame(i));
859
860
  };
860
861
  e = requestAnimationFrame(i);
861
- let a = setTimeout(C, $r);
862
+ let a = setTimeout(C, ni);
862
863
  ae = () => {
863
864
  cancelAnimationFrame(e), clearTimeout(a);
864
865
  };
@@ -878,9 +879,9 @@ var qr = ["data-handle", "onMousedown"], Jr = ["title"], Yr = {
878
879
  }, o = a.value?.closest(".docx-editor-vue__pages-viewport");
879
880
  o?.addEventListener("scroll", i, { passive: !0 }), window.addEventListener("resize", i, { passive: !0 });
880
881
  let s = null, c = !1;
881
- be(() => {
882
+ ye(() => {
882
883
  if (c || !r.imageInfo) return;
883
- let e = ne();
884
+ let e = re();
884
885
  e && (s = new MutationObserver(() => oe()), s.observe(e, {
885
886
  attributes: !0,
886
887
  attributeFilter: ["style"]
@@ -907,7 +908,7 @@ var qr = ["data-handle", "onMousedown"], Jr = ["title"], Yr = {
907
908
  height: `${n}px`,
908
909
  transform: i === 1 ? void 0 : `scale(${i})`,
909
910
  transformOrigin: "top left",
910
- zIndex: re.imageOverlay,
911
+ zIndex: ne.imageOverlay,
911
912
  pointerEvents: "auto"
912
913
  };
913
914
  }), ce = N(() => {
@@ -983,15 +984,18 @@ var qr = ["data-handle", "onMousedown"], Jr = ["title"], Yr = {
983
984
  !r.imageInfo || !p.value || (m = t, h = e.clientX, g = e.clientY, _ = p.value.width, v = p.value.height, y = { ...p.value }, u.value = Math.round(_), d.value = Math.round(v), o.value = !0, i("interact-start"), document.addEventListener("mousemove", E), document.addEventListener("mouseup", D));
984
985
  }
985
986
  function E(e) {
986
- let t = r.zoom, n = (e.clientX - h) / t, i = (e.clientY - g) / t, a = !e.shiftKey, o = ft(m, n, i, _, v, a);
987
+ let t = r.zoom, n = (e.clientX - h) / t, i = (e.clientY - g) / t, a = !e.shiftKey, o = dt(m, n, i, _, v, a);
987
988
  u.value = Math.round(o.width), d.value = Math.round(o.height);
988
989
  let s = y;
989
- s && (p.value = {
990
- left: m.includes("w") ? s.left + (s.width - o.width) : s.left,
991
- top: m.includes("n") ? s.top + (s.height - o.height) : s.top,
992
- width: s.width,
993
- height: s.height
994
- });
990
+ if (s) {
991
+ let e = m.includes("w") ? s.left + (s.width - o.width) : s.left, t = m.includes("n") ? s.top + (s.height - o.height) : s.top;
992
+ p.value = {
993
+ left: e,
994
+ top: t,
995
+ width: s.width,
996
+ height: s.height
997
+ };
998
+ }
995
999
  }
996
1000
  function D() {
997
1001
  document.removeEventListener("mousemove", E), document.removeEventListener("mouseup", D), o.value = !1, y = null, i("interact-end");
@@ -1000,11 +1004,11 @@ var qr = ["data-handle", "onMousedown"], Jr = ["title"], Yr = {
1000
1004
  C();
1001
1005
  return;
1002
1006
  }
1003
- let n = ht(e, t.pmPos, u.value, d.value);
1004
- n !== null && _e(n), be(() => C());
1007
+ let n = mt(e, t.pmPos, u.value, d.value);
1008
+ n !== null && _e(n), ye(() => C());
1005
1009
  }
1006
1010
  let ue = 0, de = 0, fe = 0, O = 0, k = null, A = null;
1007
- function j(e) {
1011
+ function M(e) {
1008
1012
  if (!e) return 0;
1009
1013
  let t = e.match(/rotate\((-?\d+(?:\.\d+)?)deg\)/)?.[1];
1010
1014
  return t ? parseFloat(t) : 0;
@@ -1013,17 +1017,17 @@ var qr = ["data-handle", "onMousedown"], Jr = ["title"], Yr = {
1013
1017
  let n = /scaleX\(-1\)/.test(e || ""), r = /scaleY\(-1\)/.test(e || ""), i = [], a = (t % 360 + 360) % 360;
1014
1018
  return a !== 0 && i.push(`rotate(${a}deg)`), n && i.push("scaleX(-1)"), r && i.push("scaleY(-1)"), i.length > 0 ? i.join(" ") : null;
1015
1019
  }
1016
- function me(e, t) {
1020
+ function P(e, t) {
1017
1021
  return Math.atan2(e - ue, -(t - de)) * 180 / Math.PI;
1018
1022
  }
1019
- function P(e) {
1023
+ function me(e) {
1020
1024
  if (!r.imageInfo) return;
1021
1025
  let t = r.imageInfo.element.getBoundingClientRect();
1022
- ue = t.left + t.width / 2, de = t.top + t.height / 2, k = te(S(r.view, r.imageInfo.pmPos)), O = j(k), A = r.imageInfo.element.querySelector("img"), fe = me(e.clientX, e.clientY), f.value = O, l.value = !0, i("interact-start"), document.addEventListener("mousemove", he), document.addEventListener("mouseup", ge);
1026
+ ue = t.left + t.width / 2, de = t.top + t.height / 2, k = te(S(r.view, r.imageInfo.pmPos)), O = M(k), A = r.imageInfo.element.querySelector("img"), fe = P(e.clientX, e.clientY), f.value = O, l.value = !0, i("interact-start"), document.addEventListener("mousemove", he), document.addEventListener("mouseup", ge);
1023
1027
  }
1024
1028
  function he(e) {
1025
- let t = me(e.clientX, e.clientY) - fe, n = O + t;
1026
- e.shiftKey || (n = Math.round(n / Qr) * Qr), f.value = (n % 360 + 360) % 360, A && (A.style.transform = pe(k, f.value) || "");
1029
+ let t = P(e.clientX, e.clientY) - fe, n = O + t;
1030
+ e.shiftKey || (n = Math.round(n / ti) * ti), f.value = (n % 360 + 360) % 360, A && (A.style.transform = pe(k, f.value) || "");
1027
1031
  }
1028
1032
  function ge() {
1029
1033
  document.removeEventListener("mousemove", he), document.removeEventListener("mouseup", ge), l.value = !1, i("interact-end");
@@ -1037,14 +1041,14 @@ var qr = ["data-handle", "onMousedown"], Jr = ["title"], Yr = {
1037
1041
  } catch {} finally {
1038
1042
  A && (A.style.transform = ""), A = null, k = null;
1039
1043
  }
1040
- be(() => C());
1044
+ ye(() => C());
1041
1045
  }
1042
1046
  let R = null;
1043
1047
  function z(e) {
1044
1048
  if (!r.imageInfo || !p.value) return;
1045
1049
  let t = e.clientX, n = e.clientY, a = p.value, o = !1, c = (e) => {
1046
1050
  let c = e.clientX - t, l = e.clientY - n;
1047
- if (!(!o && Math.sqrt(c * c + l * l) < Zr)) {
1051
+ if (!(!o && Math.sqrt(c * c + l * l) < ei)) {
1048
1052
  if (!o) {
1049
1053
  o = !0, s.value = !0, i("interact-start"), R = document.createElement("div"), R.style.cssText = "position: fixed; pointer-events: none; z-index: 10000; opacity: 0.5; border: 2px dashed #2563eb; border-radius: 4px; background: rgba(37, 99, 235, 0.1);";
1050
1054
  let e = r.zoom;
@@ -1064,44 +1068,43 @@ var qr = ["data-handle", "onMousedown"], Jr = ["title"], Yr = {
1064
1068
  let n = r.view, i = r.imageInfo;
1065
1069
  if (!n || !i) return;
1066
1070
  let o = S(n, i.pmPos);
1067
- if (o) {
1068
- if (gt(o)) {
1069
- let o = (a.value?.closest(".docx-editor-vue__pages-viewport"))?.querySelectorAll(".layout-page");
1070
- if (!o || o.length === 0) return;
1071
- let s = null;
1072
- for (let e of o) {
1073
- let n = e.getBoundingClientRect();
1074
- if (t >= n.top && t <= n.bottom) {
1075
- s = e.querySelector(".layout-page-content");
1076
- break;
1077
- }
1078
- }
1079
- if (!s) {
1080
- let e = o.item(o.length - 1);
1081
- s = e ? e.querySelector(".layout-page-content") : null;
1071
+ if (!o) return;
1072
+ let s;
1073
+ if (ht(o)) {
1074
+ let o = (a.value?.closest(".docx-editor-vue__pages-viewport"))?.querySelectorAll(".layout-page");
1075
+ if (!o || o.length === 0) return;
1076
+ let c = null;
1077
+ for (let e of o) {
1078
+ let n = e.getBoundingClientRect();
1079
+ if (t >= n.top && t <= n.bottom) {
1080
+ c = e.querySelector(".layout-page-content");
1081
+ break;
1082
1082
  }
1083
- if (!s) return;
1084
- let c = s.getBoundingClientRect(), l = r.zoom, u = nt((e - c.left) / l), d = nt((t - c.top) / l), f = pt(n, i.pmPos, u, d);
1085
- f !== null && _e(f);
1086
- } else {
1087
- let r = ne();
1088
- if (!r) return;
1089
- let a = dt(r, e, t, 1);
1090
- if (a == null || a < 0) return;
1091
- let o = mt(n, i.pmPos, a);
1092
- o !== null && _e(o);
1093
1083
  }
1094
- be(() => C());
1084
+ if (!c) {
1085
+ let e = o.item(o.length - 1);
1086
+ c = e ? e.querySelector(".layout-page-content") : null;
1087
+ }
1088
+ if (!c) return;
1089
+ let l = c.getBoundingClientRect(), u = r.zoom, d = tt((e - l.left) / u), f = tt((t - l.top) / u);
1090
+ s = ft(n, i.pmPos, d, f);
1091
+ } else {
1092
+ let r = re();
1093
+ if (!r) return;
1094
+ let a = ut(r, e, t, 1);
1095
+ if (a == null || a < 0) return;
1096
+ s = pt(n, i.pmPos, a);
1095
1097
  }
1098
+ s !== null && _e(s), ye(() => C());
1096
1099
  }
1097
1100
  function _e(e) {
1098
1101
  let t = r.view;
1099
1102
  if (t) try {
1100
- let n = Z.create(t.state.doc, e);
1103
+ let n = $e.create(t.state.doc, e);
1101
1104
  t.dispatch(t.state.tr.setSelection(n));
1102
1105
  } catch {}
1103
1106
  }
1104
- return xe(() => {
1107
+ return be(() => {
1105
1108
  document.removeEventListener("mousemove", E), document.removeEventListener("mouseup", D), document.removeEventListener("mousemove", he), document.removeEventListener("mouseup", ge), x && document.removeEventListener("mousemove", x), ee && document.removeEventListener("mouseup", ee), R &&= (R.remove(), null), b && cancelAnimationFrame(b), ae?.();
1106
1109
  }), (t, r) => e.imageInfo ? (U(), I("div", {
1107
1110
  key: 0,
@@ -1118,25 +1121,25 @@ var qr = ["data-handle", "onMousedown"], Jr = ["title"], Yr = {
1118
1121
  onMousedown: r[0] ||= Y((e) => z(e), ["prevent", "stop"]),
1119
1122
  onContextmenu: r[1] ||= Y((e) => t.$emit("context-menu", e), ["prevent", "stop"])
1120
1123
  }, null, 36),
1121
- (U(!0), I(M, null, G(ce.value, (e) => (U(), I("div", {
1124
+ (U(!0), I(j, null, G(ce.value, (e) => (U(), I("div", {
1122
1125
  key: e.pos,
1123
1126
  class: "image-overlay__handle",
1124
1127
  style: H(e.style),
1125
1128
  "data-handle": e.pos,
1126
1129
  onMousedown: Y((t) => le(t, e.pos), ["prevent", "stop"])
1127
- }, null, 44, qr))), 128)),
1130
+ }, null, 44, Xr))), 128)),
1128
1131
  r[5] ||= L("div", { class: "image-overlay__rotate-line" }, null, -1),
1129
1132
  L("div", {
1130
1133
  class: "image-overlay__rotate-handle",
1131
1134
  style: H({ left: `${w.value / 2 - 7}px` }),
1132
1135
  title: q(n)("imageOverlay.rotate"),
1133
- onMousedown: r[2] ||= Y((e) => P(e), ["prevent", "stop"])
1134
- }, null, 44, Jr),
1135
- o.value ? (U(), I("div", Yr, K(Math.round(u.value)) + " × " + K(Math.round(d.value)), 1)) : F("", !0),
1136
- l.value ? (U(), I("div", Xr, K(Math.round(f.value)) + "° ", 1)) : F("", !0)
1136
+ onMousedown: r[2] ||= Y((e) => me(e), ["prevent", "stop"])
1137
+ }, null, 44, Zr),
1138
+ o.value ? (U(), I("div", Qr, K(Math.round(u.value)) + " × " + K(Math.round(d.value)), 1)) : F("", !0),
1139
+ l.value ? (U(), I("div", $r, K(Math.round(f.value)) + "° ", 1)) : F("", !0)
1137
1140
  ], 36)) : F("", !0);
1138
1141
  }
1139
- }), [["__scopeId", "data-v-4741c675"]]), ni = ["title", "aria-label"], ri = /* @__PURE__ */ B({
1142
+ }), [["__scopeId", "data-v-4c3d1a1d"]]), ai = ["title", "aria-label"], oi = /* @__PURE__ */ z({
1140
1143
  __name: "OutlineToggleButton",
1141
1144
  props: {
1142
1145
  leftOffset: {},
@@ -1156,12 +1159,12 @@ var qr = ["data-handle", "onMousedown"], Jr = ["title"], Yr = {
1156
1159
  "aria-label": q(t)("editor.showDocumentOutline"),
1157
1160
  onClick: i[0] ||= (e) => n.$emit("toggle"),
1158
1161
  onMousedown: i[1] ||= Y(() => {}, ["stop"])
1159
- }, [z(r, {
1162
+ }, [R(r, {
1160
1163
  name: "format_list_bulleted",
1161
1164
  size: 20
1162
- })], 44, ni));
1165
+ })], 44, ai));
1163
1166
  }
1164
- }), ii = /*#__PURE__*/ t(/* @__PURE__ */ B({
1167
+ }), si = /*#__PURE__*/ t(/* @__PURE__ */ z({
1165
1168
  __name: "PageIndicator",
1166
1169
  props: {
1167
1170
  currentPage: {},
@@ -1180,7 +1183,7 @@ var qr = ["data-handle", "onMousedown"], Jr = ["title"], Yr = {
1180
1183
  total: e.totalPages
1181
1184
  })), 5));
1182
1185
  }
1183
- }), [["__scopeId", "data-v-877b9ee2"]]), ai = ["data-folio-block-id"], oi = ["data-folio-block-id", "title"], si = 2.5, ci = 5, li = 6, ui = 2, di = 2, fi = /*#__PURE__*/ t(/* @__PURE__ */ B({
1186
+ }), [["__scopeId", "data-v-f1904974"]]), ci = ["data-folio-block-id"], li = ["data-folio-block-id", "title"], ui = 2.5, di = 5, fi = 6, pi = 2, mi = 2, hi = /*#__PURE__*/ t(/* @__PURE__ */ z({
1184
1187
  __name: "TemplateDirectivesOverlay",
1185
1188
  props: {
1186
1189
  getView: { type: Function },
@@ -1192,21 +1195,21 @@ var qr = ["data-handle", "onMousedown"], Jr = ["title"], Yr = {
1192
1195
  measures: {}
1193
1196
  },
1194
1197
  setup(e) {
1195
- let t = e, n = new Set(["if", "each"]), r = new Set(["endif", "endeach"]), i = (e) => e === "each" ? "each" : "if";
1198
+ let t = e, n = /* @__PURE__ */ new Set(["if", "each"]), r = /* @__PURE__ */ new Set(["endif", "endeach"]), i = (e) => e === "each" ? "each" : "if";
1196
1199
  function a(e) {
1197
- let t = e - li - si - ui;
1198
- return t <= 0 ? 0 : Math.floor(t / ci);
1200
+ let t = e - fi - ui - pi;
1201
+ return t <= 0 ? 0 : Math.floor(t / di);
1199
1202
  }
1200
1203
  function o(e, t, n) {
1201
1204
  let r = a(n), i = Math.min(Math.max(0, e), r);
1202
- return t - li - si - (r - i) * ci;
1205
+ return t - fi - ui - (r - i) * di;
1203
1206
  }
1204
1207
  function s(e, t) {
1205
- if (t.length === 0) return e.bottom - e.top >= di ? [e] : [];
1208
+ if (t.length === 0) return e.bottom - e.top >= mi ? [e] : [];
1206
1209
  let n = [];
1207
1210
  for (let r of t) {
1208
1211
  let t = Math.max(e.top, r.top), i = Math.min(e.bottom, r.bottom);
1209
- i - t >= di && n.push({
1212
+ i - t >= mi && n.push({
1210
1213
  top: t,
1211
1214
  bottom: i
1212
1215
  });
@@ -1283,12 +1286,12 @@ var qr = ["data-handle", "onMousedown"], Jr = ["title"], Yr = {
1283
1286
  f.value = [], p.value = [], m.value = null, h.value = null;
1284
1287
  return;
1285
1288
  }
1286
- let a = bt(i);
1289
+ let a = yt(i);
1287
1290
  if (a.length === 0) {
1288
1291
  f.value = [], p.value = [], m.value = null, h.value = null;
1289
1292
  return;
1290
1293
  }
1291
- let o = Ke(r, t.zoom), s = await qe(a, {
1294
+ let o = Ge(r, t.zoom), s = await Ke(a, {
1292
1295
  pagesContainer: r,
1293
1296
  zoom: t.zoom,
1294
1297
  layout: t.layout,
@@ -1349,14 +1352,14 @@ var qr = ["data-handle", "onMousedown"], Jr = ["title"], Yr = {
1349
1352
  let n = w(e.relatedTarget);
1350
1353
  n !== t && g.value === t && (g.value = n);
1351
1354
  }
1352
- return Se(() => y()), xe(() => {
1355
+ return xe(() => y()), be(() => {
1353
1356
  v !== null && (cancelAnimationFrame(v), v = null);
1354
1357
  }), (t, n) => (U(), I("div", {
1355
1358
  class: "folio-template-directives-overlay",
1356
1359
  "data-folio-template-directives-overlay": "",
1357
1360
  onPointerover: T,
1358
1361
  onPointerout: se
1359
- }, [(U(!0), I(M, null, G(ee.value, (t) => (U(), I(M, { key: `rail:${t.blockId}` }, [(U(!0), I(M, null, G(t.segments, (n, r) => (U(), I("div", {
1362
+ }, [(U(!0), I(j, null, G(ee.value, (t) => (U(), I(j, { key: `rail:${t.blockId}` }, [(U(!0), I(j, null, G(t.segments, (n, r) => (U(), I("div", {
1360
1363
  key: `rail:${t.blockId}:${r}`,
1361
1364
  class: V([
1362
1365
  "folio-template-band-rail",
@@ -1368,10 +1371,10 @@ var qr = ["data-handle", "onMousedown"], Jr = ["title"], Yr = {
1368
1371
  position: "absolute",
1369
1372
  left: `${t.railX * e.zoom}px`,
1370
1373
  top: `${n.top * e.zoom}px`,
1371
- width: `${si * e.zoom}px`,
1374
+ width: `${ui * e.zoom}px`,
1372
1375
  height: `${Math.max(0, n.bottom - n.top) * e.zoom}px`
1373
1376
  })
1374
- }, null, 14, ai))), 128))], 64))), 128)), (U(!0), I(M, null, G(p.value, (t, n) => (U(), I(M, { key: `d:${n}` }, [(U(!0), I(M, null, G(t.rects, (r, i) => (U(), I("span", {
1377
+ }, null, 14, ci))), 128))], 64))), 128)), (U(!0), I(j, null, G(p.value, (t, n) => (U(), I(j, { key: `d:${n}` }, [(U(!0), I(j, null, G(t.rects, (r, i) => (U(), I("span", {
1375
1378
  key: `d:${n}:${i}`,
1376
1379
  class: V(oe(t.range)),
1377
1380
  "data-folio-block-id": C(t.range),
@@ -1383,9 +1386,9 @@ var qr = ["data-handle", "onMousedown"], Jr = ["title"], Yr = {
1383
1386
  width: `${(r.width + 2) * e.zoom}px`,
1384
1387
  height: `${Math.max(0, r.height - 2) * e.zoom}px`
1385
1388
  })
1386
- }, null, 14, oi))), 128))], 64))), 128))], 32));
1389
+ }, null, 14, li))), 128))], 64))), 128))], 32));
1387
1390
  }
1388
- }), [["__scopeId", "data-v-142d2ac6"]]), pi = ["href", "title"], mi = ["title"], hi = ["title"], gi = ["title"], _i = { class: "docx-hyperlink-popup__edit-row" }, vi = ["placeholder", "onKeydown"], yi = { class: "docx-hyperlink-popup__edit-row" }, bi = ["onKeydown"], xi = ["disabled"], Si = /*#__PURE__*/ t(/* @__PURE__ */ B({
1391
+ }), [["__scopeId", "data-v-142d2ac6"]]), gi = ["href", "title"], _i = ["title"], vi = ["title"], yi = ["title"], bi = { class: "docx-hyperlink-popup__edit-row" }, xi = ["placeholder", "onKeydown"], Si = { class: "docx-hyperlink-popup__edit-row" }, Ci = ["onKeydown"], wi = ["disabled"], Ti = /*#__PURE__*/ t(/* @__PURE__ */ z({
1389
1392
  __name: "HyperlinkPopup",
1390
1393
  props: {
1391
1394
  data: {},
@@ -1417,7 +1420,7 @@ var qr = ["data-handle", "onMousedown"], Jr = ["title"], Yr = {
1417
1420
  }, f = setTimeout(() => {
1418
1421
  d && document.addEventListener("mousedown", d);
1419
1422
  }, 0));
1420
- }, { immediate: !0 }), xe(p);
1423
+ }, { immediate: !0 }), be(p);
1421
1424
  function m() {
1422
1425
  r.data && (o.value = r.data.displayText, s.value = r.data.href, a.value = !0);
1423
1426
  }
@@ -1434,28 +1437,28 @@ var qr = ["data-handle", "onMousedown"], Jr = ["title"], Yr = {
1434
1437
  class: V(["docx-hyperlink-popup", { "docx-hyperlink-popup--edit": a.value }]),
1435
1438
  style: H(u.value),
1436
1439
  onMousedown: r[6] ||= Y(() => {}, ["stop"])
1437
- }, [a.value ? (U(), I(M, { key: 1 }, [L("div", _i, [Oe(L("input", {
1440
+ }, [a.value ? (U(), I(j, { key: 1 }, [L("div", bi, [De(L("input", {
1438
1441
  class: "docx-hyperlink-popup__input",
1439
1442
  placeholder: q(n)("displayText"),
1440
1443
  "onUpdate:modelValue": r[2] ||= (e) => o.value = e,
1441
- onKeydown: [ke(Y(h, ["prevent"]), ["enter"]), r[3] ||= ke((e) => t.$emit("close"), ["esc"])]
1442
- }, null, 40, vi), [[Ee, o.value]])]), L("div", yi, [Oe(L("input", {
1444
+ onKeydown: [Oe(Y(h, ["prevent"]), ["enter"]), r[3] ||= Oe((e) => t.$emit("close"), ["esc"])]
1445
+ }, null, 40, xi), [[Te, o.value]])]), L("div", Si, [De(L("input", {
1443
1446
  class: "docx-hyperlink-popup__input",
1444
1447
  placeholder: "https://...",
1445
1448
  "onUpdate:modelValue": r[4] ||= (e) => s.value = e,
1446
- onKeydown: [ke(Y(h, ["prevent"]), ["enter"]), r[5] ||= ke((e) => t.$emit("close"), ["esc"])]
1447
- }, null, 40, bi), [[Ee, s.value]]), L("button", {
1449
+ onKeydown: [Oe(Y(h, ["prevent"]), ["enter"]), r[5] ||= Oe((e) => t.$emit("close"), ["esc"])]
1450
+ }, null, 40, Ci), [[Te, s.value]]), L("button", {
1448
1451
  class: "docx-hyperlink-popup__apply",
1449
1452
  disabled: !s.value.trim(),
1450
1453
  onClick: Y(h, ["prevent"])
1451
- }, K(q(n)("common.apply")), 9, xi)])], 64)) : (U(), I(M, { key: 0 }, [
1452
- r[10] ||= ge("<span class=\"docx-hyperlink-popup__icon\" aria-hidden data-v-8bc31a34><svg width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" data-v-8bc31a34><circle cx=\"12\" cy=\"12\" r=\"10\" data-v-8bc31a34></circle><path d=\"M2 12h20\" data-v-8bc31a34></path><path d=\"M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z\" data-v-8bc31a34></path></svg></span>", 1),
1454
+ }, K(q(n)("common.apply")), 9, wi)])], 64)) : (U(), I(j, { key: 0 }, [
1455
+ r[10] ||= he("<span class=\"docx-hyperlink-popup__icon\" aria-hidden data-v-366df18c><svg width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" data-v-366df18c><circle cx=\"12\" cy=\"12\" r=\"10\" data-v-366df18c></circle><path d=\"M2 12h20\" data-v-366df18c></path><path d=\"M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z\" data-v-366df18c></path></svg></span>", 1),
1453
1456
  L("a", {
1454
1457
  class: "docx-hyperlink-popup__url",
1455
1458
  href: e.data.href,
1456
1459
  title: e.data.href,
1457
1460
  onClick: r[0] ||= Y((n) => t.$emit("navigate", e.data.href), ["prevent"])
1458
- }, K(e.data.href), 9, pi),
1461
+ }, K(e.data.href), 9, gi),
1459
1462
  r[11] ||= L("span", { class: "docx-hyperlink-popup__sep" }, null, -1),
1460
1463
  L("button", {
1461
1464
  class: "docx-hyperlink-popup__btn",
@@ -1477,7 +1480,7 @@ var qr = ["data-handle", "onMousedown"], Jr = ["title"], Yr = {
1477
1480
  height: "13",
1478
1481
  rx: "2",
1479
1482
  ry: "2"
1480
- }), L("path", { d: "M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1" })], -1)]], 8, mi),
1483
+ }), L("path", { d: "M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1" })], -1)]], 8, _i),
1481
1484
  e.readOnly ? F("", !0) : (U(), I("button", {
1482
1485
  key: 0,
1483
1486
  class: "docx-hyperlink-popup__btn",
@@ -1492,43 +1495,43 @@ var qr = ["data-handle", "onMousedown"], Jr = ["title"], Yr = {
1492
1495
  "stroke-width": "2",
1493
1496
  "stroke-linecap": "round",
1494
1497
  "stroke-linejoin": "round"
1495
- }, [L("path", { d: "M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7" }), L("path", { d: "M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z" })], -1)]], 8, hi)),
1498
+ }, [L("path", { d: "M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7" }), L("path", { d: "M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z" })], -1)]], 8, vi)),
1496
1499
  e.readOnly ? F("", !0) : (U(), I("button", {
1497
1500
  key: 1,
1498
1501
  class: "docx-hyperlink-popup__btn",
1499
1502
  title: q(n)("removeLink"),
1500
1503
  onClick: r[1] ||= Y((e) => t.$emit("remove"), ["prevent"])
1501
- }, [...r[9] ||= [ge("<svg width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" data-v-8bc31a34><path d=\"M18.84 12.25l1.72-1.71h-.02a5.004 5.004 0 0 0-.12-7.07 5.006 5.006 0 0 0-6.95 0l-1.72 1.71\" data-v-8bc31a34></path><path d=\"M5.17 11.75l-1.71 1.71a5.004 5.004 0 0 0 .12 7.07 5.006 5.006 0 0 0 6.95 0l1.71-1.71\" data-v-8bc31a34></path><line x1=\"8\" y1=\"2\" x2=\"8\" y2=\"5\" data-v-8bc31a34></line><line x1=\"2\" y1=\"8\" x2=\"5\" y2=\"8\" data-v-8bc31a34></line><line x1=\"16\" y1=\"19\" x2=\"16\" y2=\"22\" data-v-8bc31a34></line><line x1=\"19\" y1=\"16\" x2=\"22\" y2=\"16\" data-v-8bc31a34></line></svg>", 1)]], 8, gi))
1504
+ }, [...r[9] ||= [he("<svg width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" data-v-366df18c><path d=\"M18.84 12.25l1.72-1.71h-.02a5.004 5.004 0 0 0-.12-7.07 5.006 5.006 0 0 0-6.95 0l-1.72 1.71\" data-v-366df18c></path><path d=\"M5.17 11.75l-1.71 1.71a5.004 5.004 0 0 0 .12 7.07 5.006 5.006 0 0 0 6.95 0l1.71-1.71\" data-v-366df18c></path><line x1=\"8\" y1=\"2\" x2=\"8\" y2=\"5\" data-v-366df18c></line><line x1=\"2\" y1=\"8\" x2=\"5\" y2=\"8\" data-v-366df18c></line><line x1=\"16\" y1=\"19\" x2=\"16\" y2=\"22\" data-v-366df18c></line><line x1=\"19\" y1=\"16\" x2=\"22\" y2=\"16\" data-v-366df18c></line></svg>", 1)]], 8, yi))
1502
1505
  ], 64))], 38)) : F("", !0);
1503
1506
  }
1504
- }), [["__scopeId", "data-v-8bc31a34"]]);
1507
+ }), [["__scopeId", "data-v-366df18c"]]);
1505
1508
  //#endregion
1506
1509
  //#region src/composables/commentMarks.ts
1507
- function Ci(e, t) {
1510
+ function Ei(e, t) {
1508
1511
  let n = Math.max(0, Math.min(t.from, e)), r = Math.max(n, Math.min(t.to, e));
1509
1512
  return n === r ? null : {
1510
1513
  from: n,
1511
1514
  to: r
1512
1515
  };
1513
1516
  }
1514
- function wi({ docSize: e, capturedRange: t, currentRange: n, savedRange: r }) {
1517
+ function Di({ docSize: e, capturedRange: t, currentRange: n, savedRange: r }) {
1515
1518
  let i = t.from === t.to ? n.from === n.to ? r && r.from !== r.to ? r : null : n : t;
1516
- return i ? Ci(e, i) : null;
1519
+ return i ? Ei(e, i) : null;
1517
1520
  }
1518
- function Ti(e, t, n, r) {
1519
- let i = e.state.schema.marks.comment, a = Ci(e.state.doc.content.size, t);
1521
+ function Oi(e, t, n, r) {
1522
+ let i = e.state.schema.marks.comment, a = Ei(e.state.doc.content.size, t);
1520
1523
  if (!i || !a) return !1;
1521
1524
  let o = e.state.tr;
1522
1525
  return r?.replacePending && (o = o.removeMark(a.from, a.to, i.create({ commentId: wt }))), o = o.addMark(a.from, a.to, i.create({ commentId: n })), r?.selectEnd && (o = o.setSelection(et.near(o.doc.resolve(a.to), -1))), e.dispatch(o), !0;
1523
1526
  }
1524
- function Ei(e, t) {
1525
- let n = e.state.schema.marks.comment, r = Ci(e.state.doc.content.size, t);
1527
+ function ki(e, t) {
1528
+ let n = e.state.schema.marks.comment, r = Ei(e.state.doc.content.size, t);
1526
1529
  !n || !r || e.dispatch(e.state.tr.removeMark(r.from, r.to, n.create({ commentId: wt })));
1527
1530
  }
1528
1531
  //#endregion
1529
1532
  //#region src/composables/useCommentLifecycle.ts
1530
- var Di = 408, Oi = 12;
1531
- function ki(e) {
1533
+ var Ai = 408, ji = 12;
1534
+ function Mi(e) {
1532
1535
  let t = W(!1), n = W(null), r = W(null), i = W(null), a = W(null);
1533
1536
  function o(t) {
1534
1537
  let n = e.editorView.value, r = e.pagesContainer.value;
@@ -1561,7 +1564,7 @@ function ki(e) {
1561
1564
  r.value = null;
1562
1565
  return;
1563
1566
  }
1564
- let l = i.getBoundingClientRect(), u = e.pagesContainer.value?.getBoundingClientRect(), d = u ? u.right - l.left + Oi : l.width / 2 + Di;
1567
+ let l = i.getBoundingClientRect(), u = e.pagesContainer.value?.getBoundingClientRect(), d = u ? u.right - l.left + ji : l.width / 2 + Ai;
1565
1568
  r.value = {
1566
1569
  top: c.top - l.top,
1567
1570
  left: Math.max(16, Math.min(d, l.width - 16)),
@@ -1572,7 +1575,7 @@ function ki(e) {
1572
1575
  function c() {
1573
1576
  let s = e.editorView.value;
1574
1577
  if (!s) return;
1575
- let c = r.value, l = s.state.selection, u = wi({
1578
+ let c = r.value, l = s.state.selection, u = Di({
1576
1579
  docSize: s.state.doc.content.size,
1577
1580
  capturedRange: c ? {
1578
1581
  from: c.from,
@@ -1591,7 +1594,7 @@ function ki(e) {
1591
1594
  r.value = null;
1592
1595
  return;
1593
1596
  }
1594
- if (!Ti(s, u, wt, { selectEnd: !0 })) {
1597
+ if (!Oi(s, u, wt, { selectEnd: !0 })) {
1595
1598
  r.value = null, i.value = null;
1596
1599
  return;
1597
1600
  }
@@ -1604,11 +1607,11 @@ function ki(e) {
1604
1607
  let n = e.editorView.value, r = i.value;
1605
1608
  if (!n || !r) return !1;
1606
1609
  let a = e.createComment(t);
1607
- return Ti(n, r, a.id, { replacePending: !0 }) ? (e.pushComment(a), e.reLayout(), e.setActiveSidebarItem(`comment-${a.id}`), l(), !0) : !1;
1610
+ return Oi(n, r, a.id, { replacePending: !0 }) ? (e.pushComment(a), e.reLayout(), e.setActiveSidebarItem(`comment-${a.id}`), l(), !0) : !1;
1608
1611
  }
1609
1612
  function d() {
1610
1613
  let t = e.editorView.value;
1611
- t && i.value && Ei(t, i.value), l();
1614
+ t && i.value && ki(t, i.value), l();
1612
1615
  }
1613
1616
  return {
1614
1617
  isAddingComment: t,
@@ -1622,7 +1625,7 @@ function ki(e) {
1622
1625
  }
1623
1626
  //#endregion
1624
1627
  //#region src/composables/useCommentManagement.ts
1625
- function Ai(e) {
1628
+ function Ni(e) {
1626
1629
  let t = Tt(), n = W([]), r = W(!1);
1627
1630
  function i() {
1628
1631
  r.value = !0;
@@ -1707,7 +1710,7 @@ function Ai(e) {
1707
1710
  }
1708
1711
  //#endregion
1709
1712
  //#region src/utils/imageClipboard.ts
1710
- function ji(e, t, n) {
1713
+ function Pi(e, t, n) {
1711
1714
  let r = Pt(e.state), i = e.state.schema.marks.insertion;
1712
1715
  if (!r || !i) return;
1713
1716
  let a = t.selection.from, o = a - n.nodeSize;
@@ -1717,7 +1720,7 @@ function ji(e, t, n) {
1717
1720
  date: r.date
1718
1721
  }));
1719
1722
  }
1720
- function Mi(e, t) {
1723
+ function Fi(e, t) {
1721
1724
  let n = e.state.doc.nodeAt(t);
1722
1725
  if (!n || n.type.name !== "image") return;
1723
1726
  let r = n.attrs.src;
@@ -1731,7 +1734,7 @@ function Mi(e, t) {
1731
1734
  e.value = i, document.body.appendChild(e), e.select(), document.execCommand("copy"), document.body.removeChild(e);
1732
1735
  });
1733
1736
  }
1734
- function Ni(e) {
1737
+ function Ii(e) {
1735
1738
  return new Promise((t, n) => {
1736
1739
  let r = new FileReader();
1737
1740
  r.onload = () => {
@@ -1739,7 +1742,7 @@ function Ni(e) {
1739
1742
  }, r.onerror = () => n(r.error ?? /* @__PURE__ */ Error("Failed to read blob")), r.readAsDataURL(e);
1740
1743
  });
1741
1744
  }
1742
- function Pi(e) {
1745
+ function Li(e) {
1743
1746
  return new Promise((t) => {
1744
1747
  let n = new Image();
1745
1748
  n.onload = () => t({
@@ -1751,7 +1754,7 @@ function Pi(e) {
1751
1754
  }), n.src = e;
1752
1755
  });
1753
1756
  }
1754
- function Fi(e, t, n, r) {
1757
+ function Ri(e, t, n, r) {
1755
1758
  let i = e.state.schema.nodes.image;
1756
1759
  if (!i) return;
1757
1760
  let a = i.create({
@@ -1762,23 +1765,23 @@ function Fi(e, t, n, r) {
1762
1765
  wrapType: "inline",
1763
1766
  displayMode: "inline"
1764
1767
  }), o = e.state.tr.replaceSelectionWith(a);
1765
- ji(e, o, a), e.dispatch(o);
1768
+ Pi(e, o, a), e.dispatch(o);
1766
1769
  }
1767
- async function Ii(e) {
1770
+ async function zi(e) {
1768
1771
  try {
1769
1772
  let t = await navigator.clipboard.read();
1770
1773
  for (let n of t) {
1771
1774
  let t = n.types.find((e) => e.startsWith("image/"));
1772
1775
  if (t) {
1773
- let r = await Ni(await n.getType(t)), i = await Pi(r), a = i.width, o = i.height;
1774
- a > 612 && (o = Math.round(612 / a * o), a = 612), Fi(e, r, a, o);
1776
+ let r = await Ii(await n.getType(t)), i = await Li(r), a = i.width, o = i.height;
1777
+ a > 612 && (o = Math.round(612 / a * o), a = 612), Ri(e, r, a, o);
1775
1778
  return;
1776
1779
  }
1777
1780
  if (n.types.includes("text/html")) {
1778
1781
  let t = await (await n.getType("text/html")).text(), r = /<img[^>]+src="(?<src>[^"]+)"[^>]*>/iu.exec(t)?.groups?.src;
1779
1782
  if (r) {
1780
1783
  let n = /data-width="(?<w>\d+)"/u.exec(t)?.groups?.w, i = /data-height="(?<h>\d+)"/u.exec(t)?.groups?.h, a = n ? Number(n) : 200, o = i ? Number(i) : 200;
1781
- Fi(e, r, a || 200, o || 200);
1784
+ Ri(e, r, a || 200, o || 200);
1782
1785
  return;
1783
1786
  }
1784
1787
  }
@@ -1799,14 +1802,14 @@ async function Ii(e) {
1799
1802
  }
1800
1803
  }
1801
1804
  }
1802
- function Li(e, t) {
1805
+ function Bi(e, t) {
1803
1806
  let n = e.state.doc.nodeAt(t);
1804
1807
  if (!n || n.type.name !== "image") return;
1805
1808
  let r = document.createElement("input");
1806
1809
  r.type = "file", r.accept = "image/*", r.onchange = async () => {
1807
1810
  let i = r.files?.[0];
1808
1811
  if (!i) return;
1809
- let a = await Ni(i), o = await Pi(a), s = n.attrs.width, c = n.attrs.height, l = typeof s == "number" ? s : o.width, u = typeof c == "number" ? c : o.height, d = Math.min(l / o.width, u / o.height), f = Math.round(o.width * d), p = Math.round(o.height * d);
1812
+ let a = await Ii(i), o = await Li(a), s = n.attrs.width, c = n.attrs.height, l = typeof s == "number" ? s : o.width, u = typeof c == "number" ? c : o.height, d = Math.min(l / o.width, u / o.height), f = Math.round(o.width * d), p = Math.round(o.height * d);
1810
1813
  try {
1811
1814
  let r = e.state.tr.setNodeMarkup(t, void 0, {
1812
1815
  ...n.attrs,
@@ -1821,7 +1824,7 @@ function Li(e, t) {
1821
1824
  }
1822
1825
  //#endregion
1823
1826
  //#region src/composables/useContextMenus.ts
1824
- var Ri = new Set([
1827
+ var Vi = /* @__PURE__ */ new Set([
1825
1828
  "inline",
1826
1829
  "square",
1827
1830
  "tight",
@@ -1830,16 +1833,16 @@ var Ri = new Set([
1830
1833
  "behind",
1831
1834
  "inFront"
1832
1835
  ]);
1833
- function zi(e) {
1834
- return typeof e == "string" && Ri.has(e);
1836
+ function Hi(e) {
1837
+ return typeof e == "string" && Vi.has(e);
1835
1838
  }
1836
- function Bi(e) {
1837
- return zi(e) ? e : "inline";
1839
+ function Ui(e) {
1840
+ return Hi(e) ? e : "inline";
1838
1841
  }
1839
- function Vi(e) {
1842
+ function Wi(e) {
1840
1843
  return e === "left" || e === "right" || e === "none" ? e : null;
1841
1844
  }
1842
- function Hi(e) {
1845
+ function Gi(e) {
1843
1846
  let { t } = c(), n = W({
1844
1847
  isOpen: !1,
1845
1848
  position: {
@@ -1881,7 +1884,7 @@ function Hi(e) {
1881
1884
  t(e.state, (t) => e.dispatch(t), e);
1882
1885
  }
1883
1886
  function l(t, n, r, i, a) {
1884
- let o = i === "inline" ? it(t, e.zoom.value) : void 0;
1887
+ let o = i === "inline" ? rt(t, e.zoom.value) : void 0;
1885
1888
  return {
1886
1889
  open: !0,
1887
1890
  position: r,
@@ -1894,12 +1897,12 @@ function Hi(e) {
1894
1897
  function u(t) {
1895
1898
  let a = e.editorView.value;
1896
1899
  if (!a) return;
1897
- let o = ot(t.target);
1900
+ let o = at(t.target);
1898
1901
  if (o) {
1899
1902
  let i = Number(o.dataset.pmStart);
1900
1903
  if (!Number.isNaN(i)) {
1901
1904
  try {
1902
- let e = Z.create(a.state.doc, i);
1905
+ let e = $e.create(a.state.doc, i);
1903
1906
  a.dispatch(a.state.tr.setSelection(e));
1904
1907
  } catch {}
1905
1908
  e.selectedImage.value = {
@@ -1913,7 +1916,7 @@ function Hi(e) {
1913
1916
  r.value = l(o, i, {
1914
1917
  x: t.clientX,
1915
1918
  y: t.clientY
1916
- }, Bi(s.attrs.wrapType), Vi(s.attrs.cssFloat)), n.value.isOpen = !1;
1919
+ }, Ui(s.attrs.wrapType), Wi(s.attrs.cssFloat)), n.value.isOpen = !1;
1917
1920
  return;
1918
1921
  }
1919
1922
  }
@@ -1948,7 +1951,7 @@ function Hi(e) {
1948
1951
  !o || o.type.name !== "image" || (r.value = l(a.element, a.pmPos, {
1949
1952
  x: t.clientX,
1950
1953
  y: t.clientY
1951
- }, Bi(o.attrs.wrapType), Vi(o.attrs.cssFloat)), n.value.isOpen = !1);
1954
+ }, Ui(o.attrs.wrapType), Wi(o.attrs.cssFloat)), n.value.isOpen = !1);
1952
1955
  }
1953
1956
  function f(t) {
1954
1957
  let n = e.editorView.value, i = r.value;
@@ -1972,16 +1975,16 @@ function Hi(e) {
1972
1975
  case "cut":
1973
1976
  if (e.selectedImage.value) {
1974
1977
  let t = e.selectedImage.value.pmPos;
1975
- Mi(n, t);
1978
+ Fi(n, t);
1976
1979
  let r = n.state.doc.nodeAt(t);
1977
1980
  r && (n.dispatch(n.state.tr.delete(t, t + r.nodeSize)), e.selectedImage.value = null);
1978
1981
  } else n.focus(), document.execCommand("cut");
1979
1982
  break;
1980
1983
  case "copy":
1981
- e.selectedImage.value ? Mi(n, e.selectedImage.value.pmPos) : (n.focus(), document.execCommand("copy"));
1984
+ e.selectedImage.value ? Fi(n, e.selectedImage.value.pmPos) : (n.focus(), document.execCommand("copy"));
1982
1985
  break;
1983
1986
  case "paste":
1984
- Ii(n);
1987
+ zi(n);
1985
1988
  break;
1986
1989
  case "pasteAsPlainText":
1987
1990
  navigator.clipboard.readText().then((e) => {
@@ -1994,7 +1997,7 @@ function Hi(e) {
1994
1997
  break;
1995
1998
  }
1996
1999
  case "selectAll": {
1997
- let e = tt.create(n.state.doc, 0, n.state.doc.content.size);
2000
+ let e = Z.create(n.state.doc, 0, n.state.doc.content.size);
1998
2001
  n.dispatch(n.state.tr.setSelection(e));
1999
2002
  break;
2000
2003
  }
@@ -2002,7 +2005,7 @@ function Hi(e) {
2002
2005
  e.selectedImage.value && (e.showImageProperties.value = !0);
2003
2006
  break;
2004
2007
  case "replaceImage":
2005
- e.selectedImage.value && Li(n, e.selectedImage.value.pmPos);
2008
+ e.selectedImage.value && Bi(n, e.selectedImage.value.pmPos);
2006
2009
  break;
2007
2010
  case "deleteImage":
2008
2011
  if (e.selectedImage.value) {
@@ -2040,7 +2043,7 @@ function Hi(e) {
2040
2043
  }
2041
2044
  //#endregion
2042
2045
  //#region src/composables/useDocumentLifecycle.ts
2043
- function Ui(e) {
2046
+ function Ki(e) {
2044
2047
  async function t(t) {
2045
2048
  e.sidebarAutoOpenedRef.value = !1, await e.loadDocumentBuffer(t);
2046
2049
  }
@@ -2051,74 +2054,41 @@ function Ui(e) {
2051
2054
  e && t(e);
2052
2055
  }), J(e.document, (e) => {
2053
2056
  e && n(e);
2054
- }), Se(async () => {
2055
- await be();
2057
+ }), xe(async () => {
2058
+ await ye();
2056
2059
  let r = e.documentBuffer(), i = e.document();
2057
2060
  r ? await t(r) : i && n(i);
2058
2061
  });
2059
2062
  }
2060
2063
  //#endregion
2061
- //#region src/utils/aiEditRange.ts
2062
- var Wi = ({ blockId: e, doc: t, snapshot: n }) => {
2063
- let r = ln(e);
2064
- if (r !== null) {
2065
- let e = on(t, r);
2066
- if (e !== null) return {
2067
- from: e.from,
2068
- to: e.to
2069
- };
2070
- }
2071
- let i = n ?? an(t), a = i.anchors[e] ?? Gi(e, i);
2072
- return a ? Ki(t.content.size, a) : null;
2073
- }, Gi = (e, t) => {
2074
- let n = un(e);
2075
- if (n === null) return;
2076
- let r = t.blocks.at(n - 1);
2077
- return r ? t.anchors[r.id] : void 0;
2078
- };
2079
- function Ki(e, t) {
2080
- return {
2081
- from: Math.min(Math.max(t.from, 0), e),
2082
- to: Math.min(Math.max(t.to, 0), e)
2083
- };
2084
- }
2085
- //#endregion
2086
- //#region src/utils/pageText.ts
2087
- var qi = (e, t, n) => {
2088
- if (!e || !Number.isInteger(n) || n < 1) return null;
2089
- let r = e.pages[n - 1];
2090
- if (!r) return null;
2091
- let i = [];
2092
- for (let e of r.fragments) typeof e.pmStart != "number" || typeof e.pmEnd != "number" || i.push(t.textBetween(e.pmStart, e.pmEnd, "\n"));
2093
- return i.join("\n");
2094
- };
2095
- //#endregion
2096
2064
  //#region src/composables/useDocxEditorRefApi.ts
2065
+ var qi = Date.now();
2097
2066
  function Ji(e) {
2098
- function t() {
2067
+ let t = [];
2068
+ function n() {
2099
2069
  e.onPrint?.(), window.print();
2100
2070
  }
2101
- async function n(t) {
2071
+ async function r(t) {
2102
2072
  let n = await e.save(t);
2103
2073
  if (!n) return null;
2104
2074
  let r = await n.arrayBuffer();
2105
2075
  return e.clearCommentsDirty(), e.onSave?.(r), r;
2106
2076
  }
2107
- function r(t, n) {
2077
+ function i(t, n) {
2108
2078
  let r = e.pagesRef.value;
2109
2079
  if (!r) return !1;
2110
- let i = Yt(r, t), a = i.at(0);
2080
+ let i = $t(r, t), a = i.at(0);
2111
2081
  return a ? (a.scrollIntoView({
2112
2082
  block: "center",
2113
2083
  behavior: "smooth"
2114
- }), n?.highlight && Xt(i, n.highlight), !0) : !1;
2084
+ }), n?.highlight && en(i, n.highlight), !0) : !1;
2115
2085
  }
2116
- function i() {
2086
+ function a() {
2117
2087
  return e.zoom.value;
2118
2088
  }
2119
- let a = null;
2120
- function o() {
2121
- return a ??= {
2089
+ let o = null;
2090
+ function s() {
2091
+ return o ??= {
2122
2092
  getEditor: () => e.editor,
2123
2093
  getDocument: () => e.editor.getDocument(),
2124
2094
  getState: () => e.editor.getState(),
@@ -2137,26 +2107,26 @@ function Ji(e) {
2137
2107
  getLayout: () => e.editor.getLayout(),
2138
2108
  relayout: () => e.editor.relayout(),
2139
2109
  scrollToPosition: (t) => e.scrollVisiblePositionIntoView(t),
2140
- scrollToPage: l,
2141
- scrollToParaId: r,
2110
+ scrollToPage: u,
2111
+ scrollToParaId: i,
2142
2112
  getPageNumberForPmPos: (t) => {
2143
2113
  let n = e.layout.value;
2144
2114
  if (!n) return null;
2145
- let r = Jt(n, t);
2115
+ let r = Qt(n, t);
2146
2116
  return r == null ? null : r + 1;
2147
2117
  }
2148
- }, a;
2118
+ }, o;
2149
2119
  }
2150
- function s() {
2120
+ function c() {
2151
2121
  return e.layout.value?.pages.length ?? 0;
2152
2122
  }
2153
- function c() {
2123
+ function l() {
2154
2124
  let t = e.layout.value, n = e.editorView.value;
2155
2125
  if (!t || !n) return 0;
2156
- let r = Jt(t, n.state.selection.from);
2126
+ let r = Qt(t, n.state.selection.from);
2157
2127
  return r == null ? 0 : r + 1;
2158
2128
  }
2159
- function l(t) {
2129
+ function u(t) {
2160
2130
  if (!Number.isInteger(t) || t < 1) return;
2161
2131
  let n = e.pagesViewportRef.value, r = e.pagesRef.value?.querySelector(`[data-page-number="${t}"]`);
2162
2132
  if (!n || !r) return;
@@ -2169,28 +2139,99 @@ function Ji(e) {
2169
2139
  return { exposed: {
2170
2140
  getDocument: e.getDocument,
2171
2141
  hasPendingChanges: () => e.editorView.value ? e.isDirty.value || e.commentsDirty.value : !1,
2172
- getEditorRef: o,
2142
+ getEditorRef: s,
2173
2143
  getEditor: () => e.editor,
2174
- save: n,
2144
+ save: r,
2175
2145
  setZoom: e.setZoom,
2176
- getZoom: i,
2146
+ getZoom: a,
2177
2147
  focus: e.focus,
2178
- getCurrentPage: c,
2179
- getTotalPages: s,
2180
- scrollToPage: l,
2181
- scrollToParaId: r,
2182
- openPrintPreview: () => t(),
2183
- print: t,
2148
+ getCurrentPage: l,
2149
+ getTotalPages: c,
2150
+ scrollToPage: u,
2151
+ scrollToParaId: i,
2152
+ openPrintPreview: () => n(),
2153
+ print: n,
2184
2154
  loadDocument: e.loadDocument,
2185
2155
  loadDocumentBuffer: e.loadDocumentBuffer,
2186
2156
  ensureEditorView: () => e.editor.ensureView(),
2187
2157
  createAIEditSnapshot: () => {
2188
2158
  let t = e.editorView.value;
2189
- return t ? Ht(t.state.doc) : null;
2159
+ return t ? Gt(t.state.doc) : null;
2160
+ },
2161
+ applyDocumentOperations: ({ snapshot: n, batch: r, author: i = e.author() }) => {
2162
+ Ut(r.version);
2163
+ let a = e.editorView.value;
2164
+ if (!a) {
2165
+ let e = "committed";
2166
+ r.dryRun === !0 ? e = "previewed" : r.atomic === !0 && (e = "rejected");
2167
+ let t = r.operations.map((e) => ({
2168
+ id: e.id,
2169
+ reason: "unsupportedBlock"
2170
+ }));
2171
+ return {
2172
+ version: $,
2173
+ status: e,
2174
+ applied: [],
2175
+ skipped: t,
2176
+ issues: Jt(r.operations, t),
2177
+ receipts: [],
2178
+ undoHandle: null
2179
+ };
2180
+ }
2181
+ let o = t.at(-1);
2182
+ o && (!a.state.doc.eq(o.afterState.doc) || e.getComments() !== o.commentsAfter) && (t.length = 0);
2183
+ let s = e.getComments(), c = {
2184
+ state: a.state,
2185
+ dispatch: (e) => {
2186
+ a.dispatch(xt(e)), c.state = a.state;
2187
+ }
2188
+ }, l = Ht({
2189
+ view: c,
2190
+ snapshot: n,
2191
+ batch: r,
2192
+ author: i,
2193
+ createCommentId: e.createAIEditComment,
2194
+ createUndoHandle: () => ({
2195
+ type: "documentOperationUndo",
2196
+ id: `vue-${String(qi++)}`
2197
+ })
2198
+ });
2199
+ return l.undoHandle !== null && t.push({
2200
+ undoHandle: l.undoHandle,
2201
+ afterState: a.state,
2202
+ commentsBefore: s,
2203
+ commentsAfter: e.getComments()
2204
+ }), l;
2205
+ },
2206
+ undoDocumentOperations: (n) => {
2207
+ let r = t.findIndex((e) => e.undoHandle.type === n.type && e.undoHandle.id === n.id);
2208
+ if (r === -1) return {
2209
+ status: "rejected",
2210
+ undoHandle: n,
2211
+ reason: "unknownHandle"
2212
+ };
2213
+ if (r !== t.length - 1) return {
2214
+ status: "rejected",
2215
+ undoHandle: n,
2216
+ reason: "notLatest"
2217
+ };
2218
+ let i = t.at(-1), a = e.editorView.value;
2219
+ return !i || !a ? {
2220
+ status: "rejected",
2221
+ undoHandle: n,
2222
+ reason: "unknownHandle"
2223
+ } : !a.state.doc.eq(i.afterState.doc) || e.getComments() !== i.commentsAfter || !e.editor.undo() ? {
2224
+ status: "rejected",
2225
+ undoHandle: n,
2226
+ reason: "documentChanged"
2227
+ } : (e.setComments(i.commentsBefore), t.pop(), {
2228
+ status: "undone",
2229
+ undoHandle: n
2230
+ });
2190
2231
  },
2191
2232
  applyAIEditOperations: ({ snapshot: t, operations: n, mode: r = "tracked-changes", author: i = e.author() }) => {
2192
2233
  let a = e.editorView.value;
2193
- return a ? Bt({
2234
+ return a ? Vt({
2194
2235
  view: a,
2195
2236
  snapshot: t,
2196
2237
  operations: n,
@@ -2220,41 +2261,41 @@ function Ji(e) {
2220
2261
  if (!n) return !1;
2221
2262
  let r = jt(n.state, t);
2222
2263
  if (!r) return !1;
2223
- let { from: i, to: a } = Ki(n.state.doc.content.size, r), o = n.state.doc.resolve(i), s = n.state.doc.resolve(a);
2224
- return n.dispatch(n.state.tr.setSelection(tt.between(o, s))), requestAnimationFrame(() => e.scrollVisiblePositionIntoView(i)), !0;
2264
+ let { from: i, to: a } = ln(n.state.doc.content.size, r), o = n.state.doc.resolve(i), s = n.state.doc.resolve(a);
2265
+ return n.dispatch(n.state.tr.setSelection(Z.between(o, s))), requestAnimationFrame(() => e.scrollVisiblePositionIntoView(i)), !0;
2225
2266
  },
2226
2267
  scrollToBlock: (t, n) => {
2227
2268
  let r = e.editorView.value;
2228
2269
  if (!r) return !1;
2229
- let i = Wi({
2270
+ let i = un({
2230
2271
  blockId: t,
2231
2272
  doc: r.state.doc,
2232
2273
  snapshot: n
2233
2274
  });
2234
2275
  if (i === null) return !1;
2235
2276
  let { from: a, to: o } = i, s = r.state.doc.resolve(a), c = r.state.doc.resolve(o);
2236
- return r.dispatch(r.state.tr.setSelection(tt.between(s, c))), requestAnimationFrame(() => e.scrollVisiblePositionIntoView(a)), !0;
2277
+ return r.dispatch(r.state.tr.setSelection(Z.between(s, c))), requestAnimationFrame(() => e.scrollVisiblePositionIntoView(a)), !0;
2237
2278
  },
2238
2279
  getTrackedChanges: () => {
2239
2280
  let t = e.editorView.value;
2240
- return t ? Gt(t.state.doc) : [];
2281
+ return t ? Yt(t.state.doc) : [];
2241
2282
  },
2242
2283
  getCommentAnchors: () => {
2243
2284
  let t = e.editorView.value;
2244
- return t ? Wt(t.state.doc) : [];
2285
+ return t ? qt(t.state.doc) : [];
2245
2286
  },
2246
2287
  getSelectionText: () => {
2247
2288
  let t = e.editorView.value;
2248
- return t ? Me(t.state) : "";
2289
+ return t ? je(t.state) : "";
2249
2290
  },
2250
2291
  getPageText: (t) => {
2251
2292
  let n = e.editorView.value;
2252
- return n ? qi(e.layout.value, n.state.doc, t) : null;
2293
+ return n ? dn(e.layout.value, n.state.doc, t) : null;
2253
2294
  },
2254
2295
  getContentControls: (t = {}) => {
2255
2296
  let n = e.editorView.value;
2256
- return n ? $t(n.state.doc, t).map((e) => ({
2257
- properties: Zt(e.node),
2297
+ return n ? rn(n.state.doc, t).map((e) => ({
2298
+ properties: tn(e.node),
2258
2299
  path: e.path,
2259
2300
  pmPos: e.pos
2260
2301
  })) : [];
@@ -2262,27 +2303,27 @@ function Ji(e) {
2262
2303
  scrollToContentControl: (t) => {
2263
2304
  let n = e.editorView.value;
2264
2305
  if (!n) return !1;
2265
- let r = Qt(n.state.doc, t);
2306
+ let r = nn(n.state.doc, t);
2266
2307
  if (!r) return !1;
2267
2308
  let i = r.pos + 1, a = n.state.doc.resolve(i);
2268
- return n.dispatch(n.state.tr.setSelection(tt.near(a))), requestAnimationFrame(() => e.scrollVisiblePositionIntoView(i)), !0;
2309
+ return n.dispatch(n.state.tr.setSelection(Z.near(a))), requestAnimationFrame(() => e.scrollVisiblePositionIntoView(i)), !0;
2269
2310
  },
2270
2311
  setContentControlContent: (t, n, r = {}) => {
2271
2312
  let i = e.editorView.value;
2272
2313
  if (!i) return !1;
2273
- let a = typeof n == "string" ? tn(i.state, t, n, r) : rn(i.state, t, n, r);
2314
+ let a = typeof n == "string" ? on(i.state, t, n, r) : cn(i.state, t, n, r);
2274
2315
  return a ? (i.dispatch(a), !0) : !1;
2275
2316
  },
2276
2317
  setContentControlValue: (t, n, r = {}) => {
2277
2318
  let i = e.editorView.value;
2278
2319
  if (!i) return !1;
2279
- let a = nn(i.state, t, n, r);
2320
+ let a = sn(i.state, t, n, r);
2280
2321
  return a ? (i.dispatch(a), !0) : !1;
2281
2322
  },
2282
2323
  removeContentControl: (t, n = {}) => {
2283
2324
  let r = e.editorView.value;
2284
2325
  if (!r) return !1;
2285
- let i = en(r.state, t, n);
2326
+ let i = an(r.state, t, n);
2286
2327
  return i ? (r.dispatch(i), !0) : !1;
2287
2328
  }
2288
2329
  } };
@@ -2300,22 +2341,22 @@ function Yi(e) {
2300
2341
  if (!r) return;
2301
2342
  let i = e.getDocument(), a = i?.package?.styles;
2302
2343
  if (a) {
2303
- let e = Ae(a).resolveParagraphStyle(n), t = { numbering: i?.package?.numbering ? vn(i.package.numbering) : null };
2304
- e.paragraphFormatting && (t.paragraphFormatting = e.paragraphFormatting), e.runFormatting && (t.runFormatting = e.runFormatting), pn(n, t)(r.state, (e) => r.dispatch(e));
2305
- } else pn(n)(r.state, (e) => r.dispatch(e));
2344
+ let e = ke(a).resolveParagraphStyle(n), t = { numbering: i?.package?.numbering ? _n(i.package.numbering) : null };
2345
+ e.paragraphFormatting && (t.paragraphFormatting = e.paragraphFormatting), e.runFormatting && (t.runFormatting = e.runFormatting), fn(n, t)(r.state, (e) => r.dispatch(e));
2346
+ } else fn(n)(r.state, (e) => r.dispatch(e));
2306
2347
  r.focus();
2307
2348
  }
2308
2349
  function i() {
2309
2350
  let t = e.editorView.value;
2310
- t && (yn(t.state, (e) => t.dispatch(e), t), t.focus());
2351
+ t && (vn(t.state, (e) => t.dispatch(e), t), t.focus());
2311
2352
  }
2312
2353
  function a() {
2313
2354
  let t = e.editorView.value;
2314
- t && (xn(t.state, (e) => t.dispatch(e), t), t.focus());
2355
+ t && (bn(t.state, (e) => t.dispatch(e), t), t.focus());
2315
2356
  }
2316
2357
  function o() {
2317
2358
  let t = e.editorView.value;
2318
- t && (bn(t.state, (e) => t.dispatch(e), t), t.focus());
2359
+ t && (yn(t.state, (e) => t.dispatch(e), t), t.focus());
2319
2360
  }
2320
2361
  function s(e) {
2321
2362
  let n = t();
@@ -2365,14 +2406,14 @@ function Xi(e) {
2365
2406
  }
2366
2407
  function o(n, r) {
2367
2408
  let i = e.editorView.value;
2368
- i && (Sn(i, {
2409
+ i && (xn(i, {
2369
2410
  displayText: n,
2370
2411
  href: r
2371
2412
  }), t.value = null, i.focus());
2372
2413
  }
2373
2414
  function s() {
2374
2415
  let n = e.editorView.value;
2375
- n && (Cn(n, { popupHref: t.value?.href }), t.value = null, n.focus());
2416
+ n && (Sn(n, { popupHref: t.value?.href }), t.value = null, n.focus());
2376
2417
  }
2377
2418
  return {
2378
2419
  hyperlinkPopupData: t,
@@ -2386,7 +2427,7 @@ function Xi(e) {
2386
2427
  //#endregion
2387
2428
  //#region src/composables/useImageActions.ts
2388
2429
  function Zi(e) {
2389
- let t = Te(null), n = W(!1), r = N(() => {
2430
+ let t = we(null), n = W(!1), r = N(() => {
2390
2431
  e.stateTick.value;
2391
2432
  let n = e.editorView.value, r = t.value;
2392
2433
  if (!n || !r) return null;
@@ -2405,9 +2446,9 @@ function Zi(e) {
2405
2446
  function a(n) {
2406
2447
  let r = e.editorView.value, a = t.value;
2407
2448
  if (!r || !a) return;
2408
- let o = ct(n);
2449
+ let o = st(n);
2409
2450
  if (!o) return;
2410
- let s = r.state.doc.nodeAt(a.pmPos)?.attrs.wrapType === "inline" && o !== "inline" ? { initialPositionEmu: it(a.element, e.zoom.value) } : void 0, c = e.getCommands().setImageWrapType;
2451
+ let s = r.state.doc.nodeAt(a.pmPos)?.attrs.wrapType === "inline" && o !== "inline" ? { initialPositionEmu: rt(a.element, e.zoom.value) } : void 0, c = e.getCommands().setImageWrapType;
2411
2452
  c && (i(r, c(a.pmPos, o, s)), r.focus());
2412
2453
  }
2413
2454
  function o(n) {
@@ -2450,14 +2491,14 @@ function Qi(e) {
2450
2491
  e.disableFindReplaceShortcuts?.() && (t.key === "f" || t.key === "h") || (t.key === "f" || t.key === "h" ? (t.preventDefault(), e.showFindReplace.value = !0) : t.key === "k" ? (t.preventDefault(), e.showHyperlink.value = !0) : t.key === "/" && (t.preventDefault(), e.showKeyboardShortcuts.value = !e.showKeyboardShortcuts.value));
2451
2492
  }
2452
2493
  }
2453
- return Se(() => window.addEventListener("keydown", t)), xe(() => window.removeEventListener("keydown", t)), { handleKeyDown: t };
2494
+ return xe(() => window.addEventListener("keydown", t)), be(() => window.removeEventListener("keydown", t)), { handleKeyDown: t };
2454
2495
  }
2455
2496
  //#endregion
2456
2497
  //#region src/composables/useOutlineSidebar.ts
2457
2498
  function $i(e) {
2458
2499
  function t() {
2459
2500
  let t = e.editorView.value;
2460
- t && (e.outlineHeadings.value = wn(t.state.doc));
2501
+ t && (e.outlineHeadings.value = Cn(t.state.doc));
2461
2502
  }
2462
2503
  function n() {
2463
2504
  e.showOutline.value || t(), e.showOutline.value = !e.showOutline.value;
@@ -2468,7 +2509,7 @@ function $i(e) {
2468
2509
  function i(t) {
2469
2510
  let n = e.editorView.value;
2470
2511
  if (!n) return;
2471
- let r = n.state.doc.resolve(Math.min(t + 1, n.state.doc.content.size)), i = tt.near(r);
2512
+ let r = n.state.doc.resolve(Math.min(t + 1, n.state.doc.content.size)), i = Z.near(r);
2472
2513
  n.dispatch(n.state.tr.setSelection(i)), e.scrollToVisiblePosition(t), n.focus();
2473
2514
  }
2474
2515
  function a() {
@@ -2515,19 +2556,19 @@ function ea(e) {
2515
2556
  }
2516
2557
  function s(t) {
2517
2558
  let n = e.editorView.value;
2518
- n && gn(t)(n.state, n.dispatch);
2559
+ n && hn(t)(n.state, n.dispatch);
2519
2560
  }
2520
2561
  function c(t) {
2521
2562
  let n = e.editorView.value;
2522
- n && _n(t)(n.state, n.dispatch);
2563
+ n && gn(t)(n.state, n.dispatch);
2523
2564
  }
2524
2565
  function l(t) {
2525
2566
  let n = e.editorView.value;
2526
- n && (t < 0 ? hn(-t, !0)(n.state, n.dispatch) : hn(t, !1)(n.state, n.dispatch));
2567
+ n && (t < 0 ? mn(-t, !0)(n.state, n.dispatch) : mn(t, !1)(n.state, n.dispatch));
2527
2568
  }
2528
2569
  function u(t) {
2529
2570
  let n = e.editorView.value;
2530
- n && mn(t)(n.state, n.dispatch);
2571
+ n && pn(t)(n.state, n.dispatch);
2531
2572
  }
2532
2573
  return {
2533
2574
  handlePageSetupApply: t,
@@ -2571,7 +2612,7 @@ function aa(e, t) {
2571
2612
  //#endregion
2572
2613
  //#region src/utils/domQueries.ts
2573
2614
  function oa(e, t, n) {
2574
- let r = n ? Array.from(e.querySelectorAll(`.layout-page-${n} span[data-pm-start][data-pm-end]`)) : vt(e);
2615
+ let r = n ? Array.from(e.querySelectorAll(`.layout-page-${n} span[data-pm-start][data-pm-end]`)) : _t(e);
2575
2616
  for (let e of r) {
2576
2617
  let n = Number(e.dataset.pmStart), r = Number(e.dataset.pmEnd);
2577
2618
  if (!Number.isNaN(n) && !Number.isNaN(r) && t >= n && t <= r) return e;
@@ -2580,8 +2621,8 @@ function oa(e, t, n) {
2580
2621
  }
2581
2622
  function sa(e, t, n) {
2582
2623
  if (!e || !t) return;
2583
- let r = _t(e, n);
2584
- if (!r) for (let t of vt(e)) {
2624
+ let r = gt(e, n);
2625
+ if (!r) for (let t of _t(e)) {
2585
2626
  let e = Number(t.dataset.pmStart), i = Number(t.dataset.pmEnd);
2586
2627
  if (Number.isFinite(e) && Number.isFinite(i) && n >= e && n <= i) {
2587
2628
  r = t;
@@ -2597,7 +2638,7 @@ function sa(e, t, n) {
2597
2638
  }
2598
2639
  function ca(e, t, n, r) {
2599
2640
  if (!e || !t) return null;
2600
- let i = dt(e, n, r, 1);
2641
+ let i = ut(e, n, r, 1);
2601
2642
  return i === null || i < 0 ? null : Math.min(i, t.state.doc.content.size);
2602
2643
  }
2603
2644
  function la(e, t, n, r) {
@@ -2624,7 +2665,7 @@ function fa(e) {
2624
2665
  function r() {
2625
2666
  n !== null && (clearTimeout(n), n = null);
2626
2667
  }
2627
- let i = Te(null), a = 0, o = null, s = 0, c = !1, l = null, u = Dn(), d = ie({
2668
+ let i = we(null), a = 0, o = null, s = 0, c = !1, l = null, u = En(), d = re({
2628
2669
  pagesContainer: e.pagesRef,
2629
2670
  onScrollExtendSelection: (e, t) => {
2630
2671
  if (!c || l === null) return;
@@ -2650,7 +2691,7 @@ function fa(e) {
2650
2691
  function g(e, t) {
2651
2692
  let n = h();
2652
2693
  if (n) try {
2653
- let r = n.state.doc.resolve(e), i = t === void 0 ? r : n.state.doc.resolve(t), a = tt.between(r, i);
2694
+ let r = n.state.doc.resolve(e), i = t === void 0 ? r : n.state.doc.resolve(t), a = Z.between(r, i);
2654
2695
  n.dispatch(n.state.tr.setSelection(a));
2655
2696
  } catch {}
2656
2697
  }
@@ -2690,7 +2731,7 @@ function fa(e) {
2690
2731
  if (!o) return;
2691
2732
  let s = e.pagesViewportRef.value;
2692
2733
  if (!s || !(a.target instanceof HTMLElement)) return;
2693
- let l = En({
2734
+ let l = Tn({
2694
2735
  mouseX: a.clientX,
2695
2736
  mouseY: a.clientY,
2696
2737
  pagesContainer: o,
@@ -2700,7 +2741,7 @@ function fa(e) {
2700
2741
  if (!l) {
2701
2742
  n === null && (n = setTimeout(() => {
2702
2743
  t.value = null, n = null;
2703
- }, Tn));
2744
+ }, wn));
2704
2745
  return;
2705
2746
  }
2706
2747
  let u = e.zoom.value || 1, d = s.getBoundingClientRect();
@@ -2715,7 +2756,7 @@ function fa(e) {
2715
2756
  n.preventDefault(), n.stopPropagation();
2716
2757
  let r = t.value, i = e.editorView.value;
2717
2758
  if (!r || !i) return;
2718
- let a = i.state.tr.setSelection(tt.create(i.state.doc, r.cellPmPos + 1));
2759
+ let a = i.state.tr.setSelection(Z.create(i.state.doc, r.cellPmPos + 1));
2719
2760
  i.dispatch(a);
2720
2761
  let o = e.getCommands(), s = r.type === "row" ? o.addRowBelow : o.addColumnRight;
2721
2762
  s && (s()(i.state, (e) => i.dispatch(e), i), t.value = null, i.focus());
@@ -2820,7 +2861,7 @@ function fa(e) {
2820
2861
  let o = a.get(r.rId);
2821
2862
  o && (o.content = t), e.syncHfPMs?.(), e.reLayout(), e.emit("change", n);
2822
2863
  }
2823
- function re() {
2864
+ function ie() {
2824
2865
  let t = e.getDocument(), n = i.value;
2825
2866
  if (!t?.package || !n || !n.rId) {
2826
2867
  i.value = null;
@@ -2860,13 +2901,13 @@ function fa(e) {
2860
2901
  i.value && d && (d.closest(".layout-page-header") || d.closest(".layout-page-footer") || d.closest(".hf-editor") || (i.value = null, n.focus()));
2861
2902
  let f = h() ?? n;
2862
2903
  if (!e.readOnly.value && e.tableResize.tryStartResize(t, f)) return;
2863
- let p = ot(r);
2904
+ let p = at(r);
2864
2905
  if (p) {
2865
2906
  t.preventDefault(), t.stopPropagation();
2866
2907
  let n = Number(p.dataset.pmStart);
2867
2908
  if (!Number.isNaN(n)) {
2868
2909
  try {
2869
- f.dispatch(f.state.tr.setSelection(Z.create(f.state.doc, n)));
2910
+ f.dispatch(f.state.tr.setSelection($e.create(f.state.doc, n)));
2870
2911
  } catch {}
2871
2912
  e.selectedImage.value = {
2872
2913
  element: p,
@@ -2890,7 +2931,7 @@ function fa(e) {
2890
2931
  else if (t.shiftKey) {
2891
2932
  let { from: e } = f.state.selection;
2892
2933
  g(e, _);
2893
- } else g(_), l = _, c = !0, u.begin(On(f, _));
2934
+ } else g(_), l = _, c = !0, u.begin(Dn(f, _));
2894
2935
  f.focus();
2895
2936
  }
2896
2937
  function ae(e) {
@@ -2934,9 +2975,9 @@ function fa(e) {
2934
2975
  };
2935
2976
  }, 600);
2936
2977
  }
2937
- return Se(() => {
2978
+ return xe(() => {
2938
2979
  window.addEventListener("mousemove", ae), window.addEventListener("mouseup", oe), e.pagesViewportRef.value?.addEventListener("scroll", w, { passive: !0 });
2939
- }), xe(() => {
2980
+ }), be(() => {
2940
2981
  r(), window.removeEventListener("mousemove", ae), window.removeEventListener("mouseup", oe), e.pagesViewportRef.value?.removeEventListener("scroll", w), p && clearTimeout(p);
2941
2982
  }), {
2942
2983
  tableInsertButton: t,
@@ -2953,7 +2994,7 @@ function fa(e) {
2953
2994
  handleTableInsertClick: ee,
2954
2995
  clearTableInsertTimer: r,
2955
2996
  handleHfSave: ne,
2956
- handleHfRemove: re
2997
+ handleHfRemove: ie
2957
2998
  };
2958
2999
  }
2959
3000
  //#endregion
@@ -3034,7 +3075,7 @@ var ba = { class: "docx-editor-vue__toolbar-shell" }, xa = {
3034
3075
  "data-testid": "selection-overlay",
3035
3076
  class: "docx-editor-vue__decoration-origin",
3036
3077
  "aria-hidden": "true"
3037
- }, ka = ["aria-label"], Aa = /*#__PURE__*/ t(/* @__PURE__ */ B({
3078
+ }, ka = ["aria-label"], Aa = /*#__PURE__*/ t(/* @__PURE__ */ z({
3038
3079
  __name: "DocxEditor",
3039
3080
  props: {
3040
3081
  documentBuffer: { default: null },
@@ -3154,21 +3195,21 @@ var ba = { class: "docx-editor-vue__toolbar-shell" }, xa = {
3154
3195
  ],
3155
3196
  setup(t, { expose: n, emit: a }) {
3156
3197
  let o = t, s = a;
3157
- e(), i(o.components), yr(W(!1));
3158
- let l = W(o.mode), u = N(() => o.readOnly || l.value === "viewing"), d = N(() => o.showReviewControls), f = N(() => lt(l.value)), p = W("all-markup");
3159
- function m() {
3160
- dn(ut(l.value));
3198
+ e(), i(o.components), Sr(W(!1));
3199
+ let l = W(o.mode), u = N(() => o.readOnly || l.value === "viewing"), d = N(() => o.showReviewControls), f = N(() => ct(l.value)), p = W("all-markup");
3200
+ function h() {
3201
+ dn(lt(l.value));
3161
3202
  }
3162
- function g(e) {
3203
+ function y(e) {
3163
3204
  p.value = e;
3164
3205
  }
3165
3206
  let b = N(() => p.value === "all-markup" ? "" : `folio-root--${p.value}`), { t: x } = c(), S = ({ node: e }) => e;
3166
3207
  S.props = ["node"];
3167
- let te = N(() => o.documentBuffer != null || o.document != null), re = W(!1);
3168
- J(te, (e) => {
3208
+ let ne = N(() => o.documentBuffer != null || o.document != null), re = W(!1);
3209
+ J(ne, (e) => {
3169
3210
  e || (re.value = !1);
3170
3211
  });
3171
- let ie = W(null), T = W(null), se = W(null), ce = W(null), le = N(() => o.showRuler ?? !1), E = W(0), D = W(!1), ue = W(!1), de = W(!1), fe = W(!1), O = W(!1), k = W(!1), A = W(o.showOutline), j = W(!1), pe = W(null), me = Te([]), ge = Te([]), { zoom: B, zoomPercent: _e, isMinZoom: ve, isMaxZoom: be, setZoom: Ce, zoomIn: G, zoomOut: Ee, handleWheel: Oe, handleKeyDown: ke, ZOOM_PRESETS: Ae } = w(o.initialZoom);
3212
+ let w = W(null), T = W(null), se = W(null), ce = W(null), le = N(() => o.showRuler ?? !1), E = W(0), D = W(!1), ue = W(!1), de = W(!1), fe = W(!1), O = W(!1), k = W(!1), A = W(o.showOutline), M = W(!1), pe = W(null), he = we([]), z = we([]), { zoom: B, zoomPercent: _e, isMinZoom: ye, isMaxZoom: Se, setZoom: G, zoomIn: Te, zoomOut: De, handleWheel: Oe, handleKeyDown: ke, ZOOM_PRESETS: je } = oe(o.initialZoom);
3172
3213
  function Me(e) {
3173
3214
  o.enableWheelZoom !== !1 && Oe(e);
3174
3215
  }
@@ -3178,8 +3219,8 @@ var ba = { class: "docx-editor-vue__toolbar-shell" }, xa = {
3178
3219
  showHyperlink: ue,
3179
3220
  handleZoomKeyDown: ke
3180
3221
  });
3181
- let { editor: Ne, editorView: X, editorState: Ie, isReady: Re, isDirty: Ke, parseError: qe, layout: Je, blocks: Ye, measures: Xe, loadBuffer: Ze, loadDocument: Qe, save: $e, getDocument: Z, getCommands: et, focus: tt, reLayout: nt } = ae({
3182
- hiddenContainer: ie,
3222
+ let { editor: Pe, editorView: X, editorState: Le, isReady: Ge, isDirty: Ke, parseError: qe, layout: Je, blocks: Ye, measures: Xe, loadBuffer: Ze, loadDocument: Qe, save: $e, getDocument: et, getCommands: Z, focus: tt, reLayout: nt } = C({
3223
+ hiddenContainer: w,
3183
3224
  pagesContainer: T,
3184
3225
  readOnly: u,
3185
3226
  editorMode: l,
@@ -3198,7 +3239,7 @@ var ba = { class: "docx-editor-vue__toolbar-shell" }, xa = {
3198
3239
  o.onError?.(e), s("error", e);
3199
3240
  },
3200
3241
  onSelectionUpdate: (e) => {
3201
- if (o.onSelectionChange?.(je(e)), o.onSelectionTextChange) {
3242
+ if (o.onSelectionChange?.(Ae(e)), o.onSelectionTextChange) {
3202
3243
  let { from: t, to: n } = e.selection, r = t === n ? "" : e.doc.textBetween(t, n, " ", " ");
3203
3244
  o.onSelectionTextChange({
3204
3245
  from: t,
@@ -3211,9 +3252,9 @@ var ba = { class: "docx-editor-vue__toolbar-shell" }, xa = {
3211
3252
  onReadOnlyEditAttempt: () => o.onReadonlyEditAttempt?.(),
3212
3253
  featureFlags: () => o.featureFlags,
3213
3254
  onSelectiveSaveTripwire: o.onSelectiveSaveTripwire ? (e) => o.onSelectiveSaveTripwire?.(e) : void 0
3214
- }), rt = N(() => !Re.value && te.value && !(o.preserveDocumentWhileLoading === !0 && re.value));
3255
+ }), rt = N(() => !Ge.value && ne.value && !(o.preserveDocumentWhileLoading === !0 && re.value));
3215
3256
  function it() {
3216
- X.value && (Ue(), He(), nt());
3257
+ X.value && (He(), Ve(), nt());
3217
3258
  }
3218
3259
  J(() => o.fonts, (e, t, n) => {
3219
3260
  if (!e || e.length === 0) return;
@@ -3228,15 +3269,15 @@ var ba = { class: "docx-editor-vue__toolbar-shell" }, xa = {
3228
3269
  r = !0, i.length !== 0 && (ya(i), it());
3229
3270
  });
3230
3271
  }, { immediate: !0 });
3231
- let { selectedImage: at, imageInteracting: ot, imageToolbarContext: st, handleToolbarImageWrap: ct, handleImageTransform: dt } = Zi({
3272
+ let { selectedImage: at, imageInteracting: ot, imageToolbarContext: st, handleToolbarImageWrap: ut, handleImageTransform: dt } = Zi({
3232
3273
  editorView: X,
3233
3274
  zoom: B,
3234
3275
  stateTick: E,
3235
- getCommands: et
3276
+ getCommands: Z
3236
3277
  }), { hyperlinkPopupData: ft, handleHyperlinkSubmit: pt, handleHyperlinkRemove: mt, handleHyperlinkPopupNavigate: ht, handleHyperlinkPopupEdit: gt, handleHyperlinkPopupRemove: _t } = Xi({
3237
3278
  editorView: X,
3238
- getCommands: et
3239
- }), vt = C(), { tableInsertButton: yt, scrollPageInfo: bt, resolvePos: xt, setPmSelection: St, scrollVisiblePositionIntoView: Ct, handlePagesMouseDown: wt, handlePagesMouseMove: Tt, handlePagesClick: Et, handleTableInsertClick: Dt } = fa({
3279
+ getCommands: Z
3280
+ }), vt = ie(), { tableInsertButton: yt, scrollPageInfo: bt, resolvePos: xt, setPmSelection: St, scrollVisiblePositionIntoView: Ct, handlePagesMouseDown: wt, handlePagesMouseMove: Tt, handlePagesClick: Et, handleTableInsertClick: Dt } = fa({
3240
3281
  editorView: X,
3241
3282
  pagesRef: T,
3242
3283
  pagesViewportRef: se,
@@ -3250,40 +3291,40 @@ var ba = { class: "docx-editor-vue__toolbar-shell" }, xa = {
3250
3291
  tryStartResize: vt.tryStartResize,
3251
3292
  isResizing: N(() => vt.isResizing())
3252
3293
  },
3253
- getCommands: et,
3254
- getDocument: Z,
3294
+ getCommands: Z,
3295
+ getDocument: et,
3255
3296
  reLayout: nt,
3256
3297
  emit: () => {},
3257
3298
  clearOverlay: () => {}
3258
3299
  }), Ot = $i({
3259
3300
  editorView: X,
3260
3301
  showOutline: A,
3261
- showSidebar: j,
3262
- outlineHeadings: ge,
3302
+ showSidebar: M,
3303
+ outlineHeadings: z,
3263
3304
  activeSidebarItem: pe,
3264
3305
  extractCommentsAndChanges: () => {},
3265
3306
  scrollToVisiblePosition: Ct
3266
- }), { contextMenu: kt, imageContextMenu: At, imageContextMenuTextActions: jt, customTextMenuItems: Mt, handleContextMenu: Nt, handleSelectedImageContextMenu: Pt, handleImageWrapSelect: Ft, handleContextMenuAction: It } = Hi({
3307
+ }), { contextMenu: kt, imageContextMenu: At, imageContextMenuTextActions: jt, customTextMenuItems: Mt, handleContextMenu: Nt, handleSelectedImageContextMenu: Pt, handleImageWrapSelect: Ft, handleContextMenuAction: It } = Gi({
3267
3308
  editorView: X,
3268
3309
  selectedImage: at,
3269
3310
  zoom: B,
3270
3311
  showImageProperties: O,
3271
- getCommands: et,
3312
+ getCommands: Z,
3272
3313
  clearOverlay: () => {},
3273
3314
  setPmSelection: St,
3274
3315
  resolvePos: xt,
3275
3316
  customContextMenuItems: () => u.value ? void 0 : o.customContextMenuItems,
3276
3317
  onCustomContextAction: (e, t) => o.onCustomContextAction?.(e, t)
3277
- }), Lt = oe(X, E), Rt = N(() => Lt.value.entries), Q = Ai({
3318
+ }), Lt = ae(X, E), Rt = N(() => Lt.value.entries), Q = Ni({
3278
3319
  editorView: X,
3279
- getDocument: Z,
3320
+ getDocument: et,
3280
3321
  author: () => o.author,
3281
3322
  commentsProp: () => o.comments,
3282
3323
  onCommentsChange: (e) => {
3283
3324
  o.onCommentsChange?.(e), s("comments-change", e);
3284
3325
  },
3285
3326
  reLayout: nt
3286
- }), zt = Q.comments, $ = ki({
3327
+ }), zt = Q.comments, $ = Mi({
3287
3328
  editorView: X,
3288
3329
  pagesViewport: se,
3289
3330
  pagesContainer: T,
@@ -3291,7 +3332,7 @@ var ba = { class: "docx-editor-vue__toolbar-shell" }, xa = {
3291
3332
  createComment: Q.createComment,
3292
3333
  pushComment: Q.pushComment,
3293
3334
  reLayout: nt,
3294
- showSidebar: j,
3335
+ showSidebar: M,
3295
3336
  setActiveSidebarItem: (e) => {
3296
3337
  pe.value = e;
3297
3338
  }
@@ -3301,15 +3342,15 @@ var ba = { class: "docx-editor-vue__toolbar-shell" }, xa = {
3301
3342
  }
3302
3343
  let Vt = N(() => {
3303
3344
  E.value;
3304
- let e = Z()?.package.document;
3345
+ let e = et()?.package.document;
3305
3346
  return e ? e.finalSectionProperties ?? e.sections?.[0]?.properties ?? null : null;
3306
3347
  }), Ht = N(() => {
3307
3348
  E.value;
3308
3349
  let e = {};
3309
3350
  o.fontFamilies !== void 0 && (e.fontFamilies = o.fontFamilies);
3310
- let t = Z()?.package.styles?.styles;
3351
+ let t = et()?.package.styles?.styles;
3311
3352
  return t !== void 0 && (e.documentStyles = t), e;
3312
- }), Ut = N(() => Ge(Vt.value?.pageWidth ?? 12240) * B.value), Wt = N(() => {
3353
+ }), Ut = N(() => We(Vt.value?.pageWidth ?? 12240) * B.value), Wt = N(() => {
3313
3354
  let e = /* @__PURE__ */ new Set();
3314
3355
  for (let t of zt.value) t.done && e.add(t.id);
3315
3356
  return e;
@@ -3319,7 +3360,7 @@ var ba = { class: "docx-editor-vue__toolbar-shell" }, xa = {
3319
3360
  transition: "transform 0.2s ease"
3320
3361
  })), { handleApplyStyle: Kt, handleInsertSymbol: qt, handleInsertSectionBreakNextPage: Jt, handleInsertSectionBreakContinuous: Yt } = Yi({
3321
3362
  editorView: X,
3322
- getDocument: Z
3363
+ getDocument: et
3323
3364
  });
3324
3365
  function Xt() {
3325
3366
  if (o.onInsertImage) {
@@ -3331,7 +3372,7 @@ var ba = { class: "docx-editor-vue__toolbar-shell" }, xa = {
3331
3372
  let t = document.createElement("input");
3332
3373
  t.type = "file", t.accept = "image/*", t.style.display = "none", t.addEventListener("change", () => {
3333
3374
  let n = t.files?.[0];
3334
- n && Pe(e, n, () => e.focus()), t.remove();
3375
+ n && Ne(e, n, () => e.focus()), t.remove();
3335
3376
  }), document.body.appendChild(t), t.click();
3336
3377
  }
3337
3378
  function Zt(e, t) {
@@ -3340,7 +3381,7 @@ var ba = { class: "docx-editor-vue__toolbar-shell" }, xa = {
3340
3381
  return;
3341
3382
  }
3342
3383
  let n = X.value;
3343
- n && (Le(n, e, t), n.focus());
3384
+ n && (Ie(n, e, t), n.focus());
3344
3385
  }
3345
3386
  function Qt() {
3346
3387
  if (o.onInsertPageBreak) {
@@ -3356,11 +3397,11 @@ var ba = { class: "docx-editor-vue__toolbar-shell" }, xa = {
3356
3397
  return;
3357
3398
  }
3358
3399
  let e = X.value;
3359
- e && (ze(e), e.focus());
3400
+ e && (Re(e), e.focus());
3360
3401
  }
3361
3402
  let { handlePageSetupApply: en, handleLeftMarginChange: tn, handleRightMarginChange: nn, handleTopMarginChange: rn, handleBottomMarginChange: an, handleIndentLeftChange: on, handleIndentRightChange: sn, handleFirstLineIndentChange: cn, handleTabStopRemove: ln } = ea({
3362
3403
  editorView: X,
3363
- getDocument: Z,
3404
+ getDocument: et,
3364
3405
  readOnly: u,
3365
3406
  stateTick: E,
3366
3407
  reLayout: nt,
@@ -3369,7 +3410,7 @@ var ba = { class: "docx-editor-vue__toolbar-shell" }, xa = {
3369
3410
  }
3370
3411
  }), un = N(() => {
3371
3412
  E.value;
3372
- let e = X.value, t = e ? Be(e.state).paragraphFormatting : {};
3413
+ let e = X.value, t = e ? ze(e.state).paragraphFormatting : {};
3373
3414
  return {
3374
3415
  indentLeft: t.indentLeft ?? 0,
3375
3416
  indentRight: t.indentRight ?? 0,
@@ -3400,7 +3441,7 @@ var ba = { class: "docx-editor-vue__toolbar-shell" }, xa = {
3400
3441
  Ot.handleToggleOutline();
3401
3442
  break;
3402
3443
  case "toggleSidebar":
3403
- j.value = !j.value;
3444
+ M.value = !M.value;
3404
3445
  break;
3405
3446
  case "insertImage":
3406
3447
  Xt();
@@ -3425,7 +3466,7 @@ var ba = { class: "docx-editor-vue__toolbar-shell" }, xa = {
3425
3466
  Zt(e, t);
3426
3467
  }
3427
3468
  let mn = W(!1);
3428
- Ui({
3469
+ Ki({
3429
3470
  documentBuffer: () => o.documentBuffer ?? null,
3430
3471
  document: () => o.document ?? null,
3431
3472
  loadDocumentBuffer: Ze,
@@ -3449,28 +3490,28 @@ var ba = { class: "docx-editor-vue__toolbar-shell" }, xa = {
3449
3490
  ce.value && (ce.value.scrollTop = e);
3450
3491
  });
3451
3492
  }
3452
- J(Re, (e) => {
3493
+ J(Ge, (e) => {
3453
3494
  if (!e) {
3454
3495
  hn.value = !1;
3455
3496
  return;
3456
3497
  }
3457
3498
  re.value = !0, Ot.recomputeHeadingsIfOpen(), Q.seedFromDocument();
3458
- let t = Z();
3459
- t && o.onCompatibilityChange?.(Ve(t)), o.autoOpenReviewSidebar !== !1 && !mn.value && (zt.value.length > 0 || Rt.value.length > 0) && (mn.value = !0, j.value = !0), _n(), s("ready");
3460
- }), Se(() => {
3461
- let e = Ne.on("selectionChange", () => {
3499
+ let t = et();
3500
+ t && o.onCompatibilityChange?.(Be(t)), o.autoOpenReviewSidebar !== !1 && !mn.value && (zt.value.length > 0 || Rt.value.length > 0) && (mn.value = !0, M.value = !0), _n(), s("ready");
3501
+ }), xe(() => {
3502
+ let e = Pe.on("selectionChange", () => {
3462
3503
  E.value++, $.updateFloatingButton();
3463
- }), t = Ne.on("docChange", () => {
3504
+ }), t = Pe.on("docChange", () => {
3464
3505
  E.value++, Ot.recomputeHeadingsIfOpen();
3465
- }), n = Ne.on("layoutComplete", () => {
3506
+ }), n = Pe.on("layoutComplete", () => {
3466
3507
  E.value++;
3467
- }), r = vt.install(), i = We(() => o.onFontsLoaded?.());
3468
- xe(() => {
3508
+ }), r = vt.install(), i = Ue(() => o.onFontsLoaded?.());
3509
+ be(() => {
3469
3510
  e(), t(), n(), r(), i();
3470
3511
  });
3471
3512
  });
3472
3513
  let { exposed: vn } = Ji({
3473
- editor: Ne,
3514
+ editor: Pe,
3474
3515
  editorView: X,
3475
3516
  isDirty: Ke,
3476
3517
  commentsDirty: Q.commentsDirty,
@@ -3485,9 +3526,11 @@ var ba = { class: "docx-editor-vue__toolbar-shell" }, xa = {
3485
3526
  let t = Q.createComment(e);
3486
3527
  return Q.pushComment(t), t.id;
3487
3528
  },
3529
+ getComments: () => Q.comments.value,
3530
+ setComments: Q.setComments,
3488
3531
  focus: tt,
3489
- getDocument: Z,
3490
- setZoom: Ce,
3532
+ getDocument: et,
3533
+ setZoom: G,
3491
3534
  save: $e,
3492
3535
  loadDocument: Qe,
3493
3536
  loadDocumentBuffer: Ze,
@@ -3503,31 +3546,31 @@ var ba = { class: "docx-editor-vue__toolbar-shell" }, xa = {
3503
3546
  ]),
3504
3547
  style: H(t.style)
3505
3548
  }, [
3506
- L("div", ba, [z(_r, {
3549
+ L("div", ba, [R(br, {
3507
3550
  "show-table-insert": o.showTableInsert !== !1,
3508
3551
  onRename: n[0] ||= (e) => s("rename", e),
3509
3552
  onMenuAction: fn,
3510
3553
  onInsertTable: pn
3511
3554
  }, {
3512
- "title-bar-left": De(() => [we(e.$slots, "title-bar-left", {}, void 0, !0)]),
3513
- "title-bar-right": De(() => [we(e.$slots, "title-bar-right", {}, void 0, !0)]),
3555
+ "title-bar-left": Ee(() => [Ce(e.$slots, "title-bar-left", {}, void 0, !0)]),
3556
+ "title-bar-right": Ee(() => [Ce(e.$slots, "title-bar-right", {}, void 0, !0)]),
3514
3557
  _: 3
3515
- }, 8, ["show-table-insert"]), t.showToolbar ? (U(), P(v, ye({
3558
+ }, 8, ["show-table-insert"]), t.showToolbar ? (U(), P(te, ve({
3516
3559
  key: 0,
3517
3560
  view: q(X),
3518
- "get-commands": q(et),
3561
+ "get-commands": q(Z),
3519
3562
  "state-tick": E.value,
3520
3563
  "zoom-percent": q(_e),
3521
- "is-min-zoom": q(ve),
3522
- "is-max-zoom": q(be),
3523
- "zoom-presets": q(Ae),
3564
+ "is-min-zoom": q(ye),
3565
+ "is-max-zoom": q(Se),
3566
+ "zoom-presets": q(je),
3524
3567
  "show-zoom-control": t.showZoomControl,
3525
3568
  "editor-mode": l.value,
3526
3569
  "show-review-controls": d.value,
3527
3570
  "track-changes-on": f.value,
3528
3571
  "display-mode": p.value,
3529
3572
  "read-only": u.value,
3530
- "comments-sidebar-open": j.value,
3573
+ "comments-sidebar-open": M.value,
3531
3574
  "image-context": q(st),
3532
3575
  theme: t.theme ?? null
3533
3576
  }, Ht.value, {
@@ -3538,20 +3581,20 @@ var ba = { class: "docx-editor-vue__toolbar-shell" }, xa = {
3538
3581
  onPageSetup: n[4] ||= (e) => k.value = !0,
3539
3582
  onToggleOutline: q(Ot).handleToggleOutline,
3540
3583
  onApplyStyle: q(Kt),
3541
- onZoomIn: q(G),
3542
- onZoomOut: q(Ee),
3543
- onZoomSet: q(Ce),
3544
- onToggleSidebar: n[5] ||= (e) => j.value = !j.value,
3584
+ onZoomIn: q(Te),
3585
+ onZoomOut: q(De),
3586
+ onZoomSet: q(G),
3587
+ onToggleSidebar: n[5] ||= (e) => M.value = !M.value,
3545
3588
  onModeChange: dn,
3546
- onToggleTrackChanges: m,
3547
- "onUpdate:displayMode": g,
3589
+ onToggleTrackChanges: h,
3590
+ "onUpdate:displayMode": y,
3548
3591
  onImageProperties: n[6] ||= (e) => O.value = !0,
3549
- onImageWrapType: q(ct),
3592
+ onImageWrapType: q(ut),
3550
3593
  onImageTransform: q(dt)
3551
- }), he({
3552
- "table-context": De(() => [z(ee, {
3594
+ }), me({
3595
+ "table-context": Ee(() => [R(_, {
3553
3596
  view: q(X),
3554
- "get-commands": q(et),
3597
+ "get-commands": q(Z),
3555
3598
  "state-tick": E.value,
3556
3599
  theme: t.theme ?? null
3557
3600
  }, null, 8, [
@@ -3563,7 +3606,7 @@ var ba = { class: "docx-editor-vue__toolbar-shell" }, xa = {
3563
3606
  _: 2
3564
3607
  }, [e.$slots["toolbar-extra"] || t.toolbarExtra ? {
3565
3608
  name: "toolbar-extra",
3566
- fn: De(() => [we(e.$slots, "toolbar-extra", {}, () => [t.toolbarExtra ? (U(), P(S, {
3609
+ fn: Ee(() => [Ce(e.$slots, "toolbar-extra", {}, () => [t.toolbarExtra ? (U(), P(S, {
3567
3610
  key: 0,
3568
3611
  node: t.toolbarExtra
3569
3612
  }, null, 8, ["node"])) : F("", !0)], !0)]),
@@ -3593,7 +3636,7 @@ var ba = { class: "docx-editor-vue__toolbar-shell" }, xa = {
3593
3636
  "onImageWrapType",
3594
3637
  "onImageTransform"
3595
3638
  ])) : F("", !0)]),
3596
- z(fr, {
3639
+ R(hr, {
3597
3640
  "show-find-replace": D.value,
3598
3641
  "onUpdate:showFindReplace": n[7] ||= (e) => D.value = e,
3599
3642
  "show-hyperlink": ue.value,
@@ -3605,7 +3648,7 @@ var ba = { class: "docx-editor-vue__toolbar-shell" }, xa = {
3605
3648
  "show-page-setup": k.value,
3606
3649
  "onUpdate:showPageSetup": n[11] ||= (e) => k.value = e,
3607
3650
  view: q(X),
3608
- bookmarks: me.value,
3651
+ bookmarks: he.value,
3609
3652
  "selected-image-pm-pos": q(at)?.pmPos ?? null,
3610
3653
  "section-properties": Vt.value,
3611
3654
  onInsertSymbol: q(qt),
@@ -3627,16 +3670,16 @@ var ba = { class: "docx-editor-vue__toolbar-shell" }, xa = {
3627
3670
  "onHyperlinkRemove",
3628
3671
  "onPageSetupApply"
3629
3672
  ]),
3630
- q(qe) ? (U(), I("div", xa, K(q(qe)), 1)) : rt.value ? (U(), I("div", Sa, [we(e.$slots, "loading-indicator", {}, () => [t.loadingIndicator ? (U(), P(S, {
3673
+ q(qe) ? (U(), I("div", xa, K(q(qe)), 1)) : rt.value ? (U(), I("div", Sa, [Ce(e.$slots, "loading-indicator", {}, () => [t.loadingIndicator ? (U(), P(S, {
3631
3674
  key: 0,
3632
3675
  node: t.loadingIndicator
3633
- }, null, 8, ["node"])) : (U(), I(M, { key: 1 }, [R(K(q(x)("loadingDocument")), 1)], 64))], !0)])) : !q(Re) && !te.value ? (U(), I("div", Ca, [we(e.$slots, "placeholder", {}, () => [t.placeholder ? (U(), P(S, {
3676
+ }, null, 8, ["node"])) : (U(), I(j, { key: 1 }, [ge(K(q(x)("loadingDocument")), 1)], 64))], !0)])) : !q(Ge) && !ne.value ? (U(), I("div", Ca, [Ce(e.$slots, "placeholder", {}, () => [t.placeholder ? (U(), P(S, {
3634
3677
  key: 0,
3635
3678
  node: t.placeholder
3636
- }, null, 8, ["node"])) : (U(), I(M, { key: 1 }, [R("No document loaded")], 64))], !0)])) : F("", !0),
3679
+ }, null, 8, ["node"])) : (U(), I(j, { key: 1 }, [ge("No document loaded")], 64))], !0)])) : F("", !0),
3637
3680
  L("div", {
3638
3681
  ref_key: "hiddenPmRef",
3639
- ref: ie,
3682
+ ref: w,
3640
3683
  class: "docx-editor-vue__hidden-pm paged-editor__hidden-pm"
3641
3684
  }, null, 512),
3642
3685
  L("div", {
@@ -3645,7 +3688,7 @@ var ba = { class: "docx-editor-vue__toolbar-shell" }, xa = {
3645
3688
  class: "docx-editor-vue__editor-scroll",
3646
3689
  onScroll: gn
3647
3690
  }, [L("div", wa, [
3648
- le.value && !u.value ? (U(), I("div", Ta, [z(ne, {
3691
+ le.value && !u.value ? (U(), I("div", Ta, [R(ee, {
3649
3692
  "section-props": Vt.value,
3650
3693
  zoom: q(B),
3651
3694
  unit: t.rulerUnit ?? "inch",
@@ -3679,7 +3722,7 @@ var ba = { class: "docx-editor-vue__toolbar-shell" }, xa = {
3679
3722
  "onFirstLineIndentChange",
3680
3723
  "onTabStopRemove"
3681
3724
  ])])) : F("", !0),
3682
- le.value && !u.value ? (U(), I("div", Ea, [z(y, {
3725
+ le.value && !u.value ? (U(), I("div", Ea, [R(g, {
3683
3726
  "section-props": Vt.value,
3684
3727
  zoom: q(B),
3685
3728
  unit: t.rulerUnit ?? "inch",
@@ -3709,10 +3752,10 @@ var ba = { class: "docx-editor-vue__toolbar-shell" }, xa = {
3709
3752
  ref: T,
3710
3753
  class: "docx-editor-vue__pages paged-editor__pages",
3711
3754
  style: H(Gt.value)
3712
- }, null, 4), L("div", Oa, [z(sr, {
3755
+ }, null, 4), L("div", Oa, [R(ur, {
3713
3756
  "get-view": () => q(X),
3714
3757
  "get-pages-container": () => T.value,
3715
- "editor-state": q(Ie),
3758
+ "editor-state": q(Le),
3716
3759
  zoom: q(B),
3717
3760
  layout: q(Je),
3718
3761
  blocks: q(Ye),
@@ -3731,11 +3774,11 @@ var ba = { class: "docx-editor-vue__toolbar-shell" }, xa = {
3731
3774
  "on-term-click",
3732
3775
  "selected-canonical",
3733
3776
  "selection-seq"
3734
- ]), o.showTemplateDirectives ? (U(), P(fi, {
3777
+ ]), o.showTemplateDirectives ? (U(), P(hi, {
3735
3778
  key: 0,
3736
3779
  "get-view": () => q(X),
3737
3780
  "get-pages-container": () => T.value,
3738
- "editor-state": q(Ie),
3781
+ "editor-state": q(Le),
3739
3782
  zoom: q(B),
3740
3783
  layout: q(Je),
3741
3784
  blocks: q(Ye),
@@ -3749,7 +3792,7 @@ var ba = { class: "docx-editor-vue__toolbar-shell" }, xa = {
3749
3792
  "blocks",
3750
3793
  "measures"
3751
3794
  ])) : F("", !0)])]),
3752
- z(ti, {
3795
+ R(ii, {
3753
3796
  "image-info": q(at),
3754
3797
  zoom: q(B),
3755
3798
  view: q(X),
@@ -3763,7 +3806,7 @@ var ba = { class: "docx-editor-vue__toolbar-shell" }, xa = {
3763
3806
  "view",
3764
3807
  "onContextMenu"
3765
3808
  ]),
3766
- z(Si, {
3809
+ R(Ti, {
3767
3810
  data: q(ft),
3768
3811
  "read-only": u.value,
3769
3812
  onNavigate: q(ht),
@@ -3789,12 +3832,12 @@ var ba = { class: "docx-editor-vue__toolbar-shell" }, xa = {
3789
3832
  "aria-label": q(yt).type === "row" ? "Insert row" : "Insert column",
3790
3833
  onMousedown: n[16] ||= (...e) => q(Dt) && q(Dt)(...e)
3791
3834
  }, " + ", 44, ka)) : F("", !0),
3792
- z(h, {
3835
+ R(m, {
3793
3836
  comments: q(zt),
3794
3837
  "pages-container": T.value,
3795
3838
  zoom: q(B),
3796
3839
  "page-width-px": Ut.value,
3797
- "sidebar-open": j.value,
3840
+ "sidebar-open": M.value,
3798
3841
  "resolved-comment-ids": Wt.value,
3799
3842
  onMarkerClick: () => {}
3800
3843
  }, null, 8, [
@@ -3805,8 +3848,8 @@ var ba = { class: "docx-editor-vue__toolbar-shell" }, xa = {
3805
3848
  "sidebar-open",
3806
3849
  "resolved-comment-ids"
3807
3850
  ]),
3808
- z(_, {
3809
- "is-open": j.value,
3851
+ R(v, {
3852
+ "is-open": M.value,
3810
3853
  comments: q(zt),
3811
3854
  "tracked-changes": Rt.value,
3812
3855
  "show-resolved": !0,
@@ -3816,7 +3859,7 @@ var ba = { class: "docx-editor-vue__toolbar-shell" }, xa = {
3816
3859
  "page-width-px": Ut.value,
3817
3860
  zoom: q(B),
3818
3861
  "active-item-id": pe.value,
3819
- onClose: n[17] ||= (e) => j.value = !1,
3862
+ onClose: n[17] ||= (e) => M.value = !1,
3820
3863
  "onUpdate:activeItemId": n[18] ||= (e) => pe.value = e,
3821
3864
  onAddComment: q($).handleAddComment,
3822
3865
  onCancelAddComment: q($).handleCancelAddComment,
@@ -3862,17 +3905,17 @@ var ba = { class: "docx-editor-vue__toolbar-shell" }, xa = {
3862
3905
  "aria-label": "Add comment",
3863
3906
  title: "Add comment",
3864
3907
  onMousedown: n[19] ||= Y((...e) => q($).startAddComment && q($).startAddComment(...e), ["prevent", "stop"])
3865
- }, [z(r, {
3908
+ }, [R(r, {
3866
3909
  name: "add_comment",
3867
3910
  size: 18
3868
3911
  })], 36)) : F("", !0)
3869
3912
  ], 544),
3870
- A.value ? F("", !0) : (U(), P(ri, {
3913
+ A.value ? F("", !0) : (U(), P(oi, {
3871
3914
  key: 2,
3872
3915
  "left-offset": 12,
3873
3916
  onToggle: q(Ot).handleToggleOutline
3874
3917
  }, null, 8, ["onToggle"])),
3875
- q(bt).totalPages > 1 ? (U(), P(ii, {
3918
+ q(bt).totalPages > 1 ? (U(), P(si, {
3876
3919
  key: 3,
3877
3920
  "current-page": q(bt).currentPage,
3878
3921
  "total-pages": q(bt).totalPages,
@@ -3882,9 +3925,9 @@ var ba = { class: "docx-editor-vue__toolbar-shell" }, xa = {
3882
3925
  "total-pages",
3883
3926
  "visible"
3884
3927
  ])) : F("", !0),
3885
- z(dr, {
3928
+ R(mr, {
3886
3929
  "is-open": A.value,
3887
- headings: ge.value,
3930
+ headings: z.value,
3888
3931
  "get-scroll-container": () => T.value,
3889
3932
  onClose: n[24] ||= (e) => A.value = !1,
3890
3933
  onNavigate: q(Ot).handleOutlineNavigate
@@ -3895,7 +3938,7 @@ var ba = { class: "docx-editor-vue__toolbar-shell" }, xa = {
3895
3938
  "onNavigate"
3896
3939
  ])
3897
3940
  ])], 544),
3898
- z(Gr, {
3941
+ R(Jr, {
3899
3942
  "read-only": u.value,
3900
3943
  "context-menu": q(kt),
3901
3944
  "image-context-menu": q(At),
@@ -3919,30 +3962,42 @@ var ba = { class: "docx-editor-vue__toolbar-shell" }, xa = {
3919
3962
  ])
3920
3963
  ], 6));
3921
3964
  }
3922
- }), [["__scopeId", "data-v-1313e086"]]), ja = ["aria-label"], Ma = ["aria-label"], Na = [
3965
+ }), [["__scopeId", "data-v-69ec23e0"]]);
3966
+ //#endregion
3967
+ //#region src/utils/listState.ts
3968
+ function ja() {
3969
+ return {
3970
+ type: "none",
3971
+ level: 0,
3972
+ isInList: !1
3973
+ };
3974
+ }
3975
+ //#endregion
3976
+ //#region src/components/FormattingBar.vue?vue&type=script&setup=true&lang.ts
3977
+ var Ma = ["aria-label"], Na = ["aria-label"], Pa = [
3923
3978
  "disabled",
3924
3979
  "title",
3925
3980
  "aria-label"
3926
- ], Pa = [
3981
+ ], Fa = [
3927
3982
  "disabled",
3928
3983
  "title",
3929
3984
  "aria-label"
3930
- ], Fa = ["aria-label"], Ia = [
3985
+ ], Ia = ["aria-label"], La = [
3931
3986
  "disabled",
3932
3987
  "title",
3933
3988
  "aria-label",
3934
3989
  "aria-pressed"
3935
- ], La = [
3990
+ ], Ra = [
3936
3991
  "disabled",
3937
3992
  "title",
3938
3993
  "aria-label",
3939
3994
  "aria-pressed"
3940
- ], Ra = [
3995
+ ], za = [
3941
3996
  "disabled",
3942
3997
  "title",
3943
3998
  "aria-label",
3944
3999
  "aria-pressed"
3945
- ], za = /*#__PURE__*/ t(/* @__PURE__ */ B({
4000
+ ], Ba = /*#__PURE__*/ t(/* @__PURE__ */ z({
3946
4001
  __name: "FormattingBar",
3947
4002
  props: {
3948
4003
  currentFormatting: {},
@@ -3984,7 +4039,7 @@ var ba = { class: "docx-editor-vue__toolbar-shell" }, xa = {
3984
4039
  "redo"
3985
4040
  ],
3986
4041
  setup(e, { emit: t }) {
3987
- let { ColorPicker: n } = p(), i = e, a = t, { t: o } = c(), s = N(() => i.currentFormatting ?? {}), l = N(() => i.documentStyles ? { styles: i.documentStyles } : {}), u = N(() => s.value.listState ?? x()), d = N(() => {
4042
+ let { ColorPicker: n } = p(), i = e, a = t, { t: o } = c(), s = N(() => i.currentFormatting ?? {}), l = N(() => i.documentStyles ? { styles: i.documentStyles } : {}), u = N(() => s.value.listState ?? ja()), d = N(() => {
3988
4043
  let e = s.value.color;
3989
4044
  return e ? e.replace(/^#/, "").toUpperCase() : void 0;
3990
4045
  }), f = N(() => {
@@ -4014,25 +4069,25 @@ var ba = { class: "docx-editor-vue__toolbar-shell" }, xa = {
4014
4069
  title: q(o)("undoShortcut"),
4015
4070
  "aria-label": q(o)("undo"),
4016
4071
  onMousedown: i[0] ||= Y((e) => a("undo"), ["prevent"])
4017
- }, [z(r, {
4072
+ }, [R(r, {
4018
4073
  name: "undo",
4019
4074
  size: 18
4020
- })], 40, Na), L("button", {
4075
+ })], 40, Pa), L("button", {
4021
4076
  type: "button",
4022
4077
  class: "docx-formatting-bar__btn",
4023
4078
  disabled: e.disabled || !e.canRedo,
4024
4079
  title: q(o)("redoShortcut"),
4025
4080
  "aria-label": q(o)("redo"),
4026
4081
  onMousedown: i[1] ||= Y((e) => a("redo"), ["prevent"])
4027
- }, [z(r, {
4082
+ }, [R(r, {
4028
4083
  name: "redo",
4029
4084
  size: 18
4030
- })], 40, Pa)], 8, Ma),
4085
+ })], 40, Fa)], 8, Na),
4031
4086
  i[13] ||= L("span", {
4032
4087
  class: "docx-formatting-bar__divider",
4033
4088
  role: "separator"
4034
4089
  }, null, -1),
4035
- e.showStylePicker ? (U(), I(M, { key: 0 }, [z(b, ye({ value: s.value.styleId ?? "Normal" }, l.value, {
4090
+ e.showStylePicker ? (U(), I(j, { key: 0 }, [R(b, ve({ value: s.value.styleId ?? "Normal" }, l.value, {
4036
4091
  disabled: e.disabled,
4037
4092
  onChange: i[2] ||= (e) => a("format", {
4038
4093
  type: "applyStyle",
@@ -4055,10 +4110,10 @@ var ba = { class: "docx-editor-vue__toolbar-shell" }, xa = {
4055
4110
  "aria-label": q(o)("bold"),
4056
4111
  "aria-pressed": !!s.value.bold,
4057
4112
  onMousedown: i[3] ||= Y((e) => a("format", "bold"), ["prevent"])
4058
- }, [z(r, {
4113
+ }, [R(r, {
4059
4114
  name: "format_bold",
4060
4115
  size: 18
4061
- })], 42, Ia),
4116
+ })], 42, La),
4062
4117
  L("button", {
4063
4118
  type: "button",
4064
4119
  class: V(["docx-formatting-bar__btn", { "docx-formatting-bar__btn--active": s.value.italic }]),
@@ -4067,10 +4122,10 @@ var ba = { class: "docx-editor-vue__toolbar-shell" }, xa = {
4067
4122
  "aria-label": q(o)("italic"),
4068
4123
  "aria-pressed": !!s.value.italic,
4069
4124
  onMousedown: i[4] ||= Y((e) => a("format", "italic"), ["prevent"])
4070
- }, [z(r, {
4125
+ }, [R(r, {
4071
4126
  name: "format_italic",
4072
4127
  size: 18
4073
- })], 42, La),
4128
+ })], 42, Ra),
4074
4129
  L("button", {
4075
4130
  type: "button",
4076
4131
  class: V(["docx-formatting-bar__btn", { "docx-formatting-bar__btn--active": s.value.underline }]),
@@ -4079,15 +4134,15 @@ var ba = { class: "docx-editor-vue__toolbar-shell" }, xa = {
4079
4134
  "aria-label": q(o)("underline"),
4080
4135
  "aria-pressed": !!s.value.underline,
4081
4136
  onMousedown: i[5] ||= Y((e) => a("format", "underline"), ["prevent"])
4082
- }, [z(r, {
4137
+ }, [R(r, {
4083
4138
  name: "format_underlined",
4084
4139
  size: 18
4085
- })], 42, Ra)
4086
- ], 8, Fa),
4087
- e.showTextColorPicker ? (U(), I(M, { key: 1 }, [i[12] ||= L("span", {
4140
+ })], 42, za)
4141
+ ], 8, Ia),
4142
+ e.showTextColorPicker ? (U(), I(j, { key: 1 }, [i[12] ||= L("span", {
4088
4143
  class: "docx-formatting-bar__divider",
4089
4144
  role: "separator"
4090
- }, null, -1), z(q(n), {
4145
+ }, null, -1), R(q(n), {
4091
4146
  mode: "text",
4092
4147
  value: d.value,
4093
4148
  theme: e.theme ?? null,
@@ -4102,7 +4157,7 @@ var ba = { class: "docx-editor-vue__toolbar-shell" }, xa = {
4102
4157
  class: "docx-formatting-bar__divider",
4103
4158
  role: "separator"
4104
4159
  }, null, -1),
4105
- e.showAlignmentButtons ? (U(), P(S, {
4160
+ e.showAlignmentButtons ? (U(), P(y, {
4106
4161
  key: 2,
4107
4162
  value: s.value.alignment ?? "left",
4108
4163
  disabled: e.disabled,
@@ -4111,7 +4166,7 @@ var ba = { class: "docx-editor-vue__toolbar-shell" }, xa = {
4111
4166
  value: e
4112
4167
  })
4113
4168
  }, null, 8, ["value", "disabled"])) : F("", !0),
4114
- e.showListButtons ? (U(), P(te, {
4169
+ e.showListButtons ? (U(), P(x, {
4115
4170
  key: 3,
4116
4171
  "list-state": u.value,
4117
4172
  disabled: e.disabled,
@@ -4125,9 +4180,9 @@ var ba = { class: "docx-editor-vue__toolbar-shell" }, xa = {
4125
4180
  "disabled",
4126
4181
  "can-outdent"
4127
4182
  ])) : F("", !0)
4128
- ], 10, ja));
4183
+ ], 10, Ma));
4129
4184
  }
4130
- }), [["__scopeId", "data-v-225f770f"]]), Ba = [
4185
+ }), [["__scopeId", "data-v-fc03de2e"]]), Va = [
4131
4186
  {
4132
4187
  value: .5,
4133
4188
  label: "50%"
@@ -4152,7 +4207,7 @@ var ba = { class: "docx-editor-vue__toolbar-shell" }, xa = {
4152
4207
  value: 2,
4153
4208
  label: "200%"
4154
4209
  }
4155
- ], Va = /*#__PURE__*/ t(/* @__PURE__ */ B({
4210
+ ], Ha = /*#__PURE__*/ t(/* @__PURE__ */ z({
4156
4211
  __name: "ZoomControl",
4157
4212
  props: {
4158
4213
  value: { default: 1 },
@@ -4169,7 +4224,7 @@ var ba = { class: "docx-editor-vue__toolbar-shell" }, xa = {
4169
4224
  },
4170
4225
  emits: ["change"],
4171
4226
  setup(e, { emit: t }) {
4172
- let { Select: n } = p(), r = e, i = t, a = N(() => r.levels ?? Ba), o = N(() => a.value.find((e) => Math.abs(e.value - r.value) < .001)), s = N(() => o.value ? o.value.label : `${Math.round(r.value * 100)}%`), c = N(() => o.value ? String(o.value.value) : String(r.value)), l = N(() => {
4227
+ let { Select: n } = p(), r = e, i = t, a = N(() => r.levels ?? Va), o = N(() => a.value.find((e) => Math.abs(e.value - r.value) < .001)), s = N(() => o.value ? o.value.label : `${Math.round(r.value * 100)}%`), c = N(() => o.value ? String(o.value.value) : String(r.value)), l = N(() => {
4173
4228
  let e = a.value.map((e) => ({
4174
4229
  value: String(e.value),
4175
4230
  label: e.label
@@ -4197,7 +4252,7 @@ var ba = { class: "docx-editor-vue__toolbar-shell" }, xa = {
4197
4252
  "disabled"
4198
4253
  ]));
4199
4254
  }
4200
- }), [["__scopeId", "data-v-8079e07f"]]), Ha = (e, t, n = {}) => {
4255
+ }), [["__scopeId", "data-v-8079e07f"]]), Ua = (e, t, n = {}) => {
4201
4256
  let { locale: r = "en", ...i } = n;
4202
4257
  return new Promise((n, a) => {
4203
4258
  let o = W(null), s = null, c = !1, u = {
@@ -4222,8 +4277,8 @@ var ba = { class: "docx-editor-vue__toolbar-shell" }, xa = {
4222
4277
  c || (c = !0, a(/* @__PURE__ */ Error("Editor was destroyed before mounting completed."))), s?.unmount(), s = null;
4223
4278
  }
4224
4279
  };
4225
- s = me({ setup() {
4226
- return () => _e(Aa, {
4280
+ s = pe({ setup() {
4281
+ return () => B(Aa, {
4227
4282
  ...i,
4228
4283
  documentBuffer: e,
4229
4284
  ref: o,
@@ -4238,4 +4293,4 @@ var ba = { class: "docx-editor-vue__toolbar-shell" }, xa = {
4238
4293
  });
4239
4294
  };
4240
4295
  //#endregion
4241
- export { Nn as DEFAULT_AI_SUGGESTION_PRESETS, Kn as DEFAULT_AUTOCOMPLETE_DEAD_ZONE_NODES, Aa as DocxEditor, T as FindReplaceDialog, s as FolioUIProvider, se as FootnotePropertiesDialog, za as FormattingBar, ce as HyperlinkDialog, le as ImagePositionDialog, E as ImagePropertiesDialog, D as InsertImageDialog, ue as InsertSymbolDialog, de as InsertTableDialog, fe as PageSetupDialog, O as PasteSpecialDialog, k as SplitCellDialog, A as TablePropertiesDialog, j as WatermarkDialog, Va as ZoomControl, qn as acceptAutocompleteSuggestion, Jn as acceptAutocompleteWord, Ye as anonymizationDecorationsKey, Yn as appendAutocompleteToken, $ as applyFolioAIEditOperations, Pn as applySuggestions, Xn as autocompleteSuggestionKey, Zn as autocompleteSuggestionPlugin, Ln as buildPositionalText, Qn as clearAutocompleteSuggestion, It as clearTemplateSlashMenu, Lt as consumeTemplateSlashQuery, Un as createAICitationDecorationsPlugin, Mn as createDocx, jn as createEmptyDocument, Vt as createFolioAIEditSnapshot, n as defaultLocale, sn as deriveBlockId, Ut as diffWordSegments, $n as finishAutocompleteSuggestion, rr as fromMarkdown, Xe as getAnonymizationMatches, er as getAutocompleteSuggestion, kn as getDocumentWatermark, Vn as getFolioCaretViewportRect, cn as getFolioParaIdFromBlockId, Hn as getFolioSelectionViewportRect, yt as getTemplateDirectives, Rt as getTemplateSlashMenu, Kt as hashFolioAIBlockText, l as i18nPlugin, Ne as insertImageFromFile, X as insertPageBreakInView, Ie as insertTableInView, Re as insertTableOfContentsInView, dn as isFolioBlockId, fn as isSequentialFolioBlockId, Fn as isSuggestionStale, qt as normalizeFolioAIBlockText, e as provideLocale, Ha as renderAsync, Q as resetTemplateSlashQuery, In as resolveSuggestionAnchor, xt as scanDirectives, Bn as scrollFolioPositionIntoView, Wn as setAICitationsMeta, Rn as setAISuggestionsMeta, Gn as setActiveCitationMeta, Qe as setAnonymizationTermsMeta, An as setDocumentWatermark, zn as setFocusedSuggestionMeta, Ft as setTemplatePreviewValues, tr as shouldTriggerAutocomplete, nr as startAutocompleteSuggestion, zt as templateSlashMenuKey, ir as toMarkdown, ar as toMarkdownResult, c as useTranslation, w as useWheelZoom };
4296
+ export { In as DEFAULT_AI_SUGGESTION_PRESETS, Yn as DEFAULT_AUTOCOMPLETE_DEAD_ZONE_NODES, Aa as DocxEditor, w as FindReplaceDialog, s as FolioUIProvider, T as FootnotePropertiesDialog, Ba as FormattingBar, se as HyperlinkDialog, ce as ImagePositionDialog, le as ImagePropertiesDialog, E as InsertImageDialog, D as InsertSymbolDialog, ue as InsertTableDialog, de as PageSetupDialog, fe as PasteSpecialDialog, O as SplitCellDialog, k as TablePropertiesDialog, A as WatermarkDialog, Ha as ZoomControl, Xn as acceptAutocompleteSuggestion, Zn as acceptAutocompleteWord, Je as anonymizationDecorationsKey, Qn as appendAutocompleteToken, Bt as applyFolioAIEditOperations, Ln as applySuggestions, $n as autocompleteSuggestionKey, er as autocompleteSuggestionPlugin, Bn as buildPositionalText, tr as clearAutocompleteSuggestion, It as clearTemplateSlashMenu, Lt as consumeTemplateSlashQuery, Kn as createAICitationDecorationsPlugin, jn as createDocx, An as createEmptyDocument, Wt as createFolioAIEditSnapshot, n as defaultLocale, Mn as deriveBlockId, Kt as diffWordSegments, nr as finishAutocompleteSuggestion, or as fromMarkdown, Ye as getAnonymizationMatches, rr as getAutocompleteSuggestion, On as getDocumentWatermark, Wn as getFolioCaretViewportRect, Nn as getFolioParaIdFromBlockId, Gn as getFolioSelectionViewportRect, vt as getTemplateDirectives, Rt as getTemplateSlashMenu, Xt as hashFolioAIBlockText, l as i18nPlugin, Me as insertImageFromFile, Pe as insertPageBreakInView, X as insertTableInView, Le as insertTableOfContentsInView, Pn as isFolioBlockId, Fn as isSequentialFolioBlockId, Rn as isSuggestionStale, Zt as normalizeFolioAIBlockText, e as provideLocale, Ua as renderAsync, Q as resetTemplateSlashQuery, zn as resolveSuggestionAnchor, bt as scanDirectives, Un as scrollFolioPositionIntoView, qn as setAICitationsMeta, Vn as setAISuggestionsMeta, Jn as setActiveCitationMeta, Ze as setAnonymizationTermsMeta, kn as setDocumentWatermark, Hn as setFocusedSuggestionMeta, Ft as setTemplatePreviewValues, ir as shouldTriggerAutocomplete, ar as startAutocompleteSuggestion, zt as templateSlashMenuKey, sr as toMarkdown, cr as toMarkdownResult, c as useTranslation, oe as useWheelZoom };