vue-data-ui 3.28.5 → 3.28.6

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 (143) hide show
  1. package/dist/{PackageVersion-DWlHsdPa.js → PackageVersion-u-p5bCcj.js} +1 -1
  2. package/dist/components/vue-ui-3d-bar.js +1 -1
  3. package/dist/components/vue-ui-age-pyramid.js +1 -1
  4. package/dist/components/vue-ui-bullet.js +1 -1
  5. package/dist/components/vue-ui-bump.js +1 -1
  6. package/dist/components/vue-ui-candlestick.js +1 -1
  7. package/dist/components/vue-ui-carousel-table.js +1 -1
  8. package/dist/components/vue-ui-chestnut.js +1 -1
  9. package/dist/components/vue-ui-chord.js +1 -1
  10. package/dist/components/vue-ui-circle-pack.js +1 -1
  11. package/dist/components/vue-ui-cursor.js +1 -1
  12. package/dist/components/vue-ui-dag.js +1 -1
  13. package/dist/components/vue-ui-dashboard.js +1 -1
  14. package/dist/components/vue-ui-digits.js +1 -1
  15. package/dist/components/vue-ui-donut-evolution.js +1 -1
  16. package/dist/components/vue-ui-donut.js +1 -1
  17. package/dist/components/vue-ui-dumbbell.js +1 -1
  18. package/dist/components/vue-ui-flow.js +1 -1
  19. package/dist/components/vue-ui-funnel.js +1 -1
  20. package/dist/components/vue-ui-galaxy.js +1 -1
  21. package/dist/components/vue-ui-gauge.js +1 -1
  22. package/dist/components/vue-ui-geo.js +1 -1
  23. package/dist/components/vue-ui-gizmo.js +1 -1
  24. package/dist/components/vue-ui-graph.js +1 -1
  25. package/dist/components/vue-ui-heatmap.js +1 -1
  26. package/dist/components/vue-ui-hill.js +1 -1
  27. package/dist/components/vue-ui-history-plot.js +1 -1
  28. package/dist/components/vue-ui-horizontal-bar.js +1 -1
  29. package/dist/components/vue-ui-kpi.js +1 -1
  30. package/dist/components/vue-ui-molecule.js +1 -1
  31. package/dist/components/vue-ui-mood-radar.js +1 -1
  32. package/dist/components/vue-ui-nested-donuts.js +1 -1
  33. package/dist/components/vue-ui-onion.js +1 -1
  34. package/dist/components/vue-ui-parallel-coordinate-plot.js +1 -1
  35. package/dist/components/vue-ui-quadrant.js +1 -1
  36. package/dist/components/vue-ui-quick-chart.js +1 -1
  37. package/dist/components/vue-ui-radar.js +1 -1
  38. package/dist/components/vue-ui-relation-circle.js +1 -1
  39. package/dist/components/vue-ui-ridgeline.js +1 -1
  40. package/dist/components/vue-ui-rings.js +1 -1
  41. package/dist/components/vue-ui-scatter.js +1 -1
  42. package/dist/components/vue-ui-skeleton.js +1 -1
  43. package/dist/components/vue-ui-spark-trend.js +1 -1
  44. package/dist/components/vue-ui-sparkbar.js +1 -1
  45. package/dist/components/vue-ui-sparkgauge.js +1 -1
  46. package/dist/components/vue-ui-sparkhistogram.js +1 -1
  47. package/dist/components/vue-ui-sparkline.js +1 -1
  48. package/dist/components/vue-ui-sparkstackbar.js +1 -1
  49. package/dist/components/vue-ui-stackbar.js +1 -1
  50. package/dist/components/vue-ui-stackline.js +1 -1
  51. package/dist/components/vue-ui-strip-plot.js +1 -1
  52. package/dist/components/vue-ui-table-sparkline.js +1 -1
  53. package/dist/components/vue-ui-table.js +1 -1
  54. package/dist/components/vue-ui-thermometer.js +1 -1
  55. package/dist/components/vue-ui-timer.js +1 -1
  56. package/dist/components/vue-ui-tiremarks.js +1 -1
  57. package/dist/components/vue-ui-treemap.js +1 -1
  58. package/dist/components/vue-ui-vertical-bar.js +1 -1
  59. package/dist/components/vue-ui-waffle.js +1 -1
  60. package/dist/components/vue-ui-wheel.js +1 -1
  61. package/dist/components/vue-ui-word-cloud.js +1 -1
  62. package/dist/components/vue-ui-world.js +1 -1
  63. package/dist/components/vue-ui-xy.js +1 -1
  64. package/dist/composables.js +1 -1
  65. package/dist/package-BdTnZDoM.js +1 -0
  66. package/dist/{render-common-Dkf3n13B.js → render-common-CTaC-_Nw.js} +1 -1
  67. package/dist/ssr/vue-ui-donut.js +1 -1
  68. package/dist/ssr/vue-ui-xy.js +1 -1
  69. package/dist/ssr.js +1 -1
  70. package/dist/style.css +1 -1
  71. package/dist/types/composables.d.ts +51 -0
  72. package/dist/types/vue-data-ui.d.ts +51 -0
  73. package/dist/useParentSize-DGkyQ711.js +1 -0
  74. package/dist/vue-data-ui-DRkivgOZ.js +1 -0
  75. package/dist/vue-data-ui.js +1 -1
  76. package/dist/{vue-ui-3d-bar-Bm-Oe_kr.js → vue-ui-3d-bar-BeM22sZn.js} +1 -1
  77. package/dist/{vue-ui-age-pyramid-DeN6_pms.js → vue-ui-age-pyramid-BpkEVmpT.js} +1 -1
  78. package/dist/{vue-ui-bullet-CXCjzBCa.js → vue-ui-bullet-Cx9Noxp_.js} +1 -1
  79. package/dist/{vue-ui-bump-DrphtYb-.js → vue-ui-bump-DIjSKk8F.js} +1 -1
  80. package/dist/{vue-ui-candlestick-CAdTTZzx.js → vue-ui-candlestick-Cfd63wqQ.js} +1 -1
  81. package/dist/{vue-ui-carousel-table-D-PSQEuw.js → vue-ui-carousel-table-CDgmtbuI.js} +1 -1
  82. package/dist/{vue-ui-chestnut-BhnQd90d.js → vue-ui-chestnut-24bmc5Rq.js} +1 -1
  83. package/dist/{vue-ui-chord-C6swlh_I.js → vue-ui-chord-fQZQ9hjU.js} +1 -1
  84. package/dist/{vue-ui-circle-pack-CXhm9rwh.js → vue-ui-circle-pack-C1CbpBNe.js} +1 -1
  85. package/dist/{vue-ui-cursor-CCx0hL1b.js → vue-ui-cursor-9khzj4l-.js} +1 -1
  86. package/dist/{vue-ui-dag-BNYDTrHG.js → vue-ui-dag-B6QkUUCe.js} +1 -1
  87. package/dist/{vue-ui-dashboard-C2KQNeNt.js → vue-ui-dashboard-BBaAZBSj.js} +1 -1
  88. package/dist/{vue-ui-digits-Bcg9Ocwc.js → vue-ui-digits-DdrPl8eP.js} +1 -1
  89. package/dist/{vue-ui-donut-CqasvTv0.js → vue-ui-donut-BbJFmKZh.js} +1 -1
  90. package/dist/{vue-ui-donut-CU-L5W3v.js → vue-ui-donut-H65cwWN-.js} +1 -1
  91. package/dist/{vue-ui-donut-evolution-DgLZRZkG.js → vue-ui-donut-evolution-DeHbG9Rx.js} +1 -1
  92. package/dist/{vue-ui-dumbbell-DCYDSSZf.js → vue-ui-dumbbell-ClCVHsrR.js} +1 -1
  93. package/dist/{vue-ui-flow-BzGZdOi-.js → vue-ui-flow-DyrpRWOP.js} +1 -1
  94. package/dist/{vue-ui-funnel-pJc9jVJO.js → vue-ui-funnel-bjH_hFeX.js} +1 -1
  95. package/dist/{vue-ui-galaxy-DHheME5Z.js → vue-ui-galaxy-BTgZs4Le.js} +1 -1
  96. package/dist/{vue-ui-gauge-C4v_qdpm.js → vue-ui-gauge-CXZklQPg.js} +1 -1
  97. package/dist/{vue-ui-geo-Fras0OVo.js → vue-ui-geo-0_HimFX5.js} +1 -1
  98. package/dist/{vue-ui-gizmo-Bqea3ZMn.js → vue-ui-gizmo-kebiFGRl.js} +1 -1
  99. package/dist/{vue-ui-graph-BZs3jwhv.js → vue-ui-graph-NTeJASbv.js} +1 -1
  100. package/dist/{vue-ui-heatmap-2ALnM7Oj.js → vue-ui-heatmap-aiEMlbZm.js} +1 -1
  101. package/dist/{vue-ui-hill-B8dCg3x5.js → vue-ui-hill-ZpLv0IMP.js} +1 -1
  102. package/dist/{vue-ui-history-plot-CegRxR-x.js → vue-ui-history-plot-4xG3oQtO.js} +1 -1
  103. package/dist/{vue-ui-horizontal-bar-DuRnq32M.js → vue-ui-horizontal-bar-DMyL8GM6.js} +1 -1
  104. package/dist/{vue-ui-kpi-DSwSDLcO.js → vue-ui-kpi-D4q8R7Uq.js} +1 -1
  105. package/dist/{vue-ui-molecule-DF9I7IDy.js → vue-ui-molecule-4t84pqvx.js} +1 -1
  106. package/dist/{vue-ui-mood-radar-BpDzg6P1.js → vue-ui-mood-radar-BGuw0U8y.js} +1 -1
  107. package/dist/{vue-ui-nested-donuts-CYU90SX-.js → vue-ui-nested-donuts-BTTJ6KAx.js} +1 -1
  108. package/dist/{vue-ui-onion-C9Y96_Pe.js → vue-ui-onion-BUbI3uaY.js} +1 -1
  109. package/dist/{vue-ui-parallel-coordinate-plot-CEX33A1e.js → vue-ui-parallel-coordinate-plot-Bn3Y28ZQ.js} +1 -1
  110. package/dist/{vue-ui-quadrant-BzD-dhcs.js → vue-ui-quadrant-CVKEUWqI.js} +1 -1
  111. package/dist/{vue-ui-quick-chart-DDXK6KTi.js → vue-ui-quick-chart-BgH0Arb4.js} +1 -1
  112. package/dist/{vue-ui-radar-fgVruUz1.js → vue-ui-radar-Bb0u6tqk.js} +1 -1
  113. package/dist/{vue-ui-relation-circle-TA-KH-2J.js → vue-ui-relation-circle-Csx30ROI.js} +1 -1
  114. package/dist/{vue-ui-ridgeline-GJ_EyeMs.js → vue-ui-ridgeline-Ce1ZrE0B.js} +1 -1
  115. package/dist/{vue-ui-rings-CQ4CQa-D.js → vue-ui-rings-DgILqhz8.js} +1 -1
  116. package/dist/{vue-ui-scatter-ecBr_qgs.js → vue-ui-scatter-CX_rE0cU.js} +1 -1
  117. package/dist/{vue-ui-skeleton-BqHwNz2O.js → vue-ui-skeleton-C0oElPXz.js} +1 -1
  118. package/dist/{vue-ui-spark-trend-DULUucQY.js → vue-ui-spark-trend-CRQ5JfVc.js} +1 -1
  119. package/dist/{vue-ui-sparkbar-CUzfk9Y4.js → vue-ui-sparkbar-BTclK0-F.js} +1 -1
  120. package/dist/{vue-ui-sparkgauge-CEYIZNGr.js → vue-ui-sparkgauge-zNl9Xmt3.js} +1 -1
  121. package/dist/{vue-ui-sparkhistogram-BATfvYil.js → vue-ui-sparkhistogram-ynyE3DOc.js} +1 -1
  122. package/dist/{vue-ui-sparkline-B2jYjPFT.js → vue-ui-sparkline-CtsijvdW.js} +1 -1
  123. package/dist/{vue-ui-sparkstackbar-CN-Xz72S.js → vue-ui-sparkstackbar-RHlqUD-0.js} +1 -1
  124. package/dist/vue-ui-stackbar-Zhl3to0r.js +29 -0
  125. package/dist/{vue-ui-stackline-BKcbKdrA.js → vue-ui-stackline-8JRhuHTg.js} +1 -1
  126. package/dist/{vue-ui-strip-plot-CKk6MJhD.js → vue-ui-strip-plot-DL7Ulgpz.js} +1 -1
  127. package/dist/{vue-ui-table-D-jfpSh1.js → vue-ui-table-BetuN-ZS.js} +1 -1
  128. package/dist/{vue-ui-table-sparkline-295WMuHK.js → vue-ui-table-sparkline-Fdjb-U1P.js} +1 -1
  129. package/dist/{vue-ui-thermometer-Ccasz0jb.js → vue-ui-thermometer-6kfYImU-.js} +1 -1
  130. package/dist/{vue-ui-timer-DeTZUIxO.js → vue-ui-timer-BKqG5HxS.js} +1 -1
  131. package/dist/{vue-ui-tiremarks-DWrBN1nz.js → vue-ui-tiremarks-D_ps9th8.js} +1 -1
  132. package/dist/{vue-ui-treemap-D8Se3_RA.js → vue-ui-treemap-BfOdhGl7.js} +1 -1
  133. package/dist/{vue-ui-waffle-BSfHWe_Z.js → vue-ui-waffle-BL0zzw6B.js} +1 -1
  134. package/dist/{vue-ui-wheel-BRaABy8K.js → vue-ui-wheel-v1o2eN3I.js} +1 -1
  135. package/dist/{vue-ui-word-cloud-9YYx_Xrj.js → vue-ui-word-cloud-HUnuPCyQ.js} +1 -1
  136. package/dist/{vue-ui-world-BmICer9M.js → vue-ui-world-BagJihbJ.js} +1 -1
  137. package/dist/{vue-ui-xy-DYnPKTpK.js → vue-ui-xy-D948j7de.js} +1 -1
  138. package/dist/{vue-ui-xy-D7IJvizz.js → vue-ui-xy-Y_rIBQj0.js} +1 -1
  139. package/package.json +1 -1
  140. package/dist/package-CM94W_P5.js +0 -1
  141. package/dist/useTooltipPosition-aoV8pZZ9.js +0 -1
  142. package/dist/vue-data-ui-B2f_qLvD.js +0 -1
  143. package/dist/vue-ui-stackbar-D9hp_pkz.js +0 -29
