import { useCssVars as Ye, computed as m, ref as T, watch as qe, onMounted as He, openBlock as a, createElementBlock as o, normalizeClass as k, normalizeStyle as h, unref as n, createBlock as K, createCommentVNode as f, createSlots as We, withCtx as X, renderSlot as F, normalizeProps as ue, guardReactiveProps as ne, createVNode as $e, toDisplayString as c, createElementVNode as s, Fragment as g, renderList as _, createTextVNode as J, withKeys as Ke, nextTick as Ce } from "vue";
import { u as Je, c as Qe, t as Ze, a as et, p as P, b as tt, g as re, e as Q, d as ie, o as lt, X as at, s as S, w as Te, i as G, f as z, G as ze, m as Ne, j as ot, k as V, n as H, q as st, r as ut } from "./index-OhfEeW2N.js";
import { u as nt, U as rt } from "./usePrinter-stvkbwgz.js";
import it from "./vue-ui-skeleton-CZBWPZpy.js";
import ct from "./BaseIcon-QBIdDtsh.js";
import dt from "./vue-ui-accordion-BH0OU8sD.js";
import { u as Se } from "./useNestedProp-Cwjz-hIm.js";
import { _ as vt } from "./PackageVersion-DBbbI7TU.js";
import { P as yt } from "./PenAndPaper-tV-SbWUa.js";
import { u as ht } from "./useUserOptionState-BIvW1Kz7.js";
import { _ as ft } from "./_plugin-vue_export-helper-CHgC5LLL.js";
const bt = ["id"], pt = {
  key: 1,
  ref: "noTitle",
  class: "vue-data-ui-no-title-space",
  style: "height:36px; width: 100%;background:transparent"
}, gt = ["xmlns", "viewBox"], _t = ["width", "height"], xt = { key: 1 }, mt = ["fill", "font-weight", "font-size", "x", "y"], kt = ["fill", "font-weight", "font-size", "x", "y"], wt = ["id"], $t = ["stop-color"], Ct = ["stop-color"], Tt = ["id"], zt = ["stop-color"], Nt = ["stop-color"], St = ["id"], Ft = ["stop-color"], Lt = ["stop-color"], It = ["stop-color"], Pt = ["id"], Vt = ["stop-color"], Ot = ["stop-color"], Mt = ["stop-color"], Rt = ["id"], Bt = ["stop-color"], jt = ["stop-color"], At = ["stop-color"], Xt = { key: 2 }, Gt = ["x", "y", "font-size", "font-weight", "fill"], Et = ["x", "y", "font-size", "font-weight", "fill"], Ut = ["d", "stroke"], Dt = ["cx", "cy", "r", "fill"], Yt = ["cx", "cy", "r", "fill", "stroke", "stroke-width", "onClick"], qt = { key: 3 }, Ht = ["x", "y", "font-size", "fill", "onClick"], Wt = { key: 0 }, Kt = ["x", "y", "fill", "font-size", "font-weight"], Jt = ["x", "y", "height", "width", "fill", "rx", "onClick"], Qt = ["x", "y", "height", "width", "fill", "rx", "stroke", "stroke-width", "onClick"], Zt = { key: 4 }, el = ["x", "y", "fill", "font-size", "onClick"], tl = ["d", "stroke"], ll = ["fill", "cx", "cy", "r", "onClick"], al = { key: 5 }, ol = ["x", "y", "font-size", "font-weight", "fill"], sl = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], ul = ["y", "height", "width"], nl = { style: { width: "100%", height: "100%", display: "flex", "align-items": "center", "justify-content": "center", "flex-direction": "column" } }, rl = { style: { display: "flex", "align-items": "center", "justify-content": "center", gap: "12px", "flex-wrap": "wrap", "flex-direction": "row" } }, il = {
  viewBox: "0 0 20 20",
  height: "16",
  width: "16"
}, cl = ["fill"], dl = { key: 7 }, vl = ["y", "height", "width"], yl = { style: { width: "100%", height: "100%", display: "flex", "align-items": "center", "justify-content": "center", "flex-direction": "column" } }, hl = { style: { display: "flex", "align-items": "center", "justify-content": "center", gap: "12px", "flex-wrap": "wrap", "flex-direction": "row" } }, fl = {
  viewBox: "0 0 20 20",
  height: "16",
  width: "16"
}, bl = ["fill"], pl = ["cx", "cy", "fill"], gl = ["d", "stroke"], _l = ["cx", "cy", "fill"], xl = ["d", "stroke"], ml = ["cx", "cy", "fill"], kl = ["cx", "cy", "fill"], wl = ["x", "y", "fill", "font-size", "font-weight"], $l = ["x", "y", "fill", "font-size", "font-weight"], Cl = ["x", "text-anchor", "y", "fill", "font-size"], Tl = ["x", "text-anchor", "y", "fill", "font-size"], zl = ["x", "text-anchor", "y", "fill", "font-size"], Nl = ["x", "text-anchor", "y", "fill", "font-size"], Sl = ["x", "text-anchor", "y", "fill", "font-size"], Fl = ["x", "y", "font-size", "fill"], Ll = ["x", "y", "font-size", "fill"], Il = ["x", "y", "font-size", "fill"], Pl = {
  key: 4,
  class: "vue-data-ui-watermark"
}, Vl = {
  key: 6,
  ref: "source",
  dir: "auto"
}, Ol = { style: { "padding-top": "36px", position: "relative" } }, Ml = { class: "vue-ui-data-table" }, Rl = { key: 0 }, Bl = ["data-cell"], jl = { style: { display: "flex", "align-items": "center", gap: "5px", "justify-content": "flex-end", width: "100%", "padding-right": "3px" } }, Al = { key: 0 }, Xl = { key: 1 }, Gl = ["data-cell"], El = { style: { display: "flex", "align-items": "center", gap: "5px", "justify-content": "flex-end", width: "100%", "padding-right": "3px" } }, Ul = { key: 0 }, Dl = { key: 1 }, Yl = ["data-cell"], ql = { style: { display: "flex", "align-items": "center", gap: "5px", "justify-content": "flex-end", width: "100%", "padding-right": "3px" } }, Hl = { key: 0 }, Wl = { key: 1 }, Kl = ["data-cell"], Jl = { style: { display: "flex", "align-items": "center", gap: "5px", "justify-content": "flex-end", width: "100%", "padding-right": "3px" } }, Ql = { key: 0 }, Zl = { key: 1 }, ea = ["data-cell"], ta = { style: { display: "flex", "align-items": "center", gap: "5px", "justify-content": "flex-end", width: "100%", "padding-right": "3px" } }, la = { key: 0 }, aa = { key: 1 }, oa = ["data-cell"], sa = { style: { display: "flex", "align-items": "center", gap: "5px", "justify-content": "flex-end", width: "100%", "padding-right": "3px" } }, ua = { key: 0 }, na = { key: 1 }, ra = ["data-cell"], ia = { style: { display: "flex", "align-items": "center", gap: "5px", "justify-content": "flex-end", width: "100%", "padding-right": "3px" } }, ca = { key: 0 }, da = { key: 1 }, va = ["data-cell"], ya = { style: { display: "flex", "align-items": "center", gap: "5px", "justify-content": "flex-end", width: "100%", "padding-right": "3px" } }, ha = ["data-cell"], fa = { style: { display: "flex", "align-items": "center", gap: "5px", "justify-content": "flex-end", width: "100%", "padding-right": "3px" } }, ba = ["data-cell"], pa = { style: { display: "flex", "align-items": "center", gap: "5px", "justify-content": "flex-end", width: "100%", "padding-right": "3px" } }, ga = ["data-cell"], _a = { style: { display: "flex", "align-items": "center", gap: "5px", "justify-content": "flex-end", width: "100%", "padding-right": "3px" } }, xa = ["data-cell"], ma = { style: { display: "flex", "align-items": "center", gap: "5px", "justify-content": "flex-end", width: "100%", "padding-right": "3px" } }, ka = {
  __name: "vue-ui-chestnut",
  props: {
    config: {
      type: Object,
      default() {
        return {};
      }
    },
    dataset: {
      type: Array,
      default() {
        return [];
      }
    }
  },
  emits: ["selectRoot", "selectBranch", "selectNut"],
  setup(Fe, { expose: Le, emit: E }) {
    const O = Fe;
    Ye((l) => ({
      a946cfe6: l.tdo
    }));
    const { vue_ui_chestnut: Ie } = Je(), Y = m(() => !!O.dataset && O.dataset.length), w = T(Qe()), Z = T(null), Pe = T(null), ce = T(0), e = m({
      get: () => ye(),
      set: (l) => l
    }), { userOptionsVisible: ee, setUserOptionsVisibility: de, keepUserOptionState: ve } = ht({ config: e.value });
    function ye() {
      const l = Se({
        userConfig: O.config,
        defaultConfig: Ie
      });
      return l.theme ? {
        ...Se({
          userConfig: Ze.vue_ui_chestnut[l.theme] || O.config,
          defaultConfig: l
        }),
        customPalette: et[l.theme] || P
      } : l;
    }
    qe(() => O.config, (l) => {
      e.value = ye(), ee.value = !e.value.userOptions.showOnChartHover, U.value.showTable = e.value.table.show, me();
    }, { deep: !0 });
    const { isPrinting: he, isImaging: fe, generatePdf: be, generateImage: pe } = nt({
      elementId: `vue-ui-chestnut_${w.value}`,
      fileName: e.value.style.chart.layout.title.text || "vue-ui-chestnut"
    }), Ve = m(() => e.value.userOptions.show), te = m(() => tt(e.value.customPalette)), U = T({
      showTable: e.value.table.show
    }), le = T(null), ge = T(!1), Oe = m(() => e.value.table.responsiveBreakpoint), r = T({
      gap: 6,
      padding: {
        top: 102,
        left: 12,
        right: 12,
        bottom: 96
      },
      width: 1024,
      height: 0,
      branchSize: 32,
      branchStart: 128
    }), C = m(() => ({
      left: r.value.padding.left,
      top: r.value.padding.top,
      right: r.value.width - r.value.padding.right,
      bottom: r.value.height - r.value.padding.bottom,
      width: r.value.width - (r.value.padding.left + r.value.padding.right),
      height: r.value.height - (r.value.padding.top + r.value.padding.bottom),
      seedX: r.value.padding.left + 64
    })), M = m(() => Y.value ? O.dataset.flatMap((l) => (l.branches || []).map((i) => i.value || 0)).reduce((l, i) => l + i, 0) : 0), N = m(() => (O.dataset.forEach((l, i) => {
      re({
        datasetObject: l,
        requiredAttributes: ["name", "branches"]
      }).forEach((t) => {
        Q({
          componentName: "VueUiChestnut",
          type: "datasetSerieAttribute",
          property: t,
          index: i
        });
      }), l.branches && l.branches.forEach((t, u) => {
        re({
          datasetObject: t,
          requiredAttributes: ["name", "value"]
        }).forEach((b) => {
          Q({
            componentName: "VueUiChestnut",
            type: "datasetSerieAttribute",
            property: b,
            index: `${i} - ${u}`
          });
        }), t.breakdown && t.breakdown.forEach((b, y) => {
          re({
            datasetObject: b,
            requiredAttributes: ["name", "value"]
          }).forEach((p) => {
            Q({
              componentName: "VueUiChestnut",
              type: "datasetSerieAttribute",
              property: p,
              index: `${i} - ${u} - ${y}`
            });
          });
        });
      });
    }), O.dataset.map((l, i) => {
      const t = (l.branches || []).map((u) => u.value || 0).reduce((u, b) => u + b, 0);
      return {
        ...l,
        color: ie(l.color) || te.value[i] || P[i] || P[i % P.length],
        id: l.id || `root_${i}_${w.value}`,
        type: "root",
        total: t,
        rootIndex: i,
        branches: (l.branches || []).map((u, b) => ({
          ...u,
          rootName: l.name,
          rootIndex: i,
          color: ie(l.color) || te.value[i] || P[i] || P[i % P.length],
          value: u.value >= 0 ? u.value : 0,
          id: u.id || `branch_${i}_${b}_${w.value}`,
          proportionToRoot: u.value / t,
          type: "branch",
          breakdown: (u.breakdown || []).map((y, p) => ({
            table: {
              rootName: l.name,
              rootValue: t,
              rootToTotal: t / M.value,
              branchName: u.name,
              branchValue: u.value,
              branchToTotal: u.value / M.value,
              branchToRoot: u.value / t,
              nutName: y.name,
              nutValue: y.value,
              nutToTotal: y.value / M.value,
              nutToRoot: y.value / t,
              nutToBranch: y.value / u.value
            },
            ...y,
            type: "nut",
            branchName: u.name,
            rootName: l.name,
            branchTotal: u.value >= 0 ? u.value : 0,
            proportionToBranch: y.value / u.value,
            proportionToRoot: y.value / t,
            proportionToTree: y.value / M.value,
            rootIndex: i,
            id: y.id || `nut_${i}_${b}_${p}_${w.value}`,
            color: ie(y.color) || te.value[p] || P[p] || P[p % P.length],
            value: y.value >= 0 ? y.value : 0
          }))
        }))
      };
    })));
    function Me() {
      return N.value;
    }
    const Re = m(() => N.value.flatMap((l) => l.branches).length), Be = m(() => Math.max(...N.value.map((l) => l.branches.map((i) => i.value).reduce((i, t) => i + t, 0)))), je = m(() => Math.max(...N.value.flatMap((l) => l.branches.map((i) => i.value)))), _e = m(() => 256 + r.value.padding.left), B = m(() => N.value.sort((l, i) => i.total - l.total).map((l, i) => {
      const t = C.value.height / N.value.length / 2, u = l.total / Be.value * (t > 64 ? 64 : t);
      return {
        ...l,
        x: C.value.seedX,
        y: C.value.top + C.value.height / N.value.length * (i + 1) - (C.value.height / N.value.length / 2 + r.value.gap / 2),
        r: u < r.value.branchSize / 2 ? r.value.branchSize / 2 : u
      };
    })), Ae = m(() => e.value.style.chart.layout.branches.widthRatio <= 0 ? 0.1 : e.value.style.chart.layout.branches.widthRatio > 1.8 ? 1.8 : e.value.style.chart.layout.branches.widthRatio), Xe = m(() => B.value.flatMap((l) => l.branches)), j = m(() => Xe.value.sort((l, i) => i.value - l.value).map((l, i) => ({
      ...l,
      y1: i * r.value.branchSize + C.value.top + i * r.value.gap,
      y2: i * r.value.branchSize + r.value.branchSize,
      x1: _e.value,
      x2: 384 * l.value / je.value * Ae.value + _e.value
    })));
    function ae(l) {
      const i = B.value.find((t) => t.rootIndex === l.rootIndex);
      return { x: i.x, y: i.y, r: i.r };
    }
    const d = T(null), R = T(null), x = T(null), L = T(null);
    function $() {
      d.value = null, x.value = null, L.value = null;
    }
    function I(l) {
      return L.value ? L.value === null ? !0 : l.type === "root" ? l.id === L.value.id : l.rootIndex === L.value.rootIndex : d.value === null && x.value === null ? !0 : l.type === "nut" ? d.value.id === l.id : l.type === "branch" ? x.value.id === l.id : l.type === "root" ? x.value && x.value.rootIndex === l.rootIndex || d.value && d.value.rootIndex === l.rootIndex : !1;
    }
    function Ge(l) {
      $(), Ce(() => {
        d.value = l, x.value = l, R.value = Ne(
          { series: l.breakdown, base: 1 },
          l.x2 + 24 + e.value.style.chart.layout.nuts.offsetX,
          l.y1 + r.value.branchSize / 2,
          80,
          80
        ), E("selectNut", l.breakdown);
      });
    }
    function A() {
      d.value = null, R.value = null, E("selectNut", null);
    }
    function oe(l) {
      x.value && x.value.id === l.id ? (x.value = null, $(), E("selectBranch", null)) : ($(), x.value = l, E("selectBranch", l));
    }
    function xe(l) {
      L.value && L.value.id === l.id ? ($(), E("selectRoot", null)) : ($(), L.value = l, E("selectRoot", l));
    }
    function Ee() {
      return C.value.bottom - (d.value.y1 + 180) < 0 ? 0 : C.value.bottom;
    }
    function D(l) {
      return l.proportion * 100 > e.value.style.chart.layout.nuts.selected.labels.dataLabels.hideUnderValue;
    }
    function Ue() {
      const l = new ResizeObserver((i) => {
        i.forEach((t) => {
          ge.value = t.contentRect.width < Oe.value;
        });
      });
      le.value && l.observe(le.value);
    }
    He(() => {
      me();
    });
    function me() {
      lt(O.dataset) && Q({
        componentName: "VueUiChestnut",
        type: "dataset"
      });
      const l = Re.value * (r.value.branchSize + r.value.gap) + r.value.padding.top + r.value.padding.bottom;
      r.value.height = l, Ue();
    }
    const v = m(() => {
      const l = [
        e.value.table.th.translations.rootName,
        e.value.table.th.translations.rootValue,
        e.value.table.th.translations.rootToTotal,
        e.value.table.th.translations.branchName,
        e.value.table.th.translations.branchValue,
        e.value.table.th.translations.branchToRoot,
        e.value.table.th.translations.branchToTotal,
        e.value.table.th.translations.nutName,
        e.value.table.th.translations.nutValue,
        e.value.table.th.translations.nutToBranch,
        e.value.table.th.translations.nutToRoot,
        e.value.table.th.translations.nutToTotal
      ], i = N.value.flatMap((t, u) => t.branches.flatMap((b, y) => b.breakdown.flatMap((p, wa) => p.table)));
      return { head: l, body: i };
    });
    function ke() {
      Ce(() => {
        const l = [[e.value.style.chart.layout.title.text], [e.value.style.chart.layout.title.subtitle.text], [""], ["Grand total", M.value], [""]], i = v.value.head, t = v.value.body.map((y, p) => [
          v.value.body[p - 1] && v.value.body[p - 1].rootName === y.rootName ? "" : y.rootName,
          v.value.body[p - 1] && v.value.body[p - 1].rootName === y.rootName ? "" : y.rootValue,
          v.value.body[p - 1] && v.value.body[p - 1].rootName === y.rootName ? "" : y.rootToTotal,
          v.value.body[p - 1] && v.value.body[p - 1].branchName === y.branchName ? "" : y.branchName,
          v.value.body[p - 1] && v.value.body[p - 1].branchName === y.branchName ? "" : y.branchValue,
          v.value.body[p - 1] && v.value.body[p - 1].branchName === y.branchName ? "" : y.branchToRoot,
          v.value.body[p - 1] && v.value.body[p - 1].branchName === y.branchName ? "" : y.branchToTotal,
          y.nutName,
          y.nutValue,
          y.nutToBranch,
          y.nutToRoot,
          y.nutToTotal
        ]), u = l.concat([i]).concat(t), b = st(u);
        ut({ csvContent: b, title: e.value.style.chart.layout.title.text || "vue-ui-chestnut" });
      });
    }
    const q = T(!1);
    function De(l) {
      q.value = l, ce.value += 1;
    }
    function we() {
      U.value.showTable = !U.value.showTable;
    }
    const W = T(!1);
    function se() {
      W.value = !W.value;
    }
    return Le({
      getData: Me,
      generatePdf: be,
      generateCsv: ke,
      generateImage: pe,
      toggleTable: we,
      toggleAnnotator: se
    }), (l, i) => (a(), o("div", {
      class: k(`vue-ui-chestnut ${q.value ? "vue-data-ui-wrapper-fullscreen" : ""}`),
      ref_key: "chestnutChart",
      ref: Z,
      id: `vue-ui-chestnut_${w.value}`,
      style: h(`font-family:${e.value.style.fontFamily};width:100%; text-align:center;background:${e.value.style.chart.backgroundColor}`),
      onMouseenter: i[2] || (i[2] = () => n(de)(!0)),
      onMouseleave: i[3] || (i[3] = () => n(de)(!1))
    }, [
      e.value.userOptions.buttons.annotator ? (a(), K(yt, {
        key: 0,
        parent: Z.value,
        backgroundColor: e.value.style.chart.backgroundColor,
        color: e.value.style.chart.color,
        active: W.value,
        onClose: se
      }, null, 8, ["parent", "backgroundColor", "color", "active"])) : f("", !0),
      Ve.value ? (a(), o("div", pt, null, 512)) : f("", !0),
      e.value.userOptions.show && Y.value && (n(ve) || n(ee)) ? (a(), K(rt, {
        ref_key: "details",
        ref: Pe,
        key: `user_options_${ce.value}`,
        backgroundColor: e.value.style.chart.backgroundColor,
        color: e.value.style.chart.color,
        isImaging: n(fe),
        isPrinting: n(he),
        uid: w.value,
        hasPdf: e.value.userOptions.buttons.pdf,
        hasImg: e.value.userOptions.buttons.img,
        hasXls: e.value.userOptions.buttons.csv,
        hasTable: e.value.userOptions.buttons.table,
        hasFullscreen: e.value.userOptions.buttons.fullscreen,
        isFullscreen: q.value,
        titles: { ...e.value.userOptions.buttonTitles },
        chartElement: Z.value,
        position: e.value.userOptions.position,
        hasAnnotator: e.value.userOptions.buttons.annotator,
        isAnnotation: W.value,
        onToggleFullscreen: De,
        onGeneratePdf: n(be),
        onGenerateCsv: ke,
        onGenerateImage: n(pe),
        onToggleTable: we,
        onToggleAnnotator: se,
        style: h({
          visibility: n(ve) ? n(ee) ? "visible" : "hidden" : "visible"
        })
      }, We({ _: 2 }, [
        l.$slots.optionPdf ? {
          name: "optionPdf",
          fn: X(() => [
            F(l.$slots, "optionPdf", {}, void 0, !0)
          ]),
          key: "0"
        } : void 0,
        l.$slots.optionCsv ? {
          name: "optionCsv",
          fn: X(() => [
            F(l.$slots, "optionCsv", {}, void 0, !0)
          ]),
          key: "1"
        } : void 0,
        l.$slots.optionImg ? {
          name: "optionImg",
          fn: X(() => [
            F(l.$slots, "optionImg", {}, void 0, !0)
          ]),
          key: "2"
        } : void 0,
        l.$slots.optionTable ? {
          name: "optionTable",
          fn: X(() => [
            F(l.$slots, "optionTable", {}, void 0, !0)
          ]),
          key: "3"
        } : void 0,
        l.$slots.optionFullscreen ? {
          name: "optionFullscreen",
          fn: X(({ toggleFullscreen: t, isFullscreen: u }) => [
            F(l.$slots, "optionFullscreen", ue(ne({ toggleFullscreen: t, isFullscreen: u })), void 0, !0)
          ]),
          key: "4"
        } : void 0,
        l.$slots.optionAnnotator ? {
          name: "optionAnnotator",
          fn: X(({ toggleAnnotator: t, isAnnotator: u }) => [
            F(l.$slots, "optionAnnotator", ue(ne({ toggleAnnotator: t, isAnnotator: u })), void 0, !0)
          ]),
          key: "5"
        } : void 0
      ]), 1032, ["backgroundColor", "color", "isImaging", "isPrinting", "uid", "hasPdf", "hasImg", "hasXls", "hasTable", "hasFullscreen", "isFullscreen", "titles", "chartElement", "position", "hasAnnotator", "isAnnotation", "onGeneratePdf", "onGenerateImage", "style"])) : f("", !0),
      r.value.height > 0 && Y.value ? (a(), o("svg", {
        key: 3,
        xmlns: n(at),
        class: k({ "vue-data-ui-fullscreen--on": q.value, "vue-data-ui-fulscreen--off": !q.value }),
        viewBox: `0 0 ${r.value.width <= 0 ? 10 : r.value.width} ${r.value.height <= 0 ? 10 : r.value.height}`,
        style: h(`overflow:visible;background:transparent;color:${e.value.style.chart.color}`)
      }, [
        $e(vt),
        l.$slots["chart-background"] ? (a(), o("foreignObject", {
          key: 0,
          x: 0,
          y: 0,
          width: r.value.width <= 0 ? 10 : r.value.width,
          height: r.value.height <= 0 ? 10 : r.value.height,
          style: {
            pointerEvents: "none"
          }
        }, [
          F(l.$slots, "chart-background", {}, void 0, !0)
        ], 8, _t)) : f("", !0),
        d.value ? f("", !0) : (a(), o("g", xt, [
          e.value.style.chart.layout.title.text ? (a(), o("text", {
            key: 0,
            "text-anchor": "middle",
            fill: e.value.style.chart.layout.title.color,
            "font-weight": e.value.style.chart.layout.title.bold ? "bold" : "normal",
            "font-size": e.value.style.chart.layout.title.fontSize,
            x: r.value.width / 2,
            y: 12 + e.value.style.chart.layout.title.fontSize + e.value.style.chart.layout.title.offsetY,
            onClick: $
          }, c(e.value.style.chart.layout.title.text), 9, mt)) : f("", !0),
          e.value.style.chart.layout.title.subtitle.text ? (a(), o("text", {
            key: 1,
            "text-anchor": "middle",
            fill: e.value.style.chart.layout.title.subtitle.color,
            "font-weight": e.value.style.chart.layout.title.subtitle.bold ? "bold" : "normal",
            "font-size": e.value.style.chart.layout.title.subtitle.fontSize,
            x: r.value.width / 2,
            y: 48 + e.value.style.chart.layout.title.subtitle.fontSize + e.value.style.chart.layout.title.subtitle.offsetY,
            onClick: $
          }, c(e.value.style.chart.layout.title.subtitle.text), 9, kt)) : f("", !0)
        ])),
        s("defs", null, [
          (a(!0), o(g, null, _(N.value, (t, u) => (a(), o("radialGradient", {
            cx: "50%",
            cy: "50%",
            r: "50%",
            fx: "50%",
            fy: "50%",
            id: `root_gradient_${w.value}_${t.rootIndex}`
          }, [
            s("stop", {
              offset: "0%",
              "stop-color": n(S)(n(Te)(t.color, 0.05), 100 - e.value.style.chart.layout.roots.gradientIntensity)
            }, null, 8, $t),
            s("stop", {
              offset: "100%",
              "stop-color": t.color
            }, null, 8, Ct)
          ], 8, wt))), 256)),
          (a(!0), o(g, null, _(N.value, (t) => (a(), o("linearGradient", {
            x1: "0%",
            y1: "0%",
            x2: "100%",
            y2: "0%",
            id: `branch_gradient_${w.value}_${t.rootIndex}`
          }, [
            s("stop", {
              offset: "0%",
              "stop-color": t.color
            }, null, 8, zt),
            s("stop", {
              offset: "100%",
              "stop-color": n(S)(n(Te)(t.color, 0.02), 100 - e.value.style.chart.layout.branches.gradientIntensity)
            }, null, 8, Nt)
          ], 8, Tt))), 256)),
          s("radialGradient", {
            cx: "50%",
            cy: "50%",
            r: "50%",
            fx: "50%",
            fy: "50%",
            id: `nutpick_${w.value}`
          }, [
            s("stop", {
              offset: "0%",
              "stop-color": n(S)("#FFFFFF", 0)
            }, null, 8, Ft),
            s("stop", {
              offset: "80%",
              "stop-color": n(S)("#FFFFFF", e.value.style.chart.layout.nuts.selected.gradientIntensity)
            }, null, 8, Lt),
            s("stop", {
              offset: "100%",
              "stop-color": n(S)("#FFFFFF", 0)
            }, null, 8, It)
          ], 8, St),
          s("radialGradient", {
            cx: "50%",
            cy: "50%",
            r: "50%",
            fx: "50%",
            fy: "50%",
            id: `nut_${w.value}`
          }, [
            s("stop", {
              offset: "0%",
              "stop-color": n(S)("#FFFFFF", 0)
            }, null, 8, Vt),
            s("stop", {
              offset: "80%",
              "stop-color": n(S)("#FFFFFF", e.value.style.chart.layout.nuts.gradientIntensity)
            }, null, 8, Ot),
            s("stop", {
              offset: "100%",
              "stop-color": n(S)("#FFFFFF", 0)
            }, null, 8, Mt)
          ], 8, Pt),
          s("radialGradient", {
            cx: "50%",
            cy: "50%",
            r: "50%",
            fx: "50%",
            fy: "50%",
            id: `nut_underlayer_${w.value}`
          }, [
            s("stop", {
              offset: "0%",
              "stop-color": n(S)(e.value.style.chart.backgroundColor, 100)
            }, null, 8, Bt),
            s("stop", {
              offset: "80%",
              "stop-color": n(S)(e.value.style.chart.backgroundColor, 60)
            }, null, 8, jt),
            s("stop", {
              offset: "100%",
              "stop-color": n(S)(e.value.style.chart.backgroundColor, 0)
            }, null, 8, At)
          ], 8, Rt)
        ]),
        e.value.style.chart.layout.grandTotal.show ? (a(), o("g", Xt, [
          s("text", {
            x: C.value.seedX,
            y: 32 + e.value.style.chart.layout.grandTotal.offsetY,
            "font-size": e.value.style.chart.layout.grandTotal.fontSize,
            "font-weight": e.value.style.chart.layout.grandTotal.bold ? "bold" : "normal",
            fill: e.value.style.chart.layout.grandTotal.color,
            "text-anchor": "middle",
            onClick: $
          }, c(e.value.style.chart.layout.grandTotal.text), 9, Gt),
          s("text", {
            x: C.value.seedX,
            y: 38 + e.value.style.chart.layout.grandTotal.fontSize + e.value.style.chart.layout.grandTotal.offsetY,
            "font-size": e.value.style.chart.layout.grandTotal.fontSize,
            "font-weight": e.value.style.chart.layout.grandTotal.bold ? "bold" : "normal",
            fill: e.value.style.chart.layout.grandTotal.color,
            "text-anchor": "middle",
            onClick: $
          }, c(n(G)(
            e.value.style.chart.layout.grandTotal.formatter,
            M.value,
            n(z)({
              p: e.value.style.chart.layout.grandTotal.prefix,
              v: M.value,
              s: e.value.style.chart.layout.grandTotal.suffix,
              r: e.value.style.chart.layout.grandTotal.roundingValue
            })
          )), 9, Et)
        ])) : f("", !0),
        (a(!0), o(g, null, _(j.value, (t) => (a(), o("g", null, [
          (a(!0), o(g, null, _(r.value.branchSize, (u, b) => (a(), o("path", {
            d: `M
                    ${t.x1},${t.y1 + b}
                    C${t.x1 - 20},${t.y1 + b} 
                    ${t.x1 - 80},${t.y1 + b} 
                    ${ae(t).x + ae(t).r / 2}, ${ae(t).y}
                `,
            stroke: n(S)(t.color, e.value.style.chart.layout.links.opacity),
            fill: "none",
            "stroke-width": "2",
            "shape-rendering": "cirspEdges",
            style: h(`opacity:${I(t) ? 1 : 0}`),
            onClick: $
          }, null, 12, Ut))), 256))
        ]))), 256)),
        (a(!0), o(g, null, _(B.value, (t) => (a(), o("circle", {
          cx: t.x,
          cy: t.y,
          r: t.r,
          fill: e.value.style.chart.layout.roots.underlayerColor,
          stroke: "none",
          style: h(`cursor:pointer; opacity:${I(t) ? 1 : 0.05}`)
        }, null, 12, Dt))), 256)),
        (a(!0), o(g, null, _(B.value, (t, u) => (a(), o("circle", {
          cx: t.x,
          cy: t.y,
          r: t.r,
          fill: e.value.style.chart.layout.roots.useGradient ? `url(#root_gradient_${w.value}_${t.rootIndex})` : t.color,
          stroke: e.value.style.chart.layout.roots.stroke,
          "stroke-width": e.value.style.chart.layout.roots.strokeWidth,
          style: h(`cursor:pointer; opacity:${I(t) ? 1 : 0.05}`),
          onClick: (b) => xe(t)
        }, null, 12, Yt))), 256)),
        e.value.style.chart.layout.roots.labels.show ? (a(), o("g", qt, [
          (a(!0), o(g, null, _(B.value, (t, u) => (a(), o("text", {
            x: t.x,
            y: t.y + e.value.style.chart.layout.roots.labels.fontSize / 2.6,
            "text-anchor": "middle",
            "font-size": e.value.style.chart.layout.roots.labels.fontSize,
            fill: e.value.style.chart.layout.roots.labels.adaptColorToBackground ? n(ze)(t.color) : e.value.style.chart.layout.roots.labels.color,
            "font-weight": "bold",
            style: h(`cursor:pointer; opacity:${I(t) ? 1 : 0.05}`),
            onClick: (b) => xe(t)
          }, c(n(G)(
            e.value.style.chart.layout.roots.labels.formatter,
            t.total,
            n(z)({
              p: e.value.style.chart.layout.roots.labels.prefix,
              v: t.total,
              s: e.value.style.chart.layout.roots.labels.suffix,
              r: e.value.style.chart.layout.roots.labels.roundingValue
            }),
            { datapoint: t }
          )), 13, Ht))), 256)),
          (a(!0), o(g, null, _(B.value, (t) => (a(), o("g", null, [
            d.value && t.rootIndex === d.value.rootIndex || x.value && t.rootIndex === x.value.rootIndex || L.value && t.rootIndex === L.value.rootIndex ? (a(), o("g", Wt, [
              s("text", {
                x: t.x,
                y: t.y + t.r + 24,
                "text-anchor": "middle",
                fill: e.value.style.chart.layout.roots.labels.name.color,
                "font-size": e.value.style.chart.layout.roots.labels.name.fontSize,
                "font-weight": e.value.style.chart.layout.roots.labels.name.bold ? "bold" : "normal",
                onClick: $
              }, c(t.name), 9, Kt)
            ])) : f("", !0)
          ]))), 256))
        ])) : f("", !0),
        (a(!0), o(g, null, _(j.value, (t) => (a(), o("rect", {
          x: t.x1,
          y: t.y1,
          height: r.value.branchSize,
          width: t.x2 - t.x1,
          fill: e.value.style.chart.layout.branches.underlayerColor,
          rx: e.value.style.chart.layout.branches.borderRadius,
          stroke: "none",
          style: h(`opacity:${I(t) ? 1 : 0.05}`),
          onClick: (u) => oe(t)
        }, null, 12, Jt))), 256)),
        (a(!0), o(g, null, _(j.value, (t, u) => (a(), o("rect", {
          x: t.x1,
          y: t.y1,
          height: r.value.branchSize,
          width: t.x2 - t.x1,
          fill: e.value.style.chart.layout.branches.useGradient ? `url(#branch_gradient_${w.value}_${t.rootIndex})` : t.color,
          rx: e.value.style.chart.layout.branches.borderRadius,
          stroke: e.value.style.chart.layout.branches.stroke,
          "stroke-width": e.value.style.chart.layout.branches.strokeWidth,
          style: h(`cursor:pointer; opacity:${I(t) ? 1 : 0.05}`),
          onClick: (b) => oe(t)
        }, null, 12, Qt))), 256)),
        e.value.style.chart.layout.branches.labels.dataLabels.show ? (a(), o("g", Zt, [
          (a(!0), o(g, null, _(j.value, (t) => (a(), o("g", null, [
            t.proportionToRoot * 100 > e.value.style.chart.layout.branches.labels.dataLabels.hideUnderValue ? (a(), o("text", {
              key: 0,
              x: t.x1 + 6,
              y: t.y1 + r.value.branchSize / 1.5,
              "text-anchor": "start",
              fill: n(ze)(t.color),
              "font-size": e.value.style.chart.layout.branches.labels.dataLabels.fontSize,
              "font-weight": "bold",
              style: h(`cursor:pointer; opacity:${I(t) ? 1 : 0.05}`),
              onClick: (u) => oe(t)
            }, c(n(G)(
              e.value.style.chart.layout.branches.labels.dataLabels.formatter,
              t.value,
              n(z)({
                p: e.value.style.chart.layout.branches.labels.dataLabels.prefix,
                v: t.value,
                s: e.value.style.chart.layout.branches.labels.dataLabels.suffix,
                r: e.value.style.chart.layout.branches.labels.dataLabels.roundingValue
              }),
              { datapoint: t }
            )), 13, el)) : f("", !0)
          ]))), 256))
        ])) : f("", !0),
        (a(!0), o(g, null, _(j.value, (t, u) => (a(), o("g", null, [
          (a(!0), o(g, null, _(n(Ne)(
            { series: t.breakdown, base: 1 },
            t.x2 + 24 + e.value.style.chart.layout.nuts.offsetX,
            t.y1 + r.value.branchSize / 2,
            r.value.branchSize / 3,
            r.value.branchSize / 3
          ), (b, y) => (a(), o("path", {
            d: b.path,
            stroke: b.color,
            "stroke-width": 10,
            fill: "none",
            style: h(`opacity:${I(t) ? 1 : 0.1}`)
          }, null, 12, tl))), 256)),
          s("circle", {
            fill: e.value.style.chart.layout.nuts.useGradient ? `url(#nut_${w.value})` : "transparent",
            cx: t.x2 + 24 + e.value.style.chart.layout.nuts.offsetX,
            cy: t.y1 + r.value.branchSize / 2,
            r: r.value.branchSize / 2 + 2,
            onClick: (b) => Ge(t),
            style: h(`cursor:pointer;opacity:${I(t) ? 1 : 0.1}`)
          }, null, 12, ll)
        ]))), 256)),
        e.value.style.chart.layout.branches.labels.show && !x.value ? (a(), o("g", al, [
          (a(!0), o(g, null, _(j.value, (t) => (a(), o("text", {
            x: t.x2 + r.value.branchSize + 24 + e.value.style.chart.layout.nuts.offsetX,
            y: t.y1 + r.value.branchSize / 2 + 5,
            "font-size": e.value.style.chart.layout.branches.labels.fontSize,
            "font-weight": e.value.style.chart.layout.branches.labels.bold ? "bold" : "normal",
            fill: e.value.style.chart.layout.branches.labels.color,
            "text-anchor": "start",
            style: h(`opacity:${I(t) ? 1 : 0.1}`)
          }, c(t.name), 13, ol))), 256))
        ])) : f("", !0),
        s("line", {
          x1: 256 + r.value.padding.left,
          x2: 256 + r.value.padding.left,
          y1: C.value.top,
          y2: C.value.bottom,
          stroke: e.value.style.chart.layout.verticalSeparator.stroke,
          "stroke-width": e.value.style.chart.layout.verticalSeparator.strokeWidth
        }, null, 8, sl),
        !d.value && !x.value ? (a(), o("foreignObject", {
          key: 6,
          x: 0,
          y: C.value.bottom,
          height: r.value.height - C.value.bottom,
          width: r.value.width,
          style: { overflow: "visible" },
          onClick: $
        }, [
          s("div", nl, [
            s("div", rl, [
              (a(!0), o(g, null, _(B.value, (t) => (a(), o("div", {
                style: h(`display:flex;align-items:center;gap:3px;flex-direction:row;font-size:${e.value.style.chart.layout.legend.fontSize}px;`)
              }, [
                (a(), o("svg", il, [
                  s("circle", {
                    cx: "10",
                    cy: "10",
                    r: "10",
                    fill: t.color,
                    stroke: "none"
                  }, null, 8, cl)
                ])),
                s("span", null, c(t.name) + ":", 1),
                s("b", null, c(n(G)(
                  e.value.style.chart.layout.roots.labels.formatter,
                  t.total,
                  n(z)({
                    p: e.value.style.chart.layout.legend.prefix,
                    v: t.total,
                    s: e.value.style.chart.layout.legend.suffix,
                    r: e.value.style.chart.layout.legend.roundingValue
                  }),
                  { datapoint: t }
                )), 1),
                J(" (" + c(n(z)({
                  v: t.total / M.value * 100,
                  s: "%",
                  r: e.value.style.chart.layout.legend.roundingPercentage
                })) + ") ", 1)
              ], 4))), 256))
            ])
          ])
        ], 8, ul)) : f("", !0),
        d.value && R.value ? (a(), o("g", dl, [
          (a(), o("foreignObject", {
            x: 0,
            y: Ee(),
            height: r.value.height - C.value.bottom,
            width: r.value.width,
            style: { overflow: "visible" },
            onClick: $
          }, [
            s("div", yl, [
              s("b", null, c(d.value.name), 1),
              s("div", hl, [
                (a(!0), o(g, null, _(d.value.breakdown, (t, u) => (a(), o("div", {
                  style: h(`display:flex;align-items:center;gap:6px;flex-direction:row;font-size:${e.value.style.chart.layout.legend.fontSize}px;`)
                }, [
                  (a(), o("svg", fl, [
                    s("circle", {
                      cx: "10",
                      cy: "10",
                      r: "10",
                      fill: t.color,
                      stroke: "none"
                    }, null, 8, bl)
                  ])),
                  s("span", null, [
                    J(c(t.name) + ": ", 1),
                    s("b", null, c(e.value.style.chart.layout.legend.prefix) + " " + c(t.value.toFixed(e.value.style.chart.layout.nuts.selected.labels.roundingValue)) + " " + c(e.value.style.chart.layout.legend.suffix), 1),
                    J(" (" + c((t.proportionToBranch * 100).toFixed(e.value.style.chart.layout.nuts.selected.labels.roundingPercentage)) + "%)", 1)
                  ])
                ], 4))), 256))
              ])
            ])
          ], 8, vl)),
          s("circle", {
            cx: d.value.x2 + 24 + e.value.style.chart.layout.nuts.offsetX,
            cy: d.value.y1 + r.value.branchSize / 2,
            r: 256,
            fill: `url(#nut_underlayer_${w.value})`,
            onClick: A,
            class: k(e.value.style.chart.layout.nuts.selected.useMotion ? "vue-ui-chestnut-animated" : "")
          }, null, 10, pl),
          (a(!0), o(g, null, _(R.value, (t) => (a(), o("g", null, [
            D(t) ? (a(), o("path", {
              key: 0,
              d: n(ot)(
                t,
                {
                  x: d.value.x2 + 24 + e.value.style.chart.layout.nuts.offsetX,
                  y: d.value.y1 + r.value.branchSize / 2
                },
                16,
                16,
                !1,
                !1,
                64
              ),
              stroke: t.color,
              "stroke-width": "1",
              "stroke-linecap": "round",
              "stroke-linejoin": "round",
              fill: "none",
              class: k(e.value.style.chart.layout.nuts.selected.useMotion ? "vue-ui-chestnut-animated" : "")
            }, null, 10, gl)) : f("", !0)
          ]))), 256)),
          s("circle", {
            cx: d.value.x2 + 24 + e.value.style.chart.layout.nuts.offsetX,
            cy: d.value.y1 + r.value.branchSize / 2,
            r: 118,
            fill: e.value.style.chart.backgroundColor,
            onClick: A,
            class: k(e.value.style.chart.layout.nuts.selected.useMotion ? "vue-ui-chestnut-animated" : "")
          }, null, 10, _l),
          (a(!0), o(g, null, _(R.value, (t) => (a(), o("path", {
            d: t.path,
            stroke: t.color,
            "stroke-width": 64,
            fill: "none",
            onClick: A,
            class: k(e.value.style.chart.layout.nuts.selected.useMotion ? "vue-ui-chestnut-animated" : "")
          }, null, 10, xl))), 256)),
          s("circle", {
            cx: d.value.x2 + 24 + e.value.style.chart.layout.nuts.offsetX,
            cy: d.value.y1 + r.value.branchSize / 2,
            r: 100,
            fill: `url(#nutpick_${w.value})`,
            onClick: A,
            class: k(e.value.style.chart.layout.nuts.selected.useMotion ? "vue-ui-chestnut-animated" : "")
          }, null, 10, ml),
          s("circle", {
            cx: d.value.x2 + 24 + e.value.style.chart.layout.nuts.offsetX,
            cy: d.value.y1 + r.value.branchSize / 2,
            r: 48,
            fill: e.value.style.chart.backgroundColor,
            onClick: A,
            class: k(e.value.style.chart.layout.nuts.selected.useMotion ? "vue-ui-chestnut-animated" : "")
          }, null, 10, kl),
          s("text", {
            x: d.value.x2 + 24 + e.value.style.chart.layout.nuts.offsetX,
            y: d.value.y1 + 8,
            fill: e.value.style.chart.layout.nuts.selected.labels.core.total.color,
            "font-size": e.value.style.chart.layout.nuts.selected.labels.core.total.fontSize,
            "font-weight": e.value.style.chart.layout.nuts.selected.labels.core.total.bold ? "bold" : "normal",
            "text-anchor": "middle",
            onClick: A,
            class: k(e.value.style.chart.layout.nuts.selected.useMotion ? "vue-ui-chestnut-animated" : "")
          }, c(e.value.translations.total), 11, wl),
          s("text", {
            x: d.value.x2 + 24 + e.value.style.chart.layout.nuts.offsetX,
            y: d.value.y1 + 36,
            fill: e.value.style.chart.layout.nuts.selected.labels.core.value.color,
            "font-size": e.value.style.chart.layout.nuts.selected.labels.core.value.fontSize,
            "font-weight": e.value.style.chart.layout.nuts.selected.labels.core.value.bold ? "bold" : "normal",
            "text-anchor": "middle",
            onClick: A,
            class: k(e.value.style.chart.layout.nuts.selected.useMotion ? "vue-ui-chestnut-animated" : "")
          }, c(n(G)(
            e.value.style.chart.layout.nuts.selected.labels.dataLabels.formatter,
            d.value.value,
            n(z)({
              p: e.value.style.chart.layout.nuts.selected.labels.core.value.prefix,
              v: d.value.value,
              s: e.value.style.chart.layout.nuts.selected.labels.core.value.suffix,
              r: e.value.style.chart.layout.nuts.selected.roundingValue
            }),
            { datapoint: d.value }
          )), 11, $l),
          (a(!0), o(g, null, _(R.value, (t, u) => (a(), o("g", null, [
            D(t) ? (a(), o("text", {
              key: 0,
              x: n(V)(t).x,
              "text-anchor": n(V)(t).anchor,
              y: n(H)(t),
              fill: t.color,
              "font-size": e.value.style.chart.layout.nuts.selected.labels.dataLabels.fontSize,
              style: h(`font-weight:${e.value.style.chart.layout.nuts.selected.labels.dataLabels.bold ? "bold" : ""}`),
              class: k(e.value.style.chart.layout.nuts.selected.useMotion ? "vue-ui-chestnut-animated" : "")
            }, " ⬤ ", 14, Cl)) : f("", !0),
            D(t) ? (a(), o("text", {
              key: 1,
              x: n(V)(t, !0).x,
              "text-anchor": n(V)(t, !0).anchor,
              y: n(H)(t),
              fill: e.value.style.chart.layout.nuts.selected.labels.dataLabels.color,
              "font-size": e.value.style.chart.layout.nuts.selected.labels.dataLabels.fontSize,
              style: h(`font-weight:${e.value.style.chart.layout.nuts.selected.labels.dataLabels.bold ? "bold" : ""}`),
              class: k(e.value.style.chart.layout.nuts.selected.useMotion ? "vue-ui-chestnut-animated" : "")
            }, c(d.value.breakdown[u].name), 15, Tl)) : f("", !0)
          ]))), 256)),
          (a(!0), o(g, null, _(R.value, (t, u) => (a(), o("g", null, [
            D(t) ? (a(), o("text", {
              key: 0,
              x: n(V)(t, !0).x,
              "text-anchor": n(V)(t).anchor,
              y: n(H)(t) + e.value.style.chart.layout.nuts.selected.labels.dataLabels.fontSize,
              fill: e.value.style.chart.layout.nuts.selected.labels.dataLabels.color,
              "font-size": e.value.style.chart.layout.nuts.selected.labels.dataLabels.fontSize,
              style: h(`font-weight:${e.value.style.chart.layout.nuts.selected.labels.dataLabels.bold ? "bold" : ""}`),
              class: k(e.value.style.chart.layout.nuts.selected.useMotion ? "vue-ui-chestnut-animated" : "")
            }, c(n(z)({
              v: d.value.breakdown[u].value / d.value.value * 100,
              s: "%",
              r: e.value.style.chart.layout.nuts.selected.labels.roundingPercentage
            })) + " " + c(e.value.translations.of) + " " + c(d.value.breakdown[u].branchName) + " " + c(n(G)(
              e.value.style.chart.layout.nuts.selected.labels.dataLabels.formatter,
              d.value.breakdown[u].value,
              n(z)({
                p: e.value.style.chart.layout.nuts.selected.labels.dataLabels.prefix,
                v: d.value.breakdown[u].value,
                s: e.value.style.chart.layout.nuts.selected.labels.dataLabels.suffix,
                r: e.value.style.chart.layout.nuts.selected.roundingValue
              }),
              { datapoint: R.value, seriesIndex: u }
            )), 15, zl)) : f("", !0),
            D(t) ? (a(), o("text", {
              key: 1,
              x: n(V)(t, !0).x,
              "text-anchor": n(V)(t).anchor,
              y: n(H)(t) + e.value.style.chart.layout.nuts.selected.labels.dataLabels.fontSize * 2,
              fill: e.value.style.chart.layout.nuts.selected.labels.dataLabels.color,
              "font-size": e.value.style.chart.layout.nuts.selected.labels.dataLabels.fontSize,
              style: h(`font-weight:${e.value.style.chart.layout.nuts.selected.labels.dataLabels.bold ? "bold" : ""}`),
              class: k(e.value.style.chart.layout.nuts.selected.useMotion ? "vue-ui-chestnut-animated" : "")
            }, c(n(z)({
              v: d.value.breakdown[u].proportionToRoot * 100,
              s: "%",
              r: e.value.style.chart.layout.nuts.selected.labels.roundingPercentage
            })) + " " + c(e.value.translations.of) + " " + c(d.value.breakdown[u].rootName), 15, Nl)) : f("", !0),
            D(t) ? (a(), o("text", {
              key: 2,
              x: n(V)(t, !0).x,
              "text-anchor": n(V)(t).anchor,
              y: n(H)(t) + e.value.style.chart.layout.nuts.selected.labels.dataLabels.fontSize * 3,
              fill: e.value.style.chart.layout.nuts.selected.labels.dataLabels.color,
              "font-size": e.value.style.chart.layout.nuts.selected.labels.dataLabels.fontSize,
              style: h(`font-weight:${e.value.style.chart.layout.nuts.selected.labels.dataLabels.bold ? "bold" : ""}`),
              class: k(e.value.style.chart.layout.nuts.selected.useMotion ? "vue-ui-chestnut-animated" : "")
            }, c(n(z)({
              v: d.value.breakdown[u].proportionToTree * 100,
              s: "%",
              r: e.value.style.chart.layout.nuts.selected.labels.roundingPercentage
            })) + " " + c(e.value.translations.proportionToTree), 15, Sl)) : f("", !0)
          ]))), 256))
        ])) : f("", !0),
        (a(!0), o(g, null, _(j.value, (t) => (a(), o("g", null, [
          x.value && x.value.id === t.id && !d.value ? (a(), o("text", {
            key: 0,
            x: t.x1 + 6,
            y: t.y1 + r.value.branchSize + 24,
            "font-weight": "bold",
            "text-anchor": "start",
            "font-size": e.value.style.chart.layout.branches.labels.dataLabels.fontSize,
            fill: e.value.style.chart.layout.branches.labels.color,
            onClick: $
          }, c(t.name) + ": " + c(n(G)(
            e.value.style.chart.layout.branches.labels.dataLabels.formatter,
            t.value,
            n(z)({
              p: e.value.style.chart.layout.branches.labels.dataLabels.prefix,
              v: t.value,
              s: e.value.style.chart.layout.branches.labels.dataLabels.suffix,
              r: e.value.style.chart.layout.branches.labels.dataLabels.roundingValue
            }),
            { datapoint: t }
          )), 9, Fl)) : f("", !0),
          x.value && x.value.id === t.id && !d.value ? (a(), o("text", {
            key: 1,
            x: t.x1 + 6,
            y: t.y1 + r.value.branchSize + 48,
            "text-anchor": "start",
            "font-size": e.value.style.chart.layout.branches.labels.dataLabels.fontSize,
            fill: e.value.style.chart.layout.branches.labels.color,
            onClick: $
          }, c(n(z)({
            v: t.proportionToRoot * 100,
            s: "%",
            r: e.value.style.chart.layout.branches.labels.dataLabels.roundingPercentage
          })) + " " + c(e.value.translations.of) + " " + c(t.rootName), 9, Ll)) : f("", !0),
          x.value && x.value.id === t.id && !d.value ? (a(), o("text", {
            key: 2,
            x: t.x1 + 6,
            y: t.y1 + r.value.branchSize + 72,
            "text-anchor": "start",
            "font-size": e.value.style.chart.layout.branches.labels.dataLabels.fontSize,
            fill: e.value.style.chart.layout.branches.labels.color,
            onClick: $
          }, c(n(z)({
            v: t.value / M.value * 100,
            s: "%",
            r: e.value.style.chart.layout.branches.labels.dataLabels.roundingPercentage
          })) + " " + c(e.value.translations.proportionToTree), 9, Il)) : f("", !0)
        ]))), 256)),
        F(l.$slots, "svg", { svg: r.value }, void 0, !0)
      ], 14, gt)) : f("", !0),
      l.$slots.watermark ? (a(), o("div", Pl, [
        F(l.$slots, "watermark", ue(ne({ isPrinting: n(he) || n(fe) })), void 0, !0)
      ])) : f("", !0),
      Y.value ? f("", !0) : (a(), K(it, {
        key: 5,
        config: {
          type: "chestnut",
          style: {
            backgroundColor: e.value.style.chart.backgroundColor,
            chestnut: {
              color: "#CCCCCC"
            }
          }
        }
      }, null, 8, ["config"])),
      F(l.$slots, "legend", { legend: N.value }, void 0, !0),
      l.$slots.source ? (a(), o("div", Vl, [
        F(l.$slots, "source", {}, void 0, !0)
      ], 512)) : f("", !0),
      Y.value ? (a(), K(dt, {
        key: 7,
        hideDetails: "",
        config: {
          open: U.value.showTable,
          maxHeight: 1e4,
          body: {
            backgroundColor: e.value.style.chart.backgroundColor,
            color: e.value.style.chart.color
          },
          head: {
            backgroundColor: e.value.style.chart.backgroundColor,
            color: e.value.style.chart.color
          }
        }
      }, {
        content: X(() => [
          s("div", {
            ref_key: "tableContainer",
            ref: le,
            class: "vue-ui-chestnut-table"
          }, [
            s("div", Ol, [
              s("div", {
                role: "button",
                tabindex: "0",
                style: h(`width:32px; position: absolute; top: 0; left:4px; padding: 0 0px; display: flex; align-items:center;justify-content:center;height: 36px; width: 32px; cursor:pointer; background:${e.value.table.th.backgroundColor};`),
                onClick: i[0] || (i[0] = (t) => U.value.showTable = !1),
                onKeypress: i[1] || (i[1] = Ke((t) => U.value.showTable = !1, ["enter"]))
              }, [
                $e(ct, {
                  name: "close",
                  stroke: e.value.table.th.color,
                  "stroke-width": 2
                }, null, 8, ["stroke"])
              ], 36),
              s("div", {
                style: { width: "100%" },
                class: k({ "vue-ui-responsive": ge.value })
              }, [
                s("table", Ml, [
                  s("caption", {
                    style: h({ backgroundColor: e.value.table.th.backgroundColor, color: e.value.table.th.color, outline: e.value.table.th.outline }),
                    class: "vue-ui-data-table__caption"
                  }, [
                    J(c(e.value.style.chart.layout.title.text) + " ", 1),
                    e.value.style.chart.layout.title.subtitle.text ? (a(), o("span", Rl, c(e.value.style.chart.layout.title.subtitle.text), 1)) : f("", !0)
                  ], 4),
                  s("thead", null, [
                    s("tr", {
                      role: "row",
                      style: h(`background:${e.value.table.th.backgroundColor};color:${e.value.table.th.color}`)
                    }, [
                      (a(!0), o(g, null, _(v.value.head, (t) => (a(), o("th", {
                        style: h(`outline:${e.value.table.th.outline}`)
                      }, c(t), 5))), 256))
                    ], 4)
                  ]),
                  s("tbody", null, [
                    (a(!0), o(g, null, _(v.value.body, (t, u) => (a(), o("tr", {
                      class: k({ "vue-ui-data-table__tbody__row": !0, "vue-ui-data-table__tbody__row-even": u % 2 === 0, "vue-ui-data-table__tbody__row-odd": u % 2 !== 0 }),
                      style: h(`background:${e.value.table.td.backgroundColor};color:${e.value.table.td.color}`)
                    }, [
                      s("td", {
                        class: "vue-ui-data-table__tbody__td",
                        style: h(`outline:${e.value.table.td.outline}`),
                        "data-cell": v.value.head[0]
                      }, [
                        s("div", jl, [
                          v.value.body[u - 1] && v.value.body[u - 1].rootName === t.rootName ? (a(), o("span", Al)) : (a(), o("span", Xl, c(t.rootName), 1))
                        ])
                      ], 12, Bl),
                      s("td", {
                        class: "vue-ui-data-table__tbody__td",
                        style: h(`outline:${e.value.table.td.outline}`),
                        "data-cell": v.value.head[1]
                      }, [
                        s("div", El, [
                          v.value.body[u - 1] && v.value.body[u - 1].rootName === t.rootName ? (a(), o("span", Ul)) : (a(), o("span", Dl, c(t.rootValue.toFixed(e.value.table.td.roundingValue)), 1))
                        ])
                      ], 12, Gl),
                      s("td", {
                        class: "vue-ui-data-table__tbody__td",
                        style: h(`outline:${e.value.table.td.outline}`),
                        "data-cell": v.value.head[2]
                      }, [
                        s("div", ql, [
                          v.value.body[u - 1] && v.value.body[u - 1].rootName === t.rootName ? (a(), o("span", Hl)) : (a(), o("span", Wl, c((t.rootToTotal * 100).toFixed(e.value.table.td.roundingPercentage)) + "% ", 1))
                        ])
                      ], 12, Yl),
                      s("td", {
                        class: "vue-ui-data-table__tbody__td",
                        style: h(`outline:${e.value.table.td.outline}`),
                        "data-cell": v.value.head[3]
                      }, [
                        s("div", Jl, [
                          v.value.body[u - 1] && v.value.body[u - 1].branchName === t.branchName ? (a(), o("span", Ql)) : (a(), o("span", Zl, c(t.branchName), 1))
                        ])
                      ], 12, Kl),
                      s("td", {
                        class: "vue-ui-data-table__tbody__td",
                        style: h(`outline:${e.value.table.td.outline}`),
                        "data-cell": v.value.head[4]
                      }, [
                        s("div", ta, [
                          v.value.body[u - 1] && v.value.body[u - 1].branchName === t.branchName ? (a(), o("span", la)) : (a(), o("span", aa, c(t.branchValue.toFixed(e.value.table.td.roundingValue)), 1))
                        ])
                      ], 12, ea),
                      s("td", {
                        class: "vue-ui-data-table__tbody__td",
                        style: h(`outline:${e.value.table.td.outline}`),
                        "data-cell": v.value.head[5]
                      }, [
                        s("div", sa, [
                          v.value.body[u - 1] && v.value.body[u - 1].branchName === t.branchName ? (a(), o("span", ua)) : (a(), o("span", na, c((t.branchToRoot * 100).toFixed(e.value.table.td.roundingPercentage)) + "% ", 1))
                        ])
                      ], 12, oa),
                      s("td", {
                        class: "vue-ui-data-table__tbody__td",
                        style: h(`outline:${e.value.table.td.outline}`),
                        "data-cell": v.value.head[6]
                      }, [
                        s("div", ia, [
                          v.value.body[u - 1] && v.value.body[u - 1].branchName === t.branchName ? (a(), o("span", ca)) : (a(), o("span", da, c((t.branchToTotal * 100).toFixed(e.value.table.td.roundingPercentage)) + "% ", 1))
                        ])
                      ], 12, ra),
                      s("td", {
                        class: "vue-ui-data-table__tbody__td",
                        style: h(`outline:${e.value.table.td.outline}`),
                        "data-cell": v.value.head[7]
                      }, [
                        s("div", ya, c(t.nutName), 1)
                      ], 12, va),
                      s("td", {
                        class: "vue-ui-data-table__tbody__td",
                        style: h(`outline:${e.value.table.td.outline}`),
                        "data-cell": v.value.head[8]
                      }, [
                        s("div", fa, c(t.nutValue.toFixed(e.value.table.td.roundingValue)), 1)
                      ], 12, ha),
                      s("td", {
                        class: "vue-ui-data-table__tbody__td",
                        style: h(`outline:${e.value.table.td.outline}`),
                        "data-cell": v.value.head[9]
                      }, [
                        s("div", pa, c((t.nutToBranch * 100).toFixed(e.value.table.td.roundingPercentage)) + "% ", 1)
                      ], 12, ba),
                      s("td", {
                        class: "vue-ui-data-table__tbody__td",
                        style: h(`outline:${e.value.table.td.outline}`),
                        "data-cell": v.value.head[10]
                      }, [
                        s("div", _a, c((t.nutToRoot * 100).toFixed(e.value.table.td.roundingPercentage)) + "% ", 1)
                      ], 12, ga),
                      s("td", {
                        class: "vue-ui-data-table__tbody__td",
                        style: h(`outline:${e.value.table.td.outline}`),
                        "data-cell": v.value.head[11]
                      }, [
                        s("div", ma, c((t.nutToTotal * 100).toFixed(e.value.table.td.roundingPercentage)) + "% ", 1)
                      ], 12, xa)
                    ], 6))), 256))
                  ])
                ])
              ], 2)
            ])
          ], 512)
        ]),
        _: 1
      }, 8, ["config"])) : f("", !0)
    ], 46, bt));
  }
}, Oa = /* @__PURE__ */ ft(ka, [["__scopeId", "data-v-1e94e013"]]);
export {
  Oa as default
};
