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
@@ -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,Ht as o,Jt as ee,S as s,X as te,at as ne,b as c,i as re,in as ie,t as ae,w as oe,yt as se,zt as ce}from"./lib-rPeBMZrn.js";import{n as le,t as ue}from"./BaseScanner-8NdoBs7B.js";import{n as de,t as fe}from"./useHints-C-TwxM0Y.js";import{t as pe}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{n as me}from"./resolveChartConfig-CIhClE5R.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{n as ve,r as ye,t as be}from"./userOptionsSlots-CWtXN5Q6.js";import{t as xe}from"./usePrinter-DVf3YcG5.js";import{c as Se}from"./canvas-lib-22VpOI4_.js";import{t as Ce}from"./useResponsive-CENUxfEL.js";import{t as we}from"./DefGrad-DKMq1REY.js";import{t as Te}from"./useUserOptionState-CXlFnwPv.js";import{t as Ee}from"./useChartAccessibility-DOMuYJfm.js";import{t as De}from"./usePrefersMotion-XLHwega2.js";import{t as Oe}from"./useAutoSizeLabelsInsideViewbox-AIRF0PlD.js";import{t as ke}from"./vue_ui_thermometer-CRijq6H6.js";import{Fragment as l,computed as u,createBlock as d,createCommentVNode as f,createElementBlock as p,createElementVNode as m,createSlots as Ae,createVNode as je,defineAsyncComponent as Me,guardReactiveProps as h,mergeProps as Ne,normalizeClass as g,normalizeProps as Pe,normalizeStyle as Fe,onMounted as Ie,openBlock as _,ref as v,renderList as y,renderSlot as b,toDisplayString as x,toRefs as Le,unref as S,useCssVars as Re,watch as ze,withCtx as Be}from"vue";var Ve=/* @__PURE__ */ e({default:()=>C}),He=[`id`],Ue={key:1,ref:`noTitle`,class:`vue-data-ui-no-title-space`,style:`height:36px; width: 100%;background:transparent`},We=[`xmlns`,`viewBox`,`aria-labelledby`,`aria-describedby`],Ge=[`id`],Ke=[`id`],qe=[`width`,`height`],Je=[`id`],Ye=[`x`,`y`,`width`,`height`,`rx`,`ry`],Xe=[`clip-path`],Ze=[`x`,`y`,`height`,`width`],Qe=[`x`,`y`,`height`,`width`,`fill`],$e=[`x1`,`x2`,`y1`,`y2`,`stroke-width`,`stroke`],et=[`x1`,`x2`,`y1`,`y2`,`stroke-width`,`stroke`],tt=[`x1`,`x2`,`y1`,`y2`,`stroke-width`,`stroke`],nt=[`x1`,`x2`,`y1`,`y2`,`stroke-width`,`stroke`],rt=[`x1`,`x2`,`y1`,`y2`,`stroke-width`,`stroke`],it=[`x1`,`x2`,`y1`,`y2`,`stroke-width`,`stroke`],at=[`x1`,`x2`,`y1`,`y2`,`stroke-width`,`stroke`],ot=[`x1`,`x2`,`y1`,`y2`,`stroke-width`,`stroke`],st=[`x`,`y`,`height`,`width`],ct=[`aria-label`],lt=[`x`,`y`,`height`],ut=[`y`,`x`,`fill`,`font-size`,`font-weight`],dt={key:4,class:`vue-data-ui-watermark`},C=/*#__PURE__*/ pe({__name:`vue-ui-thermometer`,props:{dataset:{type:Object,default(){return{}}},config:{type:Object,default(){return{}}}},emits:[`copyAlt`],setup(e,{expose:pe,emit:Ve}){Re(e=>({v34c0b983:It.value,v4ff7ff6b:Ft.value,v43c47318:Pt.value}));let C=Me(()=>import(`./PackageVersion-DKSNC-YP.js`).then(e=>e.t)),ft=Me(()=>import(`./PenAndPaper-DoNTA-SV.js`).then(e=>e.t)),pt=Me(()=>import(`./UserOptions-B9EyfU9n.js`).then(e=>e.n)),{vue_ui_thermometer:mt}=i(),ht=De(),w=e,gt=Ve,T=v(te()),E=v(null),_t=v(0),vt=v(0),yt=v(null),bt=v(null),D=v(null),O=v(null),xt=u(()=>!!w.dataset&&Object.keys(w.dataset).length);Ie(()=>{Et()});let k=v(z()),A=u(()=>k.value.userOptions),j=u(()=>k.value.style.chart.graduations),M=u(()=>k.value.style.chart);de({config:()=>k.value,dataset:()=>w.dataset,component:`VueUiThermometer`,rules:[fe.noHint]});let St=v(M.value.thermometer.width),N=v(M.value.height),P=v(M.value.width),Ct=u(()=>k.value.userOptions.useCursorPointer),wt=u(()=>ie({defaultConfig:{userOptions:{show:!1},style:{chart:{animation:{use:!1},backgroundColor:`#99999930`,graduations:{stroke:`#6A6A6A`}}}},userConfig:k.value.skeletonConfig??{}})),{loading:F,FINAL_DATASET:I}=le({...Le(w),FINAL_CONFIG:k,prepareConfig:z,skeletonDataset:w.config?.skeletonDataset??{value:0,from:-100,to:100,steps:20,colors:{from:`#A1A1A1`,to:`#CACACA`}},skeletonConfig:ie({defaultConfig:k.value,userConfig:wt.value})}),Tt=u(()=>k.value.debug);function Et(){if(ce(w.dataset)?ne({componentName:`VueUiThermometer`,type:`dataset`,debug:Tt.value}):se({datasetObject:w.dataset,requiredAttributes:[`value`,`from`,`to`]}).forEach(e=>{ne({componentName:`VueUiThermometer`,type:`datasetAttribute`,property:e,debug:Tt.value})}),k.value.responsive){let e=Se(()=>{let{width:e,height:t}=Ce({chart:E.value,title:k.value.style.title.text?yt.value:null,source:bt.value});requestAnimationFrame(()=>{N.value=Math.max(.1,t-12),P.value=e,Vt()})});D.value&&(O.value&&D.value.unobserve(O.value),D.value.disconnect()),D.value=new ResizeObserver(e),O.value=E.value,D.value.observe(O.value)}Vt()}let{userOptionsVisible:L,setUserOptionsVisibility:Dt,keepUserOptionState:Ot}=Te({config:k.value}),{svgRef:R}=Ee({config:k.value.style.title});function z(){return me(w.config,mt,ke)}ze(()=>w.config,e=>{k.value=z(),L.value=!k.value.userOptions.showOnChartHover,St.value=M.value.thermometer.width,N.value=M.value.height,P.value=M.value.width,Et(),vt.value+=1},{deep:!0});let{isPrinting:B,isImaging:V,generatePdf:kt,generateImage:At}=xe({elementId:`thermometer__${T.value}`,fileName:k.value.style.title.text||`vue-ui-thermometer`,options:k.value.userOptions.print}),jt=u(()=>k.value.userOptions.show&&!k.value.style.title.text),H=u(()=>oe(k.value.customPalette)),U=u(()=>I.value.steps||10);function W(e,t,n){let r=[],i=Mt(e),a=Mt(t);for(let e=0;e<n;e+=1){let t=G(i.red,a.red,e,n),o=G(i.green,a.green,e,n),ee=G(i.blue,a.blue,e,n),s=`#${K(t)}${K(o)}${K(ee)}`;r.push(s)}return r}function Mt(e){let t=e.slice(1);return{red:parseInt(t.slice(0,2),16),green:parseInt(t.slice(2,4),16),blue:parseInt(t.slice(4,6),16)}}function G(e,t,n,r){return Math.round(e+(t-e)*n/r)}function K(e){return e.toString(16).padStart(2,`0`)}let q=u(()=>{let e=Math.max(.1,P.value),t=Math.max(.1,N.value),n=M.value.padding;return{width:e,left:e/2-M.value.thermometer.width/2,right:e/2+M.value.thermometer.width/2,top:n.top,bottom:t-n.bottom-n.top,height:t,thermoHeight:t-n.top-n.bottom,thermoWidth:M.value.thermometer.width}}),Nt=u(()=>q.value),J=u(()=>{let e=c(I.value.from)<0?Math.abs(c(I.value.from)):c(I.value.from),t=c(I.value.to)<0?Math.abs(c(I.value.to)):c(I.value.to),n=0;return n=c(I.value.to)>0?e+t:e>t?e-t:t-e,(1-(Math.abs(c(I.value.from))+c(I.value.value))/n)*q.value.thermoHeight}),Pt=u(()=>`${J.value}px`),Ft=u(()=>`${q.value.thermoHeight}px`),It=u(()=>ht.value?`0ms`:`${M.value.animation.speedMs}ms`),Lt=u(()=>{if(I.value.colors){if(!I.value.colors.from)return W(H.value[0]||o[0],s(I.value.colors.to),U.value||10);if(!I.value.colors.to)return W(s(I.value.colors.from),H.value[1]||o[1],U.value||10)}else return W(H.value[1]||o[1],H.value[0]||o[0],U.value||10);return W(s(I.value.colors.from),s(I.value.colors.to),U.value||10)}),Rt=u(()=>{let e=[],t=0,n=q.value.thermoHeight;for(let r=0;r<n-1;r+=n/U.value)e.push({x:q.value.left,y:q.value.top+r,qYLess:q.value.top+r+n/U.value/4,halfY:q.value.top+r+n/U.value/2,qYMore:q.value.top+r+n/U.value/4*3,color:Lt.value[t],height:Math.max(.1,n/U.value)}),t+=1;return e}),Y=v(!1);function zt(e){Y.value=e,_t.value+=1}let X=v(!1);function Z(){X.value=!X.value}async function Bt({scale:e=2}={}){if(!E.value)return;let{width:t,height:n}=E.value.getBoundingClientRect(),r=t/n,{imageUri:i,base64:a}=await he({domElement:E.value,base64:!0,img:!0,scale:e});return{imageUri:i,base64:a,title:k.value.style.title.text,width:t,height:n,aspectRatio:r}}let Q=u({get:()=>M.value.label.fontSize,set:e=>e}),{autoSizeLabels:Vt}=Oe({svgRef:R,fontSize:M.value.label.fontSize,minFontSize:M.value.label.minFontSize,sizeRef:Q,labelClass:`.vue-ui-thermometer-label`}),Ht=u(()=>M.value.backgroundColor),Ut=u(()=>k.value.style.title),{isCallbackImaging:Wt,isCallbackSvg:Gt,generateSvg:Kt,onGenerateImage:qt}=_e({svg:R,title:Ut,legend:null,legendItems:null,backgroundColor:Ht,getSvgCallback:()=>k.value.userOptions.callbacks.svg,generateImage:At});async function Jt(){gt(`copyAlt`,{config:k.value,dataset:I.value}),k.value.userOptions.callbacks.altCopy?await Promise.resolve(k.value.userOptions.callbacks.altCopy({config:k.value,dataset:I.value})):console.warn("Vue Data UI - A callback must be set for `altCopy` in userOptions.")}let Yt=u(()=>`${T.value}-title`),Xt=u(()=>`${T.value}-desc`),$=u(()=>re(M.value.label.formatter,I.value.value,a({p:M.value.label.prefix,v:I.value.value,s:M.value.label.suffix,r:M.value.label.rounding}),{datapoint:I.value})),Zt=u(()=>k.value.style.title.text||``),Qt=u(()=>{if(F.value)return`...`;let e=c(I.value.from),t=c(I.value.to);return`Thermometer value: ${$.value}. Range: ${e} to ${t}.`});return pe({getImage:Bt,generatePdf:kt,generateImage:At,generateSvg:Kt,toggleAnnotator:Z,toggleFullscreen:zt,copyAlt:Jt}),(e,i)=>(_(),p(`div`,{ref_key:`thermoChart`,ref:E,class:g(`vue-data-ui-component vue-ui-thermometer ${Y.value?`vue-data-ui-wrapper-fullscreen`:``}`),style:Fe(`width:100%;background:${M.value.backgroundColor};color:${M.value.color};font-family:${k.value.style.fontFamily}`),id:`thermometer__${T.value}`,onMouseenter:i[0]||=()=>S(Dt)(!0),onMouseleave:i[1]||=()=>S(Dt)(!1)},[A.value.buttons.annotator?(_(),d(S(ft),Ne({key:0},S(n)(A.value.annotator),{svgRef:S(R),backgroundColor:M.value.backgroundColor,color:M.value.color,active:X.value,isCursorPointer:Ct.value,palette:A.value.annotatorPalette,onClose:Z}),Ae({_:2},[y(S(r),n=>({name:n,fn:Be(r=>[b(e.$slots,n,Pe(h(S(t)(n,r))),void 0,!0)])}))]),1040,[`svgRef`,`backgroundColor`,`color`,`active`,`isCursorPointer`,`palette`])):f(``,!0),jt.value?(_(),p(`div`,Ue,null,512)):f(``,!0),k.value.style.title.text?(_(),p(`div`,{key:2,ref_key:`chartTitle`,ref:yt,style:`width:100%`},[(_(),d(ge,{key:`title_${vt.value}`,config:{title:{cy:`thermometer-div-title`,...k.value.style.title},subtitle:{cy:`thermometer-div-subtitle`,...k.value.style.title.subtitle}}},null,8,[`config`]))],512)):f(``,!0),A.value.show&&xt.value&&(S(Ot)||S(L))?(_(),d(S(pt),Ne({ref:`details`,key:`user_options_${_t.value}`,backgroundColor:M.value.backgroundColor,color:M.value.color,isImaging:S(V),isPrinting:S(B),uid:T.value,hasXls:!1,isFullscreen:Y.value,chartElement:E.value},S(ye)(A.value,`pdf img svg fullscreen altCopy annotator`),{isAnnotation:X.value,isCursorPointer:Ct.value,onToggleFullscreen:zt,onGeneratePdf:S(kt),onGenerateImage:S(qt),onGenerateSvg:S(Kt),onToggleAnnotator:Z,onCopyAlt:Jt,style:{visibility:S(Ot)?S(L)?`visible`:`hidden`:`visible`}}),Ae({_:2},[y(S(ve)(e.$slots,`menuIcon optionPdf optionImg optionSvg optionFullscreen optionAnnotator optionAltCopy custom-menu-before custom-menu-after`),t=>({name:t,fn:Be(n=>[b(e.$slots,t,Pe(h(S(be)(t,n))),void 0,!0)])}))]),1040,[`backgroundColor`,`color`,`isImaging`,`isPrinting`,`uid`,`isFullscreen`,`chartElement`,`isAnnotation`,`isCursorPointer`,`onGeneratePdf`,`onGenerateImage`,`onGenerateSvg`,`style`])):f(``,!0),(_(),p(`svg`,{ref_key:`svgRef`,ref:R,xmlns:S(ae),class:g({"vue-data-ui-fullscreen--on":Y.value,"vue-data-ui-fulscreen--off":!Y.value}),width:`100%`,viewBox:`0 0 ${q.value.width} ${q.value.height}`,style:`background:transparent`,"aria-labelledby":Yt.value,"aria-describedby":Xt.value},[m(`title`,{id:Yt.value},x(Zt.value),9,Ge),m(`desc`,{id:Xt.value},x(Qt.value),9,Ke),je(S(C)),b(e.$slots,`svg-underlayer`,{svg:{...Nt.value,isPrintingImg:S(B)||S(V)||S(Wt),isPrintingSvg:S(Gt)}},void 0,!0),e.$slots[`chart-background`]?(_(),p(`foreignObject`,{key:0,x:0,y:0,width:q.value.width,height:q.value.height,style:{pointerEvents:`none`}},[b(e.$slots,`chart-background`,{},void 0,!0)],8,qe)):f(``,!0),m(`defs`,null,[m(`clipPath`,{id:`vueUiPill-${T.value}`,clipPathUnits:`userSpaceOnUse`},[m(`rect`,{x:q.value.left,y:q.value.top,width:q.value.thermoWidth,height:q.value.thermoHeight,rx:q.value.thermoWidth/2,ry:q.value.thermoWidth/2},null,8,Ye)],8,Je),(_(!0),p(l,null,y(Rt.value,(e,t)=>(_(),d(we,{t:`linear`,id:`vueUiThermometerGradient_${t}_${T.value}`,key:`t_${t}_${T.value}`,x1:`0%`,y1:`0%`,x2:`100%`,y2:`0%`,stops:[[`0%`,e.color,1],[`50%`,S(ee)(e.color,100-j.value.gradient.intensity),1],[`100%`,e.color,1]]},null,8,[`id`,`stops`]))),128))]),m(`g`,{"clip-path":`url(#vueUiPill-${T.value})`},[m(`rect`,{x:q.value.left,y:q.value.top,height:q.value.thermoHeight,width:q.value.thermoWidth,fill:`#FFFFFF`},null,8,Ze),(_(!0),p(l,null,y(Rt.value,(e,t)=>(_(),p(`g`,{key:`graduation_${t}`},[m(`rect`,{x:e.x,y:e.y,height:e.height,width:q.value.thermoWidth,fill:j.value.gradient.show?`url(#vueUiThermometerGradient_${t}_${T.value})`:e.color,"shape-rendering":`crispEdges`},null,8,Qe),j.value.show&&[`both`,`left`].includes(j.value.sides)?(_(),p(`line`,{key:0,x1:e.x,x2:e.x+10,y1:e.y,y2:e.y,"stroke-width":j.value.strokeWidth,stroke:j.value.stroke,"stroke-linecap":`round`},null,8,$e)):f(``,!0),j.value.showIntermediate?(_(),p(l,{key:1},[j.value.show&&[`both`,`left`].includes(j.value.sides)?(_(),p(`line`,{key:0,x1:e.x,x2:e.x+5,y1:e.halfY,y2:e.halfY,"stroke-width":j.value.strokeWidth/2,stroke:j.value.stroke,"stroke-linecap":`round`},null,8,et)):f(``,!0),j.value.show&&[`both`,`left`].includes(j.value.sides)?(_(),p(`line`,{key:1,x1:e.x,x2:e.x+2.5,y1:e.qYLess,y2:e.qYLess,"stroke-width":j.value.strokeWidth/2,stroke:j.value.stroke,"stroke-linecap":`round`},null,8,tt)):f(``,!0),j.value.show&&[`both`,`left`].includes(j.value.sides)?(_(),p(`line`,{key:2,x1:e.x,x2:e.x+2.5,y1:e.qYMore,y2:e.qYMore,"stroke-width":j.value.strokeWidth/2,stroke:j.value.stroke,"stroke-linecap":`round`},null,8,nt)):f(``,!0)],64)):f(``,!0),j.value.show&&[`both`,`right`].includes(j.value.sides)?(_(),p(`line`,{key:2,x1:q.value.right,x2:q.value.right-10,y1:e.y,y2:e.y,"stroke-width":j.value.strokeWidth,stroke:j.value.stroke,"stroke-linecap":`round`},null,8,rt)):f(``,!0),j.value.showIntermediate?(_(),p(l,{key:3},[j.value.show&&[`both`,`right`].includes(j.value.sides)?(_(),p(`line`,{key:0,x1:q.value.right,x2:q.value.right-5,y1:e.halfY,y2:e.halfY,"stroke-width":j.value.strokeWidth/2,stroke:j.value.stroke,"stroke-linecap":`round`},null,8,it)):f(``,!0),j.value.show&&[`both`,`right`].includes(j.value.sides)?(_(),p(`line`,{key:1,x1:q.value.right,x2:q.value.right-2.5,y1:e.qYLess,y2:e.qYLess,"stroke-width":j.value.strokeWidth/2,stroke:j.value.stroke,"stroke-linecap":`round`},null,8,at)):f(``,!0),j.value.show&&[`both`,`right`].includes(j.value.sides)?(_(),p(`line`,{key:2,x1:q.value.right,x2:q.value.right-2.5,y1:e.qYMore,y2:e.qYMore,"stroke-width":j.value.strokeWidth/2,stroke:j.value.stroke,"stroke-linecap":`round`},null,8,ot)):f(``,!0)],64)):f(``,!0)]))),128)),m(`rect`,{class:g({"vue-ui-thermometer-temperature":M.value.animation.use}),x:q.value.left,y:q.value.top,height:J.value,width:q.value.thermoWidth,fill:`#FFFFFF66`},null,10,st)],8,Xe),M.value.label.show?(_(),p(`g`,{key:1,role:`status`,"aria-live":`polite`,"aria-label":S(F)?`Loading data`:$.value},[S(F)?(_(),p(`rect`,{key:0,x:q.value.left-60,y:J.value+q.value.top-Q.value/2,width:50,height:Q.value,fill:`#6A6A6A40`,rx:`3`},null,8,lt)):(_(),p(`text`,{key:1,"aria-hidden":`true`,class:g({"vue-ui-thermometer-temperature-value":M.value.animation.use,"vue-ui-thermometer-label":!0}),y:J.value+q.value.top+Q.value/3,x:q.value.left-10,"text-anchor":`end`,fill:M.value.label.color,"font-size":Q.value,"font-weight":M.value.label.bold?`bold`:`normal`},x($.value),11,ut))],8,ct)):f(``,!0),b(e.$slots,`svg`,{svg:{...Nt.value,isPrintingImg:S(B)||S(V)||S(Wt),isPrintingSvg:S(Gt)}},void 0,!0)],10,We)),e.$slots.watermark?(_(),p(`div`,dt,[b(e.$slots,`watermark`,Pe(h({isPrinting:S(B)||S(V)||S(Wt)||S(Gt)})),void 0,!0)])):f(``,!0),e.$slots.source?(_(),p(`div`,{key:5,ref_key:`source`,ref:bt,dir:`auto`},[b(e.$slots,`source`,{},void 0,!0)],512)):f(``,!0),b(e.$slots,`skeleton`,{},()=>[S(F)?(_(),d(ue,{key:0})):f(``,!0)],!0)],46,He))}},[[`__scopeId`,`data-v-8ccdee96`]]);export{Ve as n,C 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,rn as r,t as i}from"./lib-rPeBMZrn.js";import{n as a,t as o}from"./useHints-C-TwxM0Y.js";import{t as s}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{t as c}from"./useNestedProp-DnGoh-XS.js";import{t as l}from"./BaseIcon-CoY0vuL3.js";import{n as ee}from"./Title-BliHuXfT.js";import{c as te}from"./canvas-lib-22VpOI4_.js";import{t as ne}from"./useResponsive-CENUxfEL.js";import{t as re}from"./DefGrad-DKMq1REY.js";import{t as ie}from"./useChartAccessibility-DOMuYJfm.js";import{computed as u,createBlock as ae,createCommentVNode as d,createElementBlock as f,createElementVNode as p,createVNode as m,defineAsyncComponent as oe,guardReactiveProps as h,mergeProps as se,normalizeProps as g,normalizeStyle as _,onBeforeUnmount as ce,onMounted as le,openBlock as v,ref as y,renderSlot as b,shallowRef as ue,toDisplayString as de,unref as x,watch as fe}from"vue";var pe=class{constructor(e,t,n,r=!0,i=!0){this.interval=t,this.elapsed=0,this.isPaused=!1;let a=new Blob([`
1
+ import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{t}from"./useConfig-C3FbHv4N.js";import{X as n,rn as r,t as i}from"./lib-rPeBMZrn.js";import{n as a,t as o}from"./useHints-C-TwxM0Y.js";import{t as s}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{t as c}from"./useNestedProp-DnGoh-XS.js";import{t as l}from"./BaseIcon-CoY0vuL3.js";import{n as ee}from"./Title-BliHuXfT.js";import{c as te}from"./canvas-lib-22VpOI4_.js";import{t as ne}from"./useResponsive-CENUxfEL.js";import{t as re}from"./DefGrad-DKMq1REY.js";import{t as ie}from"./useChartAccessibility-DOMuYJfm.js";import{computed as u,createBlock as ae,createCommentVNode as d,createElementBlock as f,createElementVNode as p,createVNode as m,defineAsyncComponent as oe,guardReactiveProps as h,mergeProps as se,normalizeProps as g,normalizeStyle as _,onBeforeUnmount as ce,onMounted as le,openBlock as v,ref as y,renderSlot as b,shallowRef as ue,toDisplayString as de,unref as x,watch as fe}from"vue";var pe=class{constructor(e,t,n,r=!0,i=!0){this.interval=t,this.elapsed=0,this.isPaused=!1;let a=new Blob([`
2
2
  let interval;
3
3
  let elapsed = 0;
4
4
  let paused = false;
@@ -61,4 +61,4 @@ import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{t}from"./useConfig-By3
61
61
  break;
62
62
  }
63
63
  };
64
- `],{type:`application/javascript`}),o=URL.createObjectURL(a),s=new Worker(o);function c(e){let t=Math.floor(e/1e3),n=Math.floor(e%1e3/10),a=Math.floor(t/3600),o=Math.floor(t%3600/60),s=t%60,c=``;return i&&(c+=String(a).padStart(2,`0`)+`:`),c+=String(o).padStart(2,`0`)+`:`,c+=String(s).padStart(2,`0`),r&&(c+=`.`+String(n).padStart(2,`0`)),c}this.start=()=>{this.isPaused=!1,s.postMessage({action:`start`,data:{interval:this.interval}})},this.pause=()=>{this.isPaused?this.resume():(this.isPaused=!0,s.postMessage({action:`pause`}))},this.resume=()=>{this.isPaused&&=(s.postMessage({action:`resume`}),!1)},this.stop=()=>{s.postMessage({action:`stop`}),this.isPaused=!1},this.reset=()=>{s.postMessage({action:`reset`}),this.elapsed=0,this.isPaused=!1},this.restart=()=>{this.stop(),this.start()},this.lap=()=>new Promise(e=>{s.postMessage({action:`lap`}),s.addEventListener(`message`,t=>{let{elapsed:n,timestamp:r,action:i}=t.data;if(i===`lap`){let t=c(n);e({timestamp:r||0,elapsed:n,formatted:t})}},{once:!0})}),s.onmessage=t=>{let{elapsed:n,timestamp:r}=t.data;this.elapsed=n,e({timestamp:r||0,elapsed:this.elapsed,formatted:c(this.elapsed)})},s.onerror=e=>{n&&n(e)}}},S=/* @__PURE__ */ e({default:()=>C}),me=[`xmlns`,`viewBox`],he=[`width`,`height`],ge={key:1},_e=[`cx`,`cy`,`r`,`fill`,`stroke`,`stroke-width`],ve=[`d`,`stroke`,`stroke-width`],ye=[`r`,`fill`,`stroke`,`stroke-width`],be=[`r`,`fill`,`stroke`,`stroke-width`],xe=[`x`,`y`],Se={key:5},Ce=[`x`,`y`,`font-size`,`fill`,`font-weight`],we={key:0,class:`vue-ui-timer-controls`},Te=[`title`],Ee=[`title`],De=[`title`],Oe=[`title`],ke=[`title`],C=/*#__PURE__*/ s({__name:`vue-ui-timer`,props:{config:{type:Object,default(){return{}}}},emits:[`start`,`pause`,`reset`,`restart`,`lap`],setup(e,{expose:s,emit:S}){let C=oe(()=>import(`./PackageVersion-Bczw6rsP.js`).then(e=>e.t)),{vue_ui_timer:Ae}=t(),w=e,T=S,E=y(null),D=y(null),O=y(null),k=ue(null),A=ue(null),j=y(n()),M=y(0);le(()=>{N()});function N(){if(P.value.responsive){let e=te(()=>{let{width:e,height:t}=ne({chart:E.value,title:P.value.style.title.text?D.value:null,legend:O.value});requestAnimationFrame(()=>{B.value.width=e,B.value.height=t,P.value.responsiveProportionalSizing?(B.value.tracker.core=r({relator:Math.min(e,t),adjuster:P.value.style.width,source:6*I.value.radiusRatio,threshold:1,fallback:1}),B.value.tracker.aura=r({relator:Math.min(e,t),adjuster:P.value.style.width,source:12*I.value.aura.radiusRatio,threshold:1,fallback:1}),B.value.label=r({relator:Math.min(e,t),adjuster:P.value.style.width,source:F.value.label.fontSize,threshold:10,fallback:10})):B.value.label=F.value.label.fontSize})});k.value&&(A.value&&k.value.unobserve(A.value),k.value.disconnect()),k.value=new ResizeObserver(e),A.value=E.value.parentNode,k.value.observe(A.value)}}ce(()=>{k.value&&(A.value&&k.value.unobserve(A.value),k.value.disconnect())});let P=u({get:()=>z(),set:e=>e}),F=u(()=>P.value.stopwatch),I=u(()=>P.value.stopwatch.tracker),L=u(()=>P.value.stopwatch.legend);a({config:()=>P.value,dataset:()=>[],component:`VueUiTimer`,rules:[o.noHint]});let R=u(()=>P.value.useCursorPointer),{svgRef:je}=ie({config:P.value.style.title});function z(){return c({userConfig:w.config,defaultConfig:Ae})}fe(()=>w.config,e=>{P.value=z(),N(),M.value+=1},{deep:!0});let Me=u(()=>{if(F.value.showHours&&F.value.showHundredth)return`00:00:00.00`;if(F.value.showHours&&!F.value.showHundredth)return`00:00:00`;if(!F.value.showHours&&F.value.showHundredth)return`00:00.00`;if(!F.value.showHours&&!F.value.showHundredth)return`00:00`}),B=y({height:P.value.style.height,width:P.value.style.width,tracker:{core:6*I.value.radiusRatio,aura:12*I.value.aura.radiusRatio},label:F.value.label.fontSize}),V=y(0),H=new pe(e=>Ne(e),10,``,F.value.showHundredth,F.value.showHours),U=y(!0),W=y(!1),G=y(!1);function K(){T(`start`),U.value&&H.start(),U.value=!1,W.value=!0}function q(){W.value&&=(T(`reset`),H.stop(),X.value=[],U.value=!0,!1)}function J(){G.value=!G.value,T(`pause`,V.value),H.pause()}function Y(){W.value&&(G.value=!1,T(`restart`),X.value=[],H.restart())}let X=y([]);async function Z(){if(!W.value||G.value)return;let e=await H.lap();e&&(X.value.push(e),T(`lap`,X.value))}function Ne({timestamp:e,elapsed:t,formatted:n}){V.value={timestamp:e,elapsed:t,formatted:n}}let Q=u(()=>Math.min(B.value.width,B.value.height)/2.5*F.value.track.radiusRatio);function Pe(e,t){return e*(360/(t*1e3))%360}function Fe(e){let t=Math.PI/180*e;return{cx:B.value.width/2+Q.value*Math.cos(t),cy:B.value.height/2+Q.value*Math.sin(t)}}let $=u(()=>{let e=Pe(V.value.elapsed,F.value.cycleSeconds),{cx:t,cy:n}=Fe(e-90),r=+(e>180);return{cx:t||B.value.width/2,cy:n||B.value.height/2-Q.value,largeArcFlag:r,sweepFlag:1}});return s({start:K,pause:J,reset:q,restart:Y,lap:Z}),(e,t)=>(v(),f(`div`,{ref_key:`timerChart`,ref:E,class:`vue-data-ui-component vue-ui-timer`,style:_({fontFamily:P.value.style.fontFamily,width:`100%`,height:P.value.responsive?`100%`:`auto`,textAlign:`center`})},[P.value.style.title.text?(v(),f(`div`,{key:0,ref_key:`chartTitle`,ref:D,style:_({width:`100%`,background:P.value.style.backgroundColor})},[(v(),ae(ee,{key:`title_${M.value}`,config:{title:{cy:`title`,...P.value.style.title},subtitle:{cy:`subtitle`,...P.value.style.title.subtitle}}},null,8,[`config`]))],4)):d(``,!0),(v(),f(`svg`,{ref_key:`svgRef`,ref:je,xmlns:x(i),viewBox:`0 0 ${B.value.width<=0?10:B.value.width} ${B.value.height<=0?10:B.value.height}`,style:_({maxWidth:`100%`,overflow:`visible`,background:P.value.style.backgroundColor})},[m(x(C)),e.$slots[`chart-background`]?(v(),f(`foreignObject`,{key:0,x:0,y:0,width:B.value.width<=0?10:B.value.width,height:B.value.height<=0?10:B.value.height,style:{pointerEvents:`none`}},[b(e.$slots,`chart-background`,{},void 0,!0)],8,he)):d(``,!0),I.value.gradient.show?(v(),f(`defs`,ge,[m(re,{t:`radial`,id:`tracker_gradient_${j.value}`,cx:`50%`,cy:`50%`,r:`50%`,fx:`50%`,fy:`50%`,stops:[[`0%`,I.value.gradient.color,1],[`100%`,I.value.fill,1]]},null,8,[`id`,`stops`])])):d(``,!0),p(`circle`,{cx:B.value.width/2,cy:B.value.height/2,r:Q.value,fill:F.value.track.fill,stroke:F.value.track.stroke,"stroke-width":F.value.track.strokeWidth},null,8,_e),F.value.cycleTrack.show?(v(),f(`path`,{key:2,d:`M ${B.value.width/2},${B.value.height/2-Q.value} A ${Q.value},${Q.value} 0 ${$.value.largeArcFlag},${$.value.sweepFlag} ${$.value.cx},${$.value.cy}`,stroke:F.value.cycleTrack.stroke,"stroke-width":F.value.cycleTrack.strokeWidth,"stroke-linecap":`round`,fill:`none`},null,8,ve)):d(``,!0),p(`circle`,se($.value,{r:B.value.tracker.core,fill:I.value.gradient.show?`url(#tracker_gradient_${j.value})`:I.value.fill,stroke:I.value.stroke,"stroke-width":I.value.strokeWidth}),null,16,ye),I.value.aura.show?(v(),f(`circle`,se({key:3},$.value,{r:B.value.tracker.aura,fill:`${I.value.aura.fill}`,opacity:.2,stroke:I.value.aura.stroke,"stroke-width":I.value.aura.strokeWidth}),null,16,be)):d(``,!0),e.$slots.time?(v(),f(`foreignObject`,{key:4,x:B.value.width/2,y:B.value.height/2,height:`0.1`,width:`0.1`,style:{overflow:`visible`}},[b(e.$slots,`time`,g(h({...V.value,...B.value})),void 0,!0)],8,xe)):e.$slots.timeSvg?(v(),f(`g`,Se,[b(e.$slots,`timeSvg`,g(h({...V.value,...B.value})),void 0,!0)])):(v(),f(`text`,{key:6,x:B.value.width/2,y:B.value.height/2+B.value.label/4,"font-size":B.value.label,"text-anchor":`middle`,fill:F.value.label.color,"font-weight":F.value.label.bold?`bold`:`normal`,style:{"font-variant-numeric":`tabular-nums !important`}},de(V.value.formatted||Me.value),9,Ce))],12,me)),p(`div`,{ref_key:`chartLegend`,ref:O,style:_({width:`100%`,backgroundColor:L.value.backgroundColor})},[e.$slots.controls?d(``,!0):(v(),f(`div`,we,[L.value.buttons.start?(v(),f(`button`,{key:0,title:L.value.buttonTitles.start,onClick:K,class:`vue-ui-timer-button`,style:_({opacity:W.value?.2:1,cursor:W.value?`default`:R.value?`pointer`:`default`})},[m(l,{name:`play`,stroke:L.value.buttons.iconColor},null,8,[`stroke`])],12,Te)):d(``,!0),L.value.buttons.pause?(v(),f(`button`,{key:1,title:G.value?L.value.buttonTitles.resume:L.value.buttonTitles.pause,onClick:J,class:`vue-ui-timer-button`,style:_({opacity:W.value?1:.2,cursor:W.value&&R.value?`pointer`:`default`})},[m(l,{name:`pause`,stroke:L.value.buttons.iconColor},null,8,[`stroke`])],12,Ee)):d(``,!0),L.value.buttons.reset?(v(),f(`button`,{key:2,title:L.value.buttonTitles.reset,onClick:q,class:`vue-ui-timer-button`,style:_({opacity:W.value?1:.2,cursor:W.value&&R.value?`pointer`:`default`})},[m(l,{name:`stop`,stroke:L.value.buttons.iconColor},null,8,[`stroke`])],12,De)):d(``,!0),L.value.buttons.restart?(v(),f(`button`,{key:3,title:L.value.buttonTitles.restart,onClick:Y,class:`vue-ui-timer-button`,style:_({opacity:W.value?1:.2,cursor:W.value&&R.value?`pointer`:`default`})},[m(l,{name:`restart`,stroke:L.value.buttons.iconColor},null,8,[`stroke`])],12,Oe)):d(``,!0),L.value.buttons.lap?(v(),f(`button`,{key:4,title:L.value.buttonTitles.lap,onClick:Z,class:`vue-ui-timer-button`,style:_({opacity:W.value&&!G.value?1:.2,cursor:W.value&&!G.value&&R.value?`pointer`:`default`})},[m(l,{name:`lap`,stroke:L.value.buttons.iconColor},null,8,[`stroke`])],12,ke)):d(``,!0)])),b(e.$slots,`controls`,g(h({start:K,pause:J,reset:q,restart:Y,lap:Z,laps:X.value,isRunning:W.value,isPaused:G.value,...V.value})),void 0,!0),b(e.$slots,`laps`,g(h({laps:X.value,lap:Z,isRunning:W.value,isPaused:G.value,...V.value})),void 0,!0)],4)],4))}},[[`__scopeId`,`data-v-27b9f373`]]);export{S as n,C as t};
64
+ `],{type:`application/javascript`}),o=URL.createObjectURL(a),s=new Worker(o);function c(e){let t=Math.floor(e/1e3),n=Math.floor(e%1e3/10),a=Math.floor(t/3600),o=Math.floor(t%3600/60),s=t%60,c=``;return i&&(c+=String(a).padStart(2,`0`)+`:`),c+=String(o).padStart(2,`0`)+`:`,c+=String(s).padStart(2,`0`),r&&(c+=`.`+String(n).padStart(2,`0`)),c}this.start=()=>{this.isPaused=!1,s.postMessage({action:`start`,data:{interval:this.interval}})},this.pause=()=>{this.isPaused?this.resume():(this.isPaused=!0,s.postMessage({action:`pause`}))},this.resume=()=>{this.isPaused&&=(s.postMessage({action:`resume`}),!1)},this.stop=()=>{s.postMessage({action:`stop`}),this.isPaused=!1},this.reset=()=>{s.postMessage({action:`reset`}),this.elapsed=0,this.isPaused=!1},this.restart=()=>{this.stop(),this.start()},this.lap=()=>new Promise(e=>{s.postMessage({action:`lap`}),s.addEventListener(`message`,t=>{let{elapsed:n,timestamp:r,action:i}=t.data;if(i===`lap`){let t=c(n);e({timestamp:r||0,elapsed:n,formatted:t})}},{once:!0})}),s.onmessage=t=>{let{elapsed:n,timestamp:r}=t.data;this.elapsed=n,e({timestamp:r||0,elapsed:this.elapsed,formatted:c(this.elapsed)})},s.onerror=e=>{n&&n(e)}}},S=/* @__PURE__ */ e({default:()=>C}),me=[`xmlns`,`viewBox`],he=[`width`,`height`],ge={key:1},_e=[`cx`,`cy`,`r`,`fill`,`stroke`,`stroke-width`],ve=[`d`,`stroke`,`stroke-width`],ye=[`r`,`fill`,`stroke`,`stroke-width`],be=[`r`,`fill`,`stroke`,`stroke-width`],xe=[`x`,`y`],Se={key:5},Ce=[`x`,`y`,`font-size`,`fill`,`font-weight`],we={key:0,class:`vue-ui-timer-controls`},Te=[`title`],Ee=[`title`],De=[`title`],Oe=[`title`],ke=[`title`],C=/*#__PURE__*/ s({__name:`vue-ui-timer`,props:{config:{type:Object,default(){return{}}}},emits:[`start`,`pause`,`reset`,`restart`,`lap`],setup(e,{expose:s,emit:S}){let C=oe(()=>import(`./PackageVersion-DKSNC-YP.js`).then(e=>e.t)),{vue_ui_timer:Ae}=t(),w=e,T=S,E=y(null),D=y(null),O=y(null),k=ue(null),A=ue(null),j=y(n()),M=y(0);le(()=>{N()});function N(){if(P.value.responsive){let e=te(()=>{let{width:e,height:t}=ne({chart:E.value,title:P.value.style.title.text?D.value:null,legend:O.value});requestAnimationFrame(()=>{B.value.width=e,B.value.height=t,P.value.responsiveProportionalSizing?(B.value.tracker.core=r({relator:Math.min(e,t),adjuster:P.value.style.width,source:6*I.value.radiusRatio,threshold:1,fallback:1}),B.value.tracker.aura=r({relator:Math.min(e,t),adjuster:P.value.style.width,source:12*I.value.aura.radiusRatio,threshold:1,fallback:1}),B.value.label=r({relator:Math.min(e,t),adjuster:P.value.style.width,source:F.value.label.fontSize,threshold:10,fallback:10})):B.value.label=F.value.label.fontSize})});k.value&&(A.value&&k.value.unobserve(A.value),k.value.disconnect()),k.value=new ResizeObserver(e),A.value=E.value.parentNode,k.value.observe(A.value)}}ce(()=>{k.value&&(A.value&&k.value.unobserve(A.value),k.value.disconnect())});let P=u({get:()=>z(),set:e=>e}),F=u(()=>P.value.stopwatch),I=u(()=>P.value.stopwatch.tracker),L=u(()=>P.value.stopwatch.legend);a({config:()=>P.value,dataset:()=>[],component:`VueUiTimer`,rules:[o.noHint]});let R=u(()=>P.value.useCursorPointer),{svgRef:je}=ie({config:P.value.style.title});function z(){return c({userConfig:w.config,defaultConfig:Ae})}fe(()=>w.config,e=>{P.value=z(),N(),M.value+=1},{deep:!0});let Me=u(()=>{if(F.value.showHours&&F.value.showHundredth)return`00:00:00.00`;if(F.value.showHours&&!F.value.showHundredth)return`00:00:00`;if(!F.value.showHours&&F.value.showHundredth)return`00:00.00`;if(!F.value.showHours&&!F.value.showHundredth)return`00:00`}),B=y({height:P.value.style.height,width:P.value.style.width,tracker:{core:6*I.value.radiusRatio,aura:12*I.value.aura.radiusRatio},label:F.value.label.fontSize}),V=y(0),H=new pe(e=>Ne(e),10,``,F.value.showHundredth,F.value.showHours),U=y(!0),W=y(!1),G=y(!1);function K(){T(`start`),U.value&&H.start(),U.value=!1,W.value=!0}function q(){W.value&&=(T(`reset`),H.stop(),X.value=[],U.value=!0,!1)}function J(){G.value=!G.value,T(`pause`,V.value),H.pause()}function Y(){W.value&&(G.value=!1,T(`restart`),X.value=[],H.restart())}let X=y([]);async function Z(){if(!W.value||G.value)return;let e=await H.lap();e&&(X.value.push(e),T(`lap`,X.value))}function Ne({timestamp:e,elapsed:t,formatted:n}){V.value={timestamp:e,elapsed:t,formatted:n}}let Q=u(()=>Math.min(B.value.width,B.value.height)/2.5*F.value.track.radiusRatio);function Pe(e,t){return e*(360/(t*1e3))%360}function Fe(e){let t=Math.PI/180*e;return{cx:B.value.width/2+Q.value*Math.cos(t),cy:B.value.height/2+Q.value*Math.sin(t)}}let $=u(()=>{let e=Pe(V.value.elapsed,F.value.cycleSeconds),{cx:t,cy:n}=Fe(e-90),r=+(e>180);return{cx:t||B.value.width/2,cy:n||B.value.height/2-Q.value,largeArcFlag:r,sweepFlag:1}});return s({start:K,pause:J,reset:q,restart:Y,lap:Z}),(e,t)=>(v(),f(`div`,{ref_key:`timerChart`,ref:E,class:`vue-data-ui-component vue-ui-timer`,style:_({fontFamily:P.value.style.fontFamily,width:`100%`,height:P.value.responsive?`100%`:`auto`,textAlign:`center`})},[P.value.style.title.text?(v(),f(`div`,{key:0,ref_key:`chartTitle`,ref:D,style:_({width:`100%`,background:P.value.style.backgroundColor})},[(v(),ae(ee,{key:`title_${M.value}`,config:{title:{cy:`title`,...P.value.style.title},subtitle:{cy:`subtitle`,...P.value.style.title.subtitle}}},null,8,[`config`]))],4)):d(``,!0),(v(),f(`svg`,{ref_key:`svgRef`,ref:je,xmlns:x(i),viewBox:`0 0 ${B.value.width<=0?10:B.value.width} ${B.value.height<=0?10:B.value.height}`,style:_({maxWidth:`100%`,overflow:`visible`,background:P.value.style.backgroundColor})},[m(x(C)),e.$slots[`chart-background`]?(v(),f(`foreignObject`,{key:0,x:0,y:0,width:B.value.width<=0?10:B.value.width,height:B.value.height<=0?10:B.value.height,style:{pointerEvents:`none`}},[b(e.$slots,`chart-background`,{},void 0,!0)],8,he)):d(``,!0),I.value.gradient.show?(v(),f(`defs`,ge,[m(re,{t:`radial`,id:`tracker_gradient_${j.value}`,cx:`50%`,cy:`50%`,r:`50%`,fx:`50%`,fy:`50%`,stops:[[`0%`,I.value.gradient.color,1],[`100%`,I.value.fill,1]]},null,8,[`id`,`stops`])])):d(``,!0),p(`circle`,{cx:B.value.width/2,cy:B.value.height/2,r:Q.value,fill:F.value.track.fill,stroke:F.value.track.stroke,"stroke-width":F.value.track.strokeWidth},null,8,_e),F.value.cycleTrack.show?(v(),f(`path`,{key:2,d:`M ${B.value.width/2},${B.value.height/2-Q.value} A ${Q.value},${Q.value} 0 ${$.value.largeArcFlag},${$.value.sweepFlag} ${$.value.cx},${$.value.cy}`,stroke:F.value.cycleTrack.stroke,"stroke-width":F.value.cycleTrack.strokeWidth,"stroke-linecap":`round`,fill:`none`},null,8,ve)):d(``,!0),p(`circle`,se($.value,{r:B.value.tracker.core,fill:I.value.gradient.show?`url(#tracker_gradient_${j.value})`:I.value.fill,stroke:I.value.stroke,"stroke-width":I.value.strokeWidth}),null,16,ye),I.value.aura.show?(v(),f(`circle`,se({key:3},$.value,{r:B.value.tracker.aura,fill:`${I.value.aura.fill}`,opacity:.2,stroke:I.value.aura.stroke,"stroke-width":I.value.aura.strokeWidth}),null,16,be)):d(``,!0),e.$slots.time?(v(),f(`foreignObject`,{key:4,x:B.value.width/2,y:B.value.height/2,height:`0.1`,width:`0.1`,style:{overflow:`visible`}},[b(e.$slots,`time`,g(h({...V.value,...B.value})),void 0,!0)],8,xe)):e.$slots.timeSvg?(v(),f(`g`,Se,[b(e.$slots,`timeSvg`,g(h({...V.value,...B.value})),void 0,!0)])):(v(),f(`text`,{key:6,x:B.value.width/2,y:B.value.height/2+B.value.label/4,"font-size":B.value.label,"text-anchor":`middle`,fill:F.value.label.color,"font-weight":F.value.label.bold?`bold`:`normal`,style:{"font-variant-numeric":`tabular-nums !important`}},de(V.value.formatted||Me.value),9,Ce))],12,me)),p(`div`,{ref_key:`chartLegend`,ref:O,style:_({width:`100%`,backgroundColor:L.value.backgroundColor})},[e.$slots.controls?d(``,!0):(v(),f(`div`,we,[L.value.buttons.start?(v(),f(`button`,{key:0,title:L.value.buttonTitles.start,onClick:K,class:`vue-ui-timer-button`,style:_({opacity:W.value?.2:1,cursor:W.value?`default`:R.value?`pointer`:`default`})},[m(l,{name:`play`,stroke:L.value.buttons.iconColor},null,8,[`stroke`])],12,Te)):d(``,!0),L.value.buttons.pause?(v(),f(`button`,{key:1,title:G.value?L.value.buttonTitles.resume:L.value.buttonTitles.pause,onClick:J,class:`vue-ui-timer-button`,style:_({opacity:W.value?1:.2,cursor:W.value&&R.value?`pointer`:`default`})},[m(l,{name:`pause`,stroke:L.value.buttons.iconColor},null,8,[`stroke`])],12,Ee)):d(``,!0),L.value.buttons.reset?(v(),f(`button`,{key:2,title:L.value.buttonTitles.reset,onClick:q,class:`vue-ui-timer-button`,style:_({opacity:W.value?1:.2,cursor:W.value&&R.value?`pointer`:`default`})},[m(l,{name:`stop`,stroke:L.value.buttons.iconColor},null,8,[`stroke`])],12,De)):d(``,!0),L.value.buttons.restart?(v(),f(`button`,{key:3,title:L.value.buttonTitles.restart,onClick:Y,class:`vue-ui-timer-button`,style:_({opacity:W.value?1:.2,cursor:W.value&&R.value?`pointer`:`default`})},[m(l,{name:`restart`,stroke:L.value.buttons.iconColor},null,8,[`stroke`])],12,Oe)):d(``,!0),L.value.buttons.lap?(v(),f(`button`,{key:4,title:L.value.buttonTitles.lap,onClick:Z,class:`vue-ui-timer-button`,style:_({opacity:W.value&&!G.value?1:.2,cursor:W.value&&!G.value&&R.value?`pointer`:`default`})},[m(l,{name:`lap`,stroke:L.value.buttons.iconColor},null,8,[`stroke`])],12,ke)):d(``,!0)])),b(e.$slots,`controls`,g(h({start:K,pause:J,reset:q,restart:Y,lap:Z,laps:X.value,isRunning:W.value,isPaused:G.value,...V.value})),void 0,!0),b(e.$slots,`laps`,g(h({laps:X.value,lap:Z,isRunning:W.value,isPaused:G.value,...V.value})),void 0,!0)],4)],4))}},[[`__scopeId`,`data-v-27b9f373`]]);export{S as n,C 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,X as o,Yt as s,at as c,b as l,i as ee,in as te,t as ne,zt as re}from"./lib-rPeBMZrn.js";import{n as ie,t as ae}from"./BaseScanner-8NdoBs7B.js";import{n as oe,t as se}from"./useHints-C-TwxM0Y.js";import{t as ce}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{t as le}from"./resolveChartConfig-CIhClE5R.js";import{t as ue}from"./chartImage-DPGnEuYM.js";import{n as de}from"./Title-BliHuXfT.js";import{t as fe}from"./useChartExport-BZts4KFb.js";import{n as pe,r as me,t as he}from"./userOptionsSlots-CWtXN5Q6.js";import{t as ge}from"./usePrinter-DVf3YcG5.js";import{c as _e}from"./canvas-lib-22VpOI4_.js";import{t as ve}from"./useResponsive-CENUxfEL.js";import{t as ye}from"./useUserOptionState-CXlFnwPv.js";import{t as be}from"./useChartAccessibility-DOMuYJfm.js";import{t as xe}from"./usePrefersMotion-XLHwega2.js";import{t as Se}from"./vue_ui_tiremarks-8HFfABNF.js";import{Fragment as Ce,computed as u,createBlock as d,createCommentVNode as f,createElementBlock as p,createElementVNode as we,createSlots as Te,createVNode as Ee,defineAsyncComponent as m,guardReactiveProps as h,mergeProps as De,normalizeClass as g,normalizeProps as Oe,normalizeStyle as ke,onMounted as Ae,openBlock as _,ref as v,renderList as y,renderSlot as b,toDisplayString as x,toRefs as je,unref as S,watch as Me,withCtx as Ne}from"vue";var Pe=/* @__PURE__ */ e({default:()=>C}),Fe=[`id`],Ie=[`xmlns`,`viewBox`,`aria-labelledby`,`aria-describedby`],Le=[`id`],Re=[`id`],ze=[`width`,`height`],Be={key:1},Ve=[`d`,`stroke-width`,`stroke`],He={key:2},Ue=[`x1`,`y1`,`x2`,`y2`,`stroke-width`,`stroke`],We=[`aria-label`],Ge=[`x`,`y`,`height`],Ke=[`x`,`y`,`font-size`,`fill`,`font-weight`,`text-anchor`],qe={key:4,class:`vue-data-ui-watermark`},C=/*#__PURE__*/ ce({__name:`vue-ui-tiremarks`,props:{config:{type:Object,default(){return{}}},dataset:{type:Object,default(){return{}}}},emits:[`copyAlt`],setup(e,{expose:ce,emit:Pe}){let C=m(()=>import(`./PenAndPaper-DoNTA-SV.js`).then(e=>e.t)),Je=m(()=>import(`./UserOptions-B9EyfU9n.js`).then(e=>e.n)),Ye=m(()=>import(`./PackageVersion-DKSNC-YP.js`).then(e=>e.t)),{vue_ui_tiremarks:Xe}=i(),w=xe(),T=e,Ze=Pe,Qe=u(()=>!!T.dataset&&Object.keys(T.dataset).length),E=v(o()),D=v(null),$e=v(null),et=v(null),tt=v(null),nt=v(0),rt=v(0),O=v(null),k=v(null),A=v(R()),j=u(()=>A.value.userOptions),M=u(()=>A.value.style.chart.layout),N=u(()=>A.value.style.chart);oe({config:()=>A.value,dataset:()=>T.dataset,component:`VueUiTiremarks`,rules:[se.noHint]});let it=u(()=>A.value.userOptions.useCursorPointer),at=u(()=>te({defaultConfig:{userOptions:{show:!1},style:{chart:{backgroundColor:`#99999930`,animation:{use:!1},layout:{activeColor:`#6A6A6A80`,inactiveColor:`#CACACA80`,ticks:{gradient:{show:!1}}}}}},userConfig:A.value.skeletonConfig??{}})),{loading:P,FINAL_DATASET:F}=ie({...je(T),FINAL_CONFIG:A,prepareConfig:R,skeletonDataset:T.config?.skeletonDataset??{percentage:50},skeletonConfig:te({defaultConfig:A.value,userConfig:at.value})}),{userOptionsVisible:I,setUserOptionsVisibility:ot,keepUserOptionState:st}=ye({config:A.value}),{svgRef:L}=be({config:N.value.title});function R(){return le(T.config,Xe,Se)}Me(()=>T.config,e=>{A.value=R(),I.value=!A.value.userOptions.showOnChartHover,G.value=N.value.width,K.value=N.value.height,pt(),rt.value+=1},{deep:!0});let{isPrinting:z,isImaging:B,generatePdf:ct,generateImage:lt}=ge({elementId:E.value,fileName:N.value.title.text||`vue-ui-tiremarks`,options:A.value.userOptions.print}),ut=u(()=>A.value.userOptions.show&&!N.value.title.text),V=v(N.value.animation.use&&!w.value?0:l(F.value.percentage));Me(()=>F.value,e=>{N.value.animation.use&&!w.value?dt(e.percentage):V.value=e.percentage||0},{deep:!0}),Ae(()=>{pt()});function dt(e){let t=N.value.animation.speed,n=Math.abs(e-V.value)/(t*120);function r(){V.value<e?V.value=Math.min(V.value+n,e):V.value>e&&(V.value=Math.max(V.value-n,e)),V.value!==e&&requestAnimationFrame(r)}r()}let ft=u(()=>A.value.debug);function pt(){if(re(T.dataset)&&c({componentName:`VueUiTiremarks`,type:`dataset`,debug:ft.value}),A.value.responsive){let e=_e(()=>{let{width:e,height:t}=ve({chart:D.value,title:N.value.title.text?et.value:null,source:tt.value});requestAnimationFrame(()=>{G.value=Math.max(.1,e),K.value=Math.max(.1,t-12)})});O.value&&(k.value&&O.value.unobserve(k.value),O.value.disconnect()),O.value=new ResizeObserver(e),k.value=D.value.parentNode,O.value.observe(k.value)}dt(F.value.percentage||0)}let H=u(()=>M.value.display===`vertical`),U=u(()=>{let e=N.value.percentage.show,t={top:e?48:12,left:e?64:16,right:e?64:16,bottom:e?48:12};return H.value?{top:N.value.percentage.verticalPosition===`top`?t.top:3,left:3,right:3,bottom:N.value.percentage.verticalPosition===`bottom`?t.bottom:3}:{top:0,bottom:0,left:N.value.percentage.horizontalPosition===`left`?t.left:16,right:N.value.percentage.horizontalPosition===`right`?t.right:10}}),W=u(()=>Object.values(U.value).reduce((e,t)=>e+t,0)),G=v(N.value.width),K=v(N.value.height),q=u(()=>({height:K.value,width:G.value})),mt=u(()=>({horizontal:{x:Y.value.x+(N.value.percentage.horizontalPosition===`left`?6:3),y:q.value.height/2-Y.value.fontSize/2},vertical:{x:q.value.width/2-20,y:Y.value.y-Y.value.fontSize/2}})[M.value.display]),J=u(()=>H.value?{mark:(q.value.height-W.value)/100*.5,space:(q.value.height-W.value)/100*.5}:{mark:(q.value.width-W.value)/100*.5,space:(q.value.width-W.value)/100*.5}),ht=u(()=>{let e=[];for(let t=0;t<100;t+=1){let n=M.value.ticks.gradient.show?s(M.value.activeColor,t/100*(M.value.ticks.gradient.shiftHueIntensity/100)):M.value.activeColor;if(H.value){let r=M.value.crescendo?(100-t)*(q.value.width-U.value.left-U.value.right)/100/3:0,i=U.value.left+4+r,a=q.value.width-U.value.right-4-r,o=q.value.height-U.value.bottom-t*J.value.mark-t*J.value.space-J.value.mark,s=q.value.height-U.value.bottom-t*J.value.mark-t*J.value.space-J.value.mark,c=(a-i)/M.value.curveAngleX,l=M.value.curveAngleY*((1+t)/100);e.push({x1:i,x2:a,y1:o,y2:s,curve:`M ${i} ${o} C ${i+c} ${o-l}, ${a-c} ${s-l}, ${a} ${s}`,color:n})}else{let r=M.value.crescendo?(100-t)*(q.value.height-U.value.top-U.value.bottom)/100/3:0,i=U.value.left+t*J.value.mark+t*J.value.space-J.value.mark,a=i,o=U.value.top+4+r,s=q.value.height-U.value.bottom-4-r,c=M.value.curveAngleY*((1+t)/100),l=(s-o)/M.value.curveAngleX;e.push({x1:i,x2:a,y1:o,y2:s,curve:`M ${i} ${o} C ${i+c} ${o+l}, ${a+c} ${s-l}, ${a} ${s}`,color:n})}}return e}),Y=u(()=>{let e,t,n,r=N.value.percentage.fontSize/3;return H.value?N.value.percentage.verticalPosition===`top`?(e=q.value.width/2,t=U.value.top/2,n=`middle`):N.value.percentage.verticalPosition===`bottom`&&(e=q.value.width/2,t=q.value.height-U.value.bottom/2+r,n=`middle`):N.value.percentage.horizontalPosition===`left`?(e=4,t=q.value.height/2+r,n=`start`):N.value.percentage.horizontalPosition===`right`&&(e=q.value.width-U.value.right+8,t=q.value.height/2+r,n=`start`),{x:e,y:t,textAnchor:n,bold:N.value.percentage.bold,fontSize:N.value.percentage.fontSize,fill:N.value.percentage.color}}),X=v(!1);function gt(e){X.value=e,nt.value+=1}let Z=v(!1);function _t(){Z.value=!Z.value}let vt=ue(D,()=>N.value.title.text),yt=u(()=>N.value.backgroundColor),bt=u(()=>N.value.title),{isCallbackImaging:Q,isCallbackSvg:xt,generateSvg:St,onGenerateImage:Ct}=fe({svg:L,title:bt,legend:null,legendItems:null,backgroundColor:yt,getSvgCallback:()=>A.value.userOptions.callbacks.svg,generateImage:lt});async function wt(){Ze(`copyAlt`,{config:A.value,dataset:F.value}),A.value.userOptions.callbacks.altCopy?await Promise.resolve(A.value.userOptions.callbacks.altCopy({config:A.value,dataset:F.value})):console.warn("Vue Data UI - A callback must be set for `altCopy` in userOptions.")}let Tt=u(()=>`${E.value}-title`),Et=u(()=>`${E.value}-desc`),$=u(()=>ee(N.value.percentage.formatter,V.value,a({v:V.value,s:`%`,r:N.value.percentage.rounding}))),Dt=u(()=>N.value.title.text||``),Ot=u(()=>P.value?`Loading data`:`Value: ${$.value}`);return ce({getImage:vt,generatePdf:ct,generateImage:lt,generateSvg:St,toggleAnnotator:_t,toggleFullscreen:gt,copyAlt:wt}),(e,i)=>(_(),p(`div`,{ref_key:`tiremarksChart`,ref:D,class:g(`vue-data-ui-component vue-ui-tiremarks ${A.value.useCssAnimation?``:`vue-ui-dna`}`),style:ke(`font-family:${A.value.style.fontFamily};width:100%; text-align:center;background:${N.value.backgroundColor}`),id:E.value,onMouseenter:i[0]||=()=>S(ot)(!0),onMouseleave:i[1]||=()=>S(ot)(!1)},[j.value.buttons.annotator?(_(),d(S(C),De({key:0},S(n)(j.value.annotator),{svgRef:S(L),backgroundColor:N.value.backgroundColor,color:N.value.color,active:Z.value,isCursorPointer:it.value,palette:j.value.annotatorPalette,onClose:_t}),Te({_:2},[y(S(r),n=>({name:n,fn:Ne(r=>[b(e.$slots,n,Oe(h(S(t)(n,r))),void 0,!0)])}))]),1040,[`svgRef`,`backgroundColor`,`color`,`active`,`isCursorPointer`,`palette`])):f(``,!0),ut.value?(_(),p(`div`,{key:1,ref_key:`noTitle`,ref:$e,class:`vue-data-ui-no-title-space`,style:`height:36px; width: 100%;background:transparent`},null,512)):f(``,!0),N.value.title.text?(_(),p(`div`,{key:2,ref_key:`chartTitle`,ref:et,style:`width:100%;background:transparent;padding-bottom:12px`},[(_(),d(de,{key:`title_${rt.value}`,config:{title:{cy:`wheel-title`,...N.value.title},subtitle:{cy:`wheel-subtitle`,...N.value.title.subtitle}}},null,8,[`config`]))],512)):f(``,!0),j.value.show&&Qe.value&&(S(st)||S(I))?(_(),d(S(Je),De({ref:`details`,key:`user_options_${nt.value}`,backgroundColor:N.value.backgroundColor,color:N.value.color,isPrinting:S(z),isImaging:S(B),uid:E.value,hasXls:!1,isFullscreen:X.value,chartElement:D.value},S(me)(j.value,`pdf img svg fullscreen altCopy annotator`),{isAnnotation:Z.value,isCursorPointer:it.value,onToggleFullscreen:gt,onGeneratePdf:S(ct),onGenerateImage:S(Ct),onGenerateSvg:S(St),onToggleAnnotator:_t,onCopyAlt:wt,style:{visibility:S(st)?S(I)?`visible`:`hidden`:`visible`}}),Te({_:2},[y(S(pe)(e.$slots,`menuIcon optionPdf optionImg optionSvg optionFullscreen optionAnnotator optionAltCopy custom-menu-before custom-menu-after`),t=>({name:t,fn:Ne(n=>[b(e.$slots,t,Oe(h(S(he)(t,n))),void 0,!0)])}))]),1040,[`backgroundColor`,`color`,`isPrinting`,`isImaging`,`uid`,`isFullscreen`,`chartElement`,`isAnnotation`,`isCursorPointer`,`onGeneratePdf`,`onGenerateImage`,`onGenerateSvg`,`style`])):f(``,!0),(_(),p(`svg`,{ref_key:`svgRef`,ref:L,xmlns:S(ne),class:g({"vue-data-ui-fullscreen--on":X.value,"vue-data-ui-fulscreen--off":!X.value}),viewBox:`0 0 ${G.value} ${K.value}`,style:ke(`max-width:100%; overflow: visible; background:transparent;color:${N.value.color}`),role:`img`,"aria-labelledby":Tt.value,"aria-describedby":Et.value},[we(`title`,{id:Tt.value},x(Dt.value),9,Le),we(`desc`,{id:Et.value},x(Ot.value),9,Re),Ee(S(Ye)),b(e.$slots,`svg-underlayer`,{svg:{...q.value,isPrintingImg:S(z)||S(B)||S(Q),isPrintingSvg:S(xt)}},void 0,!0),e.$slots[`chart-background`]?(_(),p(`foreignObject`,{key:0,x:0,y:0,width:q.value.width,height:q.value.height,style:{pointerEvents:`none`}},[b(e.$slots,`chart-background`,{},void 0,!0)],8,ze)):f(``,!0),M.value.curved?(_(),p(`g`,Be,[(_(!0),p(Ce,null,y(ht.value,(e,t)=>(_(),p(`path`,{d:e.curve,"stroke-width":J.value.mark,stroke:V.value>=t?e.color:M.value.inactiveColor,"stroke-linecap":`round`,fill:`none`,class:g({"vue-ui-tick-animated":N.value.animation.use&&!S(w)&&t<=V.value})},null,10,Ve))),256))])):(_(),p(`g`,He,[(_(!0),p(Ce,null,y(ht.value,(e,t)=>(_(),p(`line`,{x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2,"stroke-width":J.value.mark,stroke:V.value>=t?e.color:M.value.inactiveColor,"stroke-linecap":`round`},null,8,Ue))),256))])),N.value.percentage.show?(_(),p(`g`,{key:3,role:`status`,"aria-live":`polite`,"aria-label":S(P)?`...`:`${$.value}`},[S(P)?(_(),p(`rect`,{key:0,x:mt.value.x,y:mt.value.y,width:40,height:Y.value.fontSize,fill:`#6A6A6A80`,rx:3},null,8,Ge)):(_(),p(`text`,{key:1,"aria-hidden":`true`,x:Y.value.x,y:Y.value.y,"font-size":Y.value.fontSize,fill:M.value.ticks.gradient.show&&N.value.percentage.useGradientColor?S(s)(M.value.activeColor,V.value/100*(M.value.ticks.gradient.shiftHueIntensity/100)):N.value.percentage.color,"font-weight":Y.value.bold?`bold`:`normal`,"text-anchor":Y.value.textAnchor},x($.value),9,Ke))],8,We)):f(``,!0),b(e.$slots,`svg`,{svg:{...q.value,isPrintingImg:S(z)||S(B)||S(Q),isPrintingSvg:S(xt)}},void 0,!0)],14,Ie)),e.$slots.watermark?(_(),p(`div`,qe,[b(e.$slots,`watermark`,Oe(h({isPrinting:S(z)||S(B)||S(Q)||S(xt)})),void 0,!0)])):f(``,!0),e.$slots.source?(_(),p(`div`,{key:5,ref_key:`source`,ref:tt,dir:`auto`},[b(e.$slots,`source`,{},void 0,!0)],512)):f(``,!0),b(e.$slots,`skeleton`,{},()=>[S(P)?(_(),d(ae,{key:0})):f(``,!0)],!0)],46,Fe))}},[[`__scopeId`,`data-v-688efa59`]]);export{Pe as n,C 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,Dt as s,Ft as c,Ht as l,S as u,X as d,Zt as f,at as ee,et as te,i as ne,in as re,nt as ie,pt as ae,r as oe,t as se,w as ce,zt as le}from"./lib-rPeBMZrn.js";import{n as ue,t as de}from"./BaseScanner-8NdoBs7B.js";import{n as fe,t as pe}from"./useHints-C-TwxM0Y.js";import{t as me}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{n as he}from"./resolveChartConfig-CIhClE5R.js";import{t as ge}from"./chartImage-DPGnEuYM.js";import{t as _e}from"./BaseIcon-CoY0vuL3.js";import{n as ve}from"./Title-BliHuXfT.js";import{t as ye}from"./useChartExport-BZts4KFb.js";import{n as be,t as xe}from"./tableIntegration-CNoJ1CIY.js";import{n as Se,r as Ce,t as we}from"./userOptionsSlots-CWtXN5Q6.js";import{t as Te}from"./usePrinter-DVf3YcG5.js";import{t as Ee}from"./useTransitions-ChGGrtrv.js";import{c as De}from"./canvas-lib-22VpOI4_.js";import{t as Oe}from"./useResponsive-CENUxfEL.js";import{t as ke}from"./DefGrad-DKMq1REY.js";import{t as Ae}from"./BaseLegendToggle-BIzyyI1h.js";import{t as je}from"./A11yDataTable-DWNlWXzs.js";import{t as Me}from"./useUserOptionState-CXlFnwPv.js";import{t as Ne}from"./useChartAccessibility-DOMuYJfm.js";import{n as Pe}from"./annotationViewport-X8fvs7pz.js";import{t as Fe}from"./Legend-DM0ClX3D.js";import{t as Ie}from"./usePanZoom-CE6Ofyy8.js";import{t as Le}from"./vue_ui_treemap-Bv4Rdl5_.js";import{Fragment as Re,Teleport as ze,computed as p,createBlock as m,createCommentVNode as h,createElementBlock as g,createElementVNode as _,createSlots as Be,createTextVNode as Ve,createVNode as He,defineAsyncComponent as Ue,guardReactiveProps as v,mergeProps as We,nextTick as Ge,normalizeClass as Ke,normalizeProps as y,normalizeStyle as qe,onBeforeUnmount as Je,onMounted as Ye,openBlock as b,ref as x,renderList as Xe,renderSlot as S,resolveDynamicComponent as Ze,shallowRef as C,toDisplayString as Qe,toRefs as $e,unref as w,useCssVars as et,useSlots as tt,watch as nt,withCtx as T,withKeys as rt,withModifiers as it}from"vue";function at(e,t){let n=e.length;if(n===0)throw Error(`Max aspect ratio cannot be computed: ${e} is an empty array`);{let r=1/0,i=-1/0,a=0;for(let t=0;t<n;t+=1){let n=e[t].normalizedValue;n<r&&(r=n),n>i&&(i=n),a+=n}return Math.max(t**2*i/a**2,a**2/(t**2*r))}}function ot(e){let{xOffset:t,yOffset:n,width:r,height:i}=e;return{x0:t,y0:n,x1:t+r,y1:n+i}}function st(e,t,n){if(e.length===0)return!0;{let r=e.concat(t);return at(e,n)>=at(r,n)}}function ct(e){let t=[],n=e.length;for(let r=0;r<n;r+=1){let n=e[r],i=n.length;for(let e=0;e<i;e+=1)t.push(n[e])}return t}function lt(e,t){return D({...t,children:e})}function ut(e){return(e.x1-e.x0)*(e.y1-e.y0)}function dt(e,t){let{width:n,height:r,xOffset:i,yOffset:a}=mt(t),o=e.length,s=e.map(e=>e.normalizedValue||0).reduce((e,t)=>e+t,0),c=s/r,l=s/n,u=i,d=a,f=[];if(n>=r){for(let t=0;t<o;t+=1){let n=e[t],r=d+n.normalizedValue/c,i={x0:u,y0:d,x1:u+c,y1:r},a=Object.assign({},n,i);d=r,f.push(a)}return f}for(let t=0;t<o;t+=1){let n=e[t],r=u+n.normalizedValue/l,i={x0:u,y0:d,x1:r,y1:d+l},a=Object.assign({},n,i);u=r,f.push(a)}return f}function ft(e){let t=mt(e),n=t.width,r=t.height;return Math.min(n,r)}function pt(e,t){let n=e.length,r=t/e.map(e=>e.value??0).reduce((e,t)=>e+t,0),i=[],a,o;for(let t=0;t<n;t+=1)o=e[t],a=Object.assign({},o,{normalizedValue:o.value*(r||0)}),i.push(a);return i}function mt(e){let{x0:t,y0:n,x1:r,y1:i}=e;return{xOffset:t,yOffset:n,width:r-t,height:i-n}}function E(e,t,n,r){let i=e,a=t,o=n,s=r;for(;;){let e=i.length;if(e===0){let e=dt(a,o);return s.concat(e)}let t=ft(o),n=i[0],r=i.slice(1,e);if(st(a,n,t)){let e=a.concat(n);i=r,a=e,o=o,s=s}else{let e=a.length,t=0;for(let n=0;n<e;n+=1)t+=a[n].normalizedValue;let n=ht(o,t),r=dt(a,o),c=s.concat(r);i=i,a=[],o=n,s=c}}}function D(e){if(e.children===void 0||!e.children.length)return[e];{let t=E(pt(e.children,ut(e)),[],e,[]),n=t.length,r=[];for(let e=0;e<n;e+=1)r.push(D(t[e]));return ct(r)}}function ht(e,t){let{width:n,height:r,xOffset:i,yOffset:a}=mt(e);if(n>=r){let e=t/r,o=n-e;return ot({xOffset:i+e,yOffset:a,width:o,height:r})}{let e=t/n,o=r-e;return ot({xOffset:i,yOffset:a+e,width:n,height:o})}}var gt=/* @__PURE__ */ e({default:()=>Gt}),_t=[`id`],vt=[`id`],yt=[`id`],bt=[`tabindex`,`onClick`,`onKeydown`,`data-last-crumb`,`onMouseenter`,`onFocus`],xt={class:`vue-ui-treemap-crumb-unit`},St={class:`vue-ui-treemap-crumb-unit-label`},Ct={key:0,style:{width:`24px`,display:`flex`,"align-items":`center`}},wt={key:0,class:`vue-ui-treemap-crumb-unit-arrow`},Tt={style:{position:`relative`}},Et=[`xmlns`,`aria-describedby`,`viewBox`],Dt={key:0},Ot=[`x`,`y`,`height`,`width`,`fill`,`rx`,`stroke`,`stroke-width`,`onClick`,`onMouseenter`,`onMouseleave`],kt=[`id`],At=[`x`,`y`,`width`,`height`],jt=[`clip-path`],Mt=[`transform`],Nt=[`transform`],Pt=[`x`,`y`,`fill`,`font-size`,`font-family`,`font-weight`],Ft={key:0},It=[`x`,`y`,`height`,`width`],Lt={style:{width:`100%`,height:`100%`,overflow:`hidden`},class:`vue-ui-treemap-cell`},Rt={key:0,"data-dom-to-png-ignore":``,class:`reset-wrapper`},zt={key:1,style:{position:`absolute`,top:`100%`,left:`0`,width:`100%`},"data-dom-to-png-ignore":``,"aria-hidden":`true`},Bt={key:6,class:`vue-data-ui-watermark`},Vt=[`id`],Ht=[`onClick`],Ut={style:{display:`flex`,"align-items":`center`}},Wt=4,Gt=/*#__PURE__*/ me({__name:`vue-ui-treemap`,props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:[`selectLegend`,`selectDatapoint`,`copyAlt`],setup(e,{expose:me,emit:at}){et(e=>({e8095b48:Ai.value}));let ot=Ue(()=>import(`./DataTable-Dof6yhO7.js`)),st=Ue(()=>import(`./PenAndPaper-DoNTA-SV.js`).then(e=>e.t)),ct=Ue(()=>import(`./vue-ui-accordion-E8TJfFeK.js`).then(e=>e.n)),ut=Ue(()=>import(`./Tooltip-C1q0Qoh7.js`)),dt=Ue(()=>import(`./UserOptions-B9EyfU9n.js`).then(e=>e.n)),ft=Ue(()=>import(`./PackageVersion-DKSNC-YP.js`).then(e=>e.t)),pt=Ue(()=>import(`./BaseDraggableDialog-BK7dj9O6.js`).then(e=>e.n)),{vue_ui_treemap:mt}=i(),E=e,D=at,ht=tt(),gt=p(()=>!!E.dataset&&E.dataset.length),Gt=p(()=>/^((?!chrome|android).)*safari/i.test(navigator.userAgent)),O=x(d()),Kt=x(!1),qt=x(``),Jt=x(!1),Yt=x(0),k=x([]),A=C(null),Xt=C(null),Zt=C(null),Qt=C(null),$t=C(null),en=x(0),tn=x(0),nn=x(0),j=x([]),rn=x(null),an=x(!1),on=x(null),sn=x(null),cn=x(null),ln=x(/* @__PURE__ */ new Map),M=x(null),un=x({x:0,y:0}),dn=x(`pointer`),fn=x(!1),N=x(Sn()),P=p(()=>N.value.userOptions),F=p(()=>N.value.style.chart.tooltip),I=p(()=>N.value.style.chart.legend),L=p(()=>N.value.style.chart.layout.labels),R=p(()=>N.value.style.chart.layout),z=p(()=>N.value.style.chart);fe({config:()=>N.value,dataset:()=>E.dataset,component:`VueUiTreemap`,rules:[pe.emptyArray,{test:e=>e.length===1&&e[0]?.children&&e[0].children.length<6&&e[0].children.length>0||e.flatMap(e=>e?.children?.length??0).reduce((e,t)=>e+t,0)<6,message:[`👀 The number of data points is < 6. Consider:`,``,`▶️ Using another type of chart instead to better show proportions: VueUiDonut, VueUiWaffle`]},{test:e=>e.length===1&&e[0]?.children&&e[0].children.length===0,message:[`👀 There is a series defined in the dataset but it has no children items.`,``,`▶️ Add children items to your series.`]}]});let{transitionEnabled:pn}=Ee({config:()=>N.value.transitions,dataset:()=>E.dataset}),B=p(()=>N.value.userOptions.useCursorPointer),mn=p(()=>re({defaultConfig:{userOptions:{show:!1},style:{chart:{backgroundColor:`#999999`,layout:{labels:{showDefaultLabels:!1},rects:{stroke:`#6A6A6A`}},legend:{backgroundColor:`transparent`}}}},userConfig:N.value.skeletonConfig??{}})),{loading:hn,FINAL_DATASET:gn,manualLoading:_n}=ue({...$e(E),FINAL_CONFIG:N,prepareConfig:Sn,skeletonDataset:E.config?.skeletonDataset??[{name:`_`,value:53,color:`#CACACA90`,children:[{name:`_`,value:21},{name:`_`,value:13},{name:`_`,value:8},{name:`_`,value:5},{name:`_`,value:3},{name:`_`,value:2},{name:`_`,value:1}]}],skeletonConfig:re({defaultConfig:N.value,userConfig:mn.value})}),{userOptionsVisible:vn,setUserOptionsVisibility:yn,keepUserOptionState:bn}=Me({config:N.value}),{svgRef:xn}=Ne({config:z.value.title});function Sn(){return he(E.config,mt,Le)}let Cn=f(E.config);nt(()=>E.config,(e,t)=>{let n=f(e),r=n!==Cn;Cn=n;let i=Sn();r?(hn.value||(N.value=i),vn.value=!N.value.userOptions.showOnChartHover,en.value+=1,tn.value+=1,nn.value+=1,V.value.showTable=N.value.table.show,V.value.showTooltip=F.value.show,V.value.showZoom=z.value.zoom?.show??!1):(N.value.style.chart.tooltip=i.style.chart.tooltip,V.value.showTooltip=N.value.style.chart.tooltip.show)},{deep:!0});let{isPrinting:wn,isImaging:Tn,generatePdf:En,generateImage:Dn}=Te({elementId:`treemap_${O.value}`,fileName:z.value.title.text||`vue-ui-treemap`,options:N.value.userOptions.print}),On=p(()=>N.value.userOptions.show&&!z.value.title.text),kn=p(()=>ce(N.value.customPalette)),V=x({showTable:N.value.table.show,showTooltip:F.value.show,showZoom:z.value.zoom?.show??!1});nt(N,()=>{V.value={showTable:N.value.table.show,showTooltip:F.value.show,showZoom:z.value.zoom?.show??!1}},{immediate:!0});let An=x({height:z.value.height,width:z.value.width});function jn(e){let t=A.value,n=An.value.height;return!t||!n?e:e*(n/t.getBoundingClientRect().height)}function Mn(){if(!rn.value||X.value.length<=1)return 0;let e=rn.value,t=getComputedStyle(e);return jn(e.offsetHeight+parseFloat(t.marginTop||`0`)+parseFloat(t.marginBottom||`0`)+parseFloat(t.paddingTop||`0`)+parseFloat(t.paddingBottom||`0`))}let H=p(()=>{let e=z.value.padding,t=An.value.width,n=An.value.height,r=Mn(),i=e.left,a=t-e.right,o=e.top,s=n-e.bottom-r;return{left:i,top:o,right:a,bottom:s,width:a-i,height:Math.max(0,s-o),vbWidth:t,vbHeight:n-r,offsetY:r}}),U=x(te(gn.value)),W=x(U.value),Nn=C(/* @__PURE__ */ new Map);nt([U,()=>N.value],()=>{cn.value=null,ln.value=/* @__PURE__ */ new Map},{deep:!0}),nt(()=>k.value,()=>{cn.value=null,ln.value=/* @__PURE__ */ new Map,Ln(),nn.value+=1,tn.value+=1},{deep:!0}),nt([()=>An.value.width,()=>An.value.height],()=>{ln.value=/* @__PURE__ */ new Map});function Pn(e){Array.isArray(e)&&e.forEach((e,t)=>{e.id||=d(),e.sourceColor===void 0&&(e.sourceColor=u(e.color)||null);let n=e.sourceColor||Nn.value.get(e.id)||kn.value[t]||l[t]||l[t%l.length];n=u(n),Nn.value.set(e.id,n),e.color=n,Fn(e,n)})}function Fn(e,t){Array.isArray(e.children)&&e.children.forEach(n=>{n.id||=d(),n.parentId=e.id,n.sourceColor===void 0&&(n.sourceColor=u(n.color)||null);let r=n.sourceColor||t;n.color=r,Fn(n,r)})}function In(e){let t=Y(e);for(;t?.parentId;)t=Y(t.parentId);return t?.id??null}function Ln(){let e=U.value.filter(e=>!k.value.includes(e.id));if(!j.value.length){W.value=e;return}let t=j.value[j.value.length-1],n=Y(t);if(!n){j.value=[],W.value=e;return}let r=In(n.id);r&&k.value.includes(r)?(j.value=[],W.value=e):W.value=[n]}nt(()=>gn.value,()=>{U.value=te(gn.value),Pn(U.value),Ln(),nn.value+=1,tn.value+=1},{deep:!0,immediate:!0,flush:`post`});let Rn=C(null),zn=C(null);Ye(()=>{an.value=!0,Vn()});let Bn=p(()=>N.value.debug);Ye(()=>{ht[`chart-background`]&&Bn.value&&console.warn(`VueUiTreemap does not support the #chart-background slot.`)});function Vn(){if(le(E.dataset)&&ee({componentName:`VueUiTreemap`,type:`dataset`,debug:Bn.value}),Pn(U.value),le(E.dataset)||(_n.value=N.value.loading),N.value.responsive){let e=De(()=>{let{width:e,height:t}=Oe({chart:A.value,title:z.value.title.text?Xt.value:null,legend:I.value.show?Zt.value:null,source:Qt.value,noTitle:$t.value});requestAnimationFrame(()=>{An.value.width=e,An.value.height=t-12})});Rn.value&&(zn.value&&Rn.value.unobserve(zn.value),Rn.value.disconnect()),Rn.value=new ResizeObserver(e),zn.value=A.value.parentNode,Rn.value.observe(zn.value)}}Je(()=>{Rn.value&&(zn.value&&Rn.value.unobserve(zn.value),Rn.value.disconnect())});let Hn=p(()=>W.value.map((e,t)=>({...e,color:u(e.color)||kn.value[t]||l[t]||l[t%l.length]})).filter(e=>!k.value.includes(e.id))),Un=p(()=>U.value.filter(e=>!k.value.includes(e.id)).map(e=>e.value||0).reduce((e,t)=>e+t,0)),Wn=p({get(){let e=[...Hn.value];return R.value.sorted&&(e=[...Hn.value].sort((e,t)=>t.value-e.value)),e.map(e=>({...e}))},set(e){return e}});function Gn(e,t){return e.value/t}function Kn(e,t,n){let r=R.value.rects.colorRatio-Gn(t,n);return c(e,r<0?0:r)}function qn(e){return Array.isArray(e.children)&&e.children.length>0}function Jn(e){return[...e].sort((e,t)=>{let n=qn(e),r=qn(t);if(n!==r)return n-r;let i=Number(e.value)||0;return(Number(t.value)||0)-i})}function Yn(e,t,n,r,i){return Jn(e).map((e,a)=>{let o=e.sourceColor||u(e.color)||u(t)||kn.value[a]||l[a]||l[a%l.length],s=e.sourceColor?e.sourceColor:Kn(o,e,r),c=Gn(e,r),d=i??e.parentId??e.id,f=Array.isArray(e.children)&&e.children.length&&e.children.reduce((e,t)=>e+(Number(t.value)||0),0)||1;return{...e,color:s,proportion:c,parentName:n,rootId:d,children:Array.isArray(e.children)&&e.children.length?Yn(e.children,o,e.name,f,d):void 0}})}function Xn(e){let t=lr(e),n=Zn(e),r=t*.55,i=t*.55,a=t*1.05,o=t*1.05,s=t*.35,c=n?a+o+s:t*.45,l=e.x0+r,u=e.x1-r,d=e.y0+c,f=e.y1-i;return u<=l||f<=d?null:{x0:l,y0:d,x1:u,y1:f}}function Zn(e){return L.value.hideUnderProportion===0||Qn(e)}function Qn(e){let t=Number(L.value.hideUnderProportion);return!Number.isFinite(t)||t<=0||e.proportion>t}function $n(e,t,n=0,r=null){if(!Array.isArray(e)||!e.length)return[];let i=e.map(e=>{let{children:t,...n}=e;return{...n}}),a=new Map(e.map(e=>[e.id,Array.isArray(e.children)?e.children:[]])),o=new Map(e.map(e=>[e.id,e])),s=lt(i,t),c=[];for(let e of s){let t=a.get(e.id)||[],i=o.get(e.id),s={...e,depth:n,parentId:r??e.parentId??null,color:i?.color??e.color??null,children:t,isVisibleNode:!0,showLabel:Zn(e)};if(c.push(s),t.length){let r=Xn(s);r&&c.push(...$n(t,r,n+1,e.id))}}return c}let er=p(()=>{let e=W.value.length?W.value:Wn.value,t=e.map(e=>Number(e.value)||0).reduce((e,t)=>e+t,0)||1;return $n(e.map((e,n)=>{let r=e.children?e.children.reduce((e,t)=>e+(Number(t.value)||0),0):e.value,{children:i,...a}=e,o=e.sourceColor||u(e.color)||Nn.value.get(e.id)||kn.value[n]||l[n]||l[n%l.length],s=e.sourceColor?e.sourceColor:Kn(o,e,t);return{...a,id:e.id||d(),parentId:e.parentId??null,name:e.name,value:e.value,color:s,proportion:(Number(e.value)||0)/t,children:Array.isArray(e.children)&&e.children.length?Yn(e.children,o,e.name,r||1):void 0}}),{x0:H.value.left,y0:H.value.top,x1:H.value.left+H.value.width,y1:H.value.top+H.value.height})}),G=p(()=>er.value);function tr(e){return(Z.value&&Z.value.id===e.id?R.value.rects.selected.strokeWidth:R.value.rects.strokeWidth)*Gr.value}function K({y0:e,y1:t}){return t-e<=0?1e-4:Math.round((t-e)*1e4)/1e4}function q({x0:e,x1:t}){return t-e<=0?1e-4:Math.round((t-e)*1e4)/1e4}function nr(){let e=L.value,t=Number(e.minFontSize),n=Number(e.fontSize),r=Math.max(0,Math.min(Number.isFinite(t)?t:0,Number.isFinite(n)?n:0));return{lowerBound:r,upperBound:Math.max(r,Number.isFinite(n)?n:r)}}function rr(e){let t=Math.min(4,Math.max(e*.25,.5));return{paddingX:t,paddingTop:t}}function ir(e,t){let{paddingX:n,paddingTop:r}=rr(t),i=t*1.1;return{x:e.x0+n,y:e.y0+r,width:Math.max(q(e)-n*2,0),height:Math.max(K(e)-r*2,0),lineHeight:i}}function ar(e,t){return ne(L.value.formatter,e.value,a({p:L.value.prefix,v:e.value,s:L.value.suffix,r:F.value.roundingValue}),{datapoint:e,seriesIndex:t})}function or(e,t){let n=ar(e,t);return Array.isArray(e.children)&&e.children.length?[`${e.name} (${n})`]:[`${e.name}`,n].filter(e=>`${e}`.length)}function sr(e,t,n){let r=or(e,n),i=ir(e,t);return!r.length||i.width<=0||i.height<=0||r.length*i.lineHeight>i.height?!1:r.every((e,n)=>Si(e,t,n===0?500:400)<=i.width)}function cr(e,t,n,r){let i=or(e,t),a=Math.max(1,...i.map(e=>String(e).length)),o=Math.min(18,Math.max(10,Math.ceil(a*.7))),s=Math.max(1,i.length),c=Math.max(q(e)-1,1e-4),l=Math.max(K(e)-1,1e-4),u=c/(o*.58),d=l/(s*1.35);return Math.max(n,Math.min(r,u,d))}function lr(e,t){let{lowerBound:n,upperBound:r}=nr(),i=Math.max(1e-4,Math.min(q(e),K(e))),a=Math.max(n,Math.min(r,i*.9)),o=Math.min(a,cr(e,t,n,r));if(sr(e,o,t)||!sr(e,n,t))return o;let s=n,c=o,l=n;for(let n=0;n<8;n+=1){let n=(s+c)/2;sr(e,n,t)?(l=n,s=n):c=n}let u=Math.max(n,o*.7);return l>=u?l:o}function ur(e){Jt.value=e,Yt.value+=1}let J=p(()=>({x:0,y:0,width:H.value.vbWidth,height:H.value.vbHeight}));function Y(e,t=U.value){for(let n of t){if(n.id===e)return n;if(n.children){let t=Y(e,n.children);if(t)return t}}return null}function dr(e){let t=[],n=Y(e);for(;n&&n.parentId;){let e=Y(n.parentId);if(!e)break;t.unshift(e.id),n=e}return t}let fr=p(()=>j.value.length>0);function pr(){W.value=U.value.slice(),j.value=[],D(`selectDatapoint`,void 0)}function mr(){return j.value[j.value.length-1]??null}function hr(e,t,n){j.value=[...dr(e.id),e.id],W.value=[e],N.value.events.datapointClick&&N.value.events.datapointClick({datapoint:t??e,seriesIndex:n}),D(`selectDatapoint`,t??e)}function gr(e,t){let n=mr();if(!n){pr();return}let r=Y(n);if(!r?.parentId){N.value.events.datapointClick&&N.value.events.datapointClick({datapoint:e,seriesIndex:t}),pr();return}let i=Y(r.parentId);i?(j.value=[...dr(i.id),i.id],W.value=[i],N.value.events.datapointClick&&N.value.events.datapointClick({datapoint:e,seriesIndex:t}),D(`selectDatapoint`,e)):pr()}function _r(e,t){if(!e){pr();return}let n=Y(e.id);n&&(mr()===n.id?gr(e,t):hr(n,e,t))}function vr(e){return e?mr()===e.id:!1}let X=p(()=>{let e=[{id:null,label:`All`}];if(j.value.length>0){let t=Y(j.value[j.value.length-1]),n=[];for(;t;)n.unshift(t),t=t.parentId?Y(t.parentId):null;for(let t of n)e.push({id:t.id,label:t.name,node:t})}return e}),Z=C(null),yr=p(()=>U.value.map((e,t)=>({...e,color:u(e.color)||kn.value[t]||l[t]||l[t%l.length],shape:`square`})).sort((e,t)=>t.value-e.value).map((e,t)=>{let n=e.value/U.value.map(e=>e.value).reduce((e,t)=>e+t,0);return{...e,proportion:n,isSegregated:k.value.includes(e.id),segregate:()=>Cr(e),opacity:k.value.includes(e.id)?.5:1,display:`${e.name}${I.value.showPercentage||I.value.showValue?`: `:``}${I.value.showValue?ne(L.value.formatter,e.value,a({p:L.value.prefix,v:e.value,s:L.value.suffix,r:I.value.roundingValue}),{datapoint:e}):``}${I.value.showPercentage?k.value.includes(e.id)?`${I.value.showValue?` (`:``}- %${I.value.showValue?`)`:``}`:`${I.value.showValue?` (`:``}${isNaN(e.value/Un.value)?`-`:(e.value/Un.value*100).toFixed(I.value.roundingPercentage)}%${I.value.showValue?`)`:``}`:``}`}})),br=p(()=>({cy:`treemap-div-legend`,backgroundColor:I.value.backgroundColor,color:I.value.color,fontSize:I.value.fontSize,paddingBottom:12,fontWeight:I.value.bold?`bold`:``})),xr=p(()=>k.value.length===yr.value.length);function Sr(){k.value.length?k.value=[]:yr.value.forEach(e=>{k.value.push(e.id)}),D(`selectLegend`,U.value.filter(e=>!k.value.includes(e.id)))}function Cr(e){Z.value=null,k.value.includes(e.id)?k.value=k.value.filter(t=>t!==e.id):k.value.length<E.dataset.length-1&&k.value.push(e.id),D(`selectLegend`,U.value.filter(e=>!k.value.includes(e.id)))}function wr(e){return U.value.length?U.value.find(t=>t.name===e)||(Bn.value&&console.warn(`VueUiTreemap - Series name not found "${e}"`),null):(Bn.value&&console.warn(`VueUiTreemap - There are no series to show.`),null)}function Tr(e){let t=wr(e);t!==null&&k.value.includes(t.id)&&Cr({id:t.id})}function Er(e){let t=wr(e);t!==null&&(k.value.includes(t.id)||Cr({id:t.id}))}function Dr({datapoint:e,seriesIndex:t}){Z.value=null,Kt.value=!1,M.value=null,dn.value=`pointer`,N.value.events.datapointLeave&&N.value.events.datapointLeave({datapoint:e,seriesIndex:t})}let Or=x(null);function kr({datapoint:e,seriesIndex:t,triggerMode:n=`pointer`}){if(xr.value||n===`pointer`&&zr.value)return;N.value.events.datapointEnter&&N.value.events.datapointEnter({datapoint:e,seriesIndex:t}),M.value=t,dn.value=n,Z.value=e,Or.value={datapoint:e,seriesIndex:t,config:N.value,series:Hn.value};let r=F.value.customFormat;if(s(r)&&ae(()=>r({seriesIndex:t,datapoint:e,series:Hn.value,config:N.value})))qt.value=r({seriesIndex:t,datapoint:e,series:Hn.value,config:N.value});else{let n=``;n+=`<div style="width:100%;text-align:center;border-bottom:1px solid ${F.value.borderColor};padding-bottom:6px;margin-bottom:3px;">${e.name}</div>`,n+=`<div style="display:flex;flex-direction:row;gap:6px;align-items:center;"><svg viewBox="0 0 12 12" height="14" width="14"><rect x="0" y="0" height="12" width="12" stroke="none" fill="${e.color}"/></svg>`,n+=`<b>${ne(L.value.formatter,e.value,a({p:L.value.prefix,v:e.value,s:L.value.suffix,r:F.value.roundingValue}),{datapoint:e,seriesIndex:t})}</b>`,qt.value=`<div>${n}</div>`}Kt.value=!0}let Q=p(()=>({head:G.value.map(e=>({name:e.name,color:e.color})),body:G.value.map(e=>e.value)}));function Ar(e=null){Ge(()=>{let t=Q.value.head.map((e,t)=>[[e.name],[Q.value.body[t]],[isNaN(Q.value.body[t]/Un.value)?`-`:Q.value.body[t]/Un.value*100]]),n=[[z.value.title.text],[z.value.title.subtitle.text],[[``],[`val`],[`%`]]].concat(t),r=o(n);e?e(r):ie({csvContent:r,title:z.value.title.text||`vue-ui-treemap`})})}let jr=p(()=>{let e=[N.value.table.columnNames.series,N.value.table.columnNames.value,N.value.table.columnNames.percentage],t=Q.value.head.map((e,t)=>{let n=ne(L.value.formatter,Q.value.body[t],a({p:L.value.prefix,v:Q.value.body[t],s:L.value.suffix,r:N.value.table.td.roundingValue}));return[{color:e.color,name:e.name,shape:`square`},n,isNaN(Q.value.body[t]/Un.value)?`-`:a({v:Q.value.body[t]/Un.value*100,s:`%`,r:N.value.table.td.roundingPercentage})]}),n={th:{backgroundColor:N.value.table.th.backgroundColor,color:N.value.table.th.color,outline:N.value.table.th.outline},td:{backgroundColor:N.value.table.td.backgroundColor,color:N.value.table.td.color,outline:N.value.table.td.outline},breakpoint:N.value.table.responsiveBreakpoint};return{colNames:[N.value.table.columnNames.series,N.value.table.columnNames.value],head:e,body:t,config:n}});function Mr(){return G.value}function Nr(){V.value.showTable=!V.value.showTable}function Pr(){V.value.showTooltip=!V.value.showTooltip}function Fr(){V.value.showZoom=!V.value.showZoom}let Ir=x(!1);function Lr(){Ir.value=!Ir.value}let Rr=p(()=>!Ir.value&&V.value.showZoom),zr=x(null),Br=x(!1),{viewBox:$,resetZoom:Vr,isZoom:Hr,setInitialViewBox:Ur,scale:Wr}=Ie(xn,{x:J.value.x,y:J.value.y,width:Math.max(10,J.value.width),height:Math.max(10,J.value.height)},1,Rr),Gr=p(()=>1/Wr.value),Kr=p(()=>Math.min(1,L.value.fontSizeZoomFactor/Math.max(Wr.value,1e-4))),qr=p(()=>`scale(${Kr.value})`),Jr=p(()=>V.value.showZoom||Hr.value);nt([()=>J.value.x,()=>J.value.y,()=>J.value.width,()=>J.value.height],()=>{Ge(()=>{Ur({x:J.value.x,y:J.value.y,width:Math.max(10,J.value.width),height:Math.max(10,J.value.height)})})},{immediate:!0});function Yr(e){Rr.value&&(e.button===void 0||e.button===0)&&(zr.value={x:e.clientX,y:e.clientY},Br.value=!1)}function Xr(e){if(!Rr.value||!zr.value)return;let t=e.clientX-zr.value.x,n=e.clientY-zr.value.y;Math.hypot(t,n)>Wt&&(Br.value=!0)}function Zr(){zr.value=null,Br.value&&window.setTimeout(()=>{Br.value=!1},0)}function Qr(e,t){Br.value||_r(e,t)}let $r=x(null);function ei(e){$r.value=e}function ti(){$r.value=null}let ni=ge(A,()=>z.value.title.text),ri=p(()=>xe({config:N,style:z,mutableConfig:V,dialog:pt,accordion:ct,isFullscreen:Jt,parent:A,maxWidth:800,isCursorPointer:B}));nt(()=>V.value.showTable,e=>be(e,N,on));function ii(){V.value.showTable=!1,sn.value&&sn.value.setTableIconState(!1)}let ai=p(()=>yr.value.map(e=>({...e,name:e.display}))),oi=p(()=>z.value.backgroundColor),si=p(()=>z.value.title),{isCallbackImaging:ci,isCallbackSvg:li,generateSvg:ui,onGenerateImage:di}=ye({svg:xn,title:si,legend:I,legendItems:ai,backgroundColor:oi,getSvgCallback:()=>N.value.userOptions.callbacks.svg,generateImage:Dn});function fi(e,t){let n=lr(e,t),{paddingX:r,paddingTop:i}=rr(n);return{fontSize:n,paddingX:r,paddingTop:i,lineHeight:n*1.1}}function pi(e){return oe(e.color??z.value.backgroundColor)}function mi({availableHeight:e,lineHeight:t,lineIndex:n}){if(n===0)return 1/0;let r=e/(n+1);return r<1e-4?-1/0:t<=0?1/0:r/t}function hi(){return Number(L.value.hideUnderProportion)===0}function gi(e){let t=Kr.value;return e.alwaysShowAllLines?`scale(${Math.min(t,e.allLinesScaleCap)})`:qr.value}function _i({rect:e,seriesIndex:t}){if(!e||!L.value.showDefaultLabels||!Zn(e))return null;let{fontSize:n,paddingX:r,paddingTop:i,lineHeight:a}=fi(e,t),o=pi(e),s=or(e,t).map(e=>String(e??``)),c=ir(e,n);if(!s.some(Boolean)||c.width<=0||c.height<=0)return null;let l=hi(),u=l?Math.max(1e-4,Math.min(1,c.height/Math.max(s.length*a,1e-4))):1,d=`treemap_clip_${O.value}_${e.id}`,f=e.x0,ee=e.y0,te=Math.max(q(e),0),ne=Math.max(K(e),0);return{key:vi(e),clipId:d,clipX:f,clipY:ee,clipWidth:te,clipHeight:ne,translate:`translate(${e.x0}, ${e.y0})`,alwaysShowAllLines:l,allLinesScaleCap:u,lines:s.map((t,s)=>({key:`${e.id}_${s}`,text:t,x:r,y:i+a*s,maxZoomFactor:mi({availableHeight:c.height,lineHeight:a,lineIndex:s}),fill:o,fontSize:n,fontFamily:N.value.style.fontFamily,fontWeight:s===0?500:400}))}}function vi(e){return`${e.id}`}let yi=p(()=>ht.rect||hn.value||!L.value.showDefaultLabels||xr.value?[]:G.value.map((e,t)=>e.showLabel?_i({rect:e,seriesIndex:t}):null).filter(Boolean)),bi;function xi(){return typeof document>`u`?null:(bi||=document.createElement(`canvas`),bi.getContext(`2d`))}function Si(e,t,n=400){let r=xi();return r?(r.font=`${n} ${t}px ${N.value.style.fontFamily}`,r.measureText(String(e)).width):e.length*t*.6}function Ci(e){let t=R.value.rects.borderRadius,n=q(e),r=K(e);return Math.min(t,Math.min(n,r)/6)}async function wi(){D(`copyAlt`,{config:N.value,dataset:G.value}),N.value.userOptions.callbacks.altCopy?await Promise.resolve(N.value.userOptions.callbacks.altCopy({config:N.value,dataset:G.value})):console.warn("Vue Data UI - A callback must be set for `altCopy` in userOptions.")}function Ti(){M.value=null,fn.value=!0}function Ei(){M.value=null,dn.value=`pointer`,Kt.value=!1,Z.value=null,fn.value=!1}function Di(e){if(!xn.value||Ir.value||document.activeElement!==xn.value||!G.value.length||xr.value)return;let t=[`ArrowLeft`,`ArrowUp`].includes(e.key),n=[`ArrowRight`,`ArrowDown`].includes(e.key),r=e.key===`Enter`||e.key===` `,i=e.key===`Escape`;if(!t&&!n&&!r&&!i)return;if(e.preventDefault(),e.stopPropagation(),i){M.value=null,dn.value=`pointer`,Kt.value=!1,Z.value=null;return}if(r){if(M.value===null)return;let e=G.value[M.value];if(!e)return;_r(e,M.value);return}let a=M.value,o=Z.value?G.value.findIndex(e=>e.id===Z.value.id):null,s=a!==null&&a>=0&&a<G.value.length,c=o!==null&&o>=0&&o<G.value.length;s?n?(a+=1,a>=G.value.length&&(a=0)):t&&(--a,a<0&&(a=G.value.length-1)):c?(a=n?o+1:o-1,a>=G.value.length&&(a=0),a<0&&(a=G.value.length-1)):a=n?0:G.value.length-1;let l=G.value[a];l&&(Oi(a),kr({datapoint:l,seriesIndex:a,triggerMode:`keyboard`}))}function Oi(e){if(!Number.isFinite(e)||!xn.value)return;let t=G.value[e];if(!t)return;let n=t.x0+q(t)/2,r=t.y0+K(t)/2,i=xn.value.getBoundingClientRect();un.value={x:i.left+(n-$.value.x)/$.value.width*i.width,y:i.top+(r-$.value.y)/$.value.height*i.height}}let ki=p(()=>({headers:jr.value?.colNames??[],rows:jr.value?.body??[]})),Ai=p(()=>z.value.color);me({getData:Mr,getImage:ni,generateCsv:Ar,generateImage:Dn,generateSvg:ui,generatePdf:En,hideSeries:Er,showSeries:Tr,toggleTable:Nr,toggleTooltip:Pr,toggleZoom:Fr,toggleAnnotator:Lr,toggleFullscreen:ur,resetZoom:Vr,copyAlt:wi});let ji=p(()=>Pe(N.value.userOptions?.annotator?.followZoom,$.value));return(e,i)=>(b(),g(`div`,{ref_key:`treemapChart`,ref:A,class:Ke(`vue-data-ui-component vue-ui-treemap ${Jt.value?`vue-data-ui-wrapper-fullscreen`:``} ${N.value.useCssAnimation?``:`vue-ui-dna`}`),style:qe(`font-family:${N.value.style.fontFamily};width:100%; ${N.value.responsive?`height: 100%;`:``} text-align:center;background:${z.value.backgroundColor}`),id:`treemap_${O.value}`,onMouseenter:i[3]||=()=>w(yn)(!0),onMouseleave:i[4]||=()=>w(yn)(!1)},[_(`div`,{id:`chart-instructions-${O.value}`,class:`sr-only`},[_(`p`,null,Qe(N.value.a11y.translations.keyboardNavigation),1)],8,vt),ki.value?.rows?.length?(b(),m(je,{key:0,uid:O.value,head:ki.value.headers,body:ki.value.rows,notice:N.value.a11y.translations.tableAvailable,caption:N.value.a11y.translations.tableCaption},null,8,[`uid`,`head`,`body`,`notice`,`caption`])):h(``,!0),P.value.buttons.annotator?(b(),m(w(st),We({key:1},w(n)(P.value.annotator),{svgRef:w(xn),followZoom:N.value.userOptions?.annotator?.followZoom,annotationViewport:ji.value,backgroundColor:z.value.backgroundColor,color:z.value.color,active:Ir.value,isCursorPointer:B.value,palette:P.value.annotatorPalette,onClose:Lr}),Be({_:2},[Xe(w(r),n=>({name:n,fn:T(r=>[S(e.$slots,n,y(v(w(t)(n,r))),void 0,!0)])}))]),1040,[`svgRef`,`followZoom`,`annotationViewport`,`backgroundColor`,`color`,`active`,`isCursorPointer`,`palette`])):h(``,!0),On.value?(b(),g(`div`,{key:2,ref_key:`noTitle`,ref:$t,class:`vue-data-ui-no-title-space`,style:`height:36px; width: 100%;background:transparent`},null,512)):h(``,!0),z.value.title.text?(b(),g(`div`,{key:3,ref_key:`chartTitle`,ref:Xt,style:qe(`width:100%;background:${z.value.backgroundColor};padding-bottom:6px`)},[(b(),m(ve,{key:`title_${en.value}`,config:{title:{cy:`treemap-div-title`,...z.value.title},subtitle:{cy:`treemap-div-subtitle`,...z.value.title.subtitle}}},null,8,[`config`]))],4)):h(``,!0),_(`div`,{id:`legend-top-${O.value}`},null,8,yt),P.value.show&&gt.value&&(w(bn)||w(vn))?(b(),m(w(dt),We({ref_key:`userOptionsRef`,ref:sn,key:`user_option_${Yt.value}`,backgroundColor:z.value.backgroundColor,color:z.value.color,isPrinting:w(wn),isImaging:w(Tn),uid:O.value,hasTooltip:P.value.buttons.tooltip&&F.value.show,isFullscreen:Jt.value,isTooltip:V.value.showTooltip,chartElement:A.value},w(Ce)(P.value,`pdf csv img svg table fullscreen altCopy annotator zoom`),{isAnnotation:Ir.value,tableDialog:N.value.table.useDialog,isCursorPointer:B.value,isZoom:V.value.showZoom,onToggleFullscreen:ur,onGeneratePdf:w(En),onGenerateCsv:Ar,onGenerateImage:w(di),onGenerateSvg:w(ui),onToggleTable:Nr,onToggleTooltip:Pr,onToggleAnnotator:Lr,onToggleZoom:Fr,onCopyAlt:wi,style:{visibility:w(bn)?w(vn)?`visible`:`hidden`:`visible`}}),Be({_:2},[Xe(w(Se)(e.$slots,`menuIcon optionTooltip optionPdf optionCsv optionImg optionSvg optionTable optionFullscreen optionAnnotator optionZoom optionAltCopy custom-menu-before custom-menu-after`),t=>({name:t,fn:T(n=>[S(e.$slots,t,y(v(w(we)(t,n))),void 0,!0)])}))]),1040,[`backgroundColor`,`color`,`isPrinting`,`isImaging`,`uid`,`hasTooltip`,`isFullscreen`,`isTooltip`,`chartElement`,`isAnnotation`,`tableDialog`,`isCursorPointer`,`isZoom`,`onGeneratePdf`,`onGenerateImage`,`onGenerateSvg`,`style`])):h(``,!0),X.value.length>1?(b(),g(`nav`,{key:5,class:`vue-ui-treemap-breadcrumbs`,"data-dom-to-png-ignore":``,ref_key:`breadcrumbsNav`,ref:rn},[(b(!0),g(Re,null,Xe(X.value,(t,n)=>(b(),g(`span`,{role:`button`,tabindex:n<X.value.length-1?0:void 0,key:t.id||`root`,onClick:e=>n===X.value.length-1?()=>{}:_r(t.node),onKeydown:[rt(it(e=>n===X.value.length-1?void 0:_r(t.node),[`prevent`]),[`enter`]),rt(it(e=>n===X.value.length-1?void 0:_r(t.node),[`prevent`]),[`space`])],class:`vue-ui-treemap-crumb`,"data-last-crumb":n===X.value.length-1,style:qe({color:z.value.color,cursor:B.value?`pointer`:`default`}),onMouseenter:e=>ei(n),onMouseleave:ti,onFocus:e=>ei(n),onBlur:ti},[_(`span`,xt,[_(`span`,St,[S(e.$slots,`breadcrumb-label`,We({ref_for:!0},{crumb:t,isRoot:n===0,isFocus:$r.value===n}),()=>[n===0?(b(),g(`div`,Ct,[He(_e,{name:$r.value===0?`homeFilled`:`home`,stroke:z.value.color},null,8,[`name`,`stroke`])])):(b(),g(Re,{key:1},[Ve(Qe(t.label),1)],64))],!0)]),n<X.value.length-1?(b(),g(`span`,wt,[S(e.$slots,`breadcrumb-arrow`,{},()=>[i[5]||=Ve(` › `,-1)],!0)])):h(``,!0)])],44,bt))),128))],512)):h(``,!0),_(`div`,Tt,[(b(),g(`svg`,{ref_key:`svgRef`,ref:xn,xmlns:w(se),"aria-describedby":`chart-instructions-${O.value}`,class:Ke({"vue-data-ui-fullscreen--on":Jt.value,"vue-data-ui-fulscreen--off":!Jt.value,"vue-data-ui-zoom-plus":!fr.value,"vue-data-ui-zoom-minus":fr.value,"vue-data-ui-no-transition":!w(pn),loading:w(hn)}),viewBox:`${w($).x} ${w($).y} ${w($).width<=0?10:w($).width} ${w($).height<=0?10:w($).height}`,style:qe(`max-width:100%; overflow:${Jr.value?`hidden`:`visible`}; background:transparent;color:${z.value.color}`),tabindex:`0`,onFocus:Ti,onBlur:Ei,onKeydown:Di,onPointerdown:Yr,onPointermove:Xr,onPointerup:Zr,onPointercancel:Zr,onPointerleave:Zr},[He(w(ft)),S(e.$slots,`svg-underlayer`,y(v({svg:H.value,isZoom:fr.value,rect:Z.value,config:N.value,isPrintingImg:w(wn)||w(Tn)||w(ci),isPrintingSvg:w(li)})),void 0,!0),(b(!0),g(Re,null,Xe(G.value,(e,t)=>(b(),g(`g`,{key:`tgrad_${e.id}`},[R.value.rects.gradient.show?(b(),g(`defs`,Dt,[He(ke,{t:`radial`,id:`tgrad_${e.id}`,gradientTransform:`translate(-1, -1.000001) scale(2, 2)`,stops:[[`18%`,e.color,1],[`100%`,w(c)(e.color,R.value.rects.gradient.intensity/100),1]]},null,8,[`id`,`stops`])])):h(``,!0)]))),128)),_(`g`,null,[(b(!0),g(Re,null,Xe(G.value,(e,t)=>(b(),g(`g`,{key:`rect_${e.id}_${e.depth}`},[_(`rect`,{x:e.x0,y:e.y0,height:K(e),width:q(e),fill:Gt.value?e.color??z.value.backgroundColor:R.value.rects.gradient.show?xr.value?z.value.backgroundColor:`url(#tgrad_${e.id})`:e.color??z.value.backgroundColor,rx:w(Wr)>1?Ci(e)*Gr.value:Ci(e),stroke:Z.value&&Z.value.id===e.id?R.value.rects.selected.stroke:R.value.rects.stroke,"stroke-width":tr(e),onClick:it(n=>Qr(e,t),[`stop`]),onMouseenter:()=>kr({datapoint:e,seriesIndex:t,triggerMode:`pointer`}),onMouseleave:n=>Dr({datapoint:e,seriesIndex:t}),style:qe(`opacity:${Z.value?Z.value.id===e.id?1:R.value.rects.selected.unselectedOpacity:1}`),class:Ke([`vue-ui-treemap-rect`,w(pn)?`vue-data-ui-transition`:``,vr(e)?`vue-data-ui-zoom-minus`:`vue-data-ui-zoom-plus`])},null,46,Ot)]))),128)),(b(!0),g(Re,null,Xe(yi.value,e=>(b(),g(`g`,{key:e.key,style:{"pointer-events":`none`}},[_(`defs`,null,[_(`clipPath`,{id:e.clipId,clipPathUnits:`userSpaceOnUse`},[_(`rect`,{class:Ke({"vue-data-ui-transition":w(pn)}),x:e.clipX,y:e.clipY,width:e.clipWidth,height:e.clipHeight},null,10,At)],8,kt)]),_(`g`,{"clip-path":`url(#${e.clipId})`},[_(`g`,{transform:e.translate},[_(`g`,{class:Ke({"vue-data-ui-transition":w(pn)}),transform:gi(e)},[(b(!0),g(Re,null,Xe(e.lines,t=>(b(),g(Re,{key:t.key},[t.text&&(e.alwaysShowAllLines||Kr.value<=t.maxZoomFactor)?(b(),g(`text`,{key:0,x:t.x,y:t.y,fill:t.fill,"font-size":t.fontSize,"font-family":t.fontFamily,"font-weight":t.fontWeight,class:Ke({"vue-data-ui-transition":w(pn)}),"text-anchor":`start`,"dominant-baseline":`text-before-edge`},Qe(t.text),11,Pt)):h(``,!0)],64))),128))],10,Nt)],8,Mt)],8,jt)]))),128)),e.$slots.rect?(b(),g(`g`,Ft,[(b(!0),g(Re,null,Xe(G.value,(t,n)=>(b(),g(`g`,{key:`slot_${t.id}_${t.depth}`},[(b(),g(`foreignObject`,{x:t.x0,y:t.y0,height:K(t),width:q(t),class:`vue-ui-treemap-cell-foreignObject`,style:{"pointer-events":`none`,overflow:`hidden`}},[_(`div`,Lt,[w(hn)?h(``,!0):S(e.$slots,`rect`,We({ref_for:!0},{rect:{...t,height:K(t),width:q(t),isSelected:!Z.value||Z.value.id===t.id},shouldShow:Qn(t)||fr.value,fontSize:lr(t,n),isZoom:fr.value,textColor:w(oe)(t.color)}),void 0,!0,0)])],8,It))]))),128))])):h(``,!0)]),S(e.$slots,`svg`,y(v({svg:H.value,isZoom:fr.value,rect:Z.value,config:N.value,isPrintingImg:w(wn)||w(Tn)||w(ci),isPrintingSvg:w(li)})),void 0,!0)],46,Et)),w(Hr)?(b(),g(`div`,Rt,[S(e.$slots,`reset-action`,{reset:w(Vr)},()=>[_(`button`,{"data-cy-reset":``,tabindex:`0`,role:`button`,class:`vue-data-ui-refresh-button`,style:qe({background:z.value.backgroundColor,cursor:B.value?`pointer`:`default`}),onClick:i[0]||=e=>w(Vr)(!0)},[He(_e,{name:`refresh`,stroke:z.value.color},null,8,[`stroke`])],4)],!0)])):h(``,!0),e.$slots.hint?(b(),g(`div`,zt,[S(e.$slots,`hint`,y(v({hint:N.value.a11y.translations.keyboardNavigation,isVisible:fn.value})),void 0,!0)])):h(``,!0)]),e.$slots.watermark?(b(),g(`div`,Bt,[S(e.$slots,`watermark`,y(v({isPrinting:w(wn)||w(Tn)||w(ci)||w(li)})),void 0,!0)])):h(``,!0),_(`div`,{id:`legend-bottom-${O.value}`},null,8,Vt),an.value&&(I.value.show||e.$slots.legend)?(b(),m(ze,{key:7,to:I.value.position===`top`?`#legend-top-${O.value}`:`#legend-bottom-${O.value}`},[_(`div`,{ref_key:`chartLegend`,ref:Zt},[S(e.$slots,`legend`,{legend:yr.value},()=>[I.value.show?(b(),m(Fe,{key:`legend_${nn.value}`,legendSet:yr.value,config:br.value,id:`treemap_legend_${O.value}`,isCursorPointer:B.value,onClickMarker:i[1]||=({legend:e})=>Cr(e)},{item:T(({legend:e,index:t})=>[w(hn)?h(``,!0):(b(),g(`div`,{key:0,onClick:t=>Cr(e),style:qe(`opacity:${k.value.includes(e.id)?.5:1}`)},Qe(e.display),13,Ht))]),legendToggle:T(()=>[yr.value.length>2&&I.value.selectAllToggle.show&&!w(hn)?(b(),m(Ae,{key:0,backgroundColor:I.value.selectAllToggle.backgroundColor,color:I.value.selectAllToggle.color,fontSize:I.value.fontSize,checked:k.value.length>0,isCursorPointer:B.value,onToggle:Sr},null,8,[`backgroundColor`,`color`,`fontSize`,`checked`,`isCursorPointer`])):h(``,!0)]),_:1},8,[`legendSet`,`config`,`id`,`isCursorPointer`])):h(``,!0)],!0)],512)],8,[`to`])):h(``,!0),e.$slots.source?(b(),g(`div`,{key:8,ref_key:`source`,ref:Qt,dir:`auto`},[S(e.$slots,`source`,{},void 0,!0)],512)):h(``,!0),He(w(ut),{teleportTo:F.value.teleportTo,show:V.value.showTooltip&&Kt.value,backgroundColor:F.value.backgroundColor,color:F.value.color,fontSize:F.value.fontSize,borderRadius:F.value.borderRadius,borderColor:F.value.borderColor,borderWidth:F.value.borderWidth,backgroundOpacity:F.value.backgroundOpacity,position:F.value.position,offsetX:F.value.offsetX,offsetY:F.value.offsetY,parent:A.value,content:qt.value,isFullscreen:Jt.value,isCustom:w(s)(F.value.customFormat),smooth:F.value.smooth,backdropFilter:F.value.backdropFilter,smoothForce:F.value.smoothForce,smoothSnapThreshold:F.value.smoothSnapThreshold,isA11yMode:dn.value===`keyboard`,a11yPosition:un.value},{"tooltip-before":T(()=>[S(e.$slots,`tooltip-before`,y(v({...Or.value})),void 0,!0)]),tooltip:T(()=>[S(e.$slots,`tooltip`,y(v({...Or.value})),void 0,!0)]),"tooltip-after":T(()=>[S(e.$slots,`tooltip-after`,y(v({...Or.value})),void 0,!0)]),_:3},8,[`teleportTo`,`show`,`backgroundColor`,`color`,`fontSize`,`borderRadius`,`borderColor`,`borderWidth`,`backgroundOpacity`,`position`,`offsetX`,`offsetY`,`parent`,`content`,`isFullscreen`,`isCustom`,`smooth`,`backdropFilter`,`smoothForce`,`smoothSnapThreshold`,`isA11yMode`,`a11yPosition`]),gt.value&&P.value.buttons.table?(b(),m(Ze(ri.value.component),We({key:9},ri.value.props,{ref_key:`tableUnit`,ref:on,onClose:ii}),Be({content:T(()=>[(b(),m(w(ot),{key:`table_${tn.value}`,colNames:jr.value.colNames,head:jr.value.head,body:jr.value.body,config:jr.value.config,title:N.value.table.useDialog?``:ri.value.title,withCloseButton:!N.value.table.useDialog,isCursorPointer:B.value,onClose:ii},{th:T(({th:e})=>[_(`div`,Ut,Qe(e),1)]),td:T(({td:e})=>[Ve(Qe(e.name||e),1)]),_:1},8,[`colNames`,`head`,`body`,`config`,`title`,`withCloseButton`,`isCursorPointer`]))]),_:2},[N.value.table.useDialog?{name:`title`,fn:T(()=>[Ve(Qe(ri.value.title),1)]),key:`0`}:void 0,N.value.table.useDialog?{name:`actions`,fn:T(()=>[_(`button`,{tabindex:`0`,class:`vue-ui-user-options-button`,onClick:i[2]||=e=>Ar(P.value.callbacks.csv),style:qe({cursor:B.value?`pointer`:`default`})},[He(_e,{name:`fileCsv`,stroke:ri.value.props.color},null,8,[`stroke`])],4)]),key:`1`}:void 0]),1040)):h(``,!0),S(e.$slots,`skeleton`,{},()=>[w(hn)?(b(),m(de,{key:0})):h(``,!0)],!0)],46,_t))}},[[`__scopeId`,`data-v-5a29df3b`]]);export{gt as n,Gt 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,Dt as s,Ht as c,Jt as l,S as ee,X as te,Yt as ne,Zt as re,at as ie,i as ae,in as oe,n as se,nt as ce,pt as le,r as ue,t as de,w as fe,yt as pe,zt as me}from"./lib-rPeBMZrn.js";import{n as he,t as ge}from"./BaseScanner-8NdoBs7B.js";import{n as _e,t as ve}from"./useHints-C-TwxM0Y.js";import{t as ye}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{n as be}from"./resolveChartConfig-CIhClE5R.js";import{t as xe}from"./chartImage-DPGnEuYM.js";import{n as Se}from"./Title-BliHuXfT.js";import{t as Ce}from"./useChartExport-BZts4KFb.js";import{n as we,t as Te}from"./tableIntegration-CNoJ1CIY.js";import{n as Ee,r as De,t as Oe}from"./userOptionsSlots-CWtXN5Q6.js";import{t as ke}from"./usePrinter-DVf3YcG5.js";import{t as Ae}from"./useTransitions-ChGGrtrv.js";import{t as je}from"./Shape-CRe8woTu.js";import{c as Me}from"./canvas-lib-22VpOI4_.js";import{t as Ne}from"./useResponsive-CENUxfEL.js";import{t as Pe}from"./DefGrad-DKMq1REY.js";import{t as Fe}from"./BaseLegendToggle-BIzyyI1h.js";import{t as Ie}from"./A11yDataTable-DWNlWXzs.js";import{t as Le}from"./useUserOptionState-CXlFnwPv.js";import{t as Re}from"./useChartAccessibility-DOMuYJfm.js";import{t as ze}from"./labelUtils-CdtU-yB_.js";import{t as Be}from"./Legend-DM0ClX3D.js";import{t as Ve}from"./usePrefersMotion-XLHwega2.js";import{t as He}from"./vue_ui_waffle-BbBLSluB.js";import{Fragment as u,Teleport as Ue,computed as d,createBlock as f,createCommentVNode as p,createElementBlock as m,createElementVNode as h,createSlots as We,createTextVNode as Ge,createVNode as Ke,defineAsyncComponent as g,guardReactiveProps as qe,mergeProps as Je,nextTick as Ye,normalizeClass as _,normalizeProps as Xe,normalizeStyle as v,onBeforeUnmount as Ze,onMounted as Qe,openBlock as y,ref as b,renderList as x,renderSlot as S,resolveDynamicComponent as $e,shallowRef as et,toDisplayString as tt,toRefs as nt,unref as C,useSlots as rt,watch as it,withCtx as w}from"vue";var at=/* @__PURE__ */ e({default:()=>Nt}),ot=[`id`],st=[`id`],ct=[`id`],lt={style:{position:`relative`}},ut=[`xmlns`,`aria-describedby`,`viewBox`],dt=[`id`],ft=[`x`,`y`,`height`,`width`],pt=[`height`,`width`],mt={key:0},ht=[`d`,`stroke`,`stroke-width`,`filter`],gt=[`d`,`fill`,`stroke`,`stroke-width`,`filter`],_t={key:0},vt=[`d`,`fill`,`filter`],yt=[`rx`,`x`,`y`,`height`,`width`,`stroke`,`stroke-width`,`filter`],bt=[`rx`,`x`,`y`,`height`,`width`,`fill`,`stroke`,`stroke-width`,`filter`],xt={key:0},St=[`rx`,`x`,`y`,`height`,`width`,`fill`,`filter`],Ct=[`points`,`stroke`,`stroke-width`,`stroke-linejoin`],wt=[`textContent`,`x`,`y`,`font-size`,`fill`,`filter`],Tt=[`d`,`onMouseover`,`onMouseleave`,`onClick`],Et=[`x`,`y`,`height`,`width`,`onMouseover`,`onMouseleave`,`onClick`],Dt={key:0,style:{position:`absolute`,top:`100%`,left:`0`,width:`100%`},"data-dom-to-png-ignore":``,"aria-hidden":`true`},Ot={key:5,class:`vue-data-ui-watermark`},kt=[`id`],At=[`onClick`],jt={key:0},Mt={key:1},Nt=/*#__PURE__*/ ye({__name:`vue-ui-waffle`,props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:[`selectLegend`,`copyAlt`],setup(e,{expose:ye,emit:at}){let Nt=g(()=>import(`./Tooltip-C1q0Qoh7.js`)),Pt=g(()=>import(`./BaseIcon-CoY0vuL3.js`).then(e=>e.n)),Ft=g(()=>import(`./DataTable-Dof6yhO7.js`)),It=g(()=>import(`./vue-ui-accordion-E8TJfFeK.js`).then(e=>e.n)),Lt=g(()=>import(`./UserOptions-B9EyfU9n.js`).then(e=>e.n)),Rt=g(()=>import(`./PenAndPaper-DoNTA-SV.js`).then(e=>e.t)),zt=g(()=>import(`./PackageVersion-DKSNC-YP.js`).then(e=>e.t)),Bt=g(()=>import(`./BaseDraggableDialog-BK7dj9O6.js`).then(e=>e.n)),{vue_ui_waffle:Vt}=i(),Ht=Ve(),T=e,Ut=rt(),Wt=d({get(){return!!T.dataset&&T.dataset.length},set(e){return e}}),E=b(te()),Gt=b(!1),Kt=b(``),D=b(null),qt=b(0),Jt=b(null),Yt=b(null),Xt=b(null),Zt=b(null),Qt=b(null),$t=b(0),en=b(0),tn=b(0),nn=b(!1),rn=b(null),an=b(null),O=b(null),on=b({x:0,y:0}),sn=b(`pointer`),cn=b(!1),k=b(vn()),A=d(()=>k.value.userOptions),j=d(()=>k.value.style.chart.tooltip),M=d(()=>k.value.style.chart.legend),N=d(()=>k.value.style.chart.layout.rect),P=d(()=>k.value.style.chart.layout.grid),F=d(()=>k.value.style.chart.layout),I=d(()=>k.value.style.chart),{transitionEnabled:L}=Ae({config:()=>k.value.transitions,dataset:()=>T.dataset});_e({config:()=>k.value,dataset:()=>T.dataset,component:`VueUiWaffle`,rules:[ve.singleSeries,ve.emptyArray,{test:e=>e.length>6,message:[`👀 The number of series is > 6. Consider:`,``,`▶️ Grouping small values dynamically into a single "Other" series.`,``,`▶️ Using filters to let users choose a maximum number of series to display.`,``,`▶️ Using VueUiHorizontalBar instead to make the dataset breakdown easier to read.`]}]});let ln=d(()=>k.value.userOptions.useCursorPointer),un=d(()=>oe({defaultConfig:{useCustomCells:!1,userOptions:{show:!1},table:{show:!1},style:{chart:{backgroundColor:`#99999930`,layout:{labels:{captions:{show:!1}},rect:{stroke:`#999999`}},legend:{backgroundColor:`transparent`,showValue:!1,showPercentage:!1}}}},userConfig:k.value.skeletonConfig??{}})),{loading:dn,FINAL_DATASET:fn,manualLoading:pn}=he({...nt(T),FINAL_CONFIG:k,prepareConfig:vn,callback:()=>{Promise.resolve().then(async()=>{W.value=Nn()})},skeletonDataset:T.config?.skeletonDataset??[{name:``,values:[1],color:`#AAAAAA`},{name:``,values:[1],color:`#BABABA`},{name:``,values:[1],color:`#CACACA`}],skeletonConfig:oe({defaultConfig:k.value,userConfig:un.value})}),{userOptionsVisible:mn,setUserOptionsVisibility:hn,keepUserOptionState:gn}=Le({config:k.value}),{svgRef:_n}=Re({config:I.value.title});function vn(){return be(T.config,Vt,He)}let yn=re(T.config);it(()=>T.config,(e,t)=>{let n=re(e),r=n!==yn;yn=n;let i=vn();r?(dn.value||(k.value=i),mn.value=!k.value.userOptions.showOnChartHover,Sn(),$t.value+=1,en.value+=1,tn.value+=1,z.value.showTable=k.value.table.show,z.value.showTooltip=j.value.show):(k.value.style.chart.tooltip=i.style.chart.tooltip,z.value.showTooltip=k.value.style.chart.tooltip.show)},{deep:!0});let R=et(null),bn=et(null),xn=d(()=>k.value.debug);function Sn(){if(me(T.dataset)?(ie({componentName:`VueUiWaffle`,type:`dataset`,debug:xn.value}),Wt.value=!1,pn.value=!0):xn.value&&T.dataset.forEach((e,t)=>{pe({datasetObject:e,requiredAttributes:[`name`,`values`]}).forEach(e=>{ie({componentName:`VueUiWaffle`,type:`datasetSerieAttribute`,property:e,index:t})})}),me(T.dataset)||(pn.value=k.value.loading),k.value.responsive){let e=Me(()=>{let{width:e,height:t}=Ne({chart:Jt.value,title:I.value.title.text?Yt.value:null,legend:M.value.show?Xt.value:null,source:Zt.value,noTitle:Qt.value});requestAnimationFrame(()=>{B.value.width=e,B.value.height=t,V.value.width=e,V.value.height=t})});R.value&&(bn.value&&R.value.unobserve(bn.value),R.value.disconnect()),R.value=new ResizeObserver(e),bn.value=Jt.value.parentNode,R.value.observe(bn.value)}}Qe(()=>{nn.value=!0,Sn()}),Ze(()=>{R.value&&(bn.value&&R.value.unobserve(bn.value),R.value.disconnect())});let{isPrinting:Cn,isImaging:wn,generatePdf:Tn,generateImage:En}=ke({elementId:`vue-ui-waffle_${E.value}`,fileName:I.value.title.text||`vue-ui-waffle`,options:k.value.userOptions.print}),Dn=d(()=>k.value.userOptions.show&&!I.value.title.text),On=d(()=>fe(k.value.customPalette)),z=b({showTable:k.value.table.show,showTooltip:j.value.show});it(k,()=>{z.value={showTable:k.value.table.show,showTooltip:j.value.show}},{immediate:!0});let B=b({height:512,width:512}),V=b({top:0,left:0,height:512,width:512}),H=d(()=>(V.value.width-P.value.size*P.value.spaceBetween)/P.value.size),U=d(()=>(V.value.height-P.value.size*P.value.spaceBetween)/P.value.size),kn=d(()=>Math.max(1e-4,V.value.width/P.value.size)),An=d(()=>Math.max(1e-4,V.value.height/P.value.size));function jn(e){let t=P.value.size*P.value.size,n=e.reduce((e,t)=>e+t,0),r=e.map(e=>e/n*t),i=r.map(Math.floor),a=r.map(e=>e%1),o=t-i.reduce((e,t)=>e+t,0);for(;o>0;){let e=a.indexOf(Math.max(...a));i[e]+=1,a[e]=0,--o}return i}let Mn=b(!1);function Nn(){return Mn.value=fn.value.flatMap(e=>e.values.reduce((e,t)=>e+t,0)).reduce((e,t)=>e+t,0)===0,fn.value.map((e,t)=>({...e,color:ee(e.color)||On.value[t]||c[t]||c[t%c.length],uid:`serie_${t}`,absoluteIndex:t}))}let Pn=d(()=>Nn()),W=b(Pn.value);it(()=>T.dataset,e=>{Array.isArray(e)&&e.length>0&&(pn.value=!1)},{immediate:!0}),it(()=>T.dataset,e=>{W.value=Nn()},{deep:!0});let Fn=d(()=>jn(W.value.filter((e,t)=>!J.value.includes(e.uid)).map((e,t)=>Mn.value?1:(e.values||[]).reduce((e,t)=>e+t,0)))),In=d(()=>jn(W.value.map((e,t)=>Mn.value?1:(e.values||[]).reduce((e,t)=>e+t)))),Ln=d(()=>P.value.size**2),G=d(()=>(xn.value&&fn.value.forEach((e,t)=>{[null,void 0].includes(e.values)&&ie({componentName:`VueUiWaffle`,type:`datasetSerieAttribute`,property:`values (number[])`,index:t})}),W.value.filter((e,t)=>!J.value.includes(e.uid)).map((e,t)=>{let n=Fn.value[t];return{absoluteIndex:e.absoluteIndex,uid:e.uid,name:e.name,color:e.color,value:(e.values||[]).reduce((e,t)=>e+t,0),absoluteValues:e.values||[],squareCount:n,proportion:n/Ln.value}}))),Rn=d(()=>W.value.map((e,t)=>{let n=In.value[t];return{absoluteIndex:e.absoluteIndex,uid:e.uid,name:e.name,color:e.color,value:(e.values||[]).reduce((e,t)=>e+t,0),absoluteValues:e.values||[],squareCount:n,proportion:n/Ln.value}}));function zn(){return Rn.value.map(e=>({name:e.name,color:e.color,value:e.value,squareCount:e.squareCount,proportion:e.proportion}))}let Bn=d(()=>{let e=0;return G.value.map((t,n)=>{let r=e,i=r+t.squareCount,a=[];for(let e=Math.floor(r);e<Math.floor(i);e+=1)a.push(e);return e=i,{...t,start:r,rects:a}})}),K=d(()=>Bn.value.flatMap((e,t)=>e.rects.map((n,r)=>({isFirst:r===0,isLongEnough:n.length>2,name:e.name,color:e.color,value:e.value,serieIndex:t,absoluteStartIndex:r<3,serieId:e.uid,...e}))).map((e,t)=>({...e,isAbsoluteFirst:t%P.value.size===0}))),q=d(()=>{let e=[];for(let t=0;t<P.value.size;t+=1)for(let n=0;n<P.value.size;n+=1)e.push({isStartOfLine:n===0,position:P.value.vertical?t:n,x:(P.value.vertical?t:n)*(H.value+P.value.spaceBetween),y:(P.value.vertical?n:t)*(U.value+P.value.spaceBetween)+V.value.top});return e}),J=b([]),Vn=b(!1),Hn=b(Object.create(null)),Un=b(Object.create(null)),Y=b(0);function Wn(e,t){W.value=W.value.map(n=>n.uid===e?{...n,values:[t]}:n)}function Gn(e,t){let n=t.find(t=>t.uid===e);return n?(n.values||[]).reduce((e,t)=>e+t,0):0}function Kn(e){let t=!1;Hn.value[e]&&(cancelAnimationFrame(Hn.value[e]),delete Hn.value[e],t=!0),Un.value[e]&&(cancelAnimationFrame(Un.value[e]),delete Un.value[e],t=!0),t&&(Y.value=Math.max(0,Y.value-1),Vn.value=Y.value>0)}function qn({seriesId:e,fromValue:t,toValue:n,mode:r}){Kn(e),Y.value+=1,Vn.value=!0;let i=t;return new Promise(a=>{function o(){if(r===`increase`){if(i>=n){Wn(e,n),--Y.value,Y.value<=0&&(Vn.value=!1),delete Hn.value[e],a();return}i+=n*.025,i>n&&(i=n),Wn(e,i),Hn.value[e]=requestAnimationFrame(o)}else{if(i<=t/100){Wn(e,0),--Y.value,Y.value<=0&&(Vn.value=!1),delete Un.value[e],a();return}i/=1.15,Wn(e,i),Un.value[e]=requestAnimationFrame(o)}}o()})}function Jn(){W.value=Pn.value;let e=J.value.length>0;k.value.useAnimation?e?[...J.value].forEach(e=>{Yn(e,!0)}):X.value.map(e=>e.uid).forEach(e=>{Yn(e,!0)}):e?J.value=[]:J.value=X.value.map(e=>e.uid)}function Yn(e,t=!1){if(Mn.value&&!t)return;let n=t||J.value.length<X.value.length-1&&X.value.length>1;if(!k.value.useAnimation){J.value.includes(e)?J.value=J.value.filter(t=>t!==e):n&&J.value.push(e);return}let r=Gn(e,Pn.value),i=Gn(e,W.value);if(i!==0||r!==0){if(J.value.includes(e)){if(J.value=J.value.filter(t=>t!==e),Ht.value){Kn(e),Wn(e,r),cr(`selectLegend`,G.value.map(e=>({name:e.name,color:e.color,value:e.value,proportion:e.proportion})));return}qn({seriesId:e,fromValue:i,toValue:r,mode:`increase`}).then(()=>{cr(`selectLegend`,G.value.map(e=>({name:e.name,color:e.color,value:e.value,proportion:e.proportion})))})}else n&&(Ht.value?(Kn(e),J.value.includes(e)||J.value.push(e),Wn(e,0),cr(`selectLegend`,G.value.map(e=>({name:e.name,color:e.color,value:e.value,proportion:e.proportion})))):qn({seriesId:e,fromValue:i,toValue:0,mode:`decrease`}).then(()=>{J.value.includes(e)||J.value.push(e),Wn(e,0),cr(`selectLegend`,G.value.map(e=>({name:e.name,color:e.color,value:e.value,proportion:e.proportion})))}))}}function Xn(e){return Rn.value.length?Rn.value.find(t=>t.name===e)||(xn.value&&console.warn(`VueUiWaffle - Series name not found "${e}"`),null):(xn.value&&console.warn(`VueUiWaffle - There are no series to show.`),null)}function Zn(e){let t=Xn(e);t!==null&&J.value.includes(t.uid)&&Yn(t.uid)}function Qn(e){let t=Xn(e);t!==null&&(J.value.includes(t.uid)||Yn(t.uid))}function $n({val:e,percentage:t,showVal:n,showPercentage:r,config:i}){return ze({config:i,val:e,percentage:t,showVal:n,showPercentage:r})}let X=d(()=>W.value.map((e,t)=>{let n=(e.values||[]).reduce((e,t)=>e+t,0),r=n/W.value.map(e=>(e.values||[]).reduce((e,t)=>e+t,0)).reduce((e,t)=>e+t,0);return{name:e.name,color:e.color||On[t]||c[t]||c[t%c.length],value:n,proportion:r,uid:e.uid,shape:`square`}}).map((e,t)=>{let n=$n({val:ae(F.value.labels.dataLabels.formatter,e.value,a({p:F.value.labels.dataLabels.prefix,v:e.value,s:F.value.labels.dataLabels.suffix,r:M.value.roundingValue}),{datapoint:e,index:t}),percentage:isNaN(e.value/Z.value)?`-`:a({v:e.value/Z.value*100,s:`%`,r:M.value.roundingPercentage}),showVal:M.value.showValue,showPercentage:M.value.showPercentage,config:M.value});return{...e,opacity:J.value.includes(e.uid)?.5:1,segregate:()=>Yn(e.uid),isSegregated:J.value.includes(e.uid),display:`${e.name}${M.value.showPercentage||M.value.showValue?`: `:``}${n}`}})),er=d(()=>({cy:`waffle-div-legend`,backgroundColor:M.value.backgroundColor,color:M.value.color,fontSize:M.value.fontSize,paddingBottom:12,fontWeight:M.value.bold?`bold`:``})),Z=d(()=>G.value.map(e=>e.value).reduce((e,t)=>e+t,0)),tr=b(null),nr=b(null),Q=d(()=>{let e=/* @__PURE__ */ new Map;return K.value.forEach((t,n)=>{e.has(t.serieIndex)?e.get(t.serieIndex).rectIndexes.push(n):e.set(t.serieIndex,{serieIndex:t.serieIndex,absoluteIndex:t.absoluteIndex,serieId:t.serieId,name:t.name,color:t.color,value:t.value,proportion:t.proportion,rectIndexes:[n]})}),Array.from(e.values()).sort((e,t)=>e.serieIndex-t.serieIndex)});function rr(e){return Q.value.find(t=>t.serieIndex===e)||null}function ir(e){let t=rr(e);return!t||!t.rectIndexes.length?null:t.rectIndexes[0]}function ar(e){let t=K.value[e];k.value.events.datapointClick&&k.value.events.datapointClick({datapoint:t,seriesIndex:t.serieIndex})}function or(e){let t=K.value[e];k.value.events.datapointLeave&&k.value.events.datapointLeave({datapoint:t,seriesIndex:t.serieIndex}),nr.value=null,Gt.value=!1,D.value=null,O.value=null,sn.value=`pointer`}function sr(e,t=`pointer`){if(J.value.length===T.dataset.length)return;let n=K.value[e];if(!n)return;sn.value=t,O.value=n.serieIndex,tr.value={datapoint:n,seriesIndex:n.absoluteIndex,series:W.value,config:k.value},k.value.events.datapointEnter&&nr.value!==n.serieIndex&&k.value.events.datapointEnter({datapoint:n,seriesIndex:n.serieIndex}),nr.value=n.serieIndex,Gt.value=!0,D.value=n.serieIndex;let r=j.value.customFormat;if(s(r)&&le(()=>r({seriesIndex:n.absoluteIndex,datapoint:n,series:W.value,config:k.value})))Kt.value=r({seriesIndex:n.absoluteIndex,datapoint:n,series:W.value,config:k.value});else{let e=``;e+=`<div style="width:100%;text-align:center;border-bottom:1px solid ${j.value.borderColor};padding-bottom:6px;margin-bottom:3px;">${n.name}</div>`,e+=`<div style="display:flex;flex-direction:row;gap:6px;align-items:center;"><svg viewBox="0 0 60 60" height="14" width="14"><rect x="0" y="0" height="60" width="60" stroke="none" rx="1" fill="${n.color}" />${Ut.pattern?`<rect x="0" y="0" height="60" width="60" stroke="none" rx="1" stroke="none" fill="url(#pattern_${E.value}_${n.absoluteIndex})"/>`:``}</svg>`,e+=`<b>${$n({config:j.value,showVal:j.value.showValue,showPercentage:j.value.showPercentage,val:`<span>${ae(F.value.labels.dataLabels.formatter,n.value,a({p:F.value.labels.dataLabels.prefix,v:n.value,s:F.value.labels.dataLabels.suffix,r:j.value.roundingValue}),{datapoint:n,seriesIndex:n.absoluteIndex,series:W.value})}</span>`,percentage:`<span>${a({v:Mn.value?1/fn.value.length*100:n.value/Z.value*100,s:`%`,r:j.value.roundingPercentage})}</span>`})}</b></div>`,Kt.value=e}}let cr=at,$=d(()=>({head:G.value.map(e=>({name:e.name,color:e.color})),body:G.value.map(e=>e.value)}));function lr(e){return k.value.useBlurOnHover&&![null,void 0].includes(D.value)&&D.value!==e?`url(#blur_${E.value})`:``}function ur(e){return[null,void 0].includes(D.value)||D.value===e?{opacity:1}:{opacity:N.value.selection.unselectedOpacity}}function dr(e){return e.length<=3?e:e.filter((t,n)=>{let r=e[(n-1+e.length)%e.length],i=e[(n+1)%e.length],a=r.x===t.x&&t.x===i.x,o=r.y===t.y&&t.y===i.y;return!a&&!o})}function fr(e){if(!e.length)return[];let t=new Set(e.map(({row:e,col:t})=>`${e}:${t}`)),n=[],r=/* @__PURE__ */ new Set,i=[[-1,0],[0,1],[1,0],[0,-1]];e.forEach(e=>{let a=`${e.row}:${e.col}`;if(r.has(a))return;let o=[],s=[e];for(r.add(a);s.length;){let e=s.shift();o.push(e),i.forEach(([n,i])=>{let a=e.row+n,o=e.col+i,c=`${a}:${o}`;t.has(c)&&!r.has(c)&&(r.add(c),s.push({row:a,col:o}))})}n.push(o)});let a=[];return n.forEach(e=>{let t=new Set(e.map(({row:e,col:t})=>`${e}:${t}`)),n=[];e.forEach(({row:e,col:r})=>{t.has(`${e-1}:${r}`)||n.push({start:{x:r,y:e},end:{x:r+1,y:e}}),t.has(`${e}:${r+1}`)||n.push({start:{x:r+1,y:e},end:{x:r+1,y:e+1}}),t.has(`${e+1}:${r}`)||n.push({start:{x:r+1,y:e+1},end:{x:r,y:e+1}}),t.has(`${e}:${r-1}`)||n.push({start:{x:r,y:e+1},end:{x:r,y:e}})});let r=/* @__PURE__ */ new Map,i=e=>`${e.start.x}:${e.start.y}>${e.end.x}:${e.end.y}`,o=e=>`${e.x}:${e.y}`,s=new Set(n.map(i));for(n.forEach(e=>{let t=o(e.start);r.has(t)||r.set(t,[]),r.get(t).push(e)});s.size;){let e=s.values().next().value,t=n.find(t=>i(t)===e),c=t.start,l=[c],ee=t;for(;ee;){s.delete(i(ee));let e=ee.end;if(o(e)===o(c))break;l.push(e),ee=(r.get(o(e))||[]).find(e=>s.has(i(e)))}l.length>=4&&a.push(dr(l))}}),a}function pr(e){let t=P.value.size,n=P.value.vertical,r=[];return K.value.forEach((i,a)=>{if(i.serieIndex!==e)return;let o=Math.floor(a/t),s=a%t;r.push({row:n?s:o,col:n?o:s})}),r}function mr(e){let t=kn.value,n=An.value;return fr(pr(e)).map(e=>e.map(({x:e,y:r})=>({x:e*t,y:V.value.top+r*n})))}function hr(e){return e.map(({x:e,y:t})=>`${e},${t}`).join(` `)}function gr(e){return e.map(e=>{if(!e.length)return``;let[t,...n]=e,r=n.map(({x:e,y:t})=>`L ${e} ${t}`).join(` `);return`M ${t.x} ${t.y} ${r} Z`}).filter(Boolean).join(` `)}let _r=d(()=>!N.value.selection?.wrap?.show||[null,void 0].includes(D.value)?[]:mr(D.value).map(hr)),vr=d(()=>{if(!N.value.merged)return[];let e=/* @__PURE__ */ new Map;return K.value.forEach((t,n)=>{e.has(t.serieIndex)||e.set(t.serieIndex,{serieIndex:t.serieIndex,absoluteIndex:t.absoluteIndex,color:t.color,gradientIndex:n,rectIndex:n})}),Array.from(e.values()).map(e=>({...e,d:gr(mr(e.serieIndex))})).filter(e=>e.d)});function yr(e,t){return F.value.labels.captions.show?K.value.length&&!Vn.value&&!P.value.vertical&&(K.value[e].isFirst&&t.position<P.value.size-2||K.value[e].isAbsoluteFirst&&e%P.value.size===0&&K.value[e].absoluteStartIndex):!1}function br(e,t=null){let n=ae(F.value.labels.dataLabels.formatter,K.value[e].value,a({p:F.value.labels.dataLabels.prefix,v:K.value[e].value,s:F.value.labels.dataLabels.suffix,r:F.value.labels.captions.roundingValue}),{datapoint:K.value[e],position:t}),r=a({v:K.value[e].proportion*100,s:`%`,r:F.value.labels.captions.roundingPercentage}),i=(F.value.labels.captions.serieNameAbbreviation?se({source:K.value[e].name,length:F.value.labels.captions.serieNameMaxAbbreviationSize}):K.value[e].name)+(F.value.labels.captions.showPercentage||F.value.labels.captions.showValue?`:`:``);return`${F.value.labels.captions.showSerieName?i:``} ${$n({val:n,percentage:r,showVal:F.value.labels.captions.showValue,showPercentage:F.value.labels.captions.showPercentage,config:F.value.labels.dataLabels})}`}function xr(e=null){Ye(()=>{let t=$.value.head.map((e,t)=>[[e.name],[$.value.body[t]],[isNaN($.value.body[t]/Z.value)?`-`:$.value.body[t]/Z.value*100]]),n=[[I.value.title.text],[I.value.title.subtitle.text],[[``],[`val`],[`%`]]].concat(t),r=o(n);e?e(r):ce({csvContent:r,title:I.value.title.text||`vue-ui-waffle`})})}let Sr=d(()=>({head:[`__SUM__`,ae(F.value.labels.dataLabels.formatter,Z.value,a({p:F.value.labels.dataLabels.prefix,v:Z.value,s:F.value.labels.dataLabels.suffix,r:k.value.table.td.roundingValue})),`100%`],body:$.value.head.map((e,t)=>[{color:e.color,name:e.name},ae(F.value.labels.dataLabels.formatter,$.value.body[t],a({p:F.value.labels.dataLabels.prefix,v:$.value.body[t],s:F.value.labels.dataLabels.suffix,r:k.value.table.td.roundingValue})),isNaN($.value.body[t]/Z.value)?`-`:a({v:$.value.body[t]/Z.value*100,s:`%`,r:k.value.table.td.roundingPercentage})]),config:{th:{backgroundColor:k.value.table.th.backgroundColor,color:k.value.table.th.color,outline:k.value.table.th.outline},td:{backgroundColor:k.value.table.td.backgroundColor,color:k.value.table.td.color,outline:k.value.table.td.outline},shape:`square`,breakpoint:k.value.table.responsiveBreakpoint},colNames:[k.value.table.columnNames.series,k.value.table.columnNames.value,k.value.table.columnNames.percentage]})),Cr=b(!1);function wr(e){Cr.value=e,qt.value+=1}function Tr(){z.value.showTable=!z.value.showTable}function Er(){z.value.showTooltip=!z.value.showTooltip}let Dr=b(!1);function Or(){Dr.value=!Dr.value}let kr=xe(Jt,()=>I.value.title.text),Ar=d(()=>Te({config:k,style:I,mutableConfig:z,dialog:Bt,accordion:It,isFullscreen:Cr,parent:Jt,maxWidth:500,isCursorPointer:ln}));it(()=>z.value.showTable,e=>we(e,k,rn));function jr(){z.value.showTable=!1,an.value&&an.value.setTableIconState(!1)}let Mr=d(()=>X.value.map(e=>({...e,name:e.display}))),Nr=d(()=>I.value.backgroundColor),Pr=d(()=>I.value.title),{isCallbackImaging:Fr,isCallbackSvg:Ir,generateSvg:Lr,onGenerateImage:Rr}=Ce({svg:_n,title:Pr,legend:M,legendItems:Mr,backgroundColor:Nr,getSvgCallback:()=>k.value.userOptions.callbacks.svg,generateImage:En});async function zr(){cr(`copyAlt`,{config:k.value,dataset:Rn.value}),k.value.userOptions.callbacks.altCopy?await Promise.resolve(k.value.userOptions.callbacks.altCopy({config:k.value,dataset:Rn.value})):console.warn("Vue Data UI - A callback must be set for `altCopy` in userOptions.")}function Br(){O.value=null,cn.value=!0}function Vr(){O.value=null,sn.value=`pointer`,Gt.value=!1,D.value=null,nr.value=null,cn.value=!1}function Hr(e){if(!_n.value||Dr.value||document.activeElement!==_n.value||!Q.value.length||J.value.length===T.dataset.length)return;let t=[`ArrowLeft`,`ArrowUp`].includes(e.key),n=[`ArrowRight`,`ArrowDown`].includes(e.key),r=e.key===`Enter`||e.key===` `,i=e.key===`Escape`;if(!t&&!n&&!r&&!i)return;if(e.preventDefault(),e.stopPropagation(),i){O.value=null,sn.value=`pointer`,Gt.value=!1,D.value=null,nr.value=null;return}if(r){if(O.value===null)return;let e=ir(O.value);if(e===null)return;ar(e);return}let a=Q.value.findIndex(e=>e.serieIndex===O.value),o=null;if(o=a===-1?n?Q.value[0]:Q.value[Q.value.length-1]:n?Q.value[(a+1)%Q.value.length]:Q.value[(a-1+Q.value.length)%Q.value.length],!o)return;let s=ir(o.serieIndex);s!==null&&(Ur(o.serieIndex),sr(s,`keyboard`))}function Ur(e){if(!Number.isFinite(e)||!_n.value)return;let t=rr(e);if(!t||!t.rectIndexes.length)return;let n=t.rectIndexes.map(e=>{let t=q.value[e];return t?{x:t.x+P.value.spaceBetween/2+kn.value/2,y:t.y+P.value.spaceBetween/2+An.value/2}:null}).filter(Boolean);if(!n.length)return;let r=Math.min(...n.map(e=>e.x)),i=Math.max(...n.map(e=>e.x)),a=Math.min(...n.map(e=>e.y)),o=Math.max(...n.map(e=>e.y)),s=(r+i)/2,c=(a+o)/2,l=_n.value.getBoundingClientRect();on.value={x:l.left+s/B.value.width*l.width,y:l.top+c/B.value.height*l.height}}let Wr=d(()=>({headers:Sr.value?.colNames??[],rows:Sr.value?.body??[]}));return ye({getData:zn,getImage:kr,generatePdf:Tn,generateCsv:xr,generateImage:En,generateSvg:Lr,hideSeries:Qn,showSeries:Zn,toggleTable:Tr,toggleTooltip:Er,toggleAnnotator:Or,toggleFullscreen:wr,copyAlt:zr}),(e,i)=>(y(),m(`div`,{class:_(`vue-data-ui-component vue-ui-waffle ${Cr.value?`vue-data-ui-wrapper-fullscreen`:``}`),ref_key:`waffleChart`,ref:Jt,id:`vue-ui-waffle_${E.value}`,style:v(`font-family:${k.value.style.fontFamily};width:100%; text-align:center;background:${I.value.backgroundColor};${k.value.responsive?`height: 100%`:``}`),onMouseenter:i[2]||=()=>C(hn)(!0),onMouseleave:i[3]||=()=>C(hn)(!1)},[h(`div`,{id:`chart-instructions-${E.value}`,class:`sr-only`},[h(`p`,null,tt(k.value.a11y.translations.keyboardNavigation),1)],8,st),Wr.value?.rows?.length?(y(),f(Ie,{key:0,uid:E.value,head:Wr.value.headers,body:Wr.value.rows,notice:k.value.a11y.translations.tableAvailable,caption:k.value.a11y.translations.tableCaption},null,8,[`uid`,`head`,`body`,`notice`,`caption`])):p(``,!0),A.value.buttons.annotator?(y(),f(C(Rt),Je({key:1},C(n)(A.value.annotator),{svgRef:C(_n),backgroundColor:I.value.backgroundColor,color:I.value.color,active:Dr.value,isCursorPointer:ln.value,palette:A.value.annotatorPalette,onClose:Or}),We({_:2},[x(C(r),n=>({name:n,fn:w(r=>[S(e.$slots,n,Xe(qe(C(t)(n,r))),void 0,!0)])}))]),1040,[`svgRef`,`backgroundColor`,`color`,`active`,`isCursorPointer`,`palette`])):p(``,!0),Dn.value?(y(),m(`div`,{key:2,ref_key:`noTitle`,ref:Qt,class:`vue-data-ui-no-title-space`,style:`height:36px; width: 100%;background:transparent`},null,512)):p(``,!0),I.value.title.text?(y(),m(`div`,{key:3,ref_key:`chartTitle`,ref:Yt,style:`width:100%;background:transparent;padding-bottom:12px`},[(y(),f(Se,{key:`title_${$t.value}`,config:{title:{cy:`waffle-title`,...I.value.title},subtitle:{cy:`waffle-subtitle`,...I.value.title.subtitle}}},null,8,[`config`]))],512)):p(``,!0),h(`div`,{id:`legend-top-${E.value}`},null,8,ct),A.value.show&&Wt.value&&(C(gn)||C(mn))?(y(),f(C(Lt),Je({ref_key:`userOptionsRef`,ref:an,key:`user_options_${qt.value}`,backgroundColor:I.value.backgroundColor,color:I.value.color,isPrinting:C(Cn),isImaging:C(wn),uid:E.value,hasTooltip:A.value.buttons.tooltip&&j.value.show,isFullscreen:Cr.value,isTooltip:z.value.showTooltip,chartElement:Jt.value},C(De)(A.value,`pdf csv img svg table fullscreen altCopy annotator`),{isAnnotation:Dr.value,tableDialog:k.value.table.useDialog,isCursorPointer:ln.value,onToggleFullscreen:wr,onGeneratePdf:C(Tn),onGenerateCsv:xr,onGenerateImage:C(Rr),onGenerateSvg:C(Lr),onToggleTable:Tr,onToggleTooltip:Er,onToggleAnnotator:Or,onCopyAlt:zr,style:{visibility:C(gn)?C(mn)?`visible`:`hidden`:`visible`}}),We({_:2},[x(C(Ee)(e.$slots,`menuIcon optionTooltip optionPdf optionCsv optionImg optionSvg optionTable optionFullscreen optionAnnotator optionAltCopy custom-menu-before custom-menu-after`),t=>({name:t,fn:w(n=>[S(e.$slots,t,Xe(qe(C(Oe)(t,n))),void 0,!0)])}))]),1040,[`backgroundColor`,`color`,`isPrinting`,`isImaging`,`uid`,`hasTooltip`,`isFullscreen`,`isTooltip`,`chartElement`,`isAnnotation`,`tableDialog`,`isCursorPointer`,`onGeneratePdf`,`onGenerateImage`,`onGenerateSvg`,`style`])):p(``,!0),h(`div`,lt,[(y(),m(`svg`,{ref_key:`svgRef`,ref:_n,xmlns:C(de),"aria-describedby":`chart-instructions-${E.value}`,class:_({"vue-data-ui-fullscreen--on":Cr.value,"vue-data-ui-fulscreen--off":!Cr.value,"vue-data-ui-no-transition":!C(L)}),tabindex:`0`,viewBox:`0 0 ${B.value.width<=0?10:B.value.width} ${B.value.height<=0?10:B.value.height}`,style:v(`max-width:100%;overflow:visible;background:transparent;color:${I.value.color}`),onFocus:Br,onBlur:Vr,onKeydown:Hr},[Ke(C(zt)),S(e.$slots,`svg-underlayer`,{svg:{...B.value,isPrintingImg:C(Cn)||C(wn)||C(Fr),isPrintingSvg:C(Ir)}},void 0,!0),h(`defs`,null,[(y(!0),m(u,null,x(K.value,(e,t)=>(y(),f(Pe,{t:`radial`,cx:`50%`,cy:`50%`,r:`50%`,fx:`50%`,fy:`50%`,id:`gradient_${E.value}_${t}`,key:`gradient_${E.value}_${t}`,stops:[[`0%`,C(l)(C(ne)(e.color,.05),100-N.value.gradientIntensity),1],[`100%`,e.color,1]]},null,8,[`id`,`stops`]))),128))]),h(`defs`,null,[h(`filter`,{id:`blur_${E.value}`,x:`-50%`,y:`-50%`,width:`200%`,height:`200%`},[...i[4]||=[h(`feGaussianBlur`,{in:`SourceGraphic`,stdDeviation:2},null,-1),h(`feColorMatrix`,{type:`saturate`,values:`0`},null,-1)]],8,dt)]),k.value.useCustomCells&&K.value.length&&e.$slots.cell?(y(!0),m(u,{key:0},x(q.value,(t,n)=>(y(),m(`foreignObject`,{x:t.x,y:t.y,height:U.value<=0?1e-4:U.value,width:H.value<=0?1e-4:H.value,class:`vue-ui-waffle-custom-cell-foreignObject`},[S(e.$slots,`cell`,Je({ref_for:!0},{cell:{...t,color:K.value[n].color,height:Math.max(0,U.value),width:Math.max(0,H.value),...K.value[n]},isSelected:[null,void 0].includes(D.value)?!0:K.value[n].serieIndex===D.value}),void 0,!0)],8,ft))),256)):p(``,!0),!K.value.length&&!k.value.useCustomCells?(y(),m(`rect`,{key:1,x:12,y:12,height:V.value.height-24,width:V.value.width-24,rx:3,fill:`none`,stroke:`black`},null,8,pt)):K.value.length&&!k.value.useCustomCells?(y(),m(u,{key:2},[e.$slots.pattern?(y(),m(`g`,mt,[(y(!0),m(u,null,x(Pn.value,t=>(y(),m(`defs`,null,[S(e.$slots,`pattern`,Je({ref_for:!0},{seriesIndex:t.absoluteIndex,patternId:`pattern_${E.value}_${t.absoluteIndex}`}),void 0,!0)]))),256))])):p(``,!0),N.value.merged?(y(),m(u,{key:1},[(y(!0),m(u,null,x(vr.value,e=>(y(),m(`path`,{key:`merged-underlayer-${e.serieIndex}`,d:e.d,fill:`white`,"fill-rule":`evenodd`,stroke:N.value.stroke,"stroke-width":N.value.strokeWidth,"stroke-linejoin":`round`,filter:lr(e.serieIndex),style:v(ur(e.serieIndex)),class:_({"vue-data-ui-transition":C(L)})},null,14,ht))),128)),(y(!0),m(u,null,x(vr.value,e=>(y(),m(`path`,{key:`merged-serie-${e.serieIndex}`,d:e.d,fill:N.value.useGradient&&N.value.gradientIntensity>0?`url(#gradient_${E.value}_${e.gradientIndex})`:e.color,"fill-rule":`evenodd`,stroke:N.value.stroke,"stroke-width":N.value.strokeWidth,"stroke-linejoin":`round`,filter:lr(e.serieIndex),style:v(ur(e.serieIndex)),class:_({"vue-data-ui-transition":C(L)})},null,14,gt))),128)),e.$slots.pattern?(y(),m(`g`,_t,[(y(!0),m(u,null,x(vr.value,e=>(y(),m(`path`,{key:`merged-pattern-${e.serieIndex}`,d:e.d,fill:`url(#pattern_${E.value}_${e.absoluteIndex})`,"fill-rule":`evenodd`,stroke:`none`,filter:lr(e.serieIndex),style:v(ur(e.serieIndex)),class:_({"vue-data-ui-transition":C(L)})},null,14,vt))),128))])):p(``,!0)],64)):(y(),m(u,{key:2},[(y(!0),m(u,null,x(q.value,(e,t)=>(y(),m(`rect`,{rx:N.value.rounded?N.value.rounding:0,x:e.x+P.value.spaceBetween/2,y:e.y+P.value.spaceBetween/2,height:U.value<=0?1e-4:U.value,width:H.value<=0?1e-4:H.value,fill:`white`,stroke:N.value.stroke,"stroke-width":N.value.strokeWidth,filter:lr(K.value[t].serieIndex),style:v(ur(K.value[t].serieIndex)),class:_({"vue-data-ui-transition":C(L)})},null,14,yt))),256)),(y(!0),m(u,null,x(q.value,(e,t)=>(y(),m(`rect`,{rx:N.value.rounded?N.value.rounding:0,x:e.x+P.value.spaceBetween/2,y:e.y+P.value.spaceBetween/2,height:U.value<=0?1e-4:U.value,width:H.value<=0?1e-4:H.value,fill:N.value.useGradient&&N.value.gradientIntensity>0?`url(#gradient_${E.value}_${t})`:K.value[t].color,stroke:N.value.stroke,"stroke-width":N.value.strokeWidth,filter:lr(K.value[t].serieIndex),style:v(ur(K.value[t].serieIndex)),class:_({"vue-data-ui-transition":C(L)})},null,14,bt))),256)),e.$slots.pattern?(y(),m(`g`,xt,[(y(!0),m(u,null,x(q.value,(e,t)=>(y(),m(`rect`,{rx:N.value.rounded?N.value.rounding:0,x:e.x+P.value.spaceBetween/2,y:e.y+P.value.spaceBetween/2,height:U.value<=0?1e-4:U.value,width:H.value<=0?1e-4:H.value,fill:`url(#pattern_${E.value}_${K.value[t].absoluteIndex})`,stroke:`none`,filter:lr(K.value[t].serieIndex),style:v(ur(K.value[t].serieIndex)),class:_({"vue-data-ui-transition":C(L)})},null,14,St))),256))])):p(``,!0)],64))],64)):p(``,!0),e.$slots.cellSvg?(y(!0),m(u,{key:3},x(q.value,(t,n)=>(y(),m(`g`,null,[S(e.$slots,`cellSvg`,Je({ref_for:!0},{cell:{...t,color:K.value[n].color,height:Math.max(0,U.value),width:Math.max(0,H.value),...K.value[n]},isSelected:[null,void 0].includes(D.value)?!0:K.value[n].serieIndex===D.value}),void 0,!0)]))),256)):p(``,!0),(y(!0),m(u,null,x(_r.value,(e,t)=>(y(),m(`polygon`,{key:`selected-series-wrap-${t}`,points:e,fill:`none`,stroke:N.value.selection.wrap.stroke,"stroke-width":N.value.selection.wrap.strokeWidth,"stroke-linejoin":N.value.selection.wrap.strokeLinejoin,"pointer-events":`none`},null,8,Ct))),128)),(y(!0),m(u,null,x(q.value,(e,t)=>(y(),m(u,null,[yr(t,e)?(y(),m(`text`,{key:`datalabel_${t}`,textContent:tt(br(t,e)),x:e.x+F.value.labels.captions.offsetX+P.value.spaceBetween/2+6,y:e.y+F.value.labels.captions.offsetY+P.value.spaceBetween/2+An.value/2+F.value.labels.captions.fontSize/3,"font-size":F.value.labels.captions.fontSize,fill:C(ue)(K.value[t].color),filter:lr(K.value[t].serieIndex),class:_({"vue-data-ui-transition":C(L)})},null,10,wt)):p(``,!0)],64))),256)),N.value.merged&&!k.value.useCustomCells?(y(!0),m(u,{key:4},x(vr.value,e=>(y(),m(`path`,{key:`tooltip-trap-${e.serieIndex}`,d:e.d,fill:`transparent`,"fill-rule":`evenodd`,stroke:`none`,"pointer-events":`fill`,onMouseover:t=>sr(e.rectIndex),onMouseleave:t=>or(e.rectIndex),onClick:t=>ar(e.rectIndex)},null,40,Tt))),128)):(y(!0),m(u,{key:5},x(q.value,(e,t)=>(y(),m(`rect`,{key:`tooltip-trap-${t}`,x:e.x+P.value.spaceBetween/2,y:e.y+P.value.spaceBetween/2,height:An.value,width:kn.value,fill:`transparent`,stroke:`none`,onMouseover:e=>sr(t),onMouseleave:e=>or(t),onClick:e=>ar(t)},null,40,Et))),128)),S(e.$slots,`svg`,{svg:{...B.value,isPrintingImg:C(Cn)||C(wn)||C(Fr),isPrintingSvg:C(Ir)}},void 0,!0)],46,ut)),e.$slots.hint?(y(),m(`div`,Dt,[S(e.$slots,`hint`,Xe(qe({hint:k.value.a11y.translations.keyboardNavigation,isVisible:cn.value})),void 0,!0)])):p(``,!0)]),e.$slots.watermark?(y(),m(`div`,Ot,[S(e.$slots,`watermark`,Xe(qe({isPrinting:C(Cn)||C(wn)||C(Fr)||C(Ir)})),void 0,!0)])):p(``,!0),h(`div`,{id:`legend-bottom-${E.value}`},null,8,kt),nn.value&&(M.value.show||e.$slots.legend)?(y(),f(Ue,{key:6,to:M.value.position===`top`?`#legend-top-${E.value}`:`#legend-bottom-${E.value}`},[h(`div`,{ref_key:`chartLegend`,ref:Xt},[S(e.$slots,`legend`,{legend:X.value},()=>[M.value.show?(y(),f(Be,{key:`legend_${tn.value}`,legendSet:X.value,config:er.value,isCursorPointer:ln.value,onClickMarker:i[0]||=({legend:e})=>Yn(e.uid)},We({item:w(({legend:e})=>[h(`div`,{onClick:t=>e.segregate(),style:v(`opacity:${J.value.includes(e.uid)?.5:1}`)},tt(e.display),13,At)]),legendToggle:w(()=>[X.value.length>2&&M.value.selectAllToggle.show&&!C(dn)?(y(),f(Fe,{key:0,backgroundColor:M.value.selectAllToggle.backgroundColor,color:M.value.selectAllToggle.color,fontSize:M.value.fontSize,checked:J.value.length>0,isCursorPointer:ln.value,onToggle:Jn},null,8,[`backgroundColor`,`color`,`fontSize`,`checked`,`isCursorPointer`])):p(``,!0)]),_:2},[e.$slots.pattern?{name:`legend-pattern`,fn:w(({legend:e,index:t})=>[Ke(je,{shape:e.shape,radius:30,stroke:`none`,plot:{x:30,y:30},fill:`url(#pattern_${E.value}_${t})`},null,8,[`shape`,`fill`])]),key:`0`}:void 0]),1032,[`legendSet`,`config`,`isCursorPointer`])):p(``,!0)],!0)],512)],8,[`to`])):p(``,!0),e.$slots.source?(y(),m(`div`,{key:7,ref_key:`source`,ref:Zt,dir:`auto`},[S(e.$slots,`source`,{},void 0,!0)],512)):p(``,!0),Ke(C(Nt),{teleportTo:j.value.teleportTo,show:z.value.showTooltip&&Gt.value&&J.value.length<T.dataset.length,backgroundColor:j.value.backgroundColor,color:j.value.color,borderRadius:j.value.borderRadius,borderColor:j.value.borderColor,borderWidth:j.value.borderWidth,backgroundOpacity:j.value.backgroundOpacity,position:j.value.position,offsetX:j.value.offsetX,offsetY:j.value.offsetY,parent:Jt.value,content:Kt.value,isCustom:j.value.customFormat&&typeof j.value.customFormat==`function`,fontSize:j.value.fontSize,isFullscreen:Cr.value,smooth:j.value.smooth,backdropFilter:j.value.backdropFilter,smoothForce:j.value.smoothForce,smoothSnapThreshold:j.value.smoothSnapThreshold,isA11yMode:sn.value===`keyboard`,a11yPosition:on.value},{"tooltip-before":w(()=>[S(e.$slots,`tooltip-before`,Xe(qe({...tr.value})),void 0,!0)]),tooltip:w(()=>[S(e.$slots,`tooltip`,Xe(qe({...tr.value})),void 0,!0)]),"tooltip-after":w(()=>[S(e.$slots,`tooltip-after`,Xe(qe({...tr.value})),void 0,!0)]),_:3},8,[`teleportTo`,`show`,`backgroundColor`,`color`,`borderRadius`,`borderColor`,`borderWidth`,`backgroundOpacity`,`position`,`offsetX`,`offsetY`,`parent`,`content`,`isCustom`,`fontSize`,`isFullscreen`,`smooth`,`backdropFilter`,`smoothForce`,`smoothSnapThreshold`,`isA11yMode`,`a11yPosition`]),Wt.value&&A.value.buttons.table?(y(),f($e(Ar.value.component),Je({key:8},Ar.value.props,{ref_key:`tableUnit`,ref:rn,onClose:jr}),We({content:w(()=>[(y(),f(C(Ft),{key:`table_${en.value}`,colNames:Sr.value.colNames,head:Sr.value.head,body:Sr.value.body,config:Sr.value.config,title:k.value.table.useDialog?``:Ar.value.title,withCloseButton:!k.value.table.useDialog,isCursorPointer:ln.value,onClose:jr},{th:w(({th:e})=>[e===`__SUM__`?(y(),m(`div`,jt,[Ke(C(Pt),{name:`sigma`,stroke:Sr.value.config.th.color,size:16},null,8,[`stroke`])])):(y(),m(`div`,Mt,tt(e),1))]),td:w(({td:e})=>[Ge(tt(e.name||e),1)]),_:1},8,[`colNames`,`head`,`body`,`config`,`title`,`withCloseButton`,`isCursorPointer`]))]),_:2},[k.value.table.useDialog?{name:`title`,fn:w(()=>[Ge(tt(Ar.value.title),1)]),key:`0`}:void 0,k.value.table.useDialog?{name:`actions`,fn:w(()=>[h(`button`,{tabindex:`0`,class:`vue-ui-user-options-button`,onClick:i[1]||=e=>xr(A.value.callbacks.csv),style:v({cursor:ln.value?`pointer`:`default`})},[Ke(C(Pt),{name:`fileCsv`,stroke:Ar.value.props.color},null,8,[`stroke`])],4)]),key:`1`}:void 0]),1040)):p(``,!0),S(e.$slots,`skeleton`,{},()=>[C(dn)?(y(),f(ge,{key:0})):p(``,!0)],!0)],46,ot))}},[[`__scopeId`,`data-v-002c14ec`]]);export{at 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,Ft as o,It as s,X as c,Yt as l,at as u,b as d,i as f,in as p,t as m,zt as h}from"./lib-rPeBMZrn.js";import{n as g,t as _}from"./BaseScanner-8NdoBs7B.js";import{n as v,t as y}from"./useHints-C-TwxM0Y.js";import{t as b}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{t as x}from"./resolveChartConfig-CIhClE5R.js";import{t as ee}from"./chartImage-DPGnEuYM.js";import{n as te}from"./Title-BliHuXfT.js";import{t as S}from"./useChartExport-BZts4KFb.js";import{n as ne,r as re,t as ie}from"./userOptionsSlots-CWtXN5Q6.js";import{t as ae}from"./usePrinter-DVf3YcG5.js";import{c as oe}from"./canvas-lib-22VpOI4_.js";import{t as se}from"./useResponsive-CENUxfEL.js";import{t as ce}from"./useUserOptionState-CXlFnwPv.js";import{t as le}from"./useChartAccessibility-DOMuYJfm.js";import{t as ue}from"./usePrefersMotion-XLHwega2.js";import{t as de}from"./vue_ui_wheel-C-479bvJ.js";import{Fragment as C,computed as w,createBlock as T,createCommentVNode as E,createElementBlock as D,createElementVNode as fe,createSlots as pe,createVNode as me,defineAsyncComponent as he,guardReactiveProps as ge,mergeProps as _e,normalizeClass as O,normalizeProps as ve,normalizeStyle as ye,onBeforeUnmount as be,onMounted as xe,openBlock as k,ref as A,renderList as j,renderSlot as M,shallowRef as Se,toDisplayString as Ce,toRefs as we,unref as N,useCssVars as Te,watch as Ee,withCtx as De}from"vue";var Oe=/* @__PURE__ */ e({default:()=>Ye}),ke=[`id`],Ae=[`xmlns`,`viewBox`,`aria-labelledby`,`aria-describedby`],je=[`id`],Me=[`id`],Ne=[`x`,`y`,`width`,`height`],Pe=[`d`,`stroke`,`stroke-width`],Fe=[`cx`,`cy`,`r`,`stroke`,`stroke-width`],Ie={key:0},Le=[`x1`,`y1`,`x2`,`y2`,`stroke`,`stroke-width`,`stroke-linecap`],Re=[`x1`,`y1`,`x2`,`y2`,`stroke`,`stroke-width`,`stroke-linecap`],ze={key:1},Be=[`d`,`fill`,`stroke`,`stroke-width`],Ve=[`d`,`fill`,`stroke`,`stroke-width`],He=[`d`,`fill`,`stroke`,`stroke-width`],Ue=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`,`stroke-linecap`],We=[`d`,`fill`,`stroke`,`stroke-width`],Ge=[`aria-label`],Ke=[`x`,`y`,`height`],qe=[`x`,`y`,`font-size`,`fill`,`font-weight`,`stroke`,`stroke-width`],Je={key:4,class:`vue-data-ui-watermark`},Ye=/*#__PURE__*/ b({__name:`vue-ui-wheel`,props:{config:{type:Object,default(){return{}}},dataset:{type:Object,default(){return{}}}},emits:[`copyAlt`],setup(e,{expose:b,emit:Oe}){Te(e=>({b5c7a3a6:Ht.value,v8a2df25a:Ut.value,v8a2e2d34:Wt.value}));let Ye=he(()=>import(`./PenAndPaper-DoNTA-SV.js`).then(e=>e.t)),Xe=he(()=>import(`./UserOptions-B9EyfU9n.js`).then(e=>e.n)),Ze=he(()=>import(`./PackageVersion-DKSNC-YP.js`).then(e=>e.t)),{vue_ui_wheel:Qe}=i(),P=ue(),F=e,$e=Oe,et=w(()=>!!F.dataset&&Object.keys(F.dataset).length),I=A(c()),tt=A(null),nt=A(0),L=A(null),rt=A(null),it=A(null),at=A(null),ot=A(0),R=A(mt()),z=w(()=>R.value.userOptions),B=w(()=>R.value.style.chart.layout.wheel.ticks),V=w(()=>R.value.style.chart.layout.wheel),H=w(()=>R.value.style.chart);v({config:()=>R.value,dataset:()=>F.dataset,component:`VueUiWheel`,rules:[y.noHint]});let st=w(()=>R.value.userOptions.useCursorPointer),ct=w(()=>p({defaultConfig:{userOptions:{show:!1},style:{chart:{backgroundColor:`#99999930`,animation:{use:!1},layout:{wheel:{ticks:{activeColor:`#6A6A6A80`,inactiveColor:`#CACACA80`}},innerCircle:{stroke:`#CACACA80`}}}}},userConfig:R.value.skeletonConfig??{}})),{loading:lt,FINAL_DATASET:U}=g({...we(F),FINAL_CONFIG:R,prepareConfig:mt,skeletonDataset:F.config?.skeletonDataset??{percentage:50},skeletonConfig:p({defaultConfig:R.value,userConfig:ct.value})}),{userOptionsVisible:ut,setUserOptionsVisibility:dt,keepUserOptionState:ft}=ce({config:R.value}),{svgRef:pt}=le({config:H.value.title});function mt(){return x(F.config,Qe,de)}Ee(()=>F.config,e=>{R.value=mt(),ut.value=!R.value.userOptions.showOnChartHover,St(),ot.value+=1},{deep:!0});let{isPrinting:ht,isImaging:gt,generatePdf:_t,generateImage:vt}=ae({elementId:I.value,fileName:H.value.title.text||`vue-ui-wheel`,options:R.value.userOptions.print}),yt=w(()=>R.value.userOptions.show&&!H.value.title.text),W=A({size:360,height:360,width:360}),G=A(H.value.layout.percentage.fontSize),K=w(()=>({radius:Math.min(W.value.width,W.value.height)*.9/2*V.value.radiusRatio,centerX:W.value.width/2,centerY:W.value.height/2}));function bt(e,t=1){let n=29.85;return{x:K.value.centerX+K.value.radius*Math.cos(n+e*Math.PI/180)*t,y:K.value.centerY+K.value.radius*Math.sin(n+e*Math.PI/180)*t}}let q=A(H.value.animation.use&&!P.value?0:U.value.percentage||0);Ee(()=>U.value,e=>{H.value.animation.use&&!P.value?Pt(e.percentage):q.value=e.percentage||0},{deep:!0});let J=Se(null),Y=Se(null);xe(()=>{St()});let xt=w(()=>R.value.debug);function St(){if(h(F.dataset)&&u({componentName:`VueUiWheel`,type:`dataset`,debug:xt.value}),R.value.responsive){let e=oe(()=>{let{width:e,height:t}=se({chart:L.value,title:H.value.title.text?rt.value:null,source:it.value,noTitle:at.value});requestAnimationFrame(()=>{W.value.width=e,W.value.height=t,G.value=H.value.layout.percentage.fontSize/360*Math.min(e,t)})});J.value&&(Y.value&&J.value.unobserve(Y.value),J.value.disconnect()),J.value=new ResizeObserver(e),Y.value=L.value.parentNode,J.value.observe(Y.value)}Pt(U.value.percentage||0),H.value.animation.use&&!P.value||(q.value=U.value.percentage||0)}be(()=>{J.value&&(Y.value&&J.value.unobserve(Y.value),J.value.disconnect())});function Ct([e,t,n],r){let i=Math.cos(r),a=Math.sin(r);return[e,t*i-n*a,t*a+n*i]}function wt([e,t,n],r){let i=r/(r-n);return[e*i,t*i,n,i]}function Tt(e,t){let n=e.replace(`#`,``),r=parseInt(n.substring(0,2),16),i=parseInt(n.substring(2,4),16),a=parseInt(n.substring(4,6),16),o=1-Math.min(1,Math.max(0,B.value.shadeColorRatio3d))*t,s=Math.max(0,Math.min(255,Math.round(r*o))),c=Math.max(0,Math.min(255,Math.round(i*o))),l=Math.max(0,Math.min(255,Math.round(a*o)));return`#${s.toString(16).padStart(2,`0`)}${c.toString(16).padStart(2,`0`)}${l.toString(16).padStart(2,`0`)}`}function Et({cx:e,cy:t,radius:n,innerRatio:r=.8,count:i=120,startDeg:a=0,axDeg:o=50,f:s=520,baseStroke:c=5,activeColor:u,inactiveColor:d,getActive:f}){let p=o*Math.PI/180,m=n,h=n*r,g=[];for(let n=0;n<i;n+=1){let r=(n/i*360+a)*Math.PI/180,o=e+m*Math.cos(r),_=t+m*Math.sin(r),v=e+h*Math.cos(r),y=t+h*Math.sin(r),b=[o-e,_-t,0],x=[v-e,y-t,0],[ee,te,S]=Ct(b,p),[ne,re,ie]=Ct(x,p),[ae,oe,,se]=wt([ee,te,S],s),[ce,le,,ue]=wt([ne,re,ie],s),de=e+ae,C=t+oe,w=e+ce,T=t+le,E=(Math.max(S,ie)- -m*Math.sin(p))/(2*m*Math.sin(p)||1),D=!f||f(n),fe=B.value.gradient.show?l(u,n*Q.value/Z.value*(B.value.gradient.shiftHueIntensity/100)):u,pe=Tt(D?fe:d,E),me=Math.max(1.25,c*se*(Math.min(W.value.width,W.value.height)/360));g.push({i:n,x1:de,y1:C,x2:w,y2:T,stroke:me,color:pe,z:Math.max(S,ie)})}return g.sort((e,t)=>e.z-t.z),g}let Dt=w(()=>{if(!R.value.layout===`3d`)return null;let e=Z.value,t=B.value.gradient.show?l(B.value.activeColor,0):B.value.activeColor,n=B.value.inactiveColor,r=B.value.strokeWidth;return Et({cx:K.value.centerX,cy:K.value.centerY,radius:K.value.radius,innerRatio:B.value.sizeRatio,count:e,startDeg:-90,axDeg:V.value.tiltAngle3d,f:Math.min(W.value.width,W.value.height)*1.45,baseStroke:r,activeColor:t,inactiveColor:n,getActive:e=>q.value>e*Q.value})});function Ot({cx:e,cy:t,r:n,count:r=180,startDeg:i=-90,axDeg:a=50,f:o}){let s=a*Math.PI/180,c=[],l=0;for(let a=0;a<r;a+=1){let u=(a/r*360+i)*Math.PI/180,[d,f,p]=Ct([n*Math.cos(u),n*Math.sin(u),0],s),[m,h,,g]=wt([d,f,p],o);l+=g,c.push([e+m,t+h])}let u=`M ${c[0][0]} ${c[0][1]}`;for(let e=1;e<c.length;e+=1)u+=` L ${c[e][0]} ${c[e][1]}`;u+=` Z`;let d=l/r;return{d:u,avgScale:d,pts:c}}let X=w(()=>{if(R.value.layout!==`3d`)return null;let e=Math.min(W.value.width,W.value.height)*1.45,t=V.value.tiltAngle3d,n=K.value.radius,{pts:r,avgScale:i}=(()=>{let r=n,i=t,{d:a,avgScale:o,pts:s}=Ot({cx:K.value.centerX,cy:K.value.centerY,r,startDeg:-90,axDeg:i,f:e});return{pts:s,avgScale:o}})(),a=1/0,o=1/0,s=-1/0,c=-1/0;for(let[e,t]of r)e<a&&(a=e),t<o&&(o=t),e>s&&(s=e),t>c&&(c=t);let l=B.value.strokeWidth/360*Math.min(W.value.width,W.value.height),u=H.value.layout.innerCircle.strokeWidth||0,d=.5*Math.max(l,u*(i||1)),f=Math.max(0,Number(B.value.depth3d)||0),p=d;return{x:a-p,y:o-f-p,w:s-a+2*p,h:c-(o-f)+2*p}});function kt(e){let t=Math.min(W.value.width,W.value.height)*1.45,{d:n,avgScale:r}=Ot({cx:K.value.centerX,cy:K.value.centerY,r:e,startDeg:-90,axDeg:V.value.tiltAngle3d,f:t}),i=(H.value.layout.innerCircle.strokeWidth||1)*r;return{d:n,stroke:H.value.layout.innerCircle.stroke,strokeWidth:i}}let At=w(()=>kt(Math.max(0,K.value.radius*.8*H.value.layout.innerCircle.radiusRatio)));function jt({cx:e,cy:t,r:n,aRad:r,ax:i,f:a}){let[o,s,c]=Ct([n*Math.cos(r),n*Math.sin(r),0],i),[l,u,,d]=wt([o,s,c],a);return{x:e+l,y:t+u,z:c,s:d}}function Mt({cx:e,cy:t,radius:n,innerRatio:r=.8,count:i=120,startDeg:a=-87,axDeg:o=45,f:s=600,activeColor:c,inactiveColor:u,getActive:d,Y:f=0}){let p=o*Math.PI/180,m=n,h=n*r,g=2*Math.PI/i,_=[];for(let n=0;n<i;n+=1){let r=a*Math.PI/180+g*n,o=r+g*Math.min(1,B.value.spacingRatio3d),v=jt({cx:e,cy:t+f,r:m,aRad:r,ax:p,f:s}),y=jt({cx:e,cy:t+f,r:m,aRad:o,ax:p,f:s}),b=jt({cx:e,cy:t+f,r:h,aRad:o,ax:p,f:s}),x=jt({cx:e,cy:t+f,r:h,aRad:r,ax:p,f:s}),ee=(v.z+y.z+x.z+b.z)/4,te=Tt(!d||d(n)?B.value.gradient.show?l(B.value.activeColor,100/i*n/100*(B.value.gradient.shiftHueIntensity/100)):c:u,(()=>{let e=m*Math.sin(p)||1;return(ee- -e)/(2*e)})()),S=`M ${v.x} ${v.y} L ${y.x} ${y.y} L ${b.x} ${b.y} L ${x.x} ${x.y} Z`;_.push({i:n,d:S,fill:te,z:ee})}return _.sort((e,t)=>e.z-t.z),_}let Nt=w(()=>{if(R.value.layout!==`3d`)return null;let e=Z.value;return t=>Mt({cx:K.value.centerX,cy:K.value.centerY,radius:K.value.radius,innerRatio:B.value.sizeRatio,count:e,startDeg:-90,axDeg:V.value.tiltAngle3d,f:Math.min(W.value.width,W.value.height)*1.45,activeColor:B.value.activeColor,inactiveColor:B.value.inactiveColor,getActive:t=>q.value>100/e*t,Y:t})});function Pt(e){let t=H.value.animation.speed,n=Math.abs(e-q.value)/(t*120);function r(){q.value<e?q.value=Math.min(q.value+n,e):q.value>e&&(q.value=Math.max(q.value-n,e)),q.value!==e&&requestAnimationFrame(r)}r()}let Z=w(()=>(xt.value&&B.value.quantity<12&&console.warn(`VueUiWheel - The min number of ticks is 12`),xt.value&&B.value.quantity>200&&console.warn(`VueUiWheel - The max number of ticks is 200`),Math.max(12,Math.min(B.value.quantity,200)))),Q=w(()=>100/Z.value),Ft=w(()=>{let e=[];for(let t=0;t<Z.value;t+=1){let n=q.value>t*Q.value?B.value.activeColor:B.value.inactiveColor,{x:r,y:i}=bt(W.value.size/Z.value*t),{x:a,y:o}=bt(W.value.size/Z.value*t,B.value.sizeRatio);e.push({x1:r,y1:i,x2:a,y2:o,color:B.value.gradient.show?l(n,t*Q.value/Z.value*(B.value.gradient.shiftHueIntensity/100)):n})}return e}),It=w(()=>s({series:Ft.value.map(e=>({name:``,value:1,color:e.color}))},K.value.centerX,K.value.centerY,K.value.radius,K.value.radius,1.99999,2,1,360,105.25,K.value.radius*(1-B.value.sizeRatio))),Lt=A(!1);function Rt(e){Lt.value=e,nt.value+=1}let zt=A(!1);function Bt(){zt.value=!zt.value}let Vt=ee(L,()=>H.value.title.text),Ht=w(()=>B.value.strokeWidth*2),Ut=w(()=>B.value.strokeWidth*2*.75),Wt=w(()=>B.value.strokeWidth),$=w(()=>Math.max(1,Math.min(20,B.value.depth3d))),Gt=w(()=>H.value.backgroundColor),Kt=w(()=>H.value.title),{isCallbackImaging:qt,isCallbackSvg:Jt,generateSvg:Yt,onGenerateImage:Xt}=S({svg:pt,title:Kt,legend:null,legendItems:null,backgroundColor:Gt,stretchTitle:!0,getSvgCallback:()=>R.value.userOptions.callbacks.svg,generateImage:vt});async function Zt(){$e(`copyAlt`,{config:R.value,dataset:U.value}),R.value.userOptions.callbacks.altCopy?await Promise.resolve(R.value.userOptions.callbacks.altCopy({config:R.value,dataset:U.value})):console.warn("Vue Data UI - A callback must be set for `altCopy` in userOptions.")}let Qt=w(()=>`${I.value}-title`),$t=w(()=>`${I.value}-desc`),en=w(()=>f(H.value.layout.percentage.formatter,d(q.value),a({v:d(q.value),s:`%`,r:H.value.layout.percentage.rounding}))),tn=w(()=>H.value.title.text||``),nn=w(()=>lt.value?`...`:`${en.value}`);return b({getImage:Vt,generatePdf:_t,generateImage:vt,generateSvg:Yt,toggleAnnotator:Bt,toggleFullscreen:Rt,copyAlt:Zt}),(e,i)=>(k(),D(`div`,{class:O([`vue-ui-wheel`,{"vue-data-ui-component":!0,"vue-ui-wheel-3d-wrap":R.value.layout===`3d`}]),ref_key:`wheelChart`,ref:L,id:I.value,style:ye(`font-family:${R.value.style.fontFamily};width:100%; text-align:center;background:${H.value.backgroundColor};${R.value.responsive?`height:100%`:``}`),onMouseenter:i[0]||=()=>N(dt)(!0),onMouseleave:i[1]||=()=>N(dt)(!1)},[z.value.buttons.annotator?(k(),T(N(Ye),_e({key:0},N(n)(z.value.annotator),{svgRef:N(pt),backgroundColor:H.value.backgroundColor,color:H.value.color,active:zt.value,isCursorPointer:st.value,palette:z.value.annotatorPalette,onClose:Bt}),pe({_:2},[j(N(r),n=>({name:n,fn:De(r=>[M(e.$slots,n,ve(ge(N(t)(n,r))),void 0,!0)])}))]),1040,[`svgRef`,`backgroundColor`,`color`,`active`,`isCursorPointer`,`palette`])):E(``,!0),yt.value?(k(),D(`div`,{key:1,ref_key:`noTitle`,ref:at,class:`vue-data-ui-no-title-space`,style:`height:36px; width: 100%;background:transparent`},null,512)):E(``,!0),H.value.title.text?(k(),D(`div`,{key:2,ref_key:`chartTitle`,ref:rt,style:`width:100%;background:transparent;padding-bottom:12px`},[(k(),T(te,{key:`title_${ot.value}`,config:{title:{cy:`wheel-title`,...H.value.title},subtitle:{cy:`wheel-subtitle`,...H.value.title.subtitle}}},null,8,[`config`]))],512)):E(``,!0),z.value.show&&et.value&&(N(ft)||N(ut))?(k(),T(N(Xe),_e({ref_key:`details`,ref:tt,key:`user_options_${nt.value}`,backgroundColor:H.value.backgroundColor,color:H.value.color,isPrinting:N(ht),isImaging:N(gt),uid:I.value,hasXls:!1,isFullscreen:Lt.value},N(re)(z.value,`pdf img svg fullscreen altCopy annotator`),{isAnnotation:zt.value,chartElement:L.value,isCursorPointer:st.value,onToggleFullscreen:Rt,onGeneratePdf:N(_t),onGenerateImage:N(Xt),onGenerateSvg:N(Yt),onToggleAnnotator:Bt,onCopyAlt:Zt,style:{visibility:N(ft)?N(ut)?`visible`:`hidden`:`visible`}}),pe({_:2},[j(N(ne)(e.$slots,`menuIcon optionPdf optionImg optionSvg optionFullscreen optionAnnotator optionAltCopy custom-menu-before custom-menu-after`),t=>({name:t,fn:De(n=>[M(e.$slots,t,ve(ge(N(ie)(t,n))),void 0,!0)])}))]),1040,[`backgroundColor`,`color`,`isPrinting`,`isImaging`,`uid`,`isFullscreen`,`isAnnotation`,`chartElement`,`isCursorPointer`,`onGeneratePdf`,`onGenerateImage`,`onGenerateSvg`,`style`])):E(``,!0),(k(),D(`svg`,{ref_key:`svgRef`,ref:pt,xmlns:N(m),class:O({"vue-data-ui-fullscreen--on":Lt.value,"vue-data-ui-fulscreen--off":!Lt.value,"vue-ui-wheel-3d-svg":R.value.layout===`3d`}),viewBox:R.value.layout===`3d`&&!R.value.responsive?`${X.value?.x-10} ${X.value?.y??0} ${X.value?.w+20??Math.max(10,W.value.width)} ${X.value?.h??Math.max(10,W.value.height)}`:`0 0 ${Math.max(10,W.value.width)} ${Math.max(10,W.value.height)}`,style:ye(`max-width:100%;overflow:visible;background:transparent;color:${H.value.color}`),role:`img`,"aria-labelledby":Qt.value,"aria-describedby":$t.value},[fe(`title`,{id:Qt.value},Ce(tn.value),9,je),fe(`desc`,{id:$t.value},Ce(nn.value),9,Me),me(N(Ze)),M(e.$slots,`svg-underlayer`,{svg:{...W.value,isPrintingImg:N(ht)||N(gt)||N(qt),isPrintingSvg:N(Jt)}},void 0,!0),e.$slots[`chart-background`]?(k(),D(`foreignObject`,{key:0,x:R.value.layout===`3d`&&!R.value.responsive?X.value?.x-10:0,y:R.value.layout===`3d`&&!R.value.responsive?X.value?.y??0:0,width:R.value.layout===`3d`&&!R.value.responsive?X.value?.w+20??Math.max(10,W.value.width):Math.max(10,W.value.width),height:R.value.layout===`3d`&&!R.value.responsive?X.value?.h??Math.max(10,W.value.height):Math.max(10,W.value.height),style:{pointerEvents:`none`}},[M(e.$slots,`chart-background`,{},void 0,!0)],8,Ne)):E(``,!0),R.value.layout===`3d`&&At.value?(k(),D(`path`,{key:1,class:`vue-ui-wheel-inner-circle`,d:At.value.d,stroke:H.value.layout.innerCircle.stroke,"stroke-width":H.value.layout.innerCircle.strokeWidth,fill:`none`},null,8,Pe)):H.value.layout.innerCircle.show?(k(),D(`circle`,{key:2,class:`vue-ui-wheel-inner-circle`,cx:K.value.centerX,cy:K.value.centerY,r:Math.max(0,K.value.radius*H.value.layout.innerCircle.radiusRatio*.8),stroke:H.value.layout.innerCircle.stroke,"stroke-width":H.value.layout.innerCircle.strokeWidth,fill:`none`},null,8,Fe)):E(``,!0),R.value.layout===`3d`?(k(),D(C,{key:3},[B.value.type===`classic`?(k(),D(`g`,Ie,[(k(!0),D(C,null,j($.value,e=>(k(),D(`g`,null,[(k(!0),D(C,null,j(Dt.value||[],t=>(k(),D(`line`,{key:t.i,x1:t.x1,y1:t.y1-e,x2:t.x2,y2:t.y2-e,stroke:N(o)(t.color,.25*e/5),"stroke-width":B.value.strokeWidth/360*Math.min(W.value.width,W.value.height),"stroke-linecap":B.value.rounded?`round`:`butt`,class:O({"vue-ui-wheel-tick":!0,"vue-ui-tick-animated":H.value.animation.use&&!N(P)&&t.i*Q.value<=q.value})},null,10,Le))),128))]))),256)),(k(!0),D(C,null,j(Dt.value||[],e=>(k(),D(`line`,{key:e.i,x1:e.x1,y1:e.y1-$.value,x2:e.x2,y2:e.y2-$.value,stroke:e.color,"stroke-width":B.value.strokeWidth/360*Math.min(W.value.width,W.value.height),"stroke-linecap":B.value.rounded?`round`:`butt`,class:O({"vue-ui-wheel-tick":!0,"vue-ui-tick-animated":H.value.animation.use&&!N(P)&&e.i*Q.value<=q.value})},null,10,Re))),128))])):(k(),D(`g`,ze,[(k(!0),D(C,null,j($.value,e=>(k(),D(`g`,null,[(k(!0),D(C,null,j(Nt.value(-e)||[],e=>(k(),D(`path`,{key:e.i,d:e.d,fill:B.value.inactiveColor,stroke:B.value.stroke,"stroke-width":B.value.strokeWidth,"stroke-linecap":`round`,"stroke-linejoin":`round`,class:`vue-ui-wheel-tick`},null,8,Be))),128)),(k(!0),D(C,null,j(Nt.value(-e)||[],t=>(k(),D(`path`,{key:t.i,d:t.d,fill:N(o)(t.fill,.5*e/$.value),stroke:B.value.stroke,"stroke-width":B.value.strokeWidth,"stroke-linecap":`round`,"stroke-linejoin":`round`,class:O({"vue-ui-wheel-tick":!0,"vue-ui-tick-animated-3d":H.value.animation.use&&!N(P)&&t.i*Q.value<=q.value})},null,10,Ve))),128))]))),256)),fe(`g`,null,[(k(!0),D(C,null,j(Nt.value(-$.value)||[],e=>(k(),D(`path`,{key:e.i,d:e.d,fill:e.fill,stroke:B.value.stroke,"stroke-width":B.value.strokeWidth,"stroke-linecap":`round`,"stroke-linejoin":`round`,class:O({"vue-ui-wheel-tick":!0,"vue-ui-tick-animated-3d":H.value.animation.use&&!N(P)&&e.i*Q.value<=q.value})},null,10,He))),128))])]))],64)):(k(),D(C,{key:4},[B.value.type===`classic`?(k(!0),D(C,{key:0},j(Ft.value,(e,t)=>(k(),D(`line`,{x1:e.x1,x2:e.x2,y1:e.y1,y2:e.y2,stroke:e.color,"stroke-width":B.value.strokeWidth/360*Math.min(W.value.width,W.value.height),"stroke-linecap":B.value.rounded?`round`:`butt`,class:O({"vue-ui-wheel-tick":!0,"vue-ui-tick-animated":H.value.animation.use&&!N(P)&&t*Q.value<=q.value})},null,10,Ue))),256)):(k(!0),D(C,{key:1},j(It.value,(e,t)=>(k(),D(`path`,{d:e.arcSlice,fill:e.color,class:O({"vue-ui-wheel-tick":!0,"vue-ui-tick-animated":H.value.animation.use&&!N(P)&&t*Q.value<=q.value}),stroke:B.value.stroke,"stroke-width":B.value.strokeWidth},null,10,We))),256))],64)),H.value.layout.percentage.show?(k(),D(`g`,{key:5,role:`status`,"aria-live":`polite`,"aria-label":N(lt)?`...`:en.value},[N(lt)?(k(),D(`rect`,{key:0,x:K.value.centerX-40,y:K.value.centerY-G.value/2,width:80,height:G.value,fill:`#6A6A6A80`,rx:`3`},null,8,Ke)):(k(),D(`text`,{key:1,"aria-hidden":`true`,x:K.value.centerX+H.value.layout.percentage.offsetX,y:K.value.centerY+G.value/3+H.value.layout.percentage.offsetY,"font-size":G.value,fill:B.value.gradient.show?N(l)(B.value.activeColor,q.value/100*(B.value.gradient.shiftHueIntensity/100)):B.value.activeColor,"text-anchor":`middle`,"font-weight":H.value.layout.percentage.bold?`bold`:`normal`,style:{"font-variant-numeric":`tabluar-nums`},stroke:H.value.layout.percentage.stroke,"stroke-width":H.value.layout.percentage.strokeWidth,"stroke-linecap":`round`,"stroke-linejoin":`round`,"paint-order":`stroke fill`,class:O({"vue-ui-wheel-label":R.value.layout===`3d`})},Ce(en.value),11,qe))],8,Ge)):E(``,!0),M(e.$slots,`svg`,{svg:{...W.value,isPrintingImg:N(ht)||N(gt)||N(qt),isPrintingSvg:N(Jt)}},void 0,!0)],14,Ae)),e.$slots.watermark?(k(),D(`div`,Je,[M(e.$slots,`watermark`,ve(ge({isPrinting:N(ht)||N(gt)||N(qt)||N(Jt)})),void 0,!0)])):E(``,!0),e.$slots.source?(k(),D(`div`,{key:5,ref_key:`source`,ref:it,dir:`auto`},[M(e.$slots,`source`,{},void 0,!0)],512)):E(``,!0),M(e.$slots,`skeleton`,{},()=>[N(lt)?(k(),T(_,{key:0})):E(``,!0)],!0)],46,ke))}},[[`__scopeId`,`data-v-c61f36b5`]]);export{Oe as n,Ye 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,S as l,X as u,Z as d,Zt as f,at as p,b as m,in as h,nt as g,t as _,yt as v,zt as y}from"./lib-rPeBMZrn.js";import{n as ee,t as te}from"./BaseScanner-8NdoBs7B.js";import{n as b,t as x}from"./useHints-C-TwxM0Y.js";import{t as S}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{n as C}from"./resolveChartConfig-CIhClE5R.js";import{t as w}from"./chartImage-DPGnEuYM.js";import{t as T}from"./BaseZoomControls-JSk9zW3D.js";import{n as ne}from"./Title-BliHuXfT.js";import{t as re}from"./useChartExport-BZts4KFb.js";import{n as ie,t as E}from"./tableIntegration-CNoJ1CIY.js";import{n as ae,r as oe,t as se}from"./userOptionsSlots-CWtXN5Q6.js";import{t as ce}from"./usePrinter-DVf3YcG5.js";import{r as le}from"./canvas-lib-22VpOI4_.js";import{t as ue}from"./useResponsive-CENUxfEL.js";import{t as de}from"./A11yDataTable-DWNlWXzs.js";import{t as fe}from"./useUserOptionState-CXlFnwPv.js";import{t as pe}from"./useChartAccessibility-DOMuYJfm.js";import{n as me}from"./annotationViewport-X8fvs7pz.js";import{t as he}from"./usePanZoom-CE6Ofyy8.js";import{t as ge}from"./vue_ui_word_cloud-DBiJtSyL.js";import{Fragment as _e,computed as D,createBlock as O,createCommentVNode as k,createElementBlock as A,createElementVNode as j,createSlots as ve,createTextVNode as ye,createVNode as be,defineAsyncComponent as M,guardReactiveProps as xe,mergeProps as Se,nextTick as Ce,normalizeClass as we,normalizeProps as Te,normalizeStyle as Ee,onBeforeUnmount as De,onMounted as Oe,openBlock as N,ref as P,renderList as ke,renderSlot as F,resolveDynamicComponent as Ae,shallowRef as je,toDisplayString as Me,toRefs as Ne,unref as I,watch as Pe,withCtx as L}from"vue";var Fe={fast:{spiralStep:6,fallbackSpiralStep:2,spiralRadiusStep:2,fallbackSpiralRadiusStep:1,primaryAttempts:1e4,fallbackAttempts:25e3,minimumVisualPadding:2,scaleStep:.9},balanced:{spiralStep:4,fallbackSpiralStep:1,spiralRadiusStep:1.5,fallbackSpiralRadiusStep:1,primaryAttempts:2e4,fallbackAttempts:5e4,minimumVisualPadding:3,scaleStep:.92},precise:{spiralStep:2,fallbackSpiralStep:1,spiralRadiusStep:1,fallbackSpiralRadiusStep:.75,primaryAttempts:5e4,fallbackAttempts:1e5,minimumVisualPadding:4,scaleStep:.95}},Ie=`fast`;function Le(e){return Fe[e]||Fe[Ie]}var Re=/* @__PURE__ */ new Map;function ze(e){let t=String(e),n=Re.get(t);if(n)return n;let r=Math.PI/180,i=[],a=[];for(let t=0;t<360;t+=e){let e=t*r;i.push(Math.cos(e)),a.push(Math.sin(e))}let o={cosineArray:i,sineArray:a};return Re.set(t,o),o}function Be({word:e,fontSize:t,pad:n,canvas:r,ctx:i,svg:a}){let o=a.style&&a.style.bold,s=a.style&&a.style.fontFamily||`Arial, "Noto Sans Arabic", Tahoma, sans-serif`,c=`${o?`bold `:``}${t}px ${s}`,l=String(e.name||``),u=/[\u0600-\u06FF]/.test(l);i.font=c,i.direction=u?`rtl`:`ltr`,i.textAlign=`left`,i.textBaseline=`alphabetic`;let d=i.measureText(l),f=Math.ceil(Math.abs(d.actualBoundingBoxLeft||0)),p=Math.ceil(Math.abs(d.actualBoundingBoxRight||d.width)),m=Math.ceil(d.actualBoundingBoxAscent||t),h=Math.ceil(d.actualBoundingBoxDescent||t*.25),g=Math.max(0,Math.round(n||0))+Math.ceil(t*(u?.22:.12)),_=Math.max(1,f+p+g*2),v=Math.max(1,m+h+g*2);r.width=_,r.height=v,i.font=c,i.direction=u?`rtl`:`ltr`,i.textAlign=`left`,i.textBaseline=`alphabetic`,i.fillStyle=`black`;let y=g+f,ee=g+m;i.fillText(l,y,ee);let te=i.getImageData(0,0,_,v).data,b=[],x=[],S=_,C=v,w=0,T=0,ne=!1;for(let e=0;e<v;e+=1){let t=e*_*4,n=-1,r=!1;for(let i=0;i<_;i+=1)te[t+i*4+3]>1?(b.push([i,e]),ne=!0,i<S&&(S=i),i>w&&(w=i),e<C&&(C=e),e>T&&(T=e),r||(r=!0,n=i)):r&&(x.push([e,n,i-1]),r=!1,n=-1);r&&x.push([e,n,_-1])}return ne||(S=0,C=0,w=0,T=0),{w:_,h:v,wordMask:b,runs:x,minX:S,minY:C,maxX:w,maxY:T}}function Ve(e){let t=[];if(!e.length)return t;let n=e[0][1],r=e[0][0],i=r;for(let a=1;a<e.length;a+=1){let o=e[a][0],s=e[a][1];s===n?(o===i+1||(t.push([n,r,i]),r=o),i=o):(t.push([n,r,i]),n=s,r=o,i=o)}return t.push([n,r,i]),t}function He(e,t){return 4294967295>>>32-(t-e+1)<<e>>>0}function Ue(e){return 4294967295<<e>>>0}function We(e){return 4294967295>>>31-e>>>0}function R({maskBits:e,maskRowStride:t,maskW:n,maskH:r,wx:i,wy:a,runs:o}){for(let s=0;s<o.length;s+=1){let c=o[s][0],l=o[s][1],u=o[s][2],d=a+c;if(d<0||d>=r)return!1;let f=i+l,p=i+u;if(f<0||p>=n)return!1;let m=d*t,h=f>>>5,g=p>>>5,_=f&31,v=p&31;if(h===g){if(e[m+h]&He(_,v))return!1}else{if(e[m+h]&Ue(_))return!1;for(let t=h+1;t<g;t+=1)if(e[m+t])return!1;if(e[m+g]&We(v))return!1}}return!0}function Ge({maskBits:e,maskRowStride:t,maskW:n,maskH:r,wx:i,wy:a,runs:o}){for(let s=0;s<o.length;s+=1){let c=o[s][0],l=o[s][1],u=o[s][2],d=a+c;if(d<0||d>=r)continue;let f=i+l,p=i+u;if(p<0||f>=n)continue;let m=d*t,h=f>>>5,g=p>>>5,_=f&31,v=p&31;if(h===g){let t=He(_,v);e[m+h]|=t}else{{let t=Ue(_);e[m+h]|=t}for(let t=h+1;t<g;t+=1)e[m+t]=4294967295;{let t=We(v);e[m+g]|=t}}}}function Ke({wordMask:e,w:t,h:n,dilation:r}){let i=new Uint8Array(t*n),a=[];for(let n=0;n<e.length;n+=1){let r=e[n][0],o=e[n][1]*t+r;i[o]||(i[o]=1,a.push(o))}for(let e=0;e<a.length;e+=1){let o=a[e],s=o/t|0,c=o-s*t;for(let e=-r;e<=r;e+=1){let a=s+e;if(a<0||a>=n)continue;let o=a*t;for(let n=-r;n<=r;n+=1){if(n===0&&e===0)continue;let r=c+n;r<0||r>=t||(i[o+r]=1)}}}let o=[];for(let e=0;e<i.length;e+=1)if(i[e]){let n=e/t|0,r=e-n*t;o.push([r,n])}return o}function z(e,t){let n=[];for(let r=0;r<t;r+=1){let t=e[r];if(!t||t.length===0)continue;t.sort((e,t)=>e[0]-t[0]);let i=t[0][0],a=t[0][1];for(let e=1;e<t.length;e+=1){let o=t[e][0],s=t[e][1];o<=a+1?s>a&&(a=s):(n.push([r,i,a]),i=o,a=s)}n.push([r,i,a])}return n}function qe({runs:e,w:t,h:n,dilation:r}){if(!e.length||r<=0)return e;let i=Array(n);for(let a=0;a<e.length;a+=1){let o=e[a],s=o[0],c=Math.max(0,o[1]-r),l=Math.min(t-1,o[2]+r),u=Math.max(0,s-r),d=Math.min(n-1,s+r);for(let e=u;e<=d;e+=1){let t=i[e];t||(t=[],i[e]=t),t.push([c,l])}}return z(i,n)}function B(e,t){let n=e.runs,r=e.w,i=e.h,a=Math.max(1,Math.round(r*t)),o=Math.max(1,Math.round(i*t)),s=Array(o),c=a,l=o,u=0,d=0,f=!1;for(let e=0;e<n.length;e+=1){let r=n[e],i=r[0],a=r[1],p=r[2],m=Math.round(i*t);if(m<0||m>=o)continue;let h=Math.round(a*t),g=Math.round((p+1)*t)-1;if(g<h)continue;let _=s[m];_||(_=[],s[m]=_),_.push([h,g]),f=!0,h<c&&(c=h),g>u&&(u=g),m<l&&(l=m),m>d&&(d=m)}if(!f)return{w:a,h:o,runs:[],minX:0,minY:0,maxX:0,maxY:0};let p=[];for(let e=0;e<o;e+=1){let t=s[e];if(!t||t.length===0)continue;t.sort((e,t)=>e[0]-t[0]);let n=t[0][0],r=t[0][1];for(let i=1;i<t.length;i+=1){let a=t[i][0],o=t[i][1];a<=r+1?o>r&&(r=o):(p.push([e,n,r]),n=a,r=o)}p.push([e,n,r])}return{w:a,h:o,runs:p,minX:c,minY:l,maxX:u,maxY:d}}var Je=/* @__PURE__ */ new Map,Ye=/* @__PURE__ */ new Map;function Xe({word:e,fontSize:t,pad:n,svg:r}){let i=r.style&&r.style.bold?1:0,a=n||0;return`${e.name}::${t}::${a}::${i}`}function Ze({word:e,fontSize:t,pad:n,canvas:r,ctx:i,svg:a}){let o=Xe({word:e,fontSize:t,pad:n,svg:a}),s=Je.get(o);if(s)return{key:o,bitmap:s};let c=Be({word:e,fontSize:t,pad:n,canvas:r,ctx:i,svg:a});return Je.set(o,c),{key:o,bitmap:c}}function Qe({bitmapKey:e,wordMask:t,w:n,h:r,dilation:i}){let a=`${e}::d${i}`,o=Ye.get(a);if(o)return o;let s=Ke({wordMask:t,w:n,h:r,dilation:i}),c={wordMask:s,runs:Ve(s)};return Ye.set(a,c),c}function $e(e,t,n){if(!e.length)return;let r=1/0,i=-1/0,a=1/0,o=-1/0;for(let t=0;t<e.length;t+=1){let n=e[t],s=n.x+n.minX,c=n.x+n.maxX,l=n.y+n.minY,u=n.y+n.maxY;s<r&&(r=s),c>i&&(i=c),l<a&&(a=l),u>o&&(o=u)}if(!isFinite(r)||!isFinite(i)||!isFinite(a)||!isFinite(o))return;let s=Math.max(Math.abs(r),Math.abs(i)),c=Math.max(Math.abs(a),Math.abs(o));if(s===0||c===0)return;let l=.9,u=t*.5*l/s,d=n*.5*l/c,f=Math.min(u,d);if(!(f<=1)){f>4&&(f=4);for(let t=0;t<e.length;t+=1){let n=e[t];n.x*=f,n.y*=f,n.width*=f,n.height*=f,n.fontSize*=f,n.minX*=f,n.maxX*=f,n.minY*=f,n.maxY*=f}}}function et(){return typeof performance<`u`&&typeof performance.now==`function`?()=>performance.now():()=>Date.now()}function tt({value:e,minimumValue:t,maximumValue:n,configuredMinimumFontSize:r,maximumFontSize:i}){if(n===t)return i;let a=(e-t)/(n-t)*(i-r)+r;return Math.max(r,Math.min(i,a))}function nt({bitmapHeight:e,proximity:t,strictPixelPadding:n,minimumVisualPadding:r}){let i=Math.max(0,Math.round(t||0)),a=Math.ceil(e*.035)+2;return Math.max(i,a,n?3:0,r)}function rt({currentBitmap:e,strictPixelPadding:t,scaleFactor:n,baseBitmap:r,bitmapKey:i,proximity:a,minimumVisualPadding:o}){let s=e.runs,c=e.w,l=e.h,u=e.minX,d=e.minY,f=e.maxX,p=e.maxY;if(!s.length)return{runs:s,bitmapWidth:c,bitmapHeight:l,bitmapMinimumX:u,bitmapMinimumY:d,bitmapMaximumX:f,bitmapMaximumY:p};let m=nt({bitmapHeight:l,proximity:a,strictPixelPadding:t,minimumVisualPadding:o});return m<=0?{runs:s,bitmapWidth:c,bitmapHeight:l,bitmapMinimumX:u,bitmapMinimumY:d,bitmapMaximumX:f,bitmapMaximumY:p}:n===1&&m===2&&t?{runs:Qe({bitmapKey:i,wordMask:r.wordMask,w:r.w,h:r.h,dilation:m}).runs,bitmapWidth:c,bitmapHeight:l,bitmapMinimumX:u,bitmapMinimumY:d,bitmapMaximumX:f,bitmapMaximumY:p}:{runs:qe({runs:s,w:c,h:l,dilation:m}),bitmapWidth:c,bitmapHeight:l,bitmapMinimumX:u,bitmapMinimumY:d,bitmapMaximumX:f,bitmapMaximumY:p}}async function V({baseBitmap:e,baseFontSize:t,minimumScaleFactor:n,maskBits:r,maskRowStride:i,maskWidth:a,maskHeight:o,centerX:s,centerY:c,maximumRadius:l,scaleStep:u,strictPixelPadding:d,bitmapKey:f,minimumFontSize:p,rawWord:m,cosineArray:h,sineArray:g,radiusStep:_,maximumAttempts:v,maybeYield:y,proximity:ee,minimumVisualPadding:te}){let b=1;for(;b>=n;){let{runs:n,bitmapWidth:x,bitmapHeight:S,bitmapMinimumX:C,bitmapMinimumY:w,bitmapMaximumX:T,bitmapMaximumY:ne}=rt({currentBitmap:b===1?e:B(e,b),strictPixelPadding:d,scaleFactor:b,baseBitmap:e,bitmapKey:f,proximity:ee,minimumVisualPadding:te}),re=0,ie=0;for(;re<l&&ie<v;){for(let e=0;e<h.length;e+=1){ie+=1;let l=Math.round(s+re*h[e]-x/2),u=Math.round(c+re*g[e]-S/2);if(!(l<0||u<0||l+x>a||u+S>o)&&R({maskBits:r,maskRowStride:i,maskW:a,maskH:o,wx:l,wy:u,runs:n})){let{__wcIndex:e,...s}=m,c=Math.max(p,Math.round(t*b)),d={...s,x:l-a/2,y:u-o/2,fontSize:c,width:x,height:S,angle:0,minX:C,minY:w,maxX:T,maxY:ne};return Ge({maskBits:r,maskRowStride:i,maskW:a,maskH:o,wx:l,wy:u,runs:n}),d}}re+=_,ie&1023||await y()}b*=u,await y()}return null}async function it({baseBitmap:e,baseFontSize:t,minimumScaleFactor:n,maskBits:r,maskRowStride:i,maskWidth:a,maskHeight:o,centerX:s,centerY:c,maximumRadius:l,scaleStep:u,strictPixelPadding:d,bitmapKey:f,minimumFontSize:p,rawWord:m,maybeYield:h,proximity:g,qualityPreset:_,primarySpiral:v,fallbackSpiral:y}){return await V({baseBitmap:e,baseFontSize:t,minimumScaleFactor:n,maskBits:r,maskRowStride:i,maskWidth:a,maskHeight:o,centerX:s,centerY:c,maximumRadius:l,scaleStep:u,strictPixelPadding:d,bitmapKey:f,minimumFontSize:p,rawWord:m,cosineArray:v.cosineArray,sineArray:v.sineArray,radiusStep:_.spiralRadiusStep,maximumAttempts:_.primaryAttempts,maybeYield:h,proximity:g,minimumVisualPadding:_.minimumVisualPadding})||await V({baseBitmap:e,baseFontSize:t,minimumScaleFactor:n,maskBits:r,maskRowStride:i,maskWidth:a,maskHeight:o,centerX:s,centerY:c,maximumRadius:l,scaleStep:u,strictPixelPadding:d,bitmapKey:f,minimumFontSize:p,rawWord:m,cosineArray:y.cosineArray,sineArray:y.sineArray,radiusStep:_.fallbackSpiralRadiusStep,maximumAttempts:_.fallbackAttempts,maybeYield:h,proximity:g,minimumVisualPadding:_.minimumVisualPadding})}async function at({words:e,proximity:t=0,svg:n,strictPixelPadding:r,quality:i=Ie,onProgress:a,debugTiming:o=!1}){let s=et(),c=s(),l=c;async function u(){s()-l>=12&&(await new Promise(e=>setTimeout(e,0)),l=s())}let d=n.width,f=n.height,p=Math.round(d),m=Math.round(f),h=Le(i),g=ze(h.spiralStep),_=ze(h.fallbackSpiralStep),v=n.minFontSize,y=Math.min(n.maxFontSize,100),ee=e.map(e=>e.value),te=Math.min(...ee),b=Math.max(...ee);if(p<=0||m<=0)return[];let x=p+31>>>5,S=new Uint32Array(x*m),C=document.createElement(`canvas`),w=C.getContext(`2d`,{willReadFrequently:!0});C.width=p,C.height=m;let T=Math.max(p,m),ne=Math.floor(p/2),re=Math.floor(m/2),ie=[...e.map((e,t)=>({...e,__wcIndex:t,id:e.id==null?`${e.name}__${t}`:e.id}))].sort((e,t)=>t.value-e.value),E=[],ae=h.scaleStep;for(let e=0;e<ie.length;e+=1){let i=ie[e],o=E.length,s=tt({value:i.value,minimumValue:te,maximumValue:b,configuredMinimumFontSize:v,maximumFontSize:y}),c=Ze({word:i,fontSize:s,pad:t,canvas:C,ctx:w,svg:n}),l=c.key,d=c.bitmap,f=d.w,ee=d.h;if(f<=0||ee<=0){await u();continue}let oe=await it({baseBitmap:d,baseFontSize:s,minimumScaleFactor:Math.max(1/s,.1),maskBits:S,maskRowStride:x,maskWidth:p,maskHeight:m,centerX:ne,centerY:re,maximumRadius:T,scaleStep:ae,strictPixelPadding:r,bitmapKey:l,minimumFontSize:1,rawWord:i,maybeYield:u,proximity:t,qualityPreset:h,primarySpiral:g,fallbackSpiral:_});if(oe&&(E.push(oe),a&&E.length>o)){let e=E[E.length-1];a({word:e,all:E})}await u()}if(!E.length)return[];$e(E,p,m);let oe=s()-c;return o&&typeof console<`u`&&console.log&&console.log(`[vue-data-ui][word-cloud] positionWordsAsync:`,`${oe.toFixed(2)} ms for ${e.length} words`),E.sort((e,t)=>t.fontSize-e.fontSize)}var ot=/* @__PURE__ */ e({default:()=>bt}),st=[`id`,`data-resizing`,`data-relayout`],ct=[`id`],lt={style:{position:`relative`}},ut=[`aria-describedby`,`xmlns`,`viewBox`],dt=[`width`,`height`],ft=[`transform`],pt=[`transform`],mt=[`data-a11y-word-index`,`x`,`y`,`width`,`height`,`aria-label`,`onMouseover`,`onMouseleave`,`onClick`],ht=[`fill`,`font-weight`,`font-size`,`transform`,`stroke`,`stroke-width`],gt={key:0,style:{position:`absolute`,top:`100%`,left:`0`,width:`100%`},"data-dom-to-png-ignore":``,"aria-hidden":`true`},_t={key:5,class:`vue-data-ui-watermark`},vt={key:6,"data-dom-to-png-ignore":``,class:`reset-wrapper`},yt={style:{display:`flex`,"align-items":`center`}},bt=/*#__PURE__*/ S({__name:`vue-ui-word-cloud`,props:{config:{type:Object,default(){return{}}},dataset:{type:[Array,String],default(){return[]}}},emits:[`copyAlt`],setup(e,{expose:S,emit:Fe}){let Ie=M(()=>import(`./Tooltip-C1q0Qoh7.js`)),Le=M(()=>import(`./BaseIcon-CoY0vuL3.js`).then(e=>e.n)),Re=M(()=>import(`./vue-ui-accordion-E8TJfFeK.js`).then(e=>e.n)),ze=M(()=>import(`./DataTable-Dof6yhO7.js`)),Be=M(()=>import(`./PenAndPaper-DoNTA-SV.js`).then(e=>e.t)),Ve=M(()=>import(`./UserOptions-B9EyfU9n.js`).then(e=>e.n)),He=M(()=>import(`./PackageVersion-DKSNC-YP.js`).then(e=>e.t)),Ue=M(()=>import(`./BaseDraggableDialog-BK7dj9O6.js`).then(e=>e.n)),{vue_ui_word_cloud:We}=i(),R=e,Ge=Fe,Ke=D({get(){return!!R.dataset&&R.dataset.length},set(e){return e}}),z=P(u()),qe=P(0),B=P(null),Je=P(null),Ye=P(null),Xe=P(0),Ze=P(0),Qe=P(!1),$e=P(null),et=P(null),tt=P(!1),nt=P(!1),rt=P(null),V=P(null),it=P({x:0,y:0}),ot=P(`pointer`),bt=P(!1),H=P(Mt()),U=D(()=>H.value.userOptions),W=D(()=>H.value.style.chart.tooltip),xt=D(()=>H.value.style.chart.controls),G=D(()=>H.value.style.chart.words),K=D(()=>H.value.style.chart);b({config:()=>H.value,dataset:()=>R.dataset,component:`VueUiWordCloud`,rules:[x.noHint]});let St=D(()=>H.value.userOptions.useCursorPointer),Ct=D(()=>h({defaultConfig:{userOptions:{show:!1},table:{show:!1},useCssAnimation:!1,animationDelayMs:0,nodeCategories:{},nodeCategoryColors:{},style:{chart:{backgroundColor:`#99999930`,words:{color:`#6A6A6A`,usePalette:!1,selectedStroke:`#CCCCCC`}}}},userConfig:H.value.skeletonConfig??{}})),{loading:wt,FINAL_DATASET:Tt,manualLoading:Et}=ee({...Ne(R),FINAL_CONFIG:H,prepareConfig:Mt,callback:()=>{Promise.resolve().then(()=>{X.value.showTable=H.value.table.show,X.value.showTooltip=W.value.show,X.value.showZoom=K.value.zoom.show})},skeletonDataset:R.config?.skeletonDataset??[{name:`Lorem`,value:6},{name:`ipsum`,value:3},{name:`dolor`,value:1},{name:`sit`,value:3},{name:`amet`,value:3},{name:`consectetur`,value:2},{name:`adipiscing`,value:1},{name:`elit`,value:2},{name:`Vivamus`,value:2},{name:`pulvinar`,value:1},{name:`pretium`,value:1},{name:`venenatis`,value:2},{name:`Donec`,value:1},{name:`imperdiet`,value:3},{name:`id`,value:1},{name:`porttitor`,value:2},{name:`tristique`,value:1},{name:`Aenean`,value:2},{name:`ac`,value:5},{name:`commodo`,value:2},{name:`justo`,value:2},{name:`Vestibulum`,value:2},{name:`placerat`,value:1},{name:`molestie`,value:1},{name:`nisl`,value:1},{name:`lacinia`,value:2},{name:`nulla`,value:1},{name:`posuere`,value:2},{name:`quis`,value:3},{name:`ullamcorper`,value:1},{name:`eu`,value:1},{name:`ex`,value:1},{name:`vitae`,value:3},{name:`facilisis`,value:1},{name:`Aliquam`,value:1},{name:`erat`,value:1},{name:`volutpat`,value:1},{name:`Proin`,value:1},{name:`nunc`,value:1},{name:`felis`,value:1},{name:`gravida`,value:3},{name:`sed`,value:1},{name:`orci`,value:1},{name:`Interdum`,value:1},{name:`et`,value:1},{name:`malesuada`,value:1},{name:`fames`,value:1},{name:`ante`,value:1}],skeletonConfig:h({defaultConfig:H.value,userConfig:Ct.value})}),Dt=P(Ot());function Ot(){return typeof Tt.value==`string`?d(Tt.value):Tt.value.map((e,t)=>({...e,value:m(e.value)}))}let{userOptionsVisible:kt,setUserOptionsVisibility:At,keepUserOptionState:jt}=fe({config:H.value}),{svgRef:q}=pe({config:K.value.title});function Mt(){return C(R.config,We,ge)}let Nt=P({x:0,y:0});function Pt(){let e={x:0,y:0,width:Math.max(10,J.value.width),height:Math.max(10,J.value.height)};dn(e),Nt.value={x:e.x+e.width/2,y:e.y+e.height/2},ln()}let Ft=le(()=>{Yt()},100),It=P(!1);Pe(()=>It.value,e=>{e===!1&&(nt.value=!0,Ft(),Pt())});let Lt=f(R.config);Pe(()=>R.config,(e,t)=>{let n=f(e),r=n!==Lt;Lt=n;let i=Mt();r?(H.value=i,kt.value=!H.value.userOptions.showOnChartHover,Ht(),Xe.value+=1,Ze.value+=1,X.value.showTable=H.value.table.show,X.value.showTooltip=W.value.show,X.value.showZoom=K.value.zoom.show):(H.value.style.chart.tooltip=i.style.chart.tooltip,X.value.showTooltip=H.value.style.chart.tooltip.show)},{deep:!0});let J=P({width:K.value.width,height:K.value.height,maxFontSize:G.value.maxFontSize,minFontSize:G.value.minFontSize,bold:G.value.bold}),Rt=le(()=>{let{width:e,height:t}=ue({chart:B.value,title:K.value.title.text?Je.value:null,legend:xt.value.show?rt.value?.$el:null,source:Ye.value});requestAnimationFrame(async()=>{J.value.width=Math.max(10,e),J.value.height=Math.max(10,t-12),await Ce(),It.value=!1})},100),zt=()=>{It.value=!0,Rt()},Y=je(null),Bt=je(null);Oe(Ht);let Vt=D(()=>H.value.debug);function Ht(){y(R.dataset)?p({componentName:`VueUiWordCloud`,type:`dataset`,debug:Vt.value}):Dt.value.forEach((e,t)=>{v({datasetObject:e,requiredAttributes:[`name`,`value`]}).forEach(e=>{Ke.value=!1,p({componentName:`VueUiWordCloud`,type:`datasetSerieAttribute`,property:e,index:t,debug:Vt.value})})}),y(R.dataset)||(Et.value=H.value.loading),H.value.responsive&&(Y.value&&(Bt.value&&Y.value.unobserve(Bt.value),Y.value.disconnect()),Y.value=new ResizeObserver(zt),Bt.value=B.value.parentNode,Y.value.observe(Bt.value)),Pt()}De(()=>{Y.value&&(Bt.value&&Y.value.unobserve(Bt.value),Y.value.disconnect())});let{isPrinting:Ut,isImaging:Wt,generatePdf:Gt,generateImage:Kt}=ce({elementId:`wordCloud_${z.value}`,fileName:K.value.title.text||`vue-ui-word-cloud`,options:H.value.userOptions.print}),X=P({showTable:H.value.table.show,showTooltip:W.value.show,showZoom:K.value.zoom.show});Pe(H,()=>{X.value.showTable=H.value.table.show,X.value.showTooltip=W.value.show,X.value.showZoom=K.value.zoom.show},{immediate:!0});function qt(e,t,n=`Arial`){let r=document.createElement(`canvas`).getContext(`2d`);return r.font=`${t}px ${G.value.bold?`bold`:`normal`} ${n}`,{width:r.measureText(e).width+G.value.proximity,height:t}}let Z=P([]),Jt=/* @__PURE__ */ new Map;function Yt(){let e=[...Dt.value].map(e=>e.value),t=Math.max(...e),n=Math.min(...e),r=[...Dt.value].map((e,r)=>{let i=(e.value-n)/(t-n)*(J.value.maxFontSize-J.value.minFontSize)+J.value.minFontSize;i=isNaN(i)?J.value.minFontSize:i;let a=qt(e.name,i);return{...e,id:e.id??`${e.name}__${r}`,fontSize:i,width:a.width,height:a.height,color:e.color?l(e.color):G.value.usePalette?H.value.customPalette[r]||H.value.customPalette[r%H.value.customPalette.length]||c[r]||c[r%c.length]:G.value.color}});Z.value.length=0,Jt.clear(),at({debugTiming:Vt.value,words:r,svg:J.value,proximity:G.value.proximity,strictPixelPadding:H.value.strictPixelPadding,quality:H.value.quality,onProgress:({all:e})=>{for(let t of e){let e=t.id,n=Jt.get(e);if(n===void 0)n=Z.value.length,Jt.set(e,n),Z.value.push({...t});else{let e=Z.value[n];e.x=t.x,e.y=t.y,e.width=t.width,e.height=t.height,e.fontSize=t.fontSize,e.minX=t.minX,e.minY=t.minY,e.maxX=t.maxX,e.maxY=t.maxY}}}}),Z.value.sort((e,t)=>t.fontSize-e.fontSize),Jt.clear(),Z.value.forEach((e,t)=>{Jt.set(e.id,t)}),tt.value=!0,nt.value=!1}let Xt=D(()=>({head:Z.value.map(e=>({name:e.name,color:e.color})),body:Z.value.map(e=>e.value)}));function Zt(e=null){Ce(()=>{let t=Xt.value.head.map((e,t)=>[[e.name],[Xt.value.body[t]]]),n=[[K.value.title.text],[K.value.title.subtitle.text],[[``],[H.value.table.columnNames.value]]].concat(t),r=o(n);e?e(r):g({csvContent:r,title:K.value.title.text||`vue-ui-word-cloud`})})}let Qt=D(()=>{let e=[H.value.table.columnNames.series,H.value.table.columnNames.value],t=Xt.value.head.map((e,t)=>{let n=a({p:H.value.table.td.prefix,v:Xt.value.body[t],s:H.value.table.td.suffix,r:H.value.table.td.roundingValue});return[{color:e.color,name:e.name},n]}),n=t.map(e=>e.map((e,t)=>t===0?e.name:e)),r={th:{backgroundColor:H.value.table.th.backgroundColor,color:H.value.table.th.color,outline:H.value.table.th.outline},td:{backgroundColor:H.value.table.td.backgroundColor,color:H.value.table.td.color,outline:H.value.table.td.outline},breakpoint:H.value.table.responsiveBreakpoint};return{colNames:[H.value.table.columnNames.series,H.value.table.columnNames.value],head:e,body:t,a11yBody:n,config:r}}),Q=P(!1);function $t(e){Q.value=e,qe.value+=1}function en(){return Z.value}function tn(){X.value.showTable=!X.value.showTable}function nn(){X.value.showTooltip=!X.value.showTooltip}let rn=P(!1);function an(){rn.value=!rn.value}function on(){X.value.showZoom=!X.value.showZoom}let sn=D(()=>!rn.value&&X.value.showZoom),{viewBox:cn,resetZoom:ln,isZoom:un,setInitialViewBox:dn,zoomByFactor:fn,scale:pn}=he(q,{x:0,y:0,width:J.value.width<=0?10:J.value.width,height:J.value.height<=0?10:J.value.height},1,sn);Pe(()=>R.dataset,()=>{Dt.value=Ot(),H.value.responsive||(Yt(),Pt())},{immediate:!0});let mn=w(B,()=>K.value.title.text),hn=D(()=>E({config:H,style:K,mutableConfig:X,dialog:Ue,accordion:Re,isFullscreen:Q,parent:B,maxWidth:500,isCursorPointer:St}));Pe(()=>X.value.showTable,e=>ie(e,H,$e));function gn(){X.value.showTable=!1,et.value&&et.value.setTableIconState(!1)}let _n=D(()=>K.value.backgroundColor),vn=D(()=>K.value.title),{isCallbackImaging:yn,isCallbackSvg:bn,generateSvg:xn,onGenerateImage:Sn}=re({svg:q,title:vn,legend:null,legendItems:null,backgroundColor:_n,getSvgCallback:()=>H.value.userOptions.callbacks.svg,generateImage:Kt});function Cn(){fn(1.5,!0)}function wn(){fn(1/1.5,!0)}let $=P(null),Tn=P(!1),En=P(``),Dn=P(null);function On(){$.value=null,V.value=null,Qe.value=!1}function kn(e,t){H.value.events.datapointLeave&&H.value.events.datapointLeave({datapoint:e,seriesIndex:t}),(V.value!==t||ot.value!==`keyboard`)&&($.value=null,Qe.value=!1)}function An(e,t){H.value.events.datapointClick&&H.value.events.datapointClick({datapoint:e,seriesIndex:t})}function jn(e){if(!q.value||e==null)return;let t=q.value.querySelector(`[data-a11y-word-index="${e}-${z.value}"]`);if(!t)return;let n=t.getBoundingClientRect();it.value={x:n.left+n.width/2,y:n.top+n.height/2}}function Mn(e,t,n=`pointer`){if(H.value.events.datapointEnter&&H.value.events.datapointEnter({datapoint:e,seriesIndex:t}),!X.value.showTooltip)return;ot.value=n,V.value=t,$.value=e.id,Dn.value={datapoint:e,config:H.value,seriesIndex:t};let r=W.value.customFormat;if(Tn.value=!1,s(r))try{let t=r({datapoint:e,config:H.value});typeof t==`string`&&(En.value=t,Tn.value=!0)}catch{console.warn(`Custom format cannot be applied.`),Tn.value=!1}if(!Tn.value){let t=`<svg viewBox="0 0 10 10" height="${W.value.fontSize}"><circle cx="5" cy="5" r="5" fill="${e.color}"/></svg><span>${e.name}:</span><b>${(e.value||0).toFixed(W.value.roundingValue)}</b>`;En.value=`<div dir="auto" style="display:flex; gap:4px; align-items:center; jsutify-content:center;">${t}</div>`}n===`keyboard`&&Ce(()=>{jn(t)}),Qe.value=!0}async function Nn(){Ge(`copyAlt`,{config:H.value,dataset:Z.value}),H.value.userOptions.callbacks.altCopy?await Promise.resolve(H.value.userOptions.callbacks.altCopy({config:H.value,dataset:Z.value})):console.warn("Vue Data UI - A callback must be set for `altCopy` in userOptions.")}function Pn(){V.value=null,bt.value=!0}function Fn(){On(),bt.value=!1}function In(e){if(!q.value||rn.value||document.activeElement!==q.value||!Z.value.length)return;let t=e.key===`ArrowLeft`||e.key===`ArrowUp`,n=e.key===`ArrowRight`||e.key===`ArrowDown`,r=e.key===`Enter`||e.key===` `,i=e.key===`Escape`;if(!t&&!n&&!r&&!i)return;if(e.preventDefault(),e.stopPropagation(),i){On();return}if(r){if(V.value===null)return;let e=Z.value[V.value];if(!e)return;An(e,V.value);return}let a=V.value;a===null||a<0||a>=Z.value.length?a=n?0:Z.value.length-1:(a+=n?1:-1,a<0&&(a=Z.value.length-1),a>=Z.value.length&&(a=0));let o=Z.value[a];o&&Mn(o,a,`keyboard`)}let Ln=D(()=>({headers:Qt.value?.colNames??[],rows:Qt.value?.a11yBody??[]}));S({getData:en,getImage:mn,generateCsv:Zt,generatePdf:Gt,generateImage:Kt,generateSvg:xn,resetZoom:ln,toggleTable:tn,toggleTooltip:nn,toggleAnnotator:an,toggleFullscreen:$t,toggleZoom:on,copyAlt:Nn});let Rn=D(()=>me(H.value.userOptions?.annotator?.followZoom,cn.value));return(e,i)=>(N(),A(`div`,{class:`vue-data-ui-component vue-ui-word-cloud`,ref_key:`wordCloudChart`,ref:B,id:`wordCloud_${z.value}`,"data-resizing":It.value,"data-relayout":nt.value,style:Ee(`width: 100%; font-family:${H.value.style.fontFamily};background:${K.value.backgroundColor};${H.value.responsive?`height:100%`:``}`),onMouseenter:i[3]||=()=>I(At)(!0),onMouseleave:i[4]||=()=>{I(At)(!1),bt.value||On()}},[j(`div`,{id:`chart-instructions-${z.value}`,class:`sr-only`},[j(`p`,null,Me(H.value.a11y.translations.keyboardNavigation),1)],8,ct),Ln.value?.rows?.length?(N(),O(de,{key:0,uid:z.value,head:Ln.value.headers,body:Ln.value.rows,notice:H.value.a11y.translations.tableAvailable,caption:H.value.a11y.translations.tableCaption},null,8,[`uid`,`head`,`body`,`notice`,`caption`])):k(``,!0),U.value.buttons.annotator?(N(),O(I(Be),Se({key:1},I(n)(U.value.annotator),{svgRef:I(q),followZoom:H.value.userOptions?.annotator?.followZoom,annotationViewport:Rn.value,backgroundColor:K.value.backgroundColor,color:K.value.color,active:rn.value,isCursorPointer:St.value,palette:U.value.annotatorPalette,onClose:an}),ve({_:2},[ke(I(r),n=>({name:n,fn:L(r=>[F(e.$slots,n,Te(xe(I(t)(n,r))),void 0,!0)])}))]),1040,[`svgRef`,`followZoom`,`annotationViewport`,`backgroundColor`,`color`,`active`,`isCursorPointer`,`palette`])):k(``,!0),K.value.title.text?(N(),A(`div`,{key:2,ref_key:`chartTitle`,ref:Je,style:`width:100%;background:transparent;padding-bottom:24px`},[(N(),O(ne,{key:`title_${Xe.value}`,config:{title:{...K.value.title},subtitle:{...K.value.title.subtitle}}},null,8,[`config`]))],512)):k(``,!0),U.value.show&&Ke.value&&(I(jt)||I(kt))?(N(),O(I(Ve),Se({ref_key:`userOptionsRef`,ref:et,key:`user_option_${qe.value}`,backgroundColor:K.value.backgroundColor,color:K.value.color,isPrinting:I(Ut),isImaging:I(Wt),uid:z.value,isFullscreen:Q.value,chartElement:B.value},I(oe)(U.value,`pdf csv img svg table fullscreen altCopy annotator zoom`),{hasTooltip:W.value.show&&U.value.buttons.tooltip,isTooltip:X.value.showTooltip,isAnnotation:rn.value,tableDialog:H.value.table.useDialog,isZoom:X.value.showZoom,isCursorPointer:St.value,onToggleFullscreen:$t,onGeneratePdf:I(Gt),onGenerateCsv:Zt,onGenerateImage:I(Sn),onGenerateSvg:I(xn),onToggleTable:tn,onToggleTooltip:nn,onToggleAnnotator:an,onToggleZoom:on,onCopyAlt:Nn,style:{visibility:I(jt)?I(kt)?`visible`:`hidden`:`visible`}}),ve({_:2},[ke(I(ae)(e.$slots,`menuIcon optionTooltip optionPdf optionCsv optionImg optionSvg optionTable optionFullscreen optionAnnotator optionZoom optionAltCopy custom-menu-before custom-menu-after`),t=>({name:t,fn:L(n=>[F(e.$slots,t,Te(xe(I(se)(t,n))),void 0,!0)])}))]),1040,[`backgroundColor`,`color`,`isPrinting`,`isImaging`,`uid`,`isFullscreen`,`chartElement`,`hasTooltip`,`isTooltip`,`isAnnotation`,`tableDialog`,`isZoom`,`isCursorPointer`,`onGeneratePdf`,`onGenerateImage`,`onGenerateSvg`,`style`])):k(``,!0),xt.value.position===`top`&&xt.value.show&&!I(wt)?(N(),O(T,{key:4,ref_key:`zoomControls`,ref:rt,config:H.value,scale:I(pn),isFullscreen:Q.value,isCursorPointer:St.value,onZoomIn:Cn,onZoomOut:wn,onResetZoom:i[0]||=e=>I(ln)(!0)},null,8,[`config`,`scale`,`isFullscreen`,`isCursorPointer`])):k(``,!0),j(`div`,lt,[(N(),A(`svg`,{ref_key:`svgRef`,ref:q,class:we({"vue-data-ui-fullscreen--on":Q.value,"vue-data-ui-fulscreen--off":!Q.value}),"aria-describedby":`chart-instructions-${z.value}`,xmlns:I(_),viewBox:`${I(cn).x} ${I(cn).y} ${I(cn).width} ${I(cn).height}`,style:`overflow:hidden;background:transparent;display:block`,tabindex:`0`,onFocus:Pn,onBlur:Fn,onKeydown:In},[be(I(He)),F(e.$slots,`svg-underlayer`,{svg:{...J.value,isPrintingImg:I(Ut)||I(Wt)||I(yn),isPrintingSvg:I(bn)}},void 0,!0),e.$slots[`chart-background`]?(N(),A(`foreignObject`,{key:0,x:0,y:0,width:J.value.width<=0?10:J.value.width,height:J.value.height<=0?10:J.value.height,style:{pointerEvents:`none`}},[F(e.$slots,`chart-background`,{},void 0,!0)],8,dt)):k(``,!0),j(`g`,{transform:`translate(${Nt.value.x}, ${Nt.value.y})`,class:we({"wc-finalized":tt.value})},[(N(!0),A(_e,null,ke(Z.value,(e,t)=>(N(),A(`g`,{key:e.id,class:`vue-ui-word-cloud-word`,transform:`translate(${e.x}, ${e.y})`},[e.minX===void 0?k(``,!0):(N(),A(`rect`,{key:0,"data-a11y-word-index":`${t}-${z.value}`,x:e.minX,y:e.minY*1.25,width:e.maxX-e.minX,height:e.maxY-e.minY,fill:`transparent`,"pointer-events":`visiblePainted`,"aria-label":`${e.name}: ${(e.value||0).toFixed(W.value.roundingValue)}`,onMouseover:n=>Mn(e,t),onMouseleave:n=>kn(e,t),onClick:n=>An(e,t)},null,40,mt)),j(`text`,{fill:e.color,"font-weight":G.value.bold?`bold`:`normal`,x:0,y:0,"font-size":e.fontSize,transform:`translate(${e.width/2}, ${e.height/2})`,"text-anchor":`middle`,"dominant-baseline":`central`,"paint-order":`stroke fill`,stroke:!$.value||$.value===e.id?G.value.selectedStroke:void 0,"stroke-width":e.height*.05,"stroke-linecap":`round`,"stroke-linejoin":`round`,style:Ee(`
2
+ pointer-events:none;
3
+ fill-opacity:${!$.value||$.value===e.id||!tt.value?1:G.value.hoverOpacity} !important;
4
+ `)},Me(e.name),13,ht)],8,pt))),128))],10,ft),F(e.$slots,`svg`,{svg:{...J.value,isPrintingImg:I(Ut)||I(Wt)||I(yn),isPrintingSvg:I(bn)}},void 0,!0)],42,ut)),e.$slots.hint?(N(),A(`div`,gt,[F(e.$slots,`hint`,Te(xe({hint:H.value.a11y.translations.keyboardNavigation,isVisible:bt.value})),void 0,!0)])):k(``,!0)]),e.$slots.watermark?(N(),A(`div`,_t,[F(e.$slots,`watermark`,Te(xe({isPrinting:I(Ut)||I(Wt)||I(yn)||I(bn)})),void 0,!0)])):k(``,!0),I(un)?(N(),A(`div`,vt,[F(e.$slots,`reset-action`,{reset:I(ln)},void 0,!0)])):k(``,!0),xt.value.position===`bottom`&&xt.value.show&&!I(wt)?(N(),O(T,{key:7,ref_key:`zoomControls`,ref:rt,config:H.value,scale:I(pn),isFullscreen:Q.value,isCursorPointer:St.value,onZoomIn:Cn,onZoomOut:wn,onResetZoom:i[1]||=e=>I(ln)(!0)},null,8,[`config`,`scale`,`isFullscreen`,`isCursorPointer`])):k(``,!0),be(I(Ie),{teleportTo:W.value.teleportTo,show:X.value.showTooltip&&Qe.value,backgroundColor:W.value.backgroundColor,color:W.value.color,fontSize:W.value.fontSize,borderRadius:W.value.borderRadius,borderColor:W.value.borderColor,borderWidth:W.value.borderWidth,backgroundOpacity:W.value.backgroundOpacity,position:W.value.position,offsetX:W.value.offsetX,offsetY:W.value.offsetY,parent:B.value,content:En.value,isCustom:Tn.value,isFullscreen:Q.value,smooth:W.value.smooth,backdropFilter:W.value.backdropFilter,smoothForce:W.value.smoothForce,smoothSnapThreshold:W.value.smoothSnapThreshold,isA11yMode:ot.value===`keyboard`,a11yPosition:it.value},{"tooltip-before":L(()=>[F(e.$slots,`tooltip-before`,Te(xe({...Dn.value})),void 0,!0)]),tooltip:L(()=>[F(e.$slots,`tooltip`,Te(xe({...Dn.value})),void 0,!0)]),"tooltip-after":L(()=>[F(e.$slots,`tooltip-after`,Te(xe({...Dn.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`]),e.$slots.source?(N(),A(`div`,{key:8,ref_key:`source`,ref:Ye,dir:`auto`},[F(e.$slots,`source`,{},void 0,!0)],512)):k(``,!0),Ke.value&&U.value.buttons.table?(N(),O(Ae(hn.value.component),Se({key:9},hn.value.props,{ref_key:`tableUnit`,ref:$e,onClose:gn}),ve({content:L(()=>[(N(),O(I(ze),{key:`table_${Ze.value}`,colNames:Qt.value.colNames,head:Qt.value.head,body:Qt.value.body,config:Qt.value.config,title:H.value.table.useDialog?``:hn.value.title,withCloseButton:!H.value.table.useDialog,isCursorPointer:St.value,onClose:gn},{th:L(({th:e})=>[j(`div`,yt,Me(e),1)]),td:L(({td:e})=>[ye(Me(e.name||e),1)]),_:1},8,[`colNames`,`head`,`body`,`config`,`title`,`withCloseButton`,`isCursorPointer`]))]),_:2},[H.value.table.useDialog?{name:`title`,fn:L(()=>[ye(Me(hn.value.title),1)]),key:`0`}:void 0,H.value.table.useDialog?{name:`actions`,fn:L(()=>[j(`button`,{tabindex:`0`,class:`vue-ui-user-options-button`,onClick:i[2]||=e=>Zt(U.value.callbacks.csv),style:Ee({cursor:St.value?`pointer`:`default`})},[be(I(Le),{name:`fileCsv`,stroke:hn.value.props.color},null,8,[`stroke`])],4)]),key:`1`}:void 0]),1040)):k(``,!0),F(e.$slots,`skeleton`,{},()=>[I(wt)?(N(),O(te,{key:0})):k(``,!0)],!0)],44,st))}},[[`__scopeId`,`data-v-a3788dc8`]]);export{ot as n,bt as t};