@bireturn/word-editor 1.0.7 → 1.0.8

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