@eigenpal/docx-editor-vue 1.4.0 → 1.5.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,42 +1,44 @@
1
- import { a as e, c as t, d as n, f as r, i, l as a, n as o, o as s, p as c, r as l, s as u, t as d, u as f } from "./KeyboardShortcutsDialog-BbuDgglK.js";
2
- import { a as p, c as m, h, i as g, o as _, s as v, t as y, x as b } from "./MenuBar-CbONA9-a.js";
3
- import { t as x } from "./_plugin-vue_export-helper-B52Kst-M.js";
4
- import { n as S } from "./RenderedDomContext-CHc18N_2.js";
5
- import { t as C } from "./zIndex-CxELVe_L.js";
6
- import { i as ee, n as te, r as ne, t as w } from "./useDragAutoScroll-BNPB-6SM.js";
7
- import { Fragment as T, Teleport as E, computed as D, createApp as re, createBlock as ie, createCommentVNode as O, createElementBlock as k, createElementVNode as A, createSlots as ae, createStaticVNode as oe, createTextVNode as j, createVNode as M, defineComponent as N, h as se, isRef as ce, nextTick as le, normalizeClass as P, normalizeStyle as F, onBeforeUnmount as I, onMounted as L, openBlock as R, ref as z, renderList as B, renderSlot as V, resolveDynamicComponent as ue, shallowRef as de, toDisplayString as H, unref as U, vModelCheckbox as W, vModelSelect as fe, vModelText as G, watch as K, withCtx as pe, withDirectives as q, withKeys as me, withModifiers as J } from "vue";
8
- import { NodeSelection as Y, TextSelection as he } from "prosemirror-state";
9
- import { applyCellSelectionHighlight as ge, clickToPositionDom as _e, computeHfCaretRectFromView as ve, computeHfSelectionRectsFromView as ye, findBodyPmAnchor as X, findBodyPmSpans as be } from "@eigenpal/docx-editor-core/layout-bridge";
10
- import { findInDocument as xe, getPageContent as Se, getSelectionInfo as Ce } from "@eigenpal/docx-editor-core/prosemirror/queries";
11
- import { LayoutSelectionGate as we, addRepeatingSectionItemTr as Te, extractSelectionState as Ee, findContentControlPos as De, findContentControlsInPM as Oe, removeContentControlTr as ke, removeRepeatingSectionItemTr as Ae, schema as je, setContentControlContentTr as Me, setContentControlValueTr as Z } from "@eigenpal/docx-editor-core/prosemirror";
12
- import { SIDEBAR_DOCUMENT_SHIFT as Ne, findWordBoundaries as Pe, loadFontDefinitions as Fe, onFontError as Ie, pixelsToEmu as Le, readDocxFileFromInput as Re, toArrayBuffer as ze } from "@eigenpal/docx-editor-core/utils";
13
- import { extractSelectionContext as Be } from "@eigenpal/docx-editor-core/prosemirror/plugins/selectionTracker";
14
- import { clearFormatting as Ve, findHyperlinkRangeAt as He } from "@eigenpal/docx-editor-core/prosemirror/commands/formatting";
15
- import { getTableContext as Q } from "@eigenpal/docx-editor-core/prosemirror/extensions/nodes/TableExtension";
16
- import { clickToPositionDom as Ue, getCaretPositionFromDom as We, getSelectionRectsFromDom as Ge } from "@eigenpal/docx-editor-core/layout-bridge/clickToPositionDom";
17
- import { calculateResizedImageDimensions as Ke, commitImageFloatMove as qe, commitImageInlineMove as Je, commitImageResize as Ye, isFloatingImage as Xe } from "@eigenpal/docx-editor-core/prosemirror/imageCommit";
18
- import { IMAGE_LAYOUT_OPTIONS as Ze, captureInlinePositionEmu as Qe, deriveLayoutChoice as $e, findImageElement as et, isImageLayoutOptionEnabled as tt, renderAllPagesNow as nt, toolbarValueToLayoutTarget as rt } from "@eigenpal/docx-editor-core/layout-painter";
19
- import { proseDocToBlocks as it } from "@eigenpal/docx-editor-core/prosemirror/conversion";
20
- import { twipsToPixels as at } from "@eigenpal/docx-editor-core/utils/units";
21
- import { pictureWatermarkDisplayEmu as ot } from "@eigenpal/docx-editor-core/types/document";
22
- import { makeRevisionInfo as st } from "@eigenpal/docx-editor-core/prosemirror/plugins";
23
- import { findPageIndexContainingPmPos as ct } from "@eigenpal/docx-editor-core/layout-engine";
24
- import { applyStyle as lt, removeTabStop as ut, setIndentFirstLine as dt, setIndentLeft as ft, setIndentRight as pt } from "@eigenpal/docx-editor-core/prosemirror/commands/paragraph";
25
- import { createStyleResolver as mt } from "@eigenpal/docx-editor-core/prosemirror/styles";
26
- import { insertPageBreak as ht } from "@eigenpal/docx-editor-core/prosemirror/commands/pageBreak";
27
- import { applyFormatting as gt, setParagraphStyle as _t } from "@eigenpal/docx-editor-core/prosemirror/applyFormatting";
28
- import { acceptChange as vt, acceptChangeById as yt, getWatermarkFromState as bt, insertImageNode as xt, rejectChange as St, rejectChangeById as Ct, setWatermark as wt } from "@eigenpal/docx-editor-core/prosemirror/commands";
29
- import { collectHeadings as Tt } from "@eigenpal/docx-editor-core/utils/headingCollector";
30
- import { addCommentToRange as Et, applyProposedChange as Dt, createComment as Ot } from "@eigenpal/docx-editor-core/prosemirror/commentOps";
31
- import { PENDING_COMMENT_ID as kt, createCommentIdAllocator as At, seedCommentAllocator as jt } from "@eigenpal/docx-editor-core/prosemirror/commentIdAllocator";
32
- import { extractTrackedChanges as Mt } from "@eigenpal/docx-editor-core/prosemirror/utils/extractTrackedChanges";
33
- import { TABLE_INSERT_HIDE_DELAY_MS as Nt, detectTableInsertHover as Pt } from "@eigenpal/docx-editor-core/layout-bridge/tableInsertHover";
34
- import { openReportIssue as Ft } from "@eigenpal/docx-editor-core/utils/reportIssue";
35
- import { ContentControlNotFoundError as It } from "@eigenpal/docx-editor-core/agent";
36
- import { findParaIdRange as Lt } from "@eigenpal/docx-editor-core/prosemirror/paraText";
37
- import { createDocumentWithText as Rt, createEmptyDocument as zt } from "@eigenpal/docx-editor-core";
1
+ import { a as e, c as t, d as n, f as r, i, l as a, n as o, o as s, r as c, s as l, t as u, u as d } from "./KeyboardShortcutsDialog-DtuQzPxi.js";
2
+ import { a as f, c as p, h as m, i as h, o as g, s as _, t as v, x as y } from "./MenuBar-DfQrRpyI.js";
3
+ import { t as b } from "./_plugin-vue_export-helper-B52Kst-M.js";
4
+ import { n as x } from "./RenderedDomContext-CHc18N_2.js";
5
+ import { t as S } from "./zIndex-CxELVe_L.js";
6
+ import { i as C, n as ee, r as te, t as ne } from "./useDragAutoScroll-BNPB-6SM.js";
7
+ import { Fragment as w, Teleport as T, computed as E, createApp as D, createBlock as O, createCommentVNode as k, createElementBlock as A, createElementVNode as j, createSlots as re, createStaticVNode as ie, createTextVNode as ae, createVNode as M, defineComponent as N, h as oe, isRef as se, nextTick as ce, normalizeClass as le, normalizeStyle as P, onBeforeUnmount as F, onMounted as I, openBlock as L, ref as R, renderList as z, renderSlot as ue, resolveDynamicComponent as de, shallowRef as fe, toDisplayString as B, unref as V, vModelCheckbox as H, vModelSelect as pe, vModelText as U, watch as W, withCtx as me, withDirectives as G, withKeys as K, withModifiers as q } from "vue";
8
+ import { NodeSelection as J, TextSelection as he } from "prosemirror-state";
9
+ import { applyCellSelectionHighlight as Y, clickToPositionDom as ge, computeHfCaretRectFromView as _e, computeHfSelectionRectsFromView as ve, findBodyPmAnchor as X, findBodyPmSpans as ye } from "@eigenpal/docx-editor-core/layout-bridge";
10
+ import { clampRangeToDoc as be, findChangeRange as xe, findCommentRange as Se, findInDocument as Ce, getPageContent as we, getSelectionInfo as Te } from "@eigenpal/docx-editor-core/prosemirror/queries";
11
+ import { LayoutSelectionGate as Ee, addRepeatingSectionItemTr as De, extractSelectionState as Oe, findContentControlPos as ke, findContentControlsInPM as Ae, removeContentControlTr as je, removeRepeatingSectionItemTr as Z, schema as Me, setContentControlContentTr as Ne, setContentControlValueAtPosTr as Pe, setContentControlValueTr as Fe } from "@eigenpal/docx-editor-core/prosemirror";
12
+ import { SIDEBAR_DOCUMENT_SHIFT as Ie, findWordBoundaries as Le, loadFontDefinitions as Re, onFontError as ze, pixelsToEmu as Be, readDocxFileFromInput as Q, toArrayBuffer as Ve } from "@eigenpal/docx-editor-core/utils";
13
+ import { extractSelectionContext as He } from "@eigenpal/docx-editor-core/prosemirror/plugins/selectionTracker";
14
+ import { clearFormatting as Ue, findHyperlinkRangeAt as We } from "@eigenpal/docx-editor-core/prosemirror/commands/formatting";
15
+ import { getTableContext as Ge } from "@eigenpal/docx-editor-core/prosemirror/extensions/nodes/TableExtension";
16
+ import { clickToPositionDom as Ke, getCaretPositionFromDom as qe, getSelectionRectsFromDom as Je } from "@eigenpal/docx-editor-core/layout-bridge/clickToPositionDom";
17
+ import { calculateResizedImageDimensions as Ye, commitImageFloatMove as Xe, commitImageInlineMove as Ze, commitImageResize as Qe, isFloatingImage as $e } from "@eigenpal/docx-editor-core/prosemirror/imageCommit";
18
+ import { IMAGE_LAYOUT_OPTIONS as et, captureInlinePositionEmu as tt, deriveLayoutChoice as nt, findImageElement as rt, isImageLayoutOptionEnabled as it, renderAllPagesNow as at, toolbarValueToLayoutTarget as ot } from "@eigenpal/docx-editor-core/layout-painter";
19
+ import { proseDocToBlocks as st } from "@eigenpal/docx-editor-core/prosemirror/conversion";
20
+ import { twipsToPixels as ct } from "@eigenpal/docx-editor-core/utils/units";
21
+ import { pictureWatermarkDisplayEmu as lt } from "@eigenpal/docx-editor-core/types/document";
22
+ import { makeRevisionInfo as ut } from "@eigenpal/docx-editor-core/prosemirror/plugins";
23
+ import { findPageIndexContainingPmPos as dt } from "@eigenpal/docx-editor-core/layout-engine";
24
+ import { acceptChange as ft, acceptChangeById as pt, getWatermarkFromState as mt, insertImageFromFile as ht, rejectChange as gt, rejectChangeById as _t, setWatermark as vt } from "@eigenpal/docx-editor-core/prosemirror/commands";
25
+ import { applyStyle as yt, removeTabStop as bt, setIndentFirstLine as xt, setIndentLeft as St, setIndentRight as Ct } from "@eigenpal/docx-editor-core/prosemirror/commands/paragraph";
26
+ import { createStyleResolver as wt } from "@eigenpal/docx-editor-core/prosemirror/styles";
27
+ import { getCachedNumberingMap as Tt } from "@eigenpal/docx-editor-core/docx";
28
+ import { insertPageBreak as Et } from "@eigenpal/docx-editor-core/prosemirror/commands/pageBreak";
29
+ import { applyFormatting as Dt, setParagraphStyle as Ot } from "@eigenpal/docx-editor-core/prosemirror/applyFormatting";
30
+ import { collectHeadings as kt } from "@eigenpal/docx-editor-core/utils/headingCollector";
31
+ import { addCommentToRange as At, applyProposedChange as jt, createComment as Mt } from "@eigenpal/docx-editor-core/prosemirror/commentOps";
32
+ import { PENDING_COMMENT_ID as Nt, createCommentIdAllocator as Pt, seedCommentAllocator as Ft } from "@eigenpal/docx-editor-core/prosemirror/commentIdAllocator";
33
+ import { extractTrackedChanges as It } from "@eigenpal/docx-editor-core/prosemirror/utils/extractTrackedChanges";
34
+ import { TABLE_INSERT_HIDE_DELAY_MS as Lt, detectTableInsertHover as Rt } from "@eigenpal/docx-editor-core/layout-bridge/tableInsertHover";
35
+ import { createCellDragTracker as zt, findCellPosFromPmPos as Bt } from "@eigenpal/docx-editor-core/prosemirror/cellDragSelection";
36
+ import { openReportIssue as Vt } from "@eigenpal/docx-editor-core/utils/reportIssue";
37
+ import { ContentControlNotFoundError as Ht } from "@eigenpal/docx-editor-core/agent";
38
+ import { findParaIdRange as Ut } from "@eigenpal/docx-editor-core/prosemirror/paraText";
39
+ import { createDocumentWithText as Wt, createEmptyDocument as Gt } from "@eigenpal/docx-editor-core";
38
40
  //#region src/utils/domQueries.ts
