@bireturn/word-editor 1.0.8 → 1.0.9

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.
@@ -1,13 +1,13 @@
1
1
  var yn = Object.defineProperty;
2
2
  var bn = (t, e, n) => e in t ? yn(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
3
3
  var N = (t, e, n) => bn(t, typeof e != "symbol" ? e + "" : e, n);
4
- import { computed as re, ref as ie, onMounted as yt, onUnmounted as st, openBlock as u, createElementBlock as g, normalizeStyle as V, createElementVNode as Z, Fragment as W, renderList as Y, normalizeClass as Ae, createBlock as Ie, resolveDynamicComponent as ot, toDisplayString as J, unref as K, createCommentVNode as pe, render as Kt, h as xn, defineComponent as _n, getCurrentInstance as kn, watch as Ke, nextTick as we, createVNode as U, createTextVNode as Be, isVNode as wn, renderSlot as Cn, resolveComponent as Mn, inject as pt, withCtx as qe, provide as vt, toRef as In, createSlots as En, reactive as Ut } from "vue";
5
- import { DynamicScroller as Sn, DynamicScrollerItem as Fn } from "vue-virtual-scroller";
6
- import { ChevronRight as qt, MoreHorizontal as Ct, Download as dt, Upload as Tn, Save as An, RotateCcw as Pn, History as $n, Settings as Ln, Info as Rn, Globe as Hn, Lock as On, Share as Bn, ShieldCheck as Dn, Search as zn, Filter as Nn, SortDesc as Vn, SortAsc as jn, Minus as Kn, Plus as Mt, Eye as It, FileText as ut, Grid as Un, Type as Et, FileDown as St, Layers as Ft, Edit as qn, Move as Wn, Copy as Gn, Trash2 as Tt, Clipboard as At, PlusCircle as Pt, ArrowDown as $t, Navigation as Lt, ChevronDown as Jn, PanelLeftOpen as Xn, ListTree as Yn, PanelLeftClose as Zn } from "lucide-vue-next";
7
- const Qn = { class: "we-vt-context-menu--option-wrapper modern-menu-wrapper" }, ei = ["onMouseenter", "onMouseleave"], ti = ["onClick"], ni = { class: "we-vt-context-menu--link-content menu-label" }, ii = {
4
+ import { computed as de, ref as te, onMounted as _t, onUnmounted as rt, openBlock as u, createElementBlock as g, normalizeStyle as V, createElementVNode as ne, Fragment as G, renderList as Q, normalizeClass as Pe, createBlock as Fe, resolveDynamicComponent as at, toDisplayString as Y, unref as K, createCommentVNode as ve, render as qt, h as _n, defineComponent as xn, getCurrentInstance as kn, watch as Ke, nextTick as Se, createVNode as q, createTextVNode as Le, isVNode as wn, renderSlot as Cn, resolveComponent as Mn, inject as mt, withCtx as qe, provide as yt, createSlots as In, reactive as Wt } from "vue";
5
+ import { DynamicScroller as En, DynamicScrollerItem as Sn } from "vue-virtual-scroller";
6
+ import { ChevronRight as Gt, MoreHorizontal as It, Download as ht, Upload as Fn, Save as Tn, RotateCcw as An, History as Pn, Settings as $n, Info as Ln, Globe as Rn, Lock as Hn, Share as On, ShieldCheck as Bn, Search as Dn, Filter as zn, SortDesc as Nn, SortAsc as Vn, Minus as jn, Plus as Et, Eye as St, FileText as ft, Grid as Kn, Type as Ft, FileDown as Tt, Layers as At, Edit as Un, Move as qn, Copy as Wn, Trash2 as Pt, Clipboard as $t, PlusCircle as Lt, ArrowDown as Rt, Navigation as Ht, ChevronDown as Gn, PanelLeftOpen as Jn, ListTree as Xn, PanelLeftClose as Yn } from "lucide-vue-next";
7
+ const Zn = { class: "we-vt-context-menu--option-wrapper modern-menu-wrapper" }, Qn = ["onMouseenter", "onMouseleave"], ei = ["onClick"], ti = { class: "we-vt-context-menu--link-content menu-label" }, ni = {
8
8
  key: 0,
9
9
  class: "we-vt-context-menu--submenu modern-submenu"
10
- }, li = ["onClick"], oi = { class: "we-vt-context-menu--link-content submenu-label" }, ai = {
10
+ }, ii = ["onClick"], li = { class: "we-vt-context-menu--link-content submenu-label" }, oi = {
11
11
  __name: "ContextMenu",
12
12
  props: {
13
13
  // 事件
@@ -30,243 +30,243 @@ const Qn = { class: "we-vt-context-menu--option-wrapper modern-menu-wrapper" },
30
30
  },
31
31
  emits: ["close", "menuClick"],
32
32
  setup(t, { emit: e }) {
33
- const n = e, l = t, o = re(() => {
34
- var D, A;
33
+ const n = e, l = t, o = de(() => {
34
+ var D, T;
35
35
  return {
36
36
  left: `${(D = l.e) == null ? void 0 : D.pageX}px`,
37
- top: `${(A = l.e) == null ? void 0 : A.pageY}px`
37
+ top: `${(T = l.e) == null ? void 0 : T.pageY}px`
38
38
  };
39
- }), s = ie([]), v = ie(null);
39
+ }), s = te([]), v = te(null);
40
40
  let m = null;
41
- const y = ie(), r = (D, A, h) => {
41
+ const y = te(), r = (D, T, h) => {
42
42
  if (D.children && D.children.length > 0) {
43
- A && A.preventDefault() && A.stopPropagation();
43
+ T && T.preventDefault() && T.stopPropagation();
44
44
  return;
45
45
  }
46
- D.disabled || (h ? n("menuClick", { ...D, parent: h.code }, l.row) : n("menuClick", D, l.row)), A && A.preventDefault() && A.stopPropagation();
46
+ D.disabled || (h ? n("menuClick", { ...D, parent: h.code }, l.row) : n("menuClick", D, l.row)), T && T.preventDefault() && T.stopPropagation();
47
47
  }, M = (D) => {
48
- let A = D.target;
49
- for (; A && A != y.value; )
50
- A = A.parentNode;
51
- A != y.value && n("close");
52
- }, _ = (D, A) => {
53
- D.currentTarget.classList.add("link--active"), m && (clearTimeout(m), m = null), A.children && A.children.length > 0 ? v.value = A.code : m = setTimeout(() => {
48
+ let T = D.target;
49
+ for (; T && T != y.value; )
50
+ T = T.parentNode;
51
+ T != y.value && n("close");
52
+ }, x = (D, T) => {
53
+ D.currentTarget.classList.add("link--active"), m && (clearTimeout(m), m = null), T.children && T.children.length > 0 ? v.value = T.code : m = setTimeout(() => {
54
54
  v.value = null;
55
55
  }, 100);
56
- }, H = (D, A) => {
57
- D.currentTarget.classList.remove("link--active"), A.children && A.children.length > 0 && (m = setTimeout(() => {
58
- v.value === A.code && (v.value = null);
56
+ }, $ = (D, T) => {
57
+ D.currentTarget.classList.remove("link--active"), T.children && T.children.length > 0 && (m = setTimeout(() => {
58
+ v.value === T.code && (v.value = null);
59
59
  }, 300));
60
60
  }, B = (D) => {
61
61
  m && (clearTimeout(m), m = null), D.currentTarget.classList.add("link--active");
62
- }, q = (D) => {
62
+ }, W = (D) => {
63
63
  D.currentTarget.classList.remove("link--active");
64
- }, S = (D) => {
65
- const A = D.code || "", h = (D.name || "").toLowerCase(), I = {
64
+ }, I = (D) => {
65
+ const T = D.code || "", h = (D.name || "").toLowerCase(), F = {
66
66
  // 添加操作 - 根据具体类型使用不同图标
67
- "add-current": Lt,
67
+ "add-current": Ht,
68
68
  // 添加(当前位置)
69
- "add-next": $t,
69
+ "add-next": Rt,
70
70
  // 添加(下一行)
71
- "add-child": Pt,
71
+ "add-child": Lt,
72
72
  // 添加(子节点)
73
73
  // 基本操作
74
- paste: At,
74
+ paste: $t,
75
75
  // 粘贴
76
- delete: Tt,
76
+ delete: Pt,
77
77
  // 删除
78
- copy: Gn,
78
+ copy: Wn,
79
79
  // 复制
80
- cut: Wn,
80
+ cut: qn,
81
81
  // 剪切
82
- edit: qn,
82
+ edit: Un,
83
83
  // 编辑
84
84
  // 导出操作 - 根据范围使用不同图标
85
- export_part_section: Ft,
85
+ export_part_section: At,
86
86
  // 导出此节点所在节
87
- export_part_chapter: St,
87
+ export_part_chapter: Tt,
88
88
  // 导出此节点所在章
89
- export_full: dt,
89
+ export_full: ht,
90
90
  // 完整导出
91
91
  // 文件格式
92
- pdf: ut,
92
+ pdf: ft,
93
93
  // PDF格式
94
- word: Et,
94
+ word: Ft,
95
95
  // WORD格式
96
- excel: Un,
96
+ excel: Kn,
97
97
  // Excel格式
98
- txt: ut,
98
+ txt: ft,
99
99
  // 文本格式
100
100
  // 视图操作
101
- view: It,
101
+ view: St,
102
102
  // 查看
103
- preview: It,
103
+ preview: St,
104
104
  // 预览
105
- expand: Mt,
105
+ expand: Et,
106
106
  // 展开
107
- collapse: Kn,
107
+ collapse: jn,
108
108
  // 折叠
109
109
  // 排序和过滤
110
- "sort-asc": jn,
110
+ "sort-asc": Vn,
111
111
  // 升序
112
- "sort-desc": Vn,
112
+ "sort-desc": Nn,
113
113
  // 降序
114
- filter: Nn,
114
+ filter: zn,
115
115
  // 过滤
116
- search: zn,
116
+ search: Dn,
117
117
  // 搜索
118
118
  // 权限操作
119
- permission: Dn,
119
+ permission: Bn,
120
120
  // 权限设置
121
- share: Bn,
121
+ share: On,
122
122
  // 分享
123
- lock: On,
123
+ lock: Hn,
124
124
  // 锁定
125
- unlock: Hn,
125
+ unlock: Rn,
126
126
  // 解锁
127
127
  // 其他操作
128
- info: Rn,
128
+ info: Ln,
129
129
  // 信息
130
- settings: Ln,
130
+ settings: $n,
131
131
  // 设置
132
- history: $n,
132
+ history: Pn,
133
133
  // 历史
134
- refresh: Pn,
134
+ refresh: An,
135
135
  // 刷新
136
- save: An,
136
+ save: Tn,
137
137
  // 保存
138
- upload: Tn,
138
+ upload: Fn,
139
139
  // 上传
140
- download: dt,
140
+ download: ht,
141
141
  // 下载
142
- more: Ct
142
+ more: It
143
143
  // 更多
144
144
  };
145
- return I[A] ? I[A] : h.includes("添加") || h.includes("add") ? h.includes("当前") || h.includes("current") ? Lt : h.includes("下") || h.includes("next") ? $t : h.includes("子") || h.includes("child") ? Pt : Mt : h.includes("导出") || h.includes("export") ? h.includes("节") || h.includes("section") ? Ft : h.includes("章") || h.includes("chapter") ? St : dt : h.includes("粘贴") || h.includes("paste") ? At : h.includes("删除") || h.includes("delete") ? Tt : h.includes("pdf") ? ut : h.includes("word") ? Et : Ct;
145
+ return F[T] ? F[T] : h.includes("添加") || h.includes("add") ? h.includes("当前") || h.includes("current") ? Ht : h.includes("下") || h.includes("next") ? Rt : h.includes("子") || h.includes("child") ? Lt : Et : h.includes("导出") || h.includes("export") ? h.includes("节") || h.includes("section") ? At : h.includes("章") || h.includes("chapter") ? Tt : ht : h.includes("粘贴") || h.includes("paste") ? $t : h.includes("删除") || h.includes("delete") ? Pt : h.includes("pdf") ? ft : h.includes("word") ? Ft : It;
146
146
  };
147
- return yt(() => {
148
- var D, A, h, I, L, F, Q;
149
- (D = l.menuConfig) != null && D.visibleMethod && typeof ((A = l.menuConfig) == null ? void 0 : A.visibleMethod) == "function" && ((L = l.menuConfig) == null || L.visibleMethod({
150
- options: (I = (h = l.menuConfig) == null ? void 0 : h.body) == null ? void 0 : I.options,
147
+ return _t(() => {
148
+ var D, T, h, F, P, E, X;
149
+ (D = l.menuConfig) != null && D.visibleMethod && typeof ((T = l.menuConfig) == null ? void 0 : T.visibleMethod) == "function" && ((P = l.menuConfig) == null || P.visibleMethod({
150
+ options: (F = (h = l.menuConfig) == null ? void 0 : h.body) == null ? void 0 : F.options,
151
151
  row: l.row
152
- })), s.value = (((Q = (F = l.menuConfig) == null ? void 0 : F.body) == null ? void 0 : Q.options) || []).flat(), document.addEventListener("click", M, !0);
153
- }), st(() => {
152
+ })), s.value = (((X = (E = l.menuConfig) == null ? void 0 : E.body) == null ? void 0 : X.options) || []).flat(), document.addEventListener("click", M, !0);
153
+ }), rt(() => {
154
154
  document.removeEventListener("click", M, !0);
155
- }), (D, A) => (u(), g("div", {
155
+ }), (D, T) => (u(), g("div", {
156
156
  class: "we-vt-table--context-menu-wrapper virtual-table-menu modern-virtual-menu",
157
157
  ref_key: "contextMenuRef",
158
158
  ref: y,
159
159
  style: V([{ display: "inline-block" }, o.value])
160
160
  }, [
161
- Z("ul", Qn, [
162
- (u(!0), g(W, null, Y(s.value, (h) => (u(), g("li", {
163
- class: Ae({
161
+ ne("ul", Zn, [
162
+ (u(!0), g(G, null, Q(s.value, (h) => (u(), g("li", {
163
+ class: Pe({
164
164
  "link--disabled": h.disabled,
165
165
  "has-children": h.children && h.children.length > 0,
166
166
  "modern-menu-item": !0
167
167
  }),
168
168
  key: h.code,
169
- onMouseenter: (I) => _(I, h),
170
- onMouseleave: (I) => H(I, h)
169
+ onMouseenter: (F) => x(F, h),
170
+ onMouseleave: (F) => $(F, h)
171
171
  }, [
172
- Z("a", {
172
+ ne("a", {
173
173
  class: "we-vt-context-menu--link modern-menu-link",
174
- onClick: (I) => r(h, I)
174
+ onClick: (F) => r(h, F)
175
175
  }, [
176
- (u(), Ie(ot(S(h)), {
176
+ (u(), Fe(at(I(h)), {
177
177
  size: 16,
178
178
  class: "menu-icon"
179
179
  })),
180
- Z("span", ni, J(h.name), 1),
181
- h.children && h.children.length > 0 ? (u(), Ie(K(qt), {
180
+ ne("span", ti, Y(h.name), 1),
181
+ h.children && h.children.length > 0 ? (u(), Fe(K(Gt), {
182
182
  key: 0,
183
183
  size: 14,
184
184
  class: "submenu-arrow"
185
- })) : pe("", !0)
186
- ], 8, ti),
187
- h.children && h.children.length > 0 && v.value === h.code ? (u(), g("ul", ii, [
188
- (u(!0), g(W, null, Y(h.children, (I) => (u(), g("li", {
189
- key: I.code,
190
- class: Ae({
191
- "link--disabled": I.disabled,
185
+ })) : ve("", !0)
186
+ ], 8, ei),
187
+ h.children && h.children.length > 0 && v.value === h.code ? (u(), g("ul", ni, [
188
+ (u(!0), g(G, null, Q(h.children, (F) => (u(), g("li", {
189
+ key: F.code,
190
+ class: Pe({
191
+ "link--disabled": F.disabled,
192
192
  "modern-submenu-item": !0
193
193
  }),
194
194
  onMouseenter: B,
195
- onMouseleave: q
195
+ onMouseleave: W
196
196
  }, [
197
- Z("a", {
197
+ ne("a", {
198
198
  class: "we-vt-context-menu--link modern-submenu-link",
199
- onClick: (L) => r(I, L, h)
199
+ onClick: (P) => r(F, P, h)
200
200
  }, [
201
- (u(), Ie(ot(S(I)), {
201
+ (u(), Fe(at(I(F)), {
202
202
  size: 14,
203
203
  class: "submenu-icon"
204
204
  })),
205
- Z("span", oi, J(I.name), 1)
206
- ], 8, li)
205
+ ne("span", li, Y(F.name), 1)
206
+ ], 8, ii)
207
207
  ], 34))), 128))
208
- ])) : pe("", !0)
209
- ], 42, ei))), 128))
208
+ ])) : ve("", !0)
209
+ ], 42, Qn))), 128))
210
210
  ])
211
211
  ], 4));
212
212
  }
213
- }, Wt = Symbol("component_container");
214
- function si(t, e, n) {
215
- const l = xn(t, { ...e }, n), o = document.createElement("div");
216
- return document.body.appendChild(o), l[Wt] = o, Kt(l, o), l.component;
213
+ }, Jt = Symbol("component_container");
214
+ function ai(t, e, n) {
215
+ const l = _n(t, { ...e }, n), o = document.createElement("div");
216
+ return document.body.appendChild(o), l[Jt] = o, qt(l, o), l.component;
217
217
  }
218
- function ri(t) {
218
+ function si(t) {
219
219
  var n;
220
- const e = t.vnode[Wt];
221
- Kt(null, e), e != null && e.checkVisibility && (e != null && e.checkVisibility()) && ((n = document.body) == null || n.removeChild(e));
220
+ const e = t.vnode[Jt];
221
+ qt(null, e), e != null && e.checkVisibility && (e != null && e.checkVisibility()) && ((n = document.body) == null || n.removeChild(e));
222
222
  }
223
- let Gt;
224
- const ci = (t) => {
225
- Gt = si(ai, t, null);
226
- }, di = function(t) {
223
+ let Xt;
224
+ const ri = (t) => {
225
+ Xt = ai(oi, t, null);
226
+ }, ci = function(t) {
227
227
  const e = t.onClose;
228
228
  return t.onClose = () => {
229
- e && e.call(), ri(Gt);
230
- }, ci(t), t;
229
+ e && e.call(), si(Xt);
230
+ }, ri(t), t;
231
231
  };
232
- function ui(t, e, n) {
232
+ function di(t, e, n) {
233
233
  const l = (n == null ? void 0 : n.keyField) || (n == null ? void 0 : n.rowField) || "node_id", o = (n == null ? void 0 : n.parentField) || "parent_id", s = (n == null ? void 0 : n.parentField) || "order";
234
234
  if (!(t != null && t.length))
235
235
  return t;
236
236
  const v = {};
237
237
  t.forEach((M) => {
238
- const _ = M[o];
239
- v[_] || (v[_] = []), v[_].push(M);
238
+ const x = M[o];
239
+ v[x] || (v[x] = []), v[x].push(M);
240
240
  });
241
241
  function m(M) {
242
- const _ = v[M] || [];
243
- _.sort(
244
- (B, q) => B[s] && q[s] ? B[s] - q[s] : 0
242
+ const x = v[M] || [];
243
+ x.sort(
244
+ (B, W) => B[s] && W[s] ? B[s] - W[s] : 0
245
245
  );
246
- const H = [];
247
- return _.forEach((B) => {
248
- H.push(B), H.push(...m(B[l]));
249
- }), H;
246
+ const $ = [];
247
+ return x.forEach((B) => {
248
+ $.push(B), $.push(...m(B[l]));
249
+ }), $;
250
250
  }
251
251
  let y = [];
252
252
  if (Array.isArray(e))
253
253
  y = e;
254
254
  else {
255
- const M = new Set(t.map((B) => B[l])), _ = t.filter((B) => !M.has(B[o]));
256
- if (_.length === 0)
255
+ const M = new Set(t.map((B) => B[l])), x = t.filter((B) => !M.has(B[o]));
256
+ if (x.length === 0)
257
257
  throw new Error("无法确定根节点:可能存在循环引用或数据不完整");
258
- const H = {};
259
- _.forEach((B) => {
260
- const q = B[o];
261
- H[q] = (H[q] || 0) + 1;
262
- }), y = Object.entries(H).map(([B]) => B);
258
+ const $ = {};
259
+ x.forEach((B) => {
260
+ const W = B[o];
261
+ $[W] = ($[W] || 0) + 1;
262
+ }), y = Object.entries($).map(([B]) => B);
263
263
  }
264
264
  let r = [];
265
265
  return y.forEach((M) => {
266
266
  r = r.concat(m(M));
267
267
  }), r;
268
268
  }
269
- function Rt(t, e, n) {
269
+ function Ot(t, e, n) {
270
270
  let l;
271
271
  for (; t && t.nodeType && t !== document; ) {
272
272
  if (t.className && t.className.split && t.className.split(" ").indexOf(e) > -1)
@@ -277,10 +277,10 @@ function Rt(t, e, n) {
277
277
  }
278
278
  return l;
279
279
  }
280
- function hi(t) {
280
+ function ui(t) {
281
281
  return typeof t == "function" || Object.prototype.toString.call(t) === "[object Object]" && !wn(t);
282
282
  }
283
- const fi = /* @__PURE__ */ _n({
283
+ const hi = /* @__PURE__ */ xn({
284
284
  name: "VirtualTable",
285
285
  props: {
286
286
  data: {
@@ -360,26 +360,26 @@ const fi = /* @__PURE__ */ _n({
360
360
  slots: n,
361
361
  expose: l
362
362
  }) {
363
- var wt;
364
- const o = kn(), s = ie(), v = ie(!1), m = ie(null), y = ie(null), r = ie([]);
363
+ var Mt;
364
+ const o = kn(), s = te(), v = te(!1), m = te(null), y = te(null), r = te([]);
365
365
  let M = /* @__PURE__ */ new Map();
366
- const _ = /* @__PURE__ */ new Map();
367
- ie(0);
368
- const H = ie([]);
369
- ie([]);
370
- const B = ie(/* @__PURE__ */ new Set()), q = ie(/* @__PURE__ */ new Set()), S = ie(null), D = 2, A = /* @__PURE__ */ new WeakMap(), h = ie(null), I = ie(""), L = /* @__PURE__ */ new Set(), F = re(() => {
366
+ const x = /* @__PURE__ */ new Map();
367
+ te(0);
368
+ const $ = te([]);
369
+ te([]);
370
+ const B = te(/* @__PURE__ */ new Set()), W = te(/* @__PURE__ */ new Set()), I = te(null), D = 2, T = /* @__PURE__ */ new WeakMap(), h = te(null), F = te(""), P = /* @__PURE__ */ new Set(), E = de(() => {
371
371
  try {
372
372
  return Array.isArray(r.value) ? r.value : [];
373
373
  } catch {
374
374
  return [];
375
375
  }
376
- }), Q = (i) => {
376
+ }), X = (i) => {
377
377
  var p, d, f;
378
378
  if (!i) return 30;
379
379
  if (i.height) return i.height;
380
380
  const a = `${i.content_type}_${((p = i.content) == null ? void 0 : p.length) || 0}_${((d = i.title) == null ? void 0 : d.length) || 0}_${i._editing ? 1 : 0}`;
381
- if (A.has(i)) {
382
- const k = A.get(i);
381
+ if (T.has(i)) {
382
+ const k = T.get(i);
383
383
  if (k.key === a)
384
384
  return k.height;
385
385
  }
@@ -399,45 +399,45 @@ const fi = /* @__PURE__ */ _n({
399
399
  c = 200;
400
400
  break;
401
401
  default: {
402
- const b = (i.content || "").length, x = (i.title || "").length, C = b + x, P = ((f = (i.content || "").match(/[\u4e00-\u9fa5]/g)) == null ? void 0 : f.length) || 0, O = C - P, T = P * 12 + O * 6, E = Math.max(1, Math.ceil(T / 760));
403
- c = Math.max(20, E * 18), i._editing && (c += 20);
402
+ const b = (i.content || "").length, _ = (i.title || "").length, C = b + _, A = ((f = (i.content || "").match(/[\u4e00-\u9fa5]/g)) == null ? void 0 : f.length) || 0, R = C - A, S = A * 12 + R * 6, L = Math.max(1, Math.ceil(S / 760));
403
+ c = Math.max(20, L * 18), i._editing && (c += 20);
404
404
  break;
405
405
  }
406
406
  }
407
- return A.set(i, {
407
+ return T.set(i, {
408
408
  key: a,
409
409
  height: c
410
410
  }), c;
411
- }, _e = re(() => {
412
- if (F.value.length === 0) return 30;
413
- const i = F.value.slice(0, Math.min(100, F.value.length));
411
+ }, ue = de(() => {
412
+ if (E.value.length === 0) return 30;
413
+ const i = E.value.slice(0, Math.min(100, E.value.length));
414
414
  if (i.length === 0) return 30;
415
- const a = i.reduce((p, d) => p + Q(d), 0) / i.length, c = Math.max(20, Math.floor(a * 0.6));
415
+ const a = i.reduce((p, d) => p + X(d), 0) / i.length, c = Math.max(20, Math.floor(a * 0.6));
416
416
  return Math.min(c, 60);
417
417
  });
418
- let $;
419
- const le = (i, a) => {
418
+ let z;
419
+ const ie = (i, a) => {
420
420
  e("menu-click", {
421
421
  menu: i,
422
422
  row: a
423
- }), $ == null || $.onClose(), $ = null;
424
- }, j = (i) => {
423
+ }), z == null || z.onClose(), z = null;
424
+ }, Ce = (i) => {
425
425
  var c, p, d, f, k;
426
426
  if (!((d = (p = (c = t.menuConfig) == null ? void 0 : c.body) == null ? void 0 : p.options) != null && d.length)) return;
427
- $ == null || $.onClose(), $ = null;
427
+ z == null || z.onClose(), z = null;
428
428
  let a = i.target;
429
429
  for (; a && (a != null && a.getAttribute) && !(a != null && a.getAttribute("data-id")) && a !== ((f = s.value) == null ? void 0 : f.$el); )
430
430
  a = a.parentNode;
431
431
  if ((k = a == null ? void 0 : a.getAttribute) != null && k.call(a, "data-id")) {
432
- const w = a.getAttribute("data-id"), b = Fe(w);
433
- b && ($ = di({
432
+ const w = a.getAttribute("data-id"), b = Ae(w);
433
+ b && (z = ci({
434
434
  e: i,
435
435
  row: b,
436
436
  menuConfig: t.menuConfig,
437
- onMenuClick: le
437
+ onMenuClick: ie
438
438
  }), i.preventDefault(), i.stopPropagation());
439
439
  }
440
- }, he = (i) => {
440
+ }, Je = (i) => {
441
441
  var c, p, d;
442
442
  if (!m.value)
443
443
  return;
@@ -451,12 +451,12 @@ const fi = /* @__PURE__ */ _n({
451
451
  $table: o == null ? void 0 : o.exposed
452
452
  }), m.value = null);
453
453
  };
454
- ((wt = t.editConfig) == null ? void 0 : wt.trigger) === "dblclick" && Ke(() => m.value, (i) => {
455
- document.removeEventListener("click", he, !0), i && setTimeout(() => {
456
- document.addEventListener("click", he, !0);
454
+ ((Mt = t.editConfig) == null ? void 0 : Mt.trigger) === "dblclick" && Ke(() => m.value, (i) => {
455
+ document.removeEventListener("click", Je, !0), i && setTimeout(() => {
456
+ document.addEventListener("click", Je, !0);
457
457
  }, 200);
458
458
  });
459
- const me = (i) => JSON.stringify(i.map((a) => {
459
+ const H = (i) => JSON.stringify(i.map((a) => {
460
460
  var c;
461
461
  return {
462
462
  id: a[t.rowConfig.keyField],
@@ -464,9 +464,9 @@ const fi = /* @__PURE__ */ _n({
464
464
  type: a.content_type,
465
465
  editing: a._editing
466
466
  };
467
- })), Ce = () => {
467
+ })), he = () => {
468
468
  if (!t.pageConfig.enabled) {
469
- H.value = [{
469
+ $.value = [{
470
470
  items: r.value,
471
471
  startIndex: 0,
472
472
  endIndex: r.value.length
@@ -485,50 +485,50 @@ const fi = /* @__PURE__ */ _n({
485
485
  }), k.length > 0 && i.push({
486
486
  items: k,
487
487
  pageNumber: parseInt(d),
488
- height: k.reduce((w, b) => w + Q(b), 0)
488
+ height: k.reduce((w, b) => w + X(b), 0)
489
489
  });
490
- }), H.value = i;
490
+ }), $.value = i;
491
491
  } else {
492
492
  const {
493
493
  pageHeight: i,
494
494
  margin: a,
495
495
  headerHeight: c = 0
496
496
  } = t.pageConfig, d = Math.max(100, i - a * 2 - c - 20), f = [];
497
- let k = [], w = 0, b = 0, x = 1;
498
- r.value.forEach((C, P) => {
499
- const O = Q(C);
497
+ let k = [], w = 0, b = 0, _ = 1;
498
+ r.value.forEach((C, A) => {
499
+ const R = X(C);
500
500
  (C.layer || 0) <= 2 && k.length > 0 ? (f.push({
501
501
  items: [...k],
502
502
  startIndex: b,
503
- endIndex: P,
503
+ endIndex: A,
504
504
  height: w,
505
- pageNumber: x++
506
- }), k = [C], w = O, b = P) : w + O > d && k.length > 0 ? (f.push({
505
+ pageNumber: _++
506
+ }), k = [C], w = R, b = A) : w + R > d && k.length > 0 ? (f.push({
507
507
  items: [...k],
508
508
  startIndex: b,
509
- endIndex: P,
509
+ endIndex: A,
510
510
  height: w,
511
- pageNumber: x++
512
- }), k = [C], w = Math.min(O, d), b = P) : (k.push(C), w += O);
511
+ pageNumber: _++
512
+ }), k = [C], w = Math.min(R, d), b = A) : (k.push(C), w += R);
513
513
  }), k.length > 0 && f.push({
514
514
  items: k,
515
515
  startIndex: b,
516
516
  endIndex: r.value.length,
517
517
  height: w,
518
- pageNumber: x
519
- }), H.value = f;
518
+ pageNumber: _
519
+ }), $.value = f;
520
520
  }
521
- }, Ne = () => {
521
+ }, me = () => {
522
522
  try {
523
- const i = Array.isArray(t.data) ? t.data : [], a = me(i);
524
- if (!(a !== I.value) && r.value.length > 0)
523
+ const i = Array.isArray(t.data) ? t.data : [], a = H(i);
524
+ if (!(a !== F.value) && r.value.length > 0)
525
525
  return;
526
- I.value = a;
527
- const p = (t.treeConfig ? ui(i, void 0, t.treeConfig) : i).map((f, k) => {
528
- const w = f[t.rowConfig.keyField], b = _.get(w);
526
+ F.value = a;
527
+ const p = (t.treeConfig ? di(i, void 0, t.treeConfig) : i).map((f, k) => {
528
+ const w = f[t.rowConfig.keyField], b = x.get(w);
529
529
  if (!b || b.content !== f.content || b.content_type !== f.content_type) {
530
- L.add(w);
531
- const x = {
530
+ P.add(w);
531
+ const _ = {
532
532
  ...f,
533
533
  index: k,
534
534
  _editing: f._editing || !1,
@@ -537,29 +537,29 @@ const fi = /* @__PURE__ */ _n({
537
537
  }
538
538
  // 保留原始数据,避免重复深拷贝
539
539
  };
540
- return _.set(w, x), x;
540
+ return x.set(w, _), _;
541
541
  }
542
542
  return b.index = k, b;
543
543
  });
544
- r.value = p, Ce();
544
+ r.value = p, he();
545
545
  const d = new Set(p.map((f) => f[t.rowConfig.keyField]));
546
- for (const [f] of _)
547
- d.has(f) || (_.delete(f), L.delete(f));
546
+ for (const [f] of x)
547
+ d.has(f) || (x.delete(f), P.delete(f));
548
548
  } catch {
549
- r.value = [], H.value = [], _.clear(), L.clear();
549
+ r.value = [], $.value = [], x.clear(), P.clear();
550
550
  }
551
551
  };
552
552
  Ke(() => t.data, (i, a) => {
553
553
  try {
554
554
  if (!Array.isArray(i))
555
555
  return;
556
- we(() => {
557
- if (Ne(), t.pageConfig.enabled) {
558
- q.value.clear(), B.value.clear();
559
- for (let c = 0; c < Math.min(3, H.value.length); c++)
560
- q.value.add(c);
561
- we(() => {
562
- de();
556
+ Se(() => {
557
+ if (me(), t.pageConfig.enabled) {
558
+ W.value.clear(), B.value.clear();
559
+ for (let c = 0; c < Math.min(3, $.value.length); c++)
560
+ W.value.add(c);
561
+ Se(() => {
562
+ fe();
563
563
  });
564
564
  }
565
565
  });
@@ -570,22 +570,22 @@ const fi = /* @__PURE__ */ _n({
570
570
  immediate: !1
571
571
  }), Ke(() => t.pageData, () => {
572
572
  if (t.pageConfig.enabled) {
573
- Ce(), q.value.clear(), B.value.clear();
574
- for (let i = 0; i < Math.min(3, H.value.length); i++)
575
- q.value.add(i);
576
- we(() => {
577
- de();
573
+ he(), W.value.clear(), B.value.clear();
574
+ for (let i = 0; i < Math.min(3, $.value.length); i++)
575
+ W.value.add(i);
576
+ Se(() => {
577
+ fe();
578
578
  });
579
579
  }
580
580
  }, {
581
581
  deep: !0
582
582
  }), Ke(() => t.pageConfig, () => {
583
583
  if (t.pageConfig.enabled) {
584
- Ce(), q.value.clear(), B.value.clear();
585
- for (let i = 0; i < Math.min(3, H.value.length); i++)
586
- q.value.add(i);
587
- we(() => {
588
- de();
584
+ he(), W.value.clear(), B.value.clear();
585
+ for (let i = 0; i < Math.min(3, $.value.length); i++)
586
+ W.value.add(i);
587
+ Se(() => {
588
+ fe();
589
589
  });
590
590
  }
591
591
  }, {
@@ -593,77 +593,77 @@ const fi = /* @__PURE__ */ _n({
593
593
  }), Ke(y, () => e("current-change", {
594
594
  row: y.value
595
595
  }));
596
- let Pe = null;
597
- const ye = () => {
598
- window.ResizeObserver && (Pe = new ResizeObserver((i) => {
596
+ let Me = null;
597
+ const Xe = () => {
598
+ window.ResizeObserver && (Me = new ResizeObserver((i) => {
599
599
  var a, c;
600
600
  for (const p of i) {
601
601
  const d = (a = p.target.dataset) == null ? void 0 : a.id;
602
602
  if (!d) continue;
603
- const f = Fe(d);
603
+ const f = Ae(d);
604
604
  if (!f) continue;
605
- const k = p.contentRect.height, w = ((c = A.get(f)) == null ? void 0 : c.height) || 0;
605
+ const k = p.contentRect.height, w = ((c = T.get(f)) == null ? void 0 : c.height) || 0;
606
606
  if (Math.abs(w - k) > 5) {
607
- const b = A.get(f) || {};
608
- A.set(f, {
607
+ const b = T.get(f) || {};
608
+ T.set(f, {
609
609
  ...b,
610
610
  height: k
611
611
  }), requestAnimationFrame(() => {
612
612
  var C;
613
- const x = p.target.__vueParentComponent;
614
- (C = x == null ? void 0 : x.proxy) != null && C.updateSize && x.proxy.updateSize();
613
+ const _ = p.target.__vueParentComponent;
614
+ (C = _ == null ? void 0 : _.proxy) != null && C.updateSize && _.proxy.updateSize();
615
615
  });
616
616
  }
617
617
  }
618
- }), we(() => {
618
+ }), Se(() => {
619
619
  var c;
620
620
  const i = (c = s.value) == null ? void 0 : c.$el;
621
621
  if (!i) return;
622
622
  i.querySelectorAll("[data-id]").forEach((p) => {
623
- p.dataset.id && Pe.observe(p);
623
+ p.dataset.id && Me.observe(p);
624
624
  });
625
625
  }));
626
- }, ce = () => {
627
- h.value && (h.value.disconnect(), h.value = null), Pe && (Pe.disconnect(), Pe = null);
628
- }, de = () => {
629
- t.pageConfig.enabled && (S.value && S.value.disconnect(), S.value = new IntersectionObserver((i) => {
626
+ }, Ye = () => {
627
+ h.value && (h.value.disconnect(), h.value = null), Me && (Me.disconnect(), Me = null);
628
+ }, fe = () => {
629
+ t.pageConfig.enabled && (I.value && I.value.disconnect(), I.value = new IntersectionObserver((i) => {
630
630
  i.forEach((a) => {
631
631
  const c = parseInt(a.target.dataset.pageIndex);
632
632
  if (a.isIntersecting) {
633
633
  B.value.add(c);
634
- for (let p = Math.max(0, c - D); p <= Math.min(H.value.length - 1, c + D); p++)
635
- q.value.add(p);
634
+ for (let p = Math.max(0, c - D); p <= Math.min($.value.length - 1, c + D); p++)
635
+ W.value.add(p);
636
636
  } else
637
637
  B.value.delete(c), setTimeout(() => {
638
- B.value.has(c) || Array.from(B.value).some((d) => Math.abs(d - c) <= D * 2) || q.value.delete(c);
638
+ B.value.has(c) || Array.from(B.value).some((d) => Math.abs(d - c) <= D * 2) || W.value.delete(c);
639
639
  }, 3e3);
640
640
  });
641
641
  }, {
642
642
  root: null,
643
643
  rootMargin: "100px",
644
644
  threshold: 0.01
645
- }), we(() => {
645
+ }), Se(() => {
646
646
  const i = document.querySelector(".a4-pages-container");
647
647
  i && i.querySelectorAll(".a4-page-placeholder").forEach((c) => {
648
- S.value.observe(c);
648
+ I.value.observe(c);
649
649
  });
650
650
  }));
651
651
  };
652
- yt(() => {
653
- Ne(), we(() => {
652
+ _t(() => {
653
+ me(), Se(() => {
654
654
  var i;
655
- if (ye(), xe.setup(), de(), ((i = t.editConfig) == null ? void 0 : i.trigger) === "contenteditable" && (document.addEventListener("selectionchange", $e), document.addEventListener("mouseup", Je)), t.pageConfig.enabled)
656
- for (let a = 0; a < Math.min(3, H.value.length); a++)
657
- q.value.add(a);
655
+ if (Xe(), se.setup(), fe(), ((i = t.editConfig) == null ? void 0 : i.trigger) === "contenteditable" && (document.addEventListener("selectionchange", re), document.addEventListener("mouseup", Te)), t.pageConfig.enabled)
656
+ for (let a = 0; a < Math.min(3, $.value.length); a++)
657
+ W.value.add(a);
658
658
  }), v.value = !0;
659
- }), st(() => {
659
+ }), rt(() => {
660
660
  var i;
661
- ce(), xe.cleanup(), S.value && (S.value.disconnect(), S.value = null), ((i = t.editConfig) == null ? void 0 : i.trigger) === "contenteditable" && (document.removeEventListener("selectionchange", $e), document.removeEventListener("mouseup", Je)), ee && clearTimeout(ee), M = /* @__PURE__ */ new Map(), _.clear(), q.value.clear(), B.value.clear();
661
+ Ye(), se.cleanup(), I.value && (I.value.disconnect(), I.value = null), ((i = t.editConfig) == null ? void 0 : i.trigger) === "contenteditable" && (document.removeEventListener("selectionchange", re), document.removeEventListener("mouseup", Te)), Ee && clearTimeout(Ee), M = /* @__PURE__ */ new Map(), x.clear(), W.value.clear(), B.value.clear();
662
662
  });
663
- const xe = {
663
+ const se = {
664
664
  handlers: /* @__PURE__ */ new Map(),
665
665
  setup() {
666
- we(() => {
666
+ Se(() => {
667
667
  var a;
668
668
  const i = (a = s.value) == null ? void 0 : a.$el;
669
669
  i && (i.addEventListener("click", this.handleClick.bind(this), {
@@ -676,15 +676,15 @@ const fi = /* @__PURE__ */ _n({
676
676
  handleClick(i) {
677
677
  const a = i.target.closest("[data-id]");
678
678
  if (!a) return;
679
- const c = a.dataset.id, p = Fe(c);
680
- p && Ye(p);
679
+ const c = a.dataset.id, p = Ae(c);
680
+ p && Qe(p);
681
681
  },
682
682
  handleDblClick(i) {
683
683
  var d;
684
684
  if (!((d = t.editConfig) != null && d.trigger) === "dblclick") return;
685
685
  const a = i.target.closest("[data-id]");
686
686
  if (!a) return;
687
- const c = a.dataset.id, p = Fe(c);
687
+ const c = a.dataset.id, p = Ae(c);
688
688
  p && Ve(p);
689
689
  },
690
690
  cleanup() {
@@ -692,33 +692,33 @@ const fi = /* @__PURE__ */ _n({
692
692
  const i = (c = (a = s.value) == null ? void 0 : a.$el) == null ? void 0 : c.querySelector(".virtual-table-wrapper");
693
693
  i && (i.removeEventListener("click", this.handleClick), i.removeEventListener("dblclick", this.handleDblClick));
694
694
  }
695
- }, Me = (i) => {
696
- Ye(i);
697
- }, fe = (i) => Ve(i);
698
- let oe = null, ue;
695
+ }, ke = (i) => {
696
+ Qe(i);
697
+ }, Ie = (i) => Ve(i);
698
+ let we = null, le;
699
699
  const ge = ({
700
700
  row: i,
701
701
  column: a
702
702
  }, c, p) => {
703
703
  var k, w;
704
- const d = p || c.target, f = Rt(d, "virtual-table-cell", (k = s.value) == null ? void 0 : k.$el);
705
- oe === f && ue && (clearTimeout(ue), oe = null), ((w = m.value) == null ? void 0 : w[t.rowConfig.keyField]) != (i == null ? void 0 : i[t.rowConfig.keyField]) && setTimeout(() => {
706
- var x, C;
704
+ const d = p || c.target, f = Ot(d, "virtual-table-cell", (k = s.value) == null ? void 0 : k.$el);
705
+ we === f && le && (clearTimeout(le), we = null), ((w = m.value) == null ? void 0 : w[t.rowConfig.keyField]) != (i == null ? void 0 : i[t.rowConfig.keyField]) && setTimeout(() => {
706
+ var _, C;
707
707
  m.value = i;
708
- let b = (x = d == null ? void 0 : d.getAttribute) == null ? void 0 : x.call(d, "field");
708
+ let b = (_ = d == null ? void 0 : d.getAttribute) == null ? void 0 : _.call(d, "field");
709
709
  if (!b) {
710
710
  try {
711
- const P = document.getSelection();
712
- let O = P == null ? void 0 : P.anchorNode;
713
- O && O.nodeType === 3 && (O = O.parentElement);
714
- const T = (C = O == null ? void 0 : O.closest) == null ? void 0 : C.call(O, "[field]");
715
- T && (b = T.getAttribute("field"));
711
+ const A = document.getSelection();
712
+ let R = A == null ? void 0 : A.anchorNode;
713
+ R && R.nodeType === 3 && (R = R.parentElement);
714
+ const S = (C = R == null ? void 0 : R.closest) == null ? void 0 : C.call(R, "[field]");
715
+ S && (b = S.getAttribute("field"));
716
716
  } catch {
717
717
  }
718
718
  if (!b && (c != null && c.composedPath)) {
719
- for (const P of c.composedPath())
720
- if (P != null && P.getAttribute && P.getAttribute("field")) {
721
- b = P.getAttribute("field");
719
+ for (const A of c.composedPath())
720
+ if (A != null && A.getAttribute && A.getAttribute("field")) {
721
+ b = A.getAttribute("field");
722
722
  break;
723
723
  }
724
724
  }
@@ -732,40 +732,40 @@ const fi = /* @__PURE__ */ _n({
732
732
  $table: o == null ? void 0 : o.exposed
733
733
  });
734
734
  }, 200);
735
- }, Ee = ({
735
+ }, ye = ({
736
736
  row: i,
737
737
  column: a
738
738
  }, c, p) => {
739
739
  var f;
740
740
  const d = p || c.target;
741
- oe = Rt(d, "virtual-table-cell", (f = s.value) == null ? void 0 : f.$el), ue && clearTimeout(ue), ue = setTimeout(() => {
742
- var b, x, C, P, O;
741
+ we = Ot(d, "virtual-table-cell", (f = s.value) == null ? void 0 : f.$el), le && clearTimeout(le), le = setTimeout(() => {
742
+ var b, _, C, A, R;
743
743
  const k = i.content_type;
744
744
  let w = (b = d == null ? void 0 : d.getAttribute) == null ? void 0 : b.call(d, "field");
745
745
  if (!w) {
746
746
  try {
747
- const T = document.getSelection();
748
- let E = T == null ? void 0 : T.anchorNode;
749
- E && E.nodeType === 3 && (E = E.parentElement);
750
- const G = (x = E == null ? void 0 : E.closest) == null ? void 0 : x.call(E, "[field]");
751
- G && (w = G.getAttribute("field"));
747
+ const S = document.getSelection();
748
+ let L = S == null ? void 0 : S.anchorNode;
749
+ L && L.nodeType === 3 && (L = L.parentElement);
750
+ const Z = (_ = L == null ? void 0 : L.closest) == null ? void 0 : _.call(L, "[field]");
751
+ Z && (w = Z.getAttribute("field"));
752
752
  } catch {
753
753
  }
754
754
  if (!w && (c != null && c.composedPath)) {
755
- for (const T of c.composedPath())
756
- if (T != null && T.getAttribute && T.getAttribute("field")) {
757
- w = T.getAttribute("field");
755
+ for (const S of c.composedPath())
756
+ if (S != null && S.getAttribute && S.getAttribute("field")) {
757
+ w = S.getAttribute("field");
758
758
  break;
759
759
  }
760
760
  }
761
761
  }
762
762
  if (k !== "table") {
763
763
  if (k === "text") {
764
- let T = null, E = null;
765
- if ((C = d == null ? void 0 : d.getAttribute) != null && C.call(d, "field") ? T = d : (P = d == null ? void 0 : d.closest) != null && P.call(d, "[field]") && (T = d.closest("[field]")), T && (E = T.textContent), w && E !== void 0 && E !== null) {
766
- E = E.trim();
767
- const G = ((O = i[w]) == null ? void 0 : O.trim()) || "";
768
- E !== G && (i[w] = E);
764
+ let S = null, L = null;
765
+ if ((C = d == null ? void 0 : d.getAttribute) != null && C.call(d, "field") ? S = d : (A = d == null ? void 0 : d.closest) != null && A.call(d, "[field]") && (S = d.closest("[field]")), S && (L = S.textContent), w && L !== void 0 && L !== null) {
766
+ L = L.trim();
767
+ const Z = ((R = i[w]) == null ? void 0 : R.trim()) || "";
768
+ L !== Z && (i[w] = L);
769
769
  }
770
770
  }
771
771
  }
@@ -779,86 +779,86 @@ const fi = /* @__PURE__ */ _n({
779
779
  });
780
780
  }, 50);
781
781
  };
782
- let z = null, ee = null;
783
- const te = (i) => {
782
+ let O = null, Ee = null;
783
+ const be = (i) => {
784
784
  var a;
785
- ((a = t.editConfig) == null ? void 0 : a.trigger) === "contenteditable" && Se("focusin", i);
786
- }, ae = (i) => {
785
+ ((a = t.editConfig) == null ? void 0 : a.trigger) === "contenteditable" && ee("focusin", i);
786
+ }, oe = (i) => {
787
787
  var a, c, p, d, f;
788
788
  if (((a = t.editConfig) == null ? void 0 : a.trigger) === "contenteditable")
789
- if (z != null && z.cellEl) {
790
- let k = z.fieldEl;
791
- !k && z.field && (k = (p = (c = z.cellEl) == null ? void 0 : c.querySelector) == null ? void 0 : p.call(c, `[field="${z.field}"]`)), k || (k = ((f = (d = z.cellEl).querySelector) == null ? void 0 : f.call(d, "[field]")) || z.cellEl), Ee(z, {
789
+ if (O != null && O.cellEl) {
790
+ let k = O.fieldEl;
791
+ !k && O.field && (k = (p = (c = O.cellEl) == null ? void 0 : c.querySelector) == null ? void 0 : p.call(c, `[field="${O.field}"]`)), k || (k = ((f = (d = O.cellEl).querySelector) == null ? void 0 : f.call(d, "[field]")) || O.cellEl), ye(O, {
792
792
  target: k
793
- }, k), z = null;
793
+ }, k), O = null;
794
794
  } else
795
- Se("focusout", i);
796
- }, Se = (i, a) => {
795
+ ee("focusout", i);
796
+ }, ee = (i, a) => {
797
797
  var c, p, d, f, k, w;
798
798
  try {
799
799
  const b = document.getSelection();
800
- let x = b == null ? void 0 : b.anchorNode;
801
- x && x.nodeType === 3 && (x = x.parentElement);
802
- const C = (c = x == null ? void 0 : x.closest) == null ? void 0 : c.call(x, ".virtual-table-cell"), P = (p = x == null ? void 0 : x.closest) == null ? void 0 : p.call(x, ".virtual-table-row");
803
- if (!C || !P) return;
804
- const O = P.getAttribute("data-id"), T = C.getAttribute("data-prop"), E = Fe(O), G = He.value.find((be) => `${be.prop}` == `${T}`) || {}, X = ((d = x == null ? void 0 : x.closest) == null ? void 0 : d.call(x, "[field]")) || null, R = ((f = X == null ? void 0 : X.getAttribute) == null ? void 0 : f.call(X, "field")) || void 0;
805
- i === "focusin" ? (z = {
806
- row: E,
807
- column: G,
800
+ let _ = b == null ? void 0 : b.anchorNode;
801
+ _ && _.nodeType === 3 && (_ = _.parentElement);
802
+ const C = (c = _ == null ? void 0 : _.closest) == null ? void 0 : c.call(_, ".virtual-table-cell"), A = (p = _ == null ? void 0 : _.closest) == null ? void 0 : p.call(_, ".virtual-table-row");
803
+ if (!C || !A) return;
804
+ const R = A.getAttribute("data-id"), S = C.getAttribute("data-prop"), L = Ae(R), Z = Oe.value.find((ce) => `${ce.prop}` == `${S}`) || {}, j = ((d = _ == null ? void 0 : _.closest) == null ? void 0 : d.call(_, "[field]")) || null, U = ((f = j == null ? void 0 : j.getAttribute) == null ? void 0 : f.call(j, "field")) || void 0;
805
+ i === "focusin" ? (O = {
806
+ row: L,
807
+ column: Z,
808
808
  cellEl: C,
809
- rowEl: P,
810
- fieldEl: X,
811
- field: R
809
+ rowEl: A,
810
+ fieldEl: j,
811
+ field: U
812
812
  }, ge({
813
- row: E,
814
- column: G
815
- }, a, X || ((k = x == null ? void 0 : x.closest) == null ? void 0 : k.call(x, "[field]")))) : Ee({
816
- row: E,
817
- column: G
818
- }, a, X || ((w = x == null ? void 0 : x.closest) == null ? void 0 : w.call(x, "[field]")));
813
+ row: L,
814
+ column: Z
815
+ }, a, j || ((k = _ == null ? void 0 : _.closest) == null ? void 0 : k.call(_, "[field]")))) : ye({
816
+ row: L,
817
+ column: Z
818
+ }, a, j || ((w = _ == null ? void 0 : _.closest) == null ? void 0 : w.call(_, "[field]")));
819
819
  } catch {
820
820
  }
821
- }, $e = () => {
821
+ }, re = () => {
822
822
  var i;
823
- ((i = t.editConfig) == null ? void 0 : i.trigger) === "contenteditable" && (ee && clearTimeout(ee), ee = setTimeout(() => {
824
- var a, c, p, d, f, k, w, b, x, C, P, O, T, E;
823
+ ((i = t.editConfig) == null ? void 0 : i.trigger) === "contenteditable" && (Ee && clearTimeout(Ee), Ee = setTimeout(() => {
824
+ var a, c, p, d, f, k, w, b, _, C, A, R, S, L;
825
825
  try {
826
- const G = document.getSelection();
827
- if (G.rangeCount === 0) return;
828
- const X = G.getRangeAt(0);
829
- let R = X.startContainer;
830
- R.nodeType === 3 && (R = R.parentElement);
831
- const be = (a = R == null ? void 0 : R.closest) == null ? void 0 : a.call(R, ".virtual-table-cell"), Te = (c = R == null ? void 0 : R.closest) == null ? void 0 : c.call(R, ".virtual-table-row");
832
- if (!be || !Te) return;
833
- const Le = Te.getAttribute("data-id"), Oe = be.getAttribute("data-prop"), ke = Fe(Le), se = He.value.find((ne) => `${ne.prop}` == `${Oe}`) || {};
834
- if (!z || ((p = z.row) == null ? void 0 : p[t.rowConfig.keyField]) !== (ke == null ? void 0 : ke[t.rowConfig.keyField]) || ((d = z.column) == null ? void 0 : d.prop) !== (se == null ? void 0 : se.prop)) {
835
- if (z) {
836
- let ne = z.fieldEl;
837
- !ne && z.field && (ne = (k = (f = z.cellEl) == null ? void 0 : f.querySelector) == null ? void 0 : k.call(f, `[field="${z.field}"]`)), ne || (ne = ((b = (w = z.cellEl) == null ? void 0 : w.querySelector) == null ? void 0 : b.call(w, "[field]")) || z.cellEl), Ee(z, {
838
- target: ne
839
- }, ne);
826
+ const Z = document.getSelection();
827
+ if (Z.rangeCount === 0) return;
828
+ const j = Z.getRangeAt(0);
829
+ let U = j.startContainer;
830
+ U.nodeType === 3 && (U = U.parentElement);
831
+ const ce = (a = U == null ? void 0 : U.closest) == null ? void 0 : a.call(U, ".virtual-table-cell"), ae = (c = U == null ? void 0 : U.closest) == null ? void 0 : c.call(U, ".virtual-table-row");
832
+ if (!ce || !ae) return;
833
+ const Be = ae.getAttribute("data-id"), De = ce.getAttribute("data-prop"), xe = Ae(Be), pe = Oe.value.find((J) => `${J.prop}` == `${De}`) || {};
834
+ if (!O || ((p = O.row) == null ? void 0 : p[t.rowConfig.keyField]) !== (xe == null ? void 0 : xe[t.rowConfig.keyField]) || ((d = O.column) == null ? void 0 : d.prop) !== (pe == null ? void 0 : pe.prop)) {
835
+ if (O) {
836
+ let J = O.fieldEl;
837
+ !J && O.field && (J = (k = (f = O.cellEl) == null ? void 0 : f.querySelector) == null ? void 0 : k.call(f, `[field="${O.field}"]`)), J || (J = ((b = (w = O.cellEl) == null ? void 0 : w.querySelector) == null ? void 0 : b.call(w, "[field]")) || O.cellEl), ye(O, {
838
+ target: J
839
+ }, J);
840
840
  }
841
- z = {
842
- row: ke,
843
- column: se,
844
- cellEl: be,
845
- rowEl: Te,
846
- fieldEl: ((x = R == null ? void 0 : R.closest) == null ? void 0 : x.call(R, "[field]")) || null,
847
- field: ((O = (P = ((C = R == null ? void 0 : R.closest) == null ? void 0 : C.call(R, "[field]")) || null) == null ? void 0 : P.getAttribute) == null ? void 0 : O.call(P, "field")) || void 0
841
+ O = {
842
+ row: xe,
843
+ column: pe,
844
+ cellEl: ce,
845
+ rowEl: ae,
846
+ fieldEl: ((_ = U == null ? void 0 : U.closest) == null ? void 0 : _.call(U, "[field]")) || null,
847
+ field: ((R = (A = ((C = U == null ? void 0 : U.closest) == null ? void 0 : C.call(U, "[field]")) || null) == null ? void 0 : A.getAttribute) == null ? void 0 : R.call(A, "field")) || void 0
848
848
  }, ge({
849
- row: ke,
850
- column: se
849
+ row: xe,
850
+ column: pe
851
851
  }, {
852
- target: be
853
- }, be);
852
+ target: ce
853
+ }, ce);
854
854
  }
855
- if (G.toString()) {
856
- const ne = X.endContainer.nodeType === 3 ? X.endContainer.parentElement : X.endContainer, tt = (T = ne == null ? void 0 : ne.closest) == null ? void 0 : T.call(ne, ".virtual-table-cell"), nt = (E = ne == null ? void 0 : ne.closest) == null ? void 0 : E.call(ne, ".virtual-table-row");
855
+ if (Z.toString()) {
856
+ const J = j.endContainer.nodeType === 3 ? j.endContainer.parentElement : j.endContainer, He = (S = J == null ? void 0 : J.closest) == null ? void 0 : S.call(J, ".virtual-table-cell"), it = (L = J == null ? void 0 : J.closest) == null ? void 0 : L.call(J, ".virtual-table-row");
857
857
  }
858
858
  } catch {
859
859
  }
860
860
  }, 50));
861
- }, Je = () => {
861
+ }, Te = () => {
862
862
  var i;
863
863
  ((i = t.editConfig) == null ? void 0 : i.trigger) === "contenteditable" && setTimeout(() => {
864
864
  var p, d, f, k;
@@ -867,22 +867,22 @@ const fi = /* @__PURE__ */ _n({
867
867
  const c = a.toString();
868
868
  if (c) {
869
869
  const w = a.rangeCount > 0 ? a.getRangeAt(0) : null;
870
- let b = null, x = null;
870
+ let b = null, _ = null;
871
871
  try {
872
872
  if (w) {
873
873
  let C = w.startContainer;
874
874
  (C == null ? void 0 : C.nodeType) === 3 && (C = C.parentElement);
875
- const P = (p = C == null ? void 0 : C.closest) == null ? void 0 : p.call(C, ".virtual-table-cell"), O = (d = C == null ? void 0 : C.closest) == null ? void 0 : d.call(C, ".virtual-table-row");
876
- b = P && O ? {
877
- rowId: O.getAttribute("data-id"),
878
- prop: P.getAttribute("data-prop")
875
+ const A = (p = C == null ? void 0 : C.closest) == null ? void 0 : p.call(C, ".virtual-table-cell"), R = (d = C == null ? void 0 : C.closest) == null ? void 0 : d.call(C, ".virtual-table-row");
876
+ b = A && R ? {
877
+ rowId: R.getAttribute("data-id"),
878
+ prop: A.getAttribute("data-prop")
879
879
  } : null;
880
- let T = w.endContainer;
881
- (T == null ? void 0 : T.nodeType) === 3 && (T = T.parentElement);
882
- const E = (f = T == null ? void 0 : T.closest) == null ? void 0 : f.call(T, ".virtual-table-cell"), G = (k = T == null ? void 0 : T.closest) == null ? void 0 : k.call(T, ".virtual-table-row");
883
- x = E && G ? {
884
- rowId: G.getAttribute("data-id"),
885
- prop: E.getAttribute("data-prop")
880
+ let S = w.endContainer;
881
+ (S == null ? void 0 : S.nodeType) === 3 && (S = S.parentElement);
882
+ const L = (f = S == null ? void 0 : S.closest) == null ? void 0 : f.call(S, ".virtual-table-cell"), Z = (k = S == null ? void 0 : S.closest) == null ? void 0 : k.call(S, ".virtual-table-row");
883
+ _ = L && Z ? {
884
+ rowId: Z.getAttribute("data-id"),
885
+ prop: L.getAttribute("data-prop")
886
886
  } : null;
887
887
  }
888
888
  } catch {
@@ -892,62 +892,62 @@ const fi = /* @__PURE__ */ _n({
892
892
  selection: a,
893
893
  range: w,
894
894
  start: b,
895
- end: x
895
+ end: _
896
896
  });
897
897
  }
898
898
  }, 10);
899
- }, Zt = (i) => (i == null ? void 0 : i._editing) === !0, Qt = (i) => i != null && i.parent_id ? M.get(i.parent_id) : null, en = (i) => {
899
+ }, Re = (i) => (i == null ? void 0 : i._editing) === !0, dt = (i) => i != null && i.parent_id ? M.get(i.parent_id) : null, en = (i) => {
900
900
  var c;
901
901
  const a = r.value.findIndex((p) => p[t.rowConfig.keyField] == i[t.rowConfig.keyField]);
902
902
  return a < 1 ? null : ((c = r.value[a - 1]) == null ? void 0 : c.layer) === i.layer ? r.value[a - 1] : null;
903
903
  }, tn = (i) => {
904
904
  const a = r.value.findIndex((c) => c[t.rowConfig.keyField] == i[t.rowConfig.keyField]);
905
905
  return a >= r.value.length - 1 ? null : r.value[a + 1];
906
- }, Fe = (i) => {
906
+ }, Ae = (i) => {
907
907
  if (!i) return null;
908
- let a = _.get(i);
909
- return a || (typeof i == "number" ? _.get(`${i}`) : typeof i == "string" && /^\d+$/.test(i) ? _.get(Number(i)) : null);
908
+ let a = x.get(i);
909
+ return a || (typeof i == "number" ? x.get(`${i}`) : typeof i == "string" && /^\d+$/.test(i) ? x.get(Number(i)) : null);
910
910
  };
911
- let Xe = null;
911
+ let Ze = null;
912
912
  const nn = (i) => {
913
- Xe && cancelAnimationFrame(Xe), Xe = requestAnimationFrame(() => {
913
+ Ze && cancelAnimationFrame(Ze), Ze = requestAnimationFrame(() => {
914
914
  var p;
915
915
  const a = t.rowConfig.keyField, c = i[a];
916
916
  if (t.pageConfig.enabled) {
917
917
  let d = -1;
918
- for (let f = 0; f < H.value.length; f++)
919
- if (H.value[f].items.some((b) => b[a] === c)) {
918
+ for (let f = 0; f < $.value.length; f++)
919
+ if ($.value[f].items.some((b) => b[a] === c)) {
920
920
  d = f;
921
921
  break;
922
922
  }
923
923
  if (d !== -1) {
924
- for (let f = Math.max(0, d - 1); f <= Math.min(H.value.length - 1, d + 1); f++)
925
- q.value.has(f) || q.value.add(f);
926
- we(() => {
924
+ for (let f = Math.max(0, d - 1); f <= Math.min($.value.length - 1, d + 1); f++)
925
+ W.value.has(f) || W.value.add(f);
926
+ Se(() => {
927
927
  const f = document.querySelector(".a4-pages-container");
928
928
  if (!f) return;
929
929
  const k = (w = 0) => {
930
930
  const b = f.querySelector(`[data-id="${c}"]`);
931
931
  if (b) {
932
- let x = 0, C = b;
932
+ let _ = 0, C = b;
933
933
  for (; C && C !== f; )
934
- x += C.offsetTop, C = C.offsetParent;
935
- const P = f.clientHeight;
936
- let O = x - P * 0.3;
937
- O = Math.max(0, O);
938
- const T = f.scrollTop, E = Math.abs(O - T), G = (X) => {
939
- const R = f.scrollTop, be = X - R, Te = Math.min(800, Math.max(300, E * 0.5)), Le = performance.now(), Oe = (se) => se < 0.5 ? 4 * se * se * se : 1 - Math.pow(-2 * se + 2, 3) / 2, ke = (se) => {
940
- const je = se - Le, ne = Math.min(je / Te, 1), tt = Oe(ne), nt = R + be * tt;
941
- f.scrollTop = nt, ne < 1 ? requestAnimationFrame(ke) : setTimeout(() => {
942
- f.scrollTop = X;
934
+ _ += C.offsetTop, C = C.offsetParent;
935
+ const A = f.clientHeight;
936
+ let R = _ - A * 0.3;
937
+ R = Math.max(0, R);
938
+ const S = f.scrollTop, L = Math.abs(R - S), Z = (j) => {
939
+ const U = f.scrollTop, ce = j - U, ae = Math.min(800, Math.max(300, L * 0.5)), Be = performance.now(), De = (pe) => pe < 0.5 ? 4 * pe * pe * pe : 1 - Math.pow(-2 * pe + 2, 3) / 2, xe = (pe) => {
940
+ const je = pe - Be, J = Math.min(je / ae, 1), He = De(J), it = U + ce * He;
941
+ f.scrollTop = it, J < 1 ? requestAnimationFrame(xe) : setTimeout(() => {
942
+ f.scrollTop = j;
943
943
  }, 50);
944
944
  };
945
- requestAnimationFrame(ke);
945
+ requestAnimationFrame(xe);
946
946
  };
947
- E > 3e3 ? f.scrollTo({
948
- top: O,
947
+ L > 3e3 ? f.scrollTo({
948
+ top: R,
949
949
  behavior: "instant"
950
- }) : G(O), b.classList.add("row--highlight"), setTimeout(() => {
950
+ }) : Z(R), b.classList.add("row--highlight"), setTimeout(() => {
951
951
  b.classList.remove("row--highlight");
952
952
  }, 1500);
953
953
  } else w < 10 && setTimeout(() => k(w + 1), 150);
@@ -959,12 +959,12 @@ const fi = /* @__PURE__ */ _n({
959
959
  const d = r.value.findIndex((f) => f[a] === c);
960
960
  d !== -1 && ((p = s.value) != null && p.scrollToItem) && s.value.scrollToItem(d);
961
961
  }
962
- Xe = null;
962
+ Ze = null;
963
963
  });
964
- }, Ye = (i) => {
964
+ }, Qe = (i) => {
965
965
  if (i) {
966
966
  if (!v.value) {
967
- setTimeout(() => Ye(i), 200);
967
+ setTimeout(() => Qe(i), 200);
968
968
  return;
969
969
  }
970
970
  y.value = i, y.value !== m.value && m.value && (m.value._editing = !1, setTimeout(() => {
@@ -998,44 +998,44 @@ const fi = /* @__PURE__ */ _n({
998
998
  }), c(!0);
999
999
  }));
1000
1000
  }
1001
- }), ln = (i) => Ve(i), ct = () => {
1002
- if (Ce(), t.pageConfig.enabled) {
1001
+ }), ln = (i) => Ve(i), ut = () => {
1002
+ if (he(), t.pageConfig.enabled) {
1003
1003
  const i = Array.from(B.value);
1004
1004
  if (i.length > 0) {
1005
1005
  const a = Math.min(...i);
1006
- for (let c = Math.max(0, a - 1); c <= Math.min(H.value.length - 1, a + 2); c++)
1007
- q.value.add(c);
1006
+ for (let c = Math.max(0, a - 1); c <= Math.min($.value.length - 1, a + 2); c++)
1007
+ W.value.add(c);
1008
1008
  } else
1009
- for (let a = 0; a < Math.min(3, H.value.length); a++)
1010
- q.value.add(a);
1011
- we(() => {
1012
- de();
1009
+ for (let a = 0; a < Math.min(3, $.value.length); a++)
1010
+ W.value.add(a);
1011
+ Se(() => {
1012
+ fe();
1013
1013
  });
1014
1014
  }
1015
- we(() => {
1015
+ Se(() => {
1016
1016
  !t.pageConfig.enabled && s.value && s.value.$forceUpdate && s.value.$forceUpdate();
1017
1017
  });
1018
1018
  }, on = (i, a) => new Promise((c) => {
1019
1019
  let p = -1;
1020
1020
  if (a == -1) {
1021
- const d = Fe(i.parent_id);
1021
+ const d = Ae(i.parent_id);
1022
1022
  for (p = r.value.findIndex((f) => f[t.rowConfig.keyField] == d[t.rowConfig.keyField]) + 1; r.value[p].parent_id == d[t.rowConfig.keyField]; )
1023
1023
  p += 1;
1024
1024
  } else
1025
1025
  p = r.value.findIndex((d) => d[t.rowConfig.keyField] == a[t.rowConfig.keyField]);
1026
- M.set(i.node_id, i), _.set(i[t.rowConfig.keyField], i), r.value.splice(p, 0, i), ct(), c({
1026
+ M.set(i.node_id, i), x.set(i[t.rowConfig.keyField], i), r.value.splice(p, 0, i), ut(), c({
1027
1027
  row: i
1028
1028
  });
1029
1029
  }), an = (i, a) => new Promise((c) => {
1030
1030
  const p = r.value.findIndex((d) => d[t.rowConfig.keyField] == a[t.rowConfig.keyField]) + 1;
1031
- M.set(i.node_id, i), _.set(i[t.rowConfig.keyField], i), r.value.splice(p, 0, i), ct(), c({
1031
+ M.set(i.node_id, i), x.set(i[t.rowConfig.keyField], i), r.value.splice(p, 0, i), ut(), c({
1032
1032
  row: i
1033
1033
  });
1034
- }), bt = (i) => {
1034
+ }), xt = (i) => {
1035
1035
  const a = r.value.findIndex((c) => c[t.rowConfig.keyField] == i[t.rowConfig.keyField] || c === i);
1036
1036
  if (a > -1) {
1037
1037
  const c = i[t.rowConfig.keyField];
1038
- M.delete(i.node_id), _.delete(c), r.value.splice(a, 1), ct();
1038
+ M.delete(i.node_id), x.delete(c), r.value.splice(a, 1), ut();
1039
1039
  }
1040
1040
  }, sn = (i, a) => {
1041
1041
  if (!i || !i[t.rowConfig.keyField]) return !1;
@@ -1050,20 +1050,20 @@ const fi = /* @__PURE__ */ _n({
1050
1050
  });
1051
1051
  }, dn = (i) => {
1052
1052
  if (i && i[t.rowConfig.keyField]) {
1053
- const a = Fe(i[t.rowConfig.keyField]);
1054
- a._original ? Object.assign(a, a._original) : bt(a);
1053
+ const a = Ae(i[t.rowConfig.keyField]);
1054
+ a._original ? Object.assign(a, a._original) : xt(a);
1055
1055
  }
1056
1056
  }, un = () => {
1057
1057
  }, hn = () => {
1058
1058
  y.value = {};
1059
- }, xt = (i) => {
1059
+ }, kt = (i) => {
1060
1060
  var c, p, d;
1061
1061
  let a = r.value.findIndex((f) => f[t.rowConfig.keyField] == i[t.rowConfig.keyField]);
1062
1062
  if (a > -1 && t.treeConfig) {
1063
1063
  const f = ((c = t.treeConfig) == null ? void 0 : c.keyField) || ((p = t.treeConfig) == null ? void 0 : p.rowField) || "node_id", k = ((d = t.treeConfig) == null ? void 0 : d.parentField) || "parent_id", w = [], b = /* @__PURE__ */ new Map();
1064
1064
  b.set(i[f], !0);
1065
- for (let x = a + 1; x < r.value.length; x++) {
1066
- const C = r.value[x];
1065
+ for (let _ = a + 1; _ < r.value.length; _++) {
1066
+ const C = r.value[_];
1067
1067
  if (C && b.has(C[k]))
1068
1068
  w.push(C), b.set(C[f]);
1069
1069
  else
@@ -1074,13 +1074,13 @@ const fi = /* @__PURE__ */ _n({
1074
1074
  return [];
1075
1075
  };
1076
1076
  l({
1077
- isEditByRow: Zt,
1078
- getParentRow: Qt,
1077
+ isEditByRow: Re,
1078
+ getParentRow: dt,
1079
1079
  getSiblingRow: en,
1080
1080
  getNextRow: tn,
1081
- getRowById: Fe,
1081
+ getRowById: Ae,
1082
1082
  scrollToRow: nn,
1083
- setCurrentRow: Ye,
1083
+ setCurrentRow: Qe,
1084
1084
  setEditRow: Ve,
1085
1085
  setEditCell: ln,
1086
1086
  insertAt: on,
@@ -1089,12 +1089,12 @@ const fi = /* @__PURE__ */ _n({
1089
1089
  isInsertByRow: rn,
1090
1090
  reloadRow: cn,
1091
1091
  revertData: dn,
1092
- remove: bt,
1092
+ remove: xt,
1093
1093
  setAllTreeExpand: un,
1094
1094
  clearCurrentRow: hn,
1095
- getAllChilds: xt
1095
+ getAllChilds: kt
1096
1096
  });
1097
- const He = re(() => n.default().filter((i) => {
1097
+ const Oe = de(() => n.default().filter((i) => {
1098
1098
  var a;
1099
1099
  return ((a = i.type) == null ? void 0 : a.name) === "VirtualTableColumn";
1100
1100
  }).map((i) => {
@@ -1105,7 +1105,7 @@ const fi = /* @__PURE__ */ _n({
1105
1105
  width: (p = i.props) == null ? void 0 : p.width,
1106
1106
  slots: i.children
1107
1107
  };
1108
- })), Ze = (i) => {
1108
+ })), et = (i) => {
1109
1109
  try {
1110
1110
  return i === 0 ? {
1111
1111
  width: "0px"
@@ -1119,33 +1119,33 @@ const fi = /* @__PURE__ */ _n({
1119
1119
  flex: "1 1 100%"
1120
1120
  };
1121
1121
  }
1122
- }, _t = re(() => {
1122
+ }, wt = de(() => {
1123
1123
  var i;
1124
- return (i = t.treeConfig) != null && i.childCurrent && y.value ? xt(y.value).map((a) => a[t.rowConfig.keyField]) : [];
1125
- }), kt = ie({
1124
+ return (i = t.treeConfig) != null && i.childCurrent && y.value ? kt(y.value).map((a) => a[t.rowConfig.keyField]) : [];
1125
+ }), Ct = te({
1126
1126
  viewStartIndex: 0,
1127
1127
  viewEndIndex: 0,
1128
1128
  visibleStartIndex: 0,
1129
1129
  visibleEndIndex: 0
1130
1130
  });
1131
- let Qe = null, et = null;
1131
+ let tt = null, nt = null;
1132
1132
  const fn = (i, a) => {
1133
- Qe && cancelAnimationFrame(Qe), Qe = requestAnimationFrame(() => {
1133
+ tt && cancelAnimationFrame(tt), tt = requestAnimationFrame(() => {
1134
1134
  e("scroll-end", {
1135
- ...kt.value
1136
- }), Qe = null;
1135
+ ...Ct.value
1136
+ }), tt = null;
1137
1137
  });
1138
1138
  }, gn = (i, a, c, p) => {
1139
- et && cancelAnimationFrame(et), et = requestAnimationFrame(() => {
1140
- kt.value = {
1139
+ nt && cancelAnimationFrame(nt), nt = requestAnimationFrame(() => {
1140
+ Ct.value = {
1141
1141
  viewStartIndex: i,
1142
1142
  viewEndIndex: a,
1143
1143
  visibleStartIndex: c,
1144
1144
  visibleEndIndex: p
1145
- }, et = null;
1145
+ }, nt = null;
1146
1146
  });
1147
1147
  }, pn = (i, a) => {
1148
- var O, T;
1148
+ var S, L, Z;
1149
1149
  const {
1150
1150
  pageHeight: c,
1151
1151
  margin: p,
@@ -1154,34 +1154,35 @@ const fi = /* @__PURE__ */ _n({
1154
1154
  pageBorderStyle: k,
1155
1155
  showPageHeader: w,
1156
1156
  headerHeight: b = 0,
1157
- footerHeight: x = 0,
1157
+ footerHeight: _ = 0,
1158
1158
  showPageNumber: C
1159
- } = t.pageConfig, P = i.pageNumber || a + 1;
1160
- return q.value.has(a) ? U(W, null, [w !== !1 && (n["page-header"] || b > 0) ? U("div", {
1159
+ } = t.pageConfig, A = i.pageNumber || a + 1, R = (S = i.items) == null ? void 0 : S.some((j) => j._isCover);
1160
+ return W.value.has(a) ? q(G, null, [w !== !1 && (n["page-header"] || b > 0) && !R ? q("div", {
1161
1161
  class: "a4-page-header",
1162
1162
  style: {
1163
1163
  minHeight: `${Math.max(b, 1)}px`
1164
1164
  }
1165
- }, [(O = n["page-header"]) == null ? void 0 : O.call(n, {
1166
- pageNumber: P,
1165
+ }, [(L = n["page-header"]) == null ? void 0 : L.call(n, {
1166
+ pageNumber: A,
1167
1167
  pageIndex: a,
1168
- totalPages: H.value.length
1169
- })]) : null, a === 0 && t.showHeader ? U("div", {
1168
+ totalPages: $.value.length,
1169
+ isCoverPage: R
1170
+ })]) : null, a === 0 && t.showHeader ? q("div", {
1170
1171
  class: "a4-table-header"
1171
- }, [U("div", {
1172
+ }, [q("div", {
1172
1173
  class: "virtual-table-header we-vt-table--header we-vt-table--header-wrapper"
1173
- }, [He.value.map((E) => {
1174
- var G, X, R;
1175
- return U("div", {
1174
+ }, [Oe.value.map((j) => {
1175
+ var U, ce, ae;
1176
+ return q("div", {
1176
1177
  class: "we-vt-header--column",
1177
- key: E.prop,
1178
- style: Ze(E.width)
1179
- }, [U("div", {
1178
+ key: j.prop,
1179
+ style: et(j.width)
1180
+ }, [q("div", {
1180
1181
  class: "we-vt-cell"
1181
- }, [(G = E.slots) != null && G.header ? (R = (X = E.slots) == null ? void 0 : X.header) == null ? void 0 : R.call(X, {
1182
- column: E
1183
- }) : E.title])]);
1184
- })])]) : null, U("div", {
1182
+ }, [(U = j.slots) != null && U.header ? (ae = (ce = j.slots) == null ? void 0 : ce.header) == null ? void 0 : ae.call(ce, {
1183
+ column: j
1184
+ }) : j.title])]);
1185
+ })])]) : null, q("div", {
1185
1186
  class: "a4-page-content",
1186
1187
  style: {
1187
1188
  ...d ? {
@@ -1189,55 +1190,55 @@ const fi = /* @__PURE__ */ _n({
1189
1190
  padding: `${f}px`
1190
1191
  } : {}
1191
1192
  }
1192
- }, [i.items.map((E) => {
1193
- var G, X;
1194
- return U("div", {
1195
- key: E[t.rowConfig.keyField],
1196
- "data-id": E[t.rowConfig.keyField],
1193
+ }, [i.items.map((j) => {
1194
+ var U, ce;
1195
+ return q("div", {
1196
+ key: j[t.rowConfig.keyField],
1197
+ "data-id": j[t.rowConfig.keyField],
1197
1198
  class: {
1198
1199
  "virtual-table-row": !0,
1199
1200
  "we-vt-body--row": !0,
1200
- "row--current": E[t.rowConfig.keyField] === ((G = y.value) == null ? void 0 : G[t.rowConfig.keyField]) || ((X = t.treeConfig) == null ? void 0 : X.childCurrent) && _t.value.includes(E[t.rowConfig.keyField])
1201
+ "row--current": j[t.rowConfig.keyField] === ((U = y.value) == null ? void 0 : U[t.rowConfig.keyField]) || ((ce = t.treeConfig) == null ? void 0 : ce.childCurrent) && wt.value.includes(j[t.rowConfig.keyField])
1201
1202
  },
1202
1203
  style: {
1203
1204
  width: "100%"
1204
1205
  },
1205
- onClick: () => Me(E),
1206
- onDblclick: () => fe(E)
1207
- }, [He.value.map((R) => {
1208
- var be, Te, Le, Oe, ke, se, je;
1209
- return U("div", {
1210
- key: R.prop,
1206
+ onClick: () => ke(j),
1207
+ onDblclick: () => Ie(j)
1208
+ }, [Oe.value.map((ae) => {
1209
+ var Be, De, xe, pe, je, J, He;
1210
+ return q("div", {
1211
+ key: ae.prop,
1211
1212
  class: "virtual-table-cell we-vt-cell",
1212
- style: Ze(R.width),
1213
- "data-prop": R.prop
1214
- }, [E._editing && ((be = t.editConfig) == null ? void 0 : be.trigger) === "dblclick" ? ((Te = R.slots) == null ? void 0 : Te.edit) && ((Oe = (Le = R.slots) == null ? void 0 : Le.edit) == null ? void 0 : Oe.call(Le, {
1215
- row: E,
1216
- column: R
1217
- })) : ((ke = R.slots) == null ? void 0 : ke.default) && ((je = (se = R.slots) == null ? void 0 : se.default) == null ? void 0 : je.call(se, {
1218
- row: E,
1219
- column: R
1213
+ style: et(ae.width),
1214
+ "data-prop": ae.prop
1215
+ }, [j._editing && ((Be = t.editConfig) == null ? void 0 : Be.trigger) === "dblclick" ? ((De = ae.slots) == null ? void 0 : De.edit) && ((pe = (xe = ae.slots) == null ? void 0 : xe.edit) == null ? void 0 : pe.call(xe, {
1216
+ row: j,
1217
+ column: ae
1218
+ })) : ((je = ae.slots) == null ? void 0 : je.default) && ((He = (J = ae.slots) == null ? void 0 : J.default) == null ? void 0 : He.call(J, {
1219
+ row: j,
1220
+ column: ae
1220
1221
  }))]);
1221
1222
  })]);
1222
- })]), n["page-footer"] ? U("div", {
1223
+ })]), n["page-footer"] ? q("div", {
1223
1224
  class: "a4-page-footer"
1224
- }, [(T = n["page-footer"]) == null ? void 0 : T.call(n, {
1225
- pageNumber: P,
1225
+ }, [(Z = n["page-footer"]) == null ? void 0 : Z.call(n, {
1226
+ pageNumber: A,
1226
1227
  pageIndex: a,
1227
- totalPages: H.value.length
1228
- })]) : U("div", {
1228
+ totalPages: $.value.length
1229
+ })]) : q("div", {
1229
1230
  class: "a4-page-footer",
1230
1231
  contenteditable: "false"
1231
- }, [C !== !1 ? U("span", {
1232
+ }, [C !== !1 ? q("span", {
1232
1233
  class: "page-number",
1233
1234
  contenteditable: "false"
1234
- }, [P, Be(" / "), H.value.length]) : null])]) : U("div", {
1235
+ }, [Le("第"), A, Le(" / "), $.value.length, Le("页")]) : null])]) : q("div", {
1235
1236
  class: "a4-page-loading"
1236
- }, [U("div", {
1237
+ }, [q("div", {
1237
1238
  class: "loading-spinner"
1238
- }, null), U("div", {
1239
+ }, null), q("div", {
1239
1240
  class: "loading-text"
1240
- }, [Be("加载中...")])]);
1241
+ }, [Le("加载中...")])]);
1241
1242
  }, vn = () => {
1242
1243
  var k;
1243
1244
  const {
@@ -1248,26 +1249,26 @@ const fi = /* @__PURE__ */ _n({
1248
1249
  showPageBorder: d,
1249
1250
  pageBorderPadding: f
1250
1251
  } = t.pageConfig;
1251
- return U("div", {
1252
+ return q("div", {
1252
1253
  class: "virtual-table we-vt-table we-vt-table--render-default border--none"
1253
- }, [U("div", {
1254
+ }, [q("div", {
1254
1255
  class: "a4-pages-container",
1255
1256
  contenteditable: ((k = t.editConfig) == null ? void 0 : k.trigger) === "contenteditable" ? "true" : void 0,
1256
- onContextmenu: j,
1257
- onFocusin: te,
1258
- onFocusout: ae
1259
- }, [H.value.map((w, b) => {
1260
- const x = q.value.has(b);
1261
- return U("div", {
1257
+ onContextmenu: Ce,
1258
+ onFocusin: be,
1259
+ onFocusout: oe
1260
+ }, [$.value.map((w, b) => {
1261
+ const _ = W.value.has(b);
1262
+ return q("div", {
1262
1263
  key: `page-${b}`,
1263
- class: x ? "a4-page" : "a4-page-placeholder",
1264
+ class: _ ? "a4-page" : "a4-page-placeholder",
1264
1265
  "data-page-index": b,
1265
1266
  style: {
1266
1267
  width: `${a}px`,
1267
1268
  minHeight: `${i}px`,
1268
1269
  marginBottom: `${p}px`,
1269
- padding: x ? `${d ? c - f : c}px` : "0",
1270
- paddingBottom: x ? "12px" : "0",
1270
+ padding: _ ? `${d ? c - f : c}px` : "0",
1271
+ paddingBottom: _ ? "12px" : "0",
1271
1272
  boxSizing: "border-box",
1272
1273
  position: "relative"
1273
1274
  }
@@ -1275,37 +1276,37 @@ const fi = /* @__PURE__ */ _n({
1275
1276
  })])]);
1276
1277
  }, mn = () => {
1277
1278
  var i;
1278
- return U("div", {
1279
+ return q("div", {
1279
1280
  class: "virtual-table we-vt-table we-vt-table--render-default border--none"
1280
- }, [t.showHeader ? U("div", {
1281
+ }, [t.showHeader ? q("div", {
1281
1282
  class: "virtual-table-header we-vt-table--header we-vt-table--header-wrapper"
1282
- }, [He.value.map((a) => {
1283
+ }, [Oe.value.map((a) => {
1283
1284
  var c, p, d;
1284
- return U("div", {
1285
+ return q("div", {
1285
1286
  class: "we-vt-header--column",
1286
1287
  key: a.prop,
1287
- style: Ze(a.width)
1288
- }, [U("div", {
1288
+ style: et(a.width)
1289
+ }, [q("div", {
1289
1290
  class: "we-vt-cell"
1290
1291
  }, [(c = a.slots) != null && c.header ? (d = (p = a.slots) == null ? void 0 : p.header) == null ? void 0 : d.call(p, {
1291
1292
  column: a
1292
- }) : a.title]), U("div", {
1293
+ }) : a.title]), q("div", {
1293
1294
  class: "we-vt-resizable is--line"
1294
1295
  }, null)]);
1295
- })]) : void 0, U(Sn, {
1296
+ })]) : void 0, q(En, {
1296
1297
  ref: s,
1297
- items: F.value,
1298
- minItemSize: _e.value,
1298
+ items: E.value,
1299
+ minItemSize: ue.value,
1299
1300
  keyField: t.rowConfig.keyField,
1300
1301
  emitUpdate: !1,
1301
1302
  buffer: 300,
1302
1303
  class: "virtual-table-wrapper",
1303
1304
  contenteditable: ((i = t.editConfig) == null ? void 0 : i.trigger) === "contenteditable" ? "true" : void 0,
1304
- onContextmenu: j,
1305
+ onContextmenu: Ce,
1305
1306
  onScrollend: fn,
1306
1307
  onUpdate: gn,
1307
- onFocusin: te,
1308
- onFocusout: ae
1308
+ onFocusin: be,
1309
+ onFocusout: oe
1309
1310
  }, {
1310
1311
  default: ({
1311
1312
  item: a,
@@ -1314,7 +1315,7 @@ const fi = /* @__PURE__ */ _n({
1314
1315
  }) => {
1315
1316
  var f, k, w;
1316
1317
  let d;
1317
- return U(Fn, {
1318
+ return q(Sn, {
1318
1319
  key: a[t.rowConfig.keyField],
1319
1320
  item: a,
1320
1321
  active: p,
@@ -1326,19 +1327,19 @@ const fi = /* @__PURE__ */ _n({
1326
1327
  "virtual-table-row": !0,
1327
1328
  "we-vt-body--row": !0,
1328
1329
  "row--current": a[t.rowConfig.keyField] === ((k = y.value) == null ? void 0 : k[t.rowConfig.keyField]) || // 如果是树,并且配置了childCurrent高亮子节点
1329
- ((w = t.treeConfig) == null ? void 0 : w.childCurrent) && _t.value.includes(a[t.rowConfig.keyField])
1330
+ ((w = t.treeConfig) == null ? void 0 : w.childCurrent) && wt.value.includes(a[t.rowConfig.keyField])
1330
1331
  }
1331
- }, hi(d = He.value.map((b) => {
1332
- var x, C, P, O, T, E, G;
1333
- return U("div", {
1332
+ }, ui(d = Oe.value.map((b) => {
1333
+ var _, C, A, R, S, L, Z;
1334
+ return q("div", {
1334
1335
  key: b.prop,
1335
1336
  class: "virtual-table-cell we-vt-cell",
1336
- style: Ze(b.width),
1337
+ style: et(b.width),
1337
1338
  "data-prop": b.prop
1338
- }, [a._editing && ((x = t.editConfig) == null ? void 0 : x.trigger) === "dblclick" ? ((C = b.slots) == null ? void 0 : C.edit) && ((O = (P = b.slots) == null ? void 0 : P.edit) == null ? void 0 : O.call(P, {
1339
+ }, [a._editing && ((_ = t.editConfig) == null ? void 0 : _.trigger) === "dblclick" ? ((C = b.slots) == null ? void 0 : C.edit) && ((R = (A = b.slots) == null ? void 0 : A.edit) == null ? void 0 : R.call(A, {
1339
1340
  row: a,
1340
1341
  column: b
1341
- })) : ((T = b.slots) == null ? void 0 : T.default) && ((G = (E = b.slots) == null ? void 0 : E.default) == null ? void 0 : G.call(E, {
1342
+ })) : ((S = b.slots) == null ? void 0 : S.default) && ((Z = (L = b.slots) == null ? void 0 : L.default) == null ? void 0 : Z.call(L, {
1342
1343
  row: a,
1343
1344
  column: b
1344
1345
  }))]);
@@ -1350,12 +1351,12 @@ const fi = /* @__PURE__ */ _n({
1350
1351
  };
1351
1352
  return () => t.pageConfig.enabled ? vn() : mn();
1352
1353
  }
1353
- }), ze = (t, e) => {
1354
+ }), Ne = (t, e) => {
1354
1355
  const n = t.__vccOpts || t;
1355
1356
  for (const [l, o] of e)
1356
1357
  n[l] = o;
1357
1358
  return n;
1358
- }, gi = /* @__PURE__ */ ze(fi, [["__scopeId", "data-v-bd96f5fb"]]), pi = {
1359
+ }, fi = /* @__PURE__ */ Ne(hi, [["__scopeId", "data-v-6bbd7545"]]), gi = {
1359
1360
  name: "VirtualTableColumn",
1360
1361
  props: {
1361
1362
  prop: String,
@@ -1363,13 +1364,13 @@ const fi = /* @__PURE__ */ _n({
1363
1364
  width: [String, Number]
1364
1365
  }
1365
1366
  };
1366
- function vi(t, e, n, l, o, s) {
1367
+ function pi(t, e, n, l, o, s) {
1367
1368
  return Cn(t.$slots, "default");
1368
1369
  }
1369
- const mi = /* @__PURE__ */ ze(pi, [["render", vi]]), yi = { class: "catalog-node" }, bi = ["title"], xi = { class: "catalog-node__text" }, _i = {
1370
+ const vi = /* @__PURE__ */ Ne(gi, [["render", pi]]), mi = { class: "catalog-node" }, yi = ["title"], bi = { class: "catalog-node__text" }, _i = {
1370
1371
  key: 0,
1371
1372
  class: "catalog-node__children"
1372
- }, ki = {
1373
+ }, xi = {
1373
1374
  __name: "CatalogNode",
1374
1375
  props: {
1375
1376
  item: { type: Object, required: !0 },
@@ -1378,96 +1379,96 @@ const mi = /* @__PURE__ */ ze(pi, [["render", vi]]), yi = { class: "catalog-node
1378
1379
  },
1379
1380
  emits: ["navigate"],
1380
1381
  setup(t, { emit: e }) {
1381
- const n = t, l = e, o = ie(!0), s = re(() => n.item.children && n.item.children.length > 0);
1382
+ const n = t, l = e, o = te(!0), s = de(() => n.item.children && n.item.children.length > 0);
1382
1383
  function v(m) {
1383
1384
  m.stopPropagation(), o.value = !o.value;
1384
1385
  }
1385
1386
  return (m, y) => {
1386
1387
  const r = Mn("CatalogNode", !0);
1387
- return u(), g("div", yi, [
1388
- Z("div", {
1389
- class: Ae(["catalog-node__label", { "is-active": t.activeId === t.item.nodeId }]),
1388
+ return u(), g("div", mi, [
1389
+ ne("div", {
1390
+ class: Pe(["catalog-node__label", { "is-active": t.activeId === t.item.nodeId }]),
1390
1391
  style: V({ paddingLeft: 10 + t.depth * 14 + "px" }),
1391
1392
  title: t.item.name,
1392
1393
  onClick: y[0] || (y[0] = (M) => l("navigate", t.item))
1393
1394
  }, [
1394
- Z("span", {
1395
+ ne("span", {
1395
1396
  class: "catalog-node__toggle",
1396
1397
  onClick: v
1397
1398
  }, [
1398
- s.value ? (u(), Ie(ot(o.value ? K(Jn) : K(qt)), {
1399
+ s.value ? (u(), Fe(at(o.value ? K(Gn) : K(Gt)), {
1399
1400
  key: 0,
1400
1401
  size: 14
1401
- })) : pe("", !0)
1402
+ })) : ve("", !0)
1402
1403
  ]),
1403
- Z("span", xi, J(t.item.name || "(无标题)"), 1)
1404
- ], 14, bi),
1404
+ ne("span", bi, Y(t.item.name || "(无标题)"), 1)
1405
+ ], 14, yi),
1405
1406
  s.value && o.value ? (u(), g("div", _i, [
1406
- (u(!0), g(W, null, Y(t.item.children, (M) => (u(), Ie(r, {
1407
+ (u(!0), g(G, null, Q(t.item.children, (M) => (u(), Fe(r, {
1407
1408
  key: M.nodeId,
1408
1409
  item: M,
1409
1410
  depth: t.depth + 1,
1410
1411
  "active-id": t.activeId,
1411
- onNavigate: y[1] || (y[1] = (_) => l("navigate", _))
1412
+ onNavigate: y[1] || (y[1] = (x) => l("navigate", x))
1412
1413
  }, null, 8, ["item", "depth", "active-id"]))), 128))
1413
- ])) : pe("", !0)
1414
+ ])) : ve("", !0)
1414
1415
  ]);
1415
1416
  };
1416
1417
  }
1417
- }, wi = /* @__PURE__ */ ze(ki, [["__scopeId", "data-v-ac882917"]]), Ci = {
1418
+ }, ki = /* @__PURE__ */ Ne(xi, [["__scopeId", "data-v-ac882917"]]), wi = {
1418
1419
  key: 0,
1419
1420
  class: "catalog catalog--collapsed"
1420
- }, Mi = {
1421
+ }, Ci = {
1421
1422
  key: 1,
1422
1423
  class: "catalog"
1423
- }, Ii = { class: "catalog__header" }, Ei = { class: "catalog__title" }, Si = { class: "catalog__body" }, Fi = {
1424
+ }, Mi = { class: "catalog__header" }, Ii = { class: "catalog__title" }, Ei = { class: "catalog__body" }, Si = {
1424
1425
  key: 0,
1425
1426
  class: "catalog__empty"
1426
- }, Ti = {
1427
+ }, Fi = {
1427
1428
  __name: "index",
1428
1429
  props: {
1429
1430
  items: { type: Array, default: () => [] }
1430
1431
  },
1431
1432
  emits: ["navigate"],
1432
1433
  setup(t, { emit: e }) {
1433
- const n = e, l = ie(!1), o = ie("");
1434
+ const n = e, l = te(!1), o = te("");
1434
1435
  function s(v) {
1435
1436
  o.value = v.nodeId, n("navigate", v);
1436
1437
  }
1437
- return (v, m) => l.value ? (u(), g("div", Ci, [
1438
- Z("button", {
1438
+ return (v, m) => l.value ? (u(), g("div", wi, [
1439
+ ne("button", {
1439
1440
  class: "catalog__icon-btn",
1440
1441
  title: "展开目录",
1441
1442
  onClick: m[0] || (m[0] = (y) => l.value = !1)
1442
1443
  }, [
1443
- U(K(Xn), { size: 18 })
1444
+ q(K(Jn), { size: 18 })
1444
1445
  ])
1445
- ])) : (u(), g("div", Mi, [
1446
- Z("div", Ii, [
1447
- Z("span", Ei, [
1448
- U(K(Yn), { size: 16 }),
1449
- m[2] || (m[2] = Be(" 目录 ", -1))
1446
+ ])) : (u(), g("div", Ci, [
1447
+ ne("div", Mi, [
1448
+ ne("span", Ii, [
1449
+ q(K(Xn), { size: 16 }),
1450
+ m[2] || (m[2] = Le(" 目录 ", -1))
1450
1451
  ]),
1451
- Z("button", {
1452
+ ne("button", {
1452
1453
  class: "catalog__icon-btn",
1453
1454
  title: "收起目录",
1454
1455
  onClick: m[1] || (m[1] = (y) => l.value = !0)
1455
1456
  }, [
1456
- U(K(Zn), { size: 18 })
1457
+ q(K(Yn), { size: 18 })
1457
1458
  ])
1458
1459
  ]),
1459
- Z("div", Si, [
1460
- (u(!0), g(W, null, Y(t.items, (y) => (u(), Ie(wi, {
1460
+ ne("div", Ei, [
1461
+ (u(!0), g(G, null, Q(t.items, (y) => (u(), Fe(ki, {
1461
1462
  key: y.nodeId,
1462
1463
  item: y,
1463
1464
  "active-id": o.value,
1464
1465
  onNavigate: s
1465
1466
  }, null, 8, ["item", "active-id"]))), 128)),
1466
- t.items.length ? pe("", !0) : (u(), g("div", Fi, " 暂无目录 "))
1467
+ t.items.length ? ve("", !0) : (u(), g("div", Si, " 暂无目录 "))
1467
1468
  ])
1468
1469
  ]));
1469
1470
  }
1470
- }, Ai = /* @__PURE__ */ ze(Ti, [["__scopeId", "data-v-8becafa1"]]), Pi = {
1471
+ }, Ti = /* @__PURE__ */ Ne(Fi, [["__scopeId", "data-v-8becafa1"]]), Ai = {
1471
1472
  first: 1,
1472
1473
  second: 2,
1473
1474
  third: 3,
@@ -1475,13 +1476,13 @@ const mi = /* @__PURE__ */ ze(pi, [["render", vi]]), yi = { class: "catalog-node
1475
1476
  fifth: 5,
1476
1477
  sixth: 6
1477
1478
  };
1478
- function $i(t) {
1479
- return t.blockType !== "title" || !t.level ? 0 : Pi[t.level] || 1;
1479
+ function Pi(t) {
1480
+ return t.blockType !== "title" || !t.level ? 0 : Ai[t.level] || 1;
1480
1481
  }
1481
- function Li(t) {
1482
+ function $i(t) {
1482
1483
  const e = [];
1483
1484
  for (const o of t || []) {
1484
- const s = $i(o);
1485
+ const s = Pi(o);
1485
1486
  s && e.push({
1486
1487
  id: o.node_id,
1487
1488
  nodeId: o.node_id,
@@ -1501,7 +1502,7 @@ function Li(t) {
1501
1502
  }
1502
1503
  return l;
1503
1504
  }
1504
- const Ri = {
1505
+ const Li = {
1505
1506
  first: 0,
1506
1507
  second: 1,
1507
1508
  third: 2,
@@ -1511,7 +1512,7 @@ const Ri = {
1511
1512
  seventh: 6,
1512
1513
  eighth: 7
1513
1514
  };
1514
- function it(t, e) {
1515
+ function lt(t, e) {
1515
1516
  let n = "", l = t;
1516
1517
  const o = e ? 65 : 97;
1517
1518
  for (; l > 0; ) {
@@ -1520,47 +1521,47 @@ function it(t, e) {
1520
1521
  }
1521
1522
  return n;
1522
1523
  }
1523
- const Ht = [
1524
+ const Bt = [
1524
1525
  (t) => t.toString(),
1525
1526
  // first:数字
1526
- (t) => it(t, !0),
1527
+ (t) => lt(t, !0),
1527
1528
  // second:大写字母
1528
1529
  (t) => `(${t})`,
1529
1530
  // third:括号数字
1530
- (t) => `(${it(t, !1)})`,
1531
+ (t) => `(${lt(t, !1)})`,
1531
1532
  // fourth:括号小写字母
1532
1533
  (t) => `${t})`,
1533
1534
  // fifth:数字+右括号
1534
- (t) => `${it(t, !1)})`,
1535
+ (t) => `${lt(t, !1)})`,
1535
1536
  // sixth:小写字母+右括号
1536
1537
  (t) => `<${t}>`,
1537
1538
  // seventh:数字+尖括号
1538
- (t) => `<${it(t, !1)}>`
1539
+ (t) => `<${lt(t, !1)}>`
1539
1540
  // eighth:小写字母+尖括号
1540
1541
  ];
1541
- function Hi() {
1542
+ function Ri() {
1542
1543
  const t = new Array(8).fill(0);
1543
1544
  return {
1544
1545
  next(e, n) {
1545
- const l = Ri[e];
1546
+ const l = Li[e];
1546
1547
  if (l == null) return "";
1547
1548
  t[l]++;
1548
1549
  for (let s = l + 1; s < t.length; s++) t[s] = 0;
1549
1550
  if (n != null && n !== "")
1550
1551
  return `${n} `;
1551
- const o = Ht[Math.min(l, Ht.length - 1)];
1552
+ const o = Bt[Math.min(l, Bt.length - 1)];
1552
1553
  return `${o(t[l])}. `;
1553
1554
  }
1554
1555
  };
1555
1556
  }
1556
- const We = 14, Jt = 760, Ot = 756, Oi = {
1557
+ const We = 14, Yt = 760, Dt = 756, Hi = {
1557
1558
  left: "left",
1558
1559
  center: "center",
1559
1560
  right: "right",
1560
1561
  alignment: "justify",
1561
1562
  justify: "justify"
1562
1563
  };
1563
- function Xt(t) {
1564
+ function Zt(t) {
1564
1565
  const e = [];
1565
1566
  let n = !1;
1566
1567
  const l = (o) => {
@@ -1579,19 +1580,24 @@ function Xt(t) {
1579
1580
  continue;
1580
1581
  }
1581
1582
  if (o && o.type === "area") {
1582
- const s = Xt(o.valueList || []), v = (o.areaId || "").includes("cover");
1583
- for (const m of s) l(m);
1584
- v && (n = !0);
1583
+ const s = Zt(o.valueList || []);
1584
+ if ((o.areaId || "").includes("cover")) {
1585
+ for (const m of s)
1586
+ l({ ...m, _isCover: !0 });
1587
+ n = !0;
1588
+ } else
1589
+ for (const m of s) l(m);
1585
1590
  } else
1586
1591
  l(o);
1587
1592
  }
1588
1593
  return e;
1589
1594
  }
1595
+ const Oi = (t) => t == null ? void 0 : t.some((e) => e._isCover);
1590
1596
  function Ge(t) {
1591
- const e = Xt(t), n = [];
1597
+ const e = Zt(t), n = [];
1592
1598
  let l = [], o = 0, s = null;
1593
1599
  const v = (y) => {
1594
- l.length && (n.push({ type: "paragraph", elements: [...l], rowFlex: y }), l = []);
1600
+ l.length && (n.push({ type: "paragraph", elements: [...l], rowFlex: y, _isCover: Oi(l) }), l = []);
1595
1601
  }, m = () => {
1596
1602
  if (o === 0) return;
1597
1603
  const y = s;
@@ -1602,16 +1608,16 @@ function Ge(t) {
1602
1608
  };
1603
1609
  for (const y of e || [])
1604
1610
  if (y.type === "table")
1605
- m(), v(), n.push({ type: "table", el: y });
1611
+ m(), v(), n.push({ type: "table", el: y, _isCover: !!y._isCover });
1606
1612
  else if (y.type === "title")
1607
- m(), v(), n.push({ type: "title", el: y });
1613
+ m(), v(), n.push({ type: "title", el: y, _isCover: !!y._isCover });
1608
1614
  else if (y.type === "list") {
1609
1615
  m(), v();
1610
1616
  const r = [];
1611
1617
  let M = [];
1612
- for (const _ of y.valueList || [])
1613
- _.value === `
1614
- ` || _.value === "​" ? (r.push([...M]), M = []) : M.push(_);
1618
+ for (const x of y.valueList || [])
1619
+ x.value === `
1620
+ ` || x.value === "​" ? (r.push([...M]), M = []) : M.push(x);
1615
1621
  (M.length || r.length === 0) && r.push([...M]), n.push({ type: "list", listType: y.listType || "ul", listStyle: y.listStyle || "disc", items: r });
1616
1622
  } else if (y.listId) {
1617
1623
  m(), v();
@@ -1620,10 +1626,10 @@ function Ge(t) {
1620
1626
  } else y.value != null && /^[\n200B]+$/.test(y.value) ? (o += y.value.length, y.rowFlex && (s = y.rowFlex)) : (m(), l.push(y));
1621
1627
  return m(), v(), n;
1622
1628
  }
1623
- function De(t) {
1629
+ function ze(t) {
1624
1630
  const e = t.filter((r) => r.type === "image").reduce((r, M) => r + (M.height || M.width || 0), 0), n = t.filter((r) => r.type !== "image").map((r) => r.value || "").join("");
1625
1631
  if (!n) return e || 20;
1626
- const l = t.reduce((r, M) => Math.max(r, M.size || 0), 0) || 14, o = l + 6, s = (n.match(/[一-龥]/g) || []).length, v = n.length - s, m = s * l + v * (l * 0.5), y = Math.max(1, Math.ceil(m / Jt));
1632
+ const l = t.reduce((r, M) => Math.max(r, M.size || 0), 0) || 14, o = l + 6, s = (n.match(/[一-龥]/g) || []).length, v = n.length - s, m = s * l + v * (l * 0.5), y = Math.max(1, Math.ceil(m / Yt));
1627
1633
  return e + Math.max(o, y * o);
1628
1634
  }
1629
1635
  function Bi(t) {
@@ -1631,10 +1637,10 @@ function Bi(t) {
1631
1637
  const e = [];
1632
1638
  let n = [];
1633
1639
  for (const l of t)
1634
- l.type === "image" && (l.width || 0) >= Jt ? (n.length && (e.push(n), n = []), e.push([l])) : n.push(l);
1640
+ l.type === "image" && (l.width || 0) >= Yt ? (n.length && (e.push(n), n = []), e.push([l])) : n.push(l);
1635
1641
  return n.length && e.push(n), e.length ? e : [[]];
1636
1642
  }
1637
- function Bt(t) {
1643
+ function zt(t) {
1638
1644
  if (t.length === 0) return [];
1639
1645
  const e = new Array(t.length).fill(0);
1640
1646
  t.forEach((s, v) => {
@@ -1654,13 +1660,13 @@ function Bt(t) {
1654
1660
  o = Math.max(o, e[s]), o <= s && (n.push(t.slice(l, s + 1)), l = s + 1, o = 0);
1655
1661
  return l < t.length && n.push(t.slice(l)), n;
1656
1662
  }
1657
- function ht(t) {
1663
+ function gt(t) {
1658
1664
  const e = (t == null ? void 0 : t.width) || 0;
1659
- return !e || e <= Ot ? 1 : Ot / e;
1665
+ return !e || e <= Dt ? 1 : Dt / e;
1660
1666
  }
1661
- function Dt(t) {
1667
+ function Nt(t) {
1662
1668
  var s, v;
1663
- const e = t.elements || [], n = ((s = e.find((m) => m.rowFlex)) == null ? void 0 : s.rowFlex) || t.rowFlex, l = { textAlign: Oi[n] || "left" }, o = (v = e.find((m) => m.rowMargin)) == null ? void 0 : v.rowMargin;
1669
+ const e = t.elements || [], n = ((s = e.find((m) => m.rowFlex)) == null ? void 0 : s.rowFlex) || t.rowFlex, l = { textAlign: Hi[n] || "left" }, o = (v = e.find((m) => m.rowMargin)) == null ? void 0 : v.rowMargin;
1664
1670
  return o && (l.lineHeight = o), l;
1665
1671
  }
1666
1672
  function Di(t) {
@@ -1676,14 +1682,14 @@ function Di(t) {
1676
1682
  } else v.type === "list" ? (n += ((s = v.items) == null ? void 0 : s.length) || 1, o = !0) : (n++, o = !0);
1677
1683
  return n > 1 || l > 30 || o ? "top" : t.verticalAlign || "middle";
1678
1684
  }
1679
- function ve(t) {
1685
+ function _e(t) {
1680
1686
  const e = {};
1681
1687
  t.font && (e.fontFamily = t.font), e.fontSize = (t.size || We) + "px", t.bold != null && (e.fontWeight = t.bold ? "bold" : "normal"), t.italic != null && (e.fontStyle = t.italic ? "italic" : "normal"), t.color && (e.color = t.color), t.highlight && t.highlight !== "rgb(255, 255, 255)" && t.highlight !== "#ffffff" && (e.backgroundColor = t.highlight);
1682
1688
  const n = [t.underline && "underline", t.strikeout && "line-through"].filter(Boolean).join(" ");
1683
1689
  return n && (e.textDecoration = n), t.letterSpacing && (e.letterSpacing = t.letterSpacing + "px"), e;
1684
1690
  }
1685
1691
  const zi = 5;
1686
- function zt(t, e = !1) {
1692
+ function Vt(t, e = !1) {
1687
1693
  var l, o;
1688
1694
  let n = 0;
1689
1695
  for (const s of t)
@@ -1691,12 +1697,12 @@ function zt(t, e = !1) {
1691
1697
  const v = ((l = s.el) == null ? void 0 : l.trList) || [];
1692
1698
  n += v.reduce((m, y) => m + (y.height || y.minHeight || 35), 0);
1693
1699
  } else if (s.type === "title")
1694
- n += De(s.titleValueList || ((o = s.el) == null ? void 0 : o.valueList) || []);
1700
+ n += ze(s.titleValueList || ((o = s.el) == null ? void 0 : o.valueList) || []);
1695
1701
  else if (s.type === "paragraph")
1696
- n += De(s.elements || []);
1702
+ n += ze(s.elements || []);
1697
1703
  else if (s.type === "list") {
1698
1704
  const v = Math.round(18), m = (s.items || []).reduce(
1699
- (y, r) => y + (r.length ? De(r) : v),
1705
+ (y, r) => y + (r.length ? ze(r) : v),
1700
1706
  0
1701
1707
  );
1702
1708
  n += Math.max(m, v);
@@ -1722,47 +1728,47 @@ const Ni = {
1722
1728
  }
1723
1729
  },
1724
1730
  setup(t) {
1725
- const e = t, n = pt("bindTableObserver", null), l = pt("resolveImageUrl", null);
1731
+ const e = t, n = mt("bindTableObserver", null), l = mt("resolveImageUrl", null);
1726
1732
  function o(v) {
1727
1733
  if (!v) return "";
1728
1734
  const m = (l == null ? void 0 : l.value) || l;
1729
1735
  return typeof m == "function" ? m(v) : v;
1730
1736
  }
1731
- const s = re(() => e.isHeaderFooter ? 0 : e.block.indentPx ?? 0);
1737
+ const s = de(() => e.isHeaderFooter ? 0 : e.block.indentPx ?? 0);
1732
1738
  return (v, m) => {
1733
1739
  var y;
1734
1740
  return t.block.blockType === "title" ? (u(), g("p", {
1735
1741
  key: 0,
1736
- class: Ae(["doc-title", `doc-title--${t.block.level}`]),
1742
+ class: Pe(["doc-title", `doc-title--${t.block.level}`]),
1737
1743
  style: V({ paddingLeft: s.value ? s.value + "px" : void 0 })
1738
1744
  }, [
1739
- (u(!0), g(W, null, Y(t.block.titleValueList || [], (r, M) => (u(), g("span", {
1745
+ (u(!0), g(G, null, Q(t.block.titleValueList || [], (r, M) => (u(), g("span", {
1740
1746
  key: M,
1741
- style: V(K(ve)(r))
1742
- }, J(r.value), 5))), 128))
1747
+ style: V(K(_e)(r))
1748
+ }, Y(r.value), 5))), 128))
1743
1749
  ], 6)) : t.block.blockType === "paragraph" ? (u(), g("p", {
1744
1750
  key: 1,
1745
1751
  class: "doc-para",
1746
- style: V({ ...K(Dt)(t.block), paddingLeft: s.value ? s.value + "px" : void 0 })
1752
+ style: V({ ...K(Nt)(t.block), paddingLeft: s.value ? s.value + "px" : void 0 })
1747
1753
  }, [
1748
- t.block.elements.length ? pe("", !0) : (u(), g("span", Ni, " ")),
1749
- (u(!0), g(W, null, Y(t.block.elements, (r, M) => {
1750
- var _, H, B, q, S, D, A, h, I, L, F, Q, _e;
1751
- return u(), g(W, { key: M }, [
1754
+ t.block.elements.length ? ve("", !0) : (u(), g("span", Ni, " ")),
1755
+ (u(!0), g(G, null, Q(t.block.elements, (r, M) => {
1756
+ var x, $, B, W, I, D, T, h, F, P, E, X, ue;
1757
+ return u(), g(G, { key: M }, [
1752
1758
  !r.type || r.type === "text" ? (u(), g("span", {
1753
1759
  key: 0,
1754
- style: V(K(ve)(r))
1755
- }, J(r.value), 5)) : r.type === "hyperlink" ? (u(), g("a", {
1760
+ style: V(K(_e)(r))
1761
+ }, Y(r.value), 5)) : r.type === "hyperlink" ? (u(), g("a", {
1756
1762
  key: 1,
1757
1763
  href: r.url,
1758
1764
  class: "doc-link",
1759
1765
  target: "_blank",
1760
1766
  rel: "noopener"
1761
1767
  }, [
1762
- (u(!0), g(W, null, Y(r.valueList || [], ($, le) => (u(), g("span", {
1763
- key: le,
1764
- style: V(K(ve)($))
1765
- }, J($.value), 5))), 128))
1768
+ (u(!0), g(G, null, Q(r.valueList || [], (z, ie) => (u(), g("span", {
1769
+ key: ie,
1770
+ style: V(K(_e)(z))
1771
+ }, Y(z.value), 5))), 128))
1766
1772
  ], 8, Vi)) : r.type === "image" ? (u(), g("img", {
1767
1773
  key: 2,
1768
1774
  src: o(r.value),
@@ -1771,16 +1777,16 @@ const Ni = {
1771
1777
  width: r.width ? r.width + "px" : "auto",
1772
1778
  height: r.height ? r.height + "px" : "auto"
1773
1779
  })
1774
- }, null, 12, ji)) : r.type === "control" ? (u(), g(W, { key: 3 }, [
1775
- ((_ = r.control) == null ? void 0 : _.type) === "text" ? (u(), g("span", {
1780
+ }, null, 12, ji)) : r.type === "control" ? (u(), g(G, { key: 3 }, [
1781
+ ((x = r.control) == null ? void 0 : x.type) === "text" ? (u(), g("span", {
1776
1782
  key: 0,
1777
1783
  style: V({ fontSize: (r.control.size || 12) + "px" })
1778
1784
  }, [
1779
- (u(!0), g(W, null, Y(r.control.value || [], ($, le) => (u(), g("span", {
1780
- key: le,
1781
- style: V(K(ve)($))
1782
- }, J($.value), 5))), 128))
1783
- ], 4)) : ((H = r.control) == null ? void 0 : H.type) === "input" ? (u(), g("span", {
1785
+ (u(!0), g(G, null, Q(r.control.value || [], (z, ie) => (u(), g("span", {
1786
+ key: ie,
1787
+ style: V(K(_e)(z))
1788
+ }, Y(z.value), 5))), 128))
1789
+ ], 4)) : (($ = r.control) == null ? void 0 : $.type) === "input" ? (u(), g("span", {
1784
1790
  key: 1,
1785
1791
  class: "ctrl-input",
1786
1792
  style: V({
@@ -1788,237 +1794,240 @@ const Ni = {
1788
1794
  fontSize: (r.control.size || 12) + "px"
1789
1795
  })
1790
1796
  }, [
1791
- (u(!0), g(W, null, Y(r.control.value || [], ($, le) => (u(), g("span", { key: le }, J($.value), 1))), 128))
1797
+ (u(!0), g(G, null, Q(r.control.value || [], (z, ie) => (u(), g("span", { key: ie }, Y(z.value), 1))), 128))
1792
1798
  ], 4)) : ((B = r.control) == null ? void 0 : B.type) === "radio" ? (u(), g("span", {
1793
1799
  key: 2,
1794
- class: Ae(["ctrl-options", { "ctrl-options--vertical": ((S = (q = r.control.extension) == null ? void 0 : q.elementAttributes) == null ? void 0 : S.layout) === "vertical" }]),
1800
+ class: Pe(["ctrl-options", { "ctrl-options--vertical": ((I = (W = r.control.extension) == null ? void 0 : W.elementAttributes) == null ? void 0 : I.layout) === "vertical" }]),
1795
1801
  style: V({ fontSize: (r.control.size || K(We)) + "px" })
1796
1802
  }, [
1797
- (u(!0), g(W, null, Y(r.control.valueSets || [], ($, le) => (u(), g("label", {
1798
- key: le,
1803
+ (u(!0), g(G, null, Q(r.control.valueSets || [], (z, ie) => (u(), g("label", {
1804
+ key: ie,
1799
1805
  class: "ctrl-option"
1800
1806
  }, [
1801
- Z("input", {
1807
+ ne("input", {
1802
1808
  type: "radio",
1803
1809
  disabled: "",
1804
- checked: r.control.code === $.code
1810
+ checked: r.control.code === z.code
1805
1811
  }, null, 8, Ki),
1806
- Be(" " + J($.value), 1)
1812
+ Le(" " + Y(z.value), 1)
1807
1813
  ]))), 128))
1808
1814
  ], 6)) : ((D = r.control) == null ? void 0 : D.type) === "checkbox" ? (u(), g("span", {
1809
1815
  key: 3,
1810
- class: Ae(["ctrl-options", { "ctrl-options--vertical": ((h = (A = r.control.extension) == null ? void 0 : A.elementAttributes) == null ? void 0 : h.layout) === "vertical" }]),
1816
+ class: Pe(["ctrl-options", { "ctrl-options--vertical": ((h = (T = r.control.extension) == null ? void 0 : T.elementAttributes) == null ? void 0 : h.layout) === "vertical" }]),
1811
1817
  style: V({ fontSize: (r.control.size || K(We)) + "px" })
1812
1818
  }, [
1813
- (u(!0), g(W, null, Y(r.control.valueSets || [], ($, le) => (u(), g("label", {
1814
- key: le,
1819
+ (u(!0), g(G, null, Q(r.control.valueSets || [], (z, ie) => (u(), g("label", {
1820
+ key: ie,
1815
1821
  class: "ctrl-option"
1816
1822
  }, [
1817
- Z("input", {
1823
+ ne("input", {
1818
1824
  type: "checkbox",
1819
1825
  disabled: "",
1820
- checked: (r.control.code || "").split(",").includes($.code)
1826
+ checked: (r.control.code || "").split(",").includes(z.code)
1821
1827
  }, null, 8, Ui),
1822
- Be(" " + J($.value), 1)
1828
+ Le(" " + Y(z.value), 1)
1823
1829
  ]))), 128))
1824
- ], 6)) : ((I = r.control) == null ? void 0 : I.type) === "select" ? (u(), g("span", qi, J(((F = (L = r.control.value) == null ? void 0 : L[0]) == null ? void 0 : F.value) || r.control.placeholder || ""), 1)) : pe("", !0)
1830
+ ], 6)) : ((F = r.control) == null ? void 0 : F.type) === "select" ? (u(), g("span", qi, Y(((E = (P = r.control.value) == null ? void 0 : P[0]) == null ? void 0 : E.value) || r.control.placeholder || ""), 1)) : ve("", !0)
1825
1831
  ], 64)) : r.type === "checkbox" ? (u(), g("input", {
1826
1832
  key: 4,
1827
1833
  type: "checkbox",
1828
- checked: !!((Q = r.checkbox) != null && Q.value),
1834
+ checked: !!((X = r.checkbox) != null && X.value),
1829
1835
  disabled: "",
1830
1836
  class: "el-check"
1831
1837
  }, null, 8, Wi)) : r.type === "radio" ? (u(), g("input", {
1832
1838
  key: 5,
1833
1839
  type: "radio",
1834
- checked: !!((_e = r.radio) != null && _e.value),
1840
+ checked: !!((ue = r.radio) != null && ue.value),
1835
1841
  disabled: "",
1836
1842
  class: "el-check"
1837
1843
  }, null, 8, Gi)) : r.type === "superscript" ? (u(), g("sup", {
1838
1844
  key: 6,
1839
- style: V(K(ve)(r))
1840
- }, J(r.value), 5)) : r.type === "subscript" ? (u(), g("sub", {
1845
+ style: V(K(_e)(r))
1846
+ }, Y(r.value), 5)) : r.type === "subscript" ? (u(), g("sub", {
1841
1847
  key: 7,
1842
- style: V(K(ve)(r))
1843
- }, J(r.value), 5)) : r.type === "tab" ? (u(), g("span", {
1848
+ style: V(K(_e)(r))
1849
+ }, Y(r.value), 5)) : r.type === "tab" ? (u(), g("span", {
1844
1850
  key: 8,
1845
1851
  class: "doc-tab",
1846
1852
  style: V({ width: (r.size || K(We)) + "px" })
1847
- }, null, 4)) : pe("", !0)
1853
+ }, null, 4)) : ve("", !0)
1848
1854
  ], 64);
1849
1855
  }), 128))
1850
- ], 4)) : t.block.blockType === "list" ? (u(), Ie(ot(t.block.listType === "ol" ? "ol" : "ul"), {
1856
+ ], 4)) : t.block.blockType === "list" ? (u(), Fe(at(t.block.listType === "ol" ? "ol" : "ul"), {
1851
1857
  key: 2,
1852
1858
  class: "doc-list",
1853
1859
  style: V({ listStyleType: t.block.listStyle === "decimal" ? "decimal" : t.block.listStyle === "lower-alpha" ? "lower-alpha" : "disc", paddingLeft: s.value ? s.value + 24 + "px" : void 0 })
1854
1860
  }, {
1855
1861
  default: qe(() => [
1856
- (u(!0), g(W, null, Y(t.block.items, (r, M) => (u(), g("li", {
1862
+ (u(!0), g(G, null, Q(t.block.items, (r, M) => (u(), g("li", {
1857
1863
  key: M,
1858
1864
  class: "doc-list-item"
1859
1865
  }, [
1860
- (u(!0), g(W, null, Y(r, (_, H) => (u(), g(W, { key: H }, [
1861
- !_.type || _.type === "text" ? (u(), g("span", {
1866
+ (u(!0), g(G, null, Q(r, (x, $) => (u(), g(G, { key: $ }, [
1867
+ !x.type || x.type === "text" ? (u(), g("span", {
1862
1868
  key: 0,
1863
- style: V(K(ve)(_))
1864
- }, J(_.value), 5)) : _.type === "superscript" ? (u(), g("sup", {
1869
+ style: V(K(_e)(x))
1870
+ }, Y(x.value), 5)) : x.type === "superscript" ? (u(), g("sup", {
1865
1871
  key: 1,
1866
- style: V(K(ve)(_))
1867
- }, J(_.value), 5)) : _.type === "subscript" ? (u(), g("sub", {
1872
+ style: V(K(_e)(x))
1873
+ }, Y(x.value), 5)) : x.type === "subscript" ? (u(), g("sub", {
1868
1874
  key: 2,
1869
- style: V(K(ve)(_))
1870
- }, J(_.value), 5)) : pe("", !0)
1875
+ style: V(K(_e)(x))
1876
+ }, Y(x.value), 5)) : ve("", !0)
1871
1877
  ], 64))), 128))
1872
1878
  ]))), 128))
1873
1879
  ]),
1874
1880
  _: 1
1875
1881
  }, 8, ["style"])) : t.block.blockType === "table-row-group" ? (u(), g("div", {
1876
1882
  key: 3,
1877
- class: Ae(["doc-table-row-wrap", { "is-first": t.block.isFirst, "is-last": t.block.isLast, "is-page-break": t.block.isPageBreak }]),
1883
+ class: Pe(["doc-table-row-wrap", { "is-first": t.block.isFirst, "is-last": t.block.isLast, "is-page-break": t.block.isPageBreak }]),
1878
1884
  style: V({
1879
1885
  display: t.block.tableRowFlex ? "flex" : void 0,
1880
1886
  justifyContent: t.block.tableRowFlex === "right" ? "flex-end" : t.block.tableRowFlex === "center" ? "center" : t.block.tableRowFlex === "left" ? "flex-start" : void 0,
1881
1887
  paddingLeft: s.value ? s.value + "px" : void 0
1882
1888
  })
1883
1889
  }, [
1884
- Z("div", {
1890
+ ne("div", {
1885
1891
  style: V({
1886
1892
  overflow: t.block.sliceHeight != null ? "hidden" : void 0,
1887
1893
  height: t.block.sliceHeight != null ? (t.block.isLast ? t.block.sliceHeight + 1 : t.block.sliceHeight) + "px" : void 0,
1888
1894
  width: t.block.tableEl.width ? "max-content" : "100%"
1889
1895
  })
1890
1896
  }, [
1891
- Z("table", {
1897
+ ne("table", {
1892
1898
  ref: t.block._baseKey && K(n) ? (r) => K(n)(r, t.block._baseKey) : void 0,
1893
- class: Ae(["doc-table", { "doc-table--no-border": t.block.tableEl.borderType === "empty", "doc-table--header-footer": t.isHeaderFooter }]),
1899
+ class: Pe(["doc-table", { "doc-table--no-border": t.block.tableEl.borderType === "empty", "doc-table--header-footer": t.isHeaderFooter }]),
1894
1900
  style: V({
1895
- width: t.block.tableEl.width ? (t.isHeaderFooter ? t.block.tableEl.width : t.block.tableEl.width * K(ht)(t.block.tableEl)) + "px" : "100%",
1901
+ width: t.block.tableEl.width ? (t.isHeaderFooter ? t.block.tableEl.width : t.block.tableEl.width * K(gt)(t.block.tableEl)) + "px" : "100%",
1896
1902
  transform: t.block.sliceOffset ? `translateY(-${t.block.sliceOffset}px)` : void 0
1897
1903
  })
1898
1904
  }, [
1899
1905
  (y = t.block.tableEl.colgroup) != null && y.length ? (u(), g("colgroup", Ji, [
1900
- (u(!0), g(W, null, Y(t.block.tableEl.colgroup, (r, M) => (u(), g("col", {
1906
+ (u(!0), g(G, null, Q(t.block.tableEl.colgroup, (r, M) => (u(), g("col", {
1901
1907
  key: M,
1902
- style: V({ width: (t.isHeaderFooter ? r.width : r.width * K(ht)(t.block.tableEl)) + "px" })
1908
+ style: V({ width: (t.isHeaderFooter ? r.width : r.width * K(gt)(t.block.tableEl)) + "px" })
1903
1909
  }, null, 4))), 128))
1904
- ])) : pe("", !0),
1905
- Z("tbody", null, [
1906
- (u(!0), g(W, null, Y(t.block.trGroup, (r, M) => (u(), g("tr", {
1910
+ ])) : ve("", !0),
1911
+ ne("tbody", null, [
1912
+ (u(!0), g(G, null, Q(t.block.trGroup, (r, M) => (u(), g("tr", {
1907
1913
  key: M,
1908
1914
  style: V({ height: (r.height || r.minHeight || 30) + "px" })
1909
1915
  }, [
1910
- (u(!0), g(W, null, Y(r.tdList || [], (_, H) => (u(), g("td", {
1911
- key: H,
1912
- colspan: _.colspan || 1,
1913
- rowspan: _.rowspan || 1,
1916
+ (u(!0), g(G, null, Q(r.tdList || [], (x, $) => (u(), g("td", {
1917
+ key: $,
1918
+ colspan: x.colspan || 1,
1919
+ rowspan: x.rowspan || 1,
1914
1920
  style: V({
1915
- backgroundColor: _.backgroundColor || void 0,
1916
- verticalAlign: K(Di)(_),
1917
- width: _.width ? _.width * K(ht)(t.block.tableEl) + "px" : void 0,
1918
- height: _.height ? _.height + "px" : void 0
1921
+ backgroundColor: x.backgroundColor || void 0,
1922
+ verticalAlign: K(Di)(x),
1923
+ width: x.width ? x.width * K(gt)(t.block.tableEl) + "px" : void 0,
1924
+ height: x.height ? x.height + "px" : void 0
1919
1925
  })
1920
1926
  }, [
1921
- (u(!0), g(W, null, Y(K(Ge)(_.value), (B, q) => (u(), g(W, { key: q }, [
1927
+ (u(!0), g(G, null, Q(K(Ge)(x.value), (B, W) => (u(), g(G, { key: W }, [
1922
1928
  B.type === "paragraph" ? (u(), g("p", {
1923
1929
  key: 0,
1924
1930
  class: "cell-para",
1925
- style: V(K(Dt)(B))
1931
+ style: V(K(Nt)(B))
1926
1932
  }, [
1927
- B.elements.length ? pe("", !0) : (u(), g("span", Yi, " ")),
1928
- (u(!0), g(W, null, Y(B.elements, (S, D) => {
1929
- var A, h, I, L, F, Q, _e;
1930
- return u(), g(W, { key: D }, [
1931
- !S.type || S.type === "text" ? (u(), g("span", {
1933
+ B.elements.length ? ve("", !0) : (u(), g("span", Yi, " ")),
1934
+ (u(!0), g(G, null, Q(B.elements, (I, D) => {
1935
+ var T, h, F, P, E, X, ue;
1936
+ return u(), g(G, { key: D }, [
1937
+ !I.type || I.type === "text" ? (u(), g("span", {
1932
1938
  key: 0,
1933
- style: V(K(ve)(S))
1934
- }, J(S.value), 5)) : S.type === "image" ? (u(), g("img", {
1939
+ style: V(K(_e)(I))
1940
+ }, Y(I.value), 5)) : I.type === "image" ? (u(), g("img", {
1935
1941
  key: 1,
1936
- src: o(S.value),
1942
+ src: o(I.value),
1937
1943
  class: "doc-image",
1938
1944
  style: V({
1939
- width: S.width ? S.width + "px" : "auto",
1940
- height: S.height ? S.height + "px" : "auto"
1945
+ width: I.width ? I.width + "px" : "auto",
1946
+ height: I.height ? I.height + "px" : "auto"
1941
1947
  })
1942
- }, null, 12, Zi)) : S.type === "hyperlink" ? (u(), g("a", {
1948
+ }, null, 12, Zi)) : I.type === "hyperlink" ? (u(), g("a", {
1943
1949
  key: 2,
1944
- href: S.url,
1950
+ href: I.url,
1945
1951
  class: "doc-link",
1946
1952
  target: "_blank"
1947
1953
  }, [
1948
- (u(!0), g(W, null, Y(S.valueList || [], ($, le) => (u(), g("span", {
1949
- key: le,
1950
- style: V(K(ve)($))
1951
- }, J($.value), 5))), 128))
1952
- ], 8, Qi)) : S.type === "control" ? (u(), g(W, { key: 3 }, [
1953
- ((A = S.control) == null ? void 0 : A.type) === "text" ? (u(), g("span", {
1954
+ (u(!0), g(G, null, Q(I.valueList || [], (z, ie) => (u(), g("span", {
1955
+ key: ie,
1956
+ style: V(K(_e)(z))
1957
+ }, Y(z.value), 5))), 128))
1958
+ ], 8, Qi)) : I.type === "control" ? (u(), g(G, { key: 3 }, [
1959
+ ((T = I.control) == null ? void 0 : T.type) === "text" ? (u(), g("span", {
1954
1960
  key: 0,
1955
- style: V({ fontSize: (S.control.size || 12) + "px" })
1961
+ style: V({ fontSize: (I.control.size || 12) + "px" })
1956
1962
  }, [
1957
- (u(!0), g(W, null, Y(S.control.value || [], ($, le) => (u(), g("span", {
1958
- key: le,
1959
- style: V(K(ve)($))
1960
- }, J($.value), 5))), 128))
1961
- ], 4)) : ((h = S.control) == null ? void 0 : h.type) === "input" ? (u(), g("span", {
1963
+ (u(!0), g(G, null, Q(I.control.value || [], (z, ie) => (u(), g("span", {
1964
+ key: ie,
1965
+ style: V(K(_e)(z))
1966
+ }, Y(z.value), 5))), 128))
1967
+ ], 4)) : ((h = I.control) == null ? void 0 : h.type) === "input" ? (u(), g("span", {
1962
1968
  key: 1,
1963
1969
  class: "ctrl-input",
1964
- style: V({ fontSize: (S.control.size || 12) + "px" })
1970
+ style: V({ fontSize: (I.control.size || 12) + "px" })
1965
1971
  }, [
1966
- (u(!0), g(W, null, Y(S.control.value || [], ($, le) => (u(), g("span", { key: le }, J($.value), 1))), 128))
1967
- ], 4)) : ((I = S.control) == null ? void 0 : I.type) === "radio" ? (u(), g("span", {
1972
+ (u(!0), g(G, null, Q(I.control.value || [], (z, ie) => (u(), g("span", { key: ie }, Y(z.value), 1))), 128))
1973
+ ], 4)) : ((F = I.control) == null ? void 0 : F.type) === "radio" ? (u(), g("span", {
1968
1974
  key: 2,
1969
- class: Ae(["ctrl-options", { "ctrl-options--vertical": ((F = (L = S.control.extension) == null ? void 0 : L.elementAttributes) == null ? void 0 : F.layout) === "vertical" }])
1975
+ class: Pe(["ctrl-options", { "ctrl-options--vertical": ((E = (P = I.control.extension) == null ? void 0 : P.elementAttributes) == null ? void 0 : E.layout) === "vertical" }])
1970
1976
  }, [
1971
- (u(!0), g(W, null, Y(S.control.valueSets || [], ($, le) => (u(), g("label", {
1972
- key: le,
1977
+ (u(!0), g(G, null, Q(I.control.valueSets || [], (z, ie) => (u(), g("label", {
1978
+ key: ie,
1973
1979
  class: "ctrl-option"
1974
1980
  }, [
1975
- Z("input", {
1981
+ ne("input", {
1976
1982
  type: "radio",
1977
1983
  disabled: "",
1978
- checked: S.control.code === $.code
1984
+ checked: I.control.code === z.code
1979
1985
  }, null, 8, el),
1980
- Be(J($.value), 1)
1986
+ Le(Y(z.value), 1)
1981
1987
  ]))), 128))
1982
- ], 2)) : pe("", !0)
1983
- ], 64)) : S.type === "checkbox" ? (u(), g("input", {
1988
+ ], 2)) : ve("", !0)
1989
+ ], 64)) : I.type === "checkbox" ? (u(), g("input", {
1984
1990
  key: 4,
1985
1991
  type: "checkbox",
1986
- checked: !!((Q = S.checkbox) != null && Q.value),
1992
+ checked: !!((X = I.checkbox) != null && X.value),
1987
1993
  disabled: "",
1988
1994
  class: "el-check"
1989
- }, null, 8, tl)) : S.type === "radio" ? (u(), g("input", {
1995
+ }, null, 8, tl)) : I.type === "radio" ? (u(), g("input", {
1990
1996
  key: 5,
1991
1997
  type: "radio",
1992
- checked: !!((_e = S.radio) != null && _e.value),
1998
+ checked: !!((ue = I.radio) != null && ue.value),
1993
1999
  disabled: "",
1994
2000
  class: "el-check"
1995
- }, null, 8, nl)) : S.type === "superscript" ? (u(), g("sup", {
2001
+ }, null, 8, nl)) : I.type === "superscript" ? (u(), g("sup", {
1996
2002
  key: 6,
1997
- style: V(K(ve)(S))
1998
- }, J(S.value), 5)) : S.type === "subscript" ? (u(), g("sub", {
2003
+ style: V(K(_e)(I))
2004
+ }, Y(I.value), 5)) : I.type === "subscript" ? (u(), g("sub", {
1999
2005
  key: 7,
2000
- style: V(K(ve)(S))
2001
- }, J(S.value), 5)) : S.type === "tab" ? (u(), g("span", {
2006
+ style: V(K(_e)(I))
2007
+ }, Y(I.value), 5)) : I.type === "tab" ? (u(), g("span", {
2002
2008
  key: 8,
2003
2009
  class: "doc-tab",
2004
- style: V({ width: (S.size || K(We)) + "px" })
2005
- }, null, 4)) : pe("", !0)
2010
+ style: V({ width: (I.size || K(We)) + "px" })
2011
+ }, null, 4)) : ve("", !0)
2006
2012
  ], 64);
2007
2013
  }), 128))
2008
- ], 4)) : pe("", !0)
2014
+ ], 4)) : ve("", !0)
2009
2015
  ], 64))), 128))
2010
2016
  ], 12, Xi))), 128))
2011
2017
  ], 4))), 128))
2012
2018
  ])
2013
2019
  ], 6)
2014
2020
  ], 4)
2015
- ], 6)) : pe("", !0);
2021
+ ], 6)) : ve("", !0);
2016
2022
  };
2017
2023
  }
2018
- }, ft = /* @__PURE__ */ ze(il, [["__scopeId", "data-v-88bdb013"]]), ll = { class: "editor-layout word-editor-scope" }, ol = { class: "editor-container" }, al = {
2024
+ }, pt = /* @__PURE__ */ Ne(il, [["__scopeId", "data-v-88bdb013"]]), ll = { class: "editor-layout word-editor-scope" }, ol = { class: "editor-container" }, al = {
2019
2025
  key: 0,
2020
2026
  class: "editor-loading"
2021
- }, sl = { class: "doc-header" }, rl = { class: "doc-footer" }, cl = { class: "doc-page-number" }, dl = 1123, ul = 50, hl = 20, fl = {
2027
+ }, sl = {
2028
+ key: 0,
2029
+ class: "doc-header"
2030
+ }, rl = { class: "doc-footer" }, cl = { class: "doc-page-number" }, dl = 1123, ul = 50, hl = 20, fl = {
2022
2031
  __name: "index",
2023
2032
  props: {
2024
2033
  // 文档结构数据(IElement[]),来源由使用方决定
@@ -2038,245 +2047,247 @@ const Ni = {
2038
2047
  }
2039
2048
  },
2040
2049
  setup(t) {
2041
- const e = t, n = re(() => {
2050
+ const e = t, n = de(() => {
2042
2051
  const h = e.data;
2043
2052
  return h ? !Array.isArray(h) && h.main ? h.main : Array.isArray(h) ? h : [] : [];
2044
- }), l = ie(null), o = ie({});
2053
+ }), l = te(null), o = te({});
2045
2054
  let s = null;
2046
- yt(() => {
2055
+ _t(() => {
2047
2056
  s = new ResizeObserver((h) => {
2048
- const I = {};
2049
- for (const L of h) {
2050
- const F = L.target._rowKey;
2051
- if (!F) continue;
2052
- const Q = Math.round(L.contentRect.height);
2053
- Q > (o.value[F] || 0) && (I[F] = Q);
2057
+ const F = {};
2058
+ for (const P of h) {
2059
+ const E = P.target._rowKey;
2060
+ if (!E) continue;
2061
+ const X = Math.round(P.contentRect.height);
2062
+ X > (o.value[E] || 0) && (F[E] = X);
2054
2063
  }
2055
- Object.keys(I).length && (o.value = { ...o.value, ...I });
2064
+ Object.keys(F).length && (o.value = { ...o.value, ...F });
2056
2065
  });
2057
- }), st(() => {
2066
+ }), rt(() => {
2058
2067
  s == null || s.disconnect(), s = null;
2059
2068
  });
2060
- function v(h, I) {
2061
- !h || !s || (h._rowKey = I, s.observe(h));
2069
+ function v(h, F) {
2070
+ !h || !s || (h._rowKey = F, s.observe(h));
2062
2071
  }
2063
- vt("bindTableObserver", v), vt("resolveImageUrl", In(e, "resolveImageUrl"));
2064
- const m = re(
2065
- () => Math.max(100, dl - ul * 2 - _.value - hl)
2066
- ), y = re(() => {
2067
- const h = Ge(n.value), I = [], L = m.value;
2068
- let F = 0;
2069
- const Q = Hi(), _e = { first: 0, second: 1, third: 2, fourth: 3, fifth: 4, sixth: 5, seventh: 6, eighth: 7 };
2070
- let $ = -1;
2071
- const le = (j) => {
2072
- var he, me, Ce;
2073
- return !!((he = j.el) != null && he._coverBreakBefore || (Ce = (me = j.elements) == null ? void 0 : me[0]) != null && Ce._coverBreakBefore);
2072
+ yt("bindTableObserver", v), yt("resolveImageUrl", e.resolveImageUrl);
2073
+ const m = de(
2074
+ () => Math.max(100, dl - ul * 2 - x.value - hl)
2075
+ ), y = de(() => {
2076
+ const h = Ge(n.value), F = [], P = m.value;
2077
+ let E = 0, X = !1;
2078
+ const ue = (H) => {
2079
+ F.push({ ...H, _isCover: X });
2080
+ }, z = Ri(), ie = { first: 0, second: 1, third: 2, fourth: 3, fifth: 4, sixth: 5, seventh: 6, eighth: 7 };
2081
+ let Ce = -1;
2082
+ const Je = (H) => {
2083
+ var he, me, Me;
2084
+ return !!((he = H.el) != null && he._coverBreakBefore || (Me = (me = H.elements) == null ? void 0 : me[0]) != null && Me._coverBreakBefore);
2074
2085
  };
2075
- return h.forEach((j, he) => {
2076
- var Ce, Ne, Pe, rt;
2077
- const me = le(j);
2078
- if (me && (F = 0), j.type === "title") {
2079
- const ye = j.el.valueList || [], ce = Q.next(j.el.level, (Ce = j.el.extension) == null ? void 0 : Ce.startIndex), de = ye.some((oe) => {
2080
- var ue;
2081
- return (ue = oe.extension) == null ? void 0 : ue.isIndex;
2086
+ return h.forEach((H, he) => {
2087
+ var Me, ct, Xe, Ye;
2088
+ const me = Je(H);
2089
+ if (me && (E = 0), X = !!H._isCover, H.type === "title") {
2090
+ const fe = H.el.valueList || [], se = z.next(H.el.level, (Me = H.el.extension) == null ? void 0 : Me.startIndex), ke = fe.some((ge) => {
2091
+ var ye;
2092
+ return (ye = ge.extension) == null ? void 0 : ye.isIndex;
2082
2093
  });
2083
- let xe = ye;
2084
- if (!de && ce) {
2085
- const oe = ye[0] || {};
2086
- xe = [
2094
+ let Ie = fe;
2095
+ if (!ke && se) {
2096
+ const ge = fe[0] || {};
2097
+ Ie = [
2087
2098
  {
2088
- value: ce,
2089
- size: oe.size,
2090
- bold: oe.bold,
2091
- italic: oe.italic,
2092
- color: oe.color,
2093
- font: oe.font,
2099
+ value: se,
2100
+ size: ge.size,
2101
+ bold: ge.bold,
2102
+ italic: ge.italic,
2103
+ color: ge.color,
2104
+ font: ge.font,
2094
2105
  extension: { isIndex: !0 }
2095
2106
  },
2096
- ...ye
2107
+ ...fe
2097
2108
  ];
2098
2109
  }
2099
- const Me = xe.map((oe) => oe.value || "").join(""), fe = De(xe);
2100
- F = F + fe > L && F > 0 ? fe : F + fe, $ = _e[j.el.level] ?? 0, I.push({
2110
+ const we = Ie.map((ge) => ge.value || "").join(""), le = ze(Ie);
2111
+ E = E + le > P && E > 0 ? le : E + le, Ce = ie[H.el.level] ?? 0, ue({
2101
2112
  node_id: `blk_${he}_0`,
2102
2113
  layer: me ? 1 : 100,
2103
2114
  blockType: "title",
2104
- level: j.el.level,
2105
- titleEl: j.el,
2106
- titleValueList: xe,
2115
+ level: H.el.level,
2116
+ titleEl: H.el,
2117
+ titleValueList: Ie,
2107
2118
  content_type: "text",
2108
- content: Me,
2109
- height: fe,
2110
- indentPx: $ * 20
2119
+ content: we,
2120
+ height: le,
2121
+ indentPx: Ce * 20
2111
2122
  });
2112
- } else if (j.type === "paragraph") {
2113
- const ye = Bi(j.elements), ce = $ >= 0 ? ($ + 1) * 20 : 0;
2114
- ye.forEach((de, xe) => {
2115
- const Me = de.map((oe) => oe.value || "").join(""), fe = De(de);
2116
- F = F + fe > L && F > 0 ? fe : F + fe, I.push({
2117
- node_id: `blk_${he}_${xe}`,
2118
- layer: me && xe === 0 ? 1 : 100,
2123
+ } else if (H.type === "paragraph") {
2124
+ const fe = Bi(H.elements), se = Ce >= 0 ? (Ce + 1) * 20 : 0;
2125
+ fe.forEach((ke, Ie) => {
2126
+ const we = ke.map((ge) => ge.value || "").join(""), le = ze(ke);
2127
+ E = E + le > P && E > 0 ? le : E + le, ue({
2128
+ node_id: `blk_${he}_${Ie}`,
2129
+ layer: me && Ie === 0 ? 1 : 100,
2119
2130
  blockType: "paragraph",
2120
- elements: de,
2121
- rowFlex: j.rowFlex,
2131
+ elements: ke,
2132
+ rowFlex: H.rowFlex,
2122
2133
  content_type: "text",
2123
- content: Me,
2124
- height: fe,
2125
- indentPx: ce
2134
+ content: we,
2135
+ height: le,
2136
+ indentPx: se
2126
2137
  });
2127
2138
  });
2128
- } else if (j.type === "table") {
2129
- const ye = !!((Ne = j.el.extension) != null && Ne.isTitleTable), ce = ((Pe = j.el.extension) == null ? void 0 : Pe.elementType) === "signOff", de = ((rt = j.el.extension) == null ? void 0 : rt.elementType) === "stepTable", xe = ce || de, Me = ye || ce ? 0 : $ >= 0 ? ($ + 1) * 20 : 0, fe = Bt(j.el.trList || []), oe = fe.length;
2130
- if (xe) {
2131
- const ue = fe.flat(), ge = ue.reduce(
2132
- (ee, te) => ee + (te.height || te.minHeight || 35),
2139
+ } else if (H.type === "table") {
2140
+ const fe = !!((ct = H.el.extension) != null && ct.isTitleTable), se = ((Xe = H.el.extension) == null ? void 0 : Xe.elementType) === "signOff", ke = ((Ye = H.el.extension) == null ? void 0 : Ye.elementType) === "stepTable", Ie = se || ke, we = fe || se ? 0 : Ce >= 0 ? (Ce + 1) * 20 : 0, le = zt(H.el.trList || []), ge = le.length;
2141
+ if (Ie) {
2142
+ const ye = le.flat(), O = ye.reduce(
2143
+ (oe, ee) => oe + (ee.height || ee.minHeight || 35),
2133
2144
  0
2134
- ), Ee = `blk_${he}_0`, z = Math.max(ge, o.value[Ee] || 0);
2135
- if (F > 0 && F + z > L && (F = 0), z > L) {
2136
- const ee = Math.ceil(z / L);
2137
- for (let te = 0; te < ee; te++) {
2138
- const ae = te * L, Se = Math.min(L, z - ae), $e = te > 0 || F > 0;
2139
- F = Se, I.push({
2140
- node_id: `blk_${he}_0_s${te}`,
2141
- layer: me && te === 0 ? 1 : 100,
2145
+ ), Ee = `blk_${he}_0`, be = Math.max(O, o.value[Ee] || 0);
2146
+ if (E > 0 && E + be > P && (E = 0), be > P) {
2147
+ const oe = Math.ceil(be / P);
2148
+ for (let ee = 0; ee < oe; ee++) {
2149
+ const re = ee * P, Te = Math.min(P, be - re), Re = ee > 0 || E > 0;
2150
+ E = Te, ue({
2151
+ node_id: `blk_${he}_0_s${ee}`,
2152
+ layer: me && ee === 0 ? 1 : 100,
2142
2153
  blockType: "table-row-group",
2143
2154
  content_type: "table-row",
2144
- rowHeight: z,
2145
- trGroup: ue,
2146
- tableEl: j.el,
2147
- tableRowFlex: j.el.rowFlex || null,
2148
- isFirst: te === 0,
2149
- isLast: te === ee - 1,
2150
- isPageBreak: $e,
2151
- sliceOffset: ae,
2152
- sliceHeight: Se,
2153
- _baseKey: te === 0 ? Ee : void 0,
2154
- height: Se,
2155
- indentPx: Me
2155
+ rowHeight: be,
2156
+ trGroup: ye,
2157
+ tableEl: H.el,
2158
+ tableRowFlex: H.el.rowFlex || null,
2159
+ isFirst: ee === 0,
2160
+ isLast: ee === oe - 1,
2161
+ isPageBreak: Re,
2162
+ sliceOffset: re,
2163
+ sliceHeight: Te,
2164
+ _baseKey: ee === 0 ? Ee : void 0,
2165
+ height: Te,
2166
+ indentPx: we
2156
2167
  });
2157
2168
  }
2158
2169
  } else {
2159
- const ee = F > 0;
2160
- F = F + z > L ? z : F + z, I.push({
2170
+ const oe = E > 0;
2171
+ E = E + be > P ? be : E + be, ue({
2161
2172
  node_id: `blk_${he}_0`,
2162
2173
  layer: me ? 1 : 100,
2163
2174
  blockType: "table-row-group",
2164
2175
  content_type: "table-row",
2165
- rowHeight: z,
2166
- trGroup: ue,
2167
- tableEl: j.el,
2168
- tableRowFlex: j.el.rowFlex || null,
2176
+ rowHeight: be,
2177
+ trGroup: ye,
2178
+ tableEl: H.el,
2179
+ tableRowFlex: H.el.rowFlex || null,
2169
2180
  isFirst: !0,
2170
2181
  isLast: !0,
2171
- isPageBreak: ee,
2172
- indentPx: Me
2182
+ isPageBreak: oe,
2183
+ indentPx: we
2173
2184
  });
2174
2185
  }
2175
2186
  } else
2176
- fe.forEach((ue, ge) => {
2177
- const Ee = `blk_${he}_${ge}`, z = ue.reduce(
2178
- (te, ae) => te + (ae.height || ae.minHeight || 35),
2187
+ le.forEach((ye, O) => {
2188
+ const Ee = `blk_${he}_${O}`, be = ye.reduce(
2189
+ (ee, re) => ee + (re.height || re.minHeight || 35),
2179
2190
  0
2180
- ), ee = Math.max(z, o.value[Ee] || 0);
2181
- if (ee > L) {
2182
- const te = Math.ceil(ee / L);
2183
- for (let ae = 0; ae < te; ae++) {
2184
- const Se = ae * L, $e = Math.min(L, ee - Se), Je = ae > 0 || F > 0;
2185
- F = $e, I.push({
2186
- node_id: `blk_${he}_${ge}_s${ae}`,
2187
- layer: me && ge === 0 && ae === 0 ? 1 : 100,
2191
+ ), oe = Math.max(be, o.value[Ee] || 0);
2192
+ if (oe > P) {
2193
+ const ee = Math.ceil(oe / P);
2194
+ for (let re = 0; re < ee; re++) {
2195
+ const Te = re * P, Re = Math.min(P, oe - Te), dt = re > 0 || E > 0;
2196
+ E = Re, ue({
2197
+ node_id: `blk_${he}_${O}_s${re}`,
2198
+ layer: me && O === 0 && re === 0 ? 1 : 100,
2188
2199
  blockType: "table-row-group",
2189
2200
  content_type: "table-row",
2190
- rowHeight: ee,
2191
- trGroup: ue,
2192
- tableEl: j.el,
2193
- tableRowFlex: j.el.rowFlex || null,
2194
- isFirst: ge === 0 && ae === 0,
2195
- isLast: ge === oe - 1 && ae === te - 1,
2196
- isPageBreak: Je,
2197
- sliceOffset: Se,
2198
- sliceHeight: $e,
2199
- _baseKey: ae === 0 ? Ee : void 0,
2200
- height: $e,
2201
- indentPx: Me
2201
+ rowHeight: oe,
2202
+ trGroup: ye,
2203
+ tableEl: H.el,
2204
+ tableRowFlex: H.el.rowFlex || null,
2205
+ isFirst: O === 0 && re === 0,
2206
+ isLast: O === ge - 1 && re === ee - 1,
2207
+ isPageBreak: dt,
2208
+ sliceOffset: Te,
2209
+ sliceHeight: Re,
2210
+ _baseKey: re === 0 ? Ee : void 0,
2211
+ height: Re,
2212
+ indentPx: we
2202
2213
  });
2203
2214
  }
2204
2215
  } else {
2205
- const te = ge > 0 && F + ee > L;
2206
- F = F + ee > L ? ee : F + ee, I.push({
2207
- node_id: `blk_${he}_${ge}`,
2208
- layer: me && ge === 0 ? 1 : 100,
2216
+ const ee = O > 0 && E + oe > P;
2217
+ E = E + oe > P ? oe : E + oe, ue({
2218
+ node_id: `blk_${he}_${O}`,
2219
+ layer: me && O === 0 ? 1 : 100,
2209
2220
  blockType: "table-row-group",
2210
2221
  content_type: "table-row",
2211
- rowHeight: ee,
2212
- trGroup: ue,
2213
- tableEl: j.el,
2214
- tableRowFlex: j.el.rowFlex || null,
2215
- isFirst: ge === 0,
2216
- isLast: ge === oe - 1,
2217
- isPageBreak: te,
2218
- indentPx: Me
2222
+ rowHeight: oe,
2223
+ trGroup: ye,
2224
+ tableEl: H.el,
2225
+ tableRowFlex: H.el.rowFlex || null,
2226
+ isFirst: O === 0,
2227
+ isLast: O === ge - 1,
2228
+ isPageBreak: ee,
2229
+ indentPx: we
2219
2230
  });
2220
2231
  }
2221
2232
  });
2222
- } else if (j.type === "list") {
2223
- const ye = Math.round(18);
2224
- let ce = 0;
2225
- for (const de of j.items)
2226
- ce += de.length ? De(de) : ye;
2227
- ce = Math.max(ce, ye), F = F + ce > L && F > 0 ? ce : F + ce, I.push({
2233
+ } else if (H.type === "list") {
2234
+ const fe = Math.round(18);
2235
+ let se = 0;
2236
+ for (const ke of H.items)
2237
+ se += ke.length ? ze(ke) : fe;
2238
+ se = Math.max(se, fe), E = E + se > P && E > 0 ? se : E + se, ue({
2228
2239
  node_id: `blk_${he}_0`,
2229
2240
  layer: me ? 1 : 100,
2230
2241
  blockType: "list",
2231
- listType: j.listType,
2232
- listStyle: j.listStyle,
2233
- items: j.items,
2234
- height: ce,
2235
- indentPx: $ >= 0 ? ($ + 1) * 20 : 0
2242
+ listType: H.listType,
2243
+ listStyle: H.listStyle,
2244
+ items: H.items,
2245
+ height: se,
2246
+ indentPx: Ce >= 0 ? (Ce + 1) * 20 : 0
2236
2247
  });
2237
2248
  }
2238
- }), I;
2239
- }), r = re(() => {
2240
- var I;
2241
- const h = (I = e.data) == null ? void 0 : I.header;
2249
+ }), F;
2250
+ }), r = de(() => {
2251
+ var F;
2252
+ const h = (F = e.data) == null ? void 0 : F.header;
2242
2253
  return h != null && h.length ? Ge(h) : [];
2243
- }), M = re(() => {
2244
- var I;
2245
- const h = (I = e.data) == null ? void 0 : I.footer;
2254
+ }), M = de(() => {
2255
+ var F;
2256
+ const h = (F = e.data) == null ? void 0 : F.footer;
2246
2257
  return h != null && h.length ? Ge(h) : [];
2247
- }), _ = re(() => zt(r.value, !0)), H = re(() => zt(M.value, !0)), B = re(() => r.value.length > 0), q = re(() => M.value.length > 0);
2248
- function S(h) {
2249
- var L, F, Q;
2250
- const I = h.type === "table";
2258
+ }), x = de(() => Vt(r.value, !0)), $ = de(() => Vt(M.value, !0)), B = de(() => r.value.length > 0), W = de(() => M.value.length > 0);
2259
+ function I(h) {
2260
+ var P, E, X;
2261
+ const F = h.type === "table";
2251
2262
  return {
2252
- blockType: I ? "table-row-group" : h.type,
2263
+ blockType: F ? "table-row-group" : h.type,
2253
2264
  elements: h.elements,
2254
2265
  rowFlex: h.rowFlex,
2255
- level: (L = h.el) == null ? void 0 : L.level,
2256
- titleValueList: ((F = h.el) == null ? void 0 : F.valueList) || h.titleValueList,
2266
+ level: (P = h.el) == null ? void 0 : P.level,
2267
+ titleValueList: ((E = h.el) == null ? void 0 : E.valueList) || h.titleValueList,
2257
2268
  listType: h.listType,
2258
2269
  listStyle: h.listStyle,
2259
2270
  items: h.items,
2260
2271
  indentPx: 0,
2261
- trGroup: I ? Bt(h.el.trList).flat() : void 0,
2262
- tableEl: I ? h.el : void 0,
2272
+ trGroup: F ? zt(h.el.trList).flat() : void 0,
2273
+ tableEl: F ? h.el : void 0,
2263
2274
  isFirst: !0,
2264
2275
  isLast: !0,
2265
- tableRowFlex: ((Q = h.el) == null ? void 0 : Q.rowFlex) || null
2276
+ tableRowFlex: ((X = h.el) == null ? void 0 : X.rowFlex) || null
2266
2277
  };
2267
2278
  }
2268
- const D = re(() => Li(y.value));
2269
- function A(h) {
2270
- var I;
2271
- (I = l.value) == null || I.scrollToRow({ node_id: h.nodeId });
2279
+ const D = de(() => $i(y.value));
2280
+ function T(h) {
2281
+ var F;
2282
+ (F = l.value) == null || F.scrollToRow({ node_id: h.nodeId });
2272
2283
  }
2273
- return (h, I) => (u(), g("div", ll, [
2274
- U(Ai, {
2284
+ return (h, F) => (u(), g("div", ll, [
2285
+ q(Ti, {
2275
2286
  items: D.value,
2276
- onNavigate: A
2287
+ onNavigate: T
2277
2288
  }, null, 8, ["items"]),
2278
- Z("div", ol, [
2279
- t.loading ? (u(), g("div", al, " 加载中… ")) : (u(), Ie(K(gi), {
2289
+ ne("div", ol, [
2290
+ t.loading ? (u(), g("div", al, " 加载中… ")) : (u(), Fe(K(fi), {
2280
2291
  key: 1,
2281
2292
  ref_key: "virtualTableRef",
2282
2293
  ref: l,
@@ -2292,16 +2303,16 @@ const Ni = {
2292
2303
  showPageBorder: !0,
2293
2304
  pageBorderPadding: 5,
2294
2305
  pageBorderStyle: "1px solid #333",
2295
- headerHeight: _.value,
2296
- footerHeight: H.value,
2306
+ headerHeight: x.value,
2307
+ footerHeight: $.value,
2297
2308
  showPageNumber: !0
2298
2309
  },
2299
2310
  data: y.value
2300
- }, En({
2311
+ }, In({
2301
2312
  default: qe(() => [
2302
- U(K(mi), null, {
2303
- default: qe(({ row: L }) => [
2304
- U(ft, { block: L }, null, 8, ["block"])
2313
+ q(K(vi), null, {
2314
+ default: qe(({ row: P }) => [
2315
+ q(pt, { block: P }, null, 8, ["block"])
2305
2316
  ]),
2306
2317
  _: 1
2307
2318
  })
@@ -2310,27 +2321,27 @@ const Ni = {
2310
2321
  }, [
2311
2322
  B.value ? {
2312
2323
  name: "page-header",
2313
- fn: qe(() => [
2314
- Z("div", sl, [
2315
- (u(!0), g(W, null, Y(r.value, (L, F) => (u(), Ie(ft, {
2316
- key: F,
2317
- block: S(L),
2324
+ fn: qe(({ isCoverPage: P }) => [
2325
+ P ? ve("", !0) : (u(), g("div", sl, [
2326
+ (u(!0), g(G, null, Q(r.value, (E, X) => (u(), Fe(pt, {
2327
+ key: X,
2328
+ block: I(E),
2318
2329
  "is-header-footer": !0
2319
2330
  }, null, 8, ["block"]))), 128))
2320
- ])
2331
+ ]))
2321
2332
  ]),
2322
2333
  key: "0"
2323
2334
  } : void 0,
2324
- q.value ? {
2335
+ W.value ? {
2325
2336
  name: "page-footer",
2326
- fn: qe(({ pageNumber: L, totalPages: F }) => [
2327
- Z("div", rl, [
2328
- (u(!0), g(W, null, Y(M.value, (Q, _e) => (u(), Ie(ft, {
2329
- key: _e,
2330
- block: S(Q),
2337
+ fn: qe(({ pageNumber: P, totalPages: E }) => [
2338
+ ne("div", rl, [
2339
+ (u(!0), g(G, null, Q(M.value, (X, ue) => (u(), Fe(pt, {
2340
+ key: ue,
2341
+ block: I(X),
2331
2342
  "is-header-footer": !0
2332
2343
  }, null, 8, ["block"]))), 128)),
2333
- Z("div", cl, J(L) + " / " + J(F), 1)
2344
+ ne("div", cl, " 第" + Y(P) + " / " + Y(E) + "页 ", 1)
2334
2345
  ])
2335
2346
  ]),
2336
2347
  key: "1"
@@ -2339,16 +2350,16 @@ const Ni = {
2339
2350
  ])
2340
2351
  ]));
2341
2352
  }
2342
- }, gl = /* @__PURE__ */ ze(fl, [["__scopeId", "data-v-c0e32534"]]), Nt = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
2343
- function lt(t = 10) {
2353
+ }, gl = /* @__PURE__ */ Ne(fl, [["__scopeId", "data-v-9ff2db2b"]]), jt = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
2354
+ function ot(t = 10) {
2344
2355
  const e = crypto.getRandomValues(new Uint8Array(t));
2345
- return Array.from(e).map((n) => Nt[n % Nt.length]).join("");
2356
+ return Array.from(e).map((n) => jt[n % jt.length]).join("");
2346
2357
  }
2347
- class at {
2358
+ class st {
2348
2359
  constructor(e) {
2349
2360
  N(this, "data");
2350
- this.data = Ut({
2351
- id: lt(),
2361
+ this.data = Wt({
2362
+ id: ot(),
2352
2363
  version: 1,
2353
2364
  sections: [this.createEmptySection()],
2354
2365
  pageWidth: 595,
@@ -2363,13 +2374,13 @@ class at {
2363
2374
  // ─── 工厂方法 ─────────────────────────────────────────────────────────────
2364
2375
  createEmptySection() {
2365
2376
  return {
2366
- id: lt(),
2377
+ id: ot(),
2367
2378
  paragraphs: [this.createEmptyParagraph()]
2368
2379
  };
2369
2380
  }
2370
2381
  createEmptyParagraph(e) {
2371
2382
  return {
2372
- id: lt(),
2383
+ id: ot(),
2373
2384
  type: "paragraph",
2374
2385
  format: e ?? {},
2375
2386
  children: []
@@ -2377,7 +2388,7 @@ class at {
2377
2388
  }
2378
2389
  createTextElement(e, n) {
2379
2390
  return {
2380
- id: lt(),
2391
+ id: ot(),
2381
2392
  type: "text",
2382
2393
  value: e,
2383
2394
  format: n ?? {}
@@ -2460,11 +2471,11 @@ class at {
2460
2471
  for (const { paragraph: v, sectionIndex: m, paragraphIndex: y } of o) {
2461
2472
  const r = m === e.sectionIndex && y === e.paragraphIndex, M = m === n.sectionIndex && y === n.paragraphIndex;
2462
2473
  if (r && (s = !0), s)
2463
- for (let _ = 0; _ < v.children.length; _++) {
2464
- const H = v.children[_];
2465
- if (!(r && _ < e.elementIndex)) {
2466
- if (M && _ > n.elementIndex) break;
2467
- H.format = { ...H.format, ...l };
2474
+ for (let x = 0; x < v.children.length; x++) {
2475
+ const $ = v.children[x];
2476
+ if (!(r && x < e.elementIndex)) {
2477
+ if (M && x > n.elementIndex) break;
2478
+ $.format = { ...$.format, ...l };
2468
2479
  }
2469
2480
  }
2470
2481
  if (M) break;
@@ -2480,26 +2491,26 @@ class at {
2480
2491
  }
2481
2492
  /** 从 JSON 恢复 */
2482
2493
  static fromJSON(e) {
2483
- const n = JSON.parse(e), l = new at();
2494
+ const n = JSON.parse(e), l = new st();
2484
2495
  return Object.assign(l.data, n), l;
2485
2496
  }
2486
2497
  }
2487
- function Re(t = 0, e = 0, n = 0, l = 0) {
2498
+ function $e(t = 0, e = 0, n = 0, l = 0) {
2488
2499
  return { sectionIndex: t, paragraphIndex: e, elementIndex: n, offset: l };
2489
2500
  }
2490
- function Vt(t, e) {
2501
+ function Kt(t, e) {
2491
2502
  return t.sectionIndex === e.sectionIndex && t.paragraphIndex === e.paragraphIndex && t.elementIndex === e.elementIndex && t.offset === e.offset;
2492
2503
  }
2493
- class mt {
2504
+ class bt {
2494
2505
  constructor(e) {
2495
- N(this, "_selection", Ut({
2496
- anchor: Re(),
2497
- focus: Re(),
2506
+ N(this, "_selection", Wt({
2507
+ anchor: $e(),
2508
+ focus: $e(),
2498
2509
  isCollapsed: !0
2499
2510
  }));
2500
2511
  N(this, "_docModel");
2501
2512
  /** 是否有选区(非光标) */
2502
- N(this, "hasSelection", re(() => !this._selection.isCollapsed));
2513
+ N(this, "hasSelection", de(() => !this._selection.isCollapsed));
2503
2514
  this._docModel = e;
2504
2515
  }
2505
2516
  get selection() {
@@ -2510,14 +2521,14 @@ class mt {
2510
2521
  this._selection.anchor = { ...e }, this._selection.focus = { ...e }, this._selection.isCollapsed = !0;
2511
2522
  }
2512
2523
  setSelection(e, n) {
2513
- this._selection.anchor = { ...e }, this._selection.focus = { ...n }, this._selection.isCollapsed = Vt(e, n);
2524
+ this._selection.anchor = { ...e }, this._selection.focus = { ...n }, this._selection.isCollapsed = Kt(e, n);
2514
2525
  }
2515
2526
  collapse(e = !0) {
2516
2527
  e ? this._selection.anchor = { ...this._selection.focus } : this._selection.focus = { ...this._selection.anchor }, this._selection.isCollapsed = !0;
2517
2528
  }
2518
2529
  selectAll() {
2519
2530
  const e = this._docModel.data.sections, n = e[e.length - 1], l = n == null ? void 0 : n.paragraphs[n.paragraphs.length - 1], o = l == null ? void 0 : l.children[l.children.length - 1], s = (o == null ? void 0 : o.type) === "text" ? o.value.length : 0;
2520
- this._selection.anchor = Re(0, 0, 0, 0), this._selection.focus = Re(
2531
+ this._selection.anchor = $e(0, 0, 0, 0), this._selection.focus = $e(
2521
2532
  e.length - 1,
2522
2533
  ((n == null ? void 0 : n.paragraphs.length) ?? 1) - 1,
2523
2534
  ((l == null ? void 0 : l.children.length) ?? 0) === 0 ? 0 : ((l == null ? void 0 : l.children.length) ?? 1) - 1,
@@ -2560,24 +2571,24 @@ class mt {
2560
2571
  l && this._applyMove(l, e);
2561
2572
  }
2562
2573
  _applyMove(e, n) {
2563
- n ? (this._selection.focus = e, this._selection.isCollapsed = Vt(this._selection.anchor, e)) : (this._selection.anchor = { ...e }, this._selection.focus = { ...e }, this._selection.isCollapsed = !0);
2574
+ n ? (this._selection.focus = e, this._selection.isCollapsed = Kt(this._selection.anchor, e)) : (this._selection.anchor = { ...e }, this._selection.focus = { ...e }, this._selection.isCollapsed = !0);
2564
2575
  }
2565
2576
  _getNextParagraphPoint(e) {
2566
2577
  const n = this._docModel.data.sections[e.sectionIndex];
2567
- return n ? e.paragraphIndex < n.paragraphs.length - 1 ? Re(e.sectionIndex, e.paragraphIndex + 1, 0, 0) : e.sectionIndex < this._docModel.data.sections.length - 1 ? Re(e.sectionIndex + 1, 0, 0, 0) : null : null;
2578
+ return n ? e.paragraphIndex < n.paragraphs.length - 1 ? $e(e.sectionIndex, e.paragraphIndex + 1, 0, 0) : e.sectionIndex < this._docModel.data.sections.length - 1 ? $e(e.sectionIndex + 1, 0, 0, 0) : null : null;
2568
2579
  }
2569
2580
  _getPrevParagraphPoint(e) {
2570
2581
  if (e.paragraphIndex > 0) {
2571
2582
  const n = this._docModel.getParagraphAt(e.sectionIndex, e.paragraphIndex - 1);
2572
2583
  if (!n) return null;
2573
2584
  const l = n.children.length - 1, o = n.children[l], s = (o == null ? void 0 : o.type) === "text" ? o.value.length : 0;
2574
- return Re(e.sectionIndex, e.paragraphIndex - 1, Math.max(l, 0), s);
2585
+ return $e(e.sectionIndex, e.paragraphIndex - 1, Math.max(l, 0), s);
2575
2586
  }
2576
2587
  if (e.sectionIndex > 0) {
2577
2588
  const n = this._docModel.data.sections[e.sectionIndex - 1];
2578
2589
  if (!n) return null;
2579
2590
  const l = n.paragraphs.length - 1, o = n.paragraphs[l], s = ((o == null ? void 0 : o.children.length) ?? 0) - 1, v = o == null ? void 0 : o.children[s], m = (v == null ? void 0 : v.type) === "text" ? v.value.length : 0;
2580
- return Re(e.sectionIndex - 1, l, Math.max(s, 0), m);
2591
+ return $e(e.sectionIndex - 1, l, Math.max(s, 0), m);
2581
2592
  }
2582
2593
  return null;
2583
2594
  }
@@ -2695,7 +2706,7 @@ class yl {
2695
2706
  }));
2696
2707
  }
2697
2708
  }
2698
- class jt {
2709
+ class Ut {
2699
2710
  constructor(e, n, l) {
2700
2711
  N(this, "name");
2701
2712
  N(this, "_deletedText", "");
@@ -2771,7 +2782,7 @@ class Ue {
2771
2782
  return (o = l == null ? void 0 : l.format) == null ? void 0 : o[e];
2772
2783
  }
2773
2784
  }
2774
- class gt {
2785
+ class vt {
2775
2786
  constructor(e, n, l, o) {
2776
2787
  N(this, "name", "textAlign");
2777
2788
  this.docModel = e, this.selectionManager = n, this._formatKey = l, this._value = o;
@@ -2793,9 +2804,9 @@ class bl {
2793
2804
  this.register("insertText", (n) => {
2794
2805
  const { focus: l } = this.selectionManager.selection;
2795
2806
  return new ml(this.docModel, this.selectionManager, l, n);
2796
- }), this.register("insertParagraph", () => new yl(this.docModel, this.selectionManager)), this.register("deleteBackward", () => new jt(this.docModel, this.selectionManager, "backward")), this.register("deleteForward", () => new jt(this.docModel, this.selectionManager, "forward")), this.register("undo", () => null), this.register("redo", () => null), ["bold", "italic", "underline", "strikethrough", "superscript", "subscript"].forEach((n) => {
2807
+ }), this.register("insertParagraph", () => new yl(this.docModel, this.selectionManager)), this.register("deleteBackward", () => new Ut(this.docModel, this.selectionManager, "backward")), this.register("deleteForward", () => new Ut(this.docModel, this.selectionManager, "forward")), this.register("undo", () => null), this.register("redo", () => null), ["bold", "italic", "underline", "strikethrough", "superscript", "subscript"].forEach((n) => {
2797
2808
  this.register(n, () => new Ue(this.docModel, this.selectionManager, n));
2798
- }), this.register("fontSize", (n) => new Ue(this.docModel, this.selectionManager, "fontSize", n)), this.register("fontFamily", (n) => new Ue(this.docModel, this.selectionManager, "fontFamily", n)), this.register("color", (n) => new Ue(this.docModel, this.selectionManager, "color", n)), this.register("backgroundColor", (n) => new Ue(this.docModel, this.selectionManager, "backgroundColor", n)), this.register("textAlign", (n) => new gt(this.docModel, this.selectionManager, "textAlign", n)), this.register("lineHeight", (n) => new gt(this.docModel, this.selectionManager, "lineHeight", n)), this.register("heading", (n) => new gt(this.docModel, this.selectionManager, "heading", n)), this.register("selectAll", () => (this.selectionManager.selectAll(), null)), this.register("setSelection", (n) => {
2809
+ }), this.register("fontSize", (n) => new Ue(this.docModel, this.selectionManager, "fontSize", n)), this.register("fontFamily", (n) => new Ue(this.docModel, this.selectionManager, "fontFamily", n)), this.register("color", (n) => new Ue(this.docModel, this.selectionManager, "color", n)), this.register("backgroundColor", (n) => new Ue(this.docModel, this.selectionManager, "backgroundColor", n)), this.register("textAlign", (n) => new vt(this.docModel, this.selectionManager, "textAlign", n)), this.register("lineHeight", (n) => new vt(this.docModel, this.selectionManager, "lineHeight", n)), this.register("heading", (n) => new vt(this.docModel, this.selectionManager, "heading", n)), this.register("selectAll", () => (this.selectionManager.selectAll(), null)), this.register("setSelection", (n) => {
2799
2810
  if (n) {
2800
2811
  const l = n;
2801
2812
  this.selectionManager.setSelection(l.anchor, l.focus);
@@ -2825,7 +2836,7 @@ class bl {
2825
2836
  o && (o.execute(), this.historyManager.push(o));
2826
2837
  }
2827
2838
  }
2828
- class xl {
2839
+ class _l {
2829
2840
  constructor(e, n) {
2830
2841
  N(this, "_el", null);
2831
2842
  N(this, "_commandManager");
@@ -2900,11 +2911,11 @@ class xl {
2900
2911
  if (!e || !this._el) return;
2901
2912
  const n = e.anchorNode, l = e.focusNode;
2902
2913
  if (!n || !l || !this._el.contains(n) && !this._el.contains(l)) return;
2903
- const o = mt.domToModelPoint(n, e.anchorOffset), s = mt.domToModelPoint(l, e.focusOffset);
2914
+ const o = bt.domToModelPoint(n, e.anchorOffset), s = bt.domToModelPoint(l, e.focusOffset);
2904
2915
  o && s && this._selectionManager.setSelection(o, s);
2905
2916
  }
2906
2917
  }
2907
- class _l {
2918
+ class xl {
2908
2919
  constructor(e = {}) {
2909
2920
  N(this, "docModel");
2910
2921
  N(this, "selection");
@@ -2915,7 +2926,7 @@ class _l {
2915
2926
  N(this, "_plugins", []);
2916
2927
  N(this, "_inputEl", null);
2917
2928
  var n;
2918
- this._readonly = e.readonly ?? !1, this.docModel = new at(e.initialDocument), this.selection = new mt(this.docModel), this.history = new vl(), this.commands = new bl(this.docModel, this.selection, this.history), this.input = new xl(this.commands, this.selection), (n = e.plugins) == null || n.forEach((l) => this.use(l));
2929
+ this._readonly = e.readonly ?? !1, this.docModel = new st(e.initialDocument), this.selection = new bt(this.docModel), this.history = new vl(), this.commands = new bl(this.docModel, this.selection, this.history), this.input = new _l(this.commands, this.selection), (n = e.plugins) == null || n.forEach((l) => this.use(l));
2919
2930
  }
2920
2931
  // ─── 公共 API ─────────────────────────────────────────────────────────────
2921
2932
  /**
@@ -2949,7 +2960,7 @@ class _l {
2949
2960
  }
2950
2961
  /** 从 JSON 加载文档(清空历史) */
2951
2962
  loadJSON(e) {
2952
- const n = at.fromJSON(e);
2963
+ const n = st.fromJSON(e);
2953
2964
  Object.assign(this.docModel.data, n.data), this.history.clear();
2954
2965
  }
2955
2966
  get isReadonly() {
@@ -2959,15 +2970,15 @@ class _l {
2959
2970
  return ["undo", "redo", "selectAll", "setSelection"].includes(e);
2960
2971
  }
2961
2972
  }
2962
- const Yt = Symbol("editor");
2973
+ const Qt = Symbol("editor");
2963
2974
  function El(t) {
2964
- const e = new _l(t);
2965
- return vt(Yt, e), st(() => {
2975
+ const e = new xl(t);
2976
+ return yt(Qt, e), rt(() => {
2966
2977
  e.unmount();
2967
2978
  }), e;
2968
2979
  }
2969
2980
  function Sl() {
2970
- const t = pt(Yt);
2981
+ const t = mt(Qt);
2971
2982
  if (!t)
2972
2983
  throw new Error("[useEditor] 必须在 EditorContainer 组件内使用");
2973
2984
  return t;
@@ -2978,9 +2989,9 @@ const kl = gl, Fl = {
2978
2989
  }
2979
2990
  };
2980
2991
  export {
2981
- _l as Editor,
2992
+ xl as Editor,
2982
2993
  kl as EditorContainer,
2983
- Yt as EditorKey,
2994
+ Qt as EditorKey,
2984
2995
  El as createEditor,
2985
2996
  Fl as default,
2986
2997
  Sl as useEditor