vue-data-ui 3.28.5 → 3.28.7

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 (159) hide show
  1. package/dist/{PackageVersion-DWlHsdPa.js → PackageVersion-CHQWwTik.js} +1 -1
  2. package/dist/SlicerPreview-D7gm-OsZ.js +1 -0
  3. package/dist/UserOptions-BUXg7qOC.js +1 -0
  4. package/dist/components/vue-ui-3d-bar.js +1 -1
  5. package/dist/components/vue-ui-age-pyramid.js +1 -1
  6. package/dist/components/vue-ui-bullet.js +1 -1
  7. package/dist/components/vue-ui-bump.js +1 -1
  8. package/dist/components/vue-ui-candlestick.js +1 -1
  9. package/dist/components/vue-ui-carousel-table.js +1 -1
  10. package/dist/components/vue-ui-chestnut.js +1 -1
  11. package/dist/components/vue-ui-chord.js +1 -1
  12. package/dist/components/vue-ui-circle-pack.js +1 -1
  13. package/dist/components/vue-ui-cursor.js +1 -1
  14. package/dist/components/vue-ui-dag.js +1 -1
  15. package/dist/components/vue-ui-dashboard.js +1 -1
  16. package/dist/components/vue-ui-digits.js +1 -1
  17. package/dist/components/vue-ui-donut-evolution.js +1 -1
  18. package/dist/components/vue-ui-donut.js +1 -1
  19. package/dist/components/vue-ui-dumbbell.js +1 -1
  20. package/dist/components/vue-ui-flow.js +1 -1
  21. package/dist/components/vue-ui-funnel.js +1 -1
  22. package/dist/components/vue-ui-galaxy.js +1 -1
  23. package/dist/components/vue-ui-gauge.js +1 -1
  24. package/dist/components/vue-ui-geo.js +1 -1
  25. package/dist/components/vue-ui-gizmo.js +1 -1
  26. package/dist/components/vue-ui-graph.js +1 -1
  27. package/dist/components/vue-ui-heatmap.js +1 -1
  28. package/dist/components/vue-ui-hill.js +1 -1
  29. package/dist/components/vue-ui-history-plot.js +1 -1
  30. package/dist/components/vue-ui-horizontal-bar.js +1 -1
  31. package/dist/components/vue-ui-kpi.js +1 -1
  32. package/dist/components/vue-ui-molecule.js +1 -1
  33. package/dist/components/vue-ui-mood-radar.js +1 -1
  34. package/dist/components/vue-ui-nested-donuts.js +1 -1
  35. package/dist/components/vue-ui-onion.js +1 -1
  36. package/dist/components/vue-ui-parallel-coordinate-plot.js +1 -1
  37. package/dist/components/vue-ui-quadrant.js +1 -1
  38. package/dist/components/vue-ui-quick-chart.js +1 -1
  39. package/dist/components/vue-ui-radar.js +1 -1
  40. package/dist/components/vue-ui-relation-circle.js +1 -1
  41. package/dist/components/vue-ui-ridgeline.js +1 -1
  42. package/dist/components/vue-ui-rings.js +1 -1
  43. package/dist/components/vue-ui-scatter.js +1 -1
  44. package/dist/components/vue-ui-skeleton.js +1 -1
  45. package/dist/components/vue-ui-spark-trend.js +1 -1
  46. package/dist/components/vue-ui-sparkbar.js +1 -1
  47. package/dist/components/vue-ui-sparkgauge.js +1 -1
  48. package/dist/components/vue-ui-sparkhistogram.js +1 -1
  49. package/dist/components/vue-ui-sparkline.js +1 -1
  50. package/dist/components/vue-ui-sparkstackbar.js +1 -1
  51. package/dist/components/vue-ui-stackbar.js +1 -1
  52. package/dist/components/vue-ui-stackline.js +1 -1
  53. package/dist/components/vue-ui-strip-plot.js +1 -1
  54. package/dist/components/vue-ui-table-heatmap.js +1 -1
  55. package/dist/components/vue-ui-table-sparkline.js +1 -1
  56. package/dist/components/vue-ui-table.js +1 -1
  57. package/dist/components/vue-ui-thermometer.js +1 -1
  58. package/dist/components/vue-ui-timer.js +1 -1
  59. package/dist/components/vue-ui-tiremarks.js +1 -1
  60. package/dist/components/vue-ui-treemap.js +1 -1
  61. package/dist/components/vue-ui-vertical-bar.js +1 -1
  62. package/dist/components/vue-ui-waffle.js +1 -1
  63. package/dist/components/vue-ui-wheel.js +1 -1
  64. package/dist/components/vue-ui-word-cloud.js +1 -1
  65. package/dist/components/vue-ui-world.js +1 -1
  66. package/dist/components/vue-ui-xy-canvas.js +1 -1
  67. package/dist/components/vue-ui-xy.js +1 -1
  68. package/dist/composables.js +1 -1
  69. package/dist/package-Dbb7W156.js +1 -0
  70. package/dist/{render-common-Dkf3n13B.js → render-common-_8VmVGgq.js} +1 -1
  71. package/dist/ssr/vue-ui-donut.js +1 -1
  72. package/dist/ssr/vue-ui-xy.js +1 -1
  73. package/dist/ssr.js +1 -1
  74. package/dist/style.css +1 -1
  75. package/dist/types/composables.d.ts +51 -0
  76. package/dist/types/vue-data-ui.d.ts +51 -0
  77. package/dist/usePanZoom-CE6Ofyy8.js +1 -0
  78. package/dist/useParentSize-DGkyQ711.js +1 -0
  79. package/dist/vue-data-ui-Bkohx9Cs.js +1 -0
  80. package/dist/vue-data-ui.js +1 -1
  81. package/dist/{vue-ui-3d-bar-Bm-Oe_kr.js → vue-ui-3d-bar-CT0QhtL7.js} +2 -2
  82. package/dist/{vue-ui-age-pyramid-DeN6_pms.js → vue-ui-age-pyramid-CkZqtIdC.js} +1 -1
  83. package/dist/{vue-ui-bullet-CXCjzBCa.js → vue-ui-bullet-DEJJEz65.js} +1 -1
  84. package/dist/{vue-ui-bump-DrphtYb-.js → vue-ui-bump-Bk4KKRas.js} +2 -2
  85. package/dist/vue-ui-candlestick-CLB_sBqP.js +22 -0
  86. package/dist/{vue-ui-carousel-table-D-PSQEuw.js → vue-ui-carousel-table-Uik-OwJI.js} +1 -1
  87. package/dist/{vue-ui-chestnut-BhnQd90d.js → vue-ui-chestnut-y3HrgMF1.js} +1 -1
  88. package/dist/{vue-ui-chord-C6swlh_I.js → vue-ui-chord-B_N2fsWI.js} +1 -1
  89. package/dist/{vue-ui-circle-pack-CXhm9rwh.js → vue-ui-circle-pack-D66Nfd--.js} +1 -1
  90. package/dist/{vue-ui-cursor-CCx0hL1b.js → vue-ui-cursor-Cn4I6C1F.js} +1 -1
  91. package/dist/vue-ui-dag-CDDz8tXx.js +9 -0
  92. package/dist/{vue-ui-dashboard-C2KQNeNt.js → vue-ui-dashboard-B3mEQdok.js} +1 -1
  93. package/dist/{vue-ui-digits-Bcg9Ocwc.js → vue-ui-digits-DD5Ehw6Z.js} +1 -1
  94. package/dist/{vue-ui-donut-CqasvTv0.js → vue-ui-donut-B4RYYl9y.js} +1 -1
  95. package/dist/{vue-ui-donut-CU-L5W3v.js → vue-ui-donut-BD1mPA4G.js} +1 -1
  96. package/dist/{vue-ui-donut-evolution-DgLZRZkG.js → vue-ui-donut-evolution-B8SGQL4s.js} +1 -1
  97. package/dist/{vue-ui-dumbbell-DCYDSSZf.js → vue-ui-dumbbell-BuvzG3Tl.js} +1 -1
  98. package/dist/{vue-ui-flow-BzGZdOi-.js → vue-ui-flow-IowFhHnI.js} +1 -1
  99. package/dist/{vue-ui-funnel-pJc9jVJO.js → vue-ui-funnel-gYtcHX9x.js} +1 -1
  100. package/dist/{vue-ui-galaxy-DHheME5Z.js → vue-ui-galaxy-CnCTZrbX.js} +1 -1
  101. package/dist/{vue-ui-gauge-C4v_qdpm.js → vue-ui-gauge-BKrgEDiX.js} +1 -1
  102. package/dist/{vue-ui-geo-Fras0OVo.js → vue-ui-geo-C-gc9jm2.js} +1 -1
  103. package/dist/{vue-ui-gizmo-Bqea3ZMn.js → vue-ui-gizmo-ByT8Q0Mm.js} +1 -1
  104. package/dist/{vue-ui-graph-BZs3jwhv.js → vue-ui-graph-C5p4Zie1.js} +1 -1
  105. package/dist/{vue-ui-heatmap-2ALnM7Oj.js → vue-ui-heatmap-BEj47GVD.js} +1 -1
  106. package/dist/vue-ui-hill-C10eL0jq.js +1 -0
  107. package/dist/{vue-ui-history-plot-CegRxR-x.js → vue-ui-history-plot-BgnJx2mW.js} +2 -2
  108. package/dist/{vue-ui-horizontal-bar-DuRnq32M.js → vue-ui-horizontal-bar-D1ko4Ir0.js} +1 -1
  109. package/dist/{vue-ui-kpi-DSwSDLcO.js → vue-ui-kpi-w-6ZJ7A1.js} +1 -1
  110. package/dist/vue-ui-molecule-C4xemEWm.js +1 -0
  111. package/dist/{vue-ui-mood-radar-BpDzg6P1.js → vue-ui-mood-radar-Db-Y54f9.js} +1 -1
  112. package/dist/{vue-ui-nested-donuts-CYU90SX-.js → vue-ui-nested-donuts-rcZDqWJr.js} +1 -1
  113. package/dist/{vue-ui-onion-C9Y96_Pe.js → vue-ui-onion-ChgJz_7Y.js} +1 -1
  114. package/dist/{vue-ui-parallel-coordinate-plot-CEX33A1e.js → vue-ui-parallel-coordinate-plot-PI7nplGP.js} +1 -1
  115. package/dist/{vue-ui-quadrant-BzD-dhcs.js → vue-ui-quadrant-BJeocB2S.js} +1 -1
  116. package/dist/{vue-ui-quick-chart-DDXK6KTi.js → vue-ui-quick-chart-C4d0hcRJ.js} +1 -1
  117. package/dist/{vue-ui-radar-fgVruUz1.js → vue-ui-radar-gUERUZrP.js} +1 -1
  118. package/dist/{vue-ui-relation-circle-TA-KH-2J.js → vue-ui-relation-circle-Ci_6Orcb.js} +1 -1
  119. package/dist/{vue-ui-ridgeline-GJ_EyeMs.js → vue-ui-ridgeline-9LPlODqi.js} +1 -1
  120. package/dist/{vue-ui-rings-CQ4CQa-D.js → vue-ui-rings-Ccd4RdGu.js} +1 -1
  121. package/dist/{vue-ui-scatter-ecBr_qgs.js → vue-ui-scatter-BsyczCTX.js} +1 -1
  122. package/dist/{vue-ui-skeleton-BqHwNz2O.js → vue-ui-skeleton-D7PLCXgR.js} +1 -1
  123. package/dist/{vue-ui-spark-trend-DULUucQY.js → vue-ui-spark-trend-DwiVMTjG.js} +1 -1
  124. package/dist/{vue-ui-sparkbar-CUzfk9Y4.js → vue-ui-sparkbar-DO5fcy40.js} +1 -1
  125. package/dist/{vue-ui-sparkgauge-CEYIZNGr.js → vue-ui-sparkgauge-jbsycjzU.js} +1 -1
  126. package/dist/{vue-ui-sparkhistogram-BATfvYil.js → vue-ui-sparkhistogram-BXO6RMNA.js} +1 -1
  127. package/dist/{vue-ui-sparkline-B2jYjPFT.js → vue-ui-sparkline-BwiQOUi0.js} +1 -1
  128. package/dist/{vue-ui-sparkstackbar-CN-Xz72S.js → vue-ui-sparkstackbar-3hDYCDkU.js} +1 -1
  129. package/dist/vue-ui-stackbar-CPb7WvxK.js +29 -0
  130. package/dist/{vue-ui-stackline-BKcbKdrA.js → vue-ui-stackline-Dv2So8hb.js} +1 -1
  131. package/dist/{vue-ui-strip-plot-CKk6MJhD.js → vue-ui-strip-plot-t6XVuFen.js} +1 -1
  132. package/dist/{vue-ui-table-D-jfpSh1.js → vue-ui-table-fYf1nuff.js} +1 -1
  133. package/dist/{vue-ui-table-heatmap-IYPQ7LMg.js → vue-ui-table-heatmap-qU0Mk0US.js} +1 -1
  134. package/dist/{vue-ui-table-sparkline-295WMuHK.js → vue-ui-table-sparkline-EIvf8kjn.js} +1 -1
  135. package/dist/{vue-ui-thermometer-Ccasz0jb.js → vue-ui-thermometer-DrcMnnAa.js} +1 -1
  136. package/dist/{vue-ui-timer-DeTZUIxO.js → vue-ui-timer-Dw7ycl6H.js} +1 -1
  137. package/dist/{vue-ui-tiremarks-DWrBN1nz.js → vue-ui-tiremarks-BHainFYD.js} +1 -1
  138. package/dist/{vue-ui-treemap-D8Se3_RA.js → vue-ui-treemap-B8vm7e8w.js} +1 -1
  139. package/dist/{vue-ui-waffle-BSfHWe_Z.js → vue-ui-waffle-CyoTLAoh.js} +1 -1
  140. package/dist/{vue-ui-wheel-BRaABy8K.js → vue-ui-wheel-TN4hPSqT.js} +1 -1
  141. package/dist/{vue-ui-word-cloud-9YYx_Xrj.js → vue-ui-word-cloud-BOMaVinm.js} +1 -1
  142. package/dist/{vue-ui-world-BmICer9M.js → vue-ui-world-BCzP1m1G.js} +1 -1
  143. package/dist/{vue-ui-xy-D7IJvizz.js → vue-ui-xy-D4R3bhnl.js} +1 -1
  144. package/dist/vue-ui-xy-NkwuuQv8.js +24 -0
  145. package/dist/vue-ui-xy-canvas-D3TCqFzz.js +9 -0
  146. package/package.json +1 -1
  147. package/dist/SlicerPreview-DYuyE9u9.js +0 -1
  148. package/dist/UserOptions-Em_JgDXM.js +0 -1
  149. package/dist/package-CM94W_P5.js +0 -1
  150. package/dist/usePanZoom-BdjP5Suc.js +0 -1
  151. package/dist/useTooltipPosition-aoV8pZZ9.js +0 -1
  152. package/dist/vue-data-ui-B2f_qLvD.js +0 -1
  153. package/dist/vue-ui-candlestick-CAdTTZzx.js +0 -22
  154. package/dist/vue-ui-dag-BNYDTrHG.js +0 -9
  155. package/dist/vue-ui-hill-B8dCg3x5.js +0 -1
  156. package/dist/vue-ui-molecule-DF9I7IDy.js +0 -1
  157. package/dist/vue-ui-stackbar-D9hp_pkz.js +0 -29
  158. package/dist/vue-ui-xy-DYnPKTpK.js +0 -24
  159. package/dist/vue-ui-xy-canvas-CjrbWdJJ.js +0 -9
