vue-data-ui 3.28.8 → 3.28.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (211) hide show
  1. package/dist/{PackageVersion-Bczw6rsP.js → PackageVersion-DKSNC-YP.js} +1 -1
  2. package/dist/StackChartTable-CZteRybF.js +1 -0
  3. package/dist/UserOptions-B9EyfU9n.js +1 -0
  4. package/dist/{XyAnalysisOptions-U4UJx51x.js → XyAnalysisOptions-CV22ga_a.js} +1 -1
  5. package/dist/components/vue-ui-3d-bar.js +1 -1
  6. package/dist/components/vue-ui-accordion.js +1 -1
  7. package/dist/components/vue-ui-age-pyramid.js +1 -1
  8. package/dist/components/vue-ui-annotator.js +1 -1
  9. package/dist/components/vue-ui-bullet.js +1 -1
  10. package/dist/components/vue-ui-bump.js +1 -1
  11. package/dist/components/vue-ui-candlestick.js +1 -1
  12. package/dist/components/vue-ui-carousel-table.js +1 -1
  13. package/dist/components/vue-ui-chestnut.js +1 -1
  14. package/dist/components/vue-ui-chord.js +1 -1
  15. package/dist/components/vue-ui-circle-pack.js +1 -1
  16. package/dist/components/vue-ui-cursor.js +1 -1
  17. package/dist/components/vue-ui-dag.js +1 -1
  18. package/dist/components/vue-ui-dashboard.js +1 -1
  19. package/dist/components/vue-ui-digits.js +1 -1
  20. package/dist/components/vue-ui-donut-evolution.js +1 -1
  21. package/dist/components/vue-ui-donut.js +1 -1
  22. package/dist/components/vue-ui-dumbbell.js +1 -1
  23. package/dist/components/vue-ui-flow.js +1 -1
  24. package/dist/components/vue-ui-funnel.js +1 -1
  25. package/dist/components/vue-ui-galaxy.js +1 -1
  26. package/dist/components/vue-ui-gauge.js +1 -1
  27. package/dist/components/vue-ui-geo.js +1 -1
  28. package/dist/components/vue-ui-gizmo.js +1 -1
  29. package/dist/components/vue-ui-graph.js +1 -1
  30. package/dist/components/vue-ui-heatmap.js +1 -1
  31. package/dist/components/vue-ui-hill.js +1 -1
  32. package/dist/components/vue-ui-history-plot.js +1 -1
  33. package/dist/components/vue-ui-horizontal-bar.js +1 -1
  34. package/dist/components/vue-ui-kpi.js +1 -1
  35. package/dist/components/vue-ui-label.js +1 -1
  36. package/dist/components/vue-ui-mini-loader.js +1 -1
  37. package/dist/components/vue-ui-molecule.js +1 -1
  38. package/dist/components/vue-ui-mood-radar.js +1 -1
  39. package/dist/components/vue-ui-nested-donuts.js +1 -1
  40. package/dist/components/vue-ui-onion.js +1 -1
  41. package/dist/components/vue-ui-parallel-coordinate-plot.js +1 -1
  42. package/dist/components/vue-ui-quadrant.js +1 -1
  43. package/dist/components/vue-ui-quick-chart.js +1 -1
  44. package/dist/components/vue-ui-radar.js +1 -1
  45. package/dist/components/vue-ui-rating.js +1 -1
  46. package/dist/components/vue-ui-relation-circle.js +1 -1
  47. package/dist/components/vue-ui-ridgeline.js +1 -1
  48. package/dist/components/vue-ui-rings.js +1 -1
  49. package/dist/components/vue-ui-scatter.js +1 -1
  50. package/dist/components/vue-ui-skeleton.js +1 -1
  51. package/dist/components/vue-ui-smiley.js +1 -1
  52. package/dist/components/vue-ui-spark-trend.js +1 -1
  53. package/dist/components/vue-ui-sparkbar.js +1 -1
  54. package/dist/components/vue-ui-sparkgauge.js +1 -1
  55. package/dist/components/vue-ui-sparkhistogram.js +1 -1
  56. package/dist/components/vue-ui-sparkline.js +1 -1
  57. package/dist/components/vue-ui-sparkstackbar.js +1 -1
  58. package/dist/components/vue-ui-stackbar.js +1 -1
  59. package/dist/components/vue-ui-stackline.js +1 -1
  60. package/dist/components/vue-ui-strip-plot.js +1 -1
  61. package/dist/components/vue-ui-table-heatmap.js +1 -1
  62. package/dist/components/vue-ui-table-sparkline.js +1 -1
  63. package/dist/components/vue-ui-table.js +1 -1
  64. package/dist/components/vue-ui-thermometer.js +1 -1
  65. package/dist/components/vue-ui-timer.js +1 -1
  66. package/dist/components/vue-ui-tiremarks.js +1 -1
  67. package/dist/components/vue-ui-treemap.js +1 -1
  68. package/dist/components/vue-ui-vertical-bar.js +1 -1
  69. package/dist/components/vue-ui-waffle.js +1 -1
  70. package/dist/components/vue-ui-wheel.js +1 -1
  71. package/dist/components/vue-ui-word-cloud.js +1 -1
  72. package/dist/components/vue-ui-world.js +1 -1
  73. package/dist/components/vue-ui-xy-canvas.js +1 -1
  74. package/dist/components/vue-ui-xy.js +1 -1
  75. package/dist/package-CXaebsLV.js +1 -0
  76. package/dist/{render-common-DY4sNXDz.js → render-common-Cy1X2PzP.js} +1 -1
  77. package/dist/ssr/vue-ui-donut.js +1 -1
  78. package/dist/ssr/vue-ui-xy.js +1 -1
  79. package/dist/ssr.js +1 -1
  80. package/dist/style.css +1 -1
  81. package/dist/{useConfig-By3Vb5kz.js → useConfig-C3FbHv4N.js} +1 -1
  82. package/dist/{useObjectBindings-0vvvimYP.js → useObjectBindings-C_70Czuj.js} +1 -1
  83. package/dist/{userOptionsSlots-DYuo-E5m.js → userOptionsSlots-CWtXN5Q6.js} +1 -1
  84. package/dist/utils.js +1 -1
  85. package/dist/vue-data-ui-O-w339Ac.js +1 -0
  86. package/dist/vue-data-ui.js +1 -1
  87. package/dist/vue-ui-3d-bar-CcFFARyq.js +19 -0
  88. package/dist/{vue-ui-accordion-DFxSW8ET.js → vue-ui-accordion-E8TJfFeK.js} +1 -1
  89. package/dist/vue-ui-age-pyramid-Di6fKV6f.js +1 -0
  90. package/dist/vue-ui-annotator-sBGtsgcb.js +331 -0
  91. package/dist/vue-ui-bullet-BZLa1xj7.js +34 -0
  92. package/dist/vue-ui-bump-BSdpAH0l.js +8 -0
  93. package/dist/vue-ui-candlestick-BKZASgq9.js +22 -0
  94. package/dist/vue-ui-carousel-table-B20E2K8A.js +1 -0
  95. package/dist/vue-ui-chestnut-DavvzmiQ.js +1 -0
  96. package/dist/vue-ui-chord-D2Hn54i7.js +21 -0
  97. package/dist/vue-ui-circle-pack-BKaS-zWo.js +13 -0
  98. package/dist/{vue-ui-cursor-DRQc_V2R.js → vue-ui-cursor-BUOHKNmb.js} +1 -1
  99. package/dist/vue-ui-dag-SLYPxbGo.js +9 -0
  100. package/dist/vue-ui-dashboard-Bgt7VLv0.js +1 -0
  101. package/dist/{vue-ui-digits-CfdB0vaP.js → vue-ui-digits-DbxT72mM.js} +1 -1
  102. package/dist/{vue-ui-donut-Dy4j7B9b.js → vue-ui-donut-8ZWyXEVs.js} +1 -1
  103. package/dist/vue-ui-donut-DBcB8Ym1.js +47 -0
  104. package/dist/vue-ui-donut-evolution-D3lo74Ce.js +2 -0
  105. package/dist/vue-ui-dumbbell-CdarkL8Z.js +9 -0
  106. package/dist/vue-ui-flow-B0dYxGWT.js +3 -0
  107. package/dist/vue-ui-funnel-C0Cl9jMd.js +1 -0
  108. package/dist/vue-ui-galaxy-C_UWOQn4.js +1 -0
  109. package/dist/vue-ui-gauge-B94ToHlW.js +1 -0
  110. package/dist/vue-ui-geo-V-JmJgKS.js +1 -0
  111. package/dist/{vue-ui-gizmo-D0QjzIGt.js → vue-ui-gizmo-BvVDEnNu.js} +1 -1
  112. package/dist/{vue-ui-graph-DScVnTzu.js → vue-ui-graph-9YSKwYhC.js} +1 -1
  113. package/dist/vue-ui-heatmap-DWtbocz5.js +1 -0
  114. package/dist/vue-ui-hill-BH_lYm5G.js +1 -0
  115. package/dist/vue-ui-history-plot-DkWvta0h.js +2 -0
  116. package/dist/vue-ui-horizontal-bar-DbJ1DFjG.js +4 -0
  117. package/dist/{vue-ui-kpi-CF7pAl08.js → vue-ui-kpi-BxW6DctE.js} +1 -1
  118. package/dist/{vue-ui-label-W0oz08pp.js → vue-ui-label-rxuzmeyD.js} +1 -1
  119. package/dist/{vue-ui-mini-loader-OLYDdN3T.js → vue-ui-mini-loader-DpAYrTYb.js} +1 -1
  120. package/dist/vue-ui-molecule-BrG8K2Tm.js +1 -0
  121. package/dist/vue-ui-mood-radar-DEpFpfiW.js +1 -0
  122. package/dist/vue-ui-nested-donuts-CZetOzaq.js +19 -0
  123. package/dist/vue-ui-onion-DvyAxUSj.js +5 -0
  124. package/dist/vue-ui-parallel-coordinate-plot-Bdakcv3w.js +9 -0
  125. package/dist/vue-ui-quadrant-CWZeQjHE.js +2 -0
  126. package/dist/vue-ui-quick-chart-BULxPrPs.js +16 -0
  127. package/dist/vue-ui-radar-CJ_5G0QP.js +1 -0
  128. package/dist/{vue-ui-rating-B9HeTCLa.js → vue-ui-rating-QcJoab0i.js} +1 -1
  129. package/dist/vue-ui-relation-circle-Vetly6f0.js +1 -0
  130. package/dist/vue-ui-ridgeline-5a87TiQf.js +2 -0
  131. package/dist/vue-ui-rings-CKuFf5vA.js +1 -0
  132. package/dist/vue-ui-scatter-C2hNg3ED.js +9 -0
  133. package/dist/{vue-ui-skeleton-an0peDis.js → vue-ui-skeleton-SlYTmirP.js} +1 -1
  134. package/dist/{vue-ui-smiley-Cht1imV-.js → vue-ui-smiley-DZVFOGfv.js} +1 -1
  135. package/dist/{vue-ui-spark-trend-DCP7blHB.js → vue-ui-spark-trend-D155vscB.js} +1 -1
  136. package/dist/{vue-ui-sparkbar-DT3sDgda.js → vue-ui-sparkbar-DFShNanl.js} +1 -1
  137. package/dist/{vue-ui-sparkgauge-AQt2L5dI.js → vue-ui-sparkgauge-CFj0wLj5.js} +1 -1
  138. package/dist/{vue-ui-sparkhistogram-a_jc2Dv2.js → vue-ui-sparkhistogram-DwDcqqEj.js} +1 -1
  139. package/dist/{vue-ui-sparkline-D2-KcHAU.js → vue-ui-sparkline-kxl5wQGY.js} +1 -1
  140. package/dist/{vue-ui-sparkstackbar-CBI4S5cu.js → vue-ui-sparkstackbar-CHjaAWVJ.js} +1 -1
  141. package/dist/vue-ui-stackbar-BrtUg-Mb.js +29 -0
  142. package/dist/vue-ui-stackline-CU2UkEJU.js +39 -0
  143. package/dist/vue-ui-strip-plot-BmEpoIoU.js +2 -0
  144. package/dist/vue-ui-table-Ddg209i0.js +14 -0
  145. package/dist/vue-ui-table-heatmap-B8AdX6Nq.js +1 -0
  146. package/dist/{vue-ui-table-sparkline-By319cB8.js → vue-ui-table-sparkline-B62l_ODH.js} +1 -1
  147. package/dist/vue-ui-thermometer-CvxyfTWE.js +1 -0
  148. package/dist/{vue-ui-timer-C6Pevf4N.js → vue-ui-timer-BkNtid9A.js} +2 -2
  149. package/dist/vue-ui-tiremarks-BE0nbuHp.js +1 -0
  150. package/dist/vue-ui-treemap-B9wAoh5g.js +1 -0
  151. package/dist/vue-ui-waffle-DqeBiuY3.js +1 -0
  152. package/dist/vue-ui-wheel---NZaS40.js +1 -0
  153. package/dist/vue-ui-word-cloud-DRFGFVmf.js +4 -0
  154. package/dist/vue-ui-world-D5gKzypf.js +19 -0
  155. package/dist/{vue-ui-xy-Df5gIADT.js → vue-ui-xy-Caj8jz6D.js} +1 -1
  156. package/dist/vue-ui-xy-CcVIXfL_.js +27 -0
  157. package/dist/vue-ui-xy-canvas-BceSG3AO.js +9 -0
  158. package/package.json +1 -1
  159. package/dist/UserOptions-DW84OKKr.js +0 -1
  160. package/dist/package-CNWVs68D.js +0 -1
  161. package/dist/vue-data-ui-BWqplouA.js +0 -1
  162. package/dist/vue-ui-3d-bar-DmRrbXjK.js +0 -19
  163. package/dist/vue-ui-age-pyramid-CJJIp5gY.js +0 -1
  164. package/dist/vue-ui-annotator-BnR2XnsL.js +0 -331
  165. package/dist/vue-ui-bullet-Br7H7FSM.js +0 -34
  166. package/dist/vue-ui-bump-DCDHNvWE.js +0 -8
  167. package/dist/vue-ui-candlestick-C_swW8gM.js +0 -22
  168. package/dist/vue-ui-carousel-table-BP_yVdDm.js +0 -1
  169. package/dist/vue-ui-chestnut-CIGNqBsT.js +0 -1
  170. package/dist/vue-ui-chord-DZRFBkRJ.js +0 -21
  171. package/dist/vue-ui-circle-pack-CtdPeMsY.js +0 -13
  172. package/dist/vue-ui-dag-Cj0CcntI.js +0 -9
  173. package/dist/vue-ui-dashboard-HyzHqAtX.js +0 -1
  174. package/dist/vue-ui-donut-Cv-bYyBN.js +0 -47
  175. package/dist/vue-ui-donut-evolution-DL112anx.js +0 -2
  176. package/dist/vue-ui-dumbbell-owG24VsQ.js +0 -9
  177. package/dist/vue-ui-flow-BMNIydqI.js +0 -3
  178. package/dist/vue-ui-funnel-BsVS3vuI.js +0 -1
  179. package/dist/vue-ui-galaxy-B8HgdBjc.js +0 -1
  180. package/dist/vue-ui-gauge-B1A_NFY6.js +0 -1
  181. package/dist/vue-ui-geo-_TG4jaV9.js +0 -1
  182. package/dist/vue-ui-heatmap-BbQseEbM.js +0 -1
  183. package/dist/vue-ui-hill-D3V84h_t.js +0 -1
  184. package/dist/vue-ui-history-plot-Bx4WYG6U.js +0 -2
  185. package/dist/vue-ui-horizontal-bar-Do0HJy4f.js +0 -4
  186. package/dist/vue-ui-molecule-bAMGCA2Y.js +0 -1
  187. package/dist/vue-ui-mood-radar-CFpgxjuR.js +0 -1
  188. package/dist/vue-ui-nested-donuts-CWY26iKX.js +0 -19
  189. package/dist/vue-ui-onion-DsBUqL_c.js +0 -5
  190. package/dist/vue-ui-parallel-coordinate-plot-BF3gO85b.js +0 -9
  191. package/dist/vue-ui-quadrant-BkNG2LGm.js +0 -2
  192. package/dist/vue-ui-quick-chart-CYxvgVpD.js +0 -17
  193. package/dist/vue-ui-radar-0H8CiLmc.js +0 -1
  194. package/dist/vue-ui-relation-circle-B0BM4xf8.js +0 -1
  195. package/dist/vue-ui-ridgeline-D-fDuE3y.js +0 -2
  196. package/dist/vue-ui-rings-UtlBiaZZ.js +0 -1
  197. package/dist/vue-ui-scatter-CduaARRt.js +0 -9
  198. package/dist/vue-ui-stackbar-DS_31-a3.js +0 -29
  199. package/dist/vue-ui-stackline-CuxohB0U.js +0 -39
  200. package/dist/vue-ui-strip-plot-bYGhsPA5.js +0 -2
  201. package/dist/vue-ui-table-heatmap-D6gpmHg8.js +0 -1
  202. package/dist/vue-ui-table-lzolsJ_n.js +0 -14
  203. package/dist/vue-ui-thermometer-B3Uv3aWc.js +0 -1
  204. package/dist/vue-ui-tiremarks-DeNdCFVD.js +0 -1
  205. package/dist/vue-ui-treemap-Ck9_llHA.js +0 -1
  206. package/dist/vue-ui-waffle-BW2SacnV.js +0 -1
  207. package/dist/vue-ui-wheel-BXDhx5bf.js +0 -1
  208. package/dist/vue-ui-word-cloud-DKPtoruY.js +0 -4
  209. package/dist/vue-ui-world-D9vpDbN7.js +0 -19
  210. package/dist/vue-ui-xy-CMckdUft.js +0 -27
  211. package/dist/vue-ui-xy-canvas-CBrKi3nN.js +0 -9
@@ -1,4 +1,4 @@
1
- import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{n as t,r as n,t as r}from"./annotationSlots-OLiW25XN.js";import{t as i}from"./useConfig-By3Vb5kz.js";import{D as a,Ht as o,J as s,X as c,in as l}from"./lib-rPeBMZrn.js";import{n as u,t as d}from"./BaseScanner-8NdoBs7B.js";import{n as f,t as ee}from"./useHints-C-TwxM0Y.js";import{t as te}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{n as ne}from"./resolveChartConfig-CIhClE5R.js";import{t as re}from"./chartImage-DPGnEuYM.js";import{t as ie}from"./vue_ui_graph-B1ACwQj7.js";import{t as ae}from"./BaseZoomControls-JSk9zW3D.js";import{n as oe}from"./Title-BliHuXfT.js";import{t as se}from"./useChartExport-BZts4KFb.js";import{t as ce}from"./tableIntegration-CNoJ1CIY.js";import{n as le,t as ue}from"./userOptionsSlots-DYuo-E5m.js";import{Fragment as p,TransitionGroup as de,computed as m,createBlock as fe,createCommentVNode as h,createElementBlock as g,createElementVNode as _,createSlots as pe,createTextVNode as me,createVNode as he,defineAsyncComponent as ge,guardReactiveProps as _e,mergeProps as ve,nextTick as ye,normalizeClass as be,normalizeProps as xe,normalizeStyle as Se,onBeforeUnmount as Ce,onMounted as we,openBlock as v,ref as y,renderList as b,renderSlot as x,resolveDynamicComponent as Te,shallowRef as Ee,toDisplayString as S,triggerRef as De,unref as C,useSlots as Oe,watch as w,withCtx as T,withKeys as ke,withModifiers as Ae}from"vue";var je={nodes:[[`center`,0,0,18],[`west`,-110,-65,15],[`east`,115,-45,16],[`south`,20,115,14],[`w1`,-190,-90,7],[`w2`,-145,-155,9],[`w3`,-65,-140,6],[`w4`,-195,-5,8],[`w5`,-115,25,6],[`e1`,70,-135,8],[`e2`,160,-130,6],[`e3`,205,-55,9],[`e4`,175,35,7],[`e5`,85,40,6],[`s1`,-65,95,8],[`s2`,-50,185,6],[`s3`,40,205,9],[`s4`,115,150,7],[`s5`,100,90,6]].map(([e,t,n,r])=>({id:`skeleton-${e}`,x:t,y:n,radius:r,fixed:!0})),links:[[`center`,`west`],[`center`,`east`],[`center`,`south`],[`west`,`w1`],[`west`,`w2`],[`west`,`w3`],[`west`,`w4`],[`west`,`w5`],[`w1`,`w2`],[`w2`,`w3`],[`w4`,`w5`],[`east`,`e1`],[`east`,`e2`],[`east`,`e3`],[`east`,`e4`],[`east`,`e5`],[`e1`,`e2`],[`e2`,`e3`],[`e4`,`e5`],[`south`,`s1`],[`south`,`s2`],[`south`,`s3`],[`south`,`s4`],[`south`,`s5`],[`s1`,`s2`],[`s2`,`s3`],[`s4`,`s5`],[`w3`,`e1`],[`w5`,`s1`],[`e5`,`s5`]].map(([e,t])=>({source:`skeleton-${e}`,target:`skeleton-${t}`}))},Me={animation:{enabled:!1},layout:{iterations:0},viewport:{initialFit:!0},userOptions:{show:!1},table:{show:!1},tooltip:{show:!1},events:{datapointEnter:null,datapointLeave:null,datapointClick:null},interaction:{zoom:{enabled:!1},pan:{enabled:!1},drag:{enabled:!1}},style:{chart:{backgroundColor:`#99999930`,controls:{show:!1},nodes:{colorByGroup:!1,color:`#BABABA`,stroke:`#CCCCCC`,sizeByValue:!1,sizeByDegree:!1,radius:10,gradient:!1,glow:{show:!1},labels:{show:!1}},links:{color:`#CCCCCC`,glow:!1,arrows:{show:!1,showOnHover:!1},pulses:{show:!1,showOnHover:!1}}}}},Ne=(e,t)=>Number.isFinite(e)?e:t;function Pe(e,t=/* @__PURE__ */ new Map,n,r=()=>{}){let i=[],a=/* @__PURE__ */ new Map,s=/* @__PURE__ */ new Map,c=/* @__PURE__ */ new Map;for(let n of e?.nodes||[]){if(!n||![`string`,`number`].includes(typeof n.id)||typeof n.id==`number`&&!Number.isFinite(n.id)||a.has(n.id)){r(`Ignored invalid or duplicate node ID`);continue}let e=t.get(n.id),o=i.length,l=o*2.399963229728653,u=20*Math.sqrt(o);c.has(n.group)||c.set(n.group,c.size);let d={...n,raw:n,x:e?.x??Ne(n.x,Math.cos(l)*u),y:e?.y??Ne(n.y,Math.sin(l)*u),vx:e?.vx||0,vy:e?.vy||0,pinned:!!n.fixed||!!e?.userPinned,userPinned:e?.userPinned,degree:0,index:o,groupIndex:c.get(n.group)};i.push(d),a.set(n.id,d),s.set(n.id,/* @__PURE__ */ new Set)}let l=[],u=/* @__PURE__ */ new Map;for(let t of e?.links||[]){let e=a.get(t?.source),n=a.get(t?.target);if(!e||!n){r(`Ignored link referencing an unknown node`);continue}e.degree+=1,n.degree+=1,s.get(e.id).add(n.id),s.get(n.id).add(e.id);let i=e.index,o=n.index,c=`${Math.min(i,o)}:${Math.max(i,o)}`,d={raw:t,source:e,target:n,index:l.length,strength:Math.min(3,Math.sqrt(Math.max(0,Ne(t.value,1)))),lane:0,direction:i<=o?1:-1};u.has(c)||u.set(c,[]),u.get(c).push(d),l.push(d)}for(let e of u.values())e.forEach((t,n)=>{t.lane=n-(e.length-1)/2,t.selfIndex=n});let d=n.customPalette?.length?n.customPalette:o,f=n.style.chart.nodes,ee=i.map(e=>Math.max(0,Ne(f.sizeByDegree?e.degree:e.value,0))),te=Math.max(1,...ee);return i.forEach((e,t)=>{e.radius=Math.max(.5,Ne(e.raw.radius,(f.sizeByValue||f.sizeByDegree)&&ee[t]>0?f.minRadius+Math.sqrt(ee[t]/te)*(f.maxRadius-f.minRadius):f.radius)),e.groupColor=f.colorByGroup?d[e.groupIndex%d.length]:f.color,e.color=e.raw.color||e.groupColor||f.color}),{nodes:i,links:l,byId:a,adjacency:s}}function Fe(e,t,n,r,i=0){let a={x:t,y:n,size:r,count:e.length,cx:0,cy:0};if(!e.length)return a;for(let t of e)a.cx+=t.x,a.cy+=t.y;if(a.cx/=e.length,a.cy/=e.length,e.length<=1||i>=20)return a.nodes=e,a;let o=r/2,s=[[],[],[],[]];for(let r of e)s[+(r.x>=t+o)+(r.y>=n+o?2:0)].push(r);a.children=[];for(let e=0;e<4;e++)s[e].length&&a.children.push(Fe(s[e],t+e%2*o,n+(e>1?o:0),o,i+1));return a}function Ie(e,t,n=1){let{nodes:r,links:i}=e;if(!r.length)return 0;let a=1/0,o=1/0,s=-1/0,c=-1/0,l=1;for(let e of r)a=Math.min(a,e.x),o=Math.min(o,e.y),s=Math.max(s,e.x),c=Math.max(c,e.y),l=Math.max(l,e.radius);let u=Fe(r,a,o,Math.max(s-a,c-o,1)+1),d=Math.max(0,-t.chargeStrength)*n*t.strength,f=t.theta*t.theta;function ee(e,t){if(!t.count)return;let n=e.x-t.cx,r=e.y-t.cy,i=n*n+r*r+4,a=e.x>=t.x&&e.x<=t.x+t.size&&e.y>=t.y&&e.y<=t.y+t.size;if(!t.nodes&&!a&&t.size*t.size<f*i)e.vx+=n*d*t.count/i,e.vy+=r*d*t.count/i;else if(t.nodes){for(let n of t.nodes)if(n!==e){let t=e.x-n.x||.01,r=e.y-n.y||.01,i=t*t+r*r+4;e.vx+=t*d/i,e.vy+=r*d/i}}else for(let n of t.children)ee(e,n)}let te=/* @__PURE__ */ new Map;if(t.clusterStrength)for(let e of r){let t=te.get(e.group)||{x:0,y:0,count:0};t.x+=e.x,t.y+=e.y,t.count+=1,te.set(e.group,t)}for(let e of r){ee(e,u),e.vx-=e.x*t.centerStrength*n,e.vy-=e.y*t.centerStrength*n;let r=te.get(e.group);r&&(e.vx+=(r.x/r.count-e.x)*t.clusterStrength*n,e.vy+=(r.y/r.count-e.y)*t.clusterStrength*n)}for(let e of i){if(e.source===e.target)continue;let r=e.target.x-e.source.x,i=e.target.y-e.source.y,a=Math.sqrt(r*r+i*i)||1,o=(a-t.linkDistance)*t.linkStrength*e.strength*n*t.strength/2,s=r/a*o,c=i/a*o,l=Math.max(1,e.source.degree),u=Math.max(1,e.target.degree);e.source.vx+=s/l,e.source.vy+=c/l,e.target.vx-=s/u,e.target.vy-=c/u}let ne=l*2+Math.max(0,t.collisionPadding),re=/* @__PURE__ */ new Map;for(let e of r){let n=Math.floor(e.x/ne),r=Math.floor(e.y/ne);for(let i=n-1;i<=n+1;i+=1){let n=re.get(i);if(n)for(let i=r-1;i<=r+1;i+=1){let r=n.get(i);if(r)for(let n of r){let r=e.x-n.x||.01,i=e.y-n.y||.01,a=r*r+i*i,o=e.radius+n.radius+t.collisionPadding;if(a<o*o){let t=Math.sqrt(a),s=(o-t)/t*.5;e.vx+=r*s,e.vy+=i*s,n.vx-=r*s,n.vy-=i*s}}}}let i=re.get(n);i||re.set(n,i=/* @__PURE__ */ new Map);let a=i.get(r);a||i.set(r,a=[]),a.push(e)}let ie=Math.max(0,t.centerStrength*n-.05),ae=1+t.friction*(ie+2*Math.sqrt(ie)),oe=0;for(let e of r)e.pinned?e.vx=e.vy=0:(e.vx=Math.max(-30,Math.min(30,e.vx*t.friction/ae)),e.vy=Math.max(-30,Math.min(30,e.vy*t.friction/ae)),e.x+=e.vx,e.y+=e.vy,oe+=e.vx*e.vx+e.vy*e.vy);return oe/r.length}function Le(e,t=e=>e){let n=(e,n)=>`${t(e)} ${t(n)}`,{source:r,target:i}=e;if(r===i){let t=r.radius+16+(e.selfIndex||0)*12,i=r.radius/Math.SQRT2;return`M ${n(r.x-i,r.y-i)} C ${n(r.x-t*2,r.y-t*3)} ${n(r.x+t*2,r.y-t*3)} ${n(r.x+i,r.y-i)}`}let a=i.x-r.x,o=i.y-r.y,s=Math.hypot(a,o)||1,c=e.lane*24*e.direction,l=(r.x+i.x)/2-o/s*c,u=(r.y+i.y)/2+a/s*c,d=Math.hypot(l-r.x,u-r.y)||1,f=Math.hypot(i.x-l,i.y-u)||1;return`M ${n(r.x+(l-r.x)/d*r.radius,r.y+(u-r.y)/d*r.radius)} Q ${n(l,u)} ${n(i.x-(i.x-l)/f*i.radius,i.y-(i.y-u)/f*i.radius)}`}var Re=/* @__PURE__ */ new Map,ze=/* @__PURE__ */ new Map,Be=8;function Ve(e,t){return JSON.stringify([t,e.nodes.map(e=>[e.x,e.y,e.vx,e.vy,e.radius,e.pinned,e.groupIndex]),e.links.map(e=>[e.source.index,e.target.index,e.strength])])}function E(e,t){e.nodes.forEach((e,n)=>{[e.x,e.y,e.vx,e.vy]=t[n]})}function He(e,t,n,{eager:r=!1}={}){let i=Ve(e,t),a=ze.get(i);if(a)return ze.delete(i),ze.set(i,a),E(e,a),n(),()=>{};let o=Re.get(i),s,c={graph:e,complete:n};if(!o){let n=e.nodes.map(e=>({...e}));o={graph:{nodes:n,links:e.links.map(e=>({...e,source:n[e.source.index],target:n[e.target.index]}))},config:{...t},listeners:/* @__PURE__ */ new Set,frame:null,iteration:0},Re.set(i,o);let r=()=>{o.frame=null;let e=performance.now(),t=1/0;for(;o.iteration<o.config.iterations&&(t=Ie(o.graph,o.config,Math.max(.015,1-o.iteration/Math.max(1,o.config.iterations))),o.iteration++,!(o.iteration>30&&t<.002||performance.now()-e>=8)););if(o.iteration>=o.config.iterations||o.iteration>30&&t<.002){let e=o.graph.nodes.map(e=>[e.x,e.y,e.vx,e.vy]);Re.delete(i),ze.set(i,e),ze.size>Be&&ze.delete(ze.keys().next().value);let t=[...o.listeners];o.listeners.clear();for(let n of t)E(n.graph,e),n.complete()}else o.frame=requestAnimationFrame(r)};s=r}return o.listeners.add(c),s&&(r?s():o.frame=requestAnimationFrame(s)),()=>{o.listeners.delete(c),!o.listeners.size&&Re.get(i)===o&&(o.frame!==null&&cancelAnimationFrame(o.frame),Re.delete(i))}}function Ue(e,t,n){return t!==null&&(e.source.id===t||e.target.id===t||!!(n?.has(e.source.id)&&n.has(e.target.id)))}function We(e,t,n=null,r=1,i){let a=/* @__PURE__ */ new Map;for(let o of e){let e=t.colorBySource?o.link.source.color:t.color||o.color,s=n!==null&&!Ue(o.link,n,i),c=t.opacity*(s?r:1),l=JSON.stringify([e,c]);a.has(l)||a.set(l,{key:l,color:e,opacity:c,items:[]}),a.get(l).items.push(o)}return[...a.values()]}function Ge(e,t,n,r,i=!1){let a=e.length,o=n*100/Math.max(1,r)*(i?-1:1),s=a>0?((t+o/a)%1+1)%1:0,c=s*a,l=e.points;for(let e=1;e<l.length;e++){let t=l[e-1],n=l[e],r=Math.hypot(n.x-t.x,n.y-t.y);if(c<=r&&r>0){let e=c/r;return{progress:s,x:t.x+(n.x-t.x)*e,y:t.y+(n.y-t.y)*e}}c-=r}return{progress:s,...l[l.length-1]}}var D=e=>Math.round(e*100)/100;function Ke(e,t){let n=Le(e,D),r,i;function a(){let t=n.match(/-?\d*\.?\d+(?:e[+-]?\d+)?/gi).map(Number),r=n.includes(` C `),i=[],a=r?24:e.lane?16:1;for(let e=0;e<=a;e++){let n=e/a,o=1-n;i.push(r?{x:o*o*o*t[0]+3*o*o*n*t[2]+3*o*n*n*t[4]+n*n*n*t[6],y:o*o*o*t[1]+3*o*o*n*t[3]+3*o*n*n*t[5]+n*n*n*t[7]}:{x:o*o*t[0]+2*o*n*t[2]+n*n*t[4],y:o*o*t[1]+2*o*n*t[3]+n*n*t[5]})}return i}let o=e.raw.color||t.color,s=e.raw.width??(t.widthByValue?Math.min(t.maxWidth,t.width*Math.sqrt(Math.max(0,e.raw.value??1))):t.width),c=!!(e.raw.directed||t.arrows.show||t.arrows.showOnHover),l=``;if(c){let e=n.match(/-?\d*\.?\d+(?:e[+-]?\d+)?/gi).map(Number),t=e.at(-2),r=e.at(-1),i=t-e.at(-4),a=r-e.at(-3),o=Math.hypot(i,a)||1,c=i/o,u=a/o,d=6*s,f=t-c*d,ee=r-u*d;l=`M ${D(t)} ${D(r)} L ${D(f-u*d/2)} ${D(ee+c*d/2)} L ${D(f+u*d/2)} ${D(ee-c*d/2)} Z`}return{link:e,d:n,arrowD:l,get points(){return r||=a()},get length(){if(i===void 0){let e=this.points;i=0;for(let t=1;t<e.length;t++)i+=Math.hypot(e[t].x-e[t-1].x,e[t].y-e[t-1].y)}return i},color:o,width:s,directed:c,key:JSON.stringify([o,s,c])}}function qe(e,t=()=>!0){let n=/* @__PURE__ */ new Map;for(let r of e){if(!t(r.link))continue;let e=n.get(r.key);e||(e={key:r.key,color:r.color,width:r.width,directed:r.directed,paths:[],arrows:[]},n.set(r.key,e)),e.paths.push(r.d),r.arrowD&&e.arrows.push(r.arrowD)}return[...n.values()].map(({paths:e,arrows:t,...n})=>({...n,d:e.join(` `),arrowD:t.join(` `)}))}function Je(e){let{x:t,y:n,radius:r}=e;return`M ${D(t-r)} ${D(n)} a ${D(r)} ${D(r)} 0 1 0 ${D(r*2)} 0 a ${D(r)} ${D(r)} 0 1 0 ${D(-r*2)} 0 Z`}function Ye(e,t=()=>!0){let n=/* @__PURE__ */ new Map;for(let r of e)t(r)&&(n.has(r.color)||n.set(r.color,[]),n.get(r.color).push(Je(r)));return[...n].map(([e,t])=>({color:e,d:t.join(` `)}))}function O(e,t,n){let r=n.x-t.x,i=n.y-t.y,a=r*r+i*i,o=a?Math.max(0,Math.min(1,((e.x-t.x)*r+(e.y-t.y)*i)/a)):0;return(e.x-t.x-o*r)**2+(e.y-t.y-o*i)**2}function Xe(e,t,n=48){let r=/* @__PURE__ */ new Map,i=/* @__PURE__ */ new Map,a=0;function o(e,t,n,r){let i=`${t}:${n}`;e.has(i)||e.set(i,[]),e.get(i).push(r)}for(let t of e)for(let e=Math.floor((t.x-t.radius)/n);e<=Math.floor((t.x+t.radius)/n);e++)for(let i=Math.floor((t.y-t.radius)/n);i<=Math.floor((t.y+t.radius)/n);i++)o(r,e,i,t);let s=!1;function c(){for(let e of t){a=Math.max(a,e.width);for(let t=1;t<e.points.length;t++){let r=e.points[t-1],a=e.points[t],s=Math.max(1,Math.ceil(Math.max(Math.abs(a.x-r.x),Math.abs(a.y-r.y))/n)),c={a:r,b:a,item:e},l;for(let e=0;e<=s;e++){let t=Math.floor((r.x+(a.x-r.x)*e/s)/n),u=Math.floor((r.y+(a.y-r.y)*e/s)/n),d=`${t}:${u}`;d!==l&&o(i,t,u,c),l=d}}}s=!0}function l(e,t,r){let i=/* @__PURE__ */ new Set;for(let a=Math.floor((t.x-r)/n);a<=Math.floor((t.x+r)/n);a++)for(let o=Math.floor((t.y-r)/n);o<=Math.floor((t.y+r)/n);o++)for(let t of e.get(`${a}:${o}`)||[])i.add(t);return i}return{nodeAt(e,t=0){let n=null;for(let i of l(r,e,t))(e.x-i.x)**2+(e.y-i.y)**2<=(i.radius+t)**2&&(!n||i.index>n.index)&&(n=i);return n},linkAt(e,t=4){s||c();let n=null,r=1/0;for(let o of l(i,e,t+a/2)){let i=O(e,o.a,o.b);i<=(t+o.item.width/2)**2&&i<r&&(r=i,n=o.item.link)}return n}}}function Ze(e){if(e==null)return``;try{return JSON.stringify(e)}catch{return String(e)}}function Qe(e,t){return{nodes:{head:[t.id,t.label,t.group,t.value,t.connections,t.metadata],body:e.nodes.map(e=>[e.id,{name:e.label??e.id,color:e.color},e.group??``,e.value??``,e.degree,Ze(e.metadata)])},links:{head:[t.source,t.target,t.label,t.value,t.directed,t.metadata],body:e.links.map(e=>[e.raw.source,e.raw.target,e.raw.label??``,e.raw.value??``,!!e.raw.directed,Ze(e.raw.metadata)])}}}function $e(e,t,n){let r=[[t.text],[t.subtitle?.text||``],[],[n.nodes],e.nodes.head,...e.nodes.body.map(e=>e.map(e=>e&&typeof e==`object`?e.name:e)),[],[n.links],e.links.head,...e.links.body];return a(r.map(e=>e.map(e=>`"${String(e??``).replaceAll(`"`,`""`)}"`)))}var k=/* @__PURE__ */ e({default:()=>Jt}),et=[`id`],tt={key:2,class:`vue-ui-graph-title`},nt=[`viewBox`,`aria-label`,`aria-busy`,`aria-describedby`,`tabindex`,`aria-activedescendant`],rt=[`id`],it=[`id`],at=[`stdDeviation`],ot={in:`blur`,result:`halo`},st=[`slope`],ct=[`id`],lt=[`stop-color`],ut=[`stop-color`],dt=[`fill`],ft=[`transform`],pt=[`filter`],mt=[`d`,`stroke`,`stroke-width`,`opacity`],ht=[`d`,`fill`,`opacity`],gt=[`opacity`],_t=[`d`,`stroke`,`stroke-width`],vt=[`d`,`fill`],yt=[`d`,`fill`,`opacity`],bt=[`fill`,`opacity`],xt={key:0,class:`vue-ui-graph-nodes vue-ui-graph-nodes-batched`,"pointer-events":`none`},St=[`stroke`,`stroke-width`,`filter`],Ct=[`d`,`fill`,`opacity`],wt=[`d`,`fill`,`opacity`],Tt=[`cx`,`cy`,`r`,`stroke`,`stroke-width`,`opacity`],Et=[`id`,`aria-label`,`aria-pressed`,`aria-describedby`],Dt=[`cx`,`cy`,`r`,`stroke`,`stroke-width`,`opacity`],Ot=[`cx`,`cy`,`r`,`stroke`],kt={key:1,class:`vue-ui-graph-nodes`},At=[`data-node-index`,`id`,`transform`,`opacity`,`aria-label`,`aria-pressed`,`aria-describedby`,`onPointerenter`,`onFocus`,`onPointerdown`,`onClick`,`onKeydown`],jt={key:0},Mt=[`r`,`fill`,`stroke`,`stroke-width`,`filter`],Nt=[`r`,`fill`],Pt={class:`vue-ui-graph-labels`,"pointer-events":`none`,"aria-hidden":`true`},Ft=[`stroke`,`stroke-width`,`x`,`y`,`font-size`,`fill`,`opacity`,`innerHTML`],It={key:4,style:{position:`absolute`,top:`100%`,left:`0`,width:`100%`},"data-dom-to-png-ignore":``,"aria-hidden":`true`},Lt={key:6,dir:`auto`},Rt={key:7,class:`vue-ui-graph-table-container`},zt=[`id`],Bt={class:`vue-ui-graph-tooltip-row`},Vt={key:0,class:`vue-ui-graph-tooltip-marker`,viewBox:`0 0 14 14`,"aria-hidden":`true`},Ht=[`fill`],Ut={key:0,class:`vue-ui-graph-tooltip-row`},Wt={class:`vue-ui-graph-tooltip-marker`,viewBox:`0 0 14 14`,"aria-hidden":`true`},Gt=[`fill`],Kt={key:1},qt={key:2,class:`vue-ui-graph-tooltip-metadata`},Jt=/*#__PURE__*/ te({__name:`vue-ui-graph`,props:{dataset:{type:Object,default:()=>({nodes:[],links:[]})},config:{type:Object,default:()=>({})}},emits:[`copyAlt`,`selectNode`,`hoverNode`,`zoom`,`zoomReset`,`layoutStart`,`layoutEnd`],setup(e,{expose:a,emit:o}){let te=ge(()=>import(`./PenAndPaper-DoNTA-SV.js`).then(e=>e.t)),Ne=ge(()=>import(`./Tooltip-C1q0Qoh7.js`)),Fe=ge(()=>import(`./UserOptions-DW84OKKr.js`).then(e=>e.n)),Le=ge(()=>import(`./DataTable-Dof6yhO7.js`)),Re=ge(()=>import(`./vue-ui-accordion-DFxSW8ET.js`).then(e=>e.n)),ze=ge(()=>import(`./BaseDraggableDialog-BK7dj9O6.js`).then(e=>e.n)),Be=ge(()=>import(`./PackageVersion-Bczw6rsP.js`).then(e=>e.t)),Ve=e,E=o,D=y(c()),O=y(null),k=y(null),Jt=y(!1),A=y(!1),Yt=m(()=>ne(Ve.config||{},i().vue_ui_graph,ie)),j=y(Yt.value);f({config:()=>j.value,dataset:()=>Ve.dataset,component:`VueUiGraph`,rules:[ee.noHint]});let Xt=m(()=>l({defaultConfig:l({defaultConfig:Yt.value,userConfig:Me}),userConfig:Ve.config?.skeletonConfig??{}})),{loading:M,FINAL_DATASET:Zt}=u({config:m(()=>Ve.config),dataset:m(()=>Ve.dataset?.nodes?.length?Ve.dataset:{}),skeletonDataset:Ve.config?.skeletonDataset??je,skeletonConfig:Xt.value,FINAL_CONFIG:j,prepareConfig:()=>Yt.value});w([Yt,Xt,M],()=>{j.value=M.value?Xt.value:Yt.value});let Qt=Oe(),N=m(()=>j.value.style.chart),$t=y(!1),P=y(!1),en=m(()=>M.value||$t.value||P.value),tn=m(()=>j.value.interaction.zoom.enabled&&!en.value);function nn(){$t.value=!$t.value,$t.value&&(X(),H&&H.type!==`node`&&(_n=H.moved,H=null,W.clear()))}let F=Ee({nodes:[],links:[],byId:/* @__PURE__ */ new Map,adjacency:/* @__PURE__ */ new Map}),rn=Ee(F.value),I=y(800),L=y(600),R=y({x:400,y:300,k:1}),z=Ee({x:400,y:300,k:1,width:800,height:600}),an=m(()=>R.value.k/z.value.k);function on(){U.value||=(z.value={...R.value,width:I.value,height:L.value},!0)}let B=y(null),sn=y(!1),V=y(null),cn=y(null),ln=y(`pointer`),un=null,dn=null,fn,pn,mn=!1,hn=0,gn=!1,_n=!1,H=null,vn=!1,yn=!0,bn=!1,U=y(!1),W=/* @__PURE__ */ new Map,xn=m(()=>B.value??(j.value.interaction.highlight.keepSelection?V.value:null)),Sn=m(()=>F.value.adjacency.get(xn.value)||/* @__PURE__ */ new Set),Cn=m(()=>F.value.nodes.length<=j.value.performance.effectThreshold),G=m(()=>!Qt.node&&F.value.nodes.length>j.value.performance.nodeBatchThreshold&&!(Cn.value&&N.value.nodes.gradient)),wn=m(()=>F.value.links.map(e=>Ke(e,N.value.links))),Tn=m(()=>qe(wn.value)),En=m(()=>{let e=N.value.links.pulses;return A.value?[]:e.showOnHover?B.value===null?[]:wn.value.filter(({link:e})=>Ue(e,B.value,j.value.interaction.highlight.neighbors?F.value.adjacency.get(B.value):void 0)):e.show?wn.value:[]}),Dn=y(null),On=/* @__PURE__ */ new Map,kn=/* @__PURE__ */ new Map,An=null,jn=null,Mn=m(()=>We(En.value,N.value.links.pulses,Ln.value?K.value:null,Rn.value,j.value.interaction.highlight.neighbors?In.value:void 0));function Nn(e){let t=/* @__PURE__ */ new Set,n=N.value.links.pulses;for(let r of Mn.value){let i=On.get(r.key);if(!i)continue;let a=[];for(let i of r.items){let r=i.link.index;t.add(r);let o=Ge(i,kn.get(r)??r*.61803398875%1,e,n.duration,n.reverse);kn.set(r,o.progress),a.push(Je({...o,radius:n.radius}))}i.setAttribute(`d`,a.join(` `))}for(let e of kn.keys())t.has(e)||kn.delete(e)}function Pn(e){An=null;let t=jn===null?0:Math.min(50,e-jn);jn=e,Nn(t),Dn.value&&Mn.value.length?An=requestAnimationFrame(Pn):jn=null}let Fn=m(()=>G.value?Ye(F.value.nodes):[]),K=y(null);w(xn,e=>{e!==null&&(K.value=e)},{immediate:!0});let In=m(()=>F.value.adjacency.get(K.value)||/* @__PURE__ */ new Set),Ln=m(()=>j.value.interaction.highlight.enabled&&xn.value!==null),Rn=m(()=>Ln.value?j.value.interaction.highlight.dimOpacity:1),zn=m(()=>K.value===null?[]:qe(wn.value,e=>Ue(e,K.value,j.value.interaction.highlight.neighbors?In.value:void 0))),Bn=m(()=>{if(!N.value.links.arrows.showOnHover||B.value===null)return[];let e=B.value,t=F.value.adjacency.get(e)||/* @__PURE__ */ new Set;return qe(wn.value,n=>Ue(n,e,j.value.interaction.highlight.neighbors?t:void 0))}),Vn=m(()=>!G.value||K.value===null?[]:Ye(F.value.nodes,e=>e.id===K.value||j.value.interaction.highlight.neighbors&&In.value.has(e.id)));w([Mn,Dn,()=>N.value.links.pulses.radius],()=>{Dn.value&&Mn.value.length?(Nn(0),An===null&&(An=requestAnimationFrame(Pn))):(An!==null&&cancelAnimationFrame(An),An=null,jn=null,kn.clear())},{flush:`post`});function Hn(e){let t=e*j.value.interaction.highlight.dimOpacity;return Ln.value?(e-t)/Math.max(1e-6,1-t):0}let Un=m(()=>F.value.byId.get(V.value)),q=m(()=>F.value.byId.get(B.value)),Wn=m(()=>{let e=F.value.nodes.filter((e,t)=>lr(e,t));if(!G.value)return e;let t=Math.max(1,N.value.nodes.labels.maxCount);return e.sort((e,t)=>Number(t.id===xn.value||t.id===V.value)-Number(e.id===xn.value||e.id===V.value)).slice(0,t)}),J=y(null),Gn=y(!1),Kn=null,qn=null,Jn=null,Yn=null;function Xn(e){if(!U.value)return{};let t=Ur(e),n=R.value,r={x:(t.x-n.x)/n.k,y:(t.y-n.y)/n.k};return qn!==F.value.nodes&&(Kn=Xe(F.value.nodes,[]),qn=F.value.nodes),{node:Kn.nodeAt(r,2/n.k)}}function Zn(e){if(P.value||H||!U.value)return;vn=!1;let t=e.target?.closest?.(`.vue-ui-graph-node`),n=(!G.value&&t?F.value.nodes[Number(t.dataset.nodeIndex)]:null)||Xn(e).node;n?(J.value=null,B.value===n.id?Kr(e,n):Z(n,e)):B.value!==null&&Z(null)}function Qn(e){P.value||(W.has(e.pointerId)?Yr(e):(Yn=e,Jn===null&&(Jn=requestAnimationFrame(()=>{Jn=null,Zn(Yn),Yn=null}))))}function $n(){Jn!==null&&cancelAnimationFrame(Jn),Jn=null,Yn=null,H||Z(null)}function er(e){if(G.value){let t=Xn(e);if(t.node){Jr(e,t.node);return}}Jr(e)}function tr(e){if(P.value)return;if(_n){_n=!1;return}let t=Xn(e);G.value&&t.node?Vr(t.node):Zr()}function nr(){if(!yn||P.value||!F.value.nodes.length||vn)return;Gn.value=!0;let e=F.value.byId.get(J.value)||Un.value||F.value.nodes[0];J.value=e.id,Z(e)}function rr(e){if(P.value)return;if([`ArrowRight`,`ArrowLeft`,`ArrowUp`,`ArrowDown`,`Home`,`End`,`Enter`,` `].includes(e.key)&&(vn=!1,Gn.value=!0),e.key===`Escape`){e.preventDefault(),e.stopPropagation(),J.value=null,Z(null),Hr();return}let t=F.value.nodes;if(!t.length)return;let n=Math.max(0,t.findIndex(e=>e.id===J.value));if([`ArrowRight`,`ArrowDown`,`ArrowLeft`,`ArrowUp`,`Home`,`End`].includes(e.key)){if(e.preventDefault(),e.key===`Home`)n=0;else if(e.key===`End`)n=t.length-1;else{let r=t[n],i=e.key===`ArrowRight`||e.key===`ArrowLeft`,a=e.key===`ArrowRight`||e.key===`ArrowDown`?1:-1,o=1/0,s=null;for(let e of t){let t=e.x-r.x,n=e.y-r.y;if((i?t:n)*a<=0)continue;let c=t*t+n*n;c<o&&(o=c,s=e)}if(!s){let e=1/0,n=1/0;for(let o of t){if(o===r)continue;let t=(i?o.x:o.y)*a,c=Math.abs(i?o.y-r.y:o.x-r.x);(t<e||t===e&&c<n)&&(e=t,n=c,s=o)}}s&&(n=s.index)}J.value=t[n].id,Z(t[n])}else(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),Vr(t[n]))}let Y=m(()=>F.value.byId.get(B.value)),ir=m(()=>({datapoint:Y.value?.raw,node:Y.value?.raw,connections:Y.value?.degree,config:j.value})),ar=m(()=>{let e=F.value.byId.get(B.value),t=k.value?.getBoundingClientRect();if(!e||!t)return{x:0,y:0};let n={x:e.x*R.value.k+R.value.x,y:e.y*R.value.k+R.value.y},r=k.value.getScreenCTM?.();return r?{x:r.a*n.x+r.c*n.y+r.e,y:r.b*n.x+r.d*n.y+r.f}:{x:t.left+(e.x*R.value.k+R.value.x)*(t.width/I.value),y:t.top+(e.y*R.value.k+R.value.y)*(t.height/L.value)}}),or=m(()=>{let e=Y.value;return e?typeof j.value.tooltip.customFormat==`function`?String(j.value.tooltip.customFormat(ir.value)):[e.label??e.id,e.group==null?``:`Group: ${e.group}`,e.value==null?``:`Value: ${e.value}`,`Connections: ${e.degree}`,j.value.tooltip.showMetadata&&e.metadata?Ze(e.metadata):``].filter(Boolean).join(`
1
+ import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{n as t,r as n,t as r}from"./annotationSlots-OLiW25XN.js";import{t as i}from"./useConfig-C3FbHv4N.js";import{D as a,Ht as o,J as s,X as c,in as l}from"./lib-rPeBMZrn.js";import{n as u,t as d}from"./BaseScanner-8NdoBs7B.js";import{n as f,t as ee}from"./useHints-C-TwxM0Y.js";import{t as te}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{n as ne}from"./resolveChartConfig-CIhClE5R.js";import{t as re}from"./chartImage-DPGnEuYM.js";import{t as ie}from"./vue_ui_graph-B1ACwQj7.js";import{t as ae}from"./BaseZoomControls-JSk9zW3D.js";import{n as oe}from"./Title-BliHuXfT.js";import{t as se}from"./useChartExport-BZts4KFb.js";import{t as ce}from"./tableIntegration-CNoJ1CIY.js";import{n as le,t as ue}from"./userOptionsSlots-CWtXN5Q6.js";import{Fragment as p,TransitionGroup as de,computed as m,createBlock as fe,createCommentVNode as h,createElementBlock as g,createElementVNode as _,createSlots as pe,createTextVNode as me,createVNode as he,defineAsyncComponent as ge,guardReactiveProps as _e,mergeProps as ve,nextTick as ye,normalizeClass as be,normalizeProps as xe,normalizeStyle as Se,onBeforeUnmount as Ce,onMounted as we,openBlock as v,ref as y,renderList as b,renderSlot as x,resolveDynamicComponent as Te,shallowRef as Ee,toDisplayString as S,triggerRef as De,unref as C,useSlots as Oe,watch as w,withCtx as T,withKeys as ke,withModifiers as Ae}from"vue";var je={nodes:[[`center`,0,0,18],[`west`,-110,-65,15],[`east`,115,-45,16],[`south`,20,115,14],[`w1`,-190,-90,7],[`w2`,-145,-155,9],[`w3`,-65,-140,6],[`w4`,-195,-5,8],[`w5`,-115,25,6],[`e1`,70,-135,8],[`e2`,160,-130,6],[`e3`,205,-55,9],[`e4`,175,35,7],[`e5`,85,40,6],[`s1`,-65,95,8],[`s2`,-50,185,6],[`s3`,40,205,9],[`s4`,115,150,7],[`s5`,100,90,6]].map(([e,t,n,r])=>({id:`skeleton-${e}`,x:t,y:n,radius:r,fixed:!0})),links:[[`center`,`west`],[`center`,`east`],[`center`,`south`],[`west`,`w1`],[`west`,`w2`],[`west`,`w3`],[`west`,`w4`],[`west`,`w5`],[`w1`,`w2`],[`w2`,`w3`],[`w4`,`w5`],[`east`,`e1`],[`east`,`e2`],[`east`,`e3`],[`east`,`e4`],[`east`,`e5`],[`e1`,`e2`],[`e2`,`e3`],[`e4`,`e5`],[`south`,`s1`],[`south`,`s2`],[`south`,`s3`],[`south`,`s4`],[`south`,`s5`],[`s1`,`s2`],[`s2`,`s3`],[`s4`,`s5`],[`w3`,`e1`],[`w5`,`s1`],[`e5`,`s5`]].map(([e,t])=>({source:`skeleton-${e}`,target:`skeleton-${t}`}))},Me={animation:{enabled:!1},layout:{iterations:0},viewport:{initialFit:!0},userOptions:{show:!1},table:{show:!1},tooltip:{show:!1},events:{datapointEnter:null,datapointLeave:null,datapointClick:null},interaction:{zoom:{enabled:!1},pan:{enabled:!1},drag:{enabled:!1}},style:{chart:{backgroundColor:`#99999930`,controls:{show:!1},nodes:{colorByGroup:!1,color:`#BABABA`,stroke:`#CCCCCC`,sizeByValue:!1,sizeByDegree:!1,radius:10,gradient:!1,glow:{show:!1},labels:{show:!1}},links:{color:`#CCCCCC`,glow:!1,arrows:{show:!1,showOnHover:!1},pulses:{show:!1,showOnHover:!1}}}}},Ne=(e,t)=>Number.isFinite(e)?e:t;function Pe(e,t=/* @__PURE__ */ new Map,n,r=()=>{}){let i=[],a=/* @__PURE__ */ new Map,s=/* @__PURE__ */ new Map,c=/* @__PURE__ */ new Map;for(let n of e?.nodes||[]){if(!n||![`string`,`number`].includes(typeof n.id)||typeof n.id==`number`&&!Number.isFinite(n.id)||a.has(n.id)){r(`Ignored invalid or duplicate node ID`);continue}let e=t.get(n.id),o=i.length,l=o*2.399963229728653,u=20*Math.sqrt(o);c.has(n.group)||c.set(n.group,c.size);let d={...n,raw:n,x:e?.x??Ne(n.x,Math.cos(l)*u),y:e?.y??Ne(n.y,Math.sin(l)*u),vx:e?.vx||0,vy:e?.vy||0,pinned:!!n.fixed||!!e?.userPinned,userPinned:e?.userPinned,degree:0,index:o,groupIndex:c.get(n.group)};i.push(d),a.set(n.id,d),s.set(n.id,/* @__PURE__ */ new Set)}let l=[],u=/* @__PURE__ */ new Map;for(let t of e?.links||[]){let e=a.get(t?.source),n=a.get(t?.target);if(!e||!n){r(`Ignored link referencing an unknown node`);continue}e.degree+=1,n.degree+=1,s.get(e.id).add(n.id),s.get(n.id).add(e.id);let i=e.index,o=n.index,c=`${Math.min(i,o)}:${Math.max(i,o)}`,d={raw:t,source:e,target:n,index:l.length,strength:Math.min(3,Math.sqrt(Math.max(0,Ne(t.value,1)))),lane:0,direction:i<=o?1:-1};u.has(c)||u.set(c,[]),u.get(c).push(d),l.push(d)}for(let e of u.values())e.forEach((t,n)=>{t.lane=n-(e.length-1)/2,t.selfIndex=n});let d=n.customPalette?.length?n.customPalette:o,f=n.style.chart.nodes,ee=i.map(e=>Math.max(0,Ne(f.sizeByDegree?e.degree:e.value,0))),te=Math.max(1,...ee);return i.forEach((e,t)=>{e.radius=Math.max(.5,Ne(e.raw.radius,(f.sizeByValue||f.sizeByDegree)&&ee[t]>0?f.minRadius+Math.sqrt(ee[t]/te)*(f.maxRadius-f.minRadius):f.radius)),e.groupColor=f.colorByGroup?d[e.groupIndex%d.length]:f.color,e.color=e.raw.color||e.groupColor||f.color}),{nodes:i,links:l,byId:a,adjacency:s}}function Fe(e,t,n,r,i=0){let a={x:t,y:n,size:r,count:e.length,cx:0,cy:0};if(!e.length)return a;for(let t of e)a.cx+=t.x,a.cy+=t.y;if(a.cx/=e.length,a.cy/=e.length,e.length<=1||i>=20)return a.nodes=e,a;let o=r/2,s=[[],[],[],[]];for(let r of e)s[+(r.x>=t+o)+(r.y>=n+o?2:0)].push(r);a.children=[];for(let e=0;e<4;e++)s[e].length&&a.children.push(Fe(s[e],t+e%2*o,n+(e>1?o:0),o,i+1));return a}function Ie(e,t,n=1){let{nodes:r,links:i}=e;if(!r.length)return 0;let a=1/0,o=1/0,s=-1/0,c=-1/0,l=1;for(let e of r)a=Math.min(a,e.x),o=Math.min(o,e.y),s=Math.max(s,e.x),c=Math.max(c,e.y),l=Math.max(l,e.radius);let u=Fe(r,a,o,Math.max(s-a,c-o,1)+1),d=Math.max(0,-t.chargeStrength)*n*t.strength,f=t.theta*t.theta;function ee(e,t){if(!t.count)return;let n=e.x-t.cx,r=e.y-t.cy,i=n*n+r*r+4,a=e.x>=t.x&&e.x<=t.x+t.size&&e.y>=t.y&&e.y<=t.y+t.size;if(!t.nodes&&!a&&t.size*t.size<f*i)e.vx+=n*d*t.count/i,e.vy+=r*d*t.count/i;else if(t.nodes){for(let n of t.nodes)if(n!==e){let t=e.x-n.x||.01,r=e.y-n.y||.01,i=t*t+r*r+4;e.vx+=t*d/i,e.vy+=r*d/i}}else for(let n of t.children)ee(e,n)}let te=/* @__PURE__ */ new Map;if(t.clusterStrength)for(let e of r){let t=te.get(e.group)||{x:0,y:0,count:0};t.x+=e.x,t.y+=e.y,t.count+=1,te.set(e.group,t)}for(let e of r){ee(e,u),e.vx-=e.x*t.centerStrength*n,e.vy-=e.y*t.centerStrength*n;let r=te.get(e.group);r&&(e.vx+=(r.x/r.count-e.x)*t.clusterStrength*n,e.vy+=(r.y/r.count-e.y)*t.clusterStrength*n)}for(let e of i){if(e.source===e.target)continue;let r=e.target.x-e.source.x,i=e.target.y-e.source.y,a=Math.sqrt(r*r+i*i)||1,o=(a-t.linkDistance)*t.linkStrength*e.strength*n*t.strength/2,s=r/a*o,c=i/a*o,l=Math.max(1,e.source.degree),u=Math.max(1,e.target.degree);e.source.vx+=s/l,e.source.vy+=c/l,e.target.vx-=s/u,e.target.vy-=c/u}let ne=l*2+Math.max(0,t.collisionPadding),re=/* @__PURE__ */ new Map;for(let e of r){let n=Math.floor(e.x/ne),r=Math.floor(e.y/ne);for(let i=n-1;i<=n+1;i+=1){let n=re.get(i);if(n)for(let i=r-1;i<=r+1;i+=1){let r=n.get(i);if(r)for(let n of r){let r=e.x-n.x||.01,i=e.y-n.y||.01,a=r*r+i*i,o=e.radius+n.radius+t.collisionPadding;if(a<o*o){let t=Math.sqrt(a),s=(o-t)/t*.5;e.vx+=r*s,e.vy+=i*s,n.vx-=r*s,n.vy-=i*s}}}}let i=re.get(n);i||re.set(n,i=/* @__PURE__ */ new Map);let a=i.get(r);a||i.set(r,a=[]),a.push(e)}let ie=Math.max(0,t.centerStrength*n-.05),ae=1+t.friction*(ie+2*Math.sqrt(ie)),oe=0;for(let e of r)e.pinned?e.vx=e.vy=0:(e.vx=Math.max(-30,Math.min(30,e.vx*t.friction/ae)),e.vy=Math.max(-30,Math.min(30,e.vy*t.friction/ae)),e.x+=e.vx,e.y+=e.vy,oe+=e.vx*e.vx+e.vy*e.vy);return oe/r.length}function Le(e,t=e=>e){let n=(e,n)=>`${t(e)} ${t(n)}`,{source:r,target:i}=e;if(r===i){let t=r.radius+16+(e.selfIndex||0)*12,i=r.radius/Math.SQRT2;return`M ${n(r.x-i,r.y-i)} C ${n(r.x-t*2,r.y-t*3)} ${n(r.x+t*2,r.y-t*3)} ${n(r.x+i,r.y-i)}`}let a=i.x-r.x,o=i.y-r.y,s=Math.hypot(a,o)||1,c=e.lane*24*e.direction,l=(r.x+i.x)/2-o/s*c,u=(r.y+i.y)/2+a/s*c,d=Math.hypot(l-r.x,u-r.y)||1,f=Math.hypot(i.x-l,i.y-u)||1;return`M ${n(r.x+(l-r.x)/d*r.radius,r.y+(u-r.y)/d*r.radius)} Q ${n(l,u)} ${n(i.x-(i.x-l)/f*i.radius,i.y-(i.y-u)/f*i.radius)}`}var Re=/* @__PURE__ */ new Map,ze=/* @__PURE__ */ new Map,Be=8;function Ve(e,t){return JSON.stringify([t,e.nodes.map(e=>[e.x,e.y,e.vx,e.vy,e.radius,e.pinned,e.groupIndex]),e.links.map(e=>[e.source.index,e.target.index,e.strength])])}function E(e,t){e.nodes.forEach((e,n)=>{[e.x,e.y,e.vx,e.vy]=t[n]})}function He(e,t,n,{eager:r=!1}={}){let i=Ve(e,t),a=ze.get(i);if(a)return ze.delete(i),ze.set(i,a),E(e,a),n(),()=>{};let o=Re.get(i),s,c={graph:e,complete:n};if(!o){let n=e.nodes.map(e=>({...e}));o={graph:{nodes:n,links:e.links.map(e=>({...e,source:n[e.source.index],target:n[e.target.index]}))},config:{...t},listeners:/* @__PURE__ */ new Set,frame:null,iteration:0},Re.set(i,o);let r=()=>{o.frame=null;let e=performance.now(),t=1/0;for(;o.iteration<o.config.iterations&&(t=Ie(o.graph,o.config,Math.max(.015,1-o.iteration/Math.max(1,o.config.iterations))),o.iteration++,!(o.iteration>30&&t<.002||performance.now()-e>=8)););if(o.iteration>=o.config.iterations||o.iteration>30&&t<.002){let e=o.graph.nodes.map(e=>[e.x,e.y,e.vx,e.vy]);Re.delete(i),ze.set(i,e),ze.size>Be&&ze.delete(ze.keys().next().value);let t=[...o.listeners];o.listeners.clear();for(let n of t)E(n.graph,e),n.complete()}else o.frame=requestAnimationFrame(r)};s=r}return o.listeners.add(c),s&&(r?s():o.frame=requestAnimationFrame(s)),()=>{o.listeners.delete(c),!o.listeners.size&&Re.get(i)===o&&(o.frame!==null&&cancelAnimationFrame(o.frame),Re.delete(i))}}function Ue(e,t,n){return t!==null&&(e.source.id===t||e.target.id===t||!!(n?.has(e.source.id)&&n.has(e.target.id)))}function We(e,t,n=null,r=1,i){let a=/* @__PURE__ */ new Map;for(let o of e){let e=t.colorBySource?o.link.source.color:t.color||o.color,s=n!==null&&!Ue(o.link,n,i),c=t.opacity*(s?r:1),l=JSON.stringify([e,c]);a.has(l)||a.set(l,{key:l,color:e,opacity:c,items:[]}),a.get(l).items.push(o)}return[...a.values()]}function Ge(e,t,n,r,i=!1){let a=e.length,o=n*100/Math.max(1,r)*(i?-1:1),s=a>0?((t+o/a)%1+1)%1:0,c=s*a,l=e.points;for(let e=1;e<l.length;e++){let t=l[e-1],n=l[e],r=Math.hypot(n.x-t.x,n.y-t.y);if(c<=r&&r>0){let e=c/r;return{progress:s,x:t.x+(n.x-t.x)*e,y:t.y+(n.y-t.y)*e}}c-=r}return{progress:s,...l[l.length-1]}}var D=e=>Math.round(e*100)/100;function Ke(e,t){let n=Le(e,D),r,i;function a(){let t=n.match(/-?\d*\.?\d+(?:e[+-]?\d+)?/gi).map(Number),r=n.includes(` C `),i=[],a=r?24:e.lane?16:1;for(let e=0;e<=a;e++){let n=e/a,o=1-n;i.push(r?{x:o*o*o*t[0]+3*o*o*n*t[2]+3*o*n*n*t[4]+n*n*n*t[6],y:o*o*o*t[1]+3*o*o*n*t[3]+3*o*n*n*t[5]+n*n*n*t[7]}:{x:o*o*t[0]+2*o*n*t[2]+n*n*t[4],y:o*o*t[1]+2*o*n*t[3]+n*n*t[5]})}return i}let o=e.raw.color||t.color,s=e.raw.width??(t.widthByValue?Math.min(t.maxWidth,t.width*Math.sqrt(Math.max(0,e.raw.value??1))):t.width),c=!!(e.raw.directed||t.arrows.show||t.arrows.showOnHover),l=``;if(c){let e=n.match(/-?\d*\.?\d+(?:e[+-]?\d+)?/gi).map(Number),t=e.at(-2),r=e.at(-1),i=t-e.at(-4),a=r-e.at(-3),o=Math.hypot(i,a)||1,c=i/o,u=a/o,d=6*s,f=t-c*d,ee=r-u*d;l=`M ${D(t)} ${D(r)} L ${D(f-u*d/2)} ${D(ee+c*d/2)} L ${D(f+u*d/2)} ${D(ee-c*d/2)} Z`}return{link:e,d:n,arrowD:l,get points(){return r||=a()},get length(){if(i===void 0){let e=this.points;i=0;for(let t=1;t<e.length;t++)i+=Math.hypot(e[t].x-e[t-1].x,e[t].y-e[t-1].y)}return i},color:o,width:s,directed:c,key:JSON.stringify([o,s,c])}}function qe(e,t=()=>!0){let n=/* @__PURE__ */ new Map;for(let r of e){if(!t(r.link))continue;let e=n.get(r.key);e||(e={key:r.key,color:r.color,width:r.width,directed:r.directed,paths:[],arrows:[]},n.set(r.key,e)),e.paths.push(r.d),r.arrowD&&e.arrows.push(r.arrowD)}return[...n.values()].map(({paths:e,arrows:t,...n})=>({...n,d:e.join(` `),arrowD:t.join(` `)}))}function Je(e){let{x:t,y:n,radius:r}=e;return`M ${D(t-r)} ${D(n)} a ${D(r)} ${D(r)} 0 1 0 ${D(r*2)} 0 a ${D(r)} ${D(r)} 0 1 0 ${D(-r*2)} 0 Z`}function Ye(e,t=()=>!0){let n=/* @__PURE__ */ new Map;for(let r of e)t(r)&&(n.has(r.color)||n.set(r.color,[]),n.get(r.color).push(Je(r)));return[...n].map(([e,t])=>({color:e,d:t.join(` `)}))}function O(e,t,n){let r=n.x-t.x,i=n.y-t.y,a=r*r+i*i,o=a?Math.max(0,Math.min(1,((e.x-t.x)*r+(e.y-t.y)*i)/a)):0;return(e.x-t.x-o*r)**2+(e.y-t.y-o*i)**2}function Xe(e,t,n=48){let r=/* @__PURE__ */ new Map,i=/* @__PURE__ */ new Map,a=0;function o(e,t,n,r){let i=`${t}:${n}`;e.has(i)||e.set(i,[]),e.get(i).push(r)}for(let t of e)for(let e=Math.floor((t.x-t.radius)/n);e<=Math.floor((t.x+t.radius)/n);e++)for(let i=Math.floor((t.y-t.radius)/n);i<=Math.floor((t.y+t.radius)/n);i++)o(r,e,i,t);let s=!1;function c(){for(let e of t){a=Math.max(a,e.width);for(let t=1;t<e.points.length;t++){let r=e.points[t-1],a=e.points[t],s=Math.max(1,Math.ceil(Math.max(Math.abs(a.x-r.x),Math.abs(a.y-r.y))/n)),c={a:r,b:a,item:e},l;for(let e=0;e<=s;e++){let t=Math.floor((r.x+(a.x-r.x)*e/s)/n),u=Math.floor((r.y+(a.y-r.y)*e/s)/n),d=`${t}:${u}`;d!==l&&o(i,t,u,c),l=d}}}s=!0}function l(e,t,r){let i=/* @__PURE__ */ new Set;for(let a=Math.floor((t.x-r)/n);a<=Math.floor((t.x+r)/n);a++)for(let o=Math.floor((t.y-r)/n);o<=Math.floor((t.y+r)/n);o++)for(let t of e.get(`${a}:${o}`)||[])i.add(t);return i}return{nodeAt(e,t=0){let n=null;for(let i of l(r,e,t))(e.x-i.x)**2+(e.y-i.y)**2<=(i.radius+t)**2&&(!n||i.index>n.index)&&(n=i);return n},linkAt(e,t=4){s||c();let n=null,r=1/0;for(let o of l(i,e,t+a/2)){let i=O(e,o.a,o.b);i<=(t+o.item.width/2)**2&&i<r&&(r=i,n=o.item.link)}return n}}}function Ze(e){if(e==null)return``;try{return JSON.stringify(e)}catch{return String(e)}}function Qe(e,t){return{nodes:{head:[t.id,t.label,t.group,t.value,t.connections,t.metadata],body:e.nodes.map(e=>[e.id,{name:e.label??e.id,color:e.color},e.group??``,e.value??``,e.degree,Ze(e.metadata)])},links:{head:[t.source,t.target,t.label,t.value,t.directed,t.metadata],body:e.links.map(e=>[e.raw.source,e.raw.target,e.raw.label??``,e.raw.value??``,!!e.raw.directed,Ze(e.raw.metadata)])}}}function $e(e,t,n){let r=[[t.text],[t.subtitle?.text||``],[],[n.nodes],e.nodes.head,...e.nodes.body.map(e=>e.map(e=>e&&typeof e==`object`?e.name:e)),[],[n.links],e.links.head,...e.links.body];return a(r.map(e=>e.map(e=>`"${String(e??``).replaceAll(`"`,`""`)}"`)))}var k=/* @__PURE__ */ e({default:()=>Jt}),et=[`id`],tt={key:2,class:`vue-ui-graph-title`},nt=[`viewBox`,`aria-label`,`aria-busy`,`aria-describedby`,`tabindex`,`aria-activedescendant`],rt=[`id`],it=[`id`],at=[`stdDeviation`],ot={in:`blur`,result:`halo`},st=[`slope`],ct=[`id`],lt=[`stop-color`],ut=[`stop-color`],dt=[`fill`],ft=[`transform`],pt=[`filter`],mt=[`d`,`stroke`,`stroke-width`,`opacity`],ht=[`d`,`fill`,`opacity`],gt=[`opacity`],_t=[`d`,`stroke`,`stroke-width`],vt=[`d`,`fill`],yt=[`d`,`fill`,`opacity`],bt=[`fill`,`opacity`],xt={key:0,class:`vue-ui-graph-nodes vue-ui-graph-nodes-batched`,"pointer-events":`none`},St=[`stroke`,`stroke-width`,`filter`],Ct=[`d`,`fill`,`opacity`],wt=[`d`,`fill`,`opacity`],Tt=[`cx`,`cy`,`r`,`stroke`,`stroke-width`,`opacity`],Et=[`id`,`aria-label`,`aria-pressed`,`aria-describedby`],Dt=[`cx`,`cy`,`r`,`stroke`,`stroke-width`,`opacity`],Ot=[`cx`,`cy`,`r`,`stroke`],kt={key:1,class:`vue-ui-graph-nodes`},At=[`data-node-index`,`id`,`transform`,`opacity`,`aria-label`,`aria-pressed`,`aria-describedby`,`onPointerenter`,`onFocus`,`onPointerdown`,`onClick`,`onKeydown`],jt={key:0},Mt=[`r`,`fill`,`stroke`,`stroke-width`,`filter`],Nt=[`r`,`fill`],Pt={class:`vue-ui-graph-labels`,"pointer-events":`none`,"aria-hidden":`true`},Ft=[`stroke`,`stroke-width`,`x`,`y`,`font-size`,`fill`,`opacity`,`innerHTML`],It={key:4,style:{position:`absolute`,top:`100%`,left:`0`,width:`100%`},"data-dom-to-png-ignore":``,"aria-hidden":`true`},Lt={key:6,dir:`auto`},Rt={key:7,class:`vue-ui-graph-table-container`},zt=[`id`],Bt={class:`vue-ui-graph-tooltip-row`},Vt={key:0,class:`vue-ui-graph-tooltip-marker`,viewBox:`0 0 14 14`,"aria-hidden":`true`},Ht=[`fill`],Ut={key:0,class:`vue-ui-graph-tooltip-row`},Wt={class:`vue-ui-graph-tooltip-marker`,viewBox:`0 0 14 14`,"aria-hidden":`true`},Gt=[`fill`],Kt={key:1},qt={key:2,class:`vue-ui-graph-tooltip-metadata`},Jt=/*#__PURE__*/ te({__name:`vue-ui-graph`,props:{dataset:{type:Object,default:()=>({nodes:[],links:[]})},config:{type:Object,default:()=>({})}},emits:[`copyAlt`,`selectNode`,`hoverNode`,`zoom`,`zoomReset`,`layoutStart`,`layoutEnd`],setup(e,{expose:a,emit:o}){let te=ge(()=>import(`./PenAndPaper-DoNTA-SV.js`).then(e=>e.t)),Ne=ge(()=>import(`./Tooltip-C1q0Qoh7.js`)),Fe=ge(()=>import(`./UserOptions-B9EyfU9n.js`).then(e=>e.n)),Le=ge(()=>import(`./DataTable-Dof6yhO7.js`)),Re=ge(()=>import(`./vue-ui-accordion-E8TJfFeK.js`).then(e=>e.n)),ze=ge(()=>import(`./BaseDraggableDialog-BK7dj9O6.js`).then(e=>e.n)),Be=ge(()=>import(`./PackageVersion-DKSNC-YP.js`).then(e=>e.t)),Ve=e,E=o,D=y(c()),O=y(null),k=y(null),Jt=y(!1),A=y(!1),Yt=m(()=>ne(Ve.config||{},i().vue_ui_graph,ie)),j=y(Yt.value);f({config:()=>j.value,dataset:()=>Ve.dataset,component:`VueUiGraph`,rules:[ee.noHint]});let Xt=m(()=>l({defaultConfig:l({defaultConfig:Yt.value,userConfig:Me}),userConfig:Ve.config?.skeletonConfig??{}})),{loading:M,FINAL_DATASET:Zt}=u({config:m(()=>Ve.config),dataset:m(()=>Ve.dataset?.nodes?.length?Ve.dataset:{}),skeletonDataset:Ve.config?.skeletonDataset??je,skeletonConfig:Xt.value,FINAL_CONFIG:j,prepareConfig:()=>Yt.value});w([Yt,Xt,M],()=>{j.value=M.value?Xt.value:Yt.value});let Qt=Oe(),N=m(()=>j.value.style.chart),$t=y(!1),P=y(!1),en=m(()=>M.value||$t.value||P.value),tn=m(()=>j.value.interaction.zoom.enabled&&!en.value);function nn(){$t.value=!$t.value,$t.value&&(X(),H&&H.type!==`node`&&(_n=H.moved,H=null,W.clear()))}let F=Ee({nodes:[],links:[],byId:/* @__PURE__ */ new Map,adjacency:/* @__PURE__ */ new Map}),rn=Ee(F.value),I=y(800),L=y(600),R=y({x:400,y:300,k:1}),z=Ee({x:400,y:300,k:1,width:800,height:600}),an=m(()=>R.value.k/z.value.k);function on(){U.value||=(z.value={...R.value,width:I.value,height:L.value},!0)}let B=y(null),sn=y(!1),V=y(null),cn=y(null),ln=y(`pointer`),un=null,dn=null,fn,pn,mn=!1,hn=0,gn=!1,_n=!1,H=null,vn=!1,yn=!0,bn=!1,U=y(!1),W=/* @__PURE__ */ new Map,xn=m(()=>B.value??(j.value.interaction.highlight.keepSelection?V.value:null)),Sn=m(()=>F.value.adjacency.get(xn.value)||/* @__PURE__ */ new Set),Cn=m(()=>F.value.nodes.length<=j.value.performance.effectThreshold),G=m(()=>!Qt.node&&F.value.nodes.length>j.value.performance.nodeBatchThreshold&&!(Cn.value&&N.value.nodes.gradient)),wn=m(()=>F.value.links.map(e=>Ke(e,N.value.links))),Tn=m(()=>qe(wn.value)),En=m(()=>{let e=N.value.links.pulses;return A.value?[]:e.showOnHover?B.value===null?[]:wn.value.filter(({link:e})=>Ue(e,B.value,j.value.interaction.highlight.neighbors?F.value.adjacency.get(B.value):void 0)):e.show?wn.value:[]}),Dn=y(null),On=/* @__PURE__ */ new Map,kn=/* @__PURE__ */ new Map,An=null,jn=null,Mn=m(()=>We(En.value,N.value.links.pulses,Ln.value?K.value:null,Rn.value,j.value.interaction.highlight.neighbors?In.value:void 0));function Nn(e){let t=/* @__PURE__ */ new Set,n=N.value.links.pulses;for(let r of Mn.value){let i=On.get(r.key);if(!i)continue;let a=[];for(let i of r.items){let r=i.link.index;t.add(r);let o=Ge(i,kn.get(r)??r*.61803398875%1,e,n.duration,n.reverse);kn.set(r,o.progress),a.push(Je({...o,radius:n.radius}))}i.setAttribute(`d`,a.join(` `))}for(let e of kn.keys())t.has(e)||kn.delete(e)}function Pn(e){An=null;let t=jn===null?0:Math.min(50,e-jn);jn=e,Nn(t),Dn.value&&Mn.value.length?An=requestAnimationFrame(Pn):jn=null}let Fn=m(()=>G.value?Ye(F.value.nodes):[]),K=y(null);w(xn,e=>{e!==null&&(K.value=e)},{immediate:!0});let In=m(()=>F.value.adjacency.get(K.value)||/* @__PURE__ */ new Set),Ln=m(()=>j.value.interaction.highlight.enabled&&xn.value!==null),Rn=m(()=>Ln.value?j.value.interaction.highlight.dimOpacity:1),zn=m(()=>K.value===null?[]:qe(wn.value,e=>Ue(e,K.value,j.value.interaction.highlight.neighbors?In.value:void 0))),Bn=m(()=>{if(!N.value.links.arrows.showOnHover||B.value===null)return[];let e=B.value,t=F.value.adjacency.get(e)||/* @__PURE__ */ new Set;return qe(wn.value,n=>Ue(n,e,j.value.interaction.highlight.neighbors?t:void 0))}),Vn=m(()=>!G.value||K.value===null?[]:Ye(F.value.nodes,e=>e.id===K.value||j.value.interaction.highlight.neighbors&&In.value.has(e.id)));w([Mn,Dn,()=>N.value.links.pulses.radius],()=>{Dn.value&&Mn.value.length?(Nn(0),An===null&&(An=requestAnimationFrame(Pn))):(An!==null&&cancelAnimationFrame(An),An=null,jn=null,kn.clear())},{flush:`post`});function Hn(e){let t=e*j.value.interaction.highlight.dimOpacity;return Ln.value?(e-t)/Math.max(1e-6,1-t):0}let Un=m(()=>F.value.byId.get(V.value)),q=m(()=>F.value.byId.get(B.value)),Wn=m(()=>{let e=F.value.nodes.filter((e,t)=>lr(e,t));if(!G.value)return e;let t=Math.max(1,N.value.nodes.labels.maxCount);return e.sort((e,t)=>Number(t.id===xn.value||t.id===V.value)-Number(e.id===xn.value||e.id===V.value)).slice(0,t)}),J=y(null),Gn=y(!1),Kn=null,qn=null,Jn=null,Yn=null;function Xn(e){if(!U.value)return{};let t=Ur(e),n=R.value,r={x:(t.x-n.x)/n.k,y:(t.y-n.y)/n.k};return qn!==F.value.nodes&&(Kn=Xe(F.value.nodes,[]),qn=F.value.nodes),{node:Kn.nodeAt(r,2/n.k)}}function Zn(e){if(P.value||H||!U.value)return;vn=!1;let t=e.target?.closest?.(`.vue-ui-graph-node`),n=(!G.value&&t?F.value.nodes[Number(t.dataset.nodeIndex)]:null)||Xn(e).node;n?(J.value=null,B.value===n.id?Kr(e,n):Z(n,e)):B.value!==null&&Z(null)}function Qn(e){P.value||(W.has(e.pointerId)?Yr(e):(Yn=e,Jn===null&&(Jn=requestAnimationFrame(()=>{Jn=null,Zn(Yn),Yn=null}))))}function $n(){Jn!==null&&cancelAnimationFrame(Jn),Jn=null,Yn=null,H||Z(null)}function er(e){if(G.value){let t=Xn(e);if(t.node){Jr(e,t.node);return}}Jr(e)}function tr(e){if(P.value)return;if(_n){_n=!1;return}let t=Xn(e);G.value&&t.node?Vr(t.node):Zr()}function nr(){if(!yn||P.value||!F.value.nodes.length||vn)return;Gn.value=!0;let e=F.value.byId.get(J.value)||Un.value||F.value.nodes[0];J.value=e.id,Z(e)}function rr(e){if(P.value)return;if([`ArrowRight`,`ArrowLeft`,`ArrowUp`,`ArrowDown`,`Home`,`End`,`Enter`,` `].includes(e.key)&&(vn=!1,Gn.value=!0),e.key===`Escape`){e.preventDefault(),e.stopPropagation(),J.value=null,Z(null),Hr();return}let t=F.value.nodes;if(!t.length)return;let n=Math.max(0,t.findIndex(e=>e.id===J.value));if([`ArrowRight`,`ArrowDown`,`ArrowLeft`,`ArrowUp`,`Home`,`End`].includes(e.key)){if(e.preventDefault(),e.key===`Home`)n=0;else if(e.key===`End`)n=t.length-1;else{let r=t[n],i=e.key===`ArrowRight`||e.key===`ArrowLeft`,a=e.key===`ArrowRight`||e.key===`ArrowDown`?1:-1,o=1/0,s=null;for(let e of t){let t=e.x-r.x,n=e.y-r.y;if((i?t:n)*a<=0)continue;let c=t*t+n*n;c<o&&(o=c,s=e)}if(!s){let e=1/0,n=1/0;for(let o of t){if(o===r)continue;let t=(i?o.x:o.y)*a,c=Math.abs(i?o.y-r.y:o.x-r.x);(t<e||t===e&&c<n)&&(e=t,n=c,s=o)}}s&&(n=s.index)}J.value=t[n].id,Z(t[n])}else(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),Vr(t[n]))}let Y=m(()=>F.value.byId.get(B.value)),ir=m(()=>({datapoint:Y.value?.raw,node:Y.value?.raw,connections:Y.value?.degree,config:j.value})),ar=m(()=>{let e=F.value.byId.get(B.value),t=k.value?.getBoundingClientRect();if(!e||!t)return{x:0,y:0};let n={x:e.x*R.value.k+R.value.x,y:e.y*R.value.k+R.value.y},r=k.value.getScreenCTM?.();return r?{x:r.a*n.x+r.c*n.y+r.e,y:r.b*n.x+r.d*n.y+r.f}:{x:t.left+(e.x*R.value.k+R.value.x)*(t.width/I.value),y:t.top+(e.y*R.value.k+R.value.y)*(t.height/L.value)}}),or=m(()=>{let e=Y.value;return e?typeof j.value.tooltip.customFormat==`function`?String(j.value.tooltip.customFormat(ir.value)):[e.label??e.id,e.group==null?``:`Group: ${e.group}`,e.value==null?``:`Value: ${e.value}`,`Connections: ${e.degree}`,j.value.tooltip.showMetadata&&e.metadata?Ze(e.metadata):``].filter(Boolean).join(`
2
2
  `):``});function sr(e){return xn.value===null||e===xn.value||j.value.interaction.highlight.neighbors&&Sn.value.has(e)}function cr(e){return j.value.interaction.highlight.enabled&&!sr(e)?j.value.interaction.highlight.dimOpacity:1}function lr(e,t){let n=N.value.nodes.labels;return!n.show||R.value.k<n.minZoom?!1:n.selectedOnly?e.id===V.value:e.id===xn.value||xn.value!==null&&Sn.value.has(e.id)?!0:!n.hoverOnly&&!n.selectedOnly&&t%Math.max(1,Math.ceil(F.value.nodes.length/Math.max(1,n.maxCount)))===0}function ur(e){let{labels:t,hover:n,selected:r,strokeWidth:i}=N.value.nodes,a=Math.max(5,i/2,n.strokeWidth/2,r.strokeWidth/2),o=e.radius+a+t.strokeWidth/2+t.fontSize*.6,s=(dr(e).split(`
3
3
  `).length-1)*t.fontSize;return(t.position===`top`?-o-s:o)+t.offsetY}function dr(e){let t=N.value.nodes.labels.maxLength;return String(e.label??e.id).replace(/\r\n?/g,`
4
4
  `).split(`
@@ -0,0 +1 @@
1
+ import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{n as t,r as n,t as r}from"./annotationSlots-OLiW25XN.js";import{t as i}from"./useConfig-C3FbHv4N.js";import{$ as a,D as o,Dt as s,Qt as c,Tt as l,X as u,at as d,b as f,i as p,in as ee,nt as te,on as ne,pt as re,r as ie,t as ae,yt as oe,zt as se}from"./lib-rPeBMZrn.js";import{n as ce,t as le}from"./BaseScanner-8NdoBs7B.js";import{n as ue,t as de}from"./useHints-C-TwxM0Y.js";import{t as fe}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{t as pe}from"./useNestedProp-DnGoh-XS.js";import{t as me}from"./useThemeCheck-BKNRbGeC.js";import{t as he}from"./img-D4RQwASc.js";import{n as ge}from"./Title-BliHuXfT.js";import{t as _e}from"./useChartExport-BZts4KFb.js";import{t as ve}from"./tableIntegration-CNoJ1CIY.js";import{n as ye,r as be,t as xe}from"./userOptionsSlots-CWtXN5Q6.js";import{t as Se}from"./useTimeLabels-Das5O74F.js";import{t as Ce}from"./usePrinter-DVf3YcG5.js";import{t as we}from"./useSvgLabelLayout-42Kats14.js";import{t as Te}from"./useTimeLabelCollider-BTybMUFi.js";import{t as Ee}from"./useResponsive-CENUxfEL.js";import{t as De}from"./vue-ui-accordion-E8TJfFeK.js";import{t as Oe}from"./A11yDataTable-DWNlWXzs.js";import{t as ke}from"./useUserOptionState-CXlFnwPv.js";import{t as Ae}from"./useChartAccessibility-DOMuYJfm.js";import{t as je}from"./useTableResponsive-uSz_qZOB.js";import{t as Me}from"./vue_ui_heatmap-kh5NMmwf.js";import{Fragment as m,computed as h,createBlock as Ne,createCommentVNode as g,createElementBlock as _,createElementVNode as v,createSlots as Pe,createTextVNode as Fe,createVNode as Ie,defineAsyncComponent as Le,guardReactiveProps as y,mergeProps as Re,nextTick as ze,normalizeClass as Be,normalizeProps as b,normalizeStyle as x,onBeforeUnmount as Ve,onMounted as He,openBlock as S,reactive as Ue,ref as C,renderList as w,renderSlot as T,resolveDynamicComponent as We,shallowRef as Ge,toDisplayString as E,toRefs as Ke,unref as D,useCssVars as qe,vShow as Je,watch as Ye,watchEffect as Xe,withCtx as O,withDirectives as Ze,withKeys as Qe}from"vue";var $e={mounted(e,t){et(e,t.value)},updated(e,t){et(e,t.value)}};function et(e,{cellWidth:t,cellHeight:n,maxFontSize:r,minFontSize:i,index:a,reportRotation:o,reportHide:s,rotateAll:c,hideAll:l}){e.removeAttribute(`transform`),e.removeAttribute(`visibility`);let u=!1,d=!1;e.setAttribute(`font-size`,r);let f=e.getComputedTextLength();if(f<=t)o(a,!1),s(a,!1);else{let n=Math.floor(r*t/f);n>=i?(e.setAttribute(`font-size`,n),o(a,!1),s(a,!1)):(o(a,!0),s(a,!1),u=!0)}if(c&&(u=!0),u){e.setAttribute(`font-size`,r);let t=e.getBBox(),o=t.x+t.width/2,c=t.y+t.height/2;e.setAttribute(`transform`,`rotate(-90 ${o} ${c})`);let l=e.getBBox().width;if(l<=n)s(a,!1);else{let t=Math.floor(r*n/l);t>=i?(e.setAttribute(`font-size`,t),s(a,!1)):(d=!0,s(a,!0))}}(l||d)&&e.setAttribute(`visibility`,`hidden`)}var tt=/* @__PURE__ */ e({default:()=>Nt}),nt=[`id`],rt=[`id`],it=[`xmlns`,`aria-describedby`,`viewBox`],at=[`x`,`y`,`width`,`height`],ot=[`x`,`y`,`height`,`width`,`fill`,`stroke`,`stroke-width`],st=[`x`,`y`,`height`,`width`,`fill`,`stroke`,`stroke-width`],ct=[`x`,`y`,`width`,`height`,`fill`,`stroke`,`stroke-width`],lt=[`data-a11y-cell-id`,`x`,`y`,`width`,`height`,`fill`,`stroke`,`stroke-width`,`aria-label`,`onMouseover`,`onMouseout`,`onClick`],ut=[`font-size`,`font-weight`,`fill`,`x`,`y`],dt=[`x`,`y`,`width`,`height`,`fill`,`stroke`,`stroke-width`],ft=[`x`,`y`,`width`,`height`,`fill`,`stroke`,`stroke-width`],pt=[`font-size`,`fill`,`x`,`y`,`font-weight`],mt=[`font-size`,`fill`,`x`,`y`,`font-weight`],ht=[`text-anchor`,`font-size`,`fill`,`font-weight`,`transform`],gt=[`text-anchor`,`font-size`,`fill`,`font-weight`,`transform`],_t={key:6},vt=[`x`,`y`,`width`,`height`,`stroke`,`stroke-width`],yt={key:7},bt=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`,`stroke-dasharray`],xt=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`,`stroke-dasharray`],St={class:`vue-ui-heatmap-legend-gauge-right`},Ct=[`data-value`],wt={class:`vue-ui-heatmap-gauge-indicator-value`},Tt={key:1,style:{position:`absolute`,top:`100%`,left:`0`,width:`100%`},"data-dom-to-png-ignore":``,"aria-hidden":`true`},Et={key:5,class:`vue-data-ui-watermark`},Dt={class:`vue-ui-data-table`},Ot={key:0},kt=[`data-cell`],At={style:{display:`flex`,"align-items":`center`,gap:`5px`,"justify-content":`flex-end`,width:`100%`,"padding-right":`3px`}},jt=[`data-cell`],Mt={style:{display:`flex`,"align-items":`center`,gap:`5px`,"justify-content":`flex-end`,width:`100%`,"padding-right":`3px`}},Nt=/*#__PURE__*/ fe({__name:`vue-ui-heatmap`,props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:[`selectDatapoint`,`copyAlt`],setup(e,{expose:fe,emit:et}){qe(e=>({v9a0dd666:e.tdo}));let tt=Le(()=>import(`./Tooltip-C1q0Qoh7.js`)),Nt=Le(()=>import(`./BaseIcon-CoY0vuL3.js`).then(e=>e.n)),Pt=Le(()=>import(`./PenAndPaper-DoNTA-SV.js`).then(e=>e.t)),Ft=Le(()=>import(`./UserOptions-B9EyfU9n.js`).then(e=>e.n)),It=Le(()=>import(`./PackageVersion-DKSNC-YP.js`).then(e=>e.t)),Lt=Le(()=>import(`./BaseDraggableDialog-BK7dj9O6.js`).then(e=>e.n)),{vue_ui_heatmap:Rt}=i(),{isThemeValid:zt,warnInvalidTheme:Bt}=me(),k=e,Vt=et,Ht=h({get(){return!!k.dataset&&k.dataset.length},set(e){return e}}),Ut=C(u()),A=C(null),Wt=C(!1),Gt=C(``),Kt=C(void 0),j=C(null),qt=C(0),Jt=C(null),Yt=C(0),Xt=C(null),Zt=C(null),Qt=C(null),$t=C(null),en=C(null),tn=C(null),nn=C(null),rn=C(null),an=C(null),on=C(null),sn=C(null),cn=C(null),ln=Ge(null),M=C(null),un=C(null),dn=C({x:0,y:0}),fn=C(`pointer`),pn=C(!1),N=C(Cn()),P=h(()=>N.value.style.layout.cells),F=h(()=>N.value.style.layout.dataLabels),I=h(()=>N.value.style.layout);ue({config:()=>N.value,dataset:()=>k.dataset,component:`VueUiHeatmap`,rules:[de.emptyArray,de.noHint]});let mn=h(()=>N.value.userOptions.useCursorPointer);function hn(){let e=Array(7).fill(`_`),t=[],n=e.length;for(let r=0;r<n;r+=1){let n=[];for(let e=0;e<14;e+=1)n.push(r+e*2);t.push({name:`${e[r]}`,values:n})}return t}let gn=h(()=>ee({defaultConfig:{table:{show:!1},userOptions:{show:!1},style:{backgroundColor:`#99999930`,layout:{cells:{colors:{hot:`#999999`,cold:`#CACACA`},columnTotal:{value:{show:!1}},rowTotal:{value:{show:!1}},value:{show:!1}},dataLabels:{xAxis:{show:!1},yAxis:{show:!1}}}}},userConfig:N.value.skeletonConfig??{}})),{loading:_n,FINAL_DATASET:L,manualLoading:vn}=ce({...Ke(k),FINAL_CONFIG:N,prepareConfig:Cn,callback:()=>{Promise.resolve().then(async()=>{await ze(),A.value&&ne(A.value,{delta:.1,delay:250})})},skeletonDataset:k.config?.skeletonDataset??hn(),skeletonConfig:ee({defaultConfig:N.value,userConfig:gn.value})}),{userOptionsVisible:yn,setUserOptionsVisibility:bn,keepUserOptionState:xn}=ke({config:N.value}),{svgRef:R}=Ae({config:N.value.style.title});function Sn(e){bn(e)}function Cn(){let e=pe({userConfig:k.config,defaultConfig:Rt}),t={},n=e.theme;if(n){if(!zt.value(e))Bt(e),t=e;else{let r=pe({userConfig:Me[n]||k.config,defaultConfig:e});t={...pe({userConfig:k.config,defaultConfig:r})}}}else t=e;return t}let wn=c(k.config);Ye(()=>k.config,(e,t)=>{let n=c(e),r=n!==wn;wn=n;let i=Cn();r?(_n.value||(N.value=i),yn.value=!N.value.userOptions.showOnChartHover,Pn(),Yt.value+=1,z.value.showTable=N.value.table.show,z.value.showTooltip=N.value.style.tooltip.show,N.value.responsive||(Fn.value=I.value.width,In.value=I.value.height)):(N.value.style.tooltip=i.style.tooltip,z.value.showTooltip=N.value.style.tooltip.show)},{deep:!0}),Ye(()=>k.dataset,e=>{Array.isArray(e)&&e.length>0&&(vn.value=!1),Pn()},{deep:!0});let{isPrinting:Tn,isImaging:En,generatePdf:Dn,generateImage:On}=Ce({elementId:`heatmap__${Ut.value}`,fileName:N.value.style.title.text||`vue-ui-heatmap`,options:N.value.userOptions.print}),kn=h(()=>N.value.userOptions.show&&!N.value.style.title.text),z=C({showTable:N.value.table.show,showTooltip:N.value.style.tooltip.show});Ye(N,()=>{z.value={showTable:N.value.table.show,showTooltip:N.value.style.tooltip.show}},{immediate:!0});let An=h(()=>N.value.table.responsiveBreakpoint),B=C(null),jn=C(!1),Mn=0,Nn=h(()=>N.value.debug);function Pn(){se(k.dataset)&&(d({componentName:`VueUiHeatmap`,type:`dataset`,debug:Nn.value}),Ht.value=!1,vn.value=!0),se(k.dataset)||(vn.value=N.value.loading),N.value.responsive&&(B.value&&(ln.value&&B.value.unobserve(ln.value),B.value.disconnect()),B.value=new ResizeObserver(()=>{let{width:e,height:t}=Ee({chart:A.value,title:N.value.style.title.text?$t.value:null,source:cn.value,noTitle:en.value});cancelAnimationFrame(Mn),Mn=requestAnimationFrame(()=>{Fn.value=e,In.value=t,jn.value=!0})}),ln.value=A.value.parentNode,B.value.observe(ln.value))}Ve(()=>{cancelAnimationFrame(Mn),B.value&&(ln.value&&B.value.unobserve(ln.value),B.value.disconnect())}),He(()=>{Pn()});let V=h(()=>Math.max(...L.value.flatMap(e=>(e.values||[]).length))),Fn=C(I.value.width),In=C(I.value.height),H=h(()=>({width:Math.max(10,Fn.value),height:Math.max(10,In.value)})),{metrics:Ln,ready:Rn,update:zn}=we({svgRef:R,canMeasure:()=>(!N.value.responsive||jn.value)&&(!(F.value.xAxis.show||P.value.columnTotal.value.show)||qn.value)&&(!F.value.yAxis.show||Kn.value),initialMetrics:{topLabelsHeight:0,leftLabelsWidth:0,xAxisSumLabelsHeight:0},measure:e=>({topLabelsHeight:e(an.value).height,leftLabelsWidth:e(nn.value).width,xAxisSumLabelsHeight:e(on.value).height})}),Bn=h(()=>Ln.value.topLabelsHeight),Vn=h(()=>Ln.value.leftLabelsWidth),Hn=h(()=>Ln.value.xAxisSumLabelsHeight),U=h(()=>Math.min(H.value.height,H.value.width)/1e3*P.value.spacing),W=h(()=>{let e=0;N.value.style.legend.show&&(e=N.value.style.legend.width);let t=I.value.padding,n=F.value.xAxis.fontSize/3,r=F.value.xAxis.fontSize/2,i=H.value.height-t.top-t.bottom-Bn.value-n,a=H.value.width/60,o={x:U.value*V.value,y:U.value*((L.value||[]).length+1)},s=H.value.width-t.left-t.right-o.x-a*2-2-e-Vn.value,c=i-a-o.y-Hn.value-r-P.value.columnTotal.value.offsetY,l={width:Math.max(3,s/V.value),height:Math.max(3,c/(L.value.length??1))};return{top:t.top+Bn.value+a+n,topLabelsHeight:Bn.value,sumCellXHeight:a,height:c,left:t.left+Vn.value+a/2,right:t.right-e,bottom:H.value.height-t.bottom-Hn.value,width:s,cellSize:l}}),Un=h(()=>Math.max(...L.value.flatMap(e=>e.values))),Wn=h(()=>Math.min(...L.value.flatMap(e=>e.values))),G=h(()=>P.value.scaleMax===null?Un.value:P.value.scaleMax),K=h(()=>P.value.scaleMin===null?Wn.value:P.value.scaleMin),q=h(()=>{let e=L.value.flatMap(e=>e.values);return e.reduce((e,t)=>e+t,0)/e.length}),Gn=C([]),Kn=C(!1),qn=C(!1),Jn=C([]),Yn=0;Xe(()=>{let e=++Yn;(async()=>{let t=F.value.yAxis,n=await Se({values:t.values.length?t.values:L.value.map(e=>e.name),maxDatapoints:L.value.length,formatter:t.datetimeFormatter,start:0,end:L.value.length});e===Yn&&(Gn.value=n,Kn.value=!0)})()});let Xn=0;Xe(()=>{let e=++Xn;(async()=>{let t=F.value.xAxis,n=await Se({values:t.values,maxDatapoints:V.value,formatter:t.datetimeFormatter,start:0,end:V.value});e===Xn&&(Jn.value=n,qn.value=!0)})()});function J(e,t,n){if(t===n)return P.value.colors.hot;let r=Math.min(Math.max(e,t),n);return l(P.value.colors.cold,P.value.colors.hot,t,n,r)}function Zn(e){if([void 0,null].includes(e))return 0;let t=K.value,n=G.value;if(t===n)return 0;let r=(e-t)/(n-t);return(1-Math.min(Math.max(r,0),1))*100}let Y=h(()=>{let e=Gn.value.map(e=>e.text),t=Jn.value.map(e=>e.text),n=P.value.scaleMin!==null||P.value.scaleMax!==null,r=L.value.map(e=>e.values.reduce((e,t)=>e+t,0)),i=L.value.map(e=>Math.max(1,e.values.length)),a=Math.max(...r),o=Math.min(...r),s=[],c=[];for(let e=0;e<V.value;e+=1){let t=0,n=0;L.value.forEach(r=>{e<r.values.length&&(t+=r.values[e]||0,n+=1)}),s.push(t),c.push(Math.max(1,n))}let l=Math.max(...s),u=Math.min(...s);return{yTotals:r.map((e,t)=>{let r=isNaN(e/a)?0:e/a,s=i[t],c=K.value*s,l=G.value*s;return{total:e,proportion:r,color:n?J(e,c,l):J(e,o,a)}}),xTotals:s.map((e,t)=>{let r=isNaN(e/l)?0:e/l,i=c[t],a=K.value*i,o=G.value*i;return{total:e,proportion:r,color:n?J(e,a,o):J(e,u,l)}}),yLabels:e,xLabels:t.slice(0,V.value)}}),X=h(()=>(L.value.forEach((e,t)=>{oe({datasetObject:e,requiredAttributes:[`values`]}).forEach(e=>{d({componentName:`VueUiHeatmap`,type:`datasetSerieAttribute`,property:`values`,index:t,debug:Nn.value})})}),L.value.map((e,t)=>({...e,temperatures:(e.values||[]).map((e,n)=>e>=q.value?{side:`up`,color:J(e,K.value,G.value),ratio:Math.abs(Math.abs(e-q.value)/Math.abs(Un.value-q.value))>1?1:Math.abs(Math.abs(e-q.value)/Math.abs(Un.value-q.value)),value:e,yAxisName:Y.value.yLabels[t],xAxisName:Y.value.xLabels[n],id:`vue-data-ui-heatmap-cell-${u()}`}:{side:`down`,ratio:Math.abs(1-Math.abs(e)/Math.abs(q.value))>1?1:Math.abs(1-Math.abs(e)/Math.abs(q.value)),color:J(e,K.value,G.value),value:e,yAxisName:Y.value.yLabels[t],xAxisName:Y.value.xLabels[n],id:`vue-data-ui-heatmap-cell-${u()}`})})))),Qn=h(()=>X.value.flatMap((e,t)=>e.temperatures.map((e,n)=>{let r=W.value.left+W.value.cellSize.width*n,i=W.value.top+W.value.cellSize.height*t;return{datapoint:e,rowIndex:t,columnIndex:n,x:r+U.value/2+W.value.sumCellXHeight,y:i+U.value/2,width:W.value.cellSize.width-U.value,height:W.value.cellSize.height-U.value,labelX:r+W.value.cellSize.width/2+W.value.sumCellXHeight,labelY:i+W.value.cellSize.height/2+P.value.value.fontSize/3,selectionX:r,selectionY:i}}))),$n=h(()=>L.value.length),er=Ue(Array($n.value*V.value||1).fill(!1)),tr=h(()=>er.some(e=>e));function nr(e,t){er[e]=t}let rr=Ue(Array($n.value*V.value||1).fill(!1)),ir=h(()=>rr.some(e=>e));function ar(e,t){rr[e]=t}let Z=C(null),or=C(null);function sr(){Wt.value=!1,Kt.value=void 0,Z.value=null,j.value=null,M.value=null,un.value=null}function cr(e){if(!R.value||!e)return;let t=R.value.querySelector(`[data-a11y-cell-id="${e}"]`);if(!t)return;let n=t.getBoundingClientRect();dn.value={x:n.left+n.width/2,y:n.top+n.height/2}}function lr(e,t,n,r,i=`pointer`,o=null){let c=W.value.cellSize.width-U.value,l={...e,x:n+c,y:r,width:W.value.cellSize.width-U.value,height:W.value.cellSize.height-U.value};if(N.value.events.datapointEnter&&N.value.events.datapointEnter({datapoint:l,seriesIndex:t}),!z.value.showTooltip)return;fn.value=i,M.value=o,un.value=e.id,j.value={x:n,y:r};let{value:u,yAxisName:d,xAxisName:f,id:ee}=e;Kt.value=ee,Z.value=u,or.value={datapoint:e,seriesIndex:t,series:X.value,config:N.value},Wt.value=!0;let te=``,ne=N.value.style.tooltip.customFormat;s(ne)&&re(()=>ne({datapoint:e,seriesIndex:t,series:X.value,config:N.value}))?Gt.value=ne({datapoint:e,seriesIndex:t,series:X.value,config:N.value}):(te+=`<div>${d} ${f?d?` - ${f}`:`${f}`:``}</div>`,te+=`<div style="margin-top:6px;padding-top:6px;border-top:1px solid ${N.value.style.tooltip.borderColor};font-weight:bold;display:flex;flex-direction:row;gap:12px;align-items:center;justify-content:center"><span style="color:${J(u,K.value,G.value)}">⬤</span><span>${isNaN(u)?`-`:p(P.value.value.formatter,u,a({p:F.value.prefix,v:u,s:F.value.suffix,r:N.value.style.tooltip.roundingValue}),{datapoint:e,seriesIndex:t})}</span></div>`,Gt.value=`<div style="font-size:${N.value.style.tooltip.fontSize}px">${te}</div>`),i===`keyboard`&&ze(()=>{cr(e.id)})}function ur({datapoint:e,seriesIndex:t}){N.value.events.datapointLeave&&N.value.events.datapointLeave({datapoint:e,seriesIndex:t}),(un.value!==e.id||fn.value!==`keyboard`)&&(Wt.value=!1,Kt.value=void 0,Z.value=null,j.value=null)}function dr(e){return p(P.value.value.formatter,Y.value.yTotals[e].total,a({p:F.value.prefix,v:Y.value.yTotals[e].total,s:F.value.suffix,r:P.value.value.roundingValue}),{datapoint:Y.value.yTotals[e],rowIndex:e})}function fr(e){return p(P.value.value.formatter,Y.value.xTotals[e].total,a({p:F.value.prefix,v:Y.value.xTotals[e].total,s:F.value.suffix,r:P.value.value.roundingValue}),{datapoint:Y.value.xTotals[e],colIndex:e})}h(()=>({head:L.value.map(e=>({name:e.name})),body:L.value.map(e=>e.values)}));function pr(e=null){ze(()=>{let t=[``,...L.value.map((e,t)=>e.name)],n=[];for(let e=0;e<Y.value.xLabels.length;e+=1){let t=[Y.value.xLabels[e]];for(let n=0;n<L.value.length;n+=1)t.push([L.value[n].values[e]]);n.push(t)}let r=[[N.value.style.title.text],[N.value.style.title.subtitle.text],[[``],[``],[``]],t].concat(n),i=o(r);e?e(i):te({csvContent:i,title:N.value.style.title.text||`vue-ui-heatmap`})})}let Q=C(!1);function mr(e){Q.value=e,qt.value+=1}function hr(){z.value.showTable=!z.value.showTable}function gr(){z.value.showTooltip=!z.value.showTooltip}let _r=C(!1);function vr(){_r.value=!_r.value}function yr(e,t){N.value.events.datapointClick&&N.value.events.datapointClick({datapoint:e,seriesIndex:t}),Vt(`selectDatapoint`,e)}function br(){return X.value}async function xr({scale:e=2}={}){if(!A.value)return;let{width:t,height:n}=A.value.getBoundingClientRect(),r=t/n,{imageUri:i,base64:a}=await he({domElement:A.value,base64:!0,img:!0,scale:e});return{imageUri:i,base64:a,title:N.value.style.title.text,width:t,height:n,aspectRatio:r}}let Sr=h(()=>({start:0,end:V.value})),Cr=h(()=>Y.value.xLabels);Te({timeLabelsEls:an,timeLabels:Cr,slicer:Sr,configRef:N,rotationPath:[`style`,`layout`,`dataLabels`,`xAxis`,`rotation`],autoRotatePath:[`style`,`layout`,`dataLabels`,`xAxis`,`autoRotate`,`enable`],isAutoSize:!1,targetClass:`.vue-ui-heatmap-col-name`,rotation:F.value.xAxis.autoRotate.angle,width:Fn,height:In}),Te({timeLabelsEls:on,timeLabels:Cr,slicer:Sr,configRef:N,rotationPath:[`style`,`layout`,`cells`,`columnTotal`,`value`,`rotation`],autoRotatePath:[`style`,`layout`,`cells`,`columnTotal`,`value`,`autoRotate`,`enable`],isAutoSize:!1,targetClass:`.vue-ui-heatmap-col-total`,rotation:P.value.columnTotal.value.autoRotate.angle,width:Fn,height:In});let wr=h(()=>ve({config:N,style:{value:N.value.style},mutableConfig:z,dialog:Lt,accordion:De,isFullscreen:Q,parent:A,maxWidth:800,isCursorPointer:mn}));Ye(()=>z.value.showTable,async e=>{N.value.table.show||(e&&N.value.table.useDialog&&Zt.value?(await ze(),Zt.value.open()):`close`in Zt.value&&Zt.value.close())});let{isResponsive:Tr}=je(Jt,An);function Er(){z.value.showTable=!1,Qt.value&&Qt.value.setTableIconState(!1)}let Dr=h(()=>N.value.style.backgroundColor),Or=h(()=>N.value.style.title),{isCallbackImaging:kr,isCallbackSvg:Ar,generateSvg:jr,onGenerateImage:Mr}=_e({svg:R,title:Or,legend:null,legendItems:null,backgroundColor:Dr,getSvgCallback:()=>N.value.userOptions.callbacks.svg,generateImage:On});async function Nr(){Vt(`copyAlt`,{config:N.value,dataset:X.value}),N.value.userOptions.callbacks.altCopy?await Promise.resolve(N.value.userOptions.callbacks.altCopy({config:N.value,dataset:X.value})):console.warn("Vue Data UI - A callback must be set for `altCopy` in userOptions.")}function Pr(e,t){let n=X.value[e];if(!n)return null;let r=n.temperatures[t];return r?{cell:r,rowIndex:e,columnIndex:t}:null}function Fr(e,t){let n=0;for(let t=0;t<e;t+=1)n+=X.value[t]?.temperatures?.length||0;return n+t}function Ir(){M.value=null,un.value=null,pn.value=!0}function Lr(){sr(),pn.value=!1}function Rr(e){if(!R.value||_r.value||document.activeElement!==R.value||!$.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){sr();return}if(a){if(M.value===null)return;let e=$.value[M.value];if(!e)return;yr(e.cell,e.rowIndex);return}let s=M.value===null?null:$.value[M.value];if(!s){let e=Kt.value?$.value.findIndex(e=>e.cell.id===Kt.value):null;if(e!==null&&e>=0&&e<$.value.length){let a=$.value[e];if(!a)return;let o=a.rowIndex,s=a.columnIndex;n?s+=1:t?--s:i?o+=1:r&&--o;let c=Br.value.rowCount;if(c<=0)return;o<0&&(o=c-1),o>=c&&(o=0);let l=X.value[o];if(!l||!l.temperatures.length)return;let u=l.temperatures.length;s<0&&(s=u-1),s>=u&&(s=0);let d=Pr(o,s);if(!d)return;let f=Fr(o,s),p=W.value.left+W.value.cellSize.width*d.columnIndex,ee=W.value.top+W.value.cellSize.height*d.rowIndex;lr(d.cell,d.rowIndex,p,ee,`keyboard`,f);return}let a=$.value[0];if(!a)return;let o=W.value.left+W.value.cellSize.width*a.columnIndex,s=W.value.top+W.value.cellSize.height*a.rowIndex;lr(a.cell,a.rowIndex,o,s,`keyboard`,0);return}let c=s.rowIndex,l=s.columnIndex;n?l+=1:t?--l:i?c+=1:r&&--c;let u=Br.value.rowCount;if(u<=0)return;c<0&&(c=u-1),c>=u&&(c=0);let d=X.value[c];if(!d||!d.temperatures.length)return;let f=d.temperatures.length;l<0&&(l=f-1),l>=f&&(l=0);let p=Pr(c,l);if(!p)return;let ee=Fr(c,l),te=W.value.left+W.value.cellSize.width*p.columnIndex,ne=W.value.top+W.value.cellSize.height*p.rowIndex;lr(p.cell,p.rowIndex,te,ne,`keyboard`,ee)}let zr=h(()=>({headers:[N.value.table.colNames.xAxis,...L.value.map(e=>e.name)],rows:Y.value.xLabels.map((e,t)=>[e,...L.value.map(e=>{let n=e.values?.[t];return isNaN(n)?`-`:a({p:F.value.prefix,v:n,s:F.value.suffix,r:N.value.table.td.roundingValue})})])})),Br=h(()=>({rowCount:X.value.length,columnCount:Math.max(0,...X.value.map(e=>e.temperatures.length))})),$=h(()=>X.value.flatMap((e,t)=>e.temperatures.map((e,n)=>({cell:e,rowIndex:t,columnIndex:n}))));return fe({getData:br,getImage:xr,generatePdf:Dn,generateCsv:pr,generateImage:On,generateSvg:jr,toggleTable:hr,toggleTooltip:gr,toggleAnnotator:vr,toggleFullscreen:mr,copyAlt:Nr}),Ye(()=>[H.value,F.value,P.value,N.value.style.fontFamily,k.dataset,Jn.value,Gn.value,qn.value,Kn.value,jn.value,an.value,nn.value,on.value],zn,{flush:`post`,deep:!0}),(i,o)=>(S(),_(`div`,{ref_key:`heatmapChart`,ref:A,class:Be(`vue-data-ui-component vue-ui-heatmap ${Q.value?`vue-data-ui-wrapper-fullscreen`:``}`),style:x(`font-family:${N.value.style.fontFamily};width:100%;${N.value.responsive?`height: 100%;`:``} text-align:center;background:${N.value.style.backgroundColor}`),id:`heatmap__${Ut.value}`,onMouseenter:o[1]||=()=>Sn(!0),onMouseleave:o[2]||=()=>{Sn(!1),pn.value||sr()}},[v(`div`,{id:`chart-instructions-${Ut.value}`,class:`sr-only`},[v(`p`,null,E(N.value.a11y.translations.keyboardNavigation),1)],8,rt),zr.value?.rows?.length?(S(),Ne(Oe,{key:0,uid:Ut.value,head:zr.value.headers,body:zr.value.rows,notice:N.value.a11y.translations.tableAvailable,caption:N.value.a11y.translations.tableCaption},null,8,[`uid`,`head`,`body`,`notice`,`caption`])):g(``,!0),N.value.userOptions.buttons.annotator?(S(),Ne(D(Pt),Re({key:1},D(n)(N.value.userOptions.annotator),{svgRef:D(R),backgroundColor:N.value.style.backgroundColor,color:N.value.style.color,active:_r.value,isCursorPointer:mn.value,palette:N.value.userOptions.annotatorPalette,onClose:vr}),Pe({_:2},[w(D(r),e=>({name:e,fn:O(n=>[T(i.$slots,e,b(y(D(t)(e,n))),void 0,!0)])}))]),1040,[`svgRef`,`backgroundColor`,`color`,`active`,`isCursorPointer`,`palette`])):g(``,!0),kn.value?(S(),_(`div`,{key:2,ref_key:`noTitle`,ref:en,class:`vue-data-ui-no-title-space`,style:`height:36px; width: 100%;background:transparent`},null,512)):g(``,!0),N.value.style.title.text?(S(),_(`div`,{key:3,ref_key:`chartTitle`,ref:$t,style:`width:100%;background:transparent`},[(S(),Ne(ge,{key:`title_${Yt.value}`,config:{title:{cy:`heatmap-div-title`,...N.value.style.title},subtitle:{cy:`heatmap-div-subtitle`,...N.value.style.title.subtitle}}},null,8,[`config`]))],512)):g(``,!0),N.value.userOptions.show&&Ht.value&&(D(xn)||D(yn))?(S(),Ne(D(Ft),Re({ref_key:`userOptionsRef`,ref:Qt,key:`user_options_${qt.value}`,backgroundColor:N.value.style.backgroundColor,color:N.value.style.color,isImaging:D(En),isPrinting:D(Tn),uid:Ut.value,hasTooltip:N.value.userOptions.buttons.tooltip&&N.value.style.tooltip.show,isFullscreen:Q.value,isTooltip:z.value.showTooltip,chartElement:A.value},D(be)(N.value.userOptions,`pdf csv img svg table fullscreen altCopy annotator`),{isAnnotation:_r.value,tableDialog:N.value.table.useDialog,isCursorPointer:mn.value,onToggleFullscreen:mr,onGeneratePdf:D(Dn),onGenerateCsv:pr,onGenerateImage:D(Mr),onGenerateSvg:D(jr),onToggleTable:hr,onToggleTooltip:gr,onToggleAnnotator:vr,onCopyAlt:Nr,style:{visibility:D(xn)?D(yn)?`visible`:`hidden`:`visible`}}),Pe({_:2},[w(D(ye)(i.$slots,`menuIcon optionTooltip optionPdf optionCsv optionImg optionSvg optionTable optionFullscreen optionAnnotator optionAltCopy custom-menu-before custom-menu-after`),e=>({name:e,fn:O(t=>[T(i.$slots,e,b(y(D(xe)(e,t))),void 0,!0)])}))]),1040,[`backgroundColor`,`color`,`isImaging`,`isPrinting`,`uid`,`hasTooltip`,`isFullscreen`,`isTooltip`,`chartElement`,`isAnnotation`,`tableDialog`,`isCursorPointer`,`onGeneratePdf`,`onGenerateImage`,`onGenerateSvg`,`style`])):g(``,!0),v(`div`,{class:Be({"vue-ui-heatmap-chart-wrapper":!0,"vue-ui-heatmap-chart-wrapper-legend-right":N.value.style.legend.show})},[(S(),_(`svg`,{ref_key:`svgRef`,ref:R,xmlns:D(ae),"aria-describedby":`chart-instructions-${Ut.value}`,class:Be({"vue-data-ui-fullscreen--on":Q.value,"vue-data-ui-fulscreen--off":!Q.value}),viewBox:`0 0 ${H.value.width} ${H.value.height}`,width:`100%`,style:x(`overflow: visible; background:transparent;color:${N.value.style.color};visibility:${D(Rn)?`visible`:`hidden`}`),"aria-live":`polite`,role:`img`,preserveAspectRatio:`xMidYMid`,tabindex:`0`,onFocus:Ir,onBlur:Lr,onKeydown:Rr},[Ie(D(It)),T(i.$slots,`svg-underlayer`,{svg:{...H.value,drawingArea:W.value,cells:Qn.value,isPrintingImg:D(Tn)||D(En)||D(kr),isPrintingSvg:D(Ar)}},void 0,!0),i.$slots[`chart-background`]?(S(),_(`foreignObject`,{key:0,x:W.value.left,y:W.value.top,width:W.value.width,height:W.value.height,style:{pointerEvents:`none`}},[T(i.$slots,`chart-background`,{},void 0,!0)],8,at)):g(``,!0),P.value.columnTotal.color.show?(S(),_(`g`,{key:1,ref_key:`xAxisSumRects`,ref:sn},[(S(!0),_(m,null,w(Y.value.xTotals,(e,t)=>(S(),_(`rect`,{x:W.value.left+W.value.cellSize.width*t+U.value/2+W.value.sumCellXHeight,y:W.value.top-W.value.sumCellXHeight+U.value*(H.value.height/H.value.width),height:W.value.sumCellXHeight,width:W.value.cellSize.width-U.value,fill:P.value.colors.underlayer,stroke:N.value.style.backgroundColor,"stroke-width":U.value},null,8,ot))),256)),(S(!0),_(m,null,w(Y.value.xTotals,(e,t)=>(S(),_(`rect`,{x:W.value.left+W.value.cellSize.width*t+U.value/2+W.value.sumCellXHeight,y:W.value.top-W.value.sumCellXHeight+U.value*(H.value.height/H.value.width),height:W.value.sumCellXHeight,width:W.value.cellSize.width-U.value,fill:e.color,stroke:N.value.style.backgroundColor,"stroke-width":U.value},null,8,st))),256))],512)):g(``,!0),v(`g`,{ref_key:`datapoints`,ref:Xt},[(S(!0),_(m,null,w(Qn.value,e=>(S(),_(`g`,null,[v(`rect`,{x:e.x,y:e.y,width:e.width,height:e.height,fill:P.value.colors.underlayer,stroke:N.value.style.backgroundColor,"stroke-width":U.value},null,8,ct),v(`rect`,{"data-a11y-cell-id":e.datapoint.id,x:e.x,y:e.y,width:e.width,height:e.height,fill:e.datapoint.color,stroke:N.value.style.backgroundColor,"stroke-width":U.value,"aria-label":`${e.datapoint.yAxisName}${e.datapoint.xAxisName?` - ${e.datapoint.xAxisName}`:``}: ${isNaN(e.datapoint.value)?`-`:e.datapoint.value}`,onMouseover:t=>lr(e.datapoint,e.rowIndex,e.selectionX,e.selectionY,`pointer`,Fr(e.rowIndex,e.columnIndex)),onMouseout:()=>ur({datapoint:e.datapoint,seriesIndex:e.rowIndex}),onClick:()=>yr(e.datapoint,e.rowIndex)},null,40,lt),P.value.value.show?Ze((S(),_(`text`,{key:0,"text-anchor":`middle`,"font-size":P.value.value.fontSize,"font-weight":P.value.value.bold?`bold`:`normal`,fill:D(ie)(e.datapoint.color),x:e.labelX,y:e.labelY,style:{pointerEvents:`none`,userSelect:`none`}},[Fe(E(D(p)(P.value.value.formatter,e.datapoint.value,D(a)({p:F.value.prefix,v:e.datapoint.value,s:F.value.suffix,r:P.value.value.roundingValue}),{datapoint:e.datapoint})),1)],8,ut)),[[D($e),{cellWidth:e.width,cellHeight:e.height,maxFontSize:P.value.value.fontSize,minFontSize:10,index:e.rowIndex*V.value+e.columnIndex,reportHide:ar,reportRotation:nr,hideAll:ir.value,rotateAll:tr.value}]]):g(``,!0)]))),256))],512),P.value.rowTotal.color.show?(S(),_(`g`,{key:2,ref_key:`yAxisSumRects`,ref:rn},[(S(!0),_(m,null,w(X.value,(e,t)=>(S(),_(m,null,[v(`rect`,{x:W.value.left,y:W.value.top+W.value.cellSize.height*t,width:W.value.sumCellXHeight,height:W.value.cellSize.height-U.value,fill:P.value.colors.underlayer,stroke:N.value.style.backgroundColor,"stroke-width":U.value},null,8,dt),v(`rect`,{x:W.value.left,y:W.value.top+W.value.cellSize.height*t+U.value/2,width:W.value.sumCellXHeight,height:W.value.cellSize.height-U.value,fill:Y.value.yTotals[t].color,stroke:N.value.style.backgroundColor,"stroke-width":U.value},null,8,ft)],64))),256))],512)):g(``,!0),F.value.yAxis.show?(S(),_(`g`,{key:3,ref_key:`yAxisLabels`,ref:nn},[(S(!0),_(m,null,w(X.value,(e,t)=>(S(),_(m,null,[v(`text`,{class:`vue-ui-heatmap-row-name`,"font-size":F.value.yAxis.fontSize,fill:F.value.yAxis.color,x:Vn.value+F.value.yAxis.offsetX,y:W.value.top+W.value.cellSize.height*t+W.value.cellSize.height/2+F.value.yAxis.fontSize/3+F.value.yAxis.offsetY-(P.value.rowTotal.value.show?F.value.yAxis.fontSize/1.5:0),"text-anchor":`end`,"font-weight":F.value.yAxis.bold?`bold`:`normal`},E(Y.value.yLabels[t]),9,pt),P.value.rowTotal.value.show?(S(),_(`text`,{key:0,class:`vue-ui-heatmap-row-total`,"font-size":F.value.yAxis.fontSize,fill:F.value.yAxis.color,x:Vn.value,y:W.value.top+W.value.cellSize.height*t+W.value.cellSize.height/2+F.value.yAxis.fontSize+F.value.yAxis.offsetY,"text-anchor":`end`,"font-weight":F.value.yAxis.bold?`bold`:`normal`},E(dr(t)),9,mt)):g(``,!0)],64))),256))],512)):g(``,!0),F.value.xAxis.show?(S(),_(`g`,{key:4,ref_key:`xAxisLabels`,ref:an},[(S(!0),_(m,null,w(Y.value.xLabels,(e,t)=>(S(),_(m,null,[!F.value.xAxis.showOnlyAtModulo||F.value.xAxis.showOnlyAtModulo&&t%F.value.xAxis.showOnlyAtModulo===0?(S(),_(`text`,{key:0,class:`vue-ui-heatmap-col-name`,"text-anchor":F.value.xAxis.rotation===0?`middle`:F.value.xAxis.rotation<0?`start`:`end`,"font-size":F.value.xAxis.fontSize,fill:F.value.xAxis.color,"font-weight":F.value.xAxis.bold?`bold`:`normal`,transform:`translate(${W.value.left+W.value.cellSize.width/2+W.value.width/Y.value.xLabels.length*t+F.value.xAxis.offsetX+W.value.sumCellXHeight}, ${W.value.topLabelsHeight+F.value.xAxis.offsetY}), rotate(${F.value.xAxis.rotation})`},E(e),9,ht)):g(``,!0)],64))),256))],512)):g(``,!0),P.value.columnTotal.value.show?(S(),_(`g`,{key:5,ref_key:`xAxisSums`,ref:on},[(S(!0),_(m,null,w(Y.value.xLabels,(e,t)=>(S(),_(`text`,{class:`vue-ui-heatmap-col-total`,"text-anchor":P.value.columnTotal.value.rotation===0?`middle`:P.value.columnTotal.value.rotation<0?`end`:`start`,"font-size":F.value.xAxis.fontSize,fill:F.value.xAxis.color,"font-weight":F.value.xAxis.bold?`bold`:`normal`,transform:`translate(${W.value.left+W.value.cellSize.width/2+W.value.width/Y.value.xLabels.length*t+F.value.xAxis.offsetX+P.value.columnTotal.value.offsetX+W.value.sumCellXHeight}, ${W.value.bottom+F.value.xAxis.fontSize/2}), rotate(${P.value.columnTotal.value.rotation})`},E(fr(t)),9,gt))),256))],512)):g(``,!0),j.value?(S(),_(`g`,_t,[v(`rect`,{style:{"pointer-events":`none`},x:j.value.x-P.value.selected.border/2+U.value+W.value.sumCellXHeight,y:j.value.y-P.value.selected.border/2+U.value,width:W.value.cellSize.width-U.value+P.value.selected.border-U.value,height:W.value.cellSize.height-U.value+P.value.selected.border-U.value,fill:`transparent`,stroke:P.value.selected.color,"stroke-width":P.value.selected.border,rx:1},null,8,vt)])):g(``,!0),I.value.crosshairs.show&&j.value?(S(),_(`g`,yt,[v(`line`,{x1:W.value.left+W.value.sumCellXHeight,x2:j.value.x+W.value.sumCellXHeight,y1:j.value.y+(W.value.cellSize.height-U.value)/2,y2:j.value.y+(W.value.cellSize.height-U.value)/2,stroke:I.value.crosshairs.stroke,"stroke-width":I.value.crosshairs.strokeWidth,"stroke-dasharray":I.value.crosshairs.strokeDasharray,"stroke-linecap":`round`},null,8,bt),v(`line`,{x1:j.value.x+W.value.sumCellXHeight+(W.value.cellSize.width-U.value)/2,x2:j.value.x+W.value.sumCellXHeight+(W.value.cellSize.width-U.value)/2,y1:j.value.y,y2:W.value.top,stroke:I.value.crosshairs.stroke,"stroke-width":I.value.crosshairs.strokeWidth,"stroke-dasharray":I.value.crosshairs.strokeDasharray,"stroke-linecap":`round`},null,8,xt)])):g(``,!0),T(i.$slots,`svg`,{svg:{...H.value,drawingArea:W.value,cells:Qn.value,isPrintingImg:D(Tn)||D(En)||D(kr),isPrintingSvg:D(Ar)}},void 0,!0)],46,it)),N.value.style.legend.show?(S(),_(`div`,{key:0,ref_key:`legendRight`,ref:tn,class:`vue-ui-heatmap-legend-right`,style:x({"--legend-width":N.value.style.legend.width+`px`})},[D(_n)?g(``,!0):(S(),_(`div`,{key:0,class:`vue-ui-heatmap-legend-label-max`,style:x({fontSize:N.value.style.legend.fontSize+`px`,color:N.value.style.legend.color})},E(D(p)(P.value.value.formatter,D(f)(G.value),D(a)({p:F.value.prefix,v:D(f)(G.value),s:F.value.suffix,r:N.value.style.legend.roundingValue}))),5)),v(`div`,St,[v(`div`,{class:`vue-ui-heatmap-gauge`,style:x({background:`linear-gradient(to bottom, ${P.value.colors.hot}, ${P.value.colors.cold})`})},[Ze(v(`div`,{class:`vue-ui-heatmap-gauge-indicator`,"data-value":D(p)(P.value.value.formatter,D(f)(Z.value),D(a)({p:F.value.prefix,v:D(f)(Z.value),s:F.value.suffix,r:N.value.style.legend.roundingValue})),style:x({position:`absolute`,width:`100%`,height:`2px`,background:[void 0,null].includes(Z.value)?`transparent`:D(ie)(or.value.datapoint.color),top:`${Zn(Z.value)}%`,transition:`all 0.2s ease-in-out`,"--background-color":N.value.style.backgroundColor,"--gauge-arrow-color":D(ie)(N.value.style.backgroundColor),"--gauge-arrow-text-color":D(ie)(N.value.style.backgroundColor),"--gauge-arrow-value":Z.value,"--gauge-arrow-font-size":N.value.style.legend.fontSize+`px`})},[v(`div`,wt,E(D(p)(P.value.value.formatter,D(f)(Z.value),D(a)({p:F.value.prefix,v:D(f)(Z.value),s:F.value.suffix,r:N.value.style.legend.roundingValue}))),1)],12,Ct),[[Je,![void 0,null].includes(Z.value)]])],4)]),D(_n)?g(``,!0):(S(),_(`div`,{key:1,class:`vue-ui-heatmap-legend-label-min`,style:x({fontSize:N.value.style.legend.fontSize+`px`,color:N.value.style.legend.color})},E(D(p)(P.value.value.formatter,D(f)(K.value),D(a)({p:F.value.prefix,v:D(f)(K.value),s:F.value.suffix,r:N.value.style.legend.roundingValue}))),5))],4)):g(``,!0),i.$slots.hint?(S(),_(`div`,Tt,[T(i.$slots,`hint`,b(y({hint:N.value.a11y.translations.keyboardNavigation,isVisible:pn.value})),void 0,!0)])):g(``,!0)],2),i.$slots.watermark?(S(),_(`div`,Et,[T(i.$slots,`watermark`,b(y({isPrinting:D(Tn)||D(En)||D(kr)||D(Ar)})),void 0,!0)])):g(``,!0),i.$slots.source?(S(),_(`div`,{key:6,ref_key:`source`,ref:cn,dir:`auto`},[T(i.$slots,`source`,{},void 0,!0)],512)):g(``,!0),Ie(D(tt),{teleportTo:N.value.style.tooltip.teleportTo,show:z.value.showTooltip&&Wt.value,backgroundColor:N.value.style.tooltip.backgroundColor,color:N.value.style.tooltip.color,borderRadius:N.value.style.tooltip.borderRadius,borderColor:N.value.style.tooltip.borderColor,borderWidth:N.value.style.tooltip.borderWidth,fontSize:N.value.style.tooltip.fontSize,backgroundOpacity:N.value.style.tooltip.backgroundOpacity,position:N.value.style.tooltip.position,offsetX:N.value.style.tooltip.offsetX,offsetY:N.value.style.tooltip.offsetY,parent:A.value,content:Gt.value,isFullscreen:Q.value,isCustom:N.value.style.tooltip.customFormat&&typeof N.value.style.tooltip.customFormat==`function`,smooth:N.value.style.tooltip.smooth,backdropFilter:N.value.style.tooltip.backdropFilter,smoothForce:N.value.style.tooltip.smoothForce,smoothSnapThreshold:N.value.style.tooltip.smoothSnapThreshold,isA11yMode:fn.value===`keyboard`,a11yPosition:dn.value},{"tooltip-before":O(()=>[T(i.$slots,`tooltip-before`,b(y({...or.value})),void 0,!0)]),tooltip:O(()=>[T(i.$slots,`tooltip`,b(y({...or.value})),void 0,!0)]),"tooltip-after":O(()=>[T(i.$slots,`tooltip-after`,b(y({...or.value})),void 0,!0)]),_:3},8,[`teleportTo`,`show`,`backgroundColor`,`color`,`borderRadius`,`borderColor`,`borderWidth`,`fontSize`,`backgroundOpacity`,`position`,`offsetX`,`offsetY`,`parent`,`content`,`isFullscreen`,`isCustom`,`smooth`,`backdropFilter`,`smoothForce`,`smoothSnapThreshold`,`isA11yMode`,`a11yPosition`]),Ht.value&&N.value.userOptions.buttons.table?(S(),Ne(We(wr.value.component),Re({key:7},wr.value.props,{ref_key:`tableUnit`,ref:Zt,onClose:Er}),Pe({content:O(()=>[v(`div`,{ref_key:`tableContainer`,ref:Jt,class:`vue-ui-heatmap-table atom-data-table`,style:x(`${N.value.table.useDialog?``:`max-height: 300px; margin-top: 24px;`}`)},[v(`div`,{style:x(`width:100%;overflow-x:auto;position:relative;${N.value.table.useDialog?``:`padding-top:36px`};`),class:Be({"vue-ui-responsive":D(Tr)})},[N.value.table.useDialog?g(``,!0):(S(),_(`div`,{key:0,role:`button`,tabindex:`0`,style:x(`width:32px; position: absolute; top: 0; left:4px; padding: 0 0px; display: flex; align-items:center;justify-content:center;height: 36px; width: 32px; cursor:pointer; background:${N.value.table.th.backgroundColor};`),onClick:Er,onKeypress:Qe(Er,[`enter`])},[Ie(D(Nt),{name:`close`,stroke:N.value.table.th.color,"stroke-width":2},null,8,[`stroke`])],36)),v(`table`,Dt,[N.value.table.useDialog?g(``,!0):(S(),_(`caption`,{key:0,style:x(`backgroundColor:${N.value.table.th.backgroundColor};color:${N.value.table.th.color};outline:${N.value.table.th.outline}`)},[Fe(E(N.value.style.title.text)+` `,1),N.value.style.title.subtitle.text?(S(),_(`span`,Ot,E(N.value.style.title.subtitle.text),1)):g(``,!0)],4)),v(`thead`,null,[v(`tr`,{role:`row`,style:x(`background:${N.value.table.th.backgroundColor};color:${N.value.table.th.color}`)},[v(`th`,{style:x(`outline:${N.value.table.th.outline};padding-right:6px`)},null,4),(S(!0),_(m,null,w(e.dataset,(e,t)=>(S(),_(`th`,{align:`right`,style:x(`outline:${N.value.table.th.outline};padding-right:6px`)},E(e.name),5))),256))],4)]),v(`tbody`,null,[(S(!0),_(m,null,w(Y.value.xLabels,(t,n)=>(S(),_(`tr`,{role:`row`,class:Be({"vue-ui-data-table__tbody__row":!0,"vue-ui-data-table__tbody__row-even":n%2==0,"vue-ui-data-table__tbody__row-odd":n%2!=0}),style:x(`background:${N.value.table.td.backgroundColor};color:${N.value.table.td.color}`)},[v(`td`,{"data-cell":N.value.table.colNames.xAxis,class:`vue-ui-data-table__tbody__td`,style:x(`outline:${N.value.table.td.outline}`)},[v(`div`,At,E(t),1)],12,kt),(S(!0),_(m,null,w(e.dataset,(t,r)=>(S(),_(`td`,{class:`vue-ui-data-table__tbody__td`,"data-cell":e.dataset[r].name,style:x(`outline:${N.value.table.td.outline}`)},[v(`div`,Mt,E(isNaN(t.values[n])?`-`:D(a)({p:F.value.prefix,v:t.values[n],s:F.value.suffix,r:N.value.table.td.roundingValue})),1)],12,jt))),256))],6))),256))])])],6)],4)]),_:2},[N.value.table.useDialog?{name:`title`,fn:O(()=>[Fe(E(wr.value.title),1)]),key:`0`}:void 0,N.value.table.useDialog?{name:`actions`,fn:O(()=>[v(`button`,{tabindex:`0`,class:`vue-ui-user-options-button`,onClick:o[0]||=e=>pr(N.value.userOptions.callbacks.csv),style:x({cursor:mn.value?`pointer`:`default`})},[Ie(D(Nt),{name:`fileCsv`,stroke:wr.value.props.color},null,8,[`stroke`])],4)]),key:`1`}:void 0]),1040)):g(``,!0),T(i.$slots,`skeleton`,{},()=>[D(_n)?(S(),Ne(le,{key:0})):g(``,!0)],!0)],46,nt))}},[[`__scopeId`,`data-v-e73829ec`]]);export{tt as n,Nt as t};
@@ -0,0 +1 @@
1
+ import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{n as t,r as n,t as r}from"./annotationSlots-OLiW25XN.js";import{t as i}from"./useConfig-C3FbHv4N.js";import{$ as a,D as o,Ht as s,X as c,a as l,i as u,nn as d,nt as f,r as p,x as m}from"./lib-rPeBMZrn.js";import{n as h,t as g}from"./useHints-C-TwxM0Y.js";import{t as ee}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{t as te}from"./useNestedProp-DnGoh-XS.js";import{t as ne}from"./useThemeCheck-BKNRbGeC.js";import{t as re}from"./chartImage-DPGnEuYM.js";import{n as ie}from"./Title-BliHuXfT.js";import{t as ae}from"./useChartExport-BZts4KFb.js";import{n as oe,r as se,t as ce}from"./userOptionsSlots-CWtXN5Q6.js";import{t as le}from"./usePrinter-DVf3YcG5.js";import{t as ue}from"./useTransitions-ChGGrtrv.js";import{t as de}from"./useUserOptionState-CXlFnwPv.js";import{t as fe}from"./vue_ui_hill-DQi4pQCG.js";import{Fragment as _,computed as v,createBlock as pe,createCommentVNode as y,createElementBlock as b,createElementVNode as x,createSlots as me,createVNode as he,defineAsyncComponent as ge,guardReactiveProps as _e,mergeProps as ve,nextTick as ye,normalizeClass as S,normalizeProps as be,normalizeStyle as xe,onBeforeUnmount as Se,onMounted as Ce,openBlock as C,ref as w,renderList as we,renderSlot as T,shallowRef as Te,toDisplayString as E,unref as D,useTemplateRef as Ee,watch as De,withCtx as Oe,withKeys as ke,withModifiers as O}from"vue";var Ae=/* @__PURE__ */ e({default:()=>wt}),je=[`id`,`data-editing`],Me={key:0,ref:`chartTitle`,style:`width:100%;background:transparent;padding-bottom:24px`},Ne={key:3,class:`vue-ui-hill__toolbar`,"data-dom-to-png-ignore":``},Pe=[`viewBox`],Fe=[`width`,`height`],Ie=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`,`stroke-dasharray`],Le=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`,`stroke-dasharray`],Re=[`d`,`stroke`,`stroke-width`,`stroke-dasharray`],ze={key:0,"pointer-events":`none`},Be=[`d`,`stroke`,`stroke-width`,`stroke-dasharray`],Ve=[`cx`,`cy`,`r`,`fill`,`stroke`,`stroke-width`],He=[`transform`,`font-size`,`fill`,`stroke`],Ue=[`transform`,`data-datapoint-index`,`data-datapoint-id`,`tabindex`,`aria-valuenow`,`aria-valuetext`,`aria-label`,`onFocus`,`onBlur`,`onKeydown`,`onPointerenter`,`onPointerleave`,`onClick`],We=[`r`,`onPointerdown`],Ge=[`r`,`fill`,`stroke`,`stroke-width`],Ke=[`stroke`,`stroke-width`],qe=[`d`],Je=[`x`,`y`,`text-anchor`,`fill`,`font-size`,`font-weight`,`stroke`,`stroke-width`],Ye=[`transform`,`tabindex`,`aria-label`,`aria-expanded`,`onClick`,`onFocus`,`onKeydown`],Xe={key:0,class:`vue-ui-hill__stack-overflow-collapse-ghosts`,"pointer-events":`none`,"aria-hidden":`true`},Ze=[`cx`,`cy`,`r`,`fill`,`stroke`,`stroke-width`],Qe=[`from`,`dur`],$e=[`from`,`dur`],et=[`from`,`to`,`dur`],tt=[`dur`],nt=[`r`],rt=[`x`,`y`,`width`,`height`,`fill`,`stroke`,`stroke-width`],it=[`stroke`,`stroke-width`],at=[`d`],ot=[`y`,`fill`,`font-size`,`font-weight`,`stroke`],st=[`x`,`y`,`fill`,`font-size`,`font-weight`,`letter-spacing`],ct=[`x`,`y`,`fill`,`font-size`,`font-weight`,`letter-spacing`],lt=[`x`,`y`,`rx`,`width`,`height`,`fill`],ut=[`id`],dt=[`x`,`y`,`width`,`height`,`rx`,`ry`],ft=[`clip-path`],pt=[`width`,`x`,`y`,`fill`,`height`,`onPointerenter`,`onPointerleave`],mt=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`],ht=[`x`,`y`,`width`,`height`,`rx`,`ry`,`stroke`,`stroke-width`],gt=[`x`,`y`,`fill`,`font-size`],_t=[`aria-label`,`onKeydown`],vt={key:0,class:`vue-ui-hill__stack-overflow-menu-title`},yt=[`disabled`,`aria-label`,`onClick`],bt={class:`vue-ui-hill__stack-overflow-menu-label`},xt={class:`vue-ui-hill__stack-overflow-menu-value`},St={key:6,class:`vue-data-ui-watermark`},Ct={key:7,class:`vue-ui-hill__loading`,"data-dom-to-png-ignore":``},wt=/*#__PURE__*/ ee({__name:`vue-ui-hill`,props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:[`edit`,`save`,`cancel`,`copyAlt`,`change`,`dragStart`,`dragEnd`,`datapointEnter`,`datapointLeave`,`selectDatapoint`],setup(e,{expose:ee,emit:Ae}){let wt=ge(()=>import(`./HillActions-BMH9pSmQ.js`)),Tt=ge(()=>import(`./UserOptions-B9EyfU9n.js`).then(e=>e.n)),Et=ge(()=>import(`./PackageVersion-DKSNC-YP.js`).then(e=>e.t)),Dt=ge(()=>import(`./PenAndPaper-DoNTA-SV.js`).then(e=>e.t)),Ot=ge(()=>import(`./BaseIcon-CoY0vuL3.js`).then(e=>e.n)),{vue_ui_hill:kt}=i(),{isThemeValid:At,warnInvalidTheme:jt}=ne(),Mt=e,Nt=w(c()),k=Te(null),Pt=Ee(`hillChartRef`),A=Ee(`svgRef`),Ft=Ee(`overflowMenuRef`),It=Ee(`userOptionsRef`),Lt=w(0),Rt=Ae;function zt(){let e=te({userConfig:Mt.config,defaultConfig:kt}),t={},n=e.theme;if(!n)t=e;else if(!At.value(e))jt(e),t=e;else{let r=te({userConfig:fe[n]||Mt.config,defaultConfig:e});t={...te({userConfig:Mt.config,defaultConfig:r}),customPalette:e.customPalette.length?e.customPalette:d[n]||nn}}return t}let j=w(zt()),M=v(()=>j.value.style.chart.layout.plots),N=v(()=>j.value.style.chart);h({config:()=>j.value,dataset:()=>Mt.dataset,component:`VueUiHill`,rules:[g.emptyArray,g.noHint]});let{transitionEnabled:P}=ue({config:()=>j.value.transitions,dataset:()=>Mt.dataset}),{userOptionsVisible:Bt,setUserOptionsVisibility:Vt,keepUserOptionState:Ht}=de({config:j.value});function Ut(){Vt(!0)}function Wt(){Vt(!1),tr.value=null,Q.value=null,er.value=null}let{isPrinting:Gt,isImaging:Kt,generatePdf:qt,generateImage:Jt}=le({elementId:`hill_${Nt.value}`,fileName:N.value.title.text||`vue-ui-hill`,options:j.value.userOptions.print}),Yt=v(()=>j.value.userOptions.useCursorPointer),Xt=w(0),Zt=w(!1);function Qt(e){Zt.value=e,Xt.value+=1}let $t=w(!1);function en(){$t.value=!$t.value}let tn=v(()=>j.value.userOptions.position===`left`?`right`:`left`);De(()=>Mt.config,()=>{k.value=null,j.value=zt(),Xt.value+=1,F.value!==j.value.editing&&(F.value=j.value.editing&&!j.value.readonly)},{deep:!0});let nn=v(()=>{let e=j.value.customPalette;return Array.isArray(e)&&e.length?e:s});function rn(e){let t=Number(e);return Number.isFinite(t)?Math.min(1,Math.max(0,t)):0}function an(e){if(e<=0)return`todo`;if(e>=1)return`done`;let t=.5,n=Math.min(t,Math.max(0,Number(j.value.interaction.peakTolerance)||0)),r=t-n,i=t+n;return e>=r&&e<=i?`top`:e<t?`left`:`right`}function on(e,t){let n=e&&typeof e==`object`?e:{},r=`Item ${t+1}`,i=String(n.name??n.label??r),a=rn(n.position??n.value??0);return{...n,id:String(n.id??`${i}-${t}`),name:i,label:String(n.label??i),position:a,color:n.color||nn.value[t%nn.value.length],muted:!!n.muted,disabled:!!n.disabled,status:an(e.position),labelSide:[`left`,`right`,`auto`].includes(n.labelSide)?n.labelSide:`auto`,__index:t}}let sn=v(()=>Array.isArray(Mt.dataset)?Mt.dataset.map(on):[]);function cn(e){return e.map(e=>({...e}))}function ln(e){let{__index:t,...n}=e;return Object.prototype.hasOwnProperty.call(n,`value`)&&(n.value=n.position),n}function un(e=I.value){return e.map(ln)}let dn=v(()=>j.value.editing&&!j.value.readonly),F=w(dn.value),I=w(cn(sn.value)),L=w(null);De(sn,e=>{F.value||(k.value=null,I.value=cn(e))},{deep:!0});let R=v(()=>!j.value.readonly);De(R,e=>{e||(L.value=null,k.value=null,F.value=!1,I.value=cn(sn.value))});function z(e,t){Rt(e,t);let n=j.value.events?.[e];typeof n==`function`&&n(t)}let B=v(()=>N.value),fn=v(()=>B.value.layout),V=v(()=>fn.value.hill),H=v(()=>fn.value.plots),U=v(()=>fn.value.labels.item),W=v(()=>fn.value.labels.phases),G=v(()=>B.value.toolbar),K=v(()=>fn.value.stackbar),q=v(()=>{let e=H.value.stacking?.overflow||{},t=Math.max(0,Number(H.value.radius)||0);return{show:e.show!==!1,marker:{radius:Math.max(4,Number(e.marker?.radius)||t),fill:e.marker.fill,stroke:e.marker?.stroke||H.value.stroke,strokeWidth:e.marker.strokeWidth,color:e.marker.labelColor,fontSize:e.marker.fontSize,bold:e.marker?.bold!==!1,offsetY:e.marker.labelOffsetY},hysteresis:t*1.5,transitionDuration:P.value?e.transitionDuration:0,menu:{width:Math.max(160,Number(e.menu?.width)||220),maxHeight:Math.max(96,Number(e.menu?.maxHeight)||220),backgroundColor:e.menu?.backgroundColor||B.value.backgroundColor,color:e.menu?.color||B.value.color,borderColor:e.menu?.borderColor||H.value.stroke,borderRadius:Math.max(0,Number(e.menu?.borderRadius)||6)}}});function pn(e,t,n=1){let r=Number(e);return Number.isFinite(r)?Math.min(n,Math.max(0,r)):t}let J=v(()=>{let e=V.value.geometry||{},t=Math.max(0,Number(B.value.width)||0),n=Math.max(0,Number(B.value.height)||0),r=pn(e.horizontalPaddingRatio,.02,.49),i=pn(e.topPaddingRatio,.12,.49),a=pn(e.bottomPaddingRatio,.2,.49),o=pn(e.curvature,.65),s=t*r,c=t/2,l=t*(1-r),u=n*i,d=n*(1-a),f=c-s,p=l-c,m=s+f*o,h=c+p*(1-o);return{startX:s,centerX:c,endX:l,baseY:d,peakY:u,width:f+p,left:[{x:s,y:d},{x:m,y:d},{x:m,y:u},{x:c,y:u}],right:[{x:c,y:u},{x:h,y:u},{x:h,y:d},{x:l,y:d}]}}),mn=v(()=>{let{left:e,right:t}=J.value;return[`M${e[0].x} ${e[0].y}`,`C${e[1].x} ${e[1].y} ${e[2].x} ${e[2].y} ${e[3].x} ${e[3].y}`,`C${t[1].x} ${t[1].y} ${t[2].x} ${t[2].y} ${t[3].x} ${t[3].y}`].join(` `)});function hn(e,t,n,r,i){let a=1-i;return a**3*e+3*a**2*i*t+3*a*i**2*n+i**3*r}function gn(e,t,n,r,i){let a=1-i;return 3*a**2*(t-e)+6*a*i*(n-t)+3*i**2*(r-n)}function _n(e){let t=rn(e),{startX:n,centerX:r,endX:i,left:a,right:o}=J.value,s=n+(t-0)/1*(i-n),c=s<=r?a:o,l=0,u=1;for(let e=0;e<28;e+=1){let e=(l+u)/2;hn(c[0].x,c[1].x,c[2].x,c[3].x,e)<s?l=e:u=e}let d=(l+u)/2,f=hn(c[0].y,c[1].y,c[2].y,c[3].y,d),p=gn(c[0].x,c[1].x,c[2].x,c[3].x,d),m=gn(c[0].y,c[1].y,c[2].y,c[3].y,d),h=Math.hypot(p,m)||1;return{x:s,y:f,normalX:m/h,normalY:-p/h}}function vn(e){let t=Number(H.value.stacking.overlapThresholdRatio);return e*(2-(Number.isFinite(t)?Math.min(2,Math.max(0,t)):.5))}function yn(e,t){let n=/* @__PURE__ */ new Map,r=H.value.stacking;if(e.forEach(e=>{n.set(e.id,{position:e.position,index:0,size:1,stackId:`stack:${e.id}`})}),!r.show||e.length<2||t<=0)return n;let i=vn(t),a=e.map((e,t)=>({datapoint:e,index:t,point:_n(e.position)})).sort((e,t)=>e.point.x-t.point.x||e.datapoint.position-t.datapoint.position||e.index-t.index),o=0;for(;o<a.length;){let e=[a[o]],t=o+1;for(;t<a.length;){let n=e[e.length-1],r=a[t];if(Math.hypot(r.point.x-n.point.x,r.point.y-n.point.y)>=i)break;e.push(r),t+=1}if(e.length>1){let t=e[0].datapoint.position,r=`stack:${e.map(({datapoint:e})=>e.id).sort().join(`|`)}`;e.forEach(({datapoint:i},a)=>{n.set(i.id,{position:t,index:a,size:e.length,stackId:r})})}o=t}return n}function bn(e){let t=e+Math.max(0,Number(H.value.strokeWidth)||0)/2,n=H.value.stacking.gap??e/2;return t*2+n}let xn=w(null),Y=w(null),X=w(null),Sn=w(null),Cn=w(null),wn=/* @__PURE__ */ new Set,Tn=null,En=null,Z=null;function Dn(e){let t=Math.max(0,Number(H.value.strokeWidth)||0),n=H.value.shadow.show?Math.max(0,Number(H.value.shadow.blur)||0)+Math.max(0,-(Number(H.value.shadow.offsetY)||0)):0;return e+t/2+n}function On(e,t,n){if(t<=1)return e-Dn(n);let r=bn(n);return e-(t-1)*r-Dn(n)}function kn(e,t,n,r){if(n<=1)return wn.delete(e),!1;let i=On(t,n,r),a=wn.has(e),o=q.value.hysteresis,s=a?i<o:i<0;return s?wn.add(e):wn.delete(e),s}let An=v(()=>{let e=Math.max(0,Number(H.value.radius)||0),t=bn(e),n=yn(I.value,e),r=/* @__PURE__ */ new Map,i=/* @__PURE__ */ new Map,a=[],o=/* @__PURE__ */ new Set,s=L.value?.id??null;q.value.show||wn.clear(),I.value.forEach(e=>{let t=n.get(e.id)||{position:e.position,index:0,size:1,stackId:`stack:${e.id}`};r.has(t.stackId)||r.set(t.stackId,[]),r.get(t.stackId).push({datapoint:e,stack:t})});let c=new Set(r.keys());return wn.forEach(e=>{c.has(e)||wn.delete(e)}),r.forEach((n,r)=>{let c=[...n].sort((e,t)=>e.stack.index-t.stack.index||e.datapoint.__index-t.datapoint.__index),l=c.reduce((e,t)=>e+(Number(t.datapoint.position)||0),0)/c.length,u=_n(l);if(!(q.value.show&&kn(r,u.y,c.length,e))){c.forEach(e=>{i.set(e.datapoint.id,{hidden:!1,displayIndex:e.stack.index,stackId:r,stackSize:c.length,promotedFromOverflow:!1,renderPosition:e.stack.position})});return}c.forEach(({datapoint:e})=>{o.add(e.id)});let d=s?c.find(({datapoint:e})=>e.id===s):null,f=c.find(({datapoint:e})=>e.id===xn.value),p=d||f||null,m=p?c.filter(({datapoint:e})=>e.id!==p.datapoint.id):c,h=Y.value,g=!(!f||h?.datapointId!==f.datapoint.id||h.moved),ee=m.length?g?l:m.reduce((e,t)=>e+(Number(t.datapoint.position)||0),0)/m.length:l,te=_n(ee);c.forEach(e=>{let t=p?.datapoint.id===e.datapoint.id,n=t&&f?.datapoint.id===e.datapoint.id;i.set(e.datapoint.id,{hidden:!t,displayIndex:+!!t,stackId:r,stackSize:c.length,promotedFromOverflow:n,renderPosition:ee})}),m.length&&a.push({stackId:r,anchorPosition:ee,x:te.x,y:te.y,hiddenCount:m.length,hiddenDatapoints:m.map(({datapoint:e})=>e),memberIds:c.map(({datapoint:e})=>e.id),collapseDatapoints:m.map(({datapoint:e,stack:n})=>{let r=_n(n.position);return{id:e.id,color:e.color,relativeX:r.x-te.x,relativeY:r.y-n.index*t-te.y}})})}),{layoutMap:n,displayMap:i,markers:a,overflowMemberIds:o}});function jn(e){let t=Nn.value.filter(e=>!e.isStackOverflowHidden),n=t.find(t=>t.id===e),r=new Map(t.filter(t=>t.id!==e).map(e=>[e.id,{x:e.x,y:e.y}]));if(!n||!H.value.stacking.show)return r;let i=t.filter(e=>Math.abs(e.x-n.x)<.001).sort((e,t)=>t.y-e.y||e.datasetIndex-t.datasetIndex);if(i.length<2)return r;let a=bn(Math.max(0,Number(H.value.radius)||0)),o=Math.max(...i.map(e=>e.y));return i.filter(t=>t.id!==e).forEach((e,t)=>{r.set(e.id,{x:n.x,y:o-t*a})}),r}function Mn(){return new Map(Nn.value.filter(e=>!e.isStackOverflowHidden).map(e=>[e.id,{x:e.x,y:e.y}]))}let Nn=v(()=>{let e=Math.max(0,Number(H.value.radius)||0),{layoutMap:t,displayMap:n,markers:r}=An.value,i=bn(e),a=L.value,o=a?.stationaryLayout,s=o instanceof Map?o:k.value instanceof Map?k.value:null,c=null;if(a&&o instanceof Map&&H.value.stacking.show&&e>0){let t=I.value.find(e=>e.id===a.id);if(t){let n=r.find(e=>e.memberIds.includes(t.id));if(n)c={x:n.x,y:n.y-i};else{let n=_n(t.position),r=vn(e),s=I.value.filter(e=>e.id!==a.id&&o.has(e.id)).map(e=>{let t=_n(e.position);return{datapoint:e,distance:Math.hypot(t.x-n.x,t.y-n.y)}}).filter(({distance:e})=>e<r).sort((e,t)=>e.distance-t.distance)[0];if(s){let e=o.get(s.datapoint.id),t=[...o.values()].filter(t=>Math.abs(t.x-e.x)<.001),n=Math.min(e.y,...t.map(e=>e.y));c={x:e.x,y:n-i}}else c=n}}}return I.value.map((e,r)=>{let o=t.get(e.id)||{position:e.position,index:0,size:1,stackId:`stack:${e.id}`},l=n.get(e.id)||{hidden:!1,displayIndex:o.index,stackId:o.stackId,stackSize:o.size,renderPosition:o.position},u=_n(l.renderPosition??o.position),d=e.id!==a?.id&&!l.promotedFromOverflow&&s instanceof Map?s.get(e.id):null,f=e.id===a?.id&&c?c:d||{x:u.x,y:u.y-l.displayIndex*i},p=e.labelSide===`auto`?null:e.labelSide,h=m(U.value.autoSideThreshold,.5,1),g=p||(e.position>h?`left`:`right`),ee=Math.abs(Number(U.value.offsetX)||0)+H.value.radius+U.value.fontSize/2;return{...e,datasetIndex:r,x:f.x,y:f.y,stackId:l.stackId,stackSize:l.stackSize,stackDisplayIndex:l.displayIndex,isStackOverflowHidden:l.hidden,isPromotedFromStackOverflow:l.promotedFromOverflow,labelSide:g,labelX:g===`left`?-ee:ee,textAnchor:g===`left`?`end`:`start`}})});function Pn(e){return I.value.find(t=>t.id===e)}function Fn(e,t){let n=rn(t),r;I.value=I.value.map(t=>t.id===e?(r={...t,position:n},r):t),r&&(xr(r.id,r.position),z(`change`,{datapoint:ln(r),dataset:un()}))}function In(e){let t=A.value;if(!t)return null;let n=t.getScreenCTM();if(!n)return null;let r=t.createSVGPoint();r.x=e,r.y=0;let i=r.matrixTransform(n.inverse()),{startX:a,endX:o}=J.value;return rn(0+(i.x-a)/(o-a)*1)}function Ln(){R.value&&(X.value=null,xn.value=null,Y.value=null,Cn.value=null,mr(),k.value=null,I.value=cn(sn.value),F.value=!0,z(`edit`,un()))}function Rn(){let e=un();X.value=null,xn.value=null,Y.value=null,Cn.value=null,mr(),L.value=null,F.value=!1,z(`save`,e)}function zn(){X.value=null,xn.value=null,Y.value=null,Cn.value=null,mr(),L.value=null,k.value=null,I.value=cn(sn.value),F.value=!1,z(`cancel`,un())}function Bn(e,t){if(!R.value||!F.value||t.disabled)return;X.value=null;let n=e.currentTarget.closest(`.vue-ui-hill__datapoint`);n&&typeof n.focus==`function`&&(n.focus(),Q.value=t.id),e.preventDefault();let r=jn(t.id),i=Y.value?.datapointId===t.id&&!Y.value?.moved;if(L.value={id:t.id,pointerId:e.pointerId,stationaryLayout:r,startClientX:e.clientX,hasMoved:!1,deferPositionUpdate:i},A.value?.setPointerCapture(e.pointerId),!i){let n=In(e.clientX);n!==null&&Fn(t.id,n)}let a=Pn(t.id);a&&z(`dragStart`,ln(a))}function Vn(e){if(!L.value||L.value.pointerId!==e.pointerId)return;e.preventDefault();let t=Math.abs(e.clientX-L.value.startClientX);if(L.value.deferPositionUpdate&&!L.value.hasMoved&&t<3)return;L.value.hasMoved||(L.value={...L.value,hasMoved:!0});let n=In(e.clientX);n!==null&&Fn(L.value.id,n)}function Hn(e){let t=L.value;if(!t||t.pointerId!==e.pointerId)return;A.value?.hasPointerCapture(e.pointerId)&&A.value.releasePointerCapture(e.pointerId);let n=e.type===`pointerup`&&!t.hasMoved,r=Pn(t.id);k.value=Mn(),L.value=null,r&&(n&&z(`selectDatapoint`,Gn(r)),z(`dragEnd`,ln(r)))}function Un(e,t){if(!R.value||!F.value||t.disabled)return;let n=Math.max(0,Number(j.value.interaction.keyboardStep)||0),r=null;switch(e.key){case`ArrowLeft`:case`ArrowDown`:r=t.position-n;break;case`ArrowRight`:case`ArrowUp`:r=t.position+n;break;case`Home`:r=0;break;case`End`:r=1;break;default:return}e.preventDefault();let i=e.currentTarget;Q.value=t.id,L.value={id:t.id,pointerId:null,stationaryLayout:jn(t.id)},Fn(t.id,r),k.value=Mn(),L.value=null,ye(()=>{i?.isConnected&&i.focus({preventScroll:!0})})}function Wn(e){let t=.5,n=Math.max(0,Number(j.value.interaction.peakTolerance)||0);return Math.abs(e-t)<=n?j.value.a11y.translations.topOfHill:e<t?W.value.left.text:W.value.right.text}function Gn(e){return{datapoint:ln(e),index:e.__index}}function Kn(e){Q.value=null,tr.value=e.id,![0,1].includes(e.position)&&Q.value!==e.id&&ir(e),z(`datapointEnter`,Gn(e))}function qn(e){tr.value===e.id&&(tr.value=null),er.value===e.id&&Q.value!==e.id&&L.value?.id!==e.id&&(er.value=null),z(`datapointLeave`,Gn(e))}function Jn(e){F.value&&R.value||z(`selectDatapoint`,Gn(e))}let Yn=v(()=>{let e=B.value;return{width:`100%`,maxWidth:`100%`,color:e.color,backgroundColor:e.backgroundColor,fontFamily:j.value.style.fontFamily,"--vue-ui-hill-button-hover-border":G.value.buttons.hoverBorderColor,"--vue-ui-hill-button-active-offset":`${G.value.buttons.activeTranslateY}px`}}),Xn=v(()=>({color:G.value.status.color,fontSize:`${G.value.status.fontSize}px`,fontWeight:G.value.status.bold?`bold`:`normal`,lineHeight:G.value.status.lineHeight}));v(()=>({color:B.value.title.color,fontSize:`${B.value.title.fontSize}px`,fontWeight:B.value.title.bold?`bold`:`normal`,textAlign:B.value.title.textAlign})),v(()=>({color:B.value.title.subtitle.color,fontSize:`${B.value.title.subtitle.fontSize}px`,fontWeight:B.value.title.subtitle.bold?`bold`:`normal`}));let Zn=v(()=>{let e=Math.max(0,Number(B.value.height)||0);return Math.min(e,J.value.baseY+e)+W.value.offsetY});function Qn(e){return W.value[e].text}function $n(e){return e.position===0||e.position===1}let er=w(null),tr=w(null),Q=w(null);function nr(e){Q.value=e.id}function rr(e){Q.value===e.id&&(Q.value=null),er.value===e.id&&tr.value!==e.id&&L.value?.id!==e.id&&(er.value=null)}function ir(e){e?.id&&(er.value=e.id)}let ar=v(()=>{let e=[],t=[],n=null;return Nn.value.forEach(r=>{r.isStackOverflowHidden||(r.id===er.value?n=r:$n(r)?e.push(r):t.push(r))}),[...e,...t,...n?[n]:[]]}),or=v(()=>An.value.markers),sr=v(()=>or.value.find(e=>e.stackId===X.value)||null),cr=v(()=>{let e=Math.max(160,Number(q.value.menu.width)||220),t=Math.max(80,Number(q.value.menu.maxHeight)||220);return{visibility:Sn.value?`visible`:`hidden`,width:`max-content`,minWidth:`${e}px`,maxWidth:`calc(100% - 16px)`,maxHeight:`${t}px`,backgroundColor:q.value.menu.backgroundColor,color:q.value.menu.color,borderColor:q.value.menu.borderColor,borderRadius:`${q.value.menu.borderRadius}px`}});function lr(e,t){let n=A.value,r=Pt.value;if(!n||!r)return null;let i=n.getScreenCTM();if(!i)return null;let a=n.createSVGPoint();a.x=e,a.y=t;let o=a.matrixTransform(i),s=r.getBoundingClientRect();return{x:o.x-s.left,y:o.y-s.top}}function ur(){let e=sr.value,t=Ft.value,n=Pt.value;if(!e||!t||!n){Sn.value=null;return}let r=lr(e.x,e.y),i=lr(e.x,e.y+q.value.marker.radius);if(!r||!i){Sn.value=null;return}let a=n.getBoundingClientRect(),o=t.offsetWidth,s=t.offsetHeight,c=Math.abs(i.y-r.y),l=Math.max(0,a.width-16),u=Math.min(o,l),d=r.x;if(u>=l)d=a.width/2;else{let e=u/2;d=Math.min(a.width-8-e,Math.max(8+e,r.x))}let f=r.y+c+8,p=r.y-c-8-s,m=f+s<=a.height-8,h=p>=8,g=f;!m&&h?g=p:m||(g=Math.min(Math.max(8,f),Math.max(8,a.height-s-8))),Sn.value={left:`${d}px`,top:`${g}px`,transform:`translateX(-50%)`,visibility:`visible`}}function dr(){typeof window<`u`&&(Z!==null&&window.cancelAnimationFrame(Z),Z=window.requestAnimationFrame(()=>{Z=null,ur()}))}De(or,e=>{X.value&&!e.some(e=>e.stackId===X.value)&&pr()}),De(()=>{let e=sr.value;return e?[e.stackId,e.x,e.y,e.hiddenDatapoints.length,e.hiddenDatapoints.map(e=>`${e.id}:${e.label}:${e.position}`).join(`|`),q.value.marker.radius,q.value.menu.width,q.value.menu.maxHeight,q.value.menu.backgroundColor,q.value.menu.color,q.value.menu.borderColor,q.value.menu.borderRadius,Zt.value]:null},e=>{e?ye(dr):Sn.value=null},{flush:`post`}),De(Ft,(e,t)=>{t&&En&&En.unobserve(t),e&&En&&(En.observe(e),ye(dr))},{flush:`post`}),De(()=>{let e=xn.value;return!e||An.value.overflowMemberIds.has(e)},e=>{e||(xn.value=null,Y.value=null)});function fr(e){e&&(X.value===e.stackId?dr():(Sn.value=null,X.value=e.stackId,ye(dr)))}function pr(){X.value=null,Sn.value=null,typeof window<`u`&&Z!==null&&(window.cancelAnimationFrame(Z),Z=null)}function mr(){Tn!==null&&(clearTimeout(Tn),Tn=null)}function hr(){let e=Y.value;e&&!e.moved&&(mr(),Cn.value=e.stackId,xn.value=null,Y.value=null,pr(),Tn=setTimeout(()=>{Cn.value=null,Tn=null},q.value.transitionDuration+80))}function gr(e){if(!(e instanceof Element))return{isMenu:!1,isMarker:!1,isSelectedDatapoint:!1};let t=Y.value,n=e.closest(`[data-datapoint-id]`);return{isMenu:!!e.closest(`[data-stack-overflow-menu]`),isMarker:!!e.closest(`[data-stack-overflow-marker]`),isSelectedDatapoint:!!(t&&n?.getAttribute(`data-datapoint-id`)===t.datapointId)}}function _r(e){let t=gr(e.target);X.value&&!t.isMenu&&!t.isMarker&&pr(),!Y.value||Y.value.moved||t.isMenu||t.isMarker||t.isSelectedDatapoint||hr()}function vr(e){let t=Nn.value.find(t=>t.id===e);if(!t||t.isStackOverflowHidden)return;let n=A.value?.querySelector(`[data-datapoint-index="${t.__index}"]`);n&&typeof n.focus==`function`&&n.focus({preventScroll:!0})}function yr(e){if(!e||e.disabled||j.value.readonly)return;let t=sr.value?.stackId;t&&(mr(),Cn.value=null,xn.value=e.id,Y.value={datapointId:e.id,stackId:t,initialPosition:e.position,moved:!1},pr(),ye(()=>{vr(e.id);let t=Nn.value.find(t=>t.id===e.id);t&&z(`selectDatapoint`,Gn(t))}))}function br(){let e=Math.max(1,Number(J.value.width)||1);return Math.max(1e-6,1/e*2)}function xr(e,t){let n=Y.value;n&&n.datapointId===e&&!n.moved&&Math.abs(t-n.initialPosition)>=br()&&(Y.value={...n,moved:!0})}Ce(()=>{document.addEventListener(`pointerdown`,_r),window.addEventListener(`resize`,dr,{passive:!0}),typeof ResizeObserver<`u`&&(En=new ResizeObserver(()=>{sr.value&&dr()}),Pt.value&&En.observe(Pt.value),A.value&&En.observe(A.value))}),Se(()=>{document.removeEventListener(`pointerdown`,_r),window.removeEventListener(`resize`,dr),En?.disconnect(),En=null,Z!==null&&(window.cancelAnimationFrame(Z),Z=null),mr()});function Sr(e){return L.value?L.value.id===e.id:tr.value===e.id||Q.value===e.id}function Cr(e){return u(M.value.dragMarker.positionIndicator.value.formatter,e.position,a({p:``,v:e.position*100,s:`%`,r:M.value.dragMarker.positionIndicator.value.rounding}))}let wr=v(()=>N.value.backgroundColor),Tr=v(()=>N.value.legend),Er=v(()=>N.value.title),{isCallbackImaging:Dr,isCallbackSvg:Or,generateSvg:kr,onGenerateImage:Ar}=ae({svg:A,title:Er,legend:Tr,legendItems:null,backgroundColor:wr,getSvgCallback:()=>j.value.userOptions.callbacks.svg,generateImage:Jt});function jr(e=null){ye(()=>{let t=un().map(e=>[[e.name],[e.position],[Cr(e)],[Wn(e.position)]]),n=[[N.value.title.text],[N.value.title.subtitle.text],[[`Name`],[`Position`],[`Percentage`],[`Phase`]]].concat(t),r=o(n);e?e(r):f({csvContent:r,title:N.value.title.text||`vue-ui-hill`})})}let Mr=v(()=>N.value.layout.stackbar.show),Nr=v(()=>{let e=Nn.value.length;Nn.value.reduce((e,t)=>e+(t?.position??0),0);let t=0,n=Nn.value.every(e=>e.position===1);return Nn.value.toSorted((e,t)=>{if(n)return e.__index-t.__index;let r=(e?.position??0)-(t?.position??0);return r===0?e.__index-t.__index:r}).map(n=>{let r=n?.position??0,i=e>0?r/e:0,a={...n,proportion:i,proportionStart:t};return t+=i,a})}),$=v(()=>Math.min(1,Math.max(0,Nr.value.reduce((e,t)=>e+t.proportion,0)))),Pr=v(()=>$.value*100),Fr=v(()=>J.value.left[0].x+J.value.width*$.value),Ir=v(()=>B.value.height+32+K.value.paddingTop);function Lr(){return u(K.value.label.formatter,Pr.value,a({p:``,v:Pr.value,s:`%`,r:0}))}let Rr=v(()=>`${Nt.value}-stackbar-clip`);async function zr(){let e=un();Rt(`copyAlt`,{config:j.value,dataset:e}),j.value.userOptions.callbacks.altCopy?await Promise.resolve(j.value.userOptions.callbacks.altCopy({config:j.value,dataset:e})):console.warn("Vue Data UI - A callback must be set for `altCopy` in userOptions.")}let Br=re(Pt,()=>N.value.title.text);function Vr(){return un()}return ee({isEditing:F,beginEditing:Ln,save:Rn,cancel:zn,getData:Vr,copyAlt:zr,toggleFullscreen:Qt,toggleAnnotator:en,generateImage:Jt,generateSvg:kr,generatePdf:qt,generateCsv:jr,getImage:Br}),(e,i)=>(C(),b(`div`,{ref_key:`hillChartRef`,ref:Pt,class:S(`vue-data-ui-component vue-ui-hill`),style:xe(Yn.value),id:`hill_${Nt.value}`,onMouseenter:Ut,onMouseleave:Wt,"data-editing":F.value},[N.value.title.text?(C(),b(`div`,Me,[(C(),pe(ie,{key:`title_${Lt.value}`,config:{title:{cy:`hill-div-title`,...N.value.title},subtitle:{cy:`hill-div-subtitle`,...N.value.title.subtitle}}},null,8,[`config`]))],512)):y(``,!0),j.value.userOptions.buttons.annotator&&A.value?(C(),pe(D(Dt),ve({key:1},D(n)(j.value.userOptions.annotator),{color:N.value.color,backgroundColor:N.value.backgroundColor,active:$t.value,svgRef:A.value,isCursorPointer:Yt.value,palette:j.value.userOptions.annotatorPalette,onClose:en}),me({_:2},[we(D(r),n=>({name:n,fn:Oe(r=>[T(e.$slots,n,be(_e(D(t)(n,r))),void 0,!0)])}))]),1040,[`color`,`backgroundColor`,`active`,`svgRef`,`isCursorPointer`,`palette`])):y(``,!0),G.value.show?(C(),pe(D(wt),{key:2,"is-editing":F.value,"is-editable":R.value,"is-fullscreen":Zt.value,position:tn.value,color:N.value.color,"background-color":N.value.backgroundColor,translations:G.value.buttons.translations,"is-cursor-pointer":Yt.value,onUpdate:Ln,onCancel:zn,onSave:Rn},{"hill-edit":Oe(()=>[T(e.$slots,`hill-edit`,{},void 0,!0)]),"hill-cancel":Oe(()=>[T(e.$slots,`hill-cancel`,{},void 0,!0)]),"hill-save":Oe(()=>[T(e.$slots,`hill-save`,{},void 0,!0)]),_:3},8,[`is-editing`,`is-editable`,`is-fullscreen`,`position`,`color`,`background-color`,`translations`,`is-cursor-pointer`])):y(``,!0),G.value.show?(C(),b(`div`,Ne,[x(`p`,{class:`vue-ui-hill__status`,style:xe(Xn.value),"aria-live":`polite`},E(F.value?G.value.status.editInstruction:G.value.status.lastUpdated),5)])):y(``,!0),j.value.userOptions.show&&(D(Ht)||D(Bt))?(C(),pe(D(Tt),ve({ref_key:`userOptionsRef`,ref:It,key:`uo_${Xt.value}`,backgroundColor:N.value.backgroundColor,color:N.value.color,isPrinting:D(Gt),isImaging:D(Kt),uid:Nt.value,hasTooltip:!1,isFullscreen:Zt.value,chartElement:Pt.value},D(se)(j.value.userOptions,`pdf csv img svg labels table fullscreen altCopy annotator`),{isAnnotation:$t.value,isCursorPointer:Yt.value,onToggleFullscreen:Qt,onGeneratePdf:D(qt),onGenerateCsv:jr,onGenerateImage:D(Ar),onGenerateSvg:D(kr),onToggleAnnotator:en,onCopyAlt:zr,style:{visibility:D(Ht)?D(Bt)?`visible`:`hidden`:`visible`}}),me({_:2},[we(D(oe)(e.$slots,`menuIcon optionPdf optionCsv optionImg optionSvg optionFullscreen optionAnnotator optionAltCopy custom-menu-before custom-menu-after`),t=>({name:t,fn:Oe(n=>[T(e.$slots,t,be(_e(D(ce)(t,n))),void 0,!0)])}))]),1040,[`backgroundColor`,`color`,`isPrinting`,`isImaging`,`uid`,`isFullscreen`,`chartElement`,`isAnnotation`,`isCursorPointer`,`onGeneratePdf`,`onGenerateImage`,`onGenerateSvg`,`style`])):y(``,!0),(C(),b(`svg`,{ref_key:`svgRef`,ref:A,style:xe({background:`transparent`,color:N.value.color,fontFamily:j.value.style.fontFamily}),class:S({"vue-data-ui-no-transition":!D(P)}),viewBox:`0 0 ${B.value.width} ${B.value.height+(Mr.value?32+K.value.paddingTop+K.value.paddingBottom+K.value.height:0)}`,role:`group`,"aria-live":`polite`,preserveAspectRatio:`xMidYMid meet`,onPointermove:Vn,onPointerup:Hn,onPointercancel:Hn},[he(D(Et)),T(e.$slots,`svg-underlayer`,{svg:{drawingArea:J.value,isEditing:F.value,datapoints:ar.value,isPrintingImg:D(Gt)||D(Kt)||D(Dr),isPrintingSvg:D(Or)}},void 0,!0),e.$slots[`chart-background`]?(C(),b(`foreignObject`,{key:0,x:0,y:0,width:Math.max(.1,B.value.width),height:Math.max(.1,B.value.height+(Mr.value?32+K.value.paddingTop+K.value.paddingBottom+K.value.height:0)),style:{pointerEvents:`none`}},[T(e.$slots,`chart-background`,{},void 0,!0)],8,Fe)):y(``,!0),V.value.baseline.show?(C(),b(`line`,{key:1,x1:J.value.startX,x2:J.value.endX,y1:J.value.baseY,y2:J.value.baseY,stroke:V.value.baseline.stroke,"stroke-width":V.value.baseline.strokeWidth,"stroke-dasharray":V.value.baseline.strokeDasharray,"vector-effect":`non-scaling-stroke`},null,8,Ie)):y(``,!0),V.value.midline.show?(C(),b(`line`,{key:2,x1:J.value.centerX,x2:J.value.centerX,y1:J.value.peakY,y2:J.value.baseY,stroke:V.value.midline.stroke,"stroke-width":V.value.midline.strokeWidth,"stroke-dasharray":V.value.midline.strokeDasharray,"vector-effect":`non-scaling-stroke`},null,8,Le)):y(``,!0),x(`path`,{d:mn.value,fill:`none`,stroke:V.value.curve.stroke,"stroke-width":V.value.curve.strokeWidth,"stroke-dasharray":V.value.curve.strokeDasharray,"stroke-linecap":`round`,"stroke-linejoin":`round`,"vector-effect":`non-scaling-stroke`},null,8,Re),M.value.dragMarker.positionIndicator.show?(C(!0),b(_,{key:3},we(ar.value,e=>(C(),b(`g`,{key:`position-indicator-${e.id}`},[Sr(e)&&H.value.dragMarker.show?(C(),b(`g`,ze,[x(`path`,{d:`M${e.x},${e.y} ${e.x},${J.value.baseY}`,stroke:M.value.dragMarker.positionIndicator.useSerieColor?e.color:M.value.dragMarker.positionIndicator.color,"stroke-width":M.value.dragMarker.positionIndicator.strokeWidth,"stroke-dasharray":M.value.dragMarker.positionIndicator.strokeDasharray,"stroke-linecap":`round`,"vector-effect":`non-scaling-stroke`,class:S({"vue-data-ui-transition":D(P)&&L.value?.id!==e.id})},null,10,Be),M.value.dragMarker.positionIndicator.circle.show?(C(),b(`circle`,{key:0,cx:e.x,cy:J.value.baseY,r:M.value.dragMarker.positionIndicator.circle.radius,fill:M.value.dragMarker.positionIndicator.useSerieColor?e.color:M.value.dragMarker.positionIndicator.color,stroke:M.value.dragMarker.positionIndicator.circle.stroke,"stroke-width":M.value.dragMarker.positionIndicator.circle.strokeWidth,"vector-effect":`non-scaling-stroke`,"paint-order":`stroke fill`,class:S({"vue-data-ui-transition":D(P)&&L.value?.id!==e.id})},null,10,Ve)):y(``,!0),M.value.dragMarker.positionIndicator.value.show?(C(),b(`text`,{key:1,"paint-order":`stroke fill`,"vector-effect":`non-scaling-stroke`,"text-anchor":`middle`,transform:`translate(${e.x}, ${J.value.baseY+M.value.radius+M.value.dragMarker.positionIndicator.value.offsetY+M.value.dragMarker.positionIndicator.value.fontSize})`,"font-size":M.value.dragMarker.positionIndicator.value.fontSize,fill:M.value.dragMarker.positionIndicator.value.useSerieColor?e.color:M.value.dragMarker.positionIndicator.value.color,stroke:N.value.backgroundColor,"stroke-width":`1`,class:S({"vue-data-ui-transition":D(P)&&L.value?.id!==e.id})},E(Cr(e)),11,He)):y(``,!0)])):y(``,!0)]))),128)):y(``,!0),(C(!0),b(_,null,we(ar.value,e=>(C(),b(`g`,{key:e.id,"data-cy-datapoint":``,class:S({"vue-ui-hill__datapoint":!0,"vue-data-ui-transition":D(P)&&L.value?.id!==e.id,"vue-ui-hill__datapoint--promoted":D(P)&&e.isPromotedFromStackOverflow}),style:xe({opacity:[0,1].includes(e.position)||e?.muted?H.value.mutedOpacity:e?.disabled?H.value.disabledOpacity:1}),transform:`translate(${e.x} ${e.y})`,"data-datapoint-index":e.__index,"data-datapoint-id":e.id,role:`slider`,tabindex:F.value&&R.value&&!e.disabled?0:-1,"aria-orientation":`horizontal`,"aria-valuemin":`0`,"aria-valuemax":`100`,"aria-valuenow":Cr(e),"aria-valuetext":`${e.label}: ${Wn(e.position)}, ${Cr(e)}`,"aria-label":e.label,onFocus:t=>nr(e),onBlur:t=>rr(e),onKeydown:t=>Un(t,e),onPointerenter:t=>Kn(e),onPointerleave:t=>qn(e),onClick:t=>Jn(e)},[x(`circle`,{r:H.value.hitRadius,fill:`transparent`,class:S({"vue-ui-hill__hit-area--active":F.value&&R.value&&!e.disabled,"vue-ui-hill__hit-area--dragging":L.value?.id===e.id}),onPointerdown:t=>Bn(t,e)},null,42,We),x(`circle`,{class:`vue-ui-hill-circle`,r:H.value.radius,fill:e.color,stroke:H.value.stroke,"stroke-width":H.value.strokeWidth,style:xe({filter:H.value.shadow.show?`drop-shadow(${H.value.shadow.offsetX}px ${H.value.shadow.offsetY}px ${H.value.shadow.blur}px ${H.value.shadow.color})`:`none`}),"vector-effect":`non-scaling-stroke`,"pointer-events":`none`},null,12,Ge),F.value&&(L.value?.id===e.id&&H.value.dragMarker.show||Sr(e))&&!e?.disabled?(C(),b(`g`,{key:0,fill:`none`,stroke:D(p)(e.color),"stroke-width":H.value.dragMarker.strokeWidth,"stroke-linecap":`round`,"stroke-linejoin":`round`,"pointer-events":`none`,"vector-effect":`non-scaling-stroke`,"aria-hidden":`true`},[x(`path`,{d:H.value.dragMarker.crossPath},null,8,qe)],8,Ke)):y(``,!0),U.value.show?(C(),b(`text`,{key:1,x:e.labelX,y:U.value.offsetY,"text-anchor":e.textAnchor,fill:U.value.useSerieColor?e.color:U.value.color,"font-size":U.value.fontSize,"font-weight":U.value.bold?`bold`:`normal`,"paint-order":`stroke fill`,stroke:U.value.stroke,"stroke-width":U.value.strokeWidth,"stroke-linejoin":`round`,"stroke-linecap":`round`,"pointer-events":`none`,style:{"user-select":`none`},"dominant-baseline":`central`},E(D(l)(e.label,U.value.ellipsisThresholdChars)),9,Je)):y(``,!0)],46,Ue))),128)),(C(!0),b(_,null,we(or.value,e=>(C(),b(`g`,{key:`stack-overflow-${e.stackId}`,class:S([`vue-ui-hill__stack-overflow-marker`,{"vue-ui-hill__stack-overflow-marker--animated":D(P),"vue-ui-hill__stack-overflow-marker--restored":Cn.value===e.stackId}]),style:xe({"--vue-ui-hill-overflow-marker-duration":`${q.value.transitionDuration*.7}ms`,"--vue-ui-hill-overflow-marker-delay":`${q.value.transitionDuration*.3}ms`,"--vue-ui-hill-overflow-label-duration":`${q.value.transitionDuration*.55}ms`,"--vue-ui-hill-overflow-label-delay":`${q.value.transitionDuration*.45}ms`,cursor:Yt.value&&!j.value.readonly?`pointer`:`default`}),transform:`translate(${e.x} ${e.y})`,"data-stack-overflow-marker":``,role:`button`,tabindex:F.value&&R.value?0:-1,"aria-label":`${e.hiddenCount} stacked datapoints. Activate to choose one.`,"aria-expanded":X.value===e.stackId,onPointerdown:i[0]||=O(()=>{},[`stop`]),onClick:O(t=>fr(e),[`stop`]),onFocus:t=>fr(e),onKeydown:[ke(O(t=>fr(e),[`prevent`,`stop`]),[`enter`]),ke(O(t=>fr(e),[`prevent`,`stop`]),[`space`]),ke(O(pr,[`prevent`,`stop`]),[`esc`])]},[D(P)&&Cn.value!==e.stackId?(C(),b(`g`,Xe,[(C(!0),b(_,null,we(e.collapseDatapoints,t=>(C(),b(`circle`,{key:`overflow-ghost-${e.stackId}-${t.id}`,cx:t.relativeX,cy:t.relativeY,r:H.value.radius,fill:t.color,stroke:H.value.stroke,"stroke-width":H.value.strokeWidth,opacity:`0.8`,"vector-effect":`non-scaling-stroke`},[x(`animate`,{attributeName:`cx`,from:t.relativeX,to:`0`,dur:`${q.value.transitionDuration}ms`,fill:`freeze`,calcMode:`spline`,keyTimes:`0;1`,keySplines:`0.22 1 0.36 1`},null,8,Qe),x(`animate`,{attributeName:`cy`,from:t.relativeY,to:`0`,dur:`${q.value.transitionDuration}ms`,fill:`freeze`,calcMode:`spline`,keyTimes:`0;1`,keySplines:`0.22 1 0.36 1`},null,8,$e),x(`animate`,{attributeName:`r`,from:H.value.radius,to:q.value.marker.radius*.7,dur:`${q.value.transitionDuration}ms`,fill:`freeze`},null,8,et),x(`animate`,{attributeName:`opacity`,from:`0.8`,to:`0`,dur:`${q.value.transitionDuration*.85}ms`,fill:`freeze`},null,8,tt)],8,Ze))),128))])):y(``,!0),x(`circle`,{r:Math.max(H.value.hitRadius,q.value.marker.radius),fill:`transparent`,"pointer-events":`all`},null,8,nt),x(`rect`,{class:`vue-ui-hill__stack-overflow-marker-rect`,x:-q.value.marker.radius,y:-q.value.marker.radius,width:q.value.marker.radius*2,height:q.value.marker.radius*2,fill:q.value.marker.fill,stroke:q.value.marker.stroke,"stroke-width":q.value.marker.strokeWidth,"vector-effect":`non-scaling-stroke`,"pointer-events":`none`},null,8,rt),x(`g`,{class:`vue-ui-hill__stack-overflow-focus-cross`,fill:`none`,stroke:D(p)(V.value.curve.stroke),"stroke-width":H.value.dragMarker.strokeWidth,"stroke-linecap":`round`,"stroke-linejoin":`round`,"pointer-events":`none`,"vector-effect":`non-scaling-stroke`,"aria-hidden":`true`},[x(`path`,{d:H.value.dragMarker.crossPath},null,8,at)],8,it),sr.value?y(``,!0):(C(),b(`text`,{key:1,class:`vue-ui-hill__stack-overflow-marker-label`,"text-anchor":`middle`,y:q.value.marker.radius+q.value.marker.offsetY+q.value.marker.fontSize,fill:q.value.marker.color,"font-size":q.value.marker.fontSize,"font-weight":q.value.marker.bold?`bold`:`normal`,"pointer-events":`none`,style:{"user-select":`none`},"paint-order":`stroke fill`,"vector-effect":`non-scaling-stroke`,stroke:N.value.backgroundColor,"stroke-width":`3`},` +`+E(e.hiddenCount),9,ot))],46,Ye))),128)),W.value.show?(C(),b(_,{key:4},[x(`text`,{x:(J.value.startX+J.value.centerX)/2,y:Zn.value,"text-anchor":`middle`,fill:W.value.color,"font-size":W.value.fontSize,"font-weight":W.value.bold?`bold`:`normal`,"letter-spacing":W.value.letterSpacing},E(Qn(`left`)),9,st),x(`text`,{x:(J.value.centerX+J.value.endX)/2,y:Zn.value,"text-anchor":`middle`,fill:W.value.color,"font-size":W.value.fontSize,"font-weight":W.value.bold?`bold`:`normal`,"letter-spacing":W.value.letterSpacing},E(Qn(`right`)),9,ct)],64)):y(``,!0),Mr.value?(C(),b(_,{key:5},[x(`rect`,{x:J.value.left[0].x,y:Ir.value,rx:K.value.height/2,width:J.value.width,height:K.value.height,fill:K.value.gutterColor},null,8,lt),x(`defs`,null,[x(`clipPath`,{id:Rr.value},[x(`rect`,{x:J.value.left[0].x,y:Ir.value,width:J.value.width*$.value,height:K.value.height,rx:Math.min(K.value.height/2,J.value.width*$.value/2),ry:Math.min(K.value.height/2,J.value.width*$.value/2)},null,8,dt)],8,ut)]),x(`g`,{"clip-path":`url(#${Rr.value})`},[(C(!0),b(_,null,we(Nr.value,e=>(C(),b(`rect`,{key:`bar_fill_${e.id}`,width:J.value.width*e.proportion,x:J.value.left[0].x+J.value.width*e.proportionStart,y:B.value.height+32+K.value.paddingTop,fill:e.color,height:K.value.height,onPointerenter:t=>Kn(e),onPointerleave:t=>qn(e)},null,40,pt))),128))],8,ft),(C(!0),b(_,null,we(Nr.value.slice(1),e=>(C(),b(`line`,{key:`bar_separator_${e.id}`,x1:J.value.left[0].x+J.value.width*e.proportionStart,x2:J.value.left[0].x+J.value.width*e.proportionStart,y1:B.value.height+32+K.value.paddingTop,y2:B.value.height+32+K.value.paddingTop+K.value.height,stroke:K.value.stroke,"stroke-width":K.value.strokeWidth,"vector-effect":`non-scaling-stroke`},null,8,mt))),128)),x(`rect`,{x:J.value.left[0].x,y:B.value.height+32+K.value.paddingTop,width:J.value.width*$.value,height:K.value.height,rx:Math.min(K.value.height/2,J.value.width*$.value/2),ry:Math.min(K.value.height/2,J.value.width*$.value/2),fill:`none`,stroke:K.value.stroke,"stroke-width":K.value.strokeWidth,"vector-effect":`non-scaling-stroke`},null,8,ht),K.value.label.show&&$.value>0?(C(),b(`text`,{key:0,x:Fr.value,y:Ir.value-6,fill:K.value.label.color,"font-size":K.value.label.fontSize,"text-anchor":`end`,"dominant-baseline":`auto`,"pointer-events":`none`,style:{"user-select":`none`}},E(Lr()),9,gt)):y(``,!0)],64)):y(``,!0),T(e.$slots,`svg`,{svg:{drawingArea:J.value,isEditing:F.value,datapoints:ar.value,isPrintingImg:D(Gt)||D(Kt)||D(Dr),isPrintingSvg:D(Or)}},void 0,!0)],46,Pe)),sr.value?(C(),b(`div`,{ref_key:`overflowMenuRef`,ref:Ft,key:`stack-overflow-menu-${sr.value.stackId}`,class:`vue-ui-hill__stack-overflow-menu`,"data-stack-overflow-menu":``,"data-dom-to-png-ignore":``,style:xe([cr.value,Sn.value]),role:`listbox`,"aria-label":`Choose one of ${sr.value.hiddenCount} stacked datapoints`,onPointerdown:i[1]||=O(()=>{},[`stop`]),onClick:i[2]||=O(()=>{},[`stop`]),onKeydown:ke(O(pr,[`prevent`,`stop`]),[`esc`])},[M.value.stacking.overflow.menu.title?(C(),b(`div`,vt,E(M.value.stacking.overflow.menu.title),1)):y(``,!0),(C(!0),b(_,null,we(sr.value.hiddenDatapoints,e=>(C(),b(`button`,{key:`hidden-${e.id}`,type:`button`,class:S([`vue-ui-hill__stack-overflow-menu-item`,{readonly:j.value.readonly}]),role:`option`,disabled:e.disabled,"aria-label":`${e.label}, ${Cr(e)}`,onClick:O(t=>yr(e),[`stop`]),style:xe({cursor:Yt.value&&!j.value.readonly?`pointer`:`default`})},[x(`span`,{class:`vue-ui-hill__stack-overflow-menu-swatch`,style:xe({backgroundColor:e.color}),"aria-hidden":`true`},null,4),x(`span`,bt,E(D(l)(e.label,U.value.ellipsisThresholdChars)),1),x(`span`,xt,E(Cr(e)),1)],14,yt))),128))],44,_t)):y(``,!0),T(e.$slots,`analysis`,{data:{...Nr.value}},void 0,!0),e.$slots.watermark?(C(),b(`div`,St,[T(e.$slots,`watermark`,be(_e({isPrinting:D(Gt)||D(Kt)||D(Dr)||D(Or)})),void 0,!0)])):y(``,!0),j.value.loading?(C(),b(`div`,Ct,[j.value.loading?T(e.$slots,`loading`,{},()=>[he(D(Ot),{name:`spinner2`,stroke:N.value.color,"is-spin":!0},null,8,[`stroke`])],!0,0):y(``,!0)])):y(``,!0)],44,je))}},[[`__scopeId`,`data-v-7c4727e2`]]);export{Ae as n,wt as t};
@@ -0,0 +1,2 @@
1
+ import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{n as t,r as n,t as r}from"./annotationSlots-OLiW25XN.js";import{t as i}from"./useConfig-C3FbHv4N.js";import{$ as a,D as o,Dt as s,Et as c,Ft as ee,Ht as te,J as ne,Q as re,S as ie,T as ae,X as oe,Zt as se,_ as ce,at as le,i as ue,in as de,nn as fe,nt as pe,qt as me,r as he,rn as l,t as ge,tn as _e,w as ve,yt as ye,zt as be}from"./lib-rPeBMZrn.js";import{n as xe,t as Se}from"./BaseScanner-8NdoBs7B.js";import{n as Ce,t as we}from"./useHints-C-TwxM0Y.js";import{t as Te}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{t as Ee}from"./useNestedProp-DnGoh-XS.js";import{t as De}from"./useThemeCheck-BKNRbGeC.js";import{t as Oe}from"./chartImage-DPGnEuYM.js";import{n as ke}from"./Title-BliHuXfT.js";import{t as Ae}from"./useChartExport-BZts4KFb.js";import{n as je,t as Me}from"./tableIntegration-CNoJ1CIY.js";import{n as Ne,r as Pe,t as Fe}from"./userOptionsSlots-CWtXN5Q6.js";import{t as Ie}from"./usePrinter-DVf3YcG5.js";import{t as Le}from"./useTransitions-ChGGrtrv.js";import{t as Re}from"./useSvgLabelLayout-42Kats14.js";import{t as ze}from"./useTimeLabelCollider-BTybMUFi.js";import{t as Be}from"./useResponsive-CENUxfEL.js";import{t as Ve}from"./DefGrad-DKMq1REY.js";import{t as He}from"./BaseLegendToggle-BIzyyI1h.js";import{t as Ue}from"./A11yDataTable-DWNlWXzs.js";import{t as We}from"./useUserOptionState-CXlFnwPv.js";import{t as Ge}from"./useChartAccessibility-DOMuYJfm.js";import{t as Ke}from"./Legend-DM0ClX3D.js";import{t as qe}from"./vue_ui_history_plot-soyqUW4Y.js";import{Fragment as u,Teleport as Je,computed as d,createBlock as f,createCommentVNode as p,createElementBlock as m,createElementVNode as h,createSlots as Ye,createTextVNode as Xe,createVNode as Ze,defineAsyncComponent as g,guardReactiveProps as _,mergeProps as Qe,nextTick as $e,normalizeClass as v,normalizeProps as y,normalizeStyle as b,onBeforeUnmount as et,onMounted as tt,openBlock as x,ref as S,renderList as C,renderSlot as w,resolveDynamicComponent as nt,shallowRef as rt,toDisplayString as T,toRefs as it,unref as E,watch as at,withCtx as D}from"vue";var ot=/* @__PURE__ */ e({default:()=>Gt}),st=[`id`],ct=[`id`],lt=[`id`],ut={style:{position:`relative`}},dt=[`xmlns`,`viewBox`,`aria-describedby`],ft=[`x`,`y`,`width`,`height`],pt={key:1},mt=[`id`,`x1`,`y1`,`x2`,`y2`],ht=[`stop-color`,`offset`],gt={key:2},_t=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`],vt={key:3},yt=[`stroke`,`stroke-width`,`x1`,`x2`,`y1`,`y2`],bt=[`x`,`y`,`fill`,`font-size`],xt=[`transform`,`font-size`,`fill`,`font-weight`],St={key:6},Ct=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`],wt={key:7},Tt=[`stroke`,`stroke-width`,`x1`,`x2`,`y1`,`y2`],Et=[`transform`,`fill`,`font-size`,`text-anchor`],Dt=[`x`,`y`,`font-size`,`fill`,`font-weight`],Ot=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`],kt=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`],At=[`d`,`stroke`,`stroke-width`],jt=[`d`,`stroke`,`stroke-width`],Mt=[`cx`,`cy`,`fill`,`r`],Nt=[`cx`,`cy`,`fill`,`r`,`stroke`,`stroke-width`],Pt={key:1},Ft=[`transform`,`font-size`,`fill`,`font-weight`],It=[`transform`,`font-size`,`fill`,`font-weight`,`innerHTML`],Lt={key:2},Rt=[`transform`,`font-size`,`font-weight`,`fill`],zt=[`cx`,`cy`,`r`,`onMouseenter`,`onMouseleave`,`onClick`],Bt={key:0,style:{position:`absolute`,top:`100%`,left:`0`,width:`100%`},"data-dom-to-png-ignore":``,"aria-hidden":`true`},Vt={key:5,class:`vue-data-ui-watermark`},Ht=[`id`],Ut=[`onClick`],Wt={style:{display:`flex`,"align-items":`center`}},Gt=/*#__PURE__*/ Te({__name:`vue-ui-history-plot`,props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:[`selectLegend`,`selectDatapoint`,`copyAlt`],setup(e,{expose:Te,emit:ot}){let Gt=g(()=>import(`./Tooltip-C1q0Qoh7.js`)),Kt=g(()=>import(`./BaseIcon-CoY0vuL3.js`).then(e=>e.n)),qt=g(()=>import(`./vue-ui-accordion-E8TJfFeK.js`).then(e=>e.n)),Jt=g(()=>import(`./DataTable-Dof6yhO7.js`)),Yt=g(()=>import(`./PenAndPaper-DoNTA-SV.js`).then(e=>e.t)),Xt=g(()=>import(`./UserOptions-B9EyfU9n.js`).then(e=>e.n)),Zt=g(()=>import(`./PackageVersion-DKSNC-YP.js`).then(e=>e.t)),Qt=g(()=>import(`./BaseDraggableDialog-BK7dj9O6.js`).then(e=>e.n)),{vue_ui_history_plot:$t}=i(),{isThemeValid:en,warnInvalidTheme:tn}=De(),O=e,k=S(null),nn=S(null),rn=S(0),an=S(null),on=S(0),sn=S(0),cn=S(0),A=rt(null),j=rt(null),ln=S(null),M=S(oe()),un=S(!1),dn=S(``),N=S([]),fn=S(!1),P=S(null),pn=S(!1),mn=S(null),hn=S(!1),gn=S(null),_n=S(null),vn=S(null),yn=S(null),bn=S(null),xn=S(null),F=S(null),I=S(null),Sn=S({x:0,y:0}),Cn=S(`pointer`),wn=S(!1),Tn=d({get:()=>!!O.dataset&&O.dataset.length,set:e=>e}),En=ot,Dn=S(!1),On=0;tt(()=>{hn.value=!0,An()});let kn=d(()=>L.value.debug);function An(){be(O.dataset)?(le({componentName:`VueUiHistoryPlot`,type:`dataset`,debug:kn.value}),Fn.value=!0):O.dataset.forEach((e,t)=>{ye({datasetObject:e,requiredAttributes:[`name`,`values`]}).forEach(e=>{Tn.value=!1,le({componentName:`VueUiHistoryPlot`,type:`datasetSerieAttribute`,property:e,index:t,debug:kn.value})})}),be(O.dataset)||(Fn.value=L.value.loading),L.value.responsive&&(A.value&&(j.value&&A.value.unobserve(j.value),A.value.disconnect()),A.value=new ResizeObserver(()=>{let{width:e,height:t}=Be({chart:k.value,title:V.value.title.text?nn.value:null,noTitle:ln.value,legend:V.value.legend.show?an.value:null,source:mn.value});cancelAnimationFrame(On),On=requestAnimationFrame(()=>{K.value.width=e,K.value.height=t,Dn.value=!0,L.value.responsiveProportionalSizing?(Y.value.plots=l({relator:Math.min(e,t),adjuster:600,source:R.value.radius,threshold:3,fallback:3}),Y.value.indexLabels=l({relator:Math.min(e,t),adjuster:600,source:R.value.indexLabels.fontSize,threshold:6,fallback:6}),Y.value.labels=l({relator:Math.min(e,t),adjuster:600,source:R.value.labels.fontSize,threshold:6,fallback:6}),Y.value.xAxisLabels=l({relator:Math.min(e,t),adjuster:600,source:B.value.x.labels.fontSize,threshold:6,fallback:6}),Y.value.xAxisName=l({relator:Math.min(e,t),adjuster:600,source:B.value.x.name.fontSize,threshold:6,fallback:6}),Y.value.yAxisLabels=l({relator:Math.min(e,t),adjuster:600,source:B.value.y.labels.fontSize,threshold:6,fallback:6}),Y.value.yAxisName=l({relator:Math.min(e,t),adjuster:600,source:B.value.y.name.fontSize,threshold:6,fallback:6})):(Y.value.plots=R.value.radius,Y.value.indexLabels=R.value.indexLabels.fontSize,Y.value.labels=R.value.labels.fontSize,Y.value.xAxisLabels=B.value.x.labels.fontSize,Y.value.xAxisName=B.value.x.name.fontSize,Y.value.yAxisLabels=B.value.y.labels.fontSize,Y.value.yAxisName=B.value.y.name.fontSize)})}),j.value=k.value.parentNode,A.value.observe(j.value))}et(()=>{cancelAnimationFrame(On),A.value&&(j.value&&A.value.unobserve(j.value),A.value.disconnect())});function jn(){let e=Ee({userConfig:O.config,defaultConfig:$t}),t={},n=e.theme;if(n){if(!en.value(e))tn(e),t=e;else{let r=Ee({userConfig:qe[n]||O.config,defaultConfig:e});t={...Ee({userConfig:O.config,defaultConfig:r}),customPalette:e.customPalette.length?e.customPalette:fe[n]||te}}}else t=e;return t}let L=S(jn()),R=d(()=>L.value.style.chart.plots),z=d(()=>L.value.style.chart.grid),B=d(()=>L.value.style.chart.axes),V=d(()=>L.value.style.chart);Ce({config:()=>L.value,dataset:()=>O.dataset,component:`VueUiHistoryPlot`,rules:[we.emptyArray,{test:e=>e.length>6,message:[`👀 The number of series is > 6. Consider:`,``,`▶️ Using filters to let users choose a maximum number of series to display.`]}]});let{transitionEnabled:H}=Le({config:()=>L.value.transitions,dataset:()=>O.dataset}),U=d(()=>L.value.userOptions.useCursorPointer),Mn=d(()=>de({defaultConfig:{userOptions:{show:!1},table:{show:!1},style:{chart:{backgroundColor:`#99999930`,axes:{x:{scaleMin:0,scaleMax:10,labels:{show:!1},name:{text:``}},y:{scaleMin:0,scaleMax:10,labels:{show:!1},name:{text:``}}},grid:{xAxis:{stroke:`#6A6A6A`},horizontalLines:{stroke:`#6A6A6A50`},yAxis:{stroke:`#6A6A6A`},verticalLines:{stroke:`#6A6A6A50`}},legend:{backgroundColor:`transparent`},paths:{useSerieColor:!1,stroke:`#6A6A6A`},plots:{stroke:`#6A6A6A`,indexLabels:{show:!1},labels:{show:!1}}}}},userConfig:L.value.skeletonConfig??{}})),{loading:Nn,FINAL_DATASET:Pn,manualLoading:Fn}=xe({...it(O),FINAL_CONFIG:L,prepareConfig:jn,skeletonDataset:O.config?.skeletonDataset??[{name:``,color:`#CACACA`,values:[{label:``,x:1,y:9},{label:``,x:4,y:1},{label:``,x:7,y:9},{label:``,x:9,y:4}]}],skeletonConfig:de({defaultConfig:L.value,userConfig:Mn.value})}),{userOptionsVisible:In,setUserOptionsVisibility:Ln,keepUserOptionState:Rn}=We({config:L.value}),{svgRef:W}=Ge({config:V.value.title}),zn=se(O.config);at(()=>O.config,(e,t)=>{let n=se(e),r=n!==zn;zn=n;let i=jn();r?(Nn.value||(L.value=i),In.value=!L.value.userOptions.showOnChartHover,An(),rn.value+=1,sn.value+=1,on.value+=1,K.value.height=V.value.height,K.value.width=V.value.width,Y.value.plots=R.value.radius,Y.value.indexLabels=R.value.indexLabels.fontSize,Y.value.labels=R.value.labels.fontSize,Y.value.xAxisLabels=B.value.x.labels.fontSize,Y.value.xAxisName=B.value.x.name.fontSize,Y.value.yAxisLabels=B.value.y.labels.fontSize,Y.value.yAxisName=B.value.y.name.fontSize,G.value.showTable=L.value.table.show,G.value.showTooltip=V.value.tooltip.show):(L.value.style.chart.tooltip=i.style.chart.tooltip,G.value.showTooltip=L.value.style.chart.tooltip.show)},{deep:!0}),at(()=>O.dataset,e=>{Array.isArray(e)&&e.length>0&&(Fn.value=!1)},{deep:!0});let{isPrinting:Bn,isImaging:Vn,generatePdf:Hn,generateImage:Un}=Ie({elementId:`history_plot_${M.value}`,fileName:V.value.title.text||`vue-ui-history-plot`,options:L.value.userOptions.print}),Wn=d(()=>L.value.userOptions.show&&!V.value.title.text),Gn=d(()=>ve(L.value.customPalette)),G=S({showTable:L.value.table.show,showTooltip:V.value.tooltip.show});at(L,()=>{G.value={showTable:L.value.table.show,showTooltip:V.value.tooltip.show}},{immediate:!0});let K=S({height:V.value.height,width:V.value.width}),Kn=d(()=>K.value.width),qn=d(()=>K.value.height),{metrics:Jn,ready:Yn,settling:q,update:Xn}=Re({svgRef:W,canMeasure:()=>!L.value.responsive||Dn.value,initialMetrics:{scaleLabelsWidth:0,yAxisLabelWidth:0,xAxisLabelHeight:0,timeLabelsHeight:0},measure:e=>({scaleLabelsWidth:e(xn.value).textWidth,yAxisLabelWidth:e(yn.value).rotatedWidth,xAxisLabelHeight:e(vn.value).height,timeLabelsHeight:e(bn.value).height})});function Zn(){let e=Jn.value.scaleLabelsWidth,t=Jn.value.yAxisLabelWidth;return e+t+(t?24:0)}let Qn=d(()=>Jn.value.xAxisLabelHeight+Jn.value.timeLabelsHeight+(vn.value?Y.value.xAxisName/2:0)),J=d(()=>{let e=V.value.padding.left,t=V.value.padding.top,n=Zn(),r=R.value.radius;return{left:e+n+B.value.y.name.offsetX,top:t+r,right:K.value.width-V.value.padding.right-r-B.value.y.name.offsetX,bottom:K.value.height-V.value.padding.bottom-Qn.value-r-B.value.x.name.offsetY,width:K.value.width-e-V.value.padding.right-n-r-B.value.y.name.offsetX,height:K.value.height-t-V.value.padding.bottom-Qn.value-r*2-B.value.x.name.offsetY}}),Y=S({plots:R.value.radius,indexLabels:R.value.indexLabels.fontSize,labels:R.value.labels.fontSize,xAxisLabels:B.value.x.labels.fontSize,xAxisName:B.value.x.name.fontSize,yAxisLabels:B.value.y.labels.fontSize,yAxisName:B.value.y.name.fontSize}),X=d(()=>Pn.value.map((e,t)=>{let n=Array.isArray(e.temperatureColors)&&e.temperatureColors.length?e.temperatureColors.map(e=>ie(e)):void 0;return{...e,color:e.color?ie(e.color):Gn.value[t]||te[t]||te[t%te.length],temperatureColors:n,temperatureAngle:$n(e.temperatureAngle),temperatureIndependant:e.temperatureIndependant===!0,usePlotTemperatureColors:e.usePlotTemperatureColors!==!1,seriesIndex:t}}));function $n(e=0){let t=Number(e);return Number.isFinite(t)?(t%360+360)%360:0}let er=d(()=>Math.max(...X.value.filter(e=>!N.value.includes(e.seriesIndex)).flatMap(e=>e.values.map(e=>e.x)))),tr=d(()=>{let e=Math.min(...X.value.filter(e=>!N.value.includes(e.seriesIndex)).flatMap(e=>e.values.map(e=>e.x)));return e<0?e:0}),nr=d(()=>Math.max(...X.value.filter(e=>!N.value.includes(e.seriesIndex)).flatMap(e=>e.values.map(e=>e.y)))),rr=d(()=>{let e=Math.min(...X.value.filter(e=>!N.value.includes(e.seriesIndex)).flatMap(e=>e.values.map(e=>e.y)));return e<0?e:0}),Z=d(()=>{let e=ce(B.value.x.scaleMin??tr.value,B.value.x.scaleMax??er.value,B.value.x.ticks),t=ce(B.value.y.scaleMin??rr.value,B.value.y.scaleMax??nr.value,B.value.y.ticks);return{x:e,y:t,tickX:e.ticks.map(t=>({x:J.value.left+(t-e.min)/(e.max-e.min)*J.value.width,y1:J.value.top,y2:J.value.bottom,value:t})),tickY:t.ticks.map(e=>({y:J.value.bottom-(e-t.min)/(t.max-t.min)*J.value.height,x1:J.value.left,x2:J.value.right,value:e}))}});function ir(e){let t=Z.value.x.min<0?Math.abs(Z.value.x.min):Z.value.x.min>0?-Z.value.x.min:0;return J.value.left+((e||0)+t)/(Z.value.x.max+t)*J.value.width}function ar(e){let t=Z.value.y.min<0?Math.abs(Z.value.y.min):Z.value.y.min>0?-Z.value.y.min:0;return J.value.bottom-((e||0)+t)/(Z.value.y.max+t)*J.value.height}let Q=d(()=>X.value.filter(e=>!N.value.includes(e.seriesIndex)).map((e,t)=>{let n=e.values.map((t,n)=>({valueX:t.x,valueY:t.y,label:t.label,x:ir(t.x),y:ar(t.y),color:e.color,seriesName:e.name,id:oe()})),r=e.smooth?ae(n):n.map(e=>`${e.x},${e.y} `).join(``).trim();return{...e,gradientIndex:t,plots:n,path:`M${r}`}})),or=d(()=>{if(P.value===null||F.value===null)return Q.value;let e=Q.value.findIndex(e=>e.seriesIndex===F.value);if(e===-1)return Q.value;let t=Q.value[e];return[...Q.value.slice(0,e),...Q.value.slice(e+1),t]}),sr=d(()=>Q.value.some(e=>cr(e)));function cr(e){return Array.isArray(e?.temperatureColors)&&e.temperatureColors.length}function lr(e){return cr(e)&&e.usePlotTemperatureColors}function ur(e){let t=Array.isArray(e?.plots)?e.plots:[];if(!t.length)return{minX:0,maxX:0,minY:0,maxY:0,width:0,height:0};let n=t.map(e=>e.x),r=t.map(e=>e.y),i=Math.min(...n),a=Math.max(...n),o=Math.min(...r),s=Math.max(...r);return{minX:i,maxX:a,minY:o,maxY:s,width:a-i,height:s-o}}function dr(){let e=J.value;return{minX:e.left,maxX:e.right,minY:e.top,maxY:e.bottom,width:e.width,height:e.height}}function fr(e){return e?.temperatureIndependant?ur(e):dr()}function pr(e){let t=$n(e?.temperatureAngle)*Math.PI/180,n=Math.sin(t),r=Math.cos(t),i=fr(e),a=i.minX+i.width/2,o=i.minY+i.height/2,s=(Math.abs(n)*i.width+Math.abs(r)*i.height)/2||1;return{x1:a-n*s,y1:o-r*s,x2:a+n*s,y2:o+r*s}}function mr(e,t){let{x1:n,y1:r,x2:i,y2:a}=pr(e),o=i-n,s=a-r,c=o*o+s*s;if(!c)return 0;let ee=((t.x-n)*o+(t.y-r)*s)/c;return Math.min(1,Math.max(0,ee))}function $(e,t){return c({colors:e.temperatureColors,ratio:mr(e,t)})}function hr(e,t){return`temperature_plot_grad_history_${e.seriesIndex}_${t.id}_${M.value}`}function gr(e,t,n){return lr(e)?R.value.gradient.show?`url(#${hr(e,t)})`:$(e,t):R.value.gradient.show?`url(#gradient_${n}_${M.value})`:t.color}function _r(e,t){return lr(e)?$(e,t):e.color}function vr(e,t){return R.value.indexLabels.adaptColorToBackground?he(_r(e,t)):R.value.indexLabels.color}function yr(e,t){let n=Q.value.find(t=>t.seriesIndex===e);return n&&lr(n)?$(n,t):t.color}function br(e){return cr(e)?`url(#temperature_grad_history_${e.seriesIndex}_${M.value})`:V.value.paths.useSerieColor?e.color:V.value.paths.stroke}function xr(e){return P.value===null||F.value===e?1:Math.min(1,R.value.unselectedOpacity)}d(()=>P.value!==null&&F.value!==null);let Sr=S(!1);function Cr(){N.value.length?N.value=[]:Or.value.forEach(e=>{N.value.push(e.seriesIndex)}),En(`selectLegend`,Q.value)}function wr(e){N.value.includes(e)?N.value=N.value.filter(t=>t!==e):N.value.push(e),En(`selectLegend`,Q.value)}function Tr(e){return X.value.length?X.value.find(t=>t.name===e)||(kn.value&&console.warn(`VueUiHistoryPlot - Series name not found "${e}"`),null):(kn.value&&console.warn(`VueUiHistoryPlot - There are no series to show.`),null)}function Er(e){let t=Tr(e);t!==null&&N.value.includes(t.seriesIndex)&&wr(t.seriesIndex)}function Dr(e){let t=Tr(e);t!==null&&(N.value.includes(t.seriesIndex)||wr(t.seriesIndex))}let Or=d(()=>X.value.map(e=>{let t=cr(e)?e.temperatureColors:null;return{...e,gradientColors:t,opacity:N.value.includes(e.seriesIndex)?.5:1,segregate:()=>wr(e.seriesIndex),isSegregated:N.value.includes(e.seriesIndex),shape:t?`gradient`:`circle`}})),kr=d(()=>({cy:`history-plot-div-legend`,backgroundColor:V.value.legend.backgroundColor,color:V.value.legend.color,fontSize:V.value.legend.fontSize,paddingBottom:12,fontWeight:V.value.legend.bold?`bold`:``}));function Ar({datapoint:e,plotIndex:t,seriesIndex:n}){L.value.events.datapointClick&&L.value.events.datapointClick({datapoint:{...e,plotIndex:t,seriesIndex:n},seriesIndex:n}),En(`selectDatapoint`,e)}function jr(e){fn.value=e,cn.value+=1}let Mr=S(null);function Nr({datapoint:e,plotIndex:t,seriesIndex:n}){L.value.events.datapointLeave&&L.value.events.datapointLeave({datapoint:{...e,plotIndex:t,seriesIndex:n},seriesIndex:n}),(Cn.value!==`keyboard`||F.value!==n||I.value!==t)&&(un.value=!1,P.value=null)}function Pr(e,t){if(!W.value)return;let n=Q.value.find(t=>t.seriesIndex===e);if(!n)return;let r=n.plots[t];if(!r)return;let i=_e(r.x,r.y,W.value);i&&(Sn.value=i)}function Fr({datapoint:e,plotIndex:t,seriesIndex:n,triggerMode:r=`pointer`}){L.value.events.datapointEnter&&L.value.events.datapointEnter({datapoint:{...e,plotIndex:t,seriesIndex:n},seriesIndex:n}),F.value=n,I.value=t,Cn.value=r,Sr.value=!0;let i=yr(n,e),o={...e,color:i};Mr.value={datapoint:o,color:i,seriesIndex:n,plotIndex:t,config:L.value,series:X.value},P.value=e;let c=V.value.tooltip.customFormat;if(pn.value=!1,s(c))try{let e=c({seriesIndex:n,datapoint:o,color:i,plotIndex:t,series:X.value,config:L.value});typeof e==`string`&&(dn.value=e,pn.value=!0)}catch{console.warn(`Custom format cannot be applied.`),pn.value=!1}if(!pn.value){let t=``;t+=`<div style="display:flex;flex-direction:row;gap:6px;align-items:center;border-bottom:1px solid ${V.value.tooltip.borderColor};margin-bottom:3px;padding-bottom:6px;"><svg viewBox="0 0 12 12" height="14" width="14"><circle cx="6" cy="6" r="6" stroke="none" fill="${i}"/></svg><span>${e.seriesName}</span></div>`,t+=`<div>${e.label}</div>`,t+=`<div>${B.value.x.name.text||`x`}: ${ue(B.value.x.labels.formatter,e.valueX,a({p:B.value.x.labels.prefix,v:e.valueX,s:B.value.x.labels.suffix,r:B.value.x.labels.rounding}))}</div>`,t+=`<div>${B.value.y.name.text||`y`}: ${ue(B.value.y.labels.formatter,e.valueY,a({p:B.value.y.labels.prefix,v:e.valueY,s:B.value.y.labels.suffix,r:B.value.y.labels.rounding}))}</div>`,dn.value=`<div>${t}</div>`}un.value=!0,r===`keyboard`&&$e(()=>{Pr(n,t)})}d(()=>({head:Q.value.map(e=>({name:e.name,color:e.color}))}));let Ir=d(()=>{let e=[L.value.table.columnNames.series,L.value.table.columnNames.datapoint,L.value.table.columnNames.x,L.value.table.columnNames.y];return{head:e,body:Q.value.flatMap(e=>e.plots.map(e=>[{color:e.color,name:e.seriesName},e.label,ue(B.value.x.labels.formatter,e.valueX,a({p:B.value.x.labels.prefix,v:e.valueX,s:B.value.x.labels.suffix,r:B.value.x.labels.rounding})),ue(B.value.y.labels.formatter,e.valueY,a({p:B.value.y.labels.prefix,v:e.valueY,s:B.value.y.labels.suffix,r:B.value.y.labels.rounding}))])),config:{th:{backgroundColor:L.value.table.th.backgroundColor,color:L.value.table.th.color,outline:L.value.table.th.outline},td:{backgroundColor:L.value.table.td.backgroundColor,color:L.value.table.td.color,outline:L.value.table.td.outline},breakpoint:L.value.table.responsiveBreakpoint},colNames:e}});function Lr(e=null){$e(()=>{let t=[[L.value.table.columnNames.series],[L.value.table.columnNames.datapoint],[L.value.table.columnNames.x],[L.value.table.columnNames.y]],n=Q.value.flatMap(e=>e.plots.map(e=>[[e.seriesName],[e.label],[e.valueX],[e.valueY]])),r=[[V.value.title.text],[V.value.title.subtitle.text],t].concat(n),i=o(r);e?e(i):pe({csvContent:i,title:V.value.title.text||`vue-ui-history-plot`})})}let Rr=S(!1);function zr(){Rr.value=!Rr.value}function Br(){G.value.showTable=!G.value.showTable}function Vr(){G.value.showTooltip=!G.value.showTooltip}function Hr(){return Q.value}let Ur=Oe(k,()=>V.value.title.text),Wr=d(()=>Z.value.tickX),Gr=d(()=>({start:0,end:Z.value.tickX.length}));ze({timeLabelsEls:bn,timeLabels:Wr,slicer:Gr,configRef:L,rotationPath:[`style`,`chart`,`axes`,`x`,`labels`,`rotation`],autoRotatePath:[`style`,`chart`,`axes`,`x`,`labels`,`autoRotate`,`enable`],isAutoSize:!1,width:Kn,height:qn,targetClass:`.vue-ui-history-plot-x-axis-scale`,rotation:B.value.x.labels.autoRotate.angle});let Kr=d(()=>Me({config:L,style:V,mutableConfig:G,dialog:Qt,accordion:qt,isFullscreen:fn,parent:k,maxWidth:800}));at(()=>G.value.showTable,e=>je(e,L,gn));function qr(){G.value.showTable=!1,_n.value&&_n.value.setTableIconState(!1)}let Jr=d(()=>V.value.backgroundColor),Yr=d(()=>V.value.legend),Xr=d(()=>V.value.title),{isCallbackImaging:Zr,isCallbackSvg:Qr,generateSvg:$r,onGenerateImage:ei}=Ae({svg:W,title:Xr,legend:Yr,legendItems:Or,backgroundColor:Jr,getSvgCallback:()=>L.value.userOptions.callbacks.svg,generateImage:Un});async function ti(){En(`copyAlt`,{config:L.value,dataset:Q.value}),L.value.userOptions.callbacks.altCopy?await Promise.resolve(L.value.userOptions.callbacks.altCopy({config:L.value,dataset:Q.value})):console.warn("Vue Data UI - A callback must be set for `altCopy` in userOptions.")}let ni=d(()=>({head:Ir.value.head,body:Ir.value.body.map(e=>[e[0]?.name||``,e[1],e[2],e[3]]),caption:L.value.a11y.translations.tableCaption,notice:L.value.a11y.translations.tableAvailable}));function ri(e){return Q.value.findIndex(t=>t.seriesIndex===e)}function ii(){if(F.value!==null&&I.value!==null){let e=Q.value.find(e=>e.seriesIndex===F.value)?.plots?.[I.value];e&&Nr({datapoint:e,plotIndex:I.value,seriesIndex:F.value})}F.value=null,I.value=null,Cn.value=`pointer`,un.value=!1,P.value=null}function ai(){F.value=null,I.value=null,wn.value=!0}function oi(){ii(),wn.value=!1}function si(e,t){if(!e?.plots?.length)return null;let n=e.plots.length;return(t%n+n)%n}function ci({seriesIndex:e,plotIndex:t,direction:n}){if(!Q.value.length)return null;let r=ri(e);if(r===-1)return null;if(n===`up`||n===`down`){let e=Q.value[r];if(!e?.plots?.length)return null;let i=si(e,t+(n===`up`?-1:1));return{seriesIndex:e.seriesIndex,plotIndex:i}}if(n===`left`||n===`right`){let e=((r+(n===`left`?-1:1))%Q.value.length+Q.value.length)%Q.value.length,i=Q.value[e];if(!i?.plots?.length)return null;let a=Math.min(t,i.plots.length-1);return{seriesIndex:i.seriesIndex,plotIndex:a}}return null}function li(e){if(!W.value||Rr.value||document.activeElement!==W.value||!Q.value.length)return;let t=e.key===`ArrowLeft`,n=e.key===`ArrowRight`,r=e.key===`ArrowUp`,i=e.key===`ArrowDown`,a=e.key===`Enter`||e.key===` `,o=e.key===`Escape`;if(!t&&!n&&!r&&!i&&!a&&!o)return;if(e.preventDefault(),e.stopPropagation(),o){ii();return}if(a){if(F.value===null||I.value===null)return;let e=Q.value.find(e=>e.seriesIndex===F.value)?.plots?.[I.value];if(!e)return;Ar({datapoint:e,plotIndex:I.value,seriesIndex:F.value});return}let s=null;if(F.value===null||I.value===null){let e=Q.value[0];if(!e?.plots?.length)return;s={seriesIndex:e.seriesIndex,plotIndex:0}}else r?s=ci({seriesIndex:F.value,plotIndex:I.value,direction:`up`}):i?s=ci({seriesIndex:F.value,plotIndex:I.value,direction:`down`}):t?s=ci({seriesIndex:F.value,plotIndex:I.value,direction:`left`}):n&&(s=ci({seriesIndex:F.value,plotIndex:I.value,direction:`right`}));if(!s)return;let c=Q.value.find(e=>e.seriesIndex===s.seriesIndex)?.plots?.[s.plotIndex];c&&Fr({datapoint:c,plotIndex:s.plotIndex,seriesIndex:s.seriesIndex,triggerMode:`keyboard`})}return Te({getData:Hr,getImage:Ur,generatePdf:Hn,generateCsv:Lr,generateImage:Un,generateSvg:$r,hideSeries:Dr,showSeries:Er,toggleTable:Br,toggleTooltip:Vr,toggleAnnotator:zr,toggleFullscreen:jr,copyAlt:ti}),at(()=>[K.value,Y.value,B.value,V.value,L.value.style.fontFamily,O.dataset,Dn.value,xn.value,bn.value,vn.value,yn.value],Xn,{flush:`post`,deep:!0}),(e,i)=>(x(),m(`div`,{id:`history_plot_${M.value}`,ref_key:`historyPlotChart`,ref:k,class:v({"vue-data-ui-component":!0,"vue-ui-history-plot":!0,"vue-data-ui-wrapper-fullscreen":fn.value}),style:b(`background:${V.value.backgroundColor};color:${V.value.color};font-family:${L.value.style.fontFamily}; position: relative; ${L.value.responsive?`height: 100%`:``}`),onMouseenter:i[2]||=()=>E(Ln)(!0),onMouseleave:i[3]||=()=>E(Ln)(!1)},[h(`div`,{id:`chart-instructions-${M.value}`,class:`sr-only`},[h(`p`,null,T(L.value.a11y.translations.keyboardNavigation),1)],8,ct),ni.value.body.length?(x(),f(Ue,{key:0,uid:M.value,head:ni.value.head,body:ni.value.body,caption:ni.value.caption,notice:ni.value.notice},null,8,[`uid`,`head`,`body`,`caption`,`notice`])):p(``,!0),w(e.$slots,`userConfig`,{},void 0,!0),L.value.userOptions.buttons.annotator?(x(),f(E(Yt),Qe({key:1},E(n)(L.value.userOptions.annotator),{svgRef:E(W),backgroundColor:V.value.backgroundColor,color:V.value.color,active:Rr.value,isCursorPointer:U.value,palette:L.value.userOptions.annotatorPalette,onClose:zr}),Ye({_:2},[C(E(r),n=>({name:n,fn:D(r=>[w(e.$slots,n,y(_(E(t)(n,r))),void 0,!0)])}))]),1040,[`svgRef`,`backgroundColor`,`color`,`active`,`isCursorPointer`,`palette`])):p(``,!0),Wn.value?(x(),m(`div`,{key:2,ref_key:`noTitle`,ref:ln,class:`vue-data-ui-no-title-space`,style:`height:36px; width: 100%;background:transparent`},null,512)):p(``,!0),V.value.title.text?(x(),m(`div`,{key:3,ref_key:`chartTitle`,ref:nn,class:`vue-ui-xy-title`,style:b(`font-family:${L.value.style.fontFamily}`)},[(x(),f(ke,{key:`title_${rn.value}`,config:{title:{cy:`history-plot-div-title`,...V.value.title},subtitle:{cy:`history-plot-div-subtitle`,...V.value.title.subtitle}}},null,8,[`config`]))],4)):p(``,!0),h(`div`,{id:`legend-top-${M.value}`},null,8,lt),L.value.userOptions.show&&Tn.value&&(E(Rn)||E(In))?(x(),f(E(Xt),Qe({ref_key:`userOptionsRef`,ref:_n,key:`user_option_${cn.value}`,backgroundColor:V.value.backgroundColor,color:V.value.color,isPrinting:E(Bn),isImaging:E(Vn),uid:M.value,hasTooltip:V.value.tooltip.show&&L.value.userOptions.buttons.tooltip,hasLabel:!1,isFullscreen:fn.value,chartElement:k.value},E(Pe)(L.value.userOptions,`pdf csv img svg table fullscreen altCopy annotator`),{isTooltip:G.value.showTooltip,isAnnotation:Rr.value,tableDialog:L.value.table.useDialog,isCursorPointer:U.value,onToggleFullscreen:jr,onGeneratePdf:E(Hn),onGenerateCsv:Lr,onGenerateImage:E(ei),onGenerateSvg:E($r),onToggleTable:Br,onToggleTooltip:Vr,onToggleAnnotator:zr,onCopyAlt:ti,style:{visibility:E(Rn)?E(In)?`visible`:`hidden`:`visible`}}),Ye({_:2},[C(E(Ne)(e.$slots,`menuIcon optionTooltip optionPdf optionCsv optionImg optionSvg optionTable optionFullscreen optionAnnotator optionAltCopy custom-menu-before custom-menu-after`),t=>({name:t,fn:D(n=>[w(e.$slots,t,y(_(E(Fe)(t,n))),void 0,!0)])}))]),1040,[`backgroundColor`,`color`,`isPrinting`,`isImaging`,`uid`,`hasTooltip`,`isFullscreen`,`chartElement`,`isTooltip`,`isAnnotation`,`tableDialog`,`isCursorPointer`,`onGeneratePdf`,`onGenerateImage`,`onGenerateSvg`,`style`])):p(``,!0),h(`div`,ut,[(x(),m(`svg`,{ref_key:`svgRef`,ref:W,xmlns:E(ge),viewBox:`0 0 ${K.value.width<0?.1:K.value.width} ${K.value.height<0?.1:K.value.height}`,style:b(`max-width:100%;overflow:visible;background:transparent;color:${V.value.color};visibility:${E(Yn)?`visible`:`hidden`}`),"aria-describedby":`chart-instructions-${M.value}`,tabindex:`0`,onFocus:ai,onBlur:oi,onKeydown:li},[Ze(E(Zt)),w(e.$slots,`svg-underlayer`,{svg:{...K.value,drawingArea:J.value,isPrintingImg:E(Bn)||E(Vn)||E(Zr),isPrintingSvg:E(Qr)}},void 0,!0),e.$slots[`chart-background`]?(x(),m(`foreignObject`,{key:0,x:J.value.left,y:J.value.top,width:J.value.width<=0?10:J.value.width,height:J.value.height<=0?10:J.value.height,style:{pointerEvents:`none`}},[w(e.$slots,`chart-background`,{},void 0,!0)],8,ft)):p(``,!0),R.value.gradient.show||sr.value?(x(),m(`defs`,pt,[R.value.gradient.show?(x(!0),m(u,{key:0},C(Q.value,(e,t)=>(x(),f(Ve,{t:`radial`,key:`gradient_${t}_${M.value}`,id:`gradient_${t}_${M.value}`,fy:`30%`,stops:[[`10%`,E(ee)(e.color,R.value.gradient.intensity/100),1],[`90%`,E(re)(e.color,.1),1],[`100%`,e.color,1]]},null,8,[`id`,`stops`]))),128)):p(``,!0),(x(!0),m(u,null,C(Q.value,e=>(x(),m(u,{key:`temperature_grad_history_template_${e.seriesIndex}_${M.value}`},[R.value.gradient.show&&lr(e)?(x(!0),m(u,{key:0},C(e.plots,t=>(x(),f(Ve,{t:`radial`,key:`temperature_plot_grad_history_${e.seriesIndex}_${t.id}_${M.value}`,id:hr(e,t),fy:`30%`,stops:[[`10%`,E(ee)($(e,t),R.value.gradient.intensity/100),1],[`90%`,E(re)($(e,t),.1),1],[`100%`,$(e,t),1]]},null,8,[`id`,`stops`]))),128)):p(``,!0),cr(e)?(x(),m(`linearGradient`,{key:1,id:`temperature_grad_history_${e.seriesIndex}_${M.value}`,gradientUnits:`userSpaceOnUse`,x1:pr(e).x1,y1:pr(e).y1,x2:pr(e).x2,y2:pr(e).y2},[(x(!0),m(u,null,C(e.temperatureColors,(t,n)=>(x(),m(`stop`,{key:`temperature_grad_history_stop_${e.seriesIndex}_${n}_${M.value}`,"stop-color":t,offset:e.temperatureColors.length===1?`0%`:E(me)(n,e.temperatureColors.length)},null,8,ht))),128))],8,mt)):p(``,!0)],64))),128))])):p(``,!0),z.value.verticalLines.show?(x(),m(`g`,gt,[(x(!0),m(u,null,C(Z.value.tickX,e=>(x(),m(`line`,{x1:e.x,x2:e.x,y1:e.y1,y2:e.y2,stroke:z.value.verticalLines.stroke,"stroke-width":z.value.verticalLines.strokeWidth,"stroke-linecap":`round`},null,8,_t))),256))])):p(``,!0),B.value.y.labels.show?(x(),m(`g`,vt,[(x(!0),m(u,null,C(Z.value.tickY,e=>(x(),m(`line`,{stroke:z.value.verticalLines.stroke,"stroke-width":z.value.verticalLines.strokeWidth,"stroke-linecap":`round`,x1:J.value.left-5,x2:J.value.left,y1:e.y,y2:e.y},null,8,yt))),256))])):p(``,!0),B.value.y.labels.show?(x(),m(`g`,{key:4,ref_key:`yAxisScales`,ref:xn},[(x(!0),m(u,null,C(Z.value.tickY,e=>(x(),m(`text`,{x:J.value.left+B.value.y.labels.offsetX-4-R.value.radius,y:e.y+Y.value.yAxisLabels/3,fill:B.value.y.labels.color,"font-size":Y.value.yAxisLabels,"text-anchor":`end`},T(E(ue)(B.value.y.labels.formatter,e.value,E(a)({p:B.value.y.labels.prefix,v:e.value,s:B.value.y.labels.suffix,r:B.value.y.labels.rounding}))),9,bt))),256))],512)):p(``,!0),B.value.y.name.text?(x(),m(`text`,{key:5,ref_key:`yAxisLabel`,ref:yn,transform:`translate(${Y.value.yAxisName}, ${K.value.height/2+B.value.y.name.offsetY}), rotate(-90)`,"font-size":Y.value.yAxisName,fill:B.value.y.name.color,"font-weight":B.value.y.name.bold?`bold`:`normal`,"text-anchor":`middle`},T(B.value.y.name.text),9,xt)):p(``,!0),z.value.horizontalLines.show?(x(),m(`g`,St,[(x(!0),m(u,null,C(Z.value.tickY,e=>(x(),m(`line`,{x1:e.x1,x2:e.x2,y1:e.y,y2:e.y,stroke:z.value.horizontalLines.stroke,"stroke-width":z.value.horizontalLines.strokeWidth,"stroke-linecap":`round`},null,8,Ct))),256))])):p(``,!0),B.value.x.labels.show?(x(),m(`g`,wt,[(x(!0),m(u,null,C(Z.value.tickX,e=>(x(),m(`line`,{stroke:z.value.verticalLines.stroke,"stroke-width":z.value.verticalLines.strokeWidth,"stroke-linecap":`round`,x1:e.x,x2:e.x,y1:J.value.bottom,y2:J.value.bottom+5},null,8,Tt))),256))])):p(``,!0),B.value.x.labels.show?(x(),m(`g`,{key:8,ref_key:`xAxisScales`,ref:bn},[(x(!0),m(u,null,C(Z.value.tickX,e=>(x(),m(`text`,{class:`vue-ui-history-plot-x-axis-scale`,transform:`translate(${e.x}, ${J.value.bottom+B.value.x.labels.offsetY+Y.value.xAxisLabels+R.value.radius}), rotate(${B.value.x.labels.rotation})`,fill:B.value.x.labels.color,"font-size":Y.value.xAxisLabels,"text-anchor":B.value.x.labels.rotation>0?`start`:B.value.x.labels.rotation<0?`end`:`middle`},T(E(ue)(B.value.x.labels.formatter,e.value,E(a)({p:B.value.x.labels.prefix,v:e.value,s:B.value.x.labels.suffix,r:B.value.x.labels.rounding}))),9,Et))),256))],512)):p(``,!0),B.value.x.name.text?(x(),m(`text`,{key:9,ref_key:`xAxisLabel`,ref:vn,x:K.value.width/2+B.value.x.name.offsetX,y:K.value.height,"font-size":Y.value.xAxisName,fill:B.value.x.name.color,"font-weight":B.value.x.name.bold?`bold`:`normal`,"text-anchor":`middle`},T(B.value.x.name.text),9,Dt)):p(``,!0),z.value.xAxis.show?(x(),m(`line`,{key:10,x1:J.value.left,x2:J.value.left+J.value.width,y1:J.value.bottom,y2:J.value.bottom,stroke:z.value.xAxis.stroke,"stroke-width":z.value.xAxis.strokeWidth,"stroke-linecap":`round`},null,8,Ot)):p(``,!0),z.value.yAxis.show?(x(),m(`line`,{key:11,x1:J.value.left,x2:J.value.left,y1:J.value.top,y2:J.value.bottom,stroke:z.value.yAxis.stroke,"stroke-width":z.value.yAxis.strokeWidth,"stroke-linecap":`round`},null,8,kt)):p(``,!0),(x(!0),m(u,null,C(or.value,e=>(x(),m(`g`,{key:`history_plot_serie_${e.seriesIndex}_${M.value}`},[V.value.paths.show?(x(),m(`g`,{key:0,style:b({opacity:xr(e.seriesIndex)})},[h(`path`,{class:v({"vue-data-ui-transition":E(H)&&!E(q)}),d:e.path,stroke:V.value.backgroundColor,"stroke-width":V.value.paths.strokeWidth+4,fill:`none`,"stroke-linecap":`round`,"stroke-linejoin":`round`},null,10,At),h(`path`,{class:v({"vue-data-ui-transition":E(H)&&!E(q)}),d:e.path,stroke:br(e),"stroke-width":V.value.paths.strokeWidth,fill:`none`,"stroke-linecap":`round`,"stroke-linejoin":`round`},null,10,jt)],4)):p(``,!0),(x(!0),m(u,null,C(e.plots,e=>(x(),m(`circle`,{cx:e.x,cy:e.y,fill:V.value.backgroundColor,r:Y.value.plots,stroke:`none`,class:v({"vue-data-ui-transition":E(H)&&!E(q)})},null,10,Mt))),256)),(x(!0),m(u,null,C(e.plots,t=>(x(),m(`circle`,{cx:t.x,cy:t.y,fill:gr(e,t,e.gradientIndex),r:Y.value.plots,stroke:R.value.stroke,"stroke-width":R.value.strokeWidth,class:v({"vue-data-ui-transition":E(H)&&!E(q)}),style:b({opacity:xr(e.seriesIndex)})},null,14,Nt))),256)),R.value.labels.show?(x(),m(`g`,Pt,[(x(!0),m(u,null,C(e.plots,(t,n)=>(x(),m(`g`,{key:`plab_${n}`},[String(t.label).includes(`
2
+ `)?(x(),m(`text`,{key:1,class:v({"vue-data-ui-transition":E(H)&&!E(q)}),transform:`translate(${t.x+R.value.labels.offsetX}, ${t.y+R.value.labels.offsetY+Y.value.plots+Y.value.labels})`,"font-size":Y.value.labels,fill:R.value.labels.color,"font-weight":R.value.labels.bold?`bold`:`normal`,"text-anchor":`middle`,style:b({opacity:xr(e.seriesIndex)}),innerHTML:E(ne)({content:String(t.label),fontSize:Y.value.labels,fill:R.value.labels.color,x:0,y:0})},null,14,It)):(x(),m(`text`,{key:0,class:v({"vue-data-ui-transition":E(H)&&!E(q)}),transform:`translate(${t.x+R.value.labels.offsetX}, ${t.y+R.value.labels.offsetY+Y.value.plots+Y.value.labels})`,"font-size":Y.value.labels,fill:R.value.labels.color,"font-weight":R.value.labels.bold?`bold`:`normal`,"text-anchor":`middle`,style:b({opacity:xr(e.seriesIndex)})},T(t.label),15,Ft))]))),128))])):p(``,!0),R.value.indexLabels.show?(x(),m(`g`,Lt,[(x(!0),m(u,null,C(e.plots,(t,n)=>(x(),m(`text`,{key:`lab_${n}`,class:v({"vue-data-ui-transition":E(H)&&!E(q)}),transform:`translate(${t.x+R.value.indexLabels.offsetX}, ${t.y+R.value.indexLabels.offsetY+Y.value.indexLabels/3})`,"font-size":Y.value.indexLabels,"font-weight":R.value.indexLabels.bold?`bold`:`normal`,fill:vr(e,t),"text-anchor":`middle`,style:b({opacity:xr(e.seriesIndex)})},T(R.value.indexLabels.startAtZero?n:n+1),15,Rt))),128))])):p(``,!0)]))),128)),(x(!0),m(u,null,C(or.value,e=>(x(),m(`g`,{key:`history_plot_trap_serie_${e.seriesIndex}_${M.value}`},[(x(!0),m(u,null,C(e.plots,(t,n)=>(x(),m(`circle`,{cx:t.x,cy:t.y,fill:`transparent`,r:Y.value.plots,stroke:`none`,onMouseenter:r=>Fr({datapoint:t,plotIndex:n,seriesIndex:e.seriesIndex,triggerMode:`pointer`}),onMouseleave:r=>Nr({datapoint:t,plotIndex:n,seriesIndex:e.seriesIndex}),onClick:r=>Ar({datapoint:t,plotIndex:n,seriesIndex:e.seriesIndex})},null,40,zt))),256))]))),128)),w(e.$slots,`svg`,{svg:{...K.value,drawingArea:J.value,isPrintingImg:E(Bn)||E(Vn)||E(Zr),isPrintingSvg:E(Qr)}},void 0,!0)],44,dt)),e.$slots.hint?(x(),m(`div`,Bt,[w(e.$slots,`hint`,y(_({hint:L.value.a11y.translations.keyboardNavigation,isVisible:wn.value})),void 0,!0)])):p(``,!0)]),e.$slots.watermark?(x(),m(`div`,Vt,[w(e.$slots,`watermark`,y(_({isPrinting:E(Bn)||E(Vn)||E(Zr)||E(Qr)})),void 0,!0)])):p(``,!0),h(`div`,{id:`legend-bottom-${M.value}`},null,8,Ht),hn.value&&(V.value.legend.show||e.$slots.legend)?(x(),f(Je,{key:6,to:V.value.legend.position===`top`?`#legend-top-${M.value}`:`#legend-bottom-${M.value}`},[h(`div`,{ref_key:`chartLegend`,ref:an},[w(e.$slots,`legend`,{legend:Or.value},()=>[V.value.legend.show&&Tn.value?(x(),f(Ke,{key:`legend_${on.value}`,legendSet:Or.value,config:kr.value,isCursorPointer:U.value,onClickMarker:i[0]||=({legend:e})=>{wr(e.seriesIndex)}},{item:D(({legend:e,index:t})=>[h(`div`,{onClick:t=>e.segregate(),style:b(`opacity:${N.value.includes(e.seriesIndex)?.5:1}`)},T(e.name),13,Ut)]),legendToggle:D(()=>[Or.value.length>2&&V.value.legend.selectAllToggle.show&&!E(Nn)?(x(),f(He,{key:0,backgroundColor:V.value.legend.selectAllToggle.backgroundColor,color:V.value.legend.selectAllToggle.color,fontSize:V.value.legend.fontSize,checked:N.value.length>0,isCursorPointer:U.value,onToggle:Cr},null,8,[`backgroundColor`,`color`,`fontSize`,`checked`,`isCursorPointer`])):p(``,!0)]),_:1},8,[`legendSet`,`config`,`isCursorPointer`])):p(``,!0)],!0)],512)],8,[`to`])):p(``,!0),e.$slots.source?(x(),m(`div`,{key:7,ref_key:`source`,ref:mn,dir:`auto`},[w(e.$slots,`source`,{},void 0,!0)],512)):p(``,!0),Ze(E(Gt),{teleportTo:V.value.tooltip.teleportTo,show:G.value.showTooltip&&un.value,backgroundColor:V.value.tooltip.backgroundColor,color:V.value.tooltip.color,fontSize:V.value.tooltip.fontSize,borderRadius:V.value.tooltip.borderRadius,borderColor:V.value.tooltip.borderColor,borderWidth:V.value.tooltip.borderWidth,backgroundOpacity:V.value.tooltip.backgroundOpacity,position:V.value.tooltip.position,offsetX:V.value.tooltip.offsetX,offsetY:V.value.tooltip.offsetY,parent:k.value,content:dn.value,isCustom:pn.value,isFullscreen:fn.value,smooth:V.value.tooltip.smooth,backdropFilter:V.value.tooltip.backdropFilter,smoothForce:V.value.tooltip.smoothForce,smoothSnapThreshold:V.value.tooltip.smoothSnapThreshold,isA11yMode:Cn.value===`keyboard`,a11yPosition:Sn.value},{"tooltip-before":D(()=>[w(e.$slots,`tooltip-before`,y(_({...Mr.value})),void 0,!0)]),tooltip:D(()=>[w(e.$slots,`tooltip`,y(_({...Mr.value})),void 0,!0)]),"tooltip-after":D(()=>[w(e.$slots,`tooltip-after`,y(_({...Mr.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`]),Tn.value&&L.value.userOptions.buttons.table?(x(),f(nt(Kr.value.component),Qe({key:8},Kr.value.props,{ref_key:`tableUnit`,ref:gn,onClose:qr}),Ye({content:D(()=>[(x(),f(E(Jt),{key:`table_${sn.value}`,colNames:Ir.value.colNames,head:Ir.value.head,body:Ir.value.body,config:Ir.value.config,title:L.value.table.useDialog?``:Kr.value.title,withCloseButton:!L.value.table.useDialog,isCursorPointer:U.value,onClose:qr},{th:D(({th:e})=>[h(`div`,Wt,T(e),1)]),td:D(({td:e})=>[Xe(T(e.name||e),1)]),_:1},8,[`colNames`,`head`,`body`,`config`,`title`,`withCloseButton`,`isCursorPointer`]))]),_:2},[L.value.table.useDialog?{name:`title`,fn:D(()=>[Xe(T(Kr.value.title),1)]),key:`0`}:void 0,L.value.table.useDialog?{name:`actions`,fn:D(()=>[h(`button`,{tabindex:`0`,class:`vue-ui-user-options-button`,onClick:i[1]||=e=>Lr(L.value.userOptions.callbacks.csv),style:b({cursor:U.value?`pointer`:`default`})},[Ze(E(Kt),{name:`fileCsv`,stroke:Kr.value.props.color},null,8,[`stroke`])],4)]),key:`1`}:void 0]),1040)):p(``,!0),w(e.$slots,`skeleton`,{},()=>[E(Nn)?(x(),f(Se,{key:0})):p(``,!0)],!0)],46,st))}},[[`__scopeId`,`data-v-4f8ecec6`]]);export{ot as n,Gt as t};
@@ -0,0 +1,4 @@
1
+ import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{n as t,r as n,t as r}from"./annotationSlots-OLiW25XN.js";import{t as i}from"./useConfig-C3FbHv4N.js";import{$ as a,D as o,Dt as s,Ht as c,J as l,Jt as ee,S as te,X as ne,Yt as re,Zt as ie,at as ae,b as u,i as oe,in as se,nn as ce,nt as le,pt as ue,t as de,tn as fe,vt as pe,w as me,wt as he,zt as ge}from"./lib-rPeBMZrn.js";import{n as _e,t as ve}from"./BaseScanner-8NdoBs7B.js";import{n as ye,t as be}from"./useHints-C-TwxM0Y.js";import{t as xe}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{t as Se}from"./useNestedProp-DnGoh-XS.js";import{t as Ce}from"./useThemeCheck-BKNRbGeC.js";import{t as we}from"./chartImage-DPGnEuYM.js";import{n as Te}from"./Title-BliHuXfT.js";import{t as Ee}from"./useChartExport-BZts4KFb.js";import{n as De,t as Oe}from"./tableIntegration-CNoJ1CIY.js";import{n as ke,r as Ae,t as je}from"./userOptionsSlots-CWtXN5Q6.js";import{t as Me}from"./usePrinter-DVf3YcG5.js";import{t as Ne}from"./useTransitions-ChGGrtrv.js";import{t as Pe}from"./Shape-CRe8woTu.js";import{c as Fe}from"./canvas-lib-22VpOI4_.js";import{t as Ie}from"./useResponsive-CENUxfEL.js";import{t as Le}from"./DefGrad-DKMq1REY.js";import{t as Re}from"./vue-ui-accordion-E8TJfFeK.js";import{t as ze}from"./BaseLegendToggle-BIzyyI1h.js";import{t as Be}from"./A11yDataTable-DWNlWXzs.js";import{t as Ve}from"./useUserOptionState-CXlFnwPv.js";import{t as He}from"./useChartAccessibility-DOMuYJfm.js";import{t as Ue}from"./useTableResponsive-uSz_qZOB.js";import{t as We}from"./Legend-DM0ClX3D.js";import{t as Ge}from"./vue_ui_horizontal_bar-C4ulIxeT.js";import{Fragment as d,computed as f,createBlock as p,createCommentVNode as m,createElementBlock as h,createElementVNode as g,createSlots as Ke,createTextVNode as qe,createVNode as Je,defineAsyncComponent as Ye,guardReactiveProps as _,mergeProps as Xe,nextTick as Ze,normalizeClass as v,normalizeProps as Qe,normalizeStyle as y,onBeforeUnmount as $e,onMounted as et,openBlock as b,ref as x,renderList as S,renderSlot as C,resolveDynamicComponent as tt,toDisplayString as w,toRefs as nt,unref as T,useCssVars as rt,useSlots as it,watch as at,withCtx as E,withKeys as ot}from"vue";var st=/* @__PURE__ */ e({default:()=>Lt}),ct=[`id`],lt=[`id`],ut=[`onClick`],dt={style:{position:`relative`}},ft=[`xmlns`,`viewBox`,`aria-describedby`],pt=[`width`,`height`],mt={key:1},ht=[`y`,`width`,`height`,`fill`,`rx`],gt=[`x`,`y`,`width`,`height`,`fill`,`rx`],_t=[`x`,`y`,`width`,`height`,`fill`,`rx`,`stroke`,`stroke-width`],vt=[`x`,`y`,`width`,`height`,`fill`,`rx`,`stroke`,`stroke-width`],yt=[`stroke`,`stroke-width`,`d`],bt=[`stroke`,`stroke-width`,`d`],xt=[`y`,`height`,`width`,`fill`],St=[`transform`,`font-size`,`fill`,`font-weight`,`innerHTML`],Ct=[`transform`,`font-size`,`fill`,`font-weight`],wt=[`transform`,`font-size`,`font-weight`,`innerHTML`],Tt=[`transform`,`font-size`,`fill`,`font-weight`,`innerHTML`],Et=[`transform`,`text-anchor`,`font-size`,`fill`,`font-weight`],Dt=[`y`,`width`,`height`,`fill`,`onMouseenter`,`onMouseleave`,`onClick`],Ot={key:0,style:{position:`absolute`,top:`100%`,left:`0`,width:`100%`},"data-dom-to-png-ignore":``,"aria-hidden":`true`},kt={key:7,class:`vue-data-ui-watermark`},At=[`onClick`],jt={style:`width:100%;padding-top: 36px;position:relative`},Mt={class:`vue-ui-data-table`},Nt={key:0},Pt={style:{width:`100%`}},Ft=[`data-cell`],It={style:{display:`flex`,"align-items":`center`,gap:`5px`,"justify-content":`flex-end`,width:`100%`,"padding-right":`3px`}},Lt=/*#__PURE__*/ xe({__name:`vue-ui-horizontal-bar`,props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:[`selectLegend`,`copyAlt`,`selectDatapoint`],setup(e,{expose:xe,emit:st}){rt(e=>({v417199f3:e.tdo}));let Lt=Ye(()=>import(`./Tooltip-C1q0Qoh7.js`)),Rt=Ye(()=>import(`./BaseIcon-CoY0vuL3.js`).then(e=>e.n)),zt=Ye(()=>import(`./PenAndPaper-DoNTA-SV.js`).then(e=>e.t)),Bt=Ye(()=>import(`./UserOptions-B9EyfU9n.js`).then(e=>e.n)),Vt=Ye(()=>import(`./PackageVersion-DKSNC-YP.js`).then(e=>e.t)),Ht=Ye(()=>import(`./BaseDraggableDialog-BK7dj9O6.js`).then(e=>e.n)),{vue_ui_vertical_bar:Ut}=i(),{isThemeValid:Wt,warnInvalidTheme:Gt}=Ce(),Kt=it(),D=e,qt=f({get(){return!!D.dataset&&D.dataset.length},set(e){return e}}),O=x(ne()),Jt=x(!1),Yt=x(``),Xt=x(null),Zt=x(0),k=x(null),Qt=x(null),$t=x(null),en=x(null),tn=x(null),nn=x(0),rn=x(0),an=x(null),on=x(null),sn=x(null),cn=x(null),ln=x(null),A=x([]),un=x({none:0,asc:1,desc:2}),j=x(0),dn=x(0),fn=null,pn=null,M=x(null),mn=x({x:0,y:0}),hn=x(`pointer`),gn=st,N=x(Dn()),P=f(()=>N.value.style.chart.layout.bars),F=f(()=>N.value.style.chart.layout),I=f(()=>N.value.style.chart.tooltip),L=f(()=>N.value.style.chart);ye({config:()=>N.value,dataset:()=>D.dataset,component:`VueUiHorizontalBar`,rules:[be.emptyArray,{test:e=>e.length>50||e.some(e=>e.children&&e.children.length>50),message:[`👀 There are > 50 series / bars, which will probably force users to scroll. Consider:`,``,`▶️ Grouping small values into an "Other" category.`,``,`▶️ Using filters, or several instances of the component with subsets of related series.`]}]});let{transitionEnabled:R}=Ne({config:()=>N.value.transitions,dataset:()=>D.dataset}),_n=f(()=>N.value.userOptions.useCursorPointer),vn=f(()=>D.config?.skeletonDataset??[{name:``,value:6,color:`#d9d9d9`},{name:``,value:5,color:`#d9d9d9`},{name:``,value:4,color:`#d9d9d9`},{name:``,value:3,color:`#d9d9d9`},{name:``,value:2,color:`#d9d9d9`},{name:``,value:1,color:`#d9d9d9`}]),yn=f(()=>se({defaultConfig:{useCssAnimation:!1,userOptions:{show:!1},table:{show:!1},style:{chart:{backgroundColor:`#99999930`,layout:{bars:{offsetX:110,dataLabels:{color:`transparent`,value:{prefix:``,suffix:``,formatter:null}},nameLabels:{color:`transparent`}},separators:{color:`#7A7A7A`}},legend:{show:!0,backgroundColor:`transparent`,color:`transparent`,prefix:``,suffix:``,formatter:null},title:{color:`#1A1A1A`,subtitle:{color:`#5A5A5A`}}}}},userConfig:N.value.skeletonConfig??{}})),{loading:bn,FINAL_DATASET:xn,manualLoading:Sn}=_e({...nt(D),FINAL_CONFIG:N,prepareConfig:Dn,callback:()=>{Promise.resolve().then(async()=>{H.value.showTable=N.value.table.show,Vn()})},skeletonDataset:vn.value,skeletonConfig:se({defaultConfig:N.value,userConfig:yn.value})}),{userOptionsVisible:Cn,setUserOptionsVisibility:wn,keepUserOptionState:Tn}=Ve({config:N.value}),{svgRef:En}=He({config:L.value.title});function Dn(){let e=Se({userConfig:D.config,defaultConfig:Ut}),t={},n=e.theme;if(n){if(!Wt.value(e))Gt(e),t=e;else{let r=Se({userConfig:Ge[n]||D.config,defaultConfig:e});t={...Se({userConfig:D.config,defaultConfig:r}),customPalette:e.customPalette.length?e.customPalette:ce[n]||c}}}else t=e;return D.config&&he(D.config,`events.datapointEnter`)?t.events.datapointEnter=D.config.events.datapointEnter:t.events.datapointEnter=null,D.config&&he(D.config,`events.datapointLeave`)?t.events.datapointLeave=D.config.events.datapointLeave:t.events.datapointLeave=null,D.config&&he(D.config,`events.datapointClick`)?t.events.datapointClick=D.config.events.datapointClick:t.events.datapointClick=null,t}let z=x(L.value.width),On=x(L.value.height),B=x(P.value.gap),kn=ie(D.config);at(()=>D.config,(e,t)=>{let n=ie(e),r=n!==kn;kn=n;let i=Dn();r?(bn.value||(N.value=i),Cn.value=!N.value.userOptions.showOnChartHover,nn.value+=1,rn.value+=1,H.value.showTable=N.value.table.show,j.value=un.value[P.value.sort]??0,H.value.showTooltip=I.value.show,z.value=L.value.width,On.value=L.value.height,B.value=P.value.gap):(N.value.style.chart.tooltip=i.style.chart.tooltip,H.value.showTooltip=N.value.style.chart.tooltip.show)},{deep:!0}),at(()=>D.dataset,e=>{Array.isArray(e)&&e.length>0&&(Sn.value=!1)},{deep:!0});let{isPrinting:An,isImaging:jn,generatePdf:Mn,generateImage:Nn}=Me({elementId:`vue-ui-vertical-bar_${O.value}`,fileName:L.value.title.text||`vue-ui-vertical-bar`,options:N.value.userOptions.print}),Pn=f(()=>N.value.userOptions.show&&!L.value.title.text),Fn=f(()=>me(N.value.customPalette)),In=x(null),Ln=f(()=>N.value.table.responsiveBreakpoint),Rn=f(()=>N.value.debug),zn=x(0),V=x(null),Bn=x(null);function Vn(){if(k.value&&(ge(D.dataset)&&(ae({componentName:`VueUiVerticalBar`,type:`dataset`,debug:Rn.value}),qt.value=!1,Sn.value=!0),ge(D.dataset)||(Sn.value=N.value.loading),N.value.responsive)){let e=Fe(()=>{let{width:e,height:t}=Ie({chart:k.value,title:L.value.title.text?Qt.value:null,legend:L.value.legend.show?$t.value:null,source:en.value,noTitle:tn.value});zn.value=t/3,requestAnimationFrame(async()=>{On.value=t,z.value=e})});V.value&&(Bn.value&&V.value.unobserve(Bn.value),V.value.disconnect()),V.value=new ResizeObserver(e),Ze(()=>{Bn.value=k.value?.parentNode,Bn.value&&V.value.observe(Bn.value)})}}$e(()=>{V.value&&(Bn.value&&V.value.unobserve(Bn.value),V.value.disconnect())});let H=x({showTable:N.value.table.show,showTooltip:I.value.show}),Hn=f(()=>j.value===0),Un=f(()=>j.value===2),U=f(()=>(xn.value.forEach((e,t)=>{!e.value&&!e.children&&ae({componentName:`VueUiVerticalBar`,type:`datasetAttributeEmpty`,property:`value (index ${t})`,debug:Rn.value}),e.children&&(ge(e.children)?ae({componentName:`VueUiVerticalBar`,type:`datasetAttributeEmpty`,property:`children (index ${t})`,debug:Rn.value}):e.children.forEach((e,t)=>{[null,void 0].includes(e.name)&&ae({componentName:`VueUiVerticalBar`,type:`datasetSerieAttribute`,property:`name`,key:`children`,index:t,debug:Rn.value})}))}),xn.value.map((e,t)=>{let n=`vertical_parent_${t}_${O.value}`,r=e.children&&e.children.length>0,i=u(e.value?e.value:r?e.children.map(e=>e.value||0).reduce((e,t)=>e+t,0):0),a=i>=0?1:-1;return{...e,id:n,absoluteIndex:t,shape:`square`,opacity:A.value.includes(n)?.5:1,value:Math.abs(i),sign:a,hasChildren:r,isChild:!1,segregate:()=>rr(n),isSegregated:A.value.includes(n),color:te(e.color)||Fn.value[t]||c[t]||c[t%c.length],children:!e.children||!e.children.length?[]:e.children.toSorted(Hn.value?()=>0:(e,t)=>Un.value?t.value-e.value:e.value-t.value).map((r,o)=>({...r,value:u(Math.abs(r.value)),absoluteIndex:t,sign:r.value>=0?1:-1,isChild:!0,parentId:n,parentName:e.name,parentValue:i,parentSign:a,id:`vertical_child_${t}_${o}_${O.value}`,childIndex:o,color:te(r.color)||te(e.color)||Fn.value[t]||c[t]||c[t%c.length]})).map((t,n)=>({...t,isFirstChild:n===0,isLastChild:n===e.children.length-1}))}}).toSorted(Hn.value?()=>0:(e,t)=>Un.value?t.value-e.value:e.value-t.value))),W=f(()=>U.value.filter(e=>!A.value.includes(e.id))),G=f(()=>W.value.flatMap(e=>e.hasChildren?e.children:e)),Wn=f(()=>U.value.flatMap(e=>e.hasChildren?e.children:e)),Gn=f(()=>W.value.flatMap(e=>e.children&&e.children.length>0?e.children.length:1).reduce((e,t)=>e+t,0)),Kn=f(()=>({cy:`vertical-bar-div-legend`,backgroundColor:L.value.legend.backgroundColor,color:L.value.legend.color,fontSize:L.value.legend.fontSize,paddingBottom:12,fontWeight:L.value.legend.bold?`bold`:``})),K=f(()=>P.value.parentLabels.show?P.value.parentLabels.fontSize*3+P.value.parentLabels.paddingBottom:0),q=f(()=>{let e=[],t=0;return G.value.forEach((n,r)=>{n.isChild&&n.childIndex===0&&P.value.parentLabels.show&&(t+=1),e[r]=t}),e}),J=f(()=>{let e=Math.max(0,...q.value)*K.value;return(On.value-24-(Gn.value-1)*B.value-e)/Gn.value}),Y=f(()=>({width:z.value,height:On.value,padding:{top:12,left:128+P.value.offsetX,right:64+P.value.paddingRight,bottom:12}})),qn=x(0);function Jn(){Ze(()=>{if(!ln.value){qn.value=0;return}let e=Array.from(ln.value.querySelectorAll(`text`)).reduce((e,t)=>{let n=t.getBBox?.().width??t.getComputedTextLength();return n>e?n:e},0);qn.value=e+12})}at(()=>[G.value,z.value,On.value,P.value.nameLabels,P.value.offsetX],()=>Jn(),{deep:!0}),et(()=>{Jn()});function Yn(){return typeof document>`u`?null:(fn||(fn=document.createElement(`canvas`),pn=fn.getContext(`2d`)),pn)}function Xn(e){let t=String(e??``),n=P.value,r=n.dataLabels.fontSize,i=n.dataLabels.bold?700:400,a=N.value.style.fontFamily,o=Yn();return o?(o.font=`${i} ${r}px ${a}`,o.measureText(t).width):t.length*r*.6}function Zn(){let e=W.value.flatMap(e=>e.children&&e.children.length?e.children.map(e=>Math.abs(e.value)):Math.abs(e.value));return e.length?Math.max(...e):0}let Qn=f(()=>{dn.value;let e=P.value,t=qn.value+Math.abs(e.nameLabels.offsetX)+e.offsetX,n=Y.value.width-Y.value.padding.right,r=Math.max(0,n-t-e.offsetX),i=Y.value.width-40,a=Zn(),o=G.value.map((e,t)=>({serie:e,textWidth:Xn(xr(e.value,e,t,e.sign))}));if(!o.length||r<=0)return{left:0,right:0};if(!o.some(({serie:e})=>e.sign===-1)){let n=o.reduce((n,{serie:o,textWidth:s})=>{let c=a?Math.abs(o.value)/a:0;if(c<=0||s<=0)return n;let l=(t+r*c+3+e.dataLabels.offsetX+s-i)/c;return Math.max(n,l)},0);return{left:0,right:Math.ceil(Math.min(r,Math.max(0,n)))}}let s=t+r/2,c=-1/0,l=1/0;o.forEach(({serie:t,textWidth:n})=>{if(t.sign===-1){let t=s+12+e.dataLabels.offsetX+n;l=Math.min(l,i-t);return}let r=s-12-e.dataLabels.offsetX-n;c=Math.max(c,40-r)});let ee=0;ee=c>l?(c+l)/2:Math.min(l,Math.max(c,0));let te=ee*2;return te>=0?{left:Math.ceil(Math.min(r,te)),right:0}:{left:0,right:Math.ceil(Math.min(r,-te))}}),$n=f(()=>Qn.value.right),er=f(()=>Qn.value.left);function tr(){dn.value+=1}et(()=>{typeof document<`u`&&document.fonts&&(document.fonts.ready.then(tr),document.fonts.addEventListener?.(`loadingdone`,tr))}),$e(()=>{typeof document<`u`&&document.fonts&&document.fonts.removeEventListener?.(`loadingdone`,tr),fn=null,pn=null});let X=f(()=>{let e=qn.value+Math.abs(P.value.nameLabels.offsetX)+er.value+P.value.offsetX,t=Y.value.width-Y.value.padding.right,n=Math.max(0,t-e-$n.value-P.value.offsetX);return{top:Y.value.padding.top,bottom:Y.value.padding.top+Y.value.height,left:e,right:t,width:n,fullHeight:Y.value.padding.top+Y.value.padding.bottom+Y.value.height}});function nr(){A.value.length?A.value=[]:U.value.forEach(e=>{A.value.push(e.id)}),gn(`selectLegend`,W.value)}async function rr(e){if(A.value.includes(e))A.value=A.value.filter(t=>t!==e);else{if(A.value.length===U.value.length-1)return;A.value.push(e)}gn(`selectLegend`,W.value)}function ir(e){return U.value.length?U.value.find(t=>t.name===e)||(Rn.value&&console.warn(`VueUiHorizontalBar - Series name not found "${e}"`),null):(Rn.value&&console.warn(`VueUiHorizontalBar - There are no series to show.`),null)}function ar(e){let t=ir(e);t!==null&&A.value.includes(t.id)&&rr(t.id)}function or(e){let t=ir(e);t!==null&&(A.value.includes(t.id)||rr(t.id))}let Z=f(()=>W.value.map(e=>Math.abs(e.value)).reduce((e,t)=>e+t,0));function sr(e,t=!1,n=0){return t?a({v:u(Math.abs(e)/Z.value*100),s:`%`,r:n}):Math.abs(e)/Z.value}let cr=f(()=>G.value.map(e=>e.sign).includes(-1)),lr=f(()=>Math.max(...W.value.flatMap(e=>e.children&&e.children.length?Math.max(...e.children.map(e=>e.value)):e.value)));function Q(e){let t=e/lr.value;return u(X.value.width/(cr.value?2:1)*t)}function ur(e){return Q(e)+X.value.left}function dr(e,t){let n=W.value.find(t=>t.id===e.parentId);return{y:X.value.top+(B.value+J.value)*t+q.value[t]*K.value-K.value+P.value.parentLabels.fontSize,name:n.name,value:[void 0,NaN,null].includes(n.value)?``:n.sign===1?n.value:-n.value,percentageToTotal:isNaN(n.value/Z.value)?``:sr(n.value,!0,P.value.dataLabels.percentage.roundingPercentage),sign:n.sign}}function fr(){return W.value}function pr(e,t){return dr(e,t).name}function mr(e,t){let n=dr(e,t);return xr(n.value,n,t,e.parentSign||e.sign)}let hr=x(null),gr=x(null);function _r({datapoint:e,seriesIndex:t}){gn(`selectDatapoint`,e),N.value.events.datapointClick&&N.value.events.datapointClick({datapoint:e,seriesIndex:t})}function vr({datapoint:e,seriesIndex:t}){N.value.events.datapointLeave&&N.value.events.datapointLeave({datapoint:e,seriesIndex:t}),Xt.value=null,Jt.value=!1,hr.value=null,M.value===t&&(M.value=null)}function yr(e,t,n=`pointer`){hn.value=n,N.value.events.datapointEnter&&N.value.events.datapointEnter({datpoint:e,seriesIndex:t}),M.value=t,Xt.value=e,gr.value={datapoint:e,seriesIndex:t,series:U.value,config:N.value},Jt.value=!0,hr.value=e.id;let r=``,i=e.isChild?e.parentName:e.name,o=e.isChild?e.name:``,c=I.value.customFormat;s(c)&&ue(()=>c({datapoint:e,series:U.value,config:N.value,seriesIndex:t}))?Yt.value=c({datapoint:e,series:U.value,config:N.value,seriesIndex:t}):(r+=`<div style="width:100%;text-align:center;border-bottom:1px solid ${I.value.borderColor};padding-bottom:6px;margin-bottom:3px;text-align:left;">
2
+ <div style="display:flex;align-items:center;gap:4px;"><svg viewBox="0 0 60 60" height="14" width="14"><rect x="0" y="0" height="60" width="60" rx="5" stroke="none" fill="${e.color}"/>${Kt.pattern?`<rect x="0" y="0" height="60" width="60" rx="5" stroke="none" fill="url(#pattern_${O.value}_${e.absoluteIndex})"/>`:``}</svg> ${i}</div>
3
+ ${o?`<div>${o}</div>`:``}
4
+ </div>`,I.value.showValue&&(r+=`<div>${N.value.translations.value}: <b>${oe(P.value.dataLabels.value.formatter,e.sign===1?e.value:-e.value,a({p:I.value.prefix,v:e.sign===1?e.value:-e.value,s:I.value.suffix,r:I.value.roundingValue}),{datapoint:e,seriesIndex:t})}</b></div>`),I.value.showPercentage&&(r+=`<div>${N.value.translations.percentageToTotal} : <b>${a({v:Math.abs(e.value)/Z.value*100,s:`%`,r:I.value.roundingPercentage})}</b></div>`,e.isChild&&(r+=`<div>${N.value.translations.percentageToSerie}: <b>${a({v:Math.abs(e.value)/Math.abs(e.parentValue)*100,s:`%`,r:I.value.roundingPercentage})}</b></div>`)),Yt.value=`<div style="text-align:left">${r}</div>`)}function br({legend:e,index:t}){let n=L.value.legend;return n.showValue?`${e.name}: ${oe(P.value.dataLabels.value.formatter,e.value,a({p:n.prefix,v:e.value,s:n.suffix,r:n.roundingValue}),{datapoint:e,seriesIndex:t})}`:e.name}function xr(e,t,n,r){if(!P.value.dataLabels.value.show)return``;let i=oe(P.value.dataLabels.value.formatter,u(r===-1&&e>=0?-e:e),a({p:P.value.dataLabels.value.prefix,v:u(r===-1&&e>=0?-e:e),s:P.value.dataLabels.value.suffix,r:P.value.dataLabels.value.roundingValue}),{datapoint:t,seriesIndex:n}),o=`(${sr(e,!0,P.value.dataLabels.percentage.roundingPercentage)})`;return`${i}${P.value.dataLabels.percentage.show?` ${o}`:``}`}let Sr=f(()=>({head:[N.value.translations.parentName,N.value.translations.value,N.value.translations.percentageToTotal,N.value.translations.childName,N.value.translations.value,N.value.translations.percentageToSerie,N.value.translations.percentageToTotal],body:G.value.map(e=>e.isChild?e.isFirstChild?{color:e.color,parentName:e.parentName,parentValue:e.parentValue,percentageToTotal:e.parentValue/Z.value,childName:e.name,childValue:e.sign===1?e.value:-e.value,childPercentageToParent:Math.abs(e.value)/Math.abs(e.parentValue),childPercentageToTotal:Math.abs(e.value)/Z.value}:{color:``,parentName:``,parentValue:``,percentageToTotal:``,childName:e.name,childValue:e.sign===1?e.value:-e.value,childPercentageToParent:Math.abs(e.value)/Math.abs(e.parentValue),childPercentageToTotal:Math.abs(e.value)/Z.value}:{color:e.color,parentName:e.name,parentValue:e.sign===1?e.value:-e.value,percentageToTotal:Math.abs(e.value)/Z.value,childName:``,childValue:``,childPercentageToParent:``,childPercentageToTotal:``})})),Cr=[{key:`parentName`,type:`name`},{key:`parentValue`,type:`value`},{key:`percentageToTotal`,type:`percentage`},{key:`childName`,type:`name`},{key:`childValue`,type:`value`},{key:`childPercentageToParent`,type:`percentage`},{key:`childPercentageToTotal`,type:`percentage`}];function wr(e,t){let n=e[t.key],r=N.value.table.td,i=[``,NaN,void 0].includes(n);return t.type===`value`?`${w(r.prefix)}${i?``:n.toFixed(r.roundingValue)}${w(r.suffix)}`:t.type===`percentage`?i?``:`${(n*100).toFixed(r.roundingPercentage)}%`:n}function Tr(e=null){let t=[[L.value.title.text],[L.value.title.subtitle.text],[``]],n=Sr.value.head,r=Sr.value.body.map(e=>[e.parentName,e.parentValue,e.percentageToTotal,e.childName,e.childValue,e.childPercentageToParent,e.childPercentageToTotal]),i=t.concat([n]).concat(r),a=o(i);e?e(a):le({csvContent:a,title:L.value.title.text||`vue-ui-vertical-bar`})}let $=x(!1);function Er(e){$.value=e,Zt.value+=1}function Dr(){H.value.showTable=!H.value.showTable}et(()=>{[`none`,`asc`,`desc`].includes(P.value.sort)||ae({componentName:`VueUiVerticalBar`,type:`attributeWrongValue`,property:`style.chart.layout.bars.sort`,key:P.value.sort}),j.value=un.value[P.value.sort]??0});function Or(){j.value+=1,j.value>2&&(j.value=0)}function kr(){Or()}function Ar(){H.value.showTooltip=!H.value.showTooltip}let jr=x(!1);function Mr(){jr.value=!jr.value}let Nr=we(k,()=>L.value.title.text),Pr=f(()=>Oe({config:N,style:L,mutableConfig:H,dialog:Ht,accordion:Re,isFullscreen:$,parent:k,maxWidth:800,isCursorPointer:_n}));at(()=>H.value.showTable,e=>De(e,N,on));let{isResponsive:Fr}=Ue(In,Ln);function Ir(){H.value.showTable=!1,sn.value&&sn.value.setTableIconState(!1)}let Lr=f(()=>U.value.map((e,t)=>({...e,shape:`square`,display:`${e.name}: ${oe(P.value.dataLabels.value.formatter,e.value,a({p:L.value.legend.prefix,v:e.value,s:L.value.legend.suffix,r:L.value.legend.roundingValue}),{datapoint:e,seriesIndex:t})}`}))),Rr=f(()=>L.value.backgroundColor),zr=f(()=>L.value.legend),Br=f(()=>L.value.title),Vr=f(()=>Lr.value.map(e=>({...e,name:e.display}))),{isCallbackImaging:Hr,isCallbackSvg:Ur,generateSvg:Wr,onGenerateImage:Gr}=Ee({svg:En,title:Br,legend:zr,legendItems:Vr,backgroundColor:Rr,getSvgCallback:()=>N.value.userOptions.callbacks.svg,generateImage:Nn});function Kr(){console.warn(`[autoSize]: this legacy method can be safely removed as it has no impact.`)}async function qr(){gn(`copyAlt`,{config:N.value,dataset:W.value}),N.value.userOptions.callbacks.altCopy?await Promise.resolve(N.value.userOptions.callbacks.altCopy({config:N.value,dataset:W.value})):console.warn("Vue Data UI - A callback must be set for `altCopy` in userOptions.")}let Jr=x(!1);function Yr(){M.value=null,Jr.value=!0}function Xr(){M.value=null,Jt.value=!1,Jr.value=!1}function Zr(){if(M.value===null)return;let e=G.value[M.value];e&&vr({datapoint:e,seriesIndex:M.value}),M.value=null,hn.value=`pointer`}function Qr(e){if(!En.value||jr.value||document.activeElement!==En.value)return;let t=e.key===`ArrowRight`||e.key===`ArrowDown`,n=e.key===`ArrowLeft`||e.key===`ArrowUp`,r=e.key===`Enter`||e.key===` `,i=e.key===`Escape`;if(!t&&!n&&!r&&!i)return;let a=G.value.length;if(!a)return;if(e.preventDefault(),e.stopPropagation(),i){Zr();return}if(r){if(M.value===null)return;let e=G.value[M.value];if(!e)return;_r({datapoint:e,seriesIndex:M.value});return}let o=M.value,s=Xt.value?G.value.findIndex(e=>e.id===Xt.value.id):null;o!==null&&o>=0&&o<a?t?(o+=1,o>=a&&(o=0)):n&&(--o,o<0&&(o=a-1)):s!==null&&s>=0&&s<a?(o=t?s+1:s-1,o>=a&&(o=0),o<0&&(o=a-1)):o=t?0:a-1;let c=G.value[o];c&&(M.value=o,$r(c),yr(c,o,`keyboard`))}function $r(e){if(!e)return;let t=X.value.right,n=X.value.top+(B.value+J.value)*e.absoluteIndex+q.value[e.absoluteIndex]*K.value;if(!Number.isFinite(t)||!Number.isFinite(n))return;let r=fe(t,n,En.value);r&&(mn.value=r)}let ei=f(()=>({head:Sr.value.head,body:Sr.value.body.map(e=>[e.parentName,e.parentValue===``?``:a({v:e.parentValue,r:P.value.dataLabels.value.roundingValue,p:P.value.dataLabels.prefix,s:P.value.dataLabels.suffix}),e.percentageToTotal===``?``:a({v:e.percentageToTotal*100,r:P.value.dataLabels.percentage.roundingPercentage,s:`%`}),e.childName,e.childValue===``?``:a({v:e.childValue,r:P.value.dataLabels.value.roundingValue,p:P.value.dataLabels.prefix,s:P.value.dataLabels.suffix}),e.childPercentageToParent===``?``:a({v:e.childPercentageToParent*100,r:P.value.dataLabels.percentage.roundingPercentage,s:`%`}),e.childPercentageToTotal===``?``:a({v:e.childPercentageToTotal*100,r:P.value.dataLabels.percentage.roundingPercentage,s:`%`})]),caption:N.value.a11y.translations.tableCaption,notice:N.value.a11y.translations.tableAvailable}));return xe({autoSize:Kr,getData:fr,getImage:Nr,generatePdf:Mn,generateCsv:Tr,generateImage:Nn,generateSvg:Wr,hideSeries:or,showSeries:ar,toggleTable:Dr,toggleSort:kr,toggleTooltip:Ar,toggleAnnotator:Mr,toggleFullscreen:Er,copyAlt:qr}),(e,i)=>(b(),h(`div`,{class:v(`vue-data-ui-component vue-ui-vertical-bar ${$.value?`vue-data-ui-wrapper-fullscreen`:``} ${N.value.useCssAnimation?``:`vue-ui-dna`} ${N.value.responsive?`vue-ui-vertical-bar-autosize`:``}`),ref_key:`verticalBarChart`,ref:k,id:`vue-ui-vertical-bar_${O.value}`,style:y(`font-family:${N.value.style.fontFamily};width:100%; text-align:center;background:${L.value.backgroundColor};height:100%`),onMouseenter:i[3]||=()=>T(wn)(!0),onMouseleave:i[4]||=()=>T(wn)(!1)},[g(`p`,{id:`chart-instructions-${O.value}`,class:`sr-only`},w(N.value.a11y.translations.keyboardNavigation),9,lt),ei.value.body.length?(b(),p(Be,{key:0,uid:O.value,head:ei.value.head,body:ei.value.body,caption:ei.value.caption,notice:ei.value.notice},null,8,[`uid`,`head`,`body`,`caption`,`notice`])):m(``,!0),N.value.userOptions.buttons.annotator?(b(),p(T(zt),Xe({key:1},T(n)(N.value.userOptions.annotator),{svgRef:T(En),backgroundColor:L.value.backgroundColor,color:L.value.color,active:jr.value,isCursorPointer:_n.value,palette:N.value.userOptions.annotatorPalette,onClose:Mr}),Ke({_:2},[S(T(r),n=>({name:n,fn:E(r=>[C(e.$slots,n,Qe(_(T(t)(n,r))),void 0,!0)])}))]),1040,[`svgRef`,`backgroundColor`,`color`,`active`,`isCursorPointer`,`palette`])):m(``,!0),Pn.value?(b(),h(`div`,{key:2,ref_key:`noTitle`,ref:tn,class:`vue-data-ui-no-title-space`,style:`height:36px; width: 100%;background:transparent`},null,512)):m(``,!0),L.value.title.text?(b(),h(`div`,{key:3,ref_key:`chartTitle`,ref:Qt,style:`width:100%;background:transparent;padding-bottom:12px`},[(b(),p(Te,{key:`title_${nn.value}`,config:{title:{cy:`vertical-bar-div-title`,...L.value.title},subtitle:{cy:`vertical-bar-div-subtitle`,...L.value.title.subtitle}}},null,8,[`config`]))],512)):m(``,!0),N.value.userOptions.show&&qt.value&&(T(Tn)||T(Cn))?(b(),p(T(Bt),Xe({ref_key:`userOptionsRef`,ref:sn,backgroundColor:L.value.backgroundColor,color:L.value.color,key:`user_options_${Zt.value}`,isImaging:T(jn),isPrinting:T(An),uid:O.value,hasTooltip:N.value.userOptions.buttons.tooltip&&I.value.show,isFullscreen:$.value,isTooltip:H.value.showTooltip,chartElement:k.value},T(Ae)(N.value.userOptions,`pdf csv img svg table fullscreen altCopy annotator sort`),{isAnnotation:jr.value,tableDialog:N.value.table.useDialog,isCursorPointer:_n.value,onToggleFullscreen:Er,onGeneratePdf:T(Mn),onGenerateCsv:Tr,onGenerateImage:T(Gr),onGenerateSvg:T(Wr),onToggleTable:Dr,onToggleSort:kr,onToggleTooltip:Ar,onToggleAnnotator:Mr,onCopyAlt:qr,style:{visibility:T(Tn)?T(Cn)?`visible`:`hidden`:`visible`}}),Ke({_:2},[S(T(ke)(e.$slots,`menuIcon optionTooltip optionPdf optionCsv optionImg optionSvg optionTable optionLabels optionSort optionFullscreen optionAnnotator optionAltCopy custom-menu-before custom-menu-after`),t=>({name:t,fn:E(n=>[C(e.$slots,t,Qe(_(T(je)(t,n))),void 0,!0)])}))]),1040,[`backgroundColor`,`color`,`isImaging`,`isPrinting`,`uid`,`hasTooltip`,`isFullscreen`,`isTooltip`,`chartElement`,`isAnnotation`,`tableDialog`,`isCursorPointer`,`onGeneratePdf`,`onGenerateImage`,`onGenerateSvg`,`style`])):m(``,!0),e.$slots.legend&&L.value.legend.show&&L.value.legend.position===`top`?C(e.$slots,`legend`,{legend:U.value},void 0,!0,5):m(``,!0),!e.$slots.legend&&L.value.legend.show&&L.value.legend.position===`top`?(b(),h(`div`,{key:6,ref_key:`chartLegend`,ref:$t},[(b(),p(We,{key:`legend_top_${rn.value}`,legendSet:U.value,config:Kn.value,onClickMarker:i[0]||=({legend:e})=>rr(e.id)},Ke({item:E(({legend:e,index:t})=>[g(`div`,{onClick:t=>rr(e.id),style:y(`opacity:${A.value.includes(e.id)?.5:1}`)},w(br({legend:e,index:t})),13,ut)]),legendToggle:E(()=>[U.value.length>2&&L.value.legend.selectAllToggle.show&&!T(bn)?(b(),p(ze,{key:0,backgroundColor:L.value.legend.selectAllToggle.backgroundColor,color:L.value.legend.selectAllToggle.color,fontSize:L.value.legend.fontSize,checked:A.value.length>0,onToggle:nr},null,8,[`backgroundColor`,`color`,`fontSize`,`checked`])):m(``,!0)]),_:2},[e.$slots.pattern?{name:`legend-pattern`,fn:E(({legend:e,index:t})=>[Je(Pe,{shape:e.shape,radius:30,stroke:`none`,plot:{x:30,y:30},fill:`url(#pattern_${O.value}_${t})`},null,8,[`shape`,`fill`])]),key:`0`}:void 0]),1032,[`legendSet`,`config`]))],512)):m(``,!0),g(`div`,dt,[(b(),h(`svg`,{ref_key:`svgRef`,ref:En,xmlns:T(de),class:v({"vue-data-ui-fullscreen--on":$.value,"vue-data-ui-fulscreen--off":!$.value,"vue-data-ui-no-transition":!T(R)}),viewBox:`0 0 ${z.value} ${On.value}`,style:y(`max-width:100%;overflow:visible;background:transparent;color:${L.value.color}`),tabindex:`0`,"aria-describedby":`chart-instructions-${O.value}`,onFocus:Yr,onBlur:Xr,onKeydown:Qr},[g(`g`,{ref_key:`G`,ref:an,class:`vue-data-ui-g`},[Je(T(Vt)),C(e.$slots,`svg-underlayer`,{svg:{...Y.value,drawingArea:X.value,isPrintingImg:T(An)||T(jn)||T(Hr),isPrintingSvg:T(Ur)}},void 0,!0),e.$slots[`chart-background`]?(b(),h(`foreignObject`,{key:0,x:0,y:0,width:z.value,height:On.value,style:{pointerEvents:`none`}},[C(e.$slots,`chart-background`,{},void 0,!0)],8,pt)):m(``,!0),g(`defs`,null,[(b(!0),h(d,null,S(G.value,(e,t)=>(b(),p(Le,{t:`linear`,x1:`0%`,y1:`0%`,x2:`100%`,y2:`0%`,id:`vertical_bar_gradient_${O.value}_${t}`,key:`vertical_bar_gradient_${O.value}_${t}`,stops:[[`0%`,e.color,1],[`100%`,T(ee)(T(re)(e.color,.03),100-P.value.gradientIntensity),1]]},null,8,[`id`,`stops`]))),128))]),e.$slots.pattern?(b(),h(`g`,mt,[(b(!0),h(d,null,S(G.value,t=>(b(),h(`defs`,null,[C(e.$slots,`pattern`,Xe({ref_for:!0},{seriesIndex:t.absoluteIndex,patternId:`pattern_${O.value}_${t.absoluteIndex}`}),void 0,!0)]))),256))])):m(``,!0),P.value.rowColor?(b(!0),h(d,{key:2},S(G.value,(e,t)=>(b(),h(`g`,{key:`row_${e.id}`},[g(`rect`,{x:0,y:X.value.top+(B.value+J.value)*t+q.value[t]*K.value,width:z.value,height:J.value<=0?1e-4:J.value,fill:P.value.rowColor,rx:P.value.rowRadius,style:{pointerEvents:`none`},class:v({"vue-data-ui-transition":T(R)})},null,10,ht)]))),128)):m(``,!0),(b(!0),h(d,null,S(G.value,(e,t)=>(b(),h(`g`,{key:`underlayer_${e.id}`},[g(`rect`,{x:T(u)(cr.value?X.value.left+X.value.width/2-(e.sign===1?0:Q(e.value)<=0?1e-4:Q(e.value)):X.value.left),y:X.value.top+(B.value+J.value)*t+q.value[t]*K.value,width:T(u)(Q(e.value)<=0?1e-4:Q(e.value)),height:J.value<=0?1e-4:J.value,fill:P.value.underlayerColor,rx:P.value.borderRadius,class:v({"vue-data-ui-transition":T(R)})},null,10,gt)]))),128)),(b(!0),h(d,null,S(G.value,(t,n)=>(b(),h(`g`,{key:`barloop_${t.id}`},[g(`rect`,{x:T(u)(cr.value?X.value.left+X.value.width/2-(t.sign===1?0:Q(t.value)<=0?1e-4:Q(t.value)):X.value.left),y:X.value.top+(B.value+J.value)*n+q.value[n]*K.value,width:T(u)(Q(t.value)<=0?1e-4:Q(t.value)),height:J.value<=0?1e-4:J.value,fill:P.value.useGradient?`url(#vertical_bar_gradient_${O.value}_${n})`:T(ee)(t.color,P.value.fillOpacity),rx:P.value.borderRadius,stroke:P.value.useStroke?t.color:`none`,"stroke-width":P.value.useStroke?P.value.strokeWidth:0,class:v({"vue-data-ui-transition":T(R)})},null,10,_t),e.$slots.pattern?(b(),h(`rect`,{key:0,x:T(u)(cr.value?X.value.left+X.value.width/2-(t.sign===1?0:Q(t.value)<=0?1e-4:Q(t.value)):X.value.left),y:X.value.top+(B.value+J.value)*n+q.value[n]*K.value,width:T(u)(Q(t.value)<=0?1e-4:Q(t.value)),height:J.value<=0?1e-4:J.value,fill:`url(#pattern_${O.value}_${t.absoluteIndex})`,rx:P.value.borderRadius,stroke:P.value.useStroke?t.color:`none`,"stroke-width":P.value.useStroke?P.value.strokeWidth:0,class:v({"vue-data-ui-transition":T(R)})},null,10,vt)):m(``,!0),(!t.isChild||t.isLastChild)&&F.value.separators.show&&n!==G.value.length-1?(b(),h(`path`,{key:1,stroke:F.value.separators.color,"stroke-width":F.value.separators.strokeWidth,"stroke-linecap":`round`,class:v({"vue-data-ui-transition":T(R)}),d:`M${z.value}, ${J.value+B.value/2+X.value.top+(B.value+J.value)*n+q.value[n]*K.value} ${F.value.separators.fullWidth?0:X.value.left}, ${J.value+B.value/2+X.value.top+(B.value+J.value)*n+q.value[n]*K.value}`},null,10,yt)):m(``,!0),cr.value&&F.value.separators.show?(b(),h(`path`,{key:2,stroke:F.value.separators.color,"stroke-width":F.value.separators.strokeWidth,"stroke-linecap":`round`,class:v({"vue-data-ui-transition":T(R)}),d:`M${X.value.left+X.value.width/2}, ${X.value.top} ${X.value.left+X.value.width/2}, ${X.value.bottom}`},null,10,bt)):m(``,!0)]))),128)),g(`g`,{ref_key:`parentLabels`,ref:cn},[(b(!0),h(d,null,S(G.value,(e,t)=>(b(),h(`g`,{key:`pn_${e.id}`,class:`vue-ui-horizontal-bar-parent-label`},[e.isChild&&e.childIndex===0&&P.value.parentLabels.show?(b(),h(`rect`,{key:0,class:v([`vue-ui-horizontal-bar-parent-marker`,{"vue-data-ui-transition":T(R)}]),x:2,y:dr(e,t).y-P.value.parentLabels.fontSize/1.5,height:P.value.parentLabels.fontSize/1.5,width:P.value.parentLabels.fontSize/1.5,rx:1,fill:e.color},null,10,xt)):m(``,!0),e.isChild&&e.childIndex===0&&P.value.parentLabels.show?(b(),h(`text`,{key:1,class:v({"vue-data-ui-transition":T(R)}),transform:`translate(${P.value.parentLabels.offsetX+P.value.parentLabels.fontSize}, ${dr(e,t).y})`,"font-size":P.value.parentLabels.fontSize,fill:P.value.parentLabels.color,"font-weight":P.value.parentLabels.bold?`bold`:`normal`,"text-anchor":`start`,innerHTML:T(l)({content:`${pr(e,t)}`,fontSize:P.value.parentLabels.fontSize,fill:F.value.bars.parentLabels.color,x:0,y:0,translateY:!1})},null,10,St)):m(``,!0),e.isChild&&e.childIndex===0&&P.value.parentLabels.show?(b(),h(`text`,{key:2,class:v({"vue-data-ui-transition":T(R)}),transform:`translate(${P.value.parentLabels.offsetX+P.value.parentLabels.fontSize}, ${dr(e,t).y+T(pe)(pr(e,t))*P.value.parentLabels.fontSize*1.1})`,"font-size":P.value.parentLabels.fontSize,fill:P.value.parentLabels.color,"font-weight":P.value.dataLabels.bold?`bold`:`normal`,"text-anchor":`start`},w(mr(e,t)),11,Ct)):m(``,!0)]))),128))],512),g(`g`,{ref_key:`childLabels`,ref:ln},[(b(!0),h(d,null,S(Wn.value,(e,t)=>(b(),h(`g`,{key:`cl_${e.id}`,class:`vue-ui-horizontal-bar-child-label`},[(e.isChild||!e.hasChildren)&&P.value.nameLabels.show?(b(),h(`text`,{key:0,"text-anchor":`start`,class:v({"vue-data-ui-transition":T(R)}),transform:`translate(${Math.abs(P.value.nameLabels.offsetX)}, ${T(u)(X.value.top+(B.value+J.value)*t+J.value/2+P.value.nameLabels.fontSize/2+q.value[t]*K.value)})`,"font-size":P.value.nameLabels.fontSize,fill:`transparent`,"font-weight":P.value.nameLabels.bold?`bold`:`normal`,style:{"user-select":`none`},innerHTML:T(l)({content:e.name,fontSize:P.value.nameLabels.fontSize,fill:`transparent`,x:0,y:0,translateY:!0})},null,10,wt)):m(``,!0)]))),128))],512),g(`g`,null,[(b(!0),h(d,null,S(G.value,(e,t)=>(b(),h(`g`,{key:`vislab_${e.id}`,class:`vue-ui-horizontal-bar-child-label`},[(e.isChild||!e.hasChildren)&&P.value.nameLabels.show?(b(),h(`text`,{key:0,class:v({"vue-data-ui-transition":T(R)}),"text-anchor":`end`,transform:`translate(${X.value.left+P.value.nameLabels.offsetX-6}, ${X.value.top+(B.value+J.value)*t+J.value/2+P.value.nameLabels.fontSize/3+q.value[t]*K.value})`,"font-size":P.value.nameLabels.fontSize,fill:P.value.nameLabels.color,"font-weight":P.value.nameLabels.bold?`bold`:`normal`,innerHTML:T(l)({content:e.name,fontSize:P.value.nameLabels.fontSize,fill:F.value.bars.nameLabels.color,x:0,y:0,translateY:!0})},null,10,Tt)):m(``,!0)]))),128))]),g(`g`,null,[(b(!0),h(d,null,S(G.value,(e,t)=>(b(),h(`g`,{key:`sdl_${e.id}`,class:`vue-ui-horizontal-bar-child-label`},[g(`text`,{class:v({"vue-data-ui-transition":T(R)}),transform:`translate(${cr.value?X.value.left+X.value.width/2+(e.sign===1?-12:12)+(e.sign===1?-F.value.bars.dataLabels.offsetX:F.value.bars.dataLabels.offsetX):Math.min(ur(e.value)+3+L.value.layout.bars.dataLabels.offsetX,X.value.right-2)},${X.value.top+(B.value+J.value)*t+J.value/2+q.value[t]*K.value+P.value.dataLabels.fontSize/3})`,"text-anchor":!cr.value||e.sign===-1?`start`:`end`,"font-size":P.value.dataLabels.fontSize,fill:P.value.dataLabels.color,"font-weight":P.value.dataLabels.bold?`bold`:`normal`},w(xr(e.value,e,t,e.sign)),11,Et)]))),128))]),(b(!0),h(d,null,S(G.value,(e,t)=>(b(),h(`g`,null,[g(`rect`,{x:0,y:X.value.top+(B.value+J.value)*t-B.value/2+q.value[t]*K.value,width:z.value,height:J.value+B.value<=0?1e-4:J.value+B.value,fill:hr.value===e.id?T(ee)(F.value.highlighter.color,F.value.highlighter.opacity):`transparent`,onMouseenter:n=>yr(e,t,`pointer`),onMouseleave:n=>vr({datapoint:e,seriesIndex:t}),onClick:n=>_r({datapoint:e,seriesIndex:t})},null,40,Dt)]))),256)),C(e.$slots,`svg`,{svg:{...Y.value,drawingArea:X.value,isPrintingImg:T(An)||T(jn)||T(Hr),isPrintingSvg:T(Ur)}},void 0,!0)],512)],46,ft)),e.$slots.hint?(b(),h(`div`,Ot,[C(e.$slots,`hint`,Qe(_({hint:N.value.a11y.translations.keyboardNavigation,isVisible:Jr.value})),void 0,!0)])):m(``,!0)]),e.$slots.watermark?(b(),h(`div`,kt,[C(e.$slots,`watermark`,Qe(_({isPrinting:T(An)||T(jn)||T(Hr)||T(Ur)})),void 0,!0)])):m(``,!0),e.$slots.legend&&L.value.legend.show&&L.value.legend.position===`bottom`?C(e.$slots,`legend`,{legend:U.value},void 0,!0,8):m(``,!0),!e.$slots.legend&&L.value.legend.show&&L.value.legend.position===`bottom`?(b(),h(`div`,{key:9,ref_key:`chartLegend`,ref:$t},[(b(),p(We,{key:`legend_bottom_${rn.value}`,legendSet:U.value,config:Kn.value,isCursorPointer:_n.value,onClickMarker:i[1]||=({legend:e})=>rr(e.id)},Ke({item:E(({legend:e,index:t})=>[g(`div`,{onClick:t=>rr(e.id),style:y(`opacity:${A.value.includes(e.id)?.5:1}`)},w(br({legend:e,index:t})),13,At)]),legendToggle:E(()=>[U.value.length>2&&L.value.legend.selectAllToggle.show&&!T(bn)?(b(),p(ze,{key:0,backgroundColor:L.value.legend.selectAllToggle.backgroundColor,color:L.value.legend.selectAllToggle.color,fontSize:L.value.legend.fontSize,checked:A.value.length>0,isCursorPointer:_n.value,onToggle:nr},null,8,[`backgroundColor`,`color`,`fontSize`,`checked`,`isCursorPointer`])):m(``,!0)]),_:2},[e.$slots.pattern?{name:`legend-pattern`,fn:E(({legend:e,index:t})=>[Je(Pe,{shape:e.shape,radius:30,stroke:`none`,plot:{x:30,y:30},fill:`url(#pattern_${O.value}_${t})`},null,8,[`shape`,`fill`])]),key:`0`}:void 0]),1032,[`legendSet`,`config`,`isCursorPointer`]))],512)):m(``,!0),e.$slots.source?(b(),h(`div`,{key:10,ref_key:`source`,ref:en,dir:`auto`},[C(e.$slots,`source`,{},void 0,!0)],512)):m(``,!0),Je(T(Lt),{teleportTo:I.value.teleportTo,show:H.value.showTooltip&&Jt.value&&A.value.length<D.dataset.length,backgroundColor:I.value.backgroundColor,color:I.value.color,borderRadius:I.value.borderRadius,borderColor:I.value.borderColor,borderWidth:I.value.borderWidth,fontSize:I.value.fontSize,backgroundOpacity:I.value.backgroundOpacity,position:I.value.position,offsetX:I.value.offsetX,offsetY:I.value.offsetY,parent:k.value,content:Yt.value,isFullscreen:$.value,isCustom:I.value.customFormat&&typeof I.value.customFormat==`function`,smooth:I.value.smooth,backdropFilter:I.value.backdropFilter,smoothForce:I.value.smoothForce,smoothSnapThreshold:I.value.smoothSnapThreshold,isA11yMode:hn.value===`keyboard`,a11yPosition:mn.value},{"tooltip-before":E(()=>[C(e.$slots,`tooltip-before`,Qe(_({...gr.value})),void 0,!0)]),tooltip:E(()=>[C(e.$slots,`tooltip`,Qe(_({...gr.value})),void 0,!0)]),"tooltip-after":E(()=>[C(e.$slots,`tooltip-after`,Qe(_({...gr.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`]),qt.value&&N.value.userOptions.buttons.table?(b(),p(tt(Pr.value.component),Xe({key:11},Pr.value.props,{ref_key:`tableUnit`,ref:on,onClose:Ir}),Ke({content:E(()=>[g(`div`,{ref_key:`tableContainer`,ref:In,class:`vue-ui-vertical-bar-table atom-data-table`,style:y(`${N.value.table.useDialog?``:`max-height: 300px; margin-top: 24px`}`)},[g(`div`,jt,[N.value.table.useDialog?m(``,!0):(b(),h(`div`,{key:0,role:`button`,tabindex:`0`,style:y(`width:32px; position: absolute; top: 0; right:4px; padding: 0 0px; display: flex; align-items:center;justify-content:center;height: 36px; width: 32px; cursor:${_n.value?`pointer`:`default`}; background:${N.value.table.th.backgroundColor};`),onClick:Ir,onKeypress:ot(Ir,[`enter`])},[Je(T(Rt),{name:`close`,stroke:N.value.table.th.color,"stroke-width":2},null,8,[`stroke`])],36)),g(`div`,{style:{width:`100%`,"container-type":`inline-size`},class:v({"vue-ui-responsive":T(Fr)})},[g(`table`,Mt,[N.value.table.useDialog?m(``,!0):(b(),h(`caption`,{key:0,style:y({backgroundColor:N.value.table.th.backgroundColor,color:N.value.table.th.color,outline:N.value.table.th.outline}),class:`vue-ui-data-table__caption`},[qe(w(L.value.title.text)+` `,1),L.value.title.subtitle.text?(b(),h(`span`,Nt,w(L.value.title.subtitle.text),1)):m(``,!0)],4)),g(`thead`,null,[g(`tr`,{role:`row`,style:y(`background:${N.value.table.th.backgroundColor};color:${N.value.table.th.color}`)},[(b(!0),h(d,null,S(Sr.value.head,e=>(b(),h(`th`,{style:y(`outline:${N.value.table.th.outline}`)},[g(`div`,Pt,w(e),1)],4))),256))],4),g(`tr`,null,[g(`th`,{style:y(`background:${N.value.table.th.backgroundColor};color:${N.value.table.th.color};outline:${N.value.table.th.outline}`)},null,4),g(`th`,{style:y(`background:${N.value.table.th.backgroundColor};color:${N.value.table.th.color};outline:${N.value.table.th.outline};text-align:right;padding-right:5px;font-weight:bold`)},` ∑ `+w(N.value.table.td.prefix)+w(isNaN(Z.value)?``:Z.value.toFixed(N.value.table.td.roundingValue))+w(N.value.table.td.suffix),5),g(`th`,{style:y(`background:${N.value.table.th.backgroundColor};color:${N.value.table.th.color};outline:${N.value.table.th.outline};text-align:right;padding-right:5px;font-weight:bold`)},` 100% `,4),g(`th`,{style:y(`background:${N.value.table.th.backgroundColor};color:${N.value.table.th.color};outline:${N.value.table.th.outline}`)},null,4),g(`th`,{style:y(`background:${N.value.table.th.backgroundColor};color:${N.value.table.th.color};outline:${N.value.table.th.outline}`)},null,4),g(`th`,{style:y(`background:${N.value.table.th.backgroundColor};color:${N.value.table.th.color};outline:${N.value.table.th.outline}`)},null,4),g(`th`,{style:y(`background:${N.value.table.th.backgroundColor};color:${N.value.table.th.color};outline:${N.value.table.th.outline}`)},null,4)])]),g(`tbody`,null,[(b(!0),h(d,null,S(Sr.value.body,(e,t)=>(b(),h(`tr`,{class:v({"vue-ui-data-table__tbody__row":!0,"vue-ui-data-table__tbody__row-even":t%2==0,"vue-ui-data-table__tbody__row-odd":t%2!=0}),style:y(`background:${N.value.table.td.backgroundColor};color:${N.value.table.td.color}`)},[(b(),h(d,null,S(Cr,(t,n)=>g(`td`,{key:t.key,class:`vue-ui-data-table__tbody__td`,style:y(n===0?`outline:${N.value.table.td.outline};font-variant-numeric: tabular-nums;`:`outline:${N.value.table.td.outline}`),"data-cell":Sr.value.head[n]??``},[g(`div`,It,[n===0?(b(),h(d,{key:0},[e.color?(b(),h(`span`,{key:0,style:y(`color:${e.color};margin-right:3px`)},`⬤`,4)):m(``,!0),g(`span`,null,w(e.parentName),1)],64)):(b(),h(d,{key:1},[qe(w(wr(e,t)),1)],64))])],12,Ft)),64))],6))),256))])])],2)])],4)]),_:2},[N.value.table.useDialog?{name:`title`,fn:E(()=>[qe(w(Pr.value.title),1)]),key:`0`}:void 0,N.value.table.useDialog?{name:`actions`,fn:E(()=>[g(`button`,{tabindex:`0`,class:`vue-ui-user-options-button`,onClick:i[2]||=e=>Tr(N.value.userOptions.callbacks.csv),style:y({cursor:_n.value?`pointer`:`default`})},[Je(T(Rt),{name:`fileCsv`,stroke:Pr.value.props.color},null,8,[`stroke`])],4)]),key:`1`}:void 0]),1040)):m(``,!0),C(e.$slots,`skeleton`,{},()=>[T(bn)?(b(),p(ve,{key:0})):m(``,!0)],!0)],46,ct))}},[[`__scopeId`,`data-v-d99b9aa1`]]);export{st as n,Lt as t};
@@ -1 +1 @@
1
- import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{t}from"./useConfig-By3Vb5kz.js";import{$ as n,X as r,i}from"./lib-rPeBMZrn.js";import{n as a,t as o}from"./useHints-C-TwxM0Y.js";import{t as s}from"./useNestedProp-DnGoh-XS.js";import{t as c}from"./usePrefersMotion-XLHwega2.js";import{Fragment as l,computed as u,createCommentVNode as d,createElementBlock as f,createElementVNode as p,createTextVNode as m,createVNode as h,defineAsyncComponent as g,normalizeClass as _,normalizeStyle as v,onMounted as y,openBlock as b,ref as x,renderSlot as S,toDisplayString as C,unref as w,useSlots as T,watch as E}from"vue";var D=/* @__PURE__ */ e({default:()=>j}),O=[`aria-labelledby`],k=[`id`],A=[`aria-label`],j={__name:`vue-ui-kpi`,props:{config:{type:Object,default(){return{}}},dataset:{type:Number,default:0}},setup(e){let D=g(()=>import(`./vue-ui-digits-CfdB0vaP.js`).then(e=>e.n)),{vue_ui_kpi:j}=t(),M=c(),N=e,P=u({get:()=>R(),set:e=>e});a({config:()=>P.value,dataset:()=>N.dataset,component:`VueUiKpi`,rules:[o.noHint]});let F=T(),I=u(()=>P.value.debug),L=x(r());y(()=>{F[`chart-background`]&&I.value&&console.warn(`VueUiKpi does not support the #chart-background slot.`)});function R(){return s({userConfig:N.config,defaultConfig:j})}E(()=>N.config,e=>{P.value=R(),H()},{deep:!0});let z=x((N.dataset,N.dataset)),B=x(P.value.useAnimation?P.value.animationValueStart:z.value),V=e=>{let t=P.value.animationFrames,n=Math.abs(e-B.value)/t;function r(){B.value<e?B.value=Math.min(B.value+n,e):B.value>e&&(B.value=Math.max(B.value-n,e)),B.value!==e&&requestAnimationFrame(r)}r()};y(()=>{H()});function H(){P.value.useAnimation&&!M.value?(B.value=P.value.animationValueStart,V(N.dataset)):B.value=N.dataset}return E(()=>N.dataset,e=>{P.value.useAnimation&&!M.value?V(e):B.value=e}),(t,r)=>(b(),f(`div`,{class:_(`vue-data-ui-component vue-ui-kpi ${P.value.layoutClass}`),style:v(`background:${P.value.backgroundColor}; ${P.value.layoutCss}`),"aria-labelledby":`kpi-title-${L.value}`},[P.value.title||t.$slots.title?(b(),f(`div`,{key:0,class:_(`vue-ui-kpi-title ${P.value.titleClass}`),style:v(`font-family: ${P.value.fontFamily}; font-size:${P.value.titleFontSize}px; color:${P.value.titleColor}; font-weight:${P.value.titleBold?`bold`:`normal`}; ${P.value.titleCss}`),id:`kpi-title-${L.value}`},[S(t.$slots,`title`,{comment:e.dataset}),m(` `+C(P.value.title),1)],14,k)):d(``,!0),S(t.$slots,`comment-before`,{comment:e.dataset}),p(`div`,{class:_(`vue-ui-kpi-value ${P.value.valueClass}`),style:v(`font-family: ${P.value.fontFamily}; font-size:${P.value.valueFontSize}px; color:${P.value.valueColor}; font-weight:${P.value.valueBold?`bold`:`normal`}; ${P.value.valueCss}`),role:`status`,"aria-live":`polite`,"aria-atomic":`true`,"aria-label":B.value.toFixed(P.value.valueRounding)},[S(t.$slots,`value`,{comment:e.dataset}),P.value.analogDigits.show?(b(),f(`div`,{key:0,style:v({height:P.value.analogDigits.height+`px`})},[h(w(D),{dataset:Number(B.value.toFixed(P.value.valueRounding)),config:{backgroundColor:P.value.backgroundColor,digits:{color:P.value.analogDigits.color,skeletonColor:P.value.analogDigits.skeletonColor}}},null,8,[`dataset`,`config`])],4)):(b(),f(l,{key:1},[m(C(w(i)(P.value.formatter,B.value,w(n)({p:P.value.prefix,v:B.value,s:P.value.suffix,r:P.value.valueRounding}))),1)],64))],14,A),S(t.$slots,`comment-after`,{comment:e.dataset})],14,O))}};export{D as n,j as t};
1
+ import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{t}from"./useConfig-C3FbHv4N.js";import{$ as n,X as r,i}from"./lib-rPeBMZrn.js";import{n as a,t as o}from"./useHints-C-TwxM0Y.js";import{t as s}from"./useNestedProp-DnGoh-XS.js";import{t as c}from"./usePrefersMotion-XLHwega2.js";import{Fragment as l,computed as u,createCommentVNode as d,createElementBlock as f,createElementVNode as p,createTextVNode as m,createVNode as h,defineAsyncComponent as g,normalizeClass as _,normalizeStyle as v,onMounted as y,openBlock as b,ref as x,renderSlot as S,toDisplayString as C,unref as w,useSlots as T,watch as E}from"vue";var D=/* @__PURE__ */ e({default:()=>j}),O=[`aria-labelledby`],k=[`id`],A=[`aria-label`],j={__name:`vue-ui-kpi`,props:{config:{type:Object,default(){return{}}},dataset:{type:Number,default:0}},setup(e){let D=g(()=>import(`./vue-ui-digits-DbxT72mM.js`).then(e=>e.n)),{vue_ui_kpi:j}=t(),M=c(),N=e,P=u({get:()=>R(),set:e=>e});a({config:()=>P.value,dataset:()=>N.dataset,component:`VueUiKpi`,rules:[o.noHint]});let F=T(),I=u(()=>P.value.debug),L=x(r());y(()=>{F[`chart-background`]&&I.value&&console.warn(`VueUiKpi does not support the #chart-background slot.`)});function R(){return s({userConfig:N.config,defaultConfig:j})}E(()=>N.config,e=>{P.value=R(),H()},{deep:!0});let z=x((N.dataset,N.dataset)),B=x(P.value.useAnimation?P.value.animationValueStart:z.value),V=e=>{let t=P.value.animationFrames,n=Math.abs(e-B.value)/t;function r(){B.value<e?B.value=Math.min(B.value+n,e):B.value>e&&(B.value=Math.max(B.value-n,e)),B.value!==e&&requestAnimationFrame(r)}r()};y(()=>{H()});function H(){P.value.useAnimation&&!M.value?(B.value=P.value.animationValueStart,V(N.dataset)):B.value=N.dataset}return E(()=>N.dataset,e=>{P.value.useAnimation&&!M.value?V(e):B.value=e}),(t,r)=>(b(),f(`div`,{class:_(`vue-data-ui-component vue-ui-kpi ${P.value.layoutClass}`),style:v(`background:${P.value.backgroundColor}; ${P.value.layoutCss}`),"aria-labelledby":`kpi-title-${L.value}`},[P.value.title||t.$slots.title?(b(),f(`div`,{key:0,class:_(`vue-ui-kpi-title ${P.value.titleClass}`),style:v(`font-family: ${P.value.fontFamily}; font-size:${P.value.titleFontSize}px; color:${P.value.titleColor}; font-weight:${P.value.titleBold?`bold`:`normal`}; ${P.value.titleCss}`),id:`kpi-title-${L.value}`},[S(t.$slots,`title`,{comment:e.dataset}),m(` `+C(P.value.title),1)],14,k)):d(``,!0),S(t.$slots,`comment-before`,{comment:e.dataset}),p(`div`,{class:_(`vue-ui-kpi-value ${P.value.valueClass}`),style:v(`font-family: ${P.value.fontFamily}; font-size:${P.value.valueFontSize}px; color:${P.value.valueColor}; font-weight:${P.value.valueBold?`bold`:`normal`}; ${P.value.valueCss}`),role:`status`,"aria-live":`polite`,"aria-atomic":`true`,"aria-label":B.value.toFixed(P.value.valueRounding)},[S(t.$slots,`value`,{comment:e.dataset}),P.value.analogDigits.show?(b(),f(`div`,{key:0,style:v({height:P.value.analogDigits.height+`px`})},[h(w(D),{dataset:Number(B.value.toFixed(P.value.valueRounding)),config:{backgroundColor:P.value.backgroundColor,digits:{color:P.value.analogDigits.color,skeletonColor:P.value.analogDigits.skeletonColor}}},null,8,[`dataset`,`config`])],4)):(b(),f(l,{key:1},[m(C(w(i)(P.value.formatter,B.value,w(n)({p:P.value.prefix,v:B.value,s:P.value.suffix,r:P.value.valueRounding}))),1)],64))],14,A),S(t.$slots,`comment-after`,{comment:e.dataset})],14,O))}};export{D as n,j as t};
@@ -1,4 +1,4 @@
1
- import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{t}from"./useConfig-By3Vb5kz.js";import{X as n,kt as r,x as i}from"./lib-rPeBMZrn.js";import{t as a}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{t as o}from"./useNestedProp-DnGoh-XS.js";import{t as s}from"./useThemeCheck-BKNRbGeC.js";import{t as c}from"./Shape-CRe8woTu.js";import{t as l}from"./vue_ui_label-dtPqyFsj.js";import{Fragment as u,computed as d,createBlock as f,createCommentVNode as p,createElementBlock as m,createElementVNode as ee,getCurrentInstance as te,guardReactiveProps as ne,nextTick as h,normalizeClass as re,normalizeProps as ie,normalizeStyle as ae,onBeforeUnmount as oe,onMounted as se,openBlock as g,ref as _,renderList as ce,renderSlot as le,toDisplayString as ue,unref as de,useTemplateRef as v,watch as fe,withModifiers as pe}from"vue";var me=/* @__PURE__ */ e({default:()=>D}),he=[`d`,`stroke`,`stroke-width`,`stroke-dasharray`],ge=[`cx`,`cy`,`r`,`fill`,`stroke`,`stroke-width`],_e=[`id`,`data-position`,`data-overflow`,`data-overlap`,`data-target-x`,`data-target-y`,`data-box-position-x`,`data-box-position-y`,`data-link-length`,`data-box-show`,`data-box-max-width`,`data-box-padding-top`,`data-box-padding-right`,`data-box-padding-bottom`,`data-box-padding-left`,`data-drag-enabled`,`data-drag-handle-position`,`data-drag-handle-size`],ve=[`x`,`y`,`width`,`height`,`rx`,`fill`,`stroke`,`stroke-width`],ye=[`x`,`y`,`width`,`height`,`rx`,`aria-label`],be=[`font-size`,`font-weight`,`text-anchor`,`fill`],xe=[`x`,`y`],Se=[`font-size`,`font-weight`,`text-anchor`,`fill`],Ce=[`x`,`y`],we=[`aria-label`],Te=[`x`,`y`,`width`,`height`],Ee=[`x`,`y`,`width`,`height`,`rx`],De=[`d`,`stroke`,`stroke-width`],Oe=[`d`,`stroke`,`stroke-width`,`opacity`],ke=8,y=4,Ae=12,je=24,Me=1,Ne=10,b=`__vueUiLabelLayoutOrder`,Pe=`__vueUiLabelNextLayoutOrder`,x=`__vueUiLabelLayoutRaf`,Fe=`__vueUiLabelSetLayoutRect`,Ie=`__vueUiLabelMeasureElement`,Le=`__vueUiLabelEmitDragEnd`,S=`__vueUiLabelPersistedOffset`,C=`__vueUiLabelDragRequestedOffset`,w=`__vueUiLabelDragging`,Re=`__vueUiLabelDragPriority`,ze=`__vueUiLabelNextDragPriority`,Be=`__vueUiLabelLastLayoutRect`,T=`__vueUiLabelLastLayoutOffset`,E=`__vueUiLabelDisplacedLabels`,D=/*#__PURE__*/ a({__name:`vue-ui-label`,props:{dataset:{type:Object,default(){return{x:null,y:null,position:{x:null,y:null}}}},config:{type:Object,default(){return{}}}},emits:[`dragStart`,`drag`,`dragEnd`,`click`,`mouseenter`,`mouseleave`,`focus`,`blur`],setup(e,{expose:a,emit:me}){let D=e,O=me,{vue_ui_label:Ve}=t(),{isThemeValid:He,warnInvalidTheme:Ue}=s();function We(){let e=o({userConfig:D.config,defaultConfig:Ve}),t={},n=e.theme;return n?He.value(e)?t=o({userConfig:l[n]||D.config,defaultConfig:e}):(Ue(e),t=e):t=e,t}let k=d(()=>We()),Ge=te(),Ke=n(),qe=v(`wrapperRef`),A=v(`labelRef`),Je=v(`contentRef`),Ye=v(`boxRef`),Xe=v(`titleTextRef`),Ze=v(`contentTextRef`),j=_(null),M=_(null),N=_(null),P=_({x:0,y:0}),Qe=_(!1),F=_(!1),$e=_(`pointer`),et=d(()=>k.value.title.fontSize),tt=d(()=>k.value.title.lineHeight),nt=d(()=>k.value.content.fontSize),rt=d(()=>k.value.content.lineHeight),it=d(()=>k.value.title.gap),at=d(()=>k.value.drag.handleWidth),ot=d(()=>k.value.collisionGap),st=null,ct=null,I=null,L={inputType:null,touchId:null,startPointer:null,startOffset:null,lastRequestedOffset:null},lt=d(()=>({x:D.dataset?.x??null,y:D.dataset?.y??null})),R=d(()=>r(lt.value.x)&&r(lt.value.y)),z=d(()=>Number(lt.value.x)),B=d(()=>Number(lt.value.y)),V=d(()=>k.value.link),H=d(()=>k.value.box),ut=d(()=>k.value.drag),U=d(()=>k.value.title.marker),dt=d(()=>k.value.overlap===!0),W=d(()=>ut.value?.enable===!0),ft=d(()=>!!(Ge?.vnode?.props??{}).onClick),pt=d(()=>ft.value),mt=d(()=>[String(k.value.title?.text??``).trim(),String(k.value.content?.text??``).trim()].filter(Boolean).join(`, `)||`Label`),ht=d(()=>`Move ${mt.value}`),gt=`label_${Ke}_drag_instructions`,_t=d(()=>k.value.a11y.translations.keyboardNavigation),vt=d(()=>r(ut.value?.iconSize)?Math.max(0,Number(ut.value.iconSize)):0),yt=d(()=>vt.value*.15),bt=d(()=>{let e=ut.value?.handlePosition;return[`left`,`right`,`top`,`bottom`].includes(e)?e:`left`}),xt=d(()=>{let e=D.dataset?.position;return!e||!r(e.x)||!r(e.y)?null:{x:Number(e.x),y:Number(e.y)}}),St=d(()=>Qe.value?null:xt.value),Ct=d(()=>r(V.value.length)?Math.max(0,Number(V.value.length)):ke),wt=d(()=>Hn(k.value.title.textAlign)),Tt=d(()=>Hn(k.value.content.textAlign)),Et=d(()=>Un(wt.value)),Dt=d(()=>Un(Tt.value)),Ot=d(()=>U.value?.color!==null&&U.value?.color!==void 0&&String(k.value.title.text??``)!==``),kt=d(()=>Ot.value&&r(U.value?.size)?Math.max(0,Number(U.value.size)):0),At=d(()=>kt.value/2),jt=d(()=>U.value?.beforeText!==!1),Mt=d(()=>Ot.value&&kt.value>0?6:0),Nt=d(()=>kt.value>0?kt.value+Mt.value:0),G=d(()=>{let e=H.value.padding??{};return{top:r(e.top)?Math.max(0,Number(e.top)):0,right:r(e.right)?Math.max(0,Number(e.right)):0,bottom:r(e.bottom)?Math.max(0,Number(e.bottom)):0,left:r(e.left)?Math.max(0,Number(e.left)):0}}),Pt=d(()=>r(H.value.borderWidth)?Math.max(0,Number(H.value.borderWidth)):0),Ft=d(()=>r(H.value.borderRadius)?Math.max(0,Number(H.value.borderRadius)):0),K=d(()=>r(H.value.maxWidth)?Math.max(0,Number(H.value.maxWidth)):null),It=d(()=>W.value&&H.value.show?at.value:0),Lt=d(()=>[`left`,`right`].includes(bt.value)),Rt=d(()=>{if(!H.value.show||!r(K.value)||K.value<=0)return null;let e=Lt.value?It.value:0;return Math.max(1,K.value-G.value.left-G.value.right-e)}),zt=d(()=>Rt.value?Math.max(1,Rt.value-Nt.value):null),q=d(()=>{if(!H.value.show||!N.value)return null;let e=Pt.value/2,t=Math.max(0,N.value.width-Pt.value),n=Math.max(0,N.value.height-Pt.value);return{x:N.value.x+e,y:N.value.y+e,width:t,height:n,rx:Math.min(Ft.value,t/2,n/2)}}),Bt=d(()=>{if(!W.value||!q.value)return null;let e=bt.value,t=[`left`,`right`].includes(e),n=Math.min(at.value,Math.max(0,t?q.value.width:q.value.height));if(n<=0||q.value.width<=0||q.value.height<=0)return null;let r=q.value.x,i=q.value.y,a=q.value.width,o=q.value.height,s=``,c=``;if(e===`left`||e===`right`){a=n,r=e===`left`?q.value.x:q.value.x+q.value.width-n;let t=e===`left`?r+n:r,l=r+n/2,u=i+o/2;s=`
1
+ import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{t}from"./useConfig-C3FbHv4N.js";import{X as n,kt as r,x as i}from"./lib-rPeBMZrn.js";import{t as a}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{t as o}from"./useNestedProp-DnGoh-XS.js";import{t as s}from"./useThemeCheck-BKNRbGeC.js";import{t as c}from"./Shape-CRe8woTu.js";import{t as l}from"./vue_ui_label-dtPqyFsj.js";import{Fragment as u,computed as d,createBlock as f,createCommentVNode as p,createElementBlock as m,createElementVNode as ee,getCurrentInstance as te,guardReactiveProps as ne,nextTick as h,normalizeClass as re,normalizeProps as ie,normalizeStyle as ae,onBeforeUnmount as oe,onMounted as se,openBlock as g,ref as _,renderList as ce,renderSlot as le,toDisplayString as ue,unref as de,useTemplateRef as v,watch as fe,withModifiers as pe}from"vue";var me=/* @__PURE__ */ e({default:()=>D}),he=[`d`,`stroke`,`stroke-width`,`stroke-dasharray`],ge=[`cx`,`cy`,`r`,`fill`,`stroke`,`stroke-width`],_e=[`id`,`data-position`,`data-overflow`,`data-overlap`,`data-target-x`,`data-target-y`,`data-box-position-x`,`data-box-position-y`,`data-link-length`,`data-box-show`,`data-box-max-width`,`data-box-padding-top`,`data-box-padding-right`,`data-box-padding-bottom`,`data-box-padding-left`,`data-drag-enabled`,`data-drag-handle-position`,`data-drag-handle-size`],ve=[`x`,`y`,`width`,`height`,`rx`,`fill`,`stroke`,`stroke-width`],ye=[`x`,`y`,`width`,`height`,`rx`,`aria-label`],be=[`font-size`,`font-weight`,`text-anchor`,`fill`],xe=[`x`,`y`],Se=[`font-size`,`font-weight`,`text-anchor`,`fill`],Ce=[`x`,`y`],we=[`aria-label`],Te=[`x`,`y`,`width`,`height`],Ee=[`x`,`y`,`width`,`height`,`rx`],De=[`d`,`stroke`,`stroke-width`],Oe=[`d`,`stroke`,`stroke-width`,`opacity`],ke=8,y=4,Ae=12,je=24,Me=1,Ne=10,b=`__vueUiLabelLayoutOrder`,Pe=`__vueUiLabelNextLayoutOrder`,x=`__vueUiLabelLayoutRaf`,Fe=`__vueUiLabelSetLayoutRect`,Ie=`__vueUiLabelMeasureElement`,Le=`__vueUiLabelEmitDragEnd`,S=`__vueUiLabelPersistedOffset`,C=`__vueUiLabelDragRequestedOffset`,w=`__vueUiLabelDragging`,Re=`__vueUiLabelDragPriority`,ze=`__vueUiLabelNextDragPriority`,Be=`__vueUiLabelLastLayoutRect`,T=`__vueUiLabelLastLayoutOffset`,E=`__vueUiLabelDisplacedLabels`,D=/*#__PURE__*/ a({__name:`vue-ui-label`,props:{dataset:{type:Object,default(){return{x:null,y:null,position:{x:null,y:null}}}},config:{type:Object,default(){return{}}}},emits:[`dragStart`,`drag`,`dragEnd`,`click`,`mouseenter`,`mouseleave`,`focus`,`blur`],setup(e,{expose:a,emit:me}){let D=e,O=me,{vue_ui_label:Ve}=t(),{isThemeValid:He,warnInvalidTheme:Ue}=s();function We(){let e=o({userConfig:D.config,defaultConfig:Ve}),t={},n=e.theme;return n?He.value(e)?t=o({userConfig:l[n]||D.config,defaultConfig:e}):(Ue(e),t=e):t=e,t}let k=d(()=>We()),Ge=te(),Ke=n(),qe=v(`wrapperRef`),A=v(`labelRef`),Je=v(`contentRef`),Ye=v(`boxRef`),Xe=v(`titleTextRef`),Ze=v(`contentTextRef`),j=_(null),M=_(null),N=_(null),P=_({x:0,y:0}),Qe=_(!1),F=_(!1),$e=_(`pointer`),et=d(()=>k.value.title.fontSize),tt=d(()=>k.value.title.lineHeight),nt=d(()=>k.value.content.fontSize),rt=d(()=>k.value.content.lineHeight),it=d(()=>k.value.title.gap),at=d(()=>k.value.drag.handleWidth),ot=d(()=>k.value.collisionGap),st=null,ct=null,I=null,L={inputType:null,touchId:null,startPointer:null,startOffset:null,lastRequestedOffset:null},lt=d(()=>({x:D.dataset?.x??null,y:D.dataset?.y??null})),R=d(()=>r(lt.value.x)&&r(lt.value.y)),z=d(()=>Number(lt.value.x)),B=d(()=>Number(lt.value.y)),V=d(()=>k.value.link),H=d(()=>k.value.box),ut=d(()=>k.value.drag),U=d(()=>k.value.title.marker),dt=d(()=>k.value.overlap===!0),W=d(()=>ut.value?.enable===!0),ft=d(()=>!!(Ge?.vnode?.props??{}).onClick),pt=d(()=>ft.value),mt=d(()=>[String(k.value.title?.text??``).trim(),String(k.value.content?.text??``).trim()].filter(Boolean).join(`, `)||`Label`),ht=d(()=>`Move ${mt.value}`),gt=`label_${Ke}_drag_instructions`,_t=d(()=>k.value.a11y.translations.keyboardNavigation),vt=d(()=>r(ut.value?.iconSize)?Math.max(0,Number(ut.value.iconSize)):0),yt=d(()=>vt.value*.15),bt=d(()=>{let e=ut.value?.handlePosition;return[`left`,`right`,`top`,`bottom`].includes(e)?e:`left`}),xt=d(()=>{let e=D.dataset?.position;return!e||!r(e.x)||!r(e.y)?null:{x:Number(e.x),y:Number(e.y)}}),St=d(()=>Qe.value?null:xt.value),Ct=d(()=>r(V.value.length)?Math.max(0,Number(V.value.length)):ke),wt=d(()=>Hn(k.value.title.textAlign)),Tt=d(()=>Hn(k.value.content.textAlign)),Et=d(()=>Un(wt.value)),Dt=d(()=>Un(Tt.value)),Ot=d(()=>U.value?.color!==null&&U.value?.color!==void 0&&String(k.value.title.text??``)!==``),kt=d(()=>Ot.value&&r(U.value?.size)?Math.max(0,Number(U.value.size)):0),At=d(()=>kt.value/2),jt=d(()=>U.value?.beforeText!==!1),Mt=d(()=>Ot.value&&kt.value>0?6:0),Nt=d(()=>kt.value>0?kt.value+Mt.value:0),G=d(()=>{let e=H.value.padding??{};return{top:r(e.top)?Math.max(0,Number(e.top)):0,right:r(e.right)?Math.max(0,Number(e.right)):0,bottom:r(e.bottom)?Math.max(0,Number(e.bottom)):0,left:r(e.left)?Math.max(0,Number(e.left)):0}}),Pt=d(()=>r(H.value.borderWidth)?Math.max(0,Number(H.value.borderWidth)):0),Ft=d(()=>r(H.value.borderRadius)?Math.max(0,Number(H.value.borderRadius)):0),K=d(()=>r(H.value.maxWidth)?Math.max(0,Number(H.value.maxWidth)):null),It=d(()=>W.value&&H.value.show?at.value:0),Lt=d(()=>[`left`,`right`].includes(bt.value)),Rt=d(()=>{if(!H.value.show||!r(K.value)||K.value<=0)return null;let e=Lt.value?It.value:0;return Math.max(1,K.value-G.value.left-G.value.right-e)}),zt=d(()=>Rt.value?Math.max(1,Rt.value-Nt.value):null),q=d(()=>{if(!H.value.show||!N.value)return null;let e=Pt.value/2,t=Math.max(0,N.value.width-Pt.value),n=Math.max(0,N.value.height-Pt.value);return{x:N.value.x+e,y:N.value.y+e,width:t,height:n,rx:Math.min(Ft.value,t/2,n/2)}}),Bt=d(()=>{if(!W.value||!q.value)return null;let e=bt.value,t=[`left`,`right`].includes(e),n=Math.min(at.value,Math.max(0,t?q.value.width:q.value.height));if(n<=0||q.value.width<=0||q.value.height<=0)return null;let r=q.value.x,i=q.value.y,a=q.value.width,o=q.value.height,s=``,c=``;if(e===`left`||e===`right`){a=n,r=e===`left`?q.value.x:q.value.x+q.value.width-n;let t=e===`left`?r+n:r,l=r+n/2,u=i+o/2;s=`
2
2
  M ${t} ${i}
3
3
  V ${i+o}
4
4
  `;let d=vt.value,f=yt.value/2,p=Math.max(0,d/2-f),m=d*.14;c=[-.7,0,.7].flatMap(e=>{let t=u+p*e;return[`M ${l-m} ${t} h 0`,`M ${l+m} ${t} h 0`]}).join(` `)}else{o=n,i=e===`top`?q.value.y:q.value.y+q.value.height-n;let t=e===`top`?i+n:i,l=r+a/2,u=i+n/2;s=`