vue-data-ui 3.29.3 → 3.29.4
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/{Arrow-CITPKnWF.js → Arrow-DhkzHBsL.js} +1 -1
- package/dist/{BaseDraggableDialog-DVstuNhT.js → BaseDraggableDialog-MyWIeEtr.js} +1 -1
- package/dist/{BaseIcon-CoY0vuL3.js → BaseIcon-CQFjKDhE.js} +1 -1
- package/dist/{BaseLegendToggle-VzX69MCo.js → BaseLegendToggle-CnQ_U5rI.js} +1 -1
- package/dist/{BaseZoomControls-D4i_j6vc.js → BaseZoomControls-OZwEB4vm.js} +1 -1
- package/dist/{ColorPicker-DmVnJGVv.js → ColorPicker-dbxPO2fg.js} +1 -1
- package/dist/{DataTable-KeuZB1JM.js → DataTable-BHW5xD9B.js} +1 -1
- package/dist/{HillActions-D--h5brJ.js → HillActions-KXWY_FyA.js} +1 -1
- package/dist/{Legend-W9YVYVX-.js → Legend-D5I3jeGD.js} +1 -1
- package/dist/{NonSvgPenAndPaper-B2kuh5Yb.js → NonSvgPenAndPaper-RQzq8DqO.js} +1 -1
- package/dist/{PackageVersion-DAF5ApGl.js → PackageVersion-B-1JX0wI.js} +1 -1
- package/dist/{PenAndPaper-BV5ODysA.js → PenAndPaper-B2UOwiJM.js} +1 -1
- package/dist/{Shape-CRe8woTu.js → Shape-DgpYvQc4.js} +1 -1
- package/dist/{SlicerPreview-BVgz_p4G.js → SlicerPreview-QaJuNJhX.js} +1 -1
- package/dist/{SparkTooltip-Ch06CV71.js → SparkTooltip-dnNSazTu.js} +1 -1
- package/dist/{StackChartTable-rTC6w378.js → StackChartTable-mMKxPOnc.js} +1 -1
- package/dist/{Title-BliHuXfT.js → Title-DlhGIAWX.js} +1 -1
- package/dist/{Tooltip-B432XpvC.js → Tooltip-CL3U31cL.js} +1 -1
- package/dist/UserOptions-B97cPcKc.js +1 -0
- package/dist/{XyAnalysisOptions-Cyt8w5B3.js → XyAnalysisOptions-DeJOjnC3.js} +1 -1
- package/dist/{chartImage-DPGnEuYM.js → chartImage-Dvrx_F7P.js} +1 -1
- package/dist/components/arrow.js +1 -1
- package/dist/components/vue-ui-3d-bar.js +1 -1
- package/dist/components/vue-ui-accordion.js +1 -1
- package/dist/components/vue-ui-age-pyramid.js +1 -1
- package/dist/components/vue-ui-annotator.js +1 -1
- package/dist/components/vue-ui-bullet.js +1 -1
- package/dist/components/vue-ui-bump.js +1 -1
- package/dist/components/vue-ui-candlestick.js +1 -1
- package/dist/components/vue-ui-carousel-table.js +1 -1
- package/dist/components/vue-ui-chestnut.js +1 -1
- package/dist/components/vue-ui-chord.js +1 -1
- package/dist/components/vue-ui-circle-pack.js +1 -1
- package/dist/components/vue-ui-cursor.js +1 -1
- package/dist/components/vue-ui-dag.js +1 -1
- package/dist/components/vue-ui-dashboard.js +1 -1
- package/dist/components/vue-ui-digits.js +1 -1
- package/dist/components/vue-ui-donut-evolution.js +1 -1
- package/dist/components/vue-ui-donut.js +1 -1
- package/dist/components/vue-ui-dumbbell.js +1 -1
- package/dist/components/vue-ui-flow.js +1 -1
- package/dist/components/vue-ui-funnel.js +1 -1
- package/dist/components/vue-ui-galaxy.js +1 -1
- package/dist/components/vue-ui-gauge.js +1 -1
- package/dist/components/vue-ui-geo.js +1 -1
- package/dist/components/vue-ui-gizmo.js +1 -1
- package/dist/components/vue-ui-graph.js +1 -1
- package/dist/components/vue-ui-heatmap.js +1 -1
- package/dist/components/vue-ui-hill.js +1 -1
- package/dist/components/vue-ui-history-plot.js +1 -1
- package/dist/components/vue-ui-horizontal-bar.js +1 -1
- package/dist/components/vue-ui-icon.js +1 -1
- package/dist/components/vue-ui-kpi.js +1 -1
- package/dist/components/vue-ui-label.js +1 -1
- package/dist/components/vue-ui-mini-loader.js +1 -1
- package/dist/components/vue-ui-molecule.js +1 -1
- package/dist/components/vue-ui-mood-radar.js +1 -1
- package/dist/components/vue-ui-nested-donuts.js +1 -1
- package/dist/components/vue-ui-onion.js +1 -1
- package/dist/components/vue-ui-parallel-coordinate-plot.js +1 -1
- package/dist/components/vue-ui-quadrant.js +1 -1
- package/dist/components/vue-ui-quick-chart.js +1 -1
- package/dist/components/vue-ui-radar.js +1 -1
- package/dist/components/vue-ui-rating.js +1 -1
- package/dist/components/vue-ui-relation-circle.js +1 -1
- package/dist/components/vue-ui-ridgeline.js +1 -1
- package/dist/components/vue-ui-rings.js +1 -1
- package/dist/components/vue-ui-scatter.js +1 -1
- package/dist/components/vue-ui-skeleton.js +1 -1
- package/dist/components/vue-ui-smiley.js +1 -1
- package/dist/components/vue-ui-spark-trend.js +1 -1
- package/dist/components/vue-ui-sparkbar.js +1 -1
- package/dist/components/vue-ui-sparkgauge.js +1 -1
- package/dist/components/vue-ui-sparkhistogram.js +1 -1
- package/dist/components/vue-ui-sparkline.js +1 -1
- package/dist/components/vue-ui-sparkstackbar.js +1 -1
- package/dist/components/vue-ui-stackbar.js +1 -1
- package/dist/components/vue-ui-stackline.js +1 -1
- package/dist/components/vue-ui-strip-plot.js +1 -1
- package/dist/components/vue-ui-table-heatmap.js +1 -1
- package/dist/components/vue-ui-table-sparkline.js +1 -1
- package/dist/components/vue-ui-table.js +1 -1
- package/dist/components/vue-ui-thermometer.js +1 -1
- package/dist/components/vue-ui-timer.js +1 -1
- package/dist/components/vue-ui-tiremarks.js +1 -1
- package/dist/components/vue-ui-treemap.js +1 -1
- package/dist/components/vue-ui-vertical-bar.js +1 -1
- package/dist/components/vue-ui-waffle.js +1 -1
- package/dist/components/vue-ui-wheel.js +1 -1
- package/dist/components/vue-ui-word-cloud.js +1 -1
- package/dist/components/vue-ui-world.js +1 -1
- package/dist/components/vue-ui-xy-canvas.js +1 -1
- package/dist/components/vue-ui-xy.js +1 -1
- package/dist/{dom-to-png-D56-Zgv4.js → dom-to-png-BciywWcQ.js} +1 -1
- package/dist/{exposedLib-BRtClmZy.js → exposedLib-BaycYTOv.js} +1 -1
- package/dist/{img-D4RQwASc.js → img-Dwb4XSud.js} +1 -1
- package/dist/{labelUtils-CdtU-yB_.js → labelUtils-D_AyGvLO.js} +1 -1
- package/dist/{lib-rPeBMZrn.js → lib-BaWaqwnJ.js} +7 -7
- package/dist/package-CfW2xYyy.js +1 -0
- package/dist/{pdf-CVdqBWVS.js → pdf-Bd6zav8D.js} +1 -1
- package/dist/{render-common-B7aQrXBR.js → render-common-CxohOkPd.js} +1 -1
- package/dist/{resolveChartConfig-0IvbmIE_.js → resolveChartConfig-QgMumfgd.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/types/vue-data-ui.d.ts +20 -0
- package/dist/{useConfig-B8qvYKdK.js → useConfig-B-AzS3w-.js} +1 -1
- package/dist/{useNestedProp-DnGoh-XS.js → useNestedProp-ri-deXpG.js} +1 -1
- package/dist/{useObjectBindings-CztjiAzG.js → useObjectBindings-DsvXXciT.js} +1 -1
- package/dist/{usePrinter-DVf3YcG5.js → usePrinter-CUD8gosC.js} +1 -1
- package/dist/utils.js +1 -1
- package/dist/vue-data-ui-orKuQ-0A.js +1 -0
- package/dist/vue-data-ui.js +1 -1
- package/dist/{vue-ui-3d-bar-D3pDUYiG.js → vue-ui-3d-bar-BxIOe5pW.js} +1 -1
- package/dist/{vue-ui-accordion-BpTfjWvH.js → vue-ui-accordion-B8LYfVG9.js} +1 -1
- package/dist/{vue-ui-age-pyramid-bJmGRZ59.js → vue-ui-age-pyramid-CsQ6Zx79.js} +1 -1
- package/dist/{vue-ui-annotator-C-gyszpf.js → vue-ui-annotator-xYv2xrXs.js} +1 -1
- package/dist/{vue-ui-bullet-5ZNUgPS7.js → vue-ui-bullet-CsaTMHaa.js} +1 -1
- package/dist/{vue-ui-bump-DYGbmTko.js → vue-ui-bump-BOVB5hWu.js} +1 -1
- package/dist/{vue-ui-candlestick-BwETH5d4.js → vue-ui-candlestick-C8W4sGST.js} +1 -1
- package/dist/{vue-ui-carousel-table-_V-HWzd-.js → vue-ui-carousel-table-DAMT9bn5.js} +1 -1
- package/dist/{vue-ui-chestnut-Cg8m6-N6.js → vue-ui-chestnut-XdPEyosT.js} +1 -1
- package/dist/{vue-ui-chord-CaJ-uclL.js → vue-ui-chord-CeYpAizS.js} +1 -1
- package/dist/{vue-ui-circle-pack-BiVPm8ii.js → vue-ui-circle-pack-Brhoqu25.js} +1 -1
- package/dist/{vue-ui-cursor-jkuEvFtX.js → vue-ui-cursor-CieGBz32.js} +1 -1
- package/dist/{vue-ui-dag-wkBDTIcz.js → vue-ui-dag-CC7fXGUn.js} +1 -1
- package/dist/{vue-ui-dashboard-CDekEQNH.js → vue-ui-dashboard-C7oXScoZ.js} +1 -1
- package/dist/{vue-ui-digits-ByjwG9Hv.js → vue-ui-digits-Cn_wqq4Y.js} +1 -1
- package/dist/{vue-ui-donut-BB7BW0dE.js → vue-ui-donut-BHRes5Ak.js} +1 -1
- package/dist/{vue-ui-donut-BV3btR0S.js → vue-ui-donut-BXlWXh2v.js} +1 -1
- package/dist/{vue-ui-donut-evolution-CPIVtWxh.js → vue-ui-donut-evolution-DHPd3KRv.js} +1 -1
- package/dist/{vue-ui-dumbbell-bTQpX8A6.js → vue-ui-dumbbell-BmqFCL_t.js} +1 -1
- package/dist/{vue-ui-flow-BRC3pGzL.js → vue-ui-flow-CvRa8Ija.js} +1 -1
- package/dist/{vue-ui-funnel-7RjzjVqE.js → vue-ui-funnel-Ds4JV24L.js} +1 -1
- package/dist/vue-ui-galaxy-DSHlkl9t.js +1 -0
- package/dist/{vue-ui-gauge-DM3p5s8H.js → vue-ui-gauge-2XPqwRR4.js} +1 -1
- package/dist/{vue-ui-geo-BUQL79cU.js → vue-ui-geo-IDzNLYVX.js} +1 -1
- package/dist/{vue-ui-gizmo-CoET_abC.js → vue-ui-gizmo-BXEnFICN.js} +1 -1
- package/dist/{vue-ui-graph-CCLd8bTj.js → vue-ui-graph-DdY8jDH-.js} +2 -2
- package/dist/{vue-ui-heatmap-BvVHrOcc.js → vue-ui-heatmap-DmgXUHFz.js} +1 -1
- package/dist/{vue-ui-hill-BkcY-Zbf.js → vue-ui-hill-CTuh5311.js} +1 -1
- package/dist/{vue-ui-history-plot-DVoOwR1y.js → vue-ui-history-plot-qpbsJ706.js} +1 -1
- package/dist/{vue-ui-horizontal-bar-Khi_qtla.js → vue-ui-horizontal-bar-BnIRG4Da.js} +1 -1
- package/dist/{vue-ui-kpi-BPL64spX.js → vue-ui-kpi-BvGMMvPY.js} +1 -1
- package/dist/{vue-ui-label-OvoE3A_k.js → vue-ui-label-CcVh3FeS.js} +1 -1
- package/dist/{vue-ui-mini-loader-DyefvJIr.js → vue-ui-mini-loader-C7rLQ7JE.js} +1 -1
- package/dist/{vue-ui-molecule-B7KJzavj.js → vue-ui-molecule-BLCwrefH.js} +1 -1
- package/dist/{vue-ui-mood-radar-6q5OUW6D.js → vue-ui-mood-radar-Bm12y-t8.js} +1 -1
- package/dist/{vue-ui-nested-donuts-C137tg5U.js → vue-ui-nested-donuts-BGz-1VHL.js} +1 -1
- package/dist/{vue-ui-onion-ClMux968.js → vue-ui-onion-C23btxVO.js} +1 -1
- package/dist/{vue-ui-parallel-coordinate-plot-JbfDQzwN.js → vue-ui-parallel-coordinate-plot-E17cuXGN.js} +1 -1
- package/dist/{vue-ui-quadrant-BPKWN3Ac.js → vue-ui-quadrant-NJPbHq0p.js} +1 -1
- package/dist/{vue-ui-quick-chart-BvqQnNn1.js → vue-ui-quick-chart-CI1n75li.js} +1 -1
- package/dist/{vue-ui-radar-DIdTBEet.js → vue-ui-radar-CD1Ge3r9.js} +1 -1
- package/dist/{vue-ui-rating-CFu9LjID.js → vue-ui-rating-mDoJ2Rkg.js} +1 -1
- package/dist/{vue-ui-relation-circle-5Noti3DC.js → vue-ui-relation-circle-CQPFqgsl.js} +1 -1
- package/dist/{vue-ui-ridgeline-DUrvAa8z.js → vue-ui-ridgeline-C0fxNnYy.js} +1 -1
- package/dist/{vue-ui-rings-B-cJIyAX.js → vue-ui-rings-D2XUhWg-.js} +1 -1
- package/dist/{vue-ui-scatter-DcchOWYi.js → vue-ui-scatter-DgfuFep8.js} +1 -1
- package/dist/{vue-ui-skeleton-DtHam8Oi.js → vue-ui-skeleton-BUMvfDJX.js} +1 -1
- package/dist/{vue-ui-smiley-C8ES41OS.js → vue-ui-smiley-aTCVrK-n.js} +1 -1
- package/dist/{vue-ui-spark-trend-m_ybZFN7.js → vue-ui-spark-trend-B1S6SaGz.js} +1 -1
- package/dist/{vue-ui-sparkbar-CVJo0I__.js → vue-ui-sparkbar-DtGqqvGS.js} +1 -1
- package/dist/{vue-ui-sparkgauge-UXQOQCQ6.js → vue-ui-sparkgauge-yEOfuIEu.js} +1 -1
- package/dist/{vue-ui-sparkhistogram-DVyAev-n.js → vue-ui-sparkhistogram-nM2G2AJx.js} +1 -1
- package/dist/{vue-ui-sparkline-DXJpSvr5.js → vue-ui-sparkline-B7ZZzccR.js} +1 -1
- package/dist/{vue-ui-sparkstackbar-CI7LeTy9.js → vue-ui-sparkstackbar-CTCvV0UA.js} +1 -1
- package/dist/{vue-ui-stackbar-BAdE_agj.js → vue-ui-stackbar-DTlq5Fmr.js} +1 -1
- package/dist/{vue-ui-stackline-CEcCgYrY.js → vue-ui-stackline-DgV0GCOn.js} +1 -1
- package/dist/{vue-ui-strip-plot-D2JTssjF.js → vue-ui-strip-plot-DlIqyn9G.js} +1 -1
- package/dist/{vue-ui-table-CcBJ_hPp.js → vue-ui-table-B1QawDAY.js} +1 -1
- package/dist/{vue-ui-table-heatmap-CwV82zwm.js → vue-ui-table-heatmap-DFjVopuI.js} +1 -1
- package/dist/{vue-ui-table-sparkline-D1OPXi2z.js → vue-ui-table-sparkline-D15wq2iu.js} +1 -1
- package/dist/{vue-ui-thermometer-D2LlLcEV.js → vue-ui-thermometer-gK8M0jyN.js} +1 -1
- package/dist/{vue-ui-timer-Ca8KPZNl.js → vue-ui-timer-Be4jnf30.js} +2 -2
- package/dist/{vue-ui-tiremarks-BsKJi3S0.js → vue-ui-tiremarks-B1PF45Fh.js} +1 -1
- package/dist/{vue-ui-treemap-5HkhmOD4.js → vue-ui-treemap-CProQJII.js} +1 -1
- package/dist/{vue-ui-waffle-2BJYwpwv.js → vue-ui-waffle-C9QBRGRd.js} +1 -1
- package/dist/{vue-ui-wheel-Dr-mMZrH.js → vue-ui-wheel-EBNVnATV.js} +1 -1
- package/dist/{vue-ui-word-cloud-CF_k1x_e.js → vue-ui-word-cloud-D_wT_OgE.js} +1 -1
- package/dist/{vue-ui-world-BuzOXOPx.js → vue-ui-world-CvjzqQPz.js} +1 -1
- package/dist/{vue-ui-xy-Cr5w4DsW.js → vue-ui-xy-B0z97XdU.js} +1 -1
- package/dist/{vue-ui-xy-Cwkavs_B.js → vue-ui-xy-ZTbijg4Q.js} +3 -3
- package/dist/{vue-ui-xy-canvas-DnWzhq9y.js → vue-ui-xy-canvas-QqaK6zlu.js} +1 -1
- package/dist/vue_ui_galaxy-fL8NyfDy.js +1 -0
- package/package.json +14 -14
- package/dist/UserOptions-K1N7zQRx.js +0 -1
- package/dist/package-Dd1ZNT5Q.js +0 -1
- package/dist/vue-data-ui-BmTsLaNH.js +0 -1
- package/dist/vue-ui-galaxy-D91dIUfs.js +0 -1
- package/dist/vue_ui_galaxy-iCWLHLBY.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{t}from"./useNestedProp-
|
|
1
|
+
import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{t}from"./useNestedProp-ri-deXpG.js";import{Jt as n,X as r,t as ee}from"./lib-BaWaqwnJ.js";import{t as i}from"./useConfig-B-AzS3w-.js";import{n as a}from"./PackageVersion-B-1JX0wI.js";import{t as o}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{Teleport as s,computed as c,createBlock as l,createCommentVNode as u,createElementBlock as d,createElementVNode as f,createVNode as te,nextTick as ne,normalizeClass as p,normalizeStyle as re,onBeforeUnmount as m,onMounted as h,openBlock as g,ref as _,toDisplayString as v,unref as y}from"vue";var b=/* @__PURE__ */ e({default:()=>F}),x=[`xmlns`,`height`,`width`],ie={id:`follower`,fy:`30%`,fx:`30%`},ae=[`stop-color`,`stop-opacity`],oe=[`r`,`fill`,`stroke`,`stroke-width`,`stroke-dasharray`],se=[`r`],ce={key:2,class:`wave`},le=[`id`],ue=[`id`],de=[`filter`,`stroke`],S={key:3,class:`crosshair`},C=[`x1`,`stroke`,`stroke-width`,`stroke-dasharray`],w=[`x1`,`stroke`,`stroke-width`,`stroke-dasharray`],T=[`y1`,`stroke`,`stroke-width`,`stroke-dasharray`],E=[`y1`,`stroke`,`stroke-width`,`stroke-dasharray`],D=[`cy`,`r`,`fill`],O=[`cy`,`r`,`fill`],k=[`cx`,`r`,`fill`],A=[`cx`,`r`,`fill`],j={key:5,class:`coordinates`},M=[`x`,`y`,`font-size`,`fill`],N=[`transform`],P=[`font-size`,`fill`],F=/*#__PURE__*/ o({__name:`vue-ui-cursor`,props:{config:{type:Object,default:{}}},setup(e){let{vue_ui_cursor:o}=i(),b=e,F=_(r()),I=c(()=>t({userConfig:b.config,defaultConfig:o})),L=_({x:-100,y:-100}),R=c(()=>Math.round(I.value.centerCircleRadius)),z=c(()=>Math.round(I.value.coordinatesOffset));function B({clientX:e,clientY:t,...n}){L.value.x=e-R.value,L.value.y=t-R.value}function V(e){L.value.x=e.targetTouches[0].clientX-R.value,L.value.y=e.targetTouches[0].clientY-R.value}let H=_(!0);function U(e){H.value=e}let W=_(!1),G=!1,K=()=>U(!0),q=()=>U(!1),J=_(null);function Y(){W.value=!1,J.value&&clearTimeout(J.value),ne(()=>{G||(W.value=!0,J.value=setTimeout(()=>{W.value=!1},1e3))})}let X=_(null),Z=_(null);function Q(){return I.value.parentId?document.getElementById(I.value.parentId):document.getElementsByTagName(`div`)[0]||null}function $(e){e&&(e.addEventListener(`mousemove`,B),e.addEventListener(`touchmove`,V),e.addEventListener(`mouseleave`,q),e.addEventListener(`mouseenter`,K),e.addEventListener(`click`,Y))}function fe(e){e&&(e.removeEventListener(`mousemove`,B),e.removeEventListener(`touchmove`,V),e.removeEventListener(`mouseleave`,q),e.removeEventListener(`mouseenter`,K),e.removeEventListener(`click`,Y))}return h(()=>{let e=Q();if(e){X.value=e,$(e);return}if(!I.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}),m(()=>{G=!0,clearTimeout(J.value),Z.value&&=(Z.value.disconnect(),null),X.value&&=(fe(X.value),null)}),(e,t)=>(g(),l(s,{to:`body`},[H.value?(g(),d(`svg`,{key:0,"data-dom-to-png-ignore":``,xmlns:y(ee),style:re(`z-index: 2147483647; overflow: visible; pointer-events: none;background: transparent; position:fixed; top:${L.value.y}px; left:${L.value.x}px;`),viewBox:`0 0 100 100`,height:R.value*2,width:R.value*2},[te(a),f(`defs`,null,[f(`radialGradient`,ie,[f(`stop`,{offset:`10%`,"stop-color":I.value.bubbleEffectColor,"stop-opacity":I.value.bubbleEffectOpacity},null,8,ae),t[0]||=f(`stop`,{offset:`95%`,"stop-color":`transparent`},null,-1)])]),I.value.showCenterCircle?(g(),d(`circle`,{key:0,cx:50,cy:50,r:R.value,fill:y(n)(I.value.centerCircleColor,I.value.centerCircleOpacity*100),stroke:I.value.centerCircleStroke,"stroke-width":I.value.centerCircleStrokeWidth,"stroke-dasharray":I.value.centerCircleDasharray},null,8,oe)):u(``,!0),I.value.bubbleEffect?(g(),d(`circle`,{key:1,cx:50,cy:50,r:R.value,fill:`url(#follower)`,stroke:`none`},null,8,se)):u(``,!0),I.value.useWaveOnClick?(g(),d(`g`,ce,[f(`defs`,null,[f(`filter`,{id:`blur_${F.value}`,x:`-50%`,y:`-50%`,width:`200%`,height:`200%`},[f(`feGaussianBlur`,{in:`SourceGraphic`,stdDeviation:4,id:`blur_std_${F.value}`},null,8,ue),t[1]||=f(`feColorMatrix`,{type:`saturate`,values:`0`},null,-1)],8,le)]),W.value?(g(),d(`circle`,{key:0,class:p({"circle-wave":W.value}),cx:50,cy:50,r:50,filter:`url(#blur_${F.value})`,stroke:I.value.centerCircleStroke,fill:`none`,"stroke-width":`3`},null,10,de)):u(``,!0)])):u(``,!0),I.value.showCrosshair?(g(),d(`g`,S,[f(`line`,{x1:-R.value+50,x2:-5e3,y1:50,y2:50,stroke:I.value.crosshairStroke,"stroke-width":I.value.crosshairStrokeWidth,"stroke-dasharray":I.value.crosshairDasharray,"stroke-linecap":`round`},null,8,C),f(`line`,{x1:50+R.value,x2:5e3,y1:50,y2:50,stroke:I.value.crosshairStroke,"stroke-width":I.value.crosshairStrokeWidth,"stroke-dasharray":I.value.crosshairDasharray,"stroke-linecap":`round`},null,8,w),f(`line`,{x1:50,x2:50,y1:-R.value+50,y2:-5e3,stroke:I.value.crosshairStroke,"stroke-width":I.value.crosshairStrokeWidth,"stroke-dasharray":I.value.crosshairDasharray,"stroke-linecap":`round`},null,8,T),f(`line`,{x1:50,x2:50,y1:R.value+50,y2:5e3,stroke:I.value.crosshairStroke,"stroke-width":I.value.crosshairStrokeWidth,"stroke-dasharray":I.value.crosshairDasharray,"stroke-linecap":`round`},null,8,E)])):u(``,!0),I.value.showIntersectCircles?(g(),d(`g`,{key:4,class:p({"rotating-circles":I.value.isLoading})},[f(`circle`,{cx:50,cy:R.value+50,r:I.value.intersectCirclesRadius,fill:I.value.intersectCirclesFill},null,8,D),f(`circle`,{cx:50,cy:-R.value+50,r:I.value.intersectCirclesRadius,fill:I.value.intersectCirclesFill},null,8,O),f(`circle`,{cx:-R.value+50,cy:50,r:I.value.intersectCirclesRadius,fill:I.value.intersectCirclesFill},null,8,k),f(`circle`,{cx:R.value+50,cy:50,r:I.value.intersectCirclesRadius,fill:I.value.intersectCirclesFill},null,8,A)],2)):u(``,!0),I.value.showCoordinates?(g(),d(`g`,j,[f(`text`,{"text-anchor":`end`,x:-R.value+50-I.value.coordinatesFontSize/2+z.value,y:50-I.value.coordinatesFontSize/2+z.value,"font-size":I.value.coordinatesFontSize,fill:I.value.coordinatesColor,style:{"font-variant-numeric":`tabular-nums`},"font-family":`Arial`},v(L.value.x.toFixed(0)),9,M),f(`g`,{transform:`translate(${50-I.value.coordinatesFontSize/2+z.value}, ${-R.value+50-I.value.coordinatesFontSize/2+z.value})`},[f(`text`,{"text-anchor":`start`,"font-size":I.value.coordinatesFontSize,fill:I.value.coordinatesColor,style:{"font-variant-numeric":`tabular-nums`},transform:`rotate(-90)`,"font-family":`Arial`},v(L.value.y.toFixed(0)),9,P)],8,N)])):u(``,!0)],12,x)):u(``,!0)]))}},[[`__scopeId`,`data-v-5e16ad76`]]);export{b as n,F 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}from"./annotationViewport-X8fvs7pz.js";import{t as c}from"./resolveChartConfig-0IvbmIE_.js";import{Pt as l,S as u,St as d,X as f,Y as p,at as m,in as h,rt as g,t as ee,tn as te,zt as ne}from"./lib-rPeBMZrn.js";import{t as re}from"./usePanZoom-DlEcNgCv.js";import{n as ie,t as ae}from"./useHints-C-TwxM0Y.js";import{t as oe}from"./useConfig-B8qvYKdK.js";import{t as se}from"./usePrinter-DVf3YcG5.js";import{t as ce}from"./useChartExport-BZts4KFb.js";import{t as le}from"./useUserOptionState-CXlFnwPv.js";import{t as ue}from"./useChartAccessibility-DOMuYJfm.js";import{t as de}from"./useResponsive-CENUxfEL.js";import{t as fe}from"./img-D4RQwASc.js";import{n as pe}from"./Title-BliHuXfT.js";import{t as me}from"./vue_ui_dag-fH3SPZmq.js";import{t as he}from"./BaseScanner-m6QR9rwD.js";import{t as ge}from"./A11yDataTable-DWNlWXzs.js";import{t as _e}from"./BaseZoomControls-D4i_j6vc.js";import{t as ve}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{Fragment as ye,Teleport as be,Transition as xe,computed as _,createBlock as v,createCommentVNode as y,createElementBlock as b,createElementVNode as x,createSlots as Se,createTextVNode as Ce,createVNode as we,defineAsyncComponent as Te,guardReactiveProps as Ee,mergeProps as De,nextTick as Oe,normalizeClass as ke,normalizeProps as Ae,normalizeStyle as je,onBeforeUnmount as Me,onMounted as Ne,openBlock as S,ref as C,renderList as Pe,renderSlot as w,toDisplayString as Fe,unref as T,watch as E,watchEffect as Ie,withCtx as Le,withModifiers as Re}from"vue";var ze=`\0`,Be=`\0`,Ve=``,D=class{_isDirected=!0;_isMultigraph=!1;_isCompound=!1;_label;_defaultNodeLabelFn=()=>void 0;_defaultEdgeLabelFn=()=>void 0;_nodes={};_in={};_preds={};_out={};_sucs={};_edgeObjs={};_edgeLabels={};_nodeCount=0;_edgeCount=0;_parent;_children;constructor(e){e&&(this._isDirected=!Object.hasOwn(e,`directed`)||e.directed,this._isMultigraph=Object.hasOwn(e,`multigraph`)?e.multigraph:!1,this._isCompound=Object.hasOwn(e,`compound`)?e.compound:!1),this._isCompound&&(this._parent={},this._children={},this._children[Be]={})}isDirected(){return this._isDirected}isMultigraph(){return this._isMultigraph}isCompound(){return this._isCompound}setGraph(e){return this._label=e,this}graph(){return this._label}setDefaultNodeLabel(e){return this._defaultNodeLabelFn=e,typeof e!=`function`&&(this._defaultNodeLabelFn=()=>e),this}nodeCount(){return this._nodeCount}nodes(){return Object.keys(this._nodes)}sources(){let e=this;return this.nodes().filter(t=>Object.keys(e._in[t]).length===0)}sinks(){let e=this;return this.nodes().filter(t=>Object.keys(e._out[t]).length===0)}setNodes(e,t){let n=arguments,r=this;return e.forEach(e=>{n.length>1?r.setNode(e,t):r.setNode(e)}),this}setNode(e,t){return Object.hasOwn(this._nodes,e)?(arguments.length>1&&(this._nodes[e]=t),this):(this._nodes[e]=arguments.length>1?t:this._defaultNodeLabelFn(e),this._isCompound&&(this._parent[e]=Be,this._children[e]={},this._children[Be][e]=!0),this._in[e]={},this._preds[e]={},this._out[e]={},this._sucs[e]={},++this._nodeCount,this)}node(e){return this._nodes[e]}hasNode(e){return Object.hasOwn(this._nodes,e)}removeNode(e){let t=this;if(Object.hasOwn(this._nodes,e)){let n=e=>t.removeEdge(t._edgeObjs[e]);delete this._nodes[e],this._isCompound&&(this._removeFromParentsChildList(e),delete this._parent[e],this.children(e).forEach(e=>{t.setParent(e)}),delete this._children[e]),Object.keys(this._in[e]).forEach(n),delete this._in[e],delete this._preds[e],Object.keys(this._out[e]).forEach(n),delete this._out[e],delete this._sucs[e],--this._nodeCount}return this}setParent(e,t){if(!this._isCompound)throw Error(`Cannot set parent in a non-compound graph`);if(t===void 0)t=Be;else{t+=``;for(let n=t;n!==void 0;n=this.parent(n))if(n===e)throw Error(`Setting `+t+` as parent of `+e+` would create a cycle`);this.setNode(t)}return this.setNode(e),this._removeFromParentsChildList(e),this._parent[e]=t,this._children[t][e]=!0,this}_removeFromParentsChildList(e){delete this._children[this._parent[e]][e]}parent(e){if(this._isCompound){let t=this._parent[e];if(t!==Be)return t}}children(e=Be){if(this._isCompound){let t=this._children[e];if(t)return Object.keys(t)}else if(e===Be)return this.nodes();else if(this.hasNode(e))return[]}predecessors(e){let t=this._preds[e];if(t)return Object.keys(t)}successors(e){let t=this._sucs[e];if(t)return Object.keys(t)}neighbors(e){let t=this.predecessors(e);if(t){let n=new Set(t);for(let t of this.successors(e))n.add(t);return Array.from(n.values())}}isLeaf(e){let t;return t=this.isDirected()?this.successors(e):this.neighbors(e),t.length===0}filterNodes(e){let t=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});t.setGraph(this.graph());let n=this;Object.entries(this._nodes).forEach(([n,r])=>{e(n)&&t.setNode(n,r)}),Object.values(this._edgeObjs).forEach(e=>{t.hasNode(e.v)&&t.hasNode(e.w)&&t.setEdge(e,n.edge(e))});let r={};function i(e){let a=n.parent(e);return a===void 0||t.hasNode(a)?(r[e]=a,a):a in r?r[a]:i(a)}return this._isCompound&&t.nodes().forEach(e=>t.setParent(e,i(e))),t}setDefaultEdgeLabel(e){return this._defaultEdgeLabelFn=e,typeof e!=`function`&&(this._defaultEdgeLabelFn=()=>e),this}edgeCount(){return this._edgeCount}edges(){return Object.values(this._edgeObjs)}setPath(e,t){let n=this,r=arguments;return e.reduce((e,i)=>(r.length>1?n.setEdge(e,i,t):n.setEdge(e,i),i)),this}setEdge(){let e,t,n,r,i=!1,a=arguments[0];typeof a==`object`&&a&&`v`in a?(e=a.v,t=a.w,n=a.name,arguments.length===2&&(r=arguments[1],i=!0)):(e=a,t=arguments[1],n=arguments[3],arguments.length>2&&(r=arguments[2],i=!0)),e=``+e,t=``+t,n!==void 0&&(n=``+n);let o=k(this._isDirected,e,t,n);if(Object.hasOwn(this._edgeLabels,o))return i&&(this._edgeLabels[o]=r),this;if(n!==void 0&&!this._isMultigraph)throw Error(`Cannot set a named edge when isMultigraph = false`);this.setNode(e),this.setNode(t),this._edgeLabels[o]=i?r:this._defaultEdgeLabelFn(e,t,n);let s=Ue(this._isDirected,e,t,n);return e=s.v,t=s.w,Object.freeze(s),this._edgeObjs[o]=s,He(this._preds[t],e),He(this._sucs[e],t),this._in[t][o]=s,this._out[e][o]=s,this._edgeCount++,this}edge(e,t,n){let r=arguments.length===1?We(this._isDirected,arguments[0]):k(this._isDirected,e,t,n);return this._edgeLabels[r]}edgeAsObj(){let e=this.edge(...arguments);return typeof e==`object`?e:{label:e}}hasEdge(e,t,n){let r=arguments.length===1?We(this._isDirected,arguments[0]):k(this._isDirected,e,t,n);return Object.hasOwn(this._edgeLabels,r)}removeEdge(e,t,n){let r=arguments.length===1?We(this._isDirected,arguments[0]):k(this._isDirected,e,t,n),i=this._edgeObjs[r];return i&&(e=i.v,t=i.w,delete this._edgeLabels[r],delete this._edgeObjs[r],O(this._preds[t],e),O(this._sucs[e],t),delete this._in[t][r],delete this._out[e][r],this._edgeCount--),this}inEdges(e,t){let n=this._in[e];if(n){let e=Object.values(n);return t?e.filter(e=>e.v===t):e}}outEdges(e,t){let n=this._out[e];if(n){let e=Object.values(n);return t?e.filter(e=>e.w===t):e}}nodeEdges(e,t){let n=this.inEdges(e,t);if(n)return n.concat(this.outEdges(e,t))}};function He(e,t){e[t]?e[t]++:e[t]=1}function O(e,t){--e[t]||delete e[t]}function k(e,t,n,r){let i=``+t,a=``+n;if(!e&&i>a){let e=i;i=a,a=e}return i+Ve+a+Ve+(r===void 0?ze:r)}function Ue(e,t,n,r){let i=``+t,a=``+n;if(!e&&i>a){let e=i;i=a,a=e}let o={v:i,w:a};return r&&(o.name=r),o}function We(e,t){return k(e,t.v,t.w,t.name)}var Ge=class{constructor(){let e={};e._next=e._prev=e,this._sentinel=e}dequeue(){let e=this._sentinel,t=e._prev;if(t!==e)return Ke(t),t}enqueue(e){let t=this._sentinel;e._prev&&e._next&&Ke(e),e._next=t._next,t._next._prev=e,t._next=e,e._prev=t}toString(){let e=[],t=this._sentinel,n=t._prev;for(;n!==t;)e.push(JSON.stringify(n,qe)),n=n._prev;return`[`+e.join(`, `)+`]`}};function Ke(e){e._prev._next=e._next,e._next._prev=e._prev,delete e._next,delete e._prev}function qe(e,t){if(e!==`_next`&&e!==`_prev`)return t}var Je=()=>1;function A(e,t){if(e.nodeCount()<=1)return[];let n=M(e,t||Je);return Ye(n.graph,n.buckets,n.zeroIndex).flatMap(t=>e.outEdges(t.v,t.w))}function Ye(e,t,n){let r=[],i=t[t.length-1],a=t[0],o;for(;e.nodeCount();){for(;o=a.dequeue();)j(e,t,n,o);for(;o=i.dequeue();)j(e,t,n,o);if(e.nodeCount()){for(let i=t.length-2;i>0;--i)if(o=t[i].dequeue(),o){r=r.concat(j(e,t,n,o,!0));break}}}return r}function j(e,t,n,r,i){let a=i?[]:void 0;return e.inEdges(r.v).forEach(r=>{let o=e.edge(r),s=e.node(r.v);i&&a.push({v:r.v,w:r.w}),s.out-=o,Xe(t,n,s)}),e.outEdges(r.v).forEach(r=>{let i=e.edge(r),a=e.node(r.w);a.in-=i,Xe(t,n,a)}),e.removeNode(r.v),a}function M(e,t){let n=new D,r=0,i=0;e.nodes().forEach(e=>{n.setNode(e,{v:e,in:0,out:0})}),e.edges().forEach(e=>{let a=n.edge(e.v,e.w)||0,o=t(e),s=a+o;n.setEdge(e.v,e.w,s),i=Math.max(i,n.node(e.v).out+=o),r=Math.max(r,n.node(e.w).in+=o)});let a=Ze(i+r+3).map(()=>new Ge),o=r+1;return n.nodes().forEach(e=>{Xe(a,o,n.node(e))}),{graph:n,buckets:a,zeroIndex:o}}function Xe(e,t,n){n.out?n.in?e[n.out-n.in+t].enqueue(n):e[e.length-1].enqueue(n):e[0].enqueue(n)}function Ze(e){let t=[];for(let n=0;n<e;n++)t.push(n);return t}function Qe(e,t,n,r){let i=r;for(;e.hasNode(i);)i=ct(r);return n.dummy=t,e.setNode(i,n),i}function N(e){let t=new D().setGraph(e.graph());return e.nodes().forEach(n=>{t.setNode(n,e.node(n))}),e.edges().forEach(n=>{let r=t.edge(n.v,n.w)||{weight:0,minlen:1},i=e.edge(n);t.setEdge(n.v,n.w,{weight:r.weight+i.weight,minlen:Math.max(r.minlen,i.minlen)})}),t}function $e(e){let t=new D({multigraph:e.isMultigraph()}).setGraph(e.graph());return e.nodes().forEach(n=>{e.children(n).length||t.setNode(n,e.node(n))}),e.edges().forEach(n=>{t.setEdge(n,e.edge(n))}),t}function P(e){let t=e.nodes().map(t=>{let n={};return e.outEdges(t).forEach(t=>{n[t.w]=(n[t.w]||0)+e.edge(t).weight}),n});return ut(e.nodes(),t)}function F(e){let t=e.nodes().map(t=>{let n={};return e.inEdges(t).forEach(t=>{n[t.v]=(n[t.v]||0)+e.edge(t).weight}),n});return ut(e.nodes(),t)}function et(e,t){let n=e.x,r=e.y,i=t.x-n,a=t.y-r,o=e.width/2,s=e.height/2;if(!i&&!a)throw Error(`Not possible to find intersection inside of the rectangle`);let c,l;return Math.abs(a)*o>Math.abs(i)*s?(a<0&&(s=-s),c=s*i/a,l=s):(i<0&&(o=-o),c=o,l=o*a/i),{x:n+c,y:r+l}}function I(e){let t=lt(z(e)+1).map(()=>[]);return e.nodes().forEach(n=>{let r=e.node(n),i=r.rank;i!==void 0&&(t[i][r.order]=n)}),t}function L(e){let t=e.nodes().map(t=>{let n=e.node(t).rank;return n===void 0?Number.MAX_VALUE:n}),n=R(Math.min,t);e.nodes().forEach(t=>{let r=e.node(t);Object.hasOwn(r,`rank`)&&(r.rank-=n)})}function tt(e){let t=e.nodes().map(t=>e.node(t).rank).filter(e=>e!==void 0),n=R(Math.min,t),r=[];e.nodes().forEach(t=>{let i=e.node(t).rank-n;r[i]||(r[i]=[]),r[i].push(t)});let i=0,a=e.graph().nodeRankFactor;Array.from(r).forEach((t,n)=>{t===void 0&&n%a!==0?--i:t!==void 0&&i&&t.forEach(t=>{e.node(t).rank+=i})})}function nt(e,t,n,r){let i={width:0,height:0};return arguments.length>=4&&(i.rank=n,i.order=r),Qe(e,`border`,i,t)}var rt=65535;function it(e,t=rt){let n=[];for(let r=0;r<e.length;r+=t){let i=e.slice(r,r+t);n.push(i)}return n}function R(e,t){if(t.length>rt){let n=it(t);return e.apply(null,n.map(t=>e.apply(null,t)))}return e.apply(null,t)}function z(e){let t=e.nodes().map(t=>{let n=e.node(t).rank;return n===void 0?Number.MIN_VALUE:n});return R(Math.max,t)}function at(e,t){let n={lhs:[],rhs:[]};return e.forEach(e=>{t(e)?n.lhs.push(e):n.rhs.push(e)}),n}function ot(e,t){let n=Date.now();try{return t()}finally{console.log(e+` time: `+(Date.now()-n)+`ms`)}}function st(e,t){return t()}var B=0;function ct(e){let t=++B;return e+String(t)}function lt(e,t,n=1){t??(t=e,e=0);let r=e=>e<t;n<0&&(r=e=>t<e);let i=[];for(let t=e;r(t);t+=n)i.push(t);return i}function V(e,t){let n={};for(let r of t)e[r]!==void 0&&(n[r]=e[r]);return n}function H(e,t){let n=t;if(typeof t==`string`){let e=t;n=t=>t[e]}return Object.entries(e).reduce((e,[t,r])=>(e[t]=n(r,t),e),{})}function ut(e,t){return e.reduce((e,n,r)=>(e[n]=t[r],e),{})}var dt={addBorderNode:nt,addDummyNode:Qe,applyWithChunking:R,asNonCompoundGraph:$e,buildLayerMatrix:I,intersectRect:et,mapValues:H,maxRank:z,normalizeRanks:L,notime:st,partition:at,pick:V,predecessorWeights:F,range:lt,removeEmptyRanks:tt,simplify:N,successorWeights:P,time:ot,uniqueId:ct,zipObject:ut};function ft(e){(e.graph().acyclicer===`greedy`?A(e,t(e)):pt(e)).forEach(t=>{let n=e.edge(t);e.removeEdge(t),n.forwardName=t.name,n.reversed=!0,e.setEdge(t.w,t.v,n,ct(`rev`))});function t(e){return t=>e.edge(t).weight}}function U(e){e.edges().forEach(t=>{let n=e.edge(t);if(n.reversed){e.removeEdge(t);let r=n.forwardName;delete n.reversed,delete n.forwardName,e.setEdge(t.w,t.v,n,r)}})}function pt(e){let t=[],n={},r={};function i(a){Object.hasOwn(r,a)||(r[a]=!0,n[a]=!0,e.outEdges(a).forEach(e=>{Object.hasOwn(n,e.w)?t.push(e):i(e.w)}),delete n[a])}return e.nodes().forEach(i),t}function W(e){e.graph().dummyChains=[],e.edges().forEach(t=>mt(e,t))}function mt(e,t){let n=t.v,r=e.node(n).rank,i=t.w,a=e.node(i).rank,o=t.name,s=e.edge(t),c=s.labelRank;if(a===r+1)return;e.removeEdge(t);let l,u,d=0;for(++r;r<a;++d,++r)s.points=[],u={width:0,height:0,edgeLabel:s,edgeObj:t,rank:r},l=Qe(e,`edge`,u,`_d`),r===c&&(u.width=s.width,u.height=s.height,u.dummy=`edge-label`,u.labelpos=s.labelpos),e.setEdge(n,l,{weight:s.weight},o),d===0&&e.graph().dummyChains.push(l),n=l;e.setEdge(n,i,{weight:s.weight},o)}function ht(e){e.graph().dummyChains.forEach(t=>{let n=e.node(t),r=n.edgeLabel;e.setEdge(n.edgeObj,r);let i;for(;n.dummy;)i=e.successors(t)[0],e.removeNode(t),r.points.push({x:n.x,y:n.y}),n.dummy===`edge-label`&&(r.x=n.x,r.y=n.y,r.width=n.width,r.height=n.height),t=i,n=e.node(t)})}function gt(e){function t(n){let r=e.node(n);if(r&&Object.prototype.hasOwnProperty.call(r,`rank`))return r.rank;let i=e.outEdges(n)||[];if(!i.length)return r&&(r.rank=0),0;let a=i.map(n=>e.node(n.w)?t(n.w)-e.edge(n).minlen:1/0),o=R(Math.min,a);return o===1/0&&(o=0),r&&(r.rank=o),o}(e.sources()||[]).forEach(t)}function G(e,t){return e.node(t.w).rank-e.node(t.v).rank-e.edge(t).minlen}function _t(e){vt(e);let t=new D;e.nodes().forEach(e=>{t.setNode(e,{})});let n=e.nodes();if(!n.length)return t;let r=n[0],i=/* @__PURE__ */ new Set([r]);for(;i.size<n.length;){let r=yt(e,i);if(!r){let e=n.find(e=>!i.has(e));i.add(e),t.setNode(e,{});continue}let{edgeObject:a,delta:o,attachFrom:s,attachTo:c}=r;bt(e,i,s,o),t.setEdge(a.v,a.w,{}),i.add(c)}return t}function vt(e){e.nodes().forEach(t=>{let n=e.node(t)||{};Object.prototype.hasOwnProperty.call(n,`rank`)||(n.rank=0,e.setNode(t,n))})}function yt(e,t){let n=null;return e.edges().forEach(r=>{let i=t.has(r.v);if(i===t.has(r.w))return;let a=G(e,r),o=Math.abs(a);if(!n||o<n.absoluteSlack){let e=i?r.v:r.w,t=i?r.w:r.v;n={edgeObject:r,delta:i?a:-a,attachFrom:e,attachTo:t,absoluteSlack:o}}}),n}function bt(e,t,n,r){r&&e.nodes().forEach(n=>{if(!t.has(n)){let t=e.node(n);t.rank+=r}})}function K(e){let t=N(e);return gt(t),t.nodes().forEach(n=>{let r=t.node(n),i=e.node(n)||{};i.rank=r.rank,e.setNode(n,i)}),e}function xt(e,t){}function St(e,t){}function Ct(e,t,n){return 0}function wt(e){return null}function Tt(e,t){return null}K.initLowLimValues=xt,K.initCutValues=St,K.calcCutValue=Ct,K.leaveEdge=wt,K.enterEdge=Tt;var Et=gt;function Dt(e){let t=e.graph().ranker;if(t instanceof Function)return t(e);switch(e.graph().ranker){case`network-simplex`:At(e);break;case`tight-tree`:kt(e);break;case`longest-path`:Ot(e);break;case`none`:break;default:At(e)}}var Ot=Et;function kt(e){Et(e),_t(e)}function At(e){K(e)}function jt(e){let t=Nt(e);e.graph().dummyChains.forEach(n=>{let r=e.node(n),i=r.edgeObj,a=Mt(e,t,i.v,i.w),o=a.path,s=a.lca,c=0,l=o[c],u=!0,d=n;for(;d!==i.w;){if(r=e.node(d),u){for(;(l=o[c])!==s&&e.node(l).maxRank<r.rank;)c++;l===s&&(u=!1)}if(!u){for(;c<o.length-1&&e.node(l=o[c+1]).minRank<=r.rank;)c++;l=o[c]}e.setParent(d,l),d=e.successors(d)[0]}})}function Mt(e,t,n,r){let i=[],a=[],o=Math.min(t[n].low,t[r].low),s=Math.max(t[n].lim,t[r].lim),c,l;c=n;do c=e.parent(c),i.push(c);while(c&&(t[c].low>o||s>t[c].lim));for(l=c,c=r;(c=e.parent(c))!==l;)a.push(c);return{path:i.concat(a.reverse()),lca:l}}function Nt(e){let t={},n=0;function r(i){let a=n;e.children(i).forEach(r),t[i]={low:a,lim:n++}}return e.children().forEach(r),t}function Pt(e){let t=dt.addDummyNode(e,`root`,{},`_root`),n=It(e),r=Object.values(n),i=dt.applyWithChunking(Math.max,r)-1,a=2*i+1;e.graph().nestingRoot=t,e.edges().forEach(t=>{e.edge(t).minlen*=a});let o=q(e)+1;e.children().forEach(r=>{Ft(e,t,a,o,i,n,r)}),e.graph().nodeRankFactor=a}function Ft(e,t,n,r,i,a,o){let s=e.children(o);if(!s.length){o!==t&&e.setEdge(t,o,{weight:0,minlen:n});return}let c=dt.addBorderNode(e,`_bt`),l=dt.addBorderNode(e,`_bb`),u=e.node(o);e.setParent(c,o),u.borderTop=c,e.setParent(l,o),u.borderBottom=l,s.forEach(s=>{Ft(e,t,n,r,i,a,s);let u=e.node(s),d=u.borderTop?u.borderTop:s,f=u.borderBottom?u.borderBottom:s,p=u.borderTop?r:2*r,m=d===f?i-a[o]+1:1;e.setEdge(c,d,{weight:p,minlen:m,nestingEdge:!0}),e.setEdge(f,l,{weight:p,minlen:m,nestingEdge:!0})}),e.parent(o)||e.setEdge(t,c,{weight:0,minlen:i+a[o]})}function It(e){let t={};function n(r,i){let a=e.children(r);a&&a.length&&a.forEach(e=>n(e,i+1)),t[r]=i}return e.children().forEach(e=>n(e,1)),t}function q(e){return e.edges().reduce((t,n)=>t+e.edge(n).weight,0)}function Lt(e){let t=e.graph();e.removeNode(t.nestingRoot),delete t.nestingRoot,e.edges().forEach(t=>{e.edge(t).nestingEdge&&e.removeEdge(t)})}function Rt(e){function t(n){let r=e.children(n),i=e.node(n);if(r.length&&r.forEach(t),Object.hasOwn(i,`minRank`)){i.borderLeft=[],i.borderRight=[];for(let t=i.minRank,r=i.maxRank+1;t<r;++t)J(e,`borderLeft`,`_bl`,n,i,t),J(e,`borderRight`,`_br`,n,i,t)}}e.children().forEach(t)}function J(e,t,n,r,i,a){let o={width:0,height:0,rank:a,borderType:t},s=i[t][a-1],c=Qe(e,`border`,o,n);i[t][a]=c,e.setParent(c,r),s&&e.setEdge(s,c,{weight:1})}function zt(e){let t=e.graph().rankdir.toLowerCase();(t===`lr`||t===`rl`)&&Vt(e)}function Bt(e){let t=e.graph().rankdir.toLowerCase();(t===`bt`||t===`rl`)&&Ht(e),(t===`lr`||t===`rl`)&&(Wt(e),Vt(e))}function Vt(e){e.nodes().forEach(t=>{Y(e.node(t))}),e.edges().forEach(t=>{Y(e.edge(t))})}function Y(e){let t=e.width;e.width=e.height,e.height=t}function Ht(e){e.nodes().forEach(t=>{Ut(e.node(t))}),e.edges().forEach(t=>{let n=e.edge(t);n.points.forEach(Ut),Object.hasOwn(n,`y`)&&Ut(n)})}function Ut(e){e.y=-e.y}function Wt(e){e.nodes().forEach(t=>{Gt(e.node(t))}),e.edges().forEach(t=>{let n=e.edge(t);n.points.forEach(Gt),Object.hasOwn(n,`x`)&&Gt(n)})}function Gt(e){let t=e.x;e.x=e.y,e.y=t}var Kt={adjust:zt,undo:Bt};function qt(e){let t={},n=e.nodes().filter(t=>e.children(t).length===0),r=n.map(t=>e.node(t).rank),i=lt(R(Math.max,r)+1).map(()=>[]);function a(n){if(t[n])return;t[n]=!0;let r=e.node(n);i[r.rank].push(n),e.successors(n).forEach(a)}return n.sort((t,n)=>e.node(t).rank-e.node(n).rank).forEach(a),i}function X(e,t){let n=0;for(let r=1;r<t.length;++r)n+=Jt(e,t[r-1],t[r]);return n}function Jt(e,t,n){let r=ut(n,n.map((e,t)=>t)),i=t.flatMap(t=>e.outEdges(t).map(t=>({pos:r[t.w],weight:e.edge(t).weight})).sort((e,t)=>e.pos-t.pos)),a=1;for(;a<n.length;)a<<=1;let o=2*a-1;--a;let s=Array(o).fill(0),c=0;return i.forEach(e=>{let t=e.pos+a;s[t]+=e.weight;let n=0;for(;t>0;)t%2&&(n+=s[t+1]),t=t-1>>1,s[t]+=e.weight;c+=e.weight*n}),c}function Yt(e,t=[]){return t.map(t=>{let n=e.inEdges(t);if(!n.length)return{v:t};let r=n.reduce((t,n)=>{let r=e.edge(n),i=e.node(n.v);return{sum:t.sum+r.weight*i.order,weight:t.weight+r.weight}},{sum:0,weight:0});return{v:t,barycenter:r.sum/r.weight,weight:r.weight}})}function Xt(e,t){let n={};return e.forEach((e,t)=>{let r=n[e.v]={indegree:0,in:[],out:[],vs:[e.v],i:t};e.barycenter!==void 0&&(r.barycenter=e.barycenter,r.weight=e.weight)}),t.edges().forEach(e=>{let t=n[e.v],r=n[e.w];t!==void 0&&r!==void 0&&(r.indegree++,t.out.push(r))}),Zt(Object.values(n).filter(e=>!e.indegree))}function Zt(e){let t=[];function n(e){return t=>{t.merged||(t.barycenter===void 0||e.barycenter===void 0||t.barycenter>=e.barycenter)&&Qt(e,t)}}function r(t){return n=>{n.in.push(t),--n.indegree===0&&e.push(n)}}for(;e.length;){let i=e.pop();t.push(i),i.in.reverse().forEach(n(i)),i.out.forEach(r(i))}return t.filter(e=>!e.merged).map(e=>V(e,[`vs`,`i`,`barycenter`,`weight`]))}function Qt(e,t){let n=0,r=0;e.weight&&(n+=e.barycenter*e.weight,r+=e.weight),t.weight&&(n+=t.barycenter*t.weight,r+=t.weight),e.vs=t.vs.concat(e.vs),e.barycenter=n/r,e.weight=r,e.i=Math.min(t.i,e.i),t.merged=!0}function Z(e,t){let n=at(e,e=>Object.hasOwn(e,`barycenter`)),r=n.lhs,i=n.rhs.sort((e,t)=>t.i-e.i),a=[],o=0,s=0,c=0;r.sort(en(!!t)),c=$t(a,i,c),r.forEach(e=>{c+=e.vs.length,a.push(e.vs),o+=e.barycenter*e.weight,s+=e.weight,c=$t(a,i,c)});let l={vs:a.flat(!0)};return s&&(l.barycenter=o/s,l.weight=s),l}function $t(e,t,n){let r;for(;t.length&&(r=t[t.length-1]).i<=n;)t.pop(),e.push(r.vs),n++;return n}function en(e){return(t,n)=>t.barycenter<n.barycenter?-1:t.barycenter>n.barycenter?1:e?n.i-t.i:t.i-n.i}function tn(e,t,n,r){let i=e.children(t),a=e.node(t),o=a?a.borderLeft:void 0,s=a?a.borderRight:void 0,c={};o&&(i=i.filter(e=>e!==o&&e!==s));let l=Yt(e,i);l.forEach(t=>{if(e.children(t.v).length){let i=tn(e,t.v,n,r);c[t.v]=i,Object.hasOwn(i,`barycenter`)&&rn(t,i)}});let u=Xt(l,n);nn(u,c);let d=Z(u,r);if(o&&(d.vs=[o,d.vs,s].flat(!0),e.predecessors(o).length)){let t=e.node(e.predecessors(o)[0]),n=e.node(e.predecessors(s)[0]);Object.hasOwn(d,`barycenter`)||(d.barycenter=0,d.weight=0),d.barycenter=(d.barycenter*d.weight+t.order+n.order)/(d.weight+2),d.weight+=2}return d}function nn(e,t){e.forEach(e=>{e.vs=e.vs.flatMap(e=>t[e]?t[e].vs:e)})}function rn(e,t){e.barycenter===void 0?(e.barycenter=t.barycenter,e.weight=t.weight):(e.barycenter=(e.barycenter*e.weight+t.barycenter*t.weight)/(e.weight+t.weight),e.weight+=t.weight)}function an(e,t,n,r){r||=e.nodes();let i=on(e),a=new D({compound:!0}).setGraph({root:i}).setDefaultNodeLabel(t=>e.node(t));return r.forEach(r=>{let o=e.node(r),s=e.parent(r);(o.rank===t||o.minRank<=t&&t<=o.maxRank)&&(a.setNode(r),a.setParent(r,s||i),e[n](r).forEach(t=>{let n=t.v===r?t.w:t.v,i=a.edge(n,r),o=i?i.weight:0;a.setEdge(n,r,{weight:e.edge(t).weight+o})}),Object.hasOwn(o,`minRank`)&&a.setNode(r,{borderLeft:o.borderLeft[t],borderRight:o.borderRight[t]}))}),a}function on(e){let t;for(;e.hasNode(t=ct(`_root`)););return t}function sn(e,t,n){let r={},i;n.forEach(n=>{let a=e.parent(n),o,s;for(;a;){if(o=e.parent(a),o?(s=r[o],r[o]=a):(s=i,i=a),s&&s!==a){t.setEdge(s,a);return}a=o}})}function cn(e,t={}){if(typeof t.customOrder==`function`){t.customOrder(e,cn);return}let n=z(e),r=ln(e,lt(1,n+1),`inEdges`),i=ln(e,lt(n-1,-1,-1),`outEdges`),a=qt(e);if(dn(e,a),t.disableOptimalOrderHeuristic)return;let o=1/0,s,c=t.constraints||[];for(let t=0,n=0;n<4;++t,++n){un(t%2==0?r:i,t%4>=2,c),a=I(e);let l=X(e,a);l<o?(o=l,n=0,s=structuredClone(a)):l===o&&(s=structuredClone(a))}dn(e,s)}function ln(e,t,n){let r=/* @__PURE__ */ new Map;function i(e,t){r.has(e)||r.set(e,[]),r.get(e).push(t)}for(let t of e.nodes()){let n=e.node(t);if(typeof n.rank==`number`&&i(n.rank,t),typeof n.minRank==`number`&&typeof n.maxRank==`number`)for(let e=n.minRank;e<=n.maxRank;e++)e!==n.rank&&i(e,t)}return t.map(t=>an(e,t,n,r.get(t)||[]))}function un(e,t,n){let r=new D;e.forEach(e=>{n.forEach(e=>r.setEdge(e.left,e.right));let i=e.graph().root,a=tn(e,i,r,t);a.vs.forEach((t,n)=>{e.node(t).order=n}),sn(e,r,a.vs)})}function dn(e,t){Object.values(t).forEach(t=>{t.forEach((t,n)=>{e.node(t).order=n})})}function Q(e,t){let n={};function r(t,r){let i=0,a=0,o=t.length,s=r[r.length-1];return r.forEach((t,c)=>{let l=pn(e,t),u=l?e.node(l).order:o;(l||t===s)&&(r.slice(a,c+1).forEach(t=>{e.predecessors(t).forEach(r=>{let a=e.node(r),o=a.order;(o<i||u<o)&&!(a.dummy&&e.node(t).dummy)&&mn(n,r,t)})}),a=c+1,i=u)}),r}return t.length&&t.reduce(r),n}function fn(e,t){let n={};function r(t,r,i,a,o){let s;lt(r,i).forEach(r=>{s=t[r],e.node(s).dummy&&e.predecessors(s).forEach(t=>{let r=e.node(t);r.dummy&&(r.order<a||r.order>o)&&mn(n,t,s)})})}function i(t,n){let i=-1,a,o=0;return n.forEach((s,c)=>{if(e.node(s).dummy===`border`){let t=e.predecessors(s);t.length&&(a=e.node(t[0]).order,r(n,o,c,i,a),o=c,i=a)}r(n,o,n.length,a,t.length)}),n}return t.length&&t.reduce(i),n}function pn(e,t){if(e.node(t).dummy)return e.predecessors(t).find(t=>e.node(t).dummy)}function mn(e,t,n){if(t>n){let e=t;t=n,n=e}let r=e[t];r||(e[t]=r={}),r[n]=!0}function hn(e,t,n){if(t>n){let e=t;t=n,n=e}return!!e[t]&&Object.hasOwn(e[t],n)}function gn(e,t,n,r){let i={},a={},o={};return t.forEach(e=>{e.forEach((e,t)=>{i[e]=e,a[e]=e,o[e]=t})}),t.forEach(e=>{let t=-1;e.forEach(e=>{let s=r(e);if(s.length){s=s.sort((e,t)=>o[e]-o[t]);let r=(s.length-1)/2;for(let c=Math.floor(r),l=Math.ceil(r);c<=l;++c){let r=s[c];a[e]===e&&t<o[r]&&!hn(n,e,r)&&(a[r]=e,a[e]=i[e]=i[r],t=o[r])}}})}),{root:i,align:a}}function _n(e,t,n,r,i){let a={},o=vn(e,t,n,i),s=i?`borderLeft`:`borderRight`;function c(e,t){let n=o.nodes().slice(),r={},i=n.pop();for(;i;){if(r[i])e(i);else{r[i]=!0,n.push(i);for(let e of t(i))n.push(e)}i=n.pop()}}function l(e){a[e]=o.inEdges(e).reduce((e,t)=>Math.max(e,a[t.v]+o.edge(t)),0)}function u(t){let n=o.outEdges(t).reduce((e,t)=>Math.min(e,a[t.w]-o.edge(t)),1/0),r=e.node(t);n!==1/0&&r.borderType!==s&&(a[t]=Math.max(a[t],n))}return c(l,o.predecessors.bind(o)),c(u,o.successors.bind(o)),Object.keys(r).forEach(e=>{a[e]=a[n[e]]}),a}function vn(e,t,n,r){let i=new e.constructor,a=e.graph(),o=Cn(a.nodesep,a.edgesep,r);return t.forEach(t=>{let r;t.forEach(t=>{let a=n[t];if(i.setNode(a),r){let s=n[r],c=i.edge(s,a);i.setEdge(s,a,Math.max(o(e,t,r),c||0))}r=t})}),i}function yn(e,t){return Object.values(t).reduce((t,n)=>{let r=-1/0,i=1/0;Object.entries(n).forEach(([t,n])=>{let a=wn(e,t)/2;r=Math.max(n+a,r),i=Math.min(n-a,i)});let a=r-i;return a<t[0]&&(t=[a,n]),t},[1/0,null])[1]}function bn(e,t){let n=Object.values(t),r=R(Math.min,n),i=R(Math.max,n);[`u`,`d`].forEach(n=>{[`l`,`r`].forEach(a=>{let o=n+a,s=e[o];if(s===t)return;let c=Object.values(s),l=r-R(Math.min,c);a!==`l`&&(l=i-R(Math.max,c)),l&&(s=H(s,e=>e+l),e[o]=s)})})}function xn(e,t){return H(e.ul,(n,r)=>{if(t)return e[t.toLowerCase()][r];let i=Object.values(e).map(e=>e[r]).sort((e,t)=>e-t);return(i[1]+i[2])/2})}function Sn(e){let t=I(e),n=Object.assign(Q(e,t),fn(e,t)),r={},i;return[`u`,`d`].forEach(a=>{i=a===`u`?t:Object.values(t).reverse(),[`l`,`r`].forEach(t=>{let o=i;t===`r`&&(o=o.map(e=>Object.values(e).reverse()));let s=(a===`u`?e.predecessors:e.successors).bind(e),c=gn(e,o,n,s),l=_n(e,o,c.root,c.align,t===`r`);t===`r`&&(l=H(l,e=>-e)),r[a+t]=l})}),bn(r,yn(e,r)),xn(r,e.graph().align)}function Cn(e,t,n){return(r,i,a)=>{let o=r.node(i),s=r.node(a),c=0,l;if(c+=o.width/2,Object.hasOwn(o,`labelpos`))switch(o.labelpos.toLowerCase()){case`l`:l=-o.width/2;break;case`r`:l=o.width/2}if(l&&(c+=n?l:-l),l=0,c+=(o.dummy?t:e)/2,c+=(s.dummy?t:e)/2,c+=s.width/2,Object.hasOwn(s,`labelpos`))switch(s.labelpos.toLowerCase()){case`l`:l=s.width/2;break;case`r`:l=-s.width/2}return l&&(c+=n?l:-l),l=0,c}}function wn(e,t){return e.node(t).width}function Tn(e){let t=$e(e);En(t);let n=Sn(t);Object.entries(n).forEach(([t,n])=>{e.node(t).x=n})}function En(e){let t=I(e),n=e.graph().ranksep,r=0;t.forEach(t=>{let i=t.reduce((t,n)=>{let r=e.node(n).height;return t>r?t:r},0);t.forEach(t=>{e.node(t).y=r+i/2}),r+=i+n})}function Dn(e,t={}){let n=t.debugTiming?ot:st;return n(`layout`,()=>{let r=n(` buildLayoutGraph`,()=>Ln(e));return n(` runLayout`,()=>On(r,n,t)),n(` updateInputGraph`,()=>$(e,r)),r})}function On(e,t,n){t(` makeSpaceForEdgeLabels`,()=>Rn(e)),t(` removeSelfEdges`,()=>Jn(e)),t(` acyclic`,()=>ft(e)),t(` nestingGraph.run`,()=>Pt(e)),t(` rank`,()=>Dt($e(e))),t(` injectEdgeLabelProxies`,()=>zn(e)),t(` removeEmptyRanks`,()=>tt(e)),t(` nestingGraph.cleanup`,()=>Lt(e)),t(` normalizeRanks`,()=>L(e)),t(` assignRankMinMax`,()=>Bn(e)),t(` removeEdgeLabelProxies`,()=>Vn(e)),t(` normalize.run`,()=>W(e)),t(` parentDummyChains`,()=>jt(e)),t(` addBorderSegments`,()=>Rt(e)),t(` order`,()=>cn(e,n)),t(` insertSelfEdges`,()=>Yn(e)),t(` adjustCoordinateSystem`,()=>Kt.adjust(e)),t(` position`,()=>Tn(e)),t(` positionSelfEdges`,()=>Xn(e)),t(` removeBorderNodes`,()=>qn(e)),t(` normalize.undo`,()=>ht(e)),t(` fixupEdgeLabelCoords`,()=>Gn(e)),t(` undoCoordinateSystem`,()=>Kt.undo(e)),t(` translateGraph`,()=>Hn(e)),t(` assignNodeIntersects`,()=>Wn(e)),t(` reversePoints`,()=>Kn(e)),t(` acyclic.undo`,()=>U(e))}function $(e,t){e.nodes().forEach(n=>{let r=e.node(n),i=t.node(n);r&&(r.x=i.x,r.y=i.y,r.order=i.order,r.rank=i.rank,t.children(n).length&&(r.width=i.width,r.height=i.height))}),e.edges().forEach(n=>{let r=e.edge(n),i=t.edge(n);r.points=i.points,Object.hasOwn(i,`x`)&&(r.x=i.x,r.y=i.y)});let n=t.graph(),r=e.graph();r.width=n.width,r.height=n.height}var kn=[`nodesep`,`edgesep`,`ranksep`,`marginx`,`marginy`],An={ranksep:50,edgesep:20,nodesep:50,rankdir:`tb`},jn=[`acyclicer`,`ranker`,`rankdir`,`align`],Mn=[`width`,`height`,`rank`],Nn={width:0,height:0},Pn=[`minlen`,`weight`,`width`,`height`,`labeloffset`],Fn={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:`r`},In=[`labelpos`,`arrowshape`];function Ln(e){let t=Qn(e.graph()),n={...An,...Zn(t,kn),...V(t,jn)},r=new D({multigraph:!0,compound:!0});return r.setGraph(n),e.nodes().forEach(t=>{let n=Zn(Qn(e.node(t)),Mn);Object.keys(Nn).forEach(e=>{n[e]===void 0&&(n[e]=Nn[e])}),r.setNode(t,n),r.setParent(t,e.parent(t))}),e.edges().forEach(t=>{let n=Qn(e.edge(t));r.setEdge(t,{...Fn,...Zn(n,Pn),...V(n,In)})}),r}function Rn(e){let t=e.graph();t.ranksep/=2,e.edges().forEach(n=>{let r=e.edge(n);r.minlen*=2,r.labelpos.toLowerCase()!==`c`&&(t.rankdir===`TB`||t.rankdir===`BT`?r.width+=r.labeloffset:r.height+=r.labeloffset)})}function zn(e){e.edges().forEach(t=>{let n=e.edge(t);if(n.width&&n.height){let n=e.node(t.v);Qe(e,`edge-proxy`,{rank:(e.node(t.w).rank-n.rank)/2+n.rank,e:t},`_ep`)}})}function Bn(e){let t=0;e.nodes().forEach(n=>{let r=e.node(n);r.borderTop&&(r.minRank=e.node(r.borderTop).rank,r.maxRank=e.node(r.borderBottom).rank,t=Math.max(t,r.maxRank))}),e.graph().maxRank=t}function Vn(e){e.nodes().forEach(t=>{let n=e.node(t);n.dummy===`edge-proxy`&&(e.edge(n.e).labelRank=n.rank,e.removeNode(t))})}function Hn(e){let t=1/0,n=0,r=1/0,i=0,a=e.graph(),o=a.marginx||0,s=a.marginy||0;function c(e){let a=e.x,o=e.y,s=e.width,c=e.height;t=Math.min(t,a-s/2),n=Math.max(n,a+s/2),r=Math.min(r,o-c/2),i=Math.max(i,o+c/2)}e.nodes().forEach(t=>c(e.node(t))),e.edges().forEach(t=>{let n=e.edge(t);Object.hasOwn(n,`x`)&&c(n)}),t-=o,r-=s,e.nodes().forEach(n=>{let i=e.node(n);i.x-=t,i.y-=r}),e.edges().forEach(n=>{let i=e.edge(n);i.points.forEach(e=>{e.x-=t,e.y-=r}),Object.hasOwn(i,`x`)&&(i.x-=t),Object.hasOwn(i,`y`)&&(i.y-=r)}),a.width=n-t+o,a.height=i-r+s}function Un(e,t,n){if(!n||!t)return e;let r=t.x-e.x,i=t.y-e.y,a=Math.sqrt(r*r+i*i);if(!a||a<=n)return e;let o=n/a;return{x:e.x+r*o,y:e.y+i*o}}function Wn(e){e.edges().forEach(t=>{let n=e.edge(t),r=e.node(t.v),i=e.node(t.w),a,o;!n.points||!n.points.length?(n.points=[],a=i,o=r):(a=n.points[0],o=n.points[n.points.length-1]);let s=et(r,a),c=et(i,o),l=n.points.length?n.points[0]:a,u=n.points.length?n.points[n.points.length-1]:o,d=n.arrowshape,f=d===`normal`||d===`vee`,p=!!n.reversed,m=s,h=c;f&&(p?m=Un(s,l,4):h=Un(c,u,4)),n.points.unshift(m),n.points.push(h)})}function Gn(e){e.edges().forEach(t=>{let n=e.edge(t);if(Object.hasOwn(n,`x`))switch((n.labelpos===`l`||n.labelpos===`r`)&&(n.width-=n.labeloffset),n.labelpos){case`l`:n.x-=n.width/2+n.labeloffset;break;case`r`:n.x+=n.width/2+n.labeloffset}})}function Kn(e){e.edges().forEach(t=>{let n=e.edge(t);n.reversed&&n.points.reverse()})}function qn(e){e.nodes().forEach(t=>{if(e.children(t).length){let n=e.node(t),r=e.node(n.borderTop),i=e.node(n.borderBottom),a=e.node(n.borderLeft[n.borderLeft.length-1]),o=e.node(n.borderRight[n.borderRight.length-1]);n.width=Math.abs(o.x-a.x),n.height=Math.abs(i.y-r.y),n.x=a.x+n.width/2,n.y=r.y+n.height/2}}),e.nodes().forEach(t=>{e.node(t).dummy===`border`&&e.removeNode(t)})}function Jn(e){e.edges().forEach(t=>{if(t.v===t.w){let n=e.node(t.v);n.selfEdges||=[],n.selfEdges.push({e:t,label:e.edge(t)}),e.removeEdge(t)}})}function Yn(e){I(e).forEach(t=>{let n=0;t.forEach((t,r)=>{let i=e.node(t);i.order=r+n,(i.selfEdges||[]).forEach(t=>{Qe(e,`selfedge`,{width:t.label.width,height:t.label.height,rank:i.rank,order:r+ ++n,e:t.e,label:t.label},`_se`)}),delete i.selfEdges})})}function Xn(e){e.nodes().forEach(t=>{let n=e.node(t);if(n.dummy===`selfedge`){let r=e.node(n.e.v),i=r.x+r.width/2,a=r.y,o=n.x-i,s=r.height/2;e.setEdge(n.e,n.label),e.removeNode(t),n.label.points=[{x:i+2*o/3,y:a-s},{x:i+5*o/6,y:a-s},{x:i+o,y:a},{x:i+5*o/6,y:a+s},{x:i+2*o/3,y:a+s}],n.label.x=n.x,n.label.y=n.y}})}function Zn(e,t){return H(V(e,t),Number)}function Qn(e){let t={};return e&&Object.entries(e).forEach(([e,n])=>{let r=e;typeof r==`string`&&(r=r.toLowerCase()),t[r]=n}),t}var $n={rankDirection:`TB`,nodeSeparation:50,rankSeparation:50,edgeSeparation:10,align:void 0,nodeWidth:100,nodeHeight:40,curvedEdges:!1,padding:20,arrowShape:`normal`,arrowSize:10};function er(e){return e.length?e.map((e,t)=>`${t===0?`M`:`L`} ${e.x} ${e.y}`).join(` `):``}function tr(e){if(!e.length)return``;if(e.length===1){let t=e[0];return`M ${t.x} ${t.y}`}if(e.length===2)return`M ${e[0].x} ${e[0].y} L ${e[1].x} ${e[1].y}`;let[t]=e,n=`M ${t.x} ${t.y}`;for(let t=1;t<e.length-1;t+=1){let r=e[t],i=e[t+1],a=r.x,o=r.y,s=(r.x+i.x)/2,c=(r.y+i.y)/2;n+=` Q ${a} ${o} ${s} ${c}`}let r=e[e.length-1];return n+=` L ${r.x} ${r.y}`,n}function nr(e){let{nodes:t,edges:n,configuration:r}=e,i=C(null),a=C(null),o=`dag-arrow-${f()}`;function s(e,t,n){a.value=null,i.value=null;let r={...$n,...n},s=new D({multigraph:!0,compound:!0});s.setGraph({rankdir:r.rankDirection,nodesep:r.nodeSeparation,ranksep:r.rankSeparation,edgesep:r.edgeSeparation,align:r.align}),e.forEach(e=>{s.setNode(e.id,{label:e.label,width:e.width??r.nodeWidth,height:e.height??r.nodeHeight})}),t.forEach(e=>{s.setEdge(e.from,e.to,{weight:e.weight??1,minlen:e.minLength??1,arrowShape:r.arrowShape??`normal`})}),Dn(s);let c=e.map(e=>{let t=s.node(e.id);return{id:e.id,label:e.label,x:t.x,y:t.y,width:t.width,height:t.height,original:e}}),l=s.edges().map(e=>{let n=s.edge(e),i=n.points||[];if(!i.length)return null;let a=r.curvedEdges?tr(i):er(i),c=r.arrowShape===`undirected`?null:`url(#${o})`,l=t.find(t=>t?.from===e.v&&t?.to===e.w);return{id:`${o}-${Array.from(JSON.stringify([e.v,e.w]),e=>e.codePointAt(0).toString(16)).join(`_`)}`,from:e.v,to:e.w,points:i,pathData:a,markerEnd:c,original:{...l,...n}}}).filter(Boolean),u=r.padding;if(!c.length){i.value={nodes:[],edges:l,viewBox:`0 0 0 0`,arrowShape:r.arrowShape,arrowSize:r.arrowSize};return}let f=c.flatMap(e=>[e.x-e.width/2,e.x+e.width/2]),p=c.flatMap(e=>[e.y-e.height/2,e.y+e.height/2]),m=Math.min(...f)-u,h=Math.max(...f)+u,g=Math.min(...p)-u,ee=Math.max(...p)+u;i.value={nodes:c,edges:l.map(e=>({...e,midpoint:e.pathData?d(e.pathData):{x:0,y:0}})),viewBox:`${m} ${g} ${h-m} ${ee-g}`,arrowShape:r.arrowShape,arrowSize:r.arrowSize}}return Ie(()=>{try{s(T(t)||[],T(n)||[],T(r)||{})}catch(e){console.error(`[useDag] layout error:`,e),a.value=e,i.value=null}}),{layoutData:i,lastError:a,arrowMarkerIdentifier:o,recomputeLayout:()=>{s(T(t)||[],T(n)||[],T(r)||{})}}}var rr=/* @__PURE__ */ e({default:()=>Ir}),ir=[`id`],ar=[`id`],or={key:1,class:`dag-chart-error`},sr={style:{position:`relative`}},cr=[`viewBox`,`xmlns`,`aria-describedby`],lr={key:0},ur=[`id`,`width`,`height`],dr=[`cx`,`cy`,`r`,`fill`],fr=[`x`,`y`,`width`,`height`,`fill`],pr={key:2},mr=[`id`,`markerWidth`,`markerHeight`,`refX`,`refY`],hr=[`d`,`fill`,`stroke`],gr={class:`vue-ui-dag-edges`},_r=[`data-a11y-midpoint-id`,`aria-label`,`onMouseenter`],vr={class:`vue-ui-dag-nodes`},yr=[`onClick`,`onMouseenter`,`onMouseleave`],br=[`data-a11y-node-id`,`aria-label`],xr=[`x`,`y`,`width`,`height`],Sr={class:`vue-ui-dag-edges`},Cr=[`d`,`stroke-width`,`marker-end`],wr={class:`vue-ui-dag-node-labels`},Tr=[`onClick`,`onMouseenter`,`onMouseleave`],Er=[`x`,`y`,`font-size`,`fill`,`font-weight`],Dr=[`x`,`y`,`font-size`,`fill`,`font-weight`,`innerHTML`],Or={key:1},kr={key:1,style:{position:`absolute`,top:`100%`,left:`0`,width:`100%`},"data-dom-to-png-ignore":``,"aria-hidden":`true`},Ar={key:6,class:`vue-data-ui-watermark`},jr=[`data-position`],Mr={key:0},Nr=[`data-position`],Pr={key:0},Fr=1.5,Ir=/*#__PURE__*/ ve({__name:`vue-ui-dag`,props:{dataset:{type:Object,default(){return{nodes:[],edges:[]}}},config:{type:Object,default(){return{}}}},emits:[`onNodeClick`,`onMidpointEnter`,`onMidpointLeave`,`copyAlt`,`rotate`],setup(e,{expose:d,emit:ve}){let Ie=Te(()=>import(`./PenAndPaper-BV5ODysA.js`).then(e=>e.t)),ze=Te(()=>import(`./UserOptions-K1N7zQRx.js`).then(e=>e.n)),Be=Te(()=>import(`./PackageVersion-DAF5ApGl.js`).then(e=>e.t)),{vue_ui_dag:Ve}=oe(),D=e,He=ve,O=C(null),k=C(f()),Ue=C(null),We=C(null),Ge=C(null),Ke=C(0),qe=C(0),Je=null,A=null,Ye=!1,j=C(null),M=C(null),Xe=C(!1),Ze=_(yt),Qe=_(()=>{let e=D.dataset;if(!Array.isArray(e?.nodes)||!e.nodes.length||e.edges!=null&&!Array.isArray(e.edges))return!1;let t=/* @__PURE__ */ new Set;for(let n of e.nodes){if(n?.id==null||![`string`,`number`].includes(typeof n.id)||typeof n.id==`number`&&!Number.isFinite(n.id)||t.has(String(n.id)))return!1;t.add(String(n.id))}return(e.edges||[]).every(e=>e&&e.from!=null&&e.to!=null&&t.has(String(e.from))&&t.has(String(e.to)))}),N=_(()=>!!Ze.value.loading||!Qe.value),$e=_(()=>h({defaultConfig:{userOptions:{show:!1},style:{chart:{backgroundColor:`#99999930`,nodes:{stroke:`#CCCCCC`,backgroundColor:`#DDDDDD50`},edges:{stroke:`#CCCCCC`},midpoints:{stroke:`#CCCCCC`,fill:`#CCCCCC`}}}},userConfig:Ze.value.skeletonConfig??{}})),P=_(()=>N.value?h({defaultConfig:Ze.value,userConfig:$e.value}):Ze.value),F=_(()=>P.value.style.chart.nodes),et=_(()=>P.value.style.chart.edges),I=_(()=>P.value.style.chart.midpoints),L=_(()=>P.value.style.chart),tt=_(()=>P.value.userOptions.useCursorPointer),nt=C(P.value.style.chart.width),rt=C(P.value.style.chart.height),it=C({x:0,y:0}),R=C(null),z=_(()=>Rt.value.get(R.value)??null),at=C(null),ot=C({left:`0px`,top:`0px`}),st=C(`top`),B=C(!1),ct=C({x:0,y:0}),lt=C({x:0,y:0}),V=C(null),H=_(()=>J(V.value)),ut=C(null),dt=C({left:`0px`,top:`0px`}),ft=C(`top`),U=C(!1),pt=C(!1),{svgRef:W}=ue({config:L.value.title}),{userOptionsVisible:mt,setUserOptionsVisibility:ht,keepUserOptionState:gt}=le({config:P.value}),G=C(P.value.style.chart.layout.rankDirection),_t={nodes:[{id:`A`,label:``},{id:`B`,label:``},{id:`C`,label:``}],edges:[{from:`A`,to:`B`},{from:`A`,to:`C`}]},vt=_(()=>N.value?D.config?.skeletonDataset??_t:D.dataset);ie({config:()=>P.value,dataset:()=>D.dataset,component:`VueUiDag`,rules:[ae.noHint]});function yt(){return c(D.config,Ve,me)}let bt=_(()=>Ze.value.debug);E([()=>D.dataset,bt],([e,t])=>{t&&(ne(e)&&m({componentName:`VueUiDag`,type:`dataset`}),!Array.isArray(e?.nodes)||!e.nodes.length?m({componentName:`VueUiDag`,type:`datasetAttributeEmpty`,property:`nodes`,index:0}):Qe.value||console.warn(`VueUiDag: provide unique node IDs and an edges array whose endpoints reference existing nodes.`))},{deep:!0,immediate:!0}),Ne(yn),E(()=>D.config,()=>{mt.value=!P.value.userOptions.showOnChartHover,Ke.value+=1},{deep:!0}),E(()=>Ze.value.style.chart.layout.rankDirection,e=>{G.value=e}),E(()=>Ze.value.style.chart.zoom.active,e=>{Bt.value=e}),E(()=>P.value.responsive,yn,{flush:`post`}),E(L,()=>{P.value.responsive?vn():(nt.value=L.value.width,rt.value=L.value.height)},{deep:!0,flush:`post`});let{isPrinting:K,isImaging:xt,generatePdf:St,generateImage:Ct}=se({elementId:`dag_${k.value}`,fileName:L.value.title.text||`vue-ui-dag`,options:P.value.userOptions.print}),wt=_(()=>L.value.backgroundColor),Tt=_(()=>L.value.title),{isCallbackImaging:Et,isCallbackSvg:Dt,generateSvg:Ot,onGenerateImage:kt}=ce({svg:W,title:Tt,legend:null,legendItems:null,backgroundColor:wt,getSvgCallback:()=>P.value.userOptions.callbacks.svg,generateImage:Ct});function At(){ht(!0)}function jt(){ht(!1)}function Mt({tooltipRef:e,isVisibleRef:t,anchorRef:n,styleRef:r,placementRef:i,offsetRef:a,margin:o=24}){return function(){let s=e.value;if(!s||!t.value)return;let c=s.getBoundingClientRect(),l=window.innerWidth,u=window.innerHeight,d=n.value.x,f=n.value.y,p=a?.value?.x??0,m=a?.value?.y??0,h=f-m-c.height-o,g=d-c.width/2,ee=`top`;if(h<o){let e=f+m+o;e+c.height<=u-o?(h=e,ee=`bottom`):(h=f-c.height/2,h<o&&(h=o),h+c.height>u-o&&(h=u-c.height-o),ee=`center`)}g<o&&(g=o),g+c.width>l-o&&(g=l-c.width-o);let te=g<=o,ne=g+c.width>=l-o;if((te||ne)&&ee!==`center`){let e,t,n=d-p-o;l-(d+p)-o>=n?(e=`right`,t=d+p+o):(e=`left`,t=d-p-o-c.width),t>=o&&t+c.width<=l-o&&(g=t,h=f-c.height/2,h<o&&(h=o),h+c.height>u-o&&(h=u-c.height-o),ee=e)}i.value=ee,r.value={left:`${g}px`,top:`${h}px`}}}function Nt(e,t){return e&&JSON.stringify(e)===JSON.stringify(t)?e:t}let{layoutData:Pt,lastError:Ft,arrowMarkerIdentifier:It}=nr({nodes:_(e=>Nt(e,(vt.value.nodes||[]).map(e=>({id:e.id,width:e.width,height:e.height})))),edges:_(e=>Nt(e,(vt.value.edges||[]).map(e=>({from:e.from,to:e.to,...e.weight===void 0?{}:{weight:e.weight},...e.minLength===void 0?{}:{minLength:e.minLength}})))),configuration:_(e=>Nt(e,{...L.value.layout,rankDirection:G.value}))}),q=_(()=>{if(!Pt.value)return null;let e=new Map((vt.value.nodes||[]).map(e=>[String(e.id),e])),t=/* @__PURE__ */ new Map;for(let e of vt.value.edges||[]){let n=JSON.stringify([String(e.from),String(e.to)]);t.has(n)||t.set(n,e)}return{...Pt.value,nodes:Pt.value.nodes.map(t=>{let n=e.get(String(t.id))??t.original;return{...t,label:n.label,original:{...n,backgroundColor:n.backgroundColor?u(n.backgroundColor):F.value.backgroundColor,color:n.color?u(n.color):F.value.labels.color}}}),edges:Pt.value.edges.map(e=>({...e,original:{...t.get(JSON.stringify([e.from,e.to])),...e.original}}))}}),Lt=_(()=>new Map((q.value?.nodes||[]).map(e=>[String(e.id),e]))),Rt=_(()=>new Map((q.value?.edges||[]).map(e=>[e.id,e])));function J(e){return e==null?null:Lt.value.get(String(e))??null}let zt=_(()=>{let e=nt.value,t=rt.value,n=Number(e),r=Number(t),i=Number.isFinite(n)&&n>0,a=Number.isFinite(r)&&r>0;return!i&&!a?null:{width:i?n:null,height:a?r:null}}),Bt=C(L.value.zoom.active),Vt=_(()=>Bt.value&&!pt.value),{viewBox:Y,resetZoom:Ht,setInitialViewBox:Ut,scale:Wt,zoomByFactor:Gt}=re(W,{x:0,y:0,width:100,height:100},1,Vt,()=>{X(),pn(),Q()}),Kt=null,qt=0;function X(){qt+=1,Kt!==null&&cancelAnimationFrame(Kt),Kt=null}function Jt(e=!1){X(),Ht(e)}async function Yt(e,{smooth:t=!0,duration:n=300,zoomReset:r=!1,zoom:i=null}={}){let a=J(e);if(Ye||!a)return!1;let o=Y.value;if(!o)return!1;let s={x:Number(o.x),y:Number(o.y),width:Number(o.width),height:Number(o.height)},c=Wt.value,u=s.width,d=s.height,f=c;if(Number.isFinite(i)&&i>0||r){Jt(!1);let e=Y.value,t=Number.isFinite(i)&&i>0?i/100:1;u=Number(e.width)/t,d=Number(e.height)/t,f=t,Y.value={...s},Wt.value=c}let p=Number(a.x),m=Number(a.y);if(!Number.isFinite(s.x)||!Number.isFinite(s.y)||!Number.isFinite(s.width)||!Number.isFinite(s.height)||!Number.isFinite(u)||!Number.isFinite(d)||!Number.isFinite(p)||!Number.isFinite(m))return!1;let h={x:p-u/2,y:m-d/2,width:u,height:d};X();let ee=qt;if(B.value=!1,!t||!Number.isFinite(n)||n<=0)return Y.value=h,Wt.value=f,!0;let te=performance.now();function ne(e){if(Ye||ee!==qt)return;let t=Math.min((e-te)/n,1),r=g(t);Y.value={x:l(s.x,h.x,r),y:l(s.y,h.y,r),width:l(s.width,h.width,r),height:l(s.height,h.height,r)},Wt.value=l(c,f,r),t<1?Kt=requestAnimationFrame(ne):(Y.value=h,Wt.value=f,Kt=null)}return Kt=requestAnimationFrame(ne),!0}E(Pt,X);function Xt(){Bt.value=!Bt.value}function Zt(){let e=q.value&&q.value.viewBox;if(!e)return;let t=String(e).split(` `).map(Number);if(t.length!==4)return;let[n,r,i,a]=t;if(!Number.isFinite(n)||!Number.isFinite(r)||!Number.isFinite(i)||!Number.isFinite(a))return;let o=i,s=a,c=n,l=r,u=zt.value;u&&(u.width!==null&&(o=u.width),u.height!==null&&(s=u.height),c=n-(o-i)/2,l=r-(s-a)/2),Ut({x:c,y:l,width:o,height:s},{overwriteCurrentIfNotZoomed:!0})}E(()=>q.value&&q.value.viewBox,()=>{Zt()},{immediate:!0}),E(()=>zt.value,()=>{Zt()});let Qt=_(()=>{let e=Y.value;return e?`${e.x} ${e.y} ${e.width} ${e.height}`:`0 0 0 0`}),Z=C(!1),$t=C({width:0,height:0});E([W,Z,()=>L.value.backgroundPattern.show],([e,t,n],r,i)=>{if(!e||!t||!n)return;let a=()=>{let{width:t,height:n}=e.getBoundingClientRect();(t!==$t.value.width||n!==$t.value.height)&&($t.value={width:t,height:n})};a();let o=new ResizeObserver(a);o.observe(e),i(()=>o.disconnect())},{flush:`post`});let en=_(()=>{let e=Y.value;if(!e||!Z.value)return e;let{width:t,height:n}=$t.value;if(!(t>0&&n>0&&e.width>0&&e.height>0))return e;let r=Math.min(t/e.width,n/e.height),i=t/r,a=n/r;return{x:e.x-(i-e.width)/2,y:e.y-(a-e.height)/2,width:i,height:a}});function tn(e){Z.value=e,qe.value+=1}function nn(){pt.value=!pt.value}function rn(){X(),Gt(Fr,!0)}function an(){X(),Gt(1/Fr,!0)}let on=[`TB`,`RL`,`BT`,`LR`];function sn(){G.value=on[(on.indexOf(G.value)+1)%on.length],Jt(),He(`rotate`,G.value)}let cn=Mt({tooltipRef:at,isVisibleRef:U,anchorRef:it,styleRef:ot,placementRef:st}),ln=Mt({tooltipRef:ut,isVisibleRef:B,anchorRef:ct,styleRef:dt,placementRef:ft,offsetRef:lt}),un=C(null);async function dn(e){He(`onMidpointEnter`,e),e?.midpoint&&W.value&&(R.value=e.id,U.value=!0,I.value.selectedEdge.animated===!0&&(un.value=e.id),await Oe(),mn())}function Q(){U.value=!1,R.value=null,He(`onMidpointLeave`),I.value.selectedEdge.animated===!0&&(un.value=null)}async function fn(e){He(`onNodeClick`,e),F.value.tooltip.showOnClick&&W.value&&(V.value=e.id,B.value=!0,await Oe(),mn())}function pn(){B.value=!1,V.value=null}function mn(){if(Ye)return;let e=W.value;if(e){if(U.value&&z.value?.midpoint){let t=z.value.midpoint,n=te(t.x,t.y,e);n&&(it.value=n),cn()}if(B.value&&H.value){let t=H.value,n=te(t.x,t.y,e);n&&(ct.value=n);let r=e.getScreenCTM?.();r&&(lt.value={x:t.width*Math.hypot(r.a,r.b||0)/2,y:t.height*Math.hypot(r.c||0,r.d)/2}),ln()}}}E([q,Y,N],()=>{B.value&&(N.value||!F.value.tooltip.showOnClick||V.value!=null&&!H.value)&&pn(),U.value&&(N.value||!I.value.show||R.value!=null&&!z.value)&&Q(),j.value!=null&&!qn.value.some(e=>e.id===j.value&&e.type===M.value)&&$n(),mn()},{deep:!0,flush:`post`});function hn(e){if(!(B.value||U.value))return;let t=ut.value;if(t&&t.contains(e.target))return;let n=at.value;if(n&&n.contains(e.target))return;let r=W.value;if(r&&r.contains(e.target)){let t=e.target.closest(`.vue-ui-dag-node`),n=e.target.closest(`.vue-ui-dag-edge-midpoint`);if(t||n)return}pn(),Q(),Xe.value||$n()}function gn(e){e.key===`Escape`&&(B.value&&pn(),U.value&&Q())}Ne(()=>{document.addEventListener(`mousedown`,hn),document.addEventListener(`keydown`,gn),window.addEventListener(`scroll`,mn,!0),window.addEventListener(`resize`,mn)}),Me(()=>{Ye=!0,document.removeEventListener(`mousedown`,hn),document.removeEventListener(`keydown`,gn),window.removeEventListener(`scroll`,mn,!0),window.removeEventListener(`resize`,mn),Je?.disconnect(),A!==null&&cancelAnimationFrame(A),X(),clearTimeout(kn)});function _n(){if(A=null,Ye||!P.value.responsive||!O.value?.parentNode)return;let{width:e,height:t}=de({chart:O.value,title:L.value.title.text?Ue.value:null,legend:L.value.controls.show?Ge.value?.$el:null,source:We.value});nt.value=Math.max(.1,e),rt.value=Math.max(.1,t-12)}function vn(){!Ye&&P.value.responsive&&A===null&&(A=requestAnimationFrame(_n))}function yn(){Je?.disconnect(),Je=null,A!==null&&cancelAnimationFrame(A),A=null,Ye||(P.value.responsive?O.value?.parentNode&&(Je=new ResizeObserver(vn),Je.observe(O.value.parentNode),vn()):(nt.value=L.value.width,rt.value=L.value.height))}function bn(e,{direction:t=-1,dasharray:n}={}){if(!e||typeof e.getTotalLength!=`function`)return bt.value&&console.warn(`VueUiDag @getIdealDashoffsetDelta: invalid path element`,e),0;let r=e.getTotalLength(),i=String(n??``).trim().split(/[\s,]+/).map(e=>Number.parseFloat(e)).filter(Number.isFinite),a=i.reduce((e,t)=>e+t,0)*(i.length%2?2:1);return t*(a>0&&Number.isFinite(a)?Math.max(1,Math.round(r/a))*a:r)}let xn=C(/* @__PURE__ */ new Map),Sn=C(/* @__PURE__ */ new Map);function Cn(e){return function(t){t?xn.value.set(e,t):xn.value.delete(e)}}function wn(){Sn.value.forEach(e=>{try{e.cancel()}catch{}}),Sn.value.clear()}function Tn(){if(wn(),Ye)return;let e=q.value?.edges??[];if(!e.length)return;let t=et.value.animations,n=Number(t.referenceDistance)>0?Number(t.referenceDistance):24;e.forEach(e=>{let r=Fn.value.get(e.id)?.animated,i=xn.value.get(e.id);if(!i||typeof i.animate!=`function`)return;if(!r){i.style.strokeDasharray=`0`,i.style.strokeDashoffset=`0`;return}let a=e?.original?.dasharray??t.dasharray;i.style.strokeDasharray=String(a),i.style.strokeDashoffset=`0`;let o=![void 0,null].includes(e?.original?.animationDirection),s=![void 0,null].includes(t.animationDirection),c=bn(i,{direction:o?Number(e.original.animationDirection):s?Number(t.animationDirection):-1,dasharray:String(a)}),l=e?.original?.animationDurationMs??t.animationDurationMs??1e3,u=Number(l),d=Number.isFinite(u)&&u>0?n/u:n/1e3,f=Math.max(1,Math.round(Math.abs(c)/Math.max(1e-9,d))),p=i.animate([{strokeDashoffset:0},{strokeDashoffset:c}],{duration:f,iterations:1/0,easing:`linear`});Sn.value.set(e.id,p)})}Me(()=>{wn()});async function En({scale:e=2}={}){if(!O.value)return;let{width:t,height:n}=O.value.getBoundingClientRect(),r=t/n,{imageUri:i,base64:a}=await fe({domElement:O.value,base64:!0,img:!0,scale:e});return{imageUri:i,base64:a,title:L.value.title.text??`vue-ui-dag`,width:t,height:n,aspectRatio:r}}let Dn=_(()=>{let e=Number(L.value.layout.nodeHeight);return Number.isFinite(e)&&e>0?e/L.value.backgroundPattern.spacingRatio:12}),On=_(()=>Dn.value*(L.value.backgroundPattern.dotRadiusRatio/100)),$=C(null),kn=null,An=0;function jn(e){kn&&=(clearTimeout(kn),null),$.value!==e&&($.value=e)}function Mn(e){un.value=null,jn(e)}async function Nn(e){$.value=null,await dn(e)}function Pn(e){let t=++An;kn&&clearTimeout(kn),kn=setTimeout(()=>{t===An&&$.value===e&&($.value=null)},20)}let Fn=_(()=>new Map((q.value?.edges||[]).map(e=>{let t=$.value!=null&&String(e.from)===String($.value),n=$.value!=null&&String(e.to)===String($.value),r=un.value===e.id||z.value?.id===e.id||M.value===`midpoint`&&j.value===e.id,i=e.original.color??et.value.stroke;return r&&I.value.selectedEdge.stroke!=null?i=I.value.selectedEdge.stroke:t&&F.value.selected.downstreamEdges.stroke!=null?i=F.value.selected.downstreamEdges.stroke:n&&F.value.selected.upstreamEdges.stroke!=null&&(i=F.value.selected.upstreamEdges.stroke),[e.id,{stroke:i,active:r,width:et.value.strokeWidth*(r||t?2:1),animated:!!e.original.animated||r&&I.value.selectedEdge.animated===!0||t&&F.value.selected.downstreamEdges.animated===!0||n&&F.value.selected.upstreamEdges.animated===!0}]})));E([Fn,()=>et.value.animations,()=>q.value?.edges],Tn,{deep:!0,flush:`post`}),Ne(Tn);function In(e){let t=Fn.value.get(e.id);return{d:e.pathData,fill:`none`,stroke:t.stroke,"stroke-width":t.width,"stroke-linecap":`round`,"stroke-linejoin":`round`}}function Ln(e){return M.value===`node`&&j.value===e}function Rn(e){let t=$.value===e.id,n=M.value===`node`&&j.value===e.id,r=t||n,i=r&&F.value.selected.backgroundColor!=null?F.value.selected.backgroundColor:e.original.backgroundColor,a=r&&F.value.selected.stroke!=null?F.value.selected.stroke:F.value.stroke,o=r&&F.value.selected.strokeWidth!=null?F.value.selected.strokeWidth:F.value.strokeWidth;return{x:e.x-e.width/2,y:e.y-e.height/2,width:e.width,height:e.height,rx:F.value.borderRadius,fill:i,stroke:a,"stroke-width":o}}function zn(e){let t=Fn.value.get(e.id),n=M.value===`midpoint`&&j.value===e.id;return{cx:e.midpoint?.x,cy:e.midpoint?.y,r:I.value.radius,fill:n?I.value.selectedEdge.stroke??I.value.fill:I.value.fill,stroke:t.stroke,"stroke-width":t.width}}function Bn(e){return Fn.value.get(e.id).stroke}let Vn=_(()=>{let e=q.value?.arrowSize||0;return q.value?.arrowShape===`normal`?`M 0 0 L ${e} ${e/2} L 0 ${e} Z`:`M 0 0 L ${e} ${e/2} L 0 ${e} L ${e/3} ${e/2} Z`});function Hn(e){return`${It}-${String(e).replace(/[^a-zA-Z0-9_-]/g,`_`)}`}function Un(){return q.value}async function Wn(){He(`copyAlt`,{config:P.value,dataset:vt.value}),P.value.userOptions.callbacks.altCopy?await Promise.resolve(P.value.userOptions.callbacks.altCopy({config:P.value,dataset:vt.value})):console.warn("Vue Data UI - A callback must be set for `altCopy` in userOptions.")}let Gn=_(()=>(q.value?.nodes??[]).map(e=>({id:e.id,type:`node`,x:e.x,y:e.y,label:e.label??e.id,raw:e}))),Kn=_(()=>I.value.show?(q.value?.edges??[]).filter(e=>e?.midpoint).map(e=>({id:e.id,type:`midpoint`,x:e.midpoint.x,y:e.midpoint.y,label:`${J(e.from)?.label??e.from} → ${J(e.to)?.label??e.to}`,raw:e})):[]),qn=_(()=>[...Gn.value,...Kn.value].sort((e,t)=>e.x===t.x?e.y-t.y:e.x-t.x)),Jn=_(()=>{let e=q.value?.nodes??[],t=q.value?.edges??[],n=[P.value.a11y?.translations?.node??`Node`,P.value.a11y?.translations?.parents??`Parents`,P.value.a11y?.translations?.children??`Children`],r=/* @__PURE__ */ new Map,i=/* @__PURE__ */ new Map;for(let e of t){let t=String(e.from),n=String(e.to);r.has(n)||r.set(n,[]),i.has(t)||i.set(t,[]),r.get(n).push(J(e.from)?.label??e.from),i.get(t).push(J(e.to)?.label??e.to)}return{headers:n,rows:e.map(e=>[e.label??e.id,r.get(String(e.id))?.join(`, `)||`—`,i.get(String(e.id))?.join(`, `)||`—`])}});function Yn(e){return`${e.type}:${e.id}`}function Xn(){return j.value==null||M.value==null?null:qn.value.find(e=>e.id===j.value&&e.type===M.value)??null}async function Zn(e){e&&(e.type===`node`?Q():e.type===`midpoint`&&(pn(),await dn(e.raw)))}function Qn(e){e&&(j.value=e.id,M.value=e.type,e.type===`node`?(jn(e.id),un.value=null):e.type===`midpoint`&&($.value=null,un.value=e.id))}function $n(){j.value=null,M.value=null,B.value||($.value=null),U.value||(un.value=null)}function er(){Xe.value=!0,$n()}function tr(){Xe.value=!1,pn(),Q(),$n()}function rr(e,t,n){let r=t.x-e.x,i=t.y-e.y;return n===`right`&&r<=0||n===`left`&&r>=0||n===`down`&&i<=0||n===`up`&&i>=0?1/0:n===`right`||n===`left`?Math.abs(r)*1e3+Math.abs(i):Math.abs(i)*1e3+Math.abs(r)}function Ir(e,t){let n=qn.value.filter(t=>Yn(t)!==Yn(e));if(!n.length)return null;let r=null,i=1/0;return n.forEach(n=>{let a=rr(e,n,t);a<i&&(i=a,r=n)}),r||(t===`right`||t===`down`?qn.value[0]??null:qn.value[qn.value.length-1]??null)}async function Lr(e){e&&e.type===`node`&&(Q(),await fn(e.raw))}async function Rr(e){if(!W.value||pt.value||document.activeElement!==W.value||!qn.value.length)return;let t=e.key===`ArrowLeft`,n=e.key===`ArrowRight`,r=e.key===`ArrowUp`,i=e.key===`ArrowDown`,a=e.key===`Enter`||e.key===` `,o=e.key===`Escape`;if(!t&&!n&&!r&&!i&&!a&&!o)return;if(e.preventDefault(),e.stopPropagation(),o){pn(),Q(),$n();return}let s=Xn();if(a){if(!s)return;s.type===`node`&&await Lr(s);return}if(!s){let e=qn.value[0];if(!e)return;Qn(e),await Zn(e);return}let c=null;n?c=Ir(s,`right`):t?c=Ir(s,`left`):i?c=Ir(s,`down`):r&&(c=Ir(s,`up`)),c&&(pn(),Q(),Qn(c),await Zn(c))}d({getData:Un,getImage:En,generatePdf:St,generateSvg:Ot,generateImage:Ct,toggleAnnotator:nn,toggleFullscreen:tn,zoomIn:rn,zoomOut:an,resetZoom:Jt,switchDirection:sn,copyAlt:Wn,focusOnNode:Yt});let zr=_(()=>s(P.value.userOptions?.annotator?.followZoom,Y.value));return(e,s)=>(S(),b(`div`,{class:ke(`vue-data-ui-component vue-ui-dag ${Z.value?`vue-data-ui-wrapper-fullscreen`:``} ${P.value.responsive?`vue-ui-dag-responsive`:``}`),id:`dag_${k.value}`,ref_key:`dagChart`,ref:O,style:je({fontFamily:P.value.style.fontFamily,backgroundColor:L.value.backgroundColor,padding:`0.5rem`}),onMouseenter:At,onMouseleave:jt},[x(`div`,{id:`chart-instructions-${k.value}`,class:`sr-only`},[x(`p`,null,Fe(P.value.a11y.translations.keyboardNavigation),1)],8,ar),P.value.a11y.includeTable&&Jn.value?.rows?.length?(S(),v(ge,{key:0,uid:k.value,head:Jn.value.headers,body:Jn.value.rows,notice:P.value.a11y.translations.tableAvailable,caption:P.value.a11y.translations.tableCaption},null,8,[`uid`,`head`,`body`,`notice`,`caption`])):y(``,!0),T(Ft)?(S(),b(`div`,or,Fe(String(T(Ft))),1)):y(``,!0),P.value.userOptions.buttons.annotator?(S(),v(T(Ie),De({key:2},T(a)(P.value.userOptions.annotator),{svgRef:T(W),followZoom:P.value.userOptions?.annotator?.followZoom,annotationViewport:zr.value,backgroundColor:L.value.backgroundColor,color:L.value.color,active:pt.value,isCursorPointer:tt.value,palette:P.value.userOptions.annotatorPalette,onClose:nn}),Se({_:2},[Pe(T(o),t=>({name:t,fn:Le(n=>[w(e.$slots,t,Ae(Ee(T(i)(t,n))),void 0,!0)])}))]),1040,[`svgRef`,`followZoom`,`annotationViewport`,`backgroundColor`,`color`,`active`,`isCursorPointer`,`palette`])):y(``,!0),P.value.userOptions.show&&Qe.value&&(T(gt)||T(mt))?(S(),v(T(ze),De({key:`user_option_${qe.value}`,backgroundColor:L.value.backgroundColor,color:L.value.color,isPrinting:T(K),isImaging:T(xt),uid:k.value,hasTooltip:!1,hasTable:!1,hasXls:!1,hasLabel:!1,isFullscreen:Z.value,chartElement:O.value},T(n)(P.value.userOptions,`pdf img svg fullscreen altCopy annotator zoom`),{isAnnotation:pt.value,isZoom:Vt.value,isCursorPointer:tt.value,onToggleFullscreen:tn,onGeneratePdf:T(St),onGenerateImage:T(kt),onGenerateSvg:T(Ot),onToggleAnnotator:nn,onToggleZoom:Xt,onCopyAlt:Wn,style:{visibility:T(gt)?T(mt)?`visible`:`hidden`:`visible`}}),Se({_:2},[Pe(T(t)(e.$slots,`menuIcon optionPdf optionImg optionSvg optionFullscreen optionAnnotator optionZoom optionAltCopy custom-menu-before custom-menu-after`),t=>({name:t,fn:Le(n=>[w(e.$slots,t,Ae(Ee(T(r)(t,n))),void 0,!0)])}))]),1040,[`backgroundColor`,`color`,`isPrinting`,`isImaging`,`uid`,`isFullscreen`,`chartElement`,`isAnnotation`,`isZoom`,`isCursorPointer`,`onGeneratePdf`,`onGenerateImage`,`onGenerateSvg`,`style`])):y(``,!0),L.value.title.text?(S(),b(`div`,{key:4,ref_key:`chartTitle`,ref:Ue,style:`width:100%;background:transparent;`},[(S(),v(pe,{key:`title_${Ke.value}`,config:{title:{cy:`dag-title`,...L.value.title},subtitle:{cy:`dag-subtitle`,...L.value.title.subtitle}}},null,8,[`config`]))],512)):y(``,!0),L.value.controls.position===`top`&&!N.value&&L.value.controls.show?(S(),v(_e,{key:5,ref_key:`zoomControls`,ref:Ge,config:P.value,scale:T(Wt),isFullscreen:Z.value,withDirection:``,onZoomIn:rn,onZoomOut:an,onResetZoom:s[0]||=()=>Jt(!0),onSwitchDirection:sn},null,8,[`config`,`scale`,`isFullscreen`])):y(``,!0),x(`div`,sr,[q.value?(S(),b(`svg`,{key:0,ref_key:`svgRef`,ref:W,class:ke({"vue-ui-dag-svg":!0,"vue-data-ui-loading":N.value}),viewBox:Qt.value,xmlns:T(ee),style:je({backgroundColor:L.value.backgroundColor,height:`100%`,width:`100%`}),tabindex:`0`,"aria-describedby":`chart-instructions-${k.value}`,onMousedown:X,onTouchstart:X,onFocus:er,onBlur:tr,onKeydown:Rr},[we(T(Be)),w(e.$slots,`svg-underlayer`,{svg:{drawingArea:T(Y),data:q.value,orientation:G.value,isPrintingImg:T(K)||T(xt)||T(Et),isPrintingSvg:T(Dt)}},void 0,!0),L.value.backgroundPattern.show?(S(),b(`defs`,lr,[x(`pattern`,{id:`dag_bg_pattern_${k.value}`,patternUnits:`userSpaceOnUse`,width:Dn.value,height:Dn.value},[w(e.$slots,`background-pattern`,Ae(Ee({x:Dn.value/2,y:Dn.value/2,color:L.value.backgroundPattern.dotColor})),()=>[x(`circle`,{cx:Dn.value/2,cy:Dn.value/2,r:On.value,fill:L.value.backgroundPattern.dotColor},null,8,dr)],!0)],8,ur)])):y(``,!0),L.value.backgroundPattern.show?(S(),b(`rect`,{key:1,x:en.value?.x??0,y:en.value?.y??0,width:en.value?.width??0,height:en.value?.height??0,fill:`url(#dag_bg_pattern_${k.value})`,style:je({pointerEvents:`none`,opacity:L.value.backgroundPattern.opacity})},null,12,fr)):y(``,!0),q.value.arrowShape===`undirected`?y(``,!0):(S(),b(`defs`,pr,[(S(!0),b(ye,null,Pe(q.value.edges,e=>(S(),b(`marker`,{key:`marker_${e.id}`,id:Hn(e.id),markerWidth:q.value.arrowSize,markerHeight:q.value.arrowSize,refX:q.value.arrowSize-3,refY:q.value.arrowSize/2,orient:`auto`,markerUnits:`strokeWidth`},[x(`path`,{d:Vn.value,fill:Bn(e),stroke:Bn(e),"stroke-width":`0`,style:{transition:`stroke 0.2s ease-in-out,
|
|
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"./resolveChartConfig-QgMumfgd.js";import{Pt as l,S as u,St as d,X as f,Y as p,at as m,in as h,rt as g,t as ee,tn as te,zt as ne}from"./lib-BaWaqwnJ.js";import{t as re}from"./usePanZoom-DlEcNgCv.js";import{n as ie,t as ae}from"./useHints-C-TwxM0Y.js";import{t as oe}from"./useConfig-B-AzS3w-.js";import{t as se}from"./usePrinter-CUD8gosC.js";import{t as ce}from"./useChartExport-BZts4KFb.js";import{t as le}from"./useUserOptionState-CXlFnwPv.js";import{t as ue}from"./useChartAccessibility-DOMuYJfm.js";import{t as de}from"./useResponsive-CENUxfEL.js";import{t as fe}from"./img-Dwb4XSud.js";import{n as pe}from"./Title-DlhGIAWX.js";import{t as me}from"./vue_ui_dag-fH3SPZmq.js";import{t as he}from"./BaseScanner-m6QR9rwD.js";import{t as ge}from"./A11yDataTable-DWNlWXzs.js";import{t as _e}from"./BaseZoomControls-OZwEB4vm.js";import{t as ve}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{Fragment as ye,Teleport as be,Transition as xe,computed as _,createBlock as v,createCommentVNode as y,createElementBlock as b,createElementVNode as x,createSlots as Se,createTextVNode as Ce,createVNode as we,defineAsyncComponent as Te,guardReactiveProps as Ee,mergeProps as De,nextTick as Oe,normalizeClass as ke,normalizeProps as Ae,normalizeStyle as je,onBeforeUnmount as Me,onMounted as Ne,openBlock as S,ref as C,renderList as Pe,renderSlot as w,toDisplayString as Fe,unref as T,watch as E,watchEffect as Ie,withCtx as Le,withModifiers as Re}from"vue";var ze=`\0`,Be=`\0`,Ve=``,D=class{_isDirected=!0;_isMultigraph=!1;_isCompound=!1;_label;_defaultNodeLabelFn=()=>void 0;_defaultEdgeLabelFn=()=>void 0;_nodes={};_in={};_preds={};_out={};_sucs={};_edgeObjs={};_edgeLabels={};_nodeCount=0;_edgeCount=0;_parent;_children;constructor(e){e&&(this._isDirected=!Object.hasOwn(e,`directed`)||e.directed,this._isMultigraph=Object.hasOwn(e,`multigraph`)?e.multigraph:!1,this._isCompound=Object.hasOwn(e,`compound`)?e.compound:!1),this._isCompound&&(this._parent={},this._children={},this._children[Be]={})}isDirected(){return this._isDirected}isMultigraph(){return this._isMultigraph}isCompound(){return this._isCompound}setGraph(e){return this._label=e,this}graph(){return this._label}setDefaultNodeLabel(e){return this._defaultNodeLabelFn=e,typeof e!=`function`&&(this._defaultNodeLabelFn=()=>e),this}nodeCount(){return this._nodeCount}nodes(){return Object.keys(this._nodes)}sources(){let e=this;return this.nodes().filter(t=>Object.keys(e._in[t]).length===0)}sinks(){let e=this;return this.nodes().filter(t=>Object.keys(e._out[t]).length===0)}setNodes(e,t){let n=arguments,r=this;return e.forEach(e=>{n.length>1?r.setNode(e,t):r.setNode(e)}),this}setNode(e,t){return Object.hasOwn(this._nodes,e)?(arguments.length>1&&(this._nodes[e]=t),this):(this._nodes[e]=arguments.length>1?t:this._defaultNodeLabelFn(e),this._isCompound&&(this._parent[e]=Be,this._children[e]={},this._children[Be][e]=!0),this._in[e]={},this._preds[e]={},this._out[e]={},this._sucs[e]={},++this._nodeCount,this)}node(e){return this._nodes[e]}hasNode(e){return Object.hasOwn(this._nodes,e)}removeNode(e){let t=this;if(Object.hasOwn(this._nodes,e)){let n=e=>t.removeEdge(t._edgeObjs[e]);delete this._nodes[e],this._isCompound&&(this._removeFromParentsChildList(e),delete this._parent[e],this.children(e).forEach(e=>{t.setParent(e)}),delete this._children[e]),Object.keys(this._in[e]).forEach(n),delete this._in[e],delete this._preds[e],Object.keys(this._out[e]).forEach(n),delete this._out[e],delete this._sucs[e],--this._nodeCount}return this}setParent(e,t){if(!this._isCompound)throw Error(`Cannot set parent in a non-compound graph`);if(t===void 0)t=Be;else{t+=``;for(let n=t;n!==void 0;n=this.parent(n))if(n===e)throw Error(`Setting `+t+` as parent of `+e+` would create a cycle`);this.setNode(t)}return this.setNode(e),this._removeFromParentsChildList(e),this._parent[e]=t,this._children[t][e]=!0,this}_removeFromParentsChildList(e){delete this._children[this._parent[e]][e]}parent(e){if(this._isCompound){let t=this._parent[e];if(t!==Be)return t}}children(e=Be){if(this._isCompound){let t=this._children[e];if(t)return Object.keys(t)}else if(e===Be)return this.nodes();else if(this.hasNode(e))return[]}predecessors(e){let t=this._preds[e];if(t)return Object.keys(t)}successors(e){let t=this._sucs[e];if(t)return Object.keys(t)}neighbors(e){let t=this.predecessors(e);if(t){let n=new Set(t);for(let t of this.successors(e))n.add(t);return Array.from(n.values())}}isLeaf(e){let t;return t=this.isDirected()?this.successors(e):this.neighbors(e),t.length===0}filterNodes(e){let t=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});t.setGraph(this.graph());let n=this;Object.entries(this._nodes).forEach(([n,r])=>{e(n)&&t.setNode(n,r)}),Object.values(this._edgeObjs).forEach(e=>{t.hasNode(e.v)&&t.hasNode(e.w)&&t.setEdge(e,n.edge(e))});let r={};function i(e){let a=n.parent(e);return a===void 0||t.hasNode(a)?(r[e]=a,a):a in r?r[a]:i(a)}return this._isCompound&&t.nodes().forEach(e=>t.setParent(e,i(e))),t}setDefaultEdgeLabel(e){return this._defaultEdgeLabelFn=e,typeof e!=`function`&&(this._defaultEdgeLabelFn=()=>e),this}edgeCount(){return this._edgeCount}edges(){return Object.values(this._edgeObjs)}setPath(e,t){let n=this,r=arguments;return e.reduce((e,i)=>(r.length>1?n.setEdge(e,i,t):n.setEdge(e,i),i)),this}setEdge(){let e,t,n,r,i=!1,a=arguments[0];typeof a==`object`&&a&&`v`in a?(e=a.v,t=a.w,n=a.name,arguments.length===2&&(r=arguments[1],i=!0)):(e=a,t=arguments[1],n=arguments[3],arguments.length>2&&(r=arguments[2],i=!0)),e=``+e,t=``+t,n!==void 0&&(n=``+n);let o=k(this._isDirected,e,t,n);if(Object.hasOwn(this._edgeLabels,o))return i&&(this._edgeLabels[o]=r),this;if(n!==void 0&&!this._isMultigraph)throw Error(`Cannot set a named edge when isMultigraph = false`);this.setNode(e),this.setNode(t),this._edgeLabels[o]=i?r:this._defaultEdgeLabelFn(e,t,n);let s=Ue(this._isDirected,e,t,n);return e=s.v,t=s.w,Object.freeze(s),this._edgeObjs[o]=s,He(this._preds[t],e),He(this._sucs[e],t),this._in[t][o]=s,this._out[e][o]=s,this._edgeCount++,this}edge(e,t,n){let r=arguments.length===1?We(this._isDirected,arguments[0]):k(this._isDirected,e,t,n);return this._edgeLabels[r]}edgeAsObj(){let e=this.edge(...arguments);return typeof e==`object`?e:{label:e}}hasEdge(e,t,n){let r=arguments.length===1?We(this._isDirected,arguments[0]):k(this._isDirected,e,t,n);return Object.hasOwn(this._edgeLabels,r)}removeEdge(e,t,n){let r=arguments.length===1?We(this._isDirected,arguments[0]):k(this._isDirected,e,t,n),i=this._edgeObjs[r];return i&&(e=i.v,t=i.w,delete this._edgeLabels[r],delete this._edgeObjs[r],O(this._preds[t],e),O(this._sucs[e],t),delete this._in[t][r],delete this._out[e][r],this._edgeCount--),this}inEdges(e,t){let n=this._in[e];if(n){let e=Object.values(n);return t?e.filter(e=>e.v===t):e}}outEdges(e,t){let n=this._out[e];if(n){let e=Object.values(n);return t?e.filter(e=>e.w===t):e}}nodeEdges(e,t){let n=this.inEdges(e,t);if(n)return n.concat(this.outEdges(e,t))}};function He(e,t){e[t]?e[t]++:e[t]=1}function O(e,t){--e[t]||delete e[t]}function k(e,t,n,r){let i=``+t,a=``+n;if(!e&&i>a){let e=i;i=a,a=e}return i+Ve+a+Ve+(r===void 0?ze:r)}function Ue(e,t,n,r){let i=``+t,a=``+n;if(!e&&i>a){let e=i;i=a,a=e}let o={v:i,w:a};return r&&(o.name=r),o}function We(e,t){return k(e,t.v,t.w,t.name)}var Ge=class{constructor(){let e={};e._next=e._prev=e,this._sentinel=e}dequeue(){let e=this._sentinel,t=e._prev;if(t!==e)return Ke(t),t}enqueue(e){let t=this._sentinel;e._prev&&e._next&&Ke(e),e._next=t._next,t._next._prev=e,t._next=e,e._prev=t}toString(){let e=[],t=this._sentinel,n=t._prev;for(;n!==t;)e.push(JSON.stringify(n,qe)),n=n._prev;return`[`+e.join(`, `)+`]`}};function Ke(e){e._prev._next=e._next,e._next._prev=e._prev,delete e._next,delete e._prev}function qe(e,t){if(e!==`_next`&&e!==`_prev`)return t}var Je=()=>1;function A(e,t){if(e.nodeCount()<=1)return[];let n=M(e,t||Je);return Ye(n.graph,n.buckets,n.zeroIndex).flatMap(t=>e.outEdges(t.v,t.w))}function Ye(e,t,n){let r=[],i=t[t.length-1],a=t[0],o;for(;e.nodeCount();){for(;o=a.dequeue();)j(e,t,n,o);for(;o=i.dequeue();)j(e,t,n,o);if(e.nodeCount()){for(let i=t.length-2;i>0;--i)if(o=t[i].dequeue(),o){r=r.concat(j(e,t,n,o,!0));break}}}return r}function j(e,t,n,r,i){let a=i?[]:void 0;return e.inEdges(r.v).forEach(r=>{let o=e.edge(r),s=e.node(r.v);i&&a.push({v:r.v,w:r.w}),s.out-=o,Xe(t,n,s)}),e.outEdges(r.v).forEach(r=>{let i=e.edge(r),a=e.node(r.w);a.in-=i,Xe(t,n,a)}),e.removeNode(r.v),a}function M(e,t){let n=new D,r=0,i=0;e.nodes().forEach(e=>{n.setNode(e,{v:e,in:0,out:0})}),e.edges().forEach(e=>{let a=n.edge(e.v,e.w)||0,o=t(e),s=a+o;n.setEdge(e.v,e.w,s),i=Math.max(i,n.node(e.v).out+=o),r=Math.max(r,n.node(e.w).in+=o)});let a=Ze(i+r+3).map(()=>new Ge),o=r+1;return n.nodes().forEach(e=>{Xe(a,o,n.node(e))}),{graph:n,buckets:a,zeroIndex:o}}function Xe(e,t,n){n.out?n.in?e[n.out-n.in+t].enqueue(n):e[e.length-1].enqueue(n):e[0].enqueue(n)}function Ze(e){let t=[];for(let n=0;n<e;n++)t.push(n);return t}function Qe(e,t,n,r){let i=r;for(;e.hasNode(i);)i=ct(r);return n.dummy=t,e.setNode(i,n),i}function N(e){let t=new D().setGraph(e.graph());return e.nodes().forEach(n=>{t.setNode(n,e.node(n))}),e.edges().forEach(n=>{let r=t.edge(n.v,n.w)||{weight:0,minlen:1},i=e.edge(n);t.setEdge(n.v,n.w,{weight:r.weight+i.weight,minlen:Math.max(r.minlen,i.minlen)})}),t}function $e(e){let t=new D({multigraph:e.isMultigraph()}).setGraph(e.graph());return e.nodes().forEach(n=>{e.children(n).length||t.setNode(n,e.node(n))}),e.edges().forEach(n=>{t.setEdge(n,e.edge(n))}),t}function P(e){let t=e.nodes().map(t=>{let n={};return e.outEdges(t).forEach(t=>{n[t.w]=(n[t.w]||0)+e.edge(t).weight}),n});return ut(e.nodes(),t)}function F(e){let t=e.nodes().map(t=>{let n={};return e.inEdges(t).forEach(t=>{n[t.v]=(n[t.v]||0)+e.edge(t).weight}),n});return ut(e.nodes(),t)}function et(e,t){let n=e.x,r=e.y,i=t.x-n,a=t.y-r,o=e.width/2,s=e.height/2;if(!i&&!a)throw Error(`Not possible to find intersection inside of the rectangle`);let c,l;return Math.abs(a)*o>Math.abs(i)*s?(a<0&&(s=-s),c=s*i/a,l=s):(i<0&&(o=-o),c=o,l=o*a/i),{x:n+c,y:r+l}}function I(e){let t=lt(z(e)+1).map(()=>[]);return e.nodes().forEach(n=>{let r=e.node(n),i=r.rank;i!==void 0&&(t[i][r.order]=n)}),t}function L(e){let t=e.nodes().map(t=>{let n=e.node(t).rank;return n===void 0?Number.MAX_VALUE:n}),n=R(Math.min,t);e.nodes().forEach(t=>{let r=e.node(t);Object.hasOwn(r,`rank`)&&(r.rank-=n)})}function tt(e){let t=e.nodes().map(t=>e.node(t).rank).filter(e=>e!==void 0),n=R(Math.min,t),r=[];e.nodes().forEach(t=>{let i=e.node(t).rank-n;r[i]||(r[i]=[]),r[i].push(t)});let i=0,a=e.graph().nodeRankFactor;Array.from(r).forEach((t,n)=>{t===void 0&&n%a!==0?--i:t!==void 0&&i&&t.forEach(t=>{e.node(t).rank+=i})})}function nt(e,t,n,r){let i={width:0,height:0};return arguments.length>=4&&(i.rank=n,i.order=r),Qe(e,`border`,i,t)}var rt=65535;function it(e,t=rt){let n=[];for(let r=0;r<e.length;r+=t){let i=e.slice(r,r+t);n.push(i)}return n}function R(e,t){if(t.length>rt){let n=it(t);return e.apply(null,n.map(t=>e.apply(null,t)))}return e.apply(null,t)}function z(e){let t=e.nodes().map(t=>{let n=e.node(t).rank;return n===void 0?Number.MIN_VALUE:n});return R(Math.max,t)}function at(e,t){let n={lhs:[],rhs:[]};return e.forEach(e=>{t(e)?n.lhs.push(e):n.rhs.push(e)}),n}function ot(e,t){let n=Date.now();try{return t()}finally{console.log(e+` time: `+(Date.now()-n)+`ms`)}}function st(e,t){return t()}var B=0;function ct(e){let t=++B;return e+String(t)}function lt(e,t,n=1){t??(t=e,e=0);let r=e=>e<t;n<0&&(r=e=>t<e);let i=[];for(let t=e;r(t);t+=n)i.push(t);return i}function V(e,t){let n={};for(let r of t)e[r]!==void 0&&(n[r]=e[r]);return n}function H(e,t){let n=t;if(typeof t==`string`){let e=t;n=t=>t[e]}return Object.entries(e).reduce((e,[t,r])=>(e[t]=n(r,t),e),{})}function ut(e,t){return e.reduce((e,n,r)=>(e[n]=t[r],e),{})}var dt={addBorderNode:nt,addDummyNode:Qe,applyWithChunking:R,asNonCompoundGraph:$e,buildLayerMatrix:I,intersectRect:et,mapValues:H,maxRank:z,normalizeRanks:L,notime:st,partition:at,pick:V,predecessorWeights:F,range:lt,removeEmptyRanks:tt,simplify:N,successorWeights:P,time:ot,uniqueId:ct,zipObject:ut};function ft(e){(e.graph().acyclicer===`greedy`?A(e,t(e)):pt(e)).forEach(t=>{let n=e.edge(t);e.removeEdge(t),n.forwardName=t.name,n.reversed=!0,e.setEdge(t.w,t.v,n,ct(`rev`))});function t(e){return t=>e.edge(t).weight}}function U(e){e.edges().forEach(t=>{let n=e.edge(t);if(n.reversed){e.removeEdge(t);let r=n.forwardName;delete n.reversed,delete n.forwardName,e.setEdge(t.w,t.v,n,r)}})}function pt(e){let t=[],n={},r={};function i(a){Object.hasOwn(r,a)||(r[a]=!0,n[a]=!0,e.outEdges(a).forEach(e=>{Object.hasOwn(n,e.w)?t.push(e):i(e.w)}),delete n[a])}return e.nodes().forEach(i),t}function W(e){e.graph().dummyChains=[],e.edges().forEach(t=>mt(e,t))}function mt(e,t){let n=t.v,r=e.node(n).rank,i=t.w,a=e.node(i).rank,o=t.name,s=e.edge(t),c=s.labelRank;if(a===r+1)return;e.removeEdge(t);let l,u,d=0;for(++r;r<a;++d,++r)s.points=[],u={width:0,height:0,edgeLabel:s,edgeObj:t,rank:r},l=Qe(e,`edge`,u,`_d`),r===c&&(u.width=s.width,u.height=s.height,u.dummy=`edge-label`,u.labelpos=s.labelpos),e.setEdge(n,l,{weight:s.weight},o),d===0&&e.graph().dummyChains.push(l),n=l;e.setEdge(n,i,{weight:s.weight},o)}function ht(e){e.graph().dummyChains.forEach(t=>{let n=e.node(t),r=n.edgeLabel;e.setEdge(n.edgeObj,r);let i;for(;n.dummy;)i=e.successors(t)[0],e.removeNode(t),r.points.push({x:n.x,y:n.y}),n.dummy===`edge-label`&&(r.x=n.x,r.y=n.y,r.width=n.width,r.height=n.height),t=i,n=e.node(t)})}function gt(e){function t(n){let r=e.node(n);if(r&&Object.prototype.hasOwnProperty.call(r,`rank`))return r.rank;let i=e.outEdges(n)||[];if(!i.length)return r&&(r.rank=0),0;let a=i.map(n=>e.node(n.w)?t(n.w)-e.edge(n).minlen:1/0),o=R(Math.min,a);return o===1/0&&(o=0),r&&(r.rank=o),o}(e.sources()||[]).forEach(t)}function G(e,t){return e.node(t.w).rank-e.node(t.v).rank-e.edge(t).minlen}function _t(e){vt(e);let t=new D;e.nodes().forEach(e=>{t.setNode(e,{})});let n=e.nodes();if(!n.length)return t;let r=n[0],i=/* @__PURE__ */ new Set([r]);for(;i.size<n.length;){let r=yt(e,i);if(!r){let e=n.find(e=>!i.has(e));i.add(e),t.setNode(e,{});continue}let{edgeObject:a,delta:o,attachFrom:s,attachTo:c}=r;bt(e,i,s,o),t.setEdge(a.v,a.w,{}),i.add(c)}return t}function vt(e){e.nodes().forEach(t=>{let n=e.node(t)||{};Object.prototype.hasOwnProperty.call(n,`rank`)||(n.rank=0,e.setNode(t,n))})}function yt(e,t){let n=null;return e.edges().forEach(r=>{let i=t.has(r.v);if(i===t.has(r.w))return;let a=G(e,r),o=Math.abs(a);if(!n||o<n.absoluteSlack){let e=i?r.v:r.w,t=i?r.w:r.v;n={edgeObject:r,delta:i?a:-a,attachFrom:e,attachTo:t,absoluteSlack:o}}}),n}function bt(e,t,n,r){r&&e.nodes().forEach(n=>{if(!t.has(n)){let t=e.node(n);t.rank+=r}})}function K(e){let t=N(e);return gt(t),t.nodes().forEach(n=>{let r=t.node(n),i=e.node(n)||{};i.rank=r.rank,e.setNode(n,i)}),e}function xt(e,t){}function St(e,t){}function Ct(e,t,n){return 0}function wt(e){return null}function Tt(e,t){return null}K.initLowLimValues=xt,K.initCutValues=St,K.calcCutValue=Ct,K.leaveEdge=wt,K.enterEdge=Tt;var Et=gt;function Dt(e){let t=e.graph().ranker;if(t instanceof Function)return t(e);switch(e.graph().ranker){case`network-simplex`:At(e);break;case`tight-tree`:kt(e);break;case`longest-path`:Ot(e);break;case`none`:break;default:At(e)}}var Ot=Et;function kt(e){Et(e),_t(e)}function At(e){K(e)}function jt(e){let t=Nt(e);e.graph().dummyChains.forEach(n=>{let r=e.node(n),i=r.edgeObj,a=Mt(e,t,i.v,i.w),o=a.path,s=a.lca,c=0,l=o[c],u=!0,d=n;for(;d!==i.w;){if(r=e.node(d),u){for(;(l=o[c])!==s&&e.node(l).maxRank<r.rank;)c++;l===s&&(u=!1)}if(!u){for(;c<o.length-1&&e.node(l=o[c+1]).minRank<=r.rank;)c++;l=o[c]}e.setParent(d,l),d=e.successors(d)[0]}})}function Mt(e,t,n,r){let i=[],a=[],o=Math.min(t[n].low,t[r].low),s=Math.max(t[n].lim,t[r].lim),c,l;c=n;do c=e.parent(c),i.push(c);while(c&&(t[c].low>o||s>t[c].lim));for(l=c,c=r;(c=e.parent(c))!==l;)a.push(c);return{path:i.concat(a.reverse()),lca:l}}function Nt(e){let t={},n=0;function r(i){let a=n;e.children(i).forEach(r),t[i]={low:a,lim:n++}}return e.children().forEach(r),t}function Pt(e){let t=dt.addDummyNode(e,`root`,{},`_root`),n=It(e),r=Object.values(n),i=dt.applyWithChunking(Math.max,r)-1,a=2*i+1;e.graph().nestingRoot=t,e.edges().forEach(t=>{e.edge(t).minlen*=a});let o=q(e)+1;e.children().forEach(r=>{Ft(e,t,a,o,i,n,r)}),e.graph().nodeRankFactor=a}function Ft(e,t,n,r,i,a,o){let s=e.children(o);if(!s.length){o!==t&&e.setEdge(t,o,{weight:0,minlen:n});return}let c=dt.addBorderNode(e,`_bt`),l=dt.addBorderNode(e,`_bb`),u=e.node(o);e.setParent(c,o),u.borderTop=c,e.setParent(l,o),u.borderBottom=l,s.forEach(s=>{Ft(e,t,n,r,i,a,s);let u=e.node(s),d=u.borderTop?u.borderTop:s,f=u.borderBottom?u.borderBottom:s,p=u.borderTop?r:2*r,m=d===f?i-a[o]+1:1;e.setEdge(c,d,{weight:p,minlen:m,nestingEdge:!0}),e.setEdge(f,l,{weight:p,minlen:m,nestingEdge:!0})}),e.parent(o)||e.setEdge(t,c,{weight:0,minlen:i+a[o]})}function It(e){let t={};function n(r,i){let a=e.children(r);a&&a.length&&a.forEach(e=>n(e,i+1)),t[r]=i}return e.children().forEach(e=>n(e,1)),t}function q(e){return e.edges().reduce((t,n)=>t+e.edge(n).weight,0)}function Lt(e){let t=e.graph();e.removeNode(t.nestingRoot),delete t.nestingRoot,e.edges().forEach(t=>{e.edge(t).nestingEdge&&e.removeEdge(t)})}function Rt(e){function t(n){let r=e.children(n),i=e.node(n);if(r.length&&r.forEach(t),Object.hasOwn(i,`minRank`)){i.borderLeft=[],i.borderRight=[];for(let t=i.minRank,r=i.maxRank+1;t<r;++t)J(e,`borderLeft`,`_bl`,n,i,t),J(e,`borderRight`,`_br`,n,i,t)}}e.children().forEach(t)}function J(e,t,n,r,i,a){let o={width:0,height:0,rank:a,borderType:t},s=i[t][a-1],c=Qe(e,`border`,o,n);i[t][a]=c,e.setParent(c,r),s&&e.setEdge(s,c,{weight:1})}function zt(e){let t=e.graph().rankdir.toLowerCase();(t===`lr`||t===`rl`)&&Vt(e)}function Bt(e){let t=e.graph().rankdir.toLowerCase();(t===`bt`||t===`rl`)&&Ht(e),(t===`lr`||t===`rl`)&&(Wt(e),Vt(e))}function Vt(e){e.nodes().forEach(t=>{Y(e.node(t))}),e.edges().forEach(t=>{Y(e.edge(t))})}function Y(e){let t=e.width;e.width=e.height,e.height=t}function Ht(e){e.nodes().forEach(t=>{Ut(e.node(t))}),e.edges().forEach(t=>{let n=e.edge(t);n.points.forEach(Ut),Object.hasOwn(n,`y`)&&Ut(n)})}function Ut(e){e.y=-e.y}function Wt(e){e.nodes().forEach(t=>{Gt(e.node(t))}),e.edges().forEach(t=>{let n=e.edge(t);n.points.forEach(Gt),Object.hasOwn(n,`x`)&&Gt(n)})}function Gt(e){let t=e.x;e.x=e.y,e.y=t}var Kt={adjust:zt,undo:Bt};function qt(e){let t={},n=e.nodes().filter(t=>e.children(t).length===0),r=n.map(t=>e.node(t).rank),i=lt(R(Math.max,r)+1).map(()=>[]);function a(n){if(t[n])return;t[n]=!0;let r=e.node(n);i[r.rank].push(n),e.successors(n).forEach(a)}return n.sort((t,n)=>e.node(t).rank-e.node(n).rank).forEach(a),i}function X(e,t){let n=0;for(let r=1;r<t.length;++r)n+=Jt(e,t[r-1],t[r]);return n}function Jt(e,t,n){let r=ut(n,n.map((e,t)=>t)),i=t.flatMap(t=>e.outEdges(t).map(t=>({pos:r[t.w],weight:e.edge(t).weight})).sort((e,t)=>e.pos-t.pos)),a=1;for(;a<n.length;)a<<=1;let o=2*a-1;--a;let s=Array(o).fill(0),c=0;return i.forEach(e=>{let t=e.pos+a;s[t]+=e.weight;let n=0;for(;t>0;)t%2&&(n+=s[t+1]),t=t-1>>1,s[t]+=e.weight;c+=e.weight*n}),c}function Yt(e,t=[]){return t.map(t=>{let n=e.inEdges(t);if(!n.length)return{v:t};let r=n.reduce((t,n)=>{let r=e.edge(n),i=e.node(n.v);return{sum:t.sum+r.weight*i.order,weight:t.weight+r.weight}},{sum:0,weight:0});return{v:t,barycenter:r.sum/r.weight,weight:r.weight}})}function Xt(e,t){let n={};return e.forEach((e,t)=>{let r=n[e.v]={indegree:0,in:[],out:[],vs:[e.v],i:t};e.barycenter!==void 0&&(r.barycenter=e.barycenter,r.weight=e.weight)}),t.edges().forEach(e=>{let t=n[e.v],r=n[e.w];t!==void 0&&r!==void 0&&(r.indegree++,t.out.push(r))}),Zt(Object.values(n).filter(e=>!e.indegree))}function Zt(e){let t=[];function n(e){return t=>{t.merged||(t.barycenter===void 0||e.barycenter===void 0||t.barycenter>=e.barycenter)&&Qt(e,t)}}function r(t){return n=>{n.in.push(t),--n.indegree===0&&e.push(n)}}for(;e.length;){let i=e.pop();t.push(i),i.in.reverse().forEach(n(i)),i.out.forEach(r(i))}return t.filter(e=>!e.merged).map(e=>V(e,[`vs`,`i`,`barycenter`,`weight`]))}function Qt(e,t){let n=0,r=0;e.weight&&(n+=e.barycenter*e.weight,r+=e.weight),t.weight&&(n+=t.barycenter*t.weight,r+=t.weight),e.vs=t.vs.concat(e.vs),e.barycenter=n/r,e.weight=r,e.i=Math.min(t.i,e.i),t.merged=!0}function Z(e,t){let n=at(e,e=>Object.hasOwn(e,`barycenter`)),r=n.lhs,i=n.rhs.sort((e,t)=>t.i-e.i),a=[],o=0,s=0,c=0;r.sort(en(!!t)),c=$t(a,i,c),r.forEach(e=>{c+=e.vs.length,a.push(e.vs),o+=e.barycenter*e.weight,s+=e.weight,c=$t(a,i,c)});let l={vs:a.flat(!0)};return s&&(l.barycenter=o/s,l.weight=s),l}function $t(e,t,n){let r;for(;t.length&&(r=t[t.length-1]).i<=n;)t.pop(),e.push(r.vs),n++;return n}function en(e){return(t,n)=>t.barycenter<n.barycenter?-1:t.barycenter>n.barycenter?1:e?n.i-t.i:t.i-n.i}function tn(e,t,n,r){let i=e.children(t),a=e.node(t),o=a?a.borderLeft:void 0,s=a?a.borderRight:void 0,c={};o&&(i=i.filter(e=>e!==o&&e!==s));let l=Yt(e,i);l.forEach(t=>{if(e.children(t.v).length){let i=tn(e,t.v,n,r);c[t.v]=i,Object.hasOwn(i,`barycenter`)&&rn(t,i)}});let u=Xt(l,n);nn(u,c);let d=Z(u,r);if(o&&(d.vs=[o,d.vs,s].flat(!0),e.predecessors(o).length)){let t=e.node(e.predecessors(o)[0]),n=e.node(e.predecessors(s)[0]);Object.hasOwn(d,`barycenter`)||(d.barycenter=0,d.weight=0),d.barycenter=(d.barycenter*d.weight+t.order+n.order)/(d.weight+2),d.weight+=2}return d}function nn(e,t){e.forEach(e=>{e.vs=e.vs.flatMap(e=>t[e]?t[e].vs:e)})}function rn(e,t){e.barycenter===void 0?(e.barycenter=t.barycenter,e.weight=t.weight):(e.barycenter=(e.barycenter*e.weight+t.barycenter*t.weight)/(e.weight+t.weight),e.weight+=t.weight)}function an(e,t,n,r){r||=e.nodes();let i=on(e),a=new D({compound:!0}).setGraph({root:i}).setDefaultNodeLabel(t=>e.node(t));return r.forEach(r=>{let o=e.node(r),s=e.parent(r);(o.rank===t||o.minRank<=t&&t<=o.maxRank)&&(a.setNode(r),a.setParent(r,s||i),e[n](r).forEach(t=>{let n=t.v===r?t.w:t.v,i=a.edge(n,r),o=i?i.weight:0;a.setEdge(n,r,{weight:e.edge(t).weight+o})}),Object.hasOwn(o,`minRank`)&&a.setNode(r,{borderLeft:o.borderLeft[t],borderRight:o.borderRight[t]}))}),a}function on(e){let t;for(;e.hasNode(t=ct(`_root`)););return t}function sn(e,t,n){let r={},i;n.forEach(n=>{let a=e.parent(n),o,s;for(;a;){if(o=e.parent(a),o?(s=r[o],r[o]=a):(s=i,i=a),s&&s!==a){t.setEdge(s,a);return}a=o}})}function cn(e,t={}){if(typeof t.customOrder==`function`){t.customOrder(e,cn);return}let n=z(e),r=ln(e,lt(1,n+1),`inEdges`),i=ln(e,lt(n-1,-1,-1),`outEdges`),a=qt(e);if(dn(e,a),t.disableOptimalOrderHeuristic)return;let o=1/0,s,c=t.constraints||[];for(let t=0,n=0;n<4;++t,++n){un(t%2==0?r:i,t%4>=2,c),a=I(e);let l=X(e,a);l<o?(o=l,n=0,s=structuredClone(a)):l===o&&(s=structuredClone(a))}dn(e,s)}function ln(e,t,n){let r=/* @__PURE__ */ new Map;function i(e,t){r.has(e)||r.set(e,[]),r.get(e).push(t)}for(let t of e.nodes()){let n=e.node(t);if(typeof n.rank==`number`&&i(n.rank,t),typeof n.minRank==`number`&&typeof n.maxRank==`number`)for(let e=n.minRank;e<=n.maxRank;e++)e!==n.rank&&i(e,t)}return t.map(t=>an(e,t,n,r.get(t)||[]))}function un(e,t,n){let r=new D;e.forEach(e=>{n.forEach(e=>r.setEdge(e.left,e.right));let i=e.graph().root,a=tn(e,i,r,t);a.vs.forEach((t,n)=>{e.node(t).order=n}),sn(e,r,a.vs)})}function dn(e,t){Object.values(t).forEach(t=>{t.forEach((t,n)=>{e.node(t).order=n})})}function Q(e,t){let n={};function r(t,r){let i=0,a=0,o=t.length,s=r[r.length-1];return r.forEach((t,c)=>{let l=pn(e,t),u=l?e.node(l).order:o;(l||t===s)&&(r.slice(a,c+1).forEach(t=>{e.predecessors(t).forEach(r=>{let a=e.node(r),o=a.order;(o<i||u<o)&&!(a.dummy&&e.node(t).dummy)&&mn(n,r,t)})}),a=c+1,i=u)}),r}return t.length&&t.reduce(r),n}function fn(e,t){let n={};function r(t,r,i,a,o){let s;lt(r,i).forEach(r=>{s=t[r],e.node(s).dummy&&e.predecessors(s).forEach(t=>{let r=e.node(t);r.dummy&&(r.order<a||r.order>o)&&mn(n,t,s)})})}function i(t,n){let i=-1,a,o=0;return n.forEach((s,c)=>{if(e.node(s).dummy===`border`){let t=e.predecessors(s);t.length&&(a=e.node(t[0]).order,r(n,o,c,i,a),o=c,i=a)}r(n,o,n.length,a,t.length)}),n}return t.length&&t.reduce(i),n}function pn(e,t){if(e.node(t).dummy)return e.predecessors(t).find(t=>e.node(t).dummy)}function mn(e,t,n){if(t>n){let e=t;t=n,n=e}let r=e[t];r||(e[t]=r={}),r[n]=!0}function hn(e,t,n){if(t>n){let e=t;t=n,n=e}return!!e[t]&&Object.hasOwn(e[t],n)}function gn(e,t,n,r){let i={},a={},o={};return t.forEach(e=>{e.forEach((e,t)=>{i[e]=e,a[e]=e,o[e]=t})}),t.forEach(e=>{let t=-1;e.forEach(e=>{let s=r(e);if(s.length){s=s.sort((e,t)=>o[e]-o[t]);let r=(s.length-1)/2;for(let c=Math.floor(r),l=Math.ceil(r);c<=l;++c){let r=s[c];a[e]===e&&t<o[r]&&!hn(n,e,r)&&(a[r]=e,a[e]=i[e]=i[r],t=o[r])}}})}),{root:i,align:a}}function _n(e,t,n,r,i){let a={},o=vn(e,t,n,i),s=i?`borderLeft`:`borderRight`;function c(e,t){let n=o.nodes().slice(),r={},i=n.pop();for(;i;){if(r[i])e(i);else{r[i]=!0,n.push(i);for(let e of t(i))n.push(e)}i=n.pop()}}function l(e){a[e]=o.inEdges(e).reduce((e,t)=>Math.max(e,a[t.v]+o.edge(t)),0)}function u(t){let n=o.outEdges(t).reduce((e,t)=>Math.min(e,a[t.w]-o.edge(t)),1/0),r=e.node(t);n!==1/0&&r.borderType!==s&&(a[t]=Math.max(a[t],n))}return c(l,o.predecessors.bind(o)),c(u,o.successors.bind(o)),Object.keys(r).forEach(e=>{a[e]=a[n[e]]}),a}function vn(e,t,n,r){let i=new e.constructor,a=e.graph(),o=Cn(a.nodesep,a.edgesep,r);return t.forEach(t=>{let r;t.forEach(t=>{let a=n[t];if(i.setNode(a),r){let s=n[r],c=i.edge(s,a);i.setEdge(s,a,Math.max(o(e,t,r),c||0))}r=t})}),i}function yn(e,t){return Object.values(t).reduce((t,n)=>{let r=-1/0,i=1/0;Object.entries(n).forEach(([t,n])=>{let a=wn(e,t)/2;r=Math.max(n+a,r),i=Math.min(n-a,i)});let a=r-i;return a<t[0]&&(t=[a,n]),t},[1/0,null])[1]}function bn(e,t){let n=Object.values(t),r=R(Math.min,n),i=R(Math.max,n);[`u`,`d`].forEach(n=>{[`l`,`r`].forEach(a=>{let o=n+a,s=e[o];if(s===t)return;let c=Object.values(s),l=r-R(Math.min,c);a!==`l`&&(l=i-R(Math.max,c)),l&&(s=H(s,e=>e+l),e[o]=s)})})}function xn(e,t){return H(e.ul,(n,r)=>{if(t)return e[t.toLowerCase()][r];let i=Object.values(e).map(e=>e[r]).sort((e,t)=>e-t);return(i[1]+i[2])/2})}function Sn(e){let t=I(e),n=Object.assign(Q(e,t),fn(e,t)),r={},i;return[`u`,`d`].forEach(a=>{i=a===`u`?t:Object.values(t).reverse(),[`l`,`r`].forEach(t=>{let o=i;t===`r`&&(o=o.map(e=>Object.values(e).reverse()));let s=(a===`u`?e.predecessors:e.successors).bind(e),c=gn(e,o,n,s),l=_n(e,o,c.root,c.align,t===`r`);t===`r`&&(l=H(l,e=>-e)),r[a+t]=l})}),bn(r,yn(e,r)),xn(r,e.graph().align)}function Cn(e,t,n){return(r,i,a)=>{let o=r.node(i),s=r.node(a),c=0,l;if(c+=o.width/2,Object.hasOwn(o,`labelpos`))switch(o.labelpos.toLowerCase()){case`l`:l=-o.width/2;break;case`r`:l=o.width/2}if(l&&(c+=n?l:-l),l=0,c+=(o.dummy?t:e)/2,c+=(s.dummy?t:e)/2,c+=s.width/2,Object.hasOwn(s,`labelpos`))switch(s.labelpos.toLowerCase()){case`l`:l=s.width/2;break;case`r`:l=-s.width/2}return l&&(c+=n?l:-l),l=0,c}}function wn(e,t){return e.node(t).width}function Tn(e){let t=$e(e);En(t);let n=Sn(t);Object.entries(n).forEach(([t,n])=>{e.node(t).x=n})}function En(e){let t=I(e),n=e.graph().ranksep,r=0;t.forEach(t=>{let i=t.reduce((t,n)=>{let r=e.node(n).height;return t>r?t:r},0);t.forEach(t=>{e.node(t).y=r+i/2}),r+=i+n})}function Dn(e,t={}){let n=t.debugTiming?ot:st;return n(`layout`,()=>{let r=n(` buildLayoutGraph`,()=>Ln(e));return n(` runLayout`,()=>On(r,n,t)),n(` updateInputGraph`,()=>$(e,r)),r})}function On(e,t,n){t(` makeSpaceForEdgeLabels`,()=>Rn(e)),t(` removeSelfEdges`,()=>Jn(e)),t(` acyclic`,()=>ft(e)),t(` nestingGraph.run`,()=>Pt(e)),t(` rank`,()=>Dt($e(e))),t(` injectEdgeLabelProxies`,()=>zn(e)),t(` removeEmptyRanks`,()=>tt(e)),t(` nestingGraph.cleanup`,()=>Lt(e)),t(` normalizeRanks`,()=>L(e)),t(` assignRankMinMax`,()=>Bn(e)),t(` removeEdgeLabelProxies`,()=>Vn(e)),t(` normalize.run`,()=>W(e)),t(` parentDummyChains`,()=>jt(e)),t(` addBorderSegments`,()=>Rt(e)),t(` order`,()=>cn(e,n)),t(` insertSelfEdges`,()=>Yn(e)),t(` adjustCoordinateSystem`,()=>Kt.adjust(e)),t(` position`,()=>Tn(e)),t(` positionSelfEdges`,()=>Xn(e)),t(` removeBorderNodes`,()=>qn(e)),t(` normalize.undo`,()=>ht(e)),t(` fixupEdgeLabelCoords`,()=>Gn(e)),t(` undoCoordinateSystem`,()=>Kt.undo(e)),t(` translateGraph`,()=>Hn(e)),t(` assignNodeIntersects`,()=>Wn(e)),t(` reversePoints`,()=>Kn(e)),t(` acyclic.undo`,()=>U(e))}function $(e,t){e.nodes().forEach(n=>{let r=e.node(n),i=t.node(n);r&&(r.x=i.x,r.y=i.y,r.order=i.order,r.rank=i.rank,t.children(n).length&&(r.width=i.width,r.height=i.height))}),e.edges().forEach(n=>{let r=e.edge(n),i=t.edge(n);r.points=i.points,Object.hasOwn(i,`x`)&&(r.x=i.x,r.y=i.y)});let n=t.graph(),r=e.graph();r.width=n.width,r.height=n.height}var kn=[`nodesep`,`edgesep`,`ranksep`,`marginx`,`marginy`],An={ranksep:50,edgesep:20,nodesep:50,rankdir:`tb`},jn=[`acyclicer`,`ranker`,`rankdir`,`align`],Mn=[`width`,`height`,`rank`],Nn={width:0,height:0},Pn=[`minlen`,`weight`,`width`,`height`,`labeloffset`],Fn={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:`r`},In=[`labelpos`,`arrowshape`];function Ln(e){let t=Qn(e.graph()),n={...An,...Zn(t,kn),...V(t,jn)},r=new D({multigraph:!0,compound:!0});return r.setGraph(n),e.nodes().forEach(t=>{let n=Zn(Qn(e.node(t)),Mn);Object.keys(Nn).forEach(e=>{n[e]===void 0&&(n[e]=Nn[e])}),r.setNode(t,n),r.setParent(t,e.parent(t))}),e.edges().forEach(t=>{let n=Qn(e.edge(t));r.setEdge(t,{...Fn,...Zn(n,Pn),...V(n,In)})}),r}function Rn(e){let t=e.graph();t.ranksep/=2,e.edges().forEach(n=>{let r=e.edge(n);r.minlen*=2,r.labelpos.toLowerCase()!==`c`&&(t.rankdir===`TB`||t.rankdir===`BT`?r.width+=r.labeloffset:r.height+=r.labeloffset)})}function zn(e){e.edges().forEach(t=>{let n=e.edge(t);if(n.width&&n.height){let n=e.node(t.v);Qe(e,`edge-proxy`,{rank:(e.node(t.w).rank-n.rank)/2+n.rank,e:t},`_ep`)}})}function Bn(e){let t=0;e.nodes().forEach(n=>{let r=e.node(n);r.borderTop&&(r.minRank=e.node(r.borderTop).rank,r.maxRank=e.node(r.borderBottom).rank,t=Math.max(t,r.maxRank))}),e.graph().maxRank=t}function Vn(e){e.nodes().forEach(t=>{let n=e.node(t);n.dummy===`edge-proxy`&&(e.edge(n.e).labelRank=n.rank,e.removeNode(t))})}function Hn(e){let t=1/0,n=0,r=1/0,i=0,a=e.graph(),o=a.marginx||0,s=a.marginy||0;function c(e){let a=e.x,o=e.y,s=e.width,c=e.height;t=Math.min(t,a-s/2),n=Math.max(n,a+s/2),r=Math.min(r,o-c/2),i=Math.max(i,o+c/2)}e.nodes().forEach(t=>c(e.node(t))),e.edges().forEach(t=>{let n=e.edge(t);Object.hasOwn(n,`x`)&&c(n)}),t-=o,r-=s,e.nodes().forEach(n=>{let i=e.node(n);i.x-=t,i.y-=r}),e.edges().forEach(n=>{let i=e.edge(n);i.points.forEach(e=>{e.x-=t,e.y-=r}),Object.hasOwn(i,`x`)&&(i.x-=t),Object.hasOwn(i,`y`)&&(i.y-=r)}),a.width=n-t+o,a.height=i-r+s}function Un(e,t,n){if(!n||!t)return e;let r=t.x-e.x,i=t.y-e.y,a=Math.sqrt(r*r+i*i);if(!a||a<=n)return e;let o=n/a;return{x:e.x+r*o,y:e.y+i*o}}function Wn(e){e.edges().forEach(t=>{let n=e.edge(t),r=e.node(t.v),i=e.node(t.w),a,o;!n.points||!n.points.length?(n.points=[],a=i,o=r):(a=n.points[0],o=n.points[n.points.length-1]);let s=et(r,a),c=et(i,o),l=n.points.length?n.points[0]:a,u=n.points.length?n.points[n.points.length-1]:o,d=n.arrowshape,f=d===`normal`||d===`vee`,p=!!n.reversed,m=s,h=c;f&&(p?m=Un(s,l,4):h=Un(c,u,4)),n.points.unshift(m),n.points.push(h)})}function Gn(e){e.edges().forEach(t=>{let n=e.edge(t);if(Object.hasOwn(n,`x`))switch((n.labelpos===`l`||n.labelpos===`r`)&&(n.width-=n.labeloffset),n.labelpos){case`l`:n.x-=n.width/2+n.labeloffset;break;case`r`:n.x+=n.width/2+n.labeloffset}})}function Kn(e){e.edges().forEach(t=>{let n=e.edge(t);n.reversed&&n.points.reverse()})}function qn(e){e.nodes().forEach(t=>{if(e.children(t).length){let n=e.node(t),r=e.node(n.borderTop),i=e.node(n.borderBottom),a=e.node(n.borderLeft[n.borderLeft.length-1]),o=e.node(n.borderRight[n.borderRight.length-1]);n.width=Math.abs(o.x-a.x),n.height=Math.abs(i.y-r.y),n.x=a.x+n.width/2,n.y=r.y+n.height/2}}),e.nodes().forEach(t=>{e.node(t).dummy===`border`&&e.removeNode(t)})}function Jn(e){e.edges().forEach(t=>{if(t.v===t.w){let n=e.node(t.v);n.selfEdges||=[],n.selfEdges.push({e:t,label:e.edge(t)}),e.removeEdge(t)}})}function Yn(e){I(e).forEach(t=>{let n=0;t.forEach((t,r)=>{let i=e.node(t);i.order=r+n,(i.selfEdges||[]).forEach(t=>{Qe(e,`selfedge`,{width:t.label.width,height:t.label.height,rank:i.rank,order:r+ ++n,e:t.e,label:t.label},`_se`)}),delete i.selfEdges})})}function Xn(e){e.nodes().forEach(t=>{let n=e.node(t);if(n.dummy===`selfedge`){let r=e.node(n.e.v),i=r.x+r.width/2,a=r.y,o=n.x-i,s=r.height/2;e.setEdge(n.e,n.label),e.removeNode(t),n.label.points=[{x:i+2*o/3,y:a-s},{x:i+5*o/6,y:a-s},{x:i+o,y:a},{x:i+5*o/6,y:a+s},{x:i+2*o/3,y:a+s}],n.label.x=n.x,n.label.y=n.y}})}function Zn(e,t){return H(V(e,t),Number)}function Qn(e){let t={};return e&&Object.entries(e).forEach(([e,n])=>{let r=e;typeof r==`string`&&(r=r.toLowerCase()),t[r]=n}),t}var $n={rankDirection:`TB`,nodeSeparation:50,rankSeparation:50,edgeSeparation:10,align:void 0,nodeWidth:100,nodeHeight:40,curvedEdges:!1,padding:20,arrowShape:`normal`,arrowSize:10};function er(e){return e.length?e.map((e,t)=>`${t===0?`M`:`L`} ${e.x} ${e.y}`).join(` `):``}function tr(e){if(!e.length)return``;if(e.length===1){let t=e[0];return`M ${t.x} ${t.y}`}if(e.length===2)return`M ${e[0].x} ${e[0].y} L ${e[1].x} ${e[1].y}`;let[t]=e,n=`M ${t.x} ${t.y}`;for(let t=1;t<e.length-1;t+=1){let r=e[t],i=e[t+1],a=r.x,o=r.y,s=(r.x+i.x)/2,c=(r.y+i.y)/2;n+=` Q ${a} ${o} ${s} ${c}`}let r=e[e.length-1];return n+=` L ${r.x} ${r.y}`,n}function nr(e){let{nodes:t,edges:n,configuration:r}=e,i=C(null),a=C(null),o=`dag-arrow-${f()}`;function s(e,t,n){a.value=null,i.value=null;let r={...$n,...n},s=new D({multigraph:!0,compound:!0});s.setGraph({rankdir:r.rankDirection,nodesep:r.nodeSeparation,ranksep:r.rankSeparation,edgesep:r.edgeSeparation,align:r.align}),e.forEach(e=>{s.setNode(e.id,{label:e.label,width:e.width??r.nodeWidth,height:e.height??r.nodeHeight})}),t.forEach(e=>{s.setEdge(e.from,e.to,{weight:e.weight??1,minlen:e.minLength??1,arrowShape:r.arrowShape??`normal`})}),Dn(s);let c=e.map(e=>{let t=s.node(e.id);return{id:e.id,label:e.label,x:t.x,y:t.y,width:t.width,height:t.height,original:e}}),l=s.edges().map(e=>{let n=s.edge(e),i=n.points||[];if(!i.length)return null;let a=r.curvedEdges?tr(i):er(i),c=r.arrowShape===`undirected`?null:`url(#${o})`,l=t.find(t=>t?.from===e.v&&t?.to===e.w);return{id:`${o}-${Array.from(JSON.stringify([e.v,e.w]),e=>e.codePointAt(0).toString(16)).join(`_`)}`,from:e.v,to:e.w,points:i,pathData:a,markerEnd:c,original:{...l,...n}}}).filter(Boolean),u=r.padding;if(!c.length){i.value={nodes:[],edges:l,viewBox:`0 0 0 0`,arrowShape:r.arrowShape,arrowSize:r.arrowSize};return}let f=c.flatMap(e=>[e.x-e.width/2,e.x+e.width/2]),p=c.flatMap(e=>[e.y-e.height/2,e.y+e.height/2]),m=Math.min(...f)-u,h=Math.max(...f)+u,g=Math.min(...p)-u,ee=Math.max(...p)+u;i.value={nodes:c,edges:l.map(e=>({...e,midpoint:e.pathData?d(e.pathData):{x:0,y:0}})),viewBox:`${m} ${g} ${h-m} ${ee-g}`,arrowShape:r.arrowShape,arrowSize:r.arrowSize}}return Ie(()=>{try{s(T(t)||[],T(n)||[],T(r)||{})}catch(e){console.error(`[useDag] layout error:`,e),a.value=e,i.value=null}}),{layoutData:i,lastError:a,arrowMarkerIdentifier:o,recomputeLayout:()=>{s(T(t)||[],T(n)||[],T(r)||{})}}}var rr=/* @__PURE__ */ e({default:()=>Ir}),ir=[`id`],ar=[`id`],or={key:1,class:`dag-chart-error`},sr={style:{position:`relative`}},cr=[`viewBox`,`xmlns`,`aria-describedby`],lr={key:0},ur=[`id`,`width`,`height`],dr=[`cx`,`cy`,`r`,`fill`],fr=[`x`,`y`,`width`,`height`,`fill`],pr={key:2},mr=[`id`,`markerWidth`,`markerHeight`,`refX`,`refY`],hr=[`d`,`fill`,`stroke`],gr={class:`vue-ui-dag-edges`},_r=[`data-a11y-midpoint-id`,`aria-label`,`onMouseenter`],vr={class:`vue-ui-dag-nodes`},yr=[`onClick`,`onMouseenter`,`onMouseleave`],br=[`data-a11y-node-id`,`aria-label`],xr=[`x`,`y`,`width`,`height`],Sr={class:`vue-ui-dag-edges`},Cr=[`d`,`stroke-width`,`marker-end`],wr={class:`vue-ui-dag-node-labels`},Tr=[`onClick`,`onMouseenter`,`onMouseleave`],Er=[`x`,`y`,`font-size`,`fill`,`font-weight`],Dr=[`x`,`y`,`font-size`,`fill`,`font-weight`,`innerHTML`],Or={key:1},kr={key:1,style:{position:`absolute`,top:`100%`,left:`0`,width:`100%`},"data-dom-to-png-ignore":``,"aria-hidden":`true`},Ar={key:6,class:`vue-data-ui-watermark`},jr=[`data-position`],Mr={key:0},Nr=[`data-position`],Pr={key:0},Fr=1.5,Ir=/*#__PURE__*/ ve({__name:`vue-ui-dag`,props:{dataset:{type:Object,default(){return{nodes:[],edges:[]}}},config:{type:Object,default(){return{}}}},emits:[`onNodeClick`,`onMidpointEnter`,`onMidpointLeave`,`copyAlt`,`rotate`],setup(e,{expose:d,emit:ve}){let Ie=Te(()=>import(`./PenAndPaper-B2UOwiJM.js`).then(e=>e.t)),ze=Te(()=>import(`./UserOptions-B97cPcKc.js`).then(e=>e.n)),Be=Te(()=>import(`./PackageVersion-B-1JX0wI.js`).then(e=>e.t)),{vue_ui_dag:Ve}=oe(),D=e,He=ve,O=C(null),k=C(f()),Ue=C(null),We=C(null),Ge=C(null),Ke=C(0),qe=C(0),Je=null,A=null,Ye=!1,j=C(null),M=C(null),Xe=C(!1),Ze=_(yt),Qe=_(()=>{let e=D.dataset;if(!Array.isArray(e?.nodes)||!e.nodes.length||e.edges!=null&&!Array.isArray(e.edges))return!1;let t=/* @__PURE__ */ new Set;for(let n of e.nodes){if(n?.id==null||![`string`,`number`].includes(typeof n.id)||typeof n.id==`number`&&!Number.isFinite(n.id)||t.has(String(n.id)))return!1;t.add(String(n.id))}return(e.edges||[]).every(e=>e&&e.from!=null&&e.to!=null&&t.has(String(e.from))&&t.has(String(e.to)))}),N=_(()=>!!Ze.value.loading||!Qe.value),$e=_(()=>h({defaultConfig:{userOptions:{show:!1},style:{chart:{backgroundColor:`#99999930`,nodes:{stroke:`#CCCCCC`,backgroundColor:`#DDDDDD50`},edges:{stroke:`#CCCCCC`},midpoints:{stroke:`#CCCCCC`,fill:`#CCCCCC`}}}},userConfig:Ze.value.skeletonConfig??{}})),P=_(()=>N.value?h({defaultConfig:Ze.value,userConfig:$e.value}):Ze.value),F=_(()=>P.value.style.chart.nodes),et=_(()=>P.value.style.chart.edges),I=_(()=>P.value.style.chart.midpoints),L=_(()=>P.value.style.chart),tt=_(()=>P.value.userOptions.useCursorPointer),nt=C(P.value.style.chart.width),rt=C(P.value.style.chart.height),it=C({x:0,y:0}),R=C(null),z=_(()=>Rt.value.get(R.value)??null),at=C(null),ot=C({left:`0px`,top:`0px`}),st=C(`top`),B=C(!1),ct=C({x:0,y:0}),lt=C({x:0,y:0}),V=C(null),H=_(()=>J(V.value)),ut=C(null),dt=C({left:`0px`,top:`0px`}),ft=C(`top`),U=C(!1),pt=C(!1),{svgRef:W}=ue({config:L.value.title}),{userOptionsVisible:mt,setUserOptionsVisibility:ht,keepUserOptionState:gt}=le({config:P.value}),G=C(P.value.style.chart.layout.rankDirection),_t={nodes:[{id:`A`,label:``},{id:`B`,label:``},{id:`C`,label:``}],edges:[{from:`A`,to:`B`},{from:`A`,to:`C`}]},vt=_(()=>N.value?D.config?.skeletonDataset??_t:D.dataset);ie({config:()=>P.value,dataset:()=>D.dataset,component:`VueUiDag`,rules:[ae.noHint]});function yt(){return c(D.config,Ve,me)}let bt=_(()=>Ze.value.debug);E([()=>D.dataset,bt],([e,t])=>{t&&(ne(e)&&m({componentName:`VueUiDag`,type:`dataset`}),!Array.isArray(e?.nodes)||!e.nodes.length?m({componentName:`VueUiDag`,type:`datasetAttributeEmpty`,property:`nodes`,index:0}):Qe.value||console.warn(`VueUiDag: provide unique node IDs and an edges array whose endpoints reference existing nodes.`))},{deep:!0,immediate:!0}),Ne(yn),E(()=>D.config,()=>{mt.value=!P.value.userOptions.showOnChartHover,Ke.value+=1},{deep:!0}),E(()=>Ze.value.style.chart.layout.rankDirection,e=>{G.value=e}),E(()=>Ze.value.style.chart.zoom.active,e=>{Bt.value=e}),E(()=>P.value.responsive,yn,{flush:`post`}),E(L,()=>{P.value.responsive?vn():(nt.value=L.value.width,rt.value=L.value.height)},{deep:!0,flush:`post`});let{isPrinting:K,isImaging:xt,generatePdf:St,generateImage:Ct}=se({elementId:`dag_${k.value}`,fileName:L.value.title.text||`vue-ui-dag`,options:P.value.userOptions.print}),wt=_(()=>L.value.backgroundColor),Tt=_(()=>L.value.title),{isCallbackImaging:Et,isCallbackSvg:Dt,generateSvg:Ot,onGenerateImage:kt}=ce({svg:W,title:Tt,legend:null,legendItems:null,backgroundColor:wt,getSvgCallback:()=>P.value.userOptions.callbacks.svg,generateImage:Ct});function At(){ht(!0)}function jt(){ht(!1)}function Mt({tooltipRef:e,isVisibleRef:t,anchorRef:n,styleRef:r,placementRef:i,offsetRef:a,margin:o=24}){return function(){let s=e.value;if(!s||!t.value)return;let c=s.getBoundingClientRect(),l=window.innerWidth,u=window.innerHeight,d=n.value.x,f=n.value.y,p=a?.value?.x??0,m=a?.value?.y??0,h=f-m-c.height-o,g=d-c.width/2,ee=`top`;if(h<o){let e=f+m+o;e+c.height<=u-o?(h=e,ee=`bottom`):(h=f-c.height/2,h<o&&(h=o),h+c.height>u-o&&(h=u-c.height-o),ee=`center`)}g<o&&(g=o),g+c.width>l-o&&(g=l-c.width-o);let te=g<=o,ne=g+c.width>=l-o;if((te||ne)&&ee!==`center`){let e,t,n=d-p-o;l-(d+p)-o>=n?(e=`right`,t=d+p+o):(e=`left`,t=d-p-o-c.width),t>=o&&t+c.width<=l-o&&(g=t,h=f-c.height/2,h<o&&(h=o),h+c.height>u-o&&(h=u-c.height-o),ee=e)}i.value=ee,r.value={left:`${g}px`,top:`${h}px`}}}function Nt(e,t){return e&&JSON.stringify(e)===JSON.stringify(t)?e:t}let{layoutData:Pt,lastError:Ft,arrowMarkerIdentifier:It}=nr({nodes:_(e=>Nt(e,(vt.value.nodes||[]).map(e=>({id:e.id,width:e.width,height:e.height})))),edges:_(e=>Nt(e,(vt.value.edges||[]).map(e=>({from:e.from,to:e.to,...e.weight===void 0?{}:{weight:e.weight},...e.minLength===void 0?{}:{minLength:e.minLength}})))),configuration:_(e=>Nt(e,{...L.value.layout,rankDirection:G.value}))}),q=_(()=>{if(!Pt.value)return null;let e=new Map((vt.value.nodes||[]).map(e=>[String(e.id),e])),t=/* @__PURE__ */ new Map;for(let e of vt.value.edges||[]){let n=JSON.stringify([String(e.from),String(e.to)]);t.has(n)||t.set(n,e)}return{...Pt.value,nodes:Pt.value.nodes.map(t=>{let n=e.get(String(t.id))??t.original;return{...t,label:n.label,original:{...n,backgroundColor:n.backgroundColor?u(n.backgroundColor):F.value.backgroundColor,color:n.color?u(n.color):F.value.labels.color}}}),edges:Pt.value.edges.map(e=>({...e,original:{...t.get(JSON.stringify([e.from,e.to])),...e.original}}))}}),Lt=_(()=>new Map((q.value?.nodes||[]).map(e=>[String(e.id),e]))),Rt=_(()=>new Map((q.value?.edges||[]).map(e=>[e.id,e])));function J(e){return e==null?null:Lt.value.get(String(e))??null}let zt=_(()=>{let e=nt.value,t=rt.value,n=Number(e),r=Number(t),i=Number.isFinite(n)&&n>0,a=Number.isFinite(r)&&r>0;return!i&&!a?null:{width:i?n:null,height:a?r:null}}),Bt=C(L.value.zoom.active),Vt=_(()=>Bt.value&&!pt.value),{viewBox:Y,resetZoom:Ht,setInitialViewBox:Ut,scale:Wt,zoomByFactor:Gt}=re(W,{x:0,y:0,width:100,height:100},1,Vt,()=>{X(),pn(),Q()}),Kt=null,qt=0;function X(){qt+=1,Kt!==null&&cancelAnimationFrame(Kt),Kt=null}function Jt(e=!1){X(),Ht(e)}async function Yt(e,{smooth:t=!0,duration:n=300,zoomReset:r=!1,zoom:i=null}={}){let a=J(e);if(Ye||!a)return!1;let o=Y.value;if(!o)return!1;let s={x:Number(o.x),y:Number(o.y),width:Number(o.width),height:Number(o.height)},c=Wt.value,u=s.width,d=s.height,f=c;if(Number.isFinite(i)&&i>0||r){Jt(!1);let e=Y.value,t=Number.isFinite(i)&&i>0?i/100:1;u=Number(e.width)/t,d=Number(e.height)/t,f=t,Y.value={...s},Wt.value=c}let p=Number(a.x),m=Number(a.y);if(!Number.isFinite(s.x)||!Number.isFinite(s.y)||!Number.isFinite(s.width)||!Number.isFinite(s.height)||!Number.isFinite(u)||!Number.isFinite(d)||!Number.isFinite(p)||!Number.isFinite(m))return!1;let h={x:p-u/2,y:m-d/2,width:u,height:d};X();let ee=qt;if(B.value=!1,!t||!Number.isFinite(n)||n<=0)return Y.value=h,Wt.value=f,!0;let te=performance.now();function ne(e){if(Ye||ee!==qt)return;let t=Math.min((e-te)/n,1),r=g(t);Y.value={x:l(s.x,h.x,r),y:l(s.y,h.y,r),width:l(s.width,h.width,r),height:l(s.height,h.height,r)},Wt.value=l(c,f,r),t<1?Kt=requestAnimationFrame(ne):(Y.value=h,Wt.value=f,Kt=null)}return Kt=requestAnimationFrame(ne),!0}E(Pt,X);function Xt(){Bt.value=!Bt.value}function Zt(){let e=q.value&&q.value.viewBox;if(!e)return;let t=String(e).split(` `).map(Number);if(t.length!==4)return;let[n,r,i,a]=t;if(!Number.isFinite(n)||!Number.isFinite(r)||!Number.isFinite(i)||!Number.isFinite(a))return;let o=i,s=a,c=n,l=r,u=zt.value;u&&(u.width!==null&&(o=u.width),u.height!==null&&(s=u.height),c=n-(o-i)/2,l=r-(s-a)/2),Ut({x:c,y:l,width:o,height:s},{overwriteCurrentIfNotZoomed:!0})}E(()=>q.value&&q.value.viewBox,()=>{Zt()},{immediate:!0}),E(()=>zt.value,()=>{Zt()});let Qt=_(()=>{let e=Y.value;return e?`${e.x} ${e.y} ${e.width} ${e.height}`:`0 0 0 0`}),Z=C(!1),$t=C({width:0,height:0});E([W,Z,()=>L.value.backgroundPattern.show],([e,t,n],r,i)=>{if(!e||!t||!n)return;let a=()=>{let{width:t,height:n}=e.getBoundingClientRect();(t!==$t.value.width||n!==$t.value.height)&&($t.value={width:t,height:n})};a();let o=new ResizeObserver(a);o.observe(e),i(()=>o.disconnect())},{flush:`post`});let en=_(()=>{let e=Y.value;if(!e||!Z.value)return e;let{width:t,height:n}=$t.value;if(!(t>0&&n>0&&e.width>0&&e.height>0))return e;let r=Math.min(t/e.width,n/e.height),i=t/r,a=n/r;return{x:e.x-(i-e.width)/2,y:e.y-(a-e.height)/2,width:i,height:a}});function tn(e){Z.value=e,qe.value+=1}function nn(){pt.value=!pt.value}function rn(){X(),Gt(Fr,!0)}function an(){X(),Gt(1/Fr,!0)}let on=[`TB`,`RL`,`BT`,`LR`];function sn(){G.value=on[(on.indexOf(G.value)+1)%on.length],Jt(),He(`rotate`,G.value)}let cn=Mt({tooltipRef:at,isVisibleRef:U,anchorRef:it,styleRef:ot,placementRef:st}),ln=Mt({tooltipRef:ut,isVisibleRef:B,anchorRef:ct,styleRef:dt,placementRef:ft,offsetRef:lt}),un=C(null);async function dn(e){He(`onMidpointEnter`,e),e?.midpoint&&W.value&&(R.value=e.id,U.value=!0,I.value.selectedEdge.animated===!0&&(un.value=e.id),await Oe(),mn())}function Q(){U.value=!1,R.value=null,He(`onMidpointLeave`),I.value.selectedEdge.animated===!0&&(un.value=null)}async function fn(e){He(`onNodeClick`,e),F.value.tooltip.showOnClick&&W.value&&(V.value=e.id,B.value=!0,await Oe(),mn())}function pn(){B.value=!1,V.value=null}function mn(){if(Ye)return;let e=W.value;if(e){if(U.value&&z.value?.midpoint){let t=z.value.midpoint,n=te(t.x,t.y,e);n&&(it.value=n),cn()}if(B.value&&H.value){let t=H.value,n=te(t.x,t.y,e);n&&(ct.value=n);let r=e.getScreenCTM?.();r&&(lt.value={x:t.width*Math.hypot(r.a,r.b||0)/2,y:t.height*Math.hypot(r.c||0,r.d)/2}),ln()}}}E([q,Y,N],()=>{B.value&&(N.value||!F.value.tooltip.showOnClick||V.value!=null&&!H.value)&&pn(),U.value&&(N.value||!I.value.show||R.value!=null&&!z.value)&&Q(),j.value!=null&&!qn.value.some(e=>e.id===j.value&&e.type===M.value)&&$n(),mn()},{deep:!0,flush:`post`});function hn(e){if(!(B.value||U.value))return;let t=ut.value;if(t&&t.contains(e.target))return;let n=at.value;if(n&&n.contains(e.target))return;let r=W.value;if(r&&r.contains(e.target)){let t=e.target.closest(`.vue-ui-dag-node`),n=e.target.closest(`.vue-ui-dag-edge-midpoint`);if(t||n)return}pn(),Q(),Xe.value||$n()}function gn(e){e.key===`Escape`&&(B.value&&pn(),U.value&&Q())}Ne(()=>{document.addEventListener(`mousedown`,hn),document.addEventListener(`keydown`,gn),window.addEventListener(`scroll`,mn,!0),window.addEventListener(`resize`,mn)}),Me(()=>{Ye=!0,document.removeEventListener(`mousedown`,hn),document.removeEventListener(`keydown`,gn),window.removeEventListener(`scroll`,mn,!0),window.removeEventListener(`resize`,mn),Je?.disconnect(),A!==null&&cancelAnimationFrame(A),X(),clearTimeout(kn)});function _n(){if(A=null,Ye||!P.value.responsive||!O.value?.parentNode)return;let{width:e,height:t}=de({chart:O.value,title:L.value.title.text?Ue.value:null,legend:L.value.controls.show?Ge.value?.$el:null,source:We.value});nt.value=Math.max(.1,e),rt.value=Math.max(.1,t-12)}function vn(){!Ye&&P.value.responsive&&A===null&&(A=requestAnimationFrame(_n))}function yn(){Je?.disconnect(),Je=null,A!==null&&cancelAnimationFrame(A),A=null,Ye||(P.value.responsive?O.value?.parentNode&&(Je=new ResizeObserver(vn),Je.observe(O.value.parentNode),vn()):(nt.value=L.value.width,rt.value=L.value.height))}function bn(e,{direction:t=-1,dasharray:n}={}){if(!e||typeof e.getTotalLength!=`function`)return bt.value&&console.warn(`VueUiDag @getIdealDashoffsetDelta: invalid path element`,e),0;let r=e.getTotalLength(),i=String(n??``).trim().split(/[\s,]+/).map(e=>Number.parseFloat(e)).filter(Number.isFinite),a=i.reduce((e,t)=>e+t,0)*(i.length%2?2:1);return t*(a>0&&Number.isFinite(a)?Math.max(1,Math.round(r/a))*a:r)}let xn=C(/* @__PURE__ */ new Map),Sn=C(/* @__PURE__ */ new Map);function Cn(e){return function(t){t?xn.value.set(e,t):xn.value.delete(e)}}function wn(){Sn.value.forEach(e=>{try{e.cancel()}catch{}}),Sn.value.clear()}function Tn(){if(wn(),Ye)return;let e=q.value?.edges??[];if(!e.length)return;let t=et.value.animations,n=Number(t.referenceDistance)>0?Number(t.referenceDistance):24;e.forEach(e=>{let r=Fn.value.get(e.id)?.animated,i=xn.value.get(e.id);if(!i||typeof i.animate!=`function`)return;if(!r){i.style.strokeDasharray=`0`,i.style.strokeDashoffset=`0`;return}let a=e?.original?.dasharray??t.dasharray;i.style.strokeDasharray=String(a),i.style.strokeDashoffset=`0`;let o=![void 0,null].includes(e?.original?.animationDirection),s=![void 0,null].includes(t.animationDirection),c=bn(i,{direction:o?Number(e.original.animationDirection):s?Number(t.animationDirection):-1,dasharray:String(a)}),l=e?.original?.animationDurationMs??t.animationDurationMs??1e3,u=Number(l),d=Number.isFinite(u)&&u>0?n/u:n/1e3,f=Math.max(1,Math.round(Math.abs(c)/Math.max(1e-9,d))),p=i.animate([{strokeDashoffset:0},{strokeDashoffset:c}],{duration:f,iterations:1/0,easing:`linear`});Sn.value.set(e.id,p)})}Me(()=>{wn()});async function En({scale:e=2}={}){if(!O.value)return;let{width:t,height:n}=O.value.getBoundingClientRect(),r=t/n,{imageUri:i,base64:a}=await fe({domElement:O.value,base64:!0,img:!0,scale:e});return{imageUri:i,base64:a,title:L.value.title.text??`vue-ui-dag`,width:t,height:n,aspectRatio:r}}let Dn=_(()=>{let e=Number(L.value.layout.nodeHeight);return Number.isFinite(e)&&e>0?e/L.value.backgroundPattern.spacingRatio:12}),On=_(()=>Dn.value*(L.value.backgroundPattern.dotRadiusRatio/100)),$=C(null),kn=null,An=0;function jn(e){kn&&=(clearTimeout(kn),null),$.value!==e&&($.value=e)}function Mn(e){un.value=null,jn(e)}async function Nn(e){$.value=null,await dn(e)}function Pn(e){let t=++An;kn&&clearTimeout(kn),kn=setTimeout(()=>{t===An&&$.value===e&&($.value=null)},20)}let Fn=_(()=>new Map((q.value?.edges||[]).map(e=>{let t=$.value!=null&&String(e.from)===String($.value),n=$.value!=null&&String(e.to)===String($.value),r=un.value===e.id||z.value?.id===e.id||M.value===`midpoint`&&j.value===e.id,i=e.original.color??et.value.stroke;return r&&I.value.selectedEdge.stroke!=null?i=I.value.selectedEdge.stroke:t&&F.value.selected.downstreamEdges.stroke!=null?i=F.value.selected.downstreamEdges.stroke:n&&F.value.selected.upstreamEdges.stroke!=null&&(i=F.value.selected.upstreamEdges.stroke),[e.id,{stroke:i,active:r,width:et.value.strokeWidth*(r||t?2:1),animated:!!e.original.animated||r&&I.value.selectedEdge.animated===!0||t&&F.value.selected.downstreamEdges.animated===!0||n&&F.value.selected.upstreamEdges.animated===!0}]})));E([Fn,()=>et.value.animations,()=>q.value?.edges],Tn,{deep:!0,flush:`post`}),Ne(Tn);function In(e){let t=Fn.value.get(e.id);return{d:e.pathData,fill:`none`,stroke:t.stroke,"stroke-width":t.width,"stroke-linecap":`round`,"stroke-linejoin":`round`}}function Ln(e){return M.value===`node`&&j.value===e}function Rn(e){let t=$.value===e.id,n=M.value===`node`&&j.value===e.id,r=t||n,i=r&&F.value.selected.backgroundColor!=null?F.value.selected.backgroundColor:e.original.backgroundColor,a=r&&F.value.selected.stroke!=null?F.value.selected.stroke:F.value.stroke,o=r&&F.value.selected.strokeWidth!=null?F.value.selected.strokeWidth:F.value.strokeWidth;return{x:e.x-e.width/2,y:e.y-e.height/2,width:e.width,height:e.height,rx:F.value.borderRadius,fill:i,stroke:a,"stroke-width":o}}function zn(e){let t=Fn.value.get(e.id),n=M.value===`midpoint`&&j.value===e.id;return{cx:e.midpoint?.x,cy:e.midpoint?.y,r:I.value.radius,fill:n?I.value.selectedEdge.stroke??I.value.fill:I.value.fill,stroke:t.stroke,"stroke-width":t.width}}function Bn(e){return Fn.value.get(e.id).stroke}let Vn=_(()=>{let e=q.value?.arrowSize||0;return q.value?.arrowShape===`normal`?`M 0 0 L ${e} ${e/2} L 0 ${e} Z`:`M 0 0 L ${e} ${e/2} L 0 ${e} L ${e/3} ${e/2} Z`});function Hn(e){return`${It}-${String(e).replace(/[^a-zA-Z0-9_-]/g,`_`)}`}function Un(){return q.value}async function Wn(){He(`copyAlt`,{config:P.value,dataset:vt.value}),P.value.userOptions.callbacks.altCopy?await Promise.resolve(P.value.userOptions.callbacks.altCopy({config:P.value,dataset:vt.value})):console.warn("Vue Data UI - A callback must be set for `altCopy` in userOptions.")}let Gn=_(()=>(q.value?.nodes??[]).map(e=>({id:e.id,type:`node`,x:e.x,y:e.y,label:e.label??e.id,raw:e}))),Kn=_(()=>I.value.show?(q.value?.edges??[]).filter(e=>e?.midpoint).map(e=>({id:e.id,type:`midpoint`,x:e.midpoint.x,y:e.midpoint.y,label:`${J(e.from)?.label??e.from} → ${J(e.to)?.label??e.to}`,raw:e})):[]),qn=_(()=>[...Gn.value,...Kn.value].sort((e,t)=>e.x===t.x?e.y-t.y:e.x-t.x)),Jn=_(()=>{let e=q.value?.nodes??[],t=q.value?.edges??[],n=[P.value.a11y?.translations?.node??`Node`,P.value.a11y?.translations?.parents??`Parents`,P.value.a11y?.translations?.children??`Children`],r=/* @__PURE__ */ new Map,i=/* @__PURE__ */ new Map;for(let e of t){let t=String(e.from),n=String(e.to);r.has(n)||r.set(n,[]),i.has(t)||i.set(t,[]),r.get(n).push(J(e.from)?.label??e.from),i.get(t).push(J(e.to)?.label??e.to)}return{headers:n,rows:e.map(e=>[e.label??e.id,r.get(String(e.id))?.join(`, `)||`—`,i.get(String(e.id))?.join(`, `)||`—`])}});function Yn(e){return`${e.type}:${e.id}`}function Xn(){return j.value==null||M.value==null?null:qn.value.find(e=>e.id===j.value&&e.type===M.value)??null}async function Zn(e){e&&(e.type===`node`?Q():e.type===`midpoint`&&(pn(),await dn(e.raw)))}function Qn(e){e&&(j.value=e.id,M.value=e.type,e.type===`node`?(jn(e.id),un.value=null):e.type===`midpoint`&&($.value=null,un.value=e.id))}function $n(){j.value=null,M.value=null,B.value||($.value=null),U.value||(un.value=null)}function er(){Xe.value=!0,$n()}function tr(){Xe.value=!1,pn(),Q(),$n()}function rr(e,t,n){let r=t.x-e.x,i=t.y-e.y;return n===`right`&&r<=0||n===`left`&&r>=0||n===`down`&&i<=0||n===`up`&&i>=0?1/0:n===`right`||n===`left`?Math.abs(r)*1e3+Math.abs(i):Math.abs(i)*1e3+Math.abs(r)}function Ir(e,t){let n=qn.value.filter(t=>Yn(t)!==Yn(e));if(!n.length)return null;let r=null,i=1/0;return n.forEach(n=>{let a=rr(e,n,t);a<i&&(i=a,r=n)}),r||(t===`right`||t===`down`?qn.value[0]??null:qn.value[qn.value.length-1]??null)}async function Lr(e){e&&e.type===`node`&&(Q(),await fn(e.raw))}async function Rr(e){if(!W.value||pt.value||document.activeElement!==W.value||!qn.value.length)return;let t=e.key===`ArrowLeft`,n=e.key===`ArrowRight`,r=e.key===`ArrowUp`,i=e.key===`ArrowDown`,a=e.key===`Enter`||e.key===` `,o=e.key===`Escape`;if(!t&&!n&&!r&&!i&&!a&&!o)return;if(e.preventDefault(),e.stopPropagation(),o){pn(),Q(),$n();return}let s=Xn();if(a){if(!s)return;s.type===`node`&&await Lr(s);return}if(!s){let e=qn.value[0];if(!e)return;Qn(e),await Zn(e);return}let c=null;n?c=Ir(s,`right`):t?c=Ir(s,`left`):i?c=Ir(s,`down`):r&&(c=Ir(s,`up`)),c&&(pn(),Q(),Qn(c),await Zn(c))}d({getData:Un,getImage:En,generatePdf:St,generateSvg:Ot,generateImage:Ct,toggleAnnotator:nn,toggleFullscreen:tn,zoomIn:rn,zoomOut:an,resetZoom:Jt,switchDirection:sn,copyAlt:Wn,focusOnNode:Yt});let zr=_(()=>s(P.value.userOptions?.annotator?.followZoom,Y.value));return(e,s)=>(S(),b(`div`,{class:ke(`vue-data-ui-component vue-ui-dag ${Z.value?`vue-data-ui-wrapper-fullscreen`:``} ${P.value.responsive?`vue-ui-dag-responsive`:``}`),id:`dag_${k.value}`,ref_key:`dagChart`,ref:O,style:je({fontFamily:P.value.style.fontFamily,backgroundColor:L.value.backgroundColor,padding:`0.5rem`}),onMouseenter:At,onMouseleave:jt},[x(`div`,{id:`chart-instructions-${k.value}`,class:`sr-only`},[x(`p`,null,Fe(P.value.a11y.translations.keyboardNavigation),1)],8,ar),P.value.a11y.includeTable&&Jn.value?.rows?.length?(S(),v(ge,{key:0,uid:k.value,head:Jn.value.headers,body:Jn.value.rows,notice:P.value.a11y.translations.tableAvailable,caption:P.value.a11y.translations.tableCaption},null,8,[`uid`,`head`,`body`,`notice`,`caption`])):y(``,!0),T(Ft)?(S(),b(`div`,or,Fe(String(T(Ft))),1)):y(``,!0),P.value.userOptions.buttons.annotator?(S(),v(T(Ie),De({key:2},T(a)(P.value.userOptions.annotator),{svgRef:T(W),followZoom:P.value.userOptions?.annotator?.followZoom,annotationViewport:zr.value,backgroundColor:L.value.backgroundColor,color:L.value.color,active:pt.value,isCursorPointer:tt.value,palette:P.value.userOptions.annotatorPalette,onClose:nn}),Se({_:2},[Pe(T(o),t=>({name:t,fn:Le(n=>[w(e.$slots,t,Ae(Ee(T(i)(t,n))),void 0,!0)])}))]),1040,[`svgRef`,`followZoom`,`annotationViewport`,`backgroundColor`,`color`,`active`,`isCursorPointer`,`palette`])):y(``,!0),P.value.userOptions.show&&Qe.value&&(T(gt)||T(mt))?(S(),v(T(ze),De({key:`user_option_${qe.value}`,backgroundColor:L.value.backgroundColor,color:L.value.color,isPrinting:T(K),isImaging:T(xt),uid:k.value,hasTooltip:!1,hasTable:!1,hasXls:!1,hasLabel:!1,isFullscreen:Z.value,chartElement:O.value},T(n)(P.value.userOptions,`pdf img svg fullscreen altCopy annotator zoom`),{isAnnotation:pt.value,isZoom:Vt.value,isCursorPointer:tt.value,onToggleFullscreen:tn,onGeneratePdf:T(St),onGenerateImage:T(kt),onGenerateSvg:T(Ot),onToggleAnnotator:nn,onToggleZoom:Xt,onCopyAlt:Wn,style:{visibility:T(gt)?T(mt)?`visible`:`hidden`:`visible`}}),Se({_:2},[Pe(T(t)(e.$slots,`menuIcon optionPdf optionImg optionSvg optionFullscreen optionAnnotator optionZoom optionAltCopy custom-menu-before custom-menu-after`),t=>({name:t,fn:Le(n=>[w(e.$slots,t,Ae(Ee(T(r)(t,n))),void 0,!0)])}))]),1040,[`backgroundColor`,`color`,`isPrinting`,`isImaging`,`uid`,`isFullscreen`,`chartElement`,`isAnnotation`,`isZoom`,`isCursorPointer`,`onGeneratePdf`,`onGenerateImage`,`onGenerateSvg`,`style`])):y(``,!0),L.value.title.text?(S(),b(`div`,{key:4,ref_key:`chartTitle`,ref:Ue,style:`width:100%;background:transparent;`},[(S(),v(pe,{key:`title_${Ke.value}`,config:{title:{cy:`dag-title`,...L.value.title},subtitle:{cy:`dag-subtitle`,...L.value.title.subtitle}}},null,8,[`config`]))],512)):y(``,!0),L.value.controls.position===`top`&&!N.value&&L.value.controls.show?(S(),v(_e,{key:5,ref_key:`zoomControls`,ref:Ge,config:P.value,scale:T(Wt),isFullscreen:Z.value,withDirection:``,onZoomIn:rn,onZoomOut:an,onResetZoom:s[0]||=()=>Jt(!0),onSwitchDirection:sn},null,8,[`config`,`scale`,`isFullscreen`])):y(``,!0),x(`div`,sr,[q.value?(S(),b(`svg`,{key:0,ref_key:`svgRef`,ref:W,class:ke({"vue-ui-dag-svg":!0,"vue-data-ui-loading":N.value}),viewBox:Qt.value,xmlns:T(ee),style:je({backgroundColor:L.value.backgroundColor,height:`100%`,width:`100%`}),tabindex:`0`,"aria-describedby":`chart-instructions-${k.value}`,onMousedown:X,onTouchstart:X,onFocus:er,onBlur:tr,onKeydown:Rr},[we(T(Be)),w(e.$slots,`svg-underlayer`,{svg:{drawingArea:T(Y),data:q.value,orientation:G.value,isPrintingImg:T(K)||T(xt)||T(Et),isPrintingSvg:T(Dt)}},void 0,!0),L.value.backgroundPattern.show?(S(),b(`defs`,lr,[x(`pattern`,{id:`dag_bg_pattern_${k.value}`,patternUnits:`userSpaceOnUse`,width:Dn.value,height:Dn.value},[w(e.$slots,`background-pattern`,Ae(Ee({x:Dn.value/2,y:Dn.value/2,color:L.value.backgroundPattern.dotColor})),()=>[x(`circle`,{cx:Dn.value/2,cy:Dn.value/2,r:On.value,fill:L.value.backgroundPattern.dotColor},null,8,dr)],!0)],8,ur)])):y(``,!0),L.value.backgroundPattern.show?(S(),b(`rect`,{key:1,x:en.value?.x??0,y:en.value?.y??0,width:en.value?.width??0,height:en.value?.height??0,fill:`url(#dag_bg_pattern_${k.value})`,style:je({pointerEvents:`none`,opacity:L.value.backgroundPattern.opacity})},null,12,fr)):y(``,!0),q.value.arrowShape===`undirected`?y(``,!0):(S(),b(`defs`,pr,[(S(!0),b(ye,null,Pe(q.value.edges,e=>(S(),b(`marker`,{key:`marker_${e.id}`,id:Hn(e.id),markerWidth:q.value.arrowSize,markerHeight:q.value.arrowSize,refX:q.value.arrowSize-3,refY:q.value.arrowSize/2,orient:`auto`,markerUnits:`strokeWidth`},[x(`path`,{d:Vn.value,fill:Bn(e),stroke:Bn(e),"stroke-width":`0`,style:{transition:`stroke 0.2s ease-in-out,
|
|
2
2
|
fill 0.2s ease-in-out,
|
|
3
3
|
stroke-width 0.2s ease-in-out`}},null,8,hr)],8,mr))),128))])),x(`g`,gr,[(S(!0),b(ye,null,Pe(q.value.edges,e=>(S(),b(ye,{key:e.id},[x(`path`,De({"data-cy-edge":``,ref_for:!0,ref:Cn(e.id)},{ref_for:!0},In(e),{style:{"pointer-events":`none`,transition:`stroke-width 0.2s ease-in-out,
|
|
4
4
|
stroke 0.2s ease-in-out`}}),null,16),I.value.show?(S(),b(`circle`,De({key:0,"data-cy-midpoint":``,class:`vue-ui-dag-edge-midpoint`,"data-a11y-midpoint-id":e.id},{ref_for:!0},zn(e),{"aria-label":`${J(e.from)?.label??e.from} to ${J(e.to)?.label??e.to}`,style:{transition:`stroke-width 0.2s ease-in-out,
|
|
@@ -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"./useNestedProp-DnGoh-XS.js";import{n as c,t as l}from"./useHints-C-TwxM0Y.js";import{t as ee}from"./useConfig-B8qvYKdK.js";import{X as te}from"./lib-rPeBMZrn.js";import{t as ne}from"./usePrinter-DVf3YcG5.js";import{t as re}from"./UserOptions-K1N7zQRx.js";import{n as ie}from"./PenAndPaper-BV5ODysA.js";import{t as u}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{Fragment as d,computed as f,createBlock as p,createCommentVNode as m,createElementBlock as h,createElementVNode as g,createSlots as ae,defineAsyncComponent as _,guardReactiveProps as v,mergeProps as y,normalizeClass as b,normalizeProps as oe,normalizeStyle as x,onBeforeUnmount as se,openBlock as S,ref as C,renderList as w,renderSlot as T,resolveDynamicComponent as ce,shallowReactive as le,shallowRef as E,toRaw as ue,unref as D,useCssVars as de,watch as O,withCtx as fe,withModifiers as pe}from"vue";var me=/* @__PURE__ */ e({default:()=>k}),he=[`id`],ge=[`onPointerdown`],_e=[`onPointerdown`],k=/*#__PURE__*/ u({__name:`vue-ui-dashboard`,props:{dataset:{type:Array,default:()=>[]},config:Object},emits:[`change`,`copyAlt`],setup(e,{expose:u,emit:me}){de(e=>({v1f8a1d55:je.value,v4502d4a5:Me.value}));let k={VueDataUi:_(()=>import(`./vue-data-ui-BmTsLaNH.js`).then(e=>e.n)),VueUi3dBar:_(()=>import(`./vue-ui-3d-bar-D3pDUYiG.js`).then(e=>e.n)),VueUiAccordion:_(()=>import(`./vue-ui-accordion-BpTfjWvH.js`).then(e=>e.n)),VueUiAgePyramid:_(()=>import(`./vue-ui-age-pyramid-bJmGRZ59.js`).then(e=>e.n)),VueUiAnnotator:_(()=>import(`./vue-ui-annotator-C-gyszpf.js`).then(e=>e.n)),VueUiCandlestick:_(()=>import(`./vue-ui-candlestick-BwETH5d4.js`).then(e=>e.n)),VueUiChestnut:_(()=>import(`./vue-ui-chestnut-Cg8m6-N6.js`).then(e=>e.n)),VueUiDigits:_(()=>import(`./vue-ui-digits-ByjwG9Hv.js`).then(e=>e.n)),VueUiDonut:_(()=>import(`./vue-ui-donut-BV3btR0S.js`).then(e=>e.n)),VueUiDonutEvolution:_(()=>import(`./vue-ui-donut-evolution-CPIVtWxh.js`).then(e=>e.n)),VueUiDumbbell:_(()=>import(`./vue-ui-dumbbell-bTQpX8A6.js`).then(e=>e.n)),VueUiFlow:_(()=>import(`./vue-ui-flow-BRC3pGzL.js`).then(e=>e.n)),VueUiGalaxy:_(()=>import(`./vue-ui-galaxy-D91dIUfs.js`).then(e=>e.n)),VueUiGauge:_(()=>import(`./vue-ui-gauge-DM3p5s8H.js`).then(e=>e.n)),VueUiHeatmap:_(()=>import(`./vue-ui-heatmap-BvVHrOcc.js`).then(e=>e.n)),VueUiKpi:_(()=>import(`./vue-ui-kpi-BPL64spX.js`).then(e=>e.n)),VueUiMiniLoader:_(()=>import(`./vue-ui-mini-loader-DyefvJIr.js`).then(e=>e.n)),VueUiMolecule:_(()=>import(`./vue-ui-molecule-B7KJzavj.js`).then(e=>e.n)),VueUiMoodRadar:_(()=>import(`./vue-ui-mood-radar-6q5OUW6D.js`).then(e=>e.n)),VueUiNestedDonuts:_(()=>import(`./vue-ui-nested-donuts-C137tg5U.js`).then(e=>e.n)),VueUiOnion:_(()=>import(`./vue-ui-onion-ClMux968.js`).then(e=>e.n)),VueUiParallelCoordinatePlot:_(()=>import(`./vue-ui-parallel-coordinate-plot-JbfDQzwN.js`).then(e=>e.n)),VueUiQuadrant:_(()=>import(`./vue-ui-quadrant-BPKWN3Ac.js`).then(e=>e.n)),VueUiQuickChart:_(()=>import(`./vue-ui-quick-chart-BvqQnNn1.js`).then(e=>e.n)),VueUiRadar:_(()=>import(`./vue-ui-radar-DIdTBEet.js`).then(e=>e.n)),VueUiRating:_(()=>import(`./vue-ui-rating-CFu9LjID.js`).then(e=>e.n)),VueUiRelationCircle:_(()=>import(`./vue-ui-relation-circle-5Noti3DC.js`).then(e=>e.n)),VueUiRings:_(()=>import(`./vue-ui-rings-B-cJIyAX.js`).then(e=>e.n)),VueUiScatter:_(()=>import(`./vue-ui-scatter-DcchOWYi.js`).then(e=>e.n)),VueUiSkeleton:_(()=>import(`./vue-ui-skeleton-DtHam8Oi.js`).then(e=>e.n)),VueUiSmiley:_(()=>import(`./vue-ui-smiley-C8ES41OS.js`).then(e=>e.n)),VueUiSparkHistogram:_(()=>import(`./vue-ui-sparkhistogram-DVyAev-n.js`).then(e=>e.n)),VueUiSparkStackbar:_(()=>import(`./vue-ui-sparkstackbar-CI7LeTy9.js`).then(e=>e.n)),VueUiSparkTrend:_(()=>import(`./vue-ui-spark-trend-m_ybZFN7.js`).then(e=>e.n)),VueUiSparkbar:_(()=>import(`./vue-ui-sparkbar-CVJo0I__.js`).then(e=>e.n)),VueUiSparkgauge:_(()=>import(`./vue-ui-sparkgauge-UXQOQCQ6.js`).then(e=>e.n)),VueUiSparkline:_(()=>import(`./vue-ui-sparkline-DXJpSvr5.js`).then(e=>e.n)),VueUiStripPlot:_(()=>import(`./vue-ui-strip-plot-D2JTssjF.js`).then(e=>e.n)),VueUiTable:_(()=>import(`./vue-ui-table-CcBJ_hPp.js`).then(e=>e.n)),VueUiTableHeatmap:_(()=>import(`./vue-ui-table-heatmap-CwV82zwm.js`).then(e=>e.n)),VueUiTableSparkline:_(()=>import(`./vue-ui-table-sparkline-D1OPXi2z.js`).then(e=>e.n)),VueUiThermometer:_(()=>import(`./vue-ui-thermometer-D2LlLcEV.js`).then(e=>e.n)),VueUiTimer:_(()=>import(`./vue-ui-timer-Ca8KPZNl.js`).then(e=>e.n)),VueUiTiremarks:_(()=>import(`./vue-ui-tiremarks-BsKJi3S0.js`).then(e=>e.n)),VueUiTreemap:_(()=>import(`./vue-ui-treemap-5HkhmOD4.js`).then(e=>e.n)),VueUiVerticalBar:_(()=>import(`./vue-ui-horizontal-bar-Khi_qtla.js`).then(e=>e.n)),VueUiHorizontalBar:_(()=>import(`./vue-ui-horizontal-bar-Khi_qtla.js`).then(e=>e.n)),VueUiWaffle:_(()=>import(`./vue-ui-waffle-2BJYwpwv.js`).then(e=>e.n)),VueUiWheel:_(()=>import(`./vue-ui-wheel-Dr-mMZrH.js`).then(e=>e.n)),VueUiWordCloud:_(()=>import(`./vue-ui-word-cloud-CF_k1x_e.js`).then(e=>e.n)),VueUiXy:_(()=>import(`./vue-ui-xy-Cwkavs_B.js`).then(e=>e.n)),VueUiXyCanvas:_(()=>import(`./vue-ui-xy-canvas-DnWzhq9y.js`).then(e=>e.n)),VueUiCarouselTable:_(()=>import(`./vue-ui-carousel-table-_V-HWzd-.js`).then(e=>e.n)),VueUiGizmo:_(()=>import(`./vue-ui-gizmo-CoET_abC.js`).then(e=>e.n)),VueUiStackbar:_(()=>import(`./vue-ui-stackbar-BAdE_agj.js`).then(e=>e.n)),VueUiStackline:_(()=>import(`./vue-ui-stackline-CEcCgYrY.js`).then(e=>e.n)),VueUiBullet:_(()=>import(`./vue-ui-bullet-5ZNUgPS7.js`).then(e=>e.n)),VueUiFunnel:_(()=>import(`./vue-ui-funnel-7RjzjVqE.js`).then(e=>e.n)),VueUiHistoryPlot:_(()=>import(`./vue-ui-history-plot-DVoOwR1y.js`).then(e=>e.n)),VueUiCirclePack:_(()=>import(`./vue-ui-circle-pack-BiVPm8ii.js`).then(e=>e.n)),VueUiWorld:_(()=>import(`./vue-ui-world-BuzOXOPx.js`).then(e=>e.n)),VueUiChord:_(()=>import(`./vue-ui-chord-CaJ-uclL.js`).then(e=>e.n)),VueUiRidgeline:_(()=>import(`./vue-ui-ridgeline-DUrvAa8z.js`).then(e=>e.n)),VueUiDag:_(()=>import(`./vue-ui-dag-wkBDTIcz.js`).then(e=>e.n))},{vue_ui_dashboard:ve}=ee(),ye=C(null),A=C(null),j=e,M=f(()=>s({userConfig:j.config,defaultConfig:ve}));c({config:()=>M.value,dataset:()=>j.dataset,component:`VueUiDashboard`,rules:[l.noHint]});let N=f(()=>M.value.userOptions.useCursorPointer),P=C(te()),F=C(M.value.locked);function be(){F.value=!F.value}O(()=>M.value.locked,e=>{F.value=e});let xe=[`left`,`top`,`width`,`height`];function I(e){return Object.fromEntries(xe.map(t=>[t,e[t]]))}function L(e,t){return xe.every(n=>Object.is(e[n],t[n]))}let R=Symbol(`dashboard-item`);function Se(e,t,n=Symbol()){let r={...e,index:t};return Object.defineProperty(r,R,{value:n}),le(r)}let z=E((j.dataset||[]).map((e,t)=>Se(e,t))),B=new Map(z.value.map(e=>[e[R],I(e)]));O(()=>j.dataset,e=>{let t=/* @__PURE__ */ new Map;for(let e of z.value)t.has(e.id)||t.set(e.id,[]),t.get(e.id).push(e);let n=/* @__PURE__ */ new Map,r=!1;z.value=(e||[]).map((e,i)=>{let a=t.get(e.id)?.shift(),o=a?.[R]??Symbol(),s=I(e),c=B.get(o),l=!c||!L(c,s);return n.set(o,s),U.value?.key===o&&l&&(r=!0),Se({...e,...a&&!l?I(a):s},i,o)}),B=n,U.value&&(r||!z.value.some(e=>e[R]===U.value.key))&&Y(!1)},{deep:!0});let V=f(()=>z.value.map(e=>({...e,resolvedComponent:typeof e.component==`string`?k[e.component]:ue(e.component)}))),H=C(null),U=E(null),W=f(()=>U.value?z.value.findIndex(e=>e[R]===U.value.key):null),G=me,Ce=[`top-left`,`top-right`,`bottom-left`,`bottom-right`],K=(e,t,n)=>Math.max(t,Math.min(n,e));function we(e){let t=K(Number.isFinite(e.width)?e.width:1,1,100),n=K(Number.isFinite(e.height)?e.height:1,1,100);return{width:t,height:n,left:K(Number.isFinite(e.left)?e.left:0,0,100-t),top:K(Number.isFinite(e.top)?e.top:0,0,100-n)}}function Te(e){return!!e?.closest?.(`input, button, select, textarea, a, [contenteditable]:not([contenteditable="false"]), [role="slider"], .range-handle, [data-dashboard-no-drag]`)}function q(e,t,n=null){if(U.value||F.value||Q.value||t.isPrimary===!1||t.button!=null&&t.button!==0||!n&&Te(t.target))return;let r=z.value[e],i=H.value?.getBoundingClientRect();if(!r||!(i?.width>0&&i.height>0)||!Number.isFinite(t.clientX)||!Number.isFinite(t.clientY))return;let a=I(r),o=we(r);Object.assign(r,o),U.value={key:r[R],direction:n,pointerId:t.pointerId,capture:t.currentTarget,x:t.clientX,y:t.clientY,boardWidth:i.width,boardHeight:i.height,initial:o,before:a},t.preventDefault?.(),t.stopPropagation?.();try{t.currentTarget?.setPointerCapture?.(t.pointerId)}catch{}document.addEventListener(`pointermove`,J,{passive:!1}),document.addEventListener(`pointerup`,Ee),document.addEventListener(`pointercancel`,X)}function J(e){let t=U.value;if(!t||t.pointerId!=null&&e.pointerId!==t.pointerId||!Number.isFinite(e.clientX)||!Number.isFinite(e.clientY))return;let n=z.value.find(e=>e[R]===t.key);if(!n){Y(!1);return}e.preventDefault?.();let r=(e.clientX-t.x)/t.boardWidth*100,i=(e.clientY-t.y)/t.boardHeight*100,a=t.initial;if(!t.direction){n.left=K(a.left+r,0,100-a.width),n.top=K(a.top+i,0,100-a.height);return}let o=a.left,s=a.top,c=a.left+a.width,l=a.top+a.height;t.direction.includes(`left`)?o=K(a.left+r,0,c-1):c=K(c+r,o+1,100),t.direction.includes(`top`)?s=K(a.top+i,0,l-1):l=K(l+i,s+1,100),Object.assign(n,{left:o,top:s,width:c-o,height:l-s})}function Y(e=!0){let t=U.value;if(!t)return;U.value=null,document.removeEventListener(`pointermove`,J),document.removeEventListener(`pointerup`,Ee),document.removeEventListener(`pointercancel`,X);try{t.capture?.releasePointerCapture?.(t.pointerId)}catch{}let n=z.value.find(e=>e[R]===t.key);if(!e||!n||L(t.before,I(n)))return;let r=t.initial;if(!t.direction)n.left=K(Math.round(n.left),0,100-n.width),n.top=K(Math.round(n.top),0,100-n.height);else{let e=r.left+r.width,i=r.top+r.height;t.direction.includes(`left`)?(n.left=K(Math.round(n.left),0,e-1),n.width=e-n.left):n.width=K(Math.round(n.left+n.width),n.left+1,100)-n.left,t.direction.includes(`top`)?(n.top=K(Math.round(n.top),0,i-1),n.height=i-n.top):n.height=K(Math.round(n.top+n.height),n.top+1,100)-n.top}L(t.before,I(n))||G(`change`,z.value)}function Ee(e){!U.value||U.value.pointerId!=null&&e.pointerId!==U.value.pointerId||(J(e),Y())}function X(e){(U.value?.pointerId==null||e?.pointerId==null||e.pointerId===U.value.pointerId)&&Y()}O(F,e=>{e&&Y()},{flush:`sync`}),se(()=>Y(!1));let{isPrinting:De,isImaging:Oe,generatePdf:ke,generateImage:Ae}=ne({elementId:`vue-ui-dashboard_${P.value}`,fileName:M.value.userOptions.print.filename||`dashboard`,options:{...M.value.userOptions.print,aspectRatio:M.value.style.board.aspectRatio}}),je=f(()=>M.value.style.item.borderColor),Me=f(()=>M.value.style.resizeHandles.backgroundColor),Ne=f(()=>M.value.style.board.aspectRatio),Pe=f(()=>M.value.style.board.backgroundColor),Fe=f(()=>M.value.style.board.border);function Ie(){return z.value}let Z=C(!1),Le=f(()=>!M.value.userOptions.showOnChartHover||Z.value),Re=f(()=>M.value.userOptions.keepStateOnChartLeave),ze=f(()=>(M.value.allowPrint||M.value.userOptions.show)&&[`pdf`,`img`,`annotator`,`altCopy`].some(e=>M.value.userOptions.buttons[e])),Q=C(!1);function $(){Q.value=!Q.value}O(Q,e=>{e&&Y()},{flush:`sync`});async function Be(){G(`copyAlt`,{config:M.value,dataset:V.value}),M.value.userOptions.callbacks.altCopy?await Promise.resolve(M.value.userOptions.callbacks.altCopy({config:M.value,dataset:V.value})):console.warn("Vue Data UI - A callback must be set for `altCopy` in userOptions.")}return u({generatePdf:ke,getItemsPositions:Ie,toggleLock:be,copyAlt:Be}),(e,s)=>(S(),h(`div`,{id:`vue-ui-dashboard_${P.value}`,onMouseenter:s[0]||=e=>Z.value=!0,onMouseleave:s[1]||=e=>Z.value=!1,ref_key:`dashboardRef`,ref:ye,style:{position:`relative`},class:`vue-data-ui-component`},[g(`div`,{class:`vue-ui-dashboard-container`,ref_key:`dashboardContainer`,ref:H,style:x(`outline:${Fe.value}; background:${Pe.value}; aspect-ratio:${Ne.value};${Q.value?`pointer-events:none`:``}`)},[g(`div`,{class:`vue-ui-dashboard-grid-container`,style:x(`background:${M.value.style.board.backgroundColor}`)},[s[2]||=g(`div`,{class:`vue-ui-dashboard-grid`},null,-1),(S(!0),h(d,null,w(V.value,(t,n)=>(S(),h(`div`,{key:z.value[n][D(R)],class:b({"vue-ui-dashboard-grid-item":!0,"vue-ui-dashboard-grid-item--locked":F.value}),style:x({width:`${t.width}%`,height:`${t.height}%`,left:`${t.left}%`,top:`${t.top}%`,cursor:`move`,boxShadow:W.value===n?`0 6px 12px -3px rgba(0,0,0,0.3)`:``,zIndex:W.value===n?V.value.length+1:t.index,backgroundColor:M.value.style.item.backgroundColor}),onPointerdown:e=>q(n,e),onLostpointercapture:X},[F.value?m(``,!0):(S(),h(d,{key:0},w(Ce,e=>g(`div`,{key:e,class:b(`vue-ui-dashboard-resize-handle vue-ui-dashboard-${e}`),onPointerdown:pe(t=>q(n,t,e),[`stop`])},null,42,_e)),64)),T(e.$slots,`top`,{item:t,index:n},void 0,!0),t.resolvedComponent?(S(),p(ce(t.resolvedComponent),y({key:1,ref_for:!0},t.props),null,16)):T(e.$slots,`content`,{item:t,index:n,left:t.left,top:t.top,height:t.height,width:t.width},void 0,!0,2),T(e.$slots,`bottom`,{item:t,index:n},void 0,!0)],46,ge))),128))],4)],4),(S(),h(`svg`,{style:x({width:`100%`,height:`100%`,pointerEvents:`none`,position:`absolute`,top:0,left:0,zIndex:V.value.length+1}),ref_key:`svgRef`,ref:A},null,4)),M.value.userOptions.buttons.annotator&&H.value&&A.value?(S(),p(ie,y({key:0},D(a)(M.value.userOptions.annotator),{color:M.value.style.board.color,backgroundColor:M.value.style.board.backgroundColor,active:Q.value,svgRef:A.value,isCursorPointer:N.value,onClose:$,style:{zIndex:V.value.length+1},palette:M.value.userOptions.annotatorPalette}),ae({_:2},[w(D(o),t=>({name:t,fn:fe(n=>[T(e.$slots,t,oe(v(D(i)(t,n))),void 0,!0)])}))]),1040,[`color`,`backgroundColor`,`active`,`svgRef`,`isCursorPointer`,`style`,`palette`])):m(``,!0),ze.value&&(Re.value||Le.value)?(S(),p(re,y({key:1,backgroundColor:M.value.style.board.backgroundColor,color:M.value.style.board.color,isPrinting:D(De),isImaging:D(Oe),uid:P.value},D(n)(M.value.userOptions,`pdf img altCopy annotator`),{hasTooltip:!1,hasXls:!1,hasTable:!1,hasLabel:!1,hasFullscreen:!1,chartElement:H.value,isAnnotation:Q.value,isCursorPointer:N.value,onGeneratePdf:D(ke),onGenerateImage:D(Ae),onToggleAnnotator:$,onCopyAlt:Be,style:{visibility:Re.value?Le.value?`visible`:`hidden`:`visible`,zIndex:V.value.length+1}}),ae({_:2},[w(D(t)(e.$slots,`menuIcon optionPdf optionImg optionAnnotator optionAltCopy custom-menu-before custom-menu-after`),t=>({name:t,fn:fe(n=>[T(e.$slots,t,oe(v(D(r)(t,n))),void 0,!0)])}))]),1040,[`backgroundColor`,`color`,`isPrinting`,`isImaging`,`uid`,`chartElement`,`isAnnotation`,`isCursorPointer`,`onGeneratePdf`,`onGenerateImage`,`style`])):m(``,!0)],40,he))}},[[`__scopeId`,`data-v-d54ac99e`]]);export{me as n,k 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"./useNestedProp-ri-deXpG.js";import{n as c,t as l}from"./useHints-C-TwxM0Y.js";import{t as ee}from"./useConfig-B-AzS3w-.js";import{X as te}from"./lib-BaWaqwnJ.js";import{t as ne}from"./usePrinter-CUD8gosC.js";import{t as re}from"./UserOptions-B97cPcKc.js";import{n as ie}from"./PenAndPaper-B2UOwiJM.js";import{t as u}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{Fragment as d,computed as f,createBlock as p,createCommentVNode as m,createElementBlock as h,createElementVNode as g,createSlots as ae,defineAsyncComponent as _,guardReactiveProps as v,mergeProps as y,normalizeClass as b,normalizeProps as oe,normalizeStyle as x,onBeforeUnmount as se,openBlock as S,ref as C,renderList as w,renderSlot as T,resolveDynamicComponent as ce,shallowReactive as le,shallowRef as E,toRaw as ue,unref as D,useCssVars as de,watch as O,withCtx as fe,withModifiers as pe}from"vue";var me=/* @__PURE__ */ e({default:()=>k}),he=[`id`],ge=[`onPointerdown`],_e=[`onPointerdown`],k=/*#__PURE__*/ u({__name:`vue-ui-dashboard`,props:{dataset:{type:Array,default:()=>[]},config:Object},emits:[`change`,`copyAlt`],setup(e,{expose:u,emit:me}){de(e=>({v1f8a1d55:je.value,v4502d4a5:Me.value}));let k={VueDataUi:_(()=>import(`./vue-data-ui-orKuQ-0A.js`).then(e=>e.n)),VueUi3dBar:_(()=>import(`./vue-ui-3d-bar-BxIOe5pW.js`).then(e=>e.n)),VueUiAccordion:_(()=>import(`./vue-ui-accordion-B8LYfVG9.js`).then(e=>e.n)),VueUiAgePyramid:_(()=>import(`./vue-ui-age-pyramid-CsQ6Zx79.js`).then(e=>e.n)),VueUiAnnotator:_(()=>import(`./vue-ui-annotator-xYv2xrXs.js`).then(e=>e.n)),VueUiCandlestick:_(()=>import(`./vue-ui-candlestick-C8W4sGST.js`).then(e=>e.n)),VueUiChestnut:_(()=>import(`./vue-ui-chestnut-XdPEyosT.js`).then(e=>e.n)),VueUiDigits:_(()=>import(`./vue-ui-digits-Cn_wqq4Y.js`).then(e=>e.n)),VueUiDonut:_(()=>import(`./vue-ui-donut-BXlWXh2v.js`).then(e=>e.n)),VueUiDonutEvolution:_(()=>import(`./vue-ui-donut-evolution-DHPd3KRv.js`).then(e=>e.n)),VueUiDumbbell:_(()=>import(`./vue-ui-dumbbell-BmqFCL_t.js`).then(e=>e.n)),VueUiFlow:_(()=>import(`./vue-ui-flow-CvRa8Ija.js`).then(e=>e.n)),VueUiGalaxy:_(()=>import(`./vue-ui-galaxy-DSHlkl9t.js`).then(e=>e.n)),VueUiGauge:_(()=>import(`./vue-ui-gauge-2XPqwRR4.js`).then(e=>e.n)),VueUiHeatmap:_(()=>import(`./vue-ui-heatmap-DmgXUHFz.js`).then(e=>e.n)),VueUiKpi:_(()=>import(`./vue-ui-kpi-BvGMMvPY.js`).then(e=>e.n)),VueUiMiniLoader:_(()=>import(`./vue-ui-mini-loader-C7rLQ7JE.js`).then(e=>e.n)),VueUiMolecule:_(()=>import(`./vue-ui-molecule-BLCwrefH.js`).then(e=>e.n)),VueUiMoodRadar:_(()=>import(`./vue-ui-mood-radar-Bm12y-t8.js`).then(e=>e.n)),VueUiNestedDonuts:_(()=>import(`./vue-ui-nested-donuts-BGz-1VHL.js`).then(e=>e.n)),VueUiOnion:_(()=>import(`./vue-ui-onion-C23btxVO.js`).then(e=>e.n)),VueUiParallelCoordinatePlot:_(()=>import(`./vue-ui-parallel-coordinate-plot-E17cuXGN.js`).then(e=>e.n)),VueUiQuadrant:_(()=>import(`./vue-ui-quadrant-NJPbHq0p.js`).then(e=>e.n)),VueUiQuickChart:_(()=>import(`./vue-ui-quick-chart-CI1n75li.js`).then(e=>e.n)),VueUiRadar:_(()=>import(`./vue-ui-radar-CD1Ge3r9.js`).then(e=>e.n)),VueUiRating:_(()=>import(`./vue-ui-rating-mDoJ2Rkg.js`).then(e=>e.n)),VueUiRelationCircle:_(()=>import(`./vue-ui-relation-circle-CQPFqgsl.js`).then(e=>e.n)),VueUiRings:_(()=>import(`./vue-ui-rings-D2XUhWg-.js`).then(e=>e.n)),VueUiScatter:_(()=>import(`./vue-ui-scatter-DgfuFep8.js`).then(e=>e.n)),VueUiSkeleton:_(()=>import(`./vue-ui-skeleton-BUMvfDJX.js`).then(e=>e.n)),VueUiSmiley:_(()=>import(`./vue-ui-smiley-aTCVrK-n.js`).then(e=>e.n)),VueUiSparkHistogram:_(()=>import(`./vue-ui-sparkhistogram-nM2G2AJx.js`).then(e=>e.n)),VueUiSparkStackbar:_(()=>import(`./vue-ui-sparkstackbar-CTCvV0UA.js`).then(e=>e.n)),VueUiSparkTrend:_(()=>import(`./vue-ui-spark-trend-B1S6SaGz.js`).then(e=>e.n)),VueUiSparkbar:_(()=>import(`./vue-ui-sparkbar-DtGqqvGS.js`).then(e=>e.n)),VueUiSparkgauge:_(()=>import(`./vue-ui-sparkgauge-yEOfuIEu.js`).then(e=>e.n)),VueUiSparkline:_(()=>import(`./vue-ui-sparkline-B7ZZzccR.js`).then(e=>e.n)),VueUiStripPlot:_(()=>import(`./vue-ui-strip-plot-DlIqyn9G.js`).then(e=>e.n)),VueUiTable:_(()=>import(`./vue-ui-table-B1QawDAY.js`).then(e=>e.n)),VueUiTableHeatmap:_(()=>import(`./vue-ui-table-heatmap-DFjVopuI.js`).then(e=>e.n)),VueUiTableSparkline:_(()=>import(`./vue-ui-table-sparkline-D15wq2iu.js`).then(e=>e.n)),VueUiThermometer:_(()=>import(`./vue-ui-thermometer-gK8M0jyN.js`).then(e=>e.n)),VueUiTimer:_(()=>import(`./vue-ui-timer-Be4jnf30.js`).then(e=>e.n)),VueUiTiremarks:_(()=>import(`./vue-ui-tiremarks-B1PF45Fh.js`).then(e=>e.n)),VueUiTreemap:_(()=>import(`./vue-ui-treemap-CProQJII.js`).then(e=>e.n)),VueUiVerticalBar:_(()=>import(`./vue-ui-horizontal-bar-BnIRG4Da.js`).then(e=>e.n)),VueUiHorizontalBar:_(()=>import(`./vue-ui-horizontal-bar-BnIRG4Da.js`).then(e=>e.n)),VueUiWaffle:_(()=>import(`./vue-ui-waffle-C9QBRGRd.js`).then(e=>e.n)),VueUiWheel:_(()=>import(`./vue-ui-wheel-EBNVnATV.js`).then(e=>e.n)),VueUiWordCloud:_(()=>import(`./vue-ui-word-cloud-D_wT_OgE.js`).then(e=>e.n)),VueUiXy:_(()=>import(`./vue-ui-xy-ZTbijg4Q.js`).then(e=>e.n)),VueUiXyCanvas:_(()=>import(`./vue-ui-xy-canvas-QqaK6zlu.js`).then(e=>e.n)),VueUiCarouselTable:_(()=>import(`./vue-ui-carousel-table-DAMT9bn5.js`).then(e=>e.n)),VueUiGizmo:_(()=>import(`./vue-ui-gizmo-BXEnFICN.js`).then(e=>e.n)),VueUiStackbar:_(()=>import(`./vue-ui-stackbar-DTlq5Fmr.js`).then(e=>e.n)),VueUiStackline:_(()=>import(`./vue-ui-stackline-DgV0GCOn.js`).then(e=>e.n)),VueUiBullet:_(()=>import(`./vue-ui-bullet-CsaTMHaa.js`).then(e=>e.n)),VueUiFunnel:_(()=>import(`./vue-ui-funnel-Ds4JV24L.js`).then(e=>e.n)),VueUiHistoryPlot:_(()=>import(`./vue-ui-history-plot-qpbsJ706.js`).then(e=>e.n)),VueUiCirclePack:_(()=>import(`./vue-ui-circle-pack-Brhoqu25.js`).then(e=>e.n)),VueUiWorld:_(()=>import(`./vue-ui-world-CvjzqQPz.js`).then(e=>e.n)),VueUiChord:_(()=>import(`./vue-ui-chord-CeYpAizS.js`).then(e=>e.n)),VueUiRidgeline:_(()=>import(`./vue-ui-ridgeline-C0fxNnYy.js`).then(e=>e.n)),VueUiDag:_(()=>import(`./vue-ui-dag-CC7fXGUn.js`).then(e=>e.n))},{vue_ui_dashboard:ve}=ee(),ye=C(null),A=C(null),j=e,M=f(()=>s({userConfig:j.config,defaultConfig:ve}));c({config:()=>M.value,dataset:()=>j.dataset,component:`VueUiDashboard`,rules:[l.noHint]});let N=f(()=>M.value.userOptions.useCursorPointer),P=C(te()),F=C(M.value.locked);function be(){F.value=!F.value}O(()=>M.value.locked,e=>{F.value=e});let xe=[`left`,`top`,`width`,`height`];function I(e){return Object.fromEntries(xe.map(t=>[t,e[t]]))}function L(e,t){return xe.every(n=>Object.is(e[n],t[n]))}let R=Symbol(`dashboard-item`);function Se(e,t,n=Symbol()){let r={...e,index:t};return Object.defineProperty(r,R,{value:n}),le(r)}let z=E((j.dataset||[]).map((e,t)=>Se(e,t))),B=new Map(z.value.map(e=>[e[R],I(e)]));O(()=>j.dataset,e=>{let t=/* @__PURE__ */ new Map;for(let e of z.value)t.has(e.id)||t.set(e.id,[]),t.get(e.id).push(e);let n=/* @__PURE__ */ new Map,r=!1;z.value=(e||[]).map((e,i)=>{let a=t.get(e.id)?.shift(),o=a?.[R]??Symbol(),s=I(e),c=B.get(o),l=!c||!L(c,s);return n.set(o,s),U.value?.key===o&&l&&(r=!0),Se({...e,...a&&!l?I(a):s},i,o)}),B=n,U.value&&(r||!z.value.some(e=>e[R]===U.value.key))&&Y(!1)},{deep:!0});let V=f(()=>z.value.map(e=>({...e,resolvedComponent:typeof e.component==`string`?k[e.component]:ue(e.component)}))),H=C(null),U=E(null),W=f(()=>U.value?z.value.findIndex(e=>e[R]===U.value.key):null),G=me,Ce=[`top-left`,`top-right`,`bottom-left`,`bottom-right`],K=(e,t,n)=>Math.max(t,Math.min(n,e));function we(e){let t=K(Number.isFinite(e.width)?e.width:1,1,100),n=K(Number.isFinite(e.height)?e.height:1,1,100);return{width:t,height:n,left:K(Number.isFinite(e.left)?e.left:0,0,100-t),top:K(Number.isFinite(e.top)?e.top:0,0,100-n)}}function Te(e){return!!e?.closest?.(`input, button, select, textarea, a, [contenteditable]:not([contenteditable="false"]), [role="slider"], .range-handle, [data-dashboard-no-drag]`)}function q(e,t,n=null){if(U.value||F.value||Q.value||t.isPrimary===!1||t.button!=null&&t.button!==0||!n&&Te(t.target))return;let r=z.value[e],i=H.value?.getBoundingClientRect();if(!r||!(i?.width>0&&i.height>0)||!Number.isFinite(t.clientX)||!Number.isFinite(t.clientY))return;let a=I(r),o=we(r);Object.assign(r,o),U.value={key:r[R],direction:n,pointerId:t.pointerId,capture:t.currentTarget,x:t.clientX,y:t.clientY,boardWidth:i.width,boardHeight:i.height,initial:o,before:a},t.preventDefault?.(),t.stopPropagation?.();try{t.currentTarget?.setPointerCapture?.(t.pointerId)}catch{}document.addEventListener(`pointermove`,J,{passive:!1}),document.addEventListener(`pointerup`,Ee),document.addEventListener(`pointercancel`,X)}function J(e){let t=U.value;if(!t||t.pointerId!=null&&e.pointerId!==t.pointerId||!Number.isFinite(e.clientX)||!Number.isFinite(e.clientY))return;let n=z.value.find(e=>e[R]===t.key);if(!n){Y(!1);return}e.preventDefault?.();let r=(e.clientX-t.x)/t.boardWidth*100,i=(e.clientY-t.y)/t.boardHeight*100,a=t.initial;if(!t.direction){n.left=K(a.left+r,0,100-a.width),n.top=K(a.top+i,0,100-a.height);return}let o=a.left,s=a.top,c=a.left+a.width,l=a.top+a.height;t.direction.includes(`left`)?o=K(a.left+r,0,c-1):c=K(c+r,o+1,100),t.direction.includes(`top`)?s=K(a.top+i,0,l-1):l=K(l+i,s+1,100),Object.assign(n,{left:o,top:s,width:c-o,height:l-s})}function Y(e=!0){let t=U.value;if(!t)return;U.value=null,document.removeEventListener(`pointermove`,J),document.removeEventListener(`pointerup`,Ee),document.removeEventListener(`pointercancel`,X);try{t.capture?.releasePointerCapture?.(t.pointerId)}catch{}let n=z.value.find(e=>e[R]===t.key);if(!e||!n||L(t.before,I(n)))return;let r=t.initial;if(!t.direction)n.left=K(Math.round(n.left),0,100-n.width),n.top=K(Math.round(n.top),0,100-n.height);else{let e=r.left+r.width,i=r.top+r.height;t.direction.includes(`left`)?(n.left=K(Math.round(n.left),0,e-1),n.width=e-n.left):n.width=K(Math.round(n.left+n.width),n.left+1,100)-n.left,t.direction.includes(`top`)?(n.top=K(Math.round(n.top),0,i-1),n.height=i-n.top):n.height=K(Math.round(n.top+n.height),n.top+1,100)-n.top}L(t.before,I(n))||G(`change`,z.value)}function Ee(e){!U.value||U.value.pointerId!=null&&e.pointerId!==U.value.pointerId||(J(e),Y())}function X(e){(U.value?.pointerId==null||e?.pointerId==null||e.pointerId===U.value.pointerId)&&Y()}O(F,e=>{e&&Y()},{flush:`sync`}),se(()=>Y(!1));let{isPrinting:De,isImaging:Oe,generatePdf:ke,generateImage:Ae}=ne({elementId:`vue-ui-dashboard_${P.value}`,fileName:M.value.userOptions.print.filename||`dashboard`,options:{...M.value.userOptions.print,aspectRatio:M.value.style.board.aspectRatio}}),je=f(()=>M.value.style.item.borderColor),Me=f(()=>M.value.style.resizeHandles.backgroundColor),Ne=f(()=>M.value.style.board.aspectRatio),Pe=f(()=>M.value.style.board.backgroundColor),Fe=f(()=>M.value.style.board.border);function Ie(){return z.value}let Z=C(!1),Le=f(()=>!M.value.userOptions.showOnChartHover||Z.value),Re=f(()=>M.value.userOptions.keepStateOnChartLeave),ze=f(()=>(M.value.allowPrint||M.value.userOptions.show)&&[`pdf`,`img`,`annotator`,`altCopy`].some(e=>M.value.userOptions.buttons[e])),Q=C(!1);function $(){Q.value=!Q.value}O(Q,e=>{e&&Y()},{flush:`sync`});async function Be(){G(`copyAlt`,{config:M.value,dataset:V.value}),M.value.userOptions.callbacks.altCopy?await Promise.resolve(M.value.userOptions.callbacks.altCopy({config:M.value,dataset:V.value})):console.warn("Vue Data UI - A callback must be set for `altCopy` in userOptions.")}return u({generatePdf:ke,getItemsPositions:Ie,toggleLock:be,copyAlt:Be}),(e,s)=>(S(),h(`div`,{id:`vue-ui-dashboard_${P.value}`,onMouseenter:s[0]||=e=>Z.value=!0,onMouseleave:s[1]||=e=>Z.value=!1,ref_key:`dashboardRef`,ref:ye,style:{position:`relative`},class:`vue-data-ui-component`},[g(`div`,{class:`vue-ui-dashboard-container`,ref_key:`dashboardContainer`,ref:H,style:x(`outline:${Fe.value}; background:${Pe.value}; aspect-ratio:${Ne.value};${Q.value?`pointer-events:none`:``}`)},[g(`div`,{class:`vue-ui-dashboard-grid-container`,style:x(`background:${M.value.style.board.backgroundColor}`)},[s[2]||=g(`div`,{class:`vue-ui-dashboard-grid`},null,-1),(S(!0),h(d,null,w(V.value,(t,n)=>(S(),h(`div`,{key:z.value[n][D(R)],class:b({"vue-ui-dashboard-grid-item":!0,"vue-ui-dashboard-grid-item--locked":F.value}),style:x({width:`${t.width}%`,height:`${t.height}%`,left:`${t.left}%`,top:`${t.top}%`,cursor:`move`,boxShadow:W.value===n?`0 6px 12px -3px rgba(0,0,0,0.3)`:``,zIndex:W.value===n?V.value.length+1:t.index,backgroundColor:M.value.style.item.backgroundColor}),onPointerdown:e=>q(n,e),onLostpointercapture:X},[F.value?m(``,!0):(S(),h(d,{key:0},w(Ce,e=>g(`div`,{key:e,class:b(`vue-ui-dashboard-resize-handle vue-ui-dashboard-${e}`),onPointerdown:pe(t=>q(n,t,e),[`stop`])},null,42,_e)),64)),T(e.$slots,`top`,{item:t,index:n},void 0,!0),t.resolvedComponent?(S(),p(ce(t.resolvedComponent),y({key:1,ref_for:!0},t.props),null,16)):T(e.$slots,`content`,{item:t,index:n,left:t.left,top:t.top,height:t.height,width:t.width},void 0,!0,2),T(e.$slots,`bottom`,{item:t,index:n},void 0,!0)],46,ge))),128))],4)],4),(S(),h(`svg`,{style:x({width:`100%`,height:`100%`,pointerEvents:`none`,position:`absolute`,top:0,left:0,zIndex:V.value.length+1}),ref_key:`svgRef`,ref:A},null,4)),M.value.userOptions.buttons.annotator&&H.value&&A.value?(S(),p(ie,y({key:0},D(a)(M.value.userOptions.annotator),{color:M.value.style.board.color,backgroundColor:M.value.style.board.backgroundColor,active:Q.value,svgRef:A.value,isCursorPointer:N.value,onClose:$,style:{zIndex:V.value.length+1},palette:M.value.userOptions.annotatorPalette}),ae({_:2},[w(D(o),t=>({name:t,fn:fe(n=>[T(e.$slots,t,oe(v(D(i)(t,n))),void 0,!0)])}))]),1040,[`color`,`backgroundColor`,`active`,`svgRef`,`isCursorPointer`,`style`,`palette`])):m(``,!0),ze.value&&(Re.value||Le.value)?(S(),p(re,y({key:1,backgroundColor:M.value.style.board.backgroundColor,color:M.value.style.board.color,isPrinting:D(De),isImaging:D(Oe),uid:P.value},D(n)(M.value.userOptions,`pdf img altCopy annotator`),{hasTooltip:!1,hasXls:!1,hasTable:!1,hasLabel:!1,hasFullscreen:!1,chartElement:H.value,isAnnotation:Q.value,isCursorPointer:N.value,onGeneratePdf:D(ke),onGenerateImage:D(Ae),onToggleAnnotator:$,onCopyAlt:Be,style:{visibility:Re.value?Le.value?`visible`:`hidden`:`visible`,zIndex:V.value.length+1}}),ae({_:2},[w(D(t)(e.$slots,`menuIcon optionPdf optionImg optionAnnotator optionAltCopy custom-menu-before custom-menu-after`),t=>({name:t,fn:fe(n=>[T(e.$slots,t,oe(v(D(r)(t,n))),void 0,!0)])}))]),1040,[`backgroundColor`,`color`,`isPrinting`,`isImaging`,`uid`,`chartElement`,`isAnnotation`,`isCursorPointer`,`onGeneratePdf`,`onGenerateImage`,`style`])):m(``,!0)],40,he))}},[[`__scopeId`,`data-v-d54ac99e`]]);export{me as n,k as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{t}from"./useNestedProp-
|
|
1
|
+
import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{t}from"./useNestedProp-ri-deXpG.js";import{X as n,t as r}from"./lib-BaWaqwnJ.js";import{n as i,t as a}from"./useHints-C-TwxM0Y.js";import{t as o}from"./useConfig-B-AzS3w-.js";import{n as s}from"./PackageVersion-B-1JX0wI.js";import{t as c}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{Fragment as l,computed as u,createBlock as d,createCommentVNode as f,createElementBlock as p,createElementVNode as m,createVNode as h,normalizeStyle as g,openBlock as _,renderList as v,toDisplayString as y,unref as b}from"vue";var x={key:0},S=[`d`,`fill`],C={key:1},w=[`cx`,`cy`,`r`,`fill`],T=26,E=2,D=-2,O=28,k=2,A=32,j=30,M=60,N=-8,P=2,F={__name:`Digit`,props:{quanta:{type:String,default:null},backgroundColor:{type:String,default:`#e1e5e8`},color:{type:String,default:`#000000`},x:{type:Number,default:0},y:{type:Number,default:0},thickness:{type:Number,default:1}},setup(e){let t=e,n={0:`1111110`,1:`0110000`,2:`1101101`,3:`1111001`,4:`0110011`,5:`1011011`,6:`1011111`,7:`1110000`,8:`1111111`,9:`1111011`,"-":`0000001`,X:`0000000`},r=u(()=>E*(t.thickness||1)),i=u(()=>Object.hasOwn(n,t.quanta)?n[t.quanta]:n.X);function a(e,t,n,r=!1){return r?`M ${e} ${t} L ${e+n} ${t-n} L ${e+T-n} ${t-n} L ${e+T} ${t} L ${e+T-n} ${t+n} L ${e+n} ${t+n} Z`:`M ${e+n} ${t-n} L ${e} ${t} L ${e+n} ${t+n} L ${e+T-n} ${t+n} L ${e+T} ${t} L ${e+T-n} ${t-n} L ${e+n} ${t-n}`}function o(e,t,n,r=!1){let i=r?-1:1,a=e-i*n,o=e+i*n;return`M ${a} ${t+T-n} L ${a} ${t+n} L ${e} ${t} L ${o} ${t+n} L ${o} ${t+T-n} L ${e} ${t+T} L ${a} ${t+T-n}`}let s=u(()=>{let{x:e,y:n}=t,i=r.value;return[{name:`a`,d:a(e,n,i,!0)},{name:`b`,d:o(e+O,n+k,i)},{name:`c`,d:o(e+O,n+A,i)},{name:`d`,d:a(e,n+M,i)},{name:`e`,d:o(e+D,n+A,i,!0)},{name:`f`,d:o(e+D,n+k,i,!0)},{name:`g`,d:a(e,n+j,i)}]});return(t,n)=>(_(),p(l,null,[[void 0,null,`.`].includes(e.quanta)?f(``,!0):(_(),p(`g`,x,[(_(!0),p(l,null,v(s.value,(t,n)=>(_(),p(`path`,{key:t.name,d:t.d,fill:i.value[n]===`1`?e.color:e.backgroundColor,stroke:`none`},null,8,S))),128))])),e.quanta==`.`?(_(),p(`g`,C,[m(`circle`,{cx:e.x+N,cy:e.y+M,r:P+r.value/2,fill:e.color},null,8,w)])):f(``,!0)],64))}},I=/* @__PURE__ */ e({default:()=>z}),L=[`id`],R=[`xmlns`,`viewBox`,`aria-describedby`],z=/*#__PURE__*/ c({__name:`vue-ui-digits`,props:{dataset:{type:Number,default:0},config:{type:Object,default(){return{}}}},setup(e){let{vue_ui_digits:c}=o(),f=e,x=u(()=>t({userConfig:f.config,defaultConfig:c}));i({config:()=>x.value,dataset:()=>f.dataset,component:`VueUiDigits`,rules:[a.noHint]});let S=u(()=>{let e=Number.isFinite(f.dataset)?f.dataset:0,t=String(e);if(!t.includes(`e`))return t;let[n,r]=t.split(`e`),i=e<0?`-`:``,[a,o=``]=n.replace(`-`,``).split(`.`),s=a+o,c=a.length+Number(r);return c<=0?`${i}0.${`0`.repeat(-c)}${s}`:c>=s.length?i+s.padEnd(c,`0`):`${i}${s.slice(0,c)}.${s.slice(c)}`}),C=u(()=>{let e=10;return[...S.value].map(t=>{let n={x:e,y:10,quanta:t};return e+=t===`.`?2:44,n})}),w=u(()=>C.value.at(-1).x+36),T=n();return(e,t)=>(_(),p(l,null,[m(`div`,{class:`sr-only`,id:`digit-${b(T)}`},y(S.value),9,L),(_(),p(`svg`,{class:`vue-data-ui-component vue-ui-digits`,xmlns:b(r),viewBox:`0 0 ${w.value} 80`,style:g({background:x.value.backgroundColor,height:x.value.height||void 0,width:x.value.width||void 0}),"aria-describedby":`digit-${b(T)}`},[h(s),(_(!0),p(l,null,v(C.value,e=>(_(),d(F,{x:e.x,y:e.y,quanta:e.quanta,color:x.value.digits.color,backgroundColor:x.value.digits.skeletonColor,thickness:x.value.digits.thickness},null,8,[`x`,`y`,`quanta`,`color`,`backgroundColor`,`thickness`]))),256))],12,R))],64))}},[[`__scopeId`,`data-v-c88c2736`]]);export{I as n,z as t};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{$ as e,Bt as t,Ht as n,It as r,Jt as i,S as a,X as o,Y as s,Yt as c,b as l,f as u,i as d,in as f,j as p,nn as m,p as h,st as g,t as _}from"./lib-rPeBMZrn.js";import{t as v}from"./useConfig-B8qvYKdK.js";import{t as y}from"./vue_ui_donut-D72uP7v_.js";import{_ as b,a as x,c as S,d as C,g as w,i as T,l as E,n as D,o as O,p as k,r as A,s as ee,t as te,u as j,v as M}from"./render-common-B7aQrXBR.js";var{vue_ui_donut:ne}=v();function re({config:e={}}={}){let t=e??{},r=f({userConfig:t,defaultConfig:ne}),i=r.theme;if(!i)return{...r,customPalette:r.customPalette?.length?r.customPalette:n};let a=f({userConfig:y[i]||{},defaultConfig:r}),o=f({userConfig:t,defaultConfig:a});return{...o,customPalette:o.customPalette?.length?o.customPalette:m[i]||n}}function N(e,t=0){let n=Number(e);return Number.isFinite(n)?n:t}function P(e,t,n){return String(t).split(`.`).reduce((e,t)=>e&&e[t]!==void 0?e[t]:void 0,e)??n}function ie(e){return typeof e!=`object`||!e?0:Array.isArray(e.values)?e.values.reduce((e,t)=>e+N(t,0),0):Array.isArray(e.series)?e.series.reduce((e,t)=>e+N(t,0),0):N(e.value??e.y??0,0)}function ae(e,t){return String(e?.name??e?.label??`Serie ${t+1}`)}function oe(e=[],t){let r=Array.isArray(t.customPalette)?t.customPalette:n;return(Array.isArray(e)?e:[]).map((e,t)=>({source:e,sourceIndex:t,value:ie(e)})).filter(e=>Number.isFinite(e.value)).sort((e,n)=>t.sorted?e.source?.ghost&&!n.source?.ghost?1:n.source?.ghost&&!e.source?.ghost?-1:n.value-e.value:0).map((e,t)=>{let n=e.source,i=e.value,o=(n?.color?a(n.color):``)||r[t%r.length];return{...n,id:n?.id??`donut_serie_${t}`,name:ae(n,t),value:i,absoluteValue:Math.abs(i),absoluteValues:Array.isArray(n?.values)?n.values:[i],color:o,index:t,sourceIndex:e.sourceIndex,patternIndex:n?.patternIndex??t,seriesIndex:n?.seriesIndex??t,ghost:!!n?.ghost}}).filter(e=>Number.isFinite(e.absoluteValue))}function se(e){return e.reduce((e,t)=>e+t.absoluteValue,0)}function ce({series:e,total:t,startAngle:n=-90}){let r=n;return e.map(e=>{let n=t?e.absoluteValue/t:0,i=n*360,a=r,o=r+i;return r=o,{...e,ratio:n,percentage:n*100,startAngle:a,endAngle:o,midAngle:a+i/2}})}function le({dataset:e=[],config:t={},width:n=512,height:r=512,additionalSvgContent:i=``,svgTitle:a=``}={}){let o=re({config:t}),s=oe(e,o),c=se(s),l={top:N(P(o,`chart.padding.top`,24),24),right:N(P(o,`chart.padding.right`,24),24),bottom:N(P(o,`chart.padding.bottom`,24),24),left:N(P(o,`chart.padding.left`,24),24)},u={top:l.top,left:l.left,right:n-l.right,bottom:r-l.bottom};u.width=Math.max(1,u.right-u.left),u.height=Math.max(1,u.bottom-u.top);let d={x:u.left+u.width/2,y:u.top+u.height/2},f=Math.max(1,Math.min(u.width,u.height)/2),p=N(P(o,`chart.donut.radius`,f),f),m=N(P(o,`chart.donut.holeRatio`,.5),.5);return{width:n,height:r,dataset:e,config:o,drawingArea:u,center:d,radius:p,innerRadius:Math.max(0,Math.min(p-1,p*m)),total:c,series:ce({series:s,total:c,startAngle:N(P(o,`chart.donut.startAngle`,-90),-90)}),additionalSvgContent:i,svgTitle:a}}var ue=o();function F(){return ue}function I(e){return O(x(e,`backgroundColor`,`#FFFFFF`),`#FFFFFF`)}function de(e){return b(e?.value??e?.absoluteValue??0,0)}function L(e){return w(e.series).filter(e=>!e?.ghost).map((e,t)=>({...e,value:Math.abs(de(e)),color:O(e.color,`#000000`),name:String(e.name??`Serie ${t+1}`),seriesIndex:e.seriesIndex??e.index??t,patternIndex:e.patternIndex??e.index??t})).filter(e=>Number.isFinite(e.value))}function R(e){return e.reduce((e,t)=>e+Math.abs(b(t.value,0)),0)}function fe(e){let t=x(e,`title`,{}),n=k(t,`subtitle`,{});if(!t.text)return 0;let r=b(t.fontSize,20),i=n.show!==!1&&n.text?b(n.fontSize,14):0;return b(t.paddingTop,12)+r+(i?i+12:0)+b(t.paddingBottom,36)}function pe({state:e,series:t}){let{config:n,width:r}=e,i=x(n,`legend`,{}),a=b(i.fontSize,12),o=b(i.markerSize,10),s=b(i.itemGap,24),c=b(i.rowGap,8),l=b(i.padding,8),u=b(i.labelGap,8),d=Math.max(1,r-l*2),f=[],p=[],m=0;return t.forEach(t=>{let n=Be(e,t),r=D(n,a),i=o+u+r,c=m+i+(p.length?s:0);p.length&&c>d&&(f.push({items:p,width:m}),p=[],m=0),p.push({serie:t,label:n,itemWidth:i}),m+=i+(p.length>1?s:0)}),p.length&&f.push({items:p,width:m}),{rows:f,fontSize:a,markerSize:o,itemGap:s,labelGap:u,rowGap:c,padding:l,height:f.length*Math.max(o,a)+Math.max(0,f.length-1)*c+l*2}}function z(e,t){return!x(e.config,`legend.show`,!0)||!t.length?{rows:[],height:0,padding:0,fontSize:12,markerSize:10,rowGap:0}:pe({state:e,series:t})}function B(e){return!!T(e,`pie`,x(e,`pie`,!1))}function me(e,t){let{config:n,width:r,height:i}=e,a=fe(n),o=z(e,t),s=x(n,`legend.show`,!0),c=x(n,`legend.position`,`bottom`),l=s&&c===`top`?o.height:0,u=s&&c!==`top`?o.height:0,d=b(x(n,`padding.top`,24),24),f=b(x(n,`padding.right`,24),24),p=b(x(n,`padding.bottom`,24),24),m=b(x(n,`padding.left`,24),24),h={top:d+a+l,right:r-f,bottom:i-p-u,left:m};h.width=Math.max(1,h.right-h.left),h.height=Math.max(1,h.bottom-h.top);let g=a?b(T(n,`title.chartOffsetY`,24),24):0,_=Math.max(1,h.height-g),v={x:h.left+h.width/2,y:h.top+g/2+_/2},y=b(x(n,`layout.donut.radiusRatio`,.35),.35),S=Math.max(.1,Math.min(.50001,y)),C=Math.max(12,Math.min(h.width,_)*S),w=x(n,`layout.donut.radius`,null),E=w==null?C:Math.min(C,b(w,C)),D=b(x(n,`layout.donut.strokeWidth`,64),64)/300,O=Math.max(Math.min(E*D*2,E),12*(1+D)),k=x(n,`layout.donut.thickness`,x(n,`layout.donut.size`,O)),A=Math.max(0,Math.min(E-1,k==null?O:b(k,O)));return{...e,drawingArea:h,center:v,radius:E,thickness:A,innerRadius:B(n)?0:Math.max(0,E-A)}}function he(e,t){let n=b(x(e.config,`layout.donut.rotation`,105.25),105.25);return r({series:t},e.center.x,e.center.y,e.radius,e.radius,1.99999,2,1,360,n,B(e.config)?e.radius:e.thickness).map((e,n)=>({...e,index:n,color:O(e.color,t[n]?.color),value:b(e.value,0),name:String(e.name??t[n]?.name??`Serie ${n+1}`),patternIndex:e.patternIndex??t[n]?.patternIndex??n,seriesIndex:e.seriesIndex??t[n]?.seriesIndex??n}))}function ge(e,t){let n=Math.max(1,...t.map(e=>Math.abs(b(e.value,0)))),r=t.map(e=>Math.abs(b(e.value,0))/n);return p({series:r,center:e.center,maxRadius:Math.min(e.drawingArea.width,e.drawingArea.height)/3,hasGhost:!1})}function V(e){return`gradient_${F()}`}function H(e,t){return`polar_gradient_${t}_${F()}`}function _e(e){return T(e.config,`type`,`classic`)!==`classic`||!x(e.config,`useGradient`,!1)?``:C(`circle`,{"data-cy":`donut-gradient-hollow`,cx:e.center.x,cy:e.center.y,r:e.radius<=0?10:e.radius,fill:`url(#${V(e)})`})}function U(e){return`drop_shadow_${F()}`}function ve(e){let{config:t,width:n}=e,r=x(t,`title`,{}),i=k(r,`subtitle`,{});if(!r.text)return``;let a=r.textAlign||`center`,o=a===`left`?b(r.paddingLeft,12):a===`right`?n-b(r.paddingRight,12):n/2,s=a===`left`?`start`:a===`right`?`end`:`middle`,c=b(r.fontSize,20),l=b(i.fontSize,14),u=b(r.paddingTop,12)+c,d=[M(r.text,{"data-cy":`donut-div-title`,x:o,y:u,"font-size":c,"font-weight":r.bold?`700`:`400`,"text-anchor":s,fill:O(r.color,A(t))})];return i.text&&d.push(M(i.text,{"data-cy":`donut-div-subtitle`,x:o,y:u+l+4,"font-size":l,"font-weight":i.bold?`700`:`400`,"text-anchor":s,fill:O(i.color||r.color,A(t))})),j(`g`,{"data-layer":`title`},d.join(``))}function ye(e,t){let{config:n}=e,r=[],a=!!x(n,`useGradient`,!1),o=!!x(n,`layout.donut.useShadow`,!1);if(a){let a=T(n,`type`,`classic`),o=b(x(n,`gradientIntensity`,30),30);if(a===`classic`&&Number.isFinite(e.thickness/e.radius)){let t=B(n)?1:e.thickness/e.radius;r.push(j(`radialGradient`,{id:V(e)},[C(`stop`,{offset:`0%`,"stop-color":i(I(n),0),"stop-opacity":0}),C(`stop`,{offset:`${(1-t)*100}%`,"stop-color":i(`#FFFFFF`,0),"stop-opacity":0}),C(`stop`,{offset:`${(1-t/2)*100}%`,"stop-color":i(`#FFFFFF`,o)}),C(`stop`,{offset:`100%`,"stop-color":i(I(n),0),"stop-opacity":0})].join(``)))}a===`polar`&&t.forEach((t,n)=>{let i=e.polarAreas?.[n];i?.middlePoint&&r.push(j(`radialGradient`,{id:H(e,n),cx:`${l(i.middlePoint.x/e.width*100)}%`,cy:`${l(i.middlePoint.y/e.height*100)}%`,r:`62%`},[C(`stop`,{offset:`0%`,"stop-color":c(t.color,.05),"stop-opacity":o/100}),C(`stop`,{offset:`100%`,"stop-color":t.color})].join(``)))})}if(o){let t=O(x(n,`layout.donut.shadowColor`,`#000000`),`#000000`),i=b(x(n,`layout.donut.shadowOpacity`,.2),.2),a=b(x(n,`layout.donut.shadowBlur`,6),6),o=b(x(n,`layout.donut.shadowOffsetY`,3),3);r.push(j(`filter`,{id:U(e),x:`-50%`,y:`-50%`,width:`200%`,height:`200%`},[C(`feDropShadow`,{dx:0,dy:o,stdDeviation:a,"flood-color":t,"flood-opacity":i})].join(``)))}return r.length?j(`defs`,{"data-layer":`definitions`},r.join(``)):``}function be(e,t){return t.color}function xe(e,t,n){return x(e.config,`useGradient`,!1)?`url(#${H(e,n)})`:t.color}function W(e){let{config:t}=e;return x(t,`layout.donut.borderColorAuto`,!0)?I(t):O(x(t,`layout.donut.borderColor`,I(t)),I(t))}function G(e){return x(e.config,`layout.donut.useShadow`,!1)?`url(#${U(e)})`:void 0}function Se(e,t){if(!t.length)return``;let n=W(e),r=b(x(e.config,`layout.donut.borderWidth`,1),1),i=[];return t.forEach((t,a)=>{b(t.proportion,0)<=0||(i.push(C(`path`,{"data-cy":`donut-arc-underlay-${a}`,d:t.arcSlice,fill:`#FFFFFF`,stroke:I(e.config)})),i.push(C(`path`,{class:`vue-ui-donut-arc-path`,"data-cy":`donut-arc-${a}`,d:t.arcSlice,fill:be(e,t,a),stroke:n,"stroke-width":r,filter:G(e)})))}),j(`g`,{"data-layer":`classic-slices`},i.join(``))}function Ce(e,t,n){if(!t.length)return``;let r=W(e),i=b(x(e.config,`layout.donut.borderWidth`,1),1),a=[];return t.forEach((t,o)=>{let s=n[o];s?.path&&(a.push(C(`path`,{"data-cy":`polar-arc-underlay-${o}`,d:s.path,fill:`#FFFFFF`,stroke:r})),a.push(C(`path`,{class:`vue-ui-donut-arc-path`,"data-cy":`donut-arc-${o}`,d:s.path,fill:xe(e,t,o),stroke:r,"stroke-width":i,filter:G(e)})))}),j(`g`,{"data-layer":`polar-slices`},a.join(``))}function K(t,n,r=`layout.labels.value.rounding`){let{config:i}=t,a=x(i,`layout.labels`,{}),o=a.dataLabels??{},s=a.value??{},c=e({p:o.prefix??``,v:n.value,s:o.suffix??``,r:b(x(i,r,s.rounding??0),s.rounding??0)});return d(s.formatter,n.value,c,{datapoint:n})}function q(t,n){let{config:r}=t,i=x(r,`layout.labels.percentage`,{}),a=b(n.proportion,0)*100,o=e({v:a,s:`%`,r:b(i.rounding,0)});return d(i.formatter,a,o,{datapoint:n})}function J(e,t){let n=x(e.config,`layout.labels`,{}),r=!!n.name?.show,i=!!(n.value?.show??!0),a=!!(n.percentage?.show??!0);return{name:r?String(t.name??``):``,value:i?K(e,t):``,percentage:a?q(e,t):``}}function we(e,t){let{value:n,percentage:r}=J(e,t);return r&&n?`${r} (${n})`:r||n||``}function Y(e,t){let n=x(e.config,`layout.labels`,{}),r=n.dataLabels??{},i=!!(n.value?.show??!0),a=!!(n.percentage?.show??!0),o=i?K(e,t):``,s=a?q(e,t):``;return o&&s?r.valuePercentageRatio===`percentageFirst`?`${s}\n${o}`:`${o}\n${s}`:o||s||``}function X(e,t){let n=x(e.config,`layout.labels`,{}).dataLabels??{};if(!T(e.config,`dataLabels.show`,n.show??!0)||!n.show)return!1;let r=b(n.hideUnderValue,0);return b(t.proportion,0)*100>r}function Te(e,t){let n=x(e.config,`layout.labels.dataLabels`,{}),r=b(n.smallArcClusterThreshold,0),i=b(n.hideUnderValue,0),a=b(t.proportion,0)*100;return a>i&&r>0&&a<=r}function Z(e){return!!x(e.config,`layout.curvedMarkers`,x(e.config,`layout.donut.curvedMarkers`,!1))}function Q(e,t){let n=x(e.config,`layout.labels.dataLabels`,{}),r={},i=e.center.x,a=e.center.y,o=b(n.smallArcClusterFontSize??n.fontSize,10),s=o/3,c=o*1.5,d=e.drawingArea.top+16,f=e.drawingArea.bottom-16,p=i-(e.radius+6),m=i+(e.radius+6),g=Z(e);function _(e){return{x:l(e.center?.endX??e.endX),y:l(e.center?.endY??e.endY)}}function v({midX:e,midY:t,bandX:n,bandY:r}){if(!g)return`M ${e} ${t} L ${e} ${r} L ${n} ${r}`;let o=n<i?-1:1,s=n-e,c=r-t,l=Math.sqrt(s*s+c*c)||1,u=e-i,d=t-a,f=Math.sqrt(u*u+d*d)||1,p=u/f,m=d/f,h=f+9;function _({x:e,y:t}){let n=e-i,r=t-a,o=Math.sqrt(n*n+r*r)||1;if(o>=h)return{x:e,y:t};let s=h/o;return{x:i+n*s,y:a+r*s}}if(l<56){let o=s/l,u=-(c/l),d=o,f=(e+n)*.5,h=(t+r)*.5,g=(f+u-i)**2+(h+d-a)**2;(f-u-i)**2+(h-d-a)**2>g&&(u=-u,d=-d);let v=Math.max(0,Math.min(1,(l-18)/44)),y=v*v*(3-2*v),b=e+s*.78,x=t+c*.78,S=_({x:b+u*(2.5+y*4)*.9+p*(1+y*2.5),y:x+d*(2.5+y*4)*.9+m*(1+y*2.5)});return`M ${e} ${t} Q ${S.x} ${S.y} ${n} ${r}`}let v=l*.34;v<20&&(v=20),v>46&&(v=46);let y=l*.46;y<22&&(y=22),y>70&&(y=70);let b=_({x:e+p*v,y:t+m*v}),x=i+o*Math.max(Math.abs(n-i),h),S=_({x:n-o*Math.min(y,Math.abs(x-n)*.75),y:r});return`M ${e} ${t} C ${b.x} ${b.y} ${S.x} ${S.y} ${n} ${r}`}function y(e){let t=String(e??``).split(/\n/g);return c+Math.max(0,t.length-1)*o*1.2}function S({arc:e,index:t}){let n=_(e);return{arc:e,index:t,midX:n.x,midY:n.y,inlineMarkerX:u(e).x,inlineMarkerY:h(e)-3.5,labelHeight:y(e.name)}}function C(e){let t=e.inlineMarkerY<a,n=e.inlineMarkerX<i;return t&&n?`TL`:t&&!n?`TR`:!t&&n?`BL`:`BR`}function w(e,t){let n=t.startsWith(`T`);e.sort((e,t)=>n?e.inlineMarkerY-t.inlineMarkerY||e.index-t.index:t.inlineMarkerY-e.inlineMarkerY||e.index-t.index)}function T({side:e,markerX:t,markerY:n,labelY:r,connectorPath:i}){return{side:e,labelX:e===`left`?t-8:t+8,labelY:r+s,textAnchor:e===`left`?`end`:`start`,markerX:t,markerY:n,connectorPath:i}}function E({candidateList:e,side:t,bandMarkerX:n,startY:i,direction:a}){let o=i;e.forEach(e=>{let{index:i,midX:s,midY:c,labelHeight:l}=e,u;a===`down`?(u=o,o+=l):(o-=l,u=o);let d=u,f=v({midX:s,midY:c,bandX:n,bandY:d});r[i]=T({side:t,markerX:n,markerY:d,labelY:u,connectorPath:f})})}let D={TL:[],TR:[],BL:[],BR:[]};return t.map((e,t)=>S({arc:e,index:t})).filter(({arc:t})=>X(e,t)&&Te(e,t)).forEach(e=>{D[C(e)].push(e)}),Object.keys(D).forEach(e=>{w(D[e],e)}),E({candidateList:D.TL,side:`left`,bandMarkerX:p,startY:d,direction:`down`}),E({candidateList:D.TR,side:`right`,bandMarkerX:m,startY:d,direction:`down`}),D.BL.length>1&&E({candidateList:D.BL,side:`left`,bandMarkerX:p,startY:f,direction:`up`}),D.BR.length>1&&E({candidateList:D.BR,side:`right`,bandMarkerX:m,startY:f,direction:`up`}),r}function Ee({state:e,arc:t,arcIndex:n,smallArcLayout:r,fontSize:i}){let a=x(e.config,`layout.labels`,{}),o=a.percentage??{},s=a.name??{},c=r?.labelX??u(t,!0,12).x,l=r?.labelY??h(t),d=r?.textAnchor??u(t,!0,12).anchor,{name:f}=J(e,t),p=we(e,t),m=String(f).split(/\n/g),_=f?m.map((t,n)=>j(`tspan`,{class:`vue-data-ui-datalabel-name`,x:n===0?void 0:c,dy:n===0?void 0:i*1.2,fill:O(s.color,A(e.config)),"font-size":i,"font-weight":s.bold?`700`:`400`},g(t+(n===m.length-1?` `:``)))).join(``):``,v=p?j(`tspan`,{class:`vue-data-ui-datalabel-value`,fill:O(o.color,A(e.config)),"font-size":i,"font-weight":o.bold?`700`:`400`},g(p)):``;return j(`text`,{"data-cy":`donut-label-inline-${n}`,class:`vue-data-ui-datalabel-inline`,x:c,y:l,"text-anchor":d},`${_}${v}`)}function De(e,t){let n=x(e.config,`layout.labels`,{}),r=n.dataLabels??{};if(!T(e.config,`dataLabels.show`,r.show??!0)||!r.show)return``;let i=b(r.fontSize??n.value?.fontSize??12,12);O(r.color??n.value?.color??A(e.config),A(e.config)),r.bold??n.value?.bold;let a=b(r.offset,16),o=Q(e,t),s=[];return t.forEach((t,n)=>{if(!X(e,t))return;let c=o[n];Y(e,t),c?s.push(Ee({state:e,arc:t,arcIndex:n,smallArcLayout:c,fontSize:b(r.smallArcClusterFontSize,i)})):s.push(Ee({state:e,arc:t,arcIndex:n,smallArcLayout:{labelX:u(t,!1,a+i/2).x,labelY:h(t,a,a),textAnchor:u(t).anchor},fontSize:i}))}),s.length?j(`g`,{"data-layer":`data-labels`},s.join(``)):``}function Oe(e,n,r=42){return t({initX:n.middlePoint.x,initY:n.middlePoint.y,offset:r,centerX:e.center.x,centerY:e.center.y})}function ke(e,t){return t.x<e.center.x?`end`:t.x>e.center.x?`start`:`middle`}function Ae(e,t,n,r){let i=x(e.config,`layout.labels`,{}),a=i.percentage??{},o=i.name??{},s=b(a.fontSize,i.dataLabels?.fontSize??12),c=b(o.fontSize,i.dataLabels?.fontSize??12),l=j(`tspan`,{class:`vue-data-ui-datalabel-value`,fill:O(a.color,A(e.config)),"font-size":s,"font-weight":a.bold?`700`:`400`},g(String(Y(e,t).replace(/\n/g,` / `)))),u=o.show?String(t.name??``).split(/\n/g).map((t,r)=>j(`tspan`,{class:`vue-data-ui-datalabel-name`,x:r===0?void 0:n,dy:r===0?void 0:c*1.2,fill:O(o.color,A(e.config)),"font-size":c,"font-weight":o.bold?`700`:`400`},g(t))).join(``):``;return r===`end`?`${u}${l}`:`${l}${u}`}function je(e,t,n){let r=x(e.config,`layout.labels`,{}),i=r.dataLabels??{},a=r.value??{},o=r.percentage??{},c=r.name??{};if(!T(e.config,`dataLabels.show`,i.show??!0)||!i.show)return``;let l=!!i.oneLine,u=b(a.fontSize,i.fontSize??12),d=b(c.fontSize,i.fontSize??12),f=O(o.color,A(e.config)),p=[];return t.forEach((t,r)=>{let i=n[r];if(!i||!X(e,t))return;let a=Oe(e,i,42),m=ke(e,a);l?p.push(j(`text`,{"data-cy":`polar-label-inline`,class:`vue-data-ui-datalabel-inline`,x:a.x,y:a.y,"text-anchor":m},Ae(e,t,a.x,m))):(p.push(j(`text`,{"data-cy":`polar-label-value`,class:`vue-data-ui-datalabel-value`,x:a.x,y:a.y,"font-size":u,"font-weight":o.bold?`700`:`400`,"text-anchor":m,fill:f},te({content:Y(e,t),x:a.x,fontSize:u,fill:f,textAnchor:m}))),c.show&&p.push(j(`text`,{"data-cy":`polar-label-name`,class:`vue-data-ui-datalabel-name`,x:a.x,y:a.y+d*1.2,"font-size":d,"font-weight":c.bold?`700`:`400`,"text-anchor":m,fill:O(c.color,A(e.config))},s({content:g(String(t.name??``)),fontSize:d,fill:O(c.color,A(e.config)),x:a.x}))))}),p.length?j(`g`,{"data-layer":`polar-data-labels`},p.join(``)):``}function Me(e,t,n=null){if(n?.connectorPath)return n.connectorPath;let r=x(e.config,`layout.labels.dataLabels`,{}),i=b(r.offset,16),a=b(r.markerFlatLength,12),o=Z(e),s=u(t).x,c=h(t,i,i)-4,l=s+(t.center.endX>t.cx?-a:a),d=`${s},${c}`,f=`${l},${c}`,p=`${t.center.endX},${t.center.endY}`;return o?`M${d} Q${f} ${p}`:`M${d} ${f} ${p}`}function Ne(e,t){let n=x(e.config,`layout.labels.dataLabels`,{});if(!T(e.config,`dataLabels.show`,n.show??!0)||!n.show)return``;let r=Q(e,t),i=[];return t.forEach((t,a)=>{if(!X(e,t))return;let o=r[a],s=Me(e,t,o);s&&(i.push(C(`path`,{"data-cy":`donut-marker-${a}`,d:s,stroke:t.color,"stroke-width":b(n.markerStrokeWidth,1),"stroke-linecap":`round`,"stroke-linejoin":`round`,fill:`none`})),i.push(C(`circle`,{"data-cy":`donut-label-marker-${a}`,cx:o?.markerX??u(t).x,cy:o?.markerY??h(t)-3.5,r:b(n.markerRadius,3),fill:t.color,stroke:I(e.config),"stroke-width":1})))}),i.length?j(`g`,{"data-layer":`label-markers`},i.join(``)):``}function Pe(e,n,r){let i=x(e.config,`layout.labels.dataLabels`,{});if(!T(e.config,`dataLabels.show`,i.show??!0)||!i.show)return``;let a=[];return n.forEach((n,o)=>{let s=r[o];if(!s?.middlePoint||!X(e,n))return;let c=t({initX:s.middlePoint.x,initY:s.middlePoint.y,offset:24,centerX:e.center.x,centerY:e.center.y});a.push(C(`path`,{"data-cy":`polar-marker-${o}`,d:`M ${c.x},${c.y} ${s.middlePoint.x},${s.middlePoint.y}`,stroke:n.color,"stroke-width":b(i.markerStrokeWidth,1),"stroke-linecap":`round`,"stroke-linejoin":`round`,fill:`none`})),a.push(C(`circle`,{"data-cy":`polar-label-marker-${o}`,cx:c.x,cy:c.y,r:b(i.markerRadius,3),fill:n.color,stroke:I(e.config),"stroke-width":1}))}),a.length?j(`g`,{"data-layer":`polar-label-markers`},a.join(``)):``}function $(e,t){return e==null||e===``?``:M(e,{"text-anchor":`middle`,...t})}function Fe(t,n,r){if(T(t.config,`type`,`classic`)!==`classic`||B(t.config)||!n)return``;let i=x(t.config,`layout.labels.hollow`,{}),a=i.total??{},o=i.average??{},s=[];if(a.show){let r=b(a.fontSize,14),i=!!o.show,c=t.center.y-(i?r:0)+b(a.offsetY,0),l=a.value??{},u=b(l.fontSize,r),f=d(l.formatter,n,e({p:l.prefix??``,v:n,s:l.suffix??``,r:b(l.rounding,0)}),{total:n});s.push($(a.text??``,{"data-cy":`hollow-total-name`,x:t.center.x,y:c,fill:O(a.color,A(t.config)),"font-size":r,"font-weight":a.bold?`700`:`400`})),s.push($(f,{"data-cy":`hollow-total-value`,x:t.center.x,y:t.center.y+r-(i?r:0)+b(l.offsetY,0),fill:O(l.color,O(a.color,A(t.config))),"font-size":u,"font-weight":l.bold?`700`:`400`}))}if(o.show){let i=b(o.fontSize,14),c=!!a.show,l=n/Math.max(1,r.length),u=o.value??{},f=b(u.fontSize,i),p=d(u.formatter,l,e({p:u.prefix??``,v:l,s:u.suffix??``,r:b(u.rounding,0)}),{average:l});s.push($(o.text??``,{"data-cy":`hollow-average-name`,x:t.center.x,y:t.center.y+(c?i:0)+b(o.offsetY,0),fill:O(o.color,A(t.config)),"font-size":i,"font-weight":o.bold?`700`:`400`})),s.push($(p,{"data-cy":`hollow-average-value`,x:t.center.x,y:t.center.y+(c?i:0)+i+b(u.offsetY,0),fill:O(u.color,O(o.color,A(t.config))),"font-size":f,"font-weight":u.bold?`700`:`400`}))}return s.filter(Boolean).length?j(`g`,{class:`vue-data-ui-donut-hollow-labels`,"data-layer":`hollow-labels`},s.join(``)):``}function Ie(t,n){let{config:r,center:i}=t,a=x(r,`layout.donut.labels.total`,x(r,`layout.labels.total`,{}));if(!a.show||!Number.isFinite(n)||n<=0)return``;let o=x(r,`layout.labels.dataLabels`,{}),s=b(a.fontSize,20),c=O(a.color,A(r)),l=d(a.formatter,n,e({p:o.prefix??``,v:n,s:o.suffix??``,r:b(a.rounding,0)}),{total:n});return M(l,{"data-cy":`donut-total`,x:i.x,y:i.y+s/3,"font-size":s,"font-weight":a.bold?`700`:`400`,"text-anchor":`middle`,fill:c})}function Le(e,t){let n=R(L(e));return n?b(t.value,0)/n*100:0}function Re(t,n){let r=x(t.config,`legend`,{}),i=x(t.config,`layout.labels`,{}),a=i.dataLabels??{},o=i.value??{},s=e({p:a.prefix??``,v:n.value,s:a.suffix??``,r:b(r.roundingValue,o.rounding??0)});return d(o.formatter,n.value,s,{datapoint:n,serie:n})}function ze(t,n){let r=x(t.config,`legend`,{}),i=x(t.config,`layout.labels`,{}).percentage??{},a=Le(t,n),o=e({v:a,s:`%`,r:b(r.roundingPercentage,i.rounding??0)});return d(i.formatter,a,o,{datapoint:n,serie:n})}function Be(e,t){let n=x(e.config,`legend`,{}),r=[],i=n.showPercentage?ze(e,t):``,a=n.showValue?Re(e,t):``,o=i&&n.usePercentageParens?`(${i})`:i,s=a&&n.useValueParens?`(${a})`:a;return n.showValueFirst?(s&&r.push(s),o&&r.push(o)):(o&&r.push(o),s&&r.push(s)),`${t.name}${r.length?`: ${r.join(` `)}`:``}`}function Ve(e,t){let n=x(e.config,`legend`,{});if(!n.show||!t.length)return``;let r=z(e,t),i=O(n.color,A(e.config)),a=n.position||`bottom`,o=Math.max(r.markerSize,r.fontSize),s=a===`top`?r.padding+o:e.height-r.height+r.padding+o,c=[];return r.rows.forEach((t,a)=>{let l=r.padding+(e.width-r.padding*2)/2-t.width/2,u=s+a*(o+r.rowGap);t.items.forEach(({serie:e,label:t,itemWidth:a})=>{c.push(C(`circle`,{cx:l+r.markerSize/2,cy:u,r:r.markerSize/2,fill:e.color,opacity:e.opacity??1})),c.push(M(t,{x:l+r.markerSize+r.labelGap,y:u+2,"font-size":r.fontSize,"font-weight":n.bold?`700`:`400`,"dominant-baseline":`middle`,fill:i,opacity:e.opacity??1})),l+=a+r.itemGap})}),j(`g`,{"data-layer":`legend`,"data-cy":`donut-div-legend`},c.join(``))}function He(e){return j(`g`,{"data-layer":`no-data`},[C(`circle`,{cx:e.center.x,cy:e.center.y,r:Math.max(1,e.radius),fill:O(x(e.config,`layout.donut.emptyFill`,`#E1E5E8`),`#E1E5E8`),opacity:.4})].join(``))}function Ue(e,t){let n=e.additionalSvgContent;return typeof n==`function`?n({width:e.width,height:e.height,drawingArea:e.drawingArea,center:e.center,radius:e.radius,thickness:e.thickness,innerRadius:e.innerRadius,config:e.config,series:t.map(e=>({...e}))})??``:n??``}function We(e,t,n){let r=`${T(e.config,`title.text`,`Donut chart`)||e.svgTitle||`Donut chart`}. ${t.length} series. Total ${l(n)}.`;return j(`title`,{},g(r))}async function Ge(e){let t=e.config,n=b(e.width,x(t,`width`,512)),r=b(e.height,x(t,`height`,512)),i=L(e),a=R(i),o=me({...e,width:n,height:r},i),s=he(o,i),c=ge(o,i),l=T(t,`type`,`classic`),u=a>0&&s.some(e=>b(e.proportion,0)>0);return`
|
|
1
|
+
import{$ as e,Bt as t,Ht as n,It as r,Jt as i,S as a,X as o,Y as s,Yt as c,b as l,f as u,i as d,in as f,j as p,nn as m,p as h,st as g,t as _}from"./lib-BaWaqwnJ.js";import{t as v}from"./useConfig-B-AzS3w-.js";import{t as y}from"./vue_ui_donut-D72uP7v_.js";import{_ as b,a as x,c as S,d as C,g as w,i as T,l as E,n as D,o as O,p as k,r as A,s as ee,t as te,u as j,v as M}from"./render-common-CxohOkPd.js";var{vue_ui_donut:ne}=v();function re({config:e={}}={}){let t=e??{},r=f({userConfig:t,defaultConfig:ne}),i=r.theme;if(!i)return{...r,customPalette:r.customPalette?.length?r.customPalette:n};let a=f({userConfig:y[i]||{},defaultConfig:r}),o=f({userConfig:t,defaultConfig:a});return{...o,customPalette:o.customPalette?.length?o.customPalette:m[i]||n}}function N(e,t=0){let n=Number(e);return Number.isFinite(n)?n:t}function P(e,t,n){return String(t).split(`.`).reduce((e,t)=>e&&e[t]!==void 0?e[t]:void 0,e)??n}function ie(e){return typeof e!=`object`||!e?0:Array.isArray(e.values)?e.values.reduce((e,t)=>e+N(t,0),0):Array.isArray(e.series)?e.series.reduce((e,t)=>e+N(t,0),0):N(e.value??e.y??0,0)}function ae(e,t){return String(e?.name??e?.label??`Serie ${t+1}`)}function oe(e=[],t){let r=Array.isArray(t.customPalette)?t.customPalette:n;return(Array.isArray(e)?e:[]).map((e,t)=>({source:e,sourceIndex:t,value:ie(e)})).filter(e=>Number.isFinite(e.value)).sort((e,n)=>t.sorted?e.source?.ghost&&!n.source?.ghost?1:n.source?.ghost&&!e.source?.ghost?-1:n.value-e.value:0).map((e,t)=>{let n=e.source,i=e.value,o=(n?.color?a(n.color):``)||r[t%r.length];return{...n,id:n?.id??`donut_serie_${t}`,name:ae(n,t),value:i,absoluteValue:Math.abs(i),absoluteValues:Array.isArray(n?.values)?n.values:[i],color:o,index:t,sourceIndex:e.sourceIndex,patternIndex:n?.patternIndex??t,seriesIndex:n?.seriesIndex??t,ghost:!!n?.ghost}}).filter(e=>Number.isFinite(e.absoluteValue))}function se(e){return e.reduce((e,t)=>e+t.absoluteValue,0)}function ce({series:e,total:t,startAngle:n=-90}){let r=n;return e.map(e=>{let n=t?e.absoluteValue/t:0,i=n*360,a=r,o=r+i;return r=o,{...e,ratio:n,percentage:n*100,startAngle:a,endAngle:o,midAngle:a+i/2}})}function le({dataset:e=[],config:t={},width:n=512,height:r=512,additionalSvgContent:i=``,svgTitle:a=``}={}){let o=re({config:t}),s=oe(e,o),c=se(s),l={top:N(P(o,`chart.padding.top`,24),24),right:N(P(o,`chart.padding.right`,24),24),bottom:N(P(o,`chart.padding.bottom`,24),24),left:N(P(o,`chart.padding.left`,24),24)},u={top:l.top,left:l.left,right:n-l.right,bottom:r-l.bottom};u.width=Math.max(1,u.right-u.left),u.height=Math.max(1,u.bottom-u.top);let d={x:u.left+u.width/2,y:u.top+u.height/2},f=Math.max(1,Math.min(u.width,u.height)/2),p=N(P(o,`chart.donut.radius`,f),f),m=N(P(o,`chart.donut.holeRatio`,.5),.5);return{width:n,height:r,dataset:e,config:o,drawingArea:u,center:d,radius:p,innerRadius:Math.max(0,Math.min(p-1,p*m)),total:c,series:ce({series:s,total:c,startAngle:N(P(o,`chart.donut.startAngle`,-90),-90)}),additionalSvgContent:i,svgTitle:a}}var ue=o();function F(){return ue}function I(e){return O(x(e,`backgroundColor`,`#FFFFFF`),`#FFFFFF`)}function de(e){return b(e?.value??e?.absoluteValue??0,0)}function L(e){return w(e.series).filter(e=>!e?.ghost).map((e,t)=>({...e,value:Math.abs(de(e)),color:O(e.color,`#000000`),name:String(e.name??`Serie ${t+1}`),seriesIndex:e.seriesIndex??e.index??t,patternIndex:e.patternIndex??e.index??t})).filter(e=>Number.isFinite(e.value))}function R(e){return e.reduce((e,t)=>e+Math.abs(b(t.value,0)),0)}function fe(e){let t=x(e,`title`,{}),n=k(t,`subtitle`,{});if(!t.text)return 0;let r=b(t.fontSize,20),i=n.show!==!1&&n.text?b(n.fontSize,14):0;return b(t.paddingTop,12)+r+(i?i+12:0)+b(t.paddingBottom,36)}function pe({state:e,series:t}){let{config:n,width:r}=e,i=x(n,`legend`,{}),a=b(i.fontSize,12),o=b(i.markerSize,10),s=b(i.itemGap,24),c=b(i.rowGap,8),l=b(i.padding,8),u=b(i.labelGap,8),d=Math.max(1,r-l*2),f=[],p=[],m=0;return t.forEach(t=>{let n=Be(e,t),r=D(n,a),i=o+u+r,c=m+i+(p.length?s:0);p.length&&c>d&&(f.push({items:p,width:m}),p=[],m=0),p.push({serie:t,label:n,itemWidth:i}),m+=i+(p.length>1?s:0)}),p.length&&f.push({items:p,width:m}),{rows:f,fontSize:a,markerSize:o,itemGap:s,labelGap:u,rowGap:c,padding:l,height:f.length*Math.max(o,a)+Math.max(0,f.length-1)*c+l*2}}function z(e,t){return!x(e.config,`legend.show`,!0)||!t.length?{rows:[],height:0,padding:0,fontSize:12,markerSize:10,rowGap:0}:pe({state:e,series:t})}function B(e){return!!T(e,`pie`,x(e,`pie`,!1))}function me(e,t){let{config:n,width:r,height:i}=e,a=fe(n),o=z(e,t),s=x(n,`legend.show`,!0),c=x(n,`legend.position`,`bottom`),l=s&&c===`top`?o.height:0,u=s&&c!==`top`?o.height:0,d=b(x(n,`padding.top`,24),24),f=b(x(n,`padding.right`,24),24),p=b(x(n,`padding.bottom`,24),24),m=b(x(n,`padding.left`,24),24),h={top:d+a+l,right:r-f,bottom:i-p-u,left:m};h.width=Math.max(1,h.right-h.left),h.height=Math.max(1,h.bottom-h.top);let g=a?b(T(n,`title.chartOffsetY`,24),24):0,_=Math.max(1,h.height-g),v={x:h.left+h.width/2,y:h.top+g/2+_/2},y=b(x(n,`layout.donut.radiusRatio`,.35),.35),S=Math.max(.1,Math.min(.50001,y)),C=Math.max(12,Math.min(h.width,_)*S),w=x(n,`layout.donut.radius`,null),E=w==null?C:Math.min(C,b(w,C)),D=b(x(n,`layout.donut.strokeWidth`,64),64)/300,O=Math.max(Math.min(E*D*2,E),12*(1+D)),k=x(n,`layout.donut.thickness`,x(n,`layout.donut.size`,O)),A=Math.max(0,Math.min(E-1,k==null?O:b(k,O)));return{...e,drawingArea:h,center:v,radius:E,thickness:A,innerRadius:B(n)?0:Math.max(0,E-A)}}function he(e,t){let n=b(x(e.config,`layout.donut.rotation`,105.25),105.25);return r({series:t},e.center.x,e.center.y,e.radius,e.radius,1.99999,2,1,360,n,B(e.config)?e.radius:e.thickness).map((e,n)=>({...e,index:n,color:O(e.color,t[n]?.color),value:b(e.value,0),name:String(e.name??t[n]?.name??`Serie ${n+1}`),patternIndex:e.patternIndex??t[n]?.patternIndex??n,seriesIndex:e.seriesIndex??t[n]?.seriesIndex??n}))}function ge(e,t){let n=Math.max(1,...t.map(e=>Math.abs(b(e.value,0)))),r=t.map(e=>Math.abs(b(e.value,0))/n);return p({series:r,center:e.center,maxRadius:Math.min(e.drawingArea.width,e.drawingArea.height)/3,hasGhost:!1})}function V(e){return`gradient_${F()}`}function H(e,t){return`polar_gradient_${t}_${F()}`}function _e(e){return T(e.config,`type`,`classic`)!==`classic`||!x(e.config,`useGradient`,!1)?``:C(`circle`,{"data-cy":`donut-gradient-hollow`,cx:e.center.x,cy:e.center.y,r:e.radius<=0?10:e.radius,fill:`url(#${V(e)})`})}function U(e){return`drop_shadow_${F()}`}function ve(e){let{config:t,width:n}=e,r=x(t,`title`,{}),i=k(r,`subtitle`,{});if(!r.text)return``;let a=r.textAlign||`center`,o=a===`left`?b(r.paddingLeft,12):a===`right`?n-b(r.paddingRight,12):n/2,s=a===`left`?`start`:a===`right`?`end`:`middle`,c=b(r.fontSize,20),l=b(i.fontSize,14),u=b(r.paddingTop,12)+c,d=[M(r.text,{"data-cy":`donut-div-title`,x:o,y:u,"font-size":c,"font-weight":r.bold?`700`:`400`,"text-anchor":s,fill:O(r.color,A(t))})];return i.text&&d.push(M(i.text,{"data-cy":`donut-div-subtitle`,x:o,y:u+l+4,"font-size":l,"font-weight":i.bold?`700`:`400`,"text-anchor":s,fill:O(i.color||r.color,A(t))})),j(`g`,{"data-layer":`title`},d.join(``))}function ye(e,t){let{config:n}=e,r=[],a=!!x(n,`useGradient`,!1),o=!!x(n,`layout.donut.useShadow`,!1);if(a){let a=T(n,`type`,`classic`),o=b(x(n,`gradientIntensity`,30),30);if(a===`classic`&&Number.isFinite(e.thickness/e.radius)){let t=B(n)?1:e.thickness/e.radius;r.push(j(`radialGradient`,{id:V(e)},[C(`stop`,{offset:`0%`,"stop-color":i(I(n),0),"stop-opacity":0}),C(`stop`,{offset:`${(1-t)*100}%`,"stop-color":i(`#FFFFFF`,0),"stop-opacity":0}),C(`stop`,{offset:`${(1-t/2)*100}%`,"stop-color":i(`#FFFFFF`,o)}),C(`stop`,{offset:`100%`,"stop-color":i(I(n),0),"stop-opacity":0})].join(``)))}a===`polar`&&t.forEach((t,n)=>{let i=e.polarAreas?.[n];i?.middlePoint&&r.push(j(`radialGradient`,{id:H(e,n),cx:`${l(i.middlePoint.x/e.width*100)}%`,cy:`${l(i.middlePoint.y/e.height*100)}%`,r:`62%`},[C(`stop`,{offset:`0%`,"stop-color":c(t.color,.05),"stop-opacity":o/100}),C(`stop`,{offset:`100%`,"stop-color":t.color})].join(``)))})}if(o){let t=O(x(n,`layout.donut.shadowColor`,`#000000`),`#000000`),i=b(x(n,`layout.donut.shadowOpacity`,.2),.2),a=b(x(n,`layout.donut.shadowBlur`,6),6),o=b(x(n,`layout.donut.shadowOffsetY`,3),3);r.push(j(`filter`,{id:U(e),x:`-50%`,y:`-50%`,width:`200%`,height:`200%`},[C(`feDropShadow`,{dx:0,dy:o,stdDeviation:a,"flood-color":t,"flood-opacity":i})].join(``)))}return r.length?j(`defs`,{"data-layer":`definitions`},r.join(``)):``}function be(e,t){return t.color}function xe(e,t,n){return x(e.config,`useGradient`,!1)?`url(#${H(e,n)})`:t.color}function W(e){let{config:t}=e;return x(t,`layout.donut.borderColorAuto`,!0)?I(t):O(x(t,`layout.donut.borderColor`,I(t)),I(t))}function G(e){return x(e.config,`layout.donut.useShadow`,!1)?`url(#${U(e)})`:void 0}function Se(e,t){if(!t.length)return``;let n=W(e),r=b(x(e.config,`layout.donut.borderWidth`,1),1),i=[];return t.forEach((t,a)=>{b(t.proportion,0)<=0||(i.push(C(`path`,{"data-cy":`donut-arc-underlay-${a}`,d:t.arcSlice,fill:`#FFFFFF`,stroke:I(e.config)})),i.push(C(`path`,{class:`vue-ui-donut-arc-path`,"data-cy":`donut-arc-${a}`,d:t.arcSlice,fill:be(e,t,a),stroke:n,"stroke-width":r,filter:G(e)})))}),j(`g`,{"data-layer":`classic-slices`},i.join(``))}function Ce(e,t,n){if(!t.length)return``;let r=W(e),i=b(x(e.config,`layout.donut.borderWidth`,1),1),a=[];return t.forEach((t,o)=>{let s=n[o];s?.path&&(a.push(C(`path`,{"data-cy":`polar-arc-underlay-${o}`,d:s.path,fill:`#FFFFFF`,stroke:r})),a.push(C(`path`,{class:`vue-ui-donut-arc-path`,"data-cy":`donut-arc-${o}`,d:s.path,fill:xe(e,t,o),stroke:r,"stroke-width":i,filter:G(e)})))}),j(`g`,{"data-layer":`polar-slices`},a.join(``))}function K(t,n,r=`layout.labels.value.rounding`){let{config:i}=t,a=x(i,`layout.labels`,{}),o=a.dataLabels??{},s=a.value??{},c=e({p:o.prefix??``,v:n.value,s:o.suffix??``,r:b(x(i,r,s.rounding??0),s.rounding??0)});return d(s.formatter,n.value,c,{datapoint:n})}function q(t,n){let{config:r}=t,i=x(r,`layout.labels.percentage`,{}),a=b(n.proportion,0)*100,o=e({v:a,s:`%`,r:b(i.rounding,0)});return d(i.formatter,a,o,{datapoint:n})}function J(e,t){let n=x(e.config,`layout.labels`,{}),r=!!n.name?.show,i=!!(n.value?.show??!0),a=!!(n.percentage?.show??!0);return{name:r?String(t.name??``):``,value:i?K(e,t):``,percentage:a?q(e,t):``}}function we(e,t){let{value:n,percentage:r}=J(e,t);return r&&n?`${r} (${n})`:r||n||``}function Y(e,t){let n=x(e.config,`layout.labels`,{}),r=n.dataLabels??{},i=!!(n.value?.show??!0),a=!!(n.percentage?.show??!0),o=i?K(e,t):``,s=a?q(e,t):``;return o&&s?r.valuePercentageRatio===`percentageFirst`?`${s}\n${o}`:`${o}\n${s}`:o||s||``}function X(e,t){let n=x(e.config,`layout.labels`,{}).dataLabels??{};if(!T(e.config,`dataLabels.show`,n.show??!0)||!n.show)return!1;let r=b(n.hideUnderValue,0);return b(t.proportion,0)*100>r}function Te(e,t){let n=x(e.config,`layout.labels.dataLabels`,{}),r=b(n.smallArcClusterThreshold,0),i=b(n.hideUnderValue,0),a=b(t.proportion,0)*100;return a>i&&r>0&&a<=r}function Z(e){return!!x(e.config,`layout.curvedMarkers`,x(e.config,`layout.donut.curvedMarkers`,!1))}function Q(e,t){let n=x(e.config,`layout.labels.dataLabels`,{}),r={},i=e.center.x,a=e.center.y,o=b(n.smallArcClusterFontSize??n.fontSize,10),s=o/3,c=o*1.5,d=e.drawingArea.top+16,f=e.drawingArea.bottom-16,p=i-(e.radius+6),m=i+(e.radius+6),g=Z(e);function _(e){return{x:l(e.center?.endX??e.endX),y:l(e.center?.endY??e.endY)}}function v({midX:e,midY:t,bandX:n,bandY:r}){if(!g)return`M ${e} ${t} L ${e} ${r} L ${n} ${r}`;let o=n<i?-1:1,s=n-e,c=r-t,l=Math.sqrt(s*s+c*c)||1,u=e-i,d=t-a,f=Math.sqrt(u*u+d*d)||1,p=u/f,m=d/f,h=f+9;function _({x:e,y:t}){let n=e-i,r=t-a,o=Math.sqrt(n*n+r*r)||1;if(o>=h)return{x:e,y:t};let s=h/o;return{x:i+n*s,y:a+r*s}}if(l<56){let o=s/l,u=-(c/l),d=o,f=(e+n)*.5,h=(t+r)*.5,g=(f+u-i)**2+(h+d-a)**2;(f-u-i)**2+(h-d-a)**2>g&&(u=-u,d=-d);let v=Math.max(0,Math.min(1,(l-18)/44)),y=v*v*(3-2*v),b=e+s*.78,x=t+c*.78,S=_({x:b+u*(2.5+y*4)*.9+p*(1+y*2.5),y:x+d*(2.5+y*4)*.9+m*(1+y*2.5)});return`M ${e} ${t} Q ${S.x} ${S.y} ${n} ${r}`}let v=l*.34;v<20&&(v=20),v>46&&(v=46);let y=l*.46;y<22&&(y=22),y>70&&(y=70);let b=_({x:e+p*v,y:t+m*v}),x=i+o*Math.max(Math.abs(n-i),h),S=_({x:n-o*Math.min(y,Math.abs(x-n)*.75),y:r});return`M ${e} ${t} C ${b.x} ${b.y} ${S.x} ${S.y} ${n} ${r}`}function y(e){let t=String(e??``).split(/\n/g);return c+Math.max(0,t.length-1)*o*1.2}function S({arc:e,index:t}){let n=_(e);return{arc:e,index:t,midX:n.x,midY:n.y,inlineMarkerX:u(e).x,inlineMarkerY:h(e)-3.5,labelHeight:y(e.name)}}function C(e){let t=e.inlineMarkerY<a,n=e.inlineMarkerX<i;return t&&n?`TL`:t&&!n?`TR`:!t&&n?`BL`:`BR`}function w(e,t){let n=t.startsWith(`T`);e.sort((e,t)=>n?e.inlineMarkerY-t.inlineMarkerY||e.index-t.index:t.inlineMarkerY-e.inlineMarkerY||e.index-t.index)}function T({side:e,markerX:t,markerY:n,labelY:r,connectorPath:i}){return{side:e,labelX:e===`left`?t-8:t+8,labelY:r+s,textAnchor:e===`left`?`end`:`start`,markerX:t,markerY:n,connectorPath:i}}function E({candidateList:e,side:t,bandMarkerX:n,startY:i,direction:a}){let o=i;e.forEach(e=>{let{index:i,midX:s,midY:c,labelHeight:l}=e,u;a===`down`?(u=o,o+=l):(o-=l,u=o);let d=u,f=v({midX:s,midY:c,bandX:n,bandY:d});r[i]=T({side:t,markerX:n,markerY:d,labelY:u,connectorPath:f})})}let D={TL:[],TR:[],BL:[],BR:[]};return t.map((e,t)=>S({arc:e,index:t})).filter(({arc:t})=>X(e,t)&&Te(e,t)).forEach(e=>{D[C(e)].push(e)}),Object.keys(D).forEach(e=>{w(D[e],e)}),E({candidateList:D.TL,side:`left`,bandMarkerX:p,startY:d,direction:`down`}),E({candidateList:D.TR,side:`right`,bandMarkerX:m,startY:d,direction:`down`}),D.BL.length>1&&E({candidateList:D.BL,side:`left`,bandMarkerX:p,startY:f,direction:`up`}),D.BR.length>1&&E({candidateList:D.BR,side:`right`,bandMarkerX:m,startY:f,direction:`up`}),r}function Ee({state:e,arc:t,arcIndex:n,smallArcLayout:r,fontSize:i}){let a=x(e.config,`layout.labels`,{}),o=a.percentage??{},s=a.name??{},c=r?.labelX??u(t,!0,12).x,l=r?.labelY??h(t),d=r?.textAnchor??u(t,!0,12).anchor,{name:f}=J(e,t),p=we(e,t),m=String(f).split(/\n/g),_=f?m.map((t,n)=>j(`tspan`,{class:`vue-data-ui-datalabel-name`,x:n===0?void 0:c,dy:n===0?void 0:i*1.2,fill:O(s.color,A(e.config)),"font-size":i,"font-weight":s.bold?`700`:`400`},g(t+(n===m.length-1?` `:``)))).join(``):``,v=p?j(`tspan`,{class:`vue-data-ui-datalabel-value`,fill:O(o.color,A(e.config)),"font-size":i,"font-weight":o.bold?`700`:`400`},g(p)):``;return j(`text`,{"data-cy":`donut-label-inline-${n}`,class:`vue-data-ui-datalabel-inline`,x:c,y:l,"text-anchor":d},`${_}${v}`)}function De(e,t){let n=x(e.config,`layout.labels`,{}),r=n.dataLabels??{};if(!T(e.config,`dataLabels.show`,r.show??!0)||!r.show)return``;let i=b(r.fontSize??n.value?.fontSize??12,12);O(r.color??n.value?.color??A(e.config),A(e.config)),r.bold??n.value?.bold;let a=b(r.offset,16),o=Q(e,t),s=[];return t.forEach((t,n)=>{if(!X(e,t))return;let c=o[n];Y(e,t),c?s.push(Ee({state:e,arc:t,arcIndex:n,smallArcLayout:c,fontSize:b(r.smallArcClusterFontSize,i)})):s.push(Ee({state:e,arc:t,arcIndex:n,smallArcLayout:{labelX:u(t,!1,a+i/2).x,labelY:h(t,a,a),textAnchor:u(t).anchor},fontSize:i}))}),s.length?j(`g`,{"data-layer":`data-labels`},s.join(``)):``}function Oe(e,n,r=42){return t({initX:n.middlePoint.x,initY:n.middlePoint.y,offset:r,centerX:e.center.x,centerY:e.center.y})}function ke(e,t){return t.x<e.center.x?`end`:t.x>e.center.x?`start`:`middle`}function Ae(e,t,n,r){let i=x(e.config,`layout.labels`,{}),a=i.percentage??{},o=i.name??{},s=b(a.fontSize,i.dataLabels?.fontSize??12),c=b(o.fontSize,i.dataLabels?.fontSize??12),l=j(`tspan`,{class:`vue-data-ui-datalabel-value`,fill:O(a.color,A(e.config)),"font-size":s,"font-weight":a.bold?`700`:`400`},g(String(Y(e,t).replace(/\n/g,` / `)))),u=o.show?String(t.name??``).split(/\n/g).map((t,r)=>j(`tspan`,{class:`vue-data-ui-datalabel-name`,x:r===0?void 0:n,dy:r===0?void 0:c*1.2,fill:O(o.color,A(e.config)),"font-size":c,"font-weight":o.bold?`700`:`400`},g(t))).join(``):``;return r===`end`?`${u}${l}`:`${l}${u}`}function je(e,t,n){let r=x(e.config,`layout.labels`,{}),i=r.dataLabels??{},a=r.value??{},o=r.percentage??{},c=r.name??{};if(!T(e.config,`dataLabels.show`,i.show??!0)||!i.show)return``;let l=!!i.oneLine,u=b(a.fontSize,i.fontSize??12),d=b(c.fontSize,i.fontSize??12),f=O(o.color,A(e.config)),p=[];return t.forEach((t,r)=>{let i=n[r];if(!i||!X(e,t))return;let a=Oe(e,i,42),m=ke(e,a);l?p.push(j(`text`,{"data-cy":`polar-label-inline`,class:`vue-data-ui-datalabel-inline`,x:a.x,y:a.y,"text-anchor":m},Ae(e,t,a.x,m))):(p.push(j(`text`,{"data-cy":`polar-label-value`,class:`vue-data-ui-datalabel-value`,x:a.x,y:a.y,"font-size":u,"font-weight":o.bold?`700`:`400`,"text-anchor":m,fill:f},te({content:Y(e,t),x:a.x,fontSize:u,fill:f,textAnchor:m}))),c.show&&p.push(j(`text`,{"data-cy":`polar-label-name`,class:`vue-data-ui-datalabel-name`,x:a.x,y:a.y+d*1.2,"font-size":d,"font-weight":c.bold?`700`:`400`,"text-anchor":m,fill:O(c.color,A(e.config))},s({content:g(String(t.name??``)),fontSize:d,fill:O(c.color,A(e.config)),x:a.x}))))}),p.length?j(`g`,{"data-layer":`polar-data-labels`},p.join(``)):``}function Me(e,t,n=null){if(n?.connectorPath)return n.connectorPath;let r=x(e.config,`layout.labels.dataLabels`,{}),i=b(r.offset,16),a=b(r.markerFlatLength,12),o=Z(e),s=u(t).x,c=h(t,i,i)-4,l=s+(t.center.endX>t.cx?-a:a),d=`${s},${c}`,f=`${l},${c}`,p=`${t.center.endX},${t.center.endY}`;return o?`M${d} Q${f} ${p}`:`M${d} ${f} ${p}`}function Ne(e,t){let n=x(e.config,`layout.labels.dataLabels`,{});if(!T(e.config,`dataLabels.show`,n.show??!0)||!n.show)return``;let r=Q(e,t),i=[];return t.forEach((t,a)=>{if(!X(e,t))return;let o=r[a],s=Me(e,t,o);s&&(i.push(C(`path`,{"data-cy":`donut-marker-${a}`,d:s,stroke:t.color,"stroke-width":b(n.markerStrokeWidth,1),"stroke-linecap":`round`,"stroke-linejoin":`round`,fill:`none`})),i.push(C(`circle`,{"data-cy":`donut-label-marker-${a}`,cx:o?.markerX??u(t).x,cy:o?.markerY??h(t)-3.5,r:b(n.markerRadius,3),fill:t.color,stroke:I(e.config),"stroke-width":1})))}),i.length?j(`g`,{"data-layer":`label-markers`},i.join(``)):``}function Pe(e,n,r){let i=x(e.config,`layout.labels.dataLabels`,{});if(!T(e.config,`dataLabels.show`,i.show??!0)||!i.show)return``;let a=[];return n.forEach((n,o)=>{let s=r[o];if(!s?.middlePoint||!X(e,n))return;let c=t({initX:s.middlePoint.x,initY:s.middlePoint.y,offset:24,centerX:e.center.x,centerY:e.center.y});a.push(C(`path`,{"data-cy":`polar-marker-${o}`,d:`M ${c.x},${c.y} ${s.middlePoint.x},${s.middlePoint.y}`,stroke:n.color,"stroke-width":b(i.markerStrokeWidth,1),"stroke-linecap":`round`,"stroke-linejoin":`round`,fill:`none`})),a.push(C(`circle`,{"data-cy":`polar-label-marker-${o}`,cx:c.x,cy:c.y,r:b(i.markerRadius,3),fill:n.color,stroke:I(e.config),"stroke-width":1}))}),a.length?j(`g`,{"data-layer":`polar-label-markers`},a.join(``)):``}function $(e,t){return e==null||e===``?``:M(e,{"text-anchor":`middle`,...t})}function Fe(t,n,r){if(T(t.config,`type`,`classic`)!==`classic`||B(t.config)||!n)return``;let i=x(t.config,`layout.labels.hollow`,{}),a=i.total??{},o=i.average??{},s=[];if(a.show){let r=b(a.fontSize,14),i=!!o.show,c=t.center.y-(i?r:0)+b(a.offsetY,0),l=a.value??{},u=b(l.fontSize,r),f=d(l.formatter,n,e({p:l.prefix??``,v:n,s:l.suffix??``,r:b(l.rounding,0)}),{total:n});s.push($(a.text??``,{"data-cy":`hollow-total-name`,x:t.center.x,y:c,fill:O(a.color,A(t.config)),"font-size":r,"font-weight":a.bold?`700`:`400`})),s.push($(f,{"data-cy":`hollow-total-value`,x:t.center.x,y:t.center.y+r-(i?r:0)+b(l.offsetY,0),fill:O(l.color,O(a.color,A(t.config))),"font-size":u,"font-weight":l.bold?`700`:`400`}))}if(o.show){let i=b(o.fontSize,14),c=!!a.show,l=n/Math.max(1,r.length),u=o.value??{},f=b(u.fontSize,i),p=d(u.formatter,l,e({p:u.prefix??``,v:l,s:u.suffix??``,r:b(u.rounding,0)}),{average:l});s.push($(o.text??``,{"data-cy":`hollow-average-name`,x:t.center.x,y:t.center.y+(c?i:0)+b(o.offsetY,0),fill:O(o.color,A(t.config)),"font-size":i,"font-weight":o.bold?`700`:`400`})),s.push($(p,{"data-cy":`hollow-average-value`,x:t.center.x,y:t.center.y+(c?i:0)+i+b(u.offsetY,0),fill:O(u.color,O(o.color,A(t.config))),"font-size":f,"font-weight":u.bold?`700`:`400`}))}return s.filter(Boolean).length?j(`g`,{class:`vue-data-ui-donut-hollow-labels`,"data-layer":`hollow-labels`},s.join(``)):``}function Ie(t,n){let{config:r,center:i}=t,a=x(r,`layout.donut.labels.total`,x(r,`layout.labels.total`,{}));if(!a.show||!Number.isFinite(n)||n<=0)return``;let o=x(r,`layout.labels.dataLabels`,{}),s=b(a.fontSize,20),c=O(a.color,A(r)),l=d(a.formatter,n,e({p:o.prefix??``,v:n,s:o.suffix??``,r:b(a.rounding,0)}),{total:n});return M(l,{"data-cy":`donut-total`,x:i.x,y:i.y+s/3,"font-size":s,"font-weight":a.bold?`700`:`400`,"text-anchor":`middle`,fill:c})}function Le(e,t){let n=R(L(e));return n?b(t.value,0)/n*100:0}function Re(t,n){let r=x(t.config,`legend`,{}),i=x(t.config,`layout.labels`,{}),a=i.dataLabels??{},o=i.value??{},s=e({p:a.prefix??``,v:n.value,s:a.suffix??``,r:b(r.roundingValue,o.rounding??0)});return d(o.formatter,n.value,s,{datapoint:n,serie:n})}function ze(t,n){let r=x(t.config,`legend`,{}),i=x(t.config,`layout.labels`,{}).percentage??{},a=Le(t,n),o=e({v:a,s:`%`,r:b(r.roundingPercentage,i.rounding??0)});return d(i.formatter,a,o,{datapoint:n,serie:n})}function Be(e,t){let n=x(e.config,`legend`,{}),r=[],i=n.showPercentage?ze(e,t):``,a=n.showValue?Re(e,t):``,o=i&&n.usePercentageParens?`(${i})`:i,s=a&&n.useValueParens?`(${a})`:a;return n.showValueFirst?(s&&r.push(s),o&&r.push(o)):(o&&r.push(o),s&&r.push(s)),`${t.name}${r.length?`: ${r.join(` `)}`:``}`}function Ve(e,t){let n=x(e.config,`legend`,{});if(!n.show||!t.length)return``;let r=z(e,t),i=O(n.color,A(e.config)),a=n.position||`bottom`,o=Math.max(r.markerSize,r.fontSize),s=a===`top`?r.padding+o:e.height-r.height+r.padding+o,c=[];return r.rows.forEach((t,a)=>{let l=r.padding+(e.width-r.padding*2)/2-t.width/2,u=s+a*(o+r.rowGap);t.items.forEach(({serie:e,label:t,itemWidth:a})=>{c.push(C(`circle`,{cx:l+r.markerSize/2,cy:u,r:r.markerSize/2,fill:e.color,opacity:e.opacity??1})),c.push(M(t,{x:l+r.markerSize+r.labelGap,y:u+2,"font-size":r.fontSize,"font-weight":n.bold?`700`:`400`,"dominant-baseline":`middle`,fill:i,opacity:e.opacity??1})),l+=a+r.itemGap})}),j(`g`,{"data-layer":`legend`,"data-cy":`donut-div-legend`},c.join(``))}function He(e){return j(`g`,{"data-layer":`no-data`},[C(`circle`,{cx:e.center.x,cy:e.center.y,r:Math.max(1,e.radius),fill:O(x(e.config,`layout.donut.emptyFill`,`#E1E5E8`),`#E1E5E8`),opacity:.4})].join(``))}function Ue(e,t){let n=e.additionalSvgContent;return typeof n==`function`?n({width:e.width,height:e.height,drawingArea:e.drawingArea,center:e.center,radius:e.radius,thickness:e.thickness,innerRadius:e.innerRadius,config:e.config,series:t.map(e=>({...e}))})??``:n??``}function We(e,t,n){let r=`${T(e.config,`title.text`,`Donut chart`)||e.svgTitle||`Donut chart`}. ${t.length} series. Total ${l(n)}.`;return j(`title`,{},g(r))}async function Ge(e){let t=e.config,n=b(e.width,x(t,`width`,512)),r=b(e.height,x(t,`height`,512)),i=L(e),a=R(i),o=me({...e,width:n,height:r},i),s=he(o,i),c=ge(o,i),l=T(t,`type`,`classic`),u=a>0&&s.some(e=>b(e.proportion,0)>0);return`
|
|
2
2
|
<svg
|
|
3
3
|
xmlns="${_}"
|
|
4
4
|
width="100%"
|