import { ref as I, computed as D, watch as Pe, onMounted as rt, onBeforeUnmount as st, openBlock as a, createElementBlock as l, normalizeClass as ne, normalizeStyle as O, createBlock as Te, unref as f, createSlots as vt, withCtx as ae, renderSlot as V, normalizeProps as J, guardReactiveProps as me, createCommentVNode as p, toDisplayString as E, createVNode as re, createElementVNode as _, Fragment as m, renderList as L, mergeProps as Ie, pushScopeId as dt, popScopeId as ct } from "vue";
import { u as ht, c as ft, t as gt, a as mt, p as U, b as pt, I as xt, e as yt, d as Ee, m as kt, C as He, X as bt, j as St, k as pe, n as Re, i as H, f as M, R as Xe, v as X, x as Ae, y as Ne } from "./index-DK7qqHGP.js";
import { t as wt, u as _t } from "./useResponsive-NZB-WLRF.js";
import Le from "./BaseIcon-ZChy8GeS.js";
import { _ as At } from "./Tooltip-Bt9pHzBM.js";
import { u as Lt, U as zt } from "./usePrinter-Cza87yNE.js";
import { S as $t } from "./Slicer-Bk9LTQad.js";
import Ct from "./vue-ui-skeleton-CQnYuosp.js";
import { u as Ze } from "./useNestedProp-0nRX_rTi.js";
import { _ as Pt } from "./PackageVersion-I1_4jcn_.js";
import { _ as Tt } from "./_plugin-vue_export-helper-CHgC5LLL.js";
const A = {
  LINE: "LINE",
  BAR: "BAR",
  DONUT: "DONUT"
}, It = ["SERIE", "SERIES", "DATA", "VALUE", "VALUES", "NUM"];
function Et({ dataset: s, barLineSwitch: $ = 6 }) {
  let g = null, R = null, q = 0;
  if ((typeof s == "number" || typeof s == "string") && console.warn(`The provided dataset (${s}) is not sufficient to build a chart`), xe(s) && (Z(s) && (s.length < $ ? g = A.BAR : g = A.LINE, R = s, q = s.length), ze(s))) {
    if (!Nt(s))
      return console.warn("The objects in the dataset array have a different data structure. Either keys or value types are different."), !1;
    const oe = Object.keys(s[0]), se = Object.values(s[0]);
    if (!oe.some((P) => Ot(P)))
      return console.warn("The data type of the dataset objects in the array must contain one of the following keys: DATA, SERIES, VALUE, VALUES, NUM. Casing is not important."), !1;
    Ye(se, (P) => typeof P == "number") && (g = A.DONUT, R = s), Ye(se, (P) => Array.isArray(P) && Z(P)) && (Je(s) > $ ? g = A.LINE : g = A.BAR, q = Je(s), R = s.map((P) => ({
      ...P,
      data: Ft(P, (G) => Z(G))
    }))), s = s.map((P) => Qe(P)), R = R.map((P) => Qe(P));
  }
  return xe(s) && [...new Set(s.flatMap((oe) => Array.isArray(oe)))][0], {
    dataset: s,
    type: g,
    usableDataset: R,
    maxSeriesLength: q
  };
}
function Ke(s) {
  return !s || xe(s) && !s.length;
}
function xe(s) {
  return Array.isArray(s);
}
function Z(s) {
  if (!xe(s) || Ke(s)) return !1;
  const $ = s.map((g) => Number(g));
  return ![...new Set($.flatMap((g) => typeof g == "number" && !isNaN(g)))].includes(!1);
}
function ze(s) {
  return !xe(s) || Ke(s) || !![...new Set(s.flatMap((g) => typeof g == "object" && !Array.isArray(g)))].includes(!1) ? !1 : !s.map((g) => Object.keys(g).length > 0).includes(!1);
}
function Rt(s, $) {
  const g = Object.keys(s).sort(), R = Object.keys($).sort();
  if (g.length !== R.length)
    return !1;
  for (let q = 0; q < g.length; q += 1) {
    const j = g[q], le = R[q];
    if (j !== le || typeof s[j] != typeof $[le])
      return !1;
  }
  return !0;
}
function Nt(s) {
  if (s.length <= 1) return !0;
  for (let $ = 0; $ < s.length; $ += 1)
    for (let g = $ + 1; g < s.length; g += 1)
      if (!Rt(s[$], s[g]))
        return !1;
  return !0;
}
function Ot(s) {
  return It.includes(s.toUpperCase());
}
function Ye(s, $) {
  let g = [];
  for (let R = 0; R < s.length; R += 1)
    g.push($(s[R]));
  return g.includes(!0);
}
function Je(s) {
  return Math.max(...[...s].flatMap(($) => Object.values($).filter((g) => Z(g)).map((g) => g.length)));
}
function Ft(s, $) {
  return Object.values(s).filter((g) => $(g))[0];
}
function Qe(s) {
  const $ = {};
  for (let g in s)
    s.hasOwnProperty(g) && ($[g.toUpperCase()] = s[g]);
  return $;
}
const et = (s) => (dt("data-v-85aefdcf"), s = s(), ct(), s), Mt = ["id"], Bt = ["xmlns", "viewBox"], Ut = ["id"], Dt = ["id"], Vt = /* @__PURE__ */ et(() => /* @__PURE__ */ _("feColorMatrix", {
  type: "saturate",
  values: "0"
}, null, -1)), qt = ["id"], Wt = ["flood-color"], jt = {
  key: 0,
  class: "donut-label-connectors"
}, Gt = ["d", "stroke", "stroke-width", "filter"], Ht = ["cx", "cy", "r", "fill"], Xt = ["cx", "cy", "r", "fill", "filter"], Zt = { class: "donut" }, Yt = ["d", "fill", "stroke", "stroke-width", "filter"], Jt = ["d", "onMouseenter", "onClick"], Qt = {
  key: 1,
  class: "donut-labels quick-animation"
}, Kt = ["cx", "cy", "fill", "filter"], ea = ["text-anchor", "x", "y", "fill", "font-size", "filter"], ta = ["text-anchor", "x", "y", "fill", "font-size", "filter"], aa = {
  key: 2,
  class: "donut-hollow quick-animation"
}, la = ["x", "y", "font-size", "fill"], oa = ["x", "y", "font-size", "fill"], ia = {
  key: 0,
  class: "line-grid"
}, ua = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], na = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], ra = {
  key: 1,
  class: "line-axis"
}, sa = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], va = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], da = {
  key: 2,
  class: "yLabels"
}, ca = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], ha = ["x", "y", "font-size", "fill"], fa = {
  key: 3,
  class: "periodLabels"
}, ga = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], ma = ["font-size", "text-anchor", "fill", "transform"], pa = { class: "plots" }, xa = { class: "line-plot-series" }, ya = ["d", "stroke", "stroke-width"], ka = ["d", "stroke", "stroke-width"], ba = ["d", "stroke", "stroke-width"], Sa = ["d", "stroke", "stroke-width"], wa = ["cx", "cy", "fill", "stroke"], _a = {
  key: 4,
  class: "dataLabels"
}, Aa = ["font-size", "fill", "x", "y"], La = { class: "tooltip-traps" }, za = ["x", "y", "height", "width", "fill", "onMouseenter", "onClick"], $a = {
  key: 0,
  class: "line-grid"
}, Ca = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], Pa = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], Ta = {
  key: 1,
  class: "line-axis"
}, Ia = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], Ea = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], Ra = {
  key: 2,
  class: "yLabels"
}, Na = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], Oa = ["x", "y", "font-size", "fill"], Fa = {
  key: 3,
  class: "periodLabels"
}, Ma = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], Ba = ["font-size", "text-anchor", "transform", "fill"], Ua = { class: "plots" }, Da = ["x", "width", "height", "y", "fill", "stroke", "stroke-width"], Va = ["to"], qa = ["from", "to"], Wa = {
  key: 4,
  class: "dataLabels"
}, ja = ["x", "y", "font-size", "fill"], Ga = { class: "tooltip-traps" }, Ha = ["x", "y", "height", "width", "fill", "onMouseenter", "onClick"], Xa = {
  key: 3,
  class: "axis-labels"
}, Za = { key: 0 }, Ya = ["font-size", "fill", "x", "y"], Ja = { key: 1 }, Qa = ["font-size", "fill", "x", "y"], Ka = { key: 2 }, el = ["font-size", "fill", "transform"], tl = { key: 3 }, al = ["font-size", "fill", "transform"], ll = {
  key: 4,
  class: "vue-data-ui-watermark"
}, ol = ["onClick"], il = ["onClick"], ul = ["onClick"], nl = {
  key: 1,
  class: "vue-ui-quick-chart-not-processable"
}, rl = /* @__PURE__ */ et(() => /* @__PURE__ */ _("span", null, "Dataset is not processable", -1)), sl = {
  __name: "vue-ui-quick-chart",
  props: {
    config: {
      type: Object,
      default() {
        return {};
      }
    },
    dataset: {
      type: [Array, Object, String, Number],
      default() {
        return null;
      }
    }
  },
  emits: ["selectDatapoint", "selectLegend"],
  setup(s, { expose: $, emit: g }) {
    const R = s, { vue_ui_quick_chart: q } = ht(), j = I(null), le = I(null), oe = I(null), se = I(null), P = I(ft()), G = I(!1), ve = I(null), Q = I(""), W = I(null), w = I([]), Oe = I(0), ye = I(0), e = D({
      get: () => Fe(),
      set: (u) => u
    });
    function Fe() {
      const u = Ze({
        userConfig: R.config,
        defaultConfig: q
      });
      return u.theme ? {
        ...Ze({
          userConfig: gt.vue_ui_quick_chart[u.theme] || R.config,
          defaultConfig: u
        }),
        customPalette: mt[u.theme] || U
      } : u;
    }
    Pe(() => R.config, (u) => {
      e.value = Fe(), y.value.width = e.value.width, y.value.height = e.value.height, Ue();
    }, { deep: !0 }), Pe(() => R.dataset, (u) => {
      k.value = ce.value, b.value.start = 0, b.value.end = k.value.maxSeriesLength, ye.value += 1;
    }, { deep: !0 });
    const de = D(() => pt(e.value.customPalette)), ce = D(() => {
      const u = Et({ dataset: xt(R.dataset, [
        "serie",
        "series",
        "data",
        "value",
        "values",
        "num"
      ]), barLineSwitch: e.value.chartIsBarUnderDatasetLength });
      return u || console.error("VueUiQuickChart : Dataset is not processable"), u;
    }), k = I(ce.value), tt = D(() => !!k.value), z = D(() => k.value ? k.value.type : null);
    Pe(() => z.value, (u) => {
      u || yt({
        componentName: "VueUiQuickChart",
        type: "dataset"
      });
    }, { immediate: !0 });
    const { isPrinting: ke, isImaging: be, generatePdf: Me, generateImage: Be } = Lt({
      elementId: `${z.value}_${P.value}`,
      fileName: e.value.title || z.value
    }), y = I({
      width: e.value.width,
      height: e.value.height
    }), Se = I({
      showTooltip: e.value.showTooltip
    }), we = I(null);
    rt(() => {
      Ue();
    });
    function Ue() {
      if (e.value.responsive) {
        const u = wt(() => {
          const { width: c, height: t } = _t({
            chart: j.value,
            title: e.value.title ? le.value : null,
            legend: e.value.showLegend ? oe.value : null,
            slicer: [A.BAR, A.LINE].includes(z.value) && e.value.zoomXy && k.value.maxSeriesLength > 1 ? se.value : null
          });
          y.value.width = c, y.value.height = t;
        });
        we.value = new ResizeObserver(u), we.value.observe(j.value.parentNode);
      }
    }
    st(() => {
      we.value && we.value.disconnect();
    });
    const at = D(() => {
      switch (z.value) {
        case A.LINE:
          return `0 0 ${y.value.width <= 0 ? 10 : y.value.width} ${y.value.height <= 0 ? 10 : y.value.height}`;
        case A.BAR:
          return `0 0 ${y.value.width <= 0 ? 10 : y.value.width} ${y.value.height <= 0 ? 10 : y.value.height}`;
        case A.DONUT:
          return `0 0 ${y.value.width <= 0 ? 10 : y.value.width} ${y.value.height <= 0 ? 10 : y.value.height}`;
        default:
          return `0 0 ${y.value.width <= 0 ? 10 : y.value.width} ${y.value.height <= 0 ? 10 : y.value.height}`;
      }
    });
    function De(u) {
      return [...u].map((c) => c.value).reduce((c, t) => c + t, 0);
    }
    function he(u) {
      return e.value.blurOnHover && ![null, void 0].includes(W.value) && W.value !== u ? `url(#blur_${P.value})` : "";
    }
    function Ve(u, c) {
      w.value.includes(u) ? w.value = w.value.filter((t) => t !== u) : w.value.length < c && w.value.push(u);
    }
    const qe = I(null), We = I(null), _e = I(!1);
    function lt(u, c) {
      _e.value = !0;
      let t = u.value;
      if (w.value.includes(u.id)) {
        let r = function() {
          t > n ? (_e.value = !1, cancelAnimationFrame(We.value), k.value = {
            ...k.value,
            dataset: k.value.dataset.map((h, N) => u.id === `donut_${N}` ? {
              ...h,
              value: n,
              VALUE: n
            } : h)
          }) : (t += n * 0.025, k.value = {
            ...k.value,
            dataset: k.value.dataset.map((h, N) => u.id === `donut_${N}` ? {
              ...h,
              value: t,
              VALUE: t
            } : h)
          }, We.value = requestAnimationFrame(r));
        };
        w.value = w.value.filter((h) => h !== u.id);
        const n = ce.value.dataset.find((h, N) => u.id === `donut_${N}`).VALUE;
        r();
      } else if (c.length > 1) {
        let n = function() {
          t < 0.1 ? (_e.value = !1, cancelAnimationFrame(qe.value), w.value.push(u.id), k.value = {
            ...k.value,
            dataset: k.value.dataset.map((r, h) => u.id === `donut_${h}` ? {
              ...r,
              value: 0,
              VALUE: 0
            } : r)
          }) : (t /= 1.1, k.value = {
            ...k.value,
            dataset: k.value.dataset.map((r, h) => u.id === `donut_${h}` ? {
              ...r,
              value: t,
              VALUE: t
            } : r)
          }, qe.value = requestAnimationFrame(n));
        };
        n();
      }
    }
    const Y = I(null);
    function ot(u) {
      Y.value = u;
    }
    const je = D(() => e.value.donutThicknessRatio < 0.15 ? 0.15 : e.value.donutThicknessRatio > 0.4 ? 0.4 : e.value.donutThicknessRatio), C = D(() => {
      if (z.value !== A.DONUT) return null;
      const u = k.value.dataset.map((o, i) => ({
        ...o,
        value: o.VALUE || o.DATA || o.SERIE || o.VALUES || o.NUM || 0,
        name: o.NAME || o.DESCRIPTION || o.TITLE || o.LABEL || `Serie ${i}`,
        id: `donut_${i}`
      })).map((o, i) => ({
        ...o,
        color: o.COLOR ? Ee(o.COLOR) : de.value[i + e.value.paletteStartIndex] || U[i + e.value.paletteStartIndex] || U[(i + e.value.paletteStartIndex) % U.length],
        immutableValue: o.value
      }));
      function c(o, i) {
        return M({
          v: isNaN(o.value / De(i)) ? 0 : o.value / De(i) * 100,
          s: "%",
          r: e.value.dataLabelRoundingPercentage
        });
      }
      function t(o) {
        return o.proportion * 100 > e.value.donutHideLabelUnderPercentage;
      }
      function n(o, i) {
        const S = ce.value.dataset.find((T, F) => `donut_${F}` === o).VALUE;
        return Math.abs(String(Number(S.toFixed(0))).length - String(Number(i.toFixed(0))).length);
      }
      function r({ datapoint: o, seriesIndex: i }) {
        ve.value = { datapoint: o, seriesIndex: i, config: e.value, dataset: u }, W.value = o.id;
        const S = e.value.tooltipCustomFormat;
        if (Ae(S) && Ne(() => S({
          datapoint: o,
          seriesIndex: i,
          series: u,
          config: e.value
        })))
          Q.value = S({
            datapoint: o,
            seriesIndex: i,
            series: u,
            config: e.value
          });
        else {
          let x = "";
          x += `<div style="width:100%;text-align:center;border-bottom:1px solid ${e.value.tooltipBorderColor};padding-bottom:6px;margin-bottom:3px;">${o.name}</div>`, x += `<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="${o.color}"/></svg>`, x += `<b>${H(
            e.value.formatter,
            o.value,
            M({
              p: e.value.valuePrefix,
              v: o.value,
              s: e.value.valueSuffix,
              r: e.value.dataLabelRoundingValue
            }),
            { datapoint: o, seriesIndex: i }
          )}</b>`, x += `<span>(${M({ v: o.proportion * 100, s: "%", r: e.value.dataLabelRoundingPercentage })})</span></div>`, Q.value = `<div>${x}</div>`;
        }
        G.value = !0;
      }
      function h() {
        G.value = !1, W.value = null, Y.value = null;
      }
      const N = {
        centerX: y.value.width / 2,
        centerY: y.value.height / 2
      }, B = u.filter((o) => !w.value.includes(o.id)).map((o) => o.value || 0).reduce((o, i) => o + i, 0), ie = u.map((o, i) => ({
        ...o,
        proportion: (o.value || 0) / B,
        value: o.value || 0,
        absoluteValue: ce.value.dataset.find((S, x) => `donut_${x}` === o.id).VALUE
      })), K = y.value.width / 2, ue = y.value.height / 2, ee = y.value.height * e.value.donutRadiusRatio;
      return {
        dataset: ie.filter((o) => !w.value.includes(o.id)),
        legend: ie,
        drawingArea: N,
        displayArcPercentage: c,
        isArcBigEnough: t,
        useTooltip: r,
        killTooltip: h,
        getSpaces: n,
        total: B,
        cx: K,
        cy: ue,
        radius: ee,
        chart: kt(
          { series: u.filter((o) => !w.value.includes(o.id)) },
          K,
          ue,
          ee,
          ee,
          1.99999,
          2,
          1,
          360,
          105.25,
          y.value.height * je.value
        )
      };
    }), b = I({
      start: 0,
      end: k.value.maxSeriesLength
    });
    function it() {
      b.value = {
        start: 0,
        end: k.value.maxSeriesLength
      }, ye.value += 1;
    }
    const ut = D(() => {
      if (!e.value.zoomMinimap.show || z.value === A.DONUT) return [];
      let u = [];
      Z(k.value.dataset) && (u = k.value.dataset), ze(k.value.dataset) && (u = k.value.dataset.map((r, h) => ({
        values: r.VALUE || r.DATA || r.SERIE || r.SERIES || r.VALUES || r.NUM || 0,
        id: z.value === A.LINE ? `line_${h}` : `bar_${h}`
      })).filter((r) => !w.value.includes(r.id)));
      const c = Z(u) ? u.length : Math.max(...u.map((r) => r.values.length));
      let t = [];
      if (Z(u))
        t = u;
      else
        for (let r = 0; r < c; r += 1)
          t.push(u.map((h) => h.values[r] || 0).reduce((h, N) => (h || 0) + (N || 0), 0));
      const n = Math.min(...t);
      return t.map((r) => r + (n < 0 ? Math.abs(n) : 0));
    }), d = D(() => {
      if (z.value !== A.LINE) return null;
      const u = {
        height: y.value.height,
        width: y.value.width
      }, c = {
        left: e.value.xyPaddingLeft,
        top: e.value.xyPaddingTop,
        right: u.width - e.value.xyPaddingRight,
        bottom: u.height - e.value.xyPaddingBottom,
        width: u.width - e.value.xyPaddingLeft - e.value.xyPaddingRight,
        height: u.height - e.value.xyPaddingTop - e.value.xyPaddingBottom
      };
      let t = [];
      Z(k.value.dataset) && (t = [
        {
          values: k.value.dataset.slice(b.value.start, b.value.end),
          absoluteIndices: k.value.dataset.map((o, i) => i).slice(b.value.start, b.value.end),
          name: e.value.title,
          color: de.value[e.value.paletteStartIndex] || U[e.value.paletteStartIndex],
          id: "line_0"
        }
      ]), ze(k.value.dataset) && (t = k.value.dataset.map((o, i) => ({
        ...o,
        values: o.VALUE || o.DATA || o.SERIE || o.SERIES || o.VALUES || o.NUM || 0,
        name: o.NAME || o.DESCRIPTION || o.TITLE || o.LABEL || `Serie ${i}`,
        id: `line_${i}`
      })).map((o, i) => ({
        ...o,
        color: o.COLOR ? Ee(o.COLOR) : de.value[i + e.value.paletteStartIndex] || U[i + e.value.paletteStartIndex] || U[(i + e.value.paletteStartIndex) % U.length],
        values: o.values.slice(b.value.start, b.value.end),
        absoluteIndices: o.values.map((S, x) => x).slice(b.value.start, b.value.end)
      })));
      const n = {
        max: Math.max(...t.filter((o) => !w.value.includes(o.id)).flatMap((o) => o.values)),
        min: Math.min(...t.filter((o) => !w.value.includes(o.id)).flatMap((o) => o.values)),
        maxSeries: Math.max(...t.map((o) => o.values.length))
      }, r = He(n.min < 0 ? n.min : 0, n.max < 0 ? 0 : n.max, e.value.xyScaleSegments), h = n.min < 0 ? Math.abs(n.min) : 0, N = n.max < 0 ? c.top : c.bottom - h / (r.max + h) * c.height, B = c.width / n.maxSeries, ie = r.ticks.map((o) => ({
        y: c.bottom - c.height * ((o + h) / (r.max + h)),
        x: c.left - 8,
        value: o
      })), K = t.map((o, i) => ({
        ...o,
        coordinates: o.values.map((S, x) => ({
          x: c.left + B * (x + 1) - B / 2,
          y: c.bottom - (S + h) / (r.max + h) * c.height,
          value: S
        }))
      })).map((o) => {
        let i = [];
        return o.coordinates.forEach((S) => {
          i.push(`${S.x},${S.y} `);
        }), {
          ...o,
          linePath: i.join(" ")
        };
      });
      function ue(o) {
        W.value = o, Y.value = o;
        const i = t.map((x) => ({
          ...x,
          value: x.values[o],
          absoluteIndex: x.absoluteIndices[o]
        })).filter((x) => !w.value.includes(x.id));
        ve.value = { datapoint: i, seriesIndex: o, config: e.value, dataset: t };
        const S = e.value.tooltipCustomFormat;
        if (Ae(S) && Ne(() => S({
          datapoint: i,
          seriesIndex: o,
          series: t,
          config: e.value
        })))
          Q.value = S({
            datapoint: i,
            seriesIndex: o,
            series: t,
            config: e.value
          });
        else {
          let x = "";
          e.value.xyPeriods[i[0].absoluteIndex] && (x += `<div style="border-bottom:1px solid ${e.value.tooltipBorderColor};padding-bottom:6px;margin-bottom:3px;">${e.value.xyPeriods[i[0].absoluteIndex]}</div>`), i.forEach((T, F) => {
            x += `
                    <div style="display:flex; flex-wrap: wrap; align-items:center; gap:3px;">
                        <svg viewBox="0 0 12 12" height="14" width="12"><circle cx="6" cy="6" r="6" stroke="none" fill="${T.color}"/></svg>
                        <span>${T.name}:</span>
                        <b>${H(
              e.value.formatter,
              T.value,
              M({
                p: e.value.valuePrefix,
                v: T.value,
                s: e.value.valueSuffix,
                r: e.value.dataLabelRoundingValue
              }),
              { datapoint: T, seriesIndex: F }
            )}
                        </b>
                    </div>
                `;
          }), Q.value = x;
        }
        G.value = !0;
      }
      function ee() {
        W.value = null, G.value = !1;
      }
      return {
        absoluteZero: N,
        dataset: K.filter((o) => !w.value.includes(o.id)),
        legend: K,
        drawingArea: c,
        extremes: n,
        slotSize: B,
        yLabels: ie,
        useTooltip: ue,
        killTooltip: ee
      };
    }), v = D(() => {
      if (z.value !== A.BAR) return null;
      const u = {
        height: y.value.height,
        width: y.value.width
      }, c = {
        left: e.value.xyPaddingLeft,
        top: e.value.xyPaddingTop,
        right: u.width - e.value.xyPaddingRight,
        bottom: u.height - e.value.xyPaddingBottom,
        width: u.width - e.value.xyPaddingLeft - e.value.xyPaddingRight,
        height: u.height - e.value.xyPaddingTop - e.value.xyPaddingBottom
      };
      let t = [];
      Z(k.value.dataset) && (t = [
        {
          values: k.value.dataset.slice(b.value.start, b.value.end),
          absoluteIndices: k.value.dataset.map((i, S) => S).slice(b.value.start, b.value.end),
          name: e.value.title,
          color: de.value[e.value.paletteStartIndex] || U[e.value.paletteStartIndex],
          id: "bar_0"
        }
      ]), ze(k.value.dataset) && (t = k.value.dataset.map((i, S) => ({
        ...i,
        values: i.VALUE || i.DATA || i.SERIE || i.SERIES || i.VALUES || i.NUM || 0,
        name: i.NAME || i.DESCRIPTION || i.TITLE || i.LABEL || `Serie ${S}`,
        id: `bar_${S}`
      })).map((i, S) => ({
        ...i,
        color: i.COLOR ? Ee(i.COLOR) : de.value[S + e.value.paletteStartIndex] || U[S + e.value.paletteStartIndex] || U[(S + e.value.paletteStartIndex) % U.length],
        values: i.values.slice(b.value.start, b.value.end),
        absoluteIndices: i.values.map((x, T) => T).slice(b.value.start, b.value.end)
      })));
      const n = {
        max: Math.max(...t.filter((i) => !w.value.includes(i.id)).flatMap((i) => i.values)) < 0 ? 0 : Math.max(...t.filter((i) => !w.value.includes(i.id)).flatMap((i) => i.values)),
        min: Math.min(...t.filter((i) => !w.value.includes(i.id)).flatMap((i) => i.values)),
        maxSeries: Math.max(...t.filter((i) => !w.value.includes(i.id)).map((i) => i.values.length))
      }, r = He(n.min < 0 ? n.min : 0, n.max, e.value.xyScaleSegments), h = r.min < 0 ? Math.abs(r.min) : 0, N = c.bottom - h / (r.max + h) * c.height, B = c.width / n.maxSeries, ie = r.ticks.map((i) => ({
        y: c.bottom - c.height * ((i + h) / (r.max + h)),
        x: c.left - 8,
        value: i
      })), K = t.map((i, S) => ({
        ...i,
        coordinates: i.values.map((x, T) => {
          const F = (x + h) / (n.max + h) * c.height, fe = Math.abs(x) / Math.abs(n.min) * (c.height - N), Ce = h / (n.max + h) * c.height, ge = B / t.filter((te) => !w.value.includes(te.id)).length - e.value.barGap / t.filter((te) => !w.value.includes(te.id)).length;
          return {
            x: c.left + B * T + ge * S + e.value.barGap / 2,
            y: x > 0 ? c.bottom - F : N,
            height: x > 0 ? F - Ce : fe,
            value: x,
            width: ge
          };
        })
      })), ue = t.filter((i) => !w.value.includes(i.id)).map((i, S) => ({
        ...i,
        coordinates: i.values.map((x, T) => {
          const F = (x + h) / (n.max + h) * c.height, fe = Math.abs(x) / (n.max + h) * c.height, Ce = h / (n.max + h) * c.height, ge = B / t.filter((te) => !w.value.includes(te.id)).length - e.value.barGap / t.filter((te) => !w.value.includes(te.id)).length;
          return {
            x: c.left + B * T + ge * S + e.value.barGap / 2,
            y: x > 0 ? c.bottom - F : N,
            height: x > 0 ? F - Ce : fe,
            value: x,
            width: ge
          };
        })
      }));
      function ee(i) {
        W.value = i, Y.value = i;
        const S = t.map((T) => ({
          ...T,
          value: T.values[i],
          absoluteIndex: T.absoluteIndices[i]
        })).filter((T) => !w.value.includes(T.id));
        ve.value = { datapoint: S, seriesIndex: i, config: e.value, dataset: t };
        const x = e.value.tooltipCustomFormat;
        if (Ae(x) && Ne(() => x({
          datapoint: S,
          seriesIndex: i,
          series: t,
          config: e.value
        })))
          Q.value = x({
            point: S,
            seriesIndex: i,
            series: t,
            config: e.value
          });
        else {
          let T = "";
          e.value.xyPeriods[S[0].absoluteIndex] && (T += `<div style="border-bottom:1px solid ${e.value.tooltipBorderColor};padding-bottom:6px;margin-bottom:3px;">${e.value.xyPeriods[S[0].absoluteIndex]}</div>`), S.forEach((F, fe) => {
            T += `
                    <div style="display:flex; flex-wrap: wrap; align-items:center; gap:3px;">
                        <svg viewBox="0 0 12 12" height="14" width="12"><rect x=0 y="0" width="12" height="12" rx="1" stroke="none" fill="${F.color}"/></svg>
                        <span>${F.name}:</span>
                        <b>${H(
              e.value.formatter,
              F.value,
              M({
                p: e.value.valuePrefix,
                v: F.value,
                s: e.value.valueSuffix,
                r: e.value.dataLabelRoundingValue
              }),
              { datapoint: F, seriesIndex: fe }
            )}
                        </b>
                    </div>
                `;
          }), Q.value = T;
        }
        G.value = !0;
      }
      function o() {
        G.value = !1, W.value = null, Y.value = null;
      }
      return {
        absoluteZero: N,
        dataset: ue.filter((i) => !w.value.includes(i.id)),
        legend: K,
        drawingArea: c,
        extremes: n,
        slotSize: B,
        yLabels: ie,
        useTooltip: ee,
        killTooltip: o
      };
    }), $e = I(!1);
    function nt(u) {
      $e.value = u, Oe.value += 1;
    }
    function Ge() {
      Se.value.showTooltip = !Se.value.showTooltip;
    }
    return $({
      generatePdf: Me,
      generateImage: Be,
      toggleTooltip: Ge
    }), (u, c) => tt.value ? (a(), l("div", {
      key: 0,
      id: `${z.value}_${P.value}`,
      ref_key: "quickChart",
      ref: j,
      class: ne({ "vue-ui-quick-chart": !0, "vue-data-ui-wrapper-fullscreen": $e.value }),
      style: O(`background:${e.value.backgroundColor};color:${e.value.color};font-family:${e.value.fontFamily}; position: relative; ${e.value.responsive ? "height: 100%" : ""}`)
    }, [
      e.value.showUserOptions ? (a(), Te(zt, {
        ref: "details",
        key: `user_option_${Oe.value}`,
        backgroundColor: e.value.backgroundColor,
        color: e.value.color,
        isPrinting: f(ke),
        isImaging: f(be),
        uid: P.value,
        hasTooltip: e.value.userOptionsButtons.tooltip && e.value.showTooltip,
        hasPdf: e.value.userOptionsButtons.pdf,
        hasImg: e.value.userOptionsButtons.img,
        hasFullscreen: e.value.userOptionsButtons.fullscreen,
        hasXls: !1,
        isTooltip: Se.value.showTooltip,
        isFullscreen: $e.value,
        titles: { ...e.value.userOptionsButtonTitles },
        chartElement: j.value,
        position: e.value.userOptionsPosition,
        onToggleFullscreen: nt,
        onGeneratePdf: f(Me),
        onGenerateImage: f(Be),
        onToggleTooltip: Ge
      }, vt({ _: 2 }, [
        u.$slots.optionTooltip ? {
          name: "optionTooltip",
          fn: ae(() => [
            V(u.$slots, "optionTooltip", {}, void 0, !0)
          ]),
          key: "0"
        } : void 0,
        u.$slots.optionPdf ? {
          name: "optionPdf",
          fn: ae(() => [
            V(u.$slots, "optionPdf", {}, void 0, !0)
          ]),
          key: "1"
        } : void 0,
        u.$slots.optionImg ? {
          name: "optionImg",
          fn: ae(() => [
            V(u.$slots, "optionImg", {}, void 0, !0)
          ]),
          key: "2"
        } : void 0,
        u.$slots.optionFullscreen ? {
          name: "optionFullscreen",
          fn: ae(({ toggleFullscreen: t, isFullscreen: n }) => [
            V(u.$slots, "optionFullscreen", J(me({ toggleFullscreen: t, isFullscreen: n })), void 0, !0)
          ]),
          key: "3"
        } : void 0
      ]), 1032, ["backgroundColor", "color", "isPrinting", "isImaging", "uid", "hasTooltip", "hasPdf", "hasImg", "hasFullscreen", "isTooltip", "isFullscreen", "titles", "chartElement", "position", "onGeneratePdf", "onGenerateImage"])) : p("", !0),
      e.value.title ? (a(), l("div", {
        key: 1,
        ref_key: "quickChartTitle",
        ref: le,
        class: "vue-ui-quick-chart-title",
        style: O(`background:transparent;color:${e.value.color};font-size:${e.value.titleFontSize}px;font-weight:${e.value.titleBold ? "bold" : "normal"};text-align:${e.value.titleTextAlign}`)
      }, E(e.value.title), 5)) : p("", !0),
      z.value ? (a(), l("svg", {
        key: 2,
        xmlns: f(bt),
        viewBox: at.value,
        style: O(`max-width:100%;overflow:visible;background:transparent;color:${e.value.color}`)
      }, [
        re(Pt),
        _("defs", null, [
          _("filter", {
            id: `blur_${P.value}`,
            x: "-50%",
            y: "-50%",
            width: "200%",
            height: "200%"
          }, [
            _("feGaussianBlur", {
              in: "SourceGraphic",
              stdDeviation: 2,
              id: `blur_std_${P.value}`
            }, null, 8, Dt),
            Vt
          ], 8, Ut),
          _("filter", {
            id: `shadow_${P.value}`,
            "color-interpolation-filters": "sRGB"
          }, [
            _("feDropShadow", {
              dx: "0",
              dy: "0",
              stdDeviation: "10",
              "flood-opacity": "0.5",
              "flood-color": e.value.donutShadowColor
            }, null, 8, Wt)
          ], 8, qt)
        ]),
        z.value === A.DONUT ? (a(), l(m, { key: 0 }, [
          e.value.showDataLabels ? (a(), l("g", jt, [
            (a(!0), l(m, null, L(C.value.chart, (t, n) => (a(), l(m, null, [
              C.value.isArcBigEnough(t) ? (a(), l("path", {
                key: 0,
                d: f(St)(t, { x: y.value.width / 2, y: y.value.height / 2 }, 16, 16, !1, !1, y.value.height * je.value),
                stroke: t.color,
                "stroke-width": e.value.donutLabelMarkerStrokeWidth,
                "stroke-linecap": "round",
                "stroke-linejoin": "round",
                fill: "none",
                filter: he(t.id)
              }, null, 8, Gt)) : p("", !0)
            ], 64))), 256))
          ])) : p("", !0),
          _("circle", {
            class: "donut-hollow",
            cx: (e.value.width || y.value.width) / 2,
            cy: (e.value.height || y.value.height) / 2,
            r: (e.value.height || y.value.height) * e.value.donutRadiusRatio,
            fill: e.value.backgroundColor
          }, null, 8, Ht),
          _("circle", {
            cx: C.value.cx,
            cy: C.value.cy,
            r: C.value.radius,
            fill: e.value.backgroundColor,
            filter: e.value.donutUseShadow ? `url(#shadow_${P.value})` : ""
          }, null, 8, Xt),
          _("g", Zt, [
            (a(!0), l(m, null, L(C.value.chart, (t, n) => (a(), l("path", {
              d: t.arcSlice,
              fill: t.color,
              stroke: e.value.backgroundColor,
              "stroke-width": e.value.donutStrokeWidth,
              filter: he(t.id)
            }, null, 8, Yt))), 256)),
            (a(!0), l(m, null, L(C.value.chart, (t, n) => (a(), l("path", {
              d: t.arcSlice,
              fill: "transparent",
              onMouseenter: (r) => C.value.useTooltip({ datapoint: t, seriesIndex: n }),
              onMouseout: c[0] || (c[0] = (r) => C.value.killTooltip()),
              onClick: (r) => g("selectDatapoint", t)
            }, null, 40, Jt))), 256))
          ]),
          e.value.showDataLabels ? (a(), l("g", Qt, [
            (a(!0), l(m, null, L(C.value.chart, (t, n) => (a(), l(m, null, [
              C.value.isArcBigEnough(t) ? (a(), l("circle", {
                key: 0,
                cx: f(pe)(t).x,
                cy: f(Re)(t) - 3.7,
                fill: t.color,
                r: 3,
                filter: he(t.id)
              }, null, 8, Kt)) : p("", !0),
              C.value.isArcBigEnough(t) ? (a(), l("text", {
                key: 1,
                "text-anchor": f(pe)(t, !0, 20).anchor,
                x: f(pe)(t, !0).x,
                y: f(Re)(t),
                fill: e.value.color,
                "font-size": e.value.dataLabelFontSize,
                filter: he(t.id)
              }, E(C.value.displayArcPercentage(t, C.value.chart)) + " (" + E(f(H)(
                e.value.formatter,
                t.value,
                f(M)({
                  p: e.value.valuePrefix,
                  v: t.value,
                  s: e.value.valueSuffix,
                  r: e.value.dataLabelRoundingValue
                }),
                { datapoint: t, seriesIndex: n }
              )) + ") ", 9, ea)) : p("", !0),
              C.value.isArcBigEnough(t, !0, 20) ? (a(), l("text", {
                key: 2,
                "text-anchor": f(pe)(t).anchor,
                x: f(pe)(t, !0).x,
                y: f(Re)(t) + e.value.dataLabelFontSize,
                fill: e.value.color,
                "font-size": e.value.dataLabelFontSize,
                filter: he(t.id)
              }, E(t.name), 9, ta)) : p("", !0)
            ], 64))), 256))
          ])) : p("", !0),
          e.value.donutShowTotal ? (a(), l("g", aa, [
            _("text", {
              "text-anchor": "middle",
              x: C.value.drawingArea.centerX,
              y: C.value.drawingArea.centerY - e.value.donutTotalLabelFontSize / 2,
              "font-size": e.value.donutTotalLabelFontSize,
              fill: e.value.color
            }, E(e.value.donutTotalLabelText), 9, la),
            _("text", {
              "text-anchor": "middle",
              x: C.value.drawingArea.centerX,
              y: C.value.drawingArea.centerY + e.value.donutTotalLabelFontSize,
              "font-size": e.value.donutTotalLabelFontSize,
              fill: e.value.color
            }, E(f(M)({
              p: e.value.valuePrefix,
              v: C.value.total,
              s: e.value.valueSuffix,
              r: e.value.dataLabelRoundingValue
            })), 9, oa)
          ])) : p("", !0)
        ], 64)) : p("", !0),
        z.value === A.LINE ? (a(), l(m, { key: 1 }, [
          e.value.xyShowGrid ? (a(), l("g", ia, [
            (a(!0), l(m, null, L(d.value.yLabels, (t) => (a(), l(m, null, [
              t.y <= d.value.drawingArea.bottom ? (a(), l("line", {
                key: 0,
                x1: d.value.drawingArea.left,
                x2: d.value.drawingArea.right,
                y1: t.y,
                y2: t.y,
                stroke: e.value.xyGridStroke,
                "stroke-width": e.value.xyGridStrokeWidth,
                "stroke-linecap": "round"
              }, null, 8, ua)) : p("", !0)
            ], 64))), 256)),
            (a(!0), l(m, null, L(d.value.extremes.maxSeries + 1, (t, n) => (a(), l("line", {
              x1: d.value.drawingArea.left + d.value.slotSize * n,
              x2: d.value.drawingArea.left + d.value.slotSize * n,
              y1: d.value.drawingArea.top,
              y2: d.value.drawingArea.bottom,
              stroke: e.value.xyGridStroke,
              "stroke-width": e.value.xyGridStrokeWidth,
              "stroke-linecap": "round"
            }, null, 8, na))), 256))
          ])) : p("", !0),
          e.value.xyShowAxis ? (a(), l("g", ra, [
            _("line", {
              x1: d.value.drawingArea.left,
              x2: d.value.drawingArea.left,
              y1: d.value.drawingArea.top,
              y2: d.value.drawingArea.bottom,
              stroke: e.value.xyAxisStroke,
              "stroke-width": e.value.xyAxisStrokeWidth,
              "stroke-linecap": "round"
            }, null, 8, sa),
            _("line", {
              x1: d.value.drawingArea.left,
              x2: d.value.drawingArea.right,
              y1: isNaN(d.value.absoluteZero) ? d.value.drawingArea.bottom : d.value.absoluteZero,
              y2: isNaN(d.value.absoluteZero) ? d.value.drawingArea.bottom : d.value.absoluteZero,
              stroke: e.value.xyAxisStroke,
              "stroke-width": e.value.xyAxisStrokeWidth,
              "stroke-linecap": "round"
            }, null, 8, va)
          ])) : p("", !0),
          e.value.xyShowScale ? (a(), l("g", da, [
            (a(!0), l(m, null, L(d.value.yLabels, (t, n) => (a(), l(m, null, [
              t.y <= d.value.drawingArea.bottom ? (a(), l("line", {
                key: 0,
                x1: t.x + 4,
                x2: d.value.drawingArea.left,
                y1: t.y,
                y2: t.y,
                stroke: e.value.xyAxisStroke,
                "stroke-width": e.value.xyAxisStrokeWidth,
                "stroke-linecap": "round"
              }, null, 8, ca)) : p("", !0),
              t.y <= d.value.drawingArea.bottom ? (a(), l("text", {
                key: 1,
                x: t.x,
                y: t.y + e.value.xyLabelsYFontSize / 3,
                "text-anchor": "end",
                "font-size": e.value.xyLabelsYFontSize,
                fill: e.value.color
              }, E(f(H)(
                e.value.formatter,
                t.value,
                f(M)({
                  p: e.value.valuePrefix,
                  v: t.value,
                  s: e.value.valueSuffix,
                  r: e.value.dataLabelRoundingValue
                }),
                { datapoint: t, seriesIndex: n }
              )), 9, ha)) : p("", !0)
            ], 64))), 256))
          ])) : p("", !0),
          e.value.xyShowScale && e.value.xyPeriods.length ? (a(), l("g", fa, [
            (a(!0), l(m, null, L(e.value.xyPeriods.slice(b.value.start, b.value.end), (t, n) => (a(), l("line", {
              x1: d.value.drawingArea.left + d.value.slotSize * (n + 1) - d.value.slotSize / 2,
              x2: d.value.drawingArea.left + d.value.slotSize * (n + 1) - d.value.slotSize / 2,
              y1: d.value.drawingArea.bottom,
              y2: d.value.drawingArea.bottom + 4,
              stroke: e.value.xyAxisStroke,
              "stroke-width": e.value.xyAxisStrokeWidth,
              "stroke-linecap": "round"
            }, null, 8, ga))), 256)),
            (a(!0), l(m, null, L(e.value.xyPeriods.slice(b.value.start, b.value.end), (t, n) => (a(), l("text", {
              "font-size": e.value.xyLabelsXFontSize,
              "text-anchor": e.value.xyPeriodLabelsRotation > 0 ? "start" : e.value.xyPeriodLabelsRotation < 0 ? "end" : "middle",
              fill: e.value.color,
              transform: `translate(${d.value.drawingArea.left + d.value.slotSize * (n + 1) - d.value.slotSize / 2}, ${d.value.drawingArea.bottom + e.value.xyLabelsXFontSize + 6}), rotate(${e.value.xyPeriodLabelsRotation})`
            }, E(t), 9, ma))), 256))
          ])) : p("", !0),
          _("g", pa, [
            (a(!0), l(m, null, L(d.value.dataset, (t, n) => (a(), l("g", xa, [
              e.value.lineSmooth ? (a(), l(m, { key: 0 }, [
                _("path", {
                  d: `M ${f(Xe)(t.coordinates)}`,
                  stroke: e.value.backgroundColor,
                  "stroke-width": e.value.lineStrokeWidth + 1,
                  "stroke-linecap": "round",
                  fill: "none",
                  class: ne({ "quick-animation": !0, "vue-data-ui-line-animated": e.value.lineAnimated }),
                  style: { transition: "all 0.3s ease-in-out" }
                }, null, 10, ya),
                _("path", {
                  d: `M ${f(Xe)(t.coordinates)}`,
                  stroke: t.color,
                  "stroke-width": e.value.lineStrokeWidth,
                  "stroke-linecap": "round",
                  fill: "none",
                  class: ne({ "quick-animation": !0, "vue-data-ui-line-animated": e.value.lineAnimated }),
                  style: { transition: "all 0.3s ease-in-out" }
                }, null, 10, ka)
              ], 64)) : (a(), l(m, { key: 1 }, [
                _("path", {
                  d: `M ${t.linePath}`,
                  stroke: e.value.backgroundColor,
                  "stroke-width": e.value.lineStrokeWidth + 1,
                  "stroke-linecap": "round",
                  fill: "none",
                  class: ne({ "quick-animation": !0, "vue-data-ui-line-animated": e.value.lineAnimated }),
                  style: { transition: "all 0.3s ease-in-out" }
                }, null, 10, ba),
                _("path", {
                  d: `M ${t.linePath}`,
                  stroke: t.color,
                  "stroke-width": e.value.lineStrokeWidth,
                  "stroke-linecap": "round",
                  fill: "none",
                  class: ne({ "quick-animation": !0, "vue-data-ui-line-animated": e.value.lineAnimated }),
                  style: { transition: "all 0.3s ease-in-out" }
                }, null, 10, Sa)
              ], 64)),
              (a(!0), l(m, null, L(t.coordinates, (r, h) => (a(), l("circle", {
                cx: r.x,
                cy: f(X)(r.y),
                r: 3,
                fill: t.color,
                stroke: e.value.backgroundColor,
                "stroke-width": "0.5",
                class: "quick-animation",
                style: { transition: "all 0.3s ease-in-out" }
              }, null, 8, wa))), 256))
            ]))), 256))
          ]),
          e.value.showDataLabels ? (a(), l("g", _a, [
            (a(!0), l(m, null, L(d.value.dataset, (t, n) => (a(), l(m, null, [
              (a(!0), l(m, null, L(t.coordinates, (r, h) => (a(), l("text", {
                "text-anchor": "middle",
                "font-size": e.value.dataLabelFontSize,
                fill: t.color,
                x: r.x,
                y: f(X)(r.y) - e.value.dataLabelFontSize / 2,
                class: "quick-animation",
                style: { transition: "all 0.3s ease-in-out" }
              }, E(f(H)(
                e.value.formatter,
                f(X)(r.value),
                f(M)({
                  p: e.value.valuePrefix,
                  v: f(X)(r.value),
                  s: e.value.valueSuffix,
                  r: e.value.dataLabelRoundingValue
                }),
                { datapoint: r, seriesIndex: h }
              )), 9, Aa))), 256))
            ], 64))), 256))
          ])) : p("", !0),
          _("g", La, [
            (a(!0), l(m, null, L(d.value.extremes.maxSeries, (t, n) => (a(), l("rect", {
              x: d.value.drawingArea.left + n * d.value.slotSize,
              y: d.value.drawingArea.top,
              height: d.value.drawingArea.height <= 0 ? 1e-5 : d.value.drawingArea.height,
              width: d.value.slotSize <= 0 ? 1e-5 : d.value.slotSize,
              fill: [W.value, Y.value].includes(n) ? e.value.xyHighlighterColor : "transparent",
              style: O(`opacity:${e.value.xyHighlighterOpacity}`),
              onMouseenter: (r) => d.value.useTooltip(n),
              onMouseleave: c[1] || (c[1] = (r) => d.value.killTooltip()),
              onClick: (r) => g("selectDatapoint", d.value.dataset.map((h) => ({
                ...h,
                value: h.values[n]
              })))
            }, null, 44, za))), 256))
          ])
        ], 64)) : p("", !0),
        z.value === A.BAR ? (a(), l(m, { key: 2 }, [
          e.value.xyShowGrid ? (a(), l("g", $a, [
            (a(!0), l(m, null, L(v.value.yLabels, (t) => (a(), l(m, null, [
              t.y <= v.value.drawingArea.bottom ? (a(), l("line", {
                key: 0,
                x1: v.value.drawingArea.left,
                x2: v.value.drawingArea.right,
                y1: t.y,
                y2: t.y,
                stroke: e.value.xyGridStroke,
                "stroke-width": e.value.xyGridStrokeWidth,
                "stroke-linecap": "round"
              }, null, 8, Ca)) : p("", !0)
            ], 64))), 256)),
            (a(!0), l(m, null, L(v.value.extremes.maxSeries + 1, (t, n) => (a(), l("line", {
              x1: v.value.drawingArea.left + v.value.slotSize * n,
              x2: v.value.drawingArea.left + v.value.slotSize * n,
              y1: v.value.drawingArea.top,
              y2: v.value.drawingArea.bottom,
              stroke: e.value.xyGridStroke,
              "stroke-width": e.value.xyGridStrokeWidth,
              "stroke-linecap": "round"
            }, null, 8, Pa))), 256))
          ])) : p("", !0),
          e.value.xyShowAxis ? (a(), l("g", Ta, [
            _("line", {
              x1: v.value.drawingArea.left,
              x2: v.value.drawingArea.left,
              y1: v.value.drawingArea.top,
              y2: v.value.drawingArea.bottom,
              stroke: e.value.xyAxisStroke,
              "stroke-width": e.value.xyAxisStrokeWidth,
              "stroke-linecap": "round"
            }, null, 8, Ia),
            _("line", {
              x1: v.value.drawingArea.left,
              x2: v.value.drawingArea.right,
              y1: isNaN(v.value.absoluteZero) ? v.value.drawingArea.bottom : v.value.absoluteZero,
              y2: isNaN(v.value.absoluteZero) ? v.value.drawingArea.bottom : v.value.absoluteZero,
              stroke: e.value.xyAxisStroke,
              "stroke-width": e.value.xyAxisStrokeWidth,
              "stroke-linecap": "round"
            }, null, 8, Ea)
          ])) : p("", !0),
          e.value.xyShowScale ? (a(), l("g", Ra, [
            (a(!0), l(m, null, L(v.value.yLabels, (t, n) => (a(), l(m, null, [
              t.y <= v.value.drawingArea.bottom ? (a(), l("line", {
                key: 0,
                x1: t.x + 4,
                x2: v.value.drawingArea.left,
                y1: t.y,
                y2: t.y,
                stroke: e.value.xyAxisStroke,
                "stroke-width": e.value.xyAxisStrokeWidth,
                "stroke-linecap": "round"
              }, null, 8, Na)) : p("", !0),
              t.y <= v.value.drawingArea.bottom ? (a(), l("text", {
                key: 1,
                x: t.x,
                y: t.y + e.value.xyLabelsYFontSize / 3,
                "text-anchor": "end",
                "font-size": e.value.xyLabelsYFontSize,
                fill: e.value.color
              }, E(f(H)(
                e.value.formatter,
                t.value,
                f(M)({
                  p: e.value.valuePrefix,
                  v: t.value,
                  s: e.value.valueSuffix,
                  r: e.value.dataLabelRoundingValue
                }),
                { datapoint: t, seriesIndex: n }
              )), 9, Oa)) : p("", !0)
            ], 64))), 256))
          ])) : p("", !0),
          e.value.xyShowScale && e.value.xyPeriods.length ? (a(), l("g", Fa, [
            (a(!0), l(m, null, L(e.value.xyPeriods.slice(b.value.start, b.value.end), (t, n) => (a(), l("line", {
              x1: v.value.drawingArea.left + v.value.slotSize * (n + 1) - v.value.slotSize / 2,
              x2: v.value.drawingArea.left + v.value.slotSize * (n + 1) - v.value.slotSize / 2,
              y1: v.value.drawingArea.bottom,
              y2: v.value.drawingArea.bottom + 4,
              stroke: e.value.xyAxisStroke,
              "stroke-width": e.value.xyAxisStrokeWidth,
              "stroke-linecap": "round"
            }, null, 8, Ma))), 256)),
            (a(!0), l(m, null, L(e.value.xyPeriods.slice(b.value.start, b.value.end), (t, n) => (a(), l("text", {
              "font-size": e.value.xyLabelsXFontSize,
              "text-anchor": e.value.xyPeriodLabelsRotation > 0 ? "start" : e.value.xyPeriodLabelsRotation < 0 ? "end" : "middle",
              transform: `translate(${v.value.drawingArea.left + v.value.slotSize * (n + 1) - v.value.slotSize / 2}, ${v.value.drawingArea.bottom + e.value.xyLabelsXFontSize + 6}) rotate(${e.value.xyPeriodLabelsRotation})`,
              fill: e.value.color
            }, E(t), 9, Ba))), 256))
          ])) : p("", !0),
          _("g", Ua, [
            (a(!0), l(m, null, L(v.value.dataset, (t, n) => (a(), l(m, null, [
              (a(!0), l(m, null, L(t.coordinates, (r, h) => (a(), l("rect", {
                x: r.x,
                width: r.width <= 0 ? 1e-5 : r.width,
                height: f(X)(r.height <= 0 ? 1e-5 : r.height),
                y: f(X)(r.y),
                fill: t.color,
                stroke: e.value.backgroundColor,
                "stroke-width": e.value.barStrokeWidth,
                "stroke-linecap": "round",
                class: ne({ "vue-data-ui-bar-animated": e.value.barAnimated && r.value < 0 })
              }, [
                e.value.barAnimated && r.value > 0 && !f(ke) && !f(be) ? (a(), l("animate", {
                  key: 0,
                  attributeName: "height",
                  from: 0,
                  to: r.height,
                  dur: "0.5s"
                }, null, 8, Va)) : p("", !0),
                e.value.barAnimated && r.value > 0 && !f(ke) && !f(be) ? (a(), l("animate", {
                  key: 1,
                  attributeName: "y",
                  from: v.value.absoluteZero,
                  to: v.value.absoluteZero - r.height,
                  dur: "0.5s"
                }, null, 8, qa)) : p("", !0)
              ], 10, Da))), 256))
            ], 64))), 256))
          ]),
          e.value.showDataLabels ? (a(), l("g", Wa, [
            (a(!0), l(m, null, L(v.value.dataset, (t, n) => (a(), l(m, null, [
              (a(!0), l(m, null, L(t.coordinates, (r, h) => (a(), l("text", {
                x: r.x + r.width / 2,
                y: f(X)(r.y) - e.value.dataLabelFontSize / 2,
                "text-anchor": "middle",
                "font-size": e.value.dataLabelFontSize,
                fill: t.color,
                class: "quick-animation"
              }, E(f(H)(
                e.value.formatter,
                f(X)(r.value),
                f(M)({
                  p: e.value.valuePrefix,
                  v: f(X)(r.value),
                  s: e.value.valueSuffix,
                  r: e.value.dataLabelRoundingValue
                }),
                { datapoint: r, seriesIndex: h }
              )), 9, ja))), 256))
            ], 64))), 256))
          ])) : p("", !0),
          _("g", Ga, [
            (a(!0), l(m, null, L(v.value.extremes.maxSeries, (t, n) => (a(), l("rect", {
              x: v.value.drawingArea.left + n * v.value.slotSize,
              y: v.value.drawingArea.top,
              height: v.value.drawingArea.height <= 0 ? 1e-5 : v.value.drawingArea.height,
              width: v.value.slotSize <= 0 ? 1e-5 : v.value.slotSize,
              fill: [W.value, Y.value].includes(n) ? e.value.xyHighlighterColor : "transparent",
              style: O(`opacity:${e.value.xyHighlighterOpacity}`),
              onMouseenter: (r) => v.value.useTooltip(n),
              onMouseleave: c[2] || (c[2] = (r) => v.value.killTooltip()),
              onClick: (r) => g("selectDatapoint", v.value.dataset.map((h) => ({
                ...h,
                value: h.values[n]
              })))
            }, null, 44, Ha))), 256))
          ])
        ], 64)) : p("", !0),
        [A.LINE, A.BAR].includes(z.value) ? (a(), l("g", Xa, [
          e.value.xAxisLabel && z.value === A.LINE ? (a(), l("g", Za, [
            _("text", {
              "font-size": e.value.axisLabelsFontSize,
              fill: e.value.color,
              "text-anchor": "middle",
              x: d.value.drawingArea.left + d.value.drawingArea.width / 2,
              y: y.value.height - e.value.axisLabelsFontSize / 3
            }, E(e.value.xAxisLabel), 9, Ya)
          ])) : p("", !0),
          e.value.xAxisLabel && z.value === A.BAR ? (a(), l("g", Ja, [
            _("text", {
              "font-size": e.value.axisLabelsFontSize,
              fill: e.value.color,
              "text-anchor": "middle",
              x: v.value.drawingArea.left + v.value.drawingArea.width / 2,
              y: y.value.height - e.value.axisLabelsFontSize / 3
            }, E(e.value.xAxisLabel), 9, Qa)
          ])) : p("", !0),
          e.value.yAxisLabel && z.value === A.LINE ? (a(), l("g", Ka, [
            _("text", {
              "font-size": e.value.axisLabelsFontSize,
              fill: e.value.color,
              transform: `translate(${e.value.axisLabelsFontSize}, ${d.value.drawingArea.top + d.value.drawingArea.height / 2}) rotate(-90)`,
              "text-anchor": "middle"
            }, E(e.value.yAxisLabel), 9, el)
          ])) : p("", !0),
          e.value.yAxisLabel && z.value === A.BAR ? (a(), l("g", tl, [
            _("text", {
              "font-size": e.value.axisLabelsFontSize,
              fill: e.value.color,
              transform: `translate(${e.value.axisLabelsFontSize}, ${v.value.drawingArea.top + v.value.drawingArea.height / 2}) rotate(-90)`,
              "text-anchor": "middle"
            }, E(e.value.yAxisLabel), 9, al)
          ])) : p("", !0)
        ])) : p("", !0)
      ], 12, Bt)) : p("", !0),
      z.value ? p("", !0) : (a(), Te(Ct, {
        key: 3,
        config: {
          type: "line",
          style: {
            backgroundColor: e.value.backgroundColor,
            line: {
              axis: {
                color: e.value.xyAxisStroke
              },
              path: {
                color: e.value.xyAxisStroke,
                strokeWidth: 0.5
              }
            }
          }
        }
      }, null, 8, ["config"])),
      u.$slots.watermark ? (a(), l("div", ll, [
        V(u.$slots, "watermark", J(me({ isPrinting: f(ke) || f(be) })), void 0, !0)
      ])) : p("", !0),
      [A.BAR, A.LINE].includes(z.value) && e.value.zoomXy && k.value.maxSeriesLength > 1 ? (a(), l("div", {
        key: `slicer_${ye.value}`,
        ref_key: "quickChartSlicer",
        ref: se
      }, [
        (a(), Te($t, {
          key: `slicer_${ye.value}`,
          background: e.value.zoomColor,
          borderColor: e.value.backgroundColor,
          fontSize: e.value.zoomFontSize,
          useResetSlot: e.value.zoomUseResetSlot,
          labelLeft: e.value.xyPeriods[b.value.start] ? e.value.xyPeriods[b.value.start] : "",
          labelRight: e.value.xyPeriods[b.value.end - 1] ? e.value.xyPeriods[b.value.end - 1] : "",
          textColor: e.value.color,
          inputColor: e.value.zoomColor,
          selectColor: e.value.zoomHighlightColor,
          max: k.value.maxSeriesLength,
          min: 0,
          valueStart: b.value.start,
          valueEnd: b.value.end,
          smoothMinimap: e.value.zoomMinimap.smooth,
          minimapSelectedColor: e.value.zoomMinimap.selectedColor,
          minimapSelectedColorOpacity: e.value.zoomMinimap.selectedColorOpacity,
          minimapSelectionRadius: e.value.zoomMinimap.selectionRadius,
          minimapLineColor: e.value.zoomMinimap.lineColor,
          minimap: ut.value,
          minimapIndicatorColor: e.value.zoomMinimap.indicatorColor,
          minimapSelectedIndex: Y.value,
          start: b.value.start,
          "onUpdate:start": c[3] || (c[3] = (t) => b.value.start = t),
          end: b.value.end,
          "onUpdate:end": c[4] || (c[4] = (t) => b.value.end = t),
          onReset: it,
          onTrapMouse: ot
        }, {
          "reset-action": ae(({ reset: t }) => [
            V(u.$slots, "reset-action", J(me({ reset: t })), void 0, !0)
          ]),
          _: 3
        }, 8, ["background", "borderColor", "fontSize", "useResetSlot", "labelLeft", "labelRight", "textColor", "inputColor", "selectColor", "max", "valueStart", "valueEnd", "smoothMinimap", "minimapSelectedColor", "minimapSelectedColorOpacity", "minimapSelectionRadius", "minimapLineColor", "minimap", "minimapIndicatorColor", "minimapSelectedIndex", "start", "end"]))
      ])) : p("", !0),
      e.value.showLegend ? (a(), l("div", {
        key: 6,
        ref_key: "quickChartLegend",
        ref: oe,
        class: "vue-ui-quick-chart-legend",
        style: O(`background:transparent;color:${e.value.color}`)
      }, [
        z.value === A.DONUT ? (a(!0), l(m, { key: 0 }, L(C.value.legend, (t, n) => (a(), l("div", {
          class: "vue-ui-quick-chart-legend-item",
          onClick: (r) => {
            lt(t, C.value.dataset), g("selectLegend", t);
          },
          style: O(`cursor: ${C.value.legend.length > 1 ? "pointer" : "default"}; opacity:${w.value.includes(t.id) ? "0.5" : "1"}`)
        }, [
          e.value.useCustomLegend ? V(u.$slots, "legend", J(Ie({ key: 0 }, { legend: t })), void 0, !0) : (a(), l(m, { key: 1 }, [
            re(Le, {
              name: e.value.legendIcon,
              stroke: t.color,
              size: e.value.legendIconSize
            }, null, 8, ["name", "stroke", "size"]),
            _("span", {
              style: O(`font-size:${e.value.legendFontSize}px`)
            }, E(t.name), 5),
            _("span", {
              style: O(`font-size:${e.value.legendFontSize}px;font-variant-numeric:tabular-nums`)
            }, E(w.value.includes(t.id) ? "-" : f(H)(
              e.value.formatter,
              t.absoluteValue,
              f(M)({
                p: e.value.valuePrefix,
                v: t.absoluteValue,
                s: e.value.valueSuffix,
                r: e.value.dataLabelRoundingValue
              }),
              { datapoint: t, seriesIndex: n }
            )), 5),
            w.value.includes(t.id) ? (a(), l("span", {
              key: 0,
              style: O(`font-size:${e.value.legendFontSize}px`)
            }, " ( - % ) ", 4)) : _e.value ? (a(), l("span", {
              key: 1,
              style: O(`font-size:${e.value.legendFontSize}px; font-variant-numeric: tabular-nums;`)
            }, " ( - % ) ", 4)) : (a(), l("span", {
              key: 2,
              style: O(`font-size:${e.value.legendFontSize}px; font-variant-numeric: tabular-nums;`)
            }, " (" + E(f(M)({
              v: t.value / C.value.total * 100,
              s: "%",
              r: e.value.dataLabelRoundingPercentage
            })) + ") ", 5))
          ], 64))
        ], 12, ol))), 256)) : p("", !0),
        z.value === A.LINE ? (a(!0), l(m, { key: 1 }, L(d.value.legend, (t, n) => (a(), l("div", {
          class: "vue-ui-quick-chart-legend-item",
          onClick: (r) => {
            Ve(t.id, d.value.legend.length - 1), g("selectLegend", t);
          },
          style: O(`cursor: ${d.value.legend.length > 1 ? "pointer" : "default"}; opacity:${w.value.includes(t.id) ? "0.5" : "1"}`)
        }, [
          e.value.useCustomLegend ? V(u.$slots, "legend", J(Ie({ key: 0 }, { legend: t })), void 0, !0) : (a(), l(m, { key: 1 }, [
            re(Le, {
              name: e.value.legendIcon,
              stroke: t.color,
              size: e.value.legendIconSize
            }, null, 8, ["name", "stroke", "size"]),
            _("span", {
              style: O(`font-size:${e.value.legendFontSize}px`)
            }, E(t.name), 5)
          ], 64))
        ], 12, il))), 256)) : p("", !0),
        z.value === A.BAR ? (a(!0), l(m, { key: 2 }, L(v.value.legend, (t, n) => (a(), l("div", {
          class: "vue-ui-quick-chart-legend-item",
          onClick: (r) => {
            Ve(t.id, v.value.legend.length - 1), g("selectLegend", t);
          },
          style: O(`cursor: ${v.value.legend.length > 1 ? "pointer" : "default"}; opacity:${w.value.includes(t.id) ? "0.5" : "1"}`)
        }, [
          e.value.useCustomLegend ? V(u.$slots, "legend", J(Ie({ key: 0 }, { legend: t })), void 0, !0) : (a(), l(m, { key: 1 }, [
            re(Le, {
              name: e.value.legendIcon,
              stroke: t.color,
              size: e.value.legendIconSize
            }, null, 8, ["name", "stroke", "size"]),
            _("span", {
              style: O(`font-size:${e.value.legendFontSize}px`)
            }, E(t.name), 5)
          ], 64))
        ], 12, ul))), 256)) : p("", !0)
      ], 4)) : p("", !0),
      re(At, {
        show: Se.value.showTooltip && G.value,
        backgroundColor: e.value.backgroundColor,
        color: e.value.color,
        borderRadius: e.value.tooltipBorderRadius,
        borderColor: e.value.tooltipBorderColor,
        borderWidth: e.value.tooltipBorderWidth,
        fontSize: e.value.tooltipFontSize,
        backgroundOpacity: e.value.tooltipBackgroundOpacity,
        position: e.value.tooltipPosition,
        offsetY: e.value.tooltipOffsetY,
        parent: j.value,
        content: Q.value,
        isCustom: f(Ae)(e.value.tooltipCustomFormat)
      }, {
        "tooltip-before": ae(() => [
          V(u.$slots, "tooltip-before", J(me({ ...ve.value })), void 0, !0)
        ]),
        "tooltip-after": ae(() => [
          V(u.$slots, "tooltip-after", J(me({ ...ve.value })), void 0, !0)
        ]),
        _: 3
      }, 8, ["show", "backgroundColor", "color", "borderRadius", "borderColor", "borderWidth", "fontSize", "backgroundOpacity", "position", "offsetY", "parent", "content", "isCustom"])
    ], 14, Mt)) : (a(), l("div", nl, [
      re(Le, {
        name: "circleCancel",
        stroke: "red"
      }),
      rl
    ]));
  }
}, bl = /* @__PURE__ */ Tt(sl, [["__scopeId", "data-v-85aefdcf"]]);
export {
  bl as default
};
