vue-data-ui 2.2.90 → 2.2.92

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