@@ -1,4 +1,4 @@
1
- import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{t}from"./useConfig-D3ZfFSE5.js";import{$ as n,D as r,Dt as i,Jt as a,Qt as o,X as s,Yt as c,_ as l,_t as ee,at as te,b as u,c as ne,gt as re,in as ie,nt as ae,pt as oe,rn as se,t as ce,wt as le,zt as ue}from"./lib-rPeBMZrn.js";import{n as de,t as fe}from"./BaseScanner-8NdoBs7B.js";import{n as pe,t as me}from"./useHints-C-TwxM0Y.js";import{t as he}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{t as ge}from"./useNestedProp-DnGoh-XS.js";import{t as _e}from"./useThemeCheck-BKNRbGeC.js";import{t as ve}from"./img-D4RQwASc.js";import{n as ye}from"./Title-BliHuXfT.js";import{t as be}from"./useChartExport-BZts4KFb.js";import{n as xe,t as Se}from"./tableIntegration-CNoJ1CIY.js";import{n as Ce,t as we}from"./annotationSlots-RvQBEO9-.js";import{n as Te,t as Ee}from"./userOptionsSlots-DYuo-E5m.js";import{n as De,r as Oe,t as ke}from"./useTimeLabels-Das5O74F.js";import{t as Ae}from"./usePrinter-DVf3YcG5.js";import{t as je}from"./useTransitions-ChGGrtrv.js";import{t as Me}from"./useSvgLabelLayout-42Kats14.js";import{t as Ne}from"./useTimeLabelCollider-BTybMUFi.js";import{t as Pe}from"./useResponsive-CENUxfEL.js";import{t as Fe}from"./DefGrad-DKMq1REY.js";import{t as Ie}from"./SlicerPreview-DYuyE9u9.js";import{t as Le}from"./A11yDataTable-DWNlWXzs.js";import{t as Re}from"./useUserOptionState-CXlFnwPv.js";import{t as ze}from"./useChartAccessibility-DOMuYJfm.js";import{t as Be}from"./annotationViewport-X8fvs7pz.js";import{t as Ve}from"./vue_ui_candlestick-DKvha_Ab.js";import{Fragment as d,computed as f,createBlock as He,createCommentVNode as p,createElementBlock as m,createElementVNode as h,createSlots as Ue,createTextVNode as We,createVNode as Ge,defineAsyncComponent as Ke,guardReactiveProps as qe,mergeProps as Je,nextTick as Ye,normalizeClass as g,normalizeProps as Xe,normalizeStyle as Ze,onBeforeUnmount as Qe,onMounted as $e,openBlock as _,ref as v,renderList as y,renderSlot as b,resolveDynamicComponent as et,shallowRef as tt,toDisplayString as nt,toRefs as rt,unref as x,watch as it,watchEffect as at,withCtx as S}from"vue";var ot=/* @__PURE__ */ e({default:()=>Vt}),st=[`id`],ct=[`id`],lt={style:{position:`relative`}},ut=[`xmlns`,`aria-describedby`,`viewBox`],dt=[`x`,`y`,`width`,`height`],ft={key:1},pt={key:0},mt=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`],ht=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`],gt=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`,`stroke-dasharray`],_t=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`,`stroke-dasharray`],vt=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`],yt=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`],bt=[`transform`,`text-anchor`,`font-size`,`fill`,`font-weight`],xt=[`transform`,`text-anchor`,`font-size`,`fill`,`font-weight`],St=[`transform`,`text-anchor`,`font-size`,`fill`,`stroke`,`font-weight`],Ct=[`x`,`y`,`width`,`height`,`fill`,`rx`],wt={key:0},Tt=[`cx`,`cy`,`r`,`fill`],Et=[`cx`,`cy`,`r`,`fill`],Dt={key:1},Ot=[`x`,`y`,`width`,`height`,`rx`,`fill`],kt=[`x`,`y`,`width`,`height`,`fill`,`rx`],At=[`x`,`y`,`height`,`width`,`fill`,`rx`],jt=[`x`,`y`,`height`,`width`,`fill`,`rx`,`stroke`,`stroke-width`],Mt=[`d`,`stroke`],Nt=[`x`,`y`,`height`,`width`,`fill`,`onMouseover`,`onMouseleave`,`onClick`],Pt=[`x`,`y`,`width`,`height`,`fill`,`fill-opacity`,`stroke`,`stroke-opacity`,`stroke-width`,`stroke-dasharray`],Ft=[`data-start`,`data-end`],It={key:0,style:{position:`absolute`,top:`100%`,left:`0`,width:`100%`},"data-dom-to-png-ignore":``,"aria-hidden":`true`},Lt={key:5,class:`vue-data-ui-watermark`},Rt=[`d`,`stroke`],zt=[`d`,`stroke`,`stroke-width`],Bt=[`innerHTML`],Vt=/*#__PURE__*/ he({__name:`vue-ui-candlestick`,props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}},selectedXIndex:{type:Number,default:void 0},zoomState:{type:Object,default:null}},emits:[`selectX`,`zoomStart`,`zoomEnd`,`zoomReset`,`update:zoomState`,`copyAlt`],setup(e,{expose:he,emit:ot}){let Vt=Ke(()=>import(`./BaseIcon-fYK0iID8.js`).then(e=>e.n)),Ht=Ke(()=>import(`./Tooltip-C1q0Qoh7.js`)),Ut=Ke(()=>import(`./vue-ui-accordion-D4FHxzsL.js`).then(e=>e.n)),Wt=Ke(()=>import(`./DataTable-5Ug6gMAX.js`)),Gt=Ke(()=>import(`./PenAndPaper-r50tK3S4.js`).then(e=>e.t)),Kt=Ke(()=>import(`./UserOptions-Em_JgDXM.js`).then(e=>e.n)),qt=Ke(()=>import(`./PackageVersion-DWlHsdPa.js`).then(e=>e.t)),Jt=Ke(()=>import(`./BaseDraggableDialog-9d30Yx8c.js`).then(e=>e.n)),{vue_ui_candlestick:Yt}=t(),{isThemeValid:Xt,warnInvalidTheme:Zt}=_e(),C=e,w=ot,Qt=f(()=>!!C.dataset&&C.dataset.length),T=v(!1),$t=v(!1),en=0,tn=v(null),E=v(s()),nn=v(!1),rn=v(``),D=v(void 0),an=v(0),O=v(null),on=v(null),sn=v(null),cn=v(null),ln=v(null),un=v(null),dn=v(0),fn=v(0),pn=v(0),mn=v(null),hn=v(null),gn=v(null),_n=v(null),vn=v(null),k=v(null),yn=v({x:0,y:0}),bn=v(`pointer`),xn=v(!1),A=v(jn()),j=f(()=>A.value.style.layout.candle),M=f(()=>A.value.style.layout.grid),N=f(()=>A.value.style.layout),P=f(()=>A.value.style),F=f(()=>A.value.userOptions);pe({config:()=>A.value,dataset:()=>C.dataset,component:`VueUiCandlestick`,rules:[me.emptyArray,{test:e=>e.length>200,message:[`👀 Dataset has > 200 points, which can cause performance issues. Consider:`,``,`▶️ Adding date inputs to constraint the dataset into a specific timeframe`,``,`▶️ Aggregate the data to larger time series to reduce the number of datapoints.`]}]});let{transitionEnabled:Sn}=je({config:()=>A.value.transitions,dataset:()=>C.dataset}),Cn=f(()=>A.value.userOptions.useCursorPointer),wn=f(()=>ie({defaultConfig:{useCssAnimation:!1,userOptions:{show:!1},table:{show:!1},style:{backgroundColor:`#99999930`,layout:{candle:{colors:{bearish:`#BABABA`,bullish:`#CACACA`}},grid:{stroke:`#6A6A6A`,verticalLines:{stroke:`#6A6A6A`},horizontalLines:{stroke:`#6A6A6A`},yAxis:{dataLabels:{show:!1},scale:{min:null,max:null}}},wick:{stroke:`#6A6A6A`,extremity:{color:`#6A6A6A`}}},tooltip:{show:!1},zoom:{show:!1,startIndex:null,endIndex:null}}},userConfig:A.value.skeletonConfig??{}})),{loading:I,FINAL_DATASET:L,manualLoading:Tn}=de({...rt(C),FINAL_CONFIG:A,prepareConfig:jn,callback:()=>{Promise.resolve().then(async()=>{await Wr()})},skeletonDataset:C.config?.skeletonDataset??[[17040672e5,10,20,2,10,30],[17067456e5,10,30,5,20,50],[17092512e5,20,50,10,30,80],[17119296e5,30,80,20,50,130],[17145216e5,50,130,30,100,210],[17172e8,80,210,50,150,340],[1719792e6,130,340,80,280,550],[17224704e5,210,550,130,450,890],[17251488e5,340,890,210,750,1440],[17277408e5,550,1440,340,1230,2330],[17304192e5,890,2330,550,1950,3770],[17330112e5,1440,3770,890,3200,5100]],skeletonConfig:ie({defaultConfig:A.value,userConfig:wn.value})}),{userOptionsVisible:En,setUserOptionsVisibility:Dn,keepUserOptionState:On}=Re({config:A.value}),{svgRef:R}=ze({config:P.value.title});function kn(){Dn(!0)}function An(){Dn(!1),w(`selectX`,{seriesIndex:null,datapoint:null}),D.value=null}function jn(){let e=ge({userConfig:C.config,defaultConfig:Yt}),t={};C.config&&le(C.config,`style.layout.grid.xAxis.dataLabels.showFirstAndLast`)&&(e.style.layout.grid.xAxis.dataLabels.showFirstAndLast=!!C.config.style.layout.grid.xAxis.dataLabels.showFirstAndLast);let n=e.theme;if(n){if(!Xt.value(e))Zt(e),t=e;else{let r=ge({userConfig:Ve[n]||C.config,defaultConfig:e});t={...ge({userConfig:C.config,defaultConfig:r})}}}else t=e;return t}let Mn=o(C.config);it(()=>C.config,(e,t)=>{let n=o(e),r=n!==Mn;Mn=n;let i=jn();r?(I.value||(A.value=jn()),En.value=!A.value.userOptions.showOnChartHover,In(),dn.value+=1,pn.value+=1,fn.value+=1,B.value.showTable=A.value.table.show,B.value.showTooltip=P.value.tooltip.show,ur()):(A.value.style.tooltip=i.style.tooltip,B.value.showTooltip=A.value.style.tooltip.show)},{deep:!0}),it(()=>C.dataset,e=>{Array.isArray(e)&&e.length>0&&(Tn.value=!1),Br()},{deep:!0});let z=v({height:P.value.height,width:P.value.width,xAxisFontSize:M.value.xAxis.dataLabels.fontSize,yAxisFontSize:M.value.yAxis.dataLabels.fontSize}),Nn=tt(null),Pn=tt(null);$e(()=>{In()});let Fn=f(()=>A.value.debug);function In(){ue(C.dataset)&&(te({componentName:`VueUiCandlestick`,type:`dataset`,debug:Fn.value}),Tn.value=!0),ue(C.dataset)||(Tn.value=A.value.loading),setTimeout(()=>{T.value=!0},10),A.value.responsive&&(Nn.value&&(Pn.value&&Nn.value.unobserve(Pn.value),Nn.value.disconnect()),Nn.value=new ResizeObserver(()=>{T.value=!1;let{width:e,height:t}=Pe({chart:O.value,title:P.value.title.text?on.value:null,slicer:P.value.zoom.show&&U.value>6?cn.value.$el:null,legend:sn.value,source:ln.value,noTitle:un.value});cancelAnimationFrame(en),en=requestAnimationFrame(()=>{z.value.width=e,z.value.height=t-12,$t.value=!0,A.value.responsiveProportionalSizing?(z.value.xAxisFontSize=se({relator:Math.min(e,t),adjuster:P.value.width,source:M.value.xAxis.dataLabels.fontSize,threshold:6,fallback:6}),z.value.yAxisFontSize=se({relator:Math.min(e,t),adjuster:P.value.width,source:M.value.yAxis.dataLabels.fontSize,threshold:6,fallback:6})):(z.value.xAxisFontSize=M.value.xAxis.dataLabels.fontSize,z.value.yAxisFontSize=M.value.yAxis.dataLabels.fontSize),tn.value&&clearTimeout(tn.value),tn.value=setTimeout(()=>{T.value=!0},10)})}),Pn.value=O.value.parentNode,Nn.value.observe(Pn.value)),Wr()}Qe(()=>{cancelAnimationFrame(en),Nn.value&&(Pn.value&&Nn.value.unobserve(Pn.value),Nn.value.disconnect())});let{isPrinting:Ln,isImaging:Rn,generatePdf:zn,generateImage:Bn}=Ae({elementId:`vue-ui-candlestick_${E.value}`,fileName:P.value.title.text||`vue-ui-candlestick`,options:A.value.userOptions.print}),Vn=f(()=>A.value.userOptions.show&&!P.value.title.text),B=v({showTable:A.value.table.show,showTooltip:P.value.tooltip.show}),{metrics:Hn,ready:Un,settling:V,update:Wn}=Me({svgRef:R,canMeasure:()=>(!A.value.responsive||$t.value)&&(!M.value.xAxis.dataLabels.show||Sr.value),initialMetrics:{scaleLabelsWidth:0,timeLabelsHeight:0},measure:e=>({scaleLabelsWidth:mn.value?e(mn.value).textWidth:M.value.yAxis.dataLabels.offsetX,timeLabelsHeight:e(hn.value).height})}),Gn=f(()=>hn.value?Hn.value.timeLabelsHeight+z.value.xAxisFontSize:0),Kn=f(()=>M.value.yAxis.position===`right`);function qn(){let e=Hn.value.scaleLabelsWidth,t=M.value.yAxis.axisName?.show?M.value.yAxis.axisName.fontSize+M.value.yAxis.axisName.offsetX:0,n=e+13+t;return{left:Kn.value?0:n,right:Kn.value?n:0,scaleLabelsWidth:e,yAxisNameWidth:t,crosshair:13}}let H=f(()=>{let{top:e,right:t,bottom:n,left:r}=N.value.padding,i=qn();return{top:e+12,right:z.value.width-t-i.right,left:r+i.left,bottom:z.value.height-n-Gn.value,width:z.value.width-r-t-i.left-i.right,height:z.value.height-e-n-Gn.value-12,scaleLabelsWidth:i.scaleLabelsWidth,yAxisNameWidth:i.yAxisNameWidth,crosshair:i.crosshair}}),Jn=f(()=>{let{left:e,top:t,width:n,height:r}=H.value,i=W.value.start,a=W.value.end-i,o=n/a,s=G.value.start-i,c=G.value.end-i,l=Math.max(0,Math.min(a,s)),ee=Math.max(0,Math.min(a,c));return{x:e+l*o,y:t,width:(ee-l)*o,height:r,fill:P.value.zoom.preview.fill,stroke:P.value.zoom.preview.stroke,"stroke-width":P.value.zoom.preview.strokeWidth,"stroke-dasharray":P.value.zoom.preview.strokeDasharray,"stroke-linecap":`round`,"stroke-linejoin":`round`,style:{pointerEvents:`none`,transition:`none !important`,animation:`none !important`}}}),U=f(()=>L.value.length),W=v({start:0,end:U.value}),G=v({start:0,end:U.value}),Yn=v(!1),Xn=v(!1),Zn=v(null),K=v(null),q=v(null),Qn=v(!1),$n=v({time:0,x:0,y:0,pointerType:null}),er=f(()=>P.value.zoom?.dragToZoom),J=f(()=>er.value.show&&Qt.value&&Hr.value&&U.value>1&&!I.value),tr=null,nr={},rr=f(()=>P.value.zoom.preview.enable&&(G.value.start!==W.value.start||G.value.end!==W.value.end));function ir(e,t){G.value[e]=t}function ar(e,t=W.value){if(!e||typeof e!=`object`)return null;let n=e.start!==void 0&&e.start!==null,r=e.end!==void 0&&e.end!==null;if(!n&&!r)return null;let i=Number(n?e.start:t.start),a=Number(r?e.end:t.end);return!Number.isFinite(i)||!Number.isFinite(a)?null:{start:i,end:a}}function or(e){let t=ar(e);t&&w(`update:zoomState`,t)}function sr(){tr&&=(cancelAnimationFrame(tr),null),nr={}}function cr(e){let t=ar(e);if(!t)return null;let{start:n,end:r}=t;return(n!==Number(W.value.start)||r!==Number(W.value.end))&&(sr(),W.value={start:n,end:r},G.value={start:n,end:r},ur()),{start:Number(W.value.start),end:Number(W.value.end)}}function lr(e){let t=cr(e);return t?(w(`update:zoomState`,t),t):null}function ur(){let e=Math.max(0,Math.min(W.value.start??0,U.value-1)),t=Math.max(e+1,Math.min(W.value.end??U.value,U.value));(!Number.isFinite(e)||!Number.isFinite(t)||t<=e)&&(e=0,t=U.value),W.value.start=e,W.value.end=t,G.value.start=e,G.value.end=t,cn.value&&cn.value.setRangeValues(e,t)}let dr=f(()=>L.value.map((e,t)=>({...e,absoluteIndex:t}))),fr=f(()=>dr.value.slice(W.value.start,W.value.end)),Y=f(()=>(Fn.value&&L.value.forEach((e,t)=>{[null,void 0].includes(e[0])&&te({componentName:`VueUiCandlestick`,type:`datasetAttribute`,property:`period (index 0)`,index:t}),[null,void 0].includes(e[1])&&te({componentName:`VueUiCandlestick`,type:`datasetAttribute`,property:`open (index 1)`,index:t}),[null,void 0].includes(e[2])&&te({componentName:`VueUiCandlestick`,type:`datasetAttribute`,property:`high (index 2)`,index:t}),[null,void 0].includes(e[3])&&te({componentName:`VueUiCandlestick`,type:`datasetAttribute`,property:`low (index 3)`,index:t}),[null,void 0].includes(e[4])&&te({componentName:`VueUiCandlestick`,type:`datasetAttribute`,property:`close (index 4)`,index:t}),[null,void 0].includes(e[5])&&te({componentName:`VueUiCandlestick`,type:`datasetAttribute`,property:`volume (index 5)`,index:t})}),fr.value.map(e=>({absoluteIndex:e.absoluteIndex,period:e[0],open:e[1],high:e[2],low:e[3],close:e[4],volume:e[5]})))),pr=f(()=>dr.value.map(e=>({absoluteIndex:e.absoluteIndex,period:e[0],open:e[1],high:e[2],low:e[3],close:e[4],volume:e[5]}))),X=f(()=>H.value.width/fr.value.length),mr=f(()=>({max:M.value.yAxis.scale.max===null?Math.max(...Y.value.map(e=>e.high)):M.value.yAxis.scale.max,min:M.value.yAxis.scale.min===null?0:M.value.yAxis.scale.min})),Z=f(()=>l(mr.value.min,mr.value.max,M.value.yAxis.dataLabels.steps));function hr(e,t,n=null,r=null){return{...e,x:u(H.value.left+t*X.value+X.value/2),y:u(H.value.top+(1-(e-Z.value.min)/(Z.value.max-Z.value.min))*H.value.height),value:u(e),isMax:e===n,isMin:e===r}}let Q=f(()=>{let e={o:Math.max(...Y.value.map(e=>e.open)),h:Math.max(...Y.value.map(e=>e.high)),l:Math.max(...Y.value.map(e=>e.low)),c:Math.max(...Y.value.map(e=>e.low))},t={o:Math.min(...Y.value.map(e=>e.open)),h:Math.min(...Y.value.map(e=>e.high)),l:Math.min(...Y.value.map(e=>e.low)),c:Math.min(...Y.value.map(e=>e.low))},n=Math.max(...Y.value.map(e=>e.volume)),r=Math.min(...Y.value.map(e=>e.volume));return Y.value.map((i,a)=>{let o=hr(i.open,a,e.o,t.o),s=hr(i.high,a,e.h,t.h),c=hr(i.low,a,e.l,t.l),l=hr(i.close,a,e.c,t.c),ee=i.close>i.open,te=i.volume===n,u=i.volume===r;return{period:i.period,open:o,high:s,low:c,close:l,volume:i.volume,isBullish:ee,absoluteIndex:i.absoluteIndex,isMaxVolume:te,isMinVolume:u}})});function gr({item:e,index:t,minimapH:n,unitW:r}){let i=M.value.yAxis.scale.min??0,a=M.value.yAxis.scale.max??Math.max(...L.value.map(e=>e[2]));return{...e,x:u(t*r),y:u((1-(e-i)/(a-i))*n),value:u(e)}}let _r=f(()=>({minimapH:e,unitW:t})=>pr.value.map((n,r)=>{let i=gr({item:n.open,index:r,minimapH:e,unitW:t}),a=gr({item:n.high,index:r,minimapH:e,unitW:t}),o=gr({item:n.low,index:r,minimapH:e,unitW:t}),s=gr({item:n.close,index:r,minimapH:e,unitW:t}),c=n.close>n.open;return{period:n.period,open:i,high:a,low:o,close:s,volume:n.volume,isBullish:c,absoluteIndex:n.absoluteIndex}})),vr=f(()=>P.value.zoom.minimap.show?[{name:``,series:L.value.map(e=>e[2]),color:`#000000`,isVisible:!0}]:[]);function yr(e){return u((e-Z.value.min)/(Z.value.max-Z.value.min))}let br=f(()=>Z.value.ticks.map(e=>({y:H.value.bottom-H.value.height*yr(e),value:u(e)}))),xr=f(()=>Y.value.map(e=>e.period)),$=v([]),Sr=v(!1),Cr=v([]),wr=0;at(()=>{let e=++wr;(async()=>{let t=await ke({values:L.value.map(e=>e[0]),maxDatapoints:L.value.length,formatter:M.value.xAxis.dataLabels.datetimeFormatter,start:W.value.start,end:W.value.end});e===wr&&($.value=t,Sr.value=!0)})()});let Tr=0;at(()=>{let e=++Tr;(async()=>{let t=await ke({values:L.value.map(e=>e[0]),maxDatapoints:L.value.length,formatter:M.value.xAxis.dataLabels.datetimeFormatter,start:0,end:U.value});e===Tr&&(Cr.value=t)})()});let Er=v({months:[],shortMonths:[],days:[],shortDays:[]}),Dr=0;at(()=>{let e=++Dr,t=M.value.xAxis.dataLabels.datetimeFormatter;(async()=>{let n=await Oe(t.locale).catch(()=>Oe(`en`));e===Dr&&(Er.value=n.data)})()});let Or=f(()=>{let e=M.value.xAxis.dataLabels.datetimeFormatter,t=De({useUTC:e.useUTC,locale:Er.value,januaryAsYear:e.januaryAsYear});return(e,n)=>{let r=L.value.map(e=>e[0])?.[e];return r==null?``:t.formatDate(new Date(r),n)}}),kr=f(()=>(L.value.map(e=>e[0])||[]).map((e,t)=>({text:Or.value(t,P.value.tooltip.timeFormat),absoluteIndex:t}))),Ar=f(()=>(L.value.map(e=>e[0])||[]).map((e,t)=>({text:Or.value(t,P.value.zoom.timeFormat),absoluteIndex:t}))),jr=f(()=>{let e=Math.max(1,Math.floor(Number(M.value.xAxis.dataLabels.modulo)||1)),t=($.value||[]).map(e=>e?.text??``),n=(Cr.value||[]).map(e=>e?.text??``),r=W.value.start??0,i=r>0||t.length<n.length;return re({configuredModulo:e,visibleTexts:t,allTexts:n,startAbs:r,isZoomed:i})}),Mr=f(()=>{let e=M.value.xAxis.dataLabels,t=$.value||[],n=Cr.value||[],r=W.value.start??0,i=D.value,a=U.value,o=t.map(e=>e?.text??``),s=n.map(e=>e?.text??``),c=ne(!!e.showOnlyFirstAndLast,!!e.showOnlyAtModulo,jr.value,o,s,r,i,a);if(!e.showFirstAndLast||e.showOnlyFirstAndLast||!c.length)return c;let l=c.length-1;return c.map((e,t)=>t!==0&&t!==l?e:{...e,text:o[t]??``})}),Nr=f(()=>M.value.xAxis.dataLabels.datetimeFormatter.enable?{start:$.value.find(e=>e.absoluteIndex===W.value.start)?.text??``,end:$.value.find(e=>e.absoluteIndex===W.value.end-1)?.text??``}:{start:L.value[W.value.start]?L.value[W.value.start][0]:L.value[0][0],end:L.value[W.value.end-1]?L.value[W.value.end-1][0]:L.value.at(-1)[0]}),Pr=v(null);function Fr(e,t){A.value.events.datapointClick&&A.value.events.datapointClick({datapoint:t,seriesIndex:e+W.value.start})}function Ir(e,t){A.value.events.datapointLeave&&A.value.events.datapointLeave({datapoint:t,seriesIndex:e+W.value.start}),D.value=void 0,nn.value=!1,k.value=null,bn.value=`pointer`}it(()=>C.selectedXIndex,e=>{if([null,void 0].includes(C.selectedXIndex)){D.value=null;return}let t=e-W.value.start;t<0||e>=W.value.end?D.value=null:D.value=t??null},{immediate:!0});function Lr(e,t,r=`pointer`){A.value.events.datapointEnter&&A.value.events.datapointEnter({datapoint:t,seriesIndex:e+W.value.start}),D.value=e,k.value=e,bn.value=r,Pr.value={datapoint:t,seriesIndex:e,series:Q.value,config:A.value},Ai({seriesIndex:e,datapoint:t});let a=P.value.tooltip.customFormat;if(i(a)&&oe(()=>a({seriesIndex:e,datapoint:t,series:Q.value,config:A.value})))rn.value=a({seriesIndex:e,datapoint:t,series:Q.value,config:A.value});else if(P.value.tooltip.show){let r=``,{period:i,open:a,high:o,low:s,close:c,volume:l,isBullish:ee}=Q.value[e],{period:te,open:u,high:ne,low:re,close:ie,volume:ae}=A.value.translations,oe=M.value.xAxis.dataLabels.datetimeFormatter.enable?P.value.tooltip.useDefaultTimeFormat?$.value[e].text:kr.value[e].text:i;r+=`<div><svg style="margin-right:6px" viewBox="0 0 12 12" height="12" width="12"><rect x="0" y="0" height="12" width="12" rx="${j.value.borderRadius*3}" stroke="${j.value.stroke}" stroke-width="${j.value.strokeWidth}"
1
+ import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{t}from"./useConfig-D3ZfFSE5.js";import{$ as n,D as r,Dt as i,Jt as a,Qt as o,X as s,Yt as c,_ as l,_t as ee,at as te,b as u,c as ne,gt as re,in as ie,nt as ae,pt as oe,rn as se,t as ce,wt as le,zt as ue}from"./lib-rPeBMZrn.js";import{n as de,t as fe}from"./BaseScanner-8NdoBs7B.js";import{n as pe,t as me}from"./useHints-C-TwxM0Y.js";import{t as he}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{t as ge}from"./useNestedProp-DnGoh-XS.js";import{t as _e}from"./useThemeCheck-BKNRbGeC.js";import{t as ve}from"./img-D4RQwASc.js";import{n as ye}from"./Title-BliHuXfT.js";import{t as be}from"./useChartExport-BZts4KFb.js";import{n as xe,t as Se}from"./tableIntegration-CNoJ1CIY.js";import{n as Ce,t as we}from"./annotationSlots-RvQBEO9-.js";import{n as Te,t as Ee}from"./userOptionsSlots-DYuo-E5m.js";import{n as De,r as Oe,t as ke}from"./useTimeLabels-Das5O74F.js";import{t as Ae}from"./usePrinter-DVf3YcG5.js";import{t as je}from"./useTransitions-ChGGrtrv.js";import{t as Me}from"./useSvgLabelLayout-42Kats14.js";import{t as Ne}from"./useTimeLabelCollider-BTybMUFi.js";import{t as Pe}from"./useResponsive-CENUxfEL.js";import{t as Fe}from"./DefGrad-DKMq1REY.js";import{t as Ie}from"./SlicerPreview-DYuyE9u9.js";import{t as Le}from"./A11yDataTable-DWNlWXzs.js";import{t as Re}from"./useUserOptionState-CXlFnwPv.js";import{t as ze}from"./useChartAccessibility-DOMuYJfm.js";import{t as Be}from"./annotationViewport-X8fvs7pz.js";import{t as Ve}from"./vue_ui_candlestick-DKvha_Ab.js";import{Fragment as d,computed as f,createBlock as He,createCommentVNode as p,createElementBlock as m,createElementVNode as h,createSlots as Ue,createTextVNode as We,createVNode as Ge,defineAsyncComponent as Ke,guardReactiveProps as qe,mergeProps as Je,nextTick as Ye,normalizeClass as g,normalizeProps as Xe,normalizeStyle as Ze,onBeforeUnmount as Qe,onMounted as $e,openBlock as _,ref as v,renderList as y,renderSlot as b,resolveDynamicComponent as et,shallowRef as tt,toDisplayString as nt,toRefs as rt,unref as x,watch as it,watchEffect as at,withCtx as S}from"vue";var ot=/* @__PURE__ */ e({default:()=>Vt}),st=[`id`],ct=[`id`],lt={style:{position:`relative`}},ut=[`xmlns`,`aria-describedby`,`viewBox`],dt=[`x`,`y`,`width`,`height`],ft={key:1},pt={key:0},mt=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`],ht=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`],gt=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`,`stroke-dasharray`],_t=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`,`stroke-dasharray`],vt=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`],yt=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`],bt=[`transform`,`text-anchor`,`font-size`,`fill`,`font-weight`],xt=[`transform`,`text-anchor`,`font-size`,`fill`,`font-weight`],St=[`transform`,`text-anchor`,`font-size`,`fill`,`stroke`,`font-weight`],Ct=[`x`,`y`,`width`,`height`,`fill`,`rx`],wt={key:0},Tt=[`cx`,`cy`,`r`,`fill`],Et=[`cx`,`cy`,`r`,`fill`],Dt={key:1},Ot=[`x`,`y`,`width`,`height`,`rx`,`fill`],kt=[`x`,`y`,`width`,`height`,`fill`,`rx`],At=[`x`,`y`,`height`,`width`,`fill`,`rx`],jt=[`x`,`y`,`height`,`width`,`fill`,`rx`,`stroke`,`stroke-width`],Mt=[`d`,`stroke`],Nt=[`x`,`y`,`height`,`width`,`fill`,`onMouseover`,`onMouseleave`,`onClick`],Pt=[`x`,`y`,`width`,`height`,`fill`,`fill-opacity`,`stroke`,`stroke-opacity`,`stroke-width`,`stroke-dasharray`],Ft=[`data-start`,`data-end`],It={key:0,style:{position:`absolute`,top:`100%`,left:`0`,width:`100%`},"data-dom-to-png-ignore":``,"aria-hidden":`true`},Lt={key:5,class:`vue-data-ui-watermark`},Rt=[`d`,`stroke`],zt=[`d`,`stroke`,`stroke-width`],Bt=[`innerHTML`],Vt=/*#__PURE__*/ he({__name:`vue-ui-candlestick`,props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}},selectedXIndex:{type:Number,default:void 0},zoomState:{type:Object,default:null}},emits:[`selectX`,`zoomStart`,`zoomEnd`,`zoomReset`,`update:zoomState`,`copyAlt`],setup(e,{expose:he,emit:ot}){let Vt=Ke(()=>import(`./BaseIcon-fYK0iID8.js`).then(e=>e.n)),Ht=Ke(()=>import(`./Tooltip-C1q0Qoh7.js`)),Ut=Ke(()=>import(`./vue-ui-accordion-D4FHxzsL.js`).then(e=>e.n)),Wt=Ke(()=>import(`./DataTable-5Ug6gMAX.js`)),Gt=Ke(()=>import(`./PenAndPaper-r50tK3S4.js`).then(e=>e.t)),Kt=Ke(()=>import(`./UserOptions-Em_JgDXM.js`).then(e=>e.n)),qt=Ke(()=>import(`./PackageVersion-u-p5bCcj.js`).then(e=>e.t)),Jt=Ke(()=>import(`./BaseDraggableDialog-9d30Yx8c.js`).then(e=>e.n)),{vue_ui_candlestick:Yt}=t(),{isThemeValid:Xt,warnInvalidTheme:Zt}=_e(),C=e,w=ot,Qt=f(()=>!!C.dataset&&C.dataset.length),T=v(!1),$t=v(!1),en=0,tn=v(null),E=v(s()),nn=v(!1),rn=v(``),D=v(void 0),an=v(0),O=v(null),on=v(null),sn=v(null),cn=v(null),ln=v(null),un=v(null),dn=v(0),fn=v(0),pn=v(0),mn=v(null),hn=v(null),gn=v(null),_n=v(null),vn=v(null),k=v(null),yn=v({x:0,y:0}),bn=v(`pointer`),xn=v(!1),A=v(jn()),j=f(()=>A.value.style.layout.candle),M=f(()=>A.value.style.layout.grid),N=f(()=>A.value.style.layout),P=f(()=>A.value.style),F=f(()=>A.value.userOptions);pe({config:()=>A.value,dataset:()=>C.dataset,component:`VueUiCandlestick`,rules:[me.emptyArray,{test:e=>e.length>200,message:[`👀 Dataset has > 200 points, which can cause performance issues. Consider:`,``,`▶️ Adding date inputs to constraint the dataset into a specific timeframe`,``,`▶️ Aggregate the data to larger time series to reduce the number of datapoints.`]}]});let{transitionEnabled:Sn}=je({config:()=>A.value.transitions,dataset:()=>C.dataset}),Cn=f(()=>A.value.userOptions.useCursorPointer),wn=f(()=>ie({defaultConfig:{useCssAnimation:!1,userOptions:{show:!1},table:{show:!1},style:{backgroundColor:`#99999930`,layout:{candle:{colors:{bearish:`#BABABA`,bullish:`#CACACA`}},grid:{stroke:`#6A6A6A`,verticalLines:{stroke:`#6A6A6A`},horizontalLines:{stroke:`#6A6A6A`},yAxis:{dataLabels:{show:!1},scale:{min:null,max:null}}},wick:{stroke:`#6A6A6A`,extremity:{color:`#6A6A6A`}}},tooltip:{show:!1},zoom:{show:!1,startIndex:null,endIndex:null}}},userConfig:A.value.skeletonConfig??{}})),{loading:I,FINAL_DATASET:L,manualLoading:Tn}=de({...rt(C),FINAL_CONFIG:A,prepareConfig:jn,callback:()=>{Promise.resolve().then(async()=>{await Wr()})},skeletonDataset:C.config?.skeletonDataset??[[17040672e5,10,20,2,10,30],[17067456e5,10,30,5,20,50],[17092512e5,20,50,10,30,80],[17119296e5,30,80,20,50,130],[17145216e5,50,130,30,100,210],[17172e8,80,210,50,150,340],[1719792e6,130,340,80,280,550],[17224704e5,210,550,130,450,890],[17251488e5,340,890,210,750,1440],[17277408e5,550,1440,340,1230,2330],[17304192e5,890,2330,550,1950,3770],[17330112e5,1440,3770,890,3200,5100]],skeletonConfig:ie({defaultConfig:A.value,userConfig:wn.value})}),{userOptionsVisible:En,setUserOptionsVisibility:Dn,keepUserOptionState:On}=Re({config:A.value}),{svgRef:R}=ze({config:P.value.title});function kn(){Dn(!0)}function An(){Dn(!1),w(`selectX`,{seriesIndex:null,datapoint:null}),D.value=null}function jn(){let e=ge({userConfig:C.config,defaultConfig:Yt}),t={};C.config&&le(C.config,`style.layout.grid.xAxis.dataLabels.showFirstAndLast`)&&(e.style.layout.grid.xAxis.dataLabels.showFirstAndLast=!!C.config.style.layout.grid.xAxis.dataLabels.showFirstAndLast);let n=e.theme;if(n){if(!Xt.value(e))Zt(e),t=e;else{let r=ge({userConfig:Ve[n]||C.config,defaultConfig:e});t={...ge({userConfig:C.config,defaultConfig:r})}}}else t=e;return t}let Mn=o(C.config);it(()=>C.config,(e,t)=>{let n=o(e),r=n!==Mn;Mn=n;let i=jn();r?(I.value||(A.value=jn()),En.value=!A.value.userOptions.showOnChartHover,In(),dn.value+=1,pn.value+=1,fn.value+=1,B.value.showTable=A.value.table.show,B.value.showTooltip=P.value.tooltip.show,ur()):(A.value.style.tooltip=i.style.tooltip,B.value.showTooltip=A.value.style.tooltip.show)},{deep:!0}),it(()=>C.dataset,e=>{Array.isArray(e)&&e.length>0&&(Tn.value=!1),Br()},{deep:!0});let z=v({height:P.value.height,width:P.value.width,xAxisFontSize:M.value.xAxis.dataLabels.fontSize,yAxisFontSize:M.value.yAxis.dataLabels.fontSize}),Nn=tt(null),Pn=tt(null);$e(()=>{In()});let Fn=f(()=>A.value.debug);function In(){ue(C.dataset)&&(te({componentName:`VueUiCandlestick`,type:`dataset`,debug:Fn.value}),Tn.value=!0),ue(C.dataset)||(Tn.value=A.value.loading),setTimeout(()=>{T.value=!0},10),A.value.responsive&&(Nn.value&&(Pn.value&&Nn.value.unobserve(Pn.value),Nn.value.disconnect()),Nn.value=new ResizeObserver(()=>{T.value=!1;let{width:e,height:t}=Pe({chart:O.value,title:P.value.title.text?on.value:null,slicer:P.value.zoom.show&&U.value>6?cn.value.$el:null,legend:sn.value,source:ln.value,noTitle:un.value});cancelAnimationFrame(en),en=requestAnimationFrame(()=>{z.value.width=e,z.value.height=t-12,$t.value=!0,A.value.responsiveProportionalSizing?(z.value.xAxisFontSize=se({relator:Math.min(e,t),adjuster:P.value.width,source:M.value.xAxis.dataLabels.fontSize,threshold:6,fallback:6}),z.value.yAxisFontSize=se({relator:Math.min(e,t),adjuster:P.value.width,source:M.value.yAxis.dataLabels.fontSize,threshold:6,fallback:6})):(z.value.xAxisFontSize=M.value.xAxis.dataLabels.fontSize,z.value.yAxisFontSize=M.value.yAxis.dataLabels.fontSize),tn.value&&clearTimeout(tn.value),tn.value=setTimeout(()=>{T.value=!0},10)})}),Pn.value=O.value.parentNode,Nn.value.observe(Pn.value)),Wr()}Qe(()=>{cancelAnimationFrame(en),Nn.value&&(Pn.value&&Nn.value.unobserve(Pn.value),Nn.value.disconnect())});let{isPrinting:Ln,isImaging:Rn,generatePdf:zn,generateImage:Bn}=Ae({elementId:`vue-ui-candlestick_${E.value}`,fileName:P.value.title.text||`vue-ui-candlestick`,options:A.value.userOptions.print}),Vn=f(()=>A.value.userOptions.show&&!P.value.title.text),B=v({showTable:A.value.table.show,showTooltip:P.value.tooltip.show}),{metrics:Hn,ready:Un,settling:V,update:Wn}=Me({svgRef:R,canMeasure:()=>(!A.value.responsive||$t.value)&&(!M.value.xAxis.dataLabels.show||Sr.value),initialMetrics:{scaleLabelsWidth:0,timeLabelsHeight:0},measure:e=>({scaleLabelsWidth:mn.value?e(mn.value).textWidth:M.value.yAxis.dataLabels.offsetX,timeLabelsHeight:e(hn.value).height})}),Gn=f(()=>hn.value?Hn.value.timeLabelsHeight+z.value.xAxisFontSize:0),Kn=f(()=>M.value.yAxis.position===`right`);function qn(){let e=Hn.value.scaleLabelsWidth,t=M.value.yAxis.axisName?.show?M.value.yAxis.axisName.fontSize+M.value.yAxis.axisName.offsetX:0,n=e+13+t;return{left:Kn.value?0:n,right:Kn.value?n:0,scaleLabelsWidth:e,yAxisNameWidth:t,crosshair:13}}let H=f(()=>{let{top:e,right:t,bottom:n,left:r}=N.value.padding,i=qn();return{top:e+12,right:z.value.width-t-i.right,left:r+i.left,bottom:z.value.height-n-Gn.value,width:z.value.width-r-t-i.left-i.right,height:z.value.height-e-n-Gn.value-12,scaleLabelsWidth:i.scaleLabelsWidth,yAxisNameWidth:i.yAxisNameWidth,crosshair:i.crosshair}}),Jn=f(()=>{let{left:e,top:t,width:n,height:r}=H.value,i=W.value.start,a=W.value.end-i,o=n/a,s=G.value.start-i,c=G.value.end-i,l=Math.max(0,Math.min(a,s)),ee=Math.max(0,Math.min(a,c));return{x:e+l*o,y:t,width:(ee-l)*o,height:r,fill:P.value.zoom.preview.fill,stroke:P.value.zoom.preview.stroke,"stroke-width":P.value.zoom.preview.strokeWidth,"stroke-dasharray":P.value.zoom.preview.strokeDasharray,"stroke-linecap":`round`,"stroke-linejoin":`round`,style:{pointerEvents:`none`,transition:`none !important`,animation:`none !important`}}}),U=f(()=>L.value.length),W=v({start:0,end:U.value}),G=v({start:0,end:U.value}),Yn=v(!1),Xn=v(!1),Zn=v(null),K=v(null),q=v(null),Qn=v(!1),$n=v({time:0,x:0,y:0,pointerType:null}),er=f(()=>P.value.zoom?.dragToZoom),J=f(()=>er.value.show&&Qt.value&&Hr.value&&U.value>1&&!I.value),tr=null,nr={},rr=f(()=>P.value.zoom.preview.enable&&(G.value.start!==W.value.start||G.value.end!==W.value.end));function ir(e,t){G.value[e]=t}function ar(e,t=W.value){if(!e||typeof e!=`object`)return null;let n=e.start!==void 0&&e.start!==null,r=e.end!==void 0&&e.end!==null;if(!n&&!r)return null;let i=Number(n?e.start:t.start),a=Number(r?e.end:t.end);return!Number.isFinite(i)||!Number.isFinite(a)?null:{start:i,end:a}}function or(e){let t=ar(e);t&&w(`update:zoomState`,t)}function sr(){tr&&=(cancelAnimationFrame(tr),null),nr={}}function cr(e){let t=ar(e);if(!t)return null;let{start:n,end:r}=t;return(n!==Number(W.value.start)||r!==Number(W.value.end))&&(sr(),W.value={start:n,end:r},G.value={start:n,end:r},ur()),{start:Number(W.value.start),end:Number(W.value.end)}}function lr(e){let t=cr(e);return t?(w(`update:zoomState`,t),t):null}function ur(){let e=Math.max(0,Math.min(W.value.start??0,U.value-1)),t=Math.max(e+1,Math.min(W.value.end??U.value,U.value));(!Number.isFinite(e)||!Number.isFinite(t)||t<=e)&&(e=0,t=U.value),W.value.start=e,W.value.end=t,G.value.start=e,G.value.end=t,cn.value&&cn.value.setRangeValues(e,t)}let dr=f(()=>L.value.map((e,t)=>({...e,absoluteIndex:t}))),fr=f(()=>dr.value.slice(W.value.start,W.value.end)),Y=f(()=>(Fn.value&&L.value.forEach((e,t)=>{[null,void 0].includes(e[0])&&te({componentName:`VueUiCandlestick`,type:`datasetAttribute`,property:`period (index 0)`,index:t}),[null,void 0].includes(e[1])&&te({componentName:`VueUiCandlestick`,type:`datasetAttribute`,property:`open (index 1)`,index:t}),[null,void 0].includes(e[2])&&te({componentName:`VueUiCandlestick`,type:`datasetAttribute`,property:`high (index 2)`,index:t}),[null,void 0].includes(e[3])&&te({componentName:`VueUiCandlestick`,type:`datasetAttribute`,property:`low (index 3)`,index:t}),[null,void 0].includes(e[4])&&te({componentName:`VueUiCandlestick`,type:`datasetAttribute`,property:`close (index 4)`,index:t}),[null,void 0].includes(e[5])&&te({componentName:`VueUiCandlestick`,type:`datasetAttribute`,property:`volume (index 5)`,index:t})}),fr.value.map(e=>({absoluteIndex:e.absoluteIndex,period:e[0],open:e[1],high:e[2],low:e[3],close:e[4],volume:e[5]})))),pr=f(()=>dr.value.map(e=>({absoluteIndex:e.absoluteIndex,period:e[0],open:e[1],high:e[2],low:e[3],close:e[4],volume:e[5]}))),X=f(()=>H.value.width/fr.value.length),mr=f(()=>({max:M.value.yAxis.scale.max===null?Math.max(...Y.value.map(e=>e.high)):M.value.yAxis.scale.max,min:M.value.yAxis.scale.min===null?0:M.value.yAxis.scale.min})),Z=f(()=>l(mr.value.min,mr.value.max,M.value.yAxis.dataLabels.steps));function hr(e,t,n=null,r=null){return{...e,x:u(H.value.left+t*X.value+X.value/2),y:u(H.value.top+(1-(e-Z.value.min)/(Z.value.max-Z.value.min))*H.value.height),value:u(e),isMax:e===n,isMin:e===r}}let Q=f(()=>{let e={o:Math.max(...Y.value.map(e=>e.open)),h:Math.max(...Y.value.map(e=>e.high)),l:Math.max(...Y.value.map(e=>e.low)),c:Math.max(...Y.value.map(e=>e.low))},t={o:Math.min(...Y.value.map(e=>e.open)),h:Math.min(...Y.value.map(e=>e.high)),l:Math.min(...Y.value.map(e=>e.low)),c:Math.min(...Y.value.map(e=>e.low))},n=Math.max(...Y.value.map(e=>e.volume)),r=Math.min(...Y.value.map(e=>e.volume));return Y.value.map((i,a)=>{let o=hr(i.open,a,e.o,t.o),s=hr(i.high,a,e.h,t.h),c=hr(i.low,a,e.l,t.l),l=hr(i.close,a,e.c,t.c),ee=i.close>i.open,te=i.volume===n,u=i.volume===r;return{period:i.period,open:o,high:s,low:c,close:l,volume:i.volume,isBullish:ee,absoluteIndex:i.absoluteIndex,isMaxVolume:te,isMinVolume:u}})});function gr({item:e,index:t,minimapH:n,unitW:r}){let i=M.value.yAxis.scale.min??0,a=M.value.yAxis.scale.max??Math.max(...L.value.map(e=>e[2]));return{...e,x:u(t*r),y:u((1-(e-i)/(a-i))*n),value:u(e)}}let _r=f(()=>({minimapH:e,unitW:t})=>pr.value.map((n,r)=>{let i=gr({item:n.open,index:r,minimapH:e,unitW:t}),a=gr({item:n.high,index:r,minimapH:e,unitW:t}),o=gr({item:n.low,index:r,minimapH:e,unitW:t}),s=gr({item:n.close,index:r,minimapH:e,unitW:t}),c=n.close>n.open;return{period:n.period,open:i,high:a,low:o,close:s,volume:n.volume,isBullish:c,absoluteIndex:n.absoluteIndex}})),vr=f(()=>P.value.zoom.minimap.show?[{name:``,series:L.value.map(e=>e[2]),color:`#000000`,isVisible:!0}]:[]);function yr(e){return u((e-Z.value.min)/(Z.value.max-Z.value.min))}let br=f(()=>Z.value.ticks.map(e=>({y:H.value.bottom-H.value.height*yr(e),value:u(e)}))),xr=f(()=>Y.value.map(e=>e.period)),$=v([]),Sr=v(!1),Cr=v([]),wr=0;at(()=>{let e=++wr;(async()=>{let t=await ke({values:L.value.map(e=>e[0]),maxDatapoints:L.value.length,formatter:M.value.xAxis.dataLabels.datetimeFormatter,start:W.value.start,end:W.value.end});e===wr&&($.value=t,Sr.value=!0)})()});let Tr=0;at(()=>{let e=++Tr;(async()=>{let t=await ke({values:L.value.map(e=>e[0]),maxDatapoints:L.value.length,formatter:M.value.xAxis.dataLabels.datetimeFormatter,start:0,end:U.value});e===Tr&&(Cr.value=t)})()});let Er=v({months:[],shortMonths:[],days:[],shortDays:[]}),Dr=0;at(()=>{let e=++Dr,t=M.value.xAxis.dataLabels.datetimeFormatter;(async()=>{let n=await Oe(t.locale).catch(()=>Oe(`en`));e===Dr&&(Er.value=n.data)})()});let Or=f(()=>{let e=M.value.xAxis.dataLabels.datetimeFormatter,t=De({useUTC:e.useUTC,locale:Er.value,januaryAsYear:e.januaryAsYear});return(e,n)=>{let r=L.value.map(e=>e[0])?.[e];return r==null?``:t.formatDate(new Date(r),n)}}),kr=f(()=>(L.value.map(e=>e[0])||[]).map((e,t)=>({text:Or.value(t,P.value.tooltip.timeFormat),absoluteIndex:t}))),Ar=f(()=>(L.value.map(e=>e[0])||[]).map((e,t)=>({text:Or.value(t,P.value.zoom.timeFormat),absoluteIndex:t}))),jr=f(()=>{let e=Math.max(1,Math.floor(Number(M.value.xAxis.dataLabels.modulo)||1)),t=($.value||[]).map(e=>e?.text??``),n=(Cr.value||[]).map(e=>e?.text??``),r=W.value.start??0,i=r>0||t.length<n.length;return re({configuredModulo:e,visibleTexts:t,allTexts:n,startAbs:r,isZoomed:i})}),Mr=f(()=>{let e=M.value.xAxis.dataLabels,t=$.value||[],n=Cr.value||[],r=W.value.start??0,i=D.value,a=U.value,o=t.map(e=>e?.text??``),s=n.map(e=>e?.text??``),c=ne(!!e.showOnlyFirstAndLast,!!e.showOnlyAtModulo,jr.value,o,s,r,i,a);if(!e.showFirstAndLast||e.showOnlyFirstAndLast||!c.length)return c;let l=c.length-1;return c.map((e,t)=>t!==0&&t!==l?e:{...e,text:o[t]??``})}),Nr=f(()=>M.value.xAxis.dataLabels.datetimeFormatter.enable?{start:$.value.find(e=>e.absoluteIndex===W.value.start)?.text??``,end:$.value.find(e=>e.absoluteIndex===W.value.end-1)?.text??``}:{start:L.value[W.value.start]?L.value[W.value.start][0]:L.value[0][0],end:L.value[W.value.end-1]?L.value[W.value.end-1][0]:L.value.at(-1)[0]}),Pr=v(null);function Fr(e,t){A.value.events.datapointClick&&A.value.events.datapointClick({datapoint:t,seriesIndex:e+W.value.start})}function Ir(e,t){A.value.events.datapointLeave&&A.value.events.datapointLeave({datapoint:t,seriesIndex:e+W.value.start}),D.value=void 0,nn.value=!1,k.value=null,bn.value=`pointer`}it(()=>C.selectedXIndex,e=>{if([null,void 0].includes(C.selectedXIndex)){D.value=null;return}let t=e-W.value.start;t<0||e>=W.value.end?D.value=null:D.value=t??null},{immediate:!0});function Lr(e,t,r=`pointer`){A.value.events.datapointEnter&&A.value.events.datapointEnter({datapoint:t,seriesIndex:e+W.value.start}),D.value=e,k.value=e,bn.value=r,Pr.value={datapoint:t,seriesIndex:e,series:Q.value,config:A.value},Ai({seriesIndex:e,datapoint:t});let a=P.value.tooltip.customFormat;if(i(a)&&oe(()=>a({seriesIndex:e,datapoint:t,series:Q.value,config:A.value})))rn.value=a({seriesIndex:e,datapoint:t,series:Q.value,config:A.value});else if(P.value.tooltip.show){let r=``,{period:i,open:a,high:o,low:s,close:c,volume:l,isBullish:ee}=Q.value[e],{period:te,open:u,high:ne,low:re,close:ie,volume:ae}=A.value.translations,oe=M.value.xAxis.dataLabels.datetimeFormatter.enable?P.value.tooltip.useDefaultTimeFormat?$.value[e].text:kr.value[e].text:i;r+=`<div><svg style="margin-right:6px" viewBox="0 0 12 12" height="12" width="12"><rect x="0" y="0" height="12" width="12" rx="${j.value.borderRadius*3}" stroke="${j.value.stroke}" stroke-width="${j.value.strokeWidth}"
2
2
  fill="${j.value.gradient.show?ee?`url(#bullish_gradient_${E.value})`:`url(#bearish_gradient_${E.value})`:ee?j.value.colors.bullish:j.value.colors.bearish}"/></svg>${oe}</div>`,r+=`${ae} : <b>${isNaN(l)?`-`:Number(l.toFixed(P.value.tooltip.roundingValue)).toLocaleString()}</b>`,r+=`<div style="margin-top:6px;padding-top:6px;border-top:1px solid ${P.value.tooltip.borderColor}">`;let se=n({p:P.value.tooltip.prefix,v:a.value,s:P.value.tooltip.suffix,r:P.value.tooltip.roundingValue}),ce=n({p:P.value.tooltip.prefix,v:o.value,s:P.value.tooltip.suffix,r:P.value.tooltip.roundingValue}),le=n({p:P.value.tooltip.prefix,v:s.value,s:P.value.tooltip.suffix,r:P.value.tooltip.roundingValue}),ue=n({p:P.value.tooltip.prefix,v:c.value,s:P.value.tooltip.suffix,r:P.value.tooltip.roundingValue});P.value.tooltip.showChart?r+=`<div style="width:100%;display:flex;align-items:center;justify-content:center;">
3
3
  <svg viewBox="0 0 100 100" width="100px" style="background: transparent; overflow: visible">
4
4
  <g>
