vue-data-ui 3.28.11 → 3.28.12
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-ksOit8fp.js → PackageVersion-PdpqwkYX.js} +1 -1
- package/dist/{XyAnalysisOptions-CUtj1x2f.js → XyAnalysisOptions-DmKfwSu6.js} +1 -1
- package/dist/components/vue-ui-3d-bar.js +1 -1
- package/dist/components/vue-ui-age-pyramid.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-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-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-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-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.js +1 -1
- package/dist/package-DWjs4THo.js +1 -0
- package/dist/{render-common-CPA2hfDW.js → render-common-C9aE_Va1.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/vue-data-ui-Da3HK_wb.js +1 -0
- package/dist/vue-data-ui.js +1 -1
- package/dist/{vue-ui-3d-bar-Cs-_W1Av.js → vue-ui-3d-bar-D1XfKXhp.js} +1 -1
- package/dist/{vue-ui-age-pyramid-cWWVFoCj.js → vue-ui-age-pyramid-CJqqtEIh.js} +1 -1
- package/dist/{vue-ui-bullet-CMQzoLKs.js → vue-ui-bullet-CxyL5Bdm.js} +1 -1
- package/dist/{vue-ui-bump-SSu5eVbF.js → vue-ui-bump-BWWMzAN_.js} +1 -1
- package/dist/{vue-ui-candlestick-Cm9jS3n7.js → vue-ui-candlestick-CQXdyPEt.js} +1 -1
- package/dist/{vue-ui-carousel-table-D-F54W90.js → vue-ui-carousel-table-DwsfnL_l.js} +1 -1
- package/dist/{vue-ui-chestnut-DNe1s8TT.js → vue-ui-chestnut-DV7XKL7g.js} +1 -1
- package/dist/{vue-ui-chord-DGzpBpuI.js → vue-ui-chord-DRNn_E6i.js} +1 -1
- package/dist/{vue-ui-circle-pack--iJQtXys.js → vue-ui-circle-pack-BcA9ZxZS.js} +1 -1
- package/dist/{vue-ui-cursor-B7DJRSGD.js → vue-ui-cursor-DSgVvP1L.js} +1 -1
- package/dist/{vue-ui-dag-tsM65e_V.js → vue-ui-dag-CWpyU7AJ.js} +1 -1
- package/dist/{vue-ui-dashboard-CC7IhQZu.js → vue-ui-dashboard-Dh_Zi8oG.js} +1 -1
- package/dist/{vue-ui-digits-hv2QeC-H.js → vue-ui-digits-Cy3Y6qro.js} +1 -1
- package/dist/{vue-ui-donut-iyVVIGoJ.js → vue-ui-donut-BqnLIKwZ.js} +1 -1
- package/dist/vue-ui-donut-DasGeYdl.js +47 -0
- package/dist/{vue-ui-donut-evolution-Wz_-FYab.js → vue-ui-donut-evolution-Bw7ilDYR.js} +1 -1
- package/dist/{vue-ui-dumbbell-p3Q2LkBV.js → vue-ui-dumbbell-BPvvKhag.js} +1 -1
- package/dist/{vue-ui-flow-BCH8YU8H.js → vue-ui-flow-XI5Y3qdk.js} +1 -1
- package/dist/{vue-ui-funnel-DdrBD9oX.js → vue-ui-funnel-DqoQogQE.js} +1 -1
- package/dist/{vue-ui-galaxy-DYKEOEL-.js → vue-ui-galaxy-NRaBIHpn.js} +1 -1
- package/dist/{vue-ui-gauge-CPgvR_YB.js → vue-ui-gauge-DX4SBIKS.js} +1 -1
- package/dist/{vue-ui-geo-DhJ3Wr_5.js → vue-ui-geo-C3e4J_kw.js} +1 -1
- package/dist/{vue-ui-gizmo-BTy4Vr1e.js → vue-ui-gizmo-C9ls2b4h.js} +1 -1
- package/dist/{vue-ui-graph-C4kfE4G8.js → vue-ui-graph-CBkbFJIA.js} +1 -1
- package/dist/{vue-ui-heatmap-lti43RhW.js → vue-ui-heatmap-D6KP1N8f.js} +1 -1
- package/dist/{vue-ui-hill-3GVfKQmi.js → vue-ui-hill-8c-9u8eg.js} +1 -1
- package/dist/{vue-ui-history-plot-DMTPygZA.js → vue-ui-history-plot-CowxWkEd.js} +1 -1
- package/dist/{vue-ui-horizontal-bar-DwWo0CvX.js → vue-ui-horizontal-bar-CVP5jBNJ.js} +1 -1
- package/dist/{vue-ui-kpi-BTMK37Ix.js → vue-ui-kpi-D1MUlURM.js} +1 -1
- package/dist/{vue-ui-molecule-rbDnRA7c.js → vue-ui-molecule-BRB54XBD.js} +1 -1
- package/dist/{vue-ui-mood-radar-8s1jnO3P.js → vue-ui-mood-radar-CkHJdUyF.js} +1 -1
- package/dist/{vue-ui-nested-donuts-8bY4HvC-.js → vue-ui-nested-donuts-C-7VZO11.js} +1 -1
- package/dist/{vue-ui-onion-CgLNDFrZ.js → vue-ui-onion-erpKpDKg.js} +1 -1
- package/dist/{vue-ui-parallel-coordinate-plot-ms14eLus.js → vue-ui-parallel-coordinate-plot-BDg0pRkN.js} +1 -1
- package/dist/{vue-ui-quadrant-6GgQZ8fW.js → vue-ui-quadrant-CUdNxC6W.js} +1 -1
- package/dist/{vue-ui-quick-chart-CzRbFXIS.js → vue-ui-quick-chart-DE5Zwioe.js} +1 -1
- package/dist/{vue-ui-radar-BxsD2JBj.js → vue-ui-radar-6y6er9ND.js} +1 -1
- package/dist/{vue-ui-relation-circle-BFPAlaWQ.js → vue-ui-relation-circle-CjnG9G7s.js} +1 -1
- package/dist/{vue-ui-ridgeline-G2m7eFWe.js → vue-ui-ridgeline-B4qi2Ajl.js} +1 -1
- package/dist/{vue-ui-rings-l_BLWL48.js → vue-ui-rings-EYfCkNB6.js} +1 -1
- package/dist/{vue-ui-scatter-C4hXe3DM.js → vue-ui-scatter-Tw-5uRac.js} +1 -1
- package/dist/{vue-ui-skeleton-BLyh-ESb.js → vue-ui-skeleton-CZMyXM-1.js} +1 -1
- package/dist/{vue-ui-spark-trend-D0hz9kNt.js → vue-ui-spark-trend-Cmj4aWcQ.js} +1 -1
- package/dist/{vue-ui-sparkbar-Dweyr8h-.js → vue-ui-sparkbar-Crq1Vui3.js} +1 -1
- package/dist/{vue-ui-sparkgauge-DQfCXKFj.js → vue-ui-sparkgauge-CN_9yenn.js} +1 -1
- package/dist/{vue-ui-sparkhistogram-DOfAu86W.js → vue-ui-sparkhistogram-CK7JmyCw.js} +1 -1
- package/dist/{vue-ui-sparkline-DuX09S8A.js → vue-ui-sparkline-2_RlGrAT.js} +1 -1
- package/dist/{vue-ui-sparkstackbar-vXOpiyrI.js → vue-ui-sparkstackbar-Dwdn2_9q.js} +1 -1
- package/dist/{vue-ui-stackbar-DsrwNY0p.js → vue-ui-stackbar-BVmQJn2b.js} +1 -1
- package/dist/{vue-ui-stackline-e7EYZet7.js → vue-ui-stackline-nvhui30B.js} +1 -1
- package/dist/{vue-ui-strip-plot-2DxzeUXU.js → vue-ui-strip-plot-Dig2RljR.js} +1 -1
- package/dist/{vue-ui-table-B344jLaG.js → vue-ui-table-_qSw3iGd.js} +1 -1
- package/dist/{vue-ui-table-sparkline-itq8yRCe.js → vue-ui-table-sparkline-39sKOqcp.js} +1 -1
- package/dist/{vue-ui-thermometer-BSRjS7l3.js → vue-ui-thermometer-CoVrrzHW.js} +1 -1
- package/dist/{vue-ui-timer-DM-urc2D.js → vue-ui-timer-DoR5PqOa.js} +1 -1
- package/dist/{vue-ui-tiremarks-CbIOAO3F.js → vue-ui-tiremarks-9tPPNGiq.js} +1 -1
- package/dist/{vue-ui-treemap-Cgal4H5O.js → vue-ui-treemap-D3mZkT4P.js} +1 -1
- package/dist/{vue-ui-waffle-BZFI7JLd.js → vue-ui-waffle-D2GfM_Se.js} +1 -1
- package/dist/{vue-ui-wheel-DdKm_Vd8.js → vue-ui-wheel-CYBaqHm6.js} +1 -1
- package/dist/{vue-ui-word-cloud-D40vUb5e.js → vue-ui-word-cloud-ClGL6iKL.js} +1 -1
- package/dist/{vue-ui-world-BseI3A0C.js → vue-ui-world-Dm7LSNB2.js} +1 -1
- package/dist/{vue-ui-xy-Bl-DUFcf.js → vue-ui-xy-2VCMSzeE.js} +2 -2
- package/dist/{vue-ui-xy-DNVd3FPA.js → vue-ui-xy-DUlJcC9R.js} +1 -1
- package/package.json +1 -1
- package/dist/package-vXTjpYqq.js +0 -1
- package/dist/vue-data-ui-0NKIVNqt.js +0 -1
- package/dist/vue-ui-donut-B9WXaiPn.js +0 -47
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{n as t,r as n,t as r}from"./userOptionsSlots-CWtXN5Q6.js";import{D as i,Jt as ee,X as a,at as o,nt as te,zt as s}from"./lib-rPeBMZrn.js";import{n as ne,t as re}from"./useHints-C-TwxM0Y.js";import{t as ie}from"./useConfig-_JwRfIqE.js";import{t as ae}from"./usePrinter-DVf3YcG5.js";import{t as oe}from"./useNestedProp-DnGoh-XS.js";import{t as se}from"./useUserOptionState-CXlFnwPv.js";import{t as ce}from"./usePrefersMotion-XLHwega2.js";import{t as le}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{Fragment as c,computed as l,createBlock as ue,createCommentVNode as u,createElementBlock as d,createElementVNode as f,createSlots as de,createTextVNode as p,defineAsyncComponent as fe,guardReactiveProps as pe,mergeProps as m,nextTick as me,normalizeClass as he,normalizeProps as ge,normalizeStyle as h,onBeforeUnmount as g,onMounted as _,openBlock as v,ref as y,renderList as b,renderSlot as x,shallowRef as _e,toDisplayString as S,unref as C,useSlots as ve,watch as w,withCtx as ye}from"vue";var be=/* @__PURE__ */ e({default:()=>T}),xe=[`id`],Se=[`aria-labelledby`],Ce=[`id`],we=[`height`],Te=[`id`],Ee=[`data-cell`,`aria-label`,`height`],De={key:2,ref:`source`,dir:`auto`},T=/*#__PURE__*/ le({__name:`vue-ui-carousel-table`,props:{config:{type:Object,default(){return{}}},dataset:{type:Object,default(){return{}}}},emits:[`copyAlt`],setup(e,{expose:le,emit:be}){let T=fe(()=>import(`./vue-ui-skeleton-BLyh-ESb.js`).then(e=>e.n)),Oe=fe(()=>import(`./UserOptions-K1N7zQRx.js`).then(e=>e.n)),{vue_ui_carousel_table:ke}=ie(),E=ce(),D=e,Ae=be,O=y(a()),je=y(!1),k=y(!!D.dataset),Me=ve();_(()=>{Ne()});let A=l({get:()=>Le(),set:e=>e}),j=l(()=>A.value.debug);_(()=>{Me[`chart-background`]&&j.value&&console.warn(`VueUiCarouselTable does not support the #chart-background slot.`)});function Ne(){s(D.dataset)?o({componentName:`VueUiCarouselTable`,type:`dataset`,debug:j.value}):((!D.dataset.head||s(D.dataset.head))&&(o({componentName:`VueUiCarouselTable`,type:`datasetAttribute`,property:`head`,debug:j.value}),k.value=!1),(!D.dataset.body||s(D.dataset.body))&&(o({componentName:`VueUiCarouselTable`,type:`datasetAttribute`,property:`body`,debug:j.value}),k.value=!1)),E.value&&(A.value.userOptions.buttons.animation=!1)}ne({config:()=>A.value,dataset:()=>D.dataset,component:`VueUiCarouselTable`,rules:[re.noHint]});let Pe=l(()=>A.value.userOptions.useCursorPointer),{userOptionsVisible:M,setUserOptionsVisibility:Fe,keepUserOptionState:Ie}=se({config:A.value});function Le(){return oe({userConfig:D.config,defaultConfig:ke})}w(()=>D.config,e=>{A.value=Le(),M.value=!A.value.userOptions.showOnChartHover,Ne()},{deep:!0}),w(()=>D.dataset,e=>{U()},{deep:!0});let{isPrinting:Re,isImaging:ze,generatePdf:Be,generateImage:Ve}=ae({elementId:`carousel-table_${O.value}`,fileName:A.value.caption.text||`vue-ui-carousel-table`,options:A.value.userOptions.print}),N=y({showAnimation:A.value.animation.use}),P=y(null),He=y(null),F=y(null),I=y(null),L=y(0),R=y(0),z=y(!1),B=y(null),V=y(null),H=y(0);function U(){B.value&&(V.value={elements:B.value.getElementsByTagName(`tr`),heights:Array.from(B.value.getElementsByTagName(`tr`)).map(e=>e.getBoundingClientRect().height)})}_(U);let Ue=l(()=>!V.value||!V.value.heights.length?0:Math.max(...V.value.heights)+L.value+R.value),We=l(()=>D.dataset.body?A.value.tbody.tr.visible<=D.dataset.body.length?A.value.tbody.tr.visible:D.dataset.body.length:0),Ge=l(()=>(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=y(0),G=y(null),K=y(0),q=y(!1),Ke=y(0);_(()=>{F.value&&(L.value=F.value.getBoundingClientRect().height),I.value&&(R.value=I.value.getBoundingClientRect().height),N.value.showAnimation&&V.value&&Je()}),_(()=>{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(),g(()=>{P.value.removeEventListener(`scroll`,n)})}});function qe(e){je.value=e,Ke.value+=1}function Je(){E.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}g(Y);function X(){q.value&&N.value.showAnimation&&(q.value=!1,K.value=0,Je())}function Ze(){A.value.animation.pauseOnHover&&Y()}let Z=y(null);function Qe(){Y(),clearTimeout(Z.value)}function $e(){clearTimeout(Z.value),Z.value=setTimeout(X,1e3)}w(()=>A.value.animation.use,e=>{e?(N.value.showAnimation=!0,X()):(N.value.showAnimation=!1,Y())}),w(()=>A.value.animation.type,e=>{Y(),W.value=0,H.value=0,P.value.scrollTo({top:0,behavior:`auto`}),X()});let et=l(()=>A.value.responsiveBreakpoint),Q=_e(null);_(()=>{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,me(()=>{Y(),K.value=0,W.value=0,U(),X()})}),P.value&&Q.value.observe(P.value)}),g(()=>{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){me(()=>{let t=D.dataset.head.map((e,t)=>[[D.dataset.body[t]]]),n=[[A.value.caption.text],[D.dataset.head.map(e=>[e])]].concat(t),r=i(n);e?e(r):te({csvContent:r,title:A.value.caption.text||`vue-ui-carousel-table`})})}async function $(){Ae(`copyAlt`,{config:A.value,dataset:D.dataset}),A.value.userOptions.callbacks.altCopy?await Promise.resolve(A.value.userOptions.callbacks.altCopy({config:A.value,dataset:D.dataset})):console.warn("Vue Data UI - A callback must be set for `altCopy` in userOptions.")}return le({pauseAnimation:Y,resumeAnimation:X,toggleAnimation:nt,generateCsv:rt,generatePdf:tt,generateImage:Ve,copyAlt:$}),(i,a)=>(v(),d(`div`,{class:`vue-data-ui-component vue-ui-carousel-table`,style:{position:`relative`,overflow:`visible`},ref_key:`chartContainer`,ref:He,onMouseenter:a[5]||=()=>C(Fe)(!0),onMouseleave:a[6]||=()=>C(Fe)(!1)},[f(`div`,{ref_key:`tableContainer`,ref:P,id:`carousel-table_${O.value}`,style:h({height:C(Re)||C(ze)?`auto`:`${Math.max(Ge.value,Ue.value)}px`,containerType:`inline-size`,position:`relative`,overflow:`auto`,fontFamily:A.value.fontFamily}),class:he({"vue-ui-responsive":z.value,"is-playing":A.value.scrollbar.hide||!q.value&&A.value.scrollbar.showOnlyOnHover}),onMouseover:a[0]||=e=>Ze(),onMouseleave:a[1]||=e=>X(),onTouchstart:a[2]||=e=>Qe(),onTouchend:a[3]||=e=>$e(),onTouchcancel:a[4]||=e=>$e()},[k.value?(v(),d(`table`,{key:0,class:`vue-data-ui-carousel-table`,"aria-labelledby":`carousel-caption-${O.value}`,style:h({...A.value.style,border:`${A.value.border.size}px solid ${A.value.border.color}`,width:`100%`,borderCollapse:`collapse`,backgroundColor:A.value.tbody.backgroundColor})},[f(`caption`,{ref_key:`caption`,ref:F,class:`vue-data-ui-carousel-table-caption`,id:`carousel-caption-${O.value}`,style:h({...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:i.$slots.caption||A.value.caption.text||A.value.userOptions.show?``:`none`})},[p(S(A.value.caption.text&&!i.$slots.caption?A.value.caption.text:``)+` `,1),x(i.$slots,`caption`,{},void 0,!0)],12,Ce),f(`thead`,{role:`rowgroup`,style:h({...A.value.thead.style,position:`sticky`,top:`${i.$slots.caption||A.value.caption.text||A.value.userOptions.show?L.value:0}px`,zIndex:1})},[f(`tr`,{ref_key:`tableRow`,ref:I,role:`row`,style:h({...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`},[(v(!0),d(c,null,b(e.dataset.head,(e,t)=>(v(),d(`th`,{role:`cell`,key:`th_${t}`,id:`col-${t}`,scope:`col`,style:h({...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`})},[p(S(i.$slots.th?``:e)+` `,1),x(i.$slots,`th`,m({ref_for:!0},{th:e,colIndex:t}),void 0,!0)],12,Te))),128))],12,we)],4),e.dataset.body&&e.dataset.head?(v(),d(`tbody`,{key:0,ref_key:`tbody`,ref:B,"aria-live":`polite`,style:{clipPath:`inset(0,0,0,0)`}},[(v(!0),d(c,null,b(e.dataset.body,(t,n)=>(v(),d(`tr`,{style:h({...A.value.tbody.tr.style,border:`${A.value.tbody.tr.border.size}px solid ${A.value.tbody.tr.border.color}`,verticalAlign:`middle`})},[(v(!0),d(c,null,b(t,(t,r)=>(v(),d(`td`,{role:`cell`,"data-cell":e.dataset.head[r]||``,"aria-label":`${e.dataset.head[r]}: ${t}`,style:h({...A.value.tbody.tr.td.style,border:`${A.value.tbody.tr.td.border.size}px solid ${A.value.tbody.tr.td.border.color}`,backgroundColor:C(ee)(A.value.tbody.tr.td.style.backgroundColor,n%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`},[p(S(i.$slots.td?``:t)+` `,1),x(i.$slots,`td`,m({ref_for:!0},{td:t,rowIndex:n,colIndex:r}),void 0,!0)],12,Ee))),256))],4))),256))],512)):u(``,!0)],12,Se)):u(``,!0)],46,xe),k.value?u(``,!0):(v(),ue(C(T),{key:0,config:{type:`table`}})),A.value.userOptions.show&&k.value&&(C(Ie)||C(M))?(v(),ue(C(Oe),m({ref:`details`,key:`user_option_${Ke.value}`,backgroundColor:A.value.style.backgroundColor,color:A.value.style.color,isPrinting:C(Re),isImaging:C(ze),uid:O.value,hasTooltip:!1,hasTable:!1,hasLabel:!1,isAnimation:!N.value.showAnimation,isFullscreen:je.value,chartElement:He.value},C(n)(A.value.userOptions,`pdf csv img fullscreen altCopy animation`),{zIndex:3,offsetX:12,isCursorPointer:Pe.value,onGeneratePdf:tt,onGenerateCsv:rt,onGenerateImage:C(Ve),onToggleAnimation:nt,onToggleFullscreen:qe,onCopyAlt:$,style:{visibility:C(Ie)?C(M)?`visible`:`hidden`:`visible`}}),de({_:2},[b(C(t)(i.$slots,`menuIcon optionPdf optionCsv optionImg optionSvg optionAnimation optionFullscreen optionAltCopy custom-menu-before custom-menu-after`),e=>({name:e,fn:ye(t=>[x(i.$slots,e,ge(pe(C(r)(e,t))),void 0,!0)])}))]),1040,[`backgroundColor`,`color`,`isPrinting`,`isImaging`,`uid`,`isAnimation`,`isFullscreen`,`chartElement`,`isCursorPointer`,`onGenerateImage`,`style`])):u(``,!0),i.$slots.source?(v(),d(`div`,De,[x(i.$slots,`source`,{},void 0,!0)],512)):u(``,!0)],544))}},[[`__scopeId`,`data-v-c9c4bcb2`]]);export{be as n,T as t};
|
|
1
|
+
import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{n as t,r as n,t as r}from"./userOptionsSlots-CWtXN5Q6.js";import{D as i,Jt as ee,X as a,at as o,nt as te,zt as s}from"./lib-rPeBMZrn.js";import{n as ne,t as re}from"./useHints-C-TwxM0Y.js";import{t as ie}from"./useConfig-_JwRfIqE.js";import{t as ae}from"./usePrinter-DVf3YcG5.js";import{t as oe}from"./useNestedProp-DnGoh-XS.js";import{t as se}from"./useUserOptionState-CXlFnwPv.js";import{t as ce}from"./usePrefersMotion-XLHwega2.js";import{t as le}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{Fragment as c,computed as l,createBlock as ue,createCommentVNode as u,createElementBlock as d,createElementVNode as f,createSlots as de,createTextVNode as p,defineAsyncComponent as fe,guardReactiveProps as pe,mergeProps as m,nextTick as me,normalizeClass as he,normalizeProps as ge,normalizeStyle as h,onBeforeUnmount as g,onMounted as _,openBlock as v,ref as y,renderList as b,renderSlot as x,shallowRef as _e,toDisplayString as S,unref as C,useSlots as ve,watch as w,withCtx as ye}from"vue";var be=/* @__PURE__ */ e({default:()=>T}),xe=[`id`],Se=[`aria-labelledby`],Ce=[`id`],we=[`height`],Te=[`id`],Ee=[`data-cell`,`aria-label`,`height`],De={key:2,ref:`source`,dir:`auto`},T=/*#__PURE__*/ le({__name:`vue-ui-carousel-table`,props:{config:{type:Object,default(){return{}}},dataset:{type:Object,default(){return{}}}},emits:[`copyAlt`],setup(e,{expose:le,emit:be}){let T=fe(()=>import(`./vue-ui-skeleton-CZMyXM-1.js`).then(e=>e.n)),Oe=fe(()=>import(`./UserOptions-K1N7zQRx.js`).then(e=>e.n)),{vue_ui_carousel_table:ke}=ie(),E=ce(),D=e,Ae=be,O=y(a()),je=y(!1),k=y(!!D.dataset),Me=ve();_(()=>{Ne()});let A=l({get:()=>Le(),set:e=>e}),j=l(()=>A.value.debug);_(()=>{Me[`chart-background`]&&j.value&&console.warn(`VueUiCarouselTable does not support the #chart-background slot.`)});function Ne(){s(D.dataset)?o({componentName:`VueUiCarouselTable`,type:`dataset`,debug:j.value}):((!D.dataset.head||s(D.dataset.head))&&(o({componentName:`VueUiCarouselTable`,type:`datasetAttribute`,property:`head`,debug:j.value}),k.value=!1),(!D.dataset.body||s(D.dataset.body))&&(o({componentName:`VueUiCarouselTable`,type:`datasetAttribute`,property:`body`,debug:j.value}),k.value=!1)),E.value&&(A.value.userOptions.buttons.animation=!1)}ne({config:()=>A.value,dataset:()=>D.dataset,component:`VueUiCarouselTable`,rules:[re.noHint]});let Pe=l(()=>A.value.userOptions.useCursorPointer),{userOptionsVisible:M,setUserOptionsVisibility:Fe,keepUserOptionState:Ie}=se({config:A.value});function Le(){return oe({userConfig:D.config,defaultConfig:ke})}w(()=>D.config,e=>{A.value=Le(),M.value=!A.value.userOptions.showOnChartHover,Ne()},{deep:!0}),w(()=>D.dataset,e=>{U()},{deep:!0});let{isPrinting:Re,isImaging:ze,generatePdf:Be,generateImage:Ve}=ae({elementId:`carousel-table_${O.value}`,fileName:A.value.caption.text||`vue-ui-carousel-table`,options:A.value.userOptions.print}),N=y({showAnimation:A.value.animation.use}),P=y(null),He=y(null),F=y(null),I=y(null),L=y(0),R=y(0),z=y(!1),B=y(null),V=y(null),H=y(0);function U(){B.value&&(V.value={elements:B.value.getElementsByTagName(`tr`),heights:Array.from(B.value.getElementsByTagName(`tr`)).map(e=>e.getBoundingClientRect().height)})}_(U);let Ue=l(()=>!V.value||!V.value.heights.length?0:Math.max(...V.value.heights)+L.value+R.value),We=l(()=>D.dataset.body?A.value.tbody.tr.visible<=D.dataset.body.length?A.value.tbody.tr.visible:D.dataset.body.length:0),Ge=l(()=>(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=y(0),G=y(null),K=y(0),q=y(!1),Ke=y(0);_(()=>{F.value&&(L.value=F.value.getBoundingClientRect().height),I.value&&(R.value=I.value.getBoundingClientRect().height),N.value.showAnimation&&V.value&&Je()}),_(()=>{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(),g(()=>{P.value.removeEventListener(`scroll`,n)})}});function qe(e){je.value=e,Ke.value+=1}function Je(){E.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}g(Y);function X(){q.value&&N.value.showAnimation&&(q.value=!1,K.value=0,Je())}function Ze(){A.value.animation.pauseOnHover&&Y()}let Z=y(null);function Qe(){Y(),clearTimeout(Z.value)}function $e(){clearTimeout(Z.value),Z.value=setTimeout(X,1e3)}w(()=>A.value.animation.use,e=>{e?(N.value.showAnimation=!0,X()):(N.value.showAnimation=!1,Y())}),w(()=>A.value.animation.type,e=>{Y(),W.value=0,H.value=0,P.value.scrollTo({top:0,behavior:`auto`}),X()});let et=l(()=>A.value.responsiveBreakpoint),Q=_e(null);_(()=>{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,me(()=>{Y(),K.value=0,W.value=0,U(),X()})}),P.value&&Q.value.observe(P.value)}),g(()=>{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){me(()=>{let t=D.dataset.head.map((e,t)=>[[D.dataset.body[t]]]),n=[[A.value.caption.text],[D.dataset.head.map(e=>[e])]].concat(t),r=i(n);e?e(r):te({csvContent:r,title:A.value.caption.text||`vue-ui-carousel-table`})})}async function $(){Ae(`copyAlt`,{config:A.value,dataset:D.dataset}),A.value.userOptions.callbacks.altCopy?await Promise.resolve(A.value.userOptions.callbacks.altCopy({config:A.value,dataset:D.dataset})):console.warn("Vue Data UI - A callback must be set for `altCopy` in userOptions.")}return le({pauseAnimation:Y,resumeAnimation:X,toggleAnimation:nt,generateCsv:rt,generatePdf:tt,generateImage:Ve,copyAlt:$}),(i,a)=>(v(),d(`div`,{class:`vue-data-ui-component vue-ui-carousel-table`,style:{position:`relative`,overflow:`visible`},ref_key:`chartContainer`,ref:He,onMouseenter:a[5]||=()=>C(Fe)(!0),onMouseleave:a[6]||=()=>C(Fe)(!1)},[f(`div`,{ref_key:`tableContainer`,ref:P,id:`carousel-table_${O.value}`,style:h({height:C(Re)||C(ze)?`auto`:`${Math.max(Ge.value,Ue.value)}px`,containerType:`inline-size`,position:`relative`,overflow:`auto`,fontFamily:A.value.fontFamily}),class:he({"vue-ui-responsive":z.value,"is-playing":A.value.scrollbar.hide||!q.value&&A.value.scrollbar.showOnlyOnHover}),onMouseover:a[0]||=e=>Ze(),onMouseleave:a[1]||=e=>X(),onTouchstart:a[2]||=e=>Qe(),onTouchend:a[3]||=e=>$e(),onTouchcancel:a[4]||=e=>$e()},[k.value?(v(),d(`table`,{key:0,class:`vue-data-ui-carousel-table`,"aria-labelledby":`carousel-caption-${O.value}`,style:h({...A.value.style,border:`${A.value.border.size}px solid ${A.value.border.color}`,width:`100%`,borderCollapse:`collapse`,backgroundColor:A.value.tbody.backgroundColor})},[f(`caption`,{ref_key:`caption`,ref:F,class:`vue-data-ui-carousel-table-caption`,id:`carousel-caption-${O.value}`,style:h({...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:i.$slots.caption||A.value.caption.text||A.value.userOptions.show?``:`none`})},[p(S(A.value.caption.text&&!i.$slots.caption?A.value.caption.text:``)+` `,1),x(i.$slots,`caption`,{},void 0,!0)],12,Ce),f(`thead`,{role:`rowgroup`,style:h({...A.value.thead.style,position:`sticky`,top:`${i.$slots.caption||A.value.caption.text||A.value.userOptions.show?L.value:0}px`,zIndex:1})},[f(`tr`,{ref_key:`tableRow`,ref:I,role:`row`,style:h({...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`},[(v(!0),d(c,null,b(e.dataset.head,(e,t)=>(v(),d(`th`,{role:`cell`,key:`th_${t}`,id:`col-${t}`,scope:`col`,style:h({...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`})},[p(S(i.$slots.th?``:e)+` `,1),x(i.$slots,`th`,m({ref_for:!0},{th:e,colIndex:t}),void 0,!0)],12,Te))),128))],12,we)],4),e.dataset.body&&e.dataset.head?(v(),d(`tbody`,{key:0,ref_key:`tbody`,ref:B,"aria-live":`polite`,style:{clipPath:`inset(0,0,0,0)`}},[(v(!0),d(c,null,b(e.dataset.body,(t,n)=>(v(),d(`tr`,{style:h({...A.value.tbody.tr.style,border:`${A.value.tbody.tr.border.size}px solid ${A.value.tbody.tr.border.color}`,verticalAlign:`middle`})},[(v(!0),d(c,null,b(t,(t,r)=>(v(),d(`td`,{role:`cell`,"data-cell":e.dataset.head[r]||``,"aria-label":`${e.dataset.head[r]}: ${t}`,style:h({...A.value.tbody.tr.td.style,border:`${A.value.tbody.tr.td.border.size}px solid ${A.value.tbody.tr.td.border.color}`,backgroundColor:C(ee)(A.value.tbody.tr.td.style.backgroundColor,n%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`},[p(S(i.$slots.td?``:t)+` `,1),x(i.$slots,`td`,m({ref_for:!0},{td:t,rowIndex:n,colIndex:r}),void 0,!0)],12,Ee))),256))],4))),256))],512)):u(``,!0)],12,Se)):u(``,!0)],46,xe),k.value?u(``,!0):(v(),ue(C(T),{key:0,config:{type:`table`}})),A.value.userOptions.show&&k.value&&(C(Ie)||C(M))?(v(),ue(C(Oe),m({ref:`details`,key:`user_option_${Ke.value}`,backgroundColor:A.value.style.backgroundColor,color:A.value.style.color,isPrinting:C(Re),isImaging:C(ze),uid:O.value,hasTooltip:!1,hasTable:!1,hasLabel:!1,isAnimation:!N.value.showAnimation,isFullscreen:je.value,chartElement:He.value},C(n)(A.value.userOptions,`pdf csv img fullscreen altCopy animation`),{zIndex:3,offsetX:12,isCursorPointer:Pe.value,onGeneratePdf:tt,onGenerateCsv:rt,onGenerateImage:C(Ve),onToggleAnimation:nt,onToggleFullscreen:qe,onCopyAlt:$,style:{visibility:C(Ie)?C(M)?`visible`:`hidden`:`visible`}}),de({_:2},[b(C(t)(i.$slots,`menuIcon optionPdf optionCsv optionImg optionSvg optionAnimation optionFullscreen optionAltCopy custom-menu-before custom-menu-after`),e=>({name:e,fn:ye(t=>[x(i.$slots,e,ge(pe(C(r)(e,t))),void 0,!0)])}))]),1040,[`backgroundColor`,`color`,`isPrinting`,`isImaging`,`uid`,`isAnimation`,`isFullscreen`,`chartElement`,`isCursorPointer`,`onGenerateImage`,`style`])):u(``,!0),i.$slots.source?(v(),d(`div`,De,[x(i.$slots,`source`,{},void 0,!0)],512)):u(``,!0)],544))}},[[`__scopeId`,`data-v-c9c4bcb2`]]);export{be as n,T as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{n as t,r as n,t as r}from"./userOptionsSlots-CWtXN5Q6.js";import{n as i,r as a,t as o}from"./annotationSlots-OLiW25XN.js";import{t as s}from"./tableIntegration-CNoJ1CIY.js";import{n as ee}from"./resolveChartConfig-0IvbmIE_.js";import{$ as c,D as te,Ht as l,It as ne,Jt as u,S as re,X as ie,Yt as ae,at as oe,f as d,h as se,i as ce,in as le,nt as ue,p as de,r as fe,t as pe,w as me,yt as he,zt as ge}from"./lib-rPeBMZrn.js";import{n as _e,t as ve}from"./useHints-C-TwxM0Y.js";import{t as ye}from"./useConfig-_JwRfIqE.js";import{n as be,t as xe}from"./BaseScanner-8NdoBs7B.js";import{t as Se}from"./usePrinter-DVf3YcG5.js";import{t as Ce}from"./useChartExport-BZts4KFb.js";import{t as we}from"./useTableResponsive-uSz_qZOB.js";import{t as Te}from"./useUserOptionState-CXlFnwPv.js";import{t as Ee}from"./useChartAccessibility-DOMuYJfm.js";import{t as De}from"./img-D4RQwASc.js";import{t as Oe}from"./vue_ui_chestnut-BKcntsvv.js";import{t as ke}from"./A11yDataTable-DWNlWXzs.js";import{t as Ae}from"./DefGrad-DKMq1REY.js";import{t as je}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{Fragment as f,computed as p,createBlock as Me,createCommentVNode as m,createElementBlock as h,createElementVNode as g,createSlots as Ne,createTextVNode as Pe,createVNode as Fe,defineAsyncComponent as Ie,guardReactiveProps as Le,mergeProps as Re,nextTick as ze,normalizeClass as _,normalizeProps as Be,normalizeStyle as v,onMounted as Ve,openBlock as y,ref as b,renderList as x,renderSlot as S,resolveDynamicComponent as He,toDisplayString as C,toRefs as Ue,unref as w,useCssVars as We,watch as Ge,withCtx as Ke,withKeys as qe}from"vue";var Je=/* @__PURE__ */ e({default:()=>Bn}),Ye=[`id`],Xe=[`id`],Ze={"aria-live":`polite`,class:`sr-only`},Qe={key:2,ref:`noTitle`,class:`vue-data-ui-no-title-space`,style:`height:36px; width: 100%;background:transparent`},$e={style:{position:`relative`}},et=[`xmlns`,`aria-describedby`,`viewBox`],tt=[`width`,`height`],nt={key:1},rt=[`fill`,`font-weight`,`font-size`,`x`,`y`],it=[`fill`,`font-weight`,`font-size`,`x`,`y`],at={key:2},ot=[`x`,`y`,`font-size`,`font-weight`,`fill`],st=[`x`,`y`,`font-size`,`font-weight`,`fill`],ct=[`d`,`stroke`,`fill`],lt=[`cx`,`cy`,`r`,`fill`],ut=[`aria-label`,`cx`,`cy`,`r`,`fill`,`stroke`,`stroke-width`,`onClick`],dt={key:3},ft=[`x`,`y`,`font-size`,`fill`,`onClick`],pt={key:0},mt=[`x`,`y`,`fill`,`font-size`,`font-weight`],ht=[`x`,`y`,`height`,`width`,`fill`,`rx`,`onClick`],gt=[`aria-label`,`x`,`y`,`height`,`width`,`fill`,`rx`,`stroke`,`stroke-width`,`onClick`],_t={key:4},vt=[`x`,`y`,`fill`,`font-size`,`onClick`],yt=[`d`,`stroke`],bt=[`aria-label`,`fill`,`cx`,`cy`,`r`,`onClick`],xt={key:5},St=[`x`,`y`,`font-size`,`font-weight`,`fill`],Ct=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`],wt=[`y`,`height`,`width`],Tt={style:{width:`100%`,height:`100%`,display:`flex`,"align-items":`center`,"justify-content":`center`,"flex-direction":`column`}},Et={style:{display:`flex`,"align-items":`center`,"justify-content":`center`,gap:`12px`,"flex-wrap":`wrap`,"flex-direction":`row`}},Dt={viewBox:`0 0 20 20`,height:`16`,width:`16`},Ot=[`fill`],kt={key:7},At=[`y`,`height`,`width`],jt={style:{width:`100%`,height:`100%`,display:`flex`,"align-items":`center`,"justify-content":`center`,"flex-direction":`column`}},Mt={style:{display:`flex`,"align-items":`center`,"justify-content":`center`,gap:`12px`,"flex-wrap":`wrap`,"flex-direction":`row`}},Nt={viewBox:`0 0 20 20`,height:`16`,width:`16`},Pt=[`fill`],Ft=[`cx`,`cy`,`fill`],It=[`d`,`stroke`],Lt=[`cx`,`cy`,`fill`],Rt=[`d`,`stroke`],zt=[`cx`,`cy`,`fill`],Bt=[`cx`,`cy`,`fill`],Vt=[`x`,`y`,`fill`,`font-size`,`font-weight`],Ht=[`x`,`y`,`fill`,`font-size`,`font-weight`],Ut=[`x`,`text-anchor`,`y`,`fill`,`font-size`],Wt=[`x`,`text-anchor`,`y`,`fill`,`font-size`],Gt=[`x`,`text-anchor`,`y`,`fill`,`font-size`],Kt=[`x`,`text-anchor`,`y`,`fill`,`font-size`],qt=[`x`,`text-anchor`,`y`,`fill`,`font-size`],Jt=[`x`,`y`,`font-size`,`fill`],Yt=[`x`,`y`,`font-size`,`fill`],Xt=[`x`,`y`,`font-size`,`fill`],Zt={key:4,class:`vue-data-ui-watermark`},Qt={key:5,ref:`source`,dir:`auto`},$t={class:`vue-ui-data-table`},en={key:0},tn=[`data-cell`],nn={style:{display:`flex`,"align-items":`center`,gap:`5px`,"justify-content":`flex-end`,width:`100%`,"padding-right":`3px`}},rn={key:0},an={key:1},on=[`data-cell`],sn={style:{display:`flex`,"align-items":`center`,gap:`5px`,"justify-content":`flex-end`,width:`100%`,"padding-right":`3px`}},cn={key:0},ln={key:1},un=[`data-cell`],dn={style:{display:`flex`,"align-items":`center`,gap:`5px`,"justify-content":`flex-end`,width:`100%`,"padding-right":`3px`}},fn={key:0},pn={key:1},mn=[`data-cell`],hn={style:{display:`flex`,"align-items":`center`,gap:`5px`,"justify-content":`flex-end`,width:`100%`,"padding-right":`3px`}},gn={key:0},_n={key:1},vn=[`data-cell`],yn={style:{display:`flex`,"align-items":`center`,gap:`5px`,"justify-content":`flex-end`,width:`100%`,"padding-right":`3px`}},bn={key:0},xn={key:1},Sn=[`data-cell`],Cn={style:{display:`flex`,"align-items":`center`,gap:`5px`,"justify-content":`flex-end`,width:`100%`,"padding-right":`3px`}},wn={key:0},Tn={key:1},En=[`data-cell`],Dn={style:{display:`flex`,"align-items":`center`,gap:`5px`,"justify-content":`flex-end`,width:`100%`,"padding-right":`3px`}},On={key:0},kn={key:1},An=[`data-cell`],jn={style:{display:`flex`,"align-items":`center`,gap:`5px`,"justify-content":`flex-end`,width:`100%`,"padding-right":`3px`}},Mn=[`data-cell`],Nn={style:{display:`flex`,"align-items":`center`,gap:`5px`,"justify-content":`flex-end`,width:`100%`,"padding-right":`3px`}},Pn=[`data-cell`],Fn={style:{display:`flex`,"align-items":`center`,gap:`5px`,"justify-content":`flex-end`,width:`100%`,"padding-right":`3px`}},In=[`data-cell`],Ln={style:{display:`flex`,"align-items":`center`,gap:`5px`,"justify-content":`flex-end`,width:`100%`,"padding-right":`3px`}},Rn=[`data-cell`],zn={style:{display:`flex`,"align-items":`center`,gap:`5px`,"justify-content":`flex-end`,width:`100%`,"padding-right":`3px`}},Bn=/*#__PURE__*/ je({__name:`vue-ui-chestnut`,props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:[`selectRoot`,`selectBranch`,`selectNut`,`copyAlt`],setup(e,{expose:je,emit:Je}){We(e=>({v45e1a30d:e.tdo}));let Bn=Ie(()=>import(`./BaseIcon-CoY0vuL3.js`).then(e=>e.n)),Vn=Ie(()=>import(`./vue-ui-accordion-DxGxf-Rm.js`).then(e=>e.n)),Hn=Ie(()=>import(`./PenAndPaper-BV5ODysA.js`).then(e=>e.t)),Un=Ie(()=>import(`./UserOptions-K1N7zQRx.js`).then(e=>e.n)),Wn=Ie(()=>import(`./PackageVersion-ksOit8fp.js`).then(e=>e.t)),Gn=Ie(()=>import(`./BaseDraggableDialog-DVstuNhT.js`).then(e=>e.n)),{vue_ui_chestnut:Kn}=ye(),T=e,qn=p(()=>!!T.dataset&&T.dataset.length),E=b(ie()),Jn=b(null),Yn=b(0),Xn=b(null),Zn=b(null),Qn=b(!1),D=b(!1),O=b(``),k=b({level:`root`,rootIndex:0,branchIndex:0,nutIndex:0,locked:!1}),A=b(or()),j=p(()=>A.value.style.chart.layout.roots),M=p(()=>A.value.style.chart.layout.branches),N=p(()=>A.value.style.chart.layout.nuts),P=p(()=>A.value.style.chart.layout),F=p(()=>A.value.style.chart);_e({config:()=>A.value,dataset:()=>T.dataset,component:`VueUiChestnut`,rules:[ve.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 I=p(()=>A.value.userOptions.useCursorPointer),$n=p(()=>le({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:A.value.skeletonConfig??{}})),{loading:er,FINAL_DATASET:tr}=be({...Ue(T),FINAL_CONFIG:A,prepareConfig:or,skeletonDataset:T.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:le({defaultConfig:A.value,userConfig:$n.value})}),{userOptionsVisible:nr,setUserOptionsVisibility:rr,keepUserOptionState:ir}=Te({config:A.value}),{svgRef:ar}=Ee({config:P.value.title});function or(){return ee(T.config,Kn,Oe)}Ge(()=>T.config,e=>{A.value=or(),nr.value=!A.value.userOptions.showOnChartHover,pr.value.showTable=A.value.table.show,Fr()},{deep:!0});let{isPrinting:sr,isImaging:cr,generatePdf:lr,generateImage:ur}=Se({elementId:`vue-ui-chestnut_${E.value}`,fileName:P.value.title.text||`vue-ui-chestnut`,options:A.value.userOptions.print}),dr=p(()=>A.value.userOptions.show),fr=p(()=>me(A.value.customPalette)),pr=b({showTable:A.value.table.show});Ge(A,()=>{pr.value={showTable:A.value.table.show}},{immediate:!0});let mr=b(null),hr=p(()=>A.value.table.responsiveBreakpoint),L=b({gap:6,padding:{top:102,left:12,right:12,bottom:96},width:1024,height:0,branchSize:32,branchStart:128}),R=p(()=>({left:L.value.padding.left,top:L.value.padding.top,right:L.value.width-L.value.padding.right,bottom:L.value.height-L.value.padding.bottom,width:L.value.width-(L.value.padding.left+L.value.padding.right),height:L.value.height-(L.value.padding.top+L.value.padding.bottom),seedX:L.value.padding.left+64})),z=p(()=>tr.value.flatMap(e=>(e.branches||[]).map(e=>e.value||0)).reduce((e,t)=>e+t,0)),gr=p(()=>A.value.debug),B=p(()=>(gr.value&&tr.value.forEach((e,t)=>{he({datasetObject:e,requiredAttributes:[`name`,`branches`]}).forEach(e=>{oe({componentName:`VueUiChestnut`,type:`datasetSerieAttribute`,property:e,index:t})}),e.branches&&e.branches.forEach((e,n)=>{he({datasetObject:e,requiredAttributes:[`name`,`value`]}).forEach(e=>{oe({componentName:`VueUiChestnut`,type:`datasetSerieAttribute`,property:e,index:`${t} - ${n}`})}),e.breakdown&&e.breakdown.forEach((e,r)=>{he({datasetObject:e,requiredAttributes:[`name`,`value`]}).forEach(e=>{oe({componentName:`VueUiChestnut`,type:`datasetSerieAttribute`,property:e,index:`${t} - ${n} - ${r}`})})})})}),tr.value.map((e,t)=>{let n=(e.branches||[]).map(e=>e.value||0).reduce((e,t)=>e+t,0);return{...e,color:re(e.color)||fr.value[t]||l[t]||l[t%l.length],id:e.id||`root_${t}_${E.value}`,type:`root`,total:n,rootIndex:t,branches:(e.branches||[]).map((r,i)=>({...r,rootName:e.name,rootIndex:t,color:re(e.color)||fr.value[t]||l[t]||l[t%l.length],value:r.value>=0?r.value:0,id:r.id||`branch_${t}_${i}_${E.value}`,proportionToRoot:r.value/n,type:`branch`,breakdown:(r.breakdown||[]).map((a,o)=>({table:{rootName:e.name,rootValue:n,rootToTotal:n/z.value,branchName:r.name,branchValue:r.value,branchToTotal:r.value/z.value,branchToRoot:r.value/n,nutName:a.name,nutValue:a.value,nutToTotal:a.value/z.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/z.value,rootIndex:t,id:a.id||`nut_${t}_${i}_${o}_${E.value}`,color:re(a.color)||fr.value[o]||l[o]||l[o%l.length],value:a.value>=0?a.value:0}))}))}})));function _r(){return B.value}let vr=Je,yr=p(()=>B.value.flatMap(e=>e.branches).length),br=p(()=>Math.max(...B.value.map(e=>e.branches.map(e=>e.value).reduce((e,t)=>e+t,0)))),xr=p(()=>Math.max(...B.value.flatMap(e=>e.branches.map(e=>e.value)))),Sr=p(()=>256+L.value.padding.left),V=p(()=>B.value.sort((e,t)=>t.total-e.total).map((e,t)=>{let n=R.value.height/B.value.length/2,r=e.total/br.value*(n>64?64:n);return{...e,x:R.value.seedX,y:R.value.top+R.value.height/B.value.length*(t+1)-(R.value.height/B.value.length/2+L.value.gap/2),r:r<L.value.branchSize/2?L.value.branchSize/2:r}})),Cr=p(()=>M.value.widthRatio<=0?.1:M.value.widthRatio>1.8?1.8:M.value.widthRatio),wr=p(()=>V.value.flatMap(e=>e.branches)),H=p(()=>wr.value.sort((e,t)=>t.value-e.value).map((e,t)=>({...e,y1:t*L.value.branchSize+R.value.top+t*L.value.gap,y2:t*L.value.branchSize+L.value.branchSize,x1:Sr.value,x2:384*e.value/xr.value*Cr.value+Sr.value}))),Tr=p(()=>V.value),Er=p(()=>Tr.value.map(e=>H.value.filter(t=>t.rootIndex===e.rootIndex).sort((e,t)=>e.y1-t.y1))),Dr=p(()=>Tr.value.map((e,t)=>Er.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 Or(e){let t=V.value.find(t=>t.rootIndex===e.rootIndex);return{x:t.x,y:t.y,r:t.r}}let U=b(null),kr=b(null),W=b(null),G=b(null);function K(){U.value=null,W.value=null,G.value=null}function q(e){if(U.value)return e.type===`root`?e.rootIndex===U.value.rootIndex:e.type===`branch`?e.id===U.value.id:e.type===`nut`&&e.branchName===U.value.name&&e.rootIndex===U.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&&D.value){if(k.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(k.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(k.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=Tr.value.findIndex(t=>t.rootIndex===e.rootIndex),n=(Er.value[t]||[]).findIndex(t=>t.id===e.id);t!==-1&&(k.value.rootIndex=t),n!==-1&&(k.value.branchIndex=n),k.value.level=`nut`,k.value.nutIndex=0,ze(()=>{U.value=e,W.value=e,kr.value=ne({series:e.breakdown,base:1},e.x2+24+N.value.offsetX,e.y1+L.value.branchSize/2,80,80),vr(`selectNut`,e.breakdown),Q()})}function J(){U.value=null,kr.value=null,vr(`selectNut`,null)}function jr(e){let t=Tr.value.findIndex(t=>t.rootIndex===e.rootIndex),n=(Er.value[t]||[]).findIndex(t=>t.id===e.id);t!==-1&&(k.value.rootIndex=t),n!==-1&&(k.value.branchIndex=n),k.value.level=`branch`,k.value.nutIndex=0,W.value&&W.value.id===e.id?(W.value=null,K(),vr(`selectBranch`,null),Q()):(K(),W.value=e,vr(`selectBranch`,e),Q())}function Mr(e){let t=Tr.value.findIndex(t=>t.id===e.id);t!==-1&&(k.value.rootIndex=t),k.value.level=`root`,k.value.branchIndex=0,k.value.nutIndex=0,G.value&&G.value.id===e.id?(K(),vr(`selectRoot`,null),Q()):(K(),G.value=e,vr(`selectRoot`,e),Q())}function Nr(){return R.value.bottom-(U.value.y1+180)<0?0:R.value.bottom}function Pr(e){return e.proportion*100>N.value.selected.labels.dataLabels.hideUnderValue}Ve(()=>{Fr()});function Fr(){ge(T.dataset)&&oe({componentName:`VueUiChestnut`,type:`dataset`,debug:gr.value});let e=yr.value*(L.value.branchSize+L.value.gap)+L.value.padding.top+L.value.padding.bottom;L.value.height=e}let Y=p(()=>({head:[A.value.table.th.translations.rootName,A.value.table.th.translations.rootValue,A.value.table.th.translations.rootToTotal,A.value.table.th.translations.branchName,A.value.table.th.translations.branchValue,A.value.table.th.translations.branchToRoot,A.value.table.th.translations.branchToTotal,A.value.table.th.translations.nutName,A.value.table.th.translations.nutValue,A.value.table.th.translations.nutToBranch,A.value.table.th.translations.nutToRoot,A.value.table.th.translations.nutToTotal],body:B.value.flatMap((e,t)=>e.branches.flatMap((e,t)=>e.breakdown.flatMap((e,t)=>e.table)))}));function Ir(e=null){ze(()=>{let t=[[P.value.title.text],[P.value.title.subtitle.text],[``],[`Grand total`,z.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=te(i);e?e(a):ue({csvContent:a,title:P.value.title.text||`vue-ui-chestnut`})})}let Lr=b(!1);function Rr(e){Lr.value=e,Yn.value+=1}function zr(){pr.value.showTable=!pr.value.showTable}let Br=b(!1);function Vr(){Br.value=!Br.value}async function Hr({scale:e=2}={}){if(!Jn.value)return;let{width:t,height:n}=Jn.value.getBoundingClientRect(),r=t/n,{imageUri:i,base64:a}=await De({domElement:Jn.value,base64:!0,img:!0,scale:e});return{imageUri:i,base64:a,title:P.value.title.text,width:t,height:n,aspectRatio:r}}function Ur(e){let t=Or(e),n=e.x1,r=e.y1,i=L.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=p(()=>s({config:A,style:F,mutableConfig:pr,dialog:Gn,accordion:Vn,isFullscreen:Lr,parent:Jn,maxWidth:800,titleStyle:P,isCursorPointer:I}));Ge(()=>pr.value.showTable,async e=>{A.value.table.show||(e&&A.value.table.useDialog&&Xn.value?(await ze(),Xn.value.open()):`close`in Xn.value&&Xn.value.close())});let{isResponsive:Gr}=we(mr,hr);function Kr(){pr.value.showTable=!1,Zn.value&&Zn.value.setTableIconState(!1)}let qr=p(()=>B.value.map((e,t)=>({...e,display:`${e.name}: ${ce(j.value.labels.formatter,e.total,c({p:P.value.legend.prefix,v:e.total,s:P.value.legend.suffix,r:P.value.legend.roundingValue}),{datapoint:e})} (${c({v:e.total/z.value*100,s:`%`,r:P.value.legend.roundingPercentage})})`}))),Jr=p(()=>qr.value.map(e=>({color:e.color,name:e.display,shape:`circle`}))),Yr=p(()=>F.value.backgroundColor),Xr=p(()=>({...P.value.legend,textAlign:`center`,show:!0,position:`bottom`})),Zr=p(()=>P.value.title),{isCallbackImaging:Qr,isCallbackSvg:$r,generateSvg:ei,onGenerateImage:ti}=Ce({svg:ar,title:Zr,legend:Xr,legendItems:Jr,backgroundColor:Yr,titleEmbedded:!0,getSvgCallback:()=>A.value.userOptions.callbacks.svg,generateImage:ur});async function ni(){vr(`copyAlt`,{config:A.value,dataset:B.value}),A.value.userOptions.callbacks.altCopy?await Promise.resolve(A.value.userOptions.callbacks.altCopy({config:A.value,dataset:B.value})):console.warn("Vue Data UI - A callback must be set for `altCopy` in userOptions.")}function ri(e){if(!e)return``;let t=c({p:P.value.legend.prefix,v:e.total,s:P.value.legend.suffix,r:P.value.legend.roundingValue}),n=c({v:e.total/z.value*100,s:`%`,r:P.value.legend.roundingPercentage});return`Root ${e.name}. Value ${t}. ${n} of total.`}function ii(e){if(!e)return``;let t=c({p:M.value.labels.dataLabels.prefix,v:e.value,s:M.value.labels.dataLabels.suffix,r:M.value.labels.dataLabels.roundingValue}),n=c({v:e.proportionToRoot*100,s:`%`,r:P.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=c({p:P.value.legend.prefix,v:e.value,s:P.value.legend.suffix,r:N.value.selected.labels.roundingValue}),n=c({v:e.proportionToBranch*100,s:`%`,r:N.value.selected.labels.roundingPercentage});return`Nut ${e.name}. Branch ${e.branchName}. Root ${e.rootName}. Value ${t}. ${n} of branch ${e.branchName}.`}let oi=p(()=>Tr.value[k.value.rootIndex]||null),X=p(()=>(Er.value[k.value.rootIndex]||[])[k.value.branchIndex]||null),si=p(()=>((Dr.value[k.value.rootIndex]||[])[k.value.branchIndex]||[])[k.value.nutIndex]||null),Z=p(()=>oi.value),ci=p(()=>X.value),li=p(()=>k.value.level===`nut`?X.value:null),ui=p(()=>Qn.value);function Q(){k.value.level===`root`?O.value=ri(oi.value):k.value.level===`branch`?O.value=ii(X.value):k.value.level===`nut`&&(O.value=ai(si.value))}function $(){k.value={level:`root`,rootIndex:0,branchIndex:0,nutIndex:0,locked:!1},O.value=``}function di(){let e=Er.value[k.value.rootIndex]||[];e.length?(k.value.branchIndex>=e.length&&(k.value.branchIndex=0),k.value.branchIndex<0&&(k.value.branchIndex=e.length-1)):k.value.branchIndex=0}function fi(){let e=(Dr.value[k.value.rootIndex]||[])[k.value.branchIndex]||[];e.length?(k.value.nutIndex>=e.length&&(k.value.nutIndex=0),k.value.nutIndex<0&&(k.value.nutIndex=e.length-1)):k.value.nutIndex=0}function pi(e){if(k.value.level===`root`){let t=Tr.value.length;if(!t)return;k.value.rootIndex+=e,k.value.rootIndex>=t&&(k.value.rootIndex=0),k.value.rootIndex<0&&(k.value.rootIndex=t-1),k.value.branchIndex=0,k.value.nutIndex=0,Q()}else k.value.level===`branch`?(k.value.branchIndex+=e,di(),k.value.nutIndex=0,Q()):k.value.level===`nut`&&(k.value.nutIndex+=e,fi(),Q())}function mi(e){if(e>0){if(k.value.level===`root`){if(!(Er.value[k.value.rootIndex]||[]).length)return;k.value.level=`branch`,k.value.branchIndex=0,k.value.nutIndex=0,Q();return}if(k.value.level===`branch`){if(!((Dr.value[k.value.rootIndex]||[])[k.value.branchIndex]||[]).length)return;k.value.level=`nut`,k.value.nutIndex=0,X.value?Ar(X.value):Q();return}}else k.value.level===`nut`?(J(),W.value=null,k.value.level=`branch`,k.value.nutIndex=0,Q()):k.value.level===`branch`&&(W.value=null,G.value=null,k.value.level=`root`,k.value.nutIndex=0,Q())}function hi(){k.value.level===`root`&&oi.value?(Mr(oi.value),O.value=`${ri(oi.value)} selected.`):k.value.level===`branch`&&X.value?(jr(X.value),O.value=`${ii(X.value)} selected.`):k.value.level===`nut`&&X.value&&si.value&&(Ar(X.value),O.value=`${ai(si.value)} details opened.`)}function gi(){Qn.value=!0,D.value=!1}function _i(){Qn.value=!1,D.value=!1,O.value=``,G.value||W.value||U.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(),Qn.value||=!0,o?(K(),$(),D.value=!1):((t||n||r||i)&&(D.value=!0),t?pi(-1):n?pi(1):r?mi(-1):i?mi(1):a&&hi()))}let yi=p(()=>({headers:Y.value.head,rows:Y.value.body.map(e=>[e.rootName,e.rootValue,c({v:e.rootToTotal*100,s:`%`,r:A.value.table.td.roundingPercentage}),e.branchName,e.branchValue,c({v:e.branchToRoot*100,s:`%`,r:A.value.table.td.roundingPercentage}),c({v:e.branchToTotal*100,s:`%`,r:A.value.table.td.roundingPercentage}),e.nutName,e.nutValue,c({v:e.nutToBranch*100,s:`%`,r:A.value.table.td.roundingPercentage}),c({v:e.nutToRoot*100,s:`%`,r:A.value.table.td.roundingPercentage}),c({v:e.nutToTotal*100,s:`%`,r:A.value.table.td.roundingPercentage})])}));return je({getData:_r,getImage:Hr,generatePdf:lr,generateCsv:Ir,generateImage:ur,generateSvg:ei,toggleTable:zr,toggleAnnotator:Vr,toggleFullscreen:Rr,copyAlt:ni}),(e,s)=>(y(),h(`div`,{class:_(`vue-data-ui-component vue-ui-chestnut ${Lr.value?`vue-data-ui-wrapper-fullscreen`:``}`),ref_key:`chestnutChart`,ref:Jn,id:`vue-ui-chestnut_${E.value}`,style:v(`font-family:${A.value.style.fontFamily};width:100%; text-align:center;background:${F.value.backgroundColor}`),onMouseenter:s[12]||=()=>w(rr)(!0),onMouseleave:s[13]||=()=>w(rr)(!1)},[g(`div`,{id:`chart-instructions-${E.value}`,class:`sr-only`},[g(`p`,null,C(A.value.a11y.translations.keyboardNavigation),1)],8,Xe),g(`div`,Ze,C(O.value),1),yi.value?.rows?.length?(y(),Me(ke,{key:0,uid:E.value,head:yi.value.headers,body:yi.value.rows,notice:A.value.a11y.translations.tableAvailable,caption:A.value.a11y.translations.tableCaption},null,8,[`uid`,`head`,`body`,`notice`,`caption`])):m(``,!0),A.value.userOptions.buttons.annotator?(y(),Me(w(Hn),Re({key:1},w(a)(A.value.userOptions.annotator),{svgRef:w(ar),backgroundColor:F.value.backgroundColor,color:F.value.color,active:Br.value,isCursorPointer:I.value,palette:A.value.userOptions.annotatorPalette,onClose:Vr}),Ne({_:2},[x(w(o),t=>({name:t,fn:Ke(n=>[S(e.$slots,t,Be(Le(w(i)(t,n))),void 0,!0)])}))]),1040,[`svgRef`,`backgroundColor`,`color`,`active`,`isCursorPointer`,`palette`])):m(``,!0),dr.value?(y(),h(`div`,Qe,null,512)):m(``,!0),A.value.userOptions.show&&qn.value&&(w(ir)||w(nr))?(y(),Me(w(Un),Re({ref_key:`userOptionsRef`,ref:Zn,key:`user_options_${Yn.value}`,backgroundColor:F.value.backgroundColor,color:F.value.color,isImaging:w(cr),isPrinting:w(sr),uid:E.value,isFullscreen:Lr.value,chartElement:Jn.value},w(n)(A.value.userOptions,`pdf csv img svg table fullscreen altCopy annotator`),{isAnnotation:Br.value,tableDialog:A.value.table.useDialog,isCursorPointer:I.value,onToggleFullscreen:Rr,onGeneratePdf:w(lr),onGenerateCsv:Ir,onGenerateImage:w(ti),onGenerateSvg:w(ei),onToggleTable:zr,onToggleAnnotator:Vr,onCopyAlt:ni,style:{visibility:w(ir)?w(nr)?`visible`:`hidden`:`visible`}}),Ne({_:2},[x(w(t)(e.$slots,`menuIcon optionPdf optionCsv optionImg optionSvg optionTable optionFullscreen optionAnnotator optionAltCopy custom-menu-before custom-menu-after`),t=>({name:t,fn:Ke(n=>[S(e.$slots,t,Be(Le(w(r)(t,n))),void 0,!0)])}))]),1040,[`backgroundColor`,`color`,`isImaging`,`isPrinting`,`uid`,`isFullscreen`,`chartElement`,`isAnnotation`,`tableDialog`,`isCursorPointer`,`onGeneratePdf`,`onGenerateImage`,`onGenerateSvg`,`style`])):m(``,!0),g(`div`,$e,[L.value.height>0?(y(),h(`svg`,{key:0,ref_key:`svgRef`,ref:ar,xmlns:w(pe),"aria-describedby":`chart-instructions-${E.value}`,class:_({"vue-data-ui-fullscreen--on":Lr.value,"vue-data-ui-fulscreen--off":!Lr.value}),viewBox:`0 0 ${L.value.width<=0?10:L.value.width} ${L.value.height<=0?10:L.value.height}`,style:v(`overflow:visible;background:transparent;color:${F.value.color}`),tabindex:`0`,onFocus:gi,onBlur:_i,onKeydown:vi},[Fe(w(Wn)),S(e.$slots,`svg-underlayer`,{svg:{...L.value,isPrintingImg:w(sr)||w(cr)||w(Qr),isPrintingSvg:w($r)}},void 0,!0),e.$slots[`chart-background`]?(y(),h(`foreignObject`,{key:0,x:0,y:0,width:L.value.width<=0?10:L.value.width,height:L.value.height<=0?10:L.value.height,style:{pointerEvents:`none`}},[S(e.$slots,`chart-background`,{},void 0,!0)],8,tt)):m(``,!0),U.value?m(``,!0):(y(),h(`g`,nt,[P.value.title.text?(y(),h(`text`,{key:0,"text-anchor":`middle`,fill:P.value.title.color,"font-weight":P.value.title.bold?`bold`:`normal`,"font-size":P.value.title.fontSize,x:L.value.width/2,y:12+P.value.title.fontSize+P.value.title.offsetY,onClick:s[0]||=()=>{K(),$(),D.value=!1}},C(P.value.title.text),9,rt)):m(``,!0),P.value.title.subtitle.text?(y(),h(`text`,{key:1,"text-anchor":`middle`,fill:P.value.title.subtitle.color,"font-weight":P.value.title.subtitle.bold?`bold`:`normal`,"font-size":P.value.title.subtitle.fontSize,x:L.value.width/2,y:48+P.value.title.subtitle.fontSize+P.value.title.subtitle.offsetY,onClick:s[1]||=()=>{K(),$(),D.value=!1}},C(P.value.title.subtitle.text),9,it)):m(``,!0)])),g(`defs`,null,[(y(!0),h(f,null,x(B.value,(e,t)=>(y(),Me(Ae,{t:`radial`,cx:`50%`,cy:`50%`,r:`50%`,fx:`50%`,fy:`50%`,id:`root_gradient_${E.value}_${e.rootIndex}`,key:`root_gradient_${E.value}_${e.rootIndex}`,stops:[[`0%`,w(u)(w(ae)(e.color,.05),100-j.value.gradientIntensity),1],[`100%`,e.color,1]]},null,8,[`id`,`stops`]))),128)),(y(!0),h(f,null,x(B.value,e=>(y(),Me(Ae,{t:`linear`,x1:`0%`,y1:`0%`,x2:`100%`,y2:`0%`,id:`branch_gradient_${E.value}_${e.rootIndex}`,key:`branch_gradient_${E.value}_${e.rootIndex}`,stops:[[`0%`,e.color,1],[`100%`,w(u)(w(ae)(e.color,.02),100-M.value.gradientIntensity),1]]},null,8,[`id`,`stops`]))),128)),Fe(Ae,{t:`radial`,cx:`50%`,cy:`50%`,r:`50%`,fx:`50%`,fy:`50%`,id:`nutpick_${E.value}`,stops:[[`0%`,w(u)(`#FFFFFF`,0),0],[`80%`,w(u)(`#FFFFFF`,N.value.selected.gradientIntensity),1],[`100%`,w(u)(`#FFFFFF`,0),0]]},null,8,[`id`,`stops`]),Fe(Ae,{t:`radial`,cx:`50%`,cy:`50%`,r:`50%`,fx:`50%`,fy:`50%`,id:`nut_${E.value}`,stops:[[`0%`,w(u)(`#FFFFFF`,0),0],[`80%`,w(u)(`#FFFFFF`,N.value.gradientIntensity),1],[`100%`,w(u)(`#FFFFFF`,0),0]]},null,8,[`id`,`stops`]),Fe(Ae,{t:`radial`,cx:`50%`,cy:`50%`,r:`50%`,fx:`50%`,fy:`50%`,id:`nut_underlayer_${E.value}`,stops:[[`0%`,w(u)(F.value.backgroundColor,100),1],[`80%`,w(u)(F.value.backgroundColor,60),1],[`100%`,w(u)(F.value.backgroundColor,0),1]]},null,8,[`id`,`stops`])]),P.value.grandTotal.show?(y(),h(`g`,at,[g(`text`,{x:R.value.seedX,y:32+P.value.grandTotal.offsetY,"font-size":P.value.grandTotal.fontSize,"font-weight":P.value.grandTotal.bold?`bold`:`normal`,fill:P.value.grandTotal.color,"text-anchor":`middle`,onClick:s[2]||=()=>{K(),$(),D.value=!1}},C(P.value.grandTotal.text),9,ot),g(`text`,{x:R.value.seedX,y:38+P.value.grandTotal.fontSize+P.value.grandTotal.offsetY,"font-size":P.value.grandTotal.fontSize,"font-weight":P.value.grandTotal.bold?`bold`:`normal`,fill:P.value.grandTotal.color,"text-anchor":`middle`,onClick:s[3]||=()=>{K(),$(),D.value=!1}},C(w(ce)(P.value.grandTotal.formatter,z.value,w(c)({p:P.value.grandTotal.prefix,v:z.value,s:P.value.grandTotal.suffix,r:P.value.grandTotal.roundingValue}))),9,st)])):m(``,!0),(y(!0),h(f,null,x(H.value,e=>(y(),h(`g`,null,[g(`defs`,null,[Fe(Ae,{t:`linear`,id:`link_grad_${e.id}`,stops:[[`0%`,e.color,1],[`100%`,w(u)(e.color,P.value.links.opacity),1]]},null,8,[`id`,`stops`])]),g(`path`,{d:Ur(e),stroke:w(u)(e.color,P.value.links.opacity),fill:`url(#link_grad_${e.id})`,"stroke-linecap":`round`,"stroke-linejoin":`round`,style:v(`opacity:${+!!q(e)}`),onClick:s[4]||=()=>{K(),$(),D.value=!1}},null,12,ct)]))),256)),(y(!0),h(f,null,x(V.value,e=>(y(),h(`circle`,{cx:e.x,cy:e.y,r:e.r,fill:j.value.underlayerColor,stroke:`none`,style:v(`cursor:${I.value?`pointer`:`default`}; opacity:${q(e)?1:.05}`)},null,12,lt))),256)),(y(!0),h(f,null,x(V.value,(e,t)=>(y(),h(`circle`,{"aria-label":ri(e),cx:e.x,cy:e.y,r:e.r,fill:j.value.useGradient?`url(#root_gradient_${E.value}_${e.rootIndex})`:e.color,stroke:j.value.stroke,"stroke-width":j.value.strokeWidth,style:v(`cursor:${I.value?`pointer`:`default`}; opacity:${q(e)?1:.05}`),onClick:t=>Mr(e)},null,12,ut))),256)),j.value.labels.show?(y(),h(`g`,dt,[(y(!0),h(f,null,x(V.value,(e,t)=>(y(),h(`text`,{x:e.x,y:e.y+j.value.labels.fontSize/2.6,"text-anchor":`middle`,"font-size":j.value.labels.fontSize,fill:j.value.labels.adaptColorToBackground?w(fe)(e.color):j.value.labels.color,"font-weight":`bold`,style:v(`cursor:${I.value?`pointer`:`default`}; opacity:${q(e)?1:.05}`),onClick:t=>Mr(e)},C(w(ce)(j.value.labels.formatter,e.total,w(c)({p:j.value.labels.prefix,v:e.total,s:j.value.labels.suffix,r:j.value.labels.roundingValue}),{datapoint:e})),13,ft))),256)),(y(!0),h(f,null,x(V.value,e=>(y(),h(`g`,null,[U.value&&e.rootIndex===U.value.rootIndex||W.value&&e.rootIndex===W.value.rootIndex||G.value&&e.rootIndex===G.value.rootIndex?(y(),h(`g`,pt,[g(`text`,{x:e.x,y:e.y+e.r+24,"text-anchor":`middle`,fill:j.value.labels.name.color,"font-size":j.value.labels.name.fontSize,"font-weight":j.value.labels.name.bold?`bold`:`normal`,onClick:s[5]||=()=>{K(),$(),D.value=!1}},C(e.name),9,mt)])):m(``,!0)]))),256))])):m(``,!0),(y(!0),h(f,null,x(H.value,e=>(y(),h(`rect`,{x:e.x1,y:e.y1,height:L.value.branchSize,width:e.x2-e.x1,fill:M.value.underlayerColor,rx:M.value.borderRadius,stroke:`none`,style:v(`opacity:${q(e)?1:.05}`),onClick:t=>jr(e)},null,12,ht))),256)),(y(!0),h(f,null,x(H.value,(e,t)=>(y(),h(`rect`,{"aria-label":ii(e),x:e.x1,y:e.y1,height:L.value.branchSize,width:e.x2-e.x1,fill:M.value.useGradient?`url(#branch_gradient_${E.value}_${e.rootIndex})`:e.color,rx:M.value.borderRadius,stroke:M.value.stroke,"stroke-width":M.value.strokeWidth,style:v(`cursor:${I.value?`pointer`:`default`}; opacity:${q(e)?1:.05}`),onClick:t=>jr(e)},null,12,gt))),256)),M.value.labels.dataLabels.show?(y(),h(`g`,_t,[(y(!0),h(f,null,x(H.value,e=>(y(),h(`g`,null,[e.proportionToRoot*100>M.value.labels.dataLabels.hideUnderValue?(y(),h(`text`,{key:0,x:e.x1+6,y:e.y1+L.value.branchSize/1.5,"text-anchor":`start`,fill:w(fe)(e.color),"font-size":M.value.labels.dataLabels.fontSize,"font-weight":`bold`,style:v(`cursor:${I.value?`pointer`:`default`}; opacity:${q(e)?1:.05}`),onClick:t=>jr(e)},C(w(ce)(M.value.labels.dataLabels.formatter,e.value,w(c)({p:P.value.branches.labels.dataLabels.prefix,v:e.value,s:P.value.branches.labels.dataLabels.suffix,r:P.value.branches.labels.dataLabels.roundingValue}),{datapoint:e})),13,vt)):m(``,!0)]))),256))])):m(``,!0),(y(!0),h(f,null,x(H.value,(e,t)=>(y(),h(`g`,null,[(y(!0),h(f,null,x(w(ne)({series:e.breakdown,base:1},e.x2+24+N.value.offsetX,e.y1+L.value.branchSize/2,L.value.branchSize/3,L.value.branchSize/3),(t,n)=>(y(),h(`path`,{d:t.path,stroke:t.color,"stroke-width":10,fill:`none`,style:v(`opacity:${q(e)?1:.1}`)},null,12,yt))),256)),g(`circle`,{"aria-label":`Open details for branch ${e.name} in root ${e.rootName}`,fill:N.value.useGradient?`url(#nut_${E.value})`:`transparent`,cx:e.x2+24+N.value.offsetX,cy:e.y1+L.value.branchSize/2,r:L.value.branchSize/2+2,onClick:t=>Ar(e),style:v(`cursor:${I.value?`pointer`:`default`};opacity:${q(e)?1:.1}`)},null,12,bt)]))),256)),M.value.labels.show&&!W.value?(y(),h(`g`,xt,[(y(!0),h(f,null,x(H.value,e=>(y(),h(`text`,{x:e.x2+L.value.branchSize+24+N.value.offsetX,y:e.y1+L.value.branchSize/2+5,"font-size":M.value.labels.fontSize,"font-weight":M.value.labels.bold?`bold`:`normal`,fill:M.value.labels.color,"text-anchor":`start`,style:v(`opacity:${q(e)?1:.1}`)},C(e.name),13,St))),256))])):m(``,!0),g(`line`,{x1:256+L.value.padding.left,x2:256+L.value.padding.left,y1:R.value.top,y2:R.value.bottom,stroke:P.value.verticalSeparator.stroke,"stroke-width":P.value.verticalSeparator.strokeWidth},null,8,Ct),!U.value&&!W.value?(y(),h(`foreignObject`,{key:6,x:0,y:R.value.bottom,height:L.value.height-R.value.bottom,width:L.value.width,style:{overflow:`visible`},"data-no-svg-export":``,onClick:s[6]||=()=>{K(),$(),D.value=!1}},[g(`div`,Tt,[g(`div`,Et,[(y(!0),h(f,null,x(V.value,e=>(y(),h(`div`,{style:v(`display:flex;align-items:center;gap:3px;flex-direction:row;font-size:${P.value.legend.fontSize}px;`)},[(y(),h(`svg`,Dt,[g(`circle`,{cx:`10`,cy:`10`,r:`10`,fill:e.color,stroke:`none`},null,8,Ot)])),w(er)?m(``,!0):(y(),h(f,{key:0},[g(`span`,null,C(e.name)+`:`,1),g(`b`,null,C(w(ce)(P.value.roots.labels.formatter,e.total,w(c)({p:F.value.layout.legend.prefix,v:e.total,s:F.value.layout.legend.suffix,r:F.value.layout.legend.roundingValue}),{datapoint:e})),1),Pe(` (`+C(w(c)({v:e.total/z.value*100,s:`%`,r:P.value.legend.roundingPercentage}))+`) `,1)],64))],4))),256))])])],8,wt)):m(``,!0),U.value&&kr.value?(y(),h(`g`,kt,[(y(),h(`foreignObject`,{x:0,y:Nr(),height:L.value.height-R.value.bottom,width:L.value.width,style:{overflow:`visible`},onClick:s[7]||=()=>{K(),$(),D.value=!1}},[g(`div`,jt,[g(`b`,null,C(U.value.name),1),g(`div`,Mt,[(y(!0),h(f,null,x(U.value.breakdown,(e,t)=>(y(),h(`div`,{style:v(`display:flex;align-items:center;gap:6px;flex-direction:row;font-size:${P.value.legend.fontSize}px;`)},[(y(),h(`svg`,Nt,[g(`circle`,{cx:`10`,cy:`10`,r:`10`,fill:e.color,stroke:`none`},null,8,Pt)])),g(`span`,null,[Pe(C(e.name)+`: `,1),g(`b`,null,C(P.value.legend.prefix)+` `+C(e.value.toFixed(F.value.layout.nuts.selected.labels.roundingValue))+` `+C(P.value.legend.suffix),1),Pe(` (`+C((e.proportionToBranch*100).toFixed(P.value.nuts.selected.labels.roundingPercentage))+`%)`,1)])],4))),256))])])],8,At)),g(`circle`,{cx:U.value.x2+24+N.value.offsetX,cy:U.value.y1+L.value.branchSize/2,r:256,fill:`url(#nut_underlayer_${E.value})`,onClick:J,class:_(N.value.selected.useMotion?`vue-ui-chestnut-animated`:``)},null,10,Ft),(y(!0),h(f,null,x(kr.value,e=>(y(),h(`g`,null,[Pr(e)?(y(),h(`path`,{key:0,d:w(se)(e,{x:U.value.x2+24+N.value.offsetX,y:U.value.y1+L.value.branchSize/2},16,16,!1,!1,64),stroke:e.color,"stroke-width":`1`,"stroke-linecap":`round`,"stroke-linejoin":`round`,fill:`none`,class:_(N.value.selected.useMotion?`vue-ui-chestnut-animated`:``)},null,10,It)):m(``,!0)]))),256)),g(`circle`,{cx:U.value.x2+24+N.value.offsetX,cy:U.value.y1+L.value.branchSize/2,r:118,fill:F.value.backgroundColor,onClick:J,class:_(N.value.selected.useMotion?`vue-ui-chestnut-animated`:``)},null,10,Lt),(y(!0),h(f,null,x(kr.value,e=>(y(),h(`path`,{d:e.path,stroke:e.color,"stroke-width":64,fill:`none`,onClick:J,class:_(N.value.selected.useMotion?`vue-ui-chestnut-animated`:``)},null,10,Rt))),256)),g(`circle`,{cx:U.value.x2+24+N.value.offsetX,cy:U.value.y1+L.value.branchSize/2,r:110,fill:`url(#nutpick_${E.value})`,onClick:J,class:_(N.value.selected.useMotion?`vue-ui-chestnut-animated`:``)},null,10,zt),g(`circle`,{cx:U.value.x2+24+N.value.offsetX,cy:U.value.y1+L.value.branchSize/2,r:64,fill:F.value.backgroundColor,onClick:J,class:_(N.value.selected.useMotion?`vue-ui-chestnut-animated`:``)},null,10,Bt),g(`text`,{x:U.value.x2+24+N.value.offsetX,y:U.value.y1+8,fill:N.value.selected.labels.core.total.color,"font-size":N.value.selected.labels.core.total.fontSize,"font-weight":N.value.selected.labels.core.total.bold?`bold`:`normal`,"text-anchor":`middle`,onClick:J,class:_(N.value.selected.useMotion?`vue-ui-chestnut-animated`:``)},C(A.value.translations.total),11,Vt),g(`text`,{x:U.value.x2+24+N.value.offsetX,y:U.value.y1+36,fill:N.value.selected.labels.core.value.color,"font-size":N.value.selected.labels.core.value.fontSize,"font-weight":N.value.selected.labels.core.value.bold?`bold`:`normal`,"text-anchor":`middle`,onClick:J,class:_(N.value.selected.useMotion?`vue-ui-chestnut-animated`:``)},C(w(ce)(N.value.selected.labels.dataLabels.formatter,U.value.value,w(c)({p:N.value.selected.labels.core.value.prefix,v:U.value.value,s:N.value.selected.labels.core.value.suffix,r:N.value.selected.roundingValue}),{datapoint:U.value})),11,Ht),(y(!0),h(f,null,x(kr.value,(e,t)=>(y(),h(`g`,null,[Pr(e)?(y(),h(`text`,{key:0,x:w(d)(e).x,"text-anchor":w(d)(e).anchor,y:w(de)(e)-N.value.selected.labels.dataLabels.fontSize/6,fill:e.color,"font-size":N.value.selected.labels.dataLabels.fontSize/2,style:v(`font-weight:${N.value.selected.labels.dataLabels.bold?`bold`:``}`),class:_(N.value.selected.useMotion?`vue-ui-chestnut-animated`:``)},` ⬤ `,14,Ut)):m(``,!0),Pr(e)?(y(),h(`text`,{key:1,x:w(d)(e,!0).x,"text-anchor":w(d)(e,!0).anchor,y:w(de)(e),fill:N.value.selected.labels.dataLabels.color,"font-size":N.value.selected.labels.dataLabels.fontSize,style:v(`font-weight:${N.value.selected.labels.dataLabels.bold?`bold`:``}`),class:_(N.value.selected.useMotion?`vue-ui-chestnut-animated`:``)},C(U.value.breakdown[t].name),15,Wt)):m(``,!0)]))),256)),(y(!0),h(f,null,x(kr.value,(e,t)=>(y(),h(`g`,null,[Pr(e)?(y(),h(`text`,{key:0,x:w(d)(e,!0).x,"text-anchor":w(d)(e).anchor,y:w(de)(e)+N.value.selected.labels.dataLabels.fontSize,fill:N.value.selected.labels.dataLabels.color,"font-size":N.value.selected.labels.dataLabels.fontSize,style:v(`font-weight:${N.value.selected.labels.dataLabels.bold?`bold`:``}`),class:_(N.value.selected.useMotion?`vue-ui-chestnut-animated`:``)},C(w(c)({v:U.value.breakdown[t].value/U.value.value*100,s:`%`,r:N.value.selected.labels.roundingPercentage}))+` `+C(A.value.translations.of)+` `+C(U.value.breakdown[t].branchName)+` `+C(w(ce)(N.value.selected.labels.dataLabels.formatter,U.value.breakdown[t].value,w(c)({p:N.value.selected.labels.dataLabels.prefix,v:U.value.breakdown[t].value,s:N.value.selected.labels.dataLabels.suffix,r:N.value.selected.roundingValue}),{datapoint:kr.value,seriesIndex:t})),15,Gt)):m(``,!0),Pr(e)?(y(),h(`text`,{key:1,x:w(d)(e,!0).x,"text-anchor":w(d)(e).anchor,y:w(de)(e)+N.value.selected.labels.dataLabels.fontSize*2,fill:N.value.selected.labels.dataLabels.color,"font-size":N.value.selected.labels.dataLabels.fontSize,style:v(`font-weight:${N.value.selected.labels.dataLabels.bold?`bold`:``}`),class:_(N.value.selected.useMotion?`vue-ui-chestnut-animated`:``)},C(w(c)({v:U.value.breakdown[t].proportionToRoot*100,s:`%`,r:N.value.selected.labels.roundingPercentage}))+` `+C(A.value.translations.of)+` `+C(U.value.breakdown[t].rootName),15,Kt)):m(``,!0),Pr(e)?(y(),h(`text`,{key:2,x:w(d)(e,!0).x,"text-anchor":w(d)(e).anchor,y:w(de)(e)+N.value.selected.labels.dataLabels.fontSize*3,fill:N.value.selected.labels.dataLabels.color,"font-size":N.value.selected.labels.dataLabels.fontSize,style:v(`font-weight:${N.value.selected.labels.dataLabels.bold?`bold`:``}`),class:_(N.value.selected.useMotion?`vue-ui-chestnut-animated`:``)},C(w(c)({v:U.value.breakdown[t].proportionToTree*100,s:`%`,r:N.value.selected.labels.roundingPercentage}))+` `+C(A.value.translations.proportionToTree),15,qt)):m(``,!0)]))),256))])):m(``,!0),(y(!0),h(f,null,x(H.value,e=>(y(),h(`g`,null,[W.value&&W.value.id===e.id&&!U.value?(y(),h(`text`,{key:0,x:e.x1+6,y:e.y1+L.value.branchSize+24,"font-weight":`bold`,"text-anchor":`start`,"font-size":M.value.labels.dataLabels.fontSize,fill:M.value.labels.color,onClick:s[8]||=()=>{K(),$(),D.value=!1}},C(e.name)+`: `+C(w(ce)(M.value.labels.dataLabels.formatter,e.value,w(c)({p:M.value.labels.dataLabels.prefix,v:e.value,s:M.value.labels.dataLabels.suffix,r:M.value.labels.dataLabels.roundingValue}),{datapoint:e})),9,Jt)):m(``,!0),W.value&&W.value.id===e.id&&!U.value?(y(),h(`text`,{key:1,x:e.x1+6,y:e.y1+L.value.branchSize+48,"text-anchor":`start`,"font-size":M.value.labels.dataLabels.fontSize,fill:M.value.labels.color,onClick:s[9]||=()=>{K(),$(),D.value=!1}},C(w(c)({v:e.proportionToRoot*100,s:`%`,r:M.value.labels.dataLabels.roundingPercentage}))+` `+C(A.value.translations.of)+` `+C(e.rootName),9,Yt)):m(``,!0),W.value&&W.value.id===e.id&&!U.value?(y(),h(`text`,{key:2,x:e.x1+6,y:e.y1+L.value.branchSize+72,"text-anchor":`start`,"font-size":M.value.labels.dataLabels.fontSize,fill:M.value.labels.color,onClick:s[10]||=()=>{K(),$(),D.value=!1}},C(w(c)({v:e.value/z.value*100,s:`%`,r:M.value.labels.dataLabels.roundingPercentage}))+` `+C(A.value.translations.proportionToTree),9,Xt)):m(``,!0)]))),256)),S(e.$slots,`svg`,{svg:{...L.value,isPrintingImg:w(sr)||w(cr)||w(Qr),isPrintingSvg:w($r)}},void 0,!0)],46,et)):m(``,!0)]),e.$slots.watermark?(y(),h(`div`,Zt,[S(e.$slots,`watermark`,Be(Le({isPrinting:w(sr)||w(cr)||w(Qr)||w($r)})),void 0,!0)])):m(``,!0),S(e.$slots,`legend`,{legend:B.value},void 0,!0),e.$slots.source?(y(),h(`div`,Qt,[S(e.$slots,`source`,{},void 0,!0)],512)):m(``,!0),qn.value&&A.value.userOptions.buttons.table?(y(),Me(He(Wr.value.component),Re({key:6},Wr.value.props,{ref_key:`tableUnit`,ref:Xn,onClose:Kr}),Ne({content:Ke(()=>[g(`div`,{ref_key:`tableContainer`,ref:mr,class:`vue-ui-chestnut-table`,style:v(`${A.value.table.useDialog?``:`max-height: 300px;margin-top:24px`}`)},[g(`div`,{style:v(`${A.value.table.useDialog?``:`padding-top:36px;`}position: relative`)},[A.value.table.useDialog?m(``,!0):(y(),h(`div`,{key:0,role:`button`,tabindex:`0`,style:v(`width:32px; position: absolute; top: 0; left:4px; padding: 0 0px; display: flex; align-items:center;justify-content:center;height: 36px; width: 32px; cursor:${I.value?`pointer`:`default`}; background:${A.value.table.th.backgroundColor};`),onClick:Kr,onKeypress:qe(Kr,[`enter`])},[Fe(w(Bn),{name:`close`,stroke:A.value.table.th.color,"stroke-width":2},null,8,[`stroke`])],36)),g(`div`,{style:{width:`100%`},class:_({"vue-ui-responsive":w(Gr)})},[g(`table`,$t,[A.value.table.useDialog?m(``,!0):(y(),h(`caption`,{key:0,style:v({backgroundColor:A.value.table.th.backgroundColor,color:A.value.table.th.color,outline:A.value.table.th.outline}),class:`vue-ui-data-table__caption`},[Pe(C(P.value.title.text)+` `,1),P.value.title.subtitle.text?(y(),h(`span`,en,C(P.value.title.subtitle.text),1)):m(``,!0)],4)),g(`thead`,null,[g(`tr`,{role:`row`,style:v(`background:${A.value.table.th.backgroundColor};color:${A.value.table.th.color}`)},[(y(!0),h(f,null,x(Y.value.head,e=>(y(),h(`th`,{style:v(`outline:${A.value.table.th.outline}`)},C(e),5))),256))],4)]),g(`tbody`,null,[(y(!0),h(f,null,x(Y.value.body,(e,t)=>(y(),h(`tr`,{class:_({"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:v(`background:${A.value.table.td.backgroundColor};color:${A.value.table.td.color}`)},[g(`td`,{class:`vue-ui-data-table__tbody__td`,style:v(`outline:${A.value.table.td.outline}`),"data-cell":Y.value.head[0]},[g(`div`,nn,[Y.value.body[t-1]&&Y.value.body[t-1].rootName===e.rootName?(y(),h(`span`,rn)):(y(),h(`span`,an,C(e.rootName),1))])],12,tn),g(`td`,{class:`vue-ui-data-table__tbody__td`,style:v(`outline:${A.value.table.td.outline}`),"data-cell":Y.value.head[1]},[g(`div`,sn,[Y.value.body[t-1]&&Y.value.body[t-1].rootName===e.rootName?(y(),h(`span`,cn)):(y(),h(`span`,ln,C(e.rootValue.toFixed(A.value.table.td.roundingValue)),1))])],12,on),g(`td`,{class:`vue-ui-data-table__tbody__td`,style:v(`outline:${A.value.table.td.outline}`),"data-cell":Y.value.head[2]},[g(`div`,dn,[Y.value.body[t-1]&&Y.value.body[t-1].rootName===e.rootName?(y(),h(`span`,fn)):(y(),h(`span`,pn,C((e.rootToTotal*100).toFixed(A.value.table.td.roundingPercentage))+`% `,1))])],12,un),g(`td`,{class:`vue-ui-data-table__tbody__td`,style:v(`outline:${A.value.table.td.outline}`),"data-cell":Y.value.head[3]},[g(`div`,hn,[Y.value.body[t-1]&&Y.value.body[t-1].branchName===e.branchName?(y(),h(`span`,gn)):(y(),h(`span`,_n,C(e.branchName),1))])],12,mn),g(`td`,{class:`vue-ui-data-table__tbody__td`,style:v(`outline:${A.value.table.td.outline}`),"data-cell":Y.value.head[4]},[g(`div`,yn,[Y.value.body[t-1]&&Y.value.body[t-1].branchName===e.branchName?(y(),h(`span`,bn)):(y(),h(`span`,xn,C(e.branchValue.toFixed(A.value.table.td.roundingValue)),1))])],12,vn),g(`td`,{class:`vue-ui-data-table__tbody__td`,style:v(`outline:${A.value.table.td.outline}`),"data-cell":Y.value.head[5]},[g(`div`,Cn,[Y.value.body[t-1]&&Y.value.body[t-1].branchName===e.branchName?(y(),h(`span`,wn)):(y(),h(`span`,Tn,C((e.branchToRoot*100).toFixed(A.value.table.td.roundingPercentage))+`% `,1))])],12,Sn),g(`td`,{class:`vue-ui-data-table__tbody__td`,style:v(`outline:${A.value.table.td.outline}`),"data-cell":Y.value.head[6]},[g(`div`,Dn,[Y.value.body[t-1]&&Y.value.body[t-1].branchName===e.branchName?(y(),h(`span`,On)):(y(),h(`span`,kn,C((e.branchToTotal*100).toFixed(A.value.table.td.roundingPercentage))+`% `,1))])],12,En),g(`td`,{class:`vue-ui-data-table__tbody__td`,style:v(`outline:${A.value.table.td.outline}`),"data-cell":Y.value.head[7]},[g(`div`,jn,C(e.nutName),1)],12,An),g(`td`,{class:`vue-ui-data-table__tbody__td`,style:v(`outline:${A.value.table.td.outline}`),"data-cell":Y.value.head[8]},[g(`div`,Nn,C(e.nutValue.toFixed(A.value.table.td.roundingValue)),1)],12,Mn),g(`td`,{class:`vue-ui-data-table__tbody__td`,style:v(`outline:${A.value.table.td.outline}`),"data-cell":Y.value.head[9]},[g(`div`,Fn,C((e.nutToBranch*100).toFixed(A.value.table.td.roundingPercentage))+`% `,1)],12,Pn),g(`td`,{class:`vue-ui-data-table__tbody__td`,style:v(`outline:${A.value.table.td.outline}`),"data-cell":Y.value.head[10]},[g(`div`,Ln,C((e.nutToRoot*100).toFixed(A.value.table.td.roundingPercentage))+`% `,1)],12,In),g(`td`,{class:`vue-ui-data-table__tbody__td`,style:v(`outline:${A.value.table.td.outline}`),"data-cell":Y.value.head[11]},[g(`div`,zn,C((e.nutToTotal*100).toFixed(A.value.table.td.roundingPercentage))+`% `,1)],12,Rn)],6))),256))])])],2)],4)],4)]),_:2},[A.value.table.useDialog?{name:`title`,fn:Ke(()=>[Pe(C(Wr.value.title),1)]),key:`0`}:void 0,A.value.table.useDialog?{name:`actions`,fn:Ke(()=>[g(`button`,{tabindex:`0`,class:`vue-ui-user-options-button`,onClick:s[11]||=e=>Ir(A.value.userOptions.callbacks.csv)},[Fe(w(Bn),{name:`fileCsv`,stroke:Wr.value.props.color},null,8,[`stroke`])])]),key:`1`}:void 0]),1040)):m(``,!0),S(e.$slots,`skeleton`,{},()=>[w(er)?(y(),Me(xe,{key:0})):m(``,!0)],!0)],46,Ye))}},[[`__scopeId`,`data-v-41623f2b`]]);export{Je as n,Bn as t};
|
|
1
|
+
import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{n as t,r as n,t as r}from"./userOptionsSlots-CWtXN5Q6.js";import{n as i,r as a,t as o}from"./annotationSlots-OLiW25XN.js";import{t as s}from"./tableIntegration-CNoJ1CIY.js";import{n as ee}from"./resolveChartConfig-0IvbmIE_.js";import{$ as c,D as te,Ht as l,It as ne,Jt as u,S as re,X as ie,Yt as ae,at as oe,f as d,h as se,i as ce,in as le,nt as ue,p as de,r as fe,t as pe,w as me,yt as he,zt as ge}from"./lib-rPeBMZrn.js";import{n as _e,t as ve}from"./useHints-C-TwxM0Y.js";import{t as ye}from"./useConfig-_JwRfIqE.js";import{n as be,t as xe}from"./BaseScanner-8NdoBs7B.js";import{t as Se}from"./usePrinter-DVf3YcG5.js";import{t as Ce}from"./useChartExport-BZts4KFb.js";import{t as we}from"./useTableResponsive-uSz_qZOB.js";import{t as Te}from"./useUserOptionState-CXlFnwPv.js";import{t as Ee}from"./useChartAccessibility-DOMuYJfm.js";import{t as De}from"./img-D4RQwASc.js";import{t as Oe}from"./vue_ui_chestnut-BKcntsvv.js";import{t as ke}from"./A11yDataTable-DWNlWXzs.js";import{t as Ae}from"./DefGrad-DKMq1REY.js";import{t as je}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{Fragment as f,computed as p,createBlock as Me,createCommentVNode as m,createElementBlock as h,createElementVNode as g,createSlots as Ne,createTextVNode as Pe,createVNode as Fe,defineAsyncComponent as Ie,guardReactiveProps as Le,mergeProps as Re,nextTick as ze,normalizeClass as _,normalizeProps as Be,normalizeStyle as v,onMounted as Ve,openBlock as y,ref as b,renderList as x,renderSlot as S,resolveDynamicComponent as He,toDisplayString as C,toRefs as Ue,unref as w,useCssVars as We,watch as Ge,withCtx as Ke,withKeys as qe}from"vue";var Je=/* @__PURE__ */ e({default:()=>Bn}),Ye=[`id`],Xe=[`id`],Ze={"aria-live":`polite`,class:`sr-only`},Qe={key:2,ref:`noTitle`,class:`vue-data-ui-no-title-space`,style:`height:36px; width: 100%;background:transparent`},$e={style:{position:`relative`}},et=[`xmlns`,`aria-describedby`,`viewBox`],tt=[`width`,`height`],nt={key:1},rt=[`fill`,`font-weight`,`font-size`,`x`,`y`],it=[`fill`,`font-weight`,`font-size`,`x`,`y`],at={key:2},ot=[`x`,`y`,`font-size`,`font-weight`,`fill`],st=[`x`,`y`,`font-size`,`font-weight`,`fill`],ct=[`d`,`stroke`,`fill`],lt=[`cx`,`cy`,`r`,`fill`],ut=[`aria-label`,`cx`,`cy`,`r`,`fill`,`stroke`,`stroke-width`,`onClick`],dt={key:3},ft=[`x`,`y`,`font-size`,`fill`,`onClick`],pt={key:0},mt=[`x`,`y`,`fill`,`font-size`,`font-weight`],ht=[`x`,`y`,`height`,`width`,`fill`,`rx`,`onClick`],gt=[`aria-label`,`x`,`y`,`height`,`width`,`fill`,`rx`,`stroke`,`stroke-width`,`onClick`],_t={key:4},vt=[`x`,`y`,`fill`,`font-size`,`onClick`],yt=[`d`,`stroke`],bt=[`aria-label`,`fill`,`cx`,`cy`,`r`,`onClick`],xt={key:5},St=[`x`,`y`,`font-size`,`font-weight`,`fill`],Ct=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`],wt=[`y`,`height`,`width`],Tt={style:{width:`100%`,height:`100%`,display:`flex`,"align-items":`center`,"justify-content":`center`,"flex-direction":`column`}},Et={style:{display:`flex`,"align-items":`center`,"justify-content":`center`,gap:`12px`,"flex-wrap":`wrap`,"flex-direction":`row`}},Dt={viewBox:`0 0 20 20`,height:`16`,width:`16`},Ot=[`fill`],kt={key:7},At=[`y`,`height`,`width`],jt={style:{width:`100%`,height:`100%`,display:`flex`,"align-items":`center`,"justify-content":`center`,"flex-direction":`column`}},Mt={style:{display:`flex`,"align-items":`center`,"justify-content":`center`,gap:`12px`,"flex-wrap":`wrap`,"flex-direction":`row`}},Nt={viewBox:`0 0 20 20`,height:`16`,width:`16`},Pt=[`fill`],Ft=[`cx`,`cy`,`fill`],It=[`d`,`stroke`],Lt=[`cx`,`cy`,`fill`],Rt=[`d`,`stroke`],zt=[`cx`,`cy`,`fill`],Bt=[`cx`,`cy`,`fill`],Vt=[`x`,`y`,`fill`,`font-size`,`font-weight`],Ht=[`x`,`y`,`fill`,`font-size`,`font-weight`],Ut=[`x`,`text-anchor`,`y`,`fill`,`font-size`],Wt=[`x`,`text-anchor`,`y`,`fill`,`font-size`],Gt=[`x`,`text-anchor`,`y`,`fill`,`font-size`],Kt=[`x`,`text-anchor`,`y`,`fill`,`font-size`],qt=[`x`,`text-anchor`,`y`,`fill`,`font-size`],Jt=[`x`,`y`,`font-size`,`fill`],Yt=[`x`,`y`,`font-size`,`fill`],Xt=[`x`,`y`,`font-size`,`fill`],Zt={key:4,class:`vue-data-ui-watermark`},Qt={key:5,ref:`source`,dir:`auto`},$t={class:`vue-ui-data-table`},en={key:0},tn=[`data-cell`],nn={style:{display:`flex`,"align-items":`center`,gap:`5px`,"justify-content":`flex-end`,width:`100%`,"padding-right":`3px`}},rn={key:0},an={key:1},on=[`data-cell`],sn={style:{display:`flex`,"align-items":`center`,gap:`5px`,"justify-content":`flex-end`,width:`100%`,"padding-right":`3px`}},cn={key:0},ln={key:1},un=[`data-cell`],dn={style:{display:`flex`,"align-items":`center`,gap:`5px`,"justify-content":`flex-end`,width:`100%`,"padding-right":`3px`}},fn={key:0},pn={key:1},mn=[`data-cell`],hn={style:{display:`flex`,"align-items":`center`,gap:`5px`,"justify-content":`flex-end`,width:`100%`,"padding-right":`3px`}},gn={key:0},_n={key:1},vn=[`data-cell`],yn={style:{display:`flex`,"align-items":`center`,gap:`5px`,"justify-content":`flex-end`,width:`100%`,"padding-right":`3px`}},bn={key:0},xn={key:1},Sn=[`data-cell`],Cn={style:{display:`flex`,"align-items":`center`,gap:`5px`,"justify-content":`flex-end`,width:`100%`,"padding-right":`3px`}},wn={key:0},Tn={key:1},En=[`data-cell`],Dn={style:{display:`flex`,"align-items":`center`,gap:`5px`,"justify-content":`flex-end`,width:`100%`,"padding-right":`3px`}},On={key:0},kn={key:1},An=[`data-cell`],jn={style:{display:`flex`,"align-items":`center`,gap:`5px`,"justify-content":`flex-end`,width:`100%`,"padding-right":`3px`}},Mn=[`data-cell`],Nn={style:{display:`flex`,"align-items":`center`,gap:`5px`,"justify-content":`flex-end`,width:`100%`,"padding-right":`3px`}},Pn=[`data-cell`],Fn={style:{display:`flex`,"align-items":`center`,gap:`5px`,"justify-content":`flex-end`,width:`100%`,"padding-right":`3px`}},In=[`data-cell`],Ln={style:{display:`flex`,"align-items":`center`,gap:`5px`,"justify-content":`flex-end`,width:`100%`,"padding-right":`3px`}},Rn=[`data-cell`],zn={style:{display:`flex`,"align-items":`center`,gap:`5px`,"justify-content":`flex-end`,width:`100%`,"padding-right":`3px`}},Bn=/*#__PURE__*/ je({__name:`vue-ui-chestnut`,props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:[`selectRoot`,`selectBranch`,`selectNut`,`copyAlt`],setup(e,{expose:je,emit:Je}){We(e=>({v45e1a30d:e.tdo}));let Bn=Ie(()=>import(`./BaseIcon-CoY0vuL3.js`).then(e=>e.n)),Vn=Ie(()=>import(`./vue-ui-accordion-DxGxf-Rm.js`).then(e=>e.n)),Hn=Ie(()=>import(`./PenAndPaper-BV5ODysA.js`).then(e=>e.t)),Un=Ie(()=>import(`./UserOptions-K1N7zQRx.js`).then(e=>e.n)),Wn=Ie(()=>import(`./PackageVersion-PdpqwkYX.js`).then(e=>e.t)),Gn=Ie(()=>import(`./BaseDraggableDialog-DVstuNhT.js`).then(e=>e.n)),{vue_ui_chestnut:Kn}=ye(),T=e,qn=p(()=>!!T.dataset&&T.dataset.length),E=b(ie()),Jn=b(null),Yn=b(0),Xn=b(null),Zn=b(null),Qn=b(!1),D=b(!1),O=b(``),k=b({level:`root`,rootIndex:0,branchIndex:0,nutIndex:0,locked:!1}),A=b(or()),j=p(()=>A.value.style.chart.layout.roots),M=p(()=>A.value.style.chart.layout.branches),N=p(()=>A.value.style.chart.layout.nuts),P=p(()=>A.value.style.chart.layout),F=p(()=>A.value.style.chart);_e({config:()=>A.value,dataset:()=>T.dataset,component:`VueUiChestnut`,rules:[ve.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 I=p(()=>A.value.userOptions.useCursorPointer),$n=p(()=>le({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:A.value.skeletonConfig??{}})),{loading:er,FINAL_DATASET:tr}=be({...Ue(T),FINAL_CONFIG:A,prepareConfig:or,skeletonDataset:T.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:le({defaultConfig:A.value,userConfig:$n.value})}),{userOptionsVisible:nr,setUserOptionsVisibility:rr,keepUserOptionState:ir}=Te({config:A.value}),{svgRef:ar}=Ee({config:P.value.title});function or(){return ee(T.config,Kn,Oe)}Ge(()=>T.config,e=>{A.value=or(),nr.value=!A.value.userOptions.showOnChartHover,pr.value.showTable=A.value.table.show,Fr()},{deep:!0});let{isPrinting:sr,isImaging:cr,generatePdf:lr,generateImage:ur}=Se({elementId:`vue-ui-chestnut_${E.value}`,fileName:P.value.title.text||`vue-ui-chestnut`,options:A.value.userOptions.print}),dr=p(()=>A.value.userOptions.show),fr=p(()=>me(A.value.customPalette)),pr=b({showTable:A.value.table.show});Ge(A,()=>{pr.value={showTable:A.value.table.show}},{immediate:!0});let mr=b(null),hr=p(()=>A.value.table.responsiveBreakpoint),L=b({gap:6,padding:{top:102,left:12,right:12,bottom:96},width:1024,height:0,branchSize:32,branchStart:128}),R=p(()=>({left:L.value.padding.left,top:L.value.padding.top,right:L.value.width-L.value.padding.right,bottom:L.value.height-L.value.padding.bottom,width:L.value.width-(L.value.padding.left+L.value.padding.right),height:L.value.height-(L.value.padding.top+L.value.padding.bottom),seedX:L.value.padding.left+64})),z=p(()=>tr.value.flatMap(e=>(e.branches||[]).map(e=>e.value||0)).reduce((e,t)=>e+t,0)),gr=p(()=>A.value.debug),B=p(()=>(gr.value&&tr.value.forEach((e,t)=>{he({datasetObject:e,requiredAttributes:[`name`,`branches`]}).forEach(e=>{oe({componentName:`VueUiChestnut`,type:`datasetSerieAttribute`,property:e,index:t})}),e.branches&&e.branches.forEach((e,n)=>{he({datasetObject:e,requiredAttributes:[`name`,`value`]}).forEach(e=>{oe({componentName:`VueUiChestnut`,type:`datasetSerieAttribute`,property:e,index:`${t} - ${n}`})}),e.breakdown&&e.breakdown.forEach((e,r)=>{he({datasetObject:e,requiredAttributes:[`name`,`value`]}).forEach(e=>{oe({componentName:`VueUiChestnut`,type:`datasetSerieAttribute`,property:e,index:`${t} - ${n} - ${r}`})})})})}),tr.value.map((e,t)=>{let n=(e.branches||[]).map(e=>e.value||0).reduce((e,t)=>e+t,0);return{...e,color:re(e.color)||fr.value[t]||l[t]||l[t%l.length],id:e.id||`root_${t}_${E.value}`,type:`root`,total:n,rootIndex:t,branches:(e.branches||[]).map((r,i)=>({...r,rootName:e.name,rootIndex:t,color:re(e.color)||fr.value[t]||l[t]||l[t%l.length],value:r.value>=0?r.value:0,id:r.id||`branch_${t}_${i}_${E.value}`,proportionToRoot:r.value/n,type:`branch`,breakdown:(r.breakdown||[]).map((a,o)=>({table:{rootName:e.name,rootValue:n,rootToTotal:n/z.value,branchName:r.name,branchValue:r.value,branchToTotal:r.value/z.value,branchToRoot:r.value/n,nutName:a.name,nutValue:a.value,nutToTotal:a.value/z.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/z.value,rootIndex:t,id:a.id||`nut_${t}_${i}_${o}_${E.value}`,color:re(a.color)||fr.value[o]||l[o]||l[o%l.length],value:a.value>=0?a.value:0}))}))}})));function _r(){return B.value}let vr=Je,yr=p(()=>B.value.flatMap(e=>e.branches).length),br=p(()=>Math.max(...B.value.map(e=>e.branches.map(e=>e.value).reduce((e,t)=>e+t,0)))),xr=p(()=>Math.max(...B.value.flatMap(e=>e.branches.map(e=>e.value)))),Sr=p(()=>256+L.value.padding.left),V=p(()=>B.value.sort((e,t)=>t.total-e.total).map((e,t)=>{let n=R.value.height/B.value.length/2,r=e.total/br.value*(n>64?64:n);return{...e,x:R.value.seedX,y:R.value.top+R.value.height/B.value.length*(t+1)-(R.value.height/B.value.length/2+L.value.gap/2),r:r<L.value.branchSize/2?L.value.branchSize/2:r}})),Cr=p(()=>M.value.widthRatio<=0?.1:M.value.widthRatio>1.8?1.8:M.value.widthRatio),wr=p(()=>V.value.flatMap(e=>e.branches)),H=p(()=>wr.value.sort((e,t)=>t.value-e.value).map((e,t)=>({...e,y1:t*L.value.branchSize+R.value.top+t*L.value.gap,y2:t*L.value.branchSize+L.value.branchSize,x1:Sr.value,x2:384*e.value/xr.value*Cr.value+Sr.value}))),Tr=p(()=>V.value),Er=p(()=>Tr.value.map(e=>H.value.filter(t=>t.rootIndex===e.rootIndex).sort((e,t)=>e.y1-t.y1))),Dr=p(()=>Tr.value.map((e,t)=>Er.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 Or(e){let t=V.value.find(t=>t.rootIndex===e.rootIndex);return{x:t.x,y:t.y,r:t.r}}let U=b(null),kr=b(null),W=b(null),G=b(null);function K(){U.value=null,W.value=null,G.value=null}function q(e){if(U.value)return e.type===`root`?e.rootIndex===U.value.rootIndex:e.type===`branch`?e.id===U.value.id:e.type===`nut`&&e.branchName===U.value.name&&e.rootIndex===U.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&&D.value){if(k.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(k.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(k.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=Tr.value.findIndex(t=>t.rootIndex===e.rootIndex),n=(Er.value[t]||[]).findIndex(t=>t.id===e.id);t!==-1&&(k.value.rootIndex=t),n!==-1&&(k.value.branchIndex=n),k.value.level=`nut`,k.value.nutIndex=0,ze(()=>{U.value=e,W.value=e,kr.value=ne({series:e.breakdown,base:1},e.x2+24+N.value.offsetX,e.y1+L.value.branchSize/2,80,80),vr(`selectNut`,e.breakdown),Q()})}function J(){U.value=null,kr.value=null,vr(`selectNut`,null)}function jr(e){let t=Tr.value.findIndex(t=>t.rootIndex===e.rootIndex),n=(Er.value[t]||[]).findIndex(t=>t.id===e.id);t!==-1&&(k.value.rootIndex=t),n!==-1&&(k.value.branchIndex=n),k.value.level=`branch`,k.value.nutIndex=0,W.value&&W.value.id===e.id?(W.value=null,K(),vr(`selectBranch`,null),Q()):(K(),W.value=e,vr(`selectBranch`,e),Q())}function Mr(e){let t=Tr.value.findIndex(t=>t.id===e.id);t!==-1&&(k.value.rootIndex=t),k.value.level=`root`,k.value.branchIndex=0,k.value.nutIndex=0,G.value&&G.value.id===e.id?(K(),vr(`selectRoot`,null),Q()):(K(),G.value=e,vr(`selectRoot`,e),Q())}function Nr(){return R.value.bottom-(U.value.y1+180)<0?0:R.value.bottom}function Pr(e){return e.proportion*100>N.value.selected.labels.dataLabels.hideUnderValue}Ve(()=>{Fr()});function Fr(){ge(T.dataset)&&oe({componentName:`VueUiChestnut`,type:`dataset`,debug:gr.value});let e=yr.value*(L.value.branchSize+L.value.gap)+L.value.padding.top+L.value.padding.bottom;L.value.height=e}let Y=p(()=>({head:[A.value.table.th.translations.rootName,A.value.table.th.translations.rootValue,A.value.table.th.translations.rootToTotal,A.value.table.th.translations.branchName,A.value.table.th.translations.branchValue,A.value.table.th.translations.branchToRoot,A.value.table.th.translations.branchToTotal,A.value.table.th.translations.nutName,A.value.table.th.translations.nutValue,A.value.table.th.translations.nutToBranch,A.value.table.th.translations.nutToRoot,A.value.table.th.translations.nutToTotal],body:B.value.flatMap((e,t)=>e.branches.flatMap((e,t)=>e.breakdown.flatMap((e,t)=>e.table)))}));function Ir(e=null){ze(()=>{let t=[[P.value.title.text],[P.value.title.subtitle.text],[``],[`Grand total`,z.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=te(i);e?e(a):ue({csvContent:a,title:P.value.title.text||`vue-ui-chestnut`})})}let Lr=b(!1);function Rr(e){Lr.value=e,Yn.value+=1}function zr(){pr.value.showTable=!pr.value.showTable}let Br=b(!1);function Vr(){Br.value=!Br.value}async function Hr({scale:e=2}={}){if(!Jn.value)return;let{width:t,height:n}=Jn.value.getBoundingClientRect(),r=t/n,{imageUri:i,base64:a}=await De({domElement:Jn.value,base64:!0,img:!0,scale:e});return{imageUri:i,base64:a,title:P.value.title.text,width:t,height:n,aspectRatio:r}}function Ur(e){let t=Or(e),n=e.x1,r=e.y1,i=L.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=p(()=>s({config:A,style:F,mutableConfig:pr,dialog:Gn,accordion:Vn,isFullscreen:Lr,parent:Jn,maxWidth:800,titleStyle:P,isCursorPointer:I}));Ge(()=>pr.value.showTable,async e=>{A.value.table.show||(e&&A.value.table.useDialog&&Xn.value?(await ze(),Xn.value.open()):`close`in Xn.value&&Xn.value.close())});let{isResponsive:Gr}=we(mr,hr);function Kr(){pr.value.showTable=!1,Zn.value&&Zn.value.setTableIconState(!1)}let qr=p(()=>B.value.map((e,t)=>({...e,display:`${e.name}: ${ce(j.value.labels.formatter,e.total,c({p:P.value.legend.prefix,v:e.total,s:P.value.legend.suffix,r:P.value.legend.roundingValue}),{datapoint:e})} (${c({v:e.total/z.value*100,s:`%`,r:P.value.legend.roundingPercentage})})`}))),Jr=p(()=>qr.value.map(e=>({color:e.color,name:e.display,shape:`circle`}))),Yr=p(()=>F.value.backgroundColor),Xr=p(()=>({...P.value.legend,textAlign:`center`,show:!0,position:`bottom`})),Zr=p(()=>P.value.title),{isCallbackImaging:Qr,isCallbackSvg:$r,generateSvg:ei,onGenerateImage:ti}=Ce({svg:ar,title:Zr,legend:Xr,legendItems:Jr,backgroundColor:Yr,titleEmbedded:!0,getSvgCallback:()=>A.value.userOptions.callbacks.svg,generateImage:ur});async function ni(){vr(`copyAlt`,{config:A.value,dataset:B.value}),A.value.userOptions.callbacks.altCopy?await Promise.resolve(A.value.userOptions.callbacks.altCopy({config:A.value,dataset:B.value})):console.warn("Vue Data UI - A callback must be set for `altCopy` in userOptions.")}function ri(e){if(!e)return``;let t=c({p:P.value.legend.prefix,v:e.total,s:P.value.legend.suffix,r:P.value.legend.roundingValue}),n=c({v:e.total/z.value*100,s:`%`,r:P.value.legend.roundingPercentage});return`Root ${e.name}. Value ${t}. ${n} of total.`}function ii(e){if(!e)return``;let t=c({p:M.value.labels.dataLabels.prefix,v:e.value,s:M.value.labels.dataLabels.suffix,r:M.value.labels.dataLabels.roundingValue}),n=c({v:e.proportionToRoot*100,s:`%`,r:P.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=c({p:P.value.legend.prefix,v:e.value,s:P.value.legend.suffix,r:N.value.selected.labels.roundingValue}),n=c({v:e.proportionToBranch*100,s:`%`,r:N.value.selected.labels.roundingPercentage});return`Nut ${e.name}. Branch ${e.branchName}. Root ${e.rootName}. Value ${t}. ${n} of branch ${e.branchName}.`}let oi=p(()=>Tr.value[k.value.rootIndex]||null),X=p(()=>(Er.value[k.value.rootIndex]||[])[k.value.branchIndex]||null),si=p(()=>((Dr.value[k.value.rootIndex]||[])[k.value.branchIndex]||[])[k.value.nutIndex]||null),Z=p(()=>oi.value),ci=p(()=>X.value),li=p(()=>k.value.level===`nut`?X.value:null),ui=p(()=>Qn.value);function Q(){k.value.level===`root`?O.value=ri(oi.value):k.value.level===`branch`?O.value=ii(X.value):k.value.level===`nut`&&(O.value=ai(si.value))}function $(){k.value={level:`root`,rootIndex:0,branchIndex:0,nutIndex:0,locked:!1},O.value=``}function di(){let e=Er.value[k.value.rootIndex]||[];e.length?(k.value.branchIndex>=e.length&&(k.value.branchIndex=0),k.value.branchIndex<0&&(k.value.branchIndex=e.length-1)):k.value.branchIndex=0}function fi(){let e=(Dr.value[k.value.rootIndex]||[])[k.value.branchIndex]||[];e.length?(k.value.nutIndex>=e.length&&(k.value.nutIndex=0),k.value.nutIndex<0&&(k.value.nutIndex=e.length-1)):k.value.nutIndex=0}function pi(e){if(k.value.level===`root`){let t=Tr.value.length;if(!t)return;k.value.rootIndex+=e,k.value.rootIndex>=t&&(k.value.rootIndex=0),k.value.rootIndex<0&&(k.value.rootIndex=t-1),k.value.branchIndex=0,k.value.nutIndex=0,Q()}else k.value.level===`branch`?(k.value.branchIndex+=e,di(),k.value.nutIndex=0,Q()):k.value.level===`nut`&&(k.value.nutIndex+=e,fi(),Q())}function mi(e){if(e>0){if(k.value.level===`root`){if(!(Er.value[k.value.rootIndex]||[]).length)return;k.value.level=`branch`,k.value.branchIndex=0,k.value.nutIndex=0,Q();return}if(k.value.level===`branch`){if(!((Dr.value[k.value.rootIndex]||[])[k.value.branchIndex]||[]).length)return;k.value.level=`nut`,k.value.nutIndex=0,X.value?Ar(X.value):Q();return}}else k.value.level===`nut`?(J(),W.value=null,k.value.level=`branch`,k.value.nutIndex=0,Q()):k.value.level===`branch`&&(W.value=null,G.value=null,k.value.level=`root`,k.value.nutIndex=0,Q())}function hi(){k.value.level===`root`&&oi.value?(Mr(oi.value),O.value=`${ri(oi.value)} selected.`):k.value.level===`branch`&&X.value?(jr(X.value),O.value=`${ii(X.value)} selected.`):k.value.level===`nut`&&X.value&&si.value&&(Ar(X.value),O.value=`${ai(si.value)} details opened.`)}function gi(){Qn.value=!0,D.value=!1}function _i(){Qn.value=!1,D.value=!1,O.value=``,G.value||W.value||U.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(),Qn.value||=!0,o?(K(),$(),D.value=!1):((t||n||r||i)&&(D.value=!0),t?pi(-1):n?pi(1):r?mi(-1):i?mi(1):a&&hi()))}let yi=p(()=>({headers:Y.value.head,rows:Y.value.body.map(e=>[e.rootName,e.rootValue,c({v:e.rootToTotal*100,s:`%`,r:A.value.table.td.roundingPercentage}),e.branchName,e.branchValue,c({v:e.branchToRoot*100,s:`%`,r:A.value.table.td.roundingPercentage}),c({v:e.branchToTotal*100,s:`%`,r:A.value.table.td.roundingPercentage}),e.nutName,e.nutValue,c({v:e.nutToBranch*100,s:`%`,r:A.value.table.td.roundingPercentage}),c({v:e.nutToRoot*100,s:`%`,r:A.value.table.td.roundingPercentage}),c({v:e.nutToTotal*100,s:`%`,r:A.value.table.td.roundingPercentage})])}));return je({getData:_r,getImage:Hr,generatePdf:lr,generateCsv:Ir,generateImage:ur,generateSvg:ei,toggleTable:zr,toggleAnnotator:Vr,toggleFullscreen:Rr,copyAlt:ni}),(e,s)=>(y(),h(`div`,{class:_(`vue-data-ui-component vue-ui-chestnut ${Lr.value?`vue-data-ui-wrapper-fullscreen`:``}`),ref_key:`chestnutChart`,ref:Jn,id:`vue-ui-chestnut_${E.value}`,style:v(`font-family:${A.value.style.fontFamily};width:100%; text-align:center;background:${F.value.backgroundColor}`),onMouseenter:s[12]||=()=>w(rr)(!0),onMouseleave:s[13]||=()=>w(rr)(!1)},[g(`div`,{id:`chart-instructions-${E.value}`,class:`sr-only`},[g(`p`,null,C(A.value.a11y.translations.keyboardNavigation),1)],8,Xe),g(`div`,Ze,C(O.value),1),yi.value?.rows?.length?(y(),Me(ke,{key:0,uid:E.value,head:yi.value.headers,body:yi.value.rows,notice:A.value.a11y.translations.tableAvailable,caption:A.value.a11y.translations.tableCaption},null,8,[`uid`,`head`,`body`,`notice`,`caption`])):m(``,!0),A.value.userOptions.buttons.annotator?(y(),Me(w(Hn),Re({key:1},w(a)(A.value.userOptions.annotator),{svgRef:w(ar),backgroundColor:F.value.backgroundColor,color:F.value.color,active:Br.value,isCursorPointer:I.value,palette:A.value.userOptions.annotatorPalette,onClose:Vr}),Ne({_:2},[x(w(o),t=>({name:t,fn:Ke(n=>[S(e.$slots,t,Be(Le(w(i)(t,n))),void 0,!0)])}))]),1040,[`svgRef`,`backgroundColor`,`color`,`active`,`isCursorPointer`,`palette`])):m(``,!0),dr.value?(y(),h(`div`,Qe,null,512)):m(``,!0),A.value.userOptions.show&&qn.value&&(w(ir)||w(nr))?(y(),Me(w(Un),Re({ref_key:`userOptionsRef`,ref:Zn,key:`user_options_${Yn.value}`,backgroundColor:F.value.backgroundColor,color:F.value.color,isImaging:w(cr),isPrinting:w(sr),uid:E.value,isFullscreen:Lr.value,chartElement:Jn.value},w(n)(A.value.userOptions,`pdf csv img svg table fullscreen altCopy annotator`),{isAnnotation:Br.value,tableDialog:A.value.table.useDialog,isCursorPointer:I.value,onToggleFullscreen:Rr,onGeneratePdf:w(lr),onGenerateCsv:Ir,onGenerateImage:w(ti),onGenerateSvg:w(ei),onToggleTable:zr,onToggleAnnotator:Vr,onCopyAlt:ni,style:{visibility:w(ir)?w(nr)?`visible`:`hidden`:`visible`}}),Ne({_:2},[x(w(t)(e.$slots,`menuIcon optionPdf optionCsv optionImg optionSvg optionTable optionFullscreen optionAnnotator optionAltCopy custom-menu-before custom-menu-after`),t=>({name:t,fn:Ke(n=>[S(e.$slots,t,Be(Le(w(r)(t,n))),void 0,!0)])}))]),1040,[`backgroundColor`,`color`,`isImaging`,`isPrinting`,`uid`,`isFullscreen`,`chartElement`,`isAnnotation`,`tableDialog`,`isCursorPointer`,`onGeneratePdf`,`onGenerateImage`,`onGenerateSvg`,`style`])):m(``,!0),g(`div`,$e,[L.value.height>0?(y(),h(`svg`,{key:0,ref_key:`svgRef`,ref:ar,xmlns:w(pe),"aria-describedby":`chart-instructions-${E.value}`,class:_({"vue-data-ui-fullscreen--on":Lr.value,"vue-data-ui-fulscreen--off":!Lr.value}),viewBox:`0 0 ${L.value.width<=0?10:L.value.width} ${L.value.height<=0?10:L.value.height}`,style:v(`overflow:visible;background:transparent;color:${F.value.color}`),tabindex:`0`,onFocus:gi,onBlur:_i,onKeydown:vi},[Fe(w(Wn)),S(e.$slots,`svg-underlayer`,{svg:{...L.value,isPrintingImg:w(sr)||w(cr)||w(Qr),isPrintingSvg:w($r)}},void 0,!0),e.$slots[`chart-background`]?(y(),h(`foreignObject`,{key:0,x:0,y:0,width:L.value.width<=0?10:L.value.width,height:L.value.height<=0?10:L.value.height,style:{pointerEvents:`none`}},[S(e.$slots,`chart-background`,{},void 0,!0)],8,tt)):m(``,!0),U.value?m(``,!0):(y(),h(`g`,nt,[P.value.title.text?(y(),h(`text`,{key:0,"text-anchor":`middle`,fill:P.value.title.color,"font-weight":P.value.title.bold?`bold`:`normal`,"font-size":P.value.title.fontSize,x:L.value.width/2,y:12+P.value.title.fontSize+P.value.title.offsetY,onClick:s[0]||=()=>{K(),$(),D.value=!1}},C(P.value.title.text),9,rt)):m(``,!0),P.value.title.subtitle.text?(y(),h(`text`,{key:1,"text-anchor":`middle`,fill:P.value.title.subtitle.color,"font-weight":P.value.title.subtitle.bold?`bold`:`normal`,"font-size":P.value.title.subtitle.fontSize,x:L.value.width/2,y:48+P.value.title.subtitle.fontSize+P.value.title.subtitle.offsetY,onClick:s[1]||=()=>{K(),$(),D.value=!1}},C(P.value.title.subtitle.text),9,it)):m(``,!0)])),g(`defs`,null,[(y(!0),h(f,null,x(B.value,(e,t)=>(y(),Me(Ae,{t:`radial`,cx:`50%`,cy:`50%`,r:`50%`,fx:`50%`,fy:`50%`,id:`root_gradient_${E.value}_${e.rootIndex}`,key:`root_gradient_${E.value}_${e.rootIndex}`,stops:[[`0%`,w(u)(w(ae)(e.color,.05),100-j.value.gradientIntensity),1],[`100%`,e.color,1]]},null,8,[`id`,`stops`]))),128)),(y(!0),h(f,null,x(B.value,e=>(y(),Me(Ae,{t:`linear`,x1:`0%`,y1:`0%`,x2:`100%`,y2:`0%`,id:`branch_gradient_${E.value}_${e.rootIndex}`,key:`branch_gradient_${E.value}_${e.rootIndex}`,stops:[[`0%`,e.color,1],[`100%`,w(u)(w(ae)(e.color,.02),100-M.value.gradientIntensity),1]]},null,8,[`id`,`stops`]))),128)),Fe(Ae,{t:`radial`,cx:`50%`,cy:`50%`,r:`50%`,fx:`50%`,fy:`50%`,id:`nutpick_${E.value}`,stops:[[`0%`,w(u)(`#FFFFFF`,0),0],[`80%`,w(u)(`#FFFFFF`,N.value.selected.gradientIntensity),1],[`100%`,w(u)(`#FFFFFF`,0),0]]},null,8,[`id`,`stops`]),Fe(Ae,{t:`radial`,cx:`50%`,cy:`50%`,r:`50%`,fx:`50%`,fy:`50%`,id:`nut_${E.value}`,stops:[[`0%`,w(u)(`#FFFFFF`,0),0],[`80%`,w(u)(`#FFFFFF`,N.value.gradientIntensity),1],[`100%`,w(u)(`#FFFFFF`,0),0]]},null,8,[`id`,`stops`]),Fe(Ae,{t:`radial`,cx:`50%`,cy:`50%`,r:`50%`,fx:`50%`,fy:`50%`,id:`nut_underlayer_${E.value}`,stops:[[`0%`,w(u)(F.value.backgroundColor,100),1],[`80%`,w(u)(F.value.backgroundColor,60),1],[`100%`,w(u)(F.value.backgroundColor,0),1]]},null,8,[`id`,`stops`])]),P.value.grandTotal.show?(y(),h(`g`,at,[g(`text`,{x:R.value.seedX,y:32+P.value.grandTotal.offsetY,"font-size":P.value.grandTotal.fontSize,"font-weight":P.value.grandTotal.bold?`bold`:`normal`,fill:P.value.grandTotal.color,"text-anchor":`middle`,onClick:s[2]||=()=>{K(),$(),D.value=!1}},C(P.value.grandTotal.text),9,ot),g(`text`,{x:R.value.seedX,y:38+P.value.grandTotal.fontSize+P.value.grandTotal.offsetY,"font-size":P.value.grandTotal.fontSize,"font-weight":P.value.grandTotal.bold?`bold`:`normal`,fill:P.value.grandTotal.color,"text-anchor":`middle`,onClick:s[3]||=()=>{K(),$(),D.value=!1}},C(w(ce)(P.value.grandTotal.formatter,z.value,w(c)({p:P.value.grandTotal.prefix,v:z.value,s:P.value.grandTotal.suffix,r:P.value.grandTotal.roundingValue}))),9,st)])):m(``,!0),(y(!0),h(f,null,x(H.value,e=>(y(),h(`g`,null,[g(`defs`,null,[Fe(Ae,{t:`linear`,id:`link_grad_${e.id}`,stops:[[`0%`,e.color,1],[`100%`,w(u)(e.color,P.value.links.opacity),1]]},null,8,[`id`,`stops`])]),g(`path`,{d:Ur(e),stroke:w(u)(e.color,P.value.links.opacity),fill:`url(#link_grad_${e.id})`,"stroke-linecap":`round`,"stroke-linejoin":`round`,style:v(`opacity:${+!!q(e)}`),onClick:s[4]||=()=>{K(),$(),D.value=!1}},null,12,ct)]))),256)),(y(!0),h(f,null,x(V.value,e=>(y(),h(`circle`,{cx:e.x,cy:e.y,r:e.r,fill:j.value.underlayerColor,stroke:`none`,style:v(`cursor:${I.value?`pointer`:`default`}; opacity:${q(e)?1:.05}`)},null,12,lt))),256)),(y(!0),h(f,null,x(V.value,(e,t)=>(y(),h(`circle`,{"aria-label":ri(e),cx:e.x,cy:e.y,r:e.r,fill:j.value.useGradient?`url(#root_gradient_${E.value}_${e.rootIndex})`:e.color,stroke:j.value.stroke,"stroke-width":j.value.strokeWidth,style:v(`cursor:${I.value?`pointer`:`default`}; opacity:${q(e)?1:.05}`),onClick:t=>Mr(e)},null,12,ut))),256)),j.value.labels.show?(y(),h(`g`,dt,[(y(!0),h(f,null,x(V.value,(e,t)=>(y(),h(`text`,{x:e.x,y:e.y+j.value.labels.fontSize/2.6,"text-anchor":`middle`,"font-size":j.value.labels.fontSize,fill:j.value.labels.adaptColorToBackground?w(fe)(e.color):j.value.labels.color,"font-weight":`bold`,style:v(`cursor:${I.value?`pointer`:`default`}; opacity:${q(e)?1:.05}`),onClick:t=>Mr(e)},C(w(ce)(j.value.labels.formatter,e.total,w(c)({p:j.value.labels.prefix,v:e.total,s:j.value.labels.suffix,r:j.value.labels.roundingValue}),{datapoint:e})),13,ft))),256)),(y(!0),h(f,null,x(V.value,e=>(y(),h(`g`,null,[U.value&&e.rootIndex===U.value.rootIndex||W.value&&e.rootIndex===W.value.rootIndex||G.value&&e.rootIndex===G.value.rootIndex?(y(),h(`g`,pt,[g(`text`,{x:e.x,y:e.y+e.r+24,"text-anchor":`middle`,fill:j.value.labels.name.color,"font-size":j.value.labels.name.fontSize,"font-weight":j.value.labels.name.bold?`bold`:`normal`,onClick:s[5]||=()=>{K(),$(),D.value=!1}},C(e.name),9,mt)])):m(``,!0)]))),256))])):m(``,!0),(y(!0),h(f,null,x(H.value,e=>(y(),h(`rect`,{x:e.x1,y:e.y1,height:L.value.branchSize,width:e.x2-e.x1,fill:M.value.underlayerColor,rx:M.value.borderRadius,stroke:`none`,style:v(`opacity:${q(e)?1:.05}`),onClick:t=>jr(e)},null,12,ht))),256)),(y(!0),h(f,null,x(H.value,(e,t)=>(y(),h(`rect`,{"aria-label":ii(e),x:e.x1,y:e.y1,height:L.value.branchSize,width:e.x2-e.x1,fill:M.value.useGradient?`url(#branch_gradient_${E.value}_${e.rootIndex})`:e.color,rx:M.value.borderRadius,stroke:M.value.stroke,"stroke-width":M.value.strokeWidth,style:v(`cursor:${I.value?`pointer`:`default`}; opacity:${q(e)?1:.05}`),onClick:t=>jr(e)},null,12,gt))),256)),M.value.labels.dataLabels.show?(y(),h(`g`,_t,[(y(!0),h(f,null,x(H.value,e=>(y(),h(`g`,null,[e.proportionToRoot*100>M.value.labels.dataLabels.hideUnderValue?(y(),h(`text`,{key:0,x:e.x1+6,y:e.y1+L.value.branchSize/1.5,"text-anchor":`start`,fill:w(fe)(e.color),"font-size":M.value.labels.dataLabels.fontSize,"font-weight":`bold`,style:v(`cursor:${I.value?`pointer`:`default`}; opacity:${q(e)?1:.05}`),onClick:t=>jr(e)},C(w(ce)(M.value.labels.dataLabels.formatter,e.value,w(c)({p:P.value.branches.labels.dataLabels.prefix,v:e.value,s:P.value.branches.labels.dataLabels.suffix,r:P.value.branches.labels.dataLabels.roundingValue}),{datapoint:e})),13,vt)):m(``,!0)]))),256))])):m(``,!0),(y(!0),h(f,null,x(H.value,(e,t)=>(y(),h(`g`,null,[(y(!0),h(f,null,x(w(ne)({series:e.breakdown,base:1},e.x2+24+N.value.offsetX,e.y1+L.value.branchSize/2,L.value.branchSize/3,L.value.branchSize/3),(t,n)=>(y(),h(`path`,{d:t.path,stroke:t.color,"stroke-width":10,fill:`none`,style:v(`opacity:${q(e)?1:.1}`)},null,12,yt))),256)),g(`circle`,{"aria-label":`Open details for branch ${e.name} in root ${e.rootName}`,fill:N.value.useGradient?`url(#nut_${E.value})`:`transparent`,cx:e.x2+24+N.value.offsetX,cy:e.y1+L.value.branchSize/2,r:L.value.branchSize/2+2,onClick:t=>Ar(e),style:v(`cursor:${I.value?`pointer`:`default`};opacity:${q(e)?1:.1}`)},null,12,bt)]))),256)),M.value.labels.show&&!W.value?(y(),h(`g`,xt,[(y(!0),h(f,null,x(H.value,e=>(y(),h(`text`,{x:e.x2+L.value.branchSize+24+N.value.offsetX,y:e.y1+L.value.branchSize/2+5,"font-size":M.value.labels.fontSize,"font-weight":M.value.labels.bold?`bold`:`normal`,fill:M.value.labels.color,"text-anchor":`start`,style:v(`opacity:${q(e)?1:.1}`)},C(e.name),13,St))),256))])):m(``,!0),g(`line`,{x1:256+L.value.padding.left,x2:256+L.value.padding.left,y1:R.value.top,y2:R.value.bottom,stroke:P.value.verticalSeparator.stroke,"stroke-width":P.value.verticalSeparator.strokeWidth},null,8,Ct),!U.value&&!W.value?(y(),h(`foreignObject`,{key:6,x:0,y:R.value.bottom,height:L.value.height-R.value.bottom,width:L.value.width,style:{overflow:`visible`},"data-no-svg-export":``,onClick:s[6]||=()=>{K(),$(),D.value=!1}},[g(`div`,Tt,[g(`div`,Et,[(y(!0),h(f,null,x(V.value,e=>(y(),h(`div`,{style:v(`display:flex;align-items:center;gap:3px;flex-direction:row;font-size:${P.value.legend.fontSize}px;`)},[(y(),h(`svg`,Dt,[g(`circle`,{cx:`10`,cy:`10`,r:`10`,fill:e.color,stroke:`none`},null,8,Ot)])),w(er)?m(``,!0):(y(),h(f,{key:0},[g(`span`,null,C(e.name)+`:`,1),g(`b`,null,C(w(ce)(P.value.roots.labels.formatter,e.total,w(c)({p:F.value.layout.legend.prefix,v:e.total,s:F.value.layout.legend.suffix,r:F.value.layout.legend.roundingValue}),{datapoint:e})),1),Pe(` (`+C(w(c)({v:e.total/z.value*100,s:`%`,r:P.value.legend.roundingPercentage}))+`) `,1)],64))],4))),256))])])],8,wt)):m(``,!0),U.value&&kr.value?(y(),h(`g`,kt,[(y(),h(`foreignObject`,{x:0,y:Nr(),height:L.value.height-R.value.bottom,width:L.value.width,style:{overflow:`visible`},onClick:s[7]||=()=>{K(),$(),D.value=!1}},[g(`div`,jt,[g(`b`,null,C(U.value.name),1),g(`div`,Mt,[(y(!0),h(f,null,x(U.value.breakdown,(e,t)=>(y(),h(`div`,{style:v(`display:flex;align-items:center;gap:6px;flex-direction:row;font-size:${P.value.legend.fontSize}px;`)},[(y(),h(`svg`,Nt,[g(`circle`,{cx:`10`,cy:`10`,r:`10`,fill:e.color,stroke:`none`},null,8,Pt)])),g(`span`,null,[Pe(C(e.name)+`: `,1),g(`b`,null,C(P.value.legend.prefix)+` `+C(e.value.toFixed(F.value.layout.nuts.selected.labels.roundingValue))+` `+C(P.value.legend.suffix),1),Pe(` (`+C((e.proportionToBranch*100).toFixed(P.value.nuts.selected.labels.roundingPercentage))+`%)`,1)])],4))),256))])])],8,At)),g(`circle`,{cx:U.value.x2+24+N.value.offsetX,cy:U.value.y1+L.value.branchSize/2,r:256,fill:`url(#nut_underlayer_${E.value})`,onClick:J,class:_(N.value.selected.useMotion?`vue-ui-chestnut-animated`:``)},null,10,Ft),(y(!0),h(f,null,x(kr.value,e=>(y(),h(`g`,null,[Pr(e)?(y(),h(`path`,{key:0,d:w(se)(e,{x:U.value.x2+24+N.value.offsetX,y:U.value.y1+L.value.branchSize/2},16,16,!1,!1,64),stroke:e.color,"stroke-width":`1`,"stroke-linecap":`round`,"stroke-linejoin":`round`,fill:`none`,class:_(N.value.selected.useMotion?`vue-ui-chestnut-animated`:``)},null,10,It)):m(``,!0)]))),256)),g(`circle`,{cx:U.value.x2+24+N.value.offsetX,cy:U.value.y1+L.value.branchSize/2,r:118,fill:F.value.backgroundColor,onClick:J,class:_(N.value.selected.useMotion?`vue-ui-chestnut-animated`:``)},null,10,Lt),(y(!0),h(f,null,x(kr.value,e=>(y(),h(`path`,{d:e.path,stroke:e.color,"stroke-width":64,fill:`none`,onClick:J,class:_(N.value.selected.useMotion?`vue-ui-chestnut-animated`:``)},null,10,Rt))),256)),g(`circle`,{cx:U.value.x2+24+N.value.offsetX,cy:U.value.y1+L.value.branchSize/2,r:110,fill:`url(#nutpick_${E.value})`,onClick:J,class:_(N.value.selected.useMotion?`vue-ui-chestnut-animated`:``)},null,10,zt),g(`circle`,{cx:U.value.x2+24+N.value.offsetX,cy:U.value.y1+L.value.branchSize/2,r:64,fill:F.value.backgroundColor,onClick:J,class:_(N.value.selected.useMotion?`vue-ui-chestnut-animated`:``)},null,10,Bt),g(`text`,{x:U.value.x2+24+N.value.offsetX,y:U.value.y1+8,fill:N.value.selected.labels.core.total.color,"font-size":N.value.selected.labels.core.total.fontSize,"font-weight":N.value.selected.labels.core.total.bold?`bold`:`normal`,"text-anchor":`middle`,onClick:J,class:_(N.value.selected.useMotion?`vue-ui-chestnut-animated`:``)},C(A.value.translations.total),11,Vt),g(`text`,{x:U.value.x2+24+N.value.offsetX,y:U.value.y1+36,fill:N.value.selected.labels.core.value.color,"font-size":N.value.selected.labels.core.value.fontSize,"font-weight":N.value.selected.labels.core.value.bold?`bold`:`normal`,"text-anchor":`middle`,onClick:J,class:_(N.value.selected.useMotion?`vue-ui-chestnut-animated`:``)},C(w(ce)(N.value.selected.labels.dataLabels.formatter,U.value.value,w(c)({p:N.value.selected.labels.core.value.prefix,v:U.value.value,s:N.value.selected.labels.core.value.suffix,r:N.value.selected.roundingValue}),{datapoint:U.value})),11,Ht),(y(!0),h(f,null,x(kr.value,(e,t)=>(y(),h(`g`,null,[Pr(e)?(y(),h(`text`,{key:0,x:w(d)(e).x,"text-anchor":w(d)(e).anchor,y:w(de)(e)-N.value.selected.labels.dataLabels.fontSize/6,fill:e.color,"font-size":N.value.selected.labels.dataLabels.fontSize/2,style:v(`font-weight:${N.value.selected.labels.dataLabels.bold?`bold`:``}`),class:_(N.value.selected.useMotion?`vue-ui-chestnut-animated`:``)},` ⬤ `,14,Ut)):m(``,!0),Pr(e)?(y(),h(`text`,{key:1,x:w(d)(e,!0).x,"text-anchor":w(d)(e,!0).anchor,y:w(de)(e),fill:N.value.selected.labels.dataLabels.color,"font-size":N.value.selected.labels.dataLabels.fontSize,style:v(`font-weight:${N.value.selected.labels.dataLabels.bold?`bold`:``}`),class:_(N.value.selected.useMotion?`vue-ui-chestnut-animated`:``)},C(U.value.breakdown[t].name),15,Wt)):m(``,!0)]))),256)),(y(!0),h(f,null,x(kr.value,(e,t)=>(y(),h(`g`,null,[Pr(e)?(y(),h(`text`,{key:0,x:w(d)(e,!0).x,"text-anchor":w(d)(e).anchor,y:w(de)(e)+N.value.selected.labels.dataLabels.fontSize,fill:N.value.selected.labels.dataLabels.color,"font-size":N.value.selected.labels.dataLabels.fontSize,style:v(`font-weight:${N.value.selected.labels.dataLabels.bold?`bold`:``}`),class:_(N.value.selected.useMotion?`vue-ui-chestnut-animated`:``)},C(w(c)({v:U.value.breakdown[t].value/U.value.value*100,s:`%`,r:N.value.selected.labels.roundingPercentage}))+` `+C(A.value.translations.of)+` `+C(U.value.breakdown[t].branchName)+` `+C(w(ce)(N.value.selected.labels.dataLabels.formatter,U.value.breakdown[t].value,w(c)({p:N.value.selected.labels.dataLabels.prefix,v:U.value.breakdown[t].value,s:N.value.selected.labels.dataLabels.suffix,r:N.value.selected.roundingValue}),{datapoint:kr.value,seriesIndex:t})),15,Gt)):m(``,!0),Pr(e)?(y(),h(`text`,{key:1,x:w(d)(e,!0).x,"text-anchor":w(d)(e).anchor,y:w(de)(e)+N.value.selected.labels.dataLabels.fontSize*2,fill:N.value.selected.labels.dataLabels.color,"font-size":N.value.selected.labels.dataLabels.fontSize,style:v(`font-weight:${N.value.selected.labels.dataLabels.bold?`bold`:``}`),class:_(N.value.selected.useMotion?`vue-ui-chestnut-animated`:``)},C(w(c)({v:U.value.breakdown[t].proportionToRoot*100,s:`%`,r:N.value.selected.labels.roundingPercentage}))+` `+C(A.value.translations.of)+` `+C(U.value.breakdown[t].rootName),15,Kt)):m(``,!0),Pr(e)?(y(),h(`text`,{key:2,x:w(d)(e,!0).x,"text-anchor":w(d)(e).anchor,y:w(de)(e)+N.value.selected.labels.dataLabels.fontSize*3,fill:N.value.selected.labels.dataLabels.color,"font-size":N.value.selected.labels.dataLabels.fontSize,style:v(`font-weight:${N.value.selected.labels.dataLabels.bold?`bold`:``}`),class:_(N.value.selected.useMotion?`vue-ui-chestnut-animated`:``)},C(w(c)({v:U.value.breakdown[t].proportionToTree*100,s:`%`,r:N.value.selected.labels.roundingPercentage}))+` `+C(A.value.translations.proportionToTree),15,qt)):m(``,!0)]))),256))])):m(``,!0),(y(!0),h(f,null,x(H.value,e=>(y(),h(`g`,null,[W.value&&W.value.id===e.id&&!U.value?(y(),h(`text`,{key:0,x:e.x1+6,y:e.y1+L.value.branchSize+24,"font-weight":`bold`,"text-anchor":`start`,"font-size":M.value.labels.dataLabels.fontSize,fill:M.value.labels.color,onClick:s[8]||=()=>{K(),$(),D.value=!1}},C(e.name)+`: `+C(w(ce)(M.value.labels.dataLabels.formatter,e.value,w(c)({p:M.value.labels.dataLabels.prefix,v:e.value,s:M.value.labels.dataLabels.suffix,r:M.value.labels.dataLabels.roundingValue}),{datapoint:e})),9,Jt)):m(``,!0),W.value&&W.value.id===e.id&&!U.value?(y(),h(`text`,{key:1,x:e.x1+6,y:e.y1+L.value.branchSize+48,"text-anchor":`start`,"font-size":M.value.labels.dataLabels.fontSize,fill:M.value.labels.color,onClick:s[9]||=()=>{K(),$(),D.value=!1}},C(w(c)({v:e.proportionToRoot*100,s:`%`,r:M.value.labels.dataLabels.roundingPercentage}))+` `+C(A.value.translations.of)+` `+C(e.rootName),9,Yt)):m(``,!0),W.value&&W.value.id===e.id&&!U.value?(y(),h(`text`,{key:2,x:e.x1+6,y:e.y1+L.value.branchSize+72,"text-anchor":`start`,"font-size":M.value.labels.dataLabels.fontSize,fill:M.value.labels.color,onClick:s[10]||=()=>{K(),$(),D.value=!1}},C(w(c)({v:e.value/z.value*100,s:`%`,r:M.value.labels.dataLabels.roundingPercentage}))+` `+C(A.value.translations.proportionToTree),9,Xt)):m(``,!0)]))),256)),S(e.$slots,`svg`,{svg:{...L.value,isPrintingImg:w(sr)||w(cr)||w(Qr),isPrintingSvg:w($r)}},void 0,!0)],46,et)):m(``,!0)]),e.$slots.watermark?(y(),h(`div`,Zt,[S(e.$slots,`watermark`,Be(Le({isPrinting:w(sr)||w(cr)||w(Qr)||w($r)})),void 0,!0)])):m(``,!0),S(e.$slots,`legend`,{legend:B.value},void 0,!0),e.$slots.source?(y(),h(`div`,Qt,[S(e.$slots,`source`,{},void 0,!0)],512)):m(``,!0),qn.value&&A.value.userOptions.buttons.table?(y(),Me(He(Wr.value.component),Re({key:6},Wr.value.props,{ref_key:`tableUnit`,ref:Xn,onClose:Kr}),Ne({content:Ke(()=>[g(`div`,{ref_key:`tableContainer`,ref:mr,class:`vue-ui-chestnut-table`,style:v(`${A.value.table.useDialog?``:`max-height: 300px;margin-top:24px`}`)},[g(`div`,{style:v(`${A.value.table.useDialog?``:`padding-top:36px;`}position: relative`)},[A.value.table.useDialog?m(``,!0):(y(),h(`div`,{key:0,role:`button`,tabindex:`0`,style:v(`width:32px; position: absolute; top: 0; left:4px; padding: 0 0px; display: flex; align-items:center;justify-content:center;height: 36px; width: 32px; cursor:${I.value?`pointer`:`default`}; background:${A.value.table.th.backgroundColor};`),onClick:Kr,onKeypress:qe(Kr,[`enter`])},[Fe(w(Bn),{name:`close`,stroke:A.value.table.th.color,"stroke-width":2},null,8,[`stroke`])],36)),g(`div`,{style:{width:`100%`},class:_({"vue-ui-responsive":w(Gr)})},[g(`table`,$t,[A.value.table.useDialog?m(``,!0):(y(),h(`caption`,{key:0,style:v({backgroundColor:A.value.table.th.backgroundColor,color:A.value.table.th.color,outline:A.value.table.th.outline}),class:`vue-ui-data-table__caption`},[Pe(C(P.value.title.text)+` `,1),P.value.title.subtitle.text?(y(),h(`span`,en,C(P.value.title.subtitle.text),1)):m(``,!0)],4)),g(`thead`,null,[g(`tr`,{role:`row`,style:v(`background:${A.value.table.th.backgroundColor};color:${A.value.table.th.color}`)},[(y(!0),h(f,null,x(Y.value.head,e=>(y(),h(`th`,{style:v(`outline:${A.value.table.th.outline}`)},C(e),5))),256))],4)]),g(`tbody`,null,[(y(!0),h(f,null,x(Y.value.body,(e,t)=>(y(),h(`tr`,{class:_({"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:v(`background:${A.value.table.td.backgroundColor};color:${A.value.table.td.color}`)},[g(`td`,{class:`vue-ui-data-table__tbody__td`,style:v(`outline:${A.value.table.td.outline}`),"data-cell":Y.value.head[0]},[g(`div`,nn,[Y.value.body[t-1]&&Y.value.body[t-1].rootName===e.rootName?(y(),h(`span`,rn)):(y(),h(`span`,an,C(e.rootName),1))])],12,tn),g(`td`,{class:`vue-ui-data-table__tbody__td`,style:v(`outline:${A.value.table.td.outline}`),"data-cell":Y.value.head[1]},[g(`div`,sn,[Y.value.body[t-1]&&Y.value.body[t-1].rootName===e.rootName?(y(),h(`span`,cn)):(y(),h(`span`,ln,C(e.rootValue.toFixed(A.value.table.td.roundingValue)),1))])],12,on),g(`td`,{class:`vue-ui-data-table__tbody__td`,style:v(`outline:${A.value.table.td.outline}`),"data-cell":Y.value.head[2]},[g(`div`,dn,[Y.value.body[t-1]&&Y.value.body[t-1].rootName===e.rootName?(y(),h(`span`,fn)):(y(),h(`span`,pn,C((e.rootToTotal*100).toFixed(A.value.table.td.roundingPercentage))+`% `,1))])],12,un),g(`td`,{class:`vue-ui-data-table__tbody__td`,style:v(`outline:${A.value.table.td.outline}`),"data-cell":Y.value.head[3]},[g(`div`,hn,[Y.value.body[t-1]&&Y.value.body[t-1].branchName===e.branchName?(y(),h(`span`,gn)):(y(),h(`span`,_n,C(e.branchName),1))])],12,mn),g(`td`,{class:`vue-ui-data-table__tbody__td`,style:v(`outline:${A.value.table.td.outline}`),"data-cell":Y.value.head[4]},[g(`div`,yn,[Y.value.body[t-1]&&Y.value.body[t-1].branchName===e.branchName?(y(),h(`span`,bn)):(y(),h(`span`,xn,C(e.branchValue.toFixed(A.value.table.td.roundingValue)),1))])],12,vn),g(`td`,{class:`vue-ui-data-table__tbody__td`,style:v(`outline:${A.value.table.td.outline}`),"data-cell":Y.value.head[5]},[g(`div`,Cn,[Y.value.body[t-1]&&Y.value.body[t-1].branchName===e.branchName?(y(),h(`span`,wn)):(y(),h(`span`,Tn,C((e.branchToRoot*100).toFixed(A.value.table.td.roundingPercentage))+`% `,1))])],12,Sn),g(`td`,{class:`vue-ui-data-table__tbody__td`,style:v(`outline:${A.value.table.td.outline}`),"data-cell":Y.value.head[6]},[g(`div`,Dn,[Y.value.body[t-1]&&Y.value.body[t-1].branchName===e.branchName?(y(),h(`span`,On)):(y(),h(`span`,kn,C((e.branchToTotal*100).toFixed(A.value.table.td.roundingPercentage))+`% `,1))])],12,En),g(`td`,{class:`vue-ui-data-table__tbody__td`,style:v(`outline:${A.value.table.td.outline}`),"data-cell":Y.value.head[7]},[g(`div`,jn,C(e.nutName),1)],12,An),g(`td`,{class:`vue-ui-data-table__tbody__td`,style:v(`outline:${A.value.table.td.outline}`),"data-cell":Y.value.head[8]},[g(`div`,Nn,C(e.nutValue.toFixed(A.value.table.td.roundingValue)),1)],12,Mn),g(`td`,{class:`vue-ui-data-table__tbody__td`,style:v(`outline:${A.value.table.td.outline}`),"data-cell":Y.value.head[9]},[g(`div`,Fn,C((e.nutToBranch*100).toFixed(A.value.table.td.roundingPercentage))+`% `,1)],12,Pn),g(`td`,{class:`vue-ui-data-table__tbody__td`,style:v(`outline:${A.value.table.td.outline}`),"data-cell":Y.value.head[10]},[g(`div`,Ln,C((e.nutToRoot*100).toFixed(A.value.table.td.roundingPercentage))+`% `,1)],12,In),g(`td`,{class:`vue-ui-data-table__tbody__td`,style:v(`outline:${A.value.table.td.outline}`),"data-cell":Y.value.head[11]},[g(`div`,zn,C((e.nutToTotal*100).toFixed(A.value.table.td.roundingPercentage))+`% `,1)],12,Rn)],6))),256))])])],2)],4)],4)]),_:2},[A.value.table.useDialog?{name:`title`,fn:Ke(()=>[Pe(C(Wr.value.title),1)]),key:`0`}:void 0,A.value.table.useDialog?{name:`actions`,fn:Ke(()=>[g(`button`,{tabindex:`0`,class:`vue-ui-user-options-button`,onClick:s[11]||=e=>Ir(A.value.userOptions.callbacks.csv)},[Fe(w(Bn),{name:`fileCsv`,stroke:Wr.value.props.color},null,8,[`stroke`])])]),key:`1`}:void 0]),1040)):m(``,!0),S(e.$slots,`skeleton`,{},()=>[w(er)?(y(),Me(xe,{key:0})):m(``,!0)],!0)],46,Ye))}},[[`__scopeId`,`data-v-41623f2b`]]);export{Je as n,Bn as t};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{n as t,r as n,t as r}from"./userOptionsSlots-CWtXN5Q6.js";import{n as i,r as a,t as o}from"./annotationSlots-OLiW25XN.js";import{n as s,t as c}from"./tableIntegration-CNoJ1CIY.js";import{t as l}from"./chartImage-DPGnEuYM.js";import{n as ee}from"./resolveChartConfig-0IvbmIE_.js";import{$ as te,D as ne,Ht as re,S as ie,X as ae,Y as oe,at as se,i as ce,in as le,nt as ue,r as de,sn as fe,t as pe,w as me,yt as he,zt as ge}from"./lib-rPeBMZrn.js";import{c as _e}from"./canvas-lib-22VpOI4_.js";import{n as ve}from"./useHints-C-TwxM0Y.js";import{t as ye}from"./useConfig-_JwRfIqE.js";import{n as be,t as xe}from"./BaseScanner-8NdoBs7B.js";import{t as Se}from"./usePrinter-DVf3YcG5.js";import{t as Ce}from"./useResponsive-CENUxfEL.js";import{t as we}from"./useChartExport-BZts4KFb.js";import{t as Te}from"./useUserOptionState-CXlFnwPv.js";import{t as Ee}from"./useChartAccessibility-DOMuYJfm.js";import{t as De}from"./Shape-CRe8woTu.js";import{n as Oe}from"./Title-BliHuXfT.js";import{t as ke}from"./vue_ui_chord-Crjq1pgV.js";import{t as Ae}from"./Legend-W9YVYVX-.js";import{t as je}from"./A11yDataTable-DWNlWXzs.js";import{t as Me}from"./_plugin-vue_export-helper-BDNMzG2s.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-DxGxf-Rm.js`).then(e=>e.n)),Ot=g(()=>import(`./BaseIcon-CoY0vuL3.js`).then(e=>e.n)),kt=g(()=>import(`./DataTable-KeuZB1JM.js`)),At=g(()=>import(`./PackageVersion-
|
|
1
|
+
import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{n as t,r as n,t as r}from"./userOptionsSlots-CWtXN5Q6.js";import{n as i,r as a,t as o}from"./annotationSlots-OLiW25XN.js";import{n as s,t as c}from"./tableIntegration-CNoJ1CIY.js";import{t as l}from"./chartImage-DPGnEuYM.js";import{n as ee}from"./resolveChartConfig-0IvbmIE_.js";import{$ as te,D as ne,Ht as re,S as ie,X as ae,Y as oe,at as se,i as ce,in as le,nt as ue,r as de,sn as fe,t as pe,w as me,yt as he,zt as ge}from"./lib-rPeBMZrn.js";import{c as _e}from"./canvas-lib-22VpOI4_.js";import{n as ve}from"./useHints-C-TwxM0Y.js";import{t as ye}from"./useConfig-_JwRfIqE.js";import{n as be,t as xe}from"./BaseScanner-8NdoBs7B.js";import{t as Se}from"./usePrinter-DVf3YcG5.js";import{t as Ce}from"./useResponsive-CENUxfEL.js";import{t as we}from"./useChartExport-BZts4KFb.js";import{t as Te}from"./useUserOptionState-CXlFnwPv.js";import{t as Ee}from"./useChartAccessibility-DOMuYJfm.js";import{t as De}from"./Shape-CRe8woTu.js";import{n as Oe}from"./Title-BliHuXfT.js";import{t as ke}from"./vue_ui_chord-Crjq1pgV.js";import{t as Ae}from"./Legend-W9YVYVX-.js";import{t as je}from"./A11yDataTable-DWNlWXzs.js";import{t as Me}from"./_plugin-vue_export-helper-BDNMzG2s.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-DxGxf-Rm.js`).then(e=>e.n)),Ot=g(()=>import(`./BaseIcon-CoY0vuL3.js`).then(e=>e.n)),kt=g(()=>import(`./DataTable-KeuZB1JM.js`)),At=g(()=>import(`./PackageVersion-PdpqwkYX.js`).then(e=>e.t)),jt=g(()=>import(`./PenAndPaper-BV5ODysA.js`).then(e=>e.t)),Mt=g(()=>import(`./UserOptions-K1N7zQRx.js`).then(e=>e.n)),Nt=g(()=>import(`./BaseDraggableDialog-DVstuNhT.js`).then(e=>e.n)),{vue_ui_chord:Pt}=ye(),E=e,Ft=Ye,D=b(!!E.dataset&&Object.hasOwn(E.dataset,`matrix`)),O=b(ae()),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);ve({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(()=>le({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}=be({...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:le({defaultConfig:L.value,userConfig:Yt.value})}),{userOptionsVisible:Qt,setUserOptionsVisibility:$t,keepUserOptionState:en}=Te({config:L.value}),{svgRef:U}=Ee({config:B.value.title}),{isPrinting:tn,isImaging:nn,generatePdf:rn,generateImage:an}=Se({elementId:`chord_${O.value}`,fileName:B.value.title.text||`vue-ui-chord`,options:L.value.userOptions.print}),W=b({showTable:L.value.table.show});function on(){return ee(E.config,Pt,ke)}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(ge(E.dataset)){se({componentName:`VueUiChord`,type:`dataset`,debug:G.value}),D.value=!1,Zt.value=!0;return}let e=he({datasetObject:E.dataset,requiredAttributes:[`matrix`]});if(e.length){G.value&&e.forEach(e=>{se({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
2
|
|
|
3
3
|
matrix:[
|
|
4
4
|
[1, 1],
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{n as t,r as n,t as r}from"./userOptionsSlots-CWtXN5Q6.js";import{n as i,r as a,t as o}from"./annotationSlots-OLiW25XN.js";import{n as s}from"./annotationViewport-X8fvs7pz.js";import{t as c}from"./tableIntegration-CNoJ1CIY.js";import{t as l}from"./chartImage-DPGnEuYM.js";import{n as u}from"./resolveChartConfig-0IvbmIE_.js";import{$ as d,D as f,Dt as p,Ft as m,Ht as ee,Q as h,S as g,X as te,Zt as ne,at as re,i as ie,in as ae,nn as oe,nt as se,q as ce,r as le,t as ue,tn as de,w as fe,zt as pe}from"./lib-rPeBMZrn.js";import{c as me}from"./canvas-lib-22VpOI4_.js";import{n as he,t as ge}from"./useHints-C-TwxM0Y.js";import{t as _e}from"./useConfig-_JwRfIqE.js";import{t as ve}from"./usePrinter-DVf3YcG5.js";import{n as ye,t as be}from"./BaseScanner-8NdoBs7B.js";import{t as xe}from"./useResponsive-CENUxfEL.js";import{t as Se}from"./useChartExport-BZts4KFb.js";import{t as Ce}from"./useTransitions-ChGGrtrv.js";import{t as we}from"./useUserOptionState-CXlFnwPv.js";import{t as Te}from"./useChartAccessibility-DOMuYJfm.js";import{n as Ee}from"./Title-BliHuXfT.js";import{t as De}from"./vue_ui_circle_pack-DarCZyF2.js";import{t as Oe}from"./usePanZoom-CE6Ofyy8.js";import{t as ke}from"./A11yDataTable-DWNlWXzs.js";import{t as Ae}from"./DefGrad-DKMq1REY.js";import{t as je}from"./_plugin-vue_export-helper-BDNMzG2s.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__*/ je({__name:`vue-ui-circle-pack`,props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:[`selectDatapoint`,`copyAlt`],setup(e,{expose:je,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-DxGxf-Rm.js`).then(e=>e.n)),Ye=C(()=>import(`./DataTable-KeuZB1JM.js`)),Xe=C(()=>import(`./UserOptions-K1N7zQRx.js`).then(e=>e.n)),Ze=C(()=>import(`./PenAndPaper-BV5ODysA.js`).then(e=>e.t)),Qe=C(()=>import(`./PackageVersion-ksOit8fp.js`).then(e=>e.t)),$e=C(()=>import(`./BaseDraggableDialog-DVstuNhT.js`).then(e=>e.n)),F=e,et=We,{vue_ui_circle_pack:tt}=_e(),nt=v(()=>!!F.dataset&&F.dataset.length),I=k(te()),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);he({config:()=>B.value,dataset:()=>F.dataset,component:`VueUiCirclePack`,rules:[ge.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}=Ce({config:()=>B.value.transitions,dataset:()=>F.dataset}),It=v(()=>B.value.userOptions.useCursorPointer),Lt=v(()=>ae({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}=ye({...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:ae({defaultConfig:B.value,userConfig:Lt.value})}),{svgRef:G}=Te({config:U.value.title}),{userOptionsVisible:Bt,setUserOptionsVisibility:Vt,keepUserOptionState:Ht}=we({config:B.value});function Ut(){return u(F.config,tt,De)}let Wt=ne(F.config);He(()=>F.config,(e,t)=>{let n=ne(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}=ve({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=oe[B.value.theme||`default`]||ee,r=hn.value.length?hn.value:n.length?n:ee;return g(e.color)||r[t%r.length]||ee[t%ee.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=te(),s=[...r,i],c=s.reduce((e,t,n)=>e+t+n,0),l=e.color||t?.color?g(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=me(()=>{let{width:e,height:t}=xe({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(){pe(F.dataset)&&re({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(()=>fe(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,p(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+=`
|
|
1
|
+
import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{n as t,r as n,t as r}from"./userOptionsSlots-CWtXN5Q6.js";import{n as i,r as a,t as o}from"./annotationSlots-OLiW25XN.js";import{n as s}from"./annotationViewport-X8fvs7pz.js";import{t as c}from"./tableIntegration-CNoJ1CIY.js";import{t as l}from"./chartImage-DPGnEuYM.js";import{n as u}from"./resolveChartConfig-0IvbmIE_.js";import{$ as d,D as f,Dt as p,Ft as m,Ht as ee,Q as h,S as g,X as te,Zt as ne,at as re,i as ie,in as ae,nn as oe,nt as se,q as ce,r as le,t as ue,tn as de,w as fe,zt as pe}from"./lib-rPeBMZrn.js";import{c as me}from"./canvas-lib-22VpOI4_.js";import{n as he,t as ge}from"./useHints-C-TwxM0Y.js";import{t as _e}from"./useConfig-_JwRfIqE.js";import{t as ve}from"./usePrinter-DVf3YcG5.js";import{n as ye,t as be}from"./BaseScanner-8NdoBs7B.js";import{t as xe}from"./useResponsive-CENUxfEL.js";import{t as Se}from"./useChartExport-BZts4KFb.js";import{t as Ce}from"./useTransitions-ChGGrtrv.js";import{t as we}from"./useUserOptionState-CXlFnwPv.js";import{t as Te}from"./useChartAccessibility-DOMuYJfm.js";import{n as Ee}from"./Title-BliHuXfT.js";import{t as De}from"./vue_ui_circle_pack-DarCZyF2.js";import{t as Oe}from"./usePanZoom-CE6Ofyy8.js";import{t as ke}from"./A11yDataTable-DWNlWXzs.js";import{t as Ae}from"./DefGrad-DKMq1REY.js";import{t as je}from"./_plugin-vue_export-helper-BDNMzG2s.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__*/ je({__name:`vue-ui-circle-pack`,props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:[`selectDatapoint`,`copyAlt`],setup(e,{expose:je,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-DxGxf-Rm.js`).then(e=>e.n)),Ye=C(()=>import(`./DataTable-KeuZB1JM.js`)),Xe=C(()=>import(`./UserOptions-K1N7zQRx.js`).then(e=>e.n)),Ze=C(()=>import(`./PenAndPaper-BV5ODysA.js`).then(e=>e.t)),Qe=C(()=>import(`./PackageVersion-PdpqwkYX.js`).then(e=>e.t)),$e=C(()=>import(`./BaseDraggableDialog-DVstuNhT.js`).then(e=>e.n)),F=e,et=We,{vue_ui_circle_pack:tt}=_e(),nt=v(()=>!!F.dataset&&F.dataset.length),I=k(te()),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);he({config:()=>B.value,dataset:()=>F.dataset,component:`VueUiCirclePack`,rules:[ge.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}=Ce({config:()=>B.value.transitions,dataset:()=>F.dataset}),It=v(()=>B.value.userOptions.useCursorPointer),Lt=v(()=>ae({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}=ye({...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:ae({defaultConfig:B.value,userConfig:Lt.value})}),{svgRef:G}=Te({config:U.value.title}),{userOptionsVisible:Bt,setUserOptionsVisibility:Vt,keepUserOptionState:Ht}=we({config:B.value});function Ut(){return u(F.config,tt,De)}let Wt=ne(F.config);He(()=>F.config,(e,t)=>{let n=ne(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}=ve({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=oe[B.value.theme||`default`]||ee,r=hn.value.length?hn.value:n.length?n:ee;return g(e.color)||r[t%r.length]||ee[t%ee.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=te(),s=[...r,i],c=s.reduce((e,t,n)=>e+t+n,0),l=e.color||t?.color?g(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=me(()=>{let{width:e,height:t}=xe({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(){pe(F.dataset)&&re({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(()=>fe(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,p(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
2
|
<div style="display:flex;align-items:center;gap:4px;">
|
|
3
3
|
<svg viewBox="0 0 10 10" height="${U.value.tooltip.fontSize}" width="${U.value.tooltip.fontSize}">
|
|
4
4
|
<circle
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{t}from"./useNestedProp-DnGoh-XS.js";import{Jt as n,X as r,t as i}from"./lib-rPeBMZrn.js";import{t as a}from"./useConfig-_JwRfIqE.js";import{n as o}from"./PackageVersion-
|
|
1
|
+
import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{t}from"./useNestedProp-DnGoh-XS.js";import{Jt as n,X as r,t as i}from"./lib-rPeBMZrn.js";import{t as a}from"./useConfig-_JwRfIqE.js";import{n as o}from"./PackageVersion-PdpqwkYX.js";import{t as s}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{Teleport as c,computed as l,createBlock as u,createCommentVNode as d,createElementBlock as f,createElementVNode as p,createVNode as ee,nextTick as te,normalizeClass as m,normalizeStyle as ne,onBeforeUnmount as re,onMounted as h,openBlock as g,ref as _,toDisplayString as v,unref as y}from"vue";var b=/* @__PURE__ */ e({default:()=>R}),x=[`xmlns`,`height`,`width`],S={id:`follower`,fy:`30%`,fx:`30%`},ie=[`stop-color`,`stop-opacity`],ae=[`r`,`fill`,`stroke`,`stroke-width`,`stroke-dasharray`],oe=[`r`],se={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__*/ s({__name:`vue-ui-cursor`,props:{config:{type:Object,default:{}}},setup(e){let{vue_ui_cursor:s}=a(),b=e,R=_(r()),z=l(()=>t({userConfig:b.config,defaultConfig:s})),B=_({x:-100,y:-100}),V=l(()=>Math.round(z.value.centerCircleRadius)),H=l(()=>Math.round(z.value.coordinatesOffset));function U({clientX:e,clientY:t,...n}){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=_(!0);function K(e){G.value=e}let q=_(!1),J=_(null);function Y(){q.value=!1,J.value&&clearTimeout(J.value),te(()=>{q.value=!0,J.value=setTimeout(()=>{q.value=!1},1e3)})}let X=_(null),Z=_(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 h(()=>{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}),re(()=>{Z.value&&=(Z.value.disconnect(),null),X.value&&=(le(X.value),null)}),(e,t)=>(g(),u(c,{to:`body`},[G.value?(g(),f(`svg`,{key:0,"data-dom-to-png-ignore":``,xmlns:y(i),style:ne(`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},[ee(o),p(`defs`,null,[p(`radialGradient`,S,[p(`stop`,{offset:`10%`,"stop-color":z.value.bubbleEffectColor,"stop-opacity":z.value.bubbleEffectOpacity},null,8,ie),t[0]||=p(`stop`,{offset:`95%`,"stop-color":`transparent`},null,-1)])]),z.value.showCenterCircle?(g(),f(`circle`,{key:0,cx:50,cy:50,r:V.value,fill:y(n)(z.value.centerCircleColor,z.value.centerCircleOpacity*100),stroke:z.value.centerCircleStroke,"stroke-width":z.value.centerCircleStrokeWidth,"stroke-dasharray":z.value.centerCircleDasharray},null,8,ae)):d(``,!0),z.value.bubbleEffect?(g(),f(`circle`,{key:1,cx:50,cy:50,r:V.value,fill:`url(#follower)`,stroke:`none`},null,8,oe)):d(``,!0),z.value.useWaveOnClick?(g(),f(`g`,se,[p(`defs`,null,[p(`filter`,{id:`blur_${R.value}`,x:`-50%`,y:`-50%`,width:`200%`,height:`200%`},[p(`feGaussianBlur`,{in:`SourceGraphic`,stdDeviation:4,id:`blur_std_${R.value}`},null,8,w),t[1]||=p(`feColorMatrix`,{type:`saturate`,values:`0`},null,-1)],8,C)]),q.value?(g(),f(`circle`,{key:0,class:m({"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)):d(``,!0)])):d(``,!0),z.value.showCrosshair?(g(),f(`g`,E,[p(`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),p(`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),p(`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),p(`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)])):d(``,!0),z.value.showIntersectCircles?(g(),f(`g`,{key:4,class:m({"rotating-circles":z.value.isLoading})},[p(`circle`,{cx:50,cy:V.value+50,r:z.value.intersectCirclesRadius,fill:z.value.intersectCirclesFill},null,8,j),p(`circle`,{cx:50,cy:-V.value+50,r:z.value.intersectCirclesRadius,fill:z.value.intersectCirclesFill},null,8,M),p(`circle`,{cx:-V.value+50,cy:50,r:z.value.intersectCirclesRadius,fill:z.value.intersectCirclesFill},null,8,N),p(`circle`,{cx:V.value+50,cy:50,r:z.value.intersectCirclesRadius,fill:z.value.intersectCirclesFill},null,8,P)],2)):d(``,!0),z.value.showCoordinates?(g(),f(`g`,F,[p(`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`},v(B.value.x.toFixed(0)),9,I),p(`g`,{transform:`translate(${50-z.value.coordinatesFontSize/2+H.value}, ${-V.value+50-z.value.coordinatesFontSize/2+H.value})`},[p(`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`},v(B.value.y.toFixed(0)),9,ce)],8,L)])):d(``,!0)],12,x)):d(``,!0)]))}},[[`__scopeId`,`data-v-4b1f566e`]]);export{b as n,R as t};
|