vue-data-ui 3.28.8 → 3.28.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{PackageVersion-Bczw6rsP.js → PackageVersion-DKSNC-YP.js} +1 -1
- package/dist/StackChartTable-CZteRybF.js +1 -0
- package/dist/UserOptions-B9EyfU9n.js +1 -0
- package/dist/{XyAnalysisOptions-U4UJx51x.js → XyAnalysisOptions-CV22ga_a.js} +1 -1
- package/dist/components/vue-ui-3d-bar.js +1 -1
- package/dist/components/vue-ui-accordion.js +1 -1
- package/dist/components/vue-ui-age-pyramid.js +1 -1
- package/dist/components/vue-ui-annotator.js +1 -1
- package/dist/components/vue-ui-bullet.js +1 -1
- package/dist/components/vue-ui-bump.js +1 -1
- package/dist/components/vue-ui-candlestick.js +1 -1
- package/dist/components/vue-ui-carousel-table.js +1 -1
- package/dist/components/vue-ui-chestnut.js +1 -1
- package/dist/components/vue-ui-chord.js +1 -1
- package/dist/components/vue-ui-circle-pack.js +1 -1
- package/dist/components/vue-ui-cursor.js +1 -1
- package/dist/components/vue-ui-dag.js +1 -1
- package/dist/components/vue-ui-dashboard.js +1 -1
- package/dist/components/vue-ui-digits.js +1 -1
- package/dist/components/vue-ui-donut-evolution.js +1 -1
- package/dist/components/vue-ui-donut.js +1 -1
- package/dist/components/vue-ui-dumbbell.js +1 -1
- package/dist/components/vue-ui-flow.js +1 -1
- package/dist/components/vue-ui-funnel.js +1 -1
- package/dist/components/vue-ui-galaxy.js +1 -1
- package/dist/components/vue-ui-gauge.js +1 -1
- package/dist/components/vue-ui-geo.js +1 -1
- package/dist/components/vue-ui-gizmo.js +1 -1
- package/dist/components/vue-ui-graph.js +1 -1
- package/dist/components/vue-ui-heatmap.js +1 -1
- package/dist/components/vue-ui-hill.js +1 -1
- package/dist/components/vue-ui-history-plot.js +1 -1
- package/dist/components/vue-ui-horizontal-bar.js +1 -1
- package/dist/components/vue-ui-kpi.js +1 -1
- package/dist/components/vue-ui-label.js +1 -1
- package/dist/components/vue-ui-mini-loader.js +1 -1
- package/dist/components/vue-ui-molecule.js +1 -1
- package/dist/components/vue-ui-mood-radar.js +1 -1
- package/dist/components/vue-ui-nested-donuts.js +1 -1
- package/dist/components/vue-ui-onion.js +1 -1
- package/dist/components/vue-ui-parallel-coordinate-plot.js +1 -1
- package/dist/components/vue-ui-quadrant.js +1 -1
- package/dist/components/vue-ui-quick-chart.js +1 -1
- package/dist/components/vue-ui-radar.js +1 -1
- package/dist/components/vue-ui-rating.js +1 -1
- package/dist/components/vue-ui-relation-circle.js +1 -1
- package/dist/components/vue-ui-ridgeline.js +1 -1
- package/dist/components/vue-ui-rings.js +1 -1
- package/dist/components/vue-ui-scatter.js +1 -1
- package/dist/components/vue-ui-skeleton.js +1 -1
- package/dist/components/vue-ui-smiley.js +1 -1
- package/dist/components/vue-ui-spark-trend.js +1 -1
- package/dist/components/vue-ui-sparkbar.js +1 -1
- package/dist/components/vue-ui-sparkgauge.js +1 -1
- package/dist/components/vue-ui-sparkhistogram.js +1 -1
- package/dist/components/vue-ui-sparkline.js +1 -1
- package/dist/components/vue-ui-sparkstackbar.js +1 -1
- package/dist/components/vue-ui-stackbar.js +1 -1
- package/dist/components/vue-ui-stackline.js +1 -1
- package/dist/components/vue-ui-strip-plot.js +1 -1
- package/dist/components/vue-ui-table-heatmap.js +1 -1
- package/dist/components/vue-ui-table-sparkline.js +1 -1
- package/dist/components/vue-ui-table.js +1 -1
- package/dist/components/vue-ui-thermometer.js +1 -1
- package/dist/components/vue-ui-timer.js +1 -1
- package/dist/components/vue-ui-tiremarks.js +1 -1
- package/dist/components/vue-ui-treemap.js +1 -1
- package/dist/components/vue-ui-vertical-bar.js +1 -1
- package/dist/components/vue-ui-waffle.js +1 -1
- package/dist/components/vue-ui-wheel.js +1 -1
- package/dist/components/vue-ui-word-cloud.js +1 -1
- package/dist/components/vue-ui-world.js +1 -1
- package/dist/components/vue-ui-xy-canvas.js +1 -1
- package/dist/components/vue-ui-xy.js +1 -1
- package/dist/package-CXaebsLV.js +1 -0
- package/dist/{render-common-DY4sNXDz.js → render-common-Cy1X2PzP.js} +1 -1
- package/dist/ssr/vue-ui-donut.js +1 -1
- package/dist/ssr/vue-ui-xy.js +1 -1
- package/dist/ssr.js +1 -1
- package/dist/style.css +1 -1
- package/dist/{useConfig-By3Vb5kz.js → useConfig-C3FbHv4N.js} +1 -1
- package/dist/{useObjectBindings-0vvvimYP.js → useObjectBindings-C_70Czuj.js} +1 -1
- package/dist/{userOptionsSlots-DYuo-E5m.js → userOptionsSlots-CWtXN5Q6.js} +1 -1
- package/dist/utils.js +1 -1
- package/dist/vue-data-ui-O-w339Ac.js +1 -0
- package/dist/vue-data-ui.js +1 -1
- package/dist/vue-ui-3d-bar-CcFFARyq.js +19 -0
- package/dist/{vue-ui-accordion-DFxSW8ET.js → vue-ui-accordion-E8TJfFeK.js} +1 -1
- package/dist/vue-ui-age-pyramid-Di6fKV6f.js +1 -0
- package/dist/vue-ui-annotator-sBGtsgcb.js +331 -0
- package/dist/vue-ui-bullet-BZLa1xj7.js +34 -0
- package/dist/vue-ui-bump-BSdpAH0l.js +8 -0
- package/dist/vue-ui-candlestick-BKZASgq9.js +22 -0
- package/dist/vue-ui-carousel-table-B20E2K8A.js +1 -0
- package/dist/vue-ui-chestnut-DavvzmiQ.js +1 -0
- package/dist/vue-ui-chord-D2Hn54i7.js +21 -0
- package/dist/vue-ui-circle-pack-BKaS-zWo.js +13 -0
- package/dist/{vue-ui-cursor-DRQc_V2R.js → vue-ui-cursor-BUOHKNmb.js} +1 -1
- package/dist/vue-ui-dag-SLYPxbGo.js +9 -0
- package/dist/vue-ui-dashboard-Bgt7VLv0.js +1 -0
- package/dist/{vue-ui-digits-CfdB0vaP.js → vue-ui-digits-DbxT72mM.js} +1 -1
- package/dist/{vue-ui-donut-Dy4j7B9b.js → vue-ui-donut-8ZWyXEVs.js} +1 -1
- package/dist/vue-ui-donut-DBcB8Ym1.js +47 -0
- package/dist/vue-ui-donut-evolution-D3lo74Ce.js +2 -0
- package/dist/vue-ui-dumbbell-CdarkL8Z.js +9 -0
- package/dist/vue-ui-flow-B0dYxGWT.js +3 -0
- package/dist/vue-ui-funnel-C0Cl9jMd.js +1 -0
- package/dist/vue-ui-galaxy-C_UWOQn4.js +1 -0
- package/dist/vue-ui-gauge-B94ToHlW.js +1 -0
- package/dist/vue-ui-geo-V-JmJgKS.js +1 -0
- package/dist/{vue-ui-gizmo-D0QjzIGt.js → vue-ui-gizmo-BvVDEnNu.js} +1 -1
- package/dist/{vue-ui-graph-DScVnTzu.js → vue-ui-graph-9YSKwYhC.js} +1 -1
- package/dist/vue-ui-heatmap-DWtbocz5.js +1 -0
- package/dist/vue-ui-hill-BH_lYm5G.js +1 -0
- package/dist/vue-ui-history-plot-DkWvta0h.js +2 -0
- package/dist/vue-ui-horizontal-bar-DbJ1DFjG.js +4 -0
- package/dist/{vue-ui-kpi-CF7pAl08.js → vue-ui-kpi-BxW6DctE.js} +1 -1
- package/dist/{vue-ui-label-W0oz08pp.js → vue-ui-label-rxuzmeyD.js} +1 -1
- package/dist/{vue-ui-mini-loader-OLYDdN3T.js → vue-ui-mini-loader-DpAYrTYb.js} +1 -1
- package/dist/vue-ui-molecule-BrG8K2Tm.js +1 -0
- package/dist/vue-ui-mood-radar-DEpFpfiW.js +1 -0
- package/dist/vue-ui-nested-donuts-CZetOzaq.js +19 -0
- package/dist/vue-ui-onion-DvyAxUSj.js +5 -0
- package/dist/vue-ui-parallel-coordinate-plot-Bdakcv3w.js +9 -0
- package/dist/vue-ui-quadrant-CWZeQjHE.js +2 -0
- package/dist/vue-ui-quick-chart-BULxPrPs.js +16 -0
- package/dist/vue-ui-radar-CJ_5G0QP.js +1 -0
- package/dist/{vue-ui-rating-B9HeTCLa.js → vue-ui-rating-QcJoab0i.js} +1 -1
- package/dist/vue-ui-relation-circle-Vetly6f0.js +1 -0
- package/dist/vue-ui-ridgeline-5a87TiQf.js +2 -0
- package/dist/vue-ui-rings-CKuFf5vA.js +1 -0
- package/dist/vue-ui-scatter-C2hNg3ED.js +9 -0
- package/dist/{vue-ui-skeleton-an0peDis.js → vue-ui-skeleton-SlYTmirP.js} +1 -1
- package/dist/{vue-ui-smiley-Cht1imV-.js → vue-ui-smiley-DZVFOGfv.js} +1 -1
- package/dist/{vue-ui-spark-trend-DCP7blHB.js → vue-ui-spark-trend-D155vscB.js} +1 -1
- package/dist/{vue-ui-sparkbar-DT3sDgda.js → vue-ui-sparkbar-DFShNanl.js} +1 -1
- package/dist/{vue-ui-sparkgauge-AQt2L5dI.js → vue-ui-sparkgauge-CFj0wLj5.js} +1 -1
- package/dist/{vue-ui-sparkhistogram-a_jc2Dv2.js → vue-ui-sparkhistogram-DwDcqqEj.js} +1 -1
- package/dist/{vue-ui-sparkline-D2-KcHAU.js → vue-ui-sparkline-kxl5wQGY.js} +1 -1
- package/dist/{vue-ui-sparkstackbar-CBI4S5cu.js → vue-ui-sparkstackbar-CHjaAWVJ.js} +1 -1
- package/dist/vue-ui-stackbar-BrtUg-Mb.js +29 -0
- package/dist/vue-ui-stackline-CU2UkEJU.js +39 -0
- package/dist/vue-ui-strip-plot-BmEpoIoU.js +2 -0
- package/dist/vue-ui-table-Ddg209i0.js +14 -0
- package/dist/vue-ui-table-heatmap-B8AdX6Nq.js +1 -0
- package/dist/{vue-ui-table-sparkline-By319cB8.js → vue-ui-table-sparkline-B62l_ODH.js} +1 -1
- package/dist/vue-ui-thermometer-CvxyfTWE.js +1 -0
- package/dist/{vue-ui-timer-C6Pevf4N.js → vue-ui-timer-BkNtid9A.js} +2 -2
- package/dist/vue-ui-tiremarks-BE0nbuHp.js +1 -0
- package/dist/vue-ui-treemap-B9wAoh5g.js +1 -0
- package/dist/vue-ui-waffle-DqeBiuY3.js +1 -0
- package/dist/vue-ui-wheel---NZaS40.js +1 -0
- package/dist/vue-ui-word-cloud-DRFGFVmf.js +4 -0
- package/dist/vue-ui-world-D5gKzypf.js +19 -0
- package/dist/{vue-ui-xy-Df5gIADT.js → vue-ui-xy-Caj8jz6D.js} +1 -1
- package/dist/vue-ui-xy-CcVIXfL_.js +27 -0
- package/dist/vue-ui-xy-canvas-BceSG3AO.js +9 -0
- package/package.json +1 -1
- package/dist/UserOptions-DW84OKKr.js +0 -1
- package/dist/package-CNWVs68D.js +0 -1
- package/dist/vue-data-ui-BWqplouA.js +0 -1
- package/dist/vue-ui-3d-bar-DmRrbXjK.js +0 -19
- package/dist/vue-ui-age-pyramid-CJJIp5gY.js +0 -1
- package/dist/vue-ui-annotator-BnR2XnsL.js +0 -331
- package/dist/vue-ui-bullet-Br7H7FSM.js +0 -34
- package/dist/vue-ui-bump-DCDHNvWE.js +0 -8
- package/dist/vue-ui-candlestick-C_swW8gM.js +0 -22
- package/dist/vue-ui-carousel-table-BP_yVdDm.js +0 -1
- package/dist/vue-ui-chestnut-CIGNqBsT.js +0 -1
- package/dist/vue-ui-chord-DZRFBkRJ.js +0 -21
- package/dist/vue-ui-circle-pack-CtdPeMsY.js +0 -13
- package/dist/vue-ui-dag-Cj0CcntI.js +0 -9
- package/dist/vue-ui-dashboard-HyzHqAtX.js +0 -1
- package/dist/vue-ui-donut-Cv-bYyBN.js +0 -47
- package/dist/vue-ui-donut-evolution-DL112anx.js +0 -2
- package/dist/vue-ui-dumbbell-owG24VsQ.js +0 -9
- package/dist/vue-ui-flow-BMNIydqI.js +0 -3
- package/dist/vue-ui-funnel-BsVS3vuI.js +0 -1
- package/dist/vue-ui-galaxy-B8HgdBjc.js +0 -1
- package/dist/vue-ui-gauge-B1A_NFY6.js +0 -1
- package/dist/vue-ui-geo-_TG4jaV9.js +0 -1
- package/dist/vue-ui-heatmap-BbQseEbM.js +0 -1
- package/dist/vue-ui-hill-D3V84h_t.js +0 -1
- package/dist/vue-ui-history-plot-Bx4WYG6U.js +0 -2
- package/dist/vue-ui-horizontal-bar-Do0HJy4f.js +0 -4
- package/dist/vue-ui-molecule-bAMGCA2Y.js +0 -1
- package/dist/vue-ui-mood-radar-CFpgxjuR.js +0 -1
- package/dist/vue-ui-nested-donuts-CWY26iKX.js +0 -19
- package/dist/vue-ui-onion-DsBUqL_c.js +0 -5
- package/dist/vue-ui-parallel-coordinate-plot-BF3gO85b.js +0 -9
- package/dist/vue-ui-quadrant-BkNG2LGm.js +0 -2
- package/dist/vue-ui-quick-chart-CYxvgVpD.js +0 -17
- package/dist/vue-ui-radar-0H8CiLmc.js +0 -1
- package/dist/vue-ui-relation-circle-B0BM4xf8.js +0 -1
- package/dist/vue-ui-ridgeline-D-fDuE3y.js +0 -2
- package/dist/vue-ui-rings-UtlBiaZZ.js +0 -1
- package/dist/vue-ui-scatter-CduaARRt.js +0 -9
- package/dist/vue-ui-stackbar-DS_31-a3.js +0 -29
- package/dist/vue-ui-stackline-CuxohB0U.js +0 -39
- package/dist/vue-ui-strip-plot-bYGhsPA5.js +0 -2
- package/dist/vue-ui-table-heatmap-D6gpmHg8.js +0 -1
- package/dist/vue-ui-table-lzolsJ_n.js +0 -14
- package/dist/vue-ui-thermometer-B3Uv3aWc.js +0 -1
- package/dist/vue-ui-tiremarks-DeNdCFVD.js +0 -1
- package/dist/vue-ui-treemap-Ck9_llHA.js +0 -1
- package/dist/vue-ui-waffle-BW2SacnV.js +0 -1
- package/dist/vue-ui-wheel-BXDhx5bf.js +0 -1
- package/dist/vue-ui-word-cloud-DKPtoruY.js +0 -4
- package/dist/vue-ui-world-D9vpDbN7.js +0 -19
- package/dist/vue-ui-xy-CMckdUft.js +0 -27
- package/dist/vue-ui-xy-canvas-CBrKi3nN.js +0 -9
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{n as t,r as n,t as r}from"./annotationSlots-OLiW25XN.js";import{t as i}from"./useConfig-C3FbHv4N.js";import{$ as a,D as o,Dt as s,Jt as ee,Qt as c,X as te,Yt as ne,_ as re,_t as ie,at as ae,b as l,c as oe,gt as se,in as ce,nt as le,pt as ue,rn as de,t as fe,wt as pe,zt as me}from"./lib-rPeBMZrn.js";import{n as he,t as ge}from"./BaseScanner-8NdoBs7B.js";import{n as _e,t as ve}from"./useHints-C-TwxM0Y.js";import{t as ye}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{t as be}from"./useNestedProp-DnGoh-XS.js";import{t as xe}from"./useThemeCheck-BKNRbGeC.js";import{t as Se}from"./img-D4RQwASc.js";import{n as Ce}from"./Title-BliHuXfT.js";import{t as we}from"./useChartExport-BZts4KFb.js";import{n as Te,t as Ee}from"./tableIntegration-CNoJ1CIY.js";import{n as De,r as Oe,t as ke}from"./userOptionsSlots-CWtXN5Q6.js";import{n as Ae,r as je,t as Me}from"./useTimeLabels-Das5O74F.js";import{t as Ne}from"./usePrinter-DVf3YcG5.js";import{t as Pe}from"./useTransitions-ChGGrtrv.js";import{t as Fe}from"./useSvgLabelLayout-42Kats14.js";import{t as Ie}from"./useTimeLabelCollider-BTybMUFi.js";import{t as Le}from"./useResponsive-CENUxfEL.js";import{t as Re}from"./DefGrad-DKMq1REY.js";import{t as ze}from"./SlicerPreview-ChKbdZSU.js";import{t as Be}from"./A11yDataTable-DWNlWXzs.js";import{t as Ve}from"./useUserOptionState-CXlFnwPv.js";import{t as He}from"./useChartAccessibility-DOMuYJfm.js";import{t as Ue}from"./annotationViewport-X8fvs7pz.js";import{t as We}from"./vue_ui_candlestick-DKvha_Ab.js";import{Fragment as u,computed as d,createBlock as Ge,createCommentVNode as f,createElementBlock as p,createElementVNode as m,createSlots as Ke,createTextVNode as qe,createVNode as Je,defineAsyncComponent as h,guardReactiveProps as Ye,mergeProps as Xe,nextTick as Ze,normalizeClass as g,normalizeProps as Qe,normalizeStyle as $e,onBeforeUnmount as et,onMounted as tt,openBlock as _,ref as v,renderList as y,renderSlot as b,resolveDynamicComponent as nt,shallowRef as rt,toDisplayString as it,toRefs as at,unref as x,watch as ot,watchEffect as st,withCtx as S}from"vue";var ct=/* @__PURE__ */ e({default:()=>Ut}),lt=[`id`],ut=[`id`],dt={style:{position:`relative`}},ft=[`xmlns`,`aria-describedby`,`viewBox`],pt=[`x`,`y`,`width`,`height`],mt={key:1},ht={key:0},gt=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`],_t=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`],vt=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`,`stroke-dasharray`],yt=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`,`stroke-dasharray`],bt=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`],xt=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`],St=[`transform`,`text-anchor`,`font-size`,`fill`,`font-weight`],Ct=[`transform`,`text-anchor`,`font-size`,`fill`,`font-weight`],wt=[`transform`,`text-anchor`,`font-size`,`fill`,`stroke`,`font-weight`],Tt=[`x`,`y`,`width`,`height`,`fill`,`rx`],Et={key:0},Dt=[`cx`,`cy`,`r`,`fill`],Ot=[`cx`,`cy`,`r`,`fill`],kt={key:1},At=[`x`,`y`,`width`,`height`,`rx`,`fill`],jt=[`x`,`y`,`width`,`height`,`fill`,`rx`],Mt=[`x`,`y`,`height`,`width`,`fill`,`rx`],Nt=[`x`,`y`,`height`,`width`,`fill`,`rx`,`stroke`,`stroke-width`],Pt=[`d`,`stroke`],Ft=[`x`,`y`,`height`,`width`,`fill`,`onMouseover`,`onMouseleave`,`onClick`],It=[`x`,`y`,`width`,`height`,`fill`,`fill-opacity`,`stroke`,`stroke-opacity`,`stroke-width`,`stroke-dasharray`],Lt=[`data-start`,`data-end`],Rt={key:0,style:{position:`absolute`,top:`100%`,left:`0`,width:`100%`},"data-dom-to-png-ignore":``,"aria-hidden":`true`},zt={key:5,class:`vue-data-ui-watermark`},Bt=[`d`,`stroke`],Vt=[`d`,`stroke`,`stroke-width`],Ht=[`innerHTML`],Ut=/*#__PURE__*/ ye({__name:`vue-ui-candlestick`,props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}},selectedXIndex:{type:Number,default:void 0},zoomState:{type:Object,default:null}},emits:[`selectX`,`zoomStart`,`zoomEnd`,`zoomReset`,`update:zoomState`,`copyAlt`],setup(e,{expose:ye,emit:ct}){let Ut=h(()=>import(`./BaseIcon-CoY0vuL3.js`).then(e=>e.n)),Wt=h(()=>import(`./Tooltip-C1q0Qoh7.js`)),Gt=h(()=>import(`./vue-ui-accordion-E8TJfFeK.js`).then(e=>e.n)),Kt=h(()=>import(`./DataTable-Dof6yhO7.js`)),qt=h(()=>import(`./PenAndPaper-DoNTA-SV.js`).then(e=>e.t)),Jt=h(()=>import(`./UserOptions-B9EyfU9n.js`).then(e=>e.n)),Yt=h(()=>import(`./PackageVersion-DKSNC-YP.js`).then(e=>e.t)),Xt=h(()=>import(`./BaseDraggableDialog-BK7dj9O6.js`).then(e=>e.n)),{vue_ui_candlestick:Zt}=i(),{isThemeValid:Qt,warnInvalidTheme:$t}=xe(),C=e,w=ct,en=d(()=>!!C.dataset&&C.dataset.length),T=v(!1),tn=v(!1),nn=0,rn=v(null),E=v(te()),an=v(!1),on=v(``),D=v(void 0),sn=v(0),O=v(null),cn=v(null),ln=v(null),un=v(null),dn=v(null),fn=v(null),pn=v(0),mn=v(0),hn=v(0),gn=v(null),_n=v(null),vn=v(null),yn=v(null),bn=v(null),k=v(null),xn=v({x:0,y:0}),Sn=v(`pointer`),Cn=v(!1),A=v(Nn()),j=d(()=>A.value.style.layout.candle),M=d(()=>A.value.style.layout.grid),N=d(()=>A.value.style.layout),P=d(()=>A.value.style),F=d(()=>A.value.userOptions);_e({config:()=>A.value,dataset:()=>C.dataset,component:`VueUiCandlestick`,rules:[ve.emptyArray,{test:e=>e.length>200,message:[`👀 Dataset has > 200 points, which can cause performance issues. Consider:`,``,`▶️ Adding date inputs to constraint the dataset into a specific timeframe`,``,`▶️ Aggregate the data to larger time series to reduce the number of datapoints.`]}]});let{transitionEnabled:wn}=Pe({config:()=>A.value.transitions,dataset:()=>C.dataset}),Tn=d(()=>A.value.userOptions.useCursorPointer),En=d(()=>ce({defaultConfig:{useCssAnimation:!1,userOptions:{show:!1},table:{show:!1},style:{backgroundColor:`#99999930`,layout:{candle:{colors:{bearish:`#BABABA`,bullish:`#CACACA`}},grid:{stroke:`#6A6A6A`,verticalLines:{stroke:`#6A6A6A`},horizontalLines:{stroke:`#6A6A6A`},yAxis:{dataLabels:{show:!1},scale:{min:null,max:null}}},wick:{stroke:`#6A6A6A`,extremity:{color:`#6A6A6A`}}},tooltip:{show:!1},zoom:{show:!1,startIndex:null,endIndex:null}}},userConfig:A.value.skeletonConfig??{}})),{loading:I,FINAL_DATASET:L,manualLoading:Dn}=he({...at(C),FINAL_CONFIG:A,prepareConfig:Nn,callback:()=>{Promise.resolve().then(async()=>{await Xr()})},skeletonDataset:C.config?.skeletonDataset??[[17040672e5,10,20,2,10,30],[17067456e5,10,30,5,20,50],[17092512e5,20,50,10,30,80],[17119296e5,30,80,20,50,130],[17145216e5,50,130,30,100,210],[17172e8,80,210,50,150,340],[1719792e6,130,340,80,280,550],[17224704e5,210,550,130,450,890],[17251488e5,340,890,210,750,1440],[17277408e5,550,1440,340,1230,2330],[17304192e5,890,2330,550,1950,3770],[17330112e5,1440,3770,890,3200,5100]],skeletonConfig:ce({defaultConfig:A.value,userConfig:En.value})}),{userOptionsVisible:On,setUserOptionsVisibility:kn,keepUserOptionState:An}=Ve({config:A.value}),{svgRef:R}=He({config:P.value.title});function jn(){kn(!0)}function Mn(){kn(!1),w(`selectX`,{seriesIndex:null,datapoint:null}),D.value=null}function Nn(){let e=be({userConfig:C.config,defaultConfig:Zt}),t={};C.config&&pe(C.config,`style.layout.grid.xAxis.dataLabels.showFirstAndLast`)&&(e.style.layout.grid.xAxis.dataLabels.showFirstAndLast=!!C.config.style.layout.grid.xAxis.dataLabels.showFirstAndLast);let n=e.theme;if(n){if(!Qt.value(e))$t(e),t=e;else{let r=be({userConfig:We[n]||C.config,defaultConfig:e});t={...be({userConfig:C.config,defaultConfig:r})}}}else t=e;return t}let Pn=c(C.config);ot(()=>C.config,(e,t)=>{let n=c(e),r=n!==Pn;Pn=n;let i=Nn();r?(I.value||(A.value=Nn()),On.value=!A.value.userOptions.showOnChartHover,Ln(),pn.value+=1,hn.value+=1,mn.value+=1,V.value.showTable=A.value.table.show,V.value.showTooltip=P.value.tooltip.show,dr()):(A.value.style.tooltip=i.style.tooltip,V.value.showTooltip=A.value.style.tooltip.show)},{deep:!0}),ot(()=>C.dataset,e=>{Array.isArray(e)&&e.length>0&&(Dn.value=!1),Kr()},{deep:!0});let z=v({height:P.value.height,width:P.value.width,xAxisFontSize:M.value.xAxis.dataLabels.fontSize,yAxisFontSize:M.value.yAxis.dataLabels.fontSize}),B=rt(null),Fn=rt(null);tt(()=>{Ln()});let In=d(()=>A.value.debug);function Ln(){me(C.dataset)&&(ae({componentName:`VueUiCandlestick`,type:`dataset`,debug:In.value}),Dn.value=!0),me(C.dataset)||(Dn.value=A.value.loading),setTimeout(()=>{T.value=!0},10),A.value.responsive&&(B.value&&(Fn.value&&B.value.unobserve(Fn.value),B.value.disconnect()),B.value=new ResizeObserver(()=>{T.value=!1;let{width:e,height:t}=Le({chart:O.value,title:P.value.title.text?cn.value:null,slicer:P.value.zoom.show&&W.value>6?un.value.$el:null,legend:ln.value,source:dn.value,noTitle:fn.value});cancelAnimationFrame(nn),nn=requestAnimationFrame(()=>{z.value.width=e,z.value.height=t-12,tn.value=!0,A.value.responsiveProportionalSizing?(z.value.xAxisFontSize=de({relator:Math.min(e,t),adjuster:P.value.width,source:M.value.xAxis.dataLabels.fontSize,threshold:6,fallback:6}),z.value.yAxisFontSize=de({relator:Math.min(e,t),adjuster:P.value.width,source:M.value.yAxis.dataLabels.fontSize,threshold:6,fallback:6})):(z.value.xAxisFontSize=M.value.xAxis.dataLabels.fontSize,z.value.yAxisFontSize=M.value.yAxis.dataLabels.fontSize),rn.value&&clearTimeout(rn.value),rn.value=setTimeout(()=>{T.value=!0},10)})}),Fn.value=O.value.parentNode,B.value.observe(Fn.value)),Xr()}et(()=>{cancelAnimationFrame(nn),B.value&&(Fn.value&&B.value.unobserve(Fn.value),B.value.disconnect())});let{isPrinting:Rn,isImaging:zn,generatePdf:Bn,generateImage:Vn}=Ne({elementId:`vue-ui-candlestick_${E.value}`,fileName:P.value.title.text||`vue-ui-candlestick`,options:A.value.userOptions.print}),Hn=d(()=>A.value.userOptions.show&&!P.value.title.text),V=v({showTable:A.value.table.show,showTooltip:P.value.tooltip.show}),{metrics:Un,ready:Wn,settling:H,update:Gn}=Fe({svgRef:R,canMeasure:()=>(!A.value.responsive||tn.value)&&(!M.value.xAxis.dataLabels.show||Er.value),initialMetrics:{scaleLabelsWidth:0,timeLabelsHeight:0},measure:e=>({scaleLabelsWidth:gn.value?e(gn.value).textWidth:M.value.yAxis.dataLabels.offsetX,timeLabelsHeight:e(_n.value).height})}),Kn=d(()=>_n.value?Un.value.timeLabelsHeight+z.value.xAxisFontSize:0),qn=d(()=>M.value.yAxis.position===`right`);function Jn(){let e=Un.value.scaleLabelsWidth,t=M.value.yAxis.axisName?.show?M.value.yAxis.axisName.fontSize+M.value.yAxis.axisName.offsetX:0,n=e+13+t;return{left:qn.value?0:n,right:qn.value?n:0,scaleLabelsWidth:e,yAxisNameWidth:t,crosshair:13}}let U=d(()=>{let{top:e,right:t,bottom:n,left:r}=N.value.padding,i=Jn();return{top:e+12,right:z.value.width-t-i.right,left:r+i.left,bottom:z.value.height-n-Kn.value,width:z.value.width-r-t-i.left-i.right,height:z.value.height-e-n-Kn.value-12,scaleLabelsWidth:i.scaleLabelsWidth,yAxisNameWidth:i.yAxisNameWidth,crosshair:i.crosshair}}),Yn=d(()=>{let{left:e,top:t,width:n,height:r}=U.value,i=G.value.start,a=G.value.end-i,o=n/a,s=K.value.start-i,ee=K.value.end-i,c=Math.max(0,Math.min(a,s)),te=Math.max(0,Math.min(a,ee));return{x:e+c*o,y:t,width:(te-c)*o,height:r,fill:P.value.zoom.preview.fill,stroke:P.value.zoom.preview.stroke,"stroke-width":P.value.zoom.preview.strokeWidth,"stroke-dasharray":P.value.zoom.preview.strokeDasharray,"stroke-linecap":`round`,"stroke-linejoin":`round`,style:{pointerEvents:`none`,transition:`none !important`,animation:`none !important`}}}),W=d(()=>L.value.length),G=v({start:0,end:W.value}),K=v({start:0,end:W.value}),Xn=v(!1),Zn=v(!1),Qn=v(null),q=v(null),J=v(null),$n=v(!1),er=v({time:0,x:0,y:0,pointerType:null}),tr=d(()=>P.value.zoom?.dragToZoom),Y=d(()=>tr.value.show&&en.value&&Jr.value&&W.value>1&&!I.value),nr=null,rr={},ir=d(()=>P.value.zoom.preview.enable&&(K.value.start!==G.value.start||K.value.end!==G.value.end));function ar(e,t){K.value[e]=t}function or(e,t=G.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 sr(e){let t=or(e);t&&w(`update:zoomState`,t)}function cr(){nr&&=(cancelAnimationFrame(nr),null),rr={}}function lr(e){let t=or(e);if(!t)return null;let{start:n,end:r}=t;return(n!==Number(G.value.start)||r!==Number(G.value.end))&&(cr(),G.value={start:n,end:r},K.value={start:n,end:r},dr()),{start:Number(G.value.start),end:Number(G.value.end)}}function ur(e){let t=lr(e);return t?(w(`update:zoomState`,t),t):null}function dr(){let e=Math.max(0,Math.min(G.value.start??0,W.value-1)),t=Math.max(e+1,Math.min(G.value.end??W.value,W.value));(!Number.isFinite(e)||!Number.isFinite(t)||t<=e)&&(e=0,t=W.value),G.value.start=e,G.value.end=t,K.value.start=e,K.value.end=t,un.value&&un.value.setRangeValues(e,t)}let fr=d(()=>L.value.map((e,t)=>({...e,absoluteIndex:t}))),pr=d(()=>fr.value.slice(G.value.start,G.value.end)),mr=d(()=>(In.value&&L.value.forEach((e,t)=>{[null,void 0].includes(e[0])&&ae({componentName:`VueUiCandlestick`,type:`datasetAttribute`,property:`period (index 0)`,index:t}),[null,void 0].includes(e[1])&&ae({componentName:`VueUiCandlestick`,type:`datasetAttribute`,property:`open (index 1)`,index:t}),[null,void 0].includes(e[2])&&ae({componentName:`VueUiCandlestick`,type:`datasetAttribute`,property:`high (index 2)`,index:t}),[null,void 0].includes(e[3])&&ae({componentName:`VueUiCandlestick`,type:`datasetAttribute`,property:`low (index 3)`,index:t}),[null,void 0].includes(e[4])&&ae({componentName:`VueUiCandlestick`,type:`datasetAttribute`,property:`close (index 4)`,index:t}),[null,void 0].includes(e[5])&&ae({componentName:`VueUiCandlestick`,type:`datasetAttribute`,property:`volume (index 5)`,index:t})}),pr.value.map(e=>({absoluteIndex:e.absoluteIndex,period:e[0],open:e[1],high:e[2],low:e[3],close:e[4],volume:e[5]})))),hr=d(()=>fr.value.map(e=>({absoluteIndex:e.absoluteIndex,period:e[0],open:e[1],high:e[2],low:e[3],close:e[4],volume:e[5]}))),X=d(()=>U.value.width/pr.value.length),gr=d(()=>{let e={o:-1/0,h:-1/0,l:-1/0},t={o:1/0,h:1/0,l:1/0},n=-1/0,r=1/0;for(let i of mr.value)e.o=Math.max(e.o,i.open),e.h=Math.max(e.h,i.high),e.l=Math.max(e.l,i.low),t.o=Math.min(t.o,i.open),t.h=Math.min(t.h,i.high),t.l=Math.min(t.l,i.low),n=Math.max(n,i.volume),r=Math.min(r,i.volume);return e.c=e.l,t.c=t.l,{max:e,min:t,volumeMax:n,volumeMin:r}}),_r=d(()=>({max:M.value.yAxis.scale.max===null?gr.value.max.h:M.value.yAxis.scale.max,min:M.value.yAxis.scale.min===null?0:M.value.yAxis.scale.min})),Z=d(()=>re(_r.value.min,_r.value.max,M.value.yAxis.dataLabels.steps));function vr(e,t,n=null,r=null){return{...e,x:l(U.value.left+t*X.value+X.value/2),y:l(U.value.top+(1-(e-Z.value.min)/(Z.value.max-Z.value.min))*U.value.height),value:l(e),isMax:e===n,isMin:e===r}}let Q=d(()=>{let{max:e,min:t,volumeMax:n,volumeMin:r}=gr.value;return mr.value.map((i,a)=>{let o=vr(i.open,a,e.o,t.o),s=vr(i.high,a,e.h,t.h),ee=vr(i.low,a,e.l,t.l),c=vr(i.close,a,e.c,t.c),te=i.close>i.open,ne=i.volume===n,re=i.volume===r;return{period:i.period,open:o,high:s,low:ee,close:c,volume:i.volume,isBullish:te,absoluteIndex:i.absoluteIndex,isMaxVolume:ne,isMinVolume:re}})}),yr=d(()=>{let e=-1/0;for(let t of L.value)e=Math.max(e,t[2]);return e});function br({item:e,index:t,minimapH:n,unitW:r,min:i,max:a}){return{...e,x:l(t*r),y:l((1-(e-i)/(a-i))*n),value:l(e)}}let xr=d(()=>{let e=hr.value,t=M.value.yAxis.scale.min??0,n=M.value.yAxis.scale.max??yr.value,r,i,a;return({minimapH:o,unitW:s})=>(a&&r===o&&i===s||(r=o,i=s,a=e.map((e,r)=>{let i=br({item:e.open,index:r,minimapH:o,unitW:s,min:t,max:n}),a=br({item:e.high,index:r,minimapH:o,unitW:s,min:t,max:n}),ee=br({item:e.low,index:r,minimapH:o,unitW:s,min:t,max:n}),c=br({item:e.close,index:r,minimapH:o,unitW:s,min:t,max:n}),te=e.close>e.open;return{period:e.period,open:i,high:a,low:ee,close:c,volume:e.volume,isBullish:te,absoluteIndex:e.absoluteIndex}})),a)}),Sr=d(()=>P.value.zoom.minimap.show?[{name:``,series:L.value.map(e=>e[2]),color:`#000000`,isVisible:!0}]:[]);function Cr(e){return l((e-Z.value.min)/(Z.value.max-Z.value.min))}let wr=d(()=>Z.value.ticks.map(e=>({y:U.value.bottom-U.value.height*Cr(e),value:l(e)}))),Tr=d(()=>mr.value.map(e=>e.period)),$=v([]),Er=v(!1),Dr=v([]),Or=0;st(()=>{let e=++Or;(async()=>{let t=await Me({values:L.value.map(e=>e[0]),maxDatapoints:L.value.length,formatter:M.value.xAxis.dataLabels.datetimeFormatter,start:G.value.start,end:G.value.end});e===Or&&($.value=t,Er.value=!0)})()});let kr=0;st(()=>{let e=++kr;(async()=>{let t=await Me({values:L.value.map(e=>e[0]),maxDatapoints:L.value.length,formatter:M.value.xAxis.dataLabels.datetimeFormatter,start:0,end:W.value});e===kr&&(Dr.value=t)})()});let Ar=v({months:[],shortMonths:[],days:[],shortDays:[]}),jr=0;st(()=>{let e=++jr,t=M.value.xAxis.dataLabels.datetimeFormatter;(async()=>{let n=await je(t.locale).catch(()=>je(`en`));e===jr&&(Ar.value=n.data)})()});let Mr=d(()=>{let e=M.value.xAxis.dataLabels.datetimeFormatter,t=Ae({useUTC:e.useUTC,locale:Ar.value,januaryAsYear:e.januaryAsYear});return(e,n)=>{let r=L.value.map(e=>e[0])?.[e];return r==null?``:t.formatDate(new Date(r),n)}}),Nr=d(()=>(L.value.map(e=>e[0])||[]).map((e,t)=>({text:Mr.value(t,P.value.tooltip.timeFormat),absoluteIndex:t}))),Pr=d(()=>(L.value.map(e=>e[0])||[]).map((e,t)=>({text:Mr.value(t,P.value.zoom.timeFormat),absoluteIndex:t}))),Fr=d(()=>($.value||[]).map(e=>e?.text??``)),Ir=d(()=>(Dr.value||[]).map(e=>e?.text??``)),Lr=d(()=>{let e=Math.max(1,Math.floor(Number(M.value.xAxis.dataLabels.modulo)||1)),t=Fr.value,n=Ir.value,r=G.value.start??0,i=r>0||t.length<n.length;return se({configuredModulo:e,visibleTexts:t,allTexts:n,startAbs:r,isZoomed:i})}),Rr=d(()=>{let e=M.value.xAxis.dataLabels,t=G.value.start??0,n=D.value,r=W.value,i=Fr.value,a=Ir.value,o=oe(!!e.showOnlyFirstAndLast,!!e.showOnlyAtModulo,Lr.value,i,a,t,n,r);if(!e.showFirstAndLast||e.showOnlyFirstAndLast||!o.length)return o;let s=o.length-1;return o.map((e,t)=>t!==0&&t!==s?e:{...e,text:i[t]??``})}),zr=d(()=>M.value.xAxis.dataLabels.datetimeFormatter.enable?{start:$.value.find(e=>e.absoluteIndex===G.value.start)?.text??``,end:$.value.find(e=>e.absoluteIndex===G.value.end-1)?.text??``}:{start:L.value[G.value.start]?L.value[G.value.start][0]:L.value[0][0],end:L.value[G.value.end-1]?L.value[G.value.end-1][0]:L.value.at(-1)[0]}),Br=v(null);function Vr(e,t){A.value.events.datapointClick&&A.value.events.datapointClick({datapoint:t,seriesIndex:e+G.value.start})}function Hr(e,t){A.value.events.datapointLeave&&A.value.events.datapointLeave({datapoint:t,seriesIndex:e+G.value.start}),D.value=void 0,an.value=!1,k.value=null,Sn.value=`pointer`}ot(()=>C.selectedXIndex,e=>{if([null,void 0].includes(C.selectedXIndex)){D.value=null;return}let t=e-G.value.start;t<0||e>=G.value.end?D.value=null:D.value=t??null},{immediate:!0});function Ur(e,t,n=`pointer`){A.value.events.datapointEnter&&A.value.events.datapointEnter({datapoint:t,seriesIndex:e+G.value.start}),D.value=e,k.value=e,Sn.value=n,Br.value={datapoint:t,seriesIndex:e,series:Q.value,config:A.value},Ii({seriesIndex:e,datapoint:t});let r=P.value.tooltip.customFormat;if(s(r)&&ue(()=>r({seriesIndex:e,datapoint:t,series:Q.value,config:A.value})))on.value=r({seriesIndex:e,datapoint:t,series:Q.value,config:A.value});else if(P.value.tooltip.show){let n=``,{period:r,open:i,high:o,low:s,close:ee,volume:c,isBullish:te}=Q.value[e],{period:ne,open:re,high:ie,low:ae,close:l,volume:oe}=A.value.translations,se=M.value.xAxis.dataLabels.datetimeFormatter.enable?P.value.tooltip.useDefaultTimeFormat?$.value[e].text:Nr.value[e].text:r;n+=`<div><svg style="margin-right:6px" viewBox="0 0 12 12" height="12" width="12"><rect x="0" y="0" height="12" width="12" rx="${j.value.borderRadius*3}" stroke="${j.value.stroke}" stroke-width="${j.value.strokeWidth}"
|
|
2
|
+
fill="${j.value.gradient.show?te?`url(#bullish_gradient_${E.value})`:`url(#bearish_gradient_${E.value})`:te?j.value.colors.bullish:j.value.colors.bearish}"/></svg>${se}</div>`,n+=`${oe} : <b>${isNaN(c)?`-`:Number(c.toFixed(P.value.tooltip.roundingValue)).toLocaleString()}</b>`,n+=`<div style="margin-top:6px;padding-top:6px;border-top:1px solid ${P.value.tooltip.borderColor}">`;let ce=a({p:P.value.tooltip.prefix,v:i.value,s:P.value.tooltip.suffix,r:P.value.tooltip.roundingValue}),le=a({p:P.value.tooltip.prefix,v:o.value,s:P.value.tooltip.suffix,r:P.value.tooltip.roundingValue}),ue=a({p:P.value.tooltip.prefix,v:s.value,s:P.value.tooltip.suffix,r:P.value.tooltip.roundingValue}),de=a({p:P.value.tooltip.prefix,v:ee.value,s:P.value.tooltip.suffix,r:P.value.tooltip.roundingValue});P.value.tooltip.showChart?n+=`<div style="width:100%;display:flex;align-items:center;justify-content:center;">
|
|
3
|
+
<svg viewBox="0 0 100 100" width="100px" style="background: transparent; overflow: visible">
|
|
4
|
+
<g>
|
|
5
|
+
<line x1="50" x2="50" y1="20" y2="80" stroke="${t.isBullish?j.value.colors.bullish:j.value.colors.bearish}" stroke-width="2" stroke-linecap="round" />
|
|
6
|
+
${t.isBullish?`
|
|
7
|
+
<line x1="45" x2="50" y1="65" y2="65" stroke="${j.value.colors.bullish}" stroke-width="1.5" stroke-linecap="round" />
|
|
8
|
+
<line x1="50" x2="55" y1="35" y2="35" stroke="${j.value.colors.bullish}" stroke-width="1.5" stroke-linecap="round" />
|
|
9
|
+
<text x="38" y="70" text-anchor="end" fill="${P.value.tooltip.color}">${ce}</text>
|
|
10
|
+
<text x="62" y="40" text-anchor="start" fill="${P.value.tooltip.color}">${de}</text>
|
|
11
|
+
`:`
|
|
12
|
+
<line x1="45" x2="50" y1="35" y2="35" stroke="${j.value.colors.bearish}" stroke-width="1.5" stroke-linecap="round" />
|
|
13
|
+
<line x1="50" x2="55" y1="65" y2="65" stroke="${j.value.colors.bearish}" stroke-width="1.5" stroke-linecap="round" />
|
|
14
|
+
<text x="40" y="40" text-anchor="end" fill="${P.value.tooltip.color}">${ce}</text>
|
|
15
|
+
<text x="60" y="70" text-anchor="start" fill="${P.value.tooltip.color}">${de}</text>
|
|
16
|
+
`}
|
|
17
|
+
<text x="50" y="13" text-anchor="middle" fill="${P.value.tooltip.color}">${le}</text>
|
|
18
|
+
<text x="50" y="97" text-anchor="middle" fill="${P.value.tooltip.color}">${ue}</text>
|
|
19
|
+
<g>
|
|
20
|
+
</svg>
|
|
21
|
+
<div>
|
|
22
|
+
`:(n+=`<div>${re}: <b>${ce}</b></div>`,n+=`<div>${ie}: <b>${le}</b></div>`,n+=`<div>${ae}: <b>${ue}</b></div>`,n+=`<div>${l}: <b>${de}</b></div>`),n+=`</div>`,on.value=`<div style="text-align:right">${n}</div>`}an.value=!0}let Wr=v(null);function Gr(){return new Promise(e=>requestAnimationFrame(()=>requestAnimationFrame(()=>e())))}et(()=>{Wr.value&&cancelAnimationFrame(Wr.value),cr(),Ei()});async function Kr({force:e=!1,publish:t=!1}={}){let n=!e;Xr(n),await Ze(),Wr.value&&cancelAnimationFrame(Wr.value),Wr.value=requestAnimationFrame(async()=>{await Gr(),Xr(n),Wr.value=null,t&&(sr({start:Number(G.value.start),end:Number(G.value.end)}),w(`zoomReset`))})}let qr=v(!1),Jr=v(!1),Yr=v(!1);ot([()=>C.zoomState,Jr],([e,t])=>{t&&e&&lr(e)},{deep:!0,immediate:!0});function Xr(e=!0){if(!qr.value){qr.value=!0;try{let{startIndex:t,endIndex:n}=P.value.zoom,r=W.value,i=t??0,a=n==null?r:Math.min(Zr(n+1,i),r);Yr.value=!0,G.value.start=i,G.value.end=a,K.value.start=i,K.value.end=a,dr(),Jr.value=!0,e&&C.zoomState&&lr(C.zoomState)}finally{queueMicrotask(()=>{Yr.value=!1}),qr.value=!1}}}function Zr(e,t=G.value.start){let n=W.value,r=Number(t);return e>n?n:e<0||e<=r?Math.min(r+1,n):e}function Qr(e=null){Ze(()=>{let t=[A.value.translations.period,A.value.translations.open,A.value.translations.high,A.value.translations.low,A.value.translations.close,A.value.translations.volume],n=Q.value.map((e,t)=>[M.value.xAxis.dataLabels.datetimeFormatter.enable?$.value[t].text:e.period,e.open.value,e.high.value,e.low.value,e.close.value,e.volume]),r=[[P.value.title.text],[P.value.title.subtitle.text],[[``],[``],[``]],t].concat(n),i=o(r);e?e(i):le({csvContent:i,title:P.value.title.text||`vue-ui-candlestick`})})}let $r=d(()=>{let e=Q.value.map((e,t)=>{let n=M.value.xAxis.dataLabels.datetimeFormatter.enable?$.value?.[t]?.text??``:e.period,r=a({p:A.value.table.td.prefix,v:e.open.value,s:A.value.table.td.suffix,r:A.value.table.td.roundingValue}),i=a({p:A.value.table.td.prefix,v:e.high.value,s:A.value.table.td.suffix,r:A.value.table.td.roundingValue}),o=a({p:A.value.table.td.prefix,v:e.low.value,s:A.value.table.td.suffix,r:A.value.table.td.roundingValue}),s=a({p:A.value.table.td.prefix,v:e.close.value,s:A.value.table.td.suffix,r:A.value.table.td.roundingValue});return[`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 12 12" height="12" width="12" style="margin-right: 6px"><rect x="0" y="0" height="12" width="12" rx="${j.value.borderRadius*3}" fill="${j.value.gradient.show?e.isBullish?`url(#bullish_gradient_${E.value})`:`url(#bearish_gradient_${E.value})`:e.isBullish?j.value.colors.bullish:j.value.colors.bearish}"/></svg> ${n}`,r,i,o,s,`${isNaN(e.volume)?`-`:e.volume.toLocaleString()}`]}),t=Q.value.map((e,t)=>[M.value.xAxis.dataLabels.datetimeFormatter.enable?$.value?.[t]?.text??``:e.period,a({p:A.value.table.td.prefix,v:e.open.value,s:A.value.table.td.suffix,r:A.value.table.td.roundingValue}),a({p:A.value.table.td.prefix,v:e.high.value,s:A.value.table.td.suffix,r:A.value.table.td.roundingValue}),a({p:A.value.table.td.prefix,v:e.low.value,s:A.value.table.td.suffix,r:A.value.table.td.roundingValue}),a({p:A.value.table.td.prefix,v:e.close.value,s:A.value.table.td.suffix,r:A.value.table.td.roundingValue}),`${isNaN(e.volume)?`-`:e.volume}`]),n={th:{backgroundColor:A.value.table.th.backgroundColor,color:A.value.table.th.color,outline:A.value.table.th.outline},td:{backgroundColor:A.value.table.td.backgroundColor,color:A.value.table.td.color,outline:A.value.table.td.outline},breakpoint:A.value.table.responsiveBreakpoint},r=[A.value.translations.period,A.value.translations.open,A.value.translations.high,A.value.translations.low,A.value.translations.last,A.value.translations.volume];return{head:r,body:e,bodyA11y:t,config:n,colNames:r}}),ei=v(!1);function ti(e){ei.value=e,sn.value+=1}function ni(){V.value.showTable=!V.value.showTable}function ri(){V.value.showTooltip=!V.value.showTooltip}let ii=v(!1);function ai(){ii.value=!ii.value}async function oi({scale:e=2}={}){if(!O.value)return;let{imageUri:t,base64:n}=await Se({domElement:O.value,base64:!0,img:!0,scale:e}),r=O.value.getBoundingClientRect(),i={width:r.width,height:r.height,aspectRatio:r.height?r.width/r.height:0},a=await ie(t,e)??i;return{imageUri:t,base64:n,title:P.value.title.text,...a}}let si=d(()=>z.value.width),ci=d(()=>z.value.height);Ie({timeLabelsEls:_n,timeLabels:$,slicer:G,configRef:A,rotationPath:[`style`,`layout`,`grid`,`xAxis`,`dataLabels`,`rotation`],autoRotatePath:[`style`,`layout`,`grid`,`xAxis`,`dataLabels`,`autoRotate`,`enable`],isAutoSize:!1,rotation:M.value.xAxis.dataLabels.autoRotate.angle,width:si,height:ci}),ot(A,()=>{V.value={showTable:A.value.table.show,showTooltip:P.value.tooltip.show}},{immediate:!0});let li=d(()=>Ee({config:A,style:P,mutableConfig:V,dialog:Xt,accordion:Gt,isFullscreen:ei,parent:O,maxWidth:800,isCursorPointer:Tn}));ot(()=>V.value.showTable,e=>Te(e,A,vn));function ui(){V.value.showTable=!1,yn.value&&yn.value.setTableIconState(!1)}let di=d(()=>P.value.backgroundColor),fi=d(()=>P.value.title),{isCallbackImaging:pi,isCallbackSvg:mi,generateSvg:hi,onGenerateImage:gi}=we({svg:R,title:fi,legend:null,legendItems:null,backgroundColor:di,getSvgCallback:()=>A.value.userOptions.callbacks.svg,generateImage:Vn});function _i(e){bn.value=e}function vi(e){rr={...rr,...e},nr&&cancelAnimationFrame(nr),nr=requestAnimationFrame(()=>{let e={...G.value,...rr};rr={},nr=null,G.value=e,K.value={...e},dr(),sr({start:Number(G.value.start),end:Number(G.value.end)})})}function yi(e){if(qr.value||Yr.value)return;let t=Number(e);Number.isFinite(t)&&(w(`zoomStart`,{index:t,isZoom:t!==0}),t!==G.value.start&&vi({start:t}))}function bi(e){if(qr.value||Yr.value)return;let t=rr.start===void 0?G.value.start:rr.start,n=Zr(Number(e),t);Number.isFinite(n)&&(w(`zoomEnd`,{index:n,isZoom:n!==W.value}),(n!==G.value.end||rr.start!==void 0)&&vi({end:n}))}function xi(e){let t=R.value;if(!t)return null;if(t.createSVGPoint&&t.getScreenCTM){let n=t.createSVGPoint();n.x=e.clientX,n.y=e.clientY;let r=t.getScreenCTM();if(r){let e=n.matrixTransform(r.inverse());return{x:e.x,y:e.y}}}let n=t.getBoundingClientRect(),r=t.viewBox?.baseVal||{x:0,y:0,width:n.width,height:n.height},i=Math.min(n.width/r.width,n.height/r.height);if(!Number.isFinite(i)||i<=0)return null;let a=r.width*i,o=r.height*i,s=(n.width-a)/2,ee=(n.height-o)/2;return{x:(e.clientX-n.left-s)/i+r.x,y:(e.clientY-n.top-ee)/i+r.y}}let Si=d(()=>!Xn.value||Qn.value==null||q.value==null?null:{x:Math.min(Qn.value,q.value),y:U.value.top,width:Math.abs(q.value-Qn.value),height:U.value.height}),Ci=d(()=>Jr.value?Number(G.value.start)!==0||Number(G.value.end)!==Number(W.value):!1);function wi(e){return Math.min(Math.max(e,U.value.left),U.value.right)}function Ti(){D.value=void 0,k.value=null,Sn.value=`pointer`,an.value=!1,bn.value=null}function Ei(e){let t=e?.pointerId==null?J.value:e.pointerId;t!=null&&R.value?.hasPointerCapture?.(t)&&R.value.releasePointerCapture(t),Xn.value=!1,Qn.value=null,q.value=null,J.value=null}function Di(){$n.value=!0,setTimeout(()=>{$n.value=!1},0)}function Oi(e){$n.value&&($n.value=!1,e.preventDefault(),e.stopPropagation())}function ki(e){if(!Y.value||!Ci.value||!e)return!1;let t=Date.now(),n=e.pointerType||`mouse`,r=er.value,i=n===`touch`?450:350,a=n===`touch`?28:10,o=Math.hypot(e.clientX-r.x,e.clientY-r.y);return r.time>0&&r.pointerType===n&&t-r.time<=i&&o<=a?(er.value={time:0,x:0,y:0,pointerType:null},Di(),Ei(e),Kr({force:!0,publish:!0}),!0):(er.value={time:t,x:e.clientX,y:e.clientY,pointerType:n},!1)}function Ai(e){let t=Number(G.value.end)-Number(G.value.start);if(t<=0||!Number.isFinite(X.value)||X.value<=0)return null;let n=Math.floor((wi(e)-U.value.left)/X.value);return Math.max(0,Math.min(t-1,n))}function ji(e,t){let n=Ai(e),r=Ai(t);if(n==null||r==null)return null;let i=Math.min(n,r),a=Math.max(n,r);return a<=i?null:{start:Number(G.value.start)+i,end:Number(G.value.start)+a+1}}function Mi(e){let t=ur(e);return t?(w(`zoomStart`,{index:t.start,isZoom:t.start!==0}),w(`zoomEnd`,{index:t.end,isZoom:t.end!==W.value}),t):null}function Ni(e){if(!Y.value||ii.value||e.button!==void 0&&e.button!==0||J.value!=null&&e.pointerId!==J.value)return;let t=xi(e);if(!t)return;let{left:n,right:r,top:i,bottom:a}=U.value;if(t.x<n||t.x>r||t.y<i||t.y>a||Number(G.value.end)-Number(G.value.start)<=1)return;Zn.value=!0,R.value?.focus?.({preventScroll:!0}),Ti();let o=wi(t.x);J.value=e.pointerId,Xn.value=!0,Qn.value=o,q.value=o}function Pi(e){if(!Y.value||!Xn.value||J.value!=null&&e.pointerId!==J.value)return;let t=xi(e);t&&(q.value=wi(t.x),Ti(),Qn.value!=null&&Math.abs(q.value-Qn.value)>=2&&!R.value?.hasPointerCapture?.(e.pointerId)&&R.value?.setPointerCapture?.(e.pointerId))}function Fi(e){if(!Y.value||!Xn.value||J.value!=null&&e.pointerId!==J.value)return;let t=xi(e);t&&(q.value=wi(t.x));let n=Qn.value,r=q.value;if((n==null||r==null?0:Math.abs(r-n))<Math.max(4,U.value.width*.01)){if(ki(e))return;Ei(e);return}let i=ji(Math.min(n,r),Math.max(n,r));i?(Ei(e),Mi(i)&&(er.value={time:0,x:0,y:0,pointerType:null},Ti(),Di())):Ei(e)}function Ii({seriesIndex:e,datapoint:t}){let n=G.value.start+e;w(`selectX`,{dataset:t,index:n,indexLabel:``})}async function Li(){w(`copyAlt`,{config:A.value,dataset:Q.value}),A.value.userOptions.callbacks.altCopy?await Promise.resolve(A.value.userOptions.callbacks.altCopy({config:A.value,dataset:Q.value})):console.warn("Vue Data UI - A callback must be set for `altCopy` in userOptions.")}function Ri(){k.value=null,Cn.value=!0}function zi(){Zn.value=!1,k.value=null,Sn.value=`pointer`,an.value=!1,D.value=void 0,Cn.value=!1}function Bi(e){if(!R.value||ii.value||document.activeElement!==R.value||(Zn.value=!1,!Q.value.length))return;let t=e.key===`ArrowLeft`,n=e.key===`ArrowRight`,r=e.key===`Enter`||e.key===` `,i=e.key===`Escape`;if(!t&&!n&&!r&&!i)return;if(e.preventDefault(),e.stopPropagation(),i){if(Y.value&&(Ci.value||Xn.value)){Ei(),Kr({force:!0,publish:!0});return}k.value=null,Sn.value=`pointer`,an.value=!1,D.value=void 0;return}if(r){if(k.value===null)return;let e=Q.value[k.value];if(!e)return;Vr(k.value,e);return}let a=k.value,o=D.value,s=a!==null&&a>=0&&a<Q.value.length,ee=o!=null&&o>=0&&o<Q.value.length;s?n?(a+=1,a>=Q.value.length&&(a=0)):t&&(--a,a<0&&(a=Q.value.length-1)):ee?(a=n?o+1:o-1,a>=Q.value.length&&(a=0),a<0&&(a=Q.value.length-1)):a=n?0:Q.value.length-1;let c=Q.value[a];c&&(Vi(a),Ur(a,c,`keyboard`))}function Vi(e){if(!Number.isFinite(e)||!R.value)return;let t=U.value.left+X.value*e+X.value/2,n=U.value.top+U.value.height/2,r=R.value.getBoundingClientRect();xn.value={x:r.left+t/z.value.width*r.width,y:r.top+n/z.value.height*r.height}}let Hi=d(()=>({headers:$r.value?.colNames??[],rows:$r.value?.bodyA11y??[]}));ye({getImage:oi,generatePdf:Bn,generateCsv:Qr,generateImage:Vn,generateSvg:hi,toggleTable:ni,toggleTooltip:ri,toggleAnnotator:ai,toggleFullscreen:ti,copyAlt:Li,resetZoom:()=>Kr({force:!0,publish:!0}),setZoomState:ur}),ot(()=>[z.value,M.value,A.value.style.fontFamily,C.dataset,G.value.start,G.value.end,$.value,Er.value,tn.value,gn.value,_n.value],Gn,{flush:`post`,deep:!0});let Ui=d(()=>Ue({enabled:F.value?.annotator?.followZoom,area:U.value,range:G.value,ticks:wr.value}));return(e,i)=>(_(),p(`div`,{ref_key:`candlestickChart`,ref:O,class:g(`vue-data-ui-component vue-ui-candlestick ${ei.value?`vue-data-ui-wrapper-fullscreen`:``} ${A.value.useCssAnimation?``:`vue-ui-dna`}`),style:$e(`position:relative;font-family:${P.value.fontFamily}; text-align:center;background:${P.value.backgroundColor}; ${A.value.responsive?`height: 100%`:``}`),id:`vue-ui-candlestick_${E.value}`,onMouseenter:jn,onMouseleave:Mn},[m(`div`,{id:`chart-instructions-${E.value}`,class:`sr-only`},[m(`p`,null,it(A.value.a11y.translations.keyboardNavigation),1)],8,ut),Hi.value?.rows?.length?(_(),Ge(Be,{key:0,uid:E.value,head:Hi.value.headers,body:Hi.value.rows,notice:A.value.a11y.translations.tableAvailable,caption:A.value.a11y.translations.tableCaption},null,8,[`uid`,`head`,`body`,`notice`,`caption`])):f(``,!0),F.value.buttons.annotator?(_(),Ge(x(qt),Xe({key:1},x(n)(F.value.annotator),{svgRef:x(R),followZoom:F.value?.annotator?.followZoom,annotationViewport:Ui.value,backgroundColor:P.value.backgroundColor,color:P.value.color,active:ii.value,isCursorPointer:Tn.value,palette:F.value.annotatorPalette,onClose:ai}),Ke({_:2},[y(x(r),n=>({name:n,fn:S(r=>[b(e.$slots,n,Qe(Ye(x(t)(n,r))),void 0,!0)])}))]),1040,[`svgRef`,`followZoom`,`annotationViewport`,`backgroundColor`,`color`,`active`,`isCursorPointer`,`palette`])):f(``,!0),Hn.value?(_(),p(`div`,{key:2,ref_key:`noTitle`,ref:fn,class:`vue-data-ui-no-title-space`,style:`height:36px; width: 100%;background:transparent`},null,512)):f(``,!0),P.value.title.text?(_(),p(`div`,{key:3,ref_key:`chartTitle`,ref:cn,style:`width:100%;background:transparent`},[(_(),Ge(Ce,{key:`title_${hn.value}`,config:{title:{cy:`candlestick-div-title`,...P.value.title},subtitle:{cy:`candlestick-div-subtitle`,...P.value.title.subtitle}}},null,8,[`config`]))],512)):f(``,!0),F.value.show&&en.value&&(x(An)||x(On))?(_(),Ge(x(Jt),Xe({ref_key:`userOptionsRef`,ref:yn,key:`user_options_${sn.value}`,backgroundColor:P.value.backgroundColor,color:P.value.color,isImaging:x(zn),isPrinting:x(Rn),uid:E.value,hasTooltip:F.value.buttons.tooltip&&P.value.tooltip.show,isFullscreen:ei.value,isTooltip:V.value.showTooltip,chartElement:O.value},x(Oe)(F.value,`pdf csv img svg table fullscreen altCopy annotator`),{isAnnotation:ii.value,tableDialog:A.value.table.useDialog,isCursorPointer:Tn.value,onToggleFullscreen:ti,onGeneratePdf:x(Bn),onGenerateCsv:Qr,onGenerateImage:x(gi),onGenerateSvg:x(hi),onToggleTable:ni,onToggleTooltip:ri,onToggleAnnotator:ai,onCopyAlt:Li,style:{visibility:x(An)?x(On)?`visible`:`hidden`:`visible`}}),Ke({_:2},[y(x(De)(e.$slots,`menuIcon optionTooltip optionPdf optionCsv optionImg optionSvg optionTable optionFullscreen optionAnnotator optionAltCopy custom-menu-before custom-menu-after`),t=>({name:t,fn:S(n=>[b(e.$slots,t,Qe(Ye(x(ke)(t,n))),void 0,!0)])}))]),1040,[`backgroundColor`,`color`,`isImaging`,`isPrinting`,`uid`,`hasTooltip`,`isFullscreen`,`isTooltip`,`chartElement`,`isAnnotation`,`tableDialog`,`isCursorPointer`,`onGeneratePdf`,`onGenerateImage`,`onGenerateSvg`,`style`])):f(``,!0),m(`div`,dt,[(_(),p(`svg`,{ref_key:`svgRef`,ref:R,xmlns:x(fe),"aria-describedby":`chart-instructions-${E.value}`,class:g({"vue-data-ui-fullscreen--on":ei.value,"vue-data-ui-fulscreen--off":!ei.value,"vue-data-ui-no-transition":!x(wn)||x(H),"vue-ui-candlestick-chart-zoom-pointer-focus":Y.value&&Zn.value}),viewBox:`0 0 ${z.value.width<=0?10:z.value.width} ${z.value.height<=0?10:z.value.height}`,style:$e({maxWidth:`100%`,visibility:x(Wn)?`visible`:`hidden`,overflow:`visible`,background:`transparent`,color:P.value.color,cursor:Y.value?Xn.value?`col-resize`:`crosshair`:void 0,touchAction:Y.value?`pan-y`:void 0,userSelect:Y.value?`none`:void 0}),tabindex:`0`,onFocus:Ri,onBlur:zi,onKeydown:Bi,onPointerdown:Ni,onPointermove:Pi,onPointerup:Fi,onPointercancel:Ei,onClickCapture:Oi},[Je(x(Yt)),b(e.$slots,`svg-underlayer`,{svg:{...z.value,data:Q.value,drawingArea:U.value,isPrintingImg:x(Rn)||x(zn)||x(pi),isPrintingSvg:x(mi)}},void 0,!0),e.$slots[`chart-background`]?(_(),p(`foreignObject`,{key:0,x:U.value.left,y:U.value.top,width:Math.max(.1,U.value.width),height:Math.max(.1,U.value.height),style:{pointerEvents:`none`}},[b(e.$slots,`chart-background`,{},void 0,!0)],8,pt)):f(``,!0),Q.value.length>0?(_(),p(`g`,mt,[m(`defs`,null,[Je(Re,{t:`linear`,id:`bearish_gradient_${E.value}`,x2:`0%`,y2:`100%`,stops:[[`0%`,j.value.colors.bearish,1],[`50%`,x(ne)(j.value.colors.bearish,.02),.87],[`100%`,x(ne)(j.value.colors.bearish,.05),.4]]},null,8,[`id`,`stops`]),Je(Re,{t:`linear`,id:`bullish_gradient_${E.value}`,x2:`0%`,y2:`100%`,stops:[[`0%`,j.value.colors.bullish,1],[`50%`,x(ne)(j.value.colors.bullish,.02),.87],[`100%`,x(ne)(j.value.colors.bullish,.05),.4]]},null,8,[`id`,`stops`])]),M.value.show?(_(),p(`g`,ht,[m(`line`,{x1:qn.value?U.value.right:U.value.left,x2:qn.value?U.value.right:U.value.left,y1:U.value.top,y2:U.value.bottom,stroke:M.value.stroke,"stroke-width":M.value.strokeWidth,"stroke-linecap":`round`},null,8,gt),m(`line`,{x1:U.value.left,x2:U.value.right,y1:U.value.bottom,y2:U.value.bottom,stroke:M.value.stroke,"stroke-width":M.value.strokeWidth,"stroke-linecap":`round`},null,8,_t),M.value.horizontalLines.show?(_(!0),p(u,{key:0},y(wr.value,e=>(_(),p(`line`,{x1:U.value.left,x2:U.value.right,y1:e.y,y2:e.y,stroke:M.value.horizontalLines.stroke,"stroke-width":M.value.horizontalLines.strokeWidth,"stroke-dasharray":M.value.horizontalLines.strokeDasharray,"stroke-linecap":`round`},null,8,vt))),256)):f(``,!0),M.value.verticalLines.show?(_(!0),p(u,{key:1},y(Rr.value,(e,t)=>(_(),p(`g`,null,[e.text?(_(),p(`line`,{key:0,x1:U.value.left+X.value*t+X.value/2,x2:U.value.left+X.value*t+X.value/2,y1:U.value.top,y2:U.value.bottom,stroke:M.value.verticalLines.stroke,"stroke-width":M.value.verticalLines.strokeWidth,"stroke-dasharray":M.value.verticalLines.strokeDasharray,"stroke-linecap":`round`},null,8,yt)):f(``,!0)]))),256)):f(``,!0),M.value.xAxis.ticks.show?(_(!0),p(u,{key:2},y(Rr.value,(e,t)=>(_(),p(`g`,null,[e.text?(_(),p(`line`,{key:0,x1:U.value.left+X.value*t+X.value/2,x2:U.value.left+X.value*t+X.value/2,y1:U.value.bottom,y2:U.value.bottom+3,stroke:M.value.stroke,"stroke-width":M.value.strokeWidth,"stroke-linecap":`round`},null,8,bt)):f(``,!0)]))),256)):f(``,!0)])):f(``,!0),M.value.yAxis.dataLabels.show?(_(),p(`g`,{key:1,ref_key:`scaleLabels`,ref:gn},[(_(!0),p(u,null,y(wr.value,(e,t)=>(_(),p(`g`,{key:`sl_${t}`},[e.value>=Z.value.min&&e.value<=Z.value.max?(_(),p(`line`,{key:0,x1:qn.value?U.value.right:U.value.left,x2:qn.value?U.value.right+5:U.value.left-5,y1:e.y,y2:e.y,stroke:M.value.stroke,"stroke-width":M.value.strokeWidth,"stroke-linecap":`round`},null,8,xt)):f(``,!0),e.value>=Z.value.min&&e.value<=Z.value.max?(_(),p(`text`,{key:1,class:g({"vue-data-ui-transition":x(wn)&&!x(H)}),transform:`translate(${qn.value?U.value.right+8+M.value.yAxis.dataLabels.offsetX:U.value.left-8+M.value.yAxis.dataLabels.offsetX}, ${e.y+z.value.yAxisFontSize/3})`,"text-anchor":qn.value?`start`:`end`,"font-size":z.value.yAxisFontSize,fill:M.value.yAxis.dataLabels.color,"font-weight":M.value.yAxis.dataLabels.bold?`bold`:`normal`},it(x(a)({p:M.value.yAxis.dataLabels.prefix,v:e.value,s:M.value.yAxis.dataLabels.suffix,r:M.value.yAxis.dataLabels.roundingValue})),11,St)):f(``,!0)]))),128))],512)):f(``,!0),M.value.xAxis.dataLabels.show&&!M.value.xAxis.dataLabels.datetimeFormatter.enable?(_(),p(`g`,{key:2,ref_key:`timeLabelsEls`,ref:_n},[(_(!0),p(u,null,y(Tr.value,(e,t)=>(_(),p(`g`,null,[m(`text`,{class:`vue-data-ui-time-label`,transform:`translate(${U.value.left+X.value*t+X.value/2}, ${U.value.bottom+z.value.xAxisFontSize*1.5}), rotate(${M.value.xAxis.dataLabels.rotation})`,"text-anchor":M.value.xAxis.dataLabels.rotation>0?`start`:M.value.xAxis.dataLabels.rotation<0?`end`:`middle`,"font-size":z.value.xAxisFontSize,fill:M.value.xAxis.dataLabels.color,"font-weight":M.value.xAxis.dataLabels.bold?`bold`:`normal`},it(e),9,Ct)]))),256))],512)):f(``,!0),M.value.xAxis.dataLabels.show&&M.value.xAxis.dataLabels.datetimeFormatter.enable?(_(),p(`g`,{key:3,ref_key:`timeLabelsEls`,ref:_n},[(_(!0),p(u,null,y(Rr.value,(e,t)=>(_(),p(`g`,null,[m(`text`,{class:`vue-data-ui-time-label`,transform:`translate(${U.value.left+X.value*t+X.value/2}, ${U.value.bottom+z.value.xAxisFontSize*1.5}), rotate(${M.value.xAxis.dataLabels.rotation})`,"text-anchor":M.value.xAxis.dataLabels.rotation>0?`start`:M.value.xAxis.dataLabels.rotation<0?`end`:`middle`,"font-size":z.value.xAxisFontSize,fill:M.value.xAxis.dataLabels.color,stroke:P.value.backgroundColor,"stroke-width":`3`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"paint-order":`stroke fill`,"font-weight":M.value.xAxis.dataLabels.bold?`bold`:`normal`},it(e?.text??``),9,wt)]))),256))],512)):f(``,!0),A.value.type===`candlestick`?(_(),p(u,{key:4},[m(`g`,null,[(_(!0),p(u,null,y(Q.value,(e,t)=>(_(),p(`g`,null,[m(`rect`,{x:e.open.x-N.value.wick.strokeWidth/2,y:e.high.y,width:N.value.wick.strokeWidth,height:Math.abs(e.high.y-e.low.y),fill:N.value.wick.stroke,stroke:`none`,rx:N.value.wick.strokeWidth/2,class:g({"vue-data-ui-transition":T.value&&!x(I)&&!x(H)})},null,10,Tt),N.value.wick.extremity.shape===`circle`?(_(),p(`g`,Et,[m(`circle`,{cx:e.high.x,cy:e.high.y,r:N.value.wick.extremity.size===`auto`?X.value/20:N.value.wick.extremity.size,fill:N.value.wick.extremity.color,class:g({"vue-data-ui-transition":T.value&&!x(I)&&!x(H)})},null,10,Dt),m(`circle`,{cx:e.low.x,cy:e.low.y,r:N.value.wick.extremity.size===`auto`?X.value/20:N.value.wick.extremity.size,fill:N.value.wick.extremity.color,class:g({"vue-data-ui-transition":T.value&&!x(I)&&!x(H)})},null,10,Ot)])):f(``,!0),N.value.wick.extremity.shape===`line`?(_(),p(`g`,kt,[m(`rect`,{x:e.high.x-(N.value.wick.extremity.size===`auto`?X.value*N.value.candle.widthRatio:N.value.wick.extremity.size)/2,y:e.high.y-N.value.wick.strokeWidth/2,width:Math.abs(e.high.x-(N.value.wick.extremity.size===`auto`?X.value*P.value.layout.candle.widthRatio:P.value.layout.wick.extremity.size)/2-(e.high.x+(P.value.layout.wick.extremity.size===`auto`?X.value*P.value.layout.candle.widthRatio:P.value.layout.wick.extremity.size)/2)),height:N.value.wick.strokeWidth,rx:N.value.wick.strokeWidth/2,fill:N.value.wick.extremity.color,stroke:`none`,class:g({"vue-data-ui-transition":T.value&&!x(I)&&!x(H)})},null,10,At),m(`rect`,{x:e.low.x-(N.value.wick.extremity.size===`auto`?X.value*N.value.candle.widthRatio:N.value.wick.extremity.size)/2,y:e.low.y-N.value.wick.strokeWidth/2,width:Math.abs(e.low.x-(N.value.wick.extremity.size===`auto`?X.value*P.value.layout.candle.widthRatio:P.value.layout.wick.extremity.size)/2-(e.low.x+(P.value.layout.wick.extremity.size===`auto`?X.value*P.value.layout.candle.widthRatio:P.value.layout.wick.extremity.size)/2)),height:N.value.wick.strokeWidth,fill:N.value.wick.extremity.color,stroke:`none`,rx:N.value.wick.strokeWidth/2,class:g({"vue-data-ui-transition":T.value&&!x(I)&&!x(H)})},null,10,jt)])):f(``,!0)]))),256))]),m(`g`,null,[(_(!0),p(u,null,y(Q.value,(e,t)=>(_(),p(`rect`,{x:e.open.x-X.value/2+X.value*(1-j.value.widthRatio)/2,y:e.isBullish?e.close.y:e.open.y,height:Math.abs(e.close.y-e.open.y)<=0?1e-4:Math.abs(e.close.y-e.open.y),width:X.value*j.value.widthRatio<=0?1e-4:X.value*j.value.widthRatio,fill:j.value.gradient.underlayer,rx:j.value.borderRadius,stroke:`none`,class:g({"vue-data-ui-transition":T.value&&!x(I)&&!x(H)})},null,10,Mt))),256)),(_(!0),p(u,null,y(Q.value,(e,t)=>(_(),p(`rect`,{x:e.open.x-X.value/2+X.value*(1-j.value.widthRatio)/2,y:e.isBullish?e.close.y:e.open.y,height:Math.abs(e.close.y-e.open.y)<=0?1e-4:Math.abs(e.close.y-e.open.y),width:X.value*j.value.widthRatio<=0?1e-4:X.value*j.value.widthRatio,fill:e.isBullish?j.value.gradient.show?`url(#bullish_gradient_${E.value})`:j.value.colors.bullish:j.value.gradient.show?`url(#bearish_gradient_${E.value})`:j.value.colors.bearish,rx:j.value.borderRadius,stroke:j.value.stroke,"stroke-width":j.value.strokeWidth,"stroke-linecap":`round`,"stroke-linejoin":`round`,class:g({"vue-data-ui-transition":T.value&&!x(I)&&!x(H)})},null,10,Nt))),256))])],64)):f(``,!0),A.value.type===`ohlc`?(_(!0),p(u,{key:5},y(Q.value,(e,t)=>(_(),p(`g`,{key:`ohlc_${e.absoluteIndex}`},[m(`path`,{d:`M ${e.high.x},${e.high.y} ${e.low.x},${e.low.y} M${e.open.x-Math.min(6,X.value/3)},${e.open.y} ${e.open.x},${e.open.y} M${e.close.x},${e.close.y} ${e.close.x+Math.min(6,X.value/3)},${e.close.y}`,stroke:e.isBullish?j.value.colors.bullish:j.value.colors.bearish,"stroke-width":1,class:g({"vue-data-ui-transition":x(wn)&&!x(H)}),"stroke-linecap":`round`,"stroke-linejoin":`round`},null,10,Pt)]))),128)):f(``,!0),m(`g`,null,[(_(!0),p(u,null,y(Q.value,(e,t)=>(_(),p(`rect`,{x:U.value.left+t*X.value,y:U.value.top,height:U.value.height<=0?1e-4:U.value.height,width:X.value<=0?1e-4:X.value,fill:D.value===t||bn.value===t?x(ee)(N.value.selector.color,N.value.selector.opacity):`transparent`,onMouseover:()=>Ur(t,e,`pointer`),onMouseleave:()=>Hr(t,e),onClick:()=>Vr(t,e)},null,40,Ft))),256))])])):f(``,!0),Si.value?(_(),p(`rect`,{key:2,x:Si.value.x,y:Si.value.y,width:Si.value.width,height:Si.value.height,fill:tr.value.selection.fill,"fill-opacity":tr.value.selection.fillOpacity,stroke:tr.value.selection.stroke,"stroke-opacity":tr.value.selection.strokeOpacity,"stroke-width":tr.value.selection.strokeWidth,"stroke-dasharray":tr.value.selection.strokeDasharray,"stroke-linecap":`round`,"stroke-linejoin":`round`,"pointer-events":`none`},null,8,It)):f(``,!0),ir.value?(_(),p(`rect`,Xe({key:3},Yn.value,{"data-start":G.value.start,"data-end":G.value.end}),null,16,Lt)):f(``,!0),b(e.$slots,`svg`,{svg:{...z.value,data:Q.value,drawingArea:U.value,isPrintingImg:x(Rn)||x(zn)||x(pi),isPrintingSvg:x(mi)}},void 0,!0)],46,ft)),e.$slots.hint?(_(),p(`div`,Rt,[b(e.$slots,`hint`,Qe(Ye({hint:A.value.a11y.translations.keyboardNavigation,isVisible:Cn.value})),void 0,!0)])):f(``,!0)]),e.$slots.watermark?(_(),p(`div`,zt,[b(e.$slots,`watermark`,Qe(Ye({isPrinting:x(Rn)||x(zn)||x(pi)||x(mi)})),void 0,!0)])):f(``,!0),P.value.zoom.show&&W.value>6&&en.value&&Jr.value?(_(),Ge(ze,{key:6,ref_key:`chartSlicer`,ref:un,"data-dom-to-png-ignore-layout":``,allMinimaps:Sr.value,background:P.value.zoom.color,borderColor:P.value.backgroundColor,customFormat:P.value.zoom.customFormat,cutNullValues:!1,enableRangeHandles:P.value.zoom.enableRangeHandles,enableSelectionDrag:P.value.zoom.enableSelectionDrag,end:G.value.end,focusOnDrag:P.value.zoom.focusOnDrag,focusRangeRatio:P.value.zoom.focusRangeRatio,fontSize:P.value.zoom.fontSize,immediate:!P.value.zoom.preview.enable,inputColor:P.value.zoom.color,isPreview:ir.value,labelLeft:zr.value.start||``,labelRight:zr.value.end||``,max:W.value,min:0,minimap:P.value.zoom.minimap.show?x(L).map(e=>e[2]):[],minimapCompact:P.value.zoom.minimap.compact,minimapFrameColor:P.value.zoom.minimap.frameColor,minimapIndicatorColor:P.value.zoom.minimap.indicatorColor,minimapMerged:!1,minimapSelectedColor:P.value.zoom.minimap.selectedColor,minimapSelectedColorOpacity:P.value.zoom.minimap.selectedColorOpacity,minimapSelectedIndex:D.value,minimapSelectionRadius:1,preciseLabels:Pr.value,refreshEndPoint:P.value.zoom.endIndex===null?W.value:P.value.zoom.endIndex+1,refreshStartPoint:P.value.zoom.startIndex===null?0:P.value.zoom.startIndex,selectColor:P.value.zoom.highlightColor,selectedSeries:x(L),smoothMinimap:!1,start:G.value.start,textColor:P.value.color,timeLabels:Dr.value,usePreciseLabels:M.value.xAxis.dataLabels.datetimeFormatter.enable&&!P.value.zoom.useDefaultFormat,useResetSlot:P.value.zoom.useResetSlot,valueEnd:G.value.end,valueStart:G.value.start,verticalHandles:P.value.zoom.minimap.verticalHandles,minScale:M.value.yAxis.scale.min,maxScale:M.value.yAxis.scale.max,maxWidth:P.value.zoom.maxWidth,minimapLeftInsetRatio:z.value.width>0&&P.value.zoom.autoFit?U.value.left/z.value.width:null,minimapRightInsetRatio:z.value.width>0&&P.value.zoom.autoFit?(z.value.width-U.value.right)/z.value.width:null,additionalMinimapHeight:P.value.zoom.minimap.additionalHeight,handleType:P.value.zoom.minimap.handleType,handleIconColor:P.value.zoom.minimap.handleIconColor,handleBorderWidth:P.value.zoom.minimap.handleBorderWidth,handleBorderColor:P.value.zoom.minimap.handleBorderColor,handleFill:P.value.zoom.minimap.handleFill,handleWidth:P.value.zoom.minimap.handleWidth,"onUpdate:end":bi,"onUpdate:start":yi,onTrapMouse:_i,onReset:i[0]||=()=>Kr({force:!0,publish:!0}),onFutureEnd:i[1]||=e=>ar(`end`,e),onFutureStart:i[2]||=e=>ar(`start`,e)},{"reset-action":S(({reset:t})=>[b(e.$slots,`reset-action`,Qe(Ye({reset:t})),void 0,!0)]),slotMap:S(({height:e,unitW:t})=>[(_(!0),p(u,null,y(xr.value({minimapH:e,unitW:t}),(e,n)=>(_(),p(`g`,null,[m(`path`,{d:`M ${e.high.x},${e.high.y} ${e.low.x},${e.low.y}`,stroke:e.isBullish?j.value.colors.bullish:j.value.colors.bearish,"stroke-width":1,style:$e({opacity:n>=K.value.start&&n<=K.value.end?1:.6})},null,12,Bt),m(`path`,{d:`M ${e.open.x},${e.open.y} ${e.close.x},${e.close.y}`,stroke:e.isBullish?j.value.colors.bullish:j.value.colors.bearish,"stroke-width":Math.min(6,t/1.5),style:$e({opacity:n>=K.value.start&&n<=K.value.end?1:.6})},null,12,Vt)]))),256))]),_:3},8,/* @__PURE__ */ `allMinimaps.background.borderColor.customFormat.enableRangeHandles.enableSelectionDrag.end.focusOnDrag.focusRangeRatio.fontSize.immediate.inputColor.isPreview.labelLeft.labelRight.max.minimap.minimapCompact.minimapFrameColor.minimapIndicatorColor.minimapSelectedColor.minimapSelectedColorOpacity.minimapSelectedIndex.preciseLabels.refreshEndPoint.refreshStartPoint.selectColor.selectedSeries.start.textColor.timeLabels.usePreciseLabels.useResetSlot.valueEnd.valueStart.verticalHandles.minScale.maxScale.maxWidth.minimapLeftInsetRatio.minimapRightInsetRatio.additionalMinimapHeight.handleType.handleIconColor.handleBorderWidth.handleBorderColor.handleFill.handleWidth`.split(`.`))):f(``,!0),m(`div`,{ref_key:`chartLegend`,ref:ln},[b(e.$slots,`legend`,{legend:Q.value},void 0,!0)],512),e.$slots.source?(_(),p(`div`,{key:7,ref_key:`source`,ref:dn,dir:`auto`},[b(e.$slots,`source`,{},void 0,!0)],512)):f(``,!0),Je(x(Wt),{teleportTo:P.value.tooltip.teleportTo,show:V.value.showTooltip&&an.value,backgroundColor:P.value.tooltip.backgroundColor,color:P.value.tooltip.color,borderRadius:P.value.tooltip.borderRadius,borderColor:P.value.tooltip.borderColor,borderWidth:P.value.tooltip.borderWidth,fontSize:P.value.tooltip.fontSize,backgroundOpacity:P.value.tooltip.backgroundOpacity,position:P.value.tooltip.position,offsetX:P.value.tooltip.offsetX,offsetY:P.value.tooltip.offsetY,parent:O.value,content:on.value,isFullscreen:ei.value,isCustom:P.value.tooltip.customFormat&&typeof P.value.tooltip.customFormat==`function`,smooth:P.value.tooltip.smooth,backdropFilter:P.value.tooltip.backdropFilter,smoothForce:P.value.tooltip.smoothForce,smoothSnapThreshold:P.value.tooltip.smoothSnapThreshold,isA11yMode:Sn.value===`keyboard`,a11yPosition:xn.value},{"tooltip-before":S(()=>[b(e.$slots,`tooltip-before`,Qe(Ye({...Br.value})),void 0,!0)]),tooltip:S(()=>[b(e.$slots,`tooltip`,Qe(Ye({...Br.value})),void 0,!0)]),"tooltip-after":S(()=>[b(e.$slots,`tooltip-after`,Qe(Ye({...Br.value})),void 0,!0)]),_:3},8,[`teleportTo`,`show`,`backgroundColor`,`color`,`borderRadius`,`borderColor`,`borderWidth`,`fontSize`,`backgroundOpacity`,`position`,`offsetX`,`offsetY`,`parent`,`content`,`isFullscreen`,`isCustom`,`smooth`,`backdropFilter`,`smoothForce`,`smoothSnapThreshold`,`isA11yMode`,`a11yPosition`]),en.value&&F.value.buttons.table?(_(),Ge(nt(li.value.component),Xe({key:8},li.value.props,{ref_key:`tableUnit`,ref:vn,onClose:ui}),Ke({content:S(()=>[(_(),Ge(x(Kt),{key:`table_${mn.value}`,colNames:$r.value.colNames,head:$r.value.head,body:$r.value.body,config:$r.value.config,title:A.value.table.useDialog?``:li.value.title,withCloseButton:!A.value.table.useDialog,isCursorPointer:Tn.value,onClose:ui},{th:S(({th:e})=>[qe(it(e),1)]),td:S(({td:e})=>[m(`div`,{innerHTML:e},null,8,Ht)]),_:1},8,[`colNames`,`head`,`body`,`config`,`title`,`withCloseButton`,`isCursorPointer`]))]),_:2},[A.value.table.useDialog?{name:`title`,fn:S(()=>[qe(it(li.value.title),1)]),key:`0`}:void 0,A.value.table.useDialog?{name:`actions`,fn:S(()=>[m(`button`,{tabindex:`0`,class:`vue-ui-user-options-button`,onClick:i[3]||=e=>Qr(F.value.callbacks.csv),style:$e({cursor:Tn.value?`pointer`:`default`})},[Je(x(Ut),{name:`fileCsv`,stroke:li.value.props.color},null,8,[`stroke`])],4)]),key:`1`}:void 0]),1040)):f(``,!0),b(e.$slots,`skeleton`,{},()=>[x(I)?(_(),Ge(ge,{key:0})):f(``,!0)],!0)],46,lt))}},[[`__scopeId`,`data-v-73f6d497`]]);export{ct as n,Ut as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{t}from"./useConfig-C3FbHv4N.js";import{D as n,Jt as ee,X as r,at as i,nt as te,zt as a}from"./lib-rPeBMZrn.js";import{n as ne,t as re}from"./useHints-C-TwxM0Y.js";import{t as o}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{t as ie}from"./useNestedProp-DnGoh-XS.js";import{n as ae,r as oe,t as se}from"./userOptionsSlots-CWtXN5Q6.js";import{t as ce}from"./usePrinter-DVf3YcG5.js";import{t as le}from"./useUserOptionState-CXlFnwPv.js";import{t as ue}from"./usePrefersMotion-XLHwega2.js";import{Fragment as s,computed as c,createBlock as de,createCommentVNode as l,createElementBlock as u,createElementVNode as d,createSlots as fe,createTextVNode as f,defineAsyncComponent as pe,guardReactiveProps as me,mergeProps as p,nextTick as he,normalizeClass as ge,normalizeProps as _e,normalizeStyle as m,onBeforeUnmount as h,onMounted as g,openBlock as _,ref as v,renderList as y,renderSlot as b,shallowRef as ve,toDisplayString as x,unref as S,useSlots as ye,watch as C,withCtx as be}from"vue";var xe=/* @__PURE__ */ e({default:()=>w}),Se=[`id`],Ce=[`aria-labelledby`],we=[`id`],Te=[`height`],Ee=[`id`],De=[`data-cell`,`aria-label`,`height`],Oe={key:2,ref:`source`,dir:`auto`},w=/*#__PURE__*/ o({__name:`vue-ui-carousel-table`,props:{config:{type:Object,default(){return{}}},dataset:{type:Object,default(){return{}}}},emits:[`copyAlt`],setup(e,{expose:o,emit:xe}){let w=pe(()=>import(`./vue-ui-skeleton-SlYTmirP.js`).then(e=>e.n)),ke=pe(()=>import(`./UserOptions-B9EyfU9n.js`).then(e=>e.n)),{vue_ui_carousel_table:Ae}=t(),T=ue(),E=e,je=xe,D=v(r()),O=v(!1),k=v(!!E.dataset),Me=ye();g(()=>{Ne()});let A=c({get:()=>Le(),set:e=>e}),j=c(()=>A.value.debug);g(()=>{Me[`chart-background`]&&j.value&&console.warn(`VueUiCarouselTable does not support the #chart-background slot.`)});function Ne(){a(E.dataset)?i({componentName:`VueUiCarouselTable`,type:`dataset`,debug:j.value}):((!E.dataset.head||a(E.dataset.head))&&(i({componentName:`VueUiCarouselTable`,type:`datasetAttribute`,property:`head`,debug:j.value}),k.value=!1),(!E.dataset.body||a(E.dataset.body))&&(i({componentName:`VueUiCarouselTable`,type:`datasetAttribute`,property:`body`,debug:j.value}),k.value=!1)),T.value&&(A.value.userOptions.buttons.animation=!1)}ne({config:()=>A.value,dataset:()=>E.dataset,component:`VueUiCarouselTable`,rules:[re.noHint]});let Pe=c(()=>A.value.userOptions.useCursorPointer),{userOptionsVisible:M,setUserOptionsVisibility:Fe,keepUserOptionState:Ie}=le({config:A.value});function Le(){return ie({userConfig:E.config,defaultConfig:Ae})}C(()=>E.config,e=>{A.value=Le(),M.value=!A.value.userOptions.showOnChartHover,Ne()},{deep:!0}),C(()=>E.dataset,e=>{U()},{deep:!0});let{isPrinting:Re,isImaging:ze,generatePdf:Be,generateImage:Ve}=ce({elementId:`carousel-table_${D.value}`,fileName:A.value.caption.text||`vue-ui-carousel-table`,options:A.value.userOptions.print}),N=v({showAnimation:A.value.animation.use}),P=v(null),He=v(null),F=v(null),I=v(null),L=v(0),R=v(0),z=v(!1),B=v(null),V=v(null),H=v(0);function U(){B.value&&(V.value={elements:B.value.getElementsByTagName(`tr`),heights:Array.from(B.value.getElementsByTagName(`tr`)).map(e=>e.getBoundingClientRect().height)})}g(U);let Ue=c(()=>!V.value||!V.value.heights.length?0:Math.max(...V.value.heights)+L.value+R.value),We=c(()=>E.dataset.body?A.value.tbody.tr.visible<=E.dataset.body.length?A.value.tbody.tr.visible:E.dataset.body.length:0),Ge=c(()=>(A.value.tbody.tr.height+A.value.tbody.tr.td.padding.top+A.value.tbody.tr.td.padding.bottom+A.value.tbody.tr.border.size*2)*We.value+L.value+R.value),W=v(0),G=v(null),K=v(0),q=v(!1),Ke=v(0);g(()=>{F.value&&(L.value=F.value.getBoundingClientRect().height),I.value&&(R.value=I.value.getBoundingClientRect().height),N.value.showAnimation&&V.value&&Je()}),g(()=>{if(P.value){let e=P.value.querySelector(`thead`),t=Array.from(B.value.querySelectorAll(`tr`));function n(){let n=e.getBoundingClientRect().bottom;t.forEach(e=>{e.getBoundingClientRect().top<n?e.style.visibility=`hidden`:e.style.visibility=`visible`})}P.value.addEventListener(`scroll`,n),n(),h(()=>{P.value.removeEventListener(`scroll`,n)})}});function qe(e){O.value=e,Ke.value+=1}function Je(){T.value||!G.value&&!q.value&&(A.value.animation.type===`scroll`?G.value=requestAnimationFrame(J):G.value=requestAnimationFrame(Xe))}function Ye(){if(!P.value)return!1;let{scrollTop:e,scrollHeight:t,clientHeight:n}=P.value;return e+n>=t}function J(e){q.value||(K.value||=e,e-K.value>=A.value.animation.speedMs&&(W.value+=V.value.heights[H.value],(Ye()||H.value>=V.value.heights.length)&&(W.value=0,H.value=-1),H.value+=1,P.value&&P.value.scrollTo({top:W.value,behavior:`smooth`}),K.value=e),G.value=requestAnimationFrame(J))}function Xe(e){if(q.value)return;K.value||=e;let t=e-K.value,n=A.value.animation.speedMs/4/1e3;t>=n&&(W.value+=n,W.value>=P.value.scrollHeight-P.value.clientHeight&&(W.value=0),P.value&&P.value.scrollTo({top:W.value,behavior:`auto`}),K.value=e),G.value=requestAnimationFrame(Xe)}function Y(){q.value=!0,cancelAnimationFrame(G.value),G.value=null}h(Y);function X(){q.value&&N.value.showAnimation&&(q.value=!1,K.value=0,Je())}function Ze(){A.value.animation.pauseOnHover&&Y()}let Z=v(null);function Qe(){Y(),clearTimeout(Z.value)}function $e(){clearTimeout(Z.value),Z.value=setTimeout(X,1e3)}C(()=>A.value.animation.use,e=>{e?(N.value.showAnimation=!0,X()):(N.value.showAnimation=!1,Y())}),C(()=>A.value.animation.type,e=>{Y(),W.value=0,H.value=0,P.value.scrollTo({top:0,behavior:`auto`}),X()});let et=c(()=>A.value.responsiveBreakpoint),Q=ve(null);g(()=>{Q.value=new ResizeObserver(e=>{e.forEach(e=>{z.value=e.contentRect.width<et.value}),L.value=F.value?F.value.getBoundingClientRect().height:0,R.value=I.value?I.value.getBoundingClientRect().height:0,H.value=0,he(()=>{Y(),K.value=0,W.value=0,U(),X()})}),P.value&&Q.value.observe(P.value)}),h(()=>{Q.value&&Q.value.disconnect()});function tt(){Be()}function nt(){N.value.showAnimation=!N.value.showAnimation,N.value.showAnimation?X():Y()}function rt(e=null){he(()=>{let t=E.dataset.head.map((e,t)=>[[E.dataset.body[t]]]),ee=[[A.value.caption.text],[E.dataset.head.map(e=>[e])]].concat(t),r=n(ee);e?e(r):te({csvContent:r,title:A.value.caption.text||`vue-ui-carousel-table`})})}async function $(){je(`copyAlt`,{config:A.value,dataset:E.dataset}),A.value.userOptions.callbacks.altCopy?await Promise.resolve(A.value.userOptions.callbacks.altCopy({config:A.value,dataset:E.dataset})):console.warn("Vue Data UI - A callback must be set for `altCopy` in userOptions.")}return o({pauseAnimation:Y,resumeAnimation:X,toggleAnimation:nt,generateCsv:rt,generatePdf:tt,generateImage:Ve,copyAlt:$}),(t,n)=>(_(),u(`div`,{class:`vue-data-ui-component vue-ui-carousel-table`,style:{position:`relative`,overflow:`visible`},ref_key:`chartContainer`,ref:He,onMouseenter:n[5]||=()=>S(Fe)(!0),onMouseleave:n[6]||=()=>S(Fe)(!1)},[d(`div`,{ref_key:`tableContainer`,ref:P,id:`carousel-table_${D.value}`,style:m({height:S(Re)||S(ze)?`auto`:`${Math.max(Ge.value,Ue.value)}px`,containerType:`inline-size`,position:`relative`,overflow:`auto`,fontFamily:A.value.fontFamily}),class:ge({"vue-ui-responsive":z.value,"is-playing":A.value.scrollbar.hide||!q.value&&A.value.scrollbar.showOnlyOnHover}),onMouseover:n[0]||=e=>Ze(),onMouseleave:n[1]||=e=>X(),onTouchstart:n[2]||=e=>Qe(),onTouchend:n[3]||=e=>$e(),onTouchcancel:n[4]||=e=>$e()},[k.value?(_(),u(`table`,{key:0,class:`vue-data-ui-carousel-table`,"aria-labelledby":`carousel-caption-${D.value}`,style:m({...A.value.style,border:`${A.value.border.size}px solid ${A.value.border.color}`,width:`100%`,borderCollapse:`collapse`,backgroundColor:A.value.tbody.backgroundColor})},[d(`caption`,{ref_key:`caption`,ref:F,class:`vue-data-ui-carousel-table-caption`,id:`carousel-caption-${D.value}`,style:m({...A.value.caption.style,fontFamily:`inherit`,position:`sticky`,top:0,zIndex:2,paddingTop:A.value.caption.padding.top+`px`,paddingRight:A.value.caption.padding.right+`px`,paddingBottom:A.value.caption.padding.bottom+`px`,paddingLeft:A.value.caption.padding.left+`px`,boxShadow:z.value?A.value.thead.tr.style.boxShadow:`none`,minHeight:`36px`,display:t.$slots.caption||A.value.caption.text||A.value.userOptions.show?``:`none`})},[f(x(A.value.caption.text&&!t.$slots.caption?A.value.caption.text:``)+` `,1),b(t.$slots,`caption`,{},void 0,!0)],12,we),d(`thead`,{role:`rowgroup`,style:m({...A.value.thead.style,position:`sticky`,top:`${t.$slots.caption||A.value.caption.text||A.value.userOptions.show?L.value:0}px`,zIndex:1})},[d(`tr`,{ref_key:`tableRow`,ref:I,role:`row`,style:m({...A.value.thead.tr.style,border:A.value.thead.tr.border.size?`${A.value.thead.tr.border.size}px solid ${A.value.thead.tr.border.color}`:`none`,boxShadow:z.value?`none`:A.value.thead.tr.style.boxShadow}),height:`${A.value.thead.tr.height}px`},[(_(!0),u(s,null,y(e.dataset.head,(e,n)=>(_(),u(`th`,{role:`cell`,key:`th_${n}`,id:`col-${n}`,scope:`col`,style:m({...A.value.thead.tr.th.style,border:A.value.thead.tr.th.border.size?`${A.value.thead.tr.th.border.size}px solid ${A.value.thead.tr.th.border.color}`:`none`,paddingTop:A.value.thead.tr.th.padding.top+`px`,paddingRight:A.value.thead.tr.th.padding.right+`px`,paddingBottom:A.value.thead.tr.th.padding.bottom+`px`,paddingLeft:A.value.thead.tr.th.padding.left+`px`})},[f(x(t.$slots.th?``:e)+` `,1),b(t.$slots,`th`,p({ref_for:!0},{th:e,colIndex:n}),void 0,!0)],12,Ee))),128))],12,Te)],4),e.dataset.body&&e.dataset.head?(_(),u(`tbody`,{key:0,ref_key:`tbody`,ref:B,"aria-live":`polite`,style:{clipPath:`inset(0,0,0,0)`}},[(_(!0),u(s,null,y(e.dataset.body,(n,r)=>(_(),u(`tr`,{style:m({...A.value.tbody.tr.style,border:`${A.value.tbody.tr.border.size}px solid ${A.value.tbody.tr.border.color}`,verticalAlign:`middle`})},[(_(!0),u(s,null,y(n,(n,i)=>(_(),u(`td`,{role:`cell`,"data-cell":e.dataset.head[i]||``,"aria-label":`${e.dataset.head[i]}: ${n}`,style:m({...A.value.tbody.tr.td.style,border:`${A.value.tbody.tr.td.border.size}px solid ${A.value.tbody.tr.td.border.color}`,backgroundColor:S(ee)(A.value.tbody.tr.td.style.backgroundColor,r%2==0&&A.value.tbody.tr.td.alternateColor?A.value.tbody.tr.td.alternateOpacity*100:100),paddingTop:A.value.tbody.tr.td.padding.top+`px`,paddingRight:A.value.tbody.tr.td.padding.right+`px`,paddingBottom:A.value.tbody.tr.td.padding.bottom+`px`,paddingLeft:A.value.tbody.tr.td.padding.left+`px`,verticalAlign:`middle`}),height:`${A.value.tbody.tr.height}px`},[f(x(t.$slots.td?``:n)+` `,1),b(t.$slots,`td`,p({ref_for:!0},{td:n,rowIndex:r,colIndex:i}),void 0,!0)],12,De))),256))],4))),256))],512)):l(``,!0)],12,Ce)):l(``,!0)],46,Se),k.value?l(``,!0):(_(),de(S(w),{key:0,config:{type:`table`}})),A.value.userOptions.show&&k.value&&(S(Ie)||S(M))?(_(),de(S(ke),p({ref:`details`,key:`user_option_${Ke.value}`,backgroundColor:A.value.style.backgroundColor,color:A.value.style.color,isPrinting:S(Re),isImaging:S(ze),uid:D.value,hasTooltip:!1,hasTable:!1,hasLabel:!1,isAnimation:!N.value.showAnimation,isFullscreen:O.value,chartElement:He.value},S(oe)(A.value.userOptions,`pdf csv img fullscreen altCopy animation`),{zIndex:3,offsetX:12,isCursorPointer:Pe.value,onGeneratePdf:tt,onGenerateCsv:rt,onGenerateImage:S(Ve),onToggleAnimation:nt,onToggleFullscreen:qe,onCopyAlt:$,style:{visibility:S(Ie)?S(M)?`visible`:`hidden`:`visible`}}),fe({_:2},[y(S(ae)(t.$slots,`menuIcon optionPdf optionCsv optionImg optionSvg optionAnimation optionFullscreen optionAltCopy custom-menu-before custom-menu-after`),e=>({name:e,fn:be(n=>[b(t.$slots,e,_e(me(S(se)(e,n))),void 0,!0)])}))]),1040,[`backgroundColor`,`color`,`isPrinting`,`isImaging`,`uid`,`isAnimation`,`isFullscreen`,`chartElement`,`isCursorPointer`,`onGenerateImage`,`style`])):l(``,!0),t.$slots.source?(_(),u(`div`,Oe,[b(t.$slots,`source`,{},void 0,!0)],512)):l(``,!0)],544))}},[[`__scopeId`,`data-v-c9c4bcb2`]]);export{xe as n,w as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{n as t,r as n,t as r}from"./annotationSlots-OLiW25XN.js";import{t as i}from"./useConfig-C3FbHv4N.js";import{$ as a,D as o,Ht as s,It as ee,Jt as c,S as te,X as ne,Yt as re,at as ie,f as l,h as ae,i as u,in as oe,nt as se,p as ce,r as le,t as ue,w as de,yt as fe,zt as pe}from"./lib-rPeBMZrn.js";import{n as me,t as he}from"./BaseScanner-8NdoBs7B.js";import{n as ge,t as _e}from"./useHints-C-TwxM0Y.js";import{t as ve}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{n as ye}from"./resolveChartConfig-CIhClE5R.js";import{t as be}from"./img-D4RQwASc.js";import{t as xe}from"./useChartExport-BZts4KFb.js";import{t as Se}from"./tableIntegration-CNoJ1CIY.js";import{n as Ce,r as we,t as Te}from"./userOptionsSlots-CWtXN5Q6.js";import{t as Ee}from"./usePrinter-DVf3YcG5.js";import{t as De}from"./DefGrad-DKMq1REY.js";import{t as Oe}from"./A11yDataTable-DWNlWXzs.js";import{t as ke}from"./useUserOptionState-CXlFnwPv.js";import{t as Ae}from"./useChartAccessibility-DOMuYJfm.js";import{t as je}from"./useTableResponsive-uSz_qZOB.js";import{t as Me}from"./vue_ui_chestnut-BxxivKN7.js";import{Fragment as d,computed as f,createBlock as Ne,createCommentVNode as p,createElementBlock as m,createElementVNode as h,createSlots as Pe,createTextVNode as Fe,createVNode as Ie,defineAsyncComponent as Le,guardReactiveProps as Re,mergeProps as ze,nextTick as Be,normalizeClass as g,normalizeProps as Ve,normalizeStyle as _,onMounted as He,openBlock as v,ref as y,renderList as b,renderSlot as x,resolveDynamicComponent as Ue,toDisplayString as S,toRefs as We,unref as C,useCssVars as Ge,watch as Ke,withCtx as qe,withKeys as Je}from"vue";var Ye=/* @__PURE__ */ e({default:()=>Vn}),Xe=[`id`],Ze=[`id`],Qe={"aria-live":`polite`,class:`sr-only`},$e={key:2,ref:`noTitle`,class:`vue-data-ui-no-title-space`,style:`height:36px; width: 100%;background:transparent`},et={style:{position:`relative`}},tt=[`xmlns`,`aria-describedby`,`viewBox`],nt=[`width`,`height`],rt={key:1},it=[`fill`,`font-weight`,`font-size`,`x`,`y`],at=[`fill`,`font-weight`,`font-size`,`x`,`y`],ot={key:2},st=[`x`,`y`,`font-size`,`font-weight`,`fill`],ct=[`x`,`y`,`font-size`,`font-weight`,`fill`],lt=[`d`,`stroke`,`fill`],ut=[`cx`,`cy`,`r`,`fill`],dt=[`aria-label`,`cx`,`cy`,`r`,`fill`,`stroke`,`stroke-width`,`onClick`],ft={key:3},pt=[`x`,`y`,`font-size`,`fill`,`onClick`],mt={key:0},ht=[`x`,`y`,`fill`,`font-size`,`font-weight`],gt=[`x`,`y`,`height`,`width`,`fill`,`rx`,`onClick`],_t=[`aria-label`,`x`,`y`,`height`,`width`,`fill`,`rx`,`stroke`,`stroke-width`,`onClick`],vt={key:4},yt=[`x`,`y`,`fill`,`font-size`,`onClick`],bt=[`d`,`stroke`],xt=[`aria-label`,`fill`,`cx`,`cy`,`r`,`onClick`],St={key:5},Ct=[`x`,`y`,`font-size`,`font-weight`,`fill`],wt=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`],Tt=[`y`,`height`,`width`],Et={style:{width:`100%`,height:`100%`,display:`flex`,"align-items":`center`,"justify-content":`center`,"flex-direction":`column`}},Dt={style:{display:`flex`,"align-items":`center`,"justify-content":`center`,gap:`12px`,"flex-wrap":`wrap`,"flex-direction":`row`}},Ot={viewBox:`0 0 20 20`,height:`16`,width:`16`},kt=[`fill`],At={key:7},jt=[`y`,`height`,`width`],Mt={style:{width:`100%`,height:`100%`,display:`flex`,"align-items":`center`,"justify-content":`center`,"flex-direction":`column`}},Nt={style:{display:`flex`,"align-items":`center`,"justify-content":`center`,gap:`12px`,"flex-wrap":`wrap`,"flex-direction":`row`}},Pt={viewBox:`0 0 20 20`,height:`16`,width:`16`},Ft=[`fill`],It=[`cx`,`cy`,`fill`],Lt=[`d`,`stroke`],Rt=[`cx`,`cy`,`fill`],zt=[`d`,`stroke`],Bt=[`cx`,`cy`,`fill`],Vt=[`cx`,`cy`,`fill`],Ht=[`x`,`y`,`fill`,`font-size`,`font-weight`],Ut=[`x`,`y`,`fill`,`font-size`,`font-weight`],Wt=[`x`,`text-anchor`,`y`,`fill`,`font-size`],Gt=[`x`,`text-anchor`,`y`,`fill`,`font-size`],Kt=[`x`,`text-anchor`,`y`,`fill`,`font-size`],qt=[`x`,`text-anchor`,`y`,`fill`,`font-size`],Jt=[`x`,`text-anchor`,`y`,`fill`,`font-size`],Yt=[`x`,`y`,`font-size`,`fill`],Xt=[`x`,`y`,`font-size`,`fill`],Zt=[`x`,`y`,`font-size`,`fill`],Qt={key:4,class:`vue-data-ui-watermark`},$t={key:5,ref:`source`,dir:`auto`},en={class:`vue-ui-data-table`},tn={key:0},nn=[`data-cell`],rn={style:{display:`flex`,"align-items":`center`,gap:`5px`,"justify-content":`flex-end`,width:`100%`,"padding-right":`3px`}},an={key:0},on={key:1},sn=[`data-cell`],cn={style:{display:`flex`,"align-items":`center`,gap:`5px`,"justify-content":`flex-end`,width:`100%`,"padding-right":`3px`}},ln={key:0},un={key:1},dn=[`data-cell`],fn={style:{display:`flex`,"align-items":`center`,gap:`5px`,"justify-content":`flex-end`,width:`100%`,"padding-right":`3px`}},pn={key:0},mn={key:1},hn=[`data-cell`],gn={style:{display:`flex`,"align-items":`center`,gap:`5px`,"justify-content":`flex-end`,width:`100%`,"padding-right":`3px`}},_n={key:0},vn={key:1},yn=[`data-cell`],bn={style:{display:`flex`,"align-items":`center`,gap:`5px`,"justify-content":`flex-end`,width:`100%`,"padding-right":`3px`}},xn={key:0},Sn={key:1},Cn=[`data-cell`],wn={style:{display:`flex`,"align-items":`center`,gap:`5px`,"justify-content":`flex-end`,width:`100%`,"padding-right":`3px`}},Tn={key:0},En={key:1},Dn=[`data-cell`],On={style:{display:`flex`,"align-items":`center`,gap:`5px`,"justify-content":`flex-end`,width:`100%`,"padding-right":`3px`}},kn={key:0},An={key:1},jn=[`data-cell`],Mn={style:{display:`flex`,"align-items":`center`,gap:`5px`,"justify-content":`flex-end`,width:`100%`,"padding-right":`3px`}},Nn=[`data-cell`],Pn={style:{display:`flex`,"align-items":`center`,gap:`5px`,"justify-content":`flex-end`,width:`100%`,"padding-right":`3px`}},Fn=[`data-cell`],In={style:{display:`flex`,"align-items":`center`,gap:`5px`,"justify-content":`flex-end`,width:`100%`,"padding-right":`3px`}},Ln=[`data-cell`],Rn={style:{display:`flex`,"align-items":`center`,gap:`5px`,"justify-content":`flex-end`,width:`100%`,"padding-right":`3px`}},zn=[`data-cell`],Bn={style:{display:`flex`,"align-items":`center`,gap:`5px`,"justify-content":`flex-end`,width:`100%`,"padding-right":`3px`}},Vn=/*#__PURE__*/ ve({__name:`vue-ui-chestnut`,props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:[`selectRoot`,`selectBranch`,`selectNut`,`copyAlt`],setup(e,{expose:ve,emit:Ye}){Ge(e=>({v45e1a30d:e.tdo}));let Vn=Le(()=>import(`./BaseIcon-CoY0vuL3.js`).then(e=>e.n)),Hn=Le(()=>import(`./vue-ui-accordion-E8TJfFeK.js`).then(e=>e.n)),Un=Le(()=>import(`./PenAndPaper-DoNTA-SV.js`).then(e=>e.t)),Wn=Le(()=>import(`./UserOptions-B9EyfU9n.js`).then(e=>e.n)),Gn=Le(()=>import(`./PackageVersion-DKSNC-YP.js`).then(e=>e.t)),Kn=Le(()=>import(`./BaseDraggableDialog-BK7dj9O6.js`).then(e=>e.n)),{vue_ui_chestnut:qn}=i(),w=e,Jn=f(()=>!!w.dataset&&w.dataset.length),T=y(ne()),Yn=y(null),Xn=y(0),Zn=y(null),Qn=y(null),$n=y(!1),E=y(!1),D=y(``),O=y({level:`root`,rootIndex:0,branchIndex:0,nutIndex:0,locked:!1}),k=y(sr()),A=f(()=>k.value.style.chart.layout.roots),j=f(()=>k.value.style.chart.layout.branches),M=f(()=>k.value.style.chart.layout.nuts),N=f(()=>k.value.style.chart.layout),P=f(()=>k.value.style.chart);ge({config:()=>k.value,dataset:()=>w.dataset,component:`VueUiChestnut`,rules:[_e.emptyArray,{test:e=>e.some(e=>e?.branches&&e.branches.length>10),message:[`👀 Some root has > 10 branches, which can make the chart heavy. Consider:`,``,`▶️ Grouping some branches in broader categories.`]},{test:e=>e.some(e=>e?.branches&&e.branches.some(e=>e?.breakdown&&e?.breakdown.length>6)),message:[`👀 Some donuts have > 6 series. Consider:`,``,`▶️ Grouping small values into an "Other" category.`]}]});let F=f(()=>k.value.userOptions.useCursorPointer),er=f(()=>oe({defaultConfig:{userOptions:{show:!1},table:{show:!1},style:{chart:{backgroundColor:`#99999930`,layout:{grandTotal:{show:!1},roots:{stroke:`#6A6A6A`,labels:{show:!1}},verticalSeparator:{stroke:`transparent`},branches:{stroke:`#6A6A6A`,underlayerColor:`#6A6A6A90`,labels:{show:!1,dataLabels:{show:!1}}}}}}},userConfig:k.value.skeletonConfig??{}})),{loading:tr,FINAL_DATASET:nr}=me({...We(w),FINAL_CONFIG:k,prepareConfig:sr,skeletonDataset:w.config?.skeletonDataset??[{name:`_`,color:`#969696`,branches:[{name:`_`,value:32,breakdown:[{name:`_`,value:16,color:`#CACACA`},{name:`_`,value:16,color:`#6A6A6A`}]},{name:`_`,value:16,breakdown:[{name:`_`,value:8,color:`#CACACA`},{name:`_`,value:8,color:`#6A6A6A`}]},{name:`_`,value:8,breakdown:[{name:`_`,value:4,color:`#CACACA`},{name:`_`,value:4,color:`#6A6A6A`}]},{name:`_`,value:4,breakdown:[{name:`_`,value:2,color:`#CACACA`},{name:`_`,value:2,color:`#6A6A6A`}]}]},{name:`_`,color:`#C4C4C4`,branches:[{name:`_`,value:24,breakdown:[{name:`_`,value:12,color:`#CACACA`},{name:`_`,value:12,color:`#6A6A6A`}]},{name:`_`,value:12,breakdown:[{name:`_`,value:6,color:`#CACACA`},{name:`_`,value:6,color:`#6A6A6A`}]},{name:`_`,value:6,breakdown:[{name:`_`,value:3,color:`#CACACA`},{name:`_`,value:3,color:`#6A6A6A`}]},{name:`_`,value:2,breakdown:[{name:`_`,value:1,color:`#CACACA`},{name:`_`,value:1,color:`#6A6A6A`}]}]}],skeletonConfig:oe({defaultConfig:k.value,userConfig:er.value})}),{userOptionsVisible:rr,setUserOptionsVisibility:ir,keepUserOptionState:ar}=ke({config:k.value}),{svgRef:or}=Ae({config:N.value.title});function sr(){return ye(w.config,qn,Me)}Ke(()=>w.config,e=>{k.value=sr(),rr.value=!k.value.userOptions.showOnChartHover,mr.value.showTable=k.value.table.show,Fr()},{deep:!0});let{isPrinting:cr,isImaging:lr,generatePdf:ur,generateImage:dr}=Ee({elementId:`vue-ui-chestnut_${T.value}`,fileName:N.value.title.text||`vue-ui-chestnut`,options:k.value.userOptions.print}),fr=f(()=>k.value.userOptions.show),pr=f(()=>de(k.value.customPalette)),mr=y({showTable:k.value.table.show});Ke(k,()=>{mr.value={showTable:k.value.table.show}},{immediate:!0});let hr=y(null),gr=f(()=>k.value.table.responsiveBreakpoint),I=y({gap:6,padding:{top:102,left:12,right:12,bottom:96},width:1024,height:0,branchSize:32,branchStart:128}),L=f(()=>({left:I.value.padding.left,top:I.value.padding.top,right:I.value.width-I.value.padding.right,bottom:I.value.height-I.value.padding.bottom,width:I.value.width-(I.value.padding.left+I.value.padding.right),height:I.value.height-(I.value.padding.top+I.value.padding.bottom),seedX:I.value.padding.left+64})),R=f(()=>nr.value.flatMap(e=>(e.branches||[]).map(e=>e.value||0)).reduce((e,t)=>e+t,0)),_r=f(()=>k.value.debug),z=f(()=>(_r.value&&nr.value.forEach((e,t)=>{fe({datasetObject:e,requiredAttributes:[`name`,`branches`]}).forEach(e=>{ie({componentName:`VueUiChestnut`,type:`datasetSerieAttribute`,property:e,index:t})}),e.branches&&e.branches.forEach((e,n)=>{fe({datasetObject:e,requiredAttributes:[`name`,`value`]}).forEach(e=>{ie({componentName:`VueUiChestnut`,type:`datasetSerieAttribute`,property:e,index:`${t} - ${n}`})}),e.breakdown&&e.breakdown.forEach((e,r)=>{fe({datasetObject:e,requiredAttributes:[`name`,`value`]}).forEach(e=>{ie({componentName:`VueUiChestnut`,type:`datasetSerieAttribute`,property:e,index:`${t} - ${n} - ${r}`})})})})}),nr.value.map((e,t)=>{let n=(e.branches||[]).map(e=>e.value||0).reduce((e,t)=>e+t,0);return{...e,color:te(e.color)||pr.value[t]||s[t]||s[t%s.length],id:e.id||`root_${t}_${T.value}`,type:`root`,total:n,rootIndex:t,branches:(e.branches||[]).map((r,i)=>({...r,rootName:e.name,rootIndex:t,color:te(e.color)||pr.value[t]||s[t]||s[t%s.length],value:r.value>=0?r.value:0,id:r.id||`branch_${t}_${i}_${T.value}`,proportionToRoot:r.value/n,type:`branch`,breakdown:(r.breakdown||[]).map((a,o)=>({table:{rootName:e.name,rootValue:n,rootToTotal:n/R.value,branchName:r.name,branchValue:r.value,branchToTotal:r.value/R.value,branchToRoot:r.value/n,nutName:a.name,nutValue:a.value,nutToTotal:a.value/R.value,nutToRoot:a.value/n,nutToBranch:a.value/r.value},...a,type:`nut`,branchName:r.name,rootName:e.name,branchTotal:r.value>=0?r.value:0,proportionToBranch:a.value/r.value,proportionToRoot:a.value/n,proportionToTree:a.value/R.value,rootIndex:t,id:a.id||`nut_${t}_${i}_${o}_${T.value}`,color:te(a.color)||pr.value[o]||s[o]||s[o%s.length],value:a.value>=0?a.value:0}))}))}})));function vr(){return z.value}let yr=Ye,br=f(()=>z.value.flatMap(e=>e.branches).length),xr=f(()=>Math.max(...z.value.map(e=>e.branches.map(e=>e.value).reduce((e,t)=>e+t,0)))),Sr=f(()=>Math.max(...z.value.flatMap(e=>e.branches.map(e=>e.value)))),Cr=f(()=>256+I.value.padding.left),B=f(()=>z.value.sort((e,t)=>t.total-e.total).map((e,t)=>{let n=L.value.height/z.value.length/2,r=e.total/xr.value*(n>64?64:n);return{...e,x:L.value.seedX,y:L.value.top+L.value.height/z.value.length*(t+1)-(L.value.height/z.value.length/2+I.value.gap/2),r:r<I.value.branchSize/2?I.value.branchSize/2:r}})),wr=f(()=>j.value.widthRatio<=0?.1:j.value.widthRatio>1.8?1.8:j.value.widthRatio),Tr=f(()=>B.value.flatMap(e=>e.branches)),V=f(()=>Tr.value.sort((e,t)=>t.value-e.value).map((e,t)=>({...e,y1:t*I.value.branchSize+L.value.top+t*I.value.gap,y2:t*I.value.branchSize+I.value.branchSize,x1:Cr.value,x2:384*e.value/Sr.value*wr.value+Cr.value}))),Er=f(()=>B.value),Dr=f(()=>Er.value.map(e=>V.value.filter(t=>t.rootIndex===e.rootIndex).sort((e,t)=>e.y1-t.y1))),Or=f(()=>Er.value.map((e,t)=>Dr.value[t].map(e=>(e.breakdown||[]).map((t,n)=>({...t,nutIndex:n,rootIndex:e.rootIndex,branchId:e.id,branchName:e.name,branchValue:e.value,rootName:e.rootName})))));function kr(e){let t=B.value.find(t=>t.rootIndex===e.rootIndex);return{x:t.x,y:t.y,r:t.r}}let H=y(null),U=y(null),W=y(null),G=y(null);function K(){H.value=null,W.value=null,G.value=null}function q(e){if(H.value)return e.type===`root`?e.rootIndex===H.value.rootIndex:e.type===`branch`?e.id===H.value.id:e.type===`nut`&&e.branchName===H.value.name&&e.rootIndex===H.value.rootIndex;if(W.value)return e.type===`root`?e.rootIndex===W.value.rootIndex:e.type===`branch`?e.id===W.value.id:e.type===`nut`&&e.branchName===W.value.name&&e.rootIndex===W.value.rootIndex;if(G.value)return e.type===`root`?e.id===G.value.id:e.type===`branch`||e.type===`nut`?e.rootIndex===G.value.rootIndex:!1;if(ui.value&&E.value){if(O.value.level===`root`)return e.type===`root`?Z.value&&e.id===Z.value.id:e.type===`branch`||e.type===`nut`?Z.value&&e.rootIndex===Z.value.rootIndex:!1;if(O.value.level===`branch`)return e.type===`root`?Z.value&&e.rootIndex===Z.value.rootIndex:e.type===`branch`?ci.value&&e.id===ci.value.id:(e.type,!1);if(O.value.level===`nut`)return e.type===`root`?Z.value&&e.rootIndex===Z.value.rootIndex:e.type===`branch`?li.value&&e.id===li.value.id:e.type===`nut`&&li.value&&e.branchName===li.value.name&&e.rootIndex===li.value.rootIndex}return!0}function Ar(e){K();let t=Er.value.findIndex(t=>t.rootIndex===e.rootIndex),n=(Dr.value[t]||[]).findIndex(t=>t.id===e.id);t!==-1&&(O.value.rootIndex=t),n!==-1&&(O.value.branchIndex=n),O.value.level=`nut`,O.value.nutIndex=0,Be(()=>{H.value=e,W.value=e,U.value=ee({series:e.breakdown,base:1},e.x2+24+M.value.offsetX,e.y1+I.value.branchSize/2,80,80),yr(`selectNut`,e.breakdown),Q()})}function J(){H.value=null,U.value=null,yr(`selectNut`,null)}function jr(e){let t=Er.value.findIndex(t=>t.rootIndex===e.rootIndex),n=(Dr.value[t]||[]).findIndex(t=>t.id===e.id);t!==-1&&(O.value.rootIndex=t),n!==-1&&(O.value.branchIndex=n),O.value.level=`branch`,O.value.nutIndex=0,W.value&&W.value.id===e.id?(W.value=null,K(),yr(`selectBranch`,null),Q()):(K(),W.value=e,yr(`selectBranch`,e),Q())}function Mr(e){let t=Er.value.findIndex(t=>t.id===e.id);t!==-1&&(O.value.rootIndex=t),O.value.level=`root`,O.value.branchIndex=0,O.value.nutIndex=0,G.value&&G.value.id===e.id?(K(),yr(`selectRoot`,null),Q()):(K(),G.value=e,yr(`selectRoot`,e),Q())}function Nr(){return L.value.bottom-(H.value.y1+180)<0?0:L.value.bottom}function Pr(e){return e.proportion*100>M.value.selected.labels.dataLabels.hideUnderValue}He(()=>{Fr()});function Fr(){pe(w.dataset)&&ie({componentName:`VueUiChestnut`,type:`dataset`,debug:_r.value});let e=br.value*(I.value.branchSize+I.value.gap)+I.value.padding.top+I.value.padding.bottom;I.value.height=e}let Y=f(()=>({head:[k.value.table.th.translations.rootName,k.value.table.th.translations.rootValue,k.value.table.th.translations.rootToTotal,k.value.table.th.translations.branchName,k.value.table.th.translations.branchValue,k.value.table.th.translations.branchToRoot,k.value.table.th.translations.branchToTotal,k.value.table.th.translations.nutName,k.value.table.th.translations.nutValue,k.value.table.th.translations.nutToBranch,k.value.table.th.translations.nutToRoot,k.value.table.th.translations.nutToTotal],body:z.value.flatMap((e,t)=>e.branches.flatMap((e,t)=>e.breakdown.flatMap((e,t)=>e.table)))}));function Ir(e=null){Be(()=>{let t=[[N.value.title.text],[N.value.title.subtitle.text],[``],[`Grand total`,R.value],[``]],n=Y.value.head,r=Y.value.body.map((e,t)=>[Y.value.body[t-1]&&Y.value.body[t-1].rootName===e.rootName?``:e.rootName,Y.value.body[t-1]&&Y.value.body[t-1].rootName===e.rootName?``:e.rootValue,Y.value.body[t-1]&&Y.value.body[t-1].rootName===e.rootName?``:e.rootToTotal,Y.value.body[t-1]&&Y.value.body[t-1].branchName===e.branchName?``:e.branchName,Y.value.body[t-1]&&Y.value.body[t-1].branchName===e.branchName?``:e.branchValue,Y.value.body[t-1]&&Y.value.body[t-1].branchName===e.branchName?``:e.branchToRoot,Y.value.body[t-1]&&Y.value.body[t-1].branchName===e.branchName?``:e.branchToTotal,e.nutName,e.nutValue,e.nutToBranch,e.nutToRoot,e.nutToTotal]),i=t.concat([n]).concat(r),a=o(i);e?e(a):se({csvContent:a,title:N.value.title.text||`vue-ui-chestnut`})})}let Lr=y(!1);function Rr(e){Lr.value=e,Xn.value+=1}function zr(){mr.value.showTable=!mr.value.showTable}let Br=y(!1);function Vr(){Br.value=!Br.value}async function Hr({scale:e=2}={}){if(!Yn.value)return;let{width:t,height:n}=Yn.value.getBoundingClientRect(),r=t/n,{imageUri:i,base64:a}=await be({domElement:Yn.value,base64:!0,img:!0,scale:e});return{imageUri:i,base64:a,title:N.value.title.text,width:t,height:n,aspectRatio:r}}function Ur(e){let t=kr(e),n=e.x1,r=e.y1,i=I.value.branchSize,a=t.x+t.r/2,o=t.y;return[`M ${n},${r}`,`C ${n-20},${r} ${n-20},${r} ${a},${o}`,`C ${a},${o} ${n-20},${r+i} ${n},${r+i}`,`Z`].join(` `)}let Wr=f(()=>Se({config:k,style:P,mutableConfig:mr,dialog:Kn,accordion:Hn,isFullscreen:Lr,parent:Yn,maxWidth:800,titleStyle:N,isCursorPointer:F}));Ke(()=>mr.value.showTable,async e=>{k.value.table.show||(e&&k.value.table.useDialog&&Zn.value?(await Be(),Zn.value.open()):`close`in Zn.value&&Zn.value.close())});let{isResponsive:Gr}=je(hr,gr);function Kr(){mr.value.showTable=!1,Qn.value&&Qn.value.setTableIconState(!1)}let qr=f(()=>z.value.map((e,t)=>({...e,display:`${e.name}: ${u(A.value.labels.formatter,e.total,a({p:N.value.legend.prefix,v:e.total,s:N.value.legend.suffix,r:N.value.legend.roundingValue}),{datapoint:e})} (${a({v:e.total/R.value*100,s:`%`,r:N.value.legend.roundingPercentage})})`}))),Jr=f(()=>qr.value.map(e=>({color:e.color,name:e.display,shape:`circle`}))),Yr=f(()=>P.value.backgroundColor),Xr=f(()=>({...N.value.legend,textAlign:`center`,show:!0,position:`bottom`})),Zr=f(()=>N.value.title),{isCallbackImaging:Qr,isCallbackSvg:$r,generateSvg:ei,onGenerateImage:ti}=xe({svg:or,title:Zr,legend:Xr,legendItems:Jr,backgroundColor:Yr,titleEmbedded:!0,getSvgCallback:()=>k.value.userOptions.callbacks.svg,generateImage:dr});async function ni(){yr(`copyAlt`,{config:k.value,dataset:z.value}),k.value.userOptions.callbacks.altCopy?await Promise.resolve(k.value.userOptions.callbacks.altCopy({config:k.value,dataset:z.value})):console.warn("Vue Data UI - A callback must be set for `altCopy` in userOptions.")}function ri(e){if(!e)return``;let t=a({p:N.value.legend.prefix,v:e.total,s:N.value.legend.suffix,r:N.value.legend.roundingValue}),n=a({v:e.total/R.value*100,s:`%`,r:N.value.legend.roundingPercentage});return`Root ${e.name}. Value ${t}. ${n} of total.`}function ii(e){if(!e)return``;let t=a({p:j.value.labels.dataLabels.prefix,v:e.value,s:j.value.labels.dataLabels.suffix,r:j.value.labels.dataLabels.roundingValue}),n=a({v:e.proportionToRoot*100,s:`%`,r:N.value.legend.roundingPercentage});return`Branch ${e.name}. Root ${e.rootName}. Value ${t}. ${n} of root ${e.rootName}.`}function ai(e){if(!e)return``;let t=a({p:N.value.legend.prefix,v:e.value,s:N.value.legend.suffix,r:M.value.selected.labels.roundingValue}),n=a({v:e.proportionToBranch*100,s:`%`,r:M.value.selected.labels.roundingPercentage});return`Nut ${e.name}. Branch ${e.branchName}. Root ${e.rootName}. Value ${t}. ${n} of branch ${e.branchName}.`}let oi=f(()=>Er.value[O.value.rootIndex]||null),X=f(()=>(Dr.value[O.value.rootIndex]||[])[O.value.branchIndex]||null),si=f(()=>((Or.value[O.value.rootIndex]||[])[O.value.branchIndex]||[])[O.value.nutIndex]||null),Z=f(()=>oi.value),ci=f(()=>X.value),li=f(()=>O.value.level===`nut`?X.value:null),ui=f(()=>$n.value);function Q(){O.value.level===`root`?D.value=ri(oi.value):O.value.level===`branch`?D.value=ii(X.value):O.value.level===`nut`&&(D.value=ai(si.value))}function $(){O.value={level:`root`,rootIndex:0,branchIndex:0,nutIndex:0,locked:!1},D.value=``}function di(){let e=Dr.value[O.value.rootIndex]||[];e.length?(O.value.branchIndex>=e.length&&(O.value.branchIndex=0),O.value.branchIndex<0&&(O.value.branchIndex=e.length-1)):O.value.branchIndex=0}function fi(){let e=(Or.value[O.value.rootIndex]||[])[O.value.branchIndex]||[];e.length?(O.value.nutIndex>=e.length&&(O.value.nutIndex=0),O.value.nutIndex<0&&(O.value.nutIndex=e.length-1)):O.value.nutIndex=0}function pi(e){if(O.value.level===`root`){let t=Er.value.length;if(!t)return;O.value.rootIndex+=e,O.value.rootIndex>=t&&(O.value.rootIndex=0),O.value.rootIndex<0&&(O.value.rootIndex=t-1),O.value.branchIndex=0,O.value.nutIndex=0,Q()}else O.value.level===`branch`?(O.value.branchIndex+=e,di(),O.value.nutIndex=0,Q()):O.value.level===`nut`&&(O.value.nutIndex+=e,fi(),Q())}function mi(e){if(e>0){if(O.value.level===`root`){if(!(Dr.value[O.value.rootIndex]||[]).length)return;O.value.level=`branch`,O.value.branchIndex=0,O.value.nutIndex=0,Q();return}if(O.value.level===`branch`){if(!((Or.value[O.value.rootIndex]||[])[O.value.branchIndex]||[]).length)return;O.value.level=`nut`,O.value.nutIndex=0,X.value?Ar(X.value):Q();return}}else O.value.level===`nut`?(J(),W.value=null,O.value.level=`branch`,O.value.nutIndex=0,Q()):O.value.level===`branch`&&(W.value=null,G.value=null,O.value.level=`root`,O.value.nutIndex=0,Q())}function hi(){O.value.level===`root`&&oi.value?(Mr(oi.value),D.value=`${ri(oi.value)} selected.`):O.value.level===`branch`&&X.value?(jr(X.value),D.value=`${ii(X.value)} selected.`):O.value.level===`nut`&&X.value&&si.value&&(Ar(X.value),D.value=`${ai(si.value)} details opened.`)}function gi(){$n.value=!0,E.value=!1}function _i(){$n.value=!1,E.value=!1,D.value=``,G.value||W.value||H.value||$()}function vi(e){let t=e.key===`ArrowUp`,n=e.key===`ArrowDown`,r=e.key===`ArrowLeft`,i=e.key===`ArrowRight`,a=e.key===`Enter`||e.key===` `,o=e.key===`Escape`;(t||n||r||i||a||o)&&(e.preventDefault(),e.stopPropagation(),$n.value||=!0,o?(K(),$(),E.value=!1):((t||n||r||i)&&(E.value=!0),t?pi(-1):n?pi(1):r?mi(-1):i?mi(1):a&&hi()))}let yi=f(()=>({headers:Y.value.head,rows:Y.value.body.map(e=>[e.rootName,e.rootValue,a({v:e.rootToTotal*100,s:`%`,r:k.value.table.td.roundingPercentage}),e.branchName,e.branchValue,a({v:e.branchToRoot*100,s:`%`,r:k.value.table.td.roundingPercentage}),a({v:e.branchToTotal*100,s:`%`,r:k.value.table.td.roundingPercentage}),e.nutName,e.nutValue,a({v:e.nutToBranch*100,s:`%`,r:k.value.table.td.roundingPercentage}),a({v:e.nutToRoot*100,s:`%`,r:k.value.table.td.roundingPercentage}),a({v:e.nutToTotal*100,s:`%`,r:k.value.table.td.roundingPercentage})])}));return ve({getData:vr,getImage:Hr,generatePdf:ur,generateCsv:Ir,generateImage:dr,generateSvg:ei,toggleTable:zr,toggleAnnotator:Vr,toggleFullscreen:Rr,copyAlt:ni}),(e,i)=>(v(),m(`div`,{class:g(`vue-data-ui-component vue-ui-chestnut ${Lr.value?`vue-data-ui-wrapper-fullscreen`:``}`),ref_key:`chestnutChart`,ref:Yn,id:`vue-ui-chestnut_${T.value}`,style:_(`font-family:${k.value.style.fontFamily};width:100%; text-align:center;background:${P.value.backgroundColor}`),onMouseenter:i[12]||=()=>C(ir)(!0),onMouseleave:i[13]||=()=>C(ir)(!1)},[h(`div`,{id:`chart-instructions-${T.value}`,class:`sr-only`},[h(`p`,null,S(k.value.a11y.translations.keyboardNavigation),1)],8,Ze),h(`div`,Qe,S(D.value),1),yi.value?.rows?.length?(v(),Ne(Oe,{key:0,uid:T.value,head:yi.value.headers,body:yi.value.rows,notice:k.value.a11y.translations.tableAvailable,caption:k.value.a11y.translations.tableCaption},null,8,[`uid`,`head`,`body`,`notice`,`caption`])):p(``,!0),k.value.userOptions.buttons.annotator?(v(),Ne(C(Un),ze({key:1},C(n)(k.value.userOptions.annotator),{svgRef:C(or),backgroundColor:P.value.backgroundColor,color:P.value.color,active:Br.value,isCursorPointer:F.value,palette:k.value.userOptions.annotatorPalette,onClose:Vr}),Pe({_:2},[b(C(r),n=>({name:n,fn:qe(r=>[x(e.$slots,n,Ve(Re(C(t)(n,r))),void 0,!0)])}))]),1040,[`svgRef`,`backgroundColor`,`color`,`active`,`isCursorPointer`,`palette`])):p(``,!0),fr.value?(v(),m(`div`,$e,null,512)):p(``,!0),k.value.userOptions.show&&Jn.value&&(C(ar)||C(rr))?(v(),Ne(C(Wn),ze({ref_key:`userOptionsRef`,ref:Qn,key:`user_options_${Xn.value}`,backgroundColor:P.value.backgroundColor,color:P.value.color,isImaging:C(lr),isPrinting:C(cr),uid:T.value,isFullscreen:Lr.value,chartElement:Yn.value},C(we)(k.value.userOptions,`pdf csv img svg table fullscreen altCopy annotator`),{isAnnotation:Br.value,tableDialog:k.value.table.useDialog,isCursorPointer:F.value,onToggleFullscreen:Rr,onGeneratePdf:C(ur),onGenerateCsv:Ir,onGenerateImage:C(ti),onGenerateSvg:C(ei),onToggleTable:zr,onToggleAnnotator:Vr,onCopyAlt:ni,style:{visibility:C(ar)?C(rr)?`visible`:`hidden`:`visible`}}),Pe({_:2},[b(C(Ce)(e.$slots,`menuIcon optionPdf optionCsv optionImg optionSvg optionTable optionFullscreen optionAnnotator optionAltCopy custom-menu-before custom-menu-after`),t=>({name:t,fn:qe(n=>[x(e.$slots,t,Ve(Re(C(Te)(t,n))),void 0,!0)])}))]),1040,[`backgroundColor`,`color`,`isImaging`,`isPrinting`,`uid`,`isFullscreen`,`chartElement`,`isAnnotation`,`tableDialog`,`isCursorPointer`,`onGeneratePdf`,`onGenerateImage`,`onGenerateSvg`,`style`])):p(``,!0),h(`div`,et,[I.value.height>0?(v(),m(`svg`,{key:0,ref_key:`svgRef`,ref:or,xmlns:C(ue),"aria-describedby":`chart-instructions-${T.value}`,class:g({"vue-data-ui-fullscreen--on":Lr.value,"vue-data-ui-fulscreen--off":!Lr.value}),viewBox:`0 0 ${I.value.width<=0?10:I.value.width} ${I.value.height<=0?10:I.value.height}`,style:_(`overflow:visible;background:transparent;color:${P.value.color}`),tabindex:`0`,onFocus:gi,onBlur:_i,onKeydown:vi},[Ie(C(Gn)),x(e.$slots,`svg-underlayer`,{svg:{...I.value,isPrintingImg:C(cr)||C(lr)||C(Qr),isPrintingSvg:C($r)}},void 0,!0),e.$slots[`chart-background`]?(v(),m(`foreignObject`,{key:0,x:0,y:0,width:I.value.width<=0?10:I.value.width,height:I.value.height<=0?10:I.value.height,style:{pointerEvents:`none`}},[x(e.$slots,`chart-background`,{},void 0,!0)],8,nt)):p(``,!0),H.value?p(``,!0):(v(),m(`g`,rt,[N.value.title.text?(v(),m(`text`,{key:0,"text-anchor":`middle`,fill:N.value.title.color,"font-weight":N.value.title.bold?`bold`:`normal`,"font-size":N.value.title.fontSize,x:I.value.width/2,y:12+N.value.title.fontSize+N.value.title.offsetY,onClick:i[0]||=()=>{K(),$(),E.value=!1}},S(N.value.title.text),9,it)):p(``,!0),N.value.title.subtitle.text?(v(),m(`text`,{key:1,"text-anchor":`middle`,fill:N.value.title.subtitle.color,"font-weight":N.value.title.subtitle.bold?`bold`:`normal`,"font-size":N.value.title.subtitle.fontSize,x:I.value.width/2,y:48+N.value.title.subtitle.fontSize+N.value.title.subtitle.offsetY,onClick:i[1]||=()=>{K(),$(),E.value=!1}},S(N.value.title.subtitle.text),9,at)):p(``,!0)])),h(`defs`,null,[(v(!0),m(d,null,b(z.value,(e,t)=>(v(),Ne(De,{t:`radial`,cx:`50%`,cy:`50%`,r:`50%`,fx:`50%`,fy:`50%`,id:`root_gradient_${T.value}_${e.rootIndex}`,key:`root_gradient_${T.value}_${e.rootIndex}`,stops:[[`0%`,C(c)(C(re)(e.color,.05),100-A.value.gradientIntensity),1],[`100%`,e.color,1]]},null,8,[`id`,`stops`]))),128)),(v(!0),m(d,null,b(z.value,e=>(v(),Ne(De,{t:`linear`,x1:`0%`,y1:`0%`,x2:`100%`,y2:`0%`,id:`branch_gradient_${T.value}_${e.rootIndex}`,key:`branch_gradient_${T.value}_${e.rootIndex}`,stops:[[`0%`,e.color,1],[`100%`,C(c)(C(re)(e.color,.02),100-j.value.gradientIntensity),1]]},null,8,[`id`,`stops`]))),128)),Ie(De,{t:`radial`,cx:`50%`,cy:`50%`,r:`50%`,fx:`50%`,fy:`50%`,id:`nutpick_${T.value}`,stops:[[`0%`,C(c)(`#FFFFFF`,0),0],[`80%`,C(c)(`#FFFFFF`,M.value.selected.gradientIntensity),1],[`100%`,C(c)(`#FFFFFF`,0),0]]},null,8,[`id`,`stops`]),Ie(De,{t:`radial`,cx:`50%`,cy:`50%`,r:`50%`,fx:`50%`,fy:`50%`,id:`nut_${T.value}`,stops:[[`0%`,C(c)(`#FFFFFF`,0),0],[`80%`,C(c)(`#FFFFFF`,M.value.gradientIntensity),1],[`100%`,C(c)(`#FFFFFF`,0),0]]},null,8,[`id`,`stops`]),Ie(De,{t:`radial`,cx:`50%`,cy:`50%`,r:`50%`,fx:`50%`,fy:`50%`,id:`nut_underlayer_${T.value}`,stops:[[`0%`,C(c)(P.value.backgroundColor,100),1],[`80%`,C(c)(P.value.backgroundColor,60),1],[`100%`,C(c)(P.value.backgroundColor,0),1]]},null,8,[`id`,`stops`])]),N.value.grandTotal.show?(v(),m(`g`,ot,[h(`text`,{x:L.value.seedX,y:32+N.value.grandTotal.offsetY,"font-size":N.value.grandTotal.fontSize,"font-weight":N.value.grandTotal.bold?`bold`:`normal`,fill:N.value.grandTotal.color,"text-anchor":`middle`,onClick:i[2]||=()=>{K(),$(),E.value=!1}},S(N.value.grandTotal.text),9,st),h(`text`,{x:L.value.seedX,y:38+N.value.grandTotal.fontSize+N.value.grandTotal.offsetY,"font-size":N.value.grandTotal.fontSize,"font-weight":N.value.grandTotal.bold?`bold`:`normal`,fill:N.value.grandTotal.color,"text-anchor":`middle`,onClick:i[3]||=()=>{K(),$(),E.value=!1}},S(C(u)(N.value.grandTotal.formatter,R.value,C(a)({p:N.value.grandTotal.prefix,v:R.value,s:N.value.grandTotal.suffix,r:N.value.grandTotal.roundingValue}))),9,ct)])):p(``,!0),(v(!0),m(d,null,b(V.value,e=>(v(),m(`g`,null,[h(`defs`,null,[Ie(De,{t:`linear`,id:`link_grad_${e.id}`,stops:[[`0%`,e.color,1],[`100%`,C(c)(e.color,N.value.links.opacity),1]]},null,8,[`id`,`stops`])]),h(`path`,{d:Ur(e),stroke:C(c)(e.color,N.value.links.opacity),fill:`url(#link_grad_${e.id})`,"stroke-linecap":`round`,"stroke-linejoin":`round`,style:_(`opacity:${+!!q(e)}`),onClick:i[4]||=()=>{K(),$(),E.value=!1}},null,12,lt)]))),256)),(v(!0),m(d,null,b(B.value,e=>(v(),m(`circle`,{cx:e.x,cy:e.y,r:e.r,fill:A.value.underlayerColor,stroke:`none`,style:_(`cursor:${F.value?`pointer`:`default`}; opacity:${q(e)?1:.05}`)},null,12,ut))),256)),(v(!0),m(d,null,b(B.value,(e,t)=>(v(),m(`circle`,{"aria-label":ri(e),cx:e.x,cy:e.y,r:e.r,fill:A.value.useGradient?`url(#root_gradient_${T.value}_${e.rootIndex})`:e.color,stroke:A.value.stroke,"stroke-width":A.value.strokeWidth,style:_(`cursor:${F.value?`pointer`:`default`}; opacity:${q(e)?1:.05}`),onClick:t=>Mr(e)},null,12,dt))),256)),A.value.labels.show?(v(),m(`g`,ft,[(v(!0),m(d,null,b(B.value,(e,t)=>(v(),m(`text`,{x:e.x,y:e.y+A.value.labels.fontSize/2.6,"text-anchor":`middle`,"font-size":A.value.labels.fontSize,fill:A.value.labels.adaptColorToBackground?C(le)(e.color):A.value.labels.color,"font-weight":`bold`,style:_(`cursor:${F.value?`pointer`:`default`}; opacity:${q(e)?1:.05}`),onClick:t=>Mr(e)},S(C(u)(A.value.labels.formatter,e.total,C(a)({p:A.value.labels.prefix,v:e.total,s:A.value.labels.suffix,r:A.value.labels.roundingValue}),{datapoint:e})),13,pt))),256)),(v(!0),m(d,null,b(B.value,e=>(v(),m(`g`,null,[H.value&&e.rootIndex===H.value.rootIndex||W.value&&e.rootIndex===W.value.rootIndex||G.value&&e.rootIndex===G.value.rootIndex?(v(),m(`g`,mt,[h(`text`,{x:e.x,y:e.y+e.r+24,"text-anchor":`middle`,fill:A.value.labels.name.color,"font-size":A.value.labels.name.fontSize,"font-weight":A.value.labels.name.bold?`bold`:`normal`,onClick:i[5]||=()=>{K(),$(),E.value=!1}},S(e.name),9,ht)])):p(``,!0)]))),256))])):p(``,!0),(v(!0),m(d,null,b(V.value,e=>(v(),m(`rect`,{x:e.x1,y:e.y1,height:I.value.branchSize,width:e.x2-e.x1,fill:j.value.underlayerColor,rx:j.value.borderRadius,stroke:`none`,style:_(`opacity:${q(e)?1:.05}`),onClick:t=>jr(e)},null,12,gt))),256)),(v(!0),m(d,null,b(V.value,(e,t)=>(v(),m(`rect`,{"aria-label":ii(e),x:e.x1,y:e.y1,height:I.value.branchSize,width:e.x2-e.x1,fill:j.value.useGradient?`url(#branch_gradient_${T.value}_${e.rootIndex})`:e.color,rx:j.value.borderRadius,stroke:j.value.stroke,"stroke-width":j.value.strokeWidth,style:_(`cursor:${F.value?`pointer`:`default`}; opacity:${q(e)?1:.05}`),onClick:t=>jr(e)},null,12,_t))),256)),j.value.labels.dataLabels.show?(v(),m(`g`,vt,[(v(!0),m(d,null,b(V.value,e=>(v(),m(`g`,null,[e.proportionToRoot*100>j.value.labels.dataLabels.hideUnderValue?(v(),m(`text`,{key:0,x:e.x1+6,y:e.y1+I.value.branchSize/1.5,"text-anchor":`start`,fill:C(le)(e.color),"font-size":j.value.labels.dataLabels.fontSize,"font-weight":`bold`,style:_(`cursor:${F.value?`pointer`:`default`}; opacity:${q(e)?1:.05}`),onClick:t=>jr(e)},S(C(u)(j.value.labels.dataLabels.formatter,e.value,C(a)({p:N.value.branches.labels.dataLabels.prefix,v:e.value,s:N.value.branches.labels.dataLabels.suffix,r:N.value.branches.labels.dataLabels.roundingValue}),{datapoint:e})),13,yt)):p(``,!0)]))),256))])):p(``,!0),(v(!0),m(d,null,b(V.value,(e,t)=>(v(),m(`g`,null,[(v(!0),m(d,null,b(C(ee)({series:e.breakdown,base:1},e.x2+24+M.value.offsetX,e.y1+I.value.branchSize/2,I.value.branchSize/3,I.value.branchSize/3),(t,n)=>(v(),m(`path`,{d:t.path,stroke:t.color,"stroke-width":10,fill:`none`,style:_(`opacity:${q(e)?1:.1}`)},null,12,bt))),256)),h(`circle`,{"aria-label":`Open details for branch ${e.name} in root ${e.rootName}`,fill:M.value.useGradient?`url(#nut_${T.value})`:`transparent`,cx:e.x2+24+M.value.offsetX,cy:e.y1+I.value.branchSize/2,r:I.value.branchSize/2+2,onClick:t=>Ar(e),style:_(`cursor:${F.value?`pointer`:`default`};opacity:${q(e)?1:.1}`)},null,12,xt)]))),256)),j.value.labels.show&&!W.value?(v(),m(`g`,St,[(v(!0),m(d,null,b(V.value,e=>(v(),m(`text`,{x:e.x2+I.value.branchSize+24+M.value.offsetX,y:e.y1+I.value.branchSize/2+5,"font-size":j.value.labels.fontSize,"font-weight":j.value.labels.bold?`bold`:`normal`,fill:j.value.labels.color,"text-anchor":`start`,style:_(`opacity:${q(e)?1:.1}`)},S(e.name),13,Ct))),256))])):p(``,!0),h(`line`,{x1:256+I.value.padding.left,x2:256+I.value.padding.left,y1:L.value.top,y2:L.value.bottom,stroke:N.value.verticalSeparator.stroke,"stroke-width":N.value.verticalSeparator.strokeWidth},null,8,wt),!H.value&&!W.value?(v(),m(`foreignObject`,{key:6,x:0,y:L.value.bottom,height:I.value.height-L.value.bottom,width:I.value.width,style:{overflow:`visible`},"data-no-svg-export":``,onClick:i[6]||=()=>{K(),$(),E.value=!1}},[h(`div`,Et,[h(`div`,Dt,[(v(!0),m(d,null,b(B.value,e=>(v(),m(`div`,{style:_(`display:flex;align-items:center;gap:3px;flex-direction:row;font-size:${N.value.legend.fontSize}px;`)},[(v(),m(`svg`,Ot,[h(`circle`,{cx:`10`,cy:`10`,r:`10`,fill:e.color,stroke:`none`},null,8,kt)])),C(tr)?p(``,!0):(v(),m(d,{key:0},[h(`span`,null,S(e.name)+`:`,1),h(`b`,null,S(C(u)(N.value.roots.labels.formatter,e.total,C(a)({p:P.value.layout.legend.prefix,v:e.total,s:P.value.layout.legend.suffix,r:P.value.layout.legend.roundingValue}),{datapoint:e})),1),Fe(` (`+S(C(a)({v:e.total/R.value*100,s:`%`,r:N.value.legend.roundingPercentage}))+`) `,1)],64))],4))),256))])])],8,Tt)):p(``,!0),H.value&&U.value?(v(),m(`g`,At,[(v(),m(`foreignObject`,{x:0,y:Nr(),height:I.value.height-L.value.bottom,width:I.value.width,style:{overflow:`visible`},onClick:i[7]||=()=>{K(),$(),E.value=!1}},[h(`div`,Mt,[h(`b`,null,S(H.value.name),1),h(`div`,Nt,[(v(!0),m(d,null,b(H.value.breakdown,(e,t)=>(v(),m(`div`,{style:_(`display:flex;align-items:center;gap:6px;flex-direction:row;font-size:${N.value.legend.fontSize}px;`)},[(v(),m(`svg`,Pt,[h(`circle`,{cx:`10`,cy:`10`,r:`10`,fill:e.color,stroke:`none`},null,8,Ft)])),h(`span`,null,[Fe(S(e.name)+`: `,1),h(`b`,null,S(N.value.legend.prefix)+` `+S(e.value.toFixed(P.value.layout.nuts.selected.labels.roundingValue))+` `+S(N.value.legend.suffix),1),Fe(` (`+S((e.proportionToBranch*100).toFixed(N.value.nuts.selected.labels.roundingPercentage))+`%)`,1)])],4))),256))])])],8,jt)),h(`circle`,{cx:H.value.x2+24+M.value.offsetX,cy:H.value.y1+I.value.branchSize/2,r:256,fill:`url(#nut_underlayer_${T.value})`,onClick:J,class:g(M.value.selected.useMotion?`vue-ui-chestnut-animated`:``)},null,10,It),(v(!0),m(d,null,b(U.value,e=>(v(),m(`g`,null,[Pr(e)?(v(),m(`path`,{key:0,d:C(ae)(e,{x:H.value.x2+24+M.value.offsetX,y:H.value.y1+I.value.branchSize/2},16,16,!1,!1,64),stroke:e.color,"stroke-width":`1`,"stroke-linecap":`round`,"stroke-linejoin":`round`,fill:`none`,class:g(M.value.selected.useMotion?`vue-ui-chestnut-animated`:``)},null,10,Lt)):p(``,!0)]))),256)),h(`circle`,{cx:H.value.x2+24+M.value.offsetX,cy:H.value.y1+I.value.branchSize/2,r:118,fill:P.value.backgroundColor,onClick:J,class:g(M.value.selected.useMotion?`vue-ui-chestnut-animated`:``)},null,10,Rt),(v(!0),m(d,null,b(U.value,e=>(v(),m(`path`,{d:e.path,stroke:e.color,"stroke-width":64,fill:`none`,onClick:J,class:g(M.value.selected.useMotion?`vue-ui-chestnut-animated`:``)},null,10,zt))),256)),h(`circle`,{cx:H.value.x2+24+M.value.offsetX,cy:H.value.y1+I.value.branchSize/2,r:110,fill:`url(#nutpick_${T.value})`,onClick:J,class:g(M.value.selected.useMotion?`vue-ui-chestnut-animated`:``)},null,10,Bt),h(`circle`,{cx:H.value.x2+24+M.value.offsetX,cy:H.value.y1+I.value.branchSize/2,r:64,fill:P.value.backgroundColor,onClick:J,class:g(M.value.selected.useMotion?`vue-ui-chestnut-animated`:``)},null,10,Vt),h(`text`,{x:H.value.x2+24+M.value.offsetX,y:H.value.y1+8,fill:M.value.selected.labels.core.total.color,"font-size":M.value.selected.labels.core.total.fontSize,"font-weight":M.value.selected.labels.core.total.bold?`bold`:`normal`,"text-anchor":`middle`,onClick:J,class:g(M.value.selected.useMotion?`vue-ui-chestnut-animated`:``)},S(k.value.translations.total),11,Ht),h(`text`,{x:H.value.x2+24+M.value.offsetX,y:H.value.y1+36,fill:M.value.selected.labels.core.value.color,"font-size":M.value.selected.labels.core.value.fontSize,"font-weight":M.value.selected.labels.core.value.bold?`bold`:`normal`,"text-anchor":`middle`,onClick:J,class:g(M.value.selected.useMotion?`vue-ui-chestnut-animated`:``)},S(C(u)(M.value.selected.labels.dataLabels.formatter,H.value.value,C(a)({p:M.value.selected.labels.core.value.prefix,v:H.value.value,s:M.value.selected.labels.core.value.suffix,r:M.value.selected.roundingValue}),{datapoint:H.value})),11,Ut),(v(!0),m(d,null,b(U.value,(e,t)=>(v(),m(`g`,null,[Pr(e)?(v(),m(`text`,{key:0,x:C(l)(e).x,"text-anchor":C(l)(e).anchor,y:C(ce)(e)-M.value.selected.labels.dataLabels.fontSize/6,fill:e.color,"font-size":M.value.selected.labels.dataLabels.fontSize/2,style:_(`font-weight:${M.value.selected.labels.dataLabels.bold?`bold`:``}`),class:g(M.value.selected.useMotion?`vue-ui-chestnut-animated`:``)},` ⬤ `,14,Wt)):p(``,!0),Pr(e)?(v(),m(`text`,{key:1,x:C(l)(e,!0).x,"text-anchor":C(l)(e,!0).anchor,y:C(ce)(e),fill:M.value.selected.labels.dataLabels.color,"font-size":M.value.selected.labels.dataLabels.fontSize,style:_(`font-weight:${M.value.selected.labels.dataLabels.bold?`bold`:``}`),class:g(M.value.selected.useMotion?`vue-ui-chestnut-animated`:``)},S(H.value.breakdown[t].name),15,Gt)):p(``,!0)]))),256)),(v(!0),m(d,null,b(U.value,(e,t)=>(v(),m(`g`,null,[Pr(e)?(v(),m(`text`,{key:0,x:C(l)(e,!0).x,"text-anchor":C(l)(e).anchor,y:C(ce)(e)+M.value.selected.labels.dataLabels.fontSize,fill:M.value.selected.labels.dataLabels.color,"font-size":M.value.selected.labels.dataLabels.fontSize,style:_(`font-weight:${M.value.selected.labels.dataLabels.bold?`bold`:``}`),class:g(M.value.selected.useMotion?`vue-ui-chestnut-animated`:``)},S(C(a)({v:H.value.breakdown[t].value/H.value.value*100,s:`%`,r:M.value.selected.labels.roundingPercentage}))+` `+S(k.value.translations.of)+` `+S(H.value.breakdown[t].branchName)+` `+S(C(u)(M.value.selected.labels.dataLabels.formatter,H.value.breakdown[t].value,C(a)({p:M.value.selected.labels.dataLabels.prefix,v:H.value.breakdown[t].value,s:M.value.selected.labels.dataLabels.suffix,r:M.value.selected.roundingValue}),{datapoint:U.value,seriesIndex:t})),15,Kt)):p(``,!0),Pr(e)?(v(),m(`text`,{key:1,x:C(l)(e,!0).x,"text-anchor":C(l)(e).anchor,y:C(ce)(e)+M.value.selected.labels.dataLabels.fontSize*2,fill:M.value.selected.labels.dataLabels.color,"font-size":M.value.selected.labels.dataLabels.fontSize,style:_(`font-weight:${M.value.selected.labels.dataLabels.bold?`bold`:``}`),class:g(M.value.selected.useMotion?`vue-ui-chestnut-animated`:``)},S(C(a)({v:H.value.breakdown[t].proportionToRoot*100,s:`%`,r:M.value.selected.labels.roundingPercentage}))+` `+S(k.value.translations.of)+` `+S(H.value.breakdown[t].rootName),15,qt)):p(``,!0),Pr(e)?(v(),m(`text`,{key:2,x:C(l)(e,!0).x,"text-anchor":C(l)(e).anchor,y:C(ce)(e)+M.value.selected.labels.dataLabels.fontSize*3,fill:M.value.selected.labels.dataLabels.color,"font-size":M.value.selected.labels.dataLabels.fontSize,style:_(`font-weight:${M.value.selected.labels.dataLabels.bold?`bold`:``}`),class:g(M.value.selected.useMotion?`vue-ui-chestnut-animated`:``)},S(C(a)({v:H.value.breakdown[t].proportionToTree*100,s:`%`,r:M.value.selected.labels.roundingPercentage}))+` `+S(k.value.translations.proportionToTree),15,Jt)):p(``,!0)]))),256))])):p(``,!0),(v(!0),m(d,null,b(V.value,e=>(v(),m(`g`,null,[W.value&&W.value.id===e.id&&!H.value?(v(),m(`text`,{key:0,x:e.x1+6,y:e.y1+I.value.branchSize+24,"font-weight":`bold`,"text-anchor":`start`,"font-size":j.value.labels.dataLabels.fontSize,fill:j.value.labels.color,onClick:i[8]||=()=>{K(),$(),E.value=!1}},S(e.name)+`: `+S(C(u)(j.value.labels.dataLabels.formatter,e.value,C(a)({p:j.value.labels.dataLabels.prefix,v:e.value,s:j.value.labels.dataLabels.suffix,r:j.value.labels.dataLabels.roundingValue}),{datapoint:e})),9,Yt)):p(``,!0),W.value&&W.value.id===e.id&&!H.value?(v(),m(`text`,{key:1,x:e.x1+6,y:e.y1+I.value.branchSize+48,"text-anchor":`start`,"font-size":j.value.labels.dataLabels.fontSize,fill:j.value.labels.color,onClick:i[9]||=()=>{K(),$(),E.value=!1}},S(C(a)({v:e.proportionToRoot*100,s:`%`,r:j.value.labels.dataLabels.roundingPercentage}))+` `+S(k.value.translations.of)+` `+S(e.rootName),9,Xt)):p(``,!0),W.value&&W.value.id===e.id&&!H.value?(v(),m(`text`,{key:2,x:e.x1+6,y:e.y1+I.value.branchSize+72,"text-anchor":`start`,"font-size":j.value.labels.dataLabels.fontSize,fill:j.value.labels.color,onClick:i[10]||=()=>{K(),$(),E.value=!1}},S(C(a)({v:e.value/R.value*100,s:`%`,r:j.value.labels.dataLabels.roundingPercentage}))+` `+S(k.value.translations.proportionToTree),9,Zt)):p(``,!0)]))),256)),x(e.$slots,`svg`,{svg:{...I.value,isPrintingImg:C(cr)||C(lr)||C(Qr),isPrintingSvg:C($r)}},void 0,!0)],46,tt)):p(``,!0)]),e.$slots.watermark?(v(),m(`div`,Qt,[x(e.$slots,`watermark`,Ve(Re({isPrinting:C(cr)||C(lr)||C(Qr)||C($r)})),void 0,!0)])):p(``,!0),x(e.$slots,`legend`,{legend:z.value},void 0,!0),e.$slots.source?(v(),m(`div`,$t,[x(e.$slots,`source`,{},void 0,!0)],512)):p(``,!0),Jn.value&&k.value.userOptions.buttons.table?(v(),Ne(Ue(Wr.value.component),ze({key:6},Wr.value.props,{ref_key:`tableUnit`,ref:Zn,onClose:Kr}),Pe({content:qe(()=>[h(`div`,{ref_key:`tableContainer`,ref:hr,class:`vue-ui-chestnut-table`,style:_(`${k.value.table.useDialog?``:`max-height: 300px;margin-top:24px`}`)},[h(`div`,{style:_(`${k.value.table.useDialog?``:`padding-top:36px;`}position: relative`)},[k.value.table.useDialog?p(``,!0):(v(),m(`div`,{key:0,role:`button`,tabindex:`0`,style:_(`width:32px; position: absolute; top: 0; left:4px; padding: 0 0px; display: flex; align-items:center;justify-content:center;height: 36px; width: 32px; cursor:${F.value?`pointer`:`default`}; background:${k.value.table.th.backgroundColor};`),onClick:Kr,onKeypress:Je(Kr,[`enter`])},[Ie(C(Vn),{name:`close`,stroke:k.value.table.th.color,"stroke-width":2},null,8,[`stroke`])],36)),h(`div`,{style:{width:`100%`},class:g({"vue-ui-responsive":C(Gr)})},[h(`table`,en,[k.value.table.useDialog?p(``,!0):(v(),m(`caption`,{key:0,style:_({backgroundColor:k.value.table.th.backgroundColor,color:k.value.table.th.color,outline:k.value.table.th.outline}),class:`vue-ui-data-table__caption`},[Fe(S(N.value.title.text)+` `,1),N.value.title.subtitle.text?(v(),m(`span`,tn,S(N.value.title.subtitle.text),1)):p(``,!0)],4)),h(`thead`,null,[h(`tr`,{role:`row`,style:_(`background:${k.value.table.th.backgroundColor};color:${k.value.table.th.color}`)},[(v(!0),m(d,null,b(Y.value.head,e=>(v(),m(`th`,{style:_(`outline:${k.value.table.th.outline}`)},S(e),5))),256))],4)]),h(`tbody`,null,[(v(!0),m(d,null,b(Y.value.body,(e,t)=>(v(),m(`tr`,{class:g({"vue-ui-data-table__tbody__row":!0,"vue-ui-data-table__tbody__row-even":t%2==0,"vue-ui-data-table__tbody__row-odd":t%2!=0}),style:_(`background:${k.value.table.td.backgroundColor};color:${k.value.table.td.color}`)},[h(`td`,{class:`vue-ui-data-table__tbody__td`,style:_(`outline:${k.value.table.td.outline}`),"data-cell":Y.value.head[0]},[h(`div`,rn,[Y.value.body[t-1]&&Y.value.body[t-1].rootName===e.rootName?(v(),m(`span`,an)):(v(),m(`span`,on,S(e.rootName),1))])],12,nn),h(`td`,{class:`vue-ui-data-table__tbody__td`,style:_(`outline:${k.value.table.td.outline}`),"data-cell":Y.value.head[1]},[h(`div`,cn,[Y.value.body[t-1]&&Y.value.body[t-1].rootName===e.rootName?(v(),m(`span`,ln)):(v(),m(`span`,un,S(e.rootValue.toFixed(k.value.table.td.roundingValue)),1))])],12,sn),h(`td`,{class:`vue-ui-data-table__tbody__td`,style:_(`outline:${k.value.table.td.outline}`),"data-cell":Y.value.head[2]},[h(`div`,fn,[Y.value.body[t-1]&&Y.value.body[t-1].rootName===e.rootName?(v(),m(`span`,pn)):(v(),m(`span`,mn,S((e.rootToTotal*100).toFixed(k.value.table.td.roundingPercentage))+`% `,1))])],12,dn),h(`td`,{class:`vue-ui-data-table__tbody__td`,style:_(`outline:${k.value.table.td.outline}`),"data-cell":Y.value.head[3]},[h(`div`,gn,[Y.value.body[t-1]&&Y.value.body[t-1].branchName===e.branchName?(v(),m(`span`,_n)):(v(),m(`span`,vn,S(e.branchName),1))])],12,hn),h(`td`,{class:`vue-ui-data-table__tbody__td`,style:_(`outline:${k.value.table.td.outline}`),"data-cell":Y.value.head[4]},[h(`div`,bn,[Y.value.body[t-1]&&Y.value.body[t-1].branchName===e.branchName?(v(),m(`span`,xn)):(v(),m(`span`,Sn,S(e.branchValue.toFixed(k.value.table.td.roundingValue)),1))])],12,yn),h(`td`,{class:`vue-ui-data-table__tbody__td`,style:_(`outline:${k.value.table.td.outline}`),"data-cell":Y.value.head[5]},[h(`div`,wn,[Y.value.body[t-1]&&Y.value.body[t-1].branchName===e.branchName?(v(),m(`span`,Tn)):(v(),m(`span`,En,S((e.branchToRoot*100).toFixed(k.value.table.td.roundingPercentage))+`% `,1))])],12,Cn),h(`td`,{class:`vue-ui-data-table__tbody__td`,style:_(`outline:${k.value.table.td.outline}`),"data-cell":Y.value.head[6]},[h(`div`,On,[Y.value.body[t-1]&&Y.value.body[t-1].branchName===e.branchName?(v(),m(`span`,kn)):(v(),m(`span`,An,S((e.branchToTotal*100).toFixed(k.value.table.td.roundingPercentage))+`% `,1))])],12,Dn),h(`td`,{class:`vue-ui-data-table__tbody__td`,style:_(`outline:${k.value.table.td.outline}`),"data-cell":Y.value.head[7]},[h(`div`,Mn,S(e.nutName),1)],12,jn),h(`td`,{class:`vue-ui-data-table__tbody__td`,style:_(`outline:${k.value.table.td.outline}`),"data-cell":Y.value.head[8]},[h(`div`,Pn,S(e.nutValue.toFixed(k.value.table.td.roundingValue)),1)],12,Nn),h(`td`,{class:`vue-ui-data-table__tbody__td`,style:_(`outline:${k.value.table.td.outline}`),"data-cell":Y.value.head[9]},[h(`div`,In,S((e.nutToBranch*100).toFixed(k.value.table.td.roundingPercentage))+`% `,1)],12,Fn),h(`td`,{class:`vue-ui-data-table__tbody__td`,style:_(`outline:${k.value.table.td.outline}`),"data-cell":Y.value.head[10]},[h(`div`,Rn,S((e.nutToRoot*100).toFixed(k.value.table.td.roundingPercentage))+`% `,1)],12,Ln),h(`td`,{class:`vue-ui-data-table__tbody__td`,style:_(`outline:${k.value.table.td.outline}`),"data-cell":Y.value.head[11]},[h(`div`,Bn,S((e.nutToTotal*100).toFixed(k.value.table.td.roundingPercentage))+`% `,1)],12,zn)],6))),256))])])],2)],4)],4)]),_:2},[k.value.table.useDialog?{name:`title`,fn:qe(()=>[Fe(S(Wr.value.title),1)]),key:`0`}:void 0,k.value.table.useDialog?{name:`actions`,fn:qe(()=>[h(`button`,{tabindex:`0`,class:`vue-ui-user-options-button`,onClick:i[11]||=e=>Ir(k.value.userOptions.callbacks.csv)},[Ie(C(Vn),{name:`fileCsv`,stroke:Wr.value.props.color},null,8,[`stroke`])])]),key:`1`}:void 0]),1040)):p(``,!0),x(e.$slots,`skeleton`,{},()=>[C(tr)?(v(),Ne(he,{key:0})):p(``,!0)],!0)],46,Xe))}},[[`__scopeId`,`data-v-41623f2b`]]);export{Ye as n,Vn as t};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{n as t,r as n,t as r}from"./annotationSlots-OLiW25XN.js";import{t as i}from"./useConfig-C3FbHv4N.js";import{$ as a,D as o,Ht as s,S as c,X as ee,Y as l,at as te,i as ne,in as re,nt as ie,r as ae,sn as oe,t as se,w as ce,yt as le,zt as ue}from"./lib-rPeBMZrn.js";import{n as de,t as fe}from"./BaseScanner-8NdoBs7B.js";import{n as pe}from"./useHints-C-TwxM0Y.js";import{t as me}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{n as he}from"./resolveChartConfig-CIhClE5R.js";import{t as ge}from"./chartImage-DPGnEuYM.js";import{n as _e}from"./Title-BliHuXfT.js";import{t as ve}from"./useChartExport-BZts4KFb.js";import{n as ye,t as be}from"./tableIntegration-CNoJ1CIY.js";import{n as xe,r as Se,t as Ce}from"./userOptionsSlots-CWtXN5Q6.js";import{t as we}from"./usePrinter-DVf3YcG5.js";import{t as Te}from"./Shape-CRe8woTu.js";import{c as Ee}from"./canvas-lib-22VpOI4_.js";import{t as De}from"./useResponsive-CENUxfEL.js";import{t as Oe}from"./A11yDataTable-DWNlWXzs.js";import{t as ke}from"./useUserOptionState-CXlFnwPv.js";import{t as Ae}from"./useChartAccessibility-DOMuYJfm.js";import{t as je}from"./Legend-DM0ClX3D.js";import{t as Me}from"./vue_ui_chord-Fq6VBRT1.js";import{Fragment as u,Teleport as Ne,computed as d,createBlock as f,createCommentVNode as p,createElementBlock as m,createElementVNode as h,createSlots as Pe,createTextVNode as Fe,createVNode as Ie,defineAsyncComponent as g,guardReactiveProps as Le,mergeProps as Re,nextTick as ze,normalizeClass as _,normalizeProps as Be,normalizeStyle as v,onBeforeUnmount as Ve,onMounted as He,openBlock as y,ref as b,renderList as x,renderSlot as S,resolveDynamicComponent as Ue,shallowRef as We,toDisplayString as C,toRefs as Ge,unref as w,useCssVars as Ke,watch as qe,withCtx as T,withModifiers as Je}from"vue";var Ye=/* @__PURE__ */ e({default:()=>Dt}),Xe=[`id`],Ze=[`id`],Qe=[`id`],$e=[`xmlns`,`viewBox`,`aria-describedby`],et=[`width`,`height`],tt={key:1},nt=[`id`,`d`],rt={key:2},it=[`transform`],at=[`d`,`fill`,`stroke`,`stroke-width`,`onMouseenter`,`onMouseleave`,`onClick`],ot=[`d`,`fill`,`stroke`,`stroke-width`],st=[`d`,`fill`],ct=[`d`,`fill`,`stroke`,`stroke-width`,`onMouseenter`,`onClick`,`onMouseleave`],lt=[`d`,`fill`,`stroke`,`stroke-width`],ut=[`d`,`fill`,`stroke`,`stroke-width`],dt=[`d`,`fill`,`stroke`,`stroke-width`],ft={key:0},pt=[`x1`,`y1`,`x2`,`y2`,`stroke`,`stroke-width`],mt=[`x1`,`y1`,`x2`,`y2`,`stroke`,`stroke-width`],ht=[`cx`,`cy`,`r`,`stroke`,`stroke-width`,`fill`],gt=[`transform`,`fill`,`text-anchor`,`font-size`,`font-weight`],_t={key:1},vt=[`font-size`,`font-weight`,`fill`],yt=[`href`],bt=[`transform`,`text-anchor`,`font-size`,`font-weight`,`fill`,`innerHTML`],xt={key:5,style:{position:`absolute`,top:`100%`,left:`0`,width:`100%`},"data-dom-to-png-ignore":``,"aria-hidden":`true`},St={key:6,class:`vue-data-ui-watermark`},Ct=[`id`],wt=[`onClick`],Tt={key:9,"data-dom-to-png-ignore":``,class:`reset-wrapper`},Et={style:{"text-align":`right`,width:`100%`}},Dt=/*#__PURE__*/ me({__name:`vue-ui-chord`,props:{dataset:{type:Object,default(){return{}}},config:{type:Object,default(){return{}}}},emits:[`selectLegend`,`selectGroup`,`selectRibbon`,`copyAlt`],setup(e,{expose:me,emit:Ye}){Ke(e=>({v099901df:e.slicerColor}));let Dt=g(()=>import(`./vue-ui-accordion-E8TJfFeK.js`).then(e=>e.n)),Ot=g(()=>import(`./BaseIcon-CoY0vuL3.js`).then(e=>e.n)),kt=g(()=>import(`./DataTable-Dof6yhO7.js`)),At=g(()=>import(`./PackageVersion-DKSNC-YP.js`).then(e=>e.t)),jt=g(()=>import(`./PenAndPaper-DoNTA-SV.js`).then(e=>e.t)),Mt=g(()=>import(`./UserOptions-B9EyfU9n.js`).then(e=>e.n)),Nt=g(()=>import(`./BaseDraggableDialog-BK7dj9O6.js`).then(e=>e.n)),{vue_ui_chord:Pt}=i(),E=e,Ft=Ye,D=b(!!E.dataset&&Object.hasOwn(E.dataset,`matrix`)),O=b(ee()),k=b(null),A=b(null),j=b(null),It=b(0),M=b(null),Lt=b(null),Rt=b(null),zt=b(null),Bt=b(null),Vt=b(0),Ht=b(0),Ut=b(0),Wt=b(!1),N=We(null),P=We(null),Gt=b(!1),Kt=b(null),qt=b(null),F=b(`group`),I=b(null),Jt=b(!1),L=b(on()),R=d(()=>L.value.style.chart.arcs),z=d(()=>L.value.style.chart.ribbons),B=d(()=>L.value.style.chart);pe({config:()=>L.value,dataset:()=>E.dataset,component:`VueUiChord`,rules:[{test:e=>e.matrix&&e.matrix.length>12,message:[`👀 The number of groups > 12, the chart might become hard to read. Consider:`,``,`▶️ Using broader groups to reduce their number.`]}]});let V=d(()=>L.value.userOptions.useCursorPointer),Yt=d(()=>re({defaultConfig:{useCssAnimation:!1,userOptions:{show:!1},table:{show:!1},style:{chart:{backgroundColor:`#99999930`,legend:{backgroundColor:`transparent`},arcs:{stroke:`#6A6A6A`,labels:{show:!1}},ribbons:{stroke:`#6A6A6A`,underlayerOpacity:0,labels:{show:!1}}}}},userConfig:L.value.skeletonConfig??{}})),{loading:Xt,FINAL_DATASET:H,manualLoading:Zt}=de({...Ge(E),FINAL_CONFIG:L,prepareConfig:on,callback:()=>{Promise.resolve().then(async()=>{await ze(),W.value.showTable=L.value.table.show})},skeletonDataset:E.config?.skeletonDataset??{matrix:[[12e3,6e3,9e3,3e3],[2e3,1e4,2e3,6001],[8e3,1600,8e3,8001],[1e3,1e3,1e3,7001]],labels:[],colors:[`#DBDBDB`,`#C4C4C4`,`#ADADAD`,`#969696`]},skeletonConfig:re({defaultConfig:L.value,userConfig:Yt.value})}),{userOptionsVisible:Qt,setUserOptionsVisibility:$t,keepUserOptionState:en}=ke({config:L.value}),{svgRef:U}=Ae({config:B.value.title}),{isPrinting:tn,isImaging:nn,generatePdf:rn,generateImage:an}=we({elementId:`chord_${O.value}`,fileName:B.value.title.text||`vue-ui-chord`,options:L.value.userOptions.print}),W=b({showTable:L.value.table.show});function on(){return he(E.config,Pt,Me)}qe(()=>E.config,e=>{Xt.value||(L.value=on()),Qt.value=!L.value.userOptions.showOnChartHover,cn(),Vt.value+=1,Ht.value+=1,Ut.value+=1,X.value=L.value.initialRotation,W.value.showTable=L.value.table.show},{deep:!0});let G=d(()=>L.value.debug);qe(()=>E.dataset,()=>{sn(),cn(),Vt.value+=1,Ht.value+=1,Ut.value+=1});function sn(){if(ue(E.dataset)){te({componentName:`VueUiChord`,type:`dataset`,debug:G.value}),D.value=!1,Zt.value=!0;return}let e=le({datasetObject:E.dataset,requiredAttributes:[`matrix`]});if(e.length){G.value&&e.forEach(e=>{te({componentName:`VueUiChord`,type:`datasetAttribute`,property:e})}),D.value=!1,Zt.value=!0;return}let t=E.dataset.matrix;if(!Array.isArray(t)||t.length<2){G.value&&console.warn(`VueUiChord: dataset.matrix requires a minimum of 2 datapoints, for example:
|
|
2
|
+
|
|
3
|
+
matrix:[
|
|
4
|
+
[1, 1],
|
|
5
|
+
[1, 1]
|
|
6
|
+
]`),D.value=!1,Zt.value=!0;return}let n=t.length,r=t.findIndex(e=>!Array.isArray(e)||e.length!==n);r===-1?(D.value=!0,Zt.value=!1):(G.value&&console.warn(`VueUiChord - Invalid matrix: dataset.matrix at index ${r} has ${Array.isArray(t[r])?t[r].length:`NaN`} elements instead of the required ${n}
|
|
7
|
+
|
|
8
|
+
dataset.matrix[${r}] = [${Array.isArray(t[r])?t[r].toString():`invalid`}]`),D.value=!1,Zt.value=!0)}function cn(){if(sn(),L.value.responsive){let e=Ee(()=>{let{width:e,height:t,heightNoTitle:n,heightSource:r,heightTitle:i,heightLegend:a}=De({chart:M.value,title:B.value.title.text?Lt.value:null,legend:B.value.legend.show?Rt.value:null,source:zt.value,noTitle:Bt.value}),o=i+a+r+n;e<t?M.value.style.width=`100%`:(M.value.style.height=`100%`,U.value.style.height=`calc(100% - ${o}px)`)},100);N.value&&(P.value&&N.value.unobserve(P.value),N.value.disconnect()),N.value=new ResizeObserver(e),P.value=M.value.parentNode,N.value.observe(P.value),e()}un.value=setTimeout(()=>{Wt.value=!0},500)}function ln(){!H.value||!Object.hasOwn(H.value,`matrix`)||H.value.matrix.length<2?(G.value&&console.warn(`VueUiChord: dataset.matrix requires a minimum of 2 datapoints, for example:
|
|
9
|
+
|
|
10
|
+
matrix:[
|
|
11
|
+
[1, 1],
|
|
12
|
+
[1, 1]
|
|
13
|
+
]`),D.value=!1):H.value.matrix.forEach((e,t)=>{e.length!==H.value.matrix.length&&(G.value&&console.warn(`VueUiChord - Invalid matrix: dataset.matrix at index ${t} has ${e.length} elements instead of the required ${H.value.matrix.length}\n\ndataset.matrix[${t}] = [${e.toString()}] has a length of ${e.length} but should have the same length as the matrix itself (${H.value.matrix.length})`),D.value=!1)})}let un=b(null);He(()=>{Gt.value=!0,cn()});let K=b({height:600,width:600}),dn=d(()=>L.value.userOptions.show&&!B.value.title.text),fn=d(()=>ce(L.value.customPalette)),q=d(()=>({inner:K.value.width*.3*R.value.innerRadiusRatio,outer:K.value.width*.34*R.value.outerRadiusRatio})),pn=d(()=>R.value.padAngle/100),J=d(()=>({matrix:H.value.matrix??[[0]],labels:H.value.labels??[``],colors:H.value.colors&&Array.isArray(H.value.colors)&&H.value.colors.length?H.value.colors.map(e=>c(e)):H.value.matrix.map((e,t)=>fn.value[t]||s[t]||s[t%s.length])}));function mn(e,t){let n=e.length,r=q.value.inner,i=Array(n).fill(0),a=0;for(let t=0;t<n;t+=1)for(let r=0;r<n;r+=1)i[t]+=e[t][r],a+=e[t][r];let o=(2*Math.PI-t*n)/a,s=[],c=0;for(let e=0;e<n;e+=1){let n=c,r=n+i[e]*o;s.push({index:e,pattern:`pattern_${O.value}_${e}`,startAngle:n,endAngle:r,name:J.value.labels[e],id:ee(),color:J.value.colors[e],proportion:i[e]/a}),c=r+t}let l=[];for(let t=0;t<n;t+=1){let n=e[t].map((e,t)=>({j:t,v:e}));n.sort((e,t)=>t.v-e.v);let i=s[t].startAngle;for(let{j:e,v:a}of n){let n=i,c=n+a*o;l.push({index:t,subIndex:e,pattern:`pattern_${O.value}_${t}`,startAngle:n,endAngle:c,value:a,groupName:J.value.labels[t],groupId:s[t].id,groupColor:J.value.colors[t],midAngle:(n+c)/2,midBaseX:Math.cos((n+c)/2-Math.PI/2)*r,midBaseY:Math.sin((n+c)/2-Math.PI/2)*r}),i=c}}let te=[];for(let e of l){let t=l.find(t=>t.index===e.subIndex&&t.subIndex===e.index);te.push({source:e,target:t,id:ee()})}return{groups:s,chords:te}}let Y=d(()=>{let e=mn(J.value.matrix,pn.value);return ln(),e.chords.sort((e,t)=>Math.max(t.source.value,t.target.value)-Math.max(e.source.value,e.target.value)),e}),hn=d(()=>{let e=q.value.outer+z.value.labels.offset+12,t=z.value.labels.fontSize*.6,n=[];if(A.value){let r=A.value;if(r.source.value){let i=String(r.source.value);n.push({id:r.id+`-src`,theta:r.source.midAngle,w:i.length*t/e,midBaseX:r.source.midBaseX,midBaseY:r.source.midBaseY,groupColor:r.source.groupColor,value:r.source.value})}if(r.target&&r.target.value&&r.target.value!==r.source.value){let i=String(r.target.value);n.push({id:r.id+`-tgt`,theta:r.target.midAngle,w:i.length*t/e,midBaseX:r.target.midBaseX,midBaseY:r.target.midBaseY,groupColor:r.target.groupColor,value:r.target.value})}return n}function r(r){Y.value.chords.filter(e=>e.source.groupId===r&&e.source.value).forEach(r=>{{let i=String(r.source.value);n.push({id:r.id+`-src`,theta:r.source.midAngle,w:i.length*t/e,midBaseX:r.source.midBaseX,midBaseY:r.source.midBaseY,groupColor:r.source.groupColor,value:r.source.value})}if(r.target&&r.target.value&&r.target.value!==r.source.value){let i=String(r.target.value);n.push({id:r.id+`-tgt`,theta:r.target.midAngle,w:i.length*t/e,midBaseX:r.target.midBaseX,midBaseY:r.target.midBaseY,groupColor:r.target.groupColor,value:r.target.value})}})}return j.value&&r(j.value),k.value&&r(k.value.id),n}),gn=d(()=>{let e=hn.value.map(e=>({...e})).sort((e,t)=>e.theta-t.theta),t=z.value.labels.minSeparationDeg*Math.PI/180,n=!0,r=0;for(;n&&r++<10;){n=!1;for(let r=1;r<e.length;r+=1){let i=e[r-1],a=e[r],o=i.theta+i.w+t;a.theta<o&&(a.theta=o,n=!0)}let r=e[0],i=e[e.length-1],a=i.theta+i.w+t-2*Math.PI;r.theta<a&&(r.theta=a,n=!0)}return e});function _n(e,t,n,r){let i=e-Math.PI/2,a=t-Math.PI/2,o=Math.cos(i)*n,s=Math.sin(i)*n,c=Math.cos(a)*n,ee=Math.sin(a)*n,l=Math.cos(a)*r,te=Math.sin(a)*r,ne=Math.cos(i)*r,re=Math.sin(i)*r,ie=+(t-e>Math.PI);return`M${o},${s} A${n},${n} 0 ${ie} 1 ${c},${ee} L${l},${te} A${r},${r} 0 ${ie} 0 ${ne},${re} Z`}function vn(e,t){let n=q.value.inner,r=e.startAngle-Math.PI/2,i=e.endAngle-Math.PI/2,a=t.startAngle-Math.PI/2,o=t.endAngle-Math.PI/2,s=Math.cos(r)*n,c=Math.sin(r)*n,ee=Math.cos(i)*n,l=Math.sin(i)*n,te=Math.cos(a)*n,ne=Math.sin(a)*n,re=Math.cos(o)*n,ie=Math.sin(o)*n;return`M${s},${c}A${n},${n} 0 ${+(e.endAngle-e.startAngle>Math.PI)} 1 ${ee},${l}Q0,0 ${te},${ne}A${n},${n} 0 ${+(t.endAngle-t.startAngle>Math.PI)} 1 ${re},${ie}Q0,0 ${s},${c}Z`}let yn=d(()=>X.value*Math.PI/180);function bn(e){return(e.startAngle+e.endAngle)/2}function xn(e){return((bn(e)+yn.value)%(2*Math.PI)+2*Math.PI)%(2*Math.PI)}function Sn(e){let t=e+yn.value;return t=(t%(2*Math.PI)+2*Math.PI)%(2*Math.PI),t>Math.PI?`end`:`start`}function Cn(e){let t=e-Math.PI/2;return`translate(${Math.cos(t)*(q.value.outer+R.value.labels.offset+24)},${Math.sin(t)*(q.value.outer+R.value.labels.offset+24)})`}function wn(e,t,n){let r=e-Math.PI/2,i=t-Math.PI/2,a=Math.cos(r)*n,o=Math.sin(r)*n,s=Math.cos(i)*n,c=Math.sin(i)*n;return`M${a},${o} A${n},${n} 0 ${+(t-e>Math.PI)} 1 ${s},${c}`}let X=b(L.value.initialRotation),Tn=b(!1),En=0,Dn=0;function On(e){let t=U.value.getBoundingClientRect(),n=t.left+t.width/2,r=t.top+t.height/2,i=e.clientX??e.touches[0].clientX,a=e.clientY??e.touches[0].clientY;return Math.atan2(a-r,i-n)}function kn(e){L.value.enableRotation&&!Un.value&&(e.preventDefault(),Tn.value=!0,En=X.value,Dn=On(e))}function An(e){if(!Tn.value)return;let t=On(e);X.value=En+(t-Dn)*180/Math.PI}function jn(){Tn.value=!1}function Mn(e){return ne(z.value.labels.formatter,e,a({p:z.value.labels.prefix,v:e,s:z.value.labels.suffix,r:z.value.labels.rounding}))}He(()=>{window.addEventListener(`mousemove`,An),window.addEventListener(`mouseup`,jn),window.addEventListener(`touchmove`,An,{passive:!1}),window.addEventListener(`touchend`,jn)}),Ve(()=>{window.removeEventListener(`mousemove`,An),window.removeEventListener(`mouseup`,jn),window.removeEventListener(`touchmove`,An),window.removeEventListener(`touchend`,jn),clearTimeout(un.value),N.value&&(P.value&&N.value.unobserve(P.value),N.value.disconnect())});let Nn=b(!1);function Pn(e){Nn.value=e,It.value+=1}function Fn(e,t){L.value.events.datapointEnter&&L.value.events.datapointEnter({datapoint:e,seriesIndex:t}),!j.value&&(k.value=e)}function In(e,t){k.value=null,L.value.events.datapointLeave&&L.value.events.datapointLeave({datapoint:e,seriesIndex:t})}function Ln(e,t){Ft(`selectGroup`,e),L.value.events.datapointClick&&L.value.events.datapointClick({datapoint:e,seriesIndex:t})}function Rn(e,t){L.value.events.datapointEnter&&L.value.events.datapointEnter({datapoint:e,seriesIndex:t}),!j.value&&(A.value=e)}function zn(e,t){A.value=null,L.value.events.datapointLeave&&L.value.events.datapointLeave({datapoint:e,seriesIndex:t})}function Bn(e,t){Ft(`selectRibbon`,e),L.value.events.datapointClick&&L.value.events.datapointClick({datapoint:e,seriesIndex:t})}function Vn(e){return!j.value&&!k.value&&!A.value?.8:(j.value?j.value===e.source.groupId:k.value?k.value.id===e.source.groupId:A.value?.id===e.id)?1:.1}function Hn(e){return!j.value&&!k.value&&!A.value||(j.value?j.value===e.id:k.value?k.value.id===e.id:[A.value?.source.groupId,A.value?.target.groupId].includes(e.id))?1:.3}let Un=b(!1);function Wn(){Un.value=!Un.value}function Gn(){W.value.showTable=!W.value.showTable}function Kn(){return Y.value}let Z=b(null);function qn(){let e=L.value.initialRotation;Z.value!==null&&cancelAnimationFrame(Z.value);let t=()=>{X.value+=(e-X.value)*.05,Math.abs(X.value-e)<.1?(X.value=e,Z.value=null):Z.value=requestAnimationFrame(t)};Z.value=requestAnimationFrame(t)}Ve(()=>{Z.value!==null&&cancelAnimationFrame(Z.value)});function Jn(e){e===j.value?(j.value=null,Ft(`selectLegend`,null)):(j.value=e,Ft(`selectLegend`,Y.value.groups.find(t=>t.id===e)))}let Yn=d(()=>Y.value.groups.map((e,t)=>({name:e.name,color:e.color,shape:`circle`,patternIndex:t,pattern:`pattern_${O.value}_${t}`,id:e.id,select:()=>Jn(e.id),opacity:j.value?j.value===e.id?1:.3:1}))),Xn=d(()=>({cy:`chord-div-legend`,backgroundColor:B.value.legend.backgroundColor,color:B.value.legend.color,fontSize:B.value.legend.fontSize,paddingBottom:12,fontWeight:B.value.legend.bold?`bold`:``})),Q=d(()=>({head:Y.value.groups.map((e,t)=>({name:e.name||t,color:e.color})),body:J.value.matrix})),Zn=d(()=>{let e=[{name:``,color:null},...Q.value.head];return{colNames:e,head:e,body:Q.value.body.map((e,t)=>[Q.value.head[t],...Q.value.body[t]]),config:{th:{backgroundColor:L.value.table.th.backgroundColor,color:L.value.table.th.color,outline:L.value.table.th.outline},td:{backgroundColor:L.value.table.td.backgroundColor,color:L.value.table.td.color,outline:L.value.table.td.outline},breakpoint:L.value.table.responsiveBreakpoint}}});function Qn(e=null){ze(()=>{let t=J.value.matrix.map((e,t)=>[[J.value.labels[t]||t],e]),n=[[B.value.title.text],[B.value.title.subtitle.text],[[``],...J.value.labels.map((e,t)=>[e||t])]].concat(t),r=o(n);e?e(r):ie({csvContent:r,title:B.value.title.text||`vue-ui-chord`})})}let $n=ge(M,()=>B.value.title.text);function er(e,t){return`${J.value.labels[t]}${R.value.labels.showPercentage?a({p:` (`,v:isNaN(e.proportion)?0:e.proportion*100,s:`%)`,r:R.value.labels.roundingPercentage}):``}`}let tr=d(()=>be({config:L,style:B,mutableConfig:W,dialog:Nt,accordion:Dt,isFullscreen:Nn,parent:M,maxWidth:800,isCursorPointer:V}));qe(()=>W.value.showTable,e=>ye(e,L,Kt));function nr(){W.value.showTable=!1,qt.value&&qt.value.setTableIconState(!1)}let rr=d(()=>B.value.backgroundColor),ir=d(()=>B.value.legend),ar=d(()=>B.value.title),{isCallbackImaging:or,isCallbackSvg:sr,generateSvg:cr,onGenerateImage:lr}=ve({svg:U,title:ar,legend:ir,legendItems:Yn,backgroundColor:rr,getSvgCallback:()=>L.value.userOptions.callbacks.svg,generateImage:an});async function ur(){Ft(`copyAlt`,{config:L.value,dataset:J.value}),L.value.userOptions.callbacks.altCopy?await Promise.resolve(L.value.userOptions.callbacks.altCopy({config:L.value,dataset:J.value})):console.warn("Vue Data UI - A callback must be set for `altCopy` in userOptions.")}let dr=d(()=>(k.value?Y.value.chords.filter(e=>e.source.groupId===k.value.id):j.value?Y.value.chords.filter(e=>e.source.groupId===j.value):Y.value.chords).filter(e=>e.source.value)),$=d(()=>({groups:Y.value.groups.map((e,t)=>({type:`group`,index:t,item:e})),ribbons:dr.value.map((e,t)=>({type:`ribbon`,index:t,item:{...e,path:vn(e.source,e.target),color:J.value.colors[e.source.index]}}))})),fr=d(()=>({headers:[``,...Q.value.head.map(e=>e.name)],rows:Q.value.body.map((e,t)=>[Q.value.head[t]?.name??`${t}`,...e.map(e=>Mn(e))])}));function pr(e){let t=$.value.groups[e];t&&(F.value=`group`,I.value=e,A.value=null,k.value=t.item)}function mr(e){let t=$.value.ribbons[e];t&&(F.value=`ribbon`,I.value=e,k.value=null,A.value=t.item)}function hr(){I.value=null,F.value=`group`,k.value=null,A.value=null}function gr(){Jt.value=!0,F.value=`group`,I.value=null}function _r(){Jt.value=!1,hr()}function vr(e){if(!U.value||Un.value||document.activeElement!==U.value)return;let t=e.key===`ArrowLeft`,n=e.key===`ArrowRight`,r=e.key===`ArrowUp`,i=e.key===`ArrowDown`,a=e.key===`Enter`||e.key===` `,o=e.key===`Escape`;if(!t&&!n&&!r&&!i&&!a&&!o)return;if(e.preventDefault(),e.stopPropagation(),o){hr();return}if(r){F.value=`group`,$.value.groups.length&&pr(I.value===null?0:Math.min(I.value,$.value.groups.length-1));return}if(i){if(!$.value.ribbons.length)return;F.value=`ribbon`,mr(I.value===null?0:Math.min(I.value,$.value.ribbons.length-1));return}if(a){if(F.value===`group`){let e=$.value.groups[I.value];e&&Ln(e.item,e.index)}else{let e=$.value.ribbons[I.value];e&&Bn(e.item,e.index)}return}let s=F.value===`group`?$.value.groups:$.value.ribbons;if(!s.length)return;let c=I.value;c===null||c<0||c>=s.length?c=n?0:s.length-1:n?(c+=1,c>=s.length&&(c=0)):t&&(--c,c<0&&(c=s.length-1)),F.value===`group`?pr(c):mr(c)}return me({getData:Kn,getImage:$n,generateCsv:Qn,generateImage:an,generateSvg:cr,generatePdf:rn,toggleAnnotator:Wn,toggleTable:Gn,toggleFullscreen:Pn,copyAlt:ur}),(e,i)=>(y(),m(`div`,{ref_key:`chordChart`,ref:M,class:_({"vue-data-ui-component":!0,"vue-ui-chord":!0,"vue-data-ui-wrapper-fullscreen":Nn.value,"vue-data-ui-responsive":L.value.responsive}),style:v(`font-family:${L.value.style.fontFamily};width:100%; text-align:center;background:${B.value.backgroundColor}`),id:`chord_${O.value}`,onMouseenter:i[2]||=()=>w($t)(!0),onMouseleave:i[3]||=()=>w($t)(!1)},[h(`div`,{id:`chart-instructions-${O.value}`,class:`sr-only`},[h(`p`,null,C(L.value.a11y.translations.keyboardNavigation),1)],8,Ze),fr.value?.rows?.length?(y(),f(Oe,{key:0,uid:O.value,head:fr.value.headers,body:fr.value.rows,notice:L.value.a11y.translations.tableAvailable,caption:L.value.a11y.translations.tableCaption},null,8,[`uid`,`head`,`body`,`notice`,`caption`])):p(``,!0),L.value.userOptions.buttons.annotator&&w(U)?(y(),f(w(jt),Re({key:1},w(n)(L.value.userOptions.annotator),{color:B.value.color,backgroundColor:B.value.backgroundColor,active:Un.value,svgRef:w(U),isCursorPointer:V.value,palette:L.value.userOptions.annotatorPalette,onClose:Wn}),Pe({_:2},[x(w(r),n=>({name:n,fn:T(r=>[S(e.$slots,n,Be(Le(w(t)(n,r))),void 0,!0)])}))]),1040,[`color`,`backgroundColor`,`active`,`svgRef`,`isCursorPointer`,`palette`])):p(``,!0),S(e.$slots,`userConfig`,{},void 0,!0),dn.value?(y(),m(`div`,{key:2,ref_key:`noTitle`,ref:Bt,class:`vue-data-ui-no-title-space`,style:`height:36px; width: 100%;background:transparent`},null,512)):p(``,!0),B.value.title.text?(y(),m(`div`,{key:3,ref_key:`chartTitle`,ref:Lt,style:`width:100%;background:transparent;padding-bottom:24px`},[(y(),f(_e,{key:`title_${Vt.value}`,config:{title:{cy:`chord-div-title`,...B.value.title},subtitle:{cy:`chord-div-subtitle`,...B.value.title.subtitle}}},null,8,[`config`]))],512)):p(``,!0),h(`div`,{id:`legend-top-${O.value}`},null,8,Qe),L.value.userOptions.show&&D.value&&(w(en)||w(Qt))?(y(),f(w(Mt),Re({ref_key:`userOptionsRef`,ref:qt,key:`user_option_${It.value}`,backgroundColor:B.value.backgroundColor,color:B.value.color,isPrinting:w(tn),isImaging:w(nn),uid:O.value,hasTooltip:!1,hasLabel:!1,isFullscreen:Nn.value,chartElement:M.value},w(Se)(L.value.userOptions,`pdf csv img svg table fullscreen altCopy annotator`),{isAnnotation:Un.value,tableDialog:L.value.table.useDialog,isCursorPointer:V.value,onToggleFullscreen:Pn,onGeneratePdf:w(rn),onGenerateCsv:Qn,onGenerateImage:w(lr),onGenerateSvg:w(cr),onToggleTable:Gn,onToggleAnnotator:Wn,onCopyAlt:ur,style:{visibility:w(en)?w(Qt)?`visible`:`hidden`:`visible`}}),Pe({_:2},[x(w(xe)(e.$slots,`menuIcon optionPdf optionCsv optionImg optionSvg optionTable optionFullscreen optionAnnotator optionAltCopy custom-menu-before custom-menu-after`),t=>({name:t,fn:T(n=>[S(e.$slots,t,Be(Le(w(Ce)(t,n))),void 0,!0)])}))]),1040,[`backgroundColor`,`color`,`isPrinting`,`isImaging`,`uid`,`isFullscreen`,`chartElement`,`isAnnotation`,`tableDialog`,`isCursorPointer`,`onGeneratePdf`,`onGenerateImage`,`onGenerateSvg`,`style`])):p(``,!0),(y(),m(`svg`,{xmlns:w(se),ref_key:`svgRef`,ref:U,viewBox:`0 0 ${K.value.width} ${K.value.height}`,"aria-describedby":`chart-instructions-${O.value}`,tabindex:`0`,preserveAspectRatio:`xMidYMid meet`,style:{overflow:`visible`},class:_({"vue-ui-chord-rotating":Tn.value,"vue-ui-chord-idle":!Tn.value}),onMousedown:Je(kn,[`prevent`]),onTouchstart:Je(kn,[`prevent`]),onFocus:gr,onBlur:_r,onKeydown:vr},[Ie(w(At)),S(e.$slots,`svg-underlayer`,{svg:{height:600,width:600,isPrintingImg:w(tn)||w(nn)||w(or),isPrintingSvg:w(sr)}},void 0,!0),e.$slots[`chart-background`]?(y(),m(`foreignObject`,{key:0,x:0,y:0,width:K.value.width<=0?10:K.value.width,height:K.value.height<=0?10:K.value.height,style:{pointerEvents:`none`}},[S(e.$slots,`chart-background`,{},void 0,!0)],8,et)):p(``,!0),R.value.labels.curved?(y(),m(`defs`,tt,[(y(!0),m(u,null,x(Y.value.groups,(e,t)=>(y(),m(`path`,{key:`labelPath-${t}`,id:`labelPath-${t}_${O.value}`,d:wn(e.startAngle,e.endAngle,(q.value.inner+q.value.outer)/2+R.value.labels.offset),fill:`none`},null,8,nt))),128))])):p(``,!0),e.$slots.pattern?(y(),m(`g`,rt,[(y(!0),m(u,null,x(Y.value.groups,(t,n)=>(y(),m(`defs`,null,[S(e.$slots,`pattern`,Re({ref_for:!0},{seriesIndex:t.index,patternId:`pattern_${O.value}_${n}`}),void 0,!0)]))),256))])):p(``,!0),h(`g`,{transform:`translate(${K.value.width/2}, ${K.value.height/2}) rotate(${X.value})`},[(y(!0),m(u,null,x(Y.value.groups,(t,n)=>(y(),m(`g`,null,[(y(),m(`path`,{class:_({"vue-ui-chord-arc":!0,"vue-ui-chord-arc-animated":L.value.useCssAnimation&&!Wt.value}),key:`arc-${n}`,d:_n(t.startAngle,t.endAngle,q.value.outer,q.value.inner),fill:J.value.colors[n],stroke:R.value.stroke,"stroke-width":R.value.strokeWidth,"stroke-linecap":`round`,"stroke-linejoin":`round`,style:v({opacity:Hn(t)}),onMouseenter:e=>Fn(t,n),onMouseleave:e=>In(t,n),onClick:e=>Ln(t,n)},null,46,at)),e.$slots.pattern?(y(),m(`path`,{class:_({"vue-ui-chord-arc":!0,"vue-ui-chord-arc-animated":L.value.useCssAnimation&&!Wt.value}),key:`arc-${n}`,d:_n(t.startAngle,t.endAngle,q.value.outer,q.value.inner),fill:`url(#${t.pattern})`,stroke:R.value.stroke,"stroke-width":R.value.strokeWidth,"stroke-linecap":`round`,"stroke-linejoin":`round`,style:v({opacity:Hn(t),pointerEvents:`none`})},null,14,ot)):p(``,!0)]))),256)),h(`g`,null,[(y(!0),m(u,null,x(k.value?Y.value.chords.filter(e=>e.source.groupId===k.value.id):j.value?Y.value.chords.filter(e=>e.source.groupId===j.value):Y.value.chords,(t,n)=>(y(),m(u,{key:`ribbon-${t.id}`},[t.source.value?(y(),m(`path`,{key:0,class:_({"vue-ui-chord-ribbon":!0}),d:vn(t.source,t.target),fill:B.value.backgroundColor,style:v({opacity:z.value.underlayerOpacity})},null,12,st)):p(``,!0),t.source.value?(y(),m(`path`,{key:1,class:_({"vue-ui-chord-ribbon":!0}),d:vn(t.source,t.target),fill:J.value.colors[t.source.index],stroke:z.value.stroke,"stroke-width":z.value.strokeWidth,"stroke-linecap":`round`,"stroke-linejoin":`round`,style:v({opacity:Vn(t)}),onMouseenter:e=>Rn({...t,path:vn(t.source,t.target),color:J.value.colors[t.source.index]},n),onClick:e=>Bn({...t,color:J.value.colors[t.source.index]},n),onMouseleave:e=>zn({...t,color:J.value.colors[t.source.index]},n)},null,44,ct)):p(``,!0),t.source.value&&e.$slots.pattern?(y(),m(`path`,{key:2,class:_({"vue-ui-chord-ribbon":!0}),d:vn(t.source,t.target),fill:`url(#pattern_${O.value}_${t.source.index})`,stroke:z.value.stroke,"stroke-width":z.value.strokeWidth,"stroke-linecap":`round`,"stroke-linejoin":`round`,style:v({opacity:Vn(t),pointerEvents:`none`})},null,12,lt)):p(``,!0)],64))),128)),A.value?(y(),m(`path`,{key:0,d:A.value.path,fill:A.value.color,stroke:z.value.stroke,"stroke-width":z.value.strokeWidth,"stroke-linecap":`round`,"stroke-linejoin":`round`,class:_({"vue-ui-chord-ribbon":!0}),style:{pointerEvents:`none`}},null,8,ut)):p(``,!0),A.value&&e.$slots.pattern?(y(),m(`path`,{key:1,d:A.value.path,fill:`url(#${A.value.source.pattern})`,stroke:z.value.stroke,"stroke-width":z.value.strokeWidth,"stroke-linecap":`round`,"stroke-linejoin":`round`,class:_({"vue-ui-chord-ribbon":!0}),style:{pointerEvents:`none`}},null,8,dt)):p(``,!0)]),(k.value||A.value||j.value)&&z.value.labels.show?(y(),m(`g`,ft,[(y(!0),m(u,null,x(gn.value,e=>(y(),m(u,{key:e.id},[h(`line`,{x1:e.midBaseX,y1:e.midBaseY,x2:Math.cos(e.theta-Math.PI/2)*(q.value.outer+z.value.labels.offset+12),y2:Math.sin(e.theta-Math.PI/2)*(q.value.outer+z.value.labels.offset+12),stroke:B.value.backgroundColor,"stroke-width":z.value.labels.connector.strokeWidth*3,"pointer-events":`none`},null,8,pt),h(`line`,{x1:e.midBaseX,y1:e.midBaseY,x2:Math.cos(e.theta-Math.PI/2)*(q.value.outer+z.value.labels.offset+12),y2:Math.sin(e.theta-Math.PI/2)*(q.value.outer+z.value.labels.offset+12),stroke:z.value.labels.connector.stroke,"stroke-width":z.value.labels.connector.strokeWidth,"pointer-events":`none`},null,8,mt),z.value.labels.marker.show?(y(),m(`circle`,{key:0,cx:Math.cos(e.theta-Math.PI/2)*(q.value.outer+z.value.labels.offset+12),cy:Math.sin(e.theta-Math.PI/2)*(q.value.outer+z.value.labels.offset+12),r:z.value.labels.marker.radius,stroke:z.value.labels.marker.stroke,"stroke-width":z.value.labels.marker.strokeWidth,fill:e.groupColor,"pointer-events":`none`},null,8,ht)):p(``,!0),h(`text`,{transform:`
|
|
14
|
+
translate(
|
|
15
|
+
${Math.cos(e.theta-Math.PI/2)*(q.value.outer+z.value.labels.offset+24)},
|
|
16
|
+
${Math.sin(e.theta-Math.PI/2)*(q.value.outer+z.value.labels.offset+24)}
|
|
17
|
+
) rotate(${-X.value})
|
|
18
|
+
`,fill:z.value.labels.useSerieColor?e.groupColor:z.value.labels.color,"text-anchor":Sn(e.theta),"font-size":z.value.labels.fontSize,"font-weight":z.value.labels.bold?`bold`:`normal`,dy:`.35em`,"pointer-events":`none`},C(Mn(e.value)),9,gt)],64))),128))])):p(``,!0),R.value.labels.show?(y(),m(`g`,_t,[R.value.labels.curved?(y(!0),m(u,{key:0},x(Y.value.groups,(e,t)=>(y(),m(`text`,{class:`vue-ui-chord-label-curved`,key:`curved-label-${t}`,"font-size":R.value.labels.fontSize,"font-weight":R.value.labels.bold?`bold`:`normal`,fill:R.value.labels.adaptColorToBackground?w(ae)(J.value.colors[t]):R.value.labels.color},[h(`textPath`,{href:`#labelPath-${t}_${O.value}`,startOffset:`50%`,"text-anchor":`middle`},C(J.value.labels[t])+C(R.value.labels.showPercentage?w(a)({p:` (`,v:isNaN(e.proportion)?0:e.proportion*100,s:`%)`,r:R.value.labels.roundingPercentage}):``),9,yt)],8,vt))),128)):!k.value&&!A.value&&!j.value?(y(!0),m(u,{key:1},x(Y.value.groups,(e,t)=>(y(),m(`text`,{class:`vue-ui-chord-label-straight`,key:`label-${t}`,transform:`
|
|
19
|
+
${Cn((e.startAngle+e.endAngle)/2)}
|
|
20
|
+
rotate(${-X.value})
|
|
21
|
+
`,dy:`.35em`,"text-anchor":xn(e)>Math.PI?`end`:`start`,"font-size":R.value.labels.fontSize,"font-weight":R.value.labels.bold?`bold`:`normal`,fill:R.value.labels.color,innerHTML:w(l)({content:w(oe)(er(e,t)),fontSize:R.value.labels.fontSize,fill:R.value.labels.color,x:0,y:0})},null,8,bt))),128)):p(``,!0)])):p(``,!0)],8,it),S(e.$slots,`svg`,{svg:{height:600,width:600,isPrintingImg:w(tn)||w(nn)||w(or),isPrintingSvg:w(sr)}},void 0,!0)],42,$e)),e.$slots.hint?(y(),m(`div`,xt,[S(e.$slots,`hint`,Be(Le({hint:L.value.a11y.translations.keyboardNavigation,isVisible:Jt.value})),void 0,!0)])):p(``,!0),e.$slots.watermark?(y(),m(`div`,St,[S(e.$slots,`watermark`,Be(Le({isPrinting:w(tn)||w(nn)||w(or)||w(sr)})),void 0,!0)])):p(``,!0),h(`div`,{id:`legend-bottom-${O.value}`},null,8,Ct),Gt.value&&(B.value.legend.show||e.$slots.legend)?(y(),f(Ne,{key:7,to:B.value.legend.position===`top`?`#legend-top-${O.value}`:`#legend-bottom-${O.value}`},[h(`div`,{ref_key:`chartLegend`,ref:Rt},[S(e.$slots,`legend`,{legend:Yn.value},()=>[B.value.legend.show?(y(),f(je,{key:`legend_${Ut.value}`,legendSet:Yn.value,config:Xn.value,isCursorPointer:V.value,onClickMarker:i[0]||=({legend:e})=>Jn(e.id)},Pe({item:T(({legend:e})=>[h(`div`,{style:v({opacity:j.value?j.value===e.id?1:.3:1}),onClick:t=>e.select()},C(e.name),13,wt)]),_:2},[e.$slots.pattern?{name:`legend-pattern`,fn:T(({legend:e,index:t})=>[Ie(Te,{shape:e.shape,radius:30,stroke:`none`,plot:{x:30,y:30},fill:`url(#pattern_${O.value}_${t})`},null,8,[`shape`,`fill`])]),key:`0`}:void 0]),1032,[`legendSet`,`config`,`isCursorPointer`])):p(``,!0)],!0)],512)],8,[`to`])):p(``,!0),e.$slots.source?(y(),m(`div`,{key:8,ref_key:`source`,ref:zt,dir:`auto`},[S(e.$slots,`source`,{},void 0,!0)],512)):p(``,!0),X.value===L.value.initialRotation?p(``,!0):(y(),m(`div`,Tt,[S(e.$slots,`reset-action`,{reset:qn},()=>[h(`button`,{"data-cy-reset":``,tabindex:`0`,role:`button`,class:`vue-data-ui-refresh-button`,style:v({background:B.value.backgroundColor,cursor:V.value?`pointer`:`default`}),onClick:qn},[Ie(w(Ot),{name:`refresh`,stroke:B.value.color},null,8,[`stroke`])],4)],!0)])),D.value&&L.value.userOptions.buttons.table?(y(),f(Ue(tr.value.component),Re({key:10},tr.value.props,{ref_key:`tableUnit`,ref:Kt,onClose:nr}),Pe({content:T(()=>[(y(),f(w(kt),{key:`table_${Ht.value}`,colNames:Zn.value.colNames,head:Zn.value.head,body:Zn.value.body,config:Zn.value.config,title:L.value.table.useDialog?``:tr.value.title,withCloseButton:!L.value.table.useDialog,isCursorPointer:V.value,onClose:nr},{th:T(({th:e})=>[Fe(C(e.name),1)]),td:T(({td:e})=>[h(`div`,Et,C(e.name?e.name:Mn(e)),1)]),_:1},8,[`colNames`,`head`,`body`,`config`,`title`,`withCloseButton`,`isCursorPointer`]))]),_:2},[L.value.table.useDialog?{name:`title`,fn:T(()=>[Fe(C(tr.value.title),1)]),key:`0`}:void 0,L.value.table.useDialog?{name:`actions`,fn:T(()=>[h(`button`,{tabindex:`0`,class:`vue-ui-user-options-button`,onClick:i[1]||=e=>Qn(L.value.userOptions.callbacks.csv),style:v({cursor:V.value?`pointer`:`default`})},[Ie(w(Ot),{name:`fileCsv`,stroke:tr.value.props.color},null,8,[`stroke`])],4)]),key:`1`}:void 0]),1040)):p(``,!0),S(e.$slots,`skeleton`,{},()=>[w(Xt)?(y(),f(fe,{key:0})):p(``,!0)],!0)],46,Xe))}},[[`__scopeId`,`data-v-2c749955`]]);export{Ye as n,Dt as t};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{n as t,r as n,t as r}from"./annotationSlots-OLiW25XN.js";import{t as i}from"./useConfig-C3FbHv4N.js";import{$ as a,D as o,Dt as s,Ft as c,Ht as l,Q as u,S as d,X as f,Zt as p,at as m,i as ee,in as h,nn as g,nt as te,q as ne,r as re,t as ie,tn as ae,w as oe,zt as se}from"./lib-rPeBMZrn.js";import{n as ce,t as le}from"./BaseScanner-8NdoBs7B.js";import{n as ue,t as de}from"./useHints-C-TwxM0Y.js";import{t as fe}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{n as pe}from"./resolveChartConfig-CIhClE5R.js";import{t as me}from"./chartImage-DPGnEuYM.js";import{n as he}from"./Title-BliHuXfT.js";import{t as ge}from"./useChartExport-BZts4KFb.js";import{t as _e}from"./tableIntegration-CNoJ1CIY.js";import{n as ve,r as ye,t as be}from"./userOptionsSlots-CWtXN5Q6.js";import{t as xe}from"./usePrinter-DVf3YcG5.js";import{t as Se}from"./useTransitions-ChGGrtrv.js";import{c as Ce}from"./canvas-lib-22VpOI4_.js";import{t as we}from"./useResponsive-CENUxfEL.js";import{t as Te}from"./DefGrad-DKMq1REY.js";import{t as Ee}from"./A11yDataTable-DWNlWXzs.js";import{t as De}from"./useUserOptionState-CXlFnwPv.js";import{t as Oe}from"./useChartAccessibility-DOMuYJfm.js";import{n as ke}from"./annotationViewport-X8fvs7pz.js";import{t as Ae}from"./usePanZoom-CE6Ofyy8.js";import{t as je}from"./vue_ui_circle_pack-CfXkXi7v.js";import{Fragment as _,computed as v,createBlock as y,createCommentVNode as b,createElementBlock as x,createElementVNode as S,createSlots as Me,createTextVNode as Ne,createVNode as Pe,defineAsyncComponent as C,guardReactiveProps as w,mergeProps as T,nextTick as Fe,normalizeClass as E,normalizeProps as D,normalizeStyle as Ie,onBeforeUnmount as Le,onMounted as Re,openBlock as O,ref as k,renderList as A,renderSlot as j,resolveDynamicComponent as ze,toDisplayString as M,toRefs as Be,unref as N,useCssVars as Ve,watch as He,withCtx as P}from"vue";function Ue(e,t=0){let n=e.reduce((e,{x:n,r})=>Math.min(e,n-r-t),1/0),r=e.reduce((e,{x:n,r})=>Math.max(e,n+r+t),-1/0),i=e.reduce((e,{y:n,r})=>Math.min(e,n-r-t),1/0),a=e.reduce((e,{y:n,r})=>Math.max(e,n+r+t),-1/0);return[n,i,r-n,a-i]}function We(e,t,n){let r=e._,i=e.next._,a=r.r+i.r,o=(r.x*i.r+i.x*r.r)/a,s=(r.y*i.r+i.y*r.r)/a;return Math.max(Math.abs(o*n),Math.abs(s*t))}function Ge(e,t,n){let r=We,i=e.length;if(!i)return e;e.sort((e,t)=>t.r-e.r);let a,o,s;if(a=e[0],a.x=0,a.y=0,!(i>1))return e;if(o=e[1],a.x=-o.r,o.x=a.r,o.y=0,!(i>2))return Je(e,n,t),e;Ke(o,a,s=e[2]),a=new tt(a),o=new tt(o),s=new tt(s),a.next=s.previous=o,o.next=a.previous=s,s.next=o.previous=a;packLoop:for(let c=3;c<i;++c){Ke(a._,o._,s=e[c]),s=new tt(s);let i=o.next,l=a.previous,u=o._.r,d=a._.r;do if(u<=d){if(qe(i._,s._)){o=i,a.next=o,o.previous=a,--c;continue packLoop}u+=i._.r,i=i.next}else{if(qe(l._,s._)){a=l,a.next=o,o.previous=a,--c;continue packLoop}d+=l._.r,l=l.previous}while(i!==l.next);s.previous=a,s.next=o,a.next=o.previous=o=s;let f=a,p=r(a,n,t),m=a.next;for(;m!==o;){let e=r(m,n,t);e<p&&(f=m,p=e),m=m.next}a=f,o=a.next}return Je(e,n,t),Ze(e,n,t),e}function Ke(e,t,n){let r=e.x-t.x,i=e.y-t.y,a=r*r+i*i;if(a){let o=(t.r+n.r)**2,s=(e.r+n.r)**2;if(o>s){let t=(a+s-o)/(2*a),c=Math.sqrt(Math.max(0,s/a-t*t));n.x=e.x-t*r-c*i,n.y=e.y-t*i+c*r}else{let e=(a+o-s)/(2*a),c=Math.sqrt(Math.max(0,o/a-e*e));n.x=t.x+e*r-c*i,n.y=t.y+e*i+c*r}}else n.x=t.x+n.r,n.y=t.y}function qe(e,t){let n=e.r+t.r-1e-6,r=t.x-e.x,i=t.y-e.y;return n>0&&n*n>r*r+i*i}function Je(e,t,n){if(e.length<4)return;let r=e[0].r,i=e.findIndex(e=>e.r<r*.6),a=i===-1?Math.min(e.length,12):i,o=e.slice(0,Math.max(3,a));for(let t=0;t<80;t+=1){let t=!1;for(let n=0;n<o.length;n+=1){let r=o[n],i=.06*(1-n/Math.max(1,o.length)),a=r.x*(1-i),s=r.y*(1-i);Ye(r,a,s,e,n)&&(r.x=a,r.y=s,t=!0)}if(Xe(o),!t)break}let s=o.reduce((e,t)=>e+t.x,0)/o.length,c=o.reduce((e,t)=>e+t.y,0)/o.length;for(let t of e)t.x-=s,t.y-=c}function Ye(e,t,n,r){let i=e.x,a=e.y;e.x=t,e.y=n;for(let t of r)if(t!==e&&qe(e,t))return e.x=i,e.y=a,!1;return e.x=i,e.y=a,!0}function Xe(e){for(let t=0;t<6;t+=1){let t=!1;for(let n=0;n<e.length-1;n+=1)for(let r=n+1;r<e.length;r+=1){let i=e[n],a=e[r],o=a.x-i.x,s=a.y-i.y,c=Math.sqrt(o*o+s*s)||1e-6,l=i.r+a.r;if(c<l){let e=(l-c)/2,n=o/c,r=s/c;i.x-=n*e,i.y-=r*e,a.x+=n*e,a.y+=r*e,t=!0}}if(!t)break}}function Ze(e,t,n){if(e.length<6)return;let r=e[0].r,i=e.findIndex(e=>e.r<=r*.45);if(i!==-1)for(let r=i;r<e.length;r+=1){let i=e[r],a=Qe(i,e.slice(0,r),t,n);a&&(i.x=a.x,i.y=a.y)}}function Qe(e,t,n,r){if(t.length<2)return null;let i=null,a=1/0;for(let o=0;o<t.length-1;o+=1)for(let s=o+1;s<t.length;s+=1){let c=t[o],l=t[s],u=$e(c,l,e.r);for(let o of u){if(!o)continue;let s={...e,x:o.x,y:o.y};if(!F(s,t))continue;let c=et(s,t,n,r);c<a&&(a=c,i=o)}}return i}function $e(e,t,n){let r=e.r+n,i=t.r+n,a=t.x-e.x,o=t.y-e.y,s=a*a+o*o,c=Math.sqrt(s);if(!c||c>r+i||c<Math.abs(r-i))return[];let l=(r*r-i*i+s)/(2*c),u=r*r-l*l;if(u<0)return[];let d=Math.sqrt(u),f=a/c,p=o/c,m=e.x+l*f,ee=e.y+l*p,h=-p*d,g=f*d;return[{x:m+h,y:ee+g},{x:m-h,y:ee-g}]}function F(e,t){for(let n of t)if(qe(n,e))return!1;return!0}function et(e,t,n,r){let i=e.x/Math.max(1,n),a=e.y/Math.max(1,r),o=i*i+a*a,s=[];for(let n of t){let t=e.x-n.x,r=e.y-n.y,i=Math.sqrt(t*t+r*r)-(e.r+n.r);s.push(i)}s.sort((e,t)=>e-t);let c=s[0]??0,l=s[1]??c,u=s[2]??l;return c*8+l*4+u*2+o*e.r*12}var tt=class{constructor(e){this._=e,this.next=null,this.previous=null}},nt=/* @__PURE__ */ e({default:()=>I}),rt=[`id`],it=[`id`],at=[`xmlns`,`aria-describedby`,`viewBox`],ot=[`x`,`y`,`width`,`height`],st={key:0},ct=[`x`,`y`,`width`,`height`,`stroke`,`stroke-width`,`fill`,`rx`,`onMouseenter`,`onMouseout`,`onClick`],lt=[`x`,`y`,`width`,`height`,`stroke`,`stroke-width`,`fill`,`rx`],ut=[`x`,`y`,`width`,`height`,`fill`,`rx`],dt=[`transform`,`font-size`,`fill`,`font-weight`],ft=[`transform`,`font-size`,`fill`,`font-weight`],pt={key:1,style:{pointerEvents:`none`}},mt=[`stroke`,`stroke-width`,`stroke-dasharray`,`opacity`,`d`],ht=[`x`,`y`,`width`,`height`,`rx`,`ry`,`fill`,`stroke`,`stroke-width`,`filter`],gt=[`fill`,`x`,`y`,`rx`,`width`,`height`],_t=[`transform`,`font-size`,`fill`,`font-family`],vt=[`dy`],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={key:6,"data-dom-to-png-ignore":``,class:`reset-wrapper`},St={style:{display:`flex`,"align-items":`center`}},I=/*#__PURE__*/ fe({__name:`vue-ui-circle-pack`,props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:[`selectDatapoint`,`copyAlt`],setup(e,{expose:fe,emit:We}){Ve(e=>({v9b29cc6a:gr.value}));let Ke=C(()=>import(`./Tooltip-C1q0Qoh7.js`)),qe=C(()=>import(`./BaseIcon-CoY0vuL3.js`).then(e=>e.n)),Je=C(()=>import(`./vue-ui-accordion-E8TJfFeK.js`).then(e=>e.n)),Ye=C(()=>import(`./DataTable-Dof6yhO7.js`)),Xe=C(()=>import(`./UserOptions-B9EyfU9n.js`).then(e=>e.n)),Ze=C(()=>import(`./PenAndPaper-DoNTA-SV.js`).then(e=>e.t)),Qe=C(()=>import(`./PackageVersion-DKSNC-YP.js`).then(e=>e.t)),$e=C(()=>import(`./BaseDraggableDialog-BK7dj9O6.js`).then(e=>e.n)),F=e,et=We,{vue_ui_circle_pack:tt}=i(),nt=v(()=>!!F.dataset&&F.dataset.length),I=k(f()),L=k(null),Ct=k(null),wt=k(null),Tt=k(0),Et=k(0),Dt=k(0),Ot=k(null),kt=k(null),At=k(null),jt=k(!1),Mt=k(``),R=k(null),z=k(null),Nt=k({x:0,y:0}),Pt=k(`pointer`),Ft=k(!1),B=k(Ut()),V=v(()=>B.value.style.chart.circles.labels),H=v(()=>B.value.style.chart.circles),U=v(()=>B.value.style.chart);ue({config:()=>B.value,dataset:()=>F.dataset,component:`VueUiCirclePack`,rules:[de.emptyArray,{test:e=>e.length===1&&(!e[0].children||e[0]?.children.length===0),message:[`👀 The dataset only has a single series. Consider:`,``,`▶️ Using a value display instead of a chart component, or using VueUiKpi.`]},{test:e=>e.length===1&&e[0]?.children&&e[0]?.children.length<6,message:[`👀 The number of datapoints is probably too low for this type of chart. Consider:`,``,`▶️ Using VueUiDonut or VueUiWaffle instead.`]}]});let{transitionEnabled:W}=Se({config:()=>B.value.transitions,dataset:()=>F.dataset}),It=v(()=>B.value.userOptions.useCursorPointer),Lt=v(()=>h({defaultConfig:{userOptions:{show:!1},table:{show:!1},style:{chart:{backgroundColor:`#99999930`,circles:{stroke:`#6A6A6A`,labels:{name:{show:!1},value:{show:!1}}}}}},userConfig:B.value.skeletonConfig??{}})),{loading:Rt,FINAL_DATASET:zt}=ce({...Be(F),FINAL_CONFIG:B,prepareConfig:Ut,skeletonDataset:F.config?.skeletonDataset??[{name:`_`,value:13,color:`#F2F2F2`},{name:`_`,value:8,color:`#DBDBDB`},{name:`_`,value:5,color:`#ADADAD`},{name:`_`,value:3,color:`#969696`},{name:`_`,value:2,color:`#808080`},{name:`_`,value:1,color:`#696969`}],skeletonConfig:h({defaultConfig:B.value,userConfig:Lt.value})}),{svgRef:G}=Oe({config:U.value.title}),{userOptionsVisible:Bt,setUserOptionsVisibility:Vt,keepUserOptionState:Ht}=De({config:B.value});function Ut(){return pe(F.config,tt,je)}let Wt=p(F.config);He(()=>F.config,(e,t)=>{let n=p(e),r=n!==Wt;Wt=n;let i=Ut();r?(B.value=i,Bt.value=!B.value.userOptions.showOnChartHover,mn(),Tt.value+=1,Et.value+=1,K.value.showTable=B.value.table.show,K.value.showTooltip=U.value.tooltip.show,K.value.showZoom=U.value.zoom?.show??!1):(B.value.style.chart.tooltip=i.style.chart.tooltip,K.value.showTooltip=B.value.style.chart.tooltip.show)},{deep:!0});let{isPrinting:Gt,isImaging:Kt,generatePdf:qt,generateImage:Jt}=xe({elementId:`vue-ui-circle-pack_${I.value}`,fileName:U.value.title.text||`vue-ui-circle-pack`,options:B.value.userOptions.print}),Yt=v(()=>B.value.userOptions.show&&!U.value.title.text),K=k({showTable:B.value.table.show,showTooltip:U.value.tooltip.show,showZoom:U.value.zoom?.show??!1});He(B,()=>{K.value={showTable:B.value.table.show,showTooltip:U.value.tooltip.show,showZoom:U.value.zoom?.show??!1}},{immediate:!0});let q=k({h:10,w:10}),Xt=k([0,0,100,100]),Zt=k({x:0,y:0,width:100,height:100}),Qt=v(()=>B.value.debug),$t=v(()=>{let e=B.value.style?.chart||{};return e.dimensions&&typeof e.dimensions.width==`number`?e.dimensions.width:typeof e.width==`number`?e.width:300}),en=v(()=>{let e=B.value.style?.chart||{};return e.dimensions&&typeof e.dimensions.height==`number`?e.dimensions.height:typeof e.height==`number`?e.height:300}),J=k([]),Y=k([]),X=k(null),Z=k(null);function tn(e,t){q.value={w:e,h:t};let n=gn.value.map(nn);if(!n.length){let n={x:0,y:0,width:e,height:t};J.value=[],Y.value=[],Xt.value=[n.x,n.y,n.width,n.height],Zt.value={...n},Mn(n);return}let r=Ge(n,t,e),[i,a,o,s]=Ue(r,1),c=Math.min(o?e/o:1,s?t/s:1),l=(e-o*c)/2,u=(t-s*c)/2,d=r.map(e=>({...e,x:(e.x-i)*c+l,y:(e.y-a)*c+u,r:e.r*c}));J.value=ln(d),Y.value=J.value;let f=Un({x:0,y:0,width:e,height:t});Xt.value=[f.x,f.y,f.width,f.height],Zt.value={...f},Mn(f)}function nn(e){return{...e,children:Array.isArray(e.children)?e.children.map(nn):[]}}function rn(e){let t=Number(e?.value);return Number.isFinite(t)&&t>0?t:Array.isArray(e?.children)?e.children.reduce((e,t)=>e+rn(t),0):0}function an(e,t){let n=g[B.value.theme||`default`]||l,r=hn.value.length?hn.value:n.length?n:l;return d(e.color)||r[t%r.length]||l[t%l.length]}function on(e){return!Array.isArray(e.children)||!e.children.length?1:e.children.reduce((e,t)=>e+on(t),0)}function sn(e,t=null,n=0,r=[]){return Array.isArray(e)?e.map((e,i)=>{let a=rn(e);if(!Number.isFinite(a)||a<=0)return null;let o=f(),s=[...r,i],c=s.reduce((e,t,n)=>e+t+n,0),l=e.color||t?.color?d(e.color||t?.color):an(e,c),u=sn(e.children,{id:o,name:e.name,color:l,rootId:t?.rootId??o},n+1,s);return{...e,value:a,r:a,id:o,color:l,depth:n,parentId:t?.id??null,parentName:t?.name??null,rootId:t?.rootId??o,hasChildren:u.length>0,childCount:u.length,leafCount:u.length?on({children:u}):1,hierarchyPath:s,children:u}}).filter(Boolean):[]}function cn(e){if(!Array.isArray(e.children)||!e.children.length)return[];let t=e.r*2;if(!t)return[];let n=Ge(e.children.map(nn),t,t),[r,i,a,o]=Ue(n,1),s=Math.min(a?t/a:1,o?t/o:1)*.9,c=a*s,l=o*s,u=e.x-c/2,d=e.y-l/2;return n.map(e=>({...e,x:(e.x-r)*s+u,y:(e.y-i)*s+d,r:e.r*s}))}function ln(e){let t=[];return e.forEach(e=>{let n=cn(e);t.push({...e,children:n}),t.push(...ln(n))}),t}function un(e,t){return!e||!t||!Array.isArray(e.hierarchyPath)||!Array.isArray(t.hierarchyPath)||e.hierarchyPath.length<=t.hierarchyPath.length?!1:t.hierarchyPath.every((t,n)=>e.hierarchyPath[n]===t)}function dn(e){return e.hasChildren?V.value.parents.show:V.value.children.show}function fn(){if(!B.value.responsive||!L.value)return;let e=Ce(()=>{let{width:e,height:t}=we({chart:L.value,title:U.value.title.text?Ct.value:null,legend:null,source:Ot.value,noTitle:wt.value});requestAnimationFrame(()=>{e&&t&&(G.value&&(G.value.setAttribute(`width`,e),G.value.setAttribute(`height`,t)),tn(e,t))})});X.value&&(Z.value&&X.value.unobserve(Z.value),X.value.disconnect()),X.value=new ResizeObserver(e),Z.value=L.value.parentNode||L.value,Z.value&&X.value.observe(Z.value),e()}function pn(){X.value&&(Z.value&&X.value.unobserve(Z.value),X.value.disconnect(),X.value=null,Z.value=null)}async function mn(){se(F.dataset)&&m({componentName:`VueUiCirclePack`,type:`dataset`,debug:Qt.value});let e=$t.value,t=en.value;tn(e,t),B.value.responsive?fn():pn()}Re(mn),Le(()=>{pn()}),He(()=>zt.value,async e=>{await mn()},{deep:!0});let hn=v(()=>oe(B.value.customPalette)),gn=v(()=>sn(zt.value)),_n=v(()=>J.value.length?Math.max(...J.value.map(e=>e.r)):0);function vn(e,t){return _n.value?t/_n.value*e:0}function yn(e,t){B.value.events.datapointLeave&&B.value.events.datapointLeave({datapoint:e,seriesIndex:t}),(Pt.value!==`keyboard`||R.value?.id!==e?.id)&&(jt.value=!1,R.value=null,z.value=null,Pt.value=`pointer`)}function bn(e,t){et(`selectDatapoint`,e),B.value.events.datapointClick&&B.value.events.datapointClick({datapoint:e,seriesIndex:t})}let xn=k(null),Sn=k(!1);function Cn(e,t,n=`pointer`){R.value=e,z.value=t,Pt.value=n,B.value.events.datapointEnter&&B.value.events.datapointEnter({datapoint:e,seriesIndex:t}),xn.value={datapoint:e,seriesIndex:t,config:B.value,series:Y.value},jt.value=!0;let r=U.value.tooltip.customFormat;if(Sn.value=!1,s(r))try{let n=r({seriesIndex:t,datapoint:e,series:Y.value,config:B.value});typeof n==`string`&&(Mt.value=n,Sn.value=!0)}catch{console.warn(`Custom format cannot be applied.`),Sn.value=!1}if(!Sn.value){let t=``;t+=`
|
|
2
|
+
<div style="display:flex;align-items:center;gap:4px;">
|
|
3
|
+
<svg viewBox="0 0 10 10" height="${U.value.tooltip.fontSize}" width="${U.value.tooltip.fontSize}">
|
|
4
|
+
<circle
|
|
5
|
+
cx="5"
|
|
6
|
+
cy="5"
|
|
7
|
+
r="5"
|
|
8
|
+
fill="${H.value.gradient.show?`url(#${e.id})`:e.color}"
|
|
9
|
+
/>
|
|
10
|
+
</svg>
|
|
11
|
+
<span>${e.name}: <b>${wn(e)}</b></span>
|
|
12
|
+
</div>
|
|
13
|
+
`,Mt.value=t}}function wn(e){return ee(V.value.value.formatter,e.value,a({p:V.value.value.prefix,v:e.value,s:V.value.value.suffix,r:V.value.value.rounding}))}function Tn(e){if(!e)return 0;let t=wn(e),n=e.r/(t.length||1)*(t.length===1?1:2);return Math.min(e.r/2.5,n)}let Q=k(!1);function En(e){Q.value=e,Dt.value+=1}let Dn=k(!1);function On(){Dn.value=!Dn.value}let kn=v(()=>!Dn.value&&K.value.showZoom),{viewBox:$,resetZoom:An,isZoom:jn,setInitialViewBox:Mn}=Ae(G,{x:0,y:0,width:Math.max(10,q.value.w),height:Math.max(10,q.value.h)},U.value.zoom?.speed??1,kn);function Nn(e,t,n=0){return!(e.x+e.width+n<t.x||t.x+t.width+n<e.x||e.y+e.height+n<t.y||t.y+t.height+n<e.y)}function Pn(e,t,n=0){let r=Math.min(Math.max(t.x,e.x-n),e.x+e.width+n),i=Math.min(Math.max(t.y,e.y-n),e.y+e.height+n),a=t.x-r,o=t.y-i;return a*a+o*o<=t.r*t.r}function Fn(e,t,n=1){let r=Math.max(4*n,Math.min(t.width,t.height)*.01);return{...e,x:Math.min(Math.max(e.x,t.x+r),t.x+t.width-e.width-r),y:Math.min(Math.max(e.y,t.y+r),t.y+t.height-e.height-r)}}function In(e){let t=[e.name];return V.value.value.show&&t.push(wn(e)),t.filter(Boolean)}function Ln(e,t,n,r,i){let a=e.x,o=e.y;return{right:{x:a+e.r+i,y:o-n/2,anchorX:a+e.r,anchorY:o},left:{x:a-e.r-i-t,y:o-n/2,anchorX:a-e.r,anchorY:o},top:{x:a-t/2,y:o-e.r-i-n,anchorX:a,anchorY:o-e.r},bottom:{x:a-t/2,y:o+e.r+i,anchorX:a,anchorY:o+e.r},topRight:{x:a+e.r*.7+i,y:o-e.r*.7-i-n,anchorX:a+e.r*.7,anchorY:o-e.r*.7},topLeft:{x:a-e.r*.7-i-t,y:o-e.r*.7-i-n,anchorX:a-e.r*.7,anchorY:o-e.r*.7},bottomRight:{x:a+e.r*.7+i,y:o+e.r*.7+i,anchorX:a+e.r*.7,anchorY:o+e.r*.7},bottomLeft:{x:a-e.r*.7-i-t,y:o+e.r*.7+i,anchorX:a-e.r*.7,anchorY:o+e.r*.7}}[r]}function Rn(e,t){let n=[],r=t.get(e.parentId);for(;r;)n.push(r),r=t.get(r.parentId);return n}function zn(e,t,n,r,i,a){let o=e.x,s=e.y,c=t||e,l=a*.6,u={right:{x:c.x+c.r+a,y:s-r/2},left:{x:c.x-c.r-a-n,y:s-r/2},top:{x:o-n/2,y:c.y-c.r-a-r},bottom:{x:o-n/2,y:c.y+c.r+a},topRight:{x:c.x+c.r+a,y:c.y-c.r-a-r-l},topLeft:{x:c.x-c.r-a-n,y:c.y-c.r-a-r-l},bottomRight:{x:c.x+c.r+a,y:c.y+c.r+a+l},bottomLeft:{x:c.x-c.r-a-n,y:c.y+c.r+a+l}}[i],d=u.x+n/2,f=u.y+r/2,p=Math.atan2(f-s,d-o);return{...u,anchorX:o+Math.cos(p)*e.r,anchorY:s+Math.sin(p)*e.r}}function Bn(e,t={}){let{clamp:n=!0,scale:r=1}=t;if(!J.value.length||!q.value.w||!q.value.h||!U.value.parentTooltips.show)return[];let i=Math.max(8,U.value.parentTooltips.fontSizeRatio*10)*r,a=i*1.25,o=i*.75,s=i*.55,c=Math.max(8*r,Math.min(e.width,e.height)*.025),l=Math.max(2*r,Math.min(e.width,e.height)*.006),u=[`right`,`left`,`top`,`bottom`,`topRight`,`topLeft`,`bottomRight`,`bottomLeft`],d=[],f=new Map(J.value.map(e=>[e.id,e]));return J.value.filter(e=>e.hasChildren&&e.name).sort((e,t)=>t.r-e.r).forEach(t=>{let p=Rn(t,f).at(-1),m=In(t),ee=m.reduce((e,t)=>Math.max(e,String(t).length),0),h=Math.max(i*5,ee*i*.62+o*2),g=m.length*a+s*2,te=p?u.map(e=>zn(t,p,h,g,e,c)):[],ne=u.map(e=>Ln(t,h,g,e,c)),re=[...te,...ne].map(t=>{let i=n?Fn({x:t.x,y:t.y,width:h,height:g},e,r):{x:t.x,y:t.y,width:h,height:g};return{...i,anchorX:t.anchorX,anchorY:t.anchorY,lineX:i.x+i.width/2,lineY:i.y+i.height/2}}).find(e=>!d.some(t=>Nn(e,t,l))&&!J.value.some(t=>Pn(e,t,l)));re&&d.push({...re,datapoint:t,id:`parent_tooltip_${t.id}`,color:t.color,lines:m,fontSize:i,lineHeight:a,paddingX:o,paddingY:s,scale:r})}),d}function Vn(e){let t=Zt.value;if(!t.width||!t.height||!e.width||!e.height)return 1;let n=Math.min(e.width/t.width,e.height/t.height);return Number.isFinite(n)&&n>0?n:1}let Hn=v(()=>Bn($.value,{clamp:!0,scale:Vn($.value)}));function Un(e){let t=Bn(e,{clamp:!1});if(!t.length)return e;let n=Math.min(e.x,...t.map(e=>e.x)),r=Math.min(e.y,...t.map(e=>e.y)),i=Math.max(e.x+e.width,...t.map(e=>e.x+e.width)),a=Math.max(e.y+e.height,...t.map(e=>e.y+e.height)),o=Math.max(8,Math.min(e.width,e.height)*.025);return{x:n-o,y:r-o,width:i-n+o*2,height:a-r+o*2}}function Wn(e){let t=[];function n(e,r=0,i=``){e.forEach(e=>{t.push({name:e.name,value:e.value,color:e.color,parentName:i,depth:r}),Array.isArray(e.children)&&e.children.length&&n(e.children,r+1,e.name)})}return n(e),t}let Gn=v(()=>{let e=Wn(gn.value);return{head:Y.value.map(e=>({name:e.name,value:e.value,color:e.color})).toSorted((e,t)=>t.value-e.value),body:e.map(e=>e.value),hierarchy:e}}),Kn=v(()=>Wn(gn.value).map(e=>({...e,name:`${`- `.repeat(e.depth)}${e.name}`})));function qn(e=null){Fe(()=>{let t=Kn.value.map(e=>[[e.name],[e.parentName||``],[e.depth],[e.value]]),n=[[U.value.title.text],[U.value.title.subtitle.text],[[B.value.table.columnNames.datapoint],[`Parent`],[`Depth`],[B.value.table.columnNames.value]]].concat(t),r=o(n);e?e(r):te({csvContent:r,title:U.value.title.text||`vue-ui-circle-pack`})})}let Jn=v(()=>{let e=[B.value.table.columnNames.datapoint,B.value.table.columnNames.parent,B.value.table.columnNames.depth,B.value.table.columnNames.value],t=Gn.value.hierarchy.map(e=>{let t=a({p:V.value.value.prefix,v:e.value,s:V.value.value.suffix,r:V.value.value.rounding});return[{color:e.color,name:`${` `.repeat(e.depth)}${e.name}`},e.parentName??``,e.depth??0,t]}),n={th:{backgroundColor:B.value.table.th.backgroundColor,color:B.value.table.th.color,outline:B.value.table.th.outline},td:{backgroundColor:B.value.table.td.backgroundColor,color:B.value.table.td.color,outline:B.value.table.td.outline},breakpoint:B.value.table.responsiveBreakpoint};return{colNames:[B.value.table.columnNames.datapoint,B.value.table.columnNames.parent,B.value.table.columnNames.depth,B.value.table.columnNames.value],head:e,body:t,config:n}});function Yn(){K.value.showTable=!K.value.showTable}function Xn(){K.value.showTooltip=!K.value.showTooltip}function Zn(){K.value.showZoom=!K.value.showZoom}function Qn(){return gn.value}let $n=me(L,()=>U.value.title.text),er=v(()=>_e({config:B,style:U,mutableConfig:K,dialog:$e,accordion:Je,isFullscreen:Q,parent:L,maxWidth:500,isCursorPointer:It}));He(()=>K.value.showTable,e=>{B.value.table.show||(e&&B.value.table.useDialog&&kt.value?kt.value.open():kt.value&&`close`in kt.value&&kt.value.close())});function tr(){K.value.showTable=!1,At.value&&At.value.setTableIconState(!1)}let nr=v(()=>U.value.backgroundColor),rr=v(()=>U.value.title),{isCallbackImaging:ir,isCallbackSvg:ar,generateSvg:or,onGenerateImage:sr}=ge({svg:G,title:rr,legend:null,legendItems:null,backgroundColor:nr,getSvgCallback:()=>B.value.userOptions.callbacks.svg,generateImage:Jt});async function cr(){et(`copyAlt`,{config:B.value,dataset:gn.value,flattenedDataset:Y.value}),B.value.userOptions.callbacks.altCopy?await Promise.resolve(B.value.userOptions.callbacks.altCopy({config:B.value,dataset:gn.value,flattenedDataset:Y.value})):console.warn("Vue Data UI - A callback must be set for `altCopy` in userOptions.")}function lr(e){if(!Number.isFinite(e)||!G.value)return;let t=J.value[e];if(!t)return;let n=ae(t.x,t.y,G.value);n&&(Nt.value=n)}function ur(){if(z.value!==null){let e=J.value[z.value];e&&yn(e,z.value)}z.value=null,Pt.value=`pointer`,jt.value=!1,R.value=null}function dr(){z.value=null,Ft.value=!0}function fr(){ur(),Ft.value=!1}function pr(e,t){let n=J.value.length;return n?e===null||e<0||e>=n?t===`next`?0:n-1:t===`previous`?(e-1+n)%n:(e+1)%n:null}function mr(e){if(!G.value||Dn.value||document.activeElement!==G.value||!J.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){ur();return}if(r){if(z.value===null)return;let e=J.value[z.value];if(!e)return;bn(e,z.value);return}let a=z.value;a===null||a<0||a>=J.value.length?a=n?0:J.value.length-1:n?a=pr(a,`next`):t&&(a=pr(a,`previous`));let o=J.value[a];o&&(z.value=a,lr(a),Cn(o,a,`keyboard`))}let hr=v(()=>({headers:Jn.value?.colNames??[],rows:Jn.value?.body?.map(e=>[e[0]?.name??``,e[1]])??[]})),gr=v(()=>U.value.color);fe({getData:Qn,getImage:$n,generateCsv:qn,generatePdf:qt,generateImage:Jt,generateSvg:or,toggleTable:Yn,toggleAnnotator:On,toggleFullscreen:En,copyAlt:cr,toggleZoom:Zn,resetZoom:An});let _r=v(()=>ke(B.value.userOptions?.annotator?.followZoom,$.value));return(e,i)=>(O(),x(`div`,{id:`vue-ui-circle-pack_${I.value}`,class:E(`vue-data-ui-component vue-ui-circle-pack ${Q.value?`vue-data-ui-wrapper-fullscreen`:``} ${N(Rt)?`loading`:``}`),ref_key:`circlePackChart`,ref:L,style:Ie(`font-family:${B.value.style.fontFamily};text-align:center;background:${U.value.backgroundColor};`),onMouseenter:i[2]||=()=>N(Vt)(!0),onMouseleave:i[3]||=()=>N(Vt)(!1)},[S(`div`,{id:`chart-instructions-${I.value}`,class:`sr-only`},[S(`p`,null,M(B.value.a11y.translations.keyboardNavigation),1)],8,it),hr.value?.rows?.length?(O(),y(Ee,{key:0,uid:I.value,head:hr.value.headers,body:hr.value.rows,notice:B.value.a11y.translations.tableAvailable,caption:B.value.a11y.translations.tableCaption},null,8,[`uid`,`head`,`body`,`notice`,`caption`])):b(``,!0),B.value.userOptions.buttons.annotator?(O(),y(N(Ze),T({key:1},N(n)(B.value.userOptions.annotator),{svgRef:N(G),followZoom:B.value.userOptions?.annotator?.followZoom,annotationViewport:_r.value,backgroundColor:U.value.backgroundColor,color:U.value.color,active:Dn.value,isCursorPointer:It.value,palette:B.value.userOptions.annotatorPalette,onClose:On}),Me({_:2},[A(N(r),n=>({name:n,fn:P(r=>[j(e.$slots,n,D(w(N(t)(n,r))),void 0,!0)])}))]),1040,[`svgRef`,`followZoom`,`annotationViewport`,`backgroundColor`,`color`,`active`,`isCursorPointer`,`palette`])):b(``,!0),j(e.$slots,`userConfig`,{},void 0,!0),Yt.value?(O(),x(`div`,{key:2,ref_key:`noTitle`,ref:wt,class:`vue-data-ui-no-title-space`,style:`height:36px; width: 100%;background:transparent`},null,512)):b(``,!0),U.value.title.text?(O(),x(`div`,{key:3,ref_key:`chartTitle`,ref:Ct,style:`width:100%;background:transparent;padding-bottom:12px`},[(O(),y(he,{key:`title_${Tt.value}`,config:{title:{cy:`donut-div-title`,...U.value.title},subtitle:{cy:`donut-div-subtitle`,...U.value.title.subtitle}}},null,8,[`config`]))],512)):b(``,!0),B.value.userOptions.show&&nt.value&&(N(Ht)||N(Bt))?(O(),y(N(Xe),T({ref_key:`userOptionsRef`,ref:At,key:`user_option_${Dt.value}`,backgroundColor:U.value.backgroundColor,color:U.value.color,isPrinting:N(Gt),isImaging:N(Kt),uid:I.value,hasTooltip:B.value.userOptions.buttons.tooltip,isTooltip:K.value.showTooltip,hasLabel:!1,isFullscreen:Q.value,chartElement:L.value},N(ye)(B.value.userOptions,`pdf csv img svg table fullscreen altCopy annotator zoom`),{isAnnotation:Dn.value,tableDialog:B.value.table.useDialog,isCursorPointer:It.value,isZoom:K.value.showZoom,onToggleFullscreen:En,onGeneratePdf:N(qt),onGenerateCsv:qn,onGenerateImage:N(sr),onGenerateSvg:N(or),onToggleTable:Yn,onToggleTooltip:Xn,onToggleAnnotator:On,onToggleZoom:Zn,onCopyAlt:cr,style:{visibility:N(Ht)?N(Bt)?`visible`:`hidden`:`visible`}}),Me({_:2},[A(N(ve)(e.$slots,`menuIcon optionTooltip optionPdf optionCsv optionImg optionSvg optionTable optionFullscreen optionAnnotator optionZoom optionAltCopy custom-menu-before custom-menu-after`),t=>({name:t,fn:P(n=>[j(e.$slots,t,D(w(N(be)(t,n))),void 0,!0)])}))]),1040,[`backgroundColor`,`color`,`isPrinting`,`isImaging`,`uid`,`hasTooltip`,`isTooltip`,`isFullscreen`,`chartElement`,`isAnnotation`,`tableDialog`,`isCursorPointer`,`isZoom`,`onGeneratePdf`,`onGenerateImage`,`onGenerateSvg`,`style`])):b(``,!0),S(`div`,{class:E({"vue-ui-circle-pack-svg-container":!0,"not-responsive":!B.value.responsive})},[(O(),x(`svg`,{ref_key:`svgRef`,ref:G,xmlns:N(ie),"aria-describedby":`chart-instructions-${I.value}`,viewBox:`${N($).x} ${N($).y} ${N($).width} ${N($).height}`,preserveAspectRatio:`xMidYMid meet`,class:E({"vue-data-ui-fullscreen--on":Q.value,"vue-data-ui-fulscreen--off":!Q.value,"not-responsive":!B.value.responsive,"vue-data-ui-no-transition":!N(W)}),style:Ie(`display:block;${B.value.responsive?`width:100%;height:auto`:`height:100%;`};overflow:${K.value.showZoom?`hidden`:`visible`};background:transparent;color:${U.value.color};background:${U.value.backgroundColor};`),tabindex:`0`,onFocus:dr,onBlur:fr,onKeydown:mr},[Pe(N(Qe)),j(e.$slots,`svg-underlayer`,{svg:{drawingArea:{...N($)},width:q.value.w,height:q.value.h,isPrintingImg:N(Gt)||N(Kt)||N(ir),isPrintingSvg:N(ar)}},void 0,!0),e.$slots[`chart-background`]?(O(),x(`foreignObject`,{key:0,x:N($).x,y:N($).y,width:q.value.w,height:q.value.h,style:{pointerEvents:`none`}},[j(e.$slots,`chart-background`,{},void 0,!0)],8,ot)):b(``,!0),(O(!0),x(_,null,A(J.value,(t,n)=>(O(),x(_,{key:t.id},[S(`defs`,null,[Pe(Te,{t:`radial`,id:t.id,fy:`30%`,stops:[[`10%`,N(c)(t.color,H.value.gradient.intensity/100),1],[`90%`,N(u)(t.color,.1),1],[`100%`,t.color,1]]},null,8,[`id`,`stops`])]),e.$slots.pattern?(O(),x(`g`,st,[S(`defs`,null,[j(e.$slots,`pattern`,T({ref_for:!0},{...t,patternId:`pattern_${I.value}_${t.id}`}),void 0,!0)])])):b(``,!0),S(`rect`,{class:E({"vue-data-ui-transition":N(W)}),x:t.x-t.r,y:t.y-t.r,width:t.r*2,height:t.r*2,stroke:H.value.stroke,"vector-effect":`non-scaling-stroke`,"stroke-width":H.value.strokeWidth*(_n.value||1)/100,fill:H.value.gradient.show?`url(#${t.id})`:t.color,rx:t.r,onMouseenter:e=>Cn(t,n,`pointer`),onMouseout:e=>yn(t,n),onClick:e=>bn(t,n)},null,42,ct),e.$slots.pattern?(O(),x(`rect`,{key:1,class:E({"vue-data-ui-transition":N(W)}),x:t.x-t.r,y:t.y-t.r,width:t.r*2,height:t.r*2,stroke:H.value.stroke,"vector-effect":`non-scaling-stroke`,"stroke-width":H.value.strokeWidth*(_n.value||1)/100,fill:`url(#pattern_${I.value}_${t.id})`,rx:t.r,style:{pointerEvents:`none`}},null,10,lt)):b(``,!0)],64))),128)),(O(!0),x(_,null,A(J.value,(e,t)=>(O(),x(_,{key:e.id},[e.hasChildren?b(``,!0):(O(),x(`rect`,{key:0,class:E({"vue-data-ui-transition":N(W)}),x:e.x-e.r,y:e.y-e.r,width:e.r*2,height:e.r*2,stroke:`none`,fill:R.value&&R.value.id===e.id?H.value.gradient.show?`url(#${e.id})`:e.color:`transparent`,rx:e.r,style:Ie({filter:R.value&&R.value.id===e.id?`drop-shadow(0px 0px 6px ${H.value.selectedShadowColor})`:`none`,opacity:+!!R.value,pointerEvents:`none`})},null,14,ut))],64))),128)),(O(!0),x(_,null,A(J.value,(t,n)=>(O(),x(_,{key:`cl_${t.id}`},[e.$slots[`data-label`]&&dn(t)?j(e.$slots,`data-label`,T({ref_for:!0},{...t,createTSpans:N(ne),fontSize:{name:t.r/3*V.value.name.fontSizeRatio,value:Tn(t)*V.value.value.fontSizeRatio},color:V.value.name.color?V.value.name.color:N(re)(t.color)}),void 0,!0,0):(O(),x(_,{key:1},[V.value.name.show&&t.name&&dn(t)?(O(),x(`text`,{key:0,style:{pointerEvents:`none`},class:E({"vue-data-ui-transition":N(W)}),transform:`translate(${t.x}, ${t.y+vn(t.r,V.value.name.offsetY)-t.r/10})`,"font-size":t.r/3*V.value.name.fontSizeRatio,fill:V.value.name.color===`auto`?N(re)(t.color):V.value.name.color,"font-weight":V.value.name.bold?`bold`:`normal`,"text-anchor":`middle`},M(t.name),11,dt)):b(``,!0),V.value.value.show&&dn(t)?(O(),x(`text`,{key:1,class:E({"vue-data-ui-transition":N(W)}),style:{pointerEvents:`none`,transition:`opacity 0.2s ease-in-out`},transform:`translate(${t.x}, ${t.y+vn(t.r,V.value.value.offsetY)+t.r/2.5})`,"font-size":Tn(t)*V.value.value.fontSizeRatio,fill:V.value.value.color===`auto`?N(re)(t.color):V.value.value.color,"font-weight":V.value.value.bold?`bold`:`normal`,"text-anchor":`middle`},M(wn(t)),11,ft)):b(``,!0)],64)),j(e.$slots,`circle`,T({ref_for:!0},{...t,showLabel:dn(t),isSelected:R.value?.id===t.id,isDescendantOfSelected:un(t,R.value),uid:`${n}_${I.value}`}),void 0,!0)],64))),128)),Hn.value.length&&U.value.parentTooltips.show?(O(),x(`g`,pt,[(O(!0),x(_,null,A(Hn.value,t=>(O(),x(`g`,{key:`tltp_${t.id}`},[S(`path`,{class:E({"vue-data-ui-transition":N(W)}),stroke:U.value.parentTooltips.link.useSerieColor?t.color:U.value.parentTooltips.link.stroke,"vector-effect":`non-scaling-stroke`,"stroke-width":U.value.parentTooltips.link.strokeWidth,"stroke-linecap":`round`,"stroke-dasharray":U.value.parentTooltips.link.strokeDasharray,opacity:U.value.parentTooltips.link.opacity,d:`M${t.anchorX}, ${t.anchorY} ${t.lineX}, ${t.lineY}`},null,10,mt),S(`rect`,{class:E({"vue-data-ui-transition":N(W)}),x:t.x,y:t.y,width:t.width,height:t.height,rx:Math.max(3*t.scale,t.fontSize/2.5)*U.value.parentTooltips.borderRadiusRatio,ry:Math.max(3*t.scale,t.fontSize/2.5)*U.value.parentTooltips.borderRadiusRatio,fill:U.value.parentTooltips.backgroundColor,stroke:U.value.parentTooltips.useSerieColor?t.color:U.value.parentTooltips.stroke,"vector-effect":`non-scaling-stroke`,"stroke-width":U.value.parentTooltips.strokeWidth,filter:U.value.parentTooltips.filter},null,10,ht),j(e.$slots,`parent-tooltip`,T({ref_for:!0},{...t}),()=>[S(`rect`,{class:E({"vue-data-ui-transition":N(W)}),fill:t.color,x:t.x+t.paddingX*1.3-t.fontSize*.35,y:t.y+t.paddingY+t.lineHeight/2-t.fontSize*.35,rx:t.fontSize*.35,width:t.fontSize*.7,height:t.fontSize*.7},null,10,gt),S(`text`,{class:E({"vue-data-ui-transition":N(W)}),transform:`translate(${t.x+t.paddingX+t.fontSize}, ${t.y+t.paddingY+t.fontSize})`,"font-size":t.fontSize,fill:U.value.parentTooltips.color,"font-family":B.value.style.fontFamily,"text-anchor":`start`},[(O(!0),x(_,null,A(t.lines,(e,n)=>(O(),x(`tspan`,{key:`${t.id}_${n}`,x:0,dy:n===0?0:t.lineHeight},M(e),9,vt))),128))],10,_t)],!0)]))),128))])):b(``,!0),j(e.$slots,`svg`,{svg:{drawingArea:{...N($)},width:q.value.w,height:q.value.h,isPrintingImg:N(Gt)||N(Kt)||N(ir),isPrintingSvg:N(ar)}},void 0,!0)],46,at)),e.$slots.hint?(O(),x(`div`,yt,[j(e.$slots,`hint`,D(w({hint:B.value.a11y.translations.keyboardNavigation,isVisible:Ft.value})),void 0,!0)])):b(``,!0)],2),e.$slots.watermark?(O(),x(`div`,bt,[j(e.$slots,`watermark`,D(w({isPrinting:N(Gt)||N(Kt)||N(ir)||N(ar)})),void 0,!0)])):b(``,!0),N(jn)?(O(),x(`div`,xt,[j(e.$slots,`reset-action`,{reset:N(An)},()=>[S(`button`,{"data-cy-reset":``,tabindex:`0`,role:`button`,class:`vue-data-ui-refresh-button`,style:Ie({background:U.value.backgroundColor,cursor:It.value?`pointer`:`default`}),onClick:i[0]||=e=>N(An)(!0)},[Pe(N(qe),{name:`refresh`,stroke:U.value.color},null,8,[`stroke`])],4)],!0)])):b(``,!0),e.$slots.source?(O(),x(`div`,{key:7,ref_key:`source`,ref:Ot,dir:`auto`},[j(e.$slots,`source`,{},void 0,!0)],512)):b(``,!0),Pe(N(Ke),{teleportTo:U.value.tooltip.teleportTo,show:K.value.showTooltip&&jt.value,backgroundColor:U.value.tooltip.backgroundColor,color:U.value.tooltip.color,fontSize:U.value.tooltip.fontSize,borderRadius:U.value.tooltip.borderRadius,borderColor:U.value.tooltip.borderColor,borderWidth:U.value.tooltip.borderWidth,backgroundOpacity:U.value.tooltip.backgroundOpacity,position:U.value.tooltip.position,offsetX:U.value.tooltip.offsetX,offsetY:U.value.tooltip.offsetY,parent:L.value,content:Mt.value,isCustom:Sn.value,isFullscreen:Q.value,smooth:U.value.tooltip.smooth,backdropFilter:U.value.tooltip.backdropFilter,smoothForce:U.value.tooltip.smoothForce,smoothSnapThreshold:U.value.tooltip.smoothSnapThrehsold,isA11yMode:Pt.value===`keyboard`,a11yPosition:Nt.value},{"tooltip-before":P(()=>[j(e.$slots,`tooltip-before`,D(w({...xn.value})),void 0,!0)]),tooltip:P(()=>[j(e.$slots,`tooltip`,D(w({...xn.value})),void 0,!0)]),"tooltip-after":P(()=>[j(e.$slots,`tooltip-after`,D(w({...xn.value})),void 0,!0)]),_:3},8,[`teleportTo`,`show`,`backgroundColor`,`color`,`fontSize`,`borderRadius`,`borderColor`,`borderWidth`,`backgroundOpacity`,`position`,`offsetX`,`offsetY`,`parent`,`content`,`isCustom`,`isFullscreen`,`smooth`,`backdropFilter`,`smoothForce`,`smoothSnapThreshold`,`isA11yMode`,`a11yPosition`]),nt.value&&B.value.userOptions.buttons.table?(O(),y(ze(er.value.component),T({key:8},er.value.props,{ref_key:`tableUnit`,ref:kt,onClose:tr}),Me({content:P(()=>[(O(),y(N(Ye),{key:`table_${Et.value}`,colNames:Jn.value.colNames,head:Jn.value.head,body:Jn.value.body,config:Jn.value.config,title:B.value.table.useDialog?``:er.value.title,withCloseButton:!B.value.table.useDialog,isCursorPointer:It.value,onClose:tr},{th:P(({th:e})=>[S(`div`,St,M(e),1)]),td:P(({td:e})=>[Ne(M(e.name||e),1)]),_:1},8,[`colNames`,`head`,`body`,`config`,`title`,`withCloseButton`,`isCursorPointer`]))]),_:2},[B.value.table.useDialog?{name:`title`,fn:P(()=>[Ne(M(er.value.title),1)]),key:`0`}:void 0,B.value.table.useDialog?{name:`actions`,fn:P(()=>[S(`button`,{tabindex:`0`,class:`vue-ui-user-options-button`,onClick:i[1]||=e=>qn(B.value.userOptions.callbacks.csv),style:Ie({cursor:It.value?`pointer`:`default`})},[Pe(N(qe),{name:`fileCsv`,stroke:er.value.props.color},null,8,[`stroke`])],4)]),key:`1`}:void 0]),1040)):b(``,!0),j(e.$slots,`skeleton`,{},()=>[N(Rt)?(O(),y(le,{key:0})):b(``,!0)],!0)],46,rt))}},[[`__scopeId`,`data-v-187a2897`]]);export{nt as n,I as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{t}from"./useConfig-
|
|
1
|
+
import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{t}from"./useConfig-C3FbHv4N.js";import{Jt as ee,X as n,t as te}from"./lib-rPeBMZrn.js";import{t as r}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{t as i}from"./useNestedProp-DnGoh-XS.js";import{n as a}from"./PackageVersion-DKSNC-YP.js";import{Teleport as o,computed as s,createBlock as ne,createCommentVNode as c,createElementBlock as l,createElementVNode as u,createVNode as d,nextTick as f,normalizeClass as p,normalizeStyle as m,onBeforeUnmount as h,onMounted as g,openBlock as _,ref as v,toDisplayString as y,unref as b}from"vue";var x=/* @__PURE__ */ e({default:()=>R}),re=[`xmlns`,`height`,`width`],ie={id:`follower`,fy:`30%`,fx:`30%`},ae=[`stop-color`,`stop-opacity`],oe=[`r`,`fill`,`stroke`,`stroke-width`,`stroke-dasharray`],se=[`r`],S={key:2,class:`wave`},C=[`id`],w=[`id`],T=[`filter`,`stroke`],E={key:3,class:`crosshair`},D=[`x1`,`stroke`,`stroke-width`,`stroke-dasharray`],O=[`x1`,`stroke`,`stroke-width`,`stroke-dasharray`],k=[`y1`,`stroke`,`stroke-width`,`stroke-dasharray`],A=[`y1`,`stroke`,`stroke-width`,`stroke-dasharray`],j=[`cy`,`r`,`fill`],M=[`cy`,`r`,`fill`],N=[`cx`,`r`,`fill`],P=[`cx`,`r`,`fill`],F={key:5,class:`coordinates`},I=[`x`,`y`,`font-size`,`fill`],L=[`transform`],ce=[`font-size`,`fill`],R=/*#__PURE__*/ r({__name:`vue-ui-cursor`,props:{config:{type:Object,default:{}}},setup(e){let{vue_ui_cursor:r}=t(),x=e,R=v(n()),z=s(()=>i({userConfig:x.config,defaultConfig:r})),B=v({x:-100,y:-100}),V=s(()=>Math.round(z.value.centerCircleRadius)),H=s(()=>Math.round(z.value.coordinatesOffset));function U({clientX:e,clientY:t,...ee}){B.value.x=e-V.value,B.value.y=t-V.value}function W(e){B.value.x=e.targetTouches[0].clientX-V.value,B.value.y=e.targetTouches[0].clientY-V.value}let G=v(!0);function K(e){G.value=e}let q=v(!1),J=v(null);function Y(){q.value=!1,J.value&&clearTimeout(J.value),f(()=>{q.value=!0,J.value=setTimeout(()=>{q.value=!1},1e3)})}let X=v(null),Z=v(null);function Q(){return z.value.parentId?document.getElementById(z.value.parentId):document.getElementsByTagName(`div`)[0]||null}function $(e){e&&(e.addEventListener(`mousemove`,U),e.addEventListener(`touchmove`,W),e.addEventListener(`mouseleave`,()=>K(!1)),e.addEventListener(`mouseenter`,()=>K(!0)),e.addEventListener(`click`,Y))}function le(e){e&&(e.removeEventListener(`mousemove`,U),e.removeEventListener(`touchmove`,W),e.removeEventListener(`mouseleave`,()=>K(!1)),e.removeEventListener(`mouseenter`,()=>K(!0)),e.removeEventListener(`click`,Y))}return g(()=>{let e=Q();if(e){X.value=e,$(e);return}if(!z.value.parentId)return;let t=new MutationObserver(()=>{let e=Q();e&&(X.value=e,$(e),t.disconnect(),Z.value=null)});t.observe(document.body,{childList:!0,subtree:!0}),Z.value=t}),h(()=>{Z.value&&=(Z.value.disconnect(),null),X.value&&=(le(X.value),null)}),(e,t)=>(_(),ne(o,{to:`body`},[G.value?(_(),l(`svg`,{key:0,"data-dom-to-png-ignore":``,xmlns:b(te),style:m(`z-index: 2147483647; overflow: visible; pointer-events: none;background: transparent; position:fixed; top:${B.value.y}px; left:${B.value.x}px;`),viewBox:`0 0 100 100`,height:V.value*2,width:V.value*2},[d(a),u(`defs`,null,[u(`radialGradient`,ie,[u(`stop`,{offset:`10%`,"stop-color":z.value.bubbleEffectColor,"stop-opacity":z.value.bubbleEffectOpacity},null,8,ae),t[0]||=u(`stop`,{offset:`95%`,"stop-color":`transparent`},null,-1)])]),z.value.showCenterCircle?(_(),l(`circle`,{key:0,cx:50,cy:50,r:V.value,fill:b(ee)(z.value.centerCircleColor,z.value.centerCircleOpacity*100),stroke:z.value.centerCircleStroke,"stroke-width":z.value.centerCircleStrokeWidth,"stroke-dasharray":z.value.centerCircleDasharray},null,8,oe)):c(``,!0),z.value.bubbleEffect?(_(),l(`circle`,{key:1,cx:50,cy:50,r:V.value,fill:`url(#follower)`,stroke:`none`},null,8,se)):c(``,!0),z.value.useWaveOnClick?(_(),l(`g`,S,[u(`defs`,null,[u(`filter`,{id:`blur_${R.value}`,x:`-50%`,y:`-50%`,width:`200%`,height:`200%`},[u(`feGaussianBlur`,{in:`SourceGraphic`,stdDeviation:4,id:`blur_std_${R.value}`},null,8,w),t[1]||=u(`feColorMatrix`,{type:`saturate`,values:`0`},null,-1)],8,C)]),q.value?(_(),l(`circle`,{key:0,class:p({"circle-wave":q.value}),cx:50,cy:50,r:50,filter:`url(#blur_${R.value})`,stroke:z.value.centerCircleStroke,fill:`none`,"stroke-width":`3`},null,10,T)):c(``,!0)])):c(``,!0),z.value.showCrosshair?(_(),l(`g`,E,[u(`line`,{x1:-V.value+50,x2:-5e3,y1:50,y2:50,stroke:z.value.crosshairStroke,"stroke-width":z.value.crosshairStrokeWidth,"stroke-dasharray":z.value.crosshairDasharray,"stroke-linecap":`round`},null,8,D),u(`line`,{x1:50+V.value,x2:5e3,y1:50,y2:50,stroke:z.value.crosshairStroke,"stroke-width":z.value.crosshairStrokeWidth,"stroke-dasharray":z.value.crosshairDasharray,"stroke-linecap":`round`},null,8,O),u(`line`,{x1:50,x2:50,y1:-V.value+50,y2:-5e3,stroke:z.value.crosshairStroke,"stroke-width":z.value.crosshairStrokeWidth,"stroke-dasharray":z.value.crosshairDasharray,"stroke-linecap":`round`},null,8,k),u(`line`,{x1:50,x2:50,y1:V.value+50,y2:5e3,stroke:z.value.crosshairStroke,"stroke-width":z.value.crosshairStrokeWidth,"stroke-dasharray":z.value.crosshairDasharray,"stroke-linecap":`round`},null,8,A)])):c(``,!0),z.value.showIntersectCircles?(_(),l(`g`,{key:4,class:p({"rotating-circles":z.value.isLoading})},[u(`circle`,{cx:50,cy:V.value+50,r:z.value.intersectCirclesRadius,fill:z.value.intersectCirclesFill},null,8,j),u(`circle`,{cx:50,cy:-V.value+50,r:z.value.intersectCirclesRadius,fill:z.value.intersectCirclesFill},null,8,M),u(`circle`,{cx:-V.value+50,cy:50,r:z.value.intersectCirclesRadius,fill:z.value.intersectCirclesFill},null,8,N),u(`circle`,{cx:V.value+50,cy:50,r:z.value.intersectCirclesRadius,fill:z.value.intersectCirclesFill},null,8,P)],2)):c(``,!0),z.value.showCoordinates?(_(),l(`g`,F,[u(`text`,{"text-anchor":`end`,x:-V.value+50-z.value.coordinatesFontSize/2+H.value,y:50-z.value.coordinatesFontSize/2+H.value,"font-size":z.value.coordinatesFontSize,fill:z.value.coordinatesColor,style:{"font-variant-numeric":`tabular-nums`},"font-family":`Arial`},y(B.value.x.toFixed(0)),9,I),u(`g`,{transform:`translate(${50-z.value.coordinatesFontSize/2+H.value}, ${-V.value+50-z.value.coordinatesFontSize/2+H.value})`},[u(`text`,{"text-anchor":`start`,"font-size":z.value.coordinatesFontSize,fill:z.value.coordinatesColor,style:{"font-variant-numeric":`tabular-nums`},transform:`rotate(-90)`,"font-family":`Arial`},y(B.value.y.toFixed(0)),9,ce)],8,L)])):c(``,!0)],12,re)):c(``,!0)]))}},[[`__scopeId`,`data-v-4b1f566e`]]);export{x as n,R as t};
|