@@ -1 +1 @@
1
- import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{t}from"./useConfig-D3ZfFSE5.js";import{X as n}from"./lib-rPeBMZrn.js";import{n as r,t as i}from"./useHints-C-TwxM0Y.js";import{t as a}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{t as ee}from"./useNestedProp-DnGoh-XS.js";import{n as te,t as ne}from"./annotationSlots-RvQBEO9-.js";import{n as re,t as ie}from"./userOptionsSlots-DYuo-E5m.js";import{t as ae}from"./usePrinter-DVf3YcG5.js";import{t as oe}from"./useUserOptionState-CXlFnwPv.js";import{t as se}from"./UserOptions-Em_JgDXM.js";import{n as ce}from"./PenAndPaper-r50tK3S4.js";import{Fragment as o,computed as s,createBlock as c,createCommentVNode as l,createElementBlock as u,createElementVNode as d,createSlots as f,defineAsyncComponent as p,guardReactiveProps as m,mergeProps as le,normalizeClass as ue,normalizeProps as de,normalizeStyle as h,openBlock as g,ref as _,renderList as v,renderSlot as y,resolveDynamicComponent as fe,unref as b,useCssVars as pe,watch as x,withCtx as S}from"vue";var C=/* @__PURE__ */ e({default:()=>T}),me=[`id`],he=[`onMousedown`,`onTouchstart`],ge=[`onMousedown`,`onTouchstart`],_e=[`onMousedown`,`onTouchstart`],ve=[`onMousedown`,`onTouchstart`],ye=[`onMousedown`,`onTouchstart`],w=1,T=/*#__PURE__*/ a({__name:`vue-ui-dashboard`,props:{dataset:Array,config:Object},emits:[`change`,`copyAlt`],setup(e,{expose:a,emit:C}){pe(e=>({v21a17f47:Me.value,f4509e1a:Ne.value}));let T={VueDataUi:p(()=>import(`./vue-data-ui-B2f_qLvD.js`).then(e=>e.n)),VueUi3dBar:p(()=>import(`./vue-ui-3d-bar-Bm-Oe_kr.js`).then(e=>e.n)),VueUiAccordion:p(()=>import(`./vue-ui-accordion-D4FHxzsL.js`).then(e=>e.n)),VueUiAgePyramid:p(()=>import(`./vue-ui-age-pyramid-DeN6_pms.js`).then(e=>e.n)),VueUiAnnotator:p(()=>import(`./vue-ui-annotator-DuAQovkf.js`).then(e=>e.n)),VueUiCandlestick:p(()=>import(`./vue-ui-candlestick-CAdTTZzx.js`).then(e=>e.n)),VueUiChestnut:p(()=>import(`./vue-ui-chestnut-BhnQd90d.js`).then(e=>e.n)),VueUiDigits:p(()=>import(`./vue-ui-digits-Bcg9Ocwc.js`).then(e=>e.n)),VueUiDonut:p(()=>import(`./vue-ui-donut-CU-L5W3v.js`).then(e=>e.n)),VueUiDonutEvolution:p(()=>import(`./vue-ui-donut-evolution-DgLZRZkG.js`).then(e=>e.n)),VueUiDumbbell:p(()=>import(`./vue-ui-dumbbell-DCYDSSZf.js`).then(e=>e.n)),VueUiFlow:p(()=>import(`./vue-ui-flow-BzGZdOi-.js`).then(e=>e.n)),VueUiGalaxy:p(()=>import(`./vue-ui-galaxy-DHheME5Z.js`).then(e=>e.n)),VueUiGauge:p(()=>import(`./vue-ui-gauge-C4v_qdpm.js`).then(e=>e.n)),VueUiHeatmap:p(()=>import(`./vue-ui-heatmap-2ALnM7Oj.js`).then(e=>e.n)),VueUiKpi:p(()=>import(`./vue-ui-kpi-DSwSDLcO.js`).then(e=>e.n)),VueUiMiniLoader:p(()=>import(`./vue-ui-mini-loader-C6vhrfx3.js`).then(e=>e.n)),VueUiMolecule:p(()=>import(`./vue-ui-molecule-DF9I7IDy.js`).then(e=>e.n)),VueUiMoodRadar:p(()=>import(`./vue-ui-mood-radar-BpDzg6P1.js`).then(e=>e.n)),VueUiNestedDonuts:p(()=>import(`./vue-ui-nested-donuts-CYU90SX-.js`).then(e=>e.n)),VueUiOnion:p(()=>import(`./vue-ui-onion-C9Y96_Pe.js`).then(e=>e.n)),VueUiParallelCoordinatePlot:p(()=>import(`./vue-ui-parallel-coordinate-plot-CEX33A1e.js`).then(e=>e.n)),VueUiQuadrant:p(()=>import(`./vue-ui-quadrant-BzD-dhcs.js`).then(e=>e.n)),VueUiQuickChart:p(()=>import(`./vue-ui-quick-chart-DDXK6KTi.js`).then(e=>e.n)),VueUiRadar:p(()=>import(`./vue-ui-radar-fgVruUz1.js`).then(e=>e.n)),VueUiRating:p(()=>import(`./vue-ui-rating-7RAJA7I4.js`).then(e=>e.n)),VueUiRelationCircle:p(()=>import(`./vue-ui-relation-circle-TA-KH-2J.js`).then(e=>e.n)),VueUiRings:p(()=>import(`./vue-ui-rings-CQ4CQa-D.js`).then(e=>e.n)),VueUiScatter:p(()=>import(`./vue-ui-scatter-ecBr_qgs.js`).then(e=>e.n)),VueUiSkeleton:p(()=>import(`./vue-ui-skeleton-BqHwNz2O.js`).then(e=>e.n)),VueUiSmiley:p(()=>import(`./vue-ui-smiley-BdhxsPGW.js`).then(e=>e.n)),VueUiSparkHistogram:p(()=>import(`./vue-ui-sparkhistogram-BATfvYil.js`).then(e=>e.n)),VueUiSparkStackbar:p(()=>import(`./vue-ui-sparkstackbar-CN-Xz72S.js`).then(e=>e.n)),VueUiSparkTrend:p(()=>import(`./vue-ui-spark-trend-DULUucQY.js`).then(e=>e.n)),VueUiSparkbar:p(()=>import(`./vue-ui-sparkbar-CUzfk9Y4.js`).then(e=>e.n)),VueUiSparkgauge:p(()=>import(`./vue-ui-sparkgauge-CEYIZNGr.js`).then(e=>e.n)),VueUiSparkline:p(()=>import(`./vue-ui-sparkline-B2jYjPFT.js`).then(e=>e.n)),VueUiStripPlot:p(()=>import(`./vue-ui-strip-plot-CKk6MJhD.js`).then(e=>e.n)),VueUiTable:p(()=>import(`./vue-ui-table-D-jfpSh1.js`).then(e=>e.n)),VueUiTableHeatmap:p(()=>import(`./vue-ui-table-heatmap-IYPQ7LMg.js`).then(e=>e.n)),VueUiTableSparkline:p(()=>import(`./vue-ui-table-sparkline-295WMuHK.js`).then(e=>e.n)),VueUiThermometer:p(()=>import(`./vue-ui-thermometer-Ccasz0jb.js`).then(e=>e.n)),VueUiTimer:p(()=>import(`./vue-ui-timer-DeTZUIxO.js`).then(e=>e.n)),VueUiTiremarks:p(()=>import(`./vue-ui-tiremarks-DWrBN1nz.js`).then(e=>e.n)),VueUiTreemap:p(()=>import(`./vue-ui-treemap-D8Se3_RA.js`).then(e=>e.n)),VueUiVerticalBar:p(()=>import(`./vue-ui-horizontal-bar-DuRnq32M.js`).then(e=>e.n)),VueUiHorizontalBar:p(()=>import(`./vue-ui-horizontal-bar-DuRnq32M.js`).then(e=>e.n)),VueUiWaffle:p(()=>import(`./vue-ui-waffle-BSfHWe_Z.js`).then(e=>e.n)),VueUiWheel:p(()=>import(`./vue-ui-wheel-BRaABy8K.js`).then(e=>e.n)),VueUiWordCloud:p(()=>import(`./vue-ui-word-cloud-9YYx_Xrj.js`).then(e=>e.n)),VueUiXy:p(()=>import(`./vue-ui-xy-DYnPKTpK.js`).then(e=>e.n)),VueUiXyCanvas:p(()=>import(`./vue-ui-xy-canvas-CjrbWdJJ.js`).then(e=>e.n)),VueUiCarouselTable:p(()=>import(`./vue-ui-carousel-table-D-PSQEuw.js`).then(e=>e.n)),VueUiGizmo:p(()=>import(`./vue-ui-gizmo-Bqea3ZMn.js`).then(e=>e.n)),VueUiStackbar:p(()=>import(`./vue-ui-stackbar-D9hp_pkz.js`).then(e=>e.n)),VueUiStackline:p(()=>import(`./vue-ui-stackline-BKcbKdrA.js`).then(e=>e.n)),VueUiBullet:p(()=>import(`./vue-ui-bullet-CXCjzBCa.js`).then(e=>e.n)),VueUiFunnel:p(()=>import(`./vue-ui-funnel-pJc9jVJO.js`).then(e=>e.n)),VueUiHistoryPlot:p(()=>import(`./vue-ui-history-plot-CegRxR-x.js`).then(e=>e.n)),VueUiCirclePack:p(()=>import(`./vue-ui-circle-pack-CXhm9rwh.js`).then(e=>e.n)),VueUiWorld:p(()=>import(`./vue-ui-world-BmICer9M.js`).then(e=>e.n)),VueUiChord:p(()=>import(`./vue-ui-chord-C6swlh_I.js`).then(e=>e.n)),VueUiRidgeline:p(()=>import(`./vue-ui-ridgeline-GJ_EyeMs.js`).then(e=>e.n)),VueUiDag:p(()=>import(`./vue-ui-dag-BNYDTrHG.js`).then(e=>e.n))},{vue_ui_dashboard:be}=t(),xe=_(null),Se=_(null),E=_(null),D=e,O=s(()=>ee({userConfig:D.config,defaultConfig:be}));r({config:()=>O.value,dataset:()=>D.dataset,component:`VueUiDashboard`,rules:[i.noHint]});let k=s(()=>O.value.userOptions.useCursorPointer),A=_(n()),j=_(O.value.locked);function Ce(){j.value=!j.value}x(()=>D.config,()=>{j.value=O.value.locked,Q.value=!O.value.userOptions.showOnChartHover});function M(){return D.dataset.map((e,t)=>({...e,index:t}))}let N=_(M());x(()=>D.dataset,()=>{N.value=M()});let P=s(()=>N.value.map(e=>({...e,resolvedComponent:typeof e.component==`string`?T[e.component]:e.component}))),F=_(null),I=_(null),L=_({x:0,y:0}),R=_({x:0,y:0}),z=_(null),B=_(!1),V=_(null),H=_(!1);function U(e){let t=e.target;(t.tagName===`INPUT`&&t.type===`range`||t.classList.contains(`range-handle`))&&(H.value=!0)}function W(e){let t=e.target;t.tagName===`INPUT`&&t.type===`range`&&(H.value=!1)}let{isPrinting:we,isImaging:Te,generatePdf:G,generateImage:Ee}=ae({elementId:`vue-ui-dashboard_${A.value}`,fileName:O.value.userOptions.print.filename||`dashboard`,options:{...O.value.userOptions.print,aspectRatio:O.value.style.board.aspectRatio}});function De(e){if(!j.value&&(B.value=!0,V.value=e,I.value===null)){F.value=e,L.value={x:event.clientX,y:event.clientY};let t=N.value[e],n=100-t.width,r=100-t.height;t.left<0&&(t.left=0),t.top<0&&(t.top=0),t.left>n&&(t.left=n),t.top>r&&(t.top=r),t.left<0&&(t.left=0),t.top<0&&(t.top=0),t.left+t.width>100&&(t.left=100-t.width),t.top+t.height>100&&(t.top=100-t.height)}}function K(e,t){B.value=!0,V.value=e,I.value={index:e,direction:t};let n=N.value[e];R.value={x:event.clientX,y:event.clientY,initialWidth:n.width,initialHeight:n.height}}function q(e,t,n){if(I.value.direction.includes(`top`)){let t=e.height-n/z.value.offsetHeight*100;t>=w&&(e.top+=n/z.value.offsetHeight*100,e.height=t)}if(I.value.direction.includes(`bottom`)){let t=e.height+n/z.value.offsetHeight*100;t>=w&&(e.height=t)}if(I.value.direction.includes(`left`)){let n=e.width-t/z.value.offsetWidth*100;n>=w&&(e.left+=t/z.value.offsetWidth*100,e.width=n)}if(I.value.direction.includes(`right`)){let n=e.width+t/z.value.offsetWidth*100;n>=w&&(e.width=n)}}function Oe(e){if(!(j.value||H.value)){if(B.value=!0,F.value!==null){let t=N.value[F.value],n=e.clientX-L.value.x,r=e.clientY-L.value.y,i=t.left+n/z.value.offsetWidth*100,a=t.top+r/z.value.offsetHeight*100;i>=0&&a>=0&&i+t.width<=100&&a+t.height<=100&&(t.left=i,t.top=a),L.value={x:e.clientX,y:e.clientY}}if(I.value!==null){let t=N.value[I.value.index];q(t,e.clientX-R.value.x,e.clientY-R.value.y),R.value={x:e.clientX,y:e.clientY}}}}let J=C;x(N,e=>{e&&!B.value&&J(`change`,N.value)},{deep:!0});function ke(){F.value=null,I.value=null,B.value=!1,V.value=null,N.value.forEach(e=>{e.left=Math.round(e.left/100*100),e.top=Math.round(e.top/100*100),e.width=Math.round(e.width/100*100),e.height=Math.round(e.height/100*100)})}function Ae(e){j.value||H.value||(B.value=!0,V.value=e,I.value===null&&(F.value=e,L.value={x:event.touches[0].clientX,y:event.touches[0].clientY}))}function Y(e,t,n){if(B.value=!0,V.value=e,I.value===null){I.value={index:e,direction:t};let r=N.value[e];R.value={x:n.touches[0].clientX,y:n.touches[0].clientY,initialWidth:r.width,initialHeight:r.height}}}function X(e){if(B.value=!0,e.preventDefault(),I.value!==null){let t=N.value[I.value.index];q(t,e.touches[0].clientX-R.value.x,e.touches[0].clientY-R.value.y),R.value={x:e.touches[0].clientX,y:e.touches[0].clientY}}}function je(e){if(!(j.value||H.value)&&(B.value=!0,e.preventDefault(),F.value!==null)){let t=N.value[F.value],n=e.touches[0].clientX-L.value.x,r=e.touches[0].clientY-L.value.y,i=t.left+n/z.value.offsetWidth*100,a=t.top+r/z.value.offsetHeight*100;i>=0&&a>=0&&i+t.width<=100&&a+t.height<=100&&(t.left=i,t.top=a),L.value={x:e.touches[0].clientX,y:e.touches[0].clientY}}}function Z(){B.value=!1,V.value=null,F.value=null,I.value=null,N.value.forEach(e=>{e.left=Math.round(e.left/100*100),e.top=Math.round(e.top/100*100),e.width=Math.round(e.width/100*100),e.height=Math.round(e.height/100*100)})}let Me=s(()=>O.value.style.item.borderColor),Ne=s(()=>O.value.style.resizeHandles.backgroundColor),Pe=s(()=>O.value.style.board.aspectRatio),Fe=s(()=>O.value.style.board.backgroundColor),Ie=s(()=>O.value.style.board.border);function Le(){return N.value}let{userOptionsVisible:Q,setUserOptionsVisibility:Re,keepUserOptionState:ze}=oe({config:O.value}),$=_(!1);function Be(){$.value=!$.value}function Ve(){Re(!0)}function He(){Re(!1)}async function Ue(){J(`copyAlt`,{config:O.value,dataset:P.value}),O.value.userOptions.callbacks.altCopy?await Promise.resolve(O.value.userOptions.callbacks.altCopy({config:O.value,dataset:P.value})):console.warn("Vue Data UI - A callback must be set for `altCopy` in userOptions.")}return a({generatePdf:G,getItemsPositions:Le,toggleLock:Ce,copyAlt:Ue}),(e,t)=>(g(),u(`div`,{id:`vue-ui-dashboard_${A.value}`,onMousedown:U,onMouseup:W,onTouchstart:U,onTouchend:W,onMouseenter:Ve,onMouseleave:He,ref_key:`dashboardRef`,ref:xe,style:{position:`relative`},class:`vue-data-ui-component`},[d(`div`,{class:`vue-ui-dashboard-container`,ref_key:`dashboardContainer`,ref:z,style:h(`outline:${Ie.value}; background:${Fe.value}; aspect-ratio:${Pe.value};${$.value?`pointer-events:none`:``}`)},[d(`div`,{class:`vue-ui-dashboard-grid-container`,ref:`container`,onMousemove:Oe,onMouseup:ke,onTouchmove:je,onTouchend:Z,style:h(`background:${O.value.style.board.backgroundColor}`)},[t[4]||=d(`div`,{class:`vue-ui-dashboard-grid`},null,-1),(g(!0),u(o,null,v(P.value,(n,r)=>(g(),u(`div`,{key:n.id,class:ue({"vue-ui-dashboard-grid-item":!0,"vue-ui-dashboard-grid-item--locked":j.value}),style:h({width:`${n.width}%`,height:`${n.height}%`,left:`${n.left}%`,top:`${n.top}%`,cursor:`move`,boxShadow:V.value===r?`0 6px 12px -3px rgba(0,0,0,0.3)`:``,zIndex:V.value===r?P.value.length+1:n.index,backgroundColor:O.value.style.item.backgroundColor}),onMousedown:e=>De(r),onTouchstart:e=>Ae(r,n)},[j.value?l(``,!0):(g(),u(o,{key:0},[d(`div`,{class:`vue-ui-dashboard-resize-handle vue-ui-dashboard-top-left`,onMousedown:e=>K(r,`top-left`),onTouchstart:e=>Y(r,`top-left`,e),onTouchmove:t[0]||=e=>X(e),onTouchend:Z},null,40,ge),d(`div`,{class:`vue-ui-dashboard-resize-handle vue-ui-dashboard-top-right`,onMousedown:e=>K(r,`top-right`),onTouchstart:e=>Y(r,`top-right`,e),onTouchmove:t[1]||=e=>X(e),onTouchend:Z},null,40,_e),d(`div`,{class:`vue-ui-dashboard-resize-handle vue-ui-dashboard-bottom-left`,onMousedown:e=>K(r,`bottom-left`),onTouchstart:e=>Y(r,`bottom-left`,e),onTouchmove:t[2]||=e=>X(e),onTouchend:Z},null,40,ve),d(`div`,{class:`vue-ui-dashboard-resize-handle vue-ui-dashboard-bottom-right`,onMousedown:e=>K(r,`bottom-right`),onTouchstart:e=>Y(r,`bottom-right`,e),onTouchmove:t[3]||=e=>X(e),onTouchend:Z},null,40,ye)],64)),y(e.$slots,`top`,{item:n,index:r},void 0,!0),n.resolvedComponent?(g(),c(fe(n.resolvedComponent),le({key:1,ref_for:!0},n.props),null,16)):y(e.$slots,`content`,{item:n,index:r,left:n.left,top:n.top,height:n.height,width:n.width},void 0,!0,2),y(e.$slots,`bottom`,{item:n,index:r},void 0,!0)],46,he))),128))],36)],4),(g(),u(`svg`,{style:h({width:`100%`,height:`100%`,pointerEvents:`none`,position:`absolute`,top:0,left:0,zIndex:P.value.length+1}),ref_key:`svgRef`,ref:E},null,4)),O.value.userOptions.buttons.annotator&&z.value&&E.value?(g(),c(ce,{key:0,showGroupActions:O.value.userOptions.annotator?.showGroupActions??!0,color:O.value.style.board.color,backgroundColor:O.value.style.board.backgroundColor,active:$.value,svgRef:E.value,isCursorPointer:k.value,onClose:Be,style:h({zIndex:P.value.length+1}),palette:O.value.userOptions.annotatorPalette},f({_:2},[v(b(ne),t=>({name:t,fn:S(n=>[y(e.$slots,t,de(m(b(te)(t,n))),void 0,!0)])}))]),1032,[`showGroupActions`,`color`,`backgroundColor`,`active`,`svgRef`,`isCursorPointer`,`style`,`palette`])):l(``,!0),(O.value.allowPrint||O.value.userOptions.show)&&(O.value.userOptions.buttons.pdf||O.value.userOptions.buttons.img)?(g(),c(se,{key:1,ref_key:`userOptionsRef`,ref:Se,backgroundColor:O.value.style.board.backgroundColor,color:O.value.style.board.color,isPrinting:b(we),isImaging:b(Te),uid:A.value,position:O.value.userOptions.position,hasTooltip:!1,hasPdf:O.value.userOptions.buttons.pdf,hasImg:O.value.userOptions.buttons.img,hasXls:!1,hasTable:!1,hasLabel:!1,hasFullscreen:!1,hasAltCopy:O.value.userOptions.buttons.altCopy,chartElement:z.value,callbacks:O.value.userOptions.callbacks,hasAnnotator:O.value.userOptions.buttons.annotator,isAnnotation:$.value,printScale:O.value.userOptions.print.scale,titles:{...O.value.userOptions.buttonTitles},isCursorPointer:k.value,onGeneratePdf:b(G),onGenerateImage:b(Ee),onToggleAnnotator:Be,onCopyAlt:Ue,style:h({visibility:b(ze)?b(Q)?`visible`:`hidden`:`visible`,zIndex:P.value.length+1})},f({_:2},[v(b(re)(e.$slots,`menuIcon optionPdf optionImg optionAnnotator optionAltCopy custom-menu-before custom-menu-after`),t=>({name:t,fn:S(n=>[y(e.$slots,t,de(m(b(ie)(t,n))),void 0,!0)])}))]),1032,[`backgroundColor`,`color`,`isPrinting`,`isImaging`,`uid`,`position`,`hasPdf`,`hasImg`,`hasAltCopy`,`chartElement`,`callbacks`,`hasAnnotator`,`isAnnotation`,`printScale`,`titles`,`isCursorPointer`,`onGeneratePdf`,`onGenerateImage`,`style`])):l(``,!0)],40,me))}},[[`__scopeId`,`data-v-97ad65a3`]]);export{C as n,T as t};
1
+ import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{t}from"./useConfig-D3ZfFSE5.js";import{X as n}from"./lib-rPeBMZrn.js";import{n as r,t as i}from"./useHints-C-TwxM0Y.js";import{t as a}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{t as ee}from"./useNestedProp-DnGoh-XS.js";import{n as te,t as ne}from"./annotationSlots-RvQBEO9-.js";import{n as re,t as ie}from"./userOptionsSlots-DYuo-E5m.js";import{t as ae}from"./usePrinter-DVf3YcG5.js";import{t as oe}from"./useUserOptionState-CXlFnwPv.js";import{t as se}from"./UserOptions-BUXg7qOC.js";import{n as ce}from"./PenAndPaper-r50tK3S4.js";import{Fragment as o,computed as s,createBlock as c,createCommentVNode as l,createElementBlock as u,createElementVNode as d,createSlots as f,defineAsyncComponent as p,guardReactiveProps as m,mergeProps as le,normalizeClass as ue,normalizeProps as de,normalizeStyle as h,openBlock as g,ref as _,renderList as v,renderSlot as y,resolveDynamicComponent as fe,unref as b,useCssVars as pe,watch as x,withCtx as S}from"vue";var C=/* @__PURE__ */ e({default:()=>T}),me=[`id`],he=[`onMousedown`,`onTouchstart`],ge=[`onMousedown`,`onTouchstart`],_e=[`onMousedown`,`onTouchstart`],ve=[`onMousedown`,`onTouchstart`],ye=[`onMousedown`,`onTouchstart`],w=1,T=/*#__PURE__*/ a({__name:`vue-ui-dashboard`,props:{dataset:Array,config:Object},emits:[`change`,`copyAlt`],setup(e,{expose:a,emit:C}){pe(e=>({v21a17f47:Me.value,f4509e1a:Ne.value}));let T={VueDataUi:p(()=>import(`./vue-data-ui-Bkohx9Cs.js`).then(e=>e.n)),VueUi3dBar:p(()=>import(`./vue-ui-3d-bar-CT0QhtL7.js`).then(e=>e.n)),VueUiAccordion:p(()=>import(`./vue-ui-accordion-D4FHxzsL.js`).then(e=>e.n)),VueUiAgePyramid:p(()=>import(`./vue-ui-age-pyramid-CkZqtIdC.js`).then(e=>e.n)),VueUiAnnotator:p(()=>import(`./vue-ui-annotator-DuAQovkf.js`).then(e=>e.n)),VueUiCandlestick:p(()=>import(`./vue-ui-candlestick-CLB_sBqP.js`).then(e=>e.n)),VueUiChestnut:p(()=>import(`./vue-ui-chestnut-y3HrgMF1.js`).then(e=>e.n)),VueUiDigits:p(()=>import(`./vue-ui-digits-DD5Ehw6Z.js`).then(e=>e.n)),VueUiDonut:p(()=>import(`./vue-ui-donut-BD1mPA4G.js`).then(e=>e.n)),VueUiDonutEvolution:p(()=>import(`./vue-ui-donut-evolution-B8SGQL4s.js`).then(e=>e.n)),VueUiDumbbell:p(()=>import(`./vue-ui-dumbbell-BuvzG3Tl.js`).then(e=>e.n)),VueUiFlow:p(()=>import(`./vue-ui-flow-IowFhHnI.js`).then(e=>e.n)),VueUiGalaxy:p(()=>import(`./vue-ui-galaxy-CnCTZrbX.js`).then(e=>e.n)),VueUiGauge:p(()=>import(`./vue-ui-gauge-BKrgEDiX.js`).then(e=>e.n)),VueUiHeatmap:p(()=>import(`./vue-ui-heatmap-BEj47GVD.js`).then(e=>e.n)),VueUiKpi:p(()=>import(`./vue-ui-kpi-w-6ZJ7A1.js`).then(e=>e.n)),VueUiMiniLoader:p(()=>import(`./vue-ui-mini-loader-C6vhrfx3.js`).then(e=>e.n)),VueUiMolecule:p(()=>import(`./vue-ui-molecule-C4xemEWm.js`).then(e=>e.n)),VueUiMoodRadar:p(()=>import(`./vue-ui-mood-radar-Db-Y54f9.js`).then(e=>e.n)),VueUiNestedDonuts:p(()=>import(`./vue-ui-nested-donuts-rcZDqWJr.js`).then(e=>e.n)),VueUiOnion:p(()=>import(`./vue-ui-onion-ChgJz_7Y.js`).then(e=>e.n)),VueUiParallelCoordinatePlot:p(()=>import(`./vue-ui-parallel-coordinate-plot-PI7nplGP.js`).then(e=>e.n)),VueUiQuadrant:p(()=>import(`./vue-ui-quadrant-BJeocB2S.js`).then(e=>e.n)),VueUiQuickChart:p(()=>import(`./vue-ui-quick-chart-C4d0hcRJ.js`).then(e=>e.n)),VueUiRadar:p(()=>import(`./vue-ui-radar-gUERUZrP.js`).then(e=>e.n)),VueUiRating:p(()=>import(`./vue-ui-rating-7RAJA7I4.js`).then(e=>e.n)),VueUiRelationCircle:p(()=>import(`./vue-ui-relation-circle-Ci_6Orcb.js`).then(e=>e.n)),VueUiRings:p(()=>import(`./vue-ui-rings-Ccd4RdGu.js`).then(e=>e.n)),VueUiScatter:p(()=>import(`./vue-ui-scatter-BsyczCTX.js`).then(e=>e.n)),VueUiSkeleton:p(()=>import(`./vue-ui-skeleton-D7PLCXgR.js`).then(e=>e.n)),VueUiSmiley:p(()=>import(`./vue-ui-smiley-BdhxsPGW.js`).then(e=>e.n)),VueUiSparkHistogram:p(()=>import(`./vue-ui-sparkhistogram-BXO6RMNA.js`).then(e=>e.n)),VueUiSparkStackbar:p(()=>import(`./vue-ui-sparkstackbar-3hDYCDkU.js`).then(e=>e.n)),VueUiSparkTrend:p(()=>import(`./vue-ui-spark-trend-DwiVMTjG.js`).then(e=>e.n)),VueUiSparkbar:p(()=>import(`./vue-ui-sparkbar-DO5fcy40.js`).then(e=>e.n)),VueUiSparkgauge:p(()=>import(`./vue-ui-sparkgauge-jbsycjzU.js`).then(e=>e.n)),VueUiSparkline:p(()=>import(`./vue-ui-sparkline-BwiQOUi0.js`).then(e=>e.n)),VueUiStripPlot:p(()=>import(`./vue-ui-strip-plot-t6XVuFen.js`).then(e=>e.n)),VueUiTable:p(()=>import(`./vue-ui-table-fYf1nuff.js`).then(e=>e.n)),VueUiTableHeatmap:p(()=>import(`./vue-ui-table-heatmap-qU0Mk0US.js`).then(e=>e.n)),VueUiTableSparkline:p(()=>import(`./vue-ui-table-sparkline-EIvf8kjn.js`).then(e=>e.n)),VueUiThermometer:p(()=>import(`./vue-ui-thermometer-DrcMnnAa.js`).then(e=>e.n)),VueUiTimer:p(()=>import(`./vue-ui-timer-Dw7ycl6H.js`).then(e=>e.n)),VueUiTiremarks:p(()=>import(`./vue-ui-tiremarks-BHainFYD.js`).then(e=>e.n)),VueUiTreemap:p(()=>import(`./vue-ui-treemap-B8vm7e8w.js`).then(e=>e.n)),VueUiVerticalBar:p(()=>import(`./vue-ui-horizontal-bar-D1ko4Ir0.js`).then(e=>e.n)),VueUiHorizontalBar:p(()=>import(`./vue-ui-horizontal-bar-D1ko4Ir0.js`).then(e=>e.n)),VueUiWaffle:p(()=>import(`./vue-ui-waffle-CyoTLAoh.js`).then(e=>e.n)),VueUiWheel:p(()=>import(`./vue-ui-wheel-TN4hPSqT.js`).then(e=>e.n)),VueUiWordCloud:p(()=>import(`./vue-ui-word-cloud-BOMaVinm.js`).then(e=>e.n)),VueUiXy:p(()=>import(`./vue-ui-xy-NkwuuQv8.js`).then(e=>e.n)),VueUiXyCanvas:p(()=>import(`./vue-ui-xy-canvas-D3TCqFzz.js`).then(e=>e.n)),VueUiCarouselTable:p(()=>import(`./vue-ui-carousel-table-Uik-OwJI.js`).then(e=>e.n)),VueUiGizmo:p(()=>import(`./vue-ui-gizmo-ByT8Q0Mm.js`).then(e=>e.n)),VueUiStackbar:p(()=>import(`./vue-ui-stackbar-CPb7WvxK.js`).then(e=>e.n)),VueUiStackline:p(()=>import(`./vue-ui-stackline-Dv2So8hb.js`).then(e=>e.n)),VueUiBullet:p(()=>import(`./vue-ui-bullet-DEJJEz65.js`).then(e=>e.n)),VueUiFunnel:p(()=>import(`./vue-ui-funnel-gYtcHX9x.js`).then(e=>e.n)),VueUiHistoryPlot:p(()=>import(`./vue-ui-history-plot-BgnJx2mW.js`).then(e=>e.n)),VueUiCirclePack:p(()=>import(`./vue-ui-circle-pack-D66Nfd--.js`).then(e=>e.n)),VueUiWorld:p(()=>import(`./vue-ui-world-BCzP1m1G.js`).then(e=>e.n)),VueUiChord:p(()=>import(`./vue-ui-chord-B_N2fsWI.js`).then(e=>e.n)),VueUiRidgeline:p(()=>import(`./vue-ui-ridgeline-9LPlODqi.js`).then(e=>e.n)),VueUiDag:p(()=>import(`./vue-ui-dag-CDDz8tXx.js`).then(e=>e.n))},{vue_ui_dashboard:be}=t(),xe=_(null),Se=_(null),E=_(null),D=e,O=s(()=>ee({userConfig:D.config,defaultConfig:be}));r({config:()=>O.value,dataset:()=>D.dataset,component:`VueUiDashboard`,rules:[i.noHint]});let k=s(()=>O.value.userOptions.useCursorPointer),A=_(n()),j=_(O.value.locked);function Ce(){j.value=!j.value}x(()=>D.config,()=>{j.value=O.value.locked,Q.value=!O.value.userOptions.showOnChartHover});function M(){return D.dataset.map((e,t)=>({...e,index:t}))}let N=_(M());x(()=>D.dataset,()=>{N.value=M()});let P=s(()=>N.value.map(e=>({...e,resolvedComponent:typeof e.component==`string`?T[e.component]:e.component}))),F=_(null),I=_(null),L=_({x:0,y:0}),R=_({x:0,y:0}),z=_(null),B=_(!1),V=_(null),H=_(!1);function U(e){let t=e.target;(t.tagName===`INPUT`&&t.type===`range`||t.classList.contains(`range-handle`))&&(H.value=!0)}function W(e){let t=e.target;t.tagName===`INPUT`&&t.type===`range`&&(H.value=!1)}let{isPrinting:we,isImaging:Te,generatePdf:G,generateImage:Ee}=ae({elementId:`vue-ui-dashboard_${A.value}`,fileName:O.value.userOptions.print.filename||`dashboard`,options:{...O.value.userOptions.print,aspectRatio:O.value.style.board.aspectRatio}});function De(e){if(!j.value&&(B.value=!0,V.value=e,I.value===null)){F.value=e,L.value={x:event.clientX,y:event.clientY};let t=N.value[e],n=100-t.width,r=100-t.height;t.left<0&&(t.left=0),t.top<0&&(t.top=0),t.left>n&&(t.left=n),t.top>r&&(t.top=r),t.left<0&&(t.left=0),t.top<0&&(t.top=0),t.left+t.width>100&&(t.left=100-t.width),t.top+t.height>100&&(t.top=100-t.height)}}function K(e,t){B.value=!0,V.value=e,I.value={index:e,direction:t};let n=N.value[e];R.value={x:event.clientX,y:event.clientY,initialWidth:n.width,initialHeight:n.height}}function q(e,t,n){if(I.value.direction.includes(`top`)){let t=e.height-n/z.value.offsetHeight*100;t>=w&&(e.top+=n/z.value.offsetHeight*100,e.height=t)}if(I.value.direction.includes(`bottom`)){let t=e.height+n/z.value.offsetHeight*100;t>=w&&(e.height=t)}if(I.value.direction.includes(`left`)){let n=e.width-t/z.value.offsetWidth*100;n>=w&&(e.left+=t/z.value.offsetWidth*100,e.width=n)}if(I.value.direction.includes(`right`)){let n=e.width+t/z.value.offsetWidth*100;n>=w&&(e.width=n)}}function Oe(e){if(!(j.value||H.value)){if(B.value=!0,F.value!==null){let t=N.value[F.value],n=e.clientX-L.value.x,r=e.clientY-L.value.y,i=t.left+n/z.value.offsetWidth*100,a=t.top+r/z.value.offsetHeight*100;i>=0&&a>=0&&i+t.width<=100&&a+t.height<=100&&(t.left=i,t.top=a),L.value={x:e.clientX,y:e.clientY}}if(I.value!==null){let t=N.value[I.value.index];q(t,e.clientX-R.value.x,e.clientY-R.value.y),R.value={x:e.clientX,y:e.clientY}}}}let J=C;x(N,e=>{e&&!B.value&&J(`change`,N.value)},{deep:!0});function ke(){F.value=null,I.value=null,B.value=!1,V.value=null,N.value.forEach(e=>{e.left=Math.round(e.left/100*100),e.top=Math.round(e.top/100*100),e.width=Math.round(e.width/100*100),e.height=Math.round(e.height/100*100)})}function Ae(e){j.value||H.value||(B.value=!0,V.value=e,I.value===null&&(F.value=e,L.value={x:event.touches[0].clientX,y:event.touches[0].clientY}))}function Y(e,t,n){if(B.value=!0,V.value=e,I.value===null){I.value={index:e,direction:t};let r=N.value[e];R.value={x:n.touches[0].clientX,y:n.touches[0].clientY,initialWidth:r.width,initialHeight:r.height}}}function X(e){if(B.value=!0,e.preventDefault(),I.value!==null){let t=N.value[I.value.index];q(t,e.touches[0].clientX-R.value.x,e.touches[0].clientY-R.value.y),R.value={x:e.touches[0].clientX,y:e.touches[0].clientY}}}function je(e){if(!(j.value||H.value)&&(B.value=!0,e.preventDefault(),F.value!==null)){let t=N.value[F.value],n=e.touches[0].clientX-L.value.x,r=e.touches[0].clientY-L.value.y,i=t.left+n/z.value.offsetWidth*100,a=t.top+r/z.value.offsetHeight*100;i>=0&&a>=0&&i+t.width<=100&&a+t.height<=100&&(t.left=i,t.top=a),L.value={x:e.touches[0].clientX,y:e.touches[0].clientY}}}function Z(){B.value=!1,V.value=null,F.value=null,I.value=null,N.value.forEach(e=>{e.left=Math.round(e.left/100*100),e.top=Math.round(e.top/100*100),e.width=Math.round(e.width/100*100),e.height=Math.round(e.height/100*100)})}let Me=s(()=>O.value.style.item.borderColor),Ne=s(()=>O.value.style.resizeHandles.backgroundColor),Pe=s(()=>O.value.style.board.aspectRatio),Fe=s(()=>O.value.style.board.backgroundColor),Ie=s(()=>O.value.style.board.border);function Le(){return N.value}let{userOptionsVisible:Q,setUserOptionsVisibility:Re,keepUserOptionState:ze}=oe({config:O.value}),$=_(!1);function Be(){$.value=!$.value}function Ve(){Re(!0)}function He(){Re(!1)}async function Ue(){J(`copyAlt`,{config:O.value,dataset:P.value}),O.value.userOptions.callbacks.altCopy?await Promise.resolve(O.value.userOptions.callbacks.altCopy({config:O.value,dataset:P.value})):console.warn("Vue Data UI - A callback must be set for `altCopy` in userOptions.")}return a({generatePdf:G,getItemsPositions:Le,toggleLock:Ce,copyAlt:Ue}),(e,t)=>(g(),u(`div`,{id:`vue-ui-dashboard_${A.value}`,onMousedown:U,onMouseup:W,onTouchstart:U,onTouchend:W,onMouseenter:Ve,onMouseleave:He,ref_key:`dashboardRef`,ref:xe,style:{position:`relative`},class:`vue-data-ui-component`},[d(`div`,{class:`vue-ui-dashboard-container`,ref_key:`dashboardContainer`,ref:z,style:h(`outline:${Ie.value}; background:${Fe.value}; aspect-ratio:${Pe.value};${$.value?`pointer-events:none`:``}`)},[d(`div`,{class:`vue-ui-dashboard-grid-container`,ref:`container`,onMousemove:Oe,onMouseup:ke,onTouchmove:je,onTouchend:Z,style:h(`background:${O.value.style.board.backgroundColor}`)},[t[4]||=d(`div`,{class:`vue-ui-dashboard-grid`},null,-1),(g(!0),u(o,null,v(P.value,(n,r)=>(g(),u(`div`,{key:n.id,class:ue({"vue-ui-dashboard-grid-item":!0,"vue-ui-dashboard-grid-item--locked":j.value}),style:h({width:`${n.width}%`,height:`${n.height}%`,left:`${n.left}%`,top:`${n.top}%`,cursor:`move`,boxShadow:V.value===r?`0 6px 12px -3px rgba(0,0,0,0.3)`:``,zIndex:V.value===r?P.value.length+1:n.index,backgroundColor:O.value.style.item.backgroundColor}),onMousedown:e=>De(r),onTouchstart:e=>Ae(r,n)},[j.value?l(``,!0):(g(),u(o,{key:0},[d(`div`,{class:`vue-ui-dashboard-resize-handle vue-ui-dashboard-top-left`,onMousedown:e=>K(r,`top-left`),onTouchstart:e=>Y(r,`top-left`,e),onTouchmove:t[0]||=e=>X(e),onTouchend:Z},null,40,ge),d(`div`,{class:`vue-ui-dashboard-resize-handle vue-ui-dashboard-top-right`,onMousedown:e=>K(r,`top-right`),onTouchstart:e=>Y(r,`top-right`,e),onTouchmove:t[1]||=e=>X(e),onTouchend:Z},null,40,_e),d(`div`,{class:`vue-ui-dashboard-resize-handle vue-ui-dashboard-bottom-left`,onMousedown:e=>K(r,`bottom-left`),onTouchstart:e=>Y(r,`bottom-left`,e),onTouchmove:t[2]||=e=>X(e),onTouchend:Z},null,40,ve),d(`div`,{class:`vue-ui-dashboard-resize-handle vue-ui-dashboard-bottom-right`,onMousedown:e=>K(r,`bottom-right`),onTouchstart:e=>Y(r,`bottom-right`,e),onTouchmove:t[3]||=e=>X(e),onTouchend:Z},null,40,ye)],64)),y(e.$slots,`top`,{item:n,index:r},void 0,!0),n.resolvedComponent?(g(),c(fe(n.resolvedComponent),le({key:1,ref_for:!0},n.props),null,16)):y(e.$slots,`content`,{item:n,index:r,left:n.left,top:n.top,height:n.height,width:n.width},void 0,!0,2),y(e.$slots,`bottom`,{item:n,index:r},void 0,!0)],46,he))),128))],36)],4),(g(),u(`svg`,{style:h({width:`100%`,height:`100%`,pointerEvents:`none`,position:`absolute`,top:0,left:0,zIndex:P.value.length+1}),ref_key:`svgRef`,ref:E},null,4)),O.value.userOptions.buttons.annotator&&z.value&&E.value?(g(),c(ce,{key:0,showGroupActions:O.value.userOptions.annotator?.showGroupActions??!0,color:O.value.style.board.color,backgroundColor:O.value.style.board.backgroundColor,active:$.value,svgRef:E.value,isCursorPointer:k.value,onClose:Be,style:h({zIndex:P.value.length+1}),palette:O.value.userOptions.annotatorPalette},f({_:2},[v(b(ne),t=>({name:t,fn:S(n=>[y(e.$slots,t,de(m(b(te)(t,n))),void 0,!0)])}))]),1032,[`showGroupActions`,`color`,`backgroundColor`,`active`,`svgRef`,`isCursorPointer`,`style`,`palette`])):l(``,!0),(O.value.allowPrint||O.value.userOptions.show)&&(O.value.userOptions.buttons.pdf||O.value.userOptions.buttons.img)?(g(),c(se,{key:1,ref_key:`userOptionsRef`,ref:Se,backgroundColor:O.value.style.board.backgroundColor,color:O.value.style.board.color,isPrinting:b(we),isImaging:b(Te),uid:A.value,position:O.value.userOptions.position,hasTooltip:!1,hasPdf:O.value.userOptions.buttons.pdf,hasImg:O.value.userOptions.buttons.img,hasXls:!1,hasTable:!1,hasLabel:!1,hasFullscreen:!1,hasAltCopy:O.value.userOptions.buttons.altCopy,chartElement:z.value,callbacks:O.value.userOptions.callbacks,hasAnnotator:O.value.userOptions.buttons.annotator,isAnnotation:$.value,printScale:O.value.userOptions.print.scale,titles:{...O.value.userOptions.buttonTitles},isCursorPointer:k.value,onGeneratePdf:b(G),onGenerateImage:b(Ee),onToggleAnnotator:Be,onCopyAlt:Ue,style:h({visibility:b(ze)?b(Q)?`visible`:`hidden`:`visible`,zIndex:P.value.length+1})},f({_:2},[v(b(re)(e.$slots,`menuIcon optionPdf optionImg optionAnnotator optionAltCopy custom-menu-before custom-menu-after`),t=>({name:t,fn:S(n=>[y(e.$slots,t,de(m(b(ie)(t,n))),void 0,!0)])}))]),1032,[`backgroundColor`,`color`,`isPrinting`,`isImaging`,`uid`,`position`,`hasPdf`,`hasImg`,`hasAltCopy`,`chartElement`,`callbacks`,`hasAnnotator`,`isAnnotation`,`printScale`,`titles`,`isCursorPointer`,`onGeneratePdf`,`onGenerateImage`,`style`])):l(``,!0)],40,me))}},[[`__scopeId`,`data-v-97ad65a3`]]);export{C as n,T as t};
@@ -1,4 +1,4 @@
1
- import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{t}from"./useConfig-D3ZfFSE5.js";import{X as n,t as r}from"./lib-rPeBMZrn.js";import{n as i,t as a}from"./useHints-C-TwxM0Y.js";import{t as o}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{t as s}from"./useNestedProp-DnGoh-XS.js";import{n as c}from"./PackageVersion-DWlHsdPa.js";import{Fragment as l,computed as u,createBlock as d,createCommentVNode as f,createElementBlock as p,createElementVNode as m,createVNode as h,normalizeStyle as g,openBlock as _,ref as v,renderList as y,toDisplayString as b,unref as x}from"vue";var S={key:0},C=[`d`,`fill`],w=[`d`,`fill`],T=[`d`,`fill`],E=[`d`,`fill`],D=[`d`,`fill`],O=[`d`,`fill`],k=[`d`,`fill`],A={key:1},j=[`cx`,`cy`,`r`,`fill`],M={__name:`Digit`,props:{quanta:{type:String,default:null},backgroundColor:{type:String,default:`#e1e5e8`},color:{type:String,default:`#000000`},x:{type:Number,default:0},y:{type:Number,default:0},thickness:{type:Number,default:1}},setup(e){let t=e,n=v({0:`1111110`,1:`0110000`,2:`1101101`,3:`1111001`,4:`0110011`,5:`1011011`,6:`1011111`,7:`1110000`,8:`1111111`,9:`1111011`,"-":`0000001`,X:`0000000`}),r=u(()=>2*(t.thickness||1)),i=u(()=>[void 0,null].includes(t.quanta)?n.value.X:n.value[t.quanta]);return(t,n)=>(_(),p(l,null,[[void 0,null,`.`].includes(e.quanta)?f(``,!0):(_(),p(`g`,S,[m(`path`,{d:`M ${e.x} ${e.y}
1
+ import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{t}from"./useConfig-D3ZfFSE5.js";import{X as n,t as r}from"./lib-rPeBMZrn.js";import{n as i,t as a}from"./useHints-C-TwxM0Y.js";import{t as o}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{t as s}from"./useNestedProp-DnGoh-XS.js";import{n as c}from"./PackageVersion-CHQWwTik.js";import{Fragment as l,computed as u,createBlock as d,createCommentVNode as f,createElementBlock as p,createElementVNode as m,createVNode as h,normalizeStyle as g,openBlock as _,ref as v,renderList as y,toDisplayString as b,unref as x}from"vue";var S={key:0},C=[`d`,`fill`],w=[`d`,`fill`],T=[`d`,`fill`],E=[`d`,`fill`],D=[`d`,`fill`],O=[`d`,`fill`],k=[`d`,`fill`],A={key:1},j=[`cx`,`cy`,`r`,`fill`],M={__name:`Digit`,props:{quanta:{type:String,default:null},backgroundColor:{type:String,default:`#e1e5e8`},color:{type:String,default:`#000000`},x:{type:Number,default:0},y:{type:Number,default:0},thickness:{type:Number,default:1}},setup(e){let t=e,n=v({0:`1111110`,1:`0110000`,2:`1101101`,3:`1111001`,4:`0110011`,5:`1011011`,6:`1011111`,7:`1110000`,8:`1111111`,9:`1111011`,"-":`0000001`,X:`0000000`}),r=u(()=>2*(t.thickness||1)),i=u(()=>[void 0,null].includes(t.quanta)?n.value.X:n.value[t.quanta]);return(t,n)=>(_(),p(l,null,[[void 0,null,`.`].includes(e.quanta)?f(``,!0):(_(),p(`g`,S,[m(`path`,{d:`M ${e.x} ${e.y}
2
2
  L ${e.x+r.value} ${e.y-r.value}
3
3
  L ${e.x+26-r.value} ${e.y-r.value}
4
4
  L ${e.x+26} ${e.y}
@@ -1,4 +1,4 @@
1
- import{t as e}from"./useConfig-D3ZfFSE5.js";import{$ as t,Bt as n,Ht as r,It as i,Jt as a,S as o,X as s,Y as c,Yt as l,b as u,f as d,i as f,in as p,j as m,nn as h,p as g,st as _,t as v}from"./lib-rPeBMZrn.js";import{t as y}from"./vue_ui_donut-T5PeOqvf.js";import{_ as b,a as x,c as S,d as C,g as w,i as T,l as E,n as D,o as O,p as k,r as A,s as ee,t as te,u as j,v as M}from"./render-common-Dkf3n13B.js";var{vue_ui_donut:ne}=e();function re({config:e={}}={}){let t=e??{},n=p({userConfig:t,defaultConfig:ne}),i=n.theme;if(!i)return{...n,customPalette:n.customPalette?.length?n.customPalette:r};let a=p({userConfig:y[i]||{},defaultConfig:n}),o=p({userConfig:t,defaultConfig:a});return{...o,customPalette:o.customPalette?.length?o.customPalette:h[i]||r}}function N(e,t=0){let n=Number(e);return Number.isFinite(n)?n:t}function P(e,t,n){return String(t).split(`.`).reduce((e,t)=>e&&e[t]!==void 0?e[t]:void 0,e)??n}function ie(e){return typeof e!=`object`||!e?0:Array.isArray(e.values)?e.values.reduce((e,t)=>e+N(t,0),0):Array.isArray(e.series)?e.series.reduce((e,t)=>e+N(t,0),0):N(e.value??e.y??0,0)}function ae(e,t){return String(e?.name??e?.label??`Serie ${t+1}`)}function oe(e=[],t){let n=Array.isArray(t.customPalette)?t.customPalette:r;return(Array.isArray(e)?e:[]).map((e,t)=>({source:e,sourceIndex:t,value:ie(e)})).filter(e=>Number.isFinite(e.value)).sort((e,t)=>e.source?.ghost&&!t.source?.ghost?1:t.source?.ghost&&!e.source?.ghost?-1:t.value-e.value).map((e,t)=>{let r=e.source,i=e.value,a=(r?.color?o(r.color):``)||n[t%n.length];return{...r,id:r?.id??`donut_serie_${t}`,name:ae(r,t),value:i,absoluteValue:Math.abs(i),absoluteValues:Array.isArray(r?.values)?r.values:[i],color:a,index:t,sourceIndex:e.sourceIndex,patternIndex:r?.patternIndex??t,seriesIndex:r?.seriesIndex??t,ghost:!!r?.ghost}}).filter(e=>Number.isFinite(e.absoluteValue))}function se(e){return e.reduce((e,t)=>e+t.absoluteValue,0)}function ce({series:e,total:t,startAngle:n=-90}){let r=n;return e.map(e=>{let n=t?e.absoluteValue/t:0,i=n*360,a=r,o=r+i;return r=o,{...e,ratio:n,percentage:n*100,startAngle:a,endAngle:o,midAngle:a+i/2}})}function le({dataset:e=[],config:t={},width:n=512,height:r=512,additionalSvgContent:i=``,svgTitle:a=``}={}){let o=re({config:t}),s=oe(e,o),c=se(s),l={top:N(P(o,`chart.padding.top`,24),24),right:N(P(o,`chart.padding.right`,24),24),bottom:N(P(o,`chart.padding.bottom`,24),24),left:N(P(o,`chart.padding.left`,24),24)},u={top:l.top,left:l.left,right:n-l.right,bottom:r-l.bottom};u.width=Math.max(1,u.right-u.left),u.height=Math.max(1,u.bottom-u.top);let d={x:u.left+u.width/2,y:u.top+u.height/2},f=Math.max(1,Math.min(u.width,u.height)/2),p=N(P(o,`chart.donut.radius`,f),f),m=N(P(o,`chart.donut.holeRatio`,.5),.5);return{width:n,height:r,dataset:e,config:o,drawingArea:u,center:d,radius:p,innerRadius:Math.max(0,Math.min(p-1,p*m)),total:c,series:ce({series:s,total:c,startAngle:N(P(o,`chart.donut.startAngle`,-90),-90)}),additionalSvgContent:i,svgTitle:a}}var ue=s();function F(){return ue}function I(e){return O(x(e,`backgroundColor`,`#FFFFFF`),`#FFFFFF`)}function de(e){return b(e?.value??e?.absoluteValue??0,0)}function L(e){return w(e.series).filter(e=>!e?.ghost).map((e,t)=>({...e,value:Math.abs(de(e)),color:O(e.color,`#000000`),name:String(e.name??`Serie ${t+1}`),seriesIndex:e.seriesIndex??e.index??t,patternIndex:e.patternIndex??e.index??t})).filter(e=>Number.isFinite(e.value))}function R(e){return e.reduce((e,t)=>e+Math.abs(b(t.value,0)),0)}function fe(e){let t=x(e,`title`,{}),n=k(t,`subtitle`,{});if(!t.text)return 0;let r=b(t.fontSize,20),i=n.show!==!1&&n.text?b(n.fontSize,14):0;return b(t.paddingTop,12)+r+(i?i+12:0)+b(t.paddingBottom,36)}function pe({state:e,series:t}){let{config:n,width:r}=e,i=x(n,`legend`,{}),a=b(i.fontSize,12),o=b(i.markerSize,10),s=b(i.itemGap,24),c=b(i.rowGap,8),l=b(i.padding,8),u=b(i.labelGap,8),d=Math.max(1,r-l*2),f=[],p=[],m=0;return t.forEach(t=>{let n=Be(e,t),r=D(n,a),i=o+u+r,c=m+i+(p.length?s:0);p.length&&c>d&&(f.push({items:p,width:m}),p=[],m=0),p.push({serie:t,label:n,itemWidth:i}),m+=i+(p.length>1?s:0)}),p.length&&f.push({items:p,width:m}),{rows:f,fontSize:a,markerSize:o,itemGap:s,labelGap:u,rowGap:c,padding:l,height:f.length*Math.max(o,a)+Math.max(0,f.length-1)*c+l*2}}function z(e,t){return!x(e.config,`legend.show`,!0)||!t.length?{rows:[],height:0,padding:0,fontSize:12,markerSize:10,rowGap:0}:pe({state:e,series:t})}function B(e){return!!T(e,`pie`,x(e,`pie`,!1))}function me(e,t){let{config:n,width:r,height:i}=e,a=fe(n),o=z(e,t),s=x(n,`legend.show`,!0),c=x(n,`legend.position`,`bottom`),l=s&&c===`top`?o.height:0,u=s&&c!==`top`?o.height:0,d=b(x(n,`padding.top`,24),24),f=b(x(n,`padding.right`,24),24),p=b(x(n,`padding.bottom`,24),24),m=b(x(n,`padding.left`,24),24),h={top:d+a+l,right:r-f,bottom:i-p-u,left:m};h.width=Math.max(1,h.right-h.left),h.height=Math.max(1,h.bottom-h.top);let g=a?b(T(n,`title.chartOffsetY`,24),24):0,_=Math.max(1,h.height-g),v={x:h.left+h.width/2,y:h.top+g/2+_/2},y=b(x(n,`layout.donut.radiusRatio`,.35),.35),S=Math.max(.1,Math.min(.50001,y)),C=Math.max(12,Math.min(h.width,_)*S),w=x(n,`layout.donut.radius`,null),E=w==null?C:Math.min(C,b(w,C)),D=b(x(n,`layout.donut.strokeWidth`,64),64)/300,O=Math.max(Math.min(E*D*2,E),12*(1+D)),k=x(n,`layout.donut.thickness`,x(n,`layout.donut.size`,O)),A=Math.max(0,Math.min(E-1,k==null?O:b(k,O)));return{...e,drawingArea:h,center:v,radius:E,thickness:A,innerRadius:B(n)?0:Math.max(0,E-A)}}function he(e,t){let n=b(x(e.config,`layout.donut.rotation`,105.25),105.25);return i({series:t},e.center.x,e.center.y,e.radius,e.radius,1.99999,2,1,360,n,B(e.config)?e.radius:e.thickness).map((e,n)=>({...e,index:n,color:O(e.color,t[n]?.color),value:b(e.value,0),name:String(e.name??t[n]?.name??`Serie ${n+1}`),patternIndex:e.patternIndex??t[n]?.patternIndex??n,seriesIndex:e.seriesIndex??t[n]?.seriesIndex??n}))}function ge(e,t){let n=Math.max(1,...t.map(e=>Math.abs(b(e.value,0)))),r=t.map(e=>Math.abs(b(e.value,0))/n);return m({series:r,center:e.center,maxRadius:Math.min(e.drawingArea.width,e.drawingArea.height)/3,hasGhost:!1})}function V(e){return`gradient_${F()}`}function H(e,t){return`polar_gradient_${t}_${F()}`}function _e(e){return T(e.config,`type`,`classic`)!==`classic`||!x(e.config,`useGradient`,!1)?``:C(`circle`,{"data-cy":`donut-gradient-hollow`,cx:e.center.x,cy:e.center.y,r:e.radius<=0?10:e.radius,fill:`url(#${V(e)})`})}function U(e){return`drop_shadow_${F()}`}function ve(e){let{config:t,width:n}=e,r=x(t,`title`,{}),i=k(r,`subtitle`,{});if(!r.text)return``;let a=r.textAlign||`center`,o=a===`left`?b(r.paddingLeft,12):a===`right`?n-b(r.paddingRight,12):n/2,s=a===`left`?`start`:a===`right`?`end`:`middle`,c=b(r.fontSize,20),l=b(i.fontSize,14),u=b(r.paddingTop,12)+c,d=[M(r.text,{"data-cy":`donut-div-title`,x:o,y:u,"font-size":c,"font-weight":r.bold?`700`:`400`,"text-anchor":s,fill:O(r.color,A(t))})];return i.text&&d.push(M(i.text,{"data-cy":`donut-div-subtitle`,x:o,y:u+l+4,"font-size":l,"font-weight":i.bold?`700`:`400`,"text-anchor":s,fill:O(i.color||r.color,A(t))})),j(`g`,{"data-layer":`title`},d.join(``))}function ye(e,t){let{config:n}=e,r=[],i=!!x(n,`useGradient`,!1),o=!!x(n,`layout.donut.useShadow`,!1);if(i){let i=T(n,`type`,`classic`),o=b(x(n,`gradientIntensity`,30),30);if(i===`classic`&&Number.isFinite(e.thickness/e.radius)){let t=B(n)?1:e.thickness/e.radius;r.push(j(`radialGradient`,{id:V(e)},[C(`stop`,{offset:`0%`,"stop-color":a(I(n),0),"stop-opacity":0}),C(`stop`,{offset:`${(1-t)*100}%`,"stop-color":a(`#FFFFFF`,0),"stop-opacity":0}),C(`stop`,{offset:`${(1-t/2)*100}%`,"stop-color":a(`#FFFFFF`,o)}),C(`stop`,{offset:`100%`,"stop-color":a(I(n),0),"stop-opacity":0})].join(``)))}i===`polar`&&t.forEach((t,n)=>{let i=e.polarAreas?.[n];i?.middlePoint&&r.push(j(`radialGradient`,{id:H(e,n),cx:`${u(i.middlePoint.x/e.width*100)}%`,cy:`${u(i.middlePoint.y/e.height*100)}%`,r:`62%`},[C(`stop`,{offset:`0%`,"stop-color":l(t.color,.05),"stop-opacity":o/100}),C(`stop`,{offset:`100%`,"stop-color":t.color})].join(``)))})}if(o){let t=O(x(n,`layout.donut.shadowColor`,`#000000`),`#000000`),i=b(x(n,`layout.donut.shadowOpacity`,.2),.2),a=b(x(n,`layout.donut.shadowBlur`,6),6),o=b(x(n,`layout.donut.shadowOffsetY`,3),3);r.push(j(`filter`,{id:U(e),x:`-50%`,y:`-50%`,width:`200%`,height:`200%`},[C(`feDropShadow`,{dx:0,dy:o,stdDeviation:a,"flood-color":t,"flood-opacity":i})].join(``)))}return r.length?j(`defs`,{"data-layer":`definitions`},r.join(``)):``}function be(e,t){return t.color}function xe(e,t,n){return x(e.config,`useGradient`,!1)?`url(#${H(e,n)})`:t.color}function W(e){let{config:t}=e;return x(t,`layout.donut.borderColorAuto`,!0)?I(t):O(x(t,`layout.donut.borderColor`,I(t)),I(t))}function G(e){return x(e.config,`layout.donut.useShadow`,!1)?`url(#${U(e)})`:void 0}function Se(e,t){if(!t.length)return``;let n=W(e),r=b(x(e.config,`layout.donut.borderWidth`,1),1),i=[];return t.forEach((t,a)=>{b(t.proportion,0)<=0||(i.push(C(`path`,{"data-cy":`donut-arc-underlay-${a}`,d:t.arcSlice,fill:`#FFFFFF`,stroke:I(e.config)})),i.push(C(`path`,{class:`vue-ui-donut-arc-path`,"data-cy":`donut-arc-${a}`,d:t.arcSlice,fill:be(e,t,a),stroke:n,"stroke-width":r,filter:G(e)})))}),j(`g`,{"data-layer":`classic-slices`},i.join(``))}function Ce(e,t,n){if(!t.length)return``;let r=W(e),i=b(x(e.config,`layout.donut.borderWidth`,1),1),a=[];return t.forEach((t,o)=>{let s=n[o];s?.path&&(a.push(C(`path`,{"data-cy":`polar-arc-underlay-${o}`,d:s.path,fill:`#FFFFFF`,stroke:r})),a.push(C(`path`,{class:`vue-ui-donut-arc-path`,"data-cy":`donut-arc-${o}`,d:s.path,fill:xe(e,t,o),stroke:r,"stroke-width":i,filter:G(e)})))}),j(`g`,{"data-layer":`polar-slices`},a.join(``))}function K(e,n,r=`layout.labels.value.rounding`){let{config:i}=e,a=x(i,`layout.labels`,{}),o=a.dataLabels??{},s=a.value??{},c=t({p:o.prefix??``,v:n.value,s:o.suffix??``,r:b(x(i,r,s.rounding??0),s.rounding??0)});return f(s.formatter,n.value,c,{datapoint:n})}function q(e,n){let{config:r}=e,i=x(r,`layout.labels.percentage`,{}),a=b(n.proportion,0)*100,o=t({v:a,s:`%`,r:b(i.rounding,0)});return f(i.formatter,a,o,{datapoint:n})}function J(e,t){let n=x(e.config,`layout.labels`,{}),r=!!n.name?.show,i=!!(n.value?.show??!0),a=!!(n.percentage?.show??!0);return{name:r?String(t.name??``):``,value:i?K(e,t):``,percentage:a?q(e,t):``}}function we(e,t){let{value:n,percentage:r}=J(e,t);return r&&n?`${r} (${n})`:r||n||``}function Y(e,t){let n=x(e.config,`layout.labels`,{}),r=n.dataLabels??{},i=!!(n.value?.show??!0),a=!!(n.percentage?.show??!0),o=i?K(e,t):``,s=a?q(e,t):``;return o&&s?r.valuePercentageRatio===`percentageFirst`?`${s}\n${o}`:`${o}\n${s}`:o||s||``}function X(e,t){let n=x(e.config,`layout.labels`,{}).dataLabels??{};if(!T(e.config,`dataLabels.show`,n.show??!0)||!n.show)return!1;let r=b(n.hideUnderValue,0);return b(t.proportion,0)*100>r}function Te(e,t){let n=x(e.config,`layout.labels.dataLabels`,{}),r=b(n.smallArcClusterThreshold,0),i=b(n.hideUnderValue,0),a=b(t.proportion,0)*100;return a>i&&r>0&&a<=r}function Z(e){return!!x(e.config,`layout.curvedMarkers`,x(e.config,`layout.donut.curvedMarkers`,!1))}function Q(e,t){let n=x(e.config,`layout.labels.dataLabels`,{}),r={},i=e.center.x,a=e.center.y,o=b(n.smallArcClusterFontSize??n.fontSize,10),s=o/3,c=o*1.5,l=e.drawingArea.top+16,f=e.drawingArea.bottom-16,p=i-(e.radius+6),m=i+(e.radius+6),h=Z(e);function _(e){return{x:u(e.center?.endX??e.endX),y:u(e.center?.endY??e.endY)}}function v({midX:e,midY:t,bandX:n,bandY:r}){if(!h)return`M ${e} ${t} L ${e} ${r} L ${n} ${r}`;let o=n<i?-1:1,s=n-e,c=r-t,l=Math.sqrt(s*s+c*c)||1,u=e-i,d=t-a,f=Math.sqrt(u*u+d*d)||1,p=u/f,m=d/f,g=f+9;function _({x:e,y:t}){let n=e-i,r=t-a,o=Math.sqrt(n*n+r*r)||1;if(o>=g)return{x:e,y:t};let s=g/o;return{x:i+n*s,y:a+r*s}}if(l<56){let o=s/l,u=-(c/l),d=o,f=(e+n)*.5,h=(t+r)*.5,g=(f+u-i)**2+(h+d-a)**2;(f-u-i)**2+(h-d-a)**2>g&&(u=-u,d=-d);let v=Math.max(0,Math.min(1,(l-18)/44)),y=v*v*(3-2*v),b=e+s*.78,x=t+c*.78,S=_({x:b+u*(2.5+y*4)*.9+p*(1+y*2.5),y:x+d*(2.5+y*4)*.9+m*(1+y*2.5)});return`M ${e} ${t} Q ${S.x} ${S.y} ${n} ${r}`}let v=l*.34;v<20&&(v=20),v>46&&(v=46);let y=l*.46;y<22&&(y=22),y>70&&(y=70);let b=_({x:e+p*v,y:t+m*v}),x=i+o*Math.max(Math.abs(n-i),g),S=_({x:n-o*Math.min(y,Math.abs(x-n)*.75),y:r});return`M ${e} ${t} C ${b.x} ${b.y} ${S.x} ${S.y} ${n} ${r}`}function y(e){let t=String(e??``).split(/\n/g);return c+Math.max(0,t.length-1)*o*1.2}function S({arc:e,index:t}){let n=_(e);return{arc:e,index:t,midX:n.x,midY:n.y,inlineMarkerX:d(e).x,inlineMarkerY:g(e)-3.5,labelHeight:y(e.name)}}function C(e){let t=e.inlineMarkerY<a,n=e.inlineMarkerX<i;return t&&n?`TL`:t&&!n?`TR`:!t&&n?`BL`:`BR`}function w(e,t){let n=t.startsWith(`T`);e.sort((e,t)=>n?e.inlineMarkerY-t.inlineMarkerY||e.index-t.index:t.inlineMarkerY-e.inlineMarkerY||e.index-t.index)}function T({side:e,markerX:t,markerY:n,labelY:r,connectorPath:i}){return{side:e,labelX:e===`left`?t-8:t+8,labelY:r+s,textAnchor:e===`left`?`end`:`start`,markerX:t,markerY:n,connectorPath:i}}function E({candidateList:e,side:t,bandMarkerX:n,startY:i,direction:a}){let o=i;e.forEach(e=>{let{index:i,midX:s,midY:c,labelHeight:l}=e,u;a===`down`?(u=o,o+=l):(o-=l,u=o);let d=u,f=v({midX:s,midY:c,bandX:n,bandY:d});r[i]=T({side:t,markerX:n,markerY:d,labelY:u,connectorPath:f})})}let D={TL:[],TR:[],BL:[],BR:[]};return t.map((e,t)=>S({arc:e,index:t})).filter(({arc:t})=>X(e,t)&&Te(e,t)).forEach(e=>{D[C(e)].push(e)}),Object.keys(D).forEach(e=>{w(D[e],e)}),E({candidateList:D.TL,side:`left`,bandMarkerX:p,startY:l,direction:`down`}),E({candidateList:D.TR,side:`right`,bandMarkerX:m,startY:l,direction:`down`}),D.BL.length>1&&E({candidateList:D.BL,side:`left`,bandMarkerX:p,startY:f,direction:`up`}),D.BR.length>1&&E({candidateList:D.BR,side:`right`,bandMarkerX:m,startY:f,direction:`up`}),r}function Ee({state:e,arc:t,arcIndex:n,smallArcLayout:r,fontSize:i}){let a=x(e.config,`layout.labels`,{}),o=a.percentage??{},s=a.name??{},c=r?.labelX??d(t,!0,12).x,l=r?.labelY??g(t),u=r?.textAnchor??d(t,!0,12).anchor,{name:f}=J(e,t),p=we(e,t),m=String(f).split(/\n/g),h=f?m.map((t,n)=>j(`tspan`,{class:`vue-data-ui-datalabel-name`,x:n===0?void 0:c,dy:n===0?void 0:i*1.2,fill:O(s.color,A(e.config)),"font-size":i,"font-weight":s.bold?`700`:`400`},_(t+(n===m.length-1?` `:``)))).join(``):``,v=p?j(`tspan`,{class:`vue-data-ui-datalabel-value`,fill:O(o.color,A(e.config)),"font-size":i,"font-weight":o.bold?`700`:`400`},_(p)):``;return j(`text`,{"data-cy":`donut-label-inline-${n}`,class:`vue-data-ui-datalabel-inline`,x:c,y:l,"text-anchor":u},`${h}${v}`)}function De(e,t){let n=x(e.config,`layout.labels`,{}),r=n.dataLabels??{};if(!T(e.config,`dataLabels.show`,r.show??!0)||!r.show)return``;let i=b(r.fontSize??n.value?.fontSize??12,12);O(r.color??n.value?.color??A(e.config),A(e.config)),r.bold??n.value?.bold;let a=b(r.offset,16),o=Q(e,t),s=[];return t.forEach((t,n)=>{if(!X(e,t))return;let c=o[n];Y(e,t),c?s.push(Ee({state:e,arc:t,arcIndex:n,smallArcLayout:c,fontSize:b(r.smallArcClusterFontSize,i)})):s.push(Ee({state:e,arc:t,arcIndex:n,smallArcLayout:{labelX:d(t,!1,a+i/2).x,labelY:g(t,a,a),textAnchor:d(t).anchor},fontSize:i}))}),s.length?j(`g`,{"data-layer":`data-labels`},s.join(``)):``}function Oe(e,t,r=42){return n({initX:t.middlePoint.x,initY:t.middlePoint.y,offset:r,centerX:e.center.x,centerY:e.center.y})}function ke(e,t){return t.x<e.center.x?`end`:t.x>e.center.x?`start`:`middle`}function Ae(e,t,n,r){let i=x(e.config,`layout.labels`,{}),a=i.percentage??{},o=i.name??{},s=b(a.fontSize,i.dataLabels?.fontSize??12),c=b(o.fontSize,i.dataLabels?.fontSize??12),l=j(`tspan`,{class:`vue-data-ui-datalabel-value`,fill:O(a.color,A(e.config)),"font-size":s,"font-weight":a.bold?`700`:`400`},_(String(Y(e,t).replace(/\n/g,` / `)))),u=o.show?String(t.name??``).split(/\n/g).map((t,r)=>j(`tspan`,{class:`vue-data-ui-datalabel-name`,x:r===0?void 0:n,dy:r===0?void 0:c*1.2,fill:O(o.color,A(e.config)),"font-size":c,"font-weight":o.bold?`700`:`400`},_(t))).join(``):``;return r===`end`?`${u}${l}`:`${l}${u}`}function je(e,t,n){let r=x(e.config,`layout.labels`,{}),i=r.dataLabels??{},a=r.value??{},o=r.percentage??{},s=r.name??{};if(!T(e.config,`dataLabels.show`,i.show??!0)||!i.show)return``;let l=!!i.oneLine,u=b(a.fontSize,i.fontSize??12),d=b(s.fontSize,i.fontSize??12),f=O(o.color,A(e.config)),p=[];return t.forEach((t,r)=>{let i=n[r];if(!i||!X(e,t))return;let a=Oe(e,i,42),m=ke(e,a);l?p.push(j(`text`,{"data-cy":`polar-label-inline`,class:`vue-data-ui-datalabel-inline`,x:a.x,y:a.y,"text-anchor":m},Ae(e,t,a.x,m))):(p.push(j(`text`,{"data-cy":`polar-label-value`,class:`vue-data-ui-datalabel-value`,x:a.x,y:a.y,"font-size":u,"font-weight":o.bold?`700`:`400`,"text-anchor":m,fill:f},te({content:Y(e,t),x:a.x,fontSize:u,fill:f,textAnchor:m}))),s.show&&p.push(j(`text`,{"data-cy":`polar-label-name`,class:`vue-data-ui-datalabel-name`,x:a.x,y:a.y+d*1.2,"font-size":d,"font-weight":s.bold?`700`:`400`,"text-anchor":m,fill:O(s.color,A(e.config))},c({content:_(String(t.name??``)),fontSize:d,fill:O(s.color,A(e.config)),x:a.x}))))}),p.length?j(`g`,{"data-layer":`polar-data-labels`},p.join(``)):``}function Me(e,t,n=null){if(n?.connectorPath)return n.connectorPath;let r=x(e.config,`layout.labels.dataLabels`,{}),i=b(r.offset,16),a=b(r.markerFlatLength,12),o=Z(e),s=d(t).x,c=g(t,i,i)-4,l=s+(t.center.endX>t.cx?-a:a),u=`${s},${c}`,f=`${l},${c}`,p=`${t.center.endX},${t.center.endY}`;return o?`M${u} Q${f} ${p}`:`M${u} ${f} ${p}`}function Ne(e,t){let n=x(e.config,`layout.labels.dataLabels`,{});if(!T(e.config,`dataLabels.show`,n.show??!0)||!n.show)return``;let r=Q(e,t),i=[];return t.forEach((t,a)=>{if(!X(e,t))return;let o=r[a],s=Me(e,t,o);s&&(i.push(C(`path`,{"data-cy":`donut-marker-${a}`,d:s,stroke:t.color,"stroke-width":b(n.markerStrokeWidth,1),"stroke-linecap":`round`,"stroke-linejoin":`round`,fill:`none`})),i.push(C(`circle`,{"data-cy":`donut-label-marker-${a}`,cx:o?.markerX??d(t).x,cy:o?.markerY??g(t)-3.5,r:b(n.markerRadius,3),fill:t.color,stroke:I(e.config),"stroke-width":1})))}),i.length?j(`g`,{"data-layer":`label-markers`},i.join(``)):``}function Pe(e,t,r){let i=x(e.config,`layout.labels.dataLabels`,{});if(!T(e.config,`dataLabels.show`,i.show??!0)||!i.show)return``;let a=[];return t.forEach((t,o)=>{let s=r[o];if(!s?.middlePoint||!X(e,t))return;let c=n({initX:s.middlePoint.x,initY:s.middlePoint.y,offset:24,centerX:e.center.x,centerY:e.center.y});a.push(C(`path`,{"data-cy":`polar-marker-${o}`,d:`M ${c.x},${c.y} ${s.middlePoint.x},${s.middlePoint.y}`,stroke:t.color,"stroke-width":b(i.markerStrokeWidth,1),"stroke-linecap":`round`,"stroke-linejoin":`round`,fill:`none`})),a.push(C(`circle`,{"data-cy":`polar-label-marker-${o}`,cx:c.x,cy:c.y,r:b(i.markerRadius,3),fill:t.color,stroke:I(e.config),"stroke-width":1}))}),a.length?j(`g`,{"data-layer":`polar-label-markers`},a.join(``)):``}function $(e,t){return e==null||e===``?``:M(e,{"text-anchor":`middle`,...t})}function Fe(e,n,r){if(T(e.config,`type`,`classic`)!==`classic`||B(e.config)||!n)return``;let i=x(e.config,`layout.labels.hollow`,{}),a=i.total??{},o=i.average??{},s=[];if(a.show){let r=b(a.fontSize,14),i=!!o.show,c=e.center.y-(i?r:0)+b(a.offsetY,0),l=a.value??{},u=b(l.fontSize,r),d=f(l.formatter,n,t({p:l.prefix??``,v:n,s:l.suffix??``,r:b(l.rounding,0)}),{total:n});s.push($(a.text??``,{"data-cy":`hollow-total-name`,x:e.center.x,y:c,fill:O(a.color,A(e.config)),"font-size":r,"font-weight":a.bold?`700`:`400`})),s.push($(d,{"data-cy":`hollow-total-value`,x:e.center.x,y:e.center.y+r-(i?r:0)+b(l.offsetY,0),fill:O(l.color,O(a.color,A(e.config))),"font-size":u,"font-weight":l.bold?`700`:`400`}))}if(o.show){let i=b(o.fontSize,14),c=!!a.show,l=n/Math.max(1,r.length),u=o.value??{},d=b(u.fontSize,i),p=f(u.formatter,l,t({p:u.prefix??``,v:l,s:u.suffix??``,r:b(u.rounding,0)}),{average:l});s.push($(o.text??``,{"data-cy":`hollow-average-name`,x:e.center.x,y:e.center.y+(c?i:0)+b(o.offsetY,0),fill:O(o.color,A(e.config)),"font-size":i,"font-weight":o.bold?`700`:`400`})),s.push($(p,{"data-cy":`hollow-average-value`,x:e.center.x,y:e.center.y+(c?i:0)+i+b(u.offsetY,0),fill:O(u.color,O(o.color,A(e.config))),"font-size":d,"font-weight":u.bold?`700`:`400`}))}return s.filter(Boolean).length?j(`g`,{class:`vue-data-ui-donut-hollow-labels`,"data-layer":`hollow-labels`},s.join(``)):``}function Ie(e,n){let{config:r,center:i}=e,a=x(r,`layout.donut.labels.total`,x(r,`layout.labels.total`,{}));if(!a.show||!Number.isFinite(n)||n<=0)return``;let o=x(r,`layout.labels.dataLabels`,{}),s=b(a.fontSize,20),c=O(a.color,A(r)),l=f(a.formatter,n,t({p:o.prefix??``,v:n,s:o.suffix??``,r:b(a.rounding,0)}),{total:n});return M(l,{"data-cy":`donut-total`,x:i.x,y:i.y+s/3,"font-size":s,"font-weight":a.bold?`700`:`400`,"text-anchor":`middle`,fill:c})}function Le(e,t){let n=R(L(e));return n?b(t.value,0)/n*100:0}function Re(e,n){let r=x(e.config,`legend`,{}),i=x(e.config,`layout.labels`,{}),a=i.dataLabels??{},o=i.value??{},s=t({p:a.prefix??``,v:n.value,s:a.suffix??``,r:b(r.roundingValue,o.rounding??0)});return f(o.formatter,n.value,s,{datapoint:n,serie:n})}function ze(e,n){let r=x(e.config,`legend`,{}),i=x(e.config,`layout.labels`,{}).percentage??{},a=Le(e,n),o=t({v:a,s:`%`,r:b(r.roundingPercentage,i.rounding??0)});return f(i.formatter,a,o,{datapoint:n,serie:n})}function Be(e,t){let n=x(e.config,`legend`,{}),r=[],i=n.showPercentage?ze(e,t):``,a=n.showValue?Re(e,t):``,o=i&&n.usePercentageParens?`(${i})`:i,s=a&&n.useValueParens?`(${a})`:a;return n.showValueFirst?(s&&r.push(s),o&&r.push(o)):(o&&r.push(o),s&&r.push(s)),`${t.name}${r.length?`: ${r.join(` `)}`:``}`}function Ve(e,t){let n=x(e.config,`legend`,{});if(!n.show||!t.length)return``;let r=z(e,t),i=O(n.color,A(e.config)),a=n.position||`bottom`,o=Math.max(r.markerSize,r.fontSize),s=a===`top`?r.padding+o:e.height-r.height+r.padding+o,c=[];return r.rows.forEach((t,a)=>{let l=r.padding+(e.width-r.padding*2)/2-t.width/2,u=s+a*(o+r.rowGap);t.items.forEach(({serie:e,label:t,itemWidth:a})=>{c.push(C(`circle`,{cx:l+r.markerSize/2,cy:u,r:r.markerSize/2,fill:e.color,opacity:e.opacity??1})),c.push(M(t,{x:l+r.markerSize+r.labelGap,y:u+2,"font-size":r.fontSize,"font-weight":n.bold?`700`:`400`,"dominant-baseline":`middle`,fill:i,opacity:e.opacity??1})),l+=a+r.itemGap})}),j(`g`,{"data-layer":`legend`,"data-cy":`donut-div-legend`},c.join(``))}function He(e){return j(`g`,{"data-layer":`no-data`},[C(`circle`,{cx:e.center.x,cy:e.center.y,r:Math.max(1,e.radius),fill:O(x(e.config,`layout.donut.emptyFill`,`#E1E5E8`),`#E1E5E8`),opacity:.4})].join(``))}function Ue(e,t){let n=e.additionalSvgContent;return typeof n==`function`?n({width:e.width,height:e.height,drawingArea:e.drawingArea,center:e.center,radius:e.radius,thickness:e.thickness,innerRadius:e.innerRadius,config:e.config,series:t.map(e=>({...e}))})??``:n??``}function We(e,t,n){let r=`${T(e.config,`title.text`,`Donut chart`)||e.svgTitle||`Donut chart`}. ${t.length} series. Total ${u(n)}.`;return j(`title`,{},_(r))}async function Ge(e){let t=e.config,n=b(e.width,x(t,`width`,512)),r=b(e.height,x(t,`height`,512)),i=L(e),a=R(i),o=me({...e,width:n,height:r},i),s=he(o,i),c=ge(o,i),l=T(t,`type`,`classic`),u=a>0&&s.some(e=>b(e.proportion,0)>0);return`
1
+ import{t as e}from"./useConfig-D3ZfFSE5.js";import{$ as t,Bt as n,Ht as r,It as i,Jt as a,S as o,X as s,Y as c,Yt as l,b as u,f as d,i as f,in as p,j as m,nn as h,p as g,st as _,t as v}from"./lib-rPeBMZrn.js";import{t as y}from"./vue_ui_donut-T5PeOqvf.js";import{_ as b,a as x,c as S,d as C,g as w,i as T,l as E,n as D,o as O,p as k,r as A,s as ee,t as te,u as j,v as M}from"./render-common-_8VmVGgq.js";var{vue_ui_donut:ne}=e();function re({config:e={}}={}){let t=e??{},n=p({userConfig:t,defaultConfig:ne}),i=n.theme;if(!i)return{...n,customPalette:n.customPalette?.length?n.customPalette:r};let a=p({userConfig:y[i]||{},defaultConfig:n}),o=p({userConfig:t,defaultConfig:a});return{...o,customPalette:o.customPalette?.length?o.customPalette:h[i]||r}}function N(e,t=0){let n=Number(e);return Number.isFinite(n)?n:t}function P(e,t,n){return String(t).split(`.`).reduce((e,t)=>e&&e[t]!==void 0?e[t]:void 0,e)??n}function ie(e){return typeof e!=`object`||!e?0:Array.isArray(e.values)?e.values.reduce((e,t)=>e+N(t,0),0):Array.isArray(e.series)?e.series.reduce((e,t)=>e+N(t,0),0):N(e.value??e.y??0,0)}function ae(e,t){return String(e?.name??e?.label??`Serie ${t+1}`)}function oe(e=[],t){let n=Array.isArray(t.customPalette)?t.customPalette:r;return(Array.isArray(e)?e:[]).map((e,t)=>({source:e,sourceIndex:t,value:ie(e)})).filter(e=>Number.isFinite(e.value)).sort((e,t)=>e.source?.ghost&&!t.source?.ghost?1:t.source?.ghost&&!e.source?.ghost?-1:t.value-e.value).map((e,t)=>{let r=e.source,i=e.value,a=(r?.color?o(r.color):``)||n[t%n.length];return{...r,id:r?.id??`donut_serie_${t}`,name:ae(r,t),value:i,absoluteValue:Math.abs(i),absoluteValues:Array.isArray(r?.values)?r.values:[i],color:a,index:t,sourceIndex:e.sourceIndex,patternIndex:r?.patternIndex??t,seriesIndex:r?.seriesIndex??t,ghost:!!r?.ghost}}).filter(e=>Number.isFinite(e.absoluteValue))}function se(e){return e.reduce((e,t)=>e+t.absoluteValue,0)}function ce({series:e,total:t,startAngle:n=-90}){let r=n;return e.map(e=>{let n=t?e.absoluteValue/t:0,i=n*360,a=r,o=r+i;return r=o,{...e,ratio:n,percentage:n*100,startAngle:a,endAngle:o,midAngle:a+i/2}})}function le({dataset:e=[],config:t={},width:n=512,height:r=512,additionalSvgContent:i=``,svgTitle:a=``}={}){let o=re({config:t}),s=oe(e,o),c=se(s),l={top:N(P(o,`chart.padding.top`,24),24),right:N(P(o,`chart.padding.right`,24),24),bottom:N(P(o,`chart.padding.bottom`,24),24),left:N(P(o,`chart.padding.left`,24),24)},u={top:l.top,left:l.left,right:n-l.right,bottom:r-l.bottom};u.width=Math.max(1,u.right-u.left),u.height=Math.max(1,u.bottom-u.top);let d={x:u.left+u.width/2,y:u.top+u.height/2},f=Math.max(1,Math.min(u.width,u.height)/2),p=N(P(o,`chart.donut.radius`,f),f),m=N(P(o,`chart.donut.holeRatio`,.5),.5);return{width:n,height:r,dataset:e,config:o,drawingArea:u,center:d,radius:p,innerRadius:Math.max(0,Math.min(p-1,p*m)),total:c,series:ce({series:s,total:c,startAngle:N(P(o,`chart.donut.startAngle`,-90),-90)}),additionalSvgContent:i,svgTitle:a}}var ue=s();function F(){return ue}function I(e){return O(x(e,`backgroundColor`,`#FFFFFF`),`#FFFFFF`)}function de(e){return b(e?.value??e?.absoluteValue??0,0)}function L(e){return w(e.series).filter(e=>!e?.ghost).map((e,t)=>({...e,value:Math.abs(de(e)),color:O(e.color,`#000000`),name:String(e.name??`Serie ${t+1}`),seriesIndex:e.seriesIndex??e.index??t,patternIndex:e.patternIndex??e.index??t})).filter(e=>Number.isFinite(e.value))}function R(e){return e.reduce((e,t)=>e+Math.abs(b(t.value,0)),0)}function fe(e){let t=x(e,`title`,{}),n=k(t,`subtitle`,{});if(!t.text)return 0;let r=b(t.fontSize,20),i=n.show!==!1&&n.text?b(n.fontSize,14):0;return b(t.paddingTop,12)+r+(i?i+12:0)+b(t.paddingBottom,36)}function pe({state:e,series:t}){let{config:n,width:r}=e,i=x(n,`legend`,{}),a=b(i.fontSize,12),o=b(i.markerSize,10),s=b(i.itemGap,24),c=b(i.rowGap,8),l=b(i.padding,8),u=b(i.labelGap,8),d=Math.max(1,r-l*2),f=[],p=[],m=0;return t.forEach(t=>{let n=Be(e,t),r=D(n,a),i=o+u+r,c=m+i+(p.length?s:0);p.length&&c>d&&(f.push({items:p,width:m}),p=[],m=0),p.push({serie:t,label:n,itemWidth:i}),m+=i+(p.length>1?s:0)}),p.length&&f.push({items:p,width:m}),{rows:f,fontSize:a,markerSize:o,itemGap:s,labelGap:u,rowGap:c,padding:l,height:f.length*Math.max(o,a)+Math.max(0,f.length-1)*c+l*2}}function z(e,t){return!x(e.config,`legend.show`,!0)||!t.length?{rows:[],height:0,padding:0,fontSize:12,markerSize:10,rowGap:0}:pe({state:e,series:t})}function B(e){return!!T(e,`pie`,x(e,`pie`,!1))}function me(e,t){let{config:n,width:r,height:i}=e,a=fe(n),o=z(e,t),s=x(n,`legend.show`,!0),c=x(n,`legend.position`,`bottom`),l=s&&c===`top`?o.height:0,u=s&&c!==`top`?o.height:0,d=b(x(n,`padding.top`,24),24),f=b(x(n,`padding.right`,24),24),p=b(x(n,`padding.bottom`,24),24),m=b(x(n,`padding.left`,24),24),h={top:d+a+l,right:r-f,bottom:i-p-u,left:m};h.width=Math.max(1,h.right-h.left),h.height=Math.max(1,h.bottom-h.top);let g=a?b(T(n,`title.chartOffsetY`,24),24):0,_=Math.max(1,h.height-g),v={x:h.left+h.width/2,y:h.top+g/2+_/2},y=b(x(n,`layout.donut.radiusRatio`,.35),.35),S=Math.max(.1,Math.min(.50001,y)),C=Math.max(12,Math.min(h.width,_)*S),w=x(n,`layout.donut.radius`,null),E=w==null?C:Math.min(C,b(w,C)),D=b(x(n,`layout.donut.strokeWidth`,64),64)/300,O=Math.max(Math.min(E*D*2,E),12*(1+D)),k=x(n,`layout.donut.thickness`,x(n,`layout.donut.size`,O)),A=Math.max(0,Math.min(E-1,k==null?O:b(k,O)));return{...e,drawingArea:h,center:v,radius:E,thickness:A,innerRadius:B(n)?0:Math.max(0,E-A)}}function he(e,t){let n=b(x(e.config,`layout.donut.rotation`,105.25),105.25);return i({series:t},e.center.x,e.center.y,e.radius,e.radius,1.99999,2,1,360,n,B(e.config)?e.radius:e.thickness).map((e,n)=>({...e,index:n,color:O(e.color,t[n]?.color),value:b(e.value,0),name:String(e.name??t[n]?.name??`Serie ${n+1}`),patternIndex:e.patternIndex??t[n]?.patternIndex??n,seriesIndex:e.seriesIndex??t[n]?.seriesIndex??n}))}function ge(e,t){let n=Math.max(1,...t.map(e=>Math.abs(b(e.value,0)))),r=t.map(e=>Math.abs(b(e.value,0))/n);return m({series:r,center:e.center,maxRadius:Math.min(e.drawingArea.width,e.drawingArea.height)/3,hasGhost:!1})}function V(e){return`gradient_${F()}`}function H(e,t){return`polar_gradient_${t}_${F()}`}function _e(e){return T(e.config,`type`,`classic`)!==`classic`||!x(e.config,`useGradient`,!1)?``:C(`circle`,{"data-cy":`donut-gradient-hollow`,cx:e.center.x,cy:e.center.y,r:e.radius<=0?10:e.radius,fill:`url(#${V(e)})`})}function U(e){return`drop_shadow_${F()}`}function ve(e){let{config:t,width:n}=e,r=x(t,`title`,{}),i=k(r,`subtitle`,{});if(!r.text)return``;let a=r.textAlign||`center`,o=a===`left`?b(r.paddingLeft,12):a===`right`?n-b(r.paddingRight,12):n/2,s=a===`left`?`start`:a===`right`?`end`:`middle`,c=b(r.fontSize,20),l=b(i.fontSize,14),u=b(r.paddingTop,12)+c,d=[M(r.text,{"data-cy":`donut-div-title`,x:o,y:u,"font-size":c,"font-weight":r.bold?`700`:`400`,"text-anchor":s,fill:O(r.color,A(t))})];return i.text&&d.push(M(i.text,{"data-cy":`donut-div-subtitle`,x:o,y:u+l+4,"font-size":l,"font-weight":i.bold?`700`:`400`,"text-anchor":s,fill:O(i.color||r.color,A(t))})),j(`g`,{"data-layer":`title`},d.join(``))}function ye(e,t){let{config:n}=e,r=[],i=!!x(n,`useGradient`,!1),o=!!x(n,`layout.donut.useShadow`,!1);if(i){let i=T(n,`type`,`classic`),o=b(x(n,`gradientIntensity`,30),30);if(i===`classic`&&Number.isFinite(e.thickness/e.radius)){let t=B(n)?1:e.thickness/e.radius;r.push(j(`radialGradient`,{id:V(e)},[C(`stop`,{offset:`0%`,"stop-color":a(I(n),0),"stop-opacity":0}),C(`stop`,{offset:`${(1-t)*100}%`,"stop-color":a(`#FFFFFF`,0),"stop-opacity":0}),C(`stop`,{offset:`${(1-t/2)*100}%`,"stop-color":a(`#FFFFFF`,o)}),C(`stop`,{offset:`100%`,"stop-color":a(I(n),0),"stop-opacity":0})].join(``)))}i===`polar`&&t.forEach((t,n)=>{let i=e.polarAreas?.[n];i?.middlePoint&&r.push(j(`radialGradient`,{id:H(e,n),cx:`${u(i.middlePoint.x/e.width*100)}%`,cy:`${u(i.middlePoint.y/e.height*100)}%`,r:`62%`},[C(`stop`,{offset:`0%`,"stop-color":l(t.color,.05),"stop-opacity":o/100}),C(`stop`,{offset:`100%`,"stop-color":t.color})].join(``)))})}if(o){let t=O(x(n,`layout.donut.shadowColor`,`#000000`),`#000000`),i=b(x(n,`layout.donut.shadowOpacity`,.2),.2),a=b(x(n,`layout.donut.shadowBlur`,6),6),o=b(x(n,`layout.donut.shadowOffsetY`,3),3);r.push(j(`filter`,{id:U(e),x:`-50%`,y:`-50%`,width:`200%`,height:`200%`},[C(`feDropShadow`,{dx:0,dy:o,stdDeviation:a,"flood-color":t,"flood-opacity":i})].join(``)))}return r.length?j(`defs`,{"data-layer":`definitions`},r.join(``)):``}function be(e,t){return t.color}function xe(e,t,n){return x(e.config,`useGradient`,!1)?`url(#${H(e,n)})`:t.color}function W(e){let{config:t}=e;return x(t,`layout.donut.borderColorAuto`,!0)?I(t):O(x(t,`layout.donut.borderColor`,I(t)),I(t))}function G(e){return x(e.config,`layout.donut.useShadow`,!1)?`url(#${U(e)})`:void 0}function Se(e,t){if(!t.length)return``;let n=W(e),r=b(x(e.config,`layout.donut.borderWidth`,1),1),i=[];return t.forEach((t,a)=>{b(t.proportion,0)<=0||(i.push(C(`path`,{"data-cy":`donut-arc-underlay-${a}`,d:t.arcSlice,fill:`#FFFFFF`,stroke:I(e.config)})),i.push(C(`path`,{class:`vue-ui-donut-arc-path`,"data-cy":`donut-arc-${a}`,d:t.arcSlice,fill:be(e,t,a),stroke:n,"stroke-width":r,filter:G(e)})))}),j(`g`,{"data-layer":`classic-slices`},i.join(``))}function Ce(e,t,n){if(!t.length)return``;let r=W(e),i=b(x(e.config,`layout.donut.borderWidth`,1),1),a=[];return t.forEach((t,o)=>{let s=n[o];s?.path&&(a.push(C(`path`,{"data-cy":`polar-arc-underlay-${o}`,d:s.path,fill:`#FFFFFF`,stroke:r})),a.push(C(`path`,{class:`vue-ui-donut-arc-path`,"data-cy":`donut-arc-${o}`,d:s.path,fill:xe(e,t,o),stroke:r,"stroke-width":i,filter:G(e)})))}),j(`g`,{"data-layer":`polar-slices`},a.join(``))}function K(e,n,r=`layout.labels.value.rounding`){let{config:i}=e,a=x(i,`layout.labels`,{}),o=a.dataLabels??{},s=a.value??{},c=t({p:o.prefix??``,v:n.value,s:o.suffix??``,r:b(x(i,r,s.rounding??0),s.rounding??0)});return f(s.formatter,n.value,c,{datapoint:n})}function q(e,n){let{config:r}=e,i=x(r,`layout.labels.percentage`,{}),a=b(n.proportion,0)*100,o=t({v:a,s:`%`,r:b(i.rounding,0)});return f(i.formatter,a,o,{datapoint:n})}function J(e,t){let n=x(e.config,`layout.labels`,{}),r=!!n.name?.show,i=!!(n.value?.show??!0),a=!!(n.percentage?.show??!0);return{name:r?String(t.name??``):``,value:i?K(e,t):``,percentage:a?q(e,t):``}}function we(e,t){let{value:n,percentage:r}=J(e,t);return r&&n?`${r} (${n})`:r||n||``}function Y(e,t){let n=x(e.config,`layout.labels`,{}),r=n.dataLabels??{},i=!!(n.value?.show??!0),a=!!(n.percentage?.show??!0),o=i?K(e,t):``,s=a?q(e,t):``;return o&&s?r.valuePercentageRatio===`percentageFirst`?`${s}\n${o}`:`${o}\n${s}`:o||s||``}function X(e,t){let n=x(e.config,`layout.labels`,{}).dataLabels??{};if(!T(e.config,`dataLabels.show`,n.show??!0)||!n.show)return!1;let r=b(n.hideUnderValue,0);return b(t.proportion,0)*100>r}function Te(e,t){let n=x(e.config,`layout.labels.dataLabels`,{}),r=b(n.smallArcClusterThreshold,0),i=b(n.hideUnderValue,0),a=b(t.proportion,0)*100;return a>i&&r>0&&a<=r}function Z(e){return!!x(e.config,`layout.curvedMarkers`,x(e.config,`layout.donut.curvedMarkers`,!1))}function Q(e,t){let n=x(e.config,`layout.labels.dataLabels`,{}),r={},i=e.center.x,a=e.center.y,o=b(n.smallArcClusterFontSize??n.fontSize,10),s=o/3,c=o*1.5,l=e.drawingArea.top+16,f=e.drawingArea.bottom-16,p=i-(e.radius+6),m=i+(e.radius+6),h=Z(e);function _(e){return{x:u(e.center?.endX??e.endX),y:u(e.center?.endY??e.endY)}}function v({midX:e,midY:t,bandX:n,bandY:r}){if(!h)return`M ${e} ${t} L ${e} ${r} L ${n} ${r}`;let o=n<i?-1:1,s=n-e,c=r-t,l=Math.sqrt(s*s+c*c)||1,u=e-i,d=t-a,f=Math.sqrt(u*u+d*d)||1,p=u/f,m=d/f,g=f+9;function _({x:e,y:t}){let n=e-i,r=t-a,o=Math.sqrt(n*n+r*r)||1;if(o>=g)return{x:e,y:t};let s=g/o;return{x:i+n*s,y:a+r*s}}if(l<56){let o=s/l,u=-(c/l),d=o,f=(e+n)*.5,h=(t+r)*.5,g=(f+u-i)**2+(h+d-a)**2;(f-u-i)**2+(h-d-a)**2>g&&(u=-u,d=-d);let v=Math.max(0,Math.min(1,(l-18)/44)),y=v*v*(3-2*v),b=e+s*.78,x=t+c*.78,S=_({x:b+u*(2.5+y*4)*.9+p*(1+y*2.5),y:x+d*(2.5+y*4)*.9+m*(1+y*2.5)});return`M ${e} ${t} Q ${S.x} ${S.y} ${n} ${r}`}let v=l*.34;v<20&&(v=20),v>46&&(v=46);let y=l*.46;y<22&&(y=22),y>70&&(y=70);let b=_({x:e+p*v,y:t+m*v}),x=i+o*Math.max(Math.abs(n-i),g),S=_({x:n-o*Math.min(y,Math.abs(x-n)*.75),y:r});return`M ${e} ${t} C ${b.x} ${b.y} ${S.x} ${S.y} ${n} ${r}`}function y(e){let t=String(e??``).split(/\n/g);return c+Math.max(0,t.length-1)*o*1.2}function S({arc:e,index:t}){let n=_(e);return{arc:e,index:t,midX:n.x,midY:n.y,inlineMarkerX:d(e).x,inlineMarkerY:g(e)-3.5,labelHeight:y(e.name)}}function C(e){let t=e.inlineMarkerY<a,n=e.inlineMarkerX<i;return t&&n?`TL`:t&&!n?`TR`:!t&&n?`BL`:`BR`}function w(e,t){let n=t.startsWith(`T`);e.sort((e,t)=>n?e.inlineMarkerY-t.inlineMarkerY||e.index-t.index:t.inlineMarkerY-e.inlineMarkerY||e.index-t.index)}function T({side:e,markerX:t,markerY:n,labelY:r,connectorPath:i}){return{side:e,labelX:e===`left`?t-8:t+8,labelY:r+s,textAnchor:e===`left`?`end`:`start`,markerX:t,markerY:n,connectorPath:i}}function E({candidateList:e,side:t,bandMarkerX:n,startY:i,direction:a}){let o=i;e.forEach(e=>{let{index:i,midX:s,midY:c,labelHeight:l}=e,u;a===`down`?(u=o,o+=l):(o-=l,u=o);let d=u,f=v({midX:s,midY:c,bandX:n,bandY:d});r[i]=T({side:t,markerX:n,markerY:d,labelY:u,connectorPath:f})})}let D={TL:[],TR:[],BL:[],BR:[]};return t.map((e,t)=>S({arc:e,index:t})).filter(({arc:t})=>X(e,t)&&Te(e,t)).forEach(e=>{D[C(e)].push(e)}),Object.keys(D).forEach(e=>{w(D[e],e)}),E({candidateList:D.TL,side:`left`,bandMarkerX:p,startY:l,direction:`down`}),E({candidateList:D.TR,side:`right`,bandMarkerX:m,startY:l,direction:`down`}),D.BL.length>1&&E({candidateList:D.BL,side:`left`,bandMarkerX:p,startY:f,direction:`up`}),D.BR.length>1&&E({candidateList:D.BR,side:`right`,bandMarkerX:m,startY:f,direction:`up`}),r}function Ee({state:e,arc:t,arcIndex:n,smallArcLayout:r,fontSize:i}){let a=x(e.config,`layout.labels`,{}),o=a.percentage??{},s=a.name??{},c=r?.labelX??d(t,!0,12).x,l=r?.labelY??g(t),u=r?.textAnchor??d(t,!0,12).anchor,{name:f}=J(e,t),p=we(e,t),m=String(f).split(/\n/g),h=f?m.map((t,n)=>j(`tspan`,{class:`vue-data-ui-datalabel-name`,x:n===0?void 0:c,dy:n===0?void 0:i*1.2,fill:O(s.color,A(e.config)),"font-size":i,"font-weight":s.bold?`700`:`400`},_(t+(n===m.length-1?` `:``)))).join(``):``,v=p?j(`tspan`,{class:`vue-data-ui-datalabel-value`,fill:O(o.color,A(e.config)),"font-size":i,"font-weight":o.bold?`700`:`400`},_(p)):``;return j(`text`,{"data-cy":`donut-label-inline-${n}`,class:`vue-data-ui-datalabel-inline`,x:c,y:l,"text-anchor":u},`${h}${v}`)}function De(e,t){let n=x(e.config,`layout.labels`,{}),r=n.dataLabels??{};if(!T(e.config,`dataLabels.show`,r.show??!0)||!r.show)return``;let i=b(r.fontSize??n.value?.fontSize??12,12);O(r.color??n.value?.color??A(e.config),A(e.config)),r.bold??n.value?.bold;let a=b(r.offset,16),o=Q(e,t),s=[];return t.forEach((t,n)=>{if(!X(e,t))return;let c=o[n];Y(e,t),c?s.push(Ee({state:e,arc:t,arcIndex:n,smallArcLayout:c,fontSize:b(r.smallArcClusterFontSize,i)})):s.push(Ee({state:e,arc:t,arcIndex:n,smallArcLayout:{labelX:d(t,!1,a+i/2).x,labelY:g(t,a,a),textAnchor:d(t).anchor},fontSize:i}))}),s.length?j(`g`,{"data-layer":`data-labels`},s.join(``)):``}function Oe(e,t,r=42){return n({initX:t.middlePoint.x,initY:t.middlePoint.y,offset:r,centerX:e.center.x,centerY:e.center.y})}function ke(e,t){return t.x<e.center.x?`end`:t.x>e.center.x?`start`:`middle`}function Ae(e,t,n,r){let i=x(e.config,`layout.labels`,{}),a=i.percentage??{},o=i.name??{},s=b(a.fontSize,i.dataLabels?.fontSize??12),c=b(o.fontSize,i.dataLabels?.fontSize??12),l=j(`tspan`,{class:`vue-data-ui-datalabel-value`,fill:O(a.color,A(e.config)),"font-size":s,"font-weight":a.bold?`700`:`400`},_(String(Y(e,t).replace(/\n/g,` / `)))),u=o.show?String(t.name??``).split(/\n/g).map((t,r)=>j(`tspan`,{class:`vue-data-ui-datalabel-name`,x:r===0?void 0:n,dy:r===0?void 0:c*1.2,fill:O(o.color,A(e.config)),"font-size":c,"font-weight":o.bold?`700`:`400`},_(t))).join(``):``;return r===`end`?`${u}${l}`:`${l}${u}`}function je(e,t,n){let r=x(e.config,`layout.labels`,{}),i=r.dataLabels??{},a=r.value??{},o=r.percentage??{},s=r.name??{};if(!T(e.config,`dataLabels.show`,i.show??!0)||!i.show)return``;let l=!!i.oneLine,u=b(a.fontSize,i.fontSize??12),d=b(s.fontSize,i.fontSize??12),f=O(o.color,A(e.config)),p=[];return t.forEach((t,r)=>{let i=n[r];if(!i||!X(e,t))return;let a=Oe(e,i,42),m=ke(e,a);l?p.push(j(`text`,{"data-cy":`polar-label-inline`,class:`vue-data-ui-datalabel-inline`,x:a.x,y:a.y,"text-anchor":m},Ae(e,t,a.x,m))):(p.push(j(`text`,{"data-cy":`polar-label-value`,class:`vue-data-ui-datalabel-value`,x:a.x,y:a.y,"font-size":u,"font-weight":o.bold?`700`:`400`,"text-anchor":m,fill:f},te({content:Y(e,t),x:a.x,fontSize:u,fill:f,textAnchor:m}))),s.show&&p.push(j(`text`,{"data-cy":`polar-label-name`,class:`vue-data-ui-datalabel-name`,x:a.x,y:a.y+d*1.2,"font-size":d,"font-weight":s.bold?`700`:`400`,"text-anchor":m,fill:O(s.color,A(e.config))},c({content:_(String(t.name??``)),fontSize:d,fill:O(s.color,A(e.config)),x:a.x}))))}),p.length?j(`g`,{"data-layer":`polar-data-labels`},p.join(``)):``}function Me(e,t,n=null){if(n?.connectorPath)return n.connectorPath;let r=x(e.config,`layout.labels.dataLabels`,{}),i=b(r.offset,16),a=b(r.markerFlatLength,12),o=Z(e),s=d(t).x,c=g(t,i,i)-4,l=s+(t.center.endX>t.cx?-a:a),u=`${s},${c}`,f=`${l},${c}`,p=`${t.center.endX},${t.center.endY}`;return o?`M${u} Q${f} ${p}`:`M${u} ${f} ${p}`}function Ne(e,t){let n=x(e.config,`layout.labels.dataLabels`,{});if(!T(e.config,`dataLabels.show`,n.show??!0)||!n.show)return``;let r=Q(e,t),i=[];return t.forEach((t,a)=>{if(!X(e,t))return;let o=r[a],s=Me(e,t,o);s&&(i.push(C(`path`,{"data-cy":`donut-marker-${a}`,d:s,stroke:t.color,"stroke-width":b(n.markerStrokeWidth,1),"stroke-linecap":`round`,"stroke-linejoin":`round`,fill:`none`})),i.push(C(`circle`,{"data-cy":`donut-label-marker-${a}`,cx:o?.markerX??d(t).x,cy:o?.markerY??g(t)-3.5,r:b(n.markerRadius,3),fill:t.color,stroke:I(e.config),"stroke-width":1})))}),i.length?j(`g`,{"data-layer":`label-markers`},i.join(``)):``}function Pe(e,t,r){let i=x(e.config,`layout.labels.dataLabels`,{});if(!T(e.config,`dataLabels.show`,i.show??!0)||!i.show)return``;let a=[];return t.forEach((t,o)=>{let s=r[o];if(!s?.middlePoint||!X(e,t))return;let c=n({initX:s.middlePoint.x,initY:s.middlePoint.y,offset:24,centerX:e.center.x,centerY:e.center.y});a.push(C(`path`,{"data-cy":`polar-marker-${o}`,d:`M ${c.x},${c.y} ${s.middlePoint.x},${s.middlePoint.y}`,stroke:t.color,"stroke-width":b(i.markerStrokeWidth,1),"stroke-linecap":`round`,"stroke-linejoin":`round`,fill:`none`})),a.push(C(`circle`,{"data-cy":`polar-label-marker-${o}`,cx:c.x,cy:c.y,r:b(i.markerRadius,3),fill:t.color,stroke:I(e.config),"stroke-width":1}))}),a.length?j(`g`,{"data-layer":`polar-label-markers`},a.join(``)):``}function $(e,t){return e==null||e===``?``:M(e,{"text-anchor":`middle`,...t})}function Fe(e,n,r){if(T(e.config,`type`,`classic`)!==`classic`||B(e.config)||!n)return``;let i=x(e.config,`layout.labels.hollow`,{}),a=i.total??{},o=i.average??{},s=[];if(a.show){let r=b(a.fontSize,14),i=!!o.show,c=e.center.y-(i?r:0)+b(a.offsetY,0),l=a.value??{},u=b(l.fontSize,r),d=f(l.formatter,n,t({p:l.prefix??``,v:n,s:l.suffix??``,r:b(l.rounding,0)}),{total:n});s.push($(a.text??``,{"data-cy":`hollow-total-name`,x:e.center.x,y:c,fill:O(a.color,A(e.config)),"font-size":r,"font-weight":a.bold?`700`:`400`})),s.push($(d,{"data-cy":`hollow-total-value`,x:e.center.x,y:e.center.y+r-(i?r:0)+b(l.offsetY,0),fill:O(l.color,O(a.color,A(e.config))),"font-size":u,"font-weight":l.bold?`700`:`400`}))}if(o.show){let i=b(o.fontSize,14),c=!!a.show,l=n/Math.max(1,r.length),u=o.value??{},d=b(u.fontSize,i),p=f(u.formatter,l,t({p:u.prefix??``,v:l,s:u.suffix??``,r:b(u.rounding,0)}),{average:l});s.push($(o.text??``,{"data-cy":`hollow-average-name`,x:e.center.x,y:e.center.y+(c?i:0)+b(o.offsetY,0),fill:O(o.color,A(e.config)),"font-size":i,"font-weight":o.bold?`700`:`400`})),s.push($(p,{"data-cy":`hollow-average-value`,x:e.center.x,y:e.center.y+(c?i:0)+i+b(u.offsetY,0),fill:O(u.color,O(o.color,A(e.config))),"font-size":d,"font-weight":u.bold?`700`:`400`}))}return s.filter(Boolean).length?j(`g`,{class:`vue-data-ui-donut-hollow-labels`,"data-layer":`hollow-labels`},s.join(``)):``}function Ie(e,n){let{config:r,center:i}=e,a=x(r,`layout.donut.labels.total`,x(r,`layout.labels.total`,{}));if(!a.show||!Number.isFinite(n)||n<=0)return``;let o=x(r,`layout.labels.dataLabels`,{}),s=b(a.fontSize,20),c=O(a.color,A(r)),l=f(a.formatter,n,t({p:o.prefix??``,v:n,s:o.suffix??``,r:b(a.rounding,0)}),{total:n});return M(l,{"data-cy":`donut-total`,x:i.x,y:i.y+s/3,"font-size":s,"font-weight":a.bold?`700`:`400`,"text-anchor":`middle`,fill:c})}function Le(e,t){let n=R(L(e));return n?b(t.value,0)/n*100:0}function Re(e,n){let r=x(e.config,`legend`,{}),i=x(e.config,`layout.labels`,{}),a=i.dataLabels??{},o=i.value??{},s=t({p:a.prefix??``,v:n.value,s:a.suffix??``,r:b(r.roundingValue,o.rounding??0)});return f(o.formatter,n.value,s,{datapoint:n,serie:n})}function ze(e,n){let r=x(e.config,`legend`,{}),i=x(e.config,`layout.labels`,{}).percentage??{},a=Le(e,n),o=t({v:a,s:`%`,r:b(r.roundingPercentage,i.rounding??0)});return f(i.formatter,a,o,{datapoint:n,serie:n})}function Be(e,t){let n=x(e.config,`legend`,{}),r=[],i=n.showPercentage?ze(e,t):``,a=n.showValue?Re(e,t):``,o=i&&n.usePercentageParens?`(${i})`:i,s=a&&n.useValueParens?`(${a})`:a;return n.showValueFirst?(s&&r.push(s),o&&r.push(o)):(o&&r.push(o),s&&r.push(s)),`${t.name}${r.length?`: ${r.join(` `)}`:``}`}function Ve(e,t){let n=x(e.config,`legend`,{});if(!n.show||!t.length)return``;let r=z(e,t),i=O(n.color,A(e.config)),a=n.position||`bottom`,o=Math.max(r.markerSize,r.fontSize),s=a===`top`?r.padding+o:e.height-r.height+r.padding+o,c=[];return r.rows.forEach((t,a)=>{let l=r.padding+(e.width-r.padding*2)/2-t.width/2,u=s+a*(o+r.rowGap);t.items.forEach(({serie:e,label:t,itemWidth:a})=>{c.push(C(`circle`,{cx:l+r.markerSize/2,cy:u,r:r.markerSize/2,fill:e.color,opacity:e.opacity??1})),c.push(M(t,{x:l+r.markerSize+r.labelGap,y:u+2,"font-size":r.fontSize,"font-weight":n.bold?`700`:`400`,"dominant-baseline":`middle`,fill:i,opacity:e.opacity??1})),l+=a+r.itemGap})}),j(`g`,{"data-layer":`legend`,"data-cy":`donut-div-legend`},c.join(``))}function He(e){return j(`g`,{"data-layer":`no-data`},[C(`circle`,{cx:e.center.x,cy:e.center.y,r:Math.max(1,e.radius),fill:O(x(e.config,`layout.donut.emptyFill`,`#E1E5E8`),`#E1E5E8`),opacity:.4})].join(``))}function Ue(e,t){let n=e.additionalSvgContent;return typeof n==`function`?n({width:e.width,height:e.height,drawingArea:e.drawingArea,center:e.center,radius:e.radius,thickness:e.thickness,innerRadius:e.innerRadius,config:e.config,series:t.map(e=>({...e}))})??``:n??``}function We(e,t,n){let r=`${T(e.config,`title.text`,`Donut chart`)||e.svgTitle||`Donut chart`}. ${t.length} series. Total ${u(n)}.`;return j(`title`,{},_(r))}async function Ge(e){let t=e.config,n=b(e.width,x(t,`width`,512)),r=b(e.height,x(t,`height`,512)),i=L(e),a=R(i),o=me({...e,width:n,height:r},i),s=he(o,i),c=ge(o,i),l=T(t,`type`,`classic`),u=a>0&&s.some(e=>b(e.proportion,0)>0);return`
2
2
  <svg
3
3
  xmlns="${v}"
4
4
  width="100%"
@@ -1,4 +1,4 @@
1
- import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{t}from"./useConfig-D3ZfFSE5.js";import{$ as n,Bt as r,D as i,Dt as a,Ht as o,It as s,Jt as c,S as l,X as u,Y as ee,Yt as te,Zt as ne,at as d,b as re,dt as ie,f,h as p,i as m,in as ae,it as oe,j as se,nn as ce,nt as le,p as h,s as ue,t as de,ut as fe,w as pe,yt as me,zt as he}from"./lib-rPeBMZrn.js";import{n as ge,t as _e}from"./BaseScanner-8NdoBs7B.js";import{n as ve,t as ye}from"./useHints-C-TwxM0Y.js";import{t as be}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{t as xe}from"./useNestedProp-DnGoh-XS.js";import{t as Se}from"./useThemeCheck-BKNRbGeC.js";import{t as Ce}from"./chartImage-DPGnEuYM.js";import{n as we}from"./Title-BliHuXfT.js";import{t as Te}from"./useChartExport-BZts4KFb.js";import{n as Ee,t as De}from"./tableIntegration-CNoJ1CIY.js";import{n as Oe,t as ke}from"./annotationSlots-RvQBEO9-.js";import{n as Ae,t as je}from"./userOptionsSlots-DYuo-E5m.js";import{t as Me}from"./usePrinter-DVf3YcG5.js";import{t as Ne}from"./Shape-CRe8woTu.js";import{c as Pe}from"./canvas-lib-22VpOI4_.js";import{t as Fe}from"./useResponsive-CENUxfEL.js";import{t as Ie}from"./DefGrad-DKMq1REY.js";import{t as Le}from"./BaseLegendToggle-aT9fOoGO.js";import{t as Re}from"./A11yDataTable-DWNlWXzs.js";import{t as ze}from"./useUserOptionState-CXlFnwPv.js";import{t as Be}from"./useChartAccessibility-DOMuYJfm.js";import{n as Ve,t as He}from"./labelUtils-CdtU-yB_.js";import{t as Ue}from"./vue_ui_donut-T5PeOqvf.js";import{t as We}from"./Legend-DM0ClX3D.js";import{Fragment as g,Teleport as Ge,computed as _,createBlock as v,createCommentVNode as y,createElementBlock as b,createElementVNode as x,createSlots as Ke,createTextVNode as qe,createVNode as Je,defineAsyncComponent as Ye,guardReactiveProps as Xe,mergeProps as Ze,nextTick as Qe,normalizeClass as $e,normalizeProps as et,normalizeStyle as S,onBeforeUnmount as tt,onMounted as nt,openBlock as C,ref as w,renderList as T,renderSlot as E,resolveDynamicComponent as rt,shallowRef as it,toDisplayString as D,toRefs as at,unref as O,useSlots as ot,vShow as st,watch as ct,withCtx as k,withDirectives as lt}from"vue";function ut(e){let{FINAL_CONFIG:t,noGhostDonut:n,svg:r,padding:i,labels_inline_fontSize:a,minSize:o,findArcMidpoint:s,calcMarkerOffsetX:c,calcMarkerOffsetY:l,animatingIndex:u,segregated:ee,isSmallArc:te}=e;return{smallArcLayoutsClassic:_(()=>{if(t.value.type!==`classic`)return{};let e={},ne=n.value||[];if(!ne.length)return e;let d=r.value.width/2,re=r.value.height/2,ie=i.value.top+16,f=r.value.height-i.value.bottom-16,p=a.value,m=p/3,ae=p*1.5,oe=d-(o.value+6),se=d+(o.value+6),ce=!!t.value.style.chart.layout.curvedMarkers;function le({midX:e,midY:t,bandX:n,bandY:r}){if(!ce)return`M ${e} ${t} L ${e} ${r} L ${n} ${r}`;let i=n<d?-1:1,a=n-e,o=r-t,s=Math.sqrt(a*a+o*o)||1,c=e-d,l=t-re,u=Math.sqrt(c*c+l*l)||1,ee=c/u,te=l/u,ne=u+9;function ie({x:e,y:t}){let n=e-d,r=t-re,i=Math.sqrt(n*n+r*r)||1;if(i>=ne)return{x:e,y:t};let a=ne/i;return{x:d+n*a,y:re+r*a}}if(s<56){let i=a/s,c=-(o/s),l=i,u=(e+n)*.5,ne=(t+r)*.5,f=u+c,p=ne+l,m=(f-d)*(f-d)+(p-re)*(p-re),ae=u-c,oe=ne-l;(ae-d)*(ae-d)+(oe-re)*(oe-re)>m&&(c=-c,l=-l);let se=.78,ce=e+a*se,le=t+o*se,h=Math.max(0,Math.min(1,(s-18)/44)),ue=h*h*(3-2*h),de=2.5+ue*4,fe=1+ue*2.5;de*=.9;let pe=ie({x:ce+c*de+ee*fe,y:le+l*de+te*fe});return`M ${e} ${t} Q ${pe.x} ${pe.y} ${n} ${r}`}let f=s*.34;f<20&&(f=20),f>46&&(f=46);let p=s*.46;p<22&&(p=22),p>70&&(p=70);let m={x:e+ee*f,y:t+te*f},ae=d+i*Math.max(Math.abs(n-d),ne),oe={x:n-i*Math.min(p,Math.abs(ae-n)*.75),y:r},se=ie(m),le=ie(oe);return`M ${e} ${t} C ${se.x} ${se.y} ${le.x} ${le.y} ${n} ${r}`}function h(e){let t=String(e??``).split(/\n/g),n=Math.max(0,t.length-1)*(p*1.2);return ae+n}function ue({arc:e,index:t}){let{x:n,y:r}=s(e.path);return{arc:e,index:t,midX:n,midY:r,inlineMarkerX:c(e).x,inlineMarkerY:l(e)-3.5,labelHeight:h(e.name)}}function de(e){let{arc:t}=e,n=t.seriesIndex??0;return u.value===n||ee.value.includes(n)?!1:te(t,n)}function fe(e){let t=e.inlineMarkerY<re,n=e.inlineMarkerX<d;return t&&n?`TL`:t&&!n?`TR`:!t&&n?`BL`:`BR`}function pe(e,t){t.startsWith(`T`)?e.sort((e,t)=>e.inlineMarkerY-t.inlineMarkerY||e.index-t.index):e.sort((e,t)=>t.inlineMarkerY-e.inlineMarkerY||e.index-t.index)}function me({side:e,markerX:t,markerY:n,labelY:r,connectorPath:i}){return{side:e,labelX:e===`left`?t-8:t+8,labelY:r+m,textAnchor:e===`left`?`end`:`start`,markerX:t,markerY:n,connectorPath:i}}function he({candidateList:t,side:n,bandMarkerX:r,startY:i,direction:a}){let o=i;t.forEach(t=>{let{index:i,midX:s,midY:c,labelHeight:l}=t,u;a===`down`?(u=o,o+=l):(o-=l,u=o);let ee=u,te=le({midX:s,midY:c,bandX:r,bandY:ee});e[i]=me({side:n,markerX:r,markerY:ee,labelY:u,connectorPath:te})})}let ge=ne.map((e,t)=>ue({arc:e,index:t})).filter(de),_e={TL:[],TR:[],BL:[],BR:[]};return ge.forEach(e=>{_e[fe(e)].push(e)}),Object.keys(_e).forEach(e=>{pe(_e[e],e)}),he({candidateList:_e.TL,side:`left`,bandMarkerX:oe,startY:ie,direction:`down`}),he({candidateList:_e.TR,side:`right`,bandMarkerX:se,startY:ie,direction:`down`}),_e.BL.length>1&&he({candidateList:_e.BL,side:`left`,bandMarkerX:oe,startY:f,direction:`up`}),_e.BR.length>1&&he({candidateList:_e.BR,side:`right`,bandMarkerX:se,startY:f,direction:`up`}),e})}}var dt=/* @__PURE__ */ e({default:()=>En}),ft=[`id`],pt=[`id`],mt=[`id`],ht={style:{position:`relative`}},gt=[`xmlns`,`aria-describedby`,`viewBox`],_t=[`width`,`height`],vt={key:1},yt={key:2},bt=[`id`],xt=[`id`],St=[`id`],Ct=[`flood-color`],wt=[`id`],Tt=[`flood-color`],Et=[`d`,`stroke`,`filter`],Dt=[`d`,`stroke`,`filter`],Ot=[`cx`,`cy`,`r`,`fill`,`filter`],kt={key:6},At=[`stroke`,`d`],jt=[`d`,`fill`,`stroke`,`stroke-width`,`filter`],Mt={key:0},Nt=[`d`,`fill`,`stroke`,`stroke-width`,`filter`],Pt={key:0},Ft=[`stroke`,`d`],It={key:0},Lt=[`d`,`stroke`,`stroke-width`,`filter`],Rt={key:1},zt=[`d`,`fill`,`stroke`,`stroke-width`,`filter`],Bt=[`d`,`fill`,`stroke`,`stroke-width`,`filter`],Vt={key:1},Ht=[`cx`,`cy`,`r`,`fill`,`stroke`,`stroke-width`],Ut=[`cx`,`cy`,`r`,`fill`,`stroke`,`stroke-width`],Wt={key:0},Gt=[`d`,`fill`,`stroke`,`stroke-width`],Kt=[`cx`,`cy`,`r`,`stroke`],qt=[`cx`,`cy`,`r`,`fill`],Jt=[`cx`,`cy`,`r`],Yt={key:0},Xt=[`d`,`stroke`,`fill`,`onMouseenter`,`onMouseleave`,`onClick`],Zt={key:1},Qt=[`cx`,`cy`,`r`],$t=[`x`,`y`,`fill`,`font-size`],en=[`x`,`y`,`fill`,`font-size`],tn=[`x`,`y`,`fill`,`font-size`],nn=[`x`,`y`,`fill`,`font-size`],rn=[`filter`,`opacity`],an={key:0},on=[`x`,`y`],sn={key:1},cn=[`cx`,`cy`,`fill`,`stroke`,`filter`,`onClick`,`onMouseenter`,`onMouseleave`],ln=[`text-anchor`,`x`,`y`,`onClick`,`onMouseenter`,`onMouseleave`,`innerHTML`],un=[`text-anchor`,`x`,`y`,`fill`,`font-size`,`onClick`,`onMouseenter`,`onMouseleave`],dn=[`text-anchor`,`x`,`y`,`fill`,`font-size`,`onClick`,`onMouseenter`,`onMouseleave`,`innerHTML`],fn=[`cx`,`cy`,`fill`,`stroke`,`filter`,`onClick`,`onMouseenter`,`onMouseleave`],pn=[`text-anchor`,`x`,`y`,`onClick`,`onMouseenter`,`onMouseleave`,`innerHTML`],mn=[`text-anchor`,`x`,`y`,`fill`,`font-size`,`onClick`,`onMouseenter`,`onMouseleave`],hn=[`text-anchor`,`x`,`y`,`fill`,`font-size`,`onClick`,`onMouseenter`,`onMouseleave`,`innerHTML`],gn={key:2},_n=[`x`,`y`,`width`],vn=[`x`,`y`,`width`],yn={key:0,style:{position:`absolute`,top:`100%`,left:`0`,width:`100%`},"data-dom-to-png-ignore":``,"aria-hidden":`true`},bn={key:5,class:`vue-data-ui-watermark`},xn=[`id`],Sn=[`onClick`],Cn={key:8,class:`vue-ui-donut-hollow`},wn={key:0},Tn={key:1},En=/*#__PURE__*/ be({__name:`vue-ui-donut`,props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:[`selectLegend`,`selectDatapoint`,`copyAlt`],setup(e,{expose:be,emit:dt}){let En=Ye(()=>import(`./Tooltip-C1q0Qoh7.js`)),Dn=Ye(()=>import(`./BaseIcon-fYK0iID8.js`).then(e=>e.n)),On=Ye(()=>import(`./vue-ui-accordion-D4FHxzsL.js`).then(e=>e.n)),kn=Ye(()=>import(`./DataTable-5Ug6gMAX.js`)),An=Ye(()=>import(`./PenAndPaper-r50tK3S4.js`).then(e=>e.t)),jn=Ye(()=>import(`./UserOptions-Em_JgDXM.js`).then(e=>e.n)),Mn=Ye(()=>import(`./PackageVersion-DWlHsdPa.js`).then(e=>e.t)),Nn=Ye(()=>import(`./BaseDraggableDialog-9d30Yx8c.js`).then(e=>e.n)),{vue_ui_donut:Pn}=t(),{isThemeValid:Fn,warnInvalidTheme:In}=Se(),Ln=ot(),A=e,Rn=_({get(){return!!A.dataset&&A.dataset.length},set(e){return e}}),zn=it(null),Bn=w(null),Vn=w(null),Hn=w(null),Un=it(null),Wn=it(null),Gn=it(null),Kn=it(null),qn=it(null),Jn=it(null),Yn=w(0),Xn=w(0),Zn=w(0),Qn=w(!1),$n=w(null),er=w(null),tr=w(null),nr=w({x:0,y:0}),rr=w(`pointer`),ir=w(!1),ar=_({get:()=>P.value.style.chart.layout.labels.percentage.fontSize,set:e=>e}),j=_({get:()=>P.value.style.chart.layout.labels.name.fontSize,set:e=>e}),or=_({get:()=>P.value.style.chart.layout.labels.dataLabels.smallArcClusterFontSize,set:e=>e}),sr=!1,cr=()=>{P.value.autoSize&&!sr&&(sr=!0,requestAnimationFrame(()=>{sr=!1;let e=P.value,t=Bn.value,n=z.value;if(!e.autoSize||!t||!n)return;let[r,i,a,o]=n.getAttribute(`viewBox`).split(` `).map(Number),s={x:r,y:i,width:a,height:o},c=[{selector:`.vue-data-ui-datalabel-value`,baseSize:F.value.percentage.fontSize,minSize:F.value.percentage.minFontSize,sizeRef:ar},{selector:`.vue-data-ui-datalabel-name`,baseSize:F.value.name.fontSize,minSize:F.value.name.minFontSize,sizeRef:j},{selector:`.vue-data-ui-datalabel-inline`,baseSize:F.value.dataLabels.smallArcClusterFontSize,minSize:F.value.name.minFontSize,sizeRef:or}];c.map(e=>t.querySelectorAll(e.selector).length).reduce((e,t)=>e+t,0)!==0&&c.forEach(({selector:e,baseSize:n,minSize:r,sizeRef:i})=>{t.querySelectorAll(e).forEach(e=>{i.value=ue({el:e,bounds:s,currentFontSize:n,minFontSize:r,attempts:200,padding:1})})})}))};nt(async()=>{Qn.value=!0,dr(),requestAnimationFrame(cr)});let lr;nt(()=>{zn.value&&(lr=new ResizeObserver(e=>{for(let t of e){let{width:e,height:n}=t.contentRect;if(e>0&&n>0){cr();break}}}),lr.observe(zn.value.parentElement))}),tt(()=>{lr?.disconnect()}),tt(()=>{Gn.value&&(Kn.value&&Gn.value.unobserve(Kn.value),Gn.value.disconnect())});let ur=_(()=>P.value.debug);function dr(){if(he(A.dataset)?(d({componentName:`VueUiDonut`,type:`dataset`,debug:ur.value}),Rn.value=!1,xr.value=!0):(A.dataset.forEach((e,t)=>{me({datasetObject:e,requiredAttributes:[`name`,`values`]}).forEach(e=>{d({componentName:`VueUiDonut`,type:`datasetSerieAttribute`,property:e,index:t,debug:ur.value}),Rn.value=!1,xr.value=!0})}),ur.value&&A.dataset.forEach((e,t)=>{e.name&&e.name!==``||d({componentName:`VueUiDonut`,type:`datasetAttributeEmpty`,property:`name`,index:t})})),he(A.dataset)||(xr.value=P.value.loading),P.value.responsive){let e=Pe(()=>{let{width:e,height:t}=Fe({chart:zn.value,title:P.value.style.chart.title.text?Un.value:null,legend:P.value.style.chart.legend.show?Wn.value:null,source:qn.value,noTitle:Jn.value,padding:P.value.autoSize?void 0:Nr.value});requestAnimationFrame(()=>{V.value.width=e,V.value.height=t,cr()})});Gn.value&&(Kn.value&&Gn.value.unobserve(Kn.value),Gn.value.disconnect()),Gn.value=new ResizeObserver(e),Kn.value=zn.value.parentNode,Gn.value.observe(Kn.value)}}let M=w(u()),fr=w(!1),pr=w(``),N=w(null),mr=w(0);function hr(){let e=xe({userConfig:A.config,defaultConfig:Pn}),t={},n=e.theme;if(!n)t=e;else if(!Fn.value(e))In(e),t=e;else{let r=xe({userConfig:Ue[n]||A.config,defaultConfig:e});t={...xe({userConfig:A.config,defaultConfig:r}),customPalette:e.customPalette.length?e.customPalette:ce[n]||o}}return t}let P=w(hr()),F=_(()=>P.value.style.chart.layout.labels),I=_(()=>P.value.style.chart.layout.donut),gr=_(()=>P.value.style.chart.layout),L=_(()=>P.value.style.chart);ve({config:()=>P.value,dataset:()=>A.dataset,component:`VueUiDonut`,rules:[ye.singleSeries,ye.emptyArray,{test:e=>e.length>6,message:[`👀 The number of series is > 6. 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.`]}]});let _r=_(()=>P.value.userOptions.useCursorPointer),vr=_(()=>ae({defaultConfig:{useCssAnimation:!1,table:{show:!1},startAnimation:{show:!1},userOptions:{show:!1},style:{chart:{backgroundColor:`#99999930`,layout:{labels:{dataLabels:{show:!1},hollow:{average:{show:!1},total:{show:!1}},value:{show:!1}}},legend:{backgroundColor:`transparent`,showValue:!1,showPercentage:!1},title:{color:`#1A1A1A`,subtitle:{color:`#5A5A5A`}}}}},userConfig:P.value.skeletonConfig??{}})),{loading:yr,FINAL_DATASET:br,manualLoading:xr,skeletonDataset:Sr}=ge({...at(A),FINAL_CONFIG:P,prepareConfig:hr,skeletonDataset:A.config?.skeletonDataset??[{name:``,values:[3],color:`#BABABA`},{name:``,values:[2],color:`#AAAAAA`},{name:``,values:[1],color:`#CACACA`}],skeletonConfig:ae({defaultConfig:P.value,userConfig:vr.value})}),R=w(!0),Cr=w(0),wr=w(!1),Tr=null;function Er(e=1e3){return new Promise(t=>{let n=performance.now();function r(i){let a=i-n,o=Math.min(a/e,1),s=oe(o);Cr.value=s,o<1?Tr=requestAnimationFrame(r):(Cr.value=1,Tr=null,t())}Tr!==null&&cancelAnimationFrame(Tr),Cr.value=0,Tr=requestAnimationFrame(r)})}ct(()=>yr.value,async e=>{if(e||wr.value)return;let t=br.value===Sr,n=P.value.startAnimation?.show;!t&&n?(wr.value=!0,await Er(P.value.startAnimation.durationMs||1e3)):Cr.value=1,R.value=!1},{immediate:!0});let{userOptionsVisible:Dr,setUserOptionsVisibility:Or,keepUserOptionState:kr}=ze({config:P.value}),{svgRef:z}=Be({config:L.value.title});function Ar(){Or(!0)}function jr(){Or(!1)}let Mr=ne(A.config);ct(()=>A.config,(e,t)=>{let n=ne(e),r=n!==Mr;Mr=n;let i=hr();r?(yr.value||(P.value=i),Dr.value=!P.value.userOptions.showOnChartHover,dr(),Yn.value+=1,Xn.value+=1,Zn.value+=1,B.value.dataLabels.show=F.value.dataLabels.show,B.value.showTable=P.value.table.show,B.value.showTooltip=L.value.tooltip.show,V.value.height=L.value.height,V.value.width=L.value.width):(P.value.style.chart.tooltip=i.style.chart.tooltip,B.value.showTooltip=P.value.style.chart.tooltip.show)},{deep:!0});let Nr=_(()=>{let{top:e,right:t,bottom:n,left:r}=L.value.padding;return{css:`padding:${e}px ${t}px ${n}px ${r}px`,top:e,right:t,bottom:n,left:r}}),{isPrinting:Pr,isImaging:Fr,generatePdf:Ir,generateImage:Lr}=Me({elementId:`donut__${M.value}`,fileName:L.value.title.text||`vue-ui-donut`,options:P.value.userOptions.print}),Rr=_(()=>P.value.userOptions.show&&!L.value.title.text),zr=_(()=>pe(P.value.customPalette)),B=w({dataLabels:{show:F.value.dataLabels.show},showTable:P.value.table.show,showTooltip:L.value.tooltip.show});ct(P,()=>{B.value={dataLabels:{show:F.value.dataLabels.show},showTable:P.value.table.show,showTooltip:L.value.tooltip.show}},{immediate:!0});let V=w({height:L.value.height,width:L.value.width}),Br=_(()=>{if(P.value.pie)return G.value;let e=I.value.strokeWidth/512,t=Math.min(V.value.width,V.value.height)*e,n=t>G.value?G.value:t;return Math.max(n,12*(1+e))}),Vr=dt,H=_(()=>br.value.sort((e,t)=>{let n=Array.isArray(e.values)?e.values.reduce((e,t)=>e+t,0):e.value??0,r=Array.isArray(t.values)?t.values.reduce((e,t)=>e+t,0):t.value??0;return e.ghost&&!t.ghost?1:t.ghost&&!e.ghost?-1:r-n}).map((e,t)=>({name:e.name,color:l(e.color)||zr.value[t]||o[t]||o[t%o.length],value:re(e.values.reduce((e,t)=>e+t,0)),absoluteValues:e.values,comment:e.comment||``,patternIndex:t,seriesIndex:t,ghost:!1,pattern:`pattern_${M.value}_${t}`})));ct(()=>A.dataset,e=>{Array.isArray(e)&&e.length>0&&(xr.value=!1)},{immediate:!0});let U=it(H.value);ct(()=>H.value,e=>{U.value=e,requestAnimationFrame(cr)});function Hr(){return H.value.map(e=>({name:e.name,color:e.color,value:e.value}))}let W=w([]),Ur=w(!1),Wr=w(null);function Gr(){Vr(`selectLegend`,$r.value.map(e=>({name:e.name,color:e.color,value:e.value})))}function Kr({from:e,to:t,duration:n,onUpdate:r,onDone:i,easing:a=oe}){let o=performance.now();function s(c){let l=Math.min((c-o)/n,1),u=a(l);r(e+(t-e)*u,l),l<1?requestAnimationFrame(s):(r(t,1),i&&i())}requestAnimationFrame(s)}function qr(){W.value.length?W.value=[]:ei.value.forEach((e,t)=>{W.value.push(t)}),Gr()}function Jr(e){let t=H.value.find((t,n)=>n===e),n=U.value.find((t,n)=>n===e).value;if(W.value.includes(e)){W.value=W.value.filter(t=>t!==e);let r=t.value;function i(){U.value=U.value.map((t,n)=>e===n?{...t,value:r}:t),Gr()}function a(){Ur.value=!0,Wr.value=e,Kr({from:n,to:r,duration:P.value.serieToggleAnimation.durationMs,onUpdate:(t,n)=>{U.value=U.value.map((n,r)=>e===r?{...n,value:t}:n),requestAnimationFrame(cr)},onDone:()=>{i(),Ur.value=!1,Wr.value=null}})}P.value.serieToggleAnimation.show&&P.value.type===`classic`?a():(i(),requestAnimationFrame(cr))}else if(W.value.length<H.value.length-1){function t(){W.value.push(e),U.value=U.value.map((t,n)=>e===n?{...t,value:0}:t),Gr()}function r(){Ur.value=!0,Wr.value=e,Kr({from:n,to:0,duration:P.value.serieToggleAnimation.durationMs,onUpdate:(t,n)=>{U.value=U.value.map((n,r)=>e===r?{...n,value:t}:n),requestAnimationFrame(cr)},onDone:()=>{t(),requestAnimationFrame(cr),Ur.value=!1,Wr.value=null}})}P.value.serieToggleAnimation.show&&P.value.type===`classic`?r():t()}}function Yr(e){return H.value.length?H.value.find(t=>t.name===e)||(ur.value&&console.warn(`VueUiDonut - Series name not found "${e}"`),null):(ur.value&&console.warn(`VueUiDonut - There are no series to show.`),null)}function Xr(e){let t=Yr(e);t!==null&&W.value.includes(t.seriesIndex)&&Jr(t.seriesIndex)}function Zr(e){let t=Yr(e);t!==null&&(W.value.includes(t.seriesIndex)||Jr(t.seriesIndex))}let Qr=_(()=>br.value.reduce((e,t)=>e+t.values.reduce((e,t)=>e+t,0),0)),$r=_(()=>{if(R.value&&!yr.value){let e=Cr.value,t=H.value.map(t=>({...t,value:t.value*e,color:t.color,ghost:!1})),n=Qr.value*(1-e);return n>0&&t.push({name:`__ghost__`,value:n,color:`transparent`,ghost:!0}),t}return U.value.forEach(e=>{if([null,void 0].includes(e.values))return{...e,values:[]}}),U.value.map((e,t)=>({...e,seriesIndex:t})).filter((e,t)=>!W.value.includes(t))}),ei=_(()=>br.value.map((e,t)=>{let n=(e.values||[]).reduce((e,t)=>e+t,0),r=n/br.value.map(e=>(e.values||[]).reduce((e,t)=>e+t,0)).reduce((e,t)=>e+t,0);return{name:e.name,color:l(e.color)||zr.value[t]||o[t]||o[t%o.length],value:n,shape:`circle`,patternIndex:t,proportion:r}}).map((e,t)=>{let r=m(F.value.value.formatter,e.value,n({p:F.value.dataLabels.prefix,v:e.value,s:F.value.dataLabels.suffix,r:L.value.legend.roundingValue}),{datapoint:e,index:t}),i=m(F.value.percentage.formatter,di(e),n({v:di(e),s:`%`,r:L.value.legend.roundingPercentage})),a=Di({val:r,percentage:W.value.includes(t)?`${Ei(e.proportion*100)}%`:i,showVal:L.value.legend.showValue,showPercentage:L.value.legend.showPercentage,config:L.value.legend});return{...e,opacity:W.value.includes(t)?.5:1,segregate:()=>!Ur.value&&Jr(t),isSegregated:W.value.includes(t),display:`${e.name}${L.value.legend.showPercentage||L.value.legend.showValue?`: `:``}${a}`}})),ti=_(()=>({cy:`donut-div-legend`,backgroundColor:L.value.legend.backgroundColor,color:L.value.legend.color,fontSize:L.value.legend.fontSize,paddingBottom:12,fontWeight:L.value.legend.bold?`bold`:``})),G=_(()=>{let e=I.value.radiusRatio,t=Math.max(.1,Math.min(.50001,e)),n=Math.min(V.value.width*t,V.value.height*t);return Math.max(12,n)}),K=_(()=>s({series:$r.value},V.value.width/2,V.value.height/2,G.value,G.value,1.99999,2,1,360,105.25,Br.value)),ni=_(()=>Math.abs($r.value.map(e=>e.value).reduce((e,t)=>e+t,0))>0),ri=_(()=>s({series:[{value:1,color:I.value.emptyFill,name:`_`,seriesIndex:0,patternIndex:-1,ghost:!1,absoluteValues:[1]}]},V.value.width/2,V.value.height/2,G.value,G.value,1.99999,2,1,360,105.25,Br.value)),q=_(()=>K.value.filter(e=>!e.ghost)),J=_(()=>{let e=Math.max(...$r.value.map(e=>e.value)),t=$r.value.map(t=>t.value/e);return se({series:t,center:{x:V.value.width/2,y:V.value.height/2},maxRadius:Math.min(V.value.width,V.value.height)/3,hasGhost:R.value})});function ii(e){return e.x>V.value.width/2+6?`start`:e.x<V.value.width/2-6?`end`:`middle`}function ai(e){return e.middlePoint.y>V.value.height/2?r({initX:e.middlePoint.x,initY:e.middlePoint.y,offset:100,centerX:V.value.width/2,centerY:V.value.height/2}).y:r({initX:e.middlePoint.x,initY:e.middlePoint.y,offset:0,centerX:V.value.width/2,centerY:V.value.height/2}).y-100}function Y(e){return e.proportion*100>F.value.dataLabels.hideUnderValue}function oi(e,t){let n=F.value.dataLabels.hideUnderValue,r=F.value.dataLabels.smallArcClusterThreshold,i=(li.value[t]??e.proportion??0)*100;return i>n&&i<=r}let{smallArcLayoutsClassic:X}=ut({FINAL_CONFIG:P,noGhostDonut:q,svg:V,padding:Nr,labels_inline_fontSize:or,minSize:G,findArcMidpoint:fe,calcMarkerOffsetX:f,calcMarkerOffsetY:h,animatingIndex:Wr,segregated:W,isSmallArc:oi});function si(e,t){let r=e.value/ci(t);return isNaN(r)?0:m(F.value.percentage.formatter,r*100,n({v:r*100,s:`%`,r:F.value.percentage.rounding}),{datapoint:e})}function ci(e){return[...e].map(e=>e.value).reduce((e,t)=>e+t,0)}let Z=_(()=>$r.value.map(e=>e.value).reduce((e,t)=>e+t,0)),li=_(()=>{let e=H.value.reduce((e,t)=>e+t.value,0);return e<=0?[]:H.value.map(t=>t.value/e)}),ui=_(()=>Z.value/$r.value.length);function di(e){return Ur.value?e.proportion*100:e.value/Z.value*100}let fi=w(null),pi=w(!1);function mi({datapoint:e,seriesIndex:t}){P.value.events.datapointLeave&&P.value.events.datapointLeave({datapoint:e,seriesIndex:t}),fr.value=!1,N.value=null,tr.value=null,rr.value=`pointer`}function Q({datapoint:e,relativeIndex:t,seriesIndex:r,show:i=!1,triggerMode:o=`pointer`}){P.value.events.datapointEnter&&P.value.events.datapointEnter({datapoint:e,seriesIndex:r}),rr.value=o,tr.value=t,fi.value={datapoint:e,seriesIndex:r,config:P.value,series:H.value},fr.value=i,N.value=t;let s=``,l=L.value.tooltip.customFormat;if(pi.value=!1,a(l))try{let t=l({seriesIndex:r,datapoint:e,series:H.value,config:P.value});typeof t==`string`&&(pr.value=t,pi.value=!0)}catch{console.warn(`Custom format cannot be applied.`),pi.value=!1}pi.value||(s+=`<div style="width:100%;text-align:center;border-bottom:1px solid ${L.value.tooltip.borderColor};padding-bottom:6px;margin-bottom:3px;">${e.name}</div>`,s+=`<div style="display:flex;flex-direction:row;gap:6px;align-items:center;"><svg viewBox="0 0 60 60" height="14" width="14"><circle cx="30" cy="30" r="30" stroke="none" fill="${e.color}"/>${Ln.pattern?`<circle cx="30" cy="30" r="30" stroke="none" fill="url(#pattern_${M.value}_${r})"/>`:``}</svg>`,s+=`<b>${Di({showVal:L.value.tooltip.showValue,showPercentage:L.value.tooltip.showPercentage,val:`<span>${m(F.value.value.formatter,e.value,n({p:F.value.dataLabels.prefix,v:e.value,s:F.value.dataLabels.suffix,r:L.value.tooltip.roundingValue}),{datapoint:e,relativeIndex:t,seriesIndex:r})}</span>`,percentage:m(F.value.percentage.formatter,e.proportion*100,n({v:e.proportion*100,s:`%`,r:L.value.tooltip.roundingPercentage}),{datapoint:e,relativeIndex:t,seriesIndex:r}),config:L.value.tooltip})}</b></div>`,L.value.comments.showInTooltip&&e.comment&&(s+=`<div class="vue-data-ui-tooltip-comment" style="background:${c(e.color,12.5)}; padding: 6px; margin-bottom: 6px; margin-top:6px; border-left: 1px solid ${e.color}">${e.comment}</div>`),pr.value=`<div>${s}</div>`)}function hi(e,t){let n=X.value[t];if(n)return{textAnchor:n.textAnchor,x:n.labelX,y:n.labelY};let r=f(e,!0,12);return{textAnchor:r.anchor,x:r.x,y:h(e)}}function gi(e,t,n){let{textAnchor:r,x:i}=hi(e,t),a=Oi(e),o=`
1
+ import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{t}from"./useConfig-D3ZfFSE5.js";import{$ as n,Bt as r,D as i,Dt as a,Ht as o,It as s,Jt as c,S as l,X as u,Y as ee,Yt as te,Zt as ne,at as d,b as re,dt as ie,f,h as p,i as m,in as ae,it as oe,j as se,nn as ce,nt as le,p as h,s as ue,t as de,ut as fe,w as pe,yt as me,zt as he}from"./lib-rPeBMZrn.js";import{n as ge,t as _e}from"./BaseScanner-8NdoBs7B.js";import{n as ve,t as ye}from"./useHints-C-TwxM0Y.js";import{t as be}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{t as xe}from"./useNestedProp-DnGoh-XS.js";import{t as Se}from"./useThemeCheck-BKNRbGeC.js";import{t as Ce}from"./chartImage-DPGnEuYM.js";import{n as we}from"./Title-BliHuXfT.js";import{t as Te}from"./useChartExport-BZts4KFb.js";import{n as Ee,t as De}from"./tableIntegration-CNoJ1CIY.js";import{n as Oe,t as ke}from"./annotationSlots-RvQBEO9-.js";import{n as Ae,t as je}from"./userOptionsSlots-DYuo-E5m.js";import{t as Me}from"./usePrinter-DVf3YcG5.js";import{t as Ne}from"./Shape-CRe8woTu.js";import{c as Pe}from"./canvas-lib-22VpOI4_.js";import{t as Fe}from"./useResponsive-CENUxfEL.js";import{t as Ie}from"./DefGrad-DKMq1REY.js";import{t as Le}from"./BaseLegendToggle-aT9fOoGO.js";import{t as Re}from"./A11yDataTable-DWNlWXzs.js";import{t as ze}from"./useUserOptionState-CXlFnwPv.js";import{t as Be}from"./useChartAccessibility-DOMuYJfm.js";import{n as Ve,t as He}from"./labelUtils-CdtU-yB_.js";import{t as Ue}from"./vue_ui_donut-T5PeOqvf.js";import{t as We}from"./Legend-DM0ClX3D.js";import{Fragment as g,Teleport as Ge,computed as _,createBlock as v,createCommentVNode as y,createElementBlock as b,createElementVNode as x,createSlots as Ke,createTextVNode as qe,createVNode as Je,defineAsyncComponent as Ye,guardReactiveProps as Xe,mergeProps as Ze,nextTick as Qe,normalizeClass as $e,normalizeProps as et,normalizeStyle as S,onBeforeUnmount as tt,onMounted as nt,openBlock as C,ref as w,renderList as T,renderSlot as E,resolveDynamicComponent as rt,shallowRef as it,toDisplayString as D,toRefs as at,unref as O,useSlots as ot,vShow as st,watch as ct,withCtx as k,withDirectives as lt}from"vue";function ut(e){let{FINAL_CONFIG:t,noGhostDonut:n,svg:r,padding:i,labels_inline_fontSize:a,minSize:o,findArcMidpoint:s,calcMarkerOffsetX:c,calcMarkerOffsetY:l,animatingIndex:u,segregated:ee,isSmallArc:te}=e;return{smallArcLayoutsClassic:_(()=>{if(t.value.type!==`classic`)return{};let e={},ne=n.value||[];if(!ne.length)return e;let d=r.value.width/2,re=r.value.height/2,ie=i.value.top+16,f=r.value.height-i.value.bottom-16,p=a.value,m=p/3,ae=p*1.5,oe=d-(o.value+6),se=d+(o.value+6),ce=!!t.value.style.chart.layout.curvedMarkers;function le({midX:e,midY:t,bandX:n,bandY:r}){if(!ce)return`M ${e} ${t} L ${e} ${r} L ${n} ${r}`;let i=n<d?-1:1,a=n-e,o=r-t,s=Math.sqrt(a*a+o*o)||1,c=e-d,l=t-re,u=Math.sqrt(c*c+l*l)||1,ee=c/u,te=l/u,ne=u+9;function ie({x:e,y:t}){let n=e-d,r=t-re,i=Math.sqrt(n*n+r*r)||1;if(i>=ne)return{x:e,y:t};let a=ne/i;return{x:d+n*a,y:re+r*a}}if(s<56){let i=a/s,c=-(o/s),l=i,u=(e+n)*.5,ne=(t+r)*.5,f=u+c,p=ne+l,m=(f-d)*(f-d)+(p-re)*(p-re),ae=u-c,oe=ne-l;(ae-d)*(ae-d)+(oe-re)*(oe-re)>m&&(c=-c,l=-l);let se=.78,ce=e+a*se,le=t+o*se,h=Math.max(0,Math.min(1,(s-18)/44)),ue=h*h*(3-2*h),de=2.5+ue*4,fe=1+ue*2.5;de*=.9;let pe=ie({x:ce+c*de+ee*fe,y:le+l*de+te*fe});return`M ${e} ${t} Q ${pe.x} ${pe.y} ${n} ${r}`}let f=s*.34;f<20&&(f=20),f>46&&(f=46);let p=s*.46;p<22&&(p=22),p>70&&(p=70);let m={x:e+ee*f,y:t+te*f},ae=d+i*Math.max(Math.abs(n-d),ne),oe={x:n-i*Math.min(p,Math.abs(ae-n)*.75),y:r},se=ie(m),le=ie(oe);return`M ${e} ${t} C ${se.x} ${se.y} ${le.x} ${le.y} ${n} ${r}`}function h(e){let t=String(e??``).split(/\n/g),n=Math.max(0,t.length-1)*(p*1.2);return ae+n}function ue({arc:e,index:t}){let{x:n,y:r}=s(e.path);return{arc:e,index:t,midX:n,midY:r,inlineMarkerX:c(e).x,inlineMarkerY:l(e)-3.5,labelHeight:h(e.name)}}function de(e){let{arc:t}=e,n=t.seriesIndex??0;return u.value===n||ee.value.includes(n)?!1:te(t,n)}function fe(e){let t=e.inlineMarkerY<re,n=e.inlineMarkerX<d;return t&&n?`TL`:t&&!n?`TR`:!t&&n?`BL`:`BR`}function pe(e,t){t.startsWith(`T`)?e.sort((e,t)=>e.inlineMarkerY-t.inlineMarkerY||e.index-t.index):e.sort((e,t)=>t.inlineMarkerY-e.inlineMarkerY||e.index-t.index)}function me({side:e,markerX:t,markerY:n,labelY:r,connectorPath:i}){return{side:e,labelX:e===`left`?t-8:t+8,labelY:r+m,textAnchor:e===`left`?`end`:`start`,markerX:t,markerY:n,connectorPath:i}}function he({candidateList:t,side:n,bandMarkerX:r,startY:i,direction:a}){let o=i;t.forEach(t=>{let{index:i,midX:s,midY:c,labelHeight:l}=t,u;a===`down`?(u=o,o+=l):(o-=l,u=o);let ee=u,te=le({midX:s,midY:c,bandX:r,bandY:ee});e[i]=me({side:n,markerX:r,markerY:ee,labelY:u,connectorPath:te})})}let ge=ne.map((e,t)=>ue({arc:e,index:t})).filter(de),_e={TL:[],TR:[],BL:[],BR:[]};return ge.forEach(e=>{_e[fe(e)].push(e)}),Object.keys(_e).forEach(e=>{pe(_e[e],e)}),he({candidateList:_e.TL,side:`left`,bandMarkerX:oe,startY:ie,direction:`down`}),he({candidateList:_e.TR,side:`right`,bandMarkerX:se,startY:ie,direction:`down`}),_e.BL.length>1&&he({candidateList:_e.BL,side:`left`,bandMarkerX:oe,startY:f,direction:`up`}),_e.BR.length>1&&he({candidateList:_e.BR,side:`right`,bandMarkerX:se,startY:f,direction:`up`}),e})}}var dt=/* @__PURE__ */ e({default:()=>En}),ft=[`id`],pt=[`id`],mt=[`id`],ht={style:{position:`relative`}},gt=[`xmlns`,`aria-describedby`,`viewBox`],_t=[`width`,`height`],vt={key:1},yt={key:2},bt=[`id`],xt=[`id`],St=[`id`],Ct=[`flood-color`],wt=[`id`],Tt=[`flood-color`],Et=[`d`,`stroke`,`filter`],Dt=[`d`,`stroke`,`filter`],Ot=[`cx`,`cy`,`r`,`fill`,`filter`],kt={key:6},At=[`stroke`,`d`],jt=[`d`,`fill`,`stroke`,`stroke-width`,`filter`],Mt={key:0},Nt=[`d`,`fill`,`stroke`,`stroke-width`,`filter`],Pt={key:0},Ft=[`stroke`,`d`],It={key:0},Lt=[`d`,`stroke`,`stroke-width`,`filter`],Rt={key:1},zt=[`d`,`fill`,`stroke`,`stroke-width`,`filter`],Bt=[`d`,`fill`,`stroke`,`stroke-width`,`filter`],Vt={key:1},Ht=[`cx`,`cy`,`r`,`fill`,`stroke`,`stroke-width`],Ut=[`cx`,`cy`,`r`,`fill`,`stroke`,`stroke-width`],Wt={key:0},Gt=[`d`,`fill`,`stroke`,`stroke-width`],Kt=[`cx`,`cy`,`r`,`stroke`],qt=[`cx`,`cy`,`r`,`fill`],Jt=[`cx`,`cy`,`r`],Yt={key:0},Xt=[`d`,`stroke`,`fill`,`onMouseenter`,`onMouseleave`,`onClick`],Zt={key:1},Qt=[`cx`,`cy`,`r`],$t=[`x`,`y`,`fill`,`font-size`],en=[`x`,`y`,`fill`,`font-size`],tn=[`x`,`y`,`fill`,`font-size`],nn=[`x`,`y`,`fill`,`font-size`],rn=[`filter`,`opacity`],an={key:0},on=[`x`,`y`],sn={key:1},cn=[`cx`,`cy`,`fill`,`stroke`,`filter`,`onClick`,`onMouseenter`,`onMouseleave`],ln=[`text-anchor`,`x`,`y`,`onClick`,`onMouseenter`,`onMouseleave`,`innerHTML`],un=[`text-anchor`,`x`,`y`,`fill`,`font-size`,`onClick`,`onMouseenter`,`onMouseleave`],dn=[`text-anchor`,`x`,`y`,`fill`,`font-size`,`onClick`,`onMouseenter`,`onMouseleave`,`innerHTML`],fn=[`cx`,`cy`,`fill`,`stroke`,`filter`,`onClick`,`onMouseenter`,`onMouseleave`],pn=[`text-anchor`,`x`,`y`,`onClick`,`onMouseenter`,`onMouseleave`,`innerHTML`],mn=[`text-anchor`,`x`,`y`,`fill`,`font-size`,`onClick`,`onMouseenter`,`onMouseleave`],hn=[`text-anchor`,`x`,`y`,`fill`,`font-size`,`onClick`,`onMouseenter`,`onMouseleave`,`innerHTML`],gn={key:2},_n=[`x`,`y`,`width`],vn=[`x`,`y`,`width`],yn={key:0,style:{position:`absolute`,top:`100%`,left:`0`,width:`100%`},"data-dom-to-png-ignore":``,"aria-hidden":`true`},bn={key:5,class:`vue-data-ui-watermark`},xn=[`id`],Sn=[`onClick`],Cn={key:8,class:`vue-ui-donut-hollow`},wn={key:0},Tn={key:1},En=/*#__PURE__*/ be({__name:`vue-ui-donut`,props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:[`selectLegend`,`selectDatapoint`,`copyAlt`],setup(e,{expose:be,emit:dt}){let En=Ye(()=>import(`./Tooltip-C1q0Qoh7.js`)),Dn=Ye(()=>import(`./BaseIcon-fYK0iID8.js`).then(e=>e.n)),On=Ye(()=>import(`./vue-ui-accordion-D4FHxzsL.js`).then(e=>e.n)),kn=Ye(()=>import(`./DataTable-5Ug6gMAX.js`)),An=Ye(()=>import(`./PenAndPaper-r50tK3S4.js`).then(e=>e.t)),jn=Ye(()=>import(`./UserOptions-BUXg7qOC.js`).then(e=>e.n)),Mn=Ye(()=>import(`./PackageVersion-CHQWwTik.js`).then(e=>e.t)),Nn=Ye(()=>import(`./BaseDraggableDialog-9d30Yx8c.js`).then(e=>e.n)),{vue_ui_donut:Pn}=t(),{isThemeValid:Fn,warnInvalidTheme:In}=Se(),Ln=ot(),A=e,Rn=_({get(){return!!A.dataset&&A.dataset.length},set(e){return e}}),zn=it(null),Bn=w(null),Vn=w(null),Hn=w(null),Un=it(null),Wn=it(null),Gn=it(null),Kn=it(null),qn=it(null),Jn=it(null),Yn=w(0),Xn=w(0),Zn=w(0),Qn=w(!1),$n=w(null),er=w(null),tr=w(null),nr=w({x:0,y:0}),rr=w(`pointer`),ir=w(!1),ar=_({get:()=>P.value.style.chart.layout.labels.percentage.fontSize,set:e=>e}),j=_({get:()=>P.value.style.chart.layout.labels.name.fontSize,set:e=>e}),or=_({get:()=>P.value.style.chart.layout.labels.dataLabels.smallArcClusterFontSize,set:e=>e}),sr=!1,cr=()=>{P.value.autoSize&&!sr&&(sr=!0,requestAnimationFrame(()=>{sr=!1;let e=P.value,t=Bn.value,n=z.value;if(!e.autoSize||!t||!n)return;let[r,i,a,o]=n.getAttribute(`viewBox`).split(` `).map(Number),s={x:r,y:i,width:a,height:o},c=[{selector:`.vue-data-ui-datalabel-value`,baseSize:F.value.percentage.fontSize,minSize:F.value.percentage.minFontSize,sizeRef:ar},{selector:`.vue-data-ui-datalabel-name`,baseSize:F.value.name.fontSize,minSize:F.value.name.minFontSize,sizeRef:j},{selector:`.vue-data-ui-datalabel-inline`,baseSize:F.value.dataLabels.smallArcClusterFontSize,minSize:F.value.name.minFontSize,sizeRef:or}];c.map(e=>t.querySelectorAll(e.selector).length).reduce((e,t)=>e+t,0)!==0&&c.forEach(({selector:e,baseSize:n,minSize:r,sizeRef:i})=>{t.querySelectorAll(e).forEach(e=>{i.value=ue({el:e,bounds:s,currentFontSize:n,minFontSize:r,attempts:200,padding:1})})})}))};nt(async()=>{Qn.value=!0,dr(),requestAnimationFrame(cr)});let lr;nt(()=>{zn.value&&(lr=new ResizeObserver(e=>{for(let t of e){let{width:e,height:n}=t.contentRect;if(e>0&&n>0){cr();break}}}),lr.observe(zn.value.parentElement))}),tt(()=>{lr?.disconnect()}),tt(()=>{Gn.value&&(Kn.value&&Gn.value.unobserve(Kn.value),Gn.value.disconnect())});let ur=_(()=>P.value.debug);function dr(){if(he(A.dataset)?(d({componentName:`VueUiDonut`,type:`dataset`,debug:ur.value}),Rn.value=!1,xr.value=!0):(A.dataset.forEach((e,t)=>{me({datasetObject:e,requiredAttributes:[`name`,`values`]}).forEach(e=>{d({componentName:`VueUiDonut`,type:`datasetSerieAttribute`,property:e,index:t,debug:ur.value}),Rn.value=!1,xr.value=!0})}),ur.value&&A.dataset.forEach((e,t)=>{e.name&&e.name!==``||d({componentName:`VueUiDonut`,type:`datasetAttributeEmpty`,property:`name`,index:t})})),he(A.dataset)||(xr.value=P.value.loading),P.value.responsive){let e=Pe(()=>{let{width:e,height:t}=Fe({chart:zn.value,title:P.value.style.chart.title.text?Un.value:null,legend:P.value.style.chart.legend.show?Wn.value:null,source:qn.value,noTitle:Jn.value,padding:P.value.autoSize?void 0:Nr.value});requestAnimationFrame(()=>{V.value.width=e,V.value.height=t,cr()})});Gn.value&&(Kn.value&&Gn.value.unobserve(Kn.value),Gn.value.disconnect()),Gn.value=new ResizeObserver(e),Kn.value=zn.value.parentNode,Gn.value.observe(Kn.value)}}let M=w(u()),fr=w(!1),pr=w(``),N=w(null),mr=w(0);function hr(){let e=xe({userConfig:A.config,defaultConfig:Pn}),t={},n=e.theme;if(!n)t=e;else if(!Fn.value(e))In(e),t=e;else{let r=xe({userConfig:Ue[n]||A.config,defaultConfig:e});t={...xe({userConfig:A.config,defaultConfig:r}),customPalette:e.customPalette.length?e.customPalette:ce[n]||o}}return t}let P=w(hr()),F=_(()=>P.value.style.chart.layout.labels),I=_(()=>P.value.style.chart.layout.donut),gr=_(()=>P.value.style.chart.layout),L=_(()=>P.value.style.chart);ve({config:()=>P.value,dataset:()=>A.dataset,component:`VueUiDonut`,rules:[ye.singleSeries,ye.emptyArray,{test:e=>e.length>6,message:[`👀 The number of series is > 6. 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.`]}]});let _r=_(()=>P.value.userOptions.useCursorPointer),vr=_(()=>ae({defaultConfig:{useCssAnimation:!1,table:{show:!1},startAnimation:{show:!1},userOptions:{show:!1},style:{chart:{backgroundColor:`#99999930`,layout:{labels:{dataLabels:{show:!1},hollow:{average:{show:!1},total:{show:!1}},value:{show:!1}}},legend:{backgroundColor:`transparent`,showValue:!1,showPercentage:!1},title:{color:`#1A1A1A`,subtitle:{color:`#5A5A5A`}}}}},userConfig:P.value.skeletonConfig??{}})),{loading:yr,FINAL_DATASET:br,manualLoading:xr,skeletonDataset:Sr}=ge({...at(A),FINAL_CONFIG:P,prepareConfig:hr,skeletonDataset:A.config?.skeletonDataset??[{name:``,values:[3],color:`#BABABA`},{name:``,values:[2],color:`#AAAAAA`},{name:``,values:[1],color:`#CACACA`}],skeletonConfig:ae({defaultConfig:P.value,userConfig:vr.value})}),R=w(!0),Cr=w(0),wr=w(!1),Tr=null;function Er(e=1e3){return new Promise(t=>{let n=performance.now();function r(i){let a=i-n,o=Math.min(a/e,1),s=oe(o);Cr.value=s,o<1?Tr=requestAnimationFrame(r):(Cr.value=1,Tr=null,t())}Tr!==null&&cancelAnimationFrame(Tr),Cr.value=0,Tr=requestAnimationFrame(r)})}ct(()=>yr.value,async e=>{if(e||wr.value)return;let t=br.value===Sr,n=P.value.startAnimation?.show;!t&&n?(wr.value=!0,await Er(P.value.startAnimation.durationMs||1e3)):Cr.value=1,R.value=!1},{immediate:!0});let{userOptionsVisible:Dr,setUserOptionsVisibility:Or,keepUserOptionState:kr}=ze({config:P.value}),{svgRef:z}=Be({config:L.value.title});function Ar(){Or(!0)}function jr(){Or(!1)}let Mr=ne(A.config);ct(()=>A.config,(e,t)=>{let n=ne(e),r=n!==Mr;Mr=n;let i=hr();r?(yr.value||(P.value=i),Dr.value=!P.value.userOptions.showOnChartHover,dr(),Yn.value+=1,Xn.value+=1,Zn.value+=1,B.value.dataLabels.show=F.value.dataLabels.show,B.value.showTable=P.value.table.show,B.value.showTooltip=L.value.tooltip.show,V.value.height=L.value.height,V.value.width=L.value.width):(P.value.style.chart.tooltip=i.style.chart.tooltip,B.value.showTooltip=P.value.style.chart.tooltip.show)},{deep:!0});let Nr=_(()=>{let{top:e,right:t,bottom:n,left:r}=L.value.padding;return{css:`padding:${e}px ${t}px ${n}px ${r}px`,top:e,right:t,bottom:n,left:r}}),{isPrinting:Pr,isImaging:Fr,generatePdf:Ir,generateImage:Lr}=Me({elementId:`donut__${M.value}`,fileName:L.value.title.text||`vue-ui-donut`,options:P.value.userOptions.print}),Rr=_(()=>P.value.userOptions.show&&!L.value.title.text),zr=_(()=>pe(P.value.customPalette)),B=w({dataLabels:{show:F.value.dataLabels.show},showTable:P.value.table.show,showTooltip:L.value.tooltip.show});ct(P,()=>{B.value={dataLabels:{show:F.value.dataLabels.show},showTable:P.value.table.show,showTooltip:L.value.tooltip.show}},{immediate:!0});let V=w({height:L.value.height,width:L.value.width}),Br=_(()=>{if(P.value.pie)return G.value;let e=I.value.strokeWidth/512,t=Math.min(V.value.width,V.value.height)*e,n=t>G.value?G.value:t;return Math.max(n,12*(1+e))}),Vr=dt,H=_(()=>br.value.sort((e,t)=>{let n=Array.isArray(e.values)?e.values.reduce((e,t)=>e+t,0):e.value??0,r=Array.isArray(t.values)?t.values.reduce((e,t)=>e+t,0):t.value??0;return e.ghost&&!t.ghost?1:t.ghost&&!e.ghost?-1:r-n}).map((e,t)=>({name:e.name,color:l(e.color)||zr.value[t]||o[t]||o[t%o.length],value:re(e.values.reduce((e,t)=>e+t,0)),absoluteValues:e.values,comment:e.comment||``,patternIndex:t,seriesIndex:t,ghost:!1,pattern:`pattern_${M.value}_${t}`})));ct(()=>A.dataset,e=>{Array.isArray(e)&&e.length>0&&(xr.value=!1)},{immediate:!0});let U=it(H.value);ct(()=>H.value,e=>{U.value=e,requestAnimationFrame(cr)});function Hr(){return H.value.map(e=>({name:e.name,color:e.color,value:e.value}))}let W=w([]),Ur=w(!1),Wr=w(null);function Gr(){Vr(`selectLegend`,$r.value.map(e=>({name:e.name,color:e.color,value:e.value})))}function Kr({from:e,to:t,duration:n,onUpdate:r,onDone:i,easing:a=oe}){let o=performance.now();function s(c){let l=Math.min((c-o)/n,1),u=a(l);r(e+(t-e)*u,l),l<1?requestAnimationFrame(s):(r(t,1),i&&i())}requestAnimationFrame(s)}function qr(){W.value.length?W.value=[]:ei.value.forEach((e,t)=>{W.value.push(t)}),Gr()}function Jr(e){let t=H.value.find((t,n)=>n===e),n=U.value.find((t,n)=>n===e).value;if(W.value.includes(e)){W.value=W.value.filter(t=>t!==e);let r=t.value;function i(){U.value=U.value.map((t,n)=>e===n?{...t,value:r}:t),Gr()}function a(){Ur.value=!0,Wr.value=e,Kr({from:n,to:r,duration:P.value.serieToggleAnimation.durationMs,onUpdate:(t,n)=>{U.value=U.value.map((n,r)=>e===r?{...n,value:t}:n),requestAnimationFrame(cr)},onDone:()=>{i(),Ur.value=!1,Wr.value=null}})}P.value.serieToggleAnimation.show&&P.value.type===`classic`?a():(i(),requestAnimationFrame(cr))}else if(W.value.length<H.value.length-1){function t(){W.value.push(e),U.value=U.value.map((t,n)=>e===n?{...t,value:0}:t),Gr()}function r(){Ur.value=!0,Wr.value=e,Kr({from:n,to:0,duration:P.value.serieToggleAnimation.durationMs,onUpdate:(t,n)=>{U.value=U.value.map((n,r)=>e===r?{...n,value:t}:n),requestAnimationFrame(cr)},onDone:()=>{t(),requestAnimationFrame(cr),Ur.value=!1,Wr.value=null}})}P.value.serieToggleAnimation.show&&P.value.type===`classic`?r():t()}}function Yr(e){return H.value.length?H.value.find(t=>t.name===e)||(ur.value&&console.warn(`VueUiDonut - Series name not found "${e}"`),null):(ur.value&&console.warn(`VueUiDonut - There are no series to show.`),null)}function Xr(e){let t=Yr(e);t!==null&&W.value.includes(t.seriesIndex)&&Jr(t.seriesIndex)}function Zr(e){let t=Yr(e);t!==null&&(W.value.includes(t.seriesIndex)||Jr(t.seriesIndex))}let Qr=_(()=>br.value.reduce((e,t)=>e+t.values.reduce((e,t)=>e+t,0),0)),$r=_(()=>{if(R.value&&!yr.value){let e=Cr.value,t=H.value.map(t=>({...t,value:t.value*e,color:t.color,ghost:!1})),n=Qr.value*(1-e);return n>0&&t.push({name:`__ghost__`,value:n,color:`transparent`,ghost:!0}),t}return U.value.forEach(e=>{if([null,void 0].includes(e.values))return{...e,values:[]}}),U.value.map((e,t)=>({...e,seriesIndex:t})).filter((e,t)=>!W.value.includes(t))}),ei=_(()=>br.value.map((e,t)=>{let n=(e.values||[]).reduce((e,t)=>e+t,0),r=n/br.value.map(e=>(e.values||[]).reduce((e,t)=>e+t,0)).reduce((e,t)=>e+t,0);return{name:e.name,color:l(e.color)||zr.value[t]||o[t]||o[t%o.length],value:n,shape:`circle`,patternIndex:t,proportion:r}}).map((e,t)=>{let r=m(F.value.value.formatter,e.value,n({p:F.value.dataLabels.prefix,v:e.value,s:F.value.dataLabels.suffix,r:L.value.legend.roundingValue}),{datapoint:e,index:t}),i=m(F.value.percentage.formatter,di(e),n({v:di(e),s:`%`,r:L.value.legend.roundingPercentage})),a=Di({val:r,percentage:W.value.includes(t)?`${Ei(e.proportion*100)}%`:i,showVal:L.value.legend.showValue,showPercentage:L.value.legend.showPercentage,config:L.value.legend});return{...e,opacity:W.value.includes(t)?.5:1,segregate:()=>!Ur.value&&Jr(t),isSegregated:W.value.includes(t),display:`${e.name}${L.value.legend.showPercentage||L.value.legend.showValue?`: `:``}${a}`}})),ti=_(()=>({cy:`donut-div-legend`,backgroundColor:L.value.legend.backgroundColor,color:L.value.legend.color,fontSize:L.value.legend.fontSize,paddingBottom:12,fontWeight:L.value.legend.bold?`bold`:``})),G=_(()=>{let e=I.value.radiusRatio,t=Math.max(.1,Math.min(.50001,e)),n=Math.min(V.value.width*t,V.value.height*t);return Math.max(12,n)}),K=_(()=>s({series:$r.value},V.value.width/2,V.value.height/2,G.value,G.value,1.99999,2,1,360,105.25,Br.value)),ni=_(()=>Math.abs($r.value.map(e=>e.value).reduce((e,t)=>e+t,0))>0),ri=_(()=>s({series:[{value:1,color:I.value.emptyFill,name:`_`,seriesIndex:0,patternIndex:-1,ghost:!1,absoluteValues:[1]}]},V.value.width/2,V.value.height/2,G.value,G.value,1.99999,2,1,360,105.25,Br.value)),q=_(()=>K.value.filter(e=>!e.ghost)),J=_(()=>{let e=Math.max(...$r.value.map(e=>e.value)),t=$r.value.map(t=>t.value/e);return se({series:t,center:{x:V.value.width/2,y:V.value.height/2},maxRadius:Math.min(V.value.width,V.value.height)/3,hasGhost:R.value})});function ii(e){return e.x>V.value.width/2+6?`start`:e.x<V.value.width/2-6?`end`:`middle`}function ai(e){return e.middlePoint.y>V.value.height/2?r({initX:e.middlePoint.x,initY:e.middlePoint.y,offset:100,centerX:V.value.width/2,centerY:V.value.height/2}).y:r({initX:e.middlePoint.x,initY:e.middlePoint.y,offset:0,centerX:V.value.width/2,centerY:V.value.height/2}).y-100}function Y(e){return e.proportion*100>F.value.dataLabels.hideUnderValue}function oi(e,t){let n=F.value.dataLabels.hideUnderValue,r=F.value.dataLabels.smallArcClusterThreshold,i=(li.value[t]??e.proportion??0)*100;return i>n&&i<=r}let{smallArcLayoutsClassic:X}=ut({FINAL_CONFIG:P,noGhostDonut:q,svg:V,padding:Nr,labels_inline_fontSize:or,minSize:G,findArcMidpoint:fe,calcMarkerOffsetX:f,calcMarkerOffsetY:h,animatingIndex:Wr,segregated:W,isSmallArc:oi});function si(e,t){let r=e.value/ci(t);return isNaN(r)?0:m(F.value.percentage.formatter,r*100,n({v:r*100,s:`%`,r:F.value.percentage.rounding}),{datapoint:e})}function ci(e){return[...e].map(e=>e.value).reduce((e,t)=>e+t,0)}let Z=_(()=>$r.value.map(e=>e.value).reduce((e,t)=>e+t,0)),li=_(()=>{let e=H.value.reduce((e,t)=>e+t.value,0);return e<=0?[]:H.value.map(t=>t.value/e)}),ui=_(()=>Z.value/$r.value.length);function di(e){return Ur.value?e.proportion*100:e.value/Z.value*100}let fi=w(null),pi=w(!1);function mi({datapoint:e,seriesIndex:t}){P.value.events.datapointLeave&&P.value.events.datapointLeave({datapoint:e,seriesIndex:t}),fr.value=!1,N.value=null,tr.value=null,rr.value=`pointer`}function Q({datapoint:e,relativeIndex:t,seriesIndex:r,show:i=!1,triggerMode:o=`pointer`}){P.value.events.datapointEnter&&P.value.events.datapointEnter({datapoint:e,seriesIndex:r}),rr.value=o,tr.value=t,fi.value={datapoint:e,seriesIndex:r,config:P.value,series:H.value},fr.value=i,N.value=t;let s=``,l=L.value.tooltip.customFormat;if(pi.value=!1,a(l))try{let t=l({seriesIndex:r,datapoint:e,series:H.value,config:P.value});typeof t==`string`&&(pr.value=t,pi.value=!0)}catch{console.warn(`Custom format cannot be applied.`),pi.value=!1}pi.value||(s+=`<div style="width:100%;text-align:center;border-bottom:1px solid ${L.value.tooltip.borderColor};padding-bottom:6px;margin-bottom:3px;">${e.name}</div>`,s+=`<div style="display:flex;flex-direction:row;gap:6px;align-items:center;"><svg viewBox="0 0 60 60" height="14" width="14"><circle cx="30" cy="30" r="30" stroke="none" fill="${e.color}"/>${Ln.pattern?`<circle cx="30" cy="30" r="30" stroke="none" fill="url(#pattern_${M.value}_${r})"/>`:``}</svg>`,s+=`<b>${Di({showVal:L.value.tooltip.showValue,showPercentage:L.value.tooltip.showPercentage,val:`<span>${m(F.value.value.formatter,e.value,n({p:F.value.dataLabels.prefix,v:e.value,s:F.value.dataLabels.suffix,r:L.value.tooltip.roundingValue}),{datapoint:e,relativeIndex:t,seriesIndex:r})}</span>`,percentage:m(F.value.percentage.formatter,e.proportion*100,n({v:e.proportion*100,s:`%`,r:L.value.tooltip.roundingPercentage}),{datapoint:e,relativeIndex:t,seriesIndex:r}),config:L.value.tooltip})}</b></div>`,L.value.comments.showInTooltip&&e.comment&&(s+=`<div class="vue-data-ui-tooltip-comment" style="background:${c(e.color,12.5)}; padding: 6px; margin-bottom: 6px; margin-top:6px; border-left: 1px solid ${e.color}">${e.comment}</div>`),pr.value=`<div>${s}</div>`)}function hi(e,t){let n=X.value[t];if(n)return{textAnchor:n.textAnchor,x:n.labelX,y:n.labelY};let r=f(e,!0,12);return{textAnchor:r.anchor,x:r.x,y:h(e)}}function gi(e,t,n){let{textAnchor:r,x:i}=hi(e,t),a=Oi(e),o=`
2
2
  <tspan
3
3
  class="vue-data-ui-datalabel-inline"
4
4
  fill="${F.value.percentage.color}"
@@ -1,2 +1,2 @@
1
- import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{t}from"./useConfig-D3ZfFSE5.js";import{$ as n,$t as r,At as i,D as a,Ht as o,It as ee,J as s,Jt as c,Kt as te,S as ne,X as re,_ as ie,at as ae,f as oe,h as se,i as ce,in as le,nn as ue,nt as de,p as fe,t as pe,tt as me,w as he,y as ge,yt as _e,zt as ve}from"./lib-rPeBMZrn.js";import{n as ye,t as be}from"./BaseScanner-8NdoBs7B.js";import{n as xe,t as Se}from"./useHints-C-TwxM0Y.js";import{t as Ce}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{t as we}from"./useNestedProp-DnGoh-XS.js";import{t as Te}from"./useThemeCheck-BKNRbGeC.js";import{t as Ee}from"./chartImage-DPGnEuYM.js";import{n as De}from"./Title-BliHuXfT.js";import{t as Oe}from"./useChartExport-BZts4KFb.js";import{n as ke,t as Ae}from"./tableIntegration-CNoJ1CIY.js";import{n as je,t as Me}from"./annotationSlots-RvQBEO9-.js";import{n as Ne,t as Pe}from"./userOptionsSlots-DYuo-E5m.js";import{t as Fe}from"./useTimeLabels-Das5O74F.js";import{t as Ie}from"./usePrinter-DVf3YcG5.js";import{t as Le}from"./useTransitions-ChGGrtrv.js";import{t as Re}from"./useStableElementSize-CegFbRlF.js";import{t as ze}from"./useSvgLabelLayout-42Kats14.js";import{t as Be}from"./useTimeLabelCollider-BTybMUFi.js";import{t as Ve}from"./useResponsive-CENUxfEL.js";import{t as He}from"./DefGrad-DKMq1REY.js";import{t as Ue}from"./SlicerPreview-DYuyE9u9.js";import{t as We}from"./BaseLegendToggle-aT9fOoGO.js";import{t as Ge}from"./A11yDataTable-DWNlWXzs.js";import{t as Ke}from"./useUserOptionState-CXlFnwPv.js";import{t as qe}from"./useChartAccessibility-DOMuYJfm.js";import{t as Je}from"./annotationViewport-X8fvs7pz.js";import{t as Ye}from"./Legend-DM0ClX3D.js";import{t as Xe}from"./vue_ui_donut_evolution-CVoh3twl.js";import{Fragment as l,Teleport as Ze,computed as u,createBlock as d,createCommentVNode as f,createElementBlock as p,createElementVNode as m,createSlots as Qe,createTextVNode as $e,createVNode as et,defineAsyncComponent as tt,guardReactiveProps as nt,mergeProps as rt,nextTick as it,normalizeClass as h,normalizeProps as at,normalizeStyle as ot,onBeforeUnmount as st,onMounted as ct,openBlock as g,ref as _,renderList as v,renderSlot as y,resolveDynamicComponent as lt,shallowRef as ut,toDisplayString as b,toRefs as dt,unref as x,watch as ft,watchEffect as pt,withCtx as S}from"vue";var mt=/* @__PURE__ */ e({default:()=>rn}),ht=[`id`],gt=[`id`],_t=[`id`],vt={style:{position:`relative`}},yt=[`xmlns`,`aria-describedby`,`viewBox`],bt=[`x`,`y`,`width`,`height`],xt={key:1},St=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`],Ct=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`],wt={key:0},Tt=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`],Et=[`font-size`,`fill`,`transform`],Dt=[`x`,`y`,`font-size`,`fill`],Ot=[`d`,`stroke`,`stroke-width`],kt=[`transform`,`font-size`,`text-anchor`,`fill`,`font-weight`],At={key:0},jt=[`text-anchor`,`font-size`,`fill`,`transform`],Mt=[`text-anchor`,`font-size`,`fill`,`transform`,`innerHTML`],Nt=[`x1`,`y1`,`x2`,`y2`,`stroke`,`stroke-width`],Pt={key:1},Ft=[`cx`,`cy`,`r`,`fill`],It={key:0},Lt={key:0},Rt=[`d`,`stroke`],zt=[`text-anchor`,`x`,`y`,`fill`],Bt=[`cx`,`cy`,`r`,`fill`],Vt={key:0},Ht=[`cx`,`cy`,`fill`],Ut={key:1},Wt=[`d`,`fill`,`stroke`],Gt={key:2},Kt=[`d`,`fill`,`stroke`],qt=[`x`,`y`,`font-size`,`fill`],Jt=[`x`,`y`,`width`,`height`,`fill`],Yt=[`x`,`y`,`width`,`height`,`onMouseenter`,`onMouseleave`,`onClick`],Xt=[`x`,`y`,`width`,`height`,`fill`,`fill-opacity`,`stroke`,`stroke-opacity`,`stroke-width`,`stroke-dasharray`],Zt={key:0,style:{position:`absolute`,top:`100%`,left:`0`,width:`100%`},"data-dom-to-png-ignore":``,"aria-hidden":`true`},Qt={key:5,class:`vue-data-ui-watermark`},$t=[`id`],en=[`onClick`],tn={key:0},nn={key:1},rn=/*#__PURE__*/ Ce({__name:`vue-ui-donut-evolution`,props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}},zoomState:{type:Object,default:null}},emits:[`selectLegend`,`zoomStart`,`zoomEnd`,`zoomReset`,`update:zoomState`,`copyAlt`],setup(e,{expose:Ce,emit:mt}){let rn=tt(()=>import(`./vue-ui-accordion-D4FHxzsL.js`).then(e=>e.n)),an=tt(()=>import(`./BaseIcon-fYK0iID8.js`).then(e=>e.n)),on=tt(()=>import(`./DataTable-5Ug6gMAX.js`)),sn=tt(()=>import(`./PackageVersion-DWlHsdPa.js`).then(e=>e.t)),cn=tt(()=>import(`./PenAndPaper-r50tK3S4.js`).then(e=>e.t)),ln=tt(()=>import(`./UserOptions-Em_JgDXM.js`).then(e=>e.n)),un=tt(()=>import(`./vue-ui-donut-CU-L5W3v.js`).then(e=>e.n)),dn=tt(()=>import(`./BaseDraggableDialog-9d30Yx8c.js`).then(e=>e.n)),{vue_ui_donut_evolution:fn}=t(),{isThemeValid:pn,warnInvalidTheme:mn}=Te(),C=e,w=_(re()),T=_([]),E=_(null),hn=_(null),gn=_(!1),D=_(null),O=_(null),_n=_(null),vn=_(0),yn=_(0),bn=_(0),xn=_(0),Sn=_(0),Cn=_(null),wn=_(null),Tn=_(null),En=_(null),Dn=_(!1),On=_(null),kn=_(null),An=ut(null),jn=_(0),Mn=_(0),Nn=_(!1);function Pn(){An.value=O.value?.parentNode??null}function Fn(){return new Promise(e=>{requestAnimationFrame(()=>{requestAnimationFrame(e)})})}async function In(){let e=++Mn.value;await it(),await Fn(),await Fn(),e===Mn.value&&(jn.value+=1)}function Ln(){Nn.value||(Nn.value=!0,it(()=>{Nn.value=!1,Pn(),In()}))}let Rn=Re({elementRef:An,minimumWidth:2,minimumHeight:2,stableFramesRequired:2,once:!1,onSizeAccepted:()=>{In()}}),zn=_(null),Bn=_(null),Vn=_(null),Hn=_(null),Un=_(null),Wn=_(!1),k=ut(null),Gn=ut(null),Kn=_(null),A=_(null),qn=_(!1),j=mt,Jn=u(()=>!!C.dataset&&C.dataset.length),Yn=_(!1),Xn=0;ct(()=>{Dn.value=!0,Pn(),Rn.start(),Qn(),In()});let Zn=u(()=>M.value.debug);function Qn(){ve(C.dataset)?(ae({componentName:`VueUiDonutEvolution`,type:`dataset`,debug:Zn.value}),ir.value=!0):C.dataset.length&&C.dataset.forEach((e,t)=>{_e({datasetObject:e,requiredAttributes:[`name`,`values`]}).forEach(e=>{ae({componentName:`VueUiDonutEvolution`,type:`datasetSerieAttribute`,property:e,index:t,debug:Zn.value}),ir.value=!0})}),ve(C.dataset)||(ir.value=M.value.loading),setTimeout(()=>{Wn.value=!0},10),xr(),M.value.responsive&&(k.value&&(Gn.value&&k.value.unobserve(Gn.value),k.value.disconnect()),k.value=new ResizeObserver(()=>{Wn.value=!1;let{width:e,height:t}=Ve({chart:O.value,title:M.value.style.chart.title.text?zn.value:null,legend:M.value.style.chart.legend.show?Bn.value:null,slicer:M.value.style.chart.zoom.show&&ar.value>1?Un.value:null,source:Vn.value});cancelAnimationFrame(Xn),Xn=requestAnimationFrame(()=>{L.value.width=e,L.value.height=t-12,Yn.value=!0,Ln(),clearTimeout(Kn.value),Kn.value=setTimeout(()=>{Wn.value=!0},10)})}),Gn.value=O.value.parentNode,k.value.observe(Gn.value)),Ln()}let M=_(kr()),N=u(()=>P.value.grid),P=u(()=>M.value.style.chart.layout),$n=u(()=>M.value.style.chart.dialog),F=u(()=>M.value.style.chart);xe({config:()=>M.value,dataset:()=>C.dataset,component:`VueUiDonutEvolution`,rules:[Se.emptyArray,{test:e=>e.length===1,message:[`👀 There is only a single series in your dataset. Consider:`,``,`▶️ Using VueUiXy instead, for a regular line chart.`]},{test:e=>e.length>6,message:[`👀 The number of series is > 6, which makes donuts hard to read. 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=>e.some(e=>e.values.length>24),message:[`👀 Some series have a number of data points > 24, which can make the chart and donuts hard to read. Consider:`,``,`▶️ Using larger time scales, or aggregated values.`,``,`▶️ Filtering the time range by adding date intputs in your UI.`,``,`▶️ Using VueUiXy to show longer series in a more comfortable display.`]}]});let{transitionEnabled:er}=Le({config:()=>M.value.transitions,dataset:()=>C.dataset}),I=u(()=>M.value.userOptions.useCursorPointer),tr=u(()=>le({defaultConfig:{useCssAnimation:!1,table:{show:!1},userOptions:{show:!1},style:{chart:{backgroundColor:`#99999930`,layout:{dataLabels:{show:!1},grid:{stroke:`#6A6A6A`,axis:{yLabel:``,xLabel:``},yAxis:{scaleMin:null,scaleMax:null,autoScale:!1,dataLabels:{show:!1}},xAxis:{dataLabels:{show:!1}}},line:{stroke:`#CACACA60`}},legend:{backgroundColor:`transparent`,showValue:!1,showPercentage:!1},zoom:{show:!1,startIndex:null,endIndex:null}}}},userConfig:M.value.skeletonConfig??{}})),{loading:nr,FINAL_DATASET:rr,manualLoading:ir}=ye({...dt(C),FINAL_CONFIG:M,prepareConfig:kr,callback:()=>{Promise.resolve().then(async()=>{await xr()})},skeletonDataset:C.config?.skeletonDataset??[{name:``,values:[1,2,3,5,8,13],color:`#AAAAAA`},{name:``,values:[1,2,3,5,8,13],color:`#BABABA`},{name:``,values:[1,2,3,5,8,13],color:`#CACACA`}],skeletonConfig:le({defaultConfig:M.value,userConfig:tr.value})}),L=_({width:P.value.width,height:P.value.height}),ar=u(()=>Math.max(...rr.value.map(e=>e.values.length))),R=_({start:0,end:ar.value}),z=_(!1),or=_(!1),B=_(null),V=_(null),H=_(null),sr=_(!1),cr=_({time:0,x:0,y:0,pointerType:null}),lr=u(()=>M.value.style.chart.zoom?.dragToZoom),U=u(()=>lr.value.show&&Jn.value&&dr.value&&Y.value>1&&!nr.value),ur=_(!1),dr=_(!1),fr=_(!1),pr=null,W={};function mr(e,t=R.value){if(!e||typeof e!=`object`)return null;let n=e.start!==void 0&&e.start!==null,r=e.end!==void 0&&e.end!==null;if(!n&&!r)return null;let i=Number(n?e.start:t.start),a=Number(r?e.end:t.end);return!Number.isFinite(i)||!Number.isFinite(a)?null:{start:i,end:a}}function hr(e){let t=mr(e);t&&j(`update:zoomState`,t)}function gr(){pr&&=(cancelAnimationFrame(pr),null),W={}}function _r(e,t=R.value.start){let n=Y.value,r=Number(t);return e>n?n:e<0||e<=r?Math.min(r+1,n):e}function vr(){let e=Y.value;if(!Number.isFinite(e)||e<=0){R.value={start:0,end:0};return}let t=Math.max(0,Math.min(Number(R.value.start)||0,e-1)),n=Math.max(t+1,Math.min(Number(R.value.end)||e,e));(!Number.isFinite(t)||!Number.isFinite(n)||n<=t)&&(t=0,n=e),R.value={start:t,end:n},Hn.value&&Hn.value.setRangeValues(t,n)}function yr(e){let t=mr(e);if(!t)return null;let{start:n,end:r}=t;return(n!==Number(R.value.start)||r!==Number(R.value.end))&&(gr(),R.value={start:n,end:r},vr(),Ln()),{start:Number(R.value.start),end:Number(R.value.end)}}function br(e){let t=yr(e);return t?(hr(t),t):null}async function xr(e=!0){if(!ur.value){ur.value=!0;try{await it(),await it();let{startIndex:t,endIndex:n}=F.value.zoom,r=Y.value;if(!Number.isFinite(r)||r<=0){R.value={start:0,end:0},dr.value=!0;return}let i=t==null?0:Number(t),a=n==null?r:_r(Number(n)+1,i);fr.value=!0,R.value={start:i,end:a},vr(),dr.value=!0,e&&C.zoomState&&yr(C.zoomState)}finally{queueMicrotask(()=>{fr.value=!1}),ur.value=!1,Ln()}}}async function Sr({force:e=!1,publish:t=!1}={}){await xr(!e),t&&(hr({start:Number(R.value.start),end:Number(R.value.end)}),j(`zoomReset`))}ft([()=>C.zoomState,dr],([e,t])=>{t&&e&&yr(e)},{deep:!0,immediate:!0});function Cr(e){W={...W,...e},pr&&cancelAnimationFrame(pr),pr=requestAnimationFrame(()=>{let e={...R.value,...W};W={},pr=null,R.value=e,vr(),Ln(),hr({start:Number(R.value.start),end:Number(R.value.end)})})}function wr(e){if(ur.value||fr.value)return;let t=Number(e);Number.isFinite(t)&&(j(`zoomStart`,{index:t,isZoom:t!==0}),t!==R.value.start&&Cr({start:t}))}function Tr(e){if(ur.value||fr.value)return;let t=W.start===void 0?R.value.start:W.start,n=_r(Number(e),t);Number.isFinite(n)&&(j(`zoomEnd`,{index:n,isZoom:n!==Y.value}),(n!==R.value.end||W.start!==void 0)&&Cr({end:n}))}let{userOptionsVisible:Er,setUserOptionsVisibility:Dr,keepUserOptionState:Or}=Ke({config:M.value}),{svgRef:G}=qe({config:F.value.title});function kr(){let e=we({userConfig:C.config,defaultConfig:fn}),t={},n=e.theme;if(n){if(!pn.value(e))mn(e),t=e;else{let r=we({userConfig:Xe[n]||C.config,defaultConfig:e});t={...we({userConfig:C.config,defaultConfig:r}),customPalette:e.customPalette?e.customPalette:ue[n]||o}}}else t=e;return t}ft(()=>C.config,e=>{nr.value||(M.value=kr()),Er.value=!M.value.userOptions.showOnChartHover,Qn(),bn.value+=1,xn.value+=1,Sn.value+=1,Ir.value.showTable=M.value.table.show},{deep:!0}),ft(()=>C.dataset,e=>{Array.isArray(e)&&e.length>0&&(ir.value=!1),Sr()},{deep:!0});let{isPrinting:Ar,isImaging:jr,generatePdf:Mr,generateImage:Nr}=Ie({elementId:w.value,fileName:F.value.title.text||`vue-ui-donut-evolution`,options:M.value.userOptions.print}),Pr=u(()=>M.value.userOptions.show&&!F.value.title.text),Fr=u(()=>he(M.value.customPalette)),Ir=_({showTable:M.value.table.show});ft(M,()=>{Ir.value={showTable:M.value.table.show}},{immediate:!0});let Lr=u(()=>({top:P.value.padding.top,right:P.value.padding.right,bottom:P.value.padding.bottom,left:P.value.padding.left})),K=u(()=>N.value.yAxis.position===`right`),{metrics:Rr,ready:zr,settling:Br,update:Vr}=ze({svgRef:G,canMeasure:()=>(!M.value.responsive||Yn.value)&&(!N.value.xAxis.dataLabels.show||Gr.value),initialMetrics:{scaleLabelsWidth:0,yAxisLabelWidth:0,xAxisLabelHeight:0,timeLabelsHeight:0},measure:e=>({scaleLabelsWidth:e(Cn.value).textWidth,yAxisLabelWidth:e(En.value).rotatedWidth,xAxisLabelHeight:e(Tn.value).height,timeLabelsHeight:e(wn.value).height})});function Hr(){let e=Rr.value.scaleLabelsWidth,t=En.value?Rr.value.yAxisLabelWidth+N.value.axis.yLabelOffsetX+N.value.axis.fontSize:0,n=e+t+5;return{left:K.value?0:n,right:K.value?n:0,scaleLabelsWidth:e,yAxisLabelWidth:t,crosshair:5}}st(()=>{cancelAnimationFrame(Xn),Rn.stop(),clearTimeout(Kn.value),gr(),vi(),ii(),k.value&&(Gn.value&&k.value.unobserve(Gn.value),k.value.disconnect(),k.value=null,Gn.value=null)});let Ur=u(()=>Rr.value.xAxisLabelHeight+Rr.value.timeLabelsHeight+N.value.axis.fontSize+N.value.xAxis.dataLabels.offsetY),q=u(()=>{let e=Hr(),t=P.value.dataLabels.fontSize*3,n=L.value.width,r=L.value.height,i=Lr.value.left+e.left,a=n-Lr.value.right-e.right,o=n-i-Lr.value.right-e.right,ee=r-Lr.value.top-Lr.value.bottom-t-Ur.value,s=Lr.value.top+t;return{top:s,left:i,right:a,bottom:r-Lr.value.bottom-Ur.value,absoluteHeight:r,absoluteWidth:n,centerX:i+Math.max(10,o)/2,centerY:s+Math.max(10,ee)/2,width:Math.max(10,o),height:Math.max(10,ee),scaleLabelsWidth:e.scaleLabelsWidth,yAxisLabelWidth:e.yAxisLabelWidth,crosshair:e.crosshair}}),J=u(()=>(Zn.value&&rr.value.forEach((e,t)=>{[null,void 0].includes(e.name)&&ae({componentName:`VueUiDonutEvolution`,type:`datasetSerieAttribute`,property:`name`,index:t}),[null,void 0].includes(e.values)&&ae({componentName:`VueUiDonutEvolution`,type:`datasetSerieAttribute`,property:`values`,index:t})}),rr.value.map((e,t)=>({...e,values:te(e.values),color:ne(e.color)||Fr.value[t]||o[t]||o[t%o.length],length:(e.values||[]).length,uid:re()})))),Wr=u(()=>J.value.filter(e=>!T.value.includes(e.uid)).map(e=>({...e,values:e.values.filter((e,t)=>t>=R.value.start&&t<=R.value.end)}))),Y=u(()=>Math.max(...J.value.map(e=>e.length))),X=_([]),Gr=_(!1),Kr=0;pt(()=>{let e=++Kr;(async()=>{let t=await Fe({values:N.value.xAxis.dataLabels.values,maxDatapoints:Y.value,formatter:N.value.xAxis.dataLabels.datetimeFormatter,start:R.value.start,end:R.value.end});e===Kr&&(X.value=t,Gr.value=!0)})()});let Z=u(()=>q.value.width/(R.value.end-R.value.start)),qr=u(()=>{let e=[];for(let t=0;t<R.value.end-R.value.start;t+=1){let n=Wr.value.map(e=>e.values[t]??null),r=n.filter(e=>[void 0,null].includes(e)).length===n.length,i=n.reduce((e,t)=>e+t,0),a=n.map(e=>e/i),o=q.value.left+Z.value*t+Z.value/2;e.push({index:t,percentages:a,subtotal:r||i<0?null:i,values:n,x:o})}return e}),Jr=u(()=>{let e=Math.max(...qr.value.map(e=>e.subtotal).filter(e=>i(e)))??1,t=Math.min(...qr.value.map(e=>e.subtotal).filter(e=>i(e)))??0,n=Math.max(N.value.yAxis.scaleMax??0,e),r;return r=N.value.yAxis.scaleMin==null?0:Math.min(t,N.value.yAxis.scaleMin),N.value.yAxis.autoScale&&(r=t,n=e),r===n&&(r=n/2,n*=1.5),{max:n,min:r}}),Q=u(()=>{let e=qr.value.length===1?Jr.value.max*2:Jr.value.max;return ie(Jr.value.min,e,N.value.yAxis.dataLabels.steps)});ft(()=>Q.value.ticks.join(`|`),()=>{Ln()},{flush:`post`});function Yr(e){return(e-Q.value.min)/(Q.value.max-Q.value.min)}let Xr=u(()=>Q.value.ticks.map(e=>({y:q.value.bottom-q.value.height*Yr(e),value:e}))),$=u(()=>{let e=qr.value,t=Math.max(...e.map(e=>e.subtotal));return e.length===1&&t*2,e.map((t,n)=>{let r=Math.min(q.value.width/24,Z.value/2*.7),i=r>q.value.width/16?q.value.width/16:r,a=E.value===t.index?q.value.width/16:i,o=e.length>4?r*2:r*2>Z.value/2*.7?Z.value/2*.7:r*2,s=q.value.bottom-q.value.height*Yr(t.subtotal),c=Wr.value.map(e=>({color:e.color,name:e.name,value:e.values[n]??0})).toSorted((e,t)=>t.value-e.value);return{...t,y:s,radius:i,activeRadius:a,hoverRadius:o,donut:ee({series:c},t.x,s,i,i,1.99999,2,1,360,105.25,i/2),donutHover:ee({series:c},t.x,s,o,o,1.99999,2,1,360,105.25,o/2),donutFocus:ee({series:c},q.value.centerX,q.value.centerY,q.value.height/3.6,q.value.height/3.6,1.99999,2,1,360,105.25,q.value.height/6)}})});function Zr(e,t,r){return ce(P.value.dataLabels.formatter,e,n({p:P.value.dataLabels.prefix,v:e,s:P.value.dataLabels.suffix,r:P.value.dataLabels.rounding}),{datapoint:t,index:r})}function Qr(e,t){return isNaN(e.value/r(t,`value`))?0:(e.value/r(t,`value`)*100).toFixed(0)+`%`}function $r(e){let t=G.value;if(!t)return null;if(t.createSVGPoint&&t.getScreenCTM){let n=t.createSVGPoint();n.x=e.clientX,n.y=e.clientY;let r=t.getScreenCTM();if(r){let e=n.matrixTransform(r.inverse());return{x:e.x,y:e.y}}}let n=t.getBoundingClientRect(),r=t.viewBox?.baseVal||{x:0,y:0,width:n.width,height:n.height},i=Math.min(n.width/r.width,n.height/r.height);if(!Number.isFinite(i)||i<=0)return null;let a=r.width*i,o=r.height*i,ee=(n.width-a)/2,s=(n.height-o)/2;return{x:(e.clientX-n.left-ee)/i+r.x,y:(e.clientY-n.top-s)/i+r.y}}let ei=u(()=>!z.value||B.value==null||V.value==null?null:{x:Math.min(B.value,V.value),y:q.value.top,width:Math.abs(V.value-B.value),height:q.value.height}),ti=u(()=>dr.value?Number(R.value.start)!==0||Number(R.value.end)!==Number(Y.value):!1);function ni(e){return Math.min(Math.max(e,q.value.left),q.value.right)}function ri(){E.value=null,hn.value=null,A.value=null}function ii(e){let t=e?.pointerId==null?H.value:e.pointerId;t!=null&&G.value?.hasPointerCapture?.(t)&&G.value.releasePointerCapture(t),z.value=!1,B.value=null,V.value=null,H.value=null}function ai(){sr.value=!0,setTimeout(()=>{sr.value=!1},0)}function oi(e){sr.value&&(sr.value=!1,e.preventDefault(),e.stopPropagation())}function si(e){if(!U.value||!ti.value||!e)return!1;let t=Date.now(),n=e.pointerType||`mouse`,r=cr.value,i=n===`touch`?450:350,a=n===`touch`?28:10,o=Math.hypot(e.clientX-r.x,e.clientY-r.y);return r.time>0&&r.pointerType===n&&t-r.time<=i&&o<=a?(cr.value={time:0,x:0,y:0,pointerType:null},ai(),vi(),ii(e),Vi(),Sr({force:!0,publish:!0}),!0):(cr.value={time:t,x:e.clientX,y:e.clientY,pointerType:n},!1)}function ci(e){let t=Number(R.value.end)-Number(R.value.start);if(t<=0||!Number.isFinite(Z.value)||Z.value<=0)return null;let n=Math.floor((ni(e)-q.value.left)/Z.value);return Math.max(0,Math.min(t-1,n))}function li(e,t){let n=ci(e),r=ci(t);if(n==null||r==null)return null;let i=Math.min(n,r),a=Math.max(n,r);return a<=i?null:{start:Number(R.value.start)+i,end:Number(R.value.start)+a+1}}function ui(e){let t=br(e);return t?(j(`zoomStart`,{index:t.start,isZoom:t.start!==0}),j(`zoomEnd`,{index:t.end,isZoom:t.end!==Y.value}),t):null}function di(e){if(!U.value||Fi.value||e.button!==void 0&&e.button!==0||H.value!=null&&e.pointerId!==H.value)return;let t=$r(e);if(!t||t.x<q.value.left||t.x>q.value.right||t.y<q.value.top||t.y>q.value.bottom||Number(R.value.end)-Number(R.value.start)<=1)return;or.value=!0,G.value?.focus?.({preventScroll:!0}),vi(),ri();let n=ni(t.x);H.value=e.pointerId,z.value=!0,B.value=n,V.value=n}function fi(e){if(!U.value||!z.value||H.value!=null&&e.pointerId!==H.value)return;let t=$r(e);t&&(V.value=ni(t.x),ri(),B.value!=null&&Math.abs(V.value-B.value)>=2&&!G.value?.hasPointerCapture?.(e.pointerId)&&G.value?.setPointerCapture?.(e.pointerId))}function pi(e){if(!U.value||!z.value||H.value!=null&&e.pointerId!==H.value)return;let t=$r(e);t&&(V.value=ni(t.x));let n=B.value,r=V.value;if((n==null||r==null?0:Math.abs(r-n))<Math.max(4,q.value.width*.01)){if(si(e))return;ii(e);return}let i=li(Math.min(n,r),Math.max(n,r));i?(ii(e),ui(i)&&(cr.value={time:0,x:0,y:0,pointerType:null},ri(),ai())):ii(e)}function mi(e){z.value||(E.value=null,hn.value=null,A.value=null,M.value.events.datapointLeave&&M.value.events.datapointLeave({datapoint:e,seriesIndex:e.seriesIndex+R.value.start}))}function hi(e){z.value||(M.value.events.datapointEnter&&M.value.events.datapointEnter({datapoint:e,seriesIndex:e.index+R.value.start}),E.value=e.index,hn.value=e,A.value=e.index)}let gi=_(null),_i=null;function vi(){_i&&=(clearTimeout(_i),null)}function yi(e,t){M.value.events.datapointClick&&M.value.events.datapointClick({datapoint:e,seriesIndex:e.index+R.value.start}),e.subtotal&&$n.value.show&&(hn.value=null,E.value=null,gn.value=!0,D.value=e,Hi(e),[null,void 0].includes(t)||(gi.value=t))}function bi(e,t){if(vi(),!U.value||!ti.value){yi(e,t);return}let n=cr.value.pointerType===`touch`?480:380;_i=setTimeout(()=>{_i=null,yi(e,t)},n)}let xi=u(()=>J.value.map((e,t)=>({name:e.name,value:e.values.slice(R.value.start,R.value.end).reduce((e,t)=>e+t,0),shape:`circle`,uid:e.uid,color:e.color})).sort((e,t)=>t.value-e.value).map((e,t)=>({...e,opacity:T.value.includes(e.uid)?.5:1,segregate:()=>Ti(e.uid),isSegregated:T.value.includes(e.uid),display:`${e.name}${F.value.legend.showPercentage||F.value.legend.showValue?`: `:``}${F.value.legend.showValue?ce(P.value.dataLabels.formatter,e.value,n({p:P.value.dataLabels.prefix,v:e.value,s:P.value.dataLabels.suffix,r:F.value.legend.roundingValue}),{datapoint:e,seriesIndex:t}):``}${F.value.legend.showPercentage?T.value.includes(e.uid)?`${F.value.legend.showValue?` (`:``}- %${F.value.legend.showValue?`)`:``}`:`${F.value.legend.showValue?` (`:``}${isNaN(e.value/Si.value)?`-`:n({v:e.value/Si.value*100,s:`%`,r:F.value.legend.roundingPercentage})}${F.value.legend.showValue?`)`:``}`:``}`}))),Si=u(()=>$.value.map(e=>e.subtotal).reduce((e,t)=>e+t,0)),Ci=u(()=>({cy:`donut-div-legend`,backgroundColor:F.value.legend.backgroundColor,color:F.value.legend.color,fontSize:F.value.legend.fontSize,paddingBottom:12,fontWeight:F.value.legend.bold?`bold`:``}));function wi(){T.value.length?T.value=[]:xi.value.forEach(e=>{T.value.push(e.uid)}),j(`selectLegend`,Wr.value)}function Ti(e){if(T.value.includes(e))T.value=T.value.filter(t=>t!==e),j(`selectLegend`,Wr.value);else{if(T.value.length===J.value.length-1)return;T.value.push(e),j(`selectLegend`,Wr.value)}D.value&&yi($.value.find((e,t)=>t===gi.value))}function Ei(e){return J.value.length?J.value.find(t=>t.name===e)||(Zn.value&&console.warn(`VueUiDonutEvolution - Series name not found "${e}"`),null):(Zn.value&&console.warn(`VueUiDonutEvolution - There are no series to show.`),null)}function Di(e){let t=Ei(e);t!==null&&T.value.includes(t.uid)&&Ti(t.uid)}function Oi(e){let t=Ei(e);t!==null&&(T.value.includes(t.uid)||Ti(t.uid))}let ki=u(()=>{let e=[``].concat(J.value.filter(e=>!T.value.includes(e.uid)).map(e=>({name:e.name,color:e.color})),[`Σ`]),t=[];for(let e=0;e<Y.value;e+=1){let n=J.value.filter(e=>!T.value.includes(e.uid)).map(t=>t.values[e]??0).reduce((e,t)=>e+t,0);t.push([X.value[e]?X.value[e].text:`-`].concat(J.value.filter(e=>!T.value.includes(e.uid)).map(t=>({value:t.values[e]??0,percentage:t.values[e]?t.values[e]/n*100:0})),[`${P.value.dataLabels.prefix}${Number(n.toFixed(M.value.table.td.roundingValue))}${P.value.dataLabels.suffix}`]))}return{head:e,body:t,bodyA11y:t.map(e=>e.map((t,n)=>n===0||n===e.length-1?t:`${Zr(t.value??0,null,n)} (${t.percentage.toFixed(1)}%)`)),config:{th:{backgroundColor:M.value.table.th.backgroundColor,color:M.value.table.th.color,outline:M.value.table.th.outline},td:{backgroundColor:M.value.table.td.backgroundColor,color:M.value.table.td.color,outline:M.value.table.td.outline},breakpoint:M.value.table.responsiveBreakpoint},colNames:[M.value.table.columnNames.period].concat(J.value.filter(e=>!T.value.includes(e.uid)).map(e=>e.name),M.value.table.columnNames.total)}});function Ai(){return J.value}function ji(e=null){it(()=>{let t=[[F.value.title.text],[F.value.title.subtitle.text],[``]],n=[...ki.value.head.map(e=>e.name??e)],r=[...ki.value.body.map(e=>e.map(e=>e.value??e))],i=t.concat([n]).concat(r),o=a(i);e?e(o):de({csvContent:o,title:F.value.title.text||`vue-ui-donut-evolution`})})}let Mi=_(!1);function Ni(e){Mi.value=e,vn.value+=1}function Pi(){Ir.value.showTable=!Ir.value.showTable}let Fi=_(!1);function Ii(){Fi.value=!Fi.value}function Li(e){return e.proportion*100>F.value.donuts.hover.hideLabelsUnderValue}let Ri=_([]),zi=_({}),Bi=_(null);function Vi(){Bi.value?.close?.(),D.value=null,gi.value=null,gn.value=!1,hn.value=null,E.value=null,A.value=null}function Hi(e){Ri.value=e.donut.map(e=>({name:e.name,values:[e.value],color:e.color})),zi.value=me({...$n.value.donutChart,responsive:!0,theme:M.value.theme}),Bi.value&&Bi.value.open()}let Ui=Ee(O,()=>F.value.title.text),Wi=u(()=>L.value.width),Gi=u(()=>L.value.height);Be({timeLabelsEls:wn,timeLabels:X,slicer:R,configRef:M,rotationPath:[`style`,`chart`,`layout`,`grid`,`xAxis`,`dataLabels`,`rotation`],autoRotatePath:[`style`,`chart`,`layout`,`grid`,`xAxis`,`dataLabels`,`autoRotate`,`enable`],isAutoSize:!1,width:Wi,height:Gi,rotation:N.value.xAxis.dataLabels.autoRotate.angle});let Ki=u(()=>Ae({config:M,style:F,mutableConfig:Ir,dialog:dn,accordion:rn,isFullscreen:Mi,parent:O,maxWidth:800,isCursorPointer:I}));ft(()=>Ir.value.showTable,e=>ke(e,M,On));function qi(){Ir.value.showTable=!1,kn.value&&kn.value.setTableIconState(!1)}let Ji=u(()=>xi.value.map(e=>({...e,name:e.display}))),Yi=u(()=>F.value.backgroundColor),Xi=u(()=>F.value.legend),Zi=u(()=>F.value.title),{isCallbackImaging:Qi,isCallbackSvg:$i,generateSvg:ea,onGenerateImage:ta}=Oe({svg:G,title:Zi,legend:Xi,legendItems:Ji,backgroundColor:Yi,getSvgCallback:()=>M.value.userOptions.callbacks.svg,generateImage:Nr});async function na(){j(`copyAlt`,{config:M.value,dataset:$.value}),M.value.userOptions.callbacks.altCopy?await Promise.resolve(M.value.userOptions.callbacks.altCopy({config:M.value,dataset:$.value})):console.warn("Vue Data UI - A callback must be set for `altCopy` in userOptions.")}function ra(){A.value=null,qn.value=!0}function ia(){or.value=!1,A.value=null,E.value=null,hn.value=null,qn.value=!1}function aa(e){if(!G.value||Fi.value||document.activeElement!==G.value||(or.value=!1,!$.value.length))return;let t=e.key===`ArrowLeft`,n=e.key===`ArrowRight`,r=e.key===`Enter`||e.key===` `,i=e.key===`Escape`;if(!t&&!n&&!r&&!i)return;if(e.preventDefault(),e.stopPropagation(),i){if(U.value&&(ti.value||z.value)){vi(),ii(),Vi(),Sr({force:!0,publish:!0});return}A.value=null,E.value=null,hn.value=null;return}if(r){if(A.value===null)return;let e=$.value[A.value];if(!e)return;yi(e,A.value);return}let a=A.value,o=E.value,ee=a!==null&&a>=0&&a<$.value.length,s=o!==null&&o>=0&&o<$.value.length;ee?n?(a+=1,a>=$.value.length&&(a=0)):t&&(--a,a<0&&(a=$.value.length-1)):s?(a=n?o+1:o-1,a>=$.value.length&&(a=0),a<0&&(a=$.value.length-1)):a=n?0:$.value.length-1;let c=$.value[a];c&&hi(c)}let oa=u(()=>({headers:ki.value?.colNames??[],rows:ki.value?.bodyA11y??[]}));Ce({getData:Ai,getImage:Ui,generatePdf:Mr,generateCsv:ji,generateImage:Nr,generateSvg:ea,hideSeries:Oi,showSeries:Di,toggleTable:Pi,toggleAnnotator:Ii,toggleFullscreen:Ni,copyAlt:na,resetZoom:()=>Sr({force:!0,publish:!0}),setZoomState:br}),ft(()=>[L.value.width,L.value.height,jn.value,X.value,Gr.value,R.value.start,R.value.end,N.value,P.value,M.value.style.fontFamily,C.dataset,Yn.value,Cn.value,wn.value,Tn.value,En.value],Vr,{flush:`post`,deep:!0});let sa=u(()=>Je({enabled:M.value.userOptions?.annotator?.followZoom,area:q.value,range:R.value,ticks:Xr.value}));return(e,t)=>(g(),p(`div`,{ref_key:`donutEvolutionChart`,ref:O,class:h(`vue-data-ui-component vue-ui-donut-evolution ${Mi.value?`vue-data-ui-wrapper-fullscreen`:``} ${M.value.useCssAnimation?``:`vue-ui-dna`}`),style:ot(`font-family:${M.value.style.fontFamily};width:100%; text-align:center;background:${F.value.backgroundColor}`),id:w.value,onMouseenter:t[4]||=()=>x(Dr)(!0),onMouseleave:t[5]||=()=>x(Dr)(!1)},[m(`div`,{id:`chart-instructions-${w.value}`,class:`sr-only`},[m(`p`,null,b(M.value.a11y.translations.keyboardNavigation),1)],8,gt),oa.value?.rows?.length?(g(),d(Ge,{key:0,uid:w.value,head:oa.value.headers,body:oa.value.rows,notice:M.value.a11y.translations.tableAvailable,caption:M.value.a11y.translations.tableCaption},null,8,[`uid`,`head`,`body`,`notice`,`caption`])):f(``,!0),M.value.userOptions.buttons.annotator?(g(),d(x(cn),{key:1,showGroupActions:M.value.userOptions.annotator?.showGroupActions??!0,svgRef:x(G),followZoom:M.value.userOptions?.annotator?.followZoom,annotationViewport:sa.value,backgroundColor:F.value.backgroundColor,color:F.value.color,active:Fi.value,isCursorPointer:I.value,palette:M.value.userOptions.annotatorPalette,onClose:Ii},Qe({_:2},[v(x(Me),t=>({name:t,fn:S(n=>[y(e.$slots,t,at(nt(x(je)(t,n))),void 0,!0)])}))]),1032,[`showGroupActions`,`svgRef`,`followZoom`,`annotationViewport`,`backgroundColor`,`color`,`active`,`isCursorPointer`,`palette`])):f(``,!0),Pr.value?(g(),p(`div`,{key:2,ref_key:`noTitle`,ref:_n,class:`vue-data-ui-no-title-space`,style:`height:36px; width: 100%;background:transparent`},null,512)):f(``,!0),F.value.title.text?(g(),p(`div`,{key:3,ref_key:`chartTitle`,ref:zn,style:`width:100%;background:transparent;padding-bottom:24px`,onMouseleave:mi},[(g(),d(De,{key:`title_${bn.value}`,config:{title:{cy:`donut-evolution-div-title`,...F.value.title},subtitle:{cy:`donut-evolution-div-subtitle`,...F.value.title.subtitle}}},null,8,[`config`]))],544)):f(``,!0),m(`div`,{id:`legend-top-${w.value}`},null,8,_t),M.value.userOptions.show&&Jn.value&&(x(Or)||x(Er))?(g(),d(x(ln),{ref_key:`userOptionsRef`,ref:kn,key:`user_options_${vn.value}`,backgroundColor:F.value.backgroundColor,color:F.value.color,isPrinting:x(Ar),isImaging:x(jr),uid:w.value,hasPdf:M.value.userOptions.buttons.pdf,hasImg:M.value.userOptions.buttons.img,hasSvg:M.value.userOptions.buttons.svg,hasXls:M.value.userOptions.buttons.csv,hasTable:M.value.userOptions.buttons.table,hasFullscreen:M.value.userOptions.buttons.fullscreen,hasAltCopy:M.value.userOptions.buttons.altCopy,isFullscreen:Mi.value,titles:{...M.value.userOptions.buttonTitles},chartElement:O.value,position:M.value.userOptions.position,hasAnnotator:M.value.userOptions.buttons.annotator,isAnnotation:Fi.value,callbacks:M.value.userOptions.callbacks,printScale:M.value.userOptions.print.scale,tableDialog:M.value.table.useDialog,isCursorPointer:I.value,onToggleFullscreen:Ni,onGeneratePdf:x(Mr),onGenerateCsv:ji,onGenerateImage:x(ta),onGenerateSvg:x(ea),onToggleTable:Pi,onToggleAnnotator:Ii,onCopyAlt:na,style:ot({visibility:x(Or)?x(Er)?`visible`:`hidden`:`visible`})},Qe({_:2},[v(x(Ne)(e.$slots,`menuIcon optionPdf optionCsv optionImg optionSvg optionTable optionFullscreen optionAnnotator optionAltCopy custom-menu-before custom-menu-after`),t=>({name:t,fn:S(n=>[y(e.$slots,t,at(nt(x(Pe)(t,n))),void 0,!0)])}))]),1032,/* @__PURE__ */ `backgroundColor.color.isPrinting.isImaging.uid.hasPdf.hasImg.hasSvg.hasXls.hasTable.hasFullscreen.hasAltCopy.isFullscreen.titles.chartElement.position.hasAnnotator.isAnnotation.callbacks.printScale.tableDialog.isCursorPointer.onGeneratePdf.onGenerateImage.onGenerateSvg.style`.split(`.`))):f(``,!0),m(`div`,vt,[(g(),p(`svg`,{ref_key:`svgRef`,ref:G,xmlns:x(pe),"aria-describedby":`chart-instructions-${w.value}`,class:h({"vue-data-ui-fullscreen--on":Mi.value,"vue-data-ui-fulscreen--off":!Mi.value,"vue-data-ui-no-transition":!x(er)||x(Br),"vue-ui-donut-evolution-chart-zoom-pointer-focus":U.value&&or.value}),viewBox:`0 0 ${q.value.absoluteWidth} ${q.value.absoluteHeight}`,style:ot({maxWidth:`100%`,visibility:x(zr)?`visible`:`hidden`,overflow:`visible`,background:`transparent`,color:F.value.color,cursor:U.value?z.value?`col-resize`:`crosshair`:void 0,touchAction:U.value?`pan-y`:void 0,userSelect:U.value?`none`:void 0}),tabindex:`0`,onFocus:ra,onBlur:ia,onKeydown:aa,onPointerdown:di,onPointermove:fi,onPointerup:pi,onPointercancel:ii,onClickCapture:oi},[et(x(sn)),y(e.$slots,`svg-underlayer`,{svg:{...q.value,isPrintingImg:x(Ar)||x(jr)||x(Qi),isPrintingSvg:x($i)}},void 0,!0),e.$slots[`chart-background`]?(g(),p(`foreignObject`,{key:0,x:q.value.left,y:q.value.top,width:q.value.width,height:q.value.height,style:{pointerEvents:`none`}},[y(e.$slots,`chart-background`,{},void 0,!0)],8,bt)):f(``,!0),m(`defs`,null,[et(He,{t:`linear`,id:`hover_${w.value}`,x1:`0%`,y1:`0%`,x2:`0%`,y2:`100%`,stops:[[`0%`,x(c)(F.value.backgroundColor,P.value.highlighter.opacity),1],[`100%`,x(c)(P.value.highlighter.color,P.value.highlighter.opacity),1]]},null,8,[`id`,`stops`]),et(He,{t:`radial`,id:`focus_${w.value}`,stops:[[`0%`,x(c)(x(ne)(F.value.backgroundColor),0),1],[`77%`,x(c)(`#FFFFFF`,30),1],[`100%`,x(c)(x(ne)(F.value.backgroundColor),0),1]]},null,8,[`id`,`stops`])]),N.value.show?(g(),p(`g`,xt,[m(`line`,{x1:K.value?q.value.right:q.value.left,x2:K.value?q.value.right:q.value.left,y1:q.value.top,y2:q.value.top+q.value.height,stroke:N.value.stroke,"stroke-width":N.value.strokeWidth,"stroke-linecap":`round`},null,8,St),m(`line`,{x1:q.value.left,x2:q.value.right,y1:q.value.bottom,y2:q.value.bottom,stroke:N.value.stroke,"stroke-width":N.value.strokeWidth,"stroke-linecap":`round`},null,8,Ct),N.value.showVerticalLines?(g(),p(`g`,wt,[(g(!0),p(l,null,v(R.value.end-R.value.start,(e,t)=>(g(),p(`line`,{x1:q.value.left+(t+1)*Z.value,x2:q.value.left+(t+1)*Z.value,y1:q.value.top,y2:q.value.bottom,stroke:N.value.stroke,"stroke-width":N.value.strokeWidth,"stroke-linecap":`round`},null,8,Tt))),256))])):f(``,!0)])):f(``,!0),m(`g`,null,[N.value.axis.yLabel?(g(),p(`text`,{key:0,ref_key:`yAxisLabel`,ref:En,"font-size":N.value.axis.fontSize,fill:N.value.axis.color,transform:`translate(${K.value?q.value.absoluteWidth-N.value.axis.fontSize/2-N.value.axis.yLabelOffsetX:N.value.axis.fontSize}, ${q.value.top+q.value.height/2}) rotate(-90)`,"text-anchor":`middle`,style:{transition:`none`}},b(N.value.axis.yLabel),9,Et)):f(``,!0),N.value.axis.xLabel?(g(),p(`text`,{key:1,ref_key:`xAxisLabel`,ref:Tn,"text-anchor":`middle`,x:q.value.absoluteWidth/2,y:q.value.absoluteHeight-3,"font-size":N.value.axis.fontSize,fill:N.value.axis.color},b(N.value.axis.xLabel),9,Dt)):f(``,!0)]),N.value.yAxis.dataLabels.show?(g(),p(`g`,{key:2,ref_key:`scaleLabels`,ref:Cn,class:h({"donut-opacity":!0,"donut-behind":E.value!==null})},[(g(!0),p(l,null,v(Xr.value,(e,t)=>(g(),p(`g`,{key:`sl_${t}`},[e.value>=Q.value.min&&e.value<=Q.value.max?(g(),p(`path`,{key:0,class:h({"vue-data-ui-transition":x(er)&&!x(Br)}),d:`M${K.value?q.value.right:q.value.left},${e.y} ${K.value?q.value.right+5:q.value.left-5},${e.y}`,stroke:N.value.stroke,"stroke-width":N.value.strokeWidth,"stroke-linecap":`round`},null,10,Ot)):f(``,!0),e.value>=Q.value.min&&e.value<=Q.value.max?(g(),p(`text`,{key:1,class:h({"vue-data-ui-transition":x(er)&&!x(Br)}),transform:`translate(${K.value?q.value.right-N.value.yAxis.dataLabels.offsetX+7:q.value.left+N.value.yAxis.dataLabels.offsetX-7}, ${e.y+N.value.yAxis.dataLabels.fontSize/3})`,"font-size":N.value.yAxis.dataLabels.fontSize,"text-anchor":K.value?`start`:`end`,fill:N.value.yAxis.dataLabels.color,"font-weight":N.value.yAxis.dataLabels.bold?`bold`:`normal`},b(x(ge)(e.value)?x(ce)(P.value.dataLabels.formatter,e.value,x(n)({p:P.value.dataLabels.prefix,v:e.value,s:P.value.dataLabels.suffix,r:P.value.grid.yAxis.dataLabels.roundingValue}),{datapoint:e,seriesIndex:t}):``),11,kt)):f(``,!0)]))),128))],2)):f(``,!0),N.value.xAxis.dataLabels.show?(g(),p(`g`,{key:3,ref_key:`timeLabelsEls`,ref:wn,class:h({"donut-opacity":!0})},[(g(!0),p(l,null,v(R.value.end-R.value.start,(e,t)=>(g(),p(`g`,null,[(N.value.xAxis.dataLabels.showOnlyFirstAndLast&&(t===0||t===Y.value-1)||!N.value.xAxis.dataLabels.showOnlyFirstAndLast)&&X.value[t]&&X.value[t].text?(g(),p(`g`,At,[String(X.value[t].text).includes(`
1
+ import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{t}from"./useConfig-D3ZfFSE5.js";import{$ as n,$t as r,At as i,D as a,Ht as o,It as ee,J as s,Jt as c,Kt as te,S as ne,X as re,_ as ie,at as ae,f as oe,h as se,i as ce,in as le,nn as ue,nt as de,p as fe,t as pe,tt as me,w as he,y as ge,yt as _e,zt as ve}from"./lib-rPeBMZrn.js";import{n as ye,t as be}from"./BaseScanner-8NdoBs7B.js";import{n as xe,t as Se}from"./useHints-C-TwxM0Y.js";import{t as Ce}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{t as we}from"./useNestedProp-DnGoh-XS.js";import{t as Te}from"./useThemeCheck-BKNRbGeC.js";import{t as Ee}from"./chartImage-DPGnEuYM.js";import{n as De}from"./Title-BliHuXfT.js";import{t as Oe}from"./useChartExport-BZts4KFb.js";import{n as ke,t as Ae}from"./tableIntegration-CNoJ1CIY.js";import{n as je,t as Me}from"./annotationSlots-RvQBEO9-.js";import{n as Ne,t as Pe}from"./userOptionsSlots-DYuo-E5m.js";import{t as Fe}from"./useTimeLabels-Das5O74F.js";import{t as Ie}from"./usePrinter-DVf3YcG5.js";import{t as Le}from"./useTransitions-ChGGrtrv.js";import{t as Re}from"./useStableElementSize-CegFbRlF.js";import{t as ze}from"./useSvgLabelLayout-42Kats14.js";import{t as Be}from"./useTimeLabelCollider-BTybMUFi.js";import{t as Ve}from"./useResponsive-CENUxfEL.js";import{t as He}from"./DefGrad-DKMq1REY.js";import{t as Ue}from"./SlicerPreview-D7gm-OsZ.js";import{t as We}from"./BaseLegendToggle-aT9fOoGO.js";import{t as Ge}from"./A11yDataTable-DWNlWXzs.js";import{t as Ke}from"./useUserOptionState-CXlFnwPv.js";import{t as qe}from"./useChartAccessibility-DOMuYJfm.js";import{t as Je}from"./annotationViewport-X8fvs7pz.js";import{t as Ye}from"./Legend-DM0ClX3D.js";import{t as Xe}from"./vue_ui_donut_evolution-CVoh3twl.js";import{Fragment as l,Teleport as Ze,computed as u,createBlock as d,createCommentVNode as f,createElementBlock as p,createElementVNode as m,createSlots as Qe,createTextVNode as $e,createVNode as et,defineAsyncComponent as tt,guardReactiveProps as nt,mergeProps as rt,nextTick as it,normalizeClass as h,normalizeProps as at,normalizeStyle as ot,onBeforeUnmount as st,onMounted as ct,openBlock as g,ref as _,renderList as v,renderSlot as y,resolveDynamicComponent as lt,shallowRef as ut,toDisplayString as b,toRefs as dt,unref as x,watch as ft,watchEffect as pt,withCtx as S}from"vue";var mt=/* @__PURE__ */ e({default:()=>rn}),ht=[`id`],gt=[`id`],_t=[`id`],vt={style:{position:`relative`}},yt=[`xmlns`,`aria-describedby`,`viewBox`],bt=[`x`,`y`,`width`,`height`],xt={key:1},St=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`],Ct=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`],wt={key:0},Tt=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`],Et=[`font-size`,`fill`,`transform`],Dt=[`x`,`y`,`font-size`,`fill`],Ot=[`d`,`stroke`,`stroke-width`],kt=[`transform`,`font-size`,`text-anchor`,`fill`,`font-weight`],At={key:0},jt=[`text-anchor`,`font-size`,`fill`,`transform`],Mt=[`text-anchor`,`font-size`,`fill`,`transform`,`innerHTML`],Nt=[`x1`,`y1`,`x2`,`y2`,`stroke`,`stroke-width`],Pt={key:1},Ft=[`cx`,`cy`,`r`,`fill`],It={key:0},Lt={key:0},Rt=[`d`,`stroke`],zt=[`text-anchor`,`x`,`y`,`fill`],Bt=[`cx`,`cy`,`r`,`fill`],Vt={key:0},Ht=[`cx`,`cy`,`fill`],Ut={key:1},Wt=[`d`,`fill`,`stroke`],Gt={key:2},Kt=[`d`,`fill`,`stroke`],qt=[`x`,`y`,`font-size`,`fill`],Jt=[`x`,`y`,`width`,`height`,`fill`],Yt=[`x`,`y`,`width`,`height`,`onMouseenter`,`onMouseleave`,`onClick`],Xt=[`x`,`y`,`width`,`height`,`fill`,`fill-opacity`,`stroke`,`stroke-opacity`,`stroke-width`,`stroke-dasharray`],Zt={key:0,style:{position:`absolute`,top:`100%`,left:`0`,width:`100%`},"data-dom-to-png-ignore":``,"aria-hidden":`true`},Qt={key:5,class:`vue-data-ui-watermark`},$t=[`id`],en=[`onClick`],tn={key:0},nn={key:1},rn=/*#__PURE__*/ Ce({__name:`vue-ui-donut-evolution`,props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}},zoomState:{type:Object,default:null}},emits:[`selectLegend`,`zoomStart`,`zoomEnd`,`zoomReset`,`update:zoomState`,`copyAlt`],setup(e,{expose:Ce,emit:mt}){let rn=tt(()=>import(`./vue-ui-accordion-D4FHxzsL.js`).then(e=>e.n)),an=tt(()=>import(`./BaseIcon-fYK0iID8.js`).then(e=>e.n)),on=tt(()=>import(`./DataTable-5Ug6gMAX.js`)),sn=tt(()=>import(`./PackageVersion-CHQWwTik.js`).then(e=>e.t)),cn=tt(()=>import(`./PenAndPaper-r50tK3S4.js`).then(e=>e.t)),ln=tt(()=>import(`./UserOptions-BUXg7qOC.js`).then(e=>e.n)),un=tt(()=>import(`./vue-ui-donut-BD1mPA4G.js`).then(e=>e.n)),dn=tt(()=>import(`./BaseDraggableDialog-9d30Yx8c.js`).then(e=>e.n)),{vue_ui_donut_evolution:fn}=t(),{isThemeValid:pn,warnInvalidTheme:mn}=Te(),C=e,w=_(re()),T=_([]),E=_(null),hn=_(null),gn=_(!1),D=_(null),O=_(null),_n=_(null),vn=_(0),yn=_(0),bn=_(0),xn=_(0),Sn=_(0),Cn=_(null),wn=_(null),Tn=_(null),En=_(null),Dn=_(!1),On=_(null),kn=_(null),An=ut(null),jn=_(0),Mn=_(0),Nn=_(!1);function Pn(){An.value=O.value?.parentNode??null}function Fn(){return new Promise(e=>{requestAnimationFrame(()=>{requestAnimationFrame(e)})})}async function In(){let e=++Mn.value;await it(),await Fn(),await Fn(),e===Mn.value&&(jn.value+=1)}function Ln(){Nn.value||(Nn.value=!0,it(()=>{Nn.value=!1,Pn(),In()}))}let Rn=Re({elementRef:An,minimumWidth:2,minimumHeight:2,stableFramesRequired:2,once:!1,onSizeAccepted:()=>{In()}}),zn=_(null),Bn=_(null),Vn=_(null),Hn=_(null),Un=_(null),Wn=_(!1),k=ut(null),Gn=ut(null),Kn=_(null),A=_(null),qn=_(!1),j=mt,Jn=u(()=>!!C.dataset&&C.dataset.length),Yn=_(!1),Xn=0;ct(()=>{Dn.value=!0,Pn(),Rn.start(),Qn(),In()});let Zn=u(()=>M.value.debug);function Qn(){ve(C.dataset)?(ae({componentName:`VueUiDonutEvolution`,type:`dataset`,debug:Zn.value}),ir.value=!0):C.dataset.length&&C.dataset.forEach((e,t)=>{_e({datasetObject:e,requiredAttributes:[`name`,`values`]}).forEach(e=>{ae({componentName:`VueUiDonutEvolution`,type:`datasetSerieAttribute`,property:e,index:t,debug:Zn.value}),ir.value=!0})}),ve(C.dataset)||(ir.value=M.value.loading),setTimeout(()=>{Wn.value=!0},10),xr(),M.value.responsive&&(k.value&&(Gn.value&&k.value.unobserve(Gn.value),k.value.disconnect()),k.value=new ResizeObserver(()=>{Wn.value=!1;let{width:e,height:t}=Ve({chart:O.value,title:M.value.style.chart.title.text?zn.value:null,legend:M.value.style.chart.legend.show?Bn.value:null,slicer:M.value.style.chart.zoom.show&&ar.value>1?Un.value:null,source:Vn.value});cancelAnimationFrame(Xn),Xn=requestAnimationFrame(()=>{L.value.width=e,L.value.height=t-12,Yn.value=!0,Ln(),clearTimeout(Kn.value),Kn.value=setTimeout(()=>{Wn.value=!0},10)})}),Gn.value=O.value.parentNode,k.value.observe(Gn.value)),Ln()}let M=_(kr()),N=u(()=>P.value.grid),P=u(()=>M.value.style.chart.layout),$n=u(()=>M.value.style.chart.dialog),F=u(()=>M.value.style.chart);xe({config:()=>M.value,dataset:()=>C.dataset,component:`VueUiDonutEvolution`,rules:[Se.emptyArray,{test:e=>e.length===1,message:[`👀 There is only a single series in your dataset. Consider:`,``,`▶️ Using VueUiXy instead, for a regular line chart.`]},{test:e=>e.length>6,message:[`👀 The number of series is > 6, which makes donuts hard to read. 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=>e.some(e=>e.values.length>24),message:[`👀 Some series have a number of data points > 24, which can make the chart and donuts hard to read. Consider:`,``,`▶️ Using larger time scales, or aggregated values.`,``,`▶️ Filtering the time range by adding date intputs in your UI.`,``,`▶️ Using VueUiXy to show longer series in a more comfortable display.`]}]});let{transitionEnabled:er}=Le({config:()=>M.value.transitions,dataset:()=>C.dataset}),I=u(()=>M.value.userOptions.useCursorPointer),tr=u(()=>le({defaultConfig:{useCssAnimation:!1,table:{show:!1},userOptions:{show:!1},style:{chart:{backgroundColor:`#99999930`,layout:{dataLabels:{show:!1},grid:{stroke:`#6A6A6A`,axis:{yLabel:``,xLabel:``},yAxis:{scaleMin:null,scaleMax:null,autoScale:!1,dataLabels:{show:!1}},xAxis:{dataLabels:{show:!1}}},line:{stroke:`#CACACA60`}},legend:{backgroundColor:`transparent`,showValue:!1,showPercentage:!1},zoom:{show:!1,startIndex:null,endIndex:null}}}},userConfig:M.value.skeletonConfig??{}})),{loading:nr,FINAL_DATASET:rr,manualLoading:ir}=ye({...dt(C),FINAL_CONFIG:M,prepareConfig:kr,callback:()=>{Promise.resolve().then(async()=>{await xr()})},skeletonDataset:C.config?.skeletonDataset??[{name:``,values:[1,2,3,5,8,13],color:`#AAAAAA`},{name:``,values:[1,2,3,5,8,13],color:`#BABABA`},{name:``,values:[1,2,3,5,8,13],color:`#CACACA`}],skeletonConfig:le({defaultConfig:M.value,userConfig:tr.value})}),L=_({width:P.value.width,height:P.value.height}),ar=u(()=>Math.max(...rr.value.map(e=>e.values.length))),R=_({start:0,end:ar.value}),z=_(!1),or=_(!1),B=_(null),V=_(null),H=_(null),sr=_(!1),cr=_({time:0,x:0,y:0,pointerType:null}),lr=u(()=>M.value.style.chart.zoom?.dragToZoom),U=u(()=>lr.value.show&&Jn.value&&dr.value&&Y.value>1&&!nr.value),ur=_(!1),dr=_(!1),fr=_(!1),pr=null,W={};function mr(e,t=R.value){if(!e||typeof e!=`object`)return null;let n=e.start!==void 0&&e.start!==null,r=e.end!==void 0&&e.end!==null;if(!n&&!r)return null;let i=Number(n?e.start:t.start),a=Number(r?e.end:t.end);return!Number.isFinite(i)||!Number.isFinite(a)?null:{start:i,end:a}}function hr(e){let t=mr(e);t&&j(`update:zoomState`,t)}function gr(){pr&&=(cancelAnimationFrame(pr),null),W={}}function _r(e,t=R.value.start){let n=Y.value,r=Number(t);return e>n?n:e<0||e<=r?Math.min(r+1,n):e}function vr(){let e=Y.value;if(!Number.isFinite(e)||e<=0){R.value={start:0,end:0};return}let t=Math.max(0,Math.min(Number(R.value.start)||0,e-1)),n=Math.max(t+1,Math.min(Number(R.value.end)||e,e));(!Number.isFinite(t)||!Number.isFinite(n)||n<=t)&&(t=0,n=e),R.value={start:t,end:n},Hn.value&&Hn.value.setRangeValues(t,n)}function yr(e){let t=mr(e);if(!t)return null;let{start:n,end:r}=t;return(n!==Number(R.value.start)||r!==Number(R.value.end))&&(gr(),R.value={start:n,end:r},vr(),Ln()),{start:Number(R.value.start),end:Number(R.value.end)}}function br(e){let t=yr(e);return t?(hr(t),t):null}async function xr(e=!0){if(!ur.value){ur.value=!0;try{await it(),await it();let{startIndex:t,endIndex:n}=F.value.zoom,r=Y.value;if(!Number.isFinite(r)||r<=0){R.value={start:0,end:0},dr.value=!0;return}let i=t==null?0:Number(t),a=n==null?r:_r(Number(n)+1,i);fr.value=!0,R.value={start:i,end:a},vr(),dr.value=!0,e&&C.zoomState&&yr(C.zoomState)}finally{queueMicrotask(()=>{fr.value=!1}),ur.value=!1,Ln()}}}async function Sr({force:e=!1,publish:t=!1}={}){await xr(!e),t&&(hr({start:Number(R.value.start),end:Number(R.value.end)}),j(`zoomReset`))}ft([()=>C.zoomState,dr],([e,t])=>{t&&e&&yr(e)},{deep:!0,immediate:!0});function Cr(e){W={...W,...e},pr&&cancelAnimationFrame(pr),pr=requestAnimationFrame(()=>{let e={...R.value,...W};W={},pr=null,R.value=e,vr(),Ln(),hr({start:Number(R.value.start),end:Number(R.value.end)})})}function wr(e){if(ur.value||fr.value)return;let t=Number(e);Number.isFinite(t)&&(j(`zoomStart`,{index:t,isZoom:t!==0}),t!==R.value.start&&Cr({start:t}))}function Tr(e){if(ur.value||fr.value)return;let t=W.start===void 0?R.value.start:W.start,n=_r(Number(e),t);Number.isFinite(n)&&(j(`zoomEnd`,{index:n,isZoom:n!==Y.value}),(n!==R.value.end||W.start!==void 0)&&Cr({end:n}))}let{userOptionsVisible:Er,setUserOptionsVisibility:Dr,keepUserOptionState:Or}=Ke({config:M.value}),{svgRef:G}=qe({config:F.value.title});function kr(){let e=we({userConfig:C.config,defaultConfig:fn}),t={},n=e.theme;if(n){if(!pn.value(e))mn(e),t=e;else{let r=we({userConfig:Xe[n]||C.config,defaultConfig:e});t={...we({userConfig:C.config,defaultConfig:r}),customPalette:e.customPalette?e.customPalette:ue[n]||o}}}else t=e;return t}ft(()=>C.config,e=>{nr.value||(M.value=kr()),Er.value=!M.value.userOptions.showOnChartHover,Qn(),bn.value+=1,xn.value+=1,Sn.value+=1,Ir.value.showTable=M.value.table.show},{deep:!0}),ft(()=>C.dataset,e=>{Array.isArray(e)&&e.length>0&&(ir.value=!1),Sr()},{deep:!0});let{isPrinting:Ar,isImaging:jr,generatePdf:Mr,generateImage:Nr}=Ie({elementId:w.value,fileName:F.value.title.text||`vue-ui-donut-evolution`,options:M.value.userOptions.print}),Pr=u(()=>M.value.userOptions.show&&!F.value.title.text),Fr=u(()=>he(M.value.customPalette)),Ir=_({showTable:M.value.table.show});ft(M,()=>{Ir.value={showTable:M.value.table.show}},{immediate:!0});let Lr=u(()=>({top:P.value.padding.top,right:P.value.padding.right,bottom:P.value.padding.bottom,left:P.value.padding.left})),K=u(()=>N.value.yAxis.position===`right`),{metrics:Rr,ready:zr,settling:Br,update:Vr}=ze({svgRef:G,canMeasure:()=>(!M.value.responsive||Yn.value)&&(!N.value.xAxis.dataLabels.show||Gr.value),initialMetrics:{scaleLabelsWidth:0,yAxisLabelWidth:0,xAxisLabelHeight:0,timeLabelsHeight:0},measure:e=>({scaleLabelsWidth:e(Cn.value).textWidth,yAxisLabelWidth:e(En.value).rotatedWidth,xAxisLabelHeight:e(Tn.value).height,timeLabelsHeight:e(wn.value).height})});function Hr(){let e=Rr.value.scaleLabelsWidth,t=En.value?Rr.value.yAxisLabelWidth+N.value.axis.yLabelOffsetX+N.value.axis.fontSize:0,n=e+t+5;return{left:K.value?0:n,right:K.value?n:0,scaleLabelsWidth:e,yAxisLabelWidth:t,crosshair:5}}st(()=>{cancelAnimationFrame(Xn),Rn.stop(),clearTimeout(Kn.value),gr(),vi(),ii(),k.value&&(Gn.value&&k.value.unobserve(Gn.value),k.value.disconnect(),k.value=null,Gn.value=null)});let Ur=u(()=>Rr.value.xAxisLabelHeight+Rr.value.timeLabelsHeight+N.value.axis.fontSize+N.value.xAxis.dataLabels.offsetY),q=u(()=>{let e=Hr(),t=P.value.dataLabels.fontSize*3,n=L.value.width,r=L.value.height,i=Lr.value.left+e.left,a=n-Lr.value.right-e.right,o=n-i-Lr.value.right-e.right,ee=r-Lr.value.top-Lr.value.bottom-t-Ur.value,s=Lr.value.top+t;return{top:s,left:i,right:a,bottom:r-Lr.value.bottom-Ur.value,absoluteHeight:r,absoluteWidth:n,centerX:i+Math.max(10,o)/2,centerY:s+Math.max(10,ee)/2,width:Math.max(10,o),height:Math.max(10,ee),scaleLabelsWidth:e.scaleLabelsWidth,yAxisLabelWidth:e.yAxisLabelWidth,crosshair:e.crosshair}}),J=u(()=>(Zn.value&&rr.value.forEach((e,t)=>{[null,void 0].includes(e.name)&&ae({componentName:`VueUiDonutEvolution`,type:`datasetSerieAttribute`,property:`name`,index:t}),[null,void 0].includes(e.values)&&ae({componentName:`VueUiDonutEvolution`,type:`datasetSerieAttribute`,property:`values`,index:t})}),rr.value.map((e,t)=>({...e,values:te(e.values),color:ne(e.color)||Fr.value[t]||o[t]||o[t%o.length],length:(e.values||[]).length,uid:re()})))),Wr=u(()=>J.value.filter(e=>!T.value.includes(e.uid)).map(e=>({...e,values:e.values.filter((e,t)=>t>=R.value.start&&t<=R.value.end)}))),Y=u(()=>Math.max(...J.value.map(e=>e.length))),X=_([]),Gr=_(!1),Kr=0;pt(()=>{let e=++Kr;(async()=>{let t=await Fe({values:N.value.xAxis.dataLabels.values,maxDatapoints:Y.value,formatter:N.value.xAxis.dataLabels.datetimeFormatter,start:R.value.start,end:R.value.end});e===Kr&&(X.value=t,Gr.value=!0)})()});let Z=u(()=>q.value.width/(R.value.end-R.value.start)),qr=u(()=>{let e=[];for(let t=0;t<R.value.end-R.value.start;t+=1){let n=Wr.value.map(e=>e.values[t]??null),r=n.filter(e=>[void 0,null].includes(e)).length===n.length,i=n.reduce((e,t)=>e+t,0),a=n.map(e=>e/i),o=q.value.left+Z.value*t+Z.value/2;e.push({index:t,percentages:a,subtotal:r||i<0?null:i,values:n,x:o})}return e}),Jr=u(()=>{let e=Math.max(...qr.value.map(e=>e.subtotal).filter(e=>i(e)))??1,t=Math.min(...qr.value.map(e=>e.subtotal).filter(e=>i(e)))??0,n=Math.max(N.value.yAxis.scaleMax??0,e),r;return r=N.value.yAxis.scaleMin==null?0:Math.min(t,N.value.yAxis.scaleMin),N.value.yAxis.autoScale&&(r=t,n=e),r===n&&(r=n/2,n*=1.5),{max:n,min:r}}),Q=u(()=>{let e=qr.value.length===1?Jr.value.max*2:Jr.value.max;return ie(Jr.value.min,e,N.value.yAxis.dataLabels.steps)});ft(()=>Q.value.ticks.join(`|`),()=>{Ln()},{flush:`post`});function Yr(e){return(e-Q.value.min)/(Q.value.max-Q.value.min)}let Xr=u(()=>Q.value.ticks.map(e=>({y:q.value.bottom-q.value.height*Yr(e),value:e}))),$=u(()=>{let e=qr.value,t=Math.max(...e.map(e=>e.subtotal));return e.length===1&&t*2,e.map((t,n)=>{let r=Math.min(q.value.width/24,Z.value/2*.7),i=r>q.value.width/16?q.value.width/16:r,a=E.value===t.index?q.value.width/16:i,o=e.length>4?r*2:r*2>Z.value/2*.7?Z.value/2*.7:r*2,s=q.value.bottom-q.value.height*Yr(t.subtotal),c=Wr.value.map(e=>({color:e.color,name:e.name,value:e.values[n]??0})).toSorted((e,t)=>t.value-e.value);return{...t,y:s,radius:i,activeRadius:a,hoverRadius:o,donut:ee({series:c},t.x,s,i,i,1.99999,2,1,360,105.25,i/2),donutHover:ee({series:c},t.x,s,o,o,1.99999,2,1,360,105.25,o/2),donutFocus:ee({series:c},q.value.centerX,q.value.centerY,q.value.height/3.6,q.value.height/3.6,1.99999,2,1,360,105.25,q.value.height/6)}})});function Zr(e,t,r){return ce(P.value.dataLabels.formatter,e,n({p:P.value.dataLabels.prefix,v:e,s:P.value.dataLabels.suffix,r:P.value.dataLabels.rounding}),{datapoint:t,index:r})}function Qr(e,t){return isNaN(e.value/r(t,`value`))?0:(e.value/r(t,`value`)*100).toFixed(0)+`%`}function $r(e){let t=G.value;if(!t)return null;if(t.createSVGPoint&&t.getScreenCTM){let n=t.createSVGPoint();n.x=e.clientX,n.y=e.clientY;let r=t.getScreenCTM();if(r){let e=n.matrixTransform(r.inverse());return{x:e.x,y:e.y}}}let n=t.getBoundingClientRect(),r=t.viewBox?.baseVal||{x:0,y:0,width:n.width,height:n.height},i=Math.min(n.width/r.width,n.height/r.height);if(!Number.isFinite(i)||i<=0)return null;let a=r.width*i,o=r.height*i,ee=(n.width-a)/2,s=(n.height-o)/2;return{x:(e.clientX-n.left-ee)/i+r.x,y:(e.clientY-n.top-s)/i+r.y}}let ei=u(()=>!z.value||B.value==null||V.value==null?null:{x:Math.min(B.value,V.value),y:q.value.top,width:Math.abs(V.value-B.value),height:q.value.height}),ti=u(()=>dr.value?Number(R.value.start)!==0||Number(R.value.end)!==Number(Y.value):!1);function ni(e){return Math.min(Math.max(e,q.value.left),q.value.right)}function ri(){E.value=null,hn.value=null,A.value=null}function ii(e){let t=e?.pointerId==null?H.value:e.pointerId;t!=null&&G.value?.hasPointerCapture?.(t)&&G.value.releasePointerCapture(t),z.value=!1,B.value=null,V.value=null,H.value=null}function ai(){sr.value=!0,setTimeout(()=>{sr.value=!1},0)}function oi(e){sr.value&&(sr.value=!1,e.preventDefault(),e.stopPropagation())}function si(e){if(!U.value||!ti.value||!e)return!1;let t=Date.now(),n=e.pointerType||`mouse`,r=cr.value,i=n===`touch`?450:350,a=n===`touch`?28:10,o=Math.hypot(e.clientX-r.x,e.clientY-r.y);return r.time>0&&r.pointerType===n&&t-r.time<=i&&o<=a?(cr.value={time:0,x:0,y:0,pointerType:null},ai(),vi(),ii(e),Vi(),Sr({force:!0,publish:!0}),!0):(cr.value={time:t,x:e.clientX,y:e.clientY,pointerType:n},!1)}function ci(e){let t=Number(R.value.end)-Number(R.value.start);if(t<=0||!Number.isFinite(Z.value)||Z.value<=0)return null;let n=Math.floor((ni(e)-q.value.left)/Z.value);return Math.max(0,Math.min(t-1,n))}function li(e,t){let n=ci(e),r=ci(t);if(n==null||r==null)return null;let i=Math.min(n,r),a=Math.max(n,r);return a<=i?null:{start:Number(R.value.start)+i,end:Number(R.value.start)+a+1}}function ui(e){let t=br(e);return t?(j(`zoomStart`,{index:t.start,isZoom:t.start!==0}),j(`zoomEnd`,{index:t.end,isZoom:t.end!==Y.value}),t):null}function di(e){if(!U.value||Fi.value||e.button!==void 0&&e.button!==0||H.value!=null&&e.pointerId!==H.value)return;let t=$r(e);if(!t||t.x<q.value.left||t.x>q.value.right||t.y<q.value.top||t.y>q.value.bottom||Number(R.value.end)-Number(R.value.start)<=1)return;or.value=!0,G.value?.focus?.({preventScroll:!0}),vi(),ri();let n=ni(t.x);H.value=e.pointerId,z.value=!0,B.value=n,V.value=n}function fi(e){if(!U.value||!z.value||H.value!=null&&e.pointerId!==H.value)return;let t=$r(e);t&&(V.value=ni(t.x),ri(),B.value!=null&&Math.abs(V.value-B.value)>=2&&!G.value?.hasPointerCapture?.(e.pointerId)&&G.value?.setPointerCapture?.(e.pointerId))}function pi(e){if(!U.value||!z.value||H.value!=null&&e.pointerId!==H.value)return;let t=$r(e);t&&(V.value=ni(t.x));let n=B.value,r=V.value;if((n==null||r==null?0:Math.abs(r-n))<Math.max(4,q.value.width*.01)){if(si(e))return;ii(e);return}let i=li(Math.min(n,r),Math.max(n,r));i?(ii(e),ui(i)&&(cr.value={time:0,x:0,y:0,pointerType:null},ri(),ai())):ii(e)}function mi(e){z.value||(E.value=null,hn.value=null,A.value=null,M.value.events.datapointLeave&&M.value.events.datapointLeave({datapoint:e,seriesIndex:e.seriesIndex+R.value.start}))}function hi(e){z.value||(M.value.events.datapointEnter&&M.value.events.datapointEnter({datapoint:e,seriesIndex:e.index+R.value.start}),E.value=e.index,hn.value=e,A.value=e.index)}let gi=_(null),_i=null;function vi(){_i&&=(clearTimeout(_i),null)}function yi(e,t){M.value.events.datapointClick&&M.value.events.datapointClick({datapoint:e,seriesIndex:e.index+R.value.start}),e.subtotal&&$n.value.show&&(hn.value=null,E.value=null,gn.value=!0,D.value=e,Hi(e),[null,void 0].includes(t)||(gi.value=t))}function bi(e,t){if(vi(),!U.value||!ti.value){yi(e,t);return}let n=cr.value.pointerType===`touch`?480:380;_i=setTimeout(()=>{_i=null,yi(e,t)},n)}let xi=u(()=>J.value.map((e,t)=>({name:e.name,value:e.values.slice(R.value.start,R.value.end).reduce((e,t)=>e+t,0),shape:`circle`,uid:e.uid,color:e.color})).sort((e,t)=>t.value-e.value).map((e,t)=>({...e,opacity:T.value.includes(e.uid)?.5:1,segregate:()=>Ti(e.uid),isSegregated:T.value.includes(e.uid),display:`${e.name}${F.value.legend.showPercentage||F.value.legend.showValue?`: `:``}${F.value.legend.showValue?ce(P.value.dataLabels.formatter,e.value,n({p:P.value.dataLabels.prefix,v:e.value,s:P.value.dataLabels.suffix,r:F.value.legend.roundingValue}),{datapoint:e,seriesIndex:t}):``}${F.value.legend.showPercentage?T.value.includes(e.uid)?`${F.value.legend.showValue?` (`:``}- %${F.value.legend.showValue?`)`:``}`:`${F.value.legend.showValue?` (`:``}${isNaN(e.value/Si.value)?`-`:n({v:e.value/Si.value*100,s:`%`,r:F.value.legend.roundingPercentage})}${F.value.legend.showValue?`)`:``}`:``}`}))),Si=u(()=>$.value.map(e=>e.subtotal).reduce((e,t)=>e+t,0)),Ci=u(()=>({cy:`donut-div-legend`,backgroundColor:F.value.legend.backgroundColor,color:F.value.legend.color,fontSize:F.value.legend.fontSize,paddingBottom:12,fontWeight:F.value.legend.bold?`bold`:``}));function wi(){T.value.length?T.value=[]:xi.value.forEach(e=>{T.value.push(e.uid)}),j(`selectLegend`,Wr.value)}function Ti(e){if(T.value.includes(e))T.value=T.value.filter(t=>t!==e),j(`selectLegend`,Wr.value);else{if(T.value.length===J.value.length-1)return;T.value.push(e),j(`selectLegend`,Wr.value)}D.value&&yi($.value.find((e,t)=>t===gi.value))}function Ei(e){return J.value.length?J.value.find(t=>t.name===e)||(Zn.value&&console.warn(`VueUiDonutEvolution - Series name not found "${e}"`),null):(Zn.value&&console.warn(`VueUiDonutEvolution - There are no series to show.`),null)}function Di(e){let t=Ei(e);t!==null&&T.value.includes(t.uid)&&Ti(t.uid)}function Oi(e){let t=Ei(e);t!==null&&(T.value.includes(t.uid)||Ti(t.uid))}let ki=u(()=>{let e=[``].concat(J.value.filter(e=>!T.value.includes(e.uid)).map(e=>({name:e.name,color:e.color})),[`Σ`]),t=[];for(let e=0;e<Y.value;e+=1){let n=J.value.filter(e=>!T.value.includes(e.uid)).map(t=>t.values[e]??0).reduce((e,t)=>e+t,0);t.push([X.value[e]?X.value[e].text:`-`].concat(J.value.filter(e=>!T.value.includes(e.uid)).map(t=>({value:t.values[e]??0,percentage:t.values[e]?t.values[e]/n*100:0})),[`${P.value.dataLabels.prefix}${Number(n.toFixed(M.value.table.td.roundingValue))}${P.value.dataLabels.suffix}`]))}return{head:e,body:t,bodyA11y:t.map(e=>e.map((t,n)=>n===0||n===e.length-1?t:`${Zr(t.value??0,null,n)} (${t.percentage.toFixed(1)}%)`)),config:{th:{backgroundColor:M.value.table.th.backgroundColor,color:M.value.table.th.color,outline:M.value.table.th.outline},td:{backgroundColor:M.value.table.td.backgroundColor,color:M.value.table.td.color,outline:M.value.table.td.outline},breakpoint:M.value.table.responsiveBreakpoint},colNames:[M.value.table.columnNames.period].concat(J.value.filter(e=>!T.value.includes(e.uid)).map(e=>e.name),M.value.table.columnNames.total)}});function Ai(){return J.value}function ji(e=null){it(()=>{let t=[[F.value.title.text],[F.value.title.subtitle.text],[``]],n=[...ki.value.head.map(e=>e.name??e)],r=[...ki.value.body.map(e=>e.map(e=>e.value??e))],i=t.concat([n]).concat(r),o=a(i);e?e(o):de({csvContent:o,title:F.value.title.text||`vue-ui-donut-evolution`})})}let Mi=_(!1);function Ni(e){Mi.value=e,vn.value+=1}function Pi(){Ir.value.showTable=!Ir.value.showTable}let Fi=_(!1);function Ii(){Fi.value=!Fi.value}function Li(e){return e.proportion*100>F.value.donuts.hover.hideLabelsUnderValue}let Ri=_([]),zi=_({}),Bi=_(null);function Vi(){Bi.value?.close?.(),D.value=null,gi.value=null,gn.value=!1,hn.value=null,E.value=null,A.value=null}function Hi(e){Ri.value=e.donut.map(e=>({name:e.name,values:[e.value],color:e.color})),zi.value=me({...$n.value.donutChart,responsive:!0,theme:M.value.theme}),Bi.value&&Bi.value.open()}let Ui=Ee(O,()=>F.value.title.text),Wi=u(()=>L.value.width),Gi=u(()=>L.value.height);Be({timeLabelsEls:wn,timeLabels:X,slicer:R,configRef:M,rotationPath:[`style`,`chart`,`layout`,`grid`,`xAxis`,`dataLabels`,`rotation`],autoRotatePath:[`style`,`chart`,`layout`,`grid`,`xAxis`,`dataLabels`,`autoRotate`,`enable`],isAutoSize:!1,width:Wi,height:Gi,rotation:N.value.xAxis.dataLabels.autoRotate.angle});let Ki=u(()=>Ae({config:M,style:F,mutableConfig:Ir,dialog:dn,accordion:rn,isFullscreen:Mi,parent:O,maxWidth:800,isCursorPointer:I}));ft(()=>Ir.value.showTable,e=>ke(e,M,On));function qi(){Ir.value.showTable=!1,kn.value&&kn.value.setTableIconState(!1)}let Ji=u(()=>xi.value.map(e=>({...e,name:e.display}))),Yi=u(()=>F.value.backgroundColor),Xi=u(()=>F.value.legend),Zi=u(()=>F.value.title),{isCallbackImaging:Qi,isCallbackSvg:$i,generateSvg:ea,onGenerateImage:ta}=Oe({svg:G,title:Zi,legend:Xi,legendItems:Ji,backgroundColor:Yi,getSvgCallback:()=>M.value.userOptions.callbacks.svg,generateImage:Nr});async function na(){j(`copyAlt`,{config:M.value,dataset:$.value}),M.value.userOptions.callbacks.altCopy?await Promise.resolve(M.value.userOptions.callbacks.altCopy({config:M.value,dataset:$.value})):console.warn("Vue Data UI - A callback must be set for `altCopy` in userOptions.")}function ra(){A.value=null,qn.value=!0}function ia(){or.value=!1,A.value=null,E.value=null,hn.value=null,qn.value=!1}function aa(e){if(!G.value||Fi.value||document.activeElement!==G.value||(or.value=!1,!$.value.length))return;let t=e.key===`ArrowLeft`,n=e.key===`ArrowRight`,r=e.key===`Enter`||e.key===` `,i=e.key===`Escape`;if(!t&&!n&&!r&&!i)return;if(e.preventDefault(),e.stopPropagation(),i){if(U.value&&(ti.value||z.value)){vi(),ii(),Vi(),Sr({force:!0,publish:!0});return}A.value=null,E.value=null,hn.value=null;return}if(r){if(A.value===null)return;let e=$.value[A.value];if(!e)return;yi(e,A.value);return}let a=A.value,o=E.value,ee=a!==null&&a>=0&&a<$.value.length,s=o!==null&&o>=0&&o<$.value.length;ee?n?(a+=1,a>=$.value.length&&(a=0)):t&&(--a,a<0&&(a=$.value.length-1)):s?(a=n?o+1:o-1,a>=$.value.length&&(a=0),a<0&&(a=$.value.length-1)):a=n?0:$.value.length-1;let c=$.value[a];c&&hi(c)}let oa=u(()=>({headers:ki.value?.colNames??[],rows:ki.value?.bodyA11y??[]}));Ce({getData:Ai,getImage:Ui,generatePdf:Mr,generateCsv:ji,generateImage:Nr,generateSvg:ea,hideSeries:Oi,showSeries:Di,toggleTable:Pi,toggleAnnotator:Ii,toggleFullscreen:Ni,copyAlt:na,resetZoom:()=>Sr({force:!0,publish:!0}),setZoomState:br}),ft(()=>[L.value.width,L.value.height,jn.value,X.value,Gr.value,R.value.start,R.value.end,N.value,P.value,M.value.style.fontFamily,C.dataset,Yn.value,Cn.value,wn.value,Tn.value,En.value],Vr,{flush:`post`,deep:!0});let sa=u(()=>Je({enabled:M.value.userOptions?.annotator?.followZoom,area:q.value,range:R.value,ticks:Xr.value}));return(e,t)=>(g(),p(`div`,{ref_key:`donutEvolutionChart`,ref:O,class:h(`vue-data-ui-component vue-ui-donut-evolution ${Mi.value?`vue-data-ui-wrapper-fullscreen`:``} ${M.value.useCssAnimation?``:`vue-ui-dna`}`),style:ot(`font-family:${M.value.style.fontFamily};width:100%; text-align:center;background:${F.value.backgroundColor}`),id:w.value,onMouseenter:t[4]||=()=>x(Dr)(!0),onMouseleave:t[5]||=()=>x(Dr)(!1)},[m(`div`,{id:`chart-instructions-${w.value}`,class:`sr-only`},[m(`p`,null,b(M.value.a11y.translations.keyboardNavigation),1)],8,gt),oa.value?.rows?.length?(g(),d(Ge,{key:0,uid:w.value,head:oa.value.headers,body:oa.value.rows,notice:M.value.a11y.translations.tableAvailable,caption:M.value.a11y.translations.tableCaption},null,8,[`uid`,`head`,`body`,`notice`,`caption`])):f(``,!0),M.value.userOptions.buttons.annotator?(g(),d(x(cn),{key:1,showGroupActions:M.value.userOptions.annotator?.showGroupActions??!0,svgRef:x(G),followZoom:M.value.userOptions?.annotator?.followZoom,annotationViewport:sa.value,backgroundColor:F.value.backgroundColor,color:F.value.color,active:Fi.value,isCursorPointer:I.value,palette:M.value.userOptions.annotatorPalette,onClose:Ii},Qe({_:2},[v(x(Me),t=>({name:t,fn:S(n=>[y(e.$slots,t,at(nt(x(je)(t,n))),void 0,!0)])}))]),1032,[`showGroupActions`,`svgRef`,`followZoom`,`annotationViewport`,`backgroundColor`,`color`,`active`,`isCursorPointer`,`palette`])):f(``,!0),Pr.value?(g(),p(`div`,{key:2,ref_key:`noTitle`,ref:_n,class:`vue-data-ui-no-title-space`,style:`height:36px; width: 100%;background:transparent`},null,512)):f(``,!0),F.value.title.text?(g(),p(`div`,{key:3,ref_key:`chartTitle`,ref:zn,style:`width:100%;background:transparent;padding-bottom:24px`,onMouseleave:mi},[(g(),d(De,{key:`title_${bn.value}`,config:{title:{cy:`donut-evolution-div-title`,...F.value.title},subtitle:{cy:`donut-evolution-div-subtitle`,...F.value.title.subtitle}}},null,8,[`config`]))],544)):f(``,!0),m(`div`,{id:`legend-top-${w.value}`},null,8,_t),M.value.userOptions.show&&Jn.value&&(x(Or)||x(Er))?(g(),d(x(ln),{ref_key:`userOptionsRef`,ref:kn,key:`user_options_${vn.value}`,backgroundColor:F.value.backgroundColor,color:F.value.color,isPrinting:x(Ar),isImaging:x(jr),uid:w.value,hasPdf:M.value.userOptions.buttons.pdf,hasImg:M.value.userOptions.buttons.img,hasSvg:M.value.userOptions.buttons.svg,hasXls:M.value.userOptions.buttons.csv,hasTable:M.value.userOptions.buttons.table,hasFullscreen:M.value.userOptions.buttons.fullscreen,hasAltCopy:M.value.userOptions.buttons.altCopy,isFullscreen:Mi.value,titles:{...M.value.userOptions.buttonTitles},chartElement:O.value,position:M.value.userOptions.position,hasAnnotator:M.value.userOptions.buttons.annotator,isAnnotation:Fi.value,callbacks:M.value.userOptions.callbacks,printScale:M.value.userOptions.print.scale,tableDialog:M.value.table.useDialog,isCursorPointer:I.value,onToggleFullscreen:Ni,onGeneratePdf:x(Mr),onGenerateCsv:ji,onGenerateImage:x(ta),onGenerateSvg:x(ea),onToggleTable:Pi,onToggleAnnotator:Ii,onCopyAlt:na,style:ot({visibility:x(Or)?x(Er)?`visible`:`hidden`:`visible`})},Qe({_:2},[v(x(Ne)(e.$slots,`menuIcon optionPdf optionCsv optionImg optionSvg optionTable optionFullscreen optionAnnotator optionAltCopy custom-menu-before custom-menu-after`),t=>({name:t,fn:S(n=>[y(e.$slots,t,at(nt(x(Pe)(t,n))),void 0,!0)])}))]),1032,/* @__PURE__ */ `backgroundColor.color.isPrinting.isImaging.uid.hasPdf.hasImg.hasSvg.hasXls.hasTable.hasFullscreen.hasAltCopy.isFullscreen.titles.chartElement.position.hasAnnotator.isAnnotation.callbacks.printScale.tableDialog.isCursorPointer.onGeneratePdf.onGenerateImage.onGenerateSvg.style`.split(`.`))):f(``,!0),m(`div`,vt,[(g(),p(`svg`,{ref_key:`svgRef`,ref:G,xmlns:x(pe),"aria-describedby":`chart-instructions-${w.value}`,class:h({"vue-data-ui-fullscreen--on":Mi.value,"vue-data-ui-fulscreen--off":!Mi.value,"vue-data-ui-no-transition":!x(er)||x(Br),"vue-ui-donut-evolution-chart-zoom-pointer-focus":U.value&&or.value}),viewBox:`0 0 ${q.value.absoluteWidth} ${q.value.absoluteHeight}`,style:ot({maxWidth:`100%`,visibility:x(zr)?`visible`:`hidden`,overflow:`visible`,background:`transparent`,color:F.value.color,cursor:U.value?z.value?`col-resize`:`crosshair`:void 0,touchAction:U.value?`pan-y`:void 0,userSelect:U.value?`none`:void 0}),tabindex:`0`,onFocus:ra,onBlur:ia,onKeydown:aa,onPointerdown:di,onPointermove:fi,onPointerup:pi,onPointercancel:ii,onClickCapture:oi},[et(x(sn)),y(e.$slots,`svg-underlayer`,{svg:{...q.value,isPrintingImg:x(Ar)||x(jr)||x(Qi),isPrintingSvg:x($i)}},void 0,!0),e.$slots[`chart-background`]?(g(),p(`foreignObject`,{key:0,x:q.value.left,y:q.value.top,width:q.value.width,height:q.value.height,style:{pointerEvents:`none`}},[y(e.$slots,`chart-background`,{},void 0,!0)],8,bt)):f(``,!0),m(`defs`,null,[et(He,{t:`linear`,id:`hover_${w.value}`,x1:`0%`,y1:`0%`,x2:`0%`,y2:`100%`,stops:[[`0%`,x(c)(F.value.backgroundColor,P.value.highlighter.opacity),1],[`100%`,x(c)(P.value.highlighter.color,P.value.highlighter.opacity),1]]},null,8,[`id`,`stops`]),et(He,{t:`radial`,id:`focus_${w.value}`,stops:[[`0%`,x(c)(x(ne)(F.value.backgroundColor),0),1],[`77%`,x(c)(`#FFFFFF`,30),1],[`100%`,x(c)(x(ne)(F.value.backgroundColor),0),1]]},null,8,[`id`,`stops`])]),N.value.show?(g(),p(`g`,xt,[m(`line`,{x1:K.value?q.value.right:q.value.left,x2:K.value?q.value.right:q.value.left,y1:q.value.top,y2:q.value.top+q.value.height,stroke:N.value.stroke,"stroke-width":N.value.strokeWidth,"stroke-linecap":`round`},null,8,St),m(`line`,{x1:q.value.left,x2:q.value.right,y1:q.value.bottom,y2:q.value.bottom,stroke:N.value.stroke,"stroke-width":N.value.strokeWidth,"stroke-linecap":`round`},null,8,Ct),N.value.showVerticalLines?(g(),p(`g`,wt,[(g(!0),p(l,null,v(R.value.end-R.value.start,(e,t)=>(g(),p(`line`,{x1:q.value.left+(t+1)*Z.value,x2:q.value.left+(t+1)*Z.value,y1:q.value.top,y2:q.value.bottom,stroke:N.value.stroke,"stroke-width":N.value.strokeWidth,"stroke-linecap":`round`},null,8,Tt))),256))])):f(``,!0)])):f(``,!0),m(`g`,null,[N.value.axis.yLabel?(g(),p(`text`,{key:0,ref_key:`yAxisLabel`,ref:En,"font-size":N.value.axis.fontSize,fill:N.value.axis.color,transform:`translate(${K.value?q.value.absoluteWidth-N.value.axis.fontSize/2-N.value.axis.yLabelOffsetX:N.value.axis.fontSize}, ${q.value.top+q.value.height/2}) rotate(-90)`,"text-anchor":`middle`,style:{transition:`none`}},b(N.value.axis.yLabel),9,Et)):f(``,!0),N.value.axis.xLabel?(g(),p(`text`,{key:1,ref_key:`xAxisLabel`,ref:Tn,"text-anchor":`middle`,x:q.value.absoluteWidth/2,y:q.value.absoluteHeight-3,"font-size":N.value.axis.fontSize,fill:N.value.axis.color},b(N.value.axis.xLabel),9,Dt)):f(``,!0)]),N.value.yAxis.dataLabels.show?(g(),p(`g`,{key:2,ref_key:`scaleLabels`,ref:Cn,class:h({"donut-opacity":!0,"donut-behind":E.value!==null})},[(g(!0),p(l,null,v(Xr.value,(e,t)=>(g(),p(`g`,{key:`sl_${t}`},[e.value>=Q.value.min&&e.value<=Q.value.max?(g(),p(`path`,{key:0,class:h({"vue-data-ui-transition":x(er)&&!x(Br)}),d:`M${K.value?q.value.right:q.value.left},${e.y} ${K.value?q.value.right+5:q.value.left-5},${e.y}`,stroke:N.value.stroke,"stroke-width":N.value.strokeWidth,"stroke-linecap":`round`},null,10,Ot)):f(``,!0),e.value>=Q.value.min&&e.value<=Q.value.max?(g(),p(`text`,{key:1,class:h({"vue-data-ui-transition":x(er)&&!x(Br)}),transform:`translate(${K.value?q.value.right-N.value.yAxis.dataLabels.offsetX+7:q.value.left+N.value.yAxis.dataLabels.offsetX-7}, ${e.y+N.value.yAxis.dataLabels.fontSize/3})`,"font-size":N.value.yAxis.dataLabels.fontSize,"text-anchor":K.value?`start`:`end`,fill:N.value.yAxis.dataLabels.color,"font-weight":N.value.yAxis.dataLabels.bold?`bold`:`normal`},b(x(ge)(e.value)?x(ce)(P.value.dataLabels.formatter,e.value,x(n)({p:P.value.dataLabels.prefix,v:e.value,s:P.value.dataLabels.suffix,r:P.value.grid.yAxis.dataLabels.roundingValue}),{datapoint:e,seriesIndex:t}):``),11,kt)):f(``,!0)]))),128))],2)):f(``,!0),N.value.xAxis.dataLabels.show?(g(),p(`g`,{key:3,ref_key:`timeLabelsEls`,ref:wn,class:h({"donut-opacity":!0})},[(g(!0),p(l,null,v(R.value.end-R.value.start,(e,t)=>(g(),p(`g`,null,[(N.value.xAxis.dataLabels.showOnlyFirstAndLast&&(t===0||t===Y.value-1)||!N.value.xAxis.dataLabels.showOnlyFirstAndLast)&&X.value[t]&&X.value[t].text?(g(),p(`g`,At,[String(X.value[t].text).includes(`
2
2
  `)?(g(),p(`text`,{key:1,class:`vue-data-ui-time-label`,"text-anchor":N.value.xAxis.dataLabels.rotation>0?`start`:N.value.xAxis.dataLabels.rotation<0?`end`:`middle`,"font-size":N.value.xAxis.dataLabels.fontSize,fill:N.value.xAxis.dataLabels.color,transform:`translate(${q.value.left+Z.value*t+Z.value/2}, ${q.value.bottom+N.value.xAxis.dataLabels.fontSize+N.value.xAxis.dataLabels.offsetY}), rotate(${N.value.xAxis.dataLabels.rotation})`,innerHTML:x(s)({content:String(X.value[t].text),fontSize:N.value.xAxis.dataLabels.fontSize,fill:P.value.grid.xAxis.dataLabels.color,x:0,y:0})},null,8,Mt)):(g(),p(`text`,{key:0,class:`vue-data-ui-time-label`,"text-anchor":N.value.xAxis.dataLabels.rotation>0?`start`:N.value.xAxis.dataLabels.rotation<0?`end`:`middle`,"font-size":N.value.xAxis.dataLabels.fontSize,fill:N.value.xAxis.dataLabels.color,transform:`translate(${q.value.left+Z.value*t+Z.value/2}, ${q.value.bottom+N.value.xAxis.dataLabels.fontSize+N.value.xAxis.dataLabels.offsetY}), rotate(${N.value.xAxis.dataLabels.rotation})`},b(X.value[t].text||``),9,jt))])):f(``,!0)]))),256))],512)):f(``,!0),(g(!0),p(l,null,v($.value,(e,t)=>(g(),p(`g`,null,[P.value.line.show&&t<$.value.length-1&&![e.subtotal,$.value[t+1].subtotal].includes(null)?(g(),p(`line`,{key:0,class:h({"donut-opacity":!0,"donut-behind":E.value!==null}),x1:e.x,y1:e.y,x2:$.value[t+1].x,y2:$.value[t+1].y,stroke:P.value.line.stroke,"stroke-width":P.value.line.strokeWidth,"stroke-linecap":`round`,"stroke-linejoin":`round`},null,10,Nt)):f(``,!0),e.subtotal===null?f(``,!0):(g(),p(`g`,Pt,[e.subtotal?(g(),p(`circle`,{key:0,cx:e.x,cy:e.y,r:e.activeRadius,fill:F.value.backgroundColor},null,8,Ft)):f(``,!0)]))]))),256)),(g(!0),p(l,null,v($.value,(e,t)=>(g(),p(`g`,{class:h({"donut-opacity":!0,"donut-behind":t!==E.value&&E.value!==null})},[e.subtotal?(g(),p(`g`,It,[E.value!==null&&E.value===t?(g(),p(`g`,Lt,[(g(!0),p(l,null,v(e.donutHover,t=>(g(),p(`g`,null,[Li(t)?(g(),p(`path`,{key:0,d:x(se)(t,{x:t.center.endX,y:t.center.endY},12,12,{x:e.x,y:e.y},!1,20),stroke:t.color,"stroke-width":`1`,"stroke-linecap":`round`,"stroke-linejoin":`round`,fill:`none`},null,8,Rt)):f(``,!0)]))),256)),(g(!0),p(l,null,v(e.donutHover,(t,n)=>(g(),p(`g`,null,[Li(t)?(g(),p(`text`,{key:0,"data-cy-hover-label":``,"text-anchor":x(oe)(t,!0,0).anchor,x:x(oe)(t,!0,9).x,y:x(fe)(t,14,10),fill:N.value.yAxis.dataLabels.color,"font-size":8,"font-weight":`bold`},b(t.name)+`: `+b(Qr(t,e.donut))+` (`+b(t.value===null?`-`:Zr(t.value,t,n))+`) `,9,zt)):f(``,!0)]))),256)),m(`g`,null,[m(`circle`,{cx:e.x,cy:e.y,r:e.hoverRadius,fill:F.value.backgroundColor},null,8,Bt)])])):f(``,!0)])):f(``,!0)],2))),256)),(g(!0),p(l,null,v($.value,(e,t)=>(g(),p(`g`,{class:h({"donut-opacity":!0,"donut-behind":t!==E.value&&E.value!==null})},[e.subtotal===null?f(``,!0):(g(),p(`g`,Vt,[e.subtotal===0?(g(),p(`circle`,{key:0,cx:e.x,cy:e.y,r:3,fill:F.value.color},null,8,Ht)):E.value!==null&&E.value===t?(g(),p(`g`,Ut,[(g(!0),p(l,null,v(e.donutHover,(e,t)=>(g(),p(`path`,{d:e.arcSlice,fill:`${e.color}`,"stroke-width":1,stroke:F.value.backgroundColor},null,8,Wt))),256))])):(g(),p(`g`,Gt,[(g(!0),p(l,null,v(e.donut,(e,t)=>(g(),p(`path`,{d:e.arcSlice,fill:`${e.color}`,"stroke-width":.5,stroke:F.value.backgroundColor},null,8,Kt))),256))]))]))],2))),256)),(g(!0),p(l,null,v($.value,(e,t)=>(g(),p(`g`,{class:h({"donut-opacity":!0,"donut-behind":t!==E.value&&E.value!==null||gn.value&&t!==D.value.index})},[e.subtotal!==null&&P.value.dataLabels.show?(g(),p(`text`,{key:0,"text-anchor":`middle`,x:e.x,y:E.value===e.index&&e.subtotal?e.y+P.value.dataLabels.fontSize/3:e.y-e.radius-P.value.dataLabels.fontSize+P.value.dataLabels.offsetY,"font-size":P.value.dataLabels.fontSize,"font-weight":`bold`,fill:P.value.dataLabels.color},b(Zr(e.subtotal,e,t)),9,qt)):f(``,!0)],2))),256)),(g(!0),p(l,null,v($.value,(e,t)=>(g(),p(`rect`,{x:q.value.left+t*Z.value,y:q.value.top,width:Z.value,height:q.value.height,fill:[E.value,gi.value].includes(e.index)?`url(#hover_${w.value})`:`transparent`,class:h({"donut-hover":I.value&&e.subtotal&&[E.value,gi.value].includes(e.index)}),style:{pointerEvents:`none`}},null,10,Jt))),256)),(g(!0),p(l,null,v($.value,(e,t)=>(g(),p(`rect`,{"data-cy-trap":``,x:q.value.left+t*Z.value,y:q.value.top,width:Z.value,height:q.value.height,fill:`transparent`,onMouseenter:t=>hi(e),onMouseleave:t=>mi(e),onClick:n=>bi(e,t),style:ot({cursor:U.value?z.value?`col-resize`:`crosshair`:void 0}),class:h({"donut-hover":I.value&&E.value===e.index&&e.subtotal})},null,46,Yt))),256)),ei.value?(g(),p(`rect`,{key:4,x:ei.value.x,y:ei.value.y,width:ei.value.width,height:ei.value.height,fill:lr.value.selection.fill,"fill-opacity":lr.value.selection.fillOpacity,stroke:lr.value.selection.stroke,"stroke-opacity":lr.value.selection.strokeOpacity,"stroke-width":lr.value.selection.strokeWidth,"stroke-dasharray":lr.value.selection.strokeDasharray,"stroke-linecap":`round`,"stroke-linejoin":`round`,"pointer-events":`none`},null,8,Xt)):f(``,!0),y(e.$slots,`svg`,{svg:{...q.value,isPrintingImg:x(Ar)||x(jr)||x(Qi),isPrintingSvg:x($i)}},void 0,!0)],46,yt)),e.$slots.hint?(g(),p(`div`,Zt,[y(e.$slots,`hint`,at(nt({hint:M.value.a11y.translations.keyboardNavigation,isVisible:qn.value})),void 0,!0)])):f(``,!0)]),e.$slots.watermark?(g(),p(`div`,Qt,[y(e.$slots,`watermark`,at(nt({isPrinting:x(Ar)||x(jr)||x(Qi)||x($i)})),void 0,!0)])):f(``,!0),m(`div`,{ref_key:`chartSlicer`,ref:Un,style:ot(`width:100%;background:${F.value.backgroundColor}`),"data-dom-to-png-ignore":``},[Y.value>1&&F.value.zoom.show?(g(),d(Ue,{ref_key:`slicerComponent`,ref:Hn,key:`slicer_${yn.value}`,background:F.value.zoom.color,borderColor:F.value.backgroundColor,fontSize:F.value.zoom.fontSize,useResetSlot:F.value.zoom.useResetSlot,timeLabels:X.value,textColor:F.value.color,inputColor:F.value.zoom.color,selectColor:F.value.zoom.highlightColor,max:Y.value,min:0,valueStart:R.value.start,valueEnd:R.value.end,refreshStartPoint:F.value.zoom.startIndex===null?0:F.value.zoom.startIndex,refreshEndPoint:F.value.zoom.endIndex===null?Y.value:F.value.zoom.endIndex+1,enableRangeHandles:F.value.zoom.enableRangeHandles,enableSelectionDrag:F.value.zoom.enableSelectionDrag,focusOnDrag:F.value.zoom.focusOnDrag,focusRangeRatio:F.value.zoom.focusRangeRatio,isCursorPointer:I.value,maxWidth:F.value.zoom.maxWidth,minimapLeftInsetRatio:q.value.absoluteWidth>0&&F.value.zoom.autoFit?q.value.left/q.value.absoluteWidth:null,minimapRightInsetRatio:q.value.absoluteWidth>0&&F.value.zoom.autoFit?(q.value.absoluteWidth-q.value.right)/q.value.absoluteWidth:null,"onUpdate:start":wr,"onUpdate:end":Tr,onReset:t[0]||=()=>Sr({force:!0,publish:!0})},{"reset-action":S(({reset:t})=>[y(e.$slots,`reset-action`,at(nt({reset:t})),void 0,!0)]),_:3},8,[`background`,`borderColor`,`fontSize`,`useResetSlot`,`timeLabels`,`textColor`,`inputColor`,`selectColor`,`max`,`valueStart`,`valueEnd`,`refreshStartPoint`,`refreshEndPoint`,`enableRangeHandles`,`enableSelectionDrag`,`focusOnDrag`,`focusRangeRatio`,`isCursorPointer`,`maxWidth`,`minimapLeftInsetRatio`,`minimapRightInsetRatio`])):f(``,!0)],4),m(`div`,{id:`legend-bottom-${w.value}`},null,8,$t),Dn.value&&(F.value.legend.show||e.$slots.legend)?(g(),d(Ze,{key:6,to:F.value.legend.position===`top`?`#legend-top-${w.value}`:`#legend-bottom-${w.value}`},[m(`div`,{ref_key:`chartLegend`,ref:Bn},[y(e.$slots,`legend`,{legend:xi.value},()=>[F.value.legend.show?(g(),d(Ye,{key:`legend_${Sn.value}`,legendSet:xi.value,config:Ci.value,onClickMarker:t[1]||=({legend:e})=>Ti(e.uid)},{item:S(({legend:e,index:t})=>[m(`div`,{onClick:t=>Ti(e.uid),style:ot(`opacity:${T.value.includes(e.uid)?.5:1}`)},b(e.display),13,en)]),legendToggle:S(()=>[xi.value.length>2&&F.value.legend.selectAllToggle.show&&!x(nr)?(g(),d(We,{key:0,backgroundColor:F.value.legend.selectAllToggle.backgroundColor,color:F.value.legend.selectAllToggle.color,fontSize:F.value.legend.fontSize,checked:T.value.length>0,onToggle:wi},null,8,[`backgroundColor`,`color`,`fontSize`,`checked`])):f(``,!0)]),_:1},8,[`legendSet`,`config`])):f(``,!0)],!0)],512)],8,[`to`])):f(``,!0),e.$slots.source?(g(),p(`div`,{key:7,ref_key:`source`,ref:Vn,dir:`auto`},[y(e.$slots,`source`,{},void 0,!0)],512)):f(``,!0),Jn.value&&M.value.userOptions.buttons.table?(g(),d(lt(Ki.value.component),rt({key:8},Ki.value.props,{ref_key:`tableUnit`,ref:On,onClose:qi}),Qe({content:S(()=>[(g(),d(x(on),{key:`table_${xn.value}`,colNames:ki.value.colNames,head:ki.value.head,body:ki.value.body,config:ki.value.config,title:M.value.table.useDialog?``:Ki.value.title,withCloseButton:!M.value.table.useDialog,isCursorPointer:I.value,onClose:qi},{th:S(({th:e})=>[$e(b(e.name??e),1)]),td:S(({td:e})=>[e.value===null?(g(),p(`span`,tn,`-`)):(g(),p(`b`,nn,b(isNaN(e.value)?``:P.value.dataLabels.prefix)+b(!isNaN(e.value)&&e.value!==null?Number(e.value.toFixed(M.value.table.td.roundingValue)).toLocaleString():e)+b(isNaN(e.value)?``:P.value.dataLabels.suffix),1)),m(`span`,null,b(e.percentage&&!isNaN(e.percentage)?`(${Number(e.percentage.toFixed(M.value.table.td.roundingPercentage)).toLocaleString()}%)`:``),1)]),_:1},8,[`colNames`,`head`,`body`,`config`,`title`,`withCloseButton`,`isCursorPointer`]))]),_:2},[M.value.table.useDialog?{name:`title`,fn:S(()=>[$e(b(Ki.value.title),1)]),key:`0`}:void 0,M.value.table.useDialog?{name:`actions`,fn:S(()=>[m(`button`,{tabindex:`0`,class:`vue-ui-user-options-button`,onClick:t[2]||=e=>ji(M.value.userOptions.callbacks.csv),style:ot({cursor:I.value?`cursor`:`default`})},[et(x(an),{name:`fileCsv`,stroke:Ki.value.props.color},null,8,[`stroke`])],4)]),key:`1`}:void 0]),1040)):f(``,!0),$n.value.show?(g(),d(x(dn),{key:9,ref_key:`dialog`,ref:Bi,onClose:t[3]||=e=>{D.value=null,gn.value=!1,hn.value=null,E.value=null,gi.value=null},backgroundColor:$n.value.backgroundColor,color:$n.value.color,headerBg:$n.value.header.backgroundColor,headerColor:$n.value.header.color,isFullscreen:Mi.value,fullscreenParent:O.value},{title:S(()=>[$e(b(X.value[Number(D.value.index)]?X.value[Number(D.value.index)].text:``),1)]),content:S(()=>[D.value?(g(),d(x(un),{key:0,config:zi.value,dataset:Ri.value},null,8,[`config`,`dataset`])):f(``,!0)]),_:1},8,[`backgroundColor`,`color`,`headerBg`,`headerColor`,`isFullscreen`,`fullscreenParent`])):f(``,!0),x(nr)?(g(),d(be,{key:10})):f(``,!0)],46,ht))}},[[`__scopeId`,`data-v-801bea8c`]]);export{mt as n,rn as t};