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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (189) hide show
  1. package/dist/{Arrow-CJeSufxg.js → Arrow-C2W0uGrq.js} +1 -1
  2. package/dist/{BaseDraggableDialog-T1gEsQid.js → BaseDraggableDialog-D_tuHEjO.js} +1 -1
  3. package/dist/{BaseIcon-Cz30ODFA.js → BaseIcon-DdIyewwY.js} +1 -1
  4. package/dist/{BaseLegendToggle-Dn_tNvn4.js → BaseLegendToggle-Bq5FjyuI.js} +1 -1
  5. package/dist/{BaseZoomControls-xq3tWD3j.js → BaseZoomControls-DoYifY2y.js} +1 -1
  6. package/dist/{ColorPicker-CUjEw53A.js → ColorPicker-MLwiwxl5.js} +1 -1
  7. package/dist/{DataTable-DSUA5M9p.js → DataTable-WNecJMcY.js} +1 -1
  8. package/dist/{HillActions-DdvXld3a.js → HillActions-CHg1AQ3p.js} +1 -1
  9. package/dist/{Legend-DokTll4u.js → Legend-D8YoT1RJ.js} +1 -1
  10. package/dist/{NonSvgPenAndPaper-BLzQuIm6.js → NonSvgPenAndPaper-CqtJpZKh.js} +1 -1
  11. package/dist/{PackageVersion-D6pKL176.js → PackageVersion-CdkxOy58.js} +1 -1
  12. package/dist/{PenAndPaper-DvJJaeU2.js → PenAndPaper-IMw576MC.js} +1 -1
  13. package/dist/{Shape-tkp65OcG.js → Shape-Bp9YNtPc.js} +1 -1
  14. package/dist/SlicerPreview-CNUciSbY.js +1 -0
  15. package/dist/{SparkTooltip-BlJLvizH.js → SparkTooltip-C5JMcBXT.js} +1 -1
  16. package/dist/{Title-BRAjxtjG.js → Title-BGYFqulv.js} +1 -1
  17. package/dist/{Tooltip-BUXB0i6z.js → Tooltip-Cus2-XNQ.js} +1 -1
  18. package/dist/{UserOptions-D65t74CM.js → UserOptions-DTxMeZv3.js} +1 -1
  19. package/dist/{chartImage-NwZO-elv.js → chartImage-CIvU_04o.js} +1 -1
  20. package/dist/components/arrow.js +1 -1
  21. package/dist/components/vue-ui-3d-bar.js +1 -1
  22. package/dist/components/vue-ui-accordion.js +1 -1
  23. package/dist/components/vue-ui-age-pyramid.js +1 -1
  24. package/dist/components/vue-ui-annotator.js +1 -1
  25. package/dist/components/vue-ui-bullet.js +1 -1
  26. package/dist/components/vue-ui-bump.js +1 -1
  27. package/dist/components/vue-ui-candlestick.js +1 -1
  28. package/dist/components/vue-ui-carousel-table.js +1 -1
  29. package/dist/components/vue-ui-chestnut.js +1 -1
  30. package/dist/components/vue-ui-chord.js +1 -1
  31. package/dist/components/vue-ui-circle-pack.js +1 -1
  32. package/dist/components/vue-ui-cursor.js +1 -1
  33. package/dist/components/vue-ui-dag.js +1 -1
  34. package/dist/components/vue-ui-dashboard.js +1 -1
  35. package/dist/components/vue-ui-digits.js +1 -1
  36. package/dist/components/vue-ui-donut-evolution.js +1 -1
  37. package/dist/components/vue-ui-donut.js +1 -1
  38. package/dist/components/vue-ui-dumbbell.js +1 -1
  39. package/dist/components/vue-ui-flow.js +1 -1
  40. package/dist/components/vue-ui-funnel.js +1 -1
  41. package/dist/components/vue-ui-galaxy.js +1 -1
  42. package/dist/components/vue-ui-gauge.js +1 -1
  43. package/dist/components/vue-ui-geo.js +1 -1
  44. package/dist/components/vue-ui-gizmo.js +1 -1
  45. package/dist/components/vue-ui-heatmap.js +1 -1
  46. package/dist/components/vue-ui-hill.js +1 -1
  47. package/dist/components/vue-ui-history-plot.js +1 -1
  48. package/dist/components/vue-ui-horizontal-bar.js +1 -1
  49. package/dist/components/vue-ui-icon.js +1 -1
  50. package/dist/components/vue-ui-kpi.js +1 -1
  51. package/dist/components/vue-ui-label.js +1 -1
  52. package/dist/components/vue-ui-mini-loader.js +1 -1
  53. package/dist/components/vue-ui-molecule.js +1 -1
  54. package/dist/components/vue-ui-mood-radar.js +1 -1
  55. package/dist/components/vue-ui-nested-donuts.js +1 -1
  56. package/dist/components/vue-ui-onion.js +1 -1
  57. package/dist/components/vue-ui-parallel-coordinate-plot.js +1 -1
  58. package/dist/components/vue-ui-quadrant.js +1 -1
  59. package/dist/components/vue-ui-quick-chart.js +1 -1
  60. package/dist/components/vue-ui-radar.js +1 -1
  61. package/dist/components/vue-ui-rating.js +1 -1
  62. package/dist/components/vue-ui-relation-circle.js +1 -1
  63. package/dist/components/vue-ui-ridgeline.js +1 -1
  64. package/dist/components/vue-ui-rings.js +1 -1
  65. package/dist/components/vue-ui-scatter.js +1 -1
  66. package/dist/components/vue-ui-skeleton.js +1 -1
  67. package/dist/components/vue-ui-smiley.js +1 -1
  68. package/dist/components/vue-ui-spark-trend.js +1 -1
  69. package/dist/components/vue-ui-sparkbar.js +1 -1
  70. package/dist/components/vue-ui-sparkgauge.js +1 -1
  71. package/dist/components/vue-ui-sparkhistogram.js +1 -1
  72. package/dist/components/vue-ui-sparkline.js +1 -1
  73. package/dist/components/vue-ui-sparkstackbar.js +1 -1
  74. package/dist/components/vue-ui-stackbar.js +1 -1
  75. package/dist/components/vue-ui-stackline.js +1 -1
  76. package/dist/components/vue-ui-strip-plot.js +1 -1
  77. package/dist/components/vue-ui-table-heatmap.js +1 -1
  78. package/dist/components/vue-ui-table-sparkline.js +1 -1
  79. package/dist/components/vue-ui-table.js +1 -1
  80. package/dist/components/vue-ui-thermometer.js +1 -1
  81. package/dist/components/vue-ui-timer.js +1 -1
  82. package/dist/components/vue-ui-tiremarks.js +1 -1
  83. package/dist/components/vue-ui-treemap.js +1 -1
  84. package/dist/components/vue-ui-vertical-bar.js +1 -1
  85. package/dist/components/vue-ui-waffle.js +1 -1
  86. package/dist/components/vue-ui-wheel.js +1 -1
  87. package/dist/components/vue-ui-word-cloud.js +1 -1
  88. package/dist/components/vue-ui-world.js +1 -1
  89. package/dist/components/vue-ui-xy-canvas.js +1 -1
  90. package/dist/components/vue-ui-xy.js +1 -1
  91. package/dist/{dom-to-png-Cp3WLHmJ.js → dom-to-png-D8t3Bm7s.js} +1 -1
  92. package/dist/{exposedLib-CMTeSmyW.js → exposedLib-DHtyEc_G.js} +1 -1
  93. package/dist/{img-8sM3sVWU.js → img-DiT4ivZ5.js} +1 -1
  94. package/dist/{labelUtils-Djp5nJtN.js → labelUtils-CG3uVXoZ.js} +1 -1
  95. package/dist/{lib-zDxoqrgo.js → lib-CV_IANZ6.js} +2 -2
  96. package/dist/package-DE5cU1Rg.js +1 -0
  97. package/dist/{pdf-Dlv_ks7R.js → pdf-BQSB1V3H.js} +1 -1
  98. package/dist/{render-common-DOYi0f4Z.js → render-common-BdZ5aRyn.js} +1 -1
  99. package/dist/{resolveChartConfig-BSo1Oe9n.js → resolveChartConfig-DZg-korK.js} +1 -1
  100. package/dist/ssr/vue-ui-donut.js +1 -1
  101. package/dist/ssr/vue-ui-xy.js +1 -1
  102. package/dist/ssr.js +1 -1
  103. package/dist/style.css +1 -1
  104. package/dist/{useNestedProp-CT9phgWx.js → useNestedProp-CB186vF2.js} +1 -1
  105. package/dist/{useObjectBindings-DM3xDKV3.js → useObjectBindings-Dse7YyAf.js} +1 -1
  106. package/dist/{usePrinter-CnyKPIFM.js → usePrinter-hLW3cv4N.js} +1 -1
  107. package/dist/utils.js +1 -1
  108. package/dist/vue-data-ui-DyYgLIZN.js +1 -0
  109. package/dist/vue-data-ui.js +1 -1
  110. package/dist/{vue-ui-3d-bar-DiaiNy-k.js → vue-ui-3d-bar-BZAoyWkc.js} +1 -1
  111. package/dist/{vue-ui-accordion-Dy5OVFKr.js → vue-ui-accordion-BNvevckx.js} +1 -1
  112. package/dist/{vue-ui-age-pyramid-OeUr1yxi.js → vue-ui-age-pyramid-DkA6vpU3.js} +1 -1
  113. package/dist/{vue-ui-annotator-DA_xAFql.js → vue-ui-annotator-DuQME4Hh.js} +1 -1
  114. package/dist/{vue-ui-bullet-B9lcCTVb.js → vue-ui-bullet-BVs8JX8S.js} +1 -1
  115. package/dist/{vue-ui-bump-DYajIrva.js → vue-ui-bump-DYdm3EvF.js} +1 -1
  116. package/dist/{vue-ui-candlestick-CdAZuNxo.js → vue-ui-candlestick-DZgxl4mW.js} +1 -1
  117. package/dist/{vue-ui-carousel-table-ihGH0LDH.js → vue-ui-carousel-table-BB7DsTUt.js} +1 -1
  118. package/dist/{vue-ui-chestnut-B2aNXFNO.js → vue-ui-chestnut-Bo1h5rBt.js} +1 -1
  119. package/dist/{vue-ui-chord-fAckHfOW.js → vue-ui-chord-B6_veyvO.js} +1 -1
  120. package/dist/{vue-ui-circle-pack-BWHVImkS.js → vue-ui-circle-pack-Bm7e2YNh.js} +1 -1
  121. package/dist/{vue-ui-cursor-DdXKXmhr.js → vue-ui-cursor-TidZDuSh.js} +1 -1
  122. package/dist/{vue-ui-dag-a0fNoIcJ.js → vue-ui-dag-BiN_AnLo.js} +1 -1
  123. package/dist/{vue-ui-dashboard-DkdYMB7n.js → vue-ui-dashboard-zepAVN_W.js} +1 -1
  124. package/dist/{vue-ui-digits-CL9SuIEI.js → vue-ui-digits-CXKKmfGj.js} +1 -1
  125. package/dist/{vue-ui-donut-BaEodt-3.js → vue-ui-donut-CKkBtyPK.js} +1 -1
  126. package/dist/{vue-ui-donut-DaYxdQmP.js → vue-ui-donut-DLDUpjDU.js} +2 -2
  127. package/dist/{vue-ui-donut-evolution-T8cRXKRQ.js → vue-ui-donut-evolution-BxMTdE5G.js} +1 -1
  128. package/dist/{vue-ui-dumbbell-B6HJxEZp.js → vue-ui-dumbbell-C8rNwdz0.js} +1 -1
  129. package/dist/{vue-ui-flow-BlTCVFr3.js → vue-ui-flow-Dru76A2O.js} +1 -1
  130. package/dist/{vue-ui-funnel-WgLFJadZ.js → vue-ui-funnel-D_u1h5S9.js} +1 -1
  131. package/dist/{vue-ui-galaxy-B3nuI6E8.js → vue-ui-galaxy-sBEH18Xj.js} +1 -1
  132. package/dist/{vue-ui-gauge-BwTP65O4.js → vue-ui-gauge-Do3RN8ne.js} +1 -1
  133. package/dist/{vue-ui-geo-CX3yH18H.js → vue-ui-geo-DDbtx_iJ.js} +1 -1
  134. package/dist/{vue-ui-gizmo-CNHcBsku.js → vue-ui-gizmo-eic6xLjB.js} +1 -1
  135. package/dist/{vue-ui-heatmap-CTdeoar7.js → vue-ui-heatmap-DlmJRsM8.js} +1 -1
  136. package/dist/{vue-ui-hill-DR5k8GWZ.js → vue-ui-hill-C5oiuIXh.js} +1 -1
  137. package/dist/{vue-ui-history-plot-C-9uH-Uj.js → vue-ui-history-plot-BJjnkWcT.js} +1 -1
  138. package/dist/{vue-ui-horizontal-bar-qqF7pL7U.js → vue-ui-horizontal-bar-BRDBJEl1.js} +1 -1
  139. package/dist/{vue-ui-kpi-DVcLXGqG.js → vue-ui-kpi-C-eed3jO.js} +1 -1
  140. package/dist/{vue-ui-label-D1Aog-zO.js → vue-ui-label-B4pkXBxc.js} +1 -1
  141. package/dist/{vue-ui-mini-loader-CX0Dx9tT.js → vue-ui-mini-loader-CElmv_iF.js} +1 -1
  142. package/dist/{vue-ui-molecule-B13qVX71.js → vue-ui-molecule-BeyQWZU9.js} +1 -1
  143. package/dist/{vue-ui-mood-radar-C1BtB8lg.js → vue-ui-mood-radar-Bh0kHfiZ.js} +1 -1
  144. package/dist/{vue-ui-nested-donuts-B90yrlJG.js → vue-ui-nested-donuts-FlnJfDaF.js} +1 -1
  145. package/dist/{vue-ui-onion-UMVO2DE_.js → vue-ui-onion-BjhSpjtW.js} +1 -1
  146. package/dist/vue-ui-parallel-coordinate-plot-CHV6XDti.js +9 -0
  147. package/dist/{vue-ui-quadrant-CPG6yAiu.js → vue-ui-quadrant-BaKSTJDv.js} +1 -1
  148. package/dist/{vue-ui-quick-chart-BTPb-Iz8.js → vue-ui-quick-chart-Nc2mVlle.js} +1 -1
  149. package/dist/{vue-ui-radar-Hd-pE9ih.js → vue-ui-radar-BzUfkLlC.js} +1 -1
  150. package/dist/{vue-ui-rating-C_YxQYa_.js → vue-ui-rating-BwWXvbAg.js} +1 -1
  151. package/dist/{vue-ui-relation-circle-CHYG7ZJl.js → vue-ui-relation-circle-nAZEg-BL.js} +1 -1
  152. package/dist/{vue-ui-ridgeline-DS1Gvljt.js → vue-ui-ridgeline-DxLZg1E2.js} +1 -1
  153. package/dist/{vue-ui-rings-B-Hb13Uu.js → vue-ui-rings-BOti0NGb.js} +1 -1
  154. package/dist/{vue-ui-scatter-BTgvOmuo.js → vue-ui-scatter-CCNMggyo.js} +1 -1
  155. package/dist/{vue-ui-skeleton-B-Acw3CC.js → vue-ui-skeleton-DI7pcimU.js} +1 -1
  156. package/dist/{vue-ui-smiley-Ciwqt6ek.js → vue-ui-smiley-D70sJZWl.js} +1 -1
  157. package/dist/{vue-ui-spark-trend-CYqy6c0S.js → vue-ui-spark-trend-BVtfEalS.js} +1 -1
  158. package/dist/{vue-ui-sparkbar-CTXIgjmP.js → vue-ui-sparkbar-CdsLI7Ke.js} +1 -1
  159. package/dist/{vue-ui-sparkgauge-CObOL6s2.js → vue-ui-sparkgauge-wmj5Wnnp.js} +1 -1
  160. package/dist/{vue-ui-sparkhistogram-ClFyDez-.js → vue-ui-sparkhistogram-D8S_P_P4.js} +1 -1
  161. package/dist/{vue-ui-sparkline-DP_nYlW8.js → vue-ui-sparkline-BjsJnS_9.js} +1 -1
  162. package/dist/{vue-ui-sparkstackbar-B2f0ePMg.js → vue-ui-sparkstackbar-ZN8LXzoV.js} +1 -1
  163. package/dist/{vue-ui-stackbar-nMWHZ-f0.js → vue-ui-stackbar-Dx_EN3pT.js} +1 -1
  164. package/dist/{vue-ui-stackline-B95y6Zc5.js → vue-ui-stackline-DW-oxJvA.js} +1 -1
  165. package/dist/{vue-ui-strip-plot-gFNC4r-X.js → vue-ui-strip-plot-D7kjJ3Qh.js} +1 -1
  166. package/dist/{vue-ui-table-Br2JgD_L.js → vue-ui-table-CaFVLHxE.js} +1 -1
  167. package/dist/{vue-ui-table-heatmap-Btu2ejF4.js → vue-ui-table-heatmap-Ctf7Rhqo.js} +1 -1
  168. package/dist/vue-ui-table-sparkline-C0I0cXBS.js +1 -0
  169. package/dist/{vue-ui-thermometer-C6u1eLfo.js → vue-ui-thermometer-B6og15Al.js} +1 -1
  170. package/dist/{vue-ui-timer-DLgsfB1U.js → vue-ui-timer-DgXvO2Q7.js} +2 -2
  171. package/dist/{vue-ui-tiremarks-8B9uE1Bx.js → vue-ui-tiremarks-Dh6fZ454.js} +1 -1
  172. package/dist/{vue-ui-treemap-C4Mot-Os.js → vue-ui-treemap-7JuvN6P_.js} +1 -1
  173. package/dist/{vue-ui-waffle-BwcwNpf7.js → vue-ui-waffle-BqvGzfse.js} +1 -1
  174. package/dist/{vue-ui-wheel-B3OGCXg7.js → vue-ui-wheel-SdwJqKA7.js} +1 -1
  175. package/dist/{vue-ui-word-cloud-BPIyMBXq.js → vue-ui-word-cloud-1WVV_k12.js} +1 -1
  176. package/dist/{vue-ui-world-Cp0DeauH.js → vue-ui-world-DjMy_utm.js} +1 -1
  177. package/dist/{vue-ui-xy-BOE1jvUS.js → vue-ui-xy-DaozHMfg.js} +1 -1
  178. package/dist/{vue-ui-xy-canvas-CaxxiKSa.js → vue-ui-xy-canvas-CegvS9RR.js} +1 -1
  179. package/dist/{vue-ui-xy-DSyKSn4L.js → vue-ui-xy-rGHSI1am.js} +3 -3
  180. package/dist/vue_ui_donut_evolution-CVoh3twl.js +1 -0
  181. package/dist/vue_ui_quick_chart-BRfcRW6Z.js +1 -0
  182. package/package.json +1 -1
  183. package/dist/SlicerPreview-GFRs2EWB.js +0 -1
  184. package/dist/package-DIR2F6AE.js +0 -1
  185. package/dist/vue-data-ui-BG41UScx.js +0 -1
  186. package/dist/vue-ui-parallel-coordinate-plot-C0ofFivm.js +0 -9
  187. package/dist/vue-ui-table-sparkline-B9mYHAxp.js +0 -1
  188. package/dist/vue_ui_donut_evolution-nzVwNQYv.js +0 -1
  189. package/dist/vue_ui_quick_chart-Da1GwklM.js +0 -1