@@ -1 +1 @@
1
- import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{t}from"./useConfig-D3ZfFSE5.js";import{D as n,Jt as r,X as i,at as a,nt as ee,zt as o}from"./lib-rPeBMZrn.js";import{n as te,t as ne}from"./useHints-C-TwxM0Y.js";import{t as re}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{t as ie}from"./useNestedProp-DnGoh-XS.js";import{n as ae,t as oe}from"./userOptionsSlots-DYuo-E5m.js";import{t as se}from"./usePrinter-DVf3YcG5.js";import{t as ce}from"./useUserOptionState-CXlFnwPv.js";import{t as le}from"./usePrefersMotion-XLHwega2.js";import{Fragment as s,computed as c,createBlock as ue,createCommentVNode as l,createElementBlock as u,createElementVNode as d,createSlots as de,createTextVNode as f,defineAsyncComponent as fe,guardReactiveProps as pe,mergeProps as me,nextTick as he,normalizeClass as ge,normalizeProps as _e,normalizeStyle as p,onBeforeUnmount as m,onMounted as h,openBlock as g,ref as _,renderList as v,renderSlot as y,shallowRef as ve,toDisplayString as b,unref as x,useSlots as ye,watch as S,withCtx as be}from"vue";var C=/* @__PURE__ */ e({default:()=>w}),xe=[`id`],Se=[`aria-labelledby`],Ce=[`id`],we=[`height`],Te=[`id`],Ee=[`data-cell`,`aria-label`,`height`],De={key:2,ref:`source`,dir:`auto`},w=/*#__PURE__*/ re({__name:`vue-ui-carousel-table`,props:{config:{type:Object,default(){return{}}},dataset:{type:Object,default(){return{}}}},emits:[`copyAlt`],setup(e,{expose:re,emit:C}){let w=fe(()=>import(`./vue-ui-skeleton-BqHwNz2O.js`).then(e=>e.n)),Oe=fe(()=>import(`./UserOptions-Em_JgDXM.js`).then(e=>e.n)),{vue_ui_carousel_table:ke}=t(),Ae=le(),T=e,je=C,E=_(i()),Me=_(!1),D=_(!!T.dataset),Ne=ye();h(()=>{Pe()});let O=c({get:()=>N(),set:e=>e}),k=c(()=>O.value.debug);h(()=>{Ne[`chart-background`]&&k.value&&console.warn(`VueUiCarouselTable does not support the #chart-background slot.`)});function Pe(){o(T.dataset)?a({componentName:`VueUiCarouselTable`,type:`dataset`,debug:k.value}):((!T.dataset.head||o(T.dataset.head))&&(a({componentName:`VueUiCarouselTable`,type:`datasetAttribute`,property:`head`,debug:k.value}),D.value=!1),(!T.dataset.body||o(T.dataset.body))&&(a({componentName:`VueUiCarouselTable`,type:`datasetAttribute`,property:`body`,debug:k.value}),D.value=!1)),Ae.value&&(O.value.userOptions.buttons.animation=!1)}te({config:()=>O.value,dataset:()=>T.dataset,component:`VueUiCarouselTable`,rules:[ne.noHint]});let Fe=c(()=>O.value.userOptions.useCursorPointer),{userOptionsVisible:A,setUserOptionsVisibility:j,keepUserOptionState:M}=ce({config:O.value});function N(){return ie({userConfig:T.config,defaultConfig:ke})}S(()=>T.config,e=>{O.value=N(),A.value=!O.value.userOptions.showOnChartHover,Pe()},{deep:!0}),S(()=>T.dataset,e=>{G()},{deep:!0});let{isPrinting:P,isImaging:Ie,generatePdf:Le,generateImage:Re}=se({elementId:`carousel-table_${E.value}`,fileName:O.value.caption.text||`vue-ui-carousel-table`,options:O.value.userOptions.print}),F=_({showAnimation:O.value.animation.use}),I=_(null),ze=_(null),L=_(null),R=_(null),z=_(0),B=_(0),V=_(!1),H=_(null),U=_(null),W=_(0);function G(){H.value&&(U.value={elements:H.value.getElementsByTagName(`tr`),heights:Array.from(H.value.getElementsByTagName(`tr`)).map(e=>e.getBoundingClientRect().height)})}h(G);let Be=c(()=>!U.value||!U.value.heights.length?0:Math.max(...U.value.heights)+z.value+B.value),Ve=c(()=>T.dataset.body?O.value.tbody.tr.visible<=T.dataset.body.length?O.value.tbody.tr.visible:T.dataset.body.length:0),He=c(()=>(O.value.tbody.tr.height+O.value.tbody.tr.td.padding.top+O.value.tbody.tr.td.padding.bottom+O.value.tbody.tr.border.size*2)*Ve.value+z.value+B.value),K=_(0),q=_(null),J=_(0),Y=_(!1),Ue=_(0);h(()=>{L.value&&(z.value=L.value.getBoundingClientRect().height),R.value&&(B.value=R.value.getBoundingClientRect().height),F.value.showAnimation&&U.value&&Ge()}),h(()=>{if(I.value){let e=I.value.querySelector(`thead`),t=Array.from(H.value.querySelectorAll(`tr`));function n(){let n=e.getBoundingClientRect().bottom;t.forEach(e=>{e.getBoundingClientRect().top<n?e.style.visibility=`hidden`:e.style.visibility=`visible`})}I.value.addEventListener(`scroll`,n),n(),m(()=>{I.value.removeEventListener(`scroll`,n)})}});function We(e){Me.value=e,Ue.value+=1}function Ge(){Ae.value||!q.value&&!Y.value&&(O.value.animation.type===`scroll`?q.value=requestAnimationFrame(qe):q.value=requestAnimationFrame(Je))}function Ke(){if(!I.value)return!1;let{scrollTop:e,scrollHeight:t,clientHeight:n}=I.value;return e+n>=t}function qe(e){Y.value||(J.value||=e,e-J.value>=O.value.animation.speedMs&&(K.value+=U.value.heights[W.value],(Ke()||W.value>=U.value.heights.length)&&(K.value=0,W.value=-1),W.value+=1,I.value&&I.value.scrollTo({top:K.value,behavior:`smooth`}),J.value=e),q.value=requestAnimationFrame(qe))}function Je(e){if(Y.value)return;J.value||=e;let t=e-J.value,n=O.value.animation.speedMs/4/1e3;t>=n&&(K.value+=n,K.value>=I.value.scrollHeight-I.value.clientHeight&&(K.value=0),I.value&&I.value.scrollTo({top:K.value,behavior:`auto`}),J.value=e),q.value=requestAnimationFrame(Je)}function X(){Y.value=!0,cancelAnimationFrame(q.value),q.value=null}m(X);function Z(){Y.value&&F.value.showAnimation&&(Y.value=!1,J.value=0,Ge())}function Ye(){O.value.animation.pauseOnHover&&X()}let Q=_(null);function Xe(){X(),clearTimeout(Q.value)}function Ze(){clearTimeout(Q.value),Q.value=setTimeout(Z,1e3)}S(()=>O.value.animation.use,e=>{e?(F.value.showAnimation=!0,Z()):(F.value.showAnimation=!1,X())}),S(()=>O.value.animation.type,e=>{X(),K.value=0,W.value=0,I.value.scrollTo({top:0,behavior:`auto`}),Z()});let Qe=c(()=>O.value.responsiveBreakpoint),$=ve(null);h(()=>{$.value=new ResizeObserver(e=>{e.forEach(e=>{V.value=e.contentRect.width<Qe.value}),z.value=L.value?L.value.getBoundingClientRect().height:0,B.value=R.value?R.value.getBoundingClientRect().height:0,W.value=0,he(()=>{X(),J.value=0,K.value=0,G(),Z()})}),I.value&&$.value.observe(I.value)}),m(()=>{$.value&&$.value.disconnect()});function $e(){Le()}function et(){F.value.showAnimation=!F.value.showAnimation,F.value.showAnimation?Z():X()}function tt(e=null){he(()=>{let t=T.dataset.head.map((e,t)=>[[T.dataset.body[t]]]),r=[[O.value.caption.text],[T.dataset.head.map(e=>[e])]].concat(t),i=n(r);e?e(i):ee({csvContent:i,title:O.value.caption.text||`vue-ui-carousel-table`})})}async function nt(){je(`copyAlt`,{config:O.value,dataset:T.dataset}),O.value.userOptions.callbacks.altCopy?await Promise.resolve(O.value.userOptions.callbacks.altCopy({config:O.value,dataset:T.dataset})):console.warn("Vue Data UI - A callback must be set for `altCopy` in userOptions.")}return re({pauseAnimation:X,resumeAnimation:Z,toggleAnimation:et,generateCsv:tt,generatePdf:$e,generateImage:Re,copyAlt:nt}),(t,n)=>(g(),u(`div`,{class:`vue-data-ui-component vue-ui-carousel-table`,style:{position:`relative`,overflow:`visible`},ref_key:`chartContainer`,ref:ze,onMouseenter:n[5]||=()=>x(j)(!0),onMouseleave:n[6]||=()=>x(j)(!1)},[d(`div`,{ref_key:`tableContainer`,ref:I,id:`carousel-table_${E.value}`,style:p({height:x(P)||x(Ie)?`auto`:`${Math.max(He.value,Be.value)}px`,containerType:`inline-size`,position:`relative`,overflow:`auto`,fontFamily:O.value.fontFamily}),class:ge({"vue-ui-responsive":V.value,"is-playing":O.value.scrollbar.hide||!Y.value&&O.value.scrollbar.showOnlyOnHover}),onMouseover:n[0]||=e=>Ye(),onMouseleave:n[1]||=e=>Z(),onTouchstart:n[2]||=e=>Xe(),onTouchend:n[3]||=e=>Ze(),onTouchcancel:n[4]||=e=>Ze()},[D.value?(g(),u(`table`,{key:0,class:`vue-data-ui-carousel-table`,"aria-labelledby":`carousel-caption-${E.value}`,style:p({...O.value.style,border:`${O.value.border.size}px solid ${O.value.border.color}`,width:`100%`,borderCollapse:`collapse`,backgroundColor:O.value.tbody.backgroundColor})},[d(`caption`,{ref_key:`caption`,ref:L,class:`vue-data-ui-carousel-table-caption`,id:`carousel-caption-${E.value}`,style:p({...O.value.caption.style,fontFamily:`inherit`,position:`sticky`,top:0,zIndex:2,paddingTop:O.value.caption.padding.top+`px`,paddingRight:O.value.caption.padding.right+`px`,paddingBottom:O.value.caption.padding.bottom+`px`,paddingLeft:O.value.caption.padding.left+`px`,boxShadow:V.value?O.value.thead.tr.style.boxShadow:`none`,minHeight:`36px`,display:t.$slots.caption||O.value.caption.text||O.value.userOptions.show?``:`none`})},[f(b(O.value.caption.text&&!t.$slots.caption?O.value.caption.text:``)+` `,1),y(t.$slots,`caption`,{},void 0,!0)],12,Ce),d(`thead`,{role:`rowgroup`,style:p({...O.value.thead.style,position:`sticky`,top:`${t.$slots.caption||O.value.caption.text||O.value.userOptions.show?z.value:0}px`,zIndex:1})},[d(`tr`,{ref_key:`tableRow`,ref:R,role:`row`,style:p({...O.value.thead.tr.style,border:O.value.thead.tr.border.size?`${O.value.thead.tr.border.size}px solid ${O.value.thead.tr.border.color}`:`none`,boxShadow:V.value?`none`:O.value.thead.tr.style.boxShadow}),height:`${O.value.thead.tr.height}px`},[(g(!0),u(s,null,v(e.dataset.head,(e,n)=>(g(),u(`th`,{role:`cell`,key:`th_${n}`,id:`col-${n}`,scope:`col`,style:p({...O.value.thead.tr.th.style,border:O.value.thead.tr.th.border.size?`${O.value.thead.tr.th.border.size}px solid ${O.value.thead.tr.th.border.color}`:`none`,paddingTop:O.value.thead.tr.th.padding.top+`px`,paddingRight:O.value.thead.tr.th.padding.right+`px`,paddingBottom:O.value.thead.tr.th.padding.bottom+`px`,paddingLeft:O.value.thead.tr.th.padding.left+`px`})},[f(b(t.$slots.th?``:e)+` `,1),y(t.$slots,`th`,me({ref_for:!0},{th:e,colIndex:n}),void 0,!0)],12,Te))),128))],12,we)],4),e.dataset.body&&e.dataset.head?(g(),u(`tbody`,{key:0,ref_key:`tbody`,ref:H,"aria-live":`polite`,style:{clipPath:`inset(0,0,0,0)`}},[(g(!0),u(s,null,v(e.dataset.body,(n,i)=>(g(),u(`tr`,{style:p({...O.value.tbody.tr.style,border:`${O.value.tbody.tr.border.size}px solid ${O.value.tbody.tr.border.color}`,verticalAlign:`middle`})},[(g(!0),u(s,null,v(n,(n,a)=>(g(),u(`td`,{role:`cell`,"data-cell":e.dataset.head[a]||``,"aria-label":`${e.dataset.head[a]}: ${n}`,style:p({...O.value.tbody.tr.td.style,border:`${O.value.tbody.tr.td.border.size}px solid ${O.value.tbody.tr.td.border.color}`,backgroundColor:x(r)(O.value.tbody.tr.td.style.backgroundColor,i%2==0&&O.value.tbody.tr.td.alternateColor?O.value.tbody.tr.td.alternateOpacity*100:100),paddingTop:O.value.tbody.tr.td.padding.top+`px`,paddingRight:O.value.tbody.tr.td.padding.right+`px`,paddingBottom:O.value.tbody.tr.td.padding.bottom+`px`,paddingLeft:O.value.tbody.tr.td.padding.left+`px`,verticalAlign:`middle`}),height:`${O.value.tbody.tr.height}px`},[f(b(t.$slots.td?``:n)+` `,1),y(t.$slots,`td`,me({ref_for:!0},{td:n,rowIndex:i,colIndex:a}),void 0,!0)],12,Ee))),256))],4))),256))],512)):l(``,!0)],12,Se)):l(``,!0)],46,xe),D.value?l(``,!0):(g(),ue(x(w),{key:0,config:{type:`table`}})),O.value.userOptions.show&&D.value&&(x(M)||x(A))?(g(),ue(x(Oe),{ref:`details`,key:`user_option_${Ue.value}`,backgroundColor:O.value.style.backgroundColor,color:O.value.style.color,isPrinting:x(P),isImaging:x(Ie),uid:E.value,hasTooltip:!1,hasPdf:O.value.userOptions.buttons.pdf,hasImg:O.value.userOptions.buttons.img,hasXls:O.value.userOptions.buttons.csv,hasTable:!1,hasLabel:!1,hasAnimation:O.value.userOptions.buttons.animation,isAnimation:!F.value.showAnimation,hasFullscreen:O.value.userOptions.buttons.fullscreen,hasAltCopy:O.value.userOptions.buttons.altCopy,isFullscreen:Me.value,chartElement:ze.value,position:O.value.userOptions.position,titles:{...O.value.userOptions.buttonTitles},zIndex:3,offsetX:12,callbacks:O.value.userOptions.callbacks,printScale:O.value.userOptions.print.scale,isCursorPointer:Fe.value,onGeneratePdf:$e,onGenerateCsv:tt,onGenerateImage:x(Re),onToggleAnimation:et,onToggleFullscreen:We,onCopyAlt:nt,style:p({visibility:x(M)?x(A)?`visible`:`hidden`:`visible`})},de({_:2},[v(x(ae)(t.$slots,`menuIcon optionPdf optionCsv optionImg optionSvg optionAnimation optionFullscreen optionAltCopy custom-menu-before custom-menu-after`),e=>({name:e,fn:be(n=>[y(t.$slots,e,_e(pe(x(oe)(e,n))),void 0,!0)])}))]),1032,[`backgroundColor`,`color`,`isPrinting`,`isImaging`,`uid`,`hasPdf`,`hasImg`,`hasXls`,`hasAnimation`,`isAnimation`,`hasFullscreen`,`hasAltCopy`,`isFullscreen`,`chartElement`,`position`,`titles`,`callbacks`,`printScale`,`isCursorPointer`,`onGenerateImage`,`style`])):l(``,!0),t.$slots.source?(g(),u(`div`,De,[y(t.$slots,`source`,{},void 0,!0)],512)):l(``,!0)],544))}},[[`__scopeId`,`data-v-f8c6267a`]]);export{C as n,w as t};
1
+ import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{t}from"./useConfig-D3ZfFSE5.js";import{D as n,Jt as r,X as i,at as a,nt as ee,zt as o}from"./lib-rPeBMZrn.js";import{n as te,t as ne}from"./useHints-C-TwxM0Y.js";import{t as re}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{t as ie}from"./useNestedProp-DnGoh-XS.js";import{n as ae,t as oe}from"./userOptionsSlots-DYuo-E5m.js";import{t as se}from"./usePrinter-DVf3YcG5.js";import{t as ce}from"./useUserOptionState-CXlFnwPv.js";import{t as le}from"./usePrefersMotion-XLHwega2.js";import{Fragment as s,computed as c,createBlock as ue,createCommentVNode as l,createElementBlock as u,createElementVNode as d,createSlots as de,createTextVNode as f,defineAsyncComponent as fe,guardReactiveProps as pe,mergeProps as me,nextTick as he,normalizeClass as ge,normalizeProps as _e,normalizeStyle as p,onBeforeUnmount as m,onMounted as h,openBlock as g,ref as _,renderList as v,renderSlot as y,shallowRef as ve,toDisplayString as b,unref as x,useSlots as ye,watch as S,withCtx as be}from"vue";var C=/* @__PURE__ */ e({default:()=>w}),xe=[`id`],Se=[`aria-labelledby`],Ce=[`id`],we=[`height`],Te=[`id`],Ee=[`data-cell`,`aria-label`,`height`],De={key:2,ref:`source`,dir:`auto`},w=/*#__PURE__*/ re({__name:`vue-ui-carousel-table`,props:{config:{type:Object,default(){return{}}},dataset:{type:Object,default(){return{}}}},emits:[`copyAlt`],setup(e,{expose:re,emit:C}){let w=fe(()=>import(`./vue-ui-skeleton-C0oElPXz.js`).then(e=>e.n)),Oe=fe(()=>import(`./UserOptions-Em_JgDXM.js`).then(e=>e.n)),{vue_ui_carousel_table:ke}=t(),Ae=le(),T=e,je=C,E=_(i()),Me=_(!1),D=_(!!T.dataset),Ne=ye();h(()=>{Pe()});let O=c({get:()=>N(),set:e=>e}),k=c(()=>O.value.debug);h(()=>{Ne[`chart-background`]&&k.value&&console.warn(`VueUiCarouselTable does not support the #chart-background slot.`)});function Pe(){o(T.dataset)?a({componentName:`VueUiCarouselTable`,type:`dataset`,debug:k.value}):((!T.dataset.head||o(T.dataset.head))&&(a({componentName:`VueUiCarouselTable`,type:`datasetAttribute`,property:`head`,debug:k.value}),D.value=!1),(!T.dataset.body||o(T.dataset.body))&&(a({componentName:`VueUiCarouselTable`,type:`datasetAttribute`,property:`body`,debug:k.value}),D.value=!1)),Ae.value&&(O.value.userOptions.buttons.animation=!1)}te({config:()=>O.value,dataset:()=>T.dataset,component:`VueUiCarouselTable`,rules:[ne.noHint]});let Fe=c(()=>O.value.userOptions.useCursorPointer),{userOptionsVisible:A,setUserOptionsVisibility:j,keepUserOptionState:M}=ce({config:O.value});function N(){return ie({userConfig:T.config,defaultConfig:ke})}S(()=>T.config,e=>{O.value=N(),A.value=!O.value.userOptions.showOnChartHover,Pe()},{deep:!0}),S(()=>T.dataset,e=>{G()},{deep:!0});let{isPrinting:P,isImaging:Ie,generatePdf:Le,generateImage:Re}=se({elementId:`carousel-table_${E.value}`,fileName:O.value.caption.text||`vue-ui-carousel-table`,options:O.value.userOptions.print}),F=_({showAnimation:O.value.animation.use}),I=_(null),ze=_(null),L=_(null),R=_(null),z=_(0),B=_(0),V=_(!1),H=_(null),U=_(null),W=_(0);function G(){H.value&&(U.value={elements:H.value.getElementsByTagName(`tr`),heights:Array.from(H.value.getElementsByTagName(`tr`)).map(e=>e.getBoundingClientRect().height)})}h(G);let Be=c(()=>!U.value||!U.value.heights.length?0:Math.max(...U.value.heights)+z.value+B.value),Ve=c(()=>T.dataset.body?O.value.tbody.tr.visible<=T.dataset.body.length?O.value.tbody.tr.visible:T.dataset.body.length:0),He=c(()=>(O.value.tbody.tr.height+O.value.tbody.tr.td.padding.top+O.value.tbody.tr.td.padding.bottom+O.value.tbody.tr.border.size*2)*Ve.value+z.value+B.value),K=_(0),q=_(null),J=_(0),Y=_(!1),Ue=_(0);h(()=>{L.value&&(z.value=L.value.getBoundingClientRect().height),R.value&&(B.value=R.value.getBoundingClientRect().height),F.value.showAnimation&&U.value&&Ge()}),h(()=>{if(I.value){let e=I.value.querySelector(`thead`),t=Array.from(H.value.querySelectorAll(`tr`));function n(){let n=e.getBoundingClientRect().bottom;t.forEach(e=>{e.getBoundingClientRect().top<n?e.style.visibility=`hidden`:e.style.visibility=`visible`})}I.value.addEventListener(`scroll`,n),n(),m(()=>{I.value.removeEventListener(`scroll`,n)})}});function We(e){Me.value=e,Ue.value+=1}function Ge(){Ae.value||!q.value&&!Y.value&&(O.value.animation.type===`scroll`?q.value=requestAnimationFrame(qe):q.value=requestAnimationFrame(Je))}function Ke(){if(!I.value)return!1;let{scrollTop:e,scrollHeight:t,clientHeight:n}=I.value;return e+n>=t}function qe(e){Y.value||(J.value||=e,e-J.value>=O.value.animation.speedMs&&(K.value+=U.value.heights[W.value],(Ke()||W.value>=U.value.heights.length)&&(K.value=0,W.value=-1),W.value+=1,I.value&&I.value.scrollTo({top:K.value,behavior:`smooth`}),J.value=e),q.value=requestAnimationFrame(qe))}function Je(e){if(Y.value)return;J.value||=e;let t=e-J.value,n=O.value.animation.speedMs/4/1e3;t>=n&&(K.value+=n,K.value>=I.value.scrollHeight-I.value.clientHeight&&(K.value=0),I.value&&I.value.scrollTo({top:K.value,behavior:`auto`}),J.value=e),q.value=requestAnimationFrame(Je)}function X(){Y.value=!0,cancelAnimationFrame(q.value),q.value=null}m(X);function Z(){Y.value&&F.value.showAnimation&&(Y.value=!1,J.value=0,Ge())}function Ye(){O.value.animation.pauseOnHover&&X()}let Q=_(null);function Xe(){X(),clearTimeout(Q.value)}function Ze(){clearTimeout(Q.value),Q.value=setTimeout(Z,1e3)}S(()=>O.value.animation.use,e=>{e?(F.value.showAnimation=!0,Z()):(F.value.showAnimation=!1,X())}),S(()=>O.value.animation.type,e=>{X(),K.value=0,W.value=0,I.value.scrollTo({top:0,behavior:`auto`}),Z()});let Qe=c(()=>O.value.responsiveBreakpoint),$=ve(null);h(()=>{$.value=new ResizeObserver(e=>{e.forEach(e=>{V.value=e.contentRect.width<Qe.value}),z.value=L.value?L.value.getBoundingClientRect().height:0,B.value=R.value?R.value.getBoundingClientRect().height:0,W.value=0,he(()=>{X(),J.value=0,K.value=0,G(),Z()})}),I.value&&$.value.observe(I.value)}),m(()=>{$.value&&$.value.disconnect()});function $e(){Le()}function et(){F.value.showAnimation=!F.value.showAnimation,F.value.showAnimation?Z():X()}function tt(e=null){he(()=>{let t=T.dataset.head.map((e,t)=>[[T.dataset.body[t]]]),r=[[O.value.caption.text],[T.dataset.head.map(e=>[e])]].concat(t),i=n(r);e?e(i):ee({csvContent:i,title:O.value.caption.text||`vue-ui-carousel-table`})})}async function nt(){je(`copyAlt`,{config:O.value,dataset:T.dataset}),O.value.userOptions.callbacks.altCopy?await Promise.resolve(O.value.userOptions.callbacks.altCopy({config:O.value,dataset:T.dataset})):console.warn("Vue Data UI - A callback must be set for `altCopy` in userOptions.")}return re({pauseAnimation:X,resumeAnimation:Z,toggleAnimation:et,generateCsv:tt,generatePdf:$e,generateImage:Re,copyAlt:nt}),(t,n)=>(g(),u(`div`,{class:`vue-data-ui-component vue-ui-carousel-table`,style:{position:`relative`,overflow:`visible`},ref_key:`chartContainer`,ref:ze,onMouseenter:n[5]||=()=>x(j)(!0),onMouseleave:n[6]||=()=>x(j)(!1)},[d(`div`,{ref_key:`tableContainer`,ref:I,id:`carousel-table_${E.value}`,style:p({height:x(P)||x(Ie)?`auto`:`${Math.max(He.value,Be.value)}px`,containerType:`inline-size`,position:`relative`,overflow:`auto`,fontFamily:O.value.fontFamily}),class:ge({"vue-ui-responsive":V.value,"is-playing":O.value.scrollbar.hide||!Y.value&&O.value.scrollbar.showOnlyOnHover}),onMouseover:n[0]||=e=>Ye(),onMouseleave:n[1]||=e=>Z(),onTouchstart:n[2]||=e=>Xe(),onTouchend:n[3]||=e=>Ze(),onTouchcancel:n[4]||=e=>Ze()},[D.value?(g(),u(`table`,{key:0,class:`vue-data-ui-carousel-table`,"aria-labelledby":`carousel-caption-${E.value}`,style:p({...O.value.style,border:`${O.value.border.size}px solid ${O.value.border.color}`,width:`100%`,borderCollapse:`collapse`,backgroundColor:O.value.tbody.backgroundColor})},[d(`caption`,{ref_key:`caption`,ref:L,class:`vue-data-ui-carousel-table-caption`,id:`carousel-caption-${E.value}`,style:p({...O.value.caption.style,fontFamily:`inherit`,position:`sticky`,top:0,zIndex:2,paddingTop:O.value.caption.padding.top+`px`,paddingRight:O.value.caption.padding.right+`px`,paddingBottom:O.value.caption.padding.bottom+`px`,paddingLeft:O.value.caption.padding.left+`px`,boxShadow:V.value?O.value.thead.tr.style.boxShadow:`none`,minHeight:`36px`,display:t.$slots.caption||O.value.caption.text||O.value.userOptions.show?``:`none`})},[f(b(O.value.caption.text&&!t.$slots.caption?O.value.caption.text:``)+` `,1),y(t.$slots,`caption`,{},void 0,!0)],12,Ce),d(`thead`,{role:`rowgroup`,style:p({...O.value.thead.style,position:`sticky`,top:`${t.$slots.caption||O.value.caption.text||O.value.userOptions.show?z.value:0}px`,zIndex:1})},[d(`tr`,{ref_key:`tableRow`,ref:R,role:`row`,style:p({...O.value.thead.tr.style,border:O.value.thead.tr.border.size?`${O.value.thead.tr.border.size}px solid ${O.value.thead.tr.border.color}`:`none`,boxShadow:V.value?`none`:O.value.thead.tr.style.boxShadow}),height:`${O.value.thead.tr.height}px`},[(g(!0),u(s,null,v(e.dataset.head,(e,n)=>(g(),u(`th`,{role:`cell`,key:`th_${n}`,id:`col-${n}`,scope:`col`,style:p({...O.value.thead.tr.th.style,border:O.value.thead.tr.th.border.size?`${O.value.thead.tr.th.border.size}px solid ${O.value.thead.tr.th.border.color}`:`none`,paddingTop:O.value.thead.tr.th.padding.top+`px`,paddingRight:O.value.thead.tr.th.padding.right+`px`,paddingBottom:O.value.thead.tr.th.padding.bottom+`px`,paddingLeft:O.value.thead.tr.th.padding.left+`px`})},[f(b(t.$slots.th?``:e)+` `,1),y(t.$slots,`th`,me({ref_for:!0},{th:e,colIndex:n}),void 0,!0)],12,Te))),128))],12,we)],4),e.dataset.body&&e.dataset.head?(g(),u(`tbody`,{key:0,ref_key:`tbody`,ref:H,"aria-live":`polite`,style:{clipPath:`inset(0,0,0,0)`}},[(g(!0),u(s,null,v(e.dataset.body,(n,i)=>(g(),u(`tr`,{style:p({...O.value.tbody.tr.style,border:`${O.value.tbody.tr.border.size}px solid ${O.value.tbody.tr.border.color}`,verticalAlign:`middle`})},[(g(!0),u(s,null,v(n,(n,a)=>(g(),u(`td`,{role:`cell`,"data-cell":e.dataset.head[a]||``,"aria-label":`${e.dataset.head[a]}: ${n}`,style:p({...O.value.tbody.tr.td.style,border:`${O.value.tbody.tr.td.border.size}px solid ${O.value.tbody.tr.td.border.color}`,backgroundColor:x(r)(O.value.tbody.tr.td.style.backgroundColor,i%2==0&&O.value.tbody.tr.td.alternateColor?O.value.tbody.tr.td.alternateOpacity*100:100),paddingTop:O.value.tbody.tr.td.padding.top+`px`,paddingRight:O.value.tbody.tr.td.padding.right+`px`,paddingBottom:O.value.tbody.tr.td.padding.bottom+`px`,paddingLeft:O.value.tbody.tr.td.padding.left+`px`,verticalAlign:`middle`}),height:`${O.value.tbody.tr.height}px`},[f(b(t.$slots.td?``:n)+` `,1),y(t.$slots,`td`,me({ref_for:!0},{td:n,rowIndex:i,colIndex:a}),void 0,!0)],12,Ee))),256))],4))),256))],512)):l(``,!0)],12,Se)):l(``,!0)],46,xe),D.value?l(``,!0):(g(),ue(x(w),{key:0,config:{type:`table`}})),O.value.userOptions.show&&D.value&&(x(M)||x(A))?(g(),ue(x(Oe),{ref:`details`,key:`user_option_${Ue.value}`,backgroundColor:O.value.style.backgroundColor,color:O.value.style.color,isPrinting:x(P),isImaging:x(Ie),uid:E.value,hasTooltip:!1,hasPdf:O.value.userOptions.buttons.pdf,hasImg:O.value.userOptions.buttons.img,hasXls:O.value.userOptions.buttons.csv,hasTable:!1,hasLabel:!1,hasAnimation:O.value.userOptions.buttons.animation,isAnimation:!F.value.showAnimation,hasFullscreen:O.value.userOptions.buttons.fullscreen,hasAltCopy:O.value.userOptions.buttons.altCopy,isFullscreen:Me.value,chartElement:ze.value,position:O.value.userOptions.position,titles:{...O.value.userOptions.buttonTitles},zIndex:3,offsetX:12,callbacks:O.value.userOptions.callbacks,printScale:O.value.userOptions.print.scale,isCursorPointer:Fe.value,onGeneratePdf:$e,onGenerateCsv:tt,onGenerateImage:x(Re),onToggleAnimation:et,onToggleFullscreen:We,onCopyAlt:nt,style:p({visibility:x(M)?x(A)?`visible`:`hidden`:`visible`})},de({_:2},[v(x(ae)(t.$slots,`menuIcon optionPdf optionCsv optionImg optionSvg optionAnimation optionFullscreen optionAltCopy custom-menu-before custom-menu-after`),e=>({name:e,fn:be(n=>[y(t.$slots,e,_e(pe(x(oe)(e,n))),void 0,!0)])}))]),1032,[`backgroundColor`,`color`,`isPrinting`,`isImaging`,`uid`,`hasPdf`,`hasImg`,`hasXls`,`hasAnimation`,`isAnimation`,`hasFullscreen`,`hasAltCopy`,`isFullscreen`,`chartElement`,`position`,`titles`,`callbacks`,`printScale`,`isCursorPointer`,`onGenerateImage`,`style`])):l(``,!0),t.$slots.source?(g(),u(`div`,De,[y(t.$slots,`source`,{},void 0,!0)],512)):l(``,!0)],544))}},[[`__scopeId`,`data-v-f8c6267a`]]);export{C as n,w as t};
@@ -1 +1 @@
1
- import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{t}from"./useConfig-D3ZfFSE5.js";import{$ as n,D as r,Ht as i,It as a,Jt as o,S as ee,X as te,Yt as ne,at as re,f as s,h as ie,i as c,in as ae,nt as oe,p as se,r as ce,t as le,w as ue,yt as de,zt as fe}from"./lib-rPeBMZrn.js";import{n as pe,t as me}from"./BaseScanner-8NdoBs7B.js";import{n as he,t as ge}from"./useHints-C-TwxM0Y.js";import{t as _e}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{n as ve}from"./resolveChartConfig-CIhClE5R.js";import{t as ye}from"./img-D4RQwASc.js";import{t as be}from"./useChartExport-BZts4KFb.js";import{t as xe}from"./tableIntegration-CNoJ1CIY.js";import{n as Se,t as Ce}from"./annotationSlots-RvQBEO9-.js";import{n as we,t as Te}from"./userOptionsSlots-DYuo-E5m.js";import{t as Ee}from"./usePrinter-DVf3YcG5.js";import{t as De}from"./DefGrad-DKMq1REY.js";import{t as Oe}from"./A11yDataTable-DWNlWXzs.js";import{t as ke}from"./useUserOptionState-CXlFnwPv.js";import{t as Ae}from"./useChartAccessibility-DOMuYJfm.js";import{t as je}from"./useTableResponsive-uSz_qZOB.js";import{t as Me}from"./vue_ui_chestnut-BxxivKN7.js";import{Fragment as l,computed as u,createBlock as d,createCommentVNode as f,createElementBlock as p,createElementVNode as m,createSlots as Ne,createTextVNode as Pe,createVNode as h,defineAsyncComponent as Fe,guardReactiveProps as Ie,mergeProps as Le,nextTick as Re,normalizeClass as g,normalizeProps as ze,normalizeStyle as _,onMounted as Be,openBlock as v,ref as y,renderList as b,renderSlot as x,resolveDynamicComponent as Ve,toDisplayString as S,toRefs as He,unref as C,useCssVars as Ue,watch as We,withCtx as Ge,withKeys as Ke}from"vue";var qe=/* @__PURE__ */ e({default:()=>zn}),Je=[`id`],Ye=[`id`],Xe={"aria-live":`polite`,class:`sr-only`},Ze={key:2,ref:`noTitle`,class:`vue-data-ui-no-title-space`,style:`height:36px; width: 100%;background:transparent`},Qe={style:{position:`relative`}},$e=[`xmlns`,`aria-describedby`,`viewBox`],et=[`width`,`height`],tt={key:1},nt=[`fill`,`font-weight`,`font-size`,`x`,`y`],rt=[`fill`,`font-weight`,`font-size`,`x`,`y`],it={key:2},at=[`x`,`y`,`font-size`,`font-weight`,`fill`],ot=[`x`,`y`,`font-size`,`font-weight`,`fill`],st=[`d`,`stroke`,`fill`],ct=[`cx`,`cy`,`r`,`fill`],lt=[`aria-label`,`cx`,`cy`,`r`,`fill`,`stroke`,`stroke-width`,`onClick`],ut={key:3},dt=[`x`,`y`,`font-size`,`fill`,`onClick`],ft={key:0},pt=[`x`,`y`,`fill`,`font-size`,`font-weight`],mt=[`x`,`y`,`height`,`width`,`fill`,`rx`,`onClick`],ht=[`aria-label`,`x`,`y`,`height`,`width`,`fill`,`rx`,`stroke`,`stroke-width`,`onClick`],gt={key:4},_t=[`x`,`y`,`fill`,`font-size`,`onClick`],vt=[`d`,`stroke`],yt=[`aria-label`,`fill`,`cx`,`cy`,`r`,`onClick`],bt={key:5},xt=[`x`,`y`,`font-size`,`font-weight`,`fill`],St=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`],Ct=[`y`,`height`,`width`],wt={style:{width:`100%`,height:`100%`,display:`flex`,"align-items":`center`,"justify-content":`center`,"flex-direction":`column`}},Tt={style:{display:`flex`,"align-items":`center`,"justify-content":`center`,gap:`12px`,"flex-wrap":`wrap`,"flex-direction":`row`}},Et={viewBox:`0 0 20 20`,height:`16`,width:`16`},Dt=[`fill`],Ot={key:7},kt=[`y`,`height`,`width`],At={style:{width:`100%`,height:`100%`,display:`flex`,"align-items":`center`,"justify-content":`center`,"flex-direction":`column`}},jt={style:{display:`flex`,"align-items":`center`,"justify-content":`center`,gap:`12px`,"flex-wrap":`wrap`,"flex-direction":`row`}},Mt={viewBox:`0 0 20 20`,height:`16`,width:`16`},Nt=[`fill`],Pt=[`cx`,`cy`,`fill`],Ft=[`d`,`stroke`],It=[`cx`,`cy`,`fill`],Lt=[`d`,`stroke`],Rt=[`cx`,`cy`,`fill`],zt=[`cx`,`cy`,`fill`],Bt=[`x`,`y`,`fill`,`font-size`,`font-weight`],Vt=[`x`,`y`,`fill`,`font-size`,`font-weight`],Ht=[`x`,`text-anchor`,`y`,`fill`,`font-size`],Ut=[`x`,`text-anchor`,`y`,`fill`,`font-size`],Wt=[`x`,`text-anchor`,`y`,`fill`,`font-size`],Gt=[`x`,`text-anchor`,`y`,`fill`,`font-size`],Kt=[`x`,`text-anchor`,`y`,`fill`,`font-size`],qt=[`x`,`y`,`font-size`,`fill`],Jt=[`x`,`y`,`font-size`,`fill`],Yt=[`x`,`y`,`font-size`,`fill`],Xt={key:4,class:`vue-data-ui-watermark`},Zt={key:5,ref:`source`,dir:`auto`},Qt={class:`vue-ui-data-table`},$t={key:0},en=[`data-cell`],tn={style:{display:`flex`,"align-items":`center`,gap:`5px`,"justify-content":`flex-end`,width:`100%`,"padding-right":`3px`}},nn={key:0},rn={key:1},an=[`data-cell`],on={style:{display:`flex`,"align-items":`center`,gap:`5px`,"justify-content":`flex-end`,width:`100%`,"padding-right":`3px`}},sn={key:0},cn={key:1},ln=[`data-cell`],un={style:{display:`flex`,"align-items":`center`,gap:`5px`,"justify-content":`flex-end`,width:`100%`,"padding-right":`3px`}},dn={key:0},fn={key:1},pn=[`data-cell`],mn={style:{display:`flex`,"align-items":`center`,gap:`5px`,"justify-content":`flex-end`,width:`100%`,"padding-right":`3px`}},hn={key:0},gn={key:1},_n=[`data-cell`],vn={style:{display:`flex`,"align-items":`center`,gap:`5px`,"justify-content":`flex-end`,width:`100%`,"padding-right":`3px`}},yn={key:0},bn={key:1},xn=[`data-cell`],Sn={style:{display:`flex`,"align-items":`center`,gap:`5px`,"justify-content":`flex-end`,width:`100%`,"padding-right":`3px`}},Cn={key:0},wn={key:1},Tn=[`data-cell`],En={style:{display:`flex`,"align-items":`center`,gap:`5px`,"justify-content":`flex-end`,width:`100%`,"padding-right":`3px`}},Dn={key:0},On={key:1},kn=[`data-cell`],An={style:{display:`flex`,"align-items":`center`,gap:`5px`,"justify-content":`flex-end`,width:`100%`,"padding-right":`3px`}},jn=[`data-cell`],Mn={style:{display:`flex`,"align-items":`center`,gap:`5px`,"justify-content":`flex-end`,width:`100%`,"padding-right":`3px`}},Nn=[`data-cell`],Pn={style:{display:`flex`,"align-items":`center`,gap:`5px`,"justify-content":`flex-end`,width:`100%`,"padding-right":`3px`}},Fn=[`data-cell`],In={style:{display:`flex`,"align-items":`center`,gap:`5px`,"justify-content":`flex-end`,width:`100%`,"padding-right":`3px`}},Ln=[`data-cell`],Rn={style:{display:`flex`,"align-items":`center`,gap:`5px`,"justify-content":`flex-end`,width:`100%`,"padding-right":`3px`}},zn=/*#__PURE__*/ _e({__name:`vue-ui-chestnut`,props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:[`selectRoot`,`selectBranch`,`selectNut`,`copyAlt`],setup(e,{expose:_e,emit:qe}){Ue(e=>({b4b59ab0:e.tdo}));let zn=Fe(()=>import(`./BaseIcon-fYK0iID8.js`).then(e=>e.n)),Bn=Fe(()=>import(`./vue-ui-accordion-D4FHxzsL.js`).then(e=>e.n)),Vn=Fe(()=>import(`./PenAndPaper-r50tK3S4.js`).then(e=>e.t)),Hn=Fe(()=>import(`./UserOptions-Em_JgDXM.js`).then(e=>e.n)),Un=Fe(()=>import(`./PackageVersion-DWlHsdPa.js`).then(e=>e.t)),Wn=Fe(()=>import(`./BaseDraggableDialog-9d30Yx8c.js`).then(e=>e.n)),{vue_ui_chestnut:Gn}=t(),w=e,Kn=u(()=>!!w.dataset&&w.dataset.length),T=y(te()),qn=y(null),Jn=y(0),Yn=y(null),Xn=y(null),Zn=y(!1),E=y(!1),D=y(``),O=y({level:`root`,rootIndex:0,branchIndex:0,nutIndex:0,locked:!1}),k=y(ar()),A=u(()=>k.value.style.chart.layout.roots),j=u(()=>k.value.style.chart.layout.branches),M=u(()=>k.value.style.chart.layout.nuts),N=u(()=>k.value.style.chart.layout),P=u(()=>k.value.style.chart);he({config:()=>k.value,dataset:()=>w.dataset,component:`VueUiChestnut`,rules:[ge.emptyArray,{test:e=>e.some(e=>e?.branches&&e.branches.length>10),message:[`👀 Some root has > 10 branches, which can make the chart heavy. Consider:`,``,`▶️ Grouping some branches in broader categories.`]},{test:e=>e.some(e=>e?.branches&&e.branches.some(e=>e?.breakdown&&e?.breakdown.length>6)),message:[`👀 Some donuts have > 6 series. Consider:`,``,`▶️ Grouping small values into an "Other" category.`]}]});let F=u(()=>k.value.userOptions.useCursorPointer),Qn=u(()=>ae({defaultConfig:{userOptions:{show:!1},table:{show:!1},style:{chart:{backgroundColor:`#99999930`,layout:{grandTotal:{show:!1},roots:{stroke:`#6A6A6A`,labels:{show:!1}},verticalSeparator:{stroke:`transparent`},branches:{stroke:`#6A6A6A`,underlayerColor:`#6A6A6A90`,labels:{show:!1,dataLabels:{show:!1}}}}}}},userConfig:k.value.skeletonConfig??{}})),{loading:$n,FINAL_DATASET:er}=pe({...He(w),FINAL_CONFIG:k,prepareConfig:ar,skeletonDataset:w.config?.skeletonDataset??[{name:`_`,color:`#969696`,branches:[{name:`_`,value:32,breakdown:[{name:`_`,value:16,color:`#CACACA`},{name:`_`,value:16,color:`#6A6A6A`}]},{name:`_`,value:16,breakdown:[{name:`_`,value:8,color:`#CACACA`},{name:`_`,value:8,color:`#6A6A6A`}]},{name:`_`,value:8,breakdown:[{name:`_`,value:4,color:`#CACACA`},{name:`_`,value:4,color:`#6A6A6A`}]},{name:`_`,value:4,breakdown:[{name:`_`,value:2,color:`#CACACA`},{name:`_`,value:2,color:`#6A6A6A`}]}]},{name:`_`,color:`#C4C4C4`,branches:[{name:`_`,value:24,breakdown:[{name:`_`,value:12,color:`#CACACA`},{name:`_`,value:12,color:`#6A6A6A`}]},{name:`_`,value:12,breakdown:[{name:`_`,value:6,color:`#CACACA`},{name:`_`,value:6,color:`#6A6A6A`}]},{name:`_`,value:6,breakdown:[{name:`_`,value:3,color:`#CACACA`},{name:`_`,value:3,color:`#6A6A6A`}]},{name:`_`,value:2,breakdown:[{name:`_`,value:1,color:`#CACACA`},{name:`_`,value:1,color:`#6A6A6A`}]}]}],skeletonConfig:ae({defaultConfig:k.value,userConfig:Qn.value})}),{userOptionsVisible:tr,setUserOptionsVisibility:nr,keepUserOptionState:rr}=ke({config:k.value}),{svgRef:ir}=Ae({config:N.value.title});function ar(){return ve(w.config,Gn,Me)}We(()=>w.config,e=>{k.value=ar(),tr.value=!k.value.userOptions.showOnChartHover,fr.value.showTable=k.value.table.show,Nr()},{deep:!0});let{isPrinting:or,isImaging:sr,generatePdf:cr,generateImage:lr}=Ee({elementId:`vue-ui-chestnut_${T.value}`,fileName:N.value.title.text||`vue-ui-chestnut`,options:k.value.userOptions.print}),ur=u(()=>k.value.userOptions.show),dr=u(()=>ue(k.value.customPalette)),fr=y({showTable:k.value.table.show});We(k,()=>{fr.value={showTable:k.value.table.show}},{immediate:!0});let pr=y(null),mr=u(()=>k.value.table.responsiveBreakpoint),I=y({gap:6,padding:{top:102,left:12,right:12,bottom:96},width:1024,height:0,branchSize:32,branchStart:128}),L=u(()=>({left:I.value.padding.left,top:I.value.padding.top,right:I.value.width-I.value.padding.right,bottom:I.value.height-I.value.padding.bottom,width:I.value.width-(I.value.padding.left+I.value.padding.right),height:I.value.height-(I.value.padding.top+I.value.padding.bottom),seedX:I.value.padding.left+64})),R=u(()=>er.value.flatMap(e=>(e.branches||[]).map(e=>e.value||0)).reduce((e,t)=>e+t,0)),hr=u(()=>k.value.debug),z=u(()=>(hr.value&&er.value.forEach((e,t)=>{de({datasetObject:e,requiredAttributes:[`name`,`branches`]}).forEach(e=>{re({componentName:`VueUiChestnut`,type:`datasetSerieAttribute`,property:e,index:t})}),e.branches&&e.branches.forEach((e,n)=>{de({datasetObject:e,requiredAttributes:[`name`,`value`]}).forEach(e=>{re({componentName:`VueUiChestnut`,type:`datasetSerieAttribute`,property:e,index:`${t} - ${n}`})}),e.breakdown&&e.breakdown.forEach((e,r)=>{de({datasetObject:e,requiredAttributes:[`name`,`value`]}).forEach(e=>{re({componentName:`VueUiChestnut`,type:`datasetSerieAttribute`,property:e,index:`${t} - ${n} - ${r}`})})})})}),er.value.map((e,t)=>{let n=(e.branches||[]).map(e=>e.value||0).reduce((e,t)=>e+t,0);return{...e,color:ee(e.color)||dr.value[t]||i[t]||i[t%i.length],id:e.id||`root_${t}_${T.value}`,type:`root`,total:n,rootIndex:t,branches:(e.branches||[]).map((r,a)=>({...r,rootName:e.name,rootIndex:t,color:ee(e.color)||dr.value[t]||i[t]||i[t%i.length],value:r.value>=0?r.value:0,id:r.id||`branch_${t}_${a}_${T.value}`,proportionToRoot:r.value/n,type:`branch`,breakdown:(r.breakdown||[]).map((o,te)=>({table:{rootName:e.name,rootValue:n,rootToTotal:n/R.value,branchName:r.name,branchValue:r.value,branchToTotal:r.value/R.value,branchToRoot:r.value/n,nutName:o.name,nutValue:o.value,nutToTotal:o.value/R.value,nutToRoot:o.value/n,nutToBranch:o.value/r.value},...o,type:`nut`,branchName:r.name,rootName:e.name,branchTotal:r.value>=0?r.value:0,proportionToBranch:o.value/r.value,proportionToRoot:o.value/n,proportionToTree:o.value/R.value,rootIndex:t,id:o.id||`nut_${t}_${a}_${te}_${T.value}`,color:ee(o.color)||dr.value[te]||i[te]||i[te%i.length],value:o.value>=0?o.value:0}))}))}})));function gr(){return z.value}let _r=qe,vr=u(()=>z.value.flatMap(e=>e.branches).length),yr=u(()=>Math.max(...z.value.map(e=>e.branches.map(e=>e.value).reduce((e,t)=>e+t,0)))),br=u(()=>Math.max(...z.value.flatMap(e=>e.branches.map(e=>e.value)))),xr=u(()=>256+I.value.padding.left),B=u(()=>z.value.sort((e,t)=>t.total-e.total).map((e,t)=>{let n=L.value.height/z.value.length/2,r=e.total/yr.value*(n>64?64:n);return{...e,x:L.value.seedX,y:L.value.top+L.value.height/z.value.length*(t+1)-(L.value.height/z.value.length/2+I.value.gap/2),r:r<I.value.branchSize/2?I.value.branchSize/2:r}})),Sr=u(()=>j.value.widthRatio<=0?.1:j.value.widthRatio>1.8?1.8:j.value.widthRatio),Cr=u(()=>B.value.flatMap(e=>e.branches)),V=u(()=>Cr.value.sort((e,t)=>t.value-e.value).map((e,t)=>({...e,y1:t*I.value.branchSize+L.value.top+t*I.value.gap,y2:t*I.value.branchSize+I.value.branchSize,x1:xr.value,x2:384*e.value/br.value*Sr.value+xr.value}))),wr=u(()=>B.value),Tr=u(()=>wr.value.map(e=>V.value.filter(t=>t.rootIndex===e.rootIndex).sort((e,t)=>e.y1-t.y1))),Er=u(()=>wr.value.map((e,t)=>Tr.value[t].map(e=>(e.breakdown||[]).map((t,n)=>({...t,nutIndex:n,rootIndex:e.rootIndex,branchId:e.id,branchName:e.name,branchValue:e.value,rootName:e.rootName})))));function Dr(e){let t=B.value.find(t=>t.rootIndex===e.rootIndex);return{x:t.x,y:t.y,r:t.r}}let H=y(null),U=y(null),W=y(null),G=y(null);function K(){H.value=null,W.value=null,G.value=null}function q(e){if(H.value)return e.type===`root`?e.rootIndex===H.value.rootIndex:e.type===`branch`?e.id===H.value.id:e.type===`nut`&&e.branchName===H.value.name&&e.rootIndex===H.value.rootIndex;if(W.value)return e.type===`root`?e.rootIndex===W.value.rootIndex:e.type===`branch`?e.id===W.value.id:e.type===`nut`&&e.branchName===W.value.name&&e.rootIndex===W.value.rootIndex;if(G.value)return e.type===`root`?e.id===G.value.id:e.type===`branch`||e.type===`nut`?e.rootIndex===G.value.rootIndex:!1;if(ci.value&&E.value){if(O.value.level===`root`)return e.type===`root`?Z.value&&e.id===Z.value.id:e.type===`branch`||e.type===`nut`?Z.value&&e.rootIndex===Z.value.rootIndex:!1;if(O.value.level===`branch`)return e.type===`root`?Z.value&&e.rootIndex===Z.value.rootIndex:e.type===`branch`?oi.value&&e.id===oi.value.id:(e.type,!1);if(O.value.level===`nut`)return e.type===`root`?Z.value&&e.rootIndex===Z.value.rootIndex:e.type===`branch`?si.value&&e.id===si.value.id:e.type===`nut`&&si.value&&e.branchName===si.value.name&&e.rootIndex===si.value.rootIndex}return!0}function Or(e){K();let t=wr.value.findIndex(t=>t.rootIndex===e.rootIndex),n=(Tr.value[t]||[]).findIndex(t=>t.id===e.id);t!==-1&&(O.value.rootIndex=t),n!==-1&&(O.value.branchIndex=n),O.value.level=`nut`,O.value.nutIndex=0,Re(()=>{H.value=e,W.value=e,U.value=a({series:e.breakdown,base:1},e.x2+24+M.value.offsetX,e.y1+I.value.branchSize/2,80,80),_r(`selectNut`,e.breakdown),Q()})}function J(){H.value=null,U.value=null,_r(`selectNut`,null)}function kr(e){let t=wr.value.findIndex(t=>t.rootIndex===e.rootIndex),n=(Tr.value[t]||[]).findIndex(t=>t.id===e.id);t!==-1&&(O.value.rootIndex=t),n!==-1&&(O.value.branchIndex=n),O.value.level=`branch`,O.value.nutIndex=0,W.value&&W.value.id===e.id?(W.value=null,K(),_r(`selectBranch`,null),Q()):(K(),W.value=e,_r(`selectBranch`,e),Q())}function Ar(e){let t=wr.value.findIndex(t=>t.id===e.id);t!==-1&&(O.value.rootIndex=t),O.value.level=`root`,O.value.branchIndex=0,O.value.nutIndex=0,G.value&&G.value.id===e.id?(K(),_r(`selectRoot`,null),Q()):(K(),G.value=e,_r(`selectRoot`,e),Q())}function jr(){return L.value.bottom-(H.value.y1+180)<0?0:L.value.bottom}function Mr(e){return e.proportion*100>M.value.selected.labels.dataLabels.hideUnderValue}Be(()=>{Nr()});function Nr(){fe(w.dataset)&&re({componentName:`VueUiChestnut`,type:`dataset`,debug:hr.value});let e=vr.value*(I.value.branchSize+I.value.gap)+I.value.padding.top+I.value.padding.bottom;I.value.height=e}let Y=u(()=>({head:[k.value.table.th.translations.rootName,k.value.table.th.translations.rootValue,k.value.table.th.translations.rootToTotal,k.value.table.th.translations.branchName,k.value.table.th.translations.branchValue,k.value.table.th.translations.branchToRoot,k.value.table.th.translations.branchToTotal,k.value.table.th.translations.nutName,k.value.table.th.translations.nutValue,k.value.table.th.translations.nutToBranch,k.value.table.th.translations.nutToRoot,k.value.table.th.translations.nutToTotal],body:z.value.flatMap((e,t)=>e.branches.flatMap((e,t)=>e.breakdown.flatMap((e,t)=>e.table)))}));function Pr(e=null){Re(()=>{let t=[[N.value.title.text],[N.value.title.subtitle.text],[``],[`Grand total`,R.value],[``]],n=Y.value.head,i=Y.value.body.map((e,t)=>[Y.value.body[t-1]&&Y.value.body[t-1].rootName===e.rootName?``:e.rootName,Y.value.body[t-1]&&Y.value.body[t-1].rootName===e.rootName?``:e.rootValue,Y.value.body[t-1]&&Y.value.body[t-1].rootName===e.rootName?``:e.rootToTotal,Y.value.body[t-1]&&Y.value.body[t-1].branchName===e.branchName?``:e.branchName,Y.value.body[t-1]&&Y.value.body[t-1].branchName===e.branchName?``:e.branchValue,Y.value.body[t-1]&&Y.value.body[t-1].branchName===e.branchName?``:e.branchToRoot,Y.value.body[t-1]&&Y.value.body[t-1].branchName===e.branchName?``:e.branchToTotal,e.nutName,e.nutValue,e.nutToBranch,e.nutToRoot,e.nutToTotal]),a=t.concat([n]).concat(i),o=r(a);e?e(o):oe({csvContent:o,title:N.value.title.text||`vue-ui-chestnut`})})}let Fr=y(!1);function Ir(e){Fr.value=e,Jn.value+=1}function Lr(){fr.value.showTable=!fr.value.showTable}let Rr=y(!1);function zr(){Rr.value=!Rr.value}async function Br({scale:e=2}={}){if(!qn.value)return;let{width:t,height:n}=qn.value.getBoundingClientRect(),r=t/n,{imageUri:i,base64:a}=await ye({domElement:qn.value,base64:!0,img:!0,scale:e});return{imageUri:i,base64:a,title:N.value.title.text,width:t,height:n,aspectRatio:r}}function Vr(e){let t=Dr(e),n=e.x1,r=e.y1,i=I.value.branchSize,a=t.x+t.r/2,o=t.y;return[`M ${n},${r}`,`C ${n-20},${r} ${n-20},${r} ${a},${o}`,`C ${a},${o} ${n-20},${r+i} ${n},${r+i}`,`Z`].join(` `)}let Hr=u(()=>xe({config:k,style:P,mutableConfig:fr,dialog:Wn,accordion:Bn,isFullscreen:Fr,parent:qn,maxWidth:800,titleStyle:N,isCursorPointer:F}));We(()=>fr.value.showTable,async e=>{k.value.table.show||(e&&k.value.table.useDialog&&Yn.value?(await Re(),Yn.value.open()):`close`in Yn.value&&Yn.value.close())});let{isResponsive:Ur}=je(pr,mr);function Wr(){fr.value.showTable=!1,Xn.value&&Xn.value.setTableIconState(!1)}let Gr=u(()=>z.value.map((e,t)=>({...e,display:`${e.name}: ${c(A.value.labels.formatter,e.total,n({p:N.value.legend.prefix,v:e.total,s:N.value.legend.suffix,r:N.value.legend.roundingValue}),{datapoint:e})} (${n({v:e.total/R.value*100,s:`%`,r:N.value.legend.roundingPercentage})})`}))),Kr=u(()=>Gr.value.map(e=>({color:e.color,name:e.display,shape:`circle`}))),qr=u(()=>P.value.backgroundColor),Jr=u(()=>({...N.value.legend,textAlign:`center`,show:!0,position:`bottom`})),Yr=u(()=>N.value.title),{isCallbackImaging:Xr,isCallbackSvg:Zr,generateSvg:Qr,onGenerateImage:$r}=be({svg:ir,title:Yr,legend:Jr,legendItems:Kr,backgroundColor:qr,titleEmbedded:!0,getSvgCallback:()=>k.value.userOptions.callbacks.svg,generateImage:lr});async function ei(){_r(`copyAlt`,{config:k.value,dataset:z.value}),k.value.userOptions.callbacks.altCopy?await Promise.resolve(k.value.userOptions.callbacks.altCopy({config:k.value,dataset:z.value})):console.warn("Vue Data UI - A callback must be set for `altCopy` in userOptions.")}function ti(e){if(!e)return``;let t=n({p:N.value.legend.prefix,v:e.total,s:N.value.legend.suffix,r:N.value.legend.roundingValue}),r=n({v:e.total/R.value*100,s:`%`,r:N.value.legend.roundingPercentage});return`Root ${e.name}. Value ${t}. ${r} of total.`}function ni(e){if(!e)return``;let t=n({p:j.value.labels.dataLabels.prefix,v:e.value,s:j.value.labels.dataLabels.suffix,r:j.value.labels.dataLabels.roundingValue}),r=n({v:e.proportionToRoot*100,s:`%`,r:N.value.legend.roundingPercentage});return`Branch ${e.name}. Root ${e.rootName}. Value ${t}. ${r} of root ${e.rootName}.`}function ri(e){if(!e)return``;let t=n({p:N.value.legend.prefix,v:e.value,s:N.value.legend.suffix,r:M.value.selected.labels.roundingValue}),r=n({v:e.proportionToBranch*100,s:`%`,r:M.value.selected.labels.roundingPercentage});return`Nut ${e.name}. Branch ${e.branchName}. Root ${e.rootName}. Value ${t}. ${r} of branch ${e.branchName}.`}let ii=u(()=>wr.value[O.value.rootIndex]||null),X=u(()=>(Tr.value[O.value.rootIndex]||[])[O.value.branchIndex]||null),ai=u(()=>((Er.value[O.value.rootIndex]||[])[O.value.branchIndex]||[])[O.value.nutIndex]||null),Z=u(()=>ii.value),oi=u(()=>X.value),si=u(()=>O.value.level===`nut`?X.value:null),ci=u(()=>Zn.value);function Q(){O.value.level===`root`?D.value=ti(ii.value):O.value.level===`branch`?D.value=ni(X.value):O.value.level===`nut`&&(D.value=ri(ai.value))}function $(){O.value={level:`root`,rootIndex:0,branchIndex:0,nutIndex:0,locked:!1},D.value=``}function li(){let e=Tr.value[O.value.rootIndex]||[];e.length?(O.value.branchIndex>=e.length&&(O.value.branchIndex=0),O.value.branchIndex<0&&(O.value.branchIndex=e.length-1)):O.value.branchIndex=0}function ui(){let e=(Er.value[O.value.rootIndex]||[])[O.value.branchIndex]||[];e.length?(O.value.nutIndex>=e.length&&(O.value.nutIndex=0),O.value.nutIndex<0&&(O.value.nutIndex=e.length-1)):O.value.nutIndex=0}function di(e){if(O.value.level===`root`){let t=wr.value.length;if(!t)return;O.value.rootIndex+=e,O.value.rootIndex>=t&&(O.value.rootIndex=0),O.value.rootIndex<0&&(O.value.rootIndex=t-1),O.value.branchIndex=0,O.value.nutIndex=0,Q()}else O.value.level===`branch`?(O.value.branchIndex+=e,li(),O.value.nutIndex=0,Q()):O.value.level===`nut`&&(O.value.nutIndex+=e,ui(),Q())}function fi(e){if(e>0){if(O.value.level===`root`){if(!(Tr.value[O.value.rootIndex]||[]).length)return;O.value.level=`branch`,O.value.branchIndex=0,O.value.nutIndex=0,Q();return}if(O.value.level===`branch`){if(!((Er.value[O.value.rootIndex]||[])[O.value.branchIndex]||[]).length)return;O.value.level=`nut`,O.value.nutIndex=0,X.value?Or(X.value):Q();return}}else O.value.level===`nut`?(J(),W.value=null,O.value.level=`branch`,O.value.nutIndex=0,Q()):O.value.level===`branch`&&(W.value=null,G.value=null,O.value.level=`root`,O.value.nutIndex=0,Q())}function pi(){O.value.level===`root`&&ii.value?(Ar(ii.value),D.value=`${ti(ii.value)} selected.`):O.value.level===`branch`&&X.value?(kr(X.value),D.value=`${ni(X.value)} selected.`):O.value.level===`nut`&&X.value&&ai.value&&(Or(X.value),D.value=`${ri(ai.value)} details opened.`)}function mi(){Zn.value=!0,E.value=!1}function hi(){Zn.value=!1,E.value=!1,D.value=``,G.value||W.value||H.value||$()}function gi(e){let t=e.key===`ArrowUp`,n=e.key===`ArrowDown`,r=e.key===`ArrowLeft`,i=e.key===`ArrowRight`,a=e.key===`Enter`||e.key===` `,o=e.key===`Escape`;(t||n||r||i||a||o)&&(e.preventDefault(),e.stopPropagation(),Zn.value||=!0,o?(K(),$(),E.value=!1):((t||n||r||i)&&(E.value=!0),t?di(-1):n?di(1):r?fi(-1):i?fi(1):a&&pi()))}let _i=u(()=>({headers:Y.value.head,rows:Y.value.body.map(e=>[e.rootName,e.rootValue,n({v:e.rootToTotal*100,s:`%`,r:k.value.table.td.roundingPercentage}),e.branchName,e.branchValue,n({v:e.branchToRoot*100,s:`%`,r:k.value.table.td.roundingPercentage}),n({v:e.branchToTotal*100,s:`%`,r:k.value.table.td.roundingPercentage}),e.nutName,e.nutValue,n({v:e.nutToBranch*100,s:`%`,r:k.value.table.td.roundingPercentage}),n({v:e.nutToRoot*100,s:`%`,r:k.value.table.td.roundingPercentage}),n({v:e.nutToTotal*100,s:`%`,r:k.value.table.td.roundingPercentage})])}));return _e({getData:gr,getImage:Br,generatePdf:cr,generateCsv:Pr,generateImage:lr,generateSvg:Qr,toggleTable:Lr,toggleAnnotator:zr,toggleFullscreen:Ir,copyAlt:ei}),(e,t)=>(v(),p(`div`,{class:g(`vue-data-ui-component vue-ui-chestnut ${Fr.value?`vue-data-ui-wrapper-fullscreen`:``}`),ref_key:`chestnutChart`,ref:qn,id:`vue-ui-chestnut_${T.value}`,style:_(`font-family:${k.value.style.fontFamily};width:100%; text-align:center;background:${P.value.backgroundColor}`),onMouseenter:t[12]||=()=>C(nr)(!0),onMouseleave:t[13]||=()=>C(nr)(!1)},[m(`div`,{id:`chart-instructions-${T.value}`,class:`sr-only`},[m(`p`,null,S(k.value.a11y.translations.keyboardNavigation),1)],8,Ye),m(`div`,Xe,S(D.value),1),_i.value?.rows?.length?(v(),d(Oe,{key:0,uid:T.value,head:_i.value.headers,body:_i.value.rows,notice:k.value.a11y.translations.tableAvailable,caption:k.value.a11y.translations.tableCaption},null,8,[`uid`,`head`,`body`,`notice`,`caption`])):f(``,!0),k.value.userOptions.buttons.annotator?(v(),d(C(Vn),{key:1,showGroupActions:k.value.userOptions.annotator?.showGroupActions??!0,svgRef:C(ir),backgroundColor:P.value.backgroundColor,color:P.value.color,active:Rr.value,isCursorPointer:F.value,palette:k.value.userOptions.annotatorPalette,onClose:zr},Ne({_:2},[b(C(Ce),t=>({name:t,fn:Ge(n=>[x(e.$slots,t,ze(Ie(C(Se)(t,n))),void 0,!0)])}))]),1032,[`showGroupActions`,`svgRef`,`backgroundColor`,`color`,`active`,`isCursorPointer`,`palette`])):f(``,!0),ur.value?(v(),p(`div`,Ze,null,512)):f(``,!0),k.value.userOptions.show&&Kn.value&&(C(rr)||C(tr))?(v(),d(C(Hn),{ref_key:`userOptionsRef`,ref:Xn,key:`user_options_${Jn.value}`,backgroundColor:P.value.backgroundColor,color:P.value.color,isImaging:C(sr),isPrinting:C(or),uid:T.value,hasPdf:k.value.userOptions.buttons.pdf,hasImg:k.value.userOptions.buttons.img,hasSvg:k.value.userOptions.buttons.svg,hasXls:k.value.userOptions.buttons.csv,hasTable:k.value.userOptions.buttons.table,hasFullscreen:k.value.userOptions.buttons.fullscreen,hasAltCopy:k.value.userOptions.buttons.altCopy,isFullscreen:Fr.value,titles:{...k.value.userOptions.buttonTitles},chartElement:qn.value,position:k.value.userOptions.position,hasAnnotator:k.value.userOptions.buttons.annotator,isAnnotation:Rr.value,callbacks:k.value.userOptions.callbacks,printScale:k.value.userOptions.print.scale,tableDialog:k.value.table.useDialog,isCursorPointer:F.value,onToggleFullscreen:Ir,onGeneratePdf:C(cr),onGenerateCsv:Pr,onGenerateImage:C($r),onGenerateSvg:C(Qr),onToggleTable:Lr,onToggleAnnotator:zr,onCopyAlt:ei,style:_({visibility:C(rr)?C(tr)?`visible`:`hidden`:`visible`})},Ne({_:2},[b(C(we)(e.$slots,`menuIcon optionPdf optionCsv optionImg optionSvg optionTable optionFullscreen optionAnnotator optionAltCopy custom-menu-before custom-menu-after`),t=>({name:t,fn:Ge(n=>[x(e.$slots,t,ze(Ie(C(Te)(t,n))),void 0,!0)])}))]),1032,/* @__PURE__ */ `backgroundColor.color.isImaging.isPrinting.uid.hasPdf.hasImg.hasSvg.hasXls.hasTable.hasFullscreen.hasAltCopy.isFullscreen.titles.chartElement.position.hasAnnotator.isAnnotation.callbacks.printScale.tableDialog.isCursorPointer.onGeneratePdf.onGenerateImage.onGenerateSvg.style`.split(`.`))):f(``,!0),m(`div`,Qe,[I.value.height>0?(v(),p(`svg`,{key:0,ref_key:`svgRef`,ref:ir,xmlns:C(le),"aria-describedby":`chart-instructions-${T.value}`,class:g({"vue-data-ui-fullscreen--on":Fr.value,"vue-data-ui-fulscreen--off":!Fr.value}),viewBox:`0 0 ${I.value.width<=0?10:I.value.width} ${I.value.height<=0?10:I.value.height}`,style:_(`overflow:visible;background:transparent;color:${P.value.color}`),tabindex:`0`,onFocus:mi,onBlur:hi,onKeydown:gi},[h(C(Un)),x(e.$slots,`svg-underlayer`,{svg:{...I.value,isPrintingImg:C(or)||C(sr)||C(Xr),isPrintingSvg:C(Zr)}},void 0,!0),e.$slots[`chart-background`]?(v(),p(`foreignObject`,{key:0,x:0,y:0,width:I.value.width<=0?10:I.value.width,height:I.value.height<=0?10:I.value.height,style:{pointerEvents:`none`}},[x(e.$slots,`chart-background`,{},void 0,!0)],8,et)):f(``,!0),H.value?f(``,!0):(v(),p(`g`,tt,[N.value.title.text?(v(),p(`text`,{key:0,"text-anchor":`middle`,fill:N.value.title.color,"font-weight":N.value.title.bold?`bold`:`normal`,"font-size":N.value.title.fontSize,x:I.value.width/2,y:12+N.value.title.fontSize+N.value.title.offsetY,onClick:t[0]||=()=>{K(),$(),E.value=!1}},S(N.value.title.text),9,nt)):f(``,!0),N.value.title.subtitle.text?(v(),p(`text`,{key:1,"text-anchor":`middle`,fill:N.value.title.subtitle.color,"font-weight":N.value.title.subtitle.bold?`bold`:`normal`,"font-size":N.value.title.subtitle.fontSize,x:I.value.width/2,y:48+N.value.title.subtitle.fontSize+N.value.title.subtitle.offsetY,onClick:t[1]||=()=>{K(),$(),E.value=!1}},S(N.value.title.subtitle.text),9,rt)):f(``,!0)])),m(`defs`,null,[(v(!0),p(l,null,b(z.value,(e,t)=>(v(),d(De,{t:`radial`,cx:`50%`,cy:`50%`,r:`50%`,fx:`50%`,fy:`50%`,id:`root_gradient_${T.value}_${e.rootIndex}`,key:`root_gradient_${T.value}_${e.rootIndex}`,stops:[[`0%`,C(o)(C(ne)(e.color,.05),100-A.value.gradientIntensity),1],[`100%`,e.color,1]]},null,8,[`id`,`stops`]))),128)),(v(!0),p(l,null,b(z.value,e=>(v(),d(De,{t:`linear`,x1:`0%`,y1:`0%`,x2:`100%`,y2:`0%`,id:`branch_gradient_${T.value}_${e.rootIndex}`,key:`branch_gradient_${T.value}_${e.rootIndex}`,stops:[[`0%`,e.color,1],[`100%`,C(o)(C(ne)(e.color,.02),100-j.value.gradientIntensity),1]]},null,8,[`id`,`stops`]))),128)),h(De,{t:`radial`,cx:`50%`,cy:`50%`,r:`50%`,fx:`50%`,fy:`50%`,id:`nutpick_${T.value}`,stops:[[`0%`,C(o)(`#FFFFFF`,0),0],[`80%`,C(o)(`#FFFFFF`,M.value.selected.gradientIntensity),1],[`100%`,C(o)(`#FFFFFF`,0),0]]},null,8,[`id`,`stops`]),h(De,{t:`radial`,cx:`50%`,cy:`50%`,r:`50%`,fx:`50%`,fy:`50%`,id:`nut_${T.value}`,stops:[[`0%`,C(o)(`#FFFFFF`,0),0],[`80%`,C(o)(`#FFFFFF`,M.value.gradientIntensity),1],[`100%`,C(o)(`#FFFFFF`,0),0]]},null,8,[`id`,`stops`]),h(De,{t:`radial`,cx:`50%`,cy:`50%`,r:`50%`,fx:`50%`,fy:`50%`,id:`nut_underlayer_${T.value}`,stops:[[`0%`,C(o)(P.value.backgroundColor,100),1],[`80%`,C(o)(P.value.backgroundColor,60),1],[`100%`,C(o)(P.value.backgroundColor,0),1]]},null,8,[`id`,`stops`])]),N.value.grandTotal.show?(v(),p(`g`,it,[m(`text`,{x:L.value.seedX,y:32+N.value.grandTotal.offsetY,"font-size":N.value.grandTotal.fontSize,"font-weight":N.value.grandTotal.bold?`bold`:`normal`,fill:N.value.grandTotal.color,"text-anchor":`middle`,onClick:t[2]||=()=>{K(),$(),E.value=!1}},S(N.value.grandTotal.text),9,at),m(`text`,{x:L.value.seedX,y:38+N.value.grandTotal.fontSize+N.value.grandTotal.offsetY,"font-size":N.value.grandTotal.fontSize,"font-weight":N.value.grandTotal.bold?`bold`:`normal`,fill:N.value.grandTotal.color,"text-anchor":`middle`,onClick:t[3]||=()=>{K(),$(),E.value=!1}},S(C(c)(N.value.grandTotal.formatter,R.value,C(n)({p:N.value.grandTotal.prefix,v:R.value,s:N.value.grandTotal.suffix,r:N.value.grandTotal.roundingValue}))),9,ot)])):f(``,!0),(v(!0),p(l,null,b(V.value,e=>(v(),p(`g`,null,[m(`defs`,null,[h(De,{t:`linear`,id:`link_grad_${e.id}`,stops:[[`0%`,e.color,1],[`100%`,C(o)(e.color,N.value.links.opacity),1]]},null,8,[`id`,`stops`])]),m(`path`,{d:Vr(e),stroke:C(o)(e.color,N.value.links.opacity),fill:`url(#link_grad_${e.id})`,"stroke-linecap":`round`,"stroke-linejoin":`round`,style:_(`opacity:${+!!q(e)}`),onClick:t[4]||=()=>{K(),$(),E.value=!1}},null,12,st)]))),256)),(v(!0),p(l,null,b(B.value,e=>(v(),p(`circle`,{cx:e.x,cy:e.y,r:e.r,fill:A.value.underlayerColor,stroke:`none`,style:_(`cursor:${F.value?`pointer`:`default`}; opacity:${q(e)?1:.05}`)},null,12,ct))),256)),(v(!0),p(l,null,b(B.value,(e,t)=>(v(),p(`circle`,{"aria-label":ti(e),cx:e.x,cy:e.y,r:e.r,fill:A.value.useGradient?`url(#root_gradient_${T.value}_${e.rootIndex})`:e.color,stroke:A.value.stroke,"stroke-width":A.value.strokeWidth,style:_(`cursor:${F.value?`pointer`:`default`}; opacity:${q(e)?1:.05}`),onClick:t=>Ar(e)},null,12,lt))),256)),A.value.labels.show?(v(),p(`g`,ut,[(v(!0),p(l,null,b(B.value,(e,t)=>(v(),p(`text`,{x:e.x,y:e.y+A.value.labels.fontSize/2.6,"text-anchor":`middle`,"font-size":A.value.labels.fontSize,fill:A.value.labels.adaptColorToBackground?C(ce)(e.color):A.value.labels.color,"font-weight":`bold`,style:_(`cursor:${F.value?`pointer`:`default`}; opacity:${q(e)?1:.05}`),onClick:t=>Ar(e)},S(C(c)(A.value.labels.formatter,e.total,C(n)({p:A.value.labels.prefix,v:e.total,s:A.value.labels.suffix,r:A.value.labels.roundingValue}),{datapoint:e})),13,dt))),256)),(v(!0),p(l,null,b(B.value,e=>(v(),p(`g`,null,[H.value&&e.rootIndex===H.value.rootIndex||W.value&&e.rootIndex===W.value.rootIndex||G.value&&e.rootIndex===G.value.rootIndex?(v(),p(`g`,ft,[m(`text`,{x:e.x,y:e.y+e.r+24,"text-anchor":`middle`,fill:A.value.labels.name.color,"font-size":A.value.labels.name.fontSize,"font-weight":A.value.labels.name.bold?`bold`:`normal`,onClick:t[5]||=()=>{K(),$(),E.value=!1}},S(e.name),9,pt)])):f(``,!0)]))),256))])):f(``,!0),(v(!0),p(l,null,b(V.value,e=>(v(),p(`rect`,{x:e.x1,y:e.y1,height:I.value.branchSize,width:e.x2-e.x1,fill:j.value.underlayerColor,rx:j.value.borderRadius,stroke:`none`,style:_(`opacity:${q(e)?1:.05}`),onClick:t=>kr(e)},null,12,mt))),256)),(v(!0),p(l,null,b(V.value,(e,t)=>(v(),p(`rect`,{"aria-label":ni(e),x:e.x1,y:e.y1,height:I.value.branchSize,width:e.x2-e.x1,fill:j.value.useGradient?`url(#branch_gradient_${T.value}_${e.rootIndex})`:e.color,rx:j.value.borderRadius,stroke:j.value.stroke,"stroke-width":j.value.strokeWidth,style:_(`cursor:${F.value?`pointer`:`default`}; opacity:${q(e)?1:.05}`),onClick:t=>kr(e)},null,12,ht))),256)),j.value.labels.dataLabels.show?(v(),p(`g`,gt,[(v(!0),p(l,null,b(V.value,e=>(v(),p(`g`,null,[e.proportionToRoot*100>j.value.labels.dataLabels.hideUnderValue?(v(),p(`text`,{key:0,x:e.x1+6,y:e.y1+I.value.branchSize/1.5,"text-anchor":`start`,fill:C(ce)(e.color),"font-size":j.value.labels.dataLabels.fontSize,"font-weight":`bold`,style:_(`cursor:${F.value?`pointer`:`default`}; opacity:${q(e)?1:.05}`),onClick:t=>kr(e)},S(C(c)(j.value.labels.dataLabels.formatter,e.value,C(n)({p:N.value.branches.labels.dataLabels.prefix,v:e.value,s:N.value.branches.labels.dataLabels.suffix,r:N.value.branches.labels.dataLabels.roundingValue}),{datapoint:e})),13,_t)):f(``,!0)]))),256))])):f(``,!0),(v(!0),p(l,null,b(V.value,(e,t)=>(v(),p(`g`,null,[(v(!0),p(l,null,b(C(a)({series:e.breakdown,base:1},e.x2+24+M.value.offsetX,e.y1+I.value.branchSize/2,I.value.branchSize/3,I.value.branchSize/3),(t,n)=>(v(),p(`path`,{d:t.path,stroke:t.color,"stroke-width":10,fill:`none`,style:_(`opacity:${q(e)?1:.1}`)},null,12,vt))),256)),m(`circle`,{"aria-label":`Open details for branch ${e.name} in root ${e.rootName}`,fill:M.value.useGradient?`url(#nut_${T.value})`:`transparent`,cx:e.x2+24+M.value.offsetX,cy:e.y1+I.value.branchSize/2,r:I.value.branchSize/2+2,onClick:t=>Or(e),style:_(`cursor:${F.value?`pointer`:`default`};opacity:${q(e)?1:.1}`)},null,12,yt)]))),256)),j.value.labels.show&&!W.value?(v(),p(`g`,bt,[(v(!0),p(l,null,b(V.value,e=>(v(),p(`text`,{x:e.x2+I.value.branchSize+24+M.value.offsetX,y:e.y1+I.value.branchSize/2+5,"font-size":j.value.labels.fontSize,"font-weight":j.value.labels.bold?`bold`:`normal`,fill:j.value.labels.color,"text-anchor":`start`,style:_(`opacity:${q(e)?1:.1}`)},S(e.name),13,xt))),256))])):f(``,!0),m(`line`,{x1:256+I.value.padding.left,x2:256+I.value.padding.left,y1:L.value.top,y2:L.value.bottom,stroke:N.value.verticalSeparator.stroke,"stroke-width":N.value.verticalSeparator.strokeWidth},null,8,St),!H.value&&!W.value?(v(),p(`foreignObject`,{key:6,x:0,y:L.value.bottom,height:I.value.height-L.value.bottom,width:I.value.width,style:{overflow:`visible`},"data-no-svg-export":``,onClick:t[6]||=()=>{K(),$(),E.value=!1}},[m(`div`,wt,[m(`div`,Tt,[(v(!0),p(l,null,b(B.value,e=>(v(),p(`div`,{style:_(`display:flex;align-items:center;gap:3px;flex-direction:row;font-size:${N.value.legend.fontSize}px;`)},[(v(),p(`svg`,Et,[m(`circle`,{cx:`10`,cy:`10`,r:`10`,fill:e.color,stroke:`none`},null,8,Dt)])),C($n)?f(``,!0):(v(),p(l,{key:0},[m(`span`,null,S(e.name)+`:`,1),m(`b`,null,S(C(c)(N.value.roots.labels.formatter,e.total,C(n)({p:P.value.layout.legend.prefix,v:e.total,s:P.value.layout.legend.suffix,r:P.value.layout.legend.roundingValue}),{datapoint:e})),1),Pe(` (`+S(C(n)({v:e.total/R.value*100,s:`%`,r:N.value.legend.roundingPercentage}))+`) `,1)],64))],4))),256))])])],8,Ct)):f(``,!0),H.value&&U.value?(v(),p(`g`,Ot,[(v(),p(`foreignObject`,{x:0,y:jr(),height:I.value.height-L.value.bottom,width:I.value.width,style:{overflow:`visible`},onClick:t[7]||=()=>{K(),$(),E.value=!1}},[m(`div`,At,[m(`b`,null,S(H.value.name),1),m(`div`,jt,[(v(!0),p(l,null,b(H.value.breakdown,(e,t)=>(v(),p(`div`,{style:_(`display:flex;align-items:center;gap:6px;flex-direction:row;font-size:${N.value.legend.fontSize}px;`)},[(v(),p(`svg`,Mt,[m(`circle`,{cx:`10`,cy:`10`,r:`10`,fill:e.color,stroke:`none`},null,8,Nt)])),m(`span`,null,[Pe(S(e.name)+`: `,1),m(`b`,null,S(N.value.legend.prefix)+` `+S(e.value.toFixed(P.value.layout.nuts.selected.labels.roundingValue))+` `+S(N.value.legend.suffix),1),Pe(` (`+S((e.proportionToBranch*100).toFixed(N.value.nuts.selected.labels.roundingPercentage))+`%)`,1)])],4))),256))])])],8,kt)),m(`circle`,{cx:H.value.x2+24+M.value.offsetX,cy:H.value.y1+I.value.branchSize/2,r:256,fill:`url(#nut_underlayer_${T.value})`,onClick:J,class:g(M.value.selected.useMotion?`vue-ui-chestnut-animated`:``)},null,10,Pt),(v(!0),p(l,null,b(U.value,e=>(v(),p(`g`,null,[Mr(e)?(v(),p(`path`,{key:0,d:C(ie)(e,{x:H.value.x2+24+M.value.offsetX,y:H.value.y1+I.value.branchSize/2},16,16,!1,!1,64),stroke:e.color,"stroke-width":`1`,"stroke-linecap":`round`,"stroke-linejoin":`round`,fill:`none`,class:g(M.value.selected.useMotion?`vue-ui-chestnut-animated`:``)},null,10,Ft)):f(``,!0)]))),256)),m(`circle`,{cx:H.value.x2+24+M.value.offsetX,cy:H.value.y1+I.value.branchSize/2,r:118,fill:P.value.backgroundColor,onClick:J,class:g(M.value.selected.useMotion?`vue-ui-chestnut-animated`:``)},null,10,It),(v(!0),p(l,null,b(U.value,e=>(v(),p(`path`,{d:e.path,stroke:e.color,"stroke-width":64,fill:`none`,onClick:J,class:g(M.value.selected.useMotion?`vue-ui-chestnut-animated`:``)},null,10,Lt))),256)),m(`circle`,{cx:H.value.x2+24+M.value.offsetX,cy:H.value.y1+I.value.branchSize/2,r:110,fill:`url(#nutpick_${T.value})`,onClick:J,class:g(M.value.selected.useMotion?`vue-ui-chestnut-animated`:``)},null,10,Rt),m(`circle`,{cx:H.value.x2+24+M.value.offsetX,cy:H.value.y1+I.value.branchSize/2,r:64,fill:P.value.backgroundColor,onClick:J,class:g(M.value.selected.useMotion?`vue-ui-chestnut-animated`:``)},null,10,zt),m(`text`,{x:H.value.x2+24+M.value.offsetX,y:H.value.y1+8,fill:M.value.selected.labels.core.total.color,"font-size":M.value.selected.labels.core.total.fontSize,"font-weight":M.value.selected.labels.core.total.bold?`bold`:`normal`,"text-anchor":`middle`,onClick:J,class:g(M.value.selected.useMotion?`vue-ui-chestnut-animated`:``)},S(k.value.translations.total),11,Bt),m(`text`,{x:H.value.x2+24+M.value.offsetX,y:H.value.y1+36,fill:M.value.selected.labels.core.value.color,"font-size":M.value.selected.labels.core.value.fontSize,"font-weight":M.value.selected.labels.core.value.bold?`bold`:`normal`,"text-anchor":`middle`,onClick:J,class:g(M.value.selected.useMotion?`vue-ui-chestnut-animated`:``)},S(C(c)(M.value.selected.labels.dataLabels.formatter,H.value.value,C(n)({p:M.value.selected.labels.core.value.prefix,v:H.value.value,s:M.value.selected.labels.core.value.suffix,r:M.value.selected.roundingValue}),{datapoint:H.value})),11,Vt),(v(!0),p(l,null,b(U.value,(e,t)=>(v(),p(`g`,null,[Mr(e)?(v(),p(`text`,{key:0,x:C(s)(e).x,"text-anchor":C(s)(e).anchor,y:C(se)(e)-M.value.selected.labels.dataLabels.fontSize/6,fill:e.color,"font-size":M.value.selected.labels.dataLabels.fontSize/2,style:_(`font-weight:${M.value.selected.labels.dataLabels.bold?`bold`:``}`),class:g(M.value.selected.useMotion?`vue-ui-chestnut-animated`:``)},` ⬤ `,14,Ht)):f(``,!0),Mr(e)?(v(),p(`text`,{key:1,x:C(s)(e,!0).x,"text-anchor":C(s)(e,!0).anchor,y:C(se)(e),fill:M.value.selected.labels.dataLabels.color,"font-size":M.value.selected.labels.dataLabels.fontSize,style:_(`font-weight:${M.value.selected.labels.dataLabels.bold?`bold`:``}`),class:g(M.value.selected.useMotion?`vue-ui-chestnut-animated`:``)},S(H.value.breakdown[t].name),15,Ut)):f(``,!0)]))),256)),(v(!0),p(l,null,b(U.value,(e,t)=>(v(),p(`g`,null,[Mr(e)?(v(),p(`text`,{key:0,x:C(s)(e,!0).x,"text-anchor":C(s)(e).anchor,y:C(se)(e)+M.value.selected.labels.dataLabels.fontSize,fill:M.value.selected.labels.dataLabels.color,"font-size":M.value.selected.labels.dataLabels.fontSize,style:_(`font-weight:${M.value.selected.labels.dataLabels.bold?`bold`:``}`),class:g(M.value.selected.useMotion?`vue-ui-chestnut-animated`:``)},S(C(n)({v:H.value.breakdown[t].value/H.value.value*100,s:`%`,r:M.value.selected.labels.roundingPercentage}))+` `+S(k.value.translations.of)+` `+S(H.value.breakdown[t].branchName)+` `+S(C(c)(M.value.selected.labels.dataLabels.formatter,H.value.breakdown[t].value,C(n)({p:M.value.selected.labels.dataLabels.prefix,v:H.value.breakdown[t].value,s:M.value.selected.labels.dataLabels.suffix,r:M.value.selected.roundingValue}),{datapoint:U.value,seriesIndex:t})),15,Wt)):f(``,!0),Mr(e)?(v(),p(`text`,{key:1,x:C(s)(e,!0).x,"text-anchor":C(s)(e).anchor,y:C(se)(e)+M.value.selected.labels.dataLabels.fontSize*2,fill:M.value.selected.labels.dataLabels.color,"font-size":M.value.selected.labels.dataLabels.fontSize,style:_(`font-weight:${M.value.selected.labels.dataLabels.bold?`bold`:``}`),class:g(M.value.selected.useMotion?`vue-ui-chestnut-animated`:``)},S(C(n)({v:H.value.breakdown[t].proportionToRoot*100,s:`%`,r:M.value.selected.labels.roundingPercentage}))+` `+S(k.value.translations.of)+` `+S(H.value.breakdown[t].rootName),15,Gt)):f(``,!0),Mr(e)?(v(),p(`text`,{key:2,x:C(s)(e,!0).x,"text-anchor":C(s)(e).anchor,y:C(se)(e)+M.value.selected.labels.dataLabels.fontSize*3,fill:M.value.selected.labels.dataLabels.color,"font-size":M.value.selected.labels.dataLabels.fontSize,style:_(`font-weight:${M.value.selected.labels.dataLabels.bold?`bold`:``}`),class:g(M.value.selected.useMotion?`vue-ui-chestnut-animated`:``)},S(C(n)({v:H.value.breakdown[t].proportionToTree*100,s:`%`,r:M.value.selected.labels.roundingPercentage}))+` `+S(k.value.translations.proportionToTree),15,Kt)):f(``,!0)]))),256))])):f(``,!0),(v(!0),p(l,null,b(V.value,e=>(v(),p(`g`,null,[W.value&&W.value.id===e.id&&!H.value?(v(),p(`text`,{key:0,x:e.x1+6,y:e.y1+I.value.branchSize+24,"font-weight":`bold`,"text-anchor":`start`,"font-size":j.value.labels.dataLabels.fontSize,fill:j.value.labels.color,onClick:t[8]||=()=>{K(),$(),E.value=!1}},S(e.name)+`: `+S(C(c)(j.value.labels.dataLabels.formatter,e.value,C(n)({p:j.value.labels.dataLabels.prefix,v:e.value,s:j.value.labels.dataLabels.suffix,r:j.value.labels.dataLabels.roundingValue}),{datapoint:e})),9,qt)):f(``,!0),W.value&&W.value.id===e.id&&!H.value?(v(),p(`text`,{key:1,x:e.x1+6,y:e.y1+I.value.branchSize+48,"text-anchor":`start`,"font-size":j.value.labels.dataLabels.fontSize,fill:j.value.labels.color,onClick:t[9]||=()=>{K(),$(),E.value=!1}},S(C(n)({v:e.proportionToRoot*100,s:`%`,r:j.value.labels.dataLabels.roundingPercentage}))+` `+S(k.value.translations.of)+` `+S(e.rootName),9,Jt)):f(``,!0),W.value&&W.value.id===e.id&&!H.value?(v(),p(`text`,{key:2,x:e.x1+6,y:e.y1+I.value.branchSize+72,"text-anchor":`start`,"font-size":j.value.labels.dataLabels.fontSize,fill:j.value.labels.color,onClick:t[10]||=()=>{K(),$(),E.value=!1}},S(C(n)({v:e.value/R.value*100,s:`%`,r:j.value.labels.dataLabels.roundingPercentage}))+` `+S(k.value.translations.proportionToTree),9,Yt)):f(``,!0)]))),256)),x(e.$slots,`svg`,{svg:{...I.value,isPrintingImg:C(or)||C(sr)||C(Xr),isPrintingSvg:C(Zr)}},void 0,!0)],46,$e)):f(``,!0)]),e.$slots.watermark?(v(),p(`div`,Xt,[x(e.$slots,`watermark`,ze(Ie({isPrinting:C(or)||C(sr)||C(Xr)||C(Zr)})),void 0,!0)])):f(``,!0),x(e.$slots,`legend`,{legend:z.value},void 0,!0),e.$slots.source?(v(),p(`div`,Zt,[x(e.$slots,`source`,{},void 0,!0)],512)):f(``,!0),Kn.value&&k.value.userOptions.buttons.table?(v(),d(Ve(Hr.value.component),Le({key:6},Hr.value.props,{ref_key:`tableUnit`,ref:Yn,onClose:Wr}),Ne({content:Ge(()=>[m(`div`,{ref_key:`tableContainer`,ref:pr,class:`vue-ui-chestnut-table`,style:_(`${k.value.table.useDialog?``:`max-height: 300px;margin-top:24px`}`)},[m(`div`,{style:_(`${k.value.table.useDialog?``:`padding-top:36px;`}position: relative`)},[k.value.table.useDialog?f(``,!0):(v(),p(`div`,{key:0,role:`button`,tabindex:`0`,style:_(`width:32px; position: absolute; top: 0; left:4px; padding: 0 0px; display: flex; align-items:center;justify-content:center;height: 36px; width: 32px; cursor:${F.value?`pointer`:`default`}; background:${k.value.table.th.backgroundColor};`),onClick:Wr,onKeypress:Ke(Wr,[`enter`])},[h(C(zn),{name:`close`,stroke:k.value.table.th.color,"stroke-width":2},null,8,[`stroke`])],36)),m(`div`,{style:{width:`100%`},class:g({"vue-ui-responsive":C(Ur)})},[m(`table`,Qt,[k.value.table.useDialog?f(``,!0):(v(),p(`caption`,{key:0,style:_({backgroundColor:k.value.table.th.backgroundColor,color:k.value.table.th.color,outline:k.value.table.th.outline}),class:`vue-ui-data-table__caption`},[Pe(S(N.value.title.text)+` `,1),N.value.title.subtitle.text?(v(),p(`span`,$t,S(N.value.title.subtitle.text),1)):f(``,!0)],4)),m(`thead`,null,[m(`tr`,{role:`row`,style:_(`background:${k.value.table.th.backgroundColor};color:${k.value.table.th.color}`)},[(v(!0),p(l,null,b(Y.value.head,e=>(v(),p(`th`,{style:_(`outline:${k.value.table.th.outline}`)},S(e),5))),256))],4)]),m(`tbody`,null,[(v(!0),p(l,null,b(Y.value.body,(e,t)=>(v(),p(`tr`,{class:g({"vue-ui-data-table__tbody__row":!0,"vue-ui-data-table__tbody__row-even":t%2==0,"vue-ui-data-table__tbody__row-odd":t%2!=0}),style:_(`background:${k.value.table.td.backgroundColor};color:${k.value.table.td.color}`)},[m(`td`,{class:`vue-ui-data-table__tbody__td`,style:_(`outline:${k.value.table.td.outline}`),"data-cell":Y.value.head[0]},[m(`div`,tn,[Y.value.body[t-1]&&Y.value.body[t-1].rootName===e.rootName?(v(),p(`span`,nn)):(v(),p(`span`,rn,S(e.rootName),1))])],12,en),m(`td`,{class:`vue-ui-data-table__tbody__td`,style:_(`outline:${k.value.table.td.outline}`),"data-cell":Y.value.head[1]},[m(`div`,on,[Y.value.body[t-1]&&Y.value.body[t-1].rootName===e.rootName?(v(),p(`span`,sn)):(v(),p(`span`,cn,S(e.rootValue.toFixed(k.value.table.td.roundingValue)),1))])],12,an),m(`td`,{class:`vue-ui-data-table__tbody__td`,style:_(`outline:${k.value.table.td.outline}`),"data-cell":Y.value.head[2]},[m(`div`,un,[Y.value.body[t-1]&&Y.value.body[t-1].rootName===e.rootName?(v(),p(`span`,dn)):(v(),p(`span`,fn,S((e.rootToTotal*100).toFixed(k.value.table.td.roundingPercentage))+`% `,1))])],12,ln),m(`td`,{class:`vue-ui-data-table__tbody__td`,style:_(`outline:${k.value.table.td.outline}`),"data-cell":Y.value.head[3]},[m(`div`,mn,[Y.value.body[t-1]&&Y.value.body[t-1].branchName===e.branchName?(v(),p(`span`,hn)):(v(),p(`span`,gn,S(e.branchName),1))])],12,pn),m(`td`,{class:`vue-ui-data-table__tbody__td`,style:_(`outline:${k.value.table.td.outline}`),"data-cell":Y.value.head[4]},[m(`div`,vn,[Y.value.body[t-1]&&Y.value.body[t-1].branchName===e.branchName?(v(),p(`span`,yn)):(v(),p(`span`,bn,S(e.branchValue.toFixed(k.value.table.td.roundingValue)),1))])],12,_n),m(`td`,{class:`vue-ui-data-table__tbody__td`,style:_(`outline:${k.value.table.td.outline}`),"data-cell":Y.value.head[5]},[m(`div`,Sn,[Y.value.body[t-1]&&Y.value.body[t-1].branchName===e.branchName?(v(),p(`span`,Cn)):(v(),p(`span`,wn,S((e.branchToRoot*100).toFixed(k.value.table.td.roundingPercentage))+`% `,1))])],12,xn),m(`td`,{class:`vue-ui-data-table__tbody__td`,style:_(`outline:${k.value.table.td.outline}`),"data-cell":Y.value.head[6]},[m(`div`,En,[Y.value.body[t-1]&&Y.value.body[t-1].branchName===e.branchName?(v(),p(`span`,Dn)):(v(),p(`span`,On,S((e.branchToTotal*100).toFixed(k.value.table.td.roundingPercentage))+`% `,1))])],12,Tn),m(`td`,{class:`vue-ui-data-table__tbody__td`,style:_(`outline:${k.value.table.td.outline}`),"data-cell":Y.value.head[7]},[m(`div`,An,S(e.nutName),1)],12,kn),m(`td`,{class:`vue-ui-data-table__tbody__td`,style:_(`outline:${k.value.table.td.outline}`),"data-cell":Y.value.head[8]},[m(`div`,Mn,S(e.nutValue.toFixed(k.value.table.td.roundingValue)),1)],12,jn),m(`td`,{class:`vue-ui-data-table__tbody__td`,style:_(`outline:${k.value.table.td.outline}`),"data-cell":Y.value.head[9]},[m(`div`,Pn,S((e.nutToBranch*100).toFixed(k.value.table.td.roundingPercentage))+`% `,1)],12,Nn),m(`td`,{class:`vue-ui-data-table__tbody__td`,style:_(`outline:${k.value.table.td.outline}`),"data-cell":Y.value.head[10]},[m(`div`,In,S((e.nutToRoot*100).toFixed(k.value.table.td.roundingPercentage))+`% `,1)],12,Fn),m(`td`,{class:`vue-ui-data-table__tbody__td`,style:_(`outline:${k.value.table.td.outline}`),"data-cell":Y.value.head[11]},[m(`div`,Rn,S((e.nutToTotal*100).toFixed(k.value.table.td.roundingPercentage))+`% `,1)],12,Ln)],6))),256))])])],2)],4)],4)]),_:2},[k.value.table.useDialog?{name:`title`,fn:Ge(()=>[Pe(S(Hr.value.title),1)]),key:`0`}:void 0,k.value.table.useDialog?{name:`actions`,fn:Ge(()=>[m(`button`,{tabindex:`0`,class:`vue-ui-user-options-button`,onClick:t[11]||=e=>Pr(k.value.userOptions.callbacks.csv)},[h(C(zn),{name:`fileCsv`,stroke:Hr.value.props.color},null,8,[`stroke`])])]),key:`1`}:void 0]),1040)):f(``,!0),x(e.$slots,`skeleton`,{},()=>[C($n)?(v(),d(me,{key:0})):f(``,!0)],!0)],46,Je))}},[[`__scopeId`,`data-v-13f1d6df`]]);export{qe as n,zn as t};
1
+ import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{t}from"./useConfig-D3ZfFSE5.js";import{$ as n,D as r,Ht as i,It as a,Jt as o,S as ee,X as te,Yt as ne,at as re,f as s,h as ie,i as c,in as ae,nt as oe,p as se,r as ce,t as le,w as ue,yt as de,zt as fe}from"./lib-rPeBMZrn.js";import{n as pe,t as me}from"./BaseScanner-8NdoBs7B.js";import{n as he,t as ge}from"./useHints-C-TwxM0Y.js";import{t as _e}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{n as ve}from"./resolveChartConfig-CIhClE5R.js";import{t as ye}from"./img-D4RQwASc.js";import{t as be}from"./useChartExport-BZts4KFb.js";import{t as xe}from"./tableIntegration-CNoJ1CIY.js";import{n as Se,t as Ce}from"./annotationSlots-RvQBEO9-.js";import{n as we,t as Te}from"./userOptionsSlots-DYuo-E5m.js";import{t as Ee}from"./usePrinter-DVf3YcG5.js";import{t as De}from"./DefGrad-DKMq1REY.js";import{t as Oe}from"./A11yDataTable-DWNlWXzs.js";import{t as ke}from"./useUserOptionState-CXlFnwPv.js";import{t as Ae}from"./useChartAccessibility-DOMuYJfm.js";import{t as je}from"./useTableResponsive-uSz_qZOB.js";import{t as Me}from"./vue_ui_chestnut-BxxivKN7.js";import{Fragment as l,computed as u,createBlock as d,createCommentVNode as f,createElementBlock as p,createElementVNode as m,createSlots as Ne,createTextVNode as Pe,createVNode as h,defineAsyncComponent as Fe,guardReactiveProps as Ie,mergeProps as Le,nextTick as Re,normalizeClass as g,normalizeProps as ze,normalizeStyle as _,onMounted as Be,openBlock as v,ref as y,renderList as b,renderSlot as x,resolveDynamicComponent as Ve,toDisplayString as S,toRefs as He,unref as C,useCssVars as Ue,watch as We,withCtx as Ge,withKeys as Ke}from"vue";var qe=/* @__PURE__ */ e({default:()=>zn}),Je=[`id`],Ye=[`id`],Xe={"aria-live":`polite`,class:`sr-only`},Ze={key:2,ref:`noTitle`,class:`vue-data-ui-no-title-space`,style:`height:36px; width: 100%;background:transparent`},Qe={style:{position:`relative`}},$e=[`xmlns`,`aria-describedby`,`viewBox`],et=[`width`,`height`],tt={key:1},nt=[`fill`,`font-weight`,`font-size`,`x`,`y`],rt=[`fill`,`font-weight`,`font-size`,`x`,`y`],it={key:2},at=[`x`,`y`,`font-size`,`font-weight`,`fill`],ot=[`x`,`y`,`font-size`,`font-weight`,`fill`],st=[`d`,`stroke`,`fill`],ct=[`cx`,`cy`,`r`,`fill`],lt=[`aria-label`,`cx`,`cy`,`r`,`fill`,`stroke`,`stroke-width`,`onClick`],ut={key:3},dt=[`x`,`y`,`font-size`,`fill`,`onClick`],ft={key:0},pt=[`x`,`y`,`fill`,`font-size`,`font-weight`],mt=[`x`,`y`,`height`,`width`,`fill`,`rx`,`onClick`],ht=[`aria-label`,`x`,`y`,`height`,`width`,`fill`,`rx`,`stroke`,`stroke-width`,`onClick`],gt={key:4},_t=[`x`,`y`,`fill`,`font-size`,`onClick`],vt=[`d`,`stroke`],yt=[`aria-label`,`fill`,`cx`,`cy`,`r`,`onClick`],bt={key:5},xt=[`x`,`y`,`font-size`,`font-weight`,`fill`],St=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`],Ct=[`y`,`height`,`width`],wt={style:{width:`100%`,height:`100%`,display:`flex`,"align-items":`center`,"justify-content":`center`,"flex-direction":`column`}},Tt={style:{display:`flex`,"align-items":`center`,"justify-content":`center`,gap:`12px`,"flex-wrap":`wrap`,"flex-direction":`row`}},Et={viewBox:`0 0 20 20`,height:`16`,width:`16`},Dt=[`fill`],Ot={key:7},kt=[`y`,`height`,`width`],At={style:{width:`100%`,height:`100%`,display:`flex`,"align-items":`center`,"justify-content":`center`,"flex-direction":`column`}},jt={style:{display:`flex`,"align-items":`center`,"justify-content":`center`,gap:`12px`,"flex-wrap":`wrap`,"flex-direction":`row`}},Mt={viewBox:`0 0 20 20`,height:`16`,width:`16`},Nt=[`fill`],Pt=[`cx`,`cy`,`fill`],Ft=[`d`,`stroke`],It=[`cx`,`cy`,`fill`],Lt=[`d`,`stroke`],Rt=[`cx`,`cy`,`fill`],zt=[`cx`,`cy`,`fill`],Bt=[`x`,`y`,`fill`,`font-size`,`font-weight`],Vt=[`x`,`y`,`fill`,`font-size`,`font-weight`],Ht=[`x`,`text-anchor`,`y`,`fill`,`font-size`],Ut=[`x`,`text-anchor`,`y`,`fill`,`font-size`],Wt=[`x`,`text-anchor`,`y`,`fill`,`font-size`],Gt=[`x`,`text-anchor`,`y`,`fill`,`font-size`],Kt=[`x`,`text-anchor`,`y`,`fill`,`font-size`],qt=[`x`,`y`,`font-size`,`fill`],Jt=[`x`,`y`,`font-size`,`fill`],Yt=[`x`,`y`,`font-size`,`fill`],Xt={key:4,class:`vue-data-ui-watermark`},Zt={key:5,ref:`source`,dir:`auto`},Qt={class:`vue-ui-data-table`},$t={key:0},en=[`data-cell`],tn={style:{display:`flex`,"align-items":`center`,gap:`5px`,"justify-content":`flex-end`,width:`100%`,"padding-right":`3px`}},nn={key:0},rn={key:1},an=[`data-cell`],on={style:{display:`flex`,"align-items":`center`,gap:`5px`,"justify-content":`flex-end`,width:`100%`,"padding-right":`3px`}},sn={key:0},cn={key:1},ln=[`data-cell`],un={style:{display:`flex`,"align-items":`center`,gap:`5px`,"justify-content":`flex-end`,width:`100%`,"padding-right":`3px`}},dn={key:0},fn={key:1},pn=[`data-cell`],mn={style:{display:`flex`,"align-items":`center`,gap:`5px`,"justify-content":`flex-end`,width:`100%`,"padding-right":`3px`}},hn={key:0},gn={key:1},_n=[`data-cell`],vn={style:{display:`flex`,"align-items":`center`,gap:`5px`,"justify-content":`flex-end`,width:`100%`,"padding-right":`3px`}},yn={key:0},bn={key:1},xn=[`data-cell`],Sn={style:{display:`flex`,"align-items":`center`,gap:`5px`,"justify-content":`flex-end`,width:`100%`,"padding-right":`3px`}},Cn={key:0},wn={key:1},Tn=[`data-cell`],En={style:{display:`flex`,"align-items":`center`,gap:`5px`,"justify-content":`flex-end`,width:`100%`,"padding-right":`3px`}},Dn={key:0},On={key:1},kn=[`data-cell`],An={style:{display:`flex`,"align-items":`center`,gap:`5px`,"justify-content":`flex-end`,width:`100%`,"padding-right":`3px`}},jn=[`data-cell`],Mn={style:{display:`flex`,"align-items":`center`,gap:`5px`,"justify-content":`flex-end`,width:`100%`,"padding-right":`3px`}},Nn=[`data-cell`],Pn={style:{display:`flex`,"align-items":`center`,gap:`5px`,"justify-content":`flex-end`,width:`100%`,"padding-right":`3px`}},Fn=[`data-cell`],In={style:{display:`flex`,"align-items":`center`,gap:`5px`,"justify-content":`flex-end`,width:`100%`,"padding-right":`3px`}},Ln=[`data-cell`],Rn={style:{display:`flex`,"align-items":`center`,gap:`5px`,"justify-content":`flex-end`,width:`100%`,"padding-right":`3px`}},zn=/*#__PURE__*/ _e({__name:`vue-ui-chestnut`,props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:[`selectRoot`,`selectBranch`,`selectNut`,`copyAlt`],setup(e,{expose:_e,emit:qe}){Ue(e=>({b4b59ab0:e.tdo}));let zn=Fe(()=>import(`./BaseIcon-fYK0iID8.js`).then(e=>e.n)),Bn=Fe(()=>import(`./vue-ui-accordion-D4FHxzsL.js`).then(e=>e.n)),Vn=Fe(()=>import(`./PenAndPaper-r50tK3S4.js`).then(e=>e.t)),Hn=Fe(()=>import(`./UserOptions-Em_JgDXM.js`).then(e=>e.n)),Un=Fe(()=>import(`./PackageVersion-u-p5bCcj.js`).then(e=>e.t)),Wn=Fe(()=>import(`./BaseDraggableDialog-9d30Yx8c.js`).then(e=>e.n)),{vue_ui_chestnut:Gn}=t(),w=e,Kn=u(()=>!!w.dataset&&w.dataset.length),T=y(te()),qn=y(null),Jn=y(0),Yn=y(null),Xn=y(null),Zn=y(!1),E=y(!1),D=y(``),O=y({level:`root`,rootIndex:0,branchIndex:0,nutIndex:0,locked:!1}),k=y(ar()),A=u(()=>k.value.style.chart.layout.roots),j=u(()=>k.value.style.chart.layout.branches),M=u(()=>k.value.style.chart.layout.nuts),N=u(()=>k.value.style.chart.layout),P=u(()=>k.value.style.chart);he({config:()=>k.value,dataset:()=>w.dataset,component:`VueUiChestnut`,rules:[ge.emptyArray,{test:e=>e.some(e=>e?.branches&&e.branches.length>10),message:[`👀 Some root has > 10 branches, which can make the chart heavy. Consider:`,``,`▶️ Grouping some branches in broader categories.`]},{test:e=>e.some(e=>e?.branches&&e.branches.some(e=>e?.breakdown&&e?.breakdown.length>6)),message:[`👀 Some donuts have > 6 series. Consider:`,``,`▶️ Grouping small values into an "Other" category.`]}]});let F=u(()=>k.value.userOptions.useCursorPointer),Qn=u(()=>ae({defaultConfig:{userOptions:{show:!1},table:{show:!1},style:{chart:{backgroundColor:`#99999930`,layout:{grandTotal:{show:!1},roots:{stroke:`#6A6A6A`,labels:{show:!1}},verticalSeparator:{stroke:`transparent`},branches:{stroke:`#6A6A6A`,underlayerColor:`#6A6A6A90`,labels:{show:!1,dataLabels:{show:!1}}}}}}},userConfig:k.value.skeletonConfig??{}})),{loading:$n,FINAL_DATASET:er}=pe({...He(w),FINAL_CONFIG:k,prepareConfig:ar,skeletonDataset:w.config?.skeletonDataset??[{name:`_`,color:`#969696`,branches:[{name:`_`,value:32,breakdown:[{name:`_`,value:16,color:`#CACACA`},{name:`_`,value:16,color:`#6A6A6A`}]},{name:`_`,value:16,breakdown:[{name:`_`,value:8,color:`#CACACA`},{name:`_`,value:8,color:`#6A6A6A`}]},{name:`_`,value:8,breakdown:[{name:`_`,value:4,color:`#CACACA`},{name:`_`,value:4,color:`#6A6A6A`}]},{name:`_`,value:4,breakdown:[{name:`_`,value:2,color:`#CACACA`},{name:`_`,value:2,color:`#6A6A6A`}]}]},{name:`_`,color:`#C4C4C4`,branches:[{name:`_`,value:24,breakdown:[{name:`_`,value:12,color:`#CACACA`},{name:`_`,value:12,color:`#6A6A6A`}]},{name:`_`,value:12,breakdown:[{name:`_`,value:6,color:`#CACACA`},{name:`_`,value:6,color:`#6A6A6A`}]},{name:`_`,value:6,breakdown:[{name:`_`,value:3,color:`#CACACA`},{name:`_`,value:3,color:`#6A6A6A`}]},{name:`_`,value:2,breakdown:[{name:`_`,value:1,color:`#CACACA`},{name:`_`,value:1,color:`#6A6A6A`}]}]}],skeletonConfig:ae({defaultConfig:k.value,userConfig:Qn.value})}),{userOptionsVisible:tr,setUserOptionsVisibility:nr,keepUserOptionState:rr}=ke({config:k.value}),{svgRef:ir}=Ae({config:N.value.title});function ar(){return ve(w.config,Gn,Me)}We(()=>w.config,e=>{k.value=ar(),tr.value=!k.value.userOptions.showOnChartHover,fr.value.showTable=k.value.table.show,Nr()},{deep:!0});let{isPrinting:or,isImaging:sr,generatePdf:cr,generateImage:lr}=Ee({elementId:`vue-ui-chestnut_${T.value}`,fileName:N.value.title.text||`vue-ui-chestnut`,options:k.value.userOptions.print}),ur=u(()=>k.value.userOptions.show),dr=u(()=>ue(k.value.customPalette)),fr=y({showTable:k.value.table.show});We(k,()=>{fr.value={showTable:k.value.table.show}},{immediate:!0});let pr=y(null),mr=u(()=>k.value.table.responsiveBreakpoint),I=y({gap:6,padding:{top:102,left:12,right:12,bottom:96},width:1024,height:0,branchSize:32,branchStart:128}),L=u(()=>({left:I.value.padding.left,top:I.value.padding.top,right:I.value.width-I.value.padding.right,bottom:I.value.height-I.value.padding.bottom,width:I.value.width-(I.value.padding.left+I.value.padding.right),height:I.value.height-(I.value.padding.top+I.value.padding.bottom),seedX:I.value.padding.left+64})),R=u(()=>er.value.flatMap(e=>(e.branches||[]).map(e=>e.value||0)).reduce((e,t)=>e+t,0)),hr=u(()=>k.value.debug),z=u(()=>(hr.value&&er.value.forEach((e,t)=>{de({datasetObject:e,requiredAttributes:[`name`,`branches`]}).forEach(e=>{re({componentName:`VueUiChestnut`,type:`datasetSerieAttribute`,property:e,index:t})}),e.branches&&e.branches.forEach((e,n)=>{de({datasetObject:e,requiredAttributes:[`name`,`value`]}).forEach(e=>{re({componentName:`VueUiChestnut`,type:`datasetSerieAttribute`,property:e,index:`${t} - ${n}`})}),e.breakdown&&e.breakdown.forEach((e,r)=>{de({datasetObject:e,requiredAttributes:[`name`,`value`]}).forEach(e=>{re({componentName:`VueUiChestnut`,type:`datasetSerieAttribute`,property:e,index:`${t} - ${n} - ${r}`})})})})}),er.value.map((e,t)=>{let n=(e.branches||[]).map(e=>e.value||0).reduce((e,t)=>e+t,0);return{...e,color:ee(e.color)||dr.value[t]||i[t]||i[t%i.length],id:e.id||`root_${t}_${T.value}`,type:`root`,total:n,rootIndex:t,branches:(e.branches||[]).map((r,a)=>({...r,rootName:e.name,rootIndex:t,color:ee(e.color)||dr.value[t]||i[t]||i[t%i.length],value:r.value>=0?r.value:0,id:r.id||`branch_${t}_${a}_${T.value}`,proportionToRoot:r.value/n,type:`branch`,breakdown:(r.breakdown||[]).map((o,te)=>({table:{rootName:e.name,rootValue:n,rootToTotal:n/R.value,branchName:r.name,branchValue:r.value,branchToTotal:r.value/R.value,branchToRoot:r.value/n,nutName:o.name,nutValue:o.value,nutToTotal:o.value/R.value,nutToRoot:o.value/n,nutToBranch:o.value/r.value},...o,type:`nut`,branchName:r.name,rootName:e.name,branchTotal:r.value>=0?r.value:0,proportionToBranch:o.value/r.value,proportionToRoot:o.value/n,proportionToTree:o.value/R.value,rootIndex:t,id:o.id||`nut_${t}_${a}_${te}_${T.value}`,color:ee(o.color)||dr.value[te]||i[te]||i[te%i.length],value:o.value>=0?o.value:0}))}))}})));function gr(){return z.value}let _r=qe,vr=u(()=>z.value.flatMap(e=>e.branches).length),yr=u(()=>Math.max(...z.value.map(e=>e.branches.map(e=>e.value).reduce((e,t)=>e+t,0)))),br=u(()=>Math.max(...z.value.flatMap(e=>e.branches.map(e=>e.value)))),xr=u(()=>256+I.value.padding.left),B=u(()=>z.value.sort((e,t)=>t.total-e.total).map((e,t)=>{let n=L.value.height/z.value.length/2,r=e.total/yr.value*(n>64?64:n);return{...e,x:L.value.seedX,y:L.value.top+L.value.height/z.value.length*(t+1)-(L.value.height/z.value.length/2+I.value.gap/2),r:r<I.value.branchSize/2?I.value.branchSize/2:r}})),Sr=u(()=>j.value.widthRatio<=0?.1:j.value.widthRatio>1.8?1.8:j.value.widthRatio),Cr=u(()=>B.value.flatMap(e=>e.branches)),V=u(()=>Cr.value.sort((e,t)=>t.value-e.value).map((e,t)=>({...e,y1:t*I.value.branchSize+L.value.top+t*I.value.gap,y2:t*I.value.branchSize+I.value.branchSize,x1:xr.value,x2:384*e.value/br.value*Sr.value+xr.value}))),wr=u(()=>B.value),Tr=u(()=>wr.value.map(e=>V.value.filter(t=>t.rootIndex===e.rootIndex).sort((e,t)=>e.y1-t.y1))),Er=u(()=>wr.value.map((e,t)=>Tr.value[t].map(e=>(e.breakdown||[]).map((t,n)=>({...t,nutIndex:n,rootIndex:e.rootIndex,branchId:e.id,branchName:e.name,branchValue:e.value,rootName:e.rootName})))));function Dr(e){let t=B.value.find(t=>t.rootIndex===e.rootIndex);return{x:t.x,y:t.y,r:t.r}}let H=y(null),U=y(null),W=y(null),G=y(null);function K(){H.value=null,W.value=null,G.value=null}function q(e){if(H.value)return e.type===`root`?e.rootIndex===H.value.rootIndex:e.type===`branch`?e.id===H.value.id:e.type===`nut`&&e.branchName===H.value.name&&e.rootIndex===H.value.rootIndex;if(W.value)return e.type===`root`?e.rootIndex===W.value.rootIndex:e.type===`branch`?e.id===W.value.id:e.type===`nut`&&e.branchName===W.value.name&&e.rootIndex===W.value.rootIndex;if(G.value)return e.type===`root`?e.id===G.value.id:e.type===`branch`||e.type===`nut`?e.rootIndex===G.value.rootIndex:!1;if(ci.value&&E.value){if(O.value.level===`root`)return e.type===`root`?Z.value&&e.id===Z.value.id:e.type===`branch`||e.type===`nut`?Z.value&&e.rootIndex===Z.value.rootIndex:!1;if(O.value.level===`branch`)return e.type===`root`?Z.value&&e.rootIndex===Z.value.rootIndex:e.type===`branch`?oi.value&&e.id===oi.value.id:(e.type,!1);if(O.value.level===`nut`)return e.type===`root`?Z.value&&e.rootIndex===Z.value.rootIndex:e.type===`branch`?si.value&&e.id===si.value.id:e.type===`nut`&&si.value&&e.branchName===si.value.name&&e.rootIndex===si.value.rootIndex}return!0}function Or(e){K();let t=wr.value.findIndex(t=>t.rootIndex===e.rootIndex),n=(Tr.value[t]||[]).findIndex(t=>t.id===e.id);t!==-1&&(O.value.rootIndex=t),n!==-1&&(O.value.branchIndex=n),O.value.level=`nut`,O.value.nutIndex=0,Re(()=>{H.value=e,W.value=e,U.value=a({series:e.breakdown,base:1},e.x2+24+M.value.offsetX,e.y1+I.value.branchSize/2,80,80),_r(`selectNut`,e.breakdown),Q()})}function J(){H.value=null,U.value=null,_r(`selectNut`,null)}function kr(e){let t=wr.value.findIndex(t=>t.rootIndex===e.rootIndex),n=(Tr.value[t]||[]).findIndex(t=>t.id===e.id);t!==-1&&(O.value.rootIndex=t),n!==-1&&(O.value.branchIndex=n),O.value.level=`branch`,O.value.nutIndex=0,W.value&&W.value.id===e.id?(W.value=null,K(),_r(`selectBranch`,null),Q()):(K(),W.value=e,_r(`selectBranch`,e),Q())}function Ar(e){let t=wr.value.findIndex(t=>t.id===e.id);t!==-1&&(O.value.rootIndex=t),O.value.level=`root`,O.value.branchIndex=0,O.value.nutIndex=0,G.value&&G.value.id===e.id?(K(),_r(`selectRoot`,null),Q()):(K(),G.value=e,_r(`selectRoot`,e),Q())}function jr(){return L.value.bottom-(H.value.y1+180)<0?0:L.value.bottom}function Mr(e){return e.proportion*100>M.value.selected.labels.dataLabels.hideUnderValue}Be(()=>{Nr()});function Nr(){fe(w.dataset)&&re({componentName:`VueUiChestnut`,type:`dataset`,debug:hr.value});let e=vr.value*(I.value.branchSize+I.value.gap)+I.value.padding.top+I.value.padding.bottom;I.value.height=e}let Y=u(()=>({head:[k.value.table.th.translations.rootName,k.value.table.th.translations.rootValue,k.value.table.th.translations.rootToTotal,k.value.table.th.translations.branchName,k.value.table.th.translations.branchValue,k.value.table.th.translations.branchToRoot,k.value.table.th.translations.branchToTotal,k.value.table.th.translations.nutName,k.value.table.th.translations.nutValue,k.value.table.th.translations.nutToBranch,k.value.table.th.translations.nutToRoot,k.value.table.th.translations.nutToTotal],body:z.value.flatMap((e,t)=>e.branches.flatMap((e,t)=>e.breakdown.flatMap((e,t)=>e.table)))}));function Pr(e=null){Re(()=>{let t=[[N.value.title.text],[N.value.title.subtitle.text],[``],[`Grand total`,R.value],[``]],n=Y.value.head,i=Y.value.body.map((e,t)=>[Y.value.body[t-1]&&Y.value.body[t-1].rootName===e.rootName?``:e.rootName,Y.value.body[t-1]&&Y.value.body[t-1].rootName===e.rootName?``:e.rootValue,Y.value.body[t-1]&&Y.value.body[t-1].rootName===e.rootName?``:e.rootToTotal,Y.value.body[t-1]&&Y.value.body[t-1].branchName===e.branchName?``:e.branchName,Y.value.body[t-1]&&Y.value.body[t-1].branchName===e.branchName?``:e.branchValue,Y.value.body[t-1]&&Y.value.body[t-1].branchName===e.branchName?``:e.branchToRoot,Y.value.body[t-1]&&Y.value.body[t-1].branchName===e.branchName?``:e.branchToTotal,e.nutName,e.nutValue,e.nutToBranch,e.nutToRoot,e.nutToTotal]),a=t.concat([n]).concat(i),o=r(a);e?e(o):oe({csvContent:o,title:N.value.title.text||`vue-ui-chestnut`})})}let Fr=y(!1);function Ir(e){Fr.value=e,Jn.value+=1}function Lr(){fr.value.showTable=!fr.value.showTable}let Rr=y(!1);function zr(){Rr.value=!Rr.value}async function Br({scale:e=2}={}){if(!qn.value)return;let{width:t,height:n}=qn.value.getBoundingClientRect(),r=t/n,{imageUri:i,base64:a}=await ye({domElement:qn.value,base64:!0,img:!0,scale:e});return{imageUri:i,base64:a,title:N.value.title.text,width:t,height:n,aspectRatio:r}}function Vr(e){let t=Dr(e),n=e.x1,r=e.y1,i=I.value.branchSize,a=t.x+t.r/2,o=t.y;return[`M ${n},${r}`,`C ${n-20},${r} ${n-20},${r} ${a},${o}`,`C ${a},${o} ${n-20},${r+i} ${n},${r+i}`,`Z`].join(` `)}let Hr=u(()=>xe({config:k,style:P,mutableConfig:fr,dialog:Wn,accordion:Bn,isFullscreen:Fr,parent:qn,maxWidth:800,titleStyle:N,isCursorPointer:F}));We(()=>fr.value.showTable,async e=>{k.value.table.show||(e&&k.value.table.useDialog&&Yn.value?(await Re(),Yn.value.open()):`close`in Yn.value&&Yn.value.close())});let{isResponsive:Ur}=je(pr,mr);function Wr(){fr.value.showTable=!1,Xn.value&&Xn.value.setTableIconState(!1)}let Gr=u(()=>z.value.map((e,t)=>({...e,display:`${e.name}: ${c(A.value.labels.formatter,e.total,n({p:N.value.legend.prefix,v:e.total,s:N.value.legend.suffix,r:N.value.legend.roundingValue}),{datapoint:e})} (${n({v:e.total/R.value*100,s:`%`,r:N.value.legend.roundingPercentage})})`}))),Kr=u(()=>Gr.value.map(e=>({color:e.color,name:e.display,shape:`circle`}))),qr=u(()=>P.value.backgroundColor),Jr=u(()=>({...N.value.legend,textAlign:`center`,show:!0,position:`bottom`})),Yr=u(()=>N.value.title),{isCallbackImaging:Xr,isCallbackSvg:Zr,generateSvg:Qr,onGenerateImage:$r}=be({svg:ir,title:Yr,legend:Jr,legendItems:Kr,backgroundColor:qr,titleEmbedded:!0,getSvgCallback:()=>k.value.userOptions.callbacks.svg,generateImage:lr});async function ei(){_r(`copyAlt`,{config:k.value,dataset:z.value}),k.value.userOptions.callbacks.altCopy?await Promise.resolve(k.value.userOptions.callbacks.altCopy({config:k.value,dataset:z.value})):console.warn("Vue Data UI - A callback must be set for `altCopy` in userOptions.")}function ti(e){if(!e)return``;let t=n({p:N.value.legend.prefix,v:e.total,s:N.value.legend.suffix,r:N.value.legend.roundingValue}),r=n({v:e.total/R.value*100,s:`%`,r:N.value.legend.roundingPercentage});return`Root ${e.name}. Value ${t}. ${r} of total.`}function ni(e){if(!e)return``;let t=n({p:j.value.labels.dataLabels.prefix,v:e.value,s:j.value.labels.dataLabels.suffix,r:j.value.labels.dataLabels.roundingValue}),r=n({v:e.proportionToRoot*100,s:`%`,r:N.value.legend.roundingPercentage});return`Branch ${e.name}. Root ${e.rootName}. Value ${t}. ${r} of root ${e.rootName}.`}function ri(e){if(!e)return``;let t=n({p:N.value.legend.prefix,v:e.value,s:N.value.legend.suffix,r:M.value.selected.labels.roundingValue}),r=n({v:e.proportionToBranch*100,s:`%`,r:M.value.selected.labels.roundingPercentage});return`Nut ${e.name}. Branch ${e.branchName}. Root ${e.rootName}. Value ${t}. ${r} of branch ${e.branchName}.`}let ii=u(()=>wr.value[O.value.rootIndex]||null),X=u(()=>(Tr.value[O.value.rootIndex]||[])[O.value.branchIndex]||null),ai=u(()=>((Er.value[O.value.rootIndex]||[])[O.value.branchIndex]||[])[O.value.nutIndex]||null),Z=u(()=>ii.value),oi=u(()=>X.value),si=u(()=>O.value.level===`nut`?X.value:null),ci=u(()=>Zn.value);function Q(){O.value.level===`root`?D.value=ti(ii.value):O.value.level===`branch`?D.value=ni(X.value):O.value.level===`nut`&&(D.value=ri(ai.value))}function $(){O.value={level:`root`,rootIndex:0,branchIndex:0,nutIndex:0,locked:!1},D.value=``}function li(){let e=Tr.value[O.value.rootIndex]||[];e.length?(O.value.branchIndex>=e.length&&(O.value.branchIndex=0),O.value.branchIndex<0&&(O.value.branchIndex=e.length-1)):O.value.branchIndex=0}function ui(){let e=(Er.value[O.value.rootIndex]||[])[O.value.branchIndex]||[];e.length?(O.value.nutIndex>=e.length&&(O.value.nutIndex=0),O.value.nutIndex<0&&(O.value.nutIndex=e.length-1)):O.value.nutIndex=0}function di(e){if(O.value.level===`root`){let t=wr.value.length;if(!t)return;O.value.rootIndex+=e,O.value.rootIndex>=t&&(O.value.rootIndex=0),O.value.rootIndex<0&&(O.value.rootIndex=t-1),O.value.branchIndex=0,O.value.nutIndex=0,Q()}else O.value.level===`branch`?(O.value.branchIndex+=e,li(),O.value.nutIndex=0,Q()):O.value.level===`nut`&&(O.value.nutIndex+=e,ui(),Q())}function fi(e){if(e>0){if(O.value.level===`root`){if(!(Tr.value[O.value.rootIndex]||[]).length)return;O.value.level=`branch`,O.value.branchIndex=0,O.value.nutIndex=0,Q();return}if(O.value.level===`branch`){if(!((Er.value[O.value.rootIndex]||[])[O.value.branchIndex]||[]).length)return;O.value.level=`nut`,O.value.nutIndex=0,X.value?Or(X.value):Q();return}}else O.value.level===`nut`?(J(),W.value=null,O.value.level=`branch`,O.value.nutIndex=0,Q()):O.value.level===`branch`&&(W.value=null,G.value=null,O.value.level=`root`,O.value.nutIndex=0,Q())}function pi(){O.value.level===`root`&&ii.value?(Ar(ii.value),D.value=`${ti(ii.value)} selected.`):O.value.level===`branch`&&X.value?(kr(X.value),D.value=`${ni(X.value)} selected.`):O.value.level===`nut`&&X.value&&ai.value&&(Or(X.value),D.value=`${ri(ai.value)} details opened.`)}function mi(){Zn.value=!0,E.value=!1}function hi(){Zn.value=!1,E.value=!1,D.value=``,G.value||W.value||H.value||$()}function gi(e){let t=e.key===`ArrowUp`,n=e.key===`ArrowDown`,r=e.key===`ArrowLeft`,i=e.key===`ArrowRight`,a=e.key===`Enter`||e.key===` `,o=e.key===`Escape`;(t||n||r||i||a||o)&&(e.preventDefault(),e.stopPropagation(),Zn.value||=!0,o?(K(),$(),E.value=!1):((t||n||r||i)&&(E.value=!0),t?di(-1):n?di(1):r?fi(-1):i?fi(1):a&&pi()))}let _i=u(()=>({headers:Y.value.head,rows:Y.value.body.map(e=>[e.rootName,e.rootValue,n({v:e.rootToTotal*100,s:`%`,r:k.value.table.td.roundingPercentage}),e.branchName,e.branchValue,n({v:e.branchToRoot*100,s:`%`,r:k.value.table.td.roundingPercentage}),n({v:e.branchToTotal*100,s:`%`,r:k.value.table.td.roundingPercentage}),e.nutName,e.nutValue,n({v:e.nutToBranch*100,s:`%`,r:k.value.table.td.roundingPercentage}),n({v:e.nutToRoot*100,s:`%`,r:k.value.table.td.roundingPercentage}),n({v:e.nutToTotal*100,s:`%`,r:k.value.table.td.roundingPercentage})])}));return _e({getData:gr,getImage:Br,generatePdf:cr,generateCsv:Pr,generateImage:lr,generateSvg:Qr,toggleTable:Lr,toggleAnnotator:zr,toggleFullscreen:Ir,copyAlt:ei}),(e,t)=>(v(),p(`div`,{class:g(`vue-data-ui-component vue-ui-chestnut ${Fr.value?`vue-data-ui-wrapper-fullscreen`:``}`),ref_key:`chestnutChart`,ref:qn,id:`vue-ui-chestnut_${T.value}`,style:_(`font-family:${k.value.style.fontFamily};width:100%; text-align:center;background:${P.value.backgroundColor}`),onMouseenter:t[12]||=()=>C(nr)(!0),onMouseleave:t[13]||=()=>C(nr)(!1)},[m(`div`,{id:`chart-instructions-${T.value}`,class:`sr-only`},[m(`p`,null,S(k.value.a11y.translations.keyboardNavigation),1)],8,Ye),m(`div`,Xe,S(D.value),1),_i.value?.rows?.length?(v(),d(Oe,{key:0,uid:T.value,head:_i.value.headers,body:_i.value.rows,notice:k.value.a11y.translations.tableAvailable,caption:k.value.a11y.translations.tableCaption},null,8,[`uid`,`head`,`body`,`notice`,`caption`])):f(``,!0),k.value.userOptions.buttons.annotator?(v(),d(C(Vn),{key:1,showGroupActions:k.value.userOptions.annotator?.showGroupActions??!0,svgRef:C(ir),backgroundColor:P.value.backgroundColor,color:P.value.color,active:Rr.value,isCursorPointer:F.value,palette:k.value.userOptions.annotatorPalette,onClose:zr},Ne({_:2},[b(C(Ce),t=>({name:t,fn:Ge(n=>[x(e.$slots,t,ze(Ie(C(Se)(t,n))),void 0,!0)])}))]),1032,[`showGroupActions`,`svgRef`,`backgroundColor`,`color`,`active`,`isCursorPointer`,`palette`])):f(``,!0),ur.value?(v(),p(`div`,Ze,null,512)):f(``,!0),k.value.userOptions.show&&Kn.value&&(C(rr)||C(tr))?(v(),d(C(Hn),{ref_key:`userOptionsRef`,ref:Xn,key:`user_options_${Jn.value}`,backgroundColor:P.value.backgroundColor,color:P.value.color,isImaging:C(sr),isPrinting:C(or),uid:T.value,hasPdf:k.value.userOptions.buttons.pdf,hasImg:k.value.userOptions.buttons.img,hasSvg:k.value.userOptions.buttons.svg,hasXls:k.value.userOptions.buttons.csv,hasTable:k.value.userOptions.buttons.table,hasFullscreen:k.value.userOptions.buttons.fullscreen,hasAltCopy:k.value.userOptions.buttons.altCopy,isFullscreen:Fr.value,titles:{...k.value.userOptions.buttonTitles},chartElement:qn.value,position:k.value.userOptions.position,hasAnnotator:k.value.userOptions.buttons.annotator,isAnnotation:Rr.value,callbacks:k.value.userOptions.callbacks,printScale:k.value.userOptions.print.scale,tableDialog:k.value.table.useDialog,isCursorPointer:F.value,onToggleFullscreen:Ir,onGeneratePdf:C(cr),onGenerateCsv:Pr,onGenerateImage:C($r),onGenerateSvg:C(Qr),onToggleTable:Lr,onToggleAnnotator:zr,onCopyAlt:ei,style:_({visibility:C(rr)?C(tr)?`visible`:`hidden`:`visible`})},Ne({_:2},[b(C(we)(e.$slots,`menuIcon optionPdf optionCsv optionImg optionSvg optionTable optionFullscreen optionAnnotator optionAltCopy custom-menu-before custom-menu-after`),t=>({name:t,fn:Ge(n=>[x(e.$slots,t,ze(Ie(C(Te)(t,n))),void 0,!0)])}))]),1032,/* @__PURE__ */ `backgroundColor.color.isImaging.isPrinting.uid.hasPdf.hasImg.hasSvg.hasXls.hasTable.hasFullscreen.hasAltCopy.isFullscreen.titles.chartElement.position.hasAnnotator.isAnnotation.callbacks.printScale.tableDialog.isCursorPointer.onGeneratePdf.onGenerateImage.onGenerateSvg.style`.split(`.`))):f(``,!0),m(`div`,Qe,[I.value.height>0?(v(),p(`svg`,{key:0,ref_key:`svgRef`,ref:ir,xmlns:C(le),"aria-describedby":`chart-instructions-${T.value}`,class:g({"vue-data-ui-fullscreen--on":Fr.value,"vue-data-ui-fulscreen--off":!Fr.value}),viewBox:`0 0 ${I.value.width<=0?10:I.value.width} ${I.value.height<=0?10:I.value.height}`,style:_(`overflow:visible;background:transparent;color:${P.value.color}`),tabindex:`0`,onFocus:mi,onBlur:hi,onKeydown:gi},[h(C(Un)),x(e.$slots,`svg-underlayer`,{svg:{...I.value,isPrintingImg:C(or)||C(sr)||C(Xr),isPrintingSvg:C(Zr)}},void 0,!0),e.$slots[`chart-background`]?(v(),p(`foreignObject`,{key:0,x:0,y:0,width:I.value.width<=0?10:I.value.width,height:I.value.height<=0?10:I.value.height,style:{pointerEvents:`none`}},[x(e.$slots,`chart-background`,{},void 0,!0)],8,et)):f(``,!0),H.value?f(``,!0):(v(),p(`g`,tt,[N.value.title.text?(v(),p(`text`,{key:0,"text-anchor":`middle`,fill:N.value.title.color,"font-weight":N.value.title.bold?`bold`:`normal`,"font-size":N.value.title.fontSize,x:I.value.width/2,y:12+N.value.title.fontSize+N.value.title.offsetY,onClick:t[0]||=()=>{K(),$(),E.value=!1}},S(N.value.title.text),9,nt)):f(``,!0),N.value.title.subtitle.text?(v(),p(`text`,{key:1,"text-anchor":`middle`,fill:N.value.title.subtitle.color,"font-weight":N.value.title.subtitle.bold?`bold`:`normal`,"font-size":N.value.title.subtitle.fontSize,x:I.value.width/2,y:48+N.value.title.subtitle.fontSize+N.value.title.subtitle.offsetY,onClick:t[1]||=()=>{K(),$(),E.value=!1}},S(N.value.title.subtitle.text),9,rt)):f(``,!0)])),m(`defs`,null,[(v(!0),p(l,null,b(z.value,(e,t)=>(v(),d(De,{t:`radial`,cx:`50%`,cy:`50%`,r:`50%`,fx:`50%`,fy:`50%`,id:`root_gradient_${T.value}_${e.rootIndex}`,key:`root_gradient_${T.value}_${e.rootIndex}`,stops:[[`0%`,C(o)(C(ne)(e.color,.05),100-A.value.gradientIntensity),1],[`100%`,e.color,1]]},null,8,[`id`,`stops`]))),128)),(v(!0),p(l,null,b(z.value,e=>(v(),d(De,{t:`linear`,x1:`0%`,y1:`0%`,x2:`100%`,y2:`0%`,id:`branch_gradient_${T.value}_${e.rootIndex}`,key:`branch_gradient_${T.value}_${e.rootIndex}`,stops:[[`0%`,e.color,1],[`100%`,C(o)(C(ne)(e.color,.02),100-j.value.gradientIntensity),1]]},null,8,[`id`,`stops`]))),128)),h(De,{t:`radial`,cx:`50%`,cy:`50%`,r:`50%`,fx:`50%`,fy:`50%`,id:`nutpick_${T.value}`,stops:[[`0%`,C(o)(`#FFFFFF`,0),0],[`80%`,C(o)(`#FFFFFF`,M.value.selected.gradientIntensity),1],[`100%`,C(o)(`#FFFFFF`,0),0]]},null,8,[`id`,`stops`]),h(De,{t:`radial`,cx:`50%`,cy:`50%`,r:`50%`,fx:`50%`,fy:`50%`,id:`nut_${T.value}`,stops:[[`0%`,C(o)(`#FFFFFF`,0),0],[`80%`,C(o)(`#FFFFFF`,M.value.gradientIntensity),1],[`100%`,C(o)(`#FFFFFF`,0),0]]},null,8,[`id`,`stops`]),h(De,{t:`radial`,cx:`50%`,cy:`50%`,r:`50%`,fx:`50%`,fy:`50%`,id:`nut_underlayer_${T.value}`,stops:[[`0%`,C(o)(P.value.backgroundColor,100),1],[`80%`,C(o)(P.value.backgroundColor,60),1],[`100%`,C(o)(P.value.backgroundColor,0),1]]},null,8,[`id`,`stops`])]),N.value.grandTotal.show?(v(),p(`g`,it,[m(`text`,{x:L.value.seedX,y:32+N.value.grandTotal.offsetY,"font-size":N.value.grandTotal.fontSize,"font-weight":N.value.grandTotal.bold?`bold`:`normal`,fill:N.value.grandTotal.color,"text-anchor":`middle`,onClick:t[2]||=()=>{K(),$(),E.value=!1}},S(N.value.grandTotal.text),9,at),m(`text`,{x:L.value.seedX,y:38+N.value.grandTotal.fontSize+N.value.grandTotal.offsetY,"font-size":N.value.grandTotal.fontSize,"font-weight":N.value.grandTotal.bold?`bold`:`normal`,fill:N.value.grandTotal.color,"text-anchor":`middle`,onClick:t[3]||=()=>{K(),$(),E.value=!1}},S(C(c)(N.value.grandTotal.formatter,R.value,C(n)({p:N.value.grandTotal.prefix,v:R.value,s:N.value.grandTotal.suffix,r:N.value.grandTotal.roundingValue}))),9,ot)])):f(``,!0),(v(!0),p(l,null,b(V.value,e=>(v(),p(`g`,null,[m(`defs`,null,[h(De,{t:`linear`,id:`link_grad_${e.id}`,stops:[[`0%`,e.color,1],[`100%`,C(o)(e.color,N.value.links.opacity),1]]},null,8,[`id`,`stops`])]),m(`path`,{d:Vr(e),stroke:C(o)(e.color,N.value.links.opacity),fill:`url(#link_grad_${e.id})`,"stroke-linecap":`round`,"stroke-linejoin":`round`,style:_(`opacity:${+!!q(e)}`),onClick:t[4]||=()=>{K(),$(),E.value=!1}},null,12,st)]))),256)),(v(!0),p(l,null,b(B.value,e=>(v(),p(`circle`,{cx:e.x,cy:e.y,r:e.r,fill:A.value.underlayerColor,stroke:`none`,style:_(`cursor:${F.value?`pointer`:`default`}; opacity:${q(e)?1:.05}`)},null,12,ct))),256)),(v(!0),p(l,null,b(B.value,(e,t)=>(v(),p(`circle`,{"aria-label":ti(e),cx:e.x,cy:e.y,r:e.r,fill:A.value.useGradient?`url(#root_gradient_${T.value}_${e.rootIndex})`:e.color,stroke:A.value.stroke,"stroke-width":A.value.strokeWidth,style:_(`cursor:${F.value?`pointer`:`default`}; opacity:${q(e)?1:.05}`),onClick:t=>Ar(e)},null,12,lt))),256)),A.value.labels.show?(v(),p(`g`,ut,[(v(!0),p(l,null,b(B.value,(e,t)=>(v(),p(`text`,{x:e.x,y:e.y+A.value.labels.fontSize/2.6,"text-anchor":`middle`,"font-size":A.value.labels.fontSize,fill:A.value.labels.adaptColorToBackground?C(ce)(e.color):A.value.labels.color,"font-weight":`bold`,style:_(`cursor:${F.value?`pointer`:`default`}; opacity:${q(e)?1:.05}`),onClick:t=>Ar(e)},S(C(c)(A.value.labels.formatter,e.total,C(n)({p:A.value.labels.prefix,v:e.total,s:A.value.labels.suffix,r:A.value.labels.roundingValue}),{datapoint:e})),13,dt))),256)),(v(!0),p(l,null,b(B.value,e=>(v(),p(`g`,null,[H.value&&e.rootIndex===H.value.rootIndex||W.value&&e.rootIndex===W.value.rootIndex||G.value&&e.rootIndex===G.value.rootIndex?(v(),p(`g`,ft,[m(`text`,{x:e.x,y:e.y+e.r+24,"text-anchor":`middle`,fill:A.value.labels.name.color,"font-size":A.value.labels.name.fontSize,"font-weight":A.value.labels.name.bold?`bold`:`normal`,onClick:t[5]||=()=>{K(),$(),E.value=!1}},S(e.name),9,pt)])):f(``,!0)]))),256))])):f(``,!0),(v(!0),p(l,null,b(V.value,e=>(v(),p(`rect`,{x:e.x1,y:e.y1,height:I.value.branchSize,width:e.x2-e.x1,fill:j.value.underlayerColor,rx:j.value.borderRadius,stroke:`none`,style:_(`opacity:${q(e)?1:.05}`),onClick:t=>kr(e)},null,12,mt))),256)),(v(!0),p(l,null,b(V.value,(e,t)=>(v(),p(`rect`,{"aria-label":ni(e),x:e.x1,y:e.y1,height:I.value.branchSize,width:e.x2-e.x1,fill:j.value.useGradient?`url(#branch_gradient_${T.value}_${e.rootIndex})`:e.color,rx:j.value.borderRadius,stroke:j.value.stroke,"stroke-width":j.value.strokeWidth,style:_(`cursor:${F.value?`pointer`:`default`}; opacity:${q(e)?1:.05}`),onClick:t=>kr(e)},null,12,ht))),256)),j.value.labels.dataLabels.show?(v(),p(`g`,gt,[(v(!0),p(l,null,b(V.value,e=>(v(),p(`g`,null,[e.proportionToRoot*100>j.value.labels.dataLabels.hideUnderValue?(v(),p(`text`,{key:0,x:e.x1+6,y:e.y1+I.value.branchSize/1.5,"text-anchor":`start`,fill:C(ce)(e.color),"font-size":j.value.labels.dataLabels.fontSize,"font-weight":`bold`,style:_(`cursor:${F.value?`pointer`:`default`}; opacity:${q(e)?1:.05}`),onClick:t=>kr(e)},S(C(c)(j.value.labels.dataLabels.formatter,e.value,C(n)({p:N.value.branches.labels.dataLabels.prefix,v:e.value,s:N.value.branches.labels.dataLabels.suffix,r:N.value.branches.labels.dataLabels.roundingValue}),{datapoint:e})),13,_t)):f(``,!0)]))),256))])):f(``,!0),(v(!0),p(l,null,b(V.value,(e,t)=>(v(),p(`g`,null,[(v(!0),p(l,null,b(C(a)({series:e.breakdown,base:1},e.x2+24+M.value.offsetX,e.y1+I.value.branchSize/2,I.value.branchSize/3,I.value.branchSize/3),(t,n)=>(v(),p(`path`,{d:t.path,stroke:t.color,"stroke-width":10,fill:`none`,style:_(`opacity:${q(e)?1:.1}`)},null,12,vt))),256)),m(`circle`,{"aria-label":`Open details for branch ${e.name} in root ${e.rootName}`,fill:M.value.useGradient?`url(#nut_${T.value})`:`transparent`,cx:e.x2+24+M.value.offsetX,cy:e.y1+I.value.branchSize/2,r:I.value.branchSize/2+2,onClick:t=>Or(e),style:_(`cursor:${F.value?`pointer`:`default`};opacity:${q(e)?1:.1}`)},null,12,yt)]))),256)),j.value.labels.show&&!W.value?(v(),p(`g`,bt,[(v(!0),p(l,null,b(V.value,e=>(v(),p(`text`,{x:e.x2+I.value.branchSize+24+M.value.offsetX,y:e.y1+I.value.branchSize/2+5,"font-size":j.value.labels.fontSize,"font-weight":j.value.labels.bold?`bold`:`normal`,fill:j.value.labels.color,"text-anchor":`start`,style:_(`opacity:${q(e)?1:.1}`)},S(e.name),13,xt))),256))])):f(``,!0),m(`line`,{x1:256+I.value.padding.left,x2:256+I.value.padding.left,y1:L.value.top,y2:L.value.bottom,stroke:N.value.verticalSeparator.stroke,"stroke-width":N.value.verticalSeparator.strokeWidth},null,8,St),!H.value&&!W.value?(v(),p(`foreignObject`,{key:6,x:0,y:L.value.bottom,height:I.value.height-L.value.bottom,width:I.value.width,style:{overflow:`visible`},"data-no-svg-export":``,onClick:t[6]||=()=>{K(),$(),E.value=!1}},[m(`div`,wt,[m(`div`,Tt,[(v(!0),p(l,null,b(B.value,e=>(v(),p(`div`,{style:_(`display:flex;align-items:center;gap:3px;flex-direction:row;font-size:${N.value.legend.fontSize}px;`)},[(v(),p(`svg`,Et,[m(`circle`,{cx:`10`,cy:`10`,r:`10`,fill:e.color,stroke:`none`},null,8,Dt)])),C($n)?f(``,!0):(v(),p(l,{key:0},[m(`span`,null,S(e.name)+`:`,1),m(`b`,null,S(C(c)(N.value.roots.labels.formatter,e.total,C(n)({p:P.value.layout.legend.prefix,v:e.total,s:P.value.layout.legend.suffix,r:P.value.layout.legend.roundingValue}),{datapoint:e})),1),Pe(` (`+S(C(n)({v:e.total/R.value*100,s:`%`,r:N.value.legend.roundingPercentage}))+`) `,1)],64))],4))),256))])])],8,Ct)):f(``,!0),H.value&&U.value?(v(),p(`g`,Ot,[(v(),p(`foreignObject`,{x:0,y:jr(),height:I.value.height-L.value.bottom,width:I.value.width,style:{overflow:`visible`},onClick:t[7]||=()=>{K(),$(),E.value=!1}},[m(`div`,At,[m(`b`,null,S(H.value.name),1),m(`div`,jt,[(v(!0),p(l,null,b(H.value.breakdown,(e,t)=>(v(),p(`div`,{style:_(`display:flex;align-items:center;gap:6px;flex-direction:row;font-size:${N.value.legend.fontSize}px;`)},[(v(),p(`svg`,Mt,[m(`circle`,{cx:`10`,cy:`10`,r:`10`,fill:e.color,stroke:`none`},null,8,Nt)])),m(`span`,null,[Pe(S(e.name)+`: `,1),m(`b`,null,S(N.value.legend.prefix)+` `+S(e.value.toFixed(P.value.layout.nuts.selected.labels.roundingValue))+` `+S(N.value.legend.suffix),1),Pe(` (`+S((e.proportionToBranch*100).toFixed(N.value.nuts.selected.labels.roundingPercentage))+`%)`,1)])],4))),256))])])],8,kt)),m(`circle`,{cx:H.value.x2+24+M.value.offsetX,cy:H.value.y1+I.value.branchSize/2,r:256,fill:`url(#nut_underlayer_${T.value})`,onClick:J,class:g(M.value.selected.useMotion?`vue-ui-chestnut-animated`:``)},null,10,Pt),(v(!0),p(l,null,b(U.value,e=>(v(),p(`g`,null,[Mr(e)?(v(),p(`path`,{key:0,d:C(ie)(e,{x:H.value.x2+24+M.value.offsetX,y:H.value.y1+I.value.branchSize/2},16,16,!1,!1,64),stroke:e.color,"stroke-width":`1`,"stroke-linecap":`round`,"stroke-linejoin":`round`,fill:`none`,class:g(M.value.selected.useMotion?`vue-ui-chestnut-animated`:``)},null,10,Ft)):f(``,!0)]))),256)),m(`circle`,{cx:H.value.x2+24+M.value.offsetX,cy:H.value.y1+I.value.branchSize/2,r:118,fill:P.value.backgroundColor,onClick:J,class:g(M.value.selected.useMotion?`vue-ui-chestnut-animated`:``)},null,10,It),(v(!0),p(l,null,b(U.value,e=>(v(),p(`path`,{d:e.path,stroke:e.color,"stroke-width":64,fill:`none`,onClick:J,class:g(M.value.selected.useMotion?`vue-ui-chestnut-animated`:``)},null,10,Lt))),256)),m(`circle`,{cx:H.value.x2+24+M.value.offsetX,cy:H.value.y1+I.value.branchSize/2,r:110,fill:`url(#nutpick_${T.value})`,onClick:J,class:g(M.value.selected.useMotion?`vue-ui-chestnut-animated`:``)},null,10,Rt),m(`circle`,{cx:H.value.x2+24+M.value.offsetX,cy:H.value.y1+I.value.branchSize/2,r:64,fill:P.value.backgroundColor,onClick:J,class:g(M.value.selected.useMotion?`vue-ui-chestnut-animated`:``)},null,10,zt),m(`text`,{x:H.value.x2+24+M.value.offsetX,y:H.value.y1+8,fill:M.value.selected.labels.core.total.color,"font-size":M.value.selected.labels.core.total.fontSize,"font-weight":M.value.selected.labels.core.total.bold?`bold`:`normal`,"text-anchor":`middle`,onClick:J,class:g(M.value.selected.useMotion?`vue-ui-chestnut-animated`:``)},S(k.value.translations.total),11,Bt),m(`text`,{x:H.value.x2+24+M.value.offsetX,y:H.value.y1+36,fill:M.value.selected.labels.core.value.color,"font-size":M.value.selected.labels.core.value.fontSize,"font-weight":M.value.selected.labels.core.value.bold?`bold`:`normal`,"text-anchor":`middle`,onClick:J,class:g(M.value.selected.useMotion?`vue-ui-chestnut-animated`:``)},S(C(c)(M.value.selected.labels.dataLabels.formatter,H.value.value,C(n)({p:M.value.selected.labels.core.value.prefix,v:H.value.value,s:M.value.selected.labels.core.value.suffix,r:M.value.selected.roundingValue}),{datapoint:H.value})),11,Vt),(v(!0),p(l,null,b(U.value,(e,t)=>(v(),p(`g`,null,[Mr(e)?(v(),p(`text`,{key:0,x:C(s)(e).x,"text-anchor":C(s)(e).anchor,y:C(se)(e)-M.value.selected.labels.dataLabels.fontSize/6,fill:e.color,"font-size":M.value.selected.labels.dataLabels.fontSize/2,style:_(`font-weight:${M.value.selected.labels.dataLabels.bold?`bold`:``}`),class:g(M.value.selected.useMotion?`vue-ui-chestnut-animated`:``)},` ⬤ `,14,Ht)):f(``,!0),Mr(e)?(v(),p(`text`,{key:1,x:C(s)(e,!0).x,"text-anchor":C(s)(e,!0).anchor,y:C(se)(e),fill:M.value.selected.labels.dataLabels.color,"font-size":M.value.selected.labels.dataLabels.fontSize,style:_(`font-weight:${M.value.selected.labels.dataLabels.bold?`bold`:``}`),class:g(M.value.selected.useMotion?`vue-ui-chestnut-animated`:``)},S(H.value.breakdown[t].name),15,Ut)):f(``,!0)]))),256)),(v(!0),p(l,null,b(U.value,(e,t)=>(v(),p(`g`,null,[Mr(e)?(v(),p(`text`,{key:0,x:C(s)(e,!0).x,"text-anchor":C(s)(e).anchor,y:C(se)(e)+M.value.selected.labels.dataLabels.fontSize,fill:M.value.selected.labels.dataLabels.color,"font-size":M.value.selected.labels.dataLabels.fontSize,style:_(`font-weight:${M.value.selected.labels.dataLabels.bold?`bold`:``}`),class:g(M.value.selected.useMotion?`vue-ui-chestnut-animated`:``)},S(C(n)({v:H.value.breakdown[t].value/H.value.value*100,s:`%`,r:M.value.selected.labels.roundingPercentage}))+` `+S(k.value.translations.of)+` `+S(H.value.breakdown[t].branchName)+` `+S(C(c)(M.value.selected.labels.dataLabels.formatter,H.value.breakdown[t].value,C(n)({p:M.value.selected.labels.dataLabels.prefix,v:H.value.breakdown[t].value,s:M.value.selected.labels.dataLabels.suffix,r:M.value.selected.roundingValue}),{datapoint:U.value,seriesIndex:t})),15,Wt)):f(``,!0),Mr(e)?(v(),p(`text`,{key:1,x:C(s)(e,!0).x,"text-anchor":C(s)(e).anchor,y:C(se)(e)+M.value.selected.labels.dataLabels.fontSize*2,fill:M.value.selected.labels.dataLabels.color,"font-size":M.value.selected.labels.dataLabels.fontSize,style:_(`font-weight:${M.value.selected.labels.dataLabels.bold?`bold`:``}`),class:g(M.value.selected.useMotion?`vue-ui-chestnut-animated`:``)},S(C(n)({v:H.value.breakdown[t].proportionToRoot*100,s:`%`,r:M.value.selected.labels.roundingPercentage}))+` `+S(k.value.translations.of)+` `+S(H.value.breakdown[t].rootName),15,Gt)):f(``,!0),Mr(e)?(v(),p(`text`,{key:2,x:C(s)(e,!0).x,"text-anchor":C(s)(e).anchor,y:C(se)(e)+M.value.selected.labels.dataLabels.fontSize*3,fill:M.value.selected.labels.dataLabels.color,"font-size":M.value.selected.labels.dataLabels.fontSize,style:_(`font-weight:${M.value.selected.labels.dataLabels.bold?`bold`:``}`),class:g(M.value.selected.useMotion?`vue-ui-chestnut-animated`:``)},S(C(n)({v:H.value.breakdown[t].proportionToTree*100,s:`%`,r:M.value.selected.labels.roundingPercentage}))+` `+S(k.value.translations.proportionToTree),15,Kt)):f(``,!0)]))),256))])):f(``,!0),(v(!0),p(l,null,b(V.value,e=>(v(),p(`g`,null,[W.value&&W.value.id===e.id&&!H.value?(v(),p(`text`,{key:0,x:e.x1+6,y:e.y1+I.value.branchSize+24,"font-weight":`bold`,"text-anchor":`start`,"font-size":j.value.labels.dataLabels.fontSize,fill:j.value.labels.color,onClick:t[8]||=()=>{K(),$(),E.value=!1}},S(e.name)+`: `+S(C(c)(j.value.labels.dataLabels.formatter,e.value,C(n)({p:j.value.labels.dataLabels.prefix,v:e.value,s:j.value.labels.dataLabels.suffix,r:j.value.labels.dataLabels.roundingValue}),{datapoint:e})),9,qt)):f(``,!0),W.value&&W.value.id===e.id&&!H.value?(v(),p(`text`,{key:1,x:e.x1+6,y:e.y1+I.value.branchSize+48,"text-anchor":`start`,"font-size":j.value.labels.dataLabels.fontSize,fill:j.value.labels.color,onClick:t[9]||=()=>{K(),$(),E.value=!1}},S(C(n)({v:e.proportionToRoot*100,s:`%`,r:j.value.labels.dataLabels.roundingPercentage}))+` `+S(k.value.translations.of)+` `+S(e.rootName),9,Jt)):f(``,!0),W.value&&W.value.id===e.id&&!H.value?(v(),p(`text`,{key:2,x:e.x1+6,y:e.y1+I.value.branchSize+72,"text-anchor":`start`,"font-size":j.value.labels.dataLabels.fontSize,fill:j.value.labels.color,onClick:t[10]||=()=>{K(),$(),E.value=!1}},S(C(n)({v:e.value/R.value*100,s:`%`,r:j.value.labels.dataLabels.roundingPercentage}))+` `+S(k.value.translations.proportionToTree),9,Yt)):f(``,!0)]))),256)),x(e.$slots,`svg`,{svg:{...I.value,isPrintingImg:C(or)||C(sr)||C(Xr),isPrintingSvg:C(Zr)}},void 0,!0)],46,$e)):f(``,!0)]),e.$slots.watermark?(v(),p(`div`,Xt,[x(e.$slots,`watermark`,ze(Ie({isPrinting:C(or)||C(sr)||C(Xr)||C(Zr)})),void 0,!0)])):f(``,!0),x(e.$slots,`legend`,{legend:z.value},void 0,!0),e.$slots.source?(v(),p(`div`,Zt,[x(e.$slots,`source`,{},void 0,!0)],512)):f(``,!0),Kn.value&&k.value.userOptions.buttons.table?(v(),d(Ve(Hr.value.component),Le({key:6},Hr.value.props,{ref_key:`tableUnit`,ref:Yn,onClose:Wr}),Ne({content:Ge(()=>[m(`div`,{ref_key:`tableContainer`,ref:pr,class:`vue-ui-chestnut-table`,style:_(`${k.value.table.useDialog?``:`max-height: 300px;margin-top:24px`}`)},[m(`div`,{style:_(`${k.value.table.useDialog?``:`padding-top:36px;`}position: relative`)},[k.value.table.useDialog?f(``,!0):(v(),p(`div`,{key:0,role:`button`,tabindex:`0`,style:_(`width:32px; position: absolute; top: 0; left:4px; padding: 0 0px; display: flex; align-items:center;justify-content:center;height: 36px; width: 32px; cursor:${F.value?`pointer`:`default`}; background:${k.value.table.th.backgroundColor};`),onClick:Wr,onKeypress:Ke(Wr,[`enter`])},[h(C(zn),{name:`close`,stroke:k.value.table.th.color,"stroke-width":2},null,8,[`stroke`])],36)),m(`div`,{style:{width:`100%`},class:g({"vue-ui-responsive":C(Ur)})},[m(`table`,Qt,[k.value.table.useDialog?f(``,!0):(v(),p(`caption`,{key:0,style:_({backgroundColor:k.value.table.th.backgroundColor,color:k.value.table.th.color,outline:k.value.table.th.outline}),class:`vue-ui-data-table__caption`},[Pe(S(N.value.title.text)+` `,1),N.value.title.subtitle.text?(v(),p(`span`,$t,S(N.value.title.subtitle.text),1)):f(``,!0)],4)),m(`thead`,null,[m(`tr`,{role:`row`,style:_(`background:${k.value.table.th.backgroundColor};color:${k.value.table.th.color}`)},[(v(!0),p(l,null,b(Y.value.head,e=>(v(),p(`th`,{style:_(`outline:${k.value.table.th.outline}`)},S(e),5))),256))],4)]),m(`tbody`,null,[(v(!0),p(l,null,b(Y.value.body,(e,t)=>(v(),p(`tr`,{class:g({"vue-ui-data-table__tbody__row":!0,"vue-ui-data-table__tbody__row-even":t%2==0,"vue-ui-data-table__tbody__row-odd":t%2!=0}),style:_(`background:${k.value.table.td.backgroundColor};color:${k.value.table.td.color}`)},[m(`td`,{class:`vue-ui-data-table__tbody__td`,style:_(`outline:${k.value.table.td.outline}`),"data-cell":Y.value.head[0]},[m(`div`,tn,[Y.value.body[t-1]&&Y.value.body[t-1].rootName===e.rootName?(v(),p(`span`,nn)):(v(),p(`span`,rn,S(e.rootName),1))])],12,en),m(`td`,{class:`vue-ui-data-table__tbody__td`,style:_(`outline:${k.value.table.td.outline}`),"data-cell":Y.value.head[1]},[m(`div`,on,[Y.value.body[t-1]&&Y.value.body[t-1].rootName===e.rootName?(v(),p(`span`,sn)):(v(),p(`span`,cn,S(e.rootValue.toFixed(k.value.table.td.roundingValue)),1))])],12,an),m(`td`,{class:`vue-ui-data-table__tbody__td`,style:_(`outline:${k.value.table.td.outline}`),"data-cell":Y.value.head[2]},[m(`div`,un,[Y.value.body[t-1]&&Y.value.body[t-1].rootName===e.rootName?(v(),p(`span`,dn)):(v(),p(`span`,fn,S((e.rootToTotal*100).toFixed(k.value.table.td.roundingPercentage))+`% `,1))])],12,ln),m(`td`,{class:`vue-ui-data-table__tbody__td`,style:_(`outline:${k.value.table.td.outline}`),"data-cell":Y.value.head[3]},[m(`div`,mn,[Y.value.body[t-1]&&Y.value.body[t-1].branchName===e.branchName?(v(),p(`span`,hn)):(v(),p(`span`,gn,S(e.branchName),1))])],12,pn),m(`td`,{class:`vue-ui-data-table__tbody__td`,style:_(`outline:${k.value.table.td.outline}`),"data-cell":Y.value.head[4]},[m(`div`,vn,[Y.value.body[t-1]&&Y.value.body[t-1].branchName===e.branchName?(v(),p(`span`,yn)):(v(),p(`span`,bn,S(e.branchValue.toFixed(k.value.table.td.roundingValue)),1))])],12,_n),m(`td`,{class:`vue-ui-data-table__tbody__td`,style:_(`outline:${k.value.table.td.outline}`),"data-cell":Y.value.head[5]},[m(`div`,Sn,[Y.value.body[t-1]&&Y.value.body[t-1].branchName===e.branchName?(v(),p(`span`,Cn)):(v(),p(`span`,wn,S((e.branchToRoot*100).toFixed(k.value.table.td.roundingPercentage))+`% `,1))])],12,xn),m(`td`,{class:`vue-ui-data-table__tbody__td`,style:_(`outline:${k.value.table.td.outline}`),"data-cell":Y.value.head[6]},[m(`div`,En,[Y.value.body[t-1]&&Y.value.body[t-1].branchName===e.branchName?(v(),p(`span`,Dn)):(v(),p(`span`,On,S((e.branchToTotal*100).toFixed(k.value.table.td.roundingPercentage))+`% `,1))])],12,Tn),m(`td`,{class:`vue-ui-data-table__tbody__td`,style:_(`outline:${k.value.table.td.outline}`),"data-cell":Y.value.head[7]},[m(`div`,An,S(e.nutName),1)],12,kn),m(`td`,{class:`vue-ui-data-table__tbody__td`,style:_(`outline:${k.value.table.td.outline}`),"data-cell":Y.value.head[8]},[m(`div`,Mn,S(e.nutValue.toFixed(k.value.table.td.roundingValue)),1)],12,jn),m(`td`,{class:`vue-ui-data-table__tbody__td`,style:_(`outline:${k.value.table.td.outline}`),"data-cell":Y.value.head[9]},[m(`div`,Pn,S((e.nutToBranch*100).toFixed(k.value.table.td.roundingPercentage))+`% `,1)],12,Nn),m(`td`,{class:`vue-ui-data-table__tbody__td`,style:_(`outline:${k.value.table.td.outline}`),"data-cell":Y.value.head[10]},[m(`div`,In,S((e.nutToRoot*100).toFixed(k.value.table.td.roundingPercentage))+`% `,1)],12,Fn),m(`td`,{class:`vue-ui-data-table__tbody__td`,style:_(`outline:${k.value.table.td.outline}`),"data-cell":Y.value.head[11]},[m(`div`,Rn,S((e.nutToTotal*100).toFixed(k.value.table.td.roundingPercentage))+`% `,1)],12,Ln)],6))),256))])])],2)],4)],4)]),_:2},[k.value.table.useDialog?{name:`title`,fn:Ge(()=>[Pe(S(Hr.value.title),1)]),key:`0`}:void 0,k.value.table.useDialog?{name:`actions`,fn:Ge(()=>[m(`button`,{tabindex:`0`,class:`vue-ui-user-options-button`,onClick:t[11]||=e=>Pr(k.value.userOptions.callbacks.csv)},[h(C(zn),{name:`fileCsv`,stroke:Hr.value.props.color},null,8,[`stroke`])])]),key:`1`}:void 0]),1040)):f(``,!0),x(e.$slots,`skeleton`,{},()=>[C($n)?(v(),d(me,{key:0})):f(``,!0)],!0)],46,Je))}},[[`__scopeId`,`data-v-13f1d6df`]]);export{qe as n,zn as t};
@@ -1,4 +1,4 @@
1
- import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{t}from"./useConfig-D3ZfFSE5.js";import{$ as n,D as r,Ht as i,S as a,X as o,Y as s,at as c,i as ee,in as l,nt as te,r as ne,sn as re,t as ie,w as ae,yt as oe,zt as se}from"./lib-rPeBMZrn.js";import{n as ce,t as le}from"./BaseScanner-8NdoBs7B.js";import{n as ue}from"./useHints-C-TwxM0Y.js";import{t as de}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{n as fe}from"./resolveChartConfig-CIhClE5R.js";import{t as pe}from"./chartImage-DPGnEuYM.js";import{n as me}from"./Title-BliHuXfT.js";import{t as he}from"./useChartExport-BZts4KFb.js";import{n as ge,t as _e}from"./tableIntegration-CNoJ1CIY.js";import{n as ve,t as ye}from"./annotationSlots-RvQBEO9-.js";import{n as be,t as xe}from"./userOptionsSlots-DYuo-E5m.js";import{t as Se}from"./usePrinter-DVf3YcG5.js";import{t as Ce}from"./Shape-CRe8woTu.js";import{c as we}from"./canvas-lib-22VpOI4_.js";import{t as Te}from"./useResponsive-CENUxfEL.js";import{t as Ee}from"./A11yDataTable-DWNlWXzs.js";import{t as De}from"./useUserOptionState-CXlFnwPv.js";import{t as Oe}from"./useChartAccessibility-DOMuYJfm.js";import{t as ke}from"./Legend-DM0ClX3D.js";import{t as Ae}from"./vue_ui_chord-Fq6VBRT1.js";import{Fragment as u,Teleport as je,computed as d,createBlock as f,createCommentVNode as p,createElementBlock as m,createElementVNode as h,createSlots as Me,createTextVNode as Ne,createVNode as Pe,defineAsyncComponent as g,guardReactiveProps as Fe,mergeProps as Ie,nextTick as Le,normalizeClass as _,normalizeProps as Re,normalizeStyle as v,onBeforeUnmount as ze,onMounted as Be,openBlock as y,ref as b,renderList as x,renderSlot as S,resolveDynamicComponent as Ve,shallowRef as He,toDisplayString as C,toRefs as Ue,unref as w,useCssVars as We,watch as Ge,withCtx as T,withModifiers as Ke}from"vue";var qe=/* @__PURE__ */ e({default:()=>Tt}),Je=[`id`],Ye=[`id`],Xe=[`id`],Ze=[`xmlns`,`viewBox`,`aria-describedby`],Qe=[`width`,`height`],$e={key:1},et=[`id`,`d`],tt={key:2},nt=[`transform`],rt=[`d`,`fill`,`stroke`,`stroke-width`,`onMouseenter`,`onMouseleave`,`onClick`],it=[`d`,`fill`,`stroke`,`stroke-width`],at=[`d`,`fill`],ot=[`d`,`fill`,`stroke`,`stroke-width`,`onMouseenter`,`onClick`,`onMouseleave`],st=[`d`,`fill`,`stroke`,`stroke-width`],ct=[`d`,`fill`,`stroke`,`stroke-width`],lt=[`d`,`fill`,`stroke`,`stroke-width`],ut={key:0},dt=[`x1`,`y1`,`x2`,`y2`,`stroke`,`stroke-width`],ft=[`x1`,`y1`,`x2`,`y2`,`stroke`,`stroke-width`],pt=[`cx`,`cy`,`r`,`stroke`,`stroke-width`,`fill`],mt=[`transform`,`fill`,`text-anchor`,`font-size`,`font-weight`],ht={key:1},gt=[`font-size`,`font-weight`,`fill`],_t=[`href`],vt=[`transform`,`text-anchor`,`font-size`,`font-weight`,`fill`,`innerHTML`],yt={key:5,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`},xt=[`id`],St=[`onClick`],Ct={key:9,"data-dom-to-png-ignore":``,class:`reset-wrapper`},wt={style:{"text-align":`right`,width:`100%`}},Tt=/*#__PURE__*/ de({__name:`vue-ui-chord`,props:{dataset:{type:Object,default(){return{}}},config:{type:Object,default(){return{}}}},emits:[`selectLegend`,`selectGroup`,`selectRibbon`,`copyAlt`],setup(e,{expose:de,emit:qe}){We(e=>({bae8b2ea:e.slicerColor}));let Tt=g(()=>import(`./vue-ui-accordion-D4FHxzsL.js`).then(e=>e.n)),Et=g(()=>import(`./BaseIcon-fYK0iID8.js`).then(e=>e.n)),Dt=g(()=>import(`./DataTable-5Ug6gMAX.js`)),Ot=g(()=>import(`./PackageVersion-DWlHsdPa.js`).then(e=>e.t)),kt=g(()=>import(`./PenAndPaper-r50tK3S4.js`).then(e=>e.t)),At=g(()=>import(`./UserOptions-Em_JgDXM.js`).then(e=>e.n)),jt=g(()=>import(`./BaseDraggableDialog-9d30Yx8c.js`).then(e=>e.n)),{vue_ui_chord:Mt}=t(),E=e,Nt=qe,D=b(!!E.dataset&&Object.hasOwn(E.dataset,`matrix`)),O=b(o()),k=b(null),A=b(null),j=b(null),Pt=b(0),M=b(null),Ft=b(null),It=b(null),Lt=b(null),Rt=b(null),zt=b(0),Bt=b(0),Vt=b(0),Ht=b(!1),N=He(null),P=He(null),Ut=b(!1),Wt=b(null),Gt=b(null),F=b(`group`),I=b(null),Kt=b(!1),L=b(rn()),R=d(()=>L.value.style.chart.arcs),z=d(()=>L.value.style.chart.ribbons),B=d(()=>L.value.style.chart);ue({config:()=>L.value,dataset:()=>E.dataset,component:`VueUiChord`,rules:[{test:e=>e.matrix&&e.matrix.length>12,message:[`👀 The number of groups > 12, the chart might become hard to read. Consider:`,``,`▶️ Using broader groups to reduce their number.`]}]});let V=d(()=>L.value.userOptions.useCursorPointer),qt=d(()=>l({defaultConfig:{useCssAnimation:!1,userOptions:{show:!1},table:{show:!1},style:{chart:{backgroundColor:`#99999930`,legend:{backgroundColor:`transparent`},arcs:{stroke:`#6A6A6A`,labels:{show:!1}},ribbons:{stroke:`#6A6A6A`,underlayerOpacity:0,labels:{show:!1}}}}},userConfig:L.value.skeletonConfig??{}})),{loading:Jt,FINAL_DATASET:H,manualLoading:Yt}=ce({...Ue(E),FINAL_CONFIG:L,prepareConfig:rn,callback:()=>{Promise.resolve().then(async()=>{await Le(),W.value.showTable=L.value.table.show})},skeletonDataset:E.config?.skeletonDataset??{matrix:[[12e3,6e3,9e3,3e3],[2e3,1e4,2e3,6001],[8e3,1600,8e3,8001],[1e3,1e3,1e3,7001]],labels:[],colors:[`#DBDBDB`,`#C4C4C4`,`#ADADAD`,`#969696`]},skeletonConfig:l({defaultConfig:L.value,userConfig:qt.value})}),{userOptionsVisible:Xt,setUserOptionsVisibility:Zt,keepUserOptionState:Qt}=De({config:L.value}),{svgRef:U}=Oe({config:B.value.title}),{isPrinting:$t,isImaging:en,generatePdf:tn,generateImage:nn}=Se({elementId:`chord_${O.value}`,fileName:B.value.title.text||`vue-ui-chord`,options:L.value.userOptions.print}),W=b({showTable:L.value.table.show});function rn(){return fe(E.config,Mt,Ae)}Ge(()=>E.config,e=>{Jt.value||(L.value=rn()),Xt.value=!L.value.userOptions.showOnChartHover,on(),zt.value+=1,Bt.value+=1,Vt.value+=1,X.value=L.value.initialRotation,W.value.showTable=L.value.table.show},{deep:!0});let G=d(()=>L.value.debug);Ge(()=>E.dataset,()=>{an(),on(),zt.value+=1,Bt.value+=1,Vt.value+=1});function an(){if(se(E.dataset)){c({componentName:`VueUiChord`,type:`dataset`,debug:G.value}),D.value=!1,Yt.value=!0;return}let e=oe({datasetObject:E.dataset,requiredAttributes:[`matrix`]});if(e.length){G.value&&e.forEach(e=>{c({componentName:`VueUiChord`,type:`datasetAttribute`,property:e})}),D.value=!1,Yt.value=!0;return}let t=E.dataset.matrix;if(!Array.isArray(t)||t.length<2){G.value&&console.warn(`VueUiChord: dataset.matrix requires a minimum of 2 datapoints, for example:
1
+ import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{t}from"./useConfig-D3ZfFSE5.js";import{$ as n,D as r,Ht as i,S as a,X as o,Y as s,at as c,i as ee,in as l,nt as te,r as ne,sn as re,t as ie,w as ae,yt as oe,zt as se}from"./lib-rPeBMZrn.js";import{n as ce,t as le}from"./BaseScanner-8NdoBs7B.js";import{n as ue}from"./useHints-C-TwxM0Y.js";import{t as de}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{n as fe}from"./resolveChartConfig-CIhClE5R.js";import{t as pe}from"./chartImage-DPGnEuYM.js";import{n as me}from"./Title-BliHuXfT.js";import{t as he}from"./useChartExport-BZts4KFb.js";import{n as ge,t as _e}from"./tableIntegration-CNoJ1CIY.js";import{n as ve,t as ye}from"./annotationSlots-RvQBEO9-.js";import{n as be,t as xe}from"./userOptionsSlots-DYuo-E5m.js";import{t as Se}from"./usePrinter-DVf3YcG5.js";import{t as Ce}from"./Shape-CRe8woTu.js";import{c as we}from"./canvas-lib-22VpOI4_.js";import{t as Te}from"./useResponsive-CENUxfEL.js";import{t as Ee}from"./A11yDataTable-DWNlWXzs.js";import{t as De}from"./useUserOptionState-CXlFnwPv.js";import{t as Oe}from"./useChartAccessibility-DOMuYJfm.js";import{t as ke}from"./Legend-DM0ClX3D.js";import{t as Ae}from"./vue_ui_chord-Fq6VBRT1.js";import{Fragment as u,Teleport as je,computed as d,createBlock as f,createCommentVNode as p,createElementBlock as m,createElementVNode as h,createSlots as Me,createTextVNode as Ne,createVNode as Pe,defineAsyncComponent as g,guardReactiveProps as Fe,mergeProps as Ie,nextTick as Le,normalizeClass as _,normalizeProps as Re,normalizeStyle as v,onBeforeUnmount as ze,onMounted as Be,openBlock as y,ref as b,renderList as x,renderSlot as S,resolveDynamicComponent as Ve,shallowRef as He,toDisplayString as C,toRefs as Ue,unref as w,useCssVars as We,watch as Ge,withCtx as T,withModifiers as Ke}from"vue";var qe=/* @__PURE__ */ e({default:()=>Tt}),Je=[`id`],Ye=[`id`],Xe=[`id`],Ze=[`xmlns`,`viewBox`,`aria-describedby`],Qe=[`width`,`height`],$e={key:1},et=[`id`,`d`],tt={key:2},nt=[`transform`],rt=[`d`,`fill`,`stroke`,`stroke-width`,`onMouseenter`,`onMouseleave`,`onClick`],it=[`d`,`fill`,`stroke`,`stroke-width`],at=[`d`,`fill`],ot=[`d`,`fill`,`stroke`,`stroke-width`,`onMouseenter`,`onClick`,`onMouseleave`],st=[`d`,`fill`,`stroke`,`stroke-width`],ct=[`d`,`fill`,`stroke`,`stroke-width`],lt=[`d`,`fill`,`stroke`,`stroke-width`],ut={key:0},dt=[`x1`,`y1`,`x2`,`y2`,`stroke`,`stroke-width`],ft=[`x1`,`y1`,`x2`,`y2`,`stroke`,`stroke-width`],pt=[`cx`,`cy`,`r`,`stroke`,`stroke-width`,`fill`],mt=[`transform`,`fill`,`text-anchor`,`font-size`,`font-weight`],ht={key:1},gt=[`font-size`,`font-weight`,`fill`],_t=[`href`],vt=[`transform`,`text-anchor`,`font-size`,`font-weight`,`fill`,`innerHTML`],yt={key:5,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`},xt=[`id`],St=[`onClick`],Ct={key:9,"data-dom-to-png-ignore":``,class:`reset-wrapper`},wt={style:{"text-align":`right`,width:`100%`}},Tt=/*#__PURE__*/ de({__name:`vue-ui-chord`,props:{dataset:{type:Object,default(){return{}}},config:{type:Object,default(){return{}}}},emits:[`selectLegend`,`selectGroup`,`selectRibbon`,`copyAlt`],setup(e,{expose:de,emit:qe}){We(e=>({bae8b2ea:e.slicerColor}));let Tt=g(()=>import(`./vue-ui-accordion-D4FHxzsL.js`).then(e=>e.n)),Et=g(()=>import(`./BaseIcon-fYK0iID8.js`).then(e=>e.n)),Dt=g(()=>import(`./DataTable-5Ug6gMAX.js`)),Ot=g(()=>import(`./PackageVersion-u-p5bCcj.js`).then(e=>e.t)),kt=g(()=>import(`./PenAndPaper-r50tK3S4.js`).then(e=>e.t)),At=g(()=>import(`./UserOptions-Em_JgDXM.js`).then(e=>e.n)),jt=g(()=>import(`./BaseDraggableDialog-9d30Yx8c.js`).then(e=>e.n)),{vue_ui_chord:Mt}=t(),E=e,Nt=qe,D=b(!!E.dataset&&Object.hasOwn(E.dataset,`matrix`)),O=b(o()),k=b(null),A=b(null),j=b(null),Pt=b(0),M=b(null),Ft=b(null),It=b(null),Lt=b(null),Rt=b(null),zt=b(0),Bt=b(0),Vt=b(0),Ht=b(!1),N=He(null),P=He(null),Ut=b(!1),Wt=b(null),Gt=b(null),F=b(`group`),I=b(null),Kt=b(!1),L=b(rn()),R=d(()=>L.value.style.chart.arcs),z=d(()=>L.value.style.chart.ribbons),B=d(()=>L.value.style.chart);ue({config:()=>L.value,dataset:()=>E.dataset,component:`VueUiChord`,rules:[{test:e=>e.matrix&&e.matrix.length>12,message:[`👀 The number of groups > 12, the chart might become hard to read. Consider:`,``,`▶️ Using broader groups to reduce their number.`]}]});let V=d(()=>L.value.userOptions.useCursorPointer),qt=d(()=>l({defaultConfig:{useCssAnimation:!1,userOptions:{show:!1},table:{show:!1},style:{chart:{backgroundColor:`#99999930`,legend:{backgroundColor:`transparent`},arcs:{stroke:`#6A6A6A`,labels:{show:!1}},ribbons:{stroke:`#6A6A6A`,underlayerOpacity:0,labels:{show:!1}}}}},userConfig:L.value.skeletonConfig??{}})),{loading:Jt,FINAL_DATASET:H,manualLoading:Yt}=ce({...Ue(E),FINAL_CONFIG:L,prepareConfig:rn,callback:()=>{Promise.resolve().then(async()=>{await Le(),W.value.showTable=L.value.table.show})},skeletonDataset:E.config?.skeletonDataset??{matrix:[[12e3,6e3,9e3,3e3],[2e3,1e4,2e3,6001],[8e3,1600,8e3,8001],[1e3,1e3,1e3,7001]],labels:[],colors:[`#DBDBDB`,`#C4C4C4`,`#ADADAD`,`#969696`]},skeletonConfig:l({defaultConfig:L.value,userConfig:qt.value})}),{userOptionsVisible:Xt,setUserOptionsVisibility:Zt,keepUserOptionState:Qt}=De({config:L.value}),{svgRef:U}=Oe({config:B.value.title}),{isPrinting:$t,isImaging:en,generatePdf:tn,generateImage:nn}=Se({elementId:`chord_${O.value}`,fileName:B.value.title.text||`vue-ui-chord`,options:L.value.userOptions.print}),W=b({showTable:L.value.table.show});function rn(){return fe(E.config,Mt,Ae)}Ge(()=>E.config,e=>{Jt.value||(L.value=rn()),Xt.value=!L.value.userOptions.showOnChartHover,on(),zt.value+=1,Bt.value+=1,Vt.value+=1,X.value=L.value.initialRotation,W.value.showTable=L.value.table.show},{deep:!0});let G=d(()=>L.value.debug);Ge(()=>E.dataset,()=>{an(),on(),zt.value+=1,Bt.value+=1,Vt.value+=1});function an(){if(se(E.dataset)){c({componentName:`VueUiChord`,type:`dataset`,debug:G.value}),D.value=!1,Yt.value=!0;return}let e=oe({datasetObject:E.dataset,requiredAttributes:[`matrix`]});if(e.length){G.value&&e.forEach(e=>{c({componentName:`VueUiChord`,type:`datasetAttribute`,property:e})}),D.value=!1,Yt.value=!0;return}let t=E.dataset.matrix;if(!Array.isArray(t)||t.length<2){G.value&&console.warn(`VueUiChord: dataset.matrix requires a minimum of 2 datapoints, for example:
2
2
 
3
3
  matrix:[
4
4
  [1, 1],
@@ -1,4 +1,4 @@
1
- import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{t}from"./useConfig-D3ZfFSE5.js";import{$ as n,D as r,Dt as i,Ft as a,Ht as o,Q as s,S as c,X as l,Zt as u,at as d,i as f,in as p,nn as m,nt as ee,q as h,r as g,t as te,tn as ne,w as re,zt as ie}from"./lib-rPeBMZrn.js";import{n as ae,t as oe}from"./BaseScanner-8NdoBs7B.js";import{n as se,t as ce}from"./useHints-C-TwxM0Y.js";import{t as le}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{n as ue}from"./resolveChartConfig-CIhClE5R.js";import{t as de}from"./chartImage-DPGnEuYM.js";import{n as fe}from"./Title-BliHuXfT.js";import{t as pe}from"./useChartExport-BZts4KFb.js";import{t as me}from"./tableIntegration-CNoJ1CIY.js";import{n as he,t as ge}from"./annotationSlots-RvQBEO9-.js";import{n as _e,t as ve}from"./userOptionsSlots-DYuo-E5m.js";import{t as ye}from"./usePrinter-DVf3YcG5.js";import{t as be}from"./useTransitions-ChGGrtrv.js";import{c as xe}from"./canvas-lib-22VpOI4_.js";import{t as Se}from"./useResponsive-CENUxfEL.js";import{t as Ce}from"./DefGrad-DKMq1REY.js";import{t as we}from"./A11yDataTable-DWNlWXzs.js";import{t as Te}from"./useUserOptionState-CXlFnwPv.js";import{t as Ee}from"./useChartAccessibility-DOMuYJfm.js";import{n as De}from"./annotationViewport-X8fvs7pz.js";import{t as Oe}from"./usePanZoom-BdjP5Suc.js";import{t as ke}from"./vue_ui_circle_pack-CfXkXi7v.js";import{Fragment as _,computed as v,createBlock as y,createCommentVNode as b,createElementBlock as x,createElementVNode as S,createSlots as Ae,createTextVNode as je,createVNode as Me,defineAsyncComponent as C,guardReactiveProps as w,mergeProps as Ne,nextTick as Pe,normalizeClass as T,normalizeProps as E,normalizeStyle as Fe,onBeforeUnmount as Ie,onMounted as Le,openBlock as D,ref as O,renderList as k,renderSlot as A,resolveDynamicComponent as Re,toDisplayString as j,toRefs as ze,unref as M,useCssVars as Be,watch as Ve,withCtx as N}from"vue";function He(e,t=0){let n=e.reduce((e,{x:n,r})=>Math.min(e,n-r-t),1/0),r=e.reduce((e,{x:n,r})=>Math.max(e,n+r+t),-1/0),i=e.reduce((e,{y:n,r})=>Math.min(e,n-r-t),1/0),a=e.reduce((e,{y:n,r})=>Math.max(e,n+r+t),-1/0);return[n,i,r-n,a-i]}function Ue(e,t,n){let r=e._,i=e.next._,a=r.r+i.r,o=(r.x*i.r+i.x*r.r)/a,s=(r.y*i.r+i.y*r.r)/a;return Math.max(Math.abs(o*n),Math.abs(s*t))}function We(e,t,n){let r=Ue,i=e.length;if(!i)return e;e.sort((e,t)=>t.r-e.r);let a,o,s;if(a=e[0],a.x=0,a.y=0,!(i>1))return e;if(o=e[1],a.x=-o.r,o.x=a.r,o.y=0,!(i>2))return qe(e,n,t),e;Ge(o,a,s=e[2]),a=new et(a),o=new et(o),s=new et(s),a.next=s.previous=o,o.next=a.previous=s,s.next=o.previous=a;packLoop:for(let c=3;c<i;++c){Ge(a._,o._,s=e[c]),s=new et(s);let i=o.next,l=a.previous,u=o._.r,d=a._.r;do if(u<=d){if(Ke(i._,s._)){o=i,a.next=o,o.previous=a,--c;continue packLoop}u+=i._.r,i=i.next}else{if(Ke(l._,s._)){a=l,a.next=o,o.previous=a,--c;continue packLoop}d+=l._.r,l=l.previous}while(i!==l.next);s.previous=a,s.next=o,a.next=o.previous=o=s;let f=a,p=r(a,n,t),m=a.next;for(;m!==o;){let e=r(m,n,t);e<p&&(f=m,p=e),m=m.next}a=f,o=a.next}return qe(e,n,t),Xe(e,n,t),e}function Ge(e,t,n){let r=e.x-t.x,i=e.y-t.y,a=r*r+i*i;if(a){let o=(t.r+n.r)**2,s=(e.r+n.r)**2;if(o>s){let t=(a+s-o)/(2*a),c=Math.sqrt(Math.max(0,s/a-t*t));n.x=e.x-t*r-c*i,n.y=e.y-t*i+c*r}else{let e=(a+o-s)/(2*a),c=Math.sqrt(Math.max(0,o/a-e*e));n.x=t.x+e*r-c*i,n.y=t.y+e*i+c*r}}else n.x=t.x+n.r,n.y=t.y}function Ke(e,t){let n=e.r+t.r-1e-6,r=t.x-e.x,i=t.y-e.y;return n>0&&n*n>r*r+i*i}function qe(e,t,n){if(e.length<4)return;let r=e[0].r,i=e.findIndex(e=>e.r<r*.6),a=i===-1?Math.min(e.length,12):i,o=e.slice(0,Math.max(3,a));for(let t=0;t<80;t+=1){let t=!1;for(let n=0;n<o.length;n+=1){let r=o[n],i=.06*(1-n/Math.max(1,o.length)),a=r.x*(1-i),s=r.y*(1-i);Je(r,a,s,e,n)&&(r.x=a,r.y=s,t=!0)}if(Ye(o),!t)break}let s=o.reduce((e,t)=>e+t.x,0)/o.length,c=o.reduce((e,t)=>e+t.y,0)/o.length;for(let t of e)t.x-=s,t.y-=c}function Je(e,t,n,r){let i=e.x,a=e.y;e.x=t,e.y=n;for(let t of r)if(t!==e&&Ke(e,t))return e.x=i,e.y=a,!1;return e.x=i,e.y=a,!0}function Ye(e){for(let t=0;t<6;t+=1){let t=!1;for(let n=0;n<e.length-1;n+=1)for(let r=n+1;r<e.length;r+=1){let i=e[n],a=e[r],o=a.x-i.x,s=a.y-i.y,c=Math.sqrt(o*o+s*s)||1e-6,l=i.r+a.r;if(c<l){let e=(l-c)/2,n=o/c,r=s/c;i.x-=n*e,i.y-=r*e,a.x+=n*e,a.y+=r*e,t=!0}}if(!t)break}}function Xe(e,t,n){if(e.length<6)return;let r=e[0].r,i=e.findIndex(e=>e.r<=r*.45);if(i!==-1)for(let r=i;r<e.length;r+=1){let i=e[r],a=Ze(i,e.slice(0,r),t,n);a&&(i.x=a.x,i.y=a.y)}}function Ze(e,t,n,r){if(t.length<2)return null;let i=null,a=1/0;for(let o=0;o<t.length-1;o+=1)for(let s=o+1;s<t.length;s+=1){let c=t[o],l=t[s],u=Qe(c,l,e.r);for(let o of u){if(!o)continue;let s={...e,x:o.x,y:o.y};if(!P(s,t))continue;let c=$e(s,t,n,r);c<a&&(a=c,i=o)}}return i}function Qe(e,t,n){let r=e.r+n,i=t.r+n,a=t.x-e.x,o=t.y-e.y,s=a*a+o*o,c=Math.sqrt(s);if(!c||c>r+i||c<Math.abs(r-i))return[];let l=(r*r-i*i+s)/(2*c),u=r*r-l*l;if(u<0)return[];let d=Math.sqrt(u),f=a/c,p=o/c,m=e.x+l*f,ee=e.y+l*p,h=-p*d,g=f*d;return[{x:m+h,y:ee+g},{x:m-h,y:ee-g}]}function P(e,t){for(let n of t)if(Ke(n,e))return!1;return!0}function $e(e,t,n,r){let i=e.x/Math.max(1,n),a=e.y/Math.max(1,r),o=i*i+a*a,s=[];for(let n of t){let t=e.x-n.x,r=e.y-n.y,i=Math.sqrt(t*t+r*r)-(e.r+n.r);s.push(i)}s.sort((e,t)=>e-t);let c=s[0]??0,l=s[1]??c,u=s[2]??l;return c*8+l*4+u*2+o*e.r*12}var et=class{constructor(e){this._=e,this.next=null,this.previous=null}},tt=/* @__PURE__ */ e({default:()=>F}),nt=[`id`],rt=[`id`],it=[`xmlns`,`aria-describedby`,`viewBox`],at=[`x`,`y`,`width`,`height`],ot={key:0},st=[`x`,`y`,`width`,`height`,`stroke`,`stroke-width`,`fill`,`rx`,`onMouseenter`,`onMouseout`,`onClick`],ct=[`x`,`y`,`width`,`height`,`stroke`,`stroke-width`,`fill`,`rx`],lt=[`x`,`y`,`width`,`height`,`fill`,`rx`],ut=[`transform`,`font-size`,`fill`,`font-weight`],dt=[`transform`,`font-size`,`fill`,`font-weight`],ft={key:1,style:{pointerEvents:`none`}},pt=[`stroke`,`stroke-width`,`stroke-dasharray`,`opacity`,`d`],mt=[`x`,`y`,`width`,`height`,`rx`,`ry`,`fill`,`stroke`,`stroke-width`,`filter`],ht=[`fill`,`x`,`y`,`rx`,`width`,`height`],gt=[`transform`,`font-size`,`fill`,`font-family`],_t=[`dy`],vt={key:0,style:{position:`absolute`,top:`100%`,left:`0`,width:`100%`},"data-dom-to-png-ignore":``,"aria-hidden":`true`},yt={key:5,class:`vue-data-ui-watermark`},bt={key:6,"data-dom-to-png-ignore":``,class:`reset-wrapper`},xt={style:{display:`flex`,"align-items":`center`}},F=/*#__PURE__*/ le({__name:`vue-ui-circle-pack`,props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:[`selectDatapoint`,`copyAlt`],setup(e,{expose:le,emit:Ue}){Be(e=>({v293d4b64:mr.value}));let Ge=C(()=>import(`./Tooltip-C1q0Qoh7.js`)),Ke=C(()=>import(`./BaseIcon-fYK0iID8.js`).then(e=>e.n)),qe=C(()=>import(`./vue-ui-accordion-D4FHxzsL.js`).then(e=>e.n)),Je=C(()=>import(`./DataTable-5Ug6gMAX.js`)),Ye=C(()=>import(`./UserOptions-Em_JgDXM.js`).then(e=>e.n)),Xe=C(()=>import(`./PenAndPaper-r50tK3S4.js`).then(e=>e.t)),Ze=C(()=>import(`./PackageVersion-DWlHsdPa.js`).then(e=>e.t)),Qe=C(()=>import(`./BaseDraggableDialog-9d30Yx8c.js`).then(e=>e.n)),P=e,$e=Ue,{vue_ui_circle_pack:et}=t(),tt=v(()=>!!P.dataset&&P.dataset.length),F=O(l()),I=O(null),St=O(null),Ct=O(null),wt=O(0),Tt=O(0),Et=O(0),Dt=O(null),L=O(null),Ot=O(null),kt=O(!1),At=O(``),R=O(null),z=O(null),jt=O({x:0,y:0}),Mt=O(`pointer`),Nt=O(!1),B=O(Vt()),V=v(()=>B.value.style.chart.circles.labels),H=v(()=>B.value.style.chart.circles),U=v(()=>B.value.style.chart);se({config:()=>B.value,dataset:()=>P.dataset,component:`VueUiCirclePack`,rules:[ce.emptyArray,{test:e=>e.length===1&&(!e[0].children||e[0]?.children.length===0),message:[`👀 The dataset only has a single series. Consider:`,``,`▶️ Using a value display instead of a chart component, or using VueUiKpi.`]},{test:e=>e.length===1&&e[0]?.children&&e[0]?.children.length<6,message:[`👀 The number of datapoints is probably too low for this type of chart. Consider:`,``,`▶️ Using VueUiDonut or VueUiWaffle instead.`]}]});let{transitionEnabled:W}=be({config:()=>B.value.transitions,dataset:()=>P.dataset}),Pt=v(()=>B.value.userOptions.useCursorPointer),Ft=v(()=>p({defaultConfig:{userOptions:{show:!1},table:{show:!1},style:{chart:{backgroundColor:`#99999930`,circles:{stroke:`#6A6A6A`,labels:{name:{show:!1},value:{show:!1}}}}}},userConfig:B.value.skeletonConfig??{}})),{loading:It,FINAL_DATASET:Lt}=ae({...ze(P),FINAL_CONFIG:B,prepareConfig:Vt,skeletonDataset:P.config?.skeletonDataset??[{name:`_`,value:13,color:`#F2F2F2`},{name:`_`,value:8,color:`#DBDBDB`},{name:`_`,value:5,color:`#ADADAD`},{name:`_`,value:3,color:`#969696`},{name:`_`,value:2,color:`#808080`},{name:`_`,value:1,color:`#696969`}],skeletonConfig:p({defaultConfig:B.value,userConfig:Ft.value})}),{svgRef:G}=Ee({config:U.value.title}),{userOptionsVisible:Rt,setUserOptionsVisibility:zt,keepUserOptionState:Bt}=Te({config:B.value});function Vt(){return ue(P.config,et,ke)}let Ht=u(P.config);Ve(()=>P.config,(e,t)=>{let n=u(e),r=n!==Ht;Ht=n;let i=Vt();r?(B.value=i,Rt.value=!B.value.userOptions.showOnChartHover,fn(),wt.value+=1,Tt.value+=1,K.value.showTable=B.value.table.show,K.value.showTooltip=U.value.tooltip.show,K.value.showZoom=U.value.zoom?.show??!1):(B.value.style.chart.tooltip=i.style.chart.tooltip,K.value.showTooltip=B.value.style.chart.tooltip.show)},{deep:!0});let{isPrinting:Ut,isImaging:Wt,generatePdf:Gt,generateImage:Kt}=ye({elementId:`vue-ui-circle-pack_${F.value}`,fileName:U.value.title.text||`vue-ui-circle-pack`,options:B.value.userOptions.print}),qt=v(()=>B.value.userOptions.show&&!U.value.title.text),K=O({showTable:B.value.table.show,showTooltip:U.value.tooltip.show,showZoom:U.value.zoom?.show??!1});Ve(B,()=>{K.value={showTable:B.value.table.show,showTooltip:U.value.tooltip.show,showZoom:U.value.zoom?.show??!1}},{immediate:!0});let q=O({h:10,w:10}),Jt=O([0,0,100,100]),Yt=O({x:0,y:0,width:100,height:100}),Xt=v(()=>B.value.debug),Zt=v(()=>{let e=B.value.style?.chart||{};return e.dimensions&&typeof e.dimensions.width==`number`?e.dimensions.width:typeof e.width==`number`?e.width:300}),Qt=v(()=>{let e=B.value.style?.chart||{};return e.dimensions&&typeof e.dimensions.height==`number`?e.dimensions.height:typeof e.height==`number`?e.height:300}),J=O([]),Y=O([]),X=O(null),Z=O(null);function $t(e,t){q.value={w:e,h:t};let n=mn.value.map(en);if(!n.length){let n={x:0,y:0,width:e,height:t};J.value=[],Y.value=[],Jt.value=[n.x,n.y,n.width,n.height],Yt.value={...n},An(n);return}let r=We(n,t,e),[i,a,o,s]=He(r,1),c=Math.min(o?e/o:1,s?t/s:1),l=(e-o*c)/2,u=(t-s*c)/2,d=r.map(e=>({...e,x:(e.x-i)*c+l,y:(e.y-a)*c+u,r:e.r*c}));J.value=sn(d),Y.value=J.value;let f=Vn({x:0,y:0,width:e,height:t});Jt.value=[f.x,f.y,f.width,f.height],Yt.value={...f},An(f)}function en(e){return{...e,children:Array.isArray(e.children)?e.children.map(en):[]}}function tn(e){let t=Number(e?.value);return Number.isFinite(t)&&t>0?t:Array.isArray(e?.children)?e.children.reduce((e,t)=>e+tn(t),0):0}function nn(e,t){let n=m[B.value.theme||`default`]||o,r=pn.value.length?pn.value:n.length?n:o;return c(e.color)||r[t%r.length]||o[t%o.length]}function rn(e){return!Array.isArray(e.children)||!e.children.length?1:e.children.reduce((e,t)=>e+rn(t),0)}function an(e,t=null,n=0,r=[]){return Array.isArray(e)?e.map((e,i)=>{let a=tn(e);if(!Number.isFinite(a)||a<=0)return null;let o=l(),s=[...r,i],u=s.reduce((e,t,n)=>e+t+n,0),d=e.color||t?.color?c(e.color||t?.color):nn(e,u),f=an(e.children,{id:o,name:e.name,color:d,rootId:t?.rootId??o},n+1,s);return{...e,value:a,r:a,id:o,color:d,depth:n,parentId:t?.id??null,parentName:t?.name??null,rootId:t?.rootId??o,hasChildren:f.length>0,childCount:f.length,leafCount:f.length?rn({children:f}):1,hierarchyPath:s,children:f}}).filter(Boolean):[]}function on(e){if(!Array.isArray(e.children)||!e.children.length)return[];let t=e.r*2;if(!t)return[];let n=We(e.children.map(en),t,t),[r,i,a,o]=He(n,1),s=Math.min(a?t/a:1,o?t/o:1)*.9,c=a*s,l=o*s,u=e.x-c/2,d=e.y-l/2;return n.map(e=>({...e,x:(e.x-r)*s+u,y:(e.y-i)*s+d,r:e.r*s}))}function sn(e){let t=[];return e.forEach(e=>{let n=on(e);t.push({...e,children:n}),t.push(...sn(n))}),t}function cn(e,t){return!e||!t||!Array.isArray(e.hierarchyPath)||!Array.isArray(t.hierarchyPath)||e.hierarchyPath.length<=t.hierarchyPath.length?!1:t.hierarchyPath.every((t,n)=>e.hierarchyPath[n]===t)}function ln(e){return e.hasChildren?V.value.parents.show:V.value.children.show}function un(){if(!B.value.responsive||!I.value)return;let e=xe(()=>{let{width:e,height:t}=Se({chart:I.value,title:U.value.title.text?St.value:null,legend:null,source:Dt.value,noTitle:Ct.value});requestAnimationFrame(()=>{e&&t&&(G.value&&(G.value.setAttribute(`width`,e),G.value.setAttribute(`height`,t)),$t(e,t))})});X.value&&(Z.value&&X.value.unobserve(Z.value),X.value.disconnect()),X.value=new ResizeObserver(e),Z.value=I.value.parentNode||I.value,Z.value&&X.value.observe(Z.value),e()}function dn(){X.value&&(Z.value&&X.value.unobserve(Z.value),X.value.disconnect(),X.value=null,Z.value=null)}async function fn(){ie(P.dataset)&&d({componentName:`VueUiCirclePack`,type:`dataset`,debug:Xt.value});let e=Zt.value,t=Qt.value;$t(e,t),B.value.responsive?un():dn()}Le(fn),Ie(()=>{dn()}),Ve(()=>Lt.value,async e=>{await fn()},{deep:!0});let pn=v(()=>re(B.value.customPalette)),mn=v(()=>an(Lt.value)),hn=v(()=>J.value.length?Math.max(...J.value.map(e=>e.r)):0);function gn(e,t){return hn.value?t/hn.value*e:0}function _n(e,t){B.value.events.datapointLeave&&B.value.events.datapointLeave({datapoint:e,seriesIndex:t}),(Mt.value!==`keyboard`||R.value?.id!==e?.id)&&(kt.value=!1,R.value=null,z.value=null,Mt.value=`pointer`)}function vn(e,t){$e(`selectDatapoint`,e),B.value.events.datapointClick&&B.value.events.datapointClick({datapoint:e,seriesIndex:t})}let yn=O(null),bn=O(!1);function xn(e,t,n=`pointer`){R.value=e,z.value=t,Mt.value=n,B.value.events.datapointEnter&&B.value.events.datapointEnter({datapoint:e,seriesIndex:t}),yn.value={datapoint:e,seriesIndex:t,config:B.value,series:Y.value},kt.value=!0;let r=U.value.tooltip.customFormat;if(bn.value=!1,i(r))try{let n=r({seriesIndex:t,datapoint:e,series:Y.value,config:B.value});typeof n==`string`&&(At.value=n,bn.value=!0)}catch{console.warn(`Custom format cannot be applied.`),bn.value=!1}if(!bn.value){let t=``;t+=`
1
+ import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{t}from"./useConfig-D3ZfFSE5.js";import{$ as n,D as r,Dt as i,Ft as a,Ht as o,Q as s,S as c,X as l,Zt as u,at as d,i as f,in as p,nn as m,nt as ee,q as h,r as g,t as te,tn as ne,w as re,zt as ie}from"./lib-rPeBMZrn.js";import{n as ae,t as oe}from"./BaseScanner-8NdoBs7B.js";import{n as se,t as ce}from"./useHints-C-TwxM0Y.js";import{t as le}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{n as ue}from"./resolveChartConfig-CIhClE5R.js";import{t as de}from"./chartImage-DPGnEuYM.js";import{n as fe}from"./Title-BliHuXfT.js";import{t as pe}from"./useChartExport-BZts4KFb.js";import{t as me}from"./tableIntegration-CNoJ1CIY.js";import{n as he,t as ge}from"./annotationSlots-RvQBEO9-.js";import{n as _e,t as ve}from"./userOptionsSlots-DYuo-E5m.js";import{t as ye}from"./usePrinter-DVf3YcG5.js";import{t as be}from"./useTransitions-ChGGrtrv.js";import{c as xe}from"./canvas-lib-22VpOI4_.js";import{t as Se}from"./useResponsive-CENUxfEL.js";import{t as Ce}from"./DefGrad-DKMq1REY.js";import{t as we}from"./A11yDataTable-DWNlWXzs.js";import{t as Te}from"./useUserOptionState-CXlFnwPv.js";import{t as Ee}from"./useChartAccessibility-DOMuYJfm.js";import{n as De}from"./annotationViewport-X8fvs7pz.js";import{t as Oe}from"./usePanZoom-BdjP5Suc.js";import{t as ke}from"./vue_ui_circle_pack-CfXkXi7v.js";import{Fragment as _,computed as v,createBlock as y,createCommentVNode as b,createElementBlock as x,createElementVNode as S,createSlots as Ae,createTextVNode as je,createVNode as Me,defineAsyncComponent as C,guardReactiveProps as w,mergeProps as Ne,nextTick as Pe,normalizeClass as T,normalizeProps as E,normalizeStyle as Fe,onBeforeUnmount as Ie,onMounted as Le,openBlock as D,ref as O,renderList as k,renderSlot as A,resolveDynamicComponent as Re,toDisplayString as j,toRefs as ze,unref as M,useCssVars as Be,watch as Ve,withCtx as N}from"vue";function He(e,t=0){let n=e.reduce((e,{x:n,r})=>Math.min(e,n-r-t),1/0),r=e.reduce((e,{x:n,r})=>Math.max(e,n+r+t),-1/0),i=e.reduce((e,{y:n,r})=>Math.min(e,n-r-t),1/0),a=e.reduce((e,{y:n,r})=>Math.max(e,n+r+t),-1/0);return[n,i,r-n,a-i]}function Ue(e,t,n){let r=e._,i=e.next._,a=r.r+i.r,o=(r.x*i.r+i.x*r.r)/a,s=(r.y*i.r+i.y*r.r)/a;return Math.max(Math.abs(o*n),Math.abs(s*t))}function We(e,t,n){let r=Ue,i=e.length;if(!i)return e;e.sort((e,t)=>t.r-e.r);let a,o,s;if(a=e[0],a.x=0,a.y=0,!(i>1))return e;if(o=e[1],a.x=-o.r,o.x=a.r,o.y=0,!(i>2))return qe(e,n,t),e;Ge(o,a,s=e[2]),a=new et(a),o=new et(o),s=new et(s),a.next=s.previous=o,o.next=a.previous=s,s.next=o.previous=a;packLoop:for(let c=3;c<i;++c){Ge(a._,o._,s=e[c]),s=new et(s);let i=o.next,l=a.previous,u=o._.r,d=a._.r;do if(u<=d){if(Ke(i._,s._)){o=i,a.next=o,o.previous=a,--c;continue packLoop}u+=i._.r,i=i.next}else{if(Ke(l._,s._)){a=l,a.next=o,o.previous=a,--c;continue packLoop}d+=l._.r,l=l.previous}while(i!==l.next);s.previous=a,s.next=o,a.next=o.previous=o=s;let f=a,p=r(a,n,t),m=a.next;for(;m!==o;){let e=r(m,n,t);e<p&&(f=m,p=e),m=m.next}a=f,o=a.next}return qe(e,n,t),Xe(e,n,t),e}function Ge(e,t,n){let r=e.x-t.x,i=e.y-t.y,a=r*r+i*i;if(a){let o=(t.r+n.r)**2,s=(e.r+n.r)**2;if(o>s){let t=(a+s-o)/(2*a),c=Math.sqrt(Math.max(0,s/a-t*t));n.x=e.x-t*r-c*i,n.y=e.y-t*i+c*r}else{let e=(a+o-s)/(2*a),c=Math.sqrt(Math.max(0,o/a-e*e));n.x=t.x+e*r-c*i,n.y=t.y+e*i+c*r}}else n.x=t.x+n.r,n.y=t.y}function Ke(e,t){let n=e.r+t.r-1e-6,r=t.x-e.x,i=t.y-e.y;return n>0&&n*n>r*r+i*i}function qe(e,t,n){if(e.length<4)return;let r=e[0].r,i=e.findIndex(e=>e.r<r*.6),a=i===-1?Math.min(e.length,12):i,o=e.slice(0,Math.max(3,a));for(let t=0;t<80;t+=1){let t=!1;for(let n=0;n<o.length;n+=1){let r=o[n],i=.06*(1-n/Math.max(1,o.length)),a=r.x*(1-i),s=r.y*(1-i);Je(r,a,s,e,n)&&(r.x=a,r.y=s,t=!0)}if(Ye(o),!t)break}let s=o.reduce((e,t)=>e+t.x,0)/o.length,c=o.reduce((e,t)=>e+t.y,0)/o.length;for(let t of e)t.x-=s,t.y-=c}function Je(e,t,n,r){let i=e.x,a=e.y;e.x=t,e.y=n;for(let t of r)if(t!==e&&Ke(e,t))return e.x=i,e.y=a,!1;return e.x=i,e.y=a,!0}function Ye(e){for(let t=0;t<6;t+=1){let t=!1;for(let n=0;n<e.length-1;n+=1)for(let r=n+1;r<e.length;r+=1){let i=e[n],a=e[r],o=a.x-i.x,s=a.y-i.y,c=Math.sqrt(o*o+s*s)||1e-6,l=i.r+a.r;if(c<l){let e=(l-c)/2,n=o/c,r=s/c;i.x-=n*e,i.y-=r*e,a.x+=n*e,a.y+=r*e,t=!0}}if(!t)break}}function Xe(e,t,n){if(e.length<6)return;let r=e[0].r,i=e.findIndex(e=>e.r<=r*.45);if(i!==-1)for(let r=i;r<e.length;r+=1){let i=e[r],a=Ze(i,e.slice(0,r),t,n);a&&(i.x=a.x,i.y=a.y)}}function Ze(e,t,n,r){if(t.length<2)return null;let i=null,a=1/0;for(let o=0;o<t.length-1;o+=1)for(let s=o+1;s<t.length;s+=1){let c=t[o],l=t[s],u=Qe(c,l,e.r);for(let o of u){if(!o)continue;let s={...e,x:o.x,y:o.y};if(!P(s,t))continue;let c=$e(s,t,n,r);c<a&&(a=c,i=o)}}return i}function Qe(e,t,n){let r=e.r+n,i=t.r+n,a=t.x-e.x,o=t.y-e.y,s=a*a+o*o,c=Math.sqrt(s);if(!c||c>r+i||c<Math.abs(r-i))return[];let l=(r*r-i*i+s)/(2*c),u=r*r-l*l;if(u<0)return[];let d=Math.sqrt(u),f=a/c,p=o/c,m=e.x+l*f,ee=e.y+l*p,h=-p*d,g=f*d;return[{x:m+h,y:ee+g},{x:m-h,y:ee-g}]}function P(e,t){for(let n of t)if(Ke(n,e))return!1;return!0}function $e(e,t,n,r){let i=e.x/Math.max(1,n),a=e.y/Math.max(1,r),o=i*i+a*a,s=[];for(let n of t){let t=e.x-n.x,r=e.y-n.y,i=Math.sqrt(t*t+r*r)-(e.r+n.r);s.push(i)}s.sort((e,t)=>e-t);let c=s[0]??0,l=s[1]??c,u=s[2]??l;return c*8+l*4+u*2+o*e.r*12}var et=class{constructor(e){this._=e,this.next=null,this.previous=null}},tt=/* @__PURE__ */ e({default:()=>F}),nt=[`id`],rt=[`id`],it=[`xmlns`,`aria-describedby`,`viewBox`],at=[`x`,`y`,`width`,`height`],ot={key:0},st=[`x`,`y`,`width`,`height`,`stroke`,`stroke-width`,`fill`,`rx`,`onMouseenter`,`onMouseout`,`onClick`],ct=[`x`,`y`,`width`,`height`,`stroke`,`stroke-width`,`fill`,`rx`],lt=[`x`,`y`,`width`,`height`,`fill`,`rx`],ut=[`transform`,`font-size`,`fill`,`font-weight`],dt=[`transform`,`font-size`,`fill`,`font-weight`],ft={key:1,style:{pointerEvents:`none`}},pt=[`stroke`,`stroke-width`,`stroke-dasharray`,`opacity`,`d`],mt=[`x`,`y`,`width`,`height`,`rx`,`ry`,`fill`,`stroke`,`stroke-width`,`filter`],ht=[`fill`,`x`,`y`,`rx`,`width`,`height`],gt=[`transform`,`font-size`,`fill`,`font-family`],_t=[`dy`],vt={key:0,style:{position:`absolute`,top:`100%`,left:`0`,width:`100%`},"data-dom-to-png-ignore":``,"aria-hidden":`true`},yt={key:5,class:`vue-data-ui-watermark`},bt={key:6,"data-dom-to-png-ignore":``,class:`reset-wrapper`},xt={style:{display:`flex`,"align-items":`center`}},F=/*#__PURE__*/ le({__name:`vue-ui-circle-pack`,props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:[`selectDatapoint`,`copyAlt`],setup(e,{expose:le,emit:Ue}){Be(e=>({v293d4b64:mr.value}));let Ge=C(()=>import(`./Tooltip-C1q0Qoh7.js`)),Ke=C(()=>import(`./BaseIcon-fYK0iID8.js`).then(e=>e.n)),qe=C(()=>import(`./vue-ui-accordion-D4FHxzsL.js`).then(e=>e.n)),Je=C(()=>import(`./DataTable-5Ug6gMAX.js`)),Ye=C(()=>import(`./UserOptions-Em_JgDXM.js`).then(e=>e.n)),Xe=C(()=>import(`./PenAndPaper-r50tK3S4.js`).then(e=>e.t)),Ze=C(()=>import(`./PackageVersion-u-p5bCcj.js`).then(e=>e.t)),Qe=C(()=>import(`./BaseDraggableDialog-9d30Yx8c.js`).then(e=>e.n)),P=e,$e=Ue,{vue_ui_circle_pack:et}=t(),tt=v(()=>!!P.dataset&&P.dataset.length),F=O(l()),I=O(null),St=O(null),Ct=O(null),wt=O(0),Tt=O(0),Et=O(0),Dt=O(null),L=O(null),Ot=O(null),kt=O(!1),At=O(``),R=O(null),z=O(null),jt=O({x:0,y:0}),Mt=O(`pointer`),Nt=O(!1),B=O(Vt()),V=v(()=>B.value.style.chart.circles.labels),H=v(()=>B.value.style.chart.circles),U=v(()=>B.value.style.chart);se({config:()=>B.value,dataset:()=>P.dataset,component:`VueUiCirclePack`,rules:[ce.emptyArray,{test:e=>e.length===1&&(!e[0].children||e[0]?.children.length===0),message:[`👀 The dataset only has a single series. Consider:`,``,`▶️ Using a value display instead of a chart component, or using VueUiKpi.`]},{test:e=>e.length===1&&e[0]?.children&&e[0]?.children.length<6,message:[`👀 The number of datapoints is probably too low for this type of chart. Consider:`,``,`▶️ Using VueUiDonut or VueUiWaffle instead.`]}]});let{transitionEnabled:W}=be({config:()=>B.value.transitions,dataset:()=>P.dataset}),Pt=v(()=>B.value.userOptions.useCursorPointer),Ft=v(()=>p({defaultConfig:{userOptions:{show:!1},table:{show:!1},style:{chart:{backgroundColor:`#99999930`,circles:{stroke:`#6A6A6A`,labels:{name:{show:!1},value:{show:!1}}}}}},userConfig:B.value.skeletonConfig??{}})),{loading:It,FINAL_DATASET:Lt}=ae({...ze(P),FINAL_CONFIG:B,prepareConfig:Vt,skeletonDataset:P.config?.skeletonDataset??[{name:`_`,value:13,color:`#F2F2F2`},{name:`_`,value:8,color:`#DBDBDB`},{name:`_`,value:5,color:`#ADADAD`},{name:`_`,value:3,color:`#969696`},{name:`_`,value:2,color:`#808080`},{name:`_`,value:1,color:`#696969`}],skeletonConfig:p({defaultConfig:B.value,userConfig:Ft.value})}),{svgRef:G}=Ee({config:U.value.title}),{userOptionsVisible:Rt,setUserOptionsVisibility:zt,keepUserOptionState:Bt}=Te({config:B.value});function Vt(){return ue(P.config,et,ke)}let Ht=u(P.config);Ve(()=>P.config,(e,t)=>{let n=u(e),r=n!==Ht;Ht=n;let i=Vt();r?(B.value=i,Rt.value=!B.value.userOptions.showOnChartHover,fn(),wt.value+=1,Tt.value+=1,K.value.showTable=B.value.table.show,K.value.showTooltip=U.value.tooltip.show,K.value.showZoom=U.value.zoom?.show??!1):(B.value.style.chart.tooltip=i.style.chart.tooltip,K.value.showTooltip=B.value.style.chart.tooltip.show)},{deep:!0});let{isPrinting:Ut,isImaging:Wt,generatePdf:Gt,generateImage:Kt}=ye({elementId:`vue-ui-circle-pack_${F.value}`,fileName:U.value.title.text||`vue-ui-circle-pack`,options:B.value.userOptions.print}),qt=v(()=>B.value.userOptions.show&&!U.value.title.text),K=O({showTable:B.value.table.show,showTooltip:U.value.tooltip.show,showZoom:U.value.zoom?.show??!1});Ve(B,()=>{K.value={showTable:B.value.table.show,showTooltip:U.value.tooltip.show,showZoom:U.value.zoom?.show??!1}},{immediate:!0});let q=O({h:10,w:10}),Jt=O([0,0,100,100]),Yt=O({x:0,y:0,width:100,height:100}),Xt=v(()=>B.value.debug),Zt=v(()=>{let e=B.value.style?.chart||{};return e.dimensions&&typeof e.dimensions.width==`number`?e.dimensions.width:typeof e.width==`number`?e.width:300}),Qt=v(()=>{let e=B.value.style?.chart||{};return e.dimensions&&typeof e.dimensions.height==`number`?e.dimensions.height:typeof e.height==`number`?e.height:300}),J=O([]),Y=O([]),X=O(null),Z=O(null);function $t(e,t){q.value={w:e,h:t};let n=mn.value.map(en);if(!n.length){let n={x:0,y:0,width:e,height:t};J.value=[],Y.value=[],Jt.value=[n.x,n.y,n.width,n.height],Yt.value={...n},An(n);return}let r=We(n,t,e),[i,a,o,s]=He(r,1),c=Math.min(o?e/o:1,s?t/s:1),l=(e-o*c)/2,u=(t-s*c)/2,d=r.map(e=>({...e,x:(e.x-i)*c+l,y:(e.y-a)*c+u,r:e.r*c}));J.value=sn(d),Y.value=J.value;let f=Vn({x:0,y:0,width:e,height:t});Jt.value=[f.x,f.y,f.width,f.height],Yt.value={...f},An(f)}function en(e){return{...e,children:Array.isArray(e.children)?e.children.map(en):[]}}function tn(e){let t=Number(e?.value);return Number.isFinite(t)&&t>0?t:Array.isArray(e?.children)?e.children.reduce((e,t)=>e+tn(t),0):0}function nn(e,t){let n=m[B.value.theme||`default`]||o,r=pn.value.length?pn.value:n.length?n:o;return c(e.color)||r[t%r.length]||o[t%o.length]}function rn(e){return!Array.isArray(e.children)||!e.children.length?1:e.children.reduce((e,t)=>e+rn(t),0)}function an(e,t=null,n=0,r=[]){return Array.isArray(e)?e.map((e,i)=>{let a=tn(e);if(!Number.isFinite(a)||a<=0)return null;let o=l(),s=[...r,i],u=s.reduce((e,t,n)=>e+t+n,0),d=e.color||t?.color?c(e.color||t?.color):nn(e,u),f=an(e.children,{id:o,name:e.name,color:d,rootId:t?.rootId??o},n+1,s);return{...e,value:a,r:a,id:o,color:d,depth:n,parentId:t?.id??null,parentName:t?.name??null,rootId:t?.rootId??o,hasChildren:f.length>0,childCount:f.length,leafCount:f.length?rn({children:f}):1,hierarchyPath:s,children:f}}).filter(Boolean):[]}function on(e){if(!Array.isArray(e.children)||!e.children.length)return[];let t=e.r*2;if(!t)return[];let n=We(e.children.map(en),t,t),[r,i,a,o]=He(n,1),s=Math.min(a?t/a:1,o?t/o:1)*.9,c=a*s,l=o*s,u=e.x-c/2,d=e.y-l/2;return n.map(e=>({...e,x:(e.x-r)*s+u,y:(e.y-i)*s+d,r:e.r*s}))}function sn(e){let t=[];return e.forEach(e=>{let n=on(e);t.push({...e,children:n}),t.push(...sn(n))}),t}function cn(e,t){return!e||!t||!Array.isArray(e.hierarchyPath)||!Array.isArray(t.hierarchyPath)||e.hierarchyPath.length<=t.hierarchyPath.length?!1:t.hierarchyPath.every((t,n)=>e.hierarchyPath[n]===t)}function ln(e){return e.hasChildren?V.value.parents.show:V.value.children.show}function un(){if(!B.value.responsive||!I.value)return;let e=xe(()=>{let{width:e,height:t}=Se({chart:I.value,title:U.value.title.text?St.value:null,legend:null,source:Dt.value,noTitle:Ct.value});requestAnimationFrame(()=>{e&&t&&(G.value&&(G.value.setAttribute(`width`,e),G.value.setAttribute(`height`,t)),$t(e,t))})});X.value&&(Z.value&&X.value.unobserve(Z.value),X.value.disconnect()),X.value=new ResizeObserver(e),Z.value=I.value.parentNode||I.value,Z.value&&X.value.observe(Z.value),e()}function dn(){X.value&&(Z.value&&X.value.unobserve(Z.value),X.value.disconnect(),X.value=null,Z.value=null)}async function fn(){ie(P.dataset)&&d({componentName:`VueUiCirclePack`,type:`dataset`,debug:Xt.value});let e=Zt.value,t=Qt.value;$t(e,t),B.value.responsive?un():dn()}Le(fn),Ie(()=>{dn()}),Ve(()=>Lt.value,async e=>{await fn()},{deep:!0});let pn=v(()=>re(B.value.customPalette)),mn=v(()=>an(Lt.value)),hn=v(()=>J.value.length?Math.max(...J.value.map(e=>e.r)):0);function gn(e,t){return hn.value?t/hn.value*e:0}function _n(e,t){B.value.events.datapointLeave&&B.value.events.datapointLeave({datapoint:e,seriesIndex:t}),(Mt.value!==`keyboard`||R.value?.id!==e?.id)&&(kt.value=!1,R.value=null,z.value=null,Mt.value=`pointer`)}function vn(e,t){$e(`selectDatapoint`,e),B.value.events.datapointClick&&B.value.events.datapointClick({datapoint:e,seriesIndex:t})}let yn=O(null),bn=O(!1);function xn(e,t,n=`pointer`){R.value=e,z.value=t,Mt.value=n,B.value.events.datapointEnter&&B.value.events.datapointEnter({datapoint:e,seriesIndex:t}),yn.value={datapoint:e,seriesIndex:t,config:B.value,series:Y.value},kt.value=!0;let r=U.value.tooltip.customFormat;if(bn.value=!1,i(r))try{let n=r({seriesIndex:t,datapoint:e,series:Y.value,config:B.value});typeof n==`string`&&(At.value=n,bn.value=!0)}catch{console.warn(`Custom format cannot be applied.`),bn.value=!1}if(!bn.value){let t=``;t+=`
2
2
  <div style="display:flex;align-items:center;gap:4px;">
3
3
  <svg viewBox="0 0 10 10" height="${U.value.tooltip.fontSize}" width="${U.value.tooltip.fontSize}">
4
4
  <circle
@@ -1 +1 @@
1
- import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{t}from"./useConfig-D3ZfFSE5.js";import{Jt as ee,X as n,t as te}from"./lib-rPeBMZrn.js";import{t as r}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{t as i}from"./useNestedProp-DnGoh-XS.js";import{n as a}from"./PackageVersion-DWlHsdPa.js";import{Teleport as o,computed as s,createBlock as ne,createCommentVNode as c,createElementBlock as l,createElementVNode as u,createVNode as d,nextTick as f,normalizeClass as p,normalizeStyle as m,onBeforeUnmount as h,onMounted as g,openBlock as _,ref as v,toDisplayString as y,unref as b}from"vue";var x=/* @__PURE__ */ e({default:()=>R}),re=[`xmlns`,`height`,`width`],ie={id:`follower`,fy:`30%`,fx:`30%`},ae=[`stop-color`,`stop-opacity`],oe=[`r`,`fill`,`stroke`,`stroke-width`,`stroke-dasharray`],se=[`r`],S={key:2,class:`wave`},C=[`id`],w=[`id`],T=[`filter`,`stroke`],E={key:3,class:`crosshair`},D=[`x1`,`stroke`,`stroke-width`,`stroke-dasharray`],O=[`x1`,`stroke`,`stroke-width`,`stroke-dasharray`],k=[`y1`,`stroke`,`stroke-width`,`stroke-dasharray`],A=[`y1`,`stroke`,`stroke-width`,`stroke-dasharray`],j=[`cy`,`r`,`fill`],M=[`cy`,`r`,`fill`],N=[`cx`,`r`,`fill`],P=[`cx`,`r`,`fill`],F={key:5,class:`coordinates`},I=[`x`,`y`,`font-size`,`fill`],L=[`transform`],ce=[`font-size`,`fill`],R=/*#__PURE__*/ r({__name:`vue-ui-cursor`,props:{config:{type:Object,default:{}}},setup(e){let{vue_ui_cursor:r}=t(),x=e,R=v(n()),z=s(()=>i({userConfig:x.config,defaultConfig:r})),B=v({x:-100,y:-100}),V=s(()=>Math.round(z.value.centerCircleRadius)),H=s(()=>Math.round(z.value.coordinatesOffset));function U({clientX:e,clientY:t,...ee}){B.value.x=e-V.value,B.value.y=t-V.value}function W(e){B.value.x=e.targetTouches[0].clientX-V.value,B.value.y=e.targetTouches[0].clientY-V.value}let G=v(!0);function K(e){G.value=e}let q=v(!1),J=v(null);function Y(){q.value=!1,J.value&&clearTimeout(J.value),f(()=>{q.value=!0,J.value=setTimeout(()=>{q.value=!1},1e3)})}let X=v(null),Z=v(null);function Q(){return z.value.parentId?document.getElementById(z.value.parentId):document.getElementsByTagName(`div`)[0]||null}function $(e){e&&(e.addEventListener(`mousemove`,U),e.addEventListener(`touchmove`,W),e.addEventListener(`mouseleave`,()=>K(!1)),e.addEventListener(`mouseenter`,()=>K(!0)),e.addEventListener(`click`,Y))}function le(e){e&&(e.removeEventListener(`mousemove`,U),e.removeEventListener(`touchmove`,W),e.removeEventListener(`mouseleave`,()=>K(!1)),e.removeEventListener(`mouseenter`,()=>K(!0)),e.removeEventListener(`click`,Y))}return g(()=>{let e=Q();if(e){X.value=e,$(e);return}if(!z.value.parentId)return;let t=new MutationObserver(()=>{let e=Q();e&&(X.value=e,$(e),t.disconnect(),Z.value=null)});t.observe(document.body,{childList:!0,subtree:!0}),Z.value=t}),h(()=>{Z.value&&=(Z.value.disconnect(),null),X.value&&=(le(X.value),null)}),(e,t)=>(_(),ne(o,{to:`body`},[G.value?(_(),l(`svg`,{key:0,"data-dom-to-png-ignore":``,xmlns:b(te),style:m(`z-index: 2147483647; overflow: visible; pointer-events: none;background: transparent; position:fixed; top:${B.value.y}px; left:${B.value.x}px;`),viewBox:`0 0 100 100`,height:V.value*2,width:V.value*2},[d(a),u(`defs`,null,[u(`radialGradient`,ie,[u(`stop`,{offset:`10%`,"stop-color":z.value.bubbleEffectColor,"stop-opacity":z.value.bubbleEffectOpacity},null,8,ae),t[0]||=u(`stop`,{offset:`95%`,"stop-color":`transparent`},null,-1)])]),z.value.showCenterCircle?(_(),l(`circle`,{key:0,cx:50,cy:50,r:V.value,fill:b(ee)(z.value.centerCircleColor,z.value.centerCircleOpacity*100),stroke:z.value.centerCircleStroke,"stroke-width":z.value.centerCircleStrokeWidth,"stroke-dasharray":z.value.centerCircleDasharray},null,8,oe)):c(``,!0),z.value.bubbleEffect?(_(),l(`circle`,{key:1,cx:50,cy:50,r:V.value,fill:`url(#follower)`,stroke:`none`},null,8,se)):c(``,!0),z.value.useWaveOnClick?(_(),l(`g`,S,[u(`defs`,null,[u(`filter`,{id:`blur_${R.value}`,x:`-50%`,y:`-50%`,width:`200%`,height:`200%`},[u(`feGaussianBlur`,{in:`SourceGraphic`,stdDeviation:4,id:`blur_std_${R.value}`},null,8,w),t[1]||=u(`feColorMatrix`,{type:`saturate`,values:`0`},null,-1)],8,C)]),q.value?(_(),l(`circle`,{key:0,class:p({"circle-wave":q.value}),cx:50,cy:50,r:50,filter:`url(#blur_${R.value})`,stroke:z.value.centerCircleStroke,fill:`none`,"stroke-width":`3`},null,10,T)):c(``,!0)])):c(``,!0),z.value.showCrosshair?(_(),l(`g`,E,[u(`line`,{x1:-V.value+50,x2:-5e3,y1:50,y2:50,stroke:z.value.crosshairStroke,"stroke-width":z.value.crosshairStrokeWidth,"stroke-dasharray":z.value.crosshairDasharray,"stroke-linecap":`round`},null,8,D),u(`line`,{x1:50+V.value,x2:5e3,y1:50,y2:50,stroke:z.value.crosshairStroke,"stroke-width":z.value.crosshairStrokeWidth,"stroke-dasharray":z.value.crosshairDasharray,"stroke-linecap":`round`},null,8,O),u(`line`,{x1:50,x2:50,y1:-V.value+50,y2:-5e3,stroke:z.value.crosshairStroke,"stroke-width":z.value.crosshairStrokeWidth,"stroke-dasharray":z.value.crosshairDasharray,"stroke-linecap":`round`},null,8,k),u(`line`,{x1:50,x2:50,y1:V.value+50,y2:5e3,stroke:z.value.crosshairStroke,"stroke-width":z.value.crosshairStrokeWidth,"stroke-dasharray":z.value.crosshairDasharray,"stroke-linecap":`round`},null,8,A)])):c(``,!0),z.value.showIntersectCircles?(_(),l(`g`,{key:4,class:p({"rotating-circles":z.value.isLoading})},[u(`circle`,{cx:50,cy:V.value+50,r:z.value.intersectCirclesRadius,fill:z.value.intersectCirclesFill},null,8,j),u(`circle`,{cx:50,cy:-V.value+50,r:z.value.intersectCirclesRadius,fill:z.value.intersectCirclesFill},null,8,M),u(`circle`,{cx:-V.value+50,cy:50,r:z.value.intersectCirclesRadius,fill:z.value.intersectCirclesFill},null,8,N),u(`circle`,{cx:V.value+50,cy:50,r:z.value.intersectCirclesRadius,fill:z.value.intersectCirclesFill},null,8,P)],2)):c(``,!0),z.value.showCoordinates?(_(),l(`g`,F,[u(`text`,{"text-anchor":`end`,x:-V.value+50-z.value.coordinatesFontSize/2+H.value,y:50-z.value.coordinatesFontSize/2+H.value,"font-size":z.value.coordinatesFontSize,fill:z.value.coordinatesColor,style:{"font-variant-numeric":`tabular-nums`},"font-family":`Arial`},y(B.value.x.toFixed(0)),9,I),u(`g`,{transform:`translate(${50-z.value.coordinatesFontSize/2+H.value}, ${-V.value+50-z.value.coordinatesFontSize/2+H.value})`},[u(`text`,{"text-anchor":`start`,"font-size":z.value.coordinatesFontSize,fill:z.value.coordinatesColor,style:{"font-variant-numeric":`tabular-nums`},transform:`rotate(-90)`,"font-family":`Arial`},y(B.value.y.toFixed(0)),9,ce)],8,L)])):c(``,!0)],12,re)):c(``,!0)]))}},[[`__scopeId`,`data-v-4b1f566e`]]);export{x as n,R as t};
1
+ import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{t}from"./useConfig-D3ZfFSE5.js";import{Jt as ee,X as n,t as te}from"./lib-rPeBMZrn.js";import{t as r}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{t as i}from"./useNestedProp-DnGoh-XS.js";import{n as a}from"./PackageVersion-u-p5bCcj.js";import{Teleport as o,computed as s,createBlock as ne,createCommentVNode as c,createElementBlock as l,createElementVNode as u,createVNode as d,nextTick as f,normalizeClass as p,normalizeStyle as m,onBeforeUnmount as h,onMounted as g,openBlock as _,ref as v,toDisplayString as y,unref as b}from"vue";var x=/* @__PURE__ */ e({default:()=>R}),re=[`xmlns`,`height`,`width`],ie={id:`follower`,fy:`30%`,fx:`30%`},ae=[`stop-color`,`stop-opacity`],oe=[`r`,`fill`,`stroke`,`stroke-width`,`stroke-dasharray`],se=[`r`],S={key:2,class:`wave`},C=[`id`],w=[`id`],T=[`filter`,`stroke`],E={key:3,class:`crosshair`},D=[`x1`,`stroke`,`stroke-width`,`stroke-dasharray`],O=[`x1`,`stroke`,`stroke-width`,`stroke-dasharray`],k=[`y1`,`stroke`,`stroke-width`,`stroke-dasharray`],A=[`y1`,`stroke`,`stroke-width`,`stroke-dasharray`],j=[`cy`,`r`,`fill`],M=[`cy`,`r`,`fill`],N=[`cx`,`r`,`fill`],P=[`cx`,`r`,`fill`],F={key:5,class:`coordinates`},I=[`x`,`y`,`font-size`,`fill`],L=[`transform`],ce=[`font-size`,`fill`],R=/*#__PURE__*/ r({__name:`vue-ui-cursor`,props:{config:{type:Object,default:{}}},setup(e){let{vue_ui_cursor:r}=t(),x=e,R=v(n()),z=s(()=>i({userConfig:x.config,defaultConfig:r})),B=v({x:-100,y:-100}),V=s(()=>Math.round(z.value.centerCircleRadius)),H=s(()=>Math.round(z.value.coordinatesOffset));function U({clientX:e,clientY:t,...ee}){B.value.x=e-V.value,B.value.y=t-V.value}function W(e){B.value.x=e.targetTouches[0].clientX-V.value,B.value.y=e.targetTouches[0].clientY-V.value}let G=v(!0);function K(e){G.value=e}let q=v(!1),J=v(null);function Y(){q.value=!1,J.value&&clearTimeout(J.value),f(()=>{q.value=!0,J.value=setTimeout(()=>{q.value=!1},1e3)})}let X=v(null),Z=v(null);function Q(){return z.value.parentId?document.getElementById(z.value.parentId):document.getElementsByTagName(`div`)[0]||null}function $(e){e&&(e.addEventListener(`mousemove`,U),e.addEventListener(`touchmove`,W),e.addEventListener(`mouseleave`,()=>K(!1)),e.addEventListener(`mouseenter`,()=>K(!0)),e.addEventListener(`click`,Y))}function le(e){e&&(e.removeEventListener(`mousemove`,U),e.removeEventListener(`touchmove`,W),e.removeEventListener(`mouseleave`,()=>K(!1)),e.removeEventListener(`mouseenter`,()=>K(!0)),e.removeEventListener(`click`,Y))}return g(()=>{let e=Q();if(e){X.value=e,$(e);return}if(!z.value.parentId)return;let t=new MutationObserver(()=>{let e=Q();e&&(X.value=e,$(e),t.disconnect(),Z.value=null)});t.observe(document.body,{childList:!0,subtree:!0}),Z.value=t}),h(()=>{Z.value&&=(Z.value.disconnect(),null),X.value&&=(le(X.value),null)}),(e,t)=>(_(),ne(o,{to:`body`},[G.value?(_(),l(`svg`,{key:0,"data-dom-to-png-ignore":``,xmlns:b(te),style:m(`z-index: 2147483647; overflow: visible; pointer-events: none;background: transparent; position:fixed; top:${B.value.y}px; left:${B.value.x}px;`),viewBox:`0 0 100 100`,height:V.value*2,width:V.value*2},[d(a),u(`defs`,null,[u(`radialGradient`,ie,[u(`stop`,{offset:`10%`,"stop-color":z.value.bubbleEffectColor,"stop-opacity":z.value.bubbleEffectOpacity},null,8,ae),t[0]||=u(`stop`,{offset:`95%`,"stop-color":`transparent`},null,-1)])]),z.value.showCenterCircle?(_(),l(`circle`,{key:0,cx:50,cy:50,r:V.value,fill:b(ee)(z.value.centerCircleColor,z.value.centerCircleOpacity*100),stroke:z.value.centerCircleStroke,"stroke-width":z.value.centerCircleStrokeWidth,"stroke-dasharray":z.value.centerCircleDasharray},null,8,oe)):c(``,!0),z.value.bubbleEffect?(_(),l(`circle`,{key:1,cx:50,cy:50,r:V.value,fill:`url(#follower)`,stroke:`none`},null,8,se)):c(``,!0),z.value.useWaveOnClick?(_(),l(`g`,S,[u(`defs`,null,[u(`filter`,{id:`blur_${R.value}`,x:`-50%`,y:`-50%`,width:`200%`,height:`200%`},[u(`feGaussianBlur`,{in:`SourceGraphic`,stdDeviation:4,id:`blur_std_${R.value}`},null,8,w),t[1]||=u(`feColorMatrix`,{type:`saturate`,values:`0`},null,-1)],8,C)]),q.value?(_(),l(`circle`,{key:0,class:p({"circle-wave":q.value}),cx:50,cy:50,r:50,filter:`url(#blur_${R.value})`,stroke:z.value.centerCircleStroke,fill:`none`,"stroke-width":`3`},null,10,T)):c(``,!0)])):c(``,!0),z.value.showCrosshair?(_(),l(`g`,E,[u(`line`,{x1:-V.value+50,x2:-5e3,y1:50,y2:50,stroke:z.value.crosshairStroke,"stroke-width":z.value.crosshairStrokeWidth,"stroke-dasharray":z.value.crosshairDasharray,"stroke-linecap":`round`},null,8,D),u(`line`,{x1:50+V.value,x2:5e3,y1:50,y2:50,stroke:z.value.crosshairStroke,"stroke-width":z.value.crosshairStrokeWidth,"stroke-dasharray":z.value.crosshairDasharray,"stroke-linecap":`round`},null,8,O),u(`line`,{x1:50,x2:50,y1:-V.value+50,y2:-5e3,stroke:z.value.crosshairStroke,"stroke-width":z.value.crosshairStrokeWidth,"stroke-dasharray":z.value.crosshairDasharray,"stroke-linecap":`round`},null,8,k),u(`line`,{x1:50,x2:50,y1:V.value+50,y2:5e3,stroke:z.value.crosshairStroke,"stroke-width":z.value.crosshairStrokeWidth,"stroke-dasharray":z.value.crosshairDasharray,"stroke-linecap":`round`},null,8,A)])):c(``,!0),z.value.showIntersectCircles?(_(),l(`g`,{key:4,class:p({"rotating-circles":z.value.isLoading})},[u(`circle`,{cx:50,cy:V.value+50,r:z.value.intersectCirclesRadius,fill:z.value.intersectCirclesFill},null,8,j),u(`circle`,{cx:50,cy:-V.value+50,r:z.value.intersectCirclesRadius,fill:z.value.intersectCirclesFill},null,8,M),u(`circle`,{cx:-V.value+50,cy:50,r:z.value.intersectCirclesRadius,fill:z.value.intersectCirclesFill},null,8,N),u(`circle`,{cx:V.value+50,cy:50,r:z.value.intersectCirclesRadius,fill:z.value.intersectCirclesFill},null,8,P)],2)):c(``,!0),z.value.showCoordinates?(_(),l(`g`,F,[u(`text`,{"text-anchor":`end`,x:-V.value+50-z.value.coordinatesFontSize/2+H.value,y:50-z.value.coordinatesFontSize/2+H.value,"font-size":z.value.coordinatesFontSize,fill:z.value.coordinatesColor,style:{"font-variant-numeric":`tabular-nums`},"font-family":`Arial`},y(B.value.x.toFixed(0)),9,I),u(`g`,{transform:`translate(${50-z.value.coordinatesFontSize/2+H.value}, ${-V.value+50-z.value.coordinatesFontSize/2+H.value})`},[u(`text`,{"text-anchor":`start`,"font-size":z.value.coordinatesFontSize,fill:z.value.coordinatesColor,style:{"font-variant-numeric":`tabular-nums`},transform:`rotate(-90)`,"font-family":`Arial`},y(B.value.y.toFixed(0)),9,ce)],8,L)])):c(``,!0)],12,re)):c(``,!0)]))}},[[`__scopeId`,`data-v-4b1f566e`]]);export{x as n,R as t};