@guodun/antdv 1.4.1 → 1.4.3

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 (135) hide show
  1. package/dist/es/components/contract-signing-location/src/ContractSigningLocationCanvas.vue.mjs +304 -293
  2. package/dist/es/components/contract-signing-location/src/coordinates.mjs +23 -23
  3. package/dist/es/components/contract-signing-location/src/location-rules.mjs +20 -10
  4. package/dist/es/components/contract-signing-location/src/page-layout.mjs +12 -9
  5. package/dist/es/components/contract-signing-location/src/template-source.mjs +2 -0
  6. package/dist/es/components/pro-contract-template-designer/src/ContractTemplateDesignerInspector.vue.mjs +208 -180
  7. package/dist/es/components/pro-contract-template-designer/src/ContractTemplateDesignerSidebar.vue.mjs +2 -1
  8. package/dist/es/components/pro-contract-template-designer/src/ContractTemplateDesignerToolbar.mjs +5 -0
  9. package/dist/es/components/pro-contract-template-designer/src/ContractTemplateDesignerToolbar.vue.mjs +690 -0
  10. package/dist/es/components/pro-contract-template-designer/src/ContractTemplateDesignerWorkspaceHeader.mjs +5 -0
  11. package/dist/es/components/pro-contract-template-designer/src/ContractTemplateDesignerWorkspaceHeader.vue.mjs +253 -0
  12. package/dist/es/components/pro-contract-template-designer/src/ContractTemplateImageContextMenu.mjs +5 -0
  13. package/dist/es/components/pro-contract-template-designer/src/ContractTemplateImageContextMenu.vue.mjs +87 -0
  14. package/dist/es/components/pro-contract-template-designer/src/ContractTemplatePageDecorations.mjs +5 -0
  15. package/dist/es/components/pro-contract-template-designer/src/ContractTemplatePageDecorations.vue.mjs +98 -0
  16. package/dist/es/components/pro-contract-template-designer/src/ContractTemplatePageDecorationsInspector.mjs +5 -0
  17. package/dist/es/components/pro-contract-template-designer/src/ContractTemplatePageDecorationsInspector.vue.mjs +550 -0
  18. package/dist/es/components/pro-contract-template-designer/src/ContractTemplatePageDecorationsStudio.mjs +5 -0
  19. package/dist/es/components/pro-contract-template-designer/src/ContractTemplatePageDecorationsStudio.vue.mjs +117 -0
  20. package/dist/es/components/pro-contract-template-designer/src/ContractTemplatePreviewModal.mjs +5 -0
  21. package/dist/es/components/pro-contract-template-designer/src/ContractTemplatePreviewModal.vue.mjs +96 -0
  22. package/dist/es/components/pro-contract-template-designer/src/ContractTemplatePreviewPage.vue.mjs +51 -26
  23. package/dist/es/components/pro-contract-template-designer/src/ContractTemplateRendererPage.vue.mjs +56 -33
  24. package/dist/es/components/pro-contract-template-designer/src/ContractTemplateSubmitDataModal.mjs +5 -0
  25. package/dist/es/components/pro-contract-template-designer/src/ContractTemplateSubmitDataModal.vue.mjs +29 -0
  26. package/dist/es/components/pro-contract-template-designer/src/ContractTemplateTextBubbleMenu.mjs +5 -0
  27. package/dist/es/components/pro-contract-template-designer/src/ContractTemplateTextBubbleMenu.vue.mjs +179 -0
  28. package/dist/es/components/pro-contract-template-designer/src/ContractTemplateTextContextMenu.mjs +5 -0
  29. package/dist/es/components/pro-contract-template-designer/src/ContractTemplateTextContextMenu.vue.mjs +390 -0
  30. package/dist/es/components/pro-contract-template-designer/src/DesignerPage.vue.mjs +332 -263
  31. package/dist/es/components/pro-contract-template-designer/src/ProContractTemplateDesigner.vue.mjs +1442 -2287
  32. package/dist/es/components/pro-contract-template-designer/src/composables/use-auto-pagination.mjs +71 -0
  33. package/dist/es/components/pro-contract-template-designer/src/composables/use-designer-files.mjs +11 -0
  34. package/dist/es/components/pro-contract-template-designer/src/composables/use-draft-cache-session.mjs +111 -0
  35. package/dist/es/components/pro-contract-template-designer/src/composables/use-signing-placement-editor.mjs +79 -0
  36. package/dist/es/components/pro-contract-template-designer/src/composables/use-template-designer.mjs +189 -160
  37. package/dist/es/components/pro-contract-template-designer/src/composables/use-template-files.mjs +35 -22
  38. package/dist/es/components/pro-contract-template-designer/src/composables/use-toolbar-overflow.mjs +71 -0
  39. package/dist/es/components/pro-contract-template-designer/src/constants.mjs +71 -10
  40. package/dist/es/components/pro-contract-template-designer/src/extensions/editor-extensions.mjs +1 -0
  41. package/dist/es/components/pro-contract-template-designer/src/utils/block-style.mjs +43 -0
  42. package/dist/es/components/pro-contract-template-designer/src/utils/context-menu-viewport.mjs +13 -0
  43. package/dist/es/components/pro-contract-template-designer/src/utils/editor-state.mjs +7 -0
  44. package/dist/es/components/pro-contract-template-designer/src/utils/page-decorations.mjs +398 -0
  45. package/dist/es/components/pro-contract-template-designer/src/utils/serialize-fingerprint.mjs +6 -0
  46. package/dist/es/components/pro-contract-template-designer/src/utils/template-renderer.mjs +88 -72
  47. package/dist/es/components/pro-contract-template-designer/style/index.css +1 -1
  48. package/dist/es/index.mjs +20 -20
  49. package/dist/lib/components/contract-signing-location/src/ContractSigningLocationCanvas.vue.cjs +1 -1
  50. package/dist/lib/components/contract-signing-location/src/coordinates.cjs +1 -1
  51. package/dist/lib/components/contract-signing-location/src/location-rules.cjs +1 -1
  52. package/dist/lib/components/contract-signing-location/src/page-layout.cjs +1 -1
  53. package/dist/lib/components/contract-signing-location/src/template-source.cjs +1 -1
  54. package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateDesignerInspector.vue.cjs +1 -1
  55. package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateDesignerSidebar.vue.cjs +1 -1
  56. package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateDesignerToolbar.cjs +1 -0
  57. package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateDesignerToolbar.vue.cjs +1 -0
  58. package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateDesignerWorkspaceHeader.cjs +1 -0
  59. package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateDesignerWorkspaceHeader.vue.cjs +1 -0
  60. package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateImageContextMenu.cjs +1 -0
  61. package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateImageContextMenu.vue.cjs +1 -0
  62. package/dist/lib/components/pro-contract-template-designer/src/ContractTemplatePageDecorations.cjs +1 -0
  63. package/dist/lib/components/pro-contract-template-designer/src/ContractTemplatePageDecorations.vue.cjs +1 -0
  64. package/dist/lib/components/pro-contract-template-designer/src/ContractTemplatePageDecorationsInspector.cjs +1 -0
  65. package/dist/lib/components/pro-contract-template-designer/src/ContractTemplatePageDecorationsInspector.vue.cjs +1 -0
  66. package/dist/lib/components/pro-contract-template-designer/src/ContractTemplatePageDecorationsStudio.cjs +1 -0
  67. package/dist/lib/components/pro-contract-template-designer/src/ContractTemplatePageDecorationsStudio.vue.cjs +1 -0
  68. package/dist/lib/components/pro-contract-template-designer/src/ContractTemplatePreviewModal.cjs +1 -0
  69. package/dist/lib/components/pro-contract-template-designer/src/ContractTemplatePreviewModal.vue.cjs +1 -0
  70. package/dist/lib/components/pro-contract-template-designer/src/ContractTemplatePreviewPage.vue.cjs +1 -1
  71. package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateRendererPage.vue.cjs +1 -1
  72. package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateSubmitDataModal.cjs +1 -0
  73. package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateSubmitDataModal.vue.cjs +1 -0
  74. package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateTextBubbleMenu.cjs +1 -0
  75. package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateTextBubbleMenu.vue.cjs +1 -0
  76. package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateTextContextMenu.cjs +1 -0
  77. package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateTextContextMenu.vue.cjs +1 -0
  78. package/dist/lib/components/pro-contract-template-designer/src/DesignerPage.vue.cjs +2 -2
  79. package/dist/lib/components/pro-contract-template-designer/src/ProContractTemplateDesigner.vue.cjs +1 -1
  80. package/dist/lib/components/pro-contract-template-designer/src/composables/use-auto-pagination.cjs +1 -0
  81. package/dist/lib/components/pro-contract-template-designer/src/composables/use-designer-files.cjs +1 -0
  82. package/dist/lib/components/pro-contract-template-designer/src/composables/use-draft-cache-session.cjs +1 -0
  83. package/dist/lib/components/pro-contract-template-designer/src/composables/use-signing-placement-editor.cjs +1 -0
  84. package/dist/lib/components/pro-contract-template-designer/src/composables/use-template-designer.cjs +4 -4
  85. package/dist/lib/components/pro-contract-template-designer/src/composables/use-template-files.cjs +2 -2
  86. package/dist/lib/components/pro-contract-template-designer/src/composables/use-toolbar-overflow.cjs +1 -0
  87. package/dist/lib/components/pro-contract-template-designer/src/constants.cjs +1 -1
  88. package/dist/lib/components/pro-contract-template-designer/src/extensions/editor-extensions.cjs +1 -1
  89. package/dist/lib/components/pro-contract-template-designer/src/utils/block-style.cjs +1 -0
  90. package/dist/lib/components/pro-contract-template-designer/src/utils/context-menu-viewport.cjs +1 -0
  91. package/dist/lib/components/pro-contract-template-designer/src/utils/editor-state.cjs +1 -0
  92. package/dist/lib/components/pro-contract-template-designer/src/utils/page-decorations.cjs +1 -0
  93. package/dist/lib/components/pro-contract-template-designer/src/utils/serialize-fingerprint.cjs +1 -0
  94. package/dist/lib/components/pro-contract-template-designer/src/utils/template-renderer.cjs +3 -3
  95. package/dist/lib/components/pro-contract-template-designer/style/index.css +1 -1
  96. package/dist/lib/index.cjs +1 -1
  97. package/dist/theme/icon.css +1 -1
  98. package/dist/theme/index.css +1 -1
  99. package/dist/types/components/contract-signing-location/src/coordinates.d.ts +2 -2
  100. package/dist/types/components/contract-signing-location/src/page-layout.d.ts +2 -2
  101. package/dist/types/components/contract-signing-location/src/template-source.d.ts +2 -0
  102. package/dist/types/components/contract-signing-location/src/types.d.ts +3 -0
  103. package/dist/types/components/pro-contract-template-designer/src/ContractTemplateDesignerInspector.vue.d.ts +3 -0
  104. package/dist/types/components/pro-contract-template-designer/src/ContractTemplateDesignerSidebar.vue.d.ts +1 -0
  105. package/dist/types/components/pro-contract-template-designer/src/ContractTemplateDesignerToolbar.vue.d.ts +104 -0
  106. package/dist/types/components/pro-contract-template-designer/src/ContractTemplateDesignerWorkspaceHeader.vue.d.ts +60 -0
  107. package/dist/types/components/pro-contract-template-designer/src/ContractTemplateImageContextMenu.vue.d.ts +27 -0
  108. package/dist/types/components/pro-contract-template-designer/src/ContractTemplatePageDecorations.vue.d.ts +13 -0
  109. package/dist/types/components/pro-contract-template-designer/src/ContractTemplatePageDecorationsInspector.vue.d.ts +28 -0
  110. package/dist/types/components/pro-contract-template-designer/src/ContractTemplatePageDecorationsStudio.vue.d.ts +77 -0
  111. package/dist/types/components/pro-contract-template-designer/src/ContractTemplatePreviewModal.vue.d.ts +36 -0
  112. package/dist/types/components/pro-contract-template-designer/src/ContractTemplatePreviewPage.vue.d.ts +5 -1
  113. package/dist/types/components/pro-contract-template-designer/src/ContractTemplateRendererHeader.vue.d.ts +4 -4
  114. package/dist/types/components/pro-contract-template-designer/src/ContractTemplateRendererToolbar.vue.d.ts +4 -4
  115. package/dist/types/components/pro-contract-template-designer/src/ContractTemplateSubmitDataModal.vue.d.ts +12 -0
  116. package/dist/types/components/pro-contract-template-designer/src/ContractTemplateTextBubbleMenu.vue.d.ts +43 -0
  117. package/dist/types/components/pro-contract-template-designer/src/ContractTemplateTextContextMenu.vue.d.ts +77 -0
  118. package/dist/types/components/pro-contract-template-designer/src/DesignerPage.vue.d.ts +30 -32
  119. package/dist/types/components/pro-contract-template-designer/src/ProContractTemplateDesigner.vue.d.ts +456 -12
  120. package/dist/types/components/pro-contract-template-designer/src/composables/use-auto-pagination.d.ts +43 -0
  121. package/dist/types/components/pro-contract-template-designer/src/composables/use-designer-files.d.ts +22 -0
  122. package/dist/types/components/pro-contract-template-designer/src/composables/use-draft-cache-session.d.ts +41 -0
  123. package/dist/types/components/pro-contract-template-designer/src/composables/use-signing-placement-editor.d.ts +49 -0
  124. package/dist/types/components/pro-contract-template-designer/src/composables/use-template-designer.d.ts +15 -1
  125. package/dist/types/components/pro-contract-template-designer/src/composables/use-template-files.d.ts +13 -0
  126. package/dist/types/components/pro-contract-template-designer/src/composables/use-toolbar-overflow.d.ts +19 -0
  127. package/dist/types/components/pro-contract-template-designer/src/constants.d.ts +7 -1
  128. package/dist/types/components/pro-contract-template-designer/src/types.d.ts +89 -0
  129. package/dist/types/components/pro-contract-template-designer/src/utils/block-style.d.ts +4 -0
  130. package/dist/types/components/pro-contract-template-designer/src/utils/context-menu-viewport.d.ts +25 -0
  131. package/dist/types/components/pro-contract-template-designer/src/utils/editor-state.d.ts +8 -0
  132. package/dist/types/components/pro-contract-template-designer/src/utils/page-decorations.d.ts +90 -0
  133. package/dist/types/components/pro-contract-template-designer/src/utils/serialize-fingerprint.d.ts +8 -0
  134. package/dist/types/components/pro-contract-template-designer/src/utils/template-renderer.d.ts +4 -1
  135. package/package.json +3 -3
