@eigenpal/docx-editor-vue 1.3.3 → 1.4.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
@@ -3,40 +3,40 @@ import { a as p, c as m, h, i as g, o as _, s as v, t as y, x as b } from "./Men
3
3
  import { t as x } from "./_plugin-vue_export-helper-B52Kst-M.js";
4
4
  import { n as S } from "./RenderedDomContext-CHc18N_2.js";
5
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-BB_IHM8f.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 se, createVNode as j, defineComponent as M, h as ce, isRef as le, nextTick as ue, normalizeClass as N, normalizeStyle as P, onBeforeUnmount as F, onMounted as I, openBlock as L, ref as R, renderList as de, renderSlot as fe, resolveDynamicComponent as pe, shallowRef as z, toDisplayString as B, unref as V, vModelCheckbox as me, vModelSelect as he, vModelText as H, watch as U, withCtx as ge, withDirectives as W, withKeys as G, withModifiers as K } from "vue";
8
- import { NodeSelection as q, TextSelection as J } from "prosemirror-state";
9
- import { applyCellSelectionHighlight as _e, clickToPositionDom as ve, computeHfCaretRectFromView as ye, computeHfSelectionRectsFromView as be, findBodyPmAnchor as Y, findBodyPmSpans as xe } from "@eigenpal/docx-editor-core/layout-bridge";
10
- import { findInDocument as Se, getPageContent as Ce, getSelectionInfo as we } from "@eigenpal/docx-editor-core/prosemirror/queries";
11
- import { LayoutSelectionGate as Te, addRepeatingSectionItemTr as Ee, extractSelectionState as De, findContentControlPos as Oe, findContentControlsInPM as ke, removeContentControlTr as Ae, removeRepeatingSectionItemTr as je, schema as Me, setContentControlContentTr as Ne, setContentControlValueTr as X } from "@eigenpal/docx-editor-core/prosemirror";
12
- import { SIDEBAR_DOCUMENT_SHIFT as Pe, findWordBoundaries as Fe, loadFontDefinitions as Ie, onFontError as Le, pixelsToEmu as Re, readDocxFileFromInput as ze, toArrayBuffer as Be } from "@eigenpal/docx-editor-core/utils";
13
- import { extractSelectionContext as Ve } from "@eigenpal/docx-editor-core/prosemirror/plugins/selectionTracker";
14
- import { clearFormatting as He, findHyperlinkRangeAt as Ue } from "@eigenpal/docx-editor-core/prosemirror/commands/formatting";
15
- import { getTableContext as Z } from "@eigenpal/docx-editor-core/prosemirror/extensions/nodes/TableExtension";
16
- import { clickToPositionDom as We, getCaretPositionFromDom as Ge, getSelectionRectsFromDom as Ke } from "@eigenpal/docx-editor-core/layout-bridge/clickToPositionDom";
17
- import { 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 Q, isImageLayoutOptionEnabled as et, renderAllPagesNow as tt, toolbarValueToLayoutTarget as nt } from "@eigenpal/docx-editor-core/layout-painter";
19
- import { proseDocToBlocks as rt } from "@eigenpal/docx-editor-core/prosemirror/conversion";
20
- import { twipsToPixels as it } from "@eigenpal/docx-editor-core/utils/units";
21
- import { pictureWatermarkDisplayEmu as at } from "@eigenpal/docx-editor-core/types/document";
22
- import { makeRevisionInfo as ot } from "@eigenpal/docx-editor-core/prosemirror/plugins";
23
- import { findPageIndexContainingPmPos as st } from "@eigenpal/docx-editor-core/layout-engine";
24
- import { applyStyle as ct, removeTabStop as lt, setIndentFirstLine as ut, setIndentLeft as dt, setIndentRight as ft } from "@eigenpal/docx-editor-core/prosemirror/commands/paragraph";
25
- import { createStyleResolver as pt } from "@eigenpal/docx-editor-core/prosemirror/styles";
26
- import { insertPageBreak as mt } from "@eigenpal/docx-editor-core/prosemirror/commands/pageBreak";
27
- import { applyFormatting as ht, setParagraphStyle as gt } from "@eigenpal/docx-editor-core/prosemirror/applyFormatting";
28
- import { acceptChange as _t, acceptChangeById as vt, getWatermarkFromState as yt, insertImageNode as bt, rejectChange as xt, rejectChangeById as St, setWatermark as Ct } from "@eigenpal/docx-editor-core/prosemirror/commands";
29
- import { collectHeadings as wt } from "@eigenpal/docx-editor-core/utils/headingCollector";
30
- import { addCommentToRange as Tt, applyProposedChange as Et, createComment as Dt } from "@eigenpal/docx-editor-core/prosemirror/commentOps";
31
- import { PENDING_COMMENT_ID as Ot, createCommentIdAllocator as kt, seedCommentAllocator as At } from "@eigenpal/docx-editor-core/prosemirror/commentIdAllocator";
32
- import { extractTrackedChanges as jt } from "@eigenpal/docx-editor-core/prosemirror/utils/extractTrackedChanges";
33
- import { TABLE_INSERT_HIDE_DELAY_MS as Mt, detectTableInsertHover as Nt } from "@eigenpal/docx-editor-core/layout-bridge/tableInsertHover";
34
- import { openReportIssue as Pt } from "@eigenpal/docx-editor-core/utils/reportIssue";
35
- import { ContentControlNotFoundError as Ft } from "@eigenpal/docx-editor-core/agent";
36
- import { findParaIdRange as It } from "@eigenpal/docx-editor-core/prosemirror/paraText";
37
- import { createDocumentWithText as Lt, createEmptyDocument as Rt } from "@eigenpal/docx-editor-core";
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";
38
38
  //#region src/utils/domQueries.ts
