vue-data-ui 3.27.1-beta.0 → 3.27.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (189) hide show
  1. package/dist/{Arrow-CJeSufxg.js → Arrow-C2W0uGrq.js} +1 -1
  2. package/dist/{BaseDraggableDialog-T1gEsQid.js → BaseDraggableDialog-D_tuHEjO.js} +1 -1
  3. package/dist/{BaseIcon-Cz30ODFA.js → BaseIcon-DdIyewwY.js} +1 -1
  4. package/dist/{BaseLegendToggle-Dn_tNvn4.js → BaseLegendToggle-Bq5FjyuI.js} +1 -1
  5. package/dist/{BaseZoomControls-xq3tWD3j.js → BaseZoomControls-DoYifY2y.js} +1 -1
  6. package/dist/{ColorPicker-CUjEw53A.js → ColorPicker-MLwiwxl5.js} +1 -1
  7. package/dist/{DataTable-DSUA5M9p.js → DataTable-WNecJMcY.js} +1 -1
  8. package/dist/{HillActions-DdvXld3a.js → HillActions-CHg1AQ3p.js} +1 -1
  9. package/dist/{Legend-DokTll4u.js → Legend-D8YoT1RJ.js} +1 -1
  10. package/dist/{NonSvgPenAndPaper-BLzQuIm6.js → NonSvgPenAndPaper-CqtJpZKh.js} +1 -1
  11. package/dist/{PackageVersion-D6pKL176.js → PackageVersion-CdkxOy58.js} +1 -1
  12. package/dist/{PenAndPaper-DvJJaeU2.js → PenAndPaper-IMw576MC.js} +1 -1
  13. package/dist/{Shape-tkp65OcG.js → Shape-Bp9YNtPc.js} +1 -1
  14. package/dist/SlicerPreview-CNUciSbY.js +1 -0
  15. package/dist/{SparkTooltip-BlJLvizH.js → SparkTooltip-C5JMcBXT.js} +1 -1
  16. package/dist/{Title-BRAjxtjG.js → Title-BGYFqulv.js} +1 -1
  17. package/dist/{Tooltip-BUXB0i6z.js → Tooltip-Cus2-XNQ.js} +1 -1
  18. package/dist/{UserOptions-D65t74CM.js → UserOptions-DTxMeZv3.js} +1 -1
  19. package/dist/{chartImage-NwZO-elv.js → chartImage-CIvU_04o.js} +1 -1
  20. package/dist/components/arrow.js +1 -1
  21. package/dist/components/vue-ui-3d-bar.js +1 -1
  22. package/dist/components/vue-ui-accordion.js +1 -1
  23. package/dist/components/vue-ui-age-pyramid.js +1 -1
  24. package/dist/components/vue-ui-annotator.js +1 -1
  25. package/dist/components/vue-ui-bullet.js +1 -1
  26. package/dist/components/vue-ui-bump.js +1 -1
  27. package/dist/components/vue-ui-candlestick.js +1 -1
  28. package/dist/components/vue-ui-carousel-table.js +1 -1
  29. package/dist/components/vue-ui-chestnut.js +1 -1
  30. package/dist/components/vue-ui-chord.js +1 -1
  31. package/dist/components/vue-ui-circle-pack.js +1 -1
  32. package/dist/components/vue-ui-cursor.js +1 -1
  33. package/dist/components/vue-ui-dag.js +1 -1
  34. package/dist/components/vue-ui-dashboard.js +1 -1
  35. package/dist/components/vue-ui-digits.js +1 -1
  36. package/dist/components/vue-ui-donut-evolution.js +1 -1
  37. package/dist/components/vue-ui-donut.js +1 -1
  38. package/dist/components/vue-ui-dumbbell.js +1 -1
  39. package/dist/components/vue-ui-flow.js +1 -1
  40. package/dist/components/vue-ui-funnel.js +1 -1
  41. package/dist/components/vue-ui-galaxy.js +1 -1
  42. package/dist/components/vue-ui-gauge.js +1 -1
  43. package/dist/components/vue-ui-geo.js +1 -1
  44. package/dist/components/vue-ui-gizmo.js +1 -1
  45. package/dist/components/vue-ui-heatmap.js +1 -1
  46. package/dist/components/vue-ui-hill.js +1 -1
  47. package/dist/components/vue-ui-history-plot.js +1 -1
  48. package/dist/components/vue-ui-horizontal-bar.js +1 -1
  49. package/dist/components/vue-ui-icon.js +1 -1
  50. package/dist/components/vue-ui-kpi.js +1 -1
  51. package/dist/components/vue-ui-label.js +1 -1
  52. package/dist/components/vue-ui-mini-loader.js +1 -1
  53. package/dist/components/vue-ui-molecule.js +1 -1
  54. package/dist/components/vue-ui-mood-radar.js +1 -1
  55. package/dist/components/vue-ui-nested-donuts.js +1 -1
  56. package/dist/components/vue-ui-onion.js +1 -1
  57. package/dist/components/vue-ui-parallel-coordinate-plot.js +1 -1
  58. package/dist/components/vue-ui-quadrant.js +1 -1
  59. package/dist/components/vue-ui-quick-chart.js +1 -1
  60. package/dist/components/vue-ui-radar.js +1 -1
  61. package/dist/components/vue-ui-rating.js +1 -1
  62. package/dist/components/vue-ui-relation-circle.js +1 -1
  63. package/dist/components/vue-ui-ridgeline.js +1 -1
  64. package/dist/components/vue-ui-rings.js +1 -1
  65. package/dist/components/vue-ui-scatter.js +1 -1
  66. package/dist/components/vue-ui-skeleton.js +1 -1
  67. package/dist/components/vue-ui-smiley.js +1 -1
  68. package/dist/components/vue-ui-spark-trend.js +1 -1
  69. package/dist/components/vue-ui-sparkbar.js +1 -1
  70. package/dist/components/vue-ui-sparkgauge.js +1 -1
  71. package/dist/components/vue-ui-sparkhistogram.js +1 -1
  72. package/dist/components/vue-ui-sparkline.js +1 -1
  73. package/dist/components/vue-ui-sparkstackbar.js +1 -1
  74. package/dist/components/vue-ui-stackbar.js +1 -1
  75. package/dist/components/vue-ui-stackline.js +1 -1
  76. package/dist/components/vue-ui-strip-plot.js +1 -1
  77. package/dist/components/vue-ui-table-heatmap.js +1 -1
  78. package/dist/components/vue-ui-table-sparkline.js +1 -1
  79. package/dist/components/vue-ui-table.js +1 -1
  80. package/dist/components/vue-ui-thermometer.js +1 -1
  81. package/dist/components/vue-ui-timer.js +1 -1
  82. package/dist/components/vue-ui-tiremarks.js +1 -1
  83. package/dist/components/vue-ui-treemap.js +1 -1
  84. package/dist/components/vue-ui-vertical-bar.js +1 -1
  85. package/dist/components/vue-ui-waffle.js +1 -1
  86. package/dist/components/vue-ui-wheel.js +1 -1
  87. package/dist/components/vue-ui-word-cloud.js +1 -1
  88. package/dist/components/vue-ui-world.js +1 -1
  89. package/dist/components/vue-ui-xy-canvas.js +1 -1
  90. package/dist/components/vue-ui-xy.js +1 -1
  91. package/dist/{dom-to-png-Cp3WLHmJ.js → dom-to-png-D8t3Bm7s.js} +1 -1
  92. package/dist/{exposedLib-CMTeSmyW.js → exposedLib-DHtyEc_G.js} +1 -1
  93. package/dist/{img-8sM3sVWU.js → img-DiT4ivZ5.js} +1 -1
  94. package/dist/{labelUtils-Djp5nJtN.js → labelUtils-CG3uVXoZ.js} +1 -1
  95. package/dist/{lib-zDxoqrgo.js → lib-CV_IANZ6.js} +2 -2
  96. package/dist/package-DE5cU1Rg.js +1 -0
  97. package/dist/{pdf-Dlv_ks7R.js → pdf-BQSB1V3H.js} +1 -1
  98. package/dist/{render-common-DOYi0f4Z.js → render-common-BdZ5aRyn.js} +1 -1
  99. package/dist/{resolveChartConfig-BSo1Oe9n.js → resolveChartConfig-DZg-korK.js} +1 -1
  100. package/dist/ssr/vue-ui-donut.js +1 -1
  101. package/dist/ssr/vue-ui-xy.js +1 -1
  102. package/dist/ssr.js +1 -1
  103. package/dist/style.css +1 -1
  104. package/dist/{useNestedProp-CT9phgWx.js → useNestedProp-CB186vF2.js} +1 -1
  105. package/dist/{useObjectBindings-DM3xDKV3.js → useObjectBindings-Dse7YyAf.js} +1 -1
  106. package/dist/{usePrinter-CnyKPIFM.js → usePrinter-hLW3cv4N.js} +1 -1
  107. package/dist/utils.js +1 -1
  108. package/dist/vue-data-ui-DyYgLIZN.js +1 -0
  109. package/dist/vue-data-ui.js +1 -1
  110. package/dist/{vue-ui-3d-bar-DiaiNy-k.js → vue-ui-3d-bar-BZAoyWkc.js} +1 -1
  111. package/dist/{vue-ui-accordion-Dy5OVFKr.js → vue-ui-accordion-BNvevckx.js} +1 -1
  112. package/dist/{vue-ui-age-pyramid-OeUr1yxi.js → vue-ui-age-pyramid-DkA6vpU3.js} +1 -1
  113. package/dist/{vue-ui-annotator-DA_xAFql.js → vue-ui-annotator-DuQME4Hh.js} +1 -1
  114. package/dist/{vue-ui-bullet-B9lcCTVb.js → vue-ui-bullet-BVs8JX8S.js} +1 -1
  115. package/dist/{vue-ui-bump-DYajIrva.js → vue-ui-bump-DYdm3EvF.js} +1 -1
  116. package/dist/{vue-ui-candlestick-CdAZuNxo.js → vue-ui-candlestick-DZgxl4mW.js} +1 -1
  117. package/dist/{vue-ui-carousel-table-ihGH0LDH.js → vue-ui-carousel-table-BB7DsTUt.js} +1 -1
  118. package/dist/{vue-ui-chestnut-B2aNXFNO.js → vue-ui-chestnut-Bo1h5rBt.js} +1 -1
  119. package/dist/{vue-ui-chord-fAckHfOW.js → vue-ui-chord-B6_veyvO.js} +1 -1
  120. package/dist/{vue-ui-circle-pack-BWHVImkS.js → vue-ui-circle-pack-Bm7e2YNh.js} +1 -1
  121. package/dist/{vue-ui-cursor-DdXKXmhr.js → vue-ui-cursor-TidZDuSh.js} +1 -1
  122. package/dist/{vue-ui-dag-a0fNoIcJ.js → vue-ui-dag-BiN_AnLo.js} +1 -1
  123. package/dist/{vue-ui-dashboard-DkdYMB7n.js → vue-ui-dashboard-zepAVN_W.js} +1 -1
  124. package/dist/{vue-ui-digits-CL9SuIEI.js → vue-ui-digits-CXKKmfGj.js} +1 -1
  125. package/dist/{vue-ui-donut-BaEodt-3.js → vue-ui-donut-CKkBtyPK.js} +1 -1
  126. package/dist/{vue-ui-donut-DaYxdQmP.js → vue-ui-donut-DLDUpjDU.js} +2 -2
  127. package/dist/{vue-ui-donut-evolution-T8cRXKRQ.js → vue-ui-donut-evolution-BxMTdE5G.js} +1 -1
  128. package/dist/{vue-ui-dumbbell-B6HJxEZp.js → vue-ui-dumbbell-C8rNwdz0.js} +1 -1
  129. package/dist/{vue-ui-flow-BlTCVFr3.js → vue-ui-flow-Dru76A2O.js} +1 -1
  130. package/dist/{vue-ui-funnel-WgLFJadZ.js → vue-ui-funnel-D_u1h5S9.js} +1 -1
  131. package/dist/{vue-ui-galaxy-B3nuI6E8.js → vue-ui-galaxy-sBEH18Xj.js} +1 -1
  132. package/dist/{vue-ui-gauge-BwTP65O4.js → vue-ui-gauge-Do3RN8ne.js} +1 -1
  133. package/dist/{vue-ui-geo-CX3yH18H.js → vue-ui-geo-DDbtx_iJ.js} +1 -1
  134. package/dist/{vue-ui-gizmo-CNHcBsku.js → vue-ui-gizmo-eic6xLjB.js} +1 -1
  135. package/dist/{vue-ui-heatmap-CTdeoar7.js → vue-ui-heatmap-DlmJRsM8.js} +1 -1
  136. package/dist/{vue-ui-hill-DR5k8GWZ.js → vue-ui-hill-C5oiuIXh.js} +1 -1
  137. package/dist/{vue-ui-history-plot-C-9uH-Uj.js → vue-ui-history-plot-BJjnkWcT.js} +1 -1
  138. package/dist/{vue-ui-horizontal-bar-qqF7pL7U.js → vue-ui-horizontal-bar-BRDBJEl1.js} +1 -1
  139. package/dist/{vue-ui-kpi-DVcLXGqG.js → vue-ui-kpi-C-eed3jO.js} +1 -1
  140. package/dist/{vue-ui-label-D1Aog-zO.js → vue-ui-label-B4pkXBxc.js} +1 -1
  141. package/dist/{vue-ui-mini-loader-CX0Dx9tT.js → vue-ui-mini-loader-CElmv_iF.js} +1 -1
  142. package/dist/{vue-ui-molecule-B13qVX71.js → vue-ui-molecule-BeyQWZU9.js} +1 -1
  143. package/dist/{vue-ui-mood-radar-C1BtB8lg.js → vue-ui-mood-radar-Bh0kHfiZ.js} +1 -1
  144. package/dist/{vue-ui-nested-donuts-B90yrlJG.js → vue-ui-nested-donuts-FlnJfDaF.js} +1 -1
  145. package/dist/{vue-ui-onion-UMVO2DE_.js → vue-ui-onion-BjhSpjtW.js} +1 -1
  146. package/dist/vue-ui-parallel-coordinate-plot-CHV6XDti.js +9 -0
  147. package/dist/{vue-ui-quadrant-CPG6yAiu.js → vue-ui-quadrant-BaKSTJDv.js} +1 -1
  148. package/dist/{vue-ui-quick-chart-BTPb-Iz8.js → vue-ui-quick-chart-Nc2mVlle.js} +1 -1
  149. package/dist/{vue-ui-radar-Hd-pE9ih.js → vue-ui-radar-BzUfkLlC.js} +1 -1
  150. package/dist/{vue-ui-rating-C_YxQYa_.js → vue-ui-rating-BwWXvbAg.js} +1 -1
  151. package/dist/{vue-ui-relation-circle-CHYG7ZJl.js → vue-ui-relation-circle-nAZEg-BL.js} +1 -1
  152. package/dist/{vue-ui-ridgeline-DS1Gvljt.js → vue-ui-ridgeline-DxLZg1E2.js} +1 -1
  153. package/dist/{vue-ui-rings-B-Hb13Uu.js → vue-ui-rings-BOti0NGb.js} +1 -1
  154. package/dist/{vue-ui-scatter-BTgvOmuo.js → vue-ui-scatter-CCNMggyo.js} +1 -1
  155. package/dist/{vue-ui-skeleton-B-Acw3CC.js → vue-ui-skeleton-DI7pcimU.js} +1 -1
  156. package/dist/{vue-ui-smiley-Ciwqt6ek.js → vue-ui-smiley-D70sJZWl.js} +1 -1
  157. package/dist/{vue-ui-spark-trend-CYqy6c0S.js → vue-ui-spark-trend-BVtfEalS.js} +1 -1
  158. package/dist/{vue-ui-sparkbar-CTXIgjmP.js → vue-ui-sparkbar-CdsLI7Ke.js} +1 -1
  159. package/dist/{vue-ui-sparkgauge-CObOL6s2.js → vue-ui-sparkgauge-wmj5Wnnp.js} +1 -1
  160. package/dist/{vue-ui-sparkhistogram-ClFyDez-.js → vue-ui-sparkhistogram-D8S_P_P4.js} +1 -1
  161. package/dist/{vue-ui-sparkline-DP_nYlW8.js → vue-ui-sparkline-BjsJnS_9.js} +1 -1
  162. package/dist/{vue-ui-sparkstackbar-B2f0ePMg.js → vue-ui-sparkstackbar-ZN8LXzoV.js} +1 -1
  163. package/dist/{vue-ui-stackbar-nMWHZ-f0.js → vue-ui-stackbar-Dx_EN3pT.js} +1 -1
  164. package/dist/{vue-ui-stackline-B95y6Zc5.js → vue-ui-stackline-DW-oxJvA.js} +1 -1
  165. package/dist/{vue-ui-strip-plot-gFNC4r-X.js → vue-ui-strip-plot-D7kjJ3Qh.js} +1 -1
  166. package/dist/{vue-ui-table-Br2JgD_L.js → vue-ui-table-CaFVLHxE.js} +1 -1
  167. package/dist/{vue-ui-table-heatmap-Btu2ejF4.js → vue-ui-table-heatmap-Ctf7Rhqo.js} +1 -1
  168. package/dist/vue-ui-table-sparkline-C0I0cXBS.js +1 -0
  169. package/dist/{vue-ui-thermometer-C6u1eLfo.js → vue-ui-thermometer-B6og15Al.js} +1 -1
  170. package/dist/{vue-ui-timer-DLgsfB1U.js → vue-ui-timer-DgXvO2Q7.js} +2 -2
  171. package/dist/{vue-ui-tiremarks-8B9uE1Bx.js → vue-ui-tiremarks-Dh6fZ454.js} +1 -1
  172. package/dist/{vue-ui-treemap-C4Mot-Os.js → vue-ui-treemap-7JuvN6P_.js} +1 -1
  173. package/dist/{vue-ui-waffle-BwcwNpf7.js → vue-ui-waffle-BqvGzfse.js} +1 -1
  174. package/dist/{vue-ui-wheel-B3OGCXg7.js → vue-ui-wheel-SdwJqKA7.js} +1 -1
  175. package/dist/{vue-ui-word-cloud-BPIyMBXq.js → vue-ui-word-cloud-1WVV_k12.js} +1 -1
  176. package/dist/{vue-ui-world-Cp0DeauH.js → vue-ui-world-DjMy_utm.js} +1 -1
  177. package/dist/{vue-ui-xy-BOE1jvUS.js → vue-ui-xy-DaozHMfg.js} +1 -1
  178. package/dist/{vue-ui-xy-canvas-CaxxiKSa.js → vue-ui-xy-canvas-CegvS9RR.js} +1 -1
  179. package/dist/{vue-ui-xy-DSyKSn4L.js → vue-ui-xy-rGHSI1am.js} +3 -3
  180. package/dist/vue_ui_donut_evolution-CVoh3twl.js +1 -0
  181. package/dist/vue_ui_quick_chart-BRfcRW6Z.js +1 -0
  182. package/package.json +1 -1
  183. package/dist/SlicerPreview-GFRs2EWB.js +0 -1
  184. package/dist/package-DIR2F6AE.js +0 -1
  185. package/dist/vue-data-ui-BG41UScx.js +0 -1
  186. package/dist/vue-ui-parallel-coordinate-plot-C0ofFivm.js +0 -9
  187. package/dist/vue-ui-table-sparkline-B9mYHAxp.js +0 -1
  188. package/dist/vue_ui_donut_evolution-nzVwNQYv.js +0 -1
  189. package/dist/vue_ui_quick_chart-Da1GwklM.js +0 -1
