vue-data-ui 2.3.2 → 2.3.4

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 (148) hide show
  1. package/dist/Arrow-B6gJebT9.js +101 -0
  2. package/dist/Arrow-C5yj6zwY.cjs +1 -0
  3. package/dist/BaseIcon-7_g11dRj.js +174 -0
  4. package/dist/BaseIcon-JtWoVorZ.cjs +1 -0
  5. package/dist/DataTable-CwaOlAsy.js +127 -0
  6. package/dist/DataTable-Rm9II-m2.cjs +1 -0
  7. package/dist/Legend-CxvJTjEm.js +62 -0
  8. package/dist/Legend-D59FIuMs.cjs +1 -0
  9. package/dist/Shape-CVItL3vh.cjs +1 -0
  10. package/dist/Shape-CjLV0scA.js +107 -0
  11. package/dist/Slicer-Bxg5niHl.js +156 -0
  12. package/dist/Slicer-Cdss5Rus.cjs +1 -0
  13. package/dist/Title-2iks1ziC.js +46 -0
  14. package/dist/Title-Bb-A5OSV.cjs +1 -0
  15. package/dist/Tooltip-C3phqKuU.js +94 -0
  16. package/dist/Tooltip-C_UE6y-E.cjs +1 -0
  17. package/dist/_plugin-vue_export-helper-BHFhmbuH.cjs +1 -0
  18. package/dist/_plugin-vue_export-helper-CHgC5LLL.js +9 -0
  19. package/dist/html2canvas.esm-BA_v9SIU.cjs +22 -0
  20. package/dist/html2canvas.esm-d2sM-0Wm.js +4870 -0
  21. package/dist/index-p5gfZSvB.cjs +4 -0
  22. package/dist/index-uOtklCCx.js +10268 -0
  23. package/dist/{index.es-BoVO5twe.js → index.es-YufTdp0y.js} +1 -1
  24. package/dist/{index.es-w_iDpZ-o.cjs → index.es-uyeSCnWE.cjs} +1 -1
  25. package/dist/jspdf.es.min-C660YX78.js +8038 -0
  26. package/dist/jspdf.es.min-DLYY9DTT.cjs +243 -0
  27. package/dist/pdf-97UbtKC2.js +44 -0
  28. package/dist/pdf-Cz3729tZ.cjs +1 -0
  29. package/dist/style.css +1 -1
  30. package/dist/useNestedProp-2kIU-7On.cjs +1 -0
  31. package/dist/useNestedProp-BgWkUab_.js +13 -0
  32. package/dist/usePrinter-B6xQCyL-.js +464 -0
  33. package/dist/usePrinter-fZlsJid8.cjs +1 -0
  34. package/dist/useResponsive-B3TrDDIG.cjs +1 -0
  35. package/dist/useResponsive-NZB-WLRF.js +187 -0
  36. package/dist/vue-data-ui-Be0rgmbA.cjs +9 -0
  37. package/dist/vue-data-ui-Ccy6rBZN.js +246 -0
  38. package/dist/vue-data-ui.cjs +1 -1
  39. package/dist/vue-data-ui.js +62 -61
  40. package/dist/vue-ui-3d-bar-BKMPFDi2.js +1085 -0
  41. package/dist/vue-ui-3d-bar-CKa4UXq4.cjs +19 -0
  42. package/dist/vue-ui-accordion-C_pwrAJl.cjs +1 -0
  43. package/dist/vue-ui-accordion-HJPf7My0.js +77 -0
  44. package/dist/vue-ui-age-pyramid-CE1xnA-8.cjs +1 -0
  45. package/dist/vue-ui-age-pyramid-DB_CL-gu.js +596 -0
  46. package/dist/vue-ui-annotator-BAMZcPlH.cjs +371 -0
  47. package/dist/vue-ui-annotator-DQsAL-nZ.js +2177 -0
  48. package/dist/vue-ui-candlestick-DCl8fpNu.js +657 -0
  49. package/dist/vue-ui-candlestick-Duv6oG79.cjs +2 -0
  50. package/dist/vue-ui-chestnut-BYHA6MT4.js +1051 -0
  51. package/dist/vue-ui-chestnut-mIZ4-ZEM.cjs +6 -0
  52. package/dist/vue-ui-cursor-C96IChA3.js +229 -0
  53. package/dist/vue-ui-cursor-De7dy4Mo.cjs +1 -0
  54. package/dist/vue-ui-dashboard-B2Yz41yO.js +232 -0
  55. package/dist/vue-ui-dashboard-BMGwKr0K.cjs +1 -0
  56. package/dist/vue-ui-digits-BnxLp7zQ.js +153 -0
  57. package/dist/vue-ui-digits-DSWyL-5K.cjs +1 -0
  58. package/dist/vue-ui-donut-1kei9ws5.cjs +1 -0
  59. package/dist/vue-ui-donut-B9iXisHK.js +743 -0
  60. package/dist/vue-ui-donut-evolution-B7Sun8sw.js +799 -0
  61. package/dist/vue-ui-donut-evolution-yv17DnGy.cjs +1 -0
  62. package/dist/vue-ui-dumbbell-BJEf_JEq.cjs +9 -0
  63. package/dist/vue-ui-dumbbell-DIsDnD1d.js +624 -0
  64. package/dist/vue-ui-flow-BTivYoGd.js +454 -0
  65. package/dist/vue-ui-flow-DOxJa8di.cjs +1 -0
  66. package/dist/vue-ui-galaxy-BEmywfFB.js +485 -0
  67. package/dist/vue-ui-galaxy-CHGOwCwM.cjs +1 -0
  68. package/dist/vue-ui-gauge-QAfMl-8t.cjs +1 -0
  69. package/dist/vue-ui-gauge-o4rDOqF3.js +466 -0
  70. package/dist/vue-ui-heatmap-BS4EzedX.cjs +1 -0
  71. package/dist/vue-ui-heatmap-DwqQqEsk.js +598 -0
  72. package/dist/vue-ui-kpi-F4qkJ_U-.cjs +1 -0
  73. package/dist/vue-ui-kpi-h8elYTcA.js +54 -0
  74. package/dist/vue-ui-mini-loader-C_8B2Pm6.cjs +1 -0
  75. package/dist/vue-ui-mini-loader-Cgoi9rhH.js +131 -0
  76. package/dist/vue-ui-molecule-Bmv76SWz.js +750 -0
  77. package/dist/vue-ui-molecule-C5CY_YYc.cjs +1 -0
  78. package/dist/vue-ui-mood-radar-BN0dzlfp.cjs +1 -0
  79. package/dist/vue-ui-mood-radar-DeMouUIe.js +548 -0
  80. package/dist/vue-ui-nested-donuts-ZyFoV-Zn.cjs +16 -0
  81. package/dist/vue-ui-nested-donuts-wOUkSVyZ.js +771 -0
  82. package/dist/vue-ui-onion-DCOKG2wG.js +554 -0
  83. package/dist/vue-ui-onion-VmTUo7TR.cjs +1 -0
  84. package/dist/vue-ui-parallel-coordinate-plot-BGtO2P4a.js +651 -0
  85. package/dist/vue-ui-parallel-coordinate-plot-BziXRF8E.cjs +8 -0
  86. package/dist/vue-ui-quadrant--JOTjPZh.js +1178 -0
  87. package/dist/vue-ui-quadrant-DawUUrur.cjs +1 -0
  88. package/dist/vue-ui-quick-chart-LXKfaJgS.js +1310 -0
  89. package/dist/vue-ui-quick-chart-jFlFtiNV.cjs +13 -0
  90. package/dist/vue-ui-radar-CWNIqvcA.js +614 -0
  91. package/dist/vue-ui-radar-VGH-lhaT.cjs +1 -0
  92. package/dist/vue-ui-rating-BNrIoJHN.js +271 -0
  93. package/dist/vue-ui-rating-Dtu6pwGx.cjs +1 -0
  94. package/dist/vue-ui-relation-circle-B3NKudOy.js +304 -0
  95. package/dist/vue-ui-relation-circle-Dwpx9o18.cjs +1 -0
  96. package/dist/vue-ui-rings-CsUngX_F.js +510 -0
  97. package/dist/vue-ui-rings-D9_OG--0.cjs +1 -0
  98. package/dist/vue-ui-scatter-DUsuh7bd.cjs +1 -0
  99. package/dist/vue-ui-scatter-DgxTz4Jx.js +874 -0
  100. package/dist/vue-ui-screenshot-51H_VrYY.js +160 -0
  101. package/dist/vue-ui-screenshot-C2Dz7CAe.cjs +3 -0
  102. package/dist/vue-ui-skeleton-BM9rwmxY.js +2064 -0
  103. package/dist/vue-ui-skeleton-sjfOtCZr.cjs +41 -0
  104. package/dist/vue-ui-smiley-DNnBtHht.cjs +2 -0
  105. package/dist/vue-ui-smiley-H5rSN-1B.js +763 -0
  106. package/dist/vue-ui-spark-trend-CLXZDYlk.js +246 -0
  107. package/dist/vue-ui-spark-trend-R4JJvfry.cjs +1 -0
  108. package/dist/vue-ui-sparkbar-C0k4ah-7.js +242 -0
  109. package/dist/vue-ui-sparkbar-CEUDIw0A.cjs +1 -0
  110. package/dist/vue-ui-sparkgauge-BHj00A07.js +157 -0
  111. package/dist/vue-ui-sparkgauge-CaEw6nmI.cjs +1 -0
  112. package/dist/vue-ui-sparkhistogram-B6GuavEu.cjs +1 -0
  113. package/dist/vue-ui-sparkhistogram-DbMLYKqE.js +244 -0
  114. package/dist/vue-ui-sparkline-CJydanLS.cjs +1 -0
  115. package/dist/vue-ui-sparkline-CYova9x3.js +333 -0
  116. package/dist/vue-ui-sparkstackbar-Df__yM5b.cjs +1 -0
  117. package/dist/vue-ui-sparkstackbar-N5rVBM2h.js +244 -0
  118. package/dist/vue-ui-strip-plot-DJJ1vEWz.js +618 -0
  119. package/dist/vue-ui-strip-plot-b5lhB35d.cjs +1 -0
  120. package/dist/vue-ui-table-NHhOVDbs.cjs +14 -0
  121. package/dist/vue-ui-table-heatmap-Cro2etCY.js +237 -0
  122. package/dist/vue-ui-table-heatmap-DlL2nCqz.cjs +1 -0
  123. package/dist/vue-ui-table-sparkline-Bw2Gc_ur.cjs +1 -0
  124. package/dist/vue-ui-table-sparkline-DppMitqF.js +420 -0
  125. package/dist/vue-ui-table-xSvwJIa7.js +1430 -0
  126. package/dist/vue-ui-thermometer-M2kdp1x5.js +385 -0
  127. package/dist/vue-ui-thermometer-Q_3PX2V3.cjs +1 -0
  128. package/dist/vue-ui-timer-BtSDeIRp.cjs +64 -0
  129. package/dist/vue-ui-timer-CAaQ-QD6.js +453 -0
  130. package/dist/vue-ui-tiremarks-CbGOSEvD.cjs +1 -0
  131. package/dist/vue-ui-tiremarks-JFv4JLP0.js +249 -0
  132. package/dist/vue-ui-treemap-BqDX-bPf.cjs +1 -0
  133. package/dist/vue-ui-treemap-DCnv-xYr.js +722 -0
  134. package/dist/vue-ui-vertical-bar-CEbApJZl.js +737 -0
  135. package/dist/vue-ui-vertical-bar-CJB_KXyr.cjs +4 -0
  136. package/dist/vue-ui-waffle-CTS6C7gu.js +638 -0
  137. package/dist/vue-ui-waffle-IMEbGe-b.cjs +1 -0
  138. package/dist/vue-ui-wheel-CuOmEWMQ.cjs +1 -0
  139. package/dist/vue-ui-wheel-_zyCdFiI.js +227 -0
  140. package/dist/vue-ui-word-cloud-RDlXBEAN.js +346 -0
  141. package/dist/vue-ui-word-cloud-Y7Yk7uUJ.cjs +1 -0
  142. package/dist/vue-ui-xy-BZJQBKnU.cjs +3 -0
  143. package/dist/vue-ui-xy-DsvN9EIQ.js +2064 -0
  144. package/dist/vue-ui-xy-canvas-D_dnbyFS.cjs +9 -0
  145. package/dist/vue-ui-xy-canvas-Dbcw8-9Q.js +1006 -0
  146. package/package.json +1 -1
  147. package/dist/index-C6KVJkgd.cjs +0 -843
  148. package/dist/index-bDBuMYfe.js +0 -57303
