vue-data-ui 3.28.12 → 3.29.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (231) hide show
  1. package/dist/BaseScanner-m6QR9rwD.js +1 -0
  2. package/dist/{PackageVersion-PdpqwkYX.js → PackageVersion-B9qiUJPH.js} +1 -1
  3. package/dist/SlicerPreview-Ks9FNVzh.js +1 -0
  4. package/dist/Tooltip-B432XpvC.js +1 -0
  5. package/dist/{XyAnalysisOptions-DmKfwSu6.js → XyAnalysisOptions-DKCLKOkA.js} +1 -1
  6. package/dist/components/vue-ui-3d-bar.js +1 -1
  7. package/dist/components/vue-ui-accordion.js +1 -1
  8. package/dist/components/vue-ui-age-pyramid.js +1 -1
  9. package/dist/components/vue-ui-annotator.js +1 -1
  10. package/dist/components/vue-ui-bullet.js +1 -1
  11. package/dist/components/vue-ui-bump.js +1 -1
  12. package/dist/components/vue-ui-candlestick.js +1 -1
  13. package/dist/components/vue-ui-carousel-table.js +1 -1
  14. package/dist/components/vue-ui-chestnut.js +1 -1
  15. package/dist/components/vue-ui-chord.js +1 -1
  16. package/dist/components/vue-ui-circle-pack.js +1 -1
  17. package/dist/components/vue-ui-cursor.js +1 -1
  18. package/dist/components/vue-ui-dag.js +1 -1
  19. package/dist/components/vue-ui-dashboard.js +1 -1
  20. package/dist/components/vue-ui-digits.js +1 -1
  21. package/dist/components/vue-ui-donut-evolution.js +1 -1
  22. package/dist/components/vue-ui-donut.js +1 -1
  23. package/dist/components/vue-ui-dumbbell.js +1 -1
  24. package/dist/components/vue-ui-flow.js +1 -1
  25. package/dist/components/vue-ui-funnel.js +1 -1
  26. package/dist/components/vue-ui-galaxy.js +1 -1
  27. package/dist/components/vue-ui-gauge.js +1 -1
  28. package/dist/components/vue-ui-geo.js +1 -1
  29. package/dist/components/vue-ui-gizmo.js +1 -1
  30. package/dist/components/vue-ui-graph.js +1 -1
  31. package/dist/components/vue-ui-heatmap.js +1 -1
  32. package/dist/components/vue-ui-hill.js +1 -1
  33. package/dist/components/vue-ui-history-plot.js +1 -1
  34. package/dist/components/vue-ui-horizontal-bar.js +1 -1
  35. package/dist/components/vue-ui-kpi.js +1 -1
  36. package/dist/components/vue-ui-label.js +1 -1
  37. package/dist/components/vue-ui-mini-loader.js +1 -1
  38. package/dist/components/vue-ui-molecule.js +1 -1
  39. package/dist/components/vue-ui-mood-radar.js +1 -1
  40. package/dist/components/vue-ui-nested-donuts.js +1 -1
  41. package/dist/components/vue-ui-onion.js +1 -1
  42. package/dist/components/vue-ui-parallel-coordinate-plot.js +1 -1
  43. package/dist/components/vue-ui-quadrant.js +1 -1
  44. package/dist/components/vue-ui-quick-chart.js +1 -1
  45. package/dist/components/vue-ui-radar.js +1 -1
  46. package/dist/components/vue-ui-rating.js +1 -1
  47. package/dist/components/vue-ui-relation-circle.js +1 -1
  48. package/dist/components/vue-ui-ridgeline.js +1 -1
  49. package/dist/components/vue-ui-rings.js +1 -1
  50. package/dist/components/vue-ui-scatter.js +1 -1
  51. package/dist/components/vue-ui-skeleton.js +1 -1
  52. package/dist/components/vue-ui-smiley.js +1 -1
  53. package/dist/components/vue-ui-spark-trend.js +1 -1
  54. package/dist/components/vue-ui-sparkbar.js +1 -1
  55. package/dist/components/vue-ui-sparkgauge.js +1 -1
  56. package/dist/components/vue-ui-sparkhistogram.js +1 -1
  57. package/dist/components/vue-ui-sparkline.js +1 -1
  58. package/dist/components/vue-ui-sparkstackbar.js +1 -1
  59. package/dist/components/vue-ui-stackbar.js +1 -1
  60. package/dist/components/vue-ui-stackline.js +1 -1
  61. package/dist/components/vue-ui-strip-plot.js +1 -1
  62. package/dist/components/vue-ui-table-heatmap.js +1 -1
  63. package/dist/components/vue-ui-table-sparkline.js +1 -1
  64. package/dist/components/vue-ui-table.js +1 -1
  65. package/dist/components/vue-ui-thermometer.js +1 -1
  66. package/dist/components/vue-ui-timer.js +1 -1
  67. package/dist/components/vue-ui-tiremarks.js +1 -1
  68. package/dist/components/vue-ui-treemap.js +1 -1
  69. package/dist/components/vue-ui-vertical-bar.js +1 -1
  70. package/dist/components/vue-ui-waffle.js +1 -1
  71. package/dist/components/vue-ui-wheel.js +1 -1
  72. package/dist/components/vue-ui-word-cloud.js +1 -1
  73. package/dist/components/vue-ui-world.js +1 -1
  74. package/dist/components/vue-ui-xy-canvas.js +1 -1
  75. package/dist/components/vue-ui-xy.js +1 -1
  76. package/dist/package-GInOA5jS.js +1 -0
  77. package/dist/{render-common-C9aE_Va1.js → render-common-DF3B4DW7.js} +1 -1
  78. package/dist/ssr/vue-ui-donut.js +1 -1
  79. package/dist/ssr/vue-ui-xy.js +1 -1
  80. package/dist/ssr.js +1 -1
  81. package/dist/style.css +1 -1
  82. package/dist/types/vue-data-ui.d.ts +56 -9
  83. package/dist/useAnimationFrame-D8gcRfnW.js +1 -0
  84. package/dist/useConfig-9oDGTWWG.js +1 -0
  85. package/dist/useLoading-BwiplGDB.js +1 -0
  86. package/dist/{useObjectBindings-D789Dz63.js → useObjectBindings-DlxSTJOa.js} +1 -1
  87. package/dist/usePanZoom-CTGk8aJt.js +1 -0
  88. package/dist/utils.js +1 -1
  89. package/dist/vue-data-ui-Bx6exT7_.js +1 -0
  90. package/dist/vue-data-ui.js +1 -1
  91. package/dist/vue-ui-3d-bar-DkehT0SI.js +10 -0
  92. package/dist/{vue-ui-accordion-DxGxf-Rm.js → vue-ui-accordion-CnAwFOgA.js} +1 -1
  93. package/dist/vue-ui-age-pyramid-DXEyySR3.js +1 -0
  94. package/dist/vue-ui-annotator-DqrdF7bH.js +259 -0
  95. package/dist/vue-ui-bullet-BNgmEm8g.js +11 -0
  96. package/dist/vue-ui-bump-nFpAoRy7.js +8 -0
  97. package/dist/vue-ui-candlestick-DvBj3KWq.js +22 -0
  98. package/dist/vue-ui-carousel-table-ChEpsK7w.js +1 -0
  99. package/dist/vue-ui-chestnut-C-_fkI6E.js +1 -0
  100. package/dist/vue-ui-chord-WqXXM4Qs.js +9 -0
  101. package/dist/vue-ui-circle-pack-Bti7Wq1h.js +13 -0
  102. package/dist/vue-ui-cursor-C_zzn7Ua.js +1 -0
  103. package/dist/vue-ui-dag-BevQ37Gp.js +7 -0
  104. package/dist/vue-ui-dashboard-ruhBa6cl.js +1 -0
  105. package/dist/vue-ui-digits-B9ksORds.js +1 -0
  106. package/dist/{vue-ui-donut-BqnLIKwZ.js → vue-ui-donut-DhrhMru7.js} +1 -1
  107. package/dist/vue-ui-donut-SbqIxWeM.js +23 -0
  108. package/dist/vue-ui-donut-evolution-BkuALrYS.js +2 -0
  109. package/dist/vue-ui-dumbbell-SOI5CdGX.js +9 -0
  110. package/dist/vue-ui-flow-DqVrfXJo.js +3 -0
  111. package/dist/vue-ui-funnel-Byx_0z_B.js +1 -0
  112. package/dist/vue-ui-galaxy-BYbvOTrG.js +1 -0
  113. package/dist/vue-ui-gauge-3_cwmDni.js +1 -0
  114. package/dist/vue-ui-geo-HaNxzfYO.js +1 -0
  115. package/dist/vue-ui-gizmo-C38WKy7L.js +1 -0
  116. package/dist/{vue-ui-graph-CBkbFJIA.js → vue-ui-graph-Dp5FNReE.js} +2 -2
  117. package/dist/vue-ui-heatmap-DM0tteNh.js +1 -0
  118. package/dist/{vue-ui-hill-8c-9u8eg.js → vue-ui-hill-Dr6Du4gm.js} +1 -1
  119. package/dist/vue-ui-history-plot-C7iVkeuY.js +2 -0
  120. package/dist/vue-ui-horizontal-bar-BP2tt9hA.js +4 -0
  121. package/dist/vue-ui-kpi-8BL_aylw.js +1 -0
  122. package/dist/{vue-ui-label-CBrMoFDG.js → vue-ui-label-D9tcQ8rR.js} +1 -1
  123. package/dist/{vue-ui-mini-loader-PsWZLMLF.js → vue-ui-mini-loader-D5-HI4Wi.js} +1 -1
  124. package/dist/vue-ui-molecule-Bg1GqvBM.js +1 -0
  125. package/dist/vue-ui-mood-radar-DIiMInOP.js +1 -0
  126. package/dist/vue-ui-nested-donuts-BCyX7Z7n.js +19 -0
  127. package/dist/vue-ui-onion-EkxCuuTI.js +5 -0
  128. package/dist/vue-ui-parallel-coordinate-plot-CE80aawg.js +9 -0
  129. package/dist/vue-ui-quadrant-DJIuGrF9.js +2 -0
  130. package/dist/vue-ui-quick-chart-BBsBw9K3.js +9 -0
  131. package/dist/vue-ui-radar-BMYyMdOg.js +1 -0
  132. package/dist/{vue-ui-rating-D0QvpD3V.js → vue-ui-rating--jhcSeor.js} +1 -1
  133. package/dist/vue-ui-relation-circle-BLeJaQJH.js +1 -0
  134. package/dist/vue-ui-ridgeline-w92zZqP2.js +2 -0
  135. package/dist/vue-ui-rings-DUEitXix.js +1 -0
  136. package/dist/vue-ui-scatter-D1XzJLsA.js +9 -0
  137. package/dist/{vue-ui-skeleton-CZMyXM-1.js → vue-ui-skeleton-Bpwe9ox7.js} +2 -2
  138. package/dist/{vue-ui-smiley-C00q-teB.js → vue-ui-smiley-AEw3JB0L.js} +1 -1
  139. package/dist/vue-ui-spark-trend-B3TKtyLN.js +1 -0
  140. package/dist/vue-ui-sparkbar-CjLLQ0Ja.js +1 -0
  141. package/dist/vue-ui-sparkgauge-9g7UUVWq.js +1 -0
  142. package/dist/vue-ui-sparkhistogram-B_rUkfjQ.js +1 -0
  143. package/dist/vue-ui-sparkline-BJj8LCeA.js +1 -0
  144. package/dist/vue-ui-sparkstackbar-B5rGYUUe.js +1 -0
  145. package/dist/vue-ui-stackbar-k0mVr3qM.js +29 -0
  146. package/dist/vue-ui-stackline-D1sDzsaB.js +17 -0
  147. package/dist/vue-ui-strip-plot-bZisAUWl.js +2 -0
  148. package/dist/vue-ui-table-YFjpQD5z.js +14 -0
  149. package/dist/vue-ui-table-heatmap-Bl_rGqXv.js +1 -0
  150. package/dist/{vue-ui-table-sparkline-39sKOqcp.js → vue-ui-table-sparkline-D-FHk6aF.js} +1 -1
  151. package/dist/vue-ui-thermometer-1gRm4qfW.js +1 -0
  152. package/dist/vue-ui-timer-Urv_5Bq7.js +65 -0
  153. package/dist/vue-ui-tiremarks-CUCnVEGx.js +1 -0
  154. package/dist/vue-ui-treemap-NgjoCq7g.js +1 -0
  155. package/dist/vue-ui-waffle-Cy9bR4eg.js +1 -0
  156. package/dist/vue-ui-wheel-DdwADpJ9.js +1 -0
  157. package/dist/vue-ui-word-cloud-I1lrCi6H.js +4 -0
  158. package/dist/vue-ui-world-CFZoRY_U.js +19 -0
  159. package/dist/vue-ui-xy-BjZ7rM8l.js +27 -0
  160. package/dist/vue-ui-xy-BqivEt9H.js +31 -0
  161. package/dist/{vue-ui-xy-canvas-CRSisgSA.js → vue-ui-xy-canvas-DGniRsGt.js} +2 -2
  162. package/dist/xyScaleTicks-DMX-D9Wd.js +1 -0
  163. package/dist/xyScales-Cb-Z9Qso.js +1 -0
  164. package/package.json +3 -3
  165. package/dist/BaseScanner-8NdoBs7B.js +0 -1
  166. package/dist/SlicerPreview-0m9E7Zh_.js +0 -1
  167. package/dist/Tooltip-C1q0Qoh7.js +0 -1
  168. package/dist/package-DWjs4THo.js +0 -1
  169. package/dist/useConfig-_JwRfIqE.js +0 -1
  170. package/dist/usePanZoom-CE6Ofyy8.js +0 -1
  171. package/dist/vue-data-ui-Da3HK_wb.js +0 -1
  172. package/dist/vue-ui-3d-bar-D1XfKXhp.js +0 -19
  173. package/dist/vue-ui-age-pyramid-CJqqtEIh.js +0 -1
  174. package/dist/vue-ui-annotator-D31LD4-s.js +0 -331
  175. package/dist/vue-ui-bullet-CxyL5Bdm.js +0 -34
  176. package/dist/vue-ui-bump-BWWMzAN_.js +0 -8
  177. package/dist/vue-ui-candlestick-CQXdyPEt.js +0 -22
  178. package/dist/vue-ui-carousel-table-DwsfnL_l.js +0 -1
  179. package/dist/vue-ui-chestnut-DV7XKL7g.js +0 -1
  180. package/dist/vue-ui-chord-DRNn_E6i.js +0 -21
  181. package/dist/vue-ui-circle-pack-BcA9ZxZS.js +0 -13
  182. package/dist/vue-ui-cursor-DSgVvP1L.js +0 -1
  183. package/dist/vue-ui-dag-CWpyU7AJ.js +0 -9
  184. package/dist/vue-ui-dashboard-Dh_Zi8oG.js +0 -1
  185. package/dist/vue-ui-digits-Cy3Y6qro.js +0 -42
  186. package/dist/vue-ui-donut-DasGeYdl.js +0 -47
  187. package/dist/vue-ui-donut-evolution-Bw7ilDYR.js +0 -2
  188. package/dist/vue-ui-dumbbell-BPvvKhag.js +0 -9
  189. package/dist/vue-ui-flow-XI5Y3qdk.js +0 -3
  190. package/dist/vue-ui-funnel-DqoQogQE.js +0 -1
  191. package/dist/vue-ui-galaxy-NRaBIHpn.js +0 -1
  192. package/dist/vue-ui-gauge-DX4SBIKS.js +0 -1
  193. package/dist/vue-ui-geo-C3e4J_kw.js +0 -1
  194. package/dist/vue-ui-gizmo-C9ls2b4h.js +0 -1
  195. package/dist/vue-ui-heatmap-D6KP1N8f.js +0 -1
  196. package/dist/vue-ui-history-plot-CowxWkEd.js +0 -2
  197. package/dist/vue-ui-horizontal-bar-CVP5jBNJ.js +0 -4
  198. package/dist/vue-ui-kpi-D1MUlURM.js +0 -1
  199. package/dist/vue-ui-molecule-BRB54XBD.js +0 -1
  200. package/dist/vue-ui-mood-radar-CkHJdUyF.js +0 -1
  201. package/dist/vue-ui-nested-donuts-C-7VZO11.js +0 -19
  202. package/dist/vue-ui-onion-erpKpDKg.js +0 -5
  203. package/dist/vue-ui-parallel-coordinate-plot-BDg0pRkN.js +0 -9
  204. package/dist/vue-ui-quadrant-CUdNxC6W.js +0 -2
  205. package/dist/vue-ui-quick-chart-DE5Zwioe.js +0 -16
  206. package/dist/vue-ui-radar-6y6er9ND.js +0 -1
  207. package/dist/vue-ui-relation-circle-CjnG9G7s.js +0 -1
  208. package/dist/vue-ui-ridgeline-B4qi2Ajl.js +0 -2
  209. package/dist/vue-ui-rings-EYfCkNB6.js +0 -1
  210. package/dist/vue-ui-scatter-Tw-5uRac.js +0 -9
  211. package/dist/vue-ui-spark-trend-Cmj4aWcQ.js +0 -1
  212. package/dist/vue-ui-sparkbar-Crq1Vui3.js +0 -1
  213. package/dist/vue-ui-sparkgauge-CN_9yenn.js +0 -1
  214. package/dist/vue-ui-sparkhistogram-CK7JmyCw.js +0 -1
  215. package/dist/vue-ui-sparkline-2_RlGrAT.js +0 -1
  216. package/dist/vue-ui-sparkstackbar-Dwdn2_9q.js +0 -1
  217. package/dist/vue-ui-stackbar-BVmQJn2b.js +0 -29
  218. package/dist/vue-ui-stackline-nvhui30B.js +0 -39
  219. package/dist/vue-ui-strip-plot-Dig2RljR.js +0 -2
  220. package/dist/vue-ui-table-_qSw3iGd.js +0 -14
  221. package/dist/vue-ui-table-heatmap-BwoRcqFD.js +0 -1
  222. package/dist/vue-ui-thermometer-CoVrrzHW.js +0 -1
  223. package/dist/vue-ui-timer-DoR5PqOa.js +0 -64
  224. package/dist/vue-ui-tiremarks-9tPPNGiq.js +0 -1
  225. package/dist/vue-ui-treemap-D3mZkT4P.js +0 -1
  226. package/dist/vue-ui-waffle-D2GfM_Se.js +0 -1
  227. package/dist/vue-ui-wheel-CYBaqHm6.js +0 -1
  228. package/dist/vue-ui-word-cloud-ClGL6iKL.js +0 -4
  229. package/dist/vue-ui-world-Dm7LSNB2.js +0 -19
  230. package/dist/vue-ui-xy-2VCMSzeE.js +0 -27
  231. package/dist/vue-ui-xy-DUlJcC9R.js +0 -31
