import { ref as i, computed as x, watch as _, nextTick as ce, onMounted as za, onBeforeUnmount as Sa, openBlock as z, createElementBlock as J, normalizeStyle as K, normalizeClass as $a, createBlock as F, createCommentVNode as A, unref as D, createSlots as Ia, withCtx as b, renderSlot as L, normalizeProps as B, guardReactiveProps as U, createElementVNode as Q, createVNode as Ta, toDisplayString as Ke, createTextVNode as Ma } from "vue";
import { u as Pa, c as Ra, t as Oa, a as Fa, p as H, C as de, b as Ea, D as Ce, i as ee, f as ae, Y as Na, J as _a, d as Qe, a2 as Aa, o as Da, e as Ha, x as ea, y as Wa, q as Xa, r as Ya, s as le, l as Ba } from "./index-Cm2_6s9o.js";
import { d as Ua, c as Za, a as aa, t as Ga, l as k, r as we, b as E, p as la, u as Va } from "./useResponsive-CoxXLe23.js";
import { _ as ja } from "./Tooltip-BBgfUr4a.js";
import { L as qa } from "./Legend-DRozxv9L.js";
import { _ as Ja } from "./Title-Coit3NcT.js";
import { S as Ka } from "./Slicer-D4SO7odF.js";
import { u as Qa, U as el } from "./usePrinter-Cx8U1e30.js";
import al from "./vue-ui-accordion-CxrNF8BI.js";
import { D as ll } from "./DataTable-NGi-FgLM.js";
import tl from "./vue-ui-skeleton-BUS6A44x.js";
import { u as ta } from "./useNestedProp-BYPZJNhi.js";
import { P as ol } from "./PenAndPaper-DJ_d10S-.js";
import { _ as rl } from "./_plugin-vue_export-helper-CHgC5LLL.js";
const ul = ["id"], sl = ["onClick"], nl = {
  key: 2,
  class: "vue-data-ui-watermark"
}, il = ["innerHTML"], vl = {
  __name: "vue-ui-xy-canvas",
  props: {
    dataset: {
      type: Array,
      default() {
        return [];
      }
    },
    config: {
      type: Object,
      default() {
        return {};
      }
    }
  },
  emits: ["selectLegend"],
  setup(ze, { expose: oa, emit: ra }) {
    const f = ze, { vue_ui_xy_canvas: ua } = Pa(), he = i(Ra()), Z = i(null), I = i(null), G = i(null), s = i(null), y = i(1), P = i(1), te = i(!1), d = i(null), oe = i(""), Se = i(null), S = i([]), W = i(1), N = i(!0), T = i(!0), ye = i(null), $e = i(0), Ie = i(0), re = i(!1), Te = i(null), Me = i(null), Pe = i(null), Re = i(null), fe = i(0), ge = i(0), pe = i(0), me = x(() => !!f.dataset && f.dataset.length), a = x({
      get: () => Oe(),
      set: (e) => e
    });
    function Oe() {
      const e = ta({
        userConfig: f.config,
        defaultConfig: ua
      });
      let t = {};
      return e.theme ? t = {
        ...ta({
          userConfig: Oa.vue_ui_xy_canvas[e.theme] || f.config,
          defaultConfig: e
        }),
        customPalette: Fa[e.theme] || H
      } : t = e, f.config && de(f.config, "style.chart.scale.min") ? t.style.chart.scale.min = f.config.style.chart.scale.min : t.style.chart.scale.min = null, f.config && de(f.config, "style.chart.scale.max") ? t.style.chart.scale.max = f.config.style.chart.scale.max : t.style.chart.scale.max = null, f.config && de(f.config, "style.chart.zoom.startIndex") ? t.style.chart.zoom.startIndex = f.config.style.chart.zoom.startIndex : t.style.chart.zoom.startIndex = null, f.config && de(f.config, "style.chart.zoom.endIndex") ? t.style.chart.zoom.endIndex = f.config.style.chart.zoom.endIndex : t.style.chart.zoom.endIndex = null, t;
    }
    _(() => f.config, (e) => {
      a.value = Oe(), xe(), fe.value += 1, ge.value += 1, pe.value += 1;
    }, { deep: !0 }), _(() => f.dataset, () => {
      xe(), fe.value += 1, ge.value += 1, pe.value += 1;
    }, { deep: !0 });
    const Fe = i(a.value.style.chart.aspectRatio), { isPrinting: Ee, isImaging: Ne, generatePdf: _e, generateImage: Ae } = Qa({
      elementId: `xy_canvas_${he.value}`,
      fileName: a.value.style.chart.title.text || "vue-ui-xy-canvas"
    }), u = i({
      showTable: a.value.table.show,
      showDataLabels: a.value.style.chart.dataLabels.show,
      stacked: a.value.style.chart.stacked,
      showTooltip: a.value.style.chart.tooltip.show
    });
    function sa(e) {
      re.value = e, Ie.value += 1;
    }
    const De = x(() => Ea(a.value.customPalette)), $ = x(() => X.value ? Math.max(...X.value.filter((e, t) => !S.value.includes(e.absoluteIndex)).map((e) => e.series.length)) : 0), l = x(() => {
      const e = y.value - y.value * (a.value.style.chart.paddingProportions.left + a.value.style.chart.paddingProportions.right);
      return {
        canvasWidth: y.value,
        canvasHeight: P.value,
        left: y.value * a.value.style.chart.paddingProportions.left,
        top: P.value * a.value.style.chart.paddingProportions.top,
        right: y.value - y.value * a.value.style.chart.paddingProportions.right,
        bottom: P.value - P.value * a.value.style.chart.paddingProportions.bottom,
        width: e,
        height: P.value - P.value * (a.value.style.chart.paddingProportions.top + a.value.style.chart.paddingProportions.bottom),
        slot: e / (r.value.end - r.value.start)
      };
    });
    function He(e, t) {
      return e / t;
    }
    function na({ hasAutoScale: e, series: t, min: o, max: v, scale: c, yOffset: g, individualHeight: n, stackIndex: p = null }) {
      return t.map((w, ke) => {
        const M = c.min < 0 ? Math.abs(c.min) : 0, R = He(w + M, M + c.max);
        let O, V;
        e && (O = Math.abs(c.min), V = He(w + O, c.max + O));
        let j = 0;
        return p === null ? j = l.value.bottom - l.value.height * (e ? V : R) : j = l.value.bottom - g - n * (e ? V : R), {
          x: l.value.left + l.value.slot * ke + l.value.slot / 2,
          y: j,
          value: w
        };
      });
    }
    const m = x(() => {
      const e = a.value.style.chart.scale.min !== null ? a.value.style.chart.scale.min : Math.min(...X.value.filter((n, p) => !S.value.includes(n.absoluteIndex)).flatMap((n) => n.series.slice(r.value.start, r.value.end))), t = a.value.style.chart.scale.max !== null ? a.value.style.chart.scale.max : Math.max(...X.value.filter((n, p) => !S.value.includes(n.absoluteIndex)).flatMap((n) => n.series.slice(r.value.start, r.value.end))), o = Ce(e < 0 ? e : 0, t === e ? e + 1 < 0 ? 0 : e + 1 : t < 0 ? 0 : t, a.value.style.chart.scale.ticks), v = o.min < 0 ? Math.abs(o.min) : 0, c = l.value.bottom - l.value.height * (v / (o.max + v)), g = o.ticks.map((n) => ({
        y: l.value.bottom - l.value.height * ((n + v) / (o.max + v)),
        x: l.value.left - 8,
        value: n
      }));
      return {
        absoluteMin: v,
        max: t,
        min: e,
        scale: o,
        yLabels: g,
        zero: c
      };
    }), ia = x(() => h.value.map((e) => `
            <div style="display:flex;flex-direction:row;gap:6px;align-items:center;">
                <svg viewBox="0 0 10 10" height="12" width="12">
                    <circle cx="5" cy="5" r="5" fill="${e.color}"/>
                </svg>
                <span>${e.name ? e.name + ": " : ""}</span>
                <span>${ee(
      a.value.style.chart.dataLabels.formatter,
      e.series[d.value],
      ae({
        p: e.prefix || "",
        v: e.series[d.value],
        s: e.suffix || "",
        r: e.rounding || 0
      }),
      { datapoint: e, seriesIndex: d.value }
    )}</span>
            </div>
        `)), X = x(() => f.dataset.map((e, t) => ({
      ...e,
      series: Na({
        data: _a(e.series),
        threshold: a.value.downsample.threshold
      }),
      absoluteIndex: t,
      color: Qe(e.color || De.value[t] || H[t] || H[t % H.length])
    })));
    _($, (e) => {
      e && We();
    });
    const h = x(() => Aa(X.value.filter((e, t) => !S.value.includes(e.absoluteIndex))).map((e, t) => ({
      ...e,
      series: e.series.slice(r.value.start, r.value.end)
    })).map((e, t) => {
      let o = [null, void 0].includes(e.scaleMin) ? Math.min(...e.series) || 0 : e.scaleMin, v = [null, void 0].includes(e.scaleMax) ? Math.max(...e.series) || 1 : e.scaleMax;
      o === v && (o = o >= 0 ? v - 1 : o, v = v >= 0 ? v : o + 1);
      const g = {
        ratios: e.series.filter((q) => ![null, void 0].includes(q)).map((q) => (q - o) / (v - o)),
        valueMin: o,
        valueMax: v
      }, n = e.scaleSteps || a.value.style.chart.scale.ticks;
      let p;
      e.autoScaling ? p = Ce(g.valueMin, g.valueMax, n) : p = Ce(g.valueMin < 0 ? g.valueMin : 0, g.valueMax <= 0 ? 0 : g.valueMax, n);
      const w = u.value.stacked ? l.value.height * (1 - e.cumulatedStackRatio) : 0, ke = u.value.stacked ? l.value.height / a.value.style.chart.stackGap : 0, M = u.value.stacked ? l.value.height * e.stackRatio - ke : l.value.height, R = p.min < 0 ? Math.abs(p.min) : 0;
      let O;
      e.autoScaling && u.value.stacked && v <= 0 ? O = l.value.bottom - w - M : O = l.value.bottom - w - M * (R / (p.max + R));
      const V = p.ticks.map((q, wa) => ({
        y: l.value.bottom - w - M * (wa / (p.ticks.length - 1)),
        x: l.value.left - 8,
        value: q
      })), j = na({
        hasAutoScale: u.value.stacked && e.autoScaling,
        series: e.series,
        min: u.value.stacked ? o : m.value.min,
        max: u.value.stacked ? v : m.value.max,
        scale: u.value.stacked ? p : m.value.scale,
        yOffset: w,
        individualHeight: M,
        stackIndex: u.value.stacked ? t : null
      });
      return {
        ...e,
        coordinatesLine: j,
        min: o,
        max: v,
        localScale: p,
        localZero: O,
        localMin: R,
        localYLabels: V,
        yOffset: w,
        individualHeight: M
      };
    })), r = i({
      start: 0,
      end: $.value
    });
    function We() {
      Xe();
    }
    const Y = i(null);
    async function Xe() {
      (a.value.style.chart.zoom.startIndex !== null || a.value.style.chart.zoom.endIndex !== null) && Y.value ? (a.value.style.chart.zoom.startIndex !== null && (await ce(), await ce(), Y.value && Y.value.setStartValue(a.value.style.chart.zoom.startIndex)), a.value.style.chart.zoom.endIndex !== null && (await ce(), await ce(), Y.value && Y.value.setEndValue(va(a.value.style.chart.zoom.endIndex + 1)))) : (r.value = {
        start: 0,
        end: $.value
      }, $e.value += 1);
    }
    function va(e) {
      const t = $.value;
      return e > t ? t : e < 0 || a.value.style.chart.zoom.startIndex !== null && e < a.value.style.chart.zoom.startIndex ? a.value.style.chart.zoom.startIndex !== null ? a.value.style.chart.zoom.startIndex + 1 : 1 : e;
    }
    const ca = x(() => h.value.filter((e) => ["line", "plot", void 0].includes(e.type))), C = x(() => h.value.filter((e) => e.type === "bar"));
    function da() {
      if (!I.value)
        return;
      const e = G.value.offsetWidth, t = G.value.offsetHeight;
      I.value.width = e * W.value * 2, I.value.height = t * W.value * 2, y.value = e * W.value * 2, P.value = t * W.value * 2, s.value.scale(W.value, W.value), be();
    }
    function ha() {
      if (s.value.clearRect(0, 0, 1e4, 1e4), s.value.fillStyle = a.value.style.chart.backgroundColor, s.value.fillRect(0, 0, l.value.canvasWidth, l.value.canvasHeight), u.value.stacked)
        a.value.style.chart.grid.y.verticalLines.show && r.value.end - r.value.start < a.value.style.chart.grid.y.verticalLines.hideUnderXLength ? h.value.forEach((e) => {
          for (let t = 0; t < r.value.end - r.value.start + 1; t += 1)
            k(
              s.value,
              [
                {
                  x: l.value.left + l.value.slot * t,
                  y: l.value.bottom - e.yOffset - e.individualHeight
                },
                {
                  x: l.value.left + l.value.slot * t,
                  y: l.value.bottom - e.yOffset
                }
              ],
              {
                color: a.value.style.chart.grid.y.verticalLines.color
              }
            );
        }) : a.value.style.chart.grid.y.verticalLines.show && r.value.end - r.value.start >= a.value.style.chart.grid.y.verticalLines.hideUnderXLength && h.value.forEach((e) => {
          for (let t = r.value.start; t < r.value.end; t += 1)
            t % Math.floor((r.value.end - r.value.start) / a.value.style.chart.grid.y.timeLabels.modulo) === 0 && k(
              s.value,
              [
                {
                  x: l.value.left + l.value.slot * (t - r.value.start) + l.value.slot / 2,
                  y: l.value.bottom - e.yOffset - e.individualHeight
                },
                {
                  x: l.value.left + l.value.slot * (t - r.value.start) + l.value.slot / 2,
                  y: l.value.bottom - e.yOffset
                }
              ],
              {
                color: a.value.style.chart.grid.y.verticalLines.color
              }
            );
        }), a.value.style.chart.grid.x.horizontalLines.show && (a.value.style.chart.grid.x.horizontalLines.alternate ? h.value.forEach((e) => {
          e.localYLabels.forEach((t, o) => {
            o < e.localYLabels.length - 1 && we(
              s.value,
              [
                { x: l.value.left, y: t.y },
                { x: l.value.right, y: t.y },
                { x: l.value.right, y: e.localYLabels[o + 1].y },
                { x: l.value.left, y: e.localYLabels[o + 1].y }
              ],
              {
                fillColor: o % 2 === 0 ? "transparent" : le(a.value.style.chart.grid.x.horizontalLines.color, a.value.style.chart.grid.x.horizontalLines.opacity),
                strokeColor: "transparent"
              }
            );
          });
        }) : h.value.forEach((e) => {
          e.localYLabels.slice(r.value.start, r.value.end).forEach((t) => {
            k(
              s.value,
              [
                { x: l.value.left, y: t.y },
                { x: l.value.right, y: t.y }
              ],
              {
                color: a.value.style.chart.grid.x.horizontalLines.color
              }
            );
          });
        })), a.value.style.chart.grid.zeroLine.show && h.value.forEach((e) => {
          k(
            s.value,
            [
              { x: l.value.left, y: e.localZero },
              { x: l.value.right, y: e.localZero }
            ],
            {
              color: a.value.style.chart.grid.zeroLine.color,
              lineDash: a.value.style.chart.grid.zeroLine.dashed ? [10, 10] : [0, 0]
            }
          );
        }), a.value.style.chart.grid.y.axisLabels.show && h.value.forEach((e) => {
          k(
            s.value,
            [
              { x: l.value.left, y: l.value.bottom - e.yOffset },
              { x: l.value.left, y: l.value.bottom - e.yOffset - e.individualHeight }
            ],
            {
              color: e.color
            }
          ), k(
            s.value,
            [
              { x: l.value.right, y: l.value.bottom - e.yOffset },
              { x: l.value.right, y: l.value.bottom - e.yOffset - e.individualHeight }
            ],
            {
              color: e.color
            }
          ), e.localYLabels.forEach((t, o) => {
            E(
              s.value,
              ee(
                a.value.style.chart.dataLabels.formatter,
                t.value,
                ae({
                  p: e.prefix || a.value.style.chart.grid.y.axisLabels.prefix || "",
                  v: t.value,
                  s: e.suffix || a.value.style.chart.grid.y.axisLabels.suffix || "",
                  r: e.rounding || a.value.style.chart.grid.y.axisLabels.rounding || 0
                }),
                { datapoint: t, seriesIndex: o }
              ),
              t.x + a.value.style.chart.grid.y.axisLabels.offsetX,
              t.y,
              {
                align: "right",
                font: `${Math.round(y.value / 40 * a.value.style.chart.grid.y.axisLabels.fontSizeRatio)}px ${a.value.style.fontFamily}`,
                color: e.color
              }
            );
          });
        }), h.value.forEach((e) => {
          E(
            s.value,
            e.name,
            y.value / 35,
            l.value.bottom - e.yOffset - e.individualHeight / 2,
            {
              align: "center",
              rotation: -90,
              color: e.color,
              font: `${Math.round(y.value / 40 * a.value.style.chart.grid.y.axisLabels.fontSizeRatio)}px ${a.value.style.fontFamily}`
            }
          );
        });
      else {
        if (a.value.style.chart.grid.y.verticalLines.show && r.value.end - r.value.start < a.value.style.chart.grid.y.verticalLines.hideUnderXLength)
          for (let e = 0; e < r.value.end - r.value.start + 1; e += 1)
            k(
              s.value,
              [
                { x: l.value.left + l.value.slot * e, y: l.value.top },
                { x: l.value.left + l.value.slot * e, y: l.value.bottom }
              ],
              {
                color: a.value.style.chart.grid.y.verticalLines.color
              }
            );
        else if (a.value.style.chart.grid.y.verticalLines.show && r.value.end - r.value.start >= a.value.style.chart.grid.y.verticalLines.hideUnderXLength)
          for (let e = r.value.start; e < r.value.end; e += 1)
            e % Math.floor((r.value.end - r.value.start) / a.value.style.chart.grid.y.timeLabels.modulo) === 0 && k(
              s.value,
              [
                { x: l.value.left + l.value.slot * (e - r.value.start) + l.value.slot / 2, y: l.value.top },
                { x: l.value.left + l.value.slot * (e - r.value.start) + l.value.slot / 2, y: l.value.bottom }
              ],
              {
                color: a.value.style.chart.grid.y.verticalLines.color
              }
            );
        a.value.style.chart.grid.x.horizontalLines.show && (a.value.style.chart.grid.x.horizontalLines.alternate ? m.value.yLabels.forEach((e, t) => {
          t < m.value.yLabels.length - 1 && we(
            s.value,
            [
              { x: l.value.left, y: e.y },
              { x: l.value.right, y: e.y },
              { x: l.value.right, y: m.value.yLabels[t + 1].y },
              { x: l.value.left, y: m.value.yLabels[t + 1].y }
            ],
            {
              fillColor: t % 2 === 0 ? "transparent" : le(a.value.style.chart.grid.x.horizontalLines.color, a.value.style.chart.grid.x.horizontalLines.opacity),
              strokeColor: "transparent"
            }
          );
        }) : m.value.yLabels.forEach((e) => {
          k(
            s.value,
            [
              { x: l.value.left, y: e.y },
              { x: l.value.right, y: e.y }
            ],
            {
              color: a.value.style.chart.grid.x.horizontalLines.color
            }
          );
        })), a.value.style.chart.grid.y.showAxis && k(
          s.value,
          [
            { x: l.value.left, y: l.value.top },
            { x: l.value.left, y: l.value.bottom }
          ],
          {
            color: a.value.style.chart.grid.y.axisColor,
            lineWidth: a.value.style.chart.grid.y.axisThickness
          }
        ), a.value.style.chart.grid.x.showAxis && k(
          s.value,
          [
            { x: l.value.left, y: l.value.bottom },
            { x: l.value.right, y: l.value.bottom }
          ],
          {
            color: a.value.style.chart.grid.x.axisColor,
            lineWidth: a.value.style.chart.grid.x.axisThickness
          }
        ), a.value.style.chart.grid.zeroLine.show && k(
          s.value,
          [
            { x: l.value.left, y: m.value.zero },
            { x: l.value.right, y: m.value.zero }
          ],
          {
            color: a.value.style.chart.grid.zeroLine.color,
            lineDash: a.value.style.chart.grid.zeroLine.dashed ? [10, 10] : [0, 0]
          }
        ), a.value.style.chart.grid.y.axisLabels.show && m.value.yLabels.forEach((e, t) => {
          E(
            s.value,
            ee(
              a.value.style.chart.dataLabels.formatter,
              e.value,
              ae({
                p: a.value.style.chart.grid.y.axisLabels.prefix || "",
                v: e.value,
                s: a.value.style.chart.grid.y.axisLabels.suffix || "",
                r: a.value.style.chart.grid.y.axisLabels.rounding || 0
              }),
              { datapoint: e, seriesIndex: t }
            ),
            e.x + a.value.style.chart.grid.y.axisLabels.offsetX,
            e.y,
            {
              align: "right",
              font: `${Math.round(y.value / 40 * a.value.style.chart.grid.y.axisLabels.fontSizeRatio)}px ${a.value.style.fontFamily}`,
              color: a.value.style.chart.grid.y.axisLabels.color
            }
          );
        });
      }
      a.value.style.chart.grid.y.axisName && E(
        s.value,
        a.value.style.chart.grid.y.axisName,
        y.value - y.value / 40 * a.value.style.chart.grid.y.axisLabels.fontSizeRatio * 1.2,
        l.value.bottom - l.value.height / 2,
        {
          font: `${Math.round(y.value / 40 * a.value.style.chart.grid.y.axisLabels.fontSizeRatio)}px ${a.value.style.fontFamily}`,
          color: a.value.style.chart.color,
          align: "center",
          rotation: 90
        }
      ), a.value.style.chart.grid.x.axisName && E(
        s.value,
        a.value.style.chart.grid.x.axisName,
        y.value / 2,
        P.value,
        {
          font: `${Math.round(y.value / 40 * a.value.style.chart.grid.y.axisLabels.fontSizeRatio)}px ${a.value.style.fontFamily}`,
          color: a.value.style.chart.color,
          align: "center"
        }
      );
    }
    function ya(e) {
      for (let t = 0; t < e.coordinatesLine.length; t += 1) {
        const o = (d.value === t ? y.value / 150 : a.value.style.chart.line.plots.show ? y.value / 200 : 0) * a.value.style.chart.line.plots.radiusRatio;
        aa(
          s.value,
          { x: e.coordinatesLine[t].x, y: e.coordinatesLine[t].y },
          o,
          {
            color: a.value.style.chart.backgroundColor,
            fillStyle: e.color,
            strokeColor: "transparent"
          }
        );
      }
    }
    function fa(e) {
      for (let t = 0; t < e.coordinatesLine.length; t += 1)
        E(
          s.value,
          ee(
            a.value.style.chart.dataLabels.formatter,
            e.coordinatesLine[t].value,
            ae({
              p: e.prefix || "",
              v: e.coordinatesLine[t].value,
              s: e.suffix || "",
              r: e.rounding || 0
            }),
            { datapoint: e.coordinatesLine[t], seriesIndex: t }
          ),
          e.coordinatesLine[t].x,
          e.coordinatesLine[t].y + a.value.style.chart.dataLabels.offsetY,
          {
            align: "center",
            font: `${Math.round(y.value / 40 * a.value.style.chart.dataLabels.fontSizeRatio)}px ${a.value.style.fontFamily}`,
            color: a.value.style.chart.dataLabels.useSerieColor ? e.color : a.value.style.chart.dataLabels.color,
            strokeColor: a.value.style.chart.backgroundColor,
            lineWidth: 0.8
          }
        );
    }
    function ga() {
      for (let e = r.value.start; e < r.value.end; e += 1)
        (r.value.end - r.value.start < a.value.style.chart.grid.y.timeLabels.modulo || r.value.end - r.value.start >= a.value.style.chart.grid.y.timeLabels.modulo && (e % Math.floor((r.value.end - r.value.start) / a.value.style.chart.grid.y.timeLabels.modulo) === 0 || e === d.value + r.value.start)) && E(
          s.value,
          a.value.style.chart.grid.y.timeLabels.values[e] || e + 1,
          l.value.left + l.value.slot * (e - r.value.start) + l.value.slot / 2,
          l.value.bottom + y.value / a.value.style.chart.grid.y.timeLabels.offsetY,
          {
            align: a.value.style.chart.grid.y.timeLabels.rotation === 0 ? "center" : a.value.style.chart.grid.y.timeLabels.rotation > 0 ? "left" : "right",
            font: `${Math.round(y.value / 40 * a.value.style.chart.grid.y.timeLabels.fontSizeRatio)}px ${a.value.style.fontFamily}`,
            color: le(a.value.style.chart.grid.y.timeLabels.color, d.value !== null ? d.value + r.value.start === e ? 100 : 20 : 100),
            rotation: a.value.style.chart.grid.y.timeLabels.rotation
          }
        );
    }
    function Ye() {
      k(
        s.value,
        [
          { x: l.value.left + l.value.slot * d.value + l.value.slot / 2, y: l.value.top },
          { x: l.value.left + l.value.slot * d.value + l.value.slot / 2, y: l.value.bottom }
        ],
        {
          color: a.value.style.chart.selector.color,
          lineDash: a.value.style.chart.selector.dashed ? [8, 8] : [0, 0],
          lineWidth: 2,
          linceCap: "round"
        }
      );
    }
    function pa() {
      C.value.forEach((e, t) => {
        for (let o = 0; o < e.coordinatesLine.length; o += 1)
          we(
            s.value,
            [
              {
                x: l.value.left + l.value.slot * o + l.value.slot / 10 + (u.value.stacked ? 0 : l.value.slot / C.value.length * t - (t === 0 ? 0 : l.value.slot / (5 * C.value.length) * t)),
                y: u.value.stacked ? e.localZero : m.value.zero
              },
              {
                x: l.value.left + l.value.slot * o + l.value.slot / 10 + (u.value.stacked ? 0 : l.value.slot / C.value.length * t - (t === 0 ? 0 : l.value.slot / (5 * C.value.length) * t)) + l.value.slot * 0.8 / (u.value.stacked ? 1 : C.value.length),
                y: u.value.stacked ? e.localZero : m.value.zero
              },
              {
                x: l.value.left + l.value.slot * o + l.value.slot / 10 + (u.value.stacked ? 0 : l.value.slot / C.value.length * t - (t === 0 ? 0 : l.value.slot / (5 * C.value.length) * t)) + l.value.slot * 0.8 / (u.value.stacked ? 1 : C.value.length),
                y: e.coordinatesLine[o].y
              },
              {
                x: l.value.left + l.value.slot * o + l.value.slot / 10 + (u.value.stacked ? 0 : l.value.slot / C.value.length * t - (t === 0 ? 0 : l.value.slot / (5 * C.value.length) * t)),
                y: e.coordinatesLine[o].y
              }
            ],
            {
              strokeColor: a.value.style.chart.backgroundColor,
              gradient: {
                type: "linear",
                start: {
                  x: e.coordinatesLine[o].x,
                  y: e.coordinatesLine[o].y
                },
                end: {
                  x: e.coordinatesLine[o].x,
                  y: u.value.stacked ? e.localZero : m.value.zero
                },
                stops: [
                  { offset: 0, color: e.color },
                  { offset: 1, color: Ba(e.color, 0.5) }
                ]
              }
            }
          ), u.value.showDataLabels && [!0, void 0].includes(e.dataLabels) && E(
            s.value,
            ee(
              a.value.style.chart.dataLabels.formatter,
              e.coordinatesLine[o].value,
              ae({
                p: e.prefix || "",
                v: e.coordinatesLine[o].value,
                s: e.suffix || "",
                r: e.rounding || 0
              }),
              { datapoint: e.coordinatesLine[o], seriesIndex: o }
            ),
            l.value.left + l.value.slot * o + l.value.slot / 10 + (u.value.stacked ? 0 : l.value.slot / C.value.length * t - (t === 0 ? 0 : l.value.slot / (5 * C.value.length) * t)) + l.value.slot * 0.4 / (u.value.stacked ? 1 : C.value.length),
            (e.coordinatesLine[o].value < 0 ? u.value.stacked ? e.localZero : m.value.zero : e.coordinatesLine[o].y) + a.value.style.chart.dataLabels.offsetY,
            {
              align: "center",
              font: `${Math.round(y.value / 40 * a.value.style.chart.dataLabels.fontSizeRatio)}px ${a.value.style.fontFamily}`,
              color: a.value.style.chart.dataLabels.useSerieColor ? e.color : a.value.style.chart.dataLabels.color,
              strokeColor: a.value.style.chart.backgroundColor,
              lineWidth: 0.8
            }
          );
      });
    }
    function ma(e) {
      e.useArea ? u.value.stacked ? la(
        s.value,
        [{ x: e.coordinatesLine[0].x, y: e.localZero }, ...e.coordinatesLine, { x: e.coordinatesLine.at(-1).x, y: e.localZero }],
        {
          fillColor: le(e.color, a.value.style.chart.area.opacity),
          strokeColor: "transparent"
        }
      ) : la(
        s.value,
        [{ x: e.coordinatesLine[0].x, y: m.value.zero }, ...e.coordinatesLine, { x: e.coordinatesLine.at(-1).x, y: m.value.zero }],
        {
          fillColor: le(e.color, a.value.style.chart.area.opacity),
          strokeColor: "transparent"
        }
      ) : k(s.value, e.coordinatesLine, {
        color: e.color,
        lineWidth: 3
      });
    }
    function ba() {
      h.value.forEach((e, t) => {
        k(
          s.value,
          [
            { x: l.value.left, y: l.value.bottom - e.yOffset },
            { x: l.value.right, y: l.value.bottom - e.yOffset }
          ],
          {
            color: a.value.style.chart.grid.x.horizontalLines.color,
            lineWidth: 1
          }
        );
      });
    }
    function be() {
      ha(), N.value ? (T.value && d.value !== null && a.value.style.chart.selector.show && Ye(), pa(), u.value.stacked && a.value.style.chart.grid.x.showAxis && ba(), ca.value.forEach((e) => {
        (e.type === "line" || !e.type) && ma(e), T.value && (ya(e), u.value.showDataLabels && [!0, void 0].includes(e.dataLabels) && fa(e));
      }), ye.value = Za(I.value)) : (ye.value && (s.value.clearRect(0, 0, 1e4, 1e4), s.value.drawImage(ye.value, 0, 0)), T.value && d.value !== null && a.value.style.chart.selector.show && Ye(), T.value && d.value !== null && h.value.forEach((e) => {
        if (e.type === "line" || !e.type || e.type === "plot") {
          if (!e.coordinatesLine[d.value]) return;
          e.coordinatesLine[d.value].x !== void 0 && e.coordinatesLine[d.value].y !== void 0 && aa(
            s.value,
            {
              x: e.coordinatesLine[d.value].x,
              y: e.coordinatesLine[d.value].y
            },
            y.value / 150 * a.value.style.chart.line.plots.radiusRatio,
            {
              color: a.value.style.chart.backgroundColor,
              fillStyle: e.color,
              strokeColor: "transparent"
            }
          );
        }
      })), a.value.style.chart.grid.y.timeLabels.show && ga(), N.value = !1;
    }
    const ue = Ua(() => {
      T.value = !0, da();
    }, $.value > 200 ? 10 : 1, !T.value);
    function xa(e) {
      const { left: t } = I.value.getBoundingClientRect(), o = e.clientX - t;
      if (o * 2 < l.value.left || o * 2 > l.value.right) {
        te.value = !1, d.value = null;
        return;
      }
      const v = o * 2 - l.value.left;
      if (d.value = Math.floor(v / l.value.slot), te.value = !0, !T.value) return;
      let c = "";
      const g = a.value.style.chart.tooltip.customFormat;
      ea(g) && Wa(() => g({
        seriesIndex: d.value,
        datapoint: h.value.map((n) => ({
          shape: n.shape || null,
          name: n.name,
          color: n.color,
          type: n.type || "line",
          value: n.series.find((p, w) => w === d.value)
        })),
        series: h.value,
        config: a.value
      })) ? oe.value = g({
        seriesIndex: d.value,
        datapoint: h.value.map((n) => ({
          shape: n.shape || null,
          name: n.name,
          color: n.color,
          type: n.type || "line",
          value: n.series.find((p, w) => w === d.value)
        })),
        series: h.value,
        config: a.value
      }) : (a.value.style.chart.grid.y.timeLabels.values.slice(r.value.start, r.value.end)[d.value] && (c += `<div style="padding-bottom: 6px; margin-bottom: 4px; border-bottom: 1px solid ${a.value.style.chart.tooltip.borderColor}; width:100%">${a.value.style.chart.grid.y.timeLabels.values.slice(r.value.start, r.value.end)[d.value]}</div>`), c += ia.value.join(""), oe.value = c), T.value = !1;
    }
    _(() => d.value, (e) => {
      ue();
    }), _(() => r.value, (e) => {
      N.value = !0, be();
    }, {
      deep: !0
    }), _(() => u.value.showDataLabels, (e) => {
      N.value = !0, be();
    }), _(() => u.value.stacked, (e) => {
      N.value = !0, T.value = !0, ue();
    });
    function La() {
      te.value = !1, d.value = null, oe.value = "";
    }
    const se = i(null), ne = i(null);
    za(() => {
      xe();
    });
    function xe() {
      if (Da(f.dataset) ? Ha({
        componentName: "VueUiXyCanvas",
        type: "dataset"
      }) : I.value && (s.value = I.value.getContext("2d", { willReadFrequently: !0 })), a.value.responsive) {
        const e = Ga(() => {
          const { width: t, height: o } = Va({
            chart: Z.value,
            title: a.value.style.chart.title.text ? Te.value : null,
            legend: a.value.style.chart.legend.show ? Me.value : null,
            slicer: a.value.style.chart.zoom.show && $.value > 1 ? Pe.value : null,
            source: Re.value
          });
          Fe.value = `${t} / ${o}`;
        });
        se.value = new ResizeObserver(e), se.value.observe(Z.value.parentNode);
      }
      ne.value = new ResizeObserver((e) => {
        for (const t of e)
          t.contentBoxSize && G.value && (N.value = !0, ue());
      }), ne.value.observe(G.value), Xe();
    }
    Sa(() => {
      ne.value && ne.value.disconnect(), se.value && se.value.disconnect();
    });
    function Be(e) {
      ra("selectLegend", h.value.find((t) => t.absoluteIndex === e)), S.value.includes(e) ? S.value = S.value.filter((t) => t !== e) : S.value.push(e), N.value = !0, ue();
    }
    const Ue = x(() => X.value.map((e, t) => ({
      ...e,
      name: e.name,
      color: Qe(e.color) || De.value[t] || H[t] || H[t % H.length],
      shape: e.shape || "circle",
      prefix: e.prefix || "",
      suffix: e.suffix || "",
      rounding: e.rounding || 0
    })).map((e) => ({
      ...e,
      opacity: S.value.includes(e.absoluteIndex) ? 0.5 : 1,
      segregate: () => Be(e.absoluteIndex),
      isSegregated: S.value.includes(e.absoluteIndex)
    }))), ka = x(() => ({
      cy: "donut-div-legend",
      backgroundColor: a.value.style.chart.legend.backgroundColor,
      color: a.value.style.chart.legend.color,
      fontSize: a.value.style.chart.legend.fontSize,
      paddingBottom: 12,
      fontWeight: a.value.style.chart.legend.bold ? "bold" : ""
    })), ie = x(() => {
      const e = [""].concat(h.value.map((c) => c.name)).concat(' <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M18 16v2a1 1 0 0 1 -1 1h-11l6 -7l-6 -7h11a1 1 0 0 1 1 1v2" /></svg>');
      let t = [];
      for (let c = 0; c < $.value; c += 1) {
        const g = h.value.map((n) => n.series[c] ?? 0).reduce((n, p) => n + p, 0);
        t.push([a.value.style.chart.grid.y.timeLabels.values.slice(r.value.start, r.value.end)[c] ?? c + 1].concat(h.value.map((n) => (n.series[c] ?? 0).toFixed(a.value.table.rounding))).concat((g ?? 0).toFixed(a.value.table.rounding)));
      }
      const o = {
        th: {
          backgroundColor: a.value.table.th.backgroundColor,
          color: a.value.table.th.color,
          outline: a.value.table.th.outline
        },
        td: {
          backgroundColor: a.value.table.td.backgroundColor,
          color: a.value.table.td.color,
          outline: a.value.table.td.outline
        },
        breakpoint: a.value.table.responsiveBreakpoint
      }, v = [a.value.table.columnNames.period].concat(h.value.map((c) => c.name)).concat(a.value.table.columnNames.total);
      return { head: e, body: t.slice(0, r.value.end - r.value.start), config: o, colNames: v };
    }), Ze = x(() => {
      if (h.value.length === 0) return { head: [], body: [], config: {}, columnNames: [] };
      const e = h.value.map((o) => ({
        label: o.name,
        color: o.color,
        type: o.type
      })), t = [];
      for (let o = r.value.start; o < r.value.end; o += 1) {
        const v = [a.value.style.chart.grid.y.timeLabels.values[o] || o + 1];
        h.value.forEach((c) => {
          v.push(Number((c.series[o] || 0).toFixed(a.value.table.rounding)));
        }), t.push(v);
      }
      return { head: e, body: t };
    });
    function Ge() {
      const e = [[a.value.style.chart.title.text], [a.value.style.chart.title.subtitle.text], [""]], t = ["", ...Ze.value.head.map((g) => g.label)], o = Ze.value.body, v = e.concat([t]).concat(o), c = Xa(v);
      Ya({ csvContent: c, title: a.value.style.chart.title.text || "vue-ui-xy-canvas" });
    }
    function Ca() {
      return h.value;
    }
    function Ve() {
      u.value.showTable = !u.value.showTable;
    }
    function je() {
      u.value.showDataLabels = !u.value.showDataLabels;
    }
    function qe() {
      u.value.stacked = !u.value.stacked;
    }
    function Je() {
      u.value.showTooltip = !u.value.showTooltip;
    }
    const ve = i(!1);
    function Le() {
      ve.value = !ve.value;
    }
    return oa({
      getData: Ca,
      generateCsv: Ge,
      generatePdf: _e,
      generateImage: Ae,
      toggleTable: Ve,
      toggleLabels: je,
      toggleStack: qe,
      toggleTooltip: Je,
      toggleAnnotator: Le
    }), (e, t) => (z(), J("div", {
      style: K(`width:100%; position:relative; ${a.value.responsive ? "height: 100%" : ""}`),
      ref_key: "xy",
      ref: Z,
      id: `xy_canvas_${he.value}`,
      class: $a(`vue-ui-donut ${re.value ? "vue-data-ui-wrapper-fullscreen" : ""}`)
    }, [
      a.value.style.chart.title.text ? (z(), J("div", {
        key: 0,
        ref_key: "chartTitle",
        ref: Te,
        style: K(`width:100%;background:${a.value.style.chart.backgroundColor};`)
      }, [
        (z(), F(Ja, {
          key: `title_${fe.value}`,
          config: {
            title: {
              cy: "xy-canvas-title",
              ...a.value.style.chart.title
            },
            subtitle: {
              cy: "xy-canvas-subtitle",
              ...a.value.style.chart.title.subtitle
            }
          }
        }, null, 8, ["config"]))
      ], 4)) : A("", !0),
      a.value.userOptions.show && me.value ? (z(), F(el, {
        ref: "details",
        key: `user_option_${Ie.value}`,
        backgroundColor: a.value.style.chart.backgroundColor,
        color: a.value.style.chart.color,
        isPrinting: D(Ee),
        isImaging: D(Ne),
        uid: he.value,
        hasTooltip: a.value.userOptions.buttons.tooltip && a.value.style.chart.tooltip.show,
        hasPdf: a.value.userOptions.buttons.pdf,
        hasImg: a.value.userOptions.buttons.img,
        hasXls: a.value.userOptions.buttons.csv,
        hasLabel: a.value.userOptions.buttons.labels,
        hasStack: ze.dataset.length > 1 && a.value.userOptions.buttons.stack,
        hasFullscreen: a.value.userOptions.buttons.fullscreen,
        hasTable: r.value.end - r.value.start < 200 && a.value.userOptions.buttons.table,
        isFullscreen: re.value,
        isTooltip: u.value.showTooltip,
        isStacked: u.value.stacked,
        titles: { ...a.value.userOptions.buttonTitles },
        chartElement: Z.value,
        position: a.value.userOptions.position,
        hasAnnotator: a.value.userOptions.buttons.annotator,
        isAnnotation: ve.value,
        onToggleFullscreen: sa,
        onGeneratePdf: D(_e),
        onGenerateCsv: Ge,
        onGenerateImage: D(Ae),
        onToggleTable: Ve,
        onToggleLabels: je,
        onToggleStack: qe,
        onToggleTooltip: Je,
        onToggleAnnotator: Le
      }, Ia({ _: 2 }, [
        e.$slots.optionTooltip ? {
          name: "optionTooltip",
          fn: b(() => [
            L(e.$slots, "optionTooltip", {}, void 0, !0)
          ]),
          key: "0"
        } : void 0,
        e.$slots.optionPdf ? {
          name: "optionPdf",
          fn: b(() => [
            L(e.$slots, "optionPdf", {}, void 0, !0)
          ]),
          key: "1"
        } : void 0,
        e.$slots.optionCsv ? {
          name: "optionCsv",
          fn: b(() => [
            L(e.$slots, "optionCsv", {}, void 0, !0)
          ]),
          key: "2"
        } : void 0,
        e.$slots.optionImg ? {
          name: "optionImg",
          fn: b(() => [
            L(e.$slots, "optionImg", {}, void 0, !0)
          ]),
          key: "3"
        } : void 0,
        e.$slots.optionTable ? {
          name: "optionTable",
          fn: b(() => [
            L(e.$slots, "optionTable", {}, void 0, !0)
          ]),
          key: "4"
        } : void 0,
        e.$slots.optionLabels ? {
          name: "optionLabels",
          fn: b(() => [
            L(e.$slots, "optionLabels", {}, void 0, !0)
          ]),
          key: "5"
        } : void 0,
        e.$slots.optionStack ? {
          name: "optionStack",
          fn: b(() => [
            L(e.$slots, "optionStack", {}, void 0, !0)
          ]),
          key: "6"
        } : void 0,
        e.$slots.optionFullscreen ? {
          name: "optionFullscreen",
          fn: b(({ toggleFullscreen: o, isFullscreen: v }) => [
            L(e.$slots, "optionFullscreen", B(U({ toggleFullscreen: o, isFullscreen: v })), void 0, !0)
          ]),
          key: "7"
        } : void 0,
        e.$slots.optionAnnotator ? {
          name: "optionAnnotator",
          fn: b(({ toggleAnnotator: o, isAnnotator: v }) => [
            L(e.$slots, "optionAnnotator", B(U({ toggleAnnotator: o, isAnnotator: v })), void 0, !0)
          ]),
          key: "8"
        } : void 0
      ]), 1032, ["backgroundColor", "color", "isPrinting", "isImaging", "uid", "hasTooltip", "hasPdf", "hasImg", "hasXls", "hasLabel", "hasStack", "hasFullscreen", "hasTable", "isFullscreen", "isTooltip", "isStacked", "titles", "chartElement", "position", "hasAnnotator", "isAnnotation", "onGeneratePdf", "onGenerateImage"])) : A("", !0),
      Q("div", {
        class: "vue-ui-xy-canvas",
        style: K(`position: relative; aspect-ratio: ${Fe.value}`),
        ref_key: "container",
        ref: G
      }, [
        me.value ? (z(), J("canvas", {
          key: 0,
          ref_key: "canvas",
          ref: I,
          style: { width: "100%", height: "100%" },
          onMousemove: t[0] || (t[0] = (o) => xa(o)),
          onMouseleave: La
        }, null, 544)) : (z(), F(tl, {
          key: 1,
          config: {
            type: "line",
            style: {
              backgroundColor: a.value.style.chart.backgroundColor,
              line: {
                axis: {
                  color: "#CCCCCC"
                },
                path: {
                  color: "#CCCCCC",
                  strokeWidth: 0.5
                }
              }
            }
          }
        }, null, 8, ["config"])),
        Ta(ja, {
          show: u.value.showTooltip && te.value,
          backgroundColor: a.value.style.chart.tooltip.backgroundColor,
          color: a.value.style.chart.tooltip.color,
          fontSize: a.value.style.chart.tooltip.fontSize,
          borderRadius: a.value.style.chart.tooltip.borderRadius,
          borderColor: a.value.style.chart.tooltip.borderColor,
          borderWidth: a.value.style.chart.tooltip.borderWidth,
          position: a.value.style.chart.tooltip.position,
          offsetY: a.value.style.chart.tooltip.offsetY,
          parent: I.value,
          content: oe.value,
          isFullscreen: re.value,
          backgroundOpacity: a.value.style.chart.tooltip.backgroundOpacity,
          isCustom: D(ea)(a.value.style.chart.tooltip.customFormat)
        }, {
          "tooltip-before": b(() => [
            L(e.$slots, "tooltip-before", B(U({ ...Se.value })), void 0, !0)
          ]),
          "tooltip-after": b(() => [
            L(e.$slots, "tooltip-after", B(U({ ...Se.value })), void 0, !0)
          ]),
          _: 3
        }, 8, ["show", "backgroundColor", "color", "fontSize", "borderRadius", "borderColor", "borderWidth", "position", "offsetY", "parent", "content", "isFullscreen", "backgroundOpacity", "isCustom"])
      ], 4),
      Q("div", {
        ref_key: "chartSlicer",
        ref: Pe,
        style: K(`width:100%;background:${a.value.style.chart.backgroundColor}`),
        "data-html2canvas-ignore": ""
      }, [
        a.value.style.chart.zoom.show && $.value > 1 ? (z(), F(Ka, {
          ref_key: "slicerComponent",
          ref: Y,
          key: `slicer_${$e.value}`,
          background: a.value.style.chart.zoom.color,
          borderColor: a.value.style.chart.backgroundColor,
          fontSize: a.value.style.chart.zoom.fontSize,
          useResetSlot: a.value.style.chart.zoom.useResetSlot,
          labelLeft: a.value.style.chart.grid.y.timeLabels.values[r.value.start] ? a.value.style.chart.grid.y.timeLabels.values[r.value.start] : "",
          labelRight: a.value.style.chart.grid.y.timeLabels.values[r.value.end - 1] ? a.value.style.chart.grid.y.timeLabels.values[r.value.end - 1] : "",
          textColor: a.value.style.chart.color,
          inputColor: a.value.style.chart.zoom.color,
          selectColor: a.value.style.chart.zoom.highlightColor,
          max: $.value,
          min: 0,
          valueStart: r.value.start,
          valueEnd: r.value.end,
          start: r.value.start,
          "onUpdate:start": t[1] || (t[1] = (o) => r.value.start = o),
          end: r.value.end,
          "onUpdate:end": t[2] || (t[2] = (o) => r.value.end = o),
          refreshStartPoint: a.value.style.chart.zoom.startIndex !== null ? a.value.style.chart.zoom.startIndex : 0,
          refreshEndPoint: a.value.style.chart.zoom.endIndex !== null ? a.value.style.chart.zoom.endIndex + 1 : $.value,
          onReset: We
        }, {
          "reset-action": b(({ reset: o }) => [
            L(e.$slots, "reset-action", B(U({ reset: o })), void 0, !0)
          ]),
          _: 3
        }, 8, ["background", "borderColor", "fontSize", "useResetSlot", "labelLeft", "labelRight", "textColor", "inputColor", "selectColor", "max", "valueStart", "valueEnd", "start", "end", "refreshStartPoint", "refreshEndPoint"])) : A("", !0)
      ], 4),
      Q("div", {
        ref_key: "chartLegend",
        ref: Me
      }, [
        a.value.style.chart.legend.show && me.value ? (z(), F(qa, {
          legendSet: Ue.value,
          config: ka.value,
          key: `legend_${pe.value}`,
          onClickMarker: t[3] || (t[3] = ({ i: o }) => Be(o))
        }, {
          item: b(({ legend: o, index: v }) => [
            Q("div", {
              onClick: (c) => o.segregate(),
              style: K(`opacity:${S.value.includes(v) ? 0.5 : 1}`)
            }, Ke(o.name), 13, sl)
          ]),
          _: 1
        }, 8, ["legendSet", "config"])) : L(e.$slots, "legend", {
          key: 1,
          legend: Ue.value
        }, void 0, !0)
      ], 512),
      e.$slots.watermark ? (z(), J("div", nl, [
        L(e.$slots, "watermark", B(U({ isPrinting: D(Ee) || D(Ne) })), void 0, !0)
      ])) : A("", !0),
      e.$slots.source ? (z(), J("div", {
        key: 3,
        ref_key: "source",
        ref: Re,
        dir: "auto"
      }, [
        L(e.$slots, "source", {}, void 0, !0)
      ], 512)) : A("", !0),
      r.value.end - r.value.start < 200 ? (z(), F(al, {
        key: 4,
        hideDetails: "",
        config: {
          open: u.value.showTable,
          maxHeight: 1e4,
          body: {
            backgroundColor: a.value.style.chart.backgroundColor,
            color: a.value.style.chart.color
          },
          head: {
            backgroundColor: a.value.style.chart.backgroundColor,
            color: a.value.style.chart.color
          }
        }
      }, {
        content: b(() => [
          (z(), F(ll, {
            key: `table_${ge.value}`,
            colNames: ie.value.colNames,
            head: ie.value.head,
            body: ie.value.body,
            config: ie.value.config,
            title: `${a.value.style.chart.title.text}${a.value.style.chart.title.subtitle.text ? ` : ${a.value.style.chart.title.subtitle.text}` : ""}`,
            onClose: t[4] || (t[4] = (o) => u.value.showTable = !1)
          }, {
            th: b(({ th: o }) => [
              Q("div", { innerHTML: o }, null, 8, il)
            ]),
            td: b(({ td: o }) => [
              Ma(Ke(o), 1)
            ]),
            _: 1
          }, 8, ["colNames", "head", "body", "config", "title"]))
        ]),
        _: 1
      }, 8, ["config"])) : A("", !0),
      a.value.userOptions.buttons.annotator && h.value.length ? (z(), F(ol, {
        key: 5,
        parent: Z.value,
        backgroundColor: a.value.style.chart.backgroundColor,
        color: a.value.style.chart.color,
        active: ve.value,
        onClose: Le
      }, null, 8, ["parent", "backgroundColor", "color", "active"])) : A("", !0)
    ], 14, ul));
  }
}, zl = /* @__PURE__ */ rl(vl, [["__scopeId", "data-v-a8e374ca"]]);
export {
  zl as default
};
