vue-data-ui 3.26.5 → 3.27.1-beta.0

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 (531) hide show
  1. package/dist/A11yDataTable-DWNlWXzs.js +1 -0
  2. package/dist/Arrow-CJeSufxg.js +1 -0
  3. package/dist/BaseDraggableDialog-T1gEsQid.js +1 -0
  4. package/dist/BaseIcon-Cz30ODFA.js +1 -0
  5. package/dist/BaseLegendToggle-Dn_tNvn4.js +1 -0
  6. package/dist/BaseScanner-8NdoBs7B.js +1 -0
  7. package/dist/BaseZoomControls-xq3tWD3j.js +1 -0
  8. package/dist/ColorPicker-CUjEw53A.js +1 -0
  9. package/dist/DataTable-DSUA5M9p.js +1 -0
  10. package/dist/DefGrad-DKMq1REY.js +1 -0
  11. package/dist/HillActions-DdvXld3a.js +1 -0
  12. package/dist/Legend-DokTll4u.js +1 -0
  13. package/dist/NonSvgPenAndPaper-BLzQuIm6.js +1 -0
  14. package/dist/PackageVersion-D6pKL176.js +1 -0
  15. package/dist/PenAndPaper-DvJJaeU2.js +1 -0
  16. package/dist/RecursiveCircles-BftI1kwF.js +1 -0
  17. package/dist/RecursiveLabels-B0d04xSj.js +1 -0
  18. package/dist/RecursiveLinks-CZtG6uWg.js +1 -0
  19. package/dist/Shape-tkp65OcG.js +1 -0
  20. package/dist/SlicerPreview-GFRs2EWB.js +1 -0
  21. package/dist/SparkTooltip-BlJLvizH.js +1 -0
  22. package/dist/Title-BRAjxtjG.js +1 -0
  23. package/dist/Tooltip-BUXB0i6z.js +1 -0
  24. package/dist/UserOptions-D65t74CM.js +1 -0
  25. package/dist/_plugin-vue_export-helper-BDNMzG2s.js +1 -0
  26. package/dist/annotationSlots-BRR85CqJ.js +1 -0
  27. package/dist/chartImage-NwZO-elv.js +1 -0
  28. package/dist/components/arrow.js +1 -2
  29. package/dist/components/vue-ui-3d-bar.js +1 -2
  30. package/dist/components/vue-ui-accordion.js +1 -2
  31. package/dist/components/vue-ui-age-pyramid.js +1 -2
  32. package/dist/components/vue-ui-annotator.js +1 -2
  33. package/dist/components/vue-ui-bullet.js +1 -2
  34. package/dist/components/vue-ui-bump.js +1 -2
  35. package/dist/components/vue-ui-candlestick.js +1 -2
  36. package/dist/components/vue-ui-carousel-table.js +1 -2
  37. package/dist/components/vue-ui-chestnut.js +1 -2
  38. package/dist/components/vue-ui-chord.js +1 -2
  39. package/dist/components/vue-ui-circle-pack.js +1 -2
  40. package/dist/components/vue-ui-cursor.js +1 -2
  41. package/dist/components/vue-ui-dag.js +1 -2
  42. package/dist/components/vue-ui-dashboard.js +1 -2
  43. package/dist/components/vue-ui-digits.js +1 -2
  44. package/dist/components/vue-ui-donut-evolution.js +1 -2
  45. package/dist/components/vue-ui-donut.js +1 -2
  46. package/dist/components/vue-ui-dumbbell.js +1 -2
  47. package/dist/components/vue-ui-flow.js +1 -2
  48. package/dist/components/vue-ui-funnel.js +1 -2
  49. package/dist/components/vue-ui-galaxy.js +1 -2
  50. package/dist/components/vue-ui-gauge.js +1 -2
  51. package/dist/components/vue-ui-geo.js +1 -2
  52. package/dist/components/vue-ui-gizmo.js +1 -2
  53. package/dist/components/vue-ui-heatmap.js +1 -2
  54. package/dist/components/vue-ui-hill.js +1 -2
  55. package/dist/components/vue-ui-history-plot.js +1 -2
  56. package/dist/components/vue-ui-horizontal-bar.js +1 -2
  57. package/dist/components/vue-ui-icon.js +1 -2
  58. package/dist/components/vue-ui-kpi.js +1 -2
  59. package/dist/components/vue-ui-label.js +1 -2
  60. package/dist/components/vue-ui-mini-loader.js +1 -2
  61. package/dist/components/vue-ui-molecule.js +1 -2
  62. package/dist/components/vue-ui-mood-radar.js +1 -2
  63. package/dist/components/vue-ui-nested-donuts.js +1 -2
  64. package/dist/components/vue-ui-onion.js +1 -2
  65. package/dist/components/vue-ui-parallel-coordinate-plot.js +1 -2
  66. package/dist/components/vue-ui-pattern-seed.js +1 -2
  67. package/dist/components/vue-ui-pattern.js +1 -2
  68. package/dist/components/vue-ui-quadrant.js +1 -2
  69. package/dist/components/vue-ui-quick-chart.js +1 -2
  70. package/dist/components/vue-ui-radar.js +1 -2
  71. package/dist/components/vue-ui-rating.js +1 -2
  72. package/dist/components/vue-ui-relation-circle.js +1 -2
  73. package/dist/components/vue-ui-ridgeline.js +1 -2
  74. package/dist/components/vue-ui-rings.js +1 -2
  75. package/dist/components/vue-ui-scatter.js +1 -2
  76. package/dist/components/vue-ui-skeleton.js +1 -2
  77. package/dist/components/vue-ui-smiley.js +1 -2
  78. package/dist/components/vue-ui-spark-trend.js +1 -2
  79. package/dist/components/vue-ui-sparkbar.js +1 -2
  80. package/dist/components/vue-ui-sparkgauge.js +1 -2
  81. package/dist/components/vue-ui-sparkhistogram.js +1 -2
  82. package/dist/components/vue-ui-sparkline.js +1 -2
  83. package/dist/components/vue-ui-sparkstackbar.js +1 -2
  84. package/dist/components/vue-ui-stackbar.js +1 -2
  85. package/dist/components/vue-ui-stackline.js +1 -2
  86. package/dist/components/vue-ui-strip-plot.js +1 -2
  87. package/dist/components/vue-ui-table-heatmap.js +1 -2
  88. package/dist/components/vue-ui-table-sparkline.js +1 -2
  89. package/dist/components/vue-ui-table.js +1 -2
  90. package/dist/components/vue-ui-thermometer.js +1 -2
  91. package/dist/components/vue-ui-timer.js +1 -2
  92. package/dist/components/vue-ui-tiremarks.js +1 -2
  93. package/dist/components/vue-ui-treemap.js +1 -2
  94. package/dist/components/vue-ui-vertical-bar.js +1 -2
  95. package/dist/components/vue-ui-waffle.js +1 -2
  96. package/dist/components/vue-ui-wheel.js +1 -2
  97. package/dist/components/vue-ui-word-cloud.js +1 -2
  98. package/dist/components/vue-ui-world.js +1 -2
  99. package/dist/components/vue-ui-xy-canvas.js +1 -2
  100. package/dist/components/vue-ui-xy.js +1 -2
  101. package/dist/composables.js +1 -5
  102. package/dist/dom-to-png-Cp3WLHmJ.js +3 -0
  103. package/dist/exposedLib-CMTeSmyW.js +1 -0
  104. package/dist/geoProjections-Bvj-eMvq.js +1 -0
  105. package/dist/img-8sM3sVWU.js +1 -0
  106. package/dist/labelUtils-Djp5nJtN.js +1 -0
  107. package/dist/lib-zDxoqrgo.js +12 -0
  108. package/dist/package-DIR2F6AE.js +1 -0
  109. package/dist/patternUtils-_q3ArM3g.js +1 -0
  110. package/dist/pdf-Dlv_ks7R.js +1 -0
  111. package/dist/render-common-DOYi0f4Z.js +1 -0
  112. package/dist/resolveChartConfig-BSo1Oe9n.js +1 -0
  113. package/dist/rolldown-runtime-DK3Fl9T5.js +1 -0
  114. package/dist/ssr/vue-ui-donut.js +1 -2
  115. package/dist/ssr/vue-ui-xy.js +1 -2
  116. package/dist/ssr.js +1 -3
  117. package/dist/style.css +1 -1
  118. package/dist/tableIntegration-CNoJ1CIY.js +1 -0
  119. package/dist/types/composables.d.ts +12 -12
  120. package/dist/types/ssr.d.ts +84 -84
  121. package/dist/types/utils.d.ts +82 -73
  122. package/dist/types/vue-data-ui.d.ts +17969 -17813
  123. package/dist/types/vue-ui-3d-bar.d.ts +24 -91
  124. package/dist/types/vue-ui-accordion.d.ts +2 -10
  125. package/dist/types/vue-ui-age-pyramid.d.ts +27 -106
  126. package/dist/types/vue-ui-annotator.d.ts +12 -88
  127. package/dist/types/vue-ui-bullet.d.ts +21 -83
  128. package/dist/types/vue-ui-bump.d.ts +23 -90
  129. package/dist/types/vue-ui-candlestick.d.ts +27 -108
  130. package/dist/types/vue-ui-carousel-table.d.ts +11 -57
  131. package/dist/types/vue-ui-chestnut.d.ts +27 -96
  132. package/dist/types/vue-ui-chord.d.ts +31 -108
  133. package/dist/types/vue-ui-circle-pack.d.ts +30 -124
  134. package/dist/types/vue-ui-cursor.d.ts +2 -8
  135. package/dist/types/vue-ui-dag.d.ts +35 -125
  136. package/dist/types/vue-ui-dashboard.d.ts +18 -66
  137. package/dist/types/vue-ui-digits.d.ts +2 -11
  138. package/dist/types/vue-ui-donut-evolution.d.ts +31 -100
  139. package/dist/types/vue-ui-donut.d.ts +31 -121
  140. package/dist/types/vue-ui-dumbbell.d.ts +24 -92
  141. package/dist/types/vue-ui-flow.d.ts +28 -104
  142. package/dist/types/vue-ui-funnel.d.ts +18 -77
  143. package/dist/types/vue-ui-galaxy.d.ts +30 -112
  144. package/dist/types/vue-ui-gauge.d.ts +22 -87
  145. package/dist/types/vue-ui-geo.d.ts +22 -92
  146. package/dist/types/vue-ui-gizmo.d.ts +5 -20
  147. package/dist/types/vue-ui-heatmap.d.ts +25 -101
  148. package/dist/types/vue-ui-hill.d.ts +22 -88
  149. package/dist/types/vue-ui-history-plot.d.ts +30 -112
  150. package/dist/types/vue-ui-horizontal-bar.d.ts +30 -114
  151. package/dist/types/vue-ui-icon.d.ts +1 -13
  152. package/dist/types/vue-ui-kpi.d.ts +5 -23
  153. package/dist/types/vue-ui-label.d.ts +11 -48
  154. package/dist/types/vue-ui-mini-loader.d.ts +4 -13
  155. package/dist/types/vue-ui-molecule.d.ts +27 -110
  156. package/dist/types/vue-ui-mood-radar.d.ts +23 -90
  157. package/dist/types/vue-ui-nested-donuts.d.ts +28 -109
  158. package/dist/types/vue-ui-onion.d.ts +26 -104
  159. package/dist/types/vue-ui-parallel-coordinate-plot.d.ts +34 -123
  160. package/dist/types/vue-ui-pattern-seed.d.ts +1 -14
  161. package/dist/types/vue-ui-pattern.d.ts +1 -13
  162. package/dist/types/vue-ui-quadrant.d.ts +33 -123
  163. package/dist/types/vue-ui-quick-chart.d.ts +30 -110
  164. package/dist/types/vue-ui-radar.d.ts +31 -114
  165. package/dist/types/vue-ui-rating.d.ts +8 -40
  166. package/dist/types/vue-ui-relation-circle.d.ts +26 -90
  167. package/dist/types/vue-ui-ridgeline.d.ts +27 -104
  168. package/dist/types/vue-ui-rings.d.ts +21 -96
  169. package/dist/types/vue-ui-scatter.d.ts +22 -95
  170. package/dist/types/vue-ui-skeleton.d.ts +2 -10
  171. package/dist/types/vue-ui-smiley.d.ts +6 -26
  172. package/dist/types/vue-ui-spark-trend.d.ts +2 -18
  173. package/dist/types/vue-ui-sparkbar.d.ts +10 -47
  174. package/dist/types/vue-ui-sparkgauge.d.ts +5 -26
  175. package/dist/types/vue-ui-sparkhistogram.d.ts +12 -44
  176. package/dist/types/vue-ui-sparkline.d.ts +16 -61
  177. package/dist/types/vue-ui-sparkstackbar.d.ts +13 -58
  178. package/dist/types/vue-ui-stackbar.d.ts +36 -120
  179. package/dist/types/vue-ui-stackline.d.ts +29 -116
  180. package/dist/types/vue-ui-strip-plot.d.ts +22 -96
  181. package/dist/types/vue-ui-table-heatmap.d.ts +14 -60
  182. package/dist/types/vue-ui-table-sparkline.d.ts +12 -51
  183. package/dist/types/vue-ui-table.d.ts +9 -36
  184. package/dist/types/vue-ui-thermometer.d.ts +14 -68
  185. package/dist/types/vue-ui-timer.d.ts +10 -47
  186. package/dist/types/vue-ui-tiremarks.d.ts +14 -68
  187. package/dist/types/vue-ui-treemap.d.ts +26 -105
  188. package/dist/types/vue-ui-vertical-bar.d.ts +8 -19
  189. package/dist/types/vue-ui-waffle.d.ts +23 -99
  190. package/dist/types/vue-ui-wheel.d.ts +14 -68
  191. package/dist/types/vue-ui-word-cloud.d.ts +20 -95
  192. package/dist/types/vue-ui-world.d.ts +22 -96
  193. package/dist/types/vue-ui-xy-canvas.d.ts +24 -101
  194. package/dist/types/vue-ui-xy.d.ts +42 -146
  195. package/dist/unpackTheme-CNsFKCeq.js +1 -0
  196. package/dist/useAutoSizeLabelsInsideViewbox-AIRF0PlD.js +1 -0
  197. package/dist/useChartAccessibility-DOMuYJfm.js +1 -0
  198. package/dist/useChartExport-DtPNpc9M.js +1 -0
  199. package/dist/useConfig-CKdzPrcf.js +1 -0
  200. package/dist/useFitSvgText-C1QC4P5G.js +1 -0
  201. package/dist/useHints-BH9r_0Vd.js +6 -0
  202. package/dist/useNestedProp-CT9phgWx.js +1 -0
  203. package/dist/useObjectBindings-DM3xDKV3.js +1 -0
  204. package/dist/usePanZoom-BdjP5Suc.js +1 -0
  205. package/dist/usePrefersMotion-XLHwega2.js +1 -0
  206. package/dist/usePrinter-CnyKPIFM.js +1 -0
  207. package/dist/useResponsive-D2CPcpda.js +1 -0
  208. package/dist/useStableElementSize-CegFbRlF.js +1 -0
  209. package/dist/useTableResponsive-uSz_qZOB.js +1 -0
  210. package/dist/useThemeCheck-BKNRbGeC.js +1 -0
  211. package/dist/useTimeLabelCollider-XQf_S7-z.js +1 -0
  212. package/dist/useTimeLabels-Das5O74F.js +1 -0
  213. package/dist/useTooltipPosition-aoV8pZZ9.js +1 -0
  214. package/dist/useTransitions-DfSHzsdz.js +1 -0
  215. package/dist/useUserOptionState-CXlFnwPv.js +1 -0
  216. package/dist/userOptionsSlots-DYuo-E5m.js +1 -0
  217. package/dist/utils.js +1 -30
  218. package/dist/vClickOutside-BxNzkY17.js +1 -0
  219. package/dist/vue-data-ui-BG41UScx.js +1 -0
  220. package/dist/vue-data-ui.js +1 -79
  221. package/dist/vue-ui-3d-bar-DiaiNy-k.js +19 -0
  222. package/dist/vue-ui-accordion-Dy5OVFKr.js +1 -0
  223. package/dist/vue-ui-age-pyramid-OeUr1yxi.js +1 -0
  224. package/dist/vue-ui-annotator-DA_xAFql.js +331 -0
  225. package/dist/vue-ui-bullet-B9lcCTVb.js +34 -0
  226. package/dist/vue-ui-bump-DYajIrva.js +10 -0
  227. package/dist/vue-ui-candlestick-CdAZuNxo.js +22 -0
  228. package/dist/vue-ui-carousel-table-ihGH0LDH.js +1 -0
  229. package/dist/vue-ui-chestnut-B2aNXFNO.js +1 -0
  230. package/dist/vue-ui-chord-fAckHfOW.js +21 -0
  231. package/dist/vue-ui-circle-pack-BWHVImkS.js +13 -0
  232. package/dist/vue-ui-cursor-DdXKXmhr.js +1 -0
  233. package/dist/vue-ui-dag-a0fNoIcJ.js +9 -0
  234. package/dist/vue-ui-dashboard-DkdYMB7n.js +1 -0
  235. package/dist/vue-ui-digits-CL9SuIEI.js +42 -0
  236. package/dist/vue-ui-donut-BaEodt-3.js +22 -0
  237. package/dist/vue-ui-donut-DaYxdQmP.js +47 -0
  238. package/dist/vue-ui-donut-evolution-T8cRXKRQ.js +2 -0
  239. package/dist/vue-ui-dumbbell-B6HJxEZp.js +9 -0
  240. package/dist/vue-ui-flow-BlTCVFr3.js +3 -0
  241. package/dist/vue-ui-funnel-WgLFJadZ.js +1 -0
  242. package/dist/vue-ui-galaxy-B3nuI6E8.js +1 -0
  243. package/dist/vue-ui-gauge-BwTP65O4.js +1 -0
  244. package/dist/vue-ui-geo-CX3yH18H.js +1 -0
  245. package/dist/vue-ui-gizmo-CNHcBsku.js +1 -0
  246. package/dist/vue-ui-heatmap-CTdeoar7.js +1 -0
  247. package/dist/vue-ui-hill-DR5k8GWZ.js +1 -0
  248. package/dist/vue-ui-history-plot-C-9uH-Uj.js +2 -0
  249. package/dist/vue-ui-horizontal-bar-qqF7pL7U.js +4 -0
  250. package/dist/vue-ui-kpi-DVcLXGqG.js +1 -0
  251. package/dist/vue-ui-label-D1Aog-zO.js +7 -0
  252. package/dist/vue-ui-mini-loader-CX0Dx9tT.js +1 -0
  253. package/dist/vue-ui-molecule-B13qVX71.js +1 -0
  254. package/dist/vue-ui-mood-radar-C1BtB8lg.js +1 -0
  255. package/dist/vue-ui-nested-donuts-B90yrlJG.js +19 -0
  256. package/dist/vue-ui-onion-UMVO2DE_.js +5 -0
  257. package/dist/vue-ui-parallel-coordinate-plot-C0ofFivm.js +9 -0
  258. package/dist/vue-ui-pattern-DrPCu32G.js +1 -0
  259. package/dist/vue-ui-pattern-seed-B8YjAAEH.js +1 -0
  260. package/dist/vue-ui-quadrant-CPG6yAiu.js +2 -0
  261. package/dist/vue-ui-quick-chart-BTPb-Iz8.js +17 -0
  262. package/dist/vue-ui-radar-Hd-pE9ih.js +1 -0
  263. package/dist/vue-ui-rating-C_YxQYa_.js +1 -0
  264. package/dist/vue-ui-relation-circle-CHYG7ZJl.js +1 -0
  265. package/dist/vue-ui-ridgeline-DS1Gvljt.js +2 -0
  266. package/dist/vue-ui-rings-B-Hb13Uu.js +1 -0
  267. package/dist/vue-ui-scatter-BTgvOmuo.js +9 -0
  268. package/dist/vue-ui-skeleton-B-Acw3CC.js +41 -0
  269. package/dist/vue-ui-smiley-Ciwqt6ek.js +1 -0
  270. package/dist/vue-ui-spark-trend-CYqy6c0S.js +1 -0
  271. package/dist/vue-ui-sparkbar-CTXIgjmP.js +1 -0
  272. package/dist/vue-ui-sparkgauge-CObOL6s2.js +1 -0
  273. package/dist/vue-ui-sparkhistogram-ClFyDez-.js +1 -0
  274. package/dist/vue-ui-sparkline-DP_nYlW8.js +1 -0
  275. package/dist/vue-ui-sparkstackbar-B2f0ePMg.js +1 -0
  276. package/dist/vue-ui-stackbar-nMWHZ-f0.js +29 -0
  277. package/dist/vue-ui-stackline-B95y6Zc5.js +39 -0
  278. package/dist/vue-ui-strip-plot-gFNC4r-X.js +2 -0
  279. package/dist/vue-ui-table-Br2JgD_L.js +14 -0
  280. package/dist/vue-ui-table-heatmap-Btu2ejF4.js +1 -0
  281. package/dist/vue-ui-table-sparkline-B9mYHAxp.js +1 -0
  282. package/dist/vue-ui-thermometer-C6u1eLfo.js +1 -0
  283. package/dist/vue-ui-timer-DLgsfB1U.js +64 -0
  284. package/dist/vue-ui-tiremarks-8B9uE1Bx.js +1 -0
  285. package/dist/vue-ui-treemap-C4Mot-Os.js +1 -0
  286. package/dist/vue-ui-waffle-BwcwNpf7.js +1 -0
  287. package/dist/vue-ui-wheel-B3OGCXg7.js +1 -0
  288. package/dist/vue-ui-word-cloud-BPIyMBXq.js +4 -0
  289. package/dist/vue-ui-world-Cp0DeauH.js +19 -0
  290. package/dist/vue-ui-xy-BOE1jvUS.js +31 -0
  291. package/dist/vue-ui-xy-DSyKSn4L.js +24 -0
  292. package/dist/vue-ui-xy-canvas-CaxxiKSa.js +9 -0
  293. package/dist/vue_ui_3d_bar-DmAve5Ri.js +1 -0
  294. package/dist/vue_ui_age_pyramid-CL0Ef8Ov.js +1 -0
  295. package/dist/vue_ui_bullet-CwVYkpjd.js +1 -0
  296. package/dist/vue_ui_bump-KJL9GYr4.js +1 -0
  297. package/dist/vue_ui_candlestick-DKvha_Ab.js +1 -0
  298. package/dist/vue_ui_chestnut-BxxivKN7.js +1 -0
  299. package/dist/vue_ui_chord-Fq6VBRT1.js +1 -0
  300. package/dist/vue_ui_circle_pack-CfXkXi7v.js +1 -0
  301. package/dist/vue_ui_dag-1b_dLSym.js +1 -0
  302. package/dist/vue_ui_donut-T5PeOqvf.js +1 -0
  303. package/dist/vue_ui_donut_evolution-nzVwNQYv.js +1 -0
  304. package/dist/vue_ui_dumbbell-BMcxK0N3.js +1 -0
  305. package/dist/vue_ui_flow-kvV56Es9.js +1 -0
  306. package/dist/vue_ui_funnel-CaEV5hG7.js +1 -0
  307. package/dist/vue_ui_galaxy-B94QInxc.js +1 -0
  308. package/dist/vue_ui_gauge-BJhb6yqE.js +1 -0
  309. package/dist/vue_ui_geo-DL1SMQHp.js +1 -0
  310. package/dist/vue_ui_heatmap-kh5NMmwf.js +1 -0
  311. package/dist/vue_ui_hill-DQi4pQCG.js +1 -0
  312. package/dist/vue_ui_history_plot-soyqUW4Y.js +1 -0
  313. package/dist/vue_ui_horizontal_bar-C4ulIxeT.js +1 -0
  314. package/dist/vue_ui_label-dtPqyFsj.js +1 -0
  315. package/dist/vue_ui_molecule-Bw1UW1Na.js +1 -0
  316. package/dist/vue_ui_mood_radar-CXaBdJnv.js +1 -0
  317. package/dist/vue_ui_nested_donuts-CRtGsJcz.js +1 -0
  318. package/dist/vue_ui_onion-C9BedU_-.js +1 -0
  319. package/dist/vue_ui_parallel_coordinate_plot-Cs_xXAG5.js +1 -0
  320. package/dist/vue_ui_quadrant-BUv-SqzP.js +1 -0
  321. package/dist/vue_ui_quick_chart-Da1GwklM.js +1 -0
  322. package/dist/vue_ui_radar-68iK9Fam.js +1 -0
  323. package/dist/vue_ui_relation_circle-Dkv-cSB6.js +1 -0
  324. package/dist/vue_ui_ridgeline-Di26JtQu.js +1 -0
  325. package/dist/vue_ui_rings-BcDDXHpQ.js +1 -0
  326. package/dist/vue_ui_scatter-C50uFYQL.js +1 -0
  327. package/dist/vue_ui_spark_trend-BOM3zo64.js +1 -0
  328. package/dist/vue_ui_sparkbar-Bpx7QrFq.js +1 -0
  329. package/dist/vue_ui_sparkgauge-D2Hk6bvS.js +1 -0
  330. package/dist/vue_ui_sparkhistogram-ChwOkoMb.js +1 -0
  331. package/dist/vue_ui_sparkline-CvL_e9L8.js +1 -0
  332. package/dist/vue_ui_sparkstackbar-Chtog7hC.js +1 -0
  333. package/dist/vue_ui_stackbar-BkBIi_bL.js +1 -0
  334. package/dist/vue_ui_stackline-D7b63K84.js +1 -0
  335. package/dist/vue_ui_strip_plot-CwMowrhT.js +1 -0
  336. package/dist/vue_ui_table_heatmap-vfeY6r97.js +1 -0
  337. package/dist/vue_ui_table_sparkline-Dlfbza49.js +1 -0
  338. package/dist/vue_ui_thermometer-CRijq6H6.js +1 -0
  339. package/dist/vue_ui_tiremarks-8HFfABNF.js +1 -0
  340. package/dist/vue_ui_treemap-Bv4Rdl5_.js +1 -0
  341. package/dist/vue_ui_vertical_bar-BLyflvlz.js +1 -0
  342. package/dist/vue_ui_waffle-BbBLSluB.js +1 -0
  343. package/dist/vue_ui_wheel-C-479bvJ.js +1 -0
  344. package/dist/vue_ui_word_cloud-DBiJtSyL.js +1 -0
  345. package/dist/vue_ui_xy-CJBM9F6W.js +1 -0
  346. package/dist/vue_ui_xy_canvas-CT-FN9rU.js +1 -0
  347. package/package.json +2 -2
  348. package/dist/A11yDataTable-DdRsVULz.js +0 -45
  349. package/dist/Arrow-BQbcOtfC.js +0 -116
  350. package/dist/BaseDraggableDialog-BCFCiP_6.js +0 -272
  351. package/dist/BaseIcon-CIK6Sqo3.js +0 -484
  352. package/dist/BaseLegendToggle-Doa5rYP2.js +0 -56
  353. package/dist/BaseScanner-Dzc8VT3j.js +0 -30
  354. package/dist/BaseZoomControls-BGQM8B5F.js +0 -111
  355. package/dist/ColorPicker-Cb7qpvFt.js +0 -257
  356. package/dist/DataTable-B6LDCXBz.js +0 -150
  357. package/dist/DefGrad-DVBqDjhO.js +0 -48
  358. package/dist/HillActions-CwdgCb7Q.js +0 -187
  359. package/dist/Legend-D9FGXIbQ.js +0 -156
  360. package/dist/NonSvgPenAndPaper-9T4MSwXC.js +0 -577
  361. package/dist/PackageVersion-CslTvFsC.js +0 -12
  362. package/dist/PenAndPaper-C1EcBgJW.js +0 -906
  363. package/dist/RecursiveCircles-D6aDPmoe.js +0 -117
  364. package/dist/RecursiveLabels-D9rfID6q.js +0 -56
  365. package/dist/RecursiveLinks-BygcpDiT.js +0 -78
  366. package/dist/Shape-BZgQLgu5.js +0 -143
  367. package/dist/SlicerPreview-DyYv_G-_.js +0 -1730
  368. package/dist/SparkTooltip-D4cRlyuq.js +0 -93
  369. package/dist/Title-Bd98RysU.js +0 -87
  370. package/dist/Tooltip-DmQeI5WE.js +0 -312
  371. package/dist/UserOptions-B_yBcZ1-.js +0 -1412
  372. package/dist/_plugin-vue_export-helper-B3ysoDQm.js +0 -8
  373. package/dist/dom-to-png-B_RJohlM.js +0 -237
  374. package/dist/exposedLib-C-JlvWAt.js +0 -28
  375. package/dist/geoProjections-BYthUA8l.js +0 -302
  376. package/dist/img-KURaWjZI.js +0 -129
  377. package/dist/labelUtils-DShv2Mbg.js +0 -19
  378. package/dist/lib-TWIH5fGr.js +0 -2152
  379. package/dist/package-DbTqd5lc.js +0 -4
  380. package/dist/patternUtils-CS7hn6at.js +0 -258
  381. package/dist/pdf-CLl24Afl.js +0 -90
  382. package/dist/render-common-CKv-jztN.js +0 -152
  383. package/dist/rolldown-runtime-Dy4uBu1J.js +0 -11
  384. package/dist/useAutoSizeLabelsInsideViewbox-DvDwcwi_.js +0 -122
  385. package/dist/useChartAccessibility-DYqac8yF.js +0 -12
  386. package/dist/useChartExport-iwOqiIWX.js +0 -803
  387. package/dist/useConfig-DObkR9Aa.js +0 -8008
  388. package/dist/useFitSvgText-CXTzBplU.js +0 -65
  389. package/dist/useHints-Dq_w2E8B.js +0 -66
  390. package/dist/useNestedProp-BxOdWM0c.js +0 -12
  391. package/dist/useObjectBindings-CPmyIJxB.js +0 -191
  392. package/dist/usePanZoom-CYU3B4T3.js +0 -157
  393. package/dist/usePrefersMotion-BC-CsqR1.js +0 -15
  394. package/dist/usePrinter-8Y1Rju0Y.js +0 -49
  395. package/dist/useResponsive-ZtArZtUf.js +0 -97
  396. package/dist/useStableElementSize-C7KADDKj.js +0 -77
  397. package/dist/useTableResponsive-BAqJPR68.js +0 -25
  398. package/dist/useThemeCheck-C43Tcqmk.js +0 -24
  399. package/dist/useTimeLabelCollider-AEcY4Ioe.js +0 -57
  400. package/dist/useTimeLabels-d2f-W1L4.js +0 -270
  401. package/dist/useTooltipPosition-BCrtQa9H.js +0 -189
  402. package/dist/useTransitions-g_zBREk2.js +0 -39
  403. package/dist/useUserOptionState-DK-_1ddE.js +0 -15
  404. package/dist/vClickOutside-DUrZWttG.js +0 -13
  405. package/dist/vue-data-ui-C3G5Zdl5.js +0 -191
  406. package/dist/vue-ui-3d-bar-Cl6-fBV8.js +0 -1831
  407. package/dist/vue-ui-accordion-AyyZDab3.js +0 -81
  408. package/dist/vue-ui-age-pyramid-DOtWAL8s.js +0 -1305
  409. package/dist/vue-ui-annotator-BCVjlojM.js +0 -3325
  410. package/dist/vue-ui-bullet-B_1Ctjvq.js +0 -702
  411. package/dist/vue-ui-bump-kOK6x4al.js +0 -1242
  412. package/dist/vue-ui-candlestick-KvhjbAxt.js +0 -2144
  413. package/dist/vue-ui-carousel-table-ArMiO0cG.js +0 -467
  414. package/dist/vue-ui-chestnut-DSM0U27X.js +0 -2016
  415. package/dist/vue-ui-chord-64akfaem.js +0 -1347
  416. package/dist/vue-ui-circle-pack-CaR_aNEh.js +0 -1647
  417. package/dist/vue-ui-cursor-DCgqYZiz.js +0 -283
  418. package/dist/vue-ui-dag-8uKK0Rlp.js +0 -2931
  419. package/dist/vue-ui-dashboard-DeccYtSY.js +0 -522
  420. package/dist/vue-ui-digits-BvK7bVuJ.js +0 -217
  421. package/dist/vue-ui-donut-8joMj08Z.js +0 -974
  422. package/dist/vue-ui-donut-CvbfzzdT.js +0 -2427
  423. package/dist/vue-ui-donut-evolution-DgITf95R.js +0 -1869
  424. package/dist/vue-ui-dumbbell-U2L4ZYhB.js +0 -1533
  425. package/dist/vue-ui-flow-DD20fJu_.js +0 -1229
  426. package/dist/vue-ui-funnel-Cx8hVlZV.js +0 -749
  427. package/dist/vue-ui-galaxy-VZFZnHPv.js +0 -1097
  428. package/dist/vue-ui-gauge-Copa7G58.js +0 -934
  429. package/dist/vue-ui-geo-DeDQ6ubl.js +0 -1495
  430. package/dist/vue-ui-gizmo-D5oUKIsP.js +0 -238
  431. package/dist/vue-ui-heatmap-BukWtNsd.js +0 -1613
  432. package/dist/vue-ui-hill-DONFacXR.js +0 -1747
  433. package/dist/vue-ui-history-plot-BMy_y9S6.js +0 -1710
  434. package/dist/vue-ui-horizontal-bar-bcPSs999.js +0 -1723
  435. package/dist/vue-ui-kpi-Bol0OWs3.js +0 -104
  436. package/dist/vue-ui-label-cwjXaEDQ.js +0 -1451
  437. package/dist/vue-ui-mini-loader-kdpasmXb.js +0 -133
  438. package/dist/vue-ui-molecule-BiAI5lbh.js +0 -941
  439. package/dist/vue-ui-mood-radar-f4xXkiBs.js +0 -1111
  440. package/dist/vue-ui-nested-donuts-ZmGGEvRk.js +0 -1515
  441. package/dist/vue-ui-onion-D6IKPpL-.js +0 -1247
  442. package/dist/vue-ui-parallel-coordinate-plot-BbfModz3.js +0 -1444
  443. package/dist/vue-ui-pattern-DKozfnVn.js +0 -154
  444. package/dist/vue-ui-pattern-seed-BB1honLm.js +0 -61
  445. package/dist/vue-ui-quadrant-CueHa1Pm.js +0 -1979
  446. package/dist/vue-ui-quick-chart-C8ZxX1Zw.js +0 -2775
  447. package/dist/vue-ui-radar-BcD7Zqvb.js +0 -1386
  448. package/dist/vue-ui-rating-V_OnJN9Y.js +0 -359
  449. package/dist/vue-ui-relation-circle-DlN4r83K.js +0 -905
  450. package/dist/vue-ui-ridgeline-BlQnTWXi.js +0 -1630
  451. package/dist/vue-ui-rings-Bf9IKwDr.js +0 -1264
  452. package/dist/vue-ui-scatter-arPbS9MH.js +0 -2418
  453. package/dist/vue-ui-skeleton-dyXWT6JX.js +0 -2567
  454. package/dist/vue-ui-smiley-w6nH1I0E.js +0 -376
  455. package/dist/vue-ui-spark-trend-Bso9bwmY.js +0 -457
  456. package/dist/vue-ui-sparkbar-CL06Yt56.js +0 -401
  457. package/dist/vue-ui-sparkgauge-BHDM5Hbr.js +0 -268
  458. package/dist/vue-ui-sparkhistogram-3Tw8PEms.js +0 -589
  459. package/dist/vue-ui-sparkline-znaswFQj.js +0 -2067
  460. package/dist/vue-ui-sparkstackbar-BOzVoWoa.js +0 -750
  461. package/dist/vue-ui-stackbar-BTOvMsP8.js +0 -2755
  462. package/dist/vue-ui-stackline-qcLrNL09.js +0 -2829
  463. package/dist/vue-ui-strip-plot-BLNaCPm8.js +0 -1752
  464. package/dist/vue-ui-table-D295mJIf.js +0 -1352
  465. package/dist/vue-ui-table-heatmap-CXeMKqKz.js +0 -363
  466. package/dist/vue-ui-table-sparkline-BYuwQrwA.js +0 -738
  467. package/dist/vue-ui-thermometer-BwJ0oF-H.js +0 -758
  468. package/dist/vue-ui-timer-BULpjYiI.js +0 -451
  469. package/dist/vue-ui-tiremarks-B7bTeU8h.js +0 -540
  470. package/dist/vue-ui-treemap-DkqDz9W4.js +0 -1745
  471. package/dist/vue-ui-waffle-Cn7WBzqh.js +0 -1633
  472. package/dist/vue-ui-wheel-Cy7kBvEx.js +0 -873
  473. package/dist/vue-ui-word-cloud-tRqc2ZMR.js +0 -1723
  474. package/dist/vue-ui-world-B755-zji.js +0 -3021
  475. package/dist/vue-ui-xy-BiHIJ7rK.js +0 -1387
  476. package/dist/vue-ui-xy-DWYTZz_v.js +0 -5777
  477. package/dist/vue-ui-xy-canvas-DGuMC_Rf.js +0 -2151
  478. package/dist/vue_ui_3d_bar-C4R7o-yX.js +0 -185
  479. package/dist/vue_ui_age_pyramid-B2R66DgQ.js +0 -310
  480. package/dist/vue_ui_bullet-ClzdLoOv.js +0 -186
  481. package/dist/vue_ui_bump-Vl-zYAtG.js +0 -201
  482. package/dist/vue_ui_candlestick-BXSQY82k.js +0 -461
  483. package/dist/vue_ui_chestnut-D2oUhad6.js +0 -305
  484. package/dist/vue_ui_chord-DPfS1Umc.js +0 -275
  485. package/dist/vue_ui_circle_pack-DZC_rdfn.js +0 -172
  486. package/dist/vue_ui_dag-TsJ_azQq.js +0 -258
  487. package/dist/vue_ui_donut-BDGqG07h.js +0 -358
  488. package/dist/vue_ui_donut_evolution-C6951a2f.js +0 -745
  489. package/dist/vue_ui_dumbbell-Bfe_jFyi.js +0 -304
  490. package/dist/vue_ui_flow-BewZjjKG.js +0 -238
  491. package/dist/vue_ui_funnel-_Og4EEkO.js +0 -234
  492. package/dist/vue_ui_galaxy-Ig0cc1_h.js +0 -265
  493. package/dist/vue_ui_gauge-Cf1RZc9q.js +0 -178
  494. package/dist/vue_ui_geo-B8TODs-G.js +0 -248
  495. package/dist/vue_ui_heatmap-B2BBBSWG.js +0 -319
  496. package/dist/vue_ui_hill-dnltu0L-.js +0 -368
  497. package/dist/vue_ui_history_plot-CuN63VEc.js +0 -413
  498. package/dist/vue_ui_horizontal_bar-C4J4QzXf.js +0 -341
  499. package/dist/vue_ui_label-B0QoxQrJ.js +0 -115
  500. package/dist/vue_ui_molecule-CO9L59SF.js +0 -231
  501. package/dist/vue_ui_mood_radar-BA6LAKhk.js +0 -281
  502. package/dist/vue_ui_nested_donuts-B8csIoVO.js +0 -273
  503. package/dist/vue_ui_onion-1FTFFS46.js +0 -293
  504. package/dist/vue_ui_parallel_coordinate_plot-CBiOBira.js +0 -278
  505. package/dist/vue_ui_quadrant-CDSTKTJz.js +0 -428
  506. package/dist/vue_ui_quick_chart-DByCqSYE.js +0 -180
  507. package/dist/vue_ui_radar-jafTED5j.js +0 -306
  508. package/dist/vue_ui_relation_circle-D0p4mXmv.js +0 -98
  509. package/dist/vue_ui_ridgeline-VM8_mx4J.js +0 -767
  510. package/dist/vue_ui_rings-BVgD2aMn.js +0 -320
  511. package/dist/vue_ui_scatter-I0POnicu.js +0 -479
  512. package/dist/vue_ui_spark_trend-DxVmpkmC.js +0 -82
  513. package/dist/vue_ui_sparkbar-z6qO--Kf.js +0 -64
  514. package/dist/vue_ui_sparkgauge-BX1MS3bA.js +0 -90
  515. package/dist/vue_ui_sparkhistogram-BRgvKUH6.js +0 -123
  516. package/dist/vue_ui_sparkline-b9pEUyGF.js +0 -183
  517. package/dist/vue_ui_sparkstackbar-BOjuQnZd.js +0 -175
  518. package/dist/vue_ui_stackbar-DdjDL6aq.js +0 -491
  519. package/dist/vue_ui_stackline-Bh0RuInt.js +0 -539
  520. package/dist/vue_ui_strip_plot-BaHbnnwN.js +0 -308
  521. package/dist/vue_ui_table_heatmap-w8vx5k6f.js +0 -80
  522. package/dist/vue_ui_table_sparkline-DAbkUrNz.js +0 -124
  523. package/dist/vue_ui_thermometer-DxgqWKlE.js +0 -123
  524. package/dist/vue_ui_tiremarks-CdEPieWV.js +0 -122
  525. package/dist/vue_ui_treemap-DoEtkRN6.js +0 -328
  526. package/dist/vue_ui_vertical_bar-CP-MKz1j.js +0 -247
  527. package/dist/vue_ui_waffle-DE_DiSVP.js +0 -299
  528. package/dist/vue_ui_wheel-DZ_nR--t.js +0 -133
  529. package/dist/vue_ui_word_cloud-C-qIMNLu.js +0 -254
  530. package/dist/vue_ui_xy-CcJADijP.js +0 -614
  531. package/dist/vue_ui_xy_canvas-DrNSzYWq.js +0 -487