@@ -0,0 +1,10 @@
1
+ import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{n as t,r as n,t as r}from"./userOptionsSlots-CWtXN5Q6.js";import{n as i,r as a,t as o}from"./annotationSlots-OLiW25XN.js";import{n as s,t as c}from"./tableIntegration-CNoJ1CIY.js";import{n as l}from"./resolveChartConfig-0IvbmIE_.js";import{$ as u,D as d,Ft as f,Ht as p,It as ee,Jt as m,Q as h,S as te,X as ne,at as re,b as ie,f as ae,h as oe,i as se,in as ce,nt as le,p as ue,t as de,w as fe,yt as pe,zt as me}from"./lib-rPeBMZrn.js";import{n as he}from"./useHints-C-TwxM0Y.js";import{t as ge}from"./useConfig-9oDGTWWG.js";import{t as _e}from"./usePrefersMotion-XLHwega2.js";import{t as ve}from"./usePrinter-DVf3YcG5.js";import{t as ye}from"./useResponsive-CENUxfEL.js";import{t as be}from"./useChartExport-BZts4KFb.js";import{t as xe}from"./useUserOptionState-CXlFnwPv.js";import{t as Se}from"./useChartAccessibility-DOMuYJfm.js";import{t as Ce}from"./img-D4RQwASc.js";import{n as we}from"./Title-BliHuXfT.js";import{t as Te}from"./vue_ui_3d_bar-Dm8zmL8w.js";import{t as Ee}from"./BaseScanner-m6QR9rwD.js";import{t as De}from"./A11yDataTable-DWNlWXzs.js";import{t as g}from"./DefGrad-DKMq1REY.js";import{t as Oe}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{Fragment as _,computed as v,createBlock as y,createCommentVNode as b,createElementBlock as x,createElementVNode as S,createSlots as ke,createTextVNode as Ae,createVNode as C,defineAsyncComponent as w,guardReactiveProps as je,mergeProps as Me,nextTick as Ne,normalizeClass as Pe,normalizeProps as Fe,normalizeStyle as T,onBeforeUnmount as Ie,onMounted as Le,openBlock as E,ref as D,renderList as O,renderSlot as k,resolveDynamicComponent as Re,toDisplayString as A,unref as j,watch as M,withCtx as N,withKeys as ze,withModifiers as Be}from"vue";var Ve=/* @__PURE__ */ e({default:()=>Yt}),He=[`id`],Ue=[`id`],We={"aria-live":`polite`,class:`sr-only`},Ge={style:{position:`relative`}},Ke=[`xmlns`,`viewBox`,`aria-describedby`],qe=[`width`,`height`],Je={key:1},Ye=[`x`,`y`,`font-size`,`font-weight`,`fill`],Xe=[`x`,`y`],Ze=[`cx`,`cy`,`stroke`,`opacity`],Qe=[`d`,`stroke`],$e=[`d`,`stroke`],et={key:4},tt={key:0},nt=[`stroke-dasharray`,`d`,`stroke`,`stroke-width`],rt=[`stroke-dasharray`,`d`,`stroke`,`stroke-width`],it=[`stroke-dasharray`,`d`,`stroke`,`stroke-width`],at=[`stroke-dasharray`,`d`,`stroke`,`stroke-width`],ot={key:1},st=[`d`,`stroke`,`stroke-width`,`fill`],ct=[`d`,`stroke`,`stroke-width`,`fill`],lt=[`d`,`stroke`,`stroke-width`,`fill`],ut={key:2},dt=[`aria-label`],ft=[`d`,`fill`,`onMouseenter`,`onClick`,`onMouseout`],pt=[`d`,`fill`,`onMouseenter`,`onClick`,`onMouseout`],mt=[`d`,`fill`,`onMouseenter`,`onClick`,`onMouseout`],ht=[`d`,`onMouseenter`,`onClick`,`onMouseout`],gt=[`d`],_t=[`d`,`stroke`],vt={key:5},yt={key:0},bt=[`stroke-dasharray`,`d`,`stroke`,`stroke-width`],xt=[`stroke-dasharray`,`d`,`stroke`,`stroke-width`],St=[`stroke-dasharray`,`d`,`stroke`,`stroke-width`],Ct=[`stroke-dasharray`,`d`,`stroke`,`stroke-width`],wt=[`d`,`stroke`,`stroke-width`,`fill`],Tt=[`d`,`stroke`,`stroke-width`,`fill`],Et=[`d`],Dt={key:1},Ot=[`aria-label`],kt=[`onMouseenter`,`onClick`,`onMouseout`,`d`,`fill`],At=[`onMouseenter`,`onClick`,`onMouseout`,`d`],jt=[`onMouseenter`,`onClick`,`onMouseout`,`d`,`fill`],Mt={key:6},Nt=[`onClick`],Pt=[`stroke`,`d`],Ft=[`cx`,`cy`,`fill`,`stroke`],It=[`x`,`y`,`width`,`height`],Lt=[`x`,`y`,`width`,`height`],Rt={key:3},zt=[`d`,`stroke`],Bt=[`d`,`fill`,`stroke`],Vt={key:0},Ht=[`text-anchor`,`x`,`y`,`fill`,`font-size`,`font-weight`],Ut=[`text-anchor`,`x`,`y`,`fill`,`font-size`,`font-weight`],Wt={key:4},Gt=[`d`,`fill`,`stroke`],Kt={key:4,class:`vue-data-ui-watermark`},qt={key:0},Jt={key:1},Yt=/*#__PURE__*/ Oe({__name:`vue-ui-3d-bar`,props:{config:{type:Object,default(){return{}}},dataset:{type:Object,default(){return{}}}},emits:[`selectDatapoint`,`copyAlt`],setup(e,{expose:Oe,emit:Ve}){let Yt=w(()=>import(`./BaseIcon-CoY0vuL3.js`).then(e=>e.n)),Xt=w(()=>import(`./vue-ui-accordion-CnAwFOgA.js`).then(e=>e.n)),Zt=w(()=>import(`./DataTable-KeuZB1JM.js`)),Qt=w(()=>import(`./PenAndPaper-BV5ODysA.js`).then(e=>e.t)),$t=w(()=>import(`./UserOptions-K1N7zQRx.js`).then(e=>e.n)),en=w(()=>import(`./PackageVersion-B9qiUJPH.js`).then(e=>e.t)),tn=w(()=>import(`./BaseDraggableDialog-DVstuNhT.js`).then(e=>e.n)),{vue_ui_3d_bar:nn}=ge(),P=e,rn=Ve,an=v(()=>{let e=P.dataset;return!e||typeof e!=`object`?!1:e.series==null?Number.isFinite(e.percentage):Array.isArray(e.series)&&e.series.length>0&&e.series.every(e=>e&&typeof e==`object`&&`name`in e&&Number.isFinite(e.value)&&(e.breakdown==null||Array.isArray(e.breakdown)&&e.breakdown.every(e=>e&&typeof e==`object`&&`name`in e&&Number.isFinite(e.value))))}),on=v(wn),F=v(()=>!!on.value.loading||!an.value),sn=_e(),cn=!1,ln=null,I=null,L=D(ne()),R=D(null),z=D(!1),un=D(0),dn=D(0),fn=D(null),pn=D(null),B=D(!1),mn=D(null),hn=D(null),gn=v(()=>ce({defaultConfig:{customPalette:[`#808080`,`#ADADAD`,`#DBDBDB`],userOptions:{show:!1},table:{show:!1},style:{chart:{backgroundColor:`#99999930`,color:`#6A6A6A`,bar:{color:`#ADADAD`,stroke:`#6A6A6A`},box:{stroke:`#6A6A6A`}}}},userConfig:on.value.skeletonConfig??{}})),V=v(()=>F.value?ce({defaultConfig:on.value,userConfig:gn.value}):on.value),_n=v(()=>V.value.style),H=v(()=>V.value.style.chart),U=v(()=>V.value.userOptions);he({config:()=>V.value,dataset:()=>P.dataset,component:`VueUi3dBar`,rules:[{test:e=>Array.isArray(e?.series)&&e.series.length>8,message:[`👀 The number of series is > 8. Consider:`,``,`▶️ Grouping small values dynamically into a single "Other" series.`,``,`▶️ Using filters to let users choose a maximum number of series to display.`,``,`▶️ Using VueUiHorizontalBar instead to make the dataset breakdown easier to read.`]},{test:e=>Array.isArray(e?.series)&&e.series.some(e=>e?.breakdown&&e.breakdown.length>6),message:[`👀 Some donut breakdowns have > 6 data points. Consider:`,``,`▶️ Grouping small values dynamically into a single "Other" data point.`]}]});let vn=v(()=>V.value.userOptions.useCursorPointer),yn={series:[{name:`_`,value:21,breakdown:[{name:`_`,value:13},{name:`_`,value:8}]},{name:`_`,value:13,breakdown:[{name:`_`,value:8},{name:`_`,value:5}]},{name:`_`,value:8,breakdown:[{name:`_`,value:5},{name:`_`,value:3}]}]},W=v(()=>F.value?P.config?.skeletonDataset??yn:P.dataset),{userOptionsVisible:bn,setUserOptionsVisibility:xn,keepUserOptionState:Sn}=xe({config:V.value}),{svgRef:Cn}=Se({config:V.value.style.chart.title});function wn(){return l(P.config,nn,Te)}M(()=>P.config,()=>{bn.value=!V.value.userOptions.showOnChartHover,un.value+=1,dn.value+=1},{deep:!0});let{isPrinting:Tn,isImaging:En,generatePdf:Dn,generateImage:On}=ve({elementId:`3d_bar_${L.value}`,fileName:H.value.title.text||`vue-ui-3d-bar`,options:V.value.userOptions.print}),kn=v(()=>fe(V.value.customPalette)),An=D({showTable:V.value.table.show});M([()=>V.value.table.show,F],([e])=>{An.value.showTable=e});let G=v(()=>W.value.series&&W.value.series.length),jn=D(H.value.box.dimensions.width*(G.value?2:1)),Mn=D(H.value.box.dimensions.height),K=v(()=>({height:Mn.value,width:jn.value,absoluteWidth:jn.value,top:H.value.box.dimensions.top,bottom:H.value.box.dimensions.bottom,left:H.value.box.dimensions.left,right:H.value.box.dimensions.right,perspective:H.value.box.dimensions.perspective})),q=v(()=>(W.value.series||[]).reduce((e,t)=>e+Math.max(0,t.value||0),0)),Nn=v(()=>{if(!G.value)return null;let e=/* @__PURE__ */ new Set;return W.value.series.map((t,n)=>{let r=t.id==null?`bar3d_${L.value}_${n}`:`bar3d_${L.value}_id_${Array.from(String(t.id),e=>e.codePointAt(0).toString(16)).join(`_`)}`;e.has(r)&&(r+=`_duplicate_${n}`),e.add(r);let i=Math.max(0,t.value||0);return{...t,value:i,id:r,seriesIndex:n,proportion:q.value?i/q.value:0,color:te(t.color)||kn.value[n]||p[n%p.length],breakdown:t.breakdown?[...t.breakdown].map(e=>({...e,value:Math.max(0,e.value||0)})).sort((e,t)=>t.value-e.value):null}}).sort((e,t)=>t.value-e.value)}),J=v(()=>{if(!Nn.value)return null;let e=0;return Nn.value.map(t=>{let n=Wn(e,t.proportion,t.breakdown,t.color);return e+=t.proportion,{...t,fill:n}})}),Y=v(()=>{let e=K.value.width/2,t=K.value;return{right:`M${e},${t.top} ${t.width-t.right}, ${t.top+t.perspective} ${t.width-t.right},${t.height-t.bottom-t.perspective} ${e},${t.height-t.bottom}`,left:`M${e},${t.top} ${t.left},${t.top+t.perspective} ${t.left},${t.height-t.bottom-t.perspective} ${e},${t.height-t.bottom}`,side:`M${e},${t.height-t.bottom} ${e},${t.top+t.perspective*2}`,topSides:`M${t.left},${t.top+t.perspective} ${e},${t.top+t.perspective*2} ${t.width-t.right},${t.top+t.perspective}`,tubeTop:`M${t.left},${t.top+t.perspective} C ${t.left},${t.top-t.perspective/3} ${t.width-t.right},${t.top-t.perspective/3} ${t.width-t.right},${t.top+t.perspective} C ${t.width-t.right},${t.top+t.perspective*2.3} ${t.left},${t.top+t.perspective*2.3} ${t.left},${t.top+t.perspective}`,tubeLeft:`M${t.left},${t.top+t.perspective} ${t.left},${t.height-t.bottom-t.perspective}`,tubeRight:`M${t.width-t.right},${t.top+t.perspective} ${t.width-t.right},${t.height-t.bottom-t.perspective}`,tubeBottom:`M${t.width-t.right},${t.height-t.bottom-t.perspective} C ${t.width-t.right},${t.height} ${t.left},${t.height} ${t.left},${t.height-t.bottom-t.perspective}`}}),X=D(0),Pn=null,Fn=0;function In(){Fn+=1,Pn!==null&&cancelAnimationFrame(Pn),Pn=null}M([()=>W.value.percentage,()=>H.value.animation.use,()=>H.value.animation.speed,()=>H.value.animation.acceleration,G,F,sn],([e])=>{In();let t=Number.isFinite(e)?e:0,{use:n,speed:r,acceleration:i}=H.value.animation;if(cn)return;if(!n||G.value||F.value||sn.value||!Number.isFinite(r)||r<=0||!Number.isFinite(i)||i<0||t<=0){X.value=t;return}X.value=0;let a=Fn,o=0;function s(){cn||a!==Fn||(Pn=null,X.value=Math.min(t,X.value+r+o),o+=.005*i,X.value<t&&(Pn=requestAnimationFrame(s)))}s()},{immediate:!0}),Le(Hn);let Ln=v(()=>on.value.debug);function Rn(){if(Ln.value){if(me(P.dataset))re({componentName:`VueUi3dBar`,type:`dataset`,debug:Ln.value});else if(!P.dataset.series)pe({datasetObject:P.dataset,requiredAttributes:[`percentage`]}).forEach(e=>{re({componentName:`VueUi3dBar`,type:`datasetAttribute`,property:e,debug:Ln.value})});else{if(!Array.isArray(P.dataset.series)){console.warn(`VueUi3dBar: dataset series must be an array.`);return}P.dataset.series.forEach((e,t)=>{if(!e||typeof e!=`object`)console.warn(`VueUi3dBar: series at index ${t} must be an object.`);else if(pe({datasetObject:e,requiredAttributes:[`name`,`value`]}).forEach(e=>{re({componentName:`VueUi3dBar`,type:`datasetSerieAttribute`,property:e,index:t,debug:Ln.value})}),e.breakdown){if(!Array.isArray(e.breakdown)){console.warn(`VueUi3dBar: breakdown at series index ${t} must be an array.`);return}e.breakdown.forEach((e,n)=>{!e||typeof e!=`object`?console.warn(`VueUi3dBar: breakdown at index ${t} - ${n} must be an object.`):pe({datasetObject:e,requiredAttributes:[`name`,`value`]}).forEach(e=>{re({componentName:`VueUi3dBar`,type:`datasetSerieAttribute`,property:e,index:`${t} - ${n}`,debug:Ln.value})})})}})}}}M([()=>P.dataset,Ln],Rn,{deep:!0,immediate:!0});function zn(){if(I=null,cn||!V.value.responsive||!R.value?.parentNode)return;let{width:e,height:t}=ye({chart:R.value,title:H.value.title.text?fn.value:null,source:pn.value});Mn.value=t-12,jn.value=e}function Bn(){!cn&&V.value.responsive&&I===null&&(I=requestAnimationFrame(zn))}function Vn(){jn.value=H.value.box.dimensions.width*(G.value?2:1),Mn.value=H.value.box.dimensions.height}function Hn(){ln?.disconnect(),ln=null,I!==null&&cancelAnimationFrame(I),I=null,cn||(V.value.responsive&&R.value?.parentNode?(ln=new ResizeObserver(Bn),ln.observe(R.value.parentNode),Bn()):Vn())}M(()=>V.value.responsive,Hn,{flush:`post`}),M([()=>H.value.box.dimensions,G],()=>{V.value.responsive?Bn():Vn()},{deep:!0}),M(()=>H.value.title,Bn,{deep:!0,flush:`post`}),Ie(()=>{cn=!0,In(),I!==null&&cancelAnimationFrame(I),ln?.disconnect()});let Un=v(()=>K.value.width/4);function Wn(e,t,n,r){let i=K.value.height-K.value.bottom-K.value.top-K.value.perspective*2,{width:a,height:o,bottom:s,right:c,left:l,perspective:u}=K.value,d=G.value?a/4:a/2,p=d*2+l,m=s+i*e,h=o-m-u-i*t/2,te=h>K.value.height/2?`top`:`bottom`,ne=o*.25,re=!!n?.length&&Qn(n)>0,ie=null,ae=null;return re&&(n=n.map((e,t)=>({...e,value:e.value||0,color:f(r,t/n.length)})),ie=ee({series:n},a/2+a/5,te===`top`?h-ne:h+ne,a/10,a/10,1.99999,2,1,360,105.25,a/20),ae=ee({series:n},a-p+a/14,o-m-u-i*t/2,a/40,a/40,1.99999,2,1,360,105.25,a/40)),{...Gn(e,t),donut:ie,miniDonut:ae,donutR:a/20,CENTER_X:d,sidePointer:{x:a-p,x2:a-p+a/14,xText:a-p+a/9,y:o-m-u-i*t/2,topY:o-m-u-i*t,height:i*t},apexBottom:{y:o-m,x:d},apexTop:{y:o-m-i*t,x:d},liningTop:`M${l},${o-m-u-i*t} ${d},${o-m-i*t} ${a-p},${o-m-u-i*t}`,liningTopShade:`M${l},${o-m-u-i*t-.5} ${d},${o-m-i*t-.5} ${a-p},${o-m-u-i*t-.5}`,bottomTubeTop:`M ${a-p-.5},${o-m-u} C ${a-p-.5},${o-m+u/2} ${l},${o-m+u/2} ${l+.5},${o-m-u}`}}function Gn(e,t,n=!1){let{width:r,height:i,bottom:a,right:o,left:s,perspective:c}=K.value,l=i-a-K.value.top-c*2,u=G.value?r/4:r/2,d=G.value?u*2+s:o,f=a+l*e;return{right:`M${u},${i-f} ${u},${i-f-l*t} ${r-d},${i-f-c-l*t} ${r-d},${i-f-c}Z`,left:`M${u},${i-f} ${u},${i-f-l*t} ${s}, ${i-f-c-l*t} ${s},${i-f-c}Z`,top:`M${u},${i-f-l*t} ${s},${i-f-c-l*t} ${u},${i-f-c*2-l*t} ${r-d},${i-f-c-l*t} Z`,tubeTop:`M${s},${i-f-l*t-c} C ${s},${i-f-l*t-c*2.5} ${r-d},${i-f-l*t-c*2.5} ${r-d},${i-f-l*t-c} C ${r-d},${i-f-l*t+c/2} ${s},${i-f-l*t+c/2} ${s},${i-f-l*t-c}`,tubeBody:`M
2
+ ${s},${i-f-l*t-c}
3
+ C ${s},${i-f-l*t+c/2}
4
+ ${r-d},${i-f-l*t+c/2}
5
+ ${r-d},${i-f-l*t-c}
6
+ L${r-d},${n?i-c*1.5:i-f-c}
7
+ C
8
+ ${r-d},${n?i:i-f+c/2}
9
+ ${s},${n?i:i-f+c/2}
10
+ ${s},${i-f-c}Z`}}let Kn=v(()=>Gn(0,ie(X.value/100),!0)),Z=D(null),qn=v(()=>{let e=J.value?.findIndex(e=>e.id===Z.value)??-1;return e>=0?e:null}),Jn=v(()=>J.value?.find(e=>e.id===Z.value)??null),Yn=v(()=>Jn.value?br(Jn.value)+(z.value?` selected`:``):``);M([J,F],()=>{(F.value||Z.value!=null&&!Jn.value)&&yr()});function Q(e,t=!1){if(F.value)return;let n=t?`datapointClick`:`datapointEnter`;V.value.events[n]?.({datapoint:e,seriesIndex:e.seriesIndex}),rn(`selectDatapoint`,e),t&&(z.value=!(z.value&&Z.value===e.id)),Z.value=e.id}function $(e){V.value.events.datapointLeave?.({datapoint:e,seriesIndex:e.seriesIndex}),z.value||(Z.value=null)}let Xn=v(()=>new Map((Nn.value||[]).map(e=>[e.id,Qn(e.breakdown||[])])));function Zn(e,t,n=!1){let r=Xn.value.get(t.id)||0,i=n?r?e.value/r*100:0:q.value?e.value/q.value*100:0;return n?i:i.toFixed(0)+`%`}function Qn(e){return e.reduce((e,t)=>e+t.value,0)}let $n=D(!1);function er(e){$n.value=e}function tr(){return G.value?J.value:W.value.percentage}let nr=v(()=>G.value?{head:Nn.value.flatMap(e=>e.breakdown&&e.breakdown.length?[{name:e.name,color:e.color},...e.breakdown.map((t,n)=>({name:t.name,color:f(e.color,n/e.breakdown.length)}))]:{name:e.name,color:e.color}),body:Nn.value.flatMap(e=>e.breakdown&&e.breakdown.length?[e.value,...e.breakdown.map(e=>e.value)]:e.value)}:null);function rr(e=null){G.value?Ne(()=>{let t=nr.value.head.map((e,t)=>[[e.name],[nr.value.body[t]],[isNaN(nr.value.body[t]/q.value)?`-`:nr.value.body[t]/q.value*100]]),n=[[H.value.title.text],[H.value.title.subtitle.text],[[``],[`val`],[`%`]]].concat(t),r=d(n);e?e(r):le({csvContent:r,title:H.value.title.text||`vue-ui-3d-bar`})}):console.warn(`VueUi3dBar : CSV download is only available in stack mode (providing dataset.series instead of dataset.percentage)`)}let ir=v(()=>({th:{backgroundColor:V.value.table.th.backgroundColor,color:V.value.table.th.color,outline:V.value.table.th.outline},td:{backgroundColor:V.value.table.td.backgroundColor,color:V.value.table.td.color,outline:V.value.table.td.outline},breakpoint:V.value.table.responsiveBreakpoint,shape:V.value.style.shape===`tube`?`circle`:`square`})),ar=v(()=>{if(!G.value||!Array.isArray(J.value)||!J.value.length)return{colNames:[],head:[],body:[],a11yBody:[],config:ir.value};let e=[`__SUM__`,u({p:H.value.legend.prefix,v:q.value,s:H.value.legend.suffix,r:V.value.table.td.roundingValue}),q.value?`100%`:`-`],t=nr.value.head.map((e,t)=>{let n=nr.value.body[t];return[{color:e.color,name:e.name},u({p:H.value.legend.prefix,v:n,s:H.value.legend.suffix,r:V.value.table.td.roundingValue}),isNaN(n/q.value)?`-`:u({v:n/q.value*100,s:`%`,r:V.value.table.td.roundingPercentage})]}),n=t.map(e=>e.map((e,t)=>t===0?e.name:e));return{colNames:[V.value.table.columnNames.series,V.value.table.columnNames.value,V.value.table.columnNames.percentage],head:e,body:t,a11yBody:n,config:ir.value}});function or(){An.value.showTable=!An.value.showTable}let sr=D(!1);function cr(){sr.value=!sr.value}async function lr({scale:e=2}={}){if(!R.value)return;let{width:t,height:n}=R.value.getBoundingClientRect(),r=t/n,{imageUri:i,base64:a}=await Ce({domElement:R.value,base64:!0,img:!0,scale:e});return{imageUri:i,base64:a,title:H.value.title.text,width:t,height:n,aspectRatio:r}}let ur=v(()=>c({config:V,style:H,mutableConfig:An,dialog:tn,accordion:Xt,isFullscreen:$n,parent:R,maxWidth:800}));M(()=>An.value.showTable,e=>{mn.value&&s(e,V,mn)});function dr(){An.value.showTable=!1,hn.value&&hn.value.setTableIconState(!1)}let fr=v(()=>V.value.style.chart.backgroundColor),pr=v(()=>V.value.style.chart.title),{isCallbackImaging:mr,isCallbackSvg:hr,generateSvg:gr,onGenerateImage:_r}=be({svg:Cn,title:pr,legend:null,legendItems:null,backgroundColor:fr,getSvgCallback:()=>V.value.userOptions.callbacks.svg,generateImage:On});async function vr(){rn(`copyAlt`,{config:V.value,dataset:W.value}),V.value.userOptions.callbacks.altCopy?await Promise.resolve(V.value.userOptions.callbacks.altCopy({config:V.value,dataset:W.value})):console.warn("Vue Data UI - A callback must be set for `altCopy` in userOptions.")}function yr(){z.value=!1,Z.value=null}function br(e){if(!e)return``;let t=u({p:H.value.legend.prefix,v:e.value,s:H.value.legend.suffix,r:H.value.legend.roundingValue}),n=u({v:e.proportion*100,s:`%`,r:H.value.legend.roundingPercentage});return`${e.name}: ${t}, ${n}`}function xr(e){if(!G.value||!J.value?.length)return;let t=J.value[e];t&&(Z.value=t.id)}function Sr(){B.value=!0,!F.value&&G.value&&J.value?.length&&qn.value===null&&xr(0)}function Cr(){B.value=!1,z.value||(Z.value=null)}function wr(e){if(F.value||sr.value||!G.value||!J.value?.length||!Cn.value||document.activeElement!==Cn.value)return;let t=[`ArrowLeft`,`ArrowDown`].includes(e.key),n=[`ArrowRight`,`ArrowUp`].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){yr();return}if(r){if(qn.value===null)return;let e=J.value[qn.value];if(!e)return;Q(e,!0);return}let a=qn.value;a===null||a<0||a>=J.value.length?a=n?0:J.value.length-1:n?(a+=1,a>=J.value.length&&(a=0)):t&&(--a,a<0&&(a=J.value.length-1)),xr(a)}let Tr=v(()=>({headers:ar.value?.colNames??[],rows:ar.value?.a11yBody??[]}));return Oe({getImage:lr,generateCsv:rr,generatePdf:Dn,generateImage:On,generateSvg:gr,getData:tr,toggleTable:or,toggleAnnotator:cr,toggleFullscreen:er,copyAlt:vr}),(e,s)=>(E(),x(`div`,{ref_key:`bar3dChart`,ref:R,class:Pe(`vue-data-ui-component vue-ui-3d-bar`),style:T(`font-family:${_n.value.fontFamily};width:100%; text-align:center;background:${H.value.backgroundColor}`),id:`3d_bar_${L.value}`,onMouseenter:s[8]||=()=>j(xn)(!0),onMouseleave:s[9]||=()=>j(xn)(!1)},[S(`div`,{id:`chart-instructions-${L.value}`,class:`sr-only`},[S(`p`,null,A(V.value.a11y.translations.keyboardNavigation),1)],8,Ue),S(`div`,We,A(Yn.value),1),V.value.a11y.includeTable&&Tr.value?.rows?.length?(E(),y(De,{key:0,uid:L.value,head:Tr.value.headers,body:Tr.value.rows,notice:V.value.a11y.translations.tableAvailable,caption:V.value.a11y.translations.tableCaption},null,8,[`uid`,`head`,`body`,`notice`,`caption`])):b(``,!0),U.value.buttons.annotator?(E(),y(j(Qt),Me({key:1},j(a)(U.value.annotator),{svgRef:j(Cn),backgroundColor:H.value.backgroundColor,color:H.value.color,active:sr.value,isCursorPointer:vn.value,palette:U.value.annotatorPalette,onClose:cr}),ke({_:2},[O(j(o),t=>({name:t,fn:N(n=>[k(e.$slots,t,Fe(je(j(i)(t,n))),void 0,!0)])}))]),1040,[`svgRef`,`backgroundColor`,`color`,`active`,`isCursorPointer`,`palette`])):b(``,!0),H.value.title.text?(E(),x(`div`,{key:2,ref_key:`chartTitle`,ref:fn,style:`width:100%;background:transparent`},[(E(),y(we,{key:`title_${un.value}`,config:{title:{cy:`3dBar-div-title`,...H.value.title},subtitle:{cy:`3dBar-div-subtitle`,...H.value.title.subtitle}}},null,8,[`config`]))],512)):b(``,!0),U.value.show&&an.value&&(j(Sn)||j(bn))?(E(),y(j($t),Me({key:3,ref_key:`userOptionsRef`,ref:hn,backgroundColor:H.value.backgroundColor,color:H.value.color,isPrinting:j(Tn),isImaging:j(En),uid:L.value,hasTable:!!G.value&&U.value.buttons.table,hasXls:!!G.value&&U.value.buttons.csv,isFullscreen:$n.value,chartElement:R.value},j(n)(U.value,`pdf img svg fullscreen altCopy annotator`),{isAnnotation:sr.value,tableDialog:V.value.table.useDialog,isCursorPointer:vn.value,onToggleFullscreen:er,onGeneratePdf:j(Dn),onGenerateCsv:rr,onGenerateImage:j(_r),onGenerateSvg:j(gr),onToggleTable:or,onToggleAnnotator:cr,onCopyAlt:vr,style:{visibility:j(Sn)?j(bn)?`visible`:`hidden`:`visible`}}),ke({_:2},[O(j(t)(e.$slots,`menuIcon optionPdf optionCsv optionImg optionSvg optionTable optionFullscreen optionAnnotator optionAltCopy custom-menu-before custom-menu-after`),t=>({name:t,fn:N(n=>[k(e.$slots,t,Fe(je(j(r)(t,n))),void 0,!0)])}))]),1040,[`backgroundColor`,`color`,`isPrinting`,`isImaging`,`uid`,`hasTable`,`hasXls`,`isFullscreen`,`chartElement`,`isAnnotation`,`tableDialog`,`isCursorPointer`,`onGeneratePdf`,`onGenerateImage`,`onGenerateSvg`,`style`])):b(``,!0),S(`div`,Ge,[(E(),x(`svg`,{ref_key:`svgRef`,ref:Cn,xmlns:j(de),class:Pe({"vue-data-ui-fullscreen--on":$n.value,"vue-data-ui-fulscreen--off":!$n.value}),viewBox:`0 0 ${K.value.absoluteWidth} ${K.value.height}`,style:T(`max-width:100%; overflow: visible; background:transparent;color:${H.value.color}`),tabindex:`0`,"aria-describedby":`chart-instructions-${L.value}`,onFocus:Sr,onBlur:Cr,onKeydown:wr},[C(j(en)),k(e.$slots,`svg-underlayer`,{svg:{...K.value,isPrintingImg:j(Tn)||j(En)||j(mr),isPrintingSvg:j(hr)}},void 0,!0),e.$slots[`chart-background`]?(E(),x(`foreignObject`,{key:0,x:0,y:0,width:K.value.absoluteWidth,height:K.value.height,style:{pointerEvents:`none`}},[k(e.$slots,`chart-background`,{},void 0,!0)],8,qe)):b(``,!0),S(`defs`,null,[C(g,{t:`radial`,id:`gradient_top${L.value}`,stops:[[`0%`,j(m)(H.value.backgroundColor,0),1],[`100%`,H.value.bar.color,1]]},null,8,[`id`,`stops`]),C(g,{t:`radial`,id:`gradient_tube_top${L.value}`,stops:[[`0%`,j(m)(j(f)(H.value.bar.color,.5),80),1],[`100%`,j(m)(j(h)(H.value.bar.color,.1),80),1]]},null,8,[`id`,`stops`]),C(g,{t:`radial`,id:`gradient_left${L.value}`,stops:[[`0%`,j(m)(H.value.backgroundColor,0),1],[`100%`,j(m)(H.value.bar.color,20),1]]},null,8,[`id`,`stops`]),C(g,{t:`radial`,id:`gradient_right${L.value}`,stops:[[`0%`,j(m)(H.value.backgroundColor,0),1],[`100%`,j(m)(H.value.bar.color,20),1]]},null,8,[`id`,`stops`]),C(g,{t:`linear`,id:`gradient_tube_body${L.value}`,x1:`0%`,y1:`0%`,x2:`100%`,y2:`0%`,stops:[[`0%`,H.value.bar.color,1],[`10%`,j(m)(j(h)(H.value.bar.color,.7),100),1],[`25%`,j(m)(j(h)(H.value.bar.color,.5),100),1],[`75%`,j(m)(H.value.bar.color,80),1],[`100%`,j(m)(j(f)(H.value.bar.color,.7),100),1]]},null,8,[`id`,`stops`])]),G.value?(E(),x(`defs`,Je,[(E(!0),x(_,null,O(J.value,e=>(E(),y(g,{t:`radial`,id:`grad_top_${e.id}`,key:`grad_top_${e.id}`,stops:[[`0%`,j(m)(j(f)(e.color,.5),80),1],[`100%`,e.color,1]]},null,8,[`id`,`stops`]))),128)),(E(!0),x(_,null,O(J.value,e=>(E(),y(g,{t:`linear`,id:`grad_left_${e.id}`,key:`grad_left_${e.id}`,stops:[[`0%`,j(m)(e.color,80),1],[`100%`,j(m)(j(h)(e.color,.5),100),1]]},null,8,[`id`,`stops`]))),128)),(E(!0),x(_,null,O(J.value,e=>(E(),y(g,{t:`linear`,id:`grad_right_${e.id}`,key:`grad_right_${e.id}`,stops:[[`2%`,j(m)(j(f)(e.color,.5),100),1],[`100%`,j(m)(e.color,80),1]]},null,8,[`id`,`stops`]))),128)),C(g,{t:`linear`,x1:`0%`,y1:`0%`,x2:`0%`,y2:`100%`,id:`vertical_line_${L.value}`,stops:[[`0%`,`#FFFFFF`,1],[`100%`,`#FFFFFF33`,1]]},null,8,[`id`])])):b(``,!0),H.value.dataLabel.show&&![null,void 0].includes(W.value.percentage)&&[null,void 0].includes(W.value.series)?(E(),x(`text`,{key:2,x:K.value.width/2,y:K.value.top-H.value.dataLabel.fontSize/2,"font-size":H.value.dataLabel.fontSize,"font-weight":H.value.dataLabel.bold?`bold`:`normal`,fill:H.value.dataLabel.color,"text-anchor":`middle`},A(j(u)({v:X.value,s:`%`,r:H.value.dataLabel.rounding})),9,Ye)):b(``,!0),z.value?(E(),x(`g`,{key:3,role:`button`,tabindex:`0`,"aria-label":`Clear selection`,onClick:s[0]||=e=>yr(),onKeydown:[s[1]||=ze(Be(e=>yr(),[`prevent`]),[`enter`]),s[2]||=ze(Be(e=>yr(),[`prevent`]),[`space`])],onFocus:s[3]||=e=>B.value=!0,onBlur:s[4]||=e=>B.value=!1,onMouseenter:s[5]||=e=>B.value=!0,onMouseleave:s[6]||=e=>B.value=!1,class:`svg-btn`,"data-dom-to-png-ignore":``,style:T({cursor:vn.value?`pointer`:`default`,outline:`none`})},[s[10]||=S(`title`,null,`Clear selection`,-1),S(`rect`,{x:Un.value-12,y:K.value.top-24,width:24,height:24,fill:`transparent`,"pointer-events":`all`},null,8,Xe),S(`circle`,{cx:Un.value,cy:K.value.top-12,r:`10`,fill:`none`,stroke:H.value.color,"stroke-width":`2`,"vector-effect":`non-scaling-stroke`,opacity:B.value?.5:0},null,8,Ze),S(`path`,{d:`M${Un.value-6},${K.value.top-18} ${Un.value+6},${K.value.top-6}`,stroke:H.value.color,"stroke-linecap":`round`,"stroke-width":`2`,"vector-effect":`non-scaling-stroke`},null,8,Qe),S(`path`,{d:`M${Un.value+6},${K.value.top-18} ${Un.value-6},${K.value.top-6}`,stroke:H.value.color,"stroke-linecap":`round`,"stroke-width":`2`,"vector-effect":`non-scaling-stroke`},null,8,$e)],36)):b(``,!0),!_n.value.shape||_n.value.shape===`bar`?(E(),x(`g`,et,[G.value?b(``,!0):(E(),x(`g`,tt,[S(`path`,{"stroke-dasharray":H.value.box.strokeDasharray,d:Y.value.right,stroke:H.value.box.stroke,"stroke-width":H.value.box.strokeWidth,"stroke-linejoin":`round`,"stroke-linecap":`round`,fill:`none`},null,8,nt),S(`path`,{"stroke-dasharray":H.value.box.strokeDasharray,d:Y.value.left,stroke:H.value.box.stroke,"stroke-width":H.value.box.strokeWidth,"stroke-linejoin":`round`,"stroke-linecap":`round`,fill:`none`},null,8,rt),S(`path`,{"stroke-dasharray":H.value.box.strokeDasharray,d:Y.value.side,stroke:H.value.box.stroke,"stroke-width":H.value.box.strokeWidth,"stroke-linejoin":`round`,"stroke-linecap":`round`,fill:`none`},null,8,it),S(`path`,{"stroke-dasharray":H.value.box.strokeDasharray,d:Y.value.topSides,stroke:H.value.box.stroke,"stroke-width":H.value.box.strokeWidth,"stroke-linejoin":`round`,"stroke-linecap":`round`,fill:`none`},null,8,at)])),G.value?b(``,!0):(E(),x(`g`,ot,[S(`path`,{d:Kn.value.right,stroke:H.value.bar.stroke,"stroke-width":H.value.bar.strokeWidth,"stroke-linejoin":`round`,"stroke-linecap":`round`,fill:`url(#gradient_right${L.value})`},null,8,st),S(`path`,{d:Kn.value.left,stroke:H.value.bar.stroke,"stroke-width":H.value.bar.strokeWidth,"stroke-linejoin":`round`,"stroke-linecap":`round`,fill:`url(#gradient_left${L.value})`},null,8,ct),S(`path`,{d:Kn.value.top,stroke:H.value.bar.stroke,"stroke-width":H.value.bar.strokeWidth,"stroke-linejoin":`round`,"stroke-linecap":`round`,fill:`url(#gradient_top${L.value})`},null,8,lt)])),G.value?(E(),x(`g`,ut,[(E(!0),x(_,null,O(J.value,(e,t)=>(E(),x(`g`,{style:T(`opacity:${Z.value?Z.value===e.id?1:.3:1}`),class:`vue-ui-3d-bar-stack`,role:`img`,"aria-label":br(e)},[S(`path`,{d:e.fill.right,fill:`url(#grad_right_${e.id})`,onMouseenter:t=>Q(e),onClick:t=>Q(e,!0),onMouseout:t=>$(e)},null,40,ft),S(`path`,{d:e.fill.left,fill:`url(#grad_left_${e.id})`,onMouseenter:t=>Q(e),onClick:t=>Q(e,!0),onMouseout:t=>$(e)},null,40,pt),S(`path`,{d:e.fill.top,fill:`url(#grad_top_${e.id})`,onMouseenter:t=>Q(e),onClick:t=>Q(e,!0),onMouseout:t=>$(e)},null,40,mt),S(`path`,{d:e.fill.liningTop,stroke:`#FFFFFF`,"stroke-width":`0.5`,"stroke-linecap":`round`,fill:`none`,onMouseenter:t=>Q(e),onClick:t=>Q(e,!0),onMouseout:t=>$(e)},null,40,ht),S(`path`,{d:`M ${e.fill.apexTop.x},${e.fill.apexTop.y} ${e.fill.apexBottom.x},${e.fill.apexBottom.y}`,stroke:`#FFFFFF`,"stroke-width":`0.5`,"stroke-linecap":`round`},null,8,gt)],12,dt))),256)),(E(!0),x(_,null,O(J.value,(e,t)=>(E(),x(`g`,null,[t===J.value.length-1?b(``,!0):(E(),x(`path`,{key:0,d:e.fill.liningTopShade,stroke:H.value.bar.shadeColor,"stroke-width":`0.5`,"stroke-linecap":`round`,fill:`none`,style:{"pointer-events":`none`}},null,8,_t))]))),256))])):b(``,!0)])):b(``,!0),_n.value.shape===`tube`?(E(),x(`g`,vt,[G.value?b(``,!0):(E(),x(`g`,yt,[S(`path`,{"stroke-dasharray":H.value.box.strokeDasharray,d:Y.value.tubeTop,stroke:H.value.box.stroke,"stroke-width":H.value.box.strokeWidth,"stroke-linejoin":`round`,"stroke-linecap":`round`,fill:`none`},null,8,bt),S(`path`,{"stroke-dasharray":H.value.box.strokeDasharray,d:Y.value.tubeLeft,stroke:H.value.box.stroke,"stroke-width":H.value.box.strokeWidth,"stroke-linejoin":`round`,"stroke-linecap":`round`,fill:`none`},null,8,xt),S(`path`,{"stroke-dasharray":H.value.box.strokeDasharray,d:Y.value.tubeRight,stroke:H.value.box.stroke,"stroke-width":H.value.box.strokeWidth,"stroke-linejoin":`round`,"stroke-linecap":`round`,fill:`none`},null,8,St),S(`path`,{"stroke-dasharray":H.value.box.strokeDasharray,d:Y.value.tubeBottom,stroke:H.value.box.stroke,"stroke-width":H.value.box.strokeWidth,"stroke-linejoin":`round`,"stroke-linecap":`round`,fill:`none`},null,8,Ct),S(`path`,{d:Kn.value.tubeTop,stroke:H.value.bar.stroke,"stroke-width":H.value.bar.strokeWidth,"stroke-linejoin":`round`,"stroke-linecap":`round`,fill:`url(#gradient_tube_top${L.value})`},null,8,wt),S(`path`,{d:Kn.value.tubeBody,stroke:H.value.bar.stroke,"stroke-width":H.value.bar.strokeWidth,"stroke-linejoin":`round`,"stroke-linecap":`round`,fill:`url(#gradient_tube_body${L.value})`},null,8,Tt),S(`path`,{d:Kn.value.tubeTop,stroke:`#FFFFFF`,"stroke-width":.5,"stroke-linejoin":`round`,"stroke-linecap":`round`,fill:`none`},null,8,Et)])),G.value?(E(),x(`g`,Dt,[(E(!0),x(_,null,O(J.value,(e,t)=>(E(),x(`g`,{style:T(`opacity:${Z.value?Z.value===e.id?1:.3:1}`),class:`vue-ui-3d-bar-stack`,role:`img`,"aria-label":br(e)},[S(`defs`,null,[C(g,{t:`radial`,id:`gradient_tube_top_${e.id}`,fx:`10%`,cy:`55%`,stops:[[`0%`,j(m)(j(f)(e.color,.5),80),1],[`100%`,j(m)(j(h)(e.color,.1),80),1]]},null,8,[`id`,`stops`]),C(g,{t:`linear`,id:`gradient_tube_body_${e.id}`,x1:`0%`,y1:`0%`,x2:`100%`,y2:`0%`,stops:[[`0%`,e.color,1],[`10%`,j(m)(j(h)(e.color,.7),100),1],[`25%`,j(m)(j(h)(e.color,.5),100),1],[`75%`,j(m)(e.color,80),1],[`100%`,j(m)(j(f)(e.color,.7),100),1]]},null,8,[`id`,`stops`])]),S(`path`,{onMouseenter:t=>Q(e),onClick:t=>Q(e,!0),onMouseout:t=>$(e),d:e.fill.tubeBody,stroke:`#FFFFFF`,"stroke-width":.5,"stroke-linejoin":`round`,"stroke-linecap":`round`,fill:`url(#gradient_tube_body_${e.id})`},null,40,kt),t>0?(E(),x(`path`,{key:0,onMouseenter:t=>Q(e),onClick:t=>Q(e,!0),onMouseout:t=>$(e),d:e.fill.bottomTubeTop,stroke:`#000000`,"stroke-width":.5,"stroke-linejoin":`round`,"stroke-linecap":`round`,fill:`none`},null,40,At)):b(``,!0),S(`path`,{onMouseenter:t=>Q(e),onClick:t=>Q(e,!0),onMouseout:t=>$(e),d:e.fill.tubeTop,stroke:`#FFFFFF`,"stroke-width":.5,"stroke-linejoin":`round`,"stroke-linecap":`round`,fill:`url(#gradient_tube_top_${e.id})`},null,40,jt)],12,Ot))),256))])):b(``,!0)])):b(``,!0),G.value?(E(),x(`g`,Mt,[(E(!0),x(_,null,O(J.value,(t,n)=>(E(),x(`g`,{style:T(`opacity:${Z.value?+(Z.value===t.id):+(t.proportion*100>H.value.legend.hideUnderPercentage)}`),onClick:e=>rn(`selectDatapoint`,t)},[S(`path`,{stroke:H.value.color,"stroke-dasharray":`1`,"stroke-width":`0.5`,"stroke-linecap":`round`,d:`M${t.fill.sidePointer.x},${t.fill.sidePointer.y} ${t.fill.sidePointer.x2},${t.fill.sidePointer.y}`},null,8,Pt),!t.fill.miniDonut||Z.value?(E(),x(`circle`,{key:0,cx:t.fill.sidePointer.x2,cy:t.fill.sidePointer.y,r:2,fill:t.color,stroke:H.value.backgroundColor},null,8,Ft)):b(``,!0),F.value?(E(),x(`rect`,{key:1,x:t.fill.sidePointer.xText,y:t.fill.sidePointer.y-H.value.legend.fontSize/2,width:K.value.width/3,height:H.value.legend.fontSize,fill:`#6A6A6A80`,rx:`3`},null,8,It)):b(``,!0),F.value?b(``,!0):(E(),x(`foreignObject`,{key:2,x:t.fill.sidePointer.xText,y:t.fill.sidePointer.y-H.value.legend.fontSize,width:K.value.absoluteWidth/3,height:H.value.legend.fontSize*2,style:{overflow:`visible`,position:`relative`}},[H.value.legend.showDefault?(E(),x(`div`,{key:0,style:T(`height: 100%; width: 100%; display: flex; flex-direction: row; flex-wrap: wrap; align-items:center;justify-content: flex-start; font-size:${H.value.legend.fontSize}px; text-align:left; line-height: ${H.value.legend.fontSize}px; color:${H.value.legend.color}; font-weight:${H.value.legend.bold?`bold`:`normal`}`)},A(j(se)(H.value.dataLabel.formatter,t.value,`${t.name}: ${j(u)({v:t.proportion*100,s:`%`,r:H.value.legend.roundingPercentage})} (${j(u)({p:H.value.legend.prefix,v:t.value,s:H.value.legend.suffix,r:H.value.legend.roundingValue})})`,{datapoint:t,seriesIndex:n,type:`barDatapoint`})),5)):b(``,!0),k(e.$slots,`legend`,Me({ref_for:!0},{datapoint:t,config:V.value,dataset:J.value}),void 0,!0)],8,Lt)),t.fill.donut&&Z.value===t.id?(E(),x(`g`,Rt,[(E(!0),x(_,null,O(t.fill.donut,(e,n)=>(E(),x(`g`,null,[Zn(e,t,!0)>6?(E(),x(`path`,{key:0,d:j(oe)(e,{x:e.cx,y:e.cy},0,8,!1,!0,10),stroke:e.color,class:`vue-ui-donut-arc-path`,"stroke-width":`0.5`,"stroke-linecap":`round`,"stroke-linejoin":`round`,fill:`none`},null,8,zt)):b(``,!0)]))),256)),(E(!0),x(_,null,O(t.fill.donut,(e,t)=>(E(),x(`path`,{class:`vue-ui-donut-arc-path`,d:e.arcSlice,fill:`${e.color}`,stroke:H.value.backgroundColor,"stroke-width":1},null,8,Bt))),256)),(E(!0),x(_,null,O(t.fill.donut,(e,n)=>(E(),x(`g`,null,[Zn(e,t,!0)>6?(E(),x(`g`,Vt,[S(`text`,{"text-anchor":j(ae)(e,!0,0).anchor,x:j(ae)(e,!0,2).x,y:j(ue)(e,12,12),fill:H.value.legend.color,"font-size":H.value.legend.fontSize/1.5,"font-weight":H.value.legend.bold?`bold`:`normal`},A(j(se)(H.value.dataLabel.formatter,e.value,`${Zn(e,t)} (${j(u)({p:V.value.style.chart.legend.prefix,v:e.value,s:V.value.style.chart.legend.suffix,r:V.value.style.chart.legend.roundingValue})})`,{datapoint:e,seriesIndex:n,type:`donutDatapoint`})),9,Ht),S(`text`,{"text-anchor":j(ae)(e).anchor,x:j(ae)(e,!0,2).x,y:j(ue)(e,12,12)+H.value.legend.fontSize/1.5,fill:H.value.legend.color,"font-size":H.value.legend.fontSize/1.5,"font-weight":H.value.legend.bold?`bold`:`normal`},A(e.name),9,Ut)])):b(``,!0)]))),256))])):b(``,!0),t.fill.miniDonut&&!Z.value?(E(),x(`g`,Wt,[(E(!0),x(_,null,O(t.fill.miniDonut,(e,t)=>(E(),x(`path`,{class:`vue-ui-donut-arc-path`,d:e.arcSlice,fill:`${e.color}`,stroke:H.value.backgroundColor,"stroke-width":.5},null,8,Gt))),256))])):b(``,!0)],12,Nt))),256))])):b(``,!0),k(e.$slots,`svg`,{svg:{...K.value,isPrintingImg:j(Tn)||j(En)||j(mr),isPrintingSvg:j(hr)}},void 0,!0)],46,Ke))]),e.$slots.watermark?(E(),x(`div`,Kt,[k(e.$slots,`watermark`,Fe(je({isPrinting:j(Tn)||j(En)||j(hr)||j(mr)})),void 0,!0)])):b(``,!0),e.$slots.source?(E(),x(`div`,{key:5,ref_key:`source`,ref:pn,dir:`auto`},[k(e.$slots,`source`,{},void 0,!0)],512)):b(``,!0),an.value&&G.value&&U.value.buttons.table?(E(),y(Re(ur.value.component),Me({key:6},ur.value.props,{ref_key:`tableUnit`,ref:mn,onClose:dr}),ke({content:N(()=>[(E(),y(j(Zt),{key:`table_${dn.value}`,colNames:ar.value.colNames,head:ar.value.head,body:ar.value.body,config:ar.value.config,title:V.value.table.useDialog?``:ur.value.title,withCloseButton:!V.value.table.useDialog,isCursorPointer:vn.value,onClose:dr},{th:N(({th:e})=>[e===`__SUM__`?(E(),x(`div`,qt,[C(j(Yt),{name:`sigma`,stroke:ar.value.config.th.color,size:16},null,8,[`stroke`])])):(E(),x(`div`,Jt,A(e),1))]),td:N(({td:e})=>[Ae(A(e.name||e),1)]),_:1},8,[`colNames`,`head`,`body`,`config`,`title`,`withCloseButton`,`isCursorPointer`]))]),_:2},[V.value.table.useDialog?{name:`title`,fn:N(()=>[Ae(A(ur.value.title),1)]),key:`0`}:void 0,V.value.table.useDialog?{name:`actions`,fn:N(()=>[S(`button`,{tabindex:`0`,class:`vue-ui-user-options-button`,onClick:s[7]||=e=>rr(U.value.callbacks.csv)},[C(j(Yt),{name:`fileCsv`,stroke:ur.value.props.color},null,8,[`stroke`])])]),key:`1`}:void 0]),1040)):b(``,!0),k(e.$slots,`skeleton`,{},()=>[F.value?(E(),y(Ee,{key:0})):b(``,!0)],!0)],44,He))}},[[`__scopeId`,`data-v-25c6416c`]]);export{Ve as n,Yt as t};
@@ -1 +1 @@
1
- import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{t}from"./BaseIcon-CoY0vuL3.js";import{t as n}from"./useNestedProp-DnGoh-XS.js";import{X as r}from"./lib-rPeBMZrn.js";import{t as i}from"./useConfig-_JwRfIqE.js";import{t as a}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{computed as o,createBlock as s,createCommentVNode as c,createElementBlock as l,createElementVNode as u,guardReactiveProps as d,normalizeClass as f,normalizeProps as p,normalizeStyle as m,onMounted as h,openBlock as g,ref as _,renderSlot as v,useCssVars as y,watch as b}from"vue";var x=/* @__PURE__ */ e({default:()=>T}),S={class:`vue-data-ui-component`},C=[`id`],w={key:0,class:`vue-ui-accordion-arrow`},T=/*#__PURE__*/ a({__name:`vue-ui-accordion`,props:{config:{type:Object,default(){return{}}},hideDetails:{type:Boolean,default:!1}},emits:[`toggle`],setup(e,{emit:a}){y(e=>({fc620ee6:P.value}));let{vue_ui_accordion:x}=i(),T=e,E=a,D=o(()=>n({userConfig:T.config,defaultConfig:x})),O=o(()=>D.value.useCursorPointer),k=_(D.value.open),A=_(r()),j=_(null),M=_(0);h(()=>{j.value.open=D.value.open}),b(()=>D.value.open,e=>{j.value.open=e});function N(){(M.value>0||!D.value.open)&&(k.value=!k.value),M.value+=1,E(`toggle`)}let P=o(()=>`${D.value.maxHeight}px`);return(n,r)=>(g(),l(`div`,S,[u(`details`,{id:`details_${A.value}`,ref_key:`details`,ref:j,onToggle:N},[u(`summary`,{class:f({"vue-ui-accordion-headless":e.hideDetails}),style:m({cursor:O.value?`pointer`:`default`})},[u(`div`,{class:`vue-ui-accordion-head`,style:m(`background:${D.value.head.backgroundColor};padding:${D.value.head.padding}; ${e.hideDetails?`height: 0px !important; padding: 0 !important;`:``}`)},[e.hideDetails?c(``,!0):(g(),l(`div`,w,[D.value.head.useArrowSlot?v(n.$slots,`arrow`,p(d({backgroundColor:D.value.head.backgroundColor,color:D.value.head.color,iconColor:D.value.head.iconColor,isOpen:k.value})),void 0,!0,0):(g(),s(t,{key:1,name:D.value.head.icon,stroke:D.value.head.iconColor,size:D.value.head.iconSize},null,8,[`name`,`stroke`,`size`]))])),v(n.$slots,`title`,p(d({color:D.value.head.color,isOpen:k.value})),void 0,!0)],4)],6)],40,C),u(`div`,{class:`vue-ui-accordion-content`,style:m(`background:${D.value.body.backgroundColor};color:${D.value.body.color}`)},[v(n.$slots,`content`,p(d({backgroundColor:D.value.body.backgroundColor,color:D.value.body.color,isOpen:k.value})),void 0,!0)],4)]))}},[[`__scopeId`,`data-v-2782a9e6`]]);export{x as n,T as t};
1
+ import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{t}from"./BaseIcon-CoY0vuL3.js";import{t as n}from"./useNestedProp-DnGoh-XS.js";import{X as r}from"./lib-rPeBMZrn.js";import{t as i}from"./useConfig-9oDGTWWG.js";import{t as a}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{computed as o,createBlock as s,createCommentVNode as c,createElementBlock as l,createElementVNode as u,guardReactiveProps as d,normalizeClass as f,normalizeProps as p,normalizeStyle as m,onMounted as h,openBlock as g,ref as _,renderSlot as v,useCssVars as y,watch as b}from"vue";var x=/* @__PURE__ */ e({default:()=>T}),S={class:`vue-data-ui-component`},C=[`id`],w={key:0,class:`vue-ui-accordion-arrow`},T=/*#__PURE__*/ a({__name:`vue-ui-accordion`,props:{config:{type:Object,default(){return{}}},hideDetails:{type:Boolean,default:!1}},emits:[`toggle`],setup(e,{emit:a}){y(e=>({fc620ee6:P.value}));let{vue_ui_accordion:x}=i(),T=e,E=a,D=o(()=>n({userConfig:T.config,defaultConfig:x})),O=o(()=>D.value.useCursorPointer),k=_(D.value.open),A=_(r()),j=_(null),M=_(0);h(()=>{j.value.open=D.value.open}),b(()=>D.value.open,e=>{j.value.open=e});function N(){(M.value>0||!D.value.open)&&(k.value=!k.value),M.value+=1,E(`toggle`)}let P=o(()=>`${D.value.maxHeight}px`);return(n,r)=>(g(),l(`div`,S,[u(`details`,{id:`details_${A.value}`,ref_key:`details`,ref:j,onToggle:N},[u(`summary`,{class:f({"vue-ui-accordion-headless":e.hideDetails}),style:m({cursor:O.value?`pointer`:`default`})},[u(`div`,{class:`vue-ui-accordion-head`,style:m(`background:${D.value.head.backgroundColor};padding:${D.value.head.padding}; ${e.hideDetails?`height: 0px !important; padding: 0 !important;`:``}`)},[e.hideDetails?c(``,!0):(g(),l(`div`,w,[D.value.head.useArrowSlot?v(n.$slots,`arrow`,p(d({backgroundColor:D.value.head.backgroundColor,color:D.value.head.color,iconColor:D.value.head.iconColor,isOpen:k.value})),void 0,!0,0):(g(),s(t,{key:1,name:D.value.head.icon,stroke:D.value.head.iconColor,size:D.value.head.iconSize},null,8,[`name`,`stroke`,`size`]))])),v(n.$slots,`title`,p(d({color:D.value.head.color,isOpen:k.value})),void 0,!0)],4)],6)],40,C),u(`div`,{class:`vue-ui-accordion-content`,style:m(`background:${D.value.body.backgroundColor};color:${D.value.body.color}`)},[v(n.$slots,`content`,p(d({backgroundColor:D.value.body.backgroundColor,color:D.value.body.color,isOpen:k.value})),void 0,!0)],4)]))}},[[`__scopeId`,`data-v-2782a9e6`]]);export{x as n,T as t};
@@ -0,0 +1 @@
1
+ import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{n as t,r as n,t as r}from"./userOptionsSlots-CWtXN5Q6.js";import{n as i,r as a,t as o}from"./annotationSlots-OLiW25XN.js";import{n as s,t as ee}from"./tableIntegration-CNoJ1CIY.js";import{t as te}from"./resolveChartConfig-0IvbmIE_.js";import{$ as c,D as ne,Jt as re,X as ie,Yt as ae,at as oe,b as l,i as u,in as se,nt as ce,t as le,tn as ue,zt as de}from"./lib-rPeBMZrn.js";import{n as fe,t as pe}from"./useHints-C-TwxM0Y.js";import{t as me}from"./useConfig-9oDGTWWG.js";import{t as he}from"./useSvgLabelLayout-42Kats14.js";import{t as ge}from"./usePrinter-DVf3YcG5.js";import{t as _e}from"./useResponsive-CENUxfEL.js";import{t as ve}from"./useChartExport-BZts4KFb.js";import{t as ye}from"./useUserOptionState-CXlFnwPv.js";import{t as be}from"./useChartAccessibility-DOMuYJfm.js";import{t as xe}from"./useTimeLabelCollider-BTybMUFi.js";import{t as Se}from"./img-D4RQwASc.js";import{n as Ce}from"./Title-BliHuXfT.js";import{t as we}from"./vue_ui_age_pyramid-DXJeenVU.js";import{t as Te}from"./BaseScanner-m6QR9rwD.js";import{t as Ee}from"./A11yDataTable-DWNlWXzs.js";import{t as De}from"./DefGrad-DKMq1REY.js";import{t as Oe}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{Fragment as d,computed as f,createBlock as ke,createCommentVNode as p,createElementBlock as m,createElementVNode as h,createSlots as Ae,createTextVNode as je,createVNode as g,defineAsyncComponent as _,guardReactiveProps as v,mergeProps as y,nextTick as Me,normalizeClass as Ne,normalizeProps as b,normalizeStyle as Pe,onBeforeUnmount as Fe,onMounted as Ie,openBlock as x,ref as S,renderList as C,renderSlot as w,resolveDynamicComponent as Le,toDisplayString as T,unref as E,watch as D,withCtx as O}from"vue";var Re=/* @__PURE__ */ e({default:()=>at}),ze=[`id`],Be=[`id`],Ve={style:{position:`relative`}},He=[`xmlns`,`viewBox`,`aria-describedby`],Ue=[`x`,`y`,`width`,`height`],We=[`fill`],Ge=[`fill`],Ke={key:0},qe={key:1},Je=[`x`,`y`,`font-size`,`fill`,`font-weight`],Ye={key:2},Xe={key:0},Ze=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`],Qe=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`],$e=[`font-size`,`fill`,`text-anchor`,`font-weight`,`transform`],et=[`x`,`y`,`font-size`,`fill`,`font-weight`],tt={key:1},nt=[`x`,`y`,`width`,`height`,`fill`,`onMouseover`,`onMouseleave`,`onClick`],rt={key:0,style:{position:`absolute`,top:`100%`,left:`0`,width:`100%`},"data-dom-to-png-ignore":``,"aria-hidden":`true`},it={key:5,class:`vue-data-ui-watermark`},at=/*#__PURE__*/ Oe({__name:`vue-ui-age-pyramid`,props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:[`copyAlt`],setup(e,{expose:Oe,emit:Re}){let at=_(()=>import(`./Tooltip-B432XpvC.js`)),ot=_(()=>import(`./BaseIcon-CoY0vuL3.js`).then(e=>e.n)),st=_(()=>import(`./vue-ui-accordion-CnAwFOgA.js`).then(e=>e.n)),ct=_(()=>import(`./DataTable-KeuZB1JM.js`)),lt=_(()=>import(`./PenAndPaper-BV5ODysA.js`).then(e=>e.t)),ut=_(()=>import(`./UserOptions-K1N7zQRx.js`).then(e=>e.n)),dt=_(()=>import(`./PackageVersion-B9qiUJPH.js`).then(e=>e.t)),ft=_(()=>import(`./BaseDraggableDialog-DVstuNhT.js`).then(e=>e.n)),{vue_ui_age_pyramid:pt}=me(),k=e,mt=Re,ht=f(()=>Array.isArray(k.dataset)&&k.dataset.length>0&&k.dataset.every(e=>Array.isArray(e)&&e.length>=4)),A=f(jt),j=f(()=>!!A.value.loading||!ht.value),M=S(ie()),N=S(!1),P=S(null),gt=S(0),F=S(null),_t=S(null),vt=S(null),yt=S(null),bt=S(null),xt=S(null),St=S(null),I=S(null),Ct=S({x:0,y:0}),L=S(`pointer`),wt=S(!1),Tt=f(()=>se({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:A.value.skeletonConfig??{}})),R=f(()=>j.value?se({defaultConfig:A.value,userConfig:Tt.value}):A.value),z=f(()=>R.value.style),B=f(()=>R.value.style.layout.dataLabels),V=f(()=>R.value.style.layout.bars),H=f(()=>R.value.style.layout.bars.labels);fe({config:()=>R.value,dataset:()=>k.dataset,component:`VueUiAgePyramid`,rules:[pe.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 U=f(()=>R.value.userOptions.useCursorPointer),Et=[[`_`,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]],Dt=f(()=>j.value?k.config?.skeletonDataset??Et:k.dataset),{userOptionsVisible:Ot,setUserOptionsVisibility:kt,keepUserOptionState:At}=ye({config:R.value}),{svgRef:W}=be({config:R.value.style.title});function jt(){return te(k.config,pt,we)}let Mt=S(!1),Nt=null,G=null,Pt=!1,Ft=f(()=>A.value.debug);D([()=>k.dataset,Ft],([e,t])=>{t&&(de(e)?oe({componentName:`VueUiAgePyramid`,type:`dataset`}):ht.value||console.warn(`VueUiAgePyramid: each dataset row must be an array containing segment, age, left, and right values.`))},{deep:!0,immediate:!0});function It(){if(G=null,Pt||!R.value.responsive||!F.value?.parentNode)return;let{width:e,height:t}=_e({chart:F.value,title:z.value.title.text?_t.value:null,source:vt.value,noTitle:yt.value});q.value={width:e,height:t},Mt.value=!0}function Lt(){!Pt&&R.value.responsive&&G===null&&(G=requestAnimationFrame(It))}function Rt(){Nt?.disconnect(),Nt=null,G!==null&&cancelAnimationFrame(G),G=null,Pt||(Mt.value=!1,R.value.responsive&&F.value?.parentNode?(Nt=new ResizeObserver(Lt),Nt.observe(F.value.parentNode),Lt()):q.value={width:z.value.width,height:z.value.height})}Ie(Rt),D(()=>R.value.responsive,Rt,{flush:`post`}),D([()=>z.value.width,()=>z.value.height],()=>{R.value.responsive?Lt():q.value={width:z.value.width,height:z.value.height}}),D([()=>z.value.title,()=>R.value.userOptions.show,()=>R.value.style.fontFamily],Lt,{deep:!0,flush:`post`}),D(()=>k.config,()=>{Ot.value=!R.value.userOptions.showOnChartHover},{deep:!0}),Fe(()=>{Pt=!0,G!==null&&cancelAnimationFrame(G),Nt?.disconnect()});let{isPrinting:zt,isImaging:Bt,generatePdf:Vt,generateImage:Ht}=ge({elementId:`vue-ui-age-pyramid_${M.value}`,fileName:z.value.title.text||`vue-ui-age-pyramid`,options:R.value.userOptions.print}),Ut=f(()=>R.value.userOptions.show&&!z.value.title.text),K=S({showTable:R.value.table.show,showTooltip:z.value.tooltip.show});D([()=>R.value.table.show,j],([e])=>{K.value.showTable=e}),D([()=>z.value.tooltip.show,j],([e])=>{K.value.showTooltip=e});let q=S({height:z.value.height,width:z.value.width}),Wt=f(()=>q.value.width),Gt=f(()=>q.value.height),{metrics:Kt,ready:qt,update:Jt}=he({svgRef:W,canMeasure:()=>!R.value.responsive||Mt.value,initialMetrics:{bottom:0},measure:e=>({bottom:e(bt.value).height})}),Yt=f(()=>Kt.value.bottom),J=f(()=>{let e=q.value.width-z.value.layout.padding.right-z.value.layout.padding.left,t=z.value.layout.padding.left,n=q.value.width-z.value.layout.padding.right;return{top:z.value.layout.padding.top+B.value.sideTitles.fontSize+B.value.sideTitles.offsetY+12,left:t,right:n,bottom:q.value.height-z.value.layout.padding.bottom-Yt.value,width:e,height:q.value.height-z.value.layout.padding.top-z.value.layout.padding.bottom-Yt.value-B.value.sideTitles.fontSize-B.value.sideTitles.offsetY-12,centerX:z.value.layout.padding.left+e/2,leftChart:{width:e/2-z.value.layout.centerSlit.width,right:t+e/2-z.value.layout.centerSlit.width},rightChart:{width:e/2-z.value.layout.centerSlit.width,left:t+e/2+z.value.layout.centerSlit.width}}}),Xt=f(()=>Dt.value.map(e=>B.value.yAxis.display===`age`?e[1]:e[0])),Zt=f(()=>{let e=Qt($t.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:J.value.left+J.value.width/2+z.value.layout.centerSlit.width+i/$t.value*J.value.leftChart.width}),n.push({value:Math.abs(a),x:J.value.left+J.value.width/2+a/$t.value*J.value.leftChart.width-z.value.layout.centerSlit.width})}return{right:t,left:n}});function Qt(e){if(e===0)return 0;let t=10**Math.floor(Math.log10(Math.abs(e)));return Math.round(e/t)*t}function Y(e){return Number.isFinite(e)?e:0}let $t=f(()=>Math.max(0,...Dt.value.flatMap(e=>[Y(e[2]),Y(e[3])]))||1),X=f(()=>Dt.value.length),en=f(()=>Dt.value.map(e=>({segment:e[0],age:e[1],left:{value:e[2],proportionToMax:Math.max(0,Y(e[2]))/$t.value},right:{value:e[3],proportionToMax:Math.max(0,Y(e[3]))/$t.value}}))),Z=f(()=>en.value.map((e,t)=>{let n=J.value.top+J.value.height/X.value*t,r=J.value.height/X.value-V.value.gap;return{segment:e.segment,age:e.age,left:{...e.left,y:n,color:V.value.left.color,x:J.value.leftChart.right-e.left.proportionToMax*J.value.leftChart.width,width:l(e.left.proportionToMax*J.value.leftChart.width),height:r},right:{...e.right,y:n,color:V.value.right.color,x:J.value.rightChart.left,width:l(e.right.proportionToMax*J.value.rightChart.width),height:r}}})),tn=[`left`,`right`],nn=[`right`,`left`];function rn(e){return{x:e.x,y:e.y,width:e.width<=0?1e-4:e.width,height:e.height<=0?1e-4:e.height,rx:V.value.borderRadius}}function an(e,t){let n=e[t];return{x:t===`left`?n.x+Math.max(1e-4,n.width)-H.value.offsetX-6:n.x+H.value.offsetX+6,y:n.y+Math.max(1e-4,n.height/2)+V.value.gap/2,"text-anchor":t===`left`?`end`:`start`,"dominant-baseline":`middle`,"font-size":H.value.fontSize,"font-weight":H.value.bold?`bold`:`normal`,fill:H.value.color,stroke:z.value.backgroundColor,"paint-order":`stroke fill`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":3}}function on(e){let t=V.value[e].color,n=re(ae(t,V.value.gradient.shiftHue),100-V.value.gradient.intensity);return e===`left`?[[`0%`,t,1],[`100%`,n,1]]:[[`0%`,n,1],[`100%`,t,1]]}function sn(e){let t=B.value.sideTitles;return{x:J.value[e],y:t.fontSize,fill:t.useSideColor?V.value[e].color:t.color,"font-size":t.fontSize,"text-anchor":e===`left`?`start`:`end`,"font-weight":t.bold?`bold`:`normal`}}let cn=f(()=>{let e=P.value,t=k.dataset?.[e];return e!=null&&t&&!j.value?{datapoint:t,seriesIndex:e,series:Z.value,config:R.value}:null});function ln(e){let[t,n,r,i]=e;return{segment:t,index:n,left:r,right:i}}function un(e,t){R.value.events.datapointClick&&R.value.events.datapointClick({datapoint:ln(t),seriesIndex:e})}function dn(e,t){R.value.events.datapointLeave&&R.value.events.datapointLeave({datapoint:ln(t),seriesIndex:e}),(L.value!==`keyboard`||I.value!==e)&&(P.value=null,N.value=!1)}function fn(e){if(!W.value)return;let t=Z.value[e];if(!t)return;let n=ue(J.value.left+J.value.width/2,t.left.y+t.left.height/2,W.value);n&&(Ct.value=n)}function pn(e,t,n=`pointer`){!j.value&&Z.value[e]&&t&&(R.value.events.datapointEnter?.({datapoint:ln(t),seriesIndex:e}),P.value=e,I.value=e,L.value=n,N.value=!0,n===`keyboard`&&Me(()=>{!Pt&&P.value===e&&fn(e)}))}let mn=f(()=>{let e=cn.value;if(!e)return``;let{datapoint:t,seriesIndex:n}=e,r=z.value.tooltip.customFormat;if(typeof r==`function`){let n=r({...e,datapoint:ln(t)});if(typeof n==`string`)return n}let i=``,a=Z.value[n];return i+=`<div><b>${a.segment}</b></div>`,i+=`<div>${R.value.translations.age}: ${u(B.value.yAxis.formatter,l(a.age),c({v:l(a.age)}),{datapoint:t,seriesIndex:n})}</div>`,i+=`<div style="margin-top:6px;padding-top:6px;border-top:1px solid ${z.value.tooltip.borderColor}">`,i+=`<div style="display:flex; flex-direction:row;gap:12px">`,i+=`<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="${V.value.gradient.underlayer}"/><rect stroke="none" x="0" y="0" height="12" width="12" rx="2" fill="${V.value.gradient.show?`url(#age_pyramid_left_${M.value})`:V.value.left.color}"/></svg><div>${R.value.translations.female}</div><div><b>${u(B.value.xAxis.formatter,l(a.left.value),c({v:l(a.left.value)}),{datapoint:t,seriesIndex:n})}</b></div></div>`,i+=`<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="${V.value.gradient.underlayer}"/><rect stroke="none" x="0" y="0" height="12" width="12" rx="2" fill="${V.value.gradient.show?`url(#age_pyramid_right_${M.value})`:V.value.right.color}"/></svg><div>${R.value.translations.male}</div><div><b>${u(B.value.xAxis.formatter,l(a.right.value),c({v:l(a.right.value)}),{datapoint:t,seriesIndex:n})}</b></div></div>`,i+=`</div>`,i+=`<div style="margin-top:6px;padding-top:6px;border-top:1px solid ${z.value.tooltip.borderColor}"><div>${R.value.translations.total}</div><div><b>${u(B.value.xAxis.formatter,l(a.right.value)+l(a.left.value),c({v:l(a.right.value)+l(a.left.value)}),{datapoint:t,seriesIndex:n})}</b></div></div>`,i+=`</div>`,`<div>${i}</div>`});D([Z,j],()=>{(j.value||!Z.value[P.value])&&(P.value=null,N.value=!1),(j.value||!Z.value[I.value])&&(I.value=null),L.value===`keyboard`&&P.value!=null&&fn(P.value)},{deep:!0,flush:`post`});let hn=f(()=>[`year`,`age`,`female`,`male`,`total`].map(e=>R.value.translations[e])),gn=f(()=>(Array.isArray(k.dataset)?k.dataset:[]).filter(e=>Array.isArray(e)&&e.length>=4).map(e=>[e[0],e[1],e[2],e[3],Y(e[2])+Y(e[3])]));function _n(e=null){Me(()=>{let t=[[z.value.title.text],[z.value.title.subtitle.text],[[``],[``],[``]],hn.value].concat(gn.value),n=ne(t);e?e(n):ce({csvContent:n,title:z.value.title.text||`vue-ui-age-pyramid`})})}let Q=f(()=>{let e=hn.value;return{head:e,body:gn.value.map(e=>[e[0],e[1],...e.slice(2).map(e=>e==null?``:e.toLocaleString())]),config:{th:{backgroundColor:R.value.table.th.backgroundColor,color:R.value.table.th.color,outline:R.value.table.th.outline},td:{backgroundColor:R.value.table.td.backgroundColor,color:R.value.table.td.color,outline:R.value.table.td.outline},breakpoint:R.value.table.responsiveBreakpoint},colNames:e}}),$=S(!1);function vn(e){$.value=e,gt.value+=1}function yn(){K.value.showTable=!K.value.showTable}function bn(){K.value.showTooltip=!K.value.showTooltip}let xn=S(!1);function Sn(){xn.value=!xn.value}async function Cn({scale:e=2}={}){if(!F.value)return;let{width:t,height:n}=F.value.getBoundingClientRect(),r=t/n,{imageUri:i,base64:a}=await Se({domElement:F.value,base64:!0,img:!0,scale:e});return{imageUri:i,base64:a,title:z.value.title.text,width:t,height:n,aspectRatio:r}}let wn=S([]),Tn=f(()=>({start:0,end:Z.value.length}));xe({timeLabelsEls:bt,timeLabels:wn,slicer:Tn,configRef:R,rotationPath:[`style`,`layout`,`dataLabels`,`xAxis`,`rotation`],autoRotatePath:[`style`,`layout`,`dataLabels`,`xAxis`,`autoRotate`,`enable`],isAutoSize:!1,width:Wt,height:Gt,targetClass:`.vue-ui-age-pyramid-x-axis-label`,rotation:z.value.layout.dataLabels.xAxis.autoRotate.angle});let En=f(()=>ee({config:R,style:z,mutableConfig:K,dialog:ft,accordion:st,isFullscreen:$,parent:F,maxWidth:800,isCursorPointer:U}));D(()=>K.value.showTable,e=>{xt.value&&s(e,R,xt)});function Dn(){K.value.showTable=!1,St.value&&St.value.setTableIconState(!1)}let On=f(()=>R.value.style.backgroundColor),kn=f(()=>R.value.style.title),{isCallbackImaging:An,isCallbackSvg:jn,generateSvg:Mn,onGenerateImage:Nn}=ve({svg:W,title:kn,legend:null,legendItems:null,backgroundColor:On,getSvgCallback:()=>R.value.userOptions.callbacks.svg,generateImage:Ht});async function Pn(){mt(`copyAlt`,{config:R.value,dataset:Z.value}),R.value.userOptions.callbacks.altCopy?await Promise.resolve(R.value.userOptions.callbacks.altCopy({config:R.value,dataset:Z.value})):console.warn("Vue Data UI - A callback must be set for `altCopy` in userOptions.")}function Fn(){wt.value=!0}function In(){P.value=null,I.value=null,L.value=`pointer`,N.value=!1,wt.value=!1}function Ln(e){if(!W.value||xn.value||j.value||document.activeElement!==W.value||!Z.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){P.value=null,I.value=null,L.value=`pointer`,N.value=!1;return}if(r){if(I.value===null)return;let e=k.dataset[I.value];if(!e)return;un(I.value,e);return}let a=I.value,o=P.value,s=a!==null&&a>=0&&a<Z.value.length,ee=o!==null&&o>=0&&o<Z.value.length;s?t?a=a-1<0?Z.value.length-1:a-1:n&&(a=a+1>Z.value.length-1?0:a+1):ee?(a=n?o+1:o-1,a>=Z.value.length&&(a=0),a<0&&(a=Z.value.length-1)):a=n?0:Z.value.length-1;let te=k.dataset[a];te&&pn(a,te,`keyboard`)}return Oe({getImage:Cn,generatePdf:Vt,generateCsv:_n,generateImage:Ht,generateSvg:Mn,toggleTable:yn,toggleTooltip:bn,toggleAnnotator:Sn,toggleFullscreen:vn,copyAlt:Pn}),D(()=>[q.value,B.value,bt.value,k.dataset,Mt.value,R.value.style.fontFamily],Jt,{flush:`post`,deep:!0}),(s,ee)=>(x(),m(`div`,{class:Ne(`vue-data-ui-component vue-ui-age-pyramid ${$.value?`vue-data-ui-wrapper-fullscreen`:``}`),ref_key:`agePyramid`,ref:F,id:`vue-ui-age-pyramid_${M.value}`,style:Pe(`font-family:${z.value.fontFamily};width:100%; text-align:center;background:${z.value.backgroundColor};${R.value.responsive?`height:100%`:``}`),onMouseenter:ee[1]||=()=>E(kt)(!0),onMouseleave:ee[2]||=()=>E(kt)(!1)},[h(`div`,{id:`chart-instructions-${M.value}`,class:`sr-only`},[h(`p`,null,T(R.value.a11y.translations.keyboardNavigation),1)],8,Be),R.value.a11y.includeTable&&Q.value?.body?.length?(x(),ke(Ee,{key:0,uid:M.value,head:Q.value.head,body:Q.value.body,notice:R.value.a11y.translations.tableAvailable,caption:R.value.a11y.translations.tableCaption},null,8,[`uid`,`head`,`body`,`notice`,`caption`])):p(``,!0),R.value.userOptions.buttons.annotator?(x(),ke(E(lt),y({key:1},E(a)(R.value.userOptions.annotator),{svgRef:E(W),backgroundColor:z.value.backgroundColor,color:z.value.color,active:xn.value,isCursorPointer:U.value,palette:R.value.userOptions.annotatorPalette,onClose:Sn}),Ae({_:2},[C(E(o),e=>({name:e,fn:O(t=>[w(s.$slots,e,b(v(E(i)(e,t))),void 0,!0)])}))]),1040,[`svgRef`,`backgroundColor`,`color`,`active`,`isCursorPointer`,`palette`])):p(``,!0),Ut.value?(x(),m(`div`,{key:2,ref_key:`noTitle`,ref:yt,class:`vue-data-ui-no-title-space`,style:`height:36px; width: 100%;background:transparent`},null,512)):p(``,!0),z.value.title.text?(x(),m(`div`,{key:3,ref_key:`chartTitle`,ref:_t,style:`width:100%;background:transparent`},[g(Ce,{config:{title:{cy:`pyramid-div-title`,...z.value.title},subtitle:{cy:`pyramid-div-subtitle`,...z.value.title.subtitle}}},null,8,[`config`])],512)):p(``,!0),R.value.userOptions.show&&ht.value&&(E(At)||E(Ot))?(x(),ke(E(ut),y({ref_key:`userOptionsRef`,ref:St,key:`user_options_${gt.value}`,backgroundColor:z.value.backgroundColor,color:z.value.color,isImaging:E(Bt),isPrinting:E(zt),uid:M.value,hasTooltip:R.value.userOptions.buttons.tooltip&&z.value.tooltip.show,isFullscreen:$.value,isTooltip:K.value.showTooltip,chartElement:F.value},E(n)(R.value.userOptions,`pdf csv img svg table fullscreen altCopy annotator`),{isAnnotation:xn.value,tableDialog:R.value.table.useDialog,isCursorPointer:U.value,onToggleFullscreen:vn,onGeneratePdf:E(Vt),onGenerateCsv:_n,onGenerateImage:E(Nn),onGenerateSvg:E(Mn),onToggleTable:yn,onToggleTooltip:bn,onToggleAnnotator:Sn,onCopyAlt:Pn,style:{visibility:E(At)?E(Ot)?`visible`:`hidden`:`visible`}}),Ae({_:2},[C(E(t)(s.$slots,`menuIcon optionTooltip optionPdf optionCsv optionImg optionSvg optionTable optionFullscreen optionAnnotator optionAltCopy custom-menu-before custom-menu-after`),e=>({name:e,fn:O(t=>[w(s.$slots,e,b(v(E(r)(e,t))),void 0,!0)])}))]),1040,[`backgroundColor`,`color`,`isImaging`,`isPrinting`,`uid`,`hasTooltip`,`isFullscreen`,`isTooltip`,`chartElement`,`isAnnotation`,`tableDialog`,`isCursorPointer`,`onGeneratePdf`,`onGenerateImage`,`onGenerateSvg`,`style`])):p(``,!0),h(`div`,Ve,[(x(),m(`svg`,{ref_key:`svgRef`,ref:W,xmlns:E(le),class:Ne({"vue-data-ui-fullscreen--on":$.value,"vue-data-ui-fulscreen--off":!$.value}),viewBox:`0 0 ${q.value.width<=0?10:q.value.width} ${q.value.height<=0?10:q.value.height}`,style:Pe(`max-width:100%;overflow:visible;background:transparent;color:${z.value.color};visibility:${E(qt)?`visible`:`hidden`}`),tabindex:`0`,"aria-describedby":`chart-instructions-${M.value}`,onFocus:Fn,onBlur:In,onKeydown:Ln},[g(E(dt)),w(s.$slots,`svg-underlayer`,{svg:{...q.value,drawingArea:J.value,isPrintingImg:E(zt)||E(Bt)||E(An),isPrintingSvg:E(jn)}},void 0,!0),s.$slots[`chart-background`]?(x(),m(`foreignObject`,{key:0,x:J.value.left,y:J.value.top,width:Math.max(.1,J.value.width),height:Math.max(.1,J.value.height),style:{pointerEvents:`none`}},[w(s.$slots,`chart-background`,{},void 0,!0)],8,Ue)):p(``,!0),h(`defs`,null,[(x(),m(d,null,C(tn,e=>g(De,{key:e,t:`linear`,id:`age_pyramid_${e}_${M.value}`,x1:`0%`,y1:`0%`,x2:`100%`,y2:`0%`,stops:on(e)},null,8,[`id`,`stops`])),64))]),(x(!0),m(d,null,C(Z.value,(e,t)=>(x(),m(`g`,{key:t},[(x(),m(d,null,C(tn,t=>(x(),m(d,{key:t},[h(`rect`,y({ref_for:!0},rn(e[t]),{fill:V.value.gradient.underlayer}),null,16,We),h(`rect`,y({ref_for:!0},rn(e[t]),{fill:V.value.gradient.show?`url(#age_pyramid_${t}_${M.value})`:e[t].color}),null,16,Ge)],64))),64))]))),128)),(x(!0),m(d,null,C(Z.value,(e,t)=>(x(),m(`g`,{key:t},[H.value.show&&(!H.value.showOnHover||P.value===t)?(x(),m(d,{key:0},C(tn,n=>h(`text`,y({key:n},{ref_for:!0},an(e,n)),T(E(u)(H.value.formatter,e[n].value,E(c)({v:e[n].value}),{datapoint:e[n],seriesIndex:t})),17)),64)):p(``,!0)]))),128)),h(`g`,null,[B.value.sideTitles.show?(x(),m(`g`,Ke,[(x(),m(d,null,C(tn,e=>h(`text`,y({key:e},{ref_for:!0},sn(e)),T(R.value.translations[e===`left`?`female`:`male`]),17)),64))])):p(``,!0),B.value.yAxis.show?(x(),m(`g`,qe,[(x(!0),m(d,null,C(Xt.value,(e,t)=>(x(),m(d,null,[t%B.value.yAxis.showEvery===0&&(!H.value.show||H.value.showOnHover&&P.value===t||P.value===null)||(H.value.show||H.value.showOnHover)&&P.value===t?(x(),m(`text`,{key:0,x:J.value.centerX,y:J.value.top+J.value.height/X.value/2+J.value.height/X.value*t,"dominant-baseline":`middle`,"text-anchor":`middle`,"font-size":B.value.yAxis.fontSize,fill:B.value.yAxis.color,"font-weight":B.value.yAxis.bold?`bold`:`normal`},T(E(u)(B.value.yAxis.formatter,e,E(c)({v:e}),{datapoint:e,seriesIndex:t})),9,Je)):p(``,!0)],64))),256))])):p(``,!0),B.value.xAxis.show?(x(),m(`g`,Ye,[z.value.layout.grid.show?(x(),m(`g`,Xe,[(x(),m(d,null,C(nn,e=>h(`line`,{key:e,x1:Zt.value[e][0].x,x2:Zt.value[e].at(-1).x,y1:J.value.bottom+B.value.xAxis.fontSize/2,y2:J.value.bottom+B.value.xAxis.fontSize/2,stroke:z.value.layout.grid.stroke,"stroke-width":z.value.layout.grid.strokeWidth,"stroke-linecap":`round`},null,8,Ze)),64))])):p(``,!0),(x(),m(d,null,C(nn,e=>(x(),m(d,{key:e},[(x(!0),m(d,null,C(Zt.value[e],(e,t)=>(x(),m(`g`,{key:t},[z.value.layout.grid.show?(x(),m(`line`,{key:0,x1:e.x,x2:e.x,y1:J.value.bottom+B.value.xAxis.fontSize/2,y2:J.value.bottom+B.value.xAxis.fontSize/2+4,stroke:z.value.layout.grid.stroke,"stroke-width":z.value.layout.grid.strokeWidth,"stroke-linecap":`round`},null,8,Qe)):p(``,!0)]))),128))],64))),64)),h(`g`,{ref_key:`xAxisLabels`,ref:bt},[(x(),m(d,null,C(nn,e=>(x(),m(d,{key:e},[(x(!0),m(d,null,C(Zt.value[e],(e,t)=>(x(),m(`text`,{key:t,class:`vue-ui-age-pyramid-x-axis-label`,"font-size":B.value.xAxis.fontSize,fill:B.value.xAxis.color,"text-anchor":B.value.xAxis.rotation>0?`start`:B.value.xAxis.rotation<0?`end`:`middle`,"font-weight":B.value.xAxis.bold?`bold`:`normal`,transform:`translate(${e.x}, ${J.value.bottom+B.value.xAxis.fontSize*2}) rotate(${B.value.xAxis.rotation})`},T(E(u)(B.value.xAxis.formatter,e.value/B.value.xAxis.scale,E(c)({v:e.value/B.value.xAxis.scale}),{datapoint:e,seriesIndex:t})),9,$e))),128))],64))),64))],512),h(`text`,{x:J.value.right,y:q.value.height,"text-anchor":`end`,"font-size":B.value.xAxis.fontSize,fill:B.value.xAxis.color,"font-weight":B.value.xAxis.bold?`bold`:`normal`},T(B.value.xAxis.translation),9,et)])):p(``,!0)]),j.value?p(``,!0):(x(),m(`g`,tt,[(x(!0),m(d,null,C(e.dataset,(e,t)=>(x(),m(`g`,null,[h(`rect`,{x:J.value.left,y:J.value.top+J.value.height/X.value*t-V.value.gap/2,width:J.value.width<=0?1e-4:J.value.width,height:J.value.height/X.value<=0?1e-4:J.value.height/X.value,fill:P.value!==null&&P.value===t?E(re)(z.value.highlighter.color,z.value.highlighter.opacity):`transparent`,onMouseover:n=>pn(t,e,`pointer`),onMouseleave:n=>dn(t,e),onClick:n=>un(t,e)},null,40,nt)]))),256))])),w(s.$slots,`svg`,{svg:{...q.value,drawingArea:J.value,isPrintingImg:E(zt)||E(Bt)||E(An),isPrintingSvg:E(jn)}},void 0,!0)],46,He)),s.$slots.hint?(x(),m(`div`,rt,[w(s.$slots,`hint`,b(v({hint:R.value.a11y.translations.keyboardNavigation,isVisible:wt.value})),void 0,!0)])):p(``,!0)]),s.$slots.watermark?(x(),m(`div`,it,[w(s.$slots,`watermark`,b(v({isPrinting:E(zt)||E(Bt)||E(An)||E(jn)})),void 0,!0)])):p(``,!0),w(s.$slots,`legend`,{legend:Z.value},void 0,!0),s.$slots.source?(x(),m(`div`,{key:6,ref_key:`source`,ref:vt,dir:`auto`},[w(s.$slots,`source`,{},void 0,!0)],512)):p(``,!0),g(E(at),{teleportTo:z.value.tooltip.teleportTo,show:K.value.showTooltip&&N.value,backgroundColor:z.value.tooltip.backgroundColor,color:z.value.tooltip.color,borderRadius:z.value.tooltip.borderRadius,borderColor:z.value.tooltip.borderColor,borderWidth:z.value.tooltip.borderWidth,fontSize:z.value.tooltip.fontSize,backgroundOpacity:z.value.tooltip.backgroundOpacity,position:z.value.tooltip.position,offsetX:z.value.tooltip.offsetX,offsetY:z.value.tooltip.offsetY,parent:F.value,content:mn.value,isFullscreen:$.value,isCustom:z.value.tooltip.customFormat&&typeof z.value.tooltip.customFormat==`function`,smooth:z.value.tooltip.smooth,backdropFilter:z.value.tooltip.backdropFilter,smoothForce:z.value.tooltip.smoothForce,smoothSnapThreshold:z.value.tooltip.smoothSnapThreshold,isA11yMode:L.value===`keyboard`,a11yPosition:Ct.value},{"tooltip-before":O(()=>[w(s.$slots,`tooltip-before`,b(v({...cn.value})),void 0,!0)]),tooltip:O(()=>[w(s.$slots,`tooltip`,b(v({...cn.value})),void 0,!0)]),"tooltip-after":O(()=>[w(s.$slots,`tooltip-after`,b(v({...cn.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`]),ht.value&&R.value.userOptions.buttons.table?(x(),ke(Le(En.value.component),y({key:7},En.value.props,{ref_key:`tableUnit`,ref:xt,onClose:Dn}),Ae({content:O(()=>[g(E(ct),{colNames:Q.value.colNames,head:Q.value.head,body:Q.value.body,config:Q.value.config,title:R.value.table.useDialog?``:En.value.title,withCloseButton:!R.value.table.useDialog,isCursorPointer:U.value,onClose:Dn},{th:O(({th:e})=>[je(T(e),1)]),td:O(({td:e})=>[je(T(e),1)]),_:1},8,[`colNames`,`head`,`body`,`config`,`title`,`withCloseButton`,`isCursorPointer`])]),_:2},[R.value.table.useDialog?{name:`title`,fn:O(()=>[je(T(En.value.title),1)]),key:`0`}:void 0,R.value.table.useDialog?{name:`actions`,fn:O(()=>[h(`button`,{tabindex:`0`,class:`vue-ui-user-options-button`,onClick:ee[0]||=e=>_n(R.value.userOptions.callbacks.csv),style:Pe({cursor:U.value?`pointer`:`default`})},[g(E(ot),{name:`fileCsv`,stroke:En.value.props.color},null,8,[`stroke`])],4)]),key:`1`}:void 0]),1040)):p(``,!0),w(s.$slots,`skeleton`,{},()=>[j.value?(x(),ke(Te,{key:0})):p(``,!0)],!0)],46,ze))}},[[`__scopeId`,`data-v-7c8d467e`]]);export{Re as n,at as t};
@@ -0,0 +1,259 @@
1
+ import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{C as t,S as n,Vt as r,X as i,in as a}from"./lib-rPeBMZrn.js";import{n as o,t as s}from"./useHints-C-TwxM0Y.js";import{t as c}from"./useConfig-9oDGTWWG.js";import{t as l}from"./dom-to-png-D56-Zgv4.js";import{t as ee}from"./usePrinter-DVf3YcG5.js";import{t as te}from"./BaseIcon-CoY0vuL3.js";import{t as ne}from"./vue-ui-accordion-CnAwFOgA.js";import{t as re}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{t as ie}from"./ColorPicker-DmVnJGVv.js";import{Fragment as ae,Teleport as oe,computed as se,createBlock as u,createCommentVNode as d,createElementBlock as f,createElementVNode as p,createTextVNode as m,createVNode as ce,guardReactiveProps as le,mergeProps as ue,nextTick as de,normalizeClass as h,normalizeProps as fe,normalizeStyle as g,onBeforeUnmount as pe,onMounted as me,openBlock as _,ref as v,renderList as he,renderSlot as y,toDisplayString as b,unref as ge,vModelCheckbox as _e,vModelText as ve,watch as ye,withCtx as x,withDirectives as be,withModifiers as xe}from"vue";function Se(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=>{if(e.setToolMode)e.setToolMode({m:`move`,r:`resize`,d:`delete`,g:`group`,t:`text`}[t],t===`g`?`group`:void 0);else 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;if(!t)return;let n=()=>{e.shapes.value=e.shapes.value.filter(e=>e.id!==t.id),e.lastSelectedShape.value=void 0};e.editShapes?e.editShapes(n):(e.history?.value?.begin?.(),n(),e.history?.value?.end?.())},l=!1,ee=null,te=()=>{l||(l=!0,e.history?.value?.begin?.(`nudge`))},ne=()=>{l&&(clearTimeout(ee),ee=setTimeout(()=>{l=!1,e.history?.value?.end?.()},160))},re=()=>{clearTimeout(ee),l&&e.history?.value?.end?.(),l=!1},ie=n=>{if(n.key.startsWith(`Arrow`)||re(),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(),e.setToolMode?e.setToolMode(null):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(),te();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),ne()}},ae=e=>{e.key.startsWith(`Arrow`)&&ne()};return window.addEventListener(`keydown`,ie),window.addEventListener(`keyup`,ae),function(){window.removeEventListener(`keydown`,ie),window.removeEventListener(`keyup`,ae),re()}}var Ce={__name:`AnnotatorToolbarActions`,props:{actions:Array},setup(e){return(t,n)=>(_(!0),f(ae,null,he(e.actions,e=>y(t.$slots,`default`,{action:e},void 0,void 0,e.key)),128))}},we={class:`teleport-tooltip__inner`},S=/*#__PURE__*/ re({__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=se(()=>t.delayIn??t.delay),r=se(()=>t.delayOut??t.delay),i=v(!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)}ye(()=>t.show,e=>{e?c():l()},{immediate:!0}),me(()=>{t.show&&c()}),pe(()=>{s()});let ee=se(()=>({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)=>(_(),u(oe,{to:`body`},[i.value?(_(),f(`div`,{key:0,class:h([`teleport-tooltip`,e.placement]),style:g(ee.value),role:`tooltip`,"aria-hidden":`false`},[p(`div`,we,[y(t.$slots,`default`,{},void 0,!0)])],6)):d(``,!0)]))}},[[`__scopeId`,`data-v-c292996f`]]),Te=/* @__PURE__ */ e({default:()=>Ct}),Ee={class:`vue-data-ui-component vue-ui-annotator`},De={"data-dom-to-png-ignore":``},Oe=[`id`],ke=[`id`],Ae={class:`tool-selection`},je=[`disabled`,`onClick`,`onMouseenter`,`onFocus`],Me={class:`tool-selection`,style:{"margin-top":`6px`}},Ne={viewBox:`0 0 12 12`,style:{width:`100%`}},Pe=[`fill`],Fe={key:0},Ie={class:`tool-input`},Le=[`checked`],Re={viewBox:`0 0 12 12`,style:{width:`100%`}},ze=[`fill`],Be={key:1},Ve={class:`tool-input`},He=[`checked`],Ue={viewBox:`0 0 24 24`,style:{width:`100%`}},We=[`stroke`],Ge={key:2},Ke={style:{display:`flex`,"flex-direction":`column`,"align-items":`center`,"justify-content":`center`}},qe={class:`tool-input`},Je={key:3},Ye={style:{display:`flex`,"flex-direction":`column`,"align-items":`center`,"justify-content":`center`}},Xe={class:`tool-input`},Ze=[`checked`],Qe={key:4},$e={style:{display:`flex`,"flex-direction":`column`,"align-items":`center`,"justify-content":`center`}},et={class:`tool-input`},tt={key:5},nt={key:6},rt=[`disabled`],it={key:7},at=[`disabled`],ot={key:8},st={key:9},ct={key:10},lt={key:11},ut={style:{display:`flex`,"flex-direction":`column`,"align-items":`center`,"justify-content":`center`},class:`tooltip`},dt={style:{display:`flex`,"flex-direction":`column`,"align-items":`start`,"justify-content":`center`}},ft={class:`tool-input`,style:{"font-variant-numeric":`tabular-nums`}},pt=[`id`],mt=[`viewBox`,`width`,`height`],ht=[`width`,`height`,`pointer-events`],gt=[`innerHTML`,`onClick`,`onDblclick`],_t=[`x1`,`x2`,`y1`,`y2`,`stroke`],vt=[`height`,`viewBox`,`width`],yt=[`cx`,`cy`],bt=`annotations`,xt=`‎`,St=450,Ct=/*#__PURE__*/ re({__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:re}){let we=e,Te=re,Ct=v(!1),wt=v(!1);me(()=>Ct.value=!0);let Tt=v(i()),{isImaging:Et,generateImage:Dt}=ee({elementId:Tt.value,fileName:bt}),C=v(void 0),Ot=v(1),w=v({start:{x:0,y:0},end:{x:0,y:0}}),T=v(void 0),kt=v(void 0),At=v(!1),jt=v(!1),Mt=v(!1),E=v(!1),Nt=v(!1),Pt=v(!0),Ft=v(!1),It=v(!1),Lt=v(!1),D=v(!1),Rt=v(!1),O=v(!1),k=v(!1),A=v(!1);ye(A,async e=>{wt.value=!1,e?(await de(),A.value&&(wt.value=!0)):(N.value=void 0,T.value=void 0,kt.value=void 0,Ut.value=[],k.value=!1)});let j=v(!1),zt=v(!1),M=v(!1),Bt=X(we.dataset?.shapes||[]),Vt=v(we.dataset?.lastSelectedShape?.id),N=se({get:()=>F.value.find(e=>e.id===Vt.value),set:e=>{Vt.value=e?.id}}),P=v({x:0,y:0}),Ht=v(!0),Ut=v([]),F=v(Bt),Wt=v(1e3),Gt=v(1e3),I=v({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}}),L=v(!1),Kt=v(1),qt=v(void 0),Jt=v(1),Yt=v(1),Xt=v(`start`),Zt=v(20),Qt=v(100),$t=r,R=v(null),z=v(null),B=v(null),V=v(null),en=v(null),tn=v(!1),nn=v({row:0,col:0}),H=v(null),U=v(!1),W=v(null),G=v({x:0,y:0}),rn=v(null),K=v([]),an=v(!1),on=v(null),sn=v({undo:0,redo:0}),cn=v(null),ln=v(null),q=se(()=>{let e=c().vue_ui_annotator;if(!Object.keys(we.config||{}).length)return e;let n=a({defaultConfig:e,userConfig:we.config});return t(n)});function un(e){return n(e)?.slice(0,7)||e}let dn=v(un(q.value.style.paletteColor)),fn=se(()=>q.value.style.buttons),J=se(()=>q.value.style);o({config:()=>q.value,dataset:()=>[],component:`VueUiAnnotator`,rules:[s.noHint]});let pn=se(()=>q.value.useCursorPointer),mn=se(()=>{let e=J.value.tooltips;return{backgroundColor:e.backgroundColor,color:e.color,border:e.border,borderRadius:`${e.borderRadius}px`,boxShadow:e.boxShadow}}),hn=se(()=>F.value.filter(e=>e.type!==`group`||Array.isArray(e.source)&&e.source.length>0).length>1),gn=se(()=>$t[Qt.value>98?98:Qt.value]);function _n(e,t=!1){let n=t?fn.value[e].selected:fn.value[e];return{background:n.backgroundColor,border:n.border,color:n.color,borderRadius:`${fn.value.borderRadius}px`,cursor:pn.value?`pointer`:`default`}}function vn(e,t){Jn(),M.value&&$(),Nr(),D.value=e===`move`,O.value=e===`resize`,E.value=e===`delete`,k.value=e===`group`,Ft.value=e===`draw`,j.value=e===`text`,C.value=e===`draw`||e===`group`?t:void 0,L.value=!1}let yn=[{key:`move`,slot:`icon-move`,icon:`move`,translation:`tooltipMove`,testId:void 0,get active(){return D.value},get disabled(){return F.value.length===0},shortcut:`M`,run:()=>vn(D.value?null:`move`,void 0)},{key:`resize`,slot:`icon-resize`,icon:`resize`,translation:`tooltipResize`,get active(){return O.value},get disabled(){return F.value.length===0},shortcut:`R`,run:()=>vn(O.value?null:`resize`,void 0)},{key:`delete`,slot:`icon-delete`,icon:`trash`,translation:`tooltipDelete`,get active(){return E.value},get disabled(){return F.value.length===0},shortcut:`D`,run:()=>vn(E.value?null:`delete`,void 0)},{key:`selectAndGroup`,slot:`icon-select-group`,icon:`selectAndGroup`,translation:`tooltipGroup`,get active(){return k.value},get disabled(){return!hn.value},shortcut:`G`,run:()=>vn(k.value?null:`group`,`group`)},{key:`bringToFront`,slot:`icon-bring-to-front`,icon:`bringToFront`,translation:`tooltipBringToFront`,get disabled(){return!N.value},run:()=>{vn(`move`),Xn(`front`)}},{key:`bringToBack`,slot:`icon-bring-to-back`,icon:`bringToBack`,translation:`tooltipBringToBack`,get disabled(){return!N.value},run:()=>{vn(`move`),Xn(`back`)}},{key:`duplicate`,slot:`icon-copy`,icon:`copy`,translation:`tooltipDuplicate`,get disabled(){return!N.value},iconProps:{size:18},run:()=>{vn(`move`),Zn()}},{key:`undoLast`,slot:`icon-undo`,icon:`refresh`,translation:`tooltipUndo`,testId:void 0,oneShot:!0,get disabled(){return sn.value.undo===0},modifier:!0,shortcut:`Z`,iconProps:{size:20},run:()=>{vn(null),sr()}},{key:`redoLast`,slot:`icon-redo`,icon:`refresh`,translation:`tooltipRedo`,testId:void 0,oneShot:!0,get disabled(){return sn.value.redo===0},modifier:!0,shortcut:`Y`,iconProps:{size:20,style:{transform:`rotateX(0deg) rotateY(180deg)`}},run:()=>{vn(null),cr()}},{key:`printPdf`,slot:`icon-print`,icon:`printer`,translation:`tooltipPdf`,get visible(){return J.value.showPrint},run:Mr},{key:`printImage`,slot:`icon-export-image`,icon:`image`,translation:`tooltipImage`,get visible(){return J.value.showImage},iconProps:{size:20},run:Dt},{key:`saveAction`,slot:`icon-save`,icon:`save`,translation:`tooltipSave`,get visible(){return J.value.showSave},run:Kr}];function bn(e){return e.shortcut?e.modifier?[an.value?`⌘`:`Ctrl`,e.shortcut]:[e.shortcut]:[]}let xn=se(()=>{switch(!0){case E.value:return`default`;case D.value:return`move`;case j.value:return`text`;case O.value:return`move`;default:return``}}),Sn=se(()=>F.value),Y=v(null);function Cn(e){return e?!!(N.value&&N.value.id===e.id):!1}function wn(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 Tn(e=[]){return e.map(({x:e,y:t})=>`${e} ${t}`).join(` `)}function En(e=``){let t=wn(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 Dn(e){if(!e||!A.value||!O.value||!N.value||N.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=En(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=z.value===`circle-radius`&&B.value?.shapeId===e.id&&B.value?.handlePoint?B.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 On(e){if(!e||e.type===`text`&&M.value&&V.value===e.id)return``;let t=Cn(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=En(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=Y.value?Array.from(Y.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 kn(e,t=!1){switch(!0){case e.type===`circle`:return`
81
+ <g id="${e.id}" style="display:${E.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:${E.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:${E.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 An(e=``){return String(e).replace(/&nbsp;/g,`\xA0`)}function jn(e){return String(e?.textContent??``).split(xt).map(An)}function Mn(e,t){if(!e)return;let n=t.length?t:[``];e.textContent=n.join(xt),e.lines=Math.max(0,n.length-1)}function Nn(e=``){return String(e).replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`)}function Pn(e=``){return Nn(An(e))||`&#8203;`}function Fn(e,t,n=!1,r=!0){let i=jn(e),a=Math.max(1,i.length),o=i.reduce((e,t)=>Math.max(e,t.length),0),s=Math.max(24,o*e.fontSize*.7+16),c=e.textAlign===`middle`?e.x-s/2:e.textAlign===`end`?e.x-s:e.x,l=Math.max(e.fontSize*1.2,e.fontSize*a);return`
99
+ <g id="${e.id}">
100
+ <rect
101
+ id="${e.id}"
102
+ data-shape-hit-area="true"
103
+ x="${c-8}"
104
+ y="${e.y-e.fontSize}"
105
+ height="${l+8}"
106
+ width="${s+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
+ ${r?kn(e,n):``}
127
+ </g>
128
+ `}function In(e,t=!0,n=``){switch(!0){case e&&e.type===`arrow`:{let r=e.strokeWidth>3?5:10,i=e.strokeWidth>3?2.5:5,a=`marker_${Tt.value}_${n||e.id}`,o=Math.max(24,Number(e.strokeWidth||1)+24);return{html:`
129
+ <defs>
130
+ <marker
131
+ id="${a}"
132
+ markerWidth="${r}"
133
+ markerHeight="${r}"
134
+ refX="0"
135
+ refY="${i}"
136
+ orient="auto"
137
+ >
138
+ <polygon
139
+ points="0 0,${r} ${i}, 0 ${r}"
140
+ fill="${e.color}"
141
+ />
142
+ </marker>
143
+ </defs>
144
+ <g id="${e.id}">
145
+ ${t?On(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="${o}"
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(#${a})"
165
+ />
166
+ ${t?Dn(e):``}
167
+ ${t?kn(e):``}
168
+ </g>
169
+ `,id:e.id}}case e&&e.type===`circle`:return{html:`
170
+ <g id="${e.id}">
171
+ ${t?On(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
+ ${t?Dn(e):``}
184
+ </g>
185
+
186
+ ${t?kn(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="${O.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:${k.value||E.value||Cn(e)?`initial`:`none`};"
198
+ />
199
+ <g id="${e.id}">
200
+ ${gr(e)}
201
+ </g>
202
+ ${t?Dn(e):``}
203
+ ${t?kn(e):``}
204
+ </g> `,id:e.id};case e&&e.type===`rect`:return{html:`<g id="${e.id}">
205
+ ${t?On(e):``}
206
+ <rect
207
+ id="${O.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
+ ${t?Dn(e):``}
218
+ ${t?kn(e):``}
219
+ </g> `,id:e.id};case e&&e.type===`line`:{let n=Math.max(24,Number(e.strokeWidth||1)+24);return{html:`
220
+ <g id="${e.id}">
221
+ ${t?On(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="${n}"
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
+ ${t?Dn(e):``}
241
+ ${t?kn(e):``}
242
+ </g>
243
+ `,id:e.id}}case e&&e.type===`text`:{let n=jn(e),r=[];for(let t=0;t<n.length;t+=1)r.push(`
244
+ ${e.isBulletTextMode?`<tspan
245
+ data-bullet-line="${t}"
246
+ x="${e.x-e.fontSize}"
247
+ y="${e.y+e.fontSize*t}"
248
+ id="${e.id}"
249
+ font-size="${e.fontSize/2}"
250
+ >⬤</tspan>`:``}
251
+ <tspan
252
+ data-text-line="${t}"
253
+ id="${e.id}"
254
+ x="${e.x}"
255
+ y="${e.y+e.fontSize*t}"
256
+ >${Pn(n[t])}</tspan>`);return{html:`
257
+ ${t?On(e):``}
258
+ ${Fn(e,r,e.isBulletTextMode,t)}
259
+ `,id:e.id}}}}let Ln=se(()=>Sn.value.map(e=>In(e)).filter(Boolean));function X(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=>X(e)):typeof e==`object`?Object.fromEntries(Object.entries(e).map(([e,t])=>[e,X(t)])):e}}function Rn(e=!1){if(!C.value||!Nt.value)return;w.value.end={x:P.value.x,y:P.value.y};let t;F.value.length>0&&T.value&&(t=[...F.value].find(e=>e.id===T.value.id));let n,r,i;t&&(n=t.x-w.value.end.x,r=t.y-w.value.end.y,i=Math.sqrt(n*n+r*r));let a,o,s,c;switch(e?(a=Math.max(w.value.end.x,t.x),o=Math.min(w.value.end.x,t.x),s=Math.max(w.value.end.y,t.y),c=Math.min(w.value.end.y,t.y)):(a=Math.max(w.value.end.x,w.value.start.x),o=Math.min(w.value.end.x,w.value.start.x),s=Math.max(w.value.end.y,w.value.start.y),c=Math.min(w.value.end.y,w.value.start.y)),!0){case C.value===`arrow`:F.value.at(-1).endX=w.value.end.x,F.value.at(-1).endY=w.value.end.y;break;case C.value===`circle`:F.value.at(-1).circleRadius=Pt.value?X(a-o)+20:i+20;break;case C.value===`line`:F.value.at(-1).path+=` ${P.value.x} ${P.value.y} `;break;case[`rect`,`group`].includes(C.value):{let e=F.value.at(-1);e.x=o,e.y=c,e.rectWidth=a-o||20,e.rectHeight=s-c||20;break}}}function zn(){Nt.value?(Rn(),cn.value=requestAnimationFrame(zn)):cn.value=null}function Bn(e){let t=F.value.findIndex(t=>t.id===e);if(t>-1&&t!==F.value.length-1){let[e]=F.value.splice(t,1);F.value.push(e)}}function Vn(e){let t=e;for(;t&&t!==Y.value;){let e=t.id;if(e&&F.value.some(t=>t.id===e))return e;t=t.parentElement}return null}function Hn(e){if(!A.value)return null;let t=Vn(e?.target);if(t)return t;let n=Y.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`,Vn(s)}function Un(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:X(F.value),lastSelectedShape:X(N.value)}),s=e=>{let t=JSON.parse(e);F.value=t.shapes,N.value=t.lastSelectedShape?.id?F.value.find(e=>e.id===t.lastSelectedShape.id):void 0,T.value=N.value?{id:N.value.id}:void 0,V.value=null,en.value=null,tn.value=!1,M.value=!1,L.value=!1,H.value=null},c=()=>{sn.value.undo=r.undo.length,sn.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{isOpen:()=>r.open,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 Wn(){if(!rn.value)return;let e=rn.value.getBoundingClientRect();G.value={x:e.left+e.width/2,y:e.top}}function Z(e,t){W.value=e,rn.value=t.currentTarget||t.target,Wn(),U.value=!0,window.addEventListener(`scroll`,Wn,!0),window.addEventListener(`resize`,Wn,{passive:!0})}function Q(){U.value=!1,W.value=null,rn.value=null,window.removeEventListener(`scroll`,Wn,!0),window.removeEventListener(`resize`,Wn)}function Gn(e){let t=Vn(e?.target)||T.value?.id||kt.value,n=F.value.find(e=>e.id===t);if(!n){R.value=null;return}N.value=n,T.value={id:n.id};let r=P.value.x,i=P.value.y;switch(n.type){case`rect`:case`circle`:case`text`:R.value={dx:r-n.x,dy:i-n.y};break;case`arrow`:R.value={dx:r-n.x,dy:i-n.y,endDx:r-n.endX,endDy:i-n.endY};break;case`line`:R.value={startX:r,startY:i,path:n.path};break;case`group`:R.value={dx:r-(n.x||0),dy:i-(n.y||0)};break;default:R.value={dx:0,dy:0}}}function Kn(e,t){if(z.value=t||null,B.value=null,e){if(e.type===`line`&&t===`line-scale`){let t=wn(e.path),n=En(e.path);if(!t.length||!n)return;B.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);B.value={shapeId:e.id,bounds:{left:t,top:n,right:r,bottom:i}}}else if(e.type===`group`&&t===`group-scale`)B.value={shapeId:e.id,width:e.rectWidth,height:e.rectHeight,source:X(e.source||[])};else if(e.type===`circle`&&t===`circle-radius`){let t=Math.max(1,Number(e.circleRadius)||1);B.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}}}}}let qn=!1;function Jn(){qn&&(qn=!1,K.value?.end?.())}function Yn(e){let t=!K.value?.isOpen?.()&&!M.value&&!Lt.value;t&&K.value?.begin?.();try{return e()}finally{t&&K.value?.end?.()}}function Xn(e){let t=N.value;t&&[`front`,`back`].includes(e)&&Yn(()=>{F.value=F.value.filter(e=>e.id!==t.id),e===`front`?F.value.push(t):F.value.unshift(t)})}function Zn(){let e=N.value;e&&Yn(()=>{let t=X(e);t.id=`${e.id}_copy_${i()}`;let n=Math.max(1,e.x-100)-e.x,r=Math.max(1,e.y-100)-e.y;t.x+=n,t.y+=r,t.type===`arrow`&&(t.endX+=n,t.endY+=r),t.type===`line`&&(t.path=Tn(wn(t.path).map(e=>({x:e.x+n,y:e.y+r})))),t.type===`group`&&(t.source=(t.source||[]).map((e,n)=>({...e,id:t.id,oldId:`${t.id}_${n}`})),_r(t)),F.value.push(t),N.value=t})}function Qn(e){e&&(e.color&&(dn.value=un(e.color)),Number.isFinite(Number(e.strokeWidth))&&(Ot.value=Number(e.strokeWidth)),`isDash`in e&&(Mt.value=!!e.isDash),e.type===`circle`?(I.value.circle.filled=!!e.isFilled,C.value=`circle`):e.type===`rect`?(I.value.rect.filled=!!e.isFilled,C.value=`rect`):e.type===`arrow`?C.value=`arrow`:e.type===`line`?C.value=`line`:e.type===`text`&&(Xt.value=e.textAlign||`start`,Zt.value=Number(e.fontSize)||Zt.value,At.value=!!e.isBold,It.value=!!e.isItalic,zt.value=!!e.isUnderline,jt.value=!!e.isBulletTextMode))}function $n(e){A.value?(e.preventDefault(),Ht.value=!1,kt.value=Vn(e.target)||void 0):kt.value=void 0}function er(){let e=V.value;!e||!Y.value||!M.value?H.value=null:de(()=>{if(!Y.value||!M.value||V.value!==e){H.value=null;return}let t=F.value.find(t=>t.id===e);if(!t||t.type!==`text`){H.value=null;return}let n=Array.from(Y.value.getElementsByTagName(`text`)).find(t=>t.getAttribute(`data-shape-id`)===e);if(!n){H.value=null;return}let r=jn(t),i=Math.max(0,Math.min(nn.value.row,r.length-1)),a=r[i]||``,o=Math.max(0,Math.min(nn.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`),Y.value.appendChild(c);let l=e=>(c.textContent=e||`​`,typeof c.getComputedTextLength==`function`?c.getComputedTextLength():c.getBBox().width),ee=l(s),te=l(a);c.remove();let ne=t.x;t.textAlign===`middle`?ne-=te/2:t.textAlign===`end`&&(ne-=te);let re=t.y+t.fontSize*i;H.value={x:ne+ee,y1:re-t.fontSize*.85,y2:re+t.fontSize*.15,color:t.color||J.value.color}})}function tr(e,{isNew:t=!1}={}){if(!e||e.type!==`text`)return;if(M.value&&V.value===e.id){let t=jn(e),n=Math.max(0,t.length-1);nn.value={row:n,col:(t[n]||``).length},L.value=!0,er();return}M.value&&$(),t||K.value?.begin?.(),N.value=e,T.value={id:e.id},V.value=e.id,en.value=t?null:X(e),tn.value=t;let n=jn(e),r=Math.max(0,n.length-1);nn.value={row:r,col:(n[r]||``).length},Qn(e),j.value=!0,M.value=!0,L.value=!0,Ft.value=!1,C.value=void 0,H.value=null,er()}function $({cancel:e=!1}={}){let t=V.value;if(!t){M.value=!1,L.value=!1,H.value=null;return}let n=F.value.find(e=>e.id===t);if(e){if(tn.value)F.value=F.value.filter(e=>e.id!==t),n=null;else if(en.value){let e=F.value.findIndex(e=>e.id===t);e!==-1&&(F.value[e]=X(en.value),n=F.value[e])}}else n&&jn(n).every(e=>e.length===0)&&(F.value=F.value.filter(e=>e.id!==t),n=null);V.value=null,en.value=null,tn.value=!1,nn.value={row:0,col:0},M.value=!1,L.value=!1,H.value=null,K.value?.end?.(),n?(N.value=n,T.value={id:n.id}):N.value?.id===t&&(N.value=void 0,T.value=void 0)}function nr(){if(M.value){$();return}let e=N.value;e&&e.type===`text`&&jn(e).every(e=>e.length===0)&&(F.value=F.value.filter(t=>t.id!==e.id),N.value=F.value.at(-1))}function rr(){K.value?.begin?.();let e={id:`text_${i()}`,type:`text`,lines:0,x:P.value.x,y:P.value.y,textContent:``,fontSize:X(Zt.value),textAlign:X(Xt.value),isBold:X(At.value),isItalic:X(It.value),isUnderline:X(zt.value),color:X(dn.value),isBulletTextMode:X(jt.value)};F.value.push(e),N.value=e,T.value={id:e.id},tr(e,{isNew:!0})}let ir=0;function ar(e){A.value&&!E.value&&(e.preventDefault(),e.stopPropagation(),Hr(e),Vn(e.target)||Date.now()<ir||(M.value&&$(),j.value&&!O.value?rr():(!Ft.value&&!k.value&&(N.value=void 0,T.value=void 0,kt.value=void 0,D.value||(C.value=void 0)),L.value=!1,H.value=null)))}function or(e){return Yn(()=>{N.value&&N.value.type===`text`&&(N.value.textAlign=e,Xt.value=e,er())})}function sr(){Jn(),M.value&&$(),K.value?.undo?.()}function cr(){Jn(),M.value&&$(),K.value?.redo?.()}function lr(e){if(!M.value||!V.value)return;let t=F.value.find(e=>e.id===V.value);if(!t||t.type!==`text`){$();return}let n=jn(t);n.length||(n=[``]);let r=Math.max(0,Math.min(nn.value.row,n.length-1)),i=Math.max(0,Math.min(nn.value.col,n[r].length)),a=!1,o=!1;if(e.key===`Escape`)e.preventDefault(),$({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=X(At.value),t.isItalic=X(It.value),t.isUnderline=X(zt.value),Mn(t,n)),(a||o)&&(nn.value={row:r,col:i},L.value=!0,er())}}function ur(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=En(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 dr(e,t){let n=ur(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 fr(e,t){let n=X(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=Tn(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 pr(e){return e.type===`group`?(e.source||[]).flatMap(t=>t.type===`group`?pr(fr(t,e)):[fr(t,e)]):[X(e)]}function mr(e,t){let n={...X(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=wn(e.path).map(e=>({x:e.x-t.x,y:e.y-t.y}))),n}function hr(){if(Ut.value=[],C.value!==`group`)return k.value=!1,F.value=F.value.filter(e=>e.type!==`group`),null;let e=F.value.at(-1);if(!e||e.type!==`group`)return null;let t=F.value.filter(t=>t.id!==e.id&&dr(t,e));if(t.length<2)return F.value=F.value.filter(t=>t.id!==e.id),null;let n=t.flatMap(e=>pr(e));Ut.value=n.map(t=>mr(t,e)),e.source=Ut.value,e.content=``;let r=new Set(t.map(e=>e.id));return F.value=F.value.filter(t=>t.id===e.id||!r.has(t.id)),_r(e),e}function gr(e){return Array.isArray(e.source)?e.source.map((t,n)=>In({...fr(t,e),id:e.id},!1,`${e.id}_${n}`)?.html||``).join(``):e.content||``}function _r(e){e.content=gr(e)}function vr(e){e.relatedTarget&&Y.value&&Y.value.contains(e.relatedTarget)||(Ht.value=!0,kt.value=void 0)}function yr(){if(!C.value&&!k.value)return;Nt.value=!0,Pt.value=!0,w.value.start={x:P.value.x,y:P.value.y};let e=`${k.value?`group`:C.value}_${i()}`;switch(!0){case C.value===`arrow`:F.value.push({id:e,x:P.value.x,y:P.value.y,endX:P.value.x,endY:P.value.y,type:C.value,color:X(dn.value),strokeWidth:X(Math.abs(Ot.value)),isDash:X(Mt.value)}),N.value=F.value.at(-1);break;case C.value===`circle`:F.value.push({alpha:I.value.circle.filled?gn.value:``,id:e,color:X(dn.value),isFilled:X(I.value.circle.filled),circleRadius:X(I.value.circle.radius),circleStrokeWidth:X(I.value.circle.strokeWidth),type:C.value,x:P.value.x,y:P.value.y,strokeWidth:X(Math.abs(Ot.value)),isDash:X(Mt.value)}),N.value=F.value.at(-1);break;case C.value===`line`:F.value.push({alpha:X(gn.value),id:e,x:P.value.x,y:P.value.y,type:C.value,color:X(dn.value),strokeWidth:X(Math.abs(Ot.value)),isDash:X(Mt.value),path:`${P.value.x} ${P.value.y}`}),N.value=F.value.at(-1);break;case C.value===`rect`:F.value.push({alpha:I.value.rect.filled?gn.value:``,id:e,color:X(dn.value),isFilled:X(I.value.rect.filled),rectStrokeWidth:X(I.value.rect.strokeWidth),rectHeight:X(I.value.rect.height),rectWidth:X(I.value.rect.width),type:C.value,x:P.value.x,y:P.value.y,strokeWidth:X(Math.abs(Ot.value)),isDash:X(Mt.value)}),N.value=F.value.at(-1);break;case C.value===`group`:F.value.push({alpha:1,id:`group_${i()}`,x:P.value.x,y:P.value.y,isFilled:!1,rectHeight:X(I.value.rect.height),rectWidth:X(I.value.rect.width),rectStrokeWidth:1,type:`group`,color:`grey`,strokeWidth:1,isDash:!0,content:``})}cn.value||=requestAnimationFrame(zn)}function br(e){if(!A.value)return;Hr(e);let t=Hn(e),n=t?F.value.find(e=>e.id===t):null;if(M.value&&V.value&&t!==V.value&&$(),E.value)Lt.value=!1;else{if(n){let t=Number.isFinite(e?.timeStamp)?e.timeStamp:Date.now(),r=Er.id===n.id&&t-Er.at>=0&&t-Er.at<=St;if(Er=r?{id:null,at:0}:{id:n.id,at:t},r){e.preventDefault(),e.stopPropagation(),Lt.value=!1,R.value=null,z.value=null,B.value=null,Tr(n);return}}else Er={id:null,at:0};if(e.preventDefault(),e.stopPropagation(),Lt.value=!0,e.pointerId!=null){try{Y.value?.setPointerCapture?.(e.pointerId)}catch{}ln.value=e.pointerId}else ln.value=null;if(Ft.value){if(n){Lt.value=!1,Ft.value=!1,N.value=n,T.value={id:n.id},Qn(n);return}K.value?.begin?.(),yr()}else if(k.value)K.value?.begin?.(),yr();else if(D.value){if(!n){Lt.value=!1,T.value=void 0;return}K.value?.begin?.(),Bn(n.id);let t=F.value.find(e=>e.id===n.id);N.value=t,T.value={id:t.id},Gn({target:e.target})}else if(O.value){if(!n){Lt.value=!1,T.value=void 0,R.value=null,z.value=null,B.value=null;return}let t=e.target?.getAttribute?.(`data-resize-handle`)||null;N.value=n,T.value={id:n.id},Qn(n),t?(R.value=null,Kn(n,t)):(z.value=null,B.value=null,Gn(e)),K.value?.begin?.()}}}function xr(e){if(!e||!e.id||!R.value&&(Gn({target:{id:e.id}}),!R.value))return;let t=P.value.x,n=P.value.y;switch(N.value=e,e.type){case`arrow`:{let{dx:r,dy:i,endDx:a,endDy:o}=R.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}=R.value;e.x=t-r,e.y=n-i;break}case`line`:{let{startX:r,startY:i,path:a}=R.value,o=t-r,s=n-i;e.path=Tn(wn(a).map(e=>({x:e.x+o,y:e.y+s})));let c=En(e.path);c&&(e.x=c.minX,e.y=c.minY);break}case`group`:{let{dx:r,dy:i}=R.value;e.x=t-r,e.y=n-i,_r(e);break}}}function Sr(){let e=T.value?.id||kt.value;if(!e)return;let t=F.value.find(t=>t.id===e);t&&xr(t)}function Cr(){let e=T.value?.id;if(!e)return;let t=F.value.find(t=>t.id===e);if(!t)return;let n=P.value.x,r=P.value.y;switch(C.value=t.type,N.value=t,t.type){case`arrow`:z.value===`arrow-start`?(t.x=n,t.y=r):z.value===`arrow-end`&&(t.endX=n,t.endY=r);break;case`line`:{if(z.value!==`line-scale`||!B.value?.bounds||!B.value?.points)return;let{bounds:e,points:i}=B.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=Tn(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(z.value!==`circle-radius`||B.value?.shapeId!==t.id||!B.value?.anchor)return;let e=B.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,B.value.handlePoint={x:i,y:a};break}case`rect`:{let e=z.value,i=B.value?.bounds;if(!e?.startsWith(`rect-`)||B.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(z.value!==`group-scale`||B.value?.shapeId!==t.id)return;let e=B.value,i=Math.max(1,e.width),a=Math.max(1,e.height),o=Math.max(20/i,20/a,Math.min((n-t.x)/i,(r-t.y)/a));t.rectWidth=i*o,t.rectHeight=a*o,t.source=e.source.map(e=>{let t=X(e);for(let e of[`diffX`,`diffY`,`diffEndX`,`diffEndY`,`circleRadius`,`rectWidth`,`rectHeight`,`fontSize`,`strokeWidth`])typeof t[e]==`number`&&(t[e]*=o);return t.diffPoints&&=t.diffPoints.map(e=>({x:e.x*o,y:e.y*o})),t}),_r(t);break}}}function wr(e){if(!A.value||E.value)return;e.preventDefault(),e.stopPropagation(),Hr(e);let t=Hn(e);t&&(kt.value=t),D.value&&Lt.value?Sr():O.value&&Lt.value&&(z.value?Cr():Sr())}function Tr(e){e&&(M.value&&V.value!==e.id&&$(),N.value=e,T.value={id:e.id},D.value=!1,E.value=!1,O.value=!0,k.value=!1,Ft.value=!1,e.type===`text`?(C.value=void 0,Qn(e),tr(e)):(j.value=!1,M.value=!1,L.value=!1,H.value=null,Qn(e)))}let Er={id:null,at:0},Dr={id:null,at:0};function Or(e,t){if(!A.value)return;let n=t||Vn(e.target);if(!n)return;Dr={id:null,at:0};let r=F.value.find(e=>e.id===n);r&&Tr(r)}function kr(e,t){if(!A.value)return;let n=t||Vn(e.target);if(!n)return;let r=F.value.find(e=>e.id===n);if(!r)return;let i=Number.isFinite(e?.timeStamp)?e.timeStamp:Date.now(),a=Dr.id===n&&i-Dr.at>=0&&i-Dr.at<=St;if(Dr=a?{id:null,at:0}:{id:n,at:i},a&&!E.value){Tr(r);return}let o=N.value?.id===n,s=j.value;if(E.value)M.value&&$(),K.value?.begin?.(),F.value=F.value.filter(e=>e.id!==n),N.value?.id===n&&(N.value=void 0),T.value=void 0,K.value?.end?.();else if(M.value&&V.value&&V.value!==n&&$(),N.value=r,T.value={id:r.id},D.value)L.value=!1,H.value=null;else if(Qn(r),r.type===`text`){let e=!D.value&&!O.value&&!Ft.value&&!k.value;j.value=e,e&&(s||o)&&tr(r)}else j.value=!1,L.value=!1,H.value=null}let Ar=v(null);function jr(e,t){for(t(e),e=e.firstChild;e;)jr(e,t),e=e.nextSibling}async function Mr(){if(Rt.value||Yr)return;M.value&&$(),vn(null),Rt.value=!0;let e=[];try{await de();let t=Ar.value;if(!t||Yr)return;jr(t,t=>{t?.nodeType===1&&(e.push({node:t,attribute:t.getAttribute(`font-family`),font:t.style.getPropertyValue(`font-family`),priority:t.style.getPropertyPriority(`font-family`)}),t.setAttribute(`font-family`,`Helvetica`),t.style.fontFamily=`Helvetica`)});let{default:n}=await import(`jspdf`);if(Yr)return;let r=await l({container:t,scale:2});if(Yr)return;let i=await new Promise((e,t)=>{let n=new Image;n.onload=()=>e(n),n.onerror=()=>t(/* @__PURE__ */ Error(`Unable to load annotation export image.`)),n.src=r});if(Yr)return;let a=i.naturalWidth||i.width,o=i.naturalHeight||i.height;if(!(a>0&&o>0))throw Error(`Annotation export image has no dimensions.`);let s={width:595.28,height:841.89},c=a/s.width*s.height,ee=s.width/a*o,te=new n(``,`pt`,`a4`);for(let e=o,t=0;e>0;e-=c,t-=s.height)te.addImage(r,`PNG`,0,t,s.width,ee,``,`FAST`),e>c&&te.addPage();te.save(`${(/* @__PURE__ */ new Date()).toLocaleDateString()}_annotations.pdf`)}catch(e){console.error(`Error generating image:`,e)}finally{for(let{node:t,attribute:n,font:r,priority:i}of e)n==null?t.removeAttribute(`font-family`):t.setAttribute(`font-family`,n),r?t.style.setProperty(`font-family`,r,i):t.style.removeProperty(`font-family`);Rt.value=!1}}function Nr(){if(!Nt.value&&!Lt.value&&ln.value==null&&cn.value==null)return;let e=Nt.value&&C.value===`group`?F.value.at(-1):null;if(e?.type===`group`&&!e.source&&(F.value=F.value.filter(t=>t.id!==e.id)),Nt.value=!1,Lt.value=!1,cn.value!==null&&cancelAnimationFrame(cn.value),cn.value=null,R.value=null,z.value=null,B.value=null,ln.value!=null){let e=ln.value;ln.value=null;try{Y.value?.releasePointerCapture?.(e)}catch{}}K.value?.end?.()}function Pr(e){if(!Nt.value&&!Lt.value)return;e&&Number.isFinite(e.clientX)&&Number.isFinite(e.clientY)&&(Hr(e),Nt.value?Rn():O.value&&z.value?Cr():(D.value||O.value)&&Sr());let t=Ft.value&&Nt.value&&N.value&&[`arrow`,`circle`,`line`,`rect`].includes(N.value.type)?F.value.find(e=>e.id===N.value.id):null;if(!E.value&&e&&(e.preventDefault(),e.stopPropagation()),Nt.value=!1,Lt.value=!1,R.value=null,z.value=null,B.value=null,ln.value!=null){let e=ln.value;ln.value=null;try{Y.value?.releasePointerCapture?.(e)}catch{}}cn.value&&=(cancelAnimationFrame(cn.value),null);let n=k.value?hr():null;K.value?.end(),n&&(k.value=!1,D.value=!0,O.value=!1,Ft.value=!1,E.value=!1,j.value=!1,M.value=!1,L.value=!1,H.value=null,N.value=n,T.value={id:n.id},kt.value=void 0,ir=Date.now()+250),t&&(ir=Date.now()+250,Tr(t))}function Fr(){return Yn(()=>{N.value&&N.value.type===`rect`&&(N.value.isFilled=!N.value.isFilled)})}function Ir(){return Yn(()=>{N.value&&N.value.type===`circle`&&(N.value.isFilled=!N.value.isFilled)})}function Lr(e=dn.value){return Yn(()=>{let t=un(typeof e==`string`&&e.length?e:dn.value);if(dn.value=t,!N.value)return;let n=F.value.find(e=>e.id===N.value.id);n&&(n.color=X(t),N.value=n,[`arrow`,`text`].includes(n.type)?er():n.alpha=X(gn.value))})}function Rr(){return Yn(()=>{N.value&&N.value.type!==`text`&&(N.value.isDash=X(Mt.value))})}function zr(){return Yn(()=>{N.value&&![`arrow`,`text`].includes(N.value.type)&&(N.value.alpha=X(gn.value))})}function Br(){return Yn(()=>{N.value&&[`arrow`,`circle`,`rect`,`line`].includes(N.value.type)&&(N.value.strokeWidth=X(Math.abs(Ot.value)))})}function Vr(){return Yn(()=>{N.value&&N.value.type===`text`&&(N.value.isBold=X(At.value),N.value.isItalic=X(It.value),N.value.isUnderline=X(zt.value),N.value.fontSize=X(Zt.value),N.value.isBulletTextMode=X(jt.value),er())})}function Hr(e){if(e.preventDefault?.(),!Y.value)return;let t=Y.value.getBoundingClientRect();if(!(t.width>0&&t.height>0))return;let n,r;e.touches&&e.touches.length>0?(n=e.touches[0].clientX,r=e.touches[0].clientY):(n=e.clientX,r=e.clientY),Number.isFinite(n)&&Number.isFinite(r)&&(P.value.x=(n-t.left)/t.width*Gt.value,P.value.y=(r-t.top)/t.height*Wt.value)}function Ur(e){nr(),vn(Ft.value&&C.value===e?null:`draw`,e)}function Wr(){let e=!j.value;nr(),vn(e?`text`:null)}function Gr(){Jn(),Nr(),Q(),M.value&&$(),A.value=!A.value,A.value||(D.value=!1,O.value=!1,k.value=!1,j.value=!1,M.value=!1,C.value=void 0,N.value=void 0,T.value=void 0,kt.value=void 0,Ut.value=[],L.value=!1,E.value=!1),Te(`toggleOpenState`,{isOpen:A.value})}function Kr(){Jn(),M.value&&$(),Te(`saveAnnotations`,{shapes:X(F.value),lastSelectedShape:X(N.value)})}let qr=null,Jr=null,Yr=!1;return me(()=>{if(Ar.value){let e=!1;jr(Ar.value,t=>{!e&&[`DIV`,`svg`,`section`,`canvas`].includes(t.tagName)&&(qt.value=t,e=!0)})}an.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)})();function e({width:e,height:t}){!Yr&&e>0&&t>0&&(Kt.value=t/e,Jt.value=e,Yt.value=t,Wt.value=Kt.value*Gt.value)}if(qt.value&&(e(qt.value.getBoundingClientRect()),Jr=new ResizeObserver(t=>t.forEach(t=>e(t.contentRect))),Jr.observe(qt.value)),on.value=e=>lr(e),window.addEventListener(`keydown`,on.value),K.value=Un(),K.value.size){let e=K.value.size();sn.value.undo=e.undo,sn.value.redo=e.redo}qr=Se({isMacLike:an,isSummaryOpen:A,isWriting:M,isDeleteMode:E,isMoveMode:D,isResizeMode:O,isSelectMode:k,isDrawMode:Ft,isTextMode:j,activeShape:C,showCaret:L,lastSelectedShape:N,shapes:F,history:K,setShapeTo:Ur,undoLastShape:sr,redoLastShape:cr,setToolMode:vn,editShapes:Yn})}),pe(()=>{Yr=!0,Nr(),Jr?.disconnect(),Q(),cn.value&&cancelAnimationFrame(cn.value),on.value&&window.removeEventListener(`keydown`,on.value),qr&&qr()}),ye(F,e=>{e.length===0&&(N.value=void 0)}),ye(j,e=>{!e&&M.value?$():(L.value=!!(e&&M.value),L.value&&er())}),(e,t)=>(_(),f(`div`,Ee,[p(`div`,De,[y(e.$slots,`toggle`,fe(le({toggle:Gr,isOpen:A.value})),()=>[ce(ne,{config:{maxHeight:1e3,useCursorPointer:pn.value,head:{backgroundColor:J.value.backgroundColor,color:J.value.color,iconColor:J.value.color,iconSize:20,icon:A.value?`close`:`annotator`,padding:`6px`},body:{backgroundColor:J.value.backgroundColor,color:J.value.color}},onToggle:Gr},{title:x(({color:e})=>[p(`div`,{style:g({color:e})},b(q.value.translations.title),5)]),content:x(({backgroundColor:e})=>[p(`div`,{id:`toggle_default_${Tt.value}`},null,8,Oe)]),_:1},8,[`config`])],!0),e.$slots.toggle&&A.value?(_(),f(`div`,{key:0,id:`toggle_slot_${Tt.value}`},null,8,ke)):d(``,!0),Ct.value&&wt.value?(_(),u(oe,{key:1,to:e.$slots.toggle?`#toggle_slot_${Tt.value}`:`#toggle_default_${Tt.value}`},[p(`div`,null,[p(`div`,Ae,[ce(Ce,{actions:yn},{default:x(({action:t})=>[!(`visible`in t)||t.visible?(_(),f(`button`,{key:0,disabled:t.disabled,style:g(_n(`controls`,t.active)),class:h({"button-tool":!0,"button-tool--selected":t.active,"button-tool--one-shot":t.oneShot,tooltip:!0}),onClick:t.run,onMouseenter:e=>J.value.showTooltips&&Z(t.key,e,`top`),onMouseleave:Q,onFocus:e=>J.value.showTooltips&&Z(t.key,e,`top`),onBlur:Q},[y(e.$slots,t.slot,fe(le(`active`in t?{active:t.active}:{})),()=>[ce(te,ue({name:t.icon,stroke:t.active?fn.value.controls.selected.color:fn.value.controls.color},t.iconProps),null,16,[`name`,`stroke`])],!0),J.value.showTooltips?(_(),u(S,{key:0,show:U.value&&W.value===t.key,x:G.value.x,y:G.value.y-6,placement:`top`,styleObject:mn.value},{default:x(()=>[m(b(q.value.translations[t.translation])+` `,1),(_(!0),f(ae,null,he(bn(t),e=>(_(),f(`kbd`,{key:e},b(e),1))),128))]),_:2},1032,[`show`,`x`,`y`,`styleObject`])):d(``,!0)],46,je)):d(``,!0)]),_:3})]),p(`div`,Me,[p(`button`,{class:h({"button-tool":!0,"button-tool--selected":C.value===`circle`,tooltip:!0}),style:g(_n(`shapes`,C.value===`circle`)),onClick:t[0]||=e=>{Ur(`circle`),k.value=!1},onMouseenter:t[1]||=e=>J.value.showTooltips&&Z(`setCircle`,e,`top`),onMouseleave:Q,onFocus:t[2]||=e=>J.value.showTooltips&&Z(`setCircle`,e,`top`),onBlur:Q},[y(e.$slots,`icon-circle`,fe(le({filled:I.value.circle.filled})),()=>[(_(),f(`svg`,Ne,[p(`circle`,{cx:6,cy:6,r:`4`,fill:I.value.circle.filled?(C.value,dn.value+gn.value):`none`,stroke:`currentColor`},null,8,Pe)]))],!0),J.value.showTooltips?(_(),u(S,{key:0,show:U.value&&W.value===`setCircle`,x:G.value.x,y:G.value.y-6,placement:`top`,styleObject:mn.value},{default:x(()=>[m(b(q.value.translations.tooltipShapeCircle)+` `,1),t[59]||=p(`kbd`,null,`C`,-1)]),_:1},8,[`show`,`x`,`y`,`styleObject`])):d(``,!0)],38),C.value===`circle`?(_(),f(`div`,Fe,[p(`label`,Ie,[m(b(q.value.translations.filled)+` `,1),be(p(`input`,{type:`checkbox`,"onUpdate:modelValue":t[3]||=e=>I.value.circle.filled=e,onChange:Ir,checked:I.value.circle.filled,style:g({all:`revert`,appearance:`auto`,"-webkit-appearance":`auto`,accentColor:J.value.color+` !important`})},null,44,Le),[[_e,I.value.circle.filled]])])])):d(``,!0),p(`button`,{class:h({"button-tool":!0,"button-tool--selected":C.value===`rect`,tooltip:!0}),style:g(_n(`shapes`,C.value===`rect`)),onClick:t[4]||=e=>{Ur(`rect`),k.value=!1},onMouseenter:t[5]||=e=>J.value.showTooltips&&Z(`setRect`,e,`top`),onMouseleave:Q,onFocus:t[6]||=e=>J.value.showTooltips&&Z(`setRect`,e,`top`),onBlur:Q},[y(e.$slots,`icon-rect`,fe(le({filled:I.value.rect.filled})),()=>[(_(),f(`svg`,Re,[p(`rect`,{x:`3`,y:`3`,style:{rx:`0 !important`,ry:`0 !important`},height:`6`,width:`6`,fill:I.value.rect.filled?(C.value,dn.value+gn.value):`none`,stroke:`currentColor`},null,8,ze)]))],!0),J.value.showTooltips?(_(),u(S,{key:0,show:U.value&&W.value===`setRect`,x:G.value.x,y:G.value.y-6,placement:`top`,styleObject:mn.value},{default:x(()=>[m(b(q.value.translations.tooltipShapeRect)+` `,1),t[60]||=p(`kbd`,null,`S`,-1)]),_:1},8,[`show`,`x`,`y`,`styleObject`])):d(``,!0)],38),C.value===`rect`?(_(),f(`div`,Be,[p(`label`,Ve,[m(b(q.value.translations.filled)+` `,1),be(p(`input`,{type:`checkbox`,"onUpdate:modelValue":t[7]||=e=>I.value.rect.filled=e,onChange:Fr,checked:I.value.rect.filled,style:g({all:`revert`,appearance:`auto`,"-webkit-appearance":`auto`,accentColor:J.value.color+` !important`})},null,44,He),[[_e,I.value.rect.filled]])])])):d(``,!0),p(`button`,{class:h({"button-tool":!0,"button-tool--selected":C.value===`arrow`,tooltip:!0}),style:g(_n(`shapes`,C.value===`arrow`)),onClick:t[8]||=e=>{Ur(`arrow`),k.value=!1},onMouseenter:t[9]||=e=>J.value.showTooltips&&Z(`setArrow`,e,`top`),onMouseleave:Q,onFocus:t[10]||=e=>J.value.showTooltips&&Z(`setArrow`,e,`top`),onBlur:Q},[y(e.$slots,`icon-arrow`,{},()=>[(_(),f(`svg`,Ue,[p(`path`,{stroke:I.value.arrow.filled?C.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,We)]))],!0),J.value.showTooltips?(_(),u(S,{key:0,show:U.value&&W.value===`setArrow`,x:G.value.x,y:G.value.y-6,placement:`top`,styleObject:mn.value},{default:x(()=>[m(b(q.value.translations.tooltipShapeArrow)+` `,1),t[61]||=p(`kbd`,null,`A`,-1)]),_:1},8,[`show`,`x`,`y`,`styleObject`])):d(``,!0)],38),p(`button`,{class:h({"button-tool":!0,"button-tool--selected":C.value===`line`,tooltip:!0}),style:g(_n(`shapes`,C.value===`line`)),onClick:t[11]||=e=>{Ur(`line`),k.value=!1},onMouseenter:t[12]||=e=>J.value.showTooltips&&Z(`setFreehand`,e,`top`),onMouseleave:Q,onFocus:t[13]||=e=>J.value.showTooltips&&Z(`setFreehand`,e,`top`),onBlur:Q},[y(e.$slots,`icon-freehand`,{},()=>[t[62]||=p(`svg`,{width:`80%`,viewBox:`0 0 24 24`,"stroke-width":`2`,stroke:`currentColor`,fill:`none`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[p(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),p(`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?(_(),u(S,{key:0,show:U.value&&W.value===`setFreehand`,x:G.value.x,y:G.value.y-6,placement:`top`,styleObject:mn.value},{default:x(()=>[m(b(q.value.translations.tooltipShapeFreehand)+` `,1),t[63]||=p(`kbd`,null,`L`,-1)]),_:1},8,[`show`,`x`,`y`,`styleObject`])):d(``,!0)],38),[`arrow`,`circle`,`rect`,`line`].includes(C.value)?(_(),f(`div`,Ge,[p(`div`,Ke,[p(`label`,qe,[m(b(q.value.translations.thickness)+` `,1),be(p(`input`,{onFocus:t[14]||=e=>N.value&&K.value.begin(),onBlur:Jn,onChange:Jn,type:`number`,"onUpdate:modelValue":t[15]||=e=>Ot.value=e,onInput:Br,min:1,style:{padding:`0 4px`,width:`40px`,border:`1px solid #dadada`,"border-radius":`3px`}},null,544),[[ve,Ot.value]])])])])):d(``,!0),[`arrow`,`circle`,`rect`].includes(C.value)?(_(),f(`div`,Je,[p(`div`,Ye,[p(`label`,Xe,[m(b(q.value.translations.dashedLines)+` `,1),be(p(`input`,{name:`dashStyle`,type:`checkbox`,"onUpdate:modelValue":t[16]||=e=>Mt.value=e,onChange:Rr,checked:Mt.value,style:g({all:`revert`,appearance:`auto`,"-webkit-appearance":`auto`,accentColor:J.value.color+` !important`})},null,44,Ze),[[_e,Mt.value]])])])])):d(``,!0),p(`button`,{class:h({"button-tool":!0,"button-tool--selected":j.value,tooltip:!0}),style:g(_n(`shapes`,j.value)),onClick:Wr,onMouseenter:t[17]||=e=>J.value.showTooltips&&Z(`setText`,e,`top`),onMouseleave:Q,onFocus:t[18]||=e=>J.value.showTooltips&&Z(`setText`,e,`top`),onBlur:Q},[y(e.$slots,`icon-text`,fe(le({active:j.value})),()=>[ce(te,{name:`text`,stroke:j.value?fn.value.shapes.selected.color:fn.value.shapes.color},null,8,[`stroke`])],!0),J.value.showTooltips?(_(),u(S,{key:0,show:U.value&&W.value===`setText`,x:G.value.x,y:G.value.y-6,placement:`top`,styleObject:mn.value},{default:x(()=>[m(b(q.value.translations.tooltipShapeText)+` `,1),t[64]||=p(`kbd`,null,`T`,-1)]),_:1},8,[`show`,`x`,`y`,`styleObject`])):d(``,!0)],38),j.value?(_(),f(`div`,Qe,[p(`div`,$e,[p(`label`,et,[m(b(q.value.translations.fontSize)+` `,1),be(p(`input`,{onFocus:t[19]||=e=>N.value&&K.value.begin(),onBlur:Jn,onChange:Jn,type:`number`,"onUpdate:modelValue":t[20]||=e=>Zt.value=e,onInput:Vr,style:{padding:`0 4px`,width:`40px`,border:`1px solid #dadada`,"border-radius":`3px`}},null,544),[[ve,Zt.value]])])])])):d(``,!0),j.value?(_(),f(`div`,tt,[p(`button`,{class:h({"button-tool":!0,"button-tool--selected":Xt.value===`start`,tooltip:!0}),style:g(_n(`shapes`,Xt.value===`start`)),onClick:t[21]||=e=>{Xt.value=`start`,or(`start`)},onMouseenter:t[22]||=e=>J.value.showTooltips&&Z(`setAlignStart`,e,`top`),onMouseleave:Q,onFocus:t[23]||=e=>J.value.showTooltips&&Z(`setAlignStart`,e,`top`),onBlur:Q},[y(e.$slots,`icon-text-align-left`,{},()=>[t[65]||=p(`svg`,{width:`80%`,viewBox:`0 0 24 24`,"stroke-width":`2`,stroke:`currentColor`,fill:`none`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[p(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),p(`path`,{d:`M4 6l16 0`}),p(`path`,{d:`M4 12l10 0`}),p(`path`,{d:`M4 18l14 0`})],-1)],!0),J.value.showTooltips?(_(),u(S,{key:0,show:U.value&&W.value===`setAlignStart`,x:G.value.x,y:G.value.y-6,placement:`top`,styleObject:mn.value},{default:x(()=>[m(b(q.value.translations.tooltipShapeTextLeft),1)]),_:1},8,[`show`,`x`,`y`,`styleObject`])):d(``,!0)],38)])):d(``,!0),j.value?(_(),f(`div`,nt,[p(`button`,{class:h({"button-tool":!0,"button-tool--selected":Xt.value===`middle`,tooltip:!0}),style:g(_n(`shapes`,Xt.value===`middle`)),disabled:jt.value,onClick:t[24]||=e=>{Xt.value=`middle`,or(`middle`)},onMouseenter:t[25]||=e=>J.value.showTooltips&&Z(`setAlignMiddle`,e,`top`),onMouseleave:Q,onFocus:t[26]||=e=>J.value.showTooltips&&Z(`setAlignMiddle`,e,`top`),onBlur:Q},[y(e.$slots,`icon-text-align-center`,{},()=>[t[66]||=p(`svg`,{width:`80%`,viewBox:`0 0 24 24`,"stroke-width":`2`,stroke:`currentColor`,fill:`none`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[p(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),p(`path`,{d:`M4 6l16 0`}),p(`path`,{d:`M8 12l8 0`}),p(`path`,{d:`M6 18l12 0`})],-1)],!0),J.value.showTooltips?(_(),u(S,{key:0,show:U.value&&W.value===`setAlignMiddle`,x:G.value.x,y:G.value.y-6,placement:`top`,styleObject:mn.value},{default:x(()=>[m(b(q.value.translations.tooltipShapeTextCenter),1)]),_:1},8,[`show`,`x`,`y`,`styleObject`])):d(``,!0)],46,rt)])):d(``,!0),j.value?(_(),f(`div`,it,[p(`button`,{class:h({"button-tool":!0,"button-tool--selected":Xt.value===`end`,tooltip:!0}),style:g(_n(`shapes`,Xt.value===`end`)),disabled:jt.value,onClick:t[27]||=e=>{Xt.value=`end`,or(`end`)},onMouseenter:t[28]||=e=>J.value.showTooltips&&Z(`setAlignEnd`,e,`top`),onMouseleave:Q,onFocus:t[29]||=e=>J.value.showTooltips&&Z(`setAlignEnd`,e,`top`),onBlur:Q},[y(e.$slots,`icon-text-align-right`,{},()=>[t[67]||=p(`svg`,{width:`80%`,viewBox:`0 0 24 24`,"stroke-width":`2`,stroke:`currentColor`,fill:`none`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[p(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),p(`path`,{d:`M4 6l16 0`}),p(`path`,{d:`M10 12l10 0`}),p(`path`,{d:`M6 18l14 0`})],-1)],!0),J.value.showTooltips?(_(),u(S,{key:0,show:U.value&&W.value===`setAlignEnd`,x:G.value.x,y:G.value.y-6,placement:`top`,styleObject:mn.value},{default:x(()=>[m(b(q.value.translations.tooltipShapeTextRight),1)]),_:1},8,[`show`,`x`,`y`,`styleObject`])):d(``,!0)],46,at)])):d(``,!0),j.value?(_(),f(`div`,ot,[p(`button`,{class:h({"button-tool":!0,"button-tool--selected":jt.value,tooltip:!0}),style:g(_n(`shapes`,jt.value)),onClick:t[30]||=e=>{jt.value=!jt.value,Xt.value=`start`,or(`start`),Vr()},onMouseenter:t[31]||=e=>J.value.showTooltips&&Z(`setBulletMode`,e,`top`),onMouseleave:Q,onFocus:t[32]||=e=>J.value.showTooltips&&Z(`setBulletMode`,e,`top`),onBlur:Q},[y(e.$slots,`icon-text-bullet-points`,{},()=>[t[68]||=p(`svg`,{width:`100%`,viewBox:`0 0 24 24`,"stroke-width":`2`,stroke:`currentColor`,fill:`none`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[p(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),p(`path`,{d:`M9 6l11 0`}),p(`path`,{d:`M9 12l11 0`}),p(`path`,{d:`M9 18l11 0`}),p(`path`,{d:`M5 6l0 .01`}),p(`path`,{d:`M5 12l0 .01`}),p(`path`,{d:`M5 18l0 .01`})],-1)],!0),J.value.showTooltips?(_(),u(S,{key:0,show:U.value&&W.value===`setBulletMode`,x:G.value.x,y:G.value.y-6,placement:`top`,styleObject:mn.value},{default:x(()=>[m(b(q.value.translations.tooltipShapeTextBullet),1)]),_:1},8,[`show`,`x`,`y`,`styleObject`])):d(``,!0)],38)])):d(``,!0),j.value?(_(),f(`div`,st,[p(`button`,{class:h({"button-tool":!0,"button-tool--selected":At.value,tooltip:!0}),style:g(_n(`shapes`,At.value)),onClick:t[33]||=e=>{At.value=!At.value,Vr()},onMouseenter:t[34]||=e=>J.value.showTooltips&&Z(`setBold`,e,`top`),onMouseleave:Q,onFocus:t[35]||=e=>J.value.showTooltips&&Z(`setBold`,e,`top`),onBlur:Q},[y(e.$slots,`icon-text-bold`,{},()=>[t[69]||=p(`svg`,{width:`100%`,viewBox:`0 0 24 24`,"stroke-width":`3`,stroke:`currentColor`,fill:`none`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[p(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),p(`path`,{d:`M7 5h6a3.5 3.5 0 0 1 0 7h-6z`}),p(`path`,{d:`M13 12h1a3.5 3.5 0 0 1 0 7h-7v-7`})],-1)],!0),J.value.showTooltips?(_(),u(S,{key:0,show:U.value&&W.value===`setBold`,x:G.value.x,y:G.value.y-6,placement:`top`,styleObject:mn.value},{default:x(()=>[m(b(q.value.translations.tooltipShapeTextBold),1)]),_:1},8,[`show`,`x`,`y`,`styleObject`])):d(``,!0)],38)])):d(``,!0),j.value?(_(),f(`div`,ct,[p(`button`,{class:h({"button-tool":!0,"button-tool--selected":It.value,tooltip:!0}),style:g(_n(`shapes`,It.value)),onClick:t[36]||=e=>{It.value=!It.value,Vr()},onMouseenter:t[37]||=e=>J.value.showTooltips&&Z(`setItalic`,e,`top`),onMouseleave:Q,onFocus:t[38]||=e=>J.value.showTooltips&&Z(`setItalic`,e,`top`),onBlur:Q},[y(e.$slots,`icon-text-italic`,{},()=>[t[70]||=p(`svg`,{width:`100%`,height:`44`,viewBox:`0 0 24 24`,"stroke-width":`2`,stroke:`currentColor`,fill:`none`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[p(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),p(`path`,{d:`M11 5l6 0`}),p(`path`,{d:`M7 19l6 0`}),p(`path`,{d:`M14 5l-4 14`})],-1)],!0),J.value.showTooltips?(_(),u(S,{key:0,show:U.value&&W.value===`setItalic`,x:G.value.x,y:G.value.y-6,placement:`top`,styleObject:mn.value},{default:x(()=>[m(b(q.value.translations.tooltipShapeTextItalic),1)]),_:1},8,[`show`,`x`,`y`,`styleObject`])):d(``,!0)],38)])):d(``,!0),j.value?(_(),f(`div`,lt,[p(`button`,{class:h({"button-tool":!0,"button-tool--selected":zt.value,tooltip:!0}),style:g(_n(`shapes`,zt.value)),onClick:t[39]||=e=>{zt.value=!zt.value,Vr()},onMouseenter:t[40]||=e=>J.value.showTooltips&&Z(`setUnderline`,e,`top`),onMouseleave:Q,onFocus:t[41]||=e=>J.value.showTooltips&&Z(`setUnderline`,e,`top`),onBlur:Q},[y(e.$slots,`icon-text-underline`,{},()=>[t[71]||=p(`svg`,{width:`100%`,viewBox:`0 0 24 24`,"stroke-width":`2`,stroke:`currentColor`,fill:`none`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[p(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),p(`path`,{d:`M7 5v5a5 5 0 0 0 10 0v-5`}),p(`path`,{d:`M5 19h14`})],-1)],!0),J.value.showTooltips?(_(),u(S,{key:0,show:U.value&&W.value===`setUnderline`,x:G.value.x,y:G.value.y-6,placement:`top`,styleObject:mn.value},{default:x(()=>[m(b(q.value.translations.tooltipShapeTextUnderline),1)]),_:1},8,[`show`,`x`,`y`,`styleObject`])):d(``,!0)],38)])):d(``,!0),p(`div`,ut,[p(`button`,{class:h({"button-tool":!0,tooltip:!0}),style:{borderRadius:`6px`},onMouseenter:t[44]||=e=>J.value.showTooltips&&Z(`setColor`,e,`top`),onMouseleave:Q,onFocus:t[45]||=e=>J.value.showTooltips&&Z(`setColor`,e,`top`),onBlur:Q},[ce(ie,{value:dn.value,"onUpdate:value":[t[42]||=e=>dn.value=e,t[43]||=e=>Lr(e)],backgroundColor:J.value.backgroundColor,buttonBorderColor:J.value.color,isCursorPointer:pn.value,palette:J.value.palette.map(un),teleported:``},{"annotator-action-color":x(({color:t})=>[y(e.$slots,`icon-color`,fe(le({color:t,backgroundColor:dn.value})),void 0,!0)]),_:3},8,[`value`,`backgroundColor`,`buttonBorderColor`,`isCursorPointer`,`palette`])],32),J.value.showTooltips?(_(),u(S,{key:0,show:U.value&&W.value===`setColor`,x:G.value.x,y:G.value.y-6,placement:`top`,styleObject:mn.value},{default:x(()=>[m(b(q.value.translations.tooltipShapeColor),1)]),_:1},8,[`show`,`x`,`y`,`styleObject`])):d(``,!0)]),p(`div`,dt,[p(`label`,ft,[m(b(q.value.translations.colorAlpha)+`: `+b(Qt.value>98?100:Qt.value)+` % `,1),be(p(`input`,{onFocus:t[46]||=e=>N.value&&K.value.begin(),onBlur:Jn,onChange:Jn,name:`colorTransparency`,type:`range`,"onUpdate:modelValue":t[47]||=e=>Qt.value=e,onInput:zr,min:0,max:100,style:g({width:`100%`,accentColor:J.value.color+` !important`})},null,36),[[ve,Qt.value]])])])])])],8,[`to`])):d(``,!0)]),p(`div`,{class:`annotator annotator__wrapper`,ref_key:`drawSvgContainer`,ref:Ar,style:{position:`relative`},id:Tt.value,"data-annotator-content":``},[p(`div`,{class:`annotator__content-layer`,style:g(`${A.value?`pointer-events: none;`:``}`)},[y(e.$slots,`default`,{},void 0,!0)],4),A.value||q.value.alwaysVisible?(_(),f(`svg`,{key:0,id:`annotatorSvg`,ref_key:`mainSvg`,ref:Y,class:h({annotator__overlay:!0,"annotator__overlay--inactive":!A.value,draw:!0,"draw--free":C.value===`line`}),viewBox:`0 0 ${Gt.value} ${Wt.value}`,width:Jt.value,height:Yt.value,onPointerdown:t[51]||=e=>br(e),onPointerup:t[52]||=e=>Pr(e),onPointercancel:Nr,onLostpointercapture:Nr,onTouchend:t[53]||=e=>Pr(e),onTouchstart:t[54]||=e=>Hr(e),onPointermove:t[55]||=e=>wr(e),onPointerout:t[56]||=e=>vr(e),onPointerover:t[57]||=e=>$n(e),onClick:t[58]||=e=>ar(e),style:g({position:`absolute`,top:0,left:0,cursor:xn.value,fontFamily:`Helvetica`,zIndex:1e8,pointerEvents:A.value?`all`:`none`})},[p(`rect`,{class:`annotator__glass`,x:`0`,y:`0`,width:Gt.value,height:Wt.value,fill:`transparent`,"pointer-events":A.value?`all`:`none`,style:{cursor:`inherit`},onPointerdown:t[48]||=xe(e=>br(e),[`stop`,`prevent`]),onPointermove:t[49]||=xe(e=>wr(e),[`stop`,`prevent`]),onPointerup:xe(Pr,[`stop`,`prevent`]),onClick:t[50]||=xe(e=>ar(e),[`stop`,`prevent`])},null,40,ht),(_(!0),f(ae,null,he(Ln.value,e=>(_(),f(`g`,{key:e.id,innerHTML:e.html,style:g({pointerEvents:A.value?null:`none`}),onClick:t=>kr(t,e.id),onDblclick:xe(t=>Or(t,e.id),[`stop`,`prevent`])},null,44,gt))),128)),H.value&&M.value?(_(),f(`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,_t)):d(``,!0)],46,mt)):d(``,!0),Rt.value||ge(Et)?(_(),f(`svg`,{key:1,style:{position:`absolute`,top:`0`,left:`0`},height:Yt.value,viewBox:`0 0 ${Gt.value} ${Wt.value}`,width:Jt.value,"data-dom-to-png-ignore":``},[p(`circle`,{class:`animated-circle-print`,cx:Gt.value/2,cy:Wt.value/2,r:`50`,stroke:`#6376DD`,"stroke-width":`10`,fill:`none`},null,8,yt)],8,vt)):d(``,!0)],8,pt)]))}},[[`__scopeId`,`data-v-6edcc724`]]);export{Te as n,Ct as t};