@@ -0,0 +1,2177 @@
1
+ import p from "./html2canvas.esm-d2sM-0Wm.js";
2
+ import { E as _ } from "./jspdf.es.min-C660YX78.js";
3
+ import { r as v, u as w, x as A, y as M } from "./index-uOtklCCx.js";
4
+ import { openBlock as d, createElementBlock as n, createElementVNode as r, normalizeStyle as c, toDisplayString as u, normalizeClass as y, createCommentVNode as a, withDirectives as f, vModelCheckbox as g, vModelText as C, renderSlot as O, Fragment as L, renderList as G, createStaticVNode as N, pushScopeId as m, popScopeId as T } from "vue";
5
+ import { _ as R } from "./_plugin-vue_export-helper-CHgC5LLL.js";
6
+ const D = {
7
+ props: {
8
+ config: {
9
+ type: Object,
10
+ default() {
11
+ return {};
12
+ }
13
+ },
14
+ dataset: {
15
+ type: Object,
16
+ default() {
17
+ return {
18
+ shapes: [],
19
+ lastSelectedShape: void 0
20
+ };
21
+ }
22
+ }
23
+ },
24
+ data() {
25
+ return {
26
+ activeShape: void 0,
27
+ strokeSize: 1,
28
+ currentPointer: {
29
+ start: {
30
+ x: 0,
31
+ y: 0
32
+ },
33
+ end: {
34
+ x: 0,
35
+ end: 0
36
+ }
37
+ },
38
+ currentTarget: void 0,
39
+ hoveredShapeId: void 0,
40
+ isBold: !1,
41
+ isBulletTextMode: !1,
42
+ isDash: !1,
43
+ isDeleteMode: !1,
44
+ isDrawing: !1,
45
+ isDrawingNewShape: !0,
46
+ isDrawMode: !1,
47
+ isItalic: !1,
48
+ isMouseDown: !1,
49
+ isMoveMode: !1,
50
+ isPrinting: !1,
51
+ isResizeMode: !1,
52
+ isSelectMode: !1,
53
+ isSummaryOpen: !1,
54
+ isTextMode: !1,
55
+ isUnderline: !1,
56
+ isWriting: !1,
57
+ lastSelectedShape: this.dataset.lastSelectedShape,
58
+ pointerDownId: -1,
59
+ pointerPosition: {
60
+ x: 0,
61
+ y: 0
62
+ },
63
+ preventEdit: !0,
64
+ selectedGroup: [],
65
+ shapes: this.dataset.shapes ? this.dataset.shapes : [],
66
+ shapesOrder: [],
67
+ step: Math.round(Math.random()) * 1e5,
68
+ svgHeight: 1e3,
69
+ svgWidth: 1e3,
70
+ options: {
71
+ arrow: {
72
+ color: "grey",
73
+ filled: !0
74
+ },
75
+ circle: {
76
+ color: "grey",
77
+ filled: !1,
78
+ radius: 3,
79
+ strokeWidth: 2
80
+ },
81
+ rect: {
82
+ color: "grey",
83
+ filled: !1,
84
+ strokeWidth: 2,
85
+ height: 12,
86
+ width: 12
87
+ }
88
+ },
89
+ selectedColor: "#000000",
90
+ showCaret: !1,
91
+ sizeRatio: 1,
92
+ slottedSvg: void 0,
93
+ sourceWidth: 1,
94
+ sourceHeight: 1,
95
+ textAlign: "start",
96
+ textFont: 20,
97
+ transparency: 100,
98
+ transparencyCodes: v
99
+ };
100
+ },
101
+ watch: {
102
+ shapes: {
103
+ handler(t) {
104
+ t.length === 0 && (this.lastSelectedShape = void 0);
105
+ }
106
+ }
107
+ },
108
+ computed: {
109
+ FINAL_CONFIG() {
110
+ const t = w().vue_ui_annotator;
111
+ if (!Object.keys(this.config || {}).length)
112
+ return t;
113
+ const s = this.treeShake({
114
+ defaultConfig: t,
115
+ userConfig: this.config
116
+ });
117
+ return this.convertConfigColors(s);
118
+ },
119
+ canSelect() {
120
+ return this.shapes.filter((t) => !["line", "group"].includes(t.type)).length > 1;
121
+ },
122
+ colorTransparency() {
123
+ return this.transparencyCodes[this.transparency > 98 ? 98 : this.transparency];
124
+ },
125
+ cursorClass() {
126
+ switch (!0) {
127
+ case this.isDeleteMode:
128
+ return "default";
129
+ case this.isMoveMode:
130
+ return "move";
131
+ case this.isTextMode:
132
+ return "text";
133
+ case this.isResizeMode:
134
+ return "se-resize";
135
+ default:
136
+ return "";
137
+ }
138
+ },
139
+ records() {
140
+ return this.shapes;
141
+ },
142
+ userShapes() {
143
+ return this.records.map((t) => {
144
+ switch (!0) {
145
+ case (t && t.type === "arrow"):
146
+ const s = t.strokeWidth > 3 ? 5 : 10, o = t.strokeWidth > 3 ? 2.5 : 5;
147
+ return `
148
+ <defs>
149
+ <marker
150
+ id="${t.id}"
151
+ markerWidth="${s}"
152
+ markerHeight="${s}"
153
+ refX="0"
154
+ refY="${o}"
155
+ orient="auto"
156
+ >
157
+ <polygon
158
+ points="0 0,${s} ${o}, 0 ${s}"
159
+ fill="${t.color}"
160
+ />
161
+ </marker>
162
+ </defs>
163
+ ${this.includeSelectionIndicator(t)}
164
+ <g id="${t.id}">
165
+ <path
166
+ style="stroke-linecap: round !important; ${t.isDash ? `stroke-dasharray: ${t.strokeWidth * 3}` : ""}"
167
+ stroke="${t.color}"
168
+ id="${t.id}"
169
+ d="M${t.x},${t.y} ${t.endX},${t.endY}"
170
+ stroke-width="${t.strokeWidth}"
171
+ marker-end="url(#${t.id})"
172
+ />
173
+ </g>
174
+ <g id="${t.id}">
175
+ <rect
176
+ id="${t.id}"
177
+ x="${t.x - 10}"
178
+ y="${t.y - 10}"
179
+ height="20"
180
+ width="20"
181
+ fill="rgba(0,0,0,0.3)"
182
+ style="display:${this.isResizeMode || this.isMoveMode ? "initial" : "none"}; rx:1 !important; ry:1 !important;"
183
+ />
184
+ </g>
185
+ ${this.includeDeleteButton(t)}
186
+ </g>
187
+ `;
188
+ case (t && t.type === "circle"):
189
+ return `
190
+ <g id="${t.id}">
191
+ ${this.includeSelectionIndicator(t)}
192
+ <circle
193
+ id="${t.id}"
194
+ cx="${t.x}"
195
+ cy="${t.y}"
196
+ r="${t.circleRadius ? t.circleRadius : Number.MIN_VALUE}"
197
+ fill="${t.isFilled ? t.color + t.alpha : "rgba(255,255,255,0.001)"}"
198
+ stroke="${t.color + t.alpha}"
199
+ stroke-width="${t.strokeWidth}"
200
+ style="${t.isDash ? `stroke-dasharray: ${t.strokeWidth * 3}` : ""}"
201
+ >
202
+ </circle>
203
+ </g>
204
+
205
+ ${this.includeDeleteButton(t)}`;
206
+ case (t && t.type === "group"):
207
+ return `<g id="${t.id}">
208
+ <rect
209
+ id="${this.isResizeMode ? "" : t.id}"
210
+ x="${t.x}"
211
+ y="${t.y}"
212
+ fill="transparent"
213
+ height="${t.rectHeight}"
214
+ width="${t.rectWidth}"
215
+ stroke="grey"
216
+ stroke-width="1"
217
+ style="rx:1 !important; ry:1 !important; ${t.isDash ? `stroke-dasharray: ${t.strokeWidth * 3}` : ""}; display:${this.isSelectMode || this.isDeleteMode || this.hoveredShapeId && this.hoveredShapeId === t.id ? "initial" : "none"};"
218
+ />
219
+ <g id="${t.id}">
220
+ ${t.content ? t.content : ""}
221
+ </g>
222
+ ${this.includeDeleteButton(t)}
223
+ </g> `;
224
+ case (t && t.type === "rect"):
225
+ return `<g id="${t.id}">
226
+ ${this.includeSelectionIndicator(t)}
227
+ <rect
228
+ id="${this.isResizeMode ? "" : t.id}"
229
+ x="${t.x}"
230
+ y="${t.y}"
231
+ fill="${t.isFilled ? t.color + t.alpha : "rgba(255,255,255,0.001)"}"
232
+ height="${t.rectHeight}"
233
+ width="${t.rectWidth}"
234
+ stroke="${t.color + t.alpha}"
235
+ stroke-width="${t.strokeWidth}"
236
+ style="rx:1 !important; ry:1 !important; ${t.isDash ? `stroke-dasharray: ${t.strokeWidth * 3}` : ""}"
237
+ />
238
+ <rect id="${t.id}"
239
+ x="${t.x + t.rectWidth}"
240
+ y="${t.y + t.rectHeight}"
241
+ height="20"
242
+ width="20"
243
+ fill="rgba(0,0,0,0.3)"
244
+ style="display:${this.isResizeMode ? "initial" : "none"}; rx:1 !important; ry:1 !important;"
245
+ />
246
+ ${this.includeDeleteButton(t)}
247
+ </g> `;
248
+ case (t && t.type === "line"):
249
+ return `
250
+ <g id="${t.id}">
251
+ <path
252
+ id="${t.id}"
253
+ d="M${t.path ? t.path : ""}"
254
+ style="stroke:${t.color + t.alpha} !important; fill:none; stroke-width:${t.strokeWidth} !important; stroke-linecap: round !important; stroke-linejoin: round !important;"
255
+ />
256
+ ${this.includeDeleteButton(t)}
257
+ </g>
258
+ `;
259
+ case (t && t.type === "text"):
260
+ const h = t.textContent.split("‎"), i = [];
261
+ for (let e = 0; e < h.length; e += 1)
262
+ i.push(`
263
+ ${t.isBulletTextMode ? `<tspan x="${t.x - t.fontSize}" y="${t.y + t.fontSize * e}" id="${t.id}" font-size="${t.fontSize / 2}">⬤</tspan>` : ""}
264
+ <tspan id="${t.id}" x="${t.x}" y="${t.y + t.fontSize * e}">
265
+ ${h[e]}
266
+ </tspan>`);
267
+ return `
268
+ ${this.includeSelectionIndicator(t)}
269
+ ${this.computeTextElement(
270
+ t,
271
+ i,
272
+ t.isBulletTextMode
273
+ )}
274
+ `;
275
+ }
276
+ });
277
+ }
278
+ },
279
+ mounted() {
280
+ const t = this.$refs.drawSvgContainer;
281
+ let s = !1;
282
+ this.walkTheDOM(t, (i) => {
283
+ if (!s && ["DIV", "svg", "section", "canvas"].includes(i.tagName)) {
284
+ this.slottedSvg = i, s = !0;
285
+ return;
286
+ }
287
+ });
288
+ const o = this.slottedSvg.getBoundingClientRect();
289
+ this.sizeRatio = o.height / o.width, this.svgWidth = 1e3, this.svgHeight = this.sizeRatio * 1e3, this.sourceWidth = o.width, this.sourceHeight = o.height, new ResizeObserver((i) => {
290
+ i.forEach((e) => {
291
+ this.sourceWidth = e.contentRect.width, this.sourceHeight = e.contentRect.height, this.sizeRatio = e.contentRect.height / e.contentRect.width, this.svgHeight = this.sizeRatio * 1e3;
292
+ });
293
+ }).observe(this.slottedSvg), window.addEventListener("keydown", (i) => {
294
+ this.write(i);
295
+ });
296
+ },
297
+ destroyed() {
298
+ window.removeEventListener("keydown", (t) => {
299
+ this.write(t);
300
+ });
301
+ },
302
+ methods: {
303
+ treeShake: A,
304
+ convertConfigColors: M,
305
+ bringShapeTo(t) {
306
+ const s = this.shapes.find(
307
+ (o) => o.id === this.lastSelectedShape.id
308
+ );
309
+ switch (!0) {
310
+ case t === "front":
311
+ this.shapes = this.shapes.filter((o) => o.id !== s.id), this.shapes.push(s);
312
+ break;
313
+ case t === "back":
314
+ this.shapes = this.shapes.filter((o) => o.id !== s.id), this.shapes = [s, ...this.shapes];
315
+ break;
316
+ default:
317
+ return;
318
+ }
319
+ },
320
+ clickSvg(t) {
321
+ if (this.isDeleteMode)
322
+ return;
323
+ this.deleteEmptyTextElement(), this.isTextMode ? (this.isWriting = !0, this.showCaret = !0) : (this.isWriting = !1, this.showCaret = !1, this.isTextMode = !1);
324
+ let s = `text_${Math.random() * 1e4}_${Math.random() * 99999}`;
325
+ if (this.isWriting) {
326
+ this.shapes.push({
327
+ id: s,
328
+ type: "text",
329
+ lines: 0,
330
+ x: this.pointerPosition.x,
331
+ y: this.pointerPosition.y,
332
+ textContent: "",
333
+ fontSize: this.copy(this.textFont),
334
+ textAlign: this.copy(this.textAlign),
335
+ isBold: this.copy(this.isBold),
336
+ isItalic: this.copy(this.isItalic),
337
+ isUnderline: this.copy(this.isUnderline),
338
+ color: this.copy(this.selectedColor),
339
+ isBulletTextMode: this.copy(this.isBulletTextMode)
340
+ }), this.currentTarget = this.shapes.at(-1), this.lastSelectedShape = this.shapes.at(-1);
341
+ return;
342
+ }
343
+ const o = () => {
344
+ this.isDash = this.shapes.find((i) => i.id === t.target.id).isDash;
345
+ }, h = () => {
346
+ this.strokeSize = this.shapes.find(
347
+ (i) => i.id === t.target.id
348
+ ).strokeWidth;
349
+ };
350
+ if (this.isSelectMode = !1, t.target.id.includes("arrow")) {
351
+ this.activeShape = "arrow", o(), h();
352
+ return;
353
+ }
354
+ if (t.target.id.includes("circle")) {
355
+ this.activeShape = "circle", this.options.circle.filled = this.shapes.find(
356
+ (i) => i.id === t.target.id
357
+ ).isFilled, o(), h();
358
+ return;
359
+ }
360
+ if (t.target.id.includes("rect")) {
361
+ this.activeShape = "rect", this.options.rect.filled = this.shapes.find(
362
+ (i) => i.id === t.target.id
363
+ ).isFilled, o(), h();
364
+ return;
365
+ }
366
+ if (t.target.id.includes("line")) {
367
+ this.activeShape = "line", h();
368
+ return;
369
+ }
370
+ if (t.target.id.includes("text")) {
371
+ this.isTextMode = !0, this.isWriting = !0, this.showCaret = !0;
372
+ const i = this.shapes.find((e) => e.id === t.target.id);
373
+ i && i.textAlign && (this.textAlign = this.shapes.find(
374
+ (e) => e.id === t.target.id
375
+ ).textAlign), i && (this.isBulletTextMode = this.shapes.find(
376
+ (e) => e.id === t.target.id
377
+ ).isBulletTextMode);
378
+ return;
379
+ }
380
+ },
381
+ copyPaste() {
382
+ const t = {
383
+ ...this.lastSelectedShape,
384
+ id: `${this.lastSelectedShape.id}_copy`,
385
+ x: this.lastSelectedShape.x - 100 < 0 ? 1 : this.lastSelectedShape.x - 100,
386
+ y: this.lastSelectedShape.y - 100 < 0 ? 1 : this.lastSelectedShape.y - 100
387
+ };
388
+ this.shapes.push(t);
389
+ },
390
+ includeDeleteButton(t, s = !1) {
391
+ switch (!0) {
392
+ case t.type === "circle":
393
+ return `
394
+ <g id="${t.id}" style="display:${this.isDeleteMode ? "initial" : "none"};">
395
+ <circle id="${t.id}" cx="${t.x}" cy="${t.y}" r="12" fill="red"/>
396
+ <line stroke="white" stroke-width="2" id="${t.id}" x1="${t.x - 4}" y1="${t.y - 4}" x2="${t.x + 4}" y2="${t.y + 4}"/>
397
+ <line stroke="white" stroke-width="2" id="${t.id}" x1="${t.x + 4}" y1="${t.y - 4}" x2="${t.x - 4}" y2="${t.y + 4}"/>
398
+ </g>
399
+ `;
400
+ case t.type === "text":
401
+ let o, h = [-8, -12, -4, -12, -4];
402
+ switch (!0) {
403
+ case t.textAlign === "start":
404
+ s ? o = [-20, -24, -16, -16, -24] : o = [-16, -20, -12, -12, -20];
405
+ break;
406
+ case t.textAlign === "middle":
407
+ o = [0, -4, 4, 4, -4], h = [-32, -36, -28, -36, -28];
408
+ break;
409
+ case t.textAlign === "end":
410
+ o = [16, 20, 12, 12, 20];
411
+ break;
412
+ default:
413
+ o = [0, 0, 0];
414
+ break;
415
+ }
416
+ return `
417
+ <g id="${t.id}" style="display:${this.isDeleteMode ? "initial" : "none"};">
418
+ <circle id="${t.id}" cx="${t.x + o[0]}" cy="${t.y + h[0]}" r="12" fill="red"/>
419
+ <line stroke="white" stroke-width="2" id="${t.id}" x1="${t.x + o[1]}" y1="${t.y + h[1]}" x2="${t.x + o[2]}" y2="${t.y + h[2]}"/>
420
+ <line stroke="white" stroke-width="2" id="${t.id}" x1="${t.x + o[3]}" y1="${t.y + h[3]}" x2="${t.x + o[4]}" y2="${t.y + h[4]}"/>
421
+ </g>
422
+ `;
423
+ default:
424
+ return `
425
+ <g id="${t.id}" style="display:${this.isDeleteMode ? "initial" : "none"};">
426
+ <circle id="${t.id}" cx="${t.x - 4}" cy="${t.y - 4}" r="12" fill="red"/>
427
+ <line stroke="white" stroke-width="2" id="${t.id}" x1="${t.x - 8}" y1="${t.y - 8}" x2="${t.x}" y2="${t.y}"/>
428
+ <line stroke="white" stroke-width="2" id="${t.id}" x1="${t.x}" y1="${t.y - 8}" x2="${t.x - 8}" y2="${t.y}"/>
429
+ </g>
430
+ `;
431
+ }
432
+ },
433
+ includeSelectionIndicator(t) {
434
+ if (t)
435
+ switch (!0) {
436
+ case t.type === "rect":
437
+ return `
438
+ <rect
439
+ id="${t.id}"
440
+ style="stroke-dasharray: 10; display:${this.hoveredShapeId && this.hoveredShapeId === t.id ? "initial" : "none"}"
441
+ x="${t.x - 20}"
442
+ y="${t.y - 20}"
443
+ height="${t.rectHeight + 40}"
444
+ width="${t.rectWidth + 40}"
445
+ fill="transparent"
446
+ stroke="grey"
447
+ />
448
+ `;
449
+ case t.type === "circle":
450
+ return `
451
+ <rect
452
+ id="${t.id}"
453
+ style="stroke-dasharray: 10; display:${this.hoveredShapeId && this.hoveredShapeId === t.id ? "initial" : "none"}"
454
+ x="${t.x - t.circleRadius - 20}"
455
+ y="${t.y - t.circleRadius - 20}"
456
+ height="${t.circleRadius * 2 + 40}"
457
+ width="${t.circleRadius * 2 + 40}"
458
+ fill="transparent"
459
+ stroke="grey"
460
+ />
461
+ `;
462
+ case t.type === "arrow":
463
+ const s = t.endX - t.x > 0, o = t.endY - t.y > 0;
464
+ return `
465
+ <rect
466
+ id="${t.id}"
467
+ style="stroke-dasharray: 10; display:${this.hoveredShapeId && this.hoveredShapeId === t.id ? "initial" : "none"}"
468
+ x="${s ? t.x - 20 : t.endX - 20}"
469
+ y="${o ? t.y - 20 : t.endY - 20}"
470
+ height="${o ? t.endY - t.y + 40 : t.y - t.endY + 40}"
471
+ width="${s ? t.endX - t.x + 40 : t.x - t.endX + 40}"
472
+ fill="transparent"
473
+ stroke="grey"
474
+ />
475
+ `;
476
+ case t.type === "text":
477
+ const h = Array.from(document.getElementsByTagName("text")).find(
478
+ (b) => b.id === t.id
479
+ );
480
+ if (!h)
481
+ return;
482
+ const { x: i, y: e, width: l, height: I } = h.getBBox();
483
+ return `
484
+ <rect
485
+ id="${t.id}"
486
+ style="stroke-dasharray: 10; display:${this.hoveredShapeId && this.hoveredShapeId === t.id ? "initial" : "none"}"
487
+ x="${i - 20}"
488
+ y="${e - 20}"
489
+ height="${I + 40}"
490
+ width="${l + 40}"
491
+ fill="transparent"
492
+ stroke="grey"
493
+ />
494
+ `;
495
+ default:
496
+ return "";
497
+ }
498
+ },
499
+ allowEditAndHoverShapes(t) {
500
+ t.preventDefault(), this.preventEdit = !1, t.target && t.target.id && (this.hoveredShapeId = t.target.id);
501
+ },
502
+ setSelectedTextAlignTo(t) {
503
+ !this.lastSelectedShape || this.lastSelectedShape.type !== "text" || (this.lastSelectedShape.textAlign = t);
504
+ },
505
+ undoLastShape() {
506
+ this.lastSelectedShape = void 0, this.shapes = this.shapes.slice(0, -1);
507
+ },
508
+ write(t) {
509
+ if (this.preventEdit)
510
+ return;
511
+ t.preventDefault();
512
+ const s = t.keyCode;
513
+ if (!this.isWriting)
514
+ return;
515
+ this.showCaret = !0;
516
+ let o;
517
+ if (this.lastSelectedShape.type === "text" ? o = this.shapes.find((i) => i.id === this.lastSelectedShape.id) : o = this.shapes.at(-1), this.currentTarget = o, o.type !== "text")
518
+ return;
519
+ this.currentTarget.isBold = this.copy(this.isBold), this.currentTarget.isItalic = this.copy(this.isItalic), this.currentTarget.isUnderline = this.copy(this.isUnderline);
520
+ const h = [
521
+ 16,
522
+ 17,
523
+ 18,
524
+ 20,
525
+ 27,
526
+ 33,
527
+ 34,
528
+ 35,
529
+ 36,
530
+ 37,
531
+ 38,
532
+ 39,
533
+ 40,
534
+ 45,
535
+ 91,
536
+ 112,
537
+ 113,
538
+ 114,
539
+ 115,
540
+ 116,
541
+ 117,
542
+ 118,
543
+ 119,
544
+ 120,
545
+ 121,
546
+ 122,
547
+ 123,
548
+ 221,
549
+ 255,
550
+ "Unidentified"
551
+ ];
552
+ switch (!0) {
553
+ case s === 8:
554
+ o.textContent = o.textContent.slice(0, -1);
555
+ break;
556
+ case s === 9:
557
+ o.textContent += "&nbsp; &nbsp; &nbsp; &nbsp;";
558
+ break;
559
+ case s === 13:
560
+ o.lines += 1, o.textContent += "‎";
561
+ return;
562
+ case h.includes(s):
563
+ return;
564
+ default:
565
+ o.textContent += t.key;
566
+ }
567
+ },
568
+ groupShapes() {
569
+ if (this.selectedGroup = [], this.activeShape !== "group") {
570
+ this.isSelectMode = !1, this.shapes = this.shapes.filter((s) => s.type !== "group");
571
+ return;
572
+ }
573
+ const t = this.shapes.at(-1);
574
+ if (this.shapes.forEach((s) => {
575
+ if (s.type !== "group")
576
+ switch (!0) {
577
+ case s.type === "arrow":
578
+ const o = s.x <= s.endX && s.y <= s.endY && t.x <= s.x && t.y <= s.y && t.x + t.rectWidth >= s.endX && t.y + t.rectHeight >= s.endY, h = s.endY < s.y && s.x < s.endX && t.x <= s.x && t.y <= s.y && t.x + t.rectWidth >= s.endX && t.y + t.rectHeight >= s.y, i = s.x > s.endX && s.y < s.endY && t.x <= s.endX && t.y <= s.endY && t.x + t.rectWidth >= s.x && t.y + t.rectHeight >= s.endY, e = s.x > s.endX && s.y > s.endY && t.x <= s.endX && t.y <= s.endY && t.x + t.rectWidth >= s.x && t.y + t.rectHeight >= s.y;
579
+ (o || h || i || e) && this.selectedGroup.push(s);
580
+ break;
581
+ case s.type === "circle":
582
+ t.x <= s.x + s.circleRadius && t.y <= s.y + s.circleRadius && s.x + s.circleRadius <= t.x + t.rectWidth && s.y + s.circleRadius <= t.y + t.rectHeight && this.selectedGroup.push(s);
583
+ break;
584
+ case s.type === "rect":
585
+ t.x <= s.x && t.y <= s.y && s.x <= t.x + t.rectWidth && s.y <= t.y + t.rectHeight && s.x + s.rectWidth <= t.x + t.rectWidth && s.y + s.rectHeight <= t.y + t.rectHeight && s.rectWidth <= t.rectWidth && s.rectHeight <= t.rectHeight && this.selectedGroup.push(s);
586
+ break;
587
+ case s.type === "text":
588
+ t.x <= s.x && t.y <= s.y && this.selectedGroup.push(s);
589
+ break;
590
+ }
591
+ }), this.selectedGroup = this.selectedGroup.map((s) => ({
592
+ ...s,
593
+ id: t.id,
594
+ oldId: s.id,
595
+ diffX: s.x - t.x,
596
+ diffY: s.y - t.y,
597
+ diffEndX: s.endX ? s.endX - t.x : 0,
598
+ diffEndY: s.endY ? s.endY - t.y : 0
599
+ })), t.source = this.selectedGroup, this.selectedGroup.length > 1) {
600
+ const s = this.copy(this.selectedGroup).map((o) => o.oldId);
601
+ this.shapes = this.shapes.filter((o) => !s.includes(o.id)), this.selectedGroup.forEach((o) => {
602
+ switch (!0) {
603
+ case o.type === "circle":
604
+ t.content += `
605
+ <circle
606
+ id="${o.id}"
607
+ cx="${o.x}"
608
+ cy="${o.y}"
609
+ r="${o.circleRadius ? o.circleRadius : Number.MIN_VALUE}"
610
+ fill="${o.isFilled ? o.color + o.alpha : "rgba(255,255,255,0.001)"}"
611
+ stroke="${o.color + o.alpha}"
612
+ stroke-width="${o.strokeWidth}"
613
+ style="${o.isDash ? `stroke-dasharray: ${o.strokeWidth * 3}` : ""}"
614
+ />
615
+ `;
616
+ break;
617
+ case o.type === "rect":
618
+ t.content += `
619
+ <rect
620
+ id="${this.isResizeMode ? "" : o.id}"
621
+ x="${o.x}"
622
+ y="${o.y}"
623
+ fill="${o.isFilled ? o.color + o.alpha : "rgba(255,255,255,0.001)"}"
624
+ height="${o.rectHeight}"
625
+ width="${o.rectWidth}"
626
+ stroke="${o.color + o.alpha}"
627
+ stroke-width="${o.strokeWidth}"
628
+ style="rx:1 !important; ry:1 !important; ${o.isDash ? `stroke-dasharray: ${o.strokeWidth * 3}` : ""}"
629
+ />
630
+ `;
631
+ break;
632
+ case o.type === "arrow":
633
+ const h = o.strokeWidth > 3 ? 5 : 10, i = o.strokeWidth > 3 ? 2.5 : 5, e = Date.now();
634
+ t.content += `
635
+ <g id="${o.id}">
636
+ <defs>
637
+ <marker
638
+ id="${e}"
639
+ markerWidth="${h}"
640
+ markerHeight="${h}"
641
+ refX="0"
642
+ refY="${i}"
643
+ orient="auto"
644
+ >
645
+ <polygon
646
+ points="0 0,${h} ${i}, 0 ${h}"
647
+ fill="${o.color}"
648
+ />
649
+ </marker>
650
+ </defs>
651
+
652
+ <path
653
+ style="stroke-linecap: round !important; ${o.isDash ? `stroke-dasharray: ${o.strokeWidth * 3}` : ""}"
654
+ stroke="${o.color}"
655
+ id="${o.id}"
656
+ d="M${o.x},${o.y} ${o.endX},${o.endY}"
657
+ stroke-width="${o.strokeWidth}"
658
+ marker-end="url(#${e})"
659
+ />
660
+ </g>
661
+ `;
662
+ break;
663
+ case o.type === "text":
664
+ const l = o.textContent.split("‎"), I = [];
665
+ for (let b = 0; b < l.length; b += 1)
666
+ I.push(`
667
+ ${o.isBulletTextMode ? `<tspan x="${o.x - o.fontSize}" y="${o.y + o.fontSize * b}" id="${o.id}" font-size="${o.fontSize / 2}">⬤</tspan>` : ""}
668
+ <tspan id="${o.id}" x="${o.x}" y="${o.y + o.fontSize * b}">
669
+ ${l[b]}
670
+ </tspan>`);
671
+ t.content += `
672
+ ${this.computeTextElement(o, I, o.isBulletTextMode)}
673
+ `;
674
+ break;
675
+ }
676
+ });
677
+ } else
678
+ this.shapes = this.shapes.filter((s) => s.id !== t.id);
679
+ },
680
+ moveGroup(t) {
681
+ t.content = "", t.x = this.copy(this.pointerPosition.x) - t.rectWidth / 2, t.y = this.copy(this.pointerPosition.y) - t.rectHeight / 2, t.source.forEach((s) => {
682
+ switch (!0) {
683
+ case s.type === "circle":
684
+ t.content += `
685
+ <circle
686
+ id="${s.id}"
687
+ cx="${this.copy(this.pointerPosition.x) + s.diffX - t.rectWidth / 2}"
688
+ cy="${this.copy(this.pointerPosition.y) + s.diffY - t.rectHeight / 2}"
689
+ r="${s.circleRadius ? s.circleRadius : Number.MIN_VALUE}"
690
+ fill="${s.isFilled ? s.color + s.alpha : "rgba(255,255,255,0.001)"}"
691
+ stroke="${s.color + s.alpha}"
692
+ stroke-width="${s.strokeWidth}"
693
+ style="${s.isDash ? `stroke-dasharray: ${s.strokeWidth * 3}` : ""}"
694
+ />
695
+ `;
696
+ break;
697
+ case s.type === "rect":
698
+ t.content += `
699
+ <rect
700
+ id="${this.isResizeMode ? "" : s.id}"
701
+ x="${this.copy(this.pointerPosition.x) + s.diffX - t.rectWidth / 2}"
702
+ y="${this.copy(this.pointerPosition.y) + s.diffY - t.rectHeight / 2}"
703
+ fill="${s.isFilled ? s.color + s.alpha : "rgba(255,255,255,0.001)"}"
704
+ height="${s.rectHeight}"
705
+ width="${s.rectWidth}"
706
+ stroke="${s.color + s.alpha}"
707
+ stroke-width="${s.strokeWidth}"
708
+ style="rx:1 !important; ry:1 !important; ${s.isDash ? `stroke-dasharray: ${s.strokeWidth * 3}` : ""}"
709
+ />
710
+ `;
711
+ break;
712
+ case s.type === "arrow":
713
+ const o = s.strokeWidth > 3 ? 5 : 10, h = s.strokeWidth > 3 ? 2.5 : 5, i = Date.now();
714
+ t.content += `
715
+ <g id="${s.id}">
716
+ <defs>
717
+ <marker
718
+ id="${i}"
719
+ markerWidth="${o}"
720
+ markerHeight="${o}"
721
+ refX="0"
722
+ refY="${h}"
723
+ orient="auto"
724
+ >
725
+ <polygon
726
+ points="0 0,${o} ${h}, 0 ${o}"
727
+ fill="${s.color}"
728
+ />
729
+ </marker>
730
+ </defs>
731
+
732
+ <path
733
+ style="stroke-linecap: round !important; ${s.isDash ? `stroke-dasharray: ${s.strokeWidth * 3}` : ""}"
734
+ stroke="${s.color}"
735
+ id="${s.id}"
736
+ d="M${this.copy(this.pointerPosition.x) + s.diffX - t.rectWidth / 2},${this.copy(this.pointerPosition.y) + s.diffY - t.rectHeight / 2} ${this.copy(this.pointerPosition.x) + s.diffEndX - t.rectWidth / 2},${this.copy(this.pointerPosition.y) + s.diffEndY - t.rectHeight / 2}"
737
+ stroke-width="${s.strokeWidth}"
738
+ marker-end="url(#${i})"
739
+ />
740
+ </g>
741
+ `;
742
+ break;
743
+ case s.type === "text":
744
+ const e = s.textContent.split("‎"), l = [];
745
+ for (let I = 0; I < e.length; I += 1)
746
+ l.push(`
747
+ ${s.isBulletTextMode ? `<tspan x="${this.copy(this.pointerPosition.x) + s.diffX - s.fontSize - t.rectWidth / 2}" y="${this.copy(this.pointerPosition.y) + s.diffY + s.fontSize * I - t.rectHeight / 2}" id="${s.id}" font-size="${s.fontSize / 2}">⬤</tspan>` : ""}
748
+ <tspan id="${s.id}" x="${this.copy(this.pointerPosition.x) + s.diffX - t.rectWidth / 2}" y="${this.copy(this.pointerPosition.y) + s.diffY + s.fontSize * I - t.rectHeight / 2}">
749
+ ${e[I]}
750
+ </tspan>`);
751
+ t.content += `
752
+ ${this.computeTextElement(s, l, s.isBulletTextMode)}
753
+ `;
754
+ break;
755
+ }
756
+ });
757
+ },
758
+ chooseAction(t) {
759
+ switch (t.preventDefault(), this.isMouseDown = !0, !0) {
760
+ case this.isDrawMode:
761
+ this.drawDown();
762
+ break;
763
+ }
764
+ },
765
+ chooseMove(t) {
766
+ switch (t.preventDefault(), t.target.localName !== "svg" && (this.currentTarget = t.target), !0) {
767
+ case (this.isMoveMode && this.isMouseDown):
768
+ this.moveDown();
769
+ break;
770
+ case (this.isResizeMode && this.isMouseDown):
771
+ this.resize();
772
+ break;
773
+ }
774
+ },
775
+ computeCaretPosition(t) {
776
+ switch (!0) {
777
+ case t.textAlign === "middle":
778
+ return `<path stroke="black" stroke-width="2" d="M${t.x},${t.y - t.fontSize} ${t.x},${t.y - t.fontSize - 15}" /> <path stroke="black" stroke-width="2" d="M${t.x - 3},${t.y - t.fontSize - 5} ${t.x},${t.y - t.fontSize} ${t.x + 3},${t.y - t.fontSize - 5}"/>`;
779
+ case t.textAlign === "start":
780
+ const s = t.isBulletTextMode ? t.fontSize : 0;
781
+ return `<path d="M${t.x - 20 - s},${t.y - t.fontSize / 6} ${t.x - 5 - s},${t.y - t.fontSize / 6}" stroke="black" stroke-width="2" />
782
+ <path d="M${t.x - 10 - s},${t.y - t.fontSize / 3} ${t.x - 5 - s},${t.y - t.fontSize / 6} ${t.x - 10 - s},${t.y}" stroke="black" stroke-width="2">`;
783
+ case t.textAlign === "end":
784
+ return `<path d="M${t.x + 20},${t.y - t.fontSize / 6} ${t.x + 5},${t.y - t.fontSize / 6}" stroke="black" stroke-width="2" />
785
+ <path d="M${t.x + 10},${t.y - t.fontSize / 3} ${t.x + 5},${t.y - t.fontSize / 6} ${t.x + 10},${t.y}" stroke="black" stroke-width="2">`;
786
+ default:
787
+ return "";
788
+ }
789
+ },
790
+ computeTextElement(t, s, o = !1) {
791
+ switch (!0) {
792
+ case t.textAlign === "start":
793
+ return `
794
+ <g id="${t.id}">
795
+ <rect
796
+ id="${t.id}"
797
+ style="display:${this.lastSelectedShape && this.lastSelectedShape.id === t.id ? "initial" : "none"};"
798
+ x="${t.x}"
799
+ y="${t.y - 50}"
800
+ height="${t.lines === 0 || t.lines === 1 ? t.fontSize * 4 : t.fontSize * 2 * t.lines}"
801
+ width="100"
802
+ fill="rgba(0,0,0,0)"
803
+ />
804
+ <text
805
+ style="user-select:none; height:100px;"
806
+ id="${t.id}"
807
+ x="${t.x}"
808
+ y="${t.y}"
809
+ text-anchor="${t.textAlign}"
810
+ font-size="${t.fontSize}"
811
+ fill="${t.color}"
812
+ font-weight="${t.isBold ? "bold" : "normal"}"
813
+ font-style="${t.isItalic ? "italic" : "normal"}"
814
+ text-decoration="${t.isUnderline ? "underline" : "none"}"
815
+ >
816
+ ${s.join("")}
817
+ </text>
818
+ ${this.showCaret && this.lastSelectedShape && this.lastSelectedShape.id === t.id ? this.computeCaretPosition(t) : ""}
819
+ ${this.includeDeleteButton(t, o)}
820
+ </g>
821
+ `;
822
+ case t.textAlign === "middle":
823
+ return `
824
+ <g id="${t.id}">
825
+ <rect
826
+ id="${t.id}"
827
+ style="display:${this.lastSelectedShape && this.lastSelectedShape.id === t.id ? "initial" : "none"};"
828
+ x="${t.x - 50}"
829
+ y="${t.y - 50}"
830
+ height="${t.lines === 0 || t.lines === 1 ? t.fontSize * 4 : t.fontSize * 2 * t.lines}"
831
+ width="100"
832
+ fill="rgba(0,0,0,0)"
833
+ />
834
+ <text
835
+ style="user-select:none; height:100px;"
836
+ id="${t.id}"
837
+ x="${t.x}"
838
+ y="${t.y}"
839
+ text-anchor="${t.textAlign}"
840
+ font-size="${t.fontSize}"
841
+ fill="${t.color}"
842
+ font-weight="${t.isBold ? "bold" : "normal"}"
843
+ font-style="${t.isItalic ? "italic" : "normal"}"
844
+ text-decoration="${t.isUnderline ? "underline" : "none"}"
845
+ >
846
+ ${s.join("")}
847
+ </text>
848
+ ${this.showCaret && this.lastSelectedShape && this.lastSelectedShape.id === t.id ? this.computeCaretPosition(t) : ""}
849
+ ${this.includeDeleteButton(t)}
850
+ </g>
851
+ `;
852
+ case t.textAlign === "end":
853
+ return `
854
+ <g id="${t.id}">
855
+ <rect
856
+ id="${t.id}"
857
+ style="display:${this.lastSelectedShape && this.lastSelectedShape.id === t.id ? "initial" : "none"};"
858
+ x="${t.x - 100}"
859
+ y="${t.y - 50}"
860
+ height="${t.lines === 0 || t.lines === 1 ? t.fontSize * 4 : t.fontSize * 2 * t.lines}"
861
+ width="100"
862
+ fill="rgba(0,0,0,0)"
863
+ />
864
+ <text
865
+ style="user-select:none; height:100px;"
866
+ id="${t.id}"
867
+ x="${t.x}"
868
+ y="${t.y}"
869
+ text-anchor="${t.textAlign}"
870
+ font-size="${t.fontSize}"
871
+ fill="${t.color}"
872
+ font-weight="${t.isBold ? "bold" : "normal"}"
873
+ font-style="${t.isItalic ? "italic" : "normal"}"
874
+ text-decoration="${t.isUnderline ? "underline" : "none"}"
875
+ >
876
+ ${s.join("")}
877
+ </text>
878
+ ${this.showCaret && this.lastSelectedShape && this.lastSelectedShape.id === t.id ? this.computeCaretPosition(t) : ""}
879
+ ${this.includeDeleteButton(t)}
880
+ </g>
881
+ `;
882
+ default:
883
+ return "";
884
+ }
885
+ },
886
+ copy(t) {
887
+ return JSON.parse(JSON.stringify(t));
888
+ },
889
+ clickShape(t) {
890
+ const s = t.target.id;
891
+ switch (!0) {
892
+ case this.isDeleteMode:
893
+ this.shapes = [...this.shapes].filter((o) => o.id !== s), this.lastSelectedShape = void 0;
894
+ break;
895
+ default:
896
+ this.lastSelectedShape = this.shapes.find((o) => o.id === s);
897
+ break;
898
+ }
899
+ },
900
+ deleteEmptyTextElement() {
901
+ !this.lastSelectedShape || !this.lastSelectedShape.id.includes("text") || this.lastSelectedShape.textContent === "" && (this.shapes = this.shapes.filter(
902
+ (t) => t.id !== this.lastSelectedShape.id
903
+ ), this.lastSelectedShape = this.shapes.at(-1));
904
+ },
905
+ drawUp(t = !1) {
906
+ if (!this.activeShape || !this.isDrawing)
907
+ return;
908
+ this.currentPointer.end = {
909
+ x: this.pointerPosition.x,
910
+ y: this.pointerPosition.y
911
+ };
912
+ let s;
913
+ this.shapes.length > 0 && this.currentTarget && (s = [...this.shapes].find(
914
+ (I) => I.id === this.currentTarget.id
915
+ ));
916
+ let o, h, i;
917
+ s && (o = s.x - this.currentPointer.end.x, h = s.y - this.currentPointer.end.y, i = Math.sqrt(o * o + h * h));
918
+ let e, l;
919
+ t ? (e = Math.max(this.currentPointer.end.x, s.x), l = Math.min(this.currentPointer.end.x, s.x), Math.max(this.currentPointer.end.y, s.y), Math.min(this.currentPointer.end.y, s.y)) : (e = Math.max(this.currentPointer.end.x, this.currentPointer.start.x), l = Math.min(this.currentPointer.end.x, this.currentPointer.start.x), Math.max(this.currentPointer.end.y, this.currentPointer.start.y), Math.min(this.currentPointer.end.y, this.currentPointer.start.y)), this.$nextTick(() => {
920
+ switch (!0) {
921
+ case this.activeShape === "arrow":
922
+ this.shapes.at(-1).endX = this.currentPointer.end.x, this.shapes.at(-1).endY = this.currentPointer.end.y;
923
+ break;
924
+ case this.activeShape === "circle":
925
+ const I = 20;
926
+ this.shapes.at(-1).circleRadius = this.isDrawingNewShape ? this.copy(e - l) + I : i + I;
927
+ break;
928
+ case this.activeShape === "line":
929
+ this.shapes.at(
930
+ -1
931
+ ).path += ` ${this.pointerPosition.x} ${this.pointerPosition.y} `;
932
+ break;
933
+ case ["rect", "group"].includes(this.activeShape):
934
+ const b = 20;
935
+ this.shapes.at(-1).rectWidth = this.copy(this.currentPointer.end.x - this.shapes.at(-1).x) > 0 ? this.copy(this.currentPointer.end.x - this.shapes.at(-1).x) : b, this.shapes.at(-1).rectHeight = this.copy(this.currentPointer.end.y - this.shapes.at(-1).y) > 0 ? this.copy(this.currentPointer.end.y - this.shapes.at(-1).y) : b;
936
+ }
937
+ });
938
+ },
939
+ drawDown() {
940
+ if (this.isDrawing = !0, !this.activeShape && !this.isSelectMode || !this.isDrawing)
941
+ return;
942
+ this.isDrawingNewShape = !0, this.currentPointer.start = {
943
+ x: this.pointerPosition.x,
944
+ y: this.pointerPosition.y
945
+ };
946
+ let t = `${this.isSelectMode ? "group" : this.activeShape}_${Math.random() * 1e4}_${Date.now()}`;
947
+ switch (!0) {
948
+ case this.activeShape === "arrow":
949
+ this.shapes.push({
950
+ id: t,
951
+ x: this.pointerPosition.x,
952
+ y: this.pointerPosition.y,
953
+ endX: this.pointerPosition.x,
954
+ endY: this.pointerPosition.y,
955
+ type: this.activeShape,
956
+ color: this.copy(this.selectedColor),
957
+ strokeWidth: this.copy(Math.abs(this.strokeSize)),
958
+ isDash: this.copy(this.isDash)
959
+ }), this.lastSelectedShape = this.shapes.at(-1);
960
+ break;
961
+ case this.activeShape === "circle":
962
+ this.shapes.push({
963
+ alpha: this.options.circle.filled ? this.colorTransparency : "",
964
+ id: t,
965
+ color: this.copy(this.selectedColor),
966
+ isFilled: this.copy(this.options.circle.filled),
967
+ circleRadius: this.copy(this.options.circle.radius),
968
+ circleStrokeWidth: this.copy(this.options.circle.strokeWidth),
969
+ type: this.activeShape,
970
+ x: this.pointerPosition.x,
971
+ y: this.pointerPosition.y,
972
+ strokeWidth: this.copy(Math.abs(this.strokeSize)),
973
+ isDash: this.copy(this.isDash)
974
+ }), this.lastSelectedShape = this.shapes.at(-1);
975
+ break;
976
+ case this.activeShape === "line":
977
+ this.shapes.push({
978
+ alpha: this.copy(this.colorTransparency),
979
+ id: t,
980
+ x: this.pointerPosition.x,
981
+ y: this.pointerPosition.y,
982
+ type: this.activeShape,
983
+ color: this.copy(this.selectedColor),
984
+ strokeWidth: this.copy(Math.abs(this.strokeSize)),
985
+ isDash: this.copy(this.isDash),
986
+ path: `${this.pointerPosition.x} ${this.pointerPosition.y}`
987
+ }), this.lastSelectedShape = this.shapes.at(-1);
988
+ break;
989
+ case this.activeShape === "rect":
990
+ this.shapes.push({
991
+ alpha: this.options.rect.filled ? this.colorTransparency : "",
992
+ id: t,
993
+ color: this.copy(this.selectedColor),
994
+ isFilled: this.copy(this.options.rect.filled),
995
+ rectStrokeWidth: this.copy(this.options.rect.strokeWidth),
996
+ rectHeight: this.copy(this.options.rect.height),
997
+ rectWidth: this.copy(this.options.rect.width),
998
+ type: this.activeShape,
999
+ x: this.pointerPosition.x,
1000
+ y: this.pointerPosition.y,
1001
+ strokeWidth: this.copy(Math.abs(this.strokeSize)),
1002
+ isDash: this.copy(this.isDash)
1003
+ }), this.lastSelectedShape = this.shapes.at(-1);
1004
+ break;
1005
+ case this.activeShape === "group":
1006
+ this.shapes.push({
1007
+ alpha: 1,
1008
+ id: `group_${Math.random() * 1e4}_${Date.now()}`,
1009
+ x: this.pointerPosition.x,
1010
+ y: this.pointerPosition.y,
1011
+ isFilled: !1,
1012
+ rectHeight: this.copy(this.options.rect.height),
1013
+ rectWidth: this.copy(this.options.rect.width),
1014
+ rectStrokeWidth: 1,
1015
+ type: "group",
1016
+ color: "grey",
1017
+ strokeWidth: 1,
1018
+ isDash: !0,
1019
+ content: ""
1020
+ });
1021
+ break;
1022
+ }
1023
+ if ((this.pointerDownId !== -1 || !this.isDrawing) && (clearInterval(this.pointerDownId), this.pointerDownId = -1), this.pointerDownId === -1 && this.isDrawing) {
1024
+ this.pointerDownId = setInterval(this.drawUp, 1);
1025
+ return;
1026
+ }
1027
+ },
1028
+ move(t) {
1029
+ if (!(!t || !t.id || t.type === "line"))
1030
+ switch (this.lastSelectedShape = t, !0) {
1031
+ case t.type === "arrow":
1032
+ t.x = this.copy(this.pointerPosition.x), t.y = this.copy(this.pointerPosition.y);
1033
+ break;
1034
+ case t.type === "circle":
1035
+ t.x = this.copy(this.pointerPosition.x), t.y = this.copy(this.pointerPosition.y);
1036
+ break;
1037
+ case t.type === "group":
1038
+ this.moveGroup(t);
1039
+ break;
1040
+ case t.type === "rect":
1041
+ t.x = this.copy(this.pointerPosition.x - t.rectWidth / 2), t.y = this.copy(this.pointerPosition.y - t.rectHeight / 2);
1042
+ break;
1043
+ case t.type === "text":
1044
+ const s = Array.from(document.getElementsByTagName("text")).find(
1045
+ (l) => l.id === t.id
1046
+ );
1047
+ if (!s)
1048
+ return;
1049
+ const { x: o, y: h, width: i, height: e } = s.getBBox();
1050
+ t.textAlign === "start" && (t.x = this.copy(this.pointerPosition.x - i / 2)), t.textAlign === "middle" && (t.x = this.copy(this.pointerPosition.x)), t.textAlign === "end" && (t.x = this.copy(this.pointerPosition.x + i / 2)), t.lines > 1 ? t.y = this.copy(this.pointerPosition.y - e / 3) : t.y = this.copy(this.pointerPosition.y + t.fontSize / 2);
1051
+ break;
1052
+ }
1053
+ },
1054
+ moveDown() {
1055
+ if (!this.currentTarget || !this.currentTarget.id)
1056
+ return;
1057
+ const t = this.currentTarget.id, s = this.shapes.find((o) => o.id === t);
1058
+ this.shapes = this.shapes.filter((o) => o.id !== t), this.shapes.push(s), this.pointerDownId === -1 && t && this.move(s);
1059
+ },
1060
+ print() {
1061
+ this.isPrinting = !0, this.isDeleteMode = !1, this.isMoveMode = !1, this.isResizeMode = !1, this.isTextMode = !1, this.isWriting = !1, this.isSelectMode = !1, this.activeShape = void 0, this.showCaret = !1, this.$nextTick(() => {
1062
+ const t = this.$refs.drawSvgContainer, s = {
1063
+ height: 851.89,
1064
+ width: 595.28
1065
+ };
1066
+ this.walkTheDOM(t, (o) => {
1067
+ o && o.nodeType === 1 && (o.setAttribute("font-family", "Helvetica"), o.style.fontFamily = "Helvetica", o.replaceWith(o));
1068
+ }), p(t).then((o) => {
1069
+ const h = o.width, i = o.height, e = h / s.width * s.height;
1070
+ let l = i, I = 0;
1071
+ const b = s.width, S = 582.28 / h * i, k = o.toDataURL("image/png", 1), x = new _("", "pt", "a4");
1072
+ if (l < e)
1073
+ x.addImage(k, "PNG", 0, 0, b, S, "", "FAST");
1074
+ else
1075
+ for (; l > 0; )
1076
+ x.addImage(
1077
+ k,
1078
+ "PNG",
1079
+ 0,
1080
+ I,
1081
+ b,
1082
+ S,
1083
+ "",
1084
+ "FAST"
1085
+ ), l -= e, I -= s.height - 24, l > 0 && x.addPage();
1086
+ x.save(`${(/* @__PURE__ */ new Date()).toLocaleDateString()}_annotations.pdf`);
1087
+ }).finally(() => {
1088
+ this.isPrinting = !1, this.walkTheDOM(t, (o) => {
1089
+ o && o.nodeType === 1 && (o.setAttribute("font-family", this.FINAL_CONFIG.style.fontFamily), o.style.fontFamily = this.FINAL_CONFIG.style.fontFamily, o.replaceWith(o));
1090
+ });
1091
+ });
1092
+ });
1093
+ },
1094
+ resetDraw() {
1095
+ this.isDrawing = !1, this.isMouseDown = !1, this.pointerDownId = -1, this.isSelectMode && this.groupShapes(), clearInterval(this.pointerDownId);
1096
+ },
1097
+ resize() {
1098
+ this.isDrawingNewShape = !1;
1099
+ const t = this.currentTarget.id;
1100
+ if (!t)
1101
+ return;
1102
+ this.isDrawing = !0;
1103
+ const s = this.shapes.find((o) => o.id === t);
1104
+ this.activeShape = s.type, this.shapes = this.shapes.filter((o) => o.id !== t), this.shapes.push(s), this.drawUp(!0);
1105
+ },
1106
+ setFillOfSelectedRect() {
1107
+ !this.lastSelectedShape || !this.lastSelectedShape.id.includes("rect") || (this.lastSelectedShape.isFilled = !this.lastSelectedShape.isFilled);
1108
+ },
1109
+ setFillOfSelectedCircle() {
1110
+ !this.lastSelectedShape || !this.lastSelectedShape.id.includes("circle") || (this.lastSelectedShape.isFilled = !this.lastSelectedShape.isFilled);
1111
+ },
1112
+ setColorOfSelectedShape() {
1113
+ this.lastSelectedShape && (this.lastSelectedShape.color = this.copy(this.selectedColor), !["arrow", "text"].includes(this.lastSelectedShape.id) && (this.lastSelectedShape.alpha = this.copy(this.colorTransparency)));
1114
+ },
1115
+ setSelectedShapeToDash() {
1116
+ !this.lastSelectedShape || this.lastSelectedShape.type === "text" || (this.lastSelectedShape.isDash = this.copy(this.isDash));
1117
+ },
1118
+ setTransparencyOfSelectedShape() {
1119
+ !this.lastSelectedShape || ["arrow", "text"].includes(this.lastSelectedShape.id) || (this.lastSelectedShape.alpha = this.copy(this.colorTransparency));
1120
+ },
1121
+ setStrokeWidthOfSelectedShape() {
1122
+ !this.lastSelectedShape || !["arrow", "circle", "rect", "line"].includes(this.lastSelectedShape.type) || (this.lastSelectedShape.strokeWidth = this.copy(Math.abs(this.strokeSize)));
1123
+ },
1124
+ setCurrentStyleOfSelectedText() {
1125
+ !this.lastSelectedShape || this.lastSelectedShape.type !== "text" || (this.lastSelectedShape.isBold = this.copy(this.isBold), this.lastSelectedShape.isItalic = this.copy(this.isItalic), this.lastSelectedShape.isUnderline = this.copy(this.isUnderline), this.lastSelectedShape.fontSize = this.copy(this.textFont), this.lastSelectedShape.isBulletTextMode = this.copy(this.isBulletTextMode));
1126
+ },
1127
+ setPointer(t) {
1128
+ t.preventDefault();
1129
+ const o = this.$refs.mainSvg.getBoundingClientRect();
1130
+ let h, i;
1131
+ t.touches && t.touches.length > 0 ? (h = t.touches[0].clientX, i = t.touches[0].clientY) : (h = t.clientX, i = t.clientY), this.pointerPosition.x = (h - o.left) / o.width * this.svgWidth, this.pointerPosition.y = (i - o.top) / o.height * this.svgHeight;
1132
+ },
1133
+ setShapeTo(t) {
1134
+ if (this.showCaret = !1, this.deleteEmptyTextElement(), t === this.activeShape) {
1135
+ this.activeShape = void 0, this.isDrawMode = !1;
1136
+ return;
1137
+ }
1138
+ this.isDrawMode = !0, this.isDeleteMode = !1, this.isMoveMode = !1, this.isResizeMode = !1, this.isTextMode = !1, this.activeShape = t;
1139
+ },
1140
+ toggleSummary() {
1141
+ this.isSummaryOpen = !this.isSummaryOpen, this.isSummaryOpen || (this.isMoveMode = !1, this.isResizeMode = !1, this.isTextMode = !1, this.isWriting = !1, this.activeShape = void 0, this.showCaret = !1, this.isDeleteMode = !1, this.isWriting = !1), this.$emit("toggleOpenState", { isOpen: this.isSummaryOpen });
1142
+ },
1143
+ walkTheDOM(t, s) {
1144
+ for (s(t), t = t.firstChild; t; )
1145
+ this.walkTheDOM(t, s), t = t.nextSibling;
1146
+ },
1147
+ save() {
1148
+ this.$emit("saveAnnotations", {
1149
+ shapes: this.shapes,
1150
+ lastSelectedShape: this.lastSelectedShape
1151
+ });
1152
+ }
1153
+ }
1154
+ }, F = (t) => (m("data-v-3611298e"), t = t(), T(), t), z = { class: "vue-ui-annotator" }, H = { "data-html2canvas-ignore": "" }, W = {
1155
+ class: "tool-selection",
1156
+ style: { "margin-top": "24px" }
1157
+ }, P = ["disabled"], B = /* @__PURE__ */ N('<svg xmlns="http://www.w3.org/2000/svg" width="80%" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round" data-v-3611298e><path stroke="none" d="M0 0h24v24H0z" fill="none" data-v-3611298e></path><path d="M18 9l3 3l-3 3" data-v-3611298e></path><path d="M15 12h6" data-v-3611298e></path><path d="M6 9l-3 3l3 3" data-v-3611298e></path><path d="M3 12h6" data-v-3611298e></path><path d="M9 18l3 3l3 -3" data-v-3611298e></path><path d="M12 15v6" data-v-3611298e></path><path d="M15 6l-3 -3l-3 3" data-v-3611298e></path><path d="M12 3v6" data-v-3611298e></path></svg>', 1), V = ["disabled"], E = /* @__PURE__ */ F(() => /* @__PURE__ */ r("svg", {
1158
+ xmlns: "http://www.w3.org/2000/svg",
1159
+ width: "80%",
1160
+ viewBox: "0 0 24 24",
1161
+ "stroke-width": "2",
1162
+ stroke: "currentColor",
1163
+ fill: "none",
1164
+ "stroke-linecap": "round",
1165
+ "stroke-linejoin": "round"
1166
+ }, [
1167
+ /* @__PURE__ */ r("path", {
1168
+ stroke: "none",
1169
+ d: "M0 0h24v24H0z",
1170
+ fill: "none"
1171
+ }),
1172
+ /* @__PURE__ */ r("path", { d: "M4 11v8a1 1 0 0 0 1 1h8m-9 -14v-1a1 1 0 0 1 1 -1h1m5 0h2m5 0h1a1 1 0 0 1 1 1v1m0 5v2m0 5v1a1 1 0 0 1 -1 1h-1" }),
1173
+ /* @__PURE__ */ r("path", { d: "M4 12h7a1 1 0 0 1 1 1v7" })
1174
+ ], -1)), X = ["disabled"], U = /* @__PURE__ */ N('<svg width="80%" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round" data-v-3611298e><path stroke="none" d="M0 0h24v24H0z" fill="none" data-v-3611298e></path><path d="M4 7l16 0" data-v-3611298e></path><path d="M10 11l0 6" data-v-3611298e></path><path d="M14 11l0 6" data-v-3611298e></path><path d="M5 7l1 12a2 2 0 0 0 2 2h8a2 2 0 0 0 2 -2l1 -12" data-v-3611298e></path><path d="M9 7v-3a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v3" data-v-3611298e></path></svg>', 1), Y = ["disabled"], j = {
1175
+ style: { width: "80%" },
1176
+ viewBox: "0 0 24 24"
1177
+ }, Z = /* @__PURE__ */ F(() => /* @__PURE__ */ r("path", {
1178
+ fill: "currentColor",
1179
+ d: "M1,1V5H2V19H1V23H5V22H19V23H23V19H22V5H23V1H19V2H5V1M5,4H19V5H20V19H19V20H5V19H4V5H5M6,6V14H9V18H18V9H14V6M8,8H12V12H8M14,11H16V16H11V14H14"
1180
+ }, null, -1)), J = [
1181
+ Z
1182
+ ], q = ["disabled"], K = {
1183
+ style: { width: "80%" },
1184
+ viewBox: "0 0 24 24"
1185
+ }, Q = /* @__PURE__ */ F(() => /* @__PURE__ */ r("path", {
1186
+ fill: "currentColor",
1187
+ d: "M2,2H11V6H9V4H4V9H6V11H2V2M22,13V22H13V18H15V20H20V15H18V13H22M8,8H16V16H8V8Z"
1188
+ }, null, -1)), $ = [
1189
+ Q
1190
+ ], tt = ["disabled"], et = {
1191
+ style: { width: "80%" },
1192
+ viewBox: "0 0 24 24"
1193
+ }, it = /* @__PURE__ */ F(() => /* @__PURE__ */ r("path", {
1194
+ fill: "currentColor",
1195
+ d: "M2,2H11V11H2V2M9,4H4V9H9V4M22,13V22H13V13H22M15,20H20V15H15V20M16,8V11H13V8H16M11,16H8V13H11V16Z"
1196
+ }, null, -1)), st = [
1197
+ it
1198
+ ], ot = ["disabled"], lt = /* @__PURE__ */ F(() => /* @__PURE__ */ r("svg", {
1199
+ width: "80%",
1200
+ viewBox: "0 0 24 24",
1201
+ "stroke-width": "2",
1202
+ stroke: "currentColor",
1203
+ fill: "none",
1204
+ "stroke-linecap": "round",
1205
+ "stroke-linejoin": "round"
1206
+ }, [
1207
+ /* @__PURE__ */ r("path", {
1208
+ stroke: "none",
1209
+ d: "M0 0h24v24H0z",
1210
+ fill: "none"
1211
+ }),
1212
+ /* @__PURE__ */ r("path", { d: "M7 3m0 2a2 2 0 0 1 2 -2h10a2 2 0 0 1 2 2v10a2 2 0 0 1 -2 2h-10a2 2 0 0 1 -2 -2z" }),
1213
+ /* @__PURE__ */ r("path", { d: "M17 17v2a2 2 0 0 1 -2 2h-10a2 2 0 0 1 -2 -2v-10a2 2 0 0 1 2 -2h2" })
1214
+ ], -1)), rt = ["disabled"], dt = /* @__PURE__ */ F(() => /* @__PURE__ */ r("svg", {
1215
+ width: "80%",
1216
+ viewBox: "0 0 24 24",
1217
+ "stroke-width": "2",
1218
+ stroke: "currentColor",
1219
+ fill: "none",
1220
+ "stroke-linecap": "round",
1221
+ "stroke-linejoin": "round"
1222
+ }, [
1223
+ /* @__PURE__ */ r("path", {
1224
+ stroke: "none",
1225
+ d: "M0 0h24v24H0z",
1226
+ fill: "none"
1227
+ }),
1228
+ /* @__PURE__ */ r("path", { d: "M9 14l-4 -4l4 -4" }),
1229
+ /* @__PURE__ */ r("path", { d: "M5 10h11a4 4 0 1 1 0 8h-1" })
1230
+ ], -1)), nt = /* @__PURE__ */ N('<svg width="80%" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round" data-v-3611298e><path stroke="none" d="M0 0h24v24H0z" fill="none" data-v-3611298e></path><path d="M17 17h2a2 2 0 0 0 2 -2v-4a2 2 0 0 0 -2 -2h-14a2 2 0 0 0 -2 2v4a2 2 0 0 0 2 2h2" data-v-3611298e></path><path d="M17 9v-4a2 2 0 0 0 -2 -2h-6a2 2 0 0 0 -2 2v4" data-v-3611298e></path><path d="M7 13m0 2a2 2 0 0 1 2 -2h6a2 2 0 0 1 2 2v4a2 2 0 0 1 -2 2h-6a2 2 0 0 1 -2 -2z" data-v-3611298e></path></svg>', 1), ct = /* @__PURE__ */ N('<svg width="100%" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round" data-v-3611298e><path stroke="none" d="M0 0h24v24H0z" fill="none" data-v-3611298e></path><path d="M6 4h10l4 4v10a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2v-12a2 2 0 0 1 2 -2" data-v-3611298e></path><path d="M12 14m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0" data-v-3611298e></path><path d="M14 4l0 4l-6 0l0 -4" data-v-3611298e></path></svg>', 1), ht = {
1231
+ class: "tool-selection",
1232
+ style: { "margin-top": "6px" }
1233
+ }, at = {
1234
+ viewBox: "0 0 12 12",
1235
+ style: { width: "100%" }
1236
+ }, ut = ["fill"], yt = {
1237
+ key: 0,
1238
+ class: "tool-input"
1239
+ }, It = { for: "circleFill" }, bt = ["checked"], Ft = {
1240
+ viewBox: "0 0 12 12",
1241
+ style: { width: "100%" }
1242
+ }, Nt = ["fill"], ft = {
1243
+ key: 1,
1244
+ class: "tool-input"
1245
+ }, xt = { for: "rectFill" }, Ct = ["checked"], gt = {
1246
+ viewBox: "0 0 24 24",
1247
+ style: { width: "100%" }
1248
+ }, St = ["stroke"], kt = /* @__PURE__ */ F(() => /* @__PURE__ */ r("svg", {
1249
+ width: "80%",
1250
+ viewBox: "0 0 24 24",
1251
+ "stroke-width": "2",
1252
+ stroke: "currentColor",
1253
+ fill: "none",
1254
+ "stroke-linecap": "round",
1255
+ "stroke-linejoin": "round"
1256
+ }, [
1257
+ /* @__PURE__ */ r("path", {
1258
+ stroke: "none",
1259
+ d: "M0 0h24v24H0z",
1260
+ fill: "none"
1261
+ }),
1262
+ /* @__PURE__ */ r("path", { d: "M3 15c2 3 4 4 7 4s7 -3 7 -7s-3 -7 -6 -7s-5 1.5 -5 4s2 5 6 5s8.408 -2.453 10 -5" })
1263
+ ], -1)), pt = { key: 2 }, _t = { style: { display: "flex", "flex-direction": "column", "align-items": "center", "justify-content": "center" } }, vt = {
1264
+ for: "textFont",
1265
+ style: { "font-size": "0.7em" }
1266
+ }, wt = { key: 3 }, At = { style: { display: "flex", "flex-direction": "column", "align-items": "center", "justify-content": "center" } }, Mt = {
1267
+ for: "dashStyle",
1268
+ style: { "font-size": "0.7em" }
1269
+ }, Ot = {
1270
+ viewBox: "0 0 24 24",
1271
+ height: "24",
1272
+ width: "24",
1273
+ style: { "margin-bottom": "-5px", "margin-top": "-10px" }
1274
+ }, Lt = /* @__PURE__ */ F(() => /* @__PURE__ */ r("line", {
1275
+ x1: "0",
1276
+ x2: "24",
1277
+ y1: "12",
1278
+ y2: "12",
1279
+ "stroke-width": "2",
1280
+ stroke: "black",
1281
+ "stroke-dasharray": "3"
1282
+ }, null, -1)), Gt = [
1283
+ Lt
1284
+ ], mt = ["checked"], Tt = {
1285
+ style: { width: "80%" },
1286
+ viewBox: "0 0 24 24",
1287
+ fill: "currentColor"
1288
+ }, Rt = /* @__PURE__ */ F(() => /* @__PURE__ */ r("path", { d: "M18.5,4L19.66,8.35L18.7,8.61C18.25,7.74 17.79,6.87 17.26,6.43C16.73,6 16.11,6 15.5,6H13V16.5C13,17 13,17.5 13.33,17.75C13.67,18 14.33,18 15,18V19H9V18C9.67,18 10.33,18 10.67,17.75C11,17.5 11,17 11,16.5V6H8.5C7.89,6 7.27,6 6.74,6.43C6.21,6.87 5.75,7.74 5.3,8.61L4.34,8.35L5.5,4H18.5Z" }, null, -1)), Dt = [
1289
+ Rt
1290
+ ], zt = { key: 4 }, Ht = { style: { display: "flex", "flex-direction": "column", "align-items": "center", "justify-content": "center" } }, Wt = {
1291
+ for: "textFont",
1292
+ style: { "font-size": "0.7em" }
1293
+ }, Pt = { key: 5 }, Bt = /* @__PURE__ */ N('<svg width="80%" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round" data-v-3611298e><path stroke="none" d="M0 0h24v24H0z" fill="none" data-v-3611298e></path><path d="M4 6l16 0" data-v-3611298e></path><path d="M4 12l10 0" data-v-3611298e></path><path d="M4 18l14 0" data-v-3611298e></path></svg>', 1), Vt = { key: 6 }, Et = ["disabled"], Xt = /* @__PURE__ */ N('<svg width="80%" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round" data-v-3611298e><path stroke="none" d="M0 0h24v24H0z" fill="none" data-v-3611298e></path><path d="M4 6l16 0" data-v-3611298e></path><path d="M8 12l8 0" data-v-3611298e></path><path d="M6 18l12 0" data-v-3611298e></path></svg>', 1), Ut = { key: 7 }, Yt = ["disabled"], jt = /* @__PURE__ */ N('<svg width="80%" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round" data-v-3611298e><path stroke="none" d="M0 0h24v24H0z" fill="none" data-v-3611298e></path><path d="M4 6l16 0" data-v-3611298e></path><path d="M10 12l10 0" data-v-3611298e></path><path d="M6 18l14 0" data-v-3611298e></path></svg>', 1), Zt = { key: 8 }, Jt = /* @__PURE__ */ N('<svg width="100%" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round" data-v-3611298e><path stroke="none" d="M0 0h24v24H0z" fill="none" data-v-3611298e></path><path d="M9 6l11 0" data-v-3611298e></path><path d="M9 12l11 0" data-v-3611298e></path><path d="M9 18l11 0" data-v-3611298e></path><path d="M5 6l0 .01" data-v-3611298e></path><path d="M5 12l0 .01" data-v-3611298e></path><path d="M5 18l0 .01" data-v-3611298e></path></svg>', 1), qt = { key: 9 }, Kt = /* @__PURE__ */ F(() => /* @__PURE__ */ r("svg", {
1294
+ width: "100%",
1295
+ viewBox: "0 0 24 24",
1296
+ "stroke-width": "3",
1297
+ stroke: "currentColor",
1298
+ fill: "none",
1299
+ "stroke-linecap": "round",
1300
+ "stroke-linejoin": "round"
1301
+ }, [
1302
+ /* @__PURE__ */ r("path", {
1303
+ stroke: "none",
1304
+ d: "M0 0h24v24H0z",
1305
+ fill: "none"
1306
+ }),
1307
+ /* @__PURE__ */ r("path", { d: "M7 5h6a3.5 3.5 0 0 1 0 7h-6z" }),
1308
+ /* @__PURE__ */ r("path", { d: "M13 12h1a3.5 3.5 0 0 1 0 7h-7v-7" })
1309
+ ], -1)), Qt = { key: 10 }, $t = /* @__PURE__ */ N('<svg width="100%" height="44" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round" data-v-3611298e><path stroke="none" d="M0 0h24v24H0z" fill="none" data-v-3611298e></path><path d="M11 5l6 0" data-v-3611298e></path><path d="M7 19l6 0" data-v-3611298e></path><path d="M14 5l-4 14" data-v-3611298e></path></svg>', 1), te = { key: 11 }, ee = /* @__PURE__ */ F(() => /* @__PURE__ */ r("svg", {
1310
+ width: "100%",
1311
+ viewBox: "0 0 24 24",
1312
+ "stroke-width": "2",
1313
+ stroke: "currentColor",
1314
+ fill: "none",
1315
+ "stroke-linecap": "round",
1316
+ "stroke-linejoin": "round"
1317
+ }, [
1318
+ /* @__PURE__ */ r("path", {
1319
+ stroke: "none",
1320
+ d: "M0 0h24v24H0z",
1321
+ fill: "none"
1322
+ }),
1323
+ /* @__PURE__ */ r("path", { d: "M7 5v5a5 5 0 0 0 10 0v-5" }),
1324
+ /* @__PURE__ */ r("path", { d: "M5 19h14" })
1325
+ ], -1)), ie = {
1326
+ style: { display: "flex", "flex-direction": "column", "align-items": "center", "justify-content": "center" },
1327
+ class: "tooltip"
1328
+ }, se = { style: { display: "flex", "flex-direction": "column", "align-items": "start", "justify-content": "center" } }, oe = {
1329
+ for: "colorTransparency",
1330
+ style: { "font-size": "0.7em" }
1331
+ }, le = {
1332
+ class: "annotator annotator__wrapper",
1333
+ ref: "drawSvgContainer",
1334
+ style: { position: "relative" }
1335
+ }, re = ["viewBox", "width", "height"], de = ["id", "innerHTML"], ne = ["height", "viewBox", "width"], ce = ["cx", "cy"];
1336
+ function he(t, s, o, h, i, e) {
1337
+ return d(), n("div", z, [
1338
+ r("div", H, [
1339
+ r("details", {
1340
+ class: "vue-ui-annotator-summary",
1341
+ onToggle: s[36] || (s[36] = (...l) => e.toggleSummary && e.toggleSummary(...l)),
1342
+ style: c(`${i.isSummaryOpen ? "padding-bottom: 12px" : ""}; background: ${e.FINAL_CONFIG.style.backgroundColor}; color:${e.FINAL_CONFIG.style.color}; ${e.FINAL_CONFIG.style.fixedTools && i.isSummaryOpen ? "position: fixed; top: 0; left: 50%; transform: translateX(-50%); z-index: 1;" : ""}`)
1343
+ }, [
1344
+ r("summary", null, u(e.FINAL_CONFIG.translations.title), 1),
1345
+ r("div", W, [
1346
+ r("button", {
1347
+ disabled: i.shapes.length === 0,
1348
+ style: c({
1349
+ background: i.isMoveMode ? e.FINAL_CONFIG.style.buttons.controls.selected.backgroundColor : e.FINAL_CONFIG.style.buttons.controls.backgroundColor,
1350
+ border: i.isMoveMode ? e.FINAL_CONFIG.style.buttons.controls.selected.border : e.FINAL_CONFIG.style.buttons.controls.border,
1351
+ color: i.isMoveMode ? e.FINAL_CONFIG.style.buttons.controls.selected.color : e.FINAL_CONFIG.style.buttons.controls.color,
1352
+ borderRadius: `${e.FINAL_CONFIG.style.buttons.borderRadius}px`
1353
+ }),
1354
+ class: y({
1355
+ "button-tool": !0,
1356
+ "button-tool--selected": i.isMoveMode,
1357
+ tooltip: !0
1358
+ }),
1359
+ onClick: s[0] || (s[0] = (l) => {
1360
+ e.deleteEmptyTextElement(), i.isMoveMode = !i.isMoveMode, i.activeShape = void 0, i.isDeleteMode = !1, i.isDrawMode = !1, i.isResizeMode = !1, i.isSelectMode = !1, i.isTextMode = !1, i.isWriting = !1, i.showCaret = !1;
1361
+ })
1362
+ }, [
1363
+ B,
1364
+ e.FINAL_CONFIG.style.showTooltips ? (d(), n("span", {
1365
+ key: 0,
1366
+ class: "tooltiptext",
1367
+ style: c({
1368
+ backgroundColor: e.FINAL_CONFIG.style.tooltips.backgroundColor,
1369
+ color: e.FINAL_CONFIG.style.tooltips.color,
1370
+ border: e.FINAL_CONFIG.style.tooltips.border,
1371
+ borderRadius: `${e.FINAL_CONFIG.style.tooltips.borderRadius}px`,
1372
+ boxShadow: e.FINAL_CONFIG.style.tooltips.boxShadow
1373
+ })
1374
+ }, u(e.FINAL_CONFIG.translations.tooltipMove), 5)) : a("", !0)
1375
+ ], 14, P),
1376
+ r("button", {
1377
+ disabled: i.shapes.length === 0 || i.activeShape === "line",
1378
+ style: c({
1379
+ background: i.isResizeMode ? e.FINAL_CONFIG.style.buttons.controls.selected.backgroundColor : e.FINAL_CONFIG.style.buttons.controls.backgroundColor,
1380
+ border: i.isResizeMode ? e.FINAL_CONFIG.style.buttons.controls.selected.border : e.FINAL_CONFIG.style.buttons.controls.border,
1381
+ color: i.isResizeMode ? e.FINAL_CONFIG.style.buttons.controls.selected.color : e.FINAL_CONFIG.style.buttons.controls.color,
1382
+ borderRadius: `${e.FINAL_CONFIG.style.buttons.borderRadius}px`
1383
+ }),
1384
+ class: y({
1385
+ "button-tool": !0,
1386
+ "button-tool--selected": i.isResizeMode,
1387
+ tooltip: !0
1388
+ }),
1389
+ onClick: s[1] || (s[1] = (l) => {
1390
+ e.deleteEmptyTextElement(), i.isResizeMode = !i.isResizeMode, i.isMoveMode = !1, i.isDeleteMode = !1, i.isDrawMode = !1, i.isSelectMode = !1, i.isTextMode = !1, i.isWriting = !1, i.activeShape = void 0, i.showCaret = !1;
1391
+ })
1392
+ }, [
1393
+ E,
1394
+ e.FINAL_CONFIG.style.showTooltips ? (d(), n("span", {
1395
+ key: 0,
1396
+ class: "tooltiptext",
1397
+ style: c({
1398
+ backgroundColor: e.FINAL_CONFIG.style.tooltips.backgroundColor,
1399
+ color: e.FINAL_CONFIG.style.tooltips.color,
1400
+ border: e.FINAL_CONFIG.style.tooltips.border,
1401
+ borderRadius: `${e.FINAL_CONFIG.style.tooltips.borderRadius}px`,
1402
+ boxShadow: e.FINAL_CONFIG.style.tooltips.boxShadow
1403
+ })
1404
+ }, u(e.FINAL_CONFIG.translations.tooltipResize), 5)) : a("", !0)
1405
+ ], 14, V),
1406
+ r("button", {
1407
+ disabled: i.shapes.length === 0,
1408
+ style: c({
1409
+ background: i.isDeleteMode ? e.FINAL_CONFIG.style.buttons.controls.selected.backgroundColor : e.FINAL_CONFIG.style.buttons.controls.backgroundColor,
1410
+ border: i.isDeleteMode ? e.FINAL_CONFIG.style.buttons.controls.selected.border : e.FINAL_CONFIG.style.buttons.controls.border,
1411
+ color: i.isDeleteMode ? e.FINAL_CONFIG.style.buttons.controls.selected.color : e.FINAL_CONFIG.style.buttons.controls.color,
1412
+ borderRadius: `${e.FINAL_CONFIG.style.buttons.borderRadius}px`
1413
+ }),
1414
+ class: y({
1415
+ "button-tool": !0,
1416
+ "button-tool--selected": i.isDeleteMode,
1417
+ tooltip: !0
1418
+ }),
1419
+ onClick: s[2] || (s[2] = (l) => {
1420
+ e.deleteEmptyTextElement(), i.isDeleteMode = !i.isDeleteMode, i.isMoveMode = !1, i.isResizeMode = !1, i.isSelectMode = !1, i.isTextMode = !1, i.isWriting = !1, i.activeShape = void 0, i.showCaret = !1;
1421
+ })
1422
+ }, [
1423
+ U,
1424
+ e.FINAL_CONFIG.style.showTooltips ? (d(), n("span", {
1425
+ key: 0,
1426
+ class: "tooltiptext",
1427
+ style: c({
1428
+ backgroundColor: e.FINAL_CONFIG.style.tooltips.backgroundColor,
1429
+ color: e.FINAL_CONFIG.style.tooltips.color,
1430
+ border: e.FINAL_CONFIG.style.tooltips.border,
1431
+ borderRadius: `${e.FINAL_CONFIG.style.tooltips.borderRadius}px`,
1432
+ boxShadow: e.FINAL_CONFIG.style.tooltips.boxShadow
1433
+ })
1434
+ }, u(e.FINAL_CONFIG.translations.tooltipDelete), 5)) : a("", !0)
1435
+ ], 14, X),
1436
+ r("button", {
1437
+ disabled: !e.canSelect,
1438
+ style: c({
1439
+ background: i.isSelectMode ? e.FINAL_CONFIG.style.buttons.controls.selected.backgroundColor : e.FINAL_CONFIG.style.buttons.controls.backgroundColor,
1440
+ border: i.isSelectMode ? e.FINAL_CONFIG.style.buttons.controls.selected.border : e.FINAL_CONFIG.style.buttons.controls.border,
1441
+ color: i.isSelectMode ? e.FINAL_CONFIG.style.buttons.controls.selected.color : e.FINAL_CONFIG.style.buttons.controls.color,
1442
+ borderRadius: `${e.FINAL_CONFIG.style.buttons.borderRadius}px`
1443
+ }),
1444
+ class: y({
1445
+ "button-tool": !0,
1446
+ "button-tool--selected": i.isSelectMode,
1447
+ tooltip: !0
1448
+ }),
1449
+ onClick: s[3] || (s[3] = (l) => {
1450
+ e.deleteEmptyTextElement(), e.setShapeTo("group"), i.isSelectMode = !i.isSelectMode, i.isDeleteMode = !1, i.isMoveMode = !1, i.isResizeMode = !1, i.isTextMode = !1, i.isWriting = !1, i.activeShape = "group", i.showCaret = !1;
1451
+ })
1452
+ }, [
1453
+ (d(), n("svg", j, J)),
1454
+ e.FINAL_CONFIG.style.showTooltips ? (d(), n("span", {
1455
+ key: 0,
1456
+ class: "tooltiptext",
1457
+ style: c({
1458
+ backgroundColor: e.FINAL_CONFIG.style.tooltips.backgroundColor,
1459
+ color: e.FINAL_CONFIG.style.tooltips.color,
1460
+ border: e.FINAL_CONFIG.style.tooltips.border,
1461
+ borderRadius: `${e.FINAL_CONFIG.style.tooltips.borderRadius}px`,
1462
+ boxShadow: e.FINAL_CONFIG.style.tooltips.boxShadow
1463
+ })
1464
+ }, u(e.FINAL_CONFIG.translations.tooltipGroup), 5)) : a("", !0)
1465
+ ], 14, Y),
1466
+ r("button", {
1467
+ disabled: i.shapes.length === 0,
1468
+ style: c({
1469
+ background: e.FINAL_CONFIG.style.buttons.controls.backgroundColor,
1470
+ border: e.FINAL_CONFIG.style.buttons.controls.border,
1471
+ color: e.FINAL_CONFIG.style.buttons.controls.color,
1472
+ borderRadius: `${e.FINAL_CONFIG.style.buttons.borderRadius}px`
1473
+ }),
1474
+ class: y({ "button-tool": !0, tooltip: !0 }),
1475
+ onClick: s[4] || (s[4] = (l) => {
1476
+ i.isResizeMode = !1, i.isMoveMode = !0, i.isDeleteMode = !1, i.isDrawMode = !1, i.isSelectMode = !1, i.isTextMode = !1, i.isWriting = !1, i.showCaret = !1, e.bringShapeTo("front");
1477
+ })
1478
+ }, [
1479
+ (d(), n("svg", K, $)),
1480
+ e.FINAL_CONFIG.style.showTooltips ? (d(), n("span", {
1481
+ key: 0,
1482
+ class: "tooltiptext",
1483
+ style: c({
1484
+ backgroundColor: e.FINAL_CONFIG.style.tooltips.backgroundColor,
1485
+ color: e.FINAL_CONFIG.style.tooltips.color,
1486
+ border: e.FINAL_CONFIG.style.tooltips.border,
1487
+ borderRadius: `${e.FINAL_CONFIG.style.tooltips.borderRadius}px`,
1488
+ boxShadow: e.FINAL_CONFIG.style.tooltips.boxShadow
1489
+ })
1490
+ }, u(e.FINAL_CONFIG.translations.tooltipBringToFront), 5)) : a("", !0)
1491
+ ], 12, q),
1492
+ r("button", {
1493
+ disabled: i.shapes.length === 0,
1494
+ style: c({
1495
+ background: e.FINAL_CONFIG.style.buttons.controls.backgroundColor,
1496
+ border: e.FINAL_CONFIG.style.buttons.controls.border,
1497
+ color: e.FINAL_CONFIG.style.buttons.controls.color,
1498
+ borderRadius: `${e.FINAL_CONFIG.style.buttons.borderRadius}px`
1499
+ }),
1500
+ class: y({ "button-tool": !0, tooltip: !0 }),
1501
+ onClick: s[5] || (s[5] = (l) => {
1502
+ i.isResizeMode = !1, i.isMoveMode = !0, i.isDeleteMode = !1, i.isDrawMode = !1, i.isSelectMode = !1, i.isTextMode = !1, i.isWriting = !1, i.showCaret = !1, e.bringShapeTo("back");
1503
+ })
1504
+ }, [
1505
+ (d(), n("svg", et, st)),
1506
+ e.FINAL_CONFIG.style.showTooltips ? (d(), n("span", {
1507
+ key: 0,
1508
+ class: "tooltiptext",
1509
+ style: c({
1510
+ backgroundColor: e.FINAL_CONFIG.style.tooltips.backgroundColor,
1511
+ color: e.FINAL_CONFIG.style.tooltips.color,
1512
+ border: e.FINAL_CONFIG.style.tooltips.border,
1513
+ borderRadius: `${e.FINAL_CONFIG.style.tooltips.borderRadius}px`,
1514
+ boxShadow: e.FINAL_CONFIG.style.tooltips.boxShadow
1515
+ })
1516
+ }, u(e.FINAL_CONFIG.translations.tooltipBringToBack), 5)) : a("", !0)
1517
+ ], 12, tt),
1518
+ r("button", {
1519
+ disabled: i.shapes.length === 0 || i.activeShape === "line",
1520
+ style: c({
1521
+ background: e.FINAL_CONFIG.style.buttons.controls.backgroundColor,
1522
+ border: e.FINAL_CONFIG.style.buttons.controls.border,
1523
+ color: e.FINAL_CONFIG.style.buttons.controls.color,
1524
+ borderRadius: `${e.FINAL_CONFIG.style.buttons.borderRadius}px`
1525
+ }),
1526
+ class: y({ "button-tool": !0, tooltip: !0 }),
1527
+ onClick: s[6] || (s[6] = (l) => {
1528
+ e.deleteEmptyTextElement(), i.isResizeMode = !1, i.isMoveMode = !0, i.isDeleteMode = !1, i.isDrawMode = !1, i.isSelectMode = !1, i.isTextMode = !1, i.isWriting = !1, i.showCaret = !1, e.copyPaste();
1529
+ })
1530
+ }, [
1531
+ lt,
1532
+ e.FINAL_CONFIG.style.showTooltips ? (d(), n("span", {
1533
+ key: 0,
1534
+ class: "tooltiptext",
1535
+ style: c({
1536
+ backgroundColor: e.FINAL_CONFIG.style.tooltips.backgroundColor,
1537
+ color: e.FINAL_CONFIG.style.tooltips.color,
1538
+ border: e.FINAL_CONFIG.style.tooltips.border,
1539
+ borderRadius: `${e.FINAL_CONFIG.style.tooltips.borderRadius}px`,
1540
+ boxShadow: e.FINAL_CONFIG.style.tooltips.boxShadow
1541
+ })
1542
+ }, u(e.FINAL_CONFIG.translations.tooltipDuplicate), 5)) : a("", !0)
1543
+ ], 12, ot),
1544
+ r("button", {
1545
+ disabled: i.shapes.length === 0,
1546
+ style: c({
1547
+ background: e.FINAL_CONFIG.style.buttons.controls.backgroundColor,
1548
+ border: e.FINAL_CONFIG.style.buttons.controls.border,
1549
+ color: e.FINAL_CONFIG.style.buttons.controls.color,
1550
+ borderRadius: `${e.FINAL_CONFIG.style.buttons.borderRadius}px`
1551
+ }),
1552
+ class: y({ "button-tool": !0, "button-tool--one-shot": !0, tooltip: !0 }),
1553
+ onClick: s[7] || (s[7] = (l) => {
1554
+ i.isResizeMode = !1, i.isMoveMode = !1, i.isDeleteMode = !1, i.isDrawMode = !1, i.isSelectMode = !1, i.isTextMode = !1, i.isWriting = !1, i.activeShape = void 0, i.showCaret = !1, e.undoLastShape();
1555
+ })
1556
+ }, [
1557
+ dt,
1558
+ e.FINAL_CONFIG.style.showTooltips ? (d(), n("span", {
1559
+ key: 0,
1560
+ class: "tooltiptext",
1561
+ style: c({
1562
+ backgroundColor: e.FINAL_CONFIG.style.tooltips.backgroundColor,
1563
+ color: e.FINAL_CONFIG.style.tooltips.color,
1564
+ border: e.FINAL_CONFIG.style.tooltips.border,
1565
+ borderRadius: `${e.FINAL_CONFIG.style.tooltips.borderRadius}px`,
1566
+ boxShadow: e.FINAL_CONFIG.style.tooltips.boxShadow
1567
+ })
1568
+ }, u(e.FINAL_CONFIG.translations.tooltipUndo), 5)) : a("", !0)
1569
+ ], 12, rt),
1570
+ e.FINAL_CONFIG.style.showPrint ? (d(), n("button", {
1571
+ key: 0,
1572
+ style: c({
1573
+ background: e.FINAL_CONFIG.style.buttons.controls.backgroundColor,
1574
+ border: e.FINAL_CONFIG.style.buttons.controls.border,
1575
+ color: e.FINAL_CONFIG.style.buttons.controls.color,
1576
+ borderRadius: `${e.FINAL_CONFIG.style.buttons.borderRadius}px`
1577
+ }),
1578
+ class: y({ "button-tool": !0, tooltip: !0 }),
1579
+ onClick: s[8] || (s[8] = (...l) => e.print && e.print(...l))
1580
+ }, [
1581
+ nt,
1582
+ e.FINAL_CONFIG.style.showTooltips ? (d(), n("span", {
1583
+ key: 0,
1584
+ class: "tooltiptext",
1585
+ style: c({
1586
+ backgroundColor: e.FINAL_CONFIG.style.tooltips.backgroundColor,
1587
+ color: e.FINAL_CONFIG.style.tooltips.color,
1588
+ border: e.FINAL_CONFIG.style.tooltips.border,
1589
+ borderRadius: `${e.FINAL_CONFIG.style.tooltips.borderRadius}px`,
1590
+ boxShadow: e.FINAL_CONFIG.style.tooltips.boxShadow
1591
+ })
1592
+ }, u(e.FINAL_CONFIG.translations.tooltipPdf), 5)) : a("", !0)
1593
+ ], 4)) : a("", !0),
1594
+ e.FINAL_CONFIG.style.showSave ? (d(), n("button", {
1595
+ key: 1,
1596
+ style: c({
1597
+ background: e.FINAL_CONFIG.style.buttons.controls.backgroundColor,
1598
+ border: e.FINAL_CONFIG.style.buttons.controls.border,
1599
+ color: e.FINAL_CONFIG.style.buttons.controls.color,
1600
+ borderRadius: `${e.FINAL_CONFIG.style.buttons.borderRadius}px`
1601
+ }),
1602
+ class: y({ "button-tool": !0, tooltip: !0 }),
1603
+ onClick: s[9] || (s[9] = (...l) => e.save && e.save(...l))
1604
+ }, [
1605
+ ct,
1606
+ e.FINAL_CONFIG.style.showTooltips ? (d(), n("span", {
1607
+ key: 0,
1608
+ class: "tooltiptext",
1609
+ style: c({
1610
+ backgroundColor: e.FINAL_CONFIG.style.tooltips.backgroundColor,
1611
+ color: e.FINAL_CONFIG.style.tooltips.color,
1612
+ border: e.FINAL_CONFIG.style.tooltips.border,
1613
+ borderRadius: `${e.FINAL_CONFIG.style.tooltips.borderRadius}px`,
1614
+ boxShadow: e.FINAL_CONFIG.style.tooltips.boxShadow
1615
+ })
1616
+ }, u(e.FINAL_CONFIG.translations.tooltipSave), 5)) : a("", !0)
1617
+ ], 4)) : a("", !0)
1618
+ ]),
1619
+ r("div", ht, [
1620
+ r("button", {
1621
+ class: y({
1622
+ "button-tool": !0,
1623
+ "button-tool--selected": i.activeShape === "circle",
1624
+ tooltip: !0
1625
+ }),
1626
+ style: c({
1627
+ background: i.activeShape === "circle" ? e.FINAL_CONFIG.style.buttons.shapes.selected.backgroundColor : e.FINAL_CONFIG.style.buttons.shapes.backgroundColor,
1628
+ border: i.activeShape === "circle" ? e.FINAL_CONFIG.style.buttons.shapes.selected.border : e.FINAL_CONFIG.style.buttons.shapes.border,
1629
+ color: i.activeShape === "circle" ? e.FINAL_CONFIG.style.buttons.shapes.selected.color : e.FINAL_CONFIG.style.buttons.shapes.color,
1630
+ borderRadius: `${e.FINAL_CONFIG.style.buttons.borderRadius}px`
1631
+ }),
1632
+ onClick: s[10] || (s[10] = (l) => {
1633
+ e.setShapeTo("circle"), i.isSelectMode = !1;
1634
+ })
1635
+ }, [
1636
+ (d(), n("svg", at, [
1637
+ r("circle", {
1638
+ cx: 6,
1639
+ cy: 6,
1640
+ r: "4",
1641
+ fill: i.options.circle.filled ? (i.activeShape === "circle", i.selectedColor + e.colorTransparency) : "none",
1642
+ stroke: "currentColor"
1643
+ }, null, 8, ut)
1644
+ ])),
1645
+ e.FINAL_CONFIG.style.showTooltips ? (d(), n("span", {
1646
+ key: 0,
1647
+ class: "tooltiptext",
1648
+ style: c({
1649
+ backgroundColor: e.FINAL_CONFIG.style.tooltips.backgroundColor,
1650
+ color: e.FINAL_CONFIG.style.tooltips.color,
1651
+ border: e.FINAL_CONFIG.style.tooltips.border,
1652
+ borderRadius: `${e.FINAL_CONFIG.style.tooltips.borderRadius}px`,
1653
+ boxShadow: e.FINAL_CONFIG.style.tooltips.boxShadow
1654
+ })
1655
+ }, u(e.FINAL_CONFIG.translations.tooltipShapeCircle), 5)) : a("", !0)
1656
+ ], 6),
1657
+ i.activeShape === "circle" ? (d(), n("div", yt, [
1658
+ r("label", It, u(e.FINAL_CONFIG.translations.filled), 1),
1659
+ f(r("input", {
1660
+ type: "checkbox",
1661
+ "onUpdate:modelValue": s[11] || (s[11] = (l) => i.options.circle.filled = l),
1662
+ onChange: s[12] || (s[12] = (...l) => e.setFillOfSelectedCircle && e.setFillOfSelectedCircle(...l)),
1663
+ checked: i.options.circle.filled
1664
+ }, null, 40, bt), [
1665
+ [g, i.options.circle.filled]
1666
+ ])
1667
+ ])) : a("", !0),
1668
+ r("button", {
1669
+ class: y({
1670
+ "button-tool": !0,
1671
+ "button-tool--selected": i.activeShape === "rect",
1672
+ tooltip: !0
1673
+ }),
1674
+ style: c({
1675
+ background: i.activeShape === "rect" ? e.FINAL_CONFIG.style.buttons.shapes.selected.backgroundColor : e.FINAL_CONFIG.style.buttons.shapes.backgroundColor,
1676
+ border: i.activeShape === "rect" ? e.FINAL_CONFIG.style.buttons.shapes.selected.border : e.FINAL_CONFIG.style.buttons.shapes.border,
1677
+ color: i.activeShape === "rect" ? e.FINAL_CONFIG.style.buttons.shapes.selected.color : e.FINAL_CONFIG.style.buttons.shapes.color,
1678
+ borderRadius: `${e.FINAL_CONFIG.style.buttons.borderRadius}px`
1679
+ }),
1680
+ onClick: s[13] || (s[13] = (l) => {
1681
+ e.setShapeTo("rect"), i.isSelectMode = !1;
1682
+ })
1683
+ }, [
1684
+ (d(), n("svg", Ft, [
1685
+ r("rect", {
1686
+ x: "3",
1687
+ y: "3",
1688
+ style: { rx: "0 !important", ry: "0 !important" },
1689
+ height: "6",
1690
+ width: "6",
1691
+ fill: i.options.rect.filled ? (i.activeShape === "rect", i.selectedColor + e.colorTransparency) : "none",
1692
+ stroke: "currentColor"
1693
+ }, null, 8, Nt)
1694
+ ])),
1695
+ e.FINAL_CONFIG.style.showTooltips ? (d(), n("span", {
1696
+ key: 0,
1697
+ class: "tooltiptext",
1698
+ style: c({
1699
+ backgroundColor: e.FINAL_CONFIG.style.tooltips.backgroundColor,
1700
+ color: e.FINAL_CONFIG.style.tooltips.color,
1701
+ border: e.FINAL_CONFIG.style.tooltips.border,
1702
+ borderRadius: `${e.FINAL_CONFIG.style.tooltips.borderRadius}px`,
1703
+ boxShadow: e.FINAL_CONFIG.style.tooltips.boxShadow
1704
+ })
1705
+ }, u(e.FINAL_CONFIG.translations.tooltipShapeRect), 5)) : a("", !0)
1706
+ ], 6),
1707
+ i.activeShape === "rect" ? (d(), n("div", ft, [
1708
+ r("label", xt, u(e.FINAL_CONFIG.translations.filled), 1),
1709
+ f(r("input", {
1710
+ id: "rectFill",
1711
+ type: "checkbox",
1712
+ "onUpdate:modelValue": s[14] || (s[14] = (l) => i.options.rect.filled = l),
1713
+ onChange: s[15] || (s[15] = (...l) => e.setFillOfSelectedRect && e.setFillOfSelectedRect(...l)),
1714
+ checked: i.options.rect.filled
1715
+ }, null, 40, Ct), [
1716
+ [g, i.options.rect.filled]
1717
+ ])
1718
+ ])) : a("", !0),
1719
+ r("button", {
1720
+ class: y({
1721
+ "button-tool": !0,
1722
+ "button-tool--selected": i.activeShape === "arrow",
1723
+ tooltip: !0
1724
+ }),
1725
+ style: c({
1726
+ background: i.activeShape === "arrow" ? e.FINAL_CONFIG.style.buttons.shapes.selected.backgroundColor : e.FINAL_CONFIG.style.buttons.shapes.backgroundColor,
1727
+ border: i.activeShape === "arrow" ? e.FINAL_CONFIG.style.buttons.shapes.selected.border : e.FINAL_CONFIG.style.buttons.shapes.border,
1728
+ color: i.activeShape === "arrow" ? e.FINAL_CONFIG.style.buttons.shapes.selected.color : e.FINAL_CONFIG.style.buttons.shapes.color,
1729
+ borderRadius: `${e.FINAL_CONFIG.style.buttons.borderRadius}px`
1730
+ }),
1731
+ onClick: s[16] || (s[16] = (l) => {
1732
+ e.setShapeTo("arrow"), i.isSelectMode = !1;
1733
+ })
1734
+ }, [
1735
+ (d(), n("svg", gt, [
1736
+ r("path", {
1737
+ stroke: i.options.arrow.filled ? i.activeShape === "arrow" ? "white" : "grey" : "none",
1738
+ "stroke-width": "2",
1739
+ d: "M5,19 19,5 14,5 19,10.5 19,5",
1740
+ fill: "none",
1741
+ "stroke-linecap": "round",
1742
+ "stroke-linejoin": "round"
1743
+ }, null, 8, St)
1744
+ ])),
1745
+ e.FINAL_CONFIG.style.showTooltips ? (d(), n("span", {
1746
+ key: 0,
1747
+ class: "tooltiptext",
1748
+ style: c({
1749
+ backgroundColor: e.FINAL_CONFIG.style.tooltips.backgroundColor,
1750
+ color: e.FINAL_CONFIG.style.tooltips.color,
1751
+ border: e.FINAL_CONFIG.style.tooltips.border,
1752
+ borderRadius: `${e.FINAL_CONFIG.style.tooltips.borderRadius}px`,
1753
+ boxShadow: e.FINAL_CONFIG.style.tooltips.boxShadow
1754
+ })
1755
+ }, u(e.FINAL_CONFIG.translations.tooltipShapeArrow), 5)) : a("", !0)
1756
+ ], 6),
1757
+ r("button", {
1758
+ class: y({
1759
+ "button-tool": !0,
1760
+ "button-tool--selected": i.activeShape === "line",
1761
+ tooltip: !0
1762
+ }),
1763
+ style: c({
1764
+ background: i.activeShape === "line" ? e.FINAL_CONFIG.style.buttons.shapes.selected.backgroundColor : e.FINAL_CONFIG.style.buttons.shapes.backgroundColor,
1765
+ border: i.activeShape === "line" ? e.FINAL_CONFIG.style.buttons.shapes.selected.border : e.FINAL_CONFIG.style.buttons.shapes.border,
1766
+ color: i.activeShape === "line" ? e.FINAL_CONFIG.style.buttons.shapes.selected.color : e.FINAL_CONFIG.style.buttons.shapes.color,
1767
+ borderRadius: `${e.FINAL_CONFIG.style.buttons.borderRadius}px`
1768
+ }),
1769
+ onClick: s[17] || (s[17] = (l) => {
1770
+ e.setShapeTo("line"), i.isSelectMode = !1;
1771
+ })
1772
+ }, [
1773
+ kt,
1774
+ e.FINAL_CONFIG.style.showTooltips ? (d(), n("span", {
1775
+ key: 0,
1776
+ class: "tooltiptext",
1777
+ style: c({
1778
+ backgroundColor: e.FINAL_CONFIG.style.tooltips.backgroundColor,
1779
+ color: e.FINAL_CONFIG.style.tooltips.color,
1780
+ border: e.FINAL_CONFIG.style.tooltips.border,
1781
+ borderRadius: `${e.FINAL_CONFIG.style.tooltips.borderRadius}px`,
1782
+ boxShadow: e.FINAL_CONFIG.style.tooltips.boxShadow
1783
+ })
1784
+ }, u(e.FINAL_CONFIG.translations.tooltipShapeFreehand), 5)) : a("", !0)
1785
+ ], 6),
1786
+ ["arrow", "circle", "rect", "line"].includes(i.activeShape) ? (d(), n("div", pt, [
1787
+ r("div", _t, [
1788
+ r("label", vt, u(e.FINAL_CONFIG.translations.thickness), 1),
1789
+ f(r("input", {
1790
+ id: "textFont",
1791
+ type: "number",
1792
+ "onUpdate:modelValue": s[18] || (s[18] = (l) => i.strokeSize = l),
1793
+ onInput: s[19] || (s[19] = (...l) => e.setStrokeWidthOfSelectedShape && e.setStrokeWidthOfSelectedShape(...l)),
1794
+ style: { padding: "0 4px", width: "40px", border: "1px solid #dadada", "border-radius": "3px" }
1795
+ }, null, 544), [
1796
+ [C, i.strokeSize]
1797
+ ])
1798
+ ])
1799
+ ])) : a("", !0),
1800
+ ["arrow", "circle", "rect"].includes(i.activeShape) ? (d(), n("div", wt, [
1801
+ r("div", At, [
1802
+ r("label", Mt, u(e.FINAL_CONFIG.translations.dashedLines), 1),
1803
+ (d(), n("svg", Ot, Gt)),
1804
+ f(r("input", {
1805
+ id: "dashStyle",
1806
+ name: "dashStyle",
1807
+ type: "checkbox",
1808
+ "onUpdate:modelValue": s[20] || (s[20] = (l) => i.isDash = l),
1809
+ onChange: s[21] || (s[21] = (...l) => e.setSelectedShapeToDash && e.setSelectedShapeToDash(...l)),
1810
+ checked: i.isDash
1811
+ }, null, 40, mt), [
1812
+ [g, i.isDash]
1813
+ ])
1814
+ ])
1815
+ ])) : a("", !0),
1816
+ r("button", {
1817
+ class: y({
1818
+ "button-tool": !0,
1819
+ "button-tool--selected": i.isTextMode,
1820
+ tooltip: !0
1821
+ }),
1822
+ style: c({
1823
+ background: i.isTextMode ? e.FINAL_CONFIG.style.buttons.shapes.selected.backgroundColor : e.FINAL_CONFIG.style.buttons.shapes.backgroundColor,
1824
+ border: i.isTextMode ? e.FINAL_CONFIG.style.buttons.shapes.selected.border : e.FINAL_CONFIG.style.buttons.shapes.border,
1825
+ color: i.isTextMode ? e.FINAL_CONFIG.style.buttons.shapes.selected.color : e.FINAL_CONFIG.style.buttons.shapes.color,
1826
+ borderRadius: `${e.FINAL_CONFIG.style.buttons.borderRadius}px`
1827
+ }),
1828
+ onClick: s[22] || (s[22] = (l) => {
1829
+ e.deleteEmptyTextElement(), i.isTextMode = !i.isTextMode, i.isDeleteMode = !1, i.isMoveMode = !1, i.isResizeMode = !1, i.isSelectMode = !1, i.isDrawMode = !1, i.activeShape = void 0;
1830
+ })
1831
+ }, [
1832
+ (d(), n("svg", Tt, Dt)),
1833
+ e.FINAL_CONFIG.style.showTooltips ? (d(), n("span", {
1834
+ key: 0,
1835
+ class: "tooltiptext",
1836
+ style: c({
1837
+ backgroundColor: e.FINAL_CONFIG.style.tooltips.backgroundColor,
1838
+ color: e.FINAL_CONFIG.style.tooltips.color,
1839
+ border: e.FINAL_CONFIG.style.tooltips.border,
1840
+ borderRadius: `${e.FINAL_CONFIG.style.tooltips.borderRadius}px`,
1841
+ boxShadow: e.FINAL_CONFIG.style.tooltips.boxShadow
1842
+ })
1843
+ }, u(e.FINAL_CONFIG.translations.tooltipShapeText), 5)) : a("", !0)
1844
+ ], 6),
1845
+ i.isTextMode ? (d(), n("div", zt, [
1846
+ r("div", Ht, [
1847
+ r("label", Wt, u(e.FINAL_CONFIG.translations.fontSize), 1),
1848
+ f(r("input", {
1849
+ id: "textFont",
1850
+ type: "number",
1851
+ "onUpdate:modelValue": s[23] || (s[23] = (l) => i.textFont = l),
1852
+ onInput: s[24] || (s[24] = (...l) => e.setCurrentStyleOfSelectedText && e.setCurrentStyleOfSelectedText(...l)),
1853
+ style: { padding: "0 4px", width: "40px", border: "1px solid #dadada", "border-radius": "3px" }
1854
+ }, null, 544), [
1855
+ [C, i.textFont]
1856
+ ])
1857
+ ])
1858
+ ])) : a("", !0),
1859
+ i.isTextMode ? (d(), n("div", Pt, [
1860
+ r("button", {
1861
+ class: y({
1862
+ "button-tool": !0,
1863
+ "button-tool--selected": i.textAlign === "start",
1864
+ tooltip: !0
1865
+ }),
1866
+ style: c({
1867
+ background: i.textAlign === "start" ? e.FINAL_CONFIG.style.buttons.shapes.selected.backgroundColor : e.FINAL_CONFIG.style.buttons.shapes.backgroundColor,
1868
+ border: i.textAlign === "start" ? e.FINAL_CONFIG.style.buttons.shapes.selected.border : e.FINAL_CONFIG.style.buttons.shapes.border,
1869
+ color: i.textAlign === "start" ? e.FINAL_CONFIG.style.buttons.shapes.selected.color : e.FINAL_CONFIG.style.buttons.shapes.color,
1870
+ borderRadius: `${e.FINAL_CONFIG.style.buttons.borderRadius}px`
1871
+ }),
1872
+ onClick: s[25] || (s[25] = (l) => {
1873
+ i.isDeleteMode = !1, i.isMoveMode = !1, i.isResizeMode = !1, i.isDrawMode = !1, i.isSelectMode = !1, i.activeShape = void 0, i.textAlign = "start", e.setSelectedTextAlignTo("start");
1874
+ })
1875
+ }, [
1876
+ Bt,
1877
+ e.FINAL_CONFIG.style.showTooltips ? (d(), n("span", {
1878
+ key: 0,
1879
+ class: "tooltiptext",
1880
+ style: c({
1881
+ backgroundColor: e.FINAL_CONFIG.style.tooltips.backgroundColor,
1882
+ color: e.FINAL_CONFIG.style.tooltips.color,
1883
+ border: e.FINAL_CONFIG.style.tooltips.border,
1884
+ borderRadius: `${e.FINAL_CONFIG.style.tooltips.borderRadius}px`,
1885
+ boxShadow: e.FINAL_CONFIG.style.tooltips.boxShadow
1886
+ })
1887
+ }, u(e.FINAL_CONFIG.translations.tooltipShapeTextLeft), 5)) : a("", !0)
1888
+ ], 6)
1889
+ ])) : a("", !0),
1890
+ i.isTextMode ? (d(), n("div", Vt, [
1891
+ r("button", {
1892
+ class: y({
1893
+ "button-tool": !0,
1894
+ "button-tool--selected": i.textAlign === "middle",
1895
+ tooltip: !0
1896
+ }),
1897
+ style: c({
1898
+ background: i.textAlign === "middle" ? e.FINAL_CONFIG.style.buttons.shapes.selected.backgroundColor : e.FINAL_CONFIG.style.buttons.shapes.backgroundColor,
1899
+ border: i.textAlign === "middle" ? e.FINAL_CONFIG.style.buttons.shapes.selected.border : e.FINAL_CONFIG.style.buttons.shapes.border,
1900
+ color: i.textAlign === "middle" ? e.FINAL_CONFIG.style.buttons.shapes.selected.color : e.FINAL_CONFIG.style.buttons.shapes.color,
1901
+ borderRadius: `${e.FINAL_CONFIG.style.buttons.borderRadius}px`
1902
+ }),
1903
+ disabled: i.isBulletTextMode,
1904
+ onClick: s[26] || (s[26] = (l) => {
1905
+ i.isDeleteMode = !1, i.isMoveMode = !1, i.isResizeMode = !1, i.isDrawMode = !1, i.isSelectMode = !1, i.activeShape = void 0, i.textAlign = "middle", e.setSelectedTextAlignTo("middle");
1906
+ })
1907
+ }, [
1908
+ Xt,
1909
+ e.FINAL_CONFIG.style.showTooltips ? (d(), n("span", {
1910
+ key: 0,
1911
+ class: "tooltiptext",
1912
+ style: c({
1913
+ backgroundColor: e.FINAL_CONFIG.style.tooltips.backgroundColor,
1914
+ color: e.FINAL_CONFIG.style.tooltips.color,
1915
+ border: e.FINAL_CONFIG.style.tooltips.border,
1916
+ borderRadius: `${e.FINAL_CONFIG.style.tooltips.borderRadius}px`,
1917
+ boxShadow: e.FINAL_CONFIG.style.tooltips.boxShadow
1918
+ })
1919
+ }, u(e.FINAL_CONFIG.translations.tooltipShapeTextCenter), 5)) : a("", !0)
1920
+ ], 14, Et)
1921
+ ])) : a("", !0),
1922
+ i.isTextMode ? (d(), n("div", Ut, [
1923
+ r("button", {
1924
+ class: y({
1925
+ "button-tool": !0,
1926
+ "button-tool--selected": i.textAlign === "end",
1927
+ tooltip: !0
1928
+ }),
1929
+ style: c({
1930
+ background: i.textAlign === "end" ? e.FINAL_CONFIG.style.buttons.shapes.selected.backgroundColor : e.FINAL_CONFIG.style.buttons.shapes.backgroundColor,
1931
+ border: i.textAlign === "end" ? e.FINAL_CONFIG.style.buttons.shapes.selected.border : e.FINAL_CONFIG.style.buttons.shapes.border,
1932
+ color: i.textAlign === "end" ? e.FINAL_CONFIG.style.buttons.shapes.selected.color : e.FINAL_CONFIG.style.buttons.shapes.color,
1933
+ borderRadius: `${e.FINAL_CONFIG.style.buttons.borderRadius}px`
1934
+ }),
1935
+ disabled: i.isBulletTextMode,
1936
+ onClick: s[27] || (s[27] = (l) => {
1937
+ i.isDeleteMode = !1, i.isMoveMode = !1, i.isResizeMode = !1, i.isDrawMode = !1, i.isSelectMode = !1, i.activeShape = void 0, i.textAlign = "end", e.setSelectedTextAlignTo("end");
1938
+ })
1939
+ }, [
1940
+ jt,
1941
+ e.FINAL_CONFIG.style.showTooltips ? (d(), n("span", {
1942
+ key: 0,
1943
+ class: "tooltiptext",
1944
+ style: c({
1945
+ backgroundColor: e.FINAL_CONFIG.style.tooltips.backgroundColor,
1946
+ color: e.FINAL_CONFIG.style.tooltips.color,
1947
+ border: e.FINAL_CONFIG.style.tooltips.border,
1948
+ borderRadius: `${e.FINAL_CONFIG.style.tooltips.borderRadius}px`,
1949
+ boxShadow: e.FINAL_CONFIG.style.tooltips.boxShadow
1950
+ })
1951
+ }, u(e.FINAL_CONFIG.translations.tooltipShapeTextRight), 5)) : a("", !0)
1952
+ ], 14, Yt)
1953
+ ])) : a("", !0),
1954
+ i.isTextMode ? (d(), n("div", Zt, [
1955
+ r("button", {
1956
+ class: y({
1957
+ "button-tool": !0,
1958
+ "button-tool--selected": i.isBulletTextMode,
1959
+ tooltip: !0
1960
+ }),
1961
+ style: c({
1962
+ background: i.isBulletTextMode ? e.FINAL_CONFIG.style.buttons.shapes.selected.backgroundColor : e.FINAL_CONFIG.style.buttons.shapes.backgroundColor,
1963
+ border: i.isBulletTextMode ? e.FINAL_CONFIG.style.buttons.shapes.selected.border : e.FINAL_CONFIG.style.buttons.shapes.border,
1964
+ color: i.isBulletTextMode ? e.FINAL_CONFIG.style.buttons.shapes.selected.color : e.FINAL_CONFIG.style.buttons.shapes.color,
1965
+ borderRadius: `${e.FINAL_CONFIG.style.buttons.borderRadius}px`
1966
+ }),
1967
+ onClick: s[28] || (s[28] = (l) => {
1968
+ i.isDeleteMode = !1, i.isMoveMode = !1, i.isResizeMode = !1, i.isDrawMode = !1, i.isSelectMode = !1, i.activeShape = void 0, i.isBulletTextMode = !i.isBulletTextMode, i.textAlign = "start", e.setSelectedTextAlignTo("start"), e.setCurrentStyleOfSelectedText();
1969
+ })
1970
+ }, [
1971
+ Jt,
1972
+ e.FINAL_CONFIG.style.showTooltips ? (d(), n("span", {
1973
+ key: 0,
1974
+ class: "tooltiptext",
1975
+ style: c({
1976
+ backgroundColor: e.FINAL_CONFIG.style.tooltips.backgroundColor,
1977
+ color: e.FINAL_CONFIG.style.tooltips.color,
1978
+ border: e.FINAL_CONFIG.style.tooltips.border,
1979
+ borderRadius: `${e.FINAL_CONFIG.style.tooltips.borderRadius}px`,
1980
+ boxShadow: e.FINAL_CONFIG.style.tooltips.boxShadow
1981
+ })
1982
+ }, u(e.FINAL_CONFIG.translations.tooltipShapeTextBullet), 5)) : a("", !0)
1983
+ ], 6)
1984
+ ])) : a("", !0),
1985
+ i.isTextMode ? (d(), n("div", qt, [
1986
+ r("button", {
1987
+ class: y({
1988
+ "button-tool": !0,
1989
+ "button-tool--selected": i.isBold,
1990
+ tooltip: !0
1991
+ }),
1992
+ style: c({
1993
+ background: i.isBold ? e.FINAL_CONFIG.style.buttons.shapes.selected.backgroundColor : e.FINAL_CONFIG.style.buttons.shapes.backgroundColor,
1994
+ border: i.isBold ? e.FINAL_CONFIG.style.buttons.shapes.selected.border : e.FINAL_CONFIG.style.buttons.shapes.border,
1995
+ color: i.isBold ? e.FINAL_CONFIG.style.buttons.shapes.selected.color : e.FINAL_CONFIG.style.buttons.shapes.color,
1996
+ borderRadius: `${e.FINAL_CONFIG.style.buttons.borderRadius}px`
1997
+ }),
1998
+ onClick: s[29] || (s[29] = (l) => {
1999
+ i.isDeleteMode = !1, i.isMoveMode = !1, i.isResizeMode = !1, i.isDrawMode = !1, i.isSelectMode = !1, i.activeShape = void 0, i.isBold = !i.isBold, e.setCurrentStyleOfSelectedText();
2000
+ })
2001
+ }, [
2002
+ Kt,
2003
+ e.FINAL_CONFIG.style.showTooltips ? (d(), n("span", {
2004
+ key: 0,
2005
+ class: "tooltiptext",
2006
+ style: c({
2007
+ backgroundColor: e.FINAL_CONFIG.style.tooltips.backgroundColor,
2008
+ color: e.FINAL_CONFIG.style.tooltips.color,
2009
+ border: e.FINAL_CONFIG.style.tooltips.border,
2010
+ borderRadius: `${e.FINAL_CONFIG.style.tooltips.borderRadius}px`,
2011
+ boxShadow: e.FINAL_CONFIG.style.tooltips.boxShadow
2012
+ })
2013
+ }, u(e.FINAL_CONFIG.translations.tooltipShapeTextBold), 5)) : a("", !0)
2014
+ ], 6)
2015
+ ])) : a("", !0),
2016
+ i.isTextMode ? (d(), n("div", Qt, [
2017
+ r("button", {
2018
+ class: y({
2019
+ "button-tool": !0,
2020
+ "button-tool--selected": i.isItalic,
2021
+ tooltip: !0
2022
+ }),
2023
+ style: c({
2024
+ background: i.isItalic ? e.FINAL_CONFIG.style.buttons.shapes.selected.backgroundColor : e.FINAL_CONFIG.style.buttons.shapes.backgroundColor,
2025
+ border: i.isItalic ? e.FINAL_CONFIG.style.buttons.shapes.selected.border : e.FINAL_CONFIG.style.buttons.shapes.border,
2026
+ color: i.isItalic ? e.FINAL_CONFIG.style.buttons.shapes.selected.color : e.FINAL_CONFIG.style.buttons.shapes.color,
2027
+ borderRadius: `${e.FINAL_CONFIG.style.buttons.borderRadius}px`
2028
+ }),
2029
+ onClick: s[30] || (s[30] = (l) => {
2030
+ i.isDeleteMode = !1, i.isMoveMode = !1, i.isResizeMode = !1, i.isDrawMode = !1, i.isSelectMode = !1, i.activeShape = void 0, i.isItalic = !i.isItalic, e.setCurrentStyleOfSelectedText();
2031
+ })
2032
+ }, [
2033
+ $t,
2034
+ e.FINAL_CONFIG.style.showTooltips ? (d(), n("span", {
2035
+ key: 0,
2036
+ class: "tooltiptext",
2037
+ style: c({
2038
+ backgroundColor: e.FINAL_CONFIG.style.tooltips.backgroundColor,
2039
+ color: e.FINAL_CONFIG.style.tooltips.color,
2040
+ border: e.FINAL_CONFIG.style.tooltips.border,
2041
+ borderRadius: `${e.FINAL_CONFIG.style.tooltips.borderRadius}px`,
2042
+ boxShadow: e.FINAL_CONFIG.style.tooltips.boxShadow
2043
+ })
2044
+ }, u(e.FINAL_CONFIG.translations.tooltipShapeTextItalic), 5)) : a("", !0)
2045
+ ], 6)
2046
+ ])) : a("", !0),
2047
+ i.isTextMode ? (d(), n("div", te, [
2048
+ r("button", {
2049
+ class: y({
2050
+ "button-tool": !0,
2051
+ "button-tool--selected": i.isUnderline,
2052
+ tooltip: !0
2053
+ }),
2054
+ style: c({
2055
+ background: i.isUnderline ? e.FINAL_CONFIG.style.buttons.shapes.selected.backgroundColor : e.FINAL_CONFIG.style.buttons.shapes.backgroundColor,
2056
+ border: i.isUnderline ? e.FINAL_CONFIG.style.buttons.shapes.selected.border : e.FINAL_CONFIG.style.buttons.shapes.border,
2057
+ color: i.isUnderline ? e.FINAL_CONFIG.style.buttons.shapes.selected.color : e.FINAL_CONFIG.style.buttons.shapes.color,
2058
+ borderRadius: `${e.FINAL_CONFIG.style.buttons.borderRadius}px`
2059
+ }),
2060
+ onClick: s[31] || (s[31] = (l) => {
2061
+ i.isDeleteMode = !1, i.isMoveMode = !1, i.isResizeMode = !1, i.isDrawMode = !1, i.isSelectMode = !1, i.activeShape = void 0, i.isUnderline = !i.isUnderline, e.setCurrentStyleOfSelectedText();
2062
+ })
2063
+ }, [
2064
+ ee,
2065
+ e.FINAL_CONFIG.style.showTooltips ? (d(), n("span", {
2066
+ key: 0,
2067
+ class: "tooltiptext",
2068
+ style: c({
2069
+ backgroundColor: e.FINAL_CONFIG.style.tooltips.backgroundColor,
2070
+ color: e.FINAL_CONFIG.style.tooltips.color,
2071
+ border: e.FINAL_CONFIG.style.tooltips.border,
2072
+ borderRadius: `${e.FINAL_CONFIG.style.tooltips.borderRadius}px`,
2073
+ boxShadow: e.FINAL_CONFIG.style.tooltips.boxShadow
2074
+ })
2075
+ }, u(e.FINAL_CONFIG.translations.tooltipShapeTextUnderline), 5)) : a("", !0)
2076
+ ], 6)
2077
+ ])) : a("", !0),
2078
+ r("div", ie, [
2079
+ f(r("input", {
2080
+ type: "color",
2081
+ id: "colorPicker",
2082
+ name: "colorPicker",
2083
+ "onUpdate:modelValue": s[32] || (s[32] = (l) => i.selectedColor = l),
2084
+ onInput: s[33] || (s[33] = (...l) => e.setColorOfSelectedShape && e.setColorOfSelectedShape(...l)),
2085
+ style: c(`height: 30px; width: 30px; border-radius: ${e.FINAL_CONFIG.style.buttons.borderRadius}px; cursor: pointer`)
2086
+ }, null, 36), [
2087
+ [C, i.selectedColor]
2088
+ ]),
2089
+ e.FINAL_CONFIG.style.showTooltips ? (d(), n("span", {
2090
+ key: 0,
2091
+ class: "tooltiptext",
2092
+ style: c({
2093
+ backgroundColor: e.FINAL_CONFIG.style.tooltips.backgroundColor,
2094
+ color: e.FINAL_CONFIG.style.tooltips.color,
2095
+ border: e.FINAL_CONFIG.style.tooltips.border,
2096
+ borderRadius: `${e.FINAL_CONFIG.style.tooltips.borderRadius}px`,
2097
+ boxShadow: e.FINAL_CONFIG.style.tooltips.boxShadow
2098
+ })
2099
+ }, u(e.FINAL_CONFIG.translations.tooltipShapeColor), 5)) : a("", !0)
2100
+ ]),
2101
+ r("div", se, [
2102
+ r("label", oe, u(e.FINAL_CONFIG.translations.colorAlpha) + ": " + u(i.transparency > 98 ? 100 : i.transparency) + " % ", 1),
2103
+ f(r("input", {
2104
+ id: "colorTransparency",
2105
+ name: "colorTransparency",
2106
+ type: "range",
2107
+ "onUpdate:modelValue": s[34] || (s[34] = (l) => i.transparency = l),
2108
+ onInput: s[35] || (s[35] = (...l) => e.setTransparencyOfSelectedShape && e.setTransparencyOfSelectedShape(...l)),
2109
+ min: 0,
2110
+ max: 100,
2111
+ style: { width: "100px" }
2112
+ }, null, 544), [
2113
+ [C, i.transparency]
2114
+ ])
2115
+ ])
2116
+ ])
2117
+ ], 36)
2118
+ ]),
2119
+ r("div", le, [
2120
+ O(t.$slots, "default", {}, void 0, !0),
2121
+ i.isSummaryOpen ? (d(), n("svg", {
2122
+ id: "annotatorSvg",
2123
+ key: i.step,
2124
+ ref: "mainSvg",
2125
+ class: y({ draw: !0, "draw--free": i.activeShape === "line" }),
2126
+ style: c([`cursor:${e.cursorClass}; font-family: Helvetica; z-index: 100000000;`, { position: "absolute", top: "0", left: "0" }]),
2127
+ viewBox: `0 0 ${i.svgWidth} ${i.svgHeight}`,
2128
+ width: i.sourceWidth,
2129
+ height: i.sourceHeight,
2130
+ onPointerdown: s[38] || (s[38] = (l) => e.chooseAction(l)),
2131
+ onPointerup: s[39] || (s[39] = (...l) => e.resetDraw && e.resetDraw(...l)),
2132
+ onTouchend: s[40] || (s[40] = (...l) => e.resetDraw && e.resetDraw(...l)),
2133
+ onTouchstart: s[41] || (s[41] = (l) => {
2134
+ e.setPointer(l), e.clickSvg(l);
2135
+ }),
2136
+ onPointermove: s[42] || (s[42] = (l) => {
2137
+ e.setPointer(l), e.chooseMove(l);
2138
+ }),
2139
+ onPointerout: s[43] || (s[43] = (l) => {
2140
+ i.preventEdit = !0, i.hoveredShapeId = void 0;
2141
+ }),
2142
+ onPointerover: s[44] || (s[44] = (l) => e.allowEditAndHoverShapes(l)),
2143
+ onClick: s[45] || (s[45] = (l) => e.clickSvg(l))
2144
+ }, [
2145
+ (d(!0), n(L, null, G(e.userShapes, (l, I) => (d(), n("g", {
2146
+ key: `shape_${I}`,
2147
+ id: l.id,
2148
+ innerHTML: l,
2149
+ onClick: s[37] || (s[37] = (b) => {
2150
+ e.clickShape(b), i.isMoveMode = !1;
2151
+ })
2152
+ }, null, 8, de))), 128))
2153
+ ], 46, re)) : a("", !0),
2154
+ i.isPrinting ? (d(), n("svg", {
2155
+ key: 1,
2156
+ style: { position: "absolute", top: "0", left: "0" },
2157
+ height: i.sourceHeight,
2158
+ viewBox: `0 0 ${i.svgWidth} ${i.svgHeight}`,
2159
+ width: i.sourceWidth
2160
+ }, [
2161
+ r("circle", {
2162
+ class: "animated-circle-print",
2163
+ cx: i.svgWidth / 2,
2164
+ cy: i.svgHeight / 2,
2165
+ r: "50",
2166
+ stroke: "#6376DD",
2167
+ "stroke-width": "10",
2168
+ fill: "none"
2169
+ }, null, 8, ce)
2170
+ ], 8, ne)) : a("", !0)
2171
+ ], 512)
2172
+ ]);
2173
+ }
2174
+ const Fe = /* @__PURE__ */ R(D, [["render", he], ["__scopeId", "data-v-3611298e"]]);
2175
+ export {
2176
+ Fe as default
2177
+ };