@@ -1,3325 +0,0 @@
1
- import { t as e } from "./rolldown-runtime-Dy4uBu1J.js";
2
- import { Bt as t, C as n, X as r, tn as i } from "./lib-TWIH5fGr.js";
3
- import { n as a, t as o } from "./useHints-Dq_w2E8B.js";
4
- import { t as s } from "./useConfig-DObkR9Aa.js";
5
- import { t as c } from "./usePrinter-8Y1Rju0Y.js";
6
- import { t as l } from "./dom-to-png-B_RJohlM.js";
7
- import { t as ee } from "./_plugin-vue_export-helper-B3ysoDQm.js";
8
- import { t as u } from "./BaseIcon-CIK6Sqo3.js";
9
- import { t as te } from "./vue-ui-accordion-AyyZDab3.js";
10
- import { t as ne } from "./ColorPicker-Cb7qpvFt.js";
11
- import { Fragment as re, Teleport as ie, computed as ae, createBlock as d, createCommentVNode as f, createElementBlock as p, createElementVNode as m, createTextVNode as h, createVNode as oe, guardReactiveProps as se, nextTick as ce, normalizeClass as g, normalizeProps as le, normalizeStyle as _, onBeforeUnmount as ue, onMounted as de, openBlock as v, ref as y, renderList as fe, renderSlot as b, toDisplayString as x, unref as pe, vModelCheckbox as me, vModelText as he, watch as ge, withCtx as S, withDirectives as _e, withModifiers as ve } from "vue";
12
- //#region src/registerAnnotatorShortcuts.js
13
- function ye(e) {
14
- let t = (t) => e.isMacLike.value ? t.metaKey : t.ctrlKey, n = (e) => {
15
- let t = e;
16
- if (!t) return !1;
17
- let n = (t.tagName || "").toLowerCase();
18
- return t.isContentEditable || n === "input" || n === "textarea" || n === "select";
19
- }, r = (t) => !!(!e.isSummaryOpen.value || n(t.target) || e.isWriting.value), i = () => {
20
- e.isDeleteMode.value = !1, e.isMoveMode.value = !1, e.isResizeMode.value = !1, e.isSelectMode.value = !1, e.isDrawMode.value = !1, e.isTextMode.value = !1, e.activeShape.value = void 0, e.showCaret.value = !1;
21
- }, a = (t) => {
22
- switch (i(), t) {
23
- case "m":
24
- e.isMoveMode.value = !0;
25
- break;
26
- case "r":
27
- e.isResizeMode.value = !0;
28
- break;
29
- case "d":
30
- e.isDeleteMode.value = !0;
31
- break;
32
- case "g":
33
- e.isSelectMode.value = !0, e.setShapeTo("group"), e.activeShape.value = "group";
34
- break;
35
- case "t": e.isTextMode.value = !0, e.isWriting.value = !1, e.showCaret.value = !1;
36
- }
37
- }, o = (t) => {
38
- switch (t) {
39
- case "c":
40
- e.setShapeTo("circle");
41
- break;
42
- case "s":
43
- e.setShapeTo("rect");
44
- break;
45
- case "a":
46
- e.setShapeTo("arrow");
47
- break;
48
- case "l": e.setShapeTo("line");
49
- }
50
- }, s = (t, n) => {
51
- let r = e.lastSelectedShape.value;
52
- if (!r) return;
53
- let i = (e, t) => {
54
- typeof r[e] == "number" && (r[e] += t);
55
- };
56
- switch (r.type) {
57
- case "rect":
58
- case "circle":
59
- case "text":
60
- i("x", t), i("y", n);
61
- break;
62
- case "arrow": i("x", t), i("y", n), i("endX", t), i("endY", n);
63
- }
64
- }, c = () => {
65
- let t = e.lastSelectedShape.value;
66
- t && (e.shapes.value = e.shapes.value.filter((e) => e.id !== t.id), e.lastSelectedShape.value = void 0);
67
- }, l = !1, ee = null, u = () => {
68
- l || (l = !0, e.history?.value?.begin?.("nudge"));
69
- }, te = () => {
70
- l && (clearTimeout(ee), ee = setTimeout(() => {
71
- l = !1, e.history?.value?.end?.();
72
- }, 160));
73
- }, ne = () => {
74
- clearTimeout(ee), l && e.history?.value?.end?.(), l = !1;
75
- }, re = (n) => {
76
- if (t(n) && !n.shiftKey && n.key.toLowerCase() === "z") {
77
- if (r(n)) return;
78
- n.preventDefault(), e.undoLastShape?.();
79
- return;
80
- }
81
- if (t(n) && n.shiftKey && n.key.toLowerCase() === "z" || t(n) && n.key.toLowerCase() === "y") {
82
- if (r(n)) return;
83
- n.preventDefault(), typeof e.redoLastShape == "function" ? e.redoLastShape() : e.history?.value?.redo?.();
84
- return;
85
- }
86
- if (r(n)) return;
87
- let l = n.key.toLowerCase();
88
- if (l === "escape") {
89
- n.preventDefault(), i();
90
- return;
91
- }
92
- if (l === "delete" || l === "backspace") {
93
- n.preventDefault(), c();
94
- return;
95
- }
96
- if ([
97
- "m",
98
- "r",
99
- "d",
100
- "g",
101
- "t"
102
- ].includes(l)) {
103
- n.preventDefault(), a(l);
104
- return;
105
- }
106
- if ([
107
- "c",
108
- "a",
109
- "l",
110
- "s"
111
- ].includes(l)) {
112
- n.preventDefault(), o(l);
113
- return;
114
- }
115
- if (n.key === "ArrowUp" || n.key === "ArrowDown" || n.key === "ArrowLeft" || n.key === "ArrowRight") {
116
- n.preventDefault(), u();
117
- let e = n.shiftKey ? 10 : 1;
118
- n.key === "ArrowUp" && s(0, -e), n.key === "ArrowDown" && s(0, e), n.key === "ArrowLeft" && s(-e, 0), n.key === "ArrowRight" && s(e, 0), te();
119
- }
120
- }, ie = (e) => {
121
- e.key.startsWith("Arrow") && te();
122
- };
123
- return window.addEventListener("keydown", re), window.addEventListener("keyup", ie), function() {
124
- window.removeEventListener("keydown", re), window.removeEventListener("keyup", ie), ne();
125
- };
126
- }
127
- //#endregion
128
- //#region src/atoms/TeleportedTooltip.vue
129
- var be = { class: "teleport-tooltip__inner" }, C = /*#__PURE__*/ ee({
130
- __name: "TeleportedTooltip",
131
- props: {
132
- show: {
133
- type: Boolean,
134
- default: !1
135
- },
136
- x: {
137
- type: Number,
138
- required: !0
139
- },
140
- y: {
141
- type: Number,
142
- required: !0
143
- },
144
- placement: {
145
- type: String,
146
- default: "top"
147
- },
148
- styleObject: {
149
- type: Object,
150
- default() {
151
- return {};
152
- }
153
- },
154
- delay: {
155
- type: Number,
156
- default: 0
157
- },
158
- delayIn: {
159
- type: Number,
160
- default: 300
161
- },
162
- delayOut: {
163
- type: Number,
164
- default: 0
165
- }
166
- },
167
- setup(e) {
168
- let t = e, n = ae(() => t.delayIn ?? t.delay), r = ae(() => t.delayOut ?? t.delay), i = y(!1), a = null, o = null;
169
- function s() {
170
- a &&= (clearTimeout(a), null), o &&= (clearTimeout(o), null);
171
- }
172
- function c() {
173
- s();
174
- let e = Math.max(0, n.value || 0);
175
- e === 0 ? i.value = !0 : a = setTimeout(() => {
176
- i.value = !0, a = null;
177
- }, e);
178
- }
179
- function l() {
180
- s();
181
- let e = Math.max(0, r.value || 0);
182
- e === 0 ? i.value = !1 : o = setTimeout(() => {
183
- i.value = !1, o = null;
184
- }, e);
185
- }
186
- ge(() => t.show, (e) => {
187
- e ? c() : l();
188
- }, { immediate: !0 }), de(() => {
189
- t.show && c();
190
- }), ue(() => {
191
- s();
192
- });
193
- let ee = ae(() => ({
194
- position: "fixed",
195
- zIndex: 2147483647,
196
- top: `${t.y}px`,
197
- left: `${t.x}px`,
198
- transform: t.placement === "bottom" ? "translate(-50%, 8px)" : "translate(-50%, -100%)",
199
- pointerEvents: "none",
200
- ...t.styleObject
201
- }));
202
- return (t, n) => (v(), d(ie, { to: "body" }, [i.value ? (v(), p("div", {
203
- key: 0,
204
- class: g(["teleport-tooltip", e.placement]),
205
- style: _(ee.value),
206
- role: "tooltip",
207
- "aria-hidden": "false"
208
- }, [m("div", be, [b(t.$slots, "default", {}, void 0, !0)])], 6)) : f("", !0)]));
209
- }
210
- }, [["__scopeId", "data-v-c292996f"]]), xe = /* @__PURE__ */ e({ default: () => Dt }), Se = { class: "vue-data-ui-component vue-ui-annotator" }, Ce = { "data-dom-to-png-ignore": "" }, we = ["id"], Te = ["id"], Ee = { class: "tool-selection" }, De = ["disabled"], Oe = ["disabled"], ke = ["disabled"], Ae = ["disabled"], je = ["disabled"], Me = ["disabled"], Ne = ["disabled"], Pe = ["disabled"], Fe = ["disabled"], Ie = {
211
- class: "tool-selection",
212
- style: { "margin-top": "6px" }
213
- }, Le = {
214
- viewBox: "0 0 12 12",
215
- style: { width: "100%" }
216
- }, Re = ["fill"], ze = { key: 0 }, Be = { class: "tool-input" }, Ve = ["checked"], He = {
217
- viewBox: "0 0 12 12",
218
- style: { width: "100%" }
219
- }, Ue = ["fill"], We = { key: 1 }, Ge = { class: "tool-input" }, Ke = ["checked"], qe = {
220
- viewBox: "0 0 24 24",
221
- style: { width: "100%" }
222
- }, Je = ["stroke"], Ye = { key: 2 }, Xe = { style: {
223
- display: "flex",
224
- "flex-direction": "column",
225
- "align-items": "center",
226
- "justify-content": "center"
227
- } }, Ze = { class: "tool-input" }, Qe = { key: 3 }, $e = { style: {
228
- display: "flex",
229
- "flex-direction": "column",
230
- "align-items": "center",
231
- "justify-content": "center"
232
- } }, et = { class: "tool-input" }, tt = ["checked"], nt = { key: 4 }, rt = { style: {
233
- display: "flex",
234
- "flex-direction": "column",
235
- "align-items": "center",
236
- "justify-content": "center"
237
- } }, it = { class: "tool-input" }, at = { key: 5 }, ot = { key: 6 }, st = ["disabled"], ct = { key: 7 }, lt = ["disabled"], ut = { key: 8 }, dt = { key: 9 }, ft = { key: 10 }, pt = { key: 11 }, mt = {
238
- style: {
239
- display: "flex",
240
- "flex-direction": "column",
241
- "align-items": "center",
242
- "justify-content": "center"
243
- },
244
- class: "tooltip"
245
- }, ht = { style: {
246
- display: "flex",
247
- "flex-direction": "column",
248
- "align-items": "start",
249
- "justify-content": "center"
250
- } }, gt = {
251
- class: "tool-input",
252
- style: { "font-variant-numeric": "tabular-nums" }
253
- }, _t = ["id"], vt = [
254
- "viewBox",
255
- "width",
256
- "height"
257
- ], yt = [
258
- "width",
259
- "height",
260
- "pointer-events"
261
- ], bt = [
262
- "innerHTML",
263
- "onClick",
264
- "onDblclick"
265
- ], xt = [
266
- "x1",
267
- "x2",
268
- "y1",
269
- "y2",
270
- "stroke"
271
- ], St = [
272
- "height",
273
- "viewBox",
274
- "width"
275
- ], Ct = ["cx", "cy"], wt = "annotations", Tt = "‎", Et = 450, Dt = /*#__PURE__*/ ee({
276
- __name: "vue-ui-annotator",
277
- props: {
278
- config: {
279
- type: Object,
280
- default() {
281
- return {};
282
- }
283
- },
284
- dataset: {
285
- type: Object,
286
- default() {
287
- return {
288
- shapes: [],
289
- lastSelectedShape: void 0
290
- };
291
- }
292
- }
293
- },
294
- emits: ["toggleOpenState", "saveAnnotations"],
295
- setup(e, { emit: ee }) {
296
- let be = e, xe = ee, Dt = y(!1), Ot = y(!1);
297
- de(() => Dt.value = !0);
298
- let kt = y(r()), { isImaging: At, generateImage: jt } = c({
299
- elementId: kt.value,
300
- fileName: wt
301
- }), w = y(void 0), Mt = y(1), T = y({
302
- start: {
303
- x: 0,
304
- y: 0
305
- },
306
- end: {
307
- x: 0,
308
- y: 0
309
- }
310
- }), E = y(void 0), Nt = y(void 0), Pt = y(!1), Ft = y(!1), It = y(!1), D = y(!1), Lt = y(!1), Rt = y(!0), O = y(!1), zt = y(!1), Bt = y(!1), k = y(!1), Vt = y(!1), A = y(!1), j = y(!1), M = y(!1);
311
- ge(M, async (e) => {
312
- if (Ot.value = !1, !e) {
313
- F.value = void 0, E.value = void 0, Nt.value = void 0, Wt.value = [], j.value = !1;
314
- return;
315
- }
316
- await ce(), Ot.value = !0;
317
- });
318
- let N = y(!1), Ht = y(!1), P = y(!1), F = y(be.dataset?.lastSelectedShape ?? void 0), I = y({
319
- x: 0,
320
- y: 0
321
- }), Ut = y(!0), Wt = y([]), L = y(be.dataset?.shapes || []);
322
- y([]);
323
- let Gt = y(Math.round(Math.random()) * 1e5), Kt = y(1e3), qt = y(1e3), R = y({
324
- arrow: {
325
- color: "grey",
326
- filled: !0
327
- },
328
- circle: {
329
- color: "grey",
330
- filled: !1,
331
- radius: 3,
332
- strokeWidth: 2
333
- },
334
- rect: {
335
- color: "grey",
336
- filled: !1,
337
- strokeWidth: 2,
338
- height: 12,
339
- width: 12
340
- }
341
- }), z = y(!1), Jt = y(1), Yt = y(void 0), Xt = y(1), Zt = y(1), B = y("start"), Qt = y(20), $t = y(100), en = t, tn = y(null), nn = y(null), V = y(null), rn = y(null), an = y(null), on = y(!1), sn = y({
342
- row: 0,
343
- col: 0
344
- }), H = y(null), U = y(!1), W = y(null), G = y({
345
- x: 0,
346
- y: 0
347
- }), cn = y(null), ln = y([]), un = y(!1), dn = y(null), fn = y({
348
- undo: 0,
349
- redo: 0
350
- }), pn = y(null);
351
- y(null), y(null);
352
- let mn = y(null), K = ae(() => {
353
- let e = s().vue_ui_annotator;
354
- if (!Object.keys(be.config || {}).length) return e;
355
- let t = i({
356
- defaultConfig: e,
357
- userConfig: be.config
358
- });
359
- return n(t);
360
- }), hn = y(K.value.style.paletteColor), q = ae(() => K.value.style.buttons), J = ae(() => K.value.style);
361
- a({
362
- config: () => K.value,
363
- dataset: () => [],
364
- component: "VueUiAnnotator",
365
- rules: [o.noHint]
366
- });
367
- let Y = ae(() => K.value.useCursorPointer), X = ae(() => {
368
- let e = J.value.tooltips;
369
- return {
370
- backgroundColor: e.backgroundColor,
371
- color: e.color,
372
- border: e.border,
373
- borderRadius: `${e.borderRadius}px`,
374
- boxShadow: e.boxShadow
375
- };
376
- }), gn = ae(() => L.value.filter((e) => e.type !== "group" || Array.isArray(e.source) && e.source.length > 0).length > 1), _n = ae(() => en[$t.value > 98 ? 98 : $t.value]), vn = ae(() => {
377
- switch (!0) {
378
- case D.value: return "default";
379
- case k.value: return "move";
380
- case N.value: return "text";
381
- case A.value: return "move";
382
- default: return "";
383
- }
384
- }), yn = ae(() => L.value), bn = y(null);
385
- function xn(e) {
386
- return e ? !!(F.value && F.value.id === e.id) : !1;
387
- }
388
- function Sn(e = "") {
389
- let t = String(e).trim().split(/\s+/).map(Number).filter(Number.isFinite), n = [];
390
- for (let e = 0; e + 1 < t.length; e += 2) n.push({
391
- x: t[e],
392
- y: t[e + 1]
393
- });
394
- return n;
395
- }
396
- function Cn(e = []) {
397
- return e.map(({ x: e, y: t }) => `${e} ${t}`).join(" ");
398
- }
399
- function wn(e = "") {
400
- let t = Sn(e);
401
- if (!t.length) return null;
402
- let n = t.map((e) => e.x), r = t.map((e) => e.y), i = Math.min(...n), a = Math.max(...n), o = Math.min(...r), s = Math.max(...r);
403
- return {
404
- minX: i,
405
- minY: o,
406
- maxX: a,
407
- maxY: s,
408
- width: Math.max(1, a - i),
409
- height: Math.max(1, s - o)
410
- };
411
- }
412
- function Tn(e) {
413
- if (!e || !M.value || !A.value || !F.value || F.value.id !== e.id) return "";
414
- let t = J.value.color || "grey", n = J.value.backgroundColor || "rgba(255,255,255,0.95)", r = ({ handle: r, x: i, y: a, cursor: o = "nwse-resize" }) => `
415
- <circle
416
- data-dom-to-png-ignore
417
- id="${e.id}"
418
- data-resize-handle="${r}"
419
- cx="${i}"
420
- cy="${a}"
421
- r="7"
422
- fill="${n}"
423
- stroke="${t}"
424
- stroke-width="2"
425
- pointer-events="all"
426
- style="cursor:${o}"
427
- />
428
- `;
429
- if (e.type === "arrow") return `
430
- ${r({
431
- handle: "arrow-start",
432
- x: e.x,
433
- y: e.y,
434
- cursor: "move"
435
- })}
436
- ${r({
437
- handle: "arrow-end",
438
- x: e.endX,
439
- y: e.endY,
440
- cursor: "move"
441
- })}
442
- `;
443
- if (e.type === "line") {
444
- let t = wn(e.path);
445
- return t ? r({
446
- handle: "line-scale",
447
- x: t.maxX,
448
- y: t.maxY
449
- }) : "";
450
- }
451
- if (e.type === "circle") {
452
- let t = Math.max(1, Number(e.circleRadius) || 1), n = nn.value === "circle-radius" && V.value?.shapeId === e.id && V.value?.handlePoint ? V.value.handlePoint : null;
453
- return r({
454
- handle: "circle-radius",
455
- x: n?.x ?? e.x + t,
456
- y: n?.y ?? e.y,
457
- cursor: "move"
458
- });
459
- }
460
- if (e.type === "rect") {
461
- let t = Number(e.x) || 0, n = Number(e.y) || 0, i = t + Math.max(0, Number(e.rectWidth) || 0), a = n + Math.max(0, Number(e.rectHeight) || 0);
462
- return `
463
- ${r({
464
- handle: "rect-nw",
465
- x: t,
466
- y: n,
467
- cursor: "nwse-resize"
468
- })}
469
- ${r({
470
- handle: "rect-ne",
471
- x: i,
472
- y: n,
473
- cursor: "nesw-resize"
474
- })}
475
- ${r({
476
- handle: "rect-se",
477
- x: i,
478
- y: a,
479
- cursor: "nwse-resize"
480
- })}
481
- ${r({
482
- handle: "rect-sw",
483
- x: t,
484
- y: a,
485
- cursor: "nesw-resize"
486
- })}
487
- `;
488
- }
489
- return e.type === "group" ? r({
490
- handle: "group-scale",
491
- x: e.x + e.rectWidth,
492
- y: e.y + e.rectHeight
493
- }) : "";
494
- }
495
- function En(e) {
496
- if (!e || e.type === "text" && P.value && rn.value === e.id) return "";
497
- let t = xn(e) ? "initial" : "none";
498
- switch (e.type) {
499
- case "rect": return `
500
- <rect
501
- data-dom-to-png-ignore
502
- style="stroke-dasharray: 10; display:${t}"
503
- x="${e.x - 20}"
504
- y="${e.y - 20}"
505
- height="${e.rectHeight + 40}"
506
- width="${e.rectWidth + 40}"
507
- fill="transparent"
508
- stroke="grey"
509
- pointer-events="none"
510
- />
511
- `;
512
- case "circle": return `
513
- <rect
514
- data-dom-to-png-ignore
515
- style="stroke-dasharray: 10; display:${t}"
516
- x="${e.x - e.circleRadius - 20}"
517
- y="${e.y - e.circleRadius - 20}"
518
- height="${e.circleRadius * 2 + 40}"
519
- width="${e.circleRadius * 2 + 40}"
520
- fill="transparent"
521
- stroke="grey"
522
- pointer-events="none"
523
- />
524
- `;
525
- case "arrow": {
526
- let n = Math.min(e.x, e.endX), r = Math.min(e.y, e.endY), i = Math.max(1, Math.abs(e.endX - e.x)), a = Math.max(1, Math.abs(e.endY - e.y));
527
- return `
528
- <rect
529
- style="stroke-dasharray: 10; display:${t}"
530
- x="${n - 20}"
531
- y="${r - 20}"
532
- height="${a + 40}"
533
- width="${i + 40}"
534
- fill="transparent"
535
- stroke="grey"
536
- pointer-events="none"
537
- />
538
- `;
539
- }
540
- case "line": {
541
- let n = wn(e.path);
542
- return n ? `
543
- <rect
544
- style="stroke-dasharray: 10; display:${t}"
545
- x="${n.minX - 20}"
546
- y="${n.minY - 20}"
547
- height="${n.height + 40}"
548
- width="${n.width + 40}"
549
- fill="transparent"
550
- stroke="grey"
551
- pointer-events="none"
552
- />
553
- ` : "";
554
- }
555
- case "text": {
556
- let n = bn.value ? Array.from(bn.value.getElementsByTagName("text")).find((t) => t.getAttribute("data-shape-id") === e.id) : null;
557
- if (!n) return "";
558
- let { x: r, y: i, width: a, height: o } = n.getBBox();
559
- return `
560
- <rect
561
- style="stroke-dasharray: 10; display:${t}"
562
- x="${r - 20}"
563
- y="${i - 20}"
564
- height="${o + 40}"
565
- width="${a + 40}"
566
- fill="transparent"
567
- stroke="grey"
568
- pointer-events="none"
569
- />
570
- `;
571
- }
572
- default: return "";
573
- }
574
- }
575
- function Dn(e, t = !1) {
576
- switch (!0) {
577
- case e.type === "circle": return `
578
- <g id="${e.id}" style="display:${D.value ? "initial" : "none"};">
579
- <circle id="${e.id}" cx="${e.x}" cy="${e.y}" r="12" fill="red"/>
580
- <line stroke="white" stroke-width="2" id="${e.id}" x1="${e.x - 4}" y1="${e.y - 4}" x2="${e.x + 4}" y2="${e.y + 4}"/>
581
- <line stroke="white" stroke-width="2" id="${e.id}" x1="${e.x + 4}" y1="${e.y - 4}" x2="${e.x - 4}" y2="${e.y + 4}"/>
582
- </g>
583
- `;
584
- case e.type === "text":
585
- let n, r = [
586
- -8,
587
- -12,
588
- -4,
589
- -12,
590
- -4
591
- ];
592
- switch (!0) {
593
- case e.textAlign === "start":
594
- n = t ? [
595
- -20,
596
- -24,
597
- -16,
598
- -16,
599
- -24
600
- ] : [
601
- -16,
602
- -20,
603
- -12,
604
- -12,
605
- -20
606
- ];
607
- break;
608
- case e.textAlign === "middle":
609
- n = [
610
- 0,
611
- -4,
612
- 4,
613
- 4,
614
- -4
615
- ], r = [
616
- -32,
617
- -36,
618
- -28,
619
- -36,
620
- -28
621
- ];
622
- break;
623
- case e.textAlign === "end":
624
- n = [
625
- 16,
626
- 20,
627
- 12,
628
- 12,
629
- 20
630
- ];
631
- break;
632
- default: n = [
633
- 0,
634
- 0,
635
- 0
636
- ];
637
- }
638
- return `
639
- <g id="${e.id}" style="display:${D.value ? "initial" : "none"};">
640
- <circle id="${e.id}" cx="${e.x + n[0]}" cy="${e.y + r[0]}" r="12" fill="red"/>
641
- <line stroke="white" stroke-width="2" id="${e.id}" x1="${e.x + n[1]}" y1="${e.y + r[1]}" x2="${e.x + n[2]}" y2="${e.y + r[2]}"/>
642
- <line stroke="white" stroke-width="2" id="${e.id}" x1="${e.x + n[3]}" y1="${e.y + r[3]}" x2="${e.x + n[4]}" y2="${e.y + r[4]}"/>
643
- </g>
644
- `;
645
- default: return `
646
- <g id="${e.id}" style="display:${D.value ? "initial" : "none"};">
647
- <circle id="${e.id}" cx="${e.x - 4}" cy="${e.y - 4}" r="12" fill="red"/>
648
- <line stroke="white" stroke-width="2" id="${e.id}" x1="${e.x - 8}" y1="${e.y - 8}" x2="${e.x}" y2="${e.y}"/>
649
- <line stroke="white" stroke-width="2" id="${e.id}" x1="${e.x}" y1="${e.y - 8}" x2="${e.x - 8}" y2="${e.y}"/>
650
- </g>
651
- `;
652
- }
653
- }
654
- function On(e = "") {
655
- return String(e).replace(/&nbsp;/g, "\xA0");
656
- }
657
- function kn(e) {
658
- return String(e?.textContent ?? "").split(Tt).map(On);
659
- }
660
- function An(e, t) {
661
- if (!e) return;
662
- let n = t.length ? t : [""];
663
- e.textContent = n.join(Tt), e.lines = Math.max(0, n.length - 1);
664
- }
665
- function jn(e = "") {
666
- return String(e).replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
667
- }
668
- function Mn(e = "") {
669
- return jn(On(e)) || "&#8203;";
670
- }
671
- function Nn(e, t, n = !1) {
672
- let r = kn(e), i = Math.max(1, r.length), a = r.reduce((e, t) => Math.max(e, t.length), 0), o = Math.max(24, a * e.fontSize * .7 + 16), s = e.textAlign === "middle" ? e.x - o / 2 : e.textAlign === "end" ? e.x - o : e.x, c = Math.max(e.fontSize * 1.2, e.fontSize * i);
673
- return `
674
- <g id="${e.id}">
675
- <rect
676
- id="${e.id}"
677
- data-shape-hit-area="true"
678
- x="${s - 8}"
679
- y="${e.y - e.fontSize}"
680
- height="${c + 8}"
681
- width="${o + 16}"
682
- fill="transparent"
683
- pointer-events="all"
684
- />
685
- <text
686
- data-shape-id="${e.id}"
687
- style="user-select:none;"
688
- id="${e.id}"
689
- x="${e.x}"
690
- y="${e.y}"
691
- text-anchor="${e.textAlign}"
692
- font-size="${e.fontSize}"
693
- fill="${e.color}"
694
- font-weight="${e.isBold ? "bold" : "normal"}"
695
- font-style="${e.isItalic ? "italic" : "normal"}"
696
- text-decoration="${e.isUnderline ? "underline" : "none"}"
697
- pointer-events="bounding-box"
698
- >
699
- ${t.join("")}
700
- </text>
701
- ${Dn(e, n)}
702
- </g>
703
- `;
704
- }
705
- let Pn = ae(() => yn.value.map((e) => {
706
- switch (!0) {
707
- case e && e.type === "arrow": {
708
- let t = e.strokeWidth > 3 ? 5 : 10, n = e.strokeWidth > 3 ? 2.5 : 5, r = `marker_${e.id}`, i = Math.max(24, Number(e.strokeWidth || 1) + 24);
709
- return {
710
- html: `
711
- <defs>
712
- <marker
713
- id="${r}"
714
- markerWidth="${t}"
715
- markerHeight="${t}"
716
- refX="0"
717
- refY="${n}"
718
- orient="auto"
719
- >
720
- <polygon
721
- points="0 0,${t} ${n}, 0 ${t}"
722
- fill="${e.color}"
723
- />
724
- </marker>
725
- </defs>
726
- <g id="${e.id}">
727
- ${En(e)}
728
- <path
729
- id="${e.id}"
730
- data-shape-hit-area="true"
731
- d="M${e.x},${e.y} ${e.endX},${e.endY}"
732
- fill="none"
733
- stroke="transparent"
734
- stroke-width="${i}"
735
- pointer-events="stroke"
736
- />
737
- <path
738
- id="${e.id}"
739
- data-shape-visible="true"
740
- style="stroke-linecap: round !important; ${e.isDash ? `stroke-dasharray: ${e.strokeWidth * 3}` : ""}"
741
- stroke="${e.color}"
742
- d="M${e.x},${e.y} ${e.endX},${e.endY}"
743
- stroke-width="${e.strokeWidth}"
744
- fill="none"
745
- pointer-events="stroke"
746
- marker-end="url(#${r})"
747
- />
748
- ${Tn(e)}
749
- ${Dn(e)}
750
- </g>
751
- `,
752
- id: e.id
753
- };
754
- }
755
- case e && e.type === "circle": return {
756
- html: `
757
- <g id="${e.id}">
758
- ${En(e)}
759
- <circle
760
- id="${e.id}"
761
- cx="${e.x}"
762
- cy="${e.y}"
763
- r="${e.circleRadius ? e.circleRadius : Number.MIN_VALUE}"
764
- fill="${e.isFilled ? e.color + e.alpha : "rgba(255,255,255,0.001)"}"
765
- stroke="${e.color + e.alpha}"
766
- stroke-width="${e.strokeWidth}"
767
- style="${e.isDash ? `stroke-dasharray: ${e.strokeWidth * 3}` : ""}"
768
- >
769
- </circle>
770
- ${Tn(e)}
771
- </g>
772
-
773
- ${Dn(e)}`,
774
- id: e.id
775
- };
776
- case e && e.type === "group": return {
777
- html: `<g id="${e.id}">
778
- <rect
779
- data-dom-to-png-ignore
780
- id="${A.value ? "" : e.id}"
781
- x="${e.x}"
782
- y="${e.y}"
783
- fill="transparent"
784
- height="${e.rectHeight}"
785
- width="${e.rectWidth}"
786
- stroke="grey"
787
- stroke-width="1"
788
- style="rx:1 !important; ry:1 !important; ${e.isDash ? `stroke-dasharray: ${e.strokeWidth * 3}` : ""}; display:${j.value || D.value || xn(e) ? "initial" : "none"};"
789
- />
790
- <g id="${e.id}">
791
- ${e.content ? e.content : ""}
792
- </g>
793
- ${Tn(e)}
794
- ${Dn(e)}
795
- </g> `,
796
- id: e.id
797
- };
798
- case e && e.type === "rect": return {
799
- html: `<g id="${e.id}">
800
- ${En(e)}
801
- <rect
802
- id="${A.value ? "" : e.id}"
803
- x="${e.x}"
804
- y="${e.y}"
805
- fill="${e.isFilled ? e.color + e.alpha : "rgba(255,255,255,0.001)"}"
806
- height="${e.rectHeight}"
807
- width="${e.rectWidth}"
808
- stroke="${e.color + e.alpha}"
809
- stroke-width="${e.strokeWidth}"
810
- style="rx:1 !important; ry:1 !important; ${e.isDash ? `stroke-dasharray: ${e.strokeWidth * 3}` : ""}"
811
- />
812
- ${Tn(e)}
813
- ${Dn(e)}
814
- </g> `,
815
- id: e.id
816
- };
817
- case e && e.type === "line": {
818
- let t = Math.max(24, Number(e.strokeWidth || 1) + 24);
819
- return {
820
- html: `
821
- <g id="${e.id}">
822
- ${En(e)}
823
- <path
824
- id="${e.id}"
825
- data-shape-hit-area="true"
826
- d="M${e.path ? e.path : ""}"
827
- fill="none"
828
- stroke="transparent"
829
- stroke-width="${t}"
830
- stroke-linecap="round"
831
- stroke-linejoin="round"
832
- pointer-events="stroke"
833
- />
834
- <path
835
- id="${e.id}"
836
- data-shape-visible="true"
837
- d="M${e.path ? e.path : ""}"
838
- style="stroke:${e.color + e.alpha} !important; fill:none; stroke-width:${e.strokeWidth} !important; stroke-linecap: round !important; stroke-linejoin: round !important; ${e.isDash ? `stroke-dasharray: ${e.strokeWidth * 3}` : ""}"
839
- pointer-events="stroke"
840
- />
841
- ${Tn(e)}
842
- ${Dn(e)}
843
- </g>
844
- `,
845
- id: e.id
846
- };
847
- }
848
- case e && e.type === "text": {
849
- let t = kn(e), n = [];
850
- for (let r = 0; r < t.length; r += 1) n.push(`
851
- ${e.isBulletTextMode ? `<tspan
852
- data-bullet-line="${r}"
853
- x="${e.x - e.fontSize}"
854
- y="${e.y + e.fontSize * r}"
855
- id="${e.id}"
856
- font-size="${e.fontSize / 2}"
857
- >⬤</tspan>` : ""}
858
- <tspan
859
- data-text-line="${r}"
860
- id="${e.id}"
861
- x="${e.x}"
862
- y="${e.y + e.fontSize * r}"
863
- >${Mn(t[r])}</tspan>`);
864
- return {
865
- html: `
866
- ${En(e)}
867
- ${Nn(e, n, e.isBulletTextMode)}
868
- `,
869
- id: e.id
870
- };
871
- }
872
- }
873
- }));
874
- function Z(e) {
875
- if (e == null) return e;
876
- try {
877
- return typeof structuredClone == "function" ? structuredClone(e) : JSON.parse(JSON.stringify(e));
878
- } catch {
879
- return Array.isArray(e) ? e.map((e) => Z(e)) : typeof e == "object" ? Object.fromEntries(Object.entries(e).map(([e, t]) => [e, Z(t)])) : e;
880
- }
881
- }
882
- function Fn(e = !1) {
883
- if (!w.value || !Lt.value) return;
884
- T.value.end = {
885
- x: I.value.x,
886
- y: I.value.y
887
- };
888
- let t;
889
- L.value.length > 0 && E.value && (t = [...L.value].find((e) => e.id === E.value.id));
890
- let n, r, i;
891
- t && (n = t.x - T.value.end.x, r = t.y - T.value.end.y, i = Math.sqrt(n * n + r * r));
892
- let a, o;
893
- switch (e ? (a = Math.max(T.value.end.x, t.x), o = Math.min(T.value.end.x, t.x), Math.max(T.value.end.y, t.y), Math.min(T.value.end.y, t.y)) : (a = Math.max(T.value.end.x, T.value.start.x), o = Math.min(T.value.end.x, T.value.start.x), Math.max(T.value.end.y, T.value.start.y), Math.min(T.value.end.y, T.value.start.y)), !0) {
894
- case w.value === "arrow":
895
- L.value.at(-1).endX = T.value.end.x, L.value.at(-1).endY = T.value.end.y;
896
- break;
897
- case w.value === "circle":
898
- L.value.at(-1).circleRadius = Rt.value ? Z(a - o) + 20 : i + 20;
899
- break;
900
- case w.value === "line":
901
- L.value.at(-1).path += ` ${I.value.x} ${I.value.y} `;
902
- break;
903
- case ["rect", "group"].includes(w.value): L.value.at(-1).rectWidth = Z(T.value.end.x - L.value.at(-1).x) > 0 ? Z(T.value.end.x - L.value.at(-1).x) : 20, L.value.at(-1).rectHeight = Z(T.value.end.y - L.value.at(-1).y) > 0 ? Z(T.value.end.y - L.value.at(-1).y) : 20;
904
- }
905
- }
906
- function In() {
907
- if (!Lt.value) {
908
- pn.value = null;
909
- return;
910
- }
911
- Fn(), pn.value = requestAnimationFrame(In);
912
- }
913
- function Ln(e) {
914
- let t = L.value.findIndex((t) => t.id === e);
915
- if (t > -1 && t !== L.value.length - 1) {
916
- let [e] = L.value.splice(t, 1);
917
- L.value.push(e);
918
- }
919
- }
920
- function Rn(e) {
921
- let t = e;
922
- for (; t && t !== bn.value;) {
923
- let e = t.id;
924
- if (e && L.value.some((t) => t.id === e)) return e;
925
- t = t.parentElement;
926
- }
927
- return null;
928
- }
929
- function zn(e) {
930
- if (!M.value) return null;
931
- let t = Rn(e?.target);
932
- if (t) return t;
933
- let n = bn.value?.querySelector(".annotator__glass");
934
- if (!n) return null;
935
- let r = e?.touches?.[0] || e?.changedTouches?.[0], i = r ? r.clientX : e?.clientX, a = r ? r.clientY : e?.clientY;
936
- if (!Number.isFinite(i) || !Number.isFinite(a)) return null;
937
- let o = n.style.pointerEvents;
938
- n.style.pointerEvents = "none";
939
- let s = document.elementFromPoint(i, a);
940
- return n.style.pointerEvents = o || "all", Rn(s);
941
- }
942
- function Bn(e = {}) {
943
- let { maxEntries: t = 200, maxBytes: n = 2e6 } = e, r = {
944
- open: !1,
945
- before: null,
946
- undo: [],
947
- redo: []
948
- }, i = {
949
- undo: 0,
950
- redo: 0
951
- }, a = (e) => typeof e == "string" ? e.length * 2 : 0, o = () => JSON.stringify({
952
- shapes: Z(L.value),
953
- lastSelectedShape: Z(F.value)
954
- }), s = (e) => {
955
- let t = JSON.parse(e);
956
- L.value = t.shapes, F.value = t.lastSelectedShape?.id ? L.value.find((e) => e.id === t.lastSelectedShape.id) : void 0, E.value = F.value ? { id: F.value.id } : void 0, rn.value = null, an.value = null, on.value = !1, P.value = !1, z.value = !1, H.value = null;
957
- }, c = () => {
958
- fn.value.undo = r.undo.length, fn.value.redo = r.redo.length;
959
- }, l = (e, o) => {
960
- let s = r[e];
961
- for (s.push(o), i[e] += a(o); s.length > t || i[e] > n;) {
962
- let t = s.shift();
963
- i[e] -= a(t);
964
- }
965
- };
966
- return {
967
- begin() {
968
- r.open || (r.open = !0, r.before = o());
969
- },
970
- end() {
971
- r.open && (r.open = !1, o() !== r.before && (l("undo", r.before), r.redo.length = 0, i.redo = 0), r.before = null, c());
972
- },
973
- undo() {
974
- let e = r.undo.pop();
975
- if (!e) return;
976
- i.undo -= a(e);
977
- let t = o();
978
- l("redo", t), s(e), c();
979
- },
980
- redo() {
981
- let e = r.redo.pop();
982
- if (!e) return;
983
- i.redo -= a(e);
984
- let t = o();
985
- l("undo", t), s(e), c();
986
- },
987
- size() {
988
- return {
989
- undo: r.undo.length,
990
- redo: r.redo.length,
991
- approxBytes: {
992
- undo: i.undo,
993
- redo: i.redo
994
- }
995
- };
996
- }
997
- };
998
- }
999
- function Vn() {
1000
- if (!cn.value) return;
1001
- let e = cn.value.getBoundingClientRect();
1002
- G.value = {
1003
- x: e.left + e.width / 2,
1004
- y: e.top
1005
- };
1006
- }
1007
- function Q(e, t, n = "top") {
1008
- W.value = e, cn.value = t.currentTarget || t.target, Vn(), U.value = !0, window.addEventListener("scroll", Vn, !0), window.addEventListener("resize", Vn, { passive: !0 });
1009
- }
1010
- function $() {
1011
- U.value = !1, W.value = null, cn.value = null, window.removeEventListener("scroll", Vn, !0), window.removeEventListener("resize", Vn);
1012
- }
1013
- function Hn(e) {
1014
- let t = Rn(e?.target) || E.value?.id || Nt.value, n = L.value.find((e) => e.id === t);
1015
- if (!n) {
1016
- tn.value = null;
1017
- return;
1018
- }
1019
- F.value = n, E.value = { id: n.id };
1020
- let r = I.value.x, i = I.value.y;
1021
- switch (n.type) {
1022
- case "rect":
1023
- case "circle":
1024
- case "text":
1025
- tn.value = {
1026
- dx: r - n.x,
1027
- dy: i - n.y
1028
- };
1029
- break;
1030
- case "arrow":
1031
- tn.value = {
1032
- dx: r - n.x,
1033
- dy: i - n.y,
1034
- endDx: r - n.endX,
1035
- endDy: i - n.endY
1036
- };
1037
- break;
1038
- case "line":
1039
- tn.value = {
1040
- startX: r,
1041
- startY: i,
1042
- path: n.path
1043
- };
1044
- break;
1045
- case "group":
1046
- tn.value = {
1047
- dx: r - (n.x || 0),
1048
- dy: i - (n.y || 0)
1049
- };
1050
- break;
1051
- default: tn.value = {
1052
- dx: 0,
1053
- dy: 0
1054
- };
1055
- }
1056
- }
1057
- function Un(e, t) {
1058
- if (nn.value = t || null, V.value = null, e) {
1059
- if (e.type === "line" && t === "line-scale") {
1060
- let t = Sn(e.path), n = wn(e.path);
1061
- if (!t.length || !n) return;
1062
- V.value = {
1063
- shapeId: e.id,
1064
- points: t,
1065
- bounds: n
1066
- };
1067
- return;
1068
- }
1069
- if (e.type === "rect" && t?.startsWith("rect-")) {
1070
- let t = Number(e.x) || 0, n = Number(e.y) || 0, r = t + Math.max(0, Number(e.rectWidth) || 0), i = n + Math.max(0, Number(e.rectHeight) || 0);
1071
- V.value = {
1072
- shapeId: e.id,
1073
- bounds: {
1074
- left: t,
1075
- top: n,
1076
- right: r,
1077
- bottom: i
1078
- }
1079
- };
1080
- return;
1081
- }
1082
- if (e.type === "circle" && t === "circle-radius") {
1083
- let t = Math.max(1, Number(e.circleRadius) || 1);
1084
- V.value = {
1085
- shapeId: e.id,
1086
- anchor: {
1087
- x: (Number(e.x) || 0) - t,
1088
- y: Number(e.y) || 0
1089
- },
1090
- handlePoint: {
1091
- x: (Number(e.x) || 0) + t,
1092
- y: Number(e.y) || 0
1093
- }
1094
- };
1095
- }
1096
- }
1097
- }
1098
- function Wn(e) {
1099
- let t = L.value.find((e) => e.id === F.value.id);
1100
- switch (!0) {
1101
- case e === "front":
1102
- L.value = L.value.filter((e) => e.id !== t.id), L.value.push(t);
1103
- break;
1104
- case e === "back":
1105
- L.value = L.value.filter((e) => e.id !== t.id), L.value = [t, ...L.value];
1106
- break;
1107
- default: return;
1108
- }
1109
- }
1110
- function Gn() {
1111
- if (!F.value?.id) return;
1112
- let e = {
1113
- ...F.value,
1114
- id: `${F.value.id}_copy_${r()}`,
1115
- x: F.value.x - 100 < 0 ? 1 : F.value.x - 100,
1116
- y: F.value.y - 100 < 0 ? 1 : F.value.y - 100
1117
- };
1118
- L.value.push(e);
1119
- }
1120
- function Kn(e) {
1121
- e && (e.color && (hn.value = e.color), Number.isFinite(Number(e.strokeWidth)) && (Mt.value = Number(e.strokeWidth)), "isDash" in e && (It.value = !!e.isDash), e.type === "circle" ? (R.value.circle.filled = !!e.isFilled, w.value = "circle") : e.type === "rect" ? (R.value.rect.filled = !!e.isFilled, w.value = "rect") : e.type === "arrow" ? w.value = "arrow" : e.type === "line" ? w.value = "line" : e.type === "text" && (B.value = e.textAlign || "start", Qt.value = Number(e.fontSize) || Qt.value, Pt.value = !!e.isBold, zt.value = !!e.isItalic, Ht.value = !!e.isUnderline, Ft.value = !!e.isBulletTextMode));
1122
- }
1123
- function qn(e) {
1124
- if (!M.value) {
1125
- Nt.value = void 0;
1126
- return;
1127
- }
1128
- e.preventDefault(), Ut.value = !1, Nt.value = Rn(e.target) || void 0;
1129
- }
1130
- function Jn() {
1131
- let e = rn.value;
1132
- if (!e || !bn.value || !P.value) {
1133
- H.value = null;
1134
- return;
1135
- }
1136
- ce(() => {
1137
- if (!bn.value || !P.value || rn.value !== e) {
1138
- H.value = null;
1139
- return;
1140
- }
1141
- let t = L.value.find((t) => t.id === e);
1142
- if (!t || t.type !== "text") {
1143
- H.value = null;
1144
- return;
1145
- }
1146
- let n = Array.from(bn.value.getElementsByTagName("text")).find((t) => t.getAttribute("data-shape-id") === e);
1147
- if (!n) {
1148
- H.value = null;
1149
- return;
1150
- }
1151
- let r = kn(t), i = Math.max(0, Math.min(sn.value.row, r.length - 1)), a = r[i] || "", o = Math.max(0, Math.min(sn.value.col, a.length)), s = a.slice(0, o), c = document.createElementNS("http://www.w3.org/2000/svg", "text");
1152
- c.setAttribute("font-size", String(t.fontSize)), c.setAttribute("font-family", n.getAttribute("font-family") || "Helvetica"), c.setAttribute("font-weight", t.isBold ? "bold" : "normal"), c.setAttribute("font-style", t.isItalic ? "italic" : "normal"), c.setAttribute("visibility", "hidden"), c.setAttribute("pointer-events", "none"), bn.value.appendChild(c);
1153
- let l = (e) => (c.textContent = e || "​", typeof c.getComputedTextLength == "function" ? c.getComputedTextLength() : c.getBBox().width), ee = l(s), u = l(a);
1154
- c.remove();
1155
- let te = t.x;
1156
- t.textAlign === "middle" ? te -= u / 2 : t.textAlign === "end" && (te -= u);
1157
- let ne = t.y + t.fontSize * i;
1158
- H.value = {
1159
- x: te + ee,
1160
- y1: ne - t.fontSize * .85,
1161
- y2: ne + t.fontSize * .15,
1162
- color: t.color || J.value.color
1163
- };
1164
- });
1165
- }
1166
- function Yn(e, { isNew: t = !1 } = {}) {
1167
- if (!e || e.type !== "text") return;
1168
- if (P.value && rn.value === e.id) {
1169
- let t = kn(e), n = Math.max(0, t.length - 1);
1170
- sn.value = {
1171
- row: n,
1172
- col: (t[n] || "").length
1173
- }, z.value = !0, Jn();
1174
- return;
1175
- }
1176
- P.value && Xn(), t || ln.value?.begin?.(), F.value = e, E.value = { id: e.id }, rn.value = e.id, an.value = t ? null : Z(e), on.value = t;
1177
- let n = kn(e), r = Math.max(0, n.length - 1);
1178
- sn.value = {
1179
- row: r,
1180
- col: (n[r] || "").length
1181
- }, Kn(e), N.value = !0, P.value = !0, z.value = !0, O.value = !1, w.value = void 0, H.value = null, Jn();
1182
- }
1183
- function Xn({ cancel: e = !1 } = {}) {
1184
- let t = rn.value;
1185
- if (!t) {
1186
- P.value = !1, z.value = !1, H.value = null;
1187
- return;
1188
- }
1189
- let n = L.value.find((e) => e.id === t);
1190
- if (e) {
1191
- if (on.value) L.value = L.value.filter((e) => e.id !== t), n = null;
1192
- else if (an.value) {
1193
- let e = L.value.findIndex((e) => e.id === t);
1194
- e !== -1 && (L.value[e] = Z(an.value), n = L.value[e]);
1195
- }
1196
- } else n && kn(n).every((e) => e.length === 0) && (L.value = L.value.filter((e) => e.id !== t), n = null);
1197
- rn.value = null, an.value = null, on.value = !1, sn.value = {
1198
- row: 0,
1199
- col: 0
1200
- }, P.value = !1, z.value = !1, H.value = null, ln.value?.end?.(), n ? (F.value = n, E.value = { id: n.id }) : F.value?.id === t && (F.value = void 0, E.value = void 0);
1201
- }
1202
- function Zn() {
1203
- if (P.value) {
1204
- Xn();
1205
- return;
1206
- }
1207
- let e = F.value;
1208
- e && e.type === "text" && kn(e).every((e) => e.length === 0) && (L.value = L.value.filter((t) => t.id !== e.id), F.value = L.value.at(-1));
1209
- }
1210
- function Qn() {
1211
- ln.value?.begin?.();
1212
- let e = {
1213
- id: `text_${r()}`,
1214
- type: "text",
1215
- lines: 0,
1216
- x: I.value.x,
1217
- y: I.value.y,
1218
- textContent: "",
1219
- fontSize: Z(Qt.value),
1220
- textAlign: Z(B.value),
1221
- isBold: Z(Pt.value),
1222
- isItalic: Z(zt.value),
1223
- isUnderline: Z(Ht.value),
1224
- color: Z(hn.value),
1225
- isBulletTextMode: Z(Ft.value)
1226
- };
1227
- L.value.push(e), F.value = e, E.value = { id: e.id }, Yn(e, { isNew: !0 });
1228
- }
1229
- let $n = 0;
1230
- function er(e) {
1231
- if (M.value && !D.value && (e.preventDefault(), e.stopPropagation(), Fr(e), !Rn(e.target) && !(Date.now() < $n))) {
1232
- if (P.value && Xn(), N.value && !A.value) {
1233
- Qn();
1234
- return;
1235
- }
1236
- !O.value && !j.value && (F.value = void 0, E.value = void 0, Nt.value = void 0, k.value || (w.value = void 0)), z.value = !1, H.value = null;
1237
- }
1238
- }
1239
- function tr(e) {
1240
- F.value && F.value.type === "text" && (F.value.textAlign = e, B.value = e, Jn());
1241
- }
1242
- function nr() {
1243
- P.value && Xn(), ln.value?.undo?.();
1244
- }
1245
- function rr() {
1246
- P.value && Xn(), ln.value?.redo?.();
1247
- }
1248
- function ir(e) {
1249
- if (!P.value || !rn.value) return;
1250
- let t = L.value.find((e) => e.id === rn.value);
1251
- if (!t || t.type !== "text") {
1252
- Xn();
1253
- return;
1254
- }
1255
- let n = kn(t);
1256
- n.length || (n = [""]);
1257
- let r = Math.max(0, Math.min(sn.value.row, n.length - 1)), i = Math.max(0, Math.min(sn.value.col, n[r].length)), a = !1, o = !1;
1258
- if (e.key === "Escape") {
1259
- e.preventDefault(), Xn({ cancel: !0 });
1260
- return;
1261
- }
1262
- if (e.key === "Enter") {
1263
- e.preventDefault();
1264
- let t = n[r];
1265
- n.splice(r, 1, t.slice(0, i), t.slice(i)), r += 1, i = 0, a = !0;
1266
- } else if (e.key === "Backspace") {
1267
- if (e.preventDefault(), i > 0) n[r] = n[r].slice(0, i - 1) + n[r].slice(i), --i, a = !0;
1268
- else if (r > 0) {
1269
- let e = n[r - 1].length;
1270
- n[r - 1] += n[r], n.splice(r, 1), --r, i = e, a = !0;
1271
- }
1272
- } else if (e.key === "Delete") e.preventDefault(), i < n[r].length ? (n[r] = n[r].slice(0, i) + n[r].slice(i + 1), a = !0) : r < n.length - 1 && (n[r] += n[r + 1], n.splice(r + 1, 1), a = !0);
1273
- else if (e.key === "ArrowLeft") e.preventDefault(), i > 0 ? --i : r > 0 && (--r, i = n[r].length), o = !0;
1274
- else if (e.key === "ArrowRight") e.preventDefault(), i < n[r].length ? i += 1 : r < n.length - 1 && (r += 1, i = 0), o = !0;
1275
- else if (e.key === "ArrowUp") e.preventDefault(), r > 0 && (--r, i = Math.min(i, n[r].length)), o = !0;
1276
- else if (e.key === "ArrowDown") e.preventDefault(), r < n.length - 1 && (r += 1, i = Math.min(i, n[r].length)), o = !0;
1277
- else if (e.key === "Home") e.preventDefault(), i = 0, o = !0;
1278
- else if (e.key === "End") e.preventDefault(), i = n[r].length, o = !0;
1279
- else if (e.key === "Tab") e.preventDefault(), n[r] = n[r].slice(0, i) + " " + n[r].slice(i), i += 4, a = !0;
1280
- else if (e.key.length === 1 && !e.ctrlKey && !e.metaKey && !e.altKey) e.preventDefault(), n[r] = n[r].slice(0, i) + e.key + n[r].slice(i), i += e.key.length, a = !0;
1281
- else return;
1282
- a && (t.isBold = Z(Pt.value), t.isItalic = Z(zt.value), t.isUnderline = Z(Ht.value), An(t, n)), (a || o) && (sn.value = {
1283
- row: r,
1284
- col: i
1285
- }, z.value = !0, Jn());
1286
- }
1287
- function ar(e) {
1288
- if (!e) return null;
1289
- switch (e.type) {
1290
- case "arrow": return {
1291
- left: Math.min(e.x, e.endX),
1292
- top: Math.min(e.y, e.endY),
1293
- right: Math.max(e.x, e.endX),
1294
- bottom: Math.max(e.y, e.endY)
1295
- };
1296
- case "circle": {
1297
- let t = Math.max(0, Number(e.circleRadius) || 0);
1298
- return {
1299
- left: e.x - t,
1300
- top: e.y - t,
1301
- right: e.x + t,
1302
- bottom: e.y + t
1303
- };
1304
- }
1305
- case "rect":
1306
- case "group": return {
1307
- left: e.x,
1308
- top: e.y,
1309
- right: e.x + e.rectWidth,
1310
- bottom: e.y + e.rectHeight
1311
- };
1312
- case "line": {
1313
- let t = wn(e.path);
1314
- return t ? {
1315
- left: t.minX,
1316
- top: t.minY,
1317
- right: t.maxX,
1318
- bottom: t.maxY
1319
- } : null;
1320
- }
1321
- case "text": return {
1322
- left: e.x,
1323
- top: e.y,
1324
- right: e.x,
1325
- bottom: e.y
1326
- };
1327
- default: return null;
1328
- }
1329
- }
1330
- function or(e, t) {
1331
- let n = ar(e);
1332
- if (!n) return !1;
1333
- let r = Math.min(t.x, t.x + t.rectWidth), i = Math.min(t.y, t.y + t.rectHeight), a = Math.max(t.x, t.x + t.rectWidth), o = Math.max(t.y, t.y + t.rectHeight);
1334
- return r <= n.left && i <= n.top && a >= n.right && o >= n.bottom;
1335
- }
1336
- function sr(e, t) {
1337
- let n = Z(e), r = Number(t.x) || 0, i = Number(t.y) || 0;
1338
- switch (n.type) {
1339
- case "circle":
1340
- case "rect":
1341
- case "text":
1342
- n.x = r + (Number(n.diffX) || 0), n.y = i + (Number(n.diffY) || 0);
1343
- break;
1344
- case "arrow":
1345
- n.x = r + (Number(n.diffX) || 0), n.y = i + (Number(n.diffY) || 0), n.endX = r + (Number(n.diffEndX) || 0), n.endY = i + (Number(n.diffEndY) || 0);
1346
- break;
1347
- case "line": Array.isArray(n.diffPoints) && n.diffPoints.length && (n.path = Cn(n.diffPoints.map((e) => ({
1348
- x: r + e.x,
1349
- y: i + e.y
1350
- }))));
1351
- }
1352
- return n.id = n.oldId || n.id, delete n.diffX, delete n.diffY, delete n.diffEndX, delete n.diffEndY, delete n.diffPoints, n;
1353
- }
1354
- function cr(e) {
1355
- return e.type === "group" ? (e.source || []).flatMap((t) => t.type === "group" ? cr(sr(t, e)) : [sr(t, e)]) : [Z(e)];
1356
- }
1357
- function lr(e, t) {
1358
- let n = {
1359
- ...Z(e),
1360
- id: t.id,
1361
- oldId: e.oldId || e.id,
1362
- diffX: (Number(e.x) || 0) - t.x,
1363
- diffY: (Number(e.y) || 0) - t.y,
1364
- diffEndX: Number.isFinite(Number(e.endX)) ? Number(e.endX) - t.x : 0,
1365
- diffEndY: Number.isFinite(Number(e.endY)) ? Number(e.endY) - t.y : 0
1366
- };
1367
- return e.type === "line" && (n.diffPoints = Sn(e.path).map((e) => ({
1368
- x: e.x - t.x,
1369
- y: e.y - t.y
1370
- }))), n;
1371
- }
1372
- function ur() {
1373
- if (Wt.value = [], w.value !== "group") return j.value = !1, L.value = L.value.filter((e) => e.type !== "group"), null;
1374
- let e = L.value.at(-1);
1375
- if (!e || e.type !== "group") return null;
1376
- let t = L.value.filter((t) => t.id !== e.id && or(t, e));
1377
- if (t.length < 2) return L.value = L.value.filter((t) => t.id !== e.id), null;
1378
- let n = t.flatMap((e) => cr(e));
1379
- Wt.value = n.map((t) => lr(t, e)), e.source = Wt.value, e.content = "";
1380
- let r = new Set(t.map((e) => e.id));
1381
- return L.value = L.value.filter((t) => t.id === e.id || !r.has(t.id)), dr(e), e;
1382
- }
1383
- function dr(e) {
1384
- e.content = "";
1385
- let t = e.x || 0, n = e.y || 0;
1386
- (e.source || []).forEach((i) => {
1387
- switch (i.type) {
1388
- case "circle": {
1389
- let r = t + i.diffX, a = n + i.diffY;
1390
- e.content += `
1391
- <circle
1392
- id="${i.id}"
1393
- cx="${r}"
1394
- cy="${a}"
1395
- r="${i.circleRadius ? i.circleRadius : Number.MIN_VALUE}"
1396
- fill="${i.isFilled ? i.color + i.alpha : "rgba(255,255,255,0.001)"}"
1397
- stroke="${i.color + i.alpha}"
1398
- stroke-width="${i.strokeWidth}"
1399
- style="${i.isDash ? `stroke-dasharray: ${i.strokeWidth * 3}` : ""}"
1400
- />
1401
- `;
1402
- break;
1403
- }
1404
- case "rect": {
1405
- let r = t + i.diffX, a = n + i.diffY;
1406
- e.content += `
1407
- <rect
1408
- id="${A.value ? "" : i.id}"
1409
- x="${r}"
1410
- y="${a}"
1411
- fill="${i.isFilled ? i.color + i.alpha : "rgba(255,255,255,0.001)"}"
1412
- height="${i.rectHeight}"
1413
- width="${i.rectWidth}"
1414
- stroke="${i.color + i.alpha}"
1415
- stroke-width="${i.strokeWidth}"
1416
- style="rx:1 !important; ry:1 !important; ${i.isDash ? `stroke-dasharray: ${i.strokeWidth * 3}` : ""}"
1417
- />
1418
- `;
1419
- break;
1420
- }
1421
- case "arrow": {
1422
- let a = t + i.diffX, o = n + i.diffY, s = t + i.diffEndX, c = n + i.diffEndY, l = i.strokeWidth > 3 ? 5 : 10, ee = i.strokeWidth > 3 ? 2.5 : 5, u = `m_${i.id}_${r()}`;
1423
- e.content += `
1424
- <g id="${i.id}">
1425
- <defs>
1426
- <marker
1427
- id="${u}"
1428
- markerWidth="${l}"
1429
- markerHeight="${l}"
1430
- refX="0"
1431
- refY="${ee}"
1432
- orient="auto">
1433
- <polygon points="0 0,${l} ${ee}, 0 ${l}" fill="${i.color}" />
1434
- </marker>
1435
- </defs>
1436
- <path
1437
- style="stroke-linecap: round !important; ${i.isDash ? `stroke-dasharray: ${i.strokeWidth * 3}` : ""}"
1438
- stroke="${i.color}"
1439
- id="${i.id}"
1440
- d="M${a},${o} ${s},${c}"
1441
- stroke-width="${i.strokeWidth}"
1442
- marker-end="url(#${u})"
1443
- />
1444
- </g>
1445
- `;
1446
- break;
1447
- }
1448
- case "line": {
1449
- let r = Cn(Array.isArray(i.diffPoints) && i.diffPoints.length ? i.diffPoints.map((e) => ({
1450
- x: t + e.x,
1451
- y: n + e.y
1452
- })) : Sn(i.path));
1453
- e.content += `
1454
- <path
1455
- id="${i.id}"
1456
- d="M${r}"
1457
- style="stroke:${i.color + i.alpha} !important; fill:none; stroke-width:${i.strokeWidth} !important; stroke-linecap:round !important; stroke-linejoin:round !important; ${i.isDash ? `stroke-dasharray: ${i.strokeWidth * 3}` : ""}"
1458
- />
1459
- `;
1460
- break;
1461
- }
1462
- case "text": {
1463
- let r = (i.textContent || "").split("‎").map((e, r) => `
1464
- ${i.isBulletTextMode ? `<tspan x="${t + i.diffX - i.fontSize}" y="${n + i.diffY + i.fontSize * r}" id="${i.id}" font-size="${i.fontSize / 2}">⬤</tspan>` : ""}
1465
- <tspan id="${i.id}" x="${t + i.diffX}" y="${n + i.diffY + i.fontSize * r}">
1466
- ${e}
1467
- </tspan>
1468
- `).join("");
1469
- e.content += `
1470
- <g id="${i.id}">
1471
- <text
1472
- style="user-select:none; height:100px;"
1473
- id="${i.id}"
1474
- x="${t + i.diffX}"
1475
- y="${n + i.diffY}"
1476
- text-anchor="${i.textAlign}"
1477
- font-size="${i.fontSize}"
1478
- fill="${i.color}"
1479
- font-weight="${i.isBold ? "bold" : "normal"}"
1480
- font-style="${i.isItalic ? "italic" : "normal"}"
1481
- text-decoration="${i.isUnderline ? "underline" : "none"}">
1482
- ${r}
1483
- </text>
1484
- </g>
1485
- `;
1486
- break;
1487
- }
1488
- }
1489
- });
1490
- }
1491
- function fr(e) {
1492
- e.relatedTarget && bn.value && bn.value.contains(e.relatedTarget) || (Ut.value = !0, Nt.value = void 0);
1493
- }
1494
- function pr() {
1495
- if (Lt.value = !0, !w.value && !j.value || !Lt.value) return;
1496
- Rt.value = !0, T.value.start = {
1497
- x: I.value.x,
1498
- y: I.value.y
1499
- };
1500
- let e = `${j.value ? "group" : w.value}_${r()}`;
1501
- switch (!0) {
1502
- case w.value === "arrow":
1503
- L.value.push({
1504
- id: e,
1505
- x: I.value.x,
1506
- y: I.value.y,
1507
- endX: I.value.x,
1508
- endY: I.value.y,
1509
- type: w.value,
1510
- color: Z(hn.value),
1511
- strokeWidth: Z(Math.abs(Mt.value)),
1512
- isDash: Z(It.value)
1513
- }), F.value = L.value.at(-1);
1514
- break;
1515
- case w.value === "circle":
1516
- L.value.push({
1517
- alpha: R.value.circle.filled ? _n.value : "",
1518
- id: e,
1519
- color: Z(hn.value),
1520
- isFilled: Z(R.value.circle.filled),
1521
- circleRadius: Z(R.value.circle.radius),
1522
- circleStrokeWidth: Z(R.value.circle.strokeWidth),
1523
- type: w.value,
1524
- x: I.value.x,
1525
- y: I.value.y,
1526
- strokeWidth: Z(Math.abs(Mt.value)),
1527
- isDash: Z(It.value)
1528
- }), F.value = L.value.at(-1);
1529
- break;
1530
- case w.value === "line":
1531
- L.value.push({
1532
- alpha: Z(_n.value),
1533
- id: e,
1534
- x: I.value.x,
1535
- y: I.value.y,
1536
- type: w.value,
1537
- color: Z(hn.value),
1538
- strokeWidth: Z(Math.abs(Mt.value)),
1539
- isDash: Z(It.value),
1540
- path: `${I.value.x} ${I.value.y}`
1541
- }), F.value = L.value.at(-1);
1542
- break;
1543
- case w.value === "rect":
1544
- L.value.push({
1545
- alpha: R.value.rect.filled ? _n.value : "",
1546
- id: e,
1547
- color: Z(hn.value),
1548
- isFilled: Z(R.value.rect.filled),
1549
- rectStrokeWidth: Z(R.value.rect.strokeWidth),
1550
- rectHeight: Z(R.value.rect.height),
1551
- rectWidth: Z(R.value.rect.width),
1552
- type: w.value,
1553
- x: I.value.x,
1554
- y: I.value.y,
1555
- strokeWidth: Z(Math.abs(Mt.value)),
1556
- isDash: Z(It.value)
1557
- }), F.value = L.value.at(-1);
1558
- break;
1559
- case w.value === "group": L.value.push({
1560
- alpha: 1,
1561
- id: `group_${r()}`,
1562
- x: I.value.x,
1563
- y: I.value.y,
1564
- isFilled: !1,
1565
- rectHeight: Z(R.value.rect.height),
1566
- rectWidth: Z(R.value.rect.width),
1567
- rectStrokeWidth: 1,
1568
- type: "group",
1569
- color: "grey",
1570
- strokeWidth: 1,
1571
- isDash: !0,
1572
- content: ""
1573
- });
1574
- }
1575
- pn.value ||= requestAnimationFrame(In);
1576
- }
1577
- function mr(e) {
1578
- if (!M.value) return;
1579
- Fr(e);
1580
- let t = zn(e), n = t ? L.value.find((e) => e.id === t) : null;
1581
- if (P.value && rn.value && t !== rn.value && Xn(), D.value) {
1582
- Bt.value = !1;
1583
- return;
1584
- }
1585
- if (n) {
1586
- let t = Number.isFinite(e?.timeStamp) ? e.timeStamp : Date.now(), r = br.id === n.id && t - br.at >= 0 && t - br.at <= Et;
1587
- if (br = r ? {
1588
- id: null,
1589
- at: 0
1590
- } : {
1591
- id: n.id,
1592
- at: t
1593
- }, r) {
1594
- e.preventDefault(), e.stopPropagation(), Bt.value = !1, tn.value = null, nn.value = null, V.value = null, yr(n);
1595
- return;
1596
- }
1597
- } else br = {
1598
- id: null,
1599
- at: 0
1600
- };
1601
- if (e.preventDefault(), e.stopPropagation(), Bt.value = !0, e.pointerId != null) {
1602
- try {
1603
- bn.value?.setPointerCapture?.(e.pointerId);
1604
- } catch {}
1605
- mn.value = e.pointerId;
1606
- } else mn.value = null;
1607
- if (O.value) {
1608
- if (n) {
1609
- Bt.value = !1, O.value = !1, F.value = n, E.value = { id: n.id }, Kn(n);
1610
- return;
1611
- }
1612
- ln.value?.begin?.(), pr();
1613
- return;
1614
- }
1615
- if (j.value) {
1616
- ln.value?.begin?.(), pr();
1617
- return;
1618
- }
1619
- if (k.value) {
1620
- if (!n) {
1621
- Bt.value = !1, E.value = void 0;
1622
- return;
1623
- }
1624
- ln.value?.begin?.(), Ln(n.id);
1625
- let t = L.value.find((e) => e.id === n.id);
1626
- F.value = t, E.value = { id: t.id }, Hn({ target: e.target });
1627
- return;
1628
- }
1629
- if (A.value) {
1630
- if (!n) {
1631
- Bt.value = !1, E.value = void 0, tn.value = null, nn.value = null, V.value = null;
1632
- return;
1633
- }
1634
- let t = e.target?.getAttribute?.("data-resize-handle") || null;
1635
- F.value = n, E.value = { id: n.id }, Kn(n), t ? (tn.value = null, Un(n, t)) : (nn.value = null, V.value = null, Hn(e)), ln.value?.begin?.();
1636
- }
1637
- }
1638
- function hr(e) {
1639
- if (!e || !e.id || !tn.value && (Hn({ target: { id: e.id } }), !tn.value)) return;
1640
- let t = I.value.x, n = I.value.y;
1641
- switch (F.value = e, e.type) {
1642
- case "arrow": {
1643
- let { dx: r, dy: i, endDx: a, endDy: o } = tn.value;
1644
- e.x = t - r, e.y = n - i, e.endX = t - (a ?? r), e.endY = n - (o ?? i);
1645
- break;
1646
- }
1647
- case "circle":
1648
- case "rect":
1649
- case "text": {
1650
- let { dx: r, dy: i } = tn.value;
1651
- e.x = t - r, e.y = n - i;
1652
- break;
1653
- }
1654
- case "line": {
1655
- let { startX: r, startY: i, path: a } = tn.value, o = t - r, s = n - i;
1656
- e.path = Cn(Sn(a).map((e) => ({
1657
- x: e.x + o,
1658
- y: e.y + s
1659
- })));
1660
- let c = wn(e.path);
1661
- c && (e.x = c.minX, e.y = c.minY);
1662
- break;
1663
- }
1664
- case "group": {
1665
- let { dx: r, dy: i } = tn.value;
1666
- e.x = t - r, e.y = n - i, dr(e);
1667
- break;
1668
- }
1669
- }
1670
- }
1671
- function gr() {
1672
- let e = E.value?.id || Nt.value;
1673
- if (!e) return;
1674
- let t = L.value.find((t) => t.id === e);
1675
- t && hr(t);
1676
- }
1677
- function _r() {
1678
- let e = E.value?.id;
1679
- if (!e) return;
1680
- let t = L.value.find((t) => t.id === e);
1681
- if (!t) return;
1682
- let n = I.value.x, r = I.value.y;
1683
- switch (w.value = t.type, F.value = t, t.type) {
1684
- case "arrow":
1685
- nn.value === "arrow-start" ? (t.x = n, t.y = r) : nn.value === "arrow-end" && (t.endX = n, t.endY = r);
1686
- break;
1687
- case "line": {
1688
- if (nn.value !== "line-scale" || !V.value?.bounds || !V.value?.points) return;
1689
- let { bounds: e, points: i } = V.value, a = Math.max(1, n - e.minX), o = Math.max(1, r - e.minY), s = a / Math.max(1, e.width), c = o / Math.max(1, e.height);
1690
- t.path = Cn(i.map((t) => ({
1691
- x: e.minX + (t.x - e.minX) * s,
1692
- y: e.minY + (t.y - e.minY) * c
1693
- }))), t.x = e.minX, t.y = e.minY;
1694
- break;
1695
- }
1696
- case "circle": {
1697
- if (nn.value !== "circle-radius" || V.value?.shapeId !== t.id || !V.value?.anchor) return;
1698
- let e = V.value.anchor, i = n, a = r, o = i - e.x, s = a - e.y, c = Math.hypot(o, s);
1699
- if (c < 2) {
1700
- if (c > 0) {
1701
- let e = 2 / c;
1702
- o *= e, s *= e;
1703
- } else o = 2, s = 0;
1704
- i = e.x + o, a = e.y + s, c = 2;
1705
- }
1706
- t.x = e.x + o / 2, t.y = e.y + s / 2, t.circleRadius = c / 2, V.value.handlePoint = {
1707
- x: i,
1708
- y: a
1709
- };
1710
- break;
1711
- }
1712
- case "rect": {
1713
- let e = nn.value, i = V.value?.bounds;
1714
- if (!e?.startsWith("rect-") || V.value?.shapeId !== t.id || !i) return;
1715
- let a = i.left, o = i.top, s = i.right, c = i.bottom;
1716
- switch (e) {
1717
- case "rect-nw":
1718
- a = Math.min(n, i.right - 20), o = Math.min(r, i.bottom - 20);
1719
- break;
1720
- case "rect-ne":
1721
- s = Math.max(n, i.left + 20), o = Math.min(r, i.bottom - 20);
1722
- break;
1723
- case "rect-se":
1724
- s = Math.max(n, i.left + 20), c = Math.max(r, i.top + 20);
1725
- break;
1726
- case "rect-sw":
1727
- a = Math.min(n, i.right - 20), c = Math.max(r, i.top + 20);
1728
- break;
1729
- default: return;
1730
- }
1731
- t.x = a, t.y = o, t.rectWidth = s - a, t.rectHeight = c - o;
1732
- break;
1733
- }
1734
- case "group":
1735
- if (nn.value !== "group-scale") return;
1736
- t.rectWidth = Math.max(20, n - t.x), t.rectHeight = Math.max(20, r - t.y);
1737
- }
1738
- }
1739
- function vr(e) {
1740
- if (!M.value || D.value) return;
1741
- e.preventDefault(), e.stopPropagation(), Fr(e);
1742
- let t = zn(e);
1743
- t && (Nt.value = t), k.value && Bt.value ? gr() : A.value && Bt.value && (nn.value ? _r() : gr());
1744
- }
1745
- function yr(e) {
1746
- if (e) {
1747
- if (P.value && rn.value !== e.id && Xn(), F.value = e, E.value = { id: e.id }, k.value = !1, D.value = !1, A.value = !0, j.value = !1, O.value = !1, e.type === "text") {
1748
- w.value = void 0, Kn(e), Yn(e);
1749
- return;
1750
- }
1751
- N.value = !1, P.value = !1, z.value = !1, H.value = null, Kn(e);
1752
- }
1753
- }
1754
- let br = {
1755
- id: null,
1756
- at: 0
1757
- }, xr = {
1758
- id: null,
1759
- at: 0
1760
- };
1761
- function Sr(e, t) {
1762
- if (!M.value) return;
1763
- let n = t || Rn(e.target);
1764
- if (!n) return;
1765
- xr = {
1766
- id: null,
1767
- at: 0
1768
- };
1769
- let r = L.value.find((e) => e.id === n);
1770
- r && yr(r);
1771
- }
1772
- function Cr(e, t) {
1773
- if (!M.value) return;
1774
- let n = t || Rn(e.target);
1775
- if (!n) return;
1776
- let r = L.value.find((e) => e.id === n);
1777
- if (!r) return;
1778
- let i = Number.isFinite(e?.timeStamp) ? e.timeStamp : Date.now(), a = xr.id === n && i - xr.at >= 0 && i - xr.at <= Et;
1779
- if (xr = a ? {
1780
- id: null,
1781
- at: 0
1782
- } : {
1783
- id: n,
1784
- at: i
1785
- }, a && !D.value) {
1786
- yr(r);
1787
- return;
1788
- }
1789
- let o = F.value?.id === n, s = N.value;
1790
- if (D.value) {
1791
- P.value && Xn(), ln.value?.begin?.(), L.value = L.value.filter((e) => e.id !== n), F.value?.id === n && (F.value = void 0), E.value = void 0, ln.value?.end?.();
1792
- return;
1793
- }
1794
- if (P.value && rn.value && rn.value !== n && Xn(), F.value = r, E.value = { id: r.id }, k.value) {
1795
- z.value = !1, H.value = null;
1796
- return;
1797
- }
1798
- if (Kn(r), r.type === "text") {
1799
- let e = !k.value && !A.value && !O.value && !j.value;
1800
- N.value = e, e && (s || o) && Yn(r);
1801
- return;
1802
- }
1803
- N.value = !1, z.value = !1, H.value = null;
1804
- }
1805
- let wr = y(null);
1806
- function Tr(e, t) {
1807
- for (t(e), e = e.firstChild; e;) Tr(e, t), e = e.nextSibling;
1808
- }
1809
- function Er() {
1810
- P.value && Xn(), Vt.value = !0, D.value = !1, k.value = !1, A.value = !1, N.value = !1, P.value = !1, j.value = !1, w.value = void 0, z.value = !1, ce(async () => {
1811
- let e = wr.value;
1812
- if (e) {
1813
- Tr(e, (e) => {
1814
- e && e.nodeType === 1 && (e.setAttribute("font-family", "Helvetica"), e.style.fontFamily = "Helvetica");
1815
- });
1816
- try {
1817
- let t;
1818
- try {
1819
- t = (await import("jspdf")).default;
1820
- } catch {
1821
- throw Error("jspdf is not installed. Run npm install jspdf");
1822
- }
1823
- let n = await l({
1824
- container: e,
1825
- scale: 2
1826
- }), r = new Image();
1827
- r.src = n, r.onload = () => {
1828
- let e = {
1829
- width: 595.28,
1830
- height: 841.89
1831
- }, i = r.width, a = r.height, o = i / e.width * e.height, s = e.width, c = s / i * a, l = new t("", "pt", "a4"), ee = 0, u = a;
1832
- if (u < o) l.addImage(n, "PNG", 0, 0, s, c, "", "FAST");
1833
- else for (; u > 0;) l.addImage(n, "PNG", 0, ee, s, c, "", "FAST"), u -= o, ee -= e.height, u > 0 && l.addPage();
1834
- l.save(`${(/* @__PURE__ */ new Date()).toLocaleDateString()}_annotations.pdf`);
1835
- };
1836
- } catch (e) {
1837
- console.error("Error generating image:", e);
1838
- } finally {
1839
- Vt.value = !1, Tr(e, (e) => {
1840
- e && e.nodeType === 1 && (e.setAttribute("font-family", J.value.fontFamily), e.style.fontFamily = J.value.fontFamily);
1841
- });
1842
- }
1843
- }
1844
- });
1845
- }
1846
- function Dr(e) {
1847
- let t = O.value && Lt.value && F.value && [
1848
- "arrow",
1849
- "circle",
1850
- "line",
1851
- "rect"
1852
- ].includes(F.value.type) ? L.value.find((e) => e.id === F.value.id) : null;
1853
- if (!D.value && e && (e.preventDefault(), e.stopPropagation()), Lt.value = !1, Bt.value = !1, tn.value = null, nn.value = null, V.value = null, mn.value != null) {
1854
- try {
1855
- bn.value?.releasePointerCapture?.(mn.value);
1856
- } catch {}
1857
- mn.value = null;
1858
- }
1859
- pn.value &&= (cancelAnimationFrame(pn.value), null);
1860
- let n = j.value ? ur() : null;
1861
- ln.value?.end(), n && (j.value = !1, k.value = !0, A.value = !1, O.value = !1, D.value = !1, N.value = !1, P.value = !1, z.value = !1, H.value = null, F.value = n, E.value = { id: n.id }, Nt.value = void 0, $n = Date.now() + 250), t && ($n = Date.now() + 250, yr(t));
1862
- }
1863
- function Or() {
1864
- F.value && F.value.id.includes("rect") && (F.value.isFilled = !F.value.isFilled);
1865
- }
1866
- function kr() {
1867
- F.value && F.value.id.includes("circle") && (F.value.isFilled = !F.value.isFilled);
1868
- }
1869
- function Ar(e = hn.value) {
1870
- let t = typeof e == "string" && e.length ? e : hn.value;
1871
- if (hn.value = t, !F.value || k.value) return;
1872
- let n = L.value.find((e) => e.id === F.value.id);
1873
- if (n) {
1874
- if (n.color = Z(t), F.value = n, ["arrow", "text"].includes(n.type)) {
1875
- Jn();
1876
- return;
1877
- }
1878
- n.alpha = Z(_n.value);
1879
- }
1880
- }
1881
- function jr() {
1882
- F.value && F.value.type !== "text" && (F.value.isDash = Z(It.value));
1883
- }
1884
- function Mr() {
1885
- F.value && !["arrow", "text"].includes(F.value.type) && (F.value.alpha = Z(_n.value));
1886
- }
1887
- function Nr() {
1888
- F.value && [
1889
- "arrow",
1890
- "circle",
1891
- "rect",
1892
- "line"
1893
- ].includes(F.value.type) && (F.value.strokeWidth = Z(Math.abs(Mt.value)));
1894
- }
1895
- function Pr() {
1896
- F.value && F.value.type === "text" && (F.value.isBold = Z(Pt.value), F.value.isItalic = Z(zt.value), F.value.isUnderline = Z(Ht.value), F.value.fontSize = Z(Qt.value), F.value.isBulletTextMode = Z(Ft.value), Jn());
1897
- }
1898
- function Fr(e) {
1899
- if (e.preventDefault(), !bn.value) return;
1900
- let t = bn.value.getBoundingClientRect(), n, r;
1901
- e.touches && e.touches.length > 0 ? (n = e.touches[0].clientX, r = e.touches[0].clientY) : (n = e.clientX, r = e.clientY), I.value.x = (n - t.left) / t.width * qt.value, I.value.y = (r - t.top) / t.height * Kt.value;
1902
- }
1903
- function Ir(e) {
1904
- if (z.value = !1, Zn(), e === w.value) {
1905
- w.value = void 0, O.value = !1;
1906
- return;
1907
- }
1908
- O.value = !0, D.value = !1, k.value = !1, A.value = !1, N.value = !1, w.value = e;
1909
- }
1910
- function Lr() {
1911
- P.value && Xn(), M.value = !M.value, M.value || (k.value = !1, A.value = !1, j.value = !1, N.value = !1, P.value = !1, w.value = void 0, F.value = void 0, E.value = void 0, Nt.value = void 0, Wt.value = [], z.value = !1, D.value = !1), xe("toggleOpenState", { isOpen: M.value });
1912
- }
1913
- function Rr() {
1914
- P.value && Xn(), xe("saveAnnotations", {
1915
- shapes: L.value,
1916
- lastSelectedShape: F.value
1917
- });
1918
- }
1919
- let zr = null;
1920
- return de(() => {
1921
- if (wr.value) {
1922
- let e = !1;
1923
- Tr(wr.value, (t) => {
1924
- if (!e && [
1925
- "DIV",
1926
- "svg",
1927
- "section",
1928
- "canvas"
1929
- ].includes(t.tagName)) {
1930
- Yt.value = t, e = !0;
1931
- return;
1932
- }
1933
- });
1934
- }
1935
- un.value = (() => {
1936
- if (typeof navigator > "u") return !1;
1937
- let e = navigator.userAgentData?.platform ?? "";
1938
- if (e) return /mac|ios/i.test(e);
1939
- let t = navigator.userAgent ?? "";
1940
- return /(Mac|iPhone|iPad|iPod)/i.test(t);
1941
- })();
1942
- let e = Yt?.value.getBoundingClientRect();
1943
- if (Jt.value = e.height / e.width, qt.value = 1e3, Kt.value = Jt.value * 1e3, Xt.value = e.width, Zt.value = e.height, new ResizeObserver((e) => {
1944
- e.forEach((e) => {
1945
- Xt.value = e.contentRect.width, Zt.value = e.contentRect.height, Jt.value = e.contentRect.height / e.contentRect.width, Kt.value = Jt.value * 1e3;
1946
- });
1947
- }).observe(Yt.value), dn.value = (e) => ir(e), window.addEventListener("keydown", dn.value), ln.value = Bn(), ln.value.size) {
1948
- let e = ln.value.size();
1949
- fn.value.undo = e.undo, fn.value.redo = e.redo;
1950
- }
1951
- zr = ye({
1952
- isMacLike: un,
1953
- isSummaryOpen: M,
1954
- isWriting: P,
1955
- isDeleteMode: D,
1956
- isMoveMode: k,
1957
- isResizeMode: A,
1958
- isSelectMode: j,
1959
- isDrawMode: O,
1960
- isTextMode: N,
1961
- activeShape: w,
1962
- showCaret: z,
1963
- lastSelectedShape: F,
1964
- shapes: L,
1965
- history: ln,
1966
- setShapeTo: Ir,
1967
- undoLastShape: nr,
1968
- redoLastShape: rr
1969
- });
1970
- }), ue(() => {
1971
- $(), pn.value && cancelAnimationFrame(pn.value), dn.value && window.removeEventListener("keydown", dn.value), zr && zr(), window.removeEventListener("keydown", ir);
1972
- }), ge(L, (e) => {
1973
- e.length === 0 && (F.value = void 0);
1974
- }), ge(N, (e) => {
1975
- if (!e && P.value) {
1976
- Xn();
1977
- return;
1978
- }
1979
- z.value = !!(e && P.value), z.value && Jn();
1980
- }), (e, t) => (v(), p("div", Se, [m("div", Ce, [
1981
- b(e.$slots, "toggle", le(se({
1982
- toggle: Lr,
1983
- isOpen: M.value
1984
- })), () => [oe(te, {
1985
- config: {
1986
- maxHeight: 1e3,
1987
- useCursorPointer: Y.value,
1988
- head: {
1989
- backgroundColor: J.value.backgroundColor,
1990
- color: J.value.color,
1991
- iconColor: J.value.color,
1992
- iconSize: 20,
1993
- icon: M.value ? "close" : "annotator",
1994
- padding: "6px"
1995
- },
1996
- body: {
1997
- backgroundColor: J.value.backgroundColor,
1998
- color: J.value.color
1999
- }
2000
- },
2001
- onToggle: Lr
2002
- }, {
2003
- title: S(({ color: e }) => [m("div", { style: _({ color: e }) }, x(K.value.translations.title), 5)]),
2004
- content: S(({ backgroundColor: e }) => [m("div", { id: `toggle_default_${kt.value}` }, null, 8, we)]),
2005
- _: 1
2006
- }, 8, ["config"])], !0),
2007
- e.$slots.toggle && M.value ? (v(), p("div", {
2008
- key: 0,
2009
- id: `toggle_slot_${kt.value}`
2010
- }, null, 8, Te)) : f("", !0),
2011
- Dt.value && Ot.value ? (v(), d(ie, {
2012
- key: 1,
2013
- to: e.$slots.toggle ? `#toggle_slot_${kt.value}` : `#toggle_default_${kt.value}`
2014
- }, [m("div", null, [m("div", Ee, [
2015
- m("button", {
2016
- disabled: L.value.length === 0,
2017
- style: _({
2018
- background: k.value ? q.value.controls.selected.backgroundColor : q.value.controls.backgroundColor,
2019
- border: k.value ? q.value.controls.selected.border : q.value.controls.border,
2020
- color: k.value ? q.value.controls.selected.color : q.value.controls.color,
2021
- borderRadius: `${q.value.borderRadius}px`,
2022
- cursor: Y.value ? "pointer" : "default"
2023
- }),
2024
- class: g({
2025
- "button-tool": !0,
2026
- "button-tool--selected": k.value,
2027
- tooltip: !0
2028
- }),
2029
- onClick: t[0] ||= (e) => {
2030
- Zn(), k.value = !k.value, D.value = !1, O.value = !1, A.value = !1, j.value = !1, N.value = !1, P.value = !1, z.value = !1;
2031
- },
2032
- onMouseenter: t[1] ||= (e) => J.value.showTooltips && Q("move", e, "top"),
2033
- onMouseleave: $,
2034
- onFocus: t[2] ||= (e) => J.value.showTooltips && Q("move", e, "top"),
2035
- onBlur: $
2036
- }, [b(e.$slots, "icon-move", le(se({ active: k.value })), () => [oe(u, {
2037
- name: "move",
2038
- stroke: k.value ? q.value.controls.selected.color : q.value.controls.color
2039
- }, null, 8, ["stroke"])], !0), J.value.showTooltips ? (v(), d(C, {
2040
- key: 0,
2041
- show: U.value && W.value === "move",
2042
- x: G.value.x,
2043
- y: G.value.y - 6,
2044
- placement: "top",
2045
- styleObject: X.value
2046
- }, {
2047
- default: S(() => [h(x(K.value.translations.tooltipMove) + " ", 1), t[91] ||= m("kbd", null, "M", -1)]),
2048
- _: 1
2049
- }, 8, [
2050
- "show",
2051
- "x",
2052
- "y",
2053
- "styleObject"
2054
- ])) : f("", !0)], 46, De),
2055
- m("button", {
2056
- disabled: L.value.length === 0,
2057
- style: _({
2058
- background: A.value ? q.value.controls.selected.backgroundColor : q.value.controls.backgroundColor,
2059
- border: A.value ? q.value.controls.selected.border : q.value.controls.border,
2060
- color: A.value ? q.value.controls.selected.color : q.value.controls.color,
2061
- borderRadius: `${q.value.borderRadius}px`,
2062
- cursor: Y.value ? "pointer" : "default"
2063
- }),
2064
- class: g({
2065
- "button-tool": !0,
2066
- "button-tool--selected": A.value,
2067
- tooltip: !0
2068
- }),
2069
- onClick: t[3] ||= (e) => {
2070
- Zn(), A.value = !A.value, k.value = !1, D.value = !1, O.value = !1, j.value = !1, N.value = !1, P.value = !1, w.value = void 0, z.value = !1;
2071
- },
2072
- onMouseenter: t[4] ||= (e) => J.value.showTooltips && Q("resize", e, "top"),
2073
- onMouseleave: $,
2074
- onFocus: t[5] ||= (e) => J.value.showTooltips && Q("resize", e, "top"),
2075
- onBlur: $
2076
- }, [b(e.$slots, "icon-resize", le(se({ active: A.value })), () => [oe(u, {
2077
- name: "resize",
2078
- stroke: A.value ? q.value.controls.selected.color : q.value.controls.color
2079
- }, null, 8, ["stroke"])], !0), J.value.showTooltips ? (v(), d(C, {
2080
- key: 0,
2081
- show: U.value && W.value === "resize",
2082
- x: G.value.x,
2083
- y: G.value.y - 6,
2084
- placement: "top",
2085
- styleObject: X.value
2086
- }, {
2087
- default: S(() => [h(x(K.value.translations.tooltipResize) + " ", 1), t[92] ||= m("kbd", null, "R", -1)]),
2088
- _: 1
2089
- }, 8, [
2090
- "show",
2091
- "x",
2092
- "y",
2093
- "styleObject"
2094
- ])) : f("", !0)], 46, Oe),
2095
- m("button", {
2096
- disabled: L.value.length === 0,
2097
- style: _({
2098
- background: D.value ? q.value.controls.selected.backgroundColor : q.value.controls.backgroundColor,
2099
- border: D.value ? q.value.controls.selected.border : q.value.controls.border,
2100
- color: D.value ? q.value.controls.selected.color : q.value.controls.color,
2101
- borderRadius: `${q.value.borderRadius}px`,
2102
- cursor: Y.value ? "pointer" : "default"
2103
- }),
2104
- class: g({
2105
- "button-tool": !0,
2106
- "button-tool--selected": D.value,
2107
- tooltip: !0
2108
- }),
2109
- onClick: t[6] ||= (e) => {
2110
- Zn(), D.value = !D.value, k.value = !1, A.value = !1, j.value = !1, N.value = !1, P.value = !1, w.value = void 0, z.value = !1;
2111
- },
2112
- onMouseenter: t[7] ||= (e) => J.value.showTooltips && Q("delete", e, "top"),
2113
- onMouseleave: $,
2114
- onFocus: t[8] ||= (e) => J.value.showTooltips && Q("delete", e, "top"),
2115
- onBlur: $
2116
- }, [b(e.$slots, "icon-delete", le(se({ active: D.value })), () => [oe(u, {
2117
- name: "trash",
2118
- stroke: D.value ? q.value.controls.selected.color : q.value.controls.color
2119
- }, null, 8, ["stroke"])], !0), J.value.showTooltips ? (v(), d(C, {
2120
- key: 0,
2121
- show: U.value && W.value === "delete",
2122
- x: G.value.x,
2123
- y: G.value.y - 6,
2124
- placement: "top",
2125
- styleObject: X.value
2126
- }, {
2127
- default: S(() => [h(x(K.value.translations.tooltipDelete) + " ", 1), t[93] ||= m("kbd", null, "D", -1)]),
2128
- _: 1
2129
- }, 8, [
2130
- "show",
2131
- "x",
2132
- "y",
2133
- "styleObject"
2134
- ])) : f("", !0)], 46, ke),
2135
- m("button", {
2136
- disabled: !gn.value,
2137
- style: _({
2138
- background: j.value ? q.value.controls.selected.backgroundColor : q.value.controls.backgroundColor,
2139
- border: j.value ? q.value.controls.selected.border : q.value.controls.border,
2140
- color: j.value ? q.value.controls.selected.color : q.value.controls.color,
2141
- borderRadius: `${q.value.borderRadius}px`,
2142
- cursor: Y.value ? "pointer" : "default"
2143
- }),
2144
- class: g({
2145
- "button-tool": !0,
2146
- "button-tool--selected": j.value,
2147
- tooltip: !0
2148
- }),
2149
- onClick: t[9] ||= (e) => {
2150
- Zn(), Ir("group"), j.value = !j.value, D.value = !1, k.value = !1, A.value = !1, N.value = !1, P.value = !1, w.value = "group", z.value = !1;
2151
- },
2152
- onMouseenter: t[10] ||= (e) => J.value.showTooltips && Q("selectAndGroup", e, "top"),
2153
- onMouseleave: $,
2154
- onFocus: t[11] ||= (e) => J.value.showTooltips && Q("selectAndGroup", e, "top"),
2155
- onBlur: $
2156
- }, [b(e.$slots, "icon-select-group", le(se({ active: j.value })), () => [oe(u, {
2157
- name: "selectAndGroup",
2158
- stroke: j.value ? q.value.controls.selected.color : q.value.controls.color
2159
- }, null, 8, ["stroke"])], !0), J.value.showTooltips ? (v(), d(C, {
2160
- key: 0,
2161
- show: U.value && W.value === "selectAndGroup",
2162
- x: G.value.x,
2163
- y: G.value.y - 6,
2164
- placement: "top",
2165
- styleObject: X.value
2166
- }, {
2167
- default: S(() => [h(x(K.value.translations.tooltipGroup) + " ", 1), t[94] ||= m("kbd", null, "G", -1)]),
2168
- _: 1
2169
- }, 8, [
2170
- "show",
2171
- "x",
2172
- "y",
2173
- "styleObject"
2174
- ])) : f("", !0)], 46, Ae),
2175
- m("button", {
2176
- disabled: L.value.length === 0,
2177
- style: _({
2178
- background: q.value.controls.backgroundColor,
2179
- border: q.value.controls.border,
2180
- color: q.value.controls.color,
2181
- borderRadius: `${q.value.borderRadius}px`,
2182
- cursor: Y.value ? "pointer" : "default"
2183
- }),
2184
- class: g({
2185
- "button-tool": !0,
2186
- tooltip: !0
2187
- }),
2188
- onClick: t[12] ||= (e) => {
2189
- A.value = !1, k.value = !0, D.value = !1, O.value = !1, j.value = !1, N.value = !1, P.value = !1, z.value = !1, Wn("front");
2190
- },
2191
- onMouseenter: t[13] ||= (e) => J.value.showTooltips && Q("bringToFront", e, "top"),
2192
- onMouseleave: $,
2193
- onFocus: t[14] ||= (e) => J.value.showTooltips && Q("bringToFront", e, "top"),
2194
- onBlur: $
2195
- }, [b(e.$slots, "icon-bring-to-front", {}, () => [oe(u, {
2196
- name: "bringToFront",
2197
- stroke: q.value.controls.color
2198
- }, null, 8, ["stroke"])], !0), J.value.showTooltips ? (v(), d(C, {
2199
- key: 0,
2200
- show: U.value && W.value === "bringToFront",
2201
- x: G.value.x,
2202
- y: G.value.y - 6,
2203
- placement: "top",
2204
- styleObject: X.value
2205
- }, {
2206
- default: S(() => [h(x(K.value.translations.tooltipBringToFront), 1)]),
2207
- _: 1
2208
- }, 8, [
2209
- "show",
2210
- "x",
2211
- "y",
2212
- "styleObject"
2213
- ])) : f("", !0)], 44, je),
2214
- m("button", {
2215
- disabled: L.value.length === 0,
2216
- style: _({
2217
- background: q.value.controls.backgroundColor,
2218
- border: q.value.controls.border,
2219
- color: q.value.controls.color,
2220
- borderRadius: `${q.value.borderRadius}px`,
2221
- cursor: Y.value ? "pointer" : "default"
2222
- }),
2223
- class: g({
2224
- "button-tool": !0,
2225
- tooltip: !0
2226
- }),
2227
- onClick: t[15] ||= (e) => {
2228
- A.value = !1, k.value = !0, D.value = !1, O.value = !1, j.value = !1, N.value = !1, P.value = !1, z.value = !1, Wn("back");
2229
- },
2230
- onMouseenter: t[16] ||= (e) => J.value.showTooltips && Q("bringToBack", e, "top"),
2231
- onMouseleave: $,
2232
- onFocus: t[17] ||= (e) => J.value.showTooltips && Q("bringToBack", e, "top"),
2233
- onBlur: $
2234
- }, [b(e.$slots, "icon-bring-to-back", {}, () => [oe(u, {
2235
- name: "bringToBack",
2236
- stroke: q.value.controls.color
2237
- }, null, 8, ["stroke"])], !0), J.value.showTooltips ? (v(), d(C, {
2238
- key: 0,
2239
- show: U.value && W.value === "bringToBack",
2240
- x: G.value.x,
2241
- y: G.value.y - 6,
2242
- placement: "top",
2243
- styleObject: X.value
2244
- }, {
2245
- default: S(() => [h(x(K.value.translations.tooltipBringToBack), 1)]),
2246
- _: 1
2247
- }, 8, [
2248
- "show",
2249
- "x",
2250
- "y",
2251
- "styleObject"
2252
- ])) : f("", !0)], 44, Me),
2253
- m("button", {
2254
- disabled: L.value.length === 0 || w.value === "line",
2255
- style: _({
2256
- background: q.value.controls.backgroundColor,
2257
- border: q.value.controls.border,
2258
- color: q.value.controls.color,
2259
- borderRadius: `${q.value.borderRadius}px`,
2260
- cursor: Y.value ? "pointer" : "default"
2261
- }),
2262
- class: g({
2263
- "button-tool": !0,
2264
- tooltip: !0
2265
- }),
2266
- onClick: t[18] ||= (e) => {
2267
- Zn(), A.value = !1, k.value = !0, D.value = !1, O.value = !1, j.value = !1, N.value = !1, P.value = !1, z.value = !1, Gn();
2268
- },
2269
- onMouseenter: t[19] ||= (e) => J.value.showTooltips && Q("duplicate", e, "top"),
2270
- onMouseleave: $,
2271
- onFocus: t[20] ||= (e) => J.value.showTooltips && Q("duplicate", e, "top"),
2272
- onBlur: $
2273
- }, [b(e.$slots, "icon-copy", {}, () => [oe(u, {
2274
- name: "copy",
2275
- stroke: q.value.controls.color,
2276
- size: 18
2277
- }, null, 8, ["stroke"])], !0), J.value.showTooltips ? (v(), d(C, {
2278
- key: 0,
2279
- show: U.value && W.value === "duplicate",
2280
- x: G.value.x,
2281
- y: G.value.y - 6,
2282
- placement: "top",
2283
- styleObject: X.value
2284
- }, {
2285
- default: S(() => [h(x(K.value.translations.tooltipDuplicate), 1)]),
2286
- _: 1
2287
- }, 8, [
2288
- "show",
2289
- "x",
2290
- "y",
2291
- "styleObject"
2292
- ])) : f("", !0)], 44, Ne),
2293
- m("button", {
2294
- disabled: fn.value.undo === 0,
2295
- style: _({
2296
- background: q.value.controls.backgroundColor,
2297
- border: q.value.controls.border,
2298
- color: q.value.controls.color,
2299
- borderRadius: `${q.value.borderRadius}px`,
2300
- cursor: Y.value ? "pointer" : "default"
2301
- }),
2302
- class: g({
2303
- "button-tool": !0,
2304
- "button-tool--one-shot": !0,
2305
- tooltip: !0
2306
- }),
2307
- onClick: t[21] ||= (e) => {
2308
- A.value = !1, k.value = !1, D.value = !1, O.value = !1, j.value = !1, N.value = !1, P.value = !1, w.value = void 0, z.value = !1, nr();
2309
- },
2310
- onMouseenter: t[22] ||= (e) => J.value.showTooltips && Q("undoLast", e, "top"),
2311
- onMouseleave: $,
2312
- onFocus: t[23] ||= (e) => J.value.showTooltips && Q("undoLast", e, "top"),
2313
- onBlur: $
2314
- }, [b(e.$slots, "icon-undo", {}, () => [oe(u, {
2315
- name: "refresh",
2316
- stroke: q.value.controls.color,
2317
- size: 20
2318
- }, null, 8, ["stroke"])], !0), J.value.showTooltips ? (v(), d(C, {
2319
- key: 0,
2320
- show: U.value && W.value === "undoLast",
2321
- x: G.value.x,
2322
- y: G.value.y - 6,
2323
- placement: "top",
2324
- styleObject: X.value
2325
- }, {
2326
- default: S(() => [
2327
- h(x(K.value.translations.tooltipUndo) + " ", 1),
2328
- m("kbd", null, x(un.value ? "⌘" : "Ctrl"), 1),
2329
- t[95] ||= m("kbd", null, "Z", -1)
2330
- ]),
2331
- _: 1
2332
- }, 8, [
2333
- "show",
2334
- "x",
2335
- "y",
2336
- "styleObject"
2337
- ])) : f("", !0)], 44, Pe),
2338
- m("button", {
2339
- disabled: fn.value.redo === 0,
2340
- style: _({
2341
- background: q.value.controls.backgroundColor,
2342
- border: q.value.controls.border,
2343
- color: q.value.controls.color,
2344
- borderRadius: `${q.value.borderRadius}px`,
2345
- cursor: Y.value ? "pointer" : "default"
2346
- }),
2347
- class: g({
2348
- "button-tool": !0,
2349
- "button-tool--one-shot": !0,
2350
- tooltip: !0
2351
- }),
2352
- onClick: t[24] ||= (e) => {
2353
- A.value = !1, k.value = !1, D.value = !1, O.value = !1, j.value = !1, N.value = !1, P.value = !1, w.value = void 0, z.value = !1, rr();
2354
- },
2355
- onMouseenter: t[25] ||= (e) => J.value.showTooltips && Q("redoLast", e, "top"),
2356
- onMouseleave: $,
2357
- onFocus: t[26] ||= (e) => J.value.showTooltips && Q("redoLast", e, "top"),
2358
- onBlur: $
2359
- }, [b(e.$slots, "icon-redo", {}, () => [oe(u, {
2360
- name: "refresh",
2361
- stroke: q.value.controls.color,
2362
- size: 20,
2363
- style: { transform: "rotateX(0deg) rotateY(180deg)" }
2364
- }, null, 8, ["stroke"])], !0), J.value.showTooltips ? (v(), d(C, {
2365
- key: 0,
2366
- show: U.value && W.value === "redoLast",
2367
- x: G.value.x,
2368
- y: G.value.y - 6,
2369
- placement: "top",
2370
- styleObject: X.value
2371
- }, {
2372
- default: S(() => [
2373
- h(x(K.value.translations.tooltipRedo) + " ", 1),
2374
- m("kbd", null, x(un.value ? "⌘" : "Ctrl"), 1),
2375
- t[96] ||= m("kbd", null, "Y", -1)
2376
- ]),
2377
- _: 1
2378
- }, 8, [
2379
- "show",
2380
- "x",
2381
- "y",
2382
- "styleObject"
2383
- ])) : f("", !0)], 44, Fe),
2384
- J.value.showPrint ? (v(), p("button", {
2385
- key: 0,
2386
- style: _({
2387
- background: q.value.controls.backgroundColor,
2388
- border: q.value.controls.border,
2389
- color: q.value.controls.color,
2390
- borderRadius: `${q.value.borderRadius}px`,
2391
- cursor: Y.value ? "pointer" : "default"
2392
- }),
2393
- class: g({
2394
- "button-tool": !0,
2395
- tooltip: !0
2396
- }),
2397
- onClick: Er,
2398
- onMouseenter: t[27] ||= (e) => J.value.showTooltips && Q("printPdf", e, "top"),
2399
- onMouseleave: $,
2400
- onFocus: t[28] ||= (e) => J.value.showTooltips && Q("printPdf", e, "top"),
2401
- onBlur: $
2402
- }, [b(e.$slots, "icon-print", {}, () => [oe(u, {
2403
- name: "printer",
2404
- stroke: q.value.controls.color
2405
- }, null, 8, ["stroke"])], !0), J.value.showTooltips ? (v(), d(C, {
2406
- key: 0,
2407
- show: U.value && W.value === "printPdf",
2408
- x: G.value.x,
2409
- y: G.value.y - 6,
2410
- placement: "top",
2411
- styleObject: X.value
2412
- }, {
2413
- default: S(() => [h(x(K.value.translations.tooltipPdf), 1)]),
2414
- _: 1
2415
- }, 8, [
2416
- "show",
2417
- "x",
2418
- "y",
2419
- "styleObject"
2420
- ])) : f("", !0)], 36)) : f("", !0),
2421
- J.value.showImage ? (v(), p("button", {
2422
- key: 1,
2423
- style: _({
2424
- background: q.value.controls.backgroundColor,
2425
- border: q.value.controls.border,
2426
- color: q.value.controls.color,
2427
- borderRadius: `${q.value.borderRadius}px`,
2428
- cursor: Y.value ? "pointer" : "default"
2429
- }),
2430
- class: g({
2431
- "button-tool": !0,
2432
- tooltip: !0
2433
- }),
2434
- onClick: t[29] ||= (...e) => pe(jt) && pe(jt)(...e),
2435
- onMouseenter: t[30] ||= (e) => J.value.showTooltips && Q("printImage", e, "top"),
2436
- onMouseleave: $,
2437
- onFocus: t[31] ||= (e) => J.value.showTooltips && Q("printImage", e, "top"),
2438
- onBlur: $
2439
- }, [b(e.$slots, "icon-export-image", {}, () => [oe(u, {
2440
- name: "image",
2441
- stroke: q.value.controls.color,
2442
- size: 20
2443
- }, null, 8, ["stroke"])], !0), J.value.showTooltips ? (v(), d(C, {
2444
- key: 0,
2445
- show: U.value && W.value === "printImage",
2446
- x: G.value.x,
2447
- y: G.value.y - 6,
2448
- placement: "top",
2449
- styleObject: X.value
2450
- }, {
2451
- default: S(() => [h(x(K.value.translations.tooltipImage), 1)]),
2452
- _: 1
2453
- }, 8, [
2454
- "show",
2455
- "x",
2456
- "y",
2457
- "styleObject"
2458
- ])) : f("", !0)], 36)) : f("", !0),
2459
- J.value.showSave ? (v(), p("button", {
2460
- key: 2,
2461
- style: _({
2462
- background: q.value.controls.backgroundColor,
2463
- border: q.value.controls.border,
2464
- color: q.value.controls.color,
2465
- borderRadius: `${q.value.borderRadius}px`,
2466
- cursor: Y.value ? "pointer" : "default"
2467
- }),
2468
- class: g({
2469
- "button-tool": !0,
2470
- tooltip: !0
2471
- }),
2472
- onClick: Rr,
2473
- onMouseenter: t[32] ||= (e) => J.value.showTooltips && Q("saveAction", e, "top"),
2474
- onMouseleave: $,
2475
- onFocus: t[33] ||= (e) => J.value.showTooltips && Q("saveAction", e, "top"),
2476
- onBlur: $
2477
- }, [b(e.$slots, "icon-save", {}, () => [oe(u, {
2478
- name: "save",
2479
- stroke: q.value.controls.color
2480
- }, null, 8, ["stroke"])], !0), J.value.showTooltips ? (v(), d(C, {
2481
- key: 0,
2482
- show: U.value && W.value === "saveAction",
2483
- x: G.value.x,
2484
- y: G.value.y - 6,
2485
- placement: "top",
2486
- styleObject: X.value
2487
- }, {
2488
- default: S(() => [h(x(K.value.translations.tooltipSave), 1)]),
2489
- _: 1
2490
- }, 8, [
2491
- "show",
2492
- "x",
2493
- "y",
2494
- "styleObject"
2495
- ])) : f("", !0)], 36)) : f("", !0)
2496
- ]), m("div", Ie, [
2497
- m("button", {
2498
- class: g({
2499
- "button-tool": !0,
2500
- "button-tool--selected": w.value === "circle",
2501
- tooltip: !0
2502
- }),
2503
- style: _({
2504
- background: w.value === "circle" ? q.value.shapes.selected.backgroundColor : q.value.shapes.backgroundColor,
2505
- border: w.value === "circle" ? q.value.shapes.selected.border : q.value.shapes.border,
2506
- color: w.value === "circle" ? q.value.shapes.selected.color : q.value.shapes.color,
2507
- borderRadius: `${q.value.borderRadius}px`,
2508
- cursor: Y.value ? "pointer" : "default"
2509
- }),
2510
- onClick: t[34] ||= (e) => {
2511
- Ir("circle"), j.value = !1;
2512
- },
2513
- onMouseenter: t[35] ||= (e) => J.value.showTooltips && Q("setCircle", e, "top"),
2514
- onMouseleave: $,
2515
- onFocus: t[36] ||= (e) => J.value.showTooltips && Q("setCircle", e, "top"),
2516
- onBlur: $
2517
- }, [b(e.$slots, "icon-circle", le(se({ filled: R.value.circle.filled })), () => [(v(), p("svg", Le, [m("circle", {
2518
- cx: 6,
2519
- cy: 6,
2520
- r: "4",
2521
- fill: R.value.circle.filled ? (w.value, hn.value + _n.value) : "none",
2522
- stroke: "currentColor"
2523
- }, null, 8, Re)]))], !0), J.value.showTooltips ? (v(), d(C, {
2524
- key: 0,
2525
- show: U.value && W.value === "setCircle",
2526
- x: G.value.x,
2527
- y: G.value.y - 6,
2528
- placement: "top",
2529
- styleObject: X.value
2530
- }, {
2531
- default: S(() => [h(x(K.value.translations.tooltipShapeCircle) + " ", 1), t[97] ||= m("kbd", null, "C", -1)]),
2532
- _: 1
2533
- }, 8, [
2534
- "show",
2535
- "x",
2536
- "y",
2537
- "styleObject"
2538
- ])) : f("", !0)], 38),
2539
- w.value === "circle" ? (v(), p("div", ze, [m("label", Be, [h(x(K.value.translations.filled) + " ", 1), _e(m("input", {
2540
- type: "checkbox",
2541
- "onUpdate:modelValue": t[37] ||= (e) => R.value.circle.filled = e,
2542
- onChange: kr,
2543
- checked: R.value.circle.filled,
2544
- style: _({
2545
- all: "revert",
2546
- appearance: "auto",
2547
- "-webkit-appearance": "auto",
2548
- accentColor: J.value.color + " !important"
2549
- })
2550
- }, null, 44, Ve), [[me, R.value.circle.filled]])])])) : f("", !0),
2551
- m("button", {
2552
- class: g({
2553
- "button-tool": !0,
2554
- "button-tool--selected": w.value === "rect",
2555
- tooltip: !0
2556
- }),
2557
- style: _({
2558
- background: w.value === "rect" ? q.value.shapes.selected.backgroundColor : q.value.shapes.backgroundColor,
2559
- border: w.value === "rect" ? q.value.shapes.selected.border : q.value.shapes.border,
2560
- color: w.value === "rect" ? q.value.shapes.selected.color : q.value.shapes.color,
2561
- borderRadius: `${q.value.borderRadius}px`,
2562
- cursor: Y.value ? "pointer" : "default"
2563
- }),
2564
- onClick: t[38] ||= (e) => {
2565
- Ir("rect"), j.value = !1;
2566
- },
2567
- onMouseenter: t[39] ||= (e) => J.value.showTooltips && Q("setRect", e, "top"),
2568
- onMouseleave: $,
2569
- onFocus: t[40] ||= (e) => J.value.showTooltips && Q("setRect", e, "top"),
2570
- onBlur: $
2571
- }, [b(e.$slots, "icon-rect", le(se({ filled: R.value.rect.filled })), () => [(v(), p("svg", He, [m("rect", {
2572
- x: "3",
2573
- y: "3",
2574
- style: {
2575
- rx: "0 !important",
2576
- ry: "0 !important"
2577
- },
2578
- height: "6",
2579
- width: "6",
2580
- fill: R.value.rect.filled ? (w.value, hn.value + _n.value) : "none",
2581
- stroke: "currentColor"
2582
- }, null, 8, Ue)]))], !0), J.value.showTooltips ? (v(), d(C, {
2583
- key: 0,
2584
- show: U.value && W.value === "setRect",
2585
- x: G.value.x,
2586
- y: G.value.y - 6,
2587
- placement: "top",
2588
- styleObject: X.value
2589
- }, {
2590
- default: S(() => [h(x(K.value.translations.tooltipShapeRect) + " ", 1), t[98] ||= m("kbd", null, "S", -1)]),
2591
- _: 1
2592
- }, 8, [
2593
- "show",
2594
- "x",
2595
- "y",
2596
- "styleObject"
2597
- ])) : f("", !0)], 38),
2598
- w.value === "rect" ? (v(), p("div", We, [m("label", Ge, [h(x(K.value.translations.filled) + " ", 1), _e(m("input", {
2599
- type: "checkbox",
2600
- "onUpdate:modelValue": t[41] ||= (e) => R.value.rect.filled = e,
2601
- onChange: Or,
2602
- checked: R.value.rect.filled,
2603
- style: _({
2604
- all: "revert",
2605
- appearance: "auto",
2606
- "-webkit-appearance": "auto",
2607
- accentColor: J.value.color + " !important"
2608
- })
2609
- }, null, 44, Ke), [[me, R.value.rect.filled]])])])) : f("", !0),
2610
- m("button", {
2611
- class: g({
2612
- "button-tool": !0,
2613
- "button-tool--selected": w.value === "arrow",
2614
- tooltip: !0
2615
- }),
2616
- style: _({
2617
- background: w.value === "arrow" ? q.value.shapes.selected.backgroundColor : q.value.shapes.backgroundColor,
2618
- border: w.value === "arrow" ? q.value.shapes.selected.border : q.value.shapes.border,
2619
- color: w.value === "arrow" ? q.value.shapes.selected.color : q.value.shapes.color,
2620
- borderRadius: `${q.value.borderRadius}px`,
2621
- cursor: Y.value ? "pointer" : "default"
2622
- }),
2623
- onClick: t[42] ||= (e) => {
2624
- Ir("arrow"), j.value = !1;
2625
- },
2626
- onMouseenter: t[43] ||= (e) => J.value.showTooltips && Q("setArrow", e, "top"),
2627
- onMouseleave: $,
2628
- onFocus: t[44] ||= (e) => J.value.showTooltips && Q("setArrow", e, "top"),
2629
- onBlur: $
2630
- }, [b(e.$slots, "icon-arrow", {}, () => [(v(), p("svg", qe, [m("path", {
2631
- stroke: R.value.arrow.filled ? w.value === "arrow" ? "white" : "grey" : "none",
2632
- "stroke-width": "2",
2633
- d: "M5,19 19,5 14,5 19,10.5 19,5",
2634
- fill: "none",
2635
- "stroke-linecap": "round",
2636
- "stroke-linejoin": "round"
2637
- }, null, 8, Je)]))], !0), J.value.showTooltips ? (v(), d(C, {
2638
- key: 0,
2639
- show: U.value && W.value === "setArrow",
2640
- x: G.value.x,
2641
- y: G.value.y - 6,
2642
- placement: "top",
2643
- styleObject: X.value
2644
- }, {
2645
- default: S(() => [h(x(K.value.translations.tooltipShapeArrow) + " ", 1), t[99] ||= m("kbd", null, "A", -1)]),
2646
- _: 1
2647
- }, 8, [
2648
- "show",
2649
- "x",
2650
- "y",
2651
- "styleObject"
2652
- ])) : f("", !0)], 38),
2653
- m("button", {
2654
- class: g({
2655
- "button-tool": !0,
2656
- "button-tool--selected": w.value === "line",
2657
- tooltip: !0
2658
- }),
2659
- style: _({
2660
- background: w.value === "line" ? q.value.shapes.selected.backgroundColor : q.value.shapes.backgroundColor,
2661
- border: w.value === "line" ? q.value.shapes.selected.border : q.value.shapes.border,
2662
- color: w.value === "line" ? q.value.shapes.selected.color : q.value.shapes.color,
2663
- borderRadius: `${q.value.borderRadius}px`,
2664
- cursor: Y.value ? "pointer" : "default"
2665
- }),
2666
- onClick: t[45] ||= (e) => {
2667
- Ir("line"), j.value = !1;
2668
- },
2669
- onMouseenter: t[46] ||= (e) => J.value.showTooltips && Q("setFreehand", e, "top"),
2670
- onMouseleave: $,
2671
- onFocus: t[47] ||= (e) => J.value.showTooltips && Q("setFreehand", e, "top"),
2672
- onBlur: $
2673
- }, [b(e.$slots, "icon-freehand", {}, () => [t[100] ||= m("svg", {
2674
- width: "80%",
2675
- viewBox: "0 0 24 24",
2676
- "stroke-width": "2",
2677
- stroke: "currentColor",
2678
- fill: "none",
2679
- "stroke-linecap": "round",
2680
- "stroke-linejoin": "round"
2681
- }, [m("path", {
2682
- stroke: "none",
2683
- d: "M0 0h24v24H0z",
2684
- fill: "none"
2685
- }), m("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" })], -1)], !0), J.value.showTooltips ? (v(), d(C, {
2686
- key: 0,
2687
- show: U.value && W.value === "setFreehand",
2688
- x: G.value.x,
2689
- y: G.value.y - 6,
2690
- placement: "top",
2691
- styleObject: X.value
2692
- }, {
2693
- default: S(() => [h(x(K.value.translations.tooltipShapeFreehand) + " ", 1), t[101] ||= m("kbd", null, "L", -1)]),
2694
- _: 1
2695
- }, 8, [
2696
- "show",
2697
- "x",
2698
- "y",
2699
- "styleObject"
2700
- ])) : f("", !0)], 38),
2701
- [
2702
- "arrow",
2703
- "circle",
2704
- "rect",
2705
- "line"
2706
- ].includes(w.value) ? (v(), p("div", Ye, [m("div", Xe, [m("label", Ze, [h(x(K.value.translations.thickness) + " ", 1), _e(m("input", {
2707
- type: "number",
2708
- "onUpdate:modelValue": t[48] ||= (e) => Mt.value = e,
2709
- onInput: Nr,
2710
- min: 1,
2711
- style: {
2712
- padding: "0 4px",
2713
- width: "40px",
2714
- border: "1px solid #dadada",
2715
- "border-radius": "3px"
2716
- }
2717
- }, null, 544), [[he, Mt.value]])])])])) : f("", !0),
2718
- [
2719
- "arrow",
2720
- "circle",
2721
- "rect"
2722
- ].includes(w.value) ? (v(), p("div", Qe, [m("div", $e, [m("label", et, [h(x(K.value.translations.dashedLines) + " ", 1), _e(m("input", {
2723
- name: "dashStyle",
2724
- type: "checkbox",
2725
- "onUpdate:modelValue": t[49] ||= (e) => It.value = e,
2726
- onChange: jr,
2727
- checked: It.value,
2728
- style: _({
2729
- all: "revert",
2730
- appearance: "auto",
2731
- "-webkit-appearance": "auto",
2732
- accentColor: J.value.color + " !important"
2733
- })
2734
- }, null, 44, tt), [[me, It.value]])])])])) : f("", !0),
2735
- m("button", {
2736
- class: g({
2737
- "button-tool": !0,
2738
- "button-tool--selected": N.value,
2739
- tooltip: !0
2740
- }),
2741
- style: _({
2742
- background: N.value ? q.value.shapes.selected.backgroundColor : q.value.shapes.backgroundColor,
2743
- border: N.value ? q.value.shapes.selected.border : q.value.shapes.border,
2744
- color: N.value ? q.value.shapes.selected.color : q.value.shapes.color,
2745
- borderRadius: `${q.value.borderRadius}px`,
2746
- cursor: Y.value ? "pointer" : "default"
2747
- }),
2748
- onClick: t[50] ||= (e) => {
2749
- Zn(), N.value = !N.value, D.value = !1, k.value = !1, A.value = !1, j.value = !1, O.value = !1, w.value = void 0;
2750
- },
2751
- onMouseenter: t[51] ||= (e) => J.value.showTooltips && Q("setText", e, "top"),
2752
- onMouseleave: $,
2753
- onFocus: t[52] ||= (e) => J.value.showTooltips && Q("setText", e, "top"),
2754
- onBlur: $
2755
- }, [b(e.$slots, "icon-text", le(se({ active: N.value })), () => [oe(u, {
2756
- name: "text",
2757
- stroke: N.value ? q.value.shapes.selected.color : q.value.shapes.color
2758
- }, null, 8, ["stroke"])], !0), J.value.showTooltips ? (v(), d(C, {
2759
- key: 0,
2760
- show: U.value && W.value === "setText",
2761
- x: G.value.x,
2762
- y: G.value.y - 6,
2763
- placement: "top",
2764
- styleObject: X.value
2765
- }, {
2766
- default: S(() => [h(x(K.value.translations.tooltipShapeText) + " ", 1), t[102] ||= m("kbd", null, "T", -1)]),
2767
- _: 1
2768
- }, 8, [
2769
- "show",
2770
- "x",
2771
- "y",
2772
- "styleObject"
2773
- ])) : f("", !0)], 38),
2774
- N.value ? (v(), p("div", nt, [m("div", rt, [m("label", it, [h(x(K.value.translations.fontSize) + " ", 1), _e(m("input", {
2775
- type: "number",
2776
- "onUpdate:modelValue": t[53] ||= (e) => Qt.value = e,
2777
- onInput: Pr,
2778
- style: {
2779
- padding: "0 4px",
2780
- width: "40px",
2781
- border: "1px solid #dadada",
2782
- "border-radius": "3px"
2783
- }
2784
- }, null, 544), [[he, Qt.value]])])])])) : f("", !0),
2785
- N.value ? (v(), p("div", at, [m("button", {
2786
- class: g({
2787
- "button-tool": !0,
2788
- "button-tool--selected": B.value === "start",
2789
- tooltip: !0
2790
- }),
2791
- style: _({
2792
- background: B.value === "start" ? q.value.shapes.selected.backgroundColor : q.value.shapes.backgroundColor,
2793
- border: B.value === "start" ? q.value.shapes.selected.border : q.value.shapes.border,
2794
- color: B.value === "start" ? q.value.shapes.selected.color : q.value.shapes.color,
2795
- borderRadius: `${q.value.borderRadius}px`,
2796
- cursor: Y.value ? "pointer" : "default"
2797
- }),
2798
- onClick: t[54] ||= (e) => {
2799
- D.value = !1, k.value = !1, A.value = !1, O.value = !1, j.value = !1, w.value = void 0, B.value = "start", tr("start");
2800
- },
2801
- onMouseenter: t[55] ||= (e) => J.value.showTooltips && Q("setAlignStart", e, "top"),
2802
- onMouseleave: $,
2803
- onFocus: t[56] ||= (e) => J.value.showTooltips && Q("setAlignStart", e, "top"),
2804
- onBlur: $
2805
- }, [b(e.$slots, "icon-text-align-left", {}, () => [t[103] ||= m("svg", {
2806
- width: "80%",
2807
- viewBox: "0 0 24 24",
2808
- "stroke-width": "2",
2809
- stroke: "currentColor",
2810
- fill: "none",
2811
- "stroke-linecap": "round",
2812
- "stroke-linejoin": "round"
2813
- }, [
2814
- m("path", {
2815
- stroke: "none",
2816
- d: "M0 0h24v24H0z",
2817
- fill: "none"
2818
- }),
2819
- m("path", { d: "M4 6l16 0" }),
2820
- m("path", { d: "M4 12l10 0" }),
2821
- m("path", { d: "M4 18l14 0" })
2822
- ], -1)], !0), J.value.showTooltips ? (v(), d(C, {
2823
- key: 0,
2824
- show: U.value && W.value === "setAlignStart",
2825
- x: G.value.x,
2826
- y: G.value.y - 6,
2827
- placement: "top",
2828
- styleObject: X.value
2829
- }, {
2830
- default: S(() => [h(x(K.value.translations.tooltipShapeTextLeft), 1)]),
2831
- _: 1
2832
- }, 8, [
2833
- "show",
2834
- "x",
2835
- "y",
2836
- "styleObject"
2837
- ])) : f("", !0)], 38)])) : f("", !0),
2838
- N.value ? (v(), p("div", ot, [m("button", {
2839
- class: g({
2840
- "button-tool": !0,
2841
- "button-tool--selected": B.value === "middle",
2842
- tooltip: !0
2843
- }),
2844
- style: _({
2845
- background: B.value === "middle" ? q.value.shapes.selected.backgroundColor : q.value.shapes.backgroundColor,
2846
- border: B.value === "middle" ? q.value.shapes.selected.border : q.value.shapes.border,
2847
- color: B.value === "middle" ? q.value.shapes.selected.color : q.value.shapes.color,
2848
- borderRadius: `${q.value.borderRadius}px`,
2849
- cursor: Y.value ? "pointer" : "default"
2850
- }),
2851
- disabled: Ft.value,
2852
- onClick: t[57] ||= (e) => {
2853
- D.value = !1, k.value = !1, A.value = !1, O.value = !1, j.value = !1, w.value = void 0, B.value = "middle", tr("middle");
2854
- },
2855
- onMouseenter: t[58] ||= (e) => J.value.showTooltips && Q("setAlignMiddle", e, "top"),
2856
- onMouseleave: $,
2857
- onFocus: t[59] ||= (e) => J.value.showTooltips && Q("setAlignMiddle", e, "top"),
2858
- onBlur: $
2859
- }, [b(e.$slots, "icon-text-align-center", {}, () => [t[104] ||= m("svg", {
2860
- width: "80%",
2861
- viewBox: "0 0 24 24",
2862
- "stroke-width": "2",
2863
- stroke: "currentColor",
2864
- fill: "none",
2865
- "stroke-linecap": "round",
2866
- "stroke-linejoin": "round"
2867
- }, [
2868
- m("path", {
2869
- stroke: "none",
2870
- d: "M0 0h24v24H0z",
2871
- fill: "none"
2872
- }),
2873
- m("path", { d: "M4 6l16 0" }),
2874
- m("path", { d: "M8 12l8 0" }),
2875
- m("path", { d: "M6 18l12 0" })
2876
- ], -1)], !0), J.value.showTooltips ? (v(), d(C, {
2877
- key: 0,
2878
- show: U.value && W.value === "setAlignMiddle",
2879
- x: G.value.x,
2880
- y: G.value.y - 6,
2881
- placement: "top",
2882
- styleObject: X.value
2883
- }, {
2884
- default: S(() => [h(x(K.value.translations.tooltipShapeTextCenter), 1)]),
2885
- _: 1
2886
- }, 8, [
2887
- "show",
2888
- "x",
2889
- "y",
2890
- "styleObject"
2891
- ])) : f("", !0)], 46, st)])) : f("", !0),
2892
- N.value ? (v(), p("div", ct, [m("button", {
2893
- class: g({
2894
- "button-tool": !0,
2895
- "button-tool--selected": B.value === "end",
2896
- tooltip: !0
2897
- }),
2898
- style: _({
2899
- background: B.value === "end" ? q.value.shapes.selected.backgroundColor : q.value.shapes.backgroundColor,
2900
- border: B.value === "end" ? q.value.shapes.selected.border : q.value.shapes.border,
2901
- color: B.value === "end" ? q.value.shapes.selected.color : q.value.shapes.color,
2902
- borderRadius: `${q.value.borderRadius}px`,
2903
- cursor: Y.value ? "pointer" : "default"
2904
- }),
2905
- disabled: Ft.value,
2906
- onClick: t[60] ||= (e) => {
2907
- D.value = !1, k.value = !1, A.value = !1, O.value = !1, j.value = !1, w.value = void 0, B.value = "end", tr("end");
2908
- },
2909
- onMouseenter: t[61] ||= (e) => J.value.showTooltips && Q("setAlignEnd", e, "top"),
2910
- onMouseleave: $,
2911
- onFocus: t[62] ||= (e) => J.value.showTooltips && Q("setAlignEnd", e, "top"),
2912
- onBlur: $
2913
- }, [b(e.$slots, "icon-text-align-right", {}, () => [t[105] ||= m("svg", {
2914
- width: "80%",
2915
- viewBox: "0 0 24 24",
2916
- "stroke-width": "2",
2917
- stroke: "currentColor",
2918
- fill: "none",
2919
- "stroke-linecap": "round",
2920
- "stroke-linejoin": "round"
2921
- }, [
2922
- m("path", {
2923
- stroke: "none",
2924
- d: "M0 0h24v24H0z",
2925
- fill: "none"
2926
- }),
2927
- m("path", { d: "M4 6l16 0" }),
2928
- m("path", { d: "M10 12l10 0" }),
2929
- m("path", { d: "M6 18l14 0" })
2930
- ], -1)], !0), J.value.showTooltips ? (v(), d(C, {
2931
- key: 0,
2932
- show: U.value && W.value === "setAlignEnd",
2933
- x: G.value.x,
2934
- y: G.value.y - 6,
2935
- placement: "top",
2936
- styleObject: X.value
2937
- }, {
2938
- default: S(() => [h(x(K.value.translations.tooltipShapeTextRight), 1)]),
2939
- _: 1
2940
- }, 8, [
2941
- "show",
2942
- "x",
2943
- "y",
2944
- "styleObject"
2945
- ])) : f("", !0)], 46, lt)])) : f("", !0),
2946
- N.value ? (v(), p("div", ut, [m("button", {
2947
- class: g({
2948
- "button-tool": !0,
2949
- "button-tool--selected": Ft.value,
2950
- tooltip: !0
2951
- }),
2952
- style: _({
2953
- background: Ft.value ? q.value.shapes.selected.backgroundColor : q.value.shapes.backgroundColor,
2954
- border: Ft.value ? q.value.shapes.selected.border : q.value.shapes.border,
2955
- color: Ft.value ? q.value.shapes.selected.color : q.value.shapes.color,
2956
- borderRadius: `${q.value.borderRadius}px`,
2957
- cursor: Y.value ? "pointer" : "default"
2958
- }),
2959
- onClick: t[63] ||= (e) => {
2960
- D.value = !1, k.value = !1, A.value = !1, O.value = !1, j.value = !1, w.value = void 0, Ft.value = !Ft.value, B.value = "start", tr("start"), Pr();
2961
- },
2962
- onMouseenter: t[64] ||= (e) => J.value.showTooltips && Q("setBulletMode", e, "top"),
2963
- onMouseleave: $,
2964
- onFocus: t[65] ||= (e) => J.value.showTooltips && Q("setBulletMode", e, "top"),
2965
- onBlur: $
2966
- }, [b(e.$slots, "icon-text-bullet-points", {}, () => [t[106] ||= m("svg", {
2967
- width: "100%",
2968
- viewBox: "0 0 24 24",
2969
- "stroke-width": "2",
2970
- stroke: "currentColor",
2971
- fill: "none",
2972
- "stroke-linecap": "round",
2973
- "stroke-linejoin": "round"
2974
- }, [
2975
- m("path", {
2976
- stroke: "none",
2977
- d: "M0 0h24v24H0z",
2978
- fill: "none"
2979
- }),
2980
- m("path", { d: "M9 6l11 0" }),
2981
- m("path", { d: "M9 12l11 0" }),
2982
- m("path", { d: "M9 18l11 0" }),
2983
- m("path", { d: "M5 6l0 .01" }),
2984
- m("path", { d: "M5 12l0 .01" }),
2985
- m("path", { d: "M5 18l0 .01" })
2986
- ], -1)], !0), J.value.showTooltips ? (v(), d(C, {
2987
- key: 0,
2988
- show: U.value && W.value === "setBulletMode",
2989
- x: G.value.x,
2990
- y: G.value.y - 6,
2991
- placement: "top",
2992
- styleObject: X.value
2993
- }, {
2994
- default: S(() => [h(x(K.value.translations.tooltipShapeTextBullet), 1)]),
2995
- _: 1
2996
- }, 8, [
2997
- "show",
2998
- "x",
2999
- "y",
3000
- "styleObject"
3001
- ])) : f("", !0)], 38)])) : f("", !0),
3002
- N.value ? (v(), p("div", dt, [m("button", {
3003
- class: g({
3004
- "button-tool": !0,
3005
- "button-tool--selected": Pt.value,
3006
- tooltip: !0
3007
- }),
3008
- style: _({
3009
- background: Pt.value ? q.value.shapes.selected.backgroundColor : q.value.shapes.backgroundColor,
3010
- border: Pt.value ? q.value.shapes.selected.border : q.value.shapes.border,
3011
- color: Pt.value ? q.value.shapes.selected.color : q.value.shapes.color,
3012
- borderRadius: `${q.value.borderRadius}px`,
3013
- cursor: Y.value ? "pointer" : "default"
3014
- }),
3015
- onClick: t[66] ||= (e) => {
3016
- D.value = !1, k.value = !1, A.value = !1, O.value = !1, j.value = !1, w.value = void 0, Pt.value = !Pt.value, Pr();
3017
- },
3018
- onMouseenter: t[67] ||= (e) => J.value.showTooltips && Q("setBold", e, "top"),
3019
- onMouseleave: $,
3020
- onFocus: t[68] ||= (e) => J.value.showTooltips && Q("setBold", e, "top"),
3021
- onBlur: $
3022
- }, [b(e.$slots, "icon-text-bold", {}, () => [t[107] ||= m("svg", {
3023
- width: "100%",
3024
- viewBox: "0 0 24 24",
3025
- "stroke-width": "3",
3026
- stroke: "currentColor",
3027
- fill: "none",
3028
- "stroke-linecap": "round",
3029
- "stroke-linejoin": "round"
3030
- }, [
3031
- m("path", {
3032
- stroke: "none",
3033
- d: "M0 0h24v24H0z",
3034
- fill: "none"
3035
- }),
3036
- m("path", { d: "M7 5h6a3.5 3.5 0 0 1 0 7h-6z" }),
3037
- m("path", { d: "M13 12h1a3.5 3.5 0 0 1 0 7h-7v-7" })
3038
- ], -1)], !0), J.value.showTooltips ? (v(), d(C, {
3039
- key: 0,
3040
- show: U.value && W.value === "setBold",
3041
- x: G.value.x,
3042
- y: G.value.y - 6,
3043
- placement: "top",
3044
- styleObject: X.value
3045
- }, {
3046
- default: S(() => [h(x(K.value.translations.tooltipShapeTextBold), 1)]),
3047
- _: 1
3048
- }, 8, [
3049
- "show",
3050
- "x",
3051
- "y",
3052
- "styleObject"
3053
- ])) : f("", !0)], 38)])) : f("", !0),
3054
- N.value ? (v(), p("div", ft, [m("button", {
3055
- class: g({
3056
- "button-tool": !0,
3057
- "button-tool--selected": zt.value,
3058
- tooltip: !0
3059
- }),
3060
- style: _({
3061
- background: zt.value ? q.value.shapes.selected.backgroundColor : q.value.shapes.backgroundColor,
3062
- border: zt.value ? q.value.shapes.selected.border : q.value.shapes.border,
3063
- color: zt.value ? q.value.shapes.selected.color : q.value.shapes.color,
3064
- borderRadius: `${q.value.borderRadius}px`,
3065
- cursor: Y.value ? "pointer" : "default"
3066
- }),
3067
- onClick: t[69] ||= (e) => {
3068
- D.value = !1, k.value = !1, A.value = !1, O.value = !1, j.value = !1, w.value = void 0, zt.value = !zt.value, Pr();
3069
- },
3070
- onMouseenter: t[70] ||= (e) => J.value.showTooltips && Q("setItalic", e, "top"),
3071
- onMouseleave: $,
3072
- onFocus: t[71] ||= (e) => J.value.showTooltips && Q("setItalic", e, "top"),
3073
- onBlur: $
3074
- }, [b(e.$slots, "icon-text-italic", {}, () => [t[108] ||= m("svg", {
3075
- width: "100%",
3076
- height: "44",
3077
- viewBox: "0 0 24 24",
3078
- "stroke-width": "2",
3079
- stroke: "currentColor",
3080
- fill: "none",
3081
- "stroke-linecap": "round",
3082
- "stroke-linejoin": "round"
3083
- }, [
3084
- m("path", {
3085
- stroke: "none",
3086
- d: "M0 0h24v24H0z",
3087
- fill: "none"
3088
- }),
3089
- m("path", { d: "M11 5l6 0" }),
3090
- m("path", { d: "M7 19l6 0" }),
3091
- m("path", { d: "M14 5l-4 14" })
3092
- ], -1)], !0), J.value.showTooltips ? (v(), d(C, {
3093
- key: 0,
3094
- show: U.value && W.value === "setItalic",
3095
- x: G.value.x,
3096
- y: G.value.y - 6,
3097
- placement: "top",
3098
- styleObject: X.value
3099
- }, {
3100
- default: S(() => [h(x(K.value.translations.tooltipShapeTextItalic), 1)]),
3101
- _: 1
3102
- }, 8, [
3103
- "show",
3104
- "x",
3105
- "y",
3106
- "styleObject"
3107
- ])) : f("", !0)], 38)])) : f("", !0),
3108
- N.value ? (v(), p("div", pt, [m("button", {
3109
- class: g({
3110
- "button-tool": !0,
3111
- "button-tool--selected": Ht.value,
3112
- tooltip: !0
3113
- }),
3114
- style: _({
3115
- background: Ht.value ? q.value.shapes.selected.backgroundColor : q.value.shapes.backgroundColor,
3116
- border: Ht.value ? q.value.shapes.selected.border : q.value.shapes.border,
3117
- color: Ht.value ? q.value.shapes.selected.color : q.value.shapes.color,
3118
- borderRadius: `${q.value.borderRadius}px`,
3119
- cursor: Y.value ? "pointer" : "default"
3120
- }),
3121
- onClick: t[72] ||= (e) => {
3122
- D.value = !1, k.value = !1, A.value = !1, O.value = !1, j.value = !1, w.value = void 0, Ht.value = !Ht.value, Pr();
3123
- },
3124
- onMouseenter: t[73] ||= (e) => J.value.showTooltips && Q("setUnderline", e, "top"),
3125
- onMouseleave: $,
3126
- onFocus: t[74] ||= (e) => J.value.showTooltips && Q("setUnderline", e, "top"),
3127
- onBlur: $
3128
- }, [b(e.$slots, "icon-text-underline", {}, () => [t[109] ||= m("svg", {
3129
- width: "100%",
3130
- viewBox: "0 0 24 24",
3131
- "stroke-width": "2",
3132
- stroke: "currentColor",
3133
- fill: "none",
3134
- "stroke-linecap": "round",
3135
- "stroke-linejoin": "round"
3136
- }, [
3137
- m("path", {
3138
- stroke: "none",
3139
- d: "M0 0h24v24H0z",
3140
- fill: "none"
3141
- }),
3142
- m("path", { d: "M7 5v5a5 5 0 0 0 10 0v-5" }),
3143
- m("path", { d: "M5 19h14" })
3144
- ], -1)], !0), J.value.showTooltips ? (v(), d(C, {
3145
- key: 0,
3146
- show: U.value && W.value === "setUnderline",
3147
- x: G.value.x,
3148
- y: G.value.y - 6,
3149
- placement: "top",
3150
- styleObject: X.value
3151
- }, {
3152
- default: S(() => [h(x(K.value.translations.tooltipShapeTextUnderline), 1)]),
3153
- _: 1
3154
- }, 8, [
3155
- "show",
3156
- "x",
3157
- "y",
3158
- "styleObject"
3159
- ])) : f("", !0)], 38)])) : f("", !0),
3160
- m("div", mt, [m("button", {
3161
- class: g({
3162
- "button-tool": !0,
3163
- tooltip: !0
3164
- }),
3165
- style: { borderRadius: "6px" },
3166
- onMouseenter: t[77] ||= (e) => J.value.showTooltips && Q("setColor", e, "top"),
3167
- onMouseleave: $,
3168
- onFocus: t[78] ||= (e) => J.value.showTooltips && Q("setColor", e, "top"),
3169
- onBlur: $
3170
- }, [oe(ne, {
3171
- value: hn.value,
3172
- "onUpdate:value": [t[75] ||= (e) => hn.value = e, t[76] ||= (e) => Ar(e)],
3173
- backgroundColor: J.value.backgroundColor,
3174
- buttonBorderColor: J.value.color,
3175
- isCursorPointer: Y.value,
3176
- palette: J.value.palette,
3177
- teleported: ""
3178
- }, {
3179
- "annotator-action-color": S(({ color: t }) => [b(e.$slots, "icon-color", le(se({
3180
- color: t,
3181
- backgroundColor: hn.value
3182
- })), void 0, !0)]),
3183
- _: 3
3184
- }, 8, [
3185
- "value",
3186
- "backgroundColor",
3187
- "buttonBorderColor",
3188
- "isCursorPointer",
3189
- "palette"
3190
- ])], 32), J.value.showTooltips ? (v(), d(C, {
3191
- key: 0,
3192
- show: U.value && W.value === "setColor",
3193
- x: G.value.x,
3194
- y: G.value.y - 6,
3195
- placement: "top",
3196
- styleObject: X.value
3197
- }, {
3198
- default: S(() => [h(x(K.value.translations.tooltipShapeColor), 1)]),
3199
- _: 1
3200
- }, 8, [
3201
- "show",
3202
- "x",
3203
- "y",
3204
- "styleObject"
3205
- ])) : f("", !0)]),
3206
- m("div", ht, [m("label", gt, [h(x(K.value.translations.colorAlpha) + ": " + x($t.value > 98 ? 100 : $t.value) + " % ", 1), _e(m("input", {
3207
- name: "colorTransparency",
3208
- type: "range",
3209
- "onUpdate:modelValue": t[79] ||= (e) => $t.value = e,
3210
- onInput: Mr,
3211
- min: 0,
3212
- max: 100,
3213
- style: _({
3214
- width: "100%",
3215
- accentColor: J.value.color + " !important"
3216
- })
3217
- }, null, 36), [[he, $t.value]])])])
3218
- ])])], 8, ["to"])) : f("", !0)
3219
- ]), m("div", {
3220
- class: "annotator annotator__wrapper",
3221
- ref_key: "drawSvgContainer",
3222
- ref: wr,
3223
- style: { position: "relative" },
3224
- id: kt.value,
3225
- "data-annotator-content": ""
3226
- }, [
3227
- m("div", {
3228
- class: "annotator__content-layer",
3229
- style: _(`${M.value ? "pointer-events: none;" : ""}`)
3230
- }, [b(e.$slots, "default", {}, void 0, !0)], 4),
3231
- M.value || K.value.alwaysVisible ? (v(), p("svg", {
3232
- id: "annotatorSvg",
3233
- key: Gt.value,
3234
- ref_key: "mainSvg",
3235
- ref: bn,
3236
- class: g({
3237
- annotator__overlay: !0,
3238
- "annotator__overlay--inactive": !M.value,
3239
- draw: !0,
3240
- "draw--free": w.value === "line"
3241
- }),
3242
- viewBox: `0 0 ${qt.value} ${Kt.value}`,
3243
- width: Xt.value,
3244
- height: Zt.value,
3245
- onPointerdown: t[83] ||= (e) => mr(e),
3246
- onPointerup: t[84] ||= (e) => Dr(e),
3247
- onTouchend: t[85] ||= (e) => Dr(e),
3248
- onTouchstart: t[86] ||= (e) => Fr(e),
3249
- onPointermove: t[87] ||= (e) => {
3250
- Fr(e), vr(e);
3251
- },
3252
- onPointerout: t[88] ||= (e) => fr(e),
3253
- onPointerover: t[89] ||= (e) => qn(e),
3254
- onClick: t[90] ||= (e) => er(e),
3255
- style: _({
3256
- position: "absolute",
3257
- top: 0,
3258
- left: 0,
3259
- cursor: vn.value,
3260
- fontFamily: "Helvetica",
3261
- zIndex: 1e8,
3262
- pointerEvents: M.value ? "all" : "none"
3263
- })
3264
- }, [
3265
- m("rect", {
3266
- class: "annotator__glass",
3267
- x: "0",
3268
- y: "0",
3269
- width: qt.value,
3270
- height: Kt.value,
3271
- fill: "transparent",
3272
- "pointer-events": M.value ? "all" : "none",
3273
- style: { cursor: "inherit" },
3274
- onPointerdown: t[80] ||= ve((e) => mr(e), ["stop", "prevent"]),
3275
- onPointermove: t[81] ||= ve((e) => {
3276
- Fr(e), vr(e);
3277
- }, ["stop", "prevent"]),
3278
- onPointerup: ve(Dr, ["stop", "prevent"]),
3279
- onClick: t[82] ||= ve((e) => er(e), ["stop", "prevent"])
3280
- }, null, 40, yt),
3281
- (v(!0), p(re, null, fe(Pn.value, (e) => (v(), p("g", {
3282
- key: e.id,
3283
- innerHTML: e.html,
3284
- style: _({ pointerEvents: M.value ? null : "none" }),
3285
- onClick: (t) => Cr(t, e.id),
3286
- onDblclick: ve((t) => Sr(t, e.id), ["stop", "prevent"])
3287
- }, null, 44, bt))), 128)),
3288
- H.value && P.value ? (v(), p("line", {
3289
- key: 0,
3290
- class: "vue-ui-annotator-caret",
3291
- x1: H.value.x,
3292
- x2: H.value.x,
3293
- y1: H.value.y1,
3294
- y2: H.value.y2,
3295
- stroke: H.value.color,
3296
- "stroke-width": "2",
3297
- "pointer-events": "none",
3298
- "vector-effect": "non-scaling-stroke"
3299
- }, null, 8, xt)) : f("", !0)
3300
- ], 46, vt)) : f("", !0),
3301
- Vt.value || pe(At) ? (v(), p("svg", {
3302
- key: 1,
3303
- style: {
3304
- position: "absolute",
3305
- top: "0",
3306
- left: "0"
3307
- },
3308
- height: Zt.value,
3309
- viewBox: `0 0 ${qt.value} ${Kt.value}`,
3310
- width: Xt.value,
3311
- "data-dom-to-png-ignore": ""
3312
- }, [m("circle", {
3313
- class: "animated-circle-print",
3314
- cx: qt.value / 2,
3315
- cy: Kt.value / 2,
3316
- r: "50",
3317
- stroke: "#6376DD",
3318
- "stroke-width": "10",
3319
- fill: "none"
3320
- }, null, 8, Ct)], 8, St)) : f("", !0)
3321
- ], 8, _t)]));
3322
- }
3323
- }, [["__scopeId", "data-v-9a06c054"]]);
3324
- //#endregion
3325
- export { xe as n, Dt as t };