vue-data-ui 3.28.1 → 3.28.2

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 (138) hide show
  1. package/dist/{PackageVersion-C4ZM3Vf7.js → PackageVersion-BIhjLNBU.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/package-DwcKiXuI.js +1 -0
  65. package/dist/{render-common-CJz0wn0I.js → render-common-B-s2XJ_I.js} +1 -1
  66. package/dist/ssr/vue-ui-donut.js +1 -1
  67. package/dist/ssr/vue-ui-xy.js +1 -1
  68. package/dist/ssr.js +1 -1
  69. package/dist/style.css.d.ts +2 -0
  70. package/dist/style.d.css.ts +2 -0
  71. package/dist/vue-data-ui-BvHCscNE.js +1 -0
  72. package/dist/vue-data-ui.js +1 -1
  73. package/dist/{vue-ui-3d-bar-CW8ahywt.js → vue-ui-3d-bar-CkHFiFp4.js} +1 -1
  74. package/dist/{vue-ui-age-pyramid-CxMwKICA.js → vue-ui-age-pyramid-vpIjdLg5.js} +1 -1
  75. package/dist/{vue-ui-bullet-ClnewIWQ.js → vue-ui-bullet-rgxGRR1p.js} +1 -1
  76. package/dist/{vue-ui-bump-C6FuNDUg.js → vue-ui-bump-CeDsunDi.js} +1 -1
  77. package/dist/{vue-ui-candlestick-CyewIjJk.js → vue-ui-candlestick-KJHOS5F7.js} +1 -1
  78. package/dist/{vue-ui-carousel-table-D0dD4kai.js → vue-ui-carousel-table-CeI5SIxH.js} +1 -1
  79. package/dist/{vue-ui-chestnut-nS1vjCqH.js → vue-ui-chestnut-CiY-2e77.js} +1 -1
  80. package/dist/{vue-ui-chord-B963Q_26.js → vue-ui-chord-8rk7304-.js} +1 -1
  81. package/dist/{vue-ui-circle-pack-DEY9X3jA.js → vue-ui-circle-pack-BsH09EPG.js} +1 -1
  82. package/dist/{vue-ui-cursor-CNv12HQG.js → vue-ui-cursor-Cpov2m58.js} +1 -1
  83. package/dist/{vue-ui-dag-s3-TMmid.js → vue-ui-dag-BHFL2cUA.js} +1 -1
  84. package/dist/{vue-ui-dashboard-B5zrGAvS.js → vue-ui-dashboard-BxXdhdNJ.js} +1 -1
  85. package/dist/{vue-ui-digits-DXQwmTUx.js → vue-ui-digits-xHOLjA2_.js} +1 -1
  86. package/dist/{vue-ui-donut-DHfOfLBF.js → vue-ui-donut-CR3klUbX.js} +1 -1
  87. package/dist/{vue-ui-donut-CDryub1L.js → vue-ui-donut-Vbp5Xs2-.js} +1 -1
  88. package/dist/{vue-ui-donut-evolution-C5pHSrza.js → vue-ui-donut-evolution-BTmztL3Y.js} +1 -1
  89. package/dist/{vue-ui-dumbbell-CQbGR7yM.js → vue-ui-dumbbell-CDcgKS2A.js} +1 -1
  90. package/dist/{vue-ui-flow-B16Mj6MW.js → vue-ui-flow-kVocPE27.js} +1 -1
  91. package/dist/{vue-ui-funnel-Dh-xi_Qi.js → vue-ui-funnel-CZAdPYqK.js} +1 -1
  92. package/dist/{vue-ui-galaxy-U_ZIP5vm.js → vue-ui-galaxy-hP-9mVlB.js} +1 -1
  93. package/dist/{vue-ui-gauge-Dr4zsf6D.js → vue-ui-gauge-BRabsLkh.js} +1 -1
  94. package/dist/{vue-ui-geo-DFebja0s.js → vue-ui-geo-Dacnp6iw.js} +1 -1
  95. package/dist/{vue-ui-gizmo-CssVcz-O.js → vue-ui-gizmo-Dp3hpHIX.js} +1 -1
  96. package/dist/{vue-ui-graph-BB_97Qz7.js → vue-ui-graph-DHU9hUry.js} +1 -1
  97. package/dist/{vue-ui-heatmap-DEBbVnrg.js → vue-ui-heatmap-kPnmZgWi.js} +1 -1
  98. package/dist/{vue-ui-hill-C1sHz3TI.js → vue-ui-hill-Ddbup7-b.js} +1 -1
  99. package/dist/{vue-ui-history-plot-CsBTJXR3.js → vue-ui-history-plot-CwO2o-2s.js} +1 -1
  100. package/dist/{vue-ui-horizontal-bar-D0kfcpEW.js → vue-ui-horizontal-bar-CvX77vE4.js} +1 -1
  101. package/dist/{vue-ui-kpi-CltKSYUI.js → vue-ui-kpi-CCOOwX_Q.js} +1 -1
  102. package/dist/{vue-ui-molecule-DtoyWWTf.js → vue-ui-molecule-BPGs9Dom.js} +1 -1
  103. package/dist/{vue-ui-mood-radar-ClOxfeH8.js → vue-ui-mood-radar-GJ-lhgI0.js} +1 -1
  104. package/dist/{vue-ui-nested-donuts-CULAXTg1.js → vue-ui-nested-donuts-CrlPwpg8.js} +1 -1
  105. package/dist/{vue-ui-onion-D7zu861i.js → vue-ui-onion-CKmyy-Y_.js} +1 -1
  106. package/dist/{vue-ui-parallel-coordinate-plot-Cjbc-WUG.js → vue-ui-parallel-coordinate-plot-C0UqWt0M.js} +1 -1
  107. package/dist/{vue-ui-quadrant-DWAb_t6r.js → vue-ui-quadrant-CTGFBNo9.js} +1 -1
  108. package/dist/{vue-ui-quick-chart-oDZwgVo8.js → vue-ui-quick-chart-ZBOPZhxA.js} +1 -1
  109. package/dist/{vue-ui-radar-BWG_N0xO.js → vue-ui-radar-B1z3Ux3E.js} +1 -1
  110. package/dist/{vue-ui-relation-circle-BCRiS2n6.js → vue-ui-relation-circle-DqN5N08e.js} +1 -1
  111. package/dist/{vue-ui-ridgeline-VYcGUP_p.js → vue-ui-ridgeline-DcSB5Qef.js} +1 -1
  112. package/dist/{vue-ui-rings-Dl0AjrRj.js → vue-ui-rings-CJqAnf-l.js} +1 -1
  113. package/dist/{vue-ui-scatter-DTa48HvG.js → vue-ui-scatter-THQAeoWs.js} +1 -1
  114. package/dist/{vue-ui-skeleton-C5mGG8hR.js → vue-ui-skeleton-DqmhigQ0.js} +1 -1
  115. package/dist/{vue-ui-spark-trend--frxeJ8f.js → vue-ui-spark-trend-B2Nf1raK.js} +1 -1
  116. package/dist/{vue-ui-sparkbar-BS5v3HMo.js → vue-ui-sparkbar-CamZ_49V.js} +1 -1
  117. package/dist/{vue-ui-sparkgauge-B1TGfXvR.js → vue-ui-sparkgauge-Ffrp_7VV.js} +1 -1
  118. package/dist/{vue-ui-sparkhistogram-Cs97AL6h.js → vue-ui-sparkhistogram-CLfzi3PO.js} +1 -1
  119. package/dist/{vue-ui-sparkline-Bp9J6x7z.js → vue-ui-sparkline-Y-sljnbS.js} +1 -1
  120. package/dist/{vue-ui-sparkstackbar-BVuuRD10.js → vue-ui-sparkstackbar-CYZ-ADO1.js} +1 -1
  121. package/dist/{vue-ui-stackbar-CRuXn3XI.js → vue-ui-stackbar-CQLYm10x.js} +1 -1
  122. package/dist/{vue-ui-stackline-Besmr9vq.js → vue-ui-stackline-VpvF7MRx.js} +1 -1
  123. package/dist/{vue-ui-strip-plot-D-aRJkR7.js → vue-ui-strip-plot-B9Ogpw7K.js} +1 -1
  124. package/dist/{vue-ui-table-D_UdQwV3.js → vue-ui-table-Bi9C3LzP.js} +1 -1
  125. package/dist/{vue-ui-table-sparkline-BdNo8fW_.js → vue-ui-table-sparkline-DEVAL0cR.js} +1 -1
  126. package/dist/{vue-ui-thermometer-TFg1SGY7.js → vue-ui-thermometer-ClN4EO0I.js} +1 -1
  127. package/dist/{vue-ui-timer-BdPksC26.js → vue-ui-timer-nqZxt1vU.js} +1 -1
  128. package/dist/{vue-ui-tiremarks-HWuO-eyj.js → vue-ui-tiremarks-BeJBsgXo.js} +1 -1
  129. package/dist/{vue-ui-treemap-IegiAqaX.js → vue-ui-treemap-FA-yXwmv.js} +1 -1
  130. package/dist/{vue-ui-waffle-BEyGfPks.js → vue-ui-waffle-CO07S6HV.js} +1 -1
  131. package/dist/{vue-ui-wheel-k8GNPGET.js → vue-ui-wheel-BeaSWB4x.js} +1 -1
  132. package/dist/{vue-ui-word-cloud-D9_15Ve7.js → vue-ui-word-cloud-C1OWGFng.js} +1 -1
  133. package/dist/{vue-ui-world-rCp5Vb7u.js → vue-ui-world-CUS_mKgl.js} +1 -1
  134. package/dist/{vue-ui-xy-CFgFg11v.js → vue-ui-xy-6B_K-quN.js} +1 -1
  135. package/dist/{vue-ui-xy-42AXepcQ.js → vue-ui-xy-BigPHE0Q.js} +1 -1
  136. package/package.json +6 -2
  137. package/dist/package-DGRUegc-.js +0 -1
  138. package/dist/vue-data-ui-CxiWUtNw.js +0 -1
@@ -1,2 +1,2 @@
1
- import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{t}from"./useConfig-6jO1fkp5.js";import{$ as n,Ct as r,D as i,Dt as a,Ht as o,J as s,Jt as c,S as ee,X as te,Yt as ne,Zt as re,at as ie,i as l,in as ae,jt as oe,nt as se,pt as ce,r as le,t as ue,w 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-BH9r_0Vd.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"./chartImage-DPGnEuYM.js";import{n as be}from"./Title-BliHuXfT.js";import{t as xe}from"./useChartExport-BZts4KFb.js";import{n as Se,t as Ce}from"./tableIntegration-CNoJ1CIY.js";import{n as we,t as Te}from"./annotationSlots-BRR85CqJ.js";import{n as Ee,t as De}from"./userOptionsSlots-DYuo-E5m.js";import{t as Oe}from"./usePrinter-sVoTzet1.js";import{t as ke}from"./Shape-CRe8woTu.js";import{c as Ae}from"./canvas-lib-22VpOI4_.js";import{t as je}from"./useResponsive-CENUxfEL.js";import{t as Me}from"./DefGrad-DKMq1REY.js";import{t as Ne}from"./BaseLegendToggle-Q3TiW9u1.js";import{t as Pe}from"./A11yDataTable-DWNlWXzs.js";import{t as Fe}from"./useUserOptionState-CXlFnwPv.js";import{t as Ie}from"./useChartAccessibility-DOMuYJfm.js";import{t as Le}from"./Legend-DM0ClX3D.js";import{t as Re}from"./vue_ui_quadrant-BUv-SqzP.js";import{Fragment as u,Teleport as ze,computed as d,createBlock as f,createCommentVNode as p,createElementBlock as m,createElementVNode as h,createSlots as Be,createTextVNode as Ve,createVNode as He,defineAsyncComponent as g,guardReactiveProps as _,mergeProps as Ue,nextTick as We,normalizeClass as v,normalizeProps as y,normalizeStyle as b,onBeforeUnmount as Ge,onMounted as Ke,openBlock as x,ref as S,renderList as C,renderSlot as w,resolveDynamicComponent as qe,shallowRef as Je,toDisplayString as T,toRefs as Ye,unref as E,watch as Xe,withCtx as D}from"vue";var Ze=/* @__PURE__ */ e({default:()=>on}),Qe=[`id`],$e=[`id`],et=[`id`],tt={style:{position:`relative`}},nt=[`xmlns`,`aria-describedby`,`viewBox`,`id`],rt=[`x`,`y`,`width`,`height`],it={key:1},at=[`fill`,`x`,`y`,`height`,`width`,`stroke-width`,`stroke`,`rx`],ot=[`x1`,`y1`,`x2`,`y2`,`stroke`,`stroke-width`],st=[`x1`,`y1`,`x2`,`y2`,`stroke`,`stroke-width`],ct={key:2},lt=[`points`,`fill`],ut=[`points`,`fill`],dt=[`points`,`fill`],ft=[`points`,`fill`],pt={key:3},mt=[`y`,`fill`,`font-size`],ht=[`x`,`y`,`fill`,`font-size`],gt=[`x`,`y`,`fill`,`font-size`],_t=[`y`,`fill`,`font-size`],vt={key:4},yt=[`x`,`y`,`font-size`,`fill`],bt=[`x`,`y`,`font-size`,`fill`],xt=[`x`,`y`,`font-size`,`fill`],St=[`id`,`font-size`,`transform`,`fill`],Ct=[`id`,`font-size`,`transform`,`fill`],wt=[`id`,`font-size`,`transform`,`fill`],Tt={key:5},Et=[`fill`,`points`],Dt=[`x`,`y`,`width`,`height`],Ot=[`x`,`y`,`width`,`height`],kt=[`x`,`y`,`width`,`height`],At=[`x`,`y`,`width`,`height`],jt=[`x`,`y`,`onMouseenter`,`onMouseleave`,`onClick`],Mt=[`data-a11y-plot-id`,`cx`,`cy`,`r`],Nt=[`data-a11y-plot-id`,`cx`,`cy`,`r`],Pt={key:0,style:{"pointer-events":`none`}},Ft=[`x`,`y`,`font-size`,`fill`],It=[`x`,`y`,`font-size`,`fill`,`innerHTML`],Lt={key:0},Rt=[`x`,`y`,`onMouseover`,`onMouseleave`,`onClick`],zt={key:8,class:`vue-ui-dna`},Bt=[`points`,`fill`],Vt=[`points`,`fill`],Ht=[`points`,`fill`],Ut=[`points`,`fill`],Wt={key:9},Gt=[`x`,`y`,`font-size`,`fill`,`font-weight`],Kt={key:10},qt=[`x`,`y`,`fill`],Jt=[`x`,`y`,`fill`],Yt=[`x`,`y`,`fill`],Xt=[`x`,`y`,`fill`],Zt=[`stroke`,`d`],Qt=[`stroke`,`d`],$t={key:0,style:{position:`absolute`,top:`100%`,left:`0`,width:`100%`},"data-dom-to-png-ignore":``,"aria-hidden":`true`},en={key:5,class:`vue-data-ui-watermark`},tn=[`id`],nn=[`onClick`],rn={key:0,height:`14`,width:`14`,viewBox:`0 0 20 20`},an=[`innerHTML`],on=/*#__PURE__*/ _e({__name:`vue-ui-quadrant`,props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:[`selectPlot`,`selectSide`,`selectLegend`,`copyAlt`],setup(e,{expose:_e,emit:Ze}){let on=g(()=>import(`./Tooltip-C1q0Qoh7.js`)),sn=g(()=>import(`./BaseIcon-Cm-IJ179.js`).then(e=>e.n)),cn=g(()=>import(`./vue-ui-accordion-S3nRtTU-.js`).then(e=>e.n)),ln=g(()=>import(`./DataTable-0Vv-aGHD.js`)),un=g(()=>import(`./PenAndPaper-BGEp-TUm.js`).then(e=>e.t)),dn=g(()=>import(`./UserOptions-uWHV_zPB.js`).then(e=>e.n)),fn=g(()=>import(`./PackageVersion-C4ZM3Vf7.js`).then(e=>e.t)),pn=g(()=>import(`./BaseDraggableDialog-DHgIPVmz.js`).then(e=>e.n)),{vue_ui_quadrant:mn}=t(),O=e,hn=d(()=>!!O.dataset&&O.dataset.length),k=S(te()),gn=Ze,_n=S(!1),vn=S(``),yn=S(0),A=S(!1),j=S(null),bn=S(null),xn=S(null),Sn=S(null),Cn=S(null),wn=S(0),Tn=S(0),En=S(0),Dn=S(!1),On=S(null),kn=S(null),An=S(null),jn=S(null),Mn=S({x:0,y:0}),Nn=S(`pointer`),Pn=S(!1),M=S(Vn()),N=d(()=>M.value.userOptions),P=d(()=>M.value.style.chart.layout.grid),F=d(()=>M.value.style.chart.layout.labels),I=d(()=>M.value.style.chart.tooltip),L=d(()=>M.value.style.chart);he({config:()=>M.value,dataset:()=>O.dataset,component:`VueUiQuadrant`,rules:[ge.emptyArray,ge.noHint]});let R=d(()=>M.value.userOptions.useCursorPointer),Fn=d(()=>({defaultConfig:{userOptions:{show:!1},table:{show:!1},style:{chart:{backgroundColor:`#99999930`,layout:{grid:{stroke:`#6A6A6A`,graduations:{stroke:`#6A6A6A`,color:`#6A6A6A90`},xAxis:{auto:!0},yAxis:{auto:!0}},labels:{quadrantLabels:{show:!1},plotLabels:{show:!1},axisLabels:{show:!1}},plots:{outlineColor:`#6A6A6A`}},legend:{backgroundColor:`transparent`}}}},userConfig:M.value.skeletonConfig??{}})),{loading:In,FINAL_DATASET:Ln}=pe({...Ye(O),FINAL_CONFIG:M,prepareConfig:Vn,callback:()=>{Promise.resolve().then(async()=>{await We(),V.value.showTable=M.value.table.show})},skeletonDataset:O.config?.skeletonDataset??[{name:`_`,shape:`circle`,color:`#CACACA`,series:[{name:`_`,x:-6,y:-4},{name:`_`,x:-5,y:-2},{name:`_`,x:-4,y:-1},{name:`_`,x:-3,y:-.5},{name:`_`,x:-2,y:-.25},{name:`_`,x:-1,y:-.135},{name:`_`,x:0,y:0},{name:`_`,x:1,y:.135},{name:`_`,x:2,y:.25},{name:`_`,x:3,y:.5},{name:`_`,x:4,y:1},{name:`_`,x:5,y:2},{name:`_`,x:6,y:4}]}],skeletonConfig:ae({defaultConfig:M.value,userConfig:Fn.value})}),{userOptionsVisible:Rn,setUserOptionsVisibility:zn,keepUserOptionState:Bn}=Fe({config:M.value}),{svgRef:z}=Ie({config:L.value.title});function Vn(){return ve(O.config,mn,Re)}let Hn=re(O.config);Xe(()=>O.config,(e,t)=>{let n=re(e),r=n!==Hn;Hn=n;let i=Vn();r?(M.value=i,Rn.value=!M.value.userOptions.showOnChartHover,Gn(),wn.value+=1,Tn.value+=1,En.value+=1,V.value.plotLabels.show=F.value.plotLabels.show,V.value.showTable=M.value.table.show,V.value.showTooltip=I.value.show):(M.value.style.chart.tooltip=i.style.chart.tooltip,V.value.showTooltip=M.value.style.chart.tooltip.show)},{deep:!0});let B=Je(null),Un=Je(null),Wn=d(()=>M.value.debug);function Gn(){if(fe(O.dataset)?ie({componentName:`VueUiQuadrant`,type:`dataset`,debug:Wn.value}):Wn.value&&O.dataset.forEach((e,t)=>{[null,void 0].includes(e.name)&&ie({componentName:`VueUiQuadrant`,type:`datasetSerieAttribute`,property:`name`,index:t}),[null,void 0].includes(e.series)?ie({componentName:`VueUiQuadrant`,type:`datasetSerieAttribute`,property:`series`,index:t}):e.series.forEach((e,t)=>{[null,void 0].includes(e.name)&&ie({componentName:`VueUiQuadrant`,type:`datasetSerieAttribute`,property:`name`,key:`series`,index:t})})}),M.value.responsive){let e=Ae(()=>{let{width:e,height:t}=je({chart:j.value,title:L.value.title.text?bn.value:null,legend:L.value.legend.show?xn.value:null,source:Sn.value,noTitle:Cn.value});H.value=48,requestAnimationFrame(()=>{U.value.height=t,U.value.usableHeight=t-H.value*2,U.value.width=e,U.value.usableWidth=e-H.value*2,U.value.top=H.value,U.value.left=H.value,U.value.right=e-H.value,U.value.bottom=t-H.value,U.value.centerX=e/2,U.value.centerY=t-t/2,U.value.padding=H.value})});B.value&&(Un.value&&B.value.unobserve(Un.value),B.value.disconnect()),B.value=new ResizeObserver(e),Un.value=j.value.parentNode,B.value.observe(Un.value)}}Ke(()=>{Dn.value=!0,Gn()}),Ge(()=>{B.value&&(Un.value&&B.value.unobserve(Un.value),B.value.disconnect())});let{isPrinting:Kn,isImaging:qn,generatePdf:Jn,generateImage:Yn}=Oe({elementId:`vue-ui-quadrant_${k.value}`,fileName:L.value.title.text||`vue-ui-quadrant`,options:M.value.userOptions.print}),Xn=d(()=>M.value.userOptions.show&&!L.value.title.text),Zn=d(()=>de(M.value.customPalette)),V=S({plotLabels:{show:F.value.plotLabels.show},showTable:M.value.table.show,showTooltip:I.value.show}),H=S(48),U=S({height:L.value.height,usableHeight:L.value.height-H.value*2,width:L.value.width,usableWidth:L.value.width-H.value*2,top:H.value,left:H.value,right:L.value.width-H.value,bottom:L.value.height-H.value,centerX:L.value.width/2,centerY:L.value.height-L.value.height/2,padding:H.value}),W=S({...JSON.parse(JSON.stringify(U.value)),startX:0,startY:0});Xe(()=>U.value,e=>{e&&(W.value={...JSON.parse(JSON.stringify(U.value)),startX:0,startY:0})},{deep:!0});let G=S(null),Qn=d(()=>{switch(G.value){case`TL`:return{x:W.value.startX+W.value.width/2,y:W.value.height,text:F.value.quadrantLabels.tl.text||`Top Left`,fontSize:F.value.quadrantLabels.tl.fontSize,fill:F.value.quadrantLabels.tl.color,bold:F.value.quadrantLabels.tl.bold};case`TR`:return{x:W.value.startX+W.value.width/2,y:W.value.height,text:F.value.quadrantLabels.tr.text||`Top Right`,fontSize:F.value.quadrantLabels.tr.fontSize,fill:F.value.quadrantLabels.tr.color,bold:F.value.quadrantLabels.tr.bold};case`BR`:return{x:W.value.startX+W.value.width/2,y:W.value.height*1.678,text:F.value.quadrantLabels.br.text||`Bottom Right`,fontSize:F.value.quadrantLabels.br.fontSize,fill:F.value.quadrantLabels.br.color,bold:F.value.quadrantLabels.br.bold};case`BL`:return{x:W.value.startX+W.value.width/2,y:W.value.height*1.678,text:F.value.quadrantLabels.bl.text||`Bottom Left`,fontSize:F.value.quadrantLabels.bl.fontSize,fill:F.value.quadrantLabels.bl.color,bold:F.value.quadrantLabels.bl.bold};default:return{x:0,y:0,text:``,fontSize:0,fill:`none`,bold:!1}}}),$n=S(null),er=S(!1);function tr({targetX:e,targetY:t,targetW:n,targetH:r,side:i}){G.value&&Tr(i);let a={x:e-W.value.startX,y:t-W.value.startY,w:n-W.value.width,h:r-W.value.height},o=M.value.zoomAnimationFrames,s=0;function c(){er.value=!0,W.value.startX+=a.x/o,W.value.startY+=a.y/o,W.value.width+=a.w/o,W.value.height+=a.h/o,s+=1,s<o?$n.value=requestAnimationFrame(c):er.value=!1}c()}let K=d(()=>M.value.zoomEnabled);function q(e){if(K.value&&!er.value){if(A.value&&G.value===e)tr({targetX:0,targetY:0,targetW:U.value.width,targetH:U.value.height}),G.value=null,A.value=!1;else{switch(G.value=e,e){case`TL`:tr({targetX:0,targetY:0,targetW:U.value.width/2+U.value.left,targetH:U.value.height/2+U.value.top,side:`tl`});break;case`TR`:tr({targetX:U.value.width/2-U.value.left,targetY:0,targetW:U.value.width/2+U.value.left,targetH:U.value.height/2+U.value.top,side:`tr`});break;case`BR`:tr({targetX:U.value.width/2-U.value.left,targetY:U.value.height/2-U.value.top,targetW:U.value.width/2+U.value.left,targetH:U.value.height/2+U.value.top,side:`br`});break;case`BL`:tr({targetX:0,targetY:U.value.height/2-U.value.top,targetW:U.value.width/2+U.value.left,targetH:U.value.height/2+U.value.top,side:`bl`});break;default:W.value.startX=0,W.value.startY=0,W.value.width=U.value.width,W.value.height=U.value.height}A.value=!0}}}let nr=d(()=>{let e=P.value.graduations.steps,t=U.value.usableWidth/(e*2),n=U.value.top,r=[];for(let i=0;i<e;i+=1)r.push({x:U.value.padding+t*i,y:n+U.value.usableHeight*(i/e/2),height:U.value.usableHeight*(1-i/e),width:U.value.usableWidth*(1-i/e),opacity:Math.round((i+1)/e*20)});return r}),J=d(()=>{let e=P.value.xAxis.max,t=P.value.xAxis.min,n=P.value.yAxis.max,r=P.value.yAxis.min;return P.value.xAxis.auto&&(e=Math.max(...rr.value.flatMap(e=>e.series.map(e=>e.x))),t=Math.min(...rr.value.flatMap(e=>e.series.map(e=>e.x)))),P.value.yAxis.auto&&(n=Math.max(...rr.value.flatMap(e=>e.series.map(e=>e.y))),r=Math.min(...rr.value.flatMap(e=>e.series.map(e=>e.y)))),{x:{max:e,min:t},y:{max:n,min:r}}}),Y=S([]),rr=d(()=>Ln.value.map((e,t)=>({...e,series:oe({data:e.series,threshold:M.value.downsample.threshold}),id:`cat_${t}_${k.value}`,color:ee(e.color)||Zn.value[t]||o[t]}))),ir=d(()=>rr.value.filter(e=>!Y.value.includes(e.id))),ar=d(()=>rr.value.map((e,t)=>({...e,shape:e.shape||`circle`,series:e.series.map(t=>({...t,x:or(t.x),y:sr(t.y),xValue:t.x,yValue:t.y,quadrantSide:_r({x:t.x,y:t.y}),categoryName:e.name,category:e,shape:e.shape,color:e.color}))}))),X=d(()=>(Wn.value&&Ln.value.forEach((e,t)=>{e.series.forEach((e,t)=>{[null,void 0].includes(e.x)&&ie({componentName:`VueUiQuadrant`,type:`datasetSerieAttribute`,property:`x`,key:`series`,index:t}),[null,void 0].includes(e.y)&&ie({componentName:`VueUiQuadrant`,type:`datasetSerieAttribute`,property:`y`,key:`series`,index:t})})}),ir.value.map((e,t)=>({...e,shape:e.shape||`circle`,color:e.color||Zn.value[t]||o[t],series:e.series.map(t=>({...t,category:e,x:or(t.x),y:sr(t.y),xValue:t.x,yValue:t.y,quadrantSide:_r({x:t.x,y:t.y}),categoryName:e.name,shape:e.shape,color:e.color,uid:te()}))}))));function or(e){if(e>=0){let t=e/J.value.x.max;return U.value.centerX+U.value.usableWidth/2*t}{let t=Math.abs(e)/Math.abs(J.value.x.min);return U.value.centerX-U.value.usableWidth/2*t}}function sr(e){if(e>=0){let t=e/J.value.y.max;return U.value.centerY+(1-U.value.usableHeight/2*t)}{let t=Math.abs(e)/Math.abs(J.value.y.min);return U.value.centerY-(1-U.value.usableHeight/2*t)}}let cr=d(()=>{let e=X.value.flatMap(e=>e.series.map(t=>({x:t.xValue,y:t.yValue,name:t.name,category:t.categoryName,quadrantSide:t.quadrantSide,sideName:F.value.quadrantLabels[t.quadrantSide].text,color:e.color,shape:e.shape}))),t=P.value.xAxis.name||`x`,n=P.value.yAxis.name||`y`;return{head:[M.value.translations.category,M.value.translations.item,t,n,M.value.translations.side],body:e.map(e=>[e.category,e.name,e.x,e.y,e.sideName||e.quadrantSide]),itsShapes:e.map(e=>({shape:e.shape,color:e.color})),tableData:e}}),lr=d(()=>{let e=cr.value.head,t=cr.value.tableData.map(e=>[{shape:e.shape,color:e.color,name:e.category},e.name,l(F.value.plotLabels.x.formatter,e.x,n({v:e.x,r:F.value.plotLabels.rounding})),l(F.value.plotLabels.y.formatter,e.y,n({v:e.y,r:F.value.plotLabels.rounding})),e.sideName||e.quadrantSide]);return{head:e,body:t,a11yBody:t.map(e=>e.map((e,t)=>t===0?e.name??``:e)),config:{th:{backgroundColor:M.value.table.th.backgroundColor,color:M.value.table.th.color,outline:M.value.table.th.outline},td:{backgroundColor:M.value.table.td.backgroundColor,color:M.value.table.td.color,outline:M.value.table.td.outline},breakpoint:M.value.table.responsiveBreakpoint},colNames:e}});function ur(){Y.value.length?Y.value=[]:fr.value.forEach(e=>{Y.value.push(e.id)}),gn(`selectLegend`,Er())}function dr(e){Y.value.includes(e)?Y.value=Y.value.filter(t=>t!==e):Y.value.push(e),gn(`selectLegend`,Er())}let fr=d(()=>ar.value.map(e=>({name:e.name,shape:e.shape,color:e.color,id:e.id,opacity:Y.value.includes(e.id)?.5:1,segregate:()=>dr(e.id),isSegregated:Y.value.includes(e.id)})));function pr(e){return fr.value.length?fr.value.find(t=>t.name===e)||(Wn.value&&console.warn(`VueUiQuadrant - Series name not found "${e}"`),null):(Wn.value&&console.warn(`VueUiQuadrant - There are no series to show.`),null)}function mr(e){let t=pr(e);t!==null&&Y.value.includes(t.id)&&dr(t.id)}function hr(e){let t=pr(e);t!==null&&(Y.value.includes(t.id)||dr(t.id))}let gr=d(()=>({cy:`quadrant-div-legend`,backgroundColor:L.value.legend.backgroundColor,color:L.value.legend.color,fontSize:L.value.legend.fontSize,paddingBottom:12,fontWeight:L.value.legend.bold?`bold`:``}));function _r(e){switch(!0){case e.x>=0&&e.y>=0:return`tr`;case e.x>=0&&e.y<0:return`br`;case e.x<0&&e.y<0:return`bl`;case e.x<0&&e.y>=0:return`tl`;default:return``}}let Z=S(null),vr=S(null),yr=S(null);function br(){Z.value=null,vr.value=null,An.value=null,jn.value=null,_n.value=!1}function xr(e){if(!z.value||!e)return;let t=`[data-a11y-plot-id="${e}"]`,n=z.value.querySelector(t);if(!n)return;let r=n.getBoundingClientRect();Mn.value={x:r.left+r.width/2,y:r.top+r.height/2}}function Sr(e,t,r,i=`pointer`,o=null){M.value.events.datapointEnter&&M.value.events.datapointEnter({datapoint:t,seriesIndex:r}),Z.value=t.uid,vr.value={color:e.color,shape:e.shape},Nn.value=i,An.value=o,jn.value=t.uid,yr.value={datapoint:t,seriesIndex:r,series:X.value,config:M.value};let s=I.value.customFormat;if(a(s)&&ce(()=>s({seriesIndex:r,datapoint:t,series:X.value,config:M.value})))vn.value=s({seriesIndex:r,datapoint:t,series:X.value,config:M.value});else{let i=``;t.quadrantSide&&(i+=`<div style="color:${F.value.quadrantLabels[t.quadrantSide].color};font-weight:${F.value.quadrantLabels[t.quadrantSide].bold?`bold`:`400`}">${F.value.quadrantLabels[t.quadrantSide].text}</div>`),i+=`<div>${e.name}</div>`,i+=`<div style="padding-bottom:6px;border-bottom:1px solid ${I.value.borderColor};margin-bottom:3px">${t.name}</div>`,i+=`<div>${P.value.xAxis.name?P.value.xAxis.name:`x`}: <b>${l(F.value.plotLabels.x.formatter,t.xValue,n({v:t.xValue,r:I.value.roundingValue}),{datapoint:t,category:e,categoryIndex:r})}</b></div>`,i+=`<div>${P.value.yAxis.name?P.value.yAxis.name:`y`}: <b>${l(F.value.plotLabels.y.formatter,t.yValue,n({v:t.yValue,r:I.value.roundingValue}),{datapoint:t,category:e,categoryIndex:r})}</b></div>`,vn.value=`<div style="text-align:left;font-size:${I.value.fontSize}px">${i}</div>`}i===`keyboard`&&We(()=>{xr(t.uid)}),_n.value=!0}function Cr(e,t){M.value.events.datapointLeave&&M.value.events.datapointLeave({datapoint:e,seriesIndex:t}),(jn.value!==e.uid||Nn.value!==`keyboard`)&&(_n.value=!1,Z.value=null,vr.value=null)}function wr(e,t,n){M.value.events.datapointClick&&M.value.events.datapointClick({datapoint:t,seriesIndex:n});let r={category:e.name,shape:e.shape,itemName:t.name,x:t.xValue,y:t.yValue,quadrantSide:t.quadrantSide,sideName:F.value.quadrantLabels[t.quadrantSide].text};gn(`selectPlot`,r)}function Tr(e){if(!e)return;let t=X.value.flatMap(t=>t.series.filter(t=>t.quadrantSide===e).map(e=>({category:e.categoryName,itemName:e.name,x:e.xValue,y:e.yValue}))),n={quadrantSide:e,sideName:F.value.quadrantLabels[e].text,items:[...t]};gn(`selectSide`,n)}let Q=d(()=>({TL:{tl:{x:U.value.left+U.value.usableWidth/4-20,y:0,fill:F.value.quadrantLabels.tl.color},tr:{x:U.value.left+U.value.usableWidth/4,y:0,fill:F.value.quadrantLabels.tr.color},br:{x:U.value.left+U.value.usableWidth/4,y:20,fill:F.value.quadrantLabels.br.color},bl:{x:U.value.left+U.value.usableWidth/4-20,y:20,fill:F.value.quadrantLabels.bl.color},crosshairs:{horizontal:`M ${U.value.left+U.value.usableWidth/4-20},20 ${U.value.left+U.value.usableWidth/4+20},20`,vertical:`M ${U.value.left+U.value.usableWidth/4},0 ${U.value.left+U.value.usableWidth/4},40`}},TR:{tl:{x:U.value.centerX+U.value.usableWidth/4-20,y:0,fill:F.value.quadrantLabels.tl.color},tr:{x:U.value.centerX+U.value.usableWidth/4,y:0,fill:F.value.quadrantLabels.tr.color},br:{x:U.value.centerX+U.value.usableWidth/4,y:20,fill:F.value.quadrantLabels.br.color},bl:{x:U.value.centerX+U.value.usableWidth/4-20,y:20,fill:F.value.quadrantLabels.bl.color},crosshairs:{horizontal:`M ${U.value.centerX+U.value.usableWidth/4-20},20 ${U.value.centerX+U.value.usableWidth/4+20},20`,vertical:`M ${U.value.centerX+U.value.usableWidth/4},0 ${U.value.centerX+U.value.usableWidth/4},40`}},BR:{tl:{x:U.value.centerX+U.value.usableWidth/4-20,y:U.value.centerY-48,fill:F.value.quadrantLabels.tl.color},tr:{x:U.value.centerX+U.value.usableWidth/4,y:U.value.centerY-48,fill:F.value.quadrantLabels.tr.color},br:{x:U.value.centerX+U.value.usableWidth/4,y:U.value.centerY-28,fill:F.value.quadrantLabels.br.color},bl:{x:U.value.centerX+U.value.usableWidth/4-20,y:U.value.centerY-28,fill:F.value.quadrantLabels.bl.color},crosshairs:{horizontal:`M ${U.value.centerX+U.value.usableWidth/4-20},${U.value.centerY-28} ${U.value.centerX+U.value.usableWidth/4+20},${U.value.centerY-28}`,vertical:`M ${U.value.centerX+U.value.usableWidth/4},${U.value.centerY-48} ${U.value.centerX+U.value.usableWidth/4},${U.value.centerY-8}`}},BL:{tl:{x:U.value.left+U.value.usableWidth/4-20,y:U.value.centerY-48,fill:F.value.quadrantLabels.tl.color},tr:{x:U.value.left+U.value.usableWidth/4,y:U.value.centerY-48,fill:F.value.quadrantLabels.tr.color},br:{x:U.value.left+U.value.usableWidth/4,y:U.value.centerY-28,fill:F.value.quadrantLabels.br.color},bl:{x:U.value.left+U.value.usableWidth/4-20,y:U.value.centerY-28,fill:F.value.quadrantLabels.bl.color},crosshairs:{horizontal:`M ${U.value.left+U.value.usableWidth/4-20},${U.value.centerY-28} ${U.value.left+U.value.usableWidth/4+20},${U.value.centerY-28}`,vertical:`M ${U.value.left+U.value.usableWidth/4},${U.value.centerY-48} ${U.value.left+U.value.usableWidth/4},${U.value.centerY-8}`}}}));function Er(){return X.value.map(e=>({color:e.color,name:e.name,shape:e.shape,series:e.series.map(e=>({name:e.name,x:e.xValue,y:e.yValue,quadrantSide:e.quadrantSide,sideName:F.value.quadrantLabels[e.quadrantSide].text}))}))}function Dr(e=null){We(()=>{let t=[[L.value.title.text],[L.value.title.subtitle.text],[``]],n=cr.value.head,r=cr.value.body,a=t.concat([n]).concat(r),o=i(a);e?e(o):se({csvContent:o,title:L.value.title.text||`vue-ui-quadrant`})})}let Or=S(!1);function kr(e){Or.value=e,yn.value+=1}function Ar(){V.value.showTable=!V.value.showTable}function jr(){V.value.plotLabels.show=!V.value.plotLabels.show}function Mr(){V.value.showTooltip=!V.value.showTooltip}let Nr=S(!1);function Pr(){Nr.value=!Nr.value}let Fr=ye(j,()=>L.value.title.text),Ir=d(()=>Ce({config:M,style:L,mutableConfig:V,dialog:pn,accordion:cn,isFullscreen:Or,parent:j,maxWidth:800,isCursorPointer:R}));Xe(()=>V.value.showTable,e=>Se(e,M,On));function Lr(){V.value.showTable=!1,kn.value&&kn.value.setTableIconState(!1)}let Rr=d(()=>L.value.backgroundColor),zr=d(()=>L.value.legend),Br=d(()=>L.value.title),{isCallbackImaging:Vr,isCallbackSvg:Hr,generateSvg:Ur,onGenerateImage:Wr}=xe({svg:z,title:Br,legend:zr,legendItems:fr,backgroundColor:Rr,getSvgCallback:()=>M.value.userOptions.callbacks.svg,generateImage:Yn});async function Gr(){gn(`copyAlt`,{config:M.value,dataset:ir.value}),M.value.userOptions.callbacks.altCopy?await Promise.resolve(M.value.userOptions.callbacks.altCopy({config:M.value,dataset:ir.value})):console.warn("Vue Data UI - A callback must be set for `altCopy` in userOptions.")}function Kr(){An.value=null,jn.value=null,Pn.value=!0}function qr(){br(),Pn.value=!1}function Jr(e){if(!z.value||Nr.value||document.activeElement!==z.value||!$.value.length)return;let t=e.key===`ArrowLeft`||e.key===`ArrowUp`,n=e.key===`ArrowRight`||e.key===`ArrowDown`,r=e.key===`Enter`||e.key===` `,i=e.key===`Escape`;if(!t&&!n&&!r&&!i)return;if(e.preventDefault(),e.stopPropagation(),i){br();return}if(r){if(An.value===null)return;let e=$.value[An.value];if(!e)return;wr(e.category,e.plot,e.categoryIndex);return}let a=An.value,o=Z.value?$.value.findIndex(e=>e.plot.uid===Z.value):null,s=a!==null&&a>=0&&a<$.value.length,c=o!==null&&o>=0&&o<$.value.length;s?(a+=n?1:-1,a<0&&(a=$.value.length-1),a>=$.value.length&&(a=0)):c?(a=n?o+1:o-1,a>=$.value.length&&(a=0),a<0&&(a=$.value.length-1)):a=n?0:$.value.length-1;let ee=$.value[a];ee&&Sr(ee.category,ee.plot,ee.categoryIndex,`keyboard`,a)}let Yr=d(()=>({headers:lr.value?.colNames??[],rows:lr.value?.a11yBody??[]})),$=d(()=>X.value.flatMap((e,t)=>e.series.map(n=>({category:e,plot:n,categoryIndex:t}))));return _e({getData:Er,getImage:Fr,generatePdf:Jn,generateCsv:Dr,generateImage:Yn,generateSvg:Ur,hideSeries:hr,showSeries:mr,toggleTable:Ar,toggleLabels:jr,toggleTooltip:Mr,toggleAnnotator:Pr,toggleFullscreen:kr,copyAlt:Gr}),(e,t)=>(x(),m(`div`,{class:v(`vue-data-ui-component vue-ui-quadrant ${Or.value?`vue-data-ui-wrapper-fullscreen`:``} ${M.value.useCssAnimation?``:`vue-ui-dna`}`),ref_key:`quadrantChart`,ref:j,id:`vue-ui-quadrant_${k.value}`,style:b(`font-family:${M.value.style.fontFamily};width:100%; text-align:center;background:${L.value.backgroundColor};${M.value.responsive?`height: 100%`:``}`),onMouseenter:t[14]||=()=>E(zn)(!0),onMouseleave:t[15]||=()=>{E(zn)(!1),Pn.value||br()}},[h(`div`,{id:`chart-instructions-${k.value}`,class:`sr-only`},[h(`p`,null,T(M.value.a11y.translations.keyboardNavigation),1)],8,$e),Yr.value?.rows?.length?(x(),f(Pe,{key:0,uid:k.value,head:Yr.value.headers,body:Yr.value.rows,notice:M.value.a11y.translations.tableAvailable,caption:M.value.a11y.translations.tableCaption},null,8,[`uid`,`head`,`body`,`notice`,`caption`])):p(``,!0),N.value.buttons.annotator?(x(),f(E(un),{key:1,svgRef:E(z),backgroundColor:L.value.backgroundColor,color:L.value.color,active:Nr.value,isCursorPointer:R.value,palette:N.value.annotatorPalette,onClose:Pr},Be({_:2},[C(E(Te),t=>({name:t,fn:D(n=>[w(e.$slots,t,y(_(E(we)(t,n))),void 0,!0)])}))]),1032,[`svgRef`,`backgroundColor`,`color`,`active`,`isCursorPointer`,`palette`])):p(``,!0),Xn.value?(x(),m(`div`,{key:2,ref_key:`noTitle`,ref:Cn,class:`vue-data-ui-no-title-space`,style:`height:36px; width: 100%;background:transparent`},null,512)):p(``,!0),L.value.title.text?(x(),m(`div`,{key:3,ref_key:`chartTitle`,ref:bn,style:`width:100%;background:transparent;padding-bottom:12px`},[(x(),f(be,{key:`table_${wn.value}`,config:{title:{cy:`quadrant-title`,...L.value.title},subtitle:{cy:`quadrant-subtitle`,...L.value.title.subtitle}}},null,8,[`config`]))],512)):p(``,!0),h(`div`,{id:`legend-top-${k.value}`},null,8,et),N.value.show&&hn.value&&(E(Bn)||E(Rn))?(x(),f(E(dn),{ref_key:`userOptionsRef`,ref:kn,key:`user_options_${yn.value}`,backgroundColor:L.value.backgroundColor,color:L.value.color,isImaging:E(qn),isPrinting:E(Kn),uid:k.value,hasTooltip:N.value.buttons.tooltip&&I.value.show,hasPdf:N.value.buttons.pdf,hasImg:N.value.buttons.img,hasSvg:N.value.buttons.svg,hasXls:N.value.buttons.csv,hasTable:N.value.buttons.table,hasLabel:N.value.buttons.labels,hasFullscreen:N.value.buttons.fullscreen,hasAltCopy:N.value.buttons.altCopy,isFullscreen:Or.value,isTooltip:V.value.showTooltip,titles:{...N.value.buttonTitles},chartElement:j.value,position:N.value.position,hasAnnotator:N.value.buttons.annotator,isAnnotation:Nr.value,callbacks:N.value.callbacks,printScale:N.value.print.scale,tableDialog:M.value.table.useDialog,isCursorPointer:R.value,onToggleFullscreen:kr,onGeneratePdf:E(Jn),onGenerateCsv:Dr,onGenerateImage:E(Wr),onGenerateSvg:E(Ur),onToggleTable:Ar,onToggleLabels:jr,onToggleTooltip:Mr,onToggleAnnotator:Pr,onCopyAlt:Gr,style:b({visibility:E(Bn)?E(Rn)?`visible`:`hidden`:`visible`})},Be({_:2},[C(E(Ee)(e.$slots,`menuIcon optionTooltip optionPdf optionCsv optionImg optionSvg optionTable optionLabels optionFullscreen optionAnnotator optionAltCopy custom-menu-before custom-menu-after`),t=>({name:t,fn:D(n=>[w(e.$slots,t,y(_(E(De)(t,n))),void 0,!0)])}))]),1032,/* @__PURE__ */ `backgroundColor.color.isImaging.isPrinting.uid.hasTooltip.hasPdf.hasImg.hasSvg.hasXls.hasTable.hasLabel.hasFullscreen.hasAltCopy.isFullscreen.isTooltip.titles.chartElement.position.hasAnnotator.isAnnotation.callbacks.printScale.tableDialog.isCursorPointer.onGeneratePdf.onGenerateImage.onGenerateSvg.style`.split(`.`))):p(``,!0),h(`div`,tt,[(x(),m(`svg`,{ref_key:`svgRef`,ref:z,xmlns:E(ue),"aria-describedby":`chart-instructions-${k.value}`,class:v({"vue-data-ui-fullscreen--on":Or.value,"vue-data-ui-fulscreen--off":!Or.value}),viewBox:`${W.value.startX} ${W.value.startY} ${W.value.width} ${W.value.height}`,style:b(`max-width:100%;overflow:hidden;background:transparent;color:${L.value.color}`),id:`svg_${k.value}`,tabindex:`0`,onFocus:Kr,onBlur:qr,onKeydown:Jr},[He(E(fn)),w(e.$slots,`svg-underlayer`,{svg:{...U.value,isPrintingImg:E(Kn)||E(qn)||E(Vr),isPrintingSvg:E(Hr)}},void 0,!0),e.$slots[`chart-background`]?(x(),m(`foreignObject`,{key:0,x:W.value.startX,y:W.value.startY,width:W.value.width,height:W.value.height,style:{pointerEvents:`none`}},[w(e.$slots,`chart-background`,{},void 0,!0)],8,rt)):p(``,!0),h(`defs`,null,[(x(!0),m(u,null,C(X.value,(e,t)=>(x(),f(Me,{t:`radial`,cx:`50%`,cy:`50%`,r:`50%`,fx:`50%`,fy:`50%`,id:`quadrant_gradient_${k.value}_${t}`,key:`quadrant_gradient_${k.value}_${t}`,stops:[[`0%`,E(c)(E(ne)(e.color,.05),L.value.layout.areas.opacity),1],[`100%`,E(c)(e.color,L.value.layout.areas.opacity),1]]},null,8,[`id`,`stops`]))),128))]),P.value.graduations.show?(x(),m(`g`,it,[(x(!0),m(u,null,C(nr.value,e=>(x(),m(`rect`,{fill:P.value.graduations.fill?E(c)(P.value.graduations.color,e.opacity):`none`,x:e.x,y:e.y,height:e.height<=0?.001:e.height,width:e.width<=0?.001:e.width,"stroke-width":P.value.graduations.strokeWidth,stroke:P.value.graduations.stroke,rx:P.value.graduations.roundingForce},null,8,at))),256))])):p(``,!0),h(`line`,{x1:U.value.left,y1:U.value.centerY,x2:U.value.right,y2:U.value.centerY,stroke:P.value.stroke,"stroke-width":P.value.strokeWidth},null,8,ot),h(`line`,{x1:U.value.centerX,y1:U.value.top,x2:U.value.centerX,y2:U.value.bottom,stroke:P.value.stroke,"stroke-width":P.value.strokeWidth},null,8,st),P.value.showArrows?(x(),m(`g`,ct,[h(`polygon`,{points:`${U.value.right-8},${U.value.centerY-6} ${U.value.right},${U.value.centerY} ${U.value.right-8},${U.value.centerY+6}`,fill:P.value.stroke,stroke:`none`},null,8,lt),h(`polygon`,{points:`${U.value.left+8},${U.value.centerY-6} ${U.value.left},${U.value.centerY} ${U.value.left+8},${U.value.centerY+6}`,fill:P.value.stroke,stroke:`none`},null,8,ut),h(`polygon`,{points:`${U.value.centerX-6},${U.value.top+8} ${U.value.centerX},${U.value.top} ${U.value.centerX+6},${U.value.top+8}`,fill:P.value.stroke,stroke:`none`},null,8,dt),h(`polygon`,{points:`${U.value.centerX-6},${U.value.bottom-8} ${U.value.centerX},${U.value.bottom} ${U.value.centerX+6},${U.value.bottom-8}`,fill:P.value.stroke,stroke:`none`},null,8,ft)])):p(``,!0),F.value.quadrantLabels.show&&!A.value?(x(),m(`g`,pt,[F.value.quadrantLabels.tl.text?(x(),m(`text`,{key:0,x:0,y:U.value.top-U.value.padding/2,"text-anchor":`start`,fill:F.value.quadrantLabels.tl.color,"font-size":F.value.quadrantLabels.tl.fontSize,style:b(`font-weight:${F.value.quadrantLabels.tl.bold?`bold`:``}`),onClick:t[0]||=e=>Tr(`tl`)},T(F.value.quadrantLabels.tl.text),13,mt)):p(``,!0),F.value.quadrantLabels.tr.text?(x(),m(`text`,{key:1,x:U.value.width,y:U.value.top-U.value.padding/2,"text-anchor":`end`,fill:F.value.quadrantLabels.tr.color,"font-size":F.value.quadrantLabels.tr.fontSize,style:b(`font-weight:${F.value.quadrantLabels.tr.bold?`bold`:``}`),onClick:t[1]||=e=>Tr(`tr`)},T(F.value.quadrantLabels.tr.text),13,ht)):p(``,!0),F.value.quadrantLabels.br.text?(x(),m(`text`,{key:2,x:U.value.width,y:U.value.bottom+U.value.padding*.7,"text-anchor":`end`,fill:F.value.quadrantLabels.br.color,"font-size":F.value.quadrantLabels.br.fontSize,style:b(`font-weight:${F.value.quadrantLabels.br.bold?`bold`:``}`),onClick:t[2]||=e=>Tr(`br`)},T(F.value.quadrantLabels.br.text),13,gt)):p(``,!0),F.value.quadrantLabels.bl.text?(x(),m(`text`,{key:3,x:0,y:U.value.bottom+U.value.padding*.7,"text-anchor":`start`,fill:F.value.quadrantLabels.bl.color,"font-size":F.value.quadrantLabels.bl.fontSize,style:b(`font-weight:${F.value.quadrantLabels.bl.bold?`bold`:``}`),onClick:t[3]||=e=>Tr(`bl`)},T(F.value.quadrantLabels.bl.text),13,_t)):p(``,!0)])):p(``,!0),F.value.axisLabels.show?(x(),m(`g`,vt,[P.value.yAxis.show?(x(),m(`text`,{key:0,x:U.value.centerX,y:U.value.top-U.value.padding/6,"text-anchor":`middle`,"font-size":F.value.axisLabels.fontSize,fill:F.value.axisLabels.color.positive},T(E(l)(F.value.plotLabels.y.formatter,J.value.y.max,E(n)({v:J.value.y.max,r:F.value.plotLabels.rounding}))),9,yt)):p(``,!0),h(`text`,{x:U.value.centerX,y:U.value.top-U.value.padding/2,"text-anchor":`middle`,"font-size":F.value.axisLabels.fontSize,fill:F.value.axisLabels.color.positive},T(P.value.yAxis.name),9,bt),P.value.yAxis.show?(x(),m(`text`,{key:1,x:U.value.centerX,y:U.value.bottom+U.value.padding*.35,"text-anchor":`middle`,"font-size":F.value.axisLabels.fontSize,fill:F.value.axisLabels.color.negative},T(E(l)(F.value.plotLabels.y.formatter,J.value.y.min,E(n)({v:J.value.y.min,r:F.value.plotLabels.rounding}))),9,xt)):p(``,!0),P.value.xAxis.show?(x(),m(`text`,{key:2,id:`xLabelMin_${k.value}`,"text-anchor":`middle`,"font-size":F.value.axisLabels.fontSize,transform:`translate(${U.value.padding-F.value.axisLabels.fontSize}, ${U.value.height/2}), rotate(-90)`,fill:F.value.axisLabels.color.negative},T(E(l)(F.value.plotLabels.x.formatter,J.value.x.min,E(n)({v:J.value.x.min,r:F.value.plotLabels.rounding}))),9,St)):p(``,!0),P.value.xAxis.show?(x(),m(`text`,{key:3,id:`xLabelMax_${k.value}`,"text-anchor":`middle`,"font-size":F.value.axisLabels.fontSize,transform:`translate(${U.value.width-U.value.padding+F.value.axisLabels.fontSize}, ${U.value.height/2}), rotate(90)`,fill:F.value.axisLabels.color.positive},T(E(l)(F.value.plotLabels.x.formatter,J.value.x.max,E(n)({v:J.value.x.max,r:F.value.plotLabels.rounding}))),9,Ct)):p(``,!0),h(`text`,{id:`xLabelMaxName_${k.value}`,"text-anchor":`middle`,"font-size":F.value.axisLabels.fontSize,transform:`translate(${U.value.width-F.value.axisLabels.fontSize}, ${U.value.height/2}), rotate(90)`,fill:F.value.axisLabels.color.positive},T(P.value.xAxis.name),9,wt)])):p(``,!0),L.value.layout.areas.show?(x(),m(`g`,Tt,[(x(!0),m(u,null,C(X.value,(e,t)=>(x(),m(`g`,null,[e.series.length>2?(x(),m(`polygon`,{key:0,"data-cy-quadrant-area":``,fill:L.value.layout.areas.useGradient?`url(#quadrant_gradient_${k.value}_${t})`:E(c)(e.color,L.value.layout.areas.opacity),points:E(r)(e)},null,8,Et)):p(``,!0)]))),256))])):p(``,!0),h(`g`,null,[h(`rect`,{onClick:t[4]||=e=>q(`TL`),x:U.value.left,y:U.value.top,width:U.value.usableWidth/2<=0?.001:U.value.usableWidth/2,height:U.value.usableHeight/2<=0?.001:U.value.usableHeight/2,fill:`transparent`,class:v({"vue-data-ui-zoom-plus":!A.value&&K.value,"vue-data-ui-zoom-minus":A.value&&K.value})},null,10,Dt),h(`rect`,{onClick:t[5]||=e=>q(`TR`),x:U.value.centerX,y:U.value.top,width:U.value.usableWidth/2<=0?.001:U.value.usableWidth/2,height:U.value.usableHeight/2<=0?.001:U.value.usableHeight/2,fill:`transparent`,class:v({"vue-data-ui-zoom-plus":!A.value&&K.value,"vue-data-ui-zoom-minus":A.value&&K.value})},null,10,Ot),h(`rect`,{onClick:t[6]||=e=>q(`BR`),x:U.value.centerX,y:U.value.centerY,width:U.value.usableWidth/2<=0?.001:U.value.usableWidth/2,height:U.value.usableHeight/2<=0?.001:U.value.usableHeight/2,fill:`transparent`,class:v({"vue-data-ui-zoom-plus":!A.value&&K.value,"vue-data-ui-zoom-minus":A.value&&K.value})},null,10,kt),h(`rect`,{onClick:t[7]||=e=>q(`BL`),x:U.value.left,y:U.value.centerY,width:U.value.usableWidth/2<=0?.001:U.value.usableWidth/2,height:U.value.usableHeight/2<=0?.001:U.value.usableHeight/2,fill:`transparent`,class:v({"vue-data-ui-zoom-plus":!A.value&&K.value,"vue-data-ui-zoom-minus":A.value&&K.value})},null,10,At)]),F.value.plotLabels.showAsTag?(x(),m(u,{key:7},[V.value.plotLabels.show?(x(),m(`g`,Lt,[(x(!0),m(u,null,C(X.value,(e,t)=>(x(),m(u,null,[(x(!0),m(u,null,C(e.series,n=>(x(),m(`foreignObject`,{style:{overflow:`visible`},height:`10`,width:`100`,x:n.x-50,y:n.y-F.value.plotLabels.fontSize,onMouseover:r=>Sr(e,n,t),onMouseleave:e=>Cr(n,t),onClick:r=>wr(e,n,t)},[h(`div`,{style:b(`color:${E(le)(e.color)};margin: 0 auto; font-size:${F.value.plotLabels.fontSize}px; text-align:center;background:${e.color}; padding: 2px 4px; border-radius: 12px; height: fit-content;`)},T(n.name),5)],40,Rt))),256))],64))),256))])):p(``,!0)],64)):(x(),m(u,{key:6},[(x(!0),m(u,null,C(X.value,(t,n)=>(x(),m(`g`,null,[e.$slots.datapoint&&!E(In)?(x(!0),m(u,{key:0},C(t.series,r=>(x(),m(`g`,{key:r.uid},[(x(),m(`foreignObject`,{x:r.x-1,y:r.y-1,width:`2`,height:`2`,style:{overflow:`visible`,"pointer-events":`none`},onMouseenter:e=>Sr(t,r,n),onMouseleave:e=>Cr(r,n),onClick:e=>wr(t,r,n)},[w(e.$slots,`datapoint`,Ue({ref_for:!0},{datapoint:{...r,onEnter:()=>Sr(t,r,n),onLeave:()=>Cr(r,n),onClick:()=>wr(t,r,n),isSelected:Z.value&&r.uid===Z.value}}),void 0,!0)],40,jt)),h(`circle`,{"data-a11y-plot-id":r.uid,cx:r.x,cy:r.y,r:Math.max(L.value.layout.plots.radius/(A.value?1.5:1),10),fill:`transparent`,style:{"pointer-events":`none`}},null,8,Mt)]))),128)):e.$slots.datapointSvg&&!E(In)?(x(!0),m(u,{key:1},C(t.series,r=>(x(),m(`g`,{key:r.uid},[w(e.$slots,`datapointSvg`,Ue({ref_for:!0},{datapoint:{...r,onEnter:()=>Sr(t,r,n),onLeave:()=>Cr(r,n),onClick:()=>wr(t,r,n),isSelected:Z.value&&r.uid===Z.value}}),void 0,!0)]))),128)):(x(!0),m(u,{key:2},C(t.series,(e,r)=>(x(),m(`g`,{key:e.uid},[He(ke,{color:t.color,isSelected:Z.value&&e.uid===Z.value,plot:e,radius:L.value.layout.plots.radius/(A.value?1.5:1),shape:t.shape,stroke:L.value.layout.plots.outline?L.value.layout.plots.outlineColor:`none`,strokeWidth:L.value.layout.plots.outlineWidth,onMouseenter:r=>Sr(t,e,n,`pointer`),onMouseleave:t=>Cr(e,n),onClick:r=>wr(t,e,n)},null,8,[`color`,`isSelected`,`plot`,`radius`,`shape`,`stroke`,`strokeWidth`,`onMouseenter`,`onMouseleave`,`onClick`]),h(`circle`,{"data-dom-to-png-ignore":``,"data-a11y-plot-id":e.uid,cx:e.x,cy:e.y,r:Math.max(L.value.layout.plots.radius/(A.value?1.5:1),10),fill:`transparent`,style:{"pointer-events":`none`}},null,8,Nt)]))),128))]))),256)),V.value.plotLabels.show?(x(),m(`g`,Pt,[(x(!0),m(u,null,C(X.value,e=>(x(),m(`g`,null,[(x(!0),m(u,null,C(e.series,e=>(x(),m(`g`,null,[String(e.name).includes(`
1
+ import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{t}from"./useConfig-6jO1fkp5.js";import{$ as n,Ct as r,D as i,Dt as a,Ht as o,J as s,Jt as c,S as ee,X as te,Yt as ne,Zt as re,at as ie,i as l,in as ae,jt as oe,nt as se,pt as ce,r as le,t as ue,w 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-BH9r_0Vd.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"./chartImage-DPGnEuYM.js";import{n as be}from"./Title-BliHuXfT.js";import{t as xe}from"./useChartExport-BZts4KFb.js";import{n as Se,t as Ce}from"./tableIntegration-CNoJ1CIY.js";import{n as we,t as Te}from"./annotationSlots-BRR85CqJ.js";import{n as Ee,t as De}from"./userOptionsSlots-DYuo-E5m.js";import{t as Oe}from"./usePrinter-sVoTzet1.js";import{t as ke}from"./Shape-CRe8woTu.js";import{c as Ae}from"./canvas-lib-22VpOI4_.js";import{t as je}from"./useResponsive-CENUxfEL.js";import{t as Me}from"./DefGrad-DKMq1REY.js";import{t as Ne}from"./BaseLegendToggle-Q3TiW9u1.js";import{t as Pe}from"./A11yDataTable-DWNlWXzs.js";import{t as Fe}from"./useUserOptionState-CXlFnwPv.js";import{t as Ie}from"./useChartAccessibility-DOMuYJfm.js";import{t as Le}from"./Legend-DM0ClX3D.js";import{t as Re}from"./vue_ui_quadrant-BUv-SqzP.js";import{Fragment as u,Teleport as ze,computed as d,createBlock as f,createCommentVNode as p,createElementBlock as m,createElementVNode as h,createSlots as Be,createTextVNode as Ve,createVNode as He,defineAsyncComponent as g,guardReactiveProps as _,mergeProps as Ue,nextTick as We,normalizeClass as v,normalizeProps as y,normalizeStyle as b,onBeforeUnmount as Ge,onMounted as Ke,openBlock as x,ref as S,renderList as C,renderSlot as w,resolveDynamicComponent as qe,shallowRef as Je,toDisplayString as T,toRefs as Ye,unref as E,watch as Xe,withCtx as D}from"vue";var Ze=/* @__PURE__ */ e({default:()=>on}),Qe=[`id`],$e=[`id`],et=[`id`],tt={style:{position:`relative`}},nt=[`xmlns`,`aria-describedby`,`viewBox`,`id`],rt=[`x`,`y`,`width`,`height`],it={key:1},at=[`fill`,`x`,`y`,`height`,`width`,`stroke-width`,`stroke`,`rx`],ot=[`x1`,`y1`,`x2`,`y2`,`stroke`,`stroke-width`],st=[`x1`,`y1`,`x2`,`y2`,`stroke`,`stroke-width`],ct={key:2},lt=[`points`,`fill`],ut=[`points`,`fill`],dt=[`points`,`fill`],ft=[`points`,`fill`],pt={key:3},mt=[`y`,`fill`,`font-size`],ht=[`x`,`y`,`fill`,`font-size`],gt=[`x`,`y`,`fill`,`font-size`],_t=[`y`,`fill`,`font-size`],vt={key:4},yt=[`x`,`y`,`font-size`,`fill`],bt=[`x`,`y`,`font-size`,`fill`],xt=[`x`,`y`,`font-size`,`fill`],St=[`id`,`font-size`,`transform`,`fill`],Ct=[`id`,`font-size`,`transform`,`fill`],wt=[`id`,`font-size`,`transform`,`fill`],Tt={key:5},Et=[`fill`,`points`],Dt=[`x`,`y`,`width`,`height`],Ot=[`x`,`y`,`width`,`height`],kt=[`x`,`y`,`width`,`height`],At=[`x`,`y`,`width`,`height`],jt=[`x`,`y`,`onMouseenter`,`onMouseleave`,`onClick`],Mt=[`data-a11y-plot-id`,`cx`,`cy`,`r`],Nt=[`data-a11y-plot-id`,`cx`,`cy`,`r`],Pt={key:0,style:{"pointer-events":`none`}},Ft=[`x`,`y`,`font-size`,`fill`],It=[`x`,`y`,`font-size`,`fill`,`innerHTML`],Lt={key:0},Rt=[`x`,`y`,`onMouseover`,`onMouseleave`,`onClick`],zt={key:8,class:`vue-ui-dna`},Bt=[`points`,`fill`],Vt=[`points`,`fill`],Ht=[`points`,`fill`],Ut=[`points`,`fill`],Wt={key:9},Gt=[`x`,`y`,`font-size`,`fill`,`font-weight`],Kt={key:10},qt=[`x`,`y`,`fill`],Jt=[`x`,`y`,`fill`],Yt=[`x`,`y`,`fill`],Xt=[`x`,`y`,`fill`],Zt=[`stroke`,`d`],Qt=[`stroke`,`d`],$t={key:0,style:{position:`absolute`,top:`100%`,left:`0`,width:`100%`},"data-dom-to-png-ignore":``,"aria-hidden":`true`},en={key:5,class:`vue-data-ui-watermark`},tn=[`id`],nn=[`onClick`],rn={key:0,height:`14`,width:`14`,viewBox:`0 0 20 20`},an=[`innerHTML`],on=/*#__PURE__*/ _e({__name:`vue-ui-quadrant`,props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:[`selectPlot`,`selectSide`,`selectLegend`,`copyAlt`],setup(e,{expose:_e,emit:Ze}){let on=g(()=>import(`./Tooltip-C1q0Qoh7.js`)),sn=g(()=>import(`./BaseIcon-Cm-IJ179.js`).then(e=>e.n)),cn=g(()=>import(`./vue-ui-accordion-S3nRtTU-.js`).then(e=>e.n)),ln=g(()=>import(`./DataTable-0Vv-aGHD.js`)),un=g(()=>import(`./PenAndPaper-BGEp-TUm.js`).then(e=>e.t)),dn=g(()=>import(`./UserOptions-uWHV_zPB.js`).then(e=>e.n)),fn=g(()=>import(`./PackageVersion-BIhjLNBU.js`).then(e=>e.t)),pn=g(()=>import(`./BaseDraggableDialog-DHgIPVmz.js`).then(e=>e.n)),{vue_ui_quadrant:mn}=t(),O=e,hn=d(()=>!!O.dataset&&O.dataset.length),k=S(te()),gn=Ze,_n=S(!1),vn=S(``),yn=S(0),A=S(!1),j=S(null),bn=S(null),xn=S(null),Sn=S(null),Cn=S(null),wn=S(0),Tn=S(0),En=S(0),Dn=S(!1),On=S(null),kn=S(null),An=S(null),jn=S(null),Mn=S({x:0,y:0}),Nn=S(`pointer`),Pn=S(!1),M=S(Vn()),N=d(()=>M.value.userOptions),P=d(()=>M.value.style.chart.layout.grid),F=d(()=>M.value.style.chart.layout.labels),I=d(()=>M.value.style.chart.tooltip),L=d(()=>M.value.style.chart);he({config:()=>M.value,dataset:()=>O.dataset,component:`VueUiQuadrant`,rules:[ge.emptyArray,ge.noHint]});let R=d(()=>M.value.userOptions.useCursorPointer),Fn=d(()=>({defaultConfig:{userOptions:{show:!1},table:{show:!1},style:{chart:{backgroundColor:`#99999930`,layout:{grid:{stroke:`#6A6A6A`,graduations:{stroke:`#6A6A6A`,color:`#6A6A6A90`},xAxis:{auto:!0},yAxis:{auto:!0}},labels:{quadrantLabels:{show:!1},plotLabels:{show:!1},axisLabels:{show:!1}},plots:{outlineColor:`#6A6A6A`}},legend:{backgroundColor:`transparent`}}}},userConfig:M.value.skeletonConfig??{}})),{loading:In,FINAL_DATASET:Ln}=pe({...Ye(O),FINAL_CONFIG:M,prepareConfig:Vn,callback:()=>{Promise.resolve().then(async()=>{await We(),V.value.showTable=M.value.table.show})},skeletonDataset:O.config?.skeletonDataset??[{name:`_`,shape:`circle`,color:`#CACACA`,series:[{name:`_`,x:-6,y:-4},{name:`_`,x:-5,y:-2},{name:`_`,x:-4,y:-1},{name:`_`,x:-3,y:-.5},{name:`_`,x:-2,y:-.25},{name:`_`,x:-1,y:-.135},{name:`_`,x:0,y:0},{name:`_`,x:1,y:.135},{name:`_`,x:2,y:.25},{name:`_`,x:3,y:.5},{name:`_`,x:4,y:1},{name:`_`,x:5,y:2},{name:`_`,x:6,y:4}]}],skeletonConfig:ae({defaultConfig:M.value,userConfig:Fn.value})}),{userOptionsVisible:Rn,setUserOptionsVisibility:zn,keepUserOptionState:Bn}=Fe({config:M.value}),{svgRef:z}=Ie({config:L.value.title});function Vn(){return ve(O.config,mn,Re)}let Hn=re(O.config);Xe(()=>O.config,(e,t)=>{let n=re(e),r=n!==Hn;Hn=n;let i=Vn();r?(M.value=i,Rn.value=!M.value.userOptions.showOnChartHover,Gn(),wn.value+=1,Tn.value+=1,En.value+=1,V.value.plotLabels.show=F.value.plotLabels.show,V.value.showTable=M.value.table.show,V.value.showTooltip=I.value.show):(M.value.style.chart.tooltip=i.style.chart.tooltip,V.value.showTooltip=M.value.style.chart.tooltip.show)},{deep:!0});let B=Je(null),Un=Je(null),Wn=d(()=>M.value.debug);function Gn(){if(fe(O.dataset)?ie({componentName:`VueUiQuadrant`,type:`dataset`,debug:Wn.value}):Wn.value&&O.dataset.forEach((e,t)=>{[null,void 0].includes(e.name)&&ie({componentName:`VueUiQuadrant`,type:`datasetSerieAttribute`,property:`name`,index:t}),[null,void 0].includes(e.series)?ie({componentName:`VueUiQuadrant`,type:`datasetSerieAttribute`,property:`series`,index:t}):e.series.forEach((e,t)=>{[null,void 0].includes(e.name)&&ie({componentName:`VueUiQuadrant`,type:`datasetSerieAttribute`,property:`name`,key:`series`,index:t})})}),M.value.responsive){let e=Ae(()=>{let{width:e,height:t}=je({chart:j.value,title:L.value.title.text?bn.value:null,legend:L.value.legend.show?xn.value:null,source:Sn.value,noTitle:Cn.value});H.value=48,requestAnimationFrame(()=>{U.value.height=t,U.value.usableHeight=t-H.value*2,U.value.width=e,U.value.usableWidth=e-H.value*2,U.value.top=H.value,U.value.left=H.value,U.value.right=e-H.value,U.value.bottom=t-H.value,U.value.centerX=e/2,U.value.centerY=t-t/2,U.value.padding=H.value})});B.value&&(Un.value&&B.value.unobserve(Un.value),B.value.disconnect()),B.value=new ResizeObserver(e),Un.value=j.value.parentNode,B.value.observe(Un.value)}}Ke(()=>{Dn.value=!0,Gn()}),Ge(()=>{B.value&&(Un.value&&B.value.unobserve(Un.value),B.value.disconnect())});let{isPrinting:Kn,isImaging:qn,generatePdf:Jn,generateImage:Yn}=Oe({elementId:`vue-ui-quadrant_${k.value}`,fileName:L.value.title.text||`vue-ui-quadrant`,options:M.value.userOptions.print}),Xn=d(()=>M.value.userOptions.show&&!L.value.title.text),Zn=d(()=>de(M.value.customPalette)),V=S({plotLabels:{show:F.value.plotLabels.show},showTable:M.value.table.show,showTooltip:I.value.show}),H=S(48),U=S({height:L.value.height,usableHeight:L.value.height-H.value*2,width:L.value.width,usableWidth:L.value.width-H.value*2,top:H.value,left:H.value,right:L.value.width-H.value,bottom:L.value.height-H.value,centerX:L.value.width/2,centerY:L.value.height-L.value.height/2,padding:H.value}),W=S({...JSON.parse(JSON.stringify(U.value)),startX:0,startY:0});Xe(()=>U.value,e=>{e&&(W.value={...JSON.parse(JSON.stringify(U.value)),startX:0,startY:0})},{deep:!0});let G=S(null),Qn=d(()=>{switch(G.value){case`TL`:return{x:W.value.startX+W.value.width/2,y:W.value.height,text:F.value.quadrantLabels.tl.text||`Top Left`,fontSize:F.value.quadrantLabels.tl.fontSize,fill:F.value.quadrantLabels.tl.color,bold:F.value.quadrantLabels.tl.bold};case`TR`:return{x:W.value.startX+W.value.width/2,y:W.value.height,text:F.value.quadrantLabels.tr.text||`Top Right`,fontSize:F.value.quadrantLabels.tr.fontSize,fill:F.value.quadrantLabels.tr.color,bold:F.value.quadrantLabels.tr.bold};case`BR`:return{x:W.value.startX+W.value.width/2,y:W.value.height*1.678,text:F.value.quadrantLabels.br.text||`Bottom Right`,fontSize:F.value.quadrantLabels.br.fontSize,fill:F.value.quadrantLabels.br.color,bold:F.value.quadrantLabels.br.bold};case`BL`:return{x:W.value.startX+W.value.width/2,y:W.value.height*1.678,text:F.value.quadrantLabels.bl.text||`Bottom Left`,fontSize:F.value.quadrantLabels.bl.fontSize,fill:F.value.quadrantLabels.bl.color,bold:F.value.quadrantLabels.bl.bold};default:return{x:0,y:0,text:``,fontSize:0,fill:`none`,bold:!1}}}),$n=S(null),er=S(!1);function tr({targetX:e,targetY:t,targetW:n,targetH:r,side:i}){G.value&&Tr(i);let a={x:e-W.value.startX,y:t-W.value.startY,w:n-W.value.width,h:r-W.value.height},o=M.value.zoomAnimationFrames,s=0;function c(){er.value=!0,W.value.startX+=a.x/o,W.value.startY+=a.y/o,W.value.width+=a.w/o,W.value.height+=a.h/o,s+=1,s<o?$n.value=requestAnimationFrame(c):er.value=!1}c()}let K=d(()=>M.value.zoomEnabled);function q(e){if(K.value&&!er.value){if(A.value&&G.value===e)tr({targetX:0,targetY:0,targetW:U.value.width,targetH:U.value.height}),G.value=null,A.value=!1;else{switch(G.value=e,e){case`TL`:tr({targetX:0,targetY:0,targetW:U.value.width/2+U.value.left,targetH:U.value.height/2+U.value.top,side:`tl`});break;case`TR`:tr({targetX:U.value.width/2-U.value.left,targetY:0,targetW:U.value.width/2+U.value.left,targetH:U.value.height/2+U.value.top,side:`tr`});break;case`BR`:tr({targetX:U.value.width/2-U.value.left,targetY:U.value.height/2-U.value.top,targetW:U.value.width/2+U.value.left,targetH:U.value.height/2+U.value.top,side:`br`});break;case`BL`:tr({targetX:0,targetY:U.value.height/2-U.value.top,targetW:U.value.width/2+U.value.left,targetH:U.value.height/2+U.value.top,side:`bl`});break;default:W.value.startX=0,W.value.startY=0,W.value.width=U.value.width,W.value.height=U.value.height}A.value=!0}}}let nr=d(()=>{let e=P.value.graduations.steps,t=U.value.usableWidth/(e*2),n=U.value.top,r=[];for(let i=0;i<e;i+=1)r.push({x:U.value.padding+t*i,y:n+U.value.usableHeight*(i/e/2),height:U.value.usableHeight*(1-i/e),width:U.value.usableWidth*(1-i/e),opacity:Math.round((i+1)/e*20)});return r}),J=d(()=>{let e=P.value.xAxis.max,t=P.value.xAxis.min,n=P.value.yAxis.max,r=P.value.yAxis.min;return P.value.xAxis.auto&&(e=Math.max(...rr.value.flatMap(e=>e.series.map(e=>e.x))),t=Math.min(...rr.value.flatMap(e=>e.series.map(e=>e.x)))),P.value.yAxis.auto&&(n=Math.max(...rr.value.flatMap(e=>e.series.map(e=>e.y))),r=Math.min(...rr.value.flatMap(e=>e.series.map(e=>e.y)))),{x:{max:e,min:t},y:{max:n,min:r}}}),Y=S([]),rr=d(()=>Ln.value.map((e,t)=>({...e,series:oe({data:e.series,threshold:M.value.downsample.threshold}),id:`cat_${t}_${k.value}`,color:ee(e.color)||Zn.value[t]||o[t]}))),ir=d(()=>rr.value.filter(e=>!Y.value.includes(e.id))),ar=d(()=>rr.value.map((e,t)=>({...e,shape:e.shape||`circle`,series:e.series.map(t=>({...t,x:or(t.x),y:sr(t.y),xValue:t.x,yValue:t.y,quadrantSide:_r({x:t.x,y:t.y}),categoryName:e.name,category:e,shape:e.shape,color:e.color}))}))),X=d(()=>(Wn.value&&Ln.value.forEach((e,t)=>{e.series.forEach((e,t)=>{[null,void 0].includes(e.x)&&ie({componentName:`VueUiQuadrant`,type:`datasetSerieAttribute`,property:`x`,key:`series`,index:t}),[null,void 0].includes(e.y)&&ie({componentName:`VueUiQuadrant`,type:`datasetSerieAttribute`,property:`y`,key:`series`,index:t})})}),ir.value.map((e,t)=>({...e,shape:e.shape||`circle`,color:e.color||Zn.value[t]||o[t],series:e.series.map(t=>({...t,category:e,x:or(t.x),y:sr(t.y),xValue:t.x,yValue:t.y,quadrantSide:_r({x:t.x,y:t.y}),categoryName:e.name,shape:e.shape,color:e.color,uid:te()}))}))));function or(e){if(e>=0){let t=e/J.value.x.max;return U.value.centerX+U.value.usableWidth/2*t}{let t=Math.abs(e)/Math.abs(J.value.x.min);return U.value.centerX-U.value.usableWidth/2*t}}function sr(e){if(e>=0){let t=e/J.value.y.max;return U.value.centerY+(1-U.value.usableHeight/2*t)}{let t=Math.abs(e)/Math.abs(J.value.y.min);return U.value.centerY-(1-U.value.usableHeight/2*t)}}let cr=d(()=>{let e=X.value.flatMap(e=>e.series.map(t=>({x:t.xValue,y:t.yValue,name:t.name,category:t.categoryName,quadrantSide:t.quadrantSide,sideName:F.value.quadrantLabels[t.quadrantSide].text,color:e.color,shape:e.shape}))),t=P.value.xAxis.name||`x`,n=P.value.yAxis.name||`y`;return{head:[M.value.translations.category,M.value.translations.item,t,n,M.value.translations.side],body:e.map(e=>[e.category,e.name,e.x,e.y,e.sideName||e.quadrantSide]),itsShapes:e.map(e=>({shape:e.shape,color:e.color})),tableData:e}}),lr=d(()=>{let e=cr.value.head,t=cr.value.tableData.map(e=>[{shape:e.shape,color:e.color,name:e.category},e.name,l(F.value.plotLabels.x.formatter,e.x,n({v:e.x,r:F.value.plotLabels.rounding})),l(F.value.plotLabels.y.formatter,e.y,n({v:e.y,r:F.value.plotLabels.rounding})),e.sideName||e.quadrantSide]);return{head:e,body:t,a11yBody:t.map(e=>e.map((e,t)=>t===0?e.name??``:e)),config:{th:{backgroundColor:M.value.table.th.backgroundColor,color:M.value.table.th.color,outline:M.value.table.th.outline},td:{backgroundColor:M.value.table.td.backgroundColor,color:M.value.table.td.color,outline:M.value.table.td.outline},breakpoint:M.value.table.responsiveBreakpoint},colNames:e}});function ur(){Y.value.length?Y.value=[]:fr.value.forEach(e=>{Y.value.push(e.id)}),gn(`selectLegend`,Er())}function dr(e){Y.value.includes(e)?Y.value=Y.value.filter(t=>t!==e):Y.value.push(e),gn(`selectLegend`,Er())}let fr=d(()=>ar.value.map(e=>({name:e.name,shape:e.shape,color:e.color,id:e.id,opacity:Y.value.includes(e.id)?.5:1,segregate:()=>dr(e.id),isSegregated:Y.value.includes(e.id)})));function pr(e){return fr.value.length?fr.value.find(t=>t.name===e)||(Wn.value&&console.warn(`VueUiQuadrant - Series name not found "${e}"`),null):(Wn.value&&console.warn(`VueUiQuadrant - There are no series to show.`),null)}function mr(e){let t=pr(e);t!==null&&Y.value.includes(t.id)&&dr(t.id)}function hr(e){let t=pr(e);t!==null&&(Y.value.includes(t.id)||dr(t.id))}let gr=d(()=>({cy:`quadrant-div-legend`,backgroundColor:L.value.legend.backgroundColor,color:L.value.legend.color,fontSize:L.value.legend.fontSize,paddingBottom:12,fontWeight:L.value.legend.bold?`bold`:``}));function _r(e){switch(!0){case e.x>=0&&e.y>=0:return`tr`;case e.x>=0&&e.y<0:return`br`;case e.x<0&&e.y<0:return`bl`;case e.x<0&&e.y>=0:return`tl`;default:return``}}let Z=S(null),vr=S(null),yr=S(null);function br(){Z.value=null,vr.value=null,An.value=null,jn.value=null,_n.value=!1}function xr(e){if(!z.value||!e)return;let t=`[data-a11y-plot-id="${e}"]`,n=z.value.querySelector(t);if(!n)return;let r=n.getBoundingClientRect();Mn.value={x:r.left+r.width/2,y:r.top+r.height/2}}function Sr(e,t,r,i=`pointer`,o=null){M.value.events.datapointEnter&&M.value.events.datapointEnter({datapoint:t,seriesIndex:r}),Z.value=t.uid,vr.value={color:e.color,shape:e.shape},Nn.value=i,An.value=o,jn.value=t.uid,yr.value={datapoint:t,seriesIndex:r,series:X.value,config:M.value};let s=I.value.customFormat;if(a(s)&&ce(()=>s({seriesIndex:r,datapoint:t,series:X.value,config:M.value})))vn.value=s({seriesIndex:r,datapoint:t,series:X.value,config:M.value});else{let i=``;t.quadrantSide&&(i+=`<div style="color:${F.value.quadrantLabels[t.quadrantSide].color};font-weight:${F.value.quadrantLabels[t.quadrantSide].bold?`bold`:`400`}">${F.value.quadrantLabels[t.quadrantSide].text}</div>`),i+=`<div>${e.name}</div>`,i+=`<div style="padding-bottom:6px;border-bottom:1px solid ${I.value.borderColor};margin-bottom:3px">${t.name}</div>`,i+=`<div>${P.value.xAxis.name?P.value.xAxis.name:`x`}: <b>${l(F.value.plotLabels.x.formatter,t.xValue,n({v:t.xValue,r:I.value.roundingValue}),{datapoint:t,category:e,categoryIndex:r})}</b></div>`,i+=`<div>${P.value.yAxis.name?P.value.yAxis.name:`y`}: <b>${l(F.value.plotLabels.y.formatter,t.yValue,n({v:t.yValue,r:I.value.roundingValue}),{datapoint:t,category:e,categoryIndex:r})}</b></div>`,vn.value=`<div style="text-align:left;font-size:${I.value.fontSize}px">${i}</div>`}i===`keyboard`&&We(()=>{xr(t.uid)}),_n.value=!0}function Cr(e,t){M.value.events.datapointLeave&&M.value.events.datapointLeave({datapoint:e,seriesIndex:t}),(jn.value!==e.uid||Nn.value!==`keyboard`)&&(_n.value=!1,Z.value=null,vr.value=null)}function wr(e,t,n){M.value.events.datapointClick&&M.value.events.datapointClick({datapoint:t,seriesIndex:n});let r={category:e.name,shape:e.shape,itemName:t.name,x:t.xValue,y:t.yValue,quadrantSide:t.quadrantSide,sideName:F.value.quadrantLabels[t.quadrantSide].text};gn(`selectPlot`,r)}function Tr(e){if(!e)return;let t=X.value.flatMap(t=>t.series.filter(t=>t.quadrantSide===e).map(e=>({category:e.categoryName,itemName:e.name,x:e.xValue,y:e.yValue}))),n={quadrantSide:e,sideName:F.value.quadrantLabels[e].text,items:[...t]};gn(`selectSide`,n)}let Q=d(()=>({TL:{tl:{x:U.value.left+U.value.usableWidth/4-20,y:0,fill:F.value.quadrantLabels.tl.color},tr:{x:U.value.left+U.value.usableWidth/4,y:0,fill:F.value.quadrantLabels.tr.color},br:{x:U.value.left+U.value.usableWidth/4,y:20,fill:F.value.quadrantLabels.br.color},bl:{x:U.value.left+U.value.usableWidth/4-20,y:20,fill:F.value.quadrantLabels.bl.color},crosshairs:{horizontal:`M ${U.value.left+U.value.usableWidth/4-20},20 ${U.value.left+U.value.usableWidth/4+20},20`,vertical:`M ${U.value.left+U.value.usableWidth/4},0 ${U.value.left+U.value.usableWidth/4},40`}},TR:{tl:{x:U.value.centerX+U.value.usableWidth/4-20,y:0,fill:F.value.quadrantLabels.tl.color},tr:{x:U.value.centerX+U.value.usableWidth/4,y:0,fill:F.value.quadrantLabels.tr.color},br:{x:U.value.centerX+U.value.usableWidth/4,y:20,fill:F.value.quadrantLabels.br.color},bl:{x:U.value.centerX+U.value.usableWidth/4-20,y:20,fill:F.value.quadrantLabels.bl.color},crosshairs:{horizontal:`M ${U.value.centerX+U.value.usableWidth/4-20},20 ${U.value.centerX+U.value.usableWidth/4+20},20`,vertical:`M ${U.value.centerX+U.value.usableWidth/4},0 ${U.value.centerX+U.value.usableWidth/4},40`}},BR:{tl:{x:U.value.centerX+U.value.usableWidth/4-20,y:U.value.centerY-48,fill:F.value.quadrantLabels.tl.color},tr:{x:U.value.centerX+U.value.usableWidth/4,y:U.value.centerY-48,fill:F.value.quadrantLabels.tr.color},br:{x:U.value.centerX+U.value.usableWidth/4,y:U.value.centerY-28,fill:F.value.quadrantLabels.br.color},bl:{x:U.value.centerX+U.value.usableWidth/4-20,y:U.value.centerY-28,fill:F.value.quadrantLabels.bl.color},crosshairs:{horizontal:`M ${U.value.centerX+U.value.usableWidth/4-20},${U.value.centerY-28} ${U.value.centerX+U.value.usableWidth/4+20},${U.value.centerY-28}`,vertical:`M ${U.value.centerX+U.value.usableWidth/4},${U.value.centerY-48} ${U.value.centerX+U.value.usableWidth/4},${U.value.centerY-8}`}},BL:{tl:{x:U.value.left+U.value.usableWidth/4-20,y:U.value.centerY-48,fill:F.value.quadrantLabels.tl.color},tr:{x:U.value.left+U.value.usableWidth/4,y:U.value.centerY-48,fill:F.value.quadrantLabels.tr.color},br:{x:U.value.left+U.value.usableWidth/4,y:U.value.centerY-28,fill:F.value.quadrantLabels.br.color},bl:{x:U.value.left+U.value.usableWidth/4-20,y:U.value.centerY-28,fill:F.value.quadrantLabels.bl.color},crosshairs:{horizontal:`M ${U.value.left+U.value.usableWidth/4-20},${U.value.centerY-28} ${U.value.left+U.value.usableWidth/4+20},${U.value.centerY-28}`,vertical:`M ${U.value.left+U.value.usableWidth/4},${U.value.centerY-48} ${U.value.left+U.value.usableWidth/4},${U.value.centerY-8}`}}}));function Er(){return X.value.map(e=>({color:e.color,name:e.name,shape:e.shape,series:e.series.map(e=>({name:e.name,x:e.xValue,y:e.yValue,quadrantSide:e.quadrantSide,sideName:F.value.quadrantLabels[e.quadrantSide].text}))}))}function Dr(e=null){We(()=>{let t=[[L.value.title.text],[L.value.title.subtitle.text],[``]],n=cr.value.head,r=cr.value.body,a=t.concat([n]).concat(r),o=i(a);e?e(o):se({csvContent:o,title:L.value.title.text||`vue-ui-quadrant`})})}let Or=S(!1);function kr(e){Or.value=e,yn.value+=1}function Ar(){V.value.showTable=!V.value.showTable}function jr(){V.value.plotLabels.show=!V.value.plotLabels.show}function Mr(){V.value.showTooltip=!V.value.showTooltip}let Nr=S(!1);function Pr(){Nr.value=!Nr.value}let Fr=ye(j,()=>L.value.title.text),Ir=d(()=>Ce({config:M,style:L,mutableConfig:V,dialog:pn,accordion:cn,isFullscreen:Or,parent:j,maxWidth:800,isCursorPointer:R}));Xe(()=>V.value.showTable,e=>Se(e,M,On));function Lr(){V.value.showTable=!1,kn.value&&kn.value.setTableIconState(!1)}let Rr=d(()=>L.value.backgroundColor),zr=d(()=>L.value.legend),Br=d(()=>L.value.title),{isCallbackImaging:Vr,isCallbackSvg:Hr,generateSvg:Ur,onGenerateImage:Wr}=xe({svg:z,title:Br,legend:zr,legendItems:fr,backgroundColor:Rr,getSvgCallback:()=>M.value.userOptions.callbacks.svg,generateImage:Yn});async function Gr(){gn(`copyAlt`,{config:M.value,dataset:ir.value}),M.value.userOptions.callbacks.altCopy?await Promise.resolve(M.value.userOptions.callbacks.altCopy({config:M.value,dataset:ir.value})):console.warn("Vue Data UI - A callback must be set for `altCopy` in userOptions.")}function Kr(){An.value=null,jn.value=null,Pn.value=!0}function qr(){br(),Pn.value=!1}function Jr(e){if(!z.value||Nr.value||document.activeElement!==z.value||!$.value.length)return;let t=e.key===`ArrowLeft`||e.key===`ArrowUp`,n=e.key===`ArrowRight`||e.key===`ArrowDown`,r=e.key===`Enter`||e.key===` `,i=e.key===`Escape`;if(!t&&!n&&!r&&!i)return;if(e.preventDefault(),e.stopPropagation(),i){br();return}if(r){if(An.value===null)return;let e=$.value[An.value];if(!e)return;wr(e.category,e.plot,e.categoryIndex);return}let a=An.value,o=Z.value?$.value.findIndex(e=>e.plot.uid===Z.value):null,s=a!==null&&a>=0&&a<$.value.length,c=o!==null&&o>=0&&o<$.value.length;s?(a+=n?1:-1,a<0&&(a=$.value.length-1),a>=$.value.length&&(a=0)):c?(a=n?o+1:o-1,a>=$.value.length&&(a=0),a<0&&(a=$.value.length-1)):a=n?0:$.value.length-1;let ee=$.value[a];ee&&Sr(ee.category,ee.plot,ee.categoryIndex,`keyboard`,a)}let Yr=d(()=>({headers:lr.value?.colNames??[],rows:lr.value?.a11yBody??[]})),$=d(()=>X.value.flatMap((e,t)=>e.series.map(n=>({category:e,plot:n,categoryIndex:t}))));return _e({getData:Er,getImage:Fr,generatePdf:Jn,generateCsv:Dr,generateImage:Yn,generateSvg:Ur,hideSeries:hr,showSeries:mr,toggleTable:Ar,toggleLabels:jr,toggleTooltip:Mr,toggleAnnotator:Pr,toggleFullscreen:kr,copyAlt:Gr}),(e,t)=>(x(),m(`div`,{class:v(`vue-data-ui-component vue-ui-quadrant ${Or.value?`vue-data-ui-wrapper-fullscreen`:``} ${M.value.useCssAnimation?``:`vue-ui-dna`}`),ref_key:`quadrantChart`,ref:j,id:`vue-ui-quadrant_${k.value}`,style:b(`font-family:${M.value.style.fontFamily};width:100%; text-align:center;background:${L.value.backgroundColor};${M.value.responsive?`height: 100%`:``}`),onMouseenter:t[14]||=()=>E(zn)(!0),onMouseleave:t[15]||=()=>{E(zn)(!1),Pn.value||br()}},[h(`div`,{id:`chart-instructions-${k.value}`,class:`sr-only`},[h(`p`,null,T(M.value.a11y.translations.keyboardNavigation),1)],8,$e),Yr.value?.rows?.length?(x(),f(Pe,{key:0,uid:k.value,head:Yr.value.headers,body:Yr.value.rows,notice:M.value.a11y.translations.tableAvailable,caption:M.value.a11y.translations.tableCaption},null,8,[`uid`,`head`,`body`,`notice`,`caption`])):p(``,!0),N.value.buttons.annotator?(x(),f(E(un),{key:1,svgRef:E(z),backgroundColor:L.value.backgroundColor,color:L.value.color,active:Nr.value,isCursorPointer:R.value,palette:N.value.annotatorPalette,onClose:Pr},Be({_:2},[C(E(Te),t=>({name:t,fn:D(n=>[w(e.$slots,t,y(_(E(we)(t,n))),void 0,!0)])}))]),1032,[`svgRef`,`backgroundColor`,`color`,`active`,`isCursorPointer`,`palette`])):p(``,!0),Xn.value?(x(),m(`div`,{key:2,ref_key:`noTitle`,ref:Cn,class:`vue-data-ui-no-title-space`,style:`height:36px; width: 100%;background:transparent`},null,512)):p(``,!0),L.value.title.text?(x(),m(`div`,{key:3,ref_key:`chartTitle`,ref:bn,style:`width:100%;background:transparent;padding-bottom:12px`},[(x(),f(be,{key:`table_${wn.value}`,config:{title:{cy:`quadrant-title`,...L.value.title},subtitle:{cy:`quadrant-subtitle`,...L.value.title.subtitle}}},null,8,[`config`]))],512)):p(``,!0),h(`div`,{id:`legend-top-${k.value}`},null,8,et),N.value.show&&hn.value&&(E(Bn)||E(Rn))?(x(),f(E(dn),{ref_key:`userOptionsRef`,ref:kn,key:`user_options_${yn.value}`,backgroundColor:L.value.backgroundColor,color:L.value.color,isImaging:E(qn),isPrinting:E(Kn),uid:k.value,hasTooltip:N.value.buttons.tooltip&&I.value.show,hasPdf:N.value.buttons.pdf,hasImg:N.value.buttons.img,hasSvg:N.value.buttons.svg,hasXls:N.value.buttons.csv,hasTable:N.value.buttons.table,hasLabel:N.value.buttons.labels,hasFullscreen:N.value.buttons.fullscreen,hasAltCopy:N.value.buttons.altCopy,isFullscreen:Or.value,isTooltip:V.value.showTooltip,titles:{...N.value.buttonTitles},chartElement:j.value,position:N.value.position,hasAnnotator:N.value.buttons.annotator,isAnnotation:Nr.value,callbacks:N.value.callbacks,printScale:N.value.print.scale,tableDialog:M.value.table.useDialog,isCursorPointer:R.value,onToggleFullscreen:kr,onGeneratePdf:E(Jn),onGenerateCsv:Dr,onGenerateImage:E(Wr),onGenerateSvg:E(Ur),onToggleTable:Ar,onToggleLabels:jr,onToggleTooltip:Mr,onToggleAnnotator:Pr,onCopyAlt:Gr,style:b({visibility:E(Bn)?E(Rn)?`visible`:`hidden`:`visible`})},Be({_:2},[C(E(Ee)(e.$slots,`menuIcon optionTooltip optionPdf optionCsv optionImg optionSvg optionTable optionLabels optionFullscreen optionAnnotator optionAltCopy custom-menu-before custom-menu-after`),t=>({name:t,fn:D(n=>[w(e.$slots,t,y(_(E(De)(t,n))),void 0,!0)])}))]),1032,/* @__PURE__ */ `backgroundColor.color.isImaging.isPrinting.uid.hasTooltip.hasPdf.hasImg.hasSvg.hasXls.hasTable.hasLabel.hasFullscreen.hasAltCopy.isFullscreen.isTooltip.titles.chartElement.position.hasAnnotator.isAnnotation.callbacks.printScale.tableDialog.isCursorPointer.onGeneratePdf.onGenerateImage.onGenerateSvg.style`.split(`.`))):p(``,!0),h(`div`,tt,[(x(),m(`svg`,{ref_key:`svgRef`,ref:z,xmlns:E(ue),"aria-describedby":`chart-instructions-${k.value}`,class:v({"vue-data-ui-fullscreen--on":Or.value,"vue-data-ui-fulscreen--off":!Or.value}),viewBox:`${W.value.startX} ${W.value.startY} ${W.value.width} ${W.value.height}`,style:b(`max-width:100%;overflow:hidden;background:transparent;color:${L.value.color}`),id:`svg_${k.value}`,tabindex:`0`,onFocus:Kr,onBlur:qr,onKeydown:Jr},[He(E(fn)),w(e.$slots,`svg-underlayer`,{svg:{...U.value,isPrintingImg:E(Kn)||E(qn)||E(Vr),isPrintingSvg:E(Hr)}},void 0,!0),e.$slots[`chart-background`]?(x(),m(`foreignObject`,{key:0,x:W.value.startX,y:W.value.startY,width:W.value.width,height:W.value.height,style:{pointerEvents:`none`}},[w(e.$slots,`chart-background`,{},void 0,!0)],8,rt)):p(``,!0),h(`defs`,null,[(x(!0),m(u,null,C(X.value,(e,t)=>(x(),f(Me,{t:`radial`,cx:`50%`,cy:`50%`,r:`50%`,fx:`50%`,fy:`50%`,id:`quadrant_gradient_${k.value}_${t}`,key:`quadrant_gradient_${k.value}_${t}`,stops:[[`0%`,E(c)(E(ne)(e.color,.05),L.value.layout.areas.opacity),1],[`100%`,E(c)(e.color,L.value.layout.areas.opacity),1]]},null,8,[`id`,`stops`]))),128))]),P.value.graduations.show?(x(),m(`g`,it,[(x(!0),m(u,null,C(nr.value,e=>(x(),m(`rect`,{fill:P.value.graduations.fill?E(c)(P.value.graduations.color,e.opacity):`none`,x:e.x,y:e.y,height:e.height<=0?.001:e.height,width:e.width<=0?.001:e.width,"stroke-width":P.value.graduations.strokeWidth,stroke:P.value.graduations.stroke,rx:P.value.graduations.roundingForce},null,8,at))),256))])):p(``,!0),h(`line`,{x1:U.value.left,y1:U.value.centerY,x2:U.value.right,y2:U.value.centerY,stroke:P.value.stroke,"stroke-width":P.value.strokeWidth},null,8,ot),h(`line`,{x1:U.value.centerX,y1:U.value.top,x2:U.value.centerX,y2:U.value.bottom,stroke:P.value.stroke,"stroke-width":P.value.strokeWidth},null,8,st),P.value.showArrows?(x(),m(`g`,ct,[h(`polygon`,{points:`${U.value.right-8},${U.value.centerY-6} ${U.value.right},${U.value.centerY} ${U.value.right-8},${U.value.centerY+6}`,fill:P.value.stroke,stroke:`none`},null,8,lt),h(`polygon`,{points:`${U.value.left+8},${U.value.centerY-6} ${U.value.left},${U.value.centerY} ${U.value.left+8},${U.value.centerY+6}`,fill:P.value.stroke,stroke:`none`},null,8,ut),h(`polygon`,{points:`${U.value.centerX-6},${U.value.top+8} ${U.value.centerX},${U.value.top} ${U.value.centerX+6},${U.value.top+8}`,fill:P.value.stroke,stroke:`none`},null,8,dt),h(`polygon`,{points:`${U.value.centerX-6},${U.value.bottom-8} ${U.value.centerX},${U.value.bottom} ${U.value.centerX+6},${U.value.bottom-8}`,fill:P.value.stroke,stroke:`none`},null,8,ft)])):p(``,!0),F.value.quadrantLabels.show&&!A.value?(x(),m(`g`,pt,[F.value.quadrantLabels.tl.text?(x(),m(`text`,{key:0,x:0,y:U.value.top-U.value.padding/2,"text-anchor":`start`,fill:F.value.quadrantLabels.tl.color,"font-size":F.value.quadrantLabels.tl.fontSize,style:b(`font-weight:${F.value.quadrantLabels.tl.bold?`bold`:``}`),onClick:t[0]||=e=>Tr(`tl`)},T(F.value.quadrantLabels.tl.text),13,mt)):p(``,!0),F.value.quadrantLabels.tr.text?(x(),m(`text`,{key:1,x:U.value.width,y:U.value.top-U.value.padding/2,"text-anchor":`end`,fill:F.value.quadrantLabels.tr.color,"font-size":F.value.quadrantLabels.tr.fontSize,style:b(`font-weight:${F.value.quadrantLabels.tr.bold?`bold`:``}`),onClick:t[1]||=e=>Tr(`tr`)},T(F.value.quadrantLabels.tr.text),13,ht)):p(``,!0),F.value.quadrantLabels.br.text?(x(),m(`text`,{key:2,x:U.value.width,y:U.value.bottom+U.value.padding*.7,"text-anchor":`end`,fill:F.value.quadrantLabels.br.color,"font-size":F.value.quadrantLabels.br.fontSize,style:b(`font-weight:${F.value.quadrantLabels.br.bold?`bold`:``}`),onClick:t[2]||=e=>Tr(`br`)},T(F.value.quadrantLabels.br.text),13,gt)):p(``,!0),F.value.quadrantLabels.bl.text?(x(),m(`text`,{key:3,x:0,y:U.value.bottom+U.value.padding*.7,"text-anchor":`start`,fill:F.value.quadrantLabels.bl.color,"font-size":F.value.quadrantLabels.bl.fontSize,style:b(`font-weight:${F.value.quadrantLabels.bl.bold?`bold`:``}`),onClick:t[3]||=e=>Tr(`bl`)},T(F.value.quadrantLabels.bl.text),13,_t)):p(``,!0)])):p(``,!0),F.value.axisLabels.show?(x(),m(`g`,vt,[P.value.yAxis.show?(x(),m(`text`,{key:0,x:U.value.centerX,y:U.value.top-U.value.padding/6,"text-anchor":`middle`,"font-size":F.value.axisLabels.fontSize,fill:F.value.axisLabels.color.positive},T(E(l)(F.value.plotLabels.y.formatter,J.value.y.max,E(n)({v:J.value.y.max,r:F.value.plotLabels.rounding}))),9,yt)):p(``,!0),h(`text`,{x:U.value.centerX,y:U.value.top-U.value.padding/2,"text-anchor":`middle`,"font-size":F.value.axisLabels.fontSize,fill:F.value.axisLabels.color.positive},T(P.value.yAxis.name),9,bt),P.value.yAxis.show?(x(),m(`text`,{key:1,x:U.value.centerX,y:U.value.bottom+U.value.padding*.35,"text-anchor":`middle`,"font-size":F.value.axisLabels.fontSize,fill:F.value.axisLabels.color.negative},T(E(l)(F.value.plotLabels.y.formatter,J.value.y.min,E(n)({v:J.value.y.min,r:F.value.plotLabels.rounding}))),9,xt)):p(``,!0),P.value.xAxis.show?(x(),m(`text`,{key:2,id:`xLabelMin_${k.value}`,"text-anchor":`middle`,"font-size":F.value.axisLabels.fontSize,transform:`translate(${U.value.padding-F.value.axisLabels.fontSize}, ${U.value.height/2}), rotate(-90)`,fill:F.value.axisLabels.color.negative},T(E(l)(F.value.plotLabels.x.formatter,J.value.x.min,E(n)({v:J.value.x.min,r:F.value.plotLabels.rounding}))),9,St)):p(``,!0),P.value.xAxis.show?(x(),m(`text`,{key:3,id:`xLabelMax_${k.value}`,"text-anchor":`middle`,"font-size":F.value.axisLabels.fontSize,transform:`translate(${U.value.width-U.value.padding+F.value.axisLabels.fontSize}, ${U.value.height/2}), rotate(90)`,fill:F.value.axisLabels.color.positive},T(E(l)(F.value.plotLabels.x.formatter,J.value.x.max,E(n)({v:J.value.x.max,r:F.value.plotLabels.rounding}))),9,Ct)):p(``,!0),h(`text`,{id:`xLabelMaxName_${k.value}`,"text-anchor":`middle`,"font-size":F.value.axisLabels.fontSize,transform:`translate(${U.value.width-F.value.axisLabels.fontSize}, ${U.value.height/2}), rotate(90)`,fill:F.value.axisLabels.color.positive},T(P.value.xAxis.name),9,wt)])):p(``,!0),L.value.layout.areas.show?(x(),m(`g`,Tt,[(x(!0),m(u,null,C(X.value,(e,t)=>(x(),m(`g`,null,[e.series.length>2?(x(),m(`polygon`,{key:0,"data-cy-quadrant-area":``,fill:L.value.layout.areas.useGradient?`url(#quadrant_gradient_${k.value}_${t})`:E(c)(e.color,L.value.layout.areas.opacity),points:E(r)(e)},null,8,Et)):p(``,!0)]))),256))])):p(``,!0),h(`g`,null,[h(`rect`,{onClick:t[4]||=e=>q(`TL`),x:U.value.left,y:U.value.top,width:U.value.usableWidth/2<=0?.001:U.value.usableWidth/2,height:U.value.usableHeight/2<=0?.001:U.value.usableHeight/2,fill:`transparent`,class:v({"vue-data-ui-zoom-plus":!A.value&&K.value,"vue-data-ui-zoom-minus":A.value&&K.value})},null,10,Dt),h(`rect`,{onClick:t[5]||=e=>q(`TR`),x:U.value.centerX,y:U.value.top,width:U.value.usableWidth/2<=0?.001:U.value.usableWidth/2,height:U.value.usableHeight/2<=0?.001:U.value.usableHeight/2,fill:`transparent`,class:v({"vue-data-ui-zoom-plus":!A.value&&K.value,"vue-data-ui-zoom-minus":A.value&&K.value})},null,10,Ot),h(`rect`,{onClick:t[6]||=e=>q(`BR`),x:U.value.centerX,y:U.value.centerY,width:U.value.usableWidth/2<=0?.001:U.value.usableWidth/2,height:U.value.usableHeight/2<=0?.001:U.value.usableHeight/2,fill:`transparent`,class:v({"vue-data-ui-zoom-plus":!A.value&&K.value,"vue-data-ui-zoom-minus":A.value&&K.value})},null,10,kt),h(`rect`,{onClick:t[7]||=e=>q(`BL`),x:U.value.left,y:U.value.centerY,width:U.value.usableWidth/2<=0?.001:U.value.usableWidth/2,height:U.value.usableHeight/2<=0?.001:U.value.usableHeight/2,fill:`transparent`,class:v({"vue-data-ui-zoom-plus":!A.value&&K.value,"vue-data-ui-zoom-minus":A.value&&K.value})},null,10,At)]),F.value.plotLabels.showAsTag?(x(),m(u,{key:7},[V.value.plotLabels.show?(x(),m(`g`,Lt,[(x(!0),m(u,null,C(X.value,(e,t)=>(x(),m(u,null,[(x(!0),m(u,null,C(e.series,n=>(x(),m(`foreignObject`,{style:{overflow:`visible`},height:`10`,width:`100`,x:n.x-50,y:n.y-F.value.plotLabels.fontSize,onMouseover:r=>Sr(e,n,t),onMouseleave:e=>Cr(n,t),onClick:r=>wr(e,n,t)},[h(`div`,{style:b(`color:${E(le)(e.color)};margin: 0 auto; font-size:${F.value.plotLabels.fontSize}px; text-align:center;background:${e.color}; padding: 2px 4px; border-radius: 12px; height: fit-content;`)},T(n.name),5)],40,Rt))),256))],64))),256))])):p(``,!0)],64)):(x(),m(u,{key:6},[(x(!0),m(u,null,C(X.value,(t,n)=>(x(),m(`g`,null,[e.$slots.datapoint&&!E(In)?(x(!0),m(u,{key:0},C(t.series,r=>(x(),m(`g`,{key:r.uid},[(x(),m(`foreignObject`,{x:r.x-1,y:r.y-1,width:`2`,height:`2`,style:{overflow:`visible`,"pointer-events":`none`},onMouseenter:e=>Sr(t,r,n),onMouseleave:e=>Cr(r,n),onClick:e=>wr(t,r,n)},[w(e.$slots,`datapoint`,Ue({ref_for:!0},{datapoint:{...r,onEnter:()=>Sr(t,r,n),onLeave:()=>Cr(r,n),onClick:()=>wr(t,r,n),isSelected:Z.value&&r.uid===Z.value}}),void 0,!0)],40,jt)),h(`circle`,{"data-a11y-plot-id":r.uid,cx:r.x,cy:r.y,r:Math.max(L.value.layout.plots.radius/(A.value?1.5:1),10),fill:`transparent`,style:{"pointer-events":`none`}},null,8,Mt)]))),128)):e.$slots.datapointSvg&&!E(In)?(x(!0),m(u,{key:1},C(t.series,r=>(x(),m(`g`,{key:r.uid},[w(e.$slots,`datapointSvg`,Ue({ref_for:!0},{datapoint:{...r,onEnter:()=>Sr(t,r,n),onLeave:()=>Cr(r,n),onClick:()=>wr(t,r,n),isSelected:Z.value&&r.uid===Z.value}}),void 0,!0)]))),128)):(x(!0),m(u,{key:2},C(t.series,(e,r)=>(x(),m(`g`,{key:e.uid},[He(ke,{color:t.color,isSelected:Z.value&&e.uid===Z.value,plot:e,radius:L.value.layout.plots.radius/(A.value?1.5:1),shape:t.shape,stroke:L.value.layout.plots.outline?L.value.layout.plots.outlineColor:`none`,strokeWidth:L.value.layout.plots.outlineWidth,onMouseenter:r=>Sr(t,e,n,`pointer`),onMouseleave:t=>Cr(e,n),onClick:r=>wr(t,e,n)},null,8,[`color`,`isSelected`,`plot`,`radius`,`shape`,`stroke`,`strokeWidth`,`onMouseenter`,`onMouseleave`,`onClick`]),h(`circle`,{"data-dom-to-png-ignore":``,"data-a11y-plot-id":e.uid,cx:e.x,cy:e.y,r:Math.max(L.value.layout.plots.radius/(A.value?1.5:1),10),fill:`transparent`,style:{"pointer-events":`none`}},null,8,Nt)]))),128))]))),256)),V.value.plotLabels.show?(x(),m(`g`,Pt,[(x(!0),m(u,null,C(X.value,e=>(x(),m(`g`,null,[(x(!0),m(u,null,C(e.series,e=>(x(),m(`g`,null,[String(e.name).includes(`
2
2
  `)?(x(),m(`text`,{key:1,x:e.x,y:e.y+F.value.plotLabels.offsetY+L.value.layout.plots.radius,"text-anchor":`middle`,"font-size":F.value.plotLabels.fontSize/(A.value?1.5:1),fill:F.value.plotLabels.color,innerHTML:E(s)({content:String(e.name),fontSize:L.value.layout.labels.plotLabels.fontSize/(A.value?1.5:1),fill:L.value.layout.labels.plotLabels.color,x:e.x,y:e.y+L.value.layout.labels.plotLabels.offsetY+L.value.layout.plots.radius})},null,8,It)):(x(),m(`text`,{key:0,x:e.x,y:e.y+F.value.plotLabels.offsetY+L.value.layout.plots.radius,"text-anchor":`middle`,"font-size":F.value.plotLabels.fontSize/(A.value?1.5:1),fill:F.value.plotLabels.color},T(e.name),9,Ft))]))),256))]))),256))])):p(``,!0)],64)),A.value?(x(),m(`g`,zt,[G.value===`TL`?(x(),m(`polygon`,{key:0,points:`${U.value.left-1},${U.value.centerY} ${U.value.centerX},${U.value.centerY} ${U.value.centerX},${U.value.top-1} ${U.value.right},${U.value.top-1} ${U.value.right},${U.value.bottom} ${U.value.left-1},${U.value.bottom} ${U.value.left-1},${U.value.centerY}`,fill:L.value.backgroundColor,style:{opacity:`1`}},null,8,Bt)):p(``,!0),G.value===`TR`?(x(),m(`polygon`,{key:1,points:`${U.value.left},${U.value.top-1} ${U.value.centerX},${U.value.top-1} ${U.value.centerX},${U.value.centerY} ${U.value.right+1},${U.value.centerY} ${U.value.right+1},${U.value.bottom} ${U.value.left},${U.value.bottom} ${U.value.left},${U.value.top-1}`,fill:L.value.backgroundColor,style:{opacity:`1`}},null,8,Vt)):p(``,!0),G.value===`BR`?(x(),m(`polygon`,{key:2,points:`${U.value.left},${U.value.top} ${U.value.right+1},${U.value.top} ${U.value.right+1},${U.value.centerY} ${U.value.centerX},${U.value.centerY} ${U.value.centerX},${U.value.bottom+1} ${U.value.left},${U.value.bottom+1} ${U.value.left},${U.value.top}`,fill:L.value.backgroundColor,style:{opacity:`1`}},null,8,Ht)):p(``,!0),G.value===`BL`?(x(),m(`polygon`,{key:3,points:`${U.value.left-1},${U.value.top} ${U.value.right},${U.value.top} ${U.value.right},${U.value.bottom+1} ${U.value.centerX},${U.value.bottom+1} ${U.value.centerX},${U.value.centerY} ${U.value.left-1},${U.value.centerY} ${U.value.left-1},${U.value.top}`,fill:L.value.backgroundColor,style:{opacity:`1`}},null,8,Ut)):p(``,!0)])):p(``,!0),G.value&&!er.value?(x(),m(`g`,Wt,[h(`text`,{x:Qn.value.x,y:Qn.value.y-Qn.value.fontSize/1.5,"font-size":Qn.value.fontSize/1.5,fill:Qn.value.fill,"text-anchor":`middle`,"font-weight":Qn.value.bold?`bold`:`normal`},T(Qn.value.text),9,Gt)])):p(``,!0),A.value&&G.value?(x(),m(`g`,Kt,[h(`rect`,{x:Q.value[G.value].tl.x,y:Q.value[G.value].tl.y,height:`20`,width:`20`,fill:Q.value[G.value].tl.fill,style:b(`cursor: ${R.value?`pointer`:`default`}; opacity: ${G.value===`TL`?1:.2}`),onClick:t[8]||=e=>q(`TL`),class:v({"vue-ui-quadrant-mini-map-cell":!0,"vue-ui-quadrant-mini-map-cell-selectable":G.value!==`TL`})},null,14,qt),h(`rect`,{x:Q.value[G.value].tr.x,y:Q.value[G.value].tr.y,height:`20`,width:`20`,fill:Q.value[G.value].tr.fill,style:b(`cursor: ${R.value?`pointer`:`default`}; opacity: ${G.value===`TR`?1:.2}`),onClick:t[9]||=e=>q(`TR`),class:v({"vue-ui-quadrant-mini-map-cell":!0,"vue-ui-quadrant-mini-map-cell-selectable":G.value!==`TR`})},null,14,Jt),h(`rect`,{x:Q.value[G.value].br.x,y:Q.value[G.value].br.y,height:`20`,width:`20`,fill:Q.value[G.value].br.fill,style:b(`cursor: ${R.value?`pointer`:`default`}; opacity: ${G.value===`BR`?1:.2}`),onClick:t[10]||=e=>q(`BR`),class:v({"vue-ui-quadrant-mini-map-cell":!0,"vue-ui-quadrant-mini-map-cell-selectable":G.value!==`BR`})},null,14,Yt),h(`rect`,{x:Q.value[G.value].bl.x,y:Q.value[G.value].bl.y,height:`20`,width:`20`,fill:Q.value[G.value].bl.fill,style:b(`cursor: ${R.value?`pointer`:`default`}; opacity: ${G.value===`BL`?1:.2}`),onClick:t[11]||=e=>q(`BL`),class:v({"vue-ui-quadrant-mini-map-cell":!0,"vue-ui-quadrant-mini-map-cell-selectable":G.value!==`BL`})},null,14,Xt),h(`path`,{class:`vue-ui-quadrant-minimap-crosshairs`,stroke:L.value.backgroundColor,"stroke-width":1,d:Q.value[G.value].crosshairs.horizontal},null,8,Zt),h(`path`,{class:`vue-ui-quadrant-minimap-crosshairs`,stroke:L.value.backgroundColor,"stroke-width":1,d:Q.value[G.value].crosshairs.vertical},null,8,Qt)])):p(``,!0),w(e.$slots,`svg`,{svg:{...U.value,isPrintingImg:E(Kn)||E(qn)||E(Vr),isPrintingSvg:E(Hr)}},void 0,!0)],46,nt)),e.$slots.hint?(x(),m(`div`,$t,[w(e.$slots,`hint`,y(_({hint:M.value.a11y.translations.keyboardNavigation,isVisible:Pn.value})),void 0,!0)])):p(``,!0)]),e.$slots.watermark?(x(),m(`div`,en,[w(e.$slots,`watermark`,y(_({isPrinting:E(Kn)||E(qn)||E(Vr)||E(Hr)})),void 0,!0)])):p(``,!0),h(`div`,{id:`legend-bottom-${k.value}`},null,8,tn),Dn.value&&(L.value.legend.show||e.$slots.legend)?(x(),f(ze,{key:6,to:L.value.legend.position===`top`?`#legend-top-${k.value}`:`#legend-bottom-${k.value}`},[h(`div`,{ref_key:`chartLegend`,ref:xn},[w(e.$slots,`legend`,{legend:fr.value},()=>[L.value.legend.show?(x(),f(Le,{key:`legend_${En.value}`,legendSet:fr.value,config:gr.value,isCursorPointer:R.value,onClickMarker:t[12]||=({legend:e})=>dr(e.id)},{item:D(({legend:e})=>[E(In)?p(``,!0):(x(),m(`div`,{key:0,onClick:t=>dr(e.id),style:b(`opacity:${Y.value.includes(e.id)?.5:1}`)},T(e.name),13,nn))]),legendToggle:D(()=>[fr.value.length>2&&L.value.legend.selectAllToggle.show&&!E(In)?(x(),f(Ne,{key:0,backgroundColor:L.value.legend.selectAllToggle.backgroundColor,color:L.value.legend.selectAllToggle.color,fontSize:L.value.legend.fontSize,checked:Y.value.length>0,isCursorPointer:R.value,onToggle:ur},null,8,[`backgroundColor`,`color`,`fontSize`,`checked`,`isCursorPointer`])):p(``,!0)]),_:1},8,[`legendSet`,`config`,`isCursorPointer`])):p(``,!0)],!0)],512)],8,[`to`])):p(``,!0),e.$slots.source?(x(),m(`div`,{key:7,ref_key:`source`,ref:Sn,dir:`auto`},[w(e.$slots,`source`,{},void 0,!0)],512)):p(``,!0),He(E(on),{teleportTo:I.value.teleportTo,show:V.value.showTooltip&&_n.value,backgroundColor:I.value.backgroundColor,color:I.value.color,borderRadius:I.value.borderRadius,borderColor:I.value.borderColor,borderWidth:I.value.borderWidth,fontSize:I.value.fontSize,backgroundOpacity:I.value.backgroundOpacity,position:I.value.position,offsetX:I.value.offsetX,offsetY:I.value.offsetY,parent:j.value,content:vn.value,isFullscreen:Or.value,isCustom:I.value.customFormat&&typeof I.value.customFormat==`function`,smooth:I.value.smooth,backdropFilter:I.value.backdropFilter,smoothForce:I.value.smoothForce,smoothSnapThreshold:I.value.smoothSnapThreshold,isA11yMode:Nn.value===`keyboard`,a11yPosition:Mn.value},{"tooltip-before":D(()=>[w(e.$slots,`tooltip-before`,y(_({...yr.value})),void 0,!0)]),tooltip:D(()=>[w(e.$slots,`tooltip`,y(_({...yr.value})),void 0,!0)]),"tooltip-after":D(()=>[w(e.$slots,`tooltip-after`,y(_({...yr.value})),void 0,!0)]),default:D(()=>[I.value.showShape?(x(),m(`svg`,rn,[He(ke,{plot:{x:10,y:10},shape:vr.value.shape,color:vr.value.color,radius:8,stroke:L.value.layout.plots.outline?L.value.layout.plots.outlineColor:`none`,"stroke-width":L.value.layout.plots.outlineWidth},null,8,[`shape`,`color`,`stroke`,`stroke-width`])])):p(``,!0)]),_:3},8,[`teleportTo`,`show`,`backgroundColor`,`color`,`borderRadius`,`borderColor`,`borderWidth`,`fontSize`,`backgroundOpacity`,`position`,`offsetX`,`offsetY`,`parent`,`content`,`isFullscreen`,`isCustom`,`smooth`,`backdropFilter`,`smoothForce`,`smoothSnapThreshold`,`isA11yMode`,`a11yPosition`]),hn.value&&N.value.buttons.table?(x(),f(qe(Ir.value.component),Ue({key:8},Ir.value.props,{ref_key:`tableUnit`,ref:On,onClose:Lr}),Be({content:D(()=>[(x(),f(E(ln),{key:`table_${Tn.value}`,colNames:lr.value.colNames,head:lr.value.head,body:lr.value.body,config:lr.value.config,title:M.value.table.useDialog?``:Ir.value.title,withCloseButton:!M.value.table.useDialog,isCursorPointer:R.value,onClose:Lr},{th:D(({th:e})=>[Ve(T(e),1)]),td:D(({td:e})=>[h(`div`,{innerHTML:e.name||e},null,8,an)]),_:1},8,[`colNames`,`head`,`body`,`config`,`title`,`withCloseButton`,`isCursorPointer`]))]),_:2},[M.value.table.useDialog?{name:`title`,fn:D(()=>[Ve(T(Ir.value.title),1)]),key:`0`}:void 0,M.value.table.useDialog?{name:`actions`,fn:D(()=>[h(`button`,{tabindex:`0`,class:`vue-ui-user-options-button`,onClick:t[13]||=e=>Dr(N.value.callbacks.csv),style:b({cursor:R.value?`pointer`:`default`})},[He(E(sn),{name:`fileCsv`,stroke:Ir.value.props.color},null,8,[`stroke`])],4)]),key:`1`}:void 0]),1040)):p(``,!0),w(e.$slots,`skeleton`,{},()=>[E(In)?(x(),f(me,{key:0})):p(``,!0)],!0)],46,Qe))}},[[`__scopeId`,`data-v-405ea290`]]);export{Ze as n,on as t};
@@ -1,4 +1,4 @@
1
- import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{t}from"./useConfig-6jO1fkp5.js";import{$ as n,Dt as r,Ht as i,It as a,J as o,Kt as s,P as c,S as ee,X as l,_ as te,at as ne,b as u,et as re,f as d,h as ie,i as f,in as p,nn as ae,p as oe,pt as se,t as ce,w as le,zt as ue}from"./lib-rPeBMZrn.js";import{n as de,t as fe}from"./BaseScanner-8NdoBs7B.js";import{n as pe,t as me}from"./useHints-BH9r_0Vd.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{t as ye}from"./useChartExport-BZts4KFb.js";import{n as be,t as xe}from"./annotationSlots-BRR85CqJ.js";import{n as Se,t as Ce}from"./userOptionsSlots-DYuo-E5m.js";import{t as we}from"./useTimeLabels-Das5O74F.js";import{t as Te}from"./usePrinter-sVoTzet1.js";import{t as Ee}from"./useTransitions-ChGGrtrv.js";import{t as De}from"./useStableElementSize-CegFbRlF.js";import{t as Oe}from"./useSvgLabelLayout-D1I8sQUi.js";import{t as ke}from"./useTimeLabelCollider-BTybMUFi.js";import{t as Ae}from"./useResponsive-CENUxfEL.js";import{t as je}from"./SlicerPreview-CFFUOlQr.js";import{t as Me}from"./BaseLegendToggle-Q3TiW9u1.js";import{t as Ne}from"./A11yDataTable-DWNlWXzs.js";import{t as Pe}from"./useChartAccessibility-DOMuYJfm.js";import{t as Fe}from"./vue_ui_quick_chart-BRfcRW6Z.js";import{Fragment as m,Teleport as Ie,computed as h,createBlock as Le,createCommentVNode as g,createElementBlock as _,createElementVNode as v,createSlots as Re,createVNode as ze,defineAsyncComponent as Be,guardReactiveProps as Ve,mergeProps as He,nextTick as Ue,normalizeClass as y,normalizeProps as We,normalizeStyle as b,onBeforeUnmount as Ge,onMounted as Ke,openBlock as x,ref as S,renderList as C,renderSlot as w,shallowRef as qe,toDisplayString as T,toRefs as Je,unref as E,watch as Ye,watchEffect as Xe,withCtx as Ze}from"vue";var D={LINE:`LINE`,BAR:`BAR`,DONUT:`DONUT`},Qe=[`SERIE`,`SERIES`,`DATA`,`VALUE`,`VALUES`,`NUM`];function $e({dataset:e,barLineSwitch:t=6,debug:n=!0}){let r=null,i=null,a=0;if((typeof e==`number`||typeof e==`string`)&&n&&console.warn(`The provided dataset (${e}) is not sufficient to build a chart`),tt(e)&&(O(e)&&(r=e.length<t?D.BAR:D.LINE,i=e,a=e.length),nt(e))){if(!it(e))return n&&console.warn(`The objects in the dataset array have a different data structure. Either keys or value types are different.`),!1;let o=Object.keys(e[0]),s=Object.values(e[0]);if(!o.some(e=>at(e)))return n&&console.warn(`The data type of the dataset objects in the array must contain one of the following keys: DATA, SERIES, VALUE, VALUES, NUM. Casing is not important.`),!1;ot(s,e=>typeof e==`number`)&&(r=D.DONUT,i=e),ot(s,e=>Array.isArray(e)&&O(e))&&(r=st(e)>t?D.LINE:D.BAR,a=st(e),i=e.map(e=>({...e,data:ct(e,e=>O(e))}))),e=e.map(e=>k(e)),i=i.map(e=>k(e))}return{dataset:e,type:r,usableDataset:i,maxSeriesLength:a}}function et(e){return!e||tt(e)&&!e.length}function tt(e){return Array.isArray(e)}function O(e){if(!tt(e)||et(e))return!1;let t=e.map(e=>Number(e));return![...new Set(t.flatMap(e=>typeof e==`number`&&!isNaN(e)))].includes(!1)}function nt(e){return!tt(e)||et(e)||[...new Set(e.flatMap(e=>typeof e==`object`&&!Array.isArray(e)))].includes(!1)?!1:!e.map(e=>Object.keys(e).length>0).includes(!1)}function rt(e,t){let n=Object.keys(e).sort(),r=Object.keys(t).sort();if(n.length!==r.length)return!1;for(let i=0;i<n.length;i+=1){let a=n[i],o=r[i];if(a!==o||typeof e[a]!=typeof t[o])return!1}return!0}function it(e){if(e.length<=1)return!0;for(let t=0;t<e.length;t+=1)for(let n=t+1;n<e.length;n+=1)if(!rt(e[t],e[n]))return!1;return!0}function at(e){return Qe.includes(e.toUpperCase())}function ot(e,t){let n=[];for(let r=0;r<e.length;r+=1)n.push(t(e[r]));return n.includes(!0)}function st(e){return Math.max(...[...e].flatMap(e=>Object.values(e).filter(e=>O(e)).map(e=>e.length)))}function ct(e,t){return Object.values(e).filter(e=>t(e))[0]}function k(e){let t={};for(let n in e)e.hasOwnProperty(n)&&(t[n.toUpperCase()]=e[n]);return t}var A=/* @__PURE__ */ e({default:()=>In}),lt=[`id`],ut=[`id`],dt=[`id`],ft={style:{position:`relative`}},pt=[`xmlns`,`aria-describedby`,`viewBox`],mt=[`x`,`y`,`width`,`height`],ht=[`x`,`y`,`width`,`height`],gt=[`width`,`height`],_t=[`id`],vt=[`id`],yt=[`id`],bt=[`flood-color`],xt={key:0,class:`donut-label-connectors`},St=[`d`,`stroke`,`stroke-width`,`filter`],Ct=[`cx`,`cy`,`r`,`fill`,`filter`],wt={class:`donut`},Tt=[`d`,`fill`,`stroke`,`stroke-width`,`filter`],Et=[`d`,`onMouseenter`,`onMouseout`,`onClick`],Dt={key:1,class:`donut-labels`},Ot=[`cx`,`cy`,`fill`,`stroke`,`filter`],kt=[`text-anchor`,`x`,`y`,`fill`,`font-size`,`filter`],At=[`text-anchor`,`x`,`y`,`fill`,`font-size`,`filter`],jt={key:2,class:`donut-hollow`},Mt=[`x`,`y`,`font-size`,`fill`],Nt=[`x`,`y`,`font-size`,`fill`],Pt={key:0,class:`line-grid`},Ft=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`],It=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`],Lt={key:1,class:`line-axis`},Rt=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`],zt=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`],Bt=[`d`,`stroke`,`stroke-width`],Vt=[`transform`,`font-size`,`fill`],Ht={key:3,class:`periodLabels`},Ut=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`],Wt={key:0},Gt=[`font-size`,`text-anchor`,`fill`,`transform`],Kt=[`font-size`,`text-anchor`,`fill`,`transform`,`innerHTML`],qt={class:`plots`},Jt=[`d`,`stroke`,`stroke-width`],Yt=[`d`,`stroke`,`stroke-width`],Xt=[`d`,`stroke`,`stroke-width`],Zt=[`d`,`stroke`,`stroke-width`],Qt=[`cx`,`cy`,`fill`,`stroke`],$t={key:4,class:`dataLabels`},en=[`font-size`,`fill`,`transform`],tn={key:5,class:`tooltip-traps`},nn=[`x`,`y`,`height`,`width`,`fill`,`onMouseenter`,`onMouseleave`,`onClick`],rn={key:0,class:`line-grid`},an=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`],on=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`],sn={key:1,class:`line-axis`},cn=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`],ln=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`],un=[`d`,`stroke`,`stroke-width`],dn=[`transform`,`font-size`,`fill`],fn={key:3,class:`periodLabels`},pn=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`],mn={key:0},hn=[`font-size`,`text-anchor`,`fill`,`transform`],gn=[`font-size`,`text-anchor`,`fill`,`transform`,`innerHTML`],_n={class:`plots`},vn=[`x`,`width`,`height`,`y`,`fill`,`stroke`,`stroke-width`],yn={key:4,class:`dataLabels`},bn=[`transform`,`font-size`,`fill`],xn={key:5,class:`tooltip-traps`},Sn=[`x`,`y`,`height`,`width`,`fill`,`onMouseenter`,`onMouseleave`,`onClick`],Cn={key:6,class:`axis-labels`},wn=[`font-size`,`fill`,`x`,`y`],Tn=[`font-size`,`fill`,`x`,`y`],En=[`font-size`,`fill`,`transform`],Dn=[`font-size`,`fill`,`transform`],On=[`x`,`y`,`width`,`height`,`fill`,`fill-opacity`,`stroke`,`stroke-opacity`,`stroke-width`,`stroke-dasharray`],kn={key:1,style:{position:`absolute`,top:`100%`,left:`0`,width:`100%`},"data-dom-to-png-ignore":``,"aria-hidden":`true`},An={key:5,class:`vue-data-ui-watermark`},jn=[`id`],Mn=[`onClick`,`onKeydown`],Nn=[`onClick`,`onKeydown`],Pn=[`onClick`,`onKeydown`],Fn={key:1,class:`vue-ui-quick-chart-not-processable`},In=/*#__PURE__*/ he({__name:`vue-ui-quick-chart`,props:{config:{type:Object,default(){return{}}},dataset:{type:[Array,Object,String,Number],default(){return null}},zoomState:{type:Object,default:null}},emits:[`selectDatapoint`,`selectLegend`,`zoomStart`,`zoomEnd`,`zoomReset`,`update:zoomState`,`copyAlt`],setup(e,{expose:he,emit:Qe}){let et=Be(()=>import(`./BaseIcon-Cm-IJ179.js`).then(e=>e.n)),tt=Be(()=>import(`./PackageVersion-C4ZM3Vf7.js`).then(e=>e.t)),rt=Be(()=>import(`./PenAndPaper-BGEp-TUm.js`).then(e=>e.t)),it=Be(()=>import(`./Tooltip-C1q0Qoh7.js`)),at=Be(()=>import(`./UserOptions-uWHV_zPB.js`).then(e=>e.n)),{vue_ui_quick_chart:ot}=t(),{isThemeValid:st,warnInvalidTheme:ct}=_e(),k=e,A=S(null),In=S(null),Ln=S(null),Rn=S(null),j=S(l()),M=S(!1),zn=S(null),Bn=S(``),N=S(null),Vn=S(null),Hn=S(null),P=S([]),Un=S(0),Wn=S(0),Gn=S(!1),Kn=S(null),qn=S(null),Jn=S(null),Yn=S(null),Xn=S(null),Zn=S(null),Qn=qe(null),$n=S(!1),er=S(0),tr=S(0),nr=S(!1);function rr(){Qn.value=A.value?.parentNode??null}function ir(){return new Promise(e=>{requestAnimationFrame(()=>{requestAnimationFrame(e)})})}async function ar(){let e=++tr.value;$n.value=!1,await Ue(),await ir(),await ir(),e===tr.value&&(er.value+=1,$n.value=!0)}function or(){nr.value||(nr.value=!0,Ue(()=>{nr.value=!1,rr(),ar()}))}let sr=De({elementRef:Qn,minimumWidth:2,minimumHeight:2,stableFramesRequired:2,once:!1,onSizeAccepted:()=>{ar()}});S(`#FFFFFF`);let F=S(xr());pe({config:()=>F.value,dataset:()=>k.dataset,component:`VueUiQuickChart`,rules:[me.emptyArray,{test:()=>!0,message:[`👀 This is a swiss-knife component. If you need more control, consider using dedicated components:`,``,`▶️ VueUiXy for time series line and/or bars`,``,`▶️ VueUiDonut, VueUiWaffle, VueUiRings for proportions`]}]});let{transitionEnabled:I}=Ee({config:()=>F.value.transitions,dataset:()=>k.dataset}),cr=h(()=>F.value.debug),lr=h(()=>F.value.useCursorPointer),L=S(null),ur=S({x:0,y:0}),R=S(`pointer`),dr=S(!1),fr=h(()=>p({dafaultConfig:{backgroundColor:`#99999930`,customPalette:[`#BABABA`],showDataLabels:!1,paletteStartIndex:0,showUserOptions:!1,showTooltip:!1,xAxisLabel:``,yAxisLabel:``,xyAxisStroke:`#999999`,xyGridStroke:`#99999950`,xyPeriods:[],xyShowScale:!1,xyPaddingLeft:6,xyPaddingBottom:12,zoomXy:!1,zoomStartIndex:null,zoomEndIndex:null},userConfig:F.value.skeletonConfig??{}})),{loading:pr,FINAL_DATASET:mr,manualLoading:hr}=de({...Je(k),FINAL_CONFIG:F,prepareConfig:xr,skeletonDataset:k.config?.skeletonDataset??[1,2,3,5,8,13,21,34,55,89],skeletonConfig:p({defaultConfig:F.value,userConfig:fr.value})}),{svgRef:z}=Pe({config:{text:F.value.title}}),gr=h(()=>F.value.showUserOptionsOnChartHover),_r=h(()=>F.value.keepUserOptionsStateOnChartLeave),vr=S(!F.value.showUserOptionsOnChartHover),yr=S(!1);function br(e=!1){yr.value=e,gr.value&&(vr.value=e)}function xr(){let e=ge({userConfig:k.config,defaultConfig:ot}),t={},n=e.theme;if(n){if(!st.value(e))ct(e),t=e;else{let r=ge({userConfig:Fe[n]||k.config,defaultConfig:e});t={...ge({userConfig:k.config,defaultConfig:r}),customPalette:e.customPalette.length?e.customPalette:ae[n]||i}}}else t=e;return t}function Sr(e){let t=re(e);return t?.tooltipPosition&&delete t.tooltipPosition,JSON.stringify(t)}let Cr=Sr(k.config);Ye(()=>k.config,(e,t)=>{let n=Sr(e),r=n!==Cr;Cr=n;let i=xr();r?(pr.value||(F.value=i),F.value.responsive||(U.value.width=F.value.width,U.value.height=F.value.height),vr.value=!F.value.showUserOptionsOnChartHover,Rr(),Pr.value.showTooltip=F.value.showTooltip):(F.value.tooltipPosition=i.tooltipPosition,Pr.value.showTooltip=F.value.showTooltip)},{deep:!0}),Ye(()=>k.dataset,e=>{Array.isArray(e)&&e.length>0&&(hr.value=!1)},{immediate:!0});let wr=h(()=>le(F.value.customPalette)),B=Qe,Tr=h(()=>{let e=$e({debug:cr.value,dataset:s(mr.value,[`serie`,`series`,`data`,`value`,`values`,`num`]),barLineSwitch:F.value.chartIsBarUnderDatasetLength});return!e&&cr.value&&console.error(`VueUiQuickChart : Dataset is not processable`),e}),V=S(Tr.value),Er=h(()=>!!V.value),H=h(()=>V.value?V.value.type:null),Dr=h(()=>[D.BAR,D.LINE].includes(H.value)),Or=h(()=>Dr.value&&F.value.zoomXy&&Number(V.value?.maxSeriesLength??0)>1);Ye(()=>H.value,e=>{e||ne({componentName:`VueUiQuickChart`,type:`dataset`,debug:cr.value})},{immediate:!0});let{isPrinting:kr,isImaging:Ar,generatePdf:jr,generateImage:Mr}=Te({elementId:`${H.value}_${j.value}`,fileName:F.value.title||H.value,options:F.value.userOptionsPrint}),Nr=h(()=>F.value.showUserOptions&&!F.value.title),U=S({width:F.value.width,height:F.value.height}),Pr=S({showTooltip:F.value.showTooltip});Ye(F,()=>{Pr.value={showTooltip:F.value.showTooltip}},{immediate:!0});let W=qe(null),Fr=qe(null),Ir=S(!1),Lr=0;Ke(()=>{Gn.value=!0,rr(),sr.start(),Rr(),ar()});function Rr(){ue(k.dataset)||(hr.value=F.value.loading),F.value.responsive&&(W.value&&(Fr.value&&W.value.unobserve(Fr.value),W.value.disconnect()),W.value=new ResizeObserver(()=>{let{width:e,height:t}=Ae({chart:A.value,title:F.value.title?In.value:null,legend:F.value.showLegend?Ln.value:null,slicer:Or.value?Rn.value:null,source:Vn.value,noTitle:Hn.value});cancelAnimationFrame(Lr),Lr=requestAnimationFrame(()=>{U.value.width=e,U.value.height=t,Ir.value=!0,or()})}),Fr.value=A.value.parentNode,W.value.observe(Fr.value)),yi(),or()}Ge(()=>{cancelAnimationFrame(Lr),sr.stop(),pi(),Ri(),W.value&&(Fr.value&&W.value.unobserve(Fr.value),W.value.disconnect(),W.value=null,Fr.value=null)});let zr=h(()=>{switch(H.value){case D.LINE:return`0 0 ${U.value.width<=0?10:U.value.width} ${U.value.height<=0?10:U.value.height}`;case D.BAR:return`0 0 ${U.value.width<=0?10:U.value.width} ${U.value.height<=0?10:U.value.height}`;case D.DONUT:return`0 0 ${U.value.width<=0?10:U.value.width} ${U.value.height<=0?10:U.value.height}`;default:return`0 0 ${U.value.width<=0?10:U.value.width} ${U.value.height<=0?10:U.value.height}`}});function Br(e){return[...e].map(e=>e.value).reduce((e,t)=>e+t,0)}function Vr(e){return F.value.blurOnHover&&![null,void 0].includes(N.value)&&N.value!==e?`url(#blur_${j.value})`:``}function Hr(){P.value.length?P.value=[]:H.value===D.DONUT?K.value.legend.forEach(e=>{P.value.push(e.id)}):H.value===D.LINE?Z.value.legend.forEach(e=>{P.value.push(e.id)}):H.value===D.BAR&&Q.value.legend.forEach(e=>{P.value.push(e.id)}),H.value===D.DONUT?B(`selectLegend`,K.value.dataset):H.value===D.LINE?B(`selectLegend`,Z.value.dataset):H.value===D.BAR&&B(`selectLegend`,Q.value.dataset)}function Ur(e,t){P.value.includes(e)?P.value=P.value.filter(t=>t!==e):P.value.length<t&&P.value.push(e)}let Wr=S(null),Gr=S(null),Kr=S(!1);function qr(e,t){Kr.value=!0;let n=e.value,r=Tr.value.dataset.find((t,n)=>e.id===`donut_${n}`).VALUE;if(P.value.includes(e.id)){P.value=P.value.filter(t=>t!==e.id);function t(){n>r?(Kr.value=!1,cancelAnimationFrame(Gr.value),V.value={...V.value,dataset:V.value.dataset.map((t,n)=>e.id===`donut_${n}`?{...t,value:r,VALUE:r}:t)},B(`selectLegend`,K.value.dataset)):(n+=r*.025,V.value={...V.value,dataset:V.value.dataset.map((t,r)=>e.id===`donut_${r}`?{...t,value:n,VALUE:n}:t)},Gr.value=requestAnimationFrame(t))}t()}else if(t.length>1){function t(){n<r/100?(Kr.value=!1,cancelAnimationFrame(Wr.value),P.value.push(e.id),V.value={...V.value,dataset:V.value.dataset.map((t,n)=>e.id===`donut_${n}`?{...t,value:0,VALUE:0}:t)},B(`selectLegend`,K.value.dataset)):(n/=1.1,V.value={...V.value,dataset:V.value.dataset.map((t,r)=>e.id===`donut_${r}`?{...t,value:n,VALUE:n}:t)},Wr.value=requestAnimationFrame(t))}t()}else B(`selectLegend`,K.value.dataset)}let G=S(null);function Jr(e){G.value=e}let Yr=h(()=>F.value.donutThicknessRatio<.01?.01:F.value.donutThicknessRatio>.4?.4:F.value.donutThicknessRatio),K=h(()=>{if(H.value!==D.DONUT)return null;let e=V.value.dataset.map((e,t)=>({...e,value:e.VALUE||e.DATA||e.SERIE||e.VALUES||e.NUM||0,name:e.NAME||e.DESCRIPTION||e.TITLE||e.LABEL||`Serie ${t}`,id:`donut_${t}`})).map((e,t)=>({...e,color:e.COLOR?ee(e.COLOR):wr.value[t+F.value.paletteStartIndex]||i[t+F.value.paletteStartIndex]||i[(t+F.value.paletteStartIndex)%i.length],immutableValue:e.value}));function t(e,t){return n({v:isNaN(e.value/Br(t))?0:e.value/Br(t)*100,s:`%`,r:F.value.dataLabelRoundingPercentage})}function o(e){return e.proportion*100>F.value.donutHideLabelUnderPercentage}function s(e,t){let n=Tr.value.dataset.find((t,n)=>`donut_${n}`===e).VALUE;return Math.abs(String(Number(n.toFixed(0))).length-String(Number(t.toFixed(0))).length)}function c({datapoint:t,seriesIndex:i,triggerMode:a=`pointer`}){zn.value={datapoint:t,seriesIndex:i,config:F.value,dataset:e},N.value=t.id,L.value=i,R.value=a;let o=F.value.tooltipCustomFormat;if(F.value.events.datapointEnter&&F.value.events.datapointEnter({datapoint:t,seriesIndex:i}),r(o)&&se(()=>o({datapoint:t,seriesIndex:i,series:e,config:F.value})))Bn.value=o({datapoint:t,seriesIndex:i,series:e,config:F.value});else{let e=``;e+=`<div style="width:100%;text-align:center;border-bottom:1px solid ${F.value.tooltipBorderColor};padding-bottom:6px;margin-bottom:3px;">${t.name}</div>`,e+=`<div style="display:flex;flex-direction:row;gap:6px;align-items:center;"><svg viewBox="0 0 12 12" height="14" width="14"><circle cx="6" cy="6" r="6" stroke="none" fill="${t.color}"/></svg>`,e+=`<b>${f(F.value.formatter,t.value,n({p:F.value.valuePrefix,v:t.value,s:F.value.valueSuffix,r:F.value.dataLabelRoundingValue}),{datapoint:t,seriesIndex:i})}</b>`,e+=`<span>(${n({v:t.proportion*100,s:`%`,r:F.value.dataLabelRoundingPercentage})})</span></div>`,Bn.value=`<div>${e}</div>`}M.value=!0}function l({datapoint:e,seriesIndex:t}){F.value.events.datapointLeave&&F.value.events.datapointLeave({datapoint:e,seriesIndex:t}),M.value=!1,N.value=null,G.value=null,L.value=null,R.value=`pointer`}function te({datapoint:e,seriesIndex:t}){F.value.events.datapointClick&&F.value.events.datapointClick({datapoint:e,seriesIndex:t}),B(`selectDatapoint`,e)}let ne={centerX:U.value.width/2,centerY:U.value.height/2},u=e.filter(e=>!P.value.includes(e.id)).map(e=>e.value||0).reduce((e,t)=>e+t,0),re=e.map((e,t)=>({...e,proportion:(e.value||0)/u,value:e.value||0,absoluteValue:Tr.value.dataset.find((t,n)=>`donut_${n}`===e.id).VALUE,shape:`circle`})),d=U.value.width/2,ie=U.value.height/2,p=U.value.height*F.value.donutRadiusRatio;return{dataset:re.filter(e=>!P.value.includes(e.id)),legend:re,drawingArea:ne,displayArcPercentage:t,isArcBigEnough:o,useTooltip:c,killTooltip:l,selectDatapoint:te,getSpaces:s,total:u,cx:d,cy:ie,radius:p,chart:a({series:e.filter(e=>!P.value.includes(e.id))},d,ie,p,p,1.99999,2,1,360,105.25,U.value.height*Yr.value)}}),q=S({start:0,end:V.value.maxSeriesLength}),Xr=S({...q.value}),Zr=S(null),J=S(!1),Qr=S(!1),$r=S(!1),Y=S(!1),ei=S(!1),ti=S(null),ni=S(null),ri=S(null),ii=S(!1),ai=S({time:0,x:0,y:0,pointerType:null}),oi={show:!1,selection:{fill:`#2D353C`,stroke:`transparent`,fillOpacity:.1,strokeOpacity:.5,strokeWidth:1,strokeDasharray:0}},si=h(()=>{let e=F.value.dragToZoom??{};return{...oi,...e,selection:{...oi.selection,...e.selection??{}}}}),ci=h(()=>Dr.value&&si.value.show&&J.value&&mi()>1&&!pr.value),li=null,ui={};function di(e,t=q.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 fi(e){let t=di(e);t&&B(`update:zoomState`,t)}function pi(){li&&=(cancelAnimationFrame(li),null),ui={}}function mi(){let e=Number(V.value?.maxSeriesLength);return Number.isFinite(e)?Math.max(0,e):0}function hi(e,t=q.value.start){let n=mi();if(n<=0)return 0;let r=Math.max(0,Math.min(Number(t)||0,n-1)),i=Number(e);return Number.isFinite(i)?i>n?n:i<=r?Math.min(r+1,n):Math.max(0,i):Math.min(r+1,n)}function gi(){let e=mi();if(e<=0){q.value={start:0,end:0},Xr.value={...q.value},Zr.value&&Zr.value.setRangeValues(0,0);return}let t=Number(q.value.start),n=Number(q.value.end);Number.isFinite(t)||(t=0),Number.isFinite(n)||(n=e),t=Math.max(0,Math.min(t,e-1)),n=Math.max(t+1,Math.min(n,e)),q.value={start:t,end:n},Xr.value={start:t,end:n},Zr.value&&Zr.value.setRangeValues(t,n)}function _i(e){if(!Dr.value)return null;let t=di(e);return t?((t.start!==Number(q.value.start)||t.end!==Number(q.value.end))&&(pi(),q.value={start:t.start,end:t.end},Xr.value={...q.value},gi(),or()),{start:Number(q.value.start),end:Number(q.value.end)}):null}function vi(e){let t=_i(e);return t?(fi(t),t):null}async function yi({applyControlledZoom:e=!0}={}){if(!Qr.value){if(!Dr.value)J.value=!1;else{Qr.value=!0;try{await Ue(),await Ue();let{zoomStartIndex:t,zoomEndIndex:n}=F.value,r=mi();if(r<=0){q.value={start:0,end:0},Xr.value={...q.value},J.value=!1;return}let i=t==null?0:Number(t),a=n==null?r:hi(Number(n)+1,i);if(e&&di(k.zoomState)){let e=di(k.zoomState);i=e.start,a=e.end}$r.value=!0,q.value={start:i,end:a},Xr.value={start:i,end:a},gi(),J.value=!0,await Ue(),Zr.value&&Zr.value.setRangeValues(q.value.start,q.value.end)}finally{queueMicrotask(()=>{$r.value=!1}),Qr.value=!1,or()}}}}async function bi({applyControlledZoom:e=!1,publish:t=!1}={}){pi(),await yi({applyControlledZoom:e}),t&&(fi({start:Number(q.value.start),end:Number(q.value.end)}),B(`zoomReset`))}function xi(e){ui={...ui,...e},li&&cancelAnimationFrame(li),li=requestAnimationFrame(()=>{let e={...q.value,...ui};ui={},li=null,q.value=e,Xr.value={...e},gi(),fi({start:Number(q.value.start),end:Number(q.value.end)}),or()})}function Si(e){if(Qr.value||$r.value)return;let t=Number(e);Number.isFinite(t)&&(B(`zoomStart`,{index:t,isZoom:t!==0}),(t!==q.value.start||ui.end!==void 0)&&xi({start:t}))}function Ci(e){if(Qr.value||$r.value)return;let t=ui.start===void 0?q.value.start:ui.start,n=hi(Number(e),t);B(`zoomEnd`,{index:n,isZoom:n!==mi()}),(n!==q.value.end||ui.start!==void 0)&&xi({end:n})}Ye([()=>k.zoomState,Dr,()=>Number(V.value?.maxSeriesLength??0)],async([e,t,n])=>{!t||n<=0||!e||(J.value?_i(e):await yi({applyControlledZoom:!0}))},{deep:!0,immediate:!0}),Ye(Tr,async e=>{if(!e){J.value=!1;return}let t=V.value?.type,n=Number(V.value?.maxSeriesLength??0);V.value=e;let r=e.type,i=Number(e.maxSeriesLength??0);[D.BAR,D.LINE].includes(r)?(t!==r||n!==i?(pi(),J.value=!1,q.value={start:0,end:i},Xr.value={...q.value},Wn.value+=1,await Ue(),await yi({applyControlledZoom:!0})):k.zoomState&&_i(k.zoomState),or()):(pi(),J.value=!1,or())},{deep:!0});let wi=h(()=>{if(!F.value.zoomMinimap.show||H.value===D.DONUT)return[];let e=[];O(V.value.dataset)&&(e=V.value.dataset),nt(V.value.dataset)&&(e=V.value.dataset.map((e,t)=>({values:e.VALUE||e.DATA||e.SERIE||e.SERIES||e.VALUES||e.NUM||0,id:H.value===D.LINE?`line_${t}`:`bar_${t}`})).filter(e=>!P.value.includes(e.id)));let t=O(e)?e.length:Math.max(...e.map(e=>e.values.length)),n=[];if(O(e))n=e;else for(let r=0;r<t;r+=1)n.push(e.map(e=>e.values[r]||0).reduce((e,t)=>(e||0)+(t||0),0));let r=Math.min(...n);return n.map(e=>e+(r<0?Math.abs(r):0))}),{metrics:Ti,ready:Ei,settling:X,update:Di}=Oe({svgRef:z,canMeasure:()=>(!F.value.responsive||Ir.value)&&(![D.LINE,D.BAR].includes(H.value)||Zi.value),initialMetrics:{scale:0,bottom:0,leftOverhang:0},measure:e=>({scale:e(Yn.value).textWidth,bottom:e(Jn.value).height,leftOverhang:e(Jn.value).leftOverhang})});function Oi(){return Math.max(Ti.value.scale+4,Ti.value.leftOverhang-F.value.xyPaddingLeft)}let ki=h(()=>Ti.value.bottom),Z=h(()=>{if(H.value!==D.LINE)return null;let e={height:U.value.height,width:U.value.width},t=Oi(),a={left:t+F.value.xyPaddingLeft,top:F.value.xyPaddingTop,right:e.width-F.value.xyPaddingRight,bottom:e.height-F.value.xyPaddingBottom-ki.value,width:Math.max(10,e.width-F.value.xyPaddingLeft-F.value.xyPaddingRight-t),height:Math.max(10,e.height-F.value.xyPaddingTop-F.value.xyPaddingBottom-ki.value)},o=[];O(V.value.dataset)&&(o=[{values:V.value.dataset.slice(q.value.start,q.value.end),absoluteValues:V.value.dataset,absoluteIndices:V.value.dataset.map((e,t)=>t).slice(q.value.start,q.value.end),name:F.value.title,color:wr.value[F.value.paletteStartIndex]||i[F.value.paletteStartIndex],id:`line_0`}]),nt(V.value.dataset)&&(o=V.value.dataset.map((e,t)=>({...e,values:e.VALUE||e.DATA||e.SERIE||e.SERIES||e.VALUES||e.NUM||0,name:e.NAME||e.DESCRIPTION||e.TITLE||e.LABEL||`Serie ${t}`,id:`line_${t}`})).map((e,t)=>({...e,color:e.COLOR?ee(e.COLOR):wr.value[t+F.value.paletteStartIndex]||i[t+F.value.paletteStartIndex]||i[(t+F.value.paletteStartIndex)%i.length],values:e.values.slice(q.value.start,q.value.end),absoluteValues:e.values,absoluteIndices:e.values.map((e,t)=>t).slice(q.value.start,q.value.end)})));let s={max:Math.max(...o.filter(e=>!P.value.includes(e.id)).flatMap(e=>e.values)),min:Math.min(...o.filter(e=>!P.value.includes(e.id)).flatMap(e=>e.values)),maxSeries:Math.max(...o.map(e=>e.values.length))},c=s.max===s.min?te(Math.min(s.min,0),s.min===0?1:Math.max(s.min,0),F.value.xyScaleSegments):te(s.min<0?s.min:0,s.max<0?0:s.max,F.value.xyScaleSegments),l=s.min<0?Math.abs(s.min):0,ne=s.max<0?a.top:a.bottom-l/(c.max+l)*a.height,u=a.width/s.maxSeries,re=c.ticks.map(e=>({y:a.bottom-a.height*((e+l)/(c.max+l)),x:a.left-8,value:e})),d=o.map((e,t)=>({...e,shape:`circle`,coordinates:e.values.map((e,t)=>({x:a.left+u*(t+1)-u/2,y:a.bottom-(e+l)/(c.max+l)*a.height,value:e}))})).map(e=>{let t=[];return e.coordinates.forEach(e=>{t.push(`${e.x},${e.y} `)}),{...e,linePath:t.join(` `)}});function ie(e){return o.map(t=>({...t,value:t.values[e],absoluteIndex:t.absoluteIndices[e]})).filter(e=>!P.value.includes(e.id))}function p(e,t=`pointer`){if(Y.value&&t===`pointer`)return;N.value=e,G.value=e,L.value=e,R.value=t;let i=ie(e);zn.value={datapoint:i,seriesIndex:e,config:F.value,dataset:o};let a=F.value.tooltipCustomFormat;if(F.value.events.datapointEnter&&F.value.events.datapointEnter({datapoint:i,seriesIndex:e+q.value.start}),r(a)&&se(()=>a({datapoint:i,seriesIndex:e,series:o,config:F.value})))Bn.value=a({datapoint:i,seriesIndex:e,series:o,config:F.value});else{let e=``;$.value[i[0].absoluteIndex]&&(e+=`<div style="border-bottom:1px solid ${F.value.tooltipBorderColor};padding-bottom:6px;margin-bottom:3px;">${$.value[i[0].absoluteIndex].text}</div>`),i.forEach((t,r)=>{e+=`
1
+ import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{t}from"./useConfig-6jO1fkp5.js";import{$ as n,Dt as r,Ht as i,It as a,J as o,Kt as s,P as c,S as ee,X as l,_ as te,at as ne,b as u,et as re,f as d,h as ie,i as f,in as p,nn as ae,p as oe,pt as se,t as ce,w as le,zt as ue}from"./lib-rPeBMZrn.js";import{n as de,t as fe}from"./BaseScanner-8NdoBs7B.js";import{n as pe,t as me}from"./useHints-BH9r_0Vd.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{t as ye}from"./useChartExport-BZts4KFb.js";import{n as be,t as xe}from"./annotationSlots-BRR85CqJ.js";import{n as Se,t as Ce}from"./userOptionsSlots-DYuo-E5m.js";import{t as we}from"./useTimeLabels-Das5O74F.js";import{t as Te}from"./usePrinter-sVoTzet1.js";import{t as Ee}from"./useTransitions-ChGGrtrv.js";import{t as De}from"./useStableElementSize-CegFbRlF.js";import{t as Oe}from"./useSvgLabelLayout-D1I8sQUi.js";import{t as ke}from"./useTimeLabelCollider-BTybMUFi.js";import{t as Ae}from"./useResponsive-CENUxfEL.js";import{t as je}from"./SlicerPreview-CFFUOlQr.js";import{t as Me}from"./BaseLegendToggle-Q3TiW9u1.js";import{t as Ne}from"./A11yDataTable-DWNlWXzs.js";import{t as Pe}from"./useChartAccessibility-DOMuYJfm.js";import{t as Fe}from"./vue_ui_quick_chart-BRfcRW6Z.js";import{Fragment as m,Teleport as Ie,computed as h,createBlock as Le,createCommentVNode as g,createElementBlock as _,createElementVNode as v,createSlots as Re,createVNode as ze,defineAsyncComponent as Be,guardReactiveProps as Ve,mergeProps as He,nextTick as Ue,normalizeClass as y,normalizeProps as We,normalizeStyle as b,onBeforeUnmount as Ge,onMounted as Ke,openBlock as x,ref as S,renderList as C,renderSlot as w,shallowRef as qe,toDisplayString as T,toRefs as Je,unref as E,watch as Ye,watchEffect as Xe,withCtx as Ze}from"vue";var D={LINE:`LINE`,BAR:`BAR`,DONUT:`DONUT`},Qe=[`SERIE`,`SERIES`,`DATA`,`VALUE`,`VALUES`,`NUM`];function $e({dataset:e,barLineSwitch:t=6,debug:n=!0}){let r=null,i=null,a=0;if((typeof e==`number`||typeof e==`string`)&&n&&console.warn(`The provided dataset (${e}) is not sufficient to build a chart`),tt(e)&&(O(e)&&(r=e.length<t?D.BAR:D.LINE,i=e,a=e.length),nt(e))){if(!it(e))return n&&console.warn(`The objects in the dataset array have a different data structure. Either keys or value types are different.`),!1;let o=Object.keys(e[0]),s=Object.values(e[0]);if(!o.some(e=>at(e)))return n&&console.warn(`The data type of the dataset objects in the array must contain one of the following keys: DATA, SERIES, VALUE, VALUES, NUM. Casing is not important.`),!1;ot(s,e=>typeof e==`number`)&&(r=D.DONUT,i=e),ot(s,e=>Array.isArray(e)&&O(e))&&(r=st(e)>t?D.LINE:D.BAR,a=st(e),i=e.map(e=>({...e,data:ct(e,e=>O(e))}))),e=e.map(e=>k(e)),i=i.map(e=>k(e))}return{dataset:e,type:r,usableDataset:i,maxSeriesLength:a}}function et(e){return!e||tt(e)&&!e.length}function tt(e){return Array.isArray(e)}function O(e){if(!tt(e)||et(e))return!1;let t=e.map(e=>Number(e));return![...new Set(t.flatMap(e=>typeof e==`number`&&!isNaN(e)))].includes(!1)}function nt(e){return!tt(e)||et(e)||[...new Set(e.flatMap(e=>typeof e==`object`&&!Array.isArray(e)))].includes(!1)?!1:!e.map(e=>Object.keys(e).length>0).includes(!1)}function rt(e,t){let n=Object.keys(e).sort(),r=Object.keys(t).sort();if(n.length!==r.length)return!1;for(let i=0;i<n.length;i+=1){let a=n[i],o=r[i];if(a!==o||typeof e[a]!=typeof t[o])return!1}return!0}function it(e){if(e.length<=1)return!0;for(let t=0;t<e.length;t+=1)for(let n=t+1;n<e.length;n+=1)if(!rt(e[t],e[n]))return!1;return!0}function at(e){return Qe.includes(e.toUpperCase())}function ot(e,t){let n=[];for(let r=0;r<e.length;r+=1)n.push(t(e[r]));return n.includes(!0)}function st(e){return Math.max(...[...e].flatMap(e=>Object.values(e).filter(e=>O(e)).map(e=>e.length)))}function ct(e,t){return Object.values(e).filter(e=>t(e))[0]}function k(e){let t={};for(let n in e)e.hasOwnProperty(n)&&(t[n.toUpperCase()]=e[n]);return t}var A=/* @__PURE__ */ e({default:()=>In}),lt=[`id`],ut=[`id`],dt=[`id`],ft={style:{position:`relative`}},pt=[`xmlns`,`aria-describedby`,`viewBox`],mt=[`x`,`y`,`width`,`height`],ht=[`x`,`y`,`width`,`height`],gt=[`width`,`height`],_t=[`id`],vt=[`id`],yt=[`id`],bt=[`flood-color`],xt={key:0,class:`donut-label-connectors`},St=[`d`,`stroke`,`stroke-width`,`filter`],Ct=[`cx`,`cy`,`r`,`fill`,`filter`],wt={class:`donut`},Tt=[`d`,`fill`,`stroke`,`stroke-width`,`filter`],Et=[`d`,`onMouseenter`,`onMouseout`,`onClick`],Dt={key:1,class:`donut-labels`},Ot=[`cx`,`cy`,`fill`,`stroke`,`filter`],kt=[`text-anchor`,`x`,`y`,`fill`,`font-size`,`filter`],At=[`text-anchor`,`x`,`y`,`fill`,`font-size`,`filter`],jt={key:2,class:`donut-hollow`},Mt=[`x`,`y`,`font-size`,`fill`],Nt=[`x`,`y`,`font-size`,`fill`],Pt={key:0,class:`line-grid`},Ft=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`],It=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`],Lt={key:1,class:`line-axis`},Rt=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`],zt=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`],Bt=[`d`,`stroke`,`stroke-width`],Vt=[`transform`,`font-size`,`fill`],Ht={key:3,class:`periodLabels`},Ut=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`],Wt={key:0},Gt=[`font-size`,`text-anchor`,`fill`,`transform`],Kt=[`font-size`,`text-anchor`,`fill`,`transform`,`innerHTML`],qt={class:`plots`},Jt=[`d`,`stroke`,`stroke-width`],Yt=[`d`,`stroke`,`stroke-width`],Xt=[`d`,`stroke`,`stroke-width`],Zt=[`d`,`stroke`,`stroke-width`],Qt=[`cx`,`cy`,`fill`,`stroke`],$t={key:4,class:`dataLabels`},en=[`font-size`,`fill`,`transform`],tn={key:5,class:`tooltip-traps`},nn=[`x`,`y`,`height`,`width`,`fill`,`onMouseenter`,`onMouseleave`,`onClick`],rn={key:0,class:`line-grid`},an=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`],on=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`],sn={key:1,class:`line-axis`},cn=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`],ln=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`],un=[`d`,`stroke`,`stroke-width`],dn=[`transform`,`font-size`,`fill`],fn={key:3,class:`periodLabels`},pn=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`],mn={key:0},hn=[`font-size`,`text-anchor`,`fill`,`transform`],gn=[`font-size`,`text-anchor`,`fill`,`transform`,`innerHTML`],_n={class:`plots`},vn=[`x`,`width`,`height`,`y`,`fill`,`stroke`,`stroke-width`],yn={key:4,class:`dataLabels`},bn=[`transform`,`font-size`,`fill`],xn={key:5,class:`tooltip-traps`},Sn=[`x`,`y`,`height`,`width`,`fill`,`onMouseenter`,`onMouseleave`,`onClick`],Cn={key:6,class:`axis-labels`},wn=[`font-size`,`fill`,`x`,`y`],Tn=[`font-size`,`fill`,`x`,`y`],En=[`font-size`,`fill`,`transform`],Dn=[`font-size`,`fill`,`transform`],On=[`x`,`y`,`width`,`height`,`fill`,`fill-opacity`,`stroke`,`stroke-opacity`,`stroke-width`,`stroke-dasharray`],kn={key:1,style:{position:`absolute`,top:`100%`,left:`0`,width:`100%`},"data-dom-to-png-ignore":``,"aria-hidden":`true`},An={key:5,class:`vue-data-ui-watermark`},jn=[`id`],Mn=[`onClick`,`onKeydown`],Nn=[`onClick`,`onKeydown`],Pn=[`onClick`,`onKeydown`],Fn={key:1,class:`vue-ui-quick-chart-not-processable`},In=/*#__PURE__*/ he({__name:`vue-ui-quick-chart`,props:{config:{type:Object,default(){return{}}},dataset:{type:[Array,Object,String,Number],default(){return null}},zoomState:{type:Object,default:null}},emits:[`selectDatapoint`,`selectLegend`,`zoomStart`,`zoomEnd`,`zoomReset`,`update:zoomState`,`copyAlt`],setup(e,{expose:he,emit:Qe}){let et=Be(()=>import(`./BaseIcon-Cm-IJ179.js`).then(e=>e.n)),tt=Be(()=>import(`./PackageVersion-BIhjLNBU.js`).then(e=>e.t)),rt=Be(()=>import(`./PenAndPaper-BGEp-TUm.js`).then(e=>e.t)),it=Be(()=>import(`./Tooltip-C1q0Qoh7.js`)),at=Be(()=>import(`./UserOptions-uWHV_zPB.js`).then(e=>e.n)),{vue_ui_quick_chart:ot}=t(),{isThemeValid:st,warnInvalidTheme:ct}=_e(),k=e,A=S(null),In=S(null),Ln=S(null),Rn=S(null),j=S(l()),M=S(!1),zn=S(null),Bn=S(``),N=S(null),Vn=S(null),Hn=S(null),P=S([]),Un=S(0),Wn=S(0),Gn=S(!1),Kn=S(null),qn=S(null),Jn=S(null),Yn=S(null),Xn=S(null),Zn=S(null),Qn=qe(null),$n=S(!1),er=S(0),tr=S(0),nr=S(!1);function rr(){Qn.value=A.value?.parentNode??null}function ir(){return new Promise(e=>{requestAnimationFrame(()=>{requestAnimationFrame(e)})})}async function ar(){let e=++tr.value;$n.value=!1,await Ue(),await ir(),await ir(),e===tr.value&&(er.value+=1,$n.value=!0)}function or(){nr.value||(nr.value=!0,Ue(()=>{nr.value=!1,rr(),ar()}))}let sr=De({elementRef:Qn,minimumWidth:2,minimumHeight:2,stableFramesRequired:2,once:!1,onSizeAccepted:()=>{ar()}});S(`#FFFFFF`);let F=S(xr());pe({config:()=>F.value,dataset:()=>k.dataset,component:`VueUiQuickChart`,rules:[me.emptyArray,{test:()=>!0,message:[`👀 This is a swiss-knife component. If you need more control, consider using dedicated components:`,``,`▶️ VueUiXy for time series line and/or bars`,``,`▶️ VueUiDonut, VueUiWaffle, VueUiRings for proportions`]}]});let{transitionEnabled:I}=Ee({config:()=>F.value.transitions,dataset:()=>k.dataset}),cr=h(()=>F.value.debug),lr=h(()=>F.value.useCursorPointer),L=S(null),ur=S({x:0,y:0}),R=S(`pointer`),dr=S(!1),fr=h(()=>p({dafaultConfig:{backgroundColor:`#99999930`,customPalette:[`#BABABA`],showDataLabels:!1,paletteStartIndex:0,showUserOptions:!1,showTooltip:!1,xAxisLabel:``,yAxisLabel:``,xyAxisStroke:`#999999`,xyGridStroke:`#99999950`,xyPeriods:[],xyShowScale:!1,xyPaddingLeft:6,xyPaddingBottom:12,zoomXy:!1,zoomStartIndex:null,zoomEndIndex:null},userConfig:F.value.skeletonConfig??{}})),{loading:pr,FINAL_DATASET:mr,manualLoading:hr}=de({...Je(k),FINAL_CONFIG:F,prepareConfig:xr,skeletonDataset:k.config?.skeletonDataset??[1,2,3,5,8,13,21,34,55,89],skeletonConfig:p({defaultConfig:F.value,userConfig:fr.value})}),{svgRef:z}=Pe({config:{text:F.value.title}}),gr=h(()=>F.value.showUserOptionsOnChartHover),_r=h(()=>F.value.keepUserOptionsStateOnChartLeave),vr=S(!F.value.showUserOptionsOnChartHover),yr=S(!1);function br(e=!1){yr.value=e,gr.value&&(vr.value=e)}function xr(){let e=ge({userConfig:k.config,defaultConfig:ot}),t={},n=e.theme;if(n){if(!st.value(e))ct(e),t=e;else{let r=ge({userConfig:Fe[n]||k.config,defaultConfig:e});t={...ge({userConfig:k.config,defaultConfig:r}),customPalette:e.customPalette.length?e.customPalette:ae[n]||i}}}else t=e;return t}function Sr(e){let t=re(e);return t?.tooltipPosition&&delete t.tooltipPosition,JSON.stringify(t)}let Cr=Sr(k.config);Ye(()=>k.config,(e,t)=>{let n=Sr(e),r=n!==Cr;Cr=n;let i=xr();r?(pr.value||(F.value=i),F.value.responsive||(U.value.width=F.value.width,U.value.height=F.value.height),vr.value=!F.value.showUserOptionsOnChartHover,Rr(),Pr.value.showTooltip=F.value.showTooltip):(F.value.tooltipPosition=i.tooltipPosition,Pr.value.showTooltip=F.value.showTooltip)},{deep:!0}),Ye(()=>k.dataset,e=>{Array.isArray(e)&&e.length>0&&(hr.value=!1)},{immediate:!0});let wr=h(()=>le(F.value.customPalette)),B=Qe,Tr=h(()=>{let e=$e({debug:cr.value,dataset:s(mr.value,[`serie`,`series`,`data`,`value`,`values`,`num`]),barLineSwitch:F.value.chartIsBarUnderDatasetLength});return!e&&cr.value&&console.error(`VueUiQuickChart : Dataset is not processable`),e}),V=S(Tr.value),Er=h(()=>!!V.value),H=h(()=>V.value?V.value.type:null),Dr=h(()=>[D.BAR,D.LINE].includes(H.value)),Or=h(()=>Dr.value&&F.value.zoomXy&&Number(V.value?.maxSeriesLength??0)>1);Ye(()=>H.value,e=>{e||ne({componentName:`VueUiQuickChart`,type:`dataset`,debug:cr.value})},{immediate:!0});let{isPrinting:kr,isImaging:Ar,generatePdf:jr,generateImage:Mr}=Te({elementId:`${H.value}_${j.value}`,fileName:F.value.title||H.value,options:F.value.userOptionsPrint}),Nr=h(()=>F.value.showUserOptions&&!F.value.title),U=S({width:F.value.width,height:F.value.height}),Pr=S({showTooltip:F.value.showTooltip});Ye(F,()=>{Pr.value={showTooltip:F.value.showTooltip}},{immediate:!0});let W=qe(null),Fr=qe(null),Ir=S(!1),Lr=0;Ke(()=>{Gn.value=!0,rr(),sr.start(),Rr(),ar()});function Rr(){ue(k.dataset)||(hr.value=F.value.loading),F.value.responsive&&(W.value&&(Fr.value&&W.value.unobserve(Fr.value),W.value.disconnect()),W.value=new ResizeObserver(()=>{let{width:e,height:t}=Ae({chart:A.value,title:F.value.title?In.value:null,legend:F.value.showLegend?Ln.value:null,slicer:Or.value?Rn.value:null,source:Vn.value,noTitle:Hn.value});cancelAnimationFrame(Lr),Lr=requestAnimationFrame(()=>{U.value.width=e,U.value.height=t,Ir.value=!0,or()})}),Fr.value=A.value.parentNode,W.value.observe(Fr.value)),yi(),or()}Ge(()=>{cancelAnimationFrame(Lr),sr.stop(),pi(),Ri(),W.value&&(Fr.value&&W.value.unobserve(Fr.value),W.value.disconnect(),W.value=null,Fr.value=null)});let zr=h(()=>{switch(H.value){case D.LINE:return`0 0 ${U.value.width<=0?10:U.value.width} ${U.value.height<=0?10:U.value.height}`;case D.BAR:return`0 0 ${U.value.width<=0?10:U.value.width} ${U.value.height<=0?10:U.value.height}`;case D.DONUT:return`0 0 ${U.value.width<=0?10:U.value.width} ${U.value.height<=0?10:U.value.height}`;default:return`0 0 ${U.value.width<=0?10:U.value.width} ${U.value.height<=0?10:U.value.height}`}});function Br(e){return[...e].map(e=>e.value).reduce((e,t)=>e+t,0)}function Vr(e){return F.value.blurOnHover&&![null,void 0].includes(N.value)&&N.value!==e?`url(#blur_${j.value})`:``}function Hr(){P.value.length?P.value=[]:H.value===D.DONUT?K.value.legend.forEach(e=>{P.value.push(e.id)}):H.value===D.LINE?Z.value.legend.forEach(e=>{P.value.push(e.id)}):H.value===D.BAR&&Q.value.legend.forEach(e=>{P.value.push(e.id)}),H.value===D.DONUT?B(`selectLegend`,K.value.dataset):H.value===D.LINE?B(`selectLegend`,Z.value.dataset):H.value===D.BAR&&B(`selectLegend`,Q.value.dataset)}function Ur(e,t){P.value.includes(e)?P.value=P.value.filter(t=>t!==e):P.value.length<t&&P.value.push(e)}let Wr=S(null),Gr=S(null),Kr=S(!1);function qr(e,t){Kr.value=!0;let n=e.value,r=Tr.value.dataset.find((t,n)=>e.id===`donut_${n}`).VALUE;if(P.value.includes(e.id)){P.value=P.value.filter(t=>t!==e.id);function t(){n>r?(Kr.value=!1,cancelAnimationFrame(Gr.value),V.value={...V.value,dataset:V.value.dataset.map((t,n)=>e.id===`donut_${n}`?{...t,value:r,VALUE:r}:t)},B(`selectLegend`,K.value.dataset)):(n+=r*.025,V.value={...V.value,dataset:V.value.dataset.map((t,r)=>e.id===`donut_${r}`?{...t,value:n,VALUE:n}:t)},Gr.value=requestAnimationFrame(t))}t()}else if(t.length>1){function t(){n<r/100?(Kr.value=!1,cancelAnimationFrame(Wr.value),P.value.push(e.id),V.value={...V.value,dataset:V.value.dataset.map((t,n)=>e.id===`donut_${n}`?{...t,value:0,VALUE:0}:t)},B(`selectLegend`,K.value.dataset)):(n/=1.1,V.value={...V.value,dataset:V.value.dataset.map((t,r)=>e.id===`donut_${r}`?{...t,value:n,VALUE:n}:t)},Wr.value=requestAnimationFrame(t))}t()}else B(`selectLegend`,K.value.dataset)}let G=S(null);function Jr(e){G.value=e}let Yr=h(()=>F.value.donutThicknessRatio<.01?.01:F.value.donutThicknessRatio>.4?.4:F.value.donutThicknessRatio),K=h(()=>{if(H.value!==D.DONUT)return null;let e=V.value.dataset.map((e,t)=>({...e,value:e.VALUE||e.DATA||e.SERIE||e.VALUES||e.NUM||0,name:e.NAME||e.DESCRIPTION||e.TITLE||e.LABEL||`Serie ${t}`,id:`donut_${t}`})).map((e,t)=>({...e,color:e.COLOR?ee(e.COLOR):wr.value[t+F.value.paletteStartIndex]||i[t+F.value.paletteStartIndex]||i[(t+F.value.paletteStartIndex)%i.length],immutableValue:e.value}));function t(e,t){return n({v:isNaN(e.value/Br(t))?0:e.value/Br(t)*100,s:`%`,r:F.value.dataLabelRoundingPercentage})}function o(e){return e.proportion*100>F.value.donutHideLabelUnderPercentage}function s(e,t){let n=Tr.value.dataset.find((t,n)=>`donut_${n}`===e).VALUE;return Math.abs(String(Number(n.toFixed(0))).length-String(Number(t.toFixed(0))).length)}function c({datapoint:t,seriesIndex:i,triggerMode:a=`pointer`}){zn.value={datapoint:t,seriesIndex:i,config:F.value,dataset:e},N.value=t.id,L.value=i,R.value=a;let o=F.value.tooltipCustomFormat;if(F.value.events.datapointEnter&&F.value.events.datapointEnter({datapoint:t,seriesIndex:i}),r(o)&&se(()=>o({datapoint:t,seriesIndex:i,series:e,config:F.value})))Bn.value=o({datapoint:t,seriesIndex:i,series:e,config:F.value});else{let e=``;e+=`<div style="width:100%;text-align:center;border-bottom:1px solid ${F.value.tooltipBorderColor};padding-bottom:6px;margin-bottom:3px;">${t.name}</div>`,e+=`<div style="display:flex;flex-direction:row;gap:6px;align-items:center;"><svg viewBox="0 0 12 12" height="14" width="14"><circle cx="6" cy="6" r="6" stroke="none" fill="${t.color}"/></svg>`,e+=`<b>${f(F.value.formatter,t.value,n({p:F.value.valuePrefix,v:t.value,s:F.value.valueSuffix,r:F.value.dataLabelRoundingValue}),{datapoint:t,seriesIndex:i})}</b>`,e+=`<span>(${n({v:t.proportion*100,s:`%`,r:F.value.dataLabelRoundingPercentage})})</span></div>`,Bn.value=`<div>${e}</div>`}M.value=!0}function l({datapoint:e,seriesIndex:t}){F.value.events.datapointLeave&&F.value.events.datapointLeave({datapoint:e,seriesIndex:t}),M.value=!1,N.value=null,G.value=null,L.value=null,R.value=`pointer`}function te({datapoint:e,seriesIndex:t}){F.value.events.datapointClick&&F.value.events.datapointClick({datapoint:e,seriesIndex:t}),B(`selectDatapoint`,e)}let ne={centerX:U.value.width/2,centerY:U.value.height/2},u=e.filter(e=>!P.value.includes(e.id)).map(e=>e.value||0).reduce((e,t)=>e+t,0),re=e.map((e,t)=>({...e,proportion:(e.value||0)/u,value:e.value||0,absoluteValue:Tr.value.dataset.find((t,n)=>`donut_${n}`===e.id).VALUE,shape:`circle`})),d=U.value.width/2,ie=U.value.height/2,p=U.value.height*F.value.donutRadiusRatio;return{dataset:re.filter(e=>!P.value.includes(e.id)),legend:re,drawingArea:ne,displayArcPercentage:t,isArcBigEnough:o,useTooltip:c,killTooltip:l,selectDatapoint:te,getSpaces:s,total:u,cx:d,cy:ie,radius:p,chart:a({series:e.filter(e=>!P.value.includes(e.id))},d,ie,p,p,1.99999,2,1,360,105.25,U.value.height*Yr.value)}}),q=S({start:0,end:V.value.maxSeriesLength}),Xr=S({...q.value}),Zr=S(null),J=S(!1),Qr=S(!1),$r=S(!1),Y=S(!1),ei=S(!1),ti=S(null),ni=S(null),ri=S(null),ii=S(!1),ai=S({time:0,x:0,y:0,pointerType:null}),oi={show:!1,selection:{fill:`#2D353C`,stroke:`transparent`,fillOpacity:.1,strokeOpacity:.5,strokeWidth:1,strokeDasharray:0}},si=h(()=>{let e=F.value.dragToZoom??{};return{...oi,...e,selection:{...oi.selection,...e.selection??{}}}}),ci=h(()=>Dr.value&&si.value.show&&J.value&&mi()>1&&!pr.value),li=null,ui={};function di(e,t=q.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 fi(e){let t=di(e);t&&B(`update:zoomState`,t)}function pi(){li&&=(cancelAnimationFrame(li),null),ui={}}function mi(){let e=Number(V.value?.maxSeriesLength);return Number.isFinite(e)?Math.max(0,e):0}function hi(e,t=q.value.start){let n=mi();if(n<=0)return 0;let r=Math.max(0,Math.min(Number(t)||0,n-1)),i=Number(e);return Number.isFinite(i)?i>n?n:i<=r?Math.min(r+1,n):Math.max(0,i):Math.min(r+1,n)}function gi(){let e=mi();if(e<=0){q.value={start:0,end:0},Xr.value={...q.value},Zr.value&&Zr.value.setRangeValues(0,0);return}let t=Number(q.value.start),n=Number(q.value.end);Number.isFinite(t)||(t=0),Number.isFinite(n)||(n=e),t=Math.max(0,Math.min(t,e-1)),n=Math.max(t+1,Math.min(n,e)),q.value={start:t,end:n},Xr.value={start:t,end:n},Zr.value&&Zr.value.setRangeValues(t,n)}function _i(e){if(!Dr.value)return null;let t=di(e);return t?((t.start!==Number(q.value.start)||t.end!==Number(q.value.end))&&(pi(),q.value={start:t.start,end:t.end},Xr.value={...q.value},gi(),or()),{start:Number(q.value.start),end:Number(q.value.end)}):null}function vi(e){let t=_i(e);return t?(fi(t),t):null}async function yi({applyControlledZoom:e=!0}={}){if(!Qr.value){if(!Dr.value)J.value=!1;else{Qr.value=!0;try{await Ue(),await Ue();let{zoomStartIndex:t,zoomEndIndex:n}=F.value,r=mi();if(r<=0){q.value={start:0,end:0},Xr.value={...q.value},J.value=!1;return}let i=t==null?0:Number(t),a=n==null?r:hi(Number(n)+1,i);if(e&&di(k.zoomState)){let e=di(k.zoomState);i=e.start,a=e.end}$r.value=!0,q.value={start:i,end:a},Xr.value={start:i,end:a},gi(),J.value=!0,await Ue(),Zr.value&&Zr.value.setRangeValues(q.value.start,q.value.end)}finally{queueMicrotask(()=>{$r.value=!1}),Qr.value=!1,or()}}}}async function bi({applyControlledZoom:e=!1,publish:t=!1}={}){pi(),await yi({applyControlledZoom:e}),t&&(fi({start:Number(q.value.start),end:Number(q.value.end)}),B(`zoomReset`))}function xi(e){ui={...ui,...e},li&&cancelAnimationFrame(li),li=requestAnimationFrame(()=>{let e={...q.value,...ui};ui={},li=null,q.value=e,Xr.value={...e},gi(),fi({start:Number(q.value.start),end:Number(q.value.end)}),or()})}function Si(e){if(Qr.value||$r.value)return;let t=Number(e);Number.isFinite(t)&&(B(`zoomStart`,{index:t,isZoom:t!==0}),(t!==q.value.start||ui.end!==void 0)&&xi({start:t}))}function Ci(e){if(Qr.value||$r.value)return;let t=ui.start===void 0?q.value.start:ui.start,n=hi(Number(e),t);B(`zoomEnd`,{index:n,isZoom:n!==mi()}),(n!==q.value.end||ui.start!==void 0)&&xi({end:n})}Ye([()=>k.zoomState,Dr,()=>Number(V.value?.maxSeriesLength??0)],async([e,t,n])=>{!t||n<=0||!e||(J.value?_i(e):await yi({applyControlledZoom:!0}))},{deep:!0,immediate:!0}),Ye(Tr,async e=>{if(!e){J.value=!1;return}let t=V.value?.type,n=Number(V.value?.maxSeriesLength??0);V.value=e;let r=e.type,i=Number(e.maxSeriesLength??0);[D.BAR,D.LINE].includes(r)?(t!==r||n!==i?(pi(),J.value=!1,q.value={start:0,end:i},Xr.value={...q.value},Wn.value+=1,await Ue(),await yi({applyControlledZoom:!0})):k.zoomState&&_i(k.zoomState),or()):(pi(),J.value=!1,or())},{deep:!0});let wi=h(()=>{if(!F.value.zoomMinimap.show||H.value===D.DONUT)return[];let e=[];O(V.value.dataset)&&(e=V.value.dataset),nt(V.value.dataset)&&(e=V.value.dataset.map((e,t)=>({values:e.VALUE||e.DATA||e.SERIE||e.SERIES||e.VALUES||e.NUM||0,id:H.value===D.LINE?`line_${t}`:`bar_${t}`})).filter(e=>!P.value.includes(e.id)));let t=O(e)?e.length:Math.max(...e.map(e=>e.values.length)),n=[];if(O(e))n=e;else for(let r=0;r<t;r+=1)n.push(e.map(e=>e.values[r]||0).reduce((e,t)=>(e||0)+(t||0),0));let r=Math.min(...n);return n.map(e=>e+(r<0?Math.abs(r):0))}),{metrics:Ti,ready:Ei,settling:X,update:Di}=Oe({svgRef:z,canMeasure:()=>(!F.value.responsive||Ir.value)&&(![D.LINE,D.BAR].includes(H.value)||Zi.value),initialMetrics:{scale:0,bottom:0,leftOverhang:0},measure:e=>({scale:e(Yn.value).textWidth,bottom:e(Jn.value).height,leftOverhang:e(Jn.value).leftOverhang})});function Oi(){return Math.max(Ti.value.scale+4,Ti.value.leftOverhang-F.value.xyPaddingLeft)}let ki=h(()=>Ti.value.bottom),Z=h(()=>{if(H.value!==D.LINE)return null;let e={height:U.value.height,width:U.value.width},t=Oi(),a={left:t+F.value.xyPaddingLeft,top:F.value.xyPaddingTop,right:e.width-F.value.xyPaddingRight,bottom:e.height-F.value.xyPaddingBottom-ki.value,width:Math.max(10,e.width-F.value.xyPaddingLeft-F.value.xyPaddingRight-t),height:Math.max(10,e.height-F.value.xyPaddingTop-F.value.xyPaddingBottom-ki.value)},o=[];O(V.value.dataset)&&(o=[{values:V.value.dataset.slice(q.value.start,q.value.end),absoluteValues:V.value.dataset,absoluteIndices:V.value.dataset.map((e,t)=>t).slice(q.value.start,q.value.end),name:F.value.title,color:wr.value[F.value.paletteStartIndex]||i[F.value.paletteStartIndex],id:`line_0`}]),nt(V.value.dataset)&&(o=V.value.dataset.map((e,t)=>({...e,values:e.VALUE||e.DATA||e.SERIE||e.SERIES||e.VALUES||e.NUM||0,name:e.NAME||e.DESCRIPTION||e.TITLE||e.LABEL||`Serie ${t}`,id:`line_${t}`})).map((e,t)=>({...e,color:e.COLOR?ee(e.COLOR):wr.value[t+F.value.paletteStartIndex]||i[t+F.value.paletteStartIndex]||i[(t+F.value.paletteStartIndex)%i.length],values:e.values.slice(q.value.start,q.value.end),absoluteValues:e.values,absoluteIndices:e.values.map((e,t)=>t).slice(q.value.start,q.value.end)})));let s={max:Math.max(...o.filter(e=>!P.value.includes(e.id)).flatMap(e=>e.values)),min:Math.min(...o.filter(e=>!P.value.includes(e.id)).flatMap(e=>e.values)),maxSeries:Math.max(...o.map(e=>e.values.length))},c=s.max===s.min?te(Math.min(s.min,0),s.min===0?1:Math.max(s.min,0),F.value.xyScaleSegments):te(s.min<0?s.min:0,s.max<0?0:s.max,F.value.xyScaleSegments),l=s.min<0?Math.abs(s.min):0,ne=s.max<0?a.top:a.bottom-l/(c.max+l)*a.height,u=a.width/s.maxSeries,re=c.ticks.map(e=>({y:a.bottom-a.height*((e+l)/(c.max+l)),x:a.left-8,value:e})),d=o.map((e,t)=>({...e,shape:`circle`,coordinates:e.values.map((e,t)=>({x:a.left+u*(t+1)-u/2,y:a.bottom-(e+l)/(c.max+l)*a.height,value:e}))})).map(e=>{let t=[];return e.coordinates.forEach(e=>{t.push(`${e.x},${e.y} `)}),{...e,linePath:t.join(` `)}});function ie(e){return o.map(t=>({...t,value:t.values[e],absoluteIndex:t.absoluteIndices[e]})).filter(e=>!P.value.includes(e.id))}function p(e,t=`pointer`){if(Y.value&&t===`pointer`)return;N.value=e,G.value=e,L.value=e,R.value=t;let i=ie(e);zn.value={datapoint:i,seriesIndex:e,config:F.value,dataset:o};let a=F.value.tooltipCustomFormat;if(F.value.events.datapointEnter&&F.value.events.datapointEnter({datapoint:i,seriesIndex:e+q.value.start}),r(a)&&se(()=>a({datapoint:i,seriesIndex:e,series:o,config:F.value})))Bn.value=a({datapoint:i,seriesIndex:e,series:o,config:F.value});else{let e=``;$.value[i[0].absoluteIndex]&&(e+=`<div style="border-bottom:1px solid ${F.value.tooltipBorderColor};padding-bottom:6px;margin-bottom:3px;">${$.value[i[0].absoluteIndex].text}</div>`),i.forEach((t,r)=>{e+=`
2
2
  <div style="display:flex; flex-wrap: wrap; align-items:center; gap:3px;">
3
3
  <svg viewBox="0 0 12 12" height="14" width="12"><circle cx="6" cy="6" r="6" stroke="none" fill="${t.color}"/></svg>
4
4
  <span>${t.name}:</span>
@@ -1 +1 @@
1
- import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{t}from"./useConfig-6jO1fkp5.js";import{$ as n,D as r,Dt as i,Ht as a,Jt as o,Lt as s,M as c,S as l,X as ee,Yt as te,Zt as ne,at as u,b as re,i as ie,in as ae,nn as oe,nt as se,pt 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}from"./useHints-BH9r_0Vd.js";import{t as ge}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{t as _e}from"./useNestedProp-DnGoh-XS.js";import{t as ve}from"./useThemeCheck-BKNRbGeC.js";import{t as ye}from"./chartImage-DPGnEuYM.js";import{n as be}from"./Title-BliHuXfT.js";import{t as xe}from"./useChartExport-BZts4KFb.js";import{n as Se,t as Ce}from"./tableIntegration-CNoJ1CIY.js";import{n as we,t as Te}from"./annotationSlots-BRR85CqJ.js";import{n as Ee,t as De}from"./userOptionsSlots-DYuo-E5m.js";import{t as Oe}from"./usePrinter-sVoTzet1.js";import{c as ke}from"./canvas-lib-22VpOI4_.js";import{t as Ae}from"./useResponsive-CENUxfEL.js";import{t as je}from"./DefGrad-DKMq1REY.js";import{t as Me}from"./BaseLegendToggle-Q3TiW9u1.js";import{t as Ne}from"./A11yDataTable-DWNlWXzs.js";import{t as Pe}from"./useUserOptionState-CXlFnwPv.js";import{t as Fe}from"./useChartAccessibility-DOMuYJfm.js";import{t as Ie}from"./Legend-DM0ClX3D.js";import{t as Le}from"./useAutoSizeLabelsInsideViewbox-AIRF0PlD.js";import{t as Re}from"./vue_ui_radar-68iK9Fam.js";import{Fragment as d,Teleport as ze,computed as f,createBlock as p,createCommentVNode as m,createElementBlock as h,createElementVNode as g,createSlots as Be,createTextVNode as Ve,createVNode as He,defineAsyncComponent as _,guardReactiveProps as v,mergeProps as Ue,nextTick as We,normalizeClass as Ge,normalizeProps as y,normalizeStyle as b,onBeforeUnmount as Ke,onMounted as qe,openBlock as x,ref as S,renderList as C,renderSlot as w,resolveDynamicComponent as Je,shallowRef as Ye,toDisplayString as T,toRefs as Xe,unref as E,watch as Ze,withCtx as D}from"vue";var Qe=/* @__PURE__ */ e({default:()=>kt}),$e=[`id`],et=[`id`],tt=[`id`],nt={style:{position:`relative`}},rt=[`xmlns`,`aria-describedby`,`viewBox`],it=[`width`,`height`],at={key:1},ot=[`x1`,`y1`,`x2`,`y2`,`stroke`,`stroke-width`],st={key:0,style:{"pointer-events":`none`}},ct=[`d`,`stroke`,`stroke-width`],lt=[`d`,`stroke`,`stroke-width`],ut={key:2},dt=[`x`,`y`,`text-anchor`,`font-size`,`fill`,`onMouseenter`,`onMouseleave`,`onClick`],ft=[`points`,`stroke`,`stroke-width`],pt=[`points`,`stroke`,`stroke-width`,`fill`],mt=[`d`,`stroke`,`stroke-width`,`stroke-dasharray`],ht={key:4},gt=[`onMouseenter`,`onMouseleave`,`onClick`],_t=[`cx`,`cy`,`r`],vt=[`cx`,`cy`,`fill`,`r`,`stroke`],yt={key:0,style:{position:`absolute`,top:`100%`,left:`0`,width:`100%`},"data-dom-to-png-ignore":``,"aria-hidden":`true`},bt={key:5,class:`vue-data-ui-watermark`},xt=[`id`],St=[`onClick`],Ct={class:`vue-data-ui-legend-item`},wt=[`stroke`,`stroke-width`,`stroke-dasharray`],Tt={key:0,style:{"max-width":`200px`,margin:`0 auto`}},Et={class:`vue-ui-radar-tooltip-datalabel`,style:{width:`100%`}},Dt={class:`vue-ui-radar-tooltip-datalabel-name`},Ot={key:0},kt=/*#__PURE__*/ ge({__name:`vue-ui-radar`,props:{config:{type:Object,default(){return{}}},dataset:{type:Object,default(){return{}}}},emits:[`selectLegend`,`copyAlt`],setup(e,{expose:ge,emit:Qe}){let kt=_(()=>import(`./Tooltip-C1q0Qoh7.js`)),At=_(()=>import(`./BaseIcon-Cm-IJ179.js`).then(e=>e.n)),jt=_(()=>import(`./vue-ui-sparkbar-BS5v3HMo.js`).then(e=>e.n)),Mt=_(()=>import(`./vue-ui-accordion-S3nRtTU-.js`).then(e=>e.n)),Nt=_(()=>import(`./DataTable-0Vv-aGHD.js`)),Pt=_(()=>import(`./PenAndPaper-BGEp-TUm.js`).then(e=>e.t)),Ft=_(()=>import(`./UserOptions-uWHV_zPB.js`).then(e=>e.n)),It=_(()=>import(`./PackageVersion-C4ZM3Vf7.js`).then(e=>e.t)),Lt=_(()=>import(`./BaseDraggableDialog-DHgIPVmz.js`).then(e=>e.n)),{vue_ui_radar:Rt}=t(),{isThemeValid:zt,warnInvalidTheme:Bt}=ve(),O=e,Vt=f(()=>!!O.dataset&&Object.keys(O.dataset).length),k=S(ee()),Ht=S(!1),Ut=S(``),Wt=S(0),A=S(null),Gt=S(null),Kt=S(null),qt=S(null),Jt=S(null),Yt=S(0),Xt=S(0),Zt=S(0),Qt=S(!1),$t=S(null),en=S(null),j=S(null),tn=S({x:0,y:0}),nn=S(`pointer`),rn=S(!1),M=S(dn()),N=f(()=>M.value.userOptions),P=f(()=>M.value.style.chart.layout.labels),F=f(()=>M.value.style.chart.layout),I=f(()=>M.value.style.chart.tooltip),L=f(()=>M.value.style.chart);he({config:()=>M.value,dataset:()=>O.dataset,component:`VueUiRadar`,rules:[{test:e=>e?.categories&&e.categories.length===0,message:[`👀 There are no categories in your dataset. Consider:`,``,`▶️ Adding categories...`]},{test:e=>e?.series&&e.series.length===0,message:[`👀 There are no series in your dataset. Consider:`,``,`▶️ Adding series...`]},{test:e=>e?.categories&&e.categories.length>3,message:[`👀 The number of categories > 3, the chart might become hard to read. Consider:`,``,`▶️ Using several instances of the component to display related categories.`,``,`▶️ Adding filters to allow users to choose a maximum number of categories.`]},{test:e=>e?.series&&e.series.length>12,message:[`👀 The number of series is > 12. Consider:`,``,`▶️ Using several instances of the component to distribute the series.`,``,`▶️ Using filters to let users choose a maximum number of series to display.`,``]}]});let R=f(()=>M.value.userOptions.useCursorPointer),an=f(()=>ae({defaultConfig:{userOptions:{show:!1},table:{show:!1},useCssAnimation:!1,style:{chart:{backgroundColor:`#99999930`,layout:{grid:{stroke:`#6A6A6A90`},labels:{dataLabels:{show:!1}},outerPolygon:{stroke:`#6A6A6A`}},legend:{backgroundColor:`transparent`}}}},userConfig:M.value.skeletonConfig??{}})),{loading:on,FINAL_DATASET:z}=pe({...Xe(O),FINAL_CONFIG:M,prepareConfig:dn,callback:()=>{Promise.resolve().then(async()=>{await We(),W.value.showTable=M.value.table.show})},skeletonDataset:O.config?.skeletonDataset??{categories:[{name:`_`,color:`#6A6A6A`}],series:[{name:`_`,values:[.6],target:1},{name:`_`,values:[.6],target:1},{name:`_`,values:[.6],target:1},{name:`_`,values:[.6],target:1},{name:`_`,values:[.6],target:1},{name:`_`,values:[.6],target:1}]},skeletonConfig:ae({defaultConfig:M.value,userConfig:an.value})}),{userOptionsVisible:sn,setUserOptionsVisibility:cn,keepUserOptionState:ln}=Pe({config:M.value}),{svgRef:B}=Fe({config:L.value.title});function un(e){return{...e,style:{...e.style,chart:{...e.style.chart,layout:{...e.style.chart.layout,grid:{rotate:0,...e.style.chart.layout.grid},labels:{...e.style.chart.layout.labels,dataLabels:{offset:0,...e.style.chart.layout.labels.dataLabels}}}}}}}function dn(){let e=un(_e({userConfig:O.config,defaultConfig:Rt})),t=e.theme;if(!t)return e;if(!zt.value(e))return Bt(e),e;let n=_e({userConfig:Re[t]||O.config,defaultConfig:e}),r=_e({userConfig:O.config,defaultConfig:n});return{...r,customPalette:r.customPalette.length?r.customPalette:oe[t]||a}}let fn=ne(O.config);Ze(()=>O.config,(e,t)=>{let n=ne(e),r=n!==fn;fn=n;let i=dn();r?(M.value=i,sn.value=!M.value.userOptions.showOnChartHover,pn(),Yt.value+=1,Xt.value+=1,Zt.value+=1,W.value.dataLabels.show=P.value.dataLabels.show,W.value.showTable=M.value.table.show,W.value.showTooltip=I.value?I.value.show:!1):(M.value.style.chart.tooltip=i.style.chart.tooltip,W.value.showTooltip=M.value.style.chart.tooltip.show)},{deep:!0});let V=Ye(null),H=Ye(null),U=f(()=>M.value.debug);function pn(){if(fe(O.dataset)&&u({componentName:`VueUiRadar`,type:`dataset`,debug:U.value}),M.value.responsive){let e=ke(()=>{let{width:e,height:t}=Ae({chart:A.value,title:L.value.title.text?Gt.value:null,legend:L.value.legend.show?Kt.value:null,source:qt.value,noTitle:Jt.value});requestAnimationFrame(()=>{G.value.width=e,G.value.height=t,Hn()})});V.value&&(H.value&&V.value.unobserve(H.value),V.value.disconnect()),V.value=new ResizeObserver(e),H.value=A.value.parentNode,V.value.observe(H.value)}Hn()}qe(()=>{Qt.value=!0,pn()}),Ke(()=>{V.value&&(H.value&&V.value.unobserve(H.value),V.value.disconnect())});let{isPrinting:mn,isImaging:hn,generatePdf:gn,generateImage:_n}=Oe({elementId:`vue-ui-radar_${k.value}`,fileName:L.value.title.text||`vue-ui-radar`,options:M.value.userOptions.print}),vn=f(()=>M.value.userOptions.show&&!L.value.title.text),yn=f(()=>ue(M.value.customPalette)),W=S({dataLabels:{show:P.value.dataLabels.show},showTable:M.value.table.show,showTooltip:I.value.show}),bn=f(()=>({style:{backgroundColor:`#FFFFFF00`,animation:{show:I.value.animation.show,animationFrames:I.value.animation.animationFrames},labels:{fontSize:I.value.fontSize,name:{color:I.value.color}},gutter:{backgroundColor:`#CCCCCC`,opacity:30}}})),G=S({height:312,width:512}),xn=Qe,K=S([]),Sn=S(null),q=S(!1);function Cn(){K.value.length?K.value=[]:Z.value.forEach((e,t)=>{K.value.push(t)}),wn()}function wn(){xn(`selectLegend`,Z.value.filter((e,t)=>!K.value.includes(t)).map(e=>({name:e.name,color:e.color,proportion:e.totalProportion})))}function Tn(e){q.value=!0,K.value.includes(e)?(Sn.value=e,K.value=K.value.filter(t=>t!==e),setTimeout(()=>{q.value=!1,Sn.value=null},500)):(K.value.push(e),setTimeout(()=>{q.value=!1},500)),wn()}function En(){return Z.value.map(e=>({name:e.name,color:e.color,proportion:e.totalProportion}))}function Dn(){let e=z.value;[null,void 0].includes(e?.categories)?(u({componentName:`VueUiRadar`,type:`dataset`,debug:U.value}),u({componentName:`VueUiRadar`,type:`datasetAttribute`,property:`categories ({ name: string; prefix?: string; suffix?: string}[])`,debug:U.value})):(e.categories.length===0?u({componentName:`VueUiRadar`,type:`datasetAttributeEmpty`,property:`categories`,debug:U.value}):U.value&&e.categories.forEach((e,t)=>{de({datasetObject:e,requiredAttributes:[`name`]}).forEach(e=>{u({componentName:`VueUiRadar`,type:`datasetAttribute`,property:`category.${e} at index ${t}`,index:t})})}),[null,void 0].includes(e?.series)?u({componentName:`VueUiRadar`,type:`datasetAttribute`,property:`series ({ name: string; values: number[]; color?: string; target: number}[])`,debug:U.value}):U.value&&e.series.forEach((e,t)=>{de({datasetObject:e,requiredAttributes:[`name`,`values`,`target`]}).forEach(e=>{u({componentName:`VueUiRadar`,type:`datasetSerieAttribute`,key:`series`,property:e,index:t})})}))}Ze(()=>z.value,()=>Dn(),{deep:!0,immediate:!0});let J=f(()=>{let e=Array.isArray(z.value?.categories)?z.value.categories:[],t=yn.value??a;return e.map((e,n)=>({name:e?.name??``,categoryId:`radar_category_${k.value}_${n}`,color:l(e?.color)||t[n]||a[n%a.length],prefix:e?.prefix??``,suffix:e?.suffix??``}))}),Y=f(()=>z.value.series.map((e,t)=>({...e,color:l(e.color)||yn.value[t]||a[t]||a[t%a.length],serieId:`radar_serie_${k.value}_${t}`,formatter:e.formatter||null,absoluteIndex:t})));function On(e){return Y.value.length?Z.value.find(t=>t.name===e)||(U.value&&console.warn(`VueUiRadar - Series name not found "${e}"`),null):(U.value&&console.warn(`VueUiRadar - There are no series to show.`),null)}function kn(e){let t=On(e);t!==null&&K.value.includes(t.absoluteIndex)&&Tn(t.absoluteIndex)}function An(e){let t=On(e);t!==null&&(K.value.includes(t.absoluteIndex)||Tn(t.absoluteIndex))}let jn=f(()=>Math.max(0,...Y.value.flatMap(e=>e.values)));function Mn(e){return F.value.scaleToAxisMax?Math.max(1,e.target||0,...e.values):e.target||jn.value||1}let Nn=f(()=>Y.value.map((e,t)=>{let n=Rn.value.coordinates[t];return Un({centerX:G.value.width/2,centerY:G.value.height/2,apexX:n.x,apexY:n.y,proportion:(e.target||0)/Mn(e)})})),Pn=f(()=>Y.value.length),Fn=f(()=>Math.min(G.value.width,G.value.height)/3),In=f(()=>{let e=Number(F.value.plots.radius??0);return Math.max(Number.isFinite(e)?e*2.5:0,10)}),Ln=f(()=>{let e=Number(F.value.grid.rotation??0);return Number.isFinite(e)?e*Math.PI/180:0}),Rn=f(()=>c({plot:{x:G.value.width/2,y:G.value.height/2},radius:Fn.value,sides:Pn.value,rotation:Ln.value})),zn=f(()=>{let e=[];for(let t=0;t<Fn.value;t+=Fn.value/F.value.grid.graduations)e.push(t);return e}),X=f(()=>Rn.value.coordinates.map((e,t)=>{let n=Y.value[t],r=Y.value[t].values.map(t=>Un({centerX:G.value.width/2,centerY:G.value.height/2,apexX:e.x,apexY:e.y,proportion:t/Mn(n)}));return{...e,...n,plots:r}}).map(e=>({...e,labelX:Bn(e).x,labelY:Bn(e).y,labelAnchor:Bn(e).anchor})));function Bn({x:e,y:t}){let n=G.value.width/2,r=G.value.height/2,i=e-n,a=t-r,o=Math.hypot(i,a),s=Number(P.value.dataLabels.offset??0),c=20+(Number.isFinite(s)?s:0);if(!o)return{x:e,y:t,anchor:`middle`};let l=i/o,ee=a/o,te=`middle`;return l>.01?te=`start`:l<-.01&&(te=`end`),{x:e+l*c,y:t+ee*c,anchor:te}}let Vn=f({get:()=>P.value.dataLabels.fontSize,set:e=>e}),{autoSizeLabels:Hn}=Le({svgRef:B,fontSize:P.value.dataLabels.fontSize,minFontSize:6,sizeRef:Vn,labelClass:`.vue-ui-radar-apex-label`});function Un({centerX:e,centerY:t,apexX:n,apexY:r,proportion:i}){return{x:e+(n-e)*i,y:t+(r-t)*i}}let Z=f(()=>{let e=Y.value.map((e,t)=>e.values.map(t=>t/(e.target||jn.value)));return J.value.map((t,r)=>{let i=re(e.map(e=>e[r]).reduce((e,t)=>e+t,0)/Y.value.length);return{...t,absoluteIndex:r,totalProportion:i,shape:`circle`,opacity:K.value.includes(r)?.5:1,segregate:()=>Tn(r),isSegregated:K.value.includes(r),display:`${t.name}: ${n({v:(i??0)*100,s:`%`,r:L.value.legend.roundingPercentage})}`}})}),Wn=f(()=>({cy:`radar-div-legend`,backgroundColor:L.value.legend.backgroundColor,color:L.value.legend.color,fontSize:L.value.legend.fontSize,paddingBottom:12,fontWeight:L.value.legend.bold?`bold`:``})),Q=f(()=>{let e=[{name:M.value.translations.datapoint,color:``},{name:M.value.translations.target,color:``},...Z.value];return{head:e,body:z.value.series.map(e=>[e.name,ie(e.formatter,e.target,n({p:e.prefix,v:e.target,s:e.suffix,r:M.value.table.td.roundingValue})),...e.values.map((t,r)=>`${ie(e.formatter,t,n({p:J.value[r]?.prefix??``,v:t,s:J.value[r]?.suffix??``,r:M.value.table.td.roundingValue}))} (${isNaN(t/e.target)?``:n({v:t/e.target*100,s:`%`,r:M.value.table.td.roundingPercentage})})`)]),config:{th:{backgroundColor:M.value.table.th.backgroundColor,color:M.value.table.th.color,outline:M.value.table.th.outline},td:{backgroundColor:M.value.table.td.backgroundColor,color:M.value.table.td.color,outline:M.value.table.td.outline},breakpoint:M.value.table.responsiveBreakpoint},colNames:e}}),Gn=S(null),Kn=S([]),qn=S(null);function Jn(e,t){Ht.value=!1,Gn.value=null,j.value=null,nn.value=`pointer`,M.value.events.datapointLeave&&M.value.events.datapointLeave({datapoint:e,seriesIndex:t})}function Yn(e,t){M.value.events.datapointClick&&M.value.events.datapointClick({datapoint:e,seriesIndex:t})}function Xn(e,t,r=`pointer`){M.value.events.datapointEnter&&M.value.events.datapointEnter({datapoint:e,seriesIndex:t}),nn.value=r,j.value=t;let a=J.value.slice();Kn.value=[],Gn.value=t,Ht.value=!0,qn.value={datapoint:e,seriesIndex:t,series:{categories:a,datapoints:Y.value,radar:X.value},config:M.value};let o=I.value.customFormat;if(i(o)&&ce(()=>o({seriesIndex:t,datapoint:e,series:{categories:a,datapoints:Y.value,radar:X.value},config:M.value})))Ut.value=o({seriesIndex:t,datapoint:e,series:{categories:a,datapoints:Y.value,radar:X.value},config:M.value});else{Ut.value=`<div style="width:100%;text-align:center;border-bottom:1px solid ${I.value.borderColor};padding-bottom:6px;margin-bottom:3px;">${e.name}</div>`;for(let t=0;t<e.values.length;t+=1)if(!K.value.includes(t)){let r=a[t],i=e.values[t],o=isNaN(i/e.target)?0:i/e.target*100,s=ie(e.formatter,i,n({p:J.value[t].prefix,v:i,s:J.value[t].suffix,r:I.value.roundingValue}),{datapoint:e}),c=n({v:o,s:`%`,r:I.value.roundingPercentage}),l=I.value.showValue&&I.value.showPercentage?`${s} (${c})`:I.value.showValue&&!I.value.showPercentage?s:!I.value.showValue&&I.value.showPercentage?`${c}`:``;Kn.value.push({name:r?.name??`#${t+1}`,value:e.values[t]/e.target*100,color:r?.color,suffix:l,prefix:``,rounding:I.value.roundingPercentage,formatter:e.formatter})}}}function Zn(e=null){We(()=>{let t=[[L.value.title.text],[L.value.title.subtitle.text],[``]],n=[[``],[M.value.translations.target],...Z.value.flatMap(e=>[[e.name],[`%`]])],i=z.value.series.map((e,t)=>[e.name,e.target,...e.values.flatMap(t=>[t,isNaN(t/e.target)?``:t/e.target*100])]),a=t.concat([n]).concat(i),o=r(a);e?e(o):se({csvContent:o,title:L.value.title.text||`vue-ui-radar`})})}let $=S(!1);function Qn(e){$.value=e,Wt.value+=1}function $n(){W.value.showTable=!W.value.showTable}function er(){W.value.showTooltip=!W.value.showTooltip}let tr=S(!1);function nr(){tr.value=!tr.value}let rr=ye(A,()=>L.value.title.text),ir=f(()=>Ce({config:M,style:L,mutableConfig:W,dialog:Lt,accordion:Mt,isFullscreen:$,parent:A,maxWidth:800,isCursorPointer:R}));Ze(()=>W.value.showTable,e=>Se(e,M,$t));function ar(){W.value.showTable=!1,en.value&&en.value.setTableIconState(!1)}let or=f(()=>Z.value.map(e=>({...e,name:e.display}))),sr=f(()=>L.value.backgroundColor),cr=f(()=>L.value.legend),lr=f(()=>L.value.title),{isCallbackImaging:ur,isCallbackSvg:dr,generateSvg:fr,onGenerateImage:pr}=xe({svg:B,title:lr,legend:cr,legendItems:or,backgroundColor:sr,getSvgCallback:()=>M.value.userOptions.callbacks.svg,generateImage:_n});async function mr(){xn(`copyAlt`,{config:M.value,dataset:X.value}),M.value.userOptions.callbacks.altCopy?await Promise.resolve(M.value.userOptions.callbacks.altCopy({config:M.value,dataset:X.value})):console.warn("Vue Data UI - A callback must be set for `altCopy` in userOptions.")}function hr(){j.value=null,rn.value=!0}function gr(){j.value=null,nn.value=`pointer`,Ht.value=!1,Gn.value=null,rn.value=!1}function _r(e){if(!Number.isFinite(e)||!B.value)return;let t=X.value[e];if(!t)return;let n=B.value.getBoundingClientRect();tn.value={x:n.left+t.labelX/G.value.width*n.width,y:n.top+t.labelY/G.value.height*n.height}}function vr(e){if(!B.value||tr.value||document.activeElement!==B.value||!X.value.length)return;let t=[`ArrowLeft`,`ArrowUp`].includes(e.key),n=[`ArrowRight`,`ArrowDown`].includes(e.key),r=e.key===`Enter`||e.key===` `,i=e.key===`Escape`;if(!t&&!n&&!r&&!i)return;if(e.preventDefault(),e.stopPropagation(),i){j.value=null,nn.value=`pointer`,Ht.value=!1,Gn.value=null;return}if(r){if(j.value===null)return;let e=X.value[j.value];if(!e)return;Yn(e,j.value);return}let a=j.value;a===null||a<0||a>=X.value.length?a=n?0:X.value.length-1:n?(a+=1,a>=X.value.length&&(a=0)):t&&(--a,a<0&&(a=X.value.length-1));let o=X.value[a];o&&(j.value=a,_r(a),Xn(o,a,`keyboard`))}let yr=f(()=>({headers:Q.value?.colNames?.map(e=>e.name??e)??[],rows:Q.value?.body??[]}));return ge({getData:En,getImage:rr,generatePdf:gn,generateCsv:Zn,generateImage:_n,generateSvg:fr,hideSeries:An,showSeries:kn,toggleTable:$n,toggleTooltip:er,toggleAnnotator:nr,toggleFullscreen:Qn,copyAlt:mr}),(e,t)=>(x(),h(`div`,{class:Ge(`vue-data-ui-component vue-ui-radar ${$.value?`vue-data-ui-wrapper-fullscreen`:``} ${M.value.useCssAnimation?``:`vue-ui-dna`}`),ref_key:`radarChart`,ref:A,id:`vue-ui-radar_${k.value}`,style:b(`font-family:${M.value.style.fontFamily};width:100%; ${M.value.responsive?`height: 100%;`:``} text-align:center;background:${L.value.backgroundColor}`),onMouseenter:t[2]||=()=>E(cn)(!0),onMouseleave:t[3]||=()=>E(cn)(!1)},[g(`div`,{id:`chart-instructions-${k.value}`,class:`sr-only`},[g(`p`,null,T(M.value.a11y.translations.keyboardNavigation),1)],8,et),yr.value?.rows?.length?(x(),p(Ne,{key:0,uid:k.value,head:yr.value.headers,body:yr.value.rows,notice:M.value.a11y.translations.tableAvailable,caption:M.value.a11y.translations.tableCaption},null,8,[`uid`,`head`,`body`,`notice`,`caption`])):m(``,!0),N.value.buttons.annotator?(x(),p(E(Pt),{key:1,svgRef:E(B),backgroundColor:L.value.backgroundColor,color:L.value.color,active:tr.value,isCursorPointer:R.value,palette:N.value.annotatorPalette,onClose:nr},Be({_:2},[C(E(Te),t=>({name:t,fn:D(n=>[w(e.$slots,t,y(v(E(we)(t,n))),void 0,!0)])}))]),1032,[`svgRef`,`backgroundColor`,`color`,`active`,`isCursorPointer`,`palette`])):m(``,!0),vn.value?(x(),h(`div`,{key:2,ref_key:`noTitle`,ref:Jt,class:`vue-data-ui-no-title-space`,style:`height:36px; width: 100%;background:transparent`},null,512)):m(``,!0),L.value.title.text?(x(),h(`div`,{key:3,ref_key:`chartTitle`,ref:Gt,style:`width:100%;background:transparent;padding-bottom:12px`},[(x(),p(be,{key:`title_${Yt.value}`,config:{title:{cy:`radar-div-title`,...L.value.title},subtitle:{cy:`radar-div-subtitle`,...L.value.title.subtitle}}},null,8,[`config`]))],512)):m(``,!0),g(`div`,{id:`legend-top-${k.value}`},null,8,tt),N.value.show&&Vt.value&&(E(ln)||E(sn))?(x(),p(E(Ft),{ref_key:`userOptionsRef`,ref:en,key:`user_options_${Wt.value}`,backgroundColor:L.value.backgroundColor,color:L.value.color,isImaging:E(hn),isPrinting:E(mn),uid:k.value,hasTooltip:N.value.buttons.tooltip&&I.value.show,hasPdf:N.value.buttons.pdf,hasImg:N.value.buttons.img,hasSvg:N.value.buttons.svg,hasXls:N.value.buttons.csv,hasTable:N.value.buttons.table,hasFullscreen:N.value.buttons.fullscreen,hasAltCopy:N.value.buttons.altCopy,isFullscreen:$.value,isTooltip:W.value.showTooltip,titles:{...N.value.buttonTitles},chartElement:A.value,position:N.value.position,hasAnnotator:N.value.buttons.annotator,isAnnotation:tr.value,callbacks:N.value.callbacks,printScale:N.value.print.scale,tableDialog:M.value.table.useDialog,isCursorPointer:R.value,onToggleFullscreen:Qn,onGeneratePdf:E(gn),onGenerateCsv:Zn,onGenerateImage:E(pr),onGenerateSvg:E(fr),onToggleTable:$n,onToggleTooltip:er,onToggleAnnotator:nr,onCopyAlt:mr,style:b({visibility:E(ln)?E(sn)?`visible`:`hidden`:`visible`})},Be({_:2},[C(E(Ee)(e.$slots,`menuIcon optionTooltip optionPdf optionCsv optionImg optionSvg optionTable optionFullscreen optionAnnotator optionAltCopy custom-menu-before custom-menu-after`),t=>({name:t,fn:D(n=>[w(e.$slots,t,y(v(E(De)(t,n))),void 0,!0)])}))]),1032,/* @__PURE__ */ `backgroundColor.color.isImaging.isPrinting.uid.hasTooltip.hasPdf.hasImg.hasSvg.hasXls.hasTable.hasFullscreen.hasAltCopy.isFullscreen.isTooltip.titles.chartElement.position.hasAnnotator.isAnnotation.callbacks.printScale.tableDialog.isCursorPointer.onGeneratePdf.onGenerateImage.onGenerateSvg.style`.split(`.`))):m(``,!0),g(`div`,nt,[(x(),h(`svg`,{ref_key:`svgRef`,ref:B,xmlns:E(le),"aria-describedby":`chart-instructions-${k.value}`,class:Ge({"vue-data-ui-fullscreen--on":$.value,"vue-data-ui-fulscreen--off":!$.value}),viewBox:`0 0 ${G.value.width<=0?10:G.value.width} ${G.value.height<=0?10:G.value.height}`,style:b(`max-width:100%;overflow:visible;background:transparent;color:${L.value.color}`),tabindex:`0`,onFocus:hr,onBlur:gr,onKeydown:vr},[He(E(It)),w(e.$slots,`svg-underlayer`,{svg:{...G.value,outerPolygon:Rn.value,isPrintingImg:E(mn)||E(hn)||E(ur),isPrintingSvg:E(dr)}},void 0,!0),e.$slots[`chart-background`]?(x(),h(`foreignObject`,{key:0,x:0,y:0,width:G.value.width<=0?10:G.value.width,height:G.value.height<=0?10:G.value.height,style:{pointerEvents:`none`}},[w(e.$slots,`chart-background`,{},void 0,!0)],8,it)):m(``,!0),g(`defs`,null,[(x(!0),h(d,null,C(J.value,(e,t)=>(x(),p(je,{t:`radial`,cx:`50%`,cy:`50%`,r:`50%`,fx:`50%`,fy:`50%`,id:`radar_gradient_${k.value}_${t}`,key:`radar_gradient_${k.value}_${t}`,stops:[[`0%`,E(o)(E(te)(e.color,.05),F.value.dataPolygon.opacity),1],[`100%`,E(o)(e.color,F.value.dataPolygon.opacity),1]]},null,8,[`id`,`stops`]))),128))]),F.value.grid.show?(x(),h(`g`,at,[(x(!0),h(d,null,C(X.value,e=>(x(),h(`line`,{x1:G.value.width/2,y1:G.value.height/2,x2:e.x,y2:e.y,stroke:F.value.grid.stroke,"stroke-width":F.value.grid.strokeWidth,style:{"pointer-events":`none`}},null,8,ot))),256)),F.value.grid.graduations>0?(x(),h(`g`,st,[(x(!0),h(d,null,C(zn.value,e=>(x(),h(`path`,{d:E(c)({plot:{x:G.value.width/2,y:G.value.height/2},radius:e,sides:Pn.value,rotation:Ln.value}).path,fill:`none`,stroke:F.value.grid.stroke,"stroke-width":F.value.grid.strokeWidth},null,8,ct))),256))])):m(``,!0)])):m(``,!0),g(`path`,{d:Rn.value.path,fill:`none`,stroke:F.value.outerPolygon.stroke,"stroke-width":F.value.outerPolygon.strokeWidth,"stroke-linejoin":`round`,"stroke-linecap":`round`,style:{"pointer-events":`none`}},null,8,lt),P.value.dataLabels.show?(x(),h(`g`,ut,[(x(!0),h(d,null,C(X.value,(e,t)=>(x(),h(`text`,{class:`vue-ui-radar-apex-label`,x:e.labelX,y:e.labelY,"text-anchor":e.labelAnchor,"dominant-baseline":`middle`,"font-size":P.value.dataLabels.fontSize,fill:P.value.dataLabels.color,onMouseenter:n=>Xn(e,t,`pointer`),onMouseleave:n=>Jn(e,t),onClick:n=>Yn(e,t)},T(e.name),41,dt))),256))])):m(``,!0),(x(!0),h(d,null,C(J.value,(e,t)=>(x(),h(`g`,null,[g(`g`,null,[M.value.useCssAnimation||!M.value.useCssAnimation&&!K.value.includes(t)?(x(),h(`polygon`,{key:0,points:E(s)(X.value.map(e=>e.plots[t]),!1,!0),stroke:L.value.backgroundColor,"stroke-width":F.value.dataPolygon.strokeWidth+1,fill:`none`,class:Ge({"animated-out":K.value.includes(t)&&M.value.useCssAnimation,"animated-in":q.value&&Sn.value===t&&M.value.useCssAnimation}),style:{"pointer-events":`none`}},null,10,ft)):m(``,!0),M.value.useCssAnimation||!M.value.useCssAnimation&&!K.value.includes(t)?(x(),h(`polygon`,{key:1,points:E(s)(X.value.map(e=>e.plots[t]),!1,!0),stroke:e.color,"stroke-width":F.value.dataPolygon.strokeWidth,fill:F.value.dataPolygon.transparent?`transparent`:F.value.dataPolygon.useGradient?`url(#radar_gradient_${k.value}_${t})`:E(o)(e.color,F.value.dataPolygon.opacity),class:Ge({"animated-out":K.value.includes(t)&&M.value.useCssAnimation,"animated-in":q.value&&Sn.value===t&&M.value.useCssAnimation}),style:{"pointer-events":`none`}},null,10,pt)):m(``,!0)])]))),256)),F.value.targetReference.show?(x(),h(`path`,{key:3,class:`vue-ui-radar-target-polygon`,d:`M${E(s)(Nn.value,!1,!0)}Z`,fill:`none`,stroke:F.value.targetReference.stroke,"stroke-width":F.value.targetReference.strokeWidth,"stroke-linejoin":`round`,"stroke-linecap":`round`,"stroke-dasharray":F.value.targetReference.strokeDasharray,style:{"pointer-events":`none`}},null,8,mt)):m(``,!0),F.value.plots.show?(x(),h(`g`,ht,[(x(!0),h(d,null,C(X.value,(e,t)=>(x(),h(`g`,{key:`radar-category-${t}`},[(x(!0),h(d,null,C(e.plots,(n,r)=>(x(),h(`g`,{key:`radar-plot-${t}-${r}`,onMouseenter:n=>!K.value.includes(r)&&Xn(e,t,`pointer`),onMouseleave:n=>!K.value.includes(r)&&Jn(e,t),onClick:n=>!K.value.includes(r)&&Yn(e,t)},[g(`circle`,{cx:n.x,cy:n.y,r:In.value,fill:`transparent`,stroke:`transparent`,style:b({pointerEvents:K.value.includes(r)?`none`:`all`})},null,12,_t),g(`circle`,{cx:n.x,cy:n.y,fill:K.value.includes(r)?`transparent`:J.value[r]?J.value[r].color:`transparent`,r:Gn.value!==null&&Gn.value===t?F.value.plots.radius*1.6:F.value.plots.radius,stroke:K.value.includes(r)?`transparent`:L.value.backgroundColor,"stroke-width":.5,class:Ge({"animated-out":K.value.includes(r)&&M.value.useCssAnimation,"animated-in":q.value&&Sn.value===r&&M.value.useCssAnimation}),style:{"pointer-events":`none`}},null,10,vt)],40,gt))),128))]))),128))])):m(``,!0),w(e.$slots,`svg`,{svg:{...G.value,outerPolygon:Rn.value,isPrintingImg:E(mn)||E(hn)||E(ur),isPrintingSvg:E(dr)}},void 0,!0)],46,rt)),e.$slots.hint?(x(),h(`div`,yt,[w(e.$slots,`hint`,y(v({hint:M.value.a11y.translations.keyboardNavigation,isVisible:rn.value})),void 0,!0)])):m(``,!0)]),e.$slots.watermark?(x(),h(`div`,bt,[w(e.$slots,`watermark`,y(v({isPrinting:E(mn)||E(hn)||E(ur)||E(dr)})),void 0,!0)])):m(``,!0),g(`div`,{id:`legend-bottom-${k.value}`},null,8,xt),Qt.value&&(L.value.legend.show||e.$slots.legend)?(x(),p(ze,{key:6,to:L.value.legend.position===`top`?`#legend-top-${k.value}`:`#legend-bottom-${k.value}`},[g(`div`,{ref_key:`chartLegend`,ref:Kt},[w(e.$slots,`legend`,{legend:Z.value},()=>[L.value.legend.show?(x(),p(Ie,{key:`legend_${Zt.value}`,legendSet:Z.value,config:Wn.value,isCursorPointer:R.value,onClickMarker:t[0]||=({i:e})=>Tn(e)},Be({item:D(({legend:e,index:t})=>[E(on)?m(``,!0):(x(),h(`div`,{key:0,onClick:t=>e.segregate(),style:b(`opacity:${K.value.includes(t)?.5:1}`)},T(e.display),13,St))]),legendToggle:D(()=>[Z.value.length>2&&L.value.legend.selectAllToggle.show&&!E(on)?(x(),p(Me,{key:0,backgroundColor:L.value.legend.selectAllToggle.backgroundColor,color:L.value.legend.selectAllToggle.color,fontSize:L.value.legend.fontSize,checked:K.value.length>0,isCursorPointer:R.value,onToggle:Cn},null,8,[`backgroundColor`,`color`,`fontSize`,`checked`,`isCursorPointer`])):m(``,!0)]),_:2},[F.value.targetReference.show&&F.value.targetReference.showInLegend?{name:`after`,fn:D(()=>[g(`div`,Ct,[g(`div`,{style:b({display:`flex`,height:L.value.legend.fontSize})},[(x(),h(`svg`,{style:b({width:L.value.legend.fontSize*2}),viewBox:`0 0 16 8`},[g(`line`,{x1:`0`,x2:`16`,y1:`4`,y2:`4`,stroke:F.value.targetReference.stroke,"stroke-width":F.value.targetReference.strokeWidth*.7,"stroke-dasharray":F.value.targetReference.strokeDasharray*.7,"stroke-linecap":`round`},null,8,wt)],4))],4),g(`span`,null,T(F.value.targetReference.legendLabel),1)])]),key:`0`}:void 0]),1032,[`legendSet`,`config`,`isCursorPointer`])):m(``,!0)],!0)],512)],8,[`to`])):m(``,!0),e.$slots.source?(x(),h(`div`,{key:7,ref_key:`source`,ref:qt,dir:`auto`},[w(e.$slots,`source`,{},void 0,!0)],512)):m(``,!0),He(E(kt),{teleportTo:I.value.teleportTo,show:W.value.showTooltip&&Ht.value,backgroundColor:I.value.backgroundColor,color:I.value.color,borderRadius:I.value.borderRadius,borderColor:I.value.borderColor,borderWidth:I.value.borderWidth,backgroundOpacity:I.value.backgroundOpacity,fontSize:I.value.fontSize,position:I.value.position,offsetX:I.value.offsetX,offsetY:I.value.offsetY,parent:A.value,content:Ut.value,isFullscreen:$.value,isCustom:I.value.customFormat&&typeof I.value.customFormat==`function`,smooth:I.value.smooth,backdropFilter:I.value.backdropFilter,smoothForce:I.value.smoothForce,smoothSnapThreshold:I.value.smoothSnapThreshold,isA11yMode:nn.value===`keyboard`,a11yPosition:tn.value},{"tooltip-before":D(()=>[w(e.$slots,`tooltip-before`,y(v({...qn.value})),void 0,!0)]),tooltip:D(()=>[w(e.$slots,`tooltip`,y(v({...qn.value})),void 0,!0)]),"tooltip-after":D(()=>[![`function`].includes(typeof I.value.customFormat)&&!e.$slots.tooltip?(x(),h(`div`,Tt,[He(E(jt),{dataset:Kn.value,config:bn.value,backgroundOpacity:0},{"data-label":D(({bar:e})=>[g(`div`,Et,[g(`span`,Dt,T(e.name+(I.value.showValue||I.value.showPercentage?`:`:``)),1),I.value.showValue||I.value.showPercentage?(x(),h(`span`,Ot,T(e.suffix),1)):m(``,!0)])]),_:1},8,[`dataset`,`config`])])):m(``,!0),w(e.$slots,`tooltip-after`,y(v({...qn.value})),void 0,!0)]),_:3},8,[`teleportTo`,`show`,`backgroundColor`,`color`,`borderRadius`,`borderColor`,`borderWidth`,`backgroundOpacity`,`fontSize`,`position`,`offsetX`,`offsetY`,`parent`,`content`,`isFullscreen`,`isCustom`,`smooth`,`backdropFilter`,`smoothForce`,`smoothSnapThreshold`,`isA11yMode`,`a11yPosition`]),Vt.value&&N.value.buttons.table?(x(),p(Je(ir.value.component),Ue({key:8},ir.value.props,{ref_key:`tableUnit`,ref:$t,onClose:ar}),Be({content:D(()=>[(x(),p(E(Nt),{key:`table_${Xt.value}`,colNames:Q.value.colNames,head:Q.value.head,body:Q.value.body,config:Q.value.config,title:M.value.table.useDialog?``:ir.value.title,withCloseButton:!M.value.table.useDialog,isCursorPointer:R.value,onClose:ar},{th:D(({th:e})=>[Ve(T(e.name),1)]),td:D(({td:e})=>[Ve(T(e),1)]),_:1},8,[`colNames`,`head`,`body`,`config`,`title`,`withCloseButton`,`isCursorPointer`]))]),_:2},[M.value.table.useDialog?{name:`title`,fn:D(()=>[Ve(T(ir.value.title),1)]),key:`0`}:void 0,M.value.table.useDialog?{name:`actions`,fn:D(()=>[g(`button`,{tabindex:`0`,class:`vue-ui-user-options-button`,onClick:t[1]||=e=>Zn(N.value.callbacks.csv),style:b({cursor:R.value?`pointer`:`default`})},[He(E(At),{name:`fileCsv`,stroke:ir.value.props.color},null,8,[`stroke`])],4)]),key:`1`}:void 0]),1040)):m(``,!0),w(e.$slots,`skeleton`,{},()=>[E(on)?(x(),p(me,{key:0})):m(``,!0)],!0)],46,$e))}},[[`__scopeId`,`data-v-6406f550`]]);export{Qe as n,kt as t};
1
+ import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{t}from"./useConfig-6jO1fkp5.js";import{$ as n,D as r,Dt as i,Ht as a,Jt as o,Lt as s,M as c,S as l,X as ee,Yt as te,Zt as ne,at as u,b as re,i as ie,in as ae,nn as oe,nt as se,pt 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}from"./useHints-BH9r_0Vd.js";import{t as ge}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{t as _e}from"./useNestedProp-DnGoh-XS.js";import{t as ve}from"./useThemeCheck-BKNRbGeC.js";import{t as ye}from"./chartImage-DPGnEuYM.js";import{n as be}from"./Title-BliHuXfT.js";import{t as xe}from"./useChartExport-BZts4KFb.js";import{n as Se,t as Ce}from"./tableIntegration-CNoJ1CIY.js";import{n as we,t as Te}from"./annotationSlots-BRR85CqJ.js";import{n as Ee,t as De}from"./userOptionsSlots-DYuo-E5m.js";import{t as Oe}from"./usePrinter-sVoTzet1.js";import{c as ke}from"./canvas-lib-22VpOI4_.js";import{t as Ae}from"./useResponsive-CENUxfEL.js";import{t as je}from"./DefGrad-DKMq1REY.js";import{t as Me}from"./BaseLegendToggle-Q3TiW9u1.js";import{t as Ne}from"./A11yDataTable-DWNlWXzs.js";import{t as Pe}from"./useUserOptionState-CXlFnwPv.js";import{t as Fe}from"./useChartAccessibility-DOMuYJfm.js";import{t as Ie}from"./Legend-DM0ClX3D.js";import{t as Le}from"./useAutoSizeLabelsInsideViewbox-AIRF0PlD.js";import{t as Re}from"./vue_ui_radar-68iK9Fam.js";import{Fragment as d,Teleport as ze,computed as f,createBlock as p,createCommentVNode as m,createElementBlock as h,createElementVNode as g,createSlots as Be,createTextVNode as Ve,createVNode as He,defineAsyncComponent as _,guardReactiveProps as v,mergeProps as Ue,nextTick as We,normalizeClass as Ge,normalizeProps as y,normalizeStyle as b,onBeforeUnmount as Ke,onMounted as qe,openBlock as x,ref as S,renderList as C,renderSlot as w,resolveDynamicComponent as Je,shallowRef as Ye,toDisplayString as T,toRefs as Xe,unref as E,watch as Ze,withCtx as D}from"vue";var Qe=/* @__PURE__ */ e({default:()=>kt}),$e=[`id`],et=[`id`],tt=[`id`],nt={style:{position:`relative`}},rt=[`xmlns`,`aria-describedby`,`viewBox`],it=[`width`,`height`],at={key:1},ot=[`x1`,`y1`,`x2`,`y2`,`stroke`,`stroke-width`],st={key:0,style:{"pointer-events":`none`}},ct=[`d`,`stroke`,`stroke-width`],lt=[`d`,`stroke`,`stroke-width`],ut={key:2},dt=[`x`,`y`,`text-anchor`,`font-size`,`fill`,`onMouseenter`,`onMouseleave`,`onClick`],ft=[`points`,`stroke`,`stroke-width`],pt=[`points`,`stroke`,`stroke-width`,`fill`],mt=[`d`,`stroke`,`stroke-width`,`stroke-dasharray`],ht={key:4},gt=[`onMouseenter`,`onMouseleave`,`onClick`],_t=[`cx`,`cy`,`r`],vt=[`cx`,`cy`,`fill`,`r`,`stroke`],yt={key:0,style:{position:`absolute`,top:`100%`,left:`0`,width:`100%`},"data-dom-to-png-ignore":``,"aria-hidden":`true`},bt={key:5,class:`vue-data-ui-watermark`},xt=[`id`],St=[`onClick`],Ct={class:`vue-data-ui-legend-item`},wt=[`stroke`,`stroke-width`,`stroke-dasharray`],Tt={key:0,style:{"max-width":`200px`,margin:`0 auto`}},Et={class:`vue-ui-radar-tooltip-datalabel`,style:{width:`100%`}},Dt={class:`vue-ui-radar-tooltip-datalabel-name`},Ot={key:0},kt=/*#__PURE__*/ ge({__name:`vue-ui-radar`,props:{config:{type:Object,default(){return{}}},dataset:{type:Object,default(){return{}}}},emits:[`selectLegend`,`copyAlt`],setup(e,{expose:ge,emit:Qe}){let kt=_(()=>import(`./Tooltip-C1q0Qoh7.js`)),At=_(()=>import(`./BaseIcon-Cm-IJ179.js`).then(e=>e.n)),jt=_(()=>import(`./vue-ui-sparkbar-CamZ_49V.js`).then(e=>e.n)),Mt=_(()=>import(`./vue-ui-accordion-S3nRtTU-.js`).then(e=>e.n)),Nt=_(()=>import(`./DataTable-0Vv-aGHD.js`)),Pt=_(()=>import(`./PenAndPaper-BGEp-TUm.js`).then(e=>e.t)),Ft=_(()=>import(`./UserOptions-uWHV_zPB.js`).then(e=>e.n)),It=_(()=>import(`./PackageVersion-BIhjLNBU.js`).then(e=>e.t)),Lt=_(()=>import(`./BaseDraggableDialog-DHgIPVmz.js`).then(e=>e.n)),{vue_ui_radar:Rt}=t(),{isThemeValid:zt,warnInvalidTheme:Bt}=ve(),O=e,Vt=f(()=>!!O.dataset&&Object.keys(O.dataset).length),k=S(ee()),Ht=S(!1),Ut=S(``),Wt=S(0),A=S(null),Gt=S(null),Kt=S(null),qt=S(null),Jt=S(null),Yt=S(0),Xt=S(0),Zt=S(0),Qt=S(!1),$t=S(null),en=S(null),j=S(null),tn=S({x:0,y:0}),nn=S(`pointer`),rn=S(!1),M=S(dn()),N=f(()=>M.value.userOptions),P=f(()=>M.value.style.chart.layout.labels),F=f(()=>M.value.style.chart.layout),I=f(()=>M.value.style.chart.tooltip),L=f(()=>M.value.style.chart);he({config:()=>M.value,dataset:()=>O.dataset,component:`VueUiRadar`,rules:[{test:e=>e?.categories&&e.categories.length===0,message:[`👀 There are no categories in your dataset. Consider:`,``,`▶️ Adding categories...`]},{test:e=>e?.series&&e.series.length===0,message:[`👀 There are no series in your dataset. Consider:`,``,`▶️ Adding series...`]},{test:e=>e?.categories&&e.categories.length>3,message:[`👀 The number of categories > 3, the chart might become hard to read. Consider:`,``,`▶️ Using several instances of the component to display related categories.`,``,`▶️ Adding filters to allow users to choose a maximum number of categories.`]},{test:e=>e?.series&&e.series.length>12,message:[`👀 The number of series is > 12. Consider:`,``,`▶️ Using several instances of the component to distribute the series.`,``,`▶️ Using filters to let users choose a maximum number of series to display.`,``]}]});let R=f(()=>M.value.userOptions.useCursorPointer),an=f(()=>ae({defaultConfig:{userOptions:{show:!1},table:{show:!1},useCssAnimation:!1,style:{chart:{backgroundColor:`#99999930`,layout:{grid:{stroke:`#6A6A6A90`},labels:{dataLabels:{show:!1}},outerPolygon:{stroke:`#6A6A6A`}},legend:{backgroundColor:`transparent`}}}},userConfig:M.value.skeletonConfig??{}})),{loading:on,FINAL_DATASET:z}=pe({...Xe(O),FINAL_CONFIG:M,prepareConfig:dn,callback:()=>{Promise.resolve().then(async()=>{await We(),W.value.showTable=M.value.table.show})},skeletonDataset:O.config?.skeletonDataset??{categories:[{name:`_`,color:`#6A6A6A`}],series:[{name:`_`,values:[.6],target:1},{name:`_`,values:[.6],target:1},{name:`_`,values:[.6],target:1},{name:`_`,values:[.6],target:1},{name:`_`,values:[.6],target:1},{name:`_`,values:[.6],target:1}]},skeletonConfig:ae({defaultConfig:M.value,userConfig:an.value})}),{userOptionsVisible:sn,setUserOptionsVisibility:cn,keepUserOptionState:ln}=Pe({config:M.value}),{svgRef:B}=Fe({config:L.value.title});function un(e){return{...e,style:{...e.style,chart:{...e.style.chart,layout:{...e.style.chart.layout,grid:{rotate:0,...e.style.chart.layout.grid},labels:{...e.style.chart.layout.labels,dataLabels:{offset:0,...e.style.chart.layout.labels.dataLabels}}}}}}}function dn(){let e=un(_e({userConfig:O.config,defaultConfig:Rt})),t=e.theme;if(!t)return e;if(!zt.value(e))return Bt(e),e;let n=_e({userConfig:Re[t]||O.config,defaultConfig:e}),r=_e({userConfig:O.config,defaultConfig:n});return{...r,customPalette:r.customPalette.length?r.customPalette:oe[t]||a}}let fn=ne(O.config);Ze(()=>O.config,(e,t)=>{let n=ne(e),r=n!==fn;fn=n;let i=dn();r?(M.value=i,sn.value=!M.value.userOptions.showOnChartHover,pn(),Yt.value+=1,Xt.value+=1,Zt.value+=1,W.value.dataLabels.show=P.value.dataLabels.show,W.value.showTable=M.value.table.show,W.value.showTooltip=I.value?I.value.show:!1):(M.value.style.chart.tooltip=i.style.chart.tooltip,W.value.showTooltip=M.value.style.chart.tooltip.show)},{deep:!0});let V=Ye(null),H=Ye(null),U=f(()=>M.value.debug);function pn(){if(fe(O.dataset)&&u({componentName:`VueUiRadar`,type:`dataset`,debug:U.value}),M.value.responsive){let e=ke(()=>{let{width:e,height:t}=Ae({chart:A.value,title:L.value.title.text?Gt.value:null,legend:L.value.legend.show?Kt.value:null,source:qt.value,noTitle:Jt.value});requestAnimationFrame(()=>{G.value.width=e,G.value.height=t,Hn()})});V.value&&(H.value&&V.value.unobserve(H.value),V.value.disconnect()),V.value=new ResizeObserver(e),H.value=A.value.parentNode,V.value.observe(H.value)}Hn()}qe(()=>{Qt.value=!0,pn()}),Ke(()=>{V.value&&(H.value&&V.value.unobserve(H.value),V.value.disconnect())});let{isPrinting:mn,isImaging:hn,generatePdf:gn,generateImage:_n}=Oe({elementId:`vue-ui-radar_${k.value}`,fileName:L.value.title.text||`vue-ui-radar`,options:M.value.userOptions.print}),vn=f(()=>M.value.userOptions.show&&!L.value.title.text),yn=f(()=>ue(M.value.customPalette)),W=S({dataLabels:{show:P.value.dataLabels.show},showTable:M.value.table.show,showTooltip:I.value.show}),bn=f(()=>({style:{backgroundColor:`#FFFFFF00`,animation:{show:I.value.animation.show,animationFrames:I.value.animation.animationFrames},labels:{fontSize:I.value.fontSize,name:{color:I.value.color}},gutter:{backgroundColor:`#CCCCCC`,opacity:30}}})),G=S({height:312,width:512}),xn=Qe,K=S([]),Sn=S(null),q=S(!1);function Cn(){K.value.length?K.value=[]:Z.value.forEach((e,t)=>{K.value.push(t)}),wn()}function wn(){xn(`selectLegend`,Z.value.filter((e,t)=>!K.value.includes(t)).map(e=>({name:e.name,color:e.color,proportion:e.totalProportion})))}function Tn(e){q.value=!0,K.value.includes(e)?(Sn.value=e,K.value=K.value.filter(t=>t!==e),setTimeout(()=>{q.value=!1,Sn.value=null},500)):(K.value.push(e),setTimeout(()=>{q.value=!1},500)),wn()}function En(){return Z.value.map(e=>({name:e.name,color:e.color,proportion:e.totalProportion}))}function Dn(){let e=z.value;[null,void 0].includes(e?.categories)?(u({componentName:`VueUiRadar`,type:`dataset`,debug:U.value}),u({componentName:`VueUiRadar`,type:`datasetAttribute`,property:`categories ({ name: string; prefix?: string; suffix?: string}[])`,debug:U.value})):(e.categories.length===0?u({componentName:`VueUiRadar`,type:`datasetAttributeEmpty`,property:`categories`,debug:U.value}):U.value&&e.categories.forEach((e,t)=>{de({datasetObject:e,requiredAttributes:[`name`]}).forEach(e=>{u({componentName:`VueUiRadar`,type:`datasetAttribute`,property:`category.${e} at index ${t}`,index:t})})}),[null,void 0].includes(e?.series)?u({componentName:`VueUiRadar`,type:`datasetAttribute`,property:`series ({ name: string; values: number[]; color?: string; target: number}[])`,debug:U.value}):U.value&&e.series.forEach((e,t)=>{de({datasetObject:e,requiredAttributes:[`name`,`values`,`target`]}).forEach(e=>{u({componentName:`VueUiRadar`,type:`datasetSerieAttribute`,key:`series`,property:e,index:t})})}))}Ze(()=>z.value,()=>Dn(),{deep:!0,immediate:!0});let J=f(()=>{let e=Array.isArray(z.value?.categories)?z.value.categories:[],t=yn.value??a;return e.map((e,n)=>({name:e?.name??``,categoryId:`radar_category_${k.value}_${n}`,color:l(e?.color)||t[n]||a[n%a.length],prefix:e?.prefix??``,suffix:e?.suffix??``}))}),Y=f(()=>z.value.series.map((e,t)=>({...e,color:l(e.color)||yn.value[t]||a[t]||a[t%a.length],serieId:`radar_serie_${k.value}_${t}`,formatter:e.formatter||null,absoluteIndex:t})));function On(e){return Y.value.length?Z.value.find(t=>t.name===e)||(U.value&&console.warn(`VueUiRadar - Series name not found "${e}"`),null):(U.value&&console.warn(`VueUiRadar - There are no series to show.`),null)}function kn(e){let t=On(e);t!==null&&K.value.includes(t.absoluteIndex)&&Tn(t.absoluteIndex)}function An(e){let t=On(e);t!==null&&(K.value.includes(t.absoluteIndex)||Tn(t.absoluteIndex))}let jn=f(()=>Math.max(0,...Y.value.flatMap(e=>e.values)));function Mn(e){return F.value.scaleToAxisMax?Math.max(1,e.target||0,...e.values):e.target||jn.value||1}let Nn=f(()=>Y.value.map((e,t)=>{let n=Rn.value.coordinates[t];return Un({centerX:G.value.width/2,centerY:G.value.height/2,apexX:n.x,apexY:n.y,proportion:(e.target||0)/Mn(e)})})),Pn=f(()=>Y.value.length),Fn=f(()=>Math.min(G.value.width,G.value.height)/3),In=f(()=>{let e=Number(F.value.plots.radius??0);return Math.max(Number.isFinite(e)?e*2.5:0,10)}),Ln=f(()=>{let e=Number(F.value.grid.rotation??0);return Number.isFinite(e)?e*Math.PI/180:0}),Rn=f(()=>c({plot:{x:G.value.width/2,y:G.value.height/2},radius:Fn.value,sides:Pn.value,rotation:Ln.value})),zn=f(()=>{let e=[];for(let t=0;t<Fn.value;t+=Fn.value/F.value.grid.graduations)e.push(t);return e}),X=f(()=>Rn.value.coordinates.map((e,t)=>{let n=Y.value[t],r=Y.value[t].values.map(t=>Un({centerX:G.value.width/2,centerY:G.value.height/2,apexX:e.x,apexY:e.y,proportion:t/Mn(n)}));return{...e,...n,plots:r}}).map(e=>({...e,labelX:Bn(e).x,labelY:Bn(e).y,labelAnchor:Bn(e).anchor})));function Bn({x:e,y:t}){let n=G.value.width/2,r=G.value.height/2,i=e-n,a=t-r,o=Math.hypot(i,a),s=Number(P.value.dataLabels.offset??0),c=20+(Number.isFinite(s)?s:0);if(!o)return{x:e,y:t,anchor:`middle`};let l=i/o,ee=a/o,te=`middle`;return l>.01?te=`start`:l<-.01&&(te=`end`),{x:e+l*c,y:t+ee*c,anchor:te}}let Vn=f({get:()=>P.value.dataLabels.fontSize,set:e=>e}),{autoSizeLabels:Hn}=Le({svgRef:B,fontSize:P.value.dataLabels.fontSize,minFontSize:6,sizeRef:Vn,labelClass:`.vue-ui-radar-apex-label`});function Un({centerX:e,centerY:t,apexX:n,apexY:r,proportion:i}){return{x:e+(n-e)*i,y:t+(r-t)*i}}let Z=f(()=>{let e=Y.value.map((e,t)=>e.values.map(t=>t/(e.target||jn.value)));return J.value.map((t,r)=>{let i=re(e.map(e=>e[r]).reduce((e,t)=>e+t,0)/Y.value.length);return{...t,absoluteIndex:r,totalProportion:i,shape:`circle`,opacity:K.value.includes(r)?.5:1,segregate:()=>Tn(r),isSegregated:K.value.includes(r),display:`${t.name}: ${n({v:(i??0)*100,s:`%`,r:L.value.legend.roundingPercentage})}`}})}),Wn=f(()=>({cy:`radar-div-legend`,backgroundColor:L.value.legend.backgroundColor,color:L.value.legend.color,fontSize:L.value.legend.fontSize,paddingBottom:12,fontWeight:L.value.legend.bold?`bold`:``})),Q=f(()=>{let e=[{name:M.value.translations.datapoint,color:``},{name:M.value.translations.target,color:``},...Z.value];return{head:e,body:z.value.series.map(e=>[e.name,ie(e.formatter,e.target,n({p:e.prefix,v:e.target,s:e.suffix,r:M.value.table.td.roundingValue})),...e.values.map((t,r)=>`${ie(e.formatter,t,n({p:J.value[r]?.prefix??``,v:t,s:J.value[r]?.suffix??``,r:M.value.table.td.roundingValue}))} (${isNaN(t/e.target)?``:n({v:t/e.target*100,s:`%`,r:M.value.table.td.roundingPercentage})})`)]),config:{th:{backgroundColor:M.value.table.th.backgroundColor,color:M.value.table.th.color,outline:M.value.table.th.outline},td:{backgroundColor:M.value.table.td.backgroundColor,color:M.value.table.td.color,outline:M.value.table.td.outline},breakpoint:M.value.table.responsiveBreakpoint},colNames:e}}),Gn=S(null),Kn=S([]),qn=S(null);function Jn(e,t){Ht.value=!1,Gn.value=null,j.value=null,nn.value=`pointer`,M.value.events.datapointLeave&&M.value.events.datapointLeave({datapoint:e,seriesIndex:t})}function Yn(e,t){M.value.events.datapointClick&&M.value.events.datapointClick({datapoint:e,seriesIndex:t})}function Xn(e,t,r=`pointer`){M.value.events.datapointEnter&&M.value.events.datapointEnter({datapoint:e,seriesIndex:t}),nn.value=r,j.value=t;let a=J.value.slice();Kn.value=[],Gn.value=t,Ht.value=!0,qn.value={datapoint:e,seriesIndex:t,series:{categories:a,datapoints:Y.value,radar:X.value},config:M.value};let o=I.value.customFormat;if(i(o)&&ce(()=>o({seriesIndex:t,datapoint:e,series:{categories:a,datapoints:Y.value,radar:X.value},config:M.value})))Ut.value=o({seriesIndex:t,datapoint:e,series:{categories:a,datapoints:Y.value,radar:X.value},config:M.value});else{Ut.value=`<div style="width:100%;text-align:center;border-bottom:1px solid ${I.value.borderColor};padding-bottom:6px;margin-bottom:3px;">${e.name}</div>`;for(let t=0;t<e.values.length;t+=1)if(!K.value.includes(t)){let r=a[t],i=e.values[t],o=isNaN(i/e.target)?0:i/e.target*100,s=ie(e.formatter,i,n({p:J.value[t].prefix,v:i,s:J.value[t].suffix,r:I.value.roundingValue}),{datapoint:e}),c=n({v:o,s:`%`,r:I.value.roundingPercentage}),l=I.value.showValue&&I.value.showPercentage?`${s} (${c})`:I.value.showValue&&!I.value.showPercentage?s:!I.value.showValue&&I.value.showPercentage?`${c}`:``;Kn.value.push({name:r?.name??`#${t+1}`,value:e.values[t]/e.target*100,color:r?.color,suffix:l,prefix:``,rounding:I.value.roundingPercentage,formatter:e.formatter})}}}function Zn(e=null){We(()=>{let t=[[L.value.title.text],[L.value.title.subtitle.text],[``]],n=[[``],[M.value.translations.target],...Z.value.flatMap(e=>[[e.name],[`%`]])],i=z.value.series.map((e,t)=>[e.name,e.target,...e.values.flatMap(t=>[t,isNaN(t/e.target)?``:t/e.target*100])]),a=t.concat([n]).concat(i),o=r(a);e?e(o):se({csvContent:o,title:L.value.title.text||`vue-ui-radar`})})}let $=S(!1);function Qn(e){$.value=e,Wt.value+=1}function $n(){W.value.showTable=!W.value.showTable}function er(){W.value.showTooltip=!W.value.showTooltip}let tr=S(!1);function nr(){tr.value=!tr.value}let rr=ye(A,()=>L.value.title.text),ir=f(()=>Ce({config:M,style:L,mutableConfig:W,dialog:Lt,accordion:Mt,isFullscreen:$,parent:A,maxWidth:800,isCursorPointer:R}));Ze(()=>W.value.showTable,e=>Se(e,M,$t));function ar(){W.value.showTable=!1,en.value&&en.value.setTableIconState(!1)}let or=f(()=>Z.value.map(e=>({...e,name:e.display}))),sr=f(()=>L.value.backgroundColor),cr=f(()=>L.value.legend),lr=f(()=>L.value.title),{isCallbackImaging:ur,isCallbackSvg:dr,generateSvg:fr,onGenerateImage:pr}=xe({svg:B,title:lr,legend:cr,legendItems:or,backgroundColor:sr,getSvgCallback:()=>M.value.userOptions.callbacks.svg,generateImage:_n});async function mr(){xn(`copyAlt`,{config:M.value,dataset:X.value}),M.value.userOptions.callbacks.altCopy?await Promise.resolve(M.value.userOptions.callbacks.altCopy({config:M.value,dataset:X.value})):console.warn("Vue Data UI - A callback must be set for `altCopy` in userOptions.")}function hr(){j.value=null,rn.value=!0}function gr(){j.value=null,nn.value=`pointer`,Ht.value=!1,Gn.value=null,rn.value=!1}function _r(e){if(!Number.isFinite(e)||!B.value)return;let t=X.value[e];if(!t)return;let n=B.value.getBoundingClientRect();tn.value={x:n.left+t.labelX/G.value.width*n.width,y:n.top+t.labelY/G.value.height*n.height}}function vr(e){if(!B.value||tr.value||document.activeElement!==B.value||!X.value.length)return;let t=[`ArrowLeft`,`ArrowUp`].includes(e.key),n=[`ArrowRight`,`ArrowDown`].includes(e.key),r=e.key===`Enter`||e.key===` `,i=e.key===`Escape`;if(!t&&!n&&!r&&!i)return;if(e.preventDefault(),e.stopPropagation(),i){j.value=null,nn.value=`pointer`,Ht.value=!1,Gn.value=null;return}if(r){if(j.value===null)return;let e=X.value[j.value];if(!e)return;Yn(e,j.value);return}let a=j.value;a===null||a<0||a>=X.value.length?a=n?0:X.value.length-1:n?(a+=1,a>=X.value.length&&(a=0)):t&&(--a,a<0&&(a=X.value.length-1));let o=X.value[a];o&&(j.value=a,_r(a),Xn(o,a,`keyboard`))}let yr=f(()=>({headers:Q.value?.colNames?.map(e=>e.name??e)??[],rows:Q.value?.body??[]}));return ge({getData:En,getImage:rr,generatePdf:gn,generateCsv:Zn,generateImage:_n,generateSvg:fr,hideSeries:An,showSeries:kn,toggleTable:$n,toggleTooltip:er,toggleAnnotator:nr,toggleFullscreen:Qn,copyAlt:mr}),(e,t)=>(x(),h(`div`,{class:Ge(`vue-data-ui-component vue-ui-radar ${$.value?`vue-data-ui-wrapper-fullscreen`:``} ${M.value.useCssAnimation?``:`vue-ui-dna`}`),ref_key:`radarChart`,ref:A,id:`vue-ui-radar_${k.value}`,style:b(`font-family:${M.value.style.fontFamily};width:100%; ${M.value.responsive?`height: 100%;`:``} text-align:center;background:${L.value.backgroundColor}`),onMouseenter:t[2]||=()=>E(cn)(!0),onMouseleave:t[3]||=()=>E(cn)(!1)},[g(`div`,{id:`chart-instructions-${k.value}`,class:`sr-only`},[g(`p`,null,T(M.value.a11y.translations.keyboardNavigation),1)],8,et),yr.value?.rows?.length?(x(),p(Ne,{key:0,uid:k.value,head:yr.value.headers,body:yr.value.rows,notice:M.value.a11y.translations.tableAvailable,caption:M.value.a11y.translations.tableCaption},null,8,[`uid`,`head`,`body`,`notice`,`caption`])):m(``,!0),N.value.buttons.annotator?(x(),p(E(Pt),{key:1,svgRef:E(B),backgroundColor:L.value.backgroundColor,color:L.value.color,active:tr.value,isCursorPointer:R.value,palette:N.value.annotatorPalette,onClose:nr},Be({_:2},[C(E(Te),t=>({name:t,fn:D(n=>[w(e.$slots,t,y(v(E(we)(t,n))),void 0,!0)])}))]),1032,[`svgRef`,`backgroundColor`,`color`,`active`,`isCursorPointer`,`palette`])):m(``,!0),vn.value?(x(),h(`div`,{key:2,ref_key:`noTitle`,ref:Jt,class:`vue-data-ui-no-title-space`,style:`height:36px; width: 100%;background:transparent`},null,512)):m(``,!0),L.value.title.text?(x(),h(`div`,{key:3,ref_key:`chartTitle`,ref:Gt,style:`width:100%;background:transparent;padding-bottom:12px`},[(x(),p(be,{key:`title_${Yt.value}`,config:{title:{cy:`radar-div-title`,...L.value.title},subtitle:{cy:`radar-div-subtitle`,...L.value.title.subtitle}}},null,8,[`config`]))],512)):m(``,!0),g(`div`,{id:`legend-top-${k.value}`},null,8,tt),N.value.show&&Vt.value&&(E(ln)||E(sn))?(x(),p(E(Ft),{ref_key:`userOptionsRef`,ref:en,key:`user_options_${Wt.value}`,backgroundColor:L.value.backgroundColor,color:L.value.color,isImaging:E(hn),isPrinting:E(mn),uid:k.value,hasTooltip:N.value.buttons.tooltip&&I.value.show,hasPdf:N.value.buttons.pdf,hasImg:N.value.buttons.img,hasSvg:N.value.buttons.svg,hasXls:N.value.buttons.csv,hasTable:N.value.buttons.table,hasFullscreen:N.value.buttons.fullscreen,hasAltCopy:N.value.buttons.altCopy,isFullscreen:$.value,isTooltip:W.value.showTooltip,titles:{...N.value.buttonTitles},chartElement:A.value,position:N.value.position,hasAnnotator:N.value.buttons.annotator,isAnnotation:tr.value,callbacks:N.value.callbacks,printScale:N.value.print.scale,tableDialog:M.value.table.useDialog,isCursorPointer:R.value,onToggleFullscreen:Qn,onGeneratePdf:E(gn),onGenerateCsv:Zn,onGenerateImage:E(pr),onGenerateSvg:E(fr),onToggleTable:$n,onToggleTooltip:er,onToggleAnnotator:nr,onCopyAlt:mr,style:b({visibility:E(ln)?E(sn)?`visible`:`hidden`:`visible`})},Be({_:2},[C(E(Ee)(e.$slots,`menuIcon optionTooltip optionPdf optionCsv optionImg optionSvg optionTable optionFullscreen optionAnnotator optionAltCopy custom-menu-before custom-menu-after`),t=>({name:t,fn:D(n=>[w(e.$slots,t,y(v(E(De)(t,n))),void 0,!0)])}))]),1032,/* @__PURE__ */ `backgroundColor.color.isImaging.isPrinting.uid.hasTooltip.hasPdf.hasImg.hasSvg.hasXls.hasTable.hasFullscreen.hasAltCopy.isFullscreen.isTooltip.titles.chartElement.position.hasAnnotator.isAnnotation.callbacks.printScale.tableDialog.isCursorPointer.onGeneratePdf.onGenerateImage.onGenerateSvg.style`.split(`.`))):m(``,!0),g(`div`,nt,[(x(),h(`svg`,{ref_key:`svgRef`,ref:B,xmlns:E(le),"aria-describedby":`chart-instructions-${k.value}`,class:Ge({"vue-data-ui-fullscreen--on":$.value,"vue-data-ui-fulscreen--off":!$.value}),viewBox:`0 0 ${G.value.width<=0?10:G.value.width} ${G.value.height<=0?10:G.value.height}`,style:b(`max-width:100%;overflow:visible;background:transparent;color:${L.value.color}`),tabindex:`0`,onFocus:hr,onBlur:gr,onKeydown:vr},[He(E(It)),w(e.$slots,`svg-underlayer`,{svg:{...G.value,outerPolygon:Rn.value,isPrintingImg:E(mn)||E(hn)||E(ur),isPrintingSvg:E(dr)}},void 0,!0),e.$slots[`chart-background`]?(x(),h(`foreignObject`,{key:0,x:0,y:0,width:G.value.width<=0?10:G.value.width,height:G.value.height<=0?10:G.value.height,style:{pointerEvents:`none`}},[w(e.$slots,`chart-background`,{},void 0,!0)],8,it)):m(``,!0),g(`defs`,null,[(x(!0),h(d,null,C(J.value,(e,t)=>(x(),p(je,{t:`radial`,cx:`50%`,cy:`50%`,r:`50%`,fx:`50%`,fy:`50%`,id:`radar_gradient_${k.value}_${t}`,key:`radar_gradient_${k.value}_${t}`,stops:[[`0%`,E(o)(E(te)(e.color,.05),F.value.dataPolygon.opacity),1],[`100%`,E(o)(e.color,F.value.dataPolygon.opacity),1]]},null,8,[`id`,`stops`]))),128))]),F.value.grid.show?(x(),h(`g`,at,[(x(!0),h(d,null,C(X.value,e=>(x(),h(`line`,{x1:G.value.width/2,y1:G.value.height/2,x2:e.x,y2:e.y,stroke:F.value.grid.stroke,"stroke-width":F.value.grid.strokeWidth,style:{"pointer-events":`none`}},null,8,ot))),256)),F.value.grid.graduations>0?(x(),h(`g`,st,[(x(!0),h(d,null,C(zn.value,e=>(x(),h(`path`,{d:E(c)({plot:{x:G.value.width/2,y:G.value.height/2},radius:e,sides:Pn.value,rotation:Ln.value}).path,fill:`none`,stroke:F.value.grid.stroke,"stroke-width":F.value.grid.strokeWidth},null,8,ct))),256))])):m(``,!0)])):m(``,!0),g(`path`,{d:Rn.value.path,fill:`none`,stroke:F.value.outerPolygon.stroke,"stroke-width":F.value.outerPolygon.strokeWidth,"stroke-linejoin":`round`,"stroke-linecap":`round`,style:{"pointer-events":`none`}},null,8,lt),P.value.dataLabels.show?(x(),h(`g`,ut,[(x(!0),h(d,null,C(X.value,(e,t)=>(x(),h(`text`,{class:`vue-ui-radar-apex-label`,x:e.labelX,y:e.labelY,"text-anchor":e.labelAnchor,"dominant-baseline":`middle`,"font-size":P.value.dataLabels.fontSize,fill:P.value.dataLabels.color,onMouseenter:n=>Xn(e,t,`pointer`),onMouseleave:n=>Jn(e,t),onClick:n=>Yn(e,t)},T(e.name),41,dt))),256))])):m(``,!0),(x(!0),h(d,null,C(J.value,(e,t)=>(x(),h(`g`,null,[g(`g`,null,[M.value.useCssAnimation||!M.value.useCssAnimation&&!K.value.includes(t)?(x(),h(`polygon`,{key:0,points:E(s)(X.value.map(e=>e.plots[t]),!1,!0),stroke:L.value.backgroundColor,"stroke-width":F.value.dataPolygon.strokeWidth+1,fill:`none`,class:Ge({"animated-out":K.value.includes(t)&&M.value.useCssAnimation,"animated-in":q.value&&Sn.value===t&&M.value.useCssAnimation}),style:{"pointer-events":`none`}},null,10,ft)):m(``,!0),M.value.useCssAnimation||!M.value.useCssAnimation&&!K.value.includes(t)?(x(),h(`polygon`,{key:1,points:E(s)(X.value.map(e=>e.plots[t]),!1,!0),stroke:e.color,"stroke-width":F.value.dataPolygon.strokeWidth,fill:F.value.dataPolygon.transparent?`transparent`:F.value.dataPolygon.useGradient?`url(#radar_gradient_${k.value}_${t})`:E(o)(e.color,F.value.dataPolygon.opacity),class:Ge({"animated-out":K.value.includes(t)&&M.value.useCssAnimation,"animated-in":q.value&&Sn.value===t&&M.value.useCssAnimation}),style:{"pointer-events":`none`}},null,10,pt)):m(``,!0)])]))),256)),F.value.targetReference.show?(x(),h(`path`,{key:3,class:`vue-ui-radar-target-polygon`,d:`M${E(s)(Nn.value,!1,!0)}Z`,fill:`none`,stroke:F.value.targetReference.stroke,"stroke-width":F.value.targetReference.strokeWidth,"stroke-linejoin":`round`,"stroke-linecap":`round`,"stroke-dasharray":F.value.targetReference.strokeDasharray,style:{"pointer-events":`none`}},null,8,mt)):m(``,!0),F.value.plots.show?(x(),h(`g`,ht,[(x(!0),h(d,null,C(X.value,(e,t)=>(x(),h(`g`,{key:`radar-category-${t}`},[(x(!0),h(d,null,C(e.plots,(n,r)=>(x(),h(`g`,{key:`radar-plot-${t}-${r}`,onMouseenter:n=>!K.value.includes(r)&&Xn(e,t,`pointer`),onMouseleave:n=>!K.value.includes(r)&&Jn(e,t),onClick:n=>!K.value.includes(r)&&Yn(e,t)},[g(`circle`,{cx:n.x,cy:n.y,r:In.value,fill:`transparent`,stroke:`transparent`,style:b({pointerEvents:K.value.includes(r)?`none`:`all`})},null,12,_t),g(`circle`,{cx:n.x,cy:n.y,fill:K.value.includes(r)?`transparent`:J.value[r]?J.value[r].color:`transparent`,r:Gn.value!==null&&Gn.value===t?F.value.plots.radius*1.6:F.value.plots.radius,stroke:K.value.includes(r)?`transparent`:L.value.backgroundColor,"stroke-width":.5,class:Ge({"animated-out":K.value.includes(r)&&M.value.useCssAnimation,"animated-in":q.value&&Sn.value===r&&M.value.useCssAnimation}),style:{"pointer-events":`none`}},null,10,vt)],40,gt))),128))]))),128))])):m(``,!0),w(e.$slots,`svg`,{svg:{...G.value,outerPolygon:Rn.value,isPrintingImg:E(mn)||E(hn)||E(ur),isPrintingSvg:E(dr)}},void 0,!0)],46,rt)),e.$slots.hint?(x(),h(`div`,yt,[w(e.$slots,`hint`,y(v({hint:M.value.a11y.translations.keyboardNavigation,isVisible:rn.value})),void 0,!0)])):m(``,!0)]),e.$slots.watermark?(x(),h(`div`,bt,[w(e.$slots,`watermark`,y(v({isPrinting:E(mn)||E(hn)||E(ur)||E(dr)})),void 0,!0)])):m(``,!0),g(`div`,{id:`legend-bottom-${k.value}`},null,8,xt),Qt.value&&(L.value.legend.show||e.$slots.legend)?(x(),p(ze,{key:6,to:L.value.legend.position===`top`?`#legend-top-${k.value}`:`#legend-bottom-${k.value}`},[g(`div`,{ref_key:`chartLegend`,ref:Kt},[w(e.$slots,`legend`,{legend:Z.value},()=>[L.value.legend.show?(x(),p(Ie,{key:`legend_${Zt.value}`,legendSet:Z.value,config:Wn.value,isCursorPointer:R.value,onClickMarker:t[0]||=({i:e})=>Tn(e)},Be({item:D(({legend:e,index:t})=>[E(on)?m(``,!0):(x(),h(`div`,{key:0,onClick:t=>e.segregate(),style:b(`opacity:${K.value.includes(t)?.5:1}`)},T(e.display),13,St))]),legendToggle:D(()=>[Z.value.length>2&&L.value.legend.selectAllToggle.show&&!E(on)?(x(),p(Me,{key:0,backgroundColor:L.value.legend.selectAllToggle.backgroundColor,color:L.value.legend.selectAllToggle.color,fontSize:L.value.legend.fontSize,checked:K.value.length>0,isCursorPointer:R.value,onToggle:Cn},null,8,[`backgroundColor`,`color`,`fontSize`,`checked`,`isCursorPointer`])):m(``,!0)]),_:2},[F.value.targetReference.show&&F.value.targetReference.showInLegend?{name:`after`,fn:D(()=>[g(`div`,Ct,[g(`div`,{style:b({display:`flex`,height:L.value.legend.fontSize})},[(x(),h(`svg`,{style:b({width:L.value.legend.fontSize*2}),viewBox:`0 0 16 8`},[g(`line`,{x1:`0`,x2:`16`,y1:`4`,y2:`4`,stroke:F.value.targetReference.stroke,"stroke-width":F.value.targetReference.strokeWidth*.7,"stroke-dasharray":F.value.targetReference.strokeDasharray*.7,"stroke-linecap":`round`},null,8,wt)],4))],4),g(`span`,null,T(F.value.targetReference.legendLabel),1)])]),key:`0`}:void 0]),1032,[`legendSet`,`config`,`isCursorPointer`])):m(``,!0)],!0)],512)],8,[`to`])):m(``,!0),e.$slots.source?(x(),h(`div`,{key:7,ref_key:`source`,ref:qt,dir:`auto`},[w(e.$slots,`source`,{},void 0,!0)],512)):m(``,!0),He(E(kt),{teleportTo:I.value.teleportTo,show:W.value.showTooltip&&Ht.value,backgroundColor:I.value.backgroundColor,color:I.value.color,borderRadius:I.value.borderRadius,borderColor:I.value.borderColor,borderWidth:I.value.borderWidth,backgroundOpacity:I.value.backgroundOpacity,fontSize:I.value.fontSize,position:I.value.position,offsetX:I.value.offsetX,offsetY:I.value.offsetY,parent:A.value,content:Ut.value,isFullscreen:$.value,isCustom:I.value.customFormat&&typeof I.value.customFormat==`function`,smooth:I.value.smooth,backdropFilter:I.value.backdropFilter,smoothForce:I.value.smoothForce,smoothSnapThreshold:I.value.smoothSnapThreshold,isA11yMode:nn.value===`keyboard`,a11yPosition:tn.value},{"tooltip-before":D(()=>[w(e.$slots,`tooltip-before`,y(v({...qn.value})),void 0,!0)]),tooltip:D(()=>[w(e.$slots,`tooltip`,y(v({...qn.value})),void 0,!0)]),"tooltip-after":D(()=>[![`function`].includes(typeof I.value.customFormat)&&!e.$slots.tooltip?(x(),h(`div`,Tt,[He(E(jt),{dataset:Kn.value,config:bn.value,backgroundOpacity:0},{"data-label":D(({bar:e})=>[g(`div`,Et,[g(`span`,Dt,T(e.name+(I.value.showValue||I.value.showPercentage?`:`:``)),1),I.value.showValue||I.value.showPercentage?(x(),h(`span`,Ot,T(e.suffix),1)):m(``,!0)])]),_:1},8,[`dataset`,`config`])])):m(``,!0),w(e.$slots,`tooltip-after`,y(v({...qn.value})),void 0,!0)]),_:3},8,[`teleportTo`,`show`,`backgroundColor`,`color`,`borderRadius`,`borderColor`,`borderWidth`,`backgroundOpacity`,`fontSize`,`position`,`offsetX`,`offsetY`,`parent`,`content`,`isFullscreen`,`isCustom`,`smooth`,`backdropFilter`,`smoothForce`,`smoothSnapThreshold`,`isA11yMode`,`a11yPosition`]),Vt.value&&N.value.buttons.table?(x(),p(Je(ir.value.component),Ue({key:8},ir.value.props,{ref_key:`tableUnit`,ref:$t,onClose:ar}),Be({content:D(()=>[(x(),p(E(Nt),{key:`table_${Xt.value}`,colNames:Q.value.colNames,head:Q.value.head,body:Q.value.body,config:Q.value.config,title:M.value.table.useDialog?``:ir.value.title,withCloseButton:!M.value.table.useDialog,isCursorPointer:R.value,onClose:ar},{th:D(({th:e})=>[Ve(T(e.name),1)]),td:D(({td:e})=>[Ve(T(e),1)]),_:1},8,[`colNames`,`head`,`body`,`config`,`title`,`withCloseButton`,`isCursorPointer`]))]),_:2},[M.value.table.useDialog?{name:`title`,fn:D(()=>[Ve(T(ir.value.title),1)]),key:`0`}:void 0,M.value.table.useDialog?{name:`actions`,fn:D(()=>[g(`button`,{tabindex:`0`,class:`vue-ui-user-options-button`,onClick:t[1]||=e=>Zn(N.value.callbacks.csv),style:b({cursor:R.value?`pointer`:`default`})},[He(E(At),{name:`fileCsv`,stroke:ir.value.props.color},null,8,[`stroke`])],4)]),key:`1`}:void 0]),1040)):m(``,!0),w(e.$slots,`skeleton`,{},()=>[E(on)?(x(),p(me,{key:0})):m(``,!0)],!0)],46,$e))}},[[`__scopeId`,`data-v-6406f550`]]);export{Qe as n,kt as t};
@@ -1 +1 @@
1
- import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{t}from"./useConfig-6jO1fkp5.js";import{$ as n,Ht as r,X as i,at as a,i as o,in as ee,r as te,rn as s,t as ne,w as re,yt as ie,zt as ae}from"./lib-rPeBMZrn.js";import{n as oe,t as se}from"./BaseScanner-8NdoBs7B.js";import{n as ce,t as le}from"./useHints-BH9r_0Vd.js";import{t as ue}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{n as de}from"./resolveChartConfig-CIhClE5R.js";import{t as fe}from"./img-D4RQwASc.js";import{n as pe}from"./Title-BliHuXfT.js";import{t as me}from"./useChartExport-BZts4KFb.js";import{n as he,t as ge}from"./annotationSlots-BRR85CqJ.js";import{n as _e,t as ve}from"./userOptionsSlots-DYuo-E5m.js";import{t as ye}from"./usePrinter-sVoTzet1.js";import{c as be}from"./canvas-lib-22VpOI4_.js";import{t as xe}from"./useResponsive-CENUxfEL.js";import{t as Se}from"./A11yDataTable-DWNlWXzs.js";import{t as Ce}from"./useUserOptionState-CXlFnwPv.js";import{t as we}from"./useChartAccessibility-DOMuYJfm.js";import{t as Te}from"./useAutoSizeLabelsInsideViewbox-AIRF0PlD.js";import{t as Ee}from"./vue_ui_relation_circle-Dkv-cSB6.js";import{Fragment as c,computed as l,createBlock as u,createCommentVNode as d,createElementBlock as f,createElementVNode as p,createSlots as De,createTextVNode as Oe,createVNode as ke,defineAsyncComponent as Ae,guardReactiveProps as m,mergeProps as je,normalizeClass as Me,normalizeProps as h,normalizeStyle as g,onBeforeUnmount as Ne,onMounted as Pe,openBlock as _,ref as v,renderList as y,renderSlot as b,shallowRef as Fe,toDisplayString as x,toRefs as Ie,unref as S,useCssVars as Le,watch as Re,withCtx as ze}from"vue";var Be=/* @__PURE__ */ e({default:()=>st}),Ve=[`id`],He=[`id`],Ue={style:{position:`relative`}},We=[`xmlns`,`viewBox`,`aria-describedby`],Ge=[`width`,`height`],Ke=[`cx`,`cy`,`r`,`stroke`,`stroke-width`],qe={key:1},Je=[`stroke`,`d`,`stroke-width`],Ye={style:{"pointer-events":`none`}},Xe=[`cx`,`cy`,`fill`,`r`,`stroke`],Ze=[`x`,`y`,`fill`,`font-size`],Qe={key:2},$e=[`stroke`,`stroke-width`,`x1`,`x2`,`y1`,`y2`],et={style:{"pointer-events":`none`}},tt=[`cx`,`cy`,`fill`,`r`,`stroke`],nt=[`x`,`y`,`fill`,`font-size`],rt=[`text-anchor`,`transform`,`x`,`y`,`font-weight`,`font-size`,`fill`,`text-decoration`,`onClick`,`onMouseenter`,`onMouseleave`],it=[`cx`,`cy`,`fill`,`stroke`,`r`,`onClick`,`onMouseenter`,`onMouseleave`],at={key:0,style:{position:`absolute`,top:`100%`,left:`0`,width:`100%`},"data-dom-to-png-ignore":``,"aria-hidden":`true`},ot={key:5,class:`vue-data-ui-watermark`},st=/*#__PURE__*/ ue({__name:`vue-ui-relation-circle`,props:{dataset:{type:Array,default(){return[]}},config:{type:Object,default(){return{}}}},emits:[`copyAlt`],setup(e,{expose:ue,emit:Be}){Le(e=>({v22fe13cb:Nt.value,v7f0fc82a:Mt.value,v6ece5e8c:Pt.value}));let st=Ae(()=>import(`./PenAndPaper-BGEp-TUm.js`).then(e=>e.t)),ct=Ae(()=>import(`./UserOptions-uWHV_zPB.js`).then(e=>e.n)),lt=Ae(()=>import(`./PackageVersion-C4ZM3Vf7.js`).then(e=>e.t)),{vue_ui_relation_circle:ut}=t(),C=e,dt=Be,ft=l(()=>!!C.dataset&&Object.keys(C.dataset).length),w=v(i()),pt=v(0),T=v(null),mt=v(null),ht=v(null),gt=v(null),_t=v(0),E=v(null),D=v(!1),O=v(Tt()),k=l(()=>O.value.userOptions),A=l(()=>O.value.style.weightLabels),j=l(()=>O.value.style);ce({config:()=>O.value,dataset:()=>C.dataset,component:`VueUiRelationCircle`,rules:[le.noHint]});let M=l(()=>O.value.userOptions.useCursorPointer),vt=l(()=>ee({defaultConfig:{userOptions:{show:!1},customPalette:Array(7).fill(`#CACACA`),style:{backgroundColor:`#99999930`,labels:{color:`#6A6A6A`},circle:{stroke:`#6A6A6A`},plot:{color:`#6A6A6A`,useSerieColor:!0},links:{maxWidth:2}}},userConfig:O.value.skeletonConfig??{}})),{loading:yt,FINAL_DATASET:bt,manualLoading:xt}=oe({...Ie(C),FINAL_CONFIG:O,prepareConfig:Tt,skeletonDataset:C.config?.skeletonDataset??[{id:`A`,label:`_`,relations:[`B`,`C`,`D`,`E`,`F`,`G`]},{id:`B`,label:`_`,relations:[`A`]},{id:`C`,label:`_`,relations:[`A`]},{id:`D`,label:`_`,relations:[`A`]},{id:`E`,label:`_`,relations:[`A`]},{id:`F`,label:`_`,relations:[`A`]},{id:`G`,label:`_`,relations:[`A`]}],skeletonConfig:ee({defaultConfig:O.value,userConfig:vt.value})}),{userOptionsVisible:St,setUserOptionsVisibility:Ct,keepUserOptionState:wt}=Ce({config:O.value}),{svgRef:N}=we({config:j.value.title});function Tt(){return de(C.config,ut,Ee)}Re(()=>C.config,e=>{O.value=Tt(),St.value=!O.value.userOptions.showOnChartHover,V.value=j.value.size,H.value=A.value.size,U.value=j.value.plot.radius,W.value=j.value.labels.fontSize,G.value.height=j.value.size,G.value.width=j.value.size,It(),_t.value+=1},{deep:!0}),Re(()=>C.dataset,e=>{Array.isArray(e)&&e.length>0&&(xt.value=!1)},{deep:!0});let{isPrinting:P,isImaging:F,generatePdf:Et,generateImage:Dt}=ye({elementId:`relation_circle_${w.value}`,fileName:j.value.title.text||`vue-ui-relation-circle`,options:O.value.userOptions.print}),Ot=l(()=>O.value.userOptions.show&&!j.value.title.text),kt=l(()=>re(O.value.customPalette)),I=v([]),L=v([]),R=v({}),z=v([]),At=v(0),B=l(()=>bt.value.slice(0,j.value.limit).map(e=>{let t=Array.isArray(e.relations)?e.relations:[];return{...e,weights:Array.isArray(e.weights)?e.weights:Array(t.length).fill(1),relations:t}}));Re(B,()=>{I.value=[],L.value=[],zt(),Vt()});let V=v(j.value.size),H=v(A.value.size),U=v(j.value.plot.radius),W=v(j.value.labels.fontSize),G=v({height:j.value.size,width:j.value.size}),K=l({get(){return V.value*j.value.circle.radiusProportion},set(e){return e}}),jt=l(()=>j.value.links.curved),Mt=l(()=>`${j.value.animation.speedMs}ms`),Nt=l(()=>K.value*2),Pt=l(()=>K.value*4),q=Fe(null),J=Fe(null);Pe(()=>{It(),document.getElementById(`relation_circle_${w.value}`).addEventListener(`click`,Rt)});let Ft=l(()=>O.value.debug);function It(){if(ae(C.dataset)?(a({componentName:`VueUiRelationCircle`,type:`dataset`,debug:Ft.value}),xt.value=!0):Ft.value&&C.dataset.forEach((e,t)=>{ie({datasetObject:e,requiredAttributes:[`id`,`label`,`relations`,`weights`]}).forEach(e=>{a({componentName:`VueUiRelationCircle`,type:`datasetSerieAttribute`,property:e,index:t})})}),ae(C.dataset)||(xt.value=O.value.loading),O.value.responsive){let e=be(()=>{let{width:e,height:t}=xe({chart:T.value,title:j.value.title.text?mt.value:null,source:ht.value,noTitle:gt.value});requestAnimationFrame(()=>{V.value=Math.min(e,t),G.value.width=Math.max(.1,e),G.value.height=Math.max(.1,t-12),K.value=V.value*j.value.circle.radiusProportion,I.value=[],L.value=[],zt(),Vt(),Lt(),O.value.responsiveProportionalSizing?(H.value=s({relator:V.value,adjuster:j.value.size,source:A.value.size,threshold:6,fallback:6}),U.value=s({relator:V.value,adjuster:j.value.size,source:j.value.plot.radius,threshold:1,fallback:1}),W.value=s({relator:V.value,adjuster:j.value.size,source:j.value.labels.fontSize,threshold:6,fallback:6})):(H.value=A.value.size,U.value=j.value.plot.radius,W.value=j.value.labels.fontSize)})});q.value&&(J.value&&q.value.unobserve(J.value),q.value.disconnect()),q.value=new ResizeObserver(e),J.value=T.value.parentNode,q.value.observe(J.value)}else I.value=[],L.value=[],zt(),Vt();Lt()}Ne(()=>{document.getElementById(`relation_circle_${w.value}`).removeEventListener(`click`,Rt),q.value&&(J.value&&q.value.unobserve(J.value),q.value.disconnect())});let{autoSizeLabels:Lt}=Te({svgRef:N,fontSize:j.value.labels.fontSize,minFontSize:j.value.labels.minFontSize,sizeRef:W,labelClass:`.vue-ui-relation-circle-legend`});function Rt(e){let t=e.target;t&&Array.from(t.classList).includes(`vue-ui-user-options`)||t&&Array.from(t.classList).includes(`vue-ui-user-options-summary`)||t&&Array.from(t.classList).includes(`vue-data-ui-button`)||t&&Array.from(t.classList).includes(`vue-ui-relation-circle-legend`)||(R.value={},z.value=[])}function zt(){let e=6.28319/B.value.length,t=360/B.value.length,n=0,i=0;B.value.forEach((a,o)=>{let ee=a.weights.reduce((e,t)=>e+t,0),te=K.value*Math.cos(n)+G.value.width/2,s=K.value*Math.sin(n)+G.value.height/2+j.value.circle.offsetY;I.value.push({x:te,y:s,...a,color:a.color?a.color:kt.value[o]?kt.value[o]:r[o],regAngle:i,totalWeight:ee}),n+=e,i+=t})}function Bt(e,t){return{x:(e.x+t.x)/2,y:(e.y+t.y)/2}}function Vt(){L.value=[],I.value.forEach(e=>{I.value.filter(t=>t.relations.includes(e.id)).forEach((t,n)=>{let r=t.relations.indexOf(e.id);L.value.push({weight:t.weights[r]?t.weights[r]:0,relationId:`${e.id}_${t.id}`,x1:e.x,y1:e.y,x2:t.x,y2:t.y,colorSource:e.color,colorTarget:t.color,midPointLine:Bt({x:e.x,y:e.y},{x:t.x,y:t.y}),midPointBezier:Ht({x1:e.x,x2:t.x,y1:e.y,y2:t.y}),...e})})})}function Ht(e){let t={x:e.x1,y:e.y1},n={x:e.x2,y:e.y2},r={x:e.x1,y:e.y1},i={x:G.value.width/2,y:G.value.height/2+j.value.circle.offsetY},a=.5;return{x:.5**3*t.x+3*.5**2*a*r.x+1.5*a**2*i.x+a**3*n.x,y:.5**3*t.y+3*.5**2*a*r.y+1.5*a**2*i.y+a**3*n.y}}let Ut=l(()=>Math.max(...L.value.map(e=>e.weight)));function Wt(e){return Object.hasOwn(R.value,`x`)?z.value.includes(e.id)?`opacity:1`:`opacity:0.1`:`opacity:1`}function Y(e){return e.colorSource}function Gt(e){return Object.hasOwn(R.value,`x`)?z.value.includes(e.id)&&e.relationId===`${e.id}_${R.value.id}`||e.relationId===`${R.value.id}_${e.id}`?`opacity:1;stroke-width:${en(e)}`:`opacity: 0`:`opacity: 1`}function X(e){return Object.hasOwn(R.value,`x`)?!!(z.value.includes(e.id)&&e.relationId===`${e.id}_${R.value.id}`||e.relationId===`${R.value.id}_${e.id}`):!1}function Kt(e){return e.regAngle>90&&e.regAngle<270?`end`:`start`}function qt(e){return e.regAngle>90&&e.regAngle<270?e.x-5:e.x+5}function Jt(e){return Object.hasOwn(R.value,`x`)?R.value.id===e.id||z.value.includes(e.id)?`opacity:1`:`opacity:0.2`:`opacity:1`}function Yt(e){return e.regAngle>90&&e.regAngle<270?`rotate(${e.regAngle+180},${e.x},${e.y})`:`rotate(${e.regAngle},${e.x},${e.y})`}let Z=v(null);function Xt(e,t){Z.value=t,E.value=t,O.value.events.datapointEnter&&O.value.events.datapointEnter({datapoint:e,seriesIndex:t})}function Zt(e,t){Z.value=null,D.value||(E.value=null),O.value.events.datapointLeave&&O.value.events.datapointLeave({datapoint:e,seriesIndex:t})}function Qt(e,t){e&&(O.value.events.datapointClick&&O.value.events.datapointClick({datapoint:e,seriesIndex:t}),At.value=360-e.regAngle,R.value.id&&e.id===R.value.id?(R.value={},z.value=[]):(R.value=e,z.value=[...e.relations]))}function $t(e,t){E.value=t,Qt(e,t)}function en(e){let t=e.weight/Ut.value*j.value.links.maxWidth;return Math.max(.3,t)}let Q=v(!1);function tn(e){Q.value=e,pt.value+=1}let $=v(!1);function nn(){$.value=!$.value}async function rn({scale:e=2}={}){if(!T.value)return;let{width:t,height:n}=T.value.getBoundingClientRect(),r=t/n,{imageUri:i,base64:a}=await fe({domElement:T.value,base64:!0,img:!0,scale:e});return{imageUri:i,base64:a,title:j.value.title.text,width:t,height:n,aspectRatio:r}}let an=l(()=>j.value.backgroundColor),on=l(()=>j.value.title),{isCallbackImaging:sn,isCallbackSvg:cn,generateSvg:ln,onGenerateImage:un}=me({svg:N,title:on,legend:null,legendItems:null,backgroundColor:an,getSvgCallback:()=>O.value.userOptions.callbacks.svg,generateImage:Dt});async function dn(){dt(`copyAlt`,{config:O.value,dataset:B.value}),O.value.userOptions.callbacks.altCopy?await Promise.resolve(O.value.userOptions.callbacks.altCopy({config:O.value,dataset:B.value})):console.warn("Vue Data UI - A callback must be set for `altCopy` in userOptions.")}function fn(){D.value=!0,I.value.length&&E.value===null&&(E.value=0)}function pn(){D.value=!1,E.value=null}function mn(e){if(!N.value||$.value||document.activeElement!==N.value||!I.value.length)return;let t=[`ArrowLeft`,`ArrowUp`].includes(e.key),n=[`ArrowRight`,`ArrowDown`].includes(e.key),r=e.key===`Enter`||e.key===` `,i=e.key===`Escape`;if(!t&&!n&&!r&&!i)return;if(e.preventDefault(),e.stopPropagation(),i){E.value=null,R.value={},z.value=[];return}if(r){if(E.value===null)return;let e=I.value[E.value];if(!e)return;Qt(e,E.value);return}let a=E.value;a===null||a<0||a>=I.value.length?a=n?0:I.value.length-1:n?(a+=1,a>=I.value.length&&(a=0)):t&&(--a,a<0&&(a=I.value.length-1)),E.value=a,Z.value=a;let o=I.value[a];o&&O.value.events.datapointEnter&&O.value.events.datapointEnter({datapoint:o,seriesIndex:a})}let hn=l(()=>({headers:[`ID`,`Label`,`Total weight`,`Relations count`,`Relations`],rows:B.value.map(e=>{let t=e.relations.map(e=>B.value.find(t=>t.id===e)?.label||e).join(`, `),n=(e.weights||[]).reduce((e,t)=>e+Number(t||0),0);return[e.id,e.label,n,e.relations.length,t]})}));return ue({getImage:rn,generatePdf:Et,generateSvg:ln,generateImage:Dt,toggleAnnotator:nn,toggleFullscreen:tn,copyAlt:dn}),(e,t)=>(_(),f(`div`,{ref_key:`relationCircleChart`,ref:T,class:`vue-data-ui-component vue-ui-relation-circle`,style:g(`width:100%;background:${j.value.backgroundColor};text-align:center;${O.value.responsive?`height: 100%`:``}`),id:`relation_circle_${w.value}`,onMouseenter:t[0]||=()=>S(Ct)(!0),onMouseleave:t[1]||=()=>S(Ct)(!1)},[p(`div`,{id:`chart-instructions-${w.value}`,class:`sr-only`},[p(`p`,null,x(O.value.a11y.translations.keyboardNavigation),1)],8,He),hn.value?.rows?.length?(_(),u(Se,{key:0,uid:w.value,head:hn.value.headers,body:hn.value.rows,notice:O.value.a11y.translations.tableAvailable,caption:O.value.a11y.translations.tableCaption},null,8,[`uid`,`head`,`body`,`notice`,`caption`])):d(``,!0),k.value.buttons.annotator?(_(),u(S(st),{key:1,svgRef:S(N),backgroundColor:j.value.backgroundColor,color:j.value.color,active:$.value,isCursorPointer:M.value,palette:k.value.annotatorPalette,onClose:nn},De({_:2},[y(S(ge),t=>({name:t,fn:ze(n=>[b(e.$slots,t,h(m(S(he)(t,n))),void 0,!0)])}))]),1032,[`svgRef`,`backgroundColor`,`color`,`active`,`isCursorPointer`,`palette`])):d(``,!0),Ot.value?(_(),f(`div`,{key:2,ref_key:`noTitle`,ref:gt,class:`vue-data-ui-no-title-space`,style:`height:36px; width: 100%;background:transparent`},null,512)):d(``,!0),j.value.title.text?(_(),f(`div`,{key:3,ref_key:`chartTitle`,ref:mt,style:`width:100%;background:transparent`},[(_(),u(pe,{key:`title_${_t.value}`,config:{title:{cy:`relation-div-title`,...j.value.title},subtitle:{cy:`relation-div-subtitle`,...j.value.title.subtitle}}},null,8,[`config`]))],512)):d(``,!0),k.value.show&&ft.value&&(S(wt)||S(St))?(_(),u(S(ct),{ref:`details`,key:`user_options_${pt.value}`,backgroundColor:j.value.backgroundColor,color:j.value.color,isPrinting:S(P),isImaging:S(F),uid:w.value,hasPdf:k.value.buttons.pdf,hasImg:k.value.buttons.img,hasSvg:k.value.buttons.svg,hasFullscreen:k.value.buttons.fullscreen,hasAltCopy:k.value.buttons.altCopy,hasXls:!1,isFullscreen:Q.value,titles:{...k.value.buttonTitles},chartElement:T.value,position:k.value.position,hasAnnotator:k.value.buttons.annotator,isAnnotation:$.value,callbacks:k.value.callbacks,printScale:k.value.print.scale,isCursorPointer:M.value,onToggleFullscreen:tn,onGeneratePdf:S(Et),onGenerateImage:S(un),onGenerateSvg:S(ln),onToggleAnnotator:nn,onCopyAlt:dn,style:g({visibility:S(wt)?S(St)?`visible`:`hidden`:`visible`})},De({_:2},[y(S(_e)(e.$slots,`menuIcon optionPdf optionImg optionSvg optionFullscreen optionAnnotator optionAltCopy custom-menu-before custom-menu-after`),t=>({name:t,fn:ze(n=>[b(e.$slots,t,h(m(S(ve)(t,n))),void 0,!0)])}))]),1032,[`backgroundColor`,`color`,`isPrinting`,`isImaging`,`uid`,`hasPdf`,`hasImg`,`hasSvg`,`hasFullscreen`,`hasAltCopy`,`isFullscreen`,`titles`,`chartElement`,`position`,`hasAnnotator`,`isAnnotation`,`callbacks`,`printScale`,`isCursorPointer`,`onGeneratePdf`,`onGenerateImage`,`onGenerateSvg`,`style`])):d(``,!0),p(`div`,Ue,[(_(),f(`svg`,{ref_key:`svgRef`,ref:N,xmlns:S(ne),class:Me([{"vue-data-ui-fullscreen--on":Q.value,"vue-data-ui-fulscreen--off":!Q.value},`relation-circle`]),viewBox:`0 0 ${G.value.width<=0?10:G.value.width} ${G.value.height<=0?10:G.value.height}`,width:`100%`,style:`user-select:none; background:transparent`,"aria-describedby":`chart-instructions-${w.value}`,tabindex:`0`,onFocus:fn,onBlur:pn,onKeydown:mn},[ke(S(lt)),b(e.$slots,`svg-underlayer`,{svg:{...G.value,isPrintingImg:S(P)||S(F)||S(sn),isPrintingSvg:S(cn)}},void 0,!0),e.$slots[`chart-background`]?(_(),f(`foreignObject`,{key:0,x:0,y:0,width:G.value.width<=0?10:G.value.width,height:G.value.height<=0?10:G.value.height,style:{pointerEvents:`none`}},[b(e.$slots,`chart-background`,{},void 0,!0)],8,Ge)):d(``,!0),p(`circle`,{cx:(G.value.width<=0?1e-4:G.value.width)/2,cy:(G.value.height<=0?1e-4:G.value.height)/2+j.value.circle.offsetY,r:K.value<=0?1e-4:K.value,stroke:j.value.circle.stroke,"stroke-width":j.value.circle.strokeWidth,fill:`transparent`,class:`main-circle`},null,8,Ke),jt.value?(_(),f(`g`,qe,[(_(!0),f(c,null,y(L.value,(e,t)=>(_(),f(`path`,{key:`relation_${t}`,style:g(Gt(e)),stroke:Y(e),class:Me([`relation`,{"vue-ui-relation-circle-selected":R.value.hasOwnProperty(`id`)&&z.value.includes(e.id)}]),d:`M${e.x1},${e.y1} C${e.x1},${e.y1} ${G.value.width/2},${G.value.height/2+j.value.circle.offsetY} ${e.x2},${e.y2}`,fill:`none`,"stroke-width":en(e),"stroke-linecap":`round`},null,14,Je))),128)),(_(!0),f(c,null,y(L.value,(t,r)=>(_(),f(`g`,Ye,[X(t)?b(e.$slots,`dataLabel`,je({ref_for:!0},{x:t.midPointBezier.x,y:t.midPointBezier.y,color:Y(t),weight:t.weight,fontSize:H.value}),void 0,!0,0):d(``,!0),X(t)&&!e.$slots.dataLabel?(_(),f(`circle`,{key:1,cx:t.midPointBezier.x,cy:t.midPointBezier.y,fill:Y(t),r:H.value,stroke:j.value.backgroundColor,"stroke-width":`1`},null,8,Xe)):d(``,!0),X(t)&&!e.$slots.dataLabel?(_(),f(`text`,{key:2,x:t.midPointBezier.x,y:t.midPointBezier.y+H.value/3,fill:S(te)(Y(t)),"text-anchor":`middle`,"font-size":H.value},x(S(o)(A.value.formatter,t.weight,S(n)({p:A.value.prefix,v:t.weight,s:A.value.suffix,r:A.value.rounding}),{...t})),9,Ze)):d(``,!0)]))),256))])):(_(),f(`g`,Qe,[(_(!0),f(c,null,y(L.value,(e,t)=>(_(),f(`line`,{key:`relation_${t}`,stroke:Y(e),"stroke-width":en(e),style:g(Gt(e)),x1:e.x1,x2:e.x2,y1:e.y1,y2:e.y2,class:Me({"vue-ui-relation-circle-selected":R.value.hasOwnProperty(`id`)&&z.value.includes(e.id)}),"stroke-linecap":`round`},null,14,$e))),128)),(_(!0),f(c,null,y(L.value,(t,r)=>(_(),f(`g`,et,[X(t)?b(e.$slots,`dataLabel`,je({ref_for:!0},{x:t.midPointLine.x,y:t.midPointLine.y,color:Y(t),weight:t.weight,fontSize:H.value}),void 0,!0,0):d(``,!0),X(t)&&!e.$slots.dataLabel&&A.value.show?(_(),f(`circle`,{key:1,cx:t.midPointLine.x,cy:t.midPointLine.y,fill:Y(t),r:H.value,stroke:j.value.backgroundColor,"stroke-width":`1`},null,8,tt)):d(``,!0),X(t)&&!e.$slots.dataLabel&&A.value.show?(_(),f(`text`,{key:2,x:t.midPointLine.x,y:t.midPointLine.y+H.value/3,fill:S(te)(Y(t)),"text-anchor":`middle`,"font-size":H.value},x(S(o)(A.value.formatter,t.weight,S(n)({p:A.value.prefix,v:t.weight,s:A.value.suffix,r:A.value.rounding}),{...t})),9,nt)):d(``,!0)]))),256))])),(_(!0),f(c,null,y(I.value,(e,t)=>(_(),f(`text`,{key:`plot_text_${t}`,"text-anchor":Kt(e),transform:Yt(e),x:qt(e),y:e.y+5,class:`vue-ui-relation-circle-legend`,"transform-origin":`start`,"font-weight":R.value.id===e.id?`900`:`400`,style:g(`font-family:${j.value.fontFamily};${Jt(e)};cursor:${M.value?`pointer`:`default`}`),"font-size":W.value,fill:j.value.labels.color,"text-decoration":t===Z.value||t===E.value?`underline`:void 0,onClick:n=>$t(e,t),onMouseenter:n=>Xt(e,t),onMouseleave:n=>Zt(e,t)},[S(yt)?(_(),f(c,{key:0},[Oe(`--------`)],64)):(_(),f(c,{key:1},[Oe(x(e.label)+` (`+x(S(o)(A.value.formatter,e.totalWeight,S(n)({p:A.value.prefix,v:e.totalWeight,s:A.value.suffix,r:A.value.rounding}),{...e}))+`) `,1)],64))],44,rt))),128)),(_(!0),f(c,null,y(I.value,(e,t)=>(_(),f(`circle`,{cx:e.x,cy:e.y,key:`plot_${t}`,style:g(`${Wt(e)}; transition: r 0.2s ease-in-out; cursor:${M.value?`pointer`:`default`}`),class:`vue-ui-relation-circle-plot`,fill:j.value.plot.useSerieColor?e.color:j.value.plot.color,stroke:j.value.backgroundColor,"stroke-width":`1`,r:U.value*(t===Z.value||t===E.value?2:1),onClick:n=>$t(e,t),onMouseenter:n=>Xt(e,t),onMouseleave:n=>Zt(e,t)},null,44,it))),128)),b(e.$slots,`svg`,{svg:{...G.value,isPrintingImg:S(P)||S(F)||S(sn),isPrintingSvg:S(cn)}},void 0,!0)],42,We)),e.$slots.hint?(_(),f(`div`,at,[b(e.$slots,`hint`,h(m({hint:O.value.a11y.translations.keyboardNavigation,isVisible:D.value})),void 0,!0)])):d(``,!0)]),e.$slots.watermark?(_(),f(`div`,ot,[b(e.$slots,`watermark`,h(m({isPrinting:S(P)||S(F)||S(sn)||S(cn)})),void 0,!0)])):d(``,!0),e.$slots.source?(_(),f(`div`,{key:6,ref_key:`source`,ref:ht,dir:`auto`},[b(e.$slots,`source`,{},void 0,!0)],512)):d(``,!0),b(e.$slots,`skeleton`,{},()=>[S(yt)?(_(),u(se,{key:0})):d(``,!0)],!0)],44,Ve))}},[[`__scopeId`,`data-v-64ac9170`]]);export{Be as n,st as t};
1
+ import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{t}from"./useConfig-6jO1fkp5.js";import{$ as n,Ht as r,X as i,at as a,i as o,in as ee,r as te,rn as s,t as ne,w as re,yt as ie,zt as ae}from"./lib-rPeBMZrn.js";import{n as oe,t as se}from"./BaseScanner-8NdoBs7B.js";import{n as ce,t as le}from"./useHints-BH9r_0Vd.js";import{t as ue}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{n as de}from"./resolveChartConfig-CIhClE5R.js";import{t as fe}from"./img-D4RQwASc.js";import{n as pe}from"./Title-BliHuXfT.js";import{t as me}from"./useChartExport-BZts4KFb.js";import{n as he,t as ge}from"./annotationSlots-BRR85CqJ.js";import{n as _e,t as ve}from"./userOptionsSlots-DYuo-E5m.js";import{t as ye}from"./usePrinter-sVoTzet1.js";import{c as be}from"./canvas-lib-22VpOI4_.js";import{t as xe}from"./useResponsive-CENUxfEL.js";import{t as Se}from"./A11yDataTable-DWNlWXzs.js";import{t as Ce}from"./useUserOptionState-CXlFnwPv.js";import{t as we}from"./useChartAccessibility-DOMuYJfm.js";import{t as Te}from"./useAutoSizeLabelsInsideViewbox-AIRF0PlD.js";import{t as Ee}from"./vue_ui_relation_circle-Dkv-cSB6.js";import{Fragment as c,computed as l,createBlock as u,createCommentVNode as d,createElementBlock as f,createElementVNode as p,createSlots as De,createTextVNode as Oe,createVNode as ke,defineAsyncComponent as Ae,guardReactiveProps as m,mergeProps as je,normalizeClass as Me,normalizeProps as h,normalizeStyle as g,onBeforeUnmount as Ne,onMounted as Pe,openBlock as _,ref as v,renderList as y,renderSlot as b,shallowRef as Fe,toDisplayString as x,toRefs as Ie,unref as S,useCssVars as Le,watch as Re,withCtx as ze}from"vue";var Be=/* @__PURE__ */ e({default:()=>st}),Ve=[`id`],He=[`id`],Ue={style:{position:`relative`}},We=[`xmlns`,`viewBox`,`aria-describedby`],Ge=[`width`,`height`],Ke=[`cx`,`cy`,`r`,`stroke`,`stroke-width`],qe={key:1},Je=[`stroke`,`d`,`stroke-width`],Ye={style:{"pointer-events":`none`}},Xe=[`cx`,`cy`,`fill`,`r`,`stroke`],Ze=[`x`,`y`,`fill`,`font-size`],Qe={key:2},$e=[`stroke`,`stroke-width`,`x1`,`x2`,`y1`,`y2`],et={style:{"pointer-events":`none`}},tt=[`cx`,`cy`,`fill`,`r`,`stroke`],nt=[`x`,`y`,`fill`,`font-size`],rt=[`text-anchor`,`transform`,`x`,`y`,`font-weight`,`font-size`,`fill`,`text-decoration`,`onClick`,`onMouseenter`,`onMouseleave`],it=[`cx`,`cy`,`fill`,`stroke`,`r`,`onClick`,`onMouseenter`,`onMouseleave`],at={key:0,style:{position:`absolute`,top:`100%`,left:`0`,width:`100%`},"data-dom-to-png-ignore":``,"aria-hidden":`true`},ot={key:5,class:`vue-data-ui-watermark`},st=/*#__PURE__*/ ue({__name:`vue-ui-relation-circle`,props:{dataset:{type:Array,default(){return[]}},config:{type:Object,default(){return{}}}},emits:[`copyAlt`],setup(e,{expose:ue,emit:Be}){Le(e=>({v22fe13cb:Nt.value,v7f0fc82a:Mt.value,v6ece5e8c:Pt.value}));let st=Ae(()=>import(`./PenAndPaper-BGEp-TUm.js`).then(e=>e.t)),ct=Ae(()=>import(`./UserOptions-uWHV_zPB.js`).then(e=>e.n)),lt=Ae(()=>import(`./PackageVersion-BIhjLNBU.js`).then(e=>e.t)),{vue_ui_relation_circle:ut}=t(),C=e,dt=Be,ft=l(()=>!!C.dataset&&Object.keys(C.dataset).length),w=v(i()),pt=v(0),T=v(null),mt=v(null),ht=v(null),gt=v(null),_t=v(0),E=v(null),D=v(!1),O=v(Tt()),k=l(()=>O.value.userOptions),A=l(()=>O.value.style.weightLabels),j=l(()=>O.value.style);ce({config:()=>O.value,dataset:()=>C.dataset,component:`VueUiRelationCircle`,rules:[le.noHint]});let M=l(()=>O.value.userOptions.useCursorPointer),vt=l(()=>ee({defaultConfig:{userOptions:{show:!1},customPalette:Array(7).fill(`#CACACA`),style:{backgroundColor:`#99999930`,labels:{color:`#6A6A6A`},circle:{stroke:`#6A6A6A`},plot:{color:`#6A6A6A`,useSerieColor:!0},links:{maxWidth:2}}},userConfig:O.value.skeletonConfig??{}})),{loading:yt,FINAL_DATASET:bt,manualLoading:xt}=oe({...Ie(C),FINAL_CONFIG:O,prepareConfig:Tt,skeletonDataset:C.config?.skeletonDataset??[{id:`A`,label:`_`,relations:[`B`,`C`,`D`,`E`,`F`,`G`]},{id:`B`,label:`_`,relations:[`A`]},{id:`C`,label:`_`,relations:[`A`]},{id:`D`,label:`_`,relations:[`A`]},{id:`E`,label:`_`,relations:[`A`]},{id:`F`,label:`_`,relations:[`A`]},{id:`G`,label:`_`,relations:[`A`]}],skeletonConfig:ee({defaultConfig:O.value,userConfig:vt.value})}),{userOptionsVisible:St,setUserOptionsVisibility:Ct,keepUserOptionState:wt}=Ce({config:O.value}),{svgRef:N}=we({config:j.value.title});function Tt(){return de(C.config,ut,Ee)}Re(()=>C.config,e=>{O.value=Tt(),St.value=!O.value.userOptions.showOnChartHover,V.value=j.value.size,H.value=A.value.size,U.value=j.value.plot.radius,W.value=j.value.labels.fontSize,G.value.height=j.value.size,G.value.width=j.value.size,It(),_t.value+=1},{deep:!0}),Re(()=>C.dataset,e=>{Array.isArray(e)&&e.length>0&&(xt.value=!1)},{deep:!0});let{isPrinting:P,isImaging:F,generatePdf:Et,generateImage:Dt}=ye({elementId:`relation_circle_${w.value}`,fileName:j.value.title.text||`vue-ui-relation-circle`,options:O.value.userOptions.print}),Ot=l(()=>O.value.userOptions.show&&!j.value.title.text),kt=l(()=>re(O.value.customPalette)),I=v([]),L=v([]),R=v({}),z=v([]),At=v(0),B=l(()=>bt.value.slice(0,j.value.limit).map(e=>{let t=Array.isArray(e.relations)?e.relations:[];return{...e,weights:Array.isArray(e.weights)?e.weights:Array(t.length).fill(1),relations:t}}));Re(B,()=>{I.value=[],L.value=[],zt(),Vt()});let V=v(j.value.size),H=v(A.value.size),U=v(j.value.plot.radius),W=v(j.value.labels.fontSize),G=v({height:j.value.size,width:j.value.size}),K=l({get(){return V.value*j.value.circle.radiusProportion},set(e){return e}}),jt=l(()=>j.value.links.curved),Mt=l(()=>`${j.value.animation.speedMs}ms`),Nt=l(()=>K.value*2),Pt=l(()=>K.value*4),q=Fe(null),J=Fe(null);Pe(()=>{It(),document.getElementById(`relation_circle_${w.value}`).addEventListener(`click`,Rt)});let Ft=l(()=>O.value.debug);function It(){if(ae(C.dataset)?(a({componentName:`VueUiRelationCircle`,type:`dataset`,debug:Ft.value}),xt.value=!0):Ft.value&&C.dataset.forEach((e,t)=>{ie({datasetObject:e,requiredAttributes:[`id`,`label`,`relations`,`weights`]}).forEach(e=>{a({componentName:`VueUiRelationCircle`,type:`datasetSerieAttribute`,property:e,index:t})})}),ae(C.dataset)||(xt.value=O.value.loading),O.value.responsive){let e=be(()=>{let{width:e,height:t}=xe({chart:T.value,title:j.value.title.text?mt.value:null,source:ht.value,noTitle:gt.value});requestAnimationFrame(()=>{V.value=Math.min(e,t),G.value.width=Math.max(.1,e),G.value.height=Math.max(.1,t-12),K.value=V.value*j.value.circle.radiusProportion,I.value=[],L.value=[],zt(),Vt(),Lt(),O.value.responsiveProportionalSizing?(H.value=s({relator:V.value,adjuster:j.value.size,source:A.value.size,threshold:6,fallback:6}),U.value=s({relator:V.value,adjuster:j.value.size,source:j.value.plot.radius,threshold:1,fallback:1}),W.value=s({relator:V.value,adjuster:j.value.size,source:j.value.labels.fontSize,threshold:6,fallback:6})):(H.value=A.value.size,U.value=j.value.plot.radius,W.value=j.value.labels.fontSize)})});q.value&&(J.value&&q.value.unobserve(J.value),q.value.disconnect()),q.value=new ResizeObserver(e),J.value=T.value.parentNode,q.value.observe(J.value)}else I.value=[],L.value=[],zt(),Vt();Lt()}Ne(()=>{document.getElementById(`relation_circle_${w.value}`).removeEventListener(`click`,Rt),q.value&&(J.value&&q.value.unobserve(J.value),q.value.disconnect())});let{autoSizeLabels:Lt}=Te({svgRef:N,fontSize:j.value.labels.fontSize,minFontSize:j.value.labels.minFontSize,sizeRef:W,labelClass:`.vue-ui-relation-circle-legend`});function Rt(e){let t=e.target;t&&Array.from(t.classList).includes(`vue-ui-user-options`)||t&&Array.from(t.classList).includes(`vue-ui-user-options-summary`)||t&&Array.from(t.classList).includes(`vue-data-ui-button`)||t&&Array.from(t.classList).includes(`vue-ui-relation-circle-legend`)||(R.value={},z.value=[])}function zt(){let e=6.28319/B.value.length,t=360/B.value.length,n=0,i=0;B.value.forEach((a,o)=>{let ee=a.weights.reduce((e,t)=>e+t,0),te=K.value*Math.cos(n)+G.value.width/2,s=K.value*Math.sin(n)+G.value.height/2+j.value.circle.offsetY;I.value.push({x:te,y:s,...a,color:a.color?a.color:kt.value[o]?kt.value[o]:r[o],regAngle:i,totalWeight:ee}),n+=e,i+=t})}function Bt(e,t){return{x:(e.x+t.x)/2,y:(e.y+t.y)/2}}function Vt(){L.value=[],I.value.forEach(e=>{I.value.filter(t=>t.relations.includes(e.id)).forEach((t,n)=>{let r=t.relations.indexOf(e.id);L.value.push({weight:t.weights[r]?t.weights[r]:0,relationId:`${e.id}_${t.id}`,x1:e.x,y1:e.y,x2:t.x,y2:t.y,colorSource:e.color,colorTarget:t.color,midPointLine:Bt({x:e.x,y:e.y},{x:t.x,y:t.y}),midPointBezier:Ht({x1:e.x,x2:t.x,y1:e.y,y2:t.y}),...e})})})}function Ht(e){let t={x:e.x1,y:e.y1},n={x:e.x2,y:e.y2},r={x:e.x1,y:e.y1},i={x:G.value.width/2,y:G.value.height/2+j.value.circle.offsetY},a=.5;return{x:.5**3*t.x+3*.5**2*a*r.x+1.5*a**2*i.x+a**3*n.x,y:.5**3*t.y+3*.5**2*a*r.y+1.5*a**2*i.y+a**3*n.y}}let Ut=l(()=>Math.max(...L.value.map(e=>e.weight)));function Wt(e){return Object.hasOwn(R.value,`x`)?z.value.includes(e.id)?`opacity:1`:`opacity:0.1`:`opacity:1`}function Y(e){return e.colorSource}function Gt(e){return Object.hasOwn(R.value,`x`)?z.value.includes(e.id)&&e.relationId===`${e.id}_${R.value.id}`||e.relationId===`${R.value.id}_${e.id}`?`opacity:1;stroke-width:${en(e)}`:`opacity: 0`:`opacity: 1`}function X(e){return Object.hasOwn(R.value,`x`)?!!(z.value.includes(e.id)&&e.relationId===`${e.id}_${R.value.id}`||e.relationId===`${R.value.id}_${e.id}`):!1}function Kt(e){return e.regAngle>90&&e.regAngle<270?`end`:`start`}function qt(e){return e.regAngle>90&&e.regAngle<270?e.x-5:e.x+5}function Jt(e){return Object.hasOwn(R.value,`x`)?R.value.id===e.id||z.value.includes(e.id)?`opacity:1`:`opacity:0.2`:`opacity:1`}function Yt(e){return e.regAngle>90&&e.regAngle<270?`rotate(${e.regAngle+180},${e.x},${e.y})`:`rotate(${e.regAngle},${e.x},${e.y})`}let Z=v(null);function Xt(e,t){Z.value=t,E.value=t,O.value.events.datapointEnter&&O.value.events.datapointEnter({datapoint:e,seriesIndex:t})}function Zt(e,t){Z.value=null,D.value||(E.value=null),O.value.events.datapointLeave&&O.value.events.datapointLeave({datapoint:e,seriesIndex:t})}function Qt(e,t){e&&(O.value.events.datapointClick&&O.value.events.datapointClick({datapoint:e,seriesIndex:t}),At.value=360-e.regAngle,R.value.id&&e.id===R.value.id?(R.value={},z.value=[]):(R.value=e,z.value=[...e.relations]))}function $t(e,t){E.value=t,Qt(e,t)}function en(e){let t=e.weight/Ut.value*j.value.links.maxWidth;return Math.max(.3,t)}let Q=v(!1);function tn(e){Q.value=e,pt.value+=1}let $=v(!1);function nn(){$.value=!$.value}async function rn({scale:e=2}={}){if(!T.value)return;let{width:t,height:n}=T.value.getBoundingClientRect(),r=t/n,{imageUri:i,base64:a}=await fe({domElement:T.value,base64:!0,img:!0,scale:e});return{imageUri:i,base64:a,title:j.value.title.text,width:t,height:n,aspectRatio:r}}let an=l(()=>j.value.backgroundColor),on=l(()=>j.value.title),{isCallbackImaging:sn,isCallbackSvg:cn,generateSvg:ln,onGenerateImage:un}=me({svg:N,title:on,legend:null,legendItems:null,backgroundColor:an,getSvgCallback:()=>O.value.userOptions.callbacks.svg,generateImage:Dt});async function dn(){dt(`copyAlt`,{config:O.value,dataset:B.value}),O.value.userOptions.callbacks.altCopy?await Promise.resolve(O.value.userOptions.callbacks.altCopy({config:O.value,dataset:B.value})):console.warn("Vue Data UI - A callback must be set for `altCopy` in userOptions.")}function fn(){D.value=!0,I.value.length&&E.value===null&&(E.value=0)}function pn(){D.value=!1,E.value=null}function mn(e){if(!N.value||$.value||document.activeElement!==N.value||!I.value.length)return;let t=[`ArrowLeft`,`ArrowUp`].includes(e.key),n=[`ArrowRight`,`ArrowDown`].includes(e.key),r=e.key===`Enter`||e.key===` `,i=e.key===`Escape`;if(!t&&!n&&!r&&!i)return;if(e.preventDefault(),e.stopPropagation(),i){E.value=null,R.value={},z.value=[];return}if(r){if(E.value===null)return;let e=I.value[E.value];if(!e)return;Qt(e,E.value);return}let a=E.value;a===null||a<0||a>=I.value.length?a=n?0:I.value.length-1:n?(a+=1,a>=I.value.length&&(a=0)):t&&(--a,a<0&&(a=I.value.length-1)),E.value=a,Z.value=a;let o=I.value[a];o&&O.value.events.datapointEnter&&O.value.events.datapointEnter({datapoint:o,seriesIndex:a})}let hn=l(()=>({headers:[`ID`,`Label`,`Total weight`,`Relations count`,`Relations`],rows:B.value.map(e=>{let t=e.relations.map(e=>B.value.find(t=>t.id===e)?.label||e).join(`, `),n=(e.weights||[]).reduce((e,t)=>e+Number(t||0),0);return[e.id,e.label,n,e.relations.length,t]})}));return ue({getImage:rn,generatePdf:Et,generateSvg:ln,generateImage:Dt,toggleAnnotator:nn,toggleFullscreen:tn,copyAlt:dn}),(e,t)=>(_(),f(`div`,{ref_key:`relationCircleChart`,ref:T,class:`vue-data-ui-component vue-ui-relation-circle`,style:g(`width:100%;background:${j.value.backgroundColor};text-align:center;${O.value.responsive?`height: 100%`:``}`),id:`relation_circle_${w.value}`,onMouseenter:t[0]||=()=>S(Ct)(!0),onMouseleave:t[1]||=()=>S(Ct)(!1)},[p(`div`,{id:`chart-instructions-${w.value}`,class:`sr-only`},[p(`p`,null,x(O.value.a11y.translations.keyboardNavigation),1)],8,He),hn.value?.rows?.length?(_(),u(Se,{key:0,uid:w.value,head:hn.value.headers,body:hn.value.rows,notice:O.value.a11y.translations.tableAvailable,caption:O.value.a11y.translations.tableCaption},null,8,[`uid`,`head`,`body`,`notice`,`caption`])):d(``,!0),k.value.buttons.annotator?(_(),u(S(st),{key:1,svgRef:S(N),backgroundColor:j.value.backgroundColor,color:j.value.color,active:$.value,isCursorPointer:M.value,palette:k.value.annotatorPalette,onClose:nn},De({_:2},[y(S(ge),t=>({name:t,fn:ze(n=>[b(e.$slots,t,h(m(S(he)(t,n))),void 0,!0)])}))]),1032,[`svgRef`,`backgroundColor`,`color`,`active`,`isCursorPointer`,`palette`])):d(``,!0),Ot.value?(_(),f(`div`,{key:2,ref_key:`noTitle`,ref:gt,class:`vue-data-ui-no-title-space`,style:`height:36px; width: 100%;background:transparent`},null,512)):d(``,!0),j.value.title.text?(_(),f(`div`,{key:3,ref_key:`chartTitle`,ref:mt,style:`width:100%;background:transparent`},[(_(),u(pe,{key:`title_${_t.value}`,config:{title:{cy:`relation-div-title`,...j.value.title},subtitle:{cy:`relation-div-subtitle`,...j.value.title.subtitle}}},null,8,[`config`]))],512)):d(``,!0),k.value.show&&ft.value&&(S(wt)||S(St))?(_(),u(S(ct),{ref:`details`,key:`user_options_${pt.value}`,backgroundColor:j.value.backgroundColor,color:j.value.color,isPrinting:S(P),isImaging:S(F),uid:w.value,hasPdf:k.value.buttons.pdf,hasImg:k.value.buttons.img,hasSvg:k.value.buttons.svg,hasFullscreen:k.value.buttons.fullscreen,hasAltCopy:k.value.buttons.altCopy,hasXls:!1,isFullscreen:Q.value,titles:{...k.value.buttonTitles},chartElement:T.value,position:k.value.position,hasAnnotator:k.value.buttons.annotator,isAnnotation:$.value,callbacks:k.value.callbacks,printScale:k.value.print.scale,isCursorPointer:M.value,onToggleFullscreen:tn,onGeneratePdf:S(Et),onGenerateImage:S(un),onGenerateSvg:S(ln),onToggleAnnotator:nn,onCopyAlt:dn,style:g({visibility:S(wt)?S(St)?`visible`:`hidden`:`visible`})},De({_:2},[y(S(_e)(e.$slots,`menuIcon optionPdf optionImg optionSvg optionFullscreen optionAnnotator optionAltCopy custom-menu-before custom-menu-after`),t=>({name:t,fn:ze(n=>[b(e.$slots,t,h(m(S(ve)(t,n))),void 0,!0)])}))]),1032,[`backgroundColor`,`color`,`isPrinting`,`isImaging`,`uid`,`hasPdf`,`hasImg`,`hasSvg`,`hasFullscreen`,`hasAltCopy`,`isFullscreen`,`titles`,`chartElement`,`position`,`hasAnnotator`,`isAnnotation`,`callbacks`,`printScale`,`isCursorPointer`,`onGeneratePdf`,`onGenerateImage`,`onGenerateSvg`,`style`])):d(``,!0),p(`div`,Ue,[(_(),f(`svg`,{ref_key:`svgRef`,ref:N,xmlns:S(ne),class:Me([{"vue-data-ui-fullscreen--on":Q.value,"vue-data-ui-fulscreen--off":!Q.value},`relation-circle`]),viewBox:`0 0 ${G.value.width<=0?10:G.value.width} ${G.value.height<=0?10:G.value.height}`,width:`100%`,style:`user-select:none; background:transparent`,"aria-describedby":`chart-instructions-${w.value}`,tabindex:`0`,onFocus:fn,onBlur:pn,onKeydown:mn},[ke(S(lt)),b(e.$slots,`svg-underlayer`,{svg:{...G.value,isPrintingImg:S(P)||S(F)||S(sn),isPrintingSvg:S(cn)}},void 0,!0),e.$slots[`chart-background`]?(_(),f(`foreignObject`,{key:0,x:0,y:0,width:G.value.width<=0?10:G.value.width,height:G.value.height<=0?10:G.value.height,style:{pointerEvents:`none`}},[b(e.$slots,`chart-background`,{},void 0,!0)],8,Ge)):d(``,!0),p(`circle`,{cx:(G.value.width<=0?1e-4:G.value.width)/2,cy:(G.value.height<=0?1e-4:G.value.height)/2+j.value.circle.offsetY,r:K.value<=0?1e-4:K.value,stroke:j.value.circle.stroke,"stroke-width":j.value.circle.strokeWidth,fill:`transparent`,class:`main-circle`},null,8,Ke),jt.value?(_(),f(`g`,qe,[(_(!0),f(c,null,y(L.value,(e,t)=>(_(),f(`path`,{key:`relation_${t}`,style:g(Gt(e)),stroke:Y(e),class:Me([`relation`,{"vue-ui-relation-circle-selected":R.value.hasOwnProperty(`id`)&&z.value.includes(e.id)}]),d:`M${e.x1},${e.y1} C${e.x1},${e.y1} ${G.value.width/2},${G.value.height/2+j.value.circle.offsetY} ${e.x2},${e.y2}`,fill:`none`,"stroke-width":en(e),"stroke-linecap":`round`},null,14,Je))),128)),(_(!0),f(c,null,y(L.value,(t,r)=>(_(),f(`g`,Ye,[X(t)?b(e.$slots,`dataLabel`,je({ref_for:!0},{x:t.midPointBezier.x,y:t.midPointBezier.y,color:Y(t),weight:t.weight,fontSize:H.value}),void 0,!0,0):d(``,!0),X(t)&&!e.$slots.dataLabel?(_(),f(`circle`,{key:1,cx:t.midPointBezier.x,cy:t.midPointBezier.y,fill:Y(t),r:H.value,stroke:j.value.backgroundColor,"stroke-width":`1`},null,8,Xe)):d(``,!0),X(t)&&!e.$slots.dataLabel?(_(),f(`text`,{key:2,x:t.midPointBezier.x,y:t.midPointBezier.y+H.value/3,fill:S(te)(Y(t)),"text-anchor":`middle`,"font-size":H.value},x(S(o)(A.value.formatter,t.weight,S(n)({p:A.value.prefix,v:t.weight,s:A.value.suffix,r:A.value.rounding}),{...t})),9,Ze)):d(``,!0)]))),256))])):(_(),f(`g`,Qe,[(_(!0),f(c,null,y(L.value,(e,t)=>(_(),f(`line`,{key:`relation_${t}`,stroke:Y(e),"stroke-width":en(e),style:g(Gt(e)),x1:e.x1,x2:e.x2,y1:e.y1,y2:e.y2,class:Me({"vue-ui-relation-circle-selected":R.value.hasOwnProperty(`id`)&&z.value.includes(e.id)}),"stroke-linecap":`round`},null,14,$e))),128)),(_(!0),f(c,null,y(L.value,(t,r)=>(_(),f(`g`,et,[X(t)?b(e.$slots,`dataLabel`,je({ref_for:!0},{x:t.midPointLine.x,y:t.midPointLine.y,color:Y(t),weight:t.weight,fontSize:H.value}),void 0,!0,0):d(``,!0),X(t)&&!e.$slots.dataLabel&&A.value.show?(_(),f(`circle`,{key:1,cx:t.midPointLine.x,cy:t.midPointLine.y,fill:Y(t),r:H.value,stroke:j.value.backgroundColor,"stroke-width":`1`},null,8,tt)):d(``,!0),X(t)&&!e.$slots.dataLabel&&A.value.show?(_(),f(`text`,{key:2,x:t.midPointLine.x,y:t.midPointLine.y+H.value/3,fill:S(te)(Y(t)),"text-anchor":`middle`,"font-size":H.value},x(S(o)(A.value.formatter,t.weight,S(n)({p:A.value.prefix,v:t.weight,s:A.value.suffix,r:A.value.rounding}),{...t})),9,nt)):d(``,!0)]))),256))])),(_(!0),f(c,null,y(I.value,(e,t)=>(_(),f(`text`,{key:`plot_text_${t}`,"text-anchor":Kt(e),transform:Yt(e),x:qt(e),y:e.y+5,class:`vue-ui-relation-circle-legend`,"transform-origin":`start`,"font-weight":R.value.id===e.id?`900`:`400`,style:g(`font-family:${j.value.fontFamily};${Jt(e)};cursor:${M.value?`pointer`:`default`}`),"font-size":W.value,fill:j.value.labels.color,"text-decoration":t===Z.value||t===E.value?`underline`:void 0,onClick:n=>$t(e,t),onMouseenter:n=>Xt(e,t),onMouseleave:n=>Zt(e,t)},[S(yt)?(_(),f(c,{key:0},[Oe(`--------`)],64)):(_(),f(c,{key:1},[Oe(x(e.label)+` (`+x(S(o)(A.value.formatter,e.totalWeight,S(n)({p:A.value.prefix,v:e.totalWeight,s:A.value.suffix,r:A.value.rounding}),{...e}))+`) `,1)],64))],44,rt))),128)),(_(!0),f(c,null,y(I.value,(e,t)=>(_(),f(`circle`,{cx:e.x,cy:e.y,key:`plot_${t}`,style:g(`${Wt(e)}; transition: r 0.2s ease-in-out; cursor:${M.value?`pointer`:`default`}`),class:`vue-ui-relation-circle-plot`,fill:j.value.plot.useSerieColor?e.color:j.value.plot.color,stroke:j.value.backgroundColor,"stroke-width":`1`,r:U.value*(t===Z.value||t===E.value?2:1),onClick:n=>$t(e,t),onMouseenter:n=>Xt(e,t),onMouseleave:n=>Zt(e,t)},null,44,it))),128)),b(e.$slots,`svg`,{svg:{...G.value,isPrintingImg:S(P)||S(F)||S(sn),isPrintingSvg:S(cn)}},void 0,!0)],42,We)),e.$slots.hint?(_(),f(`div`,at,[b(e.$slots,`hint`,h(m({hint:O.value.a11y.translations.keyboardNavigation,isVisible:D.value})),void 0,!0)])):d(``,!0)]),e.$slots.watermark?(_(),f(`div`,ot,[b(e.$slots,`watermark`,h(m({isPrinting:S(P)||S(F)||S(sn)||S(cn)})),void 0,!0)])):d(``,!0),e.$slots.source?(_(),f(`div`,{key:6,ref_key:`source`,ref:ht,dir:`auto`},[b(e.$slots,`source`,{},void 0,!0)],512)):d(``,!0),b(e.$slots,`skeleton`,{},()=>[S(yt)?(_(),u(se,{key:0})):d(``,!0)],!0)],44,Ve))}},[[`__scopeId`,`data-v-64ac9170`]]);export{Be as n,st as t};