@@ -1,4 +1,4 @@
1
- import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{n as t,t as n}from"./annotationSlots-BRR85CqJ.js";import{n as r,t as i}from"./userOptionsSlots-DYuo-E5m.js";import{Pt as a,S as o,St as s,X as c,Y as l,at as u,in as d,rt as f,t as p,zt as m}from"./lib-zDxoqrgo.js";import{n as h,t as g}from"./useHints-BH9r_0Vd.js";import{t as ee}from"./useConfig-CKdzPrcf.js";import{t as te}from"./usePrinter-CnyKPIFM.js";import{n as ne,t as re}from"./BaseScanner-8NdoBs7B.js";import{t as ie}from"./useChartExport-DtPNpc9M.js";import{t as ae}from"./img-8sM3sVWU.js";import{n as oe}from"./Title-BRAjxtjG.js";import{t as se}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{l as ce,t as le}from"./useResponsive-D2CPcpda.js";import{t as ue}from"./A11yDataTable-DWNlWXzs.js";import{t as de}from"./resolveChartConfig-BSo1Oe9n.js";import{t as fe}from"./useUserOptionState-CXlFnwPv.js";import{t as pe}from"./useChartAccessibility-DOMuYJfm.js";import{t as me}from"./usePanZoom-BdjP5Suc.js";import{t as he}from"./BaseZoomControls-xq3tWD3j.js";import{t as ge}from"./vue_ui_dag-1b_dLSym.js";import{Fragment as _e,Teleport as ve,Transition as ye,computed as _,createBlock as v,createCommentVNode as y,createElementBlock as b,createElementVNode as x,createSlots as be,createTextVNode as xe,createVNode as Se,defineAsyncComponent as Ce,guardReactiveProps as we,mergeProps as Te,nextTick as Ee,normalizeClass as De,normalizeProps as Oe,normalizeStyle as ke,onBeforeUnmount as Ae,onMounted as je,openBlock as S,ref as C,renderList as Me,renderSlot as w,toDisplayString as Ne,toRefs as Pe,unref as T,watch as Fe,watchEffect as Ie,withCtx as Le,withModifiers as Re}from"vue";var ze=`\0`,Be=`\0`,Ve=``,E=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=O(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]):O(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]):O(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]):O(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],D(this._preds[t],e),D(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 D(e,t){--e[t]||delete e[t]}function O(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 O(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 Ye(e,t){if(e.nodeCount()<=1)return[];let n=j(e,t||Je);return k(n.graph,n.buckets,n.zeroIndex).flatMap(t=>e.outEdges(t.v,t.w))}function k(e,t,n){let r=[],i=t[t.length-1],a=t[0],o;for(;e.nodeCount();){for(;o=a.dequeue();)A(e,t,n,o);for(;o=i.dequeue();)A(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(A(e,t,n,o,!0));break}}}return r}function A(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,M(t,n,s)}),e.outEdges(r.v).forEach(r=>{let i=e.edge(r),a=e.node(r.w);a.in-=i,M(t,n,a)}),e.removeNode(r.v),a}function j(e,t){let n=new E,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=Xe(i+r+3).map(()=>new Ge),o=r+1;return n.nodes().forEach(e=>{M(a,o,n.node(e))}),{graph:n,buckets:a,zeroIndex:o}}function M(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 Xe(e){let t=[];for(let n=0;n<e;n++)t.push(n);return t}function N(e,t,n,r){let i=r;for(;e.hasNode(i);)i=V(r);return n.dummy=t,e.setNode(i,n),i}function Ze(e){let t=new E().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 P(e){let t=new E({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 F(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 U(e.nodes(),t)}function Qe(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 U(e.nodes(),t)}function I(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 L(e){let t=H(rt(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 $e(e){let t=e.nodes().map(t=>{let n=e.node(t).rank;return n===void 0?Number.MAX_VALUE:n}),n=z(Math.min,t);e.nodes().forEach(t=>{let r=e.node(t);Object.hasOwn(r,`rank`)&&(r.rank-=n)})}function et(e){let t=e.nodes().map(t=>e.node(t).rank).filter(e=>e!==void 0),n=z(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 tt(e,t,n,r){let i={width:0,height:0};return arguments.length>=4&&(i.rank=n,i.order=r),N(e,`border`,i,t)}var nt=65535;function R(e,t=nt){let n=[];for(let r=0;r<e.length;r+=t){let i=e.slice(r,r+t);n.push(i)}return n}function z(e,t){if(t.length>nt){let n=R(t);return e.apply(null,n.map(t=>e.apply(null,t)))}return e.apply(null,t)}function rt(e){let t=e.nodes().map(t=>{let n=e.node(t).rank;return n===void 0?Number.MIN_VALUE:n});return z(Math.max,t)}function it(e,t){let n={lhs:[],rhs:[]};return e.forEach(e=>{t(e)?n.lhs.push(e):n.rhs.push(e)}),n}function B(e,t){let n=Date.now();try{return t()}finally{console.log(e+` time: `+(Date.now()-n)+`ms`)}}function at(e,t){return t()}var ot=0;function V(e){let t=++ot;return e+String(t)}function H(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 st(e,t){let n={};for(let r of t)e[r]!==void 0&&(n[r]=e[r]);return n}function ct(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 U(e,t){return e.reduce((e,n,r)=>(e[n]=t[r],e),{})}var W={addBorderNode:tt,addDummyNode:N,applyWithChunking:z,asNonCompoundGraph:P,buildLayerMatrix:L,intersectRect:I,mapValues:ct,maxRank:rt,normalizeRanks:$e,notime:at,partition:it,pick:st,predecessorWeights:Qe,range:H,removeEmptyRanks:et,simplify:Ze,successorWeights:F,time:B,uniqueId:V,zipObject:U};function G(e){(e.graph().acyclicer===`greedy`?Ye(e,t(e)):ut(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,V(`rev`))});function t(e){return t=>e.edge(t).weight}}function lt(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 ut(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 dt(e){e.graph().dummyChains=[],e.edges().forEach(t=>K(e,t))}function K(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=N(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 ft(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 pt(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=z(Math.min,a);return o===1/0&&(o=0),r&&(r.rank=o),o}(e.sources()||[]).forEach(t)}function mt(e,t){return e.node(t.w).rank-e.node(t.v).rank-e.edge(t).minlen}function ht(e){gt(e);let t=new E;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=_t(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;vt(e,i,s,o),t.setEdge(a.v,a.w,{}),i.add(c)}return t}function gt(e){e.nodes().forEach(t=>{let n=e.node(t)||{};Object.prototype.hasOwnProperty.call(n,`rank`)||(n.rank=0,e.setNode(t,n))})}function _t(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=mt(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 vt(e,t,n,r){r&&e.nodes().forEach(n=>{if(!t.has(n)){let t=e.node(n);t.rank+=r}})}function yt(e){let t=Ze(e);return pt(t),t.nodes().forEach(n=>{let r=t.node(n),i=e.node(n)||{};i.rank=r.rank,e.setNode(n,i)}),e}function bt(e,t){}function xt(e,t){}function St(e,t,n){return 0}function Ct(e){return null}function wt(e,t){return null}yt.initLowLimValues=bt,yt.initCutValues=xt,yt.calcCutValue=St,yt.leaveEdge=Ct,yt.enterEdge=wt;var Tt=pt;function Et(e){let t=e.graph().ranker;if(t instanceof Function)return t(e);switch(e.graph().ranker){case`network-simplex`:kt(e);break;case`tight-tree`:Ot(e);break;case`longest-path`:Dt(e);break;case`none`:break;default:kt(e)}}var Dt=Tt;function Ot(e){Tt(e),ht(e)}function kt(e){yt(e)}function At(e){let t=jt(e);e.graph().dummyChains.forEach(n=>{let r=e.node(n),i=r.edgeObj,a=q(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 q(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 jt(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 Mt(e){let t=W.addDummyNode(e,`root`,{},`_root`),n=Nt(e),r=Object.values(n),i=W.applyWithChunking(Math.max,r)-1,a=2*i+1;e.graph().nestingRoot=t,e.edges().forEach(t=>{e.edge(t).minlen*=a});let o=Pt(e)+1;e.children().forEach(r=>{J(e,t,a,o,i,n,r)}),e.graph().nodeRankFactor=a}function J(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=W.addBorderNode(e,`_bt`),l=W.addBorderNode(e,`_bb`),u=e.node(o);e.setParent(c,o),u.borderTop=c,e.setParent(l,o),u.borderBottom=l,s.forEach(s=>{J(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 Nt(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 Pt(e){return e.edges().reduce((t,n)=>t+e.edge(n).weight,0)}function Y(e){let t=e.graph();e.removeNode(t.nestingRoot),delete t.nestingRoot,e.edges().forEach(t=>{e.edge(t).nestingEdge&&e.removeEdge(t)})}function Ft(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)It(e,`borderLeft`,`_bl`,n,i,t),It(e,`borderRight`,`_br`,n,i,t)}}e.children().forEach(t)}function It(e,t,n,r,i,a){let o={width:0,height:0,rank:a,borderType:t},s=i[t][a-1],c=N(e,`border`,o,n);i[t][a]=c,e.setParent(c,r),s&&e.setEdge(s,c,{weight:1})}function Lt(e){let t=e.graph().rankdir.toLowerCase();(t===`lr`||t===`rl`)&&zt(e)}function Rt(e){let t=e.graph().rankdir.toLowerCase();(t===`bt`||t===`rl`)&&Vt(e),(t===`lr`||t===`rl`)&&(Ut(e),zt(e))}function zt(e){e.nodes().forEach(t=>{Bt(e.node(t))}),e.edges().forEach(t=>{Bt(e.edge(t))})}function Bt(e){let t=e.width;e.width=e.height,e.height=t}function Vt(e){e.nodes().forEach(t=>{Ht(e.node(t))}),e.edges().forEach(t=>{let n=e.edge(t);n.points.forEach(Ht),Object.hasOwn(n,`y`)&&Ht(n)})}function Ht(e){e.y=-e.y}function Ut(e){e.nodes().forEach(t=>{X(e.node(t))}),e.edges().forEach(t=>{let n=e.edge(t);n.points.forEach(X),Object.hasOwn(n,`x`)&&X(n)})}function X(e){let t=e.x;e.x=e.y,e.y=t}var Wt={adjust:Lt,undo:Rt};function Gt(e){let t={},n=e.nodes().filter(t=>e.children(t).length===0),r=n.map(t=>e.node(t).rank),i=H(z(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 Kt(e,t){let n=0;for(let r=1;r<t.length;++r)n+=qt(e,t[r-1],t[r]);return n}function qt(e,t,n){let r=U(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 Jt(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 Yt(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))}),Xt(Object.values(n).filter(e=>!e.indegree))}function Xt(e){let t=[];function n(e){return t=>{t.merged||(t.barycenter===void 0||e.barycenter===void 0||t.barycenter>=e.barycenter)&&Zt(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=>st(e,[`vs`,`i`,`barycenter`,`weight`]))}function Zt(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=it(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(Q(!!t)),c=Qt(a,i,c),r.forEach(e=>{c+=e.vs.length,a.push(e.vs),o+=e.barycenter*e.weight,s+=e.weight,c=Qt(a,i,c)});let l={vs:a.flat(!0)};return s&&(l.barycenter=o/s,l.weight=s),l}function Qt(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 Q(e){return(t,n)=>t.barycenter<n.barycenter?-1:t.barycenter>n.barycenter?1:e?n.i-t.i:t.i-n.i}function $t(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=Jt(e,i);l.forEach(t=>{if(e.children(t.v).length){let i=$t(e,t.v,n,r);c[t.v]=i,Object.hasOwn(i,`barycenter`)&&tn(t,i)}});let u=Yt(l,n);en(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 en(e,t){e.forEach(e=>{e.vs=e.vs.flatMap(e=>t[e]?t[e].vs:e)})}function tn(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 nn(e,t,n,r){r||=e.nodes();let i=rn(e),a=new E({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 rn(e){let t;for(;e.hasNode(t=V(`_root`)););return t}function an(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 on(e,t={}){if(typeof t.customOrder==`function`){t.customOrder(e,on);return}let n=rt(e),r=sn(e,H(1,n+1),`inEdges`),i=sn(e,H(n-1,-1,-1),`outEdges`),a=Gt(e);if(ln(e,a),t.disableOptimalOrderHeuristic)return;let o=1/0,s,c=t.constraints||[];for(let t=0,n=0;n<4;++t,++n){cn(t%2==0?r:i,t%4>=2,c),a=L(e);let l=Kt(e,a);l<o?(o=l,n=0,s=structuredClone(a)):l===o&&(s=structuredClone(a))}ln(e,s)}function sn(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=>nn(e,t,n,r.get(t)||[]))}function cn(e,t,n){let r=new E;e.forEach(e=>{n.forEach(e=>r.setEdge(e.left,e.right));let i=e.graph().root,a=$t(e,i,r,t);a.vs.forEach((t,n)=>{e.node(t).order=n}),an(e,r,a.vs)})}function ln(e,t){Object.values(t).forEach(t=>{t.forEach((t,n)=>{e.node(t).order=n})})}function un(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=fn(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)&&pn(n,r,t)})}),a=c+1,i=u)}),r}return t.length&&t.reduce(r),n}function dn(e,t){let n={};function r(t,r,i,a,o){let s;H(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)&&pn(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 fn(e,t){if(e.node(t).dummy)return e.predecessors(t).find(t=>e.node(t).dummy)}function pn(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 $(e,t,n){if(t>n){let e=t;t=n,n=e}return!!e[t]&&Object.hasOwn(e[t],n)}function mn(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]&&!$(n,e,r)&&(a[r]=e,a[e]=i[e]=i[r],t=o[r])}}})}),{root:i,align:a}}function hn(e,t,n,r,i){let a={},o=gn(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 gn(e,t,n,r){let i=new e.constructor,a=e.graph(),o=xn(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 _n(e,t){return Object.values(t).reduce((t,n)=>{let r=-1/0,i=1/0;Object.entries(n).forEach(([t,n])=>{let a=Sn(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 vn(e,t){let n=Object.values(t),r=z(Math.min,n),i=z(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-z(Math.min,c);a!==`l`&&(l=i-z(Math.max,c)),l&&(s=ct(s,e=>e+l),e[o]=s)})})}function yn(e,t){return ct(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 bn(e){let t=L(e),n=Object.assign(un(e,t),dn(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=mn(e,o,n,s),l=hn(e,o,c.root,c.align,t===`r`);t===`r`&&(l=ct(l,e=>-e)),r[a+t]=l})}),vn(r,_n(e,r)),yn(r,e.graph().align)}function xn(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 Sn(e,t){return e.node(t).width}function Cn(e){let t=P(e);wn(t);let n=bn(t);Object.entries(n).forEach(([t,n])=>{e.node(t).x=n})}function wn(e){let t=L(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 Tn(e,t={}){let n=t.debugTiming?B:at;return n(`layout`,()=>{let r=n(` buildLayoutGraph`,()=>In(e));return n(` runLayout`,()=>En(r,n,t)),n(` updateInputGraph`,()=>Dn(e,r)),r})}function En(e,t,n){t(` makeSpaceForEdgeLabels`,()=>Ln(e)),t(` removeSelfEdges`,()=>qn(e)),t(` acyclic`,()=>G(e)),t(` nestingGraph.run`,()=>Mt(e)),t(` rank`,()=>Et(P(e))),t(` injectEdgeLabelProxies`,()=>Rn(e)),t(` removeEmptyRanks`,()=>et(e)),t(` nestingGraph.cleanup`,()=>Y(e)),t(` normalizeRanks`,()=>$e(e)),t(` assignRankMinMax`,()=>zn(e)),t(` removeEdgeLabelProxies`,()=>Bn(e)),t(` normalize.run`,()=>dt(e)),t(` parentDummyChains`,()=>At(e)),t(` addBorderSegments`,()=>Ft(e)),t(` order`,()=>on(e,n)),t(` insertSelfEdges`,()=>Jn(e)),t(` adjustCoordinateSystem`,()=>Wt.adjust(e)),t(` position`,()=>Cn(e)),t(` positionSelfEdges`,()=>Yn(e)),t(` removeBorderNodes`,()=>Kn(e)),t(` normalize.undo`,()=>ft(e)),t(` fixupEdgeLabelCoords`,()=>Wn(e)),t(` undoCoordinateSystem`,()=>Wt.undo(e)),t(` translateGraph`,()=>Vn(e)),t(` assignNodeIntersects`,()=>Un(e)),t(` reversePoints`,()=>Gn(e)),t(` acyclic.undo`,()=>lt(e))}function Dn(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 On=[`nodesep`,`edgesep`,`ranksep`,`marginx`,`marginy`],kn={ranksep:50,edgesep:20,nodesep:50,rankdir:`tb`},An=[`acyclicer`,`ranker`,`rankdir`,`align`],jn=[`width`,`height`,`rank`],Mn={width:0,height:0},Nn=[`minlen`,`weight`,`width`,`height`,`labeloffset`],Pn={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:`r`},Fn=[`labelpos`,`arrowshape`];function In(e){let t=Zn(e.graph()),n={...kn,...Xn(t,On),...st(t,An)},r=new E({multigraph:!0,compound:!0});return r.setGraph(n),e.nodes().forEach(t=>{let n=Xn(Zn(e.node(t)),jn);Object.keys(Mn).forEach(e=>{n[e]===void 0&&(n[e]=Mn[e])}),r.setNode(t,n),r.setParent(t,e.parent(t))}),e.edges().forEach(t=>{let n=Zn(e.edge(t));r.setEdge(t,{...Pn,...Xn(n,Nn),...st(n,Fn)})}),r}function Ln(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 Rn(e){e.edges().forEach(t=>{let n=e.edge(t);if(n.width&&n.height){let n=e.node(t.v);N(e,`edge-proxy`,{rank:(e.node(t.w).rank-n.rank)/2+n.rank,e:t},`_ep`)}})}function zn(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 Bn(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 Vn(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 Hn(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 Un(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=I(r,a),c=I(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=Hn(s,l,4):h=Hn(c,u,4)),n.points.unshift(m),n.points.push(h)})}function Wn(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 Gn(e){e.edges().forEach(t=>{let n=e.edge(t);n.reversed&&n.points.reverse()})}function Kn(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 qn(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 Jn(e){L(e).forEach(t=>{let n=0;t.forEach((t,r)=>{let i=e.node(t);i.order=r+n,(i.selfEdges||[]).forEach(t=>{N(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 Yn(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 Xn(e,t){return ct(st(e,t),Number)}function Zn(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 Qn={rankDirection:`TB`,nodeSeparation:50,rankSeparation:50,edgeSeparation:10,align:void 0,nodeWidth:100,nodeHeight:40,curvedEdges:!1,padding:20,arrowShape:`normal`,arrowSize:10};function $n(e){return e.length?e.map((e,t)=>`${t===0?`M`:`L`} ${e.x} ${e.y}`).join(` `):``}function er(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){e[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 tr(e){let{nodes:t,edges:n,configuration:r}=e,i=C(null),a=C(null),o=`dag-arrow-${c()}`;function l(e,t,n){a.value=null,i.value=null;let r={...Qn,...n},l=new E({multigraph:!0,compound:!0});l.setGraph({rankdir:r.rankDirection,nodesep:r.nodeSeparation,ranksep:r.rankSeparation,edgesep:r.edgeSeparation,align:r.align}),e.forEach(e=>{l.setNode(e.id,{label:e.label,width:e.width??r.nodeWidth,height:e.height??r.nodeHeight})}),t.forEach(e=>{l.setEdge(e.from,e.to,{weight:e.weight??1,minlen:e.minLength??1,arrowShape:r.arrowShape??`normal`})}),Tn(l);let u=e.map(e=>{let t=l.node(e.id);return{id:e.id,label:e.label,x:t.x,y:t.y,width:t.width,height:t.height,original:e}}),d=l.edges().map(e=>{let n=l.edge(e),i=n.points||[];if(!i.length)return null;let a=r.curvedEdges?er(i):$n(i),s=r.arrowShape===`undirected`?null:`url(#${o})`,u=t.find(t=>t?.from===e.v&&t?.to===e.w);return{id:`${e.v}->${e.w}->${c()}`,from:e.v,to:e.w,points:i,pathData:a,markerEnd:s,original:{...u,...n}}}).filter(Boolean),f=r.padding;if(!u.length){i.value={nodes:[],edges:d,viewBox:`0 0 0 0`,arrowShape:r.arrowShape,arrowSize:r.arrowSize};return}let p=u.flatMap(e=>[e.x-e.width/2,e.x+e.width/2]),m=u.flatMap(e=>[e.y-e.height/2,e.y+e.height/2]),h=Math.min(...p)-f,g=Math.max(...p)+f,ee=Math.min(...m)-f,te=Math.max(...m)+f;i.value={nodes:u,edges:d.map(e=>({...e,midpoint:e.pathData?s(e.pathData):{x:0,y:0}})),viewBox:`${h} ${ee} ${g-h} ${te-ee}`,arrowShape:r.arrowShape,arrowSize:r.arrowSize}}return Ie(()=>{try{l(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:()=>{l(T(t)||[],T(n)||[],T(r)||{})}}}var nr=/* @__PURE__ */ e({default:()=>Ir}),rr=[`id`],ir=[`id`],ar={key:1,class:`dag-chart-error`},or={style:{position:`relative`}},sr=[`viewBox`,`xmlns`,`aria-describedby`],cr={key:0},lr=[`id`,`width`,`height`],ur=[`cx`,`cy`,`r`,`fill`],dr=[`x`,`y`,`width`,`height`,`fill`],fr={key:2},pr=[`id`,`markerWidth`,`markerHeight`,`refX`,`refY`],mr=[`d`,`fill`,`stroke`],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__*/ se({__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:s,emit:se}){let Ie=Ce(()=>import(`./PenAndPaper-DvJJaeU2.js`).then(e=>e.t)),ze=Ce(()=>import(`./UserOptions-D65t74CM.js`).then(e=>e.n)),Be=Ce(()=>import(`./PackageVersion-D6pKL176.js`).then(e=>e.t)),{vue_ui_dag:Ve}=ee(),E=e,He=se,D=C(null),O=C(c()),Ue=C(null),We=C(null),Ge=C(null),Ke=C(0),qe=C(0),Je=C(!1),Ye=C(!1),k=C(null),A=C(null),j=C(null),M=C(null),Xe=C(null),N=C(`pointer`),Ze=C(!1),P=C(gt()),F=_(()=>P.value.style.chart.nodes),Qe=_(()=>P.value.style.chart.edges),I=_(()=>P.value.style.chart.midpoints),L=_(()=>P.value.style.chart);h({config:()=>P.value,dataset:()=>E.dataset,component:`VueUiDag`,rules:[g.noHint]});let $e=_(()=>P.value.userOptions.useCursorPointer),et=C(P.value.style.chart.width),tt=C(P.value.style.chart.height),nt=C({x:0,y:0}),R=C(null),z=C(null),rt=C({left:`0px`,top:`0px`}),it=C(`top`),B=C(!1),at=C({x:0,y:0}),ot=C({x:0,y:0}),V=C(null),H=C(null),st=C({left:`0px`,top:`0px`}),ct=C(`top`),U=C(!1),W=C(!1),{svgRef:G}=pe({config:L.value.title}),{userOptionsVisible:lt,setUserOptionsVisibility:ut,keepUserOptionState:dt}=fe({config:P.value}),K=C(P.value.style.chart.layout.rankDirection),ft=_(()=>d({defaultConfig:{userOptions:{show:!1},style:{chart:{backgroundColor:`#99999930`,nodes:{stroke:`#CCCCCC`,backgroundColor:`#DDDDDD50`},edges:{stroke:`#CCCCCC`},midpoints:{stroke:`#CCCCCC`,fill:`#CCCCCC`}}}},userConfig:P.value.skeletonConfig??{}})),{loading:pt,FINAL_DATASET:mt,manualLoading:ht}=ne({...Pe(E),FINAL_CONFIG:P,prepareConfig:gt,skeletonDataset:E.config?.skeletonDataset??{nodes:[{id:`A`,label:``},{id:`B`,label:``},{id:`C`,label:``}],edges:[{from:`A`,to:`B`},{from:`A`,to:`C`}]},skeletonConfig:d({defaultConfig:P.value,userConfig:ft.value})});function gt(){return de(E.config,Ve,ge)}let _t=_(()=>P.value.debug);je(async()=>{m(E.dataset)&&(u({componentName:`VueUiDag`,type:`dataset`,debug:_t.value}),Ye.value=!1,ht.value=!0),(!E.dataset.nodes||E.dataset.nodes.length===0)&&(u({componentName:`VueUiDag`,type:`datasetAttributeEmpty`,property:`nodes`,index:0,debug:_t.value}),Ye.value=!1,ht.value=!0),Ye.value=!0,await Ee(),rn()}),Fe(()=>E.config,async e=>{pt.value||(P.value=gt()),lt.value=!P.value.userOptions.showOnChartHover,Ke.value+=1,K.value=L.value.layout.rankDirection,et.value=L.value.width,tt.value=L.value.height,Pt.value=L.value.zoom.active,await Ee(),rn()},{deep:!0});let{isPrinting:vt,isImaging:yt,generatePdf:bt,generateImage:xt}=te({elementId:`dag_${O.value}`,fileName:L.value.title.text||`vue-ui-dag`,options:P.value.userOptions.print}),St=_(()=>L.value.backgroundColor),Ct=_(()=>L.value.title),{isCallbackImaging:wt,isCallbackSvg:Tt,generateSvg:Et,onGenerateImage:Dt}=ie({svg:G,title:Ct,legend:null,legendItems:null,backgroundColor:St,getSvgCallback:()=>P.value.userOptions.callbacks.svg,generateImage:xt});function Ot(){Je.value=!0,ut(!0)}function kt(){ut(!1),Je.value=!1}function At({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`}}}let{layoutData:q,lastError:jt,arrowMarkerIdentifier:Mt}=tr({nodes:_(()=>mt.value.nodes.map(e=>({...e,backgroundColor:e.backgroundColor?o(e.backgroundColor):F.value.backgroundColor,color:e.color?o(e.color):F.value.labels.color}))),edges:_(()=>mt.value.edges),configuration:_(()=>({...L.value.layout,rankDirection:K.value}))});function J(e){return q.value?q.value.nodes.find(t=>t.id===e):null}_(()=>{if(!q.value)return[];let e=Qe.value.stroke,t=/* @__PURE__ */ new Set;return q.value.edges.forEach(n=>{t.add({id:n.id,from:n.from,to:n.to,color:n.original?.color||e})}),Array.from(t)});let Nt=_(()=>{let e=et.value,t=tt.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}}),Pt=C(L.value.zoom.active),{viewBox:Y,resetZoom:Ft,setInitialViewBox:It,scale:Lt,zoomByFactor:Rt}=me(G,{x:0,y:0,width:100,height:100},1,Pt,()=>{B.value=!1}),zt=null;async function Bt(e,{smooth:t=!0,duration:n=300,zoomReset:r=!1,zoom:i=null}={}){let o=J(e);if(!o)return!1;let s=Y.value;if(!s)return!1;let c={x:Number(s.x),y:Number(s.y),width:Number(s.width),height:Number(s.height)},l=Lt.value,u=c.width,d=c.height,p=l;if(Number.isFinite(i)&&i>0||r){Ft(!1);let e=Y.value,t=Number.isFinite(i)&&i>0?i/100:1;u=Number(e.width)/t,d=Number(e.height)/t,p=t,Y.value={...c},Lt.value=l}let m=Number(o.x),h=Number(o.y);if(!Number.isFinite(c.x)||!Number.isFinite(c.y)||!Number.isFinite(c.width)||!Number.isFinite(c.height)||!Number.isFinite(u)||!Number.isFinite(d)||!Number.isFinite(m)||!Number.isFinite(h))return!1;let g={x:m-u/2,y:h-d/2,width:u,height:d};if(zt!==null&&(cancelAnimationFrame(zt),zt=null),B.value=!1,!t||n<=0)return Y.value=g,Lt.value=p,!0;let ee=performance.now();function te(e){let t=Math.min((e-ee)/n,1),r=f(t);Y.value={x:a(c.x,g.x,r),y:a(c.y,g.y,r),width:a(c.width,g.width,r),height:a(c.height,g.height,r)},Lt.value=a(l,p,r),t<1?zt=requestAnimationFrame(te):(Y.value=g,Lt.value=p,zt=null)}return zt=requestAnimationFrame(te),!0}function Vt(){Pt.value=!Pt.value}function Ht(){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=Nt.value;u&&(u.width!==null&&(o=u.width),u.height!==null&&(s=u.height),c=n-(o-i)/2,l=r-(s-a)/2),It({x:c,y:l,width:o,height:s},{overwriteCurrentIfNotZoomed:!0})}Fe(()=>q.value&&q.value.viewBox,()=>{Ht()},{immediate:!0}),Fe(()=>Nt.value,()=>{Ht()}),Fe(()=>W.value,e=>{Pt.value=!e});let Ut=_(()=>{let e=Y.value;return e?`${e.x} ${e.y} ${e.width} ${e.height}`:`0 0 0 0`}),X=C(!1);function Wt(e){X.value=e,qe.value+=1}function Gt(){W.value=!W.value}function Kt(){Rt(Fr,!0)}function qt(){Rt(1/Fr,!0)}let Jt=[`TB`,`RL`,`BT`,`LR`];function Yt(){K.value=Jt[(Jt.indexOf(K.value)+1)%Jt.length],Ft(),He(`rotate`,K.value)}let Xt=At({tooltipRef:z,isVisibleRef:U,anchorRef:nt,styleRef:rt,placementRef:it,isNode:!1}),Zt=At({tooltipRef:H,isVisibleRef:B,anchorRef:at,styleRef:st,placementRef:ct,offsetRef:ot}),Z=C(null);async function Qt(e){He(`onMidpointEnter`,e);let t=G.value;if(!t||!e?.midpoint)return;let n=t.createSVGPoint();n.x=e.midpoint.x,n.y=e.midpoint.y;let r=t.getScreenCTM();if(!r)return;let i=n.matrixTransform(r);nt.value={x:i.x,y:i.y},R.value=e,U.value=!0,I.value.selectedEdge.animated===!0&&(Z.value=e.id,un()),await Ee(),Xt()}function Q(){U.value=!1,R.value=null,He(`onMidpointLeave`),I.value.selectedEdge.animated===!0&&(Z.value=null,un())}async function $t(e){if(He(`onNodeClick`,e),!F.value.tooltip.showOnClick)return;let t=G.value;if(!t)return;let n=t.createSVGPoint();n.x=e.x,n.y=e.y;let r=t.getScreenCTM();if(!r)return;let i=n.matrixTransform(r),a=L.value.layout.nodeWidth,o=L.value.layout.nodeHeight,s=r.a,c=r.d,l=a*s,u=o*c;ot.value={x:l/2,y:u/2},at.value={x:i.x,y:i.y},V.value=e,B.value=!0,await Ee(),Zt()}function en(){B.value=!1,V.value=null}function tn(e){if(!(B.value||U.value))return;let t=H.value;if(t&&t.contains(e.target))return;let n=z.value;if(n&&n.contains(e.target))return;let r=G.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}en(),Q(),Ze.value||Ln()}function nn(e){e.key===`Escape`&&(B.value&&en(),U.value&&Q())}je(()=>{document.addEventListener(`mousedown`,tn),document.addEventListener(`keydown`,nn)}),Ae(()=>{document.removeEventListener(`mousedown`,tn),document.removeEventListener(`keydown`,nn),k.value&&(A.value&&k.value.unobserve(A.value),k.value.disconnect())});function rn(){if(!P.value.responsive){k.value&&(A.value&&k.value.unobserve(A.value),k.value.disconnect(),k.value=null,A.value=null);return}let e=ce(()=>{if(!D.value)return;let{width:e,height:t}=le({chart:D.value,title:L.value.title.text?Ue.value:null,legend:L.value.controls.show?Ge.value?.$el:null,source:We.value});requestAnimationFrame(()=>{et.value=Math.max(.1,e),tt.value=Math.max(.1,t-12)})});k.value&&(A.value&&k.value.unobserve(A.value),k.value.disconnect()),k.value=new ResizeObserver(e),A.value=D.value?D.value.parentNode:null,A.value&&k.value.observe(A.value),e()}function an(e,t={}){let{direction:n=-1,mode:r=`oneLapNearest`,dasharray:i=null}=t;if(!e||typeof e.getTotalLength!=`function`)return _t.value&&console.warn(`VueUiDag @getIdealDashoffsetDelta: invalid path element`,e),0;let a=e.getTotalLength(),o=d(i??e.getAttribute(`stroke-dasharray`)??(typeof getComputedStyle==`function`?getComputedStyle(e).strokeDasharray:``));if(!Number.isFinite(o)||o<=0)return n*a;let s=Math.max(1,Math.round(a/o)),c=Math.max(1,Math.ceil(a/o)),l=Math.max(1,Math.floor(a/o)),u;return u=r===`pattern`?o:r===`oneLapCeil`?c*o:r===`oneLapFloor`?l*o:s*o,n*u;function d(e){if(!e||e===`none`)return NaN;let t=String(e).replace(/,/g,` `).trim().split(/\s+/).map(e=>Number.parseFloat(e)).filter(e=>Number.isFinite(e));if(!t.length)return NaN;let n=t.reduce((e,t)=>e+t,0);return t.length%2==1?n*2:n}}let on=C(/* @__PURE__ */ new Map),sn=C(/* @__PURE__ */ new Map);function cn(e){return function(t){t?on.value.set(e,t):on.value.delete(e)}}function ln(){sn.value.forEach(e=>{try{e.cancel()}catch{}}),sn.value.clear()}function un(){ln();let e=q.value?.edges??[];if(!e.length)return;let t=Qe.value.animations,n=Number(t.referenceDistance)>0?Number(t.referenceDistance):24;e.forEach(e=>{let r=I.value.selectedEdge.animated===!0&&Z.value!=null&&e.id===Z.value,i=!!e?.original?.animated||!!e?.animated||r,a=on.value.get(e.id);if(!a)return;if(!i){a.style.strokeDasharray=`0`,a.style.strokeDashoffset=`0`;return}let o=e?.original?.dasharray??t.dasharray;a.style.strokeDasharray=String(o),a.style.strokeDashoffset=`0`;let s=![void 0,null].includes(e?.original?.animationDirection),c=![void 0,null].includes(t.animationDirection),l=an(a,{direction:s?Number(e.original.animationDirection):c?Number(t.animationDirection):-1,mode:`oneLapNearest`,dasharray:String(o)}),u=e?.original?.animationDurationMs??t.animationDurationMs??1e3,d=Number(u),f=Number.isFinite(d)&&d>0?n/d:n/1e3,p=Math.max(1,Math.round(Math.abs(l)/Math.max(1e-9,f))),m=a.animate([{strokeDashoffset:0},{strokeDashoffset:l}],{duration:p,iterations:1/0,easing:`linear`});sn.value.set(e.id,m)})}Fe(()=>q.value&&q.value.edges,async()=>{await Ee(),un()},{deep:!0,immediate:!0}),Ae(()=>{ln()});async function dn({scale:e=2}={}){if(!D.value)return;let{width:t,height:n}=D.value.getBoundingClientRect(),r=t/n,{imageUri:i,base64:a}=await ae({domElement:D.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 fn=_(()=>{let e=Number(L.value.layout.nodeHeight);return Number.isFinite(e)&&e>0?e/L.value.backgroundPattern.spacingRatio:12}),pn=_(()=>fn.value*(L.value.backgroundPattern.dotRadiusRatio/100)),$=C(null),mn=null,hn=0;function gn(e){mn&&=(clearTimeout(mn),null),$.value!==e&&($.value=e,(F.value.selected.downstreamEdges.animated===!0||F.value.selected.upstreamEdges.animated===!0)&&un())}function _n(e){N.value=`pointer`,Z.value=null,gn(e)}async function vn(e){N.value=`pointer`,$.value=null,await Qt(e)}function yn(e){let t=++hn;mn&&clearTimeout(mn),mn=setTimeout(()=>{t===hn&&$.value===e&&($.value=null,(F.value.selected.downstreamEdges.animated===!0||F.value.selected.upstreamEdges.animated===!0)&&un())},20)}function bn(e){let t=e.from===$.value,n=e.to===$.value,r=M.value===`midpoint`&&j.value===e.id,i=Z.value===e.id||R.value?.id===e.id||r,a=e.original.color??Qe.value.stroke;return i&&I.value.selectedEdge.stroke!=null?a=I.value.selectedEdge.stroke:t&&F.value.selected.downstreamEdges.stroke!=null?a=F.value.selected.downstreamEdges.stroke:n&&F.value.selected.upstreamEdges.stroke!=null&&(a=F.value.selected.upstreamEdges.stroke),e.animated=t&&F.value.selected.downstreamEdges.animated===!0||n&&F.value.selected.upstreamEdges.animated===!0||r&&I.value.selectedEdge.animated===!0?!0:(q.value?.edges.find(t=>t.id===e.id))?.original?.animated??!1,{d:e.pathData,fill:`none`,stroke:a,"stroke-width":Qe.value.strokeWidth*(i||e.from===$.value?2:1),"stroke-linecap":`round`,"stroke-linejoin":`round`}}function xn(e){return M.value===`node`&&j.value===e}function Sn(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 Cn(e){let t=e.from===$.value,n=e.to===$.value,r=M.value===`midpoint`&&j.value===e.id,i=Z.value===e.id||R.value?.id===e.id||r,a=e.original.color??Qe.value.stroke;return i&&I.value.selectedEdge.stroke!=null?a=I.value.selectedEdge.stroke:t&&F.value.selected.downstreamEdges.stroke!=null?a=F.value.selected.downstreamEdges.stroke:n&&F.value.selected.upstreamEdges.stroke!=null&&(a=F.value.selected.upstreamEdges.stroke),{cx:e?.midpoint?.x,cy:e?.midpoint?.y,r:I.value.radius,fill:r?I.value.selectedEdge.stroke??I.value.fill:I.value.fill,stroke:a,"stroke-width":Qe.value.strokeWidth*(i||e.from===$.value?2:1)}}function wn(e){let t=e.from===$.value,n=e.to===$.value,r=M.value===`midpoint`&&j.value===e.id,i=Z.value===e.id||R.value?.id===e.id||r,a=e.color??e.original?.color??Qe.value.stroke;return i&&I.value.selectedEdge.stroke!=null?a=I.value.selectedEdge.stroke:t&&F.value.selected.downstreamEdges.stroke!=null?a=F.value.selected.downstreamEdges.stroke:n&&F.value.selected.upstreamEdges.stroke!=null&&(a=F.value.selected.upstreamEdges.stroke),a}function Tn(e){return`${Mt}-${String(e).replace(/[^a-zA-Z0-9_-]/g,`_`)}`}function En(){return q.value}async function Dn(){if(He(`copyAlt`,{config:P.value,dataset:mt.value}),!P.value.userOptions.callbacks.altCopy){console.warn("Vue Data UI - A callback must be set for `altCopy` in userOptions.");return}await Promise.resolve(P.value.userOptions.callbacks.altCopy({config:P.value,dataset:mt.value}))}let On=_(()=>(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})):[]),An=_(()=>[...On.value,...kn.value].sort((e,t)=>e.x===t.x?e.y-t.y:e.x-t.x)),jn=_(()=>{let e=/* @__PURE__ */ new Map;return An.value.forEach((t,n)=>{e.set(`${t.type}:${t.id}`,n)}),e}),Mn=_(()=>{let e=q.value?.nodes??[],t=q.value?.edges??[];return{headers:[P.value.a11y?.translations?.node??`Node`,P.value.a11y?.translations?.parents??`Parents`,P.value.a11y?.translations?.children??`Children`],rows:e.map(e=>{let n=t.filter(t=>t.to===e.id).map(e=>J(e.from)?.label??e.from).join(`, `),r=t.filter(t=>t.from===e.id).map(e=>J(e.to)?.label??e.to).join(`, `);return[e.label??e.id,n||`—`,r||`—`]})}});function Nn(e){return`${e.type}:${e.id}`}function Pn(){return j.value==null||M.value==null?null:An.value.find(e=>e.id===j.value&&e.type===M.value)??null}async function Fn(e){if(e){if(e.type===`node`){Q();return}e.type===`midpoint`&&(en(),await Qt(e.raw))}}function In(e){if(e){if(j.value=e.id,M.value=e.type,Xe.value=jn.value.get(Nn(e))??null,e.type===`node`){gn(e.id),Z.value=null;return}e.type===`midpoint`&&($.value=null,Z.value=e.id,I.value.selectedEdge.animated===!0&&un())}}function Ln(){j.value=null,M.value=null,Xe.value=null,B.value||($.value=null),U.value||(Z.value=null,I.value.selectedEdge.animated===!0&&un())}function Rn(){Ze.value=!0,Ln()}function zn(){Ze.value=!1,en(),Q(),Ln()}function Bn(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 Vn(e,t){let n=An.value.filter(t=>Nn(t)!==Nn(e));if(!n.length)return null;let r=null,i=1/0;return n.forEach(n=>{let a=Bn(e,n,t);a<i&&(i=a,r=n)}),r||(t===`right`||t===`down`?An.value[0]??null:An.value[An.value.length-1]??null)}async function Hn(e){e&&(N.value=`keyboard`,e.type===`node`&&(Q(),await $t(e.raw)))}async function Un(e){if(!G.value||W.value||document.activeElement!==G.value||!An.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){en(),Q(),Ln();return}let s=Pn();if(a){if(!s)return;s.type===`node`&&await Hn(s);return}if(!s){let e=An.value[0];if(!e)return;In(e),await Fn(e);return}let c=null;n?c=Vn(s,`right`):t?c=Vn(s,`left`):i?c=Vn(s,`down`):r&&(c=Vn(s,`up`)),c&&(en(),Q(),In(c),await Fn(c))}return s({getData:En,getImage:dn,generatePdf:bt,generateSvg:Et,generateImage:xt,toggleAnnotator:Gt,toggleFullscreen:Wt,zoomIn:Kt,zoomOut:qt,resetZoom:Ft,switchDirection:Yt,copyAlt:Dn,focusOnNode:Bt}),(e,a)=>(S(),b(`div`,{class:De(`vue-data-ui-component vue-ui-dag ${X.value?`vue-data-ui-wrapper-fullscreen`:``} ${P.value.responsive?`vue-ui-dag-responsive`:``}`),id:`dag_${O.value}`,ref_key:`dagChart`,ref:D,style:ke({fontFamily:P.value.style.fontFamily,backgroundColor:L.value.backgroundColor,padding:`0.5rem`}),onMouseenter:Ot,onMouseleave:kt},[x(`div`,{id:`chart-instructions-${O.value}`,class:`sr-only`},[x(`p`,null,Ne(P.value.a11y.translations.keyboardNavigation),1)],8,ir),Mn.value?.rows?.length?(S(),v(ue,{key:0,uid:O.value,head:Mn.value.headers,body:Mn.value.rows,notice:P.value.a11y.translations.tableAvailable,caption:P.value.a11y.translations.tableCaption},null,8,[`uid`,`head`,`body`,`notice`,`caption`])):y(``,!0),T(jt)?(S(),b(`div`,ar,Ne(String(T(jt))),1)):y(``,!0),P.value.userOptions.buttons.annotator?(S(),v(T(Ie),{key:2,svgRef:T(G),backgroundColor:L.value.backgroundColor,color:L.value.color,active:W.value,isCursorPointer:$e.value,palette:P.value.userOptions.annotatorPalette,onClose:Gt},be({_:2},[Me(T(n),n=>({name:n,fn:Le(r=>[w(e.$slots,n,Oe(we(T(t)(n,r))),void 0,!0)])}))]),1032,[`svgRef`,`backgroundColor`,`color`,`active`,`isCursorPointer`,`palette`])):y(``,!0),P.value.userOptions.show&&Ye.value&&(T(dt)||T(lt))?(S(),v(T(ze),{ref:`userOptionsRef`,key:`user_option_${qe.value}`,backgroundColor:L.value.backgroundColor,color:L.value.color,isPrinting:T(vt),isImaging:T(yt),uid:O.value,hasTooltip:!1,hasTable:!1,hasXls:!1,hasLabel:!1,hasPdf:P.value.userOptions.buttons.pdf,hasImg:P.value.userOptions.buttons.img,hasSvg:P.value.userOptions.buttons.svg,hasFullscreen:P.value.userOptions.buttons.fullscreen,hasAltCopy:P.value.userOptions.buttons.altCopy,isFullscreen:X.value,chartElement:D.value,position:P.value.userOptions.position,titles:{...P.value.userOptions.buttonTitles},hasAnnotator:P.value.userOptions.buttons.annotator,isAnnotation:W.value,callbacks:P.value.userOptions.callbacks,printScale:P.value.userOptions.print.scale,hasZoom:P.value.userOptions.buttons.zoom,isZoom:Pt.value,isCursorPointer:$e.value,onToggleFullscreen:Wt,onGeneratePdf:T(bt),onGenerateImage:T(Dt),onGenerateSvg:T(Et),onToggleAnnotator:Gt,onToggleZoom:Vt,onCopyAlt:Dn,style:ke({visibility:T(dt)?T(lt)?`visible`:`hidden`:`visible`})},be({_:2},[Me(T(r)(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,Oe(we(T(i)(t,n))),void 0,!0)])}))]),1032,[`backgroundColor`,`color`,`isPrinting`,`isImaging`,`uid`,`hasPdf`,`hasImg`,`hasSvg`,`hasFullscreen`,`hasAltCopy`,`isFullscreen`,`chartElement`,`position`,`titles`,`hasAnnotator`,`isAnnotation`,`callbacks`,`printScale`,`hasZoom`,`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(oe,{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`&&!T(pt)&&L.value.controls.show?(S(),v(he,{key:5,ref_key:`zoomControls`,ref:Ge,config:P.value,scale:T(Lt),isFullscreen:X.value,withDirection:``,onZoomIn:Kt,onZoomOut:qt,onResetZoom:a[0]||=()=>T(Ft)(!0),onSwitchDirection:Yt},null,8,[`config`,`scale`,`isFullscreen`])):y(``,!0),x(`div`,or,[T(q)?(S(),b(`svg`,{key:0,ref_key:`svgRef`,ref:G,class:De({"vue-ui-dag-svg":!0,"vue-data-ui-loading":T(pt)}),viewBox:Ut.value,xmlns:T(p),style:ke({backgroundColor:L.value.backgroundColor,height:`100%`,width:`100%`}),tabindex:`0`,"aria-describedby":`chart-instructions-${O.value}`,onFocus:Rn,onBlur:zn,onKeydown:Un},[Se(T(Be)),L.value.backgroundPattern.show?(S(),b(`defs`,cr,[x(`pattern`,{id:`dag_bg_pattern_${O.value}`,patternUnits:`userSpaceOnUse`,width:fn.value,height:fn.value},[w(e.$slots,`background-pattern`,Oe(we({x:fn.value/2,y:fn.value/2,color:L.value.backgroundPattern.dotColor})),()=>[x(`circle`,{cx:fn.value/2,cy:fn.value/2,r:pn.value,fill:L.value.backgroundPattern.dotColor},null,8,ur)],!0)],8,lr)])):y(``,!0),L.value.backgroundPattern.show?(S(),b(`rect`,{key:1,x:T(Y)?.x??0,y:T(Y)?.y??0,width:T(Y)?.width??0,height:T(Y)?.height??0,fill:`url(#dag_bg_pattern_${O.value})`,style:ke({pointerEvents:`none`,opacity:L.value.backgroundPattern.opacity})},null,12,dr)):y(``,!0),T(q).arrowShape===`undirected`?y(``,!0):(S(),b(`defs`,fr,[(S(!0),b(_e,null,Me(T(q).edges,e=>(S(),b(`marker`,{key:`marker_${e.id}`,id:Tn(e.id),markerWidth:T(q).arrowSize,markerHeight:T(q).arrowSize,refX:T(q).arrowSize-3,refY:T(q).arrowSize/2,orient:`auto`,markerUnits:`strokeWidth`},[T(q).arrowShape===`normal`?(S(),b(`path`,{key:0,d:`M 0 0 L ${T(q).arrowSize} ${T(q).arrowSize/2} L 0 ${T(q).arrowSize} Z`,fill:wn(e),stroke:wn(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,t as n}from"./annotationSlots-BRR85CqJ.js";import{n as r,t as i}from"./userOptionsSlots-DYuo-E5m.js";import{Pt as a,S as o,St as s,X as c,Y as l,at as u,in as d,rt as f,t as p,zt as m}from"./lib-CV_IANZ6.js";import{n as h,t as g}from"./useHints-BH9r_0Vd.js";import{t as ee}from"./useConfig-CKdzPrcf.js";import{t as te}from"./usePrinter-hLW3cv4N.js";import{n as ne,t as re}from"./BaseScanner-8NdoBs7B.js";import{t as ie}from"./useChartExport-DtPNpc9M.js";import{t as ae}from"./img-DiT4ivZ5.js";import{n as oe}from"./Title-BGYFqulv.js";import{t as se}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{l as ce,t as le}from"./useResponsive-D2CPcpda.js";import{t as ue}from"./A11yDataTable-DWNlWXzs.js";import{t as de}from"./resolveChartConfig-DZg-korK.js";import{t as fe}from"./useUserOptionState-CXlFnwPv.js";import{t as pe}from"./useChartAccessibility-DOMuYJfm.js";import{t as me}from"./usePanZoom-BdjP5Suc.js";import{t as he}from"./BaseZoomControls-DoYifY2y.js";import{t as ge}from"./vue_ui_dag-1b_dLSym.js";import{Fragment as _e,Teleport as ve,Transition as ye,computed as _,createBlock as v,createCommentVNode as y,createElementBlock as b,createElementVNode as x,createSlots as be,createTextVNode as xe,createVNode as Se,defineAsyncComponent as Ce,guardReactiveProps as we,mergeProps as Te,nextTick as Ee,normalizeClass as De,normalizeProps as Oe,normalizeStyle as ke,onBeforeUnmount as Ae,onMounted as je,openBlock as S,ref as C,renderList as Me,renderSlot as w,toDisplayString as Ne,toRefs as Pe,unref as T,watch as Fe,watchEffect as Ie,withCtx as Le,withModifiers as Re}from"vue";var ze=`\0`,Be=`\0`,Ve=``,E=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=O(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]):O(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]):O(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]):O(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],D(this._preds[t],e),D(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 D(e,t){--e[t]||delete e[t]}function O(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 O(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 Ye(e,t){if(e.nodeCount()<=1)return[];let n=j(e,t||Je);return k(n.graph,n.buckets,n.zeroIndex).flatMap(t=>e.outEdges(t.v,t.w))}function k(e,t,n){let r=[],i=t[t.length-1],a=t[0],o;for(;e.nodeCount();){for(;o=a.dequeue();)A(e,t,n,o);for(;o=i.dequeue();)A(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(A(e,t,n,o,!0));break}}}return r}function A(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,M(t,n,s)}),e.outEdges(r.v).forEach(r=>{let i=e.edge(r),a=e.node(r.w);a.in-=i,M(t,n,a)}),e.removeNode(r.v),a}function j(e,t){let n=new E,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=Xe(i+r+3).map(()=>new Ge),o=r+1;return n.nodes().forEach(e=>{M(a,o,n.node(e))}),{graph:n,buckets:a,zeroIndex:o}}function M(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 Xe(e){let t=[];for(let n=0;n<e;n++)t.push(n);return t}function N(e,t,n,r){let i=r;for(;e.hasNode(i);)i=V(r);return n.dummy=t,e.setNode(i,n),i}function Ze(e){let t=new E().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 P(e){let t=new E({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 F(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 U(e.nodes(),t)}function Qe(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 U(e.nodes(),t)}function I(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 L(e){let t=H(rt(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 $e(e){let t=e.nodes().map(t=>{let n=e.node(t).rank;return n===void 0?Number.MAX_VALUE:n}),n=z(Math.min,t);e.nodes().forEach(t=>{let r=e.node(t);Object.hasOwn(r,`rank`)&&(r.rank-=n)})}function et(e){let t=e.nodes().map(t=>e.node(t).rank).filter(e=>e!==void 0),n=z(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 tt(e,t,n,r){let i={width:0,height:0};return arguments.length>=4&&(i.rank=n,i.order=r),N(e,`border`,i,t)}var nt=65535;function R(e,t=nt){let n=[];for(let r=0;r<e.length;r+=t){let i=e.slice(r,r+t);n.push(i)}return n}function z(e,t){if(t.length>nt){let n=R(t);return e.apply(null,n.map(t=>e.apply(null,t)))}return e.apply(null,t)}function rt(e){let t=e.nodes().map(t=>{let n=e.node(t).rank;return n===void 0?Number.MIN_VALUE:n});return z(Math.max,t)}function it(e,t){let n={lhs:[],rhs:[]};return e.forEach(e=>{t(e)?n.lhs.push(e):n.rhs.push(e)}),n}function B(e,t){let n=Date.now();try{return t()}finally{console.log(e+` time: `+(Date.now()-n)+`ms`)}}function at(e,t){return t()}var ot=0;function V(e){let t=++ot;return e+String(t)}function H(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 st(e,t){let n={};for(let r of t)e[r]!==void 0&&(n[r]=e[r]);return n}function ct(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 U(e,t){return e.reduce((e,n,r)=>(e[n]=t[r],e),{})}var W={addBorderNode:tt,addDummyNode:N,applyWithChunking:z,asNonCompoundGraph:P,buildLayerMatrix:L,intersectRect:I,mapValues:ct,maxRank:rt,normalizeRanks:$e,notime:at,partition:it,pick:st,predecessorWeights:Qe,range:H,removeEmptyRanks:et,simplify:Ze,successorWeights:F,time:B,uniqueId:V,zipObject:U};function G(e){(e.graph().acyclicer===`greedy`?Ye(e,t(e)):ut(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,V(`rev`))});function t(e){return t=>e.edge(t).weight}}function lt(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 ut(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 dt(e){e.graph().dummyChains=[],e.edges().forEach(t=>K(e,t))}function K(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=N(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 ft(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 pt(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=z(Math.min,a);return o===1/0&&(o=0),r&&(r.rank=o),o}(e.sources()||[]).forEach(t)}function mt(e,t){return e.node(t.w).rank-e.node(t.v).rank-e.edge(t).minlen}function ht(e){gt(e);let t=new E;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=_t(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;vt(e,i,s,o),t.setEdge(a.v,a.w,{}),i.add(c)}return t}function gt(e){e.nodes().forEach(t=>{let n=e.node(t)||{};Object.prototype.hasOwnProperty.call(n,`rank`)||(n.rank=0,e.setNode(t,n))})}function _t(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=mt(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 vt(e,t,n,r){r&&e.nodes().forEach(n=>{if(!t.has(n)){let t=e.node(n);t.rank+=r}})}function yt(e){let t=Ze(e);return pt(t),t.nodes().forEach(n=>{let r=t.node(n),i=e.node(n)||{};i.rank=r.rank,e.setNode(n,i)}),e}function bt(e,t){}function xt(e,t){}function St(e,t,n){return 0}function Ct(e){return null}function wt(e,t){return null}yt.initLowLimValues=bt,yt.initCutValues=xt,yt.calcCutValue=St,yt.leaveEdge=Ct,yt.enterEdge=wt;var Tt=pt;function Et(e){let t=e.graph().ranker;if(t instanceof Function)return t(e);switch(e.graph().ranker){case`network-simplex`:kt(e);break;case`tight-tree`:Ot(e);break;case`longest-path`:Dt(e);break;case`none`:break;default:kt(e)}}var Dt=Tt;function Ot(e){Tt(e),ht(e)}function kt(e){yt(e)}function At(e){let t=jt(e);e.graph().dummyChains.forEach(n=>{let r=e.node(n),i=r.edgeObj,a=q(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 q(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 jt(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 Mt(e){let t=W.addDummyNode(e,`root`,{},`_root`),n=Nt(e),r=Object.values(n),i=W.applyWithChunking(Math.max,r)-1,a=2*i+1;e.graph().nestingRoot=t,e.edges().forEach(t=>{e.edge(t).minlen*=a});let o=Pt(e)+1;e.children().forEach(r=>{J(e,t,a,o,i,n,r)}),e.graph().nodeRankFactor=a}function J(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=W.addBorderNode(e,`_bt`),l=W.addBorderNode(e,`_bb`),u=e.node(o);e.setParent(c,o),u.borderTop=c,e.setParent(l,o),u.borderBottom=l,s.forEach(s=>{J(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 Nt(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 Pt(e){return e.edges().reduce((t,n)=>t+e.edge(n).weight,0)}function Y(e){let t=e.graph();e.removeNode(t.nestingRoot),delete t.nestingRoot,e.edges().forEach(t=>{e.edge(t).nestingEdge&&e.removeEdge(t)})}function Ft(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)It(e,`borderLeft`,`_bl`,n,i,t),It(e,`borderRight`,`_br`,n,i,t)}}e.children().forEach(t)}function It(e,t,n,r,i,a){let o={width:0,height:0,rank:a,borderType:t},s=i[t][a-1],c=N(e,`border`,o,n);i[t][a]=c,e.setParent(c,r),s&&e.setEdge(s,c,{weight:1})}function Lt(e){let t=e.graph().rankdir.toLowerCase();(t===`lr`||t===`rl`)&&zt(e)}function Rt(e){let t=e.graph().rankdir.toLowerCase();(t===`bt`||t===`rl`)&&Vt(e),(t===`lr`||t===`rl`)&&(Ut(e),zt(e))}function zt(e){e.nodes().forEach(t=>{Bt(e.node(t))}),e.edges().forEach(t=>{Bt(e.edge(t))})}function Bt(e){let t=e.width;e.width=e.height,e.height=t}function Vt(e){e.nodes().forEach(t=>{Ht(e.node(t))}),e.edges().forEach(t=>{let n=e.edge(t);n.points.forEach(Ht),Object.hasOwn(n,`y`)&&Ht(n)})}function Ht(e){e.y=-e.y}function Ut(e){e.nodes().forEach(t=>{X(e.node(t))}),e.edges().forEach(t=>{let n=e.edge(t);n.points.forEach(X),Object.hasOwn(n,`x`)&&X(n)})}function X(e){let t=e.x;e.x=e.y,e.y=t}var Wt={adjust:Lt,undo:Rt};function Gt(e){let t={},n=e.nodes().filter(t=>e.children(t).length===0),r=n.map(t=>e.node(t).rank),i=H(z(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 Kt(e,t){let n=0;for(let r=1;r<t.length;++r)n+=qt(e,t[r-1],t[r]);return n}function qt(e,t,n){let r=U(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 Jt(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 Yt(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))}),Xt(Object.values(n).filter(e=>!e.indegree))}function Xt(e){let t=[];function n(e){return t=>{t.merged||(t.barycenter===void 0||e.barycenter===void 0||t.barycenter>=e.barycenter)&&Zt(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=>st(e,[`vs`,`i`,`barycenter`,`weight`]))}function Zt(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=it(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(Q(!!t)),c=Qt(a,i,c),r.forEach(e=>{c+=e.vs.length,a.push(e.vs),o+=e.barycenter*e.weight,s+=e.weight,c=Qt(a,i,c)});let l={vs:a.flat(!0)};return s&&(l.barycenter=o/s,l.weight=s),l}function Qt(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 Q(e){return(t,n)=>t.barycenter<n.barycenter?-1:t.barycenter>n.barycenter?1:e?n.i-t.i:t.i-n.i}function $t(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=Jt(e,i);l.forEach(t=>{if(e.children(t.v).length){let i=$t(e,t.v,n,r);c[t.v]=i,Object.hasOwn(i,`barycenter`)&&tn(t,i)}});let u=Yt(l,n);en(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 en(e,t){e.forEach(e=>{e.vs=e.vs.flatMap(e=>t[e]?t[e].vs:e)})}function tn(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 nn(e,t,n,r){r||=e.nodes();let i=rn(e),a=new E({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 rn(e){let t;for(;e.hasNode(t=V(`_root`)););return t}function an(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 on(e,t={}){if(typeof t.customOrder==`function`){t.customOrder(e,on);return}let n=rt(e),r=sn(e,H(1,n+1),`inEdges`),i=sn(e,H(n-1,-1,-1),`outEdges`),a=Gt(e);if(ln(e,a),t.disableOptimalOrderHeuristic)return;let o=1/0,s,c=t.constraints||[];for(let t=0,n=0;n<4;++t,++n){cn(t%2==0?r:i,t%4>=2,c),a=L(e);let l=Kt(e,a);l<o?(o=l,n=0,s=structuredClone(a)):l===o&&(s=structuredClone(a))}ln(e,s)}function sn(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=>nn(e,t,n,r.get(t)||[]))}function cn(e,t,n){let r=new E;e.forEach(e=>{n.forEach(e=>r.setEdge(e.left,e.right));let i=e.graph().root,a=$t(e,i,r,t);a.vs.forEach((t,n)=>{e.node(t).order=n}),an(e,r,a.vs)})}function ln(e,t){Object.values(t).forEach(t=>{t.forEach((t,n)=>{e.node(t).order=n})})}function un(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=fn(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)&&pn(n,r,t)})}),a=c+1,i=u)}),r}return t.length&&t.reduce(r),n}function dn(e,t){let n={};function r(t,r,i,a,o){let s;H(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)&&pn(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 fn(e,t){if(e.node(t).dummy)return e.predecessors(t).find(t=>e.node(t).dummy)}function pn(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 $(e,t,n){if(t>n){let e=t;t=n,n=e}return!!e[t]&&Object.hasOwn(e[t],n)}function mn(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]&&!$(n,e,r)&&(a[r]=e,a[e]=i[e]=i[r],t=o[r])}}})}),{root:i,align:a}}function hn(e,t,n,r,i){let a={},o=gn(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 gn(e,t,n,r){let i=new e.constructor,a=e.graph(),o=xn(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 _n(e,t){return Object.values(t).reduce((t,n)=>{let r=-1/0,i=1/0;Object.entries(n).forEach(([t,n])=>{let a=Sn(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 vn(e,t){let n=Object.values(t),r=z(Math.min,n),i=z(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-z(Math.min,c);a!==`l`&&(l=i-z(Math.max,c)),l&&(s=ct(s,e=>e+l),e[o]=s)})})}function yn(e,t){return ct(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 bn(e){let t=L(e),n=Object.assign(un(e,t),dn(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=mn(e,o,n,s),l=hn(e,o,c.root,c.align,t===`r`);t===`r`&&(l=ct(l,e=>-e)),r[a+t]=l})}),vn(r,_n(e,r)),yn(r,e.graph().align)}function xn(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 Sn(e,t){return e.node(t).width}function Cn(e){let t=P(e);wn(t);let n=bn(t);Object.entries(n).forEach(([t,n])=>{e.node(t).x=n})}function wn(e){let t=L(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 Tn(e,t={}){let n=t.debugTiming?B:at;return n(`layout`,()=>{let r=n(` buildLayoutGraph`,()=>In(e));return n(` runLayout`,()=>En(r,n,t)),n(` updateInputGraph`,()=>Dn(e,r)),r})}function En(e,t,n){t(` makeSpaceForEdgeLabels`,()=>Ln(e)),t(` removeSelfEdges`,()=>qn(e)),t(` acyclic`,()=>G(e)),t(` nestingGraph.run`,()=>Mt(e)),t(` rank`,()=>Et(P(e))),t(` injectEdgeLabelProxies`,()=>Rn(e)),t(` removeEmptyRanks`,()=>et(e)),t(` nestingGraph.cleanup`,()=>Y(e)),t(` normalizeRanks`,()=>$e(e)),t(` assignRankMinMax`,()=>zn(e)),t(` removeEdgeLabelProxies`,()=>Bn(e)),t(` normalize.run`,()=>dt(e)),t(` parentDummyChains`,()=>At(e)),t(` addBorderSegments`,()=>Ft(e)),t(` order`,()=>on(e,n)),t(` insertSelfEdges`,()=>Jn(e)),t(` adjustCoordinateSystem`,()=>Wt.adjust(e)),t(` position`,()=>Cn(e)),t(` positionSelfEdges`,()=>Yn(e)),t(` removeBorderNodes`,()=>Kn(e)),t(` normalize.undo`,()=>ft(e)),t(` fixupEdgeLabelCoords`,()=>Wn(e)),t(` undoCoordinateSystem`,()=>Wt.undo(e)),t(` translateGraph`,()=>Vn(e)),t(` assignNodeIntersects`,()=>Un(e)),t(` reversePoints`,()=>Gn(e)),t(` acyclic.undo`,()=>lt(e))}function Dn(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 On=[`nodesep`,`edgesep`,`ranksep`,`marginx`,`marginy`],kn={ranksep:50,edgesep:20,nodesep:50,rankdir:`tb`},An=[`acyclicer`,`ranker`,`rankdir`,`align`],jn=[`width`,`height`,`rank`],Mn={width:0,height:0},Nn=[`minlen`,`weight`,`width`,`height`,`labeloffset`],Pn={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:`r`},Fn=[`labelpos`,`arrowshape`];function In(e){let t=Zn(e.graph()),n={...kn,...Xn(t,On),...st(t,An)},r=new E({multigraph:!0,compound:!0});return r.setGraph(n),e.nodes().forEach(t=>{let n=Xn(Zn(e.node(t)),jn);Object.keys(Mn).forEach(e=>{n[e]===void 0&&(n[e]=Mn[e])}),r.setNode(t,n),r.setParent(t,e.parent(t))}),e.edges().forEach(t=>{let n=Zn(e.edge(t));r.setEdge(t,{...Pn,...Xn(n,Nn),...st(n,Fn)})}),r}function Ln(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 Rn(e){e.edges().forEach(t=>{let n=e.edge(t);if(n.width&&n.height){let n=e.node(t.v);N(e,`edge-proxy`,{rank:(e.node(t.w).rank-n.rank)/2+n.rank,e:t},`_ep`)}})}function zn(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 Bn(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 Vn(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 Hn(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 Un(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=I(r,a),c=I(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=Hn(s,l,4):h=Hn(c,u,4)),n.points.unshift(m),n.points.push(h)})}function Wn(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 Gn(e){e.edges().forEach(t=>{let n=e.edge(t);n.reversed&&n.points.reverse()})}function Kn(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 qn(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 Jn(e){L(e).forEach(t=>{let n=0;t.forEach((t,r)=>{let i=e.node(t);i.order=r+n,(i.selfEdges||[]).forEach(t=>{N(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 Yn(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 Xn(e,t){return ct(st(e,t),Number)}function Zn(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 Qn={rankDirection:`TB`,nodeSeparation:50,rankSeparation:50,edgeSeparation:10,align:void 0,nodeWidth:100,nodeHeight:40,curvedEdges:!1,padding:20,arrowShape:`normal`,arrowSize:10};function $n(e){return e.length?e.map((e,t)=>`${t===0?`M`:`L`} ${e.x} ${e.y}`).join(` `):``}function er(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){e[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 tr(e){let{nodes:t,edges:n,configuration:r}=e,i=C(null),a=C(null),o=`dag-arrow-${c()}`;function l(e,t,n){a.value=null,i.value=null;let r={...Qn,...n},l=new E({multigraph:!0,compound:!0});l.setGraph({rankdir:r.rankDirection,nodesep:r.nodeSeparation,ranksep:r.rankSeparation,edgesep:r.edgeSeparation,align:r.align}),e.forEach(e=>{l.setNode(e.id,{label:e.label,width:e.width??r.nodeWidth,height:e.height??r.nodeHeight})}),t.forEach(e=>{l.setEdge(e.from,e.to,{weight:e.weight??1,minlen:e.minLength??1,arrowShape:r.arrowShape??`normal`})}),Tn(l);let u=e.map(e=>{let t=l.node(e.id);return{id:e.id,label:e.label,x:t.x,y:t.y,width:t.width,height:t.height,original:e}}),d=l.edges().map(e=>{let n=l.edge(e),i=n.points||[];if(!i.length)return null;let a=r.curvedEdges?er(i):$n(i),s=r.arrowShape===`undirected`?null:`url(#${o})`,u=t.find(t=>t?.from===e.v&&t?.to===e.w);return{id:`${e.v}->${e.w}->${c()}`,from:e.v,to:e.w,points:i,pathData:a,markerEnd:s,original:{...u,...n}}}).filter(Boolean),f=r.padding;if(!u.length){i.value={nodes:[],edges:d,viewBox:`0 0 0 0`,arrowShape:r.arrowShape,arrowSize:r.arrowSize};return}let p=u.flatMap(e=>[e.x-e.width/2,e.x+e.width/2]),m=u.flatMap(e=>[e.y-e.height/2,e.y+e.height/2]),h=Math.min(...p)-f,g=Math.max(...p)+f,ee=Math.min(...m)-f,te=Math.max(...m)+f;i.value={nodes:u,edges:d.map(e=>({...e,midpoint:e.pathData?s(e.pathData):{x:0,y:0}})),viewBox:`${h} ${ee} ${g-h} ${te-ee}`,arrowShape:r.arrowShape,arrowSize:r.arrowSize}}return Ie(()=>{try{l(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:()=>{l(T(t)||[],T(n)||[],T(r)||{})}}}var nr=/* @__PURE__ */ e({default:()=>Ir}),rr=[`id`],ir=[`id`],ar={key:1,class:`dag-chart-error`},or={style:{position:`relative`}},sr=[`viewBox`,`xmlns`,`aria-describedby`],cr={key:0},lr=[`id`,`width`,`height`],ur=[`cx`,`cy`,`r`,`fill`],dr=[`x`,`y`,`width`,`height`,`fill`],fr={key:2},pr=[`id`,`markerWidth`,`markerHeight`,`refX`,`refY`],mr=[`d`,`fill`,`stroke`],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__*/ se({__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:s,emit:se}){let Ie=Ce(()=>import(`./PenAndPaper-IMw576MC.js`).then(e=>e.t)),ze=Ce(()=>import(`./UserOptions-DTxMeZv3.js`).then(e=>e.n)),Be=Ce(()=>import(`./PackageVersion-CdkxOy58.js`).then(e=>e.t)),{vue_ui_dag:Ve}=ee(),E=e,He=se,D=C(null),O=C(c()),Ue=C(null),We=C(null),Ge=C(null),Ke=C(0),qe=C(0),Je=C(!1),Ye=C(!1),k=C(null),A=C(null),j=C(null),M=C(null),Xe=C(null),N=C(`pointer`),Ze=C(!1),P=C(gt()),F=_(()=>P.value.style.chart.nodes),Qe=_(()=>P.value.style.chart.edges),I=_(()=>P.value.style.chart.midpoints),L=_(()=>P.value.style.chart);h({config:()=>P.value,dataset:()=>E.dataset,component:`VueUiDag`,rules:[g.noHint]});let $e=_(()=>P.value.userOptions.useCursorPointer),et=C(P.value.style.chart.width),tt=C(P.value.style.chart.height),nt=C({x:0,y:0}),R=C(null),z=C(null),rt=C({left:`0px`,top:`0px`}),it=C(`top`),B=C(!1),at=C({x:0,y:0}),ot=C({x:0,y:0}),V=C(null),H=C(null),st=C({left:`0px`,top:`0px`}),ct=C(`top`),U=C(!1),W=C(!1),{svgRef:G}=pe({config:L.value.title}),{userOptionsVisible:lt,setUserOptionsVisibility:ut,keepUserOptionState:dt}=fe({config:P.value}),K=C(P.value.style.chart.layout.rankDirection),ft=_(()=>d({defaultConfig:{userOptions:{show:!1},style:{chart:{backgroundColor:`#99999930`,nodes:{stroke:`#CCCCCC`,backgroundColor:`#DDDDDD50`},edges:{stroke:`#CCCCCC`},midpoints:{stroke:`#CCCCCC`,fill:`#CCCCCC`}}}},userConfig:P.value.skeletonConfig??{}})),{loading:pt,FINAL_DATASET:mt,manualLoading:ht}=ne({...Pe(E),FINAL_CONFIG:P,prepareConfig:gt,skeletonDataset:E.config?.skeletonDataset??{nodes:[{id:`A`,label:``},{id:`B`,label:``},{id:`C`,label:``}],edges:[{from:`A`,to:`B`},{from:`A`,to:`C`}]},skeletonConfig:d({defaultConfig:P.value,userConfig:ft.value})});function gt(){return de(E.config,Ve,ge)}let _t=_(()=>P.value.debug);je(async()=>{m(E.dataset)&&(u({componentName:`VueUiDag`,type:`dataset`,debug:_t.value}),Ye.value=!1,ht.value=!0),(!E.dataset.nodes||E.dataset.nodes.length===0)&&(u({componentName:`VueUiDag`,type:`datasetAttributeEmpty`,property:`nodes`,index:0,debug:_t.value}),Ye.value=!1,ht.value=!0),Ye.value=!0,await Ee(),rn()}),Fe(()=>E.config,async e=>{pt.value||(P.value=gt()),lt.value=!P.value.userOptions.showOnChartHover,Ke.value+=1,K.value=L.value.layout.rankDirection,et.value=L.value.width,tt.value=L.value.height,Pt.value=L.value.zoom.active,await Ee(),rn()},{deep:!0});let{isPrinting:vt,isImaging:yt,generatePdf:bt,generateImage:xt}=te({elementId:`dag_${O.value}`,fileName:L.value.title.text||`vue-ui-dag`,options:P.value.userOptions.print}),St=_(()=>L.value.backgroundColor),Ct=_(()=>L.value.title),{isCallbackImaging:wt,isCallbackSvg:Tt,generateSvg:Et,onGenerateImage:Dt}=ie({svg:G,title:Ct,legend:null,legendItems:null,backgroundColor:St,getSvgCallback:()=>P.value.userOptions.callbacks.svg,generateImage:xt});function Ot(){Je.value=!0,ut(!0)}function kt(){ut(!1),Je.value=!1}function At({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`}}}let{layoutData:q,lastError:jt,arrowMarkerIdentifier:Mt}=tr({nodes:_(()=>mt.value.nodes.map(e=>({...e,backgroundColor:e.backgroundColor?o(e.backgroundColor):F.value.backgroundColor,color:e.color?o(e.color):F.value.labels.color}))),edges:_(()=>mt.value.edges),configuration:_(()=>({...L.value.layout,rankDirection:K.value}))});function J(e){return q.value?q.value.nodes.find(t=>t.id===e):null}_(()=>{if(!q.value)return[];let e=Qe.value.stroke,t=/* @__PURE__ */ new Set;return q.value.edges.forEach(n=>{t.add({id:n.id,from:n.from,to:n.to,color:n.original?.color||e})}),Array.from(t)});let Nt=_(()=>{let e=et.value,t=tt.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}}),Pt=C(L.value.zoom.active),{viewBox:Y,resetZoom:Ft,setInitialViewBox:It,scale:Lt,zoomByFactor:Rt}=me(G,{x:0,y:0,width:100,height:100},1,Pt,()=>{B.value=!1}),zt=null;async function Bt(e,{smooth:t=!0,duration:n=300,zoomReset:r=!1,zoom:i=null}={}){let o=J(e);if(!o)return!1;let s=Y.value;if(!s)return!1;let c={x:Number(s.x),y:Number(s.y),width:Number(s.width),height:Number(s.height)},l=Lt.value,u=c.width,d=c.height,p=l;if(Number.isFinite(i)&&i>0||r){Ft(!1);let e=Y.value,t=Number.isFinite(i)&&i>0?i/100:1;u=Number(e.width)/t,d=Number(e.height)/t,p=t,Y.value={...c},Lt.value=l}let m=Number(o.x),h=Number(o.y);if(!Number.isFinite(c.x)||!Number.isFinite(c.y)||!Number.isFinite(c.width)||!Number.isFinite(c.height)||!Number.isFinite(u)||!Number.isFinite(d)||!Number.isFinite(m)||!Number.isFinite(h))return!1;let g={x:m-u/2,y:h-d/2,width:u,height:d};if(zt!==null&&(cancelAnimationFrame(zt),zt=null),B.value=!1,!t||n<=0)return Y.value=g,Lt.value=p,!0;let ee=performance.now();function te(e){let t=Math.min((e-ee)/n,1),r=f(t);Y.value={x:a(c.x,g.x,r),y:a(c.y,g.y,r),width:a(c.width,g.width,r),height:a(c.height,g.height,r)},Lt.value=a(l,p,r),t<1?zt=requestAnimationFrame(te):(Y.value=g,Lt.value=p,zt=null)}return zt=requestAnimationFrame(te),!0}function Vt(){Pt.value=!Pt.value}function Ht(){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=Nt.value;u&&(u.width!==null&&(o=u.width),u.height!==null&&(s=u.height),c=n-(o-i)/2,l=r-(s-a)/2),It({x:c,y:l,width:o,height:s},{overwriteCurrentIfNotZoomed:!0})}Fe(()=>q.value&&q.value.viewBox,()=>{Ht()},{immediate:!0}),Fe(()=>Nt.value,()=>{Ht()}),Fe(()=>W.value,e=>{Pt.value=!e});let Ut=_(()=>{let e=Y.value;return e?`${e.x} ${e.y} ${e.width} ${e.height}`:`0 0 0 0`}),X=C(!1);function Wt(e){X.value=e,qe.value+=1}function Gt(){W.value=!W.value}function Kt(){Rt(Fr,!0)}function qt(){Rt(1/Fr,!0)}let Jt=[`TB`,`RL`,`BT`,`LR`];function Yt(){K.value=Jt[(Jt.indexOf(K.value)+1)%Jt.length],Ft(),He(`rotate`,K.value)}let Xt=At({tooltipRef:z,isVisibleRef:U,anchorRef:nt,styleRef:rt,placementRef:it,isNode:!1}),Zt=At({tooltipRef:H,isVisibleRef:B,anchorRef:at,styleRef:st,placementRef:ct,offsetRef:ot}),Z=C(null);async function Qt(e){He(`onMidpointEnter`,e);let t=G.value;if(!t||!e?.midpoint)return;let n=t.createSVGPoint();n.x=e.midpoint.x,n.y=e.midpoint.y;let r=t.getScreenCTM();if(!r)return;let i=n.matrixTransform(r);nt.value={x:i.x,y:i.y},R.value=e,U.value=!0,I.value.selectedEdge.animated===!0&&(Z.value=e.id,un()),await Ee(),Xt()}function Q(){U.value=!1,R.value=null,He(`onMidpointLeave`),I.value.selectedEdge.animated===!0&&(Z.value=null,un())}async function $t(e){if(He(`onNodeClick`,e),!F.value.tooltip.showOnClick)return;let t=G.value;if(!t)return;let n=t.createSVGPoint();n.x=e.x,n.y=e.y;let r=t.getScreenCTM();if(!r)return;let i=n.matrixTransform(r),a=L.value.layout.nodeWidth,o=L.value.layout.nodeHeight,s=r.a,c=r.d,l=a*s,u=o*c;ot.value={x:l/2,y:u/2},at.value={x:i.x,y:i.y},V.value=e,B.value=!0,await Ee(),Zt()}function en(){B.value=!1,V.value=null}function tn(e){if(!(B.value||U.value))return;let t=H.value;if(t&&t.contains(e.target))return;let n=z.value;if(n&&n.contains(e.target))return;let r=G.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}en(),Q(),Ze.value||Ln()}function nn(e){e.key===`Escape`&&(B.value&&en(),U.value&&Q())}je(()=>{document.addEventListener(`mousedown`,tn),document.addEventListener(`keydown`,nn)}),Ae(()=>{document.removeEventListener(`mousedown`,tn),document.removeEventListener(`keydown`,nn),k.value&&(A.value&&k.value.unobserve(A.value),k.value.disconnect())});function rn(){if(!P.value.responsive){k.value&&(A.value&&k.value.unobserve(A.value),k.value.disconnect(),k.value=null,A.value=null);return}let e=ce(()=>{if(!D.value)return;let{width:e,height:t}=le({chart:D.value,title:L.value.title.text?Ue.value:null,legend:L.value.controls.show?Ge.value?.$el:null,source:We.value});requestAnimationFrame(()=>{et.value=Math.max(.1,e),tt.value=Math.max(.1,t-12)})});k.value&&(A.value&&k.value.unobserve(A.value),k.value.disconnect()),k.value=new ResizeObserver(e),A.value=D.value?D.value.parentNode:null,A.value&&k.value.observe(A.value),e()}function an(e,t={}){let{direction:n=-1,mode:r=`oneLapNearest`,dasharray:i=null}=t;if(!e||typeof e.getTotalLength!=`function`)return _t.value&&console.warn(`VueUiDag @getIdealDashoffsetDelta: invalid path element`,e),0;let a=e.getTotalLength(),o=d(i??e.getAttribute(`stroke-dasharray`)??(typeof getComputedStyle==`function`?getComputedStyle(e).strokeDasharray:``));if(!Number.isFinite(o)||o<=0)return n*a;let s=Math.max(1,Math.round(a/o)),c=Math.max(1,Math.ceil(a/o)),l=Math.max(1,Math.floor(a/o)),u;return u=r===`pattern`?o:r===`oneLapCeil`?c*o:r===`oneLapFloor`?l*o:s*o,n*u;function d(e){if(!e||e===`none`)return NaN;let t=String(e).replace(/,/g,` `).trim().split(/\s+/).map(e=>Number.parseFloat(e)).filter(e=>Number.isFinite(e));if(!t.length)return NaN;let n=t.reduce((e,t)=>e+t,0);return t.length%2==1?n*2:n}}let on=C(/* @__PURE__ */ new Map),sn=C(/* @__PURE__ */ new Map);function cn(e){return function(t){t?on.value.set(e,t):on.value.delete(e)}}function ln(){sn.value.forEach(e=>{try{e.cancel()}catch{}}),sn.value.clear()}function un(){ln();let e=q.value?.edges??[];if(!e.length)return;let t=Qe.value.animations,n=Number(t.referenceDistance)>0?Number(t.referenceDistance):24;e.forEach(e=>{let r=I.value.selectedEdge.animated===!0&&Z.value!=null&&e.id===Z.value,i=!!e?.original?.animated||!!e?.animated||r,a=on.value.get(e.id);if(!a)return;if(!i){a.style.strokeDasharray=`0`,a.style.strokeDashoffset=`0`;return}let o=e?.original?.dasharray??t.dasharray;a.style.strokeDasharray=String(o),a.style.strokeDashoffset=`0`;let s=![void 0,null].includes(e?.original?.animationDirection),c=![void 0,null].includes(t.animationDirection),l=an(a,{direction:s?Number(e.original.animationDirection):c?Number(t.animationDirection):-1,mode:`oneLapNearest`,dasharray:String(o)}),u=e?.original?.animationDurationMs??t.animationDurationMs??1e3,d=Number(u),f=Number.isFinite(d)&&d>0?n/d:n/1e3,p=Math.max(1,Math.round(Math.abs(l)/Math.max(1e-9,f))),m=a.animate([{strokeDashoffset:0},{strokeDashoffset:l}],{duration:p,iterations:1/0,easing:`linear`});sn.value.set(e.id,m)})}Fe(()=>q.value&&q.value.edges,async()=>{await Ee(),un()},{deep:!0,immediate:!0}),Ae(()=>{ln()});async function dn({scale:e=2}={}){if(!D.value)return;let{width:t,height:n}=D.value.getBoundingClientRect(),r=t/n,{imageUri:i,base64:a}=await ae({domElement:D.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 fn=_(()=>{let e=Number(L.value.layout.nodeHeight);return Number.isFinite(e)&&e>0?e/L.value.backgroundPattern.spacingRatio:12}),pn=_(()=>fn.value*(L.value.backgroundPattern.dotRadiusRatio/100)),$=C(null),mn=null,hn=0;function gn(e){mn&&=(clearTimeout(mn),null),$.value!==e&&($.value=e,(F.value.selected.downstreamEdges.animated===!0||F.value.selected.upstreamEdges.animated===!0)&&un())}function _n(e){N.value=`pointer`,Z.value=null,gn(e)}async function vn(e){N.value=`pointer`,$.value=null,await Qt(e)}function yn(e){let t=++hn;mn&&clearTimeout(mn),mn=setTimeout(()=>{t===hn&&$.value===e&&($.value=null,(F.value.selected.downstreamEdges.animated===!0||F.value.selected.upstreamEdges.animated===!0)&&un())},20)}function bn(e){let t=e.from===$.value,n=e.to===$.value,r=M.value===`midpoint`&&j.value===e.id,i=Z.value===e.id||R.value?.id===e.id||r,a=e.original.color??Qe.value.stroke;return i&&I.value.selectedEdge.stroke!=null?a=I.value.selectedEdge.stroke:t&&F.value.selected.downstreamEdges.stroke!=null?a=F.value.selected.downstreamEdges.stroke:n&&F.value.selected.upstreamEdges.stroke!=null&&(a=F.value.selected.upstreamEdges.stroke),e.animated=t&&F.value.selected.downstreamEdges.animated===!0||n&&F.value.selected.upstreamEdges.animated===!0||r&&I.value.selectedEdge.animated===!0?!0:(q.value?.edges.find(t=>t.id===e.id))?.original?.animated??!1,{d:e.pathData,fill:`none`,stroke:a,"stroke-width":Qe.value.strokeWidth*(i||e.from===$.value?2:1),"stroke-linecap":`round`,"stroke-linejoin":`round`}}function xn(e){return M.value===`node`&&j.value===e}function Sn(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 Cn(e){let t=e.from===$.value,n=e.to===$.value,r=M.value===`midpoint`&&j.value===e.id,i=Z.value===e.id||R.value?.id===e.id||r,a=e.original.color??Qe.value.stroke;return i&&I.value.selectedEdge.stroke!=null?a=I.value.selectedEdge.stroke:t&&F.value.selected.downstreamEdges.stroke!=null?a=F.value.selected.downstreamEdges.stroke:n&&F.value.selected.upstreamEdges.stroke!=null&&(a=F.value.selected.upstreamEdges.stroke),{cx:e?.midpoint?.x,cy:e?.midpoint?.y,r:I.value.radius,fill:r?I.value.selectedEdge.stroke??I.value.fill:I.value.fill,stroke:a,"stroke-width":Qe.value.strokeWidth*(i||e.from===$.value?2:1)}}function wn(e){let t=e.from===$.value,n=e.to===$.value,r=M.value===`midpoint`&&j.value===e.id,i=Z.value===e.id||R.value?.id===e.id||r,a=e.color??e.original?.color??Qe.value.stroke;return i&&I.value.selectedEdge.stroke!=null?a=I.value.selectedEdge.stroke:t&&F.value.selected.downstreamEdges.stroke!=null?a=F.value.selected.downstreamEdges.stroke:n&&F.value.selected.upstreamEdges.stroke!=null&&(a=F.value.selected.upstreamEdges.stroke),a}function Tn(e){return`${Mt}-${String(e).replace(/[^a-zA-Z0-9_-]/g,`_`)}`}function En(){return q.value}async function Dn(){if(He(`copyAlt`,{config:P.value,dataset:mt.value}),!P.value.userOptions.callbacks.altCopy){console.warn("Vue Data UI - A callback must be set for `altCopy` in userOptions.");return}await Promise.resolve(P.value.userOptions.callbacks.altCopy({config:P.value,dataset:mt.value}))}let On=_(()=>(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})):[]),An=_(()=>[...On.value,...kn.value].sort((e,t)=>e.x===t.x?e.y-t.y:e.x-t.x)),jn=_(()=>{let e=/* @__PURE__ */ new Map;return An.value.forEach((t,n)=>{e.set(`${t.type}:${t.id}`,n)}),e}),Mn=_(()=>{let e=q.value?.nodes??[],t=q.value?.edges??[];return{headers:[P.value.a11y?.translations?.node??`Node`,P.value.a11y?.translations?.parents??`Parents`,P.value.a11y?.translations?.children??`Children`],rows:e.map(e=>{let n=t.filter(t=>t.to===e.id).map(e=>J(e.from)?.label??e.from).join(`, `),r=t.filter(t=>t.from===e.id).map(e=>J(e.to)?.label??e.to).join(`, `);return[e.label??e.id,n||`—`,r||`—`]})}});function Nn(e){return`${e.type}:${e.id}`}function Pn(){return j.value==null||M.value==null?null:An.value.find(e=>e.id===j.value&&e.type===M.value)??null}async function Fn(e){if(e){if(e.type===`node`){Q();return}e.type===`midpoint`&&(en(),await Qt(e.raw))}}function In(e){if(e){if(j.value=e.id,M.value=e.type,Xe.value=jn.value.get(Nn(e))??null,e.type===`node`){gn(e.id),Z.value=null;return}e.type===`midpoint`&&($.value=null,Z.value=e.id,I.value.selectedEdge.animated===!0&&un())}}function Ln(){j.value=null,M.value=null,Xe.value=null,B.value||($.value=null),U.value||(Z.value=null,I.value.selectedEdge.animated===!0&&un())}function Rn(){Ze.value=!0,Ln()}function zn(){Ze.value=!1,en(),Q(),Ln()}function Bn(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 Vn(e,t){let n=An.value.filter(t=>Nn(t)!==Nn(e));if(!n.length)return null;let r=null,i=1/0;return n.forEach(n=>{let a=Bn(e,n,t);a<i&&(i=a,r=n)}),r||(t===`right`||t===`down`?An.value[0]??null:An.value[An.value.length-1]??null)}async function Hn(e){e&&(N.value=`keyboard`,e.type===`node`&&(Q(),await $t(e.raw)))}async function Un(e){if(!G.value||W.value||document.activeElement!==G.value||!An.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){en(),Q(),Ln();return}let s=Pn();if(a){if(!s)return;s.type===`node`&&await Hn(s);return}if(!s){let e=An.value[0];if(!e)return;In(e),await Fn(e);return}let c=null;n?c=Vn(s,`right`):t?c=Vn(s,`left`):i?c=Vn(s,`down`):r&&(c=Vn(s,`up`)),c&&(en(),Q(),In(c),await Fn(c))}return s({getData:En,getImage:dn,generatePdf:bt,generateSvg:Et,generateImage:xt,toggleAnnotator:Gt,toggleFullscreen:Wt,zoomIn:Kt,zoomOut:qt,resetZoom:Ft,switchDirection:Yt,copyAlt:Dn,focusOnNode:Bt}),(e,a)=>(S(),b(`div`,{class:De(`vue-data-ui-component vue-ui-dag ${X.value?`vue-data-ui-wrapper-fullscreen`:``} ${P.value.responsive?`vue-ui-dag-responsive`:``}`),id:`dag_${O.value}`,ref_key:`dagChart`,ref:D,style:ke({fontFamily:P.value.style.fontFamily,backgroundColor:L.value.backgroundColor,padding:`0.5rem`}),onMouseenter:Ot,onMouseleave:kt},[x(`div`,{id:`chart-instructions-${O.value}`,class:`sr-only`},[x(`p`,null,Ne(P.value.a11y.translations.keyboardNavigation),1)],8,ir),Mn.value?.rows?.length?(S(),v(ue,{key:0,uid:O.value,head:Mn.value.headers,body:Mn.value.rows,notice:P.value.a11y.translations.tableAvailable,caption:P.value.a11y.translations.tableCaption},null,8,[`uid`,`head`,`body`,`notice`,`caption`])):y(``,!0),T(jt)?(S(),b(`div`,ar,Ne(String(T(jt))),1)):y(``,!0),P.value.userOptions.buttons.annotator?(S(),v(T(Ie),{key:2,svgRef:T(G),backgroundColor:L.value.backgroundColor,color:L.value.color,active:W.value,isCursorPointer:$e.value,palette:P.value.userOptions.annotatorPalette,onClose:Gt},be({_:2},[Me(T(n),n=>({name:n,fn:Le(r=>[w(e.$slots,n,Oe(we(T(t)(n,r))),void 0,!0)])}))]),1032,[`svgRef`,`backgroundColor`,`color`,`active`,`isCursorPointer`,`palette`])):y(``,!0),P.value.userOptions.show&&Ye.value&&(T(dt)||T(lt))?(S(),v(T(ze),{ref:`userOptionsRef`,key:`user_option_${qe.value}`,backgroundColor:L.value.backgroundColor,color:L.value.color,isPrinting:T(vt),isImaging:T(yt),uid:O.value,hasTooltip:!1,hasTable:!1,hasXls:!1,hasLabel:!1,hasPdf:P.value.userOptions.buttons.pdf,hasImg:P.value.userOptions.buttons.img,hasSvg:P.value.userOptions.buttons.svg,hasFullscreen:P.value.userOptions.buttons.fullscreen,hasAltCopy:P.value.userOptions.buttons.altCopy,isFullscreen:X.value,chartElement:D.value,position:P.value.userOptions.position,titles:{...P.value.userOptions.buttonTitles},hasAnnotator:P.value.userOptions.buttons.annotator,isAnnotation:W.value,callbacks:P.value.userOptions.callbacks,printScale:P.value.userOptions.print.scale,hasZoom:P.value.userOptions.buttons.zoom,isZoom:Pt.value,isCursorPointer:$e.value,onToggleFullscreen:Wt,onGeneratePdf:T(bt),onGenerateImage:T(Dt),onGenerateSvg:T(Et),onToggleAnnotator:Gt,onToggleZoom:Vt,onCopyAlt:Dn,style:ke({visibility:T(dt)?T(lt)?`visible`:`hidden`:`visible`})},be({_:2},[Me(T(r)(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,Oe(we(T(i)(t,n))),void 0,!0)])}))]),1032,[`backgroundColor`,`color`,`isPrinting`,`isImaging`,`uid`,`hasPdf`,`hasImg`,`hasSvg`,`hasFullscreen`,`hasAltCopy`,`isFullscreen`,`chartElement`,`position`,`titles`,`hasAnnotator`,`isAnnotation`,`callbacks`,`printScale`,`hasZoom`,`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(oe,{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`&&!T(pt)&&L.value.controls.show?(S(),v(he,{key:5,ref_key:`zoomControls`,ref:Ge,config:P.value,scale:T(Lt),isFullscreen:X.value,withDirection:``,onZoomIn:Kt,onZoomOut:qt,onResetZoom:a[0]||=()=>T(Ft)(!0),onSwitchDirection:Yt},null,8,[`config`,`scale`,`isFullscreen`])):y(``,!0),x(`div`,or,[T(q)?(S(),b(`svg`,{key:0,ref_key:`svgRef`,ref:G,class:De({"vue-ui-dag-svg":!0,"vue-data-ui-loading":T(pt)}),viewBox:Ut.value,xmlns:T(p),style:ke({backgroundColor:L.value.backgroundColor,height:`100%`,width:`100%`}),tabindex:`0`,"aria-describedby":`chart-instructions-${O.value}`,onFocus:Rn,onBlur:zn,onKeydown:Un},[Se(T(Be)),L.value.backgroundPattern.show?(S(),b(`defs`,cr,[x(`pattern`,{id:`dag_bg_pattern_${O.value}`,patternUnits:`userSpaceOnUse`,width:fn.value,height:fn.value},[w(e.$slots,`background-pattern`,Oe(we({x:fn.value/2,y:fn.value/2,color:L.value.backgroundPattern.dotColor})),()=>[x(`circle`,{cx:fn.value/2,cy:fn.value/2,r:pn.value,fill:L.value.backgroundPattern.dotColor},null,8,ur)],!0)],8,lr)])):y(``,!0),L.value.backgroundPattern.show?(S(),b(`rect`,{key:1,x:T(Y)?.x??0,y:T(Y)?.y??0,width:T(Y)?.width??0,height:T(Y)?.height??0,fill:`url(#dag_bg_pattern_${O.value})`,style:ke({pointerEvents:`none`,opacity:L.value.backgroundPattern.opacity})},null,12,dr)):y(``,!0),T(q).arrowShape===`undirected`?y(``,!0):(S(),b(`defs`,fr,[(S(!0),b(_e,null,Me(T(q).edges,e=>(S(),b(`marker`,{key:`marker_${e.id}`,id:Tn(e.id),markerWidth:T(q).arrowSize,markerHeight:T(q).arrowSize,refX:T(q).arrowSize-3,refY:T(q).arrowSize/2,orient:`auto`,markerUnits:`strokeWidth`},[T(q).arrowShape===`normal`?(S(),b(`path`,{key:0,d:`M 0 0 L ${T(q).arrowSize} ${T(q).arrowSize/2} L 0 ${T(q).arrowSize} Z`,fill:wn(e),stroke:wn(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,mr)):(S(),b(`path`,{key:1,d:`M 0 0 L ${T(q).arrowSize} ${T(q).arrowSize/2} L 0 ${T(q).arrowSize} L ${T(q).arrowSize/3} ${T(q).arrowSize/2} Z`,fill:wn(e),stroke:wn(e),"stroke-width":`0`,style:{transition:`stroke 0.2s ease-in-out,
4
4
  fill 0.2s ease-in-out,
@@ -1 +1 @@
1
- import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{n as t,t as n}from"./annotationSlots-BRR85CqJ.js";import{n as r,t as i}from"./userOptionsSlots-DYuo-E5m.js";import{X as a}from"./lib-zDxoqrgo.js";import{n as ee,t as te}from"./useHints-BH9r_0Vd.js";import{t as ne}from"./useConfig-CKdzPrcf.js";import{t as re}from"./usePrinter-CnyKPIFM.js";import{t as ie}from"./useNestedProp-CT9phgWx.js";import{t as o}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{t as ae}from"./useUserOptionState-CXlFnwPv.js";import{t as oe}from"./UserOptions-D65t74CM.js";import{n as se}from"./PenAndPaper-DvJJaeU2.js";import{Fragment as s,computed as c,createBlock as l,createCommentVNode as u,createElementBlock as d,createElementVNode as f,createSlots as p,defineAsyncComponent as m,guardReactiveProps as h,mergeProps as ce,normalizeClass as le,normalizeProps as g,normalizeStyle as _,openBlock as v,ref as y,renderList as b,renderSlot as x,resolveDynamicComponent as ue,unref as S,useCssVars as de,watch as C,withCtx as w}from"vue";var fe=/* @__PURE__ */ e({default:()=>E}),pe=[`id`],me=[`onMousedown`,`onTouchstart`],he=[`onMousedown`,`onTouchstart`],ge=[`onMousedown`,`onTouchstart`],_e=[`onMousedown`,`onTouchstart`],ve=[`onMousedown`,`onTouchstart`],T=1,E=/*#__PURE__*/ o({__name:`vue-ui-dashboard`,props:{dataset:Array,config:Object},emits:[`change`,`copyAlt`],setup(e,{expose:o,emit:fe}){de(e=>({ed4ebd52:je.value,v1504d0e3:Me.value}));let E={VueDataUi:m(()=>import(`./vue-data-ui-BG41UScx.js`).then(e=>e.n)),VueUi3dBar:m(()=>import(`./vue-ui-3d-bar-DiaiNy-k.js`).then(e=>e.n)),VueUiAccordion:m(()=>import(`./vue-ui-accordion-Dy5OVFKr.js`).then(e=>e.n)),VueUiAgePyramid:m(()=>import(`./vue-ui-age-pyramid-OeUr1yxi.js`).then(e=>e.n)),VueUiAnnotator:m(()=>import(`./vue-ui-annotator-DA_xAFql.js`).then(e=>e.n)),VueUiCandlestick:m(()=>import(`./vue-ui-candlestick-CdAZuNxo.js`).then(e=>e.n)),VueUiChestnut:m(()=>import(`./vue-ui-chestnut-B2aNXFNO.js`).then(e=>e.n)),VueUiDigits:m(()=>import(`./vue-ui-digits-CL9SuIEI.js`).then(e=>e.n)),VueUiDonut:m(()=>import(`./vue-ui-donut-DaYxdQmP.js`).then(e=>e.n)),VueUiDonutEvolution:m(()=>import(`./vue-ui-donut-evolution-T8cRXKRQ.js`).then(e=>e.n)),VueUiDumbbell:m(()=>import(`./vue-ui-dumbbell-B6HJxEZp.js`).then(e=>e.n)),VueUiFlow:m(()=>import(`./vue-ui-flow-BlTCVFr3.js`).then(e=>e.n)),VueUiGalaxy:m(()=>import(`./vue-ui-galaxy-B3nuI6E8.js`).then(e=>e.n)),VueUiGauge:m(()=>import(`./vue-ui-gauge-BwTP65O4.js`).then(e=>e.n)),VueUiHeatmap:m(()=>import(`./vue-ui-heatmap-CTdeoar7.js`).then(e=>e.n)),VueUiKpi:m(()=>import(`./vue-ui-kpi-DVcLXGqG.js`).then(e=>e.n)),VueUiMiniLoader:m(()=>import(`./vue-ui-mini-loader-CX0Dx9tT.js`).then(e=>e.n)),VueUiMolecule:m(()=>import(`./vue-ui-molecule-B13qVX71.js`).then(e=>e.n)),VueUiMoodRadar:m(()=>import(`./vue-ui-mood-radar-C1BtB8lg.js`).then(e=>e.n)),VueUiNestedDonuts:m(()=>import(`./vue-ui-nested-donuts-B90yrlJG.js`).then(e=>e.n)),VueUiOnion:m(()=>import(`./vue-ui-onion-UMVO2DE_.js`).then(e=>e.n)),VueUiParallelCoordinatePlot:m(()=>import(`./vue-ui-parallel-coordinate-plot-C0ofFivm.js`).then(e=>e.n)),VueUiQuadrant:m(()=>import(`./vue-ui-quadrant-CPG6yAiu.js`).then(e=>e.n)),VueUiQuickChart:m(()=>import(`./vue-ui-quick-chart-BTPb-Iz8.js`).then(e=>e.n)),VueUiRadar:m(()=>import(`./vue-ui-radar-Hd-pE9ih.js`).then(e=>e.n)),VueUiRating:m(()=>import(`./vue-ui-rating-C_YxQYa_.js`).then(e=>e.n)),VueUiRelationCircle:m(()=>import(`./vue-ui-relation-circle-CHYG7ZJl.js`).then(e=>e.n)),VueUiRings:m(()=>import(`./vue-ui-rings-B-Hb13Uu.js`).then(e=>e.n)),VueUiScatter:m(()=>import(`./vue-ui-scatter-BTgvOmuo.js`).then(e=>e.n)),VueUiSkeleton:m(()=>import(`./vue-ui-skeleton-B-Acw3CC.js`).then(e=>e.n)),VueUiSmiley:m(()=>import(`./vue-ui-smiley-Ciwqt6ek.js`).then(e=>e.n)),VueUiSparkHistogram:m(()=>import(`./vue-ui-sparkhistogram-ClFyDez-.js`).then(e=>e.n)),VueUiSparkStackbar:m(()=>import(`./vue-ui-sparkstackbar-B2f0ePMg.js`).then(e=>e.n)),VueUiSparkTrend:m(()=>import(`./vue-ui-spark-trend-CYqy6c0S.js`).then(e=>e.n)),VueUiSparkbar:m(()=>import(`./vue-ui-sparkbar-CTXIgjmP.js`).then(e=>e.n)),VueUiSparkgauge:m(()=>import(`./vue-ui-sparkgauge-CObOL6s2.js`).then(e=>e.n)),VueUiSparkline:m(()=>import(`./vue-ui-sparkline-DP_nYlW8.js`).then(e=>e.n)),VueUiStripPlot:m(()=>import(`./vue-ui-strip-plot-gFNC4r-X.js`).then(e=>e.n)),VueUiTable:m(()=>import(`./vue-ui-table-Br2JgD_L.js`).then(e=>e.n)),VueUiTableHeatmap:m(()=>import(`./vue-ui-table-heatmap-Btu2ejF4.js`).then(e=>e.n)),VueUiTableSparkline:m(()=>import(`./vue-ui-table-sparkline-B9mYHAxp.js`).then(e=>e.n)),VueUiThermometer:m(()=>import(`./vue-ui-thermometer-C6u1eLfo.js`).then(e=>e.n)),VueUiTimer:m(()=>import(`./vue-ui-timer-DLgsfB1U.js`).then(e=>e.n)),VueUiTiremarks:m(()=>import(`./vue-ui-tiremarks-8B9uE1Bx.js`).then(e=>e.n)),VueUiTreemap:m(()=>import(`./vue-ui-treemap-C4Mot-Os.js`).then(e=>e.n)),VueUiVerticalBar:m(()=>import(`./vue-ui-horizontal-bar-qqF7pL7U.js`).then(e=>e.n)),VueUiHorizontalBar:m(()=>import(`./vue-ui-horizontal-bar-qqF7pL7U.js`).then(e=>e.n)),VueUiWaffle:m(()=>import(`./vue-ui-waffle-BwcwNpf7.js`).then(e=>e.n)),VueUiWheel:m(()=>import(`./vue-ui-wheel-B3OGCXg7.js`).then(e=>e.n)),VueUiWordCloud:m(()=>import(`./vue-ui-word-cloud-BPIyMBXq.js`).then(e=>e.n)),VueUiXy:m(()=>import(`./vue-ui-xy-DSyKSn4L.js`).then(e=>e.n)),VueUiXyCanvas:m(()=>import(`./vue-ui-xy-canvas-CaxxiKSa.js`).then(e=>e.n)),VueUiCarouselTable:m(()=>import(`./vue-ui-carousel-table-ihGH0LDH.js`).then(e=>e.n)),VueUiGizmo:m(()=>import(`./vue-ui-gizmo-CNHcBsku.js`).then(e=>e.n)),VueUiStackbar:m(()=>import(`./vue-ui-stackbar-nMWHZ-f0.js`).then(e=>e.n)),VueUiStackline:m(()=>import(`./vue-ui-stackline-B95y6Zc5.js`).then(e=>e.n)),VueUiBullet:m(()=>import(`./vue-ui-bullet-B9lcCTVb.js`).then(e=>e.n)),VueUiFunnel:m(()=>import(`./vue-ui-funnel-WgLFJadZ.js`).then(e=>e.n)),VueUiHistoryPlot:m(()=>import(`./vue-ui-history-plot-C-9uH-Uj.js`).then(e=>e.n)),VueUiCirclePack:m(()=>import(`./vue-ui-circle-pack-BWHVImkS.js`).then(e=>e.n)),VueUiWorld:m(()=>import(`./vue-ui-world-Cp0DeauH.js`).then(e=>e.n)),VueUiChord:m(()=>import(`./vue-ui-chord-fAckHfOW.js`).then(e=>e.n)),VueUiRidgeline:m(()=>import(`./vue-ui-ridgeline-DS1Gvljt.js`).then(e=>e.n)),VueUiDag:m(()=>import(`./vue-ui-dag-a0fNoIcJ.js`).then(e=>e.n))},{vue_ui_dashboard:ye}=ne(),be=y(null),xe=y(null),D=y(null),O=e,k=c(()=>ie({userConfig:O.config,defaultConfig:ye}));ee({config:()=>k.value,dataset:()=>O.dataset,component:`VueUiDashboard`,rules:[te.noHint]});let A=c(()=>k.value.userOptions.useCursorPointer),j=y(a()),M=y(k.value.locked);function Se(){M.value=!M.value}C(()=>O.config,()=>{M.value=k.value.locked,Le.value=!k.value.userOptions.showOnChartHover});function N(){return O.dataset.map((e,t)=>({...e,index:t}))}let P=y(N());C(()=>O.dataset,()=>{P.value=N()});let F=c(()=>P.value.map(e=>({...e,resolvedComponent:typeof e.component==`string`?E[e.component]:e.component}))),I=y(null),L=y(null),R=y({x:0,y:0}),z=y({x:0,y:0}),B=y(null),V=y(!1),H=y(null),U=y(!1);function W(e){let t=e.target;(t.tagName===`INPUT`&&t.type===`range`||t.classList.contains(`range-handle`))&&(U.value=!0)}function G(e){let t=e.target;t.tagName===`INPUT`&&t.type===`range`&&(U.value=!1)}let{isPrinting:Ce,isImaging:we,generatePdf:K,generateImage:Te}=re({elementId:`vue-ui-dashboard_${j.value}`,fileName:k.value.userOptions.print.filename||`dashboard`,options:{...k.value.userOptions.print,aspectRatio:k.value.style.board.aspectRatio}});function Ee(e){if(!M.value&&(V.value=!0,H.value=e,L.value===null)){I.value=e,R.value={x:event.clientX,y:event.clientY};let t=P.value[e],n=100-t.width,r=100-t.height;t.left<0&&(t.left=0),t.top<0&&(t.top=0),t.left>n&&(t.left=n),t.top>r&&(t.top=r),t.left<0&&(t.left=0),t.top<0&&(t.top=0),t.left+t.width>100&&(t.left=100-t.width),t.top+t.height>100&&(t.top=100-t.height)}}function q(e,t){V.value=!0,H.value=e,L.value={index:e,direction:t};let n=P.value[e];z.value={x:event.clientX,y:event.clientY,initialWidth:n.width,initialHeight:n.height}}function J(e,t,n){if(L.value.direction.includes(`top`)){let t=e.height-n/B.value.offsetHeight*100;t>=T&&(e.top+=n/B.value.offsetHeight*100,e.height=t)}if(L.value.direction.includes(`bottom`)){let t=e.height+n/B.value.offsetHeight*100;t>=T&&(e.height=t)}if(L.value.direction.includes(`left`)){let n=e.width-t/B.value.offsetWidth*100;n>=T&&(e.left+=t/B.value.offsetWidth*100,e.width=n)}if(L.value.direction.includes(`right`)){let n=e.width+t/B.value.offsetWidth*100;n>=T&&(e.width=n)}}function De(e){if(!(M.value||U.value)){if(V.value=!0,I.value!==null){let t=P.value[I.value],n=e.clientX-R.value.x,r=e.clientY-R.value.y,i=t.left+n/B.value.offsetWidth*100,a=t.top+r/B.value.offsetHeight*100;i>=0&&a>=0&&i+t.width<=100&&a+t.height<=100&&(t.left=i,t.top=a),R.value={x:e.clientX,y:e.clientY}}if(L.value!==null){let t=P.value[L.value.index];J(t,e.clientX-z.value.x,e.clientY-z.value.y),z.value={x:e.clientX,y:e.clientY}}}}let Y=fe;C(P,e=>{e&&!V.value&&Y(`change`,P.value)},{deep:!0});function Oe(){I.value=null,L.value=null,V.value=!1,H.value=null,P.value.forEach(e=>{e.left=Math.round(e.left/100*100),e.top=Math.round(e.top/100*100),e.width=Math.round(e.width/100*100),e.height=Math.round(e.height/100*100)})}function ke(e){M.value||U.value||(V.value=!0,H.value=e,L.value===null&&(I.value=e,R.value={x:event.touches[0].clientX,y:event.touches[0].clientY}))}function X(e,t,n){if(V.value=!0,H.value=e,L.value===null){L.value={index:e,direction:t};let r=P.value[e];z.value={x:n.touches[0].clientX,y:n.touches[0].clientY,initialWidth:r.width,initialHeight:r.height}}}function Z(e){if(V.value=!0,e.preventDefault(),L.value!==null){let t=P.value[L.value.index];J(t,e.touches[0].clientX-z.value.x,e.touches[0].clientY-z.value.y),z.value={x:e.touches[0].clientX,y:e.touches[0].clientY}}}function Ae(e){if(!(M.value||U.value)&&(V.value=!0,e.preventDefault(),I.value!==null)){let t=P.value[I.value],n=e.touches[0].clientX-R.value.x,r=e.touches[0].clientY-R.value.y,i=t.left+n/B.value.offsetWidth*100,a=t.top+r/B.value.offsetHeight*100;i>=0&&a>=0&&i+t.width<=100&&a+t.height<=100&&(t.left=i,t.top=a),R.value={x:e.touches[0].clientX,y:e.touches[0].clientY}}}function Q(){V.value=!1,H.value=null,I.value=null,L.value=null,P.value.forEach(e=>{e.left=Math.round(e.left/100*100),e.top=Math.round(e.top/100*100),e.width=Math.round(e.width/100*100),e.height=Math.round(e.height/100*100)})}let je=c(()=>k.value.style.item.borderColor),Me=c(()=>k.value.style.resizeHandles.backgroundColor),Ne=c(()=>k.value.style.board.aspectRatio),Pe=c(()=>k.value.style.board.backgroundColor),Fe=c(()=>k.value.style.board.border);function Ie(){return P.value}let{userOptionsVisible:Le,setUserOptionsVisibility:Re,keepUserOptionState:ze}=ae({config:k.value}),$=y(!1);function Be(){$.value=!$.value}function Ve(){Re(!0)}function He(){Re(!1)}async function Ue(){if(Y(`copyAlt`,{config:k.value,dataset:F.value}),!k.value.userOptions.callbacks.altCopy){console.warn("Vue Data UI - A callback must be set for `altCopy` in userOptions.");return}await Promise.resolve(k.value.userOptions.callbacks.altCopy({config:k.value,dataset:F.value}))}return o({generatePdf:K,getItemsPositions:Ie,toggleLock:Se,copyAlt:Ue}),(e,a)=>(v(),d(`div`,{id:`vue-ui-dashboard_${j.value}`,onMousedown:W,onMouseup:G,onTouchstart:W,onTouchend:G,onMouseenter:Ve,onMouseleave:He,ref_key:`dashboardRef`,ref:be,style:{position:`relative`},class:`vue-data-ui-component`},[f(`div`,{class:`vue-ui-dashboard-container`,ref_key:`dashboardContainer`,ref:B,style:_(`outline:${Fe.value}; background:${Pe.value}; aspect-ratio:${Ne.value};${$.value?`pointer-events:none`:``}`)},[f(`div`,{class:`vue-ui-dashboard-grid-container`,ref:`container`,onMousemove:De,onMouseup:Oe,onTouchmove:Ae,onTouchend:Q,style:_(`background:${k.value.style.board.backgroundColor}`)},[a[4]||=f(`div`,{class:`vue-ui-dashboard-grid`},null,-1),(v(!0),d(s,null,b(F.value,(t,n)=>(v(),d(`div`,{key:t.id,class:le({"vue-ui-dashboard-grid-item":!0,"vue-ui-dashboard-grid-item--locked":M.value}),style:_({width:`${t.width}%`,height:`${t.height}%`,left:`${t.left}%`,top:`${t.top}%`,cursor:`move`,boxShadow:H.value===n?`0 6px 12px -3px rgba(0,0,0,0.3)`:``,zIndex:H.value===n?F.value.length+1:t.index,backgroundColor:k.value.style.item.backgroundColor}),onMousedown:e=>Ee(n),onTouchstart:e=>ke(n,t)},[M.value?u(``,!0):(v(),d(s,{key:0},[f(`div`,{class:`vue-ui-dashboard-resize-handle vue-ui-dashboard-top-left`,onMousedown:e=>q(n,`top-left`),onTouchstart:e=>X(n,`top-left`,e),onTouchmove:a[0]||=e=>Z(e),onTouchend:Q},null,40,he),f(`div`,{class:`vue-ui-dashboard-resize-handle vue-ui-dashboard-top-right`,onMousedown:e=>q(n,`top-right`),onTouchstart:e=>X(n,`top-right`,e),onTouchmove:a[1]||=e=>Z(e),onTouchend:Q},null,40,ge),f(`div`,{class:`vue-ui-dashboard-resize-handle vue-ui-dashboard-bottom-left`,onMousedown:e=>q(n,`bottom-left`),onTouchstart:e=>X(n,`bottom-left`,e),onTouchmove:a[2]||=e=>Z(e),onTouchend:Q},null,40,_e),f(`div`,{class:`vue-ui-dashboard-resize-handle vue-ui-dashboard-bottom-right`,onMousedown:e=>q(n,`bottom-right`),onTouchstart:e=>X(n,`bottom-right`,e),onTouchmove:a[3]||=e=>Z(e),onTouchend:Q},null,40,ve)],64)),x(e.$slots,`top`,{item:t,index:n},void 0,!0),t.resolvedComponent?(v(),l(ue(t.resolvedComponent),ce({key:1,ref_for:!0},t.props),null,16)):x(e.$slots,`content`,{item:t,index:n,left:t.left,top:t.top,height:t.height,width:t.width},void 0,!0,2),x(e.$slots,`bottom`,{item:t,index:n},void 0,!0)],46,me))),128))],36)],4),(v(),d(`svg`,{style:_({width:`100%`,height:`100%`,pointerEvents:`none`,position:`absolute`,top:0,left:0,zIndex:F.value.length+1}),ref_key:`svgRef`,ref:D},null,4)),k.value.userOptions.buttons.annotator&&B.value&&D.value?(v(),l(se,{key:0,color:k.value.style.board.color,backgroundColor:k.value.style.board.backgroundColor,active:$.value,svgRef:D.value,isCursorPointer:A.value,onClose:Be,style:_({zIndex:F.value.length+1}),palette:k.value.userOptions.annotatorPalette},p({_:2},[b(S(n),n=>({name:n,fn:w(r=>[x(e.$slots,n,g(h(S(t)(n,r))),void 0,!0)])}))]),1032,[`color`,`backgroundColor`,`active`,`svgRef`,`isCursorPointer`,`style`,`palette`])):u(``,!0),(k.value.allowPrint||k.value.userOptions.show)&&(k.value.userOptions.buttons.pdf||k.value.userOptions.buttons.img)?(v(),l(oe,{key:1,ref_key:`userOptionsRef`,ref:xe,backgroundColor:k.value.style.board.backgroundColor,color:k.value.style.board.color,isPrinting:S(Ce),isImaging:S(we),uid:j.value,position:k.value.userOptions.position,hasTooltip:!1,hasPdf:k.value.userOptions.buttons.pdf,hasImg:k.value.userOptions.buttons.img,hasXls:!1,hasTable:!1,hasLabel:!1,hasFullscreen:!1,hasAltCopy:k.value.userOptions.buttons.altCopy,chartElement:B.value,callbacks:k.value.userOptions.callbacks,hasAnnotator:k.value.userOptions.buttons.annotator,isAnnotation:$.value,printScale:k.value.userOptions.print.scale,titles:{...k.value.userOptions.buttonTitles},isCursorPointer:A.value,onGeneratePdf:S(K),onGenerateImage:S(Te),onToggleAnnotator:Be,onCopyAlt:Ue,style:_({visibility:S(ze)?S(Le)?`visible`:`hidden`:`visible`,zIndex:F.value.length+1})},p({_:2},[b(S(r)(e.$slots,`menuIcon optionPdf optionImg optionAnnotator optionAltCopy custom-menu-before custom-menu-after`),t=>({name:t,fn:w(n=>[x(e.$slots,t,g(h(S(i)(t,n))),void 0,!0)])}))]),1032,[`backgroundColor`,`color`,`isPrinting`,`isImaging`,`uid`,`position`,`hasPdf`,`hasImg`,`hasAltCopy`,`chartElement`,`callbacks`,`hasAnnotator`,`isAnnotation`,`printScale`,`titles`,`isCursorPointer`,`onGeneratePdf`,`onGenerateImage`,`style`])):u(``,!0)],40,pe))}},[[`__scopeId`,`data-v-96466658`]]);export{fe as n,E as t};
1
+ import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{n as t,t as n}from"./annotationSlots-BRR85CqJ.js";import{n as r,t as i}from"./userOptionsSlots-DYuo-E5m.js";import{X as a}from"./lib-CV_IANZ6.js";import{n as ee,t as te}from"./useHints-BH9r_0Vd.js";import{t as ne}from"./useConfig-CKdzPrcf.js";import{t as re}from"./usePrinter-hLW3cv4N.js";import{t as ie}from"./useNestedProp-CB186vF2.js";import{t as o}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{t as ae}from"./useUserOptionState-CXlFnwPv.js";import{t as oe}from"./UserOptions-DTxMeZv3.js";import{n as se}from"./PenAndPaper-IMw576MC.js";import{Fragment as s,computed as c,createBlock as l,createCommentVNode as u,createElementBlock as d,createElementVNode as f,createSlots as p,defineAsyncComponent as m,guardReactiveProps as h,mergeProps as ce,normalizeClass as le,normalizeProps as g,normalizeStyle as _,openBlock as v,ref as y,renderList as b,renderSlot as x,resolveDynamicComponent as ue,unref as S,useCssVars as de,watch as C,withCtx as w}from"vue";var fe=/* @__PURE__ */ e({default:()=>E}),pe=[`id`],me=[`onMousedown`,`onTouchstart`],he=[`onMousedown`,`onTouchstart`],ge=[`onMousedown`,`onTouchstart`],_e=[`onMousedown`,`onTouchstart`],ve=[`onMousedown`,`onTouchstart`],T=1,E=/*#__PURE__*/ o({__name:`vue-ui-dashboard`,props:{dataset:Array,config:Object},emits:[`change`,`copyAlt`],setup(e,{expose:o,emit:fe}){de(e=>({ed4ebd52:je.value,v1504d0e3:Me.value}));let E={VueDataUi:m(()=>import(`./vue-data-ui-DyYgLIZN.js`).then(e=>e.n)),VueUi3dBar:m(()=>import(`./vue-ui-3d-bar-BZAoyWkc.js`).then(e=>e.n)),VueUiAccordion:m(()=>import(`./vue-ui-accordion-BNvevckx.js`).then(e=>e.n)),VueUiAgePyramid:m(()=>import(`./vue-ui-age-pyramid-DkA6vpU3.js`).then(e=>e.n)),VueUiAnnotator:m(()=>import(`./vue-ui-annotator-DuQME4Hh.js`).then(e=>e.n)),VueUiCandlestick:m(()=>import(`./vue-ui-candlestick-DZgxl4mW.js`).then(e=>e.n)),VueUiChestnut:m(()=>import(`./vue-ui-chestnut-Bo1h5rBt.js`).then(e=>e.n)),VueUiDigits:m(()=>import(`./vue-ui-digits-CXKKmfGj.js`).then(e=>e.n)),VueUiDonut:m(()=>import(`./vue-ui-donut-DLDUpjDU.js`).then(e=>e.n)),VueUiDonutEvolution:m(()=>import(`./vue-ui-donut-evolution-BxMTdE5G.js`).then(e=>e.n)),VueUiDumbbell:m(()=>import(`./vue-ui-dumbbell-C8rNwdz0.js`).then(e=>e.n)),VueUiFlow:m(()=>import(`./vue-ui-flow-Dru76A2O.js`).then(e=>e.n)),VueUiGalaxy:m(()=>import(`./vue-ui-galaxy-sBEH18Xj.js`).then(e=>e.n)),VueUiGauge:m(()=>import(`./vue-ui-gauge-Do3RN8ne.js`).then(e=>e.n)),VueUiHeatmap:m(()=>import(`./vue-ui-heatmap-DlmJRsM8.js`).then(e=>e.n)),VueUiKpi:m(()=>import(`./vue-ui-kpi-C-eed3jO.js`).then(e=>e.n)),VueUiMiniLoader:m(()=>import(`./vue-ui-mini-loader-CElmv_iF.js`).then(e=>e.n)),VueUiMolecule:m(()=>import(`./vue-ui-molecule-BeyQWZU9.js`).then(e=>e.n)),VueUiMoodRadar:m(()=>import(`./vue-ui-mood-radar-Bh0kHfiZ.js`).then(e=>e.n)),VueUiNestedDonuts:m(()=>import(`./vue-ui-nested-donuts-FlnJfDaF.js`).then(e=>e.n)),VueUiOnion:m(()=>import(`./vue-ui-onion-BjhSpjtW.js`).then(e=>e.n)),VueUiParallelCoordinatePlot:m(()=>import(`./vue-ui-parallel-coordinate-plot-CHV6XDti.js`).then(e=>e.n)),VueUiQuadrant:m(()=>import(`./vue-ui-quadrant-BaKSTJDv.js`).then(e=>e.n)),VueUiQuickChart:m(()=>import(`./vue-ui-quick-chart-Nc2mVlle.js`).then(e=>e.n)),VueUiRadar:m(()=>import(`./vue-ui-radar-BzUfkLlC.js`).then(e=>e.n)),VueUiRating:m(()=>import(`./vue-ui-rating-BwWXvbAg.js`).then(e=>e.n)),VueUiRelationCircle:m(()=>import(`./vue-ui-relation-circle-nAZEg-BL.js`).then(e=>e.n)),VueUiRings:m(()=>import(`./vue-ui-rings-BOti0NGb.js`).then(e=>e.n)),VueUiScatter:m(()=>import(`./vue-ui-scatter-CCNMggyo.js`).then(e=>e.n)),VueUiSkeleton:m(()=>import(`./vue-ui-skeleton-DI7pcimU.js`).then(e=>e.n)),VueUiSmiley:m(()=>import(`./vue-ui-smiley-D70sJZWl.js`).then(e=>e.n)),VueUiSparkHistogram:m(()=>import(`./vue-ui-sparkhistogram-D8S_P_P4.js`).then(e=>e.n)),VueUiSparkStackbar:m(()=>import(`./vue-ui-sparkstackbar-ZN8LXzoV.js`).then(e=>e.n)),VueUiSparkTrend:m(()=>import(`./vue-ui-spark-trend-BVtfEalS.js`).then(e=>e.n)),VueUiSparkbar:m(()=>import(`./vue-ui-sparkbar-CdsLI7Ke.js`).then(e=>e.n)),VueUiSparkgauge:m(()=>import(`./vue-ui-sparkgauge-wmj5Wnnp.js`).then(e=>e.n)),VueUiSparkline:m(()=>import(`./vue-ui-sparkline-BjsJnS_9.js`).then(e=>e.n)),VueUiStripPlot:m(()=>import(`./vue-ui-strip-plot-D7kjJ3Qh.js`).then(e=>e.n)),VueUiTable:m(()=>import(`./vue-ui-table-CaFVLHxE.js`).then(e=>e.n)),VueUiTableHeatmap:m(()=>import(`./vue-ui-table-heatmap-Ctf7Rhqo.js`).then(e=>e.n)),VueUiTableSparkline:m(()=>import(`./vue-ui-table-sparkline-C0I0cXBS.js`).then(e=>e.n)),VueUiThermometer:m(()=>import(`./vue-ui-thermometer-B6og15Al.js`).then(e=>e.n)),VueUiTimer:m(()=>import(`./vue-ui-timer-DgXvO2Q7.js`).then(e=>e.n)),VueUiTiremarks:m(()=>import(`./vue-ui-tiremarks-Dh6fZ454.js`).then(e=>e.n)),VueUiTreemap:m(()=>import(`./vue-ui-treemap-7JuvN6P_.js`).then(e=>e.n)),VueUiVerticalBar:m(()=>import(`./vue-ui-horizontal-bar-BRDBJEl1.js`).then(e=>e.n)),VueUiHorizontalBar:m(()=>import(`./vue-ui-horizontal-bar-BRDBJEl1.js`).then(e=>e.n)),VueUiWaffle:m(()=>import(`./vue-ui-waffle-BqvGzfse.js`).then(e=>e.n)),VueUiWheel:m(()=>import(`./vue-ui-wheel-SdwJqKA7.js`).then(e=>e.n)),VueUiWordCloud:m(()=>import(`./vue-ui-word-cloud-1WVV_k12.js`).then(e=>e.n)),VueUiXy:m(()=>import(`./vue-ui-xy-rGHSI1am.js`).then(e=>e.n)),VueUiXyCanvas:m(()=>import(`./vue-ui-xy-canvas-CegvS9RR.js`).then(e=>e.n)),VueUiCarouselTable:m(()=>import(`./vue-ui-carousel-table-BB7DsTUt.js`).then(e=>e.n)),VueUiGizmo:m(()=>import(`./vue-ui-gizmo-eic6xLjB.js`).then(e=>e.n)),VueUiStackbar:m(()=>import(`./vue-ui-stackbar-Dx_EN3pT.js`).then(e=>e.n)),VueUiStackline:m(()=>import(`./vue-ui-stackline-DW-oxJvA.js`).then(e=>e.n)),VueUiBullet:m(()=>import(`./vue-ui-bullet-BVs8JX8S.js`).then(e=>e.n)),VueUiFunnel:m(()=>import(`./vue-ui-funnel-D_u1h5S9.js`).then(e=>e.n)),VueUiHistoryPlot:m(()=>import(`./vue-ui-history-plot-BJjnkWcT.js`).then(e=>e.n)),VueUiCirclePack:m(()=>import(`./vue-ui-circle-pack-Bm7e2YNh.js`).then(e=>e.n)),VueUiWorld:m(()=>import(`./vue-ui-world-DjMy_utm.js`).then(e=>e.n)),VueUiChord:m(()=>import(`./vue-ui-chord-B6_veyvO.js`).then(e=>e.n)),VueUiRidgeline:m(()=>import(`./vue-ui-ridgeline-DxLZg1E2.js`).then(e=>e.n)),VueUiDag:m(()=>import(`./vue-ui-dag-BiN_AnLo.js`).then(e=>e.n))},{vue_ui_dashboard:ye}=ne(),be=y(null),xe=y(null),D=y(null),O=e,k=c(()=>ie({userConfig:O.config,defaultConfig:ye}));ee({config:()=>k.value,dataset:()=>O.dataset,component:`VueUiDashboard`,rules:[te.noHint]});let A=c(()=>k.value.userOptions.useCursorPointer),j=y(a()),M=y(k.value.locked);function Se(){M.value=!M.value}C(()=>O.config,()=>{M.value=k.value.locked,Le.value=!k.value.userOptions.showOnChartHover});function N(){return O.dataset.map((e,t)=>({...e,index:t}))}let P=y(N());C(()=>O.dataset,()=>{P.value=N()});let F=c(()=>P.value.map(e=>({...e,resolvedComponent:typeof e.component==`string`?E[e.component]:e.component}))),I=y(null),L=y(null),R=y({x:0,y:0}),z=y({x:0,y:0}),B=y(null),V=y(!1),H=y(null),U=y(!1);function W(e){let t=e.target;(t.tagName===`INPUT`&&t.type===`range`||t.classList.contains(`range-handle`))&&(U.value=!0)}function G(e){let t=e.target;t.tagName===`INPUT`&&t.type===`range`&&(U.value=!1)}let{isPrinting:Ce,isImaging:we,generatePdf:K,generateImage:Te}=re({elementId:`vue-ui-dashboard_${j.value}`,fileName:k.value.userOptions.print.filename||`dashboard`,options:{...k.value.userOptions.print,aspectRatio:k.value.style.board.aspectRatio}});function Ee(e){if(!M.value&&(V.value=!0,H.value=e,L.value===null)){I.value=e,R.value={x:event.clientX,y:event.clientY};let t=P.value[e],n=100-t.width,r=100-t.height;t.left<0&&(t.left=0),t.top<0&&(t.top=0),t.left>n&&(t.left=n),t.top>r&&(t.top=r),t.left<0&&(t.left=0),t.top<0&&(t.top=0),t.left+t.width>100&&(t.left=100-t.width),t.top+t.height>100&&(t.top=100-t.height)}}function q(e,t){V.value=!0,H.value=e,L.value={index:e,direction:t};let n=P.value[e];z.value={x:event.clientX,y:event.clientY,initialWidth:n.width,initialHeight:n.height}}function J(e,t,n){if(L.value.direction.includes(`top`)){let t=e.height-n/B.value.offsetHeight*100;t>=T&&(e.top+=n/B.value.offsetHeight*100,e.height=t)}if(L.value.direction.includes(`bottom`)){let t=e.height+n/B.value.offsetHeight*100;t>=T&&(e.height=t)}if(L.value.direction.includes(`left`)){let n=e.width-t/B.value.offsetWidth*100;n>=T&&(e.left+=t/B.value.offsetWidth*100,e.width=n)}if(L.value.direction.includes(`right`)){let n=e.width+t/B.value.offsetWidth*100;n>=T&&(e.width=n)}}function De(e){if(!(M.value||U.value)){if(V.value=!0,I.value!==null){let t=P.value[I.value],n=e.clientX-R.value.x,r=e.clientY-R.value.y,i=t.left+n/B.value.offsetWidth*100,a=t.top+r/B.value.offsetHeight*100;i>=0&&a>=0&&i+t.width<=100&&a+t.height<=100&&(t.left=i,t.top=a),R.value={x:e.clientX,y:e.clientY}}if(L.value!==null){let t=P.value[L.value.index];J(t,e.clientX-z.value.x,e.clientY-z.value.y),z.value={x:e.clientX,y:e.clientY}}}}let Y=fe;C(P,e=>{e&&!V.value&&Y(`change`,P.value)},{deep:!0});function Oe(){I.value=null,L.value=null,V.value=!1,H.value=null,P.value.forEach(e=>{e.left=Math.round(e.left/100*100),e.top=Math.round(e.top/100*100),e.width=Math.round(e.width/100*100),e.height=Math.round(e.height/100*100)})}function ke(e){M.value||U.value||(V.value=!0,H.value=e,L.value===null&&(I.value=e,R.value={x:event.touches[0].clientX,y:event.touches[0].clientY}))}function X(e,t,n){if(V.value=!0,H.value=e,L.value===null){L.value={index:e,direction:t};let r=P.value[e];z.value={x:n.touches[0].clientX,y:n.touches[0].clientY,initialWidth:r.width,initialHeight:r.height}}}function Z(e){if(V.value=!0,e.preventDefault(),L.value!==null){let t=P.value[L.value.index];J(t,e.touches[0].clientX-z.value.x,e.touches[0].clientY-z.value.y),z.value={x:e.touches[0].clientX,y:e.touches[0].clientY}}}function Ae(e){if(!(M.value||U.value)&&(V.value=!0,e.preventDefault(),I.value!==null)){let t=P.value[I.value],n=e.touches[0].clientX-R.value.x,r=e.touches[0].clientY-R.value.y,i=t.left+n/B.value.offsetWidth*100,a=t.top+r/B.value.offsetHeight*100;i>=0&&a>=0&&i+t.width<=100&&a+t.height<=100&&(t.left=i,t.top=a),R.value={x:e.touches[0].clientX,y:e.touches[0].clientY}}}function Q(){V.value=!1,H.value=null,I.value=null,L.value=null,P.value.forEach(e=>{e.left=Math.round(e.left/100*100),e.top=Math.round(e.top/100*100),e.width=Math.round(e.width/100*100),e.height=Math.round(e.height/100*100)})}let je=c(()=>k.value.style.item.borderColor),Me=c(()=>k.value.style.resizeHandles.backgroundColor),Ne=c(()=>k.value.style.board.aspectRatio),Pe=c(()=>k.value.style.board.backgroundColor),Fe=c(()=>k.value.style.board.border);function Ie(){return P.value}let{userOptionsVisible:Le,setUserOptionsVisibility:Re,keepUserOptionState:ze}=ae({config:k.value}),$=y(!1);function Be(){$.value=!$.value}function Ve(){Re(!0)}function He(){Re(!1)}async function Ue(){if(Y(`copyAlt`,{config:k.value,dataset:F.value}),!k.value.userOptions.callbacks.altCopy){console.warn("Vue Data UI - A callback must be set for `altCopy` in userOptions.");return}await Promise.resolve(k.value.userOptions.callbacks.altCopy({config:k.value,dataset:F.value}))}return o({generatePdf:K,getItemsPositions:Ie,toggleLock:Se,copyAlt:Ue}),(e,a)=>(v(),d(`div`,{id:`vue-ui-dashboard_${j.value}`,onMousedown:W,onMouseup:G,onTouchstart:W,onTouchend:G,onMouseenter:Ve,onMouseleave:He,ref_key:`dashboardRef`,ref:be,style:{position:`relative`},class:`vue-data-ui-component`},[f(`div`,{class:`vue-ui-dashboard-container`,ref_key:`dashboardContainer`,ref:B,style:_(`outline:${Fe.value}; background:${Pe.value}; aspect-ratio:${Ne.value};${$.value?`pointer-events:none`:``}`)},[f(`div`,{class:`vue-ui-dashboard-grid-container`,ref:`container`,onMousemove:De,onMouseup:Oe,onTouchmove:Ae,onTouchend:Q,style:_(`background:${k.value.style.board.backgroundColor}`)},[a[4]||=f(`div`,{class:`vue-ui-dashboard-grid`},null,-1),(v(!0),d(s,null,b(F.value,(t,n)=>(v(),d(`div`,{key:t.id,class:le({"vue-ui-dashboard-grid-item":!0,"vue-ui-dashboard-grid-item--locked":M.value}),style:_({width:`${t.width}%`,height:`${t.height}%`,left:`${t.left}%`,top:`${t.top}%`,cursor:`move`,boxShadow:H.value===n?`0 6px 12px -3px rgba(0,0,0,0.3)`:``,zIndex:H.value===n?F.value.length+1:t.index,backgroundColor:k.value.style.item.backgroundColor}),onMousedown:e=>Ee(n),onTouchstart:e=>ke(n,t)},[M.value?u(``,!0):(v(),d(s,{key:0},[f(`div`,{class:`vue-ui-dashboard-resize-handle vue-ui-dashboard-top-left`,onMousedown:e=>q(n,`top-left`),onTouchstart:e=>X(n,`top-left`,e),onTouchmove:a[0]||=e=>Z(e),onTouchend:Q},null,40,he),f(`div`,{class:`vue-ui-dashboard-resize-handle vue-ui-dashboard-top-right`,onMousedown:e=>q(n,`top-right`),onTouchstart:e=>X(n,`top-right`,e),onTouchmove:a[1]||=e=>Z(e),onTouchend:Q},null,40,ge),f(`div`,{class:`vue-ui-dashboard-resize-handle vue-ui-dashboard-bottom-left`,onMousedown:e=>q(n,`bottom-left`),onTouchstart:e=>X(n,`bottom-left`,e),onTouchmove:a[2]||=e=>Z(e),onTouchend:Q},null,40,_e),f(`div`,{class:`vue-ui-dashboard-resize-handle vue-ui-dashboard-bottom-right`,onMousedown:e=>q(n,`bottom-right`),onTouchstart:e=>X(n,`bottom-right`,e),onTouchmove:a[3]||=e=>Z(e),onTouchend:Q},null,40,ve)],64)),x(e.$slots,`top`,{item:t,index:n},void 0,!0),t.resolvedComponent?(v(),l(ue(t.resolvedComponent),ce({key:1,ref_for:!0},t.props),null,16)):x(e.$slots,`content`,{item:t,index:n,left:t.left,top:t.top,height:t.height,width:t.width},void 0,!0,2),x(e.$slots,`bottom`,{item:t,index:n},void 0,!0)],46,me))),128))],36)],4),(v(),d(`svg`,{style:_({width:`100%`,height:`100%`,pointerEvents:`none`,position:`absolute`,top:0,left:0,zIndex:F.value.length+1}),ref_key:`svgRef`,ref:D},null,4)),k.value.userOptions.buttons.annotator&&B.value&&D.value?(v(),l(se,{key:0,color:k.value.style.board.color,backgroundColor:k.value.style.board.backgroundColor,active:$.value,svgRef:D.value,isCursorPointer:A.value,onClose:Be,style:_({zIndex:F.value.length+1}),palette:k.value.userOptions.annotatorPalette},p({_:2},[b(S(n),n=>({name:n,fn:w(r=>[x(e.$slots,n,g(h(S(t)(n,r))),void 0,!0)])}))]),1032,[`color`,`backgroundColor`,`active`,`svgRef`,`isCursorPointer`,`style`,`palette`])):u(``,!0),(k.value.allowPrint||k.value.userOptions.show)&&(k.value.userOptions.buttons.pdf||k.value.userOptions.buttons.img)?(v(),l(oe,{key:1,ref_key:`userOptionsRef`,ref:xe,backgroundColor:k.value.style.board.backgroundColor,color:k.value.style.board.color,isPrinting:S(Ce),isImaging:S(we),uid:j.value,position:k.value.userOptions.position,hasTooltip:!1,hasPdf:k.value.userOptions.buttons.pdf,hasImg:k.value.userOptions.buttons.img,hasXls:!1,hasTable:!1,hasLabel:!1,hasFullscreen:!1,hasAltCopy:k.value.userOptions.buttons.altCopy,chartElement:B.value,callbacks:k.value.userOptions.callbacks,hasAnnotator:k.value.userOptions.buttons.annotator,isAnnotation:$.value,printScale:k.value.userOptions.print.scale,titles:{...k.value.userOptions.buttonTitles},isCursorPointer:A.value,onGeneratePdf:S(K),onGenerateImage:S(Te),onToggleAnnotator:Be,onCopyAlt:Ue,style:_({visibility:S(ze)?S(Le)?`visible`:`hidden`:`visible`,zIndex:F.value.length+1})},p({_:2},[b(S(r)(e.$slots,`menuIcon optionPdf optionImg optionAnnotator optionAltCopy custom-menu-before custom-menu-after`),t=>({name:t,fn:w(n=>[x(e.$slots,t,g(h(S(i)(t,n))),void 0,!0)])}))]),1032,[`backgroundColor`,`color`,`isPrinting`,`isImaging`,`uid`,`position`,`hasPdf`,`hasImg`,`hasAltCopy`,`chartElement`,`callbacks`,`hasAnnotator`,`isAnnotation`,`printScale`,`titles`,`isCursorPointer`,`onGeneratePdf`,`onGenerateImage`,`style`])):u(``,!0)],40,pe))}},[[`__scopeId`,`data-v-96466658`]]);export{fe as n,E as t};
@@ -1,4 +1,4 @@
1
- import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{X as t,t as n}from"./lib-zDxoqrgo.js";import{n as r,t as i}from"./useHints-BH9r_0Vd.js";import{t as a}from"./useConfig-CKdzPrcf.js";import{t as o}from"./useNestedProp-CT9phgWx.js";import{t as s}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{n as c}from"./PackageVersion-D6pKL176.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 _,ref as v,renderList as y,toDisplayString as b,unref as x}from"vue";var S={key:0},C=[`d`,`fill`],w=[`d`,`fill`],T=[`d`,`fill`],E=[`d`,`fill`],D=[`d`,`fill`],O=[`d`,`fill`],k=[`d`,`fill`],A={key:1},j=[`cx`,`cy`,`r`,`fill`],M={__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=v({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(()=>2*(t.thickness||1)),i=u(()=>[void 0,null].includes(t.quanta)?n.value.X:n.value[t.quanta]);return(t,n)=>(_(),p(l,null,[[void 0,null,`.`].includes(e.quanta)?f(``,!0):(_(),p(`g`,S,[m(`path`,{d:`M ${e.x} ${e.y}
1
+ import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{X as t,t as n}from"./lib-CV_IANZ6.js";import{n as r,t as i}from"./useHints-BH9r_0Vd.js";import{t as a}from"./useConfig-CKdzPrcf.js";import{t as o}from"./useNestedProp-CB186vF2.js";import{t as s}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{n as c}from"./PackageVersion-CdkxOy58.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 _,ref as v,renderList as y,toDisplayString as b,unref as x}from"vue";var S={key:0},C=[`d`,`fill`],w=[`d`,`fill`],T=[`d`,`fill`],E=[`d`,`fill`],D=[`d`,`fill`],O=[`d`,`fill`],k=[`d`,`fill`],A={key:1},j=[`cx`,`cy`,`r`,`fill`],M={__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=v({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(()=>2*(t.thickness||1)),i=u(()=>[void 0,null].includes(t.quanta)?n.value.X:n.value[t.quanta]);return(t,n)=>(_(),p(l,null,[[void 0,null,`.`].includes(e.quanta)?f(``,!0):(_(),p(`g`,S,[m(`path`,{d:`M ${e.x} ${e.y}
2
2
  L ${e.x+r.value} ${e.y-r.value}
3
3
  L ${e.x+26-r.value} ${e.y-r.value}
4
4
  L ${e.x+26} ${e.y}
@@ -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,h as d,i as f,in as p,j as m,nn as h,p as g,st as _,t as v}from"./lib-zDxoqrgo.js";import{t as y}from"./useConfig-CKdzPrcf.js";import{t as b}from"./vue_ui_donut-T5PeOqvf.js";import{_ as x,a as S,c as C,d as w,g as T,i as E,l as D,n as O,o as k,p as A,r as j,s as ee,t as te,u as M,v as N}from"./render-common-DOYi0f4Z.js";var{vue_ui_donut:ne}=y();function re({config:e={}}={}){let t=e??{},r=p({userConfig:t,defaultConfig:ne}),i=r.theme;if(!i)return{...r,customPalette:r.customPalette?.length?r.customPalette:n};let a=p({userConfig:b[i]||{},defaultConfig:r}),o=p({userConfig:t,defaultConfig:a});return{...o,customPalette:o.customPalette?.length?o.customPalette:h[i]||n}}function P(e,t=0){let n=Number(e);return Number.isFinite(n)?n:t}function F(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+P(t,0),0):Array.isArray(e.series)?e.series.reduce((e,t)=>e+P(t,0),0):P(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,t)=>e.source?.ghost&&!t.source?.ghost?1:t.source?.ghost&&!e.source?.ghost?-1:t.value-e.value).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:P(F(o,`chart.padding.top`,24),24),right:P(F(o,`chart.padding.right`,24),24),bottom:P(F(o,`chart.padding.bottom`,24),24),left:P(F(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=P(F(o,`chart.donut.radius`,f),f),m=P(F(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:P(F(o,`chart.donut.startAngle`,-90),-90)}),additionalSvgContent:i,svgTitle:a}}var ue=o();function I(){return ue}function L(e){return k(S(e,`backgroundColor`,`#FFFFFF`),`#FFFFFF`)}function de(e){return x(e?.value??e?.absoluteValue??0,0)}function R(e){return T(e.series).filter(e=>!e?.ghost).map((e,t)=>({...e,value:Math.abs(de(e)),color:k(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 z(e){return e.reduce((e,t)=>e+Math.abs(x(t.value,0)),0)}function fe(e){let t=S(e,`title`,{}),n=A(t,`subtitle`,{});if(!t.text)return 0;let r=x(t.fontSize,20),i=n.show!==!1&&n.text?x(n.fontSize,14):0;return x(t.paddingTop,12)+r+(i?i+12:0)+x(t.paddingBottom,36)}function pe({state:e,series:t}){let{config:n,width:r}=e,i=S(n,`legend`,{}),a=x(i.fontSize,12),o=x(i.markerSize,10),s=x(i.itemGap,24),c=x(i.rowGap,8),l=x(i.padding,8),u=x(i.labelGap,8),d=Math.max(1,r-l*2),f=[],p=[],m=0;return t.forEach(t=>{let n=Ve(e,t),r=O(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 B(e,t){return!S(e.config,`legend.show`,!0)||!t.length?{rows:[],height:0,padding:0,fontSize:12,markerSize:10,rowGap:0}:pe({state:e,series:t})}function V(e){return!!E(e,`pie`,S(e,`pie`,!1))}function me(e,t){let{config:n,width:r,height:i}=e,a=fe(n),o=B(e,t),s=S(n,`legend.show`,!0),c=S(n,`legend.position`,`bottom`),l=s&&c===`top`?o.height:0,u=s&&c!==`top`?o.height:0,d=x(S(n,`padding.top`,24),24),f=x(S(n,`padding.right`,24),24),p=x(S(n,`padding.bottom`,24),24),m=x(S(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?x(E(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=x(S(n,`layout.donut.radiusRatio`,.35),.35),b=Math.max(.1,Math.min(.50001,y)),C=Math.max(12,Math.min(h.width,_)*b),w=S(n,`layout.donut.radius`,null),T=w==null?C:Math.min(C,x(w,C)),D=x(S(n,`layout.donut.strokeWidth`,64),64)/300,O=Math.max(Math.min(T*D*2,T),12*(1+D)),k=S(n,`layout.donut.thickness`,S(n,`layout.donut.size`,O)),A=Math.max(0,Math.min(T-1,k==null?O:x(k,O)));return{...e,drawingArea:h,center:v,radius:T,thickness:A,innerRadius:V(n)?0:Math.max(0,T-A)}}function he(e,t){let n=x(S(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,V(e.config)?e.radius:e.thickness).map((e,n)=>({...e,index:n,color:k(e.color,t[n]?.color),value:x(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(x(e.value,0)))),r=t.map(e=>Math.abs(x(e.value,0))/n);return m({series:r,center:e.center,maxRadius:Math.min(e.drawingArea.width,e.drawingArea.height)/3,hasGhost:!1})}function H(e){return`gradient_${I()}`}function U(e,t){return`polar_gradient_${t}_${I()}`}function _e(e){return E(e.config,`type`,`classic`)!==`classic`||!S(e.config,`useGradient`,!1)?``:w(`circle`,{"data-cy":`donut-gradient-hollow`,cx:e.center.x,cy:e.center.y,r:e.radius<=0?10:e.radius,fill:`url(#${H(e)})`})}function W(e){return`drop_shadow_${I()}`}function ve(e){let{config:t,width:n}=e,r=S(t,`title`,{}),i=A(r,`subtitle`,{});if(!r.text)return``;let a=r.textAlign||`center`,o=a===`left`?x(r.paddingLeft,12):a===`right`?n-x(r.paddingRight,12):n/2,s=a===`left`?`start`:a===`right`?`end`:`middle`,c=x(r.fontSize,20),l=x(i.fontSize,14),u=x(r.paddingTop,12)+c,d=[N(r.text,{"data-cy":`donut-div-title`,x:o,y:u,"font-size":c,"font-weight":r.bold?`700`:`400`,"text-anchor":s,fill:k(r.color,j(t))})];return i.text&&d.push(N(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:k(i.color||r.color,j(t))})),M(`g`,{"data-layer":`title`},d.join(``))}function ye(e,t){let{config:n}=e,r=[],a=!!S(n,`useGradient`,!1),o=!!S(n,`layout.donut.useShadow`,!1);if(a){let a=E(n,`type`,`classic`),o=x(S(n,`gradientIntensity`,30),30);if(a===`classic`&&Number.isFinite(e.thickness/e.radius)){let t=V(n)?1:e.thickness/e.radius;r.push(M(`radialGradient`,{id:H(e)},[w(`stop`,{offset:`0%`,"stop-color":i(L(n),0),"stop-opacity":0}),w(`stop`,{offset:`${(1-t)*100}%`,"stop-color":i(`#FFFFFF`,0),"stop-opacity":0}),w(`stop`,{offset:`${(1-t/2)*100}%`,"stop-color":i(`#FFFFFF`,o)}),w(`stop`,{offset:`100%`,"stop-color":i(L(n),0),"stop-opacity":0})].join(``)))}a===`polar`&&t.forEach((t,n)=>{let i=e.polarAreas?.[n];i?.middlePoint&&r.push(M(`radialGradient`,{id:U(e,n),cx:`${l(i.middlePoint.x/e.width*100)}%`,cy:`${l(i.middlePoint.y/e.height*100)}%`,r:`62%`},[w(`stop`,{offset:`0%`,"stop-color":c(t.color,.05),"stop-opacity":o/100}),w(`stop`,{offset:`100%`,"stop-color":t.color})].join(``)))})}if(o){let t=k(S(n,`layout.donut.shadowColor`,`#000000`),`#000000`),i=x(S(n,`layout.donut.shadowOpacity`,.2),.2),a=x(S(n,`layout.donut.shadowBlur`,6),6),o=x(S(n,`layout.donut.shadowOffsetY`,3),3);r.push(M(`filter`,{id:W(e),x:`-50%`,y:`-50%`,width:`200%`,height:`200%`},[w(`feDropShadow`,{dx:0,dy:o,stdDeviation:a,"flood-color":t,"flood-opacity":i})].join(``)))}return r.length?M(`defs`,{"data-layer":`definitions`},r.join(``)):``}function be(e,t){return t.color}function xe(e,t,n){return S(e.config,`useGradient`,!1)?`url(#${U(e,n)})`:t.color}function G(e){let{config:t}=e;return S(t,`layout.donut.borderColorAuto`,!0)?L(t):k(S(t,`layout.donut.borderColor`,L(t)),L(t))}function K(e){return S(e.config,`layout.donut.useShadow`,!1)?`url(#${W(e)})`:void 0}function Se(e,t){if(!t.length)return``;let n=G(e),r=x(S(e.config,`layout.donut.borderWidth`,1),1),i=[];return t.forEach((t,a)=>{x(t.proportion,0)<=0||(i.push(w(`path`,{"data-cy":`donut-arc-underlay-${a}`,d:t.arcSlice,fill:`#FFFFFF`,stroke:L(e.config)})),i.push(w(`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:K(e)})))}),M(`g`,{"data-layer":`classic-slices`},i.join(``))}function Ce(e,t,n){if(!t.length)return``;let r=G(e),i=x(S(e.config,`layout.donut.borderWidth`,1),1),a=[];return t.forEach((t,o)=>{let s=n[o];s?.path&&(a.push(w(`path`,{"data-cy":`polar-arc-underlay-${o}`,d:s.path,fill:`#FFFFFF`,stroke:r})),a.push(w(`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:K(e)})))}),M(`g`,{"data-layer":`polar-slices`},a.join(``))}function q(t,n,r=`layout.labels.value.rounding`){let{config:i}=t,a=S(i,`layout.labels`,{}),o=a.dataLabels??{},s=a.value??{},c=e({p:o.prefix??``,v:n.value,s:o.suffix??``,r:x(S(i,r,s.rounding??0),s.rounding??0)});return f(s.formatter,n.value,c,{datapoint:n})}function J(t,n){let{config:r}=t,i=S(r,`layout.labels.percentage`,{}),a=x(n.proportion,0)*100,o=e({v:a,s:`%`,r:x(i.rounding,0)});return f(i.formatter,a,o,{datapoint:n})}function Y(e,t){let n=S(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?q(e,t):``,percentage:a?J(e,t):``}}function we(e,t){let{value:n,percentage:r}=Y(e,t);return r&&n?`${r} (${n})`:r||n||``}function X(e,t){let n=S(e.config,`layout.labels`,{}),r=n.dataLabels??{},i=!!(n.value?.show??!0),a=!!(n.percentage?.show??!0),o=i?q(e,t):``,s=a?J(e,t):``;return o&&s?r.valuePercentageRatio===`percentageFirst`?`${s}\n${o}`:`${o}\n${s}`:o||s||``}function Z(e,t){let n=S(e.config,`layout.labels`,{}).dataLabels??{};if(!E(e.config,`dataLabels.show`,n.show??!0)||!n.show)return!1;let r=x(n.hideUnderValue,0);return x(t.proportion,0)*100>r}function Te(e,t){let n=S(e.config,`layout.labels.dataLabels`,{}),r=x(n.smallArcClusterThreshold,0),i=x(n.hideUnderValue,0),a=x(t.proportion,0)*100;return a>i&&r>0&&a<=r}function Q(e){return!!S(e.config,`layout.curvedMarkers`,S(e.config,`layout.donut.curvedMarkers`,!1))}function Ee(e,t){let n=S(e.config,`layout.labels.dataLabels`,{}),r={},i=e.center.x,a=e.center.y,o=x(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),h=Q(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(!h)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,g=f+9;function _({x:e,y:t}){let n=e-i,r=t-a,o=Math.sqrt(n*n+r*r)||1;if(o>=g)return{x:e,y:t};let s=g/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),g),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 b({arc:e,index:t}){let n=_(e);return{arc:e,index:t,midX:n.x,midY:n.y,inlineMarkerX:u(e).x,inlineMarkerY:g(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)=>b({arc:e,index:t})).filter(({arc:t})=>Z(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 De({state:e,arc:t,arcIndex:n,smallArcLayout:r,fontSize:i}){let a=S(e.config,`layout.labels`,{}),o=a.percentage??{},s=a.name??{},c=r?.labelX??u(t,!0,12).x,l=r?.labelY??g(t),d=r?.textAnchor??u(t,!0,12).anchor,{name:f}=Y(e,t),p=we(e,t),m=String(f).split(/\n/g),h=f?m.map((t,n)=>M(`tspan`,{class:`vue-data-ui-datalabel-name`,x:n===0?void 0:c,dy:n===0?void 0:i*1.2,fill:k(s.color,j(e.config)),"font-size":i,"font-weight":s.bold?`700`:`400`},_(t+(n===m.length-1?` `:``)))).join(``):``,v=p?M(`tspan`,{class:`vue-data-ui-datalabel-value`,fill:k(o.color,j(e.config)),"font-size":i,"font-weight":o.bold?`700`:`400`},_(p)):``;return M(`text`,{"data-cy":`donut-label-inline-${n}`,class:`vue-data-ui-datalabel-inline`,x:c,y:l,"text-anchor":d},`${h}${v}`)}function Oe(e,t){let n=S(e.config,`layout.labels`,{}),r=n.dataLabels??{};if(!E(e.config,`dataLabels.show`,r.show??!0)||!r.show)return``;let i=x(r.fontSize??n.value?.fontSize??12,12);k(r.color??n.value?.color??j(e.config),j(e.config)),r.bold??n.value?.bold;let a=x(r.offset,16),o=Ee(e,t),s=[];return t.forEach((t,n)=>{if(!Z(e,t))return;let c=o[n];if(X(e,t),c){s.push(De({state:e,arc:t,arcIndex:n,smallArcLayout:c,fontSize:x(r.smallArcClusterFontSize,i)}));return}s.push(De({state:e,arc:t,arcIndex:n,smallArcLayout:{labelX:u(t,!1,a+i/2).x,labelY:g(t,a,a),textAnchor:u(t).anchor},fontSize:i}))}),s.length?M(`g`,{"data-layer":`data-labels`},s.join(``)):``}function ke(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 Ae(e,t){return t.x<e.center.x?`end`:t.x>e.center.x?`start`:`middle`}function je(e,t,n,r){let i=S(e.config,`layout.labels`,{}),a=i.percentage??{},o=i.name??{},s=x(a.fontSize,i.dataLabels?.fontSize??12),c=x(o.fontSize,i.dataLabels?.fontSize??12),l=M(`tspan`,{class:`vue-data-ui-datalabel-value`,fill:k(a.color,j(e.config)),"font-size":s,"font-weight":a.bold?`700`:`400`},_(String(X(e,t).replace(/\n/g,` / `)))),u=o.show?String(t.name??``).split(/\n/g).map((t,r)=>M(`tspan`,{class:`vue-data-ui-datalabel-name`,x:r===0?void 0:n,dy:r===0?void 0:c*1.2,fill:k(o.color,j(e.config)),"font-size":c,"font-weight":o.bold?`700`:`400`},_(t))).join(``):``;return r===`end`?`${u}${l}`:`${l}${u}`}function Me(e,t,n){let r=S(e.config,`layout.labels`,{}),i=r.dataLabels??{},a=r.value??{},o=r.percentage??{},c=r.name??{};if(!E(e.config,`dataLabels.show`,i.show??!0)||!i.show)return``;let l=!!i.oneLine,u=x(a.fontSize,i.fontSize??12),d=x(c.fontSize,i.fontSize??12),f=[];return t.forEach((t,r)=>{let i=n[r];if(!i||!Z(e,t))return;let a=ke(e,i,42),p=Ae(e,a);if(l){f.push(M(`text`,{"data-cy":`polar-label-inline`,class:`vue-data-ui-datalabel-inline`,x:a.x,y:a.y,"text-anchor":p},je(e,t,a.x,p)));return}f.push(M(`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":p,fill:valueFill},te({content:X(e,t),x:a.x,fontSize:u,fill:valueFill,textAnchor:p}))),c.show&&f.push(M(`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":p,fill:k(c.color,j(e.config))},s({content:_(String(t.name??``)),fontSize:d,fill:k(c.color,j(e.config)),x:a.x})))}),f.length?M(`g`,{"data-layer":`polar-data-labels`},f.join(``)):``}function Ne(e,t,n=null){if(n?.connectorPath)return n.connectorPath;let r=S(e.config,`layout.labels.dataLabels`,{}),i=x(r.offset,16),a=x(r.markerFlatLength,12),o=Q(e);return d(t,!1,i,i,!1,!1,0,a,o)}function Pe(e,t){let n=S(e.config,`layout.labels.dataLabels`,{});if(!E(e.config,`dataLabels.show`,n.show??!0)||!n.show)return``;let r=Ee(e,t),i=[];return t.forEach((t,a)=>{if(!Z(e,t))return;let o=r[a],s=Ne(e,t,o);s&&(i.push(w(`path`,{"data-cy":`donut-marker-${a}`,d:s,stroke:t.color,"stroke-width":x(n.markerStrokeWidth,1),"stroke-linecap":`round`,"stroke-linejoin":`round`,fill:`none`})),i.push(w(`circle`,{"data-cy":`donut-label-marker-${a}`,cx:o?.markerX??u(t).x,cy:o?.markerY??g(t)-3.5,r:x(n.markerRadius,3),fill:t.color,stroke:L(e.config),"stroke-width":1})))}),i.length?M(`g`,{"data-layer":`label-markers`},i.join(``)):``}function Fe(e,n,r){let i=S(e.config,`layout.labels.dataLabels`,{});if(!E(e.config,`dataLabels.show`,i.show??!0)||!i.show)return``;let a=[];return n.forEach((n,o)=>{let s=r[o];if(!s?.middlePoint||!Z(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(w(`path`,{"data-cy":`polar-marker-${o}`,d:`M ${c.x},${c.y} ${s.middlePoint.x},${s.middlePoint.y}`,stroke:n.color,"stroke-width":x(i.markerStrokeWidth,1),"stroke-linecap":`round`,"stroke-linejoin":`round`,fill:`none`})),a.push(w(`circle`,{"data-cy":`polar-label-marker-${o}`,cx:c.x,cy:c.y,r:x(i.markerRadius,3),fill:n.color,stroke:L(e.config),"stroke-width":1}))}),a.length?M(`g`,{"data-layer":`polar-label-markers`},a.join(``)):``}function $(e,t){return e==null||e===``?``:N(e,{"text-anchor":`middle`,...t})}function Ie(t,n,r){if(E(t.config,`type`,`classic`)!==`classic`||V(t.config)||!n)return``;let i=S(t.config,`layout.labels.hollow`,{}),a=i.total??{},o=i.average??{},s=[];if(a.show){let r=x(a.fontSize,14),i=!!o.show,c=t.center.y-(i?r:0)+x(a.offsetY,0),l=a.value??{},u=x(l.fontSize,r),d=f(l.formatter,n,e({p:l.prefix??``,v:n,s:l.suffix??``,r:x(l.rounding,0)}),{total:n});s.push($(a.text??``,{"data-cy":`hollow-total-name`,x:t.center.x,y:c,fill:k(a.color,j(t.config)),"font-size":r,"font-weight":a.bold?`700`:`400`})),s.push($(d,{"data-cy":`hollow-total-value`,x:t.center.x,y:t.center.y+r-(i?r:0)+x(l.offsetY,0),fill:k(l.color,k(a.color,j(t.config))),"font-size":u,"font-weight":l.bold?`700`:`400`}))}if(o.show){let i=x(o.fontSize,14),c=!!a.show,l=n/Math.max(1,r.length),u=o.value??{},d=x(u.fontSize,i),p=f(u.formatter,l,e({p:u.prefix??``,v:l,s:u.suffix??``,r:x(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)+x(o.offsetY,0),fill:k(o.color,j(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+x(u.offsetY,0),fill:k(u.color,k(o.color,j(t.config))),"font-size":d,"font-weight":u.bold?`700`:`400`}))}return s.filter(Boolean).length?M(`g`,{class:`vue-data-ui-donut-hollow-labels`,"data-layer":`hollow-labels`},s.join(``)):``}function Le(t,n){let{config:r,center:i}=t,a=S(r,`layout.donut.labels.total`,S(r,`layout.labels.total`,{}));if(!a.show||!Number.isFinite(n)||n<=0)return``;let o=S(r,`layout.labels.dataLabels`,{}),s=x(a.fontSize,20),c=k(a.color,j(r)),l=f(a.formatter,n,e({p:o.prefix??``,v:n,s:o.suffix??``,r:x(a.rounding,0)}),{total:n});return N(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 Re(e,t){let n=z(R(e));return n?x(t.value,0)/n*100:0}function ze(t,n){let r=S(t.config,`legend`,{}),i=S(t.config,`layout.labels`,{}),a=i.dataLabels??{},o=i.value??{},s=e({p:a.prefix??``,v:n.value,s:a.suffix??``,r:x(r.roundingValue,o.rounding??0)});return f(o.formatter,n.value,s,{datapoint:n,serie:n})}function Be(t,n){let r=S(t.config,`legend`,{}),i=S(t.config,`layout.labels`,{}).percentage??{},a=Re(t,n),o=e({v:a,s:`%`,r:x(r.roundingPercentage,i.rounding??0)});return f(i.formatter,a,o,{datapoint:n,serie:n})}function Ve(e,t){let n=S(e.config,`legend`,{}),r=[],i=n.showPercentage?Be(e,t):``,a=n.showValue?ze(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 He(e,t){let n=S(e.config,`legend`,{});if(!n.show||!t.length)return``;let r=B(e,t),i=k(n.color,j(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(w(`circle`,{cx:l+r.markerSize/2,cy:u,r:r.markerSize/2,fill:e.color,opacity:e.opacity??1})),c.push(N(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})}),M(`g`,{"data-layer":`legend`,"data-cy":`donut-div-legend`},c.join(``))}function Ue(e){return M(`g`,{"data-layer":`no-data`},[w(`circle`,{cx:e.center.x,cy:e.center.y,r:Math.max(1,e.radius),fill:k(S(e.config,`layout.donut.emptyFill`,`#E1E5E8`),`#E1E5E8`),opacity:.4})].join(``))}function We(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 Ge(e,t,n){let r=`${E(e.config,`title.text`,`Donut chart`)||e.svgTitle||`Donut chart`}. ${t.length} series. Total ${l(n)}.`;return M(`title`,{},_(r))}async function Ke(e){let t=e.config,n=x(e.width,S(t,`width`,512)),r=x(e.height,S(t,`height`,512)),i=R(e),a=z(i),o=me({...e,width:n,height:r},i),s=he(o,i),c=ge(o,i),l=E(t,`type`,`classic`),u=a>0&&s.some(e=>x(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,h as d,i as f,in as p,j as m,nn as h,p as g,st as _,t as v}from"./lib-CV_IANZ6.js";import{t as y}from"./useConfig-CKdzPrcf.js";import{t as b}from"./vue_ui_donut-T5PeOqvf.js";import{_ as x,a as S,c as C,d as w,g as T,i as E,l as D,n as O,o as k,p as A,r as j,s as ee,t as te,u as M,v as N}from"./render-common-BdZ5aRyn.js";var{vue_ui_donut:ne}=y();function re({config:e={}}={}){let t=e??{},r=p({userConfig:t,defaultConfig:ne}),i=r.theme;if(!i)return{...r,customPalette:r.customPalette?.length?r.customPalette:n};let a=p({userConfig:b[i]||{},defaultConfig:r}),o=p({userConfig:t,defaultConfig:a});return{...o,customPalette:o.customPalette?.length?o.customPalette:h[i]||n}}function P(e,t=0){let n=Number(e);return Number.isFinite(n)?n:t}function F(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+P(t,0),0):Array.isArray(e.series)?e.series.reduce((e,t)=>e+P(t,0),0):P(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,t)=>e.source?.ghost&&!t.source?.ghost?1:t.source?.ghost&&!e.source?.ghost?-1:t.value-e.value).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:P(F(o,`chart.padding.top`,24),24),right:P(F(o,`chart.padding.right`,24),24),bottom:P(F(o,`chart.padding.bottom`,24),24),left:P(F(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=P(F(o,`chart.donut.radius`,f),f),m=P(F(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:P(F(o,`chart.donut.startAngle`,-90),-90)}),additionalSvgContent:i,svgTitle:a}}var ue=o();function I(){return ue}function L(e){return k(S(e,`backgroundColor`,`#FFFFFF`),`#FFFFFF`)}function de(e){return x(e?.value??e?.absoluteValue??0,0)}function R(e){return T(e.series).filter(e=>!e?.ghost).map((e,t)=>({...e,value:Math.abs(de(e)),color:k(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 z(e){return e.reduce((e,t)=>e+Math.abs(x(t.value,0)),0)}function fe(e){let t=S(e,`title`,{}),n=A(t,`subtitle`,{});if(!t.text)return 0;let r=x(t.fontSize,20),i=n.show!==!1&&n.text?x(n.fontSize,14):0;return x(t.paddingTop,12)+r+(i?i+12:0)+x(t.paddingBottom,36)}function pe({state:e,series:t}){let{config:n,width:r}=e,i=S(n,`legend`,{}),a=x(i.fontSize,12),o=x(i.markerSize,10),s=x(i.itemGap,24),c=x(i.rowGap,8),l=x(i.padding,8),u=x(i.labelGap,8),d=Math.max(1,r-l*2),f=[],p=[],m=0;return t.forEach(t=>{let n=Ve(e,t),r=O(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 B(e,t){return!S(e.config,`legend.show`,!0)||!t.length?{rows:[],height:0,padding:0,fontSize:12,markerSize:10,rowGap:0}:pe({state:e,series:t})}function V(e){return!!E(e,`pie`,S(e,`pie`,!1))}function me(e,t){let{config:n,width:r,height:i}=e,a=fe(n),o=B(e,t),s=S(n,`legend.show`,!0),c=S(n,`legend.position`,`bottom`),l=s&&c===`top`?o.height:0,u=s&&c!==`top`?o.height:0,d=x(S(n,`padding.top`,24),24),f=x(S(n,`padding.right`,24),24),p=x(S(n,`padding.bottom`,24),24),m=x(S(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?x(E(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=x(S(n,`layout.donut.radiusRatio`,.35),.35),b=Math.max(.1,Math.min(.50001,y)),C=Math.max(12,Math.min(h.width,_)*b),w=S(n,`layout.donut.radius`,null),T=w==null?C:Math.min(C,x(w,C)),D=x(S(n,`layout.donut.strokeWidth`,64),64)/300,O=Math.max(Math.min(T*D*2,T),12*(1+D)),k=S(n,`layout.donut.thickness`,S(n,`layout.donut.size`,O)),A=Math.max(0,Math.min(T-1,k==null?O:x(k,O)));return{...e,drawingArea:h,center:v,radius:T,thickness:A,innerRadius:V(n)?0:Math.max(0,T-A)}}function he(e,t){let n=x(S(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,V(e.config)?e.radius:e.thickness).map((e,n)=>({...e,index:n,color:k(e.color,t[n]?.color),value:x(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(x(e.value,0)))),r=t.map(e=>Math.abs(x(e.value,0))/n);return m({series:r,center:e.center,maxRadius:Math.min(e.drawingArea.width,e.drawingArea.height)/3,hasGhost:!1})}function H(e){return`gradient_${I()}`}function U(e,t){return`polar_gradient_${t}_${I()}`}function _e(e){return E(e.config,`type`,`classic`)!==`classic`||!S(e.config,`useGradient`,!1)?``:w(`circle`,{"data-cy":`donut-gradient-hollow`,cx:e.center.x,cy:e.center.y,r:e.radius<=0?10:e.radius,fill:`url(#${H(e)})`})}function W(e){return`drop_shadow_${I()}`}function ve(e){let{config:t,width:n}=e,r=S(t,`title`,{}),i=A(r,`subtitle`,{});if(!r.text)return``;let a=r.textAlign||`center`,o=a===`left`?x(r.paddingLeft,12):a===`right`?n-x(r.paddingRight,12):n/2,s=a===`left`?`start`:a===`right`?`end`:`middle`,c=x(r.fontSize,20),l=x(i.fontSize,14),u=x(r.paddingTop,12)+c,d=[N(r.text,{"data-cy":`donut-div-title`,x:o,y:u,"font-size":c,"font-weight":r.bold?`700`:`400`,"text-anchor":s,fill:k(r.color,j(t))})];return i.text&&d.push(N(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:k(i.color||r.color,j(t))})),M(`g`,{"data-layer":`title`},d.join(``))}function ye(e,t){let{config:n}=e,r=[],a=!!S(n,`useGradient`,!1),o=!!S(n,`layout.donut.useShadow`,!1);if(a){let a=E(n,`type`,`classic`),o=x(S(n,`gradientIntensity`,30),30);if(a===`classic`&&Number.isFinite(e.thickness/e.radius)){let t=V(n)?1:e.thickness/e.radius;r.push(M(`radialGradient`,{id:H(e)},[w(`stop`,{offset:`0%`,"stop-color":i(L(n),0),"stop-opacity":0}),w(`stop`,{offset:`${(1-t)*100}%`,"stop-color":i(`#FFFFFF`,0),"stop-opacity":0}),w(`stop`,{offset:`${(1-t/2)*100}%`,"stop-color":i(`#FFFFFF`,o)}),w(`stop`,{offset:`100%`,"stop-color":i(L(n),0),"stop-opacity":0})].join(``)))}a===`polar`&&t.forEach((t,n)=>{let i=e.polarAreas?.[n];i?.middlePoint&&r.push(M(`radialGradient`,{id:U(e,n),cx:`${l(i.middlePoint.x/e.width*100)}%`,cy:`${l(i.middlePoint.y/e.height*100)}%`,r:`62%`},[w(`stop`,{offset:`0%`,"stop-color":c(t.color,.05),"stop-opacity":o/100}),w(`stop`,{offset:`100%`,"stop-color":t.color})].join(``)))})}if(o){let t=k(S(n,`layout.donut.shadowColor`,`#000000`),`#000000`),i=x(S(n,`layout.donut.shadowOpacity`,.2),.2),a=x(S(n,`layout.donut.shadowBlur`,6),6),o=x(S(n,`layout.donut.shadowOffsetY`,3),3);r.push(M(`filter`,{id:W(e),x:`-50%`,y:`-50%`,width:`200%`,height:`200%`},[w(`feDropShadow`,{dx:0,dy:o,stdDeviation:a,"flood-color":t,"flood-opacity":i})].join(``)))}return r.length?M(`defs`,{"data-layer":`definitions`},r.join(``)):``}function be(e,t){return t.color}function xe(e,t,n){return S(e.config,`useGradient`,!1)?`url(#${U(e,n)})`:t.color}function G(e){let{config:t}=e;return S(t,`layout.donut.borderColorAuto`,!0)?L(t):k(S(t,`layout.donut.borderColor`,L(t)),L(t))}function K(e){return S(e.config,`layout.donut.useShadow`,!1)?`url(#${W(e)})`:void 0}function Se(e,t){if(!t.length)return``;let n=G(e),r=x(S(e.config,`layout.donut.borderWidth`,1),1),i=[];return t.forEach((t,a)=>{x(t.proportion,0)<=0||(i.push(w(`path`,{"data-cy":`donut-arc-underlay-${a}`,d:t.arcSlice,fill:`#FFFFFF`,stroke:L(e.config)})),i.push(w(`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:K(e)})))}),M(`g`,{"data-layer":`classic-slices`},i.join(``))}function Ce(e,t,n){if(!t.length)return``;let r=G(e),i=x(S(e.config,`layout.donut.borderWidth`,1),1),a=[];return t.forEach((t,o)=>{let s=n[o];s?.path&&(a.push(w(`path`,{"data-cy":`polar-arc-underlay-${o}`,d:s.path,fill:`#FFFFFF`,stroke:r})),a.push(w(`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:K(e)})))}),M(`g`,{"data-layer":`polar-slices`},a.join(``))}function q(t,n,r=`layout.labels.value.rounding`){let{config:i}=t,a=S(i,`layout.labels`,{}),o=a.dataLabels??{},s=a.value??{},c=e({p:o.prefix??``,v:n.value,s:o.suffix??``,r:x(S(i,r,s.rounding??0),s.rounding??0)});return f(s.formatter,n.value,c,{datapoint:n})}function J(t,n){let{config:r}=t,i=S(r,`layout.labels.percentage`,{}),a=x(n.proportion,0)*100,o=e({v:a,s:`%`,r:x(i.rounding,0)});return f(i.formatter,a,o,{datapoint:n})}function Y(e,t){let n=S(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?q(e,t):``,percentage:a?J(e,t):``}}function we(e,t){let{value:n,percentage:r}=Y(e,t);return r&&n?`${r} (${n})`:r||n||``}function X(e,t){let n=S(e.config,`layout.labels`,{}),r=n.dataLabels??{},i=!!(n.value?.show??!0),a=!!(n.percentage?.show??!0),o=i?q(e,t):``,s=a?J(e,t):``;return o&&s?r.valuePercentageRatio===`percentageFirst`?`${s}\n${o}`:`${o}\n${s}`:o||s||``}function Z(e,t){let n=S(e.config,`layout.labels`,{}).dataLabels??{};if(!E(e.config,`dataLabels.show`,n.show??!0)||!n.show)return!1;let r=x(n.hideUnderValue,0);return x(t.proportion,0)*100>r}function Te(e,t){let n=S(e.config,`layout.labels.dataLabels`,{}),r=x(n.smallArcClusterThreshold,0),i=x(n.hideUnderValue,0),a=x(t.proportion,0)*100;return a>i&&r>0&&a<=r}function Q(e){return!!S(e.config,`layout.curvedMarkers`,S(e.config,`layout.donut.curvedMarkers`,!1))}function Ee(e,t){let n=S(e.config,`layout.labels.dataLabels`,{}),r={},i=e.center.x,a=e.center.y,o=x(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),h=Q(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(!h)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,g=f+9;function _({x:e,y:t}){let n=e-i,r=t-a,o=Math.sqrt(n*n+r*r)||1;if(o>=g)return{x:e,y:t};let s=g/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),g),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 b({arc:e,index:t}){let n=_(e);return{arc:e,index:t,midX:n.x,midY:n.y,inlineMarkerX:u(e).x,inlineMarkerY:g(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)=>b({arc:e,index:t})).filter(({arc:t})=>Z(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 De({state:e,arc:t,arcIndex:n,smallArcLayout:r,fontSize:i}){let a=S(e.config,`layout.labels`,{}),o=a.percentage??{},s=a.name??{},c=r?.labelX??u(t,!0,12).x,l=r?.labelY??g(t),d=r?.textAnchor??u(t,!0,12).anchor,{name:f}=Y(e,t),p=we(e,t),m=String(f).split(/\n/g),h=f?m.map((t,n)=>M(`tspan`,{class:`vue-data-ui-datalabel-name`,x:n===0?void 0:c,dy:n===0?void 0:i*1.2,fill:k(s.color,j(e.config)),"font-size":i,"font-weight":s.bold?`700`:`400`},_(t+(n===m.length-1?` `:``)))).join(``):``,v=p?M(`tspan`,{class:`vue-data-ui-datalabel-value`,fill:k(o.color,j(e.config)),"font-size":i,"font-weight":o.bold?`700`:`400`},_(p)):``;return M(`text`,{"data-cy":`donut-label-inline-${n}`,class:`vue-data-ui-datalabel-inline`,x:c,y:l,"text-anchor":d},`${h}${v}`)}function Oe(e,t){let n=S(e.config,`layout.labels`,{}),r=n.dataLabels??{};if(!E(e.config,`dataLabels.show`,r.show??!0)||!r.show)return``;let i=x(r.fontSize??n.value?.fontSize??12,12);k(r.color??n.value?.color??j(e.config),j(e.config)),r.bold??n.value?.bold;let a=x(r.offset,16),o=Ee(e,t),s=[];return t.forEach((t,n)=>{if(!Z(e,t))return;let c=o[n];if(X(e,t),c){s.push(De({state:e,arc:t,arcIndex:n,smallArcLayout:c,fontSize:x(r.smallArcClusterFontSize,i)}));return}s.push(De({state:e,arc:t,arcIndex:n,smallArcLayout:{labelX:u(t,!1,a+i/2).x,labelY:g(t,a,a),textAnchor:u(t).anchor},fontSize:i}))}),s.length?M(`g`,{"data-layer":`data-labels`},s.join(``)):``}function ke(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 Ae(e,t){return t.x<e.center.x?`end`:t.x>e.center.x?`start`:`middle`}function je(e,t,n,r){let i=S(e.config,`layout.labels`,{}),a=i.percentage??{},o=i.name??{},s=x(a.fontSize,i.dataLabels?.fontSize??12),c=x(o.fontSize,i.dataLabels?.fontSize??12),l=M(`tspan`,{class:`vue-data-ui-datalabel-value`,fill:k(a.color,j(e.config)),"font-size":s,"font-weight":a.bold?`700`:`400`},_(String(X(e,t).replace(/\n/g,` / `)))),u=o.show?String(t.name??``).split(/\n/g).map((t,r)=>M(`tspan`,{class:`vue-data-ui-datalabel-name`,x:r===0?void 0:n,dy:r===0?void 0:c*1.2,fill:k(o.color,j(e.config)),"font-size":c,"font-weight":o.bold?`700`:`400`},_(t))).join(``):``;return r===`end`?`${u}${l}`:`${l}${u}`}function Me(e,t,n){let r=S(e.config,`layout.labels`,{}),i=r.dataLabels??{},a=r.value??{},o=r.percentage??{},c=r.name??{};if(!E(e.config,`dataLabels.show`,i.show??!0)||!i.show)return``;let l=!!i.oneLine,u=x(a.fontSize,i.fontSize??12),d=x(c.fontSize,i.fontSize??12),f=[];return t.forEach((t,r)=>{let i=n[r];if(!i||!Z(e,t))return;let a=ke(e,i,42),p=Ae(e,a);if(l){f.push(M(`text`,{"data-cy":`polar-label-inline`,class:`vue-data-ui-datalabel-inline`,x:a.x,y:a.y,"text-anchor":p},je(e,t,a.x,p)));return}f.push(M(`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":p,fill:valueFill},te({content:X(e,t),x:a.x,fontSize:u,fill:valueFill,textAnchor:p}))),c.show&&f.push(M(`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":p,fill:k(c.color,j(e.config))},s({content:_(String(t.name??``)),fontSize:d,fill:k(c.color,j(e.config)),x:a.x})))}),f.length?M(`g`,{"data-layer":`polar-data-labels`},f.join(``)):``}function Ne(e,t,n=null){if(n?.connectorPath)return n.connectorPath;let r=S(e.config,`layout.labels.dataLabels`,{}),i=x(r.offset,16),a=x(r.markerFlatLength,12),o=Q(e);return d(t,!1,i,i,!1,!1,0,a,o)}function Pe(e,t){let n=S(e.config,`layout.labels.dataLabels`,{});if(!E(e.config,`dataLabels.show`,n.show??!0)||!n.show)return``;let r=Ee(e,t),i=[];return t.forEach((t,a)=>{if(!Z(e,t))return;let o=r[a],s=Ne(e,t,o);s&&(i.push(w(`path`,{"data-cy":`donut-marker-${a}`,d:s,stroke:t.color,"stroke-width":x(n.markerStrokeWidth,1),"stroke-linecap":`round`,"stroke-linejoin":`round`,fill:`none`})),i.push(w(`circle`,{"data-cy":`donut-label-marker-${a}`,cx:o?.markerX??u(t).x,cy:o?.markerY??g(t)-3.5,r:x(n.markerRadius,3),fill:t.color,stroke:L(e.config),"stroke-width":1})))}),i.length?M(`g`,{"data-layer":`label-markers`},i.join(``)):``}function Fe(e,n,r){let i=S(e.config,`layout.labels.dataLabels`,{});if(!E(e.config,`dataLabels.show`,i.show??!0)||!i.show)return``;let a=[];return n.forEach((n,o)=>{let s=r[o];if(!s?.middlePoint||!Z(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(w(`path`,{"data-cy":`polar-marker-${o}`,d:`M ${c.x},${c.y} ${s.middlePoint.x},${s.middlePoint.y}`,stroke:n.color,"stroke-width":x(i.markerStrokeWidth,1),"stroke-linecap":`round`,"stroke-linejoin":`round`,fill:`none`})),a.push(w(`circle`,{"data-cy":`polar-label-marker-${o}`,cx:c.x,cy:c.y,r:x(i.markerRadius,3),fill:n.color,stroke:L(e.config),"stroke-width":1}))}),a.length?M(`g`,{"data-layer":`polar-label-markers`},a.join(``)):``}function $(e,t){return e==null||e===``?``:N(e,{"text-anchor":`middle`,...t})}function Ie(t,n,r){if(E(t.config,`type`,`classic`)!==`classic`||V(t.config)||!n)return``;let i=S(t.config,`layout.labels.hollow`,{}),a=i.total??{},o=i.average??{},s=[];if(a.show){let r=x(a.fontSize,14),i=!!o.show,c=t.center.y-(i?r:0)+x(a.offsetY,0),l=a.value??{},u=x(l.fontSize,r),d=f(l.formatter,n,e({p:l.prefix??``,v:n,s:l.suffix??``,r:x(l.rounding,0)}),{total:n});s.push($(a.text??``,{"data-cy":`hollow-total-name`,x:t.center.x,y:c,fill:k(a.color,j(t.config)),"font-size":r,"font-weight":a.bold?`700`:`400`})),s.push($(d,{"data-cy":`hollow-total-value`,x:t.center.x,y:t.center.y+r-(i?r:0)+x(l.offsetY,0),fill:k(l.color,k(a.color,j(t.config))),"font-size":u,"font-weight":l.bold?`700`:`400`}))}if(o.show){let i=x(o.fontSize,14),c=!!a.show,l=n/Math.max(1,r.length),u=o.value??{},d=x(u.fontSize,i),p=f(u.formatter,l,e({p:u.prefix??``,v:l,s:u.suffix??``,r:x(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)+x(o.offsetY,0),fill:k(o.color,j(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+x(u.offsetY,0),fill:k(u.color,k(o.color,j(t.config))),"font-size":d,"font-weight":u.bold?`700`:`400`}))}return s.filter(Boolean).length?M(`g`,{class:`vue-data-ui-donut-hollow-labels`,"data-layer":`hollow-labels`},s.join(``)):``}function Le(t,n){let{config:r,center:i}=t,a=S(r,`layout.donut.labels.total`,S(r,`layout.labels.total`,{}));if(!a.show||!Number.isFinite(n)||n<=0)return``;let o=S(r,`layout.labels.dataLabels`,{}),s=x(a.fontSize,20),c=k(a.color,j(r)),l=f(a.formatter,n,e({p:o.prefix??``,v:n,s:o.suffix??``,r:x(a.rounding,0)}),{total:n});return N(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 Re(e,t){let n=z(R(e));return n?x(t.value,0)/n*100:0}function ze(t,n){let r=S(t.config,`legend`,{}),i=S(t.config,`layout.labels`,{}),a=i.dataLabels??{},o=i.value??{},s=e({p:a.prefix??``,v:n.value,s:a.suffix??``,r:x(r.roundingValue,o.rounding??0)});return f(o.formatter,n.value,s,{datapoint:n,serie:n})}function Be(t,n){let r=S(t.config,`legend`,{}),i=S(t.config,`layout.labels`,{}).percentage??{},a=Re(t,n),o=e({v:a,s:`%`,r:x(r.roundingPercentage,i.rounding??0)});return f(i.formatter,a,o,{datapoint:n,serie:n})}function Ve(e,t){let n=S(e.config,`legend`,{}),r=[],i=n.showPercentage?Be(e,t):``,a=n.showValue?ze(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 He(e,t){let n=S(e.config,`legend`,{});if(!n.show||!t.length)return``;let r=B(e,t),i=k(n.color,j(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(w(`circle`,{cx:l+r.markerSize/2,cy:u,r:r.markerSize/2,fill:e.color,opacity:e.opacity??1})),c.push(N(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})}),M(`g`,{"data-layer":`legend`,"data-cy":`donut-div-legend`},c.join(``))}function Ue(e){return M(`g`,{"data-layer":`no-data`},[w(`circle`,{cx:e.center.x,cy:e.center.y,r:Math.max(1,e.radius),fill:k(S(e.config,`layout.donut.emptyFill`,`#E1E5E8`),`#E1E5E8`),opacity:.4})].join(``))}function We(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 Ge(e,t,n){let r=`${E(e.config,`title.text`,`Donut chart`)||e.svgTitle||`Donut chart`}. ${t.length} series. Total ${l(n)}.`;return M(`title`,{},_(r))}async function Ke(e){let t=e.config,n=x(e.width,S(t,`width`,512)),r=x(e.height,S(t,`height`,512)),i=R(e),a=z(i),o=me({...e,width:n,height:r},i),s=he(o,i),c=ge(o,i),l=E(t,`type`,`classic`),u=a>0&&s.some(e=>x(e.proportion,0)>0);return`
2
2
  <svg
3
3
  xmlns="${v}"
4
4
  width="100%"