import { computed as p, ref as i, watch as je, onMounted as qe, onBeforeUnmount as He, openBlock as r, createElementBlock as n, normalizeClass as z, normalizeStyle as W, unref as d, createBlock as _, createCommentVNode as c, createSlots as Ye, withCtx as m, renderSlot as f, normalizeProps as M, guardReactiveProps as R, createVNode as ee, createElementVNode as $, Fragment as T, renderList as P, toDisplayString as U, createTextVNode as Pe, nextTick as Qe } from "vue";
import { u as Je, c as Ke, t as Ze, a as et, p as x, o as tt, e as S, b as at, g as xe, d as Ae, P as Oe, v as ot, i as Fe, f as V, X as lt, s as te, w as rt, Q as Ne, x as st, y as nt, q as ut, r as it } from "./index-OhfEeW2N.js";
import { t as dt, u as ct } from "./useResponsive-CoxXLe23.js";
import { _ as vt } from "./Title-hfEOmPlv.js";
import { u as ht, U as pt } from "./usePrinter-stvkbwgz.js";
import { _ as gt } from "./Tooltip-DvcJ9uFx.js";
import ft from "./vue-ui-sparkbar-_FtDdeUa.js";
import { L as yt } from "./Legend-Qe36RQO1.js";
import { D as mt } from "./DataTable-BaW_PF1t.js";
import bt from "./vue-ui-skeleton-CZBWPZpy.js";
import kt from "./vue-ui-accordion-BH0OU8sD.js";
import { u as Se } from "./useNestedProp-Cwjz-hIm.js";
import { _ as Ct } from "./PackageVersion-DBbbI7TU.js";
import { P as wt } from "./PenAndPaper-tV-SbWUa.js";
import { u as _t } from "./useUserOptionState-BIvW1Kz7.js";
import { _ as $t } from "./_plugin-vue_export-helper-CHgC5LLL.js";
const Tt = ["id"], Pt = ["xmlns", "viewBox"], xt = ["width", "height"], At = ["id"], Ot = ["stop-color"], Ft = ["stop-color"], Nt = { key: 1 }, St = ["x1", "y1", "x2", "y2", "stroke", "stroke-width"], It = { key: 0 }, Lt = ["d", "stroke", "stroke-width"], zt = ["d", "stroke", "stroke-width"], Mt = { key: 2 }, Rt = ["x", "y", "text-anchor", "font-size", "fill", "onMouseenter"], Ut = ["points", "stroke", "stroke-width"], Vt = ["points", "stroke", "stroke-width", "fill"], Et = { key: 3 }, Bt = ["cx", "cy", "fill", "r", "stroke"], Dt = {
  key: 5,
  class: "vue-data-ui-watermark"
}, Gt = ["onClick"], Wt = {
  key: 0,
  style: { "max-width": "200px", margin: "0 auto" }
}, Xt = {
  __name: "vue-ui-radar",
  props: {
    config: {
      type: Object,
      default() {
        return {};
      }
    },
    dataset: {
      type: Object,
      default() {
        return {};
      }
    }
  },
  emits: ["selectLegend"],
  setup(Ie, { expose: Le, emit: ze }) {
    const g = Ie, { vue_ui_radar: Me } = Je(), I = p(() => !!g.dataset && Object.keys(g.dataset).length), w = i(Ke()), Re = i(null), X = i(!1), j = i(""), ae = i(0), A = i(null), oe = i(null), le = i(null), re = i(null), se = i(null), ne = i(0), ue = i(0), ie = i(0), e = p({
      get: () => ve(),
      set: (t) => t
    }), { userOptionsVisible: q, setUserOptionsVisibility: de, keepUserOptionState: ce } = _t({ config: e.value });
    function ve() {
      const t = Se({
        userConfig: g.config,
        defaultConfig: Me
      });
      return t.theme ? {
        ...Se({
          userConfig: Ze.vue_ui_radar[t.theme] || g.config,
          defaultConfig: t
        }),
        customPalette: et[t.theme] || x
      } : t;
    }
    je(() => g.config, (t) => {
      e.value = ve(), q.value = !e.value.userOptions.showOnChartHover, he(), ne.value += 1, ue.value += 1, ie.value += 1, b.value.dataLabels.show = e.value.style.chart.layout.labels.dataLabels.show, b.value.showTable = e.value.table.show, b.value.showTooltip = e.value.style.chart.tootlip.show;
    }, { deep: !0 });
    const E = i(null);
    function he() {
      if (tt(g.dataset) && S({
        componentName: "VueUiRadar",
        type: "dataset"
      }), e.value.responsive) {
        const t = dt(() => {
          const { width: a, height: o } = ct({
            chart: A.value,
            title: e.value.style.chart.title.text ? oe.value : null,
            legend: e.value.style.chart.legend.show ? le.value : null,
            source: re.value,
            noTitle: se.value
          });
          requestAnimationFrame(() => {
            u.value.width = a, u.value.height = o;
          });
        });
        E.value = new ResizeObserver(t), E.value.observe(A.value.parentNode);
      }
    }
    qe(() => {
      he();
    }), He(() => {
      E.value && E.value.disconnect();
    });
    const { isPrinting: pe, isImaging: ge, generatePdf: fe, generateImage: ye } = ht({
      elementId: `vue-ui-radar_${w.value}`,
      fileName: e.value.style.chart.title.text || "vue-ui-radar"
    }), Ue = p(() => e.value.userOptions.show && !e.value.style.chart.title.text), me = p(() => at(e.value.customPalette)), b = i({
      dataLabels: {
        show: e.value.style.chart.layout.labels.dataLabels.show
      },
      showTable: e.value.table.show,
      showTooltip: e.value.style.chart.tooltip.show
    }), Ve = p(() => ({
      style: {
        backgroundColor: "#FFFFFF00",
        animation: {
          show: e.value.style.chart.tooltip.animation.show,
          animationFrames: e.value.style.chart.tooltip.animation.animationFrames
        },
        labels: {
          fontSize: e.value.style.chart.tooltip.fontSize,
          name: {
            color: e.value.style.chart.tooltip.color
          }
        },
        gutter: {
          backgroundColor: "#CCCCCC",
          opacity: 30
        }
      }
    })), u = i({
      height: 312,
      width: 512
    }), v = i([]), L = i(null), O = i(!1);
    function be(t) {
      O.value = !0, v.value.includes(t) ? (L.value = t, v.value = v.value.filter((a) => a !== t), setTimeout(() => {
        O.value = !1, L.value = null;
      }, 500)) : (v.value.push(t), setTimeout(() => {
        O.value = !1;
      }, 500)), ze("selectLegend", F.value.filter((a, o) => !v.value.includes(o)).map((a) => ({
        name: a.name,
        color: a.color,
        proportion: a.totalProportion
      })));
    }
    function Ee() {
      return F.value.map((t) => ({
        name: t.name,
        color: t.color,
        proportion: t.totalProportion
      }));
    }
    const y = p(() => [null, void 0].includes(g.dataset.categories) ? (S({
      componentName: "VueUiRadar",
      type: "datasetAttribute",
      property: "categories ({ name: string; prefix?: string; suffix?: string}[])"
    }), []) : (g.dataset.categories.length === 0 ? S({
      componentName: "VueUiRadar",
      type: "datasetAttributeEmpty",
      property: "categories"
    }) : g.dataset.categories.forEach((t, a) => {
      xe({
        datasetObject: t,
        requiredAttributes: ["name"]
      }).forEach((o) => {
        S({
          componentName: "VueUiRadar",
          type: "datasetAttribute",
          property: `category.${o} at index ${a}`,
          index: a
        });
      });
    }), [null, void 0].includes(g.dataset.series) ? S({
      componentName: "VueUiRadar",
      type: "datasetAttribute",
      property: "series ({ name: string; values: number[]; color?: string; target: number}[])"
    }) : g.dataset.series.forEach((t, a) => {
      xe({
        datasetObject: t,
        requiredAttributes: ["name", "values", "target"]
      }).forEach((o) => {
        S({
          componentName: "VueUiRadar",
          type: "datasetSerieAttribute",
          key: "series",
          property: o,
          index: a
        });
      });
    }), g.dataset.categories.map((t, a) => ({
      name: t.name,
      categoryId: `radar_category_${w.value}_${a}`,
      color: Ae(t.color) || me.value[a] || x[a] || x[a % x.length],
      prefix: t.prefix ?? "",
      suffix: t.suffix ?? ""
    })))), k = p(() => I.value ? g.dataset.series.map((t, a) => ({
      ...t,
      color: Ae(t.color) || me.value[a] || x[a] || x[a % x.length],
      serieId: `radar_serie_${w.value}_${a}`,
      formatter: t.formatter || null
    })) : []), ke = p(() => Math.max(...k.value.flatMap((t) => t.values))), Ce = p(() => k.value.length), H = p(() => Math.min(u.value.width, u.value.height) / 3), we = p(() => Oe({
      plot: { x: u.value.width / 2, y: u.value.height / 2 },
      radius: H.value,
      sides: Ce.value,
      rotation: 0
    })), Be = p(() => {
      const t = [];
      for (let a = 0; a < H.value; a += H.value / e.value.style.chart.layout.grid.graduations)
        t.push(a);
      return t;
    }), C = p(() => we.value.coordinates.map((t, a) => {
      const o = k.value[a].values.map((l) => De({
        centerX: u.value.width / 2,
        centerY: u.value.height / 2,
        apexX: t.x,
        apexY: t.y,
        proportion: l / (k.value[a].target || ke.value)
      }));
      return {
        ...t,
        ...k.value[a],
        plots: o
      };
    }));
    function Y({ x: t, y: a }) {
      let o = "middle";
      return t = Math.round(t), a = Math.round(a), t > u.value.width / 2 && (t += 12, o = "start"), t < u.value.width / 2 && (t -= 12, o = "end"), a > u.value.height / 2 && (a += 20), a < u.value.height / 2 && (a -= 12), a === u.value.height / 2 && (a += 4), { x: t, y: a, anchor: o };
    }
    function De({ centerX: t, centerY: a, apexX: o, apexY: l, proportion: s }) {
      return {
        x: t + (o - t) * s,
        y: a + (l - a) * s
      };
    }
    const F = p(() => {
      const t = k.value.map((a, o) => a.values.map((l) => l / (a.target || ke.value)));
      return y.value.map((a, o) => ({
        ...a,
        totalProportion: ot(t.map((l) => l[o]).reduce((l, s) => l + s, 0) / k.value.length),
        shape: "circle",
        opacity: v.value.includes(o) ? 0.5 : 1,
        segregate: () => be(o),
        isSegregated: v.value.includes(o)
      }));
    }), Ge = p(() => ({
      cy: "radar-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" : ""
    })), B = p(() => {
      const t = [
        { name: e.value.translations.datapoint, color: "" },
        { name: e.value.translations.target, color: "" },
        ...F.value
      ], a = g.dataset.series.map((l) => [
        l.name,
        Fe(
          l.formatter,
          l.target,
          V({
            p: l.prefix,
            v: l.target,
            s: l.suffix,
            r: e.value.table.td.roundingValue
          })
        ),
        ...l.values.map((s, h) => `${Fe(
          l.formatter,
          s,
          V({ p: y.value[h].prefix, v: s, s: y.value[h].suffix, r: e.value.table.td.roundingValue })
        )} (${isNaN(s / l.target) ? "" : V({
          v: s / l.target * 100,
          s: "%",
          r: e.value.table.td.roundingPercentage
        })})`)
      ]), o = {
        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 { head: t, body: a, config: o, colNames: t };
    }), D = i(null), Q = i([]), J = i(null);
    function We(t, a) {
      Q.value = [], D.value = a, X.value = !0;
      let o = "";
      J.value = {
        datapoint: t,
        seriesIndex: a,
        series: {
          categories: y.value,
          datapoints: k.value,
          radar: C.value
        },
        config: e.value
      };
      const l = e.value.style.chart.tooltip.customFormat;
      if (st(l) && nt(() => l({
        seriesIndex: a,
        datapoint: t,
        series: { categories: y.value, datapoints: k.value, radar: C.value },
        config: e.value
      })))
        j.value = l({
          seriesIndex: a,
          datapoint: t,
          series: { categories: y.value, datapoints: k.value, radar: C.value },
          config: e.value
        });
      else {
        o += `<div style="width:100%;text-align:center;border-bottom:1px solid ${e.value.style.chart.tooltip.borderColor};padding-bottom:6px;margin-bottom:3px;">${t.name}</div>`;
        for (let s = 0; s < t.values.length; s += 1)
          v.value.includes(s) || Q.value.push({
            name: y.value[s].name,
            value: t.values[s] / t.target * 100,
            color: y.value[s].color,
            suffix: "%)",
            prefix: `${V({ p: y.value[s].prefix ?? "", v: t.values[s], s: y.value[s].suffix ?? "", r: e.value.style.chart.tooltip.roundingValue })} (`,
            rounding: e.value.style.chart.tooltip.roundingPercentage,
            formatter: t.formatter
          });
        j.value = o;
      }
    }
    function _e() {
      Qe(() => {
        const t = [[e.value.style.chart.title.text], [e.value.style.chart.title.subtitle.text], [""]], a = [[""], [e.value.translations.target], ...F.value.flatMap((h) => [[h.name], ["%"]])], o = g.dataset.series.map((h, jt) => [h.name, h.target, ...h.values.flatMap((Z) => [
          Z,
          isNaN(Z / h.target) ? "" : Z / h.target * 100
        ])]), l = t.concat([a]).concat(o), s = ut(l);
        it({ csvContent: s, title: e.value.style.chart.title.text || "vue-ui-radar" });
      });
    }
    const N = i(!1);
    function Xe(t) {
      N.value = t, ae.value += 1;
    }
    function $e() {
      b.value.showTable = !b.value.showTable;
    }
    function Te() {
      b.value.showTooltip = !b.value.showTooltip;
    }
    const G = i(!1);
    function K() {
      G.value = !G.value;
    }
    return Le({
      getData: Ee,
      generatePdf: fe,
      generateCsv: _e,
      generateImage: ye,
      toggleTable: $e,
      toggleTooltip: Te,
      toggleAnnotator: K
    }), (t, a) => (r(), n("div", {
      class: z(`vue-ui-radar ${N.value ? "vue-data-ui-wrapper-fullscreen" : ""} ${e.value.useCssAnimation ? "" : "vue-ui-dna"}`),
      ref_key: "radarChart",
      ref: A,
      id: `vue-ui-radar_${w.value}`,
      style: W(`font-family:${e.value.style.fontFamily};width:100%; ${e.value.responsive ? "height: 100%;" : ""} text-align:center;background:${e.value.style.chart.backgroundColor}`),
      onMouseenter: a[3] || (a[3] = () => d(de)(!0)),
      onMouseleave: a[4] || (a[4] = () => d(de)(!1))
    }, [
      e.value.userOptions.buttons.annotator ? (r(), _(wt, {
        key: 0,
        parent: A.value,
        backgroundColor: e.value.style.chart.backgroundColor,
        color: e.value.style.chart.color,
        active: G.value,
        onClose: K
      }, null, 8, ["parent", "backgroundColor", "color", "active"])) : c("", !0),
      Ue.value ? (r(), n("div", {
        key: 1,
        ref_key: "noTitle",
        ref: se,
        class: "vue-data-ui-no-title-space",
        style: "height:36px; width: 100%;background:transparent"
      }, null, 512)) : c("", !0),
      e.value.style.chart.title.text ? (r(), n("div", {
        key: 2,
        ref_key: "chartTitle",
        ref: oe,
        style: "width:100%;background:transparent;padding-bottom:12px"
      }, [
        (r(), _(vt, {
          key: `title_${ne.value}`,
          config: {
            title: {
              cy: "radar-div-title",
              ...e.value.style.chart.title
            },
            subtitle: {
              cy: "radar-div-subtitle",
              ...e.value.style.chart.title.subtitle
            }
          }
        }, null, 8, ["config"]))
      ], 512)) : c("", !0),
      e.value.userOptions.show && I.value && (d(ce) || d(q)) ? (r(), _(pt, {
        ref_key: "details",
        ref: Re,
        key: `user_options_${ae.value}`,
        backgroundColor: e.value.style.chart.backgroundColor,
        color: e.value.style.chart.color,
        isImaging: d(ge),
        isPrinting: d(pe),
        uid: w.value,
        hasTooltip: e.value.userOptions.buttons.tooltip && e.value.style.chart.tooltip.show,
        hasPdf: e.value.userOptions.buttons.pdf,
        hasImg: e.value.userOptions.buttons.img,
        hasXls: e.value.userOptions.buttons.csv,
        hasTable: e.value.userOptions.buttons.table,
        hasFullscreen: e.value.userOptions.buttons.fullscreen,
        isFullscreen: N.value,
        isTooltip: b.value.showTooltip,
        titles: { ...e.value.userOptions.buttonTitles },
        chartElement: A.value,
        position: e.value.userOptions.position,
        hasAnnotator: e.value.userOptions.buttons.annotator,
        isAnnotation: G.value,
        onToggleFullscreen: Xe,
        onGeneratePdf: d(fe),
        onGenerateCsv: _e,
        onGenerateImage: d(ye),
        onToggleTable: $e,
        onToggleTooltip: Te,
        onToggleAnnotator: K,
        style: W({
          visibility: d(ce) ? d(q) ? "visible" : "hidden" : "visible"
        })
      }, Ye({ _: 2 }, [
        t.$slots.optionTooltip ? {
          name: "optionTooltip",
          fn: m(() => [
            f(t.$slots, "optionTooltip", {}, void 0, !0)
          ]),
          key: "0"
        } : void 0,
        t.$slots.optionPdf ? {
          name: "optionPdf",
          fn: m(() => [
            f(t.$slots, "optionPdf", {}, void 0, !0)
          ]),
          key: "1"
        } : void 0,
        t.$slots.optionCsv ? {
          name: "optionCsv",
          fn: m(() => [
            f(t.$slots, "optionCsv", {}, void 0, !0)
          ]),
          key: "2"
        } : void 0,
        t.$slots.optionImg ? {
          name: "optionImg",
          fn: m(() => [
            f(t.$slots, "optionImg", {}, void 0, !0)
          ]),
          key: "3"
        } : void 0,
        t.$slots.optionTable ? {
          name: "optionTable",
          fn: m(() => [
            f(t.$slots, "optionTable", {}, void 0, !0)
          ]),
          key: "4"
        } : void 0,
        t.$slots.optionFullscreen ? {
          name: "optionFullscreen",
          fn: m(({ toggleFullscreen: o, isFullscreen: l }) => [
            f(t.$slots, "optionFullscreen", M(R({ toggleFullscreen: o, isFullscreen: l })), void 0, !0)
          ]),
          key: "5"
        } : void 0,
        t.$slots.optionAnnotator ? {
          name: "optionAnnotator",
          fn: m(({ toggleAnnotator: o, isAnnotator: l }) => [
            f(t.$slots, "optionAnnotator", M(R({ toggleAnnotator: o, isAnnotator: l })), void 0, !0)
          ]),
          key: "6"
        } : void 0
      ]), 1032, ["backgroundColor", "color", "isImaging", "isPrinting", "uid", "hasTooltip", "hasPdf", "hasImg", "hasXls", "hasTable", "hasFullscreen", "isFullscreen", "isTooltip", "titles", "chartElement", "position", "hasAnnotator", "isAnnotation", "onGeneratePdf", "onGenerateImage", "style"])) : c("", !0),
      I.value ? (r(), n("svg", {
        key: 4,
        xmlns: d(lt),
        class: z({ "vue-data-ui-fullscreen--on": N.value, "vue-data-ui-fulscreen--off": !N.value }),
        viewBox: `0 0 ${u.value.width <= 0 ? 10 : u.value.width} ${u.value.height <= 0 ? 10 : u.value.height}`,
        style: W(`max-width:100%;overflow:visible;background:transparent;color:${e.value.style.chart.color}`)
      }, [
        ee(Ct),
        t.$slots["chart-background"] ? (r(), n("foreignObject", {
          key: 0,
          x: 0,
          y: 0,
          width: u.value.width <= 0 ? 10 : u.value.width,
          height: u.value.height <= 0 ? 10 : u.value.height,
          style: {
            pointerEvents: "none"
          }
        }, [
          f(t.$slots, "chart-background", {}, void 0, !0)
        ], 8, xt)) : c("", !0),
        $("defs", null, [
          (r(!0), n(T, null, P(y.value, (o, l) => (r(), n("radialGradient", {
            cx: "50%",
            cy: "50%",
            r: "50%",
            fx: "50%",
            fy: "50%",
            id: `radar_gradient_${w.value}_${l}`
          }, [
            $("stop", {
              offset: "0%",
              "stop-color": d(te)(d(rt)(o.color, 0.05), e.value.style.chart.layout.dataPolygon.opacity)
            }, null, 8, Ot),
            $("stop", {
              offset: "100%",
              "stop-color": d(te)(o.color, e.value.style.chart.layout.dataPolygon.opacity)
            }, null, 8, Ft)
          ], 8, At))), 256))
        ]),
        e.value.style.chart.layout.grid.show ? (r(), n("g", Nt, [
          (r(!0), n(T, null, P(C.value, (o) => (r(), n("line", {
            x1: u.value.width / 2,
            y1: u.value.height / 2,
            x2: o.x,
            y2: o.y,
            stroke: e.value.style.chart.layout.grid.stroke,
            "stroke-width": e.value.style.chart.layout.grid.strokeWidth
          }, null, 8, St))), 256)),
          e.value.style.chart.layout.grid.graduations > 0 ? (r(), n("g", It, [
            (r(!0), n(T, null, P(Be.value, (o) => (r(), n("path", {
              d: d(Oe)({
                plot: { x: u.value.width / 2, y: u.value.height / 2 },
                radius: o,
                sides: Ce.value,
                rotation: 0
              }).path,
              fill: "none",
              stroke: e.value.style.chart.layout.grid.stroke,
              "stroke-width": e.value.style.chart.layout.grid.strokeWidth
            }, null, 8, Lt))), 256))
          ])) : c("", !0)
        ])) : c("", !0),
        $("path", {
          d: we.value.path,
          fill: "none",
          stroke: e.value.style.chart.layout.outerPolygon.stroke,
          "stroke-width": e.value.style.chart.layout.outerPolygon.strokeWidth,
          "stroke-linejoin": "round",
          "stroke-linecap": "round"
        }, null, 8, zt),
        e.value.style.chart.layout.labels.dataLabels.show ? (r(), n("g", Mt, [
          (r(!0), n(T, null, P(C.value, (o, l) => (r(), n("text", {
            x: Y(o).x,
            y: Y(o).y,
            "text-anchor": Y(o).anchor,
            "font-size": e.value.style.chart.layout.labels.dataLabels.fontSize,
            fill: e.value.style.chart.layout.labels.dataLabels.color,
            onMouseenter: (s) => We(o, l),
            onMouseleave: a[0] || (a[0] = (s) => {
              X.value = !1, D.value = null;
            })
          }, U(o.name), 41, Rt))), 256))
        ])) : c("", !0),
        (r(!0), n(T, null, P(y.value, (o, l) => (r(), n("g", null, [
          $("g", null, [
            e.value.useCssAnimation || !e.value.useCssAnimation && !v.value.includes(l) ? (r(), n("polygon", {
              key: 0,
              "data-cy-radar-path": "",
              points: d(Ne)(C.value.map((s) => s.plots[l]), !1, !0),
              stroke: e.value.style.chart.backgroundColor,
              "stroke-width": e.value.style.chart.layout.dataPolygon.strokeWidth + 1,
              fill: "none",
              class: z({ "animated-out": v.value.includes(l) && e.value.useCssAnimation, "animated-in": O.value && L.value === l && e.value.useCssAnimation })
            }, null, 10, Ut)) : c("", !0),
            e.value.useCssAnimation || !e.value.useCssAnimation && !v.value.includes(l) ? (r(), n("polygon", {
              key: 1,
              "data-cy-radar-path": "",
              points: d(Ne)(C.value.map((s) => s.plots[l]), !1, !0),
              stroke: o.color,
              "stroke-width": e.value.style.chart.layout.dataPolygon.strokeWidth,
              fill: e.value.style.chart.layout.dataPolygon.transparent ? "transparent" : e.value.style.chart.layout.dataPolygon.useGradient ? `url(#radar_gradient_${w.value}_${l})` : d(te)(o.color, e.value.style.chart.layout.dataPolygon.opacity),
              class: z({ "animated-out": v.value.includes(l) && e.value.useCssAnimation, "animated-in": O.value && L.value === l && e.value.useCssAnimation })
            }, null, 10, Vt)) : c("", !0)
          ])
        ]))), 256)),
        e.value.style.chart.layout.plots.show ? (r(), n("g", Et, [
          (r(!0), n(T, null, P(C.value, (o, l) => (r(), n("g", null, [
            (r(!0), n(T, null, P(o.plots, (s, h) => (r(), n("circle", {
              cx: s.x,
              cy: s.y,
              fill: v.value.includes(h) ? "transparent" : y.value[h].color,
              r: D.value !== null && D.value === l ? e.value.style.chart.layout.plots.radius * 1.6 : e.value.style.chart.layout.plots.radius,
              stroke: v.value.includes(h) ? "transparent" : e.value.style.chart.backgroundColor,
              "stroke-width": 0.5,
              class: z({ "animated-out": v.value.includes(h) && e.value.useCssAnimation, "animated-in": O.value && L.value === h && e.value.useCssAnimation })
            }, null, 10, Bt))), 256))
          ]))), 256))
        ])) : c("", !0),
        f(t.$slots, "svg", { svg: u.value }, void 0, !0)
      ], 14, Pt)) : c("", !0),
      t.$slots.watermark ? (r(), n("div", Dt, [
        f(t.$slots, "watermark", M(R({ isPrinting: d(pe) || d(ge) })), void 0, !0)
      ])) : c("", !0),
      I.value ? c("", !0) : (r(), _(bt, {
        key: 6,
        config: {
          type: "radar",
          style: {
            backgroundColor: e.value.style.chart.backgroundColor,
            radar: {
              grid: {
                color: e.value.style.chart.layout.outerPolygon.stroke
              },
              shapes: {
                color: e.value.style.chart.layout.outerPolygon.stroke
              }
            }
          }
        }
      }, null, 8, ["config"])),
      $("div", {
        ref_key: "chartLegend",
        ref: le
      }, [
        e.value.style.chart.legend.show ? (r(), _(yt, {
          key: `legend_${ie.value}`,
          legendSet: F.value,
          config: Ge.value,
          onClickMarker: a[1] || (a[1] = ({ i: o }) => be(o))
        }, {
          item: m(({ legend: o, index: l }) => [
            $("div", {
              "data-cy-legend-item": "",
              onClick: (s) => o.segregate(),
              style: W(`opacity:${v.value.includes(l) ? 0.5 : 1}`)
            }, U(o.name) + ": " + U(d(V)({
              v: o.totalProportion * 100,
              s: "%",
              r: e.value.style.chart.legend.roundingPercentage
            })), 13, Gt)
          ]),
          _: 1
        }, 8, ["legendSet", "config"])) : f(t.$slots, "legend", {
          key: 1,
          legend: F.value
        }, void 0, !0)
      ], 512),
      t.$slots.source ? (r(), n("div", {
        key: 7,
        ref_key: "source",
        ref: re,
        dir: "auto"
      }, [
        f(t.$slots, "source", {}, void 0, !0)
      ], 512)) : c("", !0),
      ee(gt, {
        show: b.value.showTooltip && X.value,
        backgroundColor: e.value.style.chart.tooltip.backgroundColor,
        color: e.value.style.chart.tooltip.color,
        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,
        fontSize: e.value.style.chart.tooltip.fontSize,
        position: e.value.style.chart.tooltip.position,
        offsetY: e.value.style.chart.tooltip.offsetY,
        parent: A.value,
        content: j.value,
        isFullscreen: N.value,
        isCustom: e.value.style.chart.tooltip.customFormat && typeof e.value.style.chart.tooltip.customFormat == "function"
      }, {
        "tooltip-before": m(() => [
          f(t.$slots, "tooltip-before", M(R({ ...J.value })), void 0, !0)
        ]),
        "tooltip-after": m(() => [
          ["function"].includes(typeof e.value.style.chart.tooltip.customFormat) ? c("", !0) : (r(), n("div", Wt, [
            ee(ft, {
              dataset: Q.value,
              config: Ve.value,
              backgroundOpacity: 0
            }, null, 8, ["dataset", "config"])
          ])),
          f(t.$slots, "tooltip-after", M(R({ ...J.value })), void 0, !0)
        ]),
        _: 3
      }, 8, ["show", "backgroundColor", "color", "borderRadius", "borderColor", "borderWidth", "backgroundOpacity", "fontSize", "position", "offsetY", "parent", "content", "isFullscreen", "isCustom"]),
      I.value ? (r(), _(kt, {
        key: 8,
        hideDetails: "",
        config: {
          open: b.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: m(() => [
          (r(), _(mt, {
            key: `table_${ue.value}`,
            colNames: B.value.colNames,
            head: B.value.head,
            body: B.value.body,
            config: B.value.config,
            title: `${e.value.style.chart.title.text}${e.value.style.chart.title.subtitle.text ? ` : ${e.value.style.chart.title.subtitle.text}` : ""}`,
            onClose: a[2] || (a[2] = (o) => b.value.showTable = !1)
          }, {
            th: m(({ th: o }) => [
              Pe(U(o.name), 1)
            ]),
            td: m(({ td: o }) => [
              Pe(U(o), 1)
            ]),
            _: 1
          }, 8, ["colNames", "head", "body", "config", "title"]))
        ]),
        _: 1
      }, 8, ["config"])) : c("", !0)
    ], 46, Tt));
  }
}, ia = /* @__PURE__ */ $t(Xt, [["__scopeId", "data-v-905ab625"]]);
export {
  ia as default
};
