@guodun/antdv 1.7.8 → 1.7.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (31) hide show
  1. package/dist/es/components/pro-contract-template-designer/src/ContractTemplateChoiceOptionsEditor.mjs +5 -0
  2. package/dist/es/components/pro-contract-template-designer/src/ContractTemplateChoiceOptionsEditor.vue.mjs +132 -0
  3. package/dist/es/components/pro-contract-template-designer/src/ContractTemplateDesignerInspector.vue.mjs +209 -246
  4. package/dist/es/components/pro-contract-template-designer/src/ProContractTemplateDesigner.vue.mjs +1019 -1009
  5. package/dist/es/components/pro-contract-template-designer/src/composables/use-template-designer.mjs +192 -162
  6. package/dist/es/components/pro-contract-template-designer/src/extensions/template-variable.mjs +70 -68
  7. package/dist/es/components/pro-contract-template-designer/src/utils/advanced-controls.mjs +63 -25
  8. package/dist/es/components/pro-contract-template-designer/src/utils/template-renderer.mjs +129 -75
  9. package/dist/es/components/pro-contract-template-designer/src/utils/template-variable-render.mjs +17 -5
  10. package/dist/es/components/pro-contract-template-designer/style/index.css +1 -1
  11. package/dist/es/index.mjs +22 -22
  12. package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateChoiceOptionsEditor.cjs +1 -0
  13. package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateChoiceOptionsEditor.vue.cjs +1 -0
  14. package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateDesignerInspector.vue.cjs +1 -2
  15. package/dist/lib/components/pro-contract-template-designer/src/ProContractTemplateDesigner.vue.cjs +1 -1
  16. package/dist/lib/components/pro-contract-template-designer/src/composables/use-template-designer.cjs +4 -4
  17. package/dist/lib/components/pro-contract-template-designer/src/extensions/template-variable.cjs +1 -1
  18. package/dist/lib/components/pro-contract-template-designer/src/utils/advanced-controls.cjs +1 -1
  19. package/dist/lib/components/pro-contract-template-designer/src/utils/template-renderer.cjs +3 -3
  20. package/dist/lib/components/pro-contract-template-designer/src/utils/template-variable-render.cjs +1 -1
  21. package/dist/lib/components/pro-contract-template-designer/style/index.css +1 -1
  22. package/dist/lib/index.cjs +1 -1
  23. package/dist/theme/icon.css +1 -1
  24. package/dist/theme/index.css +1 -1
  25. package/dist/types/components/pro-contract-template-designer/src/ContractTemplateChoiceOptionsEditor.vue.d.ts +12 -0
  26. package/dist/types/components/pro-contract-template-designer/src/ProContractTemplateDesigner.vue.d.ts +2 -0
  27. package/dist/types/components/pro-contract-template-designer/src/composables/use-template-designer.d.ts +5 -1
  28. package/dist/types/components/pro-contract-template-designer/src/types.d.ts +15 -2
  29. package/dist/types/components/pro-contract-template-designer/src/utils/advanced-controls.d.ts +10 -0
  30. package/dist/types/components/pro-contract-template-designer/src/utils/template-variable-render.d.ts +7 -0
  31. package/package.json +5 -5
@@ -1,55 +1,55 @@
1
1
  import { CONTRACT_BLOCK_STYLES as e, DEFAULT_CONTRACT_FONT_FAMILY as t, DEFAULT_FONT_SIZE_PRESETS as n, DEFAULT_TEXT_ALIGN_OPTIONS as r, resolveFontFamilyOptions as i } from "./constants.mjs";
2
2
  import { collectPageDecorationVariableKeys as a, normalizePageDecorations as o, resolvePageDecorationPreset as ee, resolvePageDecorationValidationPath as te, rewritePageDecorationVariableTokens as ne } from "./utils/page-decorations.mjs";
3
3
  import { isContractTemplateFieldType as re } from "./types.mjs";
4
- import { DEFAULT_ADVANCED_CHOICE_FIELD_TYPES as ie, DEFAULT_BUILTIN_SELECTOR_FIELD_TYPES as ae, DEFAULT_CUSTOM_FIELD_TYPES as oe, DEFAULT_FIELD_STYLE as se, DEFAULT_FIELD_TYPES as s, DEFAULT_PAGE_SIZE as ce, buildTemplatePreviewPages as le, cloneTemplateValue as c, constrainTemplatePageSizes as ue, createBlankPage as de, createBlankTemplate as fe, createDefaultPage as pe, createTemplateBodySync as me, createTemplateVariable as he, exportTemplateValue as ge, getFieldOption as _e, getPageSizeKey as ve, normalizeContractTemplateMaxPages as ye, normalizePageSizeOptions as be, normalizeTemplateValue as xe, resolvePageSize as Se, syncTemplateVariablesWithPages as Ce, validateContractTemplateVariableKey as we, validateTemplateValue as Te } from "./composables/use-template-designer.mjs";
5
- import { isSafeContractImageUrl as Ee } from "./utils/image-url.mjs";
6
- import { buildTemplateVariableData as De } from "./utils/template-renderer.mjs";
7
- import { useFitWidthZoom as Oe } from "./composables/use-fit-width-zoom.mjs";
8
- import { normalizeContractImageDimension as ke, processContractImageFile as Ae } from "./utils/content-image.mjs";
9
- import { SIGNING_LAYOUT_PRESETS as je, SIGNING_LAYOUT_PRESET_KEYS as Me, isSigningLayoutPresetKey as Ne } from "./utils/signing-layout-presets.mjs";
10
- import { inferContextVariableLabel as Pe, resolveContextVariableWidth as Fe } from "./utils/context-variable.mjs";
11
- import { captureCaretViewport as Ie } from "./utils/caret-viewport.mjs";
12
- import Le from "./DesignerPage.mjs";
13
- import Re from "./TableContextMenu.mjs";
14
- import ze from "./ContractTemplateDesignerWorkspaceHeader.mjs";
15
- import { resolveFieldTypeIcon as Be } from "./utils/template-tool-icons.mjs";
16
- import Ve from "./ContractTemplateDesignerToolbar.mjs";
17
- import He from "./ContractTemplateAuthoringBar.mjs";
18
- import { useTemplateAuthoring as Ue } from "./composables/use-template-authoring.mjs";
19
- import We from "./ContractTemplateTextContextMenu.mjs";
20
- import Ge from "./ContractTemplateTextBubbleMenu.mjs";
21
- import Ke from "./ContractTemplateImageContextMenu.mjs";
22
- import qe from "./ContractTemplatePreviewModal.mjs";
23
- import Je from "./ContractTemplateSubmitDataModal.mjs";
24
- import Ye from "./ContractTemplateVariableDataModal.mjs";
25
- import Xe from "./SigningLayoutCustomModal.mjs";
26
- import { DEFAULT_DRAFT_CACHE_INTERVAL as Ze, DEFAULT_DRAFT_CACHE_KEY as Qe, DEFAULT_DRAFT_CACHE_MAX_BYTES as l, createDraftCacheStatus as $e, formatDraftCacheSavedAt as et } from "./composables/use-template-draft-cache.mjs";
27
- import { useAutoPagination as tt } from "./composables/use-auto-pagination.mjs";
28
- import { resolveSetActiveFileIdOptions as nt } from "./composables/use-designer-files.mjs";
29
- import { cloneContractTemplateFiles as u, constrainContractTemplateFiles as rt, createContractTemplateFile as it, exportContractTemplateFiles as at, moveContractTemplateFile as ot, normalizeContractTemplateFiles as st, removeContractTemplateFile as ct, renameContractTemplateFile as lt, replaceContractTemplateFile as ut, resolveContractTemplateActiveFileId as dt } from "./composables/use-template-files.mjs";
30
- import { useDraftCacheSession as ft } from "./composables/use-draft-cache-session.mjs";
31
- import pt from "./ContractTemplateFileBar.mjs";
32
- import mt from "./ContractTemplateDesignerSidebar.mjs";
33
- import ht from "./ContractTemplateDesignerInspector.mjs";
34
- import gt from "./ContractTemplatePageDecorationsStudio.mjs";
4
+ import { DEFAULT_ADVANCED_CHOICE_FIELD_TYPES as ie, DEFAULT_BUILTIN_SELECTOR_FIELD_TYPES as ae, DEFAULT_CHECKBOX_FIELD_TYPE as oe, DEFAULT_CUSTOM_FIELD_TYPES as se, DEFAULT_FIELD_STYLE as ce, DEFAULT_FIELD_TYPES as s, DEFAULT_IMAGE_FIELD_TYPE as le, DEFAULT_PAGE_SIZE as ue, buildTemplatePreviewPages as de, cloneTemplateValue as c, constrainTemplatePageSizes as fe, createBlankPage as pe, createBlankTemplate as me, createDefaultPage as he, createTemplateBodySync as ge, createTemplateVariable as _e, exportTemplateValue as ve, getFieldOption as ye, getPageSizeKey as be, normalizeContractTemplateMaxPages as xe, normalizePageSizeOptions as Se, normalizeTemplateValue as Ce, resolvePageSize as we, syncTemplateVariablesWithPages as Te, validateContractTemplateVariableKey as Ee, validateTemplateValue as De } from "./composables/use-template-designer.mjs";
5
+ import { isSafeContractImageUrl as Oe } from "./utils/image-url.mjs";
6
+ import { buildTemplateVariableData as ke } from "./utils/template-renderer.mjs";
7
+ import { useFitWidthZoom as Ae } from "./composables/use-fit-width-zoom.mjs";
8
+ import { normalizeContractImageDimension as je, processContractImageFile as Me } from "./utils/content-image.mjs";
9
+ import { SIGNING_LAYOUT_PRESETS as Ne, SIGNING_LAYOUT_PRESET_KEYS as Pe, isSigningLayoutPresetKey as Fe } from "./utils/signing-layout-presets.mjs";
10
+ import { inferContextVariableLabel as Ie, resolveContextVariableWidth as Le } from "./utils/context-variable.mjs";
11
+ import { captureCaretViewport as Re } from "./utils/caret-viewport.mjs";
12
+ import ze from "./DesignerPage.mjs";
13
+ import Be from "./TableContextMenu.mjs";
14
+ import Ve from "./ContractTemplateDesignerWorkspaceHeader.mjs";
15
+ import { resolveFieldTypeIcon as He } from "./utils/template-tool-icons.mjs";
16
+ import Ue from "./ContractTemplateDesignerToolbar.mjs";
17
+ import We from "./ContractTemplateAuthoringBar.mjs";
18
+ import { useTemplateAuthoring as Ge } from "./composables/use-template-authoring.mjs";
19
+ import Ke from "./ContractTemplateTextContextMenu.mjs";
20
+ import qe from "./ContractTemplateTextBubbleMenu.mjs";
21
+ import Je from "./ContractTemplateImageContextMenu.mjs";
22
+ import Ye from "./ContractTemplatePreviewModal.mjs";
23
+ import Xe from "./ContractTemplateSubmitDataModal.mjs";
24
+ import Ze from "./ContractTemplateVariableDataModal.mjs";
25
+ import Qe from "./SigningLayoutCustomModal.mjs";
26
+ import { DEFAULT_DRAFT_CACHE_INTERVAL as $e, DEFAULT_DRAFT_CACHE_KEY as et, DEFAULT_DRAFT_CACHE_MAX_BYTES as l, createDraftCacheStatus as tt, formatDraftCacheSavedAt as nt } from "./composables/use-template-draft-cache.mjs";
27
+ import { useAutoPagination as rt } from "./composables/use-auto-pagination.mjs";
28
+ import { resolveSetActiveFileIdOptions as it } from "./composables/use-designer-files.mjs";
29
+ import { cloneContractTemplateFiles as u, constrainContractTemplateFiles as at, createContractTemplateFile as ot, exportContractTemplateFiles as st, moveContractTemplateFile as ct, normalizeContractTemplateFiles as lt, removeContractTemplateFile as ut, renameContractTemplateFile as dt, replaceContractTemplateFile as ft, resolveContractTemplateActiveFileId as pt } from "./composables/use-template-files.mjs";
30
+ import { useDraftCacheSession as mt } from "./composables/use-draft-cache-session.mjs";
31
+ import ht from "./ContractTemplateFileBar.mjs";
32
+ import gt from "./ContractTemplateDesignerSidebar.mjs";
33
+ import _t from "./ContractTemplateDesignerInspector.mjs";
34
+ import vt from "./ContractTemplatePageDecorationsStudio.mjs";
35
35
  import { serializeFingerprint as d } from "./utils/serialize-fingerprint.mjs";
36
- import { isSameEditorState as _t } from "./utils/editor-state.mjs";
37
- import { clampContextMenuPosition as vt, clampContextMenuToElement as yt } from "./utils/context-menu-viewport.mjs";
38
- import { Fragment as bt, Teleport as xt, computed as f, createBlock as p, createCommentVNode as m, createElementBlock as St, createElementVNode as h, createVNode as g, defineComponent as _, isRef as Ct, nextTick as v, normalizeClass as wt, normalizeStyle as Tt, onBeforeUnmount as Et, onMounted as Dt, openBlock as y, ref as b, renderList as Ot, toDisplayString as kt, toRaw as At, unref as x, useId as jt, vShow as Mt, watch as S, withCtx as Nt, withDirectives as Pt } from "vue";
39
- import { Alert as Ft, Modal as It, Tooltip as Lt, message as Rt } from "ant-design-vue";
40
- import { useElementSize as zt } from "@vueuse/core";
41
- import { CompressOutlined as Bt, DownOutlined as Vt } from "@ant-design/icons-vue";
36
+ import { isSameEditorState as yt } from "./utils/editor-state.mjs";
37
+ import { clampContextMenuPosition as bt, clampContextMenuToElement as xt } from "./utils/context-menu-viewport.mjs";
38
+ import { Fragment as St, Teleport as Ct, computed as f, createBlock as wt, createCommentVNode as p, createElementBlock as Tt, createElementVNode as m, createVNode as h, defineComponent as g, isRef as Et, nextTick as _, normalizeClass as Dt, normalizeStyle as Ot, onBeforeUnmount as kt, onMounted as At, openBlock as v, ref as y, renderList as jt, toDisplayString as Mt, toRaw as Nt, unref as b, useId as Pt, vShow as Ft, watch as x, withCtx as It, withDirectives as Lt } from "vue";
39
+ import { Alert as Rt, Modal as zt, Tooltip as Bt, message as Vt } from "ant-design-vue";
40
+ import { useElementSize as Ht } from "@vueuse/core";
41
+ import { CompressOutlined as Ut, DownOutlined as Wt } from "@ant-design/icons-vue";
42
42
  //#region src/components/pro-contract-template-designer/src/ProContractTemplateDesigner.vue?vue&type=script&setup=true&lang.ts
