vue-data-ui 3.28.8 → 3.28.10

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 (211) hide show
  1. package/dist/{PackageVersion-Bczw6rsP.js → PackageVersion-DKSNC-YP.js} +1 -1
  2. package/dist/StackChartTable-CZteRybF.js +1 -0
  3. package/dist/UserOptions-B9EyfU9n.js +1 -0
  4. package/dist/{XyAnalysisOptions-U4UJx51x.js → XyAnalysisOptions-CV22ga_a.js} +1 -1
  5. package/dist/components/vue-ui-3d-bar.js +1 -1
  6. package/dist/components/vue-ui-accordion.js +1 -1
  7. package/dist/components/vue-ui-age-pyramid.js +1 -1
  8. package/dist/components/vue-ui-annotator.js +1 -1
  9. package/dist/components/vue-ui-bullet.js +1 -1
  10. package/dist/components/vue-ui-bump.js +1 -1
  11. package/dist/components/vue-ui-candlestick.js +1 -1
  12. package/dist/components/vue-ui-carousel-table.js +1 -1
  13. package/dist/components/vue-ui-chestnut.js +1 -1
  14. package/dist/components/vue-ui-chord.js +1 -1
  15. package/dist/components/vue-ui-circle-pack.js +1 -1
  16. package/dist/components/vue-ui-cursor.js +1 -1
  17. package/dist/components/vue-ui-dag.js +1 -1
  18. package/dist/components/vue-ui-dashboard.js +1 -1
  19. package/dist/components/vue-ui-digits.js +1 -1
  20. package/dist/components/vue-ui-donut-evolution.js +1 -1
  21. package/dist/components/vue-ui-donut.js +1 -1
  22. package/dist/components/vue-ui-dumbbell.js +1 -1
  23. package/dist/components/vue-ui-flow.js +1 -1
  24. package/dist/components/vue-ui-funnel.js +1 -1
  25. package/dist/components/vue-ui-galaxy.js +1 -1
  26. package/dist/components/vue-ui-gauge.js +1 -1
  27. package/dist/components/vue-ui-geo.js +1 -1
  28. package/dist/components/vue-ui-gizmo.js +1 -1
  29. package/dist/components/vue-ui-graph.js +1 -1
  30. package/dist/components/vue-ui-heatmap.js +1 -1
  31. package/dist/components/vue-ui-hill.js +1 -1
  32. package/dist/components/vue-ui-history-plot.js +1 -1
  33. package/dist/components/vue-ui-horizontal-bar.js +1 -1
  34. package/dist/components/vue-ui-kpi.js +1 -1
  35. package/dist/components/vue-ui-label.js +1 -1
  36. package/dist/components/vue-ui-mini-loader.js +1 -1
  37. package/dist/components/vue-ui-molecule.js +1 -1
  38. package/dist/components/vue-ui-mood-radar.js +1 -1
  39. package/dist/components/vue-ui-nested-donuts.js +1 -1
  40. package/dist/components/vue-ui-onion.js +1 -1
  41. package/dist/components/vue-ui-parallel-coordinate-plot.js +1 -1
  42. package/dist/components/vue-ui-quadrant.js +1 -1
  43. package/dist/components/vue-ui-quick-chart.js +1 -1
  44. package/dist/components/vue-ui-radar.js +1 -1
  45. package/dist/components/vue-ui-rating.js +1 -1
  46. package/dist/components/vue-ui-relation-circle.js +1 -1
  47. package/dist/components/vue-ui-ridgeline.js +1 -1
  48. package/dist/components/vue-ui-rings.js +1 -1
  49. package/dist/components/vue-ui-scatter.js +1 -1
  50. package/dist/components/vue-ui-skeleton.js +1 -1
  51. package/dist/components/vue-ui-smiley.js +1 -1
  52. package/dist/components/vue-ui-spark-trend.js +1 -1
  53. package/dist/components/vue-ui-sparkbar.js +1 -1
  54. package/dist/components/vue-ui-sparkgauge.js +1 -1
  55. package/dist/components/vue-ui-sparkhistogram.js +1 -1
  56. package/dist/components/vue-ui-sparkline.js +1 -1
  57. package/dist/components/vue-ui-sparkstackbar.js +1 -1
  58. package/dist/components/vue-ui-stackbar.js +1 -1
  59. package/dist/components/vue-ui-stackline.js +1 -1
  60. package/dist/components/vue-ui-strip-plot.js +1 -1
  61. package/dist/components/vue-ui-table-heatmap.js +1 -1
  62. package/dist/components/vue-ui-table-sparkline.js +1 -1
  63. package/dist/components/vue-ui-table.js +1 -1
  64. package/dist/components/vue-ui-thermometer.js +1 -1
  65. package/dist/components/vue-ui-timer.js +1 -1
  66. package/dist/components/vue-ui-tiremarks.js +1 -1
  67. package/dist/components/vue-ui-treemap.js +1 -1
  68. package/dist/components/vue-ui-vertical-bar.js +1 -1
  69. package/dist/components/vue-ui-waffle.js +1 -1
  70. package/dist/components/vue-ui-wheel.js +1 -1
  71. package/dist/components/vue-ui-word-cloud.js +1 -1
  72. package/dist/components/vue-ui-world.js +1 -1
  73. package/dist/components/vue-ui-xy-canvas.js +1 -1
  74. package/dist/components/vue-ui-xy.js +1 -1
  75. package/dist/package-CXaebsLV.js +1 -0
  76. package/dist/{render-common-DY4sNXDz.js → render-common-Cy1X2PzP.js} +1 -1
  77. package/dist/ssr/vue-ui-donut.js +1 -1
  78. package/dist/ssr/vue-ui-xy.js +1 -1
  79. package/dist/ssr.js +1 -1
  80. package/dist/style.css +1 -1
  81. package/dist/{useConfig-By3Vb5kz.js → useConfig-C3FbHv4N.js} +1 -1
  82. package/dist/{useObjectBindings-0vvvimYP.js → useObjectBindings-C_70Czuj.js} +1 -1
  83. package/dist/{userOptionsSlots-DYuo-E5m.js → userOptionsSlots-CWtXN5Q6.js} +1 -1
  84. package/dist/utils.js +1 -1
  85. package/dist/vue-data-ui-O-w339Ac.js +1 -0
  86. package/dist/vue-data-ui.js +1 -1
  87. package/dist/vue-ui-3d-bar-CcFFARyq.js +19 -0
  88. package/dist/{vue-ui-accordion-DFxSW8ET.js → vue-ui-accordion-E8TJfFeK.js} +1 -1
  89. package/dist/vue-ui-age-pyramid-Di6fKV6f.js +1 -0
  90. package/dist/vue-ui-annotator-sBGtsgcb.js +331 -0
  91. package/dist/vue-ui-bullet-BZLa1xj7.js +34 -0
  92. package/dist/vue-ui-bump-BSdpAH0l.js +8 -0
  93. package/dist/vue-ui-candlestick-BKZASgq9.js +22 -0
  94. package/dist/vue-ui-carousel-table-B20E2K8A.js +1 -0
  95. package/dist/vue-ui-chestnut-DavvzmiQ.js +1 -0
  96. package/dist/vue-ui-chord-D2Hn54i7.js +21 -0
  97. package/dist/vue-ui-circle-pack-BKaS-zWo.js +13 -0
  98. package/dist/{vue-ui-cursor-DRQc_V2R.js → vue-ui-cursor-BUOHKNmb.js} +1 -1
  99. package/dist/vue-ui-dag-SLYPxbGo.js +9 -0
  100. package/dist/vue-ui-dashboard-Bgt7VLv0.js +1 -0
  101. package/dist/{vue-ui-digits-CfdB0vaP.js → vue-ui-digits-DbxT72mM.js} +1 -1
  102. package/dist/{vue-ui-donut-Dy4j7B9b.js → vue-ui-donut-8ZWyXEVs.js} +1 -1
  103. package/dist/vue-ui-donut-DBcB8Ym1.js +47 -0
  104. package/dist/vue-ui-donut-evolution-D3lo74Ce.js +2 -0
  105. package/dist/vue-ui-dumbbell-CdarkL8Z.js +9 -0
  106. package/dist/vue-ui-flow-B0dYxGWT.js +3 -0
  107. package/dist/vue-ui-funnel-C0Cl9jMd.js +1 -0
  108. package/dist/vue-ui-galaxy-C_UWOQn4.js +1 -0
  109. package/dist/vue-ui-gauge-B94ToHlW.js +1 -0
  110. package/dist/vue-ui-geo-V-JmJgKS.js +1 -0
  111. package/dist/{vue-ui-gizmo-D0QjzIGt.js → vue-ui-gizmo-BvVDEnNu.js} +1 -1
  112. package/dist/{vue-ui-graph-DScVnTzu.js → vue-ui-graph-9YSKwYhC.js} +1 -1
  113. package/dist/vue-ui-heatmap-DWtbocz5.js +1 -0
  114. package/dist/vue-ui-hill-BH_lYm5G.js +1 -0
  115. package/dist/vue-ui-history-plot-DkWvta0h.js +2 -0
  116. package/dist/vue-ui-horizontal-bar-DbJ1DFjG.js +4 -0
  117. package/dist/{vue-ui-kpi-CF7pAl08.js → vue-ui-kpi-BxW6DctE.js} +1 -1
  118. package/dist/{vue-ui-label-W0oz08pp.js → vue-ui-label-rxuzmeyD.js} +1 -1
  119. package/dist/{vue-ui-mini-loader-OLYDdN3T.js → vue-ui-mini-loader-DpAYrTYb.js} +1 -1
  120. package/dist/vue-ui-molecule-BrG8K2Tm.js +1 -0
  121. package/dist/vue-ui-mood-radar-DEpFpfiW.js +1 -0
  122. package/dist/vue-ui-nested-donuts-CZetOzaq.js +19 -0
  123. package/dist/vue-ui-onion-DvyAxUSj.js +5 -0
  124. package/dist/vue-ui-parallel-coordinate-plot-Bdakcv3w.js +9 -0
  125. package/dist/vue-ui-quadrant-CWZeQjHE.js +2 -0
  126. package/dist/vue-ui-quick-chart-BULxPrPs.js +16 -0
  127. package/dist/vue-ui-radar-CJ_5G0QP.js +1 -0
  128. package/dist/{vue-ui-rating-B9HeTCLa.js → vue-ui-rating-QcJoab0i.js} +1 -1
  129. package/dist/vue-ui-relation-circle-Vetly6f0.js +1 -0
  130. package/dist/vue-ui-ridgeline-5a87TiQf.js +2 -0
  131. package/dist/vue-ui-rings-CKuFf5vA.js +1 -0
  132. package/dist/vue-ui-scatter-C2hNg3ED.js +9 -0
  133. package/dist/{vue-ui-skeleton-an0peDis.js → vue-ui-skeleton-SlYTmirP.js} +1 -1
  134. package/dist/{vue-ui-smiley-Cht1imV-.js → vue-ui-smiley-DZVFOGfv.js} +1 -1
  135. package/dist/{vue-ui-spark-trend-DCP7blHB.js → vue-ui-spark-trend-D155vscB.js} +1 -1
  136. package/dist/{vue-ui-sparkbar-DT3sDgda.js → vue-ui-sparkbar-DFShNanl.js} +1 -1
  137. package/dist/{vue-ui-sparkgauge-AQt2L5dI.js → vue-ui-sparkgauge-CFj0wLj5.js} +1 -1
  138. package/dist/{vue-ui-sparkhistogram-a_jc2Dv2.js → vue-ui-sparkhistogram-DwDcqqEj.js} +1 -1
  139. package/dist/{vue-ui-sparkline-D2-KcHAU.js → vue-ui-sparkline-kxl5wQGY.js} +1 -1
  140. package/dist/{vue-ui-sparkstackbar-CBI4S5cu.js → vue-ui-sparkstackbar-CHjaAWVJ.js} +1 -1
  141. package/dist/vue-ui-stackbar-BrtUg-Mb.js +29 -0
  142. package/dist/vue-ui-stackline-CU2UkEJU.js +39 -0
  143. package/dist/vue-ui-strip-plot-BmEpoIoU.js +2 -0
  144. package/dist/vue-ui-table-Ddg209i0.js +14 -0
  145. package/dist/vue-ui-table-heatmap-B8AdX6Nq.js +1 -0
  146. package/dist/{vue-ui-table-sparkline-By319cB8.js → vue-ui-table-sparkline-B62l_ODH.js} +1 -1
  147. package/dist/vue-ui-thermometer-CvxyfTWE.js +1 -0
  148. package/dist/{vue-ui-timer-C6Pevf4N.js → vue-ui-timer-BkNtid9A.js} +2 -2
  149. package/dist/vue-ui-tiremarks-BE0nbuHp.js +1 -0
  150. package/dist/vue-ui-treemap-B9wAoh5g.js +1 -0
  151. package/dist/vue-ui-waffle-DqeBiuY3.js +1 -0
  152. package/dist/vue-ui-wheel---NZaS40.js +1 -0
  153. package/dist/vue-ui-word-cloud-DRFGFVmf.js +4 -0
  154. package/dist/vue-ui-world-D5gKzypf.js +19 -0
  155. package/dist/{vue-ui-xy-Df5gIADT.js → vue-ui-xy-Caj8jz6D.js} +1 -1
  156. package/dist/vue-ui-xy-CcVIXfL_.js +27 -0
  157. package/dist/vue-ui-xy-canvas-BceSG3AO.js +9 -0
  158. package/package.json +1 -1
  159. package/dist/UserOptions-DW84OKKr.js +0 -1
  160. package/dist/package-CNWVs68D.js +0 -1
  161. package/dist/vue-data-ui-BWqplouA.js +0 -1
  162. package/dist/vue-ui-3d-bar-DmRrbXjK.js +0 -19
  163. package/dist/vue-ui-age-pyramid-CJJIp5gY.js +0 -1
  164. package/dist/vue-ui-annotator-BnR2XnsL.js +0 -331
  165. package/dist/vue-ui-bullet-Br7H7FSM.js +0 -34
  166. package/dist/vue-ui-bump-DCDHNvWE.js +0 -8
  167. package/dist/vue-ui-candlestick-C_swW8gM.js +0 -22
  168. package/dist/vue-ui-carousel-table-BP_yVdDm.js +0 -1
  169. package/dist/vue-ui-chestnut-CIGNqBsT.js +0 -1
  170. package/dist/vue-ui-chord-DZRFBkRJ.js +0 -21
  171. package/dist/vue-ui-circle-pack-CtdPeMsY.js +0 -13
  172. package/dist/vue-ui-dag-Cj0CcntI.js +0 -9
  173. package/dist/vue-ui-dashboard-HyzHqAtX.js +0 -1
  174. package/dist/vue-ui-donut-Cv-bYyBN.js +0 -47
  175. package/dist/vue-ui-donut-evolution-DL112anx.js +0 -2
  176. package/dist/vue-ui-dumbbell-owG24VsQ.js +0 -9
  177. package/dist/vue-ui-flow-BMNIydqI.js +0 -3
  178. package/dist/vue-ui-funnel-BsVS3vuI.js +0 -1
  179. package/dist/vue-ui-galaxy-B8HgdBjc.js +0 -1
  180. package/dist/vue-ui-gauge-B1A_NFY6.js +0 -1
  181. package/dist/vue-ui-geo-_TG4jaV9.js +0 -1
  182. package/dist/vue-ui-heatmap-BbQseEbM.js +0 -1
  183. package/dist/vue-ui-hill-D3V84h_t.js +0 -1
  184. package/dist/vue-ui-history-plot-Bx4WYG6U.js +0 -2
  185. package/dist/vue-ui-horizontal-bar-Do0HJy4f.js +0 -4
  186. package/dist/vue-ui-molecule-bAMGCA2Y.js +0 -1
  187. package/dist/vue-ui-mood-radar-CFpgxjuR.js +0 -1
  188. package/dist/vue-ui-nested-donuts-CWY26iKX.js +0 -19
  189. package/dist/vue-ui-onion-DsBUqL_c.js +0 -5
  190. package/dist/vue-ui-parallel-coordinate-plot-BF3gO85b.js +0 -9
  191. package/dist/vue-ui-quadrant-BkNG2LGm.js +0 -2
  192. package/dist/vue-ui-quick-chart-CYxvgVpD.js +0 -17
  193. package/dist/vue-ui-radar-0H8CiLmc.js +0 -1
  194. package/dist/vue-ui-relation-circle-B0BM4xf8.js +0 -1
  195. package/dist/vue-ui-ridgeline-D-fDuE3y.js +0 -2
  196. package/dist/vue-ui-rings-UtlBiaZZ.js +0 -1
  197. package/dist/vue-ui-scatter-CduaARRt.js +0 -9
  198. package/dist/vue-ui-stackbar-DS_31-a3.js +0 -29
  199. package/dist/vue-ui-stackline-CuxohB0U.js +0 -39
  200. package/dist/vue-ui-strip-plot-bYGhsPA5.js +0 -2
  201. package/dist/vue-ui-table-heatmap-D6gpmHg8.js +0 -1
  202. package/dist/vue-ui-table-lzolsJ_n.js +0 -14
  203. package/dist/vue-ui-thermometer-B3Uv3aWc.js +0 -1
  204. package/dist/vue-ui-tiremarks-DeNdCFVD.js +0 -1
  205. package/dist/vue-ui-treemap-Ck9_llHA.js +0 -1
  206. package/dist/vue-ui-waffle-BW2SacnV.js +0 -1
  207. package/dist/vue-ui-wheel-BXDhx5bf.js +0 -1
  208. package/dist/vue-ui-word-cloud-DKPtoruY.js +0 -4
  209. package/dist/vue-ui-world-D9vpDbN7.js +0 -19
  210. package/dist/vue-ui-xy-CMckdUft.js +0 -27
  211. package/dist/vue-ui-xy-canvas-CBrKi3nN.js +0 -9
