vue-data-ui 3.27.1 → 3.28.1

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 (276) hide show
  1. package/README.md +97 -63
  2. package/dist/{Arrow-C2W0uGrq.js → Arrow-CITPKnWF.js} +1 -1
  3. package/dist/{BaseDraggableDialog-D_tuHEjO.js → BaseDraggableDialog-DHgIPVmz.js} +1 -1
  4. package/dist/BaseIcon-Cm-IJ179.js +1 -0
  5. package/dist/{BaseLegendToggle-Bq5FjyuI.js → BaseLegendToggle-Q3TiW9u1.js} +1 -1
  6. package/dist/BaseZoomControls-ByS_7fmI.js +1 -0
  7. package/dist/{ColorPicker-MLwiwxl5.js → ColorPicker-Dmus34hN.js} +1 -1
  8. package/dist/DataTable-0Vv-aGHD.js +1 -0
  9. package/dist/HillActions-qz6J_uK7.js +1 -0
  10. package/dist/{Legend-D8YoT1RJ.js → Legend-DM0ClX3D.js} +1 -1
  11. package/dist/{NonSvgPenAndPaper-CqtJpZKh.js → NonSvgPenAndPaper-Do6RcwEr.js} +1 -1
  12. package/dist/{PackageVersion-CdkxOy58.js → PackageVersion-C4ZM3Vf7.js} +1 -1
  13. package/dist/PenAndPaper-BGEp-TUm.js +1 -0
  14. package/dist/{Shape-Bp9YNtPc.js → Shape-CRe8woTu.js} +1 -1
  15. package/dist/SlicerPreview-CFFUOlQr.js +1 -0
  16. package/dist/{SparkTooltip-C5JMcBXT.js → SparkTooltip-Ch06CV71.js} +1 -1
  17. package/dist/{Title-BGYFqulv.js → Title-BliHuXfT.js} +1 -1
  18. package/dist/Tooltip-C1q0Qoh7.js +1 -0
  19. package/dist/UserOptions-uWHV_zPB.js +1 -0
  20. package/dist/{useResponsive-D2CPcpda.js → canvas-lib-22VpOI4_.js} +1 -1
  21. package/dist/{chartImage-CIvU_04o.js → chartImage-DPGnEuYM.js} +1 -1
  22. package/dist/components/arrow.js +1 -1
  23. package/dist/components/vue-ui-3d-bar.js +1 -1
  24. package/dist/components/vue-ui-accordion.js +1 -1
  25. package/dist/components/vue-ui-age-pyramid.js +1 -1
  26. package/dist/components/vue-ui-annotator.js +1 -1
  27. package/dist/components/vue-ui-bullet.js +1 -1
  28. package/dist/components/vue-ui-bump.js +1 -1
  29. package/dist/components/vue-ui-candlestick.js +1 -1
  30. package/dist/components/vue-ui-carousel-table.js +1 -1
  31. package/dist/components/vue-ui-chestnut.js +1 -1
  32. package/dist/components/vue-ui-chord.js +1 -1
  33. package/dist/components/vue-ui-circle-pack.js +1 -1
  34. package/dist/components/vue-ui-cursor.js +1 -1
  35. package/dist/components/vue-ui-dag.js +1 -1
  36. package/dist/components/vue-ui-dashboard.js +1 -1
  37. package/dist/components/vue-ui-digits.js +1 -1
  38. package/dist/components/vue-ui-donut-evolution.js +1 -1
  39. package/dist/components/vue-ui-donut.js +1 -1
  40. package/dist/components/vue-ui-dumbbell.js +1 -1
  41. package/dist/components/vue-ui-flow.js +1 -1
  42. package/dist/components/vue-ui-funnel.js +1 -1
  43. package/dist/components/vue-ui-galaxy.js +1 -1
  44. package/dist/components/vue-ui-gauge.js +1 -1
  45. package/dist/components/vue-ui-geo.js +1 -1
  46. package/dist/components/vue-ui-gizmo.js +1 -1
  47. package/dist/components/vue-ui-graph.js +1 -0
  48. package/dist/components/vue-ui-heatmap.js +1 -1
  49. package/dist/components/vue-ui-hill.js +1 -1
  50. package/dist/components/vue-ui-history-plot.js +1 -1
  51. package/dist/components/vue-ui-horizontal-bar.js +1 -1
  52. package/dist/components/vue-ui-icon.js +1 -1
  53. package/dist/components/vue-ui-kpi.js +1 -1
  54. package/dist/components/vue-ui-label.js +1 -1
  55. package/dist/components/vue-ui-mini-loader.js +1 -1
  56. package/dist/components/vue-ui-molecule.js +1 -1
  57. package/dist/components/vue-ui-mood-radar.js +1 -1
  58. package/dist/components/vue-ui-nested-donuts.js +1 -1
  59. package/dist/components/vue-ui-onion.js +1 -1
  60. package/dist/components/vue-ui-parallel-coordinate-plot.js +1 -1
  61. package/dist/components/vue-ui-pattern-seed.js +1 -1
  62. package/dist/components/vue-ui-pattern.js +1 -1
  63. package/dist/components/vue-ui-quadrant.js +1 -1
  64. package/dist/components/vue-ui-quick-chart.js +1 -1
  65. package/dist/components/vue-ui-radar.js +1 -1
  66. package/dist/components/vue-ui-rating.js +1 -1
  67. package/dist/components/vue-ui-relation-circle.js +1 -1
  68. package/dist/components/vue-ui-ridgeline.js +1 -1
  69. package/dist/components/vue-ui-rings.js +1 -1
  70. package/dist/components/vue-ui-scatter.js +1 -1
  71. package/dist/components/vue-ui-skeleton.js +1 -1
  72. package/dist/components/vue-ui-smiley.js +1 -1
  73. package/dist/components/vue-ui-spark-trend.js +1 -1
  74. package/dist/components/vue-ui-sparkbar.js +1 -1
  75. package/dist/components/vue-ui-sparkgauge.js +1 -1
  76. package/dist/components/vue-ui-sparkhistogram.js +1 -1
  77. package/dist/components/vue-ui-sparkline.js +1 -1
  78. package/dist/components/vue-ui-sparkstackbar.js +1 -1
  79. package/dist/components/vue-ui-stackbar.js +1 -1
  80. package/dist/components/vue-ui-stackline.js +1 -1
  81. package/dist/components/vue-ui-strip-plot.js +1 -1
  82. package/dist/components/vue-ui-table-heatmap.js +1 -1
  83. package/dist/components/vue-ui-table-sparkline.js +1 -1
  84. package/dist/components/vue-ui-table.js +1 -1
  85. package/dist/components/vue-ui-thermometer.js +1 -1
  86. package/dist/components/vue-ui-timer.js +1 -1
  87. package/dist/components/vue-ui-tiremarks.js +1 -1
  88. package/dist/components/vue-ui-treemap.js +1 -1
  89. package/dist/components/vue-ui-vertical-bar.js +1 -1
  90. package/dist/components/vue-ui-waffle.js +1 -1
  91. package/dist/components/vue-ui-wheel.js +1 -1
  92. package/dist/components/vue-ui-word-cloud.js +1 -1
  93. package/dist/components/vue-ui-world.js +1 -1
  94. package/dist/components/vue-ui-xy-canvas.js +1 -1
  95. package/dist/components/vue-ui-xy.js +1 -1
  96. package/dist/{dom-to-png-D8t3Bm7s.js → dom-to-png-D56-Zgv4.js} +1 -1
  97. package/dist/{exposedLib-DHtyEc_G.js → exposedLib-BRtClmZy.js} +1 -1
  98. package/dist/{img-DiT4ivZ5.js → img-D4RQwASc.js} +1 -1
  99. package/dist/{labelUtils-CG3uVXoZ.js → labelUtils-CdtU-yB_.js} +1 -1
  100. package/dist/{lib-CV_IANZ6.js → lib-rPeBMZrn.js} +4 -4
  101. package/dist/package-DGRUegc-.js +1 -0
  102. package/dist/{pdf-BQSB1V3H.js → pdf-DAicVFxx.js} +1 -1
  103. package/dist/{render-common-BdZ5aRyn.js → render-common-CJz0wn0I.js} +1 -1
  104. package/dist/{resolveChartConfig-DZg-korK.js → resolveChartConfig-CIhClE5R.js} +1 -1
  105. package/dist/ssr/vue-ui-donut.js +1 -1
  106. package/dist/ssr/vue-ui-xy.js +1 -1
  107. package/dist/ssr.js +1 -1
  108. package/dist/style.css +1 -1
  109. package/dist/types/vue-data-ui.d.ts +449 -0
  110. package/dist/types/vue-ui-graph.d.ts +21 -0
  111. package/dist/useChartExport-BZts4KFb.js +1 -0
  112. package/dist/useConfig-6jO1fkp5.js +1 -0
  113. package/dist/{useNestedProp-CB186vF2.js → useNestedProp-DnGoh-XS.js} +1 -1
  114. package/dist/useObjectBindings-DiMX4HGv.js +1 -0
  115. package/dist/{usePrinter-hLW3cv4N.js → usePrinter-sVoTzet1.js} +1 -1
  116. package/dist/useResponsive-CENUxfEL.js +1 -0
  117. package/dist/useSvgLabelLayout-D1I8sQUi.js +1 -0
  118. package/dist/useTimeLabelCollider-BTybMUFi.js +1 -0
  119. package/dist/useTransitions-ChGGrtrv.js +1 -0
  120. package/dist/utils.js +1 -1
  121. package/dist/vue-data-ui-CxiWUtNw.js +1 -0
  122. package/dist/vue-data-ui.js +1 -1
  123. package/dist/vue-ui-3d-bar-CW8ahywt.js +19 -0
  124. package/dist/vue-ui-accordion-S3nRtTU-.js +1 -0
  125. package/dist/vue-ui-age-pyramid-CxMwKICA.js +1 -0
  126. package/dist/vue-ui-annotator-CdCDYzdK.js +331 -0
  127. package/dist/vue-ui-bullet-ClnewIWQ.js +34 -0
  128. package/dist/vue-ui-bump-C6FuNDUg.js +8 -0
  129. package/dist/vue-ui-candlestick-CyewIjJk.js +22 -0
  130. package/dist/vue-ui-carousel-table-D0dD4kai.js +1 -0
  131. package/dist/vue-ui-chestnut-nS1vjCqH.js +1 -0
  132. package/dist/vue-ui-chord-B963Q_26.js +21 -0
  133. package/dist/vue-ui-circle-pack-DEY9X3jA.js +13 -0
  134. package/dist/vue-ui-cursor-CNv12HQG.js +1 -0
  135. package/dist/vue-ui-dag-s3-TMmid.js +9 -0
  136. package/dist/vue-ui-dashboard-B5zrGAvS.js +1 -0
  137. package/dist/{vue-ui-digits-CXKKmfGj.js → vue-ui-digits-DXQwmTUx.js} +2 -2
  138. package/dist/vue-ui-donut-CDryub1L.js +47 -0
  139. package/dist/{vue-ui-donut-CKkBtyPK.js → vue-ui-donut-DHfOfLBF.js} +2 -2
  140. package/dist/vue-ui-donut-evolution-C5pHSrza.js +2 -0
  141. package/dist/vue-ui-dumbbell-CQbGR7yM.js +9 -0
  142. package/dist/vue-ui-flow-B16Mj6MW.js +3 -0
  143. package/dist/vue-ui-funnel-Dh-xi_Qi.js +1 -0
  144. package/dist/vue-ui-galaxy-U_ZIP5vm.js +1 -0
  145. package/dist/vue-ui-gauge-Dr4zsf6D.js +1 -0
  146. package/dist/vue-ui-geo-DFebja0s.js +1 -0
  147. package/dist/vue-ui-gizmo-CssVcz-O.js +1 -0
  148. package/dist/vue-ui-graph-BB_97Qz7.js +7 -0
  149. package/dist/vue-ui-heatmap-DEBbVnrg.js +1 -0
  150. package/dist/vue-ui-hill-C1sHz3TI.js +1 -0
  151. package/dist/vue-ui-history-plot-CsBTJXR3.js +2 -0
  152. package/dist/vue-ui-horizontal-bar-D0kfcpEW.js +4 -0
  153. package/dist/vue-ui-kpi-CltKSYUI.js +1 -0
  154. package/dist/vue-ui-label-B_1kM28r.js +7 -0
  155. package/dist/vue-ui-mini-loader-7gqQI5jy.js +1 -0
  156. package/dist/vue-ui-molecule-DtoyWWTf.js +1 -0
  157. package/dist/vue-ui-mood-radar-ClOxfeH8.js +1 -0
  158. package/dist/vue-ui-nested-donuts-CULAXTg1.js +19 -0
  159. package/dist/vue-ui-onion-D7zu861i.js +5 -0
  160. package/dist/vue-ui-parallel-coordinate-plot-Cjbc-WUG.js +9 -0
  161. package/dist/vue-ui-quadrant-DWAb_t6r.js +2 -0
  162. package/dist/vue-ui-quick-chart-oDZwgVo8.js +17 -0
  163. package/dist/vue-ui-radar-BWG_N0xO.js +1 -0
  164. package/dist/vue-ui-rating-CV2b0tjA.js +1 -0
  165. package/dist/vue-ui-relation-circle-BCRiS2n6.js +1 -0
  166. package/dist/vue-ui-ridgeline-VYcGUP_p.js +2 -0
  167. package/dist/vue-ui-rings-Dl0AjrRj.js +1 -0
  168. package/dist/vue-ui-scatter-DTa48HvG.js +9 -0
  169. package/dist/{vue-ui-skeleton-DI7pcimU.js → vue-ui-skeleton-C5mGG8hR.js} +3 -3
  170. package/dist/{vue-ui-smiley-D70sJZWl.js → vue-ui-smiley-VTdQetY0.js} +1 -1
  171. package/dist/vue-ui-spark-trend--frxeJ8f.js +1 -0
  172. package/dist/vue-ui-sparkbar-BS5v3HMo.js +1 -0
  173. package/dist/vue-ui-sparkgauge-B1TGfXvR.js +1 -0
  174. package/dist/vue-ui-sparkhistogram-Cs97AL6h.js +1 -0
  175. package/dist/vue-ui-sparkline-Bp9J6x7z.js +1 -0
  176. package/dist/vue-ui-sparkstackbar-BVuuRD10.js +1 -0
  177. package/dist/vue-ui-stackbar-CRuXn3XI.js +29 -0
  178. package/dist/vue-ui-stackline-Besmr9vq.js +39 -0
  179. package/dist/vue-ui-strip-plot-D-aRJkR7.js +2 -0
  180. package/dist/vue-ui-table-D_UdQwV3.js +14 -0
  181. package/dist/vue-ui-table-heatmap-BtziURiu.js +1 -0
  182. package/dist/vue-ui-table-sparkline-BdNo8fW_.js +1 -0
  183. package/dist/vue-ui-thermometer-TFg1SGY7.js +1 -0
  184. package/dist/vue-ui-timer-BdPksC26.js +64 -0
  185. package/dist/vue-ui-tiremarks-HWuO-eyj.js +1 -0
  186. package/dist/vue-ui-treemap-IegiAqaX.js +1 -0
  187. package/dist/vue-ui-waffle-BEyGfPks.js +1 -0
  188. package/dist/vue-ui-wheel-k8GNPGET.js +1 -0
  189. package/dist/vue-ui-word-cloud-D9_15Ve7.js +4 -0
  190. package/dist/vue-ui-world-rCp5Vb7u.js +19 -0
  191. package/dist/vue-ui-xy-42AXepcQ.js +31 -0
  192. package/dist/vue-ui-xy-CFgFg11v.js +24 -0
  193. package/dist/vue-ui-xy-canvas-CeC3gcrW.js +9 -0
  194. package/dist/vue_ui_graph-B1ACwQj7.js +1 -0
  195. package/package.json +3 -3
  196. package/dist/BaseIcon-DdIyewwY.js +0 -1
  197. package/dist/BaseZoomControls-DoYifY2y.js +0 -1
  198. package/dist/DataTable-WNecJMcY.js +0 -1
  199. package/dist/HillActions-CHg1AQ3p.js +0 -1
  200. package/dist/PenAndPaper-IMw576MC.js +0 -1
  201. package/dist/SlicerPreview-CNUciSbY.js +0 -1
  202. package/dist/Tooltip-Cus2-XNQ.js +0 -1
  203. package/dist/UserOptions-DTxMeZv3.js +0 -1
  204. package/dist/package-DE5cU1Rg.js +0 -1
  205. package/dist/useChartExport-DtPNpc9M.js +0 -1
  206. package/dist/useConfig-CKdzPrcf.js +0 -1
  207. package/dist/useObjectBindings-Dse7YyAf.js +0 -1
  208. package/dist/useTimeLabelCollider-XQf_S7-z.js +0 -1
  209. package/dist/useTransitions-DfSHzsdz.js +0 -1
  210. package/dist/vue-data-ui-DyYgLIZN.js +0 -1
  211. package/dist/vue-ui-3d-bar-BZAoyWkc.js +0 -19
  212. package/dist/vue-ui-accordion-BNvevckx.js +0 -1
  213. package/dist/vue-ui-age-pyramid-DkA6vpU3.js +0 -1
  214. package/dist/vue-ui-annotator-DuQME4Hh.js +0 -331
  215. package/dist/vue-ui-bullet-BVs8JX8S.js +0 -34
  216. package/dist/vue-ui-bump-DYdm3EvF.js +0 -10
  217. package/dist/vue-ui-candlestick-DZgxl4mW.js +0 -22
  218. package/dist/vue-ui-carousel-table-BB7DsTUt.js +0 -1
  219. package/dist/vue-ui-chestnut-Bo1h5rBt.js +0 -1
  220. package/dist/vue-ui-chord-B6_veyvO.js +0 -21
  221. package/dist/vue-ui-circle-pack-Bm7e2YNh.js +0 -13
  222. package/dist/vue-ui-cursor-TidZDuSh.js +0 -1
  223. package/dist/vue-ui-dag-BiN_AnLo.js +0 -9
  224. package/dist/vue-ui-dashboard-zepAVN_W.js +0 -1
  225. package/dist/vue-ui-donut-DLDUpjDU.js +0 -47
  226. package/dist/vue-ui-donut-evolution-BxMTdE5G.js +0 -2
  227. package/dist/vue-ui-dumbbell-C8rNwdz0.js +0 -9
  228. package/dist/vue-ui-flow-Dru76A2O.js +0 -3
  229. package/dist/vue-ui-funnel-D_u1h5S9.js +0 -1
  230. package/dist/vue-ui-galaxy-sBEH18Xj.js +0 -1
  231. package/dist/vue-ui-gauge-Do3RN8ne.js +0 -1
  232. package/dist/vue-ui-geo-DDbtx_iJ.js +0 -1
  233. package/dist/vue-ui-gizmo-eic6xLjB.js +0 -1
  234. package/dist/vue-ui-heatmap-DlmJRsM8.js +0 -1
  235. package/dist/vue-ui-hill-C5oiuIXh.js +0 -1
  236. package/dist/vue-ui-history-plot-BJjnkWcT.js +0 -2
  237. package/dist/vue-ui-horizontal-bar-BRDBJEl1.js +0 -4
  238. package/dist/vue-ui-kpi-C-eed3jO.js +0 -1
  239. package/dist/vue-ui-label-B4pkXBxc.js +0 -7
  240. package/dist/vue-ui-mini-loader-CElmv_iF.js +0 -1
  241. package/dist/vue-ui-molecule-BeyQWZU9.js +0 -1
  242. package/dist/vue-ui-mood-radar-Bh0kHfiZ.js +0 -1
  243. package/dist/vue-ui-nested-donuts-FlnJfDaF.js +0 -19
  244. package/dist/vue-ui-onion-BjhSpjtW.js +0 -5
  245. package/dist/vue-ui-parallel-coordinate-plot-CHV6XDti.js +0 -9
  246. package/dist/vue-ui-quadrant-BaKSTJDv.js +0 -2
  247. package/dist/vue-ui-quick-chart-Nc2mVlle.js +0 -17
  248. package/dist/vue-ui-radar-BzUfkLlC.js +0 -1
  249. package/dist/vue-ui-rating-BwWXvbAg.js +0 -1
  250. package/dist/vue-ui-relation-circle-nAZEg-BL.js +0 -1
  251. package/dist/vue-ui-ridgeline-DxLZg1E2.js +0 -2
  252. package/dist/vue-ui-rings-BOti0NGb.js +0 -1
  253. package/dist/vue-ui-scatter-CCNMggyo.js +0 -9
  254. package/dist/vue-ui-spark-trend-BVtfEalS.js +0 -1
  255. package/dist/vue-ui-sparkbar-CdsLI7Ke.js +0 -1
  256. package/dist/vue-ui-sparkgauge-wmj5Wnnp.js +0 -1
  257. package/dist/vue-ui-sparkhistogram-D8S_P_P4.js +0 -1
  258. package/dist/vue-ui-sparkline-BjsJnS_9.js +0 -1
  259. package/dist/vue-ui-sparkstackbar-ZN8LXzoV.js +0 -1
  260. package/dist/vue-ui-stackbar-Dx_EN3pT.js +0 -29
  261. package/dist/vue-ui-stackline-DW-oxJvA.js +0 -39
  262. package/dist/vue-ui-strip-plot-D7kjJ3Qh.js +0 -2
  263. package/dist/vue-ui-table-CaFVLHxE.js +0 -14
  264. package/dist/vue-ui-table-heatmap-Ctf7Rhqo.js +0 -1
  265. package/dist/vue-ui-table-sparkline-C0I0cXBS.js +0 -1
  266. package/dist/vue-ui-thermometer-B6og15Al.js +0 -1
  267. package/dist/vue-ui-timer-DgXvO2Q7.js +0 -64
  268. package/dist/vue-ui-tiremarks-Dh6fZ454.js +0 -1
  269. package/dist/vue-ui-treemap-7JuvN6P_.js +0 -1
  270. package/dist/vue-ui-waffle-BqvGzfse.js +0 -1
  271. package/dist/vue-ui-wheel-SdwJqKA7.js +0 -1
  272. package/dist/vue-ui-word-cloud-1WVV_k12.js +0 -4
  273. package/dist/vue-ui-world-DjMy_utm.js +0 -19
  274. package/dist/vue-ui-xy-DaozHMfg.js +0 -31
  275. package/dist/vue-ui-xy-canvas-CegvS9RR.js +0 -9
  276. package/dist/vue-ui-xy-rGHSI1am.js +0 -24