39
- function zt(e) {
39
+ function Bt(e) {
40
40
  let t = window.document.querySelectorAll(`.layout-page-${e}`);
41
41
  if (t.length === 0) return null;
42
42
  let n = window.innerHeight / 2, r = t[0], i = Infinity;
@@ -46,18 +46,18 @@ function zt(e) {
46
46
  }
47
47
  return r;
48
48
  }
49
- function Bt(e, t, n) {
50
- let r = n ? Array.from(e.querySelectorAll(`.layout-page-${n} span[data-pm-start][data-pm-end]`)) : xe(e);
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
51
  for (let e of r) {
52
52
  let n = Number(e.dataset.pmStart), r = Number(e.dataset.pmEnd);
53
53
  if (!isNaN(n) && !isNaN(r) && t >= n && t <= r) return e;
54
54
  }
55
55
  return null;
56
56
  }
57
- function Vt(e, t, n) {
57
+ function Ht(e, t, n) {
58
58
  if (!e || !t) return;
59
59
  let r = null;
60
- for (let t of xe(e)) {
60
+ for (let t of be(e)) {
61
61
  let e = Number(t.dataset.pmStart), i = Number(t.dataset.pmEnd);
62
62
  if (Number.isFinite(e) && Number.isFinite(i) && n >= e && n <= i) {
63
63
  r = t;
@@ -71,21 +71,21 @@ function Vt(e, t, n) {
71
71
  behavior: "smooth"
72
72
  });
73
73
  }
74
- function Ht(e, t, n, r) {
74
+ function Ut(e, t, n, r) {
75
75
  if (!e || !t) return null;
76
- let i = ve(e, n, r, 1);
76
+ let i = _e(e, n, r, 1);
77
77
  return i === null || i < 0 ? null : Math.min(i, t.state.doc.content.size);
78
78
  }
79
- function Ut(e, t, n, r) {
79
+ function Wt(e, t, n, r) {
80
80
  if (!e) return;
81
- let i = Bt(e, t, r);
81
+ let i = Vt(e, t, r);
82
82
  if (!i) return;
83
- let a = i.textContent || "", o = Number(i.dataset.pmStart) || 0, [s, c] = Fe(a, t - o), l = o + s, u = o + c;
83
+ let a = i.textContent || "", o = Number(i.dataset.pmStart) || 0, [s, c] = Pe(a, t - o), l = o + s, u = o + c;
84
84
  l < u && n(l, u);
85
85
  }
86
- function Wt(e, t, n, r) {
86
+ function Gt(e, t, n, r) {
87
87
  if (!e) return;
88
- let i = Bt(e, t, r);
88
+ let i = Vt(e, t, r);
89
89
  if (!i) return;
90
90
  let a = i.closest(".layout-paragraph");
91
91
  if (!a) return;
@@ -94,7 +94,7 @@ function Wt(e, t, n, r) {
94
94
  }
95
95
  //#endregion
96
96
  //#region src/components/DecorationLayer.vue
97
- var Gt = /* @__PURE__ */ M({
97
+ var Kt = /* @__PURE__ */ N({
98
98
  __name: "DecorationLayer",
99
99
  props: {
100
100
  getView: { type: Function },
@@ -104,7 +104,7 @@ var Gt = /* @__PURE__ */ M({
104
104
  syncCoordinator: {}
105
105
  },
106
106
  setup(e) {
107
- let t = e, n = R(null), r = R(0), i = null, a = null;
107
+ let t = e, n = z(null), r = z(0), i = null, a = null;
108
108
  function o() {
109
109
  i !== null && cancelAnimationFrame(i), i = requestAnimationFrame(() => {
110
110
  i = null;
@@ -112,13 +112,13 @@ var Gt = /* @__PURE__ */ M({
112
112
  !e || !r || !a || t.syncCoordinator.isSafeToRender() && s(e, r, a, t.zoom);
113
113
  });
114
114
  }
115
- I(() => {
115
+ L(() => {
116
116
  a = t.syncCoordinator.onRender(() => {
117
117
  r.value++;
118
118
  }), o();
119
- }), F(() => {
119
+ }), I(() => {
120
120
  i !== null && (cancelAnimationFrame(i), i = null), a?.();
121
- }), U(() => [
121
+ }), K(() => [
122
122
  t.zoom,
123
123
  t.transactionVersion,
124
124
  r.value
@@ -179,20 +179,20 @@ var Gt = /* @__PURE__ */ M({
179
179
  function u(e) {
180
180
  return e.type?.attrs ?? null;
181
181
  }
182
- return (e, t) => (L(), k("div", {
182
+ return (e, t) => (R(), k("div", {
183
183
  ref_key: "overlayRef",
184
184
  ref: n,
185
185
  class: "paged-editor__decoration-overlay",
186
186
  "aria-hidden": "true"
187
187
  }, null, 512));
188
188
  }
189
- }), Kt = ["data-handle", "onMousedown"], qt = ["title"], Jt = {
189
+ }), qt = ["data-handle", "onMousedown"], Jt = ["title"], Yt = {
190
190
  key: 0,
191
191
  class: "image-overlay__dim"
192
- }, Yt = {
192
+ }, Xt = {
193
193
  key: 1,
194
194
  class: "image-overlay__dim image-overlay__dim--rotate"
195
- }, Xt = 4, Zt = 15, Qt = /* @__PURE__ */ x(/* @__PURE__ */ M({
195
+ }, Zt = 4, Qt = 15, $t = /* @__PURE__ */ x(/* @__PURE__ */ N({
196
196
  __name: "ImageSelectionOverlay",
197
197
  props: {
198
198
  imageInfo: {},
@@ -206,7 +206,7 @@ var Gt = /* @__PURE__ */ M({
206
206
  "context-menu"
207
207
  ],
208
208
  setup(e, { emit: t }) {
209
- let { t: r } = n(), i = e, a = t, o = R(null), s = R(!1), c = R(!1), l = R(!1), u = R(0), d = R(0), f = R(0), p = R(null), m = "se", h = 0, g = 0, _ = 0, v = 0, y = null, b = null, x = null, S = null;
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;
210
210
  function ee(e, t) {
211
211
  if (!e) return null;
212
212
  try {
@@ -225,8 +225,8 @@ var Gt = /* @__PURE__ */ M({
225
225
  if (e.element.isConnected) return e.element;
226
226
  let t = te();
227
227
  if (!t) return null;
228
- let n = Y(t, e.pmPos);
229
- return n ? Q(n) : null;
228
+ let n = X(t, e.pmPos);
229
+ return n ? et(n) : null;
230
230
  }
231
231
  function w() {
232
232
  let e = ne();
@@ -247,9 +247,9 @@ var Gt = /* @__PURE__ */ M({
247
247
  height: r.height / a
248
248
  };
249
249
  }
250
- U(() => i.imageInfo, async () => {
251
- await ue(), w();
252
- }, { immediate: !0 }), U(() => i.zoom, (e, t, n) => {
250
+ K(() => i.imageInfo, async () => {
251
+ await le(), w();
252
+ }, { immediate: !0 }), K(() => i.zoom, (e, t, n) => {
253
253
  if (!i.imageInfo) return;
254
254
  let r = 0, a = "", o = 0, s = 0, c = (e) => {
255
255
  w();
@@ -257,7 +257,7 @@ var Gt = /* @__PURE__ */ M({
257
257
  o = n === a ? o + 1 : 0, a = n, s += e, o < 2 && s < 500 && (r = requestAnimationFrame(() => c(16)));
258
258
  };
259
259
  r = requestAnimationFrame(() => c(16)), n(() => cancelAnimationFrame(r));
260
- }), U(() => i.imageInfo, (e, t, n) => {
260
+ }), K(() => i.imageInfo, (e, t, n) => {
261
261
  if (!i.imageInfo) return;
262
262
  let r = () => {
263
263
  b && cancelAnimationFrame(b), b = requestAnimationFrame(w);
@@ -355,23 +355,12 @@ var Gt = /* @__PURE__ */ M({
355
355
  }
356
356
  }
357
357
  ];
358
- }), oe = (e) => e.length === 2;
359
- function se(e, t, n, r, i, a) {
360
- let o = e.includes("w") ? -1 : +!!e.includes("e"), s = e.includes("n") ? -1 : +!!e.includes("s"), c = r + t * o, l = i + n * s;
361
- if (oe(e) && a) {
362
- let e = Math.max(c / r, l / i);
363
- c = r * e, l = i * e;
364
- }
365
- return {
366
- width: o === 0 ? r : Math.max(20, Math.min(2e3, c)),
367
- height: s === 0 ? i : Math.max(20, Math.min(2e3, l))
368
- };
369
- }
370
- function j(e, t) {
371
- !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", M), document.addEventListener("mouseup", ce));
358
+ });
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));
372
361
  }
373
- function M(e) {
374
- let t = i.zoom, n = (e.clientX - h) / t, r = (e.clientY - g) / t, a = !e.shiftKey, o = se(m, n, r, _, v, a);
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);
375
364
  u.value = Math.round(o.width), d.value = Math.round(o.height);
376
365
  let s = y;
377
366
  s && (p.value = {
@@ -381,76 +370,76 @@ var Gt = /* @__PURE__ */ M({
381
370
  height: s.height
382
371
  });
383
372
  }
384
- function ce() {
385
- document.removeEventListener("mousemove", M), document.removeEventListener("mouseup", ce), s.value = !1, y = null, a("interact-end");
373
+ function M() {
374
+ document.removeEventListener("mousemove", j), document.removeEventListener("mouseup", M), s.value = !1, y = null, a("interact-end");
386
375
  let e = i.view, t = i.imageInfo;
387
376
  if (!e || !t) {
388
377
  w();
389
378
  return;
390
379
  }
391
380
  let n = Ye(e, t.pmPos, u.value, d.value);
392
- n !== null && ye(n), ue(() => w());
381
+ n !== null && ge(n), le(() => w());
393
382
  }
394
- let le = 0, N = 0, I = 0, fe = 0, pe = null, z = null;
395
- function me(e) {
383
+ let N = 0, se = 0, ce = 0, P = 0, L = null, V = null;
384
+ function ue(e) {
396
385
  if (!e) return 0;
397
386
  let t = e.match(/rotate\((-?\d+(?:\.\d+)?)deg\)/);
398
387
  return t ? parseFloat(t[1]) : 0;
399
388
  }
400
- function he(e, t) {
389
+ function de(e, t) {
401
390
  let n = /scaleX\(-1\)/.test(e || ""), r = /scaleY\(-1\)/.test(e || ""), i = [], a = (t % 360 + 360) % 360;
402
391
  return a !== 0 && i.push(`rotate(${a}deg)`), n && i.push("scaleX(-1)"), r && i.push("scaleY(-1)"), i.length > 0 ? i.join(" ") : null;
403
392
  }
404
- function H(e, t) {
405
- return Math.atan2(e - le, -(t - N)) * 180 / Math.PI;
393
+ function W(e, t) {
394
+ return Math.atan2(e - N, -(t - se)) * 180 / Math.PI;
406
395
  }
407
- function ge(e) {
396
+ function fe(e) {
408
397
  if (!i.imageInfo) return;
409
398
  let t = i.imageInfo.element.getBoundingClientRect();
410
- le = t.left + t.width / 2, N = t.top + t.height / 2;
399
+ N = t.left + t.width / 2, se = t.top + t.height / 2;
411
400
  let n = ee(i.view, i.imageInfo.pmPos);
412
- pe = n && n.attrs.transform || null, fe = me(pe), z = i.imageInfo.element.querySelector("img"), I = H(e.clientX, e.clientY), f.value = fe, l.value = !0, a("interact-start"), document.addEventListener("mousemove", W), document.addEventListener("mouseup", G);
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);
413
402
  }
414
- function W(e) {
415
- let t = H(e.clientX, e.clientY) - I, n = fe + t;
416
- e.shiftKey || (n = Math.round(n / Zt) * Zt), f.value = (n % 360 + 360) % 360, z && (z.style.transform = he(pe, f.value) || "");
403
+ 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) || "");
417
406
  }
418
- function G() {
419
- document.removeEventListener("mousemove", W), document.removeEventListener("mouseup", G), l.value = !1, a("interact-end");
407
+ function pe() {
408
+ document.removeEventListener("mousemove", G), document.removeEventListener("mouseup", pe), l.value = !1, a("interact-end");
420
409
  let e = i.view, t = i.imageInfo;
421
410
  try {
422
411
  let n = e && t ? ee(e, t.pmPos) : null;
423
412
  e && t && n && (e.dispatch(e.state.tr.setNodeMarkup(t.pmPos, void 0, {
424
413
  ...n.attrs,
425
- transform: he(n.attrs.transform, f.value)
426
- })), ye(t.pmPos));
414
+ transform: de(n.attrs.transform, f.value)
415
+ })), ge(t.pmPos));
427
416
  } catch {} finally {
428
- z && (z.style.transform = ""), z = null, pe = null;
417
+ V && (V.style.transform = ""), V = null, L = null;
429
418
  }
430
- ue(() => w());
419
+ le(() => w());
431
420
  }
432
- let J = null;
433
- function _e(e) {
421
+ let q = null;
422
+ function me(e) {
434
423
  if (!i.imageInfo || !p.value) return;
435
424
  let t = e.clientX, n = e.clientY, r = p.value, o = !1, s = (e) => {
436
425
  let s = e.clientX - t, l = e.clientY - n;
437
- if (!(!o && Math.sqrt(s * s + l * l) < Xt)) {
426
+ if (!(!o && Math.sqrt(s * s + l * l) < Zt)) {
438
427
  if (!o) {
439
- o = !0, c.value = !0, a("interact-start"), J = document.createElement("div"), J.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);";
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);";
440
429
  let e = i.zoom;
441
- J.style.width = `${r.width * e}px`, J.style.height = `${r.height * e}px`, document.body.appendChild(J);
430
+ q.style.width = `${r.width * e}px`, q.style.height = `${r.height * e}px`, document.body.appendChild(q);
442
431
  }
443
- if (J) {
432
+ if (q) {
444
433
  let t = i.zoom;
445
- J.style.left = `${e.clientX - r.width * t / 2}px`, J.style.top = `${e.clientY - r.height * t / 2}px`;
434
+ q.style.left = `${e.clientX - r.width * t / 2}px`, q.style.top = `${e.clientY - r.height * t / 2}px`;
446
435
  }
447
436
  }
448
437
  }, l = (e) => {
449
- document.removeEventListener("mousemove", s), document.removeEventListener("mouseup", l), x = null, S = null, J &&= (J.remove(), null), c.value = !1, o && (a("interact-end"), ve(e.clientX, e.clientY));
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));
450
439
  };
451
440
  x = s, S = l, document.addEventListener("mousemove", s), document.addEventListener("mouseup", l);
452
441
  }
453
- function ve(e, t) {
442
+ function he(e, t) {
454
443
  let n = i.view, r = i.imageInfo;
455
444
  if (!n || !r) return;
456
445
  let a = ee(n, r.pmPos);
@@ -467,65 +456,65 @@ var Gt = /* @__PURE__ */ M({
467
456
  }
468
457
  }
469
458
  if (s ||= a[a.length - 1].querySelector(".layout-page-content"), !s) return;
470
- let c = s.getBoundingClientRect(), l = i.zoom, u = Re((e - c.left) / l), d = Re((t - c.top) / l), f = qe(n, r.pmPos, u, d);
471
- f !== null && ye(f);
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);
472
461
  } else {
473
462
  let i = te();
474
463
  if (!i) return;
475
- let a = We(i, e, t, 1);
464
+ let a = Ue(i, e, t, 1);
476
465
  if (a == null || a < 0) return;
477
466
  let o = Je(n, r.pmPos, a);
478
- o !== null && ye(o);
467
+ o !== null && ge(o);
479
468
  }
480
- ue(() => w());
469
+ le(() => w());
481
470
  }
482
471
  }
483
- function ye(e) {
472
+ function ge(e) {
484
473
  let t = i.view;
485
474
  if (t) try {
486
- let n = q.create(t.state.doc, e);
475
+ let n = Y.create(t.state.doc, e);
487
476
  t.dispatch(t.state.tr.setSelection(n));
488
477
  } catch {}
489
478
  }
490
- return F(() => {
491
- document.removeEventListener("mousemove", M), document.removeEventListener("mouseup", ce), document.removeEventListener("mousemove", W), document.removeEventListener("mouseup", G), x && document.removeEventListener("mousemove", x), S && document.removeEventListener("mouseup", S), J &&= (J.remove(), null), b && cancelAnimationFrame(b);
492
- }), (t, n) => e.imageInfo ? (L(), k("div", {
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", {
493
482
  key: 0,
494
483
  ref_key: "overlayRootRef",
495
484
  ref: o,
496
485
  class: "image-overlay",
497
- style: P(ie.value),
498
- onMousedown: n[3] ||= K(() => {}, ["stop"])
486
+ style: F(ie.value),
487
+ onMousedown: n[3] ||= J(() => {}, ["stop"])
499
488
  }, [
500
489
  n[4] ||= A("div", { class: "image-overlay__border" }, null, -1),
501
490
  A("div", {
502
491
  class: "image-overlay__body",
503
- style: P({ cursor: c.value ? "grabbing" : "grab" }),
504
- onMousedown: n[0] ||= K((e) => _e(e), ["prevent", "stop"]),
505
- onContextmenu: n[1] ||= K((e) => t.$emit("context-menu", e), ["prevent", "stop"])
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"])
506
495
  }, null, 36),
507
- (L(!0), k(T, null, de(ae.value, (e) => (L(), k("div", {
496
+ (R(!0), k(T, null, B(ae.value, (e) => (R(), k("div", {
508
497
  key: e.pos,
509
498
  class: "image-overlay__handle",
510
- style: P(e.style),
499
+ style: F(e.style),
511
500
  "data-handle": e.pos,
512
- onMousedown: K((t) => j(t, e.pos), ["prevent", "stop"])
513
- }, null, 44, Kt))), 128)),
501
+ onMousedown: J((t) => oe(t, e.pos), ["prevent", "stop"])
502
+ }, null, 44, qt))), 128)),
514
503
  n[5] ||= A("div", { class: "image-overlay__rotate-line" }, null, -1),
515
504
  A("div", {
516
505
  class: "image-overlay__rotate-handle",
517
- style: P({ left: `${E.value / 2 - 7}px` }),
518
- title: V(r)("imageOverlay.rotate"),
519
- onMousedown: n[2] ||= K((e) => ge(e), ["prevent", "stop"])
520
- }, null, 44, qt),
521
- s.value ? (L(), k("div", Jt, B(Math.round(u.value)) + " × " + B(Math.round(d.value)), 1)) : O("", !0),
522
- l.value ? (L(), k("div", Yt, B(Math.round(f.value)) + "° ", 1)) : O("", !0)
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)
523
512
  ], 36)) : O("", !0);
524
513
  }
525
- }), [["__scopeId", "data-v-df7c380c"]]), $t = { class: "doc-outline__header" }, en = { class: "doc-outline__body" }, tn = {
514
+ }), [["__scopeId", "data-v-503209ad"]]), en = { class: "doc-outline__header" }, tn = { class: "doc-outline__body" }, nn = {
526
515
  key: 0,
527
516
  class: "doc-outline__empty"
528
- }, nn = ["onMousedown"], rn = /* @__PURE__ */ x(/* @__PURE__ */ M({
517
+ }, rn = ["onMousedown"], an = /* @__PURE__ */ x(/* @__PURE__ */ N({
529
518
  __name: "DocumentOutline",
530
519
  props: {
531
520
  isOpen: { type: Boolean },
@@ -533,28 +522,28 @@ var Gt = /* @__PURE__ */ M({
533
522
  },
534
523
  emits: ["close", "navigate"],
535
524
  setup(e) {
536
- return (t, n) => e.isOpen ? (L(), k("nav", {
525
+ return (t, n) => e.isOpen ? (R(), k("nav", {
537
526
  key: 0,
538
527
  class: "doc-outline",
539
528
  role: "navigation",
540
529
  "aria-label": "Document outline",
541
- onMousedown: n[1] ||= K(() => {}, ["stop"])
542
- }, [A("div", $t, [A("button", {
530
+ onMousedown: n[1] ||= J(() => {}, ["stop"])
531
+ }, [A("div", en, [A("button", {
543
532
  class: "doc-outline__back",
544
533
  title: "Close outline",
545
534
  "aria-label": "Close outline",
546
535
  onClick: n[0] ||= (e) => t.$emit("close")
547
- }, [j(c, {
536
+ }, [M(c, {
548
537
  name: "arrow_back",
549
538
  size: 20
550
- })]), n[2] ||= A("span", { class: "doc-outline__title" }, "Document Outline", -1)]), A("div", en, [e.headings.length === 0 ? (L(), k("div", tn, " No headings found ")) : O("", !0), (L(!0), k(T, null, de(e.headings, (e, n) => (L(), k("button", {
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", {
551
540
  key: n,
552
541
  class: "doc-outline__item",
553
- style: P({ paddingLeft: 12 + (e.level - 1) * 16 + "px" }),
554
- onMousedown: K((n) => t.$emit("navigate", e.pmPos), ["prevent"])
555
- }, B(e.text || "(untitled)"), 45, nn))), 128))])], 32)) : O("", !0);
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);
556
545
  }
557
- }), [["__scopeId", "data-v-cb2cdc39"]]), an = /* @__PURE__ */ x(/* @__PURE__ */ M({
546
+ }), [["__scopeId", "data-v-cb2cdc39"]]), on = /* @__PURE__ */ x(/* @__PURE__ */ N({
558
547
  __name: "PageIndicator",
559
548
  props: {
560
549
  currentPage: {},
@@ -563,20 +552,20 @@ var Gt = /* @__PURE__ */ M({
563
552
  },
564
553
  setup(e) {
565
554
  let { t } = n();
566
- return (n, r) => (L(), k("div", {
555
+ return (n, r) => (R(), k("div", {
567
556
  class: "docx-editor-vue__page-indicator",
568
- style: P({ opacity: +!!e.visible }),
557
+ style: F({ opacity: +!!e.visible }),
569
558
  "aria-live": "polite",
570
559
  role: "status"
571
- }, B(V(t)("viewer.pageIndicator", {
560
+ }, H(U(t)("viewer.pageIndicator", {
572
561
  current: e.currentPage,
573
562
  total: e.totalPages
574
563
  })), 5));
575
564
  }
576
- }), [["__scopeId", "data-v-d117bf6e"]]), on = { class: "hf-editor__label" }, sn = {
565
+ }), [["__scopeId", "data-v-d117bf6e"]]), sn = { class: "hf-editor__label" }, cn = {
577
566
  class: "hf-editor__actions",
578
567
  style: { position: "relative" }
579
- }, cn = /* @__PURE__ */ x(/* @__PURE__ */ M({
568
+ }, ln = /* @__PURE__ */ x(/* @__PURE__ */ N({
580
569
  __name: "InlineHeaderFooterEditor",
581
570
  props: {
582
571
  isOpen: { type: Boolean },
@@ -590,11 +579,11 @@ var Gt = /* @__PURE__ */ M({
590
579
  "remove"
591
580
  ],
592
581
  setup(e, { emit: t }) {
593
- let n = e, r = t, i = R({}), a = R(!1);
582
+ let n = e, r = t, i = z({}), a = z(!1);
594
583
  function o(e) {
595
584
  let t = n.view;
596
585
  if (!t) return;
597
- let { $from: r, from: i } = t.state.selection, a = t.state.storedMarks || r.marks(), o = Me.nodes.field.create({
586
+ let { $from: r, from: i } = t.state.selection, a = t.state.storedMarks || r.marks(), o = je.nodes.field.create({
598
587
  fieldType: e,
599
588
  instruction: ` ${e} \\* MERGEFORMAT `,
600
589
  fieldKind: "simple",
@@ -614,34 +603,34 @@ var Gt = /* @__PURE__ */ M({
614
603
  pointerEvents: "none"
615
604
  });
616
605
  }
617
- U(() => n.isOpen, (e) => {
606
+ K(() => n.isOpen, (e) => {
618
607
  e && (s(), n.view?.focus());
619
- }), U(() => n.targetRect, () => {
608
+ }), K(() => n.targetRect, () => {
620
609
  n.isOpen && s();
621
610
  }, { deep: !0 });
622
611
  function c() {
623
- n.view && (r("save", rt(n.view.state.doc)), r("close"));
612
+ n.view && (r("save", it(n.view.state.doc)), r("close"));
624
613
  }
625
- return (t, n) => e.isOpen ? (L(), k("div", {
614
+ return (t, n) => e.isOpen ? (R(), k("div", {
626
615
  key: 0,
627
616
  class: "hf-editor",
628
- style: P(i.value)
617
+ style: F(i.value)
629
618
  }, [A("div", {
630
- class: N(["hf-editor__toolbar", e.position === "footer" ? "hf-editor__toolbar--below" : "hf-editor__toolbar--above"]),
631
- onMousedown: n[8] ||= K(() => {}, ["stop"]),
632
- onContextmenu: n[9] ||= K(() => {}, ["stop"])
633
- }, [A("span", on, B(e.position === "header" ? "Header" : "Footer"), 1), A("div", sn, [
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, [
634
623
  A("button", {
635
624
  class: "hf-editor__btn",
636
625
  title: "Options",
637
- onMousedown: n[0] ||= K(() => {}, ["prevent"]),
626
+ onMousedown: n[0] ||= J(() => {}, ["prevent"]),
638
627
  onClick: n[1] ||= (e) => a.value = !a.value
639
628
  }, " Options ▾ ", 32),
640
- a.value ? (L(), k("div", {
629
+ a.value ? (R(), k("div", {
641
630
  key: 0,
642
631
  class: "hf-editor__dropdown",
643
- onMousedown: n[4] ||= K(() => {}, ["stop"]),
644
- onContextmenu: n[5] ||= K(() => {}, ["stop"])
632
+ onMousedown: n[4] ||= J(() => {}, ["stop"]),
633
+ onContextmenu: n[5] ||= J(() => {}, ["stop"])
645
634
  }, [A("button", {
646
635
  type: "button",
647
636
  class: "hf-editor__dropdown-item",
@@ -658,24 +647,24 @@ var Gt = /* @__PURE__ */ M({
658
647
  A("button", {
659
648
  class: "hf-editor__btn",
660
649
  title: "Remove",
661
- onMousedown: n[6] ||= K((e) => t.$emit("remove"), ["prevent"])
650
+ onMousedown: n[6] ||= J((e) => t.$emit("remove"), ["prevent"])
662
651
  }, " Remove ", 32),
663
652
  A("button", {
664
653
  class: "hf-editor__btn hf-editor__btn--primary",
665
654
  title: "Save",
666
- onMousedown: K(c, ["prevent"])
655
+ onMousedown: J(c, ["prevent"])
667
656
  }, " Save ", 32),
668
657
  A("button", {
669
658
  class: "hf-editor__btn",
670
659
  title: "Cancel",
671
- onMousedown: n[7] ||= K((e) => t.$emit("close"), ["prevent"])
660
+ onMousedown: n[7] ||= J((e) => t.$emit("close"), ["prevent"])
672
661
  }, " Cancel ", 32)
673
662
  ])], 34)], 4)) : O("", !0);
674
663
  }
675
- }), [["__scopeId", "data-v-e93a9f94"]]), ln = ["role"], un = {
664
+ }), [["__scopeId", "data-v-e93a9f94"]]), un = ["role"], dn = {
676
665
  key: 0,
677
666
  class: "layout-sdt-widget-empty"
678
- }, dn = ["aria-selected", "onClick"], fn = ["value"], pn = /* @__PURE__ */ M({
667
+ }, fn = ["aria-selected", "onClick"], pn = ["value"], mn = /* @__PURE__ */ N({
679
668
  __name: "ContentControlWidgets",
680
669
  props: {
681
670
  container: {},
@@ -686,18 +675,18 @@ var Gt = /* @__PURE__ */ M({
686
675
  let t = /^sdt@(\d+)$/.exec(e ?? "");
687
676
  return t ? Number(t[1]) : null;
688
677
  }
689
- let n = e, r = R(null), i = R(null);
678
+ let n = e, r = z(null), i = z(null);
690
679
  function a(e, t) {
691
680
  let i = n.view;
692
681
  if (i) try {
693
- i.dispatch(X(i.state, { tag: e }, t)), i.focus();
682
+ i.dispatch(Z(i.state, { tag: e }, t)), i.focus();
694
683
  } catch {}
695
684
  r.value = null;
696
685
  }
697
686
  function o(e) {
698
687
  let r = n.view, i = t(e.dataset.sdtGroupId);
699
688
  if (!(!r || i == null)) try {
700
- let t = e.dataset.sdtRepeat === "add" ? Ee(r.state, i) : je(r.state, i);
689
+ let t = e.dataset.sdtRepeat === "add" ? Te(r.state, i) : Ae(r.state, i);
701
690
  r.dispatch(t), r.focus();
702
691
  } catch {}
703
692
  }
@@ -708,7 +697,7 @@ var Gt = /* @__PURE__ */ M({
708
697
  function c(e) {
709
698
  let t = n.view, i = e.dataset.sdtTag, o = e.dataset.sdtWidget;
710
699
  if (!t || !i || !o) return;
711
- let s = ke(t.state.doc, { tag: i })[0], c = e.getBoundingClientRect();
700
+ let s = Oe(t.state.doc, { tag: i })[0], c = e.getBoundingClientRect();
712
701
  o === "checkbox" ? a(i, {
713
702
  kind: "checkbox",
714
703
  checked: !s?.checked
@@ -748,10 +737,10 @@ var Gt = /* @__PURE__ */ M({
748
737
  e.key === "Escape" && (r.value = null);
749
738
  }
750
739
  let p = null;
751
- U(() => n.container, (e) => {
740
+ K(() => n.container, (e) => {
752
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));
753
- }, { immediate: !0 }), U(r, (e) => {
754
- e ? (document.addEventListener("mousedown", d), document.addEventListener("keydown", f), e.kind === "dropdown" && ue(() => {
742
+ }, { immediate: !0 }), K(r, (e) => {
743
+ e ? (document.addEventListener("mousedown", d), document.addEventListener("keydown", f), e.kind === "dropdown" && le(() => {
755
744
  let e = i.value?.querySelectorAll(".layout-sdt-widget-option");
756
745
  e?.length && ([...e].find((e) => e.getAttribute("aria-selected") === "true") ?? e[0]).focus();
757
746
  })) : (document.removeEventListener("mousedown", d), document.removeEventListener("keydown", f));
@@ -764,7 +753,7 @@ var Gt = /* @__PURE__ */ M({
764
753
  let n = t.indexOf(document.activeElement);
765
754
  t[e.key === "ArrowDown" ? (n + 1) % t.length : (n - 1 + t.length) % t.length].focus();
766
755
  }
767
- F(() => {
756
+ I(() => {
768
757
  p && (p.removeEventListener("mousedown", s), p.removeEventListener("click", l), p.removeEventListener("keydown", u)), document.removeEventListener("mousedown", d), document.removeEventListener("keydown", f);
769
758
  });
770
759
  function h(e) {
@@ -774,42 +763,42 @@ var Gt = /* @__PURE__ */ M({
774
763
  date: t
775
764
  });
776
765
  }
777
- return (e, t) => r.value ? (L(), k("div", {
766
+ return (e, t) => r.value ? (R(), k("div", {
778
767
  key: 0,
779
768
  ref_key: "popupEl",
780
769
  ref: i,
781
770
  class: "layout-sdt-widget-popup",
782
771
  role: r.value.kind === "dropdown" ? "listbox" : void 0,
783
- style: P({
772
+ style: F({
784
773
  position: "fixed",
785
774
  top: r.value.y + "px",
786
775
  left: r.value.x + "px",
787
776
  zIndex: 1e3
788
777
  }),
789
778
  onKeydown: m,
790
- onMousedown: t[0] ||= K(() => {}, ["prevent"])
791
- }, [r.value.kind === "dropdown" ? (L(), k(T, { key: 0 }, [r.value.items.length === 0 ? (L(), k("div", un, "No options")) : O("", !0), (L(!0), k(T, null, de(r.value.items, (e) => (L(), k("button", {
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", {
792
781
  key: e.value,
793
782
  type: "button",
794
783
  role: "option",
795
784
  "aria-selected": e.displayText === r.value.current,
796
- class: N(["layout-sdt-widget-option", { "is-selected": e.displayText === r.value.current }]),
785
+ class: P(["layout-sdt-widget-option", { "is-selected": e.displayText === r.value.current }]),
797
786
  onClick: (t) => a(r.value.tag, {
798
787
  kind: "dropdown",
799
788
  value: e.value
800
789
  })
801
- }, B(e.displayText), 11, dn))), 128))], 64)) : (L(), k("input", {
790
+ }, H(e.displayText), 11, fn))), 128))], 64)) : (R(), k("input", {
802
791
  key: 1,
803
792
  type: "date",
804
793
  class: "layout-sdt-widget-date",
805
794
  value: r.value.current,
806
795
  onChange: h
807
- }, null, 40, fn))], 44, ln)) : O("", !0);
796
+ }, null, 40, pn))], 44, un)) : O("", !0);
808
797
  }
809
- }), mn = {
798
+ }), hn = {
810
799
  key: 0,
811
800
  class: "docx-editor-vue__title-bar"
812
- }, hn = { class: "docx-editor-vue__title-bar-left" }, gn = { class: "docx-editor-vue__title-bar-center" }, _n = { class: "docx-editor-vue__title-bar-right" }, vn = /* @__PURE__ */ M({
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({
813
802
  __name: "DocxEditorMenuBar",
814
803
  props: {
815
804
  showMenuBar: { type: Boolean },
@@ -828,38 +817,38 @@ var Gt = /* @__PURE__ */ M({
828
817
  ],
829
818
  setup(e, { emit: t }) {
830
819
  let n = t;
831
- return (t, r) => e.showMenuBar ? (L(), k("div", mn, [
832
- A("div", hn, [e.renderLogo ? (L(), ie(pe(e.renderLogo), { key: 0 })) : O("", !0), fe(t.$slots, "title-bar-left")]),
833
- A("div", gn, [j(g, {
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, {
834
823
  "model-value": e.documentName,
835
824
  editable: e.documentNameEditable,
836
825
  "onUpdate:modelValue": r[0] ||= (e) => n("rename", e)
837
- }, null, 8, ["model-value", "editable"]), j(y, {
826
+ }, null, 8, ["model-value", "editable"]), M(y, {
838
827
  onAction: r[1] ||= (e) => n("menu-action", e),
839
828
  onInsertTable: r[2] ||= (e, t) => n("insert-table", e, t)
840
829
  })]),
841
- A("div", _n, [fe(t.$slots, "title-bar-right"), e.renderTitleBarRight ? (L(), ie(pe(e.renderTitleBarRight), { key: 0 })) : O("", !0)])
830
+ A("div", vn, [V(t.$slots, "title-bar-right"), e.renderTitleBarRight ? (R(), ie(ue(e.renderTitleBarRight), { key: 0 })) : O("", !0)])
842
831
  ])) : O("", !0);
843
832
  }
844
- }), yn = ["aria-label"], bn = { class: "wm-header" }, xn = { class: "wm-body" }, Sn = { class: "wm-radio-row" }, Cn = ["checked"], wn = {
833
+ }), bn = ["aria-label"], xn = { class: "wm-header" }, Sn = { class: "wm-body" }, Cn = { class: "wm-radio-row" }, wn = ["checked"], Tn = {
845
834
  for: "wm-none",
846
835
  class: "wm-inline-label"
847
- }, Tn = { class: "wm-radio-row" }, En = ["checked"], Dn = {
836
+ }, En = { class: "wm-radio-row" }, Dn = ["checked"], On = {
848
837
  for: "wm-picture",
849
838
  class: "wm-inline-label"
850
- }, On = {
839
+ }, kn = {
851
840
  key: 0,
852
841
  class: "wm-subform"
853
- }, kn = { class: "wm-row" }, An = {
842
+ }, An = { class: "wm-row" }, jn = {
854
843
  key: 0,
855
844
  class: "wm-row"
856
- }, jn = ["src"], Mn = { class: "wm-row" }, $ = { class: "wm-label" }, Nn = { class: "wm-inline-label" }, Pn = { class: "wm-radio-row" }, Fn = ["checked"], In = {
845
+ }, Mn = ["src"], Nn = { class: "wm-row" }, $ = { class: "wm-label" }, Pn = { class: "wm-inline-label" }, Fn = { class: "wm-radio-row" }, In = ["checked"], Ln = {
857
846
  for: "wm-text",
858
847
  class: "wm-inline-label"
859
- }, Ln = {
848
+ }, Rn = {
860
849
  key: 1,
861
850
  class: "wm-subform"
862
- }, Rn = { class: "wm-row" }, zn = { class: "wm-label" }, Bn = ["value"], Vn = ["value"], Hn = { class: "wm-row" }, Un = { class: "wm-label" }, Wn = { class: "wm-row" }, Gn = { class: "wm-label" }, Kn = ["value"], qn = { class: "wm-row" }, Jn = { class: "wm-label" }, Yn = { class: "wm-inline-label" }, Xn = { class: "wm-row" }, Zn = { class: "wm-label" }, Qn = { class: "wm-row" }, $n = { class: "wm-label" }, er = { class: "wm-inline-label" }, tr = ["checked"], nr = { class: "wm-inline-label" }, rr = ["checked"], ir = { class: "wm-inline-label" }, ar = { class: "wm-footer" }, or = ["disabled"], sr = /* @__PURE__ */ x(/* @__PURE__ */ M({
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({
863
852
  __name: "WatermarkDialog",
864
853
  props: {
865
854
  isOpen: { type: Boolean },
@@ -881,8 +870,8 @@ var Gt = /* @__PURE__ */ M({
881
870
  "Georgia",
882
871
  "Verdana",
883
872
  "Courier New"
884
- ], { t: a } = n(), o = e, s = t, c = R("none"), l = R("CONFIDENTIAL"), u = R("Calibri"), d = 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);
885
- U(() => o.isOpen, (e) => {
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) => {
886
875
  if (!e) return;
887
876
  let t = o.current;
888
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 ? {
@@ -904,7 +893,7 @@ var Gt = /* @__PURE__ */ M({
904
893
  if (g.value = e, _.value = void 0, !e) return;
905
894
  let t = new Image();
906
895
  t.onload = () => {
907
- _.value = at(t.naturalWidth, t.naturalHeight);
896
+ _.value = ot(t.naturalWidth, t.naturalHeight);
908
897
  }, t.src = e;
909
898
  }, n.readAsDataURL(t);
910
899
  }
@@ -937,96 +926,96 @@ var Gt = /* @__PURE__ */ M({
937
926
  function te(e) {
938
927
  e.key === "Escape" && C();
939
928
  }
940
- return (t, n) => e.isOpen ? (L(), k("div", {
929
+ return (t, n) => e.isOpen ? (R(), k("div", {
941
930
  key: 0,
942
931
  class: "wm-overlay",
943
- onMousedown: K(C, ["self"]),
932
+ onMousedown: J(C, ["self"]),
944
933
  onKeydown: te
945
934
  }, [A("div", {
946
935
  class: "wm-dialog",
947
936
  role: "dialog",
948
- "aria-label": V(a)("dialogs.watermark.title"),
949
- onMousedown: n[13] ||= K(() => {}, ["stop"])
937
+ "aria-label": U(a)("dialogs.watermark.title"),
938
+ onMousedown: n[13] ||= J(() => {}, ["stop"])
950
939
  }, [
951
- A("div", bn, B(V(a)("dialogs.watermark.title")), 1),
952
- A("div", xn, [
953
- A("div", Sn, [A("input", {
940
+ A("div", xn, H(U(a)("dialogs.watermark.title")), 1),
941
+ A("div", Sn, [
942
+ A("div", Cn, [A("input", {
954
943
  id: "wm-none",
955
944
  type: "radio",
956
945
  checked: c.value === "none",
957
946
  onChange: n[0] ||= (e) => c.value = "none"
958
- }, null, 40, Cn), A("label", wn, B(V(a)("dialogs.watermark.noWatermark")), 1)]),
959
- A("div", Tn, [A("input", {
947
+ }, null, 40, wn), A("label", Tn, H(U(a)("dialogs.watermark.noWatermark")), 1)]),
948
+ A("div", En, [A("input", {
960
949
  id: "wm-picture",
961
950
  type: "radio",
962
951
  checked: c.value === "picture",
963
952
  onChange: n[1] ||= (e) => c.value = "picture"
964
- }, null, 40, En), A("label", Dn, B(V(a)("dialogs.watermark.picture")), 1)]),
965
- c.value === "picture" ? (L(), k("div", On, [
966
- A("div", kn, [A("input", {
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", {
967
956
  type: "file",
968
957
  accept: "image/*",
969
958
  onChange: S
970
959
  }, null, 32)]),
971
- g.value ? (L(), k("div", An, [A("img", {
960
+ g.value ? (R(), k("div", jn, [A("img", {
972
961
  src: g.value,
973
962
  alt: "",
974
963
  class: "wm-preview"
975
- }, null, 8, jn)])) : O("", !0),
976
- A("div", Mn, [
977
- A("span", $, B(V(a)("dialogs.watermark.scale")), 1),
978
- W(A("input", {
964
+ }, null, 8, Mn)])) : O("", !0),
965
+ A("div", Nn, [
966
+ A("span", $, H(U(a)("dialogs.watermark.scale")), 1),
967
+ q(A("input", {
979
968
  class: "wm-input wm-input--narrow",
980
969
  type: "number",
981
970
  min: "10",
982
971
  max: "500",
983
972
  "onUpdate:modelValue": n[2] ||= (e) => v.value = e
984
973
  }, null, 512), [[
985
- H,
974
+ G,
986
975
  v.value,
987
976
  void 0,
988
977
  { number: !0 }
989
978
  ]]),
990
979
  n[14] ||= A("span", { class: "wm-unit" }, "%", -1)
991
980
  ]),
992
- A("label", Nn, [W(A("input", {
981
+ A("label", Pn, [q(A("input", {
993
982
  type: "checkbox",
994
983
  "onUpdate:modelValue": n[3] ||= (e) => y.value = e
995
- }, null, 512), [[me, y.value]]), se(" " + B(V(a)("dialogs.watermark.washout")), 1)])
984
+ }, null, 512), [[W, y.value]]), j(" " + H(U(a)("dialogs.watermark.washout")), 1)])
996
985
  ])) : O("", !0),
997
- A("div", Pn, [A("input", {
986
+ A("div", Fn, [A("input", {
998
987
  id: "wm-text",
999
988
  type: "radio",
1000
989
  checked: c.value === "text",
1001
990
  onChange: n[4] ||= (e) => c.value = "text"
1002
- }, null, 40, Fn), A("label", In, B(V(a)("dialogs.watermark.text")), 1)]),
1003
- c.value === "text" ? (L(), k("div", Ln, [
1004
- A("div", Rn, [A("span", zn, B(V(a)("dialogs.watermark.presetLabel")), 1), A("select", {
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", {
1005
994
  class: "wm-input",
1006
995
  value: r.includes(l.value) ? l.value : "",
1007
996
  onChange: x
1008
- }, [n[15] ||= A("option", { value: "" }, "—", -1), (L(), k(T, null, de(r, (e) => A("option", {
997
+ }, [n[15] ||= A("option", { value: "" }, "—", -1), (R(), k(T, null, B(r, (e) => A("option", {
1009
998
  key: e,
1010
999
  value: e
1011
- }, B(e), 9, Vn)), 64))], 40, Bn)]),
1012
- A("div", Hn, [A("span", Un, B(V(a)("dialogs.watermark.textLabel")), 1), W(A("input", {
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", {
1013
1002
  class: "wm-input",
1014
1003
  "onUpdate:modelValue": n[5] ||= (e) => l.value = e
1015
- }, null, 512), [[H, l.value]])]),
1016
- A("div", Wn, [A("span", Gn, B(V(a)("dialogs.watermark.fontLabel")), 1), W(A("select", {
1004
+ }, null, 512), [[G, l.value]])]),
1005
+ A("div", Gn, [A("span", Kn, H(U(a)("dialogs.watermark.fontLabel")), 1), q(A("select", {
1017
1006
  class: "wm-input",
1018
1007
  "onUpdate:modelValue": n[6] ||= (e) => u.value = e
1019
- }, [(L(), k(T, null, de(i, (e) => A("option", {
1008
+ }, [(R(), k(T, null, B(i, (e) => A("option", {
1020
1009
  key: e,
1021
1010
  value: e
1022
- }, B(e), 9, Kn)), 64))], 512), [[he, u.value]])]),
1023
- A("div", qn, [
1024
- A("span", Jn, B(V(a)("dialogs.watermark.sizeLabel")), 1),
1025
- A("label", Yn, [W(A("input", {
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", {
1026
1015
  type: "checkbox",
1027
1016
  "onUpdate:modelValue": n[7] ||= (e) => d.value = e
1028
- }, null, 512), [[me, d.value]]), se(" " + B(V(a)("dialogs.watermark.sizeAuto")), 1)]),
1029
- d.value ? O("", !0) : W((L(), k("input", {
1017
+ }, null, 512), [[W, d.value]]), j(" " + H(U(a)("dialogs.watermark.sizeAuto")), 1)]),
1018
+ d.value ? O("", !0) : q((R(), k("input", {
1030
1019
  key: 0,
1031
1020
  class: "wm-input wm-input--narrow",
1032
1021
  type: "number",
@@ -1034,50 +1023,50 @@ var Gt = /* @__PURE__ */ M({
1034
1023
  max: "200",
1035
1024
  "onUpdate:modelValue": n[8] ||= (e) => f.value = e
1036
1025
  }, null, 512)), [[
1037
- H,
1026
+ G,
1038
1027
  f.value,
1039
1028
  void 0,
1040
1029
  { number: !0 }
1041
1030
  ]])
1042
1031
  ]),
1043
- A("div", Xn, [A("span", Zn, B(V(a)("dialogs.watermark.colorLabel")), 1), W(A("input", {
1032
+ A("div", Zn, [A("span", Qn, H(U(a)("dialogs.watermark.colorLabel")), 1), q(A("input", {
1044
1033
  type: "color",
1045
1034
  "onUpdate:modelValue": n[9] ||= (e) => p.value = e
1046
- }, null, 512), [[H, p.value]])]),
1047
- A("div", Qn, [
1048
- A("span", $n, B(V(a)("dialogs.watermark.layoutLabel")), 1),
1049
- A("label", er, [A("input", {
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", {
1050
1039
  type: "radio",
1051
1040
  name: "wm-layout",
1052
1041
  checked: m.value === "diagonal",
1053
1042
  onChange: n[10] ||= (e) => m.value = "diagonal"
1054
- }, null, 40, tr), se(" " + B(V(a)("dialogs.watermark.diagonal")), 1)]),
1055
- A("label", nr, [A("input", {
1043
+ }, null, 40, nr), j(" " + H(U(a)("dialogs.watermark.diagonal")), 1)]),
1044
+ A("label", rr, [A("input", {
1056
1045
  type: "radio",
1057
1046
  name: "wm-layout",
1058
1047
  checked: m.value === "horizontal",
1059
1048
  onChange: n[11] ||= (e) => m.value = "horizontal"
1060
- }, null, 40, rr), se(" " + B(V(a)("dialogs.watermark.horizontal")), 1)])
1049
+ }, null, 40, ir), j(" " + H(U(a)("dialogs.watermark.horizontal")), 1)])
1061
1050
  ]),
1062
- A("label", ir, [W(A("input", {
1051
+ A("label", ar, [q(A("input", {
1063
1052
  type: "checkbox",
1064
1053
  "onUpdate:modelValue": n[12] ||= (e) => h.value = e
1065
- }, null, 512), [[me, h.value]]), se(" " + B(V(a)("dialogs.watermark.semitransparent")), 1)])
1054
+ }, null, 512), [[W, h.value]]), j(" " + H(U(a)("dialogs.watermark.semitransparent")), 1)])
1066
1055
  ])) : O("", !0)
1067
1056
  ]),
1068
- A("div", ar, [A("button", {
1057
+ A("div", or, [A("button", {
1069
1058
  type: "button",
1070
1059
  class: "wm-btn",
1071
1060
  onClick: C
1072
- }, B(V(a)("dialogs.watermark.cancelButton")), 1), A("button", {
1061
+ }, H(U(a)("dialogs.watermark.cancelButton")), 1), A("button", {
1073
1062
  type: "button",
1074
- class: N(["wm-btn wm-btn--primary", { "wm-btn--disabled": b.value }]),
1063
+ class: P(["wm-btn wm-btn--primary", { "wm-btn--disabled": b.value }]),
1075
1064
  disabled: b.value,
1076
1065
  onClick: ee
1077
- }, B(V(a)("dialogs.watermark.applyButton")), 11, or)])
1078
- ], 40, yn)], 32)) : O("", !0);
1066
+ }, H(U(a)("dialogs.watermark.applyButton")), 11, sr)])
1067
+ ], 40, bn)], 32)) : O("", !0);
1079
1068
  }
1080
- }), [["__scopeId", "data-v-5edfdc47"]]), cr = /* @__PURE__ */ M({
1069
+ }), [["__scopeId", "data-v-5edfdc47"]]), lr = /* @__PURE__ */ N({
1081
1070
  __name: "DocxEditorDialogs",
1082
1071
  props: {
1083
1072
  view: {},
@@ -1113,8 +1102,8 @@ var Gt = /* @__PURE__ */ M({
1113
1102
  ],
1114
1103
  setup(t, { emit: n }) {
1115
1104
  let r = n;
1116
- return (n, a) => (L(), k(T, null, [
1117
- j(u, {
1105
+ return (n, a) => (R(), k(T, null, [
1106
+ M(u, {
1118
1107
  "is-open": t.showFindReplace,
1119
1108
  view: t.view,
1120
1109
  "scroll-visible-position-into-view": t.scrollVisiblePositionIntoView,
@@ -1124,12 +1113,12 @@ var Gt = /* @__PURE__ */ M({
1124
1113
  "view",
1125
1114
  "scroll-visible-position-into-view"
1126
1115
  ]),
1127
- j(s, {
1116
+ M(s, {
1128
1117
  "is-open": t.showInsertImage,
1129
1118
  onClose: a[1] ||= (e) => r("update:showInsertImage", !1),
1130
1119
  onInsert: a[2] ||= (e) => r("insert-image", e)
1131
1120
  }, null, 8, ["is-open"]),
1132
- j(e, {
1121
+ M(e, {
1133
1122
  "is-open": t.showHyperlink,
1134
1123
  view: t.view,
1135
1124
  bookmarks: t.bookmarks,
@@ -1141,12 +1130,12 @@ var Gt = /* @__PURE__ */ M({
1141
1130
  "view",
1142
1131
  "bookmarks"
1143
1132
  ]),
1144
- j(i, {
1133
+ M(i, {
1145
1134
  "is-open": t.showInsertSymbol,
1146
1135
  onClose: a[6] ||= (e) => r("update:showInsertSymbol", !1),
1147
1136
  onInsert: a[7] ||= (e) => r("insert-symbol", e)
1148
1137
  }, null, 8, ["is-open"]),
1149
- j(l, {
1138
+ M(l, {
1150
1139
  "is-open": t.showImageProperties,
1151
1140
  view: t.view,
1152
1141
  "pm-pos": t.selectedImagePmPos,
@@ -1156,28 +1145,28 @@ var Gt = /* @__PURE__ */ M({
1156
1145
  "view",
1157
1146
  "pm-pos"
1158
1147
  ]),
1159
- j(o, {
1148
+ M(o, {
1160
1149
  "is-open": t.showPageSetup,
1161
1150
  "section-properties": t.sectionProperties,
1162
1151
  onClose: a[9] ||= (e) => r("update:showPageSetup", !1),
1163
1152
  onApply: a[10] ||= (e) => r("page-setup-apply", e)
1164
1153
  }, null, 8, ["is-open", "section-properties"]),
1165
- j(sr, {
1154
+ M(cr, {
1166
1155
  "is-open": t.showWatermark,
1167
1156
  current: t.currentWatermark,
1168
1157
  onClose: a[11] ||= (e) => r("update:showWatermark", !1),
1169
1158
  onApply: a[12] ||= (e) => r("watermark-apply", e)
1170
1159
  }, null, 8, ["is-open", "current"]),
1171
- j(d, {
1160
+ M(d, {
1172
1161
  "is-open": t.showKeyboardShortcuts,
1173
1162
  onClose: a[13] ||= (e) => r("update:showKeyboardShortcuts", !1)
1174
1163
  }, null, 8, ["is-open"])
1175
1164
  ], 64));
1176
1165
  }
1177
- }), lr = ["disabled", "onMousedown"], ur = { class: "ctx-menu__label" }, dr = {
1166
+ }), ur = ["disabled", "onMousedown"], dr = { class: "ctx-menu__label" }, fr = {
1178
1167
  key: 0,
1179
1168
  class: "ctx-menu__shortcut"
1180
- }, fr = 220, pr = 32, mr = 10, hr = /* @__PURE__ */ x(/* @__PURE__ */ M({
1169
+ }, pr = 220, mr = 32, hr = 10, gr = /* @__PURE__ */ x(/* @__PURE__ */ N({
1181
1170
  __name: "TextContextMenu",
1182
1171
  props: {
1183
1172
  isOpen: { type: Boolean },
@@ -1191,7 +1180,7 @@ var Gt = /* @__PURE__ */ M({
1191
1180
  },
1192
1181
  emits: ["close", "action"],
1193
1182
  setup(e, { emit: t }) {
1194
- let r = e, i = t, { t: a } = n(), o = R(null), s = D(() => {
1183
+ let r = e, i = t, { t: a } = n(), o = z(null), s = D(() => {
1195
1184
  let e = [
1196
1185
  {
1197
1186
  id: "cut",
@@ -1310,8 +1299,8 @@ var Gt = /* @__PURE__ */ M({
1310
1299
  disabled: !r.canSplitCell
1311
1300
  }), e;
1312
1301
  }), c = D(() => {
1313
- 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 * pr + i * 9;
1314
- return typeof window < "u" && (e + fr + mr > window.innerWidth && (e = window.innerWidth - fr - mr), t + a + mr > window.innerHeight && (t = window.innerHeight - a - mr)), {
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)), {
1315
1304
  position: "fixed",
1316
1305
  left: `${e}px`,
1317
1306
  top: `${t}px`,
@@ -1324,50 +1313,50 @@ var Gt = /* @__PURE__ */ M({
1324
1313
  function u(e) {
1325
1314
  e.key === "Escape" && i("close");
1326
1315
  }
1327
- return U(() => r.isOpen, (e) => {
1328
- e && ue(() => o.value?.focus());
1329
- }), (t, n) => (L(), ie(E, { to: "body" }, [e.isOpen ? (L(), k("div", {
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", {
1330
1319
  key: 0,
1331
1320
  class: "ctx-menu-backdrop",
1332
1321
  onMousedown: n[0] ||= (e) => t.$emit("close"),
1333
- onContextmenu: n[1] ||= K((e) => t.$emit("close"), ["prevent"])
1334
- }, null, 32)) : O("", !0), e.isOpen ? (L(), k("div", {
1322
+ onContextmenu: n[1] ||= J((e) => t.$emit("close"), ["prevent"])
1323
+ }, null, 32)) : O("", !0), e.isOpen ? (R(), k("div", {
1335
1324
  key: 1,
1336
1325
  ref_key: "menuRef",
1337
1326
  ref: o,
1338
1327
  class: "ctx-menu",
1339
- style: P(c.value),
1340
- onContextmenu: n[2] ||= K(() => {}, ["prevent"]),
1328
+ style: F(c.value),
1329
+ onContextmenu: n[2] ||= J(() => {}, ["prevent"]),
1341
1330
  onKeydown: u
1342
- }, [(L(!0), k(T, null, de(s.value, (e, t) => (L(), k("button", {
1331
+ }, [(R(!0), k(T, null, B(s.value, (e, t) => (R(), k("button", {
1343
1332
  key: e.id || t,
1344
- class: N(["ctx-menu__item", {
1333
+ class: P(["ctx-menu__item", {
1345
1334
  "ctx-menu__item--disabled": e.disabled,
1346
1335
  "ctx-menu__item--divider": e.divider
1347
1336
  }]),
1348
1337
  disabled: e.disabled,
1349
- onMousedown: K((t) => l(e.action), ["prevent"])
1350
- }, [A("span", ur, B(e.label), 1), e.shortcut ? (L(), k("span", dr, B(e.shortcut), 1)) : O("", !0)], 42, lr))), 128))], 36)) : O("", !0)]));
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)]));
1351
1340
  }
1352
- }), [["__scopeId", "data-v-b2122da6"]]), gr = ["aria-label"], _r = { class: "image-ctx-menu__icon" }, vr = { class: "image-ctx-menu__label" }, yr = {
1341
+ }), [["__scopeId", "data-v-b2122da6"]]), _r = ["aria-label"], vr = { class: "image-ctx-menu__icon" }, yr = { class: "image-ctx-menu__label" }, br = {
1353
1342
  key: 1,
1354
1343
  class: "image-ctx-menu__divider",
1355
1344
  role: "separator"
1356
- }, br = [
1345
+ }, xr = [
1357
1346
  "data-wrap-type",
1358
1347
  "data-current",
1359
1348
  "data-disabled",
1360
1349
  "disabled",
1361
1350
  "title",
1362
1351
  "onClick"
1363
- ], xr = { class: "image-ctx-menu__icon" }, Sr = { class: "image-ctx-menu__label" }, Cr = ["aria-label"], wr = ["disabled", "onClick"], Tr = { class: "image-ctx-menu__label" }, Er = {
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 = {
1364
1353
  key: 0,
1365
1354
  class: "image-ctx-menu__shortcut"
1366
- }, Dr = {
1355
+ }, Or = {
1367
1356
  key: 0,
1368
1357
  class: "image-ctx-menu__divider",
1369
1358
  role: "separator"
1370
- }, Or = 18, kr = 260, Ar = 10, jr = /* @__PURE__ */ x(/* @__PURE__ */ M({
1359
+ }, kr = 18, Ar = 260, jr = 10, Mr = /* @__PURE__ */ x(/* @__PURE__ */ N({
1371
1360
  __name: "ImageContextMenu",
1372
1361
  props: {
1373
1362
  state: {},
@@ -1388,7 +1377,7 @@ var Gt = /* @__PURE__ */ M({
1388
1377
  function a() {
1389
1378
  i("open-properties"), i("close");
1390
1379
  }
1391
- let { t: o } = n(), s = R(null), l = Ze, u = D(() => r.state ? $e(r.state.currentWrapType, r.state.currentCssFloat ?? null) : null), d = {
1380
+ let { t: o } = n(), s = z(null), l = Ze, u = D(() => r.state ? $e(r.state.currentWrapType, r.state.currentCssFloat ?? null) : null), d = {
1392
1381
  inline: "wrap_text",
1393
1382
  squareLeft: "format_image_left",
1394
1383
  squareRight: "format_image_right",
@@ -1401,16 +1390,16 @@ var Gt = /* @__PURE__ */ M({
1401
1390
  let p = D(() => {
1402
1391
  if (!r.state) return {};
1403
1392
  let e = Ze.length * 36 + 16, t = r.state.position.x, n = r.state.position.y;
1404
- return typeof window < "u" && (t + kr > window.innerWidth && (t = window.innerWidth - kr - Ar), n + e > window.innerHeight && (n = window.innerHeight - e - Ar), t < Ar && (t = Ar), n < Ar && (n = Ar)), {
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)), {
1405
1394
  position: "fixed",
1406
1395
  left: `${t}px`,
1407
1396
  top: `${n}px`,
1408
- minWidth: `${kr}px`,
1397
+ minWidth: `${Ar}px`,
1409
1398
  zIndex: 400
1410
1399
  };
1411
1400
  });
1412
1401
  function m(e) {
1413
- return r.state ? et(e, r.state.currentWrapType) : !1;
1402
+ return r.state ? tt(e, r.state.currentWrapType) : !1;
1414
1403
  }
1415
1404
  function h(e) {
1416
1405
  m(e) && (i("select", e.choice), i("close"));
@@ -1424,74 +1413,74 @@ var Gt = /* @__PURE__ */ M({
1424
1413
  function v(e) {
1425
1414
  e.key === "Escape" && (e.preventDefault(), i("close"));
1426
1415
  }
1427
- return (t, n) => (L(), ie(E, { to: "body" }, [e.state && e.state.open ? (L(), k("div", {
1416
+ return (t, n) => (R(), ie(E, { to: "body" }, [e.state && e.state.open ? (R(), k("div", {
1428
1417
  key: 0,
1429
1418
  class: "image-ctx-menu-backdrop",
1430
1419
  onMousedown: _,
1431
- onContextmenu: n[0] ||= K((e) => t.$emit("close"), ["prevent"])
1432
- }, null, 32)) : O("", !0), e.state && e.state.open ? (L(), k("div", {
1420
+ onContextmenu: n[0] ||= J((e) => t.$emit("close"), ["prevent"])
1421
+ }, null, 32)) : O("", !0), e.state && e.state.open ? (R(), k("div", {
1433
1422
  key: 1,
1434
1423
  ref_key: "menuRef",
1435
1424
  ref: s,
1436
1425
  class: "image-ctx-menu",
1437
1426
  role: "menu",
1438
- "aria-label": V(o)("imageWrap.menu.ariaLabel"),
1427
+ "aria-label": U(o)("imageWrap.menu.ariaLabel"),
1439
1428
  "data-testid": "image-context-menu",
1440
- style: P(p.value),
1441
- onContextmenu: n[4] ||= K(() => {}, ["prevent"]),
1429
+ style: F(p.value),
1430
+ onContextmenu: n[4] ||= J(() => {}, ["prevent"]),
1442
1431
  onKeydown: v
1443
1432
  }, [
1444
- e.canOpenProperties ? (L(), k("button", {
1433
+ e.canOpenProperties ? (R(), k("button", {
1445
1434
  key: 0,
1446
1435
  type: "button",
1447
1436
  role: "menuitem",
1448
1437
  class: "image-ctx-menu__item",
1449
1438
  "data-action": "open-properties",
1450
- onMousedown: n[1] ||= K(() => {}, ["prevent"]),
1439
+ onMousedown: n[1] ||= J(() => {}, ["prevent"]),
1451
1440
  onClick: a
1452
- }, [A("span", _r, [j(c, {
1441
+ }, [A("span", vr, [M(c, {
1453
1442
  name: "settings",
1454
- size: Or
1455
- })]), A("span", vr, B(V(o)("imageWrap.menu.imageProperties")), 1)], 32)) : O("", !0),
1456
- e.canOpenProperties ? (L(), k("div", yr)) : O("", !0),
1457
- (L(!0), k(T, null, de(V(l), (e) => (L(), k("button", {
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", {
1458
1447
  key: e.choice,
1459
1448
  type: "button",
1460
1449
  role: "menuitem",
1461
- class: N(["image-ctx-menu__item", { "image-ctx-menu__item--current": e.choice === u.value }]),
1450
+ class: P(["image-ctx-menu__item", { "image-ctx-menu__item--current": e.choice === u.value }]),
1462
1451
  "data-wrap-type": e.choice,
1463
1452
  "data-current": e.choice === u.value ? "true" : "false",
1464
1453
  "data-disabled": m(e) ? "false" : "true",
1465
1454
  disabled: !m(e),
1466
- title: V(o)(`imageWrap.menuDesc.${e.i18nDescKey}`),
1467
- onMousedown: n[2] ||= K(() => {}, ["prevent"]),
1455
+ title: U(o)(`imageWrap.menuDesc.${e.i18nDescKey}`),
1456
+ onMousedown: n[2] ||= J(() => {}, ["prevent"]),
1468
1457
  onClick: (t) => h(e)
1469
1458
  }, [
1470
- A("span", xr, [j(c, {
1459
+ A("span", Sr, [M(c, {
1471
1460
  name: f(e.iconHint),
1472
- size: Or
1461
+ size: kr
1473
1462
  }, null, 8, ["name"])]),
1474
- A("span", Sr, B(V(o)(`imageWrap.menu.${e.i18nLabelKey}`)), 1),
1475
- e.choice === u.value ? (L(), k("span", {
1463
+ A("span", Cr, H(U(o)(`imageWrap.menu.${e.i18nLabelKey}`)), 1),
1464
+ e.choice === u.value ? (R(), k("span", {
1476
1465
  key: 0,
1477
1466
  class: "image-ctx-menu__current-dot",
1478
- "aria-label": V(o)("imageWrap.menu.ariaLabel")
1479
- }, "●", 8, Cr)) : O("", !0)
1480
- ], 42, br))), 128)),
1481
- e.textActions && e.textActions.length > 0 ? (L(), k(T, { key: 2 }, [n[5] ||= A("div", {
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", {
1482
1471
  class: "image-ctx-menu__divider",
1483
1472
  role: "separator"
1484
- }, null, -1), (L(!0), k(T, null, de(e.textActions, (e, t) => (L(), k(T, { key: `${e.action}-${t}` }, [A("button", {
1473
+ }, null, -1), (R(!0), k(T, null, B(e.textActions, (e, t) => (R(), k(T, { key: `${e.action}-${t}` }, [A("button", {
1485
1474
  type: "button",
1486
1475
  role: "menuitem",
1487
1476
  class: "image-ctx-menu__item image-ctx-menu__item--text",
1488
1477
  disabled: e.disabled,
1489
- onMousedown: n[3] ||= K(() => {}, ["prevent"]),
1478
+ onMousedown: n[3] ||= J(() => {}, ["prevent"]),
1490
1479
  onClick: (t) => g(e)
1491
- }, [A("span", Tr, B(e.label), 1), e.shortcut ? (L(), k("span", Er, B(e.shortcut), 1)) : O("", !0)], 40, wr), e.dividerAfter ? (L(), k("div", Dr)) : O("", !0)], 64))), 128))], 64)) : O("", !0)
1492
- ], 44, gr)) : O("", !0)]));
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)]));
1493
1482
  }
1494
- }), [["__scopeId", "data-v-5c21ca8c"]]), Mr = /* @__PURE__ */ M({
1483
+ }), [["__scopeId", "data-v-5c21ca8c"]]), Nr = /* @__PURE__ */ N({
1495
1484
  __name: "DocxEditorOverlays",
1496
1485
  props: {
1497
1486
  readOnly: { type: Boolean },
@@ -1509,7 +1498,7 @@ var Gt = /* @__PURE__ */ M({
1509
1498
  ],
1510
1499
  setup(e, { emit: t }) {
1511
1500
  let n = t;
1512
- return (t, r) => (L(), k(T, null, [j(hr, {
1501
+ return (t, r) => (R(), k(T, null, [M(gr, {
1513
1502
  "is-open": e.contextMenu.isOpen,
1514
1503
  position: e.contextMenu.position,
1515
1504
  "has-selection": e.contextMenu.hasSelection,
@@ -1529,7 +1518,7 @@ var Gt = /* @__PURE__ */ M({
1529
1518
  "on-image",
1530
1519
  "can-merge-cells",
1531
1520
  "can-split-cell"
1532
- ]), j(jr, {
1521
+ ]), M(Mr, {
1533
1522
  state: e.imageContextMenu,
1534
1523
  "text-actions": e.imageContextMenuTextActions,
1535
1524
  "can-open-properties": e.canOpenImageProperties,
@@ -1543,7 +1532,7 @@ var Gt = /* @__PURE__ */ M({
1543
1532
  "can-open-properties"
1544
1533
  ])], 64));
1545
1534
  }
1546
- }), Nr = ["href", "title"], Pr = ["title"], Fr = ["title"], Ir = ["title"], Lr = { class: "docx-hyperlink-popup__edit-row" }, Rr = ["placeholder", "onKeydown"], zr = { class: "docx-hyperlink-popup__edit-row" }, Br = ["onKeydown"], Vr = ["disabled"], Hr = /* @__PURE__ */ x(/* @__PURE__ */ M({
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({
1547
1536
  __name: "HyperlinkPopup",
1548
1537
  props: {
1549
1538
  data: {},
@@ -1557,25 +1546,25 @@ var Gt = /* @__PURE__ */ M({
1557
1546
  "close"
1558
1547
  ],
1559
1548
  setup(e, { emit: t }) {
1560
- let { t: r } = n(), i = e, a = t, o = R(!1), s = R(""), c = R(""), l = R(null), u = D(() => ({
1549
+ let { t: r } = n(), i = e, a = t, o = z(!1), s = z(""), c = z(""), l = z(null), u = D(() => ({
1561
1550
  left: (i.data?.position.left ?? 0) + "px",
1562
1551
  top: (i.data?.position.top ?? 0) + "px"
1563
1552
  }));
1564
- U(() => i.data?.href, () => {
1553
+ K(() => i.data?.href, () => {
1565
1554
  o.value = !1;
1566
1555
  });
1567
1556
  let d = null, f = null;
1568
1557
  function p() {
1569
1558
  f &&= (clearTimeout(f), null), d &&= (document.removeEventListener("mousedown", d), null);
1570
1559
  }
1571
- U(() => i.data, (e) => {
1560
+ K(() => i.data, (e) => {
1572
1561
  p(), e && (d = (e) => {
1573
1562
  let t = l.value;
1574
1563
  t && !t.contains(e.target) && a("close");
1575
1564
  }, f = setTimeout(() => {
1576
1565
  d && document.addEventListener("mousedown", d);
1577
1566
  }, 0));
1578
- }, { immediate: !0 }), F(p);
1567
+ }, { immediate: !0 }), I(p);
1579
1568
  function m() {
1580
1569
  i.data && (s.value = i.data.displayText, c.value = i.data.href, o.value = !0);
1581
1570
  }
@@ -1585,40 +1574,40 @@ var Gt = /* @__PURE__ */ M({
1585
1574
  function g() {
1586
1575
  i.data && (a("copy", i.data.href), typeof navigator < "u" && navigator.clipboard && navigator.clipboard.writeText(i.data.href).catch(() => {}));
1587
1576
  }
1588
- return (t, n) => e.data ? (L(), k("div", {
1577
+ return (t, n) => e.data ? (R(), k("div", {
1589
1578
  key: 0,
1590
1579
  ref_key: "popupRef",
1591
1580
  ref: l,
1592
- class: N(["docx-hyperlink-popup", { "docx-hyperlink-popup--edit": o.value }]),
1593
- style: P(u.value),
1594
- onMousedown: n[6] ||= K(() => {}, ["stop"])
1595
- }, [o.value ? (L(), k(T, { key: 1 }, [A("div", Lr, [W(A("input", {
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", {
1596
1585
  class: "docx-hyperlink-popup__input",
1597
- placeholder: V(r)("hyperlinkPopup.displayTextPlaceholder"),
1586
+ placeholder: U(r)("hyperlinkPopup.displayTextPlaceholder"),
1598
1587
  "onUpdate:modelValue": n[2] ||= (e) => s.value = e,
1599
- onKeydown: [G(K(h, ["prevent"]), ["enter"]), n[3] ||= G((e) => t.$emit("close"), ["esc"])]
1600
- }, null, 40, Rr), [[H, s.value]])]), A("div", zr, [W(A("input", {
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", {
1601
1590
  class: "docx-hyperlink-popup__input",
1602
1591
  placeholder: "https://...",
1603
1592
  "onUpdate:modelValue": n[4] ||= (e) => c.value = e,
1604
- onKeydown: [G(K(h, ["prevent"]), ["enter"]), n[5] ||= G((e) => t.$emit("close"), ["esc"])]
1605
- }, null, 40, Br), [[H, c.value]]), A("button", {
1593
+ onKeydown: [me(J(h, ["prevent"]), ["enter"]), n[5] ||= me((e) => t.$emit("close"), ["esc"])]
1594
+ }, null, 40, Vr), [[G, c.value]]), A("button", {
1606
1595
  class: "docx-hyperlink-popup__apply",
1607
1596
  disabled: !c.value.trim(),
1608
- onClick: K(h, ["prevent"])
1609
- }, B(V(r)("common.apply")), 9, Vr)])], 64)) : (L(), k(T, { key: 0 }, [
1597
+ onClick: J(h, ["prevent"])
1598
+ }, H(U(r)("common.apply")), 9, Hr)])], 64)) : (R(), k(T, { key: 0 }, [
1610
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),
1611
1600
  A("a", {
1612
1601
  class: "docx-hyperlink-popup__url",
1613
1602
  href: e.data.href,
1614
1603
  title: e.data.href,
1615
- onClick: n[0] ||= K((n) => t.$emit("navigate", e.data.href), ["prevent"])
1616
- }, B(e.data.href), 9, Nr),
1604
+ onClick: n[0] ||= J((n) => t.$emit("navigate", e.data.href), ["prevent"])
1605
+ }, H(e.data.href), 9, Pr),
1617
1606
  n[11] ||= A("span", { class: "docx-hyperlink-popup__sep" }, null, -1),
1618
1607
  A("button", {
1619
1608
  class: "docx-hyperlink-popup__btn",
1620
- title: V(r)("hyperlinkPopup.copyLink"),
1621
- onClick: K(g, ["prevent"])
1609
+ title: U(r)("hyperlinkPopup.copyLink"),
1610
+ onClick: J(g, ["prevent"])
1622
1611
  }, [...n[7] ||= [A("svg", {
1623
1612
  width: "18",
1624
1613
  height: "18",
@@ -1635,12 +1624,12 @@ var Gt = /* @__PURE__ */ M({
1635
1624
  height: "13",
1636
1625
  rx: "2",
1637
1626
  ry: "2"
1638
- }), 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, Pr),
1639
- e.readOnly ? O("", !0) : (L(), k("button", {
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", {
1640
1629
  key: 0,
1641
1630
  class: "docx-hyperlink-popup__btn",
1642
- title: V(r)("hyperlinkPopup.editLink"),
1643
- onClick: K(m, ["prevent"])
1631
+ title: U(r)("hyperlinkPopup.editLink"),
1632
+ onClick: J(m, ["prevent"])
1644
1633
  }, [...n[8] ||= [A("svg", {
1645
1634
  width: "18",
1646
1635
  height: "18",
@@ -1650,26 +1639,26 @@ var Gt = /* @__PURE__ */ M({
1650
1639
  "stroke-width": "2",
1651
1640
  "stroke-linecap": "round",
1652
1641
  "stroke-linejoin": "round"
1653
- }, [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, Fr)),
1654
- e.readOnly ? O("", !0) : (L(), k("button", {
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", {
1655
1644
  key: 1,
1656
1645
  class: "docx-hyperlink-popup__btn",
1657
- title: V(r)("hyperlinkPopup.removeLink"),
1658
- onClick: n[1] ||= K((e) => t.$emit("remove"), ["prevent"])
1659
- }, [...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, Ir))
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))
1660
1649
  ], 64))], 38)) : O("", !0);
1661
1650
  }
1662
1651
  }), [["__scopeId", "data-v-9d23bb12"]]);
1663
1652
  //#endregion
1664
1653
  //#region src/composables/useFileIO.ts
1665
- function Ur(e) {
1666
- let t = R(null);
1654
+ function Wr(e) {
1655
+ let t = z(null);
1667
1656
  async function n() {
1668
1657
  await e.nextTick(), e.extractCommentsAndChanges(), e.emit("ready");
1669
1658
  }
1670
1659
  async function r(t) {
1671
1660
  try {
1672
- let r = await ze(t);
1661
+ let r = await Re(t);
1673
1662
  if (!r) return;
1674
1663
  await e.loadBuffer(r.buffer), e.emit("update:document", e.getDocument()), e.emit("rename", r.name), await n();
1675
1664
  } catch (t) {
@@ -1708,8 +1697,8 @@ function Ur(e) {
1708
1697
  }
1709
1698
  //#endregion
1710
1699
  //#region src/composables/useHyperlinkManagement.ts
1711
- function Wr(e) {
1712
- let t = R(null);
1700
+ function Gr(e) {
1701
+ let t = z(null);
1713
1702
  function n(t) {
1714
1703
  let n = e.editorView.value;
1715
1704
  if (!n) return;
@@ -1737,7 +1726,7 @@ function Wr(e) {
1737
1726
  function a(n, r) {
1738
1727
  let i = e.editorView.value;
1739
1728
  if (!i) return;
1740
- let a = Ue(i.state);
1729
+ let a = He(i.state);
1741
1730
  if (!a) {
1742
1731
  t.value = null;
1743
1732
  return;
@@ -1751,7 +1740,7 @@ function Wr(e) {
1751
1740
  function o() {
1752
1741
  let n = e.editorView.value;
1753
1742
  if (!n) return;
1754
- let r = Ue(n.state, t.value?.href);
1743
+ let r = He(n.state, t.value?.href);
1755
1744
  if (!r) {
1756
1745
  t.value = null;
1757
1746
  return;
@@ -1770,56 +1759,57 @@ function Wr(e) {
1770
1759
  }
1771
1760
  //#endregion
1772
1761
  //#region src/composables/useFormattingActions.ts
1773
- function Gr(e) {
1774
- function t() {
1775
- let t = e.editorView.value;
1776
- t && (He(t.state, t.dispatch, t), t.focus());
1762
+ function Kr(e) {
1763
+ let t = () => e.activeView?.value ?? e.editorView.value;
1764
+ function n() {
1765
+ let e = t();
1766
+ e && (Ve(e.state, e.dispatch, e), e.focus());
1777
1767
  }
1778
- function n(t) {
1779
- let n = e.editorView.value;
1780
- if (!n) return;
1781
- let r = e.getDocument()?.package?.styles;
1782
- if (r) {
1783
- let e = pt(r).resolveParagraphStyle(t);
1784
- ct(t, {
1768
+ function r(n) {
1769
+ let r = t();
1770
+ if (!r) return;
1771
+ let i = e.getDocument()?.package?.styles;
1772
+ if (i) {
1773
+ let e = mt(i).resolveParagraphStyle(n);
1774
+ lt(n, {
1785
1775
  paragraphFormatting: e.paragraphFormatting,
1786
1776
  runFormatting: e.runFormatting
1787
- })(n.state, (e) => n.dispatch(e));
1788
- } else ct(t)(n.state, (e) => n.dispatch(e));
1789
- n.focus();
1777
+ })(r.state, (e) => r.dispatch(e));
1778
+ } else lt(n)(r.state, (e) => r.dispatch(e));
1779
+ r.focus();
1790
1780
  }
1791
- function r() {
1781
+ function i() {
1792
1782
  let t = e.editorView.value;
1793
- t && (mt(t.state, (e) => t.dispatch(e), t), t.focus());
1783
+ t && (ht(t.state, (e) => t.dispatch(e), t), t.focus());
1794
1784
  }
1795
- function i(t) {
1796
- let n = e.editorView.value;
1785
+ function a(e) {
1786
+ let n = t();
1797
1787
  if (!n) return;
1798
- let { from: r } = n.state.selection, i = n.state.tr.insertText(t, r);
1788
+ let { from: r } = n.state.selection, i = n.state.tr.insertText(e, r);
1799
1789
  n.dispatch(i.scrollIntoView()), n.focus();
1800
1790
  }
1801
- function a(t) {
1791
+ function o(t) {
1802
1792
  let n = e.editorView.value;
1803
- return n ? ht(n, t) : !1;
1793
+ return n ? gt(n, t) : !1;
1804
1794
  }
1805
- function o(t) {
1795
+ function s(t) {
1806
1796
  let n = e.editorView.value;
1807
1797
  if (!n) return !1;
1808
1798
  let r = e.getDocument();
1809
- return gt(n, t, { styleResolver: r?.package?.styles ? pt(r.package.styles) : null });
1799
+ return _t(n, t, { styleResolver: r?.package?.styles ? mt(r.package.styles) : null });
1810
1800
  }
1811
1801
  return {
1812
- handleClearFormatting: t,
1813
- handleApplyStyle: n,
1814
- handleInsertPageBreak: r,
1815
- handleInsertSymbol: i,
1816
- applyFormatting: a,
1817
- setParagraphStyle: o
1802
+ handleClearFormatting: n,
1803
+ handleApplyStyle: r,
1804
+ handleInsertPageBreak: i,
1805
+ handleInsertSymbol: a,
1806
+ applyFormatting: o,
1807
+ setParagraphStyle: s
1818
1808
  };
1819
1809
  }
1820
1810
  //#endregion
1821
1811
  //#region src/composables/usePageSetupControls.ts
1822
- function Kr(e) {
1812
+ function qr(e) {
1823
1813
  function t(t) {
1824
1814
  let n = e.getDocument();
1825
1815
  if (!n?.package?.document) return;
@@ -1846,19 +1836,19 @@ function Kr(e) {
1846
1836
  }
1847
1837
  function s(t) {
1848
1838
  let n = e.editorView.value;
1849
- n && dt(t)(n.state, n.dispatch);
1839
+ n && ft(t)(n.state, n.dispatch);
1850
1840
  }
1851
1841
  function c(t) {
1852
1842
  let n = e.editorView.value;
1853
- n && ft(t)(n.state, n.dispatch);
1843
+ n && pt(t)(n.state, n.dispatch);
1854
1844
  }
1855
1845
  function l(t) {
1856
1846
  let n = e.editorView.value;
1857
- n && (t < 0 ? ut(-t, !0)(n.state, n.dispatch) : ut(t, !1)(n.state, n.dispatch));
1847
+ n && (t < 0 ? dt(-t, !0)(n.state, n.dispatch) : dt(t, !1)(n.state, n.dispatch));
1858
1848
  }
1859
1849
  function u(t) {
1860
1850
  let n = e.editorView.value;
1861
- n && lt(t)(n.state, n.dispatch);
1851
+ n && ut(t)(n.state, n.dispatch);
1862
1852
  }
1863
1853
  return {
1864
1854
  handlePageSetupApply: t,
@@ -1874,16 +1864,16 @@ function Kr(e) {
1874
1864
  }
1875
1865
  //#endregion
1876
1866
  //#region src/composables/useWatermarkControls.ts
1877
- function qr(e) {
1878
- let t = R(!1), n = D(() => {
1867
+ function Jr(e) {
1868
+ let t = z(!1), n = D(() => {
1879
1869
  e.stateTick.value;
1880
1870
  let t = e.editorView.value;
1881
- return t ? yt(t.state) ?? void 0 : void 0;
1871
+ return t ? bt(t.state) ?? void 0 : void 0;
1882
1872
  });
1883
1873
  function r(t) {
1884
1874
  if (e.readOnly.value) return;
1885
1875
  let n = e.editorView.value;
1886
- n && (Ct(t)(n.state, n.dispatch), e.stateTick.value++, n.focus());
1876
+ n && (wt(t)(n.state, n.dispatch), e.stateTick.value++, n.focus());
1887
1877
  }
1888
1878
  return {
1889
1879
  showWatermark: t,
@@ -1893,18 +1883,18 @@ function qr(e) {
1893
1883
  }
1894
1884
  //#endregion
1895
1885
  //#region src/composables/useOutlineSidebar.ts
1896
- function Jr(e) {
1886
+ function Yr(e) {
1897
1887
  function t() {
1898
1888
  if (!e.showOutline.value) {
1899
1889
  let t = e.editorView.value;
1900
- t && (e.outlineHeadings.value = wt(t.state.doc));
1890
+ t && (e.outlineHeadings.value = Tt(t.state.doc));
1901
1891
  }
1902
1892
  e.showOutline.value = !e.showOutline.value;
1903
1893
  }
1904
1894
  function n(t) {
1905
1895
  let n = e.editorView.value;
1906
1896
  if (!n) return;
1907
- let r = n.state.doc.resolve(Math.min(t + 1, n.state.doc.content.size)), i = J.near(r);
1897
+ let r = n.state.doc.resolve(Math.min(t + 1, n.state.doc.content.size)), i = he.near(r);
1908
1898
  n.dispatch(n.state.tr.setSelection(i).scrollIntoView()), n.focus();
1909
1899
  }
1910
1900
  function r() {
@@ -1923,7 +1913,7 @@ function Jr(e) {
1923
1913
  }
1924
1914
  //#endregion
1925
1915
  //#region src/composables/useKeyboardShortcuts.ts
1926
- function Yr(e) {
1916
+ function Xr(e) {
1927
1917
  function t(t) {
1928
1918
  if (t.key === "F1") {
1929
1919
  t.preventDefault(), e.showKeyboardShortcuts.value = !0;
@@ -1931,26 +1921,26 @@ function Yr(e) {
1931
1921
  }
1932
1922
  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)));
1933
1923
  }
1934
- return I(() => window.addEventListener("keydown", t)), F(() => window.removeEventListener("keydown", t)), { handleKeyDown: t };
1924
+ return L(() => window.addEventListener("keydown", t)), I(() => window.removeEventListener("keydown", t)), { handleKeyDown: t };
1935
1925
  }
1936
1926
  //#endregion
1937
1927
  //#region src/composables/useCommentManagement.ts
1938
- function Xr(e) {
1939
- let t = () => V(e.author) ?? "User";
1928
+ function Zr(e) {
1929
+ let t = () => U(e.author) ?? "User";
1940
1930
  function n(t) {
1941
1931
  e.comments.value = t, e.commentCallbacks?.onCommentsChange?.(t);
1942
1932
  }
1943
1933
  function r() {
1944
- At(e.commentIdAllocator, e.getDocument()?.package?.document?.comments, e.editorView.value);
1934
+ jt(e.commentIdAllocator, e.getDocument()?.package?.document?.comments, e.editorView.value);
1945
1935
  }
1946
1936
  function i(t, n, i) {
1947
- return r(), Dt(e.commentIdAllocator, t, n, i);
1937
+ return r(), Ot(e.commentIdAllocator, t, n, i);
1948
1938
  }
1949
1939
  function a(t) {
1950
1940
  let i = e.getDocument(), a = e.editorView.value;
1951
1941
  if (!i?.package?.document || !a) return null;
1952
1942
  i.package.document.comments || (i.package.document.comments = []), r();
1953
- let o = Tt(a, t, e.commentIdAllocator);
1943
+ let o = Et(a, t, e.commentIdAllocator);
1954
1944
  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;
1955
1945
  }
1956
1946
  function o(t, r, a) {
@@ -1969,7 +1959,7 @@ function Xr(e) {
1969
1959
  let n = e.editorView.value;
1970
1960
  if (!n) return !1;
1971
1961
  r();
1972
- let i = Et(n, t, e.commentIdAllocator);
1962
+ let i = Dt(n, t, e.commentIdAllocator);
1973
1963
  return i && (e.extractCommentsAndChanges(), e.showSidebar.value = !0), i;
1974
1964
  }
1975
1965
  function l(n, r) {
@@ -1996,19 +1986,19 @@ function Xr(e) {
1996
1986
  }
1997
1987
  function p(t, n) {
1998
1988
  let r = e.editorView.value;
1999
- r && (_t(t, n)(r.state, r.dispatch), e.extractCommentsAndChanges(), r.focus());
1989
+ r && (vt(t, n)(r.state, r.dispatch), e.extractCommentsAndChanges(), r.focus());
2000
1990
  }
2001
1991
  function m(t, n) {
2002
1992
  let r = e.editorView.value;
2003
- r && (xt(t, n)(r.state, r.dispatch), e.extractCommentsAndChanges(), r.focus());
1993
+ r && (St(t, n)(r.state, r.dispatch), e.extractCommentsAndChanges(), r.focus());
2004
1994
  }
2005
1995
  function h(t) {
2006
1996
  let n = e.editorView.value;
2007
- n && (vt(t)(n.state, n.dispatch), e.extractCommentsAndChanges(), n.focus());
1997
+ n && (yt(t)(n.state, n.dispatch), e.extractCommentsAndChanges(), n.focus());
2008
1998
  }
2009
1999
  function g(t) {
2010
2000
  let n = e.editorView.value;
2011
- n && (St(t)(n.state, n.dispatch), e.extractCommentsAndChanges(), n.focus());
2001
+ n && (Ct(t)(n.state, n.dispatch), e.extractCommentsAndChanges(), n.focus());
2012
2002
  }
2013
2003
  function _(r, a) {
2014
2004
  let o = e.getDocument(), s = e.editorView.value;
@@ -2045,8 +2035,8 @@ function Xr(e) {
2045
2035
  }
2046
2036
  //#endregion
2047
2037
  //#region src/composables/useHostCallbacks.ts
2048
- function Zr(e, t) {
2049
- return U(t, (t) => t && e.onEditorViewReady?.(t), { immediate: !0 }), { commentCallbacks: {
2038
+ function Qr(e, t) {
2039
+ return K(t, (t) => t && e.onEditorViewReady?.(t), { immediate: !0 }), { commentCallbacks: {
2050
2040
  onCommentAdd: (t) => e.onCommentAdd?.(t),
2051
2041
  onCommentResolve: (t) => e.onCommentResolve?.(t),
2052
2042
  onCommentDelete: (t) => e.onCommentDelete?.(t),
@@ -2056,11 +2046,11 @@ function Zr(e, t) {
2056
2046
  }
2057
2047
  //#endregion
2058
2048
  //#region src/composables/useCommentLifecycle.ts
2059
- function Qr(e) {
2060
- let t = R(null), n = R(null), r = R(null), i = R(!1);
2049
+ function $r(e) {
2050
+ let t = z(null), n = z(null), r = z(null), i = z(!1);
2061
2051
  function a() {
2062
2052
  let t = e.getDocument(), n = e.editorView.value;
2063
- !t || !n || (e.comments.value = [...t.package?.document?.comments ?? []], e.trackedChanges.value = jt(n.state).entries, !i.value && (e.comments.value.length > 0 || e.trackedChanges.value.length > 0) && (e.showSidebar.value = !0, i.value = !0));
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));
2064
2054
  }
2065
2055
  function o() {
2066
2056
  e.stateTick.value;
@@ -2079,7 +2069,7 @@ function Qr(e) {
2079
2069
  t.value = null;
2080
2070
  return;
2081
2071
  }
2082
- let s = o.getBoundingClientRect(), c = Bt(a, r);
2072
+ let s = o.getBoundingClientRect(), c = Vt(a, r);
2083
2073
  if (!c) {
2084
2074
  t.value = null;
2085
2075
  return;
@@ -2107,7 +2097,7 @@ function Qr(e) {
2107
2097
  for (let t of r) {
2108
2098
  if (t.type.name === "comment" && t.attrs.commentId != null) {
2109
2099
  let n = t.attrs.commentId;
2110
- if (n === Ot || e.resolvedCommentIds.value.has(n)) continue;
2100
+ if (n === kt || e.resolvedCommentIds.value.has(n)) continue;
2111
2101
  i = `comment-${n}`;
2112
2102
  break;
2113
2103
  }
@@ -2132,7 +2122,7 @@ function Qr(e) {
2132
2122
  }, r.value = t.value?.top ?? null;
2133
2123
  let s = i.state.schema.marks.comment;
2134
2124
  if (s) {
2135
- let e = i.state.tr.addMark(a, o, s.create({ commentId: Ot }));
2125
+ let e = i.state.tr.addMark(a, o, s.create({ commentId: kt }));
2136
2126
  i.dispatch(e);
2137
2127
  }
2138
2128
  e.showSidebar.value = !0, e.isAddingComment.value = !0, t.value = null;
@@ -2140,8 +2130,8 @@ function Qr(e) {
2140
2130
  function l(t) {
2141
2131
  let i = e.getDocument(), a = e.editorView.value;
2142
2132
  if (!i?.package) return;
2143
- i.package.document.comments || (i.package.document.comments = []), At(e.commentIdAllocator, i.package.document.comments, a);
2144
- let o = Dt(e.commentIdAllocator, t, V(e.author) ?? "User");
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");
2145
2135
  i.package.document.comments.push(o), e.comments.value = [...i.package.document.comments], e.commentCallbacks?.onCommentsChange?.(e.comments.value), e.commentCallbacks?.onCommentAdd?.(o);
2146
2136
  let s = n.value;
2147
2137
  if (a && s && s.from !== s.to) {
@@ -2164,15 +2154,15 @@ function Qr(e) {
2164
2154
  function d(t) {
2165
2155
  e.showSidebar.value = !0;
2166
2156
  }
2167
- U([
2157
+ K([
2168
2158
  e.stateTick,
2169
2159
  e.isAddingComment,
2170
2160
  e.zoom
2171
- ], () => o()), U(e.stateTick, () => s()), U(e.stateTick, () => a());
2161
+ ], () => o()), K(e.stateTick, () => s()), K(e.stateTick, () => a());
2172
2162
  let f = null;
2173
- return I(() => {
2163
+ return L(() => {
2174
2164
  f = new ResizeObserver(() => o()), e.pagesRef.value && f.observe(e.pagesRef.value), window.addEventListener("resize", o);
2175
- }), F(() => {
2165
+ }), I(() => {
2176
2166
  f?.disconnect(), window.removeEventListener("resize", o);
2177
2167
  }), {
2178
2168
  floatingCommentBtn: t,
@@ -2190,8 +2180,8 @@ function Qr(e) {
2190
2180
  }
2191
2181
  //#endregion
2192
2182
  //#region src/composables/useImageActions.ts
2193
- function $r(e) {
2194
- let t = z(null), n = R(!1), r = D(() => {
2183
+ function ei(e) {
2184
+ let t = de(null), n = z(!1), r = D(() => {
2195
2185
  e.stateTick.value;
2196
2186
  let n = e.editorView.value, r = t.value;
2197
2187
  if (!n || !r) return null;
@@ -2213,12 +2203,12 @@ function $r(e) {
2213
2203
  width: t.width,
2214
2204
  height: t.height
2215
2205
  });
2216
- bt(n.state, n.dispatch, i, n.state.selection.from), n.focus();
2206
+ xt(n.state, n.dispatch, i, n.state.selection.from), n.focus();
2217
2207
  }
2218
2208
  function a(n) {
2219
2209
  let r = e.editorView.value, i = t.value;
2220
2210
  if (!r || !i) return;
2221
- let a = nt(n);
2211
+ let a = rt(n);
2222
2212
  if (!a) return;
2223
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);
2224
2214
  l && (l(r.state, (e) => r.dispatch(e), r), r.focus());
@@ -2249,8 +2239,8 @@ function $r(e) {
2249
2239
  }
2250
2240
  //#endregion
2251
2241
  //#region src/utils/imageClipboard.ts
2252
- function ei(e, t, n) {
2253
- let r = ot(e.state), i = e.state.schema.marks.insertion;
2242
+ function ti(e, t, n) {
2243
+ let r = st(e.state), i = e.state.schema.marks.insertion;
2254
2244
  if (!r || !i) return;
2255
2245
  let a = t.selection.from, o = a - n.nodeSize;
2256
2246
  o < 0 || t.addMark(o, a, i.create({
@@ -2259,10 +2249,10 @@ function ei(e, t, n) {
2259
2249
  date: r.date
2260
2250
  }));
2261
2251
  }
2262
- function ti(e, t) {
2252
+ function ni(e, t) {
2263
2253
  return e.getBlob(t);
2264
2254
  }
2265
- function ni(e, t) {
2255
+ function ri(e, t) {
2266
2256
  let n = e.state.doc.nodeAt(t);
2267
2257
  if (!n || n.type.name !== "image") return;
2268
2258
  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({
@@ -2274,13 +2264,13 @@ function ni(e, t) {
2274
2264
  e.value = r, document.body.appendChild(e), e.select(), document.execCommand("copy"), document.body.removeChild(e);
2275
2265
  });
2276
2266
  }
2277
- function ri(e) {
2267
+ function ii(e) {
2278
2268
  return new Promise((t, n) => {
2279
2269
  let r = new FileReader();
2280
2270
  r.onload = () => t(r.result), r.onerror = n, r.readAsDataURL(e);
2281
2271
  });
2282
2272
  }
2283
- function ii(e) {
2273
+ function ai(e) {
2284
2274
  return new Promise((t) => {
2285
2275
  let n = new Image();
2286
2276
  n.onload = () => t({
@@ -2292,13 +2282,13 @@ function ii(e) {
2292
2282
  }), n.src = e;
2293
2283
  });
2294
2284
  }
2295
- async function ai(e) {
2285
+ async function oi(e) {
2296
2286
  try {
2297
2287
  let t = await navigator.clipboard.read();
2298
2288
  for (let n of t) {
2299
2289
  let t = n.types.find((e) => e.startsWith("image/"));
2300
2290
  if (t) {
2301
- let r = await ri(await ti(n, t)), i = await ii(r), a = i.width, o = i.height;
2291
+ let r = await ii(await ni(n, t)), i = await ai(r), a = i.width, o = i.height;
2302
2292
  a > 612 && (o = Math.round(612 / a * o), a = 612);
2303
2293
  let s = e.state.schema.nodes.image.create({
2304
2294
  src: r,
@@ -2308,11 +2298,11 @@ async function ai(e) {
2308
2298
  wrapType: "inline",
2309
2299
  displayMode: "inline"
2310
2300
  }), c = e.state.tr.replaceSelectionWith(s);
2311
- ei(e, c, s), e.dispatch(c);
2301
+ ti(e, c, s), e.dispatch(c);
2312
2302
  return;
2313
2303
  }
2314
2304
  if (n.types.includes("text/html")) {
2315
- let t = await (await ti(n, "text/html")).text(), r = t.match(/<img[^>]+src="([^"]+)"[^>]*>/i);
2305
+ let t = await (await ni(n, "text/html")).text(), r = t.match(/<img[^>]+src="([^"]+)"[^>]*>/i);
2316
2306
  if (r && r[1]) {
2317
2307
  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({
2318
2308
  src: n,
@@ -2322,12 +2312,12 @@ async function ai(e) {
2322
2312
  wrapType: "inline",
2323
2313
  displayMode: "inline"
2324
2314
  }), l = e.state.tr.replaceSelectionWith(c);
2325
- ei(e, l, c), e.dispatch(l);
2315
+ ti(e, l, c), e.dispatch(l);
2326
2316
  return;
2327
2317
  }
2328
2318
  }
2329
2319
  if (n.types.includes("text/plain")) {
2330
- let t = await (await ti(n, "text/plain")).text();
2320
+ let t = await (await ni(n, "text/plain")).text();
2331
2321
  if (t && t !== "[image]") {
2332
2322
  let { from: n } = e.state.selection;
2333
2323
  e.dispatch(e.state.tr.insertText(t, n));
@@ -2343,14 +2333,14 @@ async function ai(e) {
2343
2333
  }
2344
2334
  }
2345
2335
  }
2346
- function oi(e, t) {
2336
+ function si(e, t) {
2347
2337
  let n = e.state.doc.nodeAt(t);
2348
2338
  if (!n || n.type.name !== "image") return;
2349
2339
  let r = document.createElement("input");
2350
2340
  r.type = "file", r.accept = "image/*", r.onchange = async () => {
2351
2341
  let i = r.files?.[0];
2352
2342
  if (!i) return;
2353
- let a = await ri(i), o = await ii(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);
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);
2354
2344
  try {
2355
2345
  let r = e.state.tr.setNodeMarkup(t, void 0, {
2356
2346
  ...n.attrs,
@@ -2365,8 +2355,8 @@ function oi(e, t) {
2365
2355
  }
2366
2356
  //#endregion
2367
2357
  //#region src/composables/useContextMenus.ts
2368
- function si(e) {
2369
- let { t } = n(), r = R({
2358
+ function ci(e) {
2359
+ let { t } = n(), r = z({
2370
2360
  isOpen: !1,
2371
2361
  position: {
2372
2362
  x: 0,
@@ -2377,7 +2367,7 @@ function si(e) {
2377
2367
  onImage: !1,
2378
2368
  canMergeCells: !1,
2379
2369
  canSplitCell: !1
2380
- }), i = R(null), a = D(() => [
2370
+ }), i = z(null), a = D(() => [
2381
2371
  {
2382
2372
  action: "cut",
2383
2373
  label: t("contextMenu.cut"),
@@ -2403,12 +2393,12 @@ function si(e) {
2403
2393
  function o(t) {
2404
2394
  let n = e.editorView.value;
2405
2395
  if (!n) return;
2406
- let a = t.target, o = Q(a);
2396
+ let a = t.target, o = et(a);
2407
2397
  if (o) {
2408
2398
  let a = Number(o.dataset.pmStart);
2409
2399
  if (!isNaN(a)) {
2410
2400
  try {
2411
- let e = q.create(n.state.doc, a);
2401
+ let e = Y.create(n.state.doc, a);
2412
2402
  n.dispatch(n.state.tr.setSelection(e));
2413
2403
  } catch {}
2414
2404
  e.selectedImage.value = {
@@ -2441,7 +2431,7 @@ function si(e) {
2441
2431
  e.setPmSelection(a);
2442
2432
  } catch {}
2443
2433
  }
2444
- let s = Z(n.state), { empty: c } = n.state.selection;
2434
+ let s = Q(n.state), { empty: c } = n.state.selection;
2445
2435
  i.value &&= null, r.value = {
2446
2436
  isOpen: !0,
2447
2437
  position: {
@@ -2486,16 +2476,16 @@ function si(e) {
2486
2476
  switch (t) {
2487
2477
  case "cut":
2488
2478
  if (e.selectedImage.value) {
2489
- ni(n, e.selectedImage.value.pmPos);
2479
+ ri(n, e.selectedImage.value.pmPos);
2490
2480
  let t = e.selectedImage.value.pmPos, r = n.state.doc.nodeAt(t);
2491
2481
  r && (n.dispatch(n.state.tr.delete(t, t + r.nodeSize)), e.selectedImage.value = null);
2492
2482
  } else document.execCommand("cut");
2493
2483
  break;
2494
2484
  case "copy":
2495
- e.selectedImage.value ? ni(n, e.selectedImage.value.pmPos) : document.execCommand("copy");
2485
+ e.selectedImage.value ? ri(n, e.selectedImage.value.pmPos) : document.execCommand("copy");
2496
2486
  break;
2497
2487
  case "paste":
2498
- ai(n);
2488
+ oi(n);
2499
2489
  break;
2500
2490
  case "pasteAsPlainText":
2501
2491
  navigator.clipboard.readText().then((e) => {
@@ -2508,7 +2498,7 @@ function si(e) {
2508
2498
  break;
2509
2499
  }
2510
2500
  case "selectAll": {
2511
- let e = J.create(n.state.doc, 0, n.state.doc.content.size);
2501
+ let e = he.create(n.state.doc, 0, n.state.doc.content.size);
2512
2502
  n.dispatch(n.state.tr.setSelection(e));
2513
2503
  break;
2514
2504
  }
@@ -2516,7 +2506,7 @@ function si(e) {
2516
2506
  e.selectedImage.value && (e.showImageProperties.value = !0);
2517
2507
  break;
2518
2508
  case "replaceImage":
2519
- e.selectedImage.value && oi(n, e.selectedImage.value.pmPos);
2509
+ e.selectedImage.value && si(n, e.selectedImage.value.pmPos);
2520
2510
  break;
2521
2511
  case "deleteImage":
2522
2512
  if (e.selectedImage.value) {
@@ -2551,26 +2541,26 @@ function si(e) {
2551
2541
  }
2552
2542
  //#endregion
2553
2543
  //#region src/composables/usePagesPointer.ts
2554
- var ci = 500;
2555
- function li(e) {
2556
- let t = R(null), n = null;
2544
+ var li = 500;
2545
+ function ui(e) {
2546
+ let t = z(null), n = null;
2557
2547
  function r() {
2558
2548
  n !== null && (clearTimeout(n), n = null);
2559
2549
  }
2560
- let i = z(null), a = 0, o = null, s = 0, c = !1, l = null, u = w({
2550
+ let i = de(null), a = 0, o = null, s = 0, c = !1, l = null, u = w({
2561
2551
  pagesContainer: e.pagesRef,
2562
2552
  onScrollExtendSelection: (e, t) => {
2563
2553
  if (!c || l === null) return;
2564
2554
  let n = p(e, t);
2565
2555
  n !== null && n !== l && h(l, n);
2566
2556
  }
2567
- }), d = R({
2557
+ }), d = z({
2568
2558
  currentPage: 1,
2569
2559
  totalPages: 1,
2570
2560
  visible: !1
2571
2561
  }), f = null;
2572
2562
  function p(t, n) {
2573
- return Ht(e.pagesRef.value, e.editorView.value, t, n);
2563
+ return Ut(e.pagesRef.value, e.editorView.value, t, n);
2574
2564
  }
2575
2565
  function m() {
2576
2566
  let t = i.value;
@@ -2583,18 +2573,18 @@ function li(e) {
2583
2573
  function h(e, t) {
2584
2574
  let n = m();
2585
2575
  if (n) try {
2586
- let r = n.state.doc.resolve(e), i = t === void 0 ? r : n.state.doc.resolve(t), a = J.between(r, i);
2576
+ let r = n.state.doc.resolve(e), i = t === void 0 ? r : n.state.doc.resolve(t), a = he.between(r, i);
2587
2577
  n.dispatch(n.state.tr.setSelection(a));
2588
2578
  } catch {}
2589
2579
  }
2590
2580
  function g(t) {
2591
- Vt(e.pagesRef.value, e.pagesViewportRef.value, t);
2581
+ Ht(e.pagesRef.value, e.pagesViewportRef.value, t);
2592
2582
  }
2593
2583
  function _(t) {
2594
- Ut(e.pagesRef.value, t, h, i.value?.position);
2584
+ Wt(e.pagesRef.value, t, h, i.value?.position);
2595
2585
  }
2596
2586
  function v(t) {
2597
- Wt(e.pagesRef.value, t, h, i.value?.position);
2587
+ Gt(e.pagesRef.value, t, h, i.value?.position);
2598
2588
  }
2599
2589
  function y(t) {
2600
2590
  let n = e.editorView.value;
@@ -2615,7 +2605,7 @@ function li(e) {
2615
2605
  if (!o) return;
2616
2606
  let s = e.pagesViewportRef.value;
2617
2607
  if (!s) return;
2618
- let l = Nt({
2608
+ let l = Pt({
2619
2609
  mouseX: a.clientX,
2620
2610
  mouseY: a.clientY,
2621
2611
  pagesContainer: o,
@@ -2625,7 +2615,7 @@ function li(e) {
2625
2615
  if (!l) {
2626
2616
  n === null && (n = setTimeout(() => {
2627
2617
  t.value = null, n = null;
2628
- }, Mt));
2618
+ }, Nt));
2629
2619
  return;
2630
2620
  }
2631
2621
  let u = s.getBoundingClientRect();
@@ -2640,7 +2630,7 @@ function li(e) {
2640
2630
  n.preventDefault(), n.stopPropagation();
2641
2631
  let r = t.value, i = e.editorView.value;
2642
2632
  if (!r || !i) return;
2643
- let a = i.state.tr.setSelection(J.create(i.state.doc, r.cellPmPos + 1));
2633
+ let a = i.state.tr.setSelection(he.create(i.state.doc, r.cellPmPos + 1));
2644
2634
  i.dispatch(a);
2645
2635
  let o = e.getCommands(), s = r.type === "row" ? o.addRowBelow?.() : o.addColumnRight?.();
2646
2636
  s && (s(i.state, (e) => i.dispatch(e), i), t.value = null, i.focus());
@@ -2784,13 +2774,13 @@ function li(e) {
2784
2774
  i.value && (r.closest(".layout-page-header") || r.closest(".layout-page-footer") || r.closest(".hf-editor") || (i.value = null, n.focus()));
2785
2775
  let u = m() ?? n;
2786
2776
  if (!e.readOnly.value && e.tableResize.tryStartResize(t, u)) return;
2787
- let d = Q(r);
2777
+ let d = et(r);
2788
2778
  if (d) {
2789
2779
  t.preventDefault(), t.stopPropagation();
2790
2780
  let n = Number(d.dataset.pmStart);
2791
2781
  if (!isNaN(n)) {
2792
2782
  try {
2793
- u.dispatch(u.state.tr.setSelection(q.create(u.state.doc, n)));
2783
+ u.dispatch(u.state.tr.setSelection(Y.create(u.state.doc, n)));
2794
2784
  } catch {}
2795
2785
  e.selectedImage.value = {
2796
2786
  element: d,
@@ -2809,7 +2799,7 @@ function li(e) {
2809
2799
  return;
2810
2800
  }
2811
2801
  let g = Date.now();
2812
- if (g - a < ci && o === f ? s++ : s = 1, a = g, o = f, s === 2) _(f);
2802
+ if (g - a < li && o === f ? s++ : s = 1, a = g, o = f, s === 2) _(f);
2813
2803
  else if (s >= 3) v(f), s = 0;
2814
2804
  else {
2815
2805
  if (t.shiftKey) {
@@ -2851,9 +2841,9 @@ function li(e) {
2851
2841
  };
2852
2842
  }, 600);
2853
2843
  }
2854
- return I(() => {
2844
+ return L(() => {
2855
2845
  window.addEventListener("mousemove", T), window.addEventListener("mouseup", E), e.pagesViewportRef.value?.addEventListener("scroll", D, { passive: !0 });
2856
- }), F(() => {
2846
+ }), I(() => {
2857
2847
  r(), window.removeEventListener("mousemove", T), window.removeEventListener("mouseup", E), e.pagesViewportRef.value?.removeEventListener("scroll", D), f && clearTimeout(f);
2858
2848
  }), {
2859
2849
  tableInsertButton: t,
@@ -2875,7 +2865,7 @@ function li(e) {
2875
2865
  }
2876
2866
  //#endregion
2877
2867
  //#region src/composables/useSelectionSync.ts
2878
- function ui(e) {
2868
+ function di(e) {
2879
2869
  let t = null, n = null, r = null;
2880
2870
  function i() {
2881
2871
  let r = e.pagesRef.value;
@@ -2887,8 +2877,8 @@ function ui(e) {
2887
2877
  let t = e.pagesRef.value, n = e.editorView.value;
2888
2878
  if (!t || !n || e.isHfEditing?.value) return;
2889
2879
  let i = n.state.selection;
2890
- if (i instanceof q && i.node.type.name === "image") {
2891
- let n = Y(t, i.from), r = n ? Q(n) : null;
2880
+ if (i instanceof Y && i.node.type.name === "image") {
2881
+ let n = X(t, i.from), r = n ? et(n) : null;
2892
2882
  if (r) {
2893
2883
  let t = e.selectedImage.value;
2894
2884
  (!t || t.element !== r || t.pmPos !== i.from || t.width !== r.offsetWidth || t.height !== r.offsetHeight) && (e.selectedImage.value = {
@@ -2906,12 +2896,12 @@ function ui(e) {
2906
2896
  function o() {
2907
2897
  let r = e.pagesRef.value, o = e.editorView.value;
2908
2898
  if (!r || !o || (i(), e.isHfEditing?.value)) return;
2909
- a(), _e(r, o.state);
2899
+ a(), ge(r, o.state);
2910
2900
  let s = o.state.selection;
2911
- if (s instanceof q && s.node.type.name === "image") return;
2901
+ if (s instanceof Y && s.node.type.name === "image") return;
2912
2902
  let { from: c, to: l, empty: u } = s, d = r.scrollTop, f = r.scrollLeft, p = e.zoom.value || 1;
2913
2903
  if (u) {
2914
- let e = Ge(r, c, r.getBoundingClientRect());
2904
+ let e = We(r, c, r.getBoundingClientRect());
2915
2905
  if (e) {
2916
2906
  let i = document.createElement("div");
2917
2907
  i.className = "vue-caret", i.style.cssText = `
@@ -2931,7 +2921,7 @@ function ui(e) {
2931
2921
  }
2932
2922
  return;
2933
2923
  }
2934
- let m = Ke(r, c, l, r.getBoundingClientRect());
2924
+ let m = Ge(r, c, l, r.getBoundingClientRect());
2935
2925
  for (let e of m) {
2936
2926
  let t = document.createElement("div");
2937
2927
  t.className = "vue-sel-rect", t.style.cssText = `
@@ -2946,7 +2936,7 @@ function ui(e) {
2946
2936
  `, r.appendChild(t);
2947
2937
  }
2948
2938
  }
2949
- return F(() => {
2939
+ return I(() => {
2950
2940
  r !== null && cancelAnimationFrame(r), i();
2951
2941
  }), {
2952
2942
  clearOverlay: i,
@@ -2955,7 +2945,7 @@ function ui(e) {
2955
2945
  }
2956
2946
  //#endregion
2957
2947
  //#region src/composables/useMenuActions.ts
2958
- function di(e) {
2948
+ function fi(e) {
2959
2949
  function t(t) {
2960
2950
  let n = e.editorView.value;
2961
2951
  if (!n) return;
@@ -3010,7 +3000,7 @@ function di(e) {
3010
3000
  e.showKeyboardShortcuts.value = !0;
3011
3001
  break;
3012
3002
  case "reportIssue":
3013
- Pt();
3003
+ Ft();
3014
3004
  break;
3015
3005
  case "dirLTR":
3016
3006
  t("setLtr");
@@ -3028,29 +3018,29 @@ function di(e) {
3028
3018
  }
3029
3019
  //#endregion
3030
3020
  //#region src/composables/useDocumentLifecycle.ts
3031
- function fi(e) {
3021
+ function pi(e) {
3032
3022
  async function t(t) {
3033
3023
  e.sidebarAutoOpenedRef.value = !1, await e.loadDocumentBuffer(t);
3034
3024
  }
3035
3025
  function n(t) {
3036
3026
  e.sidebarAutoOpenedRef.value = !1, e.loadDocument(t);
3037
3027
  }
3038
- U(e.documentBuffer, (e) => {
3028
+ K(e.documentBuffer, (e) => {
3039
3029
  e && t(e);
3040
- }), U(e.document, (e) => {
3030
+ }), K(e.document, (e) => {
3041
3031
  e && n(e);
3042
- }), I(async () => {
3043
- await ue();
3032
+ }), L(async () => {
3033
+ await le();
3044
3034
  let r = e.documentBuffer(), i = e.document();
3045
3035
  r ? await t(r) : i && n(i);
3046
3036
  });
3047
3037
  }
3048
3038
  //#endregion
3049
3039
  //#region src/composables/useDocxEditorRefApi.ts
3050
- function pi(e) {
3040
+ function mi(e) {
3051
3041
  function t() {
3052
3042
  let t = e.pagesRef.value;
3053
- t && tt(t), e.onPrint?.(), window.print();
3043
+ t && nt(t), e.onPrint?.(), window.print();
3054
3044
  }
3055
3045
  function n() {
3056
3046
  t();
@@ -3084,41 +3074,41 @@ function pi(e) {
3084
3074
  function c() {
3085
3075
  let t = e.layout.value, n = e.editorView.value;
3086
3076
  if (!t || !n) return 0;
3087
- let r = st(t, n.state.selection.from);
3077
+ let r = ct(t, n.state.selection.from);
3088
3078
  return r == null ? 0 : r + 1;
3089
3079
  }
3090
3080
  function l(t) {
3091
3081
  let n = e.editorView.value;
3092
3082
  if (!n) return !1;
3093
- let r = It(n.state.doc, t);
3083
+ let r = Lt(n.state.doc, t);
3094
3084
  return r ? (e.scrollVisiblePositionIntoView(r.from + 1), !0) : !1;
3095
3085
  }
3096
3086
  function u(t, n) {
3097
- return Se(e.editorView.value, t, n);
3087
+ return xe(e.editorView.value, t, n);
3098
3088
  }
3099
3089
  function d() {
3100
- return we(e.editorView.value);
3090
+ return Ce(e.editorView.value);
3101
3091
  }
3102
3092
  function f() {
3103
3093
  return e.comments.value;
3104
3094
  }
3105
3095
  function p(t) {
3106
3096
  let n = e.editorView.value;
3107
- return n ? ke(n.state.doc, t ?? {}) : [];
3097
+ return n ? Oe(n.state.doc, t ?? {}) : [];
3108
3098
  }
3109
3099
  function m(t) {
3110
3100
  let n = e.editorView.value;
3111
3101
  if (!n) return !1;
3112
- let r = Oe(n.state.doc, t);
3102
+ let r = De(n.state.doc, t);
3113
3103
  return r == null ? !1 : (a(r), !0);
3114
3104
  }
3115
3105
  function h(t, n, r) {
3116
3106
  let i = e.editorView.value;
3117
3107
  if (!i) return !1;
3118
3108
  try {
3119
- return i.dispatch(Ne(i.state, t, n, r)), !0;
3109
+ return i.dispatch(Me(i.state, t, n, r)), !0;
3120
3110
  } catch (e) {
3121
- if (e instanceof Ft) return !1;
3111
+ if (e instanceof It) return !1;
3122
3112
  throw e;
3123
3113
  }
3124
3114
  }
@@ -3126,9 +3116,9 @@ function pi(e) {
3126
3116
  let r = e.editorView.value;
3127
3117
  if (!r) return !1;
3128
3118
  try {
3129
- return r.dispatch(Ae(r.state, t, n)), !0;
3119
+ return r.dispatch(ke(r.state, t, n)), !0;
3130
3120
  } catch (e) {
3131
- if (e instanceof Ft) return !1;
3121
+ if (e instanceof It) return !1;
3132
3122
  throw e;
3133
3123
  }
3134
3124
  }
@@ -3136,14 +3126,14 @@ function pi(e) {
3136
3126
  let i = e.editorView.value;
3137
3127
  if (!i) return !1;
3138
3128
  try {
3139
- return i.dispatch(X(i.state, t, n, r)), !0;
3129
+ return i.dispatch(Z(i.state, t, n, r)), !0;
3140
3130
  } catch (e) {
3141
- if (e instanceof Ft) return !1;
3131
+ if (e instanceof It) return !1;
3142
3132
  throw e;
3143
3133
  }
3144
3134
  }
3145
3135
  function v(t) {
3146
- return Ce(e.editorView.value, e.layout.value, t);
3136
+ return Se(e.editorView.value, e.layout.value, t);
3147
3137
  }
3148
3138
  function y(t) {
3149
3139
  return e.contentChangeSubscribers.add(t), () => e.contentChangeSubscribers.delete(t);
@@ -3190,25 +3180,25 @@ function pi(e) {
3190
3180
  }
3191
3181
  //#endregion
3192
3182
  //#region src/composables/useFontLifecycle.ts
3193
- function mi(e, t) {
3194
- U(e, (e) => {
3195
- Ie(e);
3183
+ function hi(e, t) {
3184
+ K(e, (e) => {
3185
+ Fe(e);
3196
3186
  }, { immediate: !0 });
3197
- let n = Le(t);
3198
- F(() => n());
3187
+ let n = Ie(t);
3188
+ I(() => n());
3199
3189
  }
3200
3190
  //#endregion
3201
3191
  //#region src/components/DocxEditor.vue?vue&type=script&setup=true&lang.ts
3202
- var hi = { class: "docx-editor-vue__toolbar-shell" }, gi = {
3192
+ var gi = { class: "docx-editor-vue__toolbar-shell" }, _i = {
3203
3193
  key: 0,
3204
3194
  class: "docx-editor-vue__error"
3205
- }, _i = {
3195
+ }, vi = {
3206
3196
  key: 1,
3207
3197
  class: "docx-editor-vue__loading"
3208
- }, vi = { class: "docx-editor-vue__editor-area" }, yi = {
3198
+ }, yi = { class: "docx-editor-vue__editor-area" }, bi = {
3209
3199
  key: 0,
3210
3200
  class: "docx-editor-vue__vertical-ruler"
3211
- }, bi = ["title"], xi = ["title", "aria-label"], Si = /* @__PURE__ */ M({
3201
+ }, xi = ["title"], Si = ["title", "aria-label"], Ci = /* @__PURE__ */ N({
3212
3202
  __name: "DocxEditor",
3213
3203
  props: {
3214
3204
  documentBuffer: { default: null },
@@ -3310,11 +3300,11 @@ var hi = { class: "docx-editor-vue__toolbar-shell" }, gi = {
3310
3300
  "mode-change"
3311
3301
  ],
3312
3302
  setup(e, { expose: n, emit: r }) {
3313
- let i = e, a = r, o = R(i.mode), s = D(() => i.readOnly || o.value === "viewing"), l = D(() => i.author);
3303
+ let i = e, a = r, o = z(i.mode), s = D(() => i.readOnly || o.value === "viewing"), l = D(() => i.author);
3314
3304
  f(D(() => i.i18n));
3315
- let { t: u } = t(D(() => i.i18n)), d = R(null), g = R(null), y = R(null), x = R(0), S = /* @__PURE__ */ new Set(), C = /* @__PURE__ */ new Set(), w = new Te(), E = R(!1), re = R(!1), oe = R(!1), se = R(!1), M = R(!1), ce = R(!1), me = R(i.showOutline), he = R(!1), H = R(!1), W = R(!1), G = R(null), q = z([]), _e = z([]), ve = z([]), { zoom: Y, zoomPercent: xe, isMinZoom: Se, isMaxZoom: Ce, setZoom: Ee, zoomIn: Oe, zoomOut: ke, handleWheel: Ae, handleKeyDown: je, installShortcuts: Me, ZOOM_PRESETS: Ne } = ne(i.initialZoom);
3316
- Me();
3317
- let { editorView: X, isReady: Fe, parseError: Ie, layout: Le, loadBuffer: Re, loadDocument: ze, save: Be, focus: He, destroy: Ue, getDocument: Z, getCommands: We, reLayout: Ge, getHfPmView: Ke, syncHfPMs: qe, setHfTransactionListener: Je, setDocument: Ye } = ee({
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({
3318
3308
  hiddenContainer: d,
3319
3309
  pagesContainer: g,
3320
3310
  readOnly: s,
@@ -3330,20 +3320,20 @@ var hi = { class: "docx-editor-vue__toolbar-shell" }, gi = {
3330
3320
  },
3331
3321
  onSelectionUpdate: () => {
3332
3322
  x.value++;
3333
- let e = X.value;
3334
- i.onSelectionChange?.(e ? De(e.state) : null);
3335
- let t = we(e);
3323
+ let e = Z.value;
3324
+ i.onSelectionChange?.(e ? Ee(e.state) : null);
3325
+ let t = Ce(e);
3336
3326
  C.forEach((e) => e(t));
3337
3327
  }
3338
- }), { commentCallbacks: Xe } = Zr(i, X), Ze = D(() => {
3328
+ }), { commentCallbacks: Ye } = Qr(i, Z), Xe = D(() => {
3339
3329
  x.value;
3340
- let e = Z();
3330
+ let e = Q();
3341
3331
  if (!e?.package?.document) return null;
3342
3332
  let t = e.package.document;
3343
3333
  return t.finalSectionProperties ?? t.sections?.[0]?.properties ?? null;
3344
- }), Qe = D(() => {
3334
+ }), Ze = D(() => {
3345
3335
  x.value;
3346
- let e = X.value, t = e ? Ve(e.state).paragraphFormatting : {};
3336
+ let e = Z.value, t = e ? Be(e.state).paragraphFormatting : {};
3347
3337
  return {
3348
3338
  indentLeft: t.indentLeft ?? 0,
3349
3339
  indentRight: t.indentRight ?? 0,
@@ -3351,26 +3341,26 @@ var hi = { class: "docx-editor-vue__toolbar-shell" }, gi = {
3351
3341
  hangingIndent: t.hangingIndent ?? !1,
3352
3342
  tabStops: t.tabs ?? null
3353
3343
  };
3354
- }), $e = D(() => (x.value, Z()?.package?.theme ?? i.theme ?? null)), Q = R(null), et = R([]);
3344
+ }), Qe = D(() => (x.value, Q()?.package?.theme ?? i.theme ?? null)), $e = z(null), et = z([]);
3355
3345
  function tt(e, t) {
3356
- Q.value = ye(e, t), et.value = be(e, t);
3346
+ $e.value = ve(e, t), et.value = ye(e, t);
3357
3347
  }
3358
3348
  function nt() {
3359
- Q.value = null, et.value = [];
3349
+ $e.value = null, et.value = [];
3360
3350
  }
3361
- mi(() => i.fonts, (e) => {
3351
+ hi(() => i.fonts, (e) => {
3362
3352
  a("error", e), i.onError?.(e);
3363
3353
  });
3364
- let rt = D(() => $.value?.headerFooter ? Ke($.value.headerFooter) ?? null : null);
3365
- I(() => {
3366
- Je((e, t) => {
3367
- requestAnimationFrame(() => {
3354
+ let rt = D(() => $.value?.headerFooter ? Ge($.value.headerFooter) ?? null : null), it = D(() => rt.value ?? Z.value);
3355
+ L(() => {
3356
+ qe((e, t) => {
3357
+ x.value++, requestAnimationFrame(() => {
3368
3358
  let e = $.value;
3369
3359
  if (!e) return;
3370
3360
  tt(t, e.position);
3371
- let n = zt(e.position), r = y.value;
3361
+ let n = Bt(e.position), r = y.value;
3372
3362
  if (!n || !r) return;
3373
- let i = n.getBoundingClientRect(), a = r.getBoundingClientRect(), o = Y.value || 1;
3363
+ let i = n.getBoundingClientRect(), a = r.getBoundingClientRect(), o = X.value || 1;
3374
3364
  $.value = {
3375
3365
  ...e,
3376
3366
  targetRect: {
@@ -3381,20 +3371,20 @@ var hi = { class: "docx-editor-vue__toolbar-shell" }, gi = {
3381
3371
  }
3382
3372
  };
3383
3373
  });
3384
- }), U(() => $.value, (e) => {
3374
+ }), K(() => $.value, (e) => {
3385
3375
  if (!e) {
3386
3376
  nt();
3387
3377
  return;
3388
3378
  }
3389
- let t = X.value;
3379
+ let t = Z.value;
3390
3380
  if (t) {
3391
3381
  try {
3392
- let e = t.state.tr.setSelection(J.create(t.state.doc, 0));
3382
+ let e = t.state.tr.setSelection(he.create(t.state.doc, 0));
3393
3383
  t.dispatch(e);
3394
3384
  } catch {}
3395
3385
  t.dom.blur?.();
3396
3386
  }
3397
- ar.updateSelectionOverlay();
3387
+ or.updateSelectionOverlay();
3398
3388
  });
3399
3389
  let e = 0;
3400
3390
  function t() {
@@ -3402,35 +3392,35 @@ var hi = { class: "docx-editor-vue__toolbar-shell" }, gi = {
3402
3392
  e = 0;
3403
3393
  let t = $.value;
3404
3394
  if (!t?.headerFooter) return;
3405
- let n = Ke(t.headerFooter);
3395
+ let n = Ge(t.headerFooter);
3406
3396
  n && tt(n, t.position);
3407
3397
  }));
3408
3398
  }
3409
- window.addEventListener("scroll", t, !0), window.addEventListener("resize", t), F(() => {
3399
+ window.addEventListener("scroll", t, !0), window.addEventListener("resize", t), I(() => {
3410
3400
  e && cancelAnimationFrame(e), window.removeEventListener("scroll", t, !0), window.removeEventListener("resize", t);
3411
3401
  });
3412
3402
  });
3413
- let at = D(() => {
3403
+ let ot = D(() => {
3414
3404
  let e = [];
3415
- return H.value && e.push(`translateX(-${Pe}px)`), Y.value !== 1 && e.push(`scale(${Y.value})`), {
3405
+ return G.value && e.push(`translateX(-${Ne}px)`), X.value !== 1 && e.push(`scale(${X.value})`), {
3416
3406
  transform: e.length > 0 ? e.join(" ") : void 0,
3417
3407
  transformOrigin: "top center",
3418
3408
  transition: "transform 0.2s ease"
3419
3409
  };
3420
- }), ot = D(() => ({
3410
+ }), st = D(() => ({
3421
3411
  paddingLeft: "20px",
3422
- paddingRight: 20 + (H.value ? Pe * 2 : 0) + "px",
3412
+ paddingRight: 20 + (G.value ? Ne * 2 : 0) + "px",
3423
3413
  transition: "padding 0.2s ease"
3424
- })), st = D(() => {
3425
- let e = Ze.value;
3426
- return it(e?.pageWidth ?? 12240) * Y.value;
3427
- }), ct = D(() => {
3414
+ })), ct = D(() => {
3415
+ let e = Xe.value;
3416
+ return at(e?.pageWidth ?? 12240) * X.value;
3417
+ }), lt = D(() => {
3428
3418
  let e = /* @__PURE__ */ new Set();
3429
- for (let t of q.value) t.parentId == null && t.done && e.add(t.id);
3419
+ for (let t of Y.value) t.parentId == null && t.done && e.add(t.id);
3430
3420
  return e;
3431
- }), lt = D(() => {
3421
+ }), ut = D(() => {
3432
3422
  x.value;
3433
- let e = X.value;
3423
+ let e = Z.value;
3434
3424
  if (!e) return [];
3435
3425
  let t = /* @__PURE__ */ new Set(), n = [];
3436
3426
  return e.state.doc.descendants((e) => {
@@ -3445,218 +3435,219 @@ var hi = { class: "docx-editor-vue__toolbar-shell" }, gi = {
3445
3435
  }
3446
3436
  return !0;
3447
3437
  }), n.sort((e, t) => e.name.localeCompare(t.name));
3448
- }), ut = kt(), { floatingCommentBtn: dt, pendingCommentRange: ft, addCommentYPosition: pt, sidebarAutoOpenedRef: mt, extractCommentsAndChanges: ht, handleAddComment: gt, handleCancelAddComment: _t, handleStartAddComment: vt, handleMarkerClick: yt } = Qr({
3449
- editorView: X,
3450
- getDocument: Z,
3451
- comments: q,
3452
- trackedChanges: _e,
3453
- resolvedCommentIds: ct,
3454
- activeSidebarItem: G,
3455
- showSidebar: H,
3456
- isAddingComment: W,
3438
+ }), dt = At(), { floatingCommentBtn: ft, pendingCommentRange: pt, addCommentYPosition: mt, sidebarAutoOpenedRef: ht, extractCommentsAndChanges: gt, handleAddComment: _t, handleCancelAddComment: vt, handleStartAddComment: yt, handleMarkerClick: bt } = $r({
3439
+ editorView: Z,
3440
+ getDocument: Q,
3441
+ comments: Y,
3442
+ trackedChanges: ge,
3443
+ resolvedCommentIds: lt,
3444
+ activeSidebarItem: me,
3445
+ showSidebar: G,
3446
+ isAddingComment: q,
3457
3447
  readOnly: s,
3458
- zoom: Y,
3448
+ zoom: X,
3459
3449
  stateTick: x,
3460
3450
  pagesRef: g,
3461
3451
  pagesViewportRef: y,
3462
3452
  emit: a,
3463
- commentIdAllocator: ut,
3453
+ commentIdAllocator: dt,
3464
3454
  author: l,
3465
- commentCallbacks: Xe
3466
- }), { docxInputRef: bt, handleDocxFileChange: xt, handleDocumentNameChange: St, downloadCurrentDocument: Ct, loadDocumentBuffer: wt, loadDocument: Tt, save: Et } = Ur({
3467
- loadBuffer: Re,
3468
- loadParsedDocument: ze,
3469
- getDocument: Z,
3470
- saveBlob: Be,
3471
- extractCommentsAndChanges: ht,
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,
3459
+ getDocument: Q,
3460
+ saveBlob: ze,
3461
+ extractCommentsAndChanges: gt,
3472
3462
  emit: a,
3473
3463
  documentName: () => i.documentName,
3474
3464
  onDocumentNameChange: i.onDocumentNameChange,
3475
- nextTick: ue
3476
- }), { hyperlinkPopupData: Dt, handleHyperlinkSubmit: Ot, handleHyperlinkRemove: At, handleHyperlinkPopupNavigate: jt, handleHyperlinkPopupEdit: Mt, handleHyperlinkPopupRemove: Nt } = Wr({
3477
- editorView: X,
3478
- getCommands: We
3479
- }), { handleClearFormatting: Pt, handleApplyStyle: Ft, handleInsertPageBreak: It, handleInsertSymbol: Lt, applyFormatting: Rt, setParagraphStyle: Bt } = Gr({
3480
- editorView: X,
3481
- getDocument: Z
3482
- }), { handlePageSetupApply: Vt, handleLeftMarginChange: Ht, handleRightMarginChange: Ut, handleTopMarginChange: Wt, handleBottomMarginChange: Kt, handleIndentLeftChange: qt, handleIndentRightChange: Jt, handleFirstLineIndentChange: Yt, handleTabStopRemove: Xt } = Kr({
3483
- editorView: X,
3484
- getDocument: Z,
3465
+ nextTick: le
3466
+ }), { hyperlinkPopupData: Ot, handleHyperlinkSubmit: kt, handleHyperlinkRemove: jt, handleHyperlinkPopupNavigate: Mt, handleHyperlinkPopupEdit: Nt, handleHyperlinkPopupRemove: Pt } = Gr({
3467
+ editorView: Z,
3468
+ getCommands: Ue
3469
+ }), { handleClearFormatting: Ft, handleApplyStyle: It, handleInsertPageBreak: Lt, handleInsertSymbol: Rt, applyFormatting: zt, setParagraphStyle: Vt } = Kr({
3470
+ editorView: Z,
3471
+ activeView: it,
3472
+ getDocument: Q
3473
+ }), { handlePageSetupApply: Ht, handleLeftMarginChange: Ut, handleRightMarginChange: Wt, handleTopMarginChange: Gt, handleBottomMarginChange: qt, handleIndentLeftChange: Jt, handleIndentRightChange: Yt, handleFirstLineIndentChange: Xt, handleTabStopRemove: Zt } = qr({
3474
+ editorView: Z,
3475
+ getDocument: Q,
3485
3476
  readOnly: s,
3486
3477
  stateTick: x,
3487
- reLayout: Ge,
3478
+ reLayout: We,
3488
3479
  emit: a
3489
- }), { showWatermark: Zt, currentWatermark: $t, handleWatermarkApply: en } = qr({
3490
- editorView: X,
3480
+ }), { showWatermark: Qt, currentWatermark: en, handleWatermarkApply: tn } = Jr({
3481
+ editorView: Z,
3491
3482
  readOnly: s,
3492
3483
  stateTick: x
3493
- }), { handleToggleOutline: tn, handleOutlineNavigate: nn, handleToggleSidebar: on, handleEditorScrollMouseDown: sn } = Jr({
3494
- editorView: X,
3495
- showOutline: me,
3496
- showSidebar: H,
3497
- outlineHeadings: ve,
3498
- activeSidebarItem: G,
3499
- extractCommentsAndChanges: ht
3484
+ }), { handleToggleOutline: nn, handleOutlineNavigate: rn, handleToggleSidebar: sn, handleEditorScrollMouseDown: cn } = Yr({
3485
+ editorView: Z,
3486
+ showOutline: W,
3487
+ showSidebar: G,
3488
+ outlineHeadings: _e,
3489
+ activeSidebarItem: me,
3490
+ extractCommentsAndChanges: gt
3500
3491
  });
3501
- Yr({
3502
- showKeyboardShortcuts: he,
3492
+ Xr({
3493
+ showKeyboardShortcuts: fe,
3503
3494
  showFindReplace: E,
3504
3495
  showHyperlink: oe,
3505
- handleZoomKeyDown: je,
3496
+ handleZoomKeyDown: Ae,
3506
3497
  disableFindReplaceShortcuts: () => i.disableFindReplaceShortcuts
3507
3498
  });
3508
- let { addComment: ln, replyToComment: un, resolveComment: dn, proposeChange: fn, handleCommentReply: mn, handleCommentResolve: hn, handleCommentUnresolve: gn, handleCommentDelete: _n, handleAcceptChange: yn, handleRejectChange: bn, handleAcceptChangeById: xn, handleRejectChangeById: Sn, handleTrackedChangeReply: Cn } = Xr({
3509
- editorView: X,
3510
- getDocument: Z,
3511
- comments: q,
3512
- trackedChanges: _e,
3513
- showSidebar: H,
3514
- isAddingComment: W,
3515
- pendingCommentRange: ft,
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({
3500
+ editorView: Z,
3501
+ getDocument: Q,
3502
+ comments: Y,
3503
+ trackedChanges: ge,
3504
+ showSidebar: G,
3505
+ isAddingComment: q,
3506
+ pendingCommentRange: pt,
3516
3507
  contentChangeSubscribers: S,
3517
- extractCommentsAndChanges: ht,
3508
+ extractCommentsAndChanges: gt,
3518
3509
  emit: a,
3519
- commentIdAllocator: ut,
3510
+ commentIdAllocator: dt,
3520
3511
  author: l,
3521
- commentCallbacks: Xe
3522
- }), { selectedImage: wn, imageInteracting: Tn, imageToolbarContext: En, handleInsertImage: Dn, handleToolbarImageWrap: On, handleImageTransform: kn } = $r({
3523
- editorView: X,
3524
- zoom: Y,
3512
+ commentCallbacks: Ye
3513
+ }), { selectedImage: Tn, imageInteracting: En, imageToolbarContext: Dn, handleInsertImage: On, handleToolbarImageWrap: kn, handleImageTransform: An } = ei({
3514
+ editorView: Z,
3515
+ zoom: X,
3525
3516
  stateTick: x,
3526
- getCommands: We
3527
- }), An = te(), jn = null, { tableInsertButton: Mn, hfEdit: $, scrollPageInfo: Nn, resolvePos: Pn, setPmSelection: Fn, scrollVisiblePositionIntoView: In, handlePagesMouseDown: Ln, handlePagesMouseMove: Rn, handlePagesClick: zn, handlePagesDoubleClick: Bn, handleTableInsertClick: Vn, clearTableInsertTimer: Hn, handleHfSave: Un, handleHfRemove: Wn } = li({
3528
- editorView: 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({
3519
+ editorView: Z,
3529
3520
  pagesRef: g,
3530
3521
  pagesViewportRef: y,
3531
- selectedImage: wn,
3532
- imageInteracting: Tn,
3533
- hyperlinkPopupData: Dt,
3522
+ selectedImage: Tn,
3523
+ imageInteracting: En,
3524
+ hyperlinkPopupData: Ot,
3534
3525
  readOnly: s,
3535
- zoom: Y,
3536
- layout: Le,
3537
- tableResize: An,
3538
- getCommands: We,
3539
- getDocument: Z,
3540
- reLayout: Ge,
3526
+ zoom: X,
3527
+ layout: Ie,
3528
+ tableResize: jn,
3529
+ getCommands: Ue,
3530
+ getDocument: Q,
3531
+ reLayout: We,
3541
3532
  emit: a,
3542
- clearOverlay: rr,
3543
- syncHfPMs: qe,
3544
- getHfPmView: Ke,
3545
- setDocument: Ye
3546
- }), { contextMenu: Gn, imageContextMenu: Kn, imageContextMenuTextActions: qn, handleContextMenu: Jn, handleSelectedImageContextMenu: Yn, handleImageWrapSelect: Xn, handleContextMenuAction: Zn } = si({
3547
- editorView: X,
3548
- selectedImage: wn,
3549
- zoom: Y,
3550
- showImageProperties: M,
3551
- getCommands: We,
3552
- clearOverlay: rr,
3553
- setPmSelection: Fn,
3554
- resolvePos: Pn
3555
- }), { handleMenuAction: Qn, handleMenuTableInsert: $n } = di({
3556
- editorView: X,
3557
- getCommands: We,
3558
- docxInputRef: bt,
3559
- showPageSetup: ce,
3560
- showWatermark: Zt,
3533
+ 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({
3538
+ editorView: Z,
3539
+ selectedImage: Tn,
3540
+ zoom: X,
3541
+ showImageProperties: N,
3542
+ getCommands: Ue,
3543
+ clearOverlay: ir,
3544
+ setPmSelection: In,
3545
+ resolvePos: Fn
3546
+ }), { handleMenuAction: $n, handleMenuTableInsert: er } = fi({
3547
+ editorView: Z,
3548
+ getCommands: Ue,
3549
+ docxInputRef: xt,
3550
+ showPageSetup: se,
3551
+ showWatermark: Qt,
3561
3552
  showInsertImage: re,
3562
3553
  showHyperlink: oe,
3563
- showInsertSymbol: se,
3564
- showKeyboardShortcuts: he,
3565
- handleClearFormatting: Pt,
3566
- handleInsertPageBreak: It,
3567
- handleToggleOutline: tn,
3568
- handleToggleSidebar: on,
3569
- downloadCurrentDocument: Ct,
3554
+ showInsertSymbol: j,
3555
+ showKeyboardShortcuts: fe,
3556
+ handleClearFormatting: Ft,
3557
+ handleInsertPageBreak: Lt,
3558
+ handleToggleOutline: nn,
3559
+ handleToggleSidebar: sn,
3560
+ downloadCurrentDocument: wt,
3570
3561
  emit: a
3571
3562
  });
3572
- fi({
3563
+ pi({
3573
3564
  documentBuffer: () => i.documentBuffer,
3574
3565
  document: () => i.document,
3575
- loadDocumentBuffer: wt,
3576
- loadDocument: Tt,
3577
- sidebarAutoOpenedRef: mt
3566
+ loadDocumentBuffer: Tt,
3567
+ loadDocument: Et,
3568
+ sidebarAutoOpenedRef: ht
3578
3569
  });
3579
- let er = () => X.value, tr = () => g.value;
3580
- U(() => i.mode, (e) => {
3570
+ let tr = () => Z.value, nr = () => g.value;
3571
+ K(() => i.mode, (e) => {
3581
3572
  e && e !== o.value && (o.value = e);
3582
- }), U(() => i.showOutline, (e) => {
3583
- me.value = !!e;
3573
+ }), K(() => i.showOutline, (e) => {
3574
+ W.value = !!e;
3584
3575
  });
3585
- function nr(e) {
3576
+ function rr(e) {
3586
3577
  o.value !== e && (o.value = e, a("mode-change", e));
3587
3578
  }
3588
- I(() => {
3589
- jn = An.install();
3590
- }), F(() => {
3591
- jn?.();
3579
+ L(() => {
3580
+ Mn = jn.install();
3581
+ }), I(() => {
3582
+ Mn?.();
3592
3583
  });
3593
- function rr() {
3594
- ar.clearOverlay();
3595
- }
3596
3584
  function ir() {
3597
- ar.updateSelectionOverlay();
3585
+ or.clearOverlay();
3586
+ }
3587
+ function ar() {
3588
+ or.updateSelectionOverlay();
3598
3589
  }
3599
- let ar = ui({
3600
- editorView: X,
3590
+ let or = di({
3591
+ editorView: Z,
3601
3592
  pagesRef: g,
3602
- zoom: Y,
3603
- selectedImage: wn,
3593
+ zoom: X,
3594
+ selectedImage: Tn,
3604
3595
  isHfEditing: D(() => $.value !== null),
3605
- imageInteracting: Tn
3606
- }), or = w.onRender(() => ir());
3607
- ir(), F(() => {
3608
- or(), rr();
3596
+ imageInteracting: En
3597
+ }), sr = w.onRender(() => ar());
3598
+ ar(), I(() => {
3599
+ sr(), ir();
3609
3600
  });
3610
- let { exposed: sr } = pi({
3611
- editorView: X,
3612
- layout: Le,
3601
+ let { exposed: cr } = mi({
3602
+ editorView: Z,
3603
+ layout: Ie,
3613
3604
  pagesRef: g,
3614
3605
  pagesViewportRef: y,
3615
- zoom: Y,
3616
- comments: q,
3617
- focus: He,
3618
- destroy: Ue,
3619
- getDocument: Z,
3620
- setZoom: Ee,
3621
- save: Et,
3622
- loadDocument: Tt,
3623
- loadDocumentBuffer: wt,
3624
- addComment: ln,
3625
- replyToComment: un,
3626
- resolveComment: dn,
3627
- proposeChange: fn,
3628
- applyFormatting: Rt,
3629
- setParagraphStyle: Bt,
3630
- scrollVisiblePositionIntoView: In,
3606
+ zoom: X,
3607
+ comments: Y,
3608
+ focus: Ve,
3609
+ destroy: He,
3610
+ 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,
3620
+ setParagraphStyle: Vt,
3621
+ scrollVisiblePositionIntoView: Ln,
3631
3622
  contentChangeSubscribers: S,
3632
3623
  selectionChangeSubscribers: C,
3633
3624
  onPrint: i.onPrint
3634
3625
  });
3635
- return n(sr), (t, n) => (L(), k("div", {
3636
- class: N([
3626
+ return n(cr), (t, n) => (R(), k("div", {
3627
+ class: P([
3637
3628
  "docx-editor-vue ep-root paged-editor",
3638
3629
  e.className,
3639
3630
  {
3640
3631
  "paged-editor--readonly": s.value,
3641
- "paged-editor--hf-editing": V($) !== null,
3642
- "paged-editor--editing-header": V($)?.position === "header",
3643
- "paged-editor--editing-footer": V($)?.position === "footer"
3632
+ "paged-editor--hf-editing": U($) !== null,
3633
+ "paged-editor--editing-header": U($)?.position === "header",
3634
+ "paged-editor--editing-footer": U($)?.position === "footer"
3644
3635
  }
3645
3636
  ]),
3646
- style: P(e.style)
3637
+ style: F(e.style)
3647
3638
  }, [
3648
- A("div", hi, [j(vn, {
3639
+ A("div", gi, [M(yn, {
3649
3640
  "show-menu-bar": e.showMenuBar,
3650
3641
  "document-name": e.documentName,
3651
3642
  "document-name-editable": e.documentNameEditable,
3652
3643
  "render-logo": e.renderLogo,
3653
3644
  "render-title-bar-right": e.renderTitleBarRight,
3654
- onRename: V(St),
3655
- onMenuAction: V(Qn),
3656
- onInsertTable: V($n)
3645
+ onRename: U(Ct),
3646
+ onMenuAction: U($n),
3647
+ onInsertTable: U(er)
3657
3648
  }, {
3658
- "title-bar-left": ge(() => [fe(t.$slots, "title-bar-left")]),
3659
- "title-bar-right": ge(() => [fe(t.$slots, "title-bar-right")]),
3649
+ "title-bar-left": pe(() => [V(t.$slots, "title-bar-left")]),
3650
+ "title-bar-right": pe(() => [V(t.$slots, "title-bar-right")]),
3660
3651
  _: 3
3661
3652
  }, 8, [
3662
3653
  "show-menu-bar",
@@ -3667,37 +3658,37 @@ var hi = { class: "docx-editor-vue__toolbar-shell" }, gi = {
3667
3658
  "onRename",
3668
3659
  "onMenuAction",
3669
3660
  "onInsertTable"
3670
- ]), e.showToolbar ? (L(), ie(b, {
3661
+ ]), e.showToolbar ? (R(), ie(b, {
3671
3662
  key: 0,
3672
- view: V(X),
3673
- "get-commands": V(We),
3663
+ view: it.value,
3664
+ "get-commands": U(Ue),
3674
3665
  "state-tick": x.value,
3675
- "zoom-percent": V(xe),
3676
- "is-min-zoom": V(Se),
3677
- "is-max-zoom": V(Ce),
3678
- "zoom-presets": V(Ne),
3666
+ "zoom-percent": U(be),
3667
+ "is-min-zoom": U(xe),
3668
+ "is-max-zoom": U(Se),
3669
+ "zoom-presets": U(Me),
3679
3670
  "show-zoom-control": e.showZoomControl,
3680
3671
  "editor-mode": o.value,
3681
- "comments-sidebar-open": H.value,
3682
- "image-context": V(En),
3683
- theme: $e.value,
3672
+ "comments-sidebar-open": G.value,
3673
+ "image-context": U(Dn),
3674
+ theme: Qe.value,
3684
3675
  "font-families": e.fontFamilies,
3685
3676
  onInsertLink: n[0] ||= (e) => oe.value = !0,
3686
- onApplyStyle: V(Ft),
3687
- onZoomIn: V(Oe),
3688
- onZoomOut: V(ke),
3689
- onZoomSet: V(Ee),
3690
- onToggleSidebar: V(on),
3691
- onModeChange: nr,
3692
- onImageWrapType: V(On),
3693
- onImageProperties: n[1] ||= (e) => M.value = !0,
3694
- onImageTransform: V(kn)
3677
+ onApplyStyle: U(It),
3678
+ onZoomIn: U(De),
3679
+ onZoomOut: U(Oe),
3680
+ onZoomSet: U(Te),
3681
+ onToggleSidebar: U(sn),
3682
+ onModeChange: rr,
3683
+ onImageWrapType: U(kn),
3684
+ onImageProperties: n[1] ||= (e) => N.value = !0,
3685
+ onImageTransform: U(An)
3695
3686
  }, ae({
3696
- "table-context": ge(() => [j(h, {
3697
- view: V(X),
3698
- "get-commands": V(We),
3687
+ "table-context": pe(() => [M(h, {
3688
+ view: it.value,
3689
+ "get-commands": U(Ue),
3699
3690
  "state-tick": x.value,
3700
- theme: $e.value
3691
+ theme: Qe.value
3701
3692
  }, null, 8, [
3702
3693
  "view",
3703
3694
  "get-commands",
@@ -3707,11 +3698,11 @@ var hi = { class: "docx-editor-vue__toolbar-shell" }, gi = {
3707
3698
  _: 2
3708
3699
  }, [e.toolbarExtra ? {
3709
3700
  name: "toolbar-extra",
3710
- fn: ge(() => [(L(), ie(pe(e.toolbarExtra)))]),
3701
+ fn: pe(() => [(R(), ie(ue(e.toolbarExtra)))]),
3711
3702
  key: "0"
3712
3703
  } : {
3713
3704
  name: "toolbar-extra",
3714
- fn: ge(() => [fe(t.$slots, "toolbar-extra")]),
3705
+ fn: pe(() => [V(t.$slots, "toolbar-extra")]),
3715
3706
  key: "1"
3716
3707
  }]), 1032, [
3717
3708
  "view",
@@ -3735,35 +3726,35 @@ var hi = { class: "docx-editor-vue__toolbar-shell" }, gi = {
3735
3726
  "onImageWrapType",
3736
3727
  "onImageTransform"
3737
3728
  ])) : O("", !0)]),
3738
- j(cr, {
3729
+ M(lr, {
3739
3730
  "show-find-replace": E.value,
3740
3731
  "onUpdate:showFindReplace": n[2] ||= (e) => E.value = e,
3741
3732
  "show-insert-image": re.value,
3742
3733
  "onUpdate:showInsertImage": n[3] ||= (e) => re.value = e,
3743
3734
  "show-hyperlink": oe.value,
3744
3735
  "onUpdate:showHyperlink": n[4] ||= (e) => oe.value = e,
3745
- "show-insert-symbol": se.value,
3746
- "onUpdate:showInsertSymbol": n[5] ||= (e) => se.value = e,
3747
- "show-image-properties": M.value,
3748
- "onUpdate:showImageProperties": n[6] ||= (e) => M.value = e,
3749
- "show-page-setup": ce.value,
3750
- "onUpdate:showPageSetup": n[7] ||= (e) => ce.value = e,
3751
- "show-watermark": V(Zt),
3752
- "onUpdate:showWatermark": n[8] ||= (e) => le(Zt) ? Zt.value = e : null,
3753
- "show-keyboard-shortcuts": he.value,
3754
- "onUpdate:showKeyboardShortcuts": n[9] ||= (e) => he.value = e,
3755
- view: V(X),
3756
- bookmarks: lt.value,
3757
- "selected-image-pm-pos": V(wn)?.pmPos ?? null,
3758
- "section-properties": Ze.value,
3759
- "current-watermark": V($t),
3760
- "scroll-visible-position-into-view": V(In),
3761
- onInsertImage: V(Dn),
3762
- onInsertSymbol: V(Lt),
3763
- onHyperlinkSubmit: V(Ot),
3764
- onHyperlinkRemove: V(At),
3765
- onPageSetupApply: V(Vt),
3766
- onWatermarkApply: V(en)
3736
+ "show-insert-symbol": j.value,
3737
+ "onUpdate:showInsertSymbol": n[5] ||= (e) => j.value = e,
3738
+ "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)
3767
3758
  }, null, 8, [
3768
3759
  "show-find-replace",
3769
3760
  "show-insert-image",
@@ -3786,8 +3777,8 @@ var hi = { class: "docx-editor-vue__toolbar-shell" }, gi = {
3786
3777
  "onPageSetupApply",
3787
3778
  "onWatermarkApply"
3788
3779
  ]),
3789
- V(Ie) ? (L(), k("div", gi, B(V(Ie)), 1)) : O("", !0),
3790
- !V(Fe) && !V(Ie) ? (L(), k("div", _i, "Loading...")) : O("", !0),
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),
3791
3782
  A("div", {
3792
3783
  ref_key: "hiddenPmRef",
3793
3784
  ref: d,
@@ -3795,26 +3786,26 @@ var hi = { class: "docx-editor-vue__toolbar-shell" }, gi = {
3795
3786
  }, null, 512),
3796
3787
  A("div", {
3797
3788
  class: "docx-editor-vue__editor-scroll",
3798
- onMousedown: n[32] ||= (...e) => V(sn) && V(sn)(...e)
3799
- }, [e.showRuler && Ze.value ? (L(), k("div", {
3789
+ onMousedown: n[32] ||= (...e) => U(cn) && U(cn)(...e)
3790
+ }, [e.showRuler && Xe.value ? (R(), k("div", {
3800
3791
  key: 0,
3801
3792
  class: "docx-editor-vue__ruler-row",
3802
- style: P(ot.value)
3803
- }, [j(_, {
3804
- "section-props": Ze.value,
3805
- zoom: V(Y),
3793
+ style: F(st.value)
3794
+ }, [M(_, {
3795
+ "section-props": Xe.value,
3796
+ zoom: U(X),
3806
3797
  editable: !s.value,
3807
- "indent-left": Qe.value.indentLeft,
3808
- "indent-right": Qe.value.indentRight,
3809
- "first-line-indent": Qe.value.firstLineIndent,
3810
- "hanging-indent": Qe.value.hangingIndent,
3811
- "tab-stops": Qe.value.tabStops,
3812
- onLeftMarginChange: V(Ht),
3813
- onRightMarginChange: V(Ut),
3814
- onIndentLeftChange: V(qt),
3815
- onIndentRightChange: V(Jt),
3816
- onFirstLineIndentChange: V(Yt),
3817
- onTabStopRemove: V(Xt)
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)
3818
3809
  }, null, 8, [
3819
3810
  "section-props",
3820
3811
  "zoom",
@@ -3830,24 +3821,24 @@ var hi = { class: "docx-editor-vue__toolbar-shell" }, gi = {
3830
3821
  "onIndentRightChange",
3831
3822
  "onFirstLineIndentChange",
3832
3823
  "onTabStopRemove"
3833
- ])], 4)) : O("", !0), A("div", vi, [
3824
+ ])], 4)) : O("", !0), A("div", yi, [
3834
3825
  A("div", {
3835
3826
  ref_key: "pagesViewportRef",
3836
3827
  ref: y,
3837
3828
  class: "docx-editor-vue__pages-viewport",
3838
- onMousedown: n[23] ||= (...e) => V(Ln) && V(Ln)(...e),
3839
- onMousemove: n[24] ||= (...e) => V(Rn) && V(Rn)(...e),
3840
- onClick: n[25] ||= (...e) => V(zn) && V(zn)(...e),
3841
- onDblclick: n[26] ||= (...e) => V(Bn) && V(Bn)(...e),
3842
- onContextmenu: n[27] ||= K((...e) => V(Jn) && V(Jn)(...e), ["prevent"]),
3843
- onWheel: n[28] ||= (...e) => V(Ae) && V(Ae)(...e)
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)
3844
3835
  }, [
3845
- e.showRuler && Ze.value ? (L(), k("div", yi, [j(p, {
3846
- "section-props": Ze.value,
3847
- zoom: V(Y),
3836
+ e.showRuler && Xe.value ? (R(), k("div", bi, [M(p, {
3837
+ "section-props": Xe.value,
3838
+ zoom: U(X),
3848
3839
  editable: !s.value,
3849
- onTopMarginChange: V(Wt),
3850
- onBottomMarginChange: V(Kt)
3840
+ onTopMarginChange: U(Gt),
3841
+ onBottomMarginChange: U(qt)
3851
3842
  }, null, 8, [
3852
3843
  "section-props",
3853
3844
  "zoom",
@@ -3859,21 +3850,21 @@ var hi = { class: "docx-editor-vue__toolbar-shell" }, gi = {
3859
3850
  ref_key: "pagesRef",
3860
3851
  ref: g,
3861
3852
  class: "docx-editor-vue__pages paged-editor__pages",
3862
- style: P(at.value)
3853
+ style: F(ot.value)
3863
3854
  }, null, 4),
3864
- s.value ? O("", !0) : (L(), ie(pn, {
3855
+ s.value ? O("", !0) : (R(), ie(mn, {
3865
3856
  key: 1,
3866
3857
  container: g.value,
3867
- view: V(X)
3858
+ view: U(Z)
3868
3859
  }, null, 8, ["container", "view"])),
3869
- j(cn, {
3870
- "is-open": V($) !== null,
3871
- position: V($)?.position ?? "header",
3860
+ M(ln, {
3861
+ "is-open": U($) !== null,
3862
+ position: U($)?.position ?? "header",
3872
3863
  view: rt.value,
3873
- "target-rect": V($)?.targetRect ?? null,
3874
- onSave: V(Un),
3864
+ "target-rect": U($)?.targetRect ?? null,
3865
+ onSave: U(Wn),
3875
3866
  onClose: n[10] ||= (e) => $.value = null,
3876
- onRemove: V(Wn)
3867
+ onRemove: U(Gn)
3877
3868
  }, null, 8, [
3878
3869
  "is-open",
3879
3870
  "position",
@@ -3882,11 +3873,11 @@ var hi = { class: "docx-editor-vue__toolbar-shell" }, gi = {
3882
3873
  "onSave",
3883
3874
  "onRemove"
3884
3875
  ]),
3885
- (L(!0), k(T, null, de(V($) ? et.value : [], (e, t) => (L(), k("div", {
3876
+ (R(!0), k(T, null, B(U($) ? et.value : [], (e, t) => (R(), k("div", {
3886
3877
  key: `hf-sel-${t}-${e.top}-${e.left}`,
3887
3878
  class: "vue-hf-sel-rect",
3888
3879
  "aria-hidden": "true",
3889
- style: P({
3880
+ style: F({
3890
3881
  position: "fixed",
3891
3882
  top: `${e.top}px`,
3892
3883
  left: `${e.left}px`,
@@ -3897,74 +3888,74 @@ var hi = { class: "docx-editor-vue__toolbar-shell" }, gi = {
3897
3888
  zIndex: 9998
3898
3889
  })
3899
3890
  }, null, 4))), 128)),
3900
- V($) && Q.value ? (L(), k("div", {
3891
+ U($) && $e.value ? (R(), k("div", {
3901
3892
  key: 2,
3902
3893
  "aria-hidden": "true",
3903
- style: P({
3894
+ style: F({
3904
3895
  position: "fixed",
3905
- top: `${Q.value.top}px`,
3906
- left: `${Q.value.left}px`,
3896
+ top: `${$e.value.top}px`,
3897
+ left: `${$e.value.left}px`,
3907
3898
  width: "2px",
3908
- height: `${Q.value.height}px`,
3899
+ height: `${$e.value.height}px`,
3909
3900
  background: "#4285f4",
3910
3901
  pointerEvents: "none",
3911
3902
  zIndex: 9999,
3912
3903
  animation: "hf-caret-blink 1.06s steps(1) infinite"
3913
3904
  })
3914
3905
  }, null, 4)) : O("", !0),
3915
- j(Qt, {
3916
- "image-info": V(wn),
3917
- zoom: V(Y),
3918
- view: V(X),
3919
- onOpenProperties: n[11] ||= (e) => M.value = !0,
3920
- onDeselect: n[12] ||= (e) => wn.value = null,
3921
- onInteractStart: n[13] ||= (e) => Tn.value = !0,
3922
- onInteractEnd: n[14] ||= (e) => Tn.value = !1,
3923
- onContextMenu: V(Yn)
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)
3924
3915
  }, null, 8, [
3925
3916
  "image-info",
3926
3917
  "zoom",
3927
3918
  "view",
3928
3919
  "onContextMenu"
3929
3920
  ]),
3930
- j(Gt, {
3931
- "get-view": er,
3932
- "get-pages-container": tr,
3933
- zoom: V(Y),
3921
+ M(Kt, {
3922
+ "get-view": tr,
3923
+ "get-pages-container": nr,
3924
+ zoom: U(X),
3934
3925
  "transaction-version": x.value,
3935
- "sync-coordinator": V(w)
3926
+ "sync-coordinator": U(w)
3936
3927
  }, null, 8, [
3937
3928
  "zoom",
3938
3929
  "transaction-version",
3939
3930
  "sync-coordinator"
3940
3931
  ]),
3941
- V(dt) && !W.value && !s.value ? (L(), k("button", {
3932
+ U(ft) && !q.value && !s.value ? (R(), k("button", {
3942
3933
  key: 3,
3943
3934
  type: "button",
3944
3935
  class: "docx-editor-vue__floating-comment",
3945
- style: P({
3946
- top: V(dt).top + "px",
3947
- left: V(dt).left + "px"
3936
+ style: F({
3937
+ top: U(ft).top + "px",
3938
+ left: U(ft).left + "px"
3948
3939
  }),
3949
- title: V(u)("comments.addComment"),
3950
- onMousedown: n[15] ||= K((...e) => V(vt) && V(vt)(...e), ["prevent", "stop"])
3951
- }, [j(c, {
3940
+ title: U(u)("comments.addComment"),
3941
+ onMousedown: n[15] ||= J((...e) => U(yt) && U(yt)(...e), ["prevent", "stop"])
3942
+ }, [M(c, {
3952
3943
  name: "add_comment",
3953
3944
  size: 16
3954
- })], 44, bi)) : O("", !0),
3955
- V(Mn) && !s.value ? (L(), k("button", {
3945
+ })], 44, xi)) : O("", !0),
3946
+ U(Nn) && !s.value ? (R(), k("button", {
3956
3947
  key: 4,
3957
3948
  type: "button",
3958
3949
  class: "docx-editor-vue__table-insert-btn",
3959
- style: P({
3960
- left: V(Mn).x + "px",
3961
- top: V(Mn).y + "px"
3950
+ style: F({
3951
+ left: U(Nn).x + "px",
3952
+ top: U(Nn).y + "px"
3962
3953
  }),
3963
- title: V(Mn).type === "row" ? "Insert row below" : "Insert column to the right",
3964
- "aria-label": V(Mn).type === "row" ? "Insert row below" : "Insert column to the right",
3965
- onMousedown: n[16] ||= (...e) => V(Vn) && V(Vn)(...e),
3966
- onMouseenter: n[17] ||= (...e) => V(Hn) && V(Hn)(...e),
3967
- onMouseleave: n[18] ||= (e) => Mn.value = null
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
3968
3959
  }, [...n[37] ||= [A("svg", {
3969
3960
  width: "12",
3970
3961
  height: "12",
@@ -3975,15 +3966,15 @@ var hi = { class: "docx-editor-vue__toolbar-shell" }, gi = {
3975
3966
  stroke: "currentColor",
3976
3967
  "stroke-width": "1.5",
3977
3968
  "stroke-linecap": "round"
3978
- })], -1)]], 44, xi)) : O("", !0),
3979
- j(v, {
3980
- comments: q.value,
3969
+ })], -1)]], 44, Si)) : O("", !0),
3970
+ M(v, {
3971
+ comments: Y.value,
3981
3972
  "pages-container": g.value,
3982
- zoom: V(Y),
3983
- "page-width-px": st.value,
3984
- "sidebar-open": H.value,
3985
- "resolved-comment-ids": ct.value,
3986
- onMarkerClick: V(yt)
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)
3987
3978
  }, null, 8, [
3988
3979
  "comments",
3989
3980
  "pages-container",
@@ -3993,30 +3984,30 @@ var hi = { class: "docx-editor-vue__toolbar-shell" }, gi = {
3993
3984
  "resolved-comment-ids",
3994
3985
  "onMarkerClick"
3995
3986
  ]),
3996
- j(m, {
3997
- "is-open": H.value,
3998
- comments: q.value,
3999
- "tracked-changes": _e.value,
4000
- "is-adding-comment": W.value,
4001
- "add-comment-y-position": V(pt),
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),
4002
3993
  "show-resolved": !0,
4003
3994
  "pages-container": g.value,
4004
- "page-width-px": st.value,
4005
- zoom: V(Y),
4006
- "active-item-id": G.value,
4007
- onClose: n[19] ||= (e) => H.value = !1,
4008
- onAddComment: V(gt),
4009
- onCancelAddComment: V(_t),
4010
- onCommentReply: V(mn),
4011
- onCommentResolve: V(hn),
4012
- onCommentUnresolve: V(gn),
4013
- onCommentDelete: V(_n),
4014
- onAcceptChange: V(yn),
4015
- onRejectChange: V(bn),
4016
- onAcceptChangeById: V(xn),
4017
- onRejectChangeById: V(Sn),
4018
- onTrackedChangeReply: V(Cn),
4019
- "onUpdate:activeItemId": n[20] ||= (e) => G.value = e
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
4020
4011
  }, null, 8, [
4021
4012
  "is-open",
4022
4013
  "comments",
@@ -4039,14 +4030,14 @@ var hi = { class: "docx-editor-vue__toolbar-shell" }, gi = {
4039
4030
  "onRejectChangeById",
4040
4031
  "onTrackedChangeReply"
4041
4032
  ]),
4042
- j(Hr, {
4043
- data: V(Dt),
4033
+ M(Ur, {
4034
+ data: U(Ot),
4044
4035
  "read-only": s.value,
4045
- onNavigate: V(jt),
4046
- onCopy: n[21] ||= (e) => Dt.value = null,
4047
- onEdit: V(Mt),
4048
- onRemove: V(Nt),
4049
- onClose: n[22] ||= (e) => Dt.value = null
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
4050
4041
  }, null, 8, [
4051
4042
  "data",
4052
4043
  "read-only",
@@ -4055,32 +4046,32 @@ var hi = { class: "docx-editor-vue__toolbar-shell" }, gi = {
4055
4046
  "onRemove"
4056
4047
  ])
4057
4048
  ], 544),
4058
- !me.value && e.showOutlineButton ? (L(), k("button", {
4049
+ !W.value && e.showOutlineButton ? (R(), k("button", {
4059
4050
  key: 0,
4060
4051
  type: "button",
4061
4052
  class: "docx-editor-vue__outline-toggle",
4062
4053
  title: "Show document outline",
4063
- onClick: n[29] ||= (...e) => V(tn) && V(tn)(...e),
4064
- onMousedown: n[30] ||= K(() => {}, ["stop"])
4065
- }, [j(c, {
4054
+ onClick: n[29] ||= (...e) => U(nn) && U(nn)(...e),
4055
+ onMousedown: n[30] ||= J(() => {}, ["stop"])
4056
+ }, [M(c, {
4066
4057
  name: "format_list_bulleted",
4067
4058
  size: 20
4068
4059
  })], 32)) : O("", !0),
4069
- V(Nn).totalPages > 1 ? (L(), ie(an, {
4060
+ U(Pn).totalPages > 1 ? (R(), ie(on, {
4070
4061
  key: 1,
4071
- "current-page": V(Nn).currentPage,
4072
- "total-pages": V(Nn).totalPages,
4073
- visible: V(Nn).visible
4062
+ "current-page": U(Pn).currentPage,
4063
+ "total-pages": U(Pn).totalPages,
4064
+ visible: U(Pn).visible
4074
4065
  }, null, 8, [
4075
4066
  "current-page",
4076
4067
  "total-pages",
4077
4068
  "visible"
4078
4069
  ])) : O("", !0),
4079
- j(rn, {
4080
- "is-open": me.value,
4081
- headings: ve.value,
4082
- onClose: n[31] ||= (e) => me.value = !1,
4083
- onNavigate: V(nn)
4070
+ M(an, {
4071
+ "is-open": W.value,
4072
+ headings: _e.value,
4073
+ onClose: n[31] ||= (e) => W.value = !1,
4074
+ onNavigate: U(rn)
4084
4075
  }, null, 8, [
4085
4076
  "is-open",
4086
4077
  "headings",
@@ -4089,23 +4080,23 @@ var hi = { class: "docx-editor-vue__toolbar-shell" }, gi = {
4089
4080
  ])], 32),
4090
4081
  A("input", {
4091
4082
  ref_key: "docxInputRef",
4092
- ref: bt,
4083
+ ref: xt,
4093
4084
  type: "file",
4094
4085
  accept: ".docx,application/vnd.openxmlformats-officedocument.wordprocessingml.document",
4095
4086
  style: { display: "none" },
4096
- onChange: n[33] ||= (...e) => V(xt) && V(xt)(...e)
4087
+ onChange: n[33] ||= (...e) => U(St) && U(St)(...e)
4097
4088
  }, null, 544),
4098
- j(Mr, {
4089
+ M(Nr, {
4099
4090
  "read-only": s.value,
4100
- "context-menu": V(Gn),
4101
- "image-context-menu": V(Kn),
4102
- "image-context-menu-text-actions": V(qn),
4103
- "can-open-image-properties": !!V(wn),
4104
- onContextMenuAction: V(Zn),
4105
- onCloseContextMenu: n[34] ||= (e) => V(Gn).isOpen = !1,
4106
- onImageWrapSelect: V(Xn),
4107
- onCloseImageContextMenu: n[35] ||= (e) => Kn.value = null,
4108
- onOpenImageProperties: n[36] ||= (e) => M.value = !0
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),
4098
+ onCloseImageContextMenu: n[35] ||= (e) => qn.value = null,
4099
+ onOpenImageProperties: n[36] ||= (e) => N.value = !0
4109
4100
  }, null, 8, [
4110
4101
  "read-only",
4111
4102
  "context-menu",
@@ -4120,8 +4111,8 @@ var hi = { class: "docx-editor-vue__toolbar-shell" }, gi = {
4120
4111
  });
4121
4112
  //#endregion
4122
4113
  //#region src/renderAsync.ts
4123
- async function Ci(e, t, n = {}) {
4124
- let r = e instanceof ArrayBuffer ? e : await Be(e), i = null, a = null, o = !1, s = {
4114
+ async function wi(e, t, n = {}) {
4115
+ let r = e instanceof ArrayBuffer ? e : await ze(e), i = null, a = null, o = !1, s = {
4125
4116
  save: async () => {
4126
4117
  let e = await (i?.save() ?? Promise.resolve(null));
4127
4118
  return e ? new Blob([e], { type: "application/vnd.openxmlformats-officedocument.wordprocessingml.document" }) : null;
@@ -4143,7 +4134,7 @@ async function Ci(e, t, n = {}) {
4143
4134
  };
4144
4135
  return new Promise((e, c) => {
4145
4136
  a = re({ setup() {
4146
- return () => ce(Si, {
4137
+ return () => se(Ci, {
4147
4138
  ...n,
4148
4139
  documentBuffer: r,
4149
4140
  showToolbar: n.showToolbar ?? !0,
@@ -4167,6 +4158,6 @@ async function Ci(e, t, n = {}) {
4167
4158
  }
4168
4159
  //#endregion
4169
4160
  //#region src/index.ts
4170
- var wi = "0.0.2";
4161
+ var Ti = "0.0.2";
4171
4162
  //#endregion
4172
- export { Si as DocxEditor, wi as VERSION, Lt as createDocumentWithText, Rt as createEmptyDocument, r as defaultLocale, a as i18nPlugin, f as provideLocale, Ci as renderAsync, n as useTranslation };
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 };