@@ -1,44 +1,44 @@
1
1
  import e from "./ContractSigningTemplatePage.mjs";
2
2
  import "./constants.mjs";
3
- import { canResizeContractSigningPlacement as t, clampContractSigningPlacement as n, getContractSigningPlacementDistances as r, getContractSigningRuleGeometry as i, moveContractSigningPlacementByDisplayDelta as a, resizeContractSigningSealGeometry as o, snapContractSigningPlacement as ee } from "./coordinates.mjs";
4
- import { buildContractSigningTemplateRenderPages as s, getContractSigningTemplateDisplayError as c, isContractSigningTemplateFile as te } from "./template-source.mjs";
5
- import { isContractSigningPageUsable as l } from "./location-rules.mjs";
6
- import { CONTRACT_SIGNING_FALLBACK_PAGE_SIZE as u, buildPageLayouts as d, contentPointToPagePoint as f, findPageAtOffset as p, getContractSigningAutoScrollDelta as m, getPageLayoutScrollTop as ne, getPageLayoutsContentSize as re, getVisibleRange as ie } from "./page-layout.mjs";
7
- import { useFitWidthZoom as ae } from "../../pro-contract-template-designer/src/composables/use-fit-width-zoom.mjs";
8
- import { getContractSigningPlacementVisual as oe } from "./signing-visuals.mjs";
9
- import { Fragment as h, computed as g, createBlock as se, createCommentVNode as _, createElementBlock as v, createElementVNode as y, createTextVNode as ce, createVNode as b, defineComponent as x, nextTick as S, normalizeClass as C, normalizeStyle as w, onBeforeUnmount as le, onMounted as ue, openBlock as T, ref as de, renderList as fe, shallowRef as E, toDisplayString as D, unref as O, watch as pe, withCtx as k, withKeys as me, withModifiers as A } from "vue";
10
- import { Button as j } from "ant-design-vue";
11
- import { useElementSize as he } from "@vueuse/core";
12
- import { ColumnWidthOutlined as ge, LeftOutlined as _e, RightOutlined as ve, ZoomInOutlined as ye, ZoomOutOutlined as be } from "@ant-design/icons-vue";
3
+ import { canResizeContractSigningPlacement as t, clampContractSigningPlacement as n, getContractSigningPlacementDistances as r, getContractSigningRuleGeometry as i, moveContractSigningPlacementByDisplayDelta as a, resizeContractSigningSealGeometry as o, snapContractSigningPlacement as s } from "./coordinates.mjs";
4
+ import { buildContractSigningTemplateRenderPages as c, getContractSigningTemplateDisplayError as l, isContractSigningTemplateFile as u } from "./template-source.mjs";
5
+ import { isContractSigningPageUsable as d } from "./location-rules.mjs";
6
+ import { CONTRACT_SIGNING_FALLBACK_PAGE_SIZE as f, buildPageLayouts as p, contentPointToPagePoint as m, findPageAtOffset as h, getContractSigningAutoScrollDelta as g, getPageLayoutScrollTop as _, getPageLayoutsContentSize as ee, getVisibleRange as te } from "./page-layout.mjs";
7
+ import { useFitWidthZoom as ne } from "../../pro-contract-template-designer/src/composables/use-fit-width-zoom.mjs";
8
+ import { getContractSigningPlacementVisual as re } from "./signing-visuals.mjs";
9
+ import { Fragment as v, computed as y, createBlock as ie, createCommentVNode as ae, createElementBlock as b, createElementVNode as x, createTextVNode as oe, createVNode as S, defineComponent as C, nextTick as se, normalizeClass as ce, normalizeStyle as w, onBeforeUnmount as le, onMounted as ue, openBlock as T, ref as de, renderList as E, shallowRef as D, toDisplayString as O, unref as k, watch as fe, withCtx as A, withKeys as pe, withModifiers as j } from "vue";
10
+ import { Button as M } from "ant-design-vue";
11
+ import { useElementSize as me } from "@vueuse/core";
12
+ import { ColumnWidthOutlined as he, LeftOutlined as ge, RightOutlined as _e, ZoomInOutlined as ve, ZoomOutOutlined as ye } from "@ant-design/icons-vue";
13
13
  //#region src/components/contract-signing-location/src/ContractSigningLocationCanvas.vue?vue&type=script&setup=true&lang.ts
