import { computed as w, ref as d, onMounted as ut, onBeforeUnmount as st, watch as Ue, openBlock as o, createElementBlock as n, normalizeClass as de, normalizeStyle as z, unref as s, createBlock as G, createCommentVNode as i, renderSlot as b, createSlots as nt, withCtx as $, normalizeProps as R, guardReactiveProps as W, createVNode as je, createElementVNode as h, Fragment as k, renderList as X, toDisplayString as x, createTextVNode as He, nextTick as rt, pushScopeId as it, popScopeId as vt } from "vue";
import { u as ct, o as dt, e as Ee, g as ht, c as yt, b as ft, d as Re, p as U, m as pt, H as gt, f as F, X as bt, s as ee, w as mt, j as wt, I as L, i as Y, k as m, n as te, t as kt, a as _t, x as xt, q as Ct, r as $t } from "./index-Z_vzxZTo.js";
import { t as Pt, u as St } from "./useResponsive-CoxXLe23.js";
import { _ as Ft } from "./Title-obqvTiXP.js";
import { u as Lt, U as Tt } from "./usePrinter-Ck0oiMlt.js";
import { D as zt } from "./DataTable-BBh7_ttv.js";
import { _ as Ot } from "./Tooltip-BK-ACGDE.js";
import { L as Yt } from "./Legend-WOejx9sp.js";
import At from "./vue-ui-skeleton-BMRe3SzB.js";
import Nt from "./vue-ui-accordion-CV2-8b1O.js";
import { u as We } from "./useNestedProp-Buhi5uyL.js";
import { _ as Xt } from "./PackageVersion-dR8EUy_P.js";
import { P as It } from "./PenAndPaper-CrXlqi9I.js";
import { u as Dt } from "./useUserOptionState-BIvW1Kz7.js";
import { _ as Mt } from "./_plugin-vue_export-helper-CHgC5LLL.js";
const Bt = (q) => (it("data-v-7c3807c4"), q = q(), vt(), q), Vt = ["id"], Gt = ["xmlns", "viewBox"], Ut = ["width", "height"], jt = { key: 1 }, Ht = ["id"], Et = ["stop-color"], Rt = ["offset", "stop-color"], Wt = ["offset", "stop-color"], qt = ["stop-color"], Jt = { key: 2 }, Kt = ["id", "cx", "cy"], Qt = ["stop-color", "stop-opacity"], Zt = ["stop-color"], el = ["id"], tl = ["id"], ll = /* @__PURE__ */ Bt(() => /* @__PURE__ */ h("feColorMatrix", {
  type: "saturate",
  values: "0"
}, null, -1)), al = ["id"], ol = ["flood-color"], ul = ["id"], sl = ["flood-color"], nl = ["d", "stroke", "filter"], rl = ["x1", "y1", "x2", "y2", "stroke", "filter"], il = ["cx", "cy", "r", "fill", "filter"], vl = ["stroke", "d"], cl = ["d", "fill", "stroke", "stroke-width", "filter"], dl = { key: 0 }, hl = ["stroke", "d"], yl = { key: 0 }, fl = ["d", "stroke", "stroke-width", "filter"], pl = ["d", "fill", "stroke", "stroke-width", "filter"], gl = { key: 1 }, bl = ["cx", "cy", "r", "fill", "stroke", "stroke-width"], ml = ["cx", "cy", "r", "stroke"], wl = ["cx", "cy", "r", "fill"], kl = { key: 0 }, _l = ["d", "fill", "onMouseenter", "onClick"], xl = { key: 1 }, Cl = ["cx", "cy", "r", "fill"], $l = ["x", "y", "fill", "font-size"], Pl = ["x", "y", "fill", "font-size"], Sl = ["x", "y", "fill", "font-size"], Fl = ["x", "y", "fill", "font-size"], Ll = ["filter"], Tl = { key: 0 }, zl = ["x", "y"], Ol = { key: 1 }, Yl = ["cx", "cy", "fill", "stroke", "filter", "onClick"], Al = ["cx", "cy", "fill", "stroke", "filter", "onClick"], Nl = ["text-anchor", "x", "y", "fill", "font-size", "onClick"], Xl = ["text-anchor", "x", "y", "fill", "font-size", "onClick"], Il = ["text-anchor", "x", "y", "fill", "font-size", "onClick"], Dl = ["text-anchor", "x", "y", "fill", "font-size", "onClick"], Ml = { key: 2 }, Bl = ["x", "y", "width"], Vl = ["x", "y", "width"], Gl = {
  key: 5,
  class: "vue-data-ui-watermark"
}, Ul = ["onClick"], jl = {
  key: 0,
  style: { "font-variant-numeric": "tabular-nums" }
}, Hl = { key: 1 }, El = ["innerHTML"], Rl = {
  __name: "vue-ui-donut",
  props: {
    config: {
      type: Object,
      default() {
        return {};
      }
    },
    dataset: {
      type: Array,
      default() {
        return [];
      }
    }
  },
  emits: ["selectLegend", "selectDatapoint"],
  setup(q, { expose: qe, emit: he }) {
    const A = q, { vue_ui_donut: Je } = ct(), J = w({
      get() {
        return !!A.dataset && A.dataset.length;
      },
      set(l) {
        return l;
      }
    }), j = d(null), ye = d(null), fe = d(null), le = d(null), pe = d(null), ge = d(null), be = d(0), me = d(0), we = d(0);
    ut(() => {
      ke();
    }), st(() => {
      le.value && le.value.disconnect();
    });
    function ke() {
      if (dt(A.dataset) ? Ee({
        componentName: "VueUiDonut",
        type: "dataset"
      }) : A.dataset.forEach((l, r) => {
        ht({
          datasetObject: l,
          requiredAttributes: ["name", "values"]
        }).forEach((t) => {
          J.value = !1, Ee({
            componentName: "VueUiDonut",
            type: "datasetSerieAttribute",
            property: t,
            index: r
          });
        });
      }), e.value.responsive) {
        const l = Pt(() => {
          const { width: r, height: t } = St({
            chart: j.value,
            title: e.value.style.chart.title.text ? ye.value : null,
            legend: e.value.style.chart.legend.show ? fe.value : null,
            source: pe.value,
            noTitle: ge.value
          });
          u.value.width = r, u.value.height = t;
        });
        le.value = new ResizeObserver(l), le.value.observe(j.value.parentNode);
      }
    }
    const _ = d(yt()), Ke = d(null), ae = d(!1), se = d(""), P = d(null), _e = d(0);
    function xe() {
      const l = We({
        userConfig: A.config,
        defaultConfig: Je
      });
      return l.theme ? {
        ...We({
          userConfig: kt.vue_ui_donut[l.theme] || A.config,
          defaultConfig: l
        }),
        customPalette: _t[l.theme] || U
      } : l;
    }
    const e = w({
      get: () => xe(),
      set: (l) => l
    }), { userOptionsVisible: ne, setUserOptionsVisibility: Ce, keepUserOptionState: $e } = Dt({ config: e.value });
    Ue(() => A.config, (l) => {
      e.value = xe(), ne.value = !e.value.showOnChartHover, ke(), be.value += 1, me.value += 1, we.value += 1;
    }, { deep: !0 });
    const { isPrinting: Pe, isImaging: Se, generatePdf: Fe, generateImage: Le } = Lt({
      elementId: `donut__${_.value}`,
      fileName: e.value.style.chart.title.text || "vue-ui-donut"
    }), Qe = w(() => e.value.userOptions.show && !e.value.style.chart.title.text), Te = w(() => ft(e.value.customPalette)), y = d({
      dataLabels: {
        show: e.value.style.chart.layout.labels.dataLabels.show
      },
      showTable: e.value.table.show,
      showTooltip: e.value.style.chart.tooltip.show
    }), u = d({
      height: 360,
      width: 512
    }), K = w(() => {
      const l = e.value.style.chart.layout.donut.strokeWidth / 512, r = u.value.width * l, t = r > C.value ? C.value : r;
      return t < 24 ? 24 : t;
    }), B = w(() => A.dataset.map((l, r) => ({
      name: l.name,
      color: Re(l.color) || Te.value[r] || U[r] || U[r % U.length],
      value: l.values.reduce((t, a) => t + a, 0),
      absoluteValues: l.values,
      comment: l.comment || ""
    }))), T = d(B.value);
    Ue(() => B.value, (l) => T.value = l);
    function Ze() {
      return B.value.map((l) => ({
        name: l.name,
        color: l.color,
        value: l.value
      }));
    }
    const N = d([]), ze = d(null), Oe = d(null), V = d(!1);
    function Ye(l) {
      const r = B.value.find((v, g) => g === l), t = T.value.find((v, g) => g === l);
      let a = t.value;
      if (N.value.includes(l)) {
        let g = function() {
          a > v ? (cancelAnimationFrame(ze.value), T.value = T.value.map((p, ce) => l === ce ? {
            ...p,
            value: v
          } : p), V.value = !1) : (V.value = !0, a += v * 0.025, T.value = T.value.map((p, ce) => l === ce ? {
            ...p,
            value: a
          } : p), ze.value = requestAnimationFrame(g));
        };
        N.value = N.value.filter((p) => p !== l);
        const v = r.value;
        g();
      } else if (N.value.length < B.value.length - 1) {
        let v = function() {
          a < t.value / 100 ? (cancelAnimationFrame(Oe.value), N.value.push(l), T.value = T.value.map((g, p) => l === p ? {
            ...g,
            value: 0
          } : g), V.value = !1) : (V.value = !0, a /= 1.1, T.value = T.value.map((g, p) => l === p ? {
            ...g,
            value: a
          } : g), Oe.value = requestAnimationFrame(v));
        };
        v();
      }
      he("selectLegend", I.value.map((v) => ({
        name: v.name,
        color: v.color,
        value: v.value
      })));
    }
    const I = w(() => (T.value.forEach((l, r) => {
      if ([null, void 0].includes(l.values))
        return {
          ...l,
          values: []
        };
    }), T.value.map((l, r) => ({
      ...l,
      seriesIndex: r
    })).filter((l, r) => !N.value.includes(r)))), Ae = w(() => A.dataset.map((l, r) => ({
      name: l.name,
      color: Re(l.color) || Te.value[r] || U[r] || U[r % U.length],
      value: (l.values || []).reduce((t, a) => t + a, 0),
      shape: "circle"
    })).map((l, r) => ({
      ...l,
      proportion: l.value / A.dataset.map((t) => (t.values || []).reduce((a, v) => a + v, 0)).reduce((t, a) => t + a, 0),
      opacity: N.value.includes(r) ? 0.5 : 1,
      segregate: () => !V.value && Ye(r),
      isSegregated: N.value.includes(r)
    }))), et = w(() => ({
      cy: "donut-div-legend",
      backgroundColor: e.value.style.chart.legend.backgroundColor,
      color: e.value.style.chart.legend.color,
      fontSize: e.value.style.chart.legend.fontSize,
      paddingBottom: 12,
      fontWeight: e.value.style.chart.legend.bold ? "bold" : ""
    })), C = w(() => {
      const l = Math.min(u.value.width / 3, u.value.height / 3);
      return l < 55 ? 55 : l;
    }), f = w(() => pt({ series: I.value }, u.value.width / 2, u.value.height / 2, C.value, C.value, 1.99999, 2, 1, 360, 105.25, K.value)), c = w(() => {
      const l = Math.max(...I.value.map((t) => t.value)), r = I.value.map((t) => t.value / l);
      return gt({
        series: r,
        center: {
          x: u.value.width / 2,
          y: u.value.height / 2
        },
        maxRadius: Math.min(u.value.width, u.value.height) / 3
      });
    });
    function H(l) {
      return l.x > u.value.width / 2 + 6 ? "start" : l.x < u.value.width / 2 - 6 ? "end" : "middle";
    }
    function tt(l) {
      return l.middlePoint.y > u.value.height / 2 ? L({ initX: l.middlePoint.x, initY: l.middlePoint.y, offset: 100, centerX: u.value.width / 2, centerY: u.value.height / 2 }).y : L({ initX: l.middlePoint.x, initY: l.middlePoint.y, offset: 0, centerX: u.value.width / 2, centerY: u.value.height / 2 }).y - 100;
    }
    function O(l) {
      return l.proportion * 100 > e.value.style.chart.layout.labels.dataLabels.hideUnderValue;
    }
    function re(l, r) {
      const t = l.value / lt(r);
      return isNaN(t) ? 0 : Y(
        e.value.style.chart.layout.labels.percentage.formatter,
        t * 100,
        F({
          v: t * 100,
          s: "%",
          r: e.value.style.chart.layout.labels.percentage.rounding
        }),
        { datapoint: l }
      );
    }
    function lt(l) {
      return [...l].map((r) => r.value).reduce((r, t) => r + t, 0);
    }
    const S = w(() => I.value.map((l) => l.value).reduce((l, r) => l + r, 0)), Ne = w(() => S.value / I.value.length), Xe = w(() => (l) => V.value ? l.proportion * 100 : l.value / S.value * 100), ie = d(null), Q = d(!1);
    function Ie({ datapoint: l, relativeIndex: r, seriesIndex: t, show: a = !1 }) {
      ie.value = { datapoint: l, seriesIndex: t, config: e.value, series: B.value }, ae.value = a, P.value = r;
      let v = "";
      const g = e.value.style.chart.tooltip.customFormat;
      if (Q.value = !1, xt(g))
        try {
          const p = g({
            seriesIndex: t,
            datapoint: l,
            series: B.value,
            config: e.value
          });
          typeof p == "string" && (se.value = p, Q.value = !0);
        } catch {
          console.warn("Custom format cannot be applied."), Q.value = !1;
        }
      if (!Q.value) {
        if (v += `<div style="width:100%;text-align:center;border-bottom:1px solid ${e.value.style.chart.tooltip.borderColor};padding-bottom:6px;margin-bottom:3px;">${l.name}</div>`, v += `<div style="display:flex;flex-direction:row;gap:6px;align-items:center;"><svg viewBox="0 0 12 12" height="14" width="14"><circle cx="6" cy="6" r="6" stroke="none" fill="${l.color}"/></svg>`, e.value.style.chart.tooltip.showValue && (v += `<b>${Y(
          e.value.style.chart.layout.labels.value.formatter,
          l.value,
          F({
            p: e.value.style.chart.layout.labels.dataLabels.prefix,
            v: l.value,
            s: e.value.style.chart.layout.labels.dataLabels.suffix,
            r: e.value.style.chart.tooltip.roundingValue
          }),
          {
            datapoint: l,
            relativeIndex: r,
            seriesIndex: t
          }
        )}</b>`), e.value.style.chart.tooltip.showPercentage) {
          const p = Y(
            e.value.style.chart.layout.labels.percentage.formatter,
            l.proportion * 100,
            F({
              v: l.proportion * 100,
              s: "%",
              r: e.value.style.chart.tooltip.roundingPercentage
            }),
            {
              datapoint: l,
              relativeIndex: r,
              seriesIndex: t
            }
          );
          e.value.style.chart.tooltip.showValue ? v += `<span>(${p})</span></div>` : v += `<b>${p}</b></div>`;
        }
        e.value.style.chart.comments.showInTooltip && l.comment && (v += `<div class="vue-data-ui-tooltip-comment" style="background:${l.color}20; padding: 6px; margin-bottom: 6px; margin-top:6px; border-left: 1px solid ${l.color}">${l.comment}</div>`), se.value = `<div>${v}</div>`;
      }
    }
    function Z(l) {
      return e.value.useBlurOnHover && ![null, void 0].includes(P.value) && P.value !== l ? `url(#blur_${_.value})` : "";
    }
    const D = w(() => {
      const l = I.value.map((t) => ({
        name: t.name,
        color: t.color
      })), r = I.value.map((t) => t.value);
      return { head: l, body: r };
    });
    function De() {
      rt(() => {
        const l = D.value.head.map((a, v) => [[
          a.name
        ], [D.value.body[v]], [isNaN(D.value.body[v] / S.value) ? "-" : D.value.body[v] / S.value * 100]]), r = [[e.value.style.chart.title.text], [e.value.style.chart.title.subtitle.text], [[""], ["val"], ["%"]]].concat(l), t = Ct(r);
        $t({ csvContent: t, title: e.value.style.chart.title.text || "vue-ui-donut" });
      });
    }
    const oe = w(() => {
      const l = [
        ' <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M18 16v2a1 1 0 0 1 -1 1h-11l6 -7l-6 -7h11a1 1 0 0 1 1 1v2" /></svg>',
        F({ p: e.value.style.chart.layout.labels.dataLabels.prefix, v: S.value, s: e.value.style.chart.layout.labels.dataLabels.suffix, r: e.value.table.td.roundingValue }),
        "100%"
      ], r = D.value.head.map((v, g) => {
        const p = F({ p: e.value.style.chart.layout.labels.dataLabels.prefix, v: D.value.body[g], s: e.value.style.chart.layout.labels.dataLabels.suffix, r: e.value.table.td.roundingValue });
        return [
          {
            color: v.color,
            name: v.name
          },
          p,
          isNaN(D.value.body[g] / S.value) ? "-" : (D.value.body[g] / S.value * 100).toFixed(e.value.table.td.roundingPercentage) + "%"
        ];
      }), t = {
        th: {
          backgroundColor: e.value.table.th.backgroundColor,
          color: e.value.table.th.color,
          outline: e.value.table.th.outline
        },
        td: {
          backgroundColor: e.value.table.td.backgroundColor,
          color: e.value.table.td.color,
          outline: e.value.table.td.outline
        },
        breakpoint: e.value.table.responsiveBreakpoint
      };
      return {
        colNames: [
          e.value.table.columnNames.series,
          e.value.table.columnNames.value,
          e.value.table.columnNames.percentage
        ],
        head: l,
        body: r,
        config: t
      };
    }), E = d(!1);
    function at(l) {
      E.value = l, _e.value += 1;
    }
    const Me = w(() => /^((?!chrome|android).)*safari/i.test(navigator.userAgent));
    function ot(l) {
      return l.toFixed(e.value.style.chart.legend.roundingPercentage).split("").map((r) => "-").join("");
    }
    function M(l, r) {
      he("selectDatapoint", { datapoint: l, index: r });
    }
    function Be() {
      y.value.showTable = !y.value.showTable;
    }
    function Ve() {
      y.value.dataLabels.show = !y.value.dataLabels.show;
    }
    function Ge() {
      y.value.showTooltip = !y.value.showTooltip;
    }
    const ue = d(!1);
    function ve() {
      ue.value = !ue.value;
    }
    return qe({
      getData: Ze,
      generatePdf: Fe,
      generateCsv: De,
      generateImage: Le,
      toggleTable: Be,
      toggleLabels: Ve,
      toggleTooltip: Ge,
      toggleAnnotator: ve
    }), (l, r) => (o(), n("div", {
      ref_key: "donutChart",
      ref: j,
      class: de(`vue-ui-donut ${E.value ? "vue-data-ui-wrapper-fullscreen" : ""} ${e.value.useCssAnimation ? "" : "vue-ui-dna"}`),
      style: z(`font-family:${e.value.style.fontFamily};width:100%; ${e.value.responsive ? "height:100%;" : ""} text-align:center;background:${e.value.style.chart.backgroundColor}`),
      id: `donut__${_.value}`,
      onMouseenter: r[6] || (r[6] = () => s(Ce)(!0)),
      onMouseleave: r[7] || (r[7] = () => s(Ce)(!1))
    }, [
      e.value.userOptions.buttons.annotator ? (o(), G(It, {
        key: 0,
        parent: j.value,
        backgroundColor: e.value.style.chart.backgroundColor,
        color: e.value.style.chart.color,
        active: ue.value,
        onClose: ve
      }, null, 8, ["parent", "backgroundColor", "color", "active"])) : i("", !0),
      b(l.$slots, "userConfig", {}, void 0, !0),
      Qe.value ? (o(), n("div", {
        key: 1,
        ref_key: "noTitle",
        ref: ge,
        class: "vue-data-ui-no-title-space",
        style: "height:36px; width: 100%;background:transparent"
      }, null, 512)) : i("", !0),
      e.value.style.chart.title.text ? (o(), n("div", {
        key: 2,
        ref_key: "chartTitle",
        ref: ye,
        style: "width:100%;background:transparent;padding-bottom:24px"
      }, [
        (o(), G(Ft, {
          key: `title_${be.value}`,
          config: {
            title: {
              cy: "donut-div-title",
              ...e.value.style.chart.title
            },
            subtitle: {
              cy: "donut-div-subtitle",
              ...e.value.style.chart.title.subtitle
            }
          }
        }, null, 8, ["config"]))
      ], 512)) : i("", !0),
      e.value.userOptions.show && J.value && (s($e) || s(ne)) ? (o(), G(Tt, {
        ref_key: "details",
        ref: Ke,
        key: `user_option_${_e.value}`,
        backgroundColor: e.value.style.chart.backgroundColor,
        color: e.value.style.chart.color,
        isPrinting: s(Pe),
        isImaging: s(Se),
        uid: _.value,
        hasTooltip: e.value.style.chart.tooltip.show && e.value.userOptions.buttons.tooltip,
        hasPdf: e.value.userOptions.buttons.pdf,
        hasImg: e.value.userOptions.buttons.img,
        hasXls: e.value.userOptions.buttons.csv,
        hasTable: e.value.userOptions.buttons.table,
        hasLabel: e.value.userOptions.buttons.labels,
        hasFullscreen: e.value.userOptions.buttons.fullscreen,
        isFullscreen: E.value,
        chartElement: j.value,
        position: e.value.userOptions.position,
        isTooltip: y.value.showTooltip,
        titles: { ...e.value.userOptions.buttonTitles },
        hasAnnotator: e.value.userOptions.buttons.annotator,
        isAnnotation: ue.value,
        onToggleFullscreen: at,
        onGeneratePdf: s(Fe),
        onGenerateCsv: De,
        onGenerateImage: s(Le),
        onToggleTable: Be,
        onToggleLabels: Ve,
        onToggleTooltip: Ge,
        onToggleAnnotator: ve,
        style: z({
          visibility: s($e) ? s(ne) ? "visible" : "hidden" : "visible"
        })
      }, nt({ _: 2 }, [
        l.$slots.optionTooltip ? {
          name: "optionTooltip",
          fn: $(() => [
            b(l.$slots, "optionTooltip", {}, void 0, !0)
          ]),
          key: "0"
        } : void 0,
        l.$slots.optionPdf ? {
          name: "optionPdf",
          fn: $(() => [
            b(l.$slots, "optionPdf", {}, void 0, !0)
          ]),
          key: "1"
        } : void 0,
        l.$slots.optionCsv ? {
          name: "optionCsv",
          fn: $(() => [
            b(l.$slots, "optionCsv", {}, void 0, !0)
          ]),
          key: "2"
        } : void 0,
        l.$slots.optionImg ? {
          name: "optionImg",
          fn: $(() => [
            b(l.$slots, "optionImg", {}, void 0, !0)
          ]),
          key: "3"
        } : void 0,
        l.$slots.optionTable ? {
          name: "optionTable",
          fn: $(() => [
            b(l.$slots, "optionTable", {}, void 0, !0)
          ]),
          key: "4"
        } : void 0,
        l.$slots.optionLabels ? {
          name: "optionLabels",
          fn: $(() => [
            b(l.$slots, "optionLabels", {}, void 0, !0)
          ]),
          key: "5"
        } : void 0,
        l.$slots.optionFullscreen ? {
          name: "optionFullscreen",
          fn: $(({ toggleFullscreen: t, isFullscreen: a }) => [
            b(l.$slots, "optionFullscreen", R(W({ toggleFullscreen: t, isFullscreen: a })), void 0, !0)
          ]),
          key: "6"
        } : void 0,
        l.$slots.optionAnnotator ? {
          name: "optionAnnotator",
          fn: $(({ toggleAnnotator: t, isAnnotator: a }) => [
            b(l.$slots, "optionAnnotator", R(W({ toggleAnnotator: t, isAnnotator: a })), void 0, !0)
          ]),
          key: "7"
        } : void 0
      ]), 1032, ["backgroundColor", "color", "isPrinting", "isImaging", "uid", "hasTooltip", "hasPdf", "hasImg", "hasXls", "hasTable", "hasLabel", "hasFullscreen", "isFullscreen", "chartElement", "position", "isTooltip", "titles", "hasAnnotator", "isAnnotation", "onGeneratePdf", "onGenerateImage", "style"])) : i("", !0),
      J.value ? (o(), n("svg", {
        key: 4,
        xmlns: s(bt),
        class: de({ "vue-data-ui-fullscreen--on": E.value, "vue-data-ui-fulscreen--off": !E.value }),
        viewBox: `0 0 ${u.value.width <= 0 ? 10 : u.value.width} ${u.value.height <= 0 ? 10 : u.value.height}`,
        style: z(`max-width:100%; overflow: visible; background:transparent;color:${e.value.style.chart.color}`)
      }, [
        je(Xt),
        l.$slots["chart-background"] ? (o(), n("foreignObject", {
          key: 0,
          x: 0,
          y: 0,
          width: u.value.width <= 0 ? 10 : u.value.width,
          height: u.value.height <= 0 ? 10 : u.value.height,
          style: {
            pointerEvents: "none"
          }
        }, [
          b(l.$slots, "chart-background", {}, void 0, !0)
        ], 8, Ut)) : i("", !0),
        e.value.type === "classic" ? (o(), n("defs", jt, [
          e.value.style.chart.useGradient ? (o(), n("radialGradient", {
            key: 0,
            id: `gradient_${_.value}`
          }, [
            h("stop", {
              offset: "0%",
              "stop-color": s(ee)(e.value.style.chart.backgroundColor, 0),
              "stop-opacity": "0"
            }, null, 8, Et),
            h("stop", {
              offset: `${(1 - K.value / C.value) * 100}%`,
              "stop-color": s(ee)("#FFFFFF", 0),
              "stop-opacity": "0"
            }, null, 8, Rt),
            h("stop", {
              offset: `${(1 - K.value / C.value / 2) * 100}%`,
              "stop-color": s(ee)("#FFFFFF", e.value.style.chart.gradientIntensity)
            }, null, 8, Wt),
            h("stop", {
              offset: "100%",
              "stop-color": s(ee)(e.value.style.chart.backgroundColor, 0),
              "stop-opacity": "0"
            }, null, 8, qt)
          ], 8, Ht)) : i("", !0)
        ])) : i("", !0),
        e.value.type === "polar" ? (o(), n("defs", Jt, [
          (o(!0), n(k, null, X(c.value, (t, a) => (o(), n("radialGradient", {
            id: `polar_gradient_${a}_${_.value}`,
            cx: t.middlePoint.x / u.value.width * 100 + "%",
            cy: t.middlePoint.y / u.value.height * 100 + "%",
            r: "62%"
          }, [
            h("stop", {
              offset: "0%",
              "stop-color": s(mt)(f.value[a].color, 0.05),
              "stop-opacity": e.value.style.chart.gradientIntensity / 100
            }, null, 8, Qt),
            h("stop", {
              offset: "100%",
              "stop-color": f.value[a].color
            }, null, 8, Zt)
          ], 8, Kt))), 256))
        ])) : i("", !0),
        h("defs", null, [
          h("filter", {
            id: `blur_${_.value}`,
            x: "-50%",
            y: "-50%",
            width: "200%",
            height: "200%"
          }, [
            h("feGaussianBlur", {
              in: "SourceGraphic",
              stdDeviation: 2,
              id: `blur_std_${_.value}`
            }, null, 8, tl),
            ll
          ], 8, el),
          h("filter", {
            id: `shadow_${_.value}`,
            "color-interpolation-filters": "sRGB"
          }, [
            h("feDropShadow", {
              dx: "0",
              dy: "0",
              stdDeviation: "10",
              "flood-opacity": "0.5",
              "flood-color": e.value.style.chart.layout.donut.shadowColor
            }, null, 8, ol)
          ], 8, al),
          h("filter", {
            id: `drop_shadow_${_.value}`,
            "color-interpolation-filters": "sRGB",
            x: "-50%",
            y: "-50%",
            width: "200%",
            height: "200%"
          }, [
            h("feDropShadow", {
              dx: "0",
              dy: "0",
              stdDeviation: "3",
              "flood-opacity": "1",
              "flood-color": e.value.style.chart.layout.donut.shadowColor
            }, null, 8, sl)
          ], 8, ul)
        ]),
        e.value.type === "classic" ? (o(!0), n(k, { key: 3 }, X(f.value, (t, a) => (o(), n("g", null, [
          O(t) && y.value.dataLabels.show ? (o(), n("path", {
            key: 0,
            d: s(wt)(t, { x: u.value.width / 2, y: u.value.height / 2 }, 16, 16, !1, !1, K.value),
            stroke: t.color,
            "stroke-width": "1",
            "stroke-linecap": "round",
            "stroke-linejoin": "round",
            fill: "none",
            filter: Z(a)
          }, null, 8, nl)) : i("", !0)
        ]))), 256)) : i("", !0),
        e.value.type === "polar" ? (o(!0), n(k, { key: 4 }, X(f.value, (t, a) => (o(), n("g", null, [
          O(t) && y.value.dataLabels.show ? (o(), n("line", {
            key: 0,
            x1: s(L)({ initX: c.value[a].middlePoint.x, initY: c.value[a].middlePoint.y, offset: 24, centerX: u.value.width / 2, centerY: u.value.height / 2 }).x,
            y1: s(L)({ initX: c.value[a].middlePoint.x, initY: c.value[a].middlePoint.y, offset: 24, centerX: u.value.width / 2, centerY: u.value.height / 2 }).y,
            x2: c.value[a].middlePoint.x,
            y2: c.value[a].middlePoint.y,
            stroke: t.color,
            "stroke-width": "1",
            "stroke-linecap": "round",
            "stroke-linejoin": "round",
            fill: "none",
            filter: Z(a)
          }, null, 8, rl)) : i("", !0)
        ]))), 256)) : i("", !0),
        e.value.type === "classic" && e.value.style.chart.layout.donut.useShadow ? (o(), n("circle", {
          key: 5,
          cx: u.value.width / 2,
          cy: u.value.height / 2,
          r: C.value <= 0 ? 10 : C.value,
          fill: e.value.style.chart.backgroundColor,
          filter: `url(#shadow_${_.value})`
        }, null, 8, il)) : i("", !0),
        S.value && e.value.type === "classic" ? (o(), n(k, { key: 6 }, [
          (o(!0), n(k, null, X(f.value, (t, a) => (o(), n("path", {
            stroke: e.value.style.chart.backgroundColor,
            d: t.arcSlice,
            fill: "#FFFFFF"
          }, null, 8, vl))), 256)),
          (o(!0), n(k, null, X(f.value, (t, a) => (o(), n("path", {
            class: "vue-ui-donut-arc-path",
            d: t.arcSlice,
            fill: s(ee)(t.color, 80),
            stroke: e.value.style.chart.backgroundColor,
            "stroke-width": e.value.style.chart.layout.donut.borderWidth,
            filter: Z(a)
          }, null, 8, cl))), 256))
        ], 64)) : i("", !0),
        S.value && e.value.type === "polar" ? (o(), n(k, { key: 7 }, [
          f.value.length > 1 ? (o(), n("g", dl, [
            (o(!0), n(k, null, X(f.value, (t, a) => (o(), n("path", {
              stroke: e.value.style.chart.backgroundColor,
              d: c.value[a].path,
              fill: "#FFFFFF"
            }, null, 8, hl))), 256)),
            e.value.style.chart.layout.donut.useShadow ? (o(), n("g", yl, [
              (o(!0), n(k, null, X(f.value, (t, a) => (o(), n("path", {
                class: "vue-ui-donut-arc-path",
                d: c.value[a].path,
                fill: "transparent",
                stroke: e.value.style.chart.backgroundColor,
                "stroke-width": e.value.style.chart.layout.donut.borderWidth,
                filter: `url(#drop_shadow_${_.value})`
              }, null, 8, fl))), 256))
            ])) : i("", !0),
            (o(!0), n(k, null, X(f.value, (t, a) => (o(), n("path", {
              class: "vue-ui-donut-arc-path",
              d: c.value[a].path,
              fill: e.value.style.chart.useGradient ? `url(#polar_gradient_${a}_${_.value})` : t.color,
              stroke: e.value.style.chart.backgroundColor,
              "stroke-width": e.value.style.chart.layout.donut.borderWidth,
              filter: Z(a)
            }, null, 8, pl))), 256))
          ])) : (o(), n("g", gl, [
            h("circle", {
              cx: u.value.width / 2,
              cy: u.value.height / 2,
              r: C.value,
              fill: e.value.style.chart.useGradient ? `url(#polar_gradient_0_${_.value})` : f.value[0].color,
              stroke: e.value.style.chart.backgroundColor,
              "stroke-width": e.value.style.chart.layout.donut.borderWidth
            }, null, 8, bl)
          ]))
        ], 64)) : (o(), n("circle", {
          key: 8,
          cx: u.value.width / 2,
          cy: u.value.height / 2,
          r: C.value <= 0 ? 10 : C.value,
          fill: "transparent",
          stroke: e.value.style.chart.backgroundColor
        }, null, 8, ml)),
        e.value.style.chart.useGradient && e.value.type === "classic" ? (o(), n("circle", {
          key: 9,
          cx: u.value.width / 2,
          cy: u.value.height / 2,
          r: (
            /* This might require adjustments */
            C.value <= 0 ? 10 : C.value
          ),
          fill: `url(#gradient_${_.value})`
        }, null, 8, wl)) : i("", !0),
        S.value ? (o(), n(k, { key: 10 }, [
          f.value.length > 1 || e.value.type === "classic" ? (o(), n("g", kl, [
            (o(!0), n(k, null, X(f.value, (t, a) => (o(), n("path", {
              "data-cy-donut-trap": "",
              d: e.value.type === "classic" ? t.arcSlice : c.value[a].path,
              fill: P.value === a ? "rgba(0,0,0,0.1)" : "transparent",
              onMouseenter: (v) => Ie({
                datapoint: t,
                relativeIndex: a,
                seriesIndex: t.seriesIndex,
                show: !0
              }),
              onMouseleave: r[0] || (r[0] = (v) => {
                ae.value = !1, P.value = null;
              }),
              onClick: (v) => M(t, a)
            }, null, 40, _l))), 256))
          ])) : (o(), n("g", xl, [
            h("circle", {
              cx: u.value.width / 2,
              cy: u.value.height / 2,
              r: C.value,
              fill: P.value === l.i ? "rgba(0,0,0,0.1)" : "transparent",
              "data-cy-donut-trap": "",
              onMouseenter: r[1] || (r[1] = (t) => Ie({
                datapoint: f.value[0],
                relativeIndex: 0,
                seriesIndex: f.value[0].seriesIndex,
                show: !0
              })),
              onMouseleave: r[2] || (r[2] = (t) => {
                ae.value = !1, P.value = null;
              }),
              onClick: r[3] || (r[3] = (t) => M(f.value[0], l.i))
            }, null, 40, Cl)
          ]))
        ], 64)) : i("", !0),
        e.value.type === "classic" ? (o(), n(k, { key: 11 }, [
          e.value.style.chart.layout.labels.hollow.total.show ? (o(), n("text", {
            key: 0,
            "text-anchor": "middle",
            x: u.value.width / 2,
            y: u.value.height / 2 - (e.value.style.chart.layout.labels.hollow.average.show ? e.value.style.chart.layout.labels.hollow.total.fontSize : 0) + e.value.style.chart.layout.labels.hollow.total.offsetY,
            fill: e.value.style.chart.layout.labels.hollow.total.color,
            "font-size": e.value.style.chart.layout.labels.hollow.total.fontSize,
            style: z(`font-weight:${e.value.style.chart.layout.labels.hollow.total.bold ? "bold" : ""}`)
          }, x(e.value.style.chart.layout.labels.hollow.total.text), 13, $l)) : i("", !0),
          e.value.style.chart.layout.labels.hollow.total.show ? (o(), n("text", {
            key: 1,
            "text-anchor": "middle",
            x: u.value.width / 2,
            y: u.value.height / 2 + e.value.style.chart.layout.labels.hollow.total.fontSize - (e.value.style.chart.layout.labels.hollow.average.show ? e.value.style.chart.layout.labels.hollow.total.fontSize : 0) + e.value.style.chart.layout.labels.hollow.total.value.offsetY,
            fill: e.value.style.chart.layout.labels.hollow.total.value.color,
            "font-size": e.value.style.chart.layout.labels.hollow.total.value.fontSize,
            style: z(`font-weight:${e.value.style.chart.layout.labels.hollow.total.value.bold ? "bold" : ""}`)
          }, x(s(Y)(
            e.value.style.chart.layout.labels.hollow.total.value.formatter,
            S.value,
            s(F)({
              p: e.value.style.chart.layout.labels.hollow.total.value.prefix,
              v: S.value,
              s: e.value.style.chart.layout.labels.hollow.total.value.suffix
            })
          )), 13, Pl)) : i("", !0),
          e.value.style.chart.layout.labels.hollow.average.show ? (o(), n("text", {
            key: 2,
            "text-anchor": "middle",
            x: u.value.width / 2,
            y: u.value.height / 2 + (e.value.style.chart.layout.labels.hollow.total.show ? e.value.style.chart.layout.labels.hollow.average.fontSize : 0) + e.value.style.chart.layout.labels.hollow.average.offsetY,
            fill: e.value.style.chart.layout.labels.hollow.average.color,
            "font-size": e.value.style.chart.layout.labels.hollow.average.fontSize,
            style: z(`font-weight:${e.value.style.chart.layout.labels.hollow.average.bold ? "bold" : ""}`)
          }, x(e.value.style.chart.layout.labels.hollow.average.text), 13, Sl)) : i("", !0),
          e.value.style.chart.layout.labels.hollow.average.show ? (o(), n("text", {
            key: 3,
            "text-anchor": "middle",
            x: u.value.width / 2,
            y: u.value.height / 2 + (e.value.style.chart.layout.labels.hollow.total.show ? e.value.style.chart.layout.labels.hollow.average.fontSize : 0) + e.value.style.chart.layout.labels.hollow.average.fontSize + e.value.style.chart.layout.labels.hollow.average.value.offsetY,
            fill: e.value.style.chart.layout.labels.hollow.average.value.color,
            "font-size": e.value.style.chart.layout.labels.hollow.average.value.fontSize,
            style: z(`font-weight:${e.value.style.chart.layout.labels.hollow.average.value.bold ? "bold" : ""}`)
          }, x(V.value ? "--" : s(Y)(
            e.value.style.chart.layout.labels.hollow.average.value.formatter,
            Ne.value,
            s(F)({
              p: e.value.style.chart.layout.labels.hollow.average.value.prefix,
              v: Ne.value,
              s: e.value.style.chart.layout.labels.hollow.average.value.suffix,
              r: e.value.style.chart.layout.labels.hollow.average.value.rounding
            })
          )), 13, Fl)) : i("", !0)
        ], 64)) : i("", !0),
        (o(!0), n(k, null, X(f.value, (t, a) => (o(), n("g", {
          filter: Z(a),
          class: de({ animated: e.value.useCssAnimation })
        }, [
          e.value.style.chart.layout.labels.dataLabels.useLabelSlots ? (o(), n("g", Tl, [
            (o(), n("foreignObject", {
              x: s(m)(t, !0).anchor === "end" ? s(m)(t).x - 120 : s(m)(t, !0).anchor === "middle" ? s(m)(t).x - 60 : s(m)(t).x,
              y: s(te)(t) - (Me.value ? 20 : 0),
              width: "120",
              height: "60",
              style: { overflow: "visible" }
            }, [
              h("div", null, [
                b(l.$slots, "dataLabel", R(W({
                  datapoint: t,
                  isBlur: !e.value.useBlurOnHover || [null, void 0].includes(P.value) || P.value === a,
                  isSafari: Me.value,
                  isVisible: O(t) && y.value.dataLabels.show,
                  textAlign: s(m)(t, !0, 16, !0).anchor,
                  flexAlign: s(m)(t, !0, 16).anchor,
                  percentage: re(t, f.value)
                })), void 0, !0)
              ])
            ], 8, zl))
          ])) : (o(), n("g", Ol, [
            e.value.type === "classic" ? (o(), n(k, { key: 0 }, [
              O(t) && y.value.dataLabels.show ? (o(), n("circle", {
                key: 0,
                cx: s(m)(t).x,
                cy: s(te)(t) - 3.5,
                fill: t.color,
                stroke: e.value.style.chart.backgroundColor,
                "stroke-width": 1,
                r: 3,
                filter: !e.value.useBlurOnHover || [null, void 0].includes(P.value) || P.value === a ? "" : `url(#blur_${_.value})`,
                onClick: (v) => M(t, a)
              }, null, 8, Yl)) : i("", !0)
            ], 64)) : i("", !0),
            e.value.type === "polar" ? (o(), n(k, { key: 1 }, [
              O(t) && y.value.dataLabels.show ? (o(), n("circle", {
                key: 0,
                cx: s(L)({ initX: c.value[a].middlePoint.x, initY: c.value[a].middlePoint.y, offset: 24, centerX: u.value.width / 2, centerY: u.value.height / 2 }).x,
                cy: s(L)({ initX: c.value[a].middlePoint.x, initY: c.value[a].middlePoint.y, offset: 24, centerX: u.value.width / 2, centerY: u.value.height / 2 }).y,
                fill: t.color,
                stroke: e.value.style.chart.backgroundColor,
                "stroke-width": 1,
                r: 3,
                filter: !e.value.useBlurOnHover || [null, void 0].includes(P.value) || P.value === a ? "" : `url(#blur_${_.value})`,
                onClick: (v) => M(t, a)
              }, null, 8, Al)) : i("", !0)
            ], 64)) : i("", !0),
            e.value.type === "classic" ? (o(), n(k, { key: 2 }, [
              O(t) && y.value.dataLabels.show ? (o(), n("text", {
                key: 0,
                "text-anchor": s(m)(t, !0, 12).anchor,
                x: s(m)(t, !0, 12).x,
                y: s(te)(t),
                fill: e.value.style.chart.layout.labels.percentage.color,
                "font-size": e.value.style.chart.layout.labels.percentage.fontSize,
                style: z(`font-weight:${e.value.style.chart.layout.labels.percentage.bold ? "bold" : ""}`),
                onClick: (v) => M(t, a)
              }, x(re(t, f.value)) + " " + x(e.value.style.chart.layout.labels.value.show ? `(${s(Y)(
                e.value.style.chart.layout.labels.value.formatter,
                t.value,
                s(F)({
                  p: e.value.style.chart.layout.labels.dataLabels.prefix,
                  v: t.value,
                  s: e.value.style.chart.layout.labels.dataLabels.suffix,
                  r: e.value.style.chart.layout.labels.value.rounding
                }),
                { datapoint: t }
              )})` : ""), 13, Nl)) : i("", !0),
              O(t) && y.value.dataLabels.show ? (o(), n("text", {
                key: 1,
                "text-anchor": s(m)(t).anchor,
                x: s(m)(t, !0, 12).x,
                y: s(te)(t) + e.value.style.chart.layout.labels.percentage.fontSize,
                fill: e.value.style.chart.layout.labels.name.color,
                "font-size": e.value.style.chart.layout.labels.name.fontSize,
                style: z(`font-weight:${e.value.style.chart.layout.labels.name.bold ? "bold" : ""}`),
                onClick: (v) => M(t, a)
              }, x(t.name), 13, Xl)) : i("", !0)
            ], 64)) : i("", !0),
            e.value.type === "polar" ? (o(), n(k, { key: 3 }, [
              O(t) && y.value.dataLabels.show ? (o(), n("text", {
                key: 0,
                "text-anchor": H(c.value[a].middlePoint),
                x: s(L)({ initX: c.value[a].middlePoint.x, initY: c.value[a].middlePoint.y, offset: 42, centerX: u.value.width / 2, centerY: u.value.height / 2 }).x,
                y: s(L)({ initX: c.value[a].middlePoint.x, initY: c.value[a].middlePoint.y, offset: 42, centerX: u.value.width / 2, centerY: u.value.height / 2 }).y,
                fill: e.value.style.chart.layout.labels.percentage.color,
                "font-size": e.value.style.chart.layout.labels.percentage.fontSize,
                style: z(`font-weight:${e.value.style.chart.layout.labels.percentage.bold ? "bold" : ""}`),
                onClick: (v) => M(t, a)
              }, x(re(t, f.value)) + " " + x(e.value.style.chart.layout.labels.value.show ? `(${s(Y)(
                e.value.style.chart.layout.labels.value.formatter,
                t.value,
                s(F)({
                  p: e.value.style.chart.layout.labels.dataLabels.prefix,
                  v: t.value,
                  s: e.value.style.chart.layout.labels.dataLabels.suffix,
                  r: e.value.style.chart.layout.labels.value.rounding
                }),
                { datapoint: t }
              )})` : ""), 13, Il)) : i("", !0),
              O(t) && y.value.dataLabels.show ? (o(), n("text", {
                key: 1,
                "text-anchor": H(c.value[a].middlePoint),
                x: s(L)({ initX: c.value[a].middlePoint.x, initY: c.value[a].middlePoint.y, offset: 42, centerX: u.value.width / 2, centerY: u.value.height / 2 }).x,
                y: s(L)({ initX: c.value[a].middlePoint.x, initY: c.value[a].middlePoint.y, offset: 42, centerX: u.value.width / 2, centerY: u.value.height / 2 }).y + e.value.style.chart.layout.labels.percentage.fontSize,
                fill: e.value.style.chart.layout.labels.name.color,
                "font-size": e.value.style.chart.layout.labels.name.fontSize,
                style: z(`font-weight:${e.value.style.chart.layout.labels.name.bold ? "bold" : ""}`),
                onClick: (v) => M(t, a)
              }, x(t.name), 13, Dl)) : i("", !0)
            ], 64)) : i("", !0)
          ])),
          y.value.dataLabels.show && e.value.style.chart.comments.show && t.comment ? (o(), n("g", Ml, [
            O(t) && e.value.type === "classic" ? (o(), n("foreignObject", {
              key: 0,
              x: e.value.style.chart.comments.offsetX + (s(m)(t, !0).anchor === "end" ? s(m)(t).x - e.value.style.chart.comments.width : s(m)(t, !0).anchor === "middle" ? s(m)(t).x - e.value.style.chart.comments.width / 2 : s(m)(t).x),
              y: s(te)(t) + 24 + e.value.style.chart.comments.offsetY,
              width: e.value.style.chart.comments.width,
              height: "200",
              style: { overflow: "visible", "pointer-events": "none" }
            }, [
              h("div", null, [
                b(l.$slots, "plot-comment", {
                  plot: { ...t, textAlign: s(m)(t, !0, 16, !0).anchor, flexAlign: s(m)(t, !0, 16).anchor }
                }, void 0, !0)
              ])
            ], 8, Bl)) : i("", !0),
            O(t) && e.value.type === "polar" ? (o(), n("foreignObject", {
              key: 1,
              x: e.value.style.chart.comments.offsetX + (H(c.value[a].middlePoint) === "end" ? s(L)({ initX: c.value[a].middlePoint.x, initY: c.value[a].middlePoint.y, offset: 42, centerX: u.value.width / 2, centerY: u.value.height / 2 }).x - e.value.style.chart.comments.width : H(c.value[a].middlePoint) === "middle" ? s(L)({ initX: c.value[a].middlePoint.x, initY: c.value[a].middlePoint.y, offset: 42, centerX: u.value.width / 2, centerY: u.value.height / 2 }).x - e.value.style.chart.comments.width / 2 : s(L)({ initX: c.value[a].middlePoint.x, initY: c.value[a].middlePoint.y, offset: 42, centerX: u.value.width / 2, centerY: u.value.height / 2 }).x),
              y: tt(c.value[a]) + e.value.style.chart.comments.offsetY,
              width: e.value.style.chart.comments.width,
              height: "200",
              style: { overflow: "visible", "pointer-events": "none" }
            }, [
              h("div", null, [
                b(l.$slots, "plot-comment", {
                  plot: { ...t, textAlign: H(c.value[a].middlePoint), flexAlign: H(c.value[a].middlePoint) }
                }, void 0, !0)
              ])
            ], 8, Vl)) : i("", !0)
          ])) : i("", !0)
        ], 10, Ll))), 256)),
        b(l.$slots, "svg", { svg: u.value }, void 0, !0)
      ], 14, Gt)) : i("", !0),
      l.$slots.watermark ? (o(), n("div", Gl, [
        b(l.$slots, "watermark", R(W({ isPrinting: s(Pe) || s(Se) })), void 0, !0)
      ])) : i("", !0),
      J.value ? i("", !0) : (o(), G(At, {
        key: 6,
        config: {
          type: "donut",
          style: {
            backgroundColor: e.value.style.chart.backgroundColor,
            donut: {
              color: "#CCCCCC",
              strokeWidth: K.value * 0.8
            }
          }
        }
      }, null, 8, ["config"])),
      h("div", {
        ref_key: "chartLegend",
        ref: fe
      }, [
        e.value.style.chart.legend.show ? (o(), G(Yt, {
          key: `legend_${we.value}`,
          legendSet: Ae.value,
          config: et.value,
          onClickMarker: r[4] || (r[4] = ({ i: t }) => Ye(t))
        }, {
          item: $(({ legend: t, index: a }) => [
            h("div", {
              style: z(`opacity:${N.value.includes(a) ? 0.5 : 1}`),
              onClick: (v) => t.segregate()
            }, [
              He(x(t.name) + ": " + x(s(Y)(
                e.value.style.chart.layout.labels.value.formatter,
                t.value,
                s(F)({
                  p: e.value.style.chart.layout.labels.dataLabels.prefix,
                  v: t.value,
                  s: e.value.style.chart.layout.labels.dataLabels.suffix,
                  r: e.value.style.chart.legend.roundingValue
                }),
                {
                  datapoint: t,
                  index: a
                }
              )) + " ", 1),
              N.value.includes(a) ? (o(), n("span", Hl, " ( " + x(ot(t.proportion * 100)) + " % ) ", 1)) : (o(), n("span", jl, " (" + x(isNaN(t.value / S.value) ? "-" : s(Y)(
                e.value.style.chart.layout.labels.percentage.formatter,
                Xe.value(t),
                s(F)({
                  v: Xe.value(t),
                  s: "%",
                  r: e.value.style.chart.legend.roundingPercentage
                })
              )) + ") ", 1))
            ], 12, Ul)
          ]),
          _: 1
        }, 8, ["legendSet", "config"])) : i("", !0),
        b(l.$slots, "legend", { legend: Ae.value }, void 0, !0)
      ], 512),
      l.$slots.source ? (o(), n("div", {
        key: 7,
        ref_key: "source",
        ref: pe,
        dir: "auto"
      }, [
        b(l.$slots, "source", {}, void 0, !0)
      ], 512)) : i("", !0),
      je(Ot, {
        show: y.value.showTooltip && ae.value,
        backgroundColor: e.value.style.chart.tooltip.backgroundColor,
        color: e.value.style.chart.tooltip.color,
        fontSize: e.value.style.chart.tooltip.fontSize,
        borderRadius: e.value.style.chart.tooltip.borderRadius,
        borderColor: e.value.style.chart.tooltip.borderColor,
        borderWidth: e.value.style.chart.tooltip.borderWidth,
        backgroundOpacity: e.value.style.chart.tooltip.backgroundOpacity,
        position: e.value.style.chart.tooltip.position,
        offsetY: e.value.style.chart.tooltip.offsetY,
        parent: j.value,
        content: se.value,
        isCustom: Q.value,
        isFullscreen: E.value
      }, {
        "tooltip-before": $(() => [
          b(l.$slots, "tooltip-before", R(W({ ...ie.value })), void 0, !0)
        ]),
        "tooltip-after": $(() => [
          b(l.$slots, "tooltip-after", R(W({ ...ie.value })), void 0, !0)
        ]),
        _: 3
      }, 8, ["show", "backgroundColor", "color", "fontSize", "borderRadius", "borderColor", "borderWidth", "backgroundOpacity", "position", "offsetY", "parent", "content", "isCustom", "isFullscreen"]),
      J.value ? (o(), G(Nt, {
        key: 8,
        hideDetails: "",
        config: {
          open: y.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: $(() => [
          (o(), G(zt, {
            key: `table_${me.value}`,
            colNames: oe.value.colNames,
            head: oe.value.head,
            body: oe.value.body,
            config: oe.value.config,
            title: `${e.value.style.chart.title.text}${e.value.style.chart.title.subtitle.text ? ` : ${e.value.style.chart.title.subtitle.text}` : ""}`,
            onClose: r[5] || (r[5] = (t) => y.value.showTable = !1)
          }, {
            th: $(({ th: t }) => [
              h("div", {
                innerHTML: t,
                style: { display: "flex", "align-items": "center" }
              }, null, 8, El)
            ]),
            td: $(({ td: t }) => [
              He(x(t.name ? t.name : isNaN(Number(t)) ? t.includes("%") ? t : s(Y)(
                e.value.style.chart.layout.labels.percentage.formatter,
                t,
                s(F)({
                  v: t,
                  s: "%",
                  r: e.value.style.chart.layout.labels.percentage.rounding
                })
              ) : s(Y)(
                e.value.style.chart.layout.labels.value.formatter,
                t,
                s(F)({
                  p: e.value.style.chart.layout.labels.dataLabels.prefix,
                  v: t,
                  s: e.value.style.chart.layout.labels.dataLabels.suffix,
                  r: e.value.style.chart.layout.labels.value.rounding
                })
              )), 1)
            ]),
            _: 1
          }, 8, ["colNames", "head", "body", "config", "title"]))
        ]),
        _: 1
      }, 8, ["config"])) : i("", !0)
    ], 46, Vt));
  }
}, ia = /* @__PURE__ */ Mt(Rl, [["__scopeId", "data-v-7c3807c4"]]);
export {
  ia as default
};