@@ -1 +0,0 @@
1
- import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{n as t,r as n,t as r}from"./annotationSlots-OLiW25XN.js";import{t as i}from"./useConfig-By3Vb5kz.js";import{$ as a,D as o,Ht as s,X as c,a as l,i as u,nn as d,nt as f,r as p,x as m}from"./lib-rPeBMZrn.js";import{n as h,t as g}from"./useHints-C-TwxM0Y.js";import{t as ee}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{t as te}from"./useNestedProp-DnGoh-XS.js";import{t as ne}from"./useThemeCheck-BKNRbGeC.js";import{t as re}from"./chartImage-DPGnEuYM.js";import{n as ie}from"./Title-BliHuXfT.js";import{t as ae}from"./useChartExport-BZts4KFb.js";import{n as oe,t as se}from"./userOptionsSlots-DYuo-E5m.js";import{t as ce}from"./usePrinter-DVf3YcG5.js";import{t as le}from"./useTransitions-ChGGrtrv.js";import{t as ue}from"./useUserOptionState-CXlFnwPv.js";import{t as de}from"./vue_ui_hill-DQi4pQCG.js";import{Fragment as fe,computed as _,createBlock as pe,createCommentVNode as v,createElementBlock as y,createElementVNode as b,createSlots as me,createVNode as he,defineAsyncComponent as ge,guardReactiveProps as _e,mergeProps as ve,nextTick as ye,normalizeClass as be,normalizeProps as xe,normalizeStyle as x,onBeforeUnmount as Se,onMounted as Ce,openBlock as S,ref as C,renderList as w,renderSlot as T,shallowRef as we,toDisplayString as E,unref as D,useTemplateRef as Te,watch as Ee,withCtx as De,withKeys as Oe,withModifiers as O}from"vue";var ke=/* @__PURE__ */ e({default:()=>Ct}),Ae=[`id`,`data-editing`],je={key:0,ref:`chartTitle`,style:`width:100%;background:transparent;padding-bottom:24px`},Me={key:3,class:`vue-ui-hill__toolbar`,"data-dom-to-png-ignore":``},Ne=[`viewBox`],Pe=[`width`,`height`],Fe=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`,`stroke-dasharray`],Ie=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`,`stroke-dasharray`],Le=[`d`,`stroke`,`stroke-width`,`stroke-dasharray`],Re={key:0,"pointer-events":`none`},ze=[`d`,`stroke`,`stroke-width`,`stroke-dasharray`],Be=[`cx`,`cy`,`r`,`fill`,`stroke`,`stroke-width`],Ve=[`transform`,`font-size`,`fill`,`stroke`],He=[`transform`,`data-datapoint-index`,`data-datapoint-id`,`tabindex`,`aria-valuenow`,`aria-valuetext`,`aria-label`,`onFocus`,`onBlur`,`onKeydown`,`onPointerenter`,`onPointerleave`,`onClick`],Ue=[`r`,`onPointerdown`],We=[`r`,`fill`,`stroke`,`stroke-width`],Ge=[`stroke`,`stroke-width`],Ke=[`d`],qe=[`x`,`y`,`text-anchor`,`fill`,`font-size`,`font-weight`,`stroke`,`stroke-width`],Je=[`transform`,`tabindex`,`aria-label`,`aria-expanded`,`onClick`,`onFocus`,`onKeydown`],Ye={key:0,class:`vue-ui-hill__stack-overflow-collapse-ghosts`,"pointer-events":`none`,"aria-hidden":`true`},Xe=[`cx`,`cy`,`r`,`fill`,`stroke`,`stroke-width`],Ze=[`from`,`dur`],Qe=[`from`,`dur`],$e=[`from`,`to`,`dur`],et=[`dur`],tt=[`r`],nt=[`x`,`y`,`width`,`height`,`fill`,`stroke`,`stroke-width`],rt=[`stroke`,`stroke-width`],it=[`d`],at=[`y`,`fill`,`font-size`,`font-weight`,`stroke`],ot=[`x`,`y`,`fill`,`font-size`,`font-weight`,`letter-spacing`],st=[`x`,`y`,`fill`,`font-size`,`font-weight`,`letter-spacing`],ct=[`x`,`y`,`rx`,`width`,`height`,`fill`],lt=[`id`],ut=[`x`,`y`,`width`,`height`,`rx`,`ry`],dt=[`clip-path`],ft=[`width`,`x`,`y`,`fill`,`height`,`onPointerenter`,`onPointerleave`],pt=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`],mt=[`x`,`y`,`width`,`height`,`rx`,`ry`,`stroke`,`stroke-width`],ht=[`x`,`y`,`fill`,`font-size`],gt=[`aria-label`,`onKeydown`],_t={key:0,class:`vue-ui-hill__stack-overflow-menu-title`},vt=[`disabled`,`aria-label`,`onClick`],yt={class:`vue-ui-hill__stack-overflow-menu-label`},bt={class:`vue-ui-hill__stack-overflow-menu-value`},xt={key:6,class:`vue-data-ui-watermark`},St={key:7,class:`vue-ui-hill__loading`,"data-dom-to-png-ignore":``},Ct=/*#__PURE__*/ ee({__name:`vue-ui-hill`,props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:[`edit`,`save`,`cancel`,`copyAlt`,`change`,`dragStart`,`dragEnd`,`datapointEnter`,`datapointLeave`,`selectDatapoint`],setup(e,{expose:ee,emit:ke}){let Ct=ge(()=>import(`./HillActions-BMH9pSmQ.js`)),wt=ge(()=>import(`./UserOptions-DW84OKKr.js`).then(e=>e.n)),Tt=ge(()=>import(`./PackageVersion-Bczw6rsP.js`).then(e=>e.t)),Et=ge(()=>import(`./PenAndPaper-DoNTA-SV.js`).then(e=>e.t)),Dt=ge(()=>import(`./BaseIcon-CoY0vuL3.js`).then(e=>e.n)),{vue_ui_hill:Ot}=i(),{isThemeValid:kt,warnInvalidTheme:At}=ne(),jt=e,Mt=C(c()),Nt=we(null),Pt=Te(`hillChartRef`),k=Te(`svgRef`),Ft=Te(`overflowMenuRef`),It=Te(`userOptionsRef`),Lt=C(0),Rt=ke;function zt(){let e=te({userConfig:jt.config,defaultConfig:Ot}),t={},n=e.theme;if(!n)t=e;else if(!kt.value(e))At(e),t=e;else{let r=te({userConfig:de[n]||jt.config,defaultConfig:e});t={...te({userConfig:jt.config,defaultConfig:r}),customPalette:e.customPalette.length?e.customPalette:d[n]||nn}}return t}let A=C(zt()),j=_(()=>A.value.style.chart.layout.plots),M=_(()=>A.value.style.chart);h({config:()=>A.value,dataset:()=>jt.dataset,component:`VueUiHill`,rules:[g.emptyArray,g.noHint]});let{transitionEnabled:N}=le({config:()=>A.value.transitions,dataset:()=>jt.dataset}),{userOptionsVisible:Bt,setUserOptionsVisibility:Vt,keepUserOptionState:Ht}=ue({config:A.value});function Ut(){Vt(!0)}function Wt(){Vt(!1),tr.value=null,Z.value=null,er.value=null}let{isPrinting:Gt,isImaging:Kt,generatePdf:qt,generateImage:Jt}=ce({elementId:`hill_${Mt.value}`,fileName:M.value.title.text||`vue-ui-hill`,options:A.value.userOptions.print}),Yt=_(()=>A.value.userOptions.useCursorPointer),Xt=C(0),Zt=C(!1);function Qt(e){Zt.value=e,Xt.value+=1}let $t=C(!1);function en(){$t.value=!$t.value}let tn=_(()=>A.value.userOptions.position===`left`?`right`:`left`);Ee(()=>jt.config,()=>{Nt.value=null,A.value=zt(),Xt.value+=1,P.value!==A.value.editing&&(P.value=A.value.editing&&!A.value.readonly)},{deep:!0});let nn=_(()=>{let e=A.value.customPalette;return Array.isArray(e)&&e.length?e:s});function rn(e){let t=Number(e);return Number.isFinite(t)?Math.min(1,Math.max(0,t)):0}function an(e){if(e<=0)return`todo`;if(e>=1)return`done`;let t=.5,n=Math.min(t,Math.max(0,Number(A.value.interaction.peakTolerance)||0)),r=t-n,i=t+n;return e>=r&&e<=i?`top`:e<t?`left`:`right`}function on(e,t){let n=e&&typeof e==`object`?e:{},r=`Item ${t+1}`,i=String(n.name??n.label??r),a=rn(n.position??n.value??0);return{...n,id:String(n.id??`${i}-${t}`),name:i,label:String(n.label??i),position:a,color:n.color||nn.value[t%nn.value.length],muted:!!n.muted,disabled:!!n.disabled,status:an(e.position),labelSide:[`left`,`right`,`auto`].includes(n.labelSide)?n.labelSide:`auto`,__index:t}}let sn=_(()=>Array.isArray(jt.dataset)?jt.dataset.map(on):[]);function cn(e){return e.map(e=>({...e}))}function ln(e){let{__index:t,...n}=e;return Object.prototype.hasOwnProperty.call(n,`value`)&&(n.value=n.position),n}function un(e=F.value){return e.map(ln)}let dn=_(()=>A.value.editing&&!A.value.readonly),P=C(dn.value),F=C(cn(sn.value)),I=C(null);Ee(sn,e=>{P.value||(Nt.value=null,F.value=cn(e))},{deep:!0});let L=_(()=>!A.value.readonly);Ee(L,e=>{e||(I.value=null,Nt.value=null,P.value=!1,F.value=cn(sn.value))});function R(e,t){Rt(e,t);let n=A.value.events?.[e];typeof n==`function`&&n(t)}let z=_(()=>M.value),fn=_(()=>z.value.layout),B=_(()=>fn.value.hill),V=_(()=>fn.value.plots),H=_(()=>fn.value.labels.item),U=_(()=>fn.value.labels.phases),W=_(()=>z.value.toolbar),G=_(()=>fn.value.stackbar),K=_(()=>{let e=V.value.stacking?.overflow||{},t=Math.max(0,Number(V.value.radius)||0);return{show:e.show!==!1,marker:{radius:Math.max(4,Number(e.marker?.radius)||t),fill:e.marker.fill,stroke:e.marker?.stroke||V.value.stroke,strokeWidth:e.marker.strokeWidth,color:e.marker.labelColor,fontSize:e.marker.fontSize,bold:e.marker?.bold!==!1,offsetY:e.marker.labelOffsetY},hysteresis:t*1.5,transitionDuration:N.value?e.transitionDuration:0,menu:{width:Math.max(160,Number(e.menu?.width)||220),maxHeight:Math.max(96,Number(e.menu?.maxHeight)||220),backgroundColor:e.menu?.backgroundColor||z.value.backgroundColor,color:e.menu?.color||z.value.color,borderColor:e.menu?.borderColor||V.value.stroke,borderRadius:Math.max(0,Number(e.menu?.borderRadius)||6)}}});function pn(e,t,n=1){let r=Number(e);return Number.isFinite(r)?Math.min(n,Math.max(0,r)):t}let q=_(()=>{let e=B.value.geometry||{},t=Math.max(0,Number(z.value.width)||0),n=Math.max(0,Number(z.value.height)||0),r=pn(e.horizontalPaddingRatio,.02,.49),i=pn(e.topPaddingRatio,.12,.49),a=pn(e.bottomPaddingRatio,.2,.49),o=pn(e.curvature,.65),s=t*r,c=t/2,l=t*(1-r),u=n*i,d=n*(1-a),f=c-s,p=l-c,m=s+f*o,h=c+p*(1-o);return{startX:s,centerX:c,endX:l,baseY:d,peakY:u,width:f+p,left:[{x:s,y:d},{x:m,y:d},{x:m,y:u},{x:c,y:u}],right:[{x:c,y:u},{x:h,y:u},{x:h,y:d},{x:l,y:d}]}}),mn=_(()=>{let{left:e,right:t}=q.value;return[`M${e[0].x} ${e[0].y}`,`C${e[1].x} ${e[1].y} ${e[2].x} ${e[2].y} ${e[3].x} ${e[3].y}`,`C${t[1].x} ${t[1].y} ${t[2].x} ${t[2].y} ${t[3].x} ${t[3].y}`].join(` `)});function hn(e,t,n,r,i){let a=1-i;return a**3*e+3*a**2*i*t+3*a*i**2*n+i**3*r}function gn(e,t,n,r,i){let a=1-i;return 3*a**2*(t-e)+6*a*i*(n-t)+3*i**2*(r-n)}function _n(e){let t=rn(e),{startX:n,centerX:r,endX:i,left:a,right:o}=q.value,s=n+(t-0)/1*(i-n),c=s<=r?a:o,l=0,u=1;for(let e=0;e<28;e+=1){let e=(l+u)/2;hn(c[0].x,c[1].x,c[2].x,c[3].x,e)<s?l=e:u=e}let d=(l+u)/2,f=hn(c[0].y,c[1].y,c[2].y,c[3].y,d),p=gn(c[0].x,c[1].x,c[2].x,c[3].x,d),m=gn(c[0].y,c[1].y,c[2].y,c[3].y,d),h=Math.hypot(p,m)||1;return{x:s,y:f,normalX:m/h,normalY:-p/h}}function vn(e){let t=Number(V.value.stacking.overlapThresholdRatio);return e*(2-(Number.isFinite(t)?Math.min(2,Math.max(0,t)):.5))}function yn(e,t){let n=/* @__PURE__ */ new Map,r=V.value.stacking;if(e.forEach(e=>{n.set(e.id,{position:e.position,index:0,size:1,stackId:`stack:${e.id}`})}),!r.show||e.length<2||t<=0)return n;let i=vn(t),a=e.map((e,t)=>({datapoint:e,index:t,point:_n(e.position)})).sort((e,t)=>e.point.x-t.point.x||e.datapoint.position-t.datapoint.position||e.index-t.index),o=0;for(;o<a.length;){let e=[a[o]],t=o+1;for(;t<a.length;){let n=e[e.length-1],r=a[t];if(Math.hypot(r.point.x-n.point.x,r.point.y-n.point.y)>=i)break;e.push(r),t+=1}if(e.length>1){let t=e[0].datapoint.position,r=`stack:${e.map(({datapoint:e})=>e.id).sort().join(`|`)}`;e.forEach(({datapoint:i},a)=>{n.set(i.id,{position:t,index:a,size:e.length,stackId:r})})}o=t}return n}function bn(e){let t=e+Math.max(0,Number(V.value.strokeWidth)||0)/2,n=V.value.stacking.gap??e/2;return t*2+n}let xn=C(null),J=C(null),Y=C(null),Sn=C(null),Cn=C(null),wn=/* @__PURE__ */ new Set,Tn=null,En=null,X=null;function Dn(e){let t=Math.max(0,Number(V.value.strokeWidth)||0),n=V.value.shadow.show?Math.max(0,Number(V.value.shadow.blur)||0)+Math.max(0,-(Number(V.value.shadow.offsetY)||0)):0;return e+t/2+n}function On(e,t,n){if(t<=1)return e-Dn(n);let r=bn(n);return e-(t-1)*r-Dn(n)}function kn(e,t,n,r){if(n<=1)return wn.delete(e),!1;let i=On(t,n,r),a=wn.has(e),o=K.value.hysteresis,s=a?i<o:i<0;return s?wn.add(e):wn.delete(e),s}let An=_(()=>{let e=Math.max(0,Number(V.value.radius)||0),t=bn(e),n=yn(F.value,e),r=/* @__PURE__ */ new Map,i=/* @__PURE__ */ new Map,a=[],o=/* @__PURE__ */ new Set,s=I.value?.id??null;K.value.show||wn.clear(),F.value.forEach(e=>{let t=n.get(e.id)||{position:e.position,index:0,size:1,stackId:`stack:${e.id}`};r.has(t.stackId)||r.set(t.stackId,[]),r.get(t.stackId).push({datapoint:e,stack:t})});let c=new Set(r.keys());return wn.forEach(e=>{c.has(e)||wn.delete(e)}),r.forEach((n,r)=>{let c=[...n].sort((e,t)=>e.stack.index-t.stack.index||e.datapoint.__index-t.datapoint.__index),l=c.reduce((e,t)=>e+(Number(t.datapoint.position)||0),0)/c.length,u=_n(l);if(!(K.value.show&&kn(r,u.y,c.length,e))){c.forEach(e=>{i.set(e.datapoint.id,{hidden:!1,displayIndex:e.stack.index,stackId:r,stackSize:c.length,promotedFromOverflow:!1,renderPosition:e.stack.position})});return}c.forEach(({datapoint:e})=>{o.add(e.id)});let d=s?c.find(({datapoint:e})=>e.id===s):null,f=c.find(({datapoint:e})=>e.id===xn.value),p=d||f||null,m=p?c.filter(({datapoint:e})=>e.id!==p.datapoint.id):c,h=J.value,g=!(!f||h?.datapointId!==f.datapoint.id||h.moved),ee=m.length?g?l:m.reduce((e,t)=>e+(Number(t.datapoint.position)||0),0)/m.length:l,te=_n(ee);c.forEach(e=>{let t=p?.datapoint.id===e.datapoint.id,n=t&&f?.datapoint.id===e.datapoint.id;i.set(e.datapoint.id,{hidden:!t,displayIndex:+!!t,stackId:r,stackSize:c.length,promotedFromOverflow:n,renderPosition:ee})}),m.length&&a.push({stackId:r,anchorPosition:ee,x:te.x,y:te.y,hiddenCount:m.length,hiddenDatapoints:m.map(({datapoint:e})=>e),memberIds:c.map(({datapoint:e})=>e.id),collapseDatapoints:m.map(({datapoint:e,stack:n})=>{let r=_n(n.position);return{id:e.id,color:e.color,relativeX:r.x-te.x,relativeY:r.y-n.index*t-te.y}})})}),{layoutMap:n,displayMap:i,markers:a,overflowMemberIds:o}});function jn(e){let t=Nn.value.filter(e=>!e.isStackOverflowHidden),n=t.find(t=>t.id===e),r=new Map(t.filter(t=>t.id!==e).map(e=>[e.id,{x:e.x,y:e.y}]));if(!n||!V.value.stacking.show)return r;let i=t.filter(e=>Math.abs(e.x-n.x)<.001).sort((e,t)=>t.y-e.y||e.datasetIndex-t.datasetIndex);if(i.length<2)return r;let a=bn(Math.max(0,Number(V.value.radius)||0)),o=Math.max(...i.map(e=>e.y));return i.filter(t=>t.id!==e).forEach((e,t)=>{r.set(e.id,{x:n.x,y:o-t*a})}),r}function Mn(){return new Map(Nn.value.filter(e=>!e.isStackOverflowHidden).map(e=>[e.id,{x:e.x,y:e.y}]))}let Nn=_(()=>{let e=Math.max(0,Number(V.value.radius)||0),{layoutMap:t,displayMap:n,markers:r}=An.value,i=bn(e),a=I.value,o=a?.stationaryLayout,s=o instanceof Map?o:Nt.value instanceof Map?Nt.value:null,c=null;if(a&&o instanceof Map&&V.value.stacking.show&&e>0){let t=F.value.find(e=>e.id===a.id);if(t){let n=r.find(e=>e.memberIds.includes(t.id));if(n)c={x:n.x,y:n.y-i};else{let n=_n(t.position),r=vn(e),s=F.value.filter(e=>e.id!==a.id&&o.has(e.id)).map(e=>{let t=_n(e.position);return{datapoint:e,distance:Math.hypot(t.x-n.x,t.y-n.y)}}).filter(({distance:e})=>e<r).sort((e,t)=>e.distance-t.distance)[0];if(s){let e=o.get(s.datapoint.id),t=[...o.values()].filter(t=>Math.abs(t.x-e.x)<.001),n=Math.min(e.y,...t.map(e=>e.y));c={x:e.x,y:n-i}}else c=n}}}return F.value.map((e,r)=>{let o=t.get(e.id)||{position:e.position,index:0,size:1,stackId:`stack:${e.id}`},l=n.get(e.id)||{hidden:!1,displayIndex:o.index,stackId:o.stackId,stackSize:o.size,renderPosition:o.position},u=_n(l.renderPosition??o.position),d=e.id!==a?.id&&!l.promotedFromOverflow&&s instanceof Map?s.get(e.id):null,f=e.id===a?.id&&c?c:d||{x:u.x,y:u.y-l.displayIndex*i},p=e.labelSide===`auto`?null:e.labelSide,h=m(H.value.autoSideThreshold,.5,1),g=p||(e.position>h?`left`:`right`),ee=Math.abs(Number(H.value.offsetX)||0)+V.value.radius+H.value.fontSize/2;return{...e,datasetIndex:r,x:f.x,y:f.y,stackId:l.stackId,stackSize:l.stackSize,stackDisplayIndex:l.displayIndex,isStackOverflowHidden:l.hidden,isPromotedFromStackOverflow:l.promotedFromOverflow,labelSide:g,labelX:g===`left`?-ee:ee,textAnchor:g===`left`?`end`:`start`}})});function Pn(e){return F.value.find(t=>t.id===e)}function Fn(e,t){let n=rn(t),r;F.value=F.value.map(t=>t.id===e?(r={...t,position:n},r):t),r&&(br(r.id,r.position),R(`change`,{datapoint:ln(r),dataset:un()}))}function In(e){let t=k.value;if(!t)return null;let n=t.getScreenCTM();if(!n)return null;let r=t.createSVGPoint();r.x=e,r.y=0;let i=r.matrixTransform(n.inverse()),{startX:a,endX:o}=q.value;return rn(0+(i.x-a)/(o-a)*1)}function Ln(){L.value&&(Y.value=null,xn.value=null,J.value=null,Cn.value=null,pr(),Nt.value=null,F.value=cn(sn.value),P.value=!0,R(`edit`,un()))}function Rn(){let e=un();Y.value=null,xn.value=null,J.value=null,Cn.value=null,pr(),I.value=null,P.value=!1,R(`save`,e)}function zn(){Y.value=null,xn.value=null,J.value=null,Cn.value=null,pr(),I.value=null,Nt.value=null,F.value=cn(sn.value),P.value=!1,R(`cancel`,un())}function Bn(e,t){if(!L.value||!P.value||t.disabled)return;Y.value=null;let n=e.currentTarget.closest(`.vue-ui-hill__datapoint`);n&&typeof n.focus==`function`&&(n.focus(),Z.value=t.id),e.preventDefault();let r=jn(t.id),i=J.value?.datapointId===t.id&&!J.value?.moved;if(I.value={id:t.id,pointerId:e.pointerId,stationaryLayout:r,startClientX:e.clientX,hasMoved:!1,deferPositionUpdate:i},k.value?.setPointerCapture(e.pointerId),!i){let n=In(e.clientX);n!==null&&Fn(t.id,n)}let a=Pn(t.id);a&&R(`dragStart`,ln(a))}function Vn(e){if(!I.value||I.value.pointerId!==e.pointerId)return;e.preventDefault();let t=Math.abs(e.clientX-I.value.startClientX);if(I.value.deferPositionUpdate&&!I.value.hasMoved&&t<3)return;I.value.hasMoved||(I.value={...I.value,hasMoved:!0});let n=In(e.clientX);n!==null&&Fn(I.value.id,n)}function Hn(e){let t=I.value;if(!t||t.pointerId!==e.pointerId)return;k.value?.hasPointerCapture(e.pointerId)&&k.value.releasePointerCapture(e.pointerId);let n=e.type===`pointerup`&&!t.hasMoved,r=Pn(t.id);Nt.value=Mn(),I.value=null,r&&(n&&R(`selectDatapoint`,Gn(r)),R(`dragEnd`,ln(r)))}function Un(e,t){if(!L.value||!P.value||t.disabled)return;let n=Math.max(0,Number(A.value.interaction.keyboardStep)||0),r=null;switch(e.key){case`ArrowLeft`:case`ArrowDown`:r=t.position-n;break;case`ArrowRight`:case`ArrowUp`:r=t.position+n;break;case`Home`:r=0;break;case`End`:r=1;break;default:return}e.preventDefault();let i=e.currentTarget;Z.value=t.id,I.value={id:t.id,pointerId:null,stationaryLayout:jn(t.id)},Fn(t.id,r),Nt.value=Mn(),I.value=null,ye(()=>{i?.isConnected&&i.focus({preventScroll:!0})})}function Wn(e){let t=.5,n=Math.max(0,Number(A.value.interaction.peakTolerance)||0);return Math.abs(e-t)<=n?A.value.a11y.translations.topOfHill:e<t?U.value.left.text:U.value.right.text}function Gn(e){return{datapoint:ln(e),index:e.__index}}function Kn(e){Z.value=null,tr.value=e.id,![0,1].includes(e.position)&&Z.value!==e.id&&ir(e),R(`datapointEnter`,Gn(e))}function qn(e){tr.value===e.id&&(tr.value=null),er.value===e.id&&Z.value!==e.id&&I.value?.id!==e.id&&(er.value=null),R(`datapointLeave`,Gn(e))}function Jn(e){P.value&&L.value||R(`selectDatapoint`,Gn(e))}let Yn=_(()=>{let e=z.value;return{width:`100%`,maxWidth:`100%`,color:e.color,backgroundColor:e.backgroundColor,fontFamily:A.value.style.fontFamily,"--vue-ui-hill-button-hover-border":W.value.buttons.hoverBorderColor,"--vue-ui-hill-button-active-offset":`${W.value.buttons.activeTranslateY}px`}}),Xn=_(()=>({color:W.value.status.color,fontSize:`${W.value.status.fontSize}px`,fontWeight:W.value.status.bold?`bold`:`normal`,lineHeight:W.value.status.lineHeight}));_(()=>({color:z.value.title.color,fontSize:`${z.value.title.fontSize}px`,fontWeight:z.value.title.bold?`bold`:`normal`,textAlign:z.value.title.textAlign})),_(()=>({color:z.value.title.subtitle.color,fontSize:`${z.value.title.subtitle.fontSize}px`,fontWeight:z.value.title.subtitle.bold?`bold`:`normal`}));let Zn=_(()=>{let e=Math.max(0,Number(z.value.height)||0);return Math.min(e,q.value.baseY+e)+U.value.offsetY});function Qn(e){return U.value[e].text}function $n(e){return e.position===0||e.position===1}let er=C(null),tr=C(null),Z=C(null);function nr(e){Z.value=e.id}function rr(e){Z.value===e.id&&(Z.value=null),er.value===e.id&&tr.value!==e.id&&I.value?.id!==e.id&&(er.value=null)}function ir(e){e?.id&&(er.value=e.id)}let ar=_(()=>{let e=[],t=[],n=null;return Nn.value.forEach(r=>{r.isStackOverflowHidden||(r.id===er.value?n=r:$n(r)?e.push(r):t.push(r))}),[...e,...t,...n?[n]:[]]}),or=_(()=>An.value.markers),Q=_(()=>or.value.find(e=>e.stackId===Y.value)||null),sr=_(()=>{let e=Math.max(160,Number(K.value.menu.width)||220),t=Math.max(80,Number(K.value.menu.maxHeight)||220);return{visibility:Sn.value?`visible`:`hidden`,width:`max-content`,minWidth:`${e}px`,maxWidth:`calc(100% - 16px)`,maxHeight:`${t}px`,backgroundColor:K.value.menu.backgroundColor,color:K.value.menu.color,borderColor:K.value.menu.borderColor,borderRadius:`${K.value.menu.borderRadius}px`}});function cr(e,t){let n=k.value,r=Pt.value;if(!n||!r)return null;let i=n.getScreenCTM();if(!i)return null;let a=n.createSVGPoint();a.x=e,a.y=t;let o=a.matrixTransform(i),s=r.getBoundingClientRect();return{x:o.x-s.left,y:o.y-s.top}}function lr(){let e=Q.value,t=Ft.value,n=Pt.value;if(!e||!t||!n){Sn.value=null;return}let r=cr(e.x,e.y),i=cr(e.x,e.y+K.value.marker.radius);if(!r||!i){Sn.value=null;return}let a=n.getBoundingClientRect(),o=t.offsetWidth,s=t.offsetHeight,c=Math.abs(i.y-r.y),l=Math.max(0,a.width-16),u=Math.min(o,l),d=r.x;if(u>=l)d=a.width/2;else{let e=u/2;d=Math.min(a.width-8-e,Math.max(8+e,r.x))}let f=r.y+c+8,p=r.y-c-8-s,m=f+s<=a.height-8,h=p>=8,g=f;!m&&h?g=p:m||(g=Math.min(Math.max(8,f),Math.max(8,a.height-s-8))),Sn.value={left:`${d}px`,top:`${g}px`,transform:`translateX(-50%)`,visibility:`visible`}}function ur(){typeof window<`u`&&(X!==null&&window.cancelAnimationFrame(X),X=window.requestAnimationFrame(()=>{X=null,lr()}))}Ee(or,e=>{Y.value&&!e.some(e=>e.stackId===Y.value)&&fr()}),Ee(()=>{let e=Q.value;return e?[e.stackId,e.x,e.y,e.hiddenDatapoints.length,e.hiddenDatapoints.map(e=>`${e.id}:${e.label}:${e.position}`).join(`|`),K.value.marker.radius,K.value.menu.width,K.value.menu.maxHeight,K.value.menu.backgroundColor,K.value.menu.color,K.value.menu.borderColor,K.value.menu.borderRadius,Zt.value]:null},e=>{e?ye(ur):Sn.value=null},{flush:`post`}),Ee(Ft,(e,t)=>{t&&En&&En.unobserve(t),e&&En&&(En.observe(e),ye(ur))},{flush:`post`}),Ee(()=>{let e=xn.value;return!e||An.value.overflowMemberIds.has(e)},e=>{e||(xn.value=null,J.value=null)});function dr(e){e&&(Y.value===e.stackId?ur():(Sn.value=null,Y.value=e.stackId,ye(ur)))}function fr(){Y.value=null,Sn.value=null,typeof window<`u`&&X!==null&&(window.cancelAnimationFrame(X),X=null)}function pr(){Tn!==null&&(clearTimeout(Tn),Tn=null)}function mr(){let e=J.value;e&&!e.moved&&(pr(),Cn.value=e.stackId,xn.value=null,J.value=null,fr(),Tn=setTimeout(()=>{Cn.value=null,Tn=null},K.value.transitionDuration+80))}function hr(e){if(!(e instanceof Element))return{isMenu:!1,isMarker:!1,isSelectedDatapoint:!1};let t=J.value,n=e.closest(`[data-datapoint-id]`);return{isMenu:!!e.closest(`[data-stack-overflow-menu]`),isMarker:!!e.closest(`[data-stack-overflow-marker]`),isSelectedDatapoint:!!(t&&n?.getAttribute(`data-datapoint-id`)===t.datapointId)}}function gr(e){let t=hr(e.target);Y.value&&!t.isMenu&&!t.isMarker&&fr(),!J.value||J.value.moved||t.isMenu||t.isMarker||t.isSelectedDatapoint||mr()}function _r(e){let t=Nn.value.find(t=>t.id===e);if(!t||t.isStackOverflowHidden)return;let n=k.value?.querySelector(`[data-datapoint-index="${t.__index}"]`);n&&typeof n.focus==`function`&&n.focus({preventScroll:!0})}function vr(e){if(!e||e.disabled||A.value.readonly)return;let t=Q.value?.stackId;t&&(pr(),Cn.value=null,xn.value=e.id,J.value={datapointId:e.id,stackId:t,initialPosition:e.position,moved:!1},fr(),ye(()=>{_r(e.id);let t=Nn.value.find(t=>t.id===e.id);t&&R(`selectDatapoint`,Gn(t))}))}function yr(){let e=Math.max(1,Number(q.value.width)||1);return Math.max(1e-6,1/e*2)}function br(e,t){let n=J.value;n&&n.datapointId===e&&!n.moved&&Math.abs(t-n.initialPosition)>=yr()&&(J.value={...n,moved:!0})}Ce(()=>{document.addEventListener(`pointerdown`,gr),window.addEventListener(`resize`,ur,{passive:!0}),typeof ResizeObserver<`u`&&(En=new ResizeObserver(()=>{Q.value&&ur()}),Pt.value&&En.observe(Pt.value),k.value&&En.observe(k.value))}),Se(()=>{document.removeEventListener(`pointerdown`,gr),window.removeEventListener(`resize`,ur),En?.disconnect(),En=null,X!==null&&(window.cancelAnimationFrame(X),X=null),pr()});function xr(e){return I.value?I.value.id===e.id:tr.value===e.id||Z.value===e.id}function Sr(e){return u(j.value.dragMarker.positionIndicator.value.formatter,e.position,a({p:``,v:e.position*100,s:`%`,r:j.value.dragMarker.positionIndicator.value.rounding}))}let Cr=_(()=>M.value.backgroundColor),wr=_(()=>M.value.legend),Tr=_(()=>M.value.title),{isCallbackImaging:Er,isCallbackSvg:Dr,generateSvg:Or,onGenerateImage:kr}=ae({svg:k,title:Tr,legend:wr,legendItems:null,backgroundColor:Cr,getSvgCallback:()=>A.value.userOptions.callbacks.svg,generateImage:Jt});function Ar(e=null){ye(()=>{let t=un().map(e=>[[e.name],[e.position],[Sr(e)],[Wn(e.position)]]),n=[[M.value.title.text],[M.value.title.subtitle.text],[[`Name`],[`Position`],[`Percentage`],[`Phase`]]].concat(t),r=o(n);e?e(r):f({csvContent:r,title:M.value.title.text||`vue-ui-hill`})})}let jr=_(()=>M.value.layout.stackbar.show),Mr=_(()=>{let e=Nn.value.length;Nn.value.reduce((e,t)=>e+(t?.position??0),0);let t=0,n=Nn.value.every(e=>e.position===1);return Nn.value.toSorted((e,t)=>{if(n)return e.__index-t.__index;let r=(e?.position??0)-(t?.position??0);return r===0?e.__index-t.__index:r}).map(n=>{let r=n?.position??0,i=e>0?r/e:0,a={...n,proportion:i,proportionStart:t};return t+=i,a})}),$=_(()=>Math.min(1,Math.max(0,Mr.value.reduce((e,t)=>e+t.proportion,0)))),Nr=_(()=>$.value*100),Pr=_(()=>q.value.left[0].x+q.value.width*$.value),Fr=_(()=>z.value.height+32+G.value.paddingTop);function Ir(){return u(G.value.label.formatter,Nr.value,a({p:``,v:Nr.value,s:`%`,r:0}))}let Lr=_(()=>`${Mt.value}-stackbar-clip`);async function Rr(){let e=un();Rt(`copyAlt`,{config:A.value,dataset:e}),A.value.userOptions.callbacks.altCopy?await Promise.resolve(A.value.userOptions.callbacks.altCopy({config:A.value,dataset:e})):console.warn("Vue Data UI - A callback must be set for `altCopy` in userOptions.")}let zr=re(Pt,()=>M.value.title.text);function Br(){return un()}return ee({isEditing:P,beginEditing:Ln,save:Rn,cancel:zn,getData:Br,copyAlt:Rr,toggleFullscreen:Qt,toggleAnnotator:en,generateImage:Jt,generateSvg:Or,generatePdf:qt,generateCsv:Ar,getImage:zr}),(e,i)=>(S(),y(`div`,{ref_key:`hillChartRef`,ref:Pt,class:be(`vue-data-ui-component vue-ui-hill`),style:x(Yn.value),id:`hill_${Mt.value}`,onMouseenter:Ut,onMouseleave:Wt,"data-editing":P.value},[M.value.title.text?(S(),y(`div`,je,[(S(),pe(ie,{key:`title_${Lt.value}`,config:{title:{cy:`hill-div-title`,...M.value.title},subtitle:{cy:`hill-div-subtitle`,...M.value.title.subtitle}}},null,8,[`config`]))],512)):v(``,!0),A.value.userOptions.buttons.annotator&&k.value?(S(),pe(D(Et),ve({key:1},D(n)(A.value.userOptions.annotator),{color:M.value.color,backgroundColor:M.value.backgroundColor,active:$t.value,svgRef:k.value,isCursorPointer:Yt.value,palette:A.value.userOptions.annotatorPalette,onClose:en}),me({_:2},[w(D(r),n=>({name:n,fn:De(r=>[T(e.$slots,n,xe(_e(D(t)(n,r))),void 0,!0)])}))]),1040,[`color`,`backgroundColor`,`active`,`svgRef`,`isCursorPointer`,`palette`])):v(``,!0),W.value.show?(S(),pe(D(Ct),{key:2,"is-editing":P.value,"is-editable":L.value,"is-fullscreen":Zt.value,position:tn.value,color:M.value.color,"background-color":M.value.backgroundColor,translations:W.value.buttons.translations,"is-cursor-pointer":Yt.value,onUpdate:Ln,onCancel:zn,onSave:Rn},{"hill-edit":De(()=>[T(e.$slots,`hill-edit`,{},void 0,!0)]),"hill-cancel":De(()=>[T(e.$slots,`hill-cancel`,{},void 0,!0)]),"hill-save":De(()=>[T(e.$slots,`hill-save`,{},void 0,!0)]),_:3},8,[`is-editing`,`is-editable`,`is-fullscreen`,`position`,`color`,`background-color`,`translations`,`is-cursor-pointer`])):v(``,!0),W.value.show?(S(),y(`div`,Me,[b(`p`,{class:`vue-ui-hill__status`,style:x(Xn.value),"aria-live":`polite`},E(P.value?W.value.status.editInstruction:W.value.status.lastUpdated),5)])):v(``,!0),A.value.userOptions.show&&(D(Ht)||D(Bt))?(S(),pe(D(wt),{ref_key:`userOptionsRef`,ref:It,key:`uo_${Xt.value}`,backgroundColor:M.value.backgroundColor,color:M.value.color,isPrinting:D(Gt),isImaging:D(Kt),uid:Mt.value,hasTooltip:!1,hasPdf:A.value.userOptions.buttons.pdf,hasImg:A.value.userOptions.buttons.img,hasSvg:A.value.userOptions.buttons.svg,hasXls:A.value.userOptions.buttons.csv,hasTable:A.value.userOptions.buttons.table,hasLabel:A.value.userOptions.buttons.labels,hasFullscreen:A.value.userOptions.buttons.fullscreen,hasAltCopy:A.value.userOptions.buttons.altCopy,isFullscreen:Zt.value,chartElement:Pt.value,position:A.value.userOptions.position,callbacks:A.value.userOptions.callbacks,titles:{...A.value.userOptions.buttonTitles},hasAnnotator:A.value.userOptions.buttons.annotator,isAnnotation:$t.value,printScale:A.value.userOptions.print.scale,isCursorPointer:Yt.value,onToggleFullscreen:Qt,onGeneratePdf:D(qt),onGenerateCsv:Ar,onGenerateImage:D(kr),onGenerateSvg:D(Or),onToggleAnnotator:en,onCopyAlt:Rr,style:x({visibility:D(Ht)?D(Bt)?`visible`:`hidden`:`visible`})},me({_:2},[w(D(oe)(e.$slots,`menuIcon optionPdf optionCsv optionImg optionSvg optionFullscreen optionAnnotator optionAltCopy custom-menu-before custom-menu-after`),t=>({name:t,fn:De(n=>[T(e.$slots,t,xe(_e(D(se)(t,n))),void 0,!0)])}))]),1032,/* @__PURE__ */ `backgroundColor.color.isPrinting.isImaging.uid.hasPdf.hasImg.hasSvg.hasXls.hasTable.hasLabel.hasFullscreen.hasAltCopy.isFullscreen.chartElement.position.callbacks.titles.hasAnnotator.isAnnotation.printScale.isCursorPointer.onGeneratePdf.onGenerateImage.onGenerateSvg.style`.split(`.`))):v(``,!0),(S(),y(`svg`,{ref_key:`svgRef`,ref:k,style:x({background:`transparent`,color:M.value.color,fontFamily:A.value.style.fontFamily}),class:be({"vue-data-ui-no-transition":!D(N)}),viewBox:`0 0 ${z.value.width} ${z.value.height+(jr.value?32+G.value.paddingTop+G.value.paddingBottom+G.value.height:0)}`,role:`group`,"aria-live":`polite`,preserveAspectRatio:`xMidYMid meet`,onPointermove:Vn,onPointerup:Hn,onPointercancel:Hn},[he(D(Tt)),T(e.$slots,`svg-underlayer`,{svg:{drawingArea:q.value,isEditing:P.value,datapoints:ar.value,isPrintingImg:D(Gt)||D(Kt)||D(Er),isPrintingSvg:D(Dr)}},void 0,!0),e.$slots[`chart-background`]?(S(),y(`foreignObject`,{key:0,x:0,y:0,width:Math.max(.1,z.value.width),height:Math.max(.1,z.value.height+(jr.value?32+G.value.paddingTop+G.value.paddingBottom+G.value.height:0)),style:{pointerEvents:`none`}},[T(e.$slots,`chart-background`,{},void 0,!0)],8,Pe)):v(``,!0),B.value.baseline.show?(S(),y(`line`,{key:1,x1:q.value.startX,x2:q.value.endX,y1:q.value.baseY,y2:q.value.baseY,stroke:B.value.baseline.stroke,"stroke-width":B.value.baseline.strokeWidth,"stroke-dasharray":B.value.baseline.strokeDasharray,"vector-effect":`non-scaling-stroke`},null,8,Fe)):v(``,!0),B.value.midline.show?(S(),y(`line`,{key:2,x1:q.value.centerX,x2:q.value.centerX,y1:q.value.peakY,y2:q.value.baseY,stroke:B.value.midline.stroke,"stroke-width":B.value.midline.strokeWidth,"stroke-dasharray":B.value.midline.strokeDasharray,"vector-effect":`non-scaling-stroke`},null,8,Ie)):v(``,!0),b(`path`,{d:mn.value,fill:`none`,stroke:B.value.curve.stroke,"stroke-width":B.value.curve.strokeWidth,"stroke-dasharray":B.value.curve.strokeDasharray,"stroke-linecap":`round`,"stroke-linejoin":`round`,"vector-effect":`non-scaling-stroke`},null,8,Le),j.value.dragMarker.positionIndicator.show?(S(!0),y(fe,{key:3},w(ar.value,e=>(S(),y(`g`,{key:`position-indicator-${e.id}`},[xr(e)&&V.value.dragMarker.show?(S(),y(`g`,Re,[b(`path`,{d:`M${e.x},${e.y} ${e.x},${q.value.baseY}`,stroke:j.value.dragMarker.positionIndicator.useSerieColor?e.color:j.value.dragMarker.positionIndicator.color,"stroke-width":j.value.dragMarker.positionIndicator.strokeWidth,"stroke-dasharray":j.value.dragMarker.positionIndicator.strokeDasharray,"stroke-linecap":`round`,"vector-effect":`non-scaling-stroke`,class:be({"vue-data-ui-transition":D(N)&&I.value?.id!==e.id})},null,10,ze),j.value.dragMarker.positionIndicator.circle.show?(S(),y(`circle`,{key:0,cx:e.x,cy:q.value.baseY,r:j.value.dragMarker.positionIndicator.circle.radius,fill:j.value.dragMarker.positionIndicator.useSerieColor?e.color:j.value.dragMarker.positionIndicator.color,stroke:j.value.dragMarker.positionIndicator.circle.stroke,"stroke-width":j.value.dragMarker.positionIndicator.circle.strokeWidth,"vector-effect":`non-scaling-stroke`,"paint-order":`stroke fill`,class:be({"vue-data-ui-transition":D(N)&&I.value?.id!==e.id})},null,10,Be)):v(``,!0),j.value.dragMarker.positionIndicator.value.show?(S(),y(`text`,{key:1,"paint-order":`stroke fill`,"vector-effect":`non-scaling-stroke`,"text-anchor":`middle`,transform:`translate(${e.x}, ${q.value.baseY+j.value.radius+j.value.dragMarker.positionIndicator.value.offsetY+j.value.dragMarker.positionIndicator.value.fontSize})`,"font-size":j.value.dragMarker.positionIndicator.value.fontSize,fill:j.value.dragMarker.positionIndicator.value.useSerieColor?e.color:j.value.dragMarker.positionIndicator.value.color,stroke:M.value.backgroundColor,"stroke-width":`1`,class:be({"vue-data-ui-transition":D(N)&&I.value?.id!==e.id})},E(Sr(e)),11,Ve)):v(``,!0)])):v(``,!0)]))),128)):v(``,!0),(S(!0),y(fe,null,w(ar.value,e=>(S(),y(`g`,{key:e.id,"data-cy-datapoint":``,class:be({"vue-ui-hill__datapoint":!0,"vue-data-ui-transition":D(N)&&I.value?.id!==e.id,"vue-ui-hill__datapoint--promoted":D(N)&&e.isPromotedFromStackOverflow}),style:x({opacity:[0,1].includes(e.position)||e?.muted?V.value.mutedOpacity:e?.disabled?V.value.disabledOpacity:1}),transform:`translate(${e.x} ${e.y})`,"data-datapoint-index":e.__index,"data-datapoint-id":e.id,role:`slider`,tabindex:P.value&&L.value&&!e.disabled?0:-1,"aria-orientation":`horizontal`,"aria-valuemin":`0`,"aria-valuemax":`100`,"aria-valuenow":Sr(e),"aria-valuetext":`${e.label}: ${Wn(e.position)}, ${Sr(e)}`,"aria-label":e.label,onFocus:t=>nr(e),onBlur:t=>rr(e),onKeydown:t=>Un(t,e),onPointerenter:t=>Kn(e),onPointerleave:t=>qn(e),onClick:t=>Jn(e)},[b(`circle`,{r:V.value.hitRadius,fill:`transparent`,class:be({"vue-ui-hill__hit-area--active":P.value&&L.value&&!e.disabled,"vue-ui-hill__hit-area--dragging":I.value?.id===e.id}),onPointerdown:t=>Bn(t,e)},null,42,Ue),b(`circle`,{class:`vue-ui-hill-circle`,r:V.value.radius,fill:e.color,stroke:V.value.stroke,"stroke-width":V.value.strokeWidth,style:x({filter:V.value.shadow.show?`drop-shadow(${V.value.shadow.offsetX}px ${V.value.shadow.offsetY}px ${V.value.shadow.blur}px ${V.value.shadow.color})`:`none`}),"vector-effect":`non-scaling-stroke`,"pointer-events":`none`},null,12,We),P.value&&(I.value?.id===e.id&&V.value.dragMarker.show||xr(e))&&!e?.disabled?(S(),y(`g`,{key:0,fill:`none`,stroke:D(p)(e.color),"stroke-width":V.value.dragMarker.strokeWidth,"stroke-linecap":`round`,"stroke-linejoin":`round`,"pointer-events":`none`,"vector-effect":`non-scaling-stroke`,"aria-hidden":`true`},[b(`path`,{d:V.value.dragMarker.crossPath},null,8,Ke)],8,Ge)):v(``,!0),H.value.show?(S(),y(`text`,{key:1,x:e.labelX,y:H.value.offsetY,"text-anchor":e.textAnchor,fill:H.value.useSerieColor?e.color:H.value.color,"font-size":H.value.fontSize,"font-weight":H.value.bold?`bold`:`normal`,"paint-order":`stroke fill`,stroke:H.value.stroke,"stroke-width":H.value.strokeWidth,"stroke-linejoin":`round`,"stroke-linecap":`round`,"pointer-events":`none`,style:{"user-select":`none`},"dominant-baseline":`central`},E(D(l)(e.label,H.value.ellipsisThresholdChars)),9,qe)):v(``,!0)],46,He))),128)),(S(!0),y(fe,null,w(or.value,e=>(S(),y(`g`,{key:`stack-overflow-${e.stackId}`,class:be([`vue-ui-hill__stack-overflow-marker`,{"vue-ui-hill__stack-overflow-marker--animated":D(N),"vue-ui-hill__stack-overflow-marker--restored":Cn.value===e.stackId}]),style:x({"--vue-ui-hill-overflow-marker-duration":`${K.value.transitionDuration*.7}ms`,"--vue-ui-hill-overflow-marker-delay":`${K.value.transitionDuration*.3}ms`,"--vue-ui-hill-overflow-label-duration":`${K.value.transitionDuration*.55}ms`,"--vue-ui-hill-overflow-label-delay":`${K.value.transitionDuration*.45}ms`,cursor:Yt.value&&!A.value.readonly?`pointer`:`default`}),transform:`translate(${e.x} ${e.y})`,"data-stack-overflow-marker":``,role:`button`,tabindex:P.value&&L.value?0:-1,"aria-label":`${e.hiddenCount} stacked datapoints. Activate to choose one.`,"aria-expanded":Y.value===e.stackId,onPointerdown:i[0]||=O(()=>{},[`stop`]),onClick:O(t=>dr(e),[`stop`]),onFocus:t=>dr(e),onKeydown:[Oe(O(t=>dr(e),[`prevent`,`stop`]),[`enter`]),Oe(O(t=>dr(e),[`prevent`,`stop`]),[`space`]),Oe(O(fr,[`prevent`,`stop`]),[`esc`])]},[D(N)&&Cn.value!==e.stackId?(S(),y(`g`,Ye,[(S(!0),y(fe,null,w(e.collapseDatapoints,t=>(S(),y(`circle`,{key:`overflow-ghost-${e.stackId}-${t.id}`,cx:t.relativeX,cy:t.relativeY,r:V.value.radius,fill:t.color,stroke:V.value.stroke,"stroke-width":V.value.strokeWidth,opacity:`0.8`,"vector-effect":`non-scaling-stroke`},[b(`animate`,{attributeName:`cx`,from:t.relativeX,to:`0`,dur:`${K.value.transitionDuration}ms`,fill:`freeze`,calcMode:`spline`,keyTimes:`0;1`,keySplines:`0.22 1 0.36 1`},null,8,Ze),b(`animate`,{attributeName:`cy`,from:t.relativeY,to:`0`,dur:`${K.value.transitionDuration}ms`,fill:`freeze`,calcMode:`spline`,keyTimes:`0;1`,keySplines:`0.22 1 0.36 1`},null,8,Qe),b(`animate`,{attributeName:`r`,from:V.value.radius,to:K.value.marker.radius*.7,dur:`${K.value.transitionDuration}ms`,fill:`freeze`},null,8,$e),b(`animate`,{attributeName:`opacity`,from:`0.8`,to:`0`,dur:`${K.value.transitionDuration*.85}ms`,fill:`freeze`},null,8,et)],8,Xe))),128))])):v(``,!0),b(`circle`,{r:Math.max(V.value.hitRadius,K.value.marker.radius),fill:`transparent`,"pointer-events":`all`},null,8,tt),b(`rect`,{class:`vue-ui-hill__stack-overflow-marker-rect`,x:-K.value.marker.radius,y:-K.value.marker.radius,width:K.value.marker.radius*2,height:K.value.marker.radius*2,fill:K.value.marker.fill,stroke:K.value.marker.stroke,"stroke-width":K.value.marker.strokeWidth,"vector-effect":`non-scaling-stroke`,"pointer-events":`none`},null,8,nt),b(`g`,{class:`vue-ui-hill__stack-overflow-focus-cross`,fill:`none`,stroke:D(p)(B.value.curve.stroke),"stroke-width":V.value.dragMarker.strokeWidth,"stroke-linecap":`round`,"stroke-linejoin":`round`,"pointer-events":`none`,"vector-effect":`non-scaling-stroke`,"aria-hidden":`true`},[b(`path`,{d:V.value.dragMarker.crossPath},null,8,it)],8,rt),Q.value?v(``,!0):(S(),y(`text`,{key:1,class:`vue-ui-hill__stack-overflow-marker-label`,"text-anchor":`middle`,y:K.value.marker.radius+K.value.marker.offsetY+K.value.marker.fontSize,fill:K.value.marker.color,"font-size":K.value.marker.fontSize,"font-weight":K.value.marker.bold?`bold`:`normal`,"pointer-events":`none`,style:{"user-select":`none`},"paint-order":`stroke fill`,"vector-effect":`non-scaling-stroke`,stroke:M.value.backgroundColor,"stroke-width":`3`},` +`+E(e.hiddenCount),9,at))],46,Je))),128)),U.value.show?(S(),y(fe,{key:4},[b(`text`,{x:(q.value.startX+q.value.centerX)/2,y:Zn.value,"text-anchor":`middle`,fill:U.value.color,"font-size":U.value.fontSize,"font-weight":U.value.bold?`bold`:`normal`,"letter-spacing":U.value.letterSpacing},E(Qn(`left`)),9,ot),b(`text`,{x:(q.value.centerX+q.value.endX)/2,y:Zn.value,"text-anchor":`middle`,fill:U.value.color,"font-size":U.value.fontSize,"font-weight":U.value.bold?`bold`:`normal`,"letter-spacing":U.value.letterSpacing},E(Qn(`right`)),9,st)],64)):v(``,!0),jr.value?(S(),y(fe,{key:5},[b(`rect`,{x:q.value.left[0].x,y:Fr.value,rx:G.value.height/2,width:q.value.width,height:G.value.height,fill:G.value.gutterColor},null,8,ct),b(`defs`,null,[b(`clipPath`,{id:Lr.value},[b(`rect`,{x:q.value.left[0].x,y:Fr.value,width:q.value.width*$.value,height:G.value.height,rx:Math.min(G.value.height/2,q.value.width*$.value/2),ry:Math.min(G.value.height/2,q.value.width*$.value/2)},null,8,ut)],8,lt)]),b(`g`,{"clip-path":`url(#${Lr.value})`},[(S(!0),y(fe,null,w(Mr.value,e=>(S(),y(`rect`,{key:`bar_fill_${e.id}`,width:q.value.width*e.proportion,x:q.value.left[0].x+q.value.width*e.proportionStart,y:z.value.height+32+G.value.paddingTop,fill:e.color,height:G.value.height,onPointerenter:t=>Kn(e),onPointerleave:t=>qn(e)},null,40,ft))),128))],8,dt),(S(!0),y(fe,null,w(Mr.value.slice(1),e=>(S(),y(`line`,{key:`bar_separator_${e.id}`,x1:q.value.left[0].x+q.value.width*e.proportionStart,x2:q.value.left[0].x+q.value.width*e.proportionStart,y1:z.value.height+32+G.value.paddingTop,y2:z.value.height+32+G.value.paddingTop+G.value.height,stroke:G.value.stroke,"stroke-width":G.value.strokeWidth,"vector-effect":`non-scaling-stroke`},null,8,pt))),128)),b(`rect`,{x:q.value.left[0].x,y:z.value.height+32+G.value.paddingTop,width:q.value.width*$.value,height:G.value.height,rx:Math.min(G.value.height/2,q.value.width*$.value/2),ry:Math.min(G.value.height/2,q.value.width*$.value/2),fill:`none`,stroke:G.value.stroke,"stroke-width":G.value.strokeWidth,"vector-effect":`non-scaling-stroke`},null,8,mt),G.value.label.show&&$.value>0?(S(),y(`text`,{key:0,x:Pr.value,y:Fr.value-6,fill:G.value.label.color,"font-size":G.value.label.fontSize,"text-anchor":`end`,"dominant-baseline":`auto`,"pointer-events":`none`,style:{"user-select":`none`}},E(Ir()),9,ht)):v(``,!0)],64)):v(``,!0),T(e.$slots,`svg`,{svg:{drawingArea:q.value,isEditing:P.value,datapoints:ar.value,isPrintingImg:D(Gt)||D(Kt)||D(Er),isPrintingSvg:D(Dr)}},void 0,!0)],46,Ne)),Q.value?(S(),y(`div`,{ref_key:`overflowMenuRef`,ref:Ft,key:`stack-overflow-menu-${Q.value.stackId}`,class:`vue-ui-hill__stack-overflow-menu`,"data-stack-overflow-menu":``,"data-dom-to-png-ignore":``,style:x([sr.value,Sn.value]),role:`listbox`,"aria-label":`Choose one of ${Q.value.hiddenCount} stacked datapoints`,onPointerdown:i[1]||=O(()=>{},[`stop`]),onClick:i[2]||=O(()=>{},[`stop`]),onKeydown:Oe(O(fr,[`prevent`,`stop`]),[`esc`])},[j.value.stacking.overflow.menu.title?(S(),y(`div`,_t,E(j.value.stacking.overflow.menu.title),1)):v(``,!0),(S(!0),y(fe,null,w(Q.value.hiddenDatapoints,e=>(S(),y(`button`,{key:`hidden-${e.id}`,type:`button`,class:be([`vue-ui-hill__stack-overflow-menu-item`,{readonly:A.value.readonly}]),role:`option`,disabled:e.disabled,"aria-label":`${e.label}, ${Sr(e)}`,onClick:O(t=>vr(e),[`stop`]),style:x({cursor:Yt.value&&!A.value.readonly?`pointer`:`default`})},[b(`span`,{class:`vue-ui-hill__stack-overflow-menu-swatch`,style:x({backgroundColor:e.color}),"aria-hidden":`true`},null,4),b(`span`,yt,E(D(l)(e.label,H.value.ellipsisThresholdChars)),1),b(`span`,bt,E(Sr(e)),1)],14,vt))),128))],44,gt)):v(``,!0),T(e.$slots,`analysis`,{data:{...Mr.value}},void 0,!0),e.$slots.watermark?(S(),y(`div`,xt,[T(e.$slots,`watermark`,xe(_e({isPrinting:D(Gt)||D(Kt)||D(Er)||D(Dr)})),void 0,!0)])):v(``,!0),A.value.loading?(S(),y(`div`,St,[A.value.loading?T(e.$slots,`loading`,{},()=>[he(D(Dt),{name:`spinner2`,stroke:M.value.color,"is-spin":!0},null,8,[`stroke`])],!0,0):v(``,!0)])):v(``,!0)],44,Ae))}},[[`__scopeId`,`data-v-704eb940`]]);export{ke as n,Ct as t};
@@ -1,2 +0,0 @@
1
- import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{n as t,r as n,t as r}from"./annotationSlots-OLiW25XN.js";import{t as i}from"./useConfig-By3Vb5kz.js";import{$ as a,D as o,Dt as s,Et as c,Ft as ee,Ht as te,J as ne,Q as re,S as ie,T as ae,X as oe,Zt as se,_ as ce,at as le,i as ue,in as de,nn as fe,nt as pe,qt as me,r as he,rn as l,t as ge,tn as _e,w as ve,yt as ye,zt as be}from"./lib-rPeBMZrn.js";import{n as xe,t as Se}from"./BaseScanner-8NdoBs7B.js";import{n as Ce,t as we}from"./useHints-C-TwxM0Y.js";import{t as Te}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{t as Ee}from"./useNestedProp-DnGoh-XS.js";import{t as De}from"./useThemeCheck-BKNRbGeC.js";import{t as Oe}from"./chartImage-DPGnEuYM.js";import{n as ke}from"./Title-BliHuXfT.js";import{t as Ae}from"./useChartExport-BZts4KFb.js";import{n as je,t as Me}from"./tableIntegration-CNoJ1CIY.js";import{n as Ne,t as Pe}from"./userOptionsSlots-DYuo-E5m.js";import{t as Fe}from"./usePrinter-DVf3YcG5.js";import{t as Ie}from"./useTransitions-ChGGrtrv.js";import{t as Le}from"./useSvgLabelLayout-42Kats14.js";import{t as Re}from"./useTimeLabelCollider-BTybMUFi.js";import{t as ze}from"./useResponsive-CENUxfEL.js";import{t as Be}from"./DefGrad-DKMq1REY.js";import{t as Ve}from"./BaseLegendToggle-BIzyyI1h.js";import{t as He}from"./A11yDataTable-DWNlWXzs.js";import{t as Ue}from"./useUserOptionState-CXlFnwPv.js";import{t as We}from"./useChartAccessibility-DOMuYJfm.js";import{t as Ge}from"./Legend-DM0ClX3D.js";import{t as Ke}from"./vue_ui_history_plot-soyqUW4Y.js";import{Fragment as u,Teleport as qe,computed as d,createBlock as f,createCommentVNode as p,createElementBlock as m,createElementVNode as h,createSlots as Je,createTextVNode as Ye,createVNode as Xe,defineAsyncComponent as g,guardReactiveProps as _,mergeProps as Ze,nextTick as Qe,normalizeClass as v,normalizeProps as y,normalizeStyle as b,onBeforeUnmount as $e,onMounted as et,openBlock as x,ref as S,renderList as C,renderSlot as w,resolveDynamicComponent as tt,shallowRef as nt,toDisplayString as T,toRefs as rt,unref as E,watch as it,withCtx as D}from"vue";var at=/* @__PURE__ */ e({default:()=>Wt}),ot=[`id`],st=[`id`],ct=[`id`],lt={style:{position:`relative`}},ut=[`xmlns`,`viewBox`,`aria-describedby`],dt=[`x`,`y`,`width`,`height`],ft={key:1},pt=[`id`,`x1`,`y1`,`x2`,`y2`],mt=[`stop-color`,`offset`],ht={key:2},gt=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`],_t={key:3},vt=[`stroke`,`stroke-width`,`x1`,`x2`,`y1`,`y2`],yt=[`x`,`y`,`fill`,`font-size`],bt=[`transform`,`font-size`,`fill`,`font-weight`],xt={key:6},St=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`],Ct={key:7},wt=[`stroke`,`stroke-width`,`x1`,`x2`,`y1`,`y2`],Tt=[`transform`,`fill`,`font-size`,`text-anchor`],Et=[`x`,`y`,`font-size`,`fill`,`font-weight`],Dt=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`],Ot=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`],kt=[`d`,`stroke`,`stroke-width`],At=[`d`,`stroke`,`stroke-width`],jt=[`cx`,`cy`,`fill`,`r`],Mt=[`cx`,`cy`,`fill`,`r`,`stroke`,`stroke-width`],Nt={key:1},Pt=[`transform`,`font-size`,`fill`,`font-weight`],Ft=[`transform`,`font-size`,`fill`,`font-weight`,`innerHTML`],It={key:2},Lt=[`transform`,`font-size`,`font-weight`,`fill`],Rt=[`cx`,`cy`,`r`,`onMouseenter`,`onMouseleave`,`onClick`],zt={key:0,style:{position:`absolute`,top:`100%`,left:`0`,width:`100%`},"data-dom-to-png-ignore":``,"aria-hidden":`true`},Bt={key:5,class:`vue-data-ui-watermark`},Vt=[`id`],Ht=[`onClick`],Ut={style:{display:`flex`,"align-items":`center`}},Wt=/*#__PURE__*/ Te({__name:`vue-ui-history-plot`,props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:[`selectLegend`,`selectDatapoint`,`copyAlt`],setup(e,{expose:Te,emit:at}){let Wt=g(()=>import(`./Tooltip-C1q0Qoh7.js`)),Gt=g(()=>import(`./BaseIcon-CoY0vuL3.js`).then(e=>e.n)),Kt=g(()=>import(`./vue-ui-accordion-DFxSW8ET.js`).then(e=>e.n)),qt=g(()=>import(`./DataTable-Dof6yhO7.js`)),Jt=g(()=>import(`./PenAndPaper-DoNTA-SV.js`).then(e=>e.t)),Yt=g(()=>import(`./UserOptions-DW84OKKr.js`).then(e=>e.n)),Xt=g(()=>import(`./PackageVersion-Bczw6rsP.js`).then(e=>e.t)),Zt=g(()=>import(`./BaseDraggableDialog-BK7dj9O6.js`).then(e=>e.n)),{vue_ui_history_plot:Qt}=i(),{isThemeValid:$t,warnInvalidTheme:en}=De(),O=e,k=S(null),tn=S(null),nn=S(0),rn=S(null),an=S(0),on=S(0),sn=S(0),A=nt(null),j=nt(null),cn=S(null),M=S(oe()),ln=S(!1),un=S(``),N=S([]),dn=S(!1),P=S(null),fn=S(!1),pn=S(null),mn=S(!1),hn=S(null),gn=S(null),_n=S(null),vn=S(null),yn=S(null),bn=S(null),F=S(null),I=S(null),xn=S({x:0,y:0}),Sn=S(`pointer`),Cn=S(!1),wn=d({get:()=>!!O.dataset&&O.dataset.length,set:e=>e}),Tn=at,En=S(!1),Dn=0;et(()=>{mn.value=!0,kn()});let On=d(()=>L.value.debug);function kn(){be(O.dataset)?(le({componentName:`VueUiHistoryPlot`,type:`dataset`,debug:On.value}),Pn.value=!0):O.dataset.forEach((e,t)=>{ye({datasetObject:e,requiredAttributes:[`name`,`values`]}).forEach(e=>{wn.value=!1,le({componentName:`VueUiHistoryPlot`,type:`datasetSerieAttribute`,property:e,index:t,debug:On.value})})}),be(O.dataset)||(Pn.value=L.value.loading),L.value.responsive&&(A.value&&(j.value&&A.value.unobserve(j.value),A.value.disconnect()),A.value=new ResizeObserver(()=>{let{width:e,height:t}=ze({chart:k.value,title:V.value.title.text?tn.value:null,noTitle:cn.value,legend:V.value.legend.show?rn.value:null,source:pn.value});cancelAnimationFrame(Dn),Dn=requestAnimationFrame(()=>{K.value.width=e,K.value.height=t,En.value=!0,L.value.responsiveProportionalSizing?(Y.value.plots=l({relator:Math.min(e,t),adjuster:600,source:R.value.radius,threshold:3,fallback:3}),Y.value.indexLabels=l({relator:Math.min(e,t),adjuster:600,source:R.value.indexLabels.fontSize,threshold:6,fallback:6}),Y.value.labels=l({relator:Math.min(e,t),adjuster:600,source:R.value.labels.fontSize,threshold:6,fallback:6}),Y.value.xAxisLabels=l({relator:Math.min(e,t),adjuster:600,source:B.value.x.labels.fontSize,threshold:6,fallback:6}),Y.value.xAxisName=l({relator:Math.min(e,t),adjuster:600,source:B.value.x.name.fontSize,threshold:6,fallback:6}),Y.value.yAxisLabels=l({relator:Math.min(e,t),adjuster:600,source:B.value.y.labels.fontSize,threshold:6,fallback:6}),Y.value.yAxisName=l({relator:Math.min(e,t),adjuster:600,source:B.value.y.name.fontSize,threshold:6,fallback:6})):(Y.value.plots=R.value.radius,Y.value.indexLabels=R.value.indexLabels.fontSize,Y.value.labels=R.value.labels.fontSize,Y.value.xAxisLabels=B.value.x.labels.fontSize,Y.value.xAxisName=B.value.x.name.fontSize,Y.value.yAxisLabels=B.value.y.labels.fontSize,Y.value.yAxisName=B.value.y.name.fontSize)})}),j.value=k.value.parentNode,A.value.observe(j.value))}$e(()=>{cancelAnimationFrame(Dn),A.value&&(j.value&&A.value.unobserve(j.value),A.value.disconnect())});function An(){let e=Ee({userConfig:O.config,defaultConfig:Qt}),t={},n=e.theme;if(n){if(!$t.value(e))en(e),t=e;else{let r=Ee({userConfig:Ke[n]||O.config,defaultConfig:e});t={...Ee({userConfig:O.config,defaultConfig:r}),customPalette:e.customPalette.length?e.customPalette:fe[n]||te}}}else t=e;return t}let L=S(An()),R=d(()=>L.value.style.chart.plots),z=d(()=>L.value.style.chart.grid),B=d(()=>L.value.style.chart.axes),V=d(()=>L.value.style.chart);Ce({config:()=>L.value,dataset:()=>O.dataset,component:`VueUiHistoryPlot`,rules:[we.emptyArray,{test:e=>e.length>6,message:[`👀 The number of series is > 6. Consider:`,``,`▶️ Using filters to let users choose a maximum number of series to display.`]}]});let{transitionEnabled:H}=Ie({config:()=>L.value.transitions,dataset:()=>O.dataset}),U=d(()=>L.value.userOptions.useCursorPointer),jn=d(()=>de({defaultConfig:{userOptions:{show:!1},table:{show:!1},style:{chart:{backgroundColor:`#99999930`,axes:{x:{scaleMin:0,scaleMax:10,labels:{show:!1},name:{text:``}},y:{scaleMin:0,scaleMax:10,labels:{show:!1},name:{text:``}}},grid:{xAxis:{stroke:`#6A6A6A`},horizontalLines:{stroke:`#6A6A6A50`},yAxis:{stroke:`#6A6A6A`},verticalLines:{stroke:`#6A6A6A50`}},legend:{backgroundColor:`transparent`},paths:{useSerieColor:!1,stroke:`#6A6A6A`},plots:{stroke:`#6A6A6A`,indexLabels:{show:!1},labels:{show:!1}}}}},userConfig:L.value.skeletonConfig??{}})),{loading:Mn,FINAL_DATASET:Nn,manualLoading:Pn}=xe({...rt(O),FINAL_CONFIG:L,prepareConfig:An,skeletonDataset:O.config?.skeletonDataset??[{name:``,color:`#CACACA`,values:[{label:``,x:1,y:9},{label:``,x:4,y:1},{label:``,x:7,y:9},{label:``,x:9,y:4}]}],skeletonConfig:de({defaultConfig:L.value,userConfig:jn.value})}),{userOptionsVisible:Fn,setUserOptionsVisibility:In,keepUserOptionState:Ln}=Ue({config:L.value}),{svgRef:W}=We({config:V.value.title}),Rn=se(O.config);it(()=>O.config,(e,t)=>{let n=se(e),r=n!==Rn;Rn=n;let i=An();r?(Mn.value||(L.value=i),Fn.value=!L.value.userOptions.showOnChartHover,kn(),nn.value+=1,on.value+=1,an.value+=1,K.value.height=V.value.height,K.value.width=V.value.width,Y.value.plots=R.value.radius,Y.value.indexLabels=R.value.indexLabels.fontSize,Y.value.labels=R.value.labels.fontSize,Y.value.xAxisLabels=B.value.x.labels.fontSize,Y.value.xAxisName=B.value.x.name.fontSize,Y.value.yAxisLabels=B.value.y.labels.fontSize,Y.value.yAxisName=B.value.y.name.fontSize,G.value.showTable=L.value.table.show,G.value.showTooltip=V.value.tooltip.show):(L.value.style.chart.tooltip=i.style.chart.tooltip,G.value.showTooltip=L.value.style.chart.tooltip.show)},{deep:!0}),it(()=>O.dataset,e=>{Array.isArray(e)&&e.length>0&&(Pn.value=!1)},{deep:!0});let{isPrinting:zn,isImaging:Bn,generatePdf:Vn,generateImage:Hn}=Fe({elementId:`history_plot_${M.value}`,fileName:V.value.title.text||`vue-ui-history-plot`,options:L.value.userOptions.print}),Un=d(()=>L.value.userOptions.show&&!V.value.title.text),Wn=d(()=>ve(L.value.customPalette)),G=S({showTable:L.value.table.show,showTooltip:V.value.tooltip.show});it(L,()=>{G.value={showTable:L.value.table.show,showTooltip:V.value.tooltip.show}},{immediate:!0});let K=S({height:V.value.height,width:V.value.width}),Gn=d(()=>K.value.width),Kn=d(()=>K.value.height),{metrics:qn,ready:Jn,settling:q,update:Yn}=Le({svgRef:W,canMeasure:()=>!L.value.responsive||En.value,initialMetrics:{scaleLabelsWidth:0,yAxisLabelWidth:0,xAxisLabelHeight:0,timeLabelsHeight:0},measure:e=>({scaleLabelsWidth:e(bn.value).textWidth,yAxisLabelWidth:e(vn.value).rotatedWidth,xAxisLabelHeight:e(_n.value).height,timeLabelsHeight:e(yn.value).height})});function Xn(){let e=qn.value.scaleLabelsWidth,t=qn.value.yAxisLabelWidth;return e+t+(t?24:0)}let Zn=d(()=>qn.value.xAxisLabelHeight+qn.value.timeLabelsHeight+(_n.value?Y.value.xAxisName/2:0)),J=d(()=>{let e=V.value.padding.left,t=V.value.padding.top,n=Xn(),r=R.value.radius;return{left:e+n+B.value.y.name.offsetX,top:t+r,right:K.value.width-V.value.padding.right-r-B.value.y.name.offsetX,bottom:K.value.height-V.value.padding.bottom-Zn.value-r-B.value.x.name.offsetY,width:K.value.width-e-V.value.padding.right-n-r-B.value.y.name.offsetX,height:K.value.height-t-V.value.padding.bottom-Zn.value-r*2-B.value.x.name.offsetY}}),Y=S({plots:R.value.radius,indexLabels:R.value.indexLabels.fontSize,labels:R.value.labels.fontSize,xAxisLabels:B.value.x.labels.fontSize,xAxisName:B.value.x.name.fontSize,yAxisLabels:B.value.y.labels.fontSize,yAxisName:B.value.y.name.fontSize}),X=d(()=>Nn.value.map((e,t)=>{let n=Array.isArray(e.temperatureColors)&&e.temperatureColors.length?e.temperatureColors.map(e=>ie(e)):void 0;return{...e,color:e.color?ie(e.color):Wn.value[t]||te[t]||te[t%te.length],temperatureColors:n,temperatureAngle:Qn(e.temperatureAngle),temperatureIndependant:e.temperatureIndependant===!0,usePlotTemperatureColors:e.usePlotTemperatureColors!==!1,seriesIndex:t}}));function Qn(e=0){let t=Number(e);return Number.isFinite(t)?(t%360+360)%360:0}let $n=d(()=>Math.max(...X.value.filter(e=>!N.value.includes(e.seriesIndex)).flatMap(e=>e.values.map(e=>e.x)))),er=d(()=>{let e=Math.min(...X.value.filter(e=>!N.value.includes(e.seriesIndex)).flatMap(e=>e.values.map(e=>e.x)));return e<0?e:0}),tr=d(()=>Math.max(...X.value.filter(e=>!N.value.includes(e.seriesIndex)).flatMap(e=>e.values.map(e=>e.y)))),nr=d(()=>{let e=Math.min(...X.value.filter(e=>!N.value.includes(e.seriesIndex)).flatMap(e=>e.values.map(e=>e.y)));return e<0?e:0}),Z=d(()=>{let e=ce(B.value.x.scaleMin??er.value,B.value.x.scaleMax??$n.value,B.value.x.ticks),t=ce(B.value.y.scaleMin??nr.value,B.value.y.scaleMax??tr.value,B.value.y.ticks);return{x:e,y:t,tickX:e.ticks.map(t=>({x:J.value.left+(t-e.min)/(e.max-e.min)*J.value.width,y1:J.value.top,y2:J.value.bottom,value:t})),tickY:t.ticks.map(e=>({y:J.value.bottom-(e-t.min)/(t.max-t.min)*J.value.height,x1:J.value.left,x2:J.value.right,value:e}))}});function rr(e){let t=Z.value.x.min<0?Math.abs(Z.value.x.min):Z.value.x.min>0?-Z.value.x.min:0;return J.value.left+((e||0)+t)/(Z.value.x.max+t)*J.value.width}function ir(e){let t=Z.value.y.min<0?Math.abs(Z.value.y.min):Z.value.y.min>0?-Z.value.y.min:0;return J.value.bottom-((e||0)+t)/(Z.value.y.max+t)*J.value.height}let Q=d(()=>X.value.filter(e=>!N.value.includes(e.seriesIndex)).map((e,t)=>{let n=e.values.map((t,n)=>({valueX:t.x,valueY:t.y,label:t.label,x:rr(t.x),y:ir(t.y),color:e.color,seriesName:e.name,id:oe()})),r=e.smooth?ae(n):n.map(e=>`${e.x},${e.y} `).join(``).trim();return{...e,gradientIndex:t,plots:n,path:`M${r}`}})),ar=d(()=>{if(P.value===null||F.value===null)return Q.value;let e=Q.value.findIndex(e=>e.seriesIndex===F.value);if(e===-1)return Q.value;let t=Q.value[e];return[...Q.value.slice(0,e),...Q.value.slice(e+1),t]}),or=d(()=>Q.value.some(e=>sr(e)));function sr(e){return Array.isArray(e?.temperatureColors)&&e.temperatureColors.length}function cr(e){return sr(e)&&e.usePlotTemperatureColors}function lr(e){let t=Array.isArray(e?.plots)?e.plots:[];if(!t.length)return{minX:0,maxX:0,minY:0,maxY:0,width:0,height:0};let n=t.map(e=>e.x),r=t.map(e=>e.y),i=Math.min(...n),a=Math.max(...n),o=Math.min(...r),s=Math.max(...r);return{minX:i,maxX:a,minY:o,maxY:s,width:a-i,height:s-o}}function ur(){let e=J.value;return{minX:e.left,maxX:e.right,minY:e.top,maxY:e.bottom,width:e.width,height:e.height}}function dr(e){return e?.temperatureIndependant?lr(e):ur()}function fr(e){let t=Qn(e?.temperatureAngle)*Math.PI/180,n=Math.sin(t),r=Math.cos(t),i=dr(e),a=i.minX+i.width/2,o=i.minY+i.height/2,s=(Math.abs(n)*i.width+Math.abs(r)*i.height)/2||1;return{x1:a-n*s,y1:o-r*s,x2:a+n*s,y2:o+r*s}}function pr(e,t){let{x1:n,y1:r,x2:i,y2:a}=fr(e),o=i-n,s=a-r,c=o*o+s*s;if(!c)return 0;let ee=((t.x-n)*o+(t.y-r)*s)/c;return Math.min(1,Math.max(0,ee))}function $(e,t){return c({colors:e.temperatureColors,ratio:pr(e,t)})}function mr(e,t){return`temperature_plot_grad_history_${e.seriesIndex}_${t.id}_${M.value}`}function hr(e,t,n){return cr(e)?R.value.gradient.show?`url(#${mr(e,t)})`:$(e,t):R.value.gradient.show?`url(#gradient_${n}_${M.value})`:t.color}function gr(e,t){return cr(e)?$(e,t):e.color}function _r(e,t){return R.value.indexLabels.adaptColorToBackground?he(gr(e,t)):R.value.indexLabels.color}function vr(e,t){let n=Q.value.find(t=>t.seriesIndex===e);return n&&cr(n)?$(n,t):t.color}function yr(e){return sr(e)?`url(#temperature_grad_history_${e.seriesIndex}_${M.value})`:V.value.paths.useSerieColor?e.color:V.value.paths.stroke}function br(e){return P.value===null||F.value===e?1:Math.min(1,R.value.unselectedOpacity)}d(()=>P.value!==null&&F.value!==null);let xr=S(!1);function Sr(){N.value.length?N.value=[]:Dr.value.forEach(e=>{N.value.push(e.seriesIndex)}),Tn(`selectLegend`,Q.value)}function Cr(e){N.value.includes(e)?N.value=N.value.filter(t=>t!==e):N.value.push(e),Tn(`selectLegend`,Q.value)}function wr(e){return X.value.length?X.value.find(t=>t.name===e)||(On.value&&console.warn(`VueUiHistoryPlot - Series name not found "${e}"`),null):(On.value&&console.warn(`VueUiHistoryPlot - There are no series to show.`),null)}function Tr(e){let t=wr(e);t!==null&&N.value.includes(t.seriesIndex)&&Cr(t.seriesIndex)}function Er(e){let t=wr(e);t!==null&&(N.value.includes(t.seriesIndex)||Cr(t.seriesIndex))}let Dr=d(()=>X.value.map(e=>{let t=sr(e)?e.temperatureColors:null;return{...e,gradientColors:t,opacity:N.value.includes(e.seriesIndex)?.5:1,segregate:()=>Cr(e.seriesIndex),isSegregated:N.value.includes(e.seriesIndex),shape:t?`gradient`:`circle`}})),Or=d(()=>({cy:`history-plot-div-legend`,backgroundColor:V.value.legend.backgroundColor,color:V.value.legend.color,fontSize:V.value.legend.fontSize,paddingBottom:12,fontWeight:V.value.legend.bold?`bold`:``}));function kr({datapoint:e,plotIndex:t,seriesIndex:n}){L.value.events.datapointClick&&L.value.events.datapointClick({datapoint:{...e,plotIndex:t,seriesIndex:n},seriesIndex:n}),Tn(`selectDatapoint`,e)}function Ar(e){dn.value=e,sn.value+=1}let jr=S(null);function Mr({datapoint:e,plotIndex:t,seriesIndex:n}){L.value.events.datapointLeave&&L.value.events.datapointLeave({datapoint:{...e,plotIndex:t,seriesIndex:n},seriesIndex:n}),(Sn.value!==`keyboard`||F.value!==n||I.value!==t)&&(ln.value=!1,P.value=null)}function Nr(e,t){if(!W.value)return;let n=Q.value.find(t=>t.seriesIndex===e);if(!n)return;let r=n.plots[t];if(!r)return;let i=_e(r.x,r.y,W.value);i&&(xn.value=i)}function Pr({datapoint:e,plotIndex:t,seriesIndex:n,triggerMode:r=`pointer`}){L.value.events.datapointEnter&&L.value.events.datapointEnter({datapoint:{...e,plotIndex:t,seriesIndex:n},seriesIndex:n}),F.value=n,I.value=t,Sn.value=r,xr.value=!0;let i=vr(n,e),o={...e,color:i};jr.value={datapoint:o,color:i,seriesIndex:n,plotIndex:t,config:L.value,series:X.value},P.value=e;let c=V.value.tooltip.customFormat;if(fn.value=!1,s(c))try{let e=c({seriesIndex:n,datapoint:o,color:i,plotIndex:t,series:X.value,config:L.value});typeof e==`string`&&(un.value=e,fn.value=!0)}catch{console.warn(`Custom format cannot be applied.`),fn.value=!1}if(!fn.value){let t=``;t+=`<div style="display:flex;flex-direction:row;gap:6px;align-items:center;border-bottom:1px solid ${V.value.tooltip.borderColor};margin-bottom:3px;padding-bottom:6px;"><svg viewBox="0 0 12 12" height="14" width="14"><circle cx="6" cy="6" r="6" stroke="none" fill="${i}"/></svg><span>${e.seriesName}</span></div>`,t+=`<div>${e.label}</div>`,t+=`<div>${B.value.x.name.text||`x`}: ${ue(B.value.x.labels.formatter,e.valueX,a({p:B.value.x.labels.prefix,v:e.valueX,s:B.value.x.labels.suffix,r:B.value.x.labels.rounding}))}</div>`,t+=`<div>${B.value.y.name.text||`y`}: ${ue(B.value.y.labels.formatter,e.valueY,a({p:B.value.y.labels.prefix,v:e.valueY,s:B.value.y.labels.suffix,r:B.value.y.labels.rounding}))}</div>`,un.value=`<div>${t}</div>`}ln.value=!0,r===`keyboard`&&Qe(()=>{Nr(n,t)})}d(()=>({head:Q.value.map(e=>({name:e.name,color:e.color}))}));let Fr=d(()=>{let e=[L.value.table.columnNames.series,L.value.table.columnNames.datapoint,L.value.table.columnNames.x,L.value.table.columnNames.y];return{head:e,body:Q.value.flatMap(e=>e.plots.map(e=>[{color:e.color,name:e.seriesName},e.label,ue(B.value.x.labels.formatter,e.valueX,a({p:B.value.x.labels.prefix,v:e.valueX,s:B.value.x.labels.suffix,r:B.value.x.labels.rounding})),ue(B.value.y.labels.formatter,e.valueY,a({p:B.value.y.labels.prefix,v:e.valueY,s:B.value.y.labels.suffix,r:B.value.y.labels.rounding}))])),config:{th:{backgroundColor:L.value.table.th.backgroundColor,color:L.value.table.th.color,outline:L.value.table.th.outline},td:{backgroundColor:L.value.table.td.backgroundColor,color:L.value.table.td.color,outline:L.value.table.td.outline},breakpoint:L.value.table.responsiveBreakpoint},colNames:e}});function Ir(e=null){Qe(()=>{let t=[[L.value.table.columnNames.series],[L.value.table.columnNames.datapoint],[L.value.table.columnNames.x],[L.value.table.columnNames.y]],n=Q.value.flatMap(e=>e.plots.map(e=>[[e.seriesName],[e.label],[e.valueX],[e.valueY]])),r=[[V.value.title.text],[V.value.title.subtitle.text],t].concat(n),i=o(r);e?e(i):pe({csvContent:i,title:V.value.title.text||`vue-ui-history-plot`})})}let Lr=S(!1);function Rr(){Lr.value=!Lr.value}function zr(){G.value.showTable=!G.value.showTable}function Br(){G.value.showTooltip=!G.value.showTooltip}function Vr(){return Q.value}let Hr=Oe(k,()=>V.value.title.text),Ur=d(()=>Z.value.tickX),Wr=d(()=>({start:0,end:Z.value.tickX.length}));Re({timeLabelsEls:yn,timeLabels:Ur,slicer:Wr,configRef:L,rotationPath:[`style`,`chart`,`axes`,`x`,`labels`,`rotation`],autoRotatePath:[`style`,`chart`,`axes`,`x`,`labels`,`autoRotate`,`enable`],isAutoSize:!1,width:Gn,height:Kn,targetClass:`.vue-ui-history-plot-x-axis-scale`,rotation:B.value.x.labels.autoRotate.angle});let Gr=d(()=>Me({config:L,style:V,mutableConfig:G,dialog:Zt,accordion:Kt,isFullscreen:dn,parent:k,maxWidth:800}));it(()=>G.value.showTable,e=>je(e,L,hn));function Kr(){G.value.showTable=!1,gn.value&&gn.value.setTableIconState(!1)}let qr=d(()=>V.value.backgroundColor),Jr=d(()=>V.value.legend),Yr=d(()=>V.value.title),{isCallbackImaging:Xr,isCallbackSvg:Zr,generateSvg:Qr,onGenerateImage:$r}=Ae({svg:W,title:Yr,legend:Jr,legendItems:Dr,backgroundColor:qr,getSvgCallback:()=>L.value.userOptions.callbacks.svg,generateImage:Hn});async function ei(){Tn(`copyAlt`,{config:L.value,dataset:Q.value}),L.value.userOptions.callbacks.altCopy?await Promise.resolve(L.value.userOptions.callbacks.altCopy({config:L.value,dataset:Q.value})):console.warn("Vue Data UI - A callback must be set for `altCopy` in userOptions.")}let ti=d(()=>({head:Fr.value.head,body:Fr.value.body.map(e=>[e[0]?.name||``,e[1],e[2],e[3]]),caption:L.value.a11y.translations.tableCaption,notice:L.value.a11y.translations.tableAvailable}));function ni(e){return Q.value.findIndex(t=>t.seriesIndex===e)}function ri(){if(F.value!==null&&I.value!==null){let e=Q.value.find(e=>e.seriesIndex===F.value)?.plots?.[I.value];e&&Mr({datapoint:e,plotIndex:I.value,seriesIndex:F.value})}F.value=null,I.value=null,Sn.value=`pointer`,ln.value=!1,P.value=null}function ii(){F.value=null,I.value=null,Cn.value=!0}function ai(){ri(),Cn.value=!1}function oi(e,t){if(!e?.plots?.length)return null;let n=e.plots.length;return(t%n+n)%n}function si({seriesIndex:e,plotIndex:t,direction:n}){if(!Q.value.length)return null;let r=ni(e);if(r===-1)return null;if(n===`up`||n===`down`){let e=Q.value[r];if(!e?.plots?.length)return null;let i=oi(e,t+(n===`up`?-1:1));return{seriesIndex:e.seriesIndex,plotIndex:i}}if(n===`left`||n===`right`){let e=((r+(n===`left`?-1:1))%Q.value.length+Q.value.length)%Q.value.length,i=Q.value[e];if(!i?.plots?.length)return null;let a=Math.min(t,i.plots.length-1);return{seriesIndex:i.seriesIndex,plotIndex:a}}return null}function ci(e){if(!W.value||Lr.value||document.activeElement!==W.value||!Q.value.length)return;let t=e.key===`ArrowLeft`,n=e.key===`ArrowRight`,r=e.key===`ArrowUp`,i=e.key===`ArrowDown`,a=e.key===`Enter`||e.key===` `,o=e.key===`Escape`;if(!t&&!n&&!r&&!i&&!a&&!o)return;if(e.preventDefault(),e.stopPropagation(),o){ri();return}if(a){if(F.value===null||I.value===null)return;let e=Q.value.find(e=>e.seriesIndex===F.value)?.plots?.[I.value];if(!e)return;kr({datapoint:e,plotIndex:I.value,seriesIndex:F.value});return}let s=null;if(F.value===null||I.value===null){let e=Q.value[0];if(!e?.plots?.length)return;s={seriesIndex:e.seriesIndex,plotIndex:0}}else r?s=si({seriesIndex:F.value,plotIndex:I.value,direction:`up`}):i?s=si({seriesIndex:F.value,plotIndex:I.value,direction:`down`}):t?s=si({seriesIndex:F.value,plotIndex:I.value,direction:`left`}):n&&(s=si({seriesIndex:F.value,plotIndex:I.value,direction:`right`}));if(!s)return;let c=Q.value.find(e=>e.seriesIndex===s.seriesIndex)?.plots?.[s.plotIndex];c&&Pr({datapoint:c,plotIndex:s.plotIndex,seriesIndex:s.seriesIndex,triggerMode:`keyboard`})}return Te({getData:Vr,getImage:Hr,generatePdf:Vn,generateCsv:Ir,generateImage:Hn,generateSvg:Qr,hideSeries:Er,showSeries:Tr,toggleTable:zr,toggleTooltip:Br,toggleAnnotator:Rr,toggleFullscreen:Ar,copyAlt:ei}),it(()=>[K.value,Y.value,B.value,V.value,L.value.style.fontFamily,O.dataset,En.value,bn.value,yn.value,_n.value,vn.value],Yn,{flush:`post`,deep:!0}),(e,i)=>(x(),m(`div`,{id:`history_plot_${M.value}`,ref_key:`historyPlotChart`,ref:k,class:v({"vue-data-ui-component":!0,"vue-ui-history-plot":!0,"vue-data-ui-wrapper-fullscreen":dn.value}),style:b(`background:${V.value.backgroundColor};color:${V.value.color};font-family:${L.value.style.fontFamily}; position: relative; ${L.value.responsive?`height: 100%`:``}`),onMouseenter:i[2]||=()=>E(In)(!0),onMouseleave:i[3]||=()=>E(In)(!1)},[h(`div`,{id:`chart-instructions-${M.value}`,class:`sr-only`},[h(`p`,null,T(L.value.a11y.translations.keyboardNavigation),1)],8,st),ti.value.body.length?(x(),f(He,{key:0,uid:M.value,head:ti.value.head,body:ti.value.body,caption:ti.value.caption,notice:ti.value.notice},null,8,[`uid`,`head`,`body`,`caption`,`notice`])):p(``,!0),w(e.$slots,`userConfig`,{},void 0,!0),L.value.userOptions.buttons.annotator?(x(),f(E(Jt),Ze({key:1},E(n)(L.value.userOptions.annotator),{svgRef:E(W),backgroundColor:V.value.backgroundColor,color:V.value.color,active:Lr.value,isCursorPointer:U.value,palette:L.value.userOptions.annotatorPalette,onClose:Rr}),Je({_:2},[C(E(r),n=>({name:n,fn:D(r=>[w(e.$slots,n,y(_(E(t)(n,r))),void 0,!0)])}))]),1040,[`svgRef`,`backgroundColor`,`color`,`active`,`isCursorPointer`,`palette`])):p(``,!0),Un.value?(x(),m(`div`,{key:2,ref_key:`noTitle`,ref:cn,class:`vue-data-ui-no-title-space`,style:`height:36px; width: 100%;background:transparent`},null,512)):p(``,!0),V.value.title.text?(x(),m(`div`,{key:3,ref_key:`chartTitle`,ref:tn,class:`vue-ui-xy-title`,style:b(`font-family:${L.value.style.fontFamily}`)},[(x(),f(ke,{key:`title_${nn.value}`,config:{title:{cy:`history-plot-div-title`,...V.value.title},subtitle:{cy:`history-plot-div-subtitle`,...V.value.title.subtitle}}},null,8,[`config`]))],4)):p(``,!0),h(`div`,{id:`legend-top-${M.value}`},null,8,ct),L.value.userOptions.show&&wn.value&&(E(Ln)||E(Fn))?(x(),f(E(Yt),{ref_key:`userOptionsRef`,ref:gn,key:`user_option_${sn.value}`,backgroundColor:V.value.backgroundColor,color:V.value.color,isPrinting:E(zn),isImaging:E(Bn),uid:M.value,hasTooltip:V.value.tooltip.show&&L.value.userOptions.buttons.tooltip,hasPdf:L.value.userOptions.buttons.pdf,hasImg:L.value.userOptions.buttons.img,hasSvg:L.value.userOptions.buttons.svg,hasXls:L.value.userOptions.buttons.csv,hasTable:L.value.userOptions.buttons.table,hasLabel:!1,hasFullscreen:L.value.userOptions.buttons.fullscreen,hasAltCopy:L.value.userOptions.buttons.altCopy,isFullscreen:dn.value,chartElement:k.value,position:L.value.userOptions.position,isTooltip:G.value.showTooltip,titles:{...L.value.userOptions.buttonTitles},hasAnnotator:L.value.userOptions.buttons.annotator,isAnnotation:Lr.value,callbacks:L.value.userOptions.callbacks,printScale:L.value.userOptions.print.scale,tableDialog:L.value.table.useDialog,isCursorPointer:U.value,onToggleFullscreen:Ar,onGeneratePdf:E(Vn),onGenerateCsv:Ir,onGenerateImage:E($r),onGenerateSvg:E(Qr),onToggleTable:zr,onToggleTooltip:Br,onToggleAnnotator:Rr,onCopyAlt:ei,style:b({visibility:E(Ln)?E(Fn)?`visible`:`hidden`:`visible`})},Je({_:2},[C(E(Ne)(e.$slots,`menuIcon optionTooltip optionPdf optionCsv optionImg optionSvg optionTable optionFullscreen optionAnnotator optionAltCopy custom-menu-before custom-menu-after`),t=>({name:t,fn:D(n=>[w(e.$slots,t,y(_(E(Pe)(t,n))),void 0,!0)])}))]),1032,/* @__PURE__ */ `backgroundColor.color.isPrinting.isImaging.uid.hasTooltip.hasPdf.hasImg.hasSvg.hasXls.hasTable.hasFullscreen.hasAltCopy.isFullscreen.chartElement.position.isTooltip.titles.hasAnnotator.isAnnotation.callbacks.printScale.tableDialog.isCursorPointer.onGeneratePdf.onGenerateImage.onGenerateSvg.style`.split(`.`))):p(``,!0),h(`div`,lt,[(x(),m(`svg`,{ref_key:`svgRef`,ref:W,xmlns:E(ge),viewBox:`0 0 ${K.value.width<0?.1:K.value.width} ${K.value.height<0?.1:K.value.height}`,style:b(`max-width:100%;overflow:visible;background:transparent;color:${V.value.color};visibility:${E(Jn)?`visible`:`hidden`}`),"aria-describedby":`chart-instructions-${M.value}`,tabindex:`0`,onFocus:ii,onBlur:ai,onKeydown:ci},[Xe(E(Xt)),w(e.$slots,`svg-underlayer`,{svg:{...K.value,drawingArea:J.value,isPrintingImg:E(zn)||E(Bn)||E(Xr),isPrintingSvg:E(Zr)}},void 0,!0),e.$slots[`chart-background`]?(x(),m(`foreignObject`,{key:0,x:J.value.left,y:J.value.top,width:J.value.width<=0?10:J.value.width,height:J.value.height<=0?10:J.value.height,style:{pointerEvents:`none`}},[w(e.$slots,`chart-background`,{},void 0,!0)],8,dt)):p(``,!0),R.value.gradient.show||or.value?(x(),m(`defs`,ft,[R.value.gradient.show?(x(!0),m(u,{key:0},C(Q.value,(e,t)=>(x(),f(Be,{t:`radial`,key:`gradient_${t}_${M.value}`,id:`gradient_${t}_${M.value}`,fy:`30%`,stops:[[`10%`,E(ee)(e.color,R.value.gradient.intensity/100),1],[`90%`,E(re)(e.color,.1),1],[`100%`,e.color,1]]},null,8,[`id`,`stops`]))),128)):p(``,!0),(x(!0),m(u,null,C(Q.value,e=>(x(),m(u,{key:`temperature_grad_history_template_${e.seriesIndex}_${M.value}`},[R.value.gradient.show&&cr(e)?(x(!0),m(u,{key:0},C(e.plots,t=>(x(),f(Be,{t:`radial`,key:`temperature_plot_grad_history_${e.seriesIndex}_${t.id}_${M.value}`,id:mr(e,t),fy:`30%`,stops:[[`10%`,E(ee)($(e,t),R.value.gradient.intensity/100),1],[`90%`,E(re)($(e,t),.1),1],[`100%`,$(e,t),1]]},null,8,[`id`,`stops`]))),128)):p(``,!0),sr(e)?(x(),m(`linearGradient`,{key:1,id:`temperature_grad_history_${e.seriesIndex}_${M.value}`,gradientUnits:`userSpaceOnUse`,x1:fr(e).x1,y1:fr(e).y1,x2:fr(e).x2,y2:fr(e).y2},[(x(!0),m(u,null,C(e.temperatureColors,(t,n)=>(x(),m(`stop`,{key:`temperature_grad_history_stop_${e.seriesIndex}_${n}_${M.value}`,"stop-color":t,offset:e.temperatureColors.length===1?`0%`:E(me)(n,e.temperatureColors.length)},null,8,mt))),128))],8,pt)):p(``,!0)],64))),128))])):p(``,!0),z.value.verticalLines.show?(x(),m(`g`,ht,[(x(!0),m(u,null,C(Z.value.tickX,e=>(x(),m(`line`,{x1:e.x,x2:e.x,y1:e.y1,y2:e.y2,stroke:z.value.verticalLines.stroke,"stroke-width":z.value.verticalLines.strokeWidth,"stroke-linecap":`round`},null,8,gt))),256))])):p(``,!0),B.value.y.labels.show?(x(),m(`g`,_t,[(x(!0),m(u,null,C(Z.value.tickY,e=>(x(),m(`line`,{stroke:z.value.verticalLines.stroke,"stroke-width":z.value.verticalLines.strokeWidth,"stroke-linecap":`round`,x1:J.value.left-5,x2:J.value.left,y1:e.y,y2:e.y},null,8,vt))),256))])):p(``,!0),B.value.y.labels.show?(x(),m(`g`,{key:4,ref_key:`yAxisScales`,ref:bn},[(x(!0),m(u,null,C(Z.value.tickY,e=>(x(),m(`text`,{x:J.value.left+B.value.y.labels.offsetX-4-R.value.radius,y:e.y+Y.value.yAxisLabels/3,fill:B.value.y.labels.color,"font-size":Y.value.yAxisLabels,"text-anchor":`end`},T(E(ue)(B.value.y.labels.formatter,e.value,E(a)({p:B.value.y.labels.prefix,v:e.value,s:B.value.y.labels.suffix,r:B.value.y.labels.rounding}))),9,yt))),256))],512)):p(``,!0),B.value.y.name.text?(x(),m(`text`,{key:5,ref_key:`yAxisLabel`,ref:vn,transform:`translate(${Y.value.yAxisName}, ${K.value.height/2+B.value.y.name.offsetY}), rotate(-90)`,"font-size":Y.value.yAxisName,fill:B.value.y.name.color,"font-weight":B.value.y.name.bold?`bold`:`normal`,"text-anchor":`middle`},T(B.value.y.name.text),9,bt)):p(``,!0),z.value.horizontalLines.show?(x(),m(`g`,xt,[(x(!0),m(u,null,C(Z.value.tickY,e=>(x(),m(`line`,{x1:e.x1,x2:e.x2,y1:e.y,y2:e.y,stroke:z.value.horizontalLines.stroke,"stroke-width":z.value.horizontalLines.strokeWidth,"stroke-linecap":`round`},null,8,St))),256))])):p(``,!0),B.value.x.labels.show?(x(),m(`g`,Ct,[(x(!0),m(u,null,C(Z.value.tickX,e=>(x(),m(`line`,{stroke:z.value.verticalLines.stroke,"stroke-width":z.value.verticalLines.strokeWidth,"stroke-linecap":`round`,x1:e.x,x2:e.x,y1:J.value.bottom,y2:J.value.bottom+5},null,8,wt))),256))])):p(``,!0),B.value.x.labels.show?(x(),m(`g`,{key:8,ref_key:`xAxisScales`,ref:yn},[(x(!0),m(u,null,C(Z.value.tickX,e=>(x(),m(`text`,{class:`vue-ui-history-plot-x-axis-scale`,transform:`translate(${e.x}, ${J.value.bottom+B.value.x.labels.offsetY+Y.value.xAxisLabels+R.value.radius}), rotate(${B.value.x.labels.rotation})`,fill:B.value.x.labels.color,"font-size":Y.value.xAxisLabels,"text-anchor":B.value.x.labels.rotation>0?`start`:B.value.x.labels.rotation<0?`end`:`middle`},T(E(ue)(B.value.x.labels.formatter,e.value,E(a)({p:B.value.x.labels.prefix,v:e.value,s:B.value.x.labels.suffix,r:B.value.x.labels.rounding}))),9,Tt))),256))],512)):p(``,!0),B.value.x.name.text?(x(),m(`text`,{key:9,ref_key:`xAxisLabel`,ref:_n,x:K.value.width/2+B.value.x.name.offsetX,y:K.value.height,"font-size":Y.value.xAxisName,fill:B.value.x.name.color,"font-weight":B.value.x.name.bold?`bold`:`normal`,"text-anchor":`middle`},T(B.value.x.name.text),9,Et)):p(``,!0),z.value.xAxis.show?(x(),m(`line`,{key:10,x1:J.value.left,x2:J.value.left+J.value.width,y1:J.value.bottom,y2:J.value.bottom,stroke:z.value.xAxis.stroke,"stroke-width":z.value.xAxis.strokeWidth,"stroke-linecap":`round`},null,8,Dt)):p(``,!0),z.value.yAxis.show?(x(),m(`line`,{key:11,x1:J.value.left,x2:J.value.left,y1:J.value.top,y2:J.value.bottom,stroke:z.value.yAxis.stroke,"stroke-width":z.value.yAxis.strokeWidth,"stroke-linecap":`round`},null,8,Ot)):p(``,!0),(x(!0),m(u,null,C(ar.value,e=>(x(),m(`g`,{key:`history_plot_serie_${e.seriesIndex}_${M.value}`},[V.value.paths.show?(x(),m(`g`,{key:0,style:b({opacity:br(e.seriesIndex)})},[h(`path`,{class:v({"vue-data-ui-transition":E(H)&&!E(q)}),d:e.path,stroke:V.value.backgroundColor,"stroke-width":V.value.paths.strokeWidth+4,fill:`none`,"stroke-linecap":`round`,"stroke-linejoin":`round`},null,10,kt),h(`path`,{class:v({"vue-data-ui-transition":E(H)&&!E(q)}),d:e.path,stroke:yr(e),"stroke-width":V.value.paths.strokeWidth,fill:`none`,"stroke-linecap":`round`,"stroke-linejoin":`round`},null,10,At)],4)):p(``,!0),(x(!0),m(u,null,C(e.plots,e=>(x(),m(`circle`,{cx:e.x,cy:e.y,fill:V.value.backgroundColor,r:Y.value.plots,stroke:`none`,class:v({"vue-data-ui-transition":E(H)&&!E(q)})},null,10,jt))),256)),(x(!0),m(u,null,C(e.plots,t=>(x(),m(`circle`,{cx:t.x,cy:t.y,fill:hr(e,t,e.gradientIndex),r:Y.value.plots,stroke:R.value.stroke,"stroke-width":R.value.strokeWidth,class:v({"vue-data-ui-transition":E(H)&&!E(q)}),style:b({opacity:br(e.seriesIndex)})},null,14,Mt))),256)),R.value.labels.show?(x(),m(`g`,Nt,[(x(!0),m(u,null,C(e.plots,(t,n)=>(x(),m(`g`,{key:`plab_${n}`},[String(t.label).includes(`
2
- `)?(x(),m(`text`,{key:1,class:v({"vue-data-ui-transition":E(H)&&!E(q)}),transform:`translate(${t.x+R.value.labels.offsetX}, ${t.y+R.value.labels.offsetY+Y.value.plots+Y.value.labels})`,"font-size":Y.value.labels,fill:R.value.labels.color,"font-weight":R.value.labels.bold?`bold`:`normal`,"text-anchor":`middle`,style:b({opacity:br(e.seriesIndex)}),innerHTML:E(ne)({content:String(t.label),fontSize:Y.value.labels,fill:R.value.labels.color,x:0,y:0})},null,14,Ft)):(x(),m(`text`,{key:0,class:v({"vue-data-ui-transition":E(H)&&!E(q)}),transform:`translate(${t.x+R.value.labels.offsetX}, ${t.y+R.value.labels.offsetY+Y.value.plots+Y.value.labels})`,"font-size":Y.value.labels,fill:R.value.labels.color,"font-weight":R.value.labels.bold?`bold`:`normal`,"text-anchor":`middle`,style:b({opacity:br(e.seriesIndex)})},T(t.label),15,Pt))]))),128))])):p(``,!0),R.value.indexLabels.show?(x(),m(`g`,It,[(x(!0),m(u,null,C(e.plots,(t,n)=>(x(),m(`text`,{key:`lab_${n}`,class:v({"vue-data-ui-transition":E(H)&&!E(q)}),transform:`translate(${t.x+R.value.indexLabels.offsetX}, ${t.y+R.value.indexLabels.offsetY+Y.value.indexLabels/3})`,"font-size":Y.value.indexLabels,"font-weight":R.value.indexLabels.bold?`bold`:`normal`,fill:_r(e,t),"text-anchor":`middle`,style:b({opacity:br(e.seriesIndex)})},T(R.value.indexLabels.startAtZero?n:n+1),15,Lt))),128))])):p(``,!0)]))),128)),(x(!0),m(u,null,C(ar.value,e=>(x(),m(`g`,{key:`history_plot_trap_serie_${e.seriesIndex}_${M.value}`},[(x(!0),m(u,null,C(e.plots,(t,n)=>(x(),m(`circle`,{cx:t.x,cy:t.y,fill:`transparent`,r:Y.value.plots,stroke:`none`,onMouseenter:r=>Pr({datapoint:t,plotIndex:n,seriesIndex:e.seriesIndex,triggerMode:`pointer`}),onMouseleave:r=>Mr({datapoint:t,plotIndex:n,seriesIndex:e.seriesIndex}),onClick:r=>kr({datapoint:t,plotIndex:n,seriesIndex:e.seriesIndex})},null,40,Rt))),256))]))),128)),w(e.$slots,`svg`,{svg:{...K.value,drawingArea:J.value,isPrintingImg:E(zn)||E(Bn)||E(Xr),isPrintingSvg:E(Zr)}},void 0,!0)],44,ut)),e.$slots.hint?(x(),m(`div`,zt,[w(e.$slots,`hint`,y(_({hint:L.value.a11y.translations.keyboardNavigation,isVisible:Cn.value})),void 0,!0)])):p(``,!0)]),e.$slots.watermark?(x(),m(`div`,Bt,[w(e.$slots,`watermark`,y(_({isPrinting:E(zn)||E(Bn)||E(Xr)||E(Zr)})),void 0,!0)])):p(``,!0),h(`div`,{id:`legend-bottom-${M.value}`},null,8,Vt),mn.value&&(V.value.legend.show||e.$slots.legend)?(x(),f(qe,{key:6,to:V.value.legend.position===`top`?`#legend-top-${M.value}`:`#legend-bottom-${M.value}`},[h(`div`,{ref_key:`chartLegend`,ref:rn},[w(e.$slots,`legend`,{legend:Dr.value},()=>[V.value.legend.show&&wn.value?(x(),f(Ge,{key:`legend_${an.value}`,legendSet:Dr.value,config:Or.value,isCursorPointer:U.value,onClickMarker:i[0]||=({legend:e})=>{Cr(e.seriesIndex)}},{item:D(({legend:e,index:t})=>[h(`div`,{onClick:t=>e.segregate(),style:b(`opacity:${N.value.includes(e.seriesIndex)?.5:1}`)},T(e.name),13,Ht)]),legendToggle:D(()=>[Dr.value.length>2&&V.value.legend.selectAllToggle.show&&!E(Mn)?(x(),f(Ve,{key:0,backgroundColor:V.value.legend.selectAllToggle.backgroundColor,color:V.value.legend.selectAllToggle.color,fontSize:V.value.legend.fontSize,checked:N.value.length>0,isCursorPointer:U.value,onToggle:Sr},null,8,[`backgroundColor`,`color`,`fontSize`,`checked`,`isCursorPointer`])):p(``,!0)]),_:1},8,[`legendSet`,`config`,`isCursorPointer`])):p(``,!0)],!0)],512)],8,[`to`])):p(``,!0),e.$slots.source?(x(),m(`div`,{key:7,ref_key:`source`,ref:pn,dir:`auto`},[w(e.$slots,`source`,{},void 0,!0)],512)):p(``,!0),Xe(E(Wt),{teleportTo:V.value.tooltip.teleportTo,show:G.value.showTooltip&&ln.value,backgroundColor:V.value.tooltip.backgroundColor,color:V.value.tooltip.color,fontSize:V.value.tooltip.fontSize,borderRadius:V.value.tooltip.borderRadius,borderColor:V.value.tooltip.borderColor,borderWidth:V.value.tooltip.borderWidth,backgroundOpacity:V.value.tooltip.backgroundOpacity,position:V.value.tooltip.position,offsetX:V.value.tooltip.offsetX,offsetY:V.value.tooltip.offsetY,parent:k.value,content:un.value,isCustom:fn.value,isFullscreen:dn.value,smooth:V.value.tooltip.smooth,backdropFilter:V.value.tooltip.backdropFilter,smoothForce:V.value.tooltip.smoothForce,smoothSnapThreshold:V.value.tooltip.smoothSnapThreshold,isA11yMode:Sn.value===`keyboard`,a11yPosition:xn.value},{"tooltip-before":D(()=>[w(e.$slots,`tooltip-before`,y(_({...jr.value})),void 0,!0)]),tooltip:D(()=>[w(e.$slots,`tooltip`,y(_({...jr.value})),void 0,!0)]),"tooltip-after":D(()=>[w(e.$slots,`tooltip-after`,y(_({...jr.value})),void 0,!0)]),_:3},8,[`teleportTo`,`show`,`backgroundColor`,`color`,`fontSize`,`borderRadius`,`borderColor`,`borderWidth`,`backgroundOpacity`,`position`,`offsetX`,`offsetY`,`parent`,`content`,`isCustom`,`isFullscreen`,`smooth`,`backdropFilter`,`smoothForce`,`smoothSnapThreshold`,`isA11yMode`,`a11yPosition`]),wn.value&&L.value.userOptions.buttons.table?(x(),f(tt(Gr.value.component),Ze({key:8},Gr.value.props,{ref_key:`tableUnit`,ref:hn,onClose:Kr}),Je({content:D(()=>[(x(),f(E(qt),{key:`table_${on.value}`,colNames:Fr.value.colNames,head:Fr.value.head,body:Fr.value.body,config:Fr.value.config,title:L.value.table.useDialog?``:Gr.value.title,withCloseButton:!L.value.table.useDialog,isCursorPointer:U.value,onClose:Kr},{th:D(({th:e})=>[h(`div`,Ut,T(e),1)]),td:D(({td:e})=>[Ye(T(e.name||e),1)]),_:1},8,[`colNames`,`head`,`body`,`config`,`title`,`withCloseButton`,`isCursorPointer`]))]),_:2},[L.value.table.useDialog?{name:`title`,fn:D(()=>[Ye(T(Gr.value.title),1)]),key:`0`}:void 0,L.value.table.useDialog?{name:`actions`,fn:D(()=>[h(`button`,{tabindex:`0`,class:`vue-ui-user-options-button`,onClick:i[1]||=e=>Ir(L.value.userOptions.callbacks.csv),style:b({cursor:U.value?`pointer`:`default`})},[Xe(E(Gt),{name:`fileCsv`,stroke:Gr.value.props.color},null,8,[`stroke`])],4)]),key:`1`}:void 0]),1040)):p(``,!0),w(e.$slots,`skeleton`,{},()=>[E(Mn)?(x(),f(Se,{key:0})):p(``,!0)],!0)],46,ot))}},[[`__scopeId`,`data-v-bf1fef0d`]]);export{at as n,Wt as t};
@@ -1,4 +0,0 @@
1
- import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{n as t,r as n,t as r}from"./annotationSlots-OLiW25XN.js";import{t as i}from"./useConfig-By3Vb5kz.js";import{$ as a,D as o,Dt as s,Ht as c,J as l,Jt as ee,S as te,X as ne,Yt as re,Zt as ie,at as ae,b as u,i as oe,in as se,nn as ce,nt as le,pt as ue,t as de,tn as fe,vt as pe,w as me,wt as he,zt as ge}from"./lib-rPeBMZrn.js";import{n as _e,t as ve}from"./BaseScanner-8NdoBs7B.js";import{n as ye,t as be}from"./useHints-C-TwxM0Y.js";import{t as xe}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{t as Se}from"./useNestedProp-DnGoh-XS.js";import{t as Ce}from"./useThemeCheck-BKNRbGeC.js";import{t as we}from"./chartImage-DPGnEuYM.js";import{n as Te}from"./Title-BliHuXfT.js";import{t as Ee}from"./useChartExport-BZts4KFb.js";import{n as De,t as Oe}from"./tableIntegration-CNoJ1CIY.js";import{n as ke,t as Ae}from"./userOptionsSlots-DYuo-E5m.js";import{t as je}from"./usePrinter-DVf3YcG5.js";import{t as Me}from"./useTransitions-ChGGrtrv.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"./vue-ui-accordion-DFxSW8ET.js";import{t as Re}from"./BaseLegendToggle-BIzyyI1h.js";import{t as ze}from"./A11yDataTable-DWNlWXzs.js";import{t as Be}from"./useUserOptionState-CXlFnwPv.js";import{t as Ve}from"./useChartAccessibility-DOMuYJfm.js";import{t as He}from"./useTableResponsive-uSz_qZOB.js";import{t as Ue}from"./Legend-DM0ClX3D.js";import{t as We}from"./vue_ui_horizontal_bar-C4ulIxeT.js";import{Fragment as d,computed as f,createBlock as p,createCommentVNode as m,createElementBlock as h,createElementVNode as g,createSlots as Ge,createTextVNode as Ke,createVNode as qe,defineAsyncComponent as Je,guardReactiveProps as Ye,mergeProps as Xe,nextTick as Ze,normalizeClass as _,normalizeProps as v,normalizeStyle as y,onBeforeUnmount as Qe,onMounted as $e,openBlock as b,ref as x,renderList as S,renderSlot as C,resolveDynamicComponent as et,toDisplayString as w,toRefs as tt,unref as T,useCssVars as nt,useSlots as rt,watch as it,withCtx as E,withKeys as at}from"vue";var ot=/* @__PURE__ */ e({default:()=>Jt}),st=[`id`],ct=[`id`],lt=[`onClick`],ut={style:{position:`relative`}},dt=[`xmlns`,`viewBox`,`aria-describedby`],ft=[`width`,`height`],pt={key:1},mt=[`y`,`width`,`height`,`fill`,`rx`],ht=[`x`,`y`,`width`,`height`,`fill`,`rx`],gt=[`x`,`y`,`width`,`height`,`fill`,`rx`,`stroke`,`stroke-width`],_t=[`x`,`y`,`width`,`height`,`fill`,`rx`,`stroke`,`stroke-width`],vt=[`stroke`,`stroke-width`,`d`],yt=[`stroke`,`stroke-width`,`d`],bt=[`y`,`height`,`width`,`fill`],xt=[`transform`,`font-size`,`fill`,`font-weight`,`innerHTML`],St=[`transform`,`font-size`,`fill`,`font-weight`],Ct=[`transform`,`font-size`,`font-weight`,`innerHTML`],wt=[`transform`,`font-size`,`fill`,`font-weight`,`innerHTML`],Tt=[`transform`,`text-anchor`,`font-size`,`fill`,`font-weight`],Et=[`y`,`width`,`height`,`fill`,`onMouseenter`,`onMouseleave`,`onClick`],Dt={key:0,style:{position:`absolute`,top:`100%`,left:`0`,width:`100%`},"data-dom-to-png-ignore":``,"aria-hidden":`true`},Ot={key:7,class:`vue-data-ui-watermark`},kt=[`onClick`],At={style:`width:100%;padding-top: 36px;position:relative`},jt={class:`vue-ui-data-table`},Mt={key:0},Nt={style:{width:`100%`}},Pt=[`data-cell`],Ft={style:{display:`flex`,"align-items":`center`,gap:`5px`,"justify-content":`flex-end`,width:`100%`,"padding-right":`3px`}},It=[`data-cell`],Lt={style:{display:`flex`,"align-items":`center`,gap:`5px`,"justify-content":`flex-end`,width:`100%`,"padding-right":`3px`}},Rt=[`data-cell`],zt={style:{display:`flex`,"align-items":`center`,gap:`5px`,"justify-content":`flex-end`,width:`100%`,"padding-right":`3px`}},Bt=[`data-cell`],Vt={style:{display:`flex`,"align-items":`center`,gap:`5px`,"justify-content":`flex-end`,width:`100%`,"padding-right":`3px`}},Ht=[`data-cell`],Ut={style:{display:`flex`,"align-items":`center`,gap:`5px`,"justify-content":`flex-end`,width:`100%`,"padding-right":`3px`}},Wt=[`data-cell`],Gt={style:{display:`flex`,"align-items":`center`,gap:`5px`,"justify-content":`flex-end`,width:`100%`,"padding-right":`3px`}},Kt=[`data-cell`],qt={style:{display:`flex`,"align-items":`center`,gap:`5px`,"justify-content":`flex-end`,width:`100%`,"padding-right":`3px`}},Jt=/*#__PURE__*/ xe({__name:`vue-ui-horizontal-bar`,props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:[`selectLegend`,`copyAlt`,`selectDatapoint`],setup(e,{expose:xe,emit:ot}){nt(e=>({v35bfb3fb:e.tdo}));let Jt=Je(()=>import(`./Tooltip-C1q0Qoh7.js`)),Yt=Je(()=>import(`./BaseIcon-CoY0vuL3.js`).then(e=>e.n)),Xt=Je(()=>import(`./PenAndPaper-DoNTA-SV.js`).then(e=>e.t)),Zt=Je(()=>import(`./UserOptions-DW84OKKr.js`).then(e=>e.n)),Qt=Je(()=>import(`./PackageVersion-Bczw6rsP.js`).then(e=>e.t)),$t=Je(()=>import(`./BaseDraggableDialog-BK7dj9O6.js`).then(e=>e.n)),{vue_ui_vertical_bar:en}=i(),{isThemeValid:tn,warnInvalidTheme:nn}=Ce(),rn=rt(),D=e,an=f({get(){return!!D.dataset&&D.dataset.length},set(e){return e}}),O=x(ne()),on=x(!1),sn=x(``),cn=x(null),ln=x(0),k=x(null),un=x(null),dn=x(null),fn=x(null),pn=x(null),mn=x(0),hn=x(0),gn=x(null),_n=x(null),vn=x(null),yn=x(null),bn=x(null),A=x([]),xn=x({none:0,asc:1,desc:2}),Sn=x(0),Cn=x(0),wn=null,Tn=null,j=x(null),En=x({x:0,y:0}),Dn=x(`pointer`),On=ot,M=x(zn()),N=f(()=>M.value.style.chart.layout.bars),P=f(()=>M.value.style.chart.layout),F=f(()=>M.value.style.chart.tooltip),I=f(()=>M.value.style.chart);ye({config:()=>M.value,dataset:()=>D.dataset,component:`VueUiHorizontalBar`,rules:[be.emptyArray,{test:e=>e.length>50||e.some(e=>e.children&&e.children.length>50),message:[`👀 There are > 50 series / bars, which will probably force users to scroll. Consider:`,``,`▶️ Grouping small values into an "Other" category.`,``,`▶️ Using filters, or several instances of the component with subsets of related series.`]}]});let{transitionEnabled:L}=Me({config:()=>M.value.transitions,dataset:()=>D.dataset}),kn=f(()=>M.value.userOptions.useCursorPointer),An=f(()=>D.config?.skeletonDataset??[{name:``,value:6,color:`#d9d9d9`},{name:``,value:5,color:`#d9d9d9`},{name:``,value:4,color:`#d9d9d9`},{name:``,value:3,color:`#d9d9d9`},{name:``,value:2,color:`#d9d9d9`},{name:``,value:1,color:`#d9d9d9`}]),jn=f(()=>se({defaultConfig:{useCssAnimation:!1,userOptions:{show:!1},table:{show:!1},style:{chart:{backgroundColor:`#99999930`,layout:{bars:{offsetX:110,dataLabels:{color:`transparent`,value:{prefix:``,suffix:``,formatter:null}},nameLabels:{color:`transparent`}},separators:{color:`#7A7A7A`}},legend:{show:!0,backgroundColor:`transparent`,color:`transparent`,prefix:``,suffix:``,formatter:null},title:{color:`#1A1A1A`,subtitle:{color:`#5A5A5A`}}}}},userConfig:M.value.skeletonConfig??{}})),{loading:Mn,FINAL_DATASET:Nn,manualLoading:Pn}=_e({...tt(D),FINAL_CONFIG:M,prepareConfig:zn,callback:()=>{Promise.resolve().then(async()=>{H.value.showTable=M.value.table.show,Qn()})},skeletonDataset:An.value,skeletonConfig:se({defaultConfig:M.value,userConfig:jn.value})}),{userOptionsVisible:Fn,setUserOptionsVisibility:In,keepUserOptionState:Ln}=Be({config:M.value}),{svgRef:Rn}=Ve({config:I.value.title});function zn(){let e=Se({userConfig:D.config,defaultConfig:en}),t={},n=e.theme;if(n){if(!tn.value(e))nn(e),t=e;else{let r=Se({userConfig:We[n]||D.config,defaultConfig:e});t={...Se({userConfig:D.config,defaultConfig:r}),customPalette:e.customPalette.length?e.customPalette:ce[n]||c}}}else t=e;return D.config&&he(D.config,`events.datapointEnter`)?t.events.datapointEnter=D.config.events.datapointEnter:t.events.datapointEnter=null,D.config&&he(D.config,`events.datapointLeave`)?t.events.datapointLeave=D.config.events.datapointLeave:t.events.datapointLeave=null,D.config&&he(D.config,`events.datapointClick`)?t.events.datapointClick=D.config.events.datapointClick:t.events.datapointClick=null,t}let R=x(I.value.width),z=x(I.value.height),B=x(N.value.gap),Bn=ie(D.config);it(()=>D.config,(e,t)=>{let n=ie(e),r=n!==Bn;Bn=n;let i=zn();r?(Mn.value||(M.value=i),Fn.value=!M.value.userOptions.showOnChartHover,mn.value+=1,hn.value+=1,H.value.showTable=M.value.table.show,Sn.value=xn.value[N.value.sort]??0,H.value.showTooltip=F.value.show,R.value=I.value.width,z.value=I.value.height,B.value=N.value.gap):(M.value.style.chart.tooltip=i.style.chart.tooltip,H.value.showTooltip=M.value.style.chart.tooltip.show)},{deep:!0}),it(()=>D.dataset,e=>{Array.isArray(e)&&e.length>0&&(Pn.value=!1)},{deep:!0});let{isPrinting:Vn,isImaging:Hn,generatePdf:Un,generateImage:Wn}=je({elementId:`vue-ui-vertical-bar_${O.value}`,fileName:I.value.title.text||`vue-ui-vertical-bar`,options:M.value.userOptions.print}),Gn=f(()=>M.value.userOptions.show&&!I.value.title.text),Kn=f(()=>me(M.value.customPalette)),qn=x(null),Jn=f(()=>M.value.table.responsiveBreakpoint),Yn=f(()=>M.value.debug),Xn=x(0),V=x(null),Zn=x(null);function Qn(){if(k.value&&(ge(D.dataset)&&(ae({componentName:`VueUiVerticalBar`,type:`dataset`,debug:Yn.value}),an.value=!1,Pn.value=!0),ge(D.dataset)||(Pn.value=M.value.loading),M.value.responsive)){let e=Pe(()=>{let{width:e,height:t}=Fe({chart:k.value,title:I.value.title.text?un.value:null,legend:I.value.legend.show?dn.value:null,source:fn.value,noTitle:pn.value});Xn.value=t/3,requestAnimationFrame(async()=>{z.value=t,R.value=e})});V.value&&(Zn.value&&V.value.unobserve(Zn.value),V.value.disconnect()),V.value=new ResizeObserver(e),Ze(()=>{Zn.value=k.value?.parentNode,Zn.value&&V.value.observe(Zn.value)})}}Qe(()=>{V.value&&(Zn.value&&V.value.unobserve(Zn.value),V.value.disconnect())});let H=x({showTable:M.value.table.show,showTooltip:F.value.show}),$n=f(()=>Sn.value===0),er=f(()=>Sn.value===2),U=f(()=>(Nn.value.forEach((e,t)=>{!e.value&&!e.children&&ae({componentName:`VueUiVerticalBar`,type:`datasetAttributeEmpty`,property:`value (index ${t})`,debug:Yn.value}),e.children&&(ge(e.children)?ae({componentName:`VueUiVerticalBar`,type:`datasetAttributeEmpty`,property:`children (index ${t})`,debug:Yn.value}):e.children.forEach((e,t)=>{[null,void 0].includes(e.name)&&ae({componentName:`VueUiVerticalBar`,type:`datasetSerieAttribute`,property:`name`,key:`children`,index:t,debug:Yn.value})}))}),Nn.value.map((e,t)=>{let n=`vertical_parent_${t}_${O.value}`,r=e.children&&e.children.length>0,i=u(e.value?e.value:r?e.children.map(e=>e.value||0).reduce((e,t)=>e+t,0):0),a=i>=0?1:-1;return{...e,id:n,absoluteIndex:t,shape:`square`,opacity:A.value.includes(n)?.5:1,value:Math.abs(i),sign:a,hasChildren:r,isChild:!1,segregate:()=>mr(n),isSegregated:A.value.includes(n),color:te(e.color)||Kn.value[t]||c[t]||c[t%c.length],children:!e.children||!e.children.length?[]:e.children.toSorted($n.value?()=>0:(e,t)=>er.value?t.value-e.value:e.value-t.value).map((r,o)=>({...r,value:u(Math.abs(r.value)),absoluteIndex:t,sign:r.value>=0?1:-1,isChild:!0,parentId:n,parentName:e.name,parentValue:i,parentSign:a,id:`vertical_child_${t}_${o}_${O.value}`,childIndex:o,color:te(r.color)||te(e.color)||Kn.value[t]||c[t]||c[t%c.length]})).map((t,n)=>({...t,isFirstChild:n===0,isLastChild:n===e.children.length-1}))}}).toSorted($n.value?()=>0:(e,t)=>er.value?t.value-e.value:e.value-t.value))),W=f(()=>U.value.filter(e=>!A.value.includes(e.id))),G=f(()=>W.value.flatMap(e=>e.hasChildren?e.children:e)),tr=f(()=>U.value.flatMap(e=>e.hasChildren?e.children:e)),nr=f(()=>W.value.flatMap(e=>e.children&&e.children.length>0?e.children.length:1).reduce((e,t)=>e+t,0)),rr=f(()=>({cy:`vertical-bar-div-legend`,backgroundColor:I.value.legend.backgroundColor,color:I.value.legend.color,fontSize:I.value.legend.fontSize,paddingBottom:12,fontWeight:I.value.legend.bold?`bold`:``})),K=f(()=>N.value.parentLabels.show?N.value.parentLabels.fontSize*3+N.value.parentLabels.paddingBottom:0),q=f(()=>{let e=[],t=0;return G.value.forEach((n,r)=>{n.isChild&&n.childIndex===0&&N.value.parentLabels.show&&(t+=1),e[r]=t}),e}),J=f(()=>{let e=Math.max(0,...q.value)*K.value;return(z.value-24-(nr.value-1)*B.value-e)/nr.value}),Y=f(()=>({width:R.value,height:z.value,padding:{top:12,left:128+N.value.offsetX,right:64+N.value.paddingRight,bottom:12}})),ir=x(0);function ar(){Ze(()=>{if(!bn.value){ir.value=0;return}let e=Array.from(bn.value.querySelectorAll(`text`)).reduce((e,t)=>{let n=t.getBBox?.().width??t.getComputedTextLength();return n>e?n:e},0);ir.value=e+12})}it(()=>[G.value,R.value,z.value,N.value.nameLabels,N.value.offsetX],()=>ar(),{deep:!0}),$e(()=>{ar()});function or(){return typeof document>`u`?null:(wn||(wn=document.createElement(`canvas`),Tn=wn.getContext(`2d`)),Tn)}function sr(e){let t=String(e??``),n=N.value,r=n.dataLabels.fontSize,i=n.dataLabels.bold?700:400,a=M.value.style.fontFamily,o=or();return o?(o.font=`${i} ${r}px ${a}`,o.measureText(t).width):t.length*r*.6}function cr(){let e=W.value.flatMap(e=>e.children&&e.children.length?e.children.map(e=>Math.abs(e.value)):Math.abs(e.value));return e.length?Math.max(...e):0}let lr=f(()=>{Cn.value;let e=N.value,t=ir.value+Math.abs(e.nameLabels.offsetX)+e.offsetX,n=Y.value.width-Y.value.padding.right,r=Math.max(0,n-t-e.offsetX),i=Y.value.width-40,a=cr(),o=G.value.map((e,t)=>({serie:e,textWidth:sr(Mr(e.value,e,t,e.sign))}));if(!o.length||r<=0)return{left:0,right:0};if(!o.some(({serie:e})=>e.sign===-1)){let n=o.reduce((n,{serie:o,textWidth:s})=>{let c=a?Math.abs(o.value)/a:0;if(c<=0||s<=0)return n;let l=(t+r*c+3+e.dataLabels.offsetX+s-i)/c;return Math.max(n,l)},0);return{left:0,right:Math.ceil(Math.min(r,Math.max(0,n)))}}let s=t+r/2,c=-1/0,l=1/0;o.forEach(({serie:t,textWidth:n})=>{if(t.sign===-1){let t=s+12+e.dataLabels.offsetX+n;l=Math.min(l,i-t);return}let r=s-12-e.dataLabels.offsetX-n;c=Math.max(c,40-r)});let ee=0;ee=c>l?(c+l)/2:Math.min(l,Math.max(c,0));let te=ee*2;return te>=0?{left:Math.ceil(Math.min(r,te)),right:0}:{left:0,right:Math.ceil(Math.min(r,-te))}}),ur=f(()=>lr.value.right),dr=f(()=>lr.value.left);function fr(){Cn.value+=1}$e(()=>{typeof document<`u`&&document.fonts&&(document.fonts.ready.then(fr),document.fonts.addEventListener?.(`loadingdone`,fr))}),Qe(()=>{typeof document<`u`&&document.fonts&&document.fonts.removeEventListener?.(`loadingdone`,fr),wn=null,Tn=null});let X=f(()=>{let e=ir.value+Math.abs(N.value.nameLabels.offsetX)+dr.value+N.value.offsetX,t=Y.value.width-Y.value.padding.right,n=Math.max(0,t-e-ur.value-N.value.offsetX);return{top:Y.value.padding.top,bottom:Y.value.padding.top+Y.value.height,left:e,right:t,width:n,fullHeight:Y.value.padding.top+Y.value.padding.bottom+Y.value.height}});function pr(){A.value.length?A.value=[]:U.value.forEach(e=>{A.value.push(e.id)}),On(`selectLegend`,W.value)}async function mr(e){if(A.value.includes(e))A.value=A.value.filter(t=>t!==e);else{if(A.value.length===U.value.length-1)return;A.value.push(e)}On(`selectLegend`,W.value)}function hr(e){return U.value.length?U.value.find(t=>t.name===e)||(Yn.value&&console.warn(`VueUiHorizontalBar - Series name not found "${e}"`),null):(Yn.value&&console.warn(`VueUiHorizontalBar - There are no series to show.`),null)}function gr(e){let t=hr(e);t!==null&&A.value.includes(t.id)&&mr(t.id)}function _r(e){let t=hr(e);t!==null&&(A.value.includes(t.id)||mr(t.id))}let Z=f(()=>W.value.map(e=>Math.abs(e.value)).reduce((e,t)=>e+t,0));function vr(e,t=!1,n=0){return t?a({v:u(Math.abs(e)/Z.value*100),s:`%`,r:n}):Math.abs(e)/Z.value}let yr=f(()=>G.value.map(e=>e.sign).includes(-1)),br=f(()=>Math.max(...W.value.flatMap(e=>e.children&&e.children.length?Math.max(...e.children.map(e=>e.value)):e.value)));function Q(e){let t=e/br.value;return u(X.value.width/(yr.value?2:1)*t)}function xr(e){return Q(e)+X.value.left}function Sr(e,t){let n=W.value.find(t=>t.id===e.parentId);return{y:X.value.top+(B.value+J.value)*t+q.value[t]*K.value-K.value+N.value.parentLabels.fontSize,name:n.name,value:[void 0,NaN,null].includes(n.value)?``:n.sign===1?n.value:-n.value,percentageToTotal:isNaN(n.value/Z.value)?``:vr(n.value,!0,N.value.dataLabels.percentage.roundingPercentage),sign:n.sign}}function Cr(){return W.value}function wr(e,t){return Sr(e,t).name}function Tr(e,t){let n=Sr(e,t);return Mr(n.value,n,t,e.parentSign||e.sign)}let Er=x(null),Dr=x(null);function Or({datapoint:e,seriesIndex:t}){On(`selectDatapoint`,e),M.value.events.datapointClick&&M.value.events.datapointClick({datapoint:e,seriesIndex:t})}function kr({datapoint:e,seriesIndex:t}){M.value.events.datapointLeave&&M.value.events.datapointLeave({datapoint:e,seriesIndex:t}),cn.value=null,on.value=!1,Er.value=null,j.value===t&&(j.value=null)}function Ar(e,t,n=`pointer`){Dn.value=n,M.value.events.datapointEnter&&M.value.events.datapointEnter({datpoint:e,seriesIndex:t}),j.value=t,cn.value=e,Dr.value={datapoint:e,seriesIndex:t,series:U.value,config:M.value},on.value=!0,Er.value=e.id;let r=``,i=e.isChild?e.parentName:e.name,o=e.isChild?e.name:``,c=F.value.customFormat;s(c)&&ue(()=>c({datapoint:e,series:U.value,config:M.value,seriesIndex:t}))?sn.value=c({datapoint:e,series:U.value,config:M.value,seriesIndex:t}):(r+=`<div style="width:100%;text-align:center;border-bottom:1px solid ${F.value.borderColor};padding-bottom:6px;margin-bottom:3px;text-align:left;">
2
- <div style="display:flex;align-items:center;gap:4px;"><svg viewBox="0 0 60 60" height="14" width="14"><rect x="0" y="0" height="60" width="60" rx="5" stroke="none" fill="${e.color}"/>${rn.pattern?`<rect x="0" y="0" height="60" width="60" rx="5" stroke="none" fill="url(#pattern_${O.value}_${e.absoluteIndex})"/>`:``}</svg> ${i}</div>
3
- ${o?`<div>${o}</div>`:``}
4
- </div>`,F.value.showValue&&(r+=`<div>${M.value.translations.value}: <b>${oe(N.value.dataLabels.value.formatter,e.sign===1?e.value:-e.value,a({p:F.value.prefix,v:e.sign===1?e.value:-e.value,s:F.value.suffix,r:F.value.roundingValue}),{datapoint:e,seriesIndex:t})}</b></div>`),F.value.showPercentage&&(r+=`<div>${M.value.translations.percentageToTotal} : <b>${a({v:Math.abs(e.value)/Z.value*100,s:`%`,r:F.value.roundingPercentage})}</b></div>`,e.isChild&&(r+=`<div>${M.value.translations.percentageToSerie}: <b>${a({v:Math.abs(e.value)/Math.abs(e.parentValue)*100,s:`%`,r:F.value.roundingPercentage})}</b></div>`)),sn.value=`<div style="text-align:left">${r}</div>`)}function jr({legend:e,index:t}){let n=I.value.legend;return n.showValue?`${e.name}: ${oe(N.value.dataLabels.value.formatter,e.value,a({p:n.prefix,v:e.value,s:n.suffix,r:n.roundingValue}),{datapoint:e,seriesIndex:t})}`:e.name}function Mr(e,t,n,r){if(!N.value.dataLabels.value.show)return``;let i=oe(N.value.dataLabels.value.formatter,u(r===-1&&e>=0?-e:e),a({p:N.value.dataLabels.value.prefix,v:u(r===-1&&e>=0?-e:e),s:N.value.dataLabels.value.suffix,r:N.value.dataLabels.value.roundingValue}),{datapoint:t,seriesIndex:n}),o=`(${vr(e,!0,N.value.dataLabels.percentage.roundingPercentage)})`;return`${i}${N.value.dataLabels.percentage.show?` ${o}`:``}`}let $=f(()=>({head:[M.value.translations.parentName,M.value.translations.value,M.value.translations.percentageToTotal,M.value.translations.childName,M.value.translations.value,M.value.translations.percentageToSerie,M.value.translations.percentageToTotal],body:G.value.map(e=>e.isChild?e.isFirstChild?{color:e.color,parentName:e.parentName,parentValue:e.parentValue,percentageToTotal:e.parentValue/Z.value,childName:e.name,childValue:e.sign===1?e.value:-e.value,childPercentageToParent:Math.abs(e.value)/Math.abs(e.parentValue),childPercentageToTotal:Math.abs(e.value)/Z.value}:{color:``,parentName:``,parentValue:``,percentageToTotal:``,childName:e.name,childValue:e.sign===1?e.value:-e.value,childPercentageToParent:Math.abs(e.value)/Math.abs(e.parentValue),childPercentageToTotal:Math.abs(e.value)/Z.value}:{color:e.color,parentName:e.name,parentValue:e.sign===1?e.value:-e.value,percentageToTotal:Math.abs(e.value)/Z.value,childName:``,childValue:``,childPercentageToParent:``,childPercentageToTotal:``})}));function Nr(e=null){let t=[[I.value.title.text],[I.value.title.subtitle.text],[``]],n=$.value.head,r=$.value.body.map(e=>[e.parentName,e.parentValue,e.percentageToTotal,e.childName,e.childValue,e.childPercentageToParent,e.childPercentageToTotal]),i=t.concat([n]).concat(r),a=o(i);e?e(a):le({csvContent:a,title:I.value.title.text||`vue-ui-vertical-bar`})}let Pr=x(!1);function Fr(e){Pr.value=e,ln.value+=1}function Ir(){H.value.showTable=!H.value.showTable}$e(()=>{[`none`,`asc`,`desc`].includes(N.value.sort)||ae({componentName:`VueUiVerticalBar`,type:`attributeWrongValue`,property:`style.chart.layout.bars.sort`,key:N.value.sort}),Sn.value=xn.value[N.value.sort]??0});function Lr(){Sn.value+=1,Sn.value>2&&(Sn.value=0)}function Rr(){Lr()}function zr(){H.value.showTooltip=!H.value.showTooltip}let Br=x(!1);function Vr(){Br.value=!Br.value}let Hr=we(k,()=>I.value.title.text),Ur=f(()=>Oe({config:M,style:I,mutableConfig:H,dialog:$t,accordion:Le,isFullscreen:Pr,parent:k,maxWidth:800,isCursorPointer:kn}));it(()=>H.value.showTable,e=>De(e,M,_n));let{isResponsive:Wr}=He(qn,Jn);function Gr(){H.value.showTable=!1,vn.value&&vn.value.setTableIconState(!1)}let Kr=f(()=>U.value.map((e,t)=>({...e,shape:`square`,display:`${e.name}: ${oe(N.value.dataLabels.value.formatter,e.value,a({p:I.value.legend.prefix,v:e.value,s:I.value.legend.suffix,r:I.value.legend.roundingValue}),{datapoint:e,seriesIndex:t})}`}))),qr=f(()=>I.value.backgroundColor),Jr=f(()=>I.value.legend),Yr=f(()=>I.value.title),Xr=f(()=>Kr.value.map(e=>({...e,name:e.display}))),{isCallbackImaging:Zr,isCallbackSvg:Qr,generateSvg:$r,onGenerateImage:ei}=Ee({svg:Rn,title:Yr,legend:Jr,legendItems:Xr,backgroundColor:qr,getSvgCallback:()=>M.value.userOptions.callbacks.svg,generateImage:Wn});function ti(){console.warn(`[autoSize]: this legacy method can be safely removed as it has no impact.`)}async function ni(){On(`copyAlt`,{config:M.value,dataset:W.value}),M.value.userOptions.callbacks.altCopy?await Promise.resolve(M.value.userOptions.callbacks.altCopy({config:M.value,dataset:W.value})):console.warn("Vue Data UI - A callback must be set for `altCopy` in userOptions.")}let ri=x(!1);function ii(){j.value=null,ri.value=!0}function ai(){j.value=null,on.value=!1,ri.value=!1}function oi(){if(j.value===null)return;let e=G.value[j.value];e&&kr({datapoint:e,seriesIndex:j.value}),j.value=null,Dn.value=`pointer`}function si(e){if(!Rn.value||Br.value||document.activeElement!==Rn.value)return;let t=e.key===`ArrowRight`||e.key===`ArrowDown`,n=e.key===`ArrowLeft`||e.key===`ArrowUp`,r=e.key===`Enter`||e.key===` `,i=e.key===`Escape`;if(!t&&!n&&!r&&!i)return;let a=G.value.length;if(!a)return;if(e.preventDefault(),e.stopPropagation(),i){oi();return}if(r){if(j.value===null)return;let e=G.value[j.value];if(!e)return;Or({datapoint:e,seriesIndex:j.value});return}let o=j.value,s=cn.value?G.value.findIndex(e=>e.id===cn.value.id):null;o!==null&&o>=0&&o<a?t?(o+=1,o>=a&&(o=0)):n&&(--o,o<0&&(o=a-1)):s!==null&&s>=0&&s<a?(o=t?s+1:s-1,o>=a&&(o=0),o<0&&(o=a-1)):o=t?0:a-1;let c=G.value[o];c&&(j.value=o,ci(c),Ar(c,o,`keyboard`))}function ci(e){if(!e)return;let t=X.value.right,n=X.value.top+(B.value+J.value)*e.absoluteIndex+q.value[e.absoluteIndex]*K.value;if(!Number.isFinite(t)||!Number.isFinite(n))return;let r=fe(t,n,Rn.value);r&&(En.value=r)}let li=f(()=>({head:$.value.head,body:$.value.body.map(e=>[e.parentName,e.parentValue===``?``:a({v:e.parentValue,r:N.value.dataLabels.value.roundingValue,p:N.value.dataLabels.prefix,s:N.value.dataLabels.suffix}),e.percentageToTotal===``?``:a({v:e.percentageToTotal*100,r:N.value.dataLabels.percentage.roundingPercentage,s:`%`}),e.childName,e.childValue===``?``:a({v:e.childValue,r:N.value.dataLabels.value.roundingValue,p:N.value.dataLabels.prefix,s:N.value.dataLabels.suffix}),e.childPercentageToParent===``?``:a({v:e.childPercentageToParent*100,r:N.value.dataLabels.percentage.roundingPercentage,s:`%`}),e.childPercentageToTotal===``?``:a({v:e.childPercentageToTotal*100,r:N.value.dataLabels.percentage.roundingPercentage,s:`%`})]),caption:M.value.a11y.translations.tableCaption,notice:M.value.a11y.translations.tableAvailable}));return xe({autoSize:ti,getData:Cr,getImage:Hr,generatePdf:Un,generateCsv:Nr,generateImage:Wn,generateSvg:$r,hideSeries:_r,showSeries:gr,toggleTable:Ir,toggleSort:Rr,toggleTooltip:zr,toggleAnnotator:Vr,toggleFullscreen:Fr,copyAlt:ni}),(e,i)=>(b(),h(`div`,{class:_(`vue-data-ui-component vue-ui-vertical-bar ${Pr.value?`vue-data-ui-wrapper-fullscreen`:``} ${M.value.useCssAnimation?``:`vue-ui-dna`} ${M.value.responsive?`vue-ui-vertical-bar-autosize`:``}`),ref_key:`verticalBarChart`,ref:k,id:`vue-ui-vertical-bar_${O.value}`,style:y(`font-family:${M.value.style.fontFamily};width:100%; text-align:center;background:${I.value.backgroundColor};height:100%`),onMouseenter:i[3]||=()=>T(In)(!0),onMouseleave:i[4]||=()=>T(In)(!1)},[g(`p`,{id:`chart-instructions-${O.value}`,class:`sr-only`},w(M.value.a11y.translations.keyboardNavigation),9,ct),li.value.body.length?(b(),p(ze,{key:0,uid:O.value,head:li.value.head,body:li.value.body,caption:li.value.caption,notice:li.value.notice},null,8,[`uid`,`head`,`body`,`caption`,`notice`])):m(``,!0),M.value.userOptions.buttons.annotator?(b(),p(T(Xt),Xe({key:1},T(n)(M.value.userOptions.annotator),{svgRef:T(Rn),backgroundColor:I.value.backgroundColor,color:I.value.color,active:Br.value,isCursorPointer:kn.value,palette:M.value.userOptions.annotatorPalette,onClose:Vr}),Ge({_:2},[S(T(r),n=>({name:n,fn:E(r=>[C(e.$slots,n,v(Ye(T(t)(n,r))),void 0,!0)])}))]),1040,[`svgRef`,`backgroundColor`,`color`,`active`,`isCursorPointer`,`palette`])):m(``,!0),Gn.value?(b(),h(`div`,{key:2,ref_key:`noTitle`,ref:pn,class:`vue-data-ui-no-title-space`,style:`height:36px; width: 100%;background:transparent`},null,512)):m(``,!0),I.value.title.text?(b(),h(`div`,{key:3,ref_key:`chartTitle`,ref:un,style:`width:100%;background:transparent;padding-bottom:12px`},[(b(),p(Te,{key:`title_${mn.value}`,config:{title:{cy:`vertical-bar-div-title`,...I.value.title},subtitle:{cy:`vertical-bar-div-subtitle`,...I.value.title.subtitle}}},null,8,[`config`]))],512)):m(``,!0),M.value.userOptions.show&&an.value&&(T(Ln)||T(Fn))?(b(),p(T(Zt),{ref_key:`userOptionsRef`,ref:vn,backgroundColor:I.value.backgroundColor,color:I.value.color,key:`user_options_${ln.value}`,isImaging:T(Hn),isPrinting:T(Vn),uid:O.value,hasTooltip:M.value.userOptions.buttons.tooltip&&F.value.show,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,hasSort:M.value.userOptions.buttons.sort,hasFullscreen:M.value.userOptions.buttons.fullscreen,hasAltCopy:M.value.userOptions.buttons.altCopy,isFullscreen:Pr.value,isTooltip:H.value.showTooltip,titles:{...M.value.userOptions.buttonTitles},chartElement:k.value,position:M.value.userOptions.position,hasAnnotator:M.value.userOptions.buttons.annotator,isAnnotation:Br.value,callbacks:M.value.userOptions.callbacks,printScale:M.value.userOptions.print.scale,tableDialog:M.value.table.useDialog,isCursorPointer:kn.value,onToggleFullscreen:Fr,onGeneratePdf:T(Un),onGenerateCsv:Nr,onGenerateImage:T(ei),onGenerateSvg:T($r),onToggleTable:Ir,onToggleSort:Rr,onToggleTooltip:zr,onToggleAnnotator:Vr,onCopyAlt:ni,style:y({visibility:T(Ln)?T(Fn)?`visible`:`hidden`:`visible`})},Ge({_:2},[S(T(ke)(e.$slots,`menuIcon optionTooltip optionPdf optionCsv optionImg optionSvg optionTable optionLabels optionSort optionFullscreen optionAnnotator optionAltCopy custom-menu-before custom-menu-after`),t=>({name:t,fn:E(n=>[C(e.$slots,t,v(Ye(T(Ae)(t,n))),void 0,!0)])}))]),1032,/* @__PURE__ */ `backgroundColor.color.isImaging.isPrinting.uid.hasTooltip.hasPdf.hasImg.hasSvg.hasXls.hasTable.hasSort.hasFullscreen.hasAltCopy.isFullscreen.isTooltip.titles.chartElement.position.hasAnnotator.isAnnotation.callbacks.printScale.tableDialog.isCursorPointer.onGeneratePdf.onGenerateImage.onGenerateSvg.style`.split(`.`))):m(``,!0),e.$slots.legend&&I.value.legend.show&&I.value.legend.position===`top`?C(e.$slots,`legend`,{legend:U.value},void 0,!0,5):m(``,!0),!e.$slots.legend&&I.value.legend.show&&I.value.legend.position===`top`?(b(),h(`div`,{key:6,ref_key:`chartLegend`,ref:dn},[(b(),p(Ue,{key:`legend_top_${hn.value}`,legendSet:U.value,config:rr.value,onClickMarker:i[0]||=({legend:e})=>mr(e.id)},Ge({item:E(({legend:e,index:t})=>[g(`div`,{onClick:t=>mr(e.id),style:y(`opacity:${A.value.includes(e.id)?.5:1}`)},w(jr({legend:e,index:t})),13,lt)]),legendToggle:E(()=>[U.value.length>2&&I.value.legend.selectAllToggle.show&&!T(Mn)?(b(),p(Re,{key:0,backgroundColor:I.value.legend.selectAllToggle.backgroundColor,color:I.value.legend.selectAllToggle.color,fontSize:I.value.legend.fontSize,checked:A.value.length>0,onToggle:pr},null,8,[`backgroundColor`,`color`,`fontSize`,`checked`])):m(``,!0)]),_:2},[e.$slots.pattern?{name:`legend-pattern`,fn:E(({legend:e,index:t})=>[qe(Ne,{shape:e.shape,radius:30,stroke:`none`,plot:{x:30,y:30},fill:`url(#pattern_${O.value}_${t})`},null,8,[`shape`,`fill`])]),key:`0`}:void 0]),1032,[`legendSet`,`config`]))],512)):m(``,!0),g(`div`,ut,[(b(),h(`svg`,{ref_key:`svgRef`,ref:Rn,xmlns:T(de),class:_({"vue-data-ui-fullscreen--on":Pr.value,"vue-data-ui-fulscreen--off":!Pr.value,"vue-data-ui-no-transition":!T(L)}),viewBox:`0 0 ${R.value} ${z.value}`,style:y(`max-width:100%;overflow:visible;background:transparent;color:${I.value.color}`),tabindex:`0`,"aria-describedby":`chart-instructions-${O.value}`,onFocus:ii,onBlur:ai,onKeydown:si},[g(`g`,{ref_key:`G`,ref:gn,class:`vue-data-ui-g`},[qe(T(Qt)),C(e.$slots,`svg-underlayer`,{svg:{...Y.value,drawingArea:X.value,isPrintingImg:T(Vn)||T(Hn)||T(Zr),isPrintingSvg:T(Qr)}},void 0,!0),e.$slots[`chart-background`]?(b(),h(`foreignObject`,{key:0,x:0,y:0,width:R.value,height:z.value,style:{pointerEvents:`none`}},[C(e.$slots,`chart-background`,{},void 0,!0)],8,ft)):m(``,!0),g(`defs`,null,[(b(!0),h(d,null,S(G.value,(e,t)=>(b(),p(Ie,{t:`linear`,x1:`0%`,y1:`0%`,x2:`100%`,y2:`0%`,id:`vertical_bar_gradient_${O.value}_${t}`,key:`vertical_bar_gradient_${O.value}_${t}`,stops:[[`0%`,e.color,1],[`100%`,T(ee)(T(re)(e.color,.03),100-N.value.gradientIntensity),1]]},null,8,[`id`,`stops`]))),128))]),e.$slots.pattern?(b(),h(`g`,pt,[(b(!0),h(d,null,S(G.value,t=>(b(),h(`defs`,null,[C(e.$slots,`pattern`,Xe({ref_for:!0},{seriesIndex:t.absoluteIndex,patternId:`pattern_${O.value}_${t.absoluteIndex}`}),void 0,!0)]))),256))])):m(``,!0),N.value.rowColor?(b(!0),h(d,{key:2},S(G.value,(e,t)=>(b(),h(`g`,{key:`row_${e.id}`},[g(`rect`,{x:0,y:X.value.top+(B.value+J.value)*t+q.value[t]*K.value,width:R.value,height:J.value<=0?1e-4:J.value,fill:N.value.rowColor,rx:N.value.rowRadius,style:{pointerEvents:`none`},class:_({"vue-data-ui-transition":T(L)})},null,10,mt)]))),128)):m(``,!0),(b(!0),h(d,null,S(G.value,(e,t)=>(b(),h(`g`,{key:`underlayer_${e.id}`},[g(`rect`,{x:T(u)(yr.value?X.value.left+X.value.width/2-(e.sign===1?0:Q(e.value)<=0?1e-4:Q(e.value)):X.value.left),y:X.value.top+(B.value+J.value)*t+q.value[t]*K.value,width:T(u)(Q(e.value)<=0?1e-4:Q(e.value)),height:J.value<=0?1e-4:J.value,fill:N.value.underlayerColor,rx:N.value.borderRadius,class:_({"vue-data-ui-transition":T(L)})},null,10,ht)]))),128)),(b(!0),h(d,null,S(G.value,(t,n)=>(b(),h(`g`,{key:`barloop_${t.id}`},[g(`rect`,{x:T(u)(yr.value?X.value.left+X.value.width/2-(t.sign===1?0:Q(t.value)<=0?1e-4:Q(t.value)):X.value.left),y:X.value.top+(B.value+J.value)*n+q.value[n]*K.value,width:T(u)(Q(t.value)<=0?1e-4:Q(t.value)),height:J.value<=0?1e-4:J.value,fill:N.value.useGradient?`url(#vertical_bar_gradient_${O.value}_${n})`:T(ee)(t.color,N.value.fillOpacity),rx:N.value.borderRadius,stroke:N.value.useStroke?t.color:`none`,"stroke-width":N.value.useStroke?N.value.strokeWidth:0,class:_({"vue-data-ui-transition":T(L)})},null,10,gt),e.$slots.pattern?(b(),h(`rect`,{key:0,x:T(u)(yr.value?X.value.left+X.value.width/2-(t.sign===1?0:Q(t.value)<=0?1e-4:Q(t.value)):X.value.left),y:X.value.top+(B.value+J.value)*n+q.value[n]*K.value,width:T(u)(Q(t.value)<=0?1e-4:Q(t.value)),height:J.value<=0?1e-4:J.value,fill:`url(#pattern_${O.value}_${t.absoluteIndex})`,rx:N.value.borderRadius,stroke:N.value.useStroke?t.color:`none`,"stroke-width":N.value.useStroke?N.value.strokeWidth:0,class:_({"vue-data-ui-transition":T(L)})},null,10,_t)):m(``,!0),(!t.isChild||t.isLastChild)&&P.value.separators.show&&n!==G.value.length-1?(b(),h(`path`,{key:1,stroke:P.value.separators.color,"stroke-width":P.value.separators.strokeWidth,"stroke-linecap":`round`,class:_({"vue-data-ui-transition":T(L)}),d:`M${R.value}, ${J.value+B.value/2+X.value.top+(B.value+J.value)*n+q.value[n]*K.value} ${P.value.separators.fullWidth?0:X.value.left}, ${J.value+B.value/2+X.value.top+(B.value+J.value)*n+q.value[n]*K.value}`},null,10,vt)):m(``,!0),yr.value&&P.value.separators.show?(b(),h(`path`,{key:2,stroke:P.value.separators.color,"stroke-width":P.value.separators.strokeWidth,"stroke-linecap":`round`,class:_({"vue-data-ui-transition":T(L)}),d:`M${X.value.left+X.value.width/2}, ${X.value.top} ${X.value.left+X.value.width/2}, ${X.value.bottom}`},null,10,yt)):m(``,!0)]))),128)),g(`g`,{ref_key:`parentLabels`,ref:yn},[(b(!0),h(d,null,S(G.value,(e,t)=>(b(),h(`g`,{key:`pn_${e.id}`,class:`vue-ui-horizontal-bar-parent-label`},[e.isChild&&e.childIndex===0&&N.value.parentLabels.show?(b(),h(`rect`,{key:0,class:_([`vue-ui-horizontal-bar-parent-marker`,{"vue-data-ui-transition":T(L)}]),x:2,y:Sr(e,t).y-N.value.parentLabels.fontSize/1.5,height:N.value.parentLabels.fontSize/1.5,width:N.value.parentLabels.fontSize/1.5,rx:1,fill:e.color},null,10,bt)):m(``,!0),e.isChild&&e.childIndex===0&&N.value.parentLabels.show?(b(),h(`text`,{key:1,class:_({"vue-data-ui-transition":T(L)}),transform:`translate(${N.value.parentLabels.offsetX+N.value.parentLabels.fontSize}, ${Sr(e,t).y})`,"font-size":N.value.parentLabels.fontSize,fill:N.value.parentLabels.color,"font-weight":N.value.parentLabels.bold?`bold`:`normal`,"text-anchor":`start`,innerHTML:T(l)({content:`${wr(e,t)}`,fontSize:N.value.parentLabels.fontSize,fill:P.value.bars.parentLabels.color,x:0,y:0,translateY:!1})},null,10,xt)):m(``,!0),e.isChild&&e.childIndex===0&&N.value.parentLabels.show?(b(),h(`text`,{key:2,class:_({"vue-data-ui-transition":T(L)}),transform:`translate(${N.value.parentLabels.offsetX+N.value.parentLabels.fontSize}, ${Sr(e,t).y+T(pe)(wr(e,t))*N.value.parentLabels.fontSize*1.1})`,"font-size":N.value.parentLabels.fontSize,fill:N.value.parentLabels.color,"font-weight":N.value.dataLabels.bold?`bold`:`normal`,"text-anchor":`start`},w(Tr(e,t)),11,St)):m(``,!0)]))),128))],512),g(`g`,{ref_key:`childLabels`,ref:bn},[(b(!0),h(d,null,S(tr.value,(e,t)=>(b(),h(`g`,{key:`cl_${e.id}`,class:`vue-ui-horizontal-bar-child-label`},[(e.isChild||!e.hasChildren)&&N.value.nameLabels.show?(b(),h(`text`,{key:0,"text-anchor":`start`,class:_({"vue-data-ui-transition":T(L)}),transform:`translate(${Math.abs(N.value.nameLabels.offsetX)}, ${T(u)(X.value.top+(B.value+J.value)*t+J.value/2+N.value.nameLabels.fontSize/2+q.value[t]*K.value)})`,"font-size":N.value.nameLabels.fontSize,fill:`transparent`,"font-weight":N.value.nameLabels.bold?`bold`:`normal`,style:{"user-select":`none`},innerHTML:T(l)({content:e.name,fontSize:N.value.nameLabels.fontSize,fill:`transparent`,x:0,y:0,translateY:!0})},null,10,Ct)):m(``,!0)]))),128))],512),g(`g`,null,[(b(!0),h(d,null,S(G.value,(e,t)=>(b(),h(`g`,{key:`vislab_${e.id}`,class:`vue-ui-horizontal-bar-child-label`},[(e.isChild||!e.hasChildren)&&N.value.nameLabels.show?(b(),h(`text`,{key:0,class:_({"vue-data-ui-transition":T(L)}),"text-anchor":`end`,transform:`translate(${X.value.left+N.value.nameLabels.offsetX-6}, ${X.value.top+(B.value+J.value)*t+J.value/2+N.value.nameLabels.fontSize/3+q.value[t]*K.value})`,"font-size":N.value.nameLabels.fontSize,fill:N.value.nameLabels.color,"font-weight":N.value.nameLabels.bold?`bold`:`normal`,innerHTML:T(l)({content:e.name,fontSize:N.value.nameLabels.fontSize,fill:P.value.bars.nameLabels.color,x:0,y:0,translateY:!0})},null,10,wt)):m(``,!0)]))),128))]),g(`g`,null,[(b(!0),h(d,null,S(G.value,(e,t)=>(b(),h(`g`,{key:`sdl_${e.id}`,class:`vue-ui-horizontal-bar-child-label`},[g(`text`,{class:_({"vue-data-ui-transition":T(L)}),transform:`translate(${yr.value?X.value.left+X.value.width/2+(e.sign===1?-12:12)+(e.sign===1?-P.value.bars.dataLabels.offsetX:P.value.bars.dataLabels.offsetX):Math.min(xr(e.value)+3+I.value.layout.bars.dataLabels.offsetX,X.value.right-2)},${X.value.top+(B.value+J.value)*t+J.value/2+q.value[t]*K.value+N.value.dataLabels.fontSize/3})`,"text-anchor":!yr.value||e.sign===-1?`start`:`end`,"font-size":N.value.dataLabels.fontSize,fill:N.value.dataLabels.color,"font-weight":N.value.dataLabels.bold?`bold`:`normal`},w(Mr(e.value,e,t,e.sign)),11,Tt)]))),128))]),(b(!0),h(d,null,S(G.value,(e,t)=>(b(),h(`g`,null,[g(`rect`,{x:0,y:X.value.top+(B.value+J.value)*t-B.value/2+q.value[t]*K.value,width:R.value,height:J.value+B.value<=0?1e-4:J.value+B.value,fill:Er.value===e.id?T(ee)(P.value.highlighter.color,P.value.highlighter.opacity):`transparent`,onMouseenter:n=>Ar(e,t,`pointer`),onMouseleave:n=>kr({datapoint:e,seriesIndex:t}),onClick:n=>Or({datapoint:e,seriesIndex:t})},null,40,Et)]))),256)),C(e.$slots,`svg`,{svg:{...Y.value,drawingArea:X.value,isPrintingImg:T(Vn)||T(Hn)||T(Zr),isPrintingSvg:T(Qr)}},void 0,!0)],512)],46,dt)),e.$slots.hint?(b(),h(`div`,Dt,[C(e.$slots,`hint`,v(Ye({hint:M.value.a11y.translations.keyboardNavigation,isVisible:ri.value})),void 0,!0)])):m(``,!0)]),e.$slots.watermark?(b(),h(`div`,Ot,[C(e.$slots,`watermark`,v(Ye({isPrinting:T(Vn)||T(Hn)||T(Zr)||T(Qr)})),void 0,!0)])):m(``,!0),e.$slots.legend&&I.value.legend.show&&I.value.legend.position===`bottom`?C(e.$slots,`legend`,{legend:U.value},void 0,!0,8):m(``,!0),!e.$slots.legend&&I.value.legend.show&&I.value.legend.position===`bottom`?(b(),h(`div`,{key:9,ref_key:`chartLegend`,ref:dn},[(b(),p(Ue,{key:`legend_bottom_${hn.value}`,legendSet:U.value,config:rr.value,isCursorPointer:kn.value,onClickMarker:i[1]||=({legend:e})=>mr(e.id)},Ge({item:E(({legend:e,index:t})=>[g(`div`,{onClick:t=>mr(e.id),style:y(`opacity:${A.value.includes(e.id)?.5:1}`)},w(jr({legend:e,index:t})),13,kt)]),legendToggle:E(()=>[U.value.length>2&&I.value.legend.selectAllToggle.show&&!T(Mn)?(b(),p(Re,{key:0,backgroundColor:I.value.legend.selectAllToggle.backgroundColor,color:I.value.legend.selectAllToggle.color,fontSize:I.value.legend.fontSize,checked:A.value.length>0,isCursorPointer:kn.value,onToggle:pr},null,8,[`backgroundColor`,`color`,`fontSize`,`checked`,`isCursorPointer`])):m(``,!0)]),_:2},[e.$slots.pattern?{name:`legend-pattern`,fn:E(({legend:e,index:t})=>[qe(Ne,{shape:e.shape,radius:30,stroke:`none`,plot:{x:30,y:30},fill:`url(#pattern_${O.value}_${t})`},null,8,[`shape`,`fill`])]),key:`0`}:void 0]),1032,[`legendSet`,`config`,`isCursorPointer`]))],512)):m(``,!0),e.$slots.source?(b(),h(`div`,{key:10,ref_key:`source`,ref:fn,dir:`auto`},[C(e.$slots,`source`,{},void 0,!0)],512)):m(``,!0),qe(T(Jt),{teleportTo:F.value.teleportTo,show:H.value.showTooltip&&on.value&&A.value.length<D.dataset.length,backgroundColor:F.value.backgroundColor,color:F.value.color,borderRadius:F.value.borderRadius,borderColor:F.value.borderColor,borderWidth:F.value.borderWidth,fontSize:F.value.fontSize,backgroundOpacity:F.value.backgroundOpacity,position:F.value.position,offsetX:F.value.offsetX,offsetY:F.value.offsetY,parent:k.value,content:sn.value,isFullscreen:Pr.value,isCustom:F.value.customFormat&&typeof F.value.customFormat==`function`,smooth:F.value.smooth,backdropFilter:F.value.backdropFilter,smoothForce:F.value.smoothForce,smoothSnapThreshold:F.value.smoothSnapThreshold,isA11yMode:Dn.value===`keyboard`,a11yPosition:En.value},{"tooltip-before":E(()=>[C(e.$slots,`tooltip-before`,v(Ye({...Dr.value})),void 0,!0)]),tooltip:E(()=>[C(e.$slots,`tooltip`,v(Ye({...Dr.value})),void 0,!0)]),"tooltip-after":E(()=>[C(e.$slots,`tooltip-after`,v(Ye({...Dr.value})),void 0,!0)]),_:3},8,[`teleportTo`,`show`,`backgroundColor`,`color`,`borderRadius`,`borderColor`,`borderWidth`,`fontSize`,`backgroundOpacity`,`position`,`offsetX`,`offsetY`,`parent`,`content`,`isFullscreen`,`isCustom`,`smooth`,`backdropFilter`,`smoothForce`,`smoothSnapThreshold`,`isA11yMode`,`a11yPosition`]),an.value&&M.value.userOptions.buttons.table?(b(),p(et(Ur.value.component),Xe({key:11},Ur.value.props,{ref_key:`tableUnit`,ref:_n,onClose:Gr}),Ge({content:E(()=>[g(`div`,{ref_key:`tableContainer`,ref:qn,class:`vue-ui-vertical-bar-table atom-data-table`,style:y(`${M.value.table.useDialog?``:`max-height: 300px; margin-top: 24px`}`)},[g(`div`,At,[M.value.table.useDialog?m(``,!0):(b(),h(`div`,{key:0,role:`button`,tabindex:`0`,style:y(`width:32px; position: absolute; top: 0; right:4px; padding: 0 0px; display: flex; align-items:center;justify-content:center;height: 36px; width: 32px; cursor:${kn.value?`pointer`:`default`}; background:${M.value.table.th.backgroundColor};`),onClick:Gr,onKeypress:at(Gr,[`enter`])},[qe(T(Yt),{name:`close`,stroke:M.value.table.th.color,"stroke-width":2},null,8,[`stroke`])],36)),g(`div`,{style:{width:`100%`,"container-type":`inline-size`},class:_({"vue-ui-responsive":T(Wr)})},[g(`table`,jt,[M.value.table.useDialog?m(``,!0):(b(),h(`caption`,{key:0,style:y({backgroundColor:M.value.table.th.backgroundColor,color:M.value.table.th.color,outline:M.value.table.th.outline}),class:`vue-ui-data-table__caption`},[Ke(w(I.value.title.text)+` `,1),I.value.title.subtitle.text?(b(),h(`span`,Mt,w(I.value.title.subtitle.text),1)):m(``,!0)],4)),g(`thead`,null,[g(`tr`,{role:`row`,style:y(`background:${M.value.table.th.backgroundColor};color:${M.value.table.th.color}`)},[(b(!0),h(d,null,S($.value.head,e=>(b(),h(`th`,{style:y(`outline:${M.value.table.th.outline}`)},[g(`div`,Nt,w(e),1)],4))),256))],4),g(`tr`,null,[g(`th`,{style:y(`background:${M.value.table.th.backgroundColor};color:${M.value.table.th.color};outline:${M.value.table.th.outline}`)},null,4),g(`th`,{style:y(`background:${M.value.table.th.backgroundColor};color:${M.value.table.th.color};outline:${M.value.table.th.outline};text-align:right;padding-right:5px;font-weight:bold`)},` ∑ `+w(M.value.table.td.prefix)+w(isNaN(Z.value)?``:Z.value.toFixed(M.value.table.td.roundingValue))+w(M.value.table.td.suffix),5),g(`th`,{style:y(`background:${M.value.table.th.backgroundColor};color:${M.value.table.th.color};outline:${M.value.table.th.outline};text-align:right;padding-right:5px;font-weight:bold`)},` 100% `,4),g(`th`,{style:y(`background:${M.value.table.th.backgroundColor};color:${M.value.table.th.color};outline:${M.value.table.th.outline}`)},null,4),g(`th`,{style:y(`background:${M.value.table.th.backgroundColor};color:${M.value.table.th.color};outline:${M.value.table.th.outline}`)},null,4),g(`th`,{style:y(`background:${M.value.table.th.backgroundColor};color:${M.value.table.th.color};outline:${M.value.table.th.outline}`)},null,4),g(`th`,{style:y(`background:${M.value.table.th.backgroundColor};color:${M.value.table.th.color};outline:${M.value.table.th.outline}`)},null,4)])]),g(`tbody`,null,[(b(!0),h(d,null,S($.value.body,(e,t)=>(b(),h(`tr`,{class:_({"vue-ui-data-table__tbody__row":!0,"vue-ui-data-table__tbody__row-even":t%2==0,"vue-ui-data-table__tbody__row-odd":t%2!=0}),style:y(`background:${M.value.table.td.backgroundColor};color:${M.value.table.td.color}`)},[g(`td`,{class:`vue-ui-data-table__tbody__td`,style:y(`outline:${M.value.table.td.outline};font-variant-numeric: tabular-nums;`),"data-cell":$.value.head[0]??``},[g(`div`,Ft,[e.color?(b(),h(`span`,{key:0,style:y(`color:${e.color};margin-right:3px`)},`⬤`,4)):m(``,!0),g(`span`,null,w(e.parentName),1)])],12,Pt),g(`td`,{class:`vue-ui-data-table__tbody__td`,style:y(`outline:${M.value.table.td.outline}`),"data-cell":$.value.head[1]??``},[g(`div`,Lt,w(M.value.table.td.prefix)+w([``,NaN,void 0].includes(e.parentValue)?``:e.parentValue.toFixed(M.value.table.td.roundingValue))+w(M.value.table.td.suffix),1)],12,It),g(`td`,{class:`vue-ui-data-table__tbody__td`,style:y(`outline:${M.value.table.td.outline}`),"data-cell":$.value.head[2]??``},[g(`div`,zt,w([``,NaN,void 0].includes(e.percentageToTotal)?``:`${(e.percentageToTotal*100).toFixed(M.value.table.td.roundingPercentage)}%`),1)],12,Rt),g(`td`,{class:`vue-ui-data-table__tbody__td`,style:y(`outline:${M.value.table.td.outline}`),"data-cell":$.value.head[3]??``},[g(`div`,Vt,w(e.childName),1)],12,Bt),g(`td`,{class:`vue-ui-data-table__tbody__td`,style:y(`outline:${M.value.table.td.outline}`),"data-cell":$.value.head[4]??``},[g(`div`,Ut,w(M.value.table.td.prefix)+w([``,NaN,void 0].includes(e.childValue)?``:e.childValue.toFixed(M.value.table.td.roundingValue))+w(M.value.table.td.suffix),1)],12,Ht),g(`td`,{class:`vue-ui-data-table__tbody__td`,style:y(`outline:${M.value.table.td.outline}`),"data-cell":$.value.head[5]??``},[g(`div`,Gt,w([``,NaN,void 0].includes(e.childPercentageToParent)?``:`${(e.childPercentageToParent*100).toFixed(M.value.table.td.roundingPercentage)}%`),1)],12,Wt),g(`td`,{class:`vue-ui-data-table__tbody__td`,style:y(`outline:${M.value.table.td.outline}`),"data-cell":$.value.head[6]??``},[g(`div`,qt,w([``,NaN,void 0].includes(e.childPercentageToTotal)?``:`${(e.childPercentageToTotal*100).toFixed(M.value.table.td.roundingPercentage)}%`),1)],12,Kt)],6))),256))])])],2)])],4)]),_:2},[M.value.table.useDialog?{name:`title`,fn:E(()=>[Ke(w(Ur.value.title),1)]),key:`0`}:void 0,M.value.table.useDialog?{name:`actions`,fn:E(()=>[g(`button`,{tabindex:`0`,class:`vue-ui-user-options-button`,onClick:i[2]||=e=>Nr(M.value.userOptions.callbacks.csv),style:y({cursor:kn.value?`pointer`:`default`})},[qe(T(Yt),{name:`fileCsv`,stroke:Ur.value.props.color},null,8,[`stroke`])],4)]),key:`1`}:void 0]),1040)):m(``,!0),C(e.$slots,`skeleton`,{},()=>[T(Mn)?(b(),p(ve,{key:0})):m(``,!0)],!0)],46,st))}},[[`__scopeId`,`data-v-c9f32a95`]]);export{ot as n,Jt as t};
@@ -1 +0,0 @@
1
- import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{n as t,r as n,t as r}from"./annotationSlots-OLiW25XN.js";import{t as i}from"./useConfig-By3Vb5kz.js";import{D as a,Dt as o,Ft as s,Ht as ee,M as c,S as te,X as ne,Zt as re,at as ie,et as l,in as ae,nt as oe,pt as se,t as ce,w as le,zt as ue}from"./lib-rPeBMZrn.js";import{n as de,t as fe}from"./BaseScanner-8NdoBs7B.js";import{n as pe,t as me}from"./useHints-C-TwxM0Y.js";import{t as he}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{n as ge}from"./resolveChartConfig-CIhClE5R.js";import{t as _e}from"./chartImage-DPGnEuYM.js";import{t as ve}from"./useChartExport-BZts4KFb.js";import{n as ye,t as be}from"./tableIntegration-CNoJ1CIY.js";import{n as xe,t as Se}from"./userOptionsSlots-DYuo-E5m.js";import{t as Ce}from"./usePrinter-DVf3YcG5.js";import{t as we}from"./DefGrad-DKMq1REY.js";import{t as Te}from"./useUserOptionState-CXlFnwPv.js";import{t as Ee}from"./useChartAccessibility-DOMuYJfm.js";import{n as De}from"./annotationViewport-X8fvs7pz.js";import{t as Oe}from"./vue_ui_molecule-Bw1UW1Na.js";import{t as ke}from"./usePanZoom-CE6Ofyy8.js";import{Fragment as Ae,computed as u,createBlock as d,createCommentVNode as f,createElementBlock as p,createElementVNode as m,createSlots as je,createTextVNode as Me,createVNode as h,defineAsyncComponent as g,guardReactiveProps as _,mergeProps as Ne,nextTick as v,normalizeClass as Pe,normalizeProps as y,normalizeStyle as b,onMounted as Fe,openBlock as x,ref as S,renderList as Ie,renderSlot as C,resolveDynamicComponent as Le,toDisplayString as Re,toRefs as ze,unref as w,useCssVars as Be,watch as T,withCtx as E}from"vue";var Ve=/* @__PURE__ */ e({default:()=>Xe}),He=[`id`],Ue={key:1,ref:`noTitle`,class:`vue-data-ui-no-title-space`,style:`height:36px; width: 100%;background:transparent`},We={key:2,style:`width:100%;background:transparent;`},Ge=[`xmlns`,`viewBox`],Ke=[`width`,`height`],qe={key:4,class:`vue-data-ui-watermark`},Je={key:5,"data-dom-to-png-ignore":``,class:`reset-wrapper`},Ye={key:6,ref:`source`,dir:`auto`},Xe=/*#__PURE__*/ he({__name:`vue-ui-molecule`,props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:[`selectNode`,`copyAlt`],setup(e,{expose:he,emit:Ve}){Be(e=>({v5b86963f:cn.value}));let Xe=g(()=>import(`./Title-BliHuXfT.js`).then(e=>e.t)),Ze=g(()=>import(`./Tooltip-C1q0Qoh7.js`)),Qe=g(()=>import(`./BaseIcon-CoY0vuL3.js`).then(e=>e.n)),$e=g(()=>import(`./vue-ui-accordion-DFxSW8ET.js`).then(e=>e.n)),et=g(()=>import(`./DataTable-Dof6yhO7.js`)),tt=g(()=>import(`./PenAndPaper-DoNTA-SV.js`).then(e=>e.t)),nt=g(()=>import(`./UserOptions-DW84OKKr.js`).then(e=>e.n)),rt=g(()=>import(`./PackageVersion-Bczw6rsP.js`).then(e=>e.t)),it=g(()=>import(`./RecursiveLinks-CZtG6uWg.js`)),at=g(()=>import(`./RecursiveLabels-B0d04xSj.js`)),ot=g(()=>import(`./RecursiveCircles-BftI1kwF.js`)),st=g(()=>import(`./BaseDraggableDialog-BK7dj9O6.js`).then(e=>e.n)),{vue_ui_molecule:ct}=i(),D=e,lt=Ve,ut=u(()=>!!D.dataset&&D.dataset.length);Fe(()=>{ft()});let dt=u(()=>M.value.debug);function ft(){ue(D.dataset)&&ie({componentName:`VueUiMolecule`,type:`dataset`,debug:dt.value})}let O=S(ne()),k=S(!1),A=S(``),j=S(null),pt=S(0),mt=S(0),ht=S(0),gt=S(null),_t=S(null),M=S(xt()),N=u(()=>M.value.style.chart.tooltip),P=u(()=>M.value.style.chart),F=u(()=>M.value.userOptions);pe({config:()=>M.value,dataset:()=>D.dataset,component:`VueUiMolecule`,rules:[me.emptyArray,{test:e=>e[0]&&e[0].nodes&&e[0].nodes.length===0,message:[`👀 There are no children nodes attached to the root node. Consider:`,``,`▶️ Adding children nodes to the root node.`]},{test:e=>e[0]&&e[0].nodes&&e[0].nodes.length>8,message:[`👀 The number of children nodes > 8, some nodes might overlap. Consider:`,``,`▶️ Grouping data into broader categories.`]}]});let I=u(()=>M.value.userOptions.useCursorPointer),vt=u(()=>ae({defaultConfig:{userOptions:{show:!1},table:{show:!1},style:{chart:{backgroundColor:`#99999930`,nodes:{stroke:`#6A6A6A`},links:{stroke:`#6A6A6A80`}}}},userConfig:M.value.skeletonConfig??{}})),{loading:L,FINAL_DATASET:R}=de({...ze(D),FINAL_CONFIG:M,prepareConfig:xt,skeletonDataset:D.config?.skeletonDataset??[{name:`_`,color:`#CACACA`,nodes:[{name:`_`,color:`#CACACA`,nodes:[{name:`_`,color:`#CACACA`},{name:`_`,color:`#CACACA`},{name:`_`,color:`#CACACA`}]},{name:`_`,color:`#CACACA`,nodes:[{name:`_`,color:`#CACACA`},{name:`_`,color:`#CACACA`},{name:`_`,color:`#CACACA`}]},{name:`_`,color:`#CACACA`,nodes:[{name:`_`,color:`#CACACA`},{name:`_`,color:`#CACACA`},{name:`_`,color:`#CACACA`}]},{name:`_`,color:`#CACACA`,nodes:[{name:`_`,color:`#CACACA`},{name:`_`,color:`#CACACA`},{name:`_`,color:`#CACACA`}]},{name:`_`,color:`#CACACA`,nodes:[{name:`_`,color:`#CACACA`},{name:`_`,color:`#CACACA`},{name:`_`,color:`#CACACA`}]},{name:`_`,color:`#CACACA`,nodes:[{name:`_`,color:`#CACACA`},{name:`_`,color:`#CACACA`},{name:`_`,color:`#CACACA`}]}]}],skeletonConfig:ae({defaultConfig:M.value,userConfig:vt.value})}),{userOptionsVisible:z,setUserOptionsVisibility:yt,keepUserOptionState:bt}=Te({config:M.value}),{svgRef:B}=Ee({config:P.value.title});function xt(){return ge(D.config,ct,Oe)}let St=re(D.config);T(()=>D.config,e=>{let t=re(e),n=t!==St;St=t;let r=xt();n?(M.value=r,z.value=!M.value.userOptions.showOnChartHover,ft(),mt.value+=1,ht.value+=1,U.value.showTable=M.value.table.show,U.value.showTooltip=N.value.show,U.value.showZoom=P.value.zoom.show):(M.value.style.chart.tooltip=r.style.chart.tooltip,U.value.showTooltip=M.value.style.chart.tooltip.show)},{deep:!0});let Ct=S(0),wt=()=>{Ct.value+=1};T([()=>L.value,()=>R.value],async([e])=>{e||(await v(),W.value=At(),await v(),wt(),await v(),Xt({x:0,y:0,width:400,height:400}),Jt(!1))},{flush:`post`,deep:!1});let{isPrinting:V,isImaging:H,generatePdf:Tt,generateImage:Et}=Ce({elementId:`cluster_${O.value}`,fileName:P.value.title.text||`vue-ui-molecule`,options:M.value.userOptions.print}),Dt=u(()=>M.value.userOptions.show&&!P.value.title.text),Ot=u(()=>le(M.value.customPalette)),U=S({showTable:M.value.table.show,showDataLabels:!0,showTooltip:N.value.show,showZoom:P.value.zoom.show});T(M,()=>{U.value={showTable:M.value.table.show,showDataLabels:!0,showTooltip:N.value.show,showZoom:P.value.zoom.show}},{immediate:!0});function kt(e,t=0){return Array.isArray(e)&&e.length>0&&e[0].nodes?kt(e[0].nodes,t+1):t}function At(){let e=kt(R.value),t=100,n=t;for(let r=0;r<e;r+=1)t/=1,n+=t;return{height:n,width:n}}let W=S(At());function jt(e,t={x:-W.value.width/2.43,y:W.value.height/2},n=W.value.width/1.1,r=24,i=0,a=0,o=`#BBBBBB`,s=0){if(!Array.isArray(e)||e.length===0)return e;let re=c({plot:t,radius:n,sides:e.length,rotation:i});return e.forEach((e,t)=>{let c=re.coordinates[t],ie=e.color?(()=>{let t=te(e.color);return t.startsWith(`#`)?t:`#${t}`})():null,l;ie?l=ie:s===0?l=o:s===1?(l=Ot.value[a]||ee[a]||o,a+=1):l=o,e.polygonPath={coordinates:[c]},e.circleRadius=r,e.color=l,e.strokeWidth=Math.min(P.value.links.strokeWidth/(s+1),r/2),e.uid=ne(),Array.isArray(e.nodes)&&e.nodes.length&&(e.nodes=jt(e.nodes,c,n/2.9,r/2.2,i+Math.PI*t/e.nodes.length,a,l,s+1))}),e}function Mt(e){let t=/* @__PURE__ */ new Set;function n(e){e.forEach(e=>{if(!e.color)return;let r=e.color;/^#?[0-9A-F]{6}$/i.test(r)||(r=te(r)),r.startsWith(`#`)||(r=`#${r}`),t.add(r),Array.isArray(e.nodes)&&e.nodes.length&&n(e.nodes)})}n(e);let r={};return Array.from(t).forEach(e=>{let t=e.slice(1);r[e]=`gradient_${t}`}),r}let Nt=u(()=>Mt(G.value)),G=u(()=>jt(l(R.value))),K=S(null);function Pt(e){K.value={datapoint:e,seriesIndex:-1,series:G.value,config:M.value};let t=N.value.customFormat;if(o(t)&&se(()=>t({seriesIndex:-1,datapoint:e,series:G.value,config:M.value})))A.value=t({seriesIndex:-1,datapoint:e,series:G.value,config:M.value});else{let t=``;t+=`<div style="display:flex;align-items:center;gap:3px"><div style="color:${e.color}">⬤</div><div>${e.name}</div></div>`,e.details&&(t+=`<div style="width:100%;border-top:1px solid ${N.value.borderColor};margin-top: 2px">${e.details}</div>`),A.value=`<div style="font-family:inherit">${t}</div>`}}let q=S(null),J=S(null),Ft=S(null);function It(e){Ft.value=q.value,q.value=e,e?M.value.events.datapointEnter&&M.value.events.datapointEnter({datapoint:e,seriesIndex:-1}):M.value.events.datapointLeave&&M.value.events.datapointLeave({datapoint:Ft.value||q.value,seriesIndex:-1}),e?(k.value=!0,Pt(e),J.value=e.uid):(k.value=!1,A.value=``,J.value=null)}function Lt(e){let t=[];function n(e){e.forEach(e=>{let r={name:e.name,details:e.details||`-`,ancestor:e.ancestor&&e.ancestor.name||`-`,color:e.color||``};t.push(r),e.nodes&&e.nodes.length>0&&n(e.nodes,e.name)})}return n(e),t}let Rt=u(()=>Lt(G.value)),Y=u(()=>({head:[M.value.table.translations.nodeName,M.value.table.translations.details,M.value.table.translations.ancestor],body:Rt.value.map((e,t)=>[{color:e.color,name:e.name},e.details,e.ancestor||``]),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.translations.nodeName,M.value.table.translations.details,M.value.table.translations.ancestor]}));function zt(e=null){v(()=>{let t=Y.value.body.map((e,t)=>[[e[0].name],[e[1]],[e[2]]]),n=[[P.value.title.text],[P.value.title.subtitle.text],[[...Y.value.head]]].concat(t),r=a(n);e?e(r):oe({csvContent:r,title:P.value.title.text||`vue-ui-molecule`})})}function Bt(){return G.value}let X=S(!1);function Vt(e){X.value=e,pt.value+=1}function Ht(){U.value.showTable=!U.value.showTable}function Ut(){U.value.showDataLabels=!U.value.showDataLabels}function Wt(){U.value.showTooltip=!U.value.showTooltip}function Gt(){U.value.showZoom=!U.value.showZoom}let Z=S(!1);function Kt(){Z.value=!Z.value}let qt=u(()=>!Z.value&&U.value.showZoom),{viewBox:Q,resetZoom:Jt,isZoom:Yt,setInitialViewBox:Xt}=ke(B,{x:0,y:0,width:Math.max(10,W.value.width),height:Math.max(10,W.value.height)},P.value.zoom.speed,qt);function Zt(e){M.value.events.datapointClick&&M.value.events.datapointClick({datapoint:e,seriesIndex:-1}),lt(`selectNode`,e)}let Qt=_e(j,()=>P.value.title.text),$=u(()=>be({config:M,style:P,mutableConfig:U,dialog:st,accordion:$e,isFullscreen:X,parent:j,maxWidth:800,isCursorPointer:I}));T(()=>U.value.showTable,e=>ye(e,M,gt));function $t(){U.value.showTable=!1,_t.value&&_t.value.setTableIconState(!1)}let en=u(()=>P.value.backgroundColor),tn=u(()=>P.value.title),{isCallbackImaging:nn,isCallbackSvg:rn,generateSvg:an,onGenerateImage:on}=ve({svg:B,title:tn,legend:null,legendItems:null,backgroundColor:en,getSvgCallback:()=>M.value.userOptions.callbacks.svg,generateImage:Et});async function sn(){lt(`copyAlt`,{config:M.value,dataset:G.value}),M.value.userOptions.callbacks.altCopy?await Promise.resolve(M.value.userOptions.callbacks.altCopy({config:M.value,dataset:G.value})):console.warn("Vue Data UI - A callback must be set for `altCopy` in userOptions.")}let cn=u(()=>P.value.color);he({getData:Bt,getImage:Qt,generatePdf:Tt,generateCsv:zt,generateImage:Et,generateSvg:an,toggleTable:Ht,toggleLabels:Ut,toggleTooltip:Wt,toggleAnnotator:Kt,toggleFullscreen:Vt,toggleZoom:Gt,copyAlt:sn});let ln=u(()=>De(M.value.userOptions?.annotator?.followZoom,Q.value));return(e,i)=>(x(),p(`div`,{ref_key:`moleculeChart`,ref:j,class:Pe(`vue-data-ui-component vue-ui-molecule ${X.value?`vue-data-ui-wrapper-fullscreen`:``}`),style:b(`font-family:${M.value.style.fontFamily};width:100%; text-align:center;background:${P.value.backgroundColor}`),id:`cluster_${O.value}`,onMouseleave:i[2]||=e=>{q.value=null,J.value=null,w(yt)(!1)},onMouseenter:i[3]||=()=>w(yt)(!0)},[F.value.buttons.annotator&&w(B)?(x(),d(w(tt),Ne({key:0},w(n)(F.value.annotator),{svgRef:w(B),followZoom:M.value.userOptions?.annotator?.followZoom,annotationViewport:ln.value,backgroundColor:P.value.backgroundColor,color:P.value.color,active:Z.value,isCursorPointer:I.value,onClose:Kt}),je({_:2},[Ie(w(r),n=>({name:n,fn:E(r=>[C(e.$slots,n,y(_(w(t)(n,r))),void 0,!0)])}))]),1040,[`svgRef`,`followZoom`,`annotationViewport`,`backgroundColor`,`color`,`active`,`isCursorPointer`])):f(``,!0),Dt.value?(x(),p(`div`,Ue,null,512)):f(``,!0),P.value.title.text?(x(),p(`div`,We,[(x(),d(w(Xe),{key:`title_${mt.value}`,config:{title:{cy:`molecule-div-title`,...P.value.title},subtitle:{cy:`molecule-div-subtitle`,...P.value.title.subtitle}}},null,8,[`config`]))])):f(``,!0),F.value.show&&ut.value&&(w(bt)||w(z))?(x(),d(w(nt),{ref_key:`userOptionsRef`,ref:_t,key:`user_options_${pt.value}`,backgroundColor:P.value.backgroundColor,color:P.value.color,isPrinting:w(V),isImaging:w(H),uid:O.value,hasTooltip:F.value.buttons.tooltip&&N.value.show,hasPdf:F.value.buttons.pdf,hasXls:F.value.buttons.csv,hasImg:F.value.buttons.img,hasSvg:F.value.buttons.svg,hasTable:F.value.buttons.table,hasLabel:F.value.buttons.labels,hasFullscreen:F.value.buttons.fullscreen,hasAltCopy:F.value.buttons.altCopy,isTooltip:U.value.showTooltip,titles:{...F.value.buttonTitles},isFullscreen:X.value,chartElement:j.value,position:F.value.position,hasAnnotator:F.value.buttons.annotator,isAnnotation:Z.value,callbacks:F.value.callbacks,printScale:F.value.print.scale,tableDialog:M.value.table.useDialog,hasZoom:F.value.buttons.zoom,isZoom:U.value.showZoom,isCursorPointer:I.value,onToggleFullscreen:Vt,onGeneratePdf:w(Tt),onGenerateCsv:zt,onGenerateImage:w(on),onGenerateSvg:w(an),onToggleTable:Ht,onToggleLabels:Ut,onToggleTooltip:Wt,onToggleAnnotator:Kt,onToggleZoom:Gt,onCopyAlt:sn,style:b({visibility:w(bt)?w(z)?`visible`:`hidden`:`visible`})},je({_:2},[Ie(w(xe)(e.$slots,`menuIcon optionTooltip optionPdf optionCsv optionImg optionSvg optionTable optionLabels optionFullscreen optionAnnotator optionZoom optionAltCopy custom-menu-before custom-menu-after`),t=>({name:t,fn:E(n=>[C(e.$slots,t,y(_(w(Se)(t,n))),void 0,!0)])}))]),1032,/* @__PURE__ */ `backgroundColor.color.isPrinting.isImaging.uid.hasTooltip.hasPdf.hasXls.hasImg.hasSvg.hasTable.hasLabel.hasFullscreen.hasAltCopy.isTooltip.titles.isFullscreen.chartElement.position.hasAnnotator.isAnnotation.callbacks.printScale.tableDialog.hasZoom.isZoom.isCursorPointer.onGeneratePdf.onGenerateImage.onGenerateSvg.style`.split(`.`))):f(``,!0),(x(),p(`svg`,{ref_key:`svgRef`,ref:B,key:`svg_${Ct.value}`,xmlns:w(ce),viewBox:`${w(Q).x} ${w(Q).y} ${w(Q).width} ${w(Q).height}`,class:Pe({"vue-data-ui-fullscreen--on":X.value,"vue-data-ui-fulscreen--off":!X.value}),style:b(`overflow: hidden; background:transparent;color:${P.value.color}`)},[h(w(rt)),C(e.$slots,`svg-underlayer`,{svg:{...W.value,drawingArea:{...w(Q)},isPrintingImg:w(V)||w(H)||w(nn),isPrintingSvg:w(rn)}},void 0,!0),e.$slots[`chart-background`]?(x(),p(`foreignObject`,{key:0,x:0,y:0,width:W.value.width<=0?10:W.value.width,height:W.value.height<=0?10:W.value.height,style:{pointerEvents:`none`}},[C(e.$slots,`chart-background`,{},void 0,!0)],8,Ke)):f(``,!0),m(`defs`,null,[(x(!0),p(Ae,null,Ie(Object.keys(Nt.value),(e,t)=>(x(),d(we,{t:`radial`,id:`gradient_${e}`,key:`gradient_${e}_${t}`,cx:`50%`,cy:`30%`,r:`50%`,fx:`50%`,fy:`50%`,stops:[[`0%`,w(s)(e,.5),1],[`100%`,e,1]]},null,8,[`id`,`stops`]))),128))]),h(w(it),{dataset:G.value,color:P.value.links.stroke,backgroundColor:P.value.backgroundColor,useChildColor:P.value.links.useChildColor},null,8,[`dataset`,`color`,`backgroundColor`,`useChildColor`]),h(w(ot),{dataset:G.value,hoveredUid:J.value,stroke:P.value.nodes.stroke,strokeHovered:P.value.nodes.strokeHovered,onClick:Zt,onHover:It},{node:E(({node:t})=>[C(e.$slots,`node`,y(_({node:t})),void 0,!0)]),"node-svg":E(({nodeSvg:t})=>[C(e.$slots,`node-svg`,y(_({nodeSvg:t})),void 0,!0)]),_:3},8,[`dataset`,`hoveredUid`,`stroke`,`strokeHovered`]),U.value.showDataLabels&&!w(L)?(x(),d(w(at),{key:1,dataset:G.value,color:P.value.color,hoveredUid:J.value},null,8,[`dataset`,`color`,`hoveredUid`])):f(``,!0),C(e.$slots,`svg`,{svg:{...W.value,drawingArea:{...w(Q)},isPrintingImg:w(V)||w(H)||w(nn),isPrintingSvg:w(rn)}},void 0,!0)],14,Ge)),e.$slots.watermark?(x(),p(`div`,qe,[C(e.$slots,`watermark`,y(_({isPrinting:w(V)||w(H)||w(nn)||w(rn)})),void 0,!0)])):f(``,!0),w(Yt)?(x(),p(`div`,Je,[C(e.$slots,`reset-action`,{reset:w(Jt)},()=>[m(`button`,{"data-cy-reset":``,tabindex:`0`,role:`button`,class:`vue-data-ui-refresh-button`,style:b({background:P.value.backgroundColor,cursor:I.value?`pointer`:`default`}),onClick:i[0]||=e=>w(Jt)(!0)},[h(w(Qe),{name:`refresh`,stroke:P.value.color},null,8,[`stroke`])],4)],!0)])):f(``,!0),e.$slots.source?(x(),p(`div`,Ye,[C(e.$slots,`source`,{},void 0,!0)],512)):f(``,!0),h(w(Ze),{teleportTo:N.value.teleportTo,show:U.value.showTooltip&&k.value,backgroundColor:N.value.backgroundColor,color:N.value.color,borderRadius:N.value.borderRadius,borderColor:N.value.borderColor,borderWidth:N.value.borderWidth,fontSize:N.value.fontSize,backgroundOpacity:N.value.backgroundOpacity,position:N.value.position,offsetX:N.value.offsetX,offsetY:N.value.offsetY,parent:j.value,content:A.value,isFullscreen:X.value,isCustom:N.value.customFormat&&typeof N.value.customFormat==`function`,smooth:N.value.smooth,backdropFilter:N.value.backdropFilter,smoothForce:N.value.smoothForce,smoothSnapThreshold:N.value.smoothSnapThreshold},{"tooltip-before":E(()=>[C(e.$slots,`tooltip-before`,y(_({...K.value})),void 0,!0)]),tooltip:E(()=>[C(e.$slots,`tooltip`,y(_({...K.value})),void 0,!0)]),"tooltip-after":E(()=>[C(e.$slots,`tooltip-after`,y(_({...K.value})),void 0,!0)]),_:3},8,[`teleportTo`,`show`,`backgroundColor`,`color`,`borderRadius`,`borderColor`,`borderWidth`,`fontSize`,`backgroundOpacity`,`position`,`offsetX`,`offsetY`,`parent`,`content`,`isFullscreen`,`isCustom`,`smooth`,`backdropFilter`,`smoothForce`,`smoothSnapThreshold`]),ut.value&&F.value.buttons.table?(x(),d(Le($.value.component),Ne({key:7},$.value.props,{ref_key:`tableUnit`,ref:gt,onClose:$t}),je({content:E(()=>[(x(),d(w(et),{key:`table_${ht.value}`,colNames:Y.value.colNames,head:Y.value.head,body:Y.value.body,config:Y.value.config,title:M.value.table.useDialog?``:$.value.title,withCloseButton:!M.value.table.useDialog,isCursorPointer:I.value,onClose:$t},{th:E(({th:e})=>[m(`div`,null,Re(e),1)]),td:E(({td:e})=>[Me(Re(e.name||e),1)]),_:1},8,[`colNames`,`head`,`body`,`config`,`title`,`withCloseButton`,`isCursorPointer`]))]),_:2},[M.value.table.useDialog?{name:`title`,fn:E(()=>[Me(Re($.value.title),1)]),key:`0`}:void 0,M.value.table.useDialog?{name:`actions`,fn:E(()=>[m(`button`,{tabindex:`0`,class:`vue-ui-user-options-button`,onClick:i[1]||=e=>zt(F.value.callbacks.csv),style:b({cursor:I.value?`pointer`:`default`})},[h(w(Qe),{name:`fileCsv`,stroke:$.value.props.color},null,8,[`stroke`])],4)]),key:`1`}:void 0]),1040)):f(``,!0),C(e.$slots,`skeleton`,{},()=>[w(L)?(x(),d(fe,{key:0})):f(``,!0)],!0)],46,He))}},[[`__scopeId`,`data-v-9e920e07`]]);export{Ve as n,Xe as t};
@@ -1 +0,0 @@
1
- import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{n as t,r as n,t as r}from"./annotationSlots-OLiW25XN.js";import{t as i}from"./useConfig-By3Vb5kz.js";import{$ as a,D as ee,Jt as o,Lt as te,M as ne,X as re,Yt as ie,at as ae,i as oe,in as se,nt as ce,t as le,zt as ue}from"./lib-rPeBMZrn.js";import{n as de,t as fe}from"./BaseScanner-8NdoBs7B.js";import{n as pe,t as me}from"./useHints-C-TwxM0Y.js";import{t as he}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{t as ge}from"./resolveChartConfig-CIhClE5R.js";import{t as _e}from"./chartImage-DPGnEuYM.js";import{n as ve}from"./Title-BliHuXfT.js";import{t as ye}from"./useChartExport-BZts4KFb.js";import{n as be,t as xe}from"./tableIntegration-CNoJ1CIY.js";import{n as Se,t as Ce}from"./userOptionsSlots-DYuo-E5m.js";import{t as we}from"./usePrinter-DVf3YcG5.js";import{c as Te}from"./canvas-lib-22VpOI4_.js";import{t as Ee}from"./useResponsive-CENUxfEL.js";import{t as De}from"./DefGrad-DKMq1REY.js";import{t as Oe}from"./A11yDataTable-DWNlWXzs.js";import{t as ke}from"./useUserOptionState-CXlFnwPv.js";import{t as Ae}from"./useChartAccessibility-DOMuYJfm.js";import{t as je}from"./Legend-DM0ClX3D.js";import{t as Me}from"./vue_ui_mood_radar-CXaBdJnv.js";import{Fragment as Ne,Teleport as Pe,computed as s,createBlock as c,createCommentVNode as l,createElementBlock as u,createElementVNode as d,createSlots as Fe,createTextVNode as Ie,createVNode as f,defineAsyncComponent as p,guardReactiveProps as m,mergeProps as Le,nextTick as Re,normalizeClass as ze,normalizeProps as h,normalizeStyle as g,onMounted as Be,openBlock as _,ref as v,renderList as Ve,renderSlot as y,resolveDynamicComponent as He,toDisplayString as b,toRefs as Ue,unref as x,watch as We,withCtx as S}from"vue";var Ge=/* @__PURE__ */ e({default:()=>C}),Ke=[`id`],qe=[`id`],Je=[`id`],Ye={style:{position:`relative`}},Xe=[`xmlns`,`aria-describedby`,`viewBox`],Ze=[`width`,`height`],Qe=[`x1`,`y1`,`x2`,`y2`,`stroke`,`stroke-width`],$e=[`d`,`stroke`,`stroke-width`],et=[`transform`],tt=[`stroke`],nt=[`aria-label`,`fill`],rt=[`transform`],it=[`stroke`],at=[`aria-label`,`fill`],ot=[`transform`],st=[`stroke`],ct=[`aria-label`,`fill`],lt=[`transform`],ut=[`stroke`],dt=[`aria-label`,`fill`],ft=[`transform`],pt=[`stroke`],mt=[`aria-label`,`fill`],ht=[`d`,`stroke`,`stroke-width`,`fill`],gt=[`x1`,`y1`,`x2`,`y2`,`stroke`],_t=[`cx`,`cy`,`fill`,`stroke`],vt=[`cx`,`cy`,`fill`,`stroke`],yt=[`x`,`y`,`fill`,`font-weight`],bt=[`x`,`y`,`fill`],xt={key:0,style:{position:`absolute`,top:`100%`,left:`0`,width:`100%`},"data-dom-to-png-ignore":``,"aria-hidden":`true`},St={key:5,class:`vue-data-ui-watermark`},Ct=[`id`],wt=[`onClick`,`onKeydown`],Tt={key:0},Et={key:1},C=/*#__PURE__*/ he({__name:`vue-ui-mood-radar`,props:{config:{type:Object,default(){return{}}},dataset:{type:Object,default(){return{}}}},emits:[`copyAlt`],setup(e,{expose:he,emit:Ge}){let C=p(()=>import(`./BaseIcon-CoY0vuL3.js`).then(e=>e.n)),Dt=p(()=>import(`./vue-ui-accordion-DFxSW8ET.js`).then(e=>e.n)),Ot=p(()=>import(`./DataTable-Dof6yhO7.js`)),kt=p(()=>import(`./PenAndPaper-DoNTA-SV.js`).then(e=>e.t)),At=p(()=>import(`./UserOptions-DW84OKKr.js`).then(e=>e.n)),jt=p(()=>import(`./PackageVersion-Bczw6rsP.js`).then(e=>e.t)),Mt=p(()=>import(`./BaseDraggableDialog-BK7dj9O6.js`).then(e=>e.n)),{vue_ui_mood_radar:Nt}=i(),w=e,Pt=Ge,T=v(re()),E=v(null),D=v(null),Ft=v(null),It=v(0),Lt=v(0),Rt=v(0),zt=v(null),Bt=v(null),O=v(null),Vt=v(null),Ht=v(null),Ut=v(!1),Wt=v(null),Gt=v(null),k=v(null),Kt=v(!1),qt=s(()=>!!w.dataset&&Object.keys(w.dataset).length),A=v(tn()),j=s(()=>A.value.userOptions),M=s(()=>A.value.style.chart.layout.smileys),N=s(()=>A.value.style.chart.layout),P=s(()=>A.value.style.chart);pe({config:()=>A.value,dataset:()=>w.dataset,component:`VueUiMoodRadar`,rules:[me.noHint]});let F=s(()=>A.value.userOptions.useCursorPointer),Jt=s(()=>se({defaultConfig:{userOptions:{show:!1},table:{show:!1},style:{chart:{backgroundColor:`#99999930`,layout:{grid:{stroke:`#6A6A6A`},outerPolygon:{stroke:`#6A6A6A`},dataPolygon:{color:`#6A6A6A`,opacity:30,stroke:`#6A6A6A`},smileys:{colors:{1:`#DBDBDB`,2:`#C4C4C4`,3:`#ADADAD`,4:`#969696`,5:`#808080`}},dataLabel:{color:`transparent`}},legend:{backgroundColor:`transparent`}}}},userConfig:A.value.skeletonConfig??{}})),{loading:Yt,FINAL_DATASET:I}=de({...Ue(w),FINAL_CONFIG:A,prepareConfig:tn,callback:()=>{Promise.resolve().then(async()=>{await Re(),R.value.showTable=A.value.table.show})},skeletonDataset:w.config?.skeletonDataset??{1:1,2:1,3:1,4:1,5:1},skeletonConfig:se({defaultConfig:A.value,userConfig:Jt.value})});Be(()=>{Ut.value=!0,Zt()});let Xt=s(()=>A.value.debug);function Zt(){if(ue(w.dataset)&&ae({componentName:`VueUiMoodRadar`,type:`dataset`,debug:Xt.value}),A.value.responsive){let e=Te(()=>{let{width:e,height:t}=Ee({chart:E.value,title:P.value.title.text?zt.value:null,legend:P.value.legend.show?Bt.value:null,noTitle:Ft.value,source:Ht.value});requestAnimationFrame(()=>{z.value.width=e,z.value.height=t-12})});O.value&&(Vt.value&&O.value.unobserve(Vt.value),O.value.disconnect()),O.value=new ResizeObserver(e),Vt.value=E.value.parentNode,O.value.observe(Vt.value)}}let{userOptionsVisible:Qt,setUserOptionsVisibility:$t,keepUserOptionState:en}=ke({config:A.value}),{svgRef:L}=Ae({config:P.value.title});function tn(){return ge(w.config,Nt,Me)}We(()=>w.config,e=>{A.value=tn(),Qt.value=!A.value.userOptions.showOnChartHover,Zt(),It.value+=1,Lt.value+=1,Rt.value+=1,R.value.showTable=A.value.table.show},{deep:!0});let{isPrinting:nn,isImaging:rn,generatePdf:an,generateImage:on}=we({elementId:T.value,fileName:P.value.title.text||`vue-ui-mood-radar`,options:A.value.userOptions.print}),sn=s(()=>A.value.userOptions.show&&!P.value.title.text),R=v({showTable:A.value.table.show}),z=v({height:256,width:256}),cn={5:{x:128,y:35},4:{x:218,y:98.5},3:{x:185,y:204},2:{x:70,y:204},1:{x:38.5,y:98.5}},ln=s(()=>{let e={};return mn.value.forEach(t=>{e[t.key]={x:t.x,y:t.y}}),e});function B(e){let t=cn[e],n=ln.value[e]||t;return`translate(${n.x-t.x}, ${n.y-t.y})`}let un=s(()=>ne({plot:{x:z.value.width/2,y:z.value.height/2},radius:Math.min(z.value.height,z.value.width)*.35,sides:5,rotation:11}));function dn({centerX:e,centerY:t,apexX:n,apexY:r,proportion:i,key:a,value:ee}){return{x:e+(n-e)*i,y:t+(r-t)*i,key:a,value:ee}}let fn=s(()=>Math.max(...Object.values(I.value).map(e=>isNaN(e)?0:e))),V=s(()=>Object.values(I.value).reduce((e,t)=>(isNaN(e)?0:e)+(isNaN(t)?0:t),0)),H=s(()=>Object.keys(I.value).map((e,t)=>{let n=typeof I.value[e]!=`number`||isNaN(I.value[e])?0:I.value[e];return{index:t,key:e,value:n,proportion:n/V.value,color:M.value.colors[e]}}).map(e=>({...e,onSelect:()=>U(e.key)})).sort((e,t)=>t.key-e.key)),pn=s(()=>H.value.map((e,t)=>({...e,display:`${oe(N.value.dataLabel.formatter,e.value,a({p:N.value.dataLabel.prefix,v:e.value,s:N.value.dataLabel.suffix,r:N.value.dataLabel.roundingValue}))}${Yt.value?``:` (${a({v:e.proportion*100,s:`%`,r:P.value.legend.roundingPercentage})})`}`}))),mn=s(()=>([`1`,`2`,`3`,`4`,`5`].forEach(e=>{[null,void 0].includes(I.value[e])&&ae({componentName:`VueUiMoodRadar`,type:`datasetAttribute`,property:e,debug:Xt.value})}),un.value.coordinates.map((e,t)=>{let n=dn({centerX:z.value.width/2,centerY:z.value.height/2,apexX:e.x,apexY:e.y,proportion:H.value[t].value/fn.value,key:H.value[t].key,value:H.value[t].value});return{...e,plots:n,key:H.value[t].key}}))),hn=s(()=>({cy:`mood-radar-legend`,backgroundColor:P.value.legend.backgroundColor,color:P.value.legend.color,fontSize:P.value.legend.fontSize,paddingBottom:12,fontWeight:P.value.legend.bold?`bold`:``}));function U(e){e===D.value?D.value=null:(D.value=e,K(e))}function W(e){D.value=e;let t=H.value.find(t=>t.key===e);A.value.events.datapointEnter&&A.value.events.datapointEnter({datapoint:t,seriesIndex:t.index})}function G(e){D.value=null;let t=H.value.find(t=>t.key===e);A.value.events.datapointLeave&&A.value.events.datapointLeave({datapoint:t,seriesIndex:t.index})}function K(e){let t=H.value.find(t=>t.key===e);A.value.events.datapointClick&&A.value.events.datapointClick({datapoint:t,seriesIndex:t.index})}let q=s(()=>({head:H.value.map(e=>({name:e.key,color:e.color})),body:H.value.map(e=>isNaN(e.value)?0:e.value)}));function gn(e=null){Re(()=>{let t=q.value.head.map((e,t)=>[[e.name],[q.value.body[t]],[isNaN(q.value.body[t]/V.value)?`-`:q.value.body[t]/V.value*100]]),n=[[P.value.title.text],[P.value.title.subtitle.text],[[``],[`val`],[`%`]]].concat(t),r=ee(n);e?e(r):ce({csvContent:r,title:P.value.title.text||`vue-ui-mood-radar`})})}let J=s(()=>({head:[`__SUM__`,Number(V.value.toFixed(A.value.table.td.roundingValue)).toLocaleString(),`100%`],body:q.value.head.map((e,t)=>[{color:e.color,name:e.name},q.value.body[t].toFixed(A.value.table.td.roundingValue),isNaN(q.value.body[t]/V.value)?`-`:(q.value.body[t]/V.value*100).toFixed(A.value.table.td.roundingPercentage)+`%`]),config:{th:{backgroundColor:A.value.table.th.backgroundColor,color:A.value.table.th.color,outline:A.value.table.th.outline},td:{backgroundColor:A.value.table.td.backgroundColor,color:A.value.table.td.color,outline:A.value.table.td.outline},breakpoint:A.value.table.responsiveBreakpoint},colNames:[A.value.table.columnNames.series,A.value.table.columnNames.value,A.value.table.columnNames.percentage]}));function _n(){return H.value}function vn(){R.value.showTable=!R.value.showTable}let Y=v(!1);function yn(e){Y.value=e}let X=v(!1);function bn(){X.value=!X.value}let xn=_e(E,()=>P.value.title.text),Z=s(()=>xe({config:A,style:P,mutableConfig:R,dialog:Mt,accordion:Dt,isFullscreen:Y,parent:E,maxWidth:800,isCursorPointer:F}));We(()=>R.value.showTable,e=>be(e,A,Wt));function Sn(){R.value.showTable=!1,Gt.value&&Gt.value.setTableIconState(!1)}let Cn=s(()=>pn.value.map(e=>({...e,name:e.display,shape:`circle`}))),wn=s(()=>P.value.backgroundColor),Tn=s(()=>P.value.legend),En=s(()=>P.value.title),{isCallbackImaging:Dn,isCallbackSvg:On,generateSvg:kn,onGenerateImage:An}=ye({svg:L,title:En,legend:Tn,legendItems:Cn,backgroundColor:wn,getSvgCallback:()=>A.value.userOptions.callbacks.svg,generateImage:on});async function jn(){Pt(`copyAlt`,{config:A.value,dataset:H.value}),A.value.userOptions.callbacks.altCopy?await Promise.resolve(A.value.userOptions.callbacks.altCopy({config:A.value,dataset:H.value})):console.warn("Vue Data UI - A callback must be set for `altCopy` in userOptions.")}let Q=s(()=>H.value.map(e=>String(e.key)));function Mn(){$t(!0)}function Nn(){$t(!1)}function Pn(e){return H.value.find(t=>String(t.key)===String(e))}function Fn(e,t,n){return oe(N.value.dataLabel.formatter,e,a({p:N.value.dataLabel.prefix,v:e,s:N.value.dataLabel.suffix,r:N.value.dataLabel.roundingValue}),{datapoint:n,seriesIndex:t})}function In(e){return a({v:V.value?e/V.value*100:0,s:`%`,r:N.value.dataLabel.roundingPercentage})}function $(e){let t=Pn(e);return t?`${e}, ${Fn(t.value,t.index,t)}, ${In(t.value)}`:`${e}`}function Ln(e){let t=Q.value[e];t&&(k.value=e,D.value=t)}function Rn(){Kt.value=!0}function zn(){k.value=null,D.value=null,Kt.value=!1}function Bn(e){if(!L.value||!Q.value.length||X.value||document.activeElement!==L.value)return;let t=[`ArrowLeft`,`ArrowUp`].includes(e.key),n=[`ArrowRight`,`ArrowDown`].includes(e.key),r=e.key===`Enter`||e.key===` `,i=e.key===`Escape`;if(!t&&!n&&!r&&!i)return;if(e.preventDefault(),e.stopPropagation(),i){k.value=null,D.value=null;return}if(r){if(k.value===null)return;let e=Q.value[k.value];if(!e)return;U(e);return}let a=k.value;a===null||a<0||a>=Q.value.length?a=n?0:Q.value.length-1:n?(a+=1,a>=Q.value.length&&(a=0)):t&&(--a,a<0&&(a=Q.value.length-1)),Ln(a)}function Vn(e,t){let n=e.key===`Enter`||e.key===` `,r=e.key===`Escape`;(n||r)&&(e.preventDefault(),e.stopPropagation(),r?(k.value=null,D.value=null):U(String(t)))}let Hn=s(()=>({headers:J.value?.colNames??[],rows:H.value.map(e=>[String(e.key),Fn(e.value,e.index,e),In(e.value)])}));return he({getData:_n,getImage:xn,generatePdf:an,generateCsv:gn,generateImage:on,generateSvg:kn,toggleTable:vn,toggleAnnotator:bn,toggleFullscreen:yn,copyAlt:jn}),(e,i)=>(_(),u(`div`,{class:ze(`vue-data-ui-component vue-ui-mood-radar ${Y.value?`vue-data-ui-wrapper-fullscreen`:``} ${A.value.useCssAnimation?``:`vue-ui-dna`}`),ref_key:`moodRadarChart`,ref:E,id:`${T.value}`,style:g(`font-family:${A.value.style.fontFamily};width:100%; text-align:center;background:${P.value.backgroundColor}`),onMouseenter:Mn,onMouseleave:Nn},[d(`div`,{id:`chart-instructions-${T.value}`,class:`sr-only`},[d(`p`,null,b(A.value.a11y.translations.keyboardNavigation),1)],8,qe),Hn.value?.rows?.length?(_(),c(Oe,{key:0,uid:T.value,head:Hn.value.headers,body:Hn.value.rows,notice:A.value.a11y.translations.tableAvailable,caption:A.value.a11y.translations.tableCaption},null,8,[`uid`,`head`,`body`,`notice`,`caption`])):l(``,!0),j.value.buttons.annotator?(_(),c(x(kt),Le({key:1},x(n)(j.value.annotator),{svgRef:x(L),backgroundColor:P.value.backgroundColor,color:P.value.color,active:X.value,isCursorPointer:F.value,palette:j.value.annotatorPalette,onClose:bn}),Fe({_:2},[Ve(x(r),n=>({name:n,fn:S(r=>[y(e.$slots,n,h(m(x(t)(n,r))),void 0,!0)])}))]),1040,[`svgRef`,`backgroundColor`,`color`,`active`,`isCursorPointer`,`palette`])):l(``,!0),sn.value?(_(),u(`div`,{key:2,ref_key:`noTitle`,ref:Ft,class:`vue-data-ui-no-title-space`,style:`height:36px; width: 100%;background:transparent`},null,512)):l(``,!0),P.value.title.text?(_(),u(`div`,{key:3,ref_key:`chartTitle`,ref:zt,style:`width:100%;background:transparent`},[f(ve,{config:{title:{cy:`mood-radar-title`,...P.value.title},subtitle:{cy:`mood-radar-subtitle`,...P.value.title.subtitle}}},null,8,[`config`])],512)):l(``,!0),d(`div`,{id:`legend-top-${T.value}`},null,8,Je),j.value.show&&qt.value&&(x(en)||x(Qt))?(_(),c(x(At),{key:4,ref_key:`userOptionsRef`,ref:Gt,backgroundColor:P.value.backgroundColor,color:P.value.color,isPrinting:x(nn),isImaging:x(rn),uid:T.value,hasPdf:j.value.buttons.pdf,hasXls:j.value.buttons.csv,hasImg:j.value.buttons.img,hasSvg:j.value.buttons.svg,hasTable:j.value.buttons.table,hasFullscreen:j.value.buttons.fullscreen,hasAltCopy:j.value.buttons.altCopy,isFullscreen:Y.value,titles:{...j.value.buttonTitles},chartElement:E.value,position:j.value.position,hasAnnotator:j.value.buttons.annotator,isAnnotation:X.value,callbacks:j.value.callbacks,printScale:j.value.print.scale,tableDialog:A.value.table.useDialog,isCursorPointer:F.value,onToggleFullscreen:yn,onGeneratePdf:x(an),onGenerateCsv:gn,onGenerateImage:x(An),onGenerateSvg:x(kn),onToggleTable:vn,onToggleAnnotator:bn,onCopyAlt:jn,style:g({visibility:x(en)?x(Qt)?`visible`:`hidden`:`visible`})},Fe({_:2},[Ve(x(Se)(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,h(m(x(Ce)(t,n))),void 0,!0)])}))]),1032,/* @__PURE__ */ `backgroundColor.color.isPrinting.isImaging.uid.hasPdf.hasXls.hasImg.hasSvg.hasTable.hasFullscreen.hasAltCopy.isFullscreen.titles.chartElement.position.hasAnnotator.isAnnotation.callbacks.printScale.tableDialog.isCursorPointer.onGeneratePdf.onGenerateImage.onGenerateSvg.style`.split(`.`))):l(``,!0),d(`div`,Ye,[(_(),u(`svg`,{ref_key:`svgRef`,ref:L,xmlns:x(le),"aria-describedby":`chart-instructions-${T.value}`,viewBox:`0 0 ${z.value.width} ${z.value.height}`,class:ze({"vue-data-ui-fullscreen--on":Y.value,"vue-data-ui-fulscreen--off":!Y.value}),style:g(`overflow:visible;background:transparent;color:${P.value.color}`),tabindex:`0`,onFocus:Rn,onBlur:zn,onKeydown:Bn},[f(x(jt)),y(e.$slots,`svg-underlayer`,{svg:{...z.value,isPrintingImg:x(nn)||x(rn)||x(Dn),isPrintingSvg:x(On)}},void 0,!0),e.$slots[`chart-background`]?(_(),u(`foreignObject`,{key:0,x:0,y:0,width:z.value.width,height:z.value.height,style:{pointerEvents:`none`}},[y(e.$slots,`chart-background`,{},void 0,!0)],8,Ze)):l(``,!0),d(`defs`,null,[f(De,{t:`radial`,cx:`50%`,cy:`50%`,r:`50%`,fx:`50%`,fy:`50%`,id:`mood_radar_gradient_${T.value}`,stops:[[`0%`,x(o)(N.value.dataPolygon.color,N.value.dataPolygon.opacity),1],[`100%`,x(o)(x(ie)(N.value.dataPolygon.color,N.value.dataPolygon.gradient.intensity/100),N.value.dataPolygon.opacity),1]]},null,8,[`id`,`stops`])]),(_(!0),u(Ne,null,Ve(un.value.coordinates,e=>(_(),u(`line`,{x1:z.value.width/2,y1:z.value.height/2,x2:e.x,y2:e.y,stroke:N.value.grid.stroke,"stroke-width":N.value.grid.strokeWidth},null,8,Qe))),256)),d(`path`,{d:un.value.path,fill:`none`,stroke:N.value.outerPolygon.stroke,"stroke-width":N.value.outerPolygon.strokeWidth,"stroke-linejoin":`round`,"stroke-linecap":`round`},null,8,$e),d(`g`,{transform:B(`5`)},[d(`path`,{fill:`none`,stroke:M.value.colors[5],"stroke-width":`1`,"stroke-linecap":`round`,d:`M119 25A1 1 0 00137 25 1 1 0 00119 25M123 26C124 33 132 33 133 26L123 26M123 22A1 1 0 00126 22 1 1 0 00123 22M130 22A1 1 0 00133 22 1 1 0 00130 22`},null,8,tt),d(`circle`,{role:`button`,class:`vue-ui-mood-radar-trap`,cx:`128`,cy:`25`,r:`20`,"aria-label":$(`5`),fill:D.value===`5`?x(o)(M.value.colors[5],20):`transparent`,onMouseenter:i[0]||=e=>W(`5`),onMouseleave:i[1]||=e=>G(`5`),onClick:i[2]||=e=>K(`5`)},null,40,nt)],8,et),d(`g`,{transform:B(`4`)},[d(`path`,{fill:`none`,stroke:M.value.colors[4],"stroke-width":`1`,"stroke-linecap":`round`,d:`M218 95A1 1 0 00236 95 1 1 0 00218 95M222 97C225 99 229 99 232 97M222 92A1 1 0 00225 92 1 1 0 00222 92M229 92A1 1 0 00232 92 1 1 0 00229 92`},null,8,it),d(`circle`,{class:`vue-ui-mood-radar-trap`,cx:`227`,cy:`95.5`,r:`20`,"aria-label":$(`4`),fill:D.value===`4`?x(o)(M.value.colors[4],20):`transparent`,onMouseenter:i[3]||=e=>W(`4`),onMouseleave:i[4]||=e=>G(`4`),onClick:i[5]||=e=>K(`4`)},null,40,at)],8,rt),d(`g`,{transform:B(`3`)},[d(`path`,{fill:`none`,stroke:M.value.colors[3],"stroke-width":`1`,"stroke-linecap":`round`,d:`M181 213A1 1 0 00199 213 1 1 0 00181 213M185 210A1 1 0 00188 210 1 1 0 00185 210M192 210A1 1 0 00195 210 1 1 0 00192 210M185 215 195 215`},null,8,st),d(`circle`,{class:`vue-ui-mood-radar-trap`,cx:`190`,cy:`213.5`,r:`20`,"aria-label":$(`3`),fill:D.value===`3`?x(o)(M.value.colors[3],20):`transparent`,onMouseenter:i[6]||=e=>W(`3`),onMouseleave:i[7]||=e=>G(`3`),onClick:i[8]||=e=>K(`3`)},null,40,ct)],8,ot),d(`g`,{transform:B(`2`)},[d(`path`,{fill:`none`,stroke:M.value.colors[2],"stroke-width":`1`,"stroke-linecap":`round`,d:`M56 213A1 1 0 0074 213 1 1 0 0056 213M60 216C63 214 67 214 70 216M60 210A1 1 0 0063 210 1 1 0 0060 210M67 210A1 1 0 0070 210 1 1 0 0067 210`},null,8,ut),d(`circle`,{class:`vue-ui-mood-radar-trap`,cx:`65`,cy:`213.5`,r:`20`,"aria-label":$(`2`),fill:D.value===`2`?x(o)(M.value.colors[2],20):`transparent`,onMouseenter:i[9]||=e=>W(`2`),onMouseleave:i[10]||=e=>G(`2`),onClick:i[11]||=e=>K(`2`)},null,40,dt)],8,lt),d(`g`,{transform:B(`1`)},[d(`path`,{fill:`none`,stroke:M.value.colors[1],"stroke-width":`1`,"stroke-linecap":`round`,d:`M20 96A1 1 0 0038 96 1 1 0 0020 96M24 100C25 95 33 95 34 100L24 100M24 93A1 1 0 0027 93 1 1 0 0024 93M31 93A1 1 0 0034 93 1 1 0 0031 93`},null,8,pt),d(`circle`,{class:`vue-ui-mood-radar-trap`,cx:`29`,cy:`95.5`,r:`20`,"aria-label":$(`1`),fill:D.value===`1`?x(o)(M.value.colors[1],20):`transparent`,onMouseenter:i[12]||=e=>W(`1`),onMouseleave:i[13]||=e=>G(`1`),onClick:i[14]||=e=>K(`1`)},null,40,mt)],8,ft),d(`path`,{d:x(te)(mn.value.map(e=>e.plots)),stroke:N.value.dataPolygon.stroke,"stroke-width":N.value.dataPolygon.strokeWidth,"stroke-linecap":`round`,"stroke-linejoin":`round`,fill:N.value.dataPolygon.gradient.show?`url(#mood_radar_gradient_${T.value})`:x(o)(N.value.dataPolygon.color,N.value.dataPolygon.opacity)},null,8,ht),(_(!0),u(Ne,null,Ve(mn.value.map(e=>e.plots),(e,t)=>(_(),u(`g`,{class:`vue-ui-mood-radar-trap`,style:g(`opacity:${D.value==e.key?`1`:`0`}`)},[d(`line`,{x1:e.x,y1:e.y,x2:z.value.width/2,y2:z.value.height/2,stroke:M.value.colors[e.key]},null,8,gt),d(`circle`,{cx:e.x,cy:e.y,fill:M.value.colors[e.key],r:`3`,stroke:P.value.backgroundColor,"stroke-width":.5},null,8,_t),d(`circle`,{cx:z.value.width/2,cy:z.value.height/2,fill:M.value.colors[e.key],r:`3`,stroke:P.value.backgroundColor,"stroke-width":.5},null,8,vt),d(`text`,{x:z.value.width/2,y:[`5`,5].includes(e.key)?z.value.height/2*1.13:z.value.height/2*.9375,fill:N.value.dataLabel.color,"font-size":`12`,"text-anchor":`middle`,"font-weight":N.value.dataLabel.bold?`bold`:`normal`},b(x(oe)(N.value.dataLabel.formatter,e.value,x(a)({p:N.value.dataLabel.prefix,v:e.value,s:N.value.dataLabel.suffix,r:N.value.dataLabel.roundingValue}),{datapoint:e,seriesIndex:t})),9,yt),d(`text`,{x:z.value.width/2,y:[`5`,5].includes(e.key)?z.value.height/2*1.273:z.value.height/2*.7968,fill:N.value.dataLabel.color,"font-size":`12`,"text-anchor":`middle`},` (`+b(x(a)({v:e.value/V.value*100,s:`%`,r:N.value.dataLabel.roundingPercentage}))+`) `,9,bt)],4))),256)),y(e.$slots,`svg`,{svg:{...z.value,isPrintingImg:x(nn)||x(rn)||x(Dn),isPrintingSvg:x(On)}},void 0,!0)],46,Xe)),e.$slots.hint?(_(),u(`div`,xt,[y(e.$slots,`hint`,h(m({hint:A.value.a11y.translations.keyboardNavigation,isVisible:Kt.value})),void 0,!0)])):l(``,!0)]),e.$slots.watermark?(_(),u(`div`,St,[y(e.$slots,`watermark`,h(m({isPrinting:x(nn)||x(rn)||x(Dn)||x(On)})),void 0,!0)])):l(``,!0),d(`div`,{id:`legend-bottom-${T.value}`},null,8,Ct),Ut.value&&(P.value.legend.show||e.$slots.legend)?(_(),c(Pe,{key:6,to:P.value.legend.position===`top`?`#legend-top-${T.value}`:`#legend-bottom-${T.value}`},[d(`div`,{ref_key:`chartLegend`,ref:Bt},[y(e.$slots,`legend`,{legend:H.value},()=>[P.value.legend.show?(_(),c(je,{legendSet:pn.value,config:hn.value,key:`legend_${Rt.value}`,isCursorPointer:F.value,style:{display:`flex`,"row-gap":`6px`},onFocusMarker:i[15]||=({legend:e})=>U(e.key)},{item:S(({legend:e,index:t})=>[d(`div`,{role:`button`,onClick:()=>U(e.key),style:{display:`flex`,"flex-direction":`row`,gap:`3px`,"align-items":`center`,margin:`3px 0`},onKeydown:t=>Vn(t,String(e.key))},[e.key==1?(_(),c(x(C),{key:0,strokeWidth:1,name:`moodSad`,stroke:M.value.colors[e.key]},null,8,[`stroke`])):l(``,!0),e.key==2?(_(),c(x(C),{key:1,strokeWidth:1,name:`moodFlat`,stroke:M.value.colors[e.key]},null,8,[`stroke`])):l(``,!0),e.key==3?(_(),c(x(C),{key:2,strokeWidth:1,name:`moodNeutral`,stroke:M.value.colors[e.key]},null,8,[`stroke`])):l(``,!0),e.key==4?(_(),c(x(C),{key:3,strokeWidth:1,name:`smiley`,stroke:M.value.colors[e.key]},null,8,[`stroke`])):l(``,!0),e.key==5?(_(),c(x(C),{key:4,strokeWidth:1,name:`moodHappy`,stroke:M.value.colors[e.key]},null,8,[`stroke`])):l(``,!0),x(Yt)?l(``,!0):(_(),u(`span`,{key:5,style:g({fontWeight:P.value.legend.bold?`bold`:`normal`})},b(e.display),5))],40,wt)]),_:1},8,[`legendSet`,`config`,`isCursorPointer`])):l(``,!0)],!0)],512)],8,[`to`])):l(``,!0),e.$slots.source?(_(),u(`div`,{key:7,ref_key:`source`,ref:Ht,dir:`auto`},[y(e.$slots,`source`,{},void 0,!0)],512)):l(``,!0),qt.value&&j.value.buttons.table?(_(),c(He(Z.value.component),Le({key:8},Z.value.props,{ref_key:`tableUnit`,ref:Wt,onClose:Sn}),Fe({content:S(()=>[f(x(Ot),{colNames:J.value.colNames,head:J.value.head,body:J.value.body,config:J.value.config,title:A.value.table.useDialog?``:Z.value.title,withCloseButton:!A.value.table.useDialog,isCursorPointer:F.value,onClose:Sn},{th:S(({th:e})=>[e===`__SUM__`?(_(),u(`div`,Tt,[f(x(C),{name:`sigma`,stroke:J.value.config.th.color,size:16},null,8,[`stroke`])])):(_(),u(`div`,Et,b(e),1))]),td:S(({td:e})=>[Ie(b(e.name||e),1)]),_:1},8,[`colNames`,`head`,`body`,`config`,`title`,`withCloseButton`,`isCursorPointer`])]),_:2},[A.value.table.useDialog?{name:`title`,fn:S(()=>[Ie(b(Z.value.title),1)]),key:`0`}:void 0,A.value.table.useDialog?{name:`actions`,fn:S(()=>[d(`button`,{tabindex:`0`,class:`vue-ui-user-options-button`,onClick:i[16]||=e=>gn(j.value.callbacks.csv),style:g({cursor:F.value?`pointer`:`default`})},[f(x(C),{name:`fileCsv`,stroke:Z.value.props.color},null,8,[`stroke`])],4)]),key:`1`}:void 0]),1040)):l(``,!0),y(e.$slots,`skeleton`,{},()=>[x(Yt)?(_(),c(fe,{key:0})):l(``,!0)],!0)],46,Ke))}},[[`__scopeId`,`data-v-1981237d`]]);export{Ge as n,C as t};
@@ -1,19 +0,0 @@
1
- import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{n as t,r as n,t as r}from"./annotationSlots-OLiW25XN.js";import{t as i}from"./useConfig-By3Vb5kz.js";import{$ as a,D as o,Dt as s,Ht as c,It as l,Jt as ee,Kt as u,S as te,Ut as ne,X as re,Zt as ie,at as ae,b as oe,f as se,i as ce,in as le,it as ue,n as de,nn as fe,nt as pe,p as me,pt as he,t as ge,w 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"./userOptionsSlots-DYuo-E5m.js";import{t as Ne}from"./usePrinter-DVf3YcG5.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-BIzyyI1h.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{t as Ve}from"./labelUtils-CdtU-yB_.js";import{t as He}from"./Legend-DM0ClX3D.js";import{t as Ue}from"./vue_ui_nested_donuts-CRtGsJcz.js";import{Fragment as d,Teleport as We,computed as f,createBlock as p,createCommentVNode as m,createElementBlock as h,createElementVNode as g,createSlots as Ge,createTextVNode as Ke,createVNode as qe,defineAsyncComponent as _,guardReactiveProps as v,mergeProps as Je,nextTick as Ye,normalizeClass as Xe,normalizeProps as y,normalizeStyle as Ze,onBeforeUnmount as Qe,onMounted as $e,openBlock as b,ref as x,renderList as S,renderSlot as C,resolveDynamicComponent as et,shallowRef as tt,toDisplayString as w,toRefs as nt,unref as T,vShow as rt,watch as it,withCtx as E,withDirectives as at}from"vue";var ot=/* @__PURE__ */ e({default:()=>Lt}),st=[`id`],ct=[`id`],lt=[`id`],ut={style:{position:`relative`}},dt=[`xmlns`,`aria-describedby`,`viewBox`],ft=[`width`,`height`],pt=[`id`],mt=[`id`],ht=[`id`],gt=[`flood-color`],_t=[`id`,`d`],vt=[`d`,`fill`,`stroke`,`stroke-width`,`filter`],yt=[`d`,`fill`,`stroke`,`stroke-width`],bt={key:1},xt=[`d`,`fill`],St={key:2},Ct=[`font-size`,`font-weight`,`fill`,`dy`],wt=[`href`],Tt=[`x`,`y`,`font-size`,`font-weight`,`fill`],Et={key:3},Dt=[`filter`],Ot=[`opacity`,`text-anchor`,`x`,`y`,`fill`,`font-size`,`font-weight`],kt=[`opacity`,`text-anchor`,`x`,`y`,`fill`,`font-size`,`font-weight`],At=[`d`,`fill`,`onMouseenter`,`onClick`,`onMouseleave`],jt={key:0,style:{position:`absolute`,top:`100%`,left:`0`,width:`100%`},"data-dom-to-png-ignore":``,"aria-hidden":`true`},Mt={key:5,class:`vue-data-ui-watermark`},Nt=[`id`],Pt={key:0,class:`vue-ui-nested-donuts-legend-title`},Ft=[`onClick`],It={style:{display:`flex`,"align-items":`center`}},Lt=/*#__PURE__*/ Ce({__name:`vue-ui-nested-donuts`,props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:[`selectLegend`,`selectDatapoint`,`copyAlt`],setup(e,{expose:Ce,emit:ot}){let Lt=_(()=>import(`./Tooltip-C1q0Qoh7.js`)),Rt=_(()=>import(`./BaseIcon-CoY0vuL3.js`).then(e=>e.n)),zt=_(()=>import(`./vue-ui-accordion-DFxSW8ET.js`).then(e=>e.n)),Bt=_(()=>import(`./DataTable-Dof6yhO7.js`)),Vt=_(()=>import(`./UserOptions-DW84OKKr.js`).then(e=>e.n)),Ht=_(()=>import(`./PenAndPaper-DoNTA-SV.js`).then(e=>e.t)),Ut=_(()=>import(`./PackageVersion-Bczw6rsP.js`).then(e=>e.t)),Wt=_(()=>import(`./BaseDraggableDialog-BK7dj9O6.js`).then(e=>e.n)),{vue_ui_nested_donuts:Gt}=i(),{isThemeValid:Kt,warnInvalidTheme:qt}=Te(),D=e,Jt=f({get(){return!!D.dataset&&D.dataset.length},set(e){return e}}),O=x(re()),Yt=x(!1),Xt=x(``),Zt=x(null),Qt=x(0),$t=x(null),en=x(null),tn=x(null),nn=x(null),rn=x(null),an=x(0),on=x(0),sn=x(0),k=x(!0),A=x([]),cn=x([]),ln=x(!1),un=x(null),dn=x(null),j=x(null),fn=x({x:0,y:0}),pn=x(`pointer`),mn=x(!1),M=x(!1);function hn(e){M.value=e,Qt.value+=1}let N=x(Cn()),P=f(()=>N.value.style.chart.layout.labels),F=f(()=>N.value.style.chart.tooltip),I=f(()=>N.value.userOptions),L=f(()=>N.value.style.chart.layout),R=f(()=>N.value.style.chart);xe({config:()=>N.value,dataset:()=>D.dataset,component:`VueUiNestedDonuts`,rules:[Se.emptyArray,{test:e=>e.some(e=>e.series.length>6),message:[`👀 Some series have > 6 data points. Consider:`,``,`▶️ Grouping small values dynamically into a single "Other" data point.`,``,`▶️ Using filters to let users choose a maximum number of data points to display.`,``,`▶️ Using VueUiHorizontalBar instead to make the dataset breakdown easier to read.`]},{test:e=>e.length===1,message:[`👀 There is only one series in your dataset. Consider:`,``,`▶️ Using VueUiDonut instead.`]},{test:e=>e.length>6,message:[`👀 The number of series in your dataset > 6. Consider:`,``,`▶️ 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 z=f(()=>N.value.userOptions.useCursorPointer),gn={name:``,series:[{name:``,values:[3],color:`#BABABA`},{name:``,values:[2],color:`#AAAAAA`},{name:``,values:[1],color:`#CACACA`}]},_n=f(()=>le({defaultConfig:{useCssAnimation:!1,table:{show:!1},startAnimation:{show:!1},userOptions:{show:!1},style:{chart:{backgroundColor:`#99999930`,layout:{labels:{dataLabels:{show:!1}}},legend:{backgroundColor:`transparent`,showValue:!1,showPercentage:!1},title:{color:`#1A1A1A`,subtitle:{color:`#5A5A5A`}}}}},userConfig:N.value.skeletonConfig??{}})),{loading:vn,FINAL_DATASET:B,manualLoading:yn}=ye({...nt(D),FINAL_CONFIG:N,prepareConfig:Cn,callback:()=>{Promise.resolve().then(async()=>{await Dn()})},skeletonDataset:D.config?.skeletonDataset??[gn,gn],skeletonConfig:le({defaultConfig:N.value,userConfig:_n.value})}),{userOptionsVisible:bn,setUserOptionsVisibility:xn,keepUserOptionState:Sn}=ze({config:N.value}),{svgRef:V}=Be({config:R.value.title});function Cn(){let e=we({userConfig:D.config,defaultConfig:Gt}),t={},n=e.theme;if(n){if(!Kt.value(e))qt(e),t=e;else{let r=we({userConfig:Ue[n]||D.config,defaultConfig:e});t={...we({userConfig:D.config,defaultConfig:r}),customPalette:e.customPalette.length?e.customPalette:fe[n]||c}}}else t=e;return t}let wn=ie(D.config);it(()=>D.config,(e,t)=>{let n=ie(e),r=n!==wn;wn=n;let i=Cn();r?(vn.value||(N.value=i),bn.value=!N.value.userOptions.showOnChartHover,kn(),an.value+=1,on.value+=1,sn.value+=1,W.value.dataLabels.show=P.value.dataLabels.show,W.value.showTable=N.value.table.show,W.value.showTooltip=F.value.show,G.value.width=R.value.width,G.value.height=R.value.height):(N.value.style.chart.tooltip=i.style.chart.tooltip,W.value.showTooltip=N.value.style.chart.tooltip.show)},{deep:!0});let Tn=f(()=>{let{top:e,right:t,bottom:n,left:r}=R.value.padding;return{css:`padding:${e}px ${t}px ${n}px ${r}px`,top:e,right:t,bottom:n,left:r}});function En(e,t=1e3,n=50){return new Promise(r=>{let i=e.length;A.value=Array(i).fill(0),cn.value=[];let a=0;e.forEach((e,o)=>{setTimeout(()=>{let n=performance.now();function s(c){let l=Math.min((c-n)/t,1),ee=e*ue(l);A.value[o]=ee,A.value=[...A.value];let te=[],ne=0;D.dataset.forEach((e,t)=>{let n=oe(e.series.reduce((e,t)=>e+oe(u(t.values).reduce((e,t)=>e+t,0)),0))-oe(A.value.slice(ne,ne+e.series.length).reduce((e,t)=>e+t,0));n>Number.MIN_VALUE&&te.push({name:`__ghost__`,arcOf:e.name,arcOfId:`${O.value}_${t}`,id:`ghost_${O.value}_${t}`,seriesIndex:-1,datasetIndex:t,color:`transparent`,value:n,fullValue:n,absoluteValues:[],ghost:!0}),ne+=e.series.length}),cn.value=te,l<1?requestAnimationFrame(s):(a+=1,a===i&&r())}requestAnimationFrame(s)},o*n)})})}async function Dn(){if(N.value.startAnimation?.show){let e=B.value.flatMap(e=>e.series).map(e=>u(e.values).reduce((e,t)=>e+t,0));A.value=e.map(()=>0),k.value=!0,cn.value=B.value.map((e,t)=>{let n=e.series.reduce((e,t)=>e+u(t.values).reduce((e,t)=>e+t,0),0);return{name:`__ghost__`,arcOf:e.name,arcOfId:`${O.value}_${t}`,id:`ghost_${O.value}_${t}`,seriesIndex:-1,datasetIndex:t,color:`transparent`,value:n,fullValue:n,absoluteValues:[],ghost:!0}}),await Ye(),En(e,N.value.startAnimation.durationMs,N.value.startAnimation.staggerMs).then(()=>{k.value=!1,cn.value=[]})}else k.value=!1}$e(async()=>{ln.value=!0,kn(),await Dn()});let H=tt(null),On=tt(null),U=f(()=>N.value.debug);function kn(){if(ve(D.dataset)?(ae({componentName:`VueUiNestedDonuts`,type:`dataset`,debug:U.value}),Jt.value=!1,yn.value=!0):yn.value=N.value.loading,N.value.responsive){let e=Pe(()=>{let{width:e,height:t}=Fe({chart:$t.value,title:R.value.title.text?en.value:null,legend:R.value.legend.show?tn.value:null,source:nn.value,noTitle:rn.value,padding:Tn.value});requestAnimationFrame(()=>{G.value.width=e,G.value.height=t})});H.value&&(On.value&&H.value.unobserve(On.value),H.value.disconnect()),H.value=new ResizeObserver(e),On.value=$t.value.parentNode,H.value.observe(On.value)}}Qe(()=>{H.value&&(On.value&&H.value.unobserve(On.value),H.value.disconnect())});let{isPrinting:An,isImaging:jn,generatePdf:Mn,generateImage:Nn}=Ne({elementId:`nested_donuts_${O.value}`,fileName:R.value.title.text||`vue-ui-nested-donuts`,options:N.value.userOptions.print}),Pn=f(()=>N.value.userOptions.show&&!R.value.title.text),Fn=f(()=>_e(N.value.customPalette)),W=x({dataLabels:{show:P.value.dataLabels.show},showTable:N.value.table.show,showTooltip:F.value.show});it(N,()=>{W.value={dataLabels:{show:P.value.dataLabels.show},showTable:N.value.table.show,showTooltip:F.value.show}},{immediate:!0});let G=x({width:R.value.width,height:R.value.height}),K=ot;function In({datapoint:e,index:t,seriesIndex:n}){N.value.events.datapointClick&&N.value.events.datapointClick({datapoint:e,seriesIndex:n}),K(`selectDatapoint`,{datapoint:e,index:t})}function Ln({from:e,to:t,duration:n,onUpdate:r,onDone:i,easing:a=ue}){let o=performance.now();function s(c){let l=Math.min((c-o)/n,1),ee=a(l);r(e+(t-e)*ee,l),l<1?requestAnimationFrame(s):(r(t,1),i&&i())}requestAnimationFrame(s)}let q=x([]),J=f(()=>{vn.value,B.value.forEach((e,t)=>{[null,void 0].includes(e.name)&&ae({componentName:`VueUiNestedDonuts`,type:`datasetSerieAttribute`,property:`name`,index:t,debug:U.value}),[null,void 0].includes(e.series)?ae({componentName:`VueUiNestedDonuts`,type:`datasetSerieAttribute`,property:`series`,index:t,debug:U.value}):e.series.length===0?ae({componentName:`VueUiNestedDonuts`,type:`datasetAttributeEmpty`,property:`series at index ${t}`,debug:U.value}):e.series.forEach((e,t)=>{[null,void 0].includes(e.name)&&ae({componentName:`VueUiNestedDonuts`,type:`datasetSerieAttribute`,property:`name`,index:t,key:`serie`,debug:U.value}),[null,void 0].includes(e.values)&&ae({componentName:`VueUiNestedDonuts`,type:`datasetSerieAttribute`,property:`values`,index:t,key:`serie`,debug:U.value})})});let e=0;return B.value.map((t,n)=>({...t,total:t.series.filter(e=>!q.value.includes(e.id)).map(e=>u(e.values).reduce((e,t)=>e+t,0)).reduce((e,t)=>e+t,0),datasetIndex:n,id:`${O.value}_${n}`,series:t.series.map((r,i)=>{let a=u(r.values).reduce((e,t)=>e+t,0);return{name:r.name,arcOf:t.name,arcOfId:`${O.value}_${n}`,id:`${O.value}_${n}_${i}`,seriesIndex:i,datasetIndex:n,color:te(r.color)||Fn.value[i]||c[i%c.length],value:k.value?A.value[e++]??0:a,absoluteValues:r.values||[]}})}))});it(()=>D.dataset,e=>{Array.isArray(e)&&e.length>0&&(yn.value=!1)},{immediate:!0});let Y=f(()=>Math.min(G.value.height,G.value.width)*(L.value.donut.strokeWidth/512)),X=f(()=>[...J.value].map((e,t)=>{let n=e.series.filter(e=>!q.value.includes(e.id)).map(e=>e.value).reduce((e,t)=>e+t,0);return{...e,total:n,series:e.series.filter(e=>!q.value.includes(e.id)).map(e=>({...e,proportion:e.value/n}))}}));function Rn(e,t,n){let r=0;for(let t=0;t<e.length;t+=1)n.includes(e[t])&&(r+=1);return r<t}let Z=x(X.value);it(()=>X.value,e=>Z.value=e);function zn(e){let t=e.map(e=>e.id);if(e.some(e=>q.value.includes(e.id))){let e=new Set(t);q.value=q.value.filter(t=>!e.has(t))}else q.value.push(...t);K(`selectLegend`,X.value)}function Bn(e){let t=D.dataset.flatMap((e,t)=>e.series.map((e,n)=>({value:u(e.values).reduce((e,t)=>e+t,0),id:`${O.value}_${t}_${n}`,arcOfId:`${O.value}_${t}`}))).find(t=>t.id===e.id);if(!t)return;let n=J.value.flatMap(e=>e.series).find(t=>t.id===e.id)?.value??0,r=Z.value.flatMap(e=>e.series).find(t=>t.id===e.id),i=r?r.value:0,a=J.value.find(e=>e.id===t.arcOfId);if(!a)return;let o=a.series.map(e=>e.id),s=Rn(o,o.length-1,q.value);q.value.includes(e.id)?(q.value=q.value.filter(t=>t!==e.id),N.value.serieToggleAnimation.show?Ln({from:i,to:n,duration:N.value.serieToggleAnimation.durationMs,onUpdate:t=>{Z.value=Z.value.map(n=>({...n,series:n.series.map(n=>n.id===e.id?{...n,value:t}:n)}))},onDone:()=>{K(`selectLegend`,X.value)}}):(Z.value=Z.value.map(t=>({...t,series:t.series.map(t=>t.id===e.id?{...t,value:n}:t)})),K(`selectLegend`,X.value))):s&&(N.value.serieToggleAnimation.show?Ln({from:i,to:0,duration:N.value.serieToggleAnimation.durationMs,onUpdate:t=>{Z.value=Z.value.map(n=>({...n,series:n.series.map(n=>n.id===e.id?{...n,value:t}:n)}))},onDone:()=>{q.value.push(e.id),K(`selectLegend`,X.value)}}):(Z.value=Z.value.map(t=>({...t,series:t.series.map(t=>t.id===e.id?{...t,value:0}:t)})),q.value.push(e.id),K(`selectLegend`,X.value)))}function Vn(e){return J.value.length?J.value.flatMap(e=>e.series).filter(t=>t.name===e)||(U.value&&console.warn(`VueUiNestedDonuts - Series name not found "${e}"`),null):(U.value&&console.warn(`VueUiNestedDonuts - There are no series to show.`),null)}function Hn(e){let t=Vn(e);t!==null&&(Array.isArray(t)?t.forEach(e=>{q.value.includes(e.id)&&Bn({id:e.id})}):q.value.includes(t.id)&&Bn({id:t.id}))}function Un(e){let t=Vn(e);t!==null&&(Array.isArray(t)?t.forEach(e=>{q.value.includes(e.id)||Bn({id:e.id})}):q.value.includes(t.id)||Bn({id:t.id}))}let Wn=f(()=>Y.value/J.value.length*L.value.donut.spacingRatio),Gn=f(()=>Z.value.map((e,t)=>Y.value-t*Y.value/J.value.length)),Kn=f(()=>Z.value.map((e,t)=>{let n=Math.abs(e.series.map(e=>e.value).reduce((e,t)=>e+t,0))>0,r=Y.value-t*Y.value/Z.value.length,i=k.value?cn.value.find(e=>e.datasetIndex===t):null,a=[...e.series,...i?[i]:[]].map(e=>({...e,value:e.value<1e-11?Number.MIN_VALUE:e.value})),o=l({series:[{name:`_`,color:L.value.donut.emptyFill,value:1}]},G.value.width/2,G.value.height/2,r,r,1.99999,2,1,360,105.25,Wn.value),s=`M ${G.value.width/2},${G.value.height/2+r}
2
- a ${r},${r} 0 1,1 0,${-2*r}
3
- a ${r},${r} 0 1,1 0,${2*r}`;return{...e,hasData:n,radius:r,skeleton:o,fullCirclePath:s,donut:l({series:a},G.value.width/2,G.value.height/2,r,r,1.99999,2,1,360,105.25,Wn.value)}})),qn=f(()=>[...J.value].map((e,t)=>{let n=t*Y.value/J.value.length;return{sizeRatio:n,donut:l({series:[{value:1}]},G.value.width/2,G.value.height/2,Y.value-n,Y.value-n,1.99999,2,1,360,105.25,Y.value/J.value.length*L.value.donut.spacingRatio)[0]}})),Jn=x(null),Yn=x(null),Xn=x(null),Zn=x(null);function Qn({datapoint:e,seriesIndex:t}){N.value.events.datapointLeave&&N.value.events.datapointLeave({datapoint:e,seriesIndex:t}),Yt.value=!1,Jn.value=null,Zt.value=null,Yn.value=null,Xn.value=null,j.value=null,pn.value=`pointer`}function $n({val:e,percentage:t,showVal:n,showPercentage:r,config:i}){return Ve({config:i,val:e,percentage:t,showVal:n,showPercentage:r})}function er({datapoint:e,_relativeIndex:t,seriesIndex:n,triggerMode:r=`pointer`}){N.value.events.datapointEnter&&N.value.events.datapointEnter({datapoint:e,seriesIndex:n}),pn.value=r,j.value=n,Jn.value=e.arcOfId,Yn.value=e.id,Xn.value=n,Zt.value=e.id,Zn.value={datapoint:e,seriesIndex:n,series:Z.value,config:N.value};let i=F.value.customFormat;if(s(i)&&he(()=>i({seriesIndex:n,datapoint:e,series:Z.value,config:N.value})))Xt.value=i({seriesIndex:n,datapoint:e,series:Z.value,config:N.value});else{let t=``;if(F.value.showAllItemsAtIndex&&q.value.length===0){let r=Z.value.map(e=>e.series.find(e=>e.seriesIndex===n));r.forEach((i,o)=>{if(!i)return``;t+=`
4
- <div style="display:flex; flex-direction: column; justify-content:flex-start; align-items:flex-start;padding:6px 0; ${o<r.length-1?`border-bottom:1px solid ${F.value.borderColor}`:``}">
5
- <div style="display:flex; flex-direction: row; gap: 3px; justify-content:flex-start; align-items:center;">
6
- <svg viewBox="0 0 20 20" height="${F.value.fontSize}" width="${F.value.fontSize}">
7
- <circle cx="10" cy="10" r="10" fill="${i.color}"/>
8
- </svg>
9
- <span>
10
- ${i.arcOf??``} - ${i.name}
11
- </span>
12
- </div>
13
- <span>
14
- <b>
15
- ${$n({config:R.value.tooltip,showVal:F.value.showValue,showPercentage:F.value.showPercentage,val:ce(L.value.labels.dataLabels.formatter,e.value,a({p:R.value.layout.labels.dataLabels.prefix,v:e.value,s:R.value.layout.labels.dataLabels.suffix,r:R.value.tooltip.roundingValue}),{datapoint:e,seriesIndex:n}),percentage:a({v:i.proportion*100,s:`%`,r:R.value.tooltip.roundingPercentage})})}
16
- </b>
17
- </span>
18
- </div>
19
- `})}else t+=`<div style="width:100%;text-align:center;border-bottom:1px solid ${F.value.borderColor};padding-bottom:6px;margin-bottom:3px;">${e.arcOf??``} - ${e.name}</div>`,t+=`<div style="display:flex;flex-direction:row;gap:6px;align-items:center;"><svg viewBox="0 0 12 12" height="14" width="14"><circle cx="6" cy="6" r="6" stroke="none" fill="${e.color}"/></svg>`,F.value.showValue&&(t+=`<b>${ce(P.value.dataLabels.formatter,e.value,a({p:P.value.dataLabels.prefix,v:e.value,s:P.value.dataLabels.suffix,r:F.value.roundingValue}),{datapoint:e,seriesIndex:n})}</b>`),F.value.showPercentage&&(F.value.showValue?t+=`<span>(${a({v:e.proportion*100,s:`%`,r:F.value.roundingPercentage})})</span></div>`:t+=`<b>${a({v:e.proportion*100,s:`%`,r:F.value.roundingPercentage})}</b></div>`);Xt.value=`<div style="font-size:${F.value.fontSize}px">${t}</div>`}Yt.value=!0}function tr(e){return e.proportion*100>P.value.dataLabels.hideUnderValue}function nr(e,t){if(!N.value.useBlurOnHover)return``;if(F.value.showAllItemsAtIndex&&q.value.length===0)return[null,void 0].includes(Xn.value)||Xn.value===t?``:`url(#blur_${O.value})`;if(!F.value.showAllItemsAtIndex||q.value.length)return[null,void 0].includes(Yn.value)||Yn.value===e.id?``:`url(#blur_${O.value})`}let rr=f(()=>J.value.map((e,t)=>{let n=e.series.filter(e=>!q.value.includes(e.id)),r=k.value?n.map(e=>{let n=B.value[t].series.findIndex(t=>t.name===e.name);return u(B.value[t].series[n].values).reduce((e,t)=>e+t,0)}).reduce((e,t)=>e+t,0):n.map(e=>e.value).reduce((e,t)=>e+t,0);return e.series.map((e,n)=>{let i=u(B.value[t].series[n].values).reduce((e,t)=>e+t,0),o=k.value?i:e.value,s=$n({val:ce(P.value.dataLabels.formatter,o,a({p:P.value.dataLabels.prefix,v:o,s:P.value.dataLabels.suffix,r:R.value.legend.roundingValue}),{datapoint:e,seriesIndex:n}),percentage:isNaN(o/r)||q.value.includes(e.id)?`-`:a({v:o/r*100,s:`%`,r:R.value.legend.roundingPercentage}),showVal:R.value.legend.showValue,showPercentage:R.value.legend.showPercentage,config:R.value.legend}),c=`${e.name}${R.value.legend.showPercentage||R.value.legend.showValue?`: `:``}${s}`;return{name:e.name,color:e.color,value:o,display:c,svgDisplay:`${e.arcOf?`${e.arcOf} - `:``}${c}`,shape:`circle`,arcOf:e.arcOf,id:e.id,seriesIndex:n,datasetIndex:t,total:r,opacity:q.value.includes(e.id)?.5:1,segregate:()=>Bn(e),isSegregated:q.value.includes(e.id)}})})),ir=f(()=>({cy:`nested-donuts-legend`,backgroundColor:R.value.legend.backgroundColor,color:R.value.legend.color,fontSize:R.value.legend.fontSize,paddingBottom:12,fontWeight:R.value.legend.bold?`bold`:``})),Q=f(()=>({head:Z.value.flatMap(e=>e.series.map(t=>({name:`${e.name} - ${t.name}`,color:t.color,total:e.total}))),body:Z.value.flatMap(e=>e.series.map(e=>e.value))}));function ar(e=null){Ye(()=>{let t=Q.value.head.map((e,t)=>[[e.name],[Q.value.body[t]],[isNaN(Q.value.body[t]/e.total)?`-`:Q.value.body[t]/e.total*100]]),n=[[R.value.title.text],[R.value.title.subtitle.text],[[``],[`val`],[`%`]]].concat(t),r=o(n);e?e(r):pe({csvContent:r,title:R.value.title.text||`vue-ui-nested-donuts`})})}let or=f(()=>{let e=[N.value.table.columnNames.series,N.value.table.columnNames.value,N.value.table.columnNames.percentage],t=Q.value.head.map((e,t)=>{let n=a({p:P.value.dataLabels.prefix,v:Q.value.body[t],s:P.value.dataLabels.suffix,r:N.value.table.td.roundingValue});return[{color:e.color,name:e.name},n,isNaN(Q.value.body[t]/e.total)?`-`:a({v:Q.value.body[t]/e.total*100,s:`%`,r:N.value.table.td.roundingPercentage})]}),n=t.map(e=>e.map((e,t)=>t===0?e.name:e)),r={th:{backgroundColor:N.value.table.th.backgroundColor,color:N.value.table.th.color,outline:N.value.table.th.outline},td:{backgroundColor:N.value.table.td.backgroundColor,color:N.value.table.td.color,outline:N.value.table.td.outline},breakpoint:N.value.table.responsiveBreakpoint};return{colNames:[N.value.table.columnNames.series,N.value.table.columnNames.value,N.value.table.columnNames.percentage],head:e,body:t,a11yBody:n,config:r}});function sr(){return J.value}function cr(){W.value.showTable=!W.value.showTable}function lr(){W.value.dataLabels.show=!W.value.dataLabels.show}function ur(){W.value.showTooltip=!W.value.showTooltip}let dr=x(!1);function fr(){dr.value=!dr.value}let pr=Ee($t,()=>R.value.title.text),mr=x(null);function hr(){if(!mr.value)return;let{x:e,y:t,width:n,height:r}=mr.value.getBBox();V.value&&V.value.setAttribute(`viewBox`,`${e} ${t} ${n+Math.min(0,e)} ${r+Math.min(0,t)}`)}let gr=f(()=>Ae({config:N,style:R,mutableConfig:W,dialog:Wt,accordion:zt,isFullscreen:M,parent:$t,maxWidth:800,isCursorPointer:z}));it(()=>W.value.showTable,e=>ke(e,N,un));function _r(){W.value.showTable=!1,dn.value&&dn.value.setTableIconState(!1)}let vr=f(()=>R.value.backgroundColor),yr=f(()=>R.value.legend),br=f(()=>R.value.title),xr=f(()=>rr.value.flat().map(e=>({...e,name:e.svgDisplay}))),{isCallbackImaging:Sr,isCallbackSvg:Cr,generateSvg:wr,onGenerateImage:Tr}=Oe({svg:V,title:br,legend:yr,legendItems:xr,backgroundColor:vr,getSvgCallback:()=>N.value.userOptions.callbacks.svg,generateImage:Nn});async function Er(){K(`copyAlt`,{config:N.value,dataset:Z.value}),N.value.userOptions.callbacks.altCopy?await Promise.resolve(N.value.userOptions.callbacks.altCopy({config:N.value,dataset:Z.value})):console.warn("Vue Data UI - A callback must be set for `altCopy` in userOptions.")}let $=f(()=>Kn.value.flatMap(e=>e.donut.filter(e=>!e.ghost)));function Dr(){j.value=null,mn.value=!0}function Or(){j.value=null,pn.value=`pointer`,Yt.value=!1,Jn.value=null,Zt.value=null,Yn.value=null,Xn.value=null,mn.value=!1}function kr(e){if(!V.value||dr.value||document.activeElement!==V.value||!$.value.length)return;let t=[`ArrowLeft`,`ArrowUp`].includes(e.key),n=[`ArrowRight`,`ArrowDown`].includes(e.key),r=e.key===`Enter`||e.key===` `,i=e.key===`Escape`;if(!t&&!n&&!r&&!i)return;if(e.preventDefault(),e.stopPropagation(),i){j.value=null,pn.value=`pointer`,Yt.value=!1,Jn.value=null,Zt.value=null,Yn.value=null,Xn.value=null;return}if(r){if(j.value===null)return;let e=$.value[j.value];if(!e)return;In({datapoint:e,index:j.value,seriesIndex:e.seriesIndex});return}let a=j.value,o=Xn.value,s=a!==null&&a>=0&&a<$.value.length,c=o!==null&&o>=0&&o<$.value.length;s?n?(a+=1,a>=$.value.length&&(a=0)):t&&(--a,a<0&&(a=$.value.length-1)):c?(a=n?o+1:o-1,a>=$.value.length&&(a=0),a<0&&(a=$.value.length-1)):a=n?0:$.value.length-1;let l=$.value[a];l&&(j.value=a,Ar(),er({datapoint:l,relativeIndex:a,seriesIndex:l.seriesIndex,show:!0,triggerMode:`keyboard`}))}function Ar(){if(!V.value)return;let e=V.value.getBoundingClientRect();fn.value={x:e.left+e.width/2,y:e.top+e.height/2}}let jr=f(()=>({headers:or.value?.colNames??[],rows:or.value?.a11yBody??[]}));return Ce({autoSize:hr,getData:sr,getImage:pr,generatePdf:Mn,generateCsv:ar,generateImage:Nn,generateSvg:wr,hideSeries:Un,showSeries:Hn,toggleTable:cr,toggleLabels:lr,toggleTooltip:ur,toggleAnnotator:fr,toggleFullscreen:hn,copyAlt:Er}),(e,i)=>(b(),h(`div`,{ref_key:`nestedDonutsChart`,ref:$t,class:Xe(`vue-data-ui-component vue-ui-nested-donuts ${M.value?`vue-data-ui-wrapper-fullscreen`:``} ${N.value.useCssAnimation?``:`vue-ui-dna`}`),style:Ze(`font-family:${N.value.style.fontFamily};width:100%; text-align:center;background:${R.value.backgroundColor}`),id:`nested_donuts_${O.value}`,onMouseenter:i[2]||=()=>T(xn)(!0),onMouseleave:i[3]||=()=>T(xn)(!1)},[g(`div`,{id:`chart-instructions-${O.value}`,class:`sr-only`},[g(`p`,null,w(N.value.a11y.translations.keyboardNavigation),1)],8,ct),jr.value?.rows?.length?(b(),p(Re,{key:0,uid:O.value,head:jr.value.headers,body:jr.value.rows,notice:N.value.a11y.translations.tableAvailable,caption:N.value.a11y.translations.tableCaption},null,8,[`uid`,`head`,`body`,`notice`,`caption`])):m(``,!0),I.value.buttons.annotator?(b(),p(T(Ht),Je({key:1},T(n)(I.value.annotator),{svgRef:T(V),backgroundColor:R.value.backgroundColor,color:R.value.color,active:dr.value,isCursorPointer:z.value,palette:I.value.annotatorPalette,onClose:fr}),Ge({_:2},[S(T(r),n=>({name:n,fn:E(r=>[C(e.$slots,n,y(v(T(t)(n,r))),void 0,!0)])}))]),1040,[`svgRef`,`backgroundColor`,`color`,`active`,`isCursorPointer`,`palette`])):m(``,!0),Pn.value?(b(),h(`div`,{key:2,ref_key:`noTitle`,ref:rn,class:`vue-data-ui-no-title-space`,style:`height:36px; width: 100%;background:transparent`},null,512)):m(``,!0),R.value.title.text?(b(),h(`div`,{key:3,ref_key:`chartTitle`,ref:en},[(b(),p(De,{key:`title_${an.value}`,config:{title:{cy:`donut-div-title`,...R.value.title},subtitle:{cy:`donut-div-subtitle`,...R.value.title.subtitle}}},null,8,[`config`]))],512)):m(``,!0),g(`div`,{id:`legend-top-${O.value}`},null,8,lt),I.value.show&&Jt.value&&(T(Sn)||T(bn))?(b(),p(T(Vt),{ref_key:`userOptionsRef`,ref:dn,key:`user_option_${Qt.value}`,backgroundColor:R.value.backgroundColor,color:R.value.color,isPrinting:T(An),isImaging:T(jn),uid:O.value,hasTooltip:I.value.buttons.tooltip&&F.value.show,hasPdf:I.value.buttons.pdf,hasXls:I.value.buttons.csv,hasImg:I.value.buttons.img,hasSvg:I.value.buttons.svg,hasTable:I.value.buttons.table,hasLabel:I.value.buttons.labels,hasFullscreen:I.value.buttons.fullscreen,hasAltCopy:I.value.buttons.altCopy,isFullscreen:M.value,isTooltip:W.value.showTooltip,titles:{...I.value.buttonTitles},chartElement:$t.value,position:I.value.position,hasAnnotator:I.value.buttons.annotator,isAnnotation:dr.value,callbacks:I.value.callbacks,printScale:I.value.print.scale,tableDialog:N.value.table.useDialog,isCursorPointer:z.value,onToggleFullscreen:hn,onGeneratePdf:T(Mn),onGenerateCsv:ar,onGenerateImage:T(Tr),onGenerateSvg:T(wr),onToggleTable:cr,onToggleLabels:lr,onToggleTooltip:ur,onToggleAnnotator:fr,onCopyAlt:Er,style:Ze({visibility:T(Sn)?T(bn)?`visible`:`hidden`:`visible`})},Ge({_:2},[S(T(je)(e.$slots,`menuIcon optionTooltip optionPdf optionCsv optionImg optionSvg optionTable optionLabels optionFullscreen optionAnnotator optionAltCopy custom-menu-before custom-menu-after`),t=>({name:t,fn:E(n=>[C(e.$slots,t,y(v(T(Me)(t,n))),void 0,!0)])}))]),1032,/* @__PURE__ */ `backgroundColor.color.isPrinting.isImaging.uid.hasTooltip.hasPdf.hasXls.hasImg.hasSvg.hasTable.hasLabel.hasFullscreen.hasAltCopy.isFullscreen.isTooltip.titles.chartElement.position.hasAnnotator.isAnnotation.callbacks.printScale.tableDialog.isCursorPointer.onGeneratePdf.onGenerateImage.onGenerateSvg.style`.split(`.`))):m(``,!0),g(`div`,ut,[(b(),h(`svg`,{ref_key:`svgRef`,ref:V,xmlns:T(ge),"aria-describedby":`chart-instructions-${O.value}`,class:Xe({"vue-data-ui-fullscreen--on":M.value,"vue-data-ui-fulscreen--off":!M.value,"vue-data-ui-svg":!0}),viewBox:`0 0 ${G.value.width<=0?.001:G.value.width} ${G.value.height<0?.001:G.value.height}`,style:Ze(`max-width:100%; overflow: visible; background:transparent;color:${R.value.color};${Tn.value.css}`),tabindex:`0`,onFocus:Dr,onBlur:Or,onKeydown:kr},[g(`g`,{ref_key:`G`,ref:mr,class:`vue-data-ui-g`},[qe(T(Ut)),C(e.$slots,`svg-underlayer`,{svg:{...G.value,isPrintingImg:T(An)||T(jn)||T(Sr),isPrintingSvg:T(Cr)}},void 0,!0),e.$slots[`chart-background`]?(b(),h(`foreignObject`,{key:0,x:0,y:0,width:G.value.width<=0?.001:G.value.width,height:G.value.height<0?.001:G.value.height,style:{pointerEvents:`none`}},[C(e.$slots,`chart-background`,{},void 0,!0)],8,ft)):m(``,!0),g(`defs`,null,[(b(!0),h(d,null,S(qn.value,(e,t)=>(b(),p(Ie,{t:`radial`,id:`radial_${O.value}_${t}`,key:`radial_${O.value}_${t}`,stops:[[`0%`,`#FFFFFF`,0],[`${(1-Wn.value/Gn.value[t])*100}%`,T(ee)(`#FFFFFF`,0),0],[`${(1-Wn.value/Gn.value[t]/2)*100}%`,`#FFFFFF`,R.value.gradientIntensity/100],[`100%`,`#FFFFFF`,0]]},null,8,[`id`,`stops`]))),128))]),g(`defs`,null,[g(`filter`,{id:`blur_${O.value}`,x:`-50%`,y:`-50%`,width:`200%`,height:`200%`},[g(`feGaussianBlur`,{in:`SourceGraphic`,stdDeviation:2,id:`blur_std_${O.value}`},null,8,mt),i[4]||=g(`feColorMatrix`,{type:`saturate`,values:`0`},null,-1)],8,pt),g(`filter`,{id:`shadow_${O.value}`,"color-interpolation-filters":`sRGB`},[g(`feDropShadow`,{dx:`0`,dy:`0`,stdDeviation:`10`,"flood-opacity":`0.5`,"flood-color":L.value.donut.shadowColor},null,8,gt)],8,ht)]),g(`defs`,null,[(b(!0),h(d,null,S(Kn.value,(e,t)=>(b(),h(`path`,{key:`path-full-${t}`,id:`path-full-${t}-${O.value}`,d:e.fullCirclePath,fill:`none`},null,8,_t))),128))]),(b(!0),h(d,null,S(Kn.value,(e,t)=>(b(),h(`g`,null,[e.hasData?(b(!0),h(d,{key:0},S(e.donut.filter(e=>!e.ghost),(e,t)=>(b(),h(`g`,null,[g(`path`,{class:`vue-ui-donut-arc-path`,d:e.arcSlice,fill:e.color,stroke:L.value.donut.borderColorAuto?R.value.backgroundColor:L.value.donut.borderColor,"stroke-width":L.value.donut.borderWidth,filter:nr(e,t)},null,8,vt)]))),256)):(b(!0),h(d,{key:1},S(e.skeleton,(e,t)=>(b(),h(`g`,null,[g(`path`,{class:`vue-ui-donut-arc-path`,d:e.arcSlice,fill:e.color,stroke:L.value.donut.borderColorAuto?R.value.backgroundColor:L.value.donut.borderColor,"stroke-width":L.value.donut.borderWidth},null,8,yt)]))),256))]))),256)),R.value.useGradient?(b(),h(`g`,bt,[(b(!0),h(d,null,S(qn.value,(e,t)=>(b(),h(`g`,null,[g(`path`,{d:e.donut.arcSlice,fill:`url(#radial_${O.value}_${t})`,stroke:`transparent`,"stroke-width":`0`},null,8,xt)]))),256))])):m(``,!0),P.value.dataLabels.showDonutName?(b(),h(`g`,St,[P.value.dataLabels.curvedDonutName?(b(!0),h(d,{key:0},S(Kn.value,(e,t)=>(b(),h(`g`,null,[(b(!0),h(d,null,S(e.donut,(n,r)=>(b(),h(`g`,null,[r===0&&G.value.width&&G.value.height?(b(),h(`text`,{key:0,"text-anchor":`middle`,"font-size":L.value.labels.dataLabels.fontSize,"font-weight":L.value.labels.dataLabels.boldDonutName?`bold`:`normal`,fill:L.value.labels.dataLabels.color,dy:L.value.labels.dataLabels.donutNameOffsetY},[g(`textPath`,{href:`#path-full-${t}-${O.value}`,startOffset:`50%`,"text-anchor":`middle`,method:`align`,spacing:`auto`},w(L.value.labels.dataLabels.donutNameAbbreviation?T(de)({source:e.name,length:N.value.style.chart.layout.labels.dataLabels.donutNameMaxAbbreviationSize}):e.name),9,wt)],8,Ct)):m(``,!0)]))),256))]))),256)):(b(!0),h(d,{key:1},S(Kn.value,(e,t)=>(b(),h(`g`,null,[(b(!0),h(d,null,S(e.donut,(t,n)=>(b(),h(`g`,null,[n===0&&G.value.width&&G.value.height?(b(),h(`text`,{key:0,x:G.value.width/2,y:t.startY-L.value.labels.dataLabels.fontSize+L.value.labels.dataLabels.donutNameOffsetY,"text-anchor":`middle`,"font-size":L.value.labels.dataLabels.fontSize,"font-weight":L.value.labels.dataLabels.boldDonutName?`bold`:`normal`,fill:L.value.labels.dataLabels.color},w(L.value.labels.dataLabels.donutNameAbbreviation?T(de)({source:e.name,length:N.value.style.chart.layout.labels.dataLabels.donutNameMaxAbbreviationSize}):e.name),9,Tt)):m(``,!0)]))),256))]))),256))])):m(``,!0),P.value.dataLabels.show?(b(),h(`g`,Et,[(b(!0),h(d,null,S(Kn.value,(e,t)=>(b(),h(`g`,null,[(b(!0),h(d,null,S(e.donut.filter(e=>!e.ghost),(e,n)=>(b(),h(`g`,{filter:nr(e,n)},[at(g(`text`,{opacity:+!!tr(e),"text-anchor":T(se)(e,!0).anchor,x:T(se)(e,!1,L.value.labels.dataLabels.offsetX).x||0,y:T(me)(e,L.value.labels.dataLabels.offsetY,L.value.labels.dataLabels.offsetY)+(P.value.dataLabels.showValueFirst&&P.value.dataLabels.showValue?L.value.labels.dataLabels.fontSize:0),fill:P.value.dataLabels.useSerieColor?e.color:L.value.labels.dataLabels.color,"font-size":P.value.dataLabels.fontSize,"font-weight":P.value.dataLabels.boldPercentage?`bold`:`normal`},w(T(ne)(T(a)({v:e.proportion*100,s:`%`,r:R.value.layout.labels.dataLabels.roundingPercentage}),L.value.labels.dataLabels.usePercentageParens?`(`:``,L.value.labels.dataLabels.usePercentageParens?`)`:``)),9,Ot),[[rt,W.value.dataLabels.show&&P.value.dataLabels.showPercentage]]),at(g(`text`,{opacity:+!!tr(e),"text-anchor":T(se)(e,!0).anchor,x:T(se)(e,!1,L.value.labels.dataLabels.offsetX).x||0,y:T(me)(e,L.value.labels.dataLabels.offsetY,L.value.labels.dataLabels.offsetY)+(P.value.dataLabels.showValueFirst||!P.value.dataLabels.showPercentage?0:L.value.labels.dataLabels.fontSize),fill:P.value.dataLabels.useSerieColor?e.color:L.value.labels.dataLabels.color,"font-size":P.value.dataLabels.fontSize,"font-weight":P.value.dataLabels.boldValue?`bold`:`normal`},w(T(ne)(T(ce)(L.value.labels.dataLabels.formatter,e.value,T(a)({p:R.value.layout.labels.dataLabels.prefix,v:e.value,s:R.value.layout.labels.dataLabels.suffix,r:R.value.layout.labels.dataLabels.roundingValue}),{datapoint:e,seriesIndex:t,datapointIndex:n}),L.value.labels.dataLabels.useValueParens?`(`:``,L.value.labels.dataLabels.useValueParens?`)`:``)),9,kt),[[rt,W.value.dataLabels.show&&P.value.dataLabels.showValue]])],8,Dt))),256))]))),256))])):m(``,!0),(b(!0),h(d,null,S(Kn.value,(e,t)=>(b(),h(`g`,null,[(b(!0),h(d,null,S(e.donut,(e,t)=>(b(),h(`g`,null,[g(`path`,{d:e.arcSlice,fill:Zt.value===e.id?L.value.donut.selectedColor:`transparent`,onMouseenter:t=>er({datapoint:e,relativeIndex:$.value.findIndex(t=>t.id===e.id),seriesIndex:e.seriesIndex}),onClick:n=>In({datapoint:e,index:t,seriesIndex:e.seriesIndex}),onMouseleave:t=>Qn({datapoint:e,seriesIndex:e.seriesIndex})},null,40,At)]))),256))]))),256)),C(e.$slots,`svg`,{svg:{...G.value,isPrintingImg:T(An)||T(jn)||T(Sr),isPrintingSvg:T(Cr)}},void 0,!0)],512)],46,dt)),e.$slots.hint?(b(),h(`div`,jt,[C(e.$slots,`hint`,y(v({hint:N.value.a11y.translations.keyboardNavigation,isVisible:mn.value})),void 0,!0)])):m(``,!0)]),e.$slots.watermark?(b(),h(`div`,Mt,[C(e.$slots,`watermark`,y(v({isPrinting:T(An)||T(jn)||T(Sr)||T(Cr)})),void 0,!0)])):m(``,!0),qe(T(Lt),{teleportTo:F.value.teleportTo,show:W.value.showTooltip&&Yt.value,backgroundColor:F.value.backgroundColor,color:F.value.color,borderRadius:F.value.borderRadius,borderColor:F.value.borderColor,borderWidth:F.value.borderWidth,fontSize:F.value.fontSize,backgroundOpacity:F.value.backgroundOpacity,position:F.value.position,offsetX:F.value.offsetX,offsetY:F.value.offsetY,parent:$t.value,content:Xt.value,isFullscreen:M.value,isCustom:T(s)(F.value.customFormat),smooth:F.value.smooth,backdropFilter:F.value.backdropFilter,smoothForce:F.value.smoothForce,smoothSnapThreshold:F.value.smoothSnapThreshold,isA11yMode:pn.value===`keyboard`,a11yPosition:fn.value},{"tooltip-before":E(()=>[C(e.$slots,`tooltip-before`,y(v({...Zn.value})),void 0,!0)]),tooltip:E(()=>[C(e.$slots,`tooltip`,y(v({...Zn.value})),void 0,!0)]),"tooltip-after":E(()=>[C(e.$slots,`tooltip-after`,y(v({...Zn.value})),void 0,!0)]),_:3},8,[`teleportTo`,`show`,`backgroundColor`,`color`,`borderRadius`,`borderColor`,`borderWidth`,`fontSize`,`backgroundOpacity`,`position`,`offsetX`,`offsetY`,`parent`,`content`,`isFullscreen`,`isCustom`,`smooth`,`backdropFilter`,`smoothForce`,`smoothSnapThreshold`,`isA11yMode`,`a11yPosition`]),g(`div`,{id:`legend-bottom-${O.value}`},null,8,Nt),ln.value&&(R.value.legend.show||e.$slots.legend)?(b(),p(We,{key:6,to:R.value.legend.position===`top`?`#legend-top-${O.value}`:`#legend-bottom-${O.value}`},[R.value.legend.show?(b(),h(`div`,{key:0,ref_key:`chartLegend`,ref:tn,class:Xe({"vue-ui-nested-donuts-legend":rr.value.length>1})},[C(e.$slots,`legend`,{legend:rr.value},()=>[(b(!0),h(d,null,S(rr.value,(e,t)=>(b(),p(He,{key:`legend_${t}_${sn.value}`,legendSet:e,config:ir.value,isCursorPointer:z.value,onClickMarker:i[0]||=({legend:e})=>Bn(e)},{legendTitle:E(({titleSet:e})=>[e[0]&&e[0].arcOf?(b(),h(`div`,Pt,w(e[0].arcOf),1)):m(``,!0)]),item:E(({legend:e,index:t})=>[g(`div`,{onClick:t=>Bn(e),style:Ze(`opacity:${q.value.includes(e.id)?.5:1}`)},w(e.display),13,Ft)]),legendToggle:E(()=>[e.length>2&&R.value.legend.selectAllToggle.show&&!T(vn)?(b(),p(Le,{key:`toggle-${t}`,backgroundColor:R.value.legend.selectAllToggle.backgroundColor,color:R.value.legend.selectAllToggle.color,fontSize:R.value.legend.fontSize,checked:e.some(e=>q.value.includes(e.id)),isCursorPointer:z.value,onToggle:t=>zn(e)},null,8,[`backgroundColor`,`color`,`fontSize`,`checked`,`isCursorPointer`,`onToggle`])):m(``,!0)]),_:2},1032,[`legendSet`,`config`,`isCursorPointer`]))),128))],!0)],2)):m(``,!0)],8,[`to`])):m(``,!0),e.$slots.source?(b(),h(`div`,{key:7,ref_key:`source`,ref:nn,dir:`auto`},[C(e.$slots,`source`,{},void 0,!0)],512)):m(``,!0),Jt.value&&I.value.buttons.table?(b(),p(et(gr.value.component),Je({key:8},gr.value.props,{ref_key:`tableUnit`,ref:un,onClose:_r}),Ge({content:E(()=>[(b(),p(T(Bt),{key:`table_${on.value}`,colNames:or.value.colNames,head:or.value.head,body:or.value.body,config:or.value.config,title:N.value.table.useDialog?``:gr.value.title,withCloseButton:!N.value.table.useDialog,isCursorPointer:z.value,onClose:_r},{th:E(({th:e})=>[g(`div`,It,w(e),1)]),td:E(({td:e})=>[Ke(w(e.name||e),1)]),_:1},8,[`colNames`,`head`,`body`,`config`,`title`,`withCloseButton`,`isCursorPointer`]))]),_:2},[N.value.table.useDialog?{name:`title`,fn:E(()=>[Ke(w(gr.value.title),1)]),key:`0`}:void 0,N.value.table.useDialog?{name:`actions`,fn:E(()=>[g(`button`,{tabindex:`0`,class:`vue-ui-user-options-button`,onClick:i[1]||=e=>ar(I.value.callbacks.csv),style:Ze({cursor:z.value?`pointer`:`default`})},[qe(T(Rt),{name:`fileCsv`,stroke:gr.value.props.color},null,8,[`stroke`])],4)]),key:`1`}:void 0]),1040)):m(``,!0),C(e.$slots,`skeleton`,{},()=>[T(vn)?(b(),p(be,{key:0})):m(``,!0)],!0)],46,st))}},[[`__scopeId`,`data-v-620e4d92`]]);export{ot as n,Lt as t};