@@ -1,4 +1,4 @@
1
- import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{n as t,t as n}from"./tableIntegration-CNoJ1CIY.js";import{n as r,t as i}from"./annotationSlots-BRR85CqJ.js";import{n as a,t as o}from"./userOptionsSlots-DYuo-E5m.js";import{$ as s,D as ee,Ft as c,Jt as te,Q as ne,X as re,_ as ie,at as ae,b as oe,i as l,in as se,nt as ce,t as le,yt as ue,zt as de}from"./lib-zDxoqrgo.js";import{n as fe,t as pe}from"./useHints-BH9r_0Vd.js";import{t as me}from"./useConfig-CKdzPrcf.js";import{t as he}from"./usePrinter-CnyKPIFM.js";import{n as ge,t as _e}from"./BaseScanner-8NdoBs7B.js";import{t as ve}from"./useChartExport-DtPNpc9M.js";import{t as ye}from"./useTimeLabelCollider-XQf_S7-z.js";import{n as be}from"./Title-BRAjxtjG.js";import{t as xe}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{l as Se,t as Ce}from"./useResponsive-D2CPcpda.js";import{t as u}from"./DefGrad-DKMq1REY.js";import{t as we}from"./A11yDataTable-DWNlWXzs.js";import{t as Te}from"./resolveChartConfig-BSo1Oe9n.js";import{t as Ee}from"./useUserOptionState-CXlFnwPv.js";import{t as De}from"./useChartAccessibility-DOMuYJfm.js";import{t as Oe}from"./chartImage-NwZO-elv.js";import{t as ke}from"./Legend-DokTll4u.js";import{t as Ae}from"./usePrefersMotion-XLHwega2.js";import{t as je}from"./vue_ui_dumbbell-BMcxK0N3.js";import{Fragment as d,Teleport as Me,computed as f,createBlock as p,createCommentVNode as m,createElementBlock as h,createElementVNode as g,createSlots as Ne,createTextVNode as Pe,createVNode as _,defineAsyncComponent as v,guardReactiveProps as Fe,mergeProps as Ie,nextTick as Le,normalizeClass as Re,normalizeProps as ze,normalizeStyle as Be,onBeforeUnmount as Ve,onMounted as He,openBlock as y,ref as b,renderList as x,renderSlot as S,resolveDynamicComponent as Ue,shallowRef as We,toDisplayString as C,toRefs as Ge,unref as w,vShow as Ke,watch as qe,watchEffect as Je,withCtx as T,withDirectives as Ye}from"vue";var Xe=/* @__PURE__ */ e({default:()=>Ft}),Ze=[`id`],Qe=[`id`],$e=[`id`],et={style:{position:`relative`}},tt=[`xmlns`,`viewBox`,`aria-describedby`],nt=[`x`,`y`,`width`,`height`],rt={key:1},it=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`,`stroke-dasharray`],at={key:2},ot=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`,`stroke-dasharray`],st=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`,`stroke-dasharray`],ct=[`transform`,`font-size`,`fill`],lt=[`x`,`y`,`font-size`,`fill`,`font-weight`,`onMouseenter`,`onMouseleave`,`onClick`],ut=[`x`,`y`,`font-size`,`fill`,`onMouseenter`,`onMouseleave`,`onClick`],dt=[`x`,`y`,`font-size`,`fill`],ft=[`transform`,`font-size`,`fill`,`font-weight`,`text-anchor`],pt=[`d`,`stroke`,`stroke-width`,`stroke-dasharray`],mt=[`d`,`stroke`,`stroke-width`,`stroke-dasharray`],ht=[`x`,`y`,`height`,`width`,`fill`],gt=[`transform`,`fill`,`font-size`],_t={key:0},vt={key:0},yt=[`d`,`fill`],bt={key:1},xt=[`x`,`y`,`height`,`width`,`fill`],St=[`cx`,`cy`,`r`,`fill`,`stroke`,`stroke-width`],Ct=[`cx`,`cy`,`r`,`fill`,`stroke`,`stroke-width`],wt={key:7},Tt=[`x`,`y`,`fill`,`font-size`],Et={key:8},Dt=[`x`,`y`,`fill`,`font-size`],Ot=[`x`,`y`,`width`,`height`,`fill`,`onMouseenter`,`onMouseleave`,`onClick`],kt={key:0,style:{position:`absolute`,top:`100%`,left:`0`,width:`100%`},"data-dom-to-png-ignore":``,"aria-hidden":`true`},At={key:5,class:`vue-data-ui-watermark`},jt=[`id`],Mt=[`xmlns`,`height`,`width`],Nt=[`fill`],Pt={style:{display:`flex`,"align-items":`center`}},Ft=/*#__PURE__*/ xe({__name:`vue-ui-dumbbell`,props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:[`selectDatapoint`,`copyAlt`],setup(e,{expose:xe,emit:Xe}){let Ft=v(()=>import(`./BaseIcon-Cz30ODFA.js`).then(e=>e.n)),It=v(()=>import(`./vue-ui-accordion-Dy5OVFKr.js`).then(e=>e.n)),Lt=v(()=>import(`./DataTable-DSUA5M9p.js`)),Rt=v(()=>import(`./PenAndPaper-DvJJaeU2.js`).then(e=>e.t)),zt=v(()=>import(`./UserOptions-D65t74CM.js`).then(e=>e.n)),Bt=v(()=>import(`./PackageVersion-D6pKL176.js`).then(e=>e.t)),Vt=v(()=>import(`./BaseDraggableDialog-T1gEsQid.js`).then(e=>e.n)),{vue_ui_dumbbell:Ht}=me(),Ut=Ae(),E=e,Wt=Xe,Gt=f({get(){return!!E.dataset&&E.dataset.length},set(e){return e}}),D=b(re()),Kt=b(0),O=b(null),qt=b(null),Jt=b(null),Yt=b(null),Xt=b(null),Zt=b(0),Qt=b(0),$t=b(0),en=b(!1),tn=b(null),nn=b(null),rn=b(null),an=b(null),on=b(null),sn=b(null),k=b(null),A=b(null),j=b(null),cn=b(!1),M=b(!1),N=b(vn()),P=f(()=>N.value.style.chart.grid.horizontalGrid),ln=f(()=>N.value.style.chart.grid.verticalGrid),F=f(()=>N.value.style.chart.labels);f(()=>N.value.style.chart.grid);let I=f(()=>N.value.style.chart.plots),L=f(()=>N.value.style.chart.comparisonLines),R=f(()=>N.value.style.chart);fe({config:()=>N.value,dataset:()=>E.dataset,component:`VueUiDumbbell`,rules:[pe.emptyArray,{test:e=>e.length>31,message:[`👀 The number of series is > 31. Consider:`,``,`▶️ Using filters to let users choose a maximum number of series to display.`,``,`▶️ Using multiple instances of the component to display related series.`]}]});let z=f(()=>N.value.userOptions.useCursorPointer),un=f(()=>se({defaultConfig:{userOptions:{show:!1},table:{show:!1},useAnimation:!1,style:{chart:{backgroundColor:`#99999930`,padding:{top:12,right:12,bottom:12,left:12},grid:{horizontalGrid:{stroke:`#6A6A6A`},verticalGrid:{stroke:`#6A6A6A`}},labels:{axis:{yLabel:``,xLabel:``},xAxisLabels:{show:!1},yAxisLabels:{show:!1},endLabels:{show:!1},startLabels:{show:!1}},legend:{backgroundColor:`transparent`},plots:{endColor:`#969696`,startColor:`#DBDBDB`,stroke:`#6A6A6A`,evaluationColors:{enable:!1}}}}},userConfig:N.value.skeletonConfig??{}})),{loading:dn,FINAL_DATASET:fn,manualLoading:pn}=ge({...Ge(E),FINAL_CONFIG:N,prepareConfig:vn,skeletonDataset:E.config?.skeletonDataset??[{name:`_`,start:21,end:34},{name:`_`,start:13,end:21},{name:`_`,start:8,end:13},{name:`_`,start:5,end:8},{name:`_`,start:3,end:5}],skeletonConfig:se({defaultConfig:N.value,userConfig:un.value})}),{userOptionsVisible:mn,setUserOptionsVisibility:hn,keepUserOptionState:gn}=Ee({config:N.value}),{svgRef:_n}=De({config:R.value.title});function vn(){return Te(E.config,Ht,je)}qe(()=>E.config,e=>{dn.value||(N.value=vn()),mn.value=!N.value.userOptions.showOnChartHover,bn(),Zt.value+=1,Qt.value+=1,$t.value+=1,G.value=R.value.rowHeight,K.value=R.value.width,H.value.showTable=N.value.table.show},{deep:!0}),qe(()=>fn.value,e=>{Array.isArray(e)&&e.length>0&&(pn.value=!1),Pn(),Fn()},{deep:!0});let B=We(null),V=We(null);He(()=>{en.value=!0,bn()});let yn=f(()=>N.value.debug);function bn(){if(de(E.dataset)?ae({componentName:`VueUiDumbbell`,type:`dataset`,debug:yn.value}):E.dataset.forEach((e,t)=>{ue({datasetObject:e,requiredAttributes:[`name`,`start`,`end`]}).forEach(e=>{Gt.value=!1,ae({componentName:`VueUiDumbbell`,type:`datasetSerieAttribute`,property:e,index:t,debug:yn.value})})}),N.value.responsive){let e=Se(()=>{let{width:e,height:t}=Ce({chart:O.value,title:R.value.title.text?qt.value:null,legend:R.value.legend.show?Jt.value:null,source:Yt.value,noTitle:Xt.value}),n=R.value.title.text?24:0,r=R.value.legend.show?24:0;requestAnimationFrame(async()=>{K.value=Math.max(.1,e),G.value=Math.max(.1,(Math.max(.1,t)-(n+r))/fn.value.length),Yn()})});B.value&&(V.value&&B.value.unobserve(V.value),B.value.disconnect()),B.value=new ResizeObserver(e),V.value=O.value.parentNode,B.value.observe(V.value)}Yn()}Ve(()=>{X.value!=null&&(cancelAnimationFrame(X.value),X.value=null),B.value&&(V.value&&B.value.unobserve(V.value),B.value.disconnect())});let{isPrinting:xn,isImaging:Sn,generatePdf:Cn,generateImage:wn}=he({elementId:`dumbbell_${D.value}`,fileName:R.value.title.text||`vue-ui-dumbbell`,options:N.value.userOptions.print}),Tn=f(()=>N.value.userOptions.show&&!R.value.title.text),H=b({showTable:N.value.table.show});qe(N,()=>{H.value={showTable:N.value.table.show}},{immediate:!0});let U=f(()=>fn.value.map((e,t)=>({...e,start:oe(e.start),end:oe(e.end),id:e.id??`${String(e.name)}__${String(e.start)}__${String(e.end)}__${re()}`}))),En=f(()=>{let e=R.value.grid,t=U.value.flatMap(e=>[e.start,e.end]).map(e=>Number(e)).filter(e=>Number.isFinite(e)),n=t.length?Math.min(...t):0,r=t.length?Math.max(...t):0;return{min:e.scaleMin??Math.min(n,0),max:e.scaleMax??r}}),W=f(()=>ie(En.value.min,En.value.max,R.value.grid.scaleSteps)),G=b(R.value.rowHeight),K=b(R.value.width);function Dn(){let e=0;an.value&&(e=Array.from(an.value.querySelectorAll(`text`)).reduce((e,t)=>{let n=t.getComputedTextLength();return n>e?n:e},0));let t=rn.value?rn.value.getBoundingClientRect().width:0;return e+t+(t?24+F.value.axis.yLabelOffsetX:0)}let On=b(0),kn=Se(e=>{On.value=e},100);Je(e=>{let t=on.value;if(!t)return;let n=new ResizeObserver(e=>{kn(e[0].contentRect.height)});n.observe(t),e(()=>n.disconnect())}),Ve(()=>{On.value=0});let An=f(()=>{M.value;let e=0;sn.value&&(e=sn.value.getBBox().height);let t=0;return on.value&&(t=On.value),e+t}),jn=f(()=>U.value.length);function Mn(e,t,n){let r=Number(e),i=Number(t.min),a=Number(t.max),o=Number(n.width);if(!Number.isFinite(r)||!Number.isFinite(i)||!Number.isFinite(a)||!Number.isFinite(o))return n.left;let s=a-i;return s<=0?n.left:n.left+(r-i)/s*o}let q=f(()=>{M.value;let e=Dn(),t=R.value.padding,n=F.value.axis.xLabel?F.value.axis.xLabelOffsetY:0,r=G.value*jn.value-An.value-t.top-t.bottom-n,i=r/jn.value,a=G.value*jn.value,o=K.value-e-t.left-t.right,s=W.value.ticks.length*(o/W.value.ticks.length);return{left:R.value.padding.left+e,right:K.value-R.value.padding.right,top:R.value.padding.top,bottom:a-R.value.padding.bottom-An.value-n,width:o,height:r,rowHeight:i,absoluteHeight:a,widthPlotReference:s}}),J=f(()=>Math.min(G.value/2*.7,I.value.radius)),Nn=b([]),Y=f({get(){let e=q.value,t=W.value;return Nn.value.map((n,r)=>{let i=Mn(n.start,t,e),a=Mn(n.endVal,t,e),o=i+(a-i)/2,s=![null,void 0].includes(n.start)&&![null,void 0].includes(n.end)&&n.end>n.start,ee=![null,void 0].includes(n.start)&&![null,void 0].includes(n.end)&&n.end<n.start,c=![null,void 0].includes(n.start)&&![null,void 0].includes(n.end)&&n.end===n.start||[null,void 0].includes(n.start)||[null,void 0].includes(n.end),te=s?I.value.evaluationColors.positive:ee?I.value.evaluationColors.negative:I.value.evaluationColors.neutral;return{...n,isPositive:s,isNegative:ee,isNeutral:c,evaluationColor:te,evaluationGrad:`url(#${s?`positive`:ee?`negative`:`neutral`}_grad_${D.value})`,startX:i,endX:a,centerX:o,y:e.top+r*e.rowHeight+e.rowHeight/2}})},set(e){Nn.value=e}});function Pn(){Nn.value=U.value.map(e=>{let t=Number(e.start);return{...e,endVal:Number.isFinite(t)?t:0}})}let X=b(null);He(()=>{Fn()});function Fn(){if(X.value!=null&&(cancelAnimationFrame(X.value),X.value=null),Pn(),!N.value.useAnimation||Ut.value){Y.value=Nn.value.map(e=>{let t=Number(e.end);return{...e,endVal:Number.isFinite(t)?t:e.endVal}});return}let e=Math.max(1,Math.min(100,N.value.animationSpeed||100))/100,t=U.value.map(e=>{let t=Number(e.start),n=Number(e.end),r=Number.isFinite(t)?t:0;return(Number.isFinite(n)?n:r)-r}),n=()=>{let r=!0;Y.value=Nn.value.map((n,i)=>{let a=Number.isFinite(Number(n.end))?Number(n.end):n.endVal,o=n.endVal+t[i]*e,s=t[i]>=0?Math.min(o,a):Math.max(o,a);return s!==a&&(r=!1),{...n,endVal:s}}),r?X.value=null:X.value=requestAnimationFrame(n)};X.value=requestAnimationFrame(n)}let In=f(()=>I.value.evaluationColors.enable?[{name:R.value.legend.labelNegative,color:I.value.gradient.show?`url(#negative_grad_${D.value})`:I.value.evaluationColors.negative},{name:R.value.legend.labelNeutral,color:I.value.gradient.show?`url(#neutral_grad_${D.value})`:I.value.evaluationColors.neutral},{name:R.value.legend.labelPositive,color:I.value.gradient.show?`url(#positive_grad_${D.value})`:I.value.evaluationColors.positive}]:[{name:R.value.legend.labelStart,color:I.value.gradient.show?`url(#start_grad_${D.value})`:I.value.startColor},{name:R.value.legend.labelEnd,color:I.value.gradient.show?`url(#end_grad_${D.value})`:I.value.endColor}]),Ln=f(()=>({cy:`donut-div-legend`,backgroundColor:R.value.legend.backgroundColor,color:R.value.legend.color,fontSize:R.value.legend.fontSize,paddingBottom:12,paddingTop:12,fontWeight:R.value.legend.bold?`bold`:``})),Z=f(()=>({head:Y.value.map(e=>({name:e.name})),body:Y.value.map(e=>({start:e.start,end:e.end}))})),Q=f(()=>{let e=[N.value.table.columnNames.series,N.value.table.columnNames.start,N.value.table.columnNames.end,N.value.table.columnNames.progression],t=Z.value.head.map((e,t)=>{let n=s({p:F.value.prefix,v:Z.value.body[t].start,s:F.value.suffix,r:N.value.table.td.roundingValue}),r=s({p:F.value.prefix,v:Z.value.body[t].end,s:F.value.suffix,r:N.value.table.td.roundingValue}),i=s({v:100*(Z.value.body[t].end/Z.value.body[t].start-1),s:`%`,r:N.value.table.td.roundingPercentage});return[{name:e.name},n,r,i]}),n={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.start,N.value.table.columnNames.end,N.value.table.columnNames.progression],head:e,body:t,config:n}});function Rn(e=null){Le(()=>{let t=Z.value.head.map((e,t)=>[[e.name],[Z.value.body[t].start],[Z.value.body[t].end]]),n=[[R.value.title.text],[R.value.title.subtitle.text],[[N.value.table.columnNames.series],[N.value.table.columnNames.start],[N.value.table.columnNames.end]]].concat(t),r=ee(n);e?e(r):ce({csvContent:r,title:R.value.title.text||`vue-ui-dumbbell`})})}let $=b(!1);function zn(e){$.value=e,Kt.value+=1}function Bn(){return U.value}function Vn(){H.value.showTable=!H.value.showTable}let Hn=b(!1);function Un(){Hn.value=!Hn.value}let Wn=Oe(O,()=>R.value.title.text),Gn=f(()=>W.value.ticks),Kn=f(()=>({start:0,end:Gn.value.length}));ye({timeLabelsEls:on,timeLabels:Gn,slicer:Kn,configRef:N,rotationPath:[`style`,`chart`,`labels`,`xAxisLabels`,`rotation`],autoRotatePath:[`style`,`chart`,`labels`,`xAxisLabels`,`autoRotate`,`enable`],isAutoSize:!1,width:K,height:G,targetClass:`.vue-ui-dumbbell-scale-label`,rotation:F.value.xAxisLabels.autoRotate.angle});function qn({rowHeight:e,fontSize:t,showProgression:n}){if(!n)return!1;let r=e/3,i=e/1.3;return Math.abs(i-r)<t*1.2}let Jn=(()=>{let e=null,t=0;return n=>{if(n===M.value){e=null,t=0;return}e===null||e!==n?(e=n,t=1):(t+=1,t>=1&&(M.value=n,e=null,t=0))}})(),Yn=Se(()=>{requestAnimationFrame(()=>{requestAnimationFrame(()=>{let e=qn({rowHeight:q.value.rowHeight,fontSize:F.value.yAxisLabels.fontSize,showProgression:F.value.yAxisLabels.showProgression});Jn(e)})})},100);function Xn({datapoint:e,seriesIndex:t}){k.value=t,A.value=e,N.value.events.datapointEnter&&N.value.events.datapointEnter({datapoint:e,seriesIndex:t})}function Zn({datapoint:e,seriesIndex:t}){k.value=null,A.value=null,N.value.events.datapointLeave&&N.value.events.datapointLeave({datapoint:e,seriesIndex:t})}function Qn({datapoint:e,seriesIndex:t}){N.value.events.datapointClick&&N.value.events.datapointClick({datapoint:e,seriesIndex:t}),Wt(`selectDatapoint`,{...e,seriesIndex:t})}let $n=f(()=>{if(A.value===null)return 0;let e=![null,void 0].includes(A.value.start),t=![null,void 0].includes(A.value.end);return e&&t?Math.min(A.value.startX,A.value.endX)+Math.abs(A.value.startX-A.value.endX)/2:e&&!t?A.value.startX:t&&!e?A.value.endX:null}),er=f(()=>{if(A.value===null)return``;let e=![null,void 0].includes(A.value.start),t=![null,void 0].includes(A.value.end),n=``,r=``;return e&&(n=l(F.value.formatter,A.value.start,s({p:F.value.prefix,v:A.value.start,s:F.value.suffix,r:F.value.startLabels.rounding}),{datapoint:A.value,seriesIndex:k.value})),t&&(r=l(F.value.formatter,A.value.end,s({p:F.value.prefix,v:A.value.end,s:F.value.suffix,r:F.value.startLabels.rounding}),{datapoint:A.value,seriesIndex:k.value})),e&&t?`${n} → ${r}`:e&&!t?n:t&&!e?r:``}),tr=f(()=>n({config:N,style:R,mutableConfig:H,dialog:Vt,accordion:It,isFullscreen:$,parent:O,maxWidth:800,isCursorPointer:z}));qe(()=>H.value.showTable,e=>t(e,N,tn));function nr(){H.value.showTable=!1,nn.value&&nn.value.setTableIconState(!1)}let rr=f(()=>In.value.map(e=>({...e,shape:`circle`}))),ir=f(()=>R.value.backgroundColor),ar=f(()=>R.value.legend),or=f(()=>R.value.title),{isCallbackImaging:sr,isCallbackSvg:cr,generateSvg:lr,onGenerateImage:ur}=ve({svg:_n,title:or,legend:ar,legendItems:rr,backgroundColor:ir,getSvgCallback:()=>N.value.userOptions.callbacks.svg,generateImage:wn});async function dr(){if(Wt(`copyAlt`,{config:N.value,dataset:Y.value}),!N.value.userOptions.callbacks.altCopy){console.warn("Vue Data UI - A callback must be set for `altCopy` in userOptions.");return}await Promise.resolve(N.value.userOptions.callbacks.altCopy({config:N.value,dataset:Y.value}))}function fr(e){let t=Y.value.length;return t?(e%t+t)%t:null}function pr(){if(j.value!==null){let e=Y.value[j.value];e&&Zn({datapoint:e,seriesIndex:j.value})}j.value=null,k.value=null,A.value=null}function mr(){j.value=null,cn.value=!0}function hr(){pr(),cn.value=!1}function gr(e){if(!_n.value||Hn.value||document.activeElement!==_n.value||!Y.value.length)return;let t=[`ArrowUp`,`ArrowLeft`].includes(e.key),n=[`ArrowDown`,`ArrowRight`].includes(e.key),r=e.key===`Enter`||e.key===` `,i=e.key===`Escape`;if(!t&&!n&&!r&&!i)return;if(e.preventDefault(),e.stopPropagation(),i){pr();return}if(r){if(j.value===null)return;let e=Y.value[j.value];if(!e)return;Qn({datapoint:e,seriesIndex:j.value});return}let a=j.value;a=a===null?n?0:Y.value.length-1:fr(a+(n?1:-1));let o=Y.value[a];o&&(j.value=a,Xn({datapoint:o,seriesIndex:a}))}let _r=f(()=>({head:Q.value.head,body:Q.value.body.map(e=>[e[0]?.name??``,e[1],e[2],e[3]]),caption:N.value.a11y.translations.tableCaption,notice:N.value.a11y.translations.tableAvailable}));return xe({getData:Bn,getImage:Wn,generatePdf:Cn,generateCsv:Rn,generateImage:wn,generateSvg:lr,toggleTable:Vn,toggleAnnotator:Un,toggleFullscreen:zn,copyAlt:dr}),(e,t)=>(y(),h(`div`,{ref_key:`dumbbellChart`,ref:O,class:Re(`vue-data-ui-component vue-ui-dumbbell ${$.value?`vue-data-ui-wrapper-fullscreen`:``}`),style:Be(`font-family:${N.value.style.fontFamily};width:100%; text-align:center;background:${R.value.backgroundColor};${N.value.responsive?`height:100%`:``}`),id:`dumbbell_${D.value}`,onMouseenter:t[1]||=()=>w(hn)(!0),onMouseleave:t[2]||=()=>w(hn)(!1)},[g(`div`,{id:`chart-instructions-${D.value}`,class:`sr-only`},[g(`p`,null,C(N.value.a11y.translations.keyboardNavigation),1)],8,Qe),_r.value.body.length?(y(),p(we,{key:0,uid:D.value,head:_r.value.head,body:_r.value.body,caption:_r.value.caption,notice:_r.value.notice},null,8,[`uid`,`head`,`body`,`caption`,`notice`])):m(``,!0),N.value.userOptions.buttons.annotator?(y(),p(w(Rt),{key:1,svgRef:w(_n),backgroundColor:R.value.backgroundColor,color:R.value.color,active:Hn.value,isCursorPointer:z.value,palette:N.value.userOptions.annotatorPalette,onClose:Un},Ne({_:2},[x(w(i),t=>({name:t,fn:T(n=>[S(e.$slots,t,ze(Fe(w(r)(t,n))),void 0,!0)])}))]),1032,[`svgRef`,`backgroundColor`,`color`,`active`,`isCursorPointer`,`palette`])):m(``,!0),Tn.value?(y(),h(`div`,{key:2,ref_key:`noTitle`,ref:Xt,class:`vue-data-ui-no-title-space`,style:`height:36px; width: 100%;background:transparent`},null,512)):m(``,!0),R.value.title.text?(y(),h(`div`,{key:3,ref_key:`chartTitle`,ref:qt,style:`width:100%;background:transparent;padding-bottom:24px`},[(y(),p(be,{key:`title_${Zt.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-${D.value}`},null,8,$e),N.value.userOptions.show&&Gt.value&&(w(gn)||w(mn))?(y(),p(w(zt),{ref_key:`userOptionsRef`,ref:nn,key:`user_option_${Kt.value}`,backgroundColor:R.value.backgroundColor,color:R.value.color,isPrinting:w(xn),isImaging:w(Sn),uid:D.value,hasPdf:N.value.userOptions.buttons.pdf,hasXls:N.value.userOptions.buttons.csv,hasImg:N.value.userOptions.buttons.img,hasSvg:N.value.userOptions.buttons.svg,hasTable:N.value.userOptions.buttons.table,hasFullscreen:N.value.userOptions.buttons.fullscreen,hasAltCopy:N.value.userOptions.buttons.altCopy,isFullscreen:$.value,titles:{...N.value.userOptions.buttonTitles},chartElement:O.value,position:N.value.userOptions.position,hasAnnotator:N.value.userOptions.buttons.annotator,isAnnotation:Hn.value,callbacks:N.value.userOptions.callbacks,printScale:N.value.userOptions.print.scale,tableDialog:N.value.table.useDialog,isCursorPointer:z.value,onToggleFullscreen:zn,onGeneratePdf:w(Cn),onGenerateCsv:Rn,onGenerateImage:w(ur),onGenerateSvg:w(lr),onToggleTable:Vn,onToggleAnnotator:Un,onCopyAlt:dr,style:Be({visibility:w(gn)?w(mn)?`visible`:`hidden`:`visible`})},Ne({_:2},[x(w(a)(e.$slots,`menuIcon optionPdf optionCsv optionImg optionSvg optionTable optionFullscreen optionAnnotator optionAltCopy custom-menu-before custom-menu-after`),t=>({name:t,fn:T(n=>[S(e.$slots,t,ze(Fe(w(o)(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(`.`))):m(``,!0),g(`div`,et,[(y(),h(`svg`,{ref_key:`svgRef`,ref:_n,xmlns:w(le),class:Re({"vue-data-ui-fullscreen--on":$.value,"vue-data-ui-fulscreen--off":!$.value}),viewBox:`0 0 ${K.value} ${q.value.absoluteHeight<=0?10:q.value.absoluteHeight}`,style:Be(`max-width:100%; overflow: visible; background:transparent;color:${R.value.color}`),"aria-describedby":`chart-instructions-${D.value}`,tabindex:`0`,onFocus:mr,onBlur:hr,onKeydown:gr},[_(w(Bt)),e.$slots[`chart-background`]?(y(),h(`foreignObject`,{key:0,x:q.value.left,y:q.value.top,width:Math.max(.1,q.value.width),height:Math.max(.1,q.value.height),style:{pointerEvents:`none`}},[S(e.$slots,`chart-background`,{},void 0,!0)],8,nt)):m(``,!0),ln.value.show?(y(),h(`g`,rt,[(y(!0),h(d,null,x(W.value.ticks,(e,t)=>(y(),h(`line`,{x1:q.value.left+t*q.value.width/(W.value.ticks.length-1),x2:q.value.left+t*q.value.width/(W.value.ticks.length-1),y1:q.value.top,y2:q.value.bottom,stroke:ln.value.stroke,"stroke-width":ln.value.strokeWidth,"stroke-dasharray":ln.value.strokeDasharray},null,8,it))),256))])):m(``,!0),P.value.show?(y(),h(`g`,at,[(y(!0),h(d,null,x(U.value,(e,t)=>(y(),h(`line`,{x1:q.value.left,x2:q.value.right,y1:q.value.top+t*q.value.rowHeight,y2:q.value.top+t*q.value.rowHeight,stroke:P.value.stroke,"stroke-width":P.value.strokeWidth,"stroke-dasharray":P.value.strokeDasharray},null,8,ot))),256)),g(`line`,{x1:q.value.left,x2:q.value.right,y1:q.value.bottom,y2:q.value.bottom,stroke:P.value.stroke,"stroke-width":P.value.strokeWidth,"stroke-dasharray":P.value.strokeDasharray},null,8,st)])):m(``,!0),F.value.axis.yLabel?(y(),h(`text`,{key:3,ref_key:`yAxisLabel`,ref:rn,transform:`translate(${F.value.axis.fontSize}, ${q.value.absoluteHeight/2}), rotate(-90)`,"font-size":F.value.axis.fontSize,fill:F.value.axis.color,"text-anchor":`middle`},C(F.value.axis.yLabel),9,ct)):m(``,!0),F.value.yAxisLabels.show?(y(),h(`g`,{key:4,ref_key:`serieLabels`,ref:an},[(y(!0),h(d,null,x(Y.value,(e,t)=>(y(),h(`text`,{class:`vue-ui-dumbbell-serie-name`,key:`serieLabel_${e.id}_${t}`,x:q.value.left-6+F.value.yAxisLabels.offsetX,y:q.value.top+t*q.value.rowHeight+(!F.value.yAxisLabels.showProgression||M.value?q.value.rowHeight/2:q.value.rowHeight/3)+F.value.yAxisLabels.fontSize/3,"font-size":F.value.yAxisLabels.fontSize,fill:F.value.yAxisLabels.color,"font-weight":F.value.yAxisLabels.bold?`bold`:`normal`,"text-anchor":`end`,onMouseenter:n=>Xn({datapoint:e,seriesIndex:t}),onMouseleave:n=>Zn({datapoint:e,seriesIndex:t}),onClick:n=>Qn({datapoint:e,seriesIndex:t})},C(e.name)+` `+C(M.value&&F.value.yAxisLabels.showProgression?[null,void 0].includes(e.start)||[null,void 0].includes(e.end)?``:`(${w(l)(F.value.yAxisLabels.formatter,100*(e.end/e.start-1),w(s)({v:100*(e.end/e.start-1),s:`%`,r:F.value.yAxisLabels.rounding}),{datapoint:e})})`:``),41,lt))),128)),F.value.yAxisLabels.showProgression&&!M.value?(y(!0),h(d,{key:0},x(Y.value,(e,t)=>(y(),h(`text`,{class:`vue-ui-dumbbell-serie-value`,x:q.value.left-6+F.value.yAxisLabels.offsetX,y:q.value.top+t*q.value.rowHeight+q.value.rowHeight/1.3+F.value.yAxisLabels.fontSize/3,"font-size":F.value.yAxisLabels.fontSize,fill:F.value.yAxisLabels.color,"text-anchor":`end`,onMouseenter:n=>Xn({datapoint:e,seriesIndex:t}),onMouseleave:n=>Zn({datapoint:e,seriesIndex:t}),onClick:n=>Qn({datapoint:e,seriesIndex:t})},C([null,void 0].includes(e.start)||[null,void 0].includes(e.end)?``:w(l)(F.value.yAxisLabels.formatter,100*(e.end/e.start-1),w(s)({v:100*(e.end/e.start-1),s:`%`,r:F.value.yAxisLabels.rounding}),{datapoint:e})),41,ut))),256)):m(``,!0)],512)):m(``,!0),F.value.axis.xLabel?(y(),h(`text`,{key:5,ref_key:`xAxisLabel`,ref:sn,x:q.value.left+q.value.width/2,y:q.value.absoluteHeight-F.value.axis.fontSize/3,"font-size":F.value.axis.fontSize,fill:F.value.axis.color,"text-anchor":`middle`},C(F.value.axis.xLabel),9,dt)):m(``,!0),F.value.xAxisLabels.show?(y(),h(`g`,{key:6,ref_key:`scaleLabels`,ref:on},[(y(!0),h(d,null,x(W.value.ticks,(e,t)=>(y(),h(`text`,{class:`vue-ui-dumbbell-scale-label`,key:`tick_${t}`,transform:`translate(${q.value.left+t*(q.value.width/(W.value.ticks.length-1))}, ${q.value.bottom+F.value.xAxisLabels.fontSize+F.value.xAxisLabels.offsetY}), rotate(${F.value.xAxisLabels.rotation})`,"font-size":F.value.xAxisLabels.fontSize,fill:F.value.xAxisLabels.color,"font-weight":F.value.xAxisLabels.bold?`bold`:`normal`,"text-anchor":F.value.xAxisLabels.rotation>0?`start`:F.value.xAxisLabels.rotation<0?`end`:`middle`},C(w(l)(F.value.formatter,e,w(s)({p:F.value.prefix,v:e,s:F.value.suffix,r:F.value.xAxisLabels.rounding}),{datapoint:e,seriesIndex:t})),9,ft))),128))],512)):m(``,!0),Ye(g(`g`,null,[Ye(g(`path`,{d:`M ${A.value?A.value.startX:q.value.left},${q.value.top} ${A.value?A.value.startX:q.value.left},${q.value.bottom}`,stroke:A.value?I.value.evaluationColors.enable?A.value.evaluationColor:I.value.startColor:`transparent`,"stroke-width":L.value.strokeWidth,"stroke-dasharray":L.value.strokeDasharray,style:{transition:`all 0.3s ease-in-out`}},null,8,pt),[[Ke,A.value!==null&&![null,void 0].includes(A.value.start)]]),Ye(g(`path`,{d:`M ${A.value?A.value.endX:q.value.left},${q.value.top} ${A.value?A.value.endX:q.value.left},${q.value.bottom}`,stroke:A.value?I.value.evaluationColors.enable?A.value.evaluationColor:I.value.endColor:`transparent`,"stroke-width":L.value.strokeWidth,"stroke-dasharray":L.value.strokeDasharray,style:{transition:`all 0.3s ease-in-out`}},null,8,mt),[[Ke,A.value!==null&&![null,void 0].includes(A.value.end)]]),Ye(g(`rect`,{x:A.value?Math.min(A.value.startX,A.value.endX):q.value.left,y:q.value.top,height:Math.max(.1,q.value.height),width:A.value?Math.max(.1,Math.abs(A.value.endX-A.value.startX)):0,fill:A.value?w(te)(L.value.rectColor,L.value.rectOpacity):`transparent`,style:{transition:`all 0.3s ease-in-out`}},null,8,ht),[[Ke,L.value.showRect&&A.value!==null&&![null,void 0].includes(A.value.start)&&![null,void 0].includes(A.value.end)]]),Ye(g(`text`,{transform:`translate(${$n.value==null?0:$n.value}, ${q.value.top-6})`,fill:L.value.labelColor,"font-size":L.value.labelFontSize,"text-anchor":`middle`,style:{transition:`all 0.3s ease-in-out`}},C(er.value),9,gt),[[Ke,A.value!==null&&$n.value!==null&&L.value.showLabel]])],512),[[Ke,L.value.show&&k.value!==null]]),g(`defs`,null,[_(u,{t:`radial`,id:`start_grad_${D.value}`,fy:`30%`,stops:[[`10%`,w(c)(I.value.startColor,I.value.gradient.intensity/100),1],[`90%`,w(ne)(I.value.startColor,.1),1],[`100%`,I.value.startColor,1]]},null,8,[`id`,`stops`]),_(u,{t:`radial`,id:`end_grad_${D.value}`,fy:`30%`,stops:[[`10%`,w(c)(I.value.endColor,I.value.gradient.intensity/100),1],[`90%`,w(ne)(I.value.endColor,.1),1],[`100%`,I.value.endColor,1]]},null,8,[`id`,`stops`]),_(u,{t:`radial`,id:`positive_grad_${D.value}`,fy:`30%`,stops:[[`10%`,w(c)(I.value.evaluationColors.positive,I.value.gradient.intensity/100),1],[`90%`,w(ne)(I.value.evaluationColors.positive,.1),1],[`100%`,I.value.evaluationColors.positive,1]]},null,8,[`id`,`stops`]),_(u,{t:`radial`,id:`negative_grad_${D.value}`,fy:`30%`,stops:[[`10%`,w(c)(I.value.evaluationColors.negative,I.value.gradient.intensity/100),1],[`90%`,w(ne)(I.value.evaluationColors.negative,.1),1],[`100%`,I.value.evaluationColors.negative,1]]},null,8,[`id`,`stops`]),_(u,{t:`radial`,id:`neutral_grad_${D.value}`,fy:`30%`,stops:[[`10%`,w(c)(I.value.evaluationColors.neutral,I.value.gradient.intensity/100),1],[`90%`,w(ne)(I.value.evaluationColors.neutral,.1),1],[`100%`,I.value.evaluationColors.neutral,1]]},null,8,[`id`,`stops`])]),(y(!0),h(d,null,x(Y.value,(e,t)=>(y(),h(`g`,{key:`plot_${t}_${e.id}`},[g(`defs`,null,[_(u,{t:`linear`,id:`grad_pos_${D.value}`,x1:`0%`,x2:`100%`,y1:`0%`,y2:`0%`,stops:[[`0%`,I.value.startColor,1],[`100%`,I.value.endColor,1]]},null,8,[`id`,`stops`]),_(u,{t:`linear`,id:`grad_neg_${D.value}`,x1:`0%`,x2:`100%`,y1:`0%`,y2:`0%`,stops:[[`0%`,I.value.endColor,1],[`100%`,I.value.startColor,1]]},null,8,[`id`,`stops`])]),![void 0,null].includes(e.end)&&![void 0,null].includes(e.start)?(y(),h(`g`,_t,[I.value.link.type===`curved`?(y(),h(`g`,vt,[g(`path`,{d:`M
1
+ import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{n as t,t as n}from"./tableIntegration-CNoJ1CIY.js";import{n as r,t as i}from"./annotationSlots-BRR85CqJ.js";import{n as a,t as o}from"./userOptionsSlots-DYuo-E5m.js";import{$ as s,D as ee,Ft as c,Jt as te,Q as ne,X as re,_ as ie,at as ae,b as oe,i as l,in as se,nt as ce,t as le,yt as ue,zt as de}from"./lib-CV_IANZ6.js";import{n as fe,t as pe}from"./useHints-BH9r_0Vd.js";import{t as me}from"./useConfig-CKdzPrcf.js";import{t as he}from"./usePrinter-hLW3cv4N.js";import{n as ge,t as _e}from"./BaseScanner-8NdoBs7B.js";import{t as ve}from"./useChartExport-DtPNpc9M.js";import{t as ye}from"./useTimeLabelCollider-XQf_S7-z.js";import{n as be}from"./Title-BGYFqulv.js";import{t as xe}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{l as Se,t as Ce}from"./useResponsive-D2CPcpda.js";import{t as u}from"./DefGrad-DKMq1REY.js";import{t as we}from"./A11yDataTable-DWNlWXzs.js";import{t as Te}from"./resolveChartConfig-DZg-korK.js";import{t as Ee}from"./useUserOptionState-CXlFnwPv.js";import{t as De}from"./useChartAccessibility-DOMuYJfm.js";import{t as Oe}from"./chartImage-CIvU_04o.js";import{t as ke}from"./Legend-D8YoT1RJ.js";import{t as Ae}from"./usePrefersMotion-XLHwega2.js";import{t as je}from"./vue_ui_dumbbell-BMcxK0N3.js";import{Fragment as d,Teleport as Me,computed as f,createBlock as p,createCommentVNode as m,createElementBlock as h,createElementVNode as g,createSlots as Ne,createTextVNode as Pe,createVNode as _,defineAsyncComponent as v,guardReactiveProps as Fe,mergeProps as Ie,nextTick as Le,normalizeClass as Re,normalizeProps as ze,normalizeStyle as Be,onBeforeUnmount as Ve,onMounted as He,openBlock as y,ref as b,renderList as x,renderSlot as S,resolveDynamicComponent as Ue,shallowRef as We,toDisplayString as C,toRefs as Ge,unref as w,vShow as Ke,watch as qe,watchEffect as Je,withCtx as T,withDirectives as Ye}from"vue";var Xe=/* @__PURE__ */ e({default:()=>Ft}),Ze=[`id`],Qe=[`id`],$e=[`id`],et={style:{position:`relative`}},tt=[`xmlns`,`viewBox`,`aria-describedby`],nt=[`x`,`y`,`width`,`height`],rt={key:1},it=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`,`stroke-dasharray`],at={key:2},ot=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`,`stroke-dasharray`],st=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`,`stroke-dasharray`],ct=[`transform`,`font-size`,`fill`],lt=[`x`,`y`,`font-size`,`fill`,`font-weight`,`onMouseenter`,`onMouseleave`,`onClick`],ut=[`x`,`y`,`font-size`,`fill`,`onMouseenter`,`onMouseleave`,`onClick`],dt=[`x`,`y`,`font-size`,`fill`],ft=[`transform`,`font-size`,`fill`,`font-weight`,`text-anchor`],pt=[`d`,`stroke`,`stroke-width`,`stroke-dasharray`],mt=[`d`,`stroke`,`stroke-width`,`stroke-dasharray`],ht=[`x`,`y`,`height`,`width`,`fill`],gt=[`transform`,`fill`,`font-size`],_t={key:0},vt={key:0},yt=[`d`,`fill`],bt={key:1},xt=[`x`,`y`,`height`,`width`,`fill`],St=[`cx`,`cy`,`r`,`fill`,`stroke`,`stroke-width`],Ct=[`cx`,`cy`,`r`,`fill`,`stroke`,`stroke-width`],wt={key:7},Tt=[`x`,`y`,`fill`,`font-size`],Et={key:8},Dt=[`x`,`y`,`fill`,`font-size`],Ot=[`x`,`y`,`width`,`height`,`fill`,`onMouseenter`,`onMouseleave`,`onClick`],kt={key:0,style:{position:`absolute`,top:`100%`,left:`0`,width:`100%`},"data-dom-to-png-ignore":``,"aria-hidden":`true`},At={key:5,class:`vue-data-ui-watermark`},jt=[`id`],Mt=[`xmlns`,`height`,`width`],Nt=[`fill`],Pt={style:{display:`flex`,"align-items":`center`}},Ft=/*#__PURE__*/ xe({__name:`vue-ui-dumbbell`,props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:[`selectDatapoint`,`copyAlt`],setup(e,{expose:xe,emit:Xe}){let Ft=v(()=>import(`./BaseIcon-DdIyewwY.js`).then(e=>e.n)),It=v(()=>import(`./vue-ui-accordion-BNvevckx.js`).then(e=>e.n)),Lt=v(()=>import(`./DataTable-WNecJMcY.js`)),Rt=v(()=>import(`./PenAndPaper-IMw576MC.js`).then(e=>e.t)),zt=v(()=>import(`./UserOptions-DTxMeZv3.js`).then(e=>e.n)),Bt=v(()=>import(`./PackageVersion-CdkxOy58.js`).then(e=>e.t)),Vt=v(()=>import(`./BaseDraggableDialog-D_tuHEjO.js`).then(e=>e.n)),{vue_ui_dumbbell:Ht}=me(),Ut=Ae(),E=e,Wt=Xe,Gt=f({get(){return!!E.dataset&&E.dataset.length},set(e){return e}}),D=b(re()),Kt=b(0),O=b(null),qt=b(null),Jt=b(null),Yt=b(null),Xt=b(null),Zt=b(0),Qt=b(0),$t=b(0),en=b(!1),tn=b(null),nn=b(null),rn=b(null),an=b(null),on=b(null),sn=b(null),k=b(null),A=b(null),j=b(null),cn=b(!1),M=b(!1),N=b(vn()),P=f(()=>N.value.style.chart.grid.horizontalGrid),ln=f(()=>N.value.style.chart.grid.verticalGrid),F=f(()=>N.value.style.chart.labels);f(()=>N.value.style.chart.grid);let I=f(()=>N.value.style.chart.plots),L=f(()=>N.value.style.chart.comparisonLines),R=f(()=>N.value.style.chart);fe({config:()=>N.value,dataset:()=>E.dataset,component:`VueUiDumbbell`,rules:[pe.emptyArray,{test:e=>e.length>31,message:[`👀 The number of series is > 31. Consider:`,``,`▶️ Using filters to let users choose a maximum number of series to display.`,``,`▶️ Using multiple instances of the component to display related series.`]}]});let z=f(()=>N.value.userOptions.useCursorPointer),un=f(()=>se({defaultConfig:{userOptions:{show:!1},table:{show:!1},useAnimation:!1,style:{chart:{backgroundColor:`#99999930`,padding:{top:12,right:12,bottom:12,left:12},grid:{horizontalGrid:{stroke:`#6A6A6A`},verticalGrid:{stroke:`#6A6A6A`}},labels:{axis:{yLabel:``,xLabel:``},xAxisLabels:{show:!1},yAxisLabels:{show:!1},endLabels:{show:!1},startLabels:{show:!1}},legend:{backgroundColor:`transparent`},plots:{endColor:`#969696`,startColor:`#DBDBDB`,stroke:`#6A6A6A`,evaluationColors:{enable:!1}}}}},userConfig:N.value.skeletonConfig??{}})),{loading:dn,FINAL_DATASET:fn,manualLoading:pn}=ge({...Ge(E),FINAL_CONFIG:N,prepareConfig:vn,skeletonDataset:E.config?.skeletonDataset??[{name:`_`,start:21,end:34},{name:`_`,start:13,end:21},{name:`_`,start:8,end:13},{name:`_`,start:5,end:8},{name:`_`,start:3,end:5}],skeletonConfig:se({defaultConfig:N.value,userConfig:un.value})}),{userOptionsVisible:mn,setUserOptionsVisibility:hn,keepUserOptionState:gn}=Ee({config:N.value}),{svgRef:_n}=De({config:R.value.title});function vn(){return Te(E.config,Ht,je)}qe(()=>E.config,e=>{dn.value||(N.value=vn()),mn.value=!N.value.userOptions.showOnChartHover,bn(),Zt.value+=1,Qt.value+=1,$t.value+=1,G.value=R.value.rowHeight,K.value=R.value.width,H.value.showTable=N.value.table.show},{deep:!0}),qe(()=>fn.value,e=>{Array.isArray(e)&&e.length>0&&(pn.value=!1),Pn(),Fn()},{deep:!0});let B=We(null),V=We(null);He(()=>{en.value=!0,bn()});let yn=f(()=>N.value.debug);function bn(){if(de(E.dataset)?ae({componentName:`VueUiDumbbell`,type:`dataset`,debug:yn.value}):E.dataset.forEach((e,t)=>{ue({datasetObject:e,requiredAttributes:[`name`,`start`,`end`]}).forEach(e=>{Gt.value=!1,ae({componentName:`VueUiDumbbell`,type:`datasetSerieAttribute`,property:e,index:t,debug:yn.value})})}),N.value.responsive){let e=Se(()=>{let{width:e,height:t}=Ce({chart:O.value,title:R.value.title.text?qt.value:null,legend:R.value.legend.show?Jt.value:null,source:Yt.value,noTitle:Xt.value}),n=R.value.title.text?24:0,r=R.value.legend.show?24:0;requestAnimationFrame(async()=>{K.value=Math.max(.1,e),G.value=Math.max(.1,(Math.max(.1,t)-(n+r))/fn.value.length),Yn()})});B.value&&(V.value&&B.value.unobserve(V.value),B.value.disconnect()),B.value=new ResizeObserver(e),V.value=O.value.parentNode,B.value.observe(V.value)}Yn()}Ve(()=>{X.value!=null&&(cancelAnimationFrame(X.value),X.value=null),B.value&&(V.value&&B.value.unobserve(V.value),B.value.disconnect())});let{isPrinting:xn,isImaging:Sn,generatePdf:Cn,generateImage:wn}=he({elementId:`dumbbell_${D.value}`,fileName:R.value.title.text||`vue-ui-dumbbell`,options:N.value.userOptions.print}),Tn=f(()=>N.value.userOptions.show&&!R.value.title.text),H=b({showTable:N.value.table.show});qe(N,()=>{H.value={showTable:N.value.table.show}},{immediate:!0});let U=f(()=>fn.value.map((e,t)=>({...e,start:oe(e.start),end:oe(e.end),id:e.id??`${String(e.name)}__${String(e.start)}__${String(e.end)}__${re()}`}))),En=f(()=>{let e=R.value.grid,t=U.value.flatMap(e=>[e.start,e.end]).map(e=>Number(e)).filter(e=>Number.isFinite(e)),n=t.length?Math.min(...t):0,r=t.length?Math.max(...t):0;return{min:e.scaleMin??Math.min(n,0),max:e.scaleMax??r}}),W=f(()=>ie(En.value.min,En.value.max,R.value.grid.scaleSteps)),G=b(R.value.rowHeight),K=b(R.value.width);function Dn(){let e=0;an.value&&(e=Array.from(an.value.querySelectorAll(`text`)).reduce((e,t)=>{let n=t.getComputedTextLength();return n>e?n:e},0));let t=rn.value?rn.value.getBoundingClientRect().width:0;return e+t+(t?24+F.value.axis.yLabelOffsetX:0)}let On=b(0),kn=Se(e=>{On.value=e},100);Je(e=>{let t=on.value;if(!t)return;let n=new ResizeObserver(e=>{kn(e[0].contentRect.height)});n.observe(t),e(()=>n.disconnect())}),Ve(()=>{On.value=0});let An=f(()=>{M.value;let e=0;sn.value&&(e=sn.value.getBBox().height);let t=0;return on.value&&(t=On.value),e+t}),jn=f(()=>U.value.length);function Mn(e,t,n){let r=Number(e),i=Number(t.min),a=Number(t.max),o=Number(n.width);if(!Number.isFinite(r)||!Number.isFinite(i)||!Number.isFinite(a)||!Number.isFinite(o))return n.left;let s=a-i;return s<=0?n.left:n.left+(r-i)/s*o}let q=f(()=>{M.value;let e=Dn(),t=R.value.padding,n=F.value.axis.xLabel?F.value.axis.xLabelOffsetY:0,r=G.value*jn.value-An.value-t.top-t.bottom-n,i=r/jn.value,a=G.value*jn.value,o=K.value-e-t.left-t.right,s=W.value.ticks.length*(o/W.value.ticks.length);return{left:R.value.padding.left+e,right:K.value-R.value.padding.right,top:R.value.padding.top,bottom:a-R.value.padding.bottom-An.value-n,width:o,height:r,rowHeight:i,absoluteHeight:a,widthPlotReference:s}}),J=f(()=>Math.min(G.value/2*.7,I.value.radius)),Nn=b([]),Y=f({get(){let e=q.value,t=W.value;return Nn.value.map((n,r)=>{let i=Mn(n.start,t,e),a=Mn(n.endVal,t,e),o=i+(a-i)/2,s=![null,void 0].includes(n.start)&&![null,void 0].includes(n.end)&&n.end>n.start,ee=![null,void 0].includes(n.start)&&![null,void 0].includes(n.end)&&n.end<n.start,c=![null,void 0].includes(n.start)&&![null,void 0].includes(n.end)&&n.end===n.start||[null,void 0].includes(n.start)||[null,void 0].includes(n.end),te=s?I.value.evaluationColors.positive:ee?I.value.evaluationColors.negative:I.value.evaluationColors.neutral;return{...n,isPositive:s,isNegative:ee,isNeutral:c,evaluationColor:te,evaluationGrad:`url(#${s?`positive`:ee?`negative`:`neutral`}_grad_${D.value})`,startX:i,endX:a,centerX:o,y:e.top+r*e.rowHeight+e.rowHeight/2}})},set(e){Nn.value=e}});function Pn(){Nn.value=U.value.map(e=>{let t=Number(e.start);return{...e,endVal:Number.isFinite(t)?t:0}})}let X=b(null);He(()=>{Fn()});function Fn(){if(X.value!=null&&(cancelAnimationFrame(X.value),X.value=null),Pn(),!N.value.useAnimation||Ut.value){Y.value=Nn.value.map(e=>{let t=Number(e.end);return{...e,endVal:Number.isFinite(t)?t:e.endVal}});return}let e=Math.max(1,Math.min(100,N.value.animationSpeed||100))/100,t=U.value.map(e=>{let t=Number(e.start),n=Number(e.end),r=Number.isFinite(t)?t:0;return(Number.isFinite(n)?n:r)-r}),n=()=>{let r=!0;Y.value=Nn.value.map((n,i)=>{let a=Number.isFinite(Number(n.end))?Number(n.end):n.endVal,o=n.endVal+t[i]*e,s=t[i]>=0?Math.min(o,a):Math.max(o,a);return s!==a&&(r=!1),{...n,endVal:s}}),r?X.value=null:X.value=requestAnimationFrame(n)};X.value=requestAnimationFrame(n)}let In=f(()=>I.value.evaluationColors.enable?[{name:R.value.legend.labelNegative,color:I.value.gradient.show?`url(#negative_grad_${D.value})`:I.value.evaluationColors.negative},{name:R.value.legend.labelNeutral,color:I.value.gradient.show?`url(#neutral_grad_${D.value})`:I.value.evaluationColors.neutral},{name:R.value.legend.labelPositive,color:I.value.gradient.show?`url(#positive_grad_${D.value})`:I.value.evaluationColors.positive}]:[{name:R.value.legend.labelStart,color:I.value.gradient.show?`url(#start_grad_${D.value})`:I.value.startColor},{name:R.value.legend.labelEnd,color:I.value.gradient.show?`url(#end_grad_${D.value})`:I.value.endColor}]),Ln=f(()=>({cy:`donut-div-legend`,backgroundColor:R.value.legend.backgroundColor,color:R.value.legend.color,fontSize:R.value.legend.fontSize,paddingBottom:12,paddingTop:12,fontWeight:R.value.legend.bold?`bold`:``})),Z=f(()=>({head:Y.value.map(e=>({name:e.name})),body:Y.value.map(e=>({start:e.start,end:e.end}))})),Q=f(()=>{let e=[N.value.table.columnNames.series,N.value.table.columnNames.start,N.value.table.columnNames.end,N.value.table.columnNames.progression],t=Z.value.head.map((e,t)=>{let n=s({p:F.value.prefix,v:Z.value.body[t].start,s:F.value.suffix,r:N.value.table.td.roundingValue}),r=s({p:F.value.prefix,v:Z.value.body[t].end,s:F.value.suffix,r:N.value.table.td.roundingValue}),i=s({v:100*(Z.value.body[t].end/Z.value.body[t].start-1),s:`%`,r:N.value.table.td.roundingPercentage});return[{name:e.name},n,r,i]}),n={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.start,N.value.table.columnNames.end,N.value.table.columnNames.progression],head:e,body:t,config:n}});function Rn(e=null){Le(()=>{let t=Z.value.head.map((e,t)=>[[e.name],[Z.value.body[t].start],[Z.value.body[t].end]]),n=[[R.value.title.text],[R.value.title.subtitle.text],[[N.value.table.columnNames.series],[N.value.table.columnNames.start],[N.value.table.columnNames.end]]].concat(t),r=ee(n);e?e(r):ce({csvContent:r,title:R.value.title.text||`vue-ui-dumbbell`})})}let $=b(!1);function zn(e){$.value=e,Kt.value+=1}function Bn(){return U.value}function Vn(){H.value.showTable=!H.value.showTable}let Hn=b(!1);function Un(){Hn.value=!Hn.value}let Wn=Oe(O,()=>R.value.title.text),Gn=f(()=>W.value.ticks),Kn=f(()=>({start:0,end:Gn.value.length}));ye({timeLabelsEls:on,timeLabels:Gn,slicer:Kn,configRef:N,rotationPath:[`style`,`chart`,`labels`,`xAxisLabels`,`rotation`],autoRotatePath:[`style`,`chart`,`labels`,`xAxisLabels`,`autoRotate`,`enable`],isAutoSize:!1,width:K,height:G,targetClass:`.vue-ui-dumbbell-scale-label`,rotation:F.value.xAxisLabels.autoRotate.angle});function qn({rowHeight:e,fontSize:t,showProgression:n}){if(!n)return!1;let r=e/3,i=e/1.3;return Math.abs(i-r)<t*1.2}let Jn=(()=>{let e=null,t=0;return n=>{if(n===M.value){e=null,t=0;return}e===null||e!==n?(e=n,t=1):(t+=1,t>=1&&(M.value=n,e=null,t=0))}})(),Yn=Se(()=>{requestAnimationFrame(()=>{requestAnimationFrame(()=>{let e=qn({rowHeight:q.value.rowHeight,fontSize:F.value.yAxisLabels.fontSize,showProgression:F.value.yAxisLabels.showProgression});Jn(e)})})},100);function Xn({datapoint:e,seriesIndex:t}){k.value=t,A.value=e,N.value.events.datapointEnter&&N.value.events.datapointEnter({datapoint:e,seriesIndex:t})}function Zn({datapoint:e,seriesIndex:t}){k.value=null,A.value=null,N.value.events.datapointLeave&&N.value.events.datapointLeave({datapoint:e,seriesIndex:t})}function Qn({datapoint:e,seriesIndex:t}){N.value.events.datapointClick&&N.value.events.datapointClick({datapoint:e,seriesIndex:t}),Wt(`selectDatapoint`,{...e,seriesIndex:t})}let $n=f(()=>{if(A.value===null)return 0;let e=![null,void 0].includes(A.value.start),t=![null,void 0].includes(A.value.end);return e&&t?Math.min(A.value.startX,A.value.endX)+Math.abs(A.value.startX-A.value.endX)/2:e&&!t?A.value.startX:t&&!e?A.value.endX:null}),er=f(()=>{if(A.value===null)return``;let e=![null,void 0].includes(A.value.start),t=![null,void 0].includes(A.value.end),n=``,r=``;return e&&(n=l(F.value.formatter,A.value.start,s({p:F.value.prefix,v:A.value.start,s:F.value.suffix,r:F.value.startLabels.rounding}),{datapoint:A.value,seriesIndex:k.value})),t&&(r=l(F.value.formatter,A.value.end,s({p:F.value.prefix,v:A.value.end,s:F.value.suffix,r:F.value.startLabels.rounding}),{datapoint:A.value,seriesIndex:k.value})),e&&t?`${n} → ${r}`:e&&!t?n:t&&!e?r:``}),tr=f(()=>n({config:N,style:R,mutableConfig:H,dialog:Vt,accordion:It,isFullscreen:$,parent:O,maxWidth:800,isCursorPointer:z}));qe(()=>H.value.showTable,e=>t(e,N,tn));function nr(){H.value.showTable=!1,nn.value&&nn.value.setTableIconState(!1)}let rr=f(()=>In.value.map(e=>({...e,shape:`circle`}))),ir=f(()=>R.value.backgroundColor),ar=f(()=>R.value.legend),or=f(()=>R.value.title),{isCallbackImaging:sr,isCallbackSvg:cr,generateSvg:lr,onGenerateImage:ur}=ve({svg:_n,title:or,legend:ar,legendItems:rr,backgroundColor:ir,getSvgCallback:()=>N.value.userOptions.callbacks.svg,generateImage:wn});async function dr(){if(Wt(`copyAlt`,{config:N.value,dataset:Y.value}),!N.value.userOptions.callbacks.altCopy){console.warn("Vue Data UI - A callback must be set for `altCopy` in userOptions.");return}await Promise.resolve(N.value.userOptions.callbacks.altCopy({config:N.value,dataset:Y.value}))}function fr(e){let t=Y.value.length;return t?(e%t+t)%t:null}function pr(){if(j.value!==null){let e=Y.value[j.value];e&&Zn({datapoint:e,seriesIndex:j.value})}j.value=null,k.value=null,A.value=null}function mr(){j.value=null,cn.value=!0}function hr(){pr(),cn.value=!1}function gr(e){if(!_n.value||Hn.value||document.activeElement!==_n.value||!Y.value.length)return;let t=[`ArrowUp`,`ArrowLeft`].includes(e.key),n=[`ArrowDown`,`ArrowRight`].includes(e.key),r=e.key===`Enter`||e.key===` `,i=e.key===`Escape`;if(!t&&!n&&!r&&!i)return;if(e.preventDefault(),e.stopPropagation(),i){pr();return}if(r){if(j.value===null)return;let e=Y.value[j.value];if(!e)return;Qn({datapoint:e,seriesIndex:j.value});return}let a=j.value;a=a===null?n?0:Y.value.length-1:fr(a+(n?1:-1));let o=Y.value[a];o&&(j.value=a,Xn({datapoint:o,seriesIndex:a}))}let _r=f(()=>({head:Q.value.head,body:Q.value.body.map(e=>[e[0]?.name??``,e[1],e[2],e[3]]),caption:N.value.a11y.translations.tableCaption,notice:N.value.a11y.translations.tableAvailable}));return xe({getData:Bn,getImage:Wn,generatePdf:Cn,generateCsv:Rn,generateImage:wn,generateSvg:lr,toggleTable:Vn,toggleAnnotator:Un,toggleFullscreen:zn,copyAlt:dr}),(e,t)=>(y(),h(`div`,{ref_key:`dumbbellChart`,ref:O,class:Re(`vue-data-ui-component vue-ui-dumbbell ${$.value?`vue-data-ui-wrapper-fullscreen`:``}`),style:Be(`font-family:${N.value.style.fontFamily};width:100%; text-align:center;background:${R.value.backgroundColor};${N.value.responsive?`height:100%`:``}`),id:`dumbbell_${D.value}`,onMouseenter:t[1]||=()=>w(hn)(!0),onMouseleave:t[2]||=()=>w(hn)(!1)},[g(`div`,{id:`chart-instructions-${D.value}`,class:`sr-only`},[g(`p`,null,C(N.value.a11y.translations.keyboardNavigation),1)],8,Qe),_r.value.body.length?(y(),p(we,{key:0,uid:D.value,head:_r.value.head,body:_r.value.body,caption:_r.value.caption,notice:_r.value.notice},null,8,[`uid`,`head`,`body`,`caption`,`notice`])):m(``,!0),N.value.userOptions.buttons.annotator?(y(),p(w(Rt),{key:1,svgRef:w(_n),backgroundColor:R.value.backgroundColor,color:R.value.color,active:Hn.value,isCursorPointer:z.value,palette:N.value.userOptions.annotatorPalette,onClose:Un},Ne({_:2},[x(w(i),t=>({name:t,fn:T(n=>[S(e.$slots,t,ze(Fe(w(r)(t,n))),void 0,!0)])}))]),1032,[`svgRef`,`backgroundColor`,`color`,`active`,`isCursorPointer`,`palette`])):m(``,!0),Tn.value?(y(),h(`div`,{key:2,ref_key:`noTitle`,ref:Xt,class:`vue-data-ui-no-title-space`,style:`height:36px; width: 100%;background:transparent`},null,512)):m(``,!0),R.value.title.text?(y(),h(`div`,{key:3,ref_key:`chartTitle`,ref:qt,style:`width:100%;background:transparent;padding-bottom:24px`},[(y(),p(be,{key:`title_${Zt.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-${D.value}`},null,8,$e),N.value.userOptions.show&&Gt.value&&(w(gn)||w(mn))?(y(),p(w(zt),{ref_key:`userOptionsRef`,ref:nn,key:`user_option_${Kt.value}`,backgroundColor:R.value.backgroundColor,color:R.value.color,isPrinting:w(xn),isImaging:w(Sn),uid:D.value,hasPdf:N.value.userOptions.buttons.pdf,hasXls:N.value.userOptions.buttons.csv,hasImg:N.value.userOptions.buttons.img,hasSvg:N.value.userOptions.buttons.svg,hasTable:N.value.userOptions.buttons.table,hasFullscreen:N.value.userOptions.buttons.fullscreen,hasAltCopy:N.value.userOptions.buttons.altCopy,isFullscreen:$.value,titles:{...N.value.userOptions.buttonTitles},chartElement:O.value,position:N.value.userOptions.position,hasAnnotator:N.value.userOptions.buttons.annotator,isAnnotation:Hn.value,callbacks:N.value.userOptions.callbacks,printScale:N.value.userOptions.print.scale,tableDialog:N.value.table.useDialog,isCursorPointer:z.value,onToggleFullscreen:zn,onGeneratePdf:w(Cn),onGenerateCsv:Rn,onGenerateImage:w(ur),onGenerateSvg:w(lr),onToggleTable:Vn,onToggleAnnotator:Un,onCopyAlt:dr,style:Be({visibility:w(gn)?w(mn)?`visible`:`hidden`:`visible`})},Ne({_:2},[x(w(a)(e.$slots,`menuIcon optionPdf optionCsv optionImg optionSvg optionTable optionFullscreen optionAnnotator optionAltCopy custom-menu-before custom-menu-after`),t=>({name:t,fn:T(n=>[S(e.$slots,t,ze(Fe(w(o)(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(`.`))):m(``,!0),g(`div`,et,[(y(),h(`svg`,{ref_key:`svgRef`,ref:_n,xmlns:w(le),class:Re({"vue-data-ui-fullscreen--on":$.value,"vue-data-ui-fulscreen--off":!$.value}),viewBox:`0 0 ${K.value} ${q.value.absoluteHeight<=0?10:q.value.absoluteHeight}`,style:Be(`max-width:100%; overflow: visible; background:transparent;color:${R.value.color}`),"aria-describedby":`chart-instructions-${D.value}`,tabindex:`0`,onFocus:mr,onBlur:hr,onKeydown:gr},[_(w(Bt)),e.$slots[`chart-background`]?(y(),h(`foreignObject`,{key:0,x:q.value.left,y:q.value.top,width:Math.max(.1,q.value.width),height:Math.max(.1,q.value.height),style:{pointerEvents:`none`}},[S(e.$slots,`chart-background`,{},void 0,!0)],8,nt)):m(``,!0),ln.value.show?(y(),h(`g`,rt,[(y(!0),h(d,null,x(W.value.ticks,(e,t)=>(y(),h(`line`,{x1:q.value.left+t*q.value.width/(W.value.ticks.length-1),x2:q.value.left+t*q.value.width/(W.value.ticks.length-1),y1:q.value.top,y2:q.value.bottom,stroke:ln.value.stroke,"stroke-width":ln.value.strokeWidth,"stroke-dasharray":ln.value.strokeDasharray},null,8,it))),256))])):m(``,!0),P.value.show?(y(),h(`g`,at,[(y(!0),h(d,null,x(U.value,(e,t)=>(y(),h(`line`,{x1:q.value.left,x2:q.value.right,y1:q.value.top+t*q.value.rowHeight,y2:q.value.top+t*q.value.rowHeight,stroke:P.value.stroke,"stroke-width":P.value.strokeWidth,"stroke-dasharray":P.value.strokeDasharray},null,8,ot))),256)),g(`line`,{x1:q.value.left,x2:q.value.right,y1:q.value.bottom,y2:q.value.bottom,stroke:P.value.stroke,"stroke-width":P.value.strokeWidth,"stroke-dasharray":P.value.strokeDasharray},null,8,st)])):m(``,!0),F.value.axis.yLabel?(y(),h(`text`,{key:3,ref_key:`yAxisLabel`,ref:rn,transform:`translate(${F.value.axis.fontSize}, ${q.value.absoluteHeight/2}), rotate(-90)`,"font-size":F.value.axis.fontSize,fill:F.value.axis.color,"text-anchor":`middle`},C(F.value.axis.yLabel),9,ct)):m(``,!0),F.value.yAxisLabels.show?(y(),h(`g`,{key:4,ref_key:`serieLabels`,ref:an},[(y(!0),h(d,null,x(Y.value,(e,t)=>(y(),h(`text`,{class:`vue-ui-dumbbell-serie-name`,key:`serieLabel_${e.id}_${t}`,x:q.value.left-6+F.value.yAxisLabels.offsetX,y:q.value.top+t*q.value.rowHeight+(!F.value.yAxisLabels.showProgression||M.value?q.value.rowHeight/2:q.value.rowHeight/3)+F.value.yAxisLabels.fontSize/3,"font-size":F.value.yAxisLabels.fontSize,fill:F.value.yAxisLabels.color,"font-weight":F.value.yAxisLabels.bold?`bold`:`normal`,"text-anchor":`end`,onMouseenter:n=>Xn({datapoint:e,seriesIndex:t}),onMouseleave:n=>Zn({datapoint:e,seriesIndex:t}),onClick:n=>Qn({datapoint:e,seriesIndex:t})},C(e.name)+` `+C(M.value&&F.value.yAxisLabels.showProgression?[null,void 0].includes(e.start)||[null,void 0].includes(e.end)?``:`(${w(l)(F.value.yAxisLabels.formatter,100*(e.end/e.start-1),w(s)({v:100*(e.end/e.start-1),s:`%`,r:F.value.yAxisLabels.rounding}),{datapoint:e})})`:``),41,lt))),128)),F.value.yAxisLabels.showProgression&&!M.value?(y(!0),h(d,{key:0},x(Y.value,(e,t)=>(y(),h(`text`,{class:`vue-ui-dumbbell-serie-value`,x:q.value.left-6+F.value.yAxisLabels.offsetX,y:q.value.top+t*q.value.rowHeight+q.value.rowHeight/1.3+F.value.yAxisLabels.fontSize/3,"font-size":F.value.yAxisLabels.fontSize,fill:F.value.yAxisLabels.color,"text-anchor":`end`,onMouseenter:n=>Xn({datapoint:e,seriesIndex:t}),onMouseleave:n=>Zn({datapoint:e,seriesIndex:t}),onClick:n=>Qn({datapoint:e,seriesIndex:t})},C([null,void 0].includes(e.start)||[null,void 0].includes(e.end)?``:w(l)(F.value.yAxisLabels.formatter,100*(e.end/e.start-1),w(s)({v:100*(e.end/e.start-1),s:`%`,r:F.value.yAxisLabels.rounding}),{datapoint:e})),41,ut))),256)):m(``,!0)],512)):m(``,!0),F.value.axis.xLabel?(y(),h(`text`,{key:5,ref_key:`xAxisLabel`,ref:sn,x:q.value.left+q.value.width/2,y:q.value.absoluteHeight-F.value.axis.fontSize/3,"font-size":F.value.axis.fontSize,fill:F.value.axis.color,"text-anchor":`middle`},C(F.value.axis.xLabel),9,dt)):m(``,!0),F.value.xAxisLabels.show?(y(),h(`g`,{key:6,ref_key:`scaleLabels`,ref:on},[(y(!0),h(d,null,x(W.value.ticks,(e,t)=>(y(),h(`text`,{class:`vue-ui-dumbbell-scale-label`,key:`tick_${t}`,transform:`translate(${q.value.left+t*(q.value.width/(W.value.ticks.length-1))}, ${q.value.bottom+F.value.xAxisLabels.fontSize+F.value.xAxisLabels.offsetY}), rotate(${F.value.xAxisLabels.rotation})`,"font-size":F.value.xAxisLabels.fontSize,fill:F.value.xAxisLabels.color,"font-weight":F.value.xAxisLabels.bold?`bold`:`normal`,"text-anchor":F.value.xAxisLabels.rotation>0?`start`:F.value.xAxisLabels.rotation<0?`end`:`middle`},C(w(l)(F.value.formatter,e,w(s)({p:F.value.prefix,v:e,s:F.value.suffix,r:F.value.xAxisLabels.rounding}),{datapoint:e,seriesIndex:t})),9,ft))),128))],512)):m(``,!0),Ye(g(`g`,null,[Ye(g(`path`,{d:`M ${A.value?A.value.startX:q.value.left},${q.value.top} ${A.value?A.value.startX:q.value.left},${q.value.bottom}`,stroke:A.value?I.value.evaluationColors.enable?A.value.evaluationColor:I.value.startColor:`transparent`,"stroke-width":L.value.strokeWidth,"stroke-dasharray":L.value.strokeDasharray,style:{transition:`all 0.3s ease-in-out`}},null,8,pt),[[Ke,A.value!==null&&![null,void 0].includes(A.value.start)]]),Ye(g(`path`,{d:`M ${A.value?A.value.endX:q.value.left},${q.value.top} ${A.value?A.value.endX:q.value.left},${q.value.bottom}`,stroke:A.value?I.value.evaluationColors.enable?A.value.evaluationColor:I.value.endColor:`transparent`,"stroke-width":L.value.strokeWidth,"stroke-dasharray":L.value.strokeDasharray,style:{transition:`all 0.3s ease-in-out`}},null,8,mt),[[Ke,A.value!==null&&![null,void 0].includes(A.value.end)]]),Ye(g(`rect`,{x:A.value?Math.min(A.value.startX,A.value.endX):q.value.left,y:q.value.top,height:Math.max(.1,q.value.height),width:A.value?Math.max(.1,Math.abs(A.value.endX-A.value.startX)):0,fill:A.value?w(te)(L.value.rectColor,L.value.rectOpacity):`transparent`,style:{transition:`all 0.3s ease-in-out`}},null,8,ht),[[Ke,L.value.showRect&&A.value!==null&&![null,void 0].includes(A.value.start)&&![null,void 0].includes(A.value.end)]]),Ye(g(`text`,{transform:`translate(${$n.value==null?0:$n.value}, ${q.value.top-6})`,fill:L.value.labelColor,"font-size":L.value.labelFontSize,"text-anchor":`middle`,style:{transition:`all 0.3s ease-in-out`}},C(er.value),9,gt),[[Ke,A.value!==null&&$n.value!==null&&L.value.showLabel]])],512),[[Ke,L.value.show&&k.value!==null]]),g(`defs`,null,[_(u,{t:`radial`,id:`start_grad_${D.value}`,fy:`30%`,stops:[[`10%`,w(c)(I.value.startColor,I.value.gradient.intensity/100),1],[`90%`,w(ne)(I.value.startColor,.1),1],[`100%`,I.value.startColor,1]]},null,8,[`id`,`stops`]),_(u,{t:`radial`,id:`end_grad_${D.value}`,fy:`30%`,stops:[[`10%`,w(c)(I.value.endColor,I.value.gradient.intensity/100),1],[`90%`,w(ne)(I.value.endColor,.1),1],[`100%`,I.value.endColor,1]]},null,8,[`id`,`stops`]),_(u,{t:`radial`,id:`positive_grad_${D.value}`,fy:`30%`,stops:[[`10%`,w(c)(I.value.evaluationColors.positive,I.value.gradient.intensity/100),1],[`90%`,w(ne)(I.value.evaluationColors.positive,.1),1],[`100%`,I.value.evaluationColors.positive,1]]},null,8,[`id`,`stops`]),_(u,{t:`radial`,id:`negative_grad_${D.value}`,fy:`30%`,stops:[[`10%`,w(c)(I.value.evaluationColors.negative,I.value.gradient.intensity/100),1],[`90%`,w(ne)(I.value.evaluationColors.negative,.1),1],[`100%`,I.value.evaluationColors.negative,1]]},null,8,[`id`,`stops`]),_(u,{t:`radial`,id:`neutral_grad_${D.value}`,fy:`30%`,stops:[[`10%`,w(c)(I.value.evaluationColors.neutral,I.value.gradient.intensity/100),1],[`90%`,w(ne)(I.value.evaluationColors.neutral,.1),1],[`100%`,I.value.evaluationColors.neutral,1]]},null,8,[`id`,`stops`])]),(y(!0),h(d,null,x(Y.value,(e,t)=>(y(),h(`g`,{key:`plot_${t}_${e.id}`},[g(`defs`,null,[_(u,{t:`linear`,id:`grad_pos_${D.value}`,x1:`0%`,x2:`100%`,y1:`0%`,y2:`0%`,stops:[[`0%`,I.value.startColor,1],[`100%`,I.value.endColor,1]]},null,8,[`id`,`stops`]),_(u,{t:`linear`,id:`grad_neg_${D.value}`,x1:`0%`,x2:`100%`,y1:`0%`,y2:`0%`,stops:[[`0%`,I.value.endColor,1],[`100%`,I.value.startColor,1]]},null,8,[`id`,`stops`])]),![void 0,null].includes(e.end)&&![void 0,null].includes(e.start)?(y(),h(`g`,_t,[I.value.link.type===`curved`?(y(),h(`g`,vt,[g(`path`,{d:`M
2
2
  ${e.startX},${e.y+J.value/2}