@@ -0,0 +1 @@
1
+ import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{t}from"./useConfig-6jO1fkp5.js";import{$ as n,D as r,Dt as i,Jt as a,X as o,Yt as ee,at as te,b as s,et as ne,i as c,in as re,nt as ie,pt as ae,t as oe,tn as se,zt as ce}from"./lib-rPeBMZrn.js";import{n as le,t as ue}from"./BaseScanner-8NdoBs7B.js";import{n as de,t as fe}from"./useHints-BH9r_0Vd.js";import{t as pe}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{t as me}from"./resolveChartConfig-CIhClE5R.js";import{t as he}from"./img-D4RQwASc.js";import{n as ge}from"./Title-BliHuXfT.js";import{t as _e}from"./useChartExport-BZts4KFb.js";import{n as ve,t as ye}from"./tableIntegration-CNoJ1CIY.js";import{n as be,t as xe}from"./annotationSlots-BRR85CqJ.js";import{n as Se,t as Ce}from"./userOptionsSlots-DYuo-E5m.js";import{t as we}from"./usePrinter-sVoTzet1.js";import{t as Te}from"./useSvgLabelLayout-D1I8sQUi.js";import{t as Ee}from"./useTimeLabelCollider-BTybMUFi.js";import{t as De}from"./useResponsive-CENUxfEL.js";import{t as Oe}from"./DefGrad-DKMq1REY.js";import{t as ke}from"./A11yDataTable-DWNlWXzs.js";import{t as Ae}from"./useUserOptionState-CXlFnwPv.js";import{t as je}from"./useChartAccessibility-DOMuYJfm.js";import{t as Me}from"./vue_ui_age_pyramid-CL0Ef8Ov.js";import{Fragment as l,computed as u,createBlock as d,createCommentVNode as f,createElementBlock as p,createElementVNode as m,createSlots as Ne,createTextVNode as Pe,createVNode as h,defineAsyncComponent as g,guardReactiveProps as _,mergeProps as Fe,nextTick as Ie,normalizeClass as Le,normalizeProps as v,normalizeStyle as Re,onBeforeUnmount as ze,onMounted as Be,openBlock as y,ref as b,renderList as x,renderSlot as S,resolveDynamicComponent as Ve,shallowRef as He,toDisplayString as C,toRefs as Ue,unref as w,watch as T,withCtx as E}from"vue";var We=/* @__PURE__ */ e({default:()=>yt}),Ge=[`id`],Ke=[`id`],qe={style:{position:`relative`}},Je=[`xmlns`,`viewBox`,`aria-describedby`],Ye=[`x`,`y`,`width`,`height`],Xe=[`x`,`y`,`width`,`height`,`fill`,`rx`],Ze=[`x`,`y`,`width`,`height`,`fill`,`rx`],Qe=[`x`,`y`,`width`,`height`,`fill`,`rx`],$e=[`x`,`y`,`width`,`height`,`fill`,`rx`],et=[`x`,`y`,`font-size`,`font-weight`,`fill`,`stroke`],tt=[`x`,`y`,`font-size`,`font-weight`,`fill`,`stroke`],nt={key:0},rt=[`x`,`y`,`fill`,`font-size`,`font-weight`],it=[`x`,`y`,`fill`,`font-size`,`font-weight`],at={key:1},ot=[`x`,`y`,`font-size`,`fill`,`font-weight`],st={key:2},ct={key:0},lt=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`],ut=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`],dt=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`],ft=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`],pt=[`font-size`,`fill`,`text-anchor`,`font-weight`,`transform`],mt=[`font-size`,`fill`,`text-anchor`,`font-weight`,`transform`],ht=[`x`,`y`,`font-size`,`fill`,`font-weight`],gt=[`x`,`y`,`width`,`height`,`fill`,`onMouseover`,`onMouseleave`,`onClick`],_t={key:0,style:{position:`absolute`,top:`100%`,left:`0`,width:`100%`},"data-dom-to-png-ignore":``,"aria-hidden":`true`},vt={key:5,class:`vue-data-ui-watermark`},yt=/*#__PURE__*/ pe({__name:`vue-ui-age-pyramid`,props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:[`copyAlt`],setup(e,{expose:pe,emit:We}){let yt=g(()=>import(`./Tooltip-C1q0Qoh7.js`)),bt=g(()=>import(`./BaseIcon-Cm-IJ179.js`).then(e=>e.n)),xt=g(()=>import(`./vue-ui-accordion-S3nRtTU-.js`).then(e=>e.n)),St=g(()=>import(`./DataTable-0Vv-aGHD.js`)),Ct=g(()=>import(`./PenAndPaper-BGEp-TUm.js`).then(e=>e.t)),wt=g(()=>import(`./UserOptions-uWHV_zPB.js`).then(e=>e.n)),Tt=g(()=>import(`./PackageVersion-C4ZM3Vf7.js`).then(e=>e.t)),Et=g(()=>import(`./BaseDraggableDialog-DHgIPVmz.js`).then(e=>e.n)),{vue_ui_age_pyramid:Dt}=t(),D=e,Ot=We,kt=u(()=>!!D.dataset&&D.dataset.length),O=b(o()),k=b(!1),At=b(``),A=b(null),jt=b(0),j=b(null),Mt=b(null),Nt=b(null),Pt=b(null),Ft=b(0),It=b(0),Lt=b(null),Rt=b(null),zt=b(null),M=b(null),Bt=b({x:0,y:0}),N=b(`pointer`),Vt=b(!1),P=b(Yt()),F=u(()=>P.value.style),I=u(()=>P.value.style.layout.dataLabels),L=u(()=>P.value.style.layout.bars),R=u(()=>P.value.style.layout.bars.labels);de({config:()=>P.value,dataset:()=>D.dataset,component:`VueUiAgePyramid`,rules:[fe.emptyArray,{test:e=>e.length>130,message:[`👀 Dataset has > 130 points. Consider:`,``,`▶️ Grouping small values into aggregated categories.`,``,`▶️ Using VueUiStackline to display data in a more compact way.`]}]});let z=u(()=>P.value.userOptions.useCursorPointer),Ht=u(()=>re({defaultConfig:{userOptions:{show:!1},table:{show:!1},translations:{male:``,female:``},style:{backgroundColor:`#99999930`,layout:{bars:{left:{color:`#CACACA`},right:{color:`#999999`}},dataLabels:{xAxis:{fontSize:0,scale:1e3,translation:``},yAxis:{show:!1}},grid:{stroke:`#6A6A6A`}}}},userConfig:P.value.skeletonConfig??{}})),{loading:Ut,FINAL_DATASET:Wt,manualLoading:Gt}=le({...Ue(D),FINAL_CONFIG:P,prepareConfig:Yt,skeletonDataset:D.config?.skeletonDataset??[[`_`,9,2,2],[`_`,8,3,3],[`_`,7,5,5],[`_`,6,8,8],[`_`,5,13,13],[`_`,4,21,21],[`_`,3,34,34],[`_`,2,55,55],[`_`,1,89,89],[`_`,0,144,144]],skeletonConfig:re({defaultConfig:P.value,userConfig:Ht.value})}),{userOptionsVisible:Kt,setUserOptionsVisibility:qt,keepUserOptionState:Jt}=Ae({config:P.value}),{svgRef:B}=je({config:P.value.style.title});function Yt(){return me(D.config,Dt,Me)}function Xt(e){let t=ne(e);return t?.style?.chart&&delete t.style.tooltip,JSON.stringify(t)}let Zt=Xt(D.config);T(()=>D.config,(e,t)=>{let n=Xt(e),r=n!==Zt;Zt=n;let i=Yt();r?(Ut.value||(P.value=i),Kt.value=!P.value.userOptions.showOnChartHover,tn(),Ft.value+=1,It.value+=1,U.value.showTable=P.value.table.show,U.value.showTooltip=P.value.style.tooltip.show):(P.value.style.tooltip=i.style.tooltip,U.value.showTooltip=P.value.style.tooltip.show)},{deep:!0}),T(()=>D.dataset,e=>{Array.isArray(e)&&e.length>0&&(Gt.value=!1)},{deep:!0});let V=He(null),H=He(null),Qt=b(!1),$t=0;Be(()=>{tn()});let en=u(()=>P.value.debug);function tn(){ce(D.dataset)&&(te({componentName:`VueUiAgePyramid`,type:`dataset`,debug:en.value}),Gt.value=!0),ce(D.dataset)||(Gt.value=P.value.loading),P.value.responsive&&(V.value&&(H.value&&V.value.unobserve(H.value),V.value.disconnect()),V.value=new ResizeObserver(()=>{let{width:e,height:t}=De({chart:j.value,title:F.value.title.text?Mt.value:null,source:Nt.value,noTitle:Pt.value});cancelAnimationFrame($t),$t=requestAnimationFrame(()=>{W.value.width=e,W.value.height=t,Qt.value=!0})}),H.value=j.value.parentNode,V.value.observe(H.value))}ze(()=>{cancelAnimationFrame($t),V.value&&(H.value&&V.value.unobserve(H.value),V.value.disconnect())});let{isPrinting:nn,isImaging:rn,generatePdf:an,generateImage:on}=we({elementId:`vue-ui-age-pyramid_${O.value}`,fileName:F.value.title.text||`vue-ui-age-pyramid`,options:P.value.userOptions.print}),sn=u(()=>P.value.userOptions.show&&!F.value.title.text),U=b({showTable:P.value.table.show,showTooltip:F.value.tooltip.show});T(P,()=>{U.value={showTable:P.value.table.show,showTooltip:F.value.tooltip.show}},{immediate:!0});let W=b({height:F.value.height,width:F.value.width}),cn=u(()=>W.value.width),ln=u(()=>W.value.height),{metrics:un,ready:dn,settling:fn,update:pn}=Te({svgRef:B,canMeasure:()=>!P.value.responsive||Qt.value,initialMetrics:{bottom:0},measure:e=>({bottom:e(Lt.value).height})}),mn=u(()=>un.value.bottom),G=u(()=>{let e=W.value.width-F.value.layout.padding.right-F.value.layout.padding.left,t=F.value.layout.padding.left,n=W.value.width-F.value.layout.padding.right;return{top:F.value.layout.padding.top+I.value.sideTitles.fontSize+I.value.sideTitles.offsetY+12,left:t,right:n,bottom:W.value.height-F.value.layout.padding.bottom-mn.value,width:e,height:W.value.height-F.value.layout.padding.top-F.value.layout.padding.bottom-mn.value-I.value.sideTitles.fontSize-I.value.sideTitles.offsetY-12,centerX:F.value.layout.padding.left+e/2,leftChart:{width:e/2-F.value.layout.centerSlit.width,right:t+e/2-F.value.layout.centerSlit.width},rightChart:{width:e/2-F.value.layout.centerSlit.width,left:t+e/2+F.value.layout.centerSlit.width}}}),hn=u(()=>Wt.value.map(e=>I.value.yAxis.display===`age`?e[1]:e[0])),K=u(()=>{let e=gn(q.value/5),t=[],n=[];for(let r=0;r<=5;r+=1){let i=e*r,a=e*(r-5);t.push({value:i,x:G.value.left+G.value.width/2+F.value.layout.centerSlit.width+i/q.value*G.value.leftChart.width}),n.push({value:Math.abs(a),x:G.value.left+G.value.width/2+a/q.value*G.value.leftChart.width-F.value.layout.centerSlit.width})}return{right:t,left:n}});function gn(e){if(e===0)return 0;let t=10**Math.floor(Math.log10(Math.abs(e))),n;return n=Math.round(e/t)*t,n}let q=u(()=>Math.max(...Wt.value.flatMap(e=>e.slice(-2).map(e=>s(e))))),J=u(()=>Wt.value.length),_n=u(()=>Wt.value.map(e=>({segment:e[0],age:e[1],left:{value:e[2],proportionToMax:e[2]/q.value},right:{value:e[3],proportionToMax:e[3]/q.value}}))),Y=u(()=>_n.value.map((e,t)=>{let n=G.value.top+G.value.height/J.value*t,r=G.value.height/J.value-L.value.gap;return{segment:e.segment,age:e.age,left:{...e.left,y:n,color:L.value.left.color,x:G.value.leftChart.right-e.left.proportionToMax*G.value.leftChart.width,width:s(e.left.proportionToMax*G.value.leftChart.width),height:r},right:{...e.right,y:n,color:L.value.right.color,x:G.value.rightChart.left,width:s(e.right.proportionToMax*G.value.rightChart.width),height:r}}})),vn=b(null);function yn(e){let[t,n,r,i]=e;return{segment:t,index:n,left:r,right:i}}function bn(e,t){P.value.events.datapointClick&&P.value.events.datapointClick({datapoint:yn(t),seriesIndex:e})}function xn(e,t){P.value.events.datapointLeave&&P.value.events.datapointLeave({datapoint:yn(t),seriesIndex:e}),(N.value!==`keyboard`||M.value!==e)&&(A.value=null,k.value=!1)}function Sn(e){if(!B.value)return;let t=Y.value[e];if(!t)return;let n=se(G.value.left+G.value.width/2,t.left.y+t.left.height/2,B.value);n&&(Bt.value=n)}function Cn(e,t,r=`pointer`){P.value.events.datapointEnter&&P.value.events.datapointEnter({datapoint:yn(t),seriesIndex:e}),A.value=e,M.value=e,N.value=r,vn.value={datapoint:t,seriesIndex:e,series:Y.value,config:P.value};let a=F.value.tooltip.customFormat;if(i(a)&&ae(()=>a({seriesIndex:e,datapoint:{segment:t[0],index:t[1],left:t[2],right:t[3]},series:Y.value,config:P.value})))At.value=a({seriesIndex:e,datapoint:{segment:t[0],index:t[1],left:t[2],right:t[3]},series:Y.value,config:P.value});else{let r=``,i=Y.value[e];r+=`<div><b>${i.segment}</b></div>`,r+=`<div>${P.value.translations.age}: ${c(I.value.yAxis.formatter,s(i.age),n({v:s(i.age)}),{datapoint:t,seriesIndex:e})}</div>`,r+=`<div style="margin-top:6px;padding-top:6px;border-top:1px solid ${F.value.tooltip.borderColor}">`,r+=`<div style="display:flex; flex-direction:row;gap:12px">`,r+=`<div style="display:flex;flex-direction:column;align-items:center;justify-content:center"><svg viewBox="0 0 12 12" height="12" width="12"><rect stroke="none" x="0" y="0" height="12" width="12" rx="2" fill="${L.value.gradient.underlayer}"/><rect stroke="none" x="0" y="0" height="12" width="12" rx="2" fill="${L.value.gradient.show?`url(#age_pyramid_left_${O.value})`:L.value.left.color}"/></svg><div>${P.value.translations.female}</div><div><b>${c(I.value.xAxis.formatter,s(i.left.value),n({v:s(i.left.value)}),{datapoint:t,seriesIndex:e})}</b></div></div>`,r+=`<div style="display:flex;flex-direction:column;align-items:center;justify-content:center"><svg viewBox="0 0 12 12" height="12" width="12"><rect stroke="none" x="0" y="0" height="12" width="12" rx="2" fill="${L.value.gradient.underlayer}"/><rect stroke="none" x="0" y="0" height="12" width="12" rx="2" fill="${L.value.gradient.show?`url(#age_pyramid_right_${O.value})`:L.value.right.color}"/></svg><div>${P.value.translations.male}</div><div><b>${c(I.value.xAxis.formatter,s(i.right.value),n({v:s(i.right.value)}),{datapoint:t,seriesIndex:e})}</b></div></div>`,r+=`</div>`,r+=`<div style="margin-top:6px;padding-top:6px;border-top:1px solid ${F.value.tooltip.borderColor}"><div>${P.value.translations.total}</div><div><b>${c(I.value.xAxis.formatter,s(i.right.value)+s(i.left.value),n({v:s(i.right.value)+s(i.left.value)}),{datapoint:t,seriesIndex:e})}</b></div></div>`,r+=`</div>`,At.value=`<div>${r}</div>`}k.value=!0,r===`keyboard`&&Ie(()=>{Sn(e)})}function wn(e=null){Ie(()=>{let t=[P.value.translations.year,P.value.translations.age,P.value.translations.female,P.value.translations.male,P.value.translations.total],n=D.dataset.map(e=>[e[0],e[1],e[2],e[3],e[2]??0+e[3]??0]),i=[[F.value.title.text],[F.value.title.subtitle.text],[[``],[``],[``]],t].concat(n),a=r(i);e?e(a):ie({csvContent:a,title:F.value.title.text||`vue-ui-heatmap`})})}let X=u(()=>{let e=[P.value.translations.year,P.value.translations.age,P.value.translations.female,P.value.translations.male,P.value.translations.total];return{head:e,body:D.dataset.map(e=>[e[0],e[1],e[2]==null?``:e[2].toLocaleString(),e[3]==null?``:e[3].toLocaleString(),(e[2]??0+e[3]??0).toLocaleString()]),config:{th:{backgroundColor:P.value.table.th.backgroundColor,color:P.value.table.th.color,outline:P.value.table.th.outline},td:{backgroundColor:P.value.table.td.backgroundColor,color:P.value.table.td.color,outline:P.value.table.td.outline},breakpoint:P.value.table.responsiveBreakpoint},colNames:e}}),Z=b(!1);function Tn(e){Z.value=e,jt.value+=1}function En(){U.value.showTable=!U.value.showTable}function Dn(){U.value.showTooltip=!U.value.showTooltip}let Q=b(!1);function On(){Q.value=!Q.value}async function kn({scale:e=2}={}){if(!j.value)return;let{width:t,height:n}=j.value.getBoundingClientRect(),r=t/n,{imageUri:i,base64:a}=await he({domElement:j.value,base64:!0,img:!0,scale:e});return{imageUri:i,base64:a,title:F.value.title.text,width:t,height:n,aspectRatio:r}}let An=b([]),jn=b({start:0,end:Y.value.length});Ee({timeLabelsEls:Lt,timeLabels:An,slicer:jn,configRef:P,rotationPath:[`style`,`layout`,`dataLabels`,`xAxis`,`rotation`],autoRotatePath:[`style`,`layout`,`dataLabels`,`xAxis`,`autoRotate`,`enable`],isAutoSize:!1,width:cn,height:ln,targetClass:`.vue-ui-age-pyramid-x-axis-label`,rotation:F.value.layout.dataLabels.xAxis.autoRotate.angle});let $=u(()=>ye({config:P,style:F,mutableConfig:U,dialog:Et,accordion:xt,isFullscreen:Z,parent:j,maxWidth:800,isCursorPointer:z}));T(()=>U.value.showTable,e=>ve(e,P,Rt));function Mn(){U.value.showTable=!1,zt.value&&zt.value.setTableIconState(!1)}let Nn=u(()=>P.value.style.backgroundColor),Pn=u(()=>P.value.style.title),{isCallbackImaging:Fn,isCallbackSvg:In,generateSvg:Ln,onGenerateImage:Rn}=_e({svg:B,title:Pn,legend:null,legendItems:null,backgroundColor:Nn,getSvgCallback:()=>P.value.userOptions.callbacks.svg,generateImage:on});async function zn(){Ot(`copyAlt`,{config:P.value,dataset:Y.value}),P.value.userOptions.callbacks.altCopy?await Promise.resolve(P.value.userOptions.callbacks.altCopy({config:P.value,dataset:Y.value})):console.warn("Vue Data UI - A callback must be set for `altCopy` in userOptions.")}function Bn(){Vt.value=!0}function Vn(){A.value=null,M.value=null,N.value=`pointer`,k.value=!1,Vt.value=!1}function Hn(e){if(!B.value||Q.value||document.activeElement!==B.value||!Y.value.length)return;let t=[`ArrowUp`,`ArrowLeft`].includes(e.key),n=[`ArrowDown`,`ArrowRight`].includes(e.key),r=e.key===`Enter`||e.key===` `,i=e.key===`Escape`;if(!t&&!n&&!r&&!i)return;if(e.preventDefault(),e.stopPropagation(),i){A.value=null,M.value=null,N.value=`pointer`,k.value=!1;return}if(r){if(M.value===null)return;let e=D.dataset[M.value];if(!e)return;bn(M.value,e);return}let a=M.value,o=A.value,ee=a!==null&&a>=0&&a<Y.value.length,te=o!==null&&o>=0&&o<Y.value.length;ee?t?a=a-1<0?Y.value.length-1:a-1:n&&(a=a+1>Y.value.length-1?0:a+1):te?(a=n?o+1:o-1,a>=Y.value.length&&(a=0),a<0&&(a=Y.value.length-1)):a=n?0:Y.value.length-1;let s=D.dataset[a];s&&Cn(a,s,`keyboard`)}return pe({getImage:kn,generatePdf:an,generateCsv:wn,generateImage:on,generateSvg:Ln,toggleTable:En,toggleTooltip:Dn,toggleAnnotator:On,toggleFullscreen:Tn,copyAlt:zn}),T(()=>[W.value,I.value,Lt.value,D.dataset,Qt.value,P.value.style.fontFamily],pn,{flush:`post`,deep:!0}),(t,r)=>(y(),p(`div`,{class:Le(`vue-data-ui-component vue-ui-age-pyramid ${Z.value?`vue-data-ui-wrapper-fullscreen`:``}`),ref_key:`agePyramid`,ref:j,id:`vue-ui-age-pyramid_${O.value}`,style:Re(`font-family:${F.value.fontFamily};width:100%; text-align:center;background:${F.value.backgroundColor};${P.value.responsive?`height:100%`:``}`),onMouseenter:r[1]||=()=>w(qt)(!0),onMouseleave:r[2]||=()=>w(qt)(!1)},[m(`div`,{id:`chart-instructions-${O.value}`,class:`sr-only`},[m(`p`,null,C(P.value.a11y.translations.keyboardNavigation),1)],8,Ke),X.value?.body?.length?(y(),d(ke,{key:0,uid:O.value,head:X.value.head,body:X.value.body,notice:P.value.a11y.translations.tableAvailable,caption:P.value.a11y.translations.tableCaption},null,8,[`uid`,`head`,`body`,`notice`,`caption`])):f(``,!0),P.value.userOptions.buttons.annotator?(y(),d(w(Ct),{key:1,svgRef:w(B),backgroundColor:F.value.backgroundColor,color:F.value.color,active:Q.value,isCursorPointer:z.value,palette:P.value.userOptions.annotatorPalette,onClose:On},Ne({_:2},[x(w(xe),e=>({name:e,fn:E(n=>[S(t.$slots,e,v(_(w(be)(e,n))),void 0,!0)])}))]),1032,[`svgRef`,`backgroundColor`,`color`,`active`,`isCursorPointer`,`palette`])):f(``,!0),sn.value?(y(),p(`div`,{key:2,ref_key:`noTitle`,ref:Pt,class:`vue-data-ui-no-title-space`,style:`height:36px; width: 100%;background:transparent`},null,512)):f(``,!0),F.value.title.text?(y(),p(`div`,{key:3,ref_key:`chartTitle`,ref:Mt,style:`width:100%;background:transparent`},[(y(),d(ge,{key:`title_${Ft.value}`,config:{title:{cy:`pyramid-div-title`,...F.value.title},subtitle:{cy:`pyramid-div-subtitle`,...F.value.title.subtitle}}},null,8,[`config`]))],512)):f(``,!0),P.value.userOptions.show&&kt.value&&(w(Jt)||w(Kt))?(y(),d(w(wt),{ref_key:`userOptionsRef`,ref:zt,key:`user_options_${jt.value}`,backgroundColor:F.value.backgroundColor,color:F.value.color,isImaging:w(rn),isPrinting:w(nn),uid:O.value,hasTooltip:P.value.userOptions.buttons.tooltip&&F.value.tooltip.show,hasPdf:P.value.userOptions.buttons.pdf,hasXls:P.value.userOptions.buttons.csv,hasImg:P.value.userOptions.buttons.img,hasSvg:P.value.userOptions.buttons.svg,hasTable:P.value.userOptions.buttons.table,hasFullscreen:P.value.userOptions.buttons.fullscreen,hasAltCopy:P.value.userOptions.buttons.altCopy,isFullscreen:Z.value,isTooltip:U.value.showTooltip,titles:{...P.value.userOptions.buttonTitles},chartElement:j.value,position:P.value.userOptions.position,hasAnnotator:P.value.userOptions.buttons.annotator,isAnnotation:Q.value,callbacks:P.value.userOptions.callbacks,printScale:P.value.userOptions.print.scale,tableDialog:P.value.table.useDialog,isCursorPointer:z.value,onToggleFullscreen:Tn,onGeneratePdf:w(an),onGenerateCsv:wn,onGenerateImage:w(Rn),onGenerateSvg:w(Ln),onToggleTable:En,onToggleTooltip:Dn,onToggleAnnotator:On,onCopyAlt:zn,style:Re({visibility:w(Jt)?w(Kt)?`visible`:`hidden`:`visible`})},Ne({_:2},[x(w(Se)(t.$slots,`menuIcon optionTooltip optionPdf optionCsv optionImg optionSvg optionTable optionFullscreen optionAnnotator optionAltCopy custom-menu-before custom-menu-after`),e=>({name:e,fn:E(n=>[S(t.$slots,e,v(_(w(Ce)(e,n))),void 0,!0)])}))]),1032,/* @__PURE__ */ `backgroundColor.color.isImaging.isPrinting.uid.hasTooltip.hasPdf.hasXls.hasImg.hasSvg.hasTable.hasFullscreen.hasAltCopy.isFullscreen.isTooltip.titles.chartElement.position.hasAnnotator.isAnnotation.callbacks.printScale.tableDialog.isCursorPointer.onGeneratePdf.onGenerateImage.onGenerateSvg.style`.split(`.`))):f(``,!0),m(`div`,qe,[(y(),p(`svg`,{ref_key:`svgRef`,ref:B,xmlns:w(oe),class:Le({"vue-data-ui-fullscreen--on":Z.value,"vue-data-ui-fulscreen--off":!Z.value}),viewBox:`0 0 ${W.value.width<=0?10:W.value.width} ${W.value.height<=0?10:W.value.height}`,style:Re(`max-width:100%;overflow:visible;background:transparent;color:${F.value.color};visibility:${w(dn)?`visible`:`hidden`}`),tabindex:`0`,"aria-describedby":`chart-instructions-${O.value}`,onFocus:Bn,onBlur:Vn,onKeydown:Hn},[h(w(Tt)),S(t.$slots,`svg-underlayer`,{svg:{...W.value,drawingArea:G.value,isPrintingImg:w(nn)||w(rn)||w(Fn),isPrintingSvg:w(In)}},void 0,!0),t.$slots[`chart-background`]?(y(),p(`foreignObject`,{key:0,x:G.value.left,y:G.value.top,width:Math.max(.1,G.value.width),height:Math.max(.1,G.value.height),style:{pointerEvents:`none`}},[S(t.$slots,`chart-background`,{},void 0,!0)],8,Ye)):f(``,!0),m(`defs`,null,[h(Oe,{t:`linear`,id:`age_pyramid_left_${O.value}`,x1:`0%`,y1:`0%`,x2:`100%`,y2:`0%`,stops:[[`0%`,L.value.left.color,1],[`100%`,w(a)(w(ee)(L.value.left.color,L.value.gradient.shiftHue),100-L.value.gradient.intensity),1]]},null,8,[`id`,`stops`]),h(Oe,{t:`linear`,id:`age_pyramid_right_${O.value}`,x1:`0%`,y1:`0%`,x2:`100%`,y2:`0%`,stops:[[`0%`,w(a)(w(ee)(L.value.right.color,L.value.gradient.shiftHue),100-L.value.gradient.intensity),1],[`100%`,L.value.right.color,1]]},null,8,[`id`,`stops`])]),(y(!0),p(l,null,x(Y.value,(e,t)=>(y(),p(`g`,null,[m(`rect`,{x:e.left.x,y:e.left.y,width:w(s)(e.left.width<=0?1e-4:e.left.width),height:e.left.height<=0?1e-4:e.left.height,fill:L.value.gradient.underlayer,rx:L.value.borderRadius},null,8,Xe),m(`rect`,{x:e.left.x,y:e.left.y,width:e.left.width<=0?1e-4:e.left.width,height:e.left.height<=0?1e-4:e.left.height,fill:L.value.gradient.show?`url(#age_pyramid_left_${O.value})`:e.left.color,rx:L.value.borderRadius},null,8,Ze),m(`rect`,{x:e.right.x,y:e.right.y,width:e.right.width<=0?1e-4:e.right.width,height:e.right.height<=0?1e-4:e.right.height,fill:L.value.gradient.underlayer,rx:L.value.borderRadius},null,8,Qe),m(`rect`,{x:e.right.x,y:e.right.y,width:e.right.width<=0?1e-4:e.right.width,height:e.right.height<=0?1e-4:e.right.height,fill:L.value.gradient.show?`url(#age_pyramid_right_${O.value})`:e.right.color,rx:L.value.borderRadius},null,8,$e)]))),256)),(y(!0),p(l,null,x(Y.value,(e,t)=>(y(),p(`g`,null,[R.value.show?(y(),p(l,{key:0},[!R.value.showOnHover||R.value.showOnHover&&A.value===t?(y(),p(`text`,{key:0,x:e.left.x+Math.max(1e-4,e.left.width)-R.value.offsetX-6,y:e.left.y+Math.max(1e-4,e.left.height/2)+L.value.gap/2,"text-anchor":`end`,"dominant-baseline":`middle`,"font-size":R.value.fontSize,"font-weight":R.value.bold?`bold`:`normal`,fill:R.value.color,stroke:F.value.backgroundColor,"paint-order":`stroke fill`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`3`},C(w(c)(R.value.formatter,e.left.value,w(n)({v:e.left.value}),{datapoint:e.left,seriesIndex:t})),9,et)):f(``,!0)],64)):f(``,!0),R.value.show?(y(),p(l,{key:1},[!R.value.showOnHover||R.value.showOnHover&&A.value===t?(y(),p(`text`,{key:0,x:e.right.x+R.value.offsetX+6,y:e.right.y+Math.max(1e-4,e.right.height/2)+L.value.gap/2,"text-anchor":`start`,"dominant-baseline":`middle`,"font-size":R.value.fontSize,"font-weight":R.value.bold?`bold`:`normal`,fill:R.value.color,stroke:F.value.backgroundColor,"paint-order":`stroke fill`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`3`},C(w(c)(R.value.formatter,e.right.value,w(n)({v:e.right.value}),{datapoint:e.right,seriesIndex:t})),9,tt)):f(``,!0)],64)):f(``,!0)]))),256)),m(`g`,null,[I.value.sideTitles.show?(y(),p(`g`,nt,[m(`text`,{x:G.value.left,y:I.value.sideTitles.fontSize,fill:I.value.sideTitles.useSideColor?L.value.left.color:I.value.sideTitles.color,"font-size":I.value.sideTitles.fontSize,"text-anchor":`start`,"font-weight":I.value.sideTitles.bold?`bold`:`normal`},C(P.value.translations.female),9,rt),m(`text`,{x:G.value.right,y:I.value.sideTitles.fontSize,fill:I.value.sideTitles.useSideColor?L.value.right.color:I.value.sideTitles.color,"font-size":I.value.sideTitles.fontSize,"text-anchor":`end`,"font-weight":I.value.sideTitles.bold?`bold`:`normal`},C(P.value.translations.male),9,it)])):f(``,!0),I.value.yAxis.show?(y(),p(`g`,at,[(y(!0),p(l,null,x(hn.value,(e,t)=>(y(),p(l,null,[t%I.value.yAxis.showEvery===0&&(!R.value.show||R.value.showOnHover&&A.value===t||A.value===null)||(R.value.show||R.value.showOnHover)&&A.value===t?(y(),p(`text`,{key:0,x:G.value.centerX,y:G.value.top+G.value.height/J.value/2+G.value.height/J.value*t,"dominant-baseline":`middle`,"text-anchor":`middle`,"font-size":I.value.yAxis.fontSize,fill:I.value.yAxis.color,"font-weight":I.value.yAxis.bold?`bold`:`normal`},C(w(c)(I.value.yAxis.formatter,e,w(n)({v:e}),{datapoint:e,seriesIndex:t})),9,ot)):f(``,!0)],64))),256))])):f(``,!0),I.value.xAxis.show?(y(),p(`g`,st,[F.value.layout.grid.show?(y(),p(`g`,ct,[m(`line`,{x1:K.value.right[0].x,x2:K.value.right.at(-1).x,y1:G.value.bottom+I.value.xAxis.fontSize/2,y2:G.value.bottom+I.value.xAxis.fontSize/2,stroke:F.value.layout.grid.stroke,"stroke-width":F.value.layout.grid.strokeWidth,"stroke-linecap":`round`},null,8,lt),m(`line`,{x1:K.value.left[0].x,x2:K.value.left.at(-1).x,y1:G.value.bottom+I.value.xAxis.fontSize/2,y2:G.value.bottom+I.value.xAxis.fontSize/2,stroke:F.value.layout.grid.stroke,"stroke-width":F.value.layout.grid.strokeWidth,"stroke-linecap":`round`},null,8,ut)])):f(``,!0),(y(!0),p(l,null,x(K.value.right,(e,t)=>(y(),p(`g`,null,[F.value.layout.grid.show?(y(),p(`line`,{key:0,x1:e.x,x2:e.x,y1:G.value.bottom+I.value.xAxis.fontSize/2,y2:G.value.bottom+I.value.xAxis.fontSize/2+4,stroke:F.value.layout.grid.stroke,"stroke-width":F.value.layout.grid.strokeWidth,"stroke-linecap":`round`},null,8,dt)):f(``,!0)]))),256)),(y(!0),p(l,null,x(K.value.left,(e,t)=>(y(),p(`g`,null,[F.value.layout.grid.show?(y(),p(`line`,{key:0,x1:e.x,x2:e.x,y1:G.value.bottom+I.value.xAxis.fontSize/2,y2:G.value.bottom+I.value.xAxis.fontSize/2+4,stroke:F.value.layout.grid.stroke,"stroke-width":F.value.layout.grid.strokeWidth,"stroke-linecap":`round`},null,8,ft)):f(``,!0)]))),256)),m(`g`,{ref_key:`xAxisLabels`,ref:Lt},[(y(!0),p(l,null,x(K.value.right,(e,t)=>(y(),p(`text`,{class:`vue-ui-age-pyramid-x-axis-label`,"font-size":I.value.xAxis.fontSize,fill:I.value.xAxis.color,"text-anchor":I.value.xAxis.rotation>0?`start`:I.value.xAxis.rotation<0?`end`:`middle`,"font-weight":I.value.xAxis.bold?`bold`:`normal`,transform:`translate(${e.x}, ${G.value.bottom+I.value.xAxis.fontSize*2}) rotate(${I.value.xAxis.rotation})`},C(w(c)(I.value.xAxis.formatter,e.value/I.value.xAxis.scale,w(n)({v:e.value/F.value.layout.dataLabels.xAxis.scale}),{datapoint:e,seriesIndex:t})),9,pt))),256)),(y(!0),p(l,null,x(K.value.left,(e,t)=>(y(),p(`text`,{class:`vue-ui-age-pyramid-x-axis-label`,"font-size":I.value.xAxis.fontSize,fill:I.value.xAxis.color,"text-anchor":I.value.xAxis.rotation>0?`start`:I.value.xAxis.rotation<0?`end`:`middle`,"font-weight":I.value.xAxis.bold?`bold`:`normal`,transform:`translate(${e.x}, ${G.value.bottom+I.value.xAxis.fontSize*2}) rotate(${I.value.xAxis.rotation})`},C(w(c)(I.value.xAxis.formatter,e.value/I.value.xAxis.scale,w(n)({v:e.value/F.value.layout.dataLabels.xAxis.scale}),{datapoint:e,seriesIndex:t})),9,mt))),256))],512),m(`text`,{x:G.value.right,y:W.value.height,"text-anchor":`end`,"font-size":I.value.xAxis.fontSize,fill:I.value.xAxis.color,"font-weight":I.value.xAxis.bold?`bold`:`normal`},C(I.value.xAxis.translation),9,ht)])):f(``,!0)]),(y(!0),p(l,null,x(e.dataset,(e,t)=>(y(),p(`g`,null,[m(`rect`,{x:G.value.left,y:G.value.top+G.value.height/J.value*t-L.value.gap/2,width:G.value.width<=0?1e-4:G.value.width,height:G.value.height/J.value<=0?1e-4:G.value.height/J.value,fill:A.value!==null&&A.value===t?w(a)(F.value.highlighter.color,F.value.highlighter.opacity):`transparent`,onMouseover:n=>Cn(t,e,`pointer`),onMouseleave:n=>xn(t,e),onClick:n=>bn(t,e)},null,40,gt)]))),256)),S(t.$slots,`svg`,{svg:{...W.value,drawingArea:G.value,isPrintingImg:w(nn)||w(rn)||w(Fn),isPrintingSvg:w(In)}},void 0,!0)],46,Je)),t.$slots.hint?(y(),p(`div`,_t,[S(t.$slots,`hint`,v(_({hint:P.value.a11y.translations.keyboardNavigation,isVisible:Vt.value})),void 0,!0)])):f(``,!0)]),t.$slots.watermark?(y(),p(`div`,vt,[S(t.$slots,`watermark`,v(_({isPrinting:w(nn)||w(rn)||w(Fn)||w(In)})),void 0,!0)])):f(``,!0),S(t.$slots,`legend`,{legend:Y.value},void 0,!0),t.$slots.source?(y(),p(`div`,{key:6,ref_key:`source`,ref:Nt,dir:`auto`},[S(t.$slots,`source`,{},void 0,!0)],512)):f(``,!0),h(w(yt),{teleportTo:F.value.tooltip.teleportTo,show:U.value.showTooltip&&k.value,backgroundColor:F.value.tooltip.backgroundColor,color:F.value.tooltip.color,borderRadius:F.value.tooltip.borderRadius,borderColor:F.value.tooltip.borderColor,borderWidth:F.value.tooltip.borderWidth,fontSize:F.value.tooltip.fontSize,backgroundOpacity:F.value.tooltip.backgroundOpacity,position:F.value.tooltip.position,offsetX:F.value.tooltip.offsetX,offsetY:F.value.tooltip.offsetY,parent:j.value,content:At.value,isFullscreen:Z.value,isCustom:F.value.tooltip.customFormat&&typeof F.value.tooltip.customFormat==`function`,smooth:F.value.tooltip.smooth,backdropFilter:F.value.tooltip.backdropFilter,smoothForce:F.value.tooltip.smoothForce,smoothSnapThreshold:F.value.tooltip.smoothSnapThreshold,isA11yMode:N.value===`keyboard`,a11yPosition:Bt.value},{"tooltip-before":E(()=>[S(t.$slots,`tooltip-before`,v(_({...vn.value})),void 0,!0)]),tooltip:E(()=>[S(t.$slots,`tooltip`,v(_({...vn.value})),void 0,!0)]),"tooltip-after":E(()=>[S(t.$slots,`tooltip-after`,v(_({...vn.value})),void 0,!0)]),_:3},8,[`teleportTo`,`show`,`backgroundColor`,`color`,`borderRadius`,`borderColor`,`borderWidth`,`fontSize`,`backgroundOpacity`,`position`,`offsetX`,`offsetY`,`parent`,`content`,`isFullscreen`,`isCustom`,`smooth`,`backdropFilter`,`smoothForce`,`smoothSnapThreshold`,`isA11yMode`,`a11yPosition`]),kt.value&&P.value.userOptions.buttons.table?(y(),d(Ve($.value.component),Fe({key:7},$.value.props,{ref_key:`tableUnit`,ref:Rt,onClose:Mn}),Ne({content:E(()=>[(y(),d(w(St),{key:`table_${It.value}`,colNames:X.value.colNames,head:X.value.head,body:X.value.body,config:X.value.config,title:P.value.table.useDialog?``:$.value.title,withCloseButton:!P.value.table.useDialog,isCursorPointer:z.value,onClose:Mn},{th:E(({th:e})=>[Pe(C(e),1)]),td:E(({td:e})=>[Pe(C(e),1)]),_:1},8,[`colNames`,`head`,`body`,`config`,`title`,`withCloseButton`,`isCursorPointer`]))]),_:2},[P.value.table.useDialog?{name:`title`,fn:E(()=>[Pe(C($.value.title),1)]),key:`0`}:void 0,P.value.table.useDialog?{name:`actions`,fn:E(()=>[m(`button`,{tabindex:`0`,class:`vue-ui-user-options-button`,onClick:r[0]||=e=>wn(P.value.userOptions.callbacks.csv),style:Re({cursor:z.value?`pointer`:`default`})},[h(w(bt),{name:`fileCsv`,stroke:$.value.props.color},null,8,[`stroke`])],4)]),key:`1`}:void 0]),1040)):f(``,!0),S(t.$slots,`skeleton`,{},()=>[w(Ut)?(y(),d(ue,{key:0})):f(``,!0)],!0)],46,Ge))}},[[`__scopeId`,`data-v-e4eda545`]]);export{We as n,yt as t};
@@ -0,0 +1,331 @@
1
+ import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{t}from"./useConfig-6jO1fkp5.js";import{C as n,Vt as r,X as i,in as a}from"./lib-rPeBMZrn.js";import{n as o,t as s}from"./useHints-BH9r_0Vd.js";import{t as c}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{t as l}from"./dom-to-png-D56-Zgv4.js";import{t as u}from"./BaseIcon-Cm-IJ179.js";import{t as ee}from"./usePrinter-sVoTzet1.js";import{t as te}from"./vue-ui-accordion-S3nRtTU-.js";import{t as ne}from"./ColorPicker-Dmus34hN.js";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";function ye(e){let t=t=>e.isMacLike.value?t.metaKey:t.ctrlKey,n=e=>{let t=e;if(!t)return!1;let n=(t.tagName||``).toLowerCase();return t.isContentEditable||n===`input`||n===`textarea`||n===`select`},r=t=>!!(!e.isSummaryOpen.value||n(t.target)||e.isWriting.value),i=()=>{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},a=t=>{switch(i(),t){case`m`:e.isMoveMode.value=!0;break;case`r`:e.isResizeMode.value=!0;break;case`d`:e.isDeleteMode.value=!0;break;case`g`:e.isSelectMode.value=!0,e.setShapeTo(`group`),e.activeShape.value=`group`;break;case`t`:e.isTextMode.value=!0,e.isWriting.value=!1,e.showCaret.value=!1}},o=t=>{switch(t){case`c`:e.setShapeTo(`circle`);break;case`s`:e.setShapeTo(`rect`);break;case`a`:e.setShapeTo(`arrow`);break;case`l`:e.setShapeTo(`line`)}},s=(t,n)=>{let r=e.lastSelectedShape.value;if(!r)return;let i=(e,t)=>{typeof r[e]==`number`&&(r[e]+=t)};switch(r.type){case`rect`:case`circle`:case`text`:i(`x`,t),i(`y`,n);break;case`arrow`:i(`x`,t),i(`y`,n),i(`endX`,t),i(`endY`,n)}},c=()=>{let t=e.lastSelectedShape.value;t&&(e.shapes.value=e.shapes.value.filter(e=>e.id!==t.id),e.lastSelectedShape.value=void 0)},l=!1,u=null,ee=()=>{l||(l=!0,e.history?.value?.begin?.(`nudge`))},te=()=>{l&&(clearTimeout(u),u=setTimeout(()=>{l=!1,e.history?.value?.end?.()},160))},ne=()=>{clearTimeout(u),l&&e.history?.value?.end?.(),l=!1},re=n=>{if(t(n)&&!n.shiftKey&&n.key.toLowerCase()===`z`){if(r(n))return;n.preventDefault(),e.undoLastShape?.();return}if(t(n)&&n.shiftKey&&n.key.toLowerCase()===`z`||t(n)&&n.key.toLowerCase()===`y`){if(r(n))return;n.preventDefault(),typeof e.redoLastShape==`function`?e.redoLastShape():e.history?.value?.redo?.();return}if(r(n))return;let l=n.key.toLowerCase();if(l===`escape`)n.preventDefault(),i();else if(l===`delete`||l===`backspace`)n.preventDefault(),c();else if([`m`,`r`,`d`,`g`,`t`].includes(l))n.preventDefault(),a(l);else if([`c`,`a`,`l`,`s`].includes(l))n.preventDefault(),o(l);else if(n.key===`ArrowUp`||n.key===`ArrowDown`||n.key===`ArrowLeft`||n.key===`ArrowRight`){n.preventDefault(),ee();let e=n.shiftKey?10:1;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()}},ie=e=>{e.key.startsWith(`Arrow`)&&te()};return window.addEventListener(`keydown`,re),window.addEventListener(`keyup`,ie),function(){window.removeEventListener(`keydown`,re),window.removeEventListener(`keyup`,ie),ne()}}var be={class:`teleport-tooltip__inner`},C=/*#__PURE__*/ c({__name:`TeleportedTooltip`,props:{show:{type:Boolean,default:!1},x:{type:Number,required:!0},y:{type:Number,required:!0},placement:{type:String,default:`top`},styleObject:{type:Object,default(){return{}}},delay:{type:Number,default:0},delayIn:{type:Number,default:300},delayOut:{type:Number,default:0}},setup(e){let t=e,n=ae(()=>t.delayIn??t.delay),r=ae(()=>t.delayOut??t.delay),i=y(!1),a=null,o=null;function s(){a&&=(clearTimeout(a),null),o&&=(clearTimeout(o),null)}function c(){s();let e=Math.max(0,n.value||0);e===0?i.value=!0:a=setTimeout(()=>{i.value=!0,a=null},e)}function l(){s();let e=Math.max(0,r.value||0);e===0?i.value=!1:o=setTimeout(()=>{i.value=!1,o=null},e)}ge(()=>t.show,e=>{e?c():l()},{immediate:!0}),de(()=>{t.show&&c()}),ue(()=>{s()});let u=ae(()=>({position:`fixed`,zIndex:2147483647,top:`${t.y}px`,left:`${t.x}px`,transform:t.placement===`bottom`?`translate(-50%, 8px)`:`translate(-50%, -100%)`,pointerEvents:`none`,...t.styleObject}));return(t,n)=>(v(),d(ie,{to:`body`},[i.value?(v(),p(`div`,{key:0,class:g([`teleport-tooltip`,e.placement]),style:_(u.value),role:`tooltip`,"aria-hidden":`false`},[m(`div`,be,[b(t.$slots,`default`,{},void 0,!0)])],6)):f(``,!0)]))}},[[`__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={class:`tool-selection`,style:{"margin-top":`6px`}},Le={viewBox:`0 0 12 12`,style:{width:`100%`}},Re=[`fill`],ze={key:0},Be={class:`tool-input`},Ve=[`checked`],He={viewBox:`0 0 12 12`,style:{width:`100%`}},Ue=[`fill`],We={key:1},Ge={class:`tool-input`},Ke=[`checked`],qe={viewBox:`0 0 24 24`,style:{width:`100%`}},Je=[`stroke`],Ye={key:2},Xe={style:{display:`flex`,"flex-direction":`column`,"align-items":`center`,"justify-content":`center`}},Ze={class:`tool-input`},Qe={key:3},$e={style:{display:`flex`,"flex-direction":`column`,"align-items":`center`,"justify-content":`center`}},et={class:`tool-input`},tt=[`checked`],nt={key:4},rt={style:{display:`flex`,"flex-direction":`column`,"align-items":`center`,"justify-content":`center`}},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={style:{display:`flex`,"flex-direction":`column`,"align-items":`center`,"justify-content":`center`},class:`tooltip`},ht={style:{display:`flex`,"flex-direction":`column`,"align-items":`start`,"justify-content":`center`}},gt={class:`tool-input`,style:{"font-variant-numeric":`tabular-nums`}},_t=[`id`],vt=[`viewBox`,`width`,`height`],yt=[`width`,`height`,`pointer-events`],bt=[`innerHTML`,`onClick`,`onDblclick`],xt=[`x1`,`x2`,`y1`,`y2`,`stroke`],St=[`height`,`viewBox`,`width`],Ct=[`cx`,`cy`],wt=`annotations`,Tt=`‎`,Et=450,Dt=/*#__PURE__*/ c({__name:`vue-ui-annotator`,props:{config:{type:Object,default(){return{}}},dataset:{type:Object,default(){return{shapes:[],lastSelectedShape:void 0}}}},emits:[`toggleOpenState`,`saveAnnotations`],setup(e,{emit:c}){let be=e,xe=c,Dt=y(!1),Ot=y(!1);de(()=>Dt.value=!0);let kt=y(i()),{isImaging:At,generateImage:jt}=ee({elementId:kt.value,fileName:wt}),w=y(void 0),Mt=y(1),T=y({start:{x:0,y:0},end:{x:0,y:0}}),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);ge(M,async e=>{Ot.value=!1,e?(await ce(),Ot.value=!0):(F.value=void 0,E.value=void 0,Nt.value=void 0,Wt.value=[],j.value=!1)});let N=y(!1),Ht=y(!1),P=y(!1),F=y(be.dataset?.lastSelectedShape??void 0),I=y({x:0,y:0}),Ut=y(!0),Wt=y([]),L=y(be.dataset?.shapes||[]);y([]);let Gt=y(Math.round(Math.random())*1e5),Kt=y(1e3),qt=y(1e3),R=y({arrow:{color:`grey`,filled:!0},circle:{color:`grey`,filled:!1,radius:3,strokeWidth:2},rect:{color:`grey`,filled:!1,strokeWidth:2,height:12,width:12}}),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=r,tn=y(null),nn=y(null),V=y(null),rn=y(null),an=y(null),on=y(!1),sn=y({row:0,col:0}),H=y(null),U=y(!1),W=y(null),G=y({x:0,y:0}),cn=y(null),ln=y([]),un=y(!1),dn=y(null),fn=y({undo:0,redo:0}),pn=y(null);y(null),y(null);let mn=y(null),K=ae(()=>{let e=t().vue_ui_annotator;if(!Object.keys(be.config||{}).length)return e;let r=a({defaultConfig:e,userConfig:be.config});return n(r)}),hn=y(K.value.style.paletteColor),q=ae(()=>K.value.style.buttons),J=ae(()=>K.value.style);o({config:()=>K.value,dataset:()=>[],component:`VueUiAnnotator`,rules:[s.noHint]});let Y=ae(()=>K.value.useCursorPointer),X=ae(()=>{let e=J.value.tooltips;return{backgroundColor:e.backgroundColor,color:e.color,border:e.border,borderRadius:`${e.borderRadius}px`,boxShadow:e.boxShadow}}),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(()=>{switch(!0){case D.value:return`default`;case k.value:return`move`;case N.value:return`text`;case A.value:return`move`;default:return``}}),yn=ae(()=>L.value),bn=y(null);function xn(e){return e?!!(F.value&&F.value.id===e.id):!1}function Sn(e=``){let t=String(e).trim().split(/\s+/).map(Number).filter(Number.isFinite),n=[];for(let e=0;e+1<t.length;e+=2)n.push({x:t[e],y:t[e+1]});return n}function Cn(e=[]){return e.map(({x:e,y:t})=>`${e} ${t}`).join(` `)}function wn(e=``){let t=Sn(e);if(!t.length)return null;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);return{minX:i,minY:o,maxX:a,maxY:s,width:Math.max(1,a-i),height:Math.max(1,s-o)}}function Tn(e){if(!e||!M.value||!A.value||!F.value||F.value.id!==e.id)return``;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`})=>`
2
+ <circle
3
+ data-dom-to-png-ignore
4
+ id="${e.id}"
5
+ data-resize-handle="${r}"
6
+ cx="${i}"
7
+ cy="${a}"
8
+ r="7"
9
+ fill="${n}"
10
+ stroke="${t}"
11
+ stroke-width="2"
12
+ pointer-events="all"
13
+ style="cursor:${o}"
14
+ />
15
+ `;if(e.type===`arrow`)return`
16
+ ${r({handle:`arrow-start`,x:e.x,y:e.y,cursor:`move`})}
17
+ ${r({handle:`arrow-end`,x:e.endX,y:e.endY,cursor:`move`})}
18
+ `;if(e.type===`line`){let t=wn(e.path);return t?r({handle:`line-scale`,x:t.maxX,y:t.maxY}):``}if(e.type===`circle`){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;return r({handle:`circle-radius`,x:n?.x??e.x+t,y:n?.y??e.y,cursor:`move`})}if(e.type===`rect`){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);return`
19
+ ${r({handle:`rect-nw`,x:t,y:n,cursor:`nwse-resize`})}
20
+ ${r({handle:`rect-ne`,x:i,y:n,cursor:`nesw-resize`})}
21
+ ${r({handle:`rect-se`,x:i,y:a,cursor:`nwse-resize`})}
22
+ ${r({handle:`rect-sw`,x:t,y:a,cursor:`nesw-resize`})}
23
+ `}return e.type===`group`?r({handle:`group-scale`,x:e.x+e.rectWidth,y:e.y+e.rectHeight}):``}function En(e){if(!e||e.type===`text`&&P.value&&rn.value===e.id)return``;let t=xn(e)?`initial`:`none`;switch(e.type){case`rect`:return`
24
+ <rect
25
+ data-dom-to-png-ignore
26
+ style="stroke-dasharray: 10; display:${t}"
27
+ x="${e.x-20}"
28
+ y="${e.y-20}"
29
+ height="${e.rectHeight+40}"
30
+ width="${e.rectWidth+40}"
31
+ fill="transparent"
32
+ stroke="grey"
33
+ pointer-events="none"
34
+ />
35
+ `;case`circle`:return`
36
+ <rect
37
+ data-dom-to-png-ignore
38
+ style="stroke-dasharray: 10; display:${t}"
39
+ x="${e.x-e.circleRadius-20}"
40
+ y="${e.y-e.circleRadius-20}"
41
+ height="${e.circleRadius*2+40}"
42
+ width="${e.circleRadius*2+40}"
43
+ fill="transparent"
44
+ stroke="grey"
45
+ pointer-events="none"
46
+ />
47
+ `;case`arrow`:{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));return`
48
+ <rect
49
+ style="stroke-dasharray: 10; display:${t}"
50
+ x="${n-20}"
51
+ y="${r-20}"
52
+ height="${a+40}"
53
+ width="${i+40}"
54
+ fill="transparent"
55
+ stroke="grey"
56
+ pointer-events="none"
57
+ />
58
+ `}case`line`:{let n=wn(e.path);return n?`
59
+ <rect
60
+ style="stroke-dasharray: 10; display:${t}"
61
+ x="${n.minX-20}"
62
+ y="${n.minY-20}"
63
+ height="${n.height+40}"
64
+ width="${n.width+40}"
65
+ fill="transparent"
66
+ stroke="grey"
67
+ pointer-events="none"
68
+ />
69
+ `:``}case`text`:{let n=bn.value?Array.from(bn.value.getElementsByTagName(`text`)).find(t=>t.getAttribute(`data-shape-id`)===e.id):null;if(!n)return``;let{x:r,y:i,width:a,height:o}=n.getBBox();return`
70
+ <rect
71
+ style="stroke-dasharray: 10; display:${t}"
72
+ x="${r-20}"
73
+ y="${i-20}"
74
+ height="${o+40}"
75
+ width="${a+40}"
76
+ fill="transparent"
77
+ stroke="grey"
78
+ pointer-events="none"
79
+ />
80
+ `}default:return``}}function Dn(e,t=!1){switch(!0){case e.type===`circle`:return`
81
+ <g id="${e.id}" style="display:${D.value?`initial`:`none`};">
82
+ <circle id="${e.id}" cx="${e.x}" cy="${e.y}" r="12" fill="red"/>
83
+ <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}"/>
84
+ <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}"/>
85
+ </g>
86
+ `;case e.type===`text`:let n,r=[-8,-12,-4,-12,-4];switch(!0){case e.textAlign===`start`:n=t?[-20,-24,-16,-16,-24]:[-16,-20,-12,-12,-20];break;case e.textAlign===`middle`:n=[0,-4,4,4,-4],r=[-32,-36,-28,-36,-28];break;case e.textAlign===`end`:n=[16,20,12,12,20];break;default:n=[0,0,0]}return`
87
+ <g id="${e.id}" style="display:${D.value?`initial`:`none`};">
88
+ <circle id="${e.id}" cx="${e.x+n[0]}" cy="${e.y+r[0]}" r="12" fill="red"/>
89
+ <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]}"/>
90
+ <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]}"/>
91
+ </g>
92
+ `;default:return`
93
+ <g id="${e.id}" style="display:${D.value?`initial`:`none`};">
94
+ <circle id="${e.id}" cx="${e.x-4}" cy="${e.y-4}" r="12" fill="red"/>
95
+ <line stroke="white" stroke-width="2" id="${e.id}" x1="${e.x-8}" y1="${e.y-8}" x2="${e.x}" y2="${e.y}"/>
96
+ <line stroke="white" stroke-width="2" id="${e.id}" x1="${e.x}" y1="${e.y-8}" x2="${e.x-8}" y2="${e.y}"/>
97
+ </g>
98
+ `}}function On(e=``){return String(e).replace(/&nbsp;/g,`\xA0`)}function kn(e){return String(e?.textContent??``).split(Tt).map(On)}function An(e,t){if(!e)return;let n=t.length?t:[``];e.textContent=n.join(Tt),e.lines=Math.max(0,n.length-1)}function jn(e=``){return String(e).replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`)}function Mn(e=``){return jn(On(e))||`&#8203;`}function Nn(e,t,n=!1){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);return`
99
+ <g id="${e.id}">
100
+ <rect
101
+ id="${e.id}"
102
+ data-shape-hit-area="true"
103
+ x="${s-8}"
104
+ y="${e.y-e.fontSize}"
105
+ height="${c+8}"
106
+ width="${o+16}"
107
+ fill="transparent"
108
+ pointer-events="all"
109
+ />
110
+ <text
111
+ data-shape-id="${e.id}"
112
+ style="user-select:none;"
113
+ id="${e.id}"
114
+ x="${e.x}"
115
+ y="${e.y}"
116
+ text-anchor="${e.textAlign}"
117
+ font-size="${e.fontSize}"
118
+ fill="${e.color}"
119
+ font-weight="${e.isBold?`bold`:`normal`}"
120
+ font-style="${e.isItalic?`italic`:`normal`}"
121
+ text-decoration="${e.isUnderline?`underline`:`none`}"
122
+ pointer-events="bounding-box"
123
+ >
124
+ ${t.join(``)}
125
+ </text>
126
+ ${Dn(e,n)}
127
+ </g>
128
+ `}let Pn=ae(()=>yn.value.map(e=>{switch(!0){case e&&e.type===`arrow`:{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);return{html:`
129
+ <defs>
130
+ <marker
131
+ id="${r}"
132
+ markerWidth="${t}"
133
+ markerHeight="${t}"
134
+ refX="0"
135
+ refY="${n}"
136
+ orient="auto"
137
+ >
138
+ <polygon
139
+ points="0 0,${t} ${n}, 0 ${t}"
140
+ fill="${e.color}"
141
+ />
142
+ </marker>
143
+ </defs>
144
+ <g id="${e.id}">
145
+ ${En(e)}
146
+ <path
147
+ id="${e.id}"
148
+ data-shape-hit-area="true"
149
+ d="M${e.x},${e.y} ${e.endX},${e.endY}"
150
+ fill="none"
151
+ stroke="transparent"
152
+ stroke-width="${i}"
153
+ pointer-events="stroke"
154
+ />
155
+ <path
156
+ id="${e.id}"
157
+ data-shape-visible="true"
158
+ style="stroke-linecap: round !important; ${e.isDash?`stroke-dasharray: ${e.strokeWidth*3}`:``}"
159
+ stroke="${e.color}"
160
+ d="M${e.x},${e.y} ${e.endX},${e.endY}"
161
+ stroke-width="${e.strokeWidth}"
162
+ fill="none"
163
+ pointer-events="stroke"
164
+ marker-end="url(#${r})"
165
+ />
166
+ ${Tn(e)}
167
+ ${Dn(e)}
168
+ </g>
169
+ `,id:e.id}}case e&&e.type===`circle`:return{html:`
170
+ <g id="${e.id}">
171
+ ${En(e)}
172
+ <circle
173
+ id="${e.id}"
174
+ cx="${e.x}"
175
+ cy="${e.y}"
176
+ r="${e.circleRadius?e.circleRadius:Number.MIN_VALUE}"
177
+ fill="${e.isFilled?e.color+e.alpha:`rgba(255,255,255,0.001)`}"
178
+ stroke="${e.color+e.alpha}"
179
+ stroke-width="${e.strokeWidth}"
180
+ style="${e.isDash?`stroke-dasharray: ${e.strokeWidth*3}`:``}"
181
+ >
182
+ </circle>
183
+ ${Tn(e)}
184
+ </g>
185
+
186
+ ${Dn(e)}`,id:e.id};case e&&e.type===`group`:return{html:`<g id="${e.id}">
187
+ <rect
188
+ data-dom-to-png-ignore
189
+ id="${A.value?``:e.id}"
190
+ x="${e.x}"
191
+ y="${e.y}"
192
+ fill="transparent"
193
+ height="${e.rectHeight}"
194
+ width="${e.rectWidth}"
195
+ stroke="grey"
196
+ stroke-width="1"
197
+ style="rx:1 !important; ry:1 !important; ${e.isDash?`stroke-dasharray: ${e.strokeWidth*3}`:``}; display:${j.value||D.value||xn(e)?`initial`:`none`};"
198
+ />
199
+ <g id="${e.id}">
200
+ ${e.content?e.content:``}
201
+ </g>
202
+ ${Tn(e)}
203
+ ${Dn(e)}
204
+ </g> `,id:e.id};case e&&e.type===`rect`:return{html:`<g id="${e.id}">
205
+ ${En(e)}
206
+ <rect
207
+ id="${A.value?``:e.id}"
208
+ x="${e.x}"
209
+ y="${e.y}"
210
+ fill="${e.isFilled?e.color+e.alpha:`rgba(255,255,255,0.001)`}"
211
+ height="${e.rectHeight}"
212
+ width="${e.rectWidth}"
213
+ stroke="${e.color+e.alpha}"
214
+ stroke-width="${e.strokeWidth}"
215
+ style="rx:1 !important; ry:1 !important; ${e.isDash?`stroke-dasharray: ${e.strokeWidth*3}`:``}"
216
+ />
217
+ ${Tn(e)}
218
+ ${Dn(e)}
219
+ </g> `,id:e.id};case e&&e.type===`line`:{let t=Math.max(24,Number(e.strokeWidth||1)+24);return{html:`
220
+ <g id="${e.id}">
221
+ ${En(e)}
222
+ <path
223
+ id="${e.id}"
224
+ data-shape-hit-area="true"
225
+ d="M${e.path?e.path:``}"
226
+ fill="none"
227
+ stroke="transparent"
228
+ stroke-width="${t}"
229
+ stroke-linecap="round"
230
+ stroke-linejoin="round"
231
+ pointer-events="stroke"
232
+ />
233
+ <path
234
+ id="${e.id}"
235
+ data-shape-visible="true"
236
+ d="M${e.path?e.path:``}"
237
+ 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}`:``}"
238
+ pointer-events="stroke"
239
+ />
240
+ ${Tn(e)}
241
+ ${Dn(e)}
242
+ </g>
243
+ `,id:e.id}}case e&&e.type===`text`:{let t=kn(e),n=[];for(let r=0;r<t.length;r+=1)n.push(`
244
+ ${e.isBulletTextMode?`<tspan
245
+ data-bullet-line="${r}"
246
+ x="${e.x-e.fontSize}"
247
+ y="${e.y+e.fontSize*r}"
248
+ id="${e.id}"
249
+ font-size="${e.fontSize/2}"
250
+ >⬤</tspan>`:``}
251
+ <tspan
252
+ data-text-line="${r}"
253
+ id="${e.id}"
254
+ x="${e.x}"
255
+ y="${e.y+e.fontSize*r}"
256
+ >${Mn(t[r])}</tspan>`);return{html:`
257
+ ${En(e)}
258
+ ${Nn(e,n,e.isBulletTextMode)}
259
+ `,id:e.id}}}}));function Z(e){if(e==null)return e;try{return typeof structuredClone==`function`?structuredClone(e):JSON.parse(JSON.stringify(e))}catch{return Array.isArray(e)?e.map(e=>Z(e)):typeof e==`object`?Object.fromEntries(Object.entries(e).map(([e,t])=>[e,Z(t)])):e}}function Fn(e=!1){if(!w.value||!Lt.value)return;T.value.end={x:I.value.x,y:I.value.y};let t;L.value.length>0&&E.value&&(t=[...L.value].find(e=>e.id===E.value.id));let n,r,i;t&&(n=t.x-T.value.end.x,r=t.y-T.value.end.y,i=Math.sqrt(n*n+r*r));let a,o;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){case w.value===`arrow`:L.value.at(-1).endX=T.value.end.x,L.value.at(-1).endY=T.value.end.y;break;case w.value===`circle`:L.value.at(-1).circleRadius=Rt.value?Z(a-o)+20:i+20;break;case w.value===`line`:L.value.at(-1).path+=` ${I.value.x} ${I.value.y} `;break;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}}function In(){Lt.value?(Fn(),pn.value=requestAnimationFrame(In)):pn.value=null}function Ln(e){let t=L.value.findIndex(t=>t.id===e);if(t>-1&&t!==L.value.length-1){let[e]=L.value.splice(t,1);L.value.push(e)}}function Rn(e){let t=e;for(;t&&t!==bn.value;){let e=t.id;if(e&&L.value.some(t=>t.id===e))return e;t=t.parentElement}return null}function zn(e){if(!M.value)return null;let t=Rn(e?.target);if(t)return t;let n=bn.value?.querySelector(`.annotator__glass`);if(!n)return null;let r=e?.touches?.[0]||e?.changedTouches?.[0],i=r?r.clientX:e?.clientX,a=r?r.clientY:e?.clientY;if(!Number.isFinite(i)||!Number.isFinite(a))return null;let o=n.style.pointerEvents;n.style.pointerEvents=`none`;let s=document.elementFromPoint(i,a);return n.style.pointerEvents=o||`all`,Rn(s)}function Bn(e={}){let{maxEntries:t=200,maxBytes:n=2e6}=e,r={open:!1,before:null,undo:[],redo:[]},i={undo:0,redo:0},a=e=>typeof e==`string`?e.length*2:0,o=()=>JSON.stringify({shapes:Z(L.value),lastSelectedShape:Z(F.value)}),s=e=>{let t=JSON.parse(e);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},c=()=>{fn.value.undo=r.undo.length,fn.value.redo=r.redo.length},l=(e,o)=>{let s=r[e];for(s.push(o),i[e]+=a(o);s.length>t||i[e]>n;){let t=s.shift();i[e]-=a(t)}};return{begin(){r.open||(r.open=!0,r.before=o())},end(){r.open&&(r.open=!1,o()!==r.before&&(l(`undo`,r.before),r.redo.length=0,i.redo=0),r.before=null,c())},undo(){let e=r.undo.pop();if(!e)return;i.undo-=a(e);let t=o();l(`redo`,t),s(e),c()},redo(){let e=r.redo.pop();if(!e)return;i.redo-=a(e);let t=o();l(`undo`,t),s(e),c()},size(){return{undo:r.undo.length,redo:r.redo.length,approxBytes:{undo:i.undo,redo:i.redo}}}}}function Vn(){if(!cn.value)return;let e=cn.value.getBoundingClientRect();G.value={x:e.left+e.width/2,y:e.top}}function Q(e,t,n=`top`){W.value=e,cn.value=t.currentTarget||t.target,Vn(),U.value=!0,window.addEventListener(`scroll`,Vn,!0),window.addEventListener(`resize`,Vn,{passive:!0})}function $(){U.value=!1,W.value=null,cn.value=null,window.removeEventListener(`scroll`,Vn,!0),window.removeEventListener(`resize`,Vn)}function Hn(e){let t=Rn(e?.target)||E.value?.id||Nt.value,n=L.value.find(e=>e.id===t);if(!n){tn.value=null;return}F.value=n,E.value={id:n.id};let r=I.value.x,i=I.value.y;switch(n.type){case`rect`:case`circle`:case`text`:tn.value={dx:r-n.x,dy:i-n.y};break;case`arrow`:tn.value={dx:r-n.x,dy:i-n.y,endDx:r-n.endX,endDy:i-n.endY};break;case`line`:tn.value={startX:r,startY:i,path:n.path};break;case`group`:tn.value={dx:r-(n.x||0),dy:i-(n.y||0)};break;default:tn.value={dx:0,dy:0}}}function Un(e,t){if(nn.value=t||null,V.value=null,e){if(e.type===`line`&&t===`line-scale`){let t=Sn(e.path),n=wn(e.path);if(!t.length||!n)return;V.value={shapeId:e.id,points:t,bounds:n}}else if(e.type===`rect`&&t?.startsWith(`rect-`)){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);V.value={shapeId:e.id,bounds:{left:t,top:n,right:r,bottom:i}}}else if(e.type===`circle`&&t===`circle-radius`){let t=Math.max(1,Number(e.circleRadius)||1);V.value={shapeId:e.id,anchor:{x:(Number(e.x)||0)-t,y:Number(e.y)||0},handlePoint:{x:(Number(e.x)||0)+t,y:Number(e.y)||0}}}}}function Wn(e){let t=L.value.find(e=>e.id===F.value.id);switch(!0){case e===`front`:L.value=L.value.filter(e=>e.id!==t.id),L.value.push(t);break;case e===`back`:L.value=L.value.filter(e=>e.id!==t.id),L.value=[t,...L.value];break;default:return}}function Gn(){if(!F.value?.id)return;let e={...F.value,id:`${F.value.id}_copy_${i()}`,x:F.value.x-100<0?1:F.value.x-100,y:F.value.y-100<0?1:F.value.y-100};L.value.push(e)}function Kn(e){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))}function qn(e){M.value?(e.preventDefault(),Ut.value=!1,Nt.value=Rn(e.target)||void 0):Nt.value=void 0}function Jn(){let e=rn.value;!e||!bn.value||!P.value?H.value=null:ce(()=>{if(!bn.value||!P.value||rn.value!==e){H.value=null;return}let t=L.value.find(t=>t.id===e);if(!t||t.type!==`text`){H.value=null;return}let n=Array.from(bn.value.getElementsByTagName(`text`)).find(t=>t.getAttribute(`data-shape-id`)===e);if(!n){H.value=null;return}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`);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);let l=e=>(c.textContent=e||`​`,typeof c.getComputedTextLength==`function`?c.getComputedTextLength():c.getBBox().width),u=l(s),ee=l(a);c.remove();let te=t.x;t.textAlign===`middle`?te-=ee/2:t.textAlign===`end`&&(te-=ee);let ne=t.y+t.fontSize*i;H.value={x:te+u,y1:ne-t.fontSize*.85,y2:ne+t.fontSize*.15,color:t.color||J.value.color}})}function Yn(e,{isNew:t=!1}={}){if(!e||e.type!==`text`)return;if(P.value&&rn.value===e.id){let t=kn(e),n=Math.max(0,t.length-1);sn.value={row:n,col:(t[n]||``).length},z.value=!0,Jn();return}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;let n=kn(e),r=Math.max(0,n.length-1);sn.value={row:r,col:(n[r]||``).length},Kn(e),N.value=!0,P.value=!0,z.value=!0,O.value=!1,w.value=void 0,H.value=null,Jn()}function Xn({cancel:e=!1}={}){let t=rn.value;if(!t){P.value=!1,z.value=!1,H.value=null;return}let n=L.value.find(e=>e.id===t);if(e){if(on.value)L.value=L.value.filter(e=>e.id!==t),n=null;else if(an.value){let e=L.value.findIndex(e=>e.id===t);e!==-1&&(L.value[e]=Z(an.value),n=L.value[e])}}else n&&kn(n).every(e=>e.length===0)&&(L.value=L.value.filter(e=>e.id!==t),n=null);rn.value=null,an.value=null,on.value=!1,sn.value={row:0,col:0},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)}function Zn(){if(P.value){Xn();return}let e=F.value;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))}function Qn(){ln.value?.begin?.();let e={id:`text_${i()}`,type:`text`,lines:0,x:I.value.x,y:I.value.y,textContent:``,fontSize:Z(Qt.value),textAlign:Z(B.value),isBold:Z(Pt.value),isItalic:Z(zt.value),isUnderline:Z(Ht.value),color:Z(hn.value),isBulletTextMode:Z(Ft.value)};L.value.push(e),F.value=e,E.value={id:e.id},Yn(e,{isNew:!0})}let $n=0;function er(e){M.value&&!D.value&&(e.preventDefault(),e.stopPropagation(),Fr(e),!Rn(e.target)&&(Date.now()<$n||(P.value&&Xn(),N.value&&!A.value?Qn():(!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))))}function tr(e){F.value&&F.value.type===`text`&&(F.value.textAlign=e,B.value=e,Jn())}function nr(){P.value&&Xn(),ln.value?.undo?.()}function rr(){P.value&&Xn(),ln.value?.redo?.()}function ir(e){if(!P.value||!rn.value)return;let t=L.value.find(e=>e.id===rn.value);if(!t||t.type!==`text`){Xn();return}let n=kn(t);n.length||(n=[``]);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;if(e.key===`Escape`)e.preventDefault(),Xn({cancel:!0});else{if(e.key===`Enter`){e.preventDefault();let t=n[r];n.splice(r,1,t.slice(0,i),t.slice(i)),r+=1,i=0,a=!0}else if(e.key===`Backspace`){if(e.preventDefault(),i>0)n[r]=n[r].slice(0,i-1)+n[r].slice(i),--i,a=!0;else if(r>0){let e=n[r-1].length;n[r-1]+=n[r],n.splice(r,1),--r,i=e,a=!0}}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);else if(e.key===`ArrowLeft`)e.preventDefault(),i>0?--i:r>0&&(--r,i=n[r].length),o=!0;else if(e.key===`ArrowRight`)e.preventDefault(),i<n[r].length?i+=1:r<n.length-1&&(r+=1,i=0),o=!0;else if(e.key===`ArrowUp`)e.preventDefault(),r>0&&(--r,i=Math.min(i,n[r].length)),o=!0;else if(e.key===`ArrowDown`)e.preventDefault(),r<n.length-1&&(r+=1,i=Math.min(i,n[r].length)),o=!0;else if(e.key===`Home`)e.preventDefault(),i=0,o=!0;else if(e.key===`End`)e.preventDefault(),i=n[r].length,o=!0;else if(e.key===`Tab`)e.preventDefault(),n[r]=n[r].slice(0,i)+` `+n[r].slice(i),i+=4,a=!0;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;else return;a&&(t.isBold=Z(Pt.value),t.isItalic=Z(zt.value),t.isUnderline=Z(Ht.value),An(t,n)),(a||o)&&(sn.value={row:r,col:i},z.value=!0,Jn())}}function ar(e){if(!e)return null;switch(e.type){case`arrow`:return{left:Math.min(e.x,e.endX),top:Math.min(e.y,e.endY),right:Math.max(e.x,e.endX),bottom:Math.max(e.y,e.endY)};case`circle`:{let t=Math.max(0,Number(e.circleRadius)||0);return{left:e.x-t,top:e.y-t,right:e.x+t,bottom:e.y+t}}case`rect`:case`group`:return{left:e.x,top:e.y,right:e.x+e.rectWidth,bottom:e.y+e.rectHeight};case`line`:{let t=wn(e.path);return t?{left:t.minX,top:t.minY,right:t.maxX,bottom:t.maxY}:null}case`text`:return{left:e.x,top:e.y,right:e.x,bottom:e.y};default:return null}}function or(e,t){let n=ar(e);if(!n)return!1;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);return r<=n.left&&i<=n.top&&a>=n.right&&o>=n.bottom}function sr(e,t){let n=Z(e),r=Number(t.x)||0,i=Number(t.y)||0;switch(n.type){case`circle`:case`rect`:case`text`:n.x=r+(Number(n.diffX)||0),n.y=i+(Number(n.diffY)||0);break;case`arrow`: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);break;case`line`:Array.isArray(n.diffPoints)&&n.diffPoints.length&&(n.path=Cn(n.diffPoints.map(e=>({x:r+e.x,y:i+e.y}))))}return n.id=n.oldId||n.id,delete n.diffX,delete n.diffY,delete n.diffEndX,delete n.diffEndY,delete n.diffPoints,n}function cr(e){return e.type===`group`?(e.source||[]).flatMap(t=>t.type===`group`?cr(sr(t,e)):[sr(t,e)]):[Z(e)]}function lr(e,t){let n={...Z(e),id:t.id,oldId:e.oldId||e.id,diffX:(Number(e.x)||0)-t.x,diffY:(Number(e.y)||0)-t.y,diffEndX:Number.isFinite(Number(e.endX))?Number(e.endX)-t.x:0,diffEndY:Number.isFinite(Number(e.endY))?Number(e.endY)-t.y:0};return e.type===`line`&&(n.diffPoints=Sn(e.path).map(e=>({x:e.x-t.x,y:e.y-t.y}))),n}function ur(){if(Wt.value=[],w.value!==`group`)return j.value=!1,L.value=L.value.filter(e=>e.type!==`group`),null;let e=L.value.at(-1);if(!e||e.type!==`group`)return null;let t=L.value.filter(t=>t.id!==e.id&&or(t,e));if(t.length<2)return L.value=L.value.filter(t=>t.id!==e.id),null;let n=t.flatMap(e=>cr(e));Wt.value=n.map(t=>lr(t,e)),e.source=Wt.value,e.content=``;let r=new Set(t.map(e=>e.id));return L.value=L.value.filter(t=>t.id===e.id||!r.has(t.id)),dr(e),e}function dr(e){e.content=``;let t=e.x||0,n=e.y||0;(e.source||[]).forEach(r=>{switch(r.type){case`circle`:{let i=t+r.diffX,a=n+r.diffY;e.content+=`
260
+ <circle
261
+ id="${r.id}"
262
+ cx="${i}"
263
+ cy="${a}"
264
+ r="${r.circleRadius?r.circleRadius:Number.MIN_VALUE}"
265
+ fill="${r.isFilled?r.color+r.alpha:`rgba(255,255,255,0.001)`}"
266
+ stroke="${r.color+r.alpha}"
267
+ stroke-width="${r.strokeWidth}"
268
+ style="${r.isDash?`stroke-dasharray: ${r.strokeWidth*3}`:``}"
269
+ />
270
+ `;break}case`rect`:{let i=t+r.diffX,a=n+r.diffY;e.content+=`
271
+ <rect
272
+ id="${A.value?``:r.id}"
273
+ x="${i}"
274
+ y="${a}"
275
+ fill="${r.isFilled?r.color+r.alpha:`rgba(255,255,255,0.001)`}"
276
+ height="${r.rectHeight}"
277
+ width="${r.rectWidth}"
278
+ stroke="${r.color+r.alpha}"
279
+ stroke-width="${r.strokeWidth}"
280
+ style="rx:1 !important; ry:1 !important; ${r.isDash?`stroke-dasharray: ${r.strokeWidth*3}`:``}"
281
+ />
282
+ `;break}case`arrow`:{let a=t+r.diffX,o=n+r.diffY,s=t+r.diffEndX,c=n+r.diffEndY,l=r.strokeWidth>3?5:10,u=r.strokeWidth>3?2.5:5,ee=`m_${r.id}_${i()}`;e.content+=`
283
+ <g id="${r.id}">
284
+ <defs>
285
+ <marker
286
+ id="${ee}"
287
+ markerWidth="${l}"
288
+ markerHeight="${l}"
289
+ refX="0"
290
+ refY="${u}"
291
+ orient="auto">
292
+ <polygon points="0 0,${l} ${u}, 0 ${l}" fill="${r.color}" />
293
+ </marker>
294
+ </defs>
295
+ <path
296
+ style="stroke-linecap: round !important; ${r.isDash?`stroke-dasharray: ${r.strokeWidth*3}`:``}"
297
+ stroke="${r.color}"
298
+ id="${r.id}"
299
+ d="M${a},${o} ${s},${c}"
300
+ stroke-width="${r.strokeWidth}"
301
+ marker-end="url(#${ee})"
302
+ />
303
+ </g>
304
+ `;break}case`line`:{let i=Cn(Array.isArray(r.diffPoints)&&r.diffPoints.length?r.diffPoints.map(e=>({x:t+e.x,y:n+e.y})):Sn(r.path));e.content+=`
305
+ <path
306
+ id="${r.id}"
307
+ d="M${i}"
308
+ style="stroke:${r.color+r.alpha} !important; fill:none; stroke-width:${r.strokeWidth} !important; stroke-linecap:round !important; stroke-linejoin:round !important; ${r.isDash?`stroke-dasharray: ${r.strokeWidth*3}`:``}"
309
+ />
310
+ `;break}case`text`:{let i=(r.textContent||``).split(`‎`).map((e,i)=>`
311
+ ${r.isBulletTextMode?`<tspan x="${t+r.diffX-r.fontSize}" y="${n+r.diffY+r.fontSize*i}" id="${r.id}" font-size="${r.fontSize/2}">⬤</tspan>`:``}
312
+ <tspan id="${r.id}" x="${t+r.diffX}" y="${n+r.diffY+r.fontSize*i}">
313
+ ${e}
314
+ </tspan>
315
+ `).join(``);e.content+=`
316
+ <g id="${r.id}">
317
+ <text
318
+ style="user-select:none; height:100px;"
319
+ id="${r.id}"
320
+ x="${t+r.diffX}"
321
+ y="${n+r.diffY}"
322
+ text-anchor="${r.textAlign}"
323
+ font-size="${r.fontSize}"
324
+ fill="${r.color}"
325
+ font-weight="${r.isBold?`bold`:`normal`}"
326
+ font-style="${r.isItalic?`italic`:`normal`}"
327
+ text-decoration="${r.isUnderline?`underline`:`none`}">
328
+ ${i}
329
+ </text>
330
+ </g>
331
+ `;break}}})}function fr(e){e.relatedTarget&&bn.value&&bn.value.contains(e.relatedTarget)||(Ut.value=!0,Nt.value=void 0)}function pr(){if(Lt.value=!0,!w.value&&!j.value||!Lt.value)return;Rt.value=!0,T.value.start={x:I.value.x,y:I.value.y};let e=`${j.value?`group`:w.value}_${i()}`;switch(!0){case w.value===`arrow`:L.value.push({id:e,x:I.value.x,y:I.value.y,endX:I.value.x,endY:I.value.y,type:w.value,color:Z(hn.value),strokeWidth:Z(Math.abs(Mt.value)),isDash:Z(It.value)}),F.value=L.value.at(-1);break;case w.value===`circle`:L.value.push({alpha:R.value.circle.filled?_n.value:``,id:e,color:Z(hn.value),isFilled:Z(R.value.circle.filled),circleRadius:Z(R.value.circle.radius),circleStrokeWidth:Z(R.value.circle.strokeWidth),type:w.value,x:I.value.x,y:I.value.y,strokeWidth:Z(Math.abs(Mt.value)),isDash:Z(It.value)}),F.value=L.value.at(-1);break;case w.value===`line`:L.value.push({alpha:Z(_n.value),id:e,x:I.value.x,y:I.value.y,type:w.value,color:Z(hn.value),strokeWidth:Z(Math.abs(Mt.value)),isDash:Z(It.value),path:`${I.value.x} ${I.value.y}`}),F.value=L.value.at(-1);break;case w.value===`rect`:L.value.push({alpha:R.value.rect.filled?_n.value:``,id:e,color:Z(hn.value),isFilled:Z(R.value.rect.filled),rectStrokeWidth:Z(R.value.rect.strokeWidth),rectHeight:Z(R.value.rect.height),rectWidth:Z(R.value.rect.width),type:w.value,x:I.value.x,y:I.value.y,strokeWidth:Z(Math.abs(Mt.value)),isDash:Z(It.value)}),F.value=L.value.at(-1);break;case w.value===`group`:L.value.push({alpha:1,id:`group_${i()}`,x:I.value.x,y:I.value.y,isFilled:!1,rectHeight:Z(R.value.rect.height),rectWidth:Z(R.value.rect.width),rectStrokeWidth:1,type:`group`,color:`grey`,strokeWidth:1,isDash:!0,content:``})}pn.value||=requestAnimationFrame(In)}function mr(e){if(!M.value)return;Fr(e);let t=zn(e),n=t?L.value.find(e=>e.id===t):null;if(P.value&&rn.value&&t!==rn.value&&Xn(),D.value)Bt.value=!1;else{if(n){let t=Number.isFinite(e?.timeStamp)?e.timeStamp:Date.now(),r=br.id===n.id&&t-br.at>=0&&t-br.at<=Et;if(br=r?{id:null,at:0}:{id:n.id,at:t},r){e.preventDefault(),e.stopPropagation(),Bt.value=!1,tn.value=null,nn.value=null,V.value=null,yr(n);return}}else br={id:null,at:0};if(e.preventDefault(),e.stopPropagation(),Bt.value=!0,e.pointerId!=null){try{bn.value?.setPointerCapture?.(e.pointerId)}catch{}mn.value=e.pointerId}else mn.value=null;if(O.value){if(n){Bt.value=!1,O.value=!1,F.value=n,E.value={id:n.id},Kn(n);return}ln.value?.begin?.(),pr()}else if(j.value)ln.value?.begin?.(),pr();else if(k.value){if(!n){Bt.value=!1,E.value=void 0;return}ln.value?.begin?.(),Ln(n.id);let t=L.value.find(e=>e.id===n.id);F.value=t,E.value={id:t.id},Hn({target:e.target})}else if(A.value){if(!n){Bt.value=!1,E.value=void 0,tn.value=null,nn.value=null,V.value=null;return}let t=e.target?.getAttribute?.(`data-resize-handle`)||null;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?.()}}}function hr(e){if(!e||!e.id||!tn.value&&(Hn({target:{id:e.id}}),!tn.value))return;let t=I.value.x,n=I.value.y;switch(F.value=e,e.type){case`arrow`:{let{dx:r,dy:i,endDx:a,endDy:o}=tn.value;e.x=t-r,e.y=n-i,e.endX=t-(a??r),e.endY=n-(o??i);break}case`circle`:case`rect`:case`text`:{let{dx:r,dy:i}=tn.value;e.x=t-r,e.y=n-i;break}case`line`:{let{startX:r,startY:i,path:a}=tn.value,o=t-r,s=n-i;e.path=Cn(Sn(a).map(e=>({x:e.x+o,y:e.y+s})));let c=wn(e.path);c&&(e.x=c.minX,e.y=c.minY);break}case`group`:{let{dx:r,dy:i}=tn.value;e.x=t-r,e.y=n-i,dr(e);break}}}function gr(){let e=E.value?.id||Nt.value;if(!e)return;let t=L.value.find(t=>t.id===e);t&&hr(t)}function _r(){let e=E.value?.id;if(!e)return;let t=L.value.find(t=>t.id===e);if(!t)return;let n=I.value.x,r=I.value.y;switch(w.value=t.type,F.value=t,t.type){case`arrow`:nn.value===`arrow-start`?(t.x=n,t.y=r):nn.value===`arrow-end`&&(t.endX=n,t.endY=r);break;case`line`:{if(nn.value!==`line-scale`||!V.value?.bounds||!V.value?.points)return;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);t.path=Cn(i.map(t=>({x:e.minX+(t.x-e.minX)*s,y:e.minY+(t.y-e.minY)*c}))),t.x=e.minX,t.y=e.minY;break}case`circle`:{if(nn.value!==`circle-radius`||V.value?.shapeId!==t.id||!V.value?.anchor)return;let e=V.value.anchor,i=n,a=r,o=i-e.x,s=a-e.y,c=Math.hypot(o,s);if(c<2){if(c>0){let e=2/c;o*=e,s*=e}else o=2,s=0;i=e.x+o,a=e.y+s,c=2}t.x=e.x+o/2,t.y=e.y+s/2,t.circleRadius=c/2,V.value.handlePoint={x:i,y:a};break}case`rect`:{let e=nn.value,i=V.value?.bounds;if(!e?.startsWith(`rect-`)||V.value?.shapeId!==t.id||!i)return;let a=i.left,o=i.top,s=i.right,c=i.bottom;switch(e){case`rect-nw`:a=Math.min(n,i.right-20),o=Math.min(r,i.bottom-20);break;case`rect-ne`:s=Math.max(n,i.left+20),o=Math.min(r,i.bottom-20);break;case`rect-se`:s=Math.max(n,i.left+20),c=Math.max(r,i.top+20);break;case`rect-sw`:a=Math.min(n,i.right-20),c=Math.max(r,i.top+20);break;default:return}t.x=a,t.y=o,t.rectWidth=s-a,t.rectHeight=c-o;break}case`group`:if(nn.value!==`group-scale`)return;t.rectWidth=Math.max(20,n-t.x),t.rectHeight=Math.max(20,r-t.y)}}function vr(e){if(!M.value||D.value)return;e.preventDefault(),e.stopPropagation(),Fr(e);let t=zn(e);t&&(Nt.value=t),k.value&&Bt.value?gr():A.value&&Bt.value&&(nn.value?_r():gr())}function yr(e){e&&(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`?(w.value=void 0,Kn(e),Yn(e)):(N.value=!1,P.value=!1,z.value=!1,H.value=null,Kn(e)))}let br={id:null,at:0},xr={id:null,at:0};function Sr(e,t){if(!M.value)return;let n=t||Rn(e.target);if(!n)return;xr={id:null,at:0};let r=L.value.find(e=>e.id===n);r&&yr(r)}function Cr(e,t){if(!M.value)return;let n=t||Rn(e.target);if(!n)return;let r=L.value.find(e=>e.id===n);if(!r)return;let i=Number.isFinite(e?.timeStamp)?e.timeStamp:Date.now(),a=xr.id===n&&i-xr.at>=0&&i-xr.at<=Et;if(xr=a?{id:null,at:0}:{id:n,at:i},a&&!D.value){yr(r);return}let o=F.value?.id===n,s=N.value;if(D.value)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?.();else if(P.value&&rn.value&&rn.value!==n&&Xn(),F.value=r,E.value={id:r.id},k.value)z.value=!1,H.value=null;else if(Kn(r),r.type===`text`){let e=!k.value&&!A.value&&!O.value&&!j.value;N.value=e,e&&(s||o)&&Yn(r)}else N.value=!1,z.value=!1,H.value=null}let wr=y(null);function Tr(e,t){for(t(e),e=e.firstChild;e;)Tr(e,t),e=e.nextSibling}function Er(){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()=>{let e=wr.value;if(e){Tr(e,e=>{e&&e.nodeType===1&&(e.setAttribute(`font-family`,`Helvetica`),e.style.fontFamily=`Helvetica`)});try{let t;try{t=(await import(`jspdf`)).default}catch{throw Error(`jspdf is not installed. Run npm install jspdf`)}let n=await l({container:e,scale:2}),r=new Image;r.src=n,r.onload=()=>{let e={width:595.28,height:841.89},i=r.width,a=r.height,o=i/e.width*e.height,s=e.width,c=s/i*a,l=new t(``,`pt`,`a4`),u=0,ee=a;if(ee<o)l.addImage(n,`PNG`,0,0,s,c,``,`FAST`);else for(;ee>0;)l.addImage(n,`PNG`,0,u,s,c,``,`FAST`),ee-=o,u-=e.height,ee>0&&l.addPage();l.save(`${(/* @__PURE__ */ new Date()).toLocaleDateString()}_annotations.pdf`)}}catch(e){console.error(`Error generating image:`,e)}finally{Vt.value=!1,Tr(e,e=>{e&&e.nodeType===1&&(e.setAttribute(`font-family`,J.value.fontFamily),e.style.fontFamily=J.value.fontFamily)})}}})}function Dr(e){let t=O.value&&Lt.value&&F.value&&[`arrow`,`circle`,`line`,`rect`].includes(F.value.type)?L.value.find(e=>e.id===F.value.id):null;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){try{bn.value?.releasePointerCapture?.(mn.value)}catch{}mn.value=null}pn.value&&=(cancelAnimationFrame(pn.value),null);let n=j.value?ur():null;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))}function Or(){F.value&&F.value.id.includes(`rect`)&&(F.value.isFilled=!F.value.isFilled)}function kr(){F.value&&F.value.id.includes(`circle`)&&(F.value.isFilled=!F.value.isFilled)}function Ar(e=hn.value){let t=typeof e==`string`&&e.length?e:hn.value;if(hn.value=t,!F.value||k.value)return;let n=L.value.find(e=>e.id===F.value.id);n&&(n.color=Z(t),F.value=n,[`arrow`,`text`].includes(n.type)?Jn():n.alpha=Z(_n.value))}function jr(){F.value&&F.value.type!==`text`&&(F.value.isDash=Z(It.value))}function Mr(){F.value&&![`arrow`,`text`].includes(F.value.type)&&(F.value.alpha=Z(_n.value))}function Nr(){F.value&&[`arrow`,`circle`,`rect`,`line`].includes(F.value.type)&&(F.value.strokeWidth=Z(Math.abs(Mt.value)))}function Pr(){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())}function Fr(e){if(e.preventDefault(),!bn.value)return;let t=bn.value.getBoundingClientRect(),n,r;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}function Ir(e){z.value=!1,Zn(),e===w.value?(w.value=void 0,O.value=!1):(O.value=!0,D.value=!1,k.value=!1,A.value=!1,N.value=!1,w.value=e)}function Lr(){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})}function Rr(){P.value&&Xn(),xe(`saveAnnotations`,{shapes:L.value,lastSelectedShape:F.value})}let zr=null;return de(()=>{if(wr.value){let e=!1;Tr(wr.value,t=>{!e&&[`DIV`,`svg`,`section`,`canvas`].includes(t.tagName)&&(Yt.value=t,e=!0)})}un.value=(()=>{if(typeof navigator>`u`)return!1;let e=navigator.userAgentData?.platform??``;if(e)return/mac|ios/i.test(e);let t=navigator.userAgent??``;return/(Mac|iPhone|iPad|iPod)/i.test(t)})();let e=Yt?.value.getBoundingClientRect();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=>{e.forEach(e=>{Xt.value=e.contentRect.width,Zt.value=e.contentRect.height,Jt.value=e.contentRect.height/e.contentRect.width,Kt.value=Jt.value*1e3})}).observe(Yt.value),dn.value=e=>ir(e),window.addEventListener(`keydown`,dn.value),ln.value=Bn(),ln.value.size){let e=ln.value.size();fn.value.undo=e.undo,fn.value.redo=e.redo}zr=ye({isMacLike:un,isSummaryOpen:M,isWriting:P,isDeleteMode:D,isMoveMode:k,isResizeMode:A,isSelectMode:j,isDrawMode:O,isTextMode:N,activeShape:w,showCaret:z,lastSelectedShape:F,shapes:L,history:ln,setShapeTo:Ir,undoLastShape:nr,redoLastShape:rr})}),ue(()=>{$(),pn.value&&cancelAnimationFrame(pn.value),dn.value&&window.removeEventListener(`keydown`,dn.value),zr&&zr(),window.removeEventListener(`keydown`,ir)}),ge(L,e=>{e.length===0&&(F.value=void 0)}),ge(N,e=>{!e&&P.value?Xn():(z.value=!!(e&&P.value),z.value&&Jn())}),(e,t)=>(v(),p(`div`,Se,[m(`div`,Ce,[b(e.$slots,`toggle`,le(se({toggle:Lr,isOpen:M.value})),()=>[oe(te,{config:{maxHeight:1e3,useCursorPointer:Y.value,head:{backgroundColor:J.value.backgroundColor,color:J.value.color,iconColor:J.value.color,iconSize:20,icon:M.value?`close`:`annotator`,padding:`6px`},body:{backgroundColor:J.value.backgroundColor,color:J.value.color}},onToggle:Lr},{title:S(({color:e})=>[m(`div`,{style:_({color:e})},x(K.value.translations.title),5)]),content:S(({backgroundColor:e})=>[m(`div`,{id:`toggle_default_${kt.value}`},null,8,we)]),_:1},8,[`config`])],!0),e.$slots.toggle&&M.value?(v(),p(`div`,{key:0,id:`toggle_slot_${kt.value}`},null,8,Te)):f(``,!0),Dt.value&&Ot.value?(v(),d(ie,{key:1,to:e.$slots.toggle?`#toggle_slot_${kt.value}`:`#toggle_default_${kt.value}`},[m(`div`,null,[m(`div`,Ee,[m(`button`,{disabled:L.value.length===0,style:_({background:k.value?q.value.controls.selected.backgroundColor:q.value.controls.backgroundColor,border:k.value?q.value.controls.selected.border:q.value.controls.border,color:k.value?q.value.controls.selected.color:q.value.controls.color,borderRadius:`${q.value.borderRadius}px`,cursor:Y.value?`pointer`:`default`}),class:g({"button-tool":!0,"button-tool--selected":k.value,tooltip:!0}),onClick:t[0]||=e=>{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},onMouseenter:t[1]||=e=>J.value.showTooltips&&Q(`move`,e,`top`),onMouseleave:$,onFocus:t[2]||=e=>J.value.showTooltips&&Q(`move`,e,`top`),onBlur:$},[b(e.$slots,`icon-move`,le(se({active:k.value})),()=>[oe(u,{name:`move`,stroke:k.value?q.value.controls.selected.color:q.value.controls.color},null,8,[`stroke`])],!0),J.value.showTooltips?(v(),d(C,{key:0,show:U.value&&W.value===`move`,x:G.value.x,y:G.value.y-6,placement:`top`,styleObject:X.value},{default:S(()=>[h(x(K.value.translations.tooltipMove)+` `,1),t[91]||=m(`kbd`,null,`M`,-1)]),_:1},8,[`show`,`x`,`y`,`styleObject`])):f(``,!0)],46,De),m(`button`,{disabled:L.value.length===0,style:_({background:A.value?q.value.controls.selected.backgroundColor:q.value.controls.backgroundColor,border:A.value?q.value.controls.selected.border:q.value.controls.border,color:A.value?q.value.controls.selected.color:q.value.controls.color,borderRadius:`${q.value.borderRadius}px`,cursor:Y.value?`pointer`:`default`}),class:g({"button-tool":!0,"button-tool--selected":A.value,tooltip:!0}),onClick:t[3]||=e=>{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},onMouseenter:t[4]||=e=>J.value.showTooltips&&Q(`resize`,e,`top`),onMouseleave:$,onFocus:t[5]||=e=>J.value.showTooltips&&Q(`resize`,e,`top`),onBlur:$},[b(e.$slots,`icon-resize`,le(se({active:A.value})),()=>[oe(u,{name:`resize`,stroke:A.value?q.value.controls.selected.color:q.value.controls.color},null,8,[`stroke`])],!0),J.value.showTooltips?(v(),d(C,{key:0,show:U.value&&W.value===`resize`,x:G.value.x,y:G.value.y-6,placement:`top`,styleObject:X.value},{default:S(()=>[h(x(K.value.translations.tooltipResize)+` `,1),t[92]||=m(`kbd`,null,`R`,-1)]),_:1},8,[`show`,`x`,`y`,`styleObject`])):f(``,!0)],46,Oe),m(`button`,{disabled:L.value.length===0,style:_({background:D.value?q.value.controls.selected.backgroundColor:q.value.controls.backgroundColor,border:D.value?q.value.controls.selected.border:q.value.controls.border,color:D.value?q.value.controls.selected.color:q.value.controls.color,borderRadius:`${q.value.borderRadius}px`,cursor:Y.value?`pointer`:`default`}),class:g({"button-tool":!0,"button-tool--selected":D.value,tooltip:!0}),onClick:t[6]||=e=>{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},onMouseenter:t[7]||=e=>J.value.showTooltips&&Q(`delete`,e,`top`),onMouseleave:$,onFocus:t[8]||=e=>J.value.showTooltips&&Q(`delete`,e,`top`),onBlur:$},[b(e.$slots,`icon-delete`,le(se({active:D.value})),()=>[oe(u,{name:`trash`,stroke:D.value?q.value.controls.selected.color:q.value.controls.color},null,8,[`stroke`])],!0),J.value.showTooltips?(v(),d(C,{key:0,show:U.value&&W.value===`delete`,x:G.value.x,y:G.value.y-6,placement:`top`,styleObject:X.value},{default:S(()=>[h(x(K.value.translations.tooltipDelete)+` `,1),t[93]||=m(`kbd`,null,`D`,-1)]),_:1},8,[`show`,`x`,`y`,`styleObject`])):f(``,!0)],46,ke),m(`button`,{disabled:!gn.value,style:_({background:j.value?q.value.controls.selected.backgroundColor:q.value.controls.backgroundColor,border:j.value?q.value.controls.selected.border:q.value.controls.border,color:j.value?q.value.controls.selected.color:q.value.controls.color,borderRadius:`${q.value.borderRadius}px`,cursor:Y.value?`pointer`:`default`}),class:g({"button-tool":!0,"button-tool--selected":j.value,tooltip:!0}),onClick:t[9]||=e=>{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},onMouseenter:t[10]||=e=>J.value.showTooltips&&Q(`selectAndGroup`,e,`top`),onMouseleave:$,onFocus:t[11]||=e=>J.value.showTooltips&&Q(`selectAndGroup`,e,`top`),onBlur:$},[b(e.$slots,`icon-select-group`,le(se({active:j.value})),()=>[oe(u,{name:`selectAndGroup`,stroke:j.value?q.value.controls.selected.color:q.value.controls.color},null,8,[`stroke`])],!0),J.value.showTooltips?(v(),d(C,{key:0,show:U.value&&W.value===`selectAndGroup`,x:G.value.x,y:G.value.y-6,placement:`top`,styleObject:X.value},{default:S(()=>[h(x(K.value.translations.tooltipGroup)+` `,1),t[94]||=m(`kbd`,null,`G`,-1)]),_:1},8,[`show`,`x`,`y`,`styleObject`])):f(``,!0)],46,Ae),m(`button`,{disabled:L.value.length===0,style:_({background:q.value.controls.backgroundColor,border:q.value.controls.border,color:q.value.controls.color,borderRadius:`${q.value.borderRadius}px`,cursor:Y.value?`pointer`:`default`}),class:g({"button-tool":!0,tooltip:!0}),onClick:t[12]||=e=>{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`)},onMouseenter:t[13]||=e=>J.value.showTooltips&&Q(`bringToFront`,e,`top`),onMouseleave:$,onFocus:t[14]||=e=>J.value.showTooltips&&Q(`bringToFront`,e,`top`),onBlur:$},[b(e.$slots,`icon-bring-to-front`,{},()=>[oe(u,{name:`bringToFront`,stroke:q.value.controls.color},null,8,[`stroke`])],!0),J.value.showTooltips?(v(),d(C,{key:0,show:U.value&&W.value===`bringToFront`,x:G.value.x,y:G.value.y-6,placement:`top`,styleObject:X.value},{default:S(()=>[h(x(K.value.translations.tooltipBringToFront),1)]),_:1},8,[`show`,`x`,`y`,`styleObject`])):f(``,!0)],44,je),m(`button`,{disabled:L.value.length===0,style:_({background:q.value.controls.backgroundColor,border:q.value.controls.border,color:q.value.controls.color,borderRadius:`${q.value.borderRadius}px`,cursor:Y.value?`pointer`:`default`}),class:g({"button-tool":!0,tooltip:!0}),onClick:t[15]||=e=>{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`)},onMouseenter:t[16]||=e=>J.value.showTooltips&&Q(`bringToBack`,e,`top`),onMouseleave:$,onFocus:t[17]||=e=>J.value.showTooltips&&Q(`bringToBack`,e,`top`),onBlur:$},[b(e.$slots,`icon-bring-to-back`,{},()=>[oe(u,{name:`bringToBack`,stroke:q.value.controls.color},null,8,[`stroke`])],!0),J.value.showTooltips?(v(),d(C,{key:0,show:U.value&&W.value===`bringToBack`,x:G.value.x,y:G.value.y-6,placement:`top`,styleObject:X.value},{default:S(()=>[h(x(K.value.translations.tooltipBringToBack),1)]),_:1},8,[`show`,`x`,`y`,`styleObject`])):f(``,!0)],44,Me),m(`button`,{disabled:L.value.length===0||w.value===`line`,style:_({background:q.value.controls.backgroundColor,border:q.value.controls.border,color:q.value.controls.color,borderRadius:`${q.value.borderRadius}px`,cursor:Y.value?`pointer`:`default`}),class:g({"button-tool":!0,tooltip:!0}),onClick:t[18]||=e=>{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()},onMouseenter:t[19]||=e=>J.value.showTooltips&&Q(`duplicate`,e,`top`),onMouseleave:$,onFocus:t[20]||=e=>J.value.showTooltips&&Q(`duplicate`,e,`top`),onBlur:$},[b(e.$slots,`icon-copy`,{},()=>[oe(u,{name:`copy`,stroke:q.value.controls.color,size:18},null,8,[`stroke`])],!0),J.value.showTooltips?(v(),d(C,{key:0,show:U.value&&W.value===`duplicate`,x:G.value.x,y:G.value.y-6,placement:`top`,styleObject:X.value},{default:S(()=>[h(x(K.value.translations.tooltipDuplicate),1)]),_:1},8,[`show`,`x`,`y`,`styleObject`])):f(``,!0)],44,Ne),m(`button`,{disabled:fn.value.undo===0,style:_({background:q.value.controls.backgroundColor,border:q.value.controls.border,color:q.value.controls.color,borderRadius:`${q.value.borderRadius}px`,cursor:Y.value?`pointer`:`default`}),class:g({"button-tool":!0,"button-tool--one-shot":!0,tooltip:!0}),onClick:t[21]||=e=>{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()},onMouseenter:t[22]||=e=>J.value.showTooltips&&Q(`undoLast`,e,`top`),onMouseleave:$,onFocus:t[23]||=e=>J.value.showTooltips&&Q(`undoLast`,e,`top`),onBlur:$},[b(e.$slots,`icon-undo`,{},()=>[oe(u,{name:`refresh`,stroke:q.value.controls.color,size:20},null,8,[`stroke`])],!0),J.value.showTooltips?(v(),d(C,{key:0,show:U.value&&W.value===`undoLast`,x:G.value.x,y:G.value.y-6,placement:`top`,styleObject:X.value},{default:S(()=>[h(x(K.value.translations.tooltipUndo)+` `,1),m(`kbd`,null,x(un.value?`⌘`:`Ctrl`),1),t[95]||=m(`kbd`,null,`Z`,-1)]),_:1},8,[`show`,`x`,`y`,`styleObject`])):f(``,!0)],44,Pe),m(`button`,{disabled:fn.value.redo===0,style:_({background:q.value.controls.backgroundColor,border:q.value.controls.border,color:q.value.controls.color,borderRadius:`${q.value.borderRadius}px`,cursor:Y.value?`pointer`:`default`}),class:g({"button-tool":!0,"button-tool--one-shot":!0,tooltip:!0}),onClick:t[24]||=e=>{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()},onMouseenter:t[25]||=e=>J.value.showTooltips&&Q(`redoLast`,e,`top`),onMouseleave:$,onFocus:t[26]||=e=>J.value.showTooltips&&Q(`redoLast`,e,`top`),onBlur:$},[b(e.$slots,`icon-redo`,{},()=>[oe(u,{name:`refresh`,stroke:q.value.controls.color,size:20,style:{transform:`rotateX(0deg) rotateY(180deg)`}},null,8,[`stroke`])],!0),J.value.showTooltips?(v(),d(C,{key:0,show:U.value&&W.value===`redoLast`,x:G.value.x,y:G.value.y-6,placement:`top`,styleObject:X.value},{default:S(()=>[h(x(K.value.translations.tooltipRedo)+` `,1),m(`kbd`,null,x(un.value?`⌘`:`Ctrl`),1),t[96]||=m(`kbd`,null,`Y`,-1)]),_:1},8,[`show`,`x`,`y`,`styleObject`])):f(``,!0)],44,Fe),J.value.showPrint?(v(),p(`button`,{key:0,style:_({background:q.value.controls.backgroundColor,border:q.value.controls.border,color:q.value.controls.color,borderRadius:`${q.value.borderRadius}px`,cursor:Y.value?`pointer`:`default`}),class:g({"button-tool":!0,tooltip:!0}),onClick:Er,onMouseenter:t[27]||=e=>J.value.showTooltips&&Q(`printPdf`,e,`top`),onMouseleave:$,onFocus:t[28]||=e=>J.value.showTooltips&&Q(`printPdf`,e,`top`),onBlur:$},[b(e.$slots,`icon-print`,{},()=>[oe(u,{name:`printer`,stroke:q.value.controls.color},null,8,[`stroke`])],!0),J.value.showTooltips?(v(),d(C,{key:0,show:U.value&&W.value===`printPdf`,x:G.value.x,y:G.value.y-6,placement:`top`,styleObject:X.value},{default:S(()=>[h(x(K.value.translations.tooltipPdf),1)]),_:1},8,[`show`,`x`,`y`,`styleObject`])):f(``,!0)],36)):f(``,!0),J.value.showImage?(v(),p(`button`,{key:1,style:_({background:q.value.controls.backgroundColor,border:q.value.controls.border,color:q.value.controls.color,borderRadius:`${q.value.borderRadius}px`,cursor:Y.value?`pointer`:`default`}),class:g({"button-tool":!0,tooltip:!0}),onClick:t[29]||=(...e)=>pe(jt)&&pe(jt)(...e),onMouseenter:t[30]||=e=>J.value.showTooltips&&Q(`printImage`,e,`top`),onMouseleave:$,onFocus:t[31]||=e=>J.value.showTooltips&&Q(`printImage`,e,`top`),onBlur:$},[b(e.$slots,`icon-export-image`,{},()=>[oe(u,{name:`image`,stroke:q.value.controls.color,size:20},null,8,[`stroke`])],!0),J.value.showTooltips?(v(),d(C,{key:0,show:U.value&&W.value===`printImage`,x:G.value.x,y:G.value.y-6,placement:`top`,styleObject:X.value},{default:S(()=>[h(x(K.value.translations.tooltipImage),1)]),_:1},8,[`show`,`x`,`y`,`styleObject`])):f(``,!0)],36)):f(``,!0),J.value.showSave?(v(),p(`button`,{key:2,style:_({background:q.value.controls.backgroundColor,border:q.value.controls.border,color:q.value.controls.color,borderRadius:`${q.value.borderRadius}px`,cursor:Y.value?`pointer`:`default`}),class:g({"button-tool":!0,tooltip:!0}),onClick:Rr,onMouseenter:t[32]||=e=>J.value.showTooltips&&Q(`saveAction`,e,`top`),onMouseleave:$,onFocus:t[33]||=e=>J.value.showTooltips&&Q(`saveAction`,e,`top`),onBlur:$},[b(e.$slots,`icon-save`,{},()=>[oe(u,{name:`save`,stroke:q.value.controls.color},null,8,[`stroke`])],!0),J.value.showTooltips?(v(),d(C,{key:0,show:U.value&&W.value===`saveAction`,x:G.value.x,y:G.value.y-6,placement:`top`,styleObject:X.value},{default:S(()=>[h(x(K.value.translations.tooltipSave),1)]),_:1},8,[`show`,`x`,`y`,`styleObject`])):f(``,!0)],36)):f(``,!0)]),m(`div`,Ie,[m(`button`,{class:g({"button-tool":!0,"button-tool--selected":w.value===`circle`,tooltip:!0}),style:_({background:w.value===`circle`?q.value.shapes.selected.backgroundColor:q.value.shapes.backgroundColor,border:w.value===`circle`?q.value.shapes.selected.border:q.value.shapes.border,color:w.value===`circle`?q.value.shapes.selected.color:q.value.shapes.color,borderRadius:`${q.value.borderRadius}px`,cursor:Y.value?`pointer`:`default`}),onClick:t[34]||=e=>{Ir(`circle`),j.value=!1},onMouseenter:t[35]||=e=>J.value.showTooltips&&Q(`setCircle`,e,`top`),onMouseleave:$,onFocus:t[36]||=e=>J.value.showTooltips&&Q(`setCircle`,e,`top`),onBlur:$},[b(e.$slots,`icon-circle`,le(se({filled:R.value.circle.filled})),()=>[(v(),p(`svg`,Le,[m(`circle`,{cx:6,cy:6,r:`4`,fill:R.value.circle.filled?(w.value,hn.value+_n.value):`none`,stroke:`currentColor`},null,8,Re)]))],!0),J.value.showTooltips?(v(),d(C,{key:0,show:U.value&&W.value===`setCircle`,x:G.value.x,y:G.value.y-6,placement:`top`,styleObject:X.value},{default:S(()=>[h(x(K.value.translations.tooltipShapeCircle)+` `,1),t[97]||=m(`kbd`,null,`C`,-1)]),_:1},8,[`show`,`x`,`y`,`styleObject`])):f(``,!0)],38),w.value===`circle`?(v(),p(`div`,ze,[m(`label`,Be,[h(x(K.value.translations.filled)+` `,1),_e(m(`input`,{type:`checkbox`,"onUpdate:modelValue":t[37]||=e=>R.value.circle.filled=e,onChange:kr,checked:R.value.circle.filled,style:_({all:`revert`,appearance:`auto`,"-webkit-appearance":`auto`,accentColor:J.value.color+` !important`})},null,44,Ve),[[me,R.value.circle.filled]])])])):f(``,!0),m(`button`,{class:g({"button-tool":!0,"button-tool--selected":w.value===`rect`,tooltip:!0}),style:_({background:w.value===`rect`?q.value.shapes.selected.backgroundColor:q.value.shapes.backgroundColor,border:w.value===`rect`?q.value.shapes.selected.border:q.value.shapes.border,color:w.value===`rect`?q.value.shapes.selected.color:q.value.shapes.color,borderRadius:`${q.value.borderRadius}px`,cursor:Y.value?`pointer`:`default`}),onClick:t[38]||=e=>{Ir(`rect`),j.value=!1},onMouseenter:t[39]||=e=>J.value.showTooltips&&Q(`setRect`,e,`top`),onMouseleave:$,onFocus:t[40]||=e=>J.value.showTooltips&&Q(`setRect`,e,`top`),onBlur:$},[b(e.$slots,`icon-rect`,le(se({filled:R.value.rect.filled})),()=>[(v(),p(`svg`,He,[m(`rect`,{x:`3`,y:`3`,style:{rx:`0 !important`,ry:`0 !important`},height:`6`,width:`6`,fill:R.value.rect.filled?(w.value,hn.value+_n.value):`none`,stroke:`currentColor`},null,8,Ue)]))],!0),J.value.showTooltips?(v(),d(C,{key:0,show:U.value&&W.value===`setRect`,x:G.value.x,y:G.value.y-6,placement:`top`,styleObject:X.value},{default:S(()=>[h(x(K.value.translations.tooltipShapeRect)+` `,1),t[98]||=m(`kbd`,null,`S`,-1)]),_:1},8,[`show`,`x`,`y`,`styleObject`])):f(``,!0)],38),w.value===`rect`?(v(),p(`div`,We,[m(`label`,Ge,[h(x(K.value.translations.filled)+` `,1),_e(m(`input`,{type:`checkbox`,"onUpdate:modelValue":t[41]||=e=>R.value.rect.filled=e,onChange:Or,checked:R.value.rect.filled,style:_({all:`revert`,appearance:`auto`,"-webkit-appearance":`auto`,accentColor:J.value.color+` !important`})},null,44,Ke),[[me,R.value.rect.filled]])])])):f(``,!0),m(`button`,{class:g({"button-tool":!0,"button-tool--selected":w.value===`arrow`,tooltip:!0}),style:_({background:w.value===`arrow`?q.value.shapes.selected.backgroundColor:q.value.shapes.backgroundColor,border:w.value===`arrow`?q.value.shapes.selected.border:q.value.shapes.border,color:w.value===`arrow`?q.value.shapes.selected.color:q.value.shapes.color,borderRadius:`${q.value.borderRadius}px`,cursor:Y.value?`pointer`:`default`}),onClick:t[42]||=e=>{Ir(`arrow`),j.value=!1},onMouseenter:t[43]||=e=>J.value.showTooltips&&Q(`setArrow`,e,`top`),onMouseleave:$,onFocus:t[44]||=e=>J.value.showTooltips&&Q(`setArrow`,e,`top`),onBlur:$},[b(e.$slots,`icon-arrow`,{},()=>[(v(),p(`svg`,qe,[m(`path`,{stroke:R.value.arrow.filled?w.value===`arrow`?`white`:`grey`:`none`,"stroke-width":`2`,d:`M5,19 19,5 14,5 19,10.5 19,5`,fill:`none`,"stroke-linecap":`round`,"stroke-linejoin":`round`},null,8,Je)]))],!0),J.value.showTooltips?(v(),d(C,{key:0,show:U.value&&W.value===`setArrow`,x:G.value.x,y:G.value.y-6,placement:`top`,styleObject:X.value},{default:S(()=>[h(x(K.value.translations.tooltipShapeArrow)+` `,1),t[99]||=m(`kbd`,null,`A`,-1)]),_:1},8,[`show`,`x`,`y`,`styleObject`])):f(``,!0)],38),m(`button`,{class:g({"button-tool":!0,"button-tool--selected":w.value===`line`,tooltip:!0}),style:_({background:w.value===`line`?q.value.shapes.selected.backgroundColor:q.value.shapes.backgroundColor,border:w.value===`line`?q.value.shapes.selected.border:q.value.shapes.border,color:w.value===`line`?q.value.shapes.selected.color:q.value.shapes.color,borderRadius:`${q.value.borderRadius}px`,cursor:Y.value?`pointer`:`default`}),onClick:t[45]||=e=>{Ir(`line`),j.value=!1},onMouseenter:t[46]||=e=>J.value.showTooltips&&Q(`setFreehand`,e,`top`),onMouseleave:$,onFocus:t[47]||=e=>J.value.showTooltips&&Q(`setFreehand`,e,`top`),onBlur:$},[b(e.$slots,`icon-freehand`,{},()=>[t[100]||=m(`svg`,{width:`80%`,viewBox:`0 0 24 24`,"stroke-width":`2`,stroke:`currentColor`,fill:`none`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[m(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),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,{key:0,show:U.value&&W.value===`setFreehand`,x:G.value.x,y:G.value.y-6,placement:`top`,styleObject:X.value},{default:S(()=>[h(x(K.value.translations.tooltipShapeFreehand)+` `,1),t[101]||=m(`kbd`,null,`L`,-1)]),_:1},8,[`show`,`x`,`y`,`styleObject`])):f(``,!0)],38),[`arrow`,`circle`,`rect`,`line`].includes(w.value)?(v(),p(`div`,Ye,[m(`div`,Xe,[m(`label`,Ze,[h(x(K.value.translations.thickness)+` `,1),_e(m(`input`,{type:`number`,"onUpdate:modelValue":t[48]||=e=>Mt.value=e,onInput:Nr,min:1,style:{padding:`0 4px`,width:`40px`,border:`1px solid #dadada`,"border-radius":`3px`}},null,544),[[he,Mt.value]])])])])):f(``,!0),[`arrow`,`circle`,`rect`].includes(w.value)?(v(),p(`div`,Qe,[m(`div`,$e,[m(`label`,et,[h(x(K.value.translations.dashedLines)+` `,1),_e(m(`input`,{name:`dashStyle`,type:`checkbox`,"onUpdate:modelValue":t[49]||=e=>It.value=e,onChange:jr,checked:It.value,style:_({all:`revert`,appearance:`auto`,"-webkit-appearance":`auto`,accentColor:J.value.color+` !important`})},null,44,tt),[[me,It.value]])])])])):f(``,!0),m(`button`,{class:g({"button-tool":!0,"button-tool--selected":N.value,tooltip:!0}),style:_({background:N.value?q.value.shapes.selected.backgroundColor:q.value.shapes.backgroundColor,border:N.value?q.value.shapes.selected.border:q.value.shapes.border,color:N.value?q.value.shapes.selected.color:q.value.shapes.color,borderRadius:`${q.value.borderRadius}px`,cursor:Y.value?`pointer`:`default`}),onClick:t[50]||=e=>{Zn(),N.value=!N.value,D.value=!1,k.value=!1,A.value=!1,j.value=!1,O.value=!1,w.value=void 0},onMouseenter:t[51]||=e=>J.value.showTooltips&&Q(`setText`,e,`top`),onMouseleave:$,onFocus:t[52]||=e=>J.value.showTooltips&&Q(`setText`,e,`top`),onBlur:$},[b(e.$slots,`icon-text`,le(se({active:N.value})),()=>[oe(u,{name:`text`,stroke:N.value?q.value.shapes.selected.color:q.value.shapes.color},null,8,[`stroke`])],!0),J.value.showTooltips?(v(),d(C,{key:0,show:U.value&&W.value===`setText`,x:G.value.x,y:G.value.y-6,placement:`top`,styleObject:X.value},{default:S(()=>[h(x(K.value.translations.tooltipShapeText)+` `,1),t[102]||=m(`kbd`,null,`T`,-1)]),_:1},8,[`show`,`x`,`y`,`styleObject`])):f(``,!0)],38),N.value?(v(),p(`div`,nt,[m(`div`,rt,[m(`label`,it,[h(x(K.value.translations.fontSize)+` `,1),_e(m(`input`,{type:`number`,"onUpdate:modelValue":t[53]||=e=>Qt.value=e,onInput:Pr,style:{padding:`0 4px`,width:`40px`,border:`1px solid #dadada`,"border-radius":`3px`}},null,544),[[he,Qt.value]])])])])):f(``,!0),N.value?(v(),p(`div`,at,[m(`button`,{class:g({"button-tool":!0,"button-tool--selected":B.value===`start`,tooltip:!0}),style:_({background:B.value===`start`?q.value.shapes.selected.backgroundColor:q.value.shapes.backgroundColor,border:B.value===`start`?q.value.shapes.selected.border:q.value.shapes.border,color:B.value===`start`?q.value.shapes.selected.color:q.value.shapes.color,borderRadius:`${q.value.borderRadius}px`,cursor:Y.value?`pointer`:`default`}),onClick:t[54]||=e=>{D.value=!1,k.value=!1,A.value=!1,O.value=!1,j.value=!1,w.value=void 0,B.value=`start`,tr(`start`)},onMouseenter:t[55]||=e=>J.value.showTooltips&&Q(`setAlignStart`,e,`top`),onMouseleave:$,onFocus:t[56]||=e=>J.value.showTooltips&&Q(`setAlignStart`,e,`top`),onBlur:$},[b(e.$slots,`icon-text-align-left`,{},()=>[t[103]||=m(`svg`,{width:`80%`,viewBox:`0 0 24 24`,"stroke-width":`2`,stroke:`currentColor`,fill:`none`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[m(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),m(`path`,{d:`M4 6l16 0`}),m(`path`,{d:`M4 12l10 0`}),m(`path`,{d:`M4 18l14 0`})],-1)],!0),J.value.showTooltips?(v(),d(C,{key:0,show:U.value&&W.value===`setAlignStart`,x:G.value.x,y:G.value.y-6,placement:`top`,styleObject:X.value},{default:S(()=>[h(x(K.value.translations.tooltipShapeTextLeft),1)]),_:1},8,[`show`,`x`,`y`,`styleObject`])):f(``,!0)],38)])):f(``,!0),N.value?(v(),p(`div`,ot,[m(`button`,{class:g({"button-tool":!0,"button-tool--selected":B.value===`middle`,tooltip:!0}),style:_({background:B.value===`middle`?q.value.shapes.selected.backgroundColor:q.value.shapes.backgroundColor,border:B.value===`middle`?q.value.shapes.selected.border:q.value.shapes.border,color:B.value===`middle`?q.value.shapes.selected.color:q.value.shapes.color,borderRadius:`${q.value.borderRadius}px`,cursor:Y.value?`pointer`:`default`}),disabled:Ft.value,onClick:t[57]||=e=>{D.value=!1,k.value=!1,A.value=!1,O.value=!1,j.value=!1,w.value=void 0,B.value=`middle`,tr(`middle`)},onMouseenter:t[58]||=e=>J.value.showTooltips&&Q(`setAlignMiddle`,e,`top`),onMouseleave:$,onFocus:t[59]||=e=>J.value.showTooltips&&Q(`setAlignMiddle`,e,`top`),onBlur:$},[b(e.$slots,`icon-text-align-center`,{},()=>[t[104]||=m(`svg`,{width:`80%`,viewBox:`0 0 24 24`,"stroke-width":`2`,stroke:`currentColor`,fill:`none`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[m(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),m(`path`,{d:`M4 6l16 0`}),m(`path`,{d:`M8 12l8 0`}),m(`path`,{d:`M6 18l12 0`})],-1)],!0),J.value.showTooltips?(v(),d(C,{key:0,show:U.value&&W.value===`setAlignMiddle`,x:G.value.x,y:G.value.y-6,placement:`top`,styleObject:X.value},{default:S(()=>[h(x(K.value.translations.tooltipShapeTextCenter),1)]),_:1},8,[`show`,`x`,`y`,`styleObject`])):f(``,!0)],46,st)])):f(``,!0),N.value?(v(),p(`div`,ct,[m(`button`,{class:g({"button-tool":!0,"button-tool--selected":B.value===`end`,tooltip:!0}),style:_({background:B.value===`end`?q.value.shapes.selected.backgroundColor:q.value.shapes.backgroundColor,border:B.value===`end`?q.value.shapes.selected.border:q.value.shapes.border,color:B.value===`end`?q.value.shapes.selected.color:q.value.shapes.color,borderRadius:`${q.value.borderRadius}px`,cursor:Y.value?`pointer`:`default`}),disabled:Ft.value,onClick:t[60]||=e=>{D.value=!1,k.value=!1,A.value=!1,O.value=!1,j.value=!1,w.value=void 0,B.value=`end`,tr(`end`)},onMouseenter:t[61]||=e=>J.value.showTooltips&&Q(`setAlignEnd`,e,`top`),onMouseleave:$,onFocus:t[62]||=e=>J.value.showTooltips&&Q(`setAlignEnd`,e,`top`),onBlur:$},[b(e.$slots,`icon-text-align-right`,{},()=>[t[105]||=m(`svg`,{width:`80%`,viewBox:`0 0 24 24`,"stroke-width":`2`,stroke:`currentColor`,fill:`none`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[m(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),m(`path`,{d:`M4 6l16 0`}),m(`path`,{d:`M10 12l10 0`}),m(`path`,{d:`M6 18l14 0`})],-1)],!0),J.value.showTooltips?(v(),d(C,{key:0,show:U.value&&W.value===`setAlignEnd`,x:G.value.x,y:G.value.y-6,placement:`top`,styleObject:X.value},{default:S(()=>[h(x(K.value.translations.tooltipShapeTextRight),1)]),_:1},8,[`show`,`x`,`y`,`styleObject`])):f(``,!0)],46,lt)])):f(``,!0),N.value?(v(),p(`div`,ut,[m(`button`,{class:g({"button-tool":!0,"button-tool--selected":Ft.value,tooltip:!0}),style:_({background:Ft.value?q.value.shapes.selected.backgroundColor:q.value.shapes.backgroundColor,border:Ft.value?q.value.shapes.selected.border:q.value.shapes.border,color:Ft.value?q.value.shapes.selected.color:q.value.shapes.color,borderRadius:`${q.value.borderRadius}px`,cursor:Y.value?`pointer`:`default`}),onClick:t[63]||=e=>{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()},onMouseenter:t[64]||=e=>J.value.showTooltips&&Q(`setBulletMode`,e,`top`),onMouseleave:$,onFocus:t[65]||=e=>J.value.showTooltips&&Q(`setBulletMode`,e,`top`),onBlur:$},[b(e.$slots,`icon-text-bullet-points`,{},()=>[t[106]||=m(`svg`,{width:`100%`,viewBox:`0 0 24 24`,"stroke-width":`2`,stroke:`currentColor`,fill:`none`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[m(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),m(`path`,{d:`M9 6l11 0`}),m(`path`,{d:`M9 12l11 0`}),m(`path`,{d:`M9 18l11 0`}),m(`path`,{d:`M5 6l0 .01`}),m(`path`,{d:`M5 12l0 .01`}),m(`path`,{d:`M5 18l0 .01`})],-1)],!0),J.value.showTooltips?(v(),d(C,{key:0,show:U.value&&W.value===`setBulletMode`,x:G.value.x,y:G.value.y-6,placement:`top`,styleObject:X.value},{default:S(()=>[h(x(K.value.translations.tooltipShapeTextBullet),1)]),_:1},8,[`show`,`x`,`y`,`styleObject`])):f(``,!0)],38)])):f(``,!0),N.value?(v(),p(`div`,dt,[m(`button`,{class:g({"button-tool":!0,"button-tool--selected":Pt.value,tooltip:!0}),style:_({background:Pt.value?q.value.shapes.selected.backgroundColor:q.value.shapes.backgroundColor,border:Pt.value?q.value.shapes.selected.border:q.value.shapes.border,color:Pt.value?q.value.shapes.selected.color:q.value.shapes.color,borderRadius:`${q.value.borderRadius}px`,cursor:Y.value?`pointer`:`default`}),onClick:t[66]||=e=>{D.value=!1,k.value=!1,A.value=!1,O.value=!1,j.value=!1,w.value=void 0,Pt.value=!Pt.value,Pr()},onMouseenter:t[67]||=e=>J.value.showTooltips&&Q(`setBold`,e,`top`),onMouseleave:$,onFocus:t[68]||=e=>J.value.showTooltips&&Q(`setBold`,e,`top`),onBlur:$},[b(e.$slots,`icon-text-bold`,{},()=>[t[107]||=m(`svg`,{width:`100%`,viewBox:`0 0 24 24`,"stroke-width":`3`,stroke:`currentColor`,fill:`none`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[m(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),m(`path`,{d:`M7 5h6a3.5 3.5 0 0 1 0 7h-6z`}),m(`path`,{d:`M13 12h1a3.5 3.5 0 0 1 0 7h-7v-7`})],-1)],!0),J.value.showTooltips?(v(),d(C,{key:0,show:U.value&&W.value===`setBold`,x:G.value.x,y:G.value.y-6,placement:`top`,styleObject:X.value},{default:S(()=>[h(x(K.value.translations.tooltipShapeTextBold),1)]),_:1},8,[`show`,`x`,`y`,`styleObject`])):f(``,!0)],38)])):f(``,!0),N.value?(v(),p(`div`,ft,[m(`button`,{class:g({"button-tool":!0,"button-tool--selected":zt.value,tooltip:!0}),style:_({background:zt.value?q.value.shapes.selected.backgroundColor:q.value.shapes.backgroundColor,border:zt.value?q.value.shapes.selected.border:q.value.shapes.border,color:zt.value?q.value.shapes.selected.color:q.value.shapes.color,borderRadius:`${q.value.borderRadius}px`,cursor:Y.value?`pointer`:`default`}),onClick:t[69]||=e=>{D.value=!1,k.value=!1,A.value=!1,O.value=!1,j.value=!1,w.value=void 0,zt.value=!zt.value,Pr()},onMouseenter:t[70]||=e=>J.value.showTooltips&&Q(`setItalic`,e,`top`),onMouseleave:$,onFocus:t[71]||=e=>J.value.showTooltips&&Q(`setItalic`,e,`top`),onBlur:$},[b(e.$slots,`icon-text-italic`,{},()=>[t[108]||=m(`svg`,{width:`100%`,height:`44`,viewBox:`0 0 24 24`,"stroke-width":`2`,stroke:`currentColor`,fill:`none`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[m(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),m(`path`,{d:`M11 5l6 0`}),m(`path`,{d:`M7 19l6 0`}),m(`path`,{d:`M14 5l-4 14`})],-1)],!0),J.value.showTooltips?(v(),d(C,{key:0,show:U.value&&W.value===`setItalic`,x:G.value.x,y:G.value.y-6,placement:`top`,styleObject:X.value},{default:S(()=>[h(x(K.value.translations.tooltipShapeTextItalic),1)]),_:1},8,[`show`,`x`,`y`,`styleObject`])):f(``,!0)],38)])):f(``,!0),N.value?(v(),p(`div`,pt,[m(`button`,{class:g({"button-tool":!0,"button-tool--selected":Ht.value,tooltip:!0}),style:_({background:Ht.value?q.value.shapes.selected.backgroundColor:q.value.shapes.backgroundColor,border:Ht.value?q.value.shapes.selected.border:q.value.shapes.border,color:Ht.value?q.value.shapes.selected.color:q.value.shapes.color,borderRadius:`${q.value.borderRadius}px`,cursor:Y.value?`pointer`:`default`}),onClick:t[72]||=e=>{D.value=!1,k.value=!1,A.value=!1,O.value=!1,j.value=!1,w.value=void 0,Ht.value=!Ht.value,Pr()},onMouseenter:t[73]||=e=>J.value.showTooltips&&Q(`setUnderline`,e,`top`),onMouseleave:$,onFocus:t[74]||=e=>J.value.showTooltips&&Q(`setUnderline`,e,`top`),onBlur:$},[b(e.$slots,`icon-text-underline`,{},()=>[t[109]||=m(`svg`,{width:`100%`,viewBox:`0 0 24 24`,"stroke-width":`2`,stroke:`currentColor`,fill:`none`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[m(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),m(`path`,{d:`M7 5v5a5 5 0 0 0 10 0v-5`}),m(`path`,{d:`M5 19h14`})],-1)],!0),J.value.showTooltips?(v(),d(C,{key:0,show:U.value&&W.value===`setUnderline`,x:G.value.x,y:G.value.y-6,placement:`top`,styleObject:X.value},{default:S(()=>[h(x(K.value.translations.tooltipShapeTextUnderline),1)]),_:1},8,[`show`,`x`,`y`,`styleObject`])):f(``,!0)],38)])):f(``,!0),m(`div`,mt,[m(`button`,{class:g({"button-tool":!0,tooltip:!0}),style:{borderRadius:`6px`},onMouseenter:t[77]||=e=>J.value.showTooltips&&Q(`setColor`,e,`top`),onMouseleave:$,onFocus:t[78]||=e=>J.value.showTooltips&&Q(`setColor`,e,`top`),onBlur:$},[oe(ne,{value:hn.value,"onUpdate:value":[t[75]||=e=>hn.value=e,t[76]||=e=>Ar(e)],backgroundColor:J.value.backgroundColor,buttonBorderColor:J.value.color,isCursorPointer:Y.value,palette:J.value.palette,teleported:``},{"annotator-action-color":S(({color:t})=>[b(e.$slots,`icon-color`,le(se({color:t,backgroundColor:hn.value})),void 0,!0)]),_:3},8,[`value`,`backgroundColor`,`buttonBorderColor`,`isCursorPointer`,`palette`])],32),J.value.showTooltips?(v(),d(C,{key:0,show:U.value&&W.value===`setColor`,x:G.value.x,y:G.value.y-6,placement:`top`,styleObject:X.value},{default:S(()=>[h(x(K.value.translations.tooltipShapeColor),1)]),_:1},8,[`show`,`x`,`y`,`styleObject`])):f(``,!0)]),m(`div`,ht,[m(`label`,gt,[h(x(K.value.translations.colorAlpha)+`: `+x($t.value>98?100:$t.value)+` % `,1),_e(m(`input`,{name:`colorTransparency`,type:`range`,"onUpdate:modelValue":t[79]||=e=>$t.value=e,onInput:Mr,min:0,max:100,style:_({width:`100%`,accentColor:J.value.color+` !important`})},null,36),[[he,$t.value]])])])])])],8,[`to`])):f(``,!0)]),m(`div`,{class:`annotator annotator__wrapper`,ref_key:`drawSvgContainer`,ref:wr,style:{position:`relative`},id:kt.value,"data-annotator-content":``},[m(`div`,{class:`annotator__content-layer`,style:_(`${M.value?`pointer-events: none;`:``}`)},[b(e.$slots,`default`,{},void 0,!0)],4),M.value||K.value.alwaysVisible?(v(),p(`svg`,{id:`annotatorSvg`,key:Gt.value,ref_key:`mainSvg`,ref:bn,class:g({annotator__overlay:!0,"annotator__overlay--inactive":!M.value,draw:!0,"draw--free":w.value===`line`}),viewBox:`0 0 ${qt.value} ${Kt.value}`,width:Xt.value,height:Zt.value,onPointerdown:t[83]||=e=>mr(e),onPointerup:t[84]||=e=>Dr(e),onTouchend:t[85]||=e=>Dr(e),onTouchstart:t[86]||=e=>Fr(e),onPointermove:t[87]||=e=>{Fr(e),vr(e)},onPointerout:t[88]||=e=>fr(e),onPointerover:t[89]||=e=>qn(e),onClick:t[90]||=e=>er(e),style:_({position:`absolute`,top:0,left:0,cursor:vn.value,fontFamily:`Helvetica`,zIndex:1e8,pointerEvents:M.value?`all`:`none`})},[m(`rect`,{class:`annotator__glass`,x:`0`,y:`0`,width:qt.value,height:Kt.value,fill:`transparent`,"pointer-events":M.value?`all`:`none`,style:{cursor:`inherit`},onPointerdown:t[80]||=ve(e=>mr(e),[`stop`,`prevent`]),onPointermove:t[81]||=ve(e=>{Fr(e),vr(e)},[`stop`,`prevent`]),onPointerup:ve(Dr,[`stop`,`prevent`]),onClick:t[82]||=ve(e=>er(e),[`stop`,`prevent`])},null,40,yt),(v(!0),p(re,null,fe(Pn.value,e=>(v(),p(`g`,{key:e.id,innerHTML:e.html,style:_({pointerEvents:M.value?null:`none`}),onClick:t=>Cr(t,e.id),onDblclick:ve(t=>Sr(t,e.id),[`stop`,`prevent`])},null,44,bt))),128)),H.value&&P.value?(v(),p(`line`,{key:0,class:`vue-ui-annotator-caret`,x1:H.value.x,x2:H.value.x,y1:H.value.y1,y2:H.value.y2,stroke:H.value.color,"stroke-width":`2`,"pointer-events":`none`,"vector-effect":`non-scaling-stroke`},null,8,xt)):f(``,!0)],46,vt)):f(``,!0),Vt.value||pe(At)?(v(),p(`svg`,{key:1,style:{position:`absolute`,top:`0`,left:`0`},height:Zt.value,viewBox:`0 0 ${qt.value} ${Kt.value}`,width:Xt.value,"data-dom-to-png-ignore":``},[m(`circle`,{class:`animated-circle-print`,cx:qt.value/2,cy:Kt.value/2,r:`50`,stroke:`#6376DD`,"stroke-width":`10`,fill:`none`},null,8,Ct)],8,St)):f(``,!0)],8,_t)]))}},[[`__scopeId`,`data-v-9a06c054`]]);export{xe as n,Dt as t};