import { computed as m, ref as d, onMounted as ut, onBeforeUnmount as st, watch as Ue, openBlock as o, createElementBlock as r, normalizeClass as ce, normalizeStyle as z, unref as u, createBlock as G, createCommentVNode as i, renderSlot as w, createSlots as nt, withCtx as $, normalizeProps as E, 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 Re, g as ht, c as yt, b as ft, d as Ee, 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 b, n as te, t as kt, a as _t, x as xt, q as Ct, r as $t } from "./index-BbPeL8Gp.js";
import { t as Pt, u as St } from "./useResponsive-CoxXLe23.js";
import { _ as Ft } from "./Title-aSAft5dl.js";
import { u as Lt, U as Tt } from "./usePrinter-DaybDVqP.js";
import { D as zt } from "./DataTable-DGf6RrOJ.js";
import { _ as Ot } from "./Tooltip-smutPF--.js";
import { L as Yt } from "./Legend-BLaZxMge.js";
import At from "./vue-ui-skeleton-Bniq21d9.js";
import Nt from "./vue-ui-accordion-5d5iVpr7.js";
import { u as We } from "./useNestedProp-BN8claGG.js";
import { _ as Xt } from "./PackageVersion-CxJghxYD.js";
import { P as It } from "./PenAndPaper-ZdZEumki.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-d4fdff95"), q = q(), vt(), q), Vt = ["id"], Gt = ["xmlns", "viewBox"], Ut = { key: 0 }, jt = ["id"], Ht = ["stop-color"], Rt = ["offset", "stop-color"], Et = ["offset", "stop-color"], Wt = ["stop-color"], qt = { key: 1 }, Jt = ["id", "cx", "cy"], Kt = ["stop-color", "stop-opacity"], Qt = ["stop-color"], Zt = ["id"], el = ["id"], tl = /* @__PURE__ */ Bt(() => /* @__PURE__ */ h("feColorMatrix", {
  type: "saturate",
  values: "0"
}, null, -1)), ll = ["id"], al = ["flood-color"], ol = ["id"], ul = ["flood-color"], sl = ["d", "stroke", "filter"], nl = ["x1", "y1", "x2", "y2", "stroke", "filter"], rl = ["cx", "cy", "r", "fill", "filter"], il = ["stroke", "d"], vl = ["d", "fill", "stroke", "stroke-width", "filter"], cl = { key: 0 }, dl = ["stroke", "d"], hl = { key: 0 }, yl = ["d", "stroke", "stroke-width", "filter"], fl = ["d", "fill", "stroke", "stroke-width", "filter"], pl = { key: 1 }, gl = ["cx", "cy", "r", "fill", "stroke", "stroke-width"], bl = ["cx", "cy", "r", "stroke"], ml = ["cx", "cy", "r", "fill"], wl = { key: 0 }, kl = ["d", "fill", "onMouseenter", "onClick"], _l = { key: 1 }, xl = ["cx", "cy", "r", "fill"], Cl = ["x", "y", "fill", "font-size"], $l = ["x", "y", "fill", "font-size"], Pl = ["x", "y", "fill", "font-size"], Sl = ["x", "y", "fill", "font-size"], Fl = ["filter"], Ll = { key: 0 }, Tl = ["x", "y"], zl = { key: 1 }, Ol = ["cx", "cy", "fill", "stroke", "filter", "onClick"], Yl = ["cx", "cy", "fill", "stroke", "filter", "onClick"], Al = ["text-anchor", "x", "y", "fill", "font-size", "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 = { key: 2 }, Ml = ["x", "y", "width"], Bl = ["x", "y", "width"], Vl = {
  key: 5,
  class: "vue-data-ui-watermark"
}, Gl = ["onClick"], Ul = {
  key: 0,
  style: { "font-variant-numeric": "tabular-nums" }
}, jl = { key: 1 }, Hl = ["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: de }) {
    const A = q, { vue_ui_donut: Je } = ct(), J = m({
      get() {
        return !!A.dataset && A.dataset.length;
      },
      set(l) {
        return l;
      }
    }), j = d(null), he = d(null), ye = d(null), le = d(null), fe = d(null), pe = d(null), ge = d(0), be = d(0), me = d(0);
    ut(() => {
      we();
    }), st(() => {
      le.value && le.value.disconnect();
    });
    function we() {
      if (dt(A.dataset) ? Re({
        componentName: "VueUiDonut",
        type: "dataset"
      }) : A.dataset.forEach((l, n) => {
        ht({
          datasetObject: l,
          requiredAttributes: ["name", "values"]
        }).forEach((t) => {
          J.value = !1, Re({
            componentName: "VueUiDonut",
            type: "datasetSerieAttribute",
            property: t,
            index: n
          });
        });
      }), e.value.responsive) {
        const l = Pt(() => {
          const { width: n, height: t } = St({
            chart: j.value,
            title: e.value.style.chart.title.text ? he.value : null,
            legend: e.value.style.chart.legend.show ? ye.value : null,
            source: fe.value,
            noTitle: pe.value
          });
          s.value.width = n, s.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), ke = d(0);
    function _e() {
      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 = m({
      get: () => _e(),
      set: (l) => l
    }), { userOptionsVisible: xe, setUserOptionsVisibility: Ce, keepUserOptionState: $e } = Dt({ config: e.value });
    Ue(() => A.config, (l) => {
      e.value = _e(), we(), ge.value += 1, be.value += 1, me.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 = m(() => e.value.userOptions.show && !e.value.style.chart.title.text), Te = m(() => 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
    }), s = d({
      height: 360,
      width: 512
    }), K = m(() => {
      const l = e.value.style.chart.layout.donut.strokeWidth / 512, n = s.value.width * l, t = n > C.value ? C.value : n;
      return t < 24 ? 24 : t;
    }), B = m(() => A.dataset.map((l, n) => ({
      name: l.name,
      color: Ee(l.color) || Te.value[n] || U[n] || U[n % 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 n = B.value.find((v, g) => g === l);
      let a = T.value.find((v, g) => g === l).value;
      if (N.value.includes(l)) {
        let g = function() {
          a > v ? (cancelAnimationFrame(ze.value), T.value = T.value.map((p, ve) => l === ve ? {
            ...p,
            value: v
          } : p), V.value = !1) : (V.value = !0, a += v * 0.025, T.value = T.value.map((p, ve) => l === ve ? {
            ...p,
            value: a
          } : p), ze.value = requestAnimationFrame(g));
        };
        N.value = N.value.filter((p) => p !== l);
        const v = n.value;
        g();
      } else if (N.value.length < B.value.length - 1) {
        let v = function() {
          a < 0.1 ? (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();
      }
      de("selectLegend", I.value.map((v) => ({
        name: v.name,
        color: v.color,
        value: v.value
      })));
    }
    const I = m(() => (T.value.forEach((l, n) => {
      if ([null, void 0].includes(l.values))
        return {
          ...l,
          values: []
        };
    }), T.value.map((l, n) => ({
      ...l,
      seriesIndex: n
    })).filter((l, n) => !N.value.includes(n)))), Ae = m(() => A.dataset.map((l, n) => ({
      name: l.name,
      color: Ee(l.color) || Te.value[n] || U[n] || U[n % U.length],
      value: (l.values || []).reduce((t, a) => t + a, 0),
      shape: "circle"
    })).map((l, n) => ({
      ...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(n) ? 0.5 : 1,
      segregate: () => !V.value && Ye(n),
      isSegregated: N.value.includes(n)
    }))), et = m(() => ({
      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 = m(() => {
      const l = Math.min(s.value.width / 3, s.value.height / 3);
      return l < 55 ? 55 : l;
    }), f = m(() => pt({ series: I.value }, s.value.width / 2, s.value.height / 2, C.value, C.value, 1.99999, 2, 1, 360, 105.25, K.value)), c = m(() => {
      const l = Math.max(...I.value.map((t) => t.value)), n = I.value.map((t) => t.value / l);
      return gt({
        series: n,
        center: {
          x: s.value.width / 2,
          y: s.value.height / 2
        },
        maxRadius: Math.min(s.value.width, s.value.height) / 3
      });
    });
    function H(l) {
      return l.x > s.value.width / 2 + 6 ? "start" : l.x < s.value.width / 2 - 6 ? "end" : "middle";
    }
    function tt(l) {
      return l.middlePoint.y > s.value.height / 2 ? L({ initX: l.middlePoint.x, initY: l.middlePoint.y, offset: 100, centerX: s.value.width / 2, centerY: s.value.height / 2 }).y : L({ initX: l.middlePoint.x, initY: l.middlePoint.y, offset: 0, centerX: s.value.width / 2, centerY: s.value.height / 2 }).y - 100;
    }
    function O(l) {
      return l.proportion * 100 > e.value.style.chart.layout.labels.dataLabels.hideUnderValue;
    }
    function ne(l, n) {
      const t = l.value / lt(n);
      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((n) => n.value).reduce((n, t) => n + t, 0);
    }
    const S = m(() => I.value.map((l) => l.value).reduce((l, n) => l + n, 0)), Ne = m(() => S.value / I.value.length), Xe = m(() => (l) => V.value ? l.proportion * 100 : l.value / S.value * 100), re = d(null), Q = d(!1);
    function Ie({ datapoint: l, relativeIndex: n, seriesIndex: t, show: a = !1 }) {
      re.value = { datapoint: l, seriesIndex: t, config: e.value, series: B.value }, ae.value = a, P.value = n;
      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: n,
            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: n,
              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 = m(() => {
      const l = I.value.map((t) => ({
        name: t.name,
        color: t.color
      })), n = I.value.map((t) => t.value);
      return { head: l, body: n };
    });
    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]]), n = [[e.value.style.chart.title.text], [e.value.style.chart.title.subtitle.text], [[""], ["val"], ["%"]]].concat(l), t = Ct(n);
        $t({ csvContent: t, title: e.value.style.chart.title.text || "vue-ui-donut" });
      });
    }
    const oe = m(() => {
      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%"
      ], n = 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: n,
        config: t
      };
    }), R = d(!1);
    function at(l) {
      R.value = l, ke.value += 1;
    }
    const Me = m(() => /^((?!chrome|android).)*safari/i.test(navigator.userAgent));
    function ot(l) {
      return l.toFixed(e.value.style.chart.legend.roundingPercentage).split("").map((n) => "-").join("");
    }
    function M(l, n) {
      de("selectDatapoint", { datapoint: l, index: n });
    }
    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 ie() {
      ue.value = !ue.value;
    }
    return qe({
      getData: Ze,
      generatePdf: Fe,
      generateCsv: De,
      generateImage: Le,
      toggleTable: Be,
      toggleLabels: Ve,
      toggleTooltip: Ge,
      toggleAnnotator: ie
    }), (l, n) => (o(), r("div", {
      ref_key: "donutChart",
      ref: j,
      class: ce(`vue-ui-donut ${R.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: n[6] || (n[6] = () => u(Ce)(!0)),
      onMouseleave: n[7] || (n[7] = () => u(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: ie
      }, null, 8, ["parent", "backgroundColor", "color", "active"])) : i("", !0),
      w(l.$slots, "userConfig", {}, void 0, !0),
      Qe.value ? (o(), r("div", {
        key: 1,
        ref_key: "noTitle",
        ref: pe,
        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(), r("div", {
        key: 2,
        ref_key: "chartTitle",
        ref: he,
        style: "width:100%;background:transparent;padding-bottom:24px"
      }, [
        (o(), G(Ft, {
          key: `title_${ge.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 && (u($e) || u(xe)) ? (o(), G(Tt, {
        ref_key: "details",
        ref: Ke,
        key: `user_option_${ke.value}`,
        backgroundColor: e.value.style.chart.backgroundColor,
        color: e.value.style.chart.color,
        isPrinting: u(Pe),
        isImaging: u(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: R.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: u(Fe),
        onGenerateCsv: De,
        onGenerateImage: u(Le),
        onToggleTable: Be,
        onToggleLabels: Ve,
        onToggleTooltip: Ge,
        onToggleAnnotator: ie,
        style: z({
          visibility: u($e) ? u(xe) ? "visible" : "hidden" : "visible"
        })
      }, nt({ _: 2 }, [
        l.$slots.optionTooltip ? {
          name: "optionTooltip",
          fn: $(() => [
            w(l.$slots, "optionTooltip", {}, void 0, !0)
          ]),
          key: "0"
        } : void 0,
        l.$slots.optionPdf ? {
          name: "optionPdf",
          fn: $(() => [
            w(l.$slots, "optionPdf", {}, void 0, !0)
          ]),
          key: "1"
        } : void 0,
        l.$slots.optionCsv ? {
          name: "optionCsv",
          fn: $(() => [
            w(l.$slots, "optionCsv", {}, void 0, !0)
          ]),
          key: "2"
        } : void 0,
        l.$slots.optionImg ? {
          name: "optionImg",
          fn: $(() => [
            w(l.$slots, "optionImg", {}, void 0, !0)
          ]),
          key: "3"
        } : void 0,
        l.$slots.optionTable ? {
          name: "optionTable",
          fn: $(() => [
            w(l.$slots, "optionTable", {}, void 0, !0)
          ]),
          key: "4"
        } : void 0,
        l.$slots.optionLabels ? {
          name: "optionLabels",
          fn: $(() => [
            w(l.$slots, "optionLabels", {}, void 0, !0)
          ]),
          key: "5"
        } : void 0,
        l.$slots.optionFullscreen ? {
          name: "optionFullscreen",
          fn: $(({ toggleFullscreen: t, isFullscreen: a }) => [
            w(l.$slots, "optionFullscreen", E(W({ toggleFullscreen: t, isFullscreen: a })), void 0, !0)
          ]),
          key: "6"
        } : void 0,
        l.$slots.optionAnnotator ? {
          name: "optionAnnotator",
          fn: $(({ toggleAnnotator: t, isAnnotator: a }) => [
            w(l.$slots, "optionAnnotator", E(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(), r("svg", {
        key: 4,
        xmlns: u(bt),
        class: ce({ "vue-data-ui-fullscreen--on": R.value, "vue-data-ui-fulscreen--off": !R.value }),
        viewBox: `0 0 ${s.value.width <= 0 ? 10 : s.value.width} ${s.value.height <= 0 ? 10 : s.value.height}`,
        style: z(`max-width:100%; overflow: visible; background:transparent;color:${e.value.style.chart.color}`)
      }, [
        je(Xt),
        e.value.type === "classic" ? (o(), r("defs", Ut, [
          e.value.style.chart.useGradient ? (o(), r("radialGradient", {
            key: 0,
            id: `gradient_${_.value}`
          }, [
            h("stop", {
              offset: "0%",
              "stop-color": u(ee)(e.value.style.chart.backgroundColor, 0),
              "stop-opacity": "0"
            }, null, 8, Ht),
            h("stop", {
              offset: `${(1 - K.value / C.value) * 100}%`,
              "stop-color": u(ee)("#FFFFFF", 0),
              "stop-opacity": "0"
            }, null, 8, Rt),
            h("stop", {
              offset: `${(1 - K.value / C.value / 2) * 100}%`,
              "stop-color": u(ee)("#FFFFFF", e.value.style.chart.gradientIntensity)
            }, null, 8, Et),
            h("stop", {
              offset: "100%",
              "stop-color": u(ee)(e.value.style.chart.backgroundColor, 0),
              "stop-opacity": "0"
            }, null, 8, Wt)
          ], 8, jt)) : i("", !0)
        ])) : i("", !0),
        e.value.type === "polar" ? (o(), r("defs", qt, [
          (o(!0), r(k, null, X(c.value, (t, a) => (o(), r("radialGradient", {
            id: `polar_gradient_${a}_${_.value}`,
            cx: t.middlePoint.x / s.value.width * 100 + "%",
            cy: t.middlePoint.y / s.value.height * 100 + "%",
            r: "62%"
          }, [
            h("stop", {
              offset: "0%",
              "stop-color": u(mt)(f.value[a].color, 0.05),
              "stop-opacity": e.value.style.chart.gradientIntensity / 100
            }, null, 8, Kt),
            h("stop", {
              offset: "100%",
              "stop-color": f.value[a].color
            }, null, 8, Qt)
          ], 8, Jt))), 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, el),
            tl
          ], 8, Zt),
          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, al)
          ], 8, ll),
          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, ul)
          ], 8, ol)
        ]),
        e.value.type === "classic" ? (o(!0), r(k, { key: 2 }, X(f.value, (t, a) => (o(), r("g", null, [
          O(t) && y.value.dataLabels.show ? (o(), r("path", {
            key: 0,
            d: u(wt)(t, { x: s.value.width / 2, y: s.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, sl)) : i("", !0)
        ]))), 256)) : i("", !0),
        e.value.type === "polar" ? (o(!0), r(k, { key: 3 }, X(f.value, (t, a) => (o(), r("g", null, [
          O(t) && y.value.dataLabels.show ? (o(), r("line", {
            key: 0,
            x1: u(L)({ initX: c.value[a].middlePoint.x, initY: c.value[a].middlePoint.y, offset: 24, centerX: s.value.width / 2, centerY: s.value.height / 2 }).x,
            y1: u(L)({ initX: c.value[a].middlePoint.x, initY: c.value[a].middlePoint.y, offset: 24, centerX: s.value.width / 2, centerY: s.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, nl)) : i("", !0)
        ]))), 256)) : i("", !0),
        e.value.type === "classic" ? (o(), r("circle", {
          key: 4,
          cx: s.value.width / 2,
          cy: s.value.height / 2,
          r: C.value <= 0 ? 10 : C.value,
          fill: e.value.style.chart.backgroundColor,
          filter: e.value.style.chart.layout.donut.useShadow ? `url(#shadow_${_.value})` : ""
        }, null, 8, rl)) : i("", !0),
        S.value && e.value.type === "classic" ? (o(), r(k, { key: 5 }, [
          (o(!0), r(k, null, X(f.value, (t, a) => (o(), r("path", {
            stroke: e.value.style.chart.backgroundColor,
            d: t.arcSlice,
            fill: "#FFFFFF"
          }, null, 8, il))), 256)),
          (o(!0), r(k, null, X(f.value, (t, a) => (o(), r("path", {
            class: "vue-ui-donut-arc-path",
            d: t.arcSlice,
            fill: u(ee)(t.color, 80),
            stroke: e.value.style.chart.backgroundColor,
            "stroke-width": e.value.style.chart.layout.donut.borderWidth,
            filter: Z(a)
          }, null, 8, vl))), 256))
        ], 64)) : i("", !0),
        S.value && e.value.type === "polar" ? (o(), r(k, { key: 6 }, [
          f.value.length > 1 ? (o(), r("g", cl, [
            (o(!0), r(k, null, X(f.value, (t, a) => (o(), r("path", {
              stroke: e.value.style.chart.backgroundColor,
              d: c.value[a].path,
              fill: "#FFFFFF"
            }, null, 8, dl))), 256)),
            e.value.style.chart.layout.donut.useShadow ? (o(), r("g", hl, [
              (o(!0), r(k, null, X(f.value, (t, a) => (o(), r("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, yl))), 256))
            ])) : i("", !0),
            (o(!0), r(k, null, X(f.value, (t, a) => (o(), r("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, fl))), 256))
          ])) : (o(), r("g", pl, [
            h("circle", {
              cx: s.value.width / 2,
              cy: s.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, gl)
          ]))
        ], 64)) : (o(), r("circle", {
          key: 7,
          cx: s.value.width / 2,
          cy: s.value.height / 2,
          r: C.value <= 0 ? 10 : C.value,
          fill: "transparent",
          stroke: e.value.style.chart.backgroundColor
        }, null, 8, bl)),
        e.value.style.chart.useGradient && e.value.type === "classic" ? (o(), r("circle", {
          key: 8,
          cx: s.value.width / 2,
          cy: s.value.height / 2,
          r: (
            /* This might require adjustments */
            C.value <= 0 ? 10 : C.value
          ),
          fill: `url(#gradient_${_.value})`
        }, null, 8, ml)) : i("", !0),
        S.value ? (o(), r(k, { key: 9 }, [
          f.value.length > 1 || e.value.type === "classic" ? (o(), r("g", wl, [
            (o(!0), r(k, null, X(f.value, (t, a) => (o(), r("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: n[0] || (n[0] = (v) => {
                ae.value = !1, P.value = null;
              }),
              onClick: (v) => M(t, a)
            }, null, 40, kl))), 256))
          ])) : (o(), r("g", _l, [
            h("circle", {
              cx: s.value.width / 2,
              cy: s.value.height / 2,
              r: C.value,
              fill: P.value === l.i ? "rgba(0,0,0,0.1)" : "transparent",
              "data-cy-donut-trap": "",
              onMouseenter: n[1] || (n[1] = (t) => Ie({
                datapoint: f.value[0],
                relativeIndex: 0,
                seriesIndex: f.value[0].seriesIndex,
                show: !0
              })),
              onMouseleave: n[2] || (n[2] = (t) => {
                ae.value = !1, P.value = null;
              }),
              onClick: n[3] || (n[3] = (t) => M(f.value[0], l.i))
            }, null, 40, xl)
          ]))
        ], 64)) : i("", !0),
        e.value.type === "classic" ? (o(), r(k, { key: 10 }, [
          e.value.style.chart.layout.labels.hollow.total.show ? (o(), r("text", {
            key: 0,
            "text-anchor": "middle",
            x: s.value.width / 2,
            y: s.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, Cl)) : i("", !0),
          e.value.style.chart.layout.labels.hollow.total.show ? (o(), r("text", {
            key: 1,
            "text-anchor": "middle",
            x: s.value.width / 2,
            y: s.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(u(Y)(
            e.value.style.chart.layout.labels.hollow.total.value.formatter,
            S.value,
            u(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, $l)) : i("", !0),
          e.value.style.chart.layout.labels.hollow.average.show ? (o(), r("text", {
            key: 2,
            "text-anchor": "middle",
            x: s.value.width / 2,
            y: s.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, Pl)) : i("", !0),
          e.value.style.chart.layout.labels.hollow.average.show ? (o(), r("text", {
            key: 3,
            "text-anchor": "middle",
            x: s.value.width / 2,
            y: s.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 ? "--" : u(Y)(
            e.value.style.chart.layout.labels.hollow.average.value.formatter,
            Ne.value,
            u(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, Sl)) : i("", !0)
        ], 64)) : i("", !0),
        (o(!0), r(k, null, X(f.value, (t, a) => (o(), r("g", {
          filter: Z(a),
          class: ce({ animated: e.value.useCssAnimation })
        }, [
          e.value.style.chart.layout.labels.dataLabels.useLabelSlots ? (o(), r("g", Ll, [
            (o(), r("foreignObject", {
              x: u(b)(t, !0).anchor === "end" ? u(b)(t).x - 120 : u(b)(t, !0).anchor === "middle" ? u(b)(t).x - 60 : u(b)(t).x,
              y: u(te)(t) - (Me.value ? 20 : 0),
              width: "120",
              height: "60",
              style: { overflow: "visible" }
            }, [
              h("div", null, [
                w(l.$slots, "dataLabel", E(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: u(b)(t, !0, 16, !0).anchor,
                  flexAlign: u(b)(t, !0, 16).anchor,
                  percentage: ne(t, f.value)
                })), void 0, !0)
              ])
            ], 8, Tl))
          ])) : (o(), r("g", zl, [
            e.value.type === "classic" ? (o(), r(k, { key: 0 }, [
              O(t) && y.value.dataLabels.show ? (o(), r("circle", {
                key: 0,
                cx: u(b)(t).x,
                cy: u(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, Ol)) : i("", !0)
            ], 64)) : i("", !0),
            e.value.type === "polar" ? (o(), r(k, { key: 1 }, [
              O(t) && y.value.dataLabels.show ? (o(), r("circle", {
                key: 0,
                cx: u(L)({ initX: c.value[a].middlePoint.x, initY: c.value[a].middlePoint.y, offset: 24, centerX: s.value.width / 2, centerY: s.value.height / 2 }).x,
                cy: u(L)({ initX: c.value[a].middlePoint.x, initY: c.value[a].middlePoint.y, offset: 24, centerX: s.value.width / 2, centerY: s.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, Yl)) : i("", !0)
            ], 64)) : i("", !0),
            e.value.type === "classic" ? (o(), r(k, { key: 2 }, [
              O(t) && y.value.dataLabels.show ? (o(), r("text", {
                key: 0,
                "text-anchor": u(b)(t, !0, 12).anchor,
                x: u(b)(t, !0, 12).x,
                y: u(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(ne(t, f.value)) + " " + x(e.value.style.chart.layout.labels.value.show ? `(${u(Y)(
                e.value.style.chart.layout.labels.value.formatter,
                t.value,
                u(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, Al)) : i("", !0),
              O(t) && y.value.dataLabels.show ? (o(), r("text", {
                key: 1,
                "text-anchor": u(b)(t).anchor,
                x: u(b)(t, !0, 12).x,
                y: u(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, Nl)) : i("", !0)
            ], 64)) : i("", !0),
            e.value.type === "polar" ? (o(), r(k, { key: 3 }, [
              O(t) && y.value.dataLabels.show ? (o(), r("text", {
                key: 0,
                "text-anchor": H(c.value[a].middlePoint),
                x: u(L)({ initX: c.value[a].middlePoint.x, initY: c.value[a].middlePoint.y, offset: 42, centerX: s.value.width / 2, centerY: s.value.height / 2 }).x,
                y: u(L)({ initX: c.value[a].middlePoint.x, initY: c.value[a].middlePoint.y, offset: 42, centerX: s.value.width / 2, centerY: s.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(ne(t, f.value)) + " " + x(e.value.style.chart.layout.labels.value.show ? `(${u(Y)(
                e.value.style.chart.layout.labels.value.formatter,
                t.value,
                u(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, Xl)) : i("", !0),
              O(t) && y.value.dataLabels.show ? (o(), r("text", {
                key: 1,
                "text-anchor": H(c.value[a].middlePoint),
                x: u(L)({ initX: c.value[a].middlePoint.x, initY: c.value[a].middlePoint.y, offset: 42, centerX: s.value.width / 2, centerY: s.value.height / 2 }).x,
                y: u(L)({ initX: c.value[a].middlePoint.x, initY: c.value[a].middlePoint.y, offset: 42, centerX: s.value.width / 2, centerY: s.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, Il)) : i("", !0)
            ], 64)) : i("", !0)
          ])),
          y.value.dataLabels.show && e.value.style.chart.comments.show && t.comment ? (o(), r("g", Dl, [
            O(t) && e.value.type === "classic" ? (o(), r("foreignObject", {
              key: 0,
              x: e.value.style.chart.comments.offsetX + (u(b)(t, !0).anchor === "end" ? u(b)(t).x - e.value.style.chart.comments.width : u(b)(t, !0).anchor === "middle" ? u(b)(t).x - e.value.style.chart.comments.width / 2 : u(b)(t).x),
              y: u(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, [
                w(l.$slots, "plot-comment", {
                  plot: { ...t, textAlign: u(b)(t, !0, 16, !0).anchor, flexAlign: u(b)(t, !0, 16).anchor }
                }, void 0, !0)
              ])
            ], 8, Ml)) : i("", !0),
            O(t) && e.value.type === "polar" ? (o(), r("foreignObject", {
              key: 1,
              x: e.value.style.chart.comments.offsetX + (H(c.value[a].middlePoint) === "end" ? u(L)({ initX: c.value[a].middlePoint.x, initY: c.value[a].middlePoint.y, offset: 42, centerX: s.value.width / 2, centerY: s.value.height / 2 }).x - e.value.style.chart.comments.width : H(c.value[a].middlePoint) === "middle" ? u(L)({ initX: c.value[a].middlePoint.x, initY: c.value[a].middlePoint.y, offset: 42, centerX: s.value.width / 2, centerY: s.value.height / 2 }).x - e.value.style.chart.comments.width / 2 : u(L)({ initX: c.value[a].middlePoint.x, initY: c.value[a].middlePoint.y, offset: 42, centerX: s.value.width / 2, centerY: s.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, [
                w(l.$slots, "plot-comment", {
                  plot: { ...t, textAlign: H(c.value[a].middlePoint), flexAlign: H(c.value[a].middlePoint) }
                }, void 0, !0)
              ])
            ], 8, Bl)) : i("", !0)
          ])) : i("", !0)
        ], 10, Fl))), 256)),
        w(l.$slots, "svg", { svg: s.value }, void 0, !0)
      ], 14, Gt)) : i("", !0),
      l.$slots.watermark ? (o(), r("div", Vl, [
        w(l.$slots, "watermark", E(W({ isPrinting: u(Pe) || u(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: ye
      }, [
        e.value.style.chart.legend.show ? (o(), G(Yt, {
          key: `legend_${me.value}`,
          legendSet: Ae.value,
          config: et.value,
          onClickMarker: n[4] || (n[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(u(Y)(
                e.value.style.chart.layout.labels.value.formatter,
                t.value,
                u(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(), r("span", jl, " ( " + x(ot(t.proportion * 100)) + " % ) ", 1)) : (o(), r("span", Ul, " (" + x(isNaN(t.value / S.value) ? "-" : u(Y)(
                e.value.style.chart.layout.labels.percentage.formatter,
                Xe.value(t),
                u(F)({
                  v: Xe.value(t),
                  s: "%",
                  r: e.value.style.chart.legend.roundingPercentage
                })
              )) + ") ", 1))
            ], 12, Gl)
          ]),
          _: 1
        }, 8, ["legendSet", "config"])) : i("", !0),
        w(l.$slots, "legend", { legend: Ae.value }, void 0, !0)
      ], 512),
      l.$slots.source ? (o(), r("div", {
        key: 7,
        ref_key: "source",
        ref: fe,
        dir: "auto"
      }, [
        w(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: R.value
      }, {
        "tooltip-before": $(() => [
          w(l.$slots, "tooltip-before", E(W({ ...re.value })), void 0, !0)
        ]),
        "tooltip-after": $(() => [
          w(l.$slots, "tooltip-after", E(W({ ...re.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_${be.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: n[5] || (n[5] = (t) => y.value.showTable = !1)
          }, {
            th: $(({ th: t }) => [
              h("div", {
                innerHTML: t,
                style: { display: "flex", "align-items": "center" }
              }, null, 8, Hl)
            ]),
            td: $(({ td: t }) => [
              He(x(t.name ? t.name : isNaN(Number(t)) ? t.includes("%") ? t : u(Y)(
                e.value.style.chart.layout.labels.percentage.formatter,
                t,
                u(F)({
                  v: t,
                  s: "%",
                  r: e.value.style.chart.layout.labels.percentage.rounding
                })
              ) : u(Y)(
                e.value.style.chart.layout.labels.value.formatter,
                t,
                u(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));
  }
}, ra = /* @__PURE__ */ Mt(Rl, [["__scopeId", "data-v-d4fdff95"]]);
export {
  ra as default
};