43
- var Ht = {
43
+ var Gt = {
44
44
  key: 2,
45
45
  class: "gd-contract-template-designer__validation"
46
- }, Ut = {
46
+ }, Kt = {
47
47
  key: 0,
48
48
  class: "gd-contract-template-designer__validation-list"
49
- }, Wt = ["onClick"], Gt = {
49
+ }, qt = ["onClick"], Jt = {
50
50
  class: "gd-contract-template-designer__sr-status",
51
51
  "aria-live": "polite"
52
- }, Kt = .5, qt = 1.5, Jt = .1, Yt = 300, Xt = 500, Zt = 128, Qt = 108, $t = 48, en = 24, tn = 10, nn = 48, rn = 8, an = /* @__PURE__ */ _({
52
+ }, Yt = .5, Xt = 1.5, Zt = .1, Qt = 300, $t = 500, en = 128, tn = 108, nn = 48, rn = 24, an = 10, on = 48, sn = 8, cn = /* @__PURE__ */ g({
53
53
  name: "ProContractTemplateDesigner",
54
54
  __name: "ProContractTemplateDesigner",
55
55
  props: {
@@ -65,13 +65,21 @@ var Ht = {
65
65
  default: !1
66
66
  },
67
67
  height: { default: 760 },
68
- pageSize: { default: () => ce },
68
+ pageSize: { default: () => ue },
69
69
  pageSizeOptions: {},
70
70
  maxPages: { default: 20 },
71
71
  imageCompression: { type: [Object, Boolean] },
72
72
  imageUpload: {},
73
73
  variableTypes: { default: () => s },
74
74
  signingLayoutPresets: {},
75
+ showImageControl: {
76
+ type: Boolean,
77
+ default: !1
78
+ },
79
+ showCheckboxControl: {
80
+ type: Boolean,
81
+ default: !1
82
+ },
75
83
  showAdvancedChoiceControls: {
76
84
  type: Boolean,
77
85
  default: !1
@@ -84,7 +92,7 @@ var Ht = {
84
92
  type: Boolean,
85
93
  default: !1
86
94
  },
87
- defaultVariableStyle: { default: () => se },
95
+ defaultVariableStyle: { default: () => ce },
88
96
  fontFamilies: { default: void 0 },
89
97
  fontFamilyMode: { default: "append" },
90
98
  contractFontBaseUrl: { default: void 0 },
@@ -104,8 +112,8 @@ var Ht = {
104
112
  type: Boolean,
105
113
  default: !0
106
114
  },
107
- draftCacheKey: { default: Qe },
108
- draftCacheInterval: { default: Ze },
115
+ draftCacheKey: { default: et },
116
+ draftCacheInterval: { default: $e },
109
117
  draftCacheMaxBytes: { default: l },
110
118
  showDraftCacheStatus: {
111
119
  type: Boolean,
@@ -128,61 +136,61 @@ var Ht = {
128
136
  "page-limit",
129
137
  "image-error"
130
138
  ],
131
- setup(s, { expose: Ze, emit: Qe }) {
132
- let l = s, _ = Qe, an = f(() => ({ height: typeof l.height == "number" ? `${l.height}px` : l.height })), on = b(), sn = b();
133
- function cn() {
134
- return sn.value;
139
+ setup(s, { expose: $e, emit: et }) {
140
+ let l = s, g = et, cn = f(() => ({ height: typeof l.height == "number" ? `${l.height}px` : l.height })), ln = y(), un = y();
141
+ function dn() {
142
+ return un.value;
135
143
  }
136
- function ln() {
137
- let e = Cn, t = sn.value;
138
- return Ie(t, () => e === Cn && !Cr && !W.value && t?.isConnected !== !1);
144
+ function fn() {
145
+ let e = En, t = un.value;
146
+ return Re(t, () => e === En && !Tr && !W.value && t?.isConnected !== !1);
139
147
  }
140
- function un() {
141
- Cn += 1;
148
+ function pn() {
149
+ En += 1;
142
150
  }
143
- let dn = b(), fn = b(), pn = b(), mn = `gd-contract-template-page-decorations-studio-${jt()}`, hn = `gd-contract-template-workspace-chrome-${jt()}`, gn = b(), _n = b(), vn = b(), yn = "", bn = "", xn, Sn, Cn = 0, wn = me(), Tn = /* @__PURE__ */ new Map(), En = b(!1), C = f(() => En.value || Array.isArray(l.files)), Dn = st(l.files, l.modelValue, l.pageSize), On = rt(Dn, l.pageSizeOptions), kn = C.value ? On.files : Dn, An = dt(kn, l.activeFileId), w = b(kn), T = b(An), jn = xe((kn.find((e) => e.id === An) ?? kn[0])?.template ?? l.modelValue, l.pageSize), E = b(ue(jn, l.pageSizeOptions));
144
- C.value ? (w.value = ut(w.value, T.value, E.value), d(w.value) !== d(Dn) && X(w.value)) : l.modelValue && d(E.value) !== d(jn) && Qi(E.value);
145
- let D = b(""), O = b(E.value.pages[0]?.id ?? ""), k = b(!1), A = b([]), j = /* @__PURE__ */ new Map(), Mn = b(!1), Nn = b(""), Pn = b(!1), Fn = b(), In = b(), Ln = b(""), Rn = b(!1), zn = b(""), Bn = b(!1), Vn = b({
151
+ let mn = y(), hn = y(), gn = y(), _n = `gd-contract-template-page-decorations-studio-${Pt()}`, vn = `gd-contract-template-workspace-chrome-${Pt()}`, yn = y(), bn = y(), xn = y(), Sn = "", Cn = "", wn, Tn, En = 0, Dn = ge(), On = /* @__PURE__ */ new Map(), kn = y(!1), S = f(() => kn.value || Array.isArray(l.files)), An = lt(l.files, l.modelValue, l.pageSize), jn = at(An, l.pageSizeOptions), Mn = S.value ? jn.files : An, Nn = pt(Mn, l.activeFileId), C = y(Mn), w = y(Nn), Pn = Ce((Mn.find((e) => e.id === Nn) ?? Mn[0])?.template ?? l.modelValue, l.pageSize), T = y(fe(Pn, l.pageSizeOptions));
152
+ S.value ? (C.value = ft(C.value, w.value, T.value), d(C.value) !== d(An) && X(C.value)) : l.modelValue && d(T.value) !== d(Pn) && ea(T.value);
153
+ let E = y(""), D = y(T.value.pages[0]?.id ?? ""), O = y(!1), k = y([]), A = /* @__PURE__ */ new Map(), Fn = y(!1), In = y(""), Ln = y(!1), Rn = y(), zn = y(), Bn = y(""), Vn = y(!1), Hn = y(""), Un = y(!1), Wn = y({
146
154
  values: {},
147
155
  variables: []
148
- }), M = b(1), N = b(!1), Hn = b(!1), Un = b(!1), P = b(!1), Wn = b(!1), Gn = b(), F = b(!1), Kn = b("header"), qn = b(!1), Jn = b({}), Yn = b(""), I = b(!1), L = b(!1), Xn = b(!1), Zn = b(!1), Qn = b(!1), $n = b(!1), er = b(!1), tr = b(""), nr = b(), rr = b(), ir = b(""), ar = b(!1), R = b(), or = b(), z = b(), sr = b(), cr = b(!1), lr, ur = b(!1), dr, fr = b(!1), pr = b(""), B = b(), mr = b(), V = b(), hr = b(), gr = b(), _r = b(), H = b(""), U = b($e("idle", "暂无本地草稿")), vr = b({
156
+ }), j = y(1), M = y(!1), Gn = y(!1), Kn = y(!1), N = y(!1), P = y(!1), qn = y(), F = y(!1), Jn = y("header"), Yn = y(!1), Xn = y({}), Zn = y(""), I = y(!1), L = y(!1), Qn = y(!1), $n = y(!1), er = y(!1), tr = y(!1), nr = y(!1), rr = y(""), ir = y(), ar = y(), or = y(""), sr = y(!1), R = y(), cr = y(), z = y(), lr = y(), ur = y(!1), dr, fr = y(!1), pr, mr = y(!1), hr = y(""), B = y(), gr = y(), V = y(), _r = y(), vr = y(), yr = y(), H = y(""), U = y(tt("idle", "暂无本地草稿")), br = y({
149
157
  rows: 3,
150
158
  cols: 3,
151
159
  withHeaderRow: !0
152
- }), yr = /* @__PURE__ */ new WeakSet(), br = [".gd-contract-template-designer__page-decorations-select-popup", ".gd-contract-template-designer__page-decorations-dropdown-popup"].join(","), xr, Sr, Cr = !1, wr = !1, Tr, Er, W = f(() => l.readonly || l.disabled), { panel: Dr, query: Or, replacement: kr, matchCase: Ar, matches: jr, currentIndex: Mr, currentMatch: Nr, feedback: Pr, highlightQuery: Fr, open: Ir, close: Lr, navigate: Rr, replaceCurrent: zr, replaceAll: Br, handleKeydown: Vr } = Ue({
153
- pages: () => E.value.pages,
154
- fileId: () => T.value,
160
+ }), xr = /* @__PURE__ */ new WeakSet(), Sr = [".gd-contract-template-designer__page-decorations-select-popup", ".gd-contract-template-designer__page-decorations-dropdown-popup"].join(","), Cr, wr, Tr = !1, Er = !1, Dr, Or, W = f(() => l.readonly || l.disabled), { panel: kr, query: Ar, replacement: jr, matchCase: Mr, matches: Nr, currentIndex: Pr, currentMatch: Fr, feedback: Ir, highlightQuery: Lr, open: Rr, close: zr, navigate: Br, replaceCurrent: Vr, replaceAll: Hr, handleKeydown: Ur } = Ge({
161
+ pages: () => T.value.pages,
162
+ fileId: () => w.value,
155
163
  readonly: () => W.value,
156
- root: () => on.value,
157
- pageRefs: j,
158
- activatePage: Lo,
164
+ root: () => ln.value,
165
+ pageRefs: A,
166
+ activatePage: zo,
159
167
  beforeOpen: () => {
160
- $(), Ts(), P.value = !1;
168
+ $(), Ds(), N.value = !1;
161
169
  },
162
- focusPanel: () => vn.value?.focusPanel(),
163
- focusTrigger: (e) => vn.value?.focusTrigger(e)
164
- }), Hr = f(() => !!(R.value || Dr.value || B.value || V.value || I.value || L.value || qn.value || Xn.value || Zn.value || Qn.value || $n.value || er.value)), Ur = f(() => !!l.enableDraftCache && !W.value), Wr = f(() => w.value.find((e) => e.id === T.value) ?? w.value[0]), Gr = f(() => Fn.value ? le(Fn.value) : []), Kr = f(() => (In.value ?? []).map((e) => ({
170
+ focusPanel: () => xn.value?.focusPanel(),
171
+ focusTrigger: (e) => xn.value?.focusTrigger(e)
172
+ }), Wr = f(() => !!(R.value || kr.value || B.value || V.value || I.value || L.value || Yn.value || Qn.value || $n.value || er.value || tr.value || nr.value)), Gr = f(() => !!l.enableDraftCache && !W.value), Kr = f(() => C.value.find((e) => e.id === w.value) ?? C.value[0]), qr = f(() => Rn.value ? de(Rn.value) : []), Jr = f(() => (zn.value ?? []).map((e) => ({
165
173
  file: e,
166
- pages: le(e.template)
167
- }))), qr = f(() => Kr.value.find((e) => e.file.id === Ln.value) ?? Kr.value[0]), G = f(() => E.value.pages.find((e) => e.id === O.value) ?? E.value.pages[0]), Jr = f(() => Se(G.value?.pageSize, E.value.pageSize)), Yr = f(() => k.value && A.value.length === 0), Xr = f(() => k.value ? Yr.value ? "校验通过,正文变量与变量配置一致" : `发现 ${A.value.length} 个校验问题` : ""), Zr = f(() => {
174
+ pages: de(e.template)
175
+ }))), Yr = f(() => Jr.value.find((e) => e.file.id === Bn.value) ?? Jr.value[0]), G = f(() => T.value.pages.find((e) => e.id === D.value) ?? T.value.pages[0]), Xr = f(() => we(G.value?.pageSize, T.value.pageSize)), Zr = f(() => O.value && k.value.length === 0), Qr = f(() => O.value ? Zr.value ? "校验通过,正文变量与变量配置一致" : `发现 ${k.value.length} 个校验问题` : ""), $r = f(() => {
168
176
  let e = G.value?.title || "合同正文";
169
- return `${C.value && Wr.value ? `${Wr.value.name} · ` : ""}${e} · ${Jr.value.label} · 共 ${E.value.pages.length} 页`;
170
- }), Qr = f(() => ({
177
+ return `${S.value && Kr.value ? `${Kr.value.name} · ` : ""}${e} · ${Xr.value.label} · 共 ${T.value.pages.length} 页`;
178
+ }), ei = f(() => ({
171
179
  none: "无装饰",
172
180
  "page-number": "标准页码",
173
181
  "internal-review": "内部审阅",
174
182
  draft: "草稿",
175
183
  custom: "自定义"
176
- })[ee(E.value.pageDecorations)]), $r = f(() => {
177
- let e = o(E.value.pageDecorations);
184
+ })[ee(T.value.pageDecorations)]), ti = f(() => {
185
+ let e = o(T.value.pageDecorations);
178
186
  return {
179
187
  header: e.header.enabled,
180
188
  footer: e.footer.enabled,
181
189
  watermark: e.watermark.enabled
182
190
  };
183
- }), ei = f(() => Object.values($r.value).filter(Boolean).length), ti = f(() => {
191
+ }), ni = f(() => Object.values(ti.value).filter(Boolean).length), ri = f(() => {
184
192
  switch (U.value.type) {
185
- case "saved": return `草稿已缓存 ${et(U.value.savedAt)}`;
193
+ case "saved": return `草稿已缓存 ${nt(U.value.savedAt)}`;
186
194
  case "restored": return "已恢复本地草稿";
187
195
  case "too-large": return "草稿过大,未缓存";
188
196
  case "unavailable":
@@ -191,23 +199,23 @@ var Ht = {
191
199
  case "cleared": return "草稿缓存已清理";
192
200
  default: return "";
193
201
  }
194
- }), ni = f(() => ({
202
+ }), ii = f(() => ({
195
203
  "is-success": U.value.type === "saved" || U.value.type === "restored",
196
204
  "is-warning": U.value.type === "too-large",
197
205
  "is-error": U.value.type === "unavailable" || U.value.type === "read-failed" || U.value.type === "write-failed"
198
- })), ri = f(() => `${Math.round(M.value * 100)}%`), ii = f(() => i(l.fontFamilies, l.fontFamilyMode)), ai = f(() => ii.value.map((e) => ({
206
+ })), ai = f(() => `${Math.round(j.value * 100)}%`), oi = f(() => i(l.fontFamilies, l.fontFamilyMode)), si = f(() => oi.value.map((e) => ({
199
207
  label: e.label,
200
208
  value: e.value
201
- }))), oi = r, si = [...e.map((e) => ({
209
+ }))), ci = r, li = [...e.map((e) => ({
202
210
  label: e.label,
203
211
  value: e.format
204
- }))], ci = [{
212
+ }))], ui = [{
205
213
  label: "实线",
206
214
  value: "solid"
207
215
  }, {
208
216
  label: "虚线",
209
217
  value: "dashed"
210
- }], li = [
218
+ }], di = [
211
219
  {
212
220
  label: "完整显示",
213
221
  value: "contain"
@@ -220,72 +228,74 @@ var Ht = {
220
228
  label: "拉伸填充",
221
229
  value: "fill"
222
230
  }
223
- ], ui = f(() => be(l.pageSizeOptions)), di = f(() => ui.value.map((e) => ({
231
+ ], fi = f(() => Se(l.pageSizeOptions)), pi = f(() => fi.value.map((e) => ({
224
232
  label: `${e.label} · ${e.width} × ${e.height}`,
225
- value: ve(e)
226
- }))), fi = f(() => ve(Jr.value)), pi = f(() => l.draftCacheKey), K = f(() => E.value.variables.find((e) => e.key === D.value)), mi = f(() => {
233
+ value: be(e)
234
+ }))), mi = f(() => be(Xr.value)), hi = f(() => l.draftCacheKey), K = f(() => T.value.variables.find((e) => e.key === E.value)), gi = f(() => {
227
235
  let e = [
228
236
  ...l.variableTypes,
237
+ ...l.showImageControl ? [le] : [],
238
+ ...l.showCheckboxControl ? [oe] : [],
229
239
  ...l.showAdvancedChoiceControls ? ie : [],
230
240
  ...l.showBuiltinSelectorControls ? ae : [],
231
- ...l.showCustomControls ? oe : []
241
+ ...l.showCustomControls ? se : []
232
242
  ].filter((e) => re(e?.type));
233
243
  return Array.from(new Map(e.map((e) => [e.type, e])).values());
234
- }), hi = f(() => {
235
- let e = [...Me.map((e) => je[e]), ...(l.signingLayoutPresets ?? []).filter((e) => !!e?.key)];
244
+ }), _i = f(() => {
245
+ let e = [...Pe.map((e) => Ne[e]), ...(l.signingLayoutPresets ?? []).filter((e) => !!e?.key)];
236
246
  return Array.from(new Map(e.map((e) => [e.key, e])).values());
237
- }), gi = f(() => mi.value.map((e) => ({
247
+ }), vi = f(() => gi.value.map((e) => ({
238
248
  ...e,
239
- icon: Be(e.type),
240
- group: e.type === "select" || e.type === "radio" ? "advanced-choice" : e.type.endsWith("-selector") ? "builtin-selector" : e.type === "custom" ? "custom" : "basic"
241
- }))), _i = f(() => ye(l.maxPages)), vi = f(() => E.value.pages.length >= _i.value), yi = f(() => {
242
- let e = wn.collectKeys(E.value);
243
- return Array.from(a(E.value.pageDecorations)).filter((t) => !e.has(t));
244
- }), { scheduleAutoPaginate: bi, scheduleFullPagination: q, resetPagination: xi, disposePagination: Si } = tt({
245
- templateValue: E,
249
+ icon: He(e.type),
250
+ group: e.type === "select" || e.type === "radio" ? "basic" : e.type.endsWith("-selector") ? "builtin-selector" : e.type === "custom" ? "custom" : "basic"
251
+ }))), yi = f(() => xe(l.maxPages)), bi = f(() => T.value.pages.length >= yi.value), xi = f(() => {
252
+ let e = Dn.collectKeys(T.value);
253
+ return Array.from(a(T.value.pageDecorations)).filter((t) => !e.has(t));
254
+ }), { scheduleAutoPaginate: Si, scheduleFullPagination: q, resetPagination: Ci, disposePagination: wi } = rt({
255
+ templateValue: T,
246
256
  readonlyState: W,
247
- isAutoPaginating: Mn,
248
- pendingPaginationPageId: Nn,
249
- activePageId: O,
250
- normalizedMaxPages: _i,
251
- pageRefs: j,
257
+ isAutoPaginating: Fn,
258
+ pendingPaginationPageId: In,
259
+ activePageId: D,
260
+ normalizedMaxPages: yi,
261
+ pageRefs: A,
252
262
  applyPagesChange: (e) => {
253
- E.value = {
254
- ...E.value,
263
+ T.value = {
264
+ ...T.value,
255
265
  pages: e
256
- }, k.value = !1, A.value = [], Yi();
266
+ }, O.value = !1, k.value = [], Zi();
257
267
  },
258
- getPageSize: da,
259
- notifyPageLimit: pa,
260
- captureViewport: ln
261
- }), { saveDraftCache: Ci, loadDraftCache: wi, clearDraftCache: Ti, restoreDraftCacheIfNeeded: Ei, stopDraftCacheTimer: Di, restartDraftCacheTimer: Oi, resetDraftFingerprint: ki } = ft({
262
- draftCacheWritable: Ur,
263
- multipleFilesMode: C,
264
- filesValue: w,
265
- activeFileIdValue: T,
266
- templateValue: E,
267
- draftCacheKey: pi,
268
+ getPageSize: pa,
269
+ notifyPageLimit: ha,
270
+ captureViewport: fn
271
+ }), { saveDraftCache: Ti, loadDraftCache: Ei, clearDraftCache: Di, restoreDraftCacheIfNeeded: Oi, stopDraftCacheTimer: ki, restartDraftCacheTimer: Ai, resetDraftFingerprint: ji } = mt({
272
+ draftCacheWritable: Gr,
273
+ multipleFilesMode: S,
274
+ filesValue: C,
275
+ activeFileIdValue: w,
276
+ templateValue: T,
277
+ draftCacheKey: hi,
268
278
  draftCacheInterval: () => l.draftCacheInterval,
269
279
  draftCacheMaxBytes: () => l.draftCacheMaxBytes,
270
280
  pageSize: () => l.pageSize,
271
281
  pageSizeOptions: () => l.pageSizeOptions,
272
282
  syncActiveFileSnapshot: Y,
273
- syncPageEditors: () => (Ji(), Gi()),
274
- setActiveFileId: $i,
283
+ syncPageEditors: () => (Xi(), qi()),
284
+ setActiveFileId: ta,
275
285
  emitFilesChange: X,
276
286
  commit: Z,
277
- updateDraftCacheStatus: ea,
287
+ updateDraftCacheStatus: na,
278
288
  scheduleFullPagination: q,
279
- activePageId: O,
280
- selectedVariableKey: D
281
- }), Ai = f(() => {
282
- let e = pr.value.trim().toLowerCase(), t = E.value.variables;
289
+ activePageId: D,
290
+ selectedVariableKey: E
291
+ }), Mi = f(() => {
292
+ let e = hr.value.trim().toLowerCase(), t = T.value.variables;
283
293
  return e ? t.filter((t) => t.label.toLowerCase().includes(e) || t.key.toLowerCase().includes(e)) : t;
284
- }), ji = f(() => Math.max($t, Jr.value.width - Zt)), Mi = f(() => Math.max(en, Jr.value.height - Qt)), J = f(() => Jn.value[O.value] ?? Bi()), Ni = f(() => J.value.hasMixedBlockFormats ? void 0 : J.value.currentHeadingLevel ?? "paragraph"), Pi = f(() => J.value.fontFamily || t), Fi = f(() => J.value.fontSize ?? se.fontSize ?? 14), Ii = f(() => J.value.textColor || se.color || "#1f2937"), Li = f(() => K.value?.style?.fontFamily || se.fontFamily || t), Ri = f(() => {
294
+ }), Ni = f(() => Math.max(nn, Xr.value.width - en)), Pi = f(() => Math.max(rn, Xr.value.height - tn)), J = f(() => Xn.value[D.value] ?? Hi()), Fi = f(() => J.value.hasMixedBlockFormats ? void 0 : J.value.currentHeadingLevel ?? "paragraph"), Ii = f(() => J.value.fontFamily || t), Li = f(() => J.value.fontSize ?? ce.fontSize ?? 14), Ri = f(() => J.value.textColor || ce.color || "#1f2937"), zi = f(() => K.value?.style?.fontFamily || ce.fontFamily || t), Bi = f(() => {
285
295
  let e = n.map((e) => ({
286
296
  label: `${e}px`,
287
297
  value: e
288
- })), t = Wi(Fi.value), r = Wi(Yn.value), i = /* @__PURE__ */ new Map();
298
+ })), t = Ki(Li.value), r = Ki(Zn.value), i = /* @__PURE__ */ new Map();
289
299
  return r && !n.includes(r) && i.set(r, {
290
300
  label: `使用 ${r}px`,
291
301
  value: r
@@ -294,91 +304,91 @@ var Ht = {
294
304
  value: t
295
305
  }), [...Array.from(i.values()), ...e];
296
306
  });
297
- S(() => l.modelValue, (e, t) => {
298
- if (!e || C.value) return;
299
- if (e !== t && Sn && At(e) === At(Sn)) {
300
- bn = "";
307
+ x(() => l.modelValue, (e, t) => {
308
+ if (!e || S.value) return;
309
+ if (e !== t && Tn && Nt(e) === Nt(Tn)) {
310
+ Cn = "";
301
311
  return;
302
312
  }
303
- if (d(e) === bn) {
304
- bn = "";
313
+ if (d(e) === Cn) {
314
+ Cn = "";
305
315
  return;
306
316
  }
307
- let n = xe(e, l.pageSize), r = ue(n, l.pageSizeOptions), i = d(r) !== d(E.value), a = d(r) === bn;
308
- a && (bn = ""), (i || !a) && (bn = "", un(), xi(), wn.clear(), qi(), E.value = r, w.value = ut(w.value, T.value, r), O.value = r.pages[0]?.id ?? "", D.value = "", q()), d(r) !== d(n) && Qi(r);
309
- }, { deep: !0 }), S(() => l.files, (e, t) => {
317
+ let n = Ce(e, l.pageSize), r = fe(n, l.pageSizeOptions), i = d(r) !== d(T.value), a = d(r) === Cn;
318
+ a && (Cn = ""), (i || !a) && (Cn = "", pn(), Ci(), Dn.clear(), Yi(), T.value = r, C.value = ft(C.value, w.value, r), D.value = r.pages[0]?.id ?? "", E.value = "", q()), d(r) !== d(n) && ea(r);
319
+ }, { deep: !0 }), x(() => l.files, (e, t) => {
310
320
  if (!Array.isArray(e)) return;
311
- if (e !== t && xn && At(e) === At(xn)) {
312
- yn = "";
321
+ if (e !== t && wn && Nt(e) === Nt(wn)) {
322
+ Sn = "";
313
323
  return;
314
324
  }
315
- if (d(e) === yn) {
316
- yn = "";
325
+ if (d(e) === Sn) {
326
+ Sn = "";
317
327
  return;
318
328
  }
319
- let n = st(e, void 0, l.pageSize), r = rt(n, l.pageSizeOptions).files, i = d(r), a = d(w.value);
320
- i === yn && (yn = "");
321
- let o = dt(r, l.activeFileId || T.value);
322
- i === a ? o !== T.value && $i(o, {
329
+ let n = lt(e, void 0, l.pageSize), r = at(n, l.pageSizeOptions).files, i = d(r), a = d(C.value);
330
+ i === Sn && (Sn = "");
331
+ let o = pt(r, l.activeFileId || w.value);
332
+ i === a ? o !== w.value && ta(o, {
323
333
  syncCurrent: !1,
324
334
  shouldEmit: !1
325
- }) : (yn = "", w.value = r, $i(o, {
335
+ }) : (Sn = "", C.value = r, ta(o, {
326
336
  syncCurrent: !1,
327
337
  shouldEmit: !1,
328
338
  forceRefresh: !0
329
339
  })), i !== d(n) && X(r);
330
- }, { deep: !0 }), S(() => l.activeFileId, (e) => {
331
- !C.value || !e || e === T.value || $i(e, {
340
+ }, { deep: !0 }), x(() => l.activeFileId, (e) => {
341
+ !S.value || !e || e === w.value || ta(e, {
332
342
  syncCurrent: !0,
333
343
  shouldEmit: !1
334
344
  });
335
345
  });
336
- function zi(e, t) {
337
- let n = d(w.value);
346
+ function Vi(e, t) {
347
+ let n = d(C.value);
338
348
  Y(!1);
339
- let { files: r } = rt(st(w.value, void 0, e), t), i = d(r) !== n, a = r.find((e) => e.id === T.value);
340
- return a && d(a.template) !== d(E.value) && (E.value = c(a.template)), i && (k.value = !1, A.value = [], X(r, "")), i;
349
+ let { files: r } = at(lt(C.value, void 0, e), t), i = d(r) !== n, a = r.find((e) => e.id === w.value);
350
+ return a && d(a.template) !== d(T.value) && (T.value = c(a.template)), i && (O.value = !1, k.value = [], X(r, "")), i;
341
351
  }
342
- S([() => l.pageSize, () => l.pageSizeOptions], ([e, t]) => {
343
- if (C.value) {
344
- zi(e, t), q();
352
+ x([() => l.pageSize, () => l.pageSizeOptions], ([e, t]) => {
353
+ if (S.value) {
354
+ Vi(e, t), q();
345
355
  return;
346
356
  }
347
- let n = ue(xe(E.value, e), t);
348
- d(n) !== d(E.value) && Z(n), q();
349
- }, { deep: !0 }), S(_i, () => {
357
+ let n = fe(Ce(T.value, e), t);
358
+ d(n) !== d(T.value) && Z(n), q();
359
+ }, { deep: !0 }), x(yi, () => {
350
360
  q();
351
- }), S(W, (e) => {
361
+ }), x(W, (e) => {
352
362
  e ? ($(), I.value = !1, L.value = !1) : q();
353
- }), S(O, () => {
363
+ }), x(D, () => {
354
364
  z.value = void 0;
355
- }), S([
356
- Hr,
365
+ }), x([
366
+ Wr,
357
367
  F,
358
- Pn
368
+ Ln
359
369
  ], () => {
360
- Os();
361
- }), S(() => [
370
+ As();
371
+ }), x(() => [
362
372
  l.enableDraftCache,
363
- pi.value,
373
+ hi.value,
364
374
  l.draftCacheInterval,
365
375
  W.value
366
376
  ], () => {
367
- ki(), Oi();
368
- }), S(N, (e) => {
377
+ ji(), Ai();
378
+ }), x(M, (e) => {
369
379
  if (!(typeof document > "u")) {
370
380
  if (e) {
371
- xr = document.body.style.overflow, document.body.style.overflow = "hidden";
381
+ Cr = document.body.style.overflow, document.body.style.overflow = "hidden";
372
382
  return;
373
383
  }
374
- document.body.style.overflow = xr ?? "", xr = void 0;
384
+ document.body.style.overflow = Cr ?? "", Cr = void 0;
375
385
  }
376
- }), Dt(() => {
377
- Ei(), Oi(), q(), document.fonts?.ready.then(q), document.fonts?.addEventListener("loadingdone", q), window.addEventListener("pointerdown", Is, !0), window.addEventListener("pointerup", Ns), window.addEventListener("keydown", zs, !0), window.addEventListener("keydown", Bs), window.addEventListener("resize", Ps), window.addEventListener("scroll", Ls, !0);
378
- }), Et(() => {
379
- un(), Si(), Ji(), Cr = !0, N.value && typeof document < "u" && (document.body.style.overflow = xr ?? ""), document.fonts?.removeEventListener("loadingdone", q), window.removeEventListener("pointerdown", Is, !0), window.removeEventListener("pointerup", Ns), window.removeEventListener("keydown", zs, !0), window.removeEventListener("keydown", Bs), window.removeEventListener("resize", Ps), window.removeEventListener("scroll", Ls, !0), dr !== void 0 && cancelAnimationFrame(dr), Di();
386
+ }), At(() => {
387
+ Oi(), Ai(), q(), document.fonts?.ready.then(q), document.fonts?.addEventListener("loadingdone", q), window.addEventListener("pointerdown", Rs, !0), window.addEventListener("pointerup", Fs), window.addEventListener("keydown", Vs, !0), window.addEventListener("keydown", Hs), window.addEventListener("resize", Is), window.addEventListener("scroll", zs, !0);
388
+ }), kt(() => {
389
+ pn(), wi(), Xi(), Tr = !0, M.value && typeof document < "u" && (document.body.style.overflow = Cr ?? ""), document.fonts?.removeEventListener("loadingdone", q), window.removeEventListener("pointerdown", Rs, !0), window.removeEventListener("pointerup", Fs), window.removeEventListener("keydown", Vs, !0), window.removeEventListener("keydown", Hs), window.removeEventListener("resize", Is), window.removeEventListener("scroll", zs, !0), pr !== void 0 && cancelAnimationFrame(pr), ki();
380
390
  });
381
- function Bi() {
391
+ function Hi() {
382
392
  return {
383
393
  isFocused: !1,
384
394
  canUndo: !1,
@@ -391,32 +401,32 @@ var Ht = {
391
401
  isTableActive: !1,
392
402
  textAlign: "left",
393
403
  fontFamily: t,
394
- fontSize: se.fontSize ?? 14,
395
- textColor: se.color ?? "#1f2937",
404
+ fontSize: ce.fontSize ?? 14,
405
+ textColor: ce.color ?? "#1f2937",
396
406
  selectionText: "",
397
407
  hasMixedBlockFormats: !1
398
408
  };
399
409
  }
400
- function Vi(e) {
410
+ function Ui(e) {
401
411
  return e === "left" || e === "center" || e === "right";
402
412
  }
403
- function Hi(e) {
413
+ function Wi(e) {
404
414
  return typeof e == "number" && Number.isInteger(e) && e >= 1 && e <= 6;
405
415
  }
406
- function Ui(e, t = Fi.value) {
416
+ function Gi(e, t = Li.value) {
407
417
  let n = Number(e);
408
- return Number.isFinite(n) ? Math.min(nn, Math.max(tn, Math.round(n))) : t;
418
+ return Number.isFinite(n) ? Math.min(on, Math.max(an, Math.round(n))) : t;
409
419
  }
410
- function Wi(e) {
420
+ function Ki(e) {
411
421
  let t = String(e || "").trim().match(/(\d+(\.\d+)?)/);
412
422
  if (!t) return;
413
423
  let n = Number(t[1]);
414
- if (Number.isFinite(n)) return Math.min(nn, Math.max(tn, Math.round(n)));
424
+ if (Number.isFinite(n)) return Math.min(on, Math.max(an, Math.round(n)));
415
425
  }
416
- function Gi(e = E.value) {
426
+ function qi(e = T.value) {
417
427
  let t = !1, n = e.pages.map((e) => {
418
- let n = j.get(e.id)?.getContentSnapshot(e), r = n?.contentHtml ?? e.contentHtml, i = n?.contentJson ?? e.contentJson;
419
- return r === e.contentHtml && At(i) === At(e.contentJson) ? e : (t = !0, {
428
+ let n = A.get(e.id)?.getContentSnapshot(e), r = n?.contentHtml ?? e.contentHtml, i = n?.contentJson ?? e.contentJson;
429
+ return r === e.contentHtml && Nt(i) === Nt(e.contentJson) ? e : (t = !0, {
420
430
  ...e,
421
431
  contentHtml: r,
422
432
  contentJson: i
@@ -427,323 +437,323 @@ var Ht = {
427
437
  pages: n
428
438
  } : e;
429
439
  }
430
- function Ki() {
431
- Tr !== void 0 && (clearTimeout(Tr), Tr = void 0), Er !== void 0 && typeof cancelIdleCallback == "function" && cancelIdleCallback(Er), Er = void 0;
432
- }
433
- function qi() {
434
- wr = !1, Ki();
435
- }
436
440
  function Ji() {
437
- let e = wr;
438
- qi(), e && Zi();
441
+ Dr !== void 0 && (clearTimeout(Dr), Dr = void 0), Or !== void 0 && typeof cancelIdleCallback == "function" && cancelIdleCallback(Or), Or = void 0;
439
442
  }
440
443
  function Yi() {
441
- wr = !0, Ki(), Tr = setTimeout(() => {
442
- Tr = void 0;
444
+ Er = !1, Ji();
445
+ }
446
+ function Xi() {
447
+ let e = Er;
448
+ Yi(), e && $i();
449
+ }
450
+ function Zi() {
451
+ Er = !0, Ji(), Dr = setTimeout(() => {
452
+ Dr = void 0;
443
453
  let e = () => {
444
- if (Er = void 0, !(!wr || Cr)) {
445
- if (Mn.value) return Yi();
446
- wr = !1, Zi();
454
+ if (Or = void 0, !(!Er || Tr)) {
455
+ if (Fn.value) return Zi();
456
+ Er = !1, $i();
447
457
  }
448
458
  };
449
- typeof requestIdleCallback == "function" ? Er = requestIdleCallback(e, { timeout: Xt }) : e();
450
- }, Yt);
459
+ typeof requestIdleCallback == "function" ? Or = requestIdleCallback(e, { timeout: $t }) : e();
460
+ }, Qt);
451
461
  }
452
- function Xi(e) {
453
- let t = E.value.pages, n = t.findIndex((t) => t.id === e.id);
462
+ function Qi(e) {
463
+ let t = T.value.pages, n = t.findIndex((t) => t.id === e.id);
454
464
  if (n < 0) return;
455
465
  let r = t[n];
456
466
  if (r.contentHtml === e.contentHtml && r.contentJson === e.contentJson && r.title === e.title && r.pageSize === e.pageSize) return;
457
467
  let i = t.slice();
458
- i[n] = e, E.value = {
459
- ...E.value,
468
+ i[n] = e, T.value = {
469
+ ...T.value,
460
470
  pages: i
461
471
  };
462
472
  }
463
- function Zi() {
464
- let e = Gi(), t = wn.sync(e);
465
- D.value && !t.variables.some((e) => e.key === D.value) && (D.value = ""), Z(t, { normalizedBody: !0 });
473
+ function $i() {
474
+ let e = qi(), t = Dn.sync(e);
475
+ E.value && !t.variables.some((e) => e.key === E.value) && (E.value = ""), Z(t, { normalizedBody: !0 });
466
476
  }
467
477
  function Y(e = !1) {
468
- Ji();
469
- let t = c(Gi());
470
- if (!C.value) return t;
471
- let n = w.value.find((e) => e.id === T.value)?.template, r = d(n) !== d(t), i = ut(w.value, T.value, t);
472
- return w.value = i, r && e && X(i), t;
478
+ Xi();
479
+ let t = c(qi());
480
+ if (!S.value) return t;
481
+ let n = C.value.find((e) => e.id === w.value)?.template, r = d(n) !== d(t), i = ft(C.value, w.value, t);
482
+ return C.value = i, r && e && X(i), t;
473
483
  }
474
- function Qi(e) {
484
+ function ea(e) {
475
485
  let t = c(e);
476
- Sn = t, bn = d(e), _("update:modelValue", t), _("change", c(e));
486
+ Tn = t, Cn = d(e), g("update:modelValue", t), g("change", c(e));
477
487
  }
478
- function X(e, t = T.value) {
479
- if (!C.value) return;
488
+ function X(e, t = w.value) {
489
+ if (!S.value) return;
480
490
  let n = u(e), r = u(n);
481
- w.value = n, xn = r, yn = d(r), _("update:files", r), _("files-change", u(r));
491
+ C.value = n, wn = r, Sn = d(r), g("update:files", r), g("files-change", u(r));
482
492
  let i = r.find((e) => e.id === t);
483
- i && _("file-change", u([i])[0]);
493
+ i && g("file-change", u([i])[0]);
484
494
  }
485
- function $i(e, t = {}) {
486
- let { syncCurrent: n, shouldEmit: r, forceRefresh: i } = nt(t), a = dt(w.value, e), o = a !== T.value;
487
- if ((o || i) && w.value.some((e) => e.id === a) && (un(), xi()), n ? Y(!0) : qi(), !o && !i) return;
488
- let ee = w.value.find((e) => e.id === a);
489
- ee && (T.value = a, E.value = c(ee.template), D.value = "", O.value = E.value.pages[0]?.id ?? "", Jn.value = {}, j.clear(), wn.clear(), Tn.clear(), k.value = !1, A.value = [], Pn.value = !1, Fn.value = void 0, In.value = void 0, ki(), r && o && _("update:activeFileId", a), n && o && Ur.value && Ci(), v(() => {
495
+ function ta(e, t = {}) {
496
+ let { syncCurrent: n, shouldEmit: r, forceRefresh: i } = it(t), a = pt(C.value, e), o = a !== w.value;
497
+ if ((o || i) && C.value.some((e) => e.id === a) && (pn(), Ci()), n ? Y(!0) : Yi(), !o && !i) return;
498
+ let ee = C.value.find((e) => e.id === a);
499
+ ee && (w.value = a, T.value = c(ee.template), E.value = "", D.value = T.value.pages[0]?.id ?? "", Xn.value = {}, A.clear(), Dn.clear(), On.clear(), O.value = !1, k.value = [], Ln.value = !1, Rn.value = void 0, zn.value = void 0, ji(), r && o && g("update:activeFileId", a), n && o && Gr.value && Ti(), _(() => {
490
500
  q();
491
501
  }));
492
502
  }
493
503
  function Z(e, t = {}) {
494
- qi();
495
- let n = t.normalizedBody ? e : ue(xe(e, l.pageSize), l.pageSizeOptions);
496
- return t.normalizedBody || (wn.clear(), Tn.clear()), E.value = n, k.value = !1, A.value = [], C.value ? X(ut(w.value, T.value, n)) : (w.value = ut(w.value, T.value, n), Qi(n)), n;
504
+ Yi();
505
+ let n = t.normalizedBody ? e : fe(Ce(e, l.pageSize), l.pageSizeOptions);
506
+ return t.normalizedBody || (Dn.clear(), On.clear()), T.value = n, O.value = !1, k.value = [], S.value ? X(ft(C.value, w.value, n)) : (C.value = ft(C.value, w.value, n), ea(n)), n;
497
507
  }
498
- function ea(e, t = e.type !== "unchanged") {
499
- U.value = e, t && _("draft-cache-change", { ...e });
508
+ function na(e, t = e.type !== "unchanged") {
509
+ U.value = e, t && g("draft-cache-change", { ...e });
500
510
  }
501
- function ta() {
511
+ function ra() {
502
512
  return { ...U.value };
503
513
  }
504
- function na(e, t) {
505
- t ? j.set(e, t) : j.delete(e);
514
+ function ia(e, t) {
515
+ t ? A.set(e, t) : A.delete(e);
506
516
  }
507
- function ra(e) {
508
- $(), Qn.value = !1, Q({
517
+ function aa(e) {
518
+ $(), er.value = !1, Q({
509
519
  type: "insert-signing-layout",
510
- preset: Ne(e.key) ? e.key : void 0,
520
+ preset: Fe(e.key) ? e.key : void 0,
511
521
  options: e.options
512
522
  });
513
523
  }
514
- function ia(e) {
524
+ function oa(e) {
515
525
  $(), Q({
516
526
  type: "insert-signing-layout",
517
527
  options: e
518
528
  });
519
529
  }
520
- function aa() {
521
- Qn.value = !1, er.value = !0;
530
+ function sa() {
531
+ er.value = !1, nr.value = !0;
522
532
  }
523
- function oa(e) {
524
- $(), $n.value = !1, Q({
533
+ function ca(e) {
534
+ $(), tr.value = !1, Q({
525
535
  type: "insert-signing-mark",
526
536
  mark: { markType: e }
527
537
  });
528
538
  }
529
- function Q(e, t = G.value?.id ?? O.value) {
530
- W.value || j.get(t)?.runCommand(e);
531
- }
532
- function sa(e) {
533
- Q(e), $();
534
- }
535
- function ca(e) {
536
- let t = R.value?.pageId;
537
- t && (j.get(t)?.focus(), H.value = typeof document < "u" && document.execCommand(e) ? `${e === "copy" ? "已复制" : e === "cut" ? "已剪切" : "已粘贴"}` : "浏览器未授权剪贴板操作,请使用系统快捷键。", $());
539
+ function Q(e, t = G.value?.id ?? D.value) {
540
+ W.value || A.get(t)?.runCommand(e);
538
541
  }
539
542
  function la(e) {
540
- let t = Z(Ce(e));
541
- return D.value && !t.variables.some((e) => e.key === D.value) && (D.value = ""), t;
543
+ Q(e), $();
542
544
  }
543
545
  function ua(e) {
544
- Xi(e), Yi(), bi(e.id);
546
+ let t = R.value?.pageId;
547
+ t && (A.get(t)?.focus(), H.value = typeof document < "u" && document.execCommand(e) ? `${e === "copy" ? "已复制" : e === "cut" ? "已剪切" : "已粘贴"}` : "浏览器未授权剪贴板操作,请使用系统快捷键。", $());
545
548
  }
546
549
  function da(e) {
547
- let t = Se(e?.pageSize, E.value.pageSize), n = `${ve(t)}:${t.label ?? ""}`;
548
- return Tn.get(n) || (Tn.set(n, t), t);
550
+ let t = Z(Te(e));
551
+ return E.value && !t.variables.some((e) => e.key === E.value) && (E.value = ""), t;
549
552
  }
550
553
  function fa(e) {
554
+ Qi(e), Zi(), Si(e.id);
555
+ }
556
+ function pa(e) {
557
+ let t = we(e?.pageSize, T.value.pageSize), n = `${be(t)}:${t.label ?? ""}`;
558
+ return On.get(n) || (On.set(n, t), t);
559
+ }
560
+ function ma(e) {
551
561
  if (W.value || !G.value) return;
552
- let t = ui.value.find((t) => ve(t) === e);
562
+ let t = fi.value.find((t) => be(t) === e);
553
563
  if (!t) return;
554
- let n = G.value.id, r = Se(t, E.value.pageSize);
564
+ let n = G.value.id, r = we(t, T.value.pageSize);
555
565
  Z({
556
- ...E.value,
557
- pages: E.value.pages.map((e) => e.id === n ? {
566
+ ...T.value,
567
+ pages: T.value.pages.map((e) => e.id === n ? {
558
568
  ...e,
559
569
  pageSize: r
560
570
  } : e)
561
- }), bi(n);
571
+ }), Si(n);
562
572
  }
563
- function pa(e) {
564
- let t = _i.value;
565
- H.value = `合同最多支持 ${t} 页`, _("page-limit", t, e);
573
+ function ha(e) {
574
+ let t = yi.value;
575
+ H.value = `合同最多支持 ${t} 页`, g("page-limit", t, e);
566
576
  }
567
- function ma() {
577
+ function ga() {
568
578
  if (W.value) return;
569
- if (vi.value) {
570
- pa("add");
579
+ if (bi.value) {
580
+ ha("add");
571
581
  return;
572
582
  }
573
- let e = pe(E.value.pages.length + 1, Jr.value);
583
+ let e = he(T.value.pages.length + 1, Xr.value);
574
584
  Z({
575
- ...E.value,
576
- pages: [...E.value.pages, e]
577
- }), O.value = e.id, q();
585
+ ...T.value,
586
+ pages: [...T.value.pages, e]
587
+ }), D.value = e.id, q();
578
588
  }
579
- function ha(e) {
589
+ function _a(e) {
580
590
  if (W.value) return;
581
- if (vi.value) {
582
- pa("duplicate");
591
+ if (bi.value) {
592
+ ha("duplicate");
583
593
  return;
584
594
  }
585
- let t = E.value.pages.findIndex((t) => t.id === e.id);
595
+ let t = T.value.pages.findIndex((t) => t.id === e.id);
586
596
  if (t < 0) return;
587
597
  let n = c({
588
598
  pages: [e],
589
599
  variables: [],
590
- pageSize: E.value.pageSize
591
- }).pages[0], r = de(t + 2, da(e), n.contentHtml, n.contentJson);
600
+ pageSize: T.value.pageSize
601
+ }).pages[0], r = pe(t + 2, pa(e), n.contentHtml, n.contentJson);
592
602
  r.title = `${e.title || `第 ${t + 1} 页`}副本`;
593
- let i = [...E.value.pages];
603
+ let i = [...T.value.pages];
594
604
  i.splice(t + 1, 0, r), Z({
595
- ...E.value,
605
+ ...T.value,
596
606
  pages: i
597
- }), O.value = r.id, q();
607
+ }), D.value = r.id, q();
598
608
  }
599
- function ga(e) {
600
- if (W.value || E.value.pages.length <= 1) return;
601
- let t = E.value.pages.findIndex((t) => t.id === e.id);
609
+ function va(e) {
610
+ if (W.value || T.value.pages.length <= 1) return;
611
+ let t = T.value.pages.findIndex((t) => t.id === e.id);
602
612
  if (t < 0) return;
603
- let n = E.value.pages.filter((t) => t.id !== e.id), r = la({
604
- ...E.value,
613
+ let n = T.value.pages.filter((t) => t.id !== e.id), r = da({
614
+ ...T.value,
605
615
  pages: n
606
616
  });
607
- O.value = r.pages[Math.min(t, r.pages.length - 1)]?.id ?? "", q();
617
+ D.value = r.pages[Math.min(t, r.pages.length - 1)]?.id ?? "", q();
608
618
  }
609
- function _a(e) {
610
- W.value || E.value.pages.length <= 1 || It.confirm({
619
+ function ya(e) {
620
+ W.value || T.value.pages.length <= 1 || zt.confirm({
611
621
  title: "删除合同页面",
612
622
  content: "删除页面会同时移除页面正文,是否继续?",
613
623
  okText: "确认删除",
614
624
  okType: "danger",
615
625
  cancelText: "取消",
616
626
  onOk: () => {
617
- ga(e);
627
+ va(e);
618
628
  }
619
629
  });
620
630
  }
621
- function va(e) {
622
- let t = new Set(E.value.variables.map((e) => e.key)), n = 1;
631
+ function ba(e) {
632
+ let t = new Set(T.value.variables.map((e) => e.key)), n = 1;
623
633
  for (; t.has(`${e}_${n}`);) n += 1;
624
634
  return `${e}_${n}`;
625
635
  }
626
- function ya(e) {
636
+ function xa(e) {
627
637
  let t = e.type ?? "text";
628
- return he({
638
+ return _e({
629
639
  ...e,
630
640
  type: t,
631
- key: e.key || va(t),
632
- label: e.label || _e(t, mi.value).label
633
- }, mi.value, l.defaultVariableStyle);
641
+ key: e.key || ba(t),
642
+ label: e.label || ye(t, gi.value).label
643
+ }, gi.value, l.defaultVariableStyle);
634
644
  }
635
- function ba(e, t = G.value?.id ?? E.value.pages[0].id, n) {
645
+ function Sa(e, t = G.value?.id ?? T.value.pages[0].id, n) {
636
646
  if (W.value) return e;
637
- let r = j.get(t)?.insertVariable(e, n), i = !E.value.variables.some((t) => t.key === e.key);
647
+ let r = A.get(t)?.insertVariable(e, n), i = !T.value.variables.some((t) => t.key === e.key);
638
648
  return Z({
639
- ...E.value,
640
- pages: r ? E.value.pages.map((e) => e.id === r.id ? r : e) : E.value.pages,
641
- variables: i ? [...E.value.variables, e] : E.value.variables
642
- }), D.value = e.key, O.value = t, i && _("variable-add", e), bi(t), e;
649
+ ...T.value,
650
+ pages: r ? T.value.pages.map((e) => e.id === r.id ? r : e) : T.value.pages,
651
+ variables: i ? [...T.value.variables, e] : T.value.variables
652
+ }), E.value = e.key, D.value = t, i && g("variable-add", e), Si(t), e;
643
653
  }
644
- function xa(e) {
645
- let { width: t, height: n, ...r } = e, i = ke(t), a = ke(n);
654
+ function Ca(e) {
655
+ let { width: t, height: n, ...r } = e, i = je(t), a = je(n);
646
656
  return {
647
657
  ...r,
648
658
  ...i === void 0 ? {} : { width: i },
649
659
  ...a === void 0 ? {} : { height: a }
650
660
  };
651
661
  }
652
- function Sa(e = {}) {
653
- let t = ke(nr.value), n = ke(rr.value);
662
+ function wa(e = {}) {
663
+ let t = je(ir.value), n = je(ar.value);
654
664
  return {
655
665
  ...e,
656
666
  ...t === void 0 ? {} : { width: t },
657
667
  ...n === void 0 ? {} : { height: n }
658
668
  };
659
669
  }
660
- function Ca() {
661
- tr.value = "", nr.value = void 0, rr.value = void 0, ir.value = "";
670
+ function Ta() {
671
+ rr.value = "", ir.value = void 0, ar.value = void 0, or.value = "";
662
672
  }
663
- function wa(e, t = G.value?.id ?? E.value.pages[0]?.id, n) {
664
- let r = xa({
673
+ function Ea(e, t = G.value?.id ?? T.value.pages[0]?.id, n) {
674
+ let r = Ca({
665
675
  ...e,
666
676
  src: e.src.trim()
667
677
  });
668
- if (!(W.value || !t || !Ee(r.src) || !r.src || !j.get(t)?.insertContentImage(r, n))) return O.value = t, D.value = "", r.src;
678
+ if (!(W.value || !t || !Oe(r.src) || !r.src || !A.get(t)?.insertContentImage(r, n))) return D.value = t, E.value = "", r.src;
669
679
  }
670
- function Ta(e) {
680
+ function Da(e) {
671
681
  return e instanceof Error ? e : /* @__PURE__ */ Error("图片处理失败");
672
682
  }
673
- async function Ea(e, t) {
674
- t === "toolbar" && (ar.value = !0, ir.value = "");
683
+ async function Oa(e, t) {
684
+ t === "toolbar" && (sr.value = !0, or.value = "");
675
685
  try {
676
- let n = await Ae(e, {
686
+ let n = await Me(e, {
677
687
  source: t,
678
688
  compression: l.imageCompression,
679
689
  upload: l.imageUpload
680
690
  });
681
- return Cr ? void 0 : n.src;
691
+ return Tr ? void 0 : n.src;
682
692
  } catch (e) {
683
- let n = Ta(e);
684
- t === "toolbar" && (ir.value = n.message), H.value = n.message, _("image-error", n, t);
693
+ let n = Da(e);
694
+ t === "toolbar" && (or.value = n.message), H.value = n.message, g("image-error", n, t);
685
695
  return;
686
696
  } finally {
687
- t === "toolbar" && (ar.value = !1);
697
+ t === "toolbar" && (sr.value = !1);
688
698
  }
689
699
  }
690
- let Da = 0;
691
- function Oa(e) {
700
+ let ka = 0;
701
+ function Aa(e) {
692
702
  let t = e.replacedFontFamilies.filter(Boolean);
693
703
  if (!t.length) return;
694
704
  let n = Date.now();
695
- n - Da < 800 || (Da = n, Rt.info(`已将 ${t.length} 种外部字体(${t.join("、")})统一为合同标准字体,以保证 Mac 与 Windows 排版一致`));
705
+ n - ka < 800 || (ka = n, Vt.info(`已将 ${t.length} 种外部字体(${t.join("、")})统一为合同标准字体,以保证 Mac 与 Windows 排版一致`));
696
706
  }
697
- async function ka(e) {
698
- return await Ea(e, "paste") ?? null;
707
+ async function ja(e) {
708
+ return await Oa(e, "paste") ?? null;
699
709
  }
700
- async function Aa(e, t = {}) {
710
+ async function Ma(e, t = {}) {
701
711
  if (W.value) return;
702
- let n = G.value?.id ?? E.value.pages[0]?.id, r = n ? j.get(n)?.getSelectionRange() : void 0, i = typeof e == "string" ? e.trim() : await Ea(e, "toolbar");
703
- if (Cr) return;
704
- if (!i || !Ee(i)) {
705
- typeof e == "string" && (ir.value = "请输入安全的图片 URL");
712
+ let n = G.value?.id ?? T.value.pages[0]?.id, r = n ? A.get(n)?.getSelectionRange() : void 0, i = typeof e == "string" ? e.trim() : await Oa(e, "toolbar");
713
+ if (Tr) return;
714
+ if (!i || !Oe(i)) {
715
+ typeof e == "string" && (or.value = "请输入安全的图片 URL");
706
716
  return;
707
717
  }
708
- if (n && !j.has(n)) return;
709
- let a = wa({
718
+ if (n && !A.has(n)) return;
719
+ let a = Ea({
710
720
  ...t,
711
721
  src: i
712
722
  }, n, r);
713
- return a && (Zn.value = !1, Ca(), H.value = "已插入图片"), a;
723
+ return a && ($n.value = !1, Ta(), H.value = "已插入图片"), a;
714
724
  }
715
- function ja() {
716
- W.value || ar.value || ($(), ir.value = "", _n.value && (_n.value.value = ""), _n.value?.click());
725
+ function Na() {
726
+ W.value || sr.value || ($(), or.value = "", bn.value && (bn.value.value = ""), bn.value?.click());
717
727
  }
718
- async function Ma(e) {
728
+ async function Pa(e) {
719
729
  let t = e.target.files?.[0];
720
- t && await Aa(t, Sa({ alt: t.name }));
730
+ t && await Ma(t, wa({ alt: t.name }));
721
731
  }
722
- async function Na() {
723
- let e = tr.value;
724
- await Aa(e, Sa());
732
+ async function Fa() {
733
+ let e = rr.value;
734
+ await Ma(e, wa());
725
735
  }
726
- function Pa(e) {
727
- eo(e), Xn.value = !1;
736
+ function Ia(e) {
737
+ no(e), Qn.value = !1;
728
738
  }
729
- function Fa() {
730
- $(), ma();
739
+ function La() {
740
+ $(), ga();
731
741
  }
732
- function Ia(e, t, n, r) {
733
- $(), ba(ya({ type: t }), e, {
742
+ function Ra(e, t, n, r) {
743
+ $(), Sa(xa({ type: t }), e, {
734
744
  left: n,
735
745
  top: r
736
746
  });
737
747
  }
738
- function La(e) {
739
- $(), D.value = e;
748
+ function za(e) {
749
+ $(), E.value = e;
740
750
  }
741
- function Ra(e) {
742
- let t = E.value.variables.find((t) => t.id === e.id);
751
+ function Ba(e) {
752
+ let t = T.value.variables.find((t) => t.id === e.id);
743
753
  if (!t) return;
744
754
  let n = e.key.trim();
745
755
  if (n !== t.key) {
746
- let t = we(n, E.value.variables, e.id);
756
+ let t = Ee(n, T.value.variables, e.id);
747
757
  if (t) {
748
758
  H.value = t;
749
759
  return;
@@ -753,22 +763,22 @@ var Ht = {
753
763
  ...e,
754
764
  key: n
755
765
  };
756
- let r = [...E.value.pages], i = t.key;
757
- j.forEach((t, n) => {
766
+ let r = [...T.value.pages], i = t.key;
767
+ A.forEach((t, n) => {
758
768
  let a = t.updateVariable(e, i);
759
769
  if (a) {
760
770
  let e = r.findIndex((e) => e.id === n);
761
771
  e >= 0 && (r[e] = a);
762
772
  }
763
773
  }), Z({
764
- ...E.value,
774
+ ...T.value,
765
775
  pages: r,
766
- variables: E.value.variables.map((t) => t.id === e.id ? e : t),
767
- ...i !== e.key && E.value.pageDecorations ? { pageDecorations: ne(E.value.pageDecorations, i, e.key) } : {}
768
- }), D.value = e.key, q();
776
+ variables: T.value.variables.map((t) => t.id === e.id ? e : t),
777
+ ...i !== e.key && T.value.pageDecorations ? { pageDecorations: ne(T.value.pageDecorations, i, e.key) } : {}
778
+ }), E.value = e.key, q();
769
779
  }
770
- function za(e) {
771
- K.value && Ra({
780
+ function Va(e) {
781
+ K.value && Ba({
772
782
  ...K.value,
773
783
  ...e,
774
784
  style: {
@@ -777,338 +787,338 @@ var Ht = {
777
787
  }
778
788
  });
779
789
  }
780
- function Ba(e) {
781
- W.value || !K.value || za({ key: e });
790
+ function Ha(e) {
791
+ W.value || !K.value || Va({ key: e });
782
792
  }
783
- function Va(e) {
793
+ function Ua(e) {
784
794
  W.value || (Z({
785
- ...E.value,
795
+ ...T.value,
786
796
  pageDecorations: o(e)
787
797
  }), q());
788
798
  }
789
- function Ha(e) {
790
- (e === "left" || e === "center" || e === "right") && za({ style: { textAlign: e } });
791
- }
792
- function Ua(e) {
793
- (e === "solid" || e === "dashed") && za({ style: { borderStyle: e } });
794
- }
795
799
  function Wa(e) {
796
- (e === "contain" || e === "cover" || e === "fill") && za({ style: { objectFit: e } });
800
+ (e === "left" || e === "center" || e === "right") && Va({ style: { textAlign: e } });
797
801
  }
798
802
  function Ga(e) {
799
- za({ style: e });
803
+ (e === "solid" || e === "dashed") && Va({ style: { borderStyle: e } });
800
804
  }
801
805
  function Ka(e) {
802
- Ga({ fontFamily: String(e || "").trim() || t });
806
+ (e === "contain" || e === "cover" || e === "fill") && Va({ style: { objectFit: e } });
803
807
  }
804
808
  function qa(e) {
805
- Ga({ fontSize: Ui(e, K.value?.style?.fontSize ?? 14) });
809
+ Va({ style: e });
806
810
  }
807
811
  function Ja(e) {
808
- K.value && za({
812
+ qa({ fontFamily: String(e || "").trim() || t });
813
+ }
814
+ function Ya(e) {
815
+ qa({ fontSize: Gi(e, K.value?.style?.fontSize ?? 14) });
816
+ }
817
+ function Xa(e) {
818
+ K.value && Va({
809
819
  multiline: e,
810
820
  rows: K.value.rows || 3,
811
821
  lineHeight: K.value.lineHeight || 28,
812
822
  style: e ? { underline: !0 } : void 0
813
823
  });
814
824
  }
815
- function Ya(e) {
816
- K.value && za({
825
+ function Za(e) {
826
+ K.value && Va({
817
827
  rows: Number(e || 3),
818
828
  lineHeight: K.value.lineHeight || 28
819
829
  });
820
830
  }
821
- function Xa(e) {
831
+ function Qa(e) {
822
832
  if (W.value) return;
823
- let t = [...E.value.pages];
824
- j.forEach((n, r) => {
833
+ let t = [...T.value.pages];
834
+ A.forEach((n, r) => {
825
835
  let i = n.removeVariable(e.key);
826
836
  if (i) {
827
837
  let e = t.findIndex((e) => e.id === r);
828
838
  e >= 0 && (t[e] = i);
829
839
  }
830
840
  }), Z({
831
- ...E.value,
841
+ ...T.value,
832
842
  pages: t,
833
- variables: E.value.variables.filter((t) => t.id !== e.id),
834
- ...E.value.pageDecorations ? { pageDecorations: ne(E.value.pageDecorations, e.key) } : {}
835
- }), D.value = "";
843
+ variables: T.value.variables.filter((t) => t.id !== e.id),
844
+ ...T.value.pageDecorations ? { pageDecorations: ne(T.value.pageDecorations, e.key) } : {}
845
+ }), E.value = "";
836
846
  }
837
- function Za(e) {
838
- let t = (e.trim() || "variable").replace(/\s+/g, "_"), n = new Set(E.value.variables.map((e) => e.key));
847
+ function $a(e) {
848
+ let t = (e.trim() || "variable").replace(/\s+/g, "_"), n = new Set(T.value.variables.map((e) => e.key));
839
849
  if (!n.has(t)) return t;
840
850
  let r = 2;
841
851
  for (; n.has(`${t}_${r}`);) r += 1;
842
852
  return `${t}_${r}`;
843
853
  }
844
- function Qa(e) {
845
- W.value || ba(he({
854
+ function eo(e) {
855
+ W.value || Sa(_e({
846
856
  ...e,
847
857
  id: void 0,
848
- key: Za(`${e.key || e.type}_copy`),
858
+ key: $a(`${e.key || e.type}_copy`),
849
859
  label: `${e.label}副本`,
850
860
  style: { ...e.style }
851
- }, mi.value, l.defaultVariableStyle));
861
+ }, gi.value, l.defaultVariableStyle));
852
862
  }
853
- function $a(e) {
854
- return W.value ? void 0 : ba(E.value.variables.find((t) => t.key === e.key) ?? he(e, mi.value, l.defaultVariableStyle));
863
+ function to(e) {
864
+ return W.value ? void 0 : Sa(T.value.variables.find((t) => t.key === e.key) ?? _e(e, gi.value, l.defaultVariableStyle));
855
865
  }
856
- function eo(e) {
857
- if (!W.value) return ba(ya({ type: e }));
866
+ function no(e) {
867
+ if (!W.value) return Sa(xa({ type: e }));
858
868
  }
859
- function to(e) {
869
+ function ro(e) {
860
870
  if (W.value || !re(e)) return;
861
- let t = R.value, n = mi.value.find((t) => t.type === e);
871
+ let t = R.value, n = gi.value.find((t) => t.type === e);
862
872
  if (!t || !n) return;
863
- let r = Pe(t.leadingText) || n.label, i = Fe(t.selectionWidth, $t, ji.value), a = no();
864
- ba(ya({
873
+ let r = Ie(t.leadingText) || n.label, i = Le(t.selectionWidth, nn, Ni.value), a = io();
874
+ Sa(xa({
865
875
  type: e,
866
876
  label: r,
867
877
  ...i ? { width: i } : {},
868
878
  ...a ? { style: a } : {}
869
879
  }), t.pageId), H.value = t.hasSelection ? `已将选中内容替换为${n.label}控件` : `已插入${n.label}控件`, $();
870
880
  }
871
- function no() {
881
+ function io() {
872
882
  let e = J.value, t = {};
873
883
  return e.isUnderline && (t.underline = !0), typeof e.fontSize == "number" && Number.isFinite(e.fontSize) && (t.fontSize = e.fontSize), e.fontFamily && (t.fontFamily = e.fontFamily), e.textColor && (t.color = e.textColor), Object.keys(t).length ? t : void 0;
874
884
  }
875
- function ro(e) {
885
+ function ao(e) {
876
886
  if (W.value) return;
877
887
  let t = R.value;
878
- t && (ba(e, t.pageId), H.value = `已绑定到${e.label},沿用原控件尺寸`, $());
888
+ t && (Sa(e, t.pageId), H.value = `已绑定到${e.label},沿用原控件尺寸`, $());
879
889
  }
880
- function io(e) {
881
- return _e(e.type && re(e.type) ? e.type : "text", mi.value).label;
890
+ function oo(e) {
891
+ return ye(e.type && re(e.type) ? e.type : "text", gi.value).label;
882
892
  }
883
- function ao() {
884
- E.value.variables.length && (fr.value = !0, v(() => {
885
- vs(), or.value?.focusBindSearch();
893
+ function so() {
894
+ T.value.variables.length && (mr.value = !0, _(() => {
895
+ bs(), cr.value?.focusBindSearch();
886
896
  }));
887
897
  }
888
- function oo(e, t) {
898
+ function co(e, t) {
889
899
  e.dataTransfer?.setData("application/x-gd-contract-variable", t), e.dataTransfer && (e.dataTransfer.effectAllowed = "copy");
890
900
  }
891
- function so(e) {
892
- return M.value = Math.round(Math.min(qt, Math.max(Kt, Number.isFinite(e) ? e : 1)) * 100) / 100, M.value;
901
+ function lo(e) {
902
+ return j.value = Math.round(Math.min(Xt, Math.max(Yt, Number.isFinite(e) ? e : 1)) * 100) / 100, j.value;
893
903
  }
894
- let { width: co } = zt(sn), { fitWidth: lo, applyAutoFit: uo, markUserAdjusted: fo, userAdjusted: po } = Oe({
895
- viewportWidth: co,
896
- widestPageWidth: f(() => Math.max(...E.value.pages.map((e) => da(e).width), ce.width) + 10),
904
+ let { width: uo } = Ht(un), { fitWidth: fo, applyAutoFit: po, markUserAdjusted: mo, userAdjusted: ho } = Ae({
905
+ viewportWidth: uo,
906
+ widestPageWidth: f(() => Math.max(...T.value.pages.map((e) => pa(e).width), ue.width) + 10),
897
907
  padding: 48,
898
- minZoom: Kt,
899
- maxZoom: qt,
900
- getZoom: () => M.value,
901
- applyZoom: so
908
+ minZoom: Yt,
909
+ maxZoom: Xt,
910
+ getZoom: () => j.value,
911
+ applyZoom: lo
902
912
  });
903
- function mo(e) {
904
- return fo(), so(e);
905
- }
906
- function ho() {
907
- return uo();
908
- }
909
- function go() {
910
- return M.value;
913
+ function go(e) {
914
+ return mo(), lo(e);
911
915
  }
912
916
  function _o() {
913
- mo(M.value + Jt);
917
+ return po();
914
918
  }
915
919
  function vo() {
916
- mo(M.value - Jt);
920
+ return j.value;
917
921
  }
918
922
  function yo() {
919
- $(), Ts(), N.value = !N.value;
923
+ go(j.value + Zt);
920
924
  }
921
- S(co, (e) => {
922
- Wn.value && !po.value && e > 0 && lo();
923
- });
924
- function bo(e) {
925
- P.value ? gn.value?.focus() : e();
925
+ function bo() {
926
+ go(j.value - Zt);
926
927
  }
927
928
  function xo() {
928
- $(), Ts(), F.value = !1, Sr = {
929
- fullscreen: N.value,
930
- sidebar: Hn.value,
931
- inspector: Un.value,
932
- chrome: P.value,
933
- zoom: M.value,
934
- userAdjusted: po.value
935
- }, N.value = !0, Hn.value = !0, Un.value = !0, P.value = !0, Wn.value = !0, v(() => {
936
- W.value ? Gn.value?.focus() : j.get(O.value)?.focus();
937
- });
929
+ $(), Ds(), M.value = !M.value;
938
930
  }
939
- function So() {
940
- let e = Sr;
941
- Wn.value = !1, Sr = void 0, e && (N.value = e.fullscreen, Hn.value = e.sidebar, Un.value = e.inspector, P.value = e.chrome, e.userAdjusted ? mo(e.zoom) : uo(), v(() => bo(() => fn.value?.focusImmersive())));
931
+ x(uo, (e) => {
932
+ P.value && !ho.value && e > 0 && fo();
933
+ });
934
+ function So(e) {
935
+ N.value ? yn.value?.focus() : e();
942
936
  }
943
937
  function Co() {
944
- Wn.value ? So() : xo();
938
+ $(), Ds(), F.value = !1, wr = {
939
+ fullscreen: M.value,
940
+ sidebar: Gn.value,
941
+ inspector: Kn.value,
942
+ chrome: N.value,
943
+ zoom: j.value,
944
+ userAdjusted: ho.value
945
+ }, M.value = !0, Gn.value = !0, Kn.value = !0, N.value = !0, P.value = !0, _(() => {
946
+ W.value ? qn.value?.focus() : A.get(D.value)?.focus();
947
+ });
945
948
  }
946
949
  function wo() {
947
- $(), z.value = void 0;
948
- let e = Y(!1);
949
- C.value ? (In.value = u(w.value), Fn.value = void 0, Ln.value = T.value || w.value[0]?.id || "") : (Fn.value = c(e), In.value = void 0, Ln.value = ""), Pn.value = !0;
950
+ let e = wr;
951
+ P.value = !1, wr = void 0, e && (M.value = e.fullscreen, Gn.value = e.sidebar, Kn.value = e.inspector, N.value = e.chrome, e.userAdjusted ? go(e.zoom) : po(), _(() => So(() => hn.value?.focusImmersive())));
950
952
  }
951
953
  function To() {
952
- Pn.value = !1, Fn.value = void 0, In.value = void 0, Ln.value = "";
954
+ P.value ? wo() : Co();
953
955
  }
954
956
  function Eo() {
955
- return ts();
957
+ $(), z.value = void 0;
958
+ let e = Y(!1);
959
+ S.value ? (zn.value = u(C.value), Rn.value = void 0, Bn.value = w.value || C.value[0]?.id || "") : (Rn.value = c(e), zn.value = void 0, Bn.value = ""), Ln.value = !0;
956
960
  }
957
961
  function Do() {
958
- $();
959
- let e = Eo();
960
- return zn.value = JSON.stringify(e, null, 2), Rn.value = !0, e;
962
+ Ln.value = !1, Rn.value = void 0, zn.value = void 0, Bn.value = "";
961
963
  }
962
964
  function Oo() {
963
- Rn.value = !1;
965
+ return rs();
964
966
  }
965
967
  function ko() {
966
- return De(Y(!1));
968
+ $();
969
+ let e = Oo();
970
+ return Hn.value = JSON.stringify(e, null, 2), Vn.value = !0, e;
967
971
  }
968
972
  function Ao() {
969
- $();
970
- let e = ko();
971
- return Vn.value = e, Bn.value = !0, e;
973
+ Vn.value = !1;
972
974
  }
973
975
  function jo() {
974
- Bn.value = !1;
976
+ return ke(Y(!1));
975
977
  }
976
978
  function Mo() {
977
- $(), z.value = void 0, I.value = !1, L.value = !1, D.value = "", O.value = "", Pn.value = !1, Fn.value = void 0, In.value = void 0, Rn.value = !1, zn.value = "", Bn.value = !1, Vn.value = {
979
+ $();
980
+ let e = jo();
981
+ return Wn.value = e, Un.value = !0, e;
982
+ }
983
+ function No() {
984
+ Un.value = !1;
985
+ }
986
+ function Po() {
987
+ $(), z.value = void 0, I.value = !1, L.value = !1, E.value = "", D.value = "", Ln.value = !1, Rn.value = void 0, zn.value = void 0, Vn.value = !1, Hn.value = "", Un.value = !1, Wn.value = {
978
988
  values: {},
979
989
  variables: []
980
- }, Jn.value = {}, un(), xi();
981
- let e = Z(fe(ce));
982
- return O.value = e.pages[0]?.id ?? "", c(e);
990
+ }, Xn.value = {}, pn(), Ci();
991
+ let e = Z(me(ue));
992
+ return D.value = e.pages[0]?.id ?? "", c(e);
983
993
  }
984
- function No() {
985
- W.value || ($(), It.confirm({
994
+ function Fo() {
995
+ W.value || ($(), zt.confirm({
986
996
  title: "清空合同内容",
987
997
  content: "将清空全部合同正文、页面和模板变量,仅保留一个空白 A4 合同页。此操作不可撤销。",
988
998
  okText: "确认清空",
989
999
  okType: "danger",
990
1000
  cancelText: "取消",
991
1001
  onOk: () => {
992
- Mo();
1002
+ Po();
993
1003
  }
994
1004
  }));
995
1005
  }
996
- function Po(e) {
997
- let t = Gi().pages, n = t.find((e) => e.id === O.value);
1006
+ function Io(e) {
1007
+ let t = qi().pages, n = t.find((e) => e.id === D.value);
998
1008
  return (n ? [n, ...t.filter((e) => e.id !== n.id)] : t).find((t) => t.contentHtml.includes(`data-key="${e.key}"`) || t.contentHtml.includes(`data-key='${e.key}'`));
999
1009
  }
1000
- function Fo(e) {
1001
- $(), D.value = e.key;
1002
- let t = Po(e);
1003
- t && (O.value = t.id, v(() => {
1004
- j.get(t.id)?.scrollIntoVariable(e.key);
1010
+ function Lo(e) {
1011
+ $(), E.value = e.key;
1012
+ let t = Io(e);
1013
+ t && (D.value = t.id, _(() => {
1014
+ A.get(t.id)?.scrollIntoVariable(e.key);
1005
1015
  }));
1006
1016
  }
1007
- function Io(e) {
1008
- let t = E.value.variables.find((t) => t.key === e || t.id === e);
1009
- t && Fo(t);
1017
+ function Ro(e) {
1018
+ let t = T.value.variables.find((t) => t.key === e || t.id === e);
1019
+ t && Lo(t);
1010
1020
  }
1011
- function Lo(e, t = !0) {
1012
- $(), O.value = e, t && v(() => {
1013
- j.get(e)?.scrollIntoPage();
1021
+ function zo(e, t = !0) {
1022
+ $(), D.value = e, t && _(() => {
1023
+ A.get(e)?.scrollIntoPage();
1014
1024
  });
1015
1025
  }
1016
- function Ro(e) {
1017
- Lo(e.pageId, !1), j.get(e.pageId)?.focusHeading(e.headingIndex);
1026
+ function Bo(e) {
1027
+ zo(e.pageId, !1), A.get(e.pageId)?.focusHeading(e.headingIndex);
1018
1028
  }
1019
- function zo(e) {
1020
- E.value.pages.some((t) => t.id === e) && Lo(e);
1029
+ function Vo(e) {
1030
+ T.value.pages.some((t) => t.id === e) && zo(e);
1021
1031
  }
1022
- function Bo() {
1032
+ function Ho() {
1023
1033
  if (F.value) {
1024
- Vo();
1034
+ Uo();
1025
1035
  return;
1026
1036
  }
1027
1037
  F.value = !0;
1028
1038
  }
1029
- function Vo() {
1030
- F.value = !1, v(() => bo(() => fn.value?.focusPageDecorations()));
1039
+ function Uo() {
1040
+ F.value = !1, _(() => So(() => hn.value?.focusPageDecorations()));
1031
1041
  }
1032
- function Ho() {
1033
- return Ji(), c(Gi());
1042
+ function Wo() {
1043
+ return Xi(), c(qi());
1034
1044
  }
1035
- function Uo(e) {
1036
- un(), xi(), Z(e), q();
1045
+ function Go(e) {
1046
+ pn(), Ci(), Z(e), q();
1037
1047
  }
1038
- function Wo() {
1048
+ function Ko() {
1039
1049
  let e = Y(!1);
1040
- return C.value ? u(w.value) : u(ut(w.value, T.value, e));
1050
+ return S.value ? u(C.value) : u(ft(C.value, w.value, e));
1041
1051
  }
1042
- function Go(e, t) {
1043
- let n = rt(st(e, void 0, l.pageSize), l.pageSizeOptions), r = w.value;
1044
- En.value = !0, Y(!1), w.value = n.files, $i(dt(w.value, t ?? T.value), {
1052
+ function qo(e, t) {
1053
+ let n = at(lt(e, void 0, l.pageSize), l.pageSizeOptions), r = C.value;
1054
+ kn.value = !0, Y(!1), C.value = n.files, ta(pt(C.value, t ?? w.value), {
1045
1055
  syncCurrent: !1,
1046
1056
  shouldEmit: !0,
1047
1057
  forceRefresh: !0
1048
- }), d(r) !== d(w.value) && X(w.value, "");
1058
+ }), d(r) !== d(C.value) && X(C.value, "");
1049
1059
  }
1050
- function Ko(e) {
1060
+ function Jo(e) {
1051
1061
  if (W.value) return;
1052
- En.value = !0, Y(!0);
1053
- let t = it(e || `合同文件 ${w.value.length + 1}`, l.pageSize);
1054
- return w.value = [...w.value, t], X(w.value, ""), _("file-add", u([t])[0]), $i(t.id, {
1062
+ kn.value = !0, Y(!0);
1063
+ let t = ot(e || `合同文件 ${C.value.length + 1}`, l.pageSize);
1064
+ return C.value = [...C.value, t], X(C.value, ""), g("file-add", u([t])[0]), ta(t.id, {
1055
1065
  syncCurrent: !1,
1056
1066
  shouldEmit: !0,
1057
1067
  forceRefresh: !0
1058
1068
  }), u([t])[0];
1059
1069
  }
1060
- function qo(e) {
1061
- !C.value && !w.value.some((t) => t.id === e) || (En.value = !0, $i(e));
1070
+ function Yo(e) {
1071
+ !S.value && !C.value.some((t) => t.id === e) || (kn.value = !0, ta(e));
1062
1072
  }
1063
- function Jo(e, t) {
1073
+ function Xo(e, t) {
1064
1074
  if (W.value) return;
1065
- En.value = !0, Y(!1);
1066
- let n = lt(w.value, e, t), r = n.find((t) => t.id === e);
1067
- if (r) return w.value = n, X(n, e), u([r])[0];
1068
- }
1069
- function Yo(e) {
1070
- if (W.value || w.value.length <= 1) return;
1071
- En.value = !0, Y(!1);
1072
- let t = w.value.find((t) => t.id === e);
1075
+ kn.value = !0, Y(!1);
1076
+ let n = dt(C.value, e, t), r = n.find((t) => t.id === e);
1077
+ if (r) return C.value = n, X(n, e), u([r])[0];
1078
+ }
1079
+ function Zo(e) {
1080
+ if (W.value || C.value.length <= 1) return;
1081
+ kn.value = !0, Y(!1);
1082
+ let t = C.value.find((t) => t.id === e);
1073
1083
  if (!t) return;
1074
- let n = ct(w.value, e);
1075
- if (n.length !== w.value.length) return w.value = n, X(n, ""), _("file-remove", u([t])[0]), T.value === e && $i(dt(n, n[0]?.id), {
1084
+ let n = ut(C.value, e);
1085
+ if (n.length !== C.value.length) return C.value = n, X(n, ""), g("file-remove", u([t])[0]), w.value === e && ta(pt(n, n[0]?.id), {
1076
1086
  syncCurrent: !1,
1077
1087
  shouldEmit: !0,
1078
1088
  forceRefresh: !0
1079
1089
  }), u([t])[0];
1080
1090
  }
1081
- function Xo(e) {
1082
- if (W.value || w.value.length <= 1) return;
1083
- let t = w.value.find((t) => t.id === e);
1084
- t && It.confirm({
1091
+ function Qo(e) {
1092
+ if (W.value || C.value.length <= 1) return;
1093
+ let t = C.value.find((t) => t.id === e);
1094
+ t && zt.confirm({
1085
1095
  title: "删除合同文件",
1086
1096
  content: `删除“${t.name}”后,其正文和变量将无法恢复,是否继续?`,
1087
1097
  okText: "确认删除",
1088
1098
  okType: "danger",
1089
1099
  cancelText: "取消",
1090
1100
  onOk: () => {
1091
- Yo(e);
1101
+ Zo(e);
1092
1102
  }
1093
1103
  });
1094
1104
  }
1095
- function Zo(e, t) {
1105
+ function $o(e, t) {
1096
1106
  if (W.value) return;
1097
- En.value = !0, Y(!1);
1098
- let n = w.value.findIndex((t) => t.id === e), r = ot(w.value, e, t), i = r.findIndex((t) => t.id === e), a = r[i];
1099
- if (!(!a || n === i)) return w.value = r, X(r, ""), _("file-move", u([a])[0], n, i), u([a])[0];
1107
+ kn.value = !0, Y(!1);
1108
+ let n = C.value.findIndex((t) => t.id === e), r = ct(C.value, e, t), i = r.findIndex((t) => t.id === e), a = r[i];
1109
+ if (!(!a || n === i)) return C.value = r, X(r, ""), g("file-move", u([a])[0], n, i), u([a])[0];
1100
1110
  }
1101
- function Qo() {
1111
+ function es() {
1102
1112
  Y(!1);
1103
- let e = rs(C.value ? w.value.flatMap((e) => Te(e.template, { maxPages: _i.value }).map((t) => ({
1113
+ let e = as(S.value ? C.value.flatMap((e) => De(e.template, { maxPages: yi.value }).map((t) => ({
1104
1114
  ...t,
1105
1115
  fileId: e.id
1106
- }))) : Te(Gi(), { maxPages: _i.value }));
1107
- return A.value = e, k.value = !0, _("validate", e), e;
1116
+ }))) : De(qi(), { maxPages: yi.value }));
1117
+ return k.value = e, O.value = !0, g("validate", e), e;
1108
1118
  }
1109
- function $o(e) {
1110
- if (e.fileId && e.fileId !== T.value) {
1111
- qo(e.fileId), v(() => $o({
1119
+ function ts(e) {
1120
+ if (e.fileId && e.fileId !== w.value) {
1121
+ Yo(e.fileId), _(() => ts({
1112
1122
  ...e,
1113
1123
  fileId: void 0
1114
1124
  }));
@@ -1116,70 +1126,70 @@ var Ht = {
1116
1126
  }
1117
1127
  let t = te(e);
1118
1128
  if (t) {
1119
- F.value = !0, v(() => pn.value?.focusField(t));
1129
+ F.value = !0, _(() => gn.value?.focusField(t));
1120
1130
  return;
1121
1131
  }
1122
1132
  if (e.variableKey) {
1123
- Io(e.variableKey);
1133
+ Ro(e.variableKey);
1124
1134
  return;
1125
1135
  }
1126
1136
  if (e.pageId) {
1127
- zo(e.pageId);
1137
+ Vo(e.pageId);
1128
1138
  return;
1129
1139
  }
1130
- let n = E.value.variables.find((t) => t.id === e.id || t.key === e.id);
1140
+ let n = T.value.variables.find((t) => t.id === e.id || t.key === e.id);
1131
1141
  if (n) {
1132
- Fo(n);
1142
+ Lo(n);
1133
1143
  return;
1134
1144
  }
1135
- E.value.pages.some((t) => t.id === e.id) && Lo(e.id);
1145
+ T.value.pages.some((t) => t.id === e.id) && zo(e.id);
1136
1146
  }
1137
- function es(e) {
1147
+ function ns(e) {
1138
1148
  return te(e) ? "页面装饰" : e.type === "variable" ? "变量" : "字段";
1139
1149
  }
1140
- function ts() {
1141
- return Ji(), ge(Gi());
1150
+ function rs() {
1151
+ return Xi(), ve(qi());
1142
1152
  }
1143
- function ns() {
1153
+ function is() {
1144
1154
  let e = Y(!1);
1145
- return at(C.value ? w.value : ut(w.value, T.value, e));
1155
+ return st(S.value ? C.value : ft(C.value, w.value, e));
1146
1156
  }
1147
- function rs(e) {
1157
+ function as(e) {
1148
1158
  let t = /* @__PURE__ */ new Set();
1149
1159
  return e.filter((e) => {
1150
1160
  let n = `${e.fileId ?? ""}|${e.code ?? ""}|${e.id}|${e.pageId ?? ""}|${e.message}`;
1151
1161
  return t.has(n) ? !1 : (t.add(n), !0);
1152
1162
  });
1153
1163
  }
1154
- function is(e) {
1155
- A.value = [...e], k.value = !0;
1164
+ function os(e) {
1165
+ k.value = [...e], O.value = !0;
1156
1166
  }
1157
- function as() {
1158
- A.value = [], k.value = !1;
1167
+ function ss() {
1168
+ k.value = [], O.value = !1;
1159
1169
  }
1160
- function os() {
1161
- j.get(G.value?.id ?? O.value)?.focus();
1170
+ function cs() {
1171
+ A.get(G.value?.id ?? D.value)?.focus();
1162
1172
  }
1163
- function ss(e) {
1164
- Vi(e) && Q({
1173
+ function ls(e) {
1174
+ Ui(e) && Q({
1165
1175
  type: "set-text-align",
1166
1176
  value: e
1167
1177
  });
1168
1178
  }
1169
- function cs(e) {
1170
- (e === "paragraph" || Hi(e)) && Q({
1179
+ function us(e) {
1180
+ (e === "paragraph" || Wi(e)) && Q({
1171
1181
  type: "apply-block-style",
1172
1182
  format: e
1173
1183
  });
1174
1184
  }
1175
- function ls(e) {
1176
- let t = Wi(e);
1185
+ function ds(e) {
1186
+ let t = Ki(e);
1177
1187
  t && (Q({
1178
1188
  type: "set-font-size",
1179
1189
  value: t
1180
- }), Yn.value = "");
1190
+ }), Zn.value = "");
1181
1191
  }
1182
- function us(e) {
1192
+ function fs(e) {
1183
1193
  let t = String(e || "").trim();
1184
1194
  if (!t) {
1185
1195
  Q({ type: "unset-font-family" });
@@ -1190,32 +1200,32 @@ var Ht = {
1190
1200
  value: t
1191
1201
  });
1192
1202
  }
1193
- function ds(e) {
1194
- fs(e.target?.value ?? "");
1203
+ function ps(e) {
1204
+ ms(e.target?.value ?? "");
1195
1205
  }
1196
- function fs(e) {
1206
+ function ms(e) {
1197
1207
  let t = e.trim();
1198
1208
  t && Q({
1199
1209
  type: "set-color",
1200
1210
  value: t
1201
1211
  });
1202
1212
  }
1203
- function ps(e) {
1204
- Yn.value = e;
1205
- }
1206
- function ms() {
1207
- Yn.value.trim() && ls(Yn.value);
1208
- }
1209
1213
  function hs(e) {
1210
- e.key === "Enter" && (e.preventDefault(), ms());
1214
+ Zn.value = e;
1211
1215
  }
1212
- function gs(e) {
1213
- e || (ms(), Yn.value = "");
1216
+ function gs() {
1217
+ Zn.value.trim() && ds(Zn.value);
1214
1218
  }
1215
1219
  function _s(e) {
1220
+ e.key === "Enter" && (e.preventDefault(), gs());
1221
+ }
1222
+ function vs(e) {
1223
+ e || (gs(), Zn.value = "");
1224
+ }
1225
+ function ys(e) {
1216
1226
  if (W.value) return;
1217
- O.value = e.pageId, I.value = !1, L.value = !1, B.value = void 0, V.value = void 0, fr.value = !1, pr.value = "";
1218
- let t = vt(e.clientX, e.clientY, 304, 300);
1227
+ D.value = e.pageId, I.value = !1, L.value = !1, B.value = void 0, V.value = void 0, mr.value = !1, hr.value = "";
1228
+ let t = bt(e.clientX, e.clientY, 304, 300);
1219
1229
  R.value = {
1220
1230
  pageId: e.pageId,
1221
1231
  x: t.x,
@@ -1223,208 +1233,208 @@ var Ht = {
1223
1233
  hasSelection: e.hasSelection,
1224
1234
  selectionWidth: e.selectionWidth,
1225
1235
  leadingText: e.leadingText
1226
- }, v(() => {
1227
- vs(), or.value?.focusFirstButton();
1236
+ }, _(() => {
1237
+ bs(), cr.value?.focusFirstButton();
1228
1238
  });
1229
1239
  }
1230
- function vs() {
1231
- let e = or.value?.getMenuElement(), t = R.value;
1240
+ function bs() {
1241
+ let e = cr.value?.getMenuElement(), t = R.value;
1232
1242
  if (!e || !t) return;
1233
- let n = yt(t.x, t.y, e);
1243
+ let n = xt(t.x, t.y, e);
1234
1244
  R.value = {
1235
1245
  ...t,
1236
1246
  x: n.x,
1237
1247
  y: n.y
1238
1248
  };
1239
1249
  }
1240
- function ys(e) {
1250
+ function xs(e) {
1241
1251
  if (W.value) return;
1242
- O.value = e.pageId, I.value = !1, L.value = !1, R.value = void 0, V.value = void 0;
1243
- let t = vt(e.clientX, e.clientY, 248, 400);
1252
+ D.value = e.pageId, I.value = !1, L.value = !1, R.value = void 0, V.value = void 0;
1253
+ let t = bt(e.clientX, e.clientY, 248, 400);
1244
1254
  B.value = {
1245
1255
  ...e,
1246
1256
  x: t.x,
1247
1257
  y: t.y
1248
- }, v(() => {
1249
- let e = mr.value?.getMenuElement(), t = B.value;
1258
+ }, _(() => {
1259
+ let e = gr.value?.getMenuElement(), t = B.value;
1250
1260
  if (e && t) {
1251
- let n = yt(t.x, t.y, e);
1261
+ let n = xt(t.x, t.y, e);
1252
1262
  B.value = {
1253
1263
  ...t,
1254
1264
  x: n.x,
1255
1265
  y: n.y
1256
1266
  };
1257
1267
  }
1258
- mr.value?.focusFirstItem();
1268
+ gr.value?.focusFirstItem();
1259
1269
  });
1260
1270
  }
1261
- function bs(e) {
1271
+ function Ss(e) {
1262
1272
  if (W.value) return;
1263
- O.value = e.pageId, I.value = !1, L.value = !1, R.value = void 0, B.value = void 0, gr.value = e.image.width, _r.value = e.image.height, D.value = "";
1264
- let t = vt(e.clientX, e.clientY, 288, 196);
1273
+ D.value = e.pageId, I.value = !1, L.value = !1, R.value = void 0, B.value = void 0, vr.value = e.image.width, yr.value = e.image.height, E.value = "";
1274
+ let t = bt(e.clientX, e.clientY, 288, 196);
1265
1275
  V.value = {
1266
1276
  pageId: e.pageId,
1267
1277
  image: e.image,
1268
1278
  x: t.x,
1269
1279
  y: t.y
1270
- }, v(() => {
1271
- xs(), hr.value?.getMenuElement()?.querySelector("input, button:not(:disabled)")?.focus();
1280
+ }, _(() => {
1281
+ Cs(), _r.value?.getMenuElement()?.querySelector("input, button:not(:disabled)")?.focus();
1272
1282
  });
1273
1283
  }
1274
- function xs() {
1275
- let e = hr.value?.getMenuElement(), t = V.value;
1284
+ function Cs() {
1285
+ let e = _r.value?.getMenuElement(), t = V.value;
1276
1286
  if (!e || !t) return;
1277
- let n = yt(t.x, t.y, e);
1287
+ let n = xt(t.x, t.y, e);
1278
1288
  V.value = {
1279
1289
  ...t,
1280
1290
  x: n.x,
1281
1291
  y: n.y
1282
1292
  };
1283
1293
  }
1284
- function Ss() {
1294
+ function ws() {
1285
1295
  let e = V.value;
1286
- !e || W.value || (j.get(e.pageId)?.updateSelectedContentImage({
1287
- width: ke(gr.value),
1288
- height: ke(_r.value)
1296
+ !e || W.value || (A.get(e.pageId)?.updateSelectedContentImage({
1297
+ width: je(vr.value),
1298
+ height: je(yr.value)
1289
1299
  }) && (H.value = "已更新图片尺寸"), $());
1290
1300
  }
1291
- function Cs() {
1301
+ function Ts() {
1292
1302
  let e = V.value;
1293
- !e || W.value || (j.get(e.pageId)?.updateSelectedContentImage({
1303
+ !e || W.value || (A.get(e.pageId)?.updateSelectedContentImage({
1294
1304
  width: void 0,
1295
1305
  height: void 0
1296
1306
  }) && (H.value = "已恢复图片自然尺寸"), $());
1297
1307
  }
1298
- function ws(e) {
1299
- e.type === "table" ? ys(e) : e.type === "image" ? bs(e) : _s(e);
1308
+ function Es(e) {
1309
+ e.type === "table" ? xs(e) : e.type === "image" ? Ss(e) : ys(e);
1300
1310
  }
1301
1311
  function $() {
1302
- R.value = void 0, B.value = void 0, V.value = void 0, fr.value = !1, pr.value = "";
1312
+ R.value = void 0, B.value = void 0, V.value = void 0, mr.value = !1, hr.value = "";
1303
1313
  }
1304
- function Ts() {
1305
- Lr(!1), I.value = !1, L.value = !1, qn.value = !1, Xn.value = !1, Zn.value = !1, Qn.value = !1, $n.value = !1;
1314
+ function Ds() {
1315
+ zr(!1), I.value = !1, L.value = !1, Yn.value = !1, Qn.value = !1, $n.value = !1, er.value = !1, tr.value = !1;
1306
1316
  }
1307
- function Es() {
1308
- Ts(), P.value = !P.value, v(() => bo(() => fn.value?.focusChromeToggle()));
1317
+ function Os() {
1318
+ Ds(), N.value = !N.value, _(() => So(() => hn.value?.focusChromeToggle()));
1309
1319
  }
1310
- let Ds = [
1320
+ let ks = [
1311
1321
  ".gd-contract-template-designer__context-menu",
1312
1322
  ".gd-contract-template-designer__bubble-menu",
1313
1323
  ".gd-contract-template-designer__bubble-menu-popup"
1314
1324
  ].join(",");
1315
- function Os() {
1316
- let e = W.value || ur.value || cr.value || Hr.value || F.value || Pn.value, t = O.value, n = e ? void 0 : j.get(t)?.getSelectionViewportRect();
1325
+ function As() {
1326
+ let e = W.value || fr.value || ur.value || Wr.value || F.value || Ln.value, t = D.value, n = e ? void 0 : A.get(t)?.getSelectionViewportRect();
1317
1327
  if (!n) {
1318
1328
  z.value = void 0;
1319
1329
  return;
1320
1330
  }
1321
- let r = n.top - 40 - rn, i = r >= 12 ? r : n.bottom + rn, a = vt((n.left + n.right) / 2 - 380 / 2, i, 380, 40);
1331
+ let r = n.top - 40 - sn, i = r >= 12 ? r : n.bottom + sn, a = bt((n.left + n.right) / 2 - 380 / 2, i, 380, 40);
1322
1332
  z.value = {
1323
1333
  pageId: t,
1324
1334
  x: a.x,
1325
1335
  y: a.y
1326
- }, v(() => ks(n));
1336
+ }, _(() => js(n));
1327
1337
  }
1328
- function ks(e) {
1329
- let t = sr.value?.getMenuElement(), n = z.value;
1338
+ function js(e) {
1339
+ let t = lr.value?.getMenuElement(), n = z.value;
1330
1340
  if (!t || !n) return;
1331
- let r = t.getBoundingClientRect(), i = e.top - r.height - rn, a = i >= 12 ? i : e.bottom + rn, o = yt((e.left + e.right) / 2 - r.width / 2, a, t);
1341
+ let r = t.getBoundingClientRect(), i = e.top - r.height - sn, a = i >= 12 ? i : e.bottom + sn, o = xt((e.left + e.right) / 2 - r.width / 2, a, t);
1332
1342
  z.value = {
1333
1343
  ...n,
1334
1344
  x: o.x,
1335
1345
  y: o.y
1336
1346
  };
1337
1347
  }
1338
- function As() {
1339
- let e = z.value?.pageId ?? O.value, t = j.get(e)?.getSelectionRange();
1340
- lr = t ? {
1348
+ function Ms() {
1349
+ let e = z.value?.pageId ?? D.value, t = A.get(e)?.getSelectionRange();
1350
+ dr = t ? {
1341
1351
  pageId: e,
1342
1352
  ...t
1343
- } : void 0, cr.value = !0, z.value = void 0;
1353
+ } : void 0, ur.value = !0, z.value = void 0;
1344
1354
  }
1345
- function js(e) {
1346
- if (!cr.value) return;
1347
- let t = lr, n = j.get(e)?.getSelectionRange();
1348
- t && n && t.pageId === e && t.from === n.from && t.to === n.to || (cr.value = !1, lr = void 0);
1355
+ function Ns(e) {
1356
+ if (!ur.value) return;
1357
+ let t = dr, n = A.get(e)?.getSelectionRange();
1358
+ t && n && t.pageId === e && t.from === n.from && t.to === n.to || (ur.value = !1, dr = void 0);
1349
1359
  }
1350
- function Ms() {
1351
- !z.value || dr !== void 0 || (dr = requestAnimationFrame(() => {
1352
- dr = void 0, Os();
1360
+ function Ps() {
1361
+ !z.value || pr !== void 0 || (pr = requestAnimationFrame(() => {
1362
+ pr = void 0, As();
1353
1363
  }));
1354
1364
  }
1355
- function Ns() {
1356
- ur.value && (ur.value = !1, Os());
1365
+ function Fs() {
1366
+ fr.value && (fr.value = !1, As());
1357
1367
  }
1358
- function Ps() {
1359
- $(), Ms();
1368
+ function Is() {
1369
+ $(), Ps();
1360
1370
  }
1361
- function Fs(e, t) {
1362
- j.get(z.value?.pageId ?? O.value)?.requestTextContextMenu(e, t);
1371
+ function Ls(e, t) {
1372
+ A.get(z.value?.pageId ?? D.value)?.requestTextContextMenu(e, t);
1363
1373
  }
1364
- function Is(e) {
1374
+ function Rs(e) {
1365
1375
  let t = e.target instanceof Element ? e.target : null;
1366
- t?.closest(".ProseMirror") && (ur.value = !0, z.value = void 0), !(!R.value && !B.value && !V.value && !z.value) && (t?.closest(Ds) || ($(), z.value && As()));
1376
+ t?.closest(".ProseMirror") && (fr.value = !0, z.value = void 0), !(!R.value && !B.value && !V.value && !z.value) && (t?.closest(ks) || ($(), z.value && Ms()));
1367
1377
  }
1368
- function Ls(e) {
1369
- (e.target instanceof Element ? e.target : null)?.closest(Ds) || ($(), Ms());
1378
+ function zs(e) {
1379
+ (e.target instanceof Element ? e.target : null)?.closest(ks) || ($(), Ps());
1370
1380
  }
1371
- function Rs(e) {
1372
- let t = on.value;
1381
+ function Bs(e) {
1382
+ let t = ln.value;
1373
1383
  if (!t || typeof document > "u") return !1;
1374
1384
  let n = e.target instanceof Node ? e.target : void 0, r = document.activeElement;
1375
1385
  return !!(n && t.contains(n) || r && t.contains(r) || n instanceof Element && n.closest(".gd-contract-template-designer__context-menu"));
1376
1386
  }
1377
- function zs(e) {
1387
+ function Vs(e) {
1378
1388
  if (e.key !== "Escape" || !F.value || typeof document > "u") return;
1379
- let t = on.value?.querySelector(".gd-contract-template-designer__page-decorations-studio");
1389
+ let t = ln.value?.querySelector(".gd-contract-template-designer__page-decorations-studio");
1380
1390
  if (!t) return;
1381
- let n = e.target instanceof Element ? e.target : null, r = document.activeElement instanceof Element ? document.activeElement : null, i = !!(n?.closest(br) || r?.closest(br)), a = !!(n && t.contains(n) || r && t.contains(r)), o = !!t.querySelector(".ant-select-open, .ant-dropdown-open");
1391
+ let n = e.target instanceof Element ? e.target : null, r = document.activeElement instanceof Element ? document.activeElement : null, i = !!(n?.closest(Sr) || r?.closest(Sr)), a = !!(n && t.contains(n) || r && t.contains(r)), o = !!t.querySelector(".ant-select-open, .ant-dropdown-open");
1382
1392
  if (i || a && o) {
1383
- yr.add(e);
1393
+ xr.add(e);
1384
1394
  return;
1385
1395
  }
1386
- !Hr.value && (a || e.target === document) && (e.preventDefault(), e.stopPropagation(), Vo());
1396
+ !Wr.value && (a || e.target === document) && (e.preventDefault(), e.stopPropagation(), Uo());
1387
1397
  }
1388
- function Bs(e) {
1398
+ function Hs(e) {
1389
1399
  if ((e.ctrlKey || e.metaKey) && !e.altKey && e.key.toLowerCase() === "s") {
1390
- if (!Ur.value || !Rs(e)) return;
1391
- e.preventDefault(), Ci();
1400
+ if (!Gr.value || !Bs(e)) return;
1401
+ e.preventDefault(), Ti();
1392
1402
  return;
1393
1403
  }
1394
1404
  if (e.key === "Escape") {
1395
- if (yr.has(e)) {
1396
- yr.delete(e);
1405
+ if (xr.has(e)) {
1406
+ xr.delete(e);
1397
1407
  return;
1398
1408
  }
1399
- let t = Hr.value, n = t || F.value;
1400
- if (!t && F.value && Vo(), $(), Ts(), n && e.stopPropagation(), !n) {
1409
+ let t = Wr.value, n = t || F.value;
1410
+ if (!t && F.value && Uo(), $(), Ds(), n && e.stopPropagation(), !n) {
1401
1411
  if (z.value) {
1402
- As(), e.stopPropagation();
1412
+ Ms(), e.stopPropagation();
1403
1413
  return;
1404
1414
  }
1405
- Wn.value ? So() : N.value = !1;
1415
+ P.value ? wo() : M.value = !1;
1406
1416
  }
1407
1417
  }
1408
1418
  }
1409
- function Vs(e, t) {
1410
- e === O.value && t.selectedContentImage && (D.value = ""), e === O.value && (js(e), Os());
1411
- let n = Jn.value[e];
1412
- n && _t(n, t) || (Jn.value = {
1413
- ...Jn.value,
1419
+ function Us(e, t) {
1420
+ e === D.value && t.selectedContentImage && (E.value = ""), e === D.value && (Ns(e), As());
1421
+ let n = Xn.value[e];
1422
+ n && yt(n, t) || (Xn.value = {
1423
+ ...Xn.value,
1414
1424
  [e]: t
1415
1425
  });
1416
1426
  }
1417
- function Hs(e = vr.value.rows, t = vr.value.cols) {
1427
+ function Ws(e = br.value.rows, t = br.value.cols) {
1418
1428
  Q({
1419
1429
  type: "insert-table",
1420
1430
  options: {
1421
1431
  rows: Math.min(10, Math.max(1, Math.round(Number(e) || 3))),
1422
1432
  cols: Math.min(10, Math.max(1, Math.round(Number(t) || 3))),
1423
- withHeaderRow: !!vr.value.withHeaderRow
1433
+ withHeaderRow: !!br.value.withHeaderRow
1424
1434
  }
1425
1435
  }), I.value = !1, $();
1426
1436
  }
1427
- let Us = {
1437
+ let Gs = {
1428
1438
  "delete-table-row": {
1429
1439
  label: "删除当前行",
1430
1440
  countKey: "deleteRow"
@@ -1438,34 +1448,34 @@ var Ht = {
1438
1448
  countKey: "deleteTable"
1439
1449
  }
1440
1450
  };
1441
- function Ws(e) {
1451
+ function Ks(e) {
1442
1452
  let t = B.value;
1443
1453
  if (!t) return;
1444
1454
  let n = () => {
1445
1455
  Q(e, t.pageId), $();
1446
- }, r = Us[e.type];
1456
+ }, r = Gs[e.type];
1447
1457
  if (!r) {
1448
1458
  n();
1449
1459
  return;
1450
1460
  }
1451
1461
  let i = t.affectedVariableCounts[r.countKey];
1452
- $(), It.confirm({
1462
+ $(), zt.confirm({
1453
1463
  title: r.label,
1454
1464
  content: i ? `此操作将移除 ${i} 个正文变量节点,是否继续?` : "此操作将修改表格结构,是否继续?",
1455
1465
  okText: "确认",
1456
1466
  okType: "danger",
1457
1467
  cancelText: "取消",
1458
1468
  onOk: n,
1459
- onCancel: () => j.get(t.pageId)?.focus()
1469
+ onCancel: () => A.get(t.pageId)?.focus()
1460
1470
  });
1461
1471
  }
1462
- function Gs(e) {
1463
- let t = mr.value?.getMenuElement();
1472
+ function qs(e) {
1473
+ let t = gr.value?.getMenuElement();
1464
1474
  if (!t) return;
1465
1475
  if (e.key === "Escape") {
1466
1476
  e.preventDefault(), e.stopPropagation();
1467
1477
  let t = B.value?.pageId;
1468
- $(), j.get(t ?? "")?.focus();
1478
+ $(), A.get(t ?? "")?.focus();
1469
1479
  return;
1470
1480
  }
1471
1481
  let n = Array.from(t.querySelectorAll("button:not(:disabled)"));
@@ -1483,114 +1493,114 @@ var Ht = {
1483
1493
  let r = (Math.max(0, n.indexOf(document.activeElement)) + (e.key === "ArrowUp" || e.key === "ArrowLeft" ? -1 : 1) + n.length) % n.length;
1484
1494
  e.preventDefault(), n[r]?.focus();
1485
1495
  }
1486
- function Ks(e) {
1496
+ function Js(e) {
1487
1497
  if (e.key !== "Escape") return;
1488
1498
  e.preventDefault(), e.stopPropagation();
1489
1499
  let t = R.value?.pageId;
1490
- $(), j.get(t ?? "")?.focus();
1500
+ $(), A.get(t ?? "")?.focus();
1491
1501
  }
1492
- function qs(e) {
1502
+ function Ys(e) {
1493
1503
  if (e.key !== "Escape") return;
1494
1504
  e.preventDefault(), e.stopPropagation();
1495
1505
  let t = V.value?.pageId;
1496
- $(), j.get(t ?? "")?.focus();
1506
+ $(), A.get(t ?? "")?.focus();
1497
1507
  }
1498
- function Js(e) {
1508
+ function Xs(e) {
1499
1509
  Q({ type: e }), L.value = !1, $();
1500
1510
  }
1501
- return Ze({
1502
- getValue: Ho,
1503
- setValue: Uo,
1504
- getFiles: Wo,
1505
- setFiles: Go,
1506
- addFile: Ko,
1507
- selectFile: qo,
1508
- renameFile: Jo,
1509
- removeFile: Yo,
1510
- moveFile: Zo,
1511
- validate: Qo,
1512
- exportTemplate: ts,
1513
- exportFiles: ns,
1514
- getSubmitData: Eo,
1515
- clearTemplate: Mo,
1516
- saveDraftCache: Ci,
1517
- loadDraftCache: wi,
1518
- clearDraftCache: Ti,
1519
- getDraftCacheStatus: ta,
1520
- insertVariable: $a,
1521
- insertImage: Aa,
1522
- focus: os,
1523
- openPreview: wo,
1524
- closePreview: To,
1525
- openSubmitDataViewer: Do,
1526
- closeSubmitDataViewer: Oo,
1527
- getVariableData: ko,
1528
- openVariableDataViewer: Ao,
1529
- closeVariableDataViewer: jo,
1530
- setServerValidationErrors: is,
1531
- clearValidationErrors: as,
1532
- scrollToVariable: Io,
1533
- scrollToPage: zo,
1534
- setZoom: mo,
1535
- resetZoom: ho,
1536
- getZoom: go,
1537
- fitWidth: lo
1538
- }), (e, t) => (y(), St("div", {
1511
+ return $e({
1512
+ getValue: Wo,
1513
+ setValue: Go,
1514
+ getFiles: Ko,
1515
+ setFiles: qo,
1516
+ addFile: Jo,
1517
+ selectFile: Yo,
1518
+ renameFile: Xo,
1519
+ removeFile: Zo,
1520
+ moveFile: $o,
1521
+ validate: es,
1522
+ exportTemplate: rs,
1523
+ exportFiles: is,
1524
+ getSubmitData: Oo,
1525
+ clearTemplate: Po,
1526
+ saveDraftCache: Ti,
1527
+ loadDraftCache: Ei,
1528
+ clearDraftCache: Di,
1529
+ getDraftCacheStatus: ra,
1530
+ insertVariable: to,
1531
+ insertImage: Ma,
1532
+ focus: cs,
1533
+ openPreview: Eo,
1534
+ closePreview: Do,
1535
+ openSubmitDataViewer: ko,
1536
+ closeSubmitDataViewer: Ao,
1537
+ getVariableData: jo,
1538
+ openVariableDataViewer: Mo,
1539
+ closeVariableDataViewer: No,
1540
+ setServerValidationErrors: os,
1541
+ clearValidationErrors: ss,
1542
+ scrollToVariable: Ro,
1543
+ scrollToPage: Vo,
1544
+ setZoom: go,
1545
+ resetZoom: _o,
1546
+ getZoom: vo,
1547
+ fitWidth: fo
1548
+ }), (e, t) => (v(), Tt("div", {
1539
1549
  ref_key: "designerElement",
1540
- ref: on,
1541
- class: wt(["gd-contract-template-designer", {
1550
+ ref: ln,
1551
+ class: Dt(["gd-contract-template-designer", {
1542
1552
  "is-disabled": s.disabled,
1543
1553
  "is-readonly": W.value,
1544
- "is-fullscreen": N.value,
1545
- "is-immersive": Wn.value
1554
+ "is-fullscreen": M.value,
1555
+ "is-immersive": P.value
1546
1556
  }]),
1547
- style: Tt(an.value),
1548
- onKeydownCapture: t[31] ||= (...e) => x(Vr) && x(Vr)(...e)
1557
+ style: Ot(cn.value),
1558
+ onKeydownCapture: t[31] ||= (...e) => b(Ur) && b(Ur)(...e)
1549
1559
  }, [
1550
- C.value ? (y(), p(pt, {
1560
+ S.value ? (v(), wt(ht, {
1551
1561
  key: 0,
1552
- files: w.value,
1553
- "active-file-id": T.value,
1562
+ files: C.value,
1563
+ "active-file-id": w.value,
1554
1564
  readonly: W.value,
1555
- onSelect: qo,
1556
- onAdd: t[0] ||= (e) => Ko(),
1557
- onRename: Jo,
1558
- onRemove: Xo,
1559
- onMove: Zo
1565
+ onSelect: Yo,
1566
+ onAdd: t[0] ||= (e) => Jo(),
1567
+ onRename: Xo,
1568
+ onRemove: Qo,
1569
+ onMove: $o
1560
1570
  }, null, 8, [
1561
1571
  "files",
1562
1572
  "active-file-id",
1563
1573
  "readonly"
1564
- ])) : m("", !0),
1565
- h("div", { class: wt(["gd-contract-template-designer__layout", {
1566
- "is-sidebar-collapsed": Hn.value,
1567
- "is-inspector-collapsed": Un.value
1574
+ ])) : p("", !0),
1575
+ m("div", { class: Dt(["gd-contract-template-designer__layout", {
1576
+ "is-sidebar-collapsed": Gn.value,
1577
+ "is-inspector-collapsed": Kn.value
1568
1578
  }]) }, [
1569
- g(mt, {
1570
- collapsed: Hn.value,
1571
- "file-id": T.value,
1572
- pages: E.value.pages,
1573
- variables: E.value.variables,
1574
- "decoration-variable-keys": yi.value,
1575
- "active-page-id": O.value,
1576
- "selected-variable-key": D.value,
1577
- "normalized-max-pages": _i.value,
1578
- "page-limit-reached": vi.value,
1579
+ h(gt, {
1580
+ collapsed: Gn.value,
1581
+ "file-id": w.value,
1582
+ pages: T.value.pages,
1583
+ variables: T.value.variables,
1584
+ "decoration-variable-keys": xi.value,
1585
+ "active-page-id": D.value,
1586
+ "selected-variable-key": E.value,
1587
+ "normalized-max-pages": yi.value,
1588
+ "page-limit-reached": bi.value,
1579
1589
  "selected-page": G.value,
1580
- "selected-page-size": Jr.value,
1581
- "normalized-page-size-options": ui.value,
1582
- "page-size-options": di.value,
1583
- "selected-page-size-option-value": fi.value,
1590
+ "selected-page-size": Xr.value,
1591
+ "normalized-page-size-options": fi.value,
1592
+ "page-size-options": pi.value,
1593
+ "selected-page-size-option-value": mi.value,
1584
1594
  readonly: W.value,
1585
- "get-page-size": da,
1586
- onToggle: t[1] ||= (e) => Hn.value = !Hn.value,
1587
- onAddPage: ma,
1588
- onActivatePage: Lo,
1589
- onNavigateOutline: Ro,
1590
- onDuplicatePage: ha,
1591
- onRemovePage: _a,
1592
- onPatchPageFormat: fa,
1593
- onScrollToVariable: Fo
1595
+ "get-page-size": pa,
1596
+ onToggle: t[1] ||= (e) => Gn.value = !Gn.value,
1597
+ onAddPage: ga,
1598
+ onActivatePage: zo,
1599
+ onNavigateOutline: Bo,
1600
+ onDuplicatePage: _a,
1601
+ onRemovePage: ya,
1602
+ onPatchPageFormat: ma,
1603
+ onScrollToVariable: Lo
1594
1604
  }, null, 8, [
1595
1605
  "collapsed",
1596
1606
  "file-id",
@@ -1608,71 +1618,71 @@ var Ht = {
1608
1618
  "selected-page-size-option-value",
1609
1619
  "readonly"
1610
1620
  ]),
1611
- h("main", {
1621
+ m("main", {
1612
1622
  ref_key: "workspaceElement",
1613
- ref: dn,
1623
+ ref: mn,
1614
1624
  class: "gd-contract-template-designer__workspace"
1615
1625
  }, [
1616
- Pt(h("div", {
1617
- id: hn,
1626
+ Lt(m("div", {
1627
+ id: vn,
1618
1628
  class: "gd-contract-template-designer__workspace-chrome"
1619
- }, [g(ze, {
1629
+ }, [h(Ve, {
1620
1630
  ref_key: "workspaceHeaderElement",
1621
- ref: fn,
1622
- summary: Zr.value,
1623
- "draft-cache-status-text": ti.value,
1624
- "draft-cache-status-class": ni.value,
1631
+ ref: hn,
1632
+ summary: $r.value,
1633
+ "draft-cache-status-text": ri.value,
1634
+ "draft-cache-status-class": ii.value,
1625
1635
  "show-draft-cache-status": s.showDraftCacheStatus,
1626
1636
  "show-clear-button": s.showClearButton,
1627
1637
  "show-submit-data-viewer": s.showSubmitDataViewer,
1628
1638
  "show-variable-data-viewer": s.showVariableDataViewer,
1629
1639
  readonly: W.value,
1630
- "zoom-percent": ri.value,
1631
- "zoom-out-disabled": M.value <= Kt,
1632
- "zoom-in-disabled": M.value >= qt,
1633
- "is-fullscreen": N.value,
1634
- immersive: Wn.value,
1640
+ "zoom-percent": ai.value,
1641
+ "zoom-out-disabled": j.value <= Yt,
1642
+ "zoom-in-disabled": j.value >= Xt,
1643
+ "is-fullscreen": M.value,
1644
+ immersive: P.value,
1635
1645
  "page-decorations-open": F.value,
1636
- "page-decorations-studio-id": mn,
1637
- "page-decorations-preset-label": Qr.value,
1638
- "page-decorations-enabled-count": ei.value,
1639
- "page-decorations-enabled-states": $r.value,
1640
- "chrome-controls-id": hn,
1641
- onZoomOut: vo,
1642
- onZoomIn: _o,
1643
- onFitWidth: x(lo),
1644
- onResetZoom: ho,
1645
- onToggleFullscreen: yo,
1646
- onToggleImmersive: Co,
1647
- onClear: No,
1648
- onValidate: Qo,
1649
- onPreview: wo,
1650
- onSubmitData: Do,
1651
- onVariableData: Ao,
1652
- onTogglePageDecorations: Bo,
1653
- onToggleChrome: Es
1646
+ "page-decorations-studio-id": _n,
1647
+ "page-decorations-preset-label": ei.value,
1648
+ "page-decorations-enabled-count": ni.value,
1649
+ "page-decorations-enabled-states": ti.value,
1650
+ "chrome-controls-id": vn,
1651
+ onZoomOut: bo,
1652
+ onZoomIn: yo,
1653
+ onFitWidth: b(fo),
1654
+ onResetZoom: _o,
1655
+ onToggleFullscreen: xo,
1656
+ onToggleImmersive: To,
1657
+ onClear: Fo,
1658
+ onValidate: es,
1659
+ onPreview: Eo,
1660
+ onSubmitData: ko,
1661
+ onVariableData: Mo,
1662
+ onTogglePageDecorations: Ho,
1663
+ onToggleChrome: Os
1654
1664
  }, {
1655
- authoring: Nt(() => [g(He, {
1665
+ authoring: It(() => [h(We, {
1656
1666
  ref_key: "authoringBarElement",
1657
- ref: vn,
1667
+ ref: xn,
1658
1668
  compact: "",
1659
- query: x(Or),
1660
- "onUpdate:query": t[2] ||= (e) => Ct(Or) ? Or.value = e : null,
1661
- replacement: x(kr),
1662
- "onUpdate:replacement": t[3] ||= (e) => Ct(kr) ? kr.value = e : null,
1663
- "match-case": x(Ar),
1664
- "onUpdate:matchCase": t[4] ||= (e) => Ct(Ar) ? Ar.value = e : null,
1665
- panel: x(Dr),
1669
+ query: b(Ar),
1670
+ "onUpdate:query": t[2] ||= (e) => Et(Ar) ? Ar.value = e : null,
1671
+ replacement: b(jr),
1672
+ "onUpdate:replacement": t[3] ||= (e) => Et(jr) ? jr.value = e : null,
1673
+ "match-case": b(Mr),
1674
+ "onUpdate:matchCase": t[4] ||= (e) => Et(Mr) ? Mr.value = e : null,
1675
+ panel: b(kr),
1666
1676
  readonly: W.value,
1667
- total: x(jr).length,
1668
- "current-index": x(Mr),
1669
- "current-page": x(Nr) ? x(Nr).pageIndex + 1 : void 0,
1670
- feedback: x(Pr),
1671
- onOpen: x(Ir),
1672
- onClose: t[5] ||= (e) => x(Lr)(),
1673
- onNavigate: x(Rr),
1674
- onReplaceCurrent: x(zr),
1675
- onReplaceAll: x(Br)
1677
+ total: b(Nr).length,
1678
+ "current-index": b(Pr),
1679
+ "current-page": b(Fr) ? b(Fr).pageIndex + 1 : void 0,
1680
+ feedback: b(Ir),
1681
+ onOpen: b(Rr),
1682
+ onClose: t[5] ||= (e) => b(zr)(),
1683
+ onNavigate: b(Br),
1684
+ onReplaceCurrent: b(Vr),
1685
+ onReplaceAll: b(Hr)
1676
1686
  }, null, 8, [
1677
1687
  "query",
1678
1688
  "replacement",
@@ -1708,138 +1718,138 @@ var Ht = {
1708
1718
  "page-decorations-enabled-count",
1709
1719
  "page-decorations-enabled-states",
1710
1720
  "onFitWidth"
1711
- ]), g(Ve, {
1712
- "variable-insert-popover-open": Xn.value,
1713
- "onUpdate:variableInsertPopoverOpen": t[6] ||= (e) => Xn.value = e,
1714
- "signing-layout-popover-open": Qn.value,
1715
- "onUpdate:signingLayoutPopoverOpen": t[7] ||= (e) => Qn.value = e,
1716
- "signing-mark-popover-open": $n.value,
1717
- "onUpdate:signingMarkPopoverOpen": t[8] ||= (e) => $n.value = e,
1718
- "image-insert-popover-open": Zn.value,
1719
- "onUpdate:imageInsertPopoverOpen": t[9] ||= (e) => Zn.value = e,
1720
- "image-insert-url": tr.value,
1721
- "onUpdate:imageInsertUrl": t[10] ||= (e) => tr.value = e,
1722
- "image-insert-width": nr.value,
1723
- "onUpdate:imageInsertWidth": t[11] ||= (e) => nr.value = e,
1724
- "image-insert-height": rr.value,
1725
- "onUpdate:imageInsertHeight": t[12] ||= (e) => rr.value = e,
1721
+ ]), h(Ue, {
1722
+ "variable-insert-popover-open": Qn.value,
1723
+ "onUpdate:variableInsertPopoverOpen": t[6] ||= (e) => Qn.value = e,
1724
+ "signing-layout-popover-open": er.value,
1725
+ "onUpdate:signingLayoutPopoverOpen": t[7] ||= (e) => er.value = e,
1726
+ "signing-mark-popover-open": tr.value,
1727
+ "onUpdate:signingMarkPopoverOpen": t[8] ||= (e) => tr.value = e,
1728
+ "image-insert-popover-open": $n.value,
1729
+ "onUpdate:imageInsertPopoverOpen": t[9] ||= (e) => $n.value = e,
1730
+ "image-insert-url": rr.value,
1731
+ "onUpdate:imageInsertUrl": t[10] ||= (e) => rr.value = e,
1732
+ "image-insert-width": ir.value,
1733
+ "onUpdate:imageInsertWidth": t[11] ||= (e) => ir.value = e,
1734
+ "image-insert-height": ar.value,
1735
+ "onUpdate:imageInsertHeight": t[12] ||= (e) => ar.value = e,
1726
1736
  "table-insert-popover-open": I.value,
1727
1737
  "onUpdate:tableInsertPopoverOpen": t[13] ||= (e) => I.value = e,
1728
1738
  "table-actions-popover-open": L.value,
1729
1739
  "onUpdate:tableActionsPopoverOpen": t[14] ||= (e) => L.value = e,
1730
- "table-insert-draft": vr.value,
1731
- "onUpdate:tableInsertDraft": t[15] ||= (e) => vr.value = e,
1732
- "toolbar-more-open": qn.value,
1733
- "onUpdate:toolbarMoreOpen": t[16] ||= (e) => qn.value = e,
1740
+ "table-insert-draft": br.value,
1741
+ "onUpdate:tableInsertDraft": t[15] ||= (e) => br.value = e,
1742
+ "toolbar-more-open": Yn.value,
1743
+ "onUpdate:toolbarMoreOpen": t[16] ||= (e) => Yn.value = e,
1734
1744
  readonly: W.value,
1735
1745
  "editor-state": J.value,
1736
- "current-block-format": Ni.value,
1737
- "block-format-options": si,
1738
- "font-family-select-options": ai.value,
1739
- "current-editor-font-family": Pi.value,
1740
- "font-size-preset-options": Ri.value,
1741
- "current-editor-font-size": Fi.value,
1742
- "editor-font-size-search-value": Yn.value,
1743
- "current-editor-text-color": Ii.value,
1744
- "body-control-tool-items": gi.value,
1745
- "signing-layout-presets": hi.value,
1746
- "page-limit-reached": vi.value,
1747
- "normalized-max-pages": _i.value,
1748
- "image-processing": ar.value,
1749
- "image-insert-error": ir.value,
1746
+ "current-block-format": Fi.value,
1747
+ "block-format-options": li,
1748
+ "font-family-select-options": si.value,
1749
+ "current-editor-font-family": Ii.value,
1750
+ "font-size-preset-options": Bi.value,
1751
+ "current-editor-font-size": Li.value,
1752
+ "editor-font-size-search-value": Zn.value,
1753
+ "current-editor-text-color": Ri.value,
1754
+ "body-control-tool-items": vi.value,
1755
+ "signing-layout-presets": _i.value,
1756
+ "page-limit-reached": bi.value,
1757
+ "normalized-max-pages": yi.value,
1758
+ "image-processing": sr.value,
1759
+ "image-insert-error": or.value,
1750
1760
  onCommand: t[17] ||= (e) => Q(e),
1751
- onPatchBlockFormat: cs,
1752
- onPatchFontFamily: us,
1753
- onPatchFontSize: ls,
1754
- onPatchColor: ds,
1755
- onPatchTextAlign: ss,
1756
- onInsertVariable: Pa,
1757
- onInsertSigningLayout: ra,
1758
- onInsertSigningMark: oa,
1759
- onOpenSigningLayoutCustom: aa,
1760
- onOpenImageFile: ja,
1761
- onInsertImageUrl: Na,
1762
- onAddPage: ma,
1763
- onInsertTable: Hs,
1764
- onTableAction: Js,
1765
- onFontSizeSearch: ps,
1766
- onFontSizeCommit: ms,
1767
- onFontSizeDropdownChange: gs,
1768
- onFontSizeKeydown: hs
1769
- }, null, 8, /* @__PURE__ */ "variable-insert-popover-open.signing-layout-popover-open.signing-mark-popover-open.image-insert-popover-open.image-insert-url.image-insert-width.image-insert-height.table-insert-popover-open.table-actions-popover-open.table-insert-draft.toolbar-more-open.readonly.editor-state.current-block-format.font-family-select-options.current-editor-font-family.font-size-preset-options.current-editor-font-size.editor-font-size-search-value.current-editor-text-color.body-control-tool-items.signing-layout-presets.page-limit-reached.normalized-max-pages.image-processing.image-insert-error".split("."))], 512), [[Mt, !P.value]]),
1770
- P.value ? (y(), p(x(Lt), {
1761
+ onPatchBlockFormat: us,
1762
+ onPatchFontFamily: fs,
1763
+ onPatchFontSize: ds,
1764
+ onPatchColor: ps,
1765
+ onPatchTextAlign: ls,
1766
+ onInsertVariable: Ia,
1767
+ onInsertSigningLayout: aa,
1768
+ onInsertSigningMark: ca,
1769
+ onOpenSigningLayoutCustom: sa,
1770
+ onOpenImageFile: Na,
1771
+ onInsertImageUrl: Fa,
1772
+ onAddPage: ga,
1773
+ onInsertTable: Ws,
1774
+ onTableAction: Xs,
1775
+ onFontSizeSearch: hs,
1776
+ onFontSizeCommit: gs,
1777
+ onFontSizeDropdownChange: vs,
1778
+ onFontSizeKeydown: _s
1779
+ }, null, 8, /* @__PURE__ */ "variable-insert-popover-open.signing-layout-popover-open.signing-mark-popover-open.image-insert-popover-open.image-insert-url.image-insert-width.image-insert-height.table-insert-popover-open.table-actions-popover-open.table-insert-draft.toolbar-more-open.readonly.editor-state.current-block-format.font-family-select-options.current-editor-font-family.font-size-preset-options.current-editor-font-size.editor-font-size-search-value.current-editor-text-color.body-control-tool-items.signing-layout-presets.page-limit-reached.normalized-max-pages.image-processing.image-insert-error".split("."))], 512), [[Ft, !N.value]]),
1780
+ N.value ? (v(), wt(b(Bt), {
1771
1781
  key: 0,
1772
1782
  title: "展开工具区"
1773
1783
  }, {
1774
- default: Nt(() => [h("button", {
1784
+ default: It(() => [m("button", {
1775
1785
  ref_key: "workspaceChromeHandleElement",
1776
- ref: gn,
1786
+ ref: yn,
1777
1787
  type: "button",
1778
1788
  class: "gd-contract-template-designer__workspace-chrome-handle",
1779
1789
  "aria-label": "展开工具区",
1780
1790
  "aria-expanded": !1,
1781
- "aria-controls": hn,
1782
- onClick: Es
1783
- }, [g(x(Vt), { "aria-hidden": "true" })], 512)]),
1791
+ "aria-controls": vn,
1792
+ onClick: Os
1793
+ }, [h(b(Wt), { "aria-hidden": "true" })], 512)]),
1784
1794
  _: 1
1785
- })) : m("", !0),
1786
- Wn.value && !F.value ? (y(), St("button", {
1795
+ })) : p("", !0),
1796
+ P.value && !F.value ? (v(), Tt("button", {
1787
1797
  key: 1,
1788
1798
  ref_key: "immersiveExitElement",
1789
- ref: Gn,
1799
+ ref: qn,
1790
1800
  type: "button",
1791
1801
  class: "gd-contract-template-designer__immersive-exit",
1792
1802
  "aria-label": "退出沉浸写作",
1793
- onClick: So
1803
+ onClick: wo
1794
1804
  }, [
1795
- g(x(Bt), { "aria-hidden": "true" }),
1796
- t[32] ||= h("span", { class: "gd-contract-template-designer__immersive-exit-label" }, "退出沉浸", -1),
1797
- t[33] ||= h("kbd", null, "Esc", -1)
1798
- ], 512)) : m("", !0),
1799
- k.value ? (y(), St("section", Ht, [g(x(Ft), {
1800
- type: Yr.value ? "success" : "error",
1801
- message: Xr.value,
1805
+ h(b(Ut), { "aria-hidden": "true" }),
1806
+ t[32] ||= m("span", { class: "gd-contract-template-designer__immersive-exit-label" }, "退出沉浸", -1),
1807
+ t[33] ||= m("kbd", null, "Esc", -1)
1808
+ ], 512)) : p("", !0),
1809
+ O.value ? (v(), Tt("section", Gt, [h(b(Rt), {
1810
+ type: Zr.value ? "success" : "error",
1811
+ message: Qr.value,
1802
1812
  "show-icon": ""
1803
- }, null, 8, ["type", "message"]), A.value.length ? (y(), St("div", Ut, [(y(!0), St(bt, null, Ot(A.value, (e) => (y(), St("button", {
1813
+ }, null, 8, ["type", "message"]), k.value.length ? (v(), Tt("div", Kt, [(v(!0), Tt(St, null, jt(k.value, (e) => (v(), Tt("button", {
1804
1814
  key: `${e.id}-${e.message}`,
1805
1815
  type: "button",
1806
1816
  class: "gd-contract-template-designer__validation-item",
1807
- onClick: (t) => $o(e)
1808
- }, [h("span", null, kt(e.message), 1), h("small", null, kt(es(e)), 1)], 8, Wt))), 128))])) : m("", !0)])) : m("", !0),
1809
- h("div", {
1817
+ onClick: (t) => ts(e)
1818
+ }, [m("span", null, Mt(e.message), 1), m("small", null, Mt(ns(e)), 1)], 8, qt))), 128))])) : p("", !0)])) : p("", !0),
1819
+ m("div", {
1810
1820
  ref_key: "canvasElement",
1811
- ref: sn,
1821
+ ref: un,
1812
1822
  class: "gd-contract-template-designer__canvas"
1813
- }, [(y(!0), St(bt, null, Ot(E.value.pages, (e, n) => (y(), p(Le, {
1814
- key: `${T.value}:${e.id}`,
1823
+ }, [(v(!0), Tt(St, null, jt(T.value.pages, (e, n) => (v(), wt(ze, {
1824
+ key: `${w.value}:${e.id}`,
1815
1825
  ref_for: !0,
1816
- ref: (t) => na(e.id, t),
1826
+ ref: (t) => ia(e.id, t),
1817
1827
  page: e,
1818
1828
  "page-index": n,
1819
- "page-size": da(e),
1820
- "page-decorations": E.value.pageDecorations,
1821
- "total-pages": E.value.pages.length,
1822
- variables: E.value.variables,
1823
- "selected-variable-key": D.value,
1824
- active: O.value === e.id,
1829
+ "page-size": pa(e),
1830
+ "page-decorations": T.value.pageDecorations,
1831
+ "total-pages": T.value.pages.length,
1832
+ variables: T.value.variables,
1833
+ "selected-variable-key": E.value,
1834
+ active: D.value === e.id,
1825
1835
  readonly: s.readonly,
1826
1836
  disabled: s.disabled,
1827
- zoom: M.value,
1828
- "process-image-file": ka,
1829
- "search-query": x(Fr),
1830
- "search-match-case": x(Ar),
1831
- "active-search-match": x(Nr)?.pageId === e.id ? x(Nr) : void 0,
1832
- "get-scroll-container": cn,
1833
- onPageUpdate: ua,
1834
- onVariableDrop: Ia,
1835
- onVariableSelect: La,
1836
- onEditorFocus: t[18] ||= (e) => Lo(e, !1),
1837
- onEditorReady: x(bi),
1838
- onCompositionEnd: x(bi),
1839
- onPageLayoutChange: x(bi),
1840
- onEditorStateChange: Vs,
1841
- onEditorContextMenu: ws,
1842
- onWordPaste: Oa,
1837
+ zoom: j.value,
1838
+ "process-image-file": ja,
1839
+ "search-query": b(Lr),
1840
+ "search-match-case": b(Mr),
1841
+ "active-search-match": b(Fr)?.pageId === e.id ? b(Fr) : void 0,
1842
+ "get-scroll-container": dn,
1843
+ onPageUpdate: fa,
1844
+ onVariableDrop: Ra,
1845
+ onVariableSelect: za,
1846
+ onEditorFocus: t[18] ||= (e) => zo(e, !1),
1847
+ onEditorReady: b(Si),
1848
+ onCompositionEnd: b(Si),
1849
+ onPageLayoutChange: b(Si),
1850
+ onEditorStateChange: Us,
1851
+ onEditorContextMenu: Es,
1852
+ onWordPaste: Aa,
1843
1853
  onVariableMoveBlocked: t[19] ||= (e) => H.value = "变量只能在当前页内移动,跨页移动尚未支持。"
1844
1854
  }, null, 8, [
1845
1855
  "page",
@@ -1861,38 +1871,38 @@ var Ht = {
1861
1871
  "onPageLayoutChange"
1862
1872
  ]))), 128))], 512)
1863
1873
  ], 512),
1864
- g(ht, {
1865
- collapsed: Un.value,
1874
+ h(_t, {
1875
+ collapsed: Kn.value,
1866
1876
  readonly: s.readonly,
1867
1877
  disabled: s.disabled,
1868
- "body-control-tool-items": gi.value,
1878
+ "body-control-tool-items": vi.value,
1869
1879
  "selected-variable": K.value,
1870
- variables: E.value.variables,
1871
- "current-variable-font-family": Li.value,
1872
- "font-family-select-options": ai.value,
1873
- "text-align-options": x(oi),
1874
- "border-style-options": ci,
1875
- "object-fit-options": li,
1876
- "selected-variable-width-max": ji.value,
1877
- "selected-variable-height-max": Mi.value,
1878
- "min-font-size": tn,
1879
- "max-font-size": nn,
1880
- "default-multiline-rows": x(3),
1881
- onToggle: t[20] ||= (e) => Un.value = !Un.value,
1882
- onVariableDragStart: oo,
1883
- onInsertVariable: eo,
1884
- onDuplicateVariable: Qa,
1885
- onRemoveVariable: Xa,
1886
- onPatchVariable: za,
1887
- onRenameVariable: Ba,
1888
- onPatchStyle: Ga,
1889
- onPatchMultiline: Ja,
1890
- onPatchRows: Ya,
1891
- onPatchFontFamily: Ka,
1892
- onPatchFontSize: qa,
1893
- onPatchTextAlign: Ha,
1894
- onPatchBorderStyle: Ua,
1895
- onPatchObjectFit: Wa
1880
+ variables: T.value.variables,
1881
+ "current-variable-font-family": zi.value,
1882
+ "font-family-select-options": si.value,
1883
+ "text-align-options": b(ci),
1884
+ "border-style-options": ui,
1885
+ "object-fit-options": di,
1886
+ "selected-variable-width-max": Ni.value,
1887
+ "selected-variable-height-max": Pi.value,
1888
+ "min-font-size": an,
1889
+ "max-font-size": on,
1890
+ "default-multiline-rows": b(3),
1891
+ onToggle: t[20] ||= (e) => Kn.value = !Kn.value,
1892
+ onVariableDragStart: co,
1893
+ onInsertVariable: no,
1894
+ onDuplicateVariable: eo,
1895
+ onRemoveVariable: Qa,
1896
+ onPatchVariable: Va,
1897
+ onRenameVariable: Ha,
1898
+ onPatchStyle: qa,
1899
+ onPatchMultiline: Xa,
1900
+ onPatchRows: Za,
1901
+ onPatchFontFamily: Ja,
1902
+ onPatchFontSize: Ya,
1903
+ onPatchTextAlign: Wa,
1904
+ onPatchBorderStyle: Ga,
1905
+ onPatchObjectFit: Ka
1896
1906
  }, null, 8, [
1897
1907
  "collapsed",
1898
1908
  "readonly",
@@ -1908,20 +1918,20 @@ var Ht = {
1908
1918
  "default-multiline-rows"
1909
1919
  ])
1910
1920
  ], 2),
1911
- Pt(g(gt, {
1921
+ Lt(h(vt, {
1912
1922
  ref_key: "pageDecorationsStudioElement",
1913
- ref: pn,
1914
- id: mn,
1923
+ ref: gn,
1924
+ id: _n,
1915
1925
  open: F.value,
1916
- decorations: E.value.pageDecorations,
1917
- variables: E.value.variables,
1918
- "font-family-options": ai.value,
1926
+ decorations: T.value.pageDecorations,
1927
+ variables: T.value.variables,
1928
+ "font-family-options": si.value,
1919
1929
  readonly: s.readonly,
1920
1930
  disabled: s.disabled,
1921
- "active-tab": Kn.value,
1922
- "onUpdate:activeTab": t[21] ||= (e) => Kn.value = e,
1923
- onChange: Va,
1924
- onClose: Vo
1931
+ "active-tab": Jn.value,
1932
+ "onUpdate:activeTab": t[21] ||= (e) => Jn.value = e,
1933
+ onChange: Ua,
1934
+ onClose: Uo
1925
1935
  }, null, 8, [
1926
1936
  "open",
1927
1937
  "decorations",
@@ -1930,71 +1940,71 @@ var Ht = {
1930
1940
  "readonly",
1931
1941
  "disabled",
1932
1942
  "active-tab"
1933
- ]), [[Mt, F.value]]),
1934
- (y(), p(xt, { to: "body" }, [
1935
- B.value ? (y(), p(Re, {
1943
+ ]), [[Ft, F.value]]),
1944
+ (v(), wt(Ct, { to: "body" }, [
1945
+ B.value ? (v(), wt(Be, {
1936
1946
  key: 0,
1937
1947
  ref_key: "tableContextMenuElement",
1938
- ref: mr,
1948
+ ref: gr,
1939
1949
  capabilities: B.value.capabilities,
1940
1950
  "active-alignment": B.value.activeAlignment,
1941
- style: Tt({
1951
+ style: Ot({
1942
1952
  left: `${B.value.x}px`,
1943
1953
  top: `${B.value.y}px`
1944
1954
  }),
1945
- onExecute: Ws,
1946
- onKeydown: Gs
1955
+ onExecute: Ks,
1956
+ onKeydown: qs
1947
1957
  }, null, 8, [
1948
1958
  "capabilities",
1949
1959
  "active-alignment",
1950
1960
  "style"
1951
- ])) : m("", !0),
1952
- V.value ? (y(), p(Ke, {
1961
+ ])) : p("", !0),
1962
+ V.value ? (v(), wt(Je, {
1953
1963
  key: 1,
1954
1964
  ref_key: "imageContextMenuElement",
1955
- ref: hr,
1956
- width: gr.value,
1957
- "onUpdate:width": t[22] ||= (e) => gr.value = e,
1958
- height: _r.value,
1959
- "onUpdate:height": t[23] ||= (e) => _r.value = e,
1965
+ ref: _r,
1966
+ width: vr.value,
1967
+ "onUpdate:width": t[22] ||= (e) => vr.value = e,
1968
+ height: yr.value,
1969
+ "onUpdate:height": t[23] ||= (e) => yr.value = e,
1960
1970
  x: V.value.x,
1961
1971
  y: V.value.y,
1962
1972
  readonly: W.value,
1963
- onRestore: Cs,
1964
- onApply: Ss,
1965
- onKeydown: qs
1973
+ onRestore: Ts,
1974
+ onApply: ws,
1975
+ onKeydown: Ys
1966
1976
  }, null, 8, [
1967
1977
  "width",
1968
1978
  "height",
1969
1979
  "x",
1970
1980
  "y",
1971
1981
  "readonly"
1972
- ])) : m("", !0),
1973
- R.value ? (y(), p(We, {
1982
+ ])) : p("", !0),
1983
+ R.value ? (v(), wt(Ke, {
1974
1984
  key: 2,
1975
1985
  ref_key: "textContextMenuElement",
1976
- ref: or,
1977
- "bind-open": fr.value,
1978
- "onUpdate:bindOpen": t[24] ||= (e) => fr.value = e,
1979
- "bind-keyword": pr.value,
1980
- "onUpdate:bindKeyword": t[25] ||= (e) => pr.value = e,
1986
+ ref: cr,
1987
+ "bind-open": mr.value,
1988
+ "onUpdate:bindOpen": t[24] ||= (e) => mr.value = e,
1989
+ "bind-keyword": hr.value,
1990
+ "onUpdate:bindKeyword": t[25] ||= (e) => hr.value = e,
1981
1991
  x: R.value.x,
1982
1992
  y: R.value.y,
1983
1993
  "has-selection": R.value.hasSelection,
1984
1994
  "editor-state": J.value,
1985
- "current-editor-text-color": Ii.value,
1986
- "body-control-tool-items": gi.value,
1987
- "text-menu-bindable-variables": Ai.value,
1988
- "variables-count": E.value.variables.length,
1989
- "resolve-bind-variable-type-label": io,
1990
- onCommand: sa,
1991
- onClipboard: ca,
1992
- onAddPage: Fa,
1993
- onInsertVariable: to,
1994
- onBindVariable: ro,
1995
- onOpenBindPanel: ao,
1996
- onKeydown: Ks,
1997
- onPatchColor: fs
1995
+ "current-editor-text-color": Ri.value,
1996
+ "body-control-tool-items": vi.value,
1997
+ "text-menu-bindable-variables": Mi.value,
1998
+ "variables-count": T.value.variables.length,
1999
+ "resolve-bind-variable-type-label": oo,
2000
+ onCommand: la,
2001
+ onClipboard: ua,
2002
+ onAddPage: La,
2003
+ onInsertVariable: ro,
2004
+ onBindVariable: ao,
2005
+ onOpenBindPanel: so,
2006
+ onKeydown: Js,
2007
+ onPatchColor: ms
1998
2008
  }, null, 8, [
1999
2009
  "bind-open",
2000
2010
  "bind-keyword",
@@ -2006,28 +2016,28 @@ var Ht = {
2006
2016
  "body-control-tool-items",
2007
2017
  "text-menu-bindable-variables",
2008
2018
  "variables-count"
2009
- ])) : m("", !0),
2010
- z.value ? (y(), p(Ge, {
2019
+ ])) : p("", !0),
2020
+ z.value ? (v(), wt(qe, {
2011
2021
  key: 3,
2012
2022
  ref_key: "textBubbleElement",
2013
- ref: sr,
2023
+ ref: lr,
2014
2024
  x: z.value.x,
2015
2025
  y: z.value.y,
2016
2026
  "editor-state": J.value,
2017
- "font-size-preset-options": Ri.value,
2018
- "current-editor-font-size": Fi.value,
2019
- "editor-font-size-search-value": Yn.value,
2020
- "current-editor-text-color": Ii.value,
2021
- "text-align-options": x(oi),
2027
+ "font-size-preset-options": Bi.value,
2028
+ "current-editor-font-size": Li.value,
2029
+ "editor-font-size-search-value": Zn.value,
2030
+ "current-editor-text-color": Ri.value,
2031
+ "text-align-options": b(ci),
2022
2032
  onCommand: Q,
2023
- onPatchFontSize: ls,
2024
- onPatchTextAlign: ss,
2025
- onPatchColor: fs,
2026
- onFontSizeSearch: ps,
2027
- onFontSizeCommit: ms,
2028
- onFontSizeDropdownChange: gs,
2029
- onFontSizeKeydown: hs,
2030
- onMore: Fs
2033
+ onPatchFontSize: ds,
2034
+ onPatchTextAlign: ls,
2035
+ onPatchColor: ms,
2036
+ onFontSizeSearch: hs,
2037
+ onFontSizeCommit: gs,
2038
+ onFontSizeDropdownChange: vs,
2039
+ onFontSizeKeydown: _s,
2040
+ onMore: Ls
2031
2041
  }, null, 8, [
2032
2042
  "x",
2033
2043
  "y",
@@ -2037,29 +2047,29 @@ var Ht = {
2037
2047
  "editor-font-size-search-value",
2038
2048
  "current-editor-text-color",
2039
2049
  "text-align-options"
2040
- ])) : m("", !0)
2050
+ ])) : p("", !0)
2041
2051
  ])),
2042
- h("input", {
2052
+ m("input", {
2043
2053
  ref_key: "imageFileInputElement",
2044
- ref: _n,
2054
+ ref: bn,
2045
2055
  class: "gd-contract-template-designer__hidden-file-input",
2046
2056
  type: "file",
2047
2057
  accept: "image/png,image/jpeg,image/webp,image/gif,image/bmp",
2048
2058
  tabindex: "-1",
2049
2059
  "aria-hidden": "true",
2050
- onChange: Ma
2060
+ onChange: Pa
2051
2061
  }, null, 544),
2052
- h("span", Gt, kt(H.value), 1),
2053
- g(qe, {
2054
- open: Pn.value,
2055
- "onUpdate:open": t[26] ||= (e) => Pn.value = e,
2056
- "preview-pages": Gr.value,
2057
- "preview-file-groups": Kr.value,
2058
- "preview-active-group": qr.value,
2059
- "preview-snapshot": Fn.value,
2062
+ m("span", Jt, Mt(H.value), 1),
2063
+ h(Ye, {
2064
+ open: Ln.value,
2065
+ "onUpdate:open": t[26] ||= (e) => Ln.value = e,
2066
+ "preview-pages": qr.value,
2067
+ "preview-file-groups": Jr.value,
2068
+ "preview-active-group": Yr.value,
2069
+ "preview-snapshot": Rn.value,
2060
2070
  "font-base-url": s.contractFontBaseUrl,
2061
- onCancel: To,
2062
- onSelectFile: t[27] ||= (e) => Ln.value = e
2071
+ onCancel: Do,
2072
+ onSelectFile: t[27] ||= (e) => Bn.value = e
2063
2073
  }, null, 8, [
2064
2074
  "open",
2065
2075
  "preview-pages",
@@ -2068,31 +2078,31 @@ var Ht = {
2068
2078
  "preview-snapshot",
2069
2079
  "font-base-url"
2070
2080
  ]),
2071
- g(Je, {
2072
- open: Rn.value,
2073
- "onUpdate:open": t[28] ||= (e) => Rn.value = e,
2074
- json: zn.value,
2075
- onCancel: Oo
2081
+ h(Xe, {
2082
+ open: Vn.value,
2083
+ "onUpdate:open": t[28] ||= (e) => Vn.value = e,
2084
+ json: Hn.value,
2085
+ onCancel: Ao
2076
2086
  }, null, 8, ["open", "json"]),
2077
- g(Ye, {
2078
- open: Bn.value,
2079
- "onUpdate:open": t[29] ||= (e) => Bn.value = e,
2080
- data: Vn.value,
2081
- "file-name": Wr.value?.name,
2082
- onCancel: jo
2087
+ h(Ze, {
2088
+ open: Un.value,
2089
+ "onUpdate:open": t[29] ||= (e) => Un.value = e,
2090
+ data: Wn.value,
2091
+ "file-name": Kr.value?.name,
2092
+ onCancel: No
2083
2093
  }, null, 8, [
2084
2094
  "open",
2085
2095
  "data",
2086
2096
  "file-name"
2087
2097
  ]),
2088
- g(Xe, {
2089
- open: er.value,
2090
- "onUpdate:open": t[30] ||= (e) => er.value = e,
2098
+ h(Qe, {
2099
+ open: nr.value,
2100
+ "onUpdate:open": t[30] ||= (e) => nr.value = e,
2091
2101
  disabled: W.value,
2092
- onInsert: ia
2102
+ onInsert: oa
2093
2103
  }, null, 8, ["open", "disabled"])
2094
2104
  ], 38));
2095
2105
  }
2096
2106
  });
2097
2107
  //#endregion
2098
- export { an as default };
2108
+ export { cn as default };