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