39
- function Bt(e) {
41
+ function Kt(e) {
40
42
  let t = window.document.querySelectorAll(`.layout-page-${e}`);
41
43
  if (t.length === 0) return null;
42
44
  let n = window.innerHeight / 2, r = t[0], i = Infinity;
@@ -46,18 +48,18 @@ function Bt(e) {
46
48
  }
47
49
  return r;
48
50
  }
49
- function Vt(e, t, n) {
50
- let r = n ? Array.from(e.querySelectorAll(`.layout-page-${n} span[data-pm-start][data-pm-end]`)) : be(e);
51
+ function qt(e, t, n) {
52
+ let r = n ? Array.from(e.querySelectorAll(`.layout-page-${n} span[data-pm-start][data-pm-end]`)) : ye(e);
51
53
  for (let e of r) {
52
54
  let n = Number(e.dataset.pmStart), r = Number(e.dataset.pmEnd);
53
55
  if (!isNaN(n) && !isNaN(r) && t >= n && t <= r) return e;
54
56
  }
55
57
  return null;
56
58
  }
57
- function Ht(e, t, n) {
59
+ function Jt(e, t, n) {
58
60
  if (!e || !t) return;
59
61
  let r = null;
60
- for (let t of be(e)) {
62
+ for (let t of ye(e)) {
61
63
  let e = Number(t.dataset.pmStart), i = Number(t.dataset.pmEnd);
62
64
  if (Number.isFinite(e) && Number.isFinite(i) && n >= e && n <= i) {
63
65
  r = t;
@@ -71,21 +73,21 @@ function Ht(e, t, n) {
71
73
  behavior: "smooth"
72
74
  });
73
75
  }
74
- function Ut(e, t, n, r) {
76
+ function Yt(e, t, n, r) {
75
77
  if (!e || !t) return null;
76
- let i = _e(e, n, r, 1);
78
+ let i = ge(e, n, r, 1);
77
79
  return i === null || i < 0 ? null : Math.min(i, t.state.doc.content.size);
78
80
  }
79
- function Wt(e, t, n, r) {
81
+ function Xt(e, t, n, r) {
80
82
  if (!e) return;
81
- let i = Vt(e, t, r);
83
+ let i = qt(e, t, r);
82
84
  if (!i) return;
83
- let a = i.textContent || "", o = Number(i.dataset.pmStart) || 0, [s, c] = Pe(a, t - o), l = o + s, u = o + c;
85
+ let a = i.textContent || "", o = Number(i.dataset.pmStart) || 0, [s, c] = Le(a, t - o), l = o + s, u = o + c;
84
86
  l < u && n(l, u);
85
87
  }
86
- function Gt(e, t, n, r) {
88
+ function Zt(e, t, n, r) {
87
89
  if (!e) return;
88
- let i = Vt(e, t, r);
90
+ let i = qt(e, t, r);
89
91
  if (!i) return;
90
92
  let a = i.closest(".layout-paragraph");
91
93
  if (!a) return;
@@ -94,7 +96,7 @@ function Gt(e, t, n, r) {
94
96
  }
95
97
  //#endregion
96
98
  //#region src/components/DecorationLayer.vue
97
- var Kt = /* @__PURE__ */ N({
99
+ var Qt = /* @__PURE__ */ N({
98
100
  __name: "DecorationLayer",
99
101
  props: {
100
102
  getView: { type: Function },
@@ -104,7 +106,7 @@ var Kt = /* @__PURE__ */ N({
104
106
  syncCoordinator: {}
105
107
  },
106
108
  setup(e) {
107
- let t = e, n = z(null), r = z(0), i = null, a = null;
109
+ let t = e, n = R(null), r = R(0), i = null, a = null;
108
110
  function o() {
109
111
  i !== null && cancelAnimationFrame(i), i = requestAnimationFrame(() => {
110
112
  i = null;
@@ -112,13 +114,13 @@ var Kt = /* @__PURE__ */ N({
112
114
  !e || !r || !a || t.syncCoordinator.isSafeToRender() && s(e, r, a, t.zoom);
113
115
  });
114
116
  }
115
- L(() => {
117
+ I(() => {
116
118
  a = t.syncCoordinator.onRender(() => {
117
119
  r.value++;
118
120
  }), o();
119
- }), I(() => {
121
+ }), F(() => {
120
122
  i !== null && (cancelAnimationFrame(i), i = null), a?.();
121
- }), K(() => [
123
+ }), W(() => [
122
124
  t.zoom,
123
125
  t.transactionVersion,
124
126
  r.value
@@ -129,7 +131,7 @@ var Kt = /* @__PURE__ */ N({
129
131
  n.firstChild && n.replaceChildren();
130
132
  return;
131
133
  }
132
- let a = S(t, r), o = a.getContainerOffset(), s = document.createDocumentFragment();
134
+ let a = x(t, r), o = a.getContainerOffset(), s = document.createDocumentFragment();
133
135
  for (let { decoration: t, from: n, to: r } of i) {
134
136
  if (n === r) {
135
137
  let r = l(t, e);
@@ -179,20 +181,34 @@ var Kt = /* @__PURE__ */ N({
179
181
  function u(e) {
180
182
  return e.type?.attrs ?? null;
181
183
  }
182
- return (e, t) => (R(), k("div", {
184
+ return (e, t) => (L(), A("div", {
183
185
  ref_key: "overlayRef",
184
186
  ref: n,
185
187
  class: "paged-editor__decoration-overlay",
186
188
  "aria-hidden": "true"
187
189
  }, null, 512));
188
190
  }
189
- }), qt = ["data-handle", "onMousedown"], Jt = ["title"], Yt = {
191
+ });
192
+ //#endregion
193
+ //#region src/composables/imageOverlayRect.ts
194
+ function $t(e) {
195
+ let t = Math.max(0, e.parentOffsetWidth - e.parentClientWidth) / 2, n = e.zoom || 1;
196
+ return {
197
+ left: (e.imageRect.left - e.parentRect.left - t + e.scrollLeft) / n,
198
+ top: (e.imageRect.top - e.parentRect.top + e.scrollTop) / n,
199
+ width: e.imageRect.width / n,
200
+ height: e.imageRect.height / n
201
+ };
202
+ }
203
+ //#endregion
204
+ //#region src/components/ImageSelectionOverlay.vue?vue&type=script&setup=true&lang.ts
205
+ var en = ["data-handle", "onMousedown"], tn = ["title"], nn = {
190
206
  key: 0,
191
207
  class: "image-overlay__dim"
192
- }, Xt = {
208
+ }, rn = {
193
209
  key: 1,
194
210
  class: "image-overlay__dim image-overlay__dim--rotate"
195
- }, Zt = 4, Qt = 15, $t = /* @__PURE__ */ x(/* @__PURE__ */ N({
211
+ }, an = 4, on = 15, sn = 250, cn = 700, ln = /* @__PURE__ */ b(/* @__PURE__ */ N({
196
212
  __name: "ImageSelectionOverlay",
197
213
  props: {
198
214
  imageInfo: {},
@@ -206,7 +222,7 @@ var Kt = /* @__PURE__ */ N({
206
222
  "context-menu"
207
223
  ],
208
224
  setup(e, { emit: t }) {
209
- let { t: r } = n(), i = e, a = t, o = z(null), s = z(!1), c = z(!1), l = z(!1), u = z(0), d = z(0), f = z(0), p = z(null), m = "se", h = 0, g = 0, _ = 0, v = 0, y = null, b = null, x = null, S = null;
225
+ let { t: n } = d(), r = e, i = t, a = R(null), o = R(!1), s = R(!1), c = R(!1), l = R(0), u = R(0), f = R(0), p = R(null), m = "se", h = 0, g = 0, _ = 0, v = 0, y = null, b = null, x = null, C = null;
210
226
  function ee(e, t) {
211
227
  if (!e) return null;
212
228
  try {
@@ -217,56 +233,82 @@ var Kt = /* @__PURE__ */ N({
217
233
  }
218
234
  }
219
235
  function te() {
220
- return o.value?.closest(".docx-editor-vue__pages-viewport")?.querySelector(".docx-editor-vue__pages") ?? null;
236
+ return a.value?.closest(".docx-editor-vue__pages-viewport")?.querySelector(".docx-editor-vue__pages") ?? null;
221
237
  }
222
238
  function ne() {
223
- let e = i.imageInfo;
239
+ let e = r.imageInfo;
224
240
  if (!e) return null;
225
241
  if (e.element.isConnected) return e.element;
226
242
  let t = te();
227
243
  if (!t) return null;
228
244
  let n = X(t, e.pmPos);
229
- return n ? et(n) : null;
245
+ return n ? rt(n) : null;
230
246
  }
231
- function w() {
247
+ function T() {
232
248
  let e = ne();
233
- if (!e || !o.value) {
249
+ if (!e || !a.value) {
234
250
  p.value = null;
235
251
  return;
236
252
  }
237
- let t = o.value.offsetParent;
253
+ let t = a.value.offsetParent;
238
254
  if (!t) {
239
255
  p.value = null;
240
256
  return;
241
257
  }
242
- let n = t.getBoundingClientRect(), r = e.getBoundingClientRect(), a = i.zoom;
243
- p.value = {
244
- left: (r.left - n.left + t.scrollLeft) / a,
245
- top: (r.top - n.top + t.scrollTop) / a,
246
- width: r.width / a,
247
- height: r.height / a
248
- };
258
+ let n = t.getBoundingClientRect();
259
+ p.value = $t({
260
+ imageRect: e.getBoundingClientRect(),
261
+ parentRect: n,
262
+ scrollLeft: t.scrollLeft,
263
+ scrollTop: t.scrollTop,
264
+ parentOffsetWidth: t.offsetWidth,
265
+ parentClientWidth: t.clientWidth,
266
+ zoom: r.zoom
267
+ });
249
268
  }
250
- K(() => i.imageInfo, async () => {
251
- await le(), w();
252
- }, { immediate: !0 }), K(() => i.zoom, (e, t, n) => {
253
- if (!i.imageInfo) return;
254
- let r = 0, a = "", o = 0, s = 0, c = (e) => {
255
- w();
256
- let t = p.value, n = t ? `${t.left}|${t.top}|${t.width}|${t.height}` : "";
257
- o = n === a ? o + 1 : 0, a = n, s += e, o < 2 && s < 500 && (r = requestAnimationFrame(() => c(16)));
269
+ let D = null;
270
+ function O() {
271
+ D?.();
272
+ let e = 0, t = "", n = 0, r = 0, i = (a) => {
273
+ r === 0 && (r = a);
274
+ let o = a - r;
275
+ T();
276
+ let s = p.value, c = s ? `${s.left}|${s.top}|${s.width}|${s.height}` : "";
277
+ n = c === t ? n + 1 : 0, t = c, !(o >= sn && n >= 2) && o < cn && (e = requestAnimationFrame(i));
258
278
  };
259
- r = requestAnimationFrame(() => c(16)), n(() => cancelAnimationFrame(r));
260
- }), K(() => i.imageInfo, (e, t, n) => {
261
- if (!i.imageInfo) return;
262
- let r = () => {
263
- b && cancelAnimationFrame(b), b = requestAnimationFrame(w);
264
- }, a = o.value?.closest(".docx-editor-vue__pages-viewport");
265
- a?.addEventListener("scroll", r, { passive: !0 }), window.addEventListener("resize", r, { passive: !0 }), n(() => {
266
- a?.removeEventListener("scroll", r), window.removeEventListener("resize", r), b && cancelAnimationFrame(b);
279
+ e = requestAnimationFrame(i);
280
+ let a = setTimeout(T, sn);
281
+ D = () => {
282
+ cancelAnimationFrame(e), clearTimeout(a);
283
+ };
284
+ }
285
+ W(() => r.imageInfo, (e, t, n) => {
286
+ if (!r.imageInfo) {
287
+ p.value = null;
288
+ return;
289
+ }
290
+ O(), n(() => D?.());
291
+ }, { immediate: !0 }), W(() => r.zoom, () => {
292
+ r.imageInfo && O();
293
+ }), W(() => r.imageInfo, (e, t, n) => {
294
+ if (!r.imageInfo) return;
295
+ let i = () => {
296
+ b && cancelAnimationFrame(b), b = requestAnimationFrame(T);
297
+ }, o = a.value?.closest(".docx-editor-vue__pages-viewport");
298
+ o?.addEventListener("scroll", i, { passive: !0 }), window.addEventListener("resize", i, { passive: !0 });
299
+ let s = null, c = !1;
300
+ ce(() => {
301
+ if (c || !r.imageInfo) return;
302
+ let e = te();
303
+ e && (s = new MutationObserver(() => O()), s.observe(e, {
304
+ attributes: !0,
305
+ attributeFilter: ["style"]
306
+ }));
307
+ }), n(() => {
308
+ c = !0, o?.removeEventListener("scroll", i), window.removeEventListener("resize", i), s?.disconnect(), b && cancelAnimationFrame(b);
267
309
  });
268
310
  }, { immediate: !0 });
269
- let E = D(() => s.value ? u.value : p.value?.width || 0), re = D(() => s.value ? d.value : p.value?.height || 0), ie = D(() => {
311
+ let re = E(() => o.value ? l.value : p.value?.width || 0), ie = E(() => o.value ? u.value : p.value?.height || 0), ae = E(() => {
270
312
  let e = p.value;
271
313
  if (!e) return {
272
314
  position: "absolute",
@@ -275,20 +317,20 @@ var Kt = /* @__PURE__ */ N({
275
317
  visibility: "hidden",
276
318
  pointerEvents: "none"
277
319
  };
278
- let t = s.value ? u.value : e.width, n = s.value ? d.value : e.height, r = i.zoom || 1;
320
+ let t = o.value ? l.value : e.width, n = o.value ? u.value : e.height, i = r.zoom || 1;
279
321
  return {
280
322
  position: "absolute",
281
- left: `${e.left * r}px`,
282
- top: `${e.top * r}px`,
323
+ left: `${e.left * i}px`,
324
+ top: `${e.top * i}px`,
283
325
  width: `${t}px`,
284
326
  height: `${n}px`,
285
- transform: r === 1 ? void 0 : `scale(${r})`,
327
+ transform: i === 1 ? void 0 : `scale(${i})`,
286
328
  transformOrigin: "top left",
287
- zIndex: C.imageOverlay,
329
+ zIndex: S.imageOverlay,
288
330
  pointerEvents: "auto"
289
331
  };
290
- }), ae = D(() => {
291
- let e = E.value, t = re.value, n = `${e / 2 - 5}px`, r = `${t / 2 - 5}px`, i = `${e - 5}px`, a = `${t - 5}px`, o = "-5px";
332
+ }), M = E(() => {
333
+ let e = re.value, t = ie.value, n = `${e / 2 - 5}px`, r = `${t / 2 - 5}px`, i = `${e - 5}px`, a = `${t - 5}px`, o = "-5px";
292
334
  return [
293
335
  {
294
336
  pos: "nw",
@@ -356,12 +398,12 @@ var Kt = /* @__PURE__ */ N({
356
398
  }
357
399
  ];
358
400
  });
359
- function oe(e, t) {
360
- !i.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), s.value = !0, a("interact-start"), document.addEventListener("mousemove", j), document.addEventListener("mouseup", M));
401
+ function N(e, t) {
402
+ !r.imageInfo || !p.value || (m = t, h = e.clientX, g = e.clientY, _ = p.value.width, v = p.value.height, y = { ...p.value }, l.value = Math.round(_), u.value = Math.round(v), o.value = !0, i("interact-start"), document.addEventListener("mousemove", oe), document.addEventListener("mouseup", se));
361
403
  }
362
- function j(e) {
363
- let t = i.zoom, n = (e.clientX - h) / t, r = (e.clientY - g) / t, a = !e.shiftKey, o = Ke(m, n, r, _, v, a);
364
- u.value = Math.round(o.width), d.value = Math.round(o.height);
404
+ function oe(e) {
405
+ let t = r.zoom, n = (e.clientX - h) / t, i = (e.clientY - g) / t, a = !e.shiftKey, o = Ye(m, n, i, _, v, a);
406
+ l.value = Math.round(o.width), u.value = Math.round(o.height);
365
407
  let s = y;
366
408
  s && (p.value = {
367
409
  left: m.includes("w") ? s.left + (s.width - o.width) : s.left,
@@ -370,151 +412,151 @@ var Kt = /* @__PURE__ */ N({
370
412
  height: s.height
371
413
  });
372
414
  }
373
- function M() {
374
- document.removeEventListener("mousemove", j), document.removeEventListener("mouseup", M), s.value = !1, y = null, a("interact-end");
375
- let e = i.view, t = i.imageInfo;
415
+ function se() {
416
+ document.removeEventListener("mousemove", oe), document.removeEventListener("mouseup", se), o.value = !1, y = null, i("interact-end");
417
+ let e = r.view, t = r.imageInfo;
376
418
  if (!e || !t) {
377
- w();
419
+ T();
378
420
  return;
379
421
  }
380
- let n = Ye(e, t.pmPos, u.value, d.value);
381
- n !== null && ge(n), le(() => w());
422
+ let n = Qe(e, t.pmPos, l.value, u.value);
423
+ n !== null && ve(n), ce(() => T());
382
424
  }
383
- let N = 0, se = 0, ce = 0, P = 0, L = null, V = null;
384
- function ue(e) {
425
+ let le = 0, I = 0, ue = 0, de = 0, fe = null, H = null;
426
+ function pe(e) {
385
427
  if (!e) return 0;
386
428
  let t = e.match(/rotate\((-?\d+(?:\.\d+)?)deg\)/);
387
429
  return t ? parseFloat(t[1]) : 0;
388
430
  }
389
- function de(e, t) {
431
+ function U(e, t) {
390
432
  let n = /scaleX\(-1\)/.test(e || ""), r = /scaleY\(-1\)/.test(e || ""), i = [], a = (t % 360 + 360) % 360;
391
433
  return a !== 0 && i.push(`rotate(${a}deg)`), n && i.push("scaleX(-1)"), r && i.push("scaleY(-1)"), i.length > 0 ? i.join(" ") : null;
392
434
  }
393
- function W(e, t) {
394
- return Math.atan2(e - N, -(t - se)) * 180 / Math.PI;
395
- }
396
- function fe(e) {
397
- if (!i.imageInfo) return;
398
- let t = i.imageInfo.element.getBoundingClientRect();
399
- N = t.left + t.width / 2, se = t.top + t.height / 2;
400
- let n = ee(i.view, i.imageInfo.pmPos);
401
- L = n && n.attrs.transform || null, P = ue(L), V = i.imageInfo.element.querySelector("img"), ce = W(e.clientX, e.clientY), f.value = P, l.value = !0, a("interact-start"), document.addEventListener("mousemove", G), document.addEventListener("mouseup", pe);
435
+ function me(e, t) {
436
+ return Math.atan2(e - le, -(t - I)) * 180 / Math.PI;
402
437
  }
403
438
  function G(e) {
404
- let t = W(e.clientX, e.clientY) - ce, n = P + t;
405
- e.shiftKey || (n = Math.round(n / Qt) * Qt), f.value = (n % 360 + 360) % 360, V && (V.style.transform = de(L, f.value) || "");
439
+ if (!r.imageInfo) return;
440
+ let t = r.imageInfo.element.getBoundingClientRect();
441
+ le = t.left + t.width / 2, I = t.top + t.height / 2;
442
+ let n = ee(r.view, r.imageInfo.pmPos);
443
+ fe = n && n.attrs.transform || null, de = pe(fe), H = r.imageInfo.element.querySelector("img"), ue = me(e.clientX, e.clientY), f.value = de, c.value = !0, i("interact-start"), document.addEventListener("mousemove", K), document.addEventListener("mouseup", he);
406
444
  }
407
- function pe() {
408
- document.removeEventListener("mousemove", G), document.removeEventListener("mouseup", pe), l.value = !1, a("interact-end");
409
- let e = i.view, t = i.imageInfo;
445
+ function K(e) {
446
+ let t = me(e.clientX, e.clientY) - ue, n = de + t;
447
+ e.shiftKey || (n = Math.round(n / on) * on), f.value = (n % 360 + 360) % 360, H && (H.style.transform = U(fe, f.value) || "");
448
+ }
449
+ function he() {
450
+ document.removeEventListener("mousemove", K), document.removeEventListener("mouseup", he), c.value = !1, i("interact-end");
451
+ let e = r.view, t = r.imageInfo;
410
452
  try {
411
453
  let n = e && t ? ee(e, t.pmPos) : null;
412
454
  e && t && n && (e.dispatch(e.state.tr.setNodeMarkup(t.pmPos, void 0, {
413
455
  ...n.attrs,
414
- transform: de(n.attrs.transform, f.value)
415
- })), ge(t.pmPos));
456
+ transform: U(n.attrs.transform, f.value)
457
+ })), ve(t.pmPos));
416
458
  } catch {} finally {
417
- V && (V.style.transform = ""), V = null, L = null;
459
+ H && (H.style.transform = ""), H = null, fe = null;
418
460
  }
419
- le(() => w());
461
+ ce(() => T());
420
462
  }
421
- let q = null;
422
- function me(e) {
423
- if (!i.imageInfo || !p.value) return;
424
- let t = e.clientX, n = e.clientY, r = p.value, o = !1, s = (e) => {
425
- let s = e.clientX - t, l = e.clientY - n;
426
- if (!(!o && Math.sqrt(s * s + l * l) < Zt)) {
463
+ let Y = null;
464
+ function ge(e) {
465
+ if (!r.imageInfo || !p.value) return;
466
+ let t = e.clientX, n = e.clientY, a = p.value, o = !1, c = (e) => {
467
+ let c = e.clientX - t, l = e.clientY - n;
468
+ if (!(!o && Math.sqrt(c * c + l * l) < an)) {
427
469
  if (!o) {
428
- o = !0, c.value = !0, a("interact-start"), q = document.createElement("div"), q.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);";
429
- let e = i.zoom;
430
- q.style.width = `${r.width * e}px`, q.style.height = `${r.height * e}px`, document.body.appendChild(q);
470
+ o = !0, s.value = !0, i("interact-start"), Y = document.createElement("div"), Y.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);";
471
+ let e = r.zoom;
472
+ Y.style.width = `${a.width * e}px`, Y.style.height = `${a.height * e}px`, document.body.appendChild(Y);
431
473
  }
432
- if (q) {
433
- let t = i.zoom;
434
- q.style.left = `${e.clientX - r.width * t / 2}px`, q.style.top = `${e.clientY - r.height * t / 2}px`;
474
+ if (Y) {
475
+ let t = r.zoom;
476
+ Y.style.left = `${e.clientX - a.width * t / 2}px`, Y.style.top = `${e.clientY - a.height * t / 2}px`;
435
477
  }
436
478
  }
437
479
  }, l = (e) => {
438
- document.removeEventListener("mousemove", s), document.removeEventListener("mouseup", l), x = null, S = null, q &&= (q.remove(), null), c.value = !1, o && (a("interact-end"), he(e.clientX, e.clientY));
480
+ document.removeEventListener("mousemove", c), document.removeEventListener("mouseup", l), x = null, C = null, Y &&= (Y.remove(), null), s.value = !1, o && (i("interact-end"), _e(e.clientX, e.clientY));
439
481
  };
440
- x = s, S = l, document.addEventListener("mousemove", s), document.addEventListener("mouseup", l);
482
+ x = c, C = l, document.addEventListener("mousemove", c), document.addEventListener("mouseup", l);
441
483
  }
442
- function he(e, t) {
443
- let n = i.view, r = i.imageInfo;
444
- if (!n || !r) return;
445
- let a = ee(n, r.pmPos);
446
- if (a) {
447
- if (Xe(a)) {
448
- let a = (o.value?.closest(".docx-editor-vue__pages-viewport"))?.querySelectorAll(".layout-page");
449
- if (!a || a.length === 0) return;
484
+ function _e(e, t) {
485
+ let n = r.view, i = r.imageInfo;
486
+ if (!n || !i) return;
487
+ let o = ee(n, i.pmPos);
488
+ if (o) {
489
+ if ($e(o)) {
490
+ let o = (a.value?.closest(".docx-editor-vue__pages-viewport"))?.querySelectorAll(".layout-page");
491
+ if (!o || o.length === 0) return;
450
492
  let s = null;
451
- for (let e of a) {
493
+ for (let e of o) {
452
494
  let n = e.getBoundingClientRect();
453
495
  if (t >= n.top && t <= n.bottom) {
454
496
  s = e.querySelector(".layout-page-content");
455
497
  break;
456
498
  }
457
499
  }
458
- if (s ||= a[a.length - 1].querySelector(".layout-page-content"), !s) return;
459
- let c = s.getBoundingClientRect(), l = i.zoom, u = Le((e - c.left) / l), d = Le((t - c.top) / l), f = qe(n, r.pmPos, u, d);
460
- f !== null && ge(f);
500
+ if (s ||= o[o.length - 1].querySelector(".layout-page-content"), !s) return;
501
+ let c = s.getBoundingClientRect(), l = r.zoom, u = Be((e - c.left) / l), d = Be((t - c.top) / l), f = Xe(n, i.pmPos, u, d);
502
+ f !== null && ve(f);
461
503
  } else {
462
- let i = te();
463
- if (!i) return;
464
- let a = Ue(i, e, t, 1);
504
+ let r = te();
505
+ if (!r) return;
506
+ let a = Ke(r, e, t, 1);
465
507
  if (a == null || a < 0) return;
466
- let o = Je(n, r.pmPos, a);
467
- o !== null && ge(o);
508
+ let o = Ze(n, i.pmPos, a);
509
+ o !== null && ve(o);
468
510
  }
469
- le(() => w());
511
+ ce(() => T());
470
512
  }
471
513
  }
472
- function ge(e) {
473
- let t = i.view;
514
+ function ve(e) {
515
+ let t = r.view;
474
516
  if (t) try {
475
- let n = Y.create(t.state.doc, e);
517
+ let n = J.create(t.state.doc, e);
476
518
  t.dispatch(t.state.tr.setSelection(n));
477
519
  } catch {}
478
520
  }
479
- return I(() => {
480
- document.removeEventListener("mousemove", j), document.removeEventListener("mouseup", M), document.removeEventListener("mousemove", G), document.removeEventListener("mouseup", pe), x && document.removeEventListener("mousemove", x), S && document.removeEventListener("mouseup", S), q &&= (q.remove(), null), b && cancelAnimationFrame(b);
481
- }), (t, n) => e.imageInfo ? (R(), k("div", {
521
+ return F(() => {
522
+ document.removeEventListener("mousemove", oe), document.removeEventListener("mouseup", se), document.removeEventListener("mousemove", K), document.removeEventListener("mouseup", he), x && document.removeEventListener("mousemove", x), C && document.removeEventListener("mouseup", C), Y &&= (Y.remove(), null), b && cancelAnimationFrame(b), D?.();
523
+ }), (t, r) => e.imageInfo ? (L(), A("div", {
482
524
  key: 0,
483
525
  ref_key: "overlayRootRef",
484
- ref: o,
526
+ ref: a,
485
527
  class: "image-overlay",
486
- style: F(ie.value),
487
- onMousedown: n[3] ||= J(() => {}, ["stop"])
528
+ style: P(ae.value),
529
+ onMousedown: r[3] ||= q(() => {}, ["stop"])
488
530
  }, [
489
- n[4] ||= A("div", { class: "image-overlay__border" }, null, -1),
490
- A("div", {
531
+ r[4] ||= j("div", { class: "image-overlay__border" }, null, -1),
532
+ j("div", {
491
533
  class: "image-overlay__body",
492
- style: F({ cursor: c.value ? "grabbing" : "grab" }),
493
- onMousedown: n[0] ||= J((e) => me(e), ["prevent", "stop"]),
494
- onContextmenu: n[1] ||= J((e) => t.$emit("context-menu", e), ["prevent", "stop"])
534
+ style: P({ cursor: s.value ? "grabbing" : "grab" }),
535
+ onMousedown: r[0] ||= q((e) => ge(e), ["prevent", "stop"]),
536
+ onContextmenu: r[1] ||= q((e) => t.$emit("context-menu", e), ["prevent", "stop"])
495
537
  }, null, 36),
496
- (R(!0), k(T, null, B(ae.value, (e) => (R(), k("div", {
538
+ (L(!0), A(w, null, z(M.value, (e) => (L(), A("div", {
497
539
  key: e.pos,
498
540
  class: "image-overlay__handle",
499
- style: F(e.style),
541
+ style: P(e.style),
500
542
  "data-handle": e.pos,
501
- onMousedown: J((t) => oe(t, e.pos), ["prevent", "stop"])
502
- }, null, 44, qt))), 128)),
503
- n[5] ||= A("div", { class: "image-overlay__rotate-line" }, null, -1),
504
- A("div", {
543
+ onMousedown: q((t) => N(t, e.pos), ["prevent", "stop"])
544
+ }, null, 44, en))), 128)),
545
+ r[5] ||= j("div", { class: "image-overlay__rotate-line" }, null, -1),
546
+ j("div", {
505
547
  class: "image-overlay__rotate-handle",
506
- style: F({ left: `${E.value / 2 - 7}px` }),
507
- title: U(r)("imageOverlay.rotate"),
508
- onMousedown: n[2] ||= J((e) => fe(e), ["prevent", "stop"])
509
- }, null, 44, Jt),
510
- s.value ? (R(), k("div", Yt, H(Math.round(u.value)) + " × " + H(Math.round(d.value)), 1)) : O("", !0),
511
- l.value ? (R(), k("div", Xt, H(Math.round(f.value)) + "° ", 1)) : O("", !0)
512
- ], 36)) : O("", !0);
513
- }
514
- }), [["__scopeId", "data-v-503209ad"]]), en = { class: "doc-outline__header" }, tn = { class: "doc-outline__body" }, nn = {
548
+ style: P({ left: `${re.value / 2 - 7}px` }),
549
+ title: V(n)("imageOverlay.rotate"),
550
+ onMousedown: r[2] ||= q((e) => G(e), ["prevent", "stop"])
551
+ }, null, 44, tn),
552
+ o.value ? (L(), A("div", nn, B(Math.round(l.value)) + " × " + B(Math.round(u.value)), 1)) : k("", !0),
553
+ c.value ? (L(), A("div", rn, B(Math.round(f.value)) + "° ", 1)) : k("", !0)
554
+ ], 36)) : k("", !0);
555
+ }
556
+ }), [["__scopeId", "data-v-2c4a2064"]]), un = { class: "doc-outline__header" }, dn = { class: "doc-outline__body" }, fn = {
515
557
  key: 0,
516
558
  class: "doc-outline__empty"
517
- }, rn = ["onMousedown"], an = /* @__PURE__ */ x(/* @__PURE__ */ N({
559
+ }, pn = ["onMousedown"], mn = /* @__PURE__ */ b(/* @__PURE__ */ N({
518
560
  __name: "DocumentOutline",
519
561
  props: {
520
562
  isOpen: { type: Boolean },
@@ -522,28 +564,28 @@ var Kt = /* @__PURE__ */ N({
522
564
  },
523
565
  emits: ["close", "navigate"],
524
566
  setup(e) {
525
- return (t, n) => e.isOpen ? (R(), k("nav", {
567
+ return (t, n) => e.isOpen ? (L(), A("nav", {
526
568
  key: 0,
527
569
  class: "doc-outline",
528
570
  role: "navigation",
529
571
  "aria-label": "Document outline",
530
- onMousedown: n[1] ||= J(() => {}, ["stop"])
531
- }, [A("div", en, [A("button", {
572
+ onMousedown: n[1] ||= q(() => {}, ["stop"])
573
+ }, [j("div", un, [j("button", {
532
574
  class: "doc-outline__back",
533
575
  title: "Close outline",
534
576
  "aria-label": "Close outline",
535
577
  onClick: n[0] ||= (e) => t.$emit("close")
536
- }, [M(c, {
578
+ }, [M(r, {
537
579
  name: "arrow_back",
538
580
  size: 20
539
- })]), n[2] ||= A("span", { class: "doc-outline__title" }, "Document Outline", -1)]), A("div", tn, [e.headings.length === 0 ? (R(), k("div", nn, " No headings found ")) : O("", !0), (R(!0), k(T, null, B(e.headings, (e, n) => (R(), k("button", {
581
+ })]), n[2] ||= j("span", { class: "doc-outline__title" }, "Document Outline", -1)]), j("div", dn, [e.headings.length === 0 ? (L(), A("div", fn, " No headings found ")) : k("", !0), (L(!0), A(w, null, z(e.headings, (e, n) => (L(), A("button", {
540
582
  key: n,
541
583
  class: "doc-outline__item",
542
- style: F({ paddingLeft: 12 + (e.level - 1) * 16 + "px" }),
543
- onMousedown: J((n) => t.$emit("navigate", e.pmPos), ["prevent"])
544
- }, H(e.text || "(untitled)"), 45, rn))), 128))])], 32)) : O("", !0);
584
+ style: P({ paddingLeft: 12 + (e.level - 1) * 16 + "px" }),
585
+ onMousedown: q((n) => t.$emit("navigate", e.pmPos), ["prevent"])
586
+ }, B(e.text || "(untitled)"), 45, pn))), 128))])], 32)) : k("", !0);
545
587
  }
546
- }), [["__scopeId", "data-v-cb2cdc39"]]), on = /* @__PURE__ */ x(/* @__PURE__ */ N({
588
+ }), [["__scopeId", "data-v-cb2cdc39"]]), hn = /* @__PURE__ */ b(/* @__PURE__ */ N({
547
589
  __name: "PageIndicator",
548
590
  props: {
549
591
  currentPage: {},
@@ -551,21 +593,21 @@ var Kt = /* @__PURE__ */ N({
551
593
  visible: { type: Boolean }
552
594
  },
553
595
  setup(e) {
554
- let { t } = n();
555
- return (n, r) => (R(), k("div", {
596
+ let { t } = d();
597
+ return (n, r) => (L(), A("div", {
556
598
  class: "docx-editor-vue__page-indicator",
557
- style: F({ opacity: +!!e.visible }),
599
+ style: P({ opacity: +!!e.visible }),
558
600
  "aria-live": "polite",
559
601
  role: "status"
560
- }, H(U(t)("viewer.pageIndicator", {
602
+ }, B(V(t)("viewer.pageIndicator", {
561
603
  current: e.currentPage,
562
604
  total: e.totalPages
563
605
  })), 5));
564
606
  }
565
- }), [["__scopeId", "data-v-d117bf6e"]]), sn = { class: "hf-editor__label" }, cn = {
607
+ }), [["__scopeId", "data-v-d117bf6e"]]), gn = { class: "hf-editor__label" }, _n = {
566
608
  class: "hf-editor__actions",
567
609
  style: { position: "relative" }
568
- }, ln = /* @__PURE__ */ x(/* @__PURE__ */ N({
610
+ }, vn = /* @__PURE__ */ b(/* @__PURE__ */ N({
569
611
  __name: "InlineHeaderFooterEditor",
570
612
  props: {
571
613
  isOpen: { type: Boolean },
@@ -579,11 +621,11 @@ var Kt = /* @__PURE__ */ N({
579
621
  "remove"
580
622
  ],
581
623
  setup(e, { emit: t }) {
582
- let n = e, r = t, i = z({}), a = z(!1);
624
+ let n = e, r = t, i = R({}), a = R(!1);
583
625
  function o(e) {
584
626
  let t = n.view;
585
627
  if (!t) return;
586
- let { $from: r, from: i } = t.state.selection, a = t.state.storedMarks || r.marks(), o = je.nodes.field.create({
628
+ let { $from: r, from: i } = t.state.selection, a = t.state.storedMarks || r.marks(), o = Me.nodes.field.create({
587
629
  fieldType: e,
588
630
  instruction: ` ${e} \\* MERGEFORMAT `,
589
631
  fieldKind: "simple",
@@ -603,68 +645,68 @@ var Kt = /* @__PURE__ */ N({
603
645
  pointerEvents: "none"
604
646
  });
605
647
  }
606
- K(() => n.isOpen, (e) => {
648
+ W(() => n.isOpen, (e) => {
607
649
  e && (s(), n.view?.focus());
608
- }), K(() => n.targetRect, () => {
650
+ }), W(() => n.targetRect, () => {
609
651
  n.isOpen && s();
610
652
  }, { deep: !0 });
611
653
  function c() {
612
- n.view && (r("save", it(n.view.state.doc)), r("close"));
654
+ n.view && (r("save", st(n.view.state.doc)), r("close"));
613
655
  }
614
- return (t, n) => e.isOpen ? (R(), k("div", {
656
+ return (t, n) => e.isOpen ? (L(), A("div", {
615
657
  key: 0,
616
658
  class: "hf-editor",
617
- style: F(i.value)
618
- }, [A("div", {
619
- class: P(["hf-editor__toolbar", e.position === "footer" ? "hf-editor__toolbar--below" : "hf-editor__toolbar--above"]),
620
- onMousedown: n[8] ||= J(() => {}, ["stop"]),
621
- onContextmenu: n[9] ||= J(() => {}, ["stop"])
622
- }, [A("span", sn, H(e.position === "header" ? "Header" : "Footer"), 1), A("div", cn, [
623
- A("button", {
659
+ style: P(i.value)
660
+ }, [j("div", {
661
+ class: le(["hf-editor__toolbar", e.position === "footer" ? "hf-editor__toolbar--below" : "hf-editor__toolbar--above"]),
662
+ onMousedown: n[8] ||= q(() => {}, ["stop"]),
663
+ onContextmenu: n[9] ||= q(() => {}, ["stop"])
664
+ }, [j("span", gn, B(e.position === "header" ? "Header" : "Footer"), 1), j("div", _n, [
665
+ j("button", {
624
666
  class: "hf-editor__btn",
625
667
  title: "Options",
626
- onMousedown: n[0] ||= J(() => {}, ["prevent"]),
668
+ onMousedown: n[0] ||= q(() => {}, ["prevent"]),
627
669
  onClick: n[1] ||= (e) => a.value = !a.value
628
670
  }, " Options ▾ ", 32),
629
- a.value ? (R(), k("div", {
671
+ a.value ? (L(), A("div", {
630
672
  key: 0,
631
673
  class: "hf-editor__dropdown",
632
- onMousedown: n[4] ||= J(() => {}, ["stop"]),
633
- onContextmenu: n[5] ||= J(() => {}, ["stop"])
634
- }, [A("button", {
674
+ onMousedown: n[4] ||= q(() => {}, ["stop"]),
675
+ onContextmenu: n[5] ||= q(() => {}, ["stop"])
676
+ }, [j("button", {
635
677
  type: "button",
636
678
  class: "hf-editor__dropdown-item",
637
679
  onClick: n[2] ||= (e) => {
638
680
  a.value = !1, o("PAGE");
639
681
  }
640
- }, " Insert current page number "), A("button", {
682
+ }, " Insert current page number "), j("button", {
641
683
  type: "button",
642
684
  class: "hf-editor__dropdown-item",
643
685
  onClick: n[3] ||= (e) => {
644
686
  a.value = !1, o("NUMPAGES");
645
687
  }
646
- }, " Insert total page count ")], 32)) : O("", !0),
647
- A("button", {
688
+ }, " Insert total page count ")], 32)) : k("", !0),
689
+ j("button", {
648
690
  class: "hf-editor__btn",
649
691
  title: "Remove",
650
- onMousedown: n[6] ||= J((e) => t.$emit("remove"), ["prevent"])
692
+ onMousedown: n[6] ||= q((e) => t.$emit("remove"), ["prevent"])
651
693
  }, " Remove ", 32),
652
- A("button", {
694
+ j("button", {
653
695
  class: "hf-editor__btn hf-editor__btn--primary",
654
696
  title: "Save",
655
- onMousedown: J(c, ["prevent"])
697
+ onMousedown: q(c, ["prevent"])
656
698
  }, " Save ", 32),
657
- A("button", {
699
+ j("button", {
658
700
  class: "hf-editor__btn",
659
701
  title: "Cancel",
660
- onMousedown: n[7] ||= J((e) => t.$emit("close"), ["prevent"])
702
+ onMousedown: n[7] ||= q((e) => t.$emit("close"), ["prevent"])
661
703
  }, " Cancel ", 32)
662
- ])], 34)], 4)) : O("", !0);
704
+ ])], 34)], 4)) : k("", !0);
663
705
  }
664
- }), [["__scopeId", "data-v-e93a9f94"]]), un = ["role"], dn = {
706
+ }), [["__scopeId", "data-v-e93a9f94"]]), yn = ["role"], bn = {
665
707
  key: 0,
666
708
  class: "layout-sdt-widget-empty"
667
- }, fn = ["aria-selected", "onClick"], pn = ["value"], mn = /* @__PURE__ */ N({
709
+ }, xn = ["aria-selected", "onClick"], Sn = ["value"], Cn = ".layout-sdt-widget, .layout-inline-sdt-widget", wn = /* @__PURE__ */ N({
668
710
  __name: "ContentControlWidgets",
669
711
  props: {
670
712
  container: {},
@@ -675,130 +717,144 @@ var Kt = /* @__PURE__ */ N({
675
717
  let t = /^sdt@(\d+)$/.exec(e ?? "");
676
718
  return t ? Number(t[1]) : null;
677
719
  }
678
- let n = e, r = z(null), i = z(null);
679
- function a(e, t) {
680
- let i = n.view;
681
- if (i) try {
682
- i.dispatch(Z(i.state, { tag: e }, t)), i.focus();
720
+ function n(e) {
721
+ if (e == null || e === "") return null;
722
+ let t = Number(e);
723
+ return Number.isFinite(t) ? t : null;
724
+ }
725
+ function r(e) {
726
+ let r = t(e.dataset.sdtGroupId) ?? n(e.dataset.sdtPos), i = e.dataset.sdtTag;
727
+ return r == null ? i ? { tag: i } : null : i ? {
728
+ pos: r,
729
+ tag: i
730
+ } : { pos: r };
731
+ }
732
+ let i = e, a = R(null), o = R(null);
733
+ function s(e, t) {
734
+ let n = i.view;
735
+ if (n) try {
736
+ let r = e.pos == null ? e.tag ? Fe(n.state, { tag: e.tag }, t) : null : Pe(n.state, e.pos, t);
737
+ if (!r) return;
738
+ n.dispatch(r), n.focus();
683
739
  } catch {}
684
- r.value = null;
740
+ a.value = null;
685
741
  }
686
- function o(e) {
687
- let r = n.view, i = t(e.dataset.sdtGroupId);
688
- if (!(!r || i == null)) try {
689
- let t = e.dataset.sdtRepeat === "add" ? Te(r.state, i) : Ae(r.state, i);
690
- r.dispatch(t), r.focus();
742
+ function c(e) {
743
+ let n = i.view, r = t(e.dataset.sdtGroupId);
744
+ if (!(!n || r == null)) try {
745
+ let t = e.dataset.sdtRepeat === "add" ? De(n.state, r) : Z(n.state, r);
746
+ n.dispatch(t), n.focus();
691
747
  } catch {}
692
748
  }
693
- function s(e) {
749
+ function l(e) {
694
750
  let t = e.target;
695
- (t?.closest?.(".layout-sdt-widget") || t?.closest?.(".layout-sdt-repeat-btn")) && e.preventDefault();
751
+ (t?.closest?.(Cn) || t?.closest?.(".layout-sdt-repeat-btn")) && e.preventDefault();
696
752
  }
697
- function c(e) {
698
- let t = n.view, i = e.dataset.sdtTag, o = e.dataset.sdtWidget;
699
- if (!t || !i || !o) return;
700
- let s = Oe(t.state.doc, { tag: i })[0], c = e.getBoundingClientRect();
701
- o === "checkbox" ? a(i, {
753
+ function u(e) {
754
+ let t = i.view, n = e.dataset.sdtWidget, o = r(e);
755
+ if (!t || !n || !o) return;
756
+ let c = o.pos == null ? o.tag ? Ae(t.state.doc, { tag: o.tag })[0] : void 0 : Ae(t.state.doc).find((e) => e.pos === o.pos), l = e.getBoundingClientRect();
757
+ n === "checkbox" ? s(o, {
702
758
  kind: "checkbox",
703
- checked: !s?.checked
704
- }) : o === "dropdown" ? r.value = {
759
+ checked: !c?.checked
760
+ }) : n === "dropdown" ? a.value = {
705
761
  kind: "dropdown",
706
- tag: i,
707
- items: s?.listItems ?? [],
708
- current: s?.text ?? "",
709
- x: c.left,
710
- y: c.bottom + 2
711
- } : o === "date" && (r.value = {
762
+ target: o,
763
+ items: c?.listItems ?? [],
764
+ current: c?.text ?? "",
765
+ x: l.left,
766
+ y: l.bottom + 2
767
+ } : n === "date" && (a.value = {
712
768
  kind: "date",
713
- tag: i,
714
- current: s?.dateValue ?? "",
715
- x: c.left,
716
- y: c.bottom + 2
769
+ target: o,
770
+ current: c?.dateValue ?? "",
771
+ x: l.left,
772
+ y: l.bottom + 2
717
773
  });
718
774
  }
719
- function l(e) {
775
+ function d(e) {
720
776
  let t = e.target?.closest?.(".layout-sdt-repeat-btn");
721
777
  if (t) {
722
- e.preventDefault(), e.stopPropagation(), o(t);
778
+ e.preventDefault(), e.stopPropagation(), c(t);
723
779
  return;
724
780
  }
725
- let n = e.target?.closest?.(".layout-sdt-widget");
726
- n && (e.preventDefault(), e.stopPropagation(), c(n));
781
+ let n = e.target?.closest?.(Cn);
782
+ n && (e.preventDefault(), e.stopPropagation(), u(n));
727
783
  }
728
- function u(e) {
784
+ function f(e) {
729
785
  if (e.key !== "Enter" && e.key !== " ") return;
730
- let t = e.target?.closest?.(".layout-sdt-widget");
731
- t && (e.preventDefault(), c(t));
786
+ let t = e.target?.closest?.(Cn);
787
+ t && (e.preventDefault(), u(t));
732
788
  }
733
- function d(e) {
734
- r.value && !i.value?.contains(e.target) && (r.value = null);
789
+ function p(e) {
790
+ a.value && !o.value?.contains(e.target) && (a.value = null);
735
791
  }
736
- function f(e) {
737
- e.key === "Escape" && (r.value = null);
792
+ function m(e) {
793
+ e.key === "Escape" && (a.value = null);
738
794
  }
739
- let p = null;
740
- K(() => n.container, (e) => {
741
- p && (p.removeEventListener("mousedown", s), p.removeEventListener("click", l), p.removeEventListener("keydown", u)), p = e ?? null, p && (p.addEventListener("mousedown", s), p.addEventListener("click", l), p.addEventListener("keydown", u));
742
- }, { immediate: !0 }), K(r, (e) => {
743
- e ? (document.addEventListener("mousedown", d), document.addEventListener("keydown", f), e.kind === "dropdown" && le(() => {
744
- let e = i.value?.querySelectorAll(".layout-sdt-widget-option");
795
+ let h = null;
796
+ W(() => i.container, (e) => {
797
+ h && (h.removeEventListener("mousedown", l), h.removeEventListener("click", d), h.removeEventListener("keydown", f)), h = e ?? null, h && (h.addEventListener("mousedown", l), h.addEventListener("click", d), h.addEventListener("keydown", f));
798
+ }, { immediate: !0 }), W(a, (e) => {
799
+ e ? (document.addEventListener("mousedown", p), document.addEventListener("keydown", m), e.kind === "dropdown" && ce(() => {
800
+ let e = o.value?.querySelectorAll(".layout-sdt-widget-option");
745
801
  e?.length && ([...e].find((e) => e.getAttribute("aria-selected") === "true") ?? e[0]).focus();
746
- })) : (document.removeEventListener("mousedown", d), document.removeEventListener("keydown", f));
802
+ })) : (document.removeEventListener("mousedown", p), document.removeEventListener("keydown", m));
747
803
  });
748
- function m(e) {
804
+ function g(e) {
749
805
  if (e.key !== "ArrowDown" && e.key !== "ArrowUp") return;
750
- let t = [...i.value?.querySelectorAll(".layout-sdt-widget-option") ?? []];
806
+ let t = [...o.value?.querySelectorAll(".layout-sdt-widget-option") ?? []];
751
807
  if (!t.length) return;
752
808
  e.preventDefault();
753
809
  let n = t.indexOf(document.activeElement);
754
810
  t[e.key === "ArrowDown" ? (n + 1) % t.length : (n - 1 + t.length) % t.length].focus();
755
811
  }
756
- I(() => {
757
- p && (p.removeEventListener("mousedown", s), p.removeEventListener("click", l), p.removeEventListener("keydown", u)), document.removeEventListener("mousedown", d), document.removeEventListener("keydown", f);
812
+ F(() => {
813
+ h && (h.removeEventListener("mousedown", l), h.removeEventListener("click", d), h.removeEventListener("keydown", f)), document.removeEventListener("mousedown", p), document.removeEventListener("keydown", m);
758
814
  });
759
- function h(e) {
815
+ function _(e) {
760
816
  let t = e.target.value;
761
- t && r.value && a(r.value.tag, {
817
+ t && a.value && s(a.value.target, {
762
818
  kind: "date",
763
819
  date: t
764
820
  });
765
821
  }
766
- return (e, t) => r.value ? (R(), k("div", {
822
+ return (e, t) => a.value ? (L(), A("div", {
767
823
  key: 0,
768
824
  ref_key: "popupEl",
769
- ref: i,
825
+ ref: o,
770
826
  class: "layout-sdt-widget-popup",
771
- role: r.value.kind === "dropdown" ? "listbox" : void 0,
772
- style: F({
827
+ role: a.value.kind === "dropdown" ? "listbox" : void 0,
828
+ style: P({
773
829
  position: "fixed",
774
- top: r.value.y + "px",
775
- left: r.value.x + "px",
830
+ top: a.value.y + "px",
831
+ left: a.value.x + "px",
776
832
  zIndex: 1e3
777
833
  }),
778
- onKeydown: m,
779
- onMousedown: t[0] ||= J(() => {}, ["prevent"])
780
- }, [r.value.kind === "dropdown" ? (R(), k(T, { key: 0 }, [r.value.items.length === 0 ? (R(), k("div", dn, "No options")) : O("", !0), (R(!0), k(T, null, B(r.value.items, (e) => (R(), k("button", {
834
+ onKeydown: g,
835
+ onMousedown: t[0] ||= q(() => {}, ["prevent"])
836
+ }, [a.value.kind === "dropdown" ? (L(), A(w, { key: 0 }, [a.value.items.length === 0 ? (L(), A("div", bn, "No options")) : k("", !0), (L(!0), A(w, null, z(a.value.items, (e) => (L(), A("button", {
781
837
  key: e.value,
782
838
  type: "button",
783
839
  role: "option",
784
- "aria-selected": e.displayText === r.value.current,
785
- class: P(["layout-sdt-widget-option", { "is-selected": e.displayText === r.value.current }]),
786
- onClick: (t) => a(r.value.tag, {
840
+ "aria-selected": e.displayText === a.value.current,
841
+ class: le(["layout-sdt-widget-option", { "is-selected": e.displayText === a.value.current }]),
842
+ onClick: (t) => s(a.value.target, {
787
843
  kind: "dropdown",
788
844
  value: e.value
789
845
  })
790
- }, H(e.displayText), 11, fn))), 128))], 64)) : (R(), k("input", {
846
+ }, B(e.displayText), 11, xn))), 128))], 64)) : (L(), A("input", {
791
847
  key: 1,
792
848
  type: "date",
793
849
  class: "layout-sdt-widget-date",
794
- value: r.value.current,
795
- onChange: h
796
- }, null, 40, pn))], 44, un)) : O("", !0);
850
+ value: a.value.current,
851
+ onChange: _
852
+ }, null, 40, Sn))], 44, yn)) : k("", !0);
797
853
  }
798
- }), hn = {
854
+ }), Tn = {
799
855
  key: 0,
800
856
  class: "docx-editor-vue__title-bar"
801
- }, gn = { class: "docx-editor-vue__title-bar-left" }, _n = { class: "docx-editor-vue__title-bar-center" }, vn = { class: "docx-editor-vue__title-bar-right" }, yn = /* @__PURE__ */ N({
857
+ }, En = { class: "docx-editor-vue__title-bar-left" }, Dn = { class: "docx-editor-vue__title-bar-center" }, On = { class: "docx-editor-vue__title-bar-right" }, kn = /* @__PURE__ */ N({
802
858
  __name: "DocxEditorMenuBar",
803
859
  props: {
804
860
  showMenuBar: { type: Boolean },
@@ -817,38 +873,38 @@ var Kt = /* @__PURE__ */ N({
817
873
  ],
818
874
  setup(e, { emit: t }) {
819
875
  let n = t;
820
- return (t, r) => e.showMenuBar ? (R(), k("div", hn, [
821
- A("div", gn, [e.renderLogo ? (R(), ie(ue(e.renderLogo), { key: 0 })) : O("", !0), V(t.$slots, "title-bar-left")]),
822
- A("div", _n, [M(g, {
876
+ return (t, r) => e.showMenuBar ? (L(), A("div", Tn, [
877
+ j("div", En, [e.renderLogo ? (L(), O(de(e.renderLogo), { key: 0 })) : k("", !0), ue(t.$slots, "title-bar-left")]),
878
+ j("div", Dn, [M(h, {
823
879
  "model-value": e.documentName,
824
880
  editable: e.documentNameEditable,
825
881
  "onUpdate:modelValue": r[0] ||= (e) => n("rename", e)
826
- }, null, 8, ["model-value", "editable"]), M(y, {
882
+ }, null, 8, ["model-value", "editable"]), M(v, {
827
883
  onAction: r[1] ||= (e) => n("menu-action", e),
828
884
  onInsertTable: r[2] ||= (e, t) => n("insert-table", e, t)
829
885
  })]),
830
- A("div", vn, [V(t.$slots, "title-bar-right"), e.renderTitleBarRight ? (R(), ie(ue(e.renderTitleBarRight), { key: 0 })) : O("", !0)])
831
- ])) : O("", !0);
886
+ j("div", On, [ue(t.$slots, "title-bar-right"), e.renderTitleBarRight ? (L(), O(de(e.renderTitleBarRight), { key: 0 })) : k("", !0)])
887
+ ])) : k("", !0);
832
888
  }
833
- }), bn = ["aria-label"], xn = { class: "wm-header" }, Sn = { class: "wm-body" }, Cn = { class: "wm-radio-row" }, wn = ["checked"], Tn = {
889
+ }), An = ["aria-label"], jn = { class: "wm-header" }, Mn = { class: "wm-body" }, Nn = { class: "wm-radio-row" }, $ = ["checked"], Pn = {
834
890
  for: "wm-none",
835
891
  class: "wm-inline-label"
836
- }, En = { class: "wm-radio-row" }, Dn = ["checked"], On = {
892
+ }, Fn = { class: "wm-radio-row" }, In = ["checked"], Ln = {
837
893
  for: "wm-picture",
838
894
  class: "wm-inline-label"
839
- }, kn = {
895
+ }, Rn = {
840
896
  key: 0,
841
897
  class: "wm-subform"
842
- }, An = { class: "wm-row" }, jn = {
898
+ }, zn = { class: "wm-row" }, Bn = {
843
899
  key: 0,
844
900
  class: "wm-row"
845
- }, Mn = ["src"], Nn = { class: "wm-row" }, $ = { class: "wm-label" }, Pn = { class: "wm-inline-label" }, Fn = { class: "wm-radio-row" }, In = ["checked"], Ln = {
901
+ }, Vn = ["src"], Hn = { class: "wm-row" }, Un = { class: "wm-label" }, Wn = { class: "wm-inline-label" }, Gn = { class: "wm-radio-row" }, Kn = ["checked"], qn = {
846
902
  for: "wm-text",
847
903
  class: "wm-inline-label"
848
- }, Rn = {
904
+ }, Jn = {
849
905
  key: 1,
850
906
  class: "wm-subform"
851
- }, zn = { class: "wm-row" }, Bn = { class: "wm-label" }, Vn = ["value"], Hn = ["value"], Un = { class: "wm-row" }, Wn = { class: "wm-label" }, Gn = { class: "wm-row" }, Kn = { class: "wm-label" }, qn = ["value"], Jn = { class: "wm-row" }, Yn = { class: "wm-label" }, Xn = { class: "wm-inline-label" }, Zn = { class: "wm-row" }, Qn = { class: "wm-label" }, $n = { class: "wm-row" }, er = { class: "wm-label" }, tr = { class: "wm-inline-label" }, nr = ["checked"], rr = { class: "wm-inline-label" }, ir = ["checked"], ar = { class: "wm-inline-label" }, or = { class: "wm-footer" }, sr = ["disabled"], cr = /* @__PURE__ */ x(/* @__PURE__ */ N({
907
+ }, Yn = { class: "wm-row" }, Xn = { class: "wm-label" }, Zn = ["value"], Qn = ["value"], $n = { class: "wm-row" }, er = { class: "wm-label" }, tr = { class: "wm-row" }, nr = { class: "wm-label" }, rr = ["value"], ir = { class: "wm-row" }, ar = { class: "wm-label" }, or = { class: "wm-inline-label" }, sr = { class: "wm-row" }, cr = { class: "wm-label" }, lr = { class: "wm-row" }, ur = { class: "wm-label" }, dr = { class: "wm-inline-label" }, fr = ["checked"], pr = { class: "wm-inline-label" }, mr = ["checked"], hr = { class: "wm-inline-label" }, gr = { class: "wm-footer" }, _r = ["disabled"], vr = /* @__PURE__ */ b(/* @__PURE__ */ N({
852
908
  __name: "WatermarkDialog",
853
909
  props: {
854
910
  isOpen: { type: Boolean },
@@ -856,33 +912,33 @@ var Kt = /* @__PURE__ */ N({
856
912
  },
857
913
  emits: ["close", "apply"],
858
914
  setup(e, { emit: t }) {
859
- let r = [
915
+ let n = [
860
916
  "CONFIDENTIAL",
861
917
  "DRAFT",
862
918
  "DO NOT COPY",
863
919
  "SAMPLE",
864
920
  "URGENT",
865
921
  "ASAP"
866
- ], i = [
922
+ ], r = [
867
923
  "Calibri",
868
924
  "Arial",
869
925
  "Times New Roman",
870
926
  "Georgia",
871
927
  "Verdana",
872
928
  "Courier New"
873
- ], { t: a } = n(), o = e, s = t, c = z("none"), l = z("CONFIDENTIAL"), u = z("Calibri"), d = z(!0), f = z(54), p = z("#C0C0C0"), m = z("diagonal"), h = z(!0), g = z(void 0), _ = z(void 0), v = z(100), y = z(!0);
874
- K(() => o.isOpen, (e) => {
929
+ ], { t: i } = d(), a = e, o = t, s = R("none"), c = R("CONFIDENTIAL"), l = R("Calibri"), u = R(!0), f = R(54), p = R("#C0C0C0"), m = R("diagonal"), h = R(!0), g = R(void 0), _ = R(void 0), v = R(100), y = R(!0);
930
+ W(() => a.isOpen, (e) => {
875
931
  if (!e) return;
876
- let t = o.current;
877
- t?.kind === "text" ? (c.value = "text", l.value = t.text, u.value = t.font || "Calibri", d.value = t.fontSize === void 0, t.fontSize !== void 0 && (f.value = t.fontSize), p.value = t.color || "#C0C0C0", m.value = t.layout, h.value = t.semitransparent) : t?.kind === "picture" ? (c.value = "picture", g.value = t.dataUrl, _.value = t.widthEmu !== void 0 && t.heightEmu !== void 0 ? {
932
+ let t = a.current;
933
+ t?.kind === "text" ? (s.value = "text", c.value = t.text, l.value = t.font || "Calibri", u.value = t.fontSize === void 0, t.fontSize !== void 0 && (f.value = t.fontSize), p.value = t.color || "#C0C0C0", m.value = t.layout, h.value = t.semitransparent) : t?.kind === "picture" ? (s.value = "picture", g.value = t.dataUrl, _.value = t.widthEmu !== void 0 && t.heightEmu !== void 0 ? {
878
934
  widthEmu: t.widthEmu,
879
935
  heightEmu: t.heightEmu
880
- } : void 0, v.value = Math.round((t.scale || 1) * 100), y.value = t.washout) : c.value = "none";
936
+ } : void 0, v.value = Math.round((t.scale || 1) * 100), y.value = t.washout) : s.value = "none";
881
937
  }, { immediate: !0 });
882
- let b = D(() => c.value === "picture" && !g.value);
938
+ let b = E(() => s.value === "picture" && !g.value);
883
939
  function x(e) {
884
940
  let t = e.target.value;
885
- t && (l.value = t);
941
+ t && (c.value = t);
886
942
  }
887
943
  function S(e) {
888
944
  let t = e.target.files?.[0];
@@ -893,27 +949,27 @@ var Kt = /* @__PURE__ */ N({
893
949
  if (g.value = e, _.value = void 0, !e) return;
894
950
  let t = new Image();
895
951
  t.onload = () => {
896
- _.value = ot(t.naturalWidth, t.naturalHeight);
952
+ _.value = lt(t.naturalWidth, t.naturalHeight);
897
953
  }, t.src = e;
898
954
  }, n.readAsDataURL(t);
899
955
  }
900
956
  function C() {
901
- s("close");
957
+ o("close");
902
958
  }
903
959
  function ee() {
904
- if (c.value === "none") s("apply", null);
905
- else if (c.value === "text") s("apply", {
960
+ if (s.value === "none") o("apply", null);
961
+ else if (s.value === "text") o("apply", {
906
962
  kind: "text",
907
- text: l.value,
908
- font: u.value,
963
+ text: c.value,
964
+ font: l.value,
909
965
  color: p.value,
910
966
  semitransparent: h.value,
911
967
  layout: m.value,
912
- fontSize: d.value ? void 0 : f.value
968
+ fontSize: u.value ? void 0 : f.value
913
969
  });
914
970
  else {
915
971
  if (!g.value) return;
916
- s("apply", {
972
+ o("apply", {
917
973
  kind: "picture",
918
974
  dataUrl: g.value,
919
975
  scale: v.value / 100,
@@ -926,147 +982,147 @@ var Kt = /* @__PURE__ */ N({
926
982
  function te(e) {
927
983
  e.key === "Escape" && C();
928
984
  }
929
- return (t, n) => e.isOpen ? (R(), k("div", {
985
+ return (t, a) => e.isOpen ? (L(), A("div", {
930
986
  key: 0,
931
987
  class: "wm-overlay",
932
- onMousedown: J(C, ["self"]),
988
+ onMousedown: q(C, ["self"]),
933
989
  onKeydown: te
934
- }, [A("div", {
990
+ }, [j("div", {
935
991
  class: "wm-dialog",
936
992
  role: "dialog",
937
- "aria-label": U(a)("dialogs.watermark.title"),
938
- onMousedown: n[13] ||= J(() => {}, ["stop"])
993
+ "aria-label": V(i)("dialogs.watermark.title"),
994
+ onMousedown: a[13] ||= q(() => {}, ["stop"])
939
995
  }, [
940
- A("div", xn, H(U(a)("dialogs.watermark.title")), 1),
941
- A("div", Sn, [
942
- A("div", Cn, [A("input", {
996
+ j("div", jn, B(V(i)("dialogs.watermark.title")), 1),
997
+ j("div", Mn, [
998
+ j("div", Nn, [j("input", {
943
999
  id: "wm-none",
944
1000
  type: "radio",
945
- checked: c.value === "none",
946
- onChange: n[0] ||= (e) => c.value = "none"
947
- }, null, 40, wn), A("label", Tn, H(U(a)("dialogs.watermark.noWatermark")), 1)]),
948
- A("div", En, [A("input", {
1001
+ checked: s.value === "none",
1002
+ onChange: a[0] ||= (e) => s.value = "none"
1003
+ }, null, 40, $), j("label", Pn, B(V(i)("dialogs.watermark.noWatermark")), 1)]),
1004
+ j("div", Fn, [j("input", {
949
1005
  id: "wm-picture",
950
1006
  type: "radio",
951
- checked: c.value === "picture",
952
- onChange: n[1] ||= (e) => c.value = "picture"
953
- }, null, 40, Dn), A("label", On, H(U(a)("dialogs.watermark.picture")), 1)]),
954
- c.value === "picture" ? (R(), k("div", kn, [
955
- A("div", An, [A("input", {
1007
+ checked: s.value === "picture",
1008
+ onChange: a[1] ||= (e) => s.value = "picture"
1009
+ }, null, 40, In), j("label", Ln, B(V(i)("dialogs.watermark.picture")), 1)]),
1010
+ s.value === "picture" ? (L(), A("div", Rn, [
1011
+ j("div", zn, [j("input", {
956
1012
  type: "file",
957
1013
  accept: "image/*",
958
1014
  onChange: S
959
1015
  }, null, 32)]),
960
- g.value ? (R(), k("div", jn, [A("img", {
1016
+ g.value ? (L(), A("div", Bn, [j("img", {
961
1017
  src: g.value,
962
1018
  alt: "",
963
1019
  class: "wm-preview"
964
- }, null, 8, Mn)])) : O("", !0),
965
- A("div", Nn, [
966
- A("span", $, H(U(a)("dialogs.watermark.scale")), 1),
967
- q(A("input", {
1020
+ }, null, 8, Vn)])) : k("", !0),
1021
+ j("div", Hn, [
1022
+ j("span", Un, B(V(i)("dialogs.watermark.scale")), 1),
1023
+ G(j("input", {
968
1024
  class: "wm-input wm-input--narrow",
969
1025
  type: "number",
970
1026
  min: "10",
971
1027
  max: "500",
972
- "onUpdate:modelValue": n[2] ||= (e) => v.value = e
1028
+ "onUpdate:modelValue": a[2] ||= (e) => v.value = e
973
1029
  }, null, 512), [[
974
- G,
1030
+ U,
975
1031
  v.value,
976
1032
  void 0,
977
1033
  { number: !0 }
978
1034
  ]]),
979
- n[14] ||= A("span", { class: "wm-unit" }, "%", -1)
1035
+ a[14] ||= j("span", { class: "wm-unit" }, "%", -1)
980
1036
  ]),
981
- A("label", Pn, [q(A("input", {
1037
+ j("label", Wn, [G(j("input", {
982
1038
  type: "checkbox",
983
- "onUpdate:modelValue": n[3] ||= (e) => y.value = e
984
- }, null, 512), [[W, y.value]]), j(" " + H(U(a)("dialogs.watermark.washout")), 1)])
985
- ])) : O("", !0),
986
- A("div", Fn, [A("input", {
1039
+ "onUpdate:modelValue": a[3] ||= (e) => y.value = e
1040
+ }, null, 512), [[H, y.value]]), ae(" " + B(V(i)("dialogs.watermark.washout")), 1)])
1041
+ ])) : k("", !0),
1042
+ j("div", Gn, [j("input", {
987
1043
  id: "wm-text",
988
1044
  type: "radio",
989
- checked: c.value === "text",
990
- onChange: n[4] ||= (e) => c.value = "text"
991
- }, null, 40, In), A("label", Ln, H(U(a)("dialogs.watermark.text")), 1)]),
992
- c.value === "text" ? (R(), k("div", Rn, [
993
- A("div", zn, [A("span", Bn, H(U(a)("dialogs.watermark.presetLabel")), 1), A("select", {
1045
+ checked: s.value === "text",
1046
+ onChange: a[4] ||= (e) => s.value = "text"
1047
+ }, null, 40, Kn), j("label", qn, B(V(i)("dialogs.watermark.text")), 1)]),
1048
+ s.value === "text" ? (L(), A("div", Jn, [
1049
+ j("div", Yn, [j("span", Xn, B(V(i)("dialogs.watermark.presetLabel")), 1), j("select", {
994
1050
  class: "wm-input",
995
- value: r.includes(l.value) ? l.value : "",
1051
+ value: n.includes(c.value) ? c.value : "",
996
1052
  onChange: x
997
- }, [n[15] ||= A("option", { value: "" }, "—", -1), (R(), k(T, null, B(r, (e) => A("option", {
1053
+ }, [a[15] ||= j("option", { value: "" }, "—", -1), (L(), A(w, null, z(n, (e) => j("option", {
998
1054
  key: e,
999
1055
  value: e
1000
- }, H(e), 9, Hn)), 64))], 40, Vn)]),
1001
- A("div", Un, [A("span", Wn, H(U(a)("dialogs.watermark.textLabel")), 1), q(A("input", {
1056
+ }, B(e), 9, Qn)), 64))], 40, Zn)]),
1057
+ j("div", $n, [j("span", er, B(V(i)("dialogs.watermark.textLabel")), 1), G(j("input", {
1002
1058
  class: "wm-input",
1003
- "onUpdate:modelValue": n[5] ||= (e) => l.value = e
1004
- }, null, 512), [[G, l.value]])]),
1005
- A("div", Gn, [A("span", Kn, H(U(a)("dialogs.watermark.fontLabel")), 1), q(A("select", {
1059
+ "onUpdate:modelValue": a[5] ||= (e) => c.value = e
1060
+ }, null, 512), [[U, c.value]])]),
1061
+ j("div", tr, [j("span", nr, B(V(i)("dialogs.watermark.fontLabel")), 1), G(j("select", {
1006
1062
  class: "wm-input",
1007
- "onUpdate:modelValue": n[6] ||= (e) => u.value = e
1008
- }, [(R(), k(T, null, B(i, (e) => A("option", {
1063
+ "onUpdate:modelValue": a[6] ||= (e) => l.value = e
1064
+ }, [(L(), A(w, null, z(r, (e) => j("option", {
1009
1065
  key: e,
1010
1066
  value: e
1011
- }, H(e), 9, qn)), 64))], 512), [[fe, u.value]])]),
1012
- A("div", Jn, [
1013
- A("span", Yn, H(U(a)("dialogs.watermark.sizeLabel")), 1),
1014
- A("label", Xn, [q(A("input", {
1067
+ }, B(e), 9, rr)), 64))], 512), [[pe, l.value]])]),
1068
+ j("div", ir, [
1069
+ j("span", ar, B(V(i)("dialogs.watermark.sizeLabel")), 1),
1070
+ j("label", or, [G(j("input", {
1015
1071
  type: "checkbox",
1016
- "onUpdate:modelValue": n[7] ||= (e) => d.value = e
1017
- }, null, 512), [[W, d.value]]), j(" " + H(U(a)("dialogs.watermark.sizeAuto")), 1)]),
1018
- d.value ? O("", !0) : q((R(), k("input", {
1072
+ "onUpdate:modelValue": a[7] ||= (e) => u.value = e
1073
+ }, null, 512), [[H, u.value]]), ae(" " + B(V(i)("dialogs.watermark.sizeAuto")), 1)]),
1074
+ u.value ? k("", !0) : G((L(), A("input", {
1019
1075
  key: 0,
1020
1076
  class: "wm-input wm-input--narrow",
1021
1077
  type: "number",
1022
1078
  min: "8",
1023
1079
  max: "200",
1024
- "onUpdate:modelValue": n[8] ||= (e) => f.value = e
1080
+ "onUpdate:modelValue": a[8] ||= (e) => f.value = e
1025
1081
  }, null, 512)), [[
1026
- G,
1082
+ U,
1027
1083
  f.value,
1028
1084
  void 0,
1029
1085
  { number: !0 }
1030
1086
  ]])
1031
1087
  ]),
1032
- A("div", Zn, [A("span", Qn, H(U(a)("dialogs.watermark.colorLabel")), 1), q(A("input", {
1088
+ j("div", sr, [j("span", cr, B(V(i)("dialogs.watermark.colorLabel")), 1), G(j("input", {
1033
1089
  type: "color",
1034
- "onUpdate:modelValue": n[9] ||= (e) => p.value = e
1035
- }, null, 512), [[G, p.value]])]),
1036
- A("div", $n, [
1037
- A("span", er, H(U(a)("dialogs.watermark.layoutLabel")), 1),
1038
- A("label", tr, [A("input", {
1090
+ "onUpdate:modelValue": a[9] ||= (e) => p.value = e
1091
+ }, null, 512), [[U, p.value]])]),
1092
+ j("div", lr, [
1093
+ j("span", ur, B(V(i)("dialogs.watermark.layoutLabel")), 1),
1094
+ j("label", dr, [j("input", {
1039
1095
  type: "radio",
1040
1096
  name: "wm-layout",
1041
1097
  checked: m.value === "diagonal",
1042
- onChange: n[10] ||= (e) => m.value = "diagonal"
1043
- }, null, 40, nr), j(" " + H(U(a)("dialogs.watermark.diagonal")), 1)]),
1044
- A("label", rr, [A("input", {
1098
+ onChange: a[10] ||= (e) => m.value = "diagonal"
1099
+ }, null, 40, fr), ae(" " + B(V(i)("dialogs.watermark.diagonal")), 1)]),
1100
+ j("label", pr, [j("input", {
1045
1101
  type: "radio",
1046
1102
  name: "wm-layout",
1047
1103
  checked: m.value === "horizontal",
1048
- onChange: n[11] ||= (e) => m.value = "horizontal"
1049
- }, null, 40, ir), j(" " + H(U(a)("dialogs.watermark.horizontal")), 1)])
1104
+ onChange: a[11] ||= (e) => m.value = "horizontal"
1105
+ }, null, 40, mr), ae(" " + B(V(i)("dialogs.watermark.horizontal")), 1)])
1050
1106
  ]),
1051
- A("label", ar, [q(A("input", {
1107
+ j("label", hr, [G(j("input", {
1052
1108
  type: "checkbox",
1053
- "onUpdate:modelValue": n[12] ||= (e) => h.value = e
1054
- }, null, 512), [[W, h.value]]), j(" " + H(U(a)("dialogs.watermark.semitransparent")), 1)])
1055
- ])) : O("", !0)
1109
+ "onUpdate:modelValue": a[12] ||= (e) => h.value = e
1110
+ }, null, 512), [[H, h.value]]), ae(" " + B(V(i)("dialogs.watermark.semitransparent")), 1)])
1111
+ ])) : k("", !0)
1056
1112
  ]),
1057
- A("div", or, [A("button", {
1113
+ j("div", gr, [j("button", {
1058
1114
  type: "button",
1059
1115
  class: "wm-btn",
1060
1116
  onClick: C
1061
- }, H(U(a)("dialogs.watermark.cancelButton")), 1), A("button", {
1117
+ }, B(V(i)("dialogs.watermark.cancelButton")), 1), j("button", {
1062
1118
  type: "button",
1063
- class: P(["wm-btn wm-btn--primary", { "wm-btn--disabled": b.value }]),
1119
+ class: le(["wm-btn wm-btn--primary", { "wm-btn--disabled": b.value }]),
1064
1120
  disabled: b.value,
1065
1121
  onClick: ee
1066
- }, H(U(a)("dialogs.watermark.applyButton")), 11, sr)])
1067
- ], 40, bn)], 32)) : O("", !0);
1122
+ }, B(V(i)("dialogs.watermark.applyButton")), 11, _r)])
1123
+ ], 40, An)], 32)) : k("", !0);
1068
1124
  }
1069
- }), [["__scopeId", "data-v-5edfdc47"]]), lr = /* @__PURE__ */ N({
1125
+ }), [["__scopeId", "data-v-5edfdc47"]]), yr = /* @__PURE__ */ N({
1070
1126
  __name: "DocxEditorDialogs",
1071
1127
  props: {
1072
1128
  view: {},
@@ -1075,7 +1131,6 @@ var Kt = /* @__PURE__ */ N({
1075
1131
  sectionProperties: {},
1076
1132
  scrollVisiblePositionIntoView: { type: Function },
1077
1133
  showFindReplace: { type: Boolean },
1078
- showInsertImage: { type: Boolean },
1079
1134
  showHyperlink: { type: Boolean },
1080
1135
  showInsertSymbol: { type: Boolean },
1081
1136
  showImageProperties: { type: Boolean },
@@ -1086,14 +1141,12 @@ var Kt = /* @__PURE__ */ N({
1086
1141
  },
1087
1142
  emits: [
1088
1143
  "update:showFindReplace",
1089
- "update:showInsertImage",
1090
1144
  "update:showHyperlink",
1091
1145
  "update:showInsertSymbol",
1092
1146
  "update:showImageProperties",
1093
1147
  "update:showPageSetup",
1094
1148
  "update:showWatermark",
1095
1149
  "update:showKeyboardShortcuts",
1096
- "insert-image",
1097
1150
  "insert-symbol",
1098
1151
  "hyperlink-submit",
1099
1152
  "hyperlink-remove",
@@ -1102,8 +1155,8 @@ var Kt = /* @__PURE__ */ N({
1102
1155
  ],
1103
1156
  setup(t, { emit: n }) {
1104
1157
  let r = n;
1105
- return (n, a) => (R(), k(T, null, [
1106
- M(u, {
1158
+ return (n, a) => (L(), A(w, null, [
1159
+ M(s, {
1107
1160
  "is-open": t.showFindReplace,
1108
1161
  view: t.view,
1109
1162
  "scroll-visible-position-into-view": t.scrollVisiblePositionIntoView,
@@ -1113,18 +1166,13 @@ var Kt = /* @__PURE__ */ N({
1113
1166
  "view",
1114
1167
  "scroll-visible-position-into-view"
1115
1168
  ]),
1116
- M(s, {
1117
- "is-open": t.showInsertImage,
1118
- onClose: a[1] ||= (e) => r("update:showInsertImage", !1),
1119
- onInsert: a[2] ||= (e) => r("insert-image", e)
1120
- }, null, 8, ["is-open"]),
1121
1169
  M(e, {
1122
1170
  "is-open": t.showHyperlink,
1123
1171
  view: t.view,
1124
1172
  bookmarks: t.bookmarks,
1125
- onClose: a[3] ||= (e) => r("update:showHyperlink", !1),
1126
- onSubmit: a[4] ||= (e) => r("hyperlink-submit", e),
1127
- onRemove: a[5] ||= (e) => r("hyperlink-remove")
1173
+ onClose: a[1] ||= (e) => r("update:showHyperlink", !1),
1174
+ onSubmit: a[2] ||= (e) => r("hyperlink-submit", e),
1175
+ onRemove: a[3] ||= (e) => r("hyperlink-remove")
1128
1176
  }, null, 8, [
1129
1177
  "is-open",
1130
1178
  "view",
@@ -1132,14 +1180,14 @@ var Kt = /* @__PURE__ */ N({
1132
1180
  ]),
1133
1181
  M(i, {
1134
1182
  "is-open": t.showInsertSymbol,
1135
- onClose: a[6] ||= (e) => r("update:showInsertSymbol", !1),
1136
- onInsert: a[7] ||= (e) => r("insert-symbol", e)
1183
+ onClose: a[4] ||= (e) => r("update:showInsertSymbol", !1),
1184
+ onInsert: a[5] ||= (e) => r("insert-symbol", e)
1137
1185
  }, null, 8, ["is-open"]),
1138
- M(l, {
1186
+ M(c, {
1139
1187
  "is-open": t.showImageProperties,
1140
1188
  view: t.view,
1141
1189
  "pm-pos": t.selectedImagePmPos,
1142
- onClose: a[8] ||= (e) => r("update:showImageProperties", !1)
1190
+ onClose: a[6] ||= (e) => r("update:showImageProperties", !1)
1143
1191
  }, null, 8, [
1144
1192
  "is-open",
1145
1193
  "view",
@@ -1148,25 +1196,25 @@ var Kt = /* @__PURE__ */ N({
1148
1196
  M(o, {
1149
1197
  "is-open": t.showPageSetup,
1150
1198
  "section-properties": t.sectionProperties,
1151
- onClose: a[9] ||= (e) => r("update:showPageSetup", !1),
1152
- onApply: a[10] ||= (e) => r("page-setup-apply", e)
1199
+ onClose: a[7] ||= (e) => r("update:showPageSetup", !1),
1200
+ onApply: a[8] ||= (e) => r("page-setup-apply", e)
1153
1201
  }, null, 8, ["is-open", "section-properties"]),
1154
- M(cr, {
1202
+ M(vr, {
1155
1203
  "is-open": t.showWatermark,
1156
1204
  current: t.currentWatermark,
1157
- onClose: a[11] ||= (e) => r("update:showWatermark", !1),
1158
- onApply: a[12] ||= (e) => r("watermark-apply", e)
1205
+ onClose: a[9] ||= (e) => r("update:showWatermark", !1),
1206
+ onApply: a[10] ||= (e) => r("watermark-apply", e)
1159
1207
  }, null, 8, ["is-open", "current"]),
1160
- M(d, {
1208
+ M(u, {
1161
1209
  "is-open": t.showKeyboardShortcuts,
1162
- onClose: a[13] ||= (e) => r("update:showKeyboardShortcuts", !1)
1210
+ onClose: a[11] ||= (e) => r("update:showKeyboardShortcuts", !1)
1163
1211
  }, null, 8, ["is-open"])
1164
1212
  ], 64));
1165
1213
  }
1166
- }), ur = ["disabled", "onMousedown"], dr = { class: "ctx-menu__label" }, fr = {
1214
+ }), br = ["disabled", "onMousedown"], xr = { class: "ctx-menu__label" }, Sr = {
1167
1215
  key: 0,
1168
1216
  class: "ctx-menu__shortcut"
1169
- }, pr = 220, mr = 32, hr = 10, gr = /* @__PURE__ */ x(/* @__PURE__ */ N({
1217
+ }, Cr = 220, wr = 32, Tr = 10, Er = /* @__PURE__ */ b(/* @__PURE__ */ N({
1170
1218
  __name: "TextContextMenu",
1171
1219
  props: {
1172
1220
  isOpen: { type: Boolean },
@@ -1180,35 +1228,35 @@ var Kt = /* @__PURE__ */ N({
1180
1228
  },
1181
1229
  emits: ["close", "action"],
1182
1230
  setup(e, { emit: t }) {
1183
- let r = e, i = t, { t: a } = n(), o = z(null), s = D(() => {
1231
+ let n = e, r = t, { t: i } = d(), a = R(null), o = E(() => {
1184
1232
  let e = [
1185
1233
  {
1186
1234
  id: "cut",
1187
- label: a("contextMenu.cut"),
1235
+ label: i("contextMenu.cut"),
1188
1236
  action: "cut",
1189
- shortcut: a("contextMenu.cutShortcut"),
1190
- disabled: !r.hasSelection || !r.isEditable
1237
+ shortcut: i("contextMenu.cutShortcut"),
1238
+ disabled: !n.hasSelection || !n.isEditable
1191
1239
  },
1192
1240
  {
1193
1241
  id: "copy",
1194
- label: a("contextMenu.copy"),
1242
+ label: i("contextMenu.copy"),
1195
1243
  action: "copy",
1196
- shortcut: a("contextMenu.copyShortcut"),
1197
- disabled: !r.hasSelection
1244
+ shortcut: i("contextMenu.copyShortcut"),
1245
+ disabled: !n.hasSelection
1198
1246
  },
1199
1247
  {
1200
1248
  id: "paste",
1201
- label: a("contextMenu.paste"),
1249
+ label: i("contextMenu.paste"),
1202
1250
  action: "paste",
1203
- shortcut: a("contextMenu.pasteShortcut"),
1204
- disabled: !r.isEditable
1251
+ shortcut: i("contextMenu.pasteShortcut"),
1252
+ disabled: !n.isEditable
1205
1253
  },
1206
1254
  {
1207
1255
  id: "pasteAsPlainText",
1208
- label: a("contextMenu.pastePlainText"),
1256
+ label: i("contextMenu.pastePlainText"),
1209
1257
  action: "pasteAsPlainText",
1210
- shortcut: a("contextMenu.pastePlainTextShortcut"),
1211
- disabled: !r.isEditable
1258
+ shortcut: i("contextMenu.pastePlainTextShortcut"),
1259
+ disabled: !n.isEditable
1212
1260
  },
1213
1261
  {
1214
1262
  id: "div1",
@@ -1218,52 +1266,52 @@ var Kt = /* @__PURE__ */ N({
1218
1266
  },
1219
1267
  {
1220
1268
  id: "delete",
1221
- label: a("contextMenu.delete"),
1269
+ label: i("contextMenu.delete"),
1222
1270
  action: "delete",
1223
- shortcut: a("contextMenu.deleteShortcut"),
1224
- disabled: !r.hasSelection || !r.isEditable
1271
+ shortcut: i("contextMenu.deleteShortcut"),
1272
+ disabled: !n.hasSelection || !n.isEditable
1225
1273
  },
1226
1274
  {
1227
1275
  id: "selectAll",
1228
- label: a("contextMenu.selectAll"),
1276
+ label: i("contextMenu.selectAll"),
1229
1277
  action: "selectAll",
1230
- shortcut: a("contextMenu.selectAllShortcut")
1278
+ shortcut: i("contextMenu.selectAllShortcut")
1231
1279
  }
1232
1280
  ];
1233
- return r.onImage && r.isEditable && e.push({
1281
+ return n.onImage && n.isEditable && e.push({
1234
1282
  id: "div-img",
1235
1283
  label: "",
1236
1284
  action: "",
1237
1285
  divider: !0
1238
1286
  }, {
1239
1287
  id: "replaceImage",
1240
- label: a("imageOverlay.replaceImage"),
1288
+ label: i("imageOverlay.replaceImage"),
1241
1289
  action: "replaceImage"
1242
1290
  }, {
1243
1291
  id: "imageProperties",
1244
- label: a("imageWrap.menu.imageProperties"),
1292
+ label: i("imageWrap.menu.imageProperties"),
1245
1293
  action: "imageProperties"
1246
1294
  }, {
1247
1295
  id: "deleteImage",
1248
- label: a("imageOverlay.deleteImage"),
1296
+ label: i("imageOverlay.deleteImage"),
1249
1297
  action: "deleteImage",
1250
- shortcut: a("contextMenu.deleteShortcut")
1251
- }), r.inTable && r.isEditable && e.push({
1298
+ shortcut: i("contextMenu.deleteShortcut")
1299
+ }), n.inTable && n.isEditable && e.push({
1252
1300
  id: "div2",
1253
1301
  label: "",
1254
1302
  action: "",
1255
1303
  divider: !0
1256
1304
  }, {
1257
1305
  id: "addRowAbove",
1258
- label: a("table.insertRowAbove"),
1306
+ label: i("table.insertRowAbove"),
1259
1307
  action: "addRowAbove"
1260
1308
  }, {
1261
1309
  id: "addRowBelow",
1262
- label: a("table.insertRowBelow"),
1310
+ label: i("table.insertRowBelow"),
1263
1311
  action: "addRowBelow"
1264
1312
  }, {
1265
1313
  id: "deleteRow",
1266
- label: a("table.deleteRow"),
1314
+ label: i("table.deleteRow"),
1267
1315
  action: "deleteRow"
1268
1316
  }, {
1269
1317
  id: "div3",
@@ -1272,15 +1320,15 @@ var Kt = /* @__PURE__ */ N({
1272
1320
  divider: !0
1273
1321
  }, {
1274
1322
  id: "addColLeft",
1275
- label: a("table.insertColumnLeft"),
1323
+ label: i("table.insertColumnLeft"),
1276
1324
  action: "addColumnLeft"
1277
1325
  }, {
1278
1326
  id: "addColRight",
1279
- label: a("table.insertColumnRight"),
1327
+ label: i("table.insertColumnRight"),
1280
1328
  action: "addColumnRight"
1281
1329
  }, {
1282
1330
  id: "deleteCol",
1283
- label: a("table.deleteColumn"),
1331
+ label: i("table.deleteColumn"),
1284
1332
  action: "deleteColumn"
1285
1333
  }, {
1286
1334
  id: "div4",
@@ -1289,74 +1337,74 @@ var Kt = /* @__PURE__ */ N({
1289
1337
  divider: !0
1290
1338
  }, {
1291
1339
  id: "mergeCells",
1292
- label: a("table.mergeCells"),
1340
+ label: i("table.mergeCells"),
1293
1341
  action: "mergeCells",
1294
- disabled: !r.canMergeCells
1342
+ disabled: !n.canMergeCells
1295
1343
  }, {
1296
1344
  id: "splitCell",
1297
- label: a("table.splitCell"),
1345
+ label: i("table.splitCell"),
1298
1346
  action: "splitCell",
1299
- disabled: !r.canSplitCell
1347
+ disabled: !n.canSplitCell
1300
1348
  }), e;
1301
- }), c = D(() => {
1302
- let e = r.position.x, t = r.position.y, n = s.value.filter((e) => !e.divider).length, i = s.value.filter((e) => e.divider).length, a = n * mr + i * 9;
1303
- return typeof window < "u" && (e + pr + hr > window.innerWidth && (e = window.innerWidth - pr - hr), t + a + hr > window.innerHeight && (t = window.innerHeight - a - hr)), {
1349
+ }), s = E(() => {
1350
+ let e = n.position.x, t = n.position.y, r = o.value.filter((e) => !e.divider).length, i = o.value.filter((e) => e.divider).length, a = r * wr + i * 9;
1351
+ return typeof window < "u" && (e + Cr + Tr > window.innerWidth && (e = window.innerWidth - Cr - Tr), t + a + Tr > window.innerHeight && (t = window.innerHeight - a - Tr)), {
1304
1352
  position: "fixed",
1305
1353
  left: `${e}px`,
1306
1354
  top: `${t}px`,
1307
1355
  zIndex: 400
1308
1356
  };
1309
1357
  });
1310
- function l(e) {
1311
- e && (i("action", e), i("close"));
1358
+ function c(e) {
1359
+ e && (r("action", e), r("close"));
1312
1360
  }
1313
- function u(e) {
1314
- e.key === "Escape" && i("close");
1361
+ function l(e) {
1362
+ e.key === "Escape" && r("close");
1315
1363
  }
1316
- return K(() => r.isOpen, (e) => {
1317
- e && le(() => o.value?.focus());
1318
- }), (t, n) => (R(), ie(E, { to: "body" }, [e.isOpen ? (R(), k("div", {
1364
+ return W(() => n.isOpen, (e) => {
1365
+ e && ce(() => a.value?.focus());
1366
+ }), (t, n) => (L(), O(T, { to: "body" }, [e.isOpen ? (L(), A("div", {
1319
1367
  key: 0,
1320
1368
  class: "ctx-menu-backdrop",
1321
1369
  onMousedown: n[0] ||= (e) => t.$emit("close"),
1322
- onContextmenu: n[1] ||= J((e) => t.$emit("close"), ["prevent"])
1323
- }, null, 32)) : O("", !0), e.isOpen ? (R(), k("div", {
1370
+ onContextmenu: n[1] ||= q((e) => t.$emit("close"), ["prevent"])
1371
+ }, null, 32)) : k("", !0), e.isOpen ? (L(), A("div", {
1324
1372
  key: 1,
1325
1373
  ref_key: "menuRef",
1326
- ref: o,
1374
+ ref: a,
1327
1375
  class: "ctx-menu",
1328
- style: F(c.value),
1329
- onContextmenu: n[2] ||= J(() => {}, ["prevent"]),
1330
- onKeydown: u
1331
- }, [(R(!0), k(T, null, B(s.value, (e, t) => (R(), k("button", {
1376
+ style: P(s.value),
1377
+ onContextmenu: n[2] ||= q(() => {}, ["prevent"]),
1378
+ onKeydown: l
1379
+ }, [(L(!0), A(w, null, z(o.value, (e, t) => (L(), A("button", {
1332
1380
  key: e.id || t,
1333
- class: P(["ctx-menu__item", {
1381
+ class: le(["ctx-menu__item", {
1334
1382
  "ctx-menu__item--disabled": e.disabled,
1335
1383
  "ctx-menu__item--divider": e.divider
1336
1384
  }]),
1337
1385
  disabled: e.disabled,
1338
- onMousedown: J((t) => l(e.action), ["prevent"])
1339
- }, [A("span", dr, H(e.label), 1), e.shortcut ? (R(), k("span", fr, H(e.shortcut), 1)) : O("", !0)], 42, ur))), 128))], 36)) : O("", !0)]));
1386
+ onMousedown: q((t) => c(e.action), ["prevent"])
1387
+ }, [j("span", xr, B(e.label), 1), e.shortcut ? (L(), A("span", Sr, B(e.shortcut), 1)) : k("", !0)], 42, br))), 128))], 36)) : k("", !0)]));
1340
1388
  }
1341
- }), [["__scopeId", "data-v-b2122da6"]]), _r = ["aria-label"], vr = { class: "image-ctx-menu__icon" }, yr = { class: "image-ctx-menu__label" }, br = {
1389
+ }), [["__scopeId", "data-v-b2122da6"]]), Dr = ["aria-label"], Or = { class: "image-ctx-menu__icon" }, kr = { class: "image-ctx-menu__label" }, Ar = {
1342
1390
  key: 1,
1343
1391
  class: "image-ctx-menu__divider",
1344
1392
  role: "separator"
1345
- }, xr = [
1393
+ }, jr = [
1346
1394
  "data-wrap-type",
1347
1395
  "data-current",
1348
1396
  "data-disabled",
1349
1397
  "disabled",
1350
1398
  "title",
1351
1399
  "onClick"
1352
- ], Sr = { class: "image-ctx-menu__icon" }, Cr = { class: "image-ctx-menu__label" }, wr = ["aria-label"], Tr = ["disabled", "onClick"], Er = { class: "image-ctx-menu__label" }, Dr = {
1400
+ ], Mr = { class: "image-ctx-menu__icon" }, Nr = { class: "image-ctx-menu__label" }, Pr = ["aria-label"], Fr = ["disabled", "onClick"], Ir = { class: "image-ctx-menu__label" }, Lr = {
1353
1401
  key: 0,
1354
1402
  class: "image-ctx-menu__shortcut"
1355
- }, Or = {
1403
+ }, Rr = {
1356
1404
  key: 0,
1357
1405
  class: "image-ctx-menu__divider",
1358
1406
  role: "separator"
1359
- }, kr = 18, Ar = 260, jr = 10, Mr = /* @__PURE__ */ x(/* @__PURE__ */ N({
1407
+ }, zr = 18, Br = 260, Vr = 10, Hr = /* @__PURE__ */ b(/* @__PURE__ */ N({
1360
1408
  __name: "ImageContextMenu",
1361
1409
  props: {
1362
1410
  state: {},
@@ -1373,11 +1421,11 @@ var Kt = /* @__PURE__ */ N({
1373
1421
  "open-properties"
1374
1422
  ],
1375
1423
  setup(e, { emit: t }) {
1376
- let r = e, i = t;
1424
+ let n = e, i = t;
1377
1425
  function a() {
1378
1426
  i("open-properties"), i("close");
1379
1427
  }
1380
- let { t: o } = n(), s = z(null), l = Ze, u = D(() => r.state ? $e(r.state.currentWrapType, r.state.currentCssFloat ?? null) : null), d = {
1428
+ let { t: o } = d(), s = R(null), c = et, l = E(() => n.state ? nt(n.state.currentWrapType, n.state.currentCssFloat ?? null) : null), u = {
1381
1429
  inline: "wrap_text",
1382
1430
  squareLeft: "format_image_left",
1383
1431
  squareRight: "format_image_right",
@@ -1385,21 +1433,21 @@ var Kt = /* @__PURE__ */ N({
1385
1433
  inFront: "flip_to_front"
1386
1434
  };
1387
1435
  function f(e) {
1388
- return d[e];
1436
+ return u[e];
1389
1437
  }
1390
- let p = D(() => {
1391
- if (!r.state) return {};
1392
- let e = Ze.length * 36 + 16, t = r.state.position.x, n = r.state.position.y;
1393
- return typeof window < "u" && (t + Ar > window.innerWidth && (t = window.innerWidth - Ar - jr), n + e > window.innerHeight && (n = window.innerHeight - e - jr), t < jr && (t = jr), n < jr && (n = jr)), {
1438
+ let p = E(() => {
1439
+ if (!n.state) return {};
1440
+ let e = et.length * 36 + 16, t = n.state.position.x, r = n.state.position.y;
1441
+ return typeof window < "u" && (t + Br > window.innerWidth && (t = window.innerWidth - Br - Vr), r + e > window.innerHeight && (r = window.innerHeight - e - Vr), t < Vr && (t = Vr), r < Vr && (r = Vr)), {
1394
1442
  position: "fixed",
1395
1443
  left: `${t}px`,
1396
- top: `${n}px`,
1397
- minWidth: `${Ar}px`,
1444
+ top: `${r}px`,
1445
+ minWidth: `${Br}px`,
1398
1446
  zIndex: 400
1399
1447
  };
1400
1448
  });
1401
1449
  function m(e) {
1402
- return r.state ? tt(e, r.state.currentWrapType) : !1;
1450
+ return n.state ? it(e, n.state.currentWrapType) : !1;
1403
1451
  }
1404
1452
  function h(e) {
1405
1453
  m(e) && (i("select", e.choice), i("close"));
@@ -1413,74 +1461,74 @@ var Kt = /* @__PURE__ */ N({
1413
1461
  function v(e) {
1414
1462
  e.key === "Escape" && (e.preventDefault(), i("close"));
1415
1463
  }
1416
- return (t, n) => (R(), ie(E, { to: "body" }, [e.state && e.state.open ? (R(), k("div", {
1464
+ return (t, n) => (L(), O(T, { to: "body" }, [e.state && e.state.open ? (L(), A("div", {
1417
1465
  key: 0,
1418
1466
  class: "image-ctx-menu-backdrop",
1419
1467
  onMousedown: _,
1420
- onContextmenu: n[0] ||= J((e) => t.$emit("close"), ["prevent"])
1421
- }, null, 32)) : O("", !0), e.state && e.state.open ? (R(), k("div", {
1468
+ onContextmenu: n[0] ||= q((e) => t.$emit("close"), ["prevent"])
1469
+ }, null, 32)) : k("", !0), e.state && e.state.open ? (L(), A("div", {
1422
1470
  key: 1,
1423
1471
  ref_key: "menuRef",
1424
1472
  ref: s,
1425
1473
  class: "image-ctx-menu",
1426
1474
  role: "menu",
1427
- "aria-label": U(o)("imageWrap.menu.ariaLabel"),
1475
+ "aria-label": V(o)("imageWrap.menu.ariaLabel"),
1428
1476
  "data-testid": "image-context-menu",
1429
- style: F(p.value),
1430
- onContextmenu: n[4] ||= J(() => {}, ["prevent"]),
1477
+ style: P(p.value),
1478
+ onContextmenu: n[4] ||= q(() => {}, ["prevent"]),
1431
1479
  onKeydown: v
1432
1480
  }, [
1433
- e.canOpenProperties ? (R(), k("button", {
1481
+ e.canOpenProperties ? (L(), A("button", {
1434
1482
  key: 0,
1435
1483
  type: "button",
1436
1484
  role: "menuitem",
1437
1485
  class: "image-ctx-menu__item",
1438
1486
  "data-action": "open-properties",
1439
- onMousedown: n[1] ||= J(() => {}, ["prevent"]),
1487
+ onMousedown: n[1] ||= q(() => {}, ["prevent"]),
1440
1488
  onClick: a
1441
- }, [A("span", vr, [M(c, {
1489
+ }, [j("span", Or, [M(r, {
1442
1490
  name: "settings",
1443
- size: kr
1444
- })]), A("span", yr, H(U(o)("imageWrap.menu.imageProperties")), 1)], 32)) : O("", !0),
1445
- e.canOpenProperties ? (R(), k("div", br)) : O("", !0),
1446
- (R(!0), k(T, null, B(U(l), (e) => (R(), k("button", {
1491
+ size: zr
1492
+ })]), j("span", kr, B(V(o)("imageWrap.menu.imageProperties")), 1)], 32)) : k("", !0),
1493
+ e.canOpenProperties ? (L(), A("div", Ar)) : k("", !0),
1494
+ (L(!0), A(w, null, z(V(c), (e) => (L(), A("button", {
1447
1495
  key: e.choice,
1448
1496
  type: "button",
1449
1497
  role: "menuitem",
1450
- class: P(["image-ctx-menu__item", { "image-ctx-menu__item--current": e.choice === u.value }]),
1498
+ class: le(["image-ctx-menu__item", { "image-ctx-menu__item--current": e.choice === l.value }]),
1451
1499
  "data-wrap-type": e.choice,
1452
- "data-current": e.choice === u.value ? "true" : "false",
1500
+ "data-current": e.choice === l.value ? "true" : "false",
1453
1501
  "data-disabled": m(e) ? "false" : "true",
1454
1502
  disabled: !m(e),
1455
- title: U(o)(`imageWrap.menuDesc.${e.i18nDescKey}`),
1456
- onMousedown: n[2] ||= J(() => {}, ["prevent"]),
1503
+ title: V(o)(`imageWrap.menuDesc.${e.i18nDescKey}`),
1504
+ onMousedown: n[2] ||= q(() => {}, ["prevent"]),
1457
1505
  onClick: (t) => h(e)
1458
1506
  }, [
1459
- A("span", Sr, [M(c, {
1507
+ j("span", Mr, [M(r, {
1460
1508
  name: f(e.iconHint),
1461
- size: kr
1509
+ size: zr
1462
1510
  }, null, 8, ["name"])]),
1463
- A("span", Cr, H(U(o)(`imageWrap.menu.${e.i18nLabelKey}`)), 1),
1464
- e.choice === u.value ? (R(), k("span", {
1511
+ j("span", Nr, B(V(o)(`imageWrap.menu.${e.i18nLabelKey}`)), 1),
1512
+ e.choice === l.value ? (L(), A("span", {
1465
1513
  key: 0,
1466
1514
  class: "image-ctx-menu__current-dot",
1467
- "aria-label": U(o)("imageWrap.menu.ariaLabel")
1468
- }, "●", 8, wr)) : O("", !0)
1469
- ], 42, xr))), 128)),
1470
- e.textActions && e.textActions.length > 0 ? (R(), k(T, { key: 2 }, [n[5] ||= A("div", {
1515
+ "aria-label": V(o)("imageWrap.menu.ariaLabel")
1516
+ }, "●", 8, Pr)) : k("", !0)
1517
+ ], 42, jr))), 128)),
1518
+ e.textActions && e.textActions.length > 0 ? (L(), A(w, { key: 2 }, [n[5] ||= j("div", {
1471
1519
  class: "image-ctx-menu__divider",
1472
1520
  role: "separator"
1473
- }, null, -1), (R(!0), k(T, null, B(e.textActions, (e, t) => (R(), k(T, { key: `${e.action}-${t}` }, [A("button", {
1521
+ }, null, -1), (L(!0), A(w, null, z(e.textActions, (e, t) => (L(), A(w, { key: `${e.action}-${t}` }, [j("button", {
1474
1522
  type: "button",
1475
1523
  role: "menuitem",
1476
1524
  class: "image-ctx-menu__item image-ctx-menu__item--text",
1477
1525
  disabled: e.disabled,
1478
- onMousedown: n[3] ||= J(() => {}, ["prevent"]),
1526
+ onMousedown: n[3] ||= q(() => {}, ["prevent"]),
1479
1527
  onClick: (t) => g(e)
1480
- }, [A("span", Er, H(e.label), 1), e.shortcut ? (R(), k("span", Dr, H(e.shortcut), 1)) : O("", !0)], 40, Tr), e.dividerAfter ? (R(), k("div", Or)) : O("", !0)], 64))), 128))], 64)) : O("", !0)
1481
- ], 44, _r)) : O("", !0)]));
1528
+ }, [j("span", Ir, B(e.label), 1), e.shortcut ? (L(), A("span", Lr, B(e.shortcut), 1)) : k("", !0)], 40, Fr), e.dividerAfter ? (L(), A("div", Rr)) : k("", !0)], 64))), 128))], 64)) : k("", !0)
1529
+ ], 44, Dr)) : k("", !0)]));
1482
1530
  }
1483
- }), [["__scopeId", "data-v-5c21ca8c"]]), Nr = /* @__PURE__ */ N({
1531
+ }), [["__scopeId", "data-v-5c21ca8c"]]), Ur = /* @__PURE__ */ N({
1484
1532
  __name: "DocxEditorOverlays",
1485
1533
  props: {
1486
1534
  readOnly: { type: Boolean },
@@ -1498,7 +1546,7 @@ var Kt = /* @__PURE__ */ N({
1498
1546
  ],
1499
1547
  setup(e, { emit: t }) {
1500
1548
  let n = t;
1501
- return (t, r) => (R(), k(T, null, [M(gr, {
1549
+ return (t, r) => (L(), A(w, null, [M(Er, {
1502
1550
  "is-open": e.contextMenu.isOpen,
1503
1551
  position: e.contextMenu.position,
1504
1552
  "has-selection": e.contextMenu.hasSelection,
@@ -1518,7 +1566,7 @@ var Kt = /* @__PURE__ */ N({
1518
1566
  "on-image",
1519
1567
  "can-merge-cells",
1520
1568
  "can-split-cell"
1521
- ]), M(Mr, {
1569
+ ]), M(Hr, {
1522
1570
  state: e.imageContextMenu,
1523
1571
  "text-actions": e.imageContextMenuTextActions,
1524
1572
  "can-open-properties": e.canOpenImageProperties,
@@ -1532,7 +1580,7 @@ var Kt = /* @__PURE__ */ N({
1532
1580
  "can-open-properties"
1533
1581
  ])], 64));
1534
1582
  }
1535
- }), Pr = ["href", "title"], Fr = ["title"], Ir = ["title"], Lr = ["title"], Rr = { class: "docx-hyperlink-popup__edit-row" }, zr = ["placeholder", "onKeydown"], Br = { class: "docx-hyperlink-popup__edit-row" }, Vr = ["onKeydown"], Hr = ["disabled"], Ur = /* @__PURE__ */ x(/* @__PURE__ */ N({
1583
+ }), Wr = ["href", "title"], Gr = ["title"], Kr = ["title"], qr = ["title"], Jr = { class: "docx-hyperlink-popup__edit-row" }, Yr = ["placeholder", "onKeydown"], Xr = { class: "docx-hyperlink-popup__edit-row" }, Zr = ["onKeydown"], Qr = ["disabled"], $r = /* @__PURE__ */ b(/* @__PURE__ */ N({
1536
1584
  __name: "HyperlinkPopup",
1537
1585
  props: {
1538
1586
  data: {},
@@ -1546,69 +1594,69 @@ var Kt = /* @__PURE__ */ N({
1546
1594
  "close"
1547
1595
  ],
1548
1596
  setup(e, { emit: t }) {
1549
- let { t: r } = n(), i = e, a = t, o = z(!1), s = z(""), c = z(""), l = z(null), u = D(() => ({
1550
- left: (i.data?.position.left ?? 0) + "px",
1551
- top: (i.data?.position.top ?? 0) + "px"
1597
+ let { t: n } = d(), r = e, i = t, a = R(!1), o = R(""), s = R(""), c = R(null), l = E(() => ({
1598
+ left: (r.data?.position.left ?? 0) + "px",
1599
+ top: (r.data?.position.top ?? 0) + "px"
1552
1600
  }));
1553
- K(() => i.data?.href, () => {
1554
- o.value = !1;
1601
+ W(() => r.data?.href, () => {
1602
+ a.value = !1;
1555
1603
  });
1556
- let d = null, f = null;
1604
+ let u = null, f = null;
1557
1605
  function p() {
1558
- f &&= (clearTimeout(f), null), d &&= (document.removeEventListener("mousedown", d), null);
1606
+ f &&= (clearTimeout(f), null), u &&= (document.removeEventListener("mousedown", u), null);
1559
1607
  }
1560
- K(() => i.data, (e) => {
1561
- p(), e && (d = (e) => {
1562
- let t = l.value;
1563
- t && !t.contains(e.target) && a("close");
1608
+ W(() => r.data, (e) => {
1609
+ p(), e && (u = (e) => {
1610
+ let t = c.value;
1611
+ t && !t.contains(e.target) && i("close");
1564
1612
  }, f = setTimeout(() => {
1565
- d && document.addEventListener("mousedown", d);
1613
+ u && document.addEventListener("mousedown", u);
1566
1614
  }, 0));
1567
- }, { immediate: !0 }), I(p);
1615
+ }, { immediate: !0 }), F(p);
1568
1616
  function m() {
1569
- i.data && (s.value = i.data.displayText, c.value = i.data.href, o.value = !0);
1617
+ r.data && (o.value = r.data.displayText, s.value = r.data.href, a.value = !0);
1570
1618
  }
1571
1619
  function h() {
1572
- c.value.trim() && (a("edit", s.value, c.value), o.value = !1);
1620
+ s.value.trim() && (i("edit", o.value, s.value), a.value = !1);
1573
1621
  }
1574
1622
  function g() {
1575
- i.data && (a("copy", i.data.href), typeof navigator < "u" && navigator.clipboard && navigator.clipboard.writeText(i.data.href).catch(() => {}));
1623
+ r.data && (i("copy", r.data.href), typeof navigator < "u" && navigator.clipboard && navigator.clipboard.writeText(r.data.href).catch(() => {}));
1576
1624
  }
1577
- return (t, n) => e.data ? (R(), k("div", {
1625
+ return (t, r) => e.data ? (L(), A("div", {
1578
1626
  key: 0,
1579
1627
  ref_key: "popupRef",
1580
- ref: l,
1581
- class: P(["docx-hyperlink-popup", { "docx-hyperlink-popup--edit": o.value }]),
1582
- style: F(u.value),
1583
- onMousedown: n[6] ||= J(() => {}, ["stop"])
1584
- }, [o.value ? (R(), k(T, { key: 1 }, [A("div", Rr, [q(A("input", {
1628
+ ref: c,
1629
+ class: le(["docx-hyperlink-popup", { "docx-hyperlink-popup--edit": a.value }]),
1630
+ style: P(l.value),
1631
+ onMousedown: r[6] ||= q(() => {}, ["stop"])
1632
+ }, [a.value ? (L(), A(w, { key: 1 }, [j("div", Jr, [G(j("input", {
1585
1633
  class: "docx-hyperlink-popup__input",
1586
- placeholder: U(r)("hyperlinkPopup.displayTextPlaceholder"),
1587
- "onUpdate:modelValue": n[2] ||= (e) => s.value = e,
1588
- onKeydown: [me(J(h, ["prevent"]), ["enter"]), n[3] ||= me((e) => t.$emit("close"), ["esc"])]
1589
- }, null, 40, zr), [[G, s.value]])]), A("div", Br, [q(A("input", {
1634
+ placeholder: V(n)("hyperlinkPopup.displayTextPlaceholder"),
1635
+ "onUpdate:modelValue": r[2] ||= (e) => o.value = e,
1636
+ onKeydown: [K(q(h, ["prevent"]), ["enter"]), r[3] ||= K((e) => t.$emit("close"), ["esc"])]
1637
+ }, null, 40, Yr), [[U, o.value]])]), j("div", Xr, [G(j("input", {
1590
1638
  class: "docx-hyperlink-popup__input",
1591
1639
  placeholder: "https://...",
1592
- "onUpdate:modelValue": n[4] ||= (e) => c.value = e,
1593
- onKeydown: [me(J(h, ["prevent"]), ["enter"]), n[5] ||= me((e) => t.$emit("close"), ["esc"])]
1594
- }, null, 40, Vr), [[G, c.value]]), A("button", {
1640
+ "onUpdate:modelValue": r[4] ||= (e) => s.value = e,
1641
+ onKeydown: [K(q(h, ["prevent"]), ["enter"]), r[5] ||= K((e) => t.$emit("close"), ["esc"])]
1642
+ }, null, 40, Zr), [[U, s.value]]), j("button", {
1595
1643
  class: "docx-hyperlink-popup__apply",
1596
- disabled: !c.value.trim(),
1597
- onClick: J(h, ["prevent"])
1598
- }, H(U(r)("common.apply")), 9, Hr)])], 64)) : (R(), k(T, { key: 0 }, [
1599
- n[10] ||= oe("<span class=\"docx-hyperlink-popup__icon\" aria-hidden data-v-9d23bb12><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-9d23bb12><circle cx=\"12\" cy=\"12\" r=\"10\" data-v-9d23bb12></circle><path d=\"M2 12h20\" data-v-9d23bb12></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-9d23bb12></path></svg></span>", 1),
1600
- A("a", {
1644
+ disabled: !s.value.trim(),
1645
+ onClick: q(h, ["prevent"])
1646
+ }, B(V(n)("common.apply")), 9, Qr)])], 64)) : (L(), A(w, { key: 0 }, [
1647
+ r[10] ||= ie("<span class=\"docx-hyperlink-popup__icon\" aria-hidden data-v-9d23bb12><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-9d23bb12><circle cx=\"12\" cy=\"12\" r=\"10\" data-v-9d23bb12></circle><path d=\"M2 12h20\" data-v-9d23bb12></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-9d23bb12></path></svg></span>", 1),
1648
+ j("a", {
1601
1649
  class: "docx-hyperlink-popup__url",
1602
1650
  href: e.data.href,
1603
1651
  title: e.data.href,
1604
- onClick: n[0] ||= J((n) => t.$emit("navigate", e.data.href), ["prevent"])
1605
- }, H(e.data.href), 9, Pr),
1606
- n[11] ||= A("span", { class: "docx-hyperlink-popup__sep" }, null, -1),
1607
- A("button", {
1652
+ onClick: r[0] ||= q((n) => t.$emit("navigate", e.data.href), ["prevent"])
1653
+ }, B(e.data.href), 9, Wr),
1654
+ r[11] ||= j("span", { class: "docx-hyperlink-popup__sep" }, null, -1),
1655
+ j("button", {
1608
1656
  class: "docx-hyperlink-popup__btn",
1609
- title: U(r)("hyperlinkPopup.copyLink"),
1610
- onClick: J(g, ["prevent"])
1611
- }, [...n[7] ||= [A("svg", {
1657
+ title: V(n)("hyperlinkPopup.copyLink"),
1658
+ onClick: q(g, ["prevent"])
1659
+ }, [...r[7] ||= [j("svg", {
1612
1660
  width: "18",
1613
1661
  height: "18",
1614
1662
  viewBox: "0 0 24 24",
@@ -1617,20 +1665,20 @@ var Kt = /* @__PURE__ */ N({
1617
1665
  "stroke-width": "2",
1618
1666
  "stroke-linecap": "round",
1619
1667
  "stroke-linejoin": "round"
1620
- }, [A("rect", {
1668
+ }, [j("rect", {
1621
1669
  x: "9",
1622
1670
  y: "9",
1623
1671
  width: "13",
1624
1672
  height: "13",
1625
1673
  rx: "2",
1626
1674
  ry: "2"
1627
- }), A("path", { d: "M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1" })], -1)]], 8, Fr),
1628
- e.readOnly ? O("", !0) : (R(), k("button", {
1675
+ }), j("path", { d: "M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1" })], -1)]], 8, Gr),
1676
+ e.readOnly ? k("", !0) : (L(), A("button", {
1629
1677
  key: 0,
1630
1678
  class: "docx-hyperlink-popup__btn",
1631
- title: U(r)("hyperlinkPopup.editLink"),
1632
- onClick: J(m, ["prevent"])
1633
- }, [...n[8] ||= [A("svg", {
1679
+ title: V(n)("hyperlinkPopup.editLink"),
1680
+ onClick: q(m, ["prevent"])
1681
+ }, [...r[8] ||= [j("svg", {
1634
1682
  width: "18",
1635
1683
  height: "18",
1636
1684
  viewBox: "0 0 24 24",
@@ -1639,66 +1687,72 @@ var Kt = /* @__PURE__ */ N({
1639
1687
  "stroke-width": "2",
1640
1688
  "stroke-linecap": "round",
1641
1689
  "stroke-linejoin": "round"
1642
- }, [A("path", { d: "M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7" }), A("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, Ir)),
1643
- e.readOnly ? O("", !0) : (R(), k("button", {
1690
+ }, [j("path", { d: "M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7" }), j("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, Kr)),
1691
+ e.readOnly ? k("", !0) : (L(), A("button", {
1644
1692
  key: 1,
1645
1693
  class: "docx-hyperlink-popup__btn",
1646
- title: U(r)("hyperlinkPopup.removeLink"),
1647
- onClick: n[1] ||= J((e) => t.$emit("remove"), ["prevent"])
1648
- }, [...n[9] ||= [oe("<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-9d23bb12><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-9d23bb12></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-9d23bb12></path><line x1=\"8\" y1=\"2\" x2=\"8\" y2=\"5\" data-v-9d23bb12></line><line x1=\"2\" y1=\"8\" x2=\"5\" y2=\"8\" data-v-9d23bb12></line><line x1=\"16\" y1=\"19\" x2=\"16\" y2=\"22\" data-v-9d23bb12></line><line x1=\"19\" y1=\"16\" x2=\"22\" y2=\"16\" data-v-9d23bb12></line></svg>", 1)]], 8, Lr))
1649
- ], 64))], 38)) : O("", !0);
1694
+ title: V(n)("hyperlinkPopup.removeLink"),
1695
+ onClick: r[1] ||= q((e) => t.$emit("remove"), ["prevent"])
1696
+ }, [...r[9] ||= [ie("<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-9d23bb12><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-9d23bb12></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-9d23bb12></path><line x1=\"8\" y1=\"2\" x2=\"8\" y2=\"5\" data-v-9d23bb12></line><line x1=\"2\" y1=\"8\" x2=\"5\" y2=\"8\" data-v-9d23bb12></line><line x1=\"16\" y1=\"19\" x2=\"16\" y2=\"22\" data-v-9d23bb12></line><line x1=\"19\" y1=\"16\" x2=\"22\" y2=\"16\" data-v-9d23bb12></line></svg>", 1)]], 8, qr))
1697
+ ], 64))], 38)) : k("", !0);
1650
1698
  }
1651
1699
  }), [["__scopeId", "data-v-9d23bb12"]]);
1652
1700
  //#endregion
1653
1701
  //#region src/composables/useFileIO.ts
1654
- function Wr(e) {
1655
- let t = z(null);
1656
- async function n() {
1702
+ function ei(e) {
1703
+ let t = R(null), n = R(null);
1704
+ function r(t) {
1705
+ let n = t.target, r = n.files?.[0], i = e.getActiveView();
1706
+ r && i && ht(i, r, { onError: (t) => e.emit("error", t instanceof Error ? t : /* @__PURE__ */ Error("Failed to insert image")) }), n.value = "";
1707
+ }
1708
+ async function i() {
1657
1709
  await e.nextTick(), e.extractCommentsAndChanges(), e.emit("ready");
1658
1710
  }
1659
- async function r(t) {
1711
+ async function a(t) {
1660
1712
  try {
1661
- let r = await Re(t);
1662
- if (!r) return;
1663
- await e.loadBuffer(r.buffer), e.emit("update:document", e.getDocument()), e.emit("rename", r.name), await n();
1713
+ let n = await Q(t);
1714
+ if (!n) return;
1715
+ await e.loadBuffer(n.buffer), e.emit("update:document", e.getDocument()), e.emit("rename", n.name), await i();
1664
1716
  } catch (t) {
1665
1717
  e.emit("error", t instanceof Error ? t : /* @__PURE__ */ Error("Failed to open document"));
1666
1718
  }
1667
1719
  }
1668
- function i(t) {
1720
+ function o(t) {
1669
1721
  e.onDocumentNameChange?.(t), e.emit("rename", t);
1670
1722
  }
1671
- async function a() {
1723
+ async function s() {
1672
1724
  let t = await e.saveBlob();
1673
1725
  if (!t) return;
1674
1726
  let n = (e.documentName() ?? "").trim() || "document", r = URL.createObjectURL(t), i = window.document.createElement("a");
1675
1727
  i.href = r, i.download = `${n.replace(/\.docx$/i, "")}.docx`, i.click(), setTimeout(() => URL.revokeObjectURL(r), 0);
1676
1728
  }
1677
- async function o(t) {
1678
- await e.loadBuffer(t), e.emit("update:document", e.getDocument()), await n();
1729
+ async function c(t) {
1730
+ await e.loadBuffer(t), e.emit("update:document", e.getDocument()), await i();
1679
1731
  }
1680
- function s(t) {
1681
- e.loadParsedDocument(t), e.emit("update:document", t), n();
1732
+ function l(t) {
1733
+ e.loadParsedDocument(t), e.emit("update:document", t), i();
1682
1734
  }
1683
- async function c() {
1735
+ async function u() {
1684
1736
  let t = await e.saveBlob();
1685
1737
  return t ? t.arrayBuffer() : null;
1686
1738
  }
1687
1739
  return {
1688
1740
  docxInputRef: t,
1689
- handleDocxFileChange: r,
1690
- handleDocumentNameChange: i,
1691
- downloadCurrentDocument: a,
1692
- emitReadyAfterSidebarStateRefresh: n,
1693
- loadDocumentBuffer: o,
1694
- loadDocument: s,
1695
- save: c
1741
+ imageInputRef: n,
1742
+ handleImageFileChange: r,
1743
+ handleDocxFileChange: a,
1744
+ handleDocumentNameChange: o,
1745
+ downloadCurrentDocument: s,
1746
+ emitReadyAfterSidebarStateRefresh: i,
1747
+ loadDocumentBuffer: c,
1748
+ loadDocument: l,
1749
+ save: u
1696
1750
  };
1697
1751
  }
1698
1752
  //#endregion
1699
1753
  //#region src/composables/useHyperlinkManagement.ts
1700
- function Gr(e) {
1701
- let t = z(null);
1754
+ function ti(e) {
1755
+ let t = R(null);
1702
1756
  function n(t) {
1703
1757
  let n = e.editorView.value;
1704
1758
  if (!n) return;
@@ -1726,7 +1780,7 @@ function Gr(e) {
1726
1780
  function a(n, r) {
1727
1781
  let i = e.editorView.value;
1728
1782
  if (!i) return;
1729
- let a = He(i.state);
1783
+ let a = We(i.state);
1730
1784
  if (!a) {
1731
1785
  t.value = null;
1732
1786
  return;
@@ -1740,7 +1794,7 @@ function Gr(e) {
1740
1794
  function o() {
1741
1795
  let n = e.editorView.value;
1742
1796
  if (!n) return;
1743
- let r = He(n.state, t.value?.href);
1797
+ let r = We(n.state, t.value?.href);
1744
1798
  if (!r) {
1745
1799
  t.value = null;
1746
1800
  return;
@@ -1759,28 +1813,29 @@ function Gr(e) {
1759
1813
  }
1760
1814
  //#endregion
1761
1815
  //#region src/composables/useFormattingActions.ts
1762
- function Kr(e) {
1816
+ function ni(e) {
1763
1817
  let t = () => e.activeView?.value ?? e.editorView.value;
1764
1818
  function n() {
1765
1819
  let e = t();
1766
- e && (Ve(e.state, e.dispatch, e), e.focus());
1820
+ e && (Ue(e.state, e.dispatch, e), e.focus());
1767
1821
  }
1768
1822
  function r(n) {
1769
1823
  let r = t();
1770
1824
  if (!r) return;
1771
- let i = e.getDocument()?.package?.styles;
1772
- if (i) {
1773
- let e = mt(i).resolveParagraphStyle(n);
1774
- lt(n, {
1825
+ let i = e.getDocument(), a = i?.package?.styles;
1826
+ if (a) {
1827
+ let e = wt(a).resolveParagraphStyle(n);
1828
+ yt(n, {
1775
1829
  paragraphFormatting: e.paragraphFormatting,
1776
- runFormatting: e.runFormatting
1830
+ runFormatting: e.runFormatting,
1831
+ numbering: i?.package?.numbering ? Tt(i.package.numbering) : null
1777
1832
  })(r.state, (e) => r.dispatch(e));
1778
- } else lt(n)(r.state, (e) => r.dispatch(e));
1833
+ } else yt(n)(r.state, (e) => r.dispatch(e));
1779
1834
  r.focus();
1780
1835
  }
1781
1836
  function i() {
1782
1837
  let t = e.editorView.value;
1783
- t && (ht(t.state, (e) => t.dispatch(e), t), t.focus());
1838
+ t && (Et(t.state, (e) => t.dispatch(e), t), t.focus());
1784
1839
  }
1785
1840
  function a(e) {
1786
1841
  let n = t();
@@ -1790,13 +1845,16 @@ function Kr(e) {
1790
1845
  }
1791
1846
  function o(t) {
1792
1847
  let n = e.editorView.value;
1793
- return n ? gt(n, t) : !1;
1848
+ return n ? Dt(n, t) : !1;
1794
1849
  }
1795
1850
  function s(t) {
1796
1851
  let n = e.editorView.value;
1797
1852
  if (!n) return !1;
1798
1853
  let r = e.getDocument();
1799
- return _t(n, t, { styleResolver: r?.package?.styles ? mt(r.package.styles) : null });
1854
+ return Ot(n, t, {
1855
+ styleResolver: r?.package?.styles ? wt(r.package.styles) : null,
1856
+ numbering: r?.package?.numbering ? Tt(r.package.numbering) : null
1857
+ });
1800
1858
  }
1801
1859
  return {
1802
1860
  handleClearFormatting: n,
@@ -1809,7 +1867,7 @@ function Kr(e) {
1809
1867
  }
1810
1868
  //#endregion
1811
1869
  //#region src/composables/usePageSetupControls.ts
1812
- function qr(e) {
1870
+ function ri(e) {
1813
1871
  function t(t) {
1814
1872
  let n = e.getDocument();
1815
1873
  if (!n?.package?.document) return;
@@ -1836,19 +1894,19 @@ function qr(e) {
1836
1894
  }
1837
1895
  function s(t) {
1838
1896
  let n = e.editorView.value;
1839
- n && ft(t)(n.state, n.dispatch);
1897
+ n && St(t)(n.state, n.dispatch);
1840
1898
  }
1841
1899
  function c(t) {
1842
1900
  let n = e.editorView.value;
1843
- n && pt(t)(n.state, n.dispatch);
1901
+ n && Ct(t)(n.state, n.dispatch);
1844
1902
  }
1845
1903
  function l(t) {
1846
1904
  let n = e.editorView.value;
1847
- n && (t < 0 ? dt(-t, !0)(n.state, n.dispatch) : dt(t, !1)(n.state, n.dispatch));
1905
+ n && (t < 0 ? xt(-t, !0)(n.state, n.dispatch) : xt(t, !1)(n.state, n.dispatch));
1848
1906
  }
1849
1907
  function u(t) {
1850
1908
  let n = e.editorView.value;
1851
- n && ut(t)(n.state, n.dispatch);
1909
+ n && bt(t)(n.state, n.dispatch);
1852
1910
  }
1853
1911
  return {
1854
1912
  handlePageSetupApply: t,
@@ -1864,16 +1922,16 @@ function qr(e) {
1864
1922
  }
1865
1923
  //#endregion
1866
1924
  //#region src/composables/useWatermarkControls.ts
1867
- function Jr(e) {
1868
- let t = z(!1), n = D(() => {
1925
+ function ii(e) {
1926
+ let t = R(!1), n = E(() => {
1869
1927
  e.stateTick.value;
1870
1928
  let t = e.editorView.value;
1871
- return t ? bt(t.state) ?? void 0 : void 0;
1929
+ return t ? mt(t.state) ?? void 0 : void 0;
1872
1930
  });
1873
1931
  function r(t) {
1874
1932
  if (e.readOnly.value) return;
1875
1933
  let n = e.editorView.value;
1876
- n && (wt(t)(n.state, n.dispatch), e.stateTick.value++, n.focus());
1934
+ n && (vt(t)(n.state, n.dispatch), e.stateTick.value++, n.focus());
1877
1935
  }
1878
1936
  return {
1879
1937
  showWatermark: t,
@@ -1883,11 +1941,11 @@ function Jr(e) {
1883
1941
  }
1884
1942
  //#endregion
1885
1943
  //#region src/composables/useOutlineSidebar.ts
1886
- function Yr(e) {
1944
+ function ai(e) {
1887
1945
  function t() {
1888
1946
  if (!e.showOutline.value) {
1889
1947
  let t = e.editorView.value;
1890
- t && (e.outlineHeadings.value = Tt(t.state.doc));
1948
+ t && (e.outlineHeadings.value = kt(t.state.doc));
1891
1949
  }
1892
1950
  e.showOutline.value = !e.showOutline.value;
1893
1951
  }
@@ -1913,7 +1971,7 @@ function Yr(e) {
1913
1971
  }
1914
1972
  //#endregion
1915
1973
  //#region src/composables/useKeyboardShortcuts.ts
1916
- function Xr(e) {
1974
+ function oi(e) {
1917
1975
  function t(t) {
1918
1976
  if (t.key === "F1") {
1919
1977
  t.preventDefault(), e.showKeyboardShortcuts.value = !0;
@@ -1921,26 +1979,26 @@ function Xr(e) {
1921
1979
  }
1922
1980
  e.handleZoomKeyDown(t), (t.ctrlKey || t.metaKey) && (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)));
1923
1981
  }
1924
- return L(() => window.addEventListener("keydown", t)), I(() => window.removeEventListener("keydown", t)), { handleKeyDown: t };
1982
+ return I(() => window.addEventListener("keydown", t)), F(() => window.removeEventListener("keydown", t)), { handleKeyDown: t };
1925
1983
  }
1926
1984
  //#endregion
1927
1985
  //#region src/composables/useCommentManagement.ts
1928
- function Zr(e) {
1929
- let t = () => U(e.author) ?? "User";
1986
+ function si(e) {
1987
+ let t = () => V(e.author) ?? "User";
1930
1988
  function n(t) {
1931
1989
  e.comments.value = t, e.commentCallbacks?.onCommentsChange?.(t);
1932
1990
  }
1933
1991
  function r() {
1934
- jt(e.commentIdAllocator, e.getDocument()?.package?.document?.comments, e.editorView.value);
1992
+ Ft(e.commentIdAllocator, e.getDocument()?.package?.document?.comments, e.editorView.value);
1935
1993
  }
1936
1994
  function i(t, n, i) {
1937
- return r(), Ot(e.commentIdAllocator, t, n, i);
1995
+ return r(), Mt(e.commentIdAllocator, t, n, i);
1938
1996
  }
1939
1997
  function a(t) {
1940
1998
  let i = e.getDocument(), a = e.editorView.value;
1941
1999
  if (!i?.package?.document || !a) return null;
1942
2000
  i.package.document.comments || (i.package.document.comments = []), r();
1943
- let o = Et(a, t, e.commentIdAllocator);
2001
+ let o = At(a, t, e.commentIdAllocator);
1944
2002
  return o ? (i.package.document.comments.push(o), n([...i.package.document.comments]), e.showSidebar.value = !0, e.emit("change", i), e.contentChangeSubscribers.forEach((e) => e(i)), o.id) : null;
1945
2003
  }
1946
2004
  function o(t, r, a) {
@@ -1959,7 +2017,7 @@ function Zr(e) {
1959
2017
  let n = e.editorView.value;
1960
2018
  if (!n) return !1;
1961
2019
  r();
1962
- let i = Dt(n, t, e.commentIdAllocator);
2020
+ let i = jt(n, t, e.commentIdAllocator);
1963
2021
  return i && (e.extractCommentsAndChanges(), e.showSidebar.value = !0), i;
1964
2022
  }
1965
2023
  function l(n, r) {
@@ -1986,36 +2044,26 @@ function Zr(e) {
1986
2044
  }
1987
2045
  function p(t, n) {
1988
2046
  let r = e.editorView.value;
1989
- r && (vt(t, n)(r.state, r.dispatch), e.extractCommentsAndChanges(), r.focus());
2047
+ r && (ft(t, n)(r.state, r.dispatch), e.extractCommentsAndChanges(), r.focus());
1990
2048
  }
1991
2049
  function m(t, n) {
1992
2050
  let r = e.editorView.value;
1993
- r && (St(t, n)(r.state, r.dispatch), e.extractCommentsAndChanges(), r.focus());
2051
+ r && (gt(t, n)(r.state, r.dispatch), e.extractCommentsAndChanges(), r.focus());
1994
2052
  }
1995
2053
  function h(t) {
1996
2054
  let n = e.editorView.value;
1997
- n && (yt(t)(n.state, n.dispatch), e.extractCommentsAndChanges(), n.focus());
2055
+ n && (pt(t)(n.state, n.dispatch), e.extractCommentsAndChanges(), n.focus());
1998
2056
  }
1999
2057
  function g(t) {
2000
2058
  let n = e.editorView.value;
2001
- n && (Ct(t)(n.state, n.dispatch), e.extractCommentsAndChanges(), n.focus());
2059
+ n && (_t(t)(n.state, n.dispatch), e.extractCommentsAndChanges(), n.focus());
2002
2060
  }
2003
2061
  function _(r, a) {
2004
- let o = e.getDocument(), s = e.editorView.value;
2005
- if (!o?.package?.document || !s) return;
2062
+ let o = e.getDocument();
2063
+ if (!o?.package?.document) return;
2006
2064
  o.package.document.comments || (o.package.document.comments = []);
2007
- let c = s.state.schema.marks.comment;
2008
- if (!c) return;
2009
- let l = null, u = s.state.schema.marks.insertion, d = s.state.schema.marks.deletion;
2010
- if (s.state.doc.descendants((e, t) => {
2011
- if (l !== null) return !1;
2012
- for (let n of e.marks) if ((n.type === u || n.type === d) && n.attrs.revisionId === r) return l = t, !1;
2013
- return !0;
2014
- }), l === null) return;
2015
- let f = i(a, t());
2016
- o.package.document.comments.push(f), n([...o.package.document.comments]);
2017
- let p = l, m = Math.min(p + 1, s.state.doc.content.size);
2018
- s.dispatch(s.state.tr.addMark(p, m, c.create({ commentId: f.id }))), e.emit("change", o);
2065
+ let s = i(a, t(), r);
2066
+ o.package.document.comments.push(s), n([...o.package.document.comments]), e.emit("change", o);
2019
2067
  }
2020
2068
  return {
2021
2069
  addComment: a,
@@ -2035,8 +2083,8 @@ function Zr(e) {
2035
2083
  }
2036
2084
  //#endregion
2037
2085
  //#region src/composables/useHostCallbacks.ts
2038
- function Qr(e, t) {
2039
- return K(t, (t) => t && e.onEditorViewReady?.(t), { immediate: !0 }), { commentCallbacks: {
2086
+ function ci(e, t) {
2087
+ return W(t, (t) => t && e.onEditorViewReady?.(t), { immediate: !0 }), { commentCallbacks: {
2040
2088
  onCommentAdd: (t) => e.onCommentAdd?.(t),
2041
2089
  onCommentResolve: (t) => e.onCommentResolve?.(t),
2042
2090
  onCommentDelete: (t) => e.onCommentDelete?.(t),
@@ -2046,11 +2094,11 @@ function Qr(e, t) {
2046
2094
  }
2047
2095
  //#endregion
2048
2096
  //#region src/composables/useCommentLifecycle.ts
2049
- function $r(e) {
2050
- let t = z(null), n = z(null), r = z(null), i = z(!1);
2097
+ function li(e) {
2098
+ let t = R(null), n = R(null), r = R(null), i = R(!1);
2051
2099
  function a() {
2052
2100
  let t = e.getDocument(), n = e.editorView.value;
2053
- !t || !n || (e.comments.value = [...t.package?.document?.comments ?? []], e.trackedChanges.value = Mt(n.state).entries, !i.value && (e.comments.value.length > 0 || e.trackedChanges.value.length > 0) && (e.showSidebar.value = !0, i.value = !0));
2101
+ !t || !n || (e.comments.value = [...t.package?.document?.comments ?? []], e.trackedChanges.value = It(n.state).entries, !i.value && (e.comments.value.length > 0 || e.trackedChanges.value.length > 0) && (e.showSidebar.value = !0, i.value = !0));
2054
2102
  }
2055
2103
  function o() {
2056
2104
  e.stateTick.value;
@@ -2069,7 +2117,7 @@ function $r(e) {
2069
2117
  t.value = null;
2070
2118
  return;
2071
2119
  }
2072
- let s = o.getBoundingClientRect(), c = Vt(a, r);
2120
+ let s = o.getBoundingClientRect(), c = qt(a, r);
2073
2121
  if (!c) {
2074
2122
  t.value = null;
2075
2123
  return;
@@ -2097,7 +2145,7 @@ function $r(e) {
2097
2145
  for (let t of r) {
2098
2146
  if (t.type.name === "comment" && t.attrs.commentId != null) {
2099
2147
  let n = t.attrs.commentId;
2100
- if (n === kt || e.resolvedCommentIds.value.has(n)) continue;
2148
+ if (n === Nt || e.resolvedCommentIds.value.has(n)) continue;
2101
2149
  i = `comment-${n}`;
2102
2150
  break;
2103
2151
  }
@@ -2122,7 +2170,7 @@ function $r(e) {
2122
2170
  }, r.value = t.value?.top ?? null;
2123
2171
  let s = i.state.schema.marks.comment;
2124
2172
  if (s) {
2125
- let e = i.state.tr.addMark(a, o, s.create({ commentId: kt }));
2173
+ let e = i.state.tr.addMark(a, o, s.create({ commentId: Nt }));
2126
2174
  i.dispatch(e);
2127
2175
  }
2128
2176
  e.showSidebar.value = !0, e.isAddingComment.value = !0, t.value = null;
@@ -2130,8 +2178,8 @@ function $r(e) {
2130
2178
  function l(t) {
2131
2179
  let i = e.getDocument(), a = e.editorView.value;
2132
2180
  if (!i?.package) return;
2133
- i.package.document.comments || (i.package.document.comments = []), jt(e.commentIdAllocator, i.package.document.comments, a);
2134
- let o = Ot(e.commentIdAllocator, t, U(e.author) ?? "User");
2181
+ i.package.document.comments || (i.package.document.comments = []), Ft(e.commentIdAllocator, i.package.document.comments, a);
2182
+ let o = Mt(e.commentIdAllocator, t, V(e.author) ?? "User");
2135
2183
  i.package.document.comments.push(o), e.comments.value = [...i.package.document.comments], e.commentCallbacks?.onCommentsChange?.(e.comments.value), e.commentCallbacks?.onCommentAdd?.(o);
2136
2184
  let s = n.value;
2137
2185
  if (a && s && s.from !== s.to) {
@@ -2154,15 +2202,15 @@ function $r(e) {
2154
2202
  function d(t) {
2155
2203
  e.showSidebar.value = !0;
2156
2204
  }
2157
- K([
2205
+ W([
2158
2206
  e.stateTick,
2159
2207
  e.isAddingComment,
2160
2208
  e.zoom
2161
- ], () => o()), K(e.stateTick, () => s()), K(e.stateTick, () => a());
2209
+ ], () => o()), W(e.stateTick, () => s()), W(e.stateTick, () => a());
2162
2210
  let f = null;
2163
- return L(() => {
2211
+ return I(() => {
2164
2212
  f = new ResizeObserver(() => o()), e.pagesRef.value && f.observe(e.pagesRef.value), window.addEventListener("resize", o);
2165
- }), I(() => {
2213
+ }), F(() => {
2166
2214
  f?.disconnect(), window.removeEventListener("resize", o);
2167
2215
  }), {
2168
2216
  floatingCommentBtn: t,
@@ -2180,8 +2228,8 @@ function $r(e) {
2180
2228
  }
2181
2229
  //#endregion
2182
2230
  //#region src/composables/useImageActions.ts
2183
- function ei(e) {
2184
- let t = de(null), n = z(!1), r = D(() => {
2231
+ function ui(e) {
2232
+ let t = fe(null), n = R(!1), r = E(() => {
2185
2233
  e.stateTick.value;
2186
2234
  let n = e.editorView.value, r = t.value;
2187
2235
  if (!n || !r) return null;
@@ -2192,28 +2240,15 @@ function ei(e) {
2192
2240
  cssFloat: i.attrs.cssFloat ?? null
2193
2241
  };
2194
2242
  });
2195
- function i(t) {
2196
- let n = e.editorView.value;
2197
- if (!n) return;
2198
- let r = n.state.schema.nodes.image;
2199
- if (!r) return;
2200
- let i = r.create({
2201
- src: t.src,
2202
- alt: t.alt,
2203
- width: t.width,
2204
- height: t.height
2205
- });
2206
- xt(n.state, n.dispatch, i, n.state.selection.from), n.focus();
2207
- }
2208
- function a(n) {
2243
+ function i(n) {
2209
2244
  let r = e.editorView.value, i = t.value;
2210
2245
  if (!r || !i) return;
2211
- let a = rt(n);
2246
+ let a = ot(n);
2212
2247
  if (!a) return;
2213
- let o = r.state.doc.nodeAt(i.pmPos), s = e.getCommands(), c = o?.attrs.wrapType === "inline" && a !== "inline" ? { initialPositionEmu: Qe(i.element, e.zoom.value) } : void 0, l = s.setImageWrapType?.(i.pmPos, a, c);
2248
+ let o = r.state.doc.nodeAt(i.pmPos), s = e.getCommands(), c = o?.attrs.wrapType === "inline" && a !== "inline" ? { initialPositionEmu: tt(i.element, e.zoom.value) } : void 0, l = s.setImageWrapType?.(i.pmPos, a, c);
2214
2249
  l && (l(r.state, (e) => r.dispatch(e), r), r.focus());
2215
2250
  }
2216
- function o(n) {
2251
+ function a(n) {
2217
2252
  let r = e.editorView.value, i = t.value;
2218
2253
  if (!r || !i) return;
2219
2254
  let a = r.state.doc.nodeAt(i.pmPos);
@@ -2232,15 +2267,14 @@ function ei(e) {
2232
2267
  selectedImage: t,
2233
2268
  imageInteracting: n,
2234
2269
  imageToolbarContext: r,
2235
- handleInsertImage: i,
2236
- handleToolbarImageWrap: a,
2237
- handleImageTransform: o
2270
+ handleToolbarImageWrap: i,
2271
+ handleImageTransform: a
2238
2272
  };
2239
2273
  }
2240
2274
  //#endregion
2241
2275
  //#region src/utils/imageClipboard.ts
2242
- function ti(e, t, n) {
2243
- let r = st(e.state), i = e.state.schema.marks.insertion;
2276
+ function di(e, t, n) {
2277
+ let r = ut(e.state), i = e.state.schema.marks.insertion;
2244
2278
  if (!r || !i) return;
2245
2279
  let a = t.selection.from, o = a - n.nodeSize;
2246
2280
  o < 0 || t.addMark(o, a, i.create({
@@ -2249,10 +2283,10 @@ function ti(e, t, n) {
2249
2283
  date: r.date
2250
2284
  }));
2251
2285
  }
2252
- function ni(e, t) {
2286
+ function fi(e, t) {
2253
2287
  return e.getBlob(t);
2254
2288
  }
2255
- function ri(e, t) {
2289
+ function pi(e, t) {
2256
2290
  let n = e.state.doc.nodeAt(t);
2257
2291
  if (!n || n.type.name !== "image") return;
2258
2292
  let r = `<img src="${n.attrs.src}" data-pm-image="true" data-width="${n.attrs.width ?? ""}" data-height="${n.attrs.height ?? ""}" data-wrap-type="${n.attrs.wrapType ?? ""}" data-display-mode="${n.attrs.displayMode ?? ""}" data-rid="${n.attrs.rId ?? ""}" />`, i = new ClipboardItem({
@@ -2264,13 +2298,13 @@ function ri(e, t) {
2264
2298
  e.value = r, document.body.appendChild(e), e.select(), document.execCommand("copy"), document.body.removeChild(e);
2265
2299
  });
2266
2300
  }
2267
- function ii(e) {
2301
+ function mi(e) {
2268
2302
  return new Promise((t, n) => {
2269
2303
  let r = new FileReader();
2270
2304
  r.onload = () => t(r.result), r.onerror = n, r.readAsDataURL(e);
2271
2305
  });
2272
2306
  }
2273
- function ai(e) {
2307
+ function hi(e) {
2274
2308
  return new Promise((t) => {
2275
2309
  let n = new Image();
2276
2310
  n.onload = () => t({
@@ -2282,13 +2316,13 @@ function ai(e) {
2282
2316
  }), n.src = e;
2283
2317
  });
2284
2318
  }
2285
- async function oi(e) {
2319
+ async function gi(e) {
2286
2320
  try {
2287
2321
  let t = await navigator.clipboard.read();
2288
2322
  for (let n of t) {
2289
2323
  let t = n.types.find((e) => e.startsWith("image/"));
2290
2324
  if (t) {
2291
- let r = await ii(await ni(n, t)), i = await ai(r), a = i.width, o = i.height;
2325
+ let r = await mi(await fi(n, t)), i = await hi(r), a = i.width, o = i.height;
2292
2326
  a > 612 && (o = Math.round(612 / a * o), a = 612);
2293
2327
  let s = e.state.schema.nodes.image.create({
2294
2328
  src: r,
@@ -2298,11 +2332,11 @@ async function oi(e) {
2298
2332
  wrapType: "inline",
2299
2333
  displayMode: "inline"
2300
2334
  }), c = e.state.tr.replaceSelectionWith(s);
2301
- ti(e, c, s), e.dispatch(c);
2335
+ di(e, c, s), e.dispatch(c);
2302
2336
  return;
2303
2337
  }
2304
2338
  if (n.types.includes("text/html")) {
2305
- let t = await (await ni(n, "text/html")).text(), r = t.match(/<img[^>]+src="([^"]+)"[^>]*>/i);
2339
+ let t = await (await fi(n, "text/html")).text(), r = t.match(/<img[^>]+src="([^"]+)"[^>]*>/i);
2306
2340
  if (r && r[1]) {
2307
2341
  let n = r[1], i = t.match(/data-width="(\d+)"/), a = t.match(/data-height="(\d+)"/), o = i ? Number(i[1]) : 200, s = a ? Number(a[1]) : 200, c = e.state.schema.nodes.image.create({
2308
2342
  src: n,
@@ -2312,12 +2346,12 @@ async function oi(e) {
2312
2346
  wrapType: "inline",
2313
2347
  displayMode: "inline"
2314
2348
  }), l = e.state.tr.replaceSelectionWith(c);
2315
- ti(e, l, c), e.dispatch(l);
2349
+ di(e, l, c), e.dispatch(l);
2316
2350
  return;
2317
2351
  }
2318
2352
  }
2319
2353
  if (n.types.includes("text/plain")) {
2320
- let t = await (await ni(n, "text/plain")).text();
2354
+ let t = await (await fi(n, "text/plain")).text();
2321
2355
  if (t && t !== "[image]") {
2322
2356
  let { from: n } = e.state.selection;
2323
2357
  e.dispatch(e.state.tr.insertText(t, n));
@@ -2333,14 +2367,14 @@ async function oi(e) {
2333
2367
  }
2334
2368
  }
2335
2369
  }
2336
- function si(e, t) {
2370
+ function _i(e, t) {
2337
2371
  let n = e.state.doc.nodeAt(t);
2338
2372
  if (!n || n.type.name !== "image") return;
2339
2373
  let r = document.createElement("input");
2340
2374
  r.type = "file", r.accept = "image/*", r.onchange = async () => {
2341
2375
  let i = r.files?.[0];
2342
2376
  if (!i) return;
2343
- let a = await ii(i), o = await ai(a), s = n.attrs.width || o.width, c = n.attrs.height || o.height, l = Math.min(s / o.width, c / o.height), u = Math.round(o.width * l), d = Math.round(o.height * l);
2377
+ let a = await mi(i), o = await hi(a), s = n.attrs.width || o.width, c = n.attrs.height || o.height, l = Math.min(s / o.width, c / o.height), u = Math.round(o.width * l), d = Math.round(o.height * l);
2344
2378
  try {
2345
2379
  let r = e.state.tr.setNodeMarkup(t, void 0, {
2346
2380
  ...n.attrs,
@@ -2355,8 +2389,8 @@ function si(e, t) {
2355
2389
  }
2356
2390
  //#endregion
2357
2391
  //#region src/composables/useContextMenus.ts
2358
- function ci(e) {
2359
- let { t } = n(), r = z({
2392
+ function vi(e) {
2393
+ let { t } = d(), n = R({
2360
2394
  isOpen: !1,
2361
2395
  position: {
2362
2396
  x: 0,
@@ -2367,7 +2401,7 @@ function ci(e) {
2367
2401
  onImage: !1,
2368
2402
  canMergeCells: !1,
2369
2403
  canSplitCell: !1
2370
- }), i = z(null), a = D(() => [
2404
+ }), r = R(null), i = E(() => [
2371
2405
  {
2372
2406
  action: "cut",
2373
2407
  label: t("contextMenu.cut"),
@@ -2390,16 +2424,16 @@ function ci(e) {
2390
2424
  shortcut: t("contextMenu.deleteShortcut")
2391
2425
  }
2392
2426
  ]);
2393
- function o(t) {
2394
- let n = e.editorView.value;
2395
- if (!n) return;
2396
- let a = t.target, o = et(a);
2427
+ function a(t) {
2428
+ let i = e.editorView.value;
2429
+ if (!i) return;
2430
+ let a = t.target, o = rt(a);
2397
2431
  if (o) {
2398
2432
  let a = Number(o.dataset.pmStart);
2399
2433
  if (!isNaN(a)) {
2400
2434
  try {
2401
- let e = Y.create(n.state.doc, a);
2402
- n.dispatch(n.state.tr.setSelection(e));
2435
+ let e = J.create(i.state.doc, a);
2436
+ i.dispatch(i.state.tr.setSelection(e));
2403
2437
  } catch {}
2404
2438
  e.selectedImage.value = {
2405
2439
  element: o,
@@ -2407,32 +2441,32 @@ function ci(e) {
2407
2441
  width: o.offsetWidth,
2408
2442
  height: o.offsetHeight
2409
2443
  }, e.clearOverlay();
2410
- let s = n.state.doc.nodeAt(a);
2444
+ let s = i.state.doc.nodeAt(a);
2411
2445
  if (s && s.type.name === "image") {
2412
- let n = s.attrs.wrapType ?? "inline", c = s.attrs.cssFloat;
2413
- i.value = {
2446
+ let i = s.attrs.wrapType ?? "inline", c = s.attrs.cssFloat;
2447
+ r.value = {
2414
2448
  open: !0,
2415
2449
  position: {
2416
2450
  x: t.clientX,
2417
2451
  y: t.clientY
2418
2452
  },
2419
2453
  pmPos: a,
2420
- currentWrapType: n,
2454
+ currentWrapType: i,
2421
2455
  currentCssFloat: c ?? null,
2422
- inlinePositionEmu: n === "inline" ? Qe(o, e.zoom.value) : void 0
2423
- }, r.value.isOpen = !1;
2456
+ inlinePositionEmu: i === "inline" ? tt(o, e.zoom.value) : void 0
2457
+ }, n.value.isOpen = !1;
2424
2458
  return;
2425
2459
  }
2426
2460
  }
2427
2461
  }
2428
2462
  {
2429
- let { from: r, to: i } = n.state.selection, a = e.resolvePos(t.clientX, t.clientY);
2430
- if (a !== null && (a < r || a > i)) try {
2463
+ let { from: n, to: r } = i.state.selection, a = e.resolvePos(t.clientX, t.clientY);
2464
+ if (a !== null && (a < n || a > r)) try {
2431
2465
  e.setPmSelection(a);
2432
2466
  } catch {}
2433
2467
  }
2434
- let s = Q(n.state), { empty: c } = n.state.selection;
2435
- i.value &&= null, r.value = {
2468
+ let s = Ge(i.state), { empty: c } = i.state.selection;
2469
+ r.value &&= null, n.value = {
2436
2470
  isOpen: !0,
2437
2471
  position: {
2438
2472
  x: t.clientX,
@@ -2445,13 +2479,13 @@ function ci(e) {
2445
2479
  canSplitCell: !!s.canSplitCell
2446
2480
  };
2447
2481
  }
2448
- function s(t) {
2449
- let n = e.editorView.value, a = e.selectedImage.value;
2450
- if (!n || !a) return;
2451
- let o = n.state.doc.nodeAt(a.pmPos);
2482
+ function o(t) {
2483
+ let i = e.editorView.value, a = e.selectedImage.value;
2484
+ if (!i || !a) return;
2485
+ let o = i.state.doc.nodeAt(a.pmPos);
2452
2486
  if (!o || o.type.name !== "image") return;
2453
2487
  let s = o.attrs.wrapType ?? "inline", c = o.attrs.cssFloat;
2454
- i.value = {
2488
+ r.value = {
2455
2489
  open: !0,
2456
2490
  position: {
2457
2491
  x: t.clientX,
@@ -2460,32 +2494,32 @@ function ci(e) {
2460
2494
  pmPos: a.pmPos,
2461
2495
  currentWrapType: s,
2462
2496
  currentCssFloat: c ?? null,
2463
- inlinePositionEmu: s === "inline" ? Qe(a.element, e.zoom.value) : void 0
2464
- }, r.value.isOpen = !1;
2497
+ inlinePositionEmu: s === "inline" ? tt(a.element, e.zoom.value) : void 0
2498
+ }, n.value.isOpen = !1;
2465
2499
  }
2466
- function c(t) {
2467
- let n = e.editorView.value, r = i.value;
2468
- if (!n || !r) return;
2469
- let a = e.getCommands(), o = r.inlinePositionEmu && t !== "inline" ? { initialPositionEmu: r.inlinePositionEmu } : void 0, s = a.setImageWrapType?.(r.pmPos, t, o);
2500
+ function s(t) {
2501
+ let n = e.editorView.value, i = r.value;
2502
+ if (!n || !i) return;
2503
+ let a = e.getCommands(), o = i.inlinePositionEmu && t !== "inline" ? { initialPositionEmu: i.inlinePositionEmu } : void 0, s = a.setImageWrapType?.(i.pmPos, t, o);
2470
2504
  s && (s(n.state, (e) => n.dispatch(e), n), n.focus());
2471
2505
  }
2472
- function l(t) {
2506
+ function c(t) {
2473
2507
  let n = e.editorView.value;
2474
2508
  if (!n) return;
2475
2509
  let r = e.getCommands();
2476
2510
  switch (t) {
2477
2511
  case "cut":
2478
2512
  if (e.selectedImage.value) {
2479
- ri(n, e.selectedImage.value.pmPos);
2513
+ pi(n, e.selectedImage.value.pmPos);
2480
2514
  let t = e.selectedImage.value.pmPos, r = n.state.doc.nodeAt(t);
2481
2515
  r && (n.dispatch(n.state.tr.delete(t, t + r.nodeSize)), e.selectedImage.value = null);
2482
2516
  } else document.execCommand("cut");
2483
2517
  break;
2484
2518
  case "copy":
2485
- e.selectedImage.value ? ri(n, e.selectedImage.value.pmPos) : document.execCommand("copy");
2519
+ e.selectedImage.value ? pi(n, e.selectedImage.value.pmPos) : document.execCommand("copy");
2486
2520
  break;
2487
2521
  case "paste":
2488
- oi(n);
2522
+ gi(n);
2489
2523
  break;
2490
2524
  case "pasteAsPlainText":
2491
2525
  navigator.clipboard.readText().then((e) => {
@@ -2506,7 +2540,7 @@ function ci(e) {
2506
2540
  e.selectedImage.value && (e.showImageProperties.value = !0);
2507
2541
  break;
2508
2542
  case "replaceImage":
2509
- e.selectedImage.value && si(n, e.selectedImage.value.pmPos);
2543
+ e.selectedImage.value && _i(n, e.selectedImage.value.pmPos);
2510
2544
  break;
2511
2545
  case "deleteImage":
2512
2546
  if (e.selectedImage.value) {
@@ -2530,39 +2564,39 @@ function ci(e) {
2530
2564
  n.focus();
2531
2565
  }
2532
2566
  return {
2533
- contextMenu: r,
2534
- imageContextMenu: i,
2535
- imageContextMenuTextActions: a,
2536
- handleContextMenu: o,
2537
- handleSelectedImageContextMenu: s,
2538
- handleImageWrapSelect: c,
2539
- handleContextMenuAction: l
2567
+ contextMenu: n,
2568
+ imageContextMenu: r,
2569
+ imageContextMenuTextActions: i,
2570
+ handleContextMenu: a,
2571
+ handleSelectedImageContextMenu: o,
2572
+ handleImageWrapSelect: s,
2573
+ handleContextMenuAction: c
2540
2574
  };
2541
2575
  }
2542
2576
  //#endregion
2543
2577
  //#region src/composables/usePagesPointer.ts
2544
- var li = 500;
2545
- function ui(e) {
2546
- let t = z(null), n = null;
2578
+ var yi = 500;
2579
+ function bi(e) {
2580
+ let t = R(null), n = null;
2547
2581
  function r() {
2548
2582
  n !== null && (clearTimeout(n), n = null);
2549
2583
  }
2550
- let i = de(null), a = 0, o = null, s = 0, c = !1, l = null, u = w({
2584
+ let i = fe(null), a = 0, o = null, s = 0, c = !1, l = null, u = zt(), d = ne({
2551
2585
  pagesContainer: e.pagesRef,
2552
2586
  onScrollExtendSelection: (e, t) => {
2553
2587
  if (!c || l === null) return;
2554
- let n = p(e, t);
2555
- n !== null && n !== l && h(l, n);
2588
+ let n = m(e, t);
2589
+ n !== null && n !== l && g(l, n);
2556
2590
  }
2557
- }), d = z({
2591
+ }), f = R({
2558
2592
  currentPage: 1,
2559
2593
  totalPages: 1,
2560
2594
  visible: !1
2561
- }), f = null;
2562
- function p(t, n) {
2563
- return Ut(e.pagesRef.value, e.editorView.value, t, n);
2595
+ }), p = null;
2596
+ function m(t, n) {
2597
+ return Yt(e.pagesRef.value, e.editorView.value, t, n);
2564
2598
  }
2565
- function m() {
2599
+ function h() {
2566
2600
  let t = i.value;
2567
2601
  if (t?.headerFooter && e.getHfPmView) {
2568
2602
  let n = e.getHfPmView(t.headerFooter);
@@ -2570,42 +2604,42 @@ function ui(e) {
2570
2604
  }
2571
2605
  return e.editorView.value;
2572
2606
  }
2573
- function h(e, t) {
2574
- let n = m();
2607
+ function g(e, t) {
2608
+ let n = h();
2575
2609
  if (n) try {
2576
2610
  let r = n.state.doc.resolve(e), i = t === void 0 ? r : n.state.doc.resolve(t), a = he.between(r, i);
2577
2611
  n.dispatch(n.state.tr.setSelection(a));
2578
2612
  } catch {}
2579
2613
  }
2580
- function g(t) {
2581
- Ht(e.pagesRef.value, e.pagesViewportRef.value, t);
2582
- }
2583
2614
  function _(t) {
2584
- Wt(e.pagesRef.value, t, h, i.value?.position);
2615
+ Jt(e.pagesRef.value, e.pagesViewportRef.value, t);
2585
2616
  }
2586
2617
  function v(t) {
2587
- Gt(e.pagesRef.value, t, h, i.value?.position);
2618
+ Xt(e.pagesRef.value, t, g, i.value?.position);
2588
2619
  }
2589
2620
  function y(t) {
2621
+ Zt(e.pagesRef.value, t, g, i.value?.position);
2622
+ }
2623
+ function b(t) {
2590
2624
  let n = e.editorView.value;
2591
2625
  if (!n) return;
2592
2626
  let r = null;
2593
2627
  if (n.state.doc.descendants((e, n) => r === null ? (e.attrs?.bookmarks)?.some((e) => e.name === t) ? (r = n, !1) : !0 : !1), r !== null) {
2594
- g(r);
2628
+ _(r);
2595
2629
  try {
2596
- h(Math.min(r + 1, n.state.doc.content.size));
2630
+ g(Math.min(r + 1, n.state.doc.content.size));
2597
2631
  } catch {
2598
- h(r);
2632
+ g(r);
2599
2633
  }
2600
2634
  }
2601
2635
  }
2602
- function b(a) {
2636
+ function x(a) {
2603
2637
  if (e.readOnly.value || c) return;
2604
2638
  let o = e.pagesRef.value;
2605
2639
  if (!o) return;
2606
2640
  let s = e.pagesViewportRef.value;
2607
2641
  if (!s) return;
2608
- let l = Pt({
2642
+ let l = Rt({
2609
2643
  mouseX: a.clientX,
2610
2644
  mouseY: a.clientY,
2611
2645
  pagesContainer: o,
@@ -2615,7 +2649,7 @@ function ui(e) {
2615
2649
  if (!l) {
2616
2650
  n === null && (n = setTimeout(() => {
2617
2651
  t.value = null, n = null;
2618
- }, Nt));
2652
+ }, Lt));
2619
2653
  return;
2620
2654
  }
2621
2655
  let u = s.getBoundingClientRect();
@@ -2626,7 +2660,7 @@ function ui(e) {
2626
2660
  cellPmPos: l.cellPmPos
2627
2661
  }, r();
2628
2662
  }
2629
- function x(n) {
2663
+ function S(n) {
2630
2664
  n.preventDefault(), n.stopPropagation();
2631
2665
  let r = t.value, i = e.editorView.value;
2632
2666
  if (!r || !i) return;
@@ -2635,17 +2669,17 @@ function ui(e) {
2635
2669
  let o = e.getCommands(), s = r.type === "row" ? o.addRowBelow?.() : o.addColumnRight?.();
2636
2670
  s && (s(i.state, (e) => i.dispatch(e), i), t.value = null, i.focus());
2637
2671
  }
2638
- function S(t) {
2672
+ function C(t) {
2639
2673
  let n = t.target?.closest("a[href]");
2640
2674
  if (!n) return;
2641
2675
  t.preventDefault();
2642
2676
  let r = n.getAttribute("href") || "";
2643
2677
  if (r.startsWith("#")) {
2644
2678
  let e = r.slice(1);
2645
- e && y(e);
2679
+ e && b(e);
2646
2680
  return;
2647
2681
  }
2648
- let i = m();
2682
+ let i = h();
2649
2683
  if (i && i.state.selection.from !== i.state.selection.to) return;
2650
2684
  let a = e.pagesViewportRef.value;
2651
2685
  if (!a) return;
@@ -2660,7 +2694,7 @@ function ui(e) {
2660
2694
  }
2661
2695
  };
2662
2696
  }
2663
- function C(t) {
2697
+ function ee(t) {
2664
2698
  let n = t.target, r = n.closest(".layout-page-header"), a = n.closest(".layout-page-footer"), o = r ?? a;
2665
2699
  if (!o) return;
2666
2700
  let s = r ? "header" : "footer", c = e.getDocument();
@@ -2726,7 +2760,7 @@ function ui(e) {
2726
2760
  }
2727
2761
  };
2728
2762
  }
2729
- function ee(t) {
2763
+ function te(t) {
2730
2764
  let n = e.getDocument(), r = i.value;
2731
2765
  if (!n?.package || !r) return;
2732
2766
  let a = r.position === "header" ? n.package.headers : n.package.footers;
@@ -2734,7 +2768,7 @@ function ui(e) {
2734
2768
  let o = a.get(r.rId);
2735
2769
  o && (o.content = t), e.syncHfPMs?.(), e.reLayout(), e.emit("change", n);
2736
2770
  }
2737
- function te() {
2771
+ function w() {
2738
2772
  let t = e.getDocument(), n = i.value;
2739
2773
  if (!t?.package || !n || !n.rId) {
2740
2774
  i.value = null;
@@ -2766,59 +2800,67 @@ function ui(e) {
2766
2800
  };
2767
2801
  i.value = null, e.setDocument?.(d), e.syncHfPMs?.(), e.reLayout(), e.emit("change", d);
2768
2802
  }
2769
- function ne(t) {
2803
+ function T(t) {
2770
2804
  if (t.button !== 0 || e.imageInteracting.value) return;
2771
2805
  let n = e.editorView.value;
2772
2806
  if (!n) return;
2773
2807
  let r = t.target;
2774
2808
  i.value && (r.closest(".layout-page-header") || r.closest(".layout-page-footer") || r.closest(".hf-editor") || (i.value = null, n.focus()));
2775
- let u = m() ?? n;
2776
- if (!e.readOnly.value && e.tableResize.tryStartResize(t, u)) return;
2777
- let d = et(r);
2778
- if (d) {
2809
+ let d = h() ?? n;
2810
+ if (!e.readOnly.value && e.tableResize.tryStartResize(t, d)) return;
2811
+ let f = rt(r);
2812
+ if (f) {
2779
2813
  t.preventDefault(), t.stopPropagation();
2780
- let n = Number(d.dataset.pmStart);
2814
+ let n = Number(f.dataset.pmStart);
2781
2815
  if (!isNaN(n)) {
2782
2816
  try {
2783
- u.dispatch(u.state.tr.setSelection(Y.create(u.state.doc, n)));
2817
+ d.dispatch(d.state.tr.setSelection(J.create(d.state.doc, n)));
2784
2818
  } catch {}
2785
2819
  e.selectedImage.value = {
2786
- element: d,
2820
+ element: f,
2787
2821
  pmPos: n,
2788
- width: d.offsetWidth,
2789
- height: d.offsetHeight
2822
+ width: f.offsetWidth,
2823
+ height: f.offsetHeight
2790
2824
  }, e.clearOverlay();
2791
2825
  }
2792
- u.focus();
2826
+ d.focus();
2793
2827
  return;
2794
2828
  }
2795
2829
  e.selectedImage.value = null, t.preventDefault();
2796
- let f = p(t.clientX, t.clientY);
2797
- if (f === null) {
2798
- u.focus();
2830
+ let p = m(t.clientX, t.clientY);
2831
+ if (p === null) {
2832
+ d.focus();
2799
2833
  return;
2800
2834
  }
2801
- let g = Date.now();
2802
- if (g - a < li && o === f ? s++ : s = 1, a = g, o = f, s === 2) _(f);
2803
- else if (s >= 3) v(f), s = 0;
2835
+ let _ = Date.now();
2836
+ if (_ - a < yi && o === p ? s++ : s = 1, a = _, o = p, s === 2) v(p);
2837
+ else if (s >= 3) y(p), s = 0;
2804
2838
  else {
2805
2839
  if (t.shiftKey) {
2806
- let { from: e } = u.state.selection;
2807
- h(e, f);
2808
- } else h(f);
2809
- l = f, c = !0;
2840
+ let { from: e } = d.state.selection;
2841
+ g(e, p);
2842
+ } else g(p);
2843
+ l = p, c = !0, u.begin(Bt(d, p));
2810
2844
  }
2811
- u.focus();
2845
+ d.focus();
2812
2846
  }
2813
- function T(e) {
2847
+ function E(e) {
2814
2848
  if (!c || l === null) return;
2815
- let t = p(e.clientX, e.clientY);
2816
- t !== null && t !== l && h(l, t), u.updateMousePosition(e.clientX, e.clientY);
2817
- }
2818
- function E() {
2819
- c = !1, u.stopAutoScroll();
2849
+ let t = m(e.clientX, e.clientY);
2850
+ if (t !== null) {
2851
+ let n = h();
2852
+ if (n && u.update(n, t, e.clientX)) {
2853
+ d.updateMousePosition(e.clientX, e.clientY);
2854
+ return;
2855
+ }
2856
+ t !== l && g(l, t);
2857
+ }
2858
+ d.updateMousePosition(e.clientX, e.clientY);
2820
2859
  }
2821
2860
  function D() {
2861
+ c = !1, u.end(), d.stopAutoScroll();
2862
+ }
2863
+ function O() {
2822
2864
  let t = e.pagesViewportRef.value, n = e.layout.value;
2823
2865
  if (!t || !n || n.pages.length === 0) return;
2824
2866
  let r = t.scrollTop, i = n.pages.length, a = r + t.clientHeight / 2, o = 24, s = 1;
@@ -2830,42 +2872,42 @@ function ui(e) {
2830
2872
  }
2831
2873
  o = r + 24, s = e + 2;
2832
2874
  }
2833
- s = Math.min(s, i), d.value = {
2875
+ s = Math.min(s, i), f.value = {
2834
2876
  currentPage: s,
2835
2877
  totalPages: i,
2836
2878
  visible: !0
2837
- }, f && clearTimeout(f), f = setTimeout(() => {
2838
- d.value = {
2839
- ...d.value,
2879
+ }, p && clearTimeout(p), p = setTimeout(() => {
2880
+ f.value = {
2881
+ ...f.value,
2840
2882
  visible: !1
2841
2883
  };
2842
2884
  }, 600);
2843
2885
  }
2844
- return L(() => {
2845
- window.addEventListener("mousemove", T), window.addEventListener("mouseup", E), e.pagesViewportRef.value?.addEventListener("scroll", D, { passive: !0 });
2846
- }), I(() => {
2847
- r(), window.removeEventListener("mousemove", T), window.removeEventListener("mouseup", E), e.pagesViewportRef.value?.removeEventListener("scroll", D), f && clearTimeout(f);
2886
+ return I(() => {
2887
+ window.addEventListener("mousemove", E), window.addEventListener("mouseup", D), e.pagesViewportRef.value?.addEventListener("scroll", O, { passive: !0 });
2888
+ }), F(() => {
2889
+ r(), window.removeEventListener("mousemove", E), window.removeEventListener("mouseup", D), e.pagesViewportRef.value?.removeEventListener("scroll", O), p && clearTimeout(p);
2848
2890
  }), {
2849
2891
  tableInsertButton: t,
2850
2892
  hfEdit: i,
2851
- scrollPageInfo: d,
2852
- resolvePos: p,
2853
- setPmSelection: h,
2854
- scrollVisiblePositionIntoView: g,
2855
- navigateToBookmark: y,
2856
- handlePagesMouseDown: ne,
2857
- handlePagesMouseMove: b,
2858
- handlePagesClick: S,
2859
- handlePagesDoubleClick: C,
2860
- handleTableInsertClick: x,
2893
+ scrollPageInfo: f,
2894
+ resolvePos: m,
2895
+ setPmSelection: g,
2896
+ scrollVisiblePositionIntoView: _,
2897
+ navigateToBookmark: b,
2898
+ handlePagesMouseDown: T,
2899
+ handlePagesMouseMove: x,
2900
+ handlePagesClick: C,
2901
+ handlePagesDoubleClick: ee,
2902
+ handleTableInsertClick: S,
2861
2903
  clearTableInsertTimer: r,
2862
- handleHfSave: ee,
2863
- handleHfRemove: te
2904
+ handleHfSave: te,
2905
+ handleHfRemove: w
2864
2906
  };
2865
2907
  }
2866
2908
  //#endregion
2867
2909
  //#region src/composables/useSelectionSync.ts
2868
- function di(e) {
2910
+ function xi(e) {
2869
2911
  let t = null, n = null, r = null;
2870
2912
  function i() {
2871
2913
  let r = e.pagesRef.value;
@@ -2877,8 +2919,8 @@ function di(e) {
2877
2919
  let t = e.pagesRef.value, n = e.editorView.value;
2878
2920
  if (!t || !n || e.isHfEditing?.value) return;
2879
2921
  let i = n.state.selection;
2880
- if (i instanceof Y && i.node.type.name === "image") {
2881
- let n = X(t, i.from), r = n ? et(n) : null;
2922
+ if (i instanceof J && i.node.type.name === "image") {
2923
+ let n = X(t, i.from), r = n ? rt(n) : null;
2882
2924
  if (r) {
2883
2925
  let t = e.selectedImage.value;
2884
2926
  (!t || t.element !== r || t.pmPos !== i.from || t.width !== r.offsetWidth || t.height !== r.offsetHeight) && (e.selectedImage.value = {
@@ -2896,12 +2938,12 @@ function di(e) {
2896
2938
  function o() {
2897
2939
  let r = e.pagesRef.value, o = e.editorView.value;
2898
2940
  if (!r || !o || (i(), e.isHfEditing?.value)) return;
2899
- a(), ge(r, o.state);
2941
+ a(), Y(r, o.state);
2900
2942
  let s = o.state.selection;
2901
- if (s instanceof Y && s.node.type.name === "image") return;
2943
+ if (s instanceof J && s.node.type.name === "image") return;
2902
2944
  let { from: c, to: l, empty: u } = s, d = r.scrollTop, f = r.scrollLeft, p = e.zoom.value || 1;
2903
2945
  if (u) {
2904
- let e = We(r, c, r.getBoundingClientRect());
2946
+ let e = qe(r, c, r.getBoundingClientRect());
2905
2947
  if (e) {
2906
2948
  let i = document.createElement("div");
2907
2949
  i.className = "vue-caret", i.style.cssText = `
@@ -2912,7 +2954,7 @@ function di(e) {
2912
2954
  height: ${e.height}px;
2913
2955
  background: #000;
2914
2956
  pointer-events: none;
2915
- z-index: ${C.selectionOverlay};
2957
+ z-index: ${S.selectionOverlay};
2916
2958
  `, r.appendChild(i), n = i;
2917
2959
  let a = !0;
2918
2960
  t = setInterval(() => {
@@ -2921,7 +2963,7 @@ function di(e) {
2921
2963
  }
2922
2964
  return;
2923
2965
  }
2924
- let m = Ge(r, c, l, r.getBoundingClientRect());
2966
+ let m = Je(r, c, l, r.getBoundingClientRect());
2925
2967
  for (let e of m) {
2926
2968
  let t = document.createElement("div");
2927
2969
  t.className = "vue-sel-rect", t.style.cssText = `
@@ -2932,11 +2974,11 @@ function di(e) {
2932
2974
  height: ${e.height / p}px;
2933
2975
  background: rgba(66, 133, 244, 0.3);
2934
2976
  pointer-events: none;
2935
- z-index: ${C.selectionOverlay};
2977
+ z-index: ${S.selectionOverlay};
2936
2978
  `, r.appendChild(t);
2937
2979
  }
2938
2980
  }
2939
- return I(() => {
2981
+ return F(() => {
2940
2982
  r !== null && cancelAnimationFrame(r), i();
2941
2983
  }), {
2942
2984
  clearOverlay: i,
@@ -2945,7 +2987,7 @@ function di(e) {
2945
2987
  }
2946
2988
  //#endregion
2947
2989
  //#region src/composables/useMenuActions.ts
2948
- function fi(e) {
2990
+ function Si(e) {
2949
2991
  function t(t) {
2950
2992
  let n = e.editorView.value;
2951
2993
  if (!n) return;
@@ -2976,7 +3018,7 @@ function fi(e) {
2976
3018
  e.handleClearFormatting();
2977
3019
  break;
2978
3020
  case "insertImage":
2979
- e.showInsertImage.value = !0;
3021
+ e.imageInputRef.value?.click();
2980
3022
  break;
2981
3023
  case "insertLink":
2982
3024
  e.showHyperlink.value = !0;
@@ -3000,7 +3042,7 @@ function fi(e) {
3000
3042
  e.showKeyboardShortcuts.value = !0;
3001
3043
  break;
3002
3044
  case "reportIssue":
3003
- Ft();
3045
+ Vt();
3004
3046
  break;
3005
3047
  case "dirLTR":
3006
3048
  t("setLtr");
@@ -3018,29 +3060,29 @@ function fi(e) {
3018
3060
  }
3019
3061
  //#endregion
3020
3062
  //#region src/composables/useDocumentLifecycle.ts
3021
- function pi(e) {
3063
+ function Ci(e) {
3022
3064
  async function t(t) {
3023
3065
  e.sidebarAutoOpenedRef.value = !1, await e.loadDocumentBuffer(t);
3024
3066
  }
3025
3067
  function n(t) {
3026
3068
  e.sidebarAutoOpenedRef.value = !1, e.loadDocument(t);
3027
3069
  }
3028
- K(e.documentBuffer, (e) => {
3070
+ W(e.documentBuffer, (e) => {
3029
3071
  e && t(e);
3030
- }), K(e.document, (e) => {
3072
+ }), W(e.document, (e) => {
3031
3073
  e && n(e);
3032
- }), L(async () => {
3033
- await le();
3074
+ }), I(async () => {
3075
+ await ce();
3034
3076
  let r = e.documentBuffer(), i = e.document();
3035
3077
  r ? await t(r) : i && n(i);
3036
3078
  });
3037
3079
  }
3038
3080
  //#endregion
3039
3081
  //#region src/composables/useDocxEditorRefApi.ts
3040
- function mi(e) {
3082
+ function wi(e) {
3041
3083
  function t() {
3042
3084
  let t = e.pagesRef.value;
3043
- t && nt(t), e.onPrint?.(), window.print();
3085
+ t && at(t), e.onPrint?.(), window.print();
3044
3086
  }
3045
3087
  function n() {
3046
3088
  t();
@@ -3074,71 +3116,93 @@ function mi(e) {
3074
3116
  function c() {
3075
3117
  let t = e.layout.value, n = e.editorView.value;
3076
3118
  if (!t || !n) return 0;
3077
- let r = ct(t, n.state.selection.from);
3119
+ let r = dt(t, n.state.selection.from);
3078
3120
  return r == null ? 0 : r + 1;
3079
3121
  }
3080
3122
  function l(t) {
3081
3123
  let n = e.editorView.value;
3082
3124
  if (!n) return !1;
3083
- let r = Lt(n.state.doc, t);
3125
+ let r = Ut(n.state.doc, t);
3084
3126
  return r ? (e.scrollVisiblePositionIntoView(r.from + 1), !0) : !1;
3085
3127
  }
3086
3128
  function u(t, n) {
3087
- return xe(e.editorView.value, t, n);
3129
+ return Ce(e.editorView.value, t, n);
3088
3130
  }
3089
3131
  function d() {
3090
- return Ce(e.editorView.value);
3132
+ return Te(e.editorView.value);
3091
3133
  }
3092
3134
  function f() {
3093
3135
  return e.comments.value;
3094
3136
  }
3095
3137
  function p(t) {
3096
3138
  let n = e.editorView.value;
3097
- return n ? Oe(n.state.doc, t ?? {}) : [];
3139
+ return n ? Ae(n.state.doc, t ?? {}) : [];
3098
3140
  }
3099
3141
  function m(t) {
3100
3142
  let n = e.editorView.value;
3101
3143
  if (!n) return !1;
3102
- let r = De(n.state.doc, t);
3144
+ let r = ke(n.state.doc, t);
3103
3145
  return r == null ? !1 : (a(r), !0);
3104
3146
  }
3105
3147
  function h(t, n, r) {
3148
+ let i = he.between(t.state.doc.resolve(n), t.state.doc.resolve(r));
3149
+ t.dispatch(t.state.tr.setSelection(i)), e.scrollVisiblePositionIntoView(n);
3150
+ }
3151
+ function g(t, n) {
3152
+ let r = e.editorView.value;
3153
+ if (!r) return;
3154
+ let i = be(r.state.doc, t, n);
3155
+ i && h(r, i.from, i.to);
3156
+ }
3157
+ function _(t) {
3158
+ let n = e.editorView.value;
3159
+ if (!n) return !1;
3160
+ let r = Se(n, t);
3161
+ return r ? (h(n, r.from, r.to), !0) : !1;
3162
+ }
3163
+ function v(t) {
3164
+ let n = e.editorView.value;
3165
+ if (!n) return !1;
3166
+ let r = xe(n, t);
3167
+ return r ? (h(n, r.from, r.to), !0) : !1;
3168
+ }
3169
+ function y(t, n, r) {
3106
3170
  let i = e.editorView.value;
3107
3171
  if (!i) return !1;
3108
3172
  try {
3109
- return i.dispatch(Me(i.state, t, n, r)), !0;
3173
+ return i.dispatch(Ne(i.state, t, n, r)), !0;
3110
3174
  } catch (e) {
3111
- if (e instanceof It) return !1;
3175
+ if (e instanceof Ht) return !1;
3112
3176
  throw e;
3113
3177
  }
3114
3178
  }
3115
- function g(t, n) {
3179
+ function b(t, n) {
3116
3180
  let r = e.editorView.value;
3117
3181
  if (!r) return !1;
3118
3182
  try {
3119
- return r.dispatch(ke(r.state, t, n)), !0;
3183
+ return r.dispatch(je(r.state, t, n)), !0;
3120
3184
  } catch (e) {
3121
- if (e instanceof It) return !1;
3185
+ if (e instanceof Ht) return !1;
3122
3186
  throw e;
3123
3187
  }
3124
3188
  }
3125
- function _(t, n, r) {
3189
+ function x(t, n, r) {
3126
3190
  let i = e.editorView.value;
3127
3191
  if (!i) return !1;
3128
3192
  try {
3129
- return i.dispatch(Z(i.state, t, n, r)), !0;
3193
+ return i.dispatch(Fe(i.state, t, n, r)), !0;
3130
3194
  } catch (e) {
3131
- if (e instanceof It) return !1;
3195
+ if (e instanceof Ht) return !1;
3132
3196
  throw e;
3133
3197
  }
3134
3198
  }
3135
- function v(t) {
3136
- return Se(e.editorView.value, e.layout.value, t);
3199
+ function S(t) {
3200
+ return we(e.editorView.value, e.layout.value, t);
3137
3201
  }
3138
- function y(t) {
3202
+ function C(t) {
3139
3203
  return e.contentChangeSubscribers.add(t), () => e.contentChangeSubscribers.delete(t);
3140
3204
  }
3141
- function b(t) {
3205
+ function ee(t) {
3142
3206
  return e.selectionChangeSubscribers.add(t), () => e.selectionChangeSubscribers.delete(t);
3143
3207
  }
3144
3208
  return { exposed: {
@@ -3161,44 +3225,47 @@ function mi(e) {
3161
3225
  resolveComment: e.resolveComment,
3162
3226
  proposeChange: e.proposeChange,
3163
3227
  scrollToParaId: l,
3228
+ scrollToCommentId: _,
3229
+ scrollToChangeId: v,
3230
+ highlightRange: g,
3164
3231
  findInDocument: u,
3165
3232
  getSelectionInfo: d,
3166
3233
  getComments: f,
3167
3234
  getContentControls: p,
3168
3235
  scrollToContentControl: m,
3169
- setContentControlContent: h,
3170
- removeContentControl: g,
3171
- setContentControlValue: _,
3236
+ setContentControlContent: y,
3237
+ removeContentControl: b,
3238
+ setContentControlValue: x,
3172
3239
  applyFormatting: e.applyFormatting,
3173
3240
  setParagraphStyle: e.setParagraphStyle,
3174
- getPageContent: v,
3241
+ getPageContent: S,
3175
3242
  getTotalPages: s,
3176
3243
  getCurrentPage: c,
3177
- onContentChange: y,
3178
- onSelectionChange: b
3244
+ onContentChange: C,
3245
+ onSelectionChange: ee
3179
3246
  } };
3180
3247
  }
3181
3248
  //#endregion
3182
3249
  //#region src/composables/useFontLifecycle.ts
3183
- function hi(e, t) {
3184
- K(e, (e) => {
3185
- Fe(e);
3250
+ function Ti(e, t) {
3251
+ W(e, (e) => {
3252
+ Re(e);
3186
3253
  }, { immediate: !0 });
3187
- let n = Ie(t);
3188
- I(() => n());
3254
+ let n = ze(t);
3255
+ F(() => n());
3189
3256
  }
3190
3257
  //#endregion
3191
3258
  //#region src/components/DocxEditor.vue?vue&type=script&setup=true&lang.ts
3192
- var gi = { class: "docx-editor-vue__toolbar-shell" }, _i = {
3259
+ var Ei = { class: "docx-editor-vue__toolbar-shell" }, Di = {
3193
3260
  key: 0,
3194
3261
  class: "docx-editor-vue__error"
3195
- }, vi = {
3262
+ }, Oi = {
3196
3263
  key: 1,
3197
3264
  class: "docx-editor-vue__loading"
3198
- }, yi = { class: "docx-editor-vue__editor-area" }, bi = {
3265
+ }, ki = { class: "docx-editor-vue__editor-area" }, Ai = {
3199
3266
  key: 0,
3200
3267
  class: "docx-editor-vue__vertical-ruler"
3201
- }, xi = ["title"], Si = ["title", "aria-label"], Ci = /* @__PURE__ */ N({
3268
+ }, ji = ["title"], Mi = ["title", "aria-label"], Ni = /* @__PURE__ */ N({
3202
3269
  __name: "DocxEditor",
3203
3270
  props: {
3204
3271
  documentBuffer: { default: null },
@@ -3299,41 +3366,41 @@ var gi = { class: "docx-editor-vue__toolbar-shell" }, _i = {
3299
3366
  "menu-action",
3300
3367
  "mode-change"
3301
3368
  ],
3302
- setup(e, { expose: n, emit: r }) {
3303
- let i = e, a = r, o = z(i.mode), s = D(() => i.readOnly || o.value === "viewing"), l = D(() => i.author);
3304
- f(D(() => i.i18n));
3305
- let { t: u } = t(D(() => i.i18n)), d = z(null), g = z(null), y = z(null), x = z(0), S = /* @__PURE__ */ new Set(), C = /* @__PURE__ */ new Set(), w = new we(), E = z(!1), re = z(!1), oe = z(!1), j = z(!1), N = z(!1), se = z(!1), W = z(i.showOutline), fe = z(!1), G = z(!1), q = z(!1), me = z(null), Y = de([]), ge = de([]), _e = de([]), { zoom: X, zoomPercent: be, isMinZoom: xe, isMaxZoom: Se, setZoom: Te, zoomIn: De, zoomOut: Oe, handleWheel: ke, handleKeyDown: Ae, installShortcuts: je, ZOOM_PRESETS: Me } = ne(i.initialZoom);
3306
- je();
3307
- let { editorView: Z, isReady: Pe, parseError: Fe, layout: Ie, loadBuffer: Le, loadDocument: Re, save: ze, focus: Ve, destroy: He, getDocument: Q, getCommands: Ue, reLayout: We, getHfPmView: Ge, syncHfPMs: Ke, setHfTransactionListener: qe, setDocument: Je } = ee({
3308
- hiddenContainer: d,
3309
- pagesContainer: g,
3310
- readOnly: s,
3369
+ setup(e, { expose: t, emit: n }) {
3370
+ let i = e, o = n, s = R(i.mode), c = E(() => i.readOnly || s.value === "viewing"), u = E(() => i.author);
3371
+ a(E(() => i.i18n));
3372
+ let { t: d } = l(E(() => i.i18n)), h = R(null), v = R(null), b = R(null), x = R(0), S = /* @__PURE__ */ new Set(), ne = /* @__PURE__ */ new Set(), T = new Ee(), D = R(!1), ie = R(!1), ae = R(!1), N = R(!1), oe = R(!1), H = R(i.showOutline), pe = R(!1), U = R(!1), G = R(!1), K = R(null), J = fe([]), Y = fe([]), ge = fe([]), { zoom: X, zoomPercent: ye, isMinZoom: be, isMaxZoom: xe, setZoom: Se, zoomIn: Ce, zoomOut: we, handleWheel: De, handleKeyDown: ke, installShortcuts: Ae, ZOOM_PRESETS: je } = te(i.initialZoom);
3373
+ Ae();
3374
+ let { editorView: Z, isReady: Me, parseError: Ne, layout: Pe, loadBuffer: Fe, loadDocument: Le, save: Re, focus: ze, destroy: Be, getDocument: Q, getCommands: Ve, reLayout: Ue, getHfPmView: We, syncHfPMs: Ge, setHfTransactionListener: Ke, setDocument: qe } = C({
3375
+ hiddenContainer: h,
3376
+ pagesContainer: v,
3377
+ readOnly: c,
3311
3378
  externalPlugins: i.externalPlugins,
3312
- syncCoordinator: w,
3313
- editorMode: o,
3314
- author: l,
3379
+ syncCoordinator: T,
3380
+ editorMode: s,
3381
+ author: u,
3315
3382
  onChange: (e) => {
3316
- a("change", e), a("update:document", e), i.onChange?.(e), S.forEach((t) => t(e));
3383
+ o("change", e), o("update:document", e), i.onChange?.(e), S.forEach((t) => t(e));
3317
3384
  },
3318
3385
  onError: (e) => {
3319
- a("error", e), i.onError?.(e);
3386
+ o("error", e), i.onError?.(e);
3320
3387
  },
3321
3388
  onSelectionUpdate: () => {
3322
3389
  x.value++;
3323
3390
  let e = Z.value;
3324
- i.onSelectionChange?.(e ? Ee(e.state) : null);
3325
- let t = Ce(e);
3326
- C.forEach((e) => e(t));
3391
+ i.onSelectionChange?.(e ? Oe(e.state) : null);
3392
+ let t = Te(e);
3393
+ ne.forEach((e) => e(t));
3327
3394
  }
3328
- }), { commentCallbacks: Ye } = Qr(i, Z), Xe = D(() => {
3395
+ }), { commentCallbacks: Je } = ci(i, Z), Ye = E(() => {
3329
3396
  x.value;
3330
3397
  let e = Q();
3331
3398
  if (!e?.package?.document) return null;
3332
3399
  let t = e.package.document;
3333
3400
  return t.finalSectionProperties ?? t.sections?.[0]?.properties ?? null;
3334
- }), Ze = D(() => {
3401
+ }), Xe = E(() => {
3335
3402
  x.value;
3336
- let e = Z.value, t = e ? Be(e.state).paragraphFormatting : {};
3403
+ let e = Z.value, t = e ? He(e.state).paragraphFormatting : {};
3337
3404
  return {
3338
3405
  indentLeft: t.indentLeft ?? 0,
3339
3406
  indentRight: t.indentRight ?? 0,
@@ -3341,24 +3408,24 @@ var gi = { class: "docx-editor-vue__toolbar-shell" }, _i = {
3341
3408
  hangingIndent: t.hangingIndent ?? !1,
3342
3409
  tabStops: t.tabs ?? null
3343
3410
  };
3344
- }), Qe = D(() => (x.value, Q()?.package?.theme ?? i.theme ?? null)), $e = z(null), et = z([]);
3345
- function tt(e, t) {
3346
- $e.value = ve(e, t), et.value = ye(e, t);
3411
+ }), Ze = E(() => (x.value, Q()?.package?.theme ?? i.theme ?? null)), Qe = R(null), $e = R([]);
3412
+ function et(e, t) {
3413
+ Qe.value = _e(e, t), $e.value = ve(e, t);
3347
3414
  }
3348
- function nt() {
3349
- $e.value = null, et.value = [];
3415
+ function tt() {
3416
+ Qe.value = null, $e.value = [];
3350
3417
  }
3351
- hi(() => i.fonts, (e) => {
3352
- a("error", e), i.onError?.(e);
3418
+ Ti(() => i.fonts, (e) => {
3419
+ o("error", e), i.onError?.(e);
3353
3420
  });
3354
- let rt = D(() => $.value?.headerFooter ? Ge($.value.headerFooter) ?? null : null), it = D(() => rt.value ?? Z.value);
3355
- L(() => {
3356
- qe((e, t) => {
3421
+ let nt = E(() => $.value?.headerFooter ? We($.value.headerFooter) ?? null : null), rt = E(() => nt.value ?? Z.value);
3422
+ I(() => {
3423
+ Ke((e, t) => {
3357
3424
  x.value++, requestAnimationFrame(() => {
3358
3425
  let e = $.value;
3359
3426
  if (!e) return;
3360
- tt(t, e.position);
3361
- let n = Bt(e.position), r = y.value;
3427
+ et(t, e.position);
3428
+ let n = Kt(e.position), r = b.value;
3362
3429
  if (!n || !r) return;
3363
3430
  let i = n.getBoundingClientRect(), a = r.getBoundingClientRect(), o = X.value || 1;
3364
3431
  $.value = {
@@ -3371,9 +3438,9 @@ var gi = { class: "docx-editor-vue__toolbar-shell" }, _i = {
3371
3438
  }
3372
3439
  };
3373
3440
  });
3374
- }), K(() => $.value, (e) => {
3441
+ }), W(() => $.value, (e) => {
3375
3442
  if (!e) {
3376
- nt();
3443
+ tt();
3377
3444
  return;
3378
3445
  }
3379
3446
  let t = Z.value;
@@ -3392,33 +3459,33 @@ var gi = { class: "docx-editor-vue__toolbar-shell" }, _i = {
3392
3459
  e = 0;
3393
3460
  let t = $.value;
3394
3461
  if (!t?.headerFooter) return;
3395
- let n = Ge(t.headerFooter);
3396
- n && tt(n, t.position);
3462
+ let n = We(t.headerFooter);
3463
+ n && et(n, t.position);
3397
3464
  }));
3398
3465
  }
3399
- window.addEventListener("scroll", t, !0), window.addEventListener("resize", t), I(() => {
3466
+ window.addEventListener("scroll", t, !0), window.addEventListener("resize", t), F(() => {
3400
3467
  e && cancelAnimationFrame(e), window.removeEventListener("scroll", t, !0), window.removeEventListener("resize", t);
3401
3468
  });
3402
3469
  });
3403
- let ot = D(() => {
3470
+ let it = E(() => {
3404
3471
  let e = [];
3405
- return G.value && e.push(`translateX(-${Ne}px)`), X.value !== 1 && e.push(`scale(${X.value})`), {
3472
+ return U.value && e.push(`translateX(-${Ie}px)`), X.value !== 1 && e.push(`scale(${X.value})`), {
3406
3473
  transform: e.length > 0 ? e.join(" ") : void 0,
3407
3474
  transformOrigin: "top center",
3408
3475
  transition: "transform 0.2s ease"
3409
3476
  };
3410
- }), st = D(() => ({
3477
+ }), at = E(() => ({
3411
3478
  paddingLeft: "20px",
3412
- paddingRight: 20 + (G.value ? Ne * 2 : 0) + "px",
3479
+ paddingRight: 20 + (U.value ? Ie * 2 : 0) + "px",
3413
3480
  transition: "padding 0.2s ease"
3414
- })), ct = D(() => {
3415
- let e = Xe.value;
3416
- return at(e?.pageWidth ?? 12240) * X.value;
3417
- }), lt = D(() => {
3481
+ })), ot = E(() => {
3482
+ let e = Ye.value;
3483
+ return ct(e?.pageWidth ?? 12240) * X.value;
3484
+ }), st = E(() => {
3418
3485
  let e = /* @__PURE__ */ new Set();
3419
- for (let t of Y.value) t.parentId == null && t.done && e.add(t.id);
3486
+ for (let t of J.value) t.parentId == null && t.done && e.add(t.id);
3420
3487
  return e;
3421
- }), ut = D(() => {
3488
+ }), lt = E(() => {
3422
3489
  x.value;
3423
3490
  let e = Z.value;
3424
3491
  if (!e) return [];
@@ -3435,150 +3502,151 @@ var gi = { class: "docx-editor-vue__toolbar-shell" }, _i = {
3435
3502
  }
3436
3503
  return !0;
3437
3504
  }), n.sort((e, t) => e.name.localeCompare(t.name));
3438
- }), dt = At(), { floatingCommentBtn: ft, pendingCommentRange: pt, addCommentYPosition: mt, sidebarAutoOpenedRef: ht, extractCommentsAndChanges: gt, handleAddComment: _t, handleCancelAddComment: vt, handleStartAddComment: yt, handleMarkerClick: bt } = $r({
3505
+ }), ut = Pt(), { floatingCommentBtn: dt, pendingCommentRange: ft, addCommentYPosition: pt, sidebarAutoOpenedRef: mt, extractCommentsAndChanges: ht, handleAddComment: gt, handleCancelAddComment: _t, handleStartAddComment: vt, handleMarkerClick: yt } = li({
3439
3506
  editorView: Z,
3440
3507
  getDocument: Q,
3441
- comments: Y,
3442
- trackedChanges: ge,
3443
- resolvedCommentIds: lt,
3444
- activeSidebarItem: me,
3445
- showSidebar: G,
3446
- isAddingComment: q,
3447
- readOnly: s,
3508
+ comments: J,
3509
+ trackedChanges: Y,
3510
+ resolvedCommentIds: st,
3511
+ activeSidebarItem: K,
3512
+ showSidebar: U,
3513
+ isAddingComment: G,
3514
+ readOnly: c,
3448
3515
  zoom: X,
3449
3516
  stateTick: x,
3450
- pagesRef: g,
3451
- pagesViewportRef: y,
3452
- emit: a,
3453
- commentIdAllocator: dt,
3454
- author: l,
3455
- commentCallbacks: Ye
3456
- }), { docxInputRef: xt, handleDocxFileChange: St, handleDocumentNameChange: Ct, downloadCurrentDocument: wt, loadDocumentBuffer: Tt, loadDocument: Et, save: Dt } = Wr({
3457
- loadBuffer: Le,
3458
- loadParsedDocument: Re,
3517
+ pagesRef: v,
3518
+ pagesViewportRef: b,
3519
+ emit: o,
3520
+ commentIdAllocator: ut,
3521
+ author: u,
3522
+ commentCallbacks: Je
3523
+ }), { docxInputRef: bt, imageInputRef: xt, handleImageFileChange: St, handleDocxFileChange: Ct, handleDocumentNameChange: wt, downloadCurrentDocument: Tt, loadDocumentBuffer: Et, loadDocument: Dt, save: Ot } = ei({
3524
+ loadBuffer: Fe,
3525
+ loadParsedDocument: Le,
3459
3526
  getDocument: Q,
3460
- saveBlob: ze,
3461
- extractCommentsAndChanges: gt,
3462
- emit: a,
3527
+ saveBlob: Re,
3528
+ extractCommentsAndChanges: ht,
3529
+ emit: o,
3463
3530
  documentName: () => i.documentName,
3464
3531
  onDocumentNameChange: i.onDocumentNameChange,
3465
- nextTick: le
3466
- }), { hyperlinkPopupData: Ot, handleHyperlinkSubmit: kt, handleHyperlinkRemove: jt, handleHyperlinkPopupNavigate: Mt, handleHyperlinkPopupEdit: Nt, handleHyperlinkPopupRemove: Pt } = Gr({
3532
+ getActiveView: () => rt.value,
3533
+ nextTick: ce
3534
+ }), { hyperlinkPopupData: kt, handleHyperlinkSubmit: At, handleHyperlinkRemove: jt, handleHyperlinkPopupNavigate: Mt, handleHyperlinkPopupEdit: Nt, handleHyperlinkPopupRemove: Ft } = ti({
3467
3535
  editorView: Z,
3468
- getCommands: Ue
3469
- }), { handleClearFormatting: Ft, handleApplyStyle: It, handleInsertPageBreak: Lt, handleInsertSymbol: Rt, applyFormatting: zt, setParagraphStyle: Vt } = Kr({
3536
+ getCommands: Ve
3537
+ }), { handleClearFormatting: It, handleApplyStyle: Lt, handleInsertPageBreak: Rt, handleInsertSymbol: zt, applyFormatting: Bt, setParagraphStyle: Vt } = ni({
3470
3538
  editorView: Z,
3471
- activeView: it,
3539
+ activeView: rt,
3472
3540
  getDocument: Q
3473
- }), { handlePageSetupApply: Ht, handleLeftMarginChange: Ut, handleRightMarginChange: Wt, handleTopMarginChange: Gt, handleBottomMarginChange: qt, handleIndentLeftChange: Jt, handleIndentRightChange: Yt, handleFirstLineIndentChange: Xt, handleTabStopRemove: Zt } = qr({
3541
+ }), { handlePageSetupApply: Ht, handleLeftMarginChange: Ut, handleRightMarginChange: Wt, handleTopMarginChange: Gt, handleBottomMarginChange: qt, handleIndentLeftChange: Jt, handleIndentRightChange: Yt, handleFirstLineIndentChange: Xt, handleTabStopRemove: Zt } = ri({
3474
3542
  editorView: Z,
3475
3543
  getDocument: Q,
3476
- readOnly: s,
3544
+ readOnly: c,
3477
3545
  stateTick: x,
3478
- reLayout: We,
3479
- emit: a
3480
- }), { showWatermark: Qt, currentWatermark: en, handleWatermarkApply: tn } = Jr({
3546
+ reLayout: Ue,
3547
+ emit: o
3548
+ }), { showWatermark: $t, currentWatermark: en, handleWatermarkApply: tn } = ii({
3481
3549
  editorView: Z,
3482
- readOnly: s,
3550
+ readOnly: c,
3483
3551
  stateTick: x
3484
- }), { handleToggleOutline: nn, handleOutlineNavigate: rn, handleToggleSidebar: sn, handleEditorScrollMouseDown: cn } = Yr({
3552
+ }), { handleToggleOutline: nn, handleOutlineNavigate: rn, handleToggleSidebar: an, handleEditorScrollMouseDown: on } = ai({
3485
3553
  editorView: Z,
3486
- showOutline: W,
3487
- showSidebar: G,
3488
- outlineHeadings: _e,
3489
- activeSidebarItem: me,
3490
- extractCommentsAndChanges: gt
3554
+ showOutline: H,
3555
+ showSidebar: U,
3556
+ outlineHeadings: ge,
3557
+ activeSidebarItem: K,
3558
+ extractCommentsAndChanges: ht
3491
3559
  });
3492
- Xr({
3493
- showKeyboardShortcuts: fe,
3494
- showFindReplace: E,
3495
- showHyperlink: oe,
3496
- handleZoomKeyDown: Ae,
3560
+ oi({
3561
+ showKeyboardShortcuts: pe,
3562
+ showFindReplace: D,
3563
+ showHyperlink: ie,
3564
+ handleZoomKeyDown: ke,
3497
3565
  disableFindReplaceShortcuts: () => i.disableFindReplaceShortcuts
3498
3566
  });
3499
- let { addComment: un, replyToComment: dn, resolveComment: fn, proposeChange: pn, handleCommentReply: hn, handleCommentResolve: gn, handleCommentUnresolve: _n, handleCommentDelete: vn, handleAcceptChange: bn, handleRejectChange: xn, handleAcceptChangeById: Sn, handleRejectChangeById: Cn, handleTrackedChangeReply: wn } = Zr({
3567
+ let { addComment: sn, replyToComment: cn, resolveComment: un, proposeChange: dn, handleCommentReply: fn, handleCommentResolve: pn, handleCommentUnresolve: gn, handleCommentDelete: _n, handleAcceptChange: yn, handleRejectChange: bn, handleAcceptChangeById: xn, handleRejectChangeById: Sn, handleTrackedChangeReply: Cn } = si({
3500
3568
  editorView: Z,
3501
3569
  getDocument: Q,
3502
- comments: Y,
3503
- trackedChanges: ge,
3504
- showSidebar: G,
3505
- isAddingComment: q,
3506
- pendingCommentRange: pt,
3570
+ comments: J,
3571
+ trackedChanges: Y,
3572
+ showSidebar: U,
3573
+ isAddingComment: G,
3574
+ pendingCommentRange: ft,
3507
3575
  contentChangeSubscribers: S,
3508
- extractCommentsAndChanges: gt,
3509
- emit: a,
3510
- commentIdAllocator: dt,
3511
- author: l,
3512
- commentCallbacks: Ye
3513
- }), { selectedImage: Tn, imageInteracting: En, imageToolbarContext: Dn, handleInsertImage: On, handleToolbarImageWrap: kn, handleImageTransform: An } = ei({
3576
+ extractCommentsAndChanges: ht,
3577
+ emit: o,
3578
+ commentIdAllocator: ut,
3579
+ author: u,
3580
+ commentCallbacks: Je
3581
+ }), { selectedImage: Tn, imageInteracting: En, imageToolbarContext: Dn, handleToolbarImageWrap: On, handleImageTransform: An } = ui({
3514
3582
  editorView: Z,
3515
3583
  zoom: X,
3516
3584
  stateTick: x,
3517
- getCommands: Ue
3518
- }), jn = te(), Mn = null, { tableInsertButton: Nn, hfEdit: $, scrollPageInfo: Pn, resolvePos: Fn, setPmSelection: In, scrollVisiblePositionIntoView: Ln, handlePagesMouseDown: Rn, handlePagesMouseMove: zn, handlePagesClick: Bn, handlePagesDoubleClick: Vn, handleTableInsertClick: Hn, clearTableInsertTimer: Un, handleHfSave: Wn, handleHfRemove: Gn } = ui({
3585
+ getCommands: Ve
3586
+ }), jn = ee(), Mn = null, { tableInsertButton: Nn, hfEdit: $, scrollPageInfo: Pn, resolvePos: Fn, setPmSelection: In, scrollVisiblePositionIntoView: Ln, handlePagesMouseDown: Rn, handlePagesMouseMove: zn, handlePagesClick: Bn, handlePagesDoubleClick: Vn, handleTableInsertClick: Hn, clearTableInsertTimer: Un, handleHfSave: Wn, handleHfRemove: Gn } = bi({
3519
3587
  editorView: Z,
3520
- pagesRef: g,
3521
- pagesViewportRef: y,
3588
+ pagesRef: v,
3589
+ pagesViewportRef: b,
3522
3590
  selectedImage: Tn,
3523
3591
  imageInteracting: En,
3524
- hyperlinkPopupData: Ot,
3525
- readOnly: s,
3592
+ hyperlinkPopupData: kt,
3593
+ readOnly: c,
3526
3594
  zoom: X,
3527
- layout: Ie,
3595
+ layout: Pe,
3528
3596
  tableResize: jn,
3529
- getCommands: Ue,
3597
+ getCommands: Ve,
3530
3598
  getDocument: Q,
3531
- reLayout: We,
3532
- emit: a,
3599
+ reLayout: Ue,
3600
+ emit: o,
3533
3601
  clearOverlay: ir,
3534
- syncHfPMs: Ke,
3535
- getHfPmView: Ge,
3536
- setDocument: Je
3537
- }), { contextMenu: Kn, imageContextMenu: qn, imageContextMenuTextActions: Jn, handleContextMenu: Yn, handleSelectedImageContextMenu: Xn, handleImageWrapSelect: Zn, handleContextMenuAction: Qn } = ci({
3602
+ syncHfPMs: Ge,
3603
+ getHfPmView: We,
3604
+ setDocument: qe
3605
+ }), { contextMenu: Kn, imageContextMenu: qn, imageContextMenuTextActions: Jn, handleContextMenu: Yn, handleSelectedImageContextMenu: Xn, handleImageWrapSelect: Zn, handleContextMenuAction: Qn } = vi({
3538
3606
  editorView: Z,
3539
3607
  selectedImage: Tn,
3540
3608
  zoom: X,
3541
3609
  showImageProperties: N,
3542
- getCommands: Ue,
3610
+ getCommands: Ve,
3543
3611
  clearOverlay: ir,
3544
3612
  setPmSelection: In,
3545
3613
  resolvePos: Fn
3546
- }), { handleMenuAction: $n, handleMenuTableInsert: er } = fi({
3614
+ }), { handleMenuAction: $n, handleMenuTableInsert: er } = Si({
3547
3615
  editorView: Z,
3548
- getCommands: Ue,
3549
- docxInputRef: xt,
3550
- showPageSetup: se,
3551
- showWatermark: Qt,
3552
- showInsertImage: re,
3553
- showHyperlink: oe,
3554
- showInsertSymbol: j,
3555
- showKeyboardShortcuts: fe,
3556
- handleClearFormatting: Ft,
3557
- handleInsertPageBreak: Lt,
3616
+ getCommands: Ve,
3617
+ docxInputRef: bt,
3618
+ imageInputRef: xt,
3619
+ showPageSetup: oe,
3620
+ showWatermark: $t,
3621
+ showHyperlink: ie,
3622
+ showInsertSymbol: ae,
3623
+ showKeyboardShortcuts: pe,
3624
+ handleClearFormatting: It,
3625
+ handleInsertPageBreak: Rt,
3558
3626
  handleToggleOutline: nn,
3559
- handleToggleSidebar: sn,
3560
- downloadCurrentDocument: wt,
3561
- emit: a
3627
+ handleToggleSidebar: an,
3628
+ downloadCurrentDocument: Tt,
3629
+ emit: o
3562
3630
  });
3563
- pi({
3631
+ Ci({
3564
3632
  documentBuffer: () => i.documentBuffer,
3565
3633
  document: () => i.document,
3566
- loadDocumentBuffer: Tt,
3567
- loadDocument: Et,
3568
- sidebarAutoOpenedRef: ht
3634
+ loadDocumentBuffer: Et,
3635
+ loadDocument: Dt,
3636
+ sidebarAutoOpenedRef: mt
3569
3637
  });
3570
- let tr = () => Z.value, nr = () => g.value;
3571
- K(() => i.mode, (e) => {
3572
- e && e !== o.value && (o.value = e);
3573
- }), K(() => i.showOutline, (e) => {
3574
- W.value = !!e;
3638
+ let tr = () => Z.value, nr = () => v.value;
3639
+ W(() => i.mode, (e) => {
3640
+ e && e !== s.value && (s.value = e);
3641
+ }), W(() => i.showOutline, (e) => {
3642
+ H.value = !!e;
3575
3643
  });
3576
3644
  function rr(e) {
3577
- o.value !== e && (o.value = e, a("mode-change", e));
3645
+ s.value !== e && (s.value = e, o("mode-change", e));
3578
3646
  }
3579
- L(() => {
3647
+ I(() => {
3580
3648
  Mn = jn.install();
3581
- }), I(() => {
3649
+ }), F(() => {
3582
3650
  Mn?.();
3583
3651
  });
3584
3652
  function ir() {
@@ -3587,67 +3655,67 @@ var gi = { class: "docx-editor-vue__toolbar-shell" }, _i = {
3587
3655
  function ar() {
3588
3656
  or.updateSelectionOverlay();
3589
3657
  }
3590
- let or = di({
3658
+ let or = xi({
3591
3659
  editorView: Z,
3592
- pagesRef: g,
3660
+ pagesRef: v,
3593
3661
  zoom: X,
3594
3662
  selectedImage: Tn,
3595
- isHfEditing: D(() => $.value !== null),
3663
+ isHfEditing: E(() => $.value !== null),
3596
3664
  imageInteracting: En
3597
- }), sr = w.onRender(() => ar());
3598
- ar(), I(() => {
3665
+ }), sr = T.onRender(() => ar());
3666
+ ar(), F(() => {
3599
3667
  sr(), ir();
3600
3668
  });
3601
- let { exposed: cr } = mi({
3669
+ let { exposed: cr } = wi({
3602
3670
  editorView: Z,
3603
- layout: Ie,
3604
- pagesRef: g,
3605
- pagesViewportRef: y,
3671
+ layout: Pe,
3672
+ pagesRef: v,
3673
+ pagesViewportRef: b,
3606
3674
  zoom: X,
3607
- comments: Y,
3608
- focus: Ve,
3609
- destroy: He,
3675
+ comments: J,
3676
+ focus: ze,
3677
+ destroy: Be,
3610
3678
  getDocument: Q,
3611
- setZoom: Te,
3612
- save: Dt,
3613
- loadDocument: Et,
3614
- loadDocumentBuffer: Tt,
3615
- addComment: un,
3616
- replyToComment: dn,
3617
- resolveComment: fn,
3618
- proposeChange: pn,
3619
- applyFormatting: zt,
3679
+ setZoom: Se,
3680
+ save: Ot,
3681
+ loadDocument: Dt,
3682
+ loadDocumentBuffer: Et,
3683
+ addComment: sn,
3684
+ replyToComment: cn,
3685
+ resolveComment: un,
3686
+ proposeChange: dn,
3687
+ applyFormatting: Bt,
3620
3688
  setParagraphStyle: Vt,
3621
3689
  scrollVisiblePositionIntoView: Ln,
3622
3690
  contentChangeSubscribers: S,
3623
- selectionChangeSubscribers: C,
3691
+ selectionChangeSubscribers: ne,
3624
3692
  onPrint: i.onPrint
3625
3693
  });
3626
- return n(cr), (t, n) => (R(), k("div", {
3627
- class: P([
3694
+ return t(cr), (t, n) => (L(), A("div", {
3695
+ class: le([
3628
3696
  "docx-editor-vue ep-root paged-editor",
3629
3697
  e.className,
3630
3698
  {
3631
- "paged-editor--readonly": s.value,
3632
- "paged-editor--hf-editing": U($) !== null,
3633
- "paged-editor--editing-header": U($)?.position === "header",
3634
- "paged-editor--editing-footer": U($)?.position === "footer"
3699
+ "paged-editor--readonly": c.value,
3700
+ "paged-editor--hf-editing": V($) !== null,
3701
+ "paged-editor--editing-header": V($)?.position === "header",
3702
+ "paged-editor--editing-footer": V($)?.position === "footer"
3635
3703
  }
3636
3704
  ]),
3637
- style: F(e.style)
3705
+ style: P(e.style)
3638
3706
  }, [
3639
- A("div", gi, [M(yn, {
3707
+ j("div", Ei, [M(kn, {
3640
3708
  "show-menu-bar": e.showMenuBar,
3641
3709
  "document-name": e.documentName,
3642
3710
  "document-name-editable": e.documentNameEditable,
3643
3711
  "render-logo": e.renderLogo,
3644
3712
  "render-title-bar-right": e.renderTitleBarRight,
3645
- onRename: U(Ct),
3646
- onMenuAction: U($n),
3647
- onInsertTable: U(er)
3713
+ onRename: V(wt),
3714
+ onMenuAction: V($n),
3715
+ onInsertTable: V(er)
3648
3716
  }, {
3649
- "title-bar-left": pe(() => [V(t.$slots, "title-bar-left")]),
3650
- "title-bar-right": pe(() => [V(t.$slots, "title-bar-right")]),
3717
+ "title-bar-left": me(() => [ue(t.$slots, "title-bar-left")]),
3718
+ "title-bar-right": me(() => [ue(t.$slots, "title-bar-right")]),
3651
3719
  _: 3
3652
3720
  }, 8, [
3653
3721
  "show-menu-bar",
@@ -3658,37 +3726,37 @@ var gi = { class: "docx-editor-vue__toolbar-shell" }, _i = {
3658
3726
  "onRename",
3659
3727
  "onMenuAction",
3660
3728
  "onInsertTable"
3661
- ]), e.showToolbar ? (R(), ie(b, {
3729
+ ]), e.showToolbar ? (L(), O(y, {
3662
3730
  key: 0,
3663
- view: it.value,
3664
- "get-commands": U(Ue),
3731
+ view: rt.value,
3732
+ "get-commands": V(Ve),
3665
3733
  "state-tick": x.value,
3666
- "zoom-percent": U(be),
3667
- "is-min-zoom": U(xe),
3668
- "is-max-zoom": U(Se),
3669
- "zoom-presets": U(Me),
3734
+ "zoom-percent": V(ye),
3735
+ "is-min-zoom": V(be),
3736
+ "is-max-zoom": V(xe),
3737
+ "zoom-presets": V(je),
3670
3738
  "show-zoom-control": e.showZoomControl,
3671
- "editor-mode": o.value,
3672
- "comments-sidebar-open": G.value,
3673
- "image-context": U(Dn),
3674
- theme: Qe.value,
3739
+ "editor-mode": s.value,
3740
+ "comments-sidebar-open": U.value,
3741
+ "image-context": V(Dn),
3742
+ theme: Ze.value,
3675
3743
  "font-families": e.fontFamilies,
3676
- onInsertLink: n[0] ||= (e) => oe.value = !0,
3677
- onApplyStyle: U(It),
3678
- onZoomIn: U(De),
3679
- onZoomOut: U(Oe),
3680
- onZoomSet: U(Te),
3681
- onToggleSidebar: U(sn),
3744
+ onInsertLink: n[0] ||= (e) => ie.value = !0,
3745
+ onApplyStyle: V(Lt),
3746
+ onZoomIn: V(Ce),
3747
+ onZoomOut: V(we),
3748
+ onZoomSet: V(Se),
3749
+ onToggleSidebar: V(an),
3682
3750
  onModeChange: rr,
3683
- onImageWrapType: U(kn),
3751
+ onImageWrapType: V(On),
3684
3752
  onImageProperties: n[1] ||= (e) => N.value = !0,
3685
- onImageTransform: U(An)
3686
- }, ae({
3687
- "table-context": pe(() => [M(h, {
3688
- view: it.value,
3689
- "get-commands": U(Ue),
3753
+ onImageTransform: V(An)
3754
+ }, re({
3755
+ "table-context": me(() => [M(m, {
3756
+ view: rt.value,
3757
+ "get-commands": V(Ve),
3690
3758
  "state-tick": x.value,
3691
- theme: Qe.value
3759
+ theme: Ze.value
3692
3760
  }, null, 8, [
3693
3761
  "view",
3694
3762
  "get-commands",
@@ -3698,11 +3766,11 @@ var gi = { class: "docx-editor-vue__toolbar-shell" }, _i = {
3698
3766
  _: 2
3699
3767
  }, [e.toolbarExtra ? {
3700
3768
  name: "toolbar-extra",
3701
- fn: pe(() => [(R(), ie(ue(e.toolbarExtra)))]),
3769
+ fn: me(() => [(L(), O(de(e.toolbarExtra)))]),
3702
3770
  key: "0"
3703
3771
  } : {
3704
3772
  name: "toolbar-extra",
3705
- fn: pe(() => [V(t.$slots, "toolbar-extra")]),
3773
+ fn: me(() => [ue(t.$slots, "toolbar-extra")]),
3706
3774
  key: "1"
3707
3775
  }]), 1032, [
3708
3776
  "view",
@@ -3725,39 +3793,35 @@ var gi = { class: "docx-editor-vue__toolbar-shell" }, _i = {
3725
3793
  "onToggleSidebar",
3726
3794
  "onImageWrapType",
3727
3795
  "onImageTransform"
3728
- ])) : O("", !0)]),
3729
- M(lr, {
3730
- "show-find-replace": E.value,
3731
- "onUpdate:showFindReplace": n[2] ||= (e) => E.value = e,
3732
- "show-insert-image": re.value,
3733
- "onUpdate:showInsertImage": n[3] ||= (e) => re.value = e,
3734
- "show-hyperlink": oe.value,
3735
- "onUpdate:showHyperlink": n[4] ||= (e) => oe.value = e,
3736
- "show-insert-symbol": j.value,
3737
- "onUpdate:showInsertSymbol": n[5] ||= (e) => j.value = e,
3796
+ ])) : k("", !0)]),
3797
+ M(yr, {
3798
+ "show-find-replace": D.value,
3799
+ "onUpdate:showFindReplace": n[2] ||= (e) => D.value = e,
3800
+ "show-hyperlink": ie.value,
3801
+ "onUpdate:showHyperlink": n[3] ||= (e) => ie.value = e,
3802
+ "show-insert-symbol": ae.value,
3803
+ "onUpdate:showInsertSymbol": n[4] ||= (e) => ae.value = e,
3738
3804
  "show-image-properties": N.value,
3739
- "onUpdate:showImageProperties": n[6] ||= (e) => N.value = e,
3740
- "show-page-setup": se.value,
3741
- "onUpdate:showPageSetup": n[7] ||= (e) => se.value = e,
3742
- "show-watermark": U(Qt),
3743
- "onUpdate:showWatermark": n[8] ||= (e) => ce(Qt) ? Qt.value = e : null,
3744
- "show-keyboard-shortcuts": fe.value,
3745
- "onUpdate:showKeyboardShortcuts": n[9] ||= (e) => fe.value = e,
3746
- view: U(Z),
3747
- bookmarks: ut.value,
3748
- "selected-image-pm-pos": U(Tn)?.pmPos ?? null,
3749
- "section-properties": Xe.value,
3750
- "current-watermark": U(en),
3751
- "scroll-visible-position-into-view": U(Ln),
3752
- onInsertImage: U(On),
3753
- onInsertSymbol: U(Rt),
3754
- onHyperlinkSubmit: U(kt),
3755
- onHyperlinkRemove: U(jt),
3756
- onPageSetupApply: U(Ht),
3757
- onWatermarkApply: U(tn)
3805
+ "onUpdate:showImageProperties": n[5] ||= (e) => N.value = e,
3806
+ "show-page-setup": oe.value,
3807
+ "onUpdate:showPageSetup": n[6] ||= (e) => oe.value = e,
3808
+ "show-watermark": V($t),
3809
+ "onUpdate:showWatermark": n[7] ||= (e) => se($t) ? $t.value = e : null,
3810
+ "show-keyboard-shortcuts": pe.value,
3811
+ "onUpdate:showKeyboardShortcuts": n[8] ||= (e) => pe.value = e,
3812
+ view: V(Z),
3813
+ bookmarks: lt.value,
3814
+ "selected-image-pm-pos": V(Tn)?.pmPos ?? null,
3815
+ "section-properties": Ye.value,
3816
+ "current-watermark": V(en),
3817
+ "scroll-visible-position-into-view": V(Ln),
3818
+ onInsertSymbol: V(zt),
3819
+ onHyperlinkSubmit: V(At),
3820
+ onHyperlinkRemove: V(jt),
3821
+ onPageSetupApply: V(Ht),
3822
+ onWatermarkApply: V(tn)
3758
3823
  }, null, 8, [
3759
3824
  "show-find-replace",
3760
- "show-insert-image",
3761
3825
  "show-hyperlink",
3762
3826
  "show-insert-symbol",
3763
3827
  "show-image-properties",
@@ -3770,42 +3834,41 @@ var gi = { class: "docx-editor-vue__toolbar-shell" }, _i = {
3770
3834
  "section-properties",
3771
3835
  "current-watermark",
3772
3836
  "scroll-visible-position-into-view",
3773
- "onInsertImage",
3774
3837
  "onInsertSymbol",
3775
3838
  "onHyperlinkSubmit",
3776
3839
  "onHyperlinkRemove",
3777
3840
  "onPageSetupApply",
3778
3841
  "onWatermarkApply"
3779
3842
  ]),
3780
- U(Fe) ? (R(), k("div", _i, H(U(Fe)), 1)) : O("", !0),
3781
- !U(Pe) && !U(Fe) ? (R(), k("div", vi, "Loading...")) : O("", !0),
3782
- A("div", {
3843
+ V(Ne) ? (L(), A("div", Di, B(V(Ne)), 1)) : k("", !0),
3844
+ !V(Me) && !V(Ne) ? (L(), A("div", Oi, "Loading...")) : k("", !0),
3845
+ j("div", {
3783
3846
  ref_key: "hiddenPmRef",
3784
- ref: d,
3847
+ ref: h,
3785
3848
  class: "docx-editor-vue__hidden-pm paged-editor__hidden-pm"
3786
3849
  }, null, 512),
3787
- A("div", {
3850
+ j("div", {
3788
3851
  class: "docx-editor-vue__editor-scroll",
3789
- onMousedown: n[32] ||= (...e) => U(cn) && U(cn)(...e)
3790
- }, [e.showRuler && Xe.value ? (R(), k("div", {
3852
+ onMousedown: n[31] ||= (...e) => V(on) && V(on)(...e)
3853
+ }, [e.showRuler && Ye.value ? (L(), A("div", {
3791
3854
  key: 0,
3792
3855
  class: "docx-editor-vue__ruler-row",
3793
- style: F(st.value)
3794
- }, [M(_, {
3795
- "section-props": Xe.value,
3796
- zoom: U(X),
3797
- editable: !s.value,
3798
- "indent-left": Ze.value.indentLeft,
3799
- "indent-right": Ze.value.indentRight,
3800
- "first-line-indent": Ze.value.firstLineIndent,
3801
- "hanging-indent": Ze.value.hangingIndent,
3802
- "tab-stops": Ze.value.tabStops,
3803
- onLeftMarginChange: U(Ut),
3804
- onRightMarginChange: U(Wt),
3805
- onIndentLeftChange: U(Jt),
3806
- onIndentRightChange: U(Yt),
3807
- onFirstLineIndentChange: U(Xt),
3808
- onTabStopRemove: U(Zt)
3856
+ style: P(at.value)
3857
+ }, [M(g, {
3858
+ "section-props": Ye.value,
3859
+ zoom: V(X),
3860
+ editable: !c.value,
3861
+ "indent-left": Xe.value.indentLeft,
3862
+ "indent-right": Xe.value.indentRight,
3863
+ "first-line-indent": Xe.value.firstLineIndent,
3864
+ "hanging-indent": Xe.value.hangingIndent,
3865
+ "tab-stops": Xe.value.tabStops,
3866
+ onLeftMarginChange: V(Ut),
3867
+ onRightMarginChange: V(Wt),
3868
+ onIndentLeftChange: V(Jt),
3869
+ onIndentRightChange: V(Yt),
3870
+ onFirstLineIndentChange: V(Xt),
3871
+ onTabStopRemove: V(Zt)
3809
3872
  }, null, 8, [
3810
3873
  "section-props",
3811
3874
  "zoom",
@@ -3821,50 +3884,50 @@ var gi = { class: "docx-editor-vue__toolbar-shell" }, _i = {
3821
3884
  "onIndentRightChange",
3822
3885
  "onFirstLineIndentChange",
3823
3886
  "onTabStopRemove"
3824
- ])], 4)) : O("", !0), A("div", yi, [
3825
- A("div", {
3887
+ ])], 4)) : k("", !0), j("div", ki, [
3888
+ j("div", {
3826
3889
  ref_key: "pagesViewportRef",
3827
- ref: y,
3890
+ ref: b,
3828
3891
  class: "docx-editor-vue__pages-viewport",
3829
- onMousedown: n[23] ||= (...e) => U(Rn) && U(Rn)(...e),
3830
- onMousemove: n[24] ||= (...e) => U(zn) && U(zn)(...e),
3831
- onClick: n[25] ||= (...e) => U(Bn) && U(Bn)(...e),
3832
- onDblclick: n[26] ||= (...e) => U(Vn) && U(Vn)(...e),
3833
- onContextmenu: n[27] ||= J((...e) => U(Yn) && U(Yn)(...e), ["prevent"]),
3834
- onWheel: n[28] ||= (...e) => U(ke) && U(ke)(...e)
3892
+ onMousedown: n[22] ||= (...e) => V(Rn) && V(Rn)(...e),
3893
+ onMousemove: n[23] ||= (...e) => V(zn) && V(zn)(...e),
3894
+ onClick: n[24] ||= (...e) => V(Bn) && V(Bn)(...e),
3895
+ onDblclick: n[25] ||= (...e) => V(Vn) && V(Vn)(...e),
3896
+ onContextmenu: n[26] ||= q((...e) => V(Yn) && V(Yn)(...e), ["prevent"]),
3897
+ onWheel: n[27] ||= (...e) => V(De) && V(De)(...e)
3835
3898
  }, [
3836
- e.showRuler && Xe.value ? (R(), k("div", bi, [M(p, {
3837
- "section-props": Xe.value,
3838
- zoom: U(X),
3839
- editable: !s.value,
3840
- onTopMarginChange: U(Gt),
3841
- onBottomMarginChange: U(qt)
3899
+ e.showRuler && Ye.value ? (L(), A("div", Ai, [M(f, {
3900
+ "section-props": Ye.value,
3901
+ zoom: V(X),
3902
+ editable: !c.value,
3903
+ onTopMarginChange: V(Gt),
3904
+ onBottomMarginChange: V(qt)
3842
3905
  }, null, 8, [
3843
3906
  "section-props",
3844
3907
  "zoom",
3845
3908
  "editable",
3846
3909
  "onTopMarginChange",
3847
3910
  "onBottomMarginChange"
3848
- ])])) : O("", !0),
3849
- A("div", {
3911
+ ])])) : k("", !0),
3912
+ j("div", {
3850
3913
  ref_key: "pagesRef",
3851
- ref: g,
3914
+ ref: v,
3852
3915
  class: "docx-editor-vue__pages paged-editor__pages",
3853
- style: F(ot.value)
3916
+ style: P(it.value)
3854
3917
  }, null, 4),
3855
- s.value ? O("", !0) : (R(), ie(mn, {
3918
+ c.value ? k("", !0) : (L(), O(wn, {
3856
3919
  key: 1,
3857
- container: g.value,
3858
- view: U(Z)
3920
+ container: v.value,
3921
+ view: V(Z)
3859
3922
  }, null, 8, ["container", "view"])),
3860
- M(ln, {
3861
- "is-open": U($) !== null,
3862
- position: U($)?.position ?? "header",
3863
- view: rt.value,
3864
- "target-rect": U($)?.targetRect ?? null,
3865
- onSave: U(Wn),
3866
- onClose: n[10] ||= (e) => $.value = null,
3867
- onRemove: U(Gn)
3923
+ M(vn, {
3924
+ "is-open": V($) !== null,
3925
+ position: V($)?.position ?? "header",
3926
+ view: nt.value,
3927
+ "target-rect": V($)?.targetRect ?? null,
3928
+ onSave: V(Wn),
3929
+ onClose: n[9] ||= (e) => $.value = null,
3930
+ onRemove: V(Gn)
3868
3931
  }, null, 8, [
3869
3932
  "is-open",
3870
3933
  "position",
@@ -3873,11 +3936,11 @@ var gi = { class: "docx-editor-vue__toolbar-shell" }, _i = {
3873
3936
  "onSave",
3874
3937
  "onRemove"
3875
3938
  ]),
3876
- (R(!0), k(T, null, B(U($) ? et.value : [], (e, t) => (R(), k("div", {
3939
+ (L(!0), A(w, null, z(V($) ? $e.value : [], (e, t) => (L(), A("div", {
3877
3940
  key: `hf-sel-${t}-${e.top}-${e.left}`,
3878
3941
  class: "vue-hf-sel-rect",
3879
3942
  "aria-hidden": "true",
3880
- style: F({
3943
+ style: P({
3881
3944
  position: "fixed",
3882
3945
  top: `${e.top}px`,
3883
3946
  left: `${e.left}px`,
@@ -3888,93 +3951,93 @@ var gi = { class: "docx-editor-vue__toolbar-shell" }, _i = {
3888
3951
  zIndex: 9998
3889
3952
  })
3890
3953
  }, null, 4))), 128)),
3891
- U($) && $e.value ? (R(), k("div", {
3954
+ V($) && Qe.value ? (L(), A("div", {
3892
3955
  key: 2,
3893
3956
  "aria-hidden": "true",
3894
- style: F({
3957
+ style: P({
3895
3958
  position: "fixed",
3896
- top: `${$e.value.top}px`,
3897
- left: `${$e.value.left}px`,
3959
+ top: `${Qe.value.top}px`,
3960
+ left: `${Qe.value.left}px`,
3898
3961
  width: "2px",
3899
- height: `${$e.value.height}px`,
3962
+ height: `${Qe.value.height}px`,
3900
3963
  background: "#4285f4",
3901
3964
  pointerEvents: "none",
3902
3965
  zIndex: 9999,
3903
3966
  animation: "hf-caret-blink 1.06s steps(1) infinite"
3904
3967
  })
3905
- }, null, 4)) : O("", !0),
3906
- M($t, {
3907
- "image-info": U(Tn),
3908
- zoom: U(X),
3909
- view: U(Z),
3910
- onOpenProperties: n[11] ||= (e) => N.value = !0,
3911
- onDeselect: n[12] ||= (e) => Tn.value = null,
3912
- onInteractStart: n[13] ||= (e) => En.value = !0,
3913
- onInteractEnd: n[14] ||= (e) => En.value = !1,
3914
- onContextMenu: U(Xn)
3968
+ }, null, 4)) : k("", !0),
3969
+ M(ln, {
3970
+ "image-info": V(Tn),
3971
+ zoom: V(X),
3972
+ view: V(Z),
3973
+ onOpenProperties: n[10] ||= (e) => N.value = !0,
3974
+ onDeselect: n[11] ||= (e) => Tn.value = null,
3975
+ onInteractStart: n[12] ||= (e) => En.value = !0,
3976
+ onInteractEnd: n[13] ||= (e) => En.value = !1,
3977
+ onContextMenu: V(Xn)
3915
3978
  }, null, 8, [
3916
3979
  "image-info",
3917
3980
  "zoom",
3918
3981
  "view",
3919
3982
  "onContextMenu"
3920
3983
  ]),
3921
- M(Kt, {
3984
+ M(Qt, {
3922
3985
  "get-view": tr,
3923
3986
  "get-pages-container": nr,
3924
- zoom: U(X),
3987
+ zoom: V(X),
3925
3988
  "transaction-version": x.value,
3926
- "sync-coordinator": U(w)
3989
+ "sync-coordinator": V(T)
3927
3990
  }, null, 8, [
3928
3991
  "zoom",
3929
3992
  "transaction-version",
3930
3993
  "sync-coordinator"
3931
3994
  ]),
3932
- U(ft) && !q.value && !s.value ? (R(), k("button", {
3995
+ V(dt) && !G.value && !c.value ? (L(), A("button", {
3933
3996
  key: 3,
3934
3997
  type: "button",
3935
3998
  class: "docx-editor-vue__floating-comment",
3936
- style: F({
3937
- top: U(ft).top + "px",
3938
- left: U(ft).left + "px"
3999
+ style: P({
4000
+ top: V(dt).top + "px",
4001
+ left: V(dt).left + "px"
3939
4002
  }),
3940
- title: U(u)("comments.addComment"),
3941
- onMousedown: n[15] ||= J((...e) => U(yt) && U(yt)(...e), ["prevent", "stop"])
3942
- }, [M(c, {
4003
+ title: V(d)("comments.addComment"),
4004
+ onMousedown: n[14] ||= q((...e) => V(vt) && V(vt)(...e), ["prevent", "stop"])
4005
+ }, [M(r, {
3943
4006
  name: "add_comment",
3944
4007
  size: 16
3945
- })], 44, xi)) : O("", !0),
3946
- U(Nn) && !s.value ? (R(), k("button", {
4008
+ })], 44, ji)) : k("", !0),
4009
+ V(Nn) && !c.value ? (L(), A("button", {
3947
4010
  key: 4,
3948
4011
  type: "button",
3949
4012
  class: "docx-editor-vue__table-insert-btn",
3950
- style: F({
3951
- left: U(Nn).x + "px",
3952
- top: U(Nn).y + "px"
4013
+ style: P({
4014
+ left: V(Nn).x + "px",
4015
+ top: V(Nn).y + "px"
3953
4016
  }),
3954
- title: U(Nn).type === "row" ? "Insert row below" : "Insert column to the right",
3955
- "aria-label": U(Nn).type === "row" ? "Insert row below" : "Insert column to the right",
3956
- onMousedown: n[16] ||= (...e) => U(Hn) && U(Hn)(...e),
3957
- onMouseenter: n[17] ||= (...e) => U(Un) && U(Un)(...e),
3958
- onMouseleave: n[18] ||= (e) => Nn.value = null
3959
- }, [...n[37] ||= [A("svg", {
4017
+ title: V(Nn).type === "row" ? "Insert row below" : "Insert column to the right",
4018
+ "aria-label": V(Nn).type === "row" ? "Insert row below" : "Insert column to the right",
4019
+ onMousedown: n[15] ||= (...e) => V(Hn) && V(Hn)(...e),
4020
+ onMouseenter: n[16] ||= (...e) => V(Un) && V(Un)(...e),
4021
+ onMouseleave: n[17] ||= (e) => Nn.value = null
4022
+ }, [...n[37] ||= [j("svg", {
3960
4023
  width: "12",
3961
4024
  height: "12",
3962
4025
  viewBox: "0 0 12 12",
3963
4026
  fill: "none"
3964
- }, [A("path", {
4027
+ }, [j("path", {
3965
4028
  d: "M6 1v10M1 6h10",
3966
4029
  stroke: "currentColor",
3967
4030
  "stroke-width": "1.5",
3968
4031
  "stroke-linecap": "round"
3969
- })], -1)]], 44, Si)) : O("", !0),
3970
- M(v, {
3971
- comments: Y.value,
3972
- "pages-container": g.value,
3973
- zoom: U(X),
3974
- "page-width-px": ct.value,
3975
- "sidebar-open": G.value,
3976
- "resolved-comment-ids": lt.value,
3977
- onMarkerClick: U(bt)
4032
+ })], -1)]], 44, Mi)) : k("", !0),
4033
+ M(_, {
4034
+ comments: J.value,
4035
+ "pages-container": v.value,
4036
+ zoom: V(X),
4037
+ "page-width-px": ot.value,
4038
+ "sidebar-open": U.value,
4039
+ "resolved-comment-ids": st.value,
4040
+ onMarkerClick: V(yt)
3978
4041
  }, null, 8, [
3979
4042
  "comments",
3980
4043
  "pages-container",
@@ -3984,30 +4047,30 @@ var gi = { class: "docx-editor-vue__toolbar-shell" }, _i = {
3984
4047
  "resolved-comment-ids",
3985
4048
  "onMarkerClick"
3986
4049
  ]),
3987
- M(m, {
3988
- "is-open": G.value,
3989
- comments: Y.value,
3990
- "tracked-changes": ge.value,
3991
- "is-adding-comment": q.value,
3992
- "add-comment-y-position": U(mt),
4050
+ M(p, {
4051
+ "is-open": U.value,
4052
+ comments: J.value,
4053
+ "tracked-changes": Y.value,
4054
+ "is-adding-comment": G.value,
4055
+ "add-comment-y-position": V(pt),
3993
4056
  "show-resolved": !0,
3994
- "pages-container": g.value,
3995
- "page-width-px": ct.value,
3996
- zoom: U(X),
3997
- "active-item-id": me.value,
3998
- onClose: n[19] ||= (e) => G.value = !1,
3999
- onAddComment: U(_t),
4000
- onCancelAddComment: U(vt),
4001
- onCommentReply: U(hn),
4002
- onCommentResolve: U(gn),
4003
- onCommentUnresolve: U(_n),
4004
- onCommentDelete: U(vn),
4005
- onAcceptChange: U(bn),
4006
- onRejectChange: U(xn),
4007
- onAcceptChangeById: U(Sn),
4008
- onRejectChangeById: U(Cn),
4009
- onTrackedChangeReply: U(wn),
4010
- "onUpdate:activeItemId": n[20] ||= (e) => me.value = e
4057
+ "pages-container": v.value,
4058
+ "page-width-px": ot.value,
4059
+ zoom: V(X),
4060
+ "active-item-id": K.value,
4061
+ onClose: n[18] ||= (e) => U.value = !1,
4062
+ onAddComment: V(gt),
4063
+ onCancelAddComment: V(_t),
4064
+ onCommentReply: V(fn),
4065
+ onCommentResolve: V(pn),
4066
+ onCommentUnresolve: V(gn),
4067
+ onCommentDelete: V(_n),
4068
+ onAcceptChange: V(yn),
4069
+ onRejectChange: V(bn),
4070
+ onAcceptChangeById: V(xn),
4071
+ onRejectChangeById: V(Sn),
4072
+ onTrackedChangeReply: V(Cn),
4073
+ "onUpdate:activeItemId": n[19] ||= (e) => K.value = e
4011
4074
  }, null, 8, [
4012
4075
  "is-open",
4013
4076
  "comments",
@@ -4030,14 +4093,14 @@ var gi = { class: "docx-editor-vue__toolbar-shell" }, _i = {
4030
4093
  "onRejectChangeById",
4031
4094
  "onTrackedChangeReply"
4032
4095
  ]),
4033
- M(Ur, {
4034
- data: U(Ot),
4035
- "read-only": s.value,
4036
- onNavigate: U(Mt),
4037
- onCopy: n[21] ||= (e) => Ot.value = null,
4038
- onEdit: U(Nt),
4039
- onRemove: U(Pt),
4040
- onClose: n[22] ||= (e) => Ot.value = null
4096
+ M($r, {
4097
+ data: V(kt),
4098
+ "read-only": c.value,
4099
+ onNavigate: V(Mt),
4100
+ onCopy: n[20] ||= (e) => kt.value = null,
4101
+ onEdit: V(Nt),
4102
+ onRemove: V(Ft),
4103
+ onClose: n[21] ||= (e) => kt.value = null
4041
4104
  }, null, 8, [
4042
4105
  "data",
4043
4106
  "read-only",
@@ -4046,55 +4109,63 @@ var gi = { class: "docx-editor-vue__toolbar-shell" }, _i = {
4046
4109
  "onRemove"
4047
4110
  ])
4048
4111
  ], 544),
4049
- !W.value && e.showOutlineButton ? (R(), k("button", {
4112
+ !H.value && e.showOutlineButton ? (L(), A("button", {
4050
4113
  key: 0,
4051
4114
  type: "button",
4052
4115
  class: "docx-editor-vue__outline-toggle",
4053
4116
  title: "Show document outline",
4054
- onClick: n[29] ||= (...e) => U(nn) && U(nn)(...e),
4055
- onMousedown: n[30] ||= J(() => {}, ["stop"])
4056
- }, [M(c, {
4117
+ onClick: n[28] ||= (...e) => V(nn) && V(nn)(...e),
4118
+ onMousedown: n[29] ||= q(() => {}, ["stop"])
4119
+ }, [M(r, {
4057
4120
  name: "format_list_bulleted",
4058
4121
  size: 20
4059
- })], 32)) : O("", !0),
4060
- U(Pn).totalPages > 1 ? (R(), ie(on, {
4122
+ })], 32)) : k("", !0),
4123
+ V(Pn).totalPages > 1 ? (L(), O(hn, {
4061
4124
  key: 1,
4062
- "current-page": U(Pn).currentPage,
4063
- "total-pages": U(Pn).totalPages,
4064
- visible: U(Pn).visible
4125
+ "current-page": V(Pn).currentPage,
4126
+ "total-pages": V(Pn).totalPages,
4127
+ visible: V(Pn).visible
4065
4128
  }, null, 8, [
4066
4129
  "current-page",
4067
4130
  "total-pages",
4068
4131
  "visible"
4069
- ])) : O("", !0),
4070
- M(an, {
4071
- "is-open": W.value,
4072
- headings: _e.value,
4073
- onClose: n[31] ||= (e) => W.value = !1,
4074
- onNavigate: U(rn)
4132
+ ])) : k("", !0),
4133
+ M(mn, {
4134
+ "is-open": H.value,
4135
+ headings: ge.value,
4136
+ onClose: n[30] ||= (e) => H.value = !1,
4137
+ onNavigate: V(rn)
4075
4138
  }, null, 8, [
4076
4139
  "is-open",
4077
4140
  "headings",
4078
4141
  "onNavigate"
4079
4142
  ])
4080
4143
  ])], 32),
4081
- A("input", {
4144
+ j("input", {
4082
4145
  ref_key: "docxInputRef",
4083
- ref: xt,
4146
+ ref: bt,
4084
4147
  type: "file",
4085
4148
  accept: ".docx,application/vnd.openxmlformats-officedocument.wordprocessingml.document",
4086
4149
  style: { display: "none" },
4087
- onChange: n[33] ||= (...e) => U(St) && U(St)(...e)
4150
+ onChange: n[32] ||= (...e) => V(Ct) && V(Ct)(...e)
4151
+ }, null, 544),
4152
+ j("input", {
4153
+ ref_key: "imageInputRef",
4154
+ ref: xt,
4155
+ type: "file",
4156
+ accept: "image/*",
4157
+ style: { display: "none" },
4158
+ onChange: n[33] ||= (...e) => V(St) && V(St)(...e)
4088
4159
  }, null, 544),
4089
- M(Nr, {
4090
- "read-only": s.value,
4091
- "context-menu": U(Kn),
4092
- "image-context-menu": U(qn),
4093
- "image-context-menu-text-actions": U(Jn),
4094
- "can-open-image-properties": !!U(Tn),
4095
- onContextMenuAction: U(Qn),
4096
- onCloseContextMenu: n[34] ||= (e) => U(Kn).isOpen = !1,
4097
- onImageWrapSelect: U(Zn),
4160
+ M(Ur, {
4161
+ "read-only": c.value,
4162
+ "context-menu": V(Kn),
4163
+ "image-context-menu": V(qn),
4164
+ "image-context-menu-text-actions": V(Jn),
4165
+ "can-open-image-properties": !!V(Tn),
4166
+ onContextMenuAction: V(Qn),
4167
+ onCloseContextMenu: n[34] ||= (e) => V(Kn).isOpen = !1,
4168
+ onImageWrapSelect: V(Zn),
4098
4169
  onCloseImageContextMenu: n[35] ||= (e) => qn.value = null,
4099
4170
  onOpenImageProperties: n[36] ||= (e) => N.value = !0
4100
4171
  }, null, 8, [
@@ -4111,8 +4182,8 @@ var gi = { class: "docx-editor-vue__toolbar-shell" }, _i = {
4111
4182
  });
4112
4183
  //#endregion
4113
4184
  //#region src/renderAsync.ts
4114
- async function wi(e, t, n = {}) {
4115
- let r = e instanceof ArrayBuffer ? e : await ze(e), i = null, a = null, o = !1, s = {
4185
+ async function Pi(e, t, n = {}) {
4186
+ let r = e instanceof ArrayBuffer ? e : await Ve(e), i = null, a = null, o = !1, s = {
4116
4187
  save: async () => {
4117
4188
  let e = await (i?.save() ?? Promise.resolve(null));
4118
4189
  return e ? new Blob([e], { type: "application/vnd.openxmlformats-officedocument.wordprocessingml.document" }) : null;
@@ -4133,8 +4204,8 @@ async function wi(e, t, n = {}) {
4133
4204
  }
4134
4205
  };
4135
4206
  return new Promise((e, c) => {
4136
- a = re({ setup() {
4137
- return () => se(Ci, {
4207
+ a = D({ setup() {
4208
+ return () => oe(Ni, {
4138
4209
  ...n,
4139
4210
  documentBuffer: r,
4140
4211
  showToolbar: n.showToolbar ?? !0,
@@ -4158,6 +4229,6 @@ async function wi(e, t, n = {}) {
4158
4229
  }
4159
4230
  //#endregion
4160
4231
  //#region src/index.ts
4161
- var Ti = "0.0.2";
4232
+ var Fi = "0.0.2";
4162
4233
  //#endregion
4163
- export { Ci as DocxEditor, Ti as VERSION, Rt as createDocumentWithText, zt as createEmptyDocument, r as defaultLocale, a as i18nPlugin, f as provideLocale, wi as renderAsync, n as useTranslation };
4234
+ export { Ni as DocxEditor, Fi as VERSION, Wt as createDocumentWithText, Gt as createEmptyDocument, n as defaultLocale, t as i18nPlugin, a as provideLocale, Pi as renderAsync, d as useTranslation };