3
3
  C ${e.centerX},${e.y} ${e.centerX},${e.y}
4
4
  ${e.endX},${e.y+J.value/2}
@@ -1,3 +1,3 @@
1
- import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{n as t,t as n}from"./tableIntegration-CNoJ1CIY.js";import{n as r,t as i}from"./annotationSlots-BRR85CqJ.js";import{n as a,t as o}from"./userOptionsSlots-DYuo-E5m.js";import{$ as s,D as c,Dt as l,Ht as u,S as d,X as ee,Zt as f,at as p,b as m,i as h,in as g,n as te,nn as _,nt as v,r as y,t as b,w as x,zt as S}from"./lib-zDxoqrgo.js";import{n as ne,t as C}from"./useHints-BH9r_0Vd.js";import{t as re}from"./useConfig-CKdzPrcf.js";import{t as ie}from"./usePrinter-CnyKPIFM.js";import{n as ae,t as oe}from"./BaseScanner-8NdoBs7B.js";import{t as se}from"./useNestedProp-CT9phgWx.js";import{t as ce}from"./useThemeCheck-BKNRbGeC.js";import{t as le}from"./useChartExport-DtPNpc9M.js";import{n as ue}from"./Title-BRAjxtjG.js";import{t as de}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{l as fe,t as pe}from"./useResponsive-D2CPcpda.js";import{t as me}from"./A11yDataTable-DWNlWXzs.js";import{t as he}from"./useUserOptionState-CXlFnwPv.js";import{t as ge}from"./useChartAccessibility-DOMuYJfm.js";import{t as _e}from"./chartImage-NwZO-elv.js";import{t as ve}from"./Legend-DokTll4u.js";import{t as ye}from"./vue_ui_flow-kvV56Es9.js";import{Fragment as be,Teleport as xe,computed as w,createBlock as T,createCommentVNode as E,createElementBlock as D,createElementVNode as O,createSlots as Se,createTextVNode as Ce,createVNode as we,defineAsyncComponent as k,guardReactiveProps as A,mergeProps as Te,nextTick as Ee,normalizeClass as De,normalizeProps as j,normalizeStyle as M,onMounted as Oe,openBlock as N,ref as P,renderList as F,renderSlot as I,resolveDynamicComponent as ke,toDisplayString as L,toRefs as Ae,unref as R,watch as je,withCtx as z}from"vue";var Me=/* @__PURE__ */ e({default:()=>$e}),Ne=[`id`],Pe=[`id`],Fe={key:2,ref:`noTitle`,class:`vue-data-ui-no-title-space`,style:`height:36px; width: 100%;background:transparent`},Ie=[`id`],Le={style:{position:`relative`}},Re=[`xmlns`,`aria-describedby`,`viewBox`],ze=[`width`,`height`],Be=[`id`],Ve=[`stop-color`],He=[`stop-color`],Ue=[`d`,`fill`,`stroke`,`stroke-width`],We=[`data-a11y-node-id`,`x`,`y`,`height`,`width`,`fill`,`stroke`,`stroke-width`,`rx`,`aria-label`,`onMouseenter`,`onMouseleave`,`onClick`],Ge={key:1},Ke=[`x`,`y`,`font-size`,`fill`],qe=[`x`,`y`,`font-size`,`fill`],Je={key:0,style:{position:`absolute`,top:`100%`,left:`0`,width:`100%`},"data-dom-to-png-ignore":``,"aria-hidden":`true`},Ye={key:5,class:`vue-data-ui-watermark`},Xe=[`id`],Ze=[`onClick`],Qe={style:{display:`flex`,"align-items":`center`}},$e=/*#__PURE__*/ de({__name:`vue-ui-flow`,props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:[`copyAlt`],setup(e,{expose:de,emit:Me}){let $e=k(()=>import(`./Tooltip-BUXB0i6z.js`)),et=k(()=>import(`./BaseIcon-Cz30ODFA.js`).then(e=>e.n)),tt=k(()=>import(`./vue-ui-accordion-Dy5OVFKr.js`).then(e=>e.n)),nt=k(()=>import(`./DataTable-DSUA5M9p.js`)),rt=k(()=>import(`./PenAndPaper-DvJJaeU2.js`).then(e=>e.t)),it=k(()=>import(`./UserOptions-D65t74CM.js`).then(e=>e.n)),at=k(()=>import(`./PackageVersion-D6pKL176.js`).then(e=>e.t)),ot=k(()=>import(`./BaseDraggableDialog-T1gEsQid.js`).then(e=>e.n)),{vue_ui_flow:st}=re(),{isThemeValid:ct,warnInvalidTheme:lt}=ce(),B=e,ut=Me,V=P(ee()),H=P(null),dt=P(0),ft=P(0),pt=P(!1),mt=P(``),ht=P(null),gt=P(null),_t=P(null),vt=P(null),yt=P(null),bt=P(!1),xt=P(null),St=P(null),Ct=P(null),wt=P(null),Tt=P(null),Et=P({x:0,y:0}),Dt=P(`pointer`),Ot=P(!1),kt=w(()=>!!B.dataset&&B.dataset.length);Oe(()=>{bt.value=!0,Rt()});let U=P(!1);function At(e){U.value=e,dt.value+=1}let W=P(Ht()),G=w(()=>W.value.style.chart.nodes.labels),K=w(()=>W.value.style.chart.nodes),jt=w(()=>W.value.style.chart.links),q=w(()=>W.value.style.chart);ne({config:()=>W.value,dataset:()=>B.dataset,component:`VueUiFlow`,rules:[C.emptyArray,C.noHint]});let Mt=w(()=>W.value.userOptions.useCursorPointer),Nt=w(()=>g({defaultConfig:{userOptions:{show:!1},nodeCategories:{B:`A`,C:`B`},nodeCategoryColors:{A:`#CACACA`,B:`#AAAAAA`},table:{show:!1},style:{chart:{backgroundColor:`#99999930`,legend:{backgroundColor:`transparent`},nodes:{labels:{show:!1},stroke:`#666666`},links:{stroke:`#666666`}}}},userConfig:W.value.skeletonConfig??{}})),{loading:Pt,FINAL_DATASET:Ft,manualLoading:It}=ae({...Ae(B),FINAL_CONFIG:W,prepareConfig:Ht,skeletonDataset:B.config?.skeletonDataset??[[`A`,`B`,2,`#CACACA`],[`B`,`C`,1,`#CACACA`],[`C`,`D`,.5,`#CACACA`],[`E`,`F`,1,`#AAAAAA`],[`F`,`G`,.5,`#AAAAAA`],[`G`,`H`,.25,`#AAAAAA`]],skeletonConfig:g({defaultConfig:W.value,userConfig:Nt.value})}),Lt=w(()=>W.value.debug);function Rt(){if(S(B.dataset)&&(p({componentName:`VueUiFlow`,type:`dataset`,debug:Lt.value}),It.value=!0),S(B.dataset)||(It.value=W.value.loading),W.value.responsive){let e=fe(()=>{let{width:e,height:t}=pe({chart:H.value,title:q.value.title.text?gt.value:null,legend:q.value.legend.show?ht.value:null,source:_t.value});requestAnimationFrame(()=>{Ut.value=e,Wt.value=t})});vt.value&&(yt.value&&vt.value.unobserve(yt.value),vt.value.disconnect()),vt.value=new ResizeObserver(e),yt.value=H.value.parentNode,vt.value.observe(yt.value)}}let{userOptionsVisible:zt,setUserOptionsVisibility:Bt,keepUserOptionState:Vt}=he({config:W.value}),{svgRef:J}=ge({config:q.value.title});function Ht(){let e=se({userConfig:B.config,defaultConfig:st}),t=e,n=e.theme;if(n){if(!ct.value(e))lt(e),t=e;else{let r=se({userConfig:ye[n]||B.config,defaultConfig:e});t={...se({userConfig:B.config,defaultConfig:r}),customPalette:e.customPalette.length?e.customPalette:_[n]||u}}}else t=e;return t.nodeCategories=B.config.nodeCategories||{},t.nodeCategoryColors=B.config.nodeCategoryColors||{},t}let Ut=P(q.value.width),Wt=P(q.value.height),Gt=f(B.config);je(()=>B.config,(e,t)=>{let n=f(e),r=n!==Gt;Gt=n;let i=Ht();if(!r){W.value.style.chart.tooltip=i.style.chart.tooltip,Y.value.showTooltip=W.value.style.chart.tooltip.show;return}Pt.value||(W.value=i),zt.value=!W.value.userOptions.showOnChartHover,Rt(),ft.value+=1,Y.value.showTable=W.value.table.show},{deep:!0}),je(()=>B.dataset,e=>{Array.isArray(e)&&e.length>0&&(It.value=!1)},{deep:!0});let{isPrinting:Kt,isImaging:qt,generatePdf:Jt,generateImage:Yt}=ie({elementId:`flow_${V.value}`,fileName:q.value.title.text||`vue-ui-flow`,options:W.value.userOptions.print}),Xt=w(()=>W.value.userOptions.show&&!q.value.title.text),Zt=w(()=>x(W.value.customPalette)),Qt=w(()=>K.value.width),Y=P({showTable:W.value.table.show,showTooltip:q.value.tooltip.show});je(W,()=>{Y.value={showTable:W.value.table.show,showTooltip:q.value.tooltip.show}},{immediate:!0});let $t=w(()=>!Ft.value||!Ft.value.length?[]:Ft.value.map((e,t)=>[e[0],e[1],m(e[2]),e[3]?d(e[3]):Zt.value[t]||Zt.value[t%Zt.value.length]||u[t]||u[t%u.length]]));function en(e){let t={},n={};function r(e,r){t[e]||(t[e]={level:null,inflow:0,outflow:0,children:[],color:null,uid:ee()}),t[e].level===null&&(t[e].level=r),n[r]||(n[r]=[]),n[r].includes(e)||n[r].push(e)}e.forEach(([e,n,i])=>{let a=t[e]?.level??0,o=a+1;r(e,a),r(n,o),t[e].children.push({target:n,value:i}),t[e].outflow+=i,t[n].inflow+=i});let i=new Set(e.map(([e])=>e)),a=new Set(e.map(([,e])=>e)),o=Array.from(i).filter(e=>!a.has(e)),s={};o.forEach((e,t)=>{s[e]=Zt.value[t]||u[t%u.length]});let c={};e.forEach(([e,t,n,r])=>{r&&(c[e]=r,c[t]=r)}),Object.keys(t).forEach((e,n)=>{let r=W.value.nodeCategories?.[e],i=r?W.value.nodeCategoryColors?.[r]:null;t[e].color=c[e]||i||(o.includes(e)?s[e]:null)||u[n%u.length]}),Object.keys(t).forEach(e=>{t[e].value=Math.max(t[e].inflow,t[e].outflow)});let l=rn.value,d=an.value.width,f=an.value.height,p=Object.keys(n).map(Number).sort((e,t)=>e-t),h=p.length||1,g=h>1?d/(h-1):0,te=Number(Qt.value),_=Number(K.value.gapPx??K.value.gap??8),v=Number(K.value.minHeight||0);function y(e){let r=n[e],i=r.length;if(!i)return 1/0;let a=Math.max(0,(i-1)*_),o=Math.max(0,f-a),s=Math.min(v,i?o/i:0),c=0,l=r.map(e=>t[e].value||0),u=l.reduce((e,t)=>e+t,0);for(let e=0;e<12;e+=1){let e=u>0?(o-c)/u:0,t=[];for(let n=0;n<l.length;n+=1){let r=l[n];r<0||r*e<s&&t.push(n)}if(!t.length)return Math.max(0,e);for(let e of t)c+=s,u-=l[e],l[e]=-1;if(u<=0)return 0}return u>0?Math.max(0,(o-c)/u):0}let b=p.map(y),x=b.length?Math.min(...b):0,S={};p.forEach(e=>{let r=n[e],i=r.length,a=Math.max(0,(i-1)*_),o=Math.max(0,f-a),s=Math.min(v,i?o/i:0),c=r.map(e=>Math.max(s,(t[e].value||0)*x)),u=c.reduce((e,t)=>e+t,0)+a,d=Math.max(0,(f-u)/2);r.forEach((n,r)=>{let a=c[r],o=l.left+e*g,s=d;S[n]={x:o,y:s,absoluteY:s,height:a,i:r,color:t[n].color,value:t[n].value,id:ee()},d+=a,r<i-1&&(d+=_)})});let ne=[],C=l.top,re={},ie={};Object.keys(t).forEach(e=>{re[e]=S[e]?.y??0,ie[e]=0});let ae=!!jt.value.smooth,oe=.5;return p.forEach(e=>{n[e].forEach(e=>{let n=t[e],r=S[e];if(!n.children||!n.children.length)return;let i=r.y;n.children.forEach(({target:a,value:o})=>{let s=S[a],c=t[a],l=n.outflow>0?o/n.outflow:0,u=c.inflow>0?o/c.inflow:0,d=m(i+C),f=m(i+l*r.height+C),p=re[a],h=p+u*s.height;ie[a]+=o;let g=c.inflow>0&&ie[a]>=c.inflow-1e-6,_=s.y+s.height;(g||h>_-.25)&&(h=_);let v=m(p+C),y=m(h+C),b=m(r.x+te),x=m(s.x),se;if(!ae||x<=b)se=`M ${b} ${d} L ${b} ${f} L ${x} ${y} L ${x} ${v} Z`;else{let e=x-b,t=m(b+e*oe),n=m(x-e*oe),r=d,i=v,a=f,o=y;se=`M ${b} ${r} C ${t} ${r}, ${n} ${i}, ${x} ${i} L ${x} ${o} C ${n} ${o}, ${t} ${a}, ${b} ${a} Z`}ne.push({id:ee(),source:e,target:a,path:se,value:o,sourceColor:n.color,targetColor:t[a].color}),i=f-C,re[a]=h})})}),{nodeCoordinates:S,links:ne}}let X=w(()=>{let e=en(Ft.value);return{nodes:Object.keys(e.nodeCoordinates).map((t,n)=>({...e.nodeCoordinates[t],name:t})),links:e.links}}),tn=w(()=>Ut.value),nn=w(()=>Wt.value),rn=w(()=>q.value.padding),an=w(()=>({width:Math.max(0,tn.value-40-rn.value.right-rn.value.left),height:Math.max(0,nn.value-rn.value.top-rn.value.bottom)})),on=w(()=>({width:tn.value,height:nn.value}));function sn(e){let t={},n={},r=/* @__PURE__ */ new Set;return $t.value.forEach(([e,r,i])=>{t[e]||(t[e]=[]),n[r]||(n[r]=[]),t[e].push(r),n[r].push(e)}),t[e]&&t[e].forEach(e=>r.add(e)),n[e]&&n[e].forEach(e=>r.add(e)),Array.from(r).concat(e)}let Z=P(null),Q=P(null),cn=P(null),ln=P(!1),un=P(null);function dn(){un.value=null,Z.value=null,Q.value=null,pt.value=!1,wt.value=null,Tt.value=null}function fn(e){if(!J.value||!e)return;let t=J.value.querySelector(`[data-a11y-node-id="${e}"]`);if(!t)return;let n=t.getBoundingClientRect();Et.value={x:n.left+n.width/2,y:n.top+n.height/2}}function pn(e,t,n=`pointer`,r=null){kn.value=[],Z.value=sn(e.name),Q.value=e.name,un.value=e.id,Dt.value=n,wt.value=r,Tt.value=e.id;let i=e.name,a=$t.value,o=0,c=0,u=[],d=[],ee=new Set(a.map(([e])=>e)),f=new Set(a.map(([,e])=>e)),p=Array.from(ee).filter(e=>!f.has(e)),m=a.filter(([e])=>p.includes(e)).reduce((e,[t,n,r])=>e+r,0),g={};X.value.nodes.forEach(e=>{g[e.name]=e.color}),a.forEach(([e,t,n])=>{t===i&&(o+=n,u.push({source:e,value:n,color:g[e]})),e===i&&(c+=n,d.push({target:t,value:n,color:g[t]}))});let te=m>0?Math.max(o,c)/m*100:0,_={name:i,inflow:o,outflow:c,from:u,to:d,percentOfTotal:te,color:g[i]||`#000000`};W.value.events.datapointEnter&&W.value.events.datapointEnter({datapoint:_,seriesIndex:t}),cn.value={datapoint:_,config:W.value,seriesIndex:t,series:X.value},pt.value=!0;let v=``,y=q.value.tooltip.customFormat;if(ln.value=!1,l(y))try{let e=y({datapoint:_,series:X.value,config:W.value});typeof e==`string`&&(mt.value=e,ln.value=!0)}catch{console.warn(`Custom format cannot be applied.`)}if(!ln.value){let e=q.value.tooltip.showPercentage?`<div>${s({p:q.value.tooltip.translations.percentOfTotal,v:_.percentOfTotal,s:`%`,r:q.value.tooltip.roundingPercentage})}</div>`:``;v+=`<div style="width:100%;text-align:center;border-bottom:1px solid ${q.value.tooltip.borderColor};padding-bottom:6px;margin-bottom:3px;"><span style="margin-right:4px; color:${_.color}">⏹</span>${_.name}${e}</div>`,_.from.length&&(v+=`<div>${q.value.tooltip.translations.from}</div>`,_.from.forEach(e=>{v+=`<div><span style="color:${e.color}">⏹←</span> ${e.source}: ${h(G.value.formatter,e.value,s({p:G.value.prefix,v:e.value,s:G.value.suffix,r:G.value.rounding}))}</div>`})),_.to.length&&(v+=`<div style="margin-top:6px;">${q.value.tooltip.translations.to}</div>`,_.to.forEach(e=>{v+=`<div><span style="color:${e.color}">⏹→</span> ${e.target}: ${h(G.value.formatter,e.value,s({p:G.value.prefix,v:e.value,s:G.value.suffix,r:G.value.rounding}))}</div>`})),mt.value=v}n===`keyboard`&&Ee(()=>{fn(e.id)})}function mn(e){let t=cn.value;W.value.events.datapointLeave&&W.value.events.datapointLeave({datapoint:t,seriesIndex:e}),!(Dt.value===`keyboard`&&Tt.value)&&(un.value=null,Z.value=null,Q.value=null,pt.value=!1)}function hn(e){let t=cn.value;W.value.events.datapointClick&&W.value.events.datapointClick({datapoint:t,seriesIndex:e})}let gn=w(()=>X.value.links.map(({source:e,target:t,sourceColor:n,targetColor:r,value:i})=>({source:e,target:t,sourceColor:n,targetColor:r,value:i})));function _n(e=null){Ee(()=>{let t=gn.value.map((e,t)=>[[e.source],[e.target],[e.value]]),n=[[q.value.title.text],[q.value.title.subtitle.text],[[W.value.table.columnNames.source],[W.value.table.columnNames.target],[W.value.table.columnNames.value]]].concat(t),r=c(n);e?e(r):v({csvContent:r,title:q.value.title.text||`vue-ui-flow`})})}let vn=w(()=>{let e=[W.value.table.columnNames.source,W.value.table.columnNames.target,W.value.table.columnNames.value],t=gn.value.map((e,t)=>[{color:e.sourceColor,name:e.source,shape:`square`},{color:e.targetColor,name:e.target,shape:`square`},s({p:G.value.prefix,v:e.value,s:G.value.suffix,r:G.value.rounding})]),n={th:{backgroundColor:W.value.table.th.backgroundColor,color:W.value.table.th.color,outline:W.value.table.th.outline},td:{backgroundColor:W.value.table.td.backgroundColor,color:W.value.table.td.color,outline:W.value.table.td.outline},breakpoint:W.value.table.responsiveBreakpoint};return{colNames:[W.value.table.columnNames.source,W.value.table.columnNames.target,W.value.table.columnNames.value],head:e,body:t,config:n}}),yn=w(()=>({headers:vn.value?.colNames??[],rows:vn.value?.body??[]})),bn=w(()=>[...X.value.nodes].map((e,t)=>({...e,index:t,centerX:e.x+Qt.value/2,centerY:m(e.absoluteY)+q.value.padding.top+e.height/2})).sort((e,t)=>e.x===t.x?e.absoluteY-t.absoluteY:e.x-t.x)),$=w(()=>{let e=[];return bn.value.forEach(t=>{let n=e.find(e=>Math.abs(e.x-t.x)<=1);n?n.nodes.push(t):e.push({x:t.x,nodes:[t]})}),e.forEach(e=>{e.nodes.sort((e,t)=>e.absoluteY-t.absoluteY)}),e.sort((e,t)=>e.x-t.x)}),xn=w(()=>{let e=/* @__PURE__ */ new Map;return bn.value.forEach((t,n)=>{e.set(t.id,n)}),e});function Sn(){return X.value}function Cn(){Y.value.showTable=!Y.value.showTable}let wn=P(!1);function Tn(){wn.value=!wn.value}function En(){Y.value.showTooltip=!Y.value.showTooltip}let Dn=w(()=>{let e=new Set(X.value.nodes.map(e=>W.value.nodeCategories[e.name]||`__uncategorized__`));return Array.from(e).map(e=>({name:e,color:W.value.nodeCategoryColors[e]||u[0],shape:`square`,count:X.value.nodes.filter(t=>(W.value.nodeCategories[t.name]||`__uncategorized__`)===e).length})).map((e,t)=>{let n=kn.value.includes(t);return{...e,segregate:()=>An({legend:e,i:t}),isSegregated:n,opacity:kn.value.length?n?1:.5:1,display:`${e.name} (${e.count})`}})}),On=w(()=>Dn.value.filter(e=>e.name!==`__uncategorized__`)),kn=P([]);function An({legend:e,i:t}){let n=e.name;if(Z.value?.every(e=>W.value.nodeCategories[e]===n)){Z.value=null,Q.value=null,kn.value=[];return}kn.value=[t],Z.value=X.value.nodes.filter(e=>W.value.nodeCategories[e.name]===n).map(e=>e.name),Q.value=null}let jn=w(()=>({cy:`flow-legend`,backgroundColor:q.value.legend.backgroundColor,color:q.value.legend.color,fontSize:q.value.legend.fontSize,paddingBottom:q.value.legend.paddingBottom,fontWeight:q.value.legend.bold?`bold`:`normal`})),Mn=_e(H,()=>q.value.title.text),Nn=w(()=>n({config:W,style:q,mutableConfig:Y,dialog:ot,accordion:tt,isFullscreen:U,parent:H,maxWidth:800,isCursorPointer:Mt}));je(()=>Y.value.showTable,e=>t(e,W,xt));function Pn(){Y.value.showTable=!1,St.value&&St.value.setTableIconState(!1)}let Fn=w(()=>On.value.map(e=>({...e,name:e.display}))),In=w(()=>q.value.backgroundColor),Ln=w(()=>q.value.legend),Rn=w(()=>q.value.title),{isCallbackImaging:zn,isCallbackSvg:Bn,generateSvg:Vn,onGenerateImage:Hn}=le({svg:J,title:Rn,legend:Ln,legendItems:Fn,backgroundColor:In,getSvgCallback:()=>W.value.userOptions.callbacks.svg,generateImage:Yt});async function Un(){if(ut(`copyAlt`,{config:W.value,dataset:X.value}),!W.value.userOptions.callbacks.altCopy){console.warn("Vue Data UI - A callback must be set for `altCopy` in userOptions.");return}await Promise.resolve(W.value.userOptions.callbacks.altCopy({config:W.value,dataset:X.value}))}function Wn(e){return $.value.findIndex(t=>t.nodes.some(t=>t.id===e))}function Gn(e,t){let n=$.value[e];return n?n.nodes.findIndex(e=>e.id===t):-1}function Kn(e,t){let n=$.value[e];if(!n||!n.nodes.length)return null;let r=n.nodes[0],i=Math.abs(r.centerY-t);for(let e=1;e<n.nodes.length;e+=1){let a=n.nodes[e],o=Math.abs(a.centerY-t);o<i&&(r=a,i=o)}return r}function qn(){wt.value=null,Tt.value=null,Ot.value=!0}function Jn(){dn(),Ot.value=!1}function Yn(e){if(!J.value||wn.value||document.activeElement!==J.value||!bn.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){dn();return}if(a){if(wt.value===null)return;hn(wt.value);return}if(Tt.value===null){let e=$.value[0]?.nodes?.[0];if(!e)return;let t=xn.value.get(e.id)??0;pn(e,t,`keyboard`,t);return}let s=xn.value.get(Tt.value);if(s===void 0)return;let c=bn.value[s];if(!c)return;let l=Wn(c.id);if(l<0)return;let u=null;if(r||i){let e=Gn(l,c.id);if(e<0)return;let t=$.value[l];if(!t?.nodes?.length)return;let n=e+(i?1:-1);n<0&&(n=t.nodes.length-1),n>=t.nodes.length&&(n=0),u=t.nodes[n]}if(t||n){let e=l+(n?1:-1);e<0&&(e=$.value.length-1),e>=$.value.length&&(e=0),u=Kn(e,c.centerY)}if(!u)return;let d=xn.value.get(u.id);d!==void 0&&pn(u,d,`keyboard`,d)}return de({getData:Sn,getImage:Mn,generateCsv:_n,generateImage:Yt,generateSvg:Vn,generatePdf:Jt,toggleTable:Cn,toggleAnnotator:Tn,toggleTooltip:En,drillCategory:An,unselectNode:mn,toggleFullscreen:At,copyAlt:Un}),(e,t)=>(N(),D(`div`,{ref_key:`flowChart`,ref:H,class:De(`vue-data-ui-component vue-ui-flow ${U.value?`vue-data-ui-wrapper-fullscreen`:``}`),style:M(`font-family:${W.value.style.fontFamily};width:100%; text-align:center;background:${q.value.backgroundColor}`),id:`flow_${V.value}`,onMouseenter:t[2]||=()=>R(Bt)(!0),onMouseleave:t[3]||=()=>{R(Bt)(!1),Ot.value||dn()}},[O(`div`,{id:`chart-instructions-${V.value}`,class:`sr-only`},[O(`p`,null,L(W.value.a11y.translations.keyboardNavigation),1)],8,Pe),yn.value?.rows?.length?(N(),T(me,{key:0,uid:V.value,head:yn.value.headers,body:yn.value.rows,notice:W.value.a11y.translations.tableAvailable,caption:W.value.a11y.translations.tableCaption},null,8,[`uid`,`head`,`body`,`notice`,`caption`])):E(``,!0),W.value.userOptions.buttons.annotator?(N(),T(R(rt),{key:1,svgRef:R(J),backgroundColor:q.value.backgroundColor,color:q.value.color,active:wn.value,palette:W.value.userOptions.annotatorPalette,isCursorPointer:Mt.value,onClose:Tn},Se({_:2},[F(R(i),t=>({name:t,fn:z(n=>[I(e.$slots,t,j(A(R(r)(t,n))),void 0,!0)])}))]),1032,[`svgRef`,`backgroundColor`,`color`,`active`,`palette`,`isCursorPointer`])):E(``,!0),Xt.value?(N(),D(`div`,Fe,null,512)):E(``,!0),q.value.title.text?(N(),D(`div`,{key:3,ref_key:`chartTitle`,ref:gt,style:`width:100%;background:transparent;padding-bottom:24px`},[(N(),T(ue,{key:`title_${ft.value}`,config:{title:{cy:`flow-title`,...q.value.title},subtitle:{cy:`flow-subtitle`,...q.value.title.subtitle}}},null,8,[`config`]))],512)):E(``,!0),O(`div`,{id:`legend-top-${V.value}`},null,8,Ie),W.value.userOptions.show&&kt.value&&(R(Vt)||R(zt))?(N(),T(R(it),{ref_key:`userOptionsRef`,ref:St,key:`user_option_${dt.value}`,backgroundColor:q.value.backgroundColor,color:q.value.color,isPrinting:R(Kt),isImaging:R(qt),uid:V.value,hasPdf:W.value.userOptions.buttons.pdf,hasXls:W.value.userOptions.buttons.csv,hasImg:W.value.userOptions.buttons.img,hasSvg:W.value.userOptions.buttons.svg,hasTable:W.value.userOptions.buttons.table,callbacks:W.value.userOptions.callbacks,hasFullscreen:W.value.userOptions.buttons.fullscreen,hasAltCopy:W.value.userOptions.buttons.altCopy,isFullscreen:U.value,titles:{...W.value.userOptions.buttonTitles},chartElement:H.value,position:W.value.userOptions.position,hasAnnotator:W.value.userOptions.buttons.annotator,printScale:W.value.userOptions.print.scale,isAnnotation:wn.value,hasTooltip:q.value.tooltip.show&&W.value.userOptions.buttons.tooltip,isTooltip:Y.value.showTooltip,tableDialog:W.value.table.useDialog,isCursorPointer:Mt.value,onToggleTooltip:En,onToggleFullscreen:At,onGeneratePdf:R(Jt),onGenerateCsv:_n,onGenerateImage:R(Hn),onGenerateSvg:R(Vn),onToggleTable:Cn,onToggleAnnotator:Tn,onCopyAlt:Un,style:M({visibility:R(Vt)?R(zt)?`visible`:`hidden`:`visible`})},Se({_:2},[F(R(a)(e.$slots,`menuIcon optionTooltip optionPdf optionCsv optionImg optionSvg optionTable optionFullscreen optionAnnotator optionAltCopy custom-menu-before custom-menu-after`),t=>({name:t,fn:z(n=>[I(e.$slots,t,j(A(R(o)(t,n))),void 0,!0)])}))]),1032,/* @__PURE__ */ `backgroundColor.color.isPrinting.isImaging.uid.hasPdf.hasXls.hasImg.hasSvg.hasTable.callbacks.hasFullscreen.hasAltCopy.isFullscreen.titles.chartElement.position.hasAnnotator.printScale.isAnnotation.hasTooltip.isTooltip.tableDialog.isCursorPointer.onGeneratePdf.onGenerateImage.onGenerateSvg.style`.split(`.`))):E(``,!0),O(`div`,Le,[(N(),D(`svg`,{ref_key:`svgRef`,ref:J,xmlns:R(b),"aria-describedby":`chart-instructions-${V.value}`,viewBox:`0 0 ${on.value.width} ${on.value.height}`,class:De({"vue-data-ui-fullscreen--on":U.value,"vue-data-ui-fulscreen--off":!U.value}),style:M({maxWidth:`100%`,overflow:`visible`,background:`transparent`,color:q.value.color}),tabindex:`0`,onFocus:qn,onBlur:Jn,onKeydown:Yn},[we(R(at)),e.$slots[`chart-background`]?(N(),D(`foreignObject`,{key:0,x:0,y:0,width:on.value.width,height:on.value.height,style:{pointerEvents:`none`}},[I(e.$slots,`chart-background`,{},void 0,!0)],8,ze)):E(``,!0),O(`defs`,null,[(N(!0),D(be,null,F(X.value.links,(e,t)=>(N(),D(`linearGradient`,{id:e.id,x1:`0%`,y1:`0%`,x2:`100%`,y2:`0%`},[O(`stop`,{offset:`0%`,"stop-color":e.sourceColor},null,8,Ve),O(`stop`,{offset:`100%`,"stop-color":e.targetColor},null,8,He)],8,Be))),256))]),(N(!0),D(be,null,F(X.value.links,e=>(N(),D(`path`,{class:`vue-ui-flow-link`,d:e.path,"stroke-linejoin":`round`,"stroke-miterlimit":`1`,fill:`url(#${e.id})`,stroke:jt.value.stroke,"stroke-width":jt.value.strokeWidth,style:M(`
1
+ import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{n as t,t as n}from"./tableIntegration-CNoJ1CIY.js";import{n as r,t as i}from"./annotationSlots-BRR85CqJ.js";import{n as a,t as o}from"./userOptionsSlots-DYuo-E5m.js";import{$ as s,D as c,Dt as l,Ht as u,S as d,X as ee,Zt as f,at as p,b as m,i as h,in as g,n as te,nn as _,nt as v,r as y,t as b,w as x,zt as S}from"./lib-CV_IANZ6.js";import{n as ne,t as C}from"./useHints-BH9r_0Vd.js";import{t as re}from"./useConfig-CKdzPrcf.js";import{t as ie}from"./usePrinter-hLW3cv4N.js";import{n as ae,t as oe}from"./BaseScanner-8NdoBs7B.js";import{t as se}from"./useNestedProp-CB186vF2.js";import{t as ce}from"./useThemeCheck-BKNRbGeC.js";import{t as le}from"./useChartExport-DtPNpc9M.js";import{n as ue}from"./Title-BGYFqulv.js";import{t as de}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{l as fe,t as pe}from"./useResponsive-D2CPcpda.js";import{t as me}from"./A11yDataTable-DWNlWXzs.js";import{t as he}from"./useUserOptionState-CXlFnwPv.js";import{t as ge}from"./useChartAccessibility-DOMuYJfm.js";import{t as _e}from"./chartImage-CIvU_04o.js";import{t as ve}from"./Legend-D8YoT1RJ.js";import{t as ye}from"./vue_ui_flow-kvV56Es9.js";import{Fragment as be,Teleport as xe,computed as w,createBlock as T,createCommentVNode as E,createElementBlock as D,createElementVNode as O,createSlots as Se,createTextVNode as Ce,createVNode as we,defineAsyncComponent as k,guardReactiveProps as A,mergeProps as Te,nextTick as Ee,normalizeClass as De,normalizeProps as j,normalizeStyle as M,onMounted as Oe,openBlock as N,ref as P,renderList as F,renderSlot as I,resolveDynamicComponent as ke,toDisplayString as L,toRefs as Ae,unref as R,watch as je,withCtx as z}from"vue";var Me=/* @__PURE__ */ e({default:()=>$e}),Ne=[`id`],Pe=[`id`],Fe={key:2,ref:`noTitle`,class:`vue-data-ui-no-title-space`,style:`height:36px; width: 100%;background:transparent`},Ie=[`id`],Le={style:{position:`relative`}},Re=[`xmlns`,`aria-describedby`,`viewBox`],ze=[`width`,`height`],Be=[`id`],Ve=[`stop-color`],He=[`stop-color`],Ue=[`d`,`fill`,`stroke`,`stroke-width`],We=[`data-a11y-node-id`,`x`,`y`,`height`,`width`,`fill`,`stroke`,`stroke-width`,`rx`,`aria-label`,`onMouseenter`,`onMouseleave`,`onClick`],Ge={key:1},Ke=[`x`,`y`,`font-size`,`fill`],qe=[`x`,`y`,`font-size`,`fill`],Je={key:0,style:{position:`absolute`,top:`100%`,left:`0`,width:`100%`},"data-dom-to-png-ignore":``,"aria-hidden":`true`},Ye={key:5,class:`vue-data-ui-watermark`},Xe=[`id`],Ze=[`onClick`],Qe={style:{display:`flex`,"align-items":`center`}},$e=/*#__PURE__*/ de({__name:`vue-ui-flow`,props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:[`copyAlt`],setup(e,{expose:de,emit:Me}){let $e=k(()=>import(`./Tooltip-Cus2-XNQ.js`)),et=k(()=>import(`./BaseIcon-DdIyewwY.js`).then(e=>e.n)),tt=k(()=>import(`./vue-ui-accordion-BNvevckx.js`).then(e=>e.n)),nt=k(()=>import(`./DataTable-WNecJMcY.js`)),rt=k(()=>import(`./PenAndPaper-IMw576MC.js`).then(e=>e.t)),it=k(()=>import(`./UserOptions-DTxMeZv3.js`).then(e=>e.n)),at=k(()=>import(`./PackageVersion-CdkxOy58.js`).then(e=>e.t)),ot=k(()=>import(`./BaseDraggableDialog-D_tuHEjO.js`).then(e=>e.n)),{vue_ui_flow:st}=re(),{isThemeValid:ct,warnInvalidTheme:lt}=ce(),B=e,ut=Me,V=P(ee()),H=P(null),dt=P(0),ft=P(0),pt=P(!1),mt=P(``),ht=P(null),gt=P(null),_t=P(null),vt=P(null),yt=P(null),bt=P(!1),xt=P(null),St=P(null),Ct=P(null),wt=P(null),Tt=P(null),Et=P({x:0,y:0}),Dt=P(`pointer`),Ot=P(!1),kt=w(()=>!!B.dataset&&B.dataset.length);Oe(()=>{bt.value=!0,Rt()});let U=P(!1);function At(e){U.value=e,dt.value+=1}let W=P(Ht()),G=w(()=>W.value.style.chart.nodes.labels),K=w(()=>W.value.style.chart.nodes),jt=w(()=>W.value.style.chart.links),q=w(()=>W.value.style.chart);ne({config:()=>W.value,dataset:()=>B.dataset,component:`VueUiFlow`,rules:[C.emptyArray,C.noHint]});let Mt=w(()=>W.value.userOptions.useCursorPointer),Nt=w(()=>g({defaultConfig:{userOptions:{show:!1},nodeCategories:{B:`A`,C:`B`},nodeCategoryColors:{A:`#CACACA`,B:`#AAAAAA`},table:{show:!1},style:{chart:{backgroundColor:`#99999930`,legend:{backgroundColor:`transparent`},nodes:{labels:{show:!1},stroke:`#666666`},links:{stroke:`#666666`}}}},userConfig:W.value.skeletonConfig??{}})),{loading:Pt,FINAL_DATASET:Ft,manualLoading:It}=ae({...Ae(B),FINAL_CONFIG:W,prepareConfig:Ht,skeletonDataset:B.config?.skeletonDataset??[[`A`,`B`,2,`#CACACA`],[`B`,`C`,1,`#CACACA`],[`C`,`D`,.5,`#CACACA`],[`E`,`F`,1,`#AAAAAA`],[`F`,`G`,.5,`#AAAAAA`],[`G`,`H`,.25,`#AAAAAA`]],skeletonConfig:g({defaultConfig:W.value,userConfig:Nt.value})}),Lt=w(()=>W.value.debug);function Rt(){if(S(B.dataset)&&(p({componentName:`VueUiFlow`,type:`dataset`,debug:Lt.value}),It.value=!0),S(B.dataset)||(It.value=W.value.loading),W.value.responsive){let e=fe(()=>{let{width:e,height:t}=pe({chart:H.value,title:q.value.title.text?gt.value:null,legend:q.value.legend.show?ht.value:null,source:_t.value});requestAnimationFrame(()=>{Ut.value=e,Wt.value=t})});vt.value&&(yt.value&&vt.value.unobserve(yt.value),vt.value.disconnect()),vt.value=new ResizeObserver(e),yt.value=H.value.parentNode,vt.value.observe(yt.value)}}let{userOptionsVisible:zt,setUserOptionsVisibility:Bt,keepUserOptionState:Vt}=he({config:W.value}),{svgRef:J}=ge({config:q.value.title});function Ht(){let e=se({userConfig:B.config,defaultConfig:st}),t=e,n=e.theme;if(n){if(!ct.value(e))lt(e),t=e;else{let r=se({userConfig:ye[n]||B.config,defaultConfig:e});t={...se({userConfig:B.config,defaultConfig:r}),customPalette:e.customPalette.length?e.customPalette:_[n]||u}}}else t=e;return t.nodeCategories=B.config.nodeCategories||{},t.nodeCategoryColors=B.config.nodeCategoryColors||{},t}let Ut=P(q.value.width),Wt=P(q.value.height),Gt=f(B.config);je(()=>B.config,(e,t)=>{let n=f(e),r=n!==Gt;Gt=n;let i=Ht();if(!r){W.value.style.chart.tooltip=i.style.chart.tooltip,Y.value.showTooltip=W.value.style.chart.tooltip.show;return}Pt.value||(W.value=i),zt.value=!W.value.userOptions.showOnChartHover,Rt(),ft.value+=1,Y.value.showTable=W.value.table.show},{deep:!0}),je(()=>B.dataset,e=>{Array.isArray(e)&&e.length>0&&(It.value=!1)},{deep:!0});let{isPrinting:Kt,isImaging:qt,generatePdf:Jt,generateImage:Yt}=ie({elementId:`flow_${V.value}`,fileName:q.value.title.text||`vue-ui-flow`,options:W.value.userOptions.print}),Xt=w(()=>W.value.userOptions.show&&!q.value.title.text),Zt=w(()=>x(W.value.customPalette)),Qt=w(()=>K.value.width),Y=P({showTable:W.value.table.show,showTooltip:q.value.tooltip.show});je(W,()=>{Y.value={showTable:W.value.table.show,showTooltip:q.value.tooltip.show}},{immediate:!0});let $t=w(()=>!Ft.value||!Ft.value.length?[]:Ft.value.map((e,t)=>[e[0],e[1],m(e[2]),e[3]?d(e[3]):Zt.value[t]||Zt.value[t%Zt.value.length]||u[t]||u[t%u.length]]));function en(e){let t={},n={};function r(e,r){t[e]||(t[e]={level:null,inflow:0,outflow:0,children:[],color:null,uid:ee()}),t[e].level===null&&(t[e].level=r),n[r]||(n[r]=[]),n[r].includes(e)||n[r].push(e)}e.forEach(([e,n,i])=>{let a=t[e]?.level??0,o=a+1;r(e,a),r(n,o),t[e].children.push({target:n,value:i}),t[e].outflow+=i,t[n].inflow+=i});let i=new Set(e.map(([e])=>e)),a=new Set(e.map(([,e])=>e)),o=Array.from(i).filter(e=>!a.has(e)),s={};o.forEach((e,t)=>{s[e]=Zt.value[t]||u[t%u.length]});let c={};e.forEach(([e,t,n,r])=>{r&&(c[e]=r,c[t]=r)}),Object.keys(t).forEach((e,n)=>{let r=W.value.nodeCategories?.[e],i=r?W.value.nodeCategoryColors?.[r]:null;t[e].color=c[e]||i||(o.includes(e)?s[e]:null)||u[n%u.length]}),Object.keys(t).forEach(e=>{t[e].value=Math.max(t[e].inflow,t[e].outflow)});let l=rn.value,d=an.value.width,f=an.value.height,p=Object.keys(n).map(Number).sort((e,t)=>e-t),h=p.length||1,g=h>1?d/(h-1):0,te=Number(Qt.value),_=Number(K.value.gapPx??K.value.gap??8),v=Number(K.value.minHeight||0);function y(e){let r=n[e],i=r.length;if(!i)return 1/0;let a=Math.max(0,(i-1)*_),o=Math.max(0,f-a),s=Math.min(v,i?o/i:0),c=0,l=r.map(e=>t[e].value||0),u=l.reduce((e,t)=>e+t,0);for(let e=0;e<12;e+=1){let e=u>0?(o-c)/u:0,t=[];for(let n=0;n<l.length;n+=1){let r=l[n];r<0||r*e<s&&t.push(n)}if(!t.length)return Math.max(0,e);for(let e of t)c+=s,u-=l[e],l[e]=-1;if(u<=0)return 0}return u>0?Math.max(0,(o-c)/u):0}let b=p.map(y),x=b.length?Math.min(...b):0,S={};p.forEach(e=>{let r=n[e],i=r.length,a=Math.max(0,(i-1)*_),o=Math.max(0,f-a),s=Math.min(v,i?o/i:0),c=r.map(e=>Math.max(s,(t[e].value||0)*x)),u=c.reduce((e,t)=>e+t,0)+a,d=Math.max(0,(f-u)/2);r.forEach((n,r)=>{let a=c[r],o=l.left+e*g,s=d;S[n]={x:o,y:s,absoluteY:s,height:a,i:r,color:t[n].color,value:t[n].value,id:ee()},d+=a,r<i-1&&(d+=_)})});let ne=[],C=l.top,re={},ie={};Object.keys(t).forEach(e=>{re[e]=S[e]?.y??0,ie[e]=0});let ae=!!jt.value.smooth,oe=.5;return p.forEach(e=>{n[e].forEach(e=>{let n=t[e],r=S[e];if(!n.children||!n.children.length)return;let i=r.y;n.children.forEach(({target:a,value:o})=>{let s=S[a],c=t[a],l=n.outflow>0?o/n.outflow:0,u=c.inflow>0?o/c.inflow:0,d=m(i+C),f=m(i+l*r.height+C),p=re[a],h=p+u*s.height;ie[a]+=o;let g=c.inflow>0&&ie[a]>=c.inflow-1e-6,_=s.y+s.height;(g||h>_-.25)&&(h=_);let v=m(p+C),y=m(h+C),b=m(r.x+te),x=m(s.x),se;if(!ae||x<=b)se=`M ${b} ${d} L ${b} ${f} L ${x} ${y} L ${x} ${v} Z`;else{let e=x-b,t=m(b+e*oe),n=m(x-e*oe),r=d,i=v,a=f,o=y;se=`M ${b} ${r} C ${t} ${r}, ${n} ${i}, ${x} ${i} L ${x} ${o} C ${n} ${o}, ${t} ${a}, ${b} ${a} Z`}ne.push({id:ee(),source:e,target:a,path:se,value:o,sourceColor:n.color,targetColor:t[a].color}),i=f-C,re[a]=h})})}),{nodeCoordinates:S,links:ne}}let X=w(()=>{let e=en(Ft.value);return{nodes:Object.keys(e.nodeCoordinates).map((t,n)=>({...e.nodeCoordinates[t],name:t})),links:e.links}}),tn=w(()=>Ut.value),nn=w(()=>Wt.value),rn=w(()=>q.value.padding),an=w(()=>({width:Math.max(0,tn.value-40-rn.value.right-rn.value.left),height:Math.max(0,nn.value-rn.value.top-rn.value.bottom)})),on=w(()=>({width:tn.value,height:nn.value}));function sn(e){let t={},n={},r=/* @__PURE__ */ new Set;return $t.value.forEach(([e,r,i])=>{t[e]||(t[e]=[]),n[r]||(n[r]=[]),t[e].push(r),n[r].push(e)}),t[e]&&t[e].forEach(e=>r.add(e)),n[e]&&n[e].forEach(e=>r.add(e)),Array.from(r).concat(e)}let Z=P(null),Q=P(null),cn=P(null),ln=P(!1),un=P(null);function dn(){un.value=null,Z.value=null,Q.value=null,pt.value=!1,wt.value=null,Tt.value=null}function fn(e){if(!J.value||!e)return;let t=J.value.querySelector(`[data-a11y-node-id="${e}"]`);if(!t)return;let n=t.getBoundingClientRect();Et.value={x:n.left+n.width/2,y:n.top+n.height/2}}function pn(e,t,n=`pointer`,r=null){kn.value=[],Z.value=sn(e.name),Q.value=e.name,un.value=e.id,Dt.value=n,wt.value=r,Tt.value=e.id;let i=e.name,a=$t.value,o=0,c=0,u=[],d=[],ee=new Set(a.map(([e])=>e)),f=new Set(a.map(([,e])=>e)),p=Array.from(ee).filter(e=>!f.has(e)),m=a.filter(([e])=>p.includes(e)).reduce((e,[t,n,r])=>e+r,0),g={};X.value.nodes.forEach(e=>{g[e.name]=e.color}),a.forEach(([e,t,n])=>{t===i&&(o+=n,u.push({source:e,value:n,color:g[e]})),e===i&&(c+=n,d.push({target:t,value:n,color:g[t]}))});let te=m>0?Math.max(o,c)/m*100:0,_={name:i,inflow:o,outflow:c,from:u,to:d,percentOfTotal:te,color:g[i]||`#000000`};W.value.events.datapointEnter&&W.value.events.datapointEnter({datapoint:_,seriesIndex:t}),cn.value={datapoint:_,config:W.value,seriesIndex:t,series:X.value},pt.value=!0;let v=``,y=q.value.tooltip.customFormat;if(ln.value=!1,l(y))try{let e=y({datapoint:_,series:X.value,config:W.value});typeof e==`string`&&(mt.value=e,ln.value=!0)}catch{console.warn(`Custom format cannot be applied.`)}if(!ln.value){let e=q.value.tooltip.showPercentage?`<div>${s({p:q.value.tooltip.translations.percentOfTotal,v:_.percentOfTotal,s:`%`,r:q.value.tooltip.roundingPercentage})}</div>`:``;v+=`<div style="width:100%;text-align:center;border-bottom:1px solid ${q.value.tooltip.borderColor};padding-bottom:6px;margin-bottom:3px;"><span style="margin-right:4px; color:${_.color}">⏹</span>${_.name}${e}</div>`,_.from.length&&(v+=`<div>${q.value.tooltip.translations.from}</div>`,_.from.forEach(e=>{v+=`<div><span style="color:${e.color}">⏹←</span> ${e.source}: ${h(G.value.formatter,e.value,s({p:G.value.prefix,v:e.value,s:G.value.suffix,r:G.value.rounding}))}</div>`})),_.to.length&&(v+=`<div style="margin-top:6px;">${q.value.tooltip.translations.to}</div>`,_.to.forEach(e=>{v+=`<div><span style="color:${e.color}">⏹→</span> ${e.target}: ${h(G.value.formatter,e.value,s({p:G.value.prefix,v:e.value,s:G.value.suffix,r:G.value.rounding}))}</div>`})),mt.value=v}n===`keyboard`&&Ee(()=>{fn(e.id)})}function mn(e){let t=cn.value;W.value.events.datapointLeave&&W.value.events.datapointLeave({datapoint:t,seriesIndex:e}),!(Dt.value===`keyboard`&&Tt.value)&&(un.value=null,Z.value=null,Q.value=null,pt.value=!1)}function hn(e){let t=cn.value;W.value.events.datapointClick&&W.value.events.datapointClick({datapoint:t,seriesIndex:e})}let gn=w(()=>X.value.links.map(({source:e,target:t,sourceColor:n,targetColor:r,value:i})=>({source:e,target:t,sourceColor:n,targetColor:r,value:i})));function _n(e=null){Ee(()=>{let t=gn.value.map((e,t)=>[[e.source],[e.target],[e.value]]),n=[[q.value.title.text],[q.value.title.subtitle.text],[[W.value.table.columnNames.source],[W.value.table.columnNames.target],[W.value.table.columnNames.value]]].concat(t),r=c(n);e?e(r):v({csvContent:r,title:q.value.title.text||`vue-ui-flow`})})}let vn=w(()=>{let e=[W.value.table.columnNames.source,W.value.table.columnNames.target,W.value.table.columnNames.value],t=gn.value.map((e,t)=>[{color:e.sourceColor,name:e.source,shape:`square`},{color:e.targetColor,name:e.target,shape:`square`},s({p:G.value.prefix,v:e.value,s:G.value.suffix,r:G.value.rounding})]),n={th:{backgroundColor:W.value.table.th.backgroundColor,color:W.value.table.th.color,outline:W.value.table.th.outline},td:{backgroundColor:W.value.table.td.backgroundColor,color:W.value.table.td.color,outline:W.value.table.td.outline},breakpoint:W.value.table.responsiveBreakpoint};return{colNames:[W.value.table.columnNames.source,W.value.table.columnNames.target,W.value.table.columnNames.value],head:e,body:t,config:n}}),yn=w(()=>({headers:vn.value?.colNames??[],rows:vn.value?.body??[]})),bn=w(()=>[...X.value.nodes].map((e,t)=>({...e,index:t,centerX:e.x+Qt.value/2,centerY:m(e.absoluteY)+q.value.padding.top+e.height/2})).sort((e,t)=>e.x===t.x?e.absoluteY-t.absoluteY:e.x-t.x)),$=w(()=>{let e=[];return bn.value.forEach(t=>{let n=e.find(e=>Math.abs(e.x-t.x)<=1);n?n.nodes.push(t):e.push({x:t.x,nodes:[t]})}),e.forEach(e=>{e.nodes.sort((e,t)=>e.absoluteY-t.absoluteY)}),e.sort((e,t)=>e.x-t.x)}),xn=w(()=>{let e=/* @__PURE__ */ new Map;return bn.value.forEach((t,n)=>{e.set(t.id,n)}),e});function Sn(){return X.value}function Cn(){Y.value.showTable=!Y.value.showTable}let wn=P(!1);function Tn(){wn.value=!wn.value}function En(){Y.value.showTooltip=!Y.value.showTooltip}let Dn=w(()=>{let e=new Set(X.value.nodes.map(e=>W.value.nodeCategories[e.name]||`__uncategorized__`));return Array.from(e).map(e=>({name:e,color:W.value.nodeCategoryColors[e]||u[0],shape:`square`,count:X.value.nodes.filter(t=>(W.value.nodeCategories[t.name]||`__uncategorized__`)===e).length})).map((e,t)=>{let n=kn.value.includes(t);return{...e,segregate:()=>An({legend:e,i:t}),isSegregated:n,opacity:kn.value.length?n?1:.5:1,display:`${e.name} (${e.count})`}})}),On=w(()=>Dn.value.filter(e=>e.name!==`__uncategorized__`)),kn=P([]);function An({legend:e,i:t}){let n=e.name;if(Z.value?.every(e=>W.value.nodeCategories[e]===n)){Z.value=null,Q.value=null,kn.value=[];return}kn.value=[t],Z.value=X.value.nodes.filter(e=>W.value.nodeCategories[e.name]===n).map(e=>e.name),Q.value=null}let jn=w(()=>({cy:`flow-legend`,backgroundColor:q.value.legend.backgroundColor,color:q.value.legend.color,fontSize:q.value.legend.fontSize,paddingBottom:q.value.legend.paddingBottom,fontWeight:q.value.legend.bold?`bold`:`normal`})),Mn=_e(H,()=>q.value.title.text),Nn=w(()=>n({config:W,style:q,mutableConfig:Y,dialog:ot,accordion:tt,isFullscreen:U,parent:H,maxWidth:800,isCursorPointer:Mt}));je(()=>Y.value.showTable,e=>t(e,W,xt));function Pn(){Y.value.showTable=!1,St.value&&St.value.setTableIconState(!1)}let Fn=w(()=>On.value.map(e=>({...e,name:e.display}))),In=w(()=>q.value.backgroundColor),Ln=w(()=>q.value.legend),Rn=w(()=>q.value.title),{isCallbackImaging:zn,isCallbackSvg:Bn,generateSvg:Vn,onGenerateImage:Hn}=le({svg:J,title:Rn,legend:Ln,legendItems:Fn,backgroundColor:In,getSvgCallback:()=>W.value.userOptions.callbacks.svg,generateImage:Yt});async function Un(){if(ut(`copyAlt`,{config:W.value,dataset:X.value}),!W.value.userOptions.callbacks.altCopy){console.warn("Vue Data UI - A callback must be set for `altCopy` in userOptions.");return}await Promise.resolve(W.value.userOptions.callbacks.altCopy({config:W.value,dataset:X.value}))}function Wn(e){return $.value.findIndex(t=>t.nodes.some(t=>t.id===e))}function Gn(e,t){let n=$.value[e];return n?n.nodes.findIndex(e=>e.id===t):-1}function Kn(e,t){let n=$.value[e];if(!n||!n.nodes.length)return null;let r=n.nodes[0],i=Math.abs(r.centerY-t);for(let e=1;e<n.nodes.length;e+=1){let a=n.nodes[e],o=Math.abs(a.centerY-t);o<i&&(r=a,i=o)}return r}function qn(){wt.value=null,Tt.value=null,Ot.value=!0}function Jn(){dn(),Ot.value=!1}function Yn(e){if(!J.value||wn.value||document.activeElement!==J.value||!bn.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){dn();return}if(a){if(wt.value===null)return;hn(wt.value);return}if(Tt.value===null){let e=$.value[0]?.nodes?.[0];if(!e)return;let t=xn.value.get(e.id)??0;pn(e,t,`keyboard`,t);return}let s=xn.value.get(Tt.value);if(s===void 0)return;let c=bn.value[s];if(!c)return;let l=Wn(c.id);if(l<0)return;let u=null;if(r||i){let e=Gn(l,c.id);if(e<0)return;let t=$.value[l];if(!t?.nodes?.length)return;let n=e+(i?1:-1);n<0&&(n=t.nodes.length-1),n>=t.nodes.length&&(n=0),u=t.nodes[n]}if(t||n){let e=l+(n?1:-1);e<0&&(e=$.value.length-1),e>=$.value.length&&(e=0),u=Kn(e,c.centerY)}if(!u)return;let d=xn.value.get(u.id);d!==void 0&&pn(u,d,`keyboard`,d)}return de({getData:Sn,getImage:Mn,generateCsv:_n,generateImage:Yt,generateSvg:Vn,generatePdf:Jt,toggleTable:Cn,toggleAnnotator:Tn,toggleTooltip:En,drillCategory:An,unselectNode:mn,toggleFullscreen:At,copyAlt:Un}),(e,t)=>(N(),D(`div`,{ref_key:`flowChart`,ref:H,class:De(`vue-data-ui-component vue-ui-flow ${U.value?`vue-data-ui-wrapper-fullscreen`:``}`),style:M(`font-family:${W.value.style.fontFamily};width:100%; text-align:center;background:${q.value.backgroundColor}`),id:`flow_${V.value}`,onMouseenter:t[2]||=()=>R(Bt)(!0),onMouseleave:t[3]||=()=>{R(Bt)(!1),Ot.value||dn()}},[O(`div`,{id:`chart-instructions-${V.value}`,class:`sr-only`},[O(`p`,null,L(W.value.a11y.translations.keyboardNavigation),1)],8,Pe),yn.value?.rows?.length?(N(),T(me,{key:0,uid:V.value,head:yn.value.headers,body:yn.value.rows,notice:W.value.a11y.translations.tableAvailable,caption:W.value.a11y.translations.tableCaption},null,8,[`uid`,`head`,`body`,`notice`,`caption`])):E(``,!0),W.value.userOptions.buttons.annotator?(N(),T(R(rt),{key:1,svgRef:R(J),backgroundColor:q.value.backgroundColor,color:q.value.color,active:wn.value,palette:W.value.userOptions.annotatorPalette,isCursorPointer:Mt.value,onClose:Tn},Se({_:2},[F(R(i),t=>({name:t,fn:z(n=>[I(e.$slots,t,j(A(R(r)(t,n))),void 0,!0)])}))]),1032,[`svgRef`,`backgroundColor`,`color`,`active`,`palette`,`isCursorPointer`])):E(``,!0),Xt.value?(N(),D(`div`,Fe,null,512)):E(``,!0),q.value.title.text?(N(),D(`div`,{key:3,ref_key:`chartTitle`,ref:gt,style:`width:100%;background:transparent;padding-bottom:24px`},[(N(),T(ue,{key:`title_${ft.value}`,config:{title:{cy:`flow-title`,...q.value.title},subtitle:{cy:`flow-subtitle`,...q.value.title.subtitle}}},null,8,[`config`]))],512)):E(``,!0),O(`div`,{id:`legend-top-${V.value}`},null,8,Ie),W.value.userOptions.show&&kt.value&&(R(Vt)||R(zt))?(N(),T(R(it),{ref_key:`userOptionsRef`,ref:St,key:`user_option_${dt.value}`,backgroundColor:q.value.backgroundColor,color:q.value.color,isPrinting:R(Kt),isImaging:R(qt),uid:V.value,hasPdf:W.value.userOptions.buttons.pdf,hasXls:W.value.userOptions.buttons.csv,hasImg:W.value.userOptions.buttons.img,hasSvg:W.value.userOptions.buttons.svg,hasTable:W.value.userOptions.buttons.table,callbacks:W.value.userOptions.callbacks,hasFullscreen:W.value.userOptions.buttons.fullscreen,hasAltCopy:W.value.userOptions.buttons.altCopy,isFullscreen:U.value,titles:{...W.value.userOptions.buttonTitles},chartElement:H.value,position:W.value.userOptions.position,hasAnnotator:W.value.userOptions.buttons.annotator,printScale:W.value.userOptions.print.scale,isAnnotation:wn.value,hasTooltip:q.value.tooltip.show&&W.value.userOptions.buttons.tooltip,isTooltip:Y.value.showTooltip,tableDialog:W.value.table.useDialog,isCursorPointer:Mt.value,onToggleTooltip:En,onToggleFullscreen:At,onGeneratePdf:R(Jt),onGenerateCsv:_n,onGenerateImage:R(Hn),onGenerateSvg:R(Vn),onToggleTable:Cn,onToggleAnnotator:Tn,onCopyAlt:Un,style:M({visibility:R(Vt)?R(zt)?`visible`:`hidden`:`visible`})},Se({_:2},[F(R(a)(e.$slots,`menuIcon optionTooltip optionPdf optionCsv optionImg optionSvg optionTable optionFullscreen optionAnnotator optionAltCopy custom-menu-before custom-menu-after`),t=>({name:t,fn:z(n=>[I(e.$slots,t,j(A(R(o)(t,n))),void 0,!0)])}))]),1032,/* @__PURE__ */ `backgroundColor.color.isPrinting.isImaging.uid.hasPdf.hasXls.hasImg.hasSvg.hasTable.callbacks.hasFullscreen.hasAltCopy.isFullscreen.titles.chartElement.position.hasAnnotator.printScale.isAnnotation.hasTooltip.isTooltip.tableDialog.isCursorPointer.onGeneratePdf.onGenerateImage.onGenerateSvg.style`.split(`.`))):E(``,!0),O(`div`,Le,[(N(),D(`svg`,{ref_key:`svgRef`,ref:J,xmlns:R(b),"aria-describedby":`chart-instructions-${V.value}`,viewBox:`0 0 ${on.value.width} ${on.value.height}`,class:De({"vue-data-ui-fullscreen--on":U.value,"vue-data-ui-fulscreen--off":!U.value}),style:M({maxWidth:`100%`,overflow:`visible`,background:`transparent`,color:q.value.color}),tabindex:`0`,onFocus:qn,onBlur:Jn,onKeydown:Yn},[we(R(at)),e.$slots[`chart-background`]?(N(),D(`foreignObject`,{key:0,x:0,y:0,width:on.value.width,height:on.value.height,style:{pointerEvents:`none`}},[I(e.$slots,`chart-background`,{},void 0,!0)],8,ze)):E(``,!0),O(`defs`,null,[(N(!0),D(be,null,F(X.value.links,(e,t)=>(N(),D(`linearGradient`,{id:e.id,x1:`0%`,y1:`0%`,x2:`100%`,y2:`0%`},[O(`stop`,{offset:`0%`,"stop-color":e.sourceColor},null,8,Ve),O(`stop`,{offset:`100%`,"stop-color":e.targetColor},null,8,He)],8,Be))),256))]),(N(!0),D(be,null,F(X.value.links,e=>(N(),D(`path`,{class:`vue-ui-flow-link`,d:e.path,"stroke-linejoin":`round`,"stroke-miterlimit":`1`,fill:`url(#${e.id})`,stroke:jt.value.stroke,"stroke-width":jt.value.strokeWidth,style:M(`
2
2
  opacity:${Z.value?Z.value.includes(e.source)&&Z.value.includes(e.target)?1:.3:Q.value?[e.target,e.source].includes(Q.value)?1:.3:jt.value.opacity}
3
3
  `)},null,12,Ue))),256)),(N(!0),D(be,null,F(X.value.nodes,(e,t)=>(N(),D(`rect`,{"data-a11y-node-id":e.id,class:`vue-ui-flow-node`,x:e.x,y:R(m)(e.absoluteY)+q.value.padding.top,height:R(m)(e.height),width:Qt.value,fill:e.color,stroke:K.value.stroke,"stroke-width":K.value.strokeWidth,rx:K.value.borderRadius,style:M({opacity:Z.value?Z.value.includes(e.name)?1:.3:1,outline:un.value!==null&&un.value===e.id?`2px solid currentColor`:void 0}),"aria-label":`${e.name}: ${R(h)(G.value.formatter,e.value,R(s)({p:G.value.prefix,v:e.value,s:G.value.suffix,r:G.value.rounding}))}`,onMouseenter:n=>pn(e,t,`pointer`,xn.value.get(e.id)),onMouseleave:e=>mn(t),onClick:e=>hn(t)},null,44,We))),256)),G.value.show?(N(),D(`g`,Ge,[(N(!0),D(be,null,F(X.value.nodes,(e,t)=>(N(),D(`text`,{x:e.x+Qt.value/2,y:(G.value.showValue?R(m)(e.absoluteY+e.height/2-G.value.fontSize/4):e.absoluteY+e.height/2+G.value.fontSize/3)+q.value.padding.top,"font-size":G.value.fontSize,fill:R(y)(e.color),"text-anchor":`middle`,style:M(`pointer-events: none; opacity:${Z.value?+!!Z.value.includes(e.name):1}`)},L(G.value.abbreviation.use?R(te)({source:e.name,length:K.value.labels.abbreviation.length}):e.name),13,Ke))),256)),G.value.showValue?(N(!0),D(be,{key:0},F(X.value.nodes,(e,t)=>(N(),D(`text`,{x:e.x+Qt.value/2,y:R(m)(e.absoluteY+e.height/2+G.value.fontSize/1.3)+q.value.padding.top,"font-size":G.value.fontSize,fill:R(y)(e.color),"text-anchor":`middle`,style:M(`pointer-events: none; opacity:${Z.value?+!!Z.value.includes(e.name):1}`)},L(R(h)(G.value.formatter,e.value,R(s)({p:G.value.prefix,v:e.value,s:G.value.suffix,r:G.value.rounding}),{datapoint:e,seriesIndex:t})),13,qe))),256)):E(``,!0)])):E(``,!0),I(e.$slots,`svg`,{svg:{...on.value,isPrintingImg:R(Kt)||R(qt)||R(zn),isPrintingSvg:R(Bn)}},void 0,!0)],46,Re)),e.$slots.hint?(N(),D(`div`,Je,[I(e.$slots,`hint`,j(A({hint:W.value.a11y.translations.keyboardNavigation,isVisible:Ot.value})),void 0,!0)])):E(``,!0)]),e.$slots.watermark?(N(),D(`div`,Ye,[I(e.$slots,`watermark`,j(A({isPrinting:R(Kt)||R(qt)||R(zn)||R(Bn)})),void 0,!0)])):E(``,!0),O(`div`,{id:`legend-bottom-${V.value}`},null,8,Xe),bt.value&&(q.value.legend.show||e.$slots.legend)?(N(),T(xe,{key:6,to:q.value.legend.position===`top`?`#legend-top-${V.value}`:`#legend-bottom-${V.value}`},[O(`div`,{ref_key:`chartLegend`,ref:ht},[I(e.$slots,`legend`,{legend:Dn.value},()=>[q.value.legend.show&&On.value.length?(N(),T(ve,{key:0,legendSet:On.value,config:jn.value,isCursorPointer:Mt.value,onClickMarker:t[0]||=e=>An(e)},{item:z(({legend:e,index:t})=>[R(Pt)?E(``,!0):(N(),D(`div`,{key:0,onClick:t=>e.segregate(),style:M(`opacity:${kn.value.length?kn.value.includes(t)?1:.5:1}`)},L(e.display),13,Ze))]),_:1},8,[`legendSet`,`config`,`isCursorPointer`])):E(``,!0)],!0)],512)],8,[`to`])):E(``,!0),e.$slots.source?(N(),D(`div`,{key:7,ref_key:`source`,ref:_t,dir:`auto`},[I(e.$slots,`source`,{},void 0,!0)],512)):E(``,!0),we(R($e),{ref_key:`tooltip`,ref:Ct,teleportTo:q.value.tooltip.teleportTo,show:Y.value.showTooltip&&pt.value,backgroundColor:q.value.tooltip.backgroundColor,color:q.value.tooltip.color,fontSize:q.value.tooltip.fontSize,borderRadius:q.value.tooltip.borderRadius,borderColor:q.value.tooltip.borderColor,borderWidth:q.value.tooltip.borderWidth,backgroundOpacity:q.value.tooltip.backgroundOpacity,position:q.value.tooltip.position,offsetX:q.value.tooltip.offsetX,offsetY:q.value.tooltip.offsetY,parent:H.value,content:mt.value,isCustom:ln.value,isFullscreen:U.value,smooth:q.value.tooltip.smooth,backdropFilter:q.value.tooltip.backdropFilter,smoothForce:q.value.tooltip.smoothForce,smoothSnapThreshold:q.value.tooltip.smoothSnapThreshold,isA11yMode:Dt.value===`keyboard`,a11yPosition:Et.value},{"tooltip-before":z(()=>[I(e.$slots,`tooltip-before`,j(A({...cn.value})),void 0,!0)]),tooltip:z(()=>[I(e.$slots,`tooltip`,j(A({...cn.value})),void 0,!0)]),"tooltip-after":z(()=>[I(e.$slots,`tooltip-after`,j(A({...cn.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`]),kt.value&&W.value.userOptions.buttons.table?(N(),T(ke(Nn.value.component),Te({key:8},Nn.value.props,{ref_key:`tableUnit`,ref:xt,onClose:Pn}),Se({content:z(()=>[we(R(nt),{colNames:vn.value.colNames,head:vn.value.head,body:vn.value.body,config:vn.value.config,title:W.value.table.useDialog?``:Nn.value.title,withCloseButton:!W.value.table.useDialog,isCursorPointer:Mt.value,onClose:Pn},{th:z(({th:e})=>[O(`div`,Qe,L(e),1)]),td:z(({td:e})=>[Ce(L(e.name||e),1)]),_:1},8,[`colNames`,`head`,`body`,`config`,`title`,`withCloseButton`,`isCursorPointer`])]),_:2},[W.value.table.useDialog?{name:`title`,fn:z(()=>[Ce(L(Nn.value.title),1)]),key:`0`}:void 0,W.value.table.useDialog?{name:`actions`,fn:z(()=>[O(`button`,{tabindex:`0`,class:`vue-ui-user-options-button`,onClick:t[1]||=e=>_n(W.value.userOptions.callbacks.csv),style:M({cursor:Mt.value?`pointer`:`default`})},[we(R(et),{name:`fileCsv`,stroke:Nn.value.props.color},null,8,[`stroke`])],4)]),key:`1`}:void 0]),1040)):E(``,!0),I(e.$slots,`skeleton`,{},()=>[R(Pt)?(N(),T(oe,{key:0})):E(``,!0)],!0)],46,Ne))}},[[`__scopeId`,`data-v-5dd9c7a6`]]);export{Me as n,$e as t};
@@ -1 +1 @@
1
- import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{n as t,t as n}from"./tableIntegration-CNoJ1CIY.js";import{n as r,t as i}from"./annotationSlots-BRR85CqJ.js";import{n as a,t as ee}from"./userOptionsSlots-DYuo-E5m.js";import{$ as o,D as te,Ft as ne,S as re,X as ie,at as ae,i as s,nt as oe,r as se,rn as c,t as ce,yt as le,zt as ue}from"./lib-zDxoqrgo.js";import{n as de,t as fe}from"./useHints-BH9r_0Vd.js";import{t as pe}from"./useConfig-CKdzPrcf.js";import{t as me}from"./usePrinter-CnyKPIFM.js";import{t as he}from"./useChartExport-DtPNpc9M.js";import{n as ge}from"./Title-BRAjxtjG.js";import{t as _e}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{l as ve,t as ye}from"./useResponsive-D2CPcpda.js";import{t as be}from"./DefGrad-DKMq1REY.js";import{t as xe}from"./resolveChartConfig-BSo1Oe9n.js";import{t as Se}from"./useUserOptionState-CXlFnwPv.js";import{t as Ce}from"./useChartAccessibility-DOMuYJfm.js";import{t as we}from"./chartImage-NwZO-elv.js";import{t as Te}from"./usePrefersMotion-XLHwega2.js";import{t as Ee}from"./vue_ui_funnel-CaEV5hG7.js";import{Fragment as l,computed as u,createBlock as d,createCommentVNode as f,createElementBlock as p,createElementVNode as m,createSlots as h,createTextVNode as De,createVNode as Oe,defineAsyncComponent as g,guardReactiveProps as ke,mergeProps as _,nextTick as Ae,normalizeClass as v,normalizeProps as je,normalizeStyle as y,onBeforeUnmount as Me,onMounted as Ne,openBlock as b,ref as x,renderList as S,renderSlot as C,resolveDynamicComponent as Pe,shallowRef as Fe,toDisplayString as w,unref as T,useCssVars as Ie,watch as Le,withCtx as E}from"vue";var Re=/* @__PURE__ */ e({default:()=>Ze}),ze=[`id`],Be=[`xmlns`,`viewBox`],Ve=[`width`,`height`],He=[`stroke`,`stroke-width`],Ue=[`stroke`,`stroke-width`],We=[`x`,`y`,`font-size`,`fill`,`font-weight`],Ge=[`points`,`fill`],Ke=[`stroke`,`stroke-width`,`rx`],qe=[`x`,`y`,`font-size`,`fill`,`font-weight`],Je=[`x`,`y`,`font-size`,`fill`,`font-weight`],Ye={key:5,class:`vue-data-ui-watermark`},Xe={style:{display:`flex`,"align-items":`center`}},Ze=/*#__PURE__*/ _e({__name:`vue-ui-funnel`,props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:[`copyAlt`],setup(e,{expose:_e,emit:Re}){Ie(e=>({v6c990ee0:Mt.value}));let Ze=g(()=>import(`./BaseIcon-Cz30ODFA.js`).then(e=>e.n)),Qe=g(()=>import(`./vue-ui-skeleton-B-Acw3CC.js`).then(e=>e.n)),$e=g(()=>import(`./vue-ui-accordion-Dy5OVFKr.js`).then(e=>e.n)),et=g(()=>import(`./DataTable-DSUA5M9p.js`)),tt=g(()=>import(`./UserOptions-D65t74CM.js`).then(e=>e.n)),nt=g(()=>import(`./PenAndPaper-DvJJaeU2.js`).then(e=>e.t)),rt=g(()=>import(`./PackageVersion-D6pKL176.js`).then(e=>e.t)),it=g(()=>import(`./BaseDraggableDialog-T1gEsQid.js`).then(e=>e.n)),{vue_ui_funnel:at}=pe(),D=Te(),O=e,ot=Re,k=x(null),A=x(ie()),st=x(0),ct=x(0),lt=x(0),ut=x(null),dt=x(null),ft=x(null),j=Fe(null),M=Fe(null),N=x(!1),pt=x(null),P=x(null),F=u(()=>!!O.dataset&&O.dataset.length);Ne(gt),Me(()=>{j.value&&(M.value&&j.value.unobserve(M.value),j.value.disconnect())});function mt(){return xe(O.config,at,Ee)}let I=u({get:()=>mt(),set:e=>e}),ht=u(()=>I.value.debug),L=u(()=>I.value.style.chart.bars),R=u(()=>I.value.style.chart.circles),z=u(()=>I.value.style.chart);function gt(){if(ue(O.dataset)?ae({componentName:`VueUiFunnel`,type:`dataset`,debug:ht.value}):O.dataset.forEach((e,t)=>{le({datasetObject:e,requiredAttributes:[`name`,`value`]}).forEach(e=>{F.value=!1,ae({componentName:`VueUiFunnel`,type:`datasetSerieAttribute`,property:e,index:t,debug:ht.value})})}),I.value.responsive){let e=ve(()=>{let{width:e,height:t}=ye({chart:k.value,title:z.value.title.text?ft.value:null,source:dt.value,noTitle:ut.value});requestAnimationFrame(()=>{H.value.height=t,H.value.width=e,W.value=Dt(),I.value.responsiveProportionalSizing?(V.value.circles=c({relator:Math.min(e,t),adjuster:600,source:R.value.dataLabels.fontSize,threshold:10,fallback:10}),V.value.names=c({relator:Math.min(e,t),adjuster:600,source:L.value.dataLabels.name.fontSize,threshold:10,fallback:10}),V.value.values=c({relator:Math.min(e,t),adjuster:600,source:L.value.dataLabels.value.fontSize,threshold:10,fallback:10})):(V.value.circles=R.value.dataLabels.fontSize,V.value.names=L.value.dataLabels.name.fontSize,V.value.values=L.value.dataLabels.value.fontSize)})});j.value&&(M.value&&j.value.unobserve(M.value),j.value.disconnect()),j.value=new ResizeObserver(e),M.value=k.value.parentNode,j.value.observe(M.value)}}de({config:()=>I.value,dataset:()=>O.dataset,component:`VueUiFunnel`,rules:[fe.emptyArray,{test:e=>e.length>10,message:[`👀 The dataset has a length > 10. Consider:`,``,`▶️ Aggregating some datapoints into broader categories`]}]});let _t=u(()=>I.value.userOptions.useCursorPointer),{userOptionsVisible:vt,setUserOptionsVisibility:yt,keepUserOptionState:bt}=Se({config:I.value}),{svgRef:xt}=Ce({config:z.value.title});Le(()=>O.config,e=>{I.value=mt(),vt.value=!I.value.userOptions.showOnChartHover,gt(),ct.value+=1,lt.value+=1,V.value.circles=R.value.dataLabels.fontSize,V.value.names=L.value.dataLabels.name.fontSize,V.value.values=L.value.dataLabels.value.fontSize,B.value.showTable=I.value.table.show},{deep:!0});let{isPrinting:St,isImaging:Ct,generatePdf:wt,generateImage:Tt}=me({elementId:`funnel_${A.value}`,fileName:z.value.title.text||`vue-ui-funnel`,options:I.value.userOptions.print}),Et=u(()=>I.value.userOptions.show&&!z.value.title.text),B=x({showTable:I.value.table.show}),V=x({circles:R.value.dataLabels.fontSize,names:L.value.dataLabels.name.fontSize,values:L.value.dataLabels.value.fontSize}),H=u({get:()=>({height:z.value.height,width:z.value.width}),set:e=>e}),U=u(()=>F.value?O.dataset.map((e,t)=>({...e,color:e.color?re(e.color):ne(L.value.defaultColor,t/O.dataset.length)})):[]);setTimeout(()=>{N.value=!0},U.value.length*150);function Dt(){let e=z.value.padding.left,t=z.value.padding.top;return{left:e,top:t,right:H.value.width-z.value.padding.right,bottom:H.value.height-z.value.padding.bottom,width:H.value.width-e-z.value.padding.right,height:H.value.height-t-z.value.padding.bottom}}let W=x(Dt()),G=u(()=>W.value.height/O.dataset.length),K=u(()=>G.value*L.value.gapRatio),Ot=u(()=>W.value.width*z.value.barCircleSpacingRatio),q=u(()=>U.value.map((e,t)=>{let n=G.value-K.value,r=W.value.top+K.value/2*t+(G.value-K.value/2)*t+K.value/2,i=e.value/U.value[0].value,a=(W.value.width-n-Ot.value)*(e.value/U.value[0].value);return{...e,cx:W.value.left+n/2,cy:r+n/2,datapointIndex:t,fill:e.color,height:Math.max(n,0),proportion:i,r:Math.max(n/2,0),width:Math.max(a,0),x:W.value.left+n+Ot.value,y:r}})),kt=u(()=>{let e=q.value.map(e=>`${e.x+e.width},${e.y+(G.value-K.value)/2}`);return`${q.value[0].x},${q.value[0].y+(G.value-K.value)/2} ${e.toString()} ${q.value.at(-1).x},${q.value.at(-1).y+(G.value-K.value)/2}`}),At=u(()=>({x1:q.value[0].cx,y1:q.value[0].cy,x2:q.value.at(-1).cx,y2:q.value.at(-1).cy})),J=x(!1);function jt(e){J.value=e,st.value+=1}let Mt=u(()=>`${U.value.length*150}ms`),Y=x(!1);function Nt(){Y.value=!Y.value}function Pt(){B.value.showTable=!B.value.showTable}let X=u(()=>({head:U.value.map(e=>({name:e.name,color:e.color})),body:U.value.map(e=>e.value)})),Z=u(()=>{let e=[I.value.table.columnNames.series,I.value.table.columnNames.value,I.value.table.columnNames.percentage],t=X.value.head.map((e,t)=>{let n=s(L.value.dataLabels.value.formatter,X.value.body[t],o({p:L.value.dataLabels.value.prefix,v:X.value.body[t],s:L.value.dataLabels.value.suffix,r:I.value.table.td.roundingValue}),{datapoint:q.value[t]}),r=s(R.value.dataLabels.formatter,q.value[t].proportion*100,o({v:q.value[t].proportion*100,s:`%`,r:I.value.table.td.roundingPercentage}),{datapoint:q.value[t]});return[{color:e.color,name:e.name},n,r]}),n={th:{backgroundColor:I.value.table.th.backgroundColor,color:I.value.table.th.color,outline:I.value.table.th.outline},td:{backgroundColor:I.value.table.td.backgroundColor,color:I.value.table.td.color,outline:I.value.table.td.outline},breakpoint:I.value.table.responsiveBreakpoint};return{colNames:[I.value.table.columnNames.series,I.value.table.columnNames.value,I.value.table.columnNames.percentage],head:e,body:t,config:n}});function Q(e=null){Ae(()=>{let t=X.value.head.map((e,t)=>[[e.name],[X.value.body[t]],[q.value[t].proportion*100]]),n=[[z.value.title.text],[z.value.title.subtitle.text],[[I.value.table.columnNames.series],[I.value.table.columnNames.value],[`%`]]].concat(t),r=te(n);e?e(r):oe({csvContent:r,title:z.value.title.text||`vue-ui-funnel`})})}function Ft(){return U.value}let It=we(k,()=>z.value.title.text),$=u(()=>n({config:I,style:z,mutableConfig:B,dialog:it,accordion:$e,isFullscreen:J,parent:k,maxWidth:800}));Le(()=>B.value.showTable,e=>t(e,I,pt));function Lt(){B.value.showTable=!1,P.value&&P.value.setTableIconState(!1)}let Rt=u(()=>z.value.backgroundColor),zt=u(()=>z.value.title),{isCallbackImaging:Bt,isCallbackSvg:Vt,generateSvg:Ht,onGenerateImage:Ut}=he({svg:xt,title:zt,legend:null,legendItems:null,backgroundColor:Rt,getSvgCallback:()=>I.value.userOptions.callbacks.svg,generateImage:Tt});async function Wt(){if(ot(`copyAlt`,{config:I.value,dataset:U.value}),!I.value.userOptions.callbacks.altCopy){console.warn("Vue Data UI - A callback must be set for `altCopy` in userOptions.");return}await Promise.resolve(I.value.userOptions.callbacks.altCopy({config:I.value,dataset:U.value}))}return _e({getData:Ft,getImage:It,generatePdf:wt,generateCsv:Q,generateImage:Tt,generateSvg:Ht,toggleTable:Pt,toggleAnnotator:Nt,toggleFullscreen:jt,copyAlt:Wt}),(e,t)=>(b(),p(`div`,{ref_key:`funnelChart`,ref:k,class:v(`vue-data-ui-component vue-ui-funnel ${J.value?`vue-data-ui-wrapper-fullscreen`:``} ${I.value.useCssAnimation?``:`vue-ui-dna`}`),style:y(`font-family:${I.value.style.fontFamily};width:100%; ${I.value.responsive?`height:100%;`:``} text-align:center;background:${z.value.backgroundColor}`),id:`funnel_${A.value}`,onMouseenter:t[1]||=()=>T(yt)(!0),onMouseleave:t[2]||=()=>T(yt)(!1)},[I.value.userOptions.buttons.annotator?(b(),d(T(nt),{key:0,svgRef:T(xt),backgroundColor:z.value.backgroundColor,color:z.value.color,active:Y.value,isCursorPointer:_t.value,palette:I.value.userOptions.annotatorPalette,onClose:Nt},h({_:2},[S(T(i),t=>({name:t,fn:E(n=>[C(e.$slots,t,je(ke(T(r)(t,n))),void 0,!0)])}))]),1032,[`svgRef`,`backgroundColor`,`color`,`active`,`isCursorPointer`,`palette`])):f(``,!0),Et.value?(b(),p(`div`,{key:1,ref_key:`noTitle`,ref:ut,class:`vue-data-ui-no-title-space`,style:`height:36px; width: 100%;background:transparent`},null,512)):f(``,!0),z.value.title.text?(b(),p(`div`,{key:2,ref_key:`chartTitle`,ref:ft,style:`width:100%;background:transparent;padding-bottom:24px`},[(b(),d(ge,{key:`title_${ct.value}`,config:{title:{cy:`funnel-div-title`,...z.value.title},subtitle:{cy:`funnel-div-subtitle`,...z.value.title.subtitle}}},null,8,[`config`]))],512)):f(``,!0),I.value.userOptions.show&&F.value&&(T(bt)||T(vt))?(b(),d(T(tt),{ref_key:`userOptionsRef`,ref:P,key:`user_option_${st.value}`,backgroundColor:z.value.backgroundColor,color:z.value.color,isPrinting:T(St),isImaging:T(Ct),uid:A.value,hasTooltip:!1,hasPdf:I.value.userOptions.buttons.pdf,hasImg:I.value.userOptions.buttons.img,hasSvg:I.value.userOptions.buttons.svg,hasXls:I.value.userOptions.buttons.csv,hasTable:I.value.userOptions.buttons.table,hasLabel:!1,hasFullscreen:I.value.userOptions.buttons.fullscreen,hasAltCopy:I.value.userOptions.buttons.altCopy,isFullscreen:J.value,chartElement:k.value,position:I.value.userOptions.position,titles:{...I.value.userOptions.buttonTitles},hasAnnotator:I.value.userOptions.buttons.annotator,isAnnotation:Y.value,callbacks:I.value.userOptions.callbacks,printScale:I.value.userOptions.print.scale,tableDialog:I.value.table.useDialog,isCursorPointer:_t.value,onToggleAnnotator:Nt,onToggleFullscreen:jt,onGeneratePdf:T(wt),onGenerateImage:T(Ut),onGenerateSvg:T(Ht),onToggleTable:Pt,onGenerateCsv:Q,onCopyAlt:Wt,style:y({visibility:T(bt)?T(vt)?`visible`:`hidden`:`visible`})},h({_:2},[S(T(a)(e.$slots,`menuIcon optionPdf optionCsv optionImg optionSvg optionTable optionFullscreen optionAnnotator optionAltCopy custom-menu-before custom-menu-after`),t=>({name:t,fn:E(n=>[C(e.$slots,t,je(ke(T(ee)(t,n))),void 0,!0)])}))]),1032,/* @__PURE__ */ `backgroundColor.color.isPrinting.isImaging.uid.hasPdf.hasImg.hasSvg.hasXls.hasTable.hasFullscreen.hasAltCopy.isFullscreen.chartElement.position.titles.hasAnnotator.isAnnotation.callbacks.printScale.tableDialog.isCursorPointer.onGeneratePdf.onGenerateImage.onGenerateSvg.style`.split(`.`))):f(``,!0),F.value?(b(),p(`svg`,{key:4,ref_key:`svgRef`,ref:xt,xmlns:T(ce),class:v({"vue-data-ui-fullscreen--on":J.value,"vue-data-ui-fulscreen--off":!J.value}),viewBox:`0 0 ${H.value.width<=0?10:H.value.width} ${H.value.height<=0?10:H.value.height}`,style:y(`max-width:100%; overflow: visible; background:transparent;color:${z.value.color}`)},[Oe(T(rt)),e.$slots[`chart-background`]?(b(),p(`foreignObject`,{key:0,x:0,y:0,width:H.value.width<=0?10:H.value.width,height:H.value.height<=0?10:H.value.height,style:{pointerEvents:`none`}},[C(e.$slots,`chart-background`,{},void 0,!0)],8,Ve)):f(``,!0),m(`defs`,null,[Oe(be,{t:`linear`,id:`funnel_area_${A.value}`,x1:`0%`,x2:`100%`,y1:`0%`,y2:`0%`,stops:[[`0%`,z.value.backgroundColor,0],[`20%`,z.value.area.color,1],[`100%`,z.value.area.color,1]]},null,8,[`id`,`stops`])]),z.value.circleLinks.show?(b(),p(`line`,_({key:1},At.value,{stroke:z.value.circleLinks.color,"stroke-width":12*z.value.circleLinks.widthRatio,"stroke-linecap":`round`,class:{animated:I.value.useCssAnimation&&!T(D)},style:{strokeDasharray:I.value.useCssAnimation&&!T(D)?W.value.height:0,strokeDashoffset:I.value.useCssAnimation&&!T(D)?W.value.height:0}}),null,16,He)):f(``,!0),(b(!0),p(l,null,S(q.value,({cx:e,cy:t,r:n,fill:r},i)=>(b(),p(`circle`,_({ref_for:!0},{cx:e,cy:t,r:n,fill:r},{stroke:R.value.stroke,"stroke-width":R.value.strokeWidth,class:{animated:I.value.useCssAnimation&&!N.value&&!T(D)},style:{animationDelay:`${150*i}ms`}}),null,16,Ue))),256)),(b(!0),p(l,null,S(q.value,(e,t)=>(b(),p(`text`,{x:e.cx,y:e.cy+V.value.circles/3+R.value.dataLabels.offsetY,"text-anchor":`middle`,"font-size":V.value.circles,fill:R.value.dataLabels.adaptColorToBackground?T(se)(e.color):R.value.dataLabels.color,"font-weight":R.value.dataLabels.bold?`bold`:`normal`,class:v({animated:I.value.useCssAnimation&&!N.value&&!T(D)}),style:y({animationDelay:`${150*t}ms`})},w(T(s)(R.value.dataLabels.formatter,e.proportion*100,T(o)({v:e.proportion*100,s:`%`,r:R.value.dataLabels.rounding}),{datapoint:e})),15,We))),256)),z.value.area.show?(b(),p(`polygon`,{key:2,points:kt.value,fill:`url(#funnel_area_${A.value})`,class:v({animated:I.value.useCssAnimation&&!N.value&&!T(D)}),style:y({transition:I.value.useCssAnimation?`all ${150*U.value.length}ms ease-in`:`none`})},null,14,Ge)):f(``,!0),(b(!0),p(l,null,S(q.value,({x:e,y:t,height:n,width:r,fill:i},a)=>(b(),p(`rect`,_({ref_for:!0},{x:e,y:t,height:n,width:r,fill:i},{stroke:L.value.stroke,"stroke-width":L.value.strokeWidth,rx:L.value.borderRadius,class:{animated:I.value.useCssAnimation&&!N.value&&!T(D)},style:{animationDelay:`${150*a}ms`}}),null,16,Ke))),256)),(b(!0),p(l,null,S(q.value,(e,t)=>(b(),p(`g`,null,[m(`text`,{x:e.x+e.width+L.value.dataLabels.name.offsetX+12,y:e.cy-V.value.names/2+L.value.dataLabels.name.offsetY,"text-anchor":`start`,"font-size":V.value.names,fill:L.value.dataLabels.name.color,"font-weight":L.value.dataLabels.name.bold?`bold`:`normal`,class:v({animated:I.value.useCssAnimation&&!N.value&&!T(D)}),style:y({animationDelay:`${150*t}ms`})},w(e.name),15,qe),m(`text`,{x:e.x+e.width+L.value.dataLabels.value.offsetX+12,y:e.cy+V.value.values+L.value.dataLabels.value.offsetY,"text-anchor":`start`,"font-size":V.value.values,fill:L.value.dataLabels.value.color,"font-weight":L.value.dataLabels.value.bold?`bold`:`normal`,class:v({animated:I.value.useCssAnimation&&!N.value&&!T(D)}),style:y({animationDelay:`${150*t}ms`})},w(T(s)(L.value.dataLabels.value.formatter,e.value,T(o)({p:L.value.dataLabels.value.prefix,v:e.value,s:L.value.dataLabels.value.suffix,r:L.value.dataLabels.value.rounding}),{datapoint:e})),15,Je)]))),256)),C(e.$slots,`svg`,{svg:{...H.value,isPrintingImg:T(St)||T(Ct)||T(Bt),isPrintingSvg:T(Vt)}},void 0,!0)],14,Be)):f(``,!0),e.$slots.watermark?(b(),p(`div`,Ye,[C(e.$slots,`watermark`,je(ke({isPrinting:T(St)||T(Ct)||T(Bt)||T(Vt)})),void 0,!0)])):f(``,!0),F.value?f(``,!0):(b(),d(T(Qe),{key:6,config:{type:`verticalBar`,style:{backgroundColor:z.value.backgroundColor,verticalBar:{axis:{color:`#CCCCCC`},color:`#CCCCCC`}}}},null,8,[`config`])),e.$slots.source?(b(),p(`div`,{key:7,ref_key:`source`,ref:dt,dir:`auto`},[C(e.$slots,`source`,{},void 0,!0)],512)):f(``,!0),F.value&&I.value.userOptions.buttons.table?(b(),d(Pe($.value.component),_({key:8},$.value.props,{ref_key:`tableUnit`,ref:pt,onClose:Lt}),h({content:E(()=>[(b(),d(T(et),{key:`table_${lt.value}`,colNames:Z.value.colNames,head:Z.value.head,body:Z.value.body,config:Z.value.config,title:I.value.table.useDialog?``:$.value.title,withCloseButton:!I.value.table.useDialog,onClose:Lt},{th:E(({th:e})=>[m(`div`,Xe,w(e),1)]),td:E(({td:e})=>[De(w(e.name?e.name:e),1)]),_:1},8,[`colNames`,`head`,`body`,`config`,`title`,`withCloseButton`]))]),_:2},[I.value.table.useDialog?{name:`title`,fn:E(()=>[De(w($.value.title),1)]),key:`0`}:void 0,I.value.table.useDialog?{name:`actions`,fn:E(()=>[m(`button`,{tabindex:`0`,class:`vue-ui-user-options-button`,onClick:t[0]||=e=>Q(I.value.userOptions.callbacks.csv)},[Oe(T(Ze),{name:`fileCsv`,stroke:$.value.props.color},null,8,[`stroke`])])]),key:`1`}:void 0]),1040)):f(``,!0)],46,ze))}},[[`__scopeId`,`data-v-efc62c19`]]);export{Re as n,Ze as t};
1
+ import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{n as t,t as n}from"./tableIntegration-CNoJ1CIY.js";import{n as r,t as i}from"./annotationSlots-BRR85CqJ.js";import{n as a,t as ee}from"./userOptionsSlots-DYuo-E5m.js";import{$ as o,D as te,Ft as ne,S as re,X as ie,at as ae,i as s,nt as oe,r as se,rn as c,t as ce,yt as le,zt as ue}from"./lib-CV_IANZ6.js";import{n as de,t as fe}from"./useHints-BH9r_0Vd.js";import{t as pe}from"./useConfig-CKdzPrcf.js";import{t as me}from"./usePrinter-hLW3cv4N.js";import{t as he}from"./useChartExport-DtPNpc9M.js";import{n as ge}from"./Title-BGYFqulv.js";import{t as _e}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{l as ve,t as ye}from"./useResponsive-D2CPcpda.js";import{t as be}from"./DefGrad-DKMq1REY.js";import{t as xe}from"./resolveChartConfig-DZg-korK.js";import{t as Se}from"./useUserOptionState-CXlFnwPv.js";import{t as Ce}from"./useChartAccessibility-DOMuYJfm.js";import{t as we}from"./chartImage-CIvU_04o.js";import{t as Te}from"./usePrefersMotion-XLHwega2.js";import{t as Ee}from"./vue_ui_funnel-CaEV5hG7.js";import{Fragment as l,computed as u,createBlock as d,createCommentVNode as f,createElementBlock as p,createElementVNode as m,createSlots as h,createTextVNode as De,createVNode as Oe,defineAsyncComponent as g,guardReactiveProps as ke,mergeProps as _,nextTick as Ae,normalizeClass as v,normalizeProps as je,normalizeStyle as y,onBeforeUnmount as Me,onMounted as Ne,openBlock as b,ref as x,renderList as S,renderSlot as C,resolveDynamicComponent as Pe,shallowRef as Fe,toDisplayString as w,unref as T,useCssVars as Ie,watch as Le,withCtx as E}from"vue";var Re=/* @__PURE__ */ e({default:()=>Ze}),ze=[`id`],Be=[`xmlns`,`viewBox`],Ve=[`width`,`height`],He=[`stroke`,`stroke-width`],Ue=[`stroke`,`stroke-width`],We=[`x`,`y`,`font-size`,`fill`,`font-weight`],Ge=[`points`,`fill`],Ke=[`stroke`,`stroke-width`,`rx`],qe=[`x`,`y`,`font-size`,`fill`,`font-weight`],Je=[`x`,`y`,`font-size`,`fill`,`font-weight`],Ye={key:5,class:`vue-data-ui-watermark`},Xe={style:{display:`flex`,"align-items":`center`}},Ze=/*#__PURE__*/ _e({__name:`vue-ui-funnel`,props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:[`copyAlt`],setup(e,{expose:_e,emit:Re}){Ie(e=>({v6c990ee0:Mt.value}));let Ze=g(()=>import(`./BaseIcon-DdIyewwY.js`).then(e=>e.n)),Qe=g(()=>import(`./vue-ui-skeleton-DI7pcimU.js`).then(e=>e.n)),$e=g(()=>import(`./vue-ui-accordion-BNvevckx.js`).then(e=>e.n)),et=g(()=>import(`./DataTable-WNecJMcY.js`)),tt=g(()=>import(`./UserOptions-DTxMeZv3.js`).then(e=>e.n)),nt=g(()=>import(`./PenAndPaper-IMw576MC.js`).then(e=>e.t)),rt=g(()=>import(`./PackageVersion-CdkxOy58.js`).then(e=>e.t)),it=g(()=>import(`./BaseDraggableDialog-D_tuHEjO.js`).then(e=>e.n)),{vue_ui_funnel:at}=pe(),D=Te(),O=e,ot=Re,k=x(null),A=x(ie()),st=x(0),ct=x(0),lt=x(0),ut=x(null),dt=x(null),ft=x(null),j=Fe(null),M=Fe(null),N=x(!1),pt=x(null),P=x(null),F=u(()=>!!O.dataset&&O.dataset.length);Ne(gt),Me(()=>{j.value&&(M.value&&j.value.unobserve(M.value),j.value.disconnect())});function mt(){return xe(O.config,at,Ee)}let I=u({get:()=>mt(),set:e=>e}),ht=u(()=>I.value.debug),L=u(()=>I.value.style.chart.bars),R=u(()=>I.value.style.chart.circles),z=u(()=>I.value.style.chart);function gt(){if(ue(O.dataset)?ae({componentName:`VueUiFunnel`,type:`dataset`,debug:ht.value}):O.dataset.forEach((e,t)=>{le({datasetObject:e,requiredAttributes:[`name`,`value`]}).forEach(e=>{F.value=!1,ae({componentName:`VueUiFunnel`,type:`datasetSerieAttribute`,property:e,index:t,debug:ht.value})})}),I.value.responsive){let e=ve(()=>{let{width:e,height:t}=ye({chart:k.value,title:z.value.title.text?ft.value:null,source:dt.value,noTitle:ut.value});requestAnimationFrame(()=>{H.value.height=t,H.value.width=e,W.value=Dt(),I.value.responsiveProportionalSizing?(V.value.circles=c({relator:Math.min(e,t),adjuster:600,source:R.value.dataLabels.fontSize,threshold:10,fallback:10}),V.value.names=c({relator:Math.min(e,t),adjuster:600,source:L.value.dataLabels.name.fontSize,threshold:10,fallback:10}),V.value.values=c({relator:Math.min(e,t),adjuster:600,source:L.value.dataLabels.value.fontSize,threshold:10,fallback:10})):(V.value.circles=R.value.dataLabels.fontSize,V.value.names=L.value.dataLabels.name.fontSize,V.value.values=L.value.dataLabels.value.fontSize)})});j.value&&(M.value&&j.value.unobserve(M.value),j.value.disconnect()),j.value=new ResizeObserver(e),M.value=k.value.parentNode,j.value.observe(M.value)}}de({config:()=>I.value,dataset:()=>O.dataset,component:`VueUiFunnel`,rules:[fe.emptyArray,{test:e=>e.length>10,message:[`👀 The dataset has a length > 10. Consider:`,``,`▶️ Aggregating some datapoints into broader categories`]}]});let _t=u(()=>I.value.userOptions.useCursorPointer),{userOptionsVisible:vt,setUserOptionsVisibility:yt,keepUserOptionState:bt}=Se({config:I.value}),{svgRef:xt}=Ce({config:z.value.title});Le(()=>O.config,e=>{I.value=mt(),vt.value=!I.value.userOptions.showOnChartHover,gt(),ct.value+=1,lt.value+=1,V.value.circles=R.value.dataLabels.fontSize,V.value.names=L.value.dataLabels.name.fontSize,V.value.values=L.value.dataLabels.value.fontSize,B.value.showTable=I.value.table.show},{deep:!0});let{isPrinting:St,isImaging:Ct,generatePdf:wt,generateImage:Tt}=me({elementId:`funnel_${A.value}`,fileName:z.value.title.text||`vue-ui-funnel`,options:I.value.userOptions.print}),Et=u(()=>I.value.userOptions.show&&!z.value.title.text),B=x({showTable:I.value.table.show}),V=x({circles:R.value.dataLabels.fontSize,names:L.value.dataLabels.name.fontSize,values:L.value.dataLabels.value.fontSize}),H=u({get:()=>({height:z.value.height,width:z.value.width}),set:e=>e}),U=u(()=>F.value?O.dataset.map((e,t)=>({...e,color:e.color?re(e.color):ne(L.value.defaultColor,t/O.dataset.length)})):[]);setTimeout(()=>{N.value=!0},U.value.length*150);function Dt(){let e=z.value.padding.left,t=z.value.padding.top;return{left:e,top:t,right:H.value.width-z.value.padding.right,bottom:H.value.height-z.value.padding.bottom,width:H.value.width-e-z.value.padding.right,height:H.value.height-t-z.value.padding.bottom}}let W=x(Dt()),G=u(()=>W.value.height/O.dataset.length),K=u(()=>G.value*L.value.gapRatio),Ot=u(()=>W.value.width*z.value.barCircleSpacingRatio),q=u(()=>U.value.map((e,t)=>{let n=G.value-K.value,r=W.value.top+K.value/2*t+(G.value-K.value/2)*t+K.value/2,i=e.value/U.value[0].value,a=(W.value.width-n-Ot.value)*(e.value/U.value[0].value);return{...e,cx:W.value.left+n/2,cy:r+n/2,datapointIndex:t,fill:e.color,height:Math.max(n,0),proportion:i,r:Math.max(n/2,0),width:Math.max(a,0),x:W.value.left+n+Ot.value,y:r}})),kt=u(()=>{let e=q.value.map(e=>`${e.x+e.width},${e.y+(G.value-K.value)/2}`);return`${q.value[0].x},${q.value[0].y+(G.value-K.value)/2} ${e.toString()} ${q.value.at(-1).x},${q.value.at(-1).y+(G.value-K.value)/2}`}),At=u(()=>({x1:q.value[0].cx,y1:q.value[0].cy,x2:q.value.at(-1).cx,y2:q.value.at(-1).cy})),J=x(!1);function jt(e){J.value=e,st.value+=1}let Mt=u(()=>`${U.value.length*150}ms`),Y=x(!1);function Nt(){Y.value=!Y.value}function Pt(){B.value.showTable=!B.value.showTable}let X=u(()=>({head:U.value.map(e=>({name:e.name,color:e.color})),body:U.value.map(e=>e.value)})),Z=u(()=>{let e=[I.value.table.columnNames.series,I.value.table.columnNames.value,I.value.table.columnNames.percentage],t=X.value.head.map((e,t)=>{let n=s(L.value.dataLabels.value.formatter,X.value.body[t],o({p:L.value.dataLabels.value.prefix,v:X.value.body[t],s:L.value.dataLabels.value.suffix,r:I.value.table.td.roundingValue}),{datapoint:q.value[t]}),r=s(R.value.dataLabels.formatter,q.value[t].proportion*100,o({v:q.value[t].proportion*100,s:`%`,r:I.value.table.td.roundingPercentage}),{datapoint:q.value[t]});return[{color:e.color,name:e.name},n,r]}),n={th:{backgroundColor:I.value.table.th.backgroundColor,color:I.value.table.th.color,outline:I.value.table.th.outline},td:{backgroundColor:I.value.table.td.backgroundColor,color:I.value.table.td.color,outline:I.value.table.td.outline},breakpoint:I.value.table.responsiveBreakpoint};return{colNames:[I.value.table.columnNames.series,I.value.table.columnNames.value,I.value.table.columnNames.percentage],head:e,body:t,config:n}});function Q(e=null){Ae(()=>{let t=X.value.head.map((e,t)=>[[e.name],[X.value.body[t]],[q.value[t].proportion*100]]),n=[[z.value.title.text],[z.value.title.subtitle.text],[[I.value.table.columnNames.series],[I.value.table.columnNames.value],[`%`]]].concat(t),r=te(n);e?e(r):oe({csvContent:r,title:z.value.title.text||`vue-ui-funnel`})})}function Ft(){return U.value}let It=we(k,()=>z.value.title.text),$=u(()=>n({config:I,style:z,mutableConfig:B,dialog:it,accordion:$e,isFullscreen:J,parent:k,maxWidth:800}));Le(()=>B.value.showTable,e=>t(e,I,pt));function Lt(){B.value.showTable=!1,P.value&&P.value.setTableIconState(!1)}let Rt=u(()=>z.value.backgroundColor),zt=u(()=>z.value.title),{isCallbackImaging:Bt,isCallbackSvg:Vt,generateSvg:Ht,onGenerateImage:Ut}=he({svg:xt,title:zt,legend:null,legendItems:null,backgroundColor:Rt,getSvgCallback:()=>I.value.userOptions.callbacks.svg,generateImage:Tt});async function Wt(){if(ot(`copyAlt`,{config:I.value,dataset:U.value}),!I.value.userOptions.callbacks.altCopy){console.warn("Vue Data UI - A callback must be set for `altCopy` in userOptions.");return}await Promise.resolve(I.value.userOptions.callbacks.altCopy({config:I.value,dataset:U.value}))}return _e({getData:Ft,getImage:It,generatePdf:wt,generateCsv:Q,generateImage:Tt,generateSvg:Ht,toggleTable:Pt,toggleAnnotator:Nt,toggleFullscreen:jt,copyAlt:Wt}),(e,t)=>(b(),p(`div`,{ref_key:`funnelChart`,ref:k,class:v(`vue-data-ui-component vue-ui-funnel ${J.value?`vue-data-ui-wrapper-fullscreen`:``} ${I.value.useCssAnimation?``:`vue-ui-dna`}`),style:y(`font-family:${I.value.style.fontFamily};width:100%; ${I.value.responsive?`height:100%;`:``} text-align:center;background:${z.value.backgroundColor}`),id:`funnel_${A.value}`,onMouseenter:t[1]||=()=>T(yt)(!0),onMouseleave:t[2]||=()=>T(yt)(!1)},[I.value.userOptions.buttons.annotator?(b(),d(T(nt),{key:0,svgRef:T(xt),backgroundColor:z.value.backgroundColor,color:z.value.color,active:Y.value,isCursorPointer:_t.value,palette:I.value.userOptions.annotatorPalette,onClose:Nt},h({_:2},[S(T(i),t=>({name:t,fn:E(n=>[C(e.$slots,t,je(ke(T(r)(t,n))),void 0,!0)])}))]),1032,[`svgRef`,`backgroundColor`,`color`,`active`,`isCursorPointer`,`palette`])):f(``,!0),Et.value?(b(),p(`div`,{key:1,ref_key:`noTitle`,ref:ut,class:`vue-data-ui-no-title-space`,style:`height:36px; width: 100%;background:transparent`},null,512)):f(``,!0),z.value.title.text?(b(),p(`div`,{key:2,ref_key:`chartTitle`,ref:ft,style:`width:100%;background:transparent;padding-bottom:24px`},[(b(),d(ge,{key:`title_${ct.value}`,config:{title:{cy:`funnel-div-title`,...z.value.title},subtitle:{cy:`funnel-div-subtitle`,...z.value.title.subtitle}}},null,8,[`config`]))],512)):f(``,!0),I.value.userOptions.show&&F.value&&(T(bt)||T(vt))?(b(),d(T(tt),{ref_key:`userOptionsRef`,ref:P,key:`user_option_${st.value}`,backgroundColor:z.value.backgroundColor,color:z.value.color,isPrinting:T(St),isImaging:T(Ct),uid:A.value,hasTooltip:!1,hasPdf:I.value.userOptions.buttons.pdf,hasImg:I.value.userOptions.buttons.img,hasSvg:I.value.userOptions.buttons.svg,hasXls:I.value.userOptions.buttons.csv,hasTable:I.value.userOptions.buttons.table,hasLabel:!1,hasFullscreen:I.value.userOptions.buttons.fullscreen,hasAltCopy:I.value.userOptions.buttons.altCopy,isFullscreen:J.value,chartElement:k.value,position:I.value.userOptions.position,titles:{...I.value.userOptions.buttonTitles},hasAnnotator:I.value.userOptions.buttons.annotator,isAnnotation:Y.value,callbacks:I.value.userOptions.callbacks,printScale:I.value.userOptions.print.scale,tableDialog:I.value.table.useDialog,isCursorPointer:_t.value,onToggleAnnotator:Nt,onToggleFullscreen:jt,onGeneratePdf:T(wt),onGenerateImage:T(Ut),onGenerateSvg:T(Ht),onToggleTable:Pt,onGenerateCsv:Q,onCopyAlt:Wt,style:y({visibility:T(bt)?T(vt)?`visible`:`hidden`:`visible`})},h({_:2},[S(T(a)(e.$slots,`menuIcon optionPdf optionCsv optionImg optionSvg optionTable optionFullscreen optionAnnotator optionAltCopy custom-menu-before custom-menu-after`),t=>({name:t,fn:E(n=>[C(e.$slots,t,je(ke(T(ee)(t,n))),void 0,!0)])}))]),1032,/* @__PURE__ */ `backgroundColor.color.isPrinting.isImaging.uid.hasPdf.hasImg.hasSvg.hasXls.hasTable.hasFullscreen.hasAltCopy.isFullscreen.chartElement.position.titles.hasAnnotator.isAnnotation.callbacks.printScale.tableDialog.isCursorPointer.onGeneratePdf.onGenerateImage.onGenerateSvg.style`.split(`.`))):f(``,!0),F.value?(b(),p(`svg`,{key:4,ref_key:`svgRef`,ref:xt,xmlns:T(ce),class:v({"vue-data-ui-fullscreen--on":J.value,"vue-data-ui-fulscreen--off":!J.value}),viewBox:`0 0 ${H.value.width<=0?10:H.value.width} ${H.value.height<=0?10:H.value.height}`,style:y(`max-width:100%; overflow: visible; background:transparent;color:${z.value.color}`)},[Oe(T(rt)),e.$slots[`chart-background`]?(b(),p(`foreignObject`,{key:0,x:0,y:0,width:H.value.width<=0?10:H.value.width,height:H.value.height<=0?10:H.value.height,style:{pointerEvents:`none`}},[C(e.$slots,`chart-background`,{},void 0,!0)],8,Ve)):f(``,!0),m(`defs`,null,[Oe(be,{t:`linear`,id:`funnel_area_${A.value}`,x1:`0%`,x2:`100%`,y1:`0%`,y2:`0%`,stops:[[`0%`,z.value.backgroundColor,0],[`20%`,z.value.area.color,1],[`100%`,z.value.area.color,1]]},null,8,[`id`,`stops`])]),z.value.circleLinks.show?(b(),p(`line`,_({key:1},At.value,{stroke:z.value.circleLinks.color,"stroke-width":12*z.value.circleLinks.widthRatio,"stroke-linecap":`round`,class:{animated:I.value.useCssAnimation&&!T(D)},style:{strokeDasharray:I.value.useCssAnimation&&!T(D)?W.value.height:0,strokeDashoffset:I.value.useCssAnimation&&!T(D)?W.value.height:0}}),null,16,He)):f(``,!0),(b(!0),p(l,null,S(q.value,({cx:e,cy:t,r:n,fill:r},i)=>(b(),p(`circle`,_({ref_for:!0},{cx:e,cy:t,r:n,fill:r},{stroke:R.value.stroke,"stroke-width":R.value.strokeWidth,class:{animated:I.value.useCssAnimation&&!N.value&&!T(D)},style:{animationDelay:`${150*i}ms`}}),null,16,Ue))),256)),(b(!0),p(l,null,S(q.value,(e,t)=>(b(),p(`text`,{x:e.cx,y:e.cy+V.value.circles/3+R.value.dataLabels.offsetY,"text-anchor":`middle`,"font-size":V.value.circles,fill:R.value.dataLabels.adaptColorToBackground?T(se)(e.color):R.value.dataLabels.color,"font-weight":R.value.dataLabels.bold?`bold`:`normal`,class:v({animated:I.value.useCssAnimation&&!N.value&&!T(D)}),style:y({animationDelay:`${150*t}ms`})},w(T(s)(R.value.dataLabels.formatter,e.proportion*100,T(o)({v:e.proportion*100,s:`%`,r:R.value.dataLabels.rounding}),{datapoint:e})),15,We))),256)),z.value.area.show?(b(),p(`polygon`,{key:2,points:kt.value,fill:`url(#funnel_area_${A.value})`,class:v({animated:I.value.useCssAnimation&&!N.value&&!T(D)}),style:y({transition:I.value.useCssAnimation?`all ${150*U.value.length}ms ease-in`:`none`})},null,14,Ge)):f(``,!0),(b(!0),p(l,null,S(q.value,({x:e,y:t,height:n,width:r,fill:i},a)=>(b(),p(`rect`,_({ref_for:!0},{x:e,y:t,height:n,width:r,fill:i},{stroke:L.value.stroke,"stroke-width":L.value.strokeWidth,rx:L.value.borderRadius,class:{animated:I.value.useCssAnimation&&!N.value&&!T(D)},style:{animationDelay:`${150*a}ms`}}),null,16,Ke))),256)),(b(!0),p(l,null,S(q.value,(e,t)=>(b(),p(`g`,null,[m(`text`,{x:e.x+e.width+L.value.dataLabels.name.offsetX+12,y:e.cy-V.value.names/2+L.value.dataLabels.name.offsetY,"text-anchor":`start`,"font-size":V.value.names,fill:L.value.dataLabels.name.color,"font-weight":L.value.dataLabels.name.bold?`bold`:`normal`,class:v({animated:I.value.useCssAnimation&&!N.value&&!T(D)}),style:y({animationDelay:`${150*t}ms`})},w(e.name),15,qe),m(`text`,{x:e.x+e.width+L.value.dataLabels.value.offsetX+12,y:e.cy+V.value.values+L.value.dataLabels.value.offsetY,"text-anchor":`start`,"font-size":V.value.values,fill:L.value.dataLabels.value.color,"font-weight":L.value.dataLabels.value.bold?`bold`:`normal`,class:v({animated:I.value.useCssAnimation&&!N.value&&!T(D)}),style:y({animationDelay:`${150*t}ms`})},w(T(s)(L.value.dataLabels.value.formatter,e.value,T(o)({p:L.value.dataLabels.value.prefix,v:e.value,s:L.value.dataLabels.value.suffix,r:L.value.dataLabels.value.rounding}),{datapoint:e})),15,Je)]))),256)),C(e.$slots,`svg`,{svg:{...H.value,isPrintingImg:T(St)||T(Ct)||T(Bt),isPrintingSvg:T(Vt)}},void 0,!0)],14,Be)):f(``,!0),e.$slots.watermark?(b(),p(`div`,Ye,[C(e.$slots,`watermark`,je(ke({isPrinting:T(St)||T(Ct)||T(Bt)||T(Vt)})),void 0,!0)])):f(``,!0),F.value?f(``,!0):(b(),d(T(Qe),{key:6,config:{type:`verticalBar`,style:{backgroundColor:z.value.backgroundColor,verticalBar:{axis:{color:`#CCCCCC`},color:`#CCCCCC`}}}},null,8,[`config`])),e.$slots.source?(b(),p(`div`,{key:7,ref_key:`source`,ref:dt,dir:`auto`},[C(e.$slots,`source`,{},void 0,!0)],512)):f(``,!0),F.value&&I.value.userOptions.buttons.table?(b(),d(Pe($.value.component),_({key:8},$.value.props,{ref_key:`tableUnit`,ref:pt,onClose:Lt}),h({content:E(()=>[(b(),d(T(et),{key:`table_${lt.value}`,colNames:Z.value.colNames,head:Z.value.head,body:Z.value.body,config:Z.value.config,title:I.value.table.useDialog?``:$.value.title,withCloseButton:!I.value.table.useDialog,onClose:Lt},{th:E(({th:e})=>[m(`div`,Xe,w(e),1)]),td:E(({td:e})=>[De(w(e.name?e.name:e),1)]),_:1},8,[`colNames`,`head`,`body`,`config`,`title`,`withCloseButton`]))]),_:2},[I.value.table.useDialog?{name:`title`,fn:E(()=>[De(w($.value.title),1)]),key:`0`}:void 0,I.value.table.useDialog?{name:`actions`,fn:E(()=>[m(`button`,{tabindex:`0`,class:`vue-ui-user-options-button`,onClick:t[0]||=e=>Q(I.value.userOptions.callbacks.csv)},[Oe(T(Ze),{name:`fileCsv`,stroke:$.value.props.color},null,8,[`stroke`])])]),key:`1`}:void 0]),1040)):f(``,!0)],46,ze))}},[[`__scopeId`,`data-v-efc62c19`]]);export{Re as n,Ze as t};
@@ -1 +1 @@
1
- import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{n as t,t as n}from"./tableIntegration-CNoJ1CIY.js";import{n as r,t as i}from"./annotationSlots-BRR85CqJ.js";import{n as a,t as o}from"./userOptionsSlots-DYuo-E5m.js";import{$ as s,D as c,Dt as ee,Ht as te,Kt as ne,S as re,X as ie,Zt as ae,at as oe,i as se,in as ce,nt as le,pt as ue,t as de,w as fe,yt as pe,z as me,zt as he}from"./lib-zDxoqrgo.js";import{n as ge,t as _e}from"./useHints-BH9r_0Vd.js";import{t as ve}from"./useConfig-CKdzPrcf.js";import{t as ye}from"./usePrinter-CnyKPIFM.js";import{n as be,t as xe}from"./BaseScanner-8NdoBs7B.js";import{t as Se}from"./useChartExport-DtPNpc9M.js";import{t as Ce}from"./useTransitions-DfSHzsdz.js";import{n as we}from"./Title-BRAjxtjG.js";import{t as Te}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{l as Ee,t as De}from"./useResponsive-D2CPcpda.js";import{t as Oe}from"./BaseLegendToggle-Dn_tNvn4.js";import{t as ke}from"./A11yDataTable-DWNlWXzs.js";import{n as Ae}from"./resolveChartConfig-BSo1Oe9n.js";import{t as je}from"./useUserOptionState-CXlFnwPv.js";import{t as Me}from"./useChartAccessibility-DOMuYJfm.js";import{t as Ne}from"./chartImage-NwZO-elv.js";import{t as Pe}from"./labelUtils-Djp5nJtN.js";import{t as Fe}from"./Legend-DokTll4u.js";import{t as Ie}from"./vue_ui_galaxy-B94QInxc.js";import{Fragment as Le,Teleport as Re,computed as l,createBlock as u,createCommentVNode as d,createElementBlock as f,createElementVNode as p,createSlots as ze,createTextVNode as Be,createVNode as Ve,defineAsyncComponent as m,guardReactiveProps as h,mergeProps as He,nextTick as Ue,normalizeClass as g,normalizeProps as _,normalizeStyle as v,onMounted as We,openBlock as y,ref as b,renderList as Ge,renderSlot as x,resolveDynamicComponent as Ke,toDisplayString as S,toRefs as qe,unref as C,watch as Je,withCtx as w}from"vue";var Ye=/* @__PURE__ */ e({default:()=>ht}),Xe=[`id`],Ze=[`id`],Qe=[`id`],$e={style:{position:`relative`}},et=[`xmlns`,`aria-describedby`,`viewBox`],tt=[`width`,`height`],nt=[`id`],rt=[`stdDeviation`],it=[`d`,`stroke`,`stroke-width`],at=[`d`,`stroke`,`stroke-width`],ot=[`filter`],st=[`d`,`stroke`,`stroke-width`],ct=[`data-a11y-serie-id`,`d`,`stroke-width`,`aria-label`,`onMouseenter`,`onMouseleave`,`onClick`],lt={key:0,style:{position:`absolute`,top:`100%`,left:`0`,width:`100%`},"data-dom-to-png-ignore":``,"aria-hidden":`true`},ut={key:5,class:`vue-data-ui-watermark`},dt=[`id`],ft=[`onClick`],pt={key:0},mt={key:1},ht=/*#__PURE__*/ Te({__name:`vue-ui-galaxy`,props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:[`selectLegend`,`selectDatapoint`,`copyAlt`],setup(e,{expose:Te,emit:Ye}){let ht=m(()=>import(`./Tooltip-BUXB0i6z.js`)),gt=m(()=>import(`./BaseIcon-Cz30ODFA.js`).then(e=>e.n)),_t=m(()=>import(`./vue-ui-accordion-Dy5OVFKr.js`).then(e=>e.n)),vt=m(()=>import(`./DataTable-DSUA5M9p.js`)),yt=m(()=>import(`./PenAndPaper-DvJJaeU2.js`).then(e=>e.t)),bt=m(()=>import(`./UserOptions-D65t74CM.js`).then(e=>e.n)),xt=m(()=>import(`./PackageVersion-D6pKL176.js`).then(e=>e.t)),St=m(()=>import(`./BaseDraggableDialog-T1gEsQid.js`).then(e=>e.n)),{vue_ui_galaxy:Ct}=ve(),T=e,E=b(ie()),D=b(null),wt=b(!1),Tt=b(``),O=b(null),Et=b(0),Dt=b(0),Ot=b(0),kt=b(0),At=b(null),jt=b(null),Mt=b(null),Nt=b(null),k=b(null),Pt=b(null),Ft=b(!1),It=b(null),Lt=b(null),A=b(null),Rt=b(null),zt=b({x:0,y:0}),Bt=b(`pointer`),j=b(!1),Vt=l(()=>!!T.dataset&&T.dataset.length),M=b(Zt()),N=l(()=>M.value.style.chart.layout.arcs),P=l(()=>M.value.style.chart.layout),F=l(()=>M.value.style.chart);ge({config:()=>M.value,dataset:()=>T.dataset,component:`VueUiGalaxy`,rules:[_e.singleSeries,_e.emptyArray,{test:e=>e.length>6,message:[`👀 The number of series is > 6. Consider:`,``,`▶️ Grouping small values dynamically into a single "Other" series.`,``,`▶️ Using filters to let users choose a maximum number of series to display.`,``,`▶️ Using VueUiHorizontalBar instead to make the dataset breakdown easier to read.`]}]});let{transitionEnabled:Ht}=Ce({config:()=>M.value.transitions,dataset:()=>T.dataset}),I=l(()=>M.value.userOptions.useCursorPointer),Ut=l(()=>ce({defaultConfig:{userOptions:{show:!1},table:{show:!1},useCssAnimation:!1,style:{chart:{backgroundColor:`#99999930`,legend:{backgroundColor:`transparent`}}}},userConfig:M.value.skeletonConfig??{}})),{loading:Wt,FINAL_DATASET:Gt}=be({...qe(T),FINAL_CONFIG:M,prepareConfig:Zt,callback:()=>{Promise.resolve().then(async()=>{await Ue(),R.value.showTable=M.value.table.show})},skeletonDataset:T.config?.skeletonDataset??[{name:`_`,values:[21],color:`#DBDBDB`},{name:`_`,values:[13],color:`#C4C4C4`},{name:`_`,values:[8],color:`#ADADAD`}],skeletonConfig:ce({defaultConfig:M.value,userConfig:Ut.value})});We(()=>{Ft.value=!0,qt()});let Kt=l(()=>M.value.debug);function qt(){if(he(T.dataset)?oe({componentName:`VueUiGalaxy`,type:`dataset`,debug:Kt.value}):Kt.value&&T.dataset.forEach((e,t)=>{pe({datasetObject:e,requiredAttributes:[`name`,`values`]}).forEach(e=>{oe({componentName:`VueUiGalaxy`,type:`datasetSerieAttribute`,property:e,index:t})})}),M.value.responsive){let e=Ee(()=>{let{width:e,height:t}=De({chart:D.value,title:F.value.title.text?At.value:null,legend:F.value.legend.show?jt.value:null,noTitle:Nt.value,source:Mt.value});requestAnimationFrame(()=>{z.value=Math.max(.1,e),B.value=Math.max(.1,t-12)})});k.value&&(Pt.value&&k.value.unobserve(Pt.value),k.value.disconnect()),k.value=new ResizeObserver(e),Pt.value=D.value.parentNode,k.value.observe(Pt.value)}}let{userOptionsVisible:Jt,setUserOptionsVisibility:Yt,keepUserOptionState:Xt}=je({config:M.value}),{svgRef:L}=Me({config:F.value.title});function Zt(){return Ae(T.config,Ct,Ie)}let Qt=ae(T.config);Je(()=>T.config,(e,t)=>{let n=ae(e),r=n!==Qt;Qt=n;let i=Zt();if(!r){M.value.style.chart.tooltip=i.style.chart.tooltip,R.value.showTooltip=M.value.style.chart.tooltip.show;return}M.value=i,Jt.value=!M.value.userOptions.showOnChartHover,qt(),Dt.value+=1,Ot.value+=1,kt.value+=1,R.value.dataLabels.show=P.value.labels.dataLabels.show,R.value.showTable=M.value.table.show,R.value.showTooltip=F.value.tooltip.show},{deep:!0});let{isPrinting:$t,isImaging:en,generatePdf:tn,generateImage:nn}=ye({elementId:`galaxy_${E.value}`,fileName:F.value.title.text||`vue-ui-galaxy`,options:M.value.userOptions.print}),rn=l(()=>M.value.userOptions.show&&!F.value.title.text),an=l(()=>fe(M.value.customPalette)),R=b({dataLabels:{show:P.value.labels.dataLabels.show},showTable:M.value.table.show,showTooltip:F.value.tooltip.show}),z=b(250),B=b(180),on=b(0),sn=b(0),V=l(()=>({width:z.value,height:B.value,viewBox:`${on.value} ${sn.value} ${z.value} ${B.value}`})),cn=Ye,H=b([]);function ln(){cn(`selectLegend`,K.value.map(e=>({name:e.name,color:e.color,value:e.value})))}function un(){H.value.length?H.value=[]:J.value.forEach(e=>{H.value.push(e.id)}),ln()}function U(e){H.value.includes(e.id)?H.value=H.value.filter(t=>t!==e.id):H.value.push(e.id),ln()}function dn(e){return W.value.length?W.value.find(t=>t.name===e)||(Kt.value&&console.warn(`VueUiGalaxy - Series name not found "${e}"`),null):(Kt.value&&console.warn(`VueUiGalaxy - There are no series to show.`),null)}function fn(e){let t=dn(e);t!==null&&H.value.includes(t.id)&&U({id:t.id})}function pn(e){let t=dn(e);t!==null&&(H.value.includes(t.id)||U({id:t.id}))}let W=l(()=>Gt.value.map((e,t)=>({name:e.name,color:re(e.color)||an.value[t]||te[t]||te[t%te.length],value:e.values?ne(e.values).reduce((e,t)=>e+t,0):0,absoluteValues:ne(e.values),id:ie()})).sort((e,t)=>t.value-e.value).map((e,t)=>({...e,absoluteIndex:t})));function mn(){return W.value.map(e=>({name:e.name,color:e.color,value:e.value}))}let G=l(()=>W.value.filter(e=>!H.value.includes(e.id)).map(e=>e.value).reduce((e,t)=>e+t,0)),hn=b(190),gn=l(()=>W.value.filter(e=>!H.value.includes(e.id))),_n=l(()=>(N.value.strokeWidth+N.value.borderWidth)/2+(P.value.padding??12)),vn=l(()=>me({maxPoints:hn.value,a:N.value.a??6,b:N.value.b??6,angleStep:N.value.angleStep??.07,startX:V.value.width/2+N.value.offsetX,startY:V.value.height/2+N.value.offsetY,boxWidth:V.value.width,boxHeight:V.value.height,padding:_n.value})),K=l(()=>{let e=[];for(let t=0;t<gn.value.length;t+=1){let n=gn.value[t],r=n.value/G.value*hn.value+(t>0&&e.length?e[t-1].points:0);e.push({points:r,...n,seriesIndex:t,proportion:n.value/G.value,path:vn.value(r)})}return e.filter(e=>!H.value.includes(e.id)).toSorted((e,t)=>t.points-e.points)});function yn(e){let t=Math.min(z.value,B.value),n=O.value===e.id&&N.value.hoverEffect.show?N.value.hoverEffect.multiplicator:1,r=(N.value.strokeWidth+N.value.borderWidth)*n,i=N.value.strokeWidth*n,a=N.value.strokeWidth/2*n;return{border:r/180*t,path:i/180*t,blur:a/180*t}}let q=b(!1);function bn(e){q.value=e,Et.value+=1}let xn=b(null);function Sn(){wt.value=!1,O.value=null,A.value=null,Rt.value=null}function Cn(e){if(!L.value||!e)return;let t=L.value.querySelector(`[data-a11y-serie-id="${e}"]`);if(!t)return;let n=t.getBoundingClientRect();zt.value={x:n.left+n.width/2,y:n.top+n.height/2}}function wn(e){M.value.events.datapointLeave&&M.value.events.datapointLeave({datapoint:e,seriesIndex:e.absoluteIndex}),(Rt.value!==e.id||Bt.value!==`keyboard`)&&(wt.value=!1,O.value=null)}function Tn(e){cn(`selectDatapoint`,e),M.value.events.datapointClick&&M.value.events.datapointClick({datapoint:e,seriesIndex:e.absoluteIndex})}function En({val:e,percentage:t,showVal:n,showPercentage:r}){let i=P.value.labels.dataLabels;return Pe({config:i,val:e,percentage:t,showVal:n,showPercentage:r})}function Dn({datapoint:e,_relativeIndex:t,seriesIndex:n,show:r=!1,triggerMode:i=`pointer`,flatIndex:a=null}){if(M.value.events.datapointEnter&&M.value.events.datapointEnter({datapoint:e,seriesIndex:e.absoluteIndex}),!R.value.showTooltip)return;Bt.value=i,A.value=a,Rt.value=e.id,xn.value={datapoint:e,seriesIndex:n,series:W.value,config:M.value},wt.value=r,O.value=e.id;let o=``,c=F.value.tooltip.customFormat;ee(c)&&ue(()=>c({seriesIndex:n,datapoint:e,series:W.value,config:M.value}))?Tt.value=c({seriesIndex:n,datapoint:e,series:W.value,config:M.value}):(o+=`<div style="width:100%;text-align:center;border-bottom:1px solid ${F.value.tooltip.borderColor};padding-bottom:6px;margin-bottom:3px;">${e.name}</div>`,o+=`<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>`,o+=`<b>${En({showVal:F.value.tooltip.showValue,showPercentage:F.value.tooltip.showPercentage,val:se(P.value.labels.dataLabels.formatter,e.value,s({p:P.value.labels.dataLabels.prefix,v:e.value,s:P.value.labels.dataLabels.suffix,r:F.value.tooltip.roundingValue}),{datapoint:e,seriesIndex:n}),percentage:s({v:e.proportion*100,s:`%`,r:F.value.tooltip.roundingPercentage})})}</b></div>`,Tt.value=`<div>${o}</div>`),i===`keyboard`&&Ue(()=>{Cn(e.id)})}let J=l(()=>W.value.map((e,t)=>{let n=se(P.value.labels.dataLabels.formatter,e.value,s({p:P.value.labels.dataLabels.prefix,v:e.value,s:P.value.labels.dataLabels.suffix,r:F.value.legend.roundingValue}),{datapoint:e,index:t}),r=isNaN(e.value/G.value)||H.value.includes(e.id)?`-`:s({v:e.value/G.value*100,s:`%`,r:F.value.legend.roundingPercentage}),i=En({showVal:F.value.legend.showValue,showPercentage:F.value.legend.showPercentage,val:n,percentage:r});return{...e,proportion:(e.value||0)/Gt.value.map(e=>(e.values||[]).reduce((e,t)=>e+t,0)).reduce((e,t)=>e+t,0),opacity:H.value.includes(e.id)?.5:1,shape:e.shape||`circle`,segregate:()=>U(e),isSegregated:H.value.includes(e.id),display:`${e.name}${F.value.legend.showPercentage||F.value.legend.showValue?`: `:``}${i}`}})),On=l(()=>({cy:`galaxy-div-legend`,backgroundColor:F.value.legend.backgroundColor,color:F.value.legend.color,fontSize:F.value.legend.fontSize,paddingBottom:12,fontWeight:F.value.legend.bold?`bold`:``})),Y=l(()=>({head:K.value.map(e=>({name:e.name,color:e.color})),body:K.value.map(e=>e.value)}));function kn(e=null){Ue(()=>{let t=Y.value.head.map((e,t)=>[[e.name],[Y.value.body[t]],[isNaN(Y.value.body[t]/G.value)?`-`:Y.value.body[t]/G.value*100]]),n=[[F.value.title.text],[F.value.title.subtitle.text],[[``],[`val`],[`%`]]].concat(t),r=c(n);e?e(r):le({csvContent:r,title:F.value.title.text||`vue-ui-galaxy`})})}let X=l(()=>{let e=[`__SUM__`,s({p:P.value.labels.dataLabels.prefix,v:G.value,s:P.value.labels.dataLabels.suffix,r:M.value.table.td.roundingValue}),`100%`],t=Y.value.head.map((e,t)=>{let n=s({p:P.value.labels.dataLabels.prefix,v:Y.value.body[t],s:P.value.labels.dataLabels.suffix,r:M.value.table.td.roundingValue});return[{color:e.color,name:e.name},n,isNaN(Y.value.body[t]/G.value)?`-`:s({v:Y.value.body[t]/G.value*100,s:`%`,r:M.value.table.td.roundingPercentage})]}),n={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};return{colNames:[M.value.table.columnNames.series,M.value.table.columnNames.value,M.value.table.columnNames.percentage],head:e,body:t,config:n}});function An(){R.value.showTable=!R.value.showTable}function jn(){R.value.showTooltip=!R.value.showTooltip}let Z=b(!1);function Mn(){Z.value=!Z.value}let Nn=Ne(D,()=>F.value.title.text),Q=l(()=>n({config:M,style:F,mutableConfig:R,dialog:St,accordion:_t,isFullscreen:q,parent:D,maxWidth:500,isCursorPointer:I}));Je(()=>R.value.showTable,e=>t(e,M,It));function Pn(){R.value.showTable=!1,Lt.value&&Lt.value.setTableIconState(!1)}let Fn=l(()=>J.value.map(e=>({...e,name:e.display}))),In=l(()=>F.value.backgroundColor),Ln=l(()=>F.value.legend),Rn=l(()=>F.value.title),{isCallbackImaging:zn,isCallbackSvg:Bn,generateSvg:Vn,onGenerateImage:Hn}=Se({svg:L,title:Rn,legend:Ln,legendItems:Fn,backgroundColor:In,getSvgCallback:()=>M.value.userOptions.callbacks.svg,generateImage:nn});async function Un(){if(cn(`copyAlt`,{config:M.value,dataset:W.value}),!M.value.userOptions.callbacks.altCopy){console.warn("Vue Data UI - A callback must be set for `altCopy` in userOptions.");return}await Promise.resolve(M.value.userOptions.callbacks.altCopy({config:M.value,dataset:W.value}))}function Wn(){A.value=null,Rt.value=null,j.value=!0}function Gn(){Sn(),j.value=!1}function Kn(e){if(!L.value||Z.value||document.activeElement!==L.value||!$.value.length)return;let t=e.key===`ArrowLeft`||e.key===`ArrowUp`,n=e.key===`ArrowRight`||e.key===`ArrowDown`,r=e.key===`Enter`||e.key===` `,i=e.key===`Escape`;if(!t&&!n&&!r&&!i)return;if(e.preventDefault(),e.stopPropagation(),i){Sn();return}if(r){if(A.value===null)return;let e=$.value[A.value];if(!e)return;Tn(e.datapoint);return}let a=A.value;a===null||a<0||a>=$.value.length?a=n?0:$.value.length-1:(a+=n?1:-1,a<0&&(a=$.value.length-1),a>=$.value.length&&(a=0));let o=$.value[a];o&&Dn({datapoint:o.datapoint,seriesIndex:o.datapoint.seriesIndex,show:!0,triggerMode:`keyboard`,flatIndex:a})}let qn=l(()=>({headers:X.value?.colNames??[],rows:X.value?.body??[]})),$=l(()=>K.value.map((e,t)=>({datapoint:e,index:t})));return Te({getData:mn,getImage:Nn,generatePdf:tn,generateCsv:kn,generateImage:nn,generateSvg:Vn,hideSeries:pn,showSeries:fn,toggleTable:An,toggleTooltip:jn,toggleAnnotator:Mn,toggleFullscreen:bn,copyAlt:Un}),(e,t)=>(y(),f(`div`,{ref_key:`galaxyChart`,ref:D,class:g(`vue-data-ui-component vue-ui-galaxy ${q.value?`vue-data-ui-wrapper-fullscreen`:``} ${M.value.useCssAnimation?``:`vue-ui-dna`} ${C(Wt)?`loading`:``}`),style:v(`font-family:${M.value.style.fontFamily};width:100%; text-align:center;${F.value.title.text?``:`padding-top:36px`};background:${F.value.backgroundColor}`),id:`galaxy_${E.value}`,onMouseenter:t[2]||=()=>C(Yt)(!0),onMouseleave:t[3]||=()=>{C(Yt)(!1),j.value||Sn()}},[p(`div`,{id:`chart-instructions-${E.value}`,class:`sr-only`},[p(`p`,null,S(M.value.a11y.translations.keyboardNavigation),1)],8,Ze),qn.value?.rows?.length?(y(),u(ke,{key:0,uid:E.value,head:qn.value.headers,body:qn.value.rows,notice:M.value.a11y.translations.tableAvailable,caption:M.value.a11y.translations.tableCaption},null,8,[`uid`,`head`,`body`,`notice`,`caption`])):d(``,!0),M.value.userOptions.buttons.annotator?(y(),u(C(yt),{key:1,svgRef:C(L),backgroundColor:F.value.backgroundColor,color:F.value.color,active:Z.value,isCursorPointer:I.value,palette:M.value.userOptions.annotatorPalette,onClose:Mn},ze({_:2},[Ge(C(i),t=>({name:t,fn:w(n=>[x(e.$slots,t,_(h(C(r)(t,n))),void 0,!0)])}))]),1032,[`svgRef`,`backgroundColor`,`color`,`active`,`isCursorPointer`,`palette`])):d(``,!0),rn.value?(y(),f(`div`,{key:2,ref_key:`noTitle`,ref:Nt,class:`vue-data-ui-no-title-space`,style:`height:36px; width: 100%;background:transparent`},null,512)):d(``,!0),F.value.title.text?(y(),f(`div`,{key:3,ref_key:`chartTitle`,ref:At,style:`width:100%;background:transparent;padding-bottom:24px`},[(y(),u(we,{key:`title_${Dt.value}`,config:{title:{cy:`galaxy-div-title`,...F.value.title},subtitle:{cy:`galaxy-div-subtitle`,...F.value.title.subtitle}}},null,8,[`config`]))],512)):d(``,!0),p(`div`,{id:`legend-top-${E.value}`},null,8,Qe),M.value.userOptions.show&&Vt.value&&(C(Xt)||C(Jt))?(y(),u(C(bt),{ref_key:`userOptionsRef`,ref:Lt,key:`user_option_${Et.value}`,backgroundColor:F.value.backgroundColor,color:F.value.color,isPrinting:C($t),isImaging:C(en),uid:E.value,hasTooltip:M.value.userOptions.buttons.tooltip&&F.value.tooltip.show,hasPdf:M.value.userOptions.buttons.pdf,hasXls:M.value.userOptions.buttons.csv,hasImg:M.value.userOptions.buttons.img,hasSvg:M.value.userOptions.buttons.svg,hasTable:M.value.userOptions.buttons.table,hasFullscreen:M.value.userOptions.buttons.fullscreen,hasAltCopy:M.value.userOptions.buttons.altCopy,isTooltip:R.value.showTooltip,isFullscreen:q.value,titles:{...M.value.userOptions.buttonTitles},chartElement:D.value,position:M.value.userOptions.position,hasAnnotator:M.value.userOptions.buttons.annotator,isAnnotation:Z.value,callbacks:M.value.userOptions.callbacks,printScale:M.value.userOptions.print.scale,tableDialog:M.value.table.useDialog,isCursorPointer:I.value,onToggleFullscreen:bn,onGeneratePdf:C(tn),onGenerateCsv:kn,onGenerateImage:C(Hn),onGenerateSvg:C(Vn),onToggleTable:An,onToggleTooltip:jn,onToggleAnnotator:Mn,onCopyAlt:Un,style:v({visibility:C(Xt)?C(Jt)?`visible`:`hidden`:`visible`})},ze({_:2},[Ge(C(a)(e.$slots,`menuIcon optionTooltip optionPdf optionCsv optionImg optionSvg optionTable optionFullscreen optionAnnotator optionAltCopy custom-menu-before custom-menu-after`),t=>({name:t,fn:w(n=>[x(e.$slots,t,_(h(C(o)(t,n))),void 0,!0)])}))]),1032,/* @__PURE__ */ `backgroundColor.color.isPrinting.isImaging.uid.hasTooltip.hasPdf.hasXls.hasImg.hasSvg.hasTable.hasFullscreen.hasAltCopy.isTooltip.isFullscreen.titles.chartElement.position.hasAnnotator.isAnnotation.callbacks.printScale.tableDialog.isCursorPointer.onGeneratePdf.onGenerateImage.onGenerateSvg.style`.split(`.`))):d(``,!0),p(`div`,$e,[(y(),f(`svg`,{ref_key:`svgRef`,ref:L,xmlns:C(de),"aria-describedby":`chart-instructions-${E.value}`,class:g({"vue-data-ui-fullscreen--on":q.value,"vue-data-ui-fulscreen--off":!q.value}),viewBox:V.value.viewBox,style:v(`max-width:100%; overflow: visible; background:transparent;color:${F.value.color}`),tabindex:`0`,onFocus:Wn,onBlur:Gn,onKeydown:Kn},[Ve(C(xt)),e.$slots[`chart-background`]?(y(),f(`foreignObject`,{key:0,x:0,y:0,width:V.value.width,height:V.value.height,style:{pointerEvents:`none`}},[x(e.$slots,`chart-background`,{},void 0,!0)],8,tt)):d(``,!0),p(`defs`,null,[p(`filter`,{id:`blur_${E.value}`,x:`-50%`,y:`-50%`,width:`200%`,height:`200%`},[p(`feGaussianBlur`,{in:`SourceGraphic`,stdDeviation:100/N.value.gradient.intensity},null,8,rt)],8,nt)]),(y(!0),f(Le,null,Ge(K.value,e=>(y(),f(`g`,{key:`dp_${e.id}`},[e.value?(y(),f(`path`,{key:0,d:e.path,fill:`none`,stroke:F.value.backgroundColor,"stroke-width":yn(e).border,class:g({"vue-data-ui-transition":C(Ht)}),"stroke-linecap":`round`},null,10,it)):d(``,!0),e.value?(y(),f(`path`,{key:1,d:e.path,fill:`none`,stroke:e.color,"stroke-width":yn(e).path,"stroke-linecap":`round`,class:g({"vue-data-ui-transition":C(Ht),"vue-ui-galaxy-blur":O.value&&O.value!==e.id&&M.value.useBlurOnHover})},null,10,at)):d(``,!0),e.value&&N.value.gradient.show?(y(),f(`g`,{key:2,filter:`url(#blur_${E.value})`},[p(`path`,{d:e.path,fill:`none`,stroke:N.value.gradient.color,"stroke-width":yn(e).blur,"stroke-linecap":`round`,class:g({"vue-ui-galaxy-gradient":!0,"vue-data-ui-transition":C(Ht),"vue-ui-galaxy-blur":O.value&&O.value!==e.id&&M.value.useBlurOnHover})},null,10,st)],8,ot)):d(``,!0)]))),128)),(y(!0),f(Le,null,Ge(K.value,(e,t)=>(y(),f(`g`,null,[e.value?(y(),f(`path`,{key:0,"data-a11y-serie-id":e.id,d:e.path,fill:`none`,stroke:`transparent`,"stroke-width":N.value.strokeWidth+N.value.borderWidth,"stroke-linecap":`round`,"aria-label":`${e.name}: ${C(s)({p:P.value.labels.dataLabels.prefix,v:e.value,s:P.value.labels.dataLabels.suffix,r:F.value.tooltip.roundingValue})}`,onMouseenter:n=>Dn({datapoint:e,relativeIndex:t,seriesIndex:e.seriesIndex,show:!0,triggerMode:`pointer`,flatIndex:t}),onMouseleave:t=>wn(e),onClick:t=>Tn(e)},null,40,ct)):d(``,!0)]))),256)),x(e.$slots,`svg`,{svg:{...V.value,isPrintingImg:C($t)||C(en)||C(zn),isPrintingSvg:C(Bn)}},void 0,!0)],46,et)),e.$slots.hint?(y(),f(`div`,lt,[x(e.$slots,`hint`,_(h({hint:M.value.a11y.translations.keyboardNavigation,isVisible:j.value})),void 0,!0)])):d(``,!0)]),e.$slots.watermark?(y(),f(`div`,ut,[x(e.$slots,`watermark`,_(h({isPrinting:C($t)||C(en)||C(zn)||C(Bn)})),void 0,!0)])):d(``,!0),p(`div`,{id:`legend-bottom-${E.value}`},null,8,dt),Ft.value&&(F.value.legend.show||e.$slots.legend)?(y(),u(Re,{key:6,to:F.value.legend.position===`top`?`#legend-top-${E.value}`:`#legend-bottom-${E.value}`},[p(`div`,{ref_key:`chartLegend`,ref:jt},[x(e.$slots,`legend`,{legend:J.value},()=>[F.value.legend.show?(y(),u(Fe,{key:`legend_${kt.value}`,legendSet:J.value,config:On.value,onClickMarker:t[0]||=({legend:e})=>U(e)},{item:w(({legend:e,index:t})=>[C(Wt)?d(``,!0):(y(),f(`div`,{key:0,onClick:t=>U(e),style:v(`opacity:${H.value.includes(e.id)?.5:1}`)},S(e.display),13,ft))]),legendToggle:w(()=>[J.value.length>2&&F.value.legend.selectAllToggle.show&&!C(Wt)?(y(),u(Oe,{key:0,backgroundColor:F.value.legend.selectAllToggle.backgroundColor,color:F.value.legend.selectAllToggle.color,fontSize:F.value.legend.fontSize,checked:H.value.length>0,onToggle:un},null,8,[`backgroundColor`,`color`,`fontSize`,`checked`])):d(``,!0)]),_:1},8,[`legendSet`,`config`])):d(``,!0)],!0)],512)],8,[`to`])):d(``,!0),e.$slots.source?(y(),f(`div`,{key:7,ref_key:`source`,ref:Mt,dir:`auto`},[x(e.$slots,`source`,{},void 0,!0)],512)):d(``,!0),Ve(C(ht),{teleportTo:F.value.tooltip.teleportTo,show:R.value.showTooltip&&wt.value,backgroundColor:F.value.tooltip.backgroundColor,color:F.value.tooltip.color,borderRadius:F.value.tooltip.borderRadius,borderColor:F.value.tooltip.borderColor,borderWidth:F.value.tooltip.borderWidth,fontSize:F.value.tooltip.fontSize,backgroundOpacity:F.value.tooltip.backgroundOpacity,position:F.value.tooltip.position,offsetX:F.value.tooltip.offsetX,offsetY:F.value.tooltip.offsetY,parent:D.value,content:Tt.value,isFullscreen:q.value,isCustom:C(ee)(F.value.tooltip.customFormat),smooth:F.value.tooltip.smooth,backdropFilter:F.value.tooltip.backdropFilter,smoothForce:F.value.tooltip.smoothForce,smoothSnapThreshold:F.value.tooltip.smoothSnapThreshold,isA11yMode:Bt.value===`keyboard`,a11yPosition:zt.value},{"tooltip-before":w(()=>[x(e.$slots,`tooltip-before`,_(h({...xn.value})),void 0,!0)]),tooltip:w(()=>[x(e.$slots,`tooltip`,_(h({...xn.value})),void 0,!0)]),"tooltip-after":w(()=>[x(e.$slots,`tooltip-after`,_(h({...xn.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`]),Vt.value&&M.value.userOptions.buttons.table?(y(),u(Ke(Q.value.component),He({key:8},Q.value.props,{ref_key:`tableUnit`,ref:It,onClose:Pn}),ze({content:w(()=>[(y(),u(C(vt),{key:`table_${Ot.value}`,colNames:X.value.colNames,head:X.value.head,body:X.value.body,config:X.value.config,title:M.value.table.useDialog?``:Q.value.title,withCloseButton:!M.value.table.useDialog,isCursorPointer:I.value,onClose:Pn},{th:w(({th:e})=>[e===`__SUM__`?(y(),f(`div`,pt,[Ve(C(gt),{name:`sigma`,stroke:X.value.config.th.color,size:16},null,8,[`stroke`])])):(y(),f(`div`,mt,S(e),1))]),td:w(({td:e})=>[Be(S(e.name||e),1)]),_:1},8,[`colNames`,`head`,`body`,`config`,`title`,`withCloseButton`,`isCursorPointer`]))]),_:2},[M.value.table.useDialog?{name:`title`,fn:w(()=>[Be(S(Q.value.title),1)]),key:`0`}:void 0,M.value.table.useDialog?{name:`actions`,fn:w(()=>[p(`button`,{tabindex:`0`,class:`vue-ui-user-options-button`,onClick:t[1]||=e=>kn(M.value.userOptions.callbacks.csv),style:v({cursor:I.value?`pointer`:`default`})},[Ve(C(gt),{name:`fileCsv`,stroke:Q.value.props.color},null,8,[`stroke`])],4)]),key:`1`}:void 0]),1040)):d(``,!0),x(e.$slots,`skeleton`,{},()=>[C(Wt)?(y(),u(xe,{key:0})):d(``,!0)],!0)],46,Xe))}},[[`__scopeId`,`data-v-fbbde348`]]);export{Ye as n,ht as t};
1
+ import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{n as t,t as n}from"./tableIntegration-CNoJ1CIY.js";import{n as r,t as i}from"./annotationSlots-BRR85CqJ.js";import{n as a,t as o}from"./userOptionsSlots-DYuo-E5m.js";import{$ as s,D as c,Dt as ee,Ht as te,Kt as ne,S as re,X as ie,Zt as ae,at as oe,i as se,in as ce,nt as le,pt as ue,t as de,w as fe,yt as pe,z as me,zt as he}from"./lib-CV_IANZ6.js";import{n as ge,t as _e}from"./useHints-BH9r_0Vd.js";import{t as ve}from"./useConfig-CKdzPrcf.js";import{t as ye}from"./usePrinter-hLW3cv4N.js";import{n as be,t as xe}from"./BaseScanner-8NdoBs7B.js";import{t as Se}from"./useChartExport-DtPNpc9M.js";import{t as Ce}from"./useTransitions-DfSHzsdz.js";import{n as we}from"./Title-BGYFqulv.js";import{t as Te}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{l as Ee,t as De}from"./useResponsive-D2CPcpda.js";import{t as Oe}from"./BaseLegendToggle-Bq5FjyuI.js";import{t as ke}from"./A11yDataTable-DWNlWXzs.js";import{n as Ae}from"./resolveChartConfig-DZg-korK.js";import{t as je}from"./useUserOptionState-CXlFnwPv.js";import{t as Me}from"./useChartAccessibility-DOMuYJfm.js";import{t as Ne}from"./chartImage-CIvU_04o.js";import{t as Pe}from"./labelUtils-CG3uVXoZ.js";import{t as Fe}from"./Legend-D8YoT1RJ.js";import{t as Ie}from"./vue_ui_galaxy-B94QInxc.js";import{Fragment as Le,Teleport as Re,computed as l,createBlock as u,createCommentVNode as d,createElementBlock as f,createElementVNode as p,createSlots as ze,createTextVNode as Be,createVNode as Ve,defineAsyncComponent as m,guardReactiveProps as h,mergeProps as He,nextTick as Ue,normalizeClass as g,normalizeProps as _,normalizeStyle as v,onMounted as We,openBlock as y,ref as b,renderList as Ge,renderSlot as x,resolveDynamicComponent as Ke,toDisplayString as S,toRefs as qe,unref as C,watch as Je,withCtx as w}from"vue";var Ye=/* @__PURE__ */ e({default:()=>ht}),Xe=[`id`],Ze=[`id`],Qe=[`id`],$e={style:{position:`relative`}},et=[`xmlns`,`aria-describedby`,`viewBox`],tt=[`width`,`height`],nt=[`id`],rt=[`stdDeviation`],it=[`d`,`stroke`,`stroke-width`],at=[`d`,`stroke`,`stroke-width`],ot=[`filter`],st=[`d`,`stroke`,`stroke-width`],ct=[`data-a11y-serie-id`,`d`,`stroke-width`,`aria-label`,`onMouseenter`,`onMouseleave`,`onClick`],lt={key:0,style:{position:`absolute`,top:`100%`,left:`0`,width:`100%`},"data-dom-to-png-ignore":``,"aria-hidden":`true`},ut={key:5,class:`vue-data-ui-watermark`},dt=[`id`],ft=[`onClick`],pt={key:0},mt={key:1},ht=/*#__PURE__*/ Te({__name:`vue-ui-galaxy`,props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:[`selectLegend`,`selectDatapoint`,`copyAlt`],setup(e,{expose:Te,emit:Ye}){let ht=m(()=>import(`./Tooltip-Cus2-XNQ.js`)),gt=m(()=>import(`./BaseIcon-DdIyewwY.js`).then(e=>e.n)),_t=m(()=>import(`./vue-ui-accordion-BNvevckx.js`).then(e=>e.n)),vt=m(()=>import(`./DataTable-WNecJMcY.js`)),yt=m(()=>import(`./PenAndPaper-IMw576MC.js`).then(e=>e.t)),bt=m(()=>import(`./UserOptions-DTxMeZv3.js`).then(e=>e.n)),xt=m(()=>import(`./PackageVersion-CdkxOy58.js`).then(e=>e.t)),St=m(()=>import(`./BaseDraggableDialog-D_tuHEjO.js`).then(e=>e.n)),{vue_ui_galaxy:Ct}=ve(),T=e,E=b(ie()),D=b(null),wt=b(!1),Tt=b(``),O=b(null),Et=b(0),Dt=b(0),Ot=b(0),kt=b(0),At=b(null),jt=b(null),Mt=b(null),Nt=b(null),k=b(null),Pt=b(null),Ft=b(!1),It=b(null),Lt=b(null),A=b(null),Rt=b(null),zt=b({x:0,y:0}),Bt=b(`pointer`),j=b(!1),Vt=l(()=>!!T.dataset&&T.dataset.length),M=b(Zt()),N=l(()=>M.value.style.chart.layout.arcs),P=l(()=>M.value.style.chart.layout),F=l(()=>M.value.style.chart);ge({config:()=>M.value,dataset:()=>T.dataset,component:`VueUiGalaxy`,rules:[_e.singleSeries,_e.emptyArray,{test:e=>e.length>6,message:[`👀 The number of series is > 6. Consider:`,``,`▶️ Grouping small values dynamically into a single "Other" series.`,``,`▶️ Using filters to let users choose a maximum number of series to display.`,``,`▶️ Using VueUiHorizontalBar instead to make the dataset breakdown easier to read.`]}]});let{transitionEnabled:Ht}=Ce({config:()=>M.value.transitions,dataset:()=>T.dataset}),I=l(()=>M.value.userOptions.useCursorPointer),Ut=l(()=>ce({defaultConfig:{userOptions:{show:!1},table:{show:!1},useCssAnimation:!1,style:{chart:{backgroundColor:`#99999930`,legend:{backgroundColor:`transparent`}}}},userConfig:M.value.skeletonConfig??{}})),{loading:Wt,FINAL_DATASET:Gt}=be({...qe(T),FINAL_CONFIG:M,prepareConfig:Zt,callback:()=>{Promise.resolve().then(async()=>{await Ue(),R.value.showTable=M.value.table.show})},skeletonDataset:T.config?.skeletonDataset??[{name:`_`,values:[21],color:`#DBDBDB`},{name:`_`,values:[13],color:`#C4C4C4`},{name:`_`,values:[8],color:`#ADADAD`}],skeletonConfig:ce({defaultConfig:M.value,userConfig:Ut.value})});We(()=>{Ft.value=!0,qt()});let Kt=l(()=>M.value.debug);function qt(){if(he(T.dataset)?oe({componentName:`VueUiGalaxy`,type:`dataset`,debug:Kt.value}):Kt.value&&T.dataset.forEach((e,t)=>{pe({datasetObject:e,requiredAttributes:[`name`,`values`]}).forEach(e=>{oe({componentName:`VueUiGalaxy`,type:`datasetSerieAttribute`,property:e,index:t})})}),M.value.responsive){let e=Ee(()=>{let{width:e,height:t}=De({chart:D.value,title:F.value.title.text?At.value:null,legend:F.value.legend.show?jt.value:null,noTitle:Nt.value,source:Mt.value});requestAnimationFrame(()=>{z.value=Math.max(.1,e),B.value=Math.max(.1,t-12)})});k.value&&(Pt.value&&k.value.unobserve(Pt.value),k.value.disconnect()),k.value=new ResizeObserver(e),Pt.value=D.value.parentNode,k.value.observe(Pt.value)}}let{userOptionsVisible:Jt,setUserOptionsVisibility:Yt,keepUserOptionState:Xt}=je({config:M.value}),{svgRef:L}=Me({config:F.value.title});function Zt(){return Ae(T.config,Ct,Ie)}let Qt=ae(T.config);Je(()=>T.config,(e,t)=>{let n=ae(e),r=n!==Qt;Qt=n;let i=Zt();if(!r){M.value.style.chart.tooltip=i.style.chart.tooltip,R.value.showTooltip=M.value.style.chart.tooltip.show;return}M.value=i,Jt.value=!M.value.userOptions.showOnChartHover,qt(),Dt.value+=1,Ot.value+=1,kt.value+=1,R.value.dataLabels.show=P.value.labels.dataLabels.show,R.value.showTable=M.value.table.show,R.value.showTooltip=F.value.tooltip.show},{deep:!0});let{isPrinting:$t,isImaging:en,generatePdf:tn,generateImage:nn}=ye({elementId:`galaxy_${E.value}`,fileName:F.value.title.text||`vue-ui-galaxy`,options:M.value.userOptions.print}),rn=l(()=>M.value.userOptions.show&&!F.value.title.text),an=l(()=>fe(M.value.customPalette)),R=b({dataLabels:{show:P.value.labels.dataLabels.show},showTable:M.value.table.show,showTooltip:F.value.tooltip.show}),z=b(250),B=b(180),on=b(0),sn=b(0),V=l(()=>({width:z.value,height:B.value,viewBox:`${on.value} ${sn.value} ${z.value} ${B.value}`})),cn=Ye,H=b([]);function ln(){cn(`selectLegend`,K.value.map(e=>({name:e.name,color:e.color,value:e.value})))}function un(){H.value.length?H.value=[]:J.value.forEach(e=>{H.value.push(e.id)}),ln()}function U(e){H.value.includes(e.id)?H.value=H.value.filter(t=>t!==e.id):H.value.push(e.id),ln()}function dn(e){return W.value.length?W.value.find(t=>t.name===e)||(Kt.value&&console.warn(`VueUiGalaxy - Series name not found "${e}"`),null):(Kt.value&&console.warn(`VueUiGalaxy - There are no series to show.`),null)}function fn(e){let t=dn(e);t!==null&&H.value.includes(t.id)&&U({id:t.id})}function pn(e){let t=dn(e);t!==null&&(H.value.includes(t.id)||U({id:t.id}))}let W=l(()=>Gt.value.map((e,t)=>({name:e.name,color:re(e.color)||an.value[t]||te[t]||te[t%te.length],value:e.values?ne(e.values).reduce((e,t)=>e+t,0):0,absoluteValues:ne(e.values),id:ie()})).sort((e,t)=>t.value-e.value).map((e,t)=>({...e,absoluteIndex:t})));function mn(){return W.value.map(e=>({name:e.name,color:e.color,value:e.value}))}let G=l(()=>W.value.filter(e=>!H.value.includes(e.id)).map(e=>e.value).reduce((e,t)=>e+t,0)),hn=b(190),gn=l(()=>W.value.filter(e=>!H.value.includes(e.id))),_n=l(()=>(N.value.strokeWidth+N.value.borderWidth)/2+(P.value.padding??12)),vn=l(()=>me({maxPoints:hn.value,a:N.value.a??6,b:N.value.b??6,angleStep:N.value.angleStep??.07,startX:V.value.width/2+N.value.offsetX,startY:V.value.height/2+N.value.offsetY,boxWidth:V.value.width,boxHeight:V.value.height,padding:_n.value})),K=l(()=>{let e=[];for(let t=0;t<gn.value.length;t+=1){let n=gn.value[t],r=n.value/G.value*hn.value+(t>0&&e.length?e[t-1].points:0);e.push({points:r,...n,seriesIndex:t,proportion:n.value/G.value,path:vn.value(r)})}return e.filter(e=>!H.value.includes(e.id)).toSorted((e,t)=>t.points-e.points)});function yn(e){let t=Math.min(z.value,B.value),n=O.value===e.id&&N.value.hoverEffect.show?N.value.hoverEffect.multiplicator:1,r=(N.value.strokeWidth+N.value.borderWidth)*n,i=N.value.strokeWidth*n,a=N.value.strokeWidth/2*n;return{border:r/180*t,path:i/180*t,blur:a/180*t}}let q=b(!1);function bn(e){q.value=e,Et.value+=1}let xn=b(null);function Sn(){wt.value=!1,O.value=null,A.value=null,Rt.value=null}function Cn(e){if(!L.value||!e)return;let t=L.value.querySelector(`[data-a11y-serie-id="${e}"]`);if(!t)return;let n=t.getBoundingClientRect();zt.value={x:n.left+n.width/2,y:n.top+n.height/2}}function wn(e){M.value.events.datapointLeave&&M.value.events.datapointLeave({datapoint:e,seriesIndex:e.absoluteIndex}),(Rt.value!==e.id||Bt.value!==`keyboard`)&&(wt.value=!1,O.value=null)}function Tn(e){cn(`selectDatapoint`,e),M.value.events.datapointClick&&M.value.events.datapointClick({datapoint:e,seriesIndex:e.absoluteIndex})}function En({val:e,percentage:t,showVal:n,showPercentage:r}){let i=P.value.labels.dataLabels;return Pe({config:i,val:e,percentage:t,showVal:n,showPercentage:r})}function Dn({datapoint:e,_relativeIndex:t,seriesIndex:n,show:r=!1,triggerMode:i=`pointer`,flatIndex:a=null}){if(M.value.events.datapointEnter&&M.value.events.datapointEnter({datapoint:e,seriesIndex:e.absoluteIndex}),!R.value.showTooltip)return;Bt.value=i,A.value=a,Rt.value=e.id,xn.value={datapoint:e,seriesIndex:n,series:W.value,config:M.value},wt.value=r,O.value=e.id;let o=``,c=F.value.tooltip.customFormat;ee(c)&&ue(()=>c({seriesIndex:n,datapoint:e,series:W.value,config:M.value}))?Tt.value=c({seriesIndex:n,datapoint:e,series:W.value,config:M.value}):(o+=`<div style="width:100%;text-align:center;border-bottom:1px solid ${F.value.tooltip.borderColor};padding-bottom:6px;margin-bottom:3px;">${e.name}</div>`,o+=`<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>`,o+=`<b>${En({showVal:F.value.tooltip.showValue,showPercentage:F.value.tooltip.showPercentage,val:se(P.value.labels.dataLabels.formatter,e.value,s({p:P.value.labels.dataLabels.prefix,v:e.value,s:P.value.labels.dataLabels.suffix,r:F.value.tooltip.roundingValue}),{datapoint:e,seriesIndex:n}),percentage:s({v:e.proportion*100,s:`%`,r:F.value.tooltip.roundingPercentage})})}</b></div>`,Tt.value=`<div>${o}</div>`),i===`keyboard`&&Ue(()=>{Cn(e.id)})}let J=l(()=>W.value.map((e,t)=>{let n=se(P.value.labels.dataLabels.formatter,e.value,s({p:P.value.labels.dataLabels.prefix,v:e.value,s:P.value.labels.dataLabels.suffix,r:F.value.legend.roundingValue}),{datapoint:e,index:t}),r=isNaN(e.value/G.value)||H.value.includes(e.id)?`-`:s({v:e.value/G.value*100,s:`%`,r:F.value.legend.roundingPercentage}),i=En({showVal:F.value.legend.showValue,showPercentage:F.value.legend.showPercentage,val:n,percentage:r});return{...e,proportion:(e.value||0)/Gt.value.map(e=>(e.values||[]).reduce((e,t)=>e+t,0)).reduce((e,t)=>e+t,0),opacity:H.value.includes(e.id)?.5:1,shape:e.shape||`circle`,segregate:()=>U(e),isSegregated:H.value.includes(e.id),display:`${e.name}${F.value.legend.showPercentage||F.value.legend.showValue?`: `:``}${i}`}})),On=l(()=>({cy:`galaxy-div-legend`,backgroundColor:F.value.legend.backgroundColor,color:F.value.legend.color,fontSize:F.value.legend.fontSize,paddingBottom:12,fontWeight:F.value.legend.bold?`bold`:``})),Y=l(()=>({head:K.value.map(e=>({name:e.name,color:e.color})),body:K.value.map(e=>e.value)}));function kn(e=null){Ue(()=>{let t=Y.value.head.map((e,t)=>[[e.name],[Y.value.body[t]],[isNaN(Y.value.body[t]/G.value)?`-`:Y.value.body[t]/G.value*100]]),n=[[F.value.title.text],[F.value.title.subtitle.text],[[``],[`val`],[`%`]]].concat(t),r=c(n);e?e(r):le({csvContent:r,title:F.value.title.text||`vue-ui-galaxy`})})}let X=l(()=>{let e=[`__SUM__`,s({p:P.value.labels.dataLabels.prefix,v:G.value,s:P.value.labels.dataLabels.suffix,r:M.value.table.td.roundingValue}),`100%`],t=Y.value.head.map((e,t)=>{let n=s({p:P.value.labels.dataLabels.prefix,v:Y.value.body[t],s:P.value.labels.dataLabels.suffix,r:M.value.table.td.roundingValue});return[{color:e.color,name:e.name},n,isNaN(Y.value.body[t]/G.value)?`-`:s({v:Y.value.body[t]/G.value*100,s:`%`,r:M.value.table.td.roundingPercentage})]}),n={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};return{colNames:[M.value.table.columnNames.series,M.value.table.columnNames.value,M.value.table.columnNames.percentage],head:e,body:t,config:n}});function An(){R.value.showTable=!R.value.showTable}function jn(){R.value.showTooltip=!R.value.showTooltip}let Z=b(!1);function Mn(){Z.value=!Z.value}let Nn=Ne(D,()=>F.value.title.text),Q=l(()=>n({config:M,style:F,mutableConfig:R,dialog:St,accordion:_t,isFullscreen:q,parent:D,maxWidth:500,isCursorPointer:I}));Je(()=>R.value.showTable,e=>t(e,M,It));function Pn(){R.value.showTable=!1,Lt.value&&Lt.value.setTableIconState(!1)}let Fn=l(()=>J.value.map(e=>({...e,name:e.display}))),In=l(()=>F.value.backgroundColor),Ln=l(()=>F.value.legend),Rn=l(()=>F.value.title),{isCallbackImaging:zn,isCallbackSvg:Bn,generateSvg:Vn,onGenerateImage:Hn}=Se({svg:L,title:Rn,legend:Ln,legendItems:Fn,backgroundColor:In,getSvgCallback:()=>M.value.userOptions.callbacks.svg,generateImage:nn});async function Un(){if(cn(`copyAlt`,{config:M.value,dataset:W.value}),!M.value.userOptions.callbacks.altCopy){console.warn("Vue Data UI - A callback must be set for `altCopy` in userOptions.");return}await Promise.resolve(M.value.userOptions.callbacks.altCopy({config:M.value,dataset:W.value}))}function Wn(){A.value=null,Rt.value=null,j.value=!0}function Gn(){Sn(),j.value=!1}function Kn(e){if(!L.value||Z.value||document.activeElement!==L.value||!$.value.length)return;let t=e.key===`ArrowLeft`||e.key===`ArrowUp`,n=e.key===`ArrowRight`||e.key===`ArrowDown`,r=e.key===`Enter`||e.key===` `,i=e.key===`Escape`;if(!t&&!n&&!r&&!i)return;if(e.preventDefault(),e.stopPropagation(),i){Sn();return}if(r){if(A.value===null)return;let e=$.value[A.value];if(!e)return;Tn(e.datapoint);return}let a=A.value;a===null||a<0||a>=$.value.length?a=n?0:$.value.length-1:(a+=n?1:-1,a<0&&(a=$.value.length-1),a>=$.value.length&&(a=0));let o=$.value[a];o&&Dn({datapoint:o.datapoint,seriesIndex:o.datapoint.seriesIndex,show:!0,triggerMode:`keyboard`,flatIndex:a})}let qn=l(()=>({headers:X.value?.colNames??[],rows:X.value?.body??[]})),$=l(()=>K.value.map((e,t)=>({datapoint:e,index:t})));return Te({getData:mn,getImage:Nn,generatePdf:tn,generateCsv:kn,generateImage:nn,generateSvg:Vn,hideSeries:pn,showSeries:fn,toggleTable:An,toggleTooltip:jn,toggleAnnotator:Mn,toggleFullscreen:bn,copyAlt:Un}),(e,t)=>(y(),f(`div`,{ref_key:`galaxyChart`,ref:D,class:g(`vue-data-ui-component vue-ui-galaxy ${q.value?`vue-data-ui-wrapper-fullscreen`:``} ${M.value.useCssAnimation?``:`vue-ui-dna`} ${C(Wt)?`loading`:``}`),style:v(`font-family:${M.value.style.fontFamily};width:100%; text-align:center;${F.value.title.text?``:`padding-top:36px`};background:${F.value.backgroundColor}`),id:`galaxy_${E.value}`,onMouseenter:t[2]||=()=>C(Yt)(!0),onMouseleave:t[3]||=()=>{C(Yt)(!1),j.value||Sn()}},[p(`div`,{id:`chart-instructions-${E.value}`,class:`sr-only`},[p(`p`,null,S(M.value.a11y.translations.keyboardNavigation),1)],8,Ze),qn.value?.rows?.length?(y(),u(ke,{key:0,uid:E.value,head:qn.value.headers,body:qn.value.rows,notice:M.value.a11y.translations.tableAvailable,caption:M.value.a11y.translations.tableCaption},null,8,[`uid`,`head`,`body`,`notice`,`caption`])):d(``,!0),M.value.userOptions.buttons.annotator?(y(),u(C(yt),{key:1,svgRef:C(L),backgroundColor:F.value.backgroundColor,color:F.value.color,active:Z.value,isCursorPointer:I.value,palette:M.value.userOptions.annotatorPalette,onClose:Mn},ze({_:2},[Ge(C(i),t=>({name:t,fn:w(n=>[x(e.$slots,t,_(h(C(r)(t,n))),void 0,!0)])}))]),1032,[`svgRef`,`backgroundColor`,`color`,`active`,`isCursorPointer`,`palette`])):d(``,!0),rn.value?(y(),f(`div`,{key:2,ref_key:`noTitle`,ref:Nt,class:`vue-data-ui-no-title-space`,style:`height:36px; width: 100%;background:transparent`},null,512)):d(``,!0),F.value.title.text?(y(),f(`div`,{key:3,ref_key:`chartTitle`,ref:At,style:`width:100%;background:transparent;padding-bottom:24px`},[(y(),u(we,{key:`title_${Dt.value}`,config:{title:{cy:`galaxy-div-title`,...F.value.title},subtitle:{cy:`galaxy-div-subtitle`,...F.value.title.subtitle}}},null,8,[`config`]))],512)):d(``,!0),p(`div`,{id:`legend-top-${E.value}`},null,8,Qe),M.value.userOptions.show&&Vt.value&&(C(Xt)||C(Jt))?(y(),u(C(bt),{ref_key:`userOptionsRef`,ref:Lt,key:`user_option_${Et.value}`,backgroundColor:F.value.backgroundColor,color:F.value.color,isPrinting:C($t),isImaging:C(en),uid:E.value,hasTooltip:M.value.userOptions.buttons.tooltip&&F.value.tooltip.show,hasPdf:M.value.userOptions.buttons.pdf,hasXls:M.value.userOptions.buttons.csv,hasImg:M.value.userOptions.buttons.img,hasSvg:M.value.userOptions.buttons.svg,hasTable:M.value.userOptions.buttons.table,hasFullscreen:M.value.userOptions.buttons.fullscreen,hasAltCopy:M.value.userOptions.buttons.altCopy,isTooltip:R.value.showTooltip,isFullscreen:q.value,titles:{...M.value.userOptions.buttonTitles},chartElement:D.value,position:M.value.userOptions.position,hasAnnotator:M.value.userOptions.buttons.annotator,isAnnotation:Z.value,callbacks:M.value.userOptions.callbacks,printScale:M.value.userOptions.print.scale,tableDialog:M.value.table.useDialog,isCursorPointer:I.value,onToggleFullscreen:bn,onGeneratePdf:C(tn),onGenerateCsv:kn,onGenerateImage:C(Hn),onGenerateSvg:C(Vn),onToggleTable:An,onToggleTooltip:jn,onToggleAnnotator:Mn,onCopyAlt:Un,style:v({visibility:C(Xt)?C(Jt)?`visible`:`hidden`:`visible`})},ze({_:2},[Ge(C(a)(e.$slots,`menuIcon optionTooltip optionPdf optionCsv optionImg optionSvg optionTable optionFullscreen optionAnnotator optionAltCopy custom-menu-before custom-menu-after`),t=>({name:t,fn:w(n=>[x(e.$slots,t,_(h(C(o)(t,n))),void 0,!0)])}))]),1032,/* @__PURE__ */ `backgroundColor.color.isPrinting.isImaging.uid.hasTooltip.hasPdf.hasXls.hasImg.hasSvg.hasTable.hasFullscreen.hasAltCopy.isTooltip.isFullscreen.titles.chartElement.position.hasAnnotator.isAnnotation.callbacks.printScale.tableDialog.isCursorPointer.onGeneratePdf.onGenerateImage.onGenerateSvg.style`.split(`.`))):d(``,!0),p(`div`,$e,[(y(),f(`svg`,{ref_key:`svgRef`,ref:L,xmlns:C(de),"aria-describedby":`chart-instructions-${E.value}`,class:g({"vue-data-ui-fullscreen--on":q.value,"vue-data-ui-fulscreen--off":!q.value}),viewBox:V.value.viewBox,style:v(`max-width:100%; overflow: visible; background:transparent;color:${F.value.color}`),tabindex:`0`,onFocus:Wn,onBlur:Gn,onKeydown:Kn},[Ve(C(xt)),e.$slots[`chart-background`]?(y(),f(`foreignObject`,{key:0,x:0,y:0,width:V.value.width,height:V.value.height,style:{pointerEvents:`none`}},[x(e.$slots,`chart-background`,{},void 0,!0)],8,tt)):d(``,!0),p(`defs`,null,[p(`filter`,{id:`blur_${E.value}`,x:`-50%`,y:`-50%`,width:`200%`,height:`200%`},[p(`feGaussianBlur`,{in:`SourceGraphic`,stdDeviation:100/N.value.gradient.intensity},null,8,rt)],8,nt)]),(y(!0),f(Le,null,Ge(K.value,e=>(y(),f(`g`,{key:`dp_${e.id}`},[e.value?(y(),f(`path`,{key:0,d:e.path,fill:`none`,stroke:F.value.backgroundColor,"stroke-width":yn(e).border,class:g({"vue-data-ui-transition":C(Ht)}),"stroke-linecap":`round`},null,10,it)):d(``,!0),e.value?(y(),f(`path`,{key:1,d:e.path,fill:`none`,stroke:e.color,"stroke-width":yn(e).path,"stroke-linecap":`round`,class:g({"vue-data-ui-transition":C(Ht),"vue-ui-galaxy-blur":O.value&&O.value!==e.id&&M.value.useBlurOnHover})},null,10,at)):d(``,!0),e.value&&N.value.gradient.show?(y(),f(`g`,{key:2,filter:`url(#blur_${E.value})`},[p(`path`,{d:e.path,fill:`none`,stroke:N.value.gradient.color,"stroke-width":yn(e).blur,"stroke-linecap":`round`,class:g({"vue-ui-galaxy-gradient":!0,"vue-data-ui-transition":C(Ht),"vue-ui-galaxy-blur":O.value&&O.value!==e.id&&M.value.useBlurOnHover})},null,10,st)],8,ot)):d(``,!0)]))),128)),(y(!0),f(Le,null,Ge(K.value,(e,t)=>(y(),f(`g`,null,[e.value?(y(),f(`path`,{key:0,"data-a11y-serie-id":e.id,d:e.path,fill:`none`,stroke:`transparent`,"stroke-width":N.value.strokeWidth+N.value.borderWidth,"stroke-linecap":`round`,"aria-label":`${e.name}: ${C(s)({p:P.value.labels.dataLabels.prefix,v:e.value,s:P.value.labels.dataLabels.suffix,r:F.value.tooltip.roundingValue})}`,onMouseenter:n=>Dn({datapoint:e,relativeIndex:t,seriesIndex:e.seriesIndex,show:!0,triggerMode:`pointer`,flatIndex:t}),onMouseleave:t=>wn(e),onClick:t=>Tn(e)},null,40,ct)):d(``,!0)]))),256)),x(e.$slots,`svg`,{svg:{...V.value,isPrintingImg:C($t)||C(en)||C(zn),isPrintingSvg:C(Bn)}},void 0,!0)],46,et)),e.$slots.hint?(y(),f(`div`,lt,[x(e.$slots,`hint`,_(h({hint:M.value.a11y.translations.keyboardNavigation,isVisible:j.value})),void 0,!0)])):d(``,!0)]),e.$slots.watermark?(y(),f(`div`,ut,[x(e.$slots,`watermark`,_(h({isPrinting:C($t)||C(en)||C(zn)||C(Bn)})),void 0,!0)])):d(``,!0),p(`div`,{id:`legend-bottom-${E.value}`},null,8,dt),Ft.value&&(F.value.legend.show||e.$slots.legend)?(y(),u(Re,{key:6,to:F.value.legend.position===`top`?`#legend-top-${E.value}`:`#legend-bottom-${E.value}`},[p(`div`,{ref_key:`chartLegend`,ref:jt},[x(e.$slots,`legend`,{legend:J.value},()=>[F.value.legend.show?(y(),u(Fe,{key:`legend_${kt.value}`,legendSet:J.value,config:On.value,onClickMarker:t[0]||=({legend:e})=>U(e)},{item:w(({legend:e,index:t})=>[C(Wt)?d(``,!0):(y(),f(`div`,{key:0,onClick:t=>U(e),style:v(`opacity:${H.value.includes(e.id)?.5:1}`)},S(e.display),13,ft))]),legendToggle:w(()=>[J.value.length>2&&F.value.legend.selectAllToggle.show&&!C(Wt)?(y(),u(Oe,{key:0,backgroundColor:F.value.legend.selectAllToggle.backgroundColor,color:F.value.legend.selectAllToggle.color,fontSize:F.value.legend.fontSize,checked:H.value.length>0,onToggle:un},null,8,[`backgroundColor`,`color`,`fontSize`,`checked`])):d(``,!0)]),_:1},8,[`legendSet`,`config`])):d(``,!0)],!0)],512)],8,[`to`])):d(``,!0),e.$slots.source?(y(),f(`div`,{key:7,ref_key:`source`,ref:Mt,dir:`auto`},[x(e.$slots,`source`,{},void 0,!0)],512)):d(``,!0),Ve(C(ht),{teleportTo:F.value.tooltip.teleportTo,show:R.value.showTooltip&&wt.value,backgroundColor:F.value.tooltip.backgroundColor,color:F.value.tooltip.color,borderRadius:F.value.tooltip.borderRadius,borderColor:F.value.tooltip.borderColor,borderWidth:F.value.tooltip.borderWidth,fontSize:F.value.tooltip.fontSize,backgroundOpacity:F.value.tooltip.backgroundOpacity,position:F.value.tooltip.position,offsetX:F.value.tooltip.offsetX,offsetY:F.value.tooltip.offsetY,parent:D.value,content:Tt.value,isFullscreen:q.value,isCustom:C(ee)(F.value.tooltip.customFormat),smooth:F.value.tooltip.smooth,backdropFilter:F.value.tooltip.backdropFilter,smoothForce:F.value.tooltip.smoothForce,smoothSnapThreshold:F.value.tooltip.smoothSnapThreshold,isA11yMode:Bt.value===`keyboard`,a11yPosition:zt.value},{"tooltip-before":w(()=>[x(e.$slots,`tooltip-before`,_(h({...xn.value})),void 0,!0)]),tooltip:w(()=>[x(e.$slots,`tooltip`,_(h({...xn.value})),void 0,!0)]),"tooltip-after":w(()=>[x(e.$slots,`tooltip-after`,_(h({...xn.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`]),Vt.value&&M.value.userOptions.buttons.table?(y(),u(Ke(Q.value.component),He({key:8},Q.value.props,{ref_key:`tableUnit`,ref:It,onClose:Pn}),ze({content:w(()=>[(y(),u(C(vt),{key:`table_${Ot.value}`,colNames:X.value.colNames,head:X.value.head,body:X.value.body,config:X.value.config,title:M.value.table.useDialog?``:Q.value.title,withCloseButton:!M.value.table.useDialog,isCursorPointer:I.value,onClose:Pn},{th:w(({th:e})=>[e===`__SUM__`?(y(),f(`div`,pt,[Ve(C(gt),{name:`sigma`,stroke:X.value.config.th.color,size:16},null,8,[`stroke`])])):(y(),f(`div`,mt,S(e),1))]),td:w(({td:e})=>[Be(S(e.name||e),1)]),_:1},8,[`colNames`,`head`,`body`,`config`,`title`,`withCloseButton`,`isCursorPointer`]))]),_:2},[M.value.table.useDialog?{name:`title`,fn:w(()=>[Be(S(Q.value.title),1)]),key:`0`}:void 0,M.value.table.useDialog?{name:`actions`,fn:w(()=>[p(`button`,{tabindex:`0`,class:`vue-ui-user-options-button`,onClick:t[1]||=e=>kn(M.value.userOptions.callbacks.csv),style:v({cursor:I.value?`pointer`:`default`})},[Ve(C(gt),{name:`fileCsv`,stroke:Q.value.props.color},null,8,[`stroke`])],4)]),key:`1`}:void 0]),1040)):d(``,!0),x(e.$slots,`skeleton`,{},()=>[C(Wt)?(y(),u(xe,{key:0})):d(``,!0)],!0)],46,Xe))}},[[`__scopeId`,`data-v-fbbde348`]]);export{Ye as n,ht as t};