14
- var xe = { class: "gd-ant-contract-signing-location__workspace" }, Se = { class: "gd-ant-contract-signing-location__workspace-head" }, Ce = { key: 0 }, we = { class: "gd-ant-contract-signing-location__workspace-tools" }, Te = {
14
+ var be = { class: "gd-ant-contract-signing-location__workspace" }, xe = { class: "gd-ant-contract-signing-location__workspace-head" }, Se = { key: 0 }, Ce = { class: "gd-ant-contract-signing-location__workspace-tools" }, we = {
15
15
  class: "gd-ant-contract-signing-location__page-jumper",
16
16
  "aria-label": "页码跳转"
17
- }, Ee = ["value", "max"], De = {
17
+ }, Te = ["value", "max"], Ee = {
18
18
  class: "gd-ant-contract-signing-location__zoom-tools",
19
19
  "aria-label": "页面缩放"
20
- }, Oe = ["aria-label"], ke = {
20
+ }, De = ["aria-label"], Oe = {
21
21
  key: 1,
22
22
  class: "gd-ant-contract-signing-location__page-placeholder is-error",
23
23
  role: "alert"
24
- }, Ae = ["src"], je = {
24
+ }, ke = ["src"], Ae = {
25
25
  key: 3,
26
26
  class: "gd-ant-contract-signing-location__page-placeholder"
27
- }, Me = ["onClick"], Ne = ["onClick"], Pe = { class: "gd-ant-contract-signing-location__render-region" }, Fe = { class: "gd-ant-contract-signing-location__render-region-content" }, Ie = { class: "is-horizontal is-top" }, Le = { class: "is-horizontal is-bottom" }, Re = { class: "is-vertical is-left" }, ze = { class: "is-vertical is-right" }, Be = {
27
+ }, je = ["onClick"], Me = ["onClick"], Ne = { class: "gd-ant-contract-signing-location__render-region" }, Pe = { class: "gd-ant-contract-signing-location__render-region-content" }, Fe = { class: "is-horizontal is-top" }, Ie = { class: "is-horizontal is-bottom" }, Le = { class: "is-vertical is-left" }, Re = { class: "is-vertical is-right" }, ze = {
28
28
  key: 1,
29
29
  class: "gd-ant-contract-signing-location__snap-guides",
30
30
  "aria-hidden": "true"
31
- }, Ve = [
31
+ }, Be = [
32
32
  "title",
33
33
  "aria-label",
34
34
  "aria-pressed",
35
35
  "onClick",
36
36
  "onPointerdown",
37
37
  "onKeydown"
38
- ], He = { class: "gd-ant-contract-signing-location__placement-body" }, Ue = ["src", "alt"], We = {
38
+ ], Ve = { class: "gd-ant-contract-signing-location__placement-body" }, He = ["src", "alt"], Ue = {
39
39
  key: 0,
40
40
  class: "gd-ant-contract-signing-location__placement-badge"
41
- }, Ge = ["onPointerdown"], Ke = /* @__PURE__ */ x({
41
+ }, We = ["onPointerdown"], Ge = /* @__PURE__ */ C({
42
42
  name: "ContractSigningLocationCanvas",
43
43
  __name: "ContractSigningLocationCanvas",
44
44
  props: {
@@ -69,8 +69,8 @@ var xe = { class: "gd-ant-contract-signing-location__workspace" }, Se = { class:
69
69
  "zoom-change",
70
70
  "scroll-to-ready"
71
71
  ],
72
- setup(x, { expose: Ke, emit: qe }) {
73
- let Je = [
72
+ setup(C, { expose: Ge, emit: Ke }) {
73
+ let qe = [
74
74
  "nw",
75
75
  "n",
76
76
  "ne",
@@ -79,142 +79,154 @@ var xe = { class: "gd-ant-contract-signing-location__workspace" }, Se = { class:
79
79
  "s",
80
80
  "sw",
81
81
  "w"
82
- ], M = x, N = qe, P = de(null), F = de(null), I = E(1), L = E(M.activePageIndex), Ye = E({
82
+ ], N = C, P = Ke, F = de(null), I = de(null), Je = D(1), L = D(N.activePageIndex), Ye = D({
83
83
  start: 0,
84
84
  end: -1
85
- }), { width: Xe } = he(P), { fitWidth: Ze, markUserAdjusted: Qe } = ae({
85
+ }), { width: Xe } = me(F), { fitWidth: Ze, markUserAdjusted: Qe } = ne({
86
86
  viewportWidth: Xe,
87
- widestPageWidth: g(() => Math.max(...M.pages.map((e) => e.width || u.width), u.width)),
87
+ widestPageWidth: y(() => Math.max(...N.pages.map((e) => e.displayWidth || e.width || f.width), f.width)),
88
88
  padding: 48,
89
- minZoom: () => M.minZoom,
90
- maxZoom: () => M.maxZoom,
91
- getZoom: () => M.zoom,
92
- applyZoom: (e) => (N("zoom-change", e), e)
93
- }), $e = E([]), et = E(), R = E(), z, B = 0, V, tt, nt, H, U = g(() => d(M.pages, M.zoom, 16)), rt = g(() => re(U.value)), W = g(() => te(M.file)), it = g(() => s(M.file?.source)), at = g(() => new Map(it.value.map((e) => [e.pageIndex, e]))), G = g(() => c(M.file)), ot = g(() => {
89
+ minZoom: () => N.minZoom,
90
+ maxZoom: () => N.maxZoom,
91
+ getZoom: () => N.zoom,
92
+ applyZoom: (e) => (P("zoom-change", e), e)
93
+ }), $e = D([]), et = D(), R = D(), z, B = 0, V, tt, nt, H, U = y(() => p(N.pages, N.zoom, 16)), rt = y(() => ee(U.value)), W = y(() => u(N.file)), it = y(() => c(N.file?.source)), at = y(() => new Map(it.value.map((e) => [e.pageIndex, e]))), ot = y(() => l(N.file)), st = y(() => {
94
94
  let e = Ye.value;
95
95
  return U.value.length ? e.end < e.start ? U.value.slice(0, 2) : U.value.slice(e.start, e.end + 1) : [];
96
- }), st = g(() => ot.value.flatMap((e) => {
97
- let t = Y(e.pageIndex);
96
+ }), ct = y(() => st.value.flatMap((e) => {
97
+ let t = q(e.pageIndex);
98
98
  return t ? [{
99
99
  layout: e,
100
100
  page: t,
101
- logical: mt(t),
101
+ logical: J(t),
102
102
  templatePage: at.value.get(e.pageIndex)
103
103
  }] : [];
104
- })), K = g(() => M.pages.find((e) => e.pageIndex === L.value) ?? M.pages[0]), ct = g(() => Math.min(M.minZoom, M.maxZoom)), lt = g(() => Math.max(M.minZoom, M.maxZoom)), q = g(() => M.placements.find((e) => e.id === M.selectedPlacementId)), ut = /* @__PURE__ */ new Date(), J = /* @__PURE__ */ new Map();
105
- function dt(e) {
104
+ })), lt = y(() => N.pages.find((e) => e.pageIndex === L.value) ?? N.pages[0]), ut = y(() => Math.min(N.minZoom, N.maxZoom)), dt = y(() => Math.max(N.minZoom, N.maxZoom)), G = y(() => N.placements.find((e) => e.id === N.selectedPlacementId)), ft = /* @__PURE__ */ new Date(), K = /* @__PURE__ */ new Map();
105
+ function pt(e) {
106
106
  return JSON.stringify([
107
107
  e.signType,
108
108
  e.sealType ?? [],
109
- M.sealTypeOptions ?? []
109
+ N.sealTypeOptions ?? []
110
110
  ]);
111
111
  }
112
- function ft(e) {
113
- let t = dt(e), n = J.get(t);
112
+ function mt(e) {
113
+ let t = pt(e), n = K.get(t);
114
114
  if (n) return n;
115
- let r = oe(e, {
116
- sealTypeOptions: M.sealTypeOptions,
117
- date: ut
115
+ let r = re(e, {
116
+ sealTypeOptions: N.sealTypeOptions,
117
+ date: ft
118
118
  });
119
- if (J.size >= 128) {
120
- let e = J.keys().next().value;
121
- e !== void 0 && J.delete(e);
119
+ if (K.size >= 128) {
120
+ let e = K.keys().next().value;
121
+ e !== void 0 && K.delete(e);
122
122
  }
123
- return J.set(t, r), r;
123
+ return K.set(t, r), r;
124
124
  }
125
- let pt = g(() => {
125
+ let ht = y(() => {
126
126
  let e = /* @__PURE__ */ new WeakMap();
127
- return M.placements.forEach((t) => {
128
- e.set(t, ft(t));
127
+ return N.placements.forEach((t) => {
128
+ e.set(t, mt(t));
129
129
  }), e;
130
130
  });
131
- pe(() => M.activePageIndex, (e) => {
132
- L.value = e, Ot() || Q(e);
133
- }), pe(() => M.pages.map((e) => e.pageIndex).join(","), () => {
134
- S(() => {
135
- X(), Z(), N("scroll-to-ready");
131
+ fe(() => N.activePageIndex, (e) => {
132
+ L.value = e, At() || Q(e);
133
+ }), fe(() => N.pages.map((e) => e.pageIndex).join(","), () => {
134
+ se(() => {
135
+ X(), Z(), P("scroll-to-ready");
136
136
  });
137
- }), pe(() => M.zoom, (e, t) => {
138
- if (!P.value || t == null || e === t) return;
139
- let n = Et(), r = d(M.pages, t, 16), i = p(r, n.layoutScrollTop + 1) ?? r[0];
137
+ }), fe(() => N.zoom, (e, t) => {
138
+ if (!F.value || t == null || e === t) return;
139
+ let n = Ot(), r = p(N.pages, t, 16), i = h(r, n.layoutScrollTop + 1) ?? r[0];
140
140
  if (!i) return;
141
141
  nt = {
142
142
  pageIndex: i.pageIndex,
143
143
  offsetInPage: n.layoutScrollTop - i.top
144
144
  };
145
145
  let a = e / Math.max(.01, t);
146
- S(() => At(a));
146
+ se(() => Mt(a));
147
147
  }), ue(() => {
148
- X(), Z(), N("scroll-to-ready"), !(typeof ResizeObserver > "u" || !P.value) && (H = new ResizeObserver(() => {
148
+ X(), Z(), P("scroll-to-ready"), !(typeof ResizeObserver > "u" || !F.value) && (H = new ResizeObserver(() => {
149
149
  X(), Z();
150
- }), H.observe(P.value));
150
+ }), H.observe(F.value));
151
151
  }), le(() => {
152
- qt(), Rt(), V && clearTimeout(V), H?.disconnect(), H = void 0;
152
+ Yt(), Bt(), V && clearTimeout(V), H?.disconnect(), H = void 0;
153
153
  });
154
- function Y(e) {
155
- return M.pages.find((t) => t.pageIndex === e);
154
+ function q(e) {
155
+ return N.pages.find((t) => t.pageIndex === e);
156
156
  }
157
- function mt(e) {
158
- return l(e) ? {
157
+ function J(e) {
158
+ return e && d(e) ? {
159
159
  width: e.width,
160
160
  height: e.height
161
- } : { ...u };
161
+ } : { ...f };
162
162
  }
163
- function ht(e) {
164
- return `${M.file?.fileId ?? ""}:${e}`;
163
+ function Y(e) {
164
+ if (!e || !d(e)) return { ...f };
165
+ let t = Number(e.displayWidth), n = Number(e.displayHeight);
166
+ return {
167
+ width: Number.isFinite(t) && t > 0 ? t : e.width,
168
+ height: Number.isFinite(n) && n > 0 ? n : e.height
169
+ };
165
170
  }
166
171
  function gt(e) {
167
- return M.previewLoadingKeys.includes(ht(e));
172
+ return `${N.file?.fileId ?? ""}:${e}`;
168
173
  }
169
174
  function _t(e) {
170
- return M.previewErrorMap[ht(e)] || "";
175
+ return N.previewLoadingKeys.includes(gt(e));
171
176
  }
172
177
  function vt(e) {
173
- return M.placements.filter((t) => t.pageIndex === e);
178
+ return N.previewErrorMap[gt(e)] || "";
174
179
  }
175
180
  function yt(e) {
176
- let t = q.value;
177
- return t && t.pageIndex === e.pageIndex ? r(t, e) : void 0;
181
+ return N.placements.filter((t) => t.pageIndex === e);
178
182
  }
179
183
  function bt(e) {
180
- let t = i(e);
184
+ let t = G.value;
185
+ return t && t.pageIndex === e.pageIndex ? r(t, e) : void 0;
186
+ }
187
+ function xt(e) {
188
+ let t = i(e), n = q(e.pageIndex), r = Y(n), a = J(n);
181
189
  return {
182
- left: `${t.signLeft}px`,
183
- top: `${t.signTop}px`,
184
- width: `${t.signWidth}px`,
185
- height: `${t.signHeight}px`
190
+ left: `${t.signLeft * r.width / Math.max(1, a.width)}px`,
191
+ top: `${t.signTop * r.height / Math.max(1, a.height)}px`,
192
+ width: `${t.signWidth * r.width / Math.max(1, a.width)}px`,
193
+ height: `${t.signHeight * r.height / Math.max(1, a.height)}px`
186
194
  };
187
195
  }
188
- function xt(e) {
189
- let t = i(e);
196
+ function St(e) {
197
+ let t = i(e), n = q(e.pageIndex), r = Y(n), a = J(n), o = r.width / Math.max(1, a.width), s = r.height / Math.max(1, a.height);
190
198
  return {
191
- "--gd-contract-sign-left": `${t.signLeft}px`,
192
- "--gd-contract-sign-top": `${t.signTop}px`,
193
- "--gd-contract-sign-right": `${t.signLeft + t.signWidth}px`,
194
- "--gd-contract-sign-bottom": `${t.signTop + t.signHeight}px`
199
+ "--gd-contract-sign-left": `${t.signLeft * o}px`,
200
+ "--gd-contract-sign-top": `${t.signTop * s}px`,
201
+ "--gd-contract-sign-right": `${(t.signLeft + t.signWidth) * o}px`,
202
+ "--gd-contract-sign-bottom": `${(t.signTop + t.signHeight) * s}px`
195
203
  };
196
204
  }
197
- function St(e, t) {
205
+ function Ct(e, t) {
206
+ let n = Y(t), r = J(t), i = e.axis === "x" ? n.width / Math.max(1, r.width) : n.height / Math.max(1, r.height);
207
+ return e.axis === "x" ? { left: `${e.position * i}px` } : { top: `${e.position * i}px` };
208
+ }
209
+ function wt(e, t) {
198
210
  return n(e, t, {
199
- sealSizeLimit: M.sealSizeLimit,
211
+ sealSizeLimit: N.sealSizeLimit,
200
212
  sealTypes: e.sealType,
201
- sealTypeOptions: M.sealTypeOptions
213
+ sealTypeOptions: N.sealTypeOptions
202
214
  });
203
215
  }
204
- function Ct(e) {
205
- return pt.value.get(e) ?? ft(e);
216
+ function Tt(e) {
217
+ return ht.value.get(e) ?? mt(e);
206
218
  }
207
- function wt(e) {
208
- return t(e, M.resizable, M.readonly) && e.id === M.selectedPlacementId;
219
+ function Et(e) {
220
+ return t(e, N.resizable, N.readonly) && e.id === N.selectedPlacementId;
209
221
  }
210
- function Tt(e) {
222
+ function Dt(e) {
211
223
  return {
212
224
  ...e,
213
225
  sealType: e.sealType ? [...e.sealType] : void 0
214
226
  };
215
227
  }
216
- function Et() {
217
- let e = P.value, t = F.value;
228
+ function Ot() {
229
+ let e = F.value, t = I.value;
218
230
  if (!e) return {
219
231
  layoutScrollTop: 0,
220
232
  viewportHeight: 0
@@ -225,8 +237,8 @@ var xe = { class: "gd-ant-contract-signing-location__workspace" }, Se = { class:
225
237
  viewportHeight: e.clientHeight
226
238
  };
227
239
  }
228
- function Dt(e, t) {
229
- let n = F.value;
240
+ function kt(e, t) {
241
+ let n = I.value;
230
242
  if (n) {
231
243
  let r = n.getBoundingClientRect();
232
244
  return {
@@ -234,7 +246,7 @@ var xe = { class: "gd-ant-contract-signing-location__workspace" }, Se = { class:
234
246
  y: t - r.top
235
247
  };
236
248
  }
237
- let r = P.value;
249
+ let r = F.value;
238
250
  if (!r) return {
239
251
  x: e,
240
252
  y: t
@@ -245,83 +257,83 @@ var xe = { class: "gd-ant-contract-signing-location__workspace" }, Se = { class:
245
257
  y: t - i.top + r.scrollTop - o
246
258
  };
247
259
  }
248
- function Ot() {
260
+ function At() {
249
261
  return !!(document.activeElement && document.activeElement.tagName === "INPUT");
250
262
  }
251
263
  function X() {
252
- let e = Et();
253
- Ye.value = ie(U.value, e.layoutScrollTop, e.viewportHeight, 1);
254
- let t = p(U.value, e.layoutScrollTop + 1);
264
+ let e = Ot();
265
+ Ye.value = te(U.value, e.layoutScrollTop, e.viewportHeight, 1);
266
+ let t = h(U.value, e.layoutScrollTop + 1);
255
267
  if (t) {
256
268
  let e = L.value !== t.pageIndex;
257
- L.value = t.pageIndex, Ot() || Q(t.pageIndex), e && N("view-page", t.pageIndex);
269
+ L.value = t.pageIndex, At() || Q(t.pageIndex), e && P("view-page", t.pageIndex);
258
270
  }
259
271
  }
260
272
  function Z() {
261
273
  let e = Ye.value;
262
- N("visible-pages", U.value.slice(Math.max(0, e.start), e.end + 1).map((e) => e.pageIndex));
274
+ P("visible-pages", U.value.slice(Math.max(0, e.start), e.end + 1).map((e) => e.pageIndex));
263
275
  }
264
- function kt() {
276
+ function jt() {
265
277
  X(), V && clearTimeout(V), V = setTimeout(() => {
266
- Z(), L.value !== tt && (tt = L.value, N("page-change", L.value));
278
+ Z(), L.value !== tt && (tt = L.value, P("page-change", L.value));
267
279
  }, 80);
268
280
  }
269
- function At(e) {
270
- let t = P.value, n = F.value, r = nt;
281
+ function Mt(e) {
282
+ let t = F.value, n = I.value, r = nt;
271
283
  if (nt = void 0, !t || !n || !r) return;
272
284
  let i = U.value.find((e) => e.pageIndex === r.pageIndex);
273
285
  i && (t.scrollTop = n.offsetTop + i.top + r.offsetInPage * e, X());
274
286
  }
275
- function jt(e) {
276
- let t = P.value, n = F.value;
277
- t && (L.value = e, Q(e), N("page-change", e), tt = e, S(() => {
278
- let r = ne(U.value, e);
287
+ function Nt(e) {
288
+ let t = F.value, n = I.value;
289
+ t && (L.value = e, Q(e), P("page-change", e), tt = e, se(() => {
290
+ let r = _(U.value, e);
279
291
  t.scrollTop = (n?.offsetTop ?? 0) + r, X(), Z();
280
292
  }));
281
293
  }
282
- function Mt(e) {
283
- let t = M.placements.find((t) => t.id === e), n = P.value, r = F.value;
294
+ function Pt(e) {
295
+ let t = N.placements.find((t) => t.id === e), n = F.value, r = I.value;
284
296
  if (!t || !n) return;
285
297
  let a = U.value.find((e) => e.pageIndex === t.pageIndex);
286
- a && (L.value = t.pageIndex, Q(t.pageIndex), S(() => {
287
- let e = Et(), o = a.top + i(t).signTop * M.zoom, ee = o + i(t).signHeight * M.zoom, s = e.layoutScrollTop, c = s + e.viewportHeight;
288
- (o < s || ee > c) && (n.scrollTop = (r?.offsetTop ?? 0) + Math.max(0, o - 24)), X(), Z(), N("page-change", t.pageIndex);
298
+ a && (L.value = t.pageIndex, Q(t.pageIndex), se(() => {
299
+ let e = Ot(), o = q(t.pageIndex), s = Y(o), c = J(o), l = a.top + i(t).signTop * s.height / Math.max(1, c.height) * N.zoom, u = l + i(t).signHeight * s.height / Math.max(1, c.height) * N.zoom, d = e.layoutScrollTop, f = d + e.viewportHeight;
300
+ (l < d || u > f) && (n.scrollTop = (r?.offsetTop ?? 0) + Math.max(0, l - 24)), X(), Z(), P("page-change", t.pageIndex);
289
301
  }));
290
302
  }
291
303
  function Q(e) {
292
- let t = M.pages.findIndex((t) => t.pageIndex === e);
293
- I.value = t >= 0 ? t + 1 : 1;
304
+ let t = N.pages.findIndex((t) => t.pageIndex === e);
305
+ Je.value = t >= 0 ? t + 1 : 1;
294
306
  }
295
- function Nt(e) {
296
- let t = M.pages.findIndex((e) => e.pageIndex === L.value), n = Math.min(M.pages.length - 1, Math.max(0, (t < 0 ? 0 : t) + e)), r = M.pages[n];
297
- r && jt(r.pageIndex);
307
+ function Ft(e) {
308
+ let t = N.pages.findIndex((e) => e.pageIndex === L.value), n = Math.min(N.pages.length - 1, Math.max(0, (t < 0 ? 0 : t) + e)), r = N.pages[n];
309
+ r && Nt(r.pageIndex);
298
310
  }
299
- function Pt(e) {
311
+ function It(e) {
300
312
  let t = Number(e.target.value);
301
313
  if (!Number.isFinite(t)) {
302
314
  Q(L.value);
303
315
  return;
304
316
  }
305
- let n = Math.min(M.pages.length, Math.max(1, Math.round(t))) - 1, r = M.pages[n];
306
- r ? jt(r.pageIndex) : Q(L.value);
317
+ let n = Math.min(N.pages.length, Math.max(1, Math.round(t))) - 1, r = N.pages[n];
318
+ r ? Nt(r.pageIndex) : Q(L.value);
307
319
  }
308
- function Ft(e, t = "user") {
309
- t === "user" && Qe(), N("zoom-change", e);
320
+ function Lt(e, t = "user") {
321
+ t === "user" && Qe(), P("zoom-change", e);
310
322
  }
311
- function It(e) {
312
- e.target.closest(".gd-ant-contract-signing-location__placement") || N("select", "");
323
+ function Rt(e) {
324
+ e.target.closest(".gd-ant-contract-signing-location__placement") || P("select", "");
313
325
  }
314
- function Lt() {
315
- window.addEventListener("pointermove", Vt, { passive: !1 }), window.addEventListener("pointerup", $), window.addEventListener("pointercancel", $);
326
+ function zt() {
327
+ window.addEventListener("pointermove", Ut, { passive: !1 }), window.addEventListener("pointerup", $), window.addEventListener("pointercancel", $);
316
328
  }
317
- function Rt() {
318
- window.removeEventListener("pointermove", Vt), window.removeEventListener("pointerup", $), window.removeEventListener("pointercancel", $);
329
+ function Bt() {
330
+ window.removeEventListener("pointermove", Ut), window.removeEventListener("pointerup", $), window.removeEventListener("pointercancel", $);
319
331
  }
320
- function zt(e, t, n) {
321
- e.stopPropagation(), N("select", t.id);
322
- let r = Y(t.pageIndex);
323
- if (M.readonly || !r || !l(r) || e.button !== 0) return;
324
- let i = Dt(e.clientX, e.clientY), a = f(U.value, M.pages, i.x, i.y), o = e.currentTarget;
332
+ function Vt(e, t, n) {
333
+ e.stopPropagation(), P("select", t.id);
334
+ let r = q(t.pageIndex);
335
+ if (N.readonly || !r || !d(r) || e.button !== 0) return;
336
+ let i = kt(e.clientX, e.clientY), a = m(U.value, N.pages, i.x, i.y), o = e.currentTarget;
325
337
  o.focus({ preventScroll: !0 }), R.value = {
326
338
  pointerId: e.pointerId,
327
339
  mode: n ? "resize" : "move",
@@ -329,102 +341,102 @@ var xe = { class: "gd-ant-contract-signing-location__workspace" }, Se = { class:
329
341
  placementId: t.id,
330
342
  startX: e.clientX,
331
343
  startY: e.clientY,
332
- origin: Tt(t),
344
+ origin: Dt(t),
333
345
  grabOffsetX: (a?.x ?? t.signLeft) - t.signLeft,
334
346
  grabOffsetY: (a?.y ?? t.signTop) - t.signTop
335
347
  }, z = {
336
348
  clientX: e.clientX,
337
349
  clientY: e.clientY,
338
350
  pointerId: e.pointerId
339
- }, Lt(), Kt();
351
+ }, zt(), Jt();
340
352
  try {
341
353
  o.setPointerCapture(e.pointerId);
342
354
  } catch {}
343
355
  }
344
- function Bt(e, t, n) {
345
- zt(e, t, n);
356
+ function Ht(e, t, n) {
357
+ Vt(e, t, n);
346
358
  }
347
- function Vt(e) {
359
+ function Ut(e) {
348
360
  let t = R.value;
349
361
  !t || t.pointerId !== e.pointerId || (e.preventDefault(), z = {
350
362
  clientX: e.clientX,
351
363
  clientY: e.clientY,
352
364
  pointerId: e.pointerId
353
- }, Ht(z));
365
+ }, Wt(z));
354
366
  }
355
367
  function $(e) {
356
- R.value?.pointerId === e.pointerId && (R.value = void 0, z = void 0, $e.value = [], et.value = void 0, qt(), Rt());
368
+ R.value?.pointerId === e.pointerId && (R.value = void 0, z = void 0, $e.value = [], et.value = void 0, Yt(), Bt());
357
369
  }
358
- function Ht(e) {
370
+ function Wt(e) {
359
371
  let t = R.value;
360
372
  if (!t) return;
361
373
  if (t.mode === "resize") {
362
- Ut(t, e);
374
+ Gt(t, e);
363
375
  return;
364
376
  }
365
- let n = Dt(e.clientX, e.clientY), r = f(U.value, M.pages, n.x, n.y);
377
+ let n = kt(e.clientX, e.clientY), r = m(U.value, N.pages, n.x, n.y);
366
378
  if (!r) return;
367
- let i = Gt(r.pageIndex, t.origin.pageIndex);
368
- if (!i || !l(i)) return;
369
- let a = ee(St({
379
+ let i = qt(r.pageIndex, t.origin.pageIndex);
380
+ if (!i || !d(i)) return;
381
+ let a = s(wt({
370
382
  ...t.origin,
371
383
  pageIndex: i.pageIndex,
372
384
  signLeft: r.x - t.grabOffsetX,
373
385
  signTop: r.y - t.grabOffsetY
374
- }, i), vt(i.pageIndex), M.zoom), o = St(a.placement, i);
375
- $e.value = a.guides, et.value = i.pageIndex, N("update", o);
386
+ }, i), yt(i.pageIndex), N.zoom, void 0, i), o = wt(a.placement, i);
387
+ $e.value = a.guides, et.value = i.pageIndex, P("update", o);
376
388
  }
377
- function Ut(e, t) {
378
- let n = Y(e.origin.pageIndex), r = e.handle;
379
- if (!n || !r || !l(n)) return;
389
+ function Gt(e, t) {
390
+ let n = q(e.origin.pageIndex), r = e.handle;
391
+ if (!n || !r || !d(n)) return;
380
392
  let a = U.value.find((e) => e.pageIndex === n.pageIndex);
381
393
  if (!a) return;
382
- let o = Dt(t.clientX, t.clientY), ee = n.width / Math.max(1, a.width), s = n.height / Math.max(1, a.height), c = (o.x - a.left) * ee, te = (o.y - a.top) * s;
394
+ let o = kt(t.clientX, t.clientY), s = Y(n), c = n.width / Math.max(1, s.width * N.zoom), l = n.height / Math.max(1, s.height * N.zoom), u = (o.x - a.left) * c, f = (o.y - a.top) * l;
383
395
  if (e.origin.signType === "seal") {
384
- Wt(e, n, r, c, te);
396
+ Kt(e, n, r, u, f);
385
397
  return;
386
398
  }
387
- let u = i(e.origin), d = u.signLeft, f = u.signTop, p = u.signLeft + u.signWidth, m = u.signTop + u.signHeight;
388
- r.includes("w") && (d = c), r.includes("e") && (p = c), r.includes("n") && (f = te), r.includes("s") && (m = te), p - d < 8 && (r.includes("w") ? d = p - 8 : p = d + 8), m - f < 8 && (r.includes("n") ? f = m - 8 : m = f + 8), N("update", St({
399
+ let p = i(e.origin), m = p.signLeft, h = p.signTop, g = p.signLeft + p.signWidth, _ = p.signTop + p.signHeight;
400
+ r.includes("w") && (m = u), r.includes("e") && (g = u), r.includes("n") && (h = f), r.includes("s") && (_ = f), g - m < 8 && (r.includes("w") ? m = g - 8 : g = m + 8), _ - h < 8 && (r.includes("n") ? h = _ - 8 : _ = h + 8), P("update", wt({
389
401
  ...e.origin,
390
- signLeft: d,
391
- signTop: f,
392
- signWidth: p - d,
393
- signHeight: m - f
402
+ signLeft: m,
403
+ signTop: h,
404
+ signWidth: g - m,
405
+ signHeight: _ - h
394
406
  }, n));
395
407
  }
396
- function Wt(e, t, n, r, i) {
397
- let a = o(e.origin, n, r, i, t, M.sealSizeLimit);
398
- N("update", St({
408
+ function Kt(e, t, n, r, i) {
409
+ let a = o(e.origin, n, r, i, t, N.sealSizeLimit);
410
+ P("update", wt({
399
411
  ...e.origin,
400
412
  ...a
401
413
  }, t));
402
414
  }
403
- function Gt(e, t) {
404
- let n = Y(e);
405
- return n && l(n) ? n : Y(t);
415
+ function qt(e, t) {
416
+ let n = q(e);
417
+ return n && d(n) ? n : q(t);
406
418
  }
407
- function Kt() {
408
- qt();
419
+ function Jt() {
420
+ Yt();
409
421
  let e = () => {
410
- let t = R.value, n = P.value;
422
+ let t = R.value, n = F.value;
411
423
  if (!t || !n || !z) {
412
424
  B = 0;
413
425
  return;
414
426
  }
415
- let r = n.getBoundingClientRect(), i = m(z.clientY, r);
416
- i !== 0 && (n.scrollTop += i, X(), Ht(z)), B = requestAnimationFrame(e);
427
+ let r = n.getBoundingClientRect(), i = g(z.clientY, r);
428
+ i !== 0 && (n.scrollTop += i, X(), Wt(z)), B = requestAnimationFrame(e);
417
429
  };
418
430
  B = requestAnimationFrame(e);
419
431
  }
420
- function qt() {
432
+ function Yt() {
421
433
  B &&= (cancelAnimationFrame(B), 0);
422
434
  }
423
- function Jt(e, t) {
424
- let n = Y(t.pageIndex);
425
- if (M.readonly || !n || !l(n)) return;
435
+ function Xt(e, t) {
436
+ let n = q(t.pageIndex);
437
+ if (N.readonly || !n || !d(n)) return;
426
438
  if (e.key === "Delete" || e.key === "Backspace") {
427
- e.preventDefault(), N("remove", t.id);
439
+ e.preventDefault(), P("remove", t.id);
428
440
  return;
429
441
  }
430
442
  let r = e.shiftKey ? 10 : 1, i = 0, o = 0;
@@ -433,116 +445,115 @@ var xe = { class: "gd-ant-contract-signing-location__workspace" }, Se = { class:
433
445
  else if (e.key === "ArrowUp") o = -r;
434
446
  else if (e.key === "ArrowDown") o = r;
435
447
  else return;
436
- e.preventDefault(), N("update", a(t, i, o, n, {
437
- width: n.width,
438
- height: n.height
439
- }, { sealSizeLimit: M.sealSizeLimit }));
448
+ e.preventDefault();
449
+ let s = Y(n), c = J(n);
450
+ P("update", a(t, i * s.width / Math.max(1, c.width), o * s.height / Math.max(1, c.height), n, Y(n), { sealSizeLimit: N.sealSizeLimit }));
440
451
  }
441
- function Yt(e) {
452
+ function Zt(e) {
442
453
  let t = e.dataTransfer?.getData("application/x-gd-contract-signing-location") || e.dataTransfer?.getData("text/plain");
443
454
  if (t) try {
444
455
  let e = JSON.parse(t);
445
- return Zt(e.type) ? e.type : void 0;
456
+ return $t(e.type) ? e.type : void 0;
446
457
  } catch {
447
- return Zt(t) ? t : void 0;
458
+ return $t(t) ? t : void 0;
448
459
  }
449
460
  }
450
- function Xt(e) {
451
- if (M.readonly) return;
452
- let t = Yt(e);
461
+ function Qt(e) {
462
+ if (N.readonly) return;
463
+ let t = Zt(e);
453
464
  if (!t) return;
454
465
  e.preventDefault();
455
- let n = Dt(e.clientX, e.clientY), r = f(U.value, M.pages, n.x, n.y, 1);
456
- r && N("add", t, r.x, r.y, r.pageIndex);
466
+ let n = kt(e.clientX, e.clientY), r = m(U.value, N.pages, n.x, n.y, 1);
467
+ r && P("add", t, r.x, r.y, r.pageIndex);
457
468
  }
458
- function Zt(e) {
469
+ function $t(e) {
459
470
  return e === "seal" || e === "signature" || e === "date";
460
471
  }
461
- return Ke({
462
- scrollToPage: jt,
463
- scrollToPlacement: Mt,
472
+ return Ge({
473
+ scrollToPage: Nt,
474
+ scrollToPlacement: Pt,
464
475
  fitWidth: Ze
465
- }), (t, n) => (T(), v("main", xe, [y("header", Se, [y("div", null, [y("strong", null, D(x.file?.fileName || "合同页面"), 1), K.value ? (T(), v("span", Ce, "第 " + D(K.value.displayPageNumber) + " 页 · " + D(W.value ? "HTML" : "PDF") + " " + D(K.value.width) + " × " + D(K.value.height), 1)) : _("", !0)]), y("div", we, [y("div", Te, [
466
- b(O(j), {
476
+ }), (t, n) => (T(), b("main", be, [x("header", xe, [x("div", null, [x("strong", null, O(C.file?.fileName || "合同页面"), 1), lt.value ? (T(), b("span", Se, "第 " + O(lt.value.displayPageNumber) + " 页 · " + O(W.value ? "HTML" : "PDF") + " " + O(lt.value.width) + " × " + O(lt.value.height), 1)) : ae("", !0)]), x("div", Ce, [x("div", we, [
477
+ S(k(M), {
467
478
  size: "small",
468
- disabled: I.value <= 1,
479
+ disabled: Je.value <= 1,
469
480
  "aria-label": "上一页",
470
- onClick: n[0] ||= (e) => Nt(-1)
481
+ onClick: n[0] ||= (e) => Ft(-1)
471
482
  }, {
472
- default: k(() => [b(O(_e), { "aria-hidden": "true" })]),
483
+ default: A(() => [S(k(ge), { "aria-hidden": "true" })]),
473
484
  _: 1
474
485
  }, 8, ["disabled"]),
475
- y("label", null, [
476
- n[6] ||= ce(" 第 ", -1),
477
- y("input", {
478
- value: I.value,
486
+ x("label", null, [
487
+ n[6] ||= oe(" 第 ", -1),
488
+ x("input", {
489
+ value: Je.value,
479
490
  type: "number",
480
491
  min: "1",
481
- max: Math.max(1, x.pages.length),
482
- onChange: Pt,
483
- onKeydown: me(Pt, ["enter"])
484
- }, null, 40, Ee),
485
- ce(" / " + D(x.pages.length) + " 页 ", 1)
492
+ max: Math.max(1, C.pages.length),
493
+ onChange: It,
494
+ onKeydown: pe(It, ["enter"])
495
+ }, null, 40, Te),
496
+ oe(" / " + O(C.pages.length) + " 页 ", 1)
486
497
  ]),
487
- b(O(j), {
498
+ S(k(M), {
488
499
  size: "small",
489
- disabled: I.value >= x.pages.length,
500
+ disabled: Je.value >= C.pages.length,
490
501
  "aria-label": "下一页",
491
- onClick: n[1] ||= (e) => Nt(1)
502
+ onClick: n[1] ||= (e) => Ft(1)
492
503
  }, {
493
- default: k(() => [b(O(ve), { "aria-hidden": "true" })]),
504
+ default: A(() => [S(k(_e), { "aria-hidden": "true" })]),
494
505
  _: 1
495
506
  }, 8, ["disabled"])
496
- ]), y("div", De, [
497
- b(O(j), {
507
+ ]), x("div", Ee, [
508
+ S(k(M), {
498
509
  size: "small",
499
- disabled: x.zoom <= ct.value,
510
+ disabled: C.zoom <= ut.value,
500
511
  "aria-label": "缩小页面",
501
- onClick: n[2] ||= (e) => Ft(x.zoom - .1)
512
+ onClick: n[2] ||= (e) => Lt(C.zoom - .1)
502
513
  }, {
503
- default: k(() => [b(O(be), { "aria-hidden": "true" })]),
514
+ default: A(() => [S(k(ye), { "aria-hidden": "true" })]),
504
515
  _: 1
505
516
  }, 8, ["disabled"]),
506
- y("button", {
517
+ x("button", {
507
518
  type: "button",
508
- onClick: n[3] ||= (e) => Ft(1)
509
- }, D(Math.round(x.zoom * 100)) + "%", 1),
510
- b(O(j), {
519
+ onClick: n[3] ||= (e) => Lt(1)
520
+ }, O(Math.round(C.zoom * 100)) + "%", 1),
521
+ S(k(M), {
511
522
  size: "small",
512
- disabled: x.zoom >= lt.value,
523
+ disabled: C.zoom >= dt.value,
513
524
  "aria-label": "放大页面",
514
- onClick: n[4] ||= (e) => Ft(x.zoom + .1)
525
+ onClick: n[4] ||= (e) => Lt(C.zoom + .1)
515
526
  }, {
516
- default: k(() => [b(O(ye), { "aria-hidden": "true" })]),
527
+ default: A(() => [S(k(ve), { "aria-hidden": "true" })]),
517
528
  _: 1
518
529
  }, 8, ["disabled"]),
519
- b(O(j), {
530
+ S(k(M), {
520
531
  size: "small",
521
532
  "aria-label": "适应宽度",
522
533
  title: "适应宽度",
523
- onClick: O(Ze)
534
+ onClick: k(Ze)
524
535
  }, {
525
- default: k(() => [b(O(ge), { "aria-hidden": "true" })]),
536
+ default: A(() => [S(k(he), { "aria-hidden": "true" })]),
526
537
  _: 1
527
538
  }, 8, ["onClick"])
528
- ])])]), y("div", {
539
+ ])])]), x("div", {
529
540
  ref_key: "scrollRef",
530
- ref: P,
541
+ ref: F,
531
542
  class: "gd-ant-contract-signing-location__canvas-scroll",
532
- onScrollPassive: kt,
533
- onClick: It,
534
- onDragover: n[5] ||= A(() => {}, ["prevent"]),
535
- onDrop: Xt
536
- }, [x.pages.length ? (T(), v("div", {
543
+ onScrollPassive: jt,
544
+ onClick: Rt,
545
+ onDragover: n[5] ||= j(() => {}, ["prevent"]),
546
+ onDrop: Qt
547
+ }, [C.pages.length ? (T(), b("div", {
537
548
  key: 1,
538
549
  ref_key: "stackRef",
539
- ref: F,
550
+ ref: I,
540
551
  class: "gd-ant-contract-signing-location__page-stack",
541
552
  style: w({
542
553
  width: `${rt.value.width}px`,
543
554
  height: `${rt.value.height}px`
544
555
  })
545
- }, [(T(!0), v(h, null, fe(st.value, (t) => (T(), v("div", {
556
+ }, [(T(!0), b(v, null, E(ct.value, (t) => (T(), b("div", {
546
557
  key: t.layout.pageIndex,
547
558
  class: "gd-ant-contract-signing-location__page-shell",
548
559
  style: w({
@@ -551,89 +562,89 @@ var xe = { class: "gd-ant-contract-signing-location__workspace" }, Se = { class:
551
562
  width: `${t.layout.width}px`,
552
563
  height: `${t.layout.height}px`
553
564
  })
554
- }, [y("div", {
565
+ }, [x("div", {
555
566
  class: "gd-ant-contract-signing-location__page",
556
567
  style: w({
557
- width: `${t.logical.width}px`,
558
- height: `${t.logical.height}px`,
559
- transform: `scale(${x.zoom})`
568
+ width: `${Y(t.page).width}px`,
569
+ height: `${Y(t.page).height}px`,
570
+ transform: `scale(${C.zoom})`
560
571
  }),
561
- "aria-label": `${x.file?.fileName || "合同"}第 ${t.page.displayPageNumber} 页`
562
- }, [W.value && t.templatePage ? (T(), se(e, {
572
+ "aria-label": `${C.file?.fileName || "合同"}第 ${t.page.displayPageNumber} 页`
573
+ }, [W.value && t.templatePage ? (T(), ie(e, {
563
574
  key: 0,
564
575
  page: t.templatePage
565
- }, null, 8, ["page"])) : W.value ? (T(), v("div", ke, [n[8] ||= y("strong", null, "模板页面无法渲染", -1), y("span", null, D(G.value || "页面结构无效,请回到模板设计器修复后重试。"), 1)])) : t.page.previewUrl ? (T(), v("img", {
576
+ }, null, 8, ["page"])) : W.value ? (T(), b("div", Oe, [n[8] ||= x("strong", null, "模板页面无法渲染", -1), x("span", null, O(ot.value || "页面结构无效,请回到模板设计器修复后重试。"), 1)])) : t.page.previewUrl ? (T(), b("img", {
566
577
  key: 2,
567
578
  class: "gd-ant-contract-signing-location__page-image",
568
579
  src: t.page.previewUrl,
569
580
  alt: "合同页面预览"
570
- }, null, 8, Ae)) : (T(), v("div", je, [gt(t.layout.pageIndex) ? (T(), v(h, { key: 0 }, [y("strong", null, "第 " + D(t.page.displayPageNumber) + " 页加载中…", 1), y("span", null, D(t.page.width) + " × " + D(t.page.height), 1)], 64)) : _t(t.layout.pageIndex) ? (T(), v(h, { key: 1 }, [
571
- n[9] ||= y("strong", null, "合同页面预览加载失败", -1),
572
- y("span", null, D(_t(t.layout.pageIndex)), 1),
573
- y("button", {
581
+ }, null, 8, ke)) : (T(), b("div", Ae, [_t(t.layout.pageIndex) ? (T(), b(v, { key: 0 }, [x("strong", null, "第 " + O(t.page.displayPageNumber) + " 页加载中…", 1), x("span", null, O(t.page.width) + " × " + O(t.page.height), 1)], 64)) : vt(t.layout.pageIndex) ? (T(), b(v, { key: 1 }, [
582
+ n[9] ||= x("strong", null, "合同页面预览加载失败", -1),
583
+ x("span", null, O(vt(t.layout.pageIndex)), 1),
584
+ x("button", {
574
585
  type: "button",
575
- onClick: A((e) => N("retry", t.layout.pageIndex), ["stop"])
576
- }, "重试当前页", 8, Me)
577
- ], 64)) : O(l)(t.page) ? (T(), v(h, { key: 3 }, [
578
- y("strong", null, "第 " + D(t.page.displayPageNumber) + " 页", 1),
579
- y("span", null, D(t.page.width) + " × " + D(t.page.height), 1),
580
- n[12] ||= y("small", null, "等待 dataProvider 返回页面预览图", -1)
581
- ], 64)) : (T(), v(h, { key: 2 }, [
582
- n[10] ||= y("strong", null, "页面元数据不完整", -1),
583
- n[11] ||= y("span", null, "缺少有效的原始宽高,无法安全计算签署坐标。", -1),
584
- y("button", {
586
+ onClick: j((e) => P("retry", t.layout.pageIndex), ["stop"])
587
+ }, "重试当前页", 8, je)
588
+ ], 64)) : k(d)(t.page) ? (T(), b(v, { key: 3 }, [
589
+ x("strong", null, "第 " + O(t.page.displayPageNumber) + " 页", 1),
590
+ x("span", null, O(t.page.width) + " × " + O(t.page.height), 1),
591
+ n[12] ||= x("small", null, "等待 dataProvider 返回页面预览图", -1)
592
+ ], 64)) : (T(), b(v, { key: 2 }, [
593
+ n[10] ||= x("strong", null, "页面元数据不完整", -1),
594
+ n[11] ||= x("span", null, "缺少有效的原始宽高,无法安全计算签署坐标。", -1),
595
+ x("button", {
585
596
  type: "button",
586
- onClick: A((e) => N("retry", t.layout.pageIndex), ["stop"])
587
- }, "重新加载页面", 8, Ne)
588
- ], 64))])), y("div", Pe, [y("div", Fe, [
589
- q.value && q.value.pageIndex === t.layout.pageIndex ? (T(), v("div", {
597
+ onClick: j((e) => P("retry", t.layout.pageIndex), ["stop"])
598
+ }, "重新加载页面", 8, Me)
599
+ ], 64))])), x("div", Ne, [x("div", Pe, [
600
+ G.value && G.value.pageIndex === t.layout.pageIndex ? (T(), b("div", {
590
601
  key: 0,
591
602
  class: "gd-ant-contract-signing-location__coordinate-guides",
592
- style: w(xt(q.value)),
603
+ style: w(St(G.value)),
593
604
  "aria-hidden": "true"
594
605
  }, [
595
- y("span", Ie, [y("small", null, "上 " + D(yt(t.page)?.top), 1)]),
596
- y("span", Le, [y("small", null, "下 " + D(yt(t.page)?.bottom), 1)]),
597
- y("span", Re, [y("small", null, "左 " + D(yt(t.page)?.left), 1)]),
598
- y("span", ze, [y("small", null, "右 " + D(yt(t.page)?.right), 1)])
599
- ], 4)) : _("", !0),
600
- $e.value.length && et.value === t.layout.pageIndex ? (T(), v("div", Be, [(T(!0), v(h, null, fe($e.value, (e, t) => (T(), v("span", {
601
- key: `${e.axis}-${t}`,
602
- class: C(e.axis === "x" ? "is-vertical" : "is-horizontal"),
603
- style: w(e.axis === "x" ? { left: `${e.position}px` } : { top: `${e.position}px` })
604
- }, null, 6))), 128))])) : _("", !0),
605
- (T(!0), v(h, null, fe(vt(t.layout.pageIndex), (e) => (T(), v("button", {
606
+ x("span", Fe, [x("small", null, "上 " + O(bt(t.page)?.top), 1)]),
607
+ x("span", Ie, [x("small", null, "下 " + O(bt(t.page)?.bottom), 1)]),
608
+ x("span", Le, [x("small", null, "左 " + O(bt(t.page)?.left), 1)]),
609
+ x("span", Re, [x("small", null, "右 " + O(bt(t.page)?.right), 1)])
610
+ ], 4)) : ae("", !0),
611
+ $e.value.length && et.value === t.layout.pageIndex ? (T(), b("div", ze, [(T(!0), b(v, null, E($e.value, (e, n) => (T(), b("span", {
612
+ key: `${e.axis}-${n}`,
613
+ class: ce(e.axis === "x" ? "is-vertical" : "is-horizontal"),
614
+ style: w(Ct(e, t.page))
615
+ }, null, 6))), 128))])) : ae("", !0),
616
+ (T(!0), b(v, null, E(yt(t.layout.pageIndex), (e) => (T(), b("button", {
606
617
  key: e.id,
607
618
  type: "button",
608
- class: C(["gd-ant-contract-signing-location__placement", [`is-${e.signType}`, { "is-selected": e.id === x.selectedPlacementId }]]),
609
- style: w(bt(e)),
610
- title: Ct(e).alt,
611
- "aria-label": Ct(e).alt,
612
- "aria-pressed": e.id === x.selectedPlacementId,
613
- onClick: A((t) => N("select", e.id), ["stop"]),
614
- onPointerdown: (t) => zt(t, e),
619
+ class: ce(["gd-ant-contract-signing-location__placement", [`is-${e.signType}`, { "is-selected": e.id === C.selectedPlacementId }]]),
620
+ style: w(xt(e)),
621
+ title: Tt(e).alt,
622
+ "aria-label": Tt(e).alt,
623
+ "aria-pressed": e.id === C.selectedPlacementId,
624
+ onClick: j((t) => P("select", e.id), ["stop"]),
625
+ onPointerdown: (t) => Vt(t, e),
615
626
  onLostpointercapture: $,
616
- onKeydown: (t) => Jt(t, e)
627
+ onKeydown: (t) => Xt(t, e)
617
628
  }, [
618
- y("span", He, [y("img", {
629
+ x("span", Ve, [x("img", {
619
630
  class: "gd-ant-contract-signing-location__placement-visual",
620
- src: Ct(e).dataUrl,
621
- alt: Ct(e).alt,
631
+ src: Tt(e).dataUrl,
632
+ alt: Tt(e).alt,
622
633
  draggable: "false"
623
- }, null, 8, Ue)]),
624
- e.mustSign ? (T(), v("span", We, "必签")) : _("", !0),
625
- (T(!0), v(h, null, fe(wt(e) ? Je : [], (t) => (T(), v("i", {
634
+ }, null, 8, He)]),
635
+ e.mustSign ? (T(), b("span", Ue, "必签")) : ae("", !0),
636
+ (T(!0), b(v, null, E(Et(e) ? qe : [], (t) => (T(), b("i", {
626
637
  key: t,
627
- class: C(["gd-ant-contract-signing-location__resize-handle", `is-${t}`]),
628
- onPointerdown: A((n) => Bt(n, e, t), ["stop"])
629
- }, null, 42, Ge))), 128))
630
- ], 46, Ve))), 128))
631
- ])])], 12, Oe)], 4))), 128))], 4)) : (T(), v("div", {
638
+ class: ce(["gd-ant-contract-signing-location__resize-handle", `is-${t}`]),
639
+ onPointerdown: j((n) => Ht(n, e, t), ["stop"])
640
+ }, null, 42, We))), 128))
641
+ ], 46, Be))), 128))
642
+ ])])], 12, De)], 4))), 128))], 4)) : (T(), b("div", {
632
643
  key: 0,
633
- class: C(["gd-ant-contract-signing-location__canvas-state", { "is-error": W.value && G.value }]),
644
+ class: ce(["gd-ant-contract-signing-location__canvas-state", { "is-error": W.value && ot.value }]),
634
645
  role: "status"
635
- }, [W.value && G.value ? (T(), v(h, { key: 0 }, [n[7] ||= y("strong", null, "合同模板无法渲染", -1), y("span", null, D(G.value), 1)], 64)) : (T(), v(h, { key: 1 }, [ce("请选择可用的合同页面")], 64))], 2))], 544)]));
646
+ }, [W.value && ot.value ? (T(), b(v, { key: 0 }, [n[7] ||= x("strong", null, "合同模板无法渲染", -1), x("span", null, O(ot.value), 1)], 64)) : (T(), b(v, { key: 1 }, [oe("请选择可用的合同页面")], 64))], 2))], 544)]));
636
647
  }
637
648
  });
638
649
  //#endregion
639
- export { Ke as default };
650
+ export { Ge as default };