import { computed as p, ref as g, onMounted as Xe, watch as Ue, openBlock as s, createElementBlock as n, normalizeClass as ye, normalizeStyle as U, createBlock as Y, createCommentVNode as v, renderSlot as k, createVNode as se, unref as z, createSlots as xt, withCtx as C, normalizeProps as D, guardReactiveProps as E, Fragment as h, renderList as f, createElementVNode as H, toDisplayString as S, createTextVNode as kt } from "vue";
import { u as wt, c as Ye, t as Ct, a as _t, p as ie, M as Ge, b as zt, o as Lt, e as Je, g as St, d as $t, a7 as ne, a3 as qe, C as Ze, X as Mt, l as Tt, F as Ke, f as B, x as Qe, i as je, y as Nt, q as Ot, r as Pt } from "./index-DT2Q6wHA.js";
import { u as et } from "./useNestedProp-mBik37PJ.js";
import { t as At, u as Rt } from "./useResponsive-CoxXLe23.js";
import { u as It, U as Ft } from "./usePrinter-Bu3_FFNh.js";
import { S as Vt } from "./Slicer-C-vVh0yP.js";
import { _ as Dt } from "./Tooltip-DxlT2AdY.js";
import { _ as Et } from "./Title-B5wIQ3bR.js";
import { L as Ht } from "./Legend-BJNfeJUD.js";
import Bt from "./vue-ui-accordion-Y-KIir2-.js";
import { D as Wt } from "./DataTable-Chl6EuoM.js";
import Xt from "./vue-ui-skeleton-D9lIs0pC.js";
import { _ as Ut } from "./PackageVersion-tBXJRRcv.js";
import { P as Yt } from "./PenAndPaper-VhfbqYdY.js";
import { _ as Gt } from "./_plugin-vue_export-helper-CHgC5LLL.js";
const Jt = ["id"], qt = ["xmlns", "viewBox"], Zt = { key: 0 }, Kt = ["id"], Qt = ["stop-color"], jt = ["stop-color"], ea = ["stop-color"], ta = ["x1", "x2", "y1", "y2", "stroke"], aa = ["x1", "x2", "y1", "y2", "stroke"], la = ["x1", "x2", "y1", "y2", "stroke"], oa = ["x1", "x2", "y1", "y2", "stroke"], ra = ["x", "y", "height", "rx", "width", "fill", "stroke", "stroke-width"], sa = ["x", "y", "width", "rx", "height", "fill", "stroke", "stroke-width"], ia = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], na = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], ua = ["x", "y", "font-size", "fill", "font-weight"], ca = ["transform", "font-size", "fill", "font-weight"], va = ["x", "y", "font-size", "fill", "font-weight"], ha = { key: 0 }, da = ["x", "y", "font-size", "font-weight", "fill"], ya = ["x", "y", "font-size", "fill", "font-weight"], ga = { key: 0 }, ba = ["x", "y", "font-size", "font-weight", "fill"], fa = ["x1", "x2", "y1", "y2", "stroke"], ma = ["x", "y", "font-size", "font-weight", "fill"], pa = ["x1", "x2", "y1", "y2", "stroke"], xa = ["font-size", "font-weight", "fill", "text-anchor", "transform"], ka = ["text-anchor", "font-size", "font-weight", "fill", "transform"], wa = ["font-size", "font-weight", "fill", "x", "y"], Ca = ["x", "y", "width", "height", "onClick", "onMouseenter", "fill"], _a = ["x", "y", "width", "height", "onClick", "onMouseenter", "fill"], za = {
  key: 4,
  class: "vue-data-ui-watermark"
}, La = ["onClick"], Sa = ["innerHTML"], $a = {
  __name: "vue-ui-stackbar",
  props: {
    config: {
      type: Object,
      default() {
        return {};
      }
    },
    dataset: {
      type: Array,
      default() {
        return [];
      }
    }
  },
  emits: ["selectDatapoint", "selectLegend"],
  setup(ge, { expose: tt, emit: be }) {
    const x = ge, { vue_ui_stackbar: at } = wt(), W = p({
      get() {
        return !!x.dataset && x.dataset.length;
      },
      set(a) {
        return a;
      }
    }), X = g(null), ue = g(Ye()), j = g(!1), fe = g(null), ce = g(""), L = g([]), me = g(0), pe = g(null), xe = g(null), ke = g(null), we = g(null), Ce = g(0), ve = g(!1), G = g(null), J = g(!1), lt = g(0), ot = g(0), rt = g(0);
    Xe(() => {
      he();
    });
    const e = p({
      get: () => _e(),
      set: (a) => a
    });
    function _e() {
      const a = et({
        userConfig: x.config,
        defaultConfig: at
      });
      let o = {};
      return a.theme ? o = {
        ...et({
          userConfig: Ct.vue_ui_stackbar[a.theme] || x.config,
          defaultConfig: a
        }),
        customPalette: _t[a.theme] || ie
      } : o = a, x.config && Ge(x.config, "style.chart.grid.scale.scaleMin") ? o.style.chart.grid.scale.scaleMin = x.config.style.chart.grid.scale.scaleMin : o.style.chart.grid.scale.scaleMin = null, x.config && Ge(x.config, "style.chart.grid.scale.scaleMax") ? o.style.chart.grid.scale.scaleMax = x.config.style.chart.grid.scale.scaleMax : o.style.chart.grid.scale.scaleMax = null, o;
    }
    Ue(() => x.config, (a) => {
      e.value = _e(), he(), lt.value += 1, ot.value += 1, rt.value += 1;
    }, { deep: !0 }), Ue(() => x.dataset, (a) => {
      Ne();
    }, { deep: !0 });
    const _ = g({
      dataLabels: {
        show: e.value.style.chart.bars.dataLabels.show
      },
      showTable: e.value.table.show,
      showTooltip: e.value.style.chart.tooltip.show
    }), { isPrinting: ze, isImaging: Le, generatePdf: Se, generateImage: $e } = It({
      elementId: `stackbar_${ue.value}`,
      fileName: e.value.style.chart.title.text || "vue-ui-stackbar"
    }), ee = g({
      width: e.value.style.chart.width,
      height: e.value.style.chart.height,
      paddingRatio: {
        top: e.value.style.chart.padding.top / e.value.style.chart.height,
        right: e.value.style.chart.padding.right / e.value.style.chart.width,
        bottom: e.value.style.chart.padding.bottom / e.value.style.chart.height,
        left: e.value.style.chart.padding.left / e.value.style.chart.width
      }
    }), st = p(() => zt(e.value.customPalette)), Me = g(null), Te = g(null);
    Xe(() => {
      he();
    });
    function he() {
      if (Lt(x.dataset) ? Je({
        componentName: "VueUiStackbar",
        type: "dataset"
      }) : x.dataset.forEach((a, o) => {
        St({
          datasetObject: a,
          requiredAttributes: ["name", "series"]
        }).forEach((t) => {
          W.value = !1, Je({
            componentName: "VueUiStackbar",
            type: "datasetSerieAttribute",
            property: t,
            index: o
          });
        });
      }), setTimeout(() => {
        J.value = !0;
      }, 10), e.value.responsive) {
        const a = At(() => {
          J.value = !1;
          const { width: o, height: t } = Rt({
            chart: X.value,
            title: e.value.style.chart.title.text ? pe.value : null,
            legend: e.value.style.chart.legend.show ? xe.value : null,
            slicer: e.value.style.chart.zoom.show && A.value > 1 ? ke.value : null,
            source: we.value
          });
          ee.value.width = o, ee.value.height = t, clearTimeout(Te.value), Te.value = setTimeout(() => {
            J.value = !0;
          }, 10);
        });
        Me.value = new ResizeObserver(a), Me.value.observe(X.value.parentNode);
      }
    }
    const r = p(() => {
      const { height: a, width: o } = ee.value, { right: t } = ee.value.paddingRatio, l = e.value.style.chart.padding.top, i = o - o * t, u = a - e.value.style.chart.padding.bottom, w = e.value.style.chart.padding.left, R = o - w - o * t, I = a - l - e.value.style.chart.padding.bottom;
      return {
        chartHeight: a,
        chartWidth: o,
        top: l,
        right: i,
        bottom: u,
        left: w,
        width: R,
        height: I < 0 ? 0 : I
      };
    }), P = p(() => x.dataset.map((a, o) => {
      const t = $t(a.color) || st.value[o] || ie[o] || ie[o % ie.length];
      return {
        ...a,
        // In distributed mode, all values are converted to positive
        series: JSON.parse(JSON.stringify(a.series)).map((l) => e.value.style.chart.bars.distributed ? Math.abs(l) : l),
        // Store signs to manage display of neg values in distributed mode
        signedSeries: a.series.map((l) => l >= 0 ? 1 : -1),
        absoluteIndex: o,
        id: Ye(),
        color: t
      };
    })), A = p(() => Math.max(...P.value.filter((a) => !L.value.includes(a.id)).map((a) => a.series.length))), c = g({
      start: 0,
      end: Math.max(...x.dataset.map((a) => a.series.length))
    });
    function Ne() {
      c.value = {
        start: 0,
        end: Math.max(...x.dataset.map((a) => a.series.length))
      }, Ce.value += 1;
    }
    const d = p(() => {
      let a;
      return e.value.orientation === "vertical" ? a = r.value.width / (c.value.end - c.value.start) : a = r.value.height / (c.value.end - c.value.start), a <= 0 ? 0 : a;
    }), q = p(() => ne(P.value.filter((a) => !L.value.includes(a.id))).slice(c.value.start, c.value.end)), it = p(() => ne(P.value.filter((a) => !L.value.includes(a.id)).map((a) => ({
      ...a,
      series: a.series.map((o, t) => a.signedSeries[t] === -1 && o >= 0 ? -o : o)
    }))).slice(c.value.start, c.value.end)), te = p(() => {
      const a = P.value.filter((o) => !L.value.includes(o.id));
      return {
        positive: ne(a.map((o) => ({
          ...o,
          series: o.series.slice(c.value.start, c.value.end).map((t) => t >= 0 ? t : 0)
        }))),
        negative: ne(a.map((o) => ({
          ...o,
          series: o.series.slice(c.value.start, c.value.end).map((t) => t < 0 ? t : 0)
        })))
      };
    }), N = p(() => {
      const a = e.value.style.chart.grid.scale.scaleMax !== null && !e.value.style.chart.bars.distributed ? e.value.style.chart.grid.scale.scaleMax : Math.max(...te.value.positive), o = Math.min(...te.value.negative), t = e.value.style.chart.grid.scale.scaleMin !== null && !e.value.style.chart.bars.distributed ? e.value.style.chart.grid.scale.scaleMin : [-1 / 0, 1 / 0, NaN, void 0, null].includes(o) ? 0 : o, l = !e.value.style.chart.bars.distributed && (e.value.style.chart.grid.scale.scaleMax !== null || e.value.style.chart.grid.scale.scaleMin !== null) ? qe(t > 0 ? 0 : t, a < 0 ? 0 : a, e.value.style.chart.grid.scale.ticks) : Ze(t > 0 ? 0 : t, a < 0 ? 0 : a, e.value.style.chart.grid.scale.ticks);
      return l.ticks.map((i) => ({
        zero: r.value.bottom - r.value.height * (Math.abs(l.min) / (l.max + Math.abs(l.min))),
        y: r.value.bottom - r.value.height * ((i + Math.abs(l.min)) / (l.max + Math.abs(l.min))),
        x: r.value.left - 8,
        horizontal_zero: r.value.left + r.value.width * (Math.abs(l.min) / (l.max + Math.abs(l.min))),
        horizontal_x: r.value.left + r.value.width * ((i + Math.abs(l.min)) / (l.max + Math.abs(l.min))),
        horizontal_y: r.value.bottom - 8,
        value: i
      }));
    }), Z = p(() => e.value.style.chart.grid.x.timeLabels.values.slice(c.value.start, c.value.end)), m = p(() => {
      if (!W.value) return [];
      let a = Array(A.value).fill(0), o = Array(A.value).fill(0), t = Array(A.value).fill(0), l = Array(A.value).fill(0);
      const i = Math.max(...te.value.positive) || 0, u = Math.min(...te.value.negative), w = [-1 / 0, 1 / 0, NaN, void 0, null].includes(u) ? 0 : u, R = !e.value.style.chart.bars.distributed && (e.value.style.chart.grid.scale.scaleMax !== null || e.value.style.chart.grid.scale.scaleMin !== null) ? qe(e.value.style.chart.grid.scale.scaleMin !== null ? e.value.style.chart.grid.scale.scaleMin : w > 0 ? 0 : w, e.value.style.chart.grid.scale.scaleMax !== null ? e.value.style.chart.grid.scale.scaleMax : i < 0 ? 0 : i, e.value.style.chart.grid.scale.ticks) : Ze(e.value.style.chart.grid.scale.scaleMin !== null ? e.value.style.chart.grid.scale.scaleMin : w > 0 ? 0 : w, e.value.style.chart.grid.scale.scaleMax !== null ? e.value.style.chart.grid.scale.scaleMax : i < 0 ? 0 : i, e.value.style.chart.grid.scale.ticks), { min: I, max: K } = R, F = K + (I >= 0 ? 0 : Math.abs(I)) || 1, $ = r.value.height, re = r.value.width, Be = N.value[0] ? N.value[0].zero : r.value.bottom, We = N.value[0] ? N.value[0].horizontal_zero : r.value.left;
      return P.value.filter((Q) => !L.value.includes(Q.id)).map((Q) => {
        const O = Q.series.slice(c.value.start, c.value.end), ht = Q.signedSeries.slice(c.value.start, c.value.end), dt = O.map((y, b) => r.value.left + d.value * b + d.value * e.value.style.chart.bars.gapRatio / 4), yt = O.map((y, b) => r.value.top + d.value * b + d.value * e.value.style.chart.bars.gapRatio / 4), gt = O.map((y, b) => {
          const M = e.value.style.chart.bars.distributed ? (y || 0) / q.value[b] : (y || 0) / F;
          let V, T;
          return y > 0 ? (T = $ * M, V = Be - T - a[b], a[b] += T) : (T = $ * M, V = Be + t[b], t[b] += Math.abs(T)), V;
        }), bt = O.map((y, b) => {
          const M = e.value.style.chart.bars.distributed ? (y || 0) / q.value[b] : (y || 0) / F;
          let V, T;
          return y > 0 ? (T = re * M, V = We + o[b], o[b] += T) : (T = re * M, V = We - Math.abs(T) - l[b], l[b] += Math.abs(T)), V;
        }), ft = O.map((y, b) => {
          const M = e.value.style.chart.bars.distributed ? (y || 0) / q.value[b] : (y || 0) / F;
          return y > 0 ? $ * M : $ * Math.abs(M);
        }), mt = O.map((y, b) => {
          const M = e.value.style.chart.bars.distributed ? (y || 0) / q.value[b] : (y || 0) / F;
          return y > 0 ? re * M : re * Math.abs(M);
        }), pt = O.map((y) => Math.abs(y)).reduce((y, b) => y + b, 0);
        return {
          ...Q,
          proportions: O.map((y, b) => e.value.style.chart.bars.distributed ? (y || 0) / q.value[b] : (y || 0) / pt),
          series: O,
          signedSeries: ht,
          x: dt,
          y: gt,
          height: ft,
          horizontal_width: mt,
          horizontal_y: yt,
          horizontal_x: bt
        };
      });
    }), Oe = p(() => it.value.map((a, o) => ({
      value: a,
      sign: a >= 0 ? 1 : -1
    })));
    function ae(a, o, t, l, i) {
      const u = i === -1 && a >= 0 ? -a : a;
      return je(
        e.value.style.chart.bars.dataLabels.formatter,
        u,
        B({
          p: e.value.style.chart.bars.dataLabels.prefix,
          v: u,
          s: e.value.style.chart.bars.dataLabels.suffix,
          r: e.value.style.chart.bars.dataLabels.rounding
        }),
        { datapoint: o, seriesIndex: t, datapointIndex: l }
      );
    }
    function Pe(a, o, t, l) {
      return je(
        e.value.style.chart.bars.dataLabels.formatter,
        a,
        B({
          v: a,
          s: "%",
          r: e.value.style.chart.bars.dataLabels.rounding
        }),
        { datapoint: o, seriesIndex: t, datapointIndex: l }
      );
    }
    function Ae(a) {
      const o = JSON.parse(JSON.stringify(m.value)).map((t) => ({
        name: t.name,
        value: t.series[a] === 0 ? 0 : t.series[a] || null,
        proportion: t.proportions[a] || null,
        color: t.color,
        id: t.id
      }));
      be("selectDatapoint", { datapoint: o, period: Z.value[a] });
    }
    function Re(a) {
      G.value = a, j.value = !0;
      const o = e.value.style.chart.tooltip.customFormat, t = JSON.parse(JSON.stringify(m.value)).map((i) => ({
        name: i.name,
        value: i.series[a] === 0 ? 0 : (i.signedSeries[a] === -1 && i.series[a] >= 0 ? -i.series[a] : i.series[a]) || null,
        proportion: i.proportions[a] || null,
        color: i.color,
        id: i.id
      })), l = t.map((i) => Math.abs(i.value)).reduce((i, u) => i + u, 0);
      if (Qe(o) && Nt(() => o({
        seriesIndex: a,
        datapoint: t,
        series: m.value,
        config: e.value
      })))
        ce.value = o({
          seriesIndex: a,
          datapoint: t,
          series: m.value,
          config: e.value
        });
      else {
        const {
          showValue: i,
          showPercentage: u,
          borderColor: w,
          roundingValue: R,
          roundingPercentage: I
        } = e.value.style.chart.tooltip;
        let K = "";
        Z.value[a] && (K += `<div style="width:100%;text-align:center;border-bottom:1px solid ${w};padding-bottom:6px;margin-bottom:3px;">${Z.value[a]}</div>`);
        const F = [
          i && u ? "(" : "",
          i && u ? ")" : ""
        ];
        t.reverse().forEach(($) => {
          K += `
                <div style="display:flex;flex-direction:row;align-items:center;gap:4px">
                    <svg viewBox="0 0 12 12" height="14" width="14"><rect rx="1" x="0" y="0" height="12" width="12" stroke="none" fill="${e.value.style.chart.bars.gradient.show ? `url(#gradient_${$.id})` : $.color}"/></svg>
                    ${$.name}${i || u ? ":" : ""} ${i ? B({
            p: e.value.style.chart.bars.dataLabels.prefix,
            v: $.value,
            s: e.value.style.chart.bars.dataLabels.suffix,
            r: R
          }) : ""} ${F[0]}${u ? B({
            v: isNaN($.value / l) ? 0 : Math.abs($.value) / l * 100,
            // Negs are absed to show relative proportion to absolute total. It's opinionated.
            s: "%",
            r: I
          }) : ""}${F[1]}
                </div>
            `;
        }), ce.value = `<div>${K}</div>`;
      }
    }
    function nt(a) {
      ve.value = a, me.value += 1;
    }
    function Ie() {
      _.value.showTable = !_.value.showTable;
    }
    function Fe() {
      _.value.dataLabels.show = !_.value.dataLabels.show;
    }
    function Ve() {
      _.value.showTooltip = !_.value.showTooltip;
    }
    function ut() {
      return m.value;
    }
    const De = p(() => {
      if (m.value.length === 0) return { head: [], body: [], config: {}, columnNames: [] };
      const a = m.value.map(({ name: t, color: l }) => ({
        label: t,
        color: l
      })), o = [];
      for (let t = c.value.start; t < c.value.end; t += 1) {
        const l = [e.value.style.chart.grid.x.timeLabels.values[t] || t + 1];
        P.value.forEach((i) => {
          l.push(Number((i.series[t] || 0).toFixed(e.value.table.td.roundingValue)));
        }), o.push(l);
      }
      return { head: a, body: o };
    });
    function Ee() {
      const a = [[e.value.style.chart.title.text], [e.value.style.chart.title.subtitle.text], [""]], o = ["", ...De.value.head.map((u) => u.label)], t = De.value.body, l = a.concat([o]).concat(t), i = Ot(l);
      Pt({ csvContent: i, title: e.value.style.chart.title.text || "vue-ui-stackbar" });
    }
    const le = p(() => {
      const a = [""].concat(m.value.map((i) => i.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 o = [];
      for (let i = 0; i < A.value; i += 1) {
        const u = m.value.map((w) => w.series[i] ?? 0).reduce((w, R) => w + R, 0);
        o.push([e.value.style.chart.grid.x.timeLabels.values.slice(c.value.start, c.value.end)[i] ?? i + 1].concat(m.value.map((w) => (w.series[i] ?? 0).toFixed(e.value.table.td.roundingValue))).concat((u ?? 0).toFixed(e.value.table.td.roundingValue)));
      }
      const t = {
        th: {
          backgroundColor: e.value.table.th.backgroundColor,
          color: e.value.table.th.color,
          outline: e.value.table.th.outline
        },
        td: {
          backgroundColor: e.value.table.td.backgroundColor,
          color: e.value.table.td.color,
          outline: e.value.table.td.outline
        },
        breakpoint: e.value.table.responsiveBreakpoint
      }, l = [e.value.table.columnNames.period].concat(m.value.map((i) => i.name)).concat(e.value.table.columnNames.total);
      return { head: a, body: o.slice(0, c.value.end - c.value.start), config: t, colNames: l };
    });
    function ct(a, o) {
      if (be("selectLegend", m.value.find((t) => t.absoluteIndex === a)), L.value.includes(o.id))
        L.value = L.value.filter((t) => t !== o.id);
      else {
        if (L.value.length === P.value.length - 1) return;
        L.value.push(o.id);
      }
    }
    const He = p(() => P.value.map((a, o) => ({
      ...a,
      shape: "square"
    })).map((a) => ({
      ...a,
      opacity: L.value.includes(a.id) ? 0.5 : 1,
      segregate: () => ct(a.absoluteIndex, a),
      isSegregated: L.value.includes(a.id)
    }))), vt = p(() => ({
      cy: "stackbar-legend",
      backgroundColor: e.value.style.chart.legend.backgroundColor,
      color: e.value.style.chart.legend.color,
      fontSize: e.value.style.chart.legend.fontSize,
      paddingBottom: 12,
      fontWeight: e.value.style.chart.legend.bold ? "bold" : ""
    })), oe = g(!1);
    function de() {
      oe.value = !oe.value;
    }
    return tt({
      getData: ut,
      generatePdf: Se,
      generateCsv: Ee,
      generateImage: $e,
      toggleTable: Ie,
      toggleLabels: Fe,
      toggleTooltip: Ve,
      toggleAnnotator: de
    }), (a, o) => (s(), n("div", {
      id: `stackbar_${ue.value}`,
      ref_key: "stackbarChart",
      ref: X,
      class: ye({ "vue-ui-stackbar": !0, "vue-data-ui-wrapper-fullscreen": ve.value }),
      style: U(`background:${e.value.style.chart.backgroundColor};color:${e.value.style.chart.color};font-family:${e.value.style.fontFamily}; position: relative; ${e.value.responsive ? "height: 100%" : ""}`)
    }, [
      e.value.userOptions.buttons.annotator ? (s(), Y(Yt, {
        key: 0,
        parent: X.value,
        backgroundColor: e.value.style.chart.backgroundColor,
        color: e.value.style.chart.color,
        active: oe.value,
        onClose: de
      }, null, 8, ["parent", "backgroundColor", "color", "active"])) : v("", !0),
      k(a.$slots, "userConfig", {}, void 0, !0),
      e.value.style.chart.title.text ? (s(), n("div", {
        key: 1,
        ref_key: "chartTitle",
        ref: pe,
        style: "width:100%;background:transparent;padding-bottom:24px"
      }, [
        se(Et, {
          config: {
            title: {
              cy: "stackbar-title",
              ...e.value.style.chart.title
            },
            subtitle: {
              cy: "stackbar-subtitle",
              ...e.value.style.chart.title.subtitle
            }
          }
        }, null, 8, ["config"])
      ], 512)) : v("", !0),
      e.value.userOptions.show && W.value ? (s(), Y(Ft, {
        ref: "details",
        key: `user_option_${me.value}`,
        backgroundColor: e.value.style.chart.backgroundColor,
        color: e.value.style.chart.color,
        isPrinting: z(ze),
        isImaging: z(Le),
        uid: ue.value,
        hasTooltip: e.value.style.chart.tooltip.show && e.value.userOptions.buttons.tooltip,
        hasPdf: e.value.userOptions.buttons.pdf,
        hasImg: e.value.userOptions.buttons.img,
        hasXls: e.value.userOptions.buttons.csv,
        hasTable: e.value.userOptions.buttons.table,
        hasLabel: e.value.userOptions.buttons.labels,
        hasFullscreen: e.value.userOptions.buttons.fullscreen,
        isFullscreen: ve.value,
        chartElement: X.value,
        position: e.value.userOptions.position,
        isTooltip: _.value.showTooltip,
        titles: { ...e.value.userOptions.buttonTitles },
        hasAnnotator: e.value.userOptions.buttons.annotator,
        isAnnotation: oe.value,
        onToggleFullscreen: nt,
        onGeneratePdf: z(Se),
        onGenerateCsv: Ee,
        onGenerateImage: z($e),
        onToggleTable: Ie,
        onToggleLabels: Fe,
        onToggleTooltip: Ve,
        onToggleAnnotator: de
      }, xt({ _: 2 }, [
        a.$slots.optionTooltip ? {
          name: "optionTooltip",
          fn: C(() => [
            k(a.$slots, "optionTooltip", {}, void 0, !0)
          ]),
          key: "0"
        } : void 0,
        a.$slots.optionPdf ? {
          name: "optionPdf",
          fn: C(() => [
            k(a.$slots, "optionPdf", {}, void 0, !0)
          ]),
          key: "1"
        } : void 0,
        a.$slots.optionCsv ? {
          name: "optionCsv",
          fn: C(() => [
            k(a.$slots, "optionCsv", {}, void 0, !0)
          ]),
          key: "2"
        } : void 0,
        a.$slots.optionImg ? {
          name: "optionImg",
          fn: C(() => [
            k(a.$slots, "optionImg", {}, void 0, !0)
          ]),
          key: "3"
        } : void 0,
        a.$slots.optionTable ? {
          name: "optionTable",
          fn: C(() => [
            k(a.$slots, "optionTable", {}, void 0, !0)
          ]),
          key: "4"
        } : void 0,
        a.$slots.optionLabels ? {
          name: "optionLabels",
          fn: C(() => [
            k(a.$slots, "optionLabels", {}, void 0, !0)
          ]),
          key: "5"
        } : void 0,
        a.$slots.optionFullscreen ? {
          name: "optionFullscreen",
          fn: C(({ toggleFullscreen: t, isFullscreen: l }) => [
            k(a.$slots, "optionFullscreen", D(E({ toggleFullscreen: t, isFullscreen: l })), void 0, !0)
          ]),
          key: "6"
        } : void 0,
        a.$slots.optionAnnotator ? {
          name: "optionAnnotator",
          fn: C(({ toggleAnnotator: t, isAnnotator: l }) => [
            k(a.$slots, "optionAnnotator", D(E({ toggleAnnotator: t, isAnnotator: l })), void 0, !0)
          ]),
          key: "7"
        } : void 0
      ]), 1032, ["backgroundColor", "color", "isPrinting", "isImaging", "uid", "hasTooltip", "hasPdf", "hasImg", "hasXls", "hasTable", "hasLabel", "hasFullscreen", "isFullscreen", "chartElement", "position", "isTooltip", "titles", "hasAnnotator", "isAnnotation", "onGeneratePdf", "onGenerateImage"])) : v("", !0),
      W.value ? (s(), n("svg", {
        key: 3,
        xmlns: z(Mt),
        viewBox: `0 0 ${r.value.chartWidth <= 0 ? 10 : r.value.chartWidth} ${r.value.chartHeight <= 0 ? 10 : r.value.chartHeight}`,
        style: U(`max-width:100%;overflow:visible;background:transparent;color:${e.value.style.chart.color}`)
      }, [
        se(Ut),
        e.value.style.chart.bars.gradient.show ? (s(), n("defs", Zt, [
          (s(!0), n(h, null, f(m.value, (t, l) => (s(), n("linearGradient", {
            id: `gradient_${t.id}`,
            x1: "0%",
            y1: "0%",
            x2: "0%",
            y2: "100%"
          }, [
            H("stop", {
              offset: "0%",
              "stop-color": t.color
            }, null, 8, Qt),
            H("stop", {
              offset: "61.8%",
              "stop-color": z(Tt)(t.color, e.value.style.chart.bars.gradient.intensity / 100)
            }, null, 8, jt),
            H("stop", {
              offset: "100%",
              "stop-color": t.color
            }, null, 8, ea)
          ], 8, Kt))), 256))
        ])) : v("", !0),
        e.value.style.chart.grid.x.showHorizontalLines && e.value.orientation === "vertical" ? (s(!0), n(h, { key: 1 }, f(N.value, (t, l) => (s(), n("line", {
          x1: r.value.left,
          x2: r.value.right,
          y1: t.y,
          y2: t.y,
          stroke: e.value.style.chart.grid.x.axisColor,
          "stroke-width": 1,
          "stroke-linecap": "round"
        }, null, 8, ta))), 256)) : v("", !0),
        e.value.style.chart.grid.x.showHorizontalLines && e.value.orientation === "horizontal" ? (s(!0), n(h, { key: 2 }, f(c.value.end - c.value.start + 1, (t, l) => (s(), n("line", {
          x1: r.value.left,
          x2: r.value.right,
          y1: r.value.top + d.value * l,
          y2: r.value.top + d.value * l,
          stroke: e.value.style.chart.grid.y.axisColor,
          "stroke-width": 1,
          "stroke-linecap": "round"
        }, null, 8, aa))), 256)) : v("", !0),
        e.value.style.chart.grid.y.showVerticalLines && e.value.orientation === "vertical" ? (s(!0), n(h, { key: 3 }, f(c.value.end - c.value.start + 1, (t, l) => (s(), n("line", {
          x1: r.value.left + d.value * l,
          x2: r.value.left + d.value * l,
          y1: r.value.top,
          y2: r.value.bottom,
          stroke: e.value.style.chart.grid.y.axisColor,
          "stroke-width": 1,
          "stroke-linecap": "round"
        }, null, 8, la))), 256)) : v("", !0),
        e.value.style.chart.grid.x.showHorizontalLines && e.value.orientation === "horizontal" ? (s(!0), n(h, { key: 4 }, f(N.value, (t, l) => (s(), n("line", {
          x1: t.horizontal_x,
          x2: t.horizontal_x,
          y1: r.value.top,
          y2: r.value.bottom,
          stroke: e.value.style.chart.grid.x.axisColor,
          "stroke-width": 1,
          "stroke-linecap": "round"
        }, null, 8, oa))), 256)) : v("", !0),
        (s(!0), n(h, null, f(m.value, (t, l) => (s(), n("g", null, [
          e.value.orientation === "vertical" ? (s(!0), n(h, { key: 0 }, f(t.x, (i, u) => (s(), n("rect", {
            x: i,
            y: t.y[u] < 0 ? 0 : t.y[u],
            height: t.height[u] < 0 ? 1e-4 : t.height[u],
            rx: e.value.style.chart.bars.borderRadius > t.height[u] / 2 ? (t.height[u] < 0 ? 0 : t.height[u]) / 2 : e.value.style.chart.bars.borderRadius,
            width: d.value * (1 - e.value.style.chart.bars.gapRatio / 2),
            fill: e.value.style.chart.bars.gradient.show ? `url(#gradient_${t.id})` : t.color,
            stroke: e.value.style.chart.backgroundColor,
            "stroke-width": e.value.style.chart.bars.strokeWidth,
            "stroke-linecap": "round",
            "stroke-linejoin": "round",
            class: ye({ "vue-data-ui-bar-animated": e.value.useCssAnimation, "vue-data-ui-bar-transition": J.value })
          }, null, 10, ra))), 256)) : (s(!0), n(h, { key: 1 }, f(t.horizontal_x, (i, u) => (s(), n("rect", {
            x: i,
            y: t.horizontal_y[u] < 0 ? 0 : t.horizontal_y[u],
            width: t.horizontal_width[u] < 0 ? 1e-4 : t.horizontal_width[u],
            rx: e.value.style.chart.bars.borderRadius > t.height[u] / 2 ? (t.height[u] < 0 ? 0 : t.height[u]) / 2 : e.value.style.chart.bars.borderRadius,
            height: d.value * (1 - e.value.style.chart.bars.gapRatio / 2),
            fill: e.value.style.chart.bars.gradient.show ? `url(#gradient_${t.id})` : t.color,
            stroke: e.value.style.chart.backgroundColor,
            "stroke-width": e.value.style.chart.bars.strokeWidth,
            "stroke-linecap": "round",
            "stroke-linejoin": "round",
            class: ye({ "vue-data-ui-bar-animated": e.value.useCssAnimation, "vue-data-ui-bar-transition": J.value })
          }, null, 10, sa))), 256))
        ]))), 256)),
        e.value.style.chart.grid.x.showAxis ? (s(), n("line", {
          key: 5,
          x1: r.value.left,
          x2: r.value.right,
          y1: r.value.bottom,
          y2: r.value.bottom,
          stroke: e.value.style.chart.grid.x.axisColor,
          "stroke-width": e.value.style.chart.grid.x.axisThickness,
          "stroke-linecap": "round",
          "stroke-linejoin": "round"
        }, null, 8, ia)) : v("", !0),
        e.value.style.chart.grid.y.showAxis && !e.value.style.chart.bars.distributed ? (s(), n("line", {
          key: 6,
          x1: r.value.left,
          x2: r.value.left,
          y1: r.value.top,
          y2: r.value.bottom,
          stroke: e.value.style.chart.grid.y.axisColor,
          "stroke-width": e.value.style.chart.grid.y.axisThickness,
          "stroke-linecap": "round",
          "stroke-linejoin": "round"
        }, null, 8, na)) : v("", !0),
        e.value.style.chart.grid.x.axisName.show && e.value.style.chart.grid.x.axisName.text ? (s(), n("text", {
          key: 7,
          x: r.value.left + r.value.width / 2,
          y: r.value.chartHeight + e.value.style.chart.grid.x.axisName.offsetY,
          "font-size": e.value.style.chart.grid.x.axisName.fontSize,
          fill: e.value.style.chart.grid.x.axisName.color,
          "font-weight": e.value.style.chart.grid.x.axisName.bold ? "bold" : "normal",
          "text-anchor": "middle"
        }, S(e.value.style.chart.grid.x.axisName.text), 9, ua)) : v("", !0),
        e.value.style.chart.grid.y.axisName.show && e.value.style.chart.grid.y.axisName.text ? (s(), n("text", {
          key: 8,
          transform: `translate(${e.value.style.chart.grid.y.axisName.fontSize + e.value.style.chart.grid.y.axisName.offsetX}, ${r.value.top + r.value.height / 2}) rotate(-90)`,
          "font-size": e.value.style.chart.grid.y.axisName.fontSize,
          fill: e.value.style.chart.grid.y.axisName.color,
          "font-weight": e.value.style.chart.grid.y.axisName.bold ? "bold" : "normal",
          "text-anchor": "middle"
        }, S(e.value.style.chart.grid.y.axisName.text), 9, ca)) : v("", !0),
        _.value.dataLabels.show && e.value.orientation === "vertical" ? (s(), n(h, { key: 9 }, [
          (s(!0), n(h, null, f(m.value, (t, l) => (s(), n("g", null, [
            (s(!0), n(h, null, f(t.x, (i, u) => (s(), n("text", {
              x: i + d.value * (1 - e.value.style.chart.bars.gapRatio / 2) / 2,
              y: t.y[u] + t.height[u] / 2 + e.value.style.chart.bars.dataLabels.fontSize / 3,
              "font-size": e.value.style.chart.bars.dataLabels.fontSize,
              fill: e.value.style.chart.bars.dataLabels.adaptColorToBackground ? z(Ke)(t.color) : e.value.style.chart.bars.dataLabels.color,
              "font-weight": e.value.style.chart.bars.dataLabels.bold ? "bold" : "normal",
              "text-anchor": "middle"
            }, S(e.value.style.chart.bars.showDistributedPercentage && e.value.style.chart.bars.distributed ? Pe(t.proportions[u] * 100, t, l, u) : ae(t.series[u], t, l, u, t.signedSeries[u])), 9, va))), 256))
          ]))), 256)),
          e.value.style.chart.bars.totalValues.show && m.value.length > 1 ? (s(), n("g", ha, [
            (s(!0), n(h, null, f(Oe.value, (t, l) => (s(), n("text", {
              x: r.value.left + d.value * l + d.value / 2,
              y: r.value.top - e.value.style.chart.bars.totalValues.fontSize / 3,
              "text-anchor": "middle",
              "font-size": e.value.style.chart.bars.totalValues.fontSize,
              "font-weight": e.value.style.chart.bars.totalValues.bold ? "bold" : "normal",
              fill: e.value.style.chart.bars.totalValues.color
            }, S(ae(t.value, t, l, t.sign)), 9, da))), 256))
          ])) : v("", !0)
        ], 64)) : v("", !0),
        _.value.dataLabels.show && e.value.orientation === "horizontal" ? (s(), n(h, { key: 10 }, [
          (s(!0), n(h, null, f(m.value, (t, l) => (s(), n("g", null, [
            (s(!0), n(h, null, f(t.horizontal_x, (i, u) => (s(), n("text", {
              x: i + (t.horizontal_width[u] < 0 ? 1e-4 : t.horizontal_width[u]) / 2,
              y: t.horizontal_y[u] + d.value * (1 - e.value.style.chart.bars.gapRatio / 2) / 2 + e.value.style.chart.bars.dataLabels.fontSize / 3,
              "font-size": e.value.style.chart.bars.dataLabels.fontSize,
              fill: e.value.style.chart.bars.dataLabels.adaptColorToBackground ? z(Ke)(t.color) : e.value.style.chart.bars.dataLabels.color,
              "font-weight": e.value.style.chart.bars.dataLabels.bold ? "bold" : "normal",
              "text-anchor": "middle"
            }, S(e.value.style.chart.bars.showDistributedPercentage && e.value.style.chart.bars.distributed ? Pe(t.proportions[u] * 100, t, l, u) : ae(t.series[u], t, l, u, t.signedSeries[u])), 9, ya))), 256))
          ]))), 256)),
          e.value.style.chart.bars.totalValues.show && m.value.length > 1 ? (s(), n("g", ga, [
            (s(!0), n(h, null, f(Oe.value, (t, l) => (s(), n("text", {
              x: r.value.right + e.value.style.chart.bars.totalValues.fontSize / 3,
              y: r.value.top + d.value * l + d.value / 2,
              "text-anchor": "start",
              "font-size": e.value.style.chart.bars.totalValues.fontSize,
              "font-weight": e.value.style.chart.bars.totalValues.bold ? "bold" : "normal",
              fill: e.value.style.chart.bars.totalValues.color
            }, S(ae(t.value, t, l, t.sign)), 9, ba))), 256))
          ])) : v("", !0)
        ], 64)) : v("", !0),
        e.value.style.chart.grid.y.axisLabels.show && !e.value.style.chart.bars.distributed && e.value.orientation === "vertical" ? (s(), n(h, { key: 11 }, [
          (s(!0), n(h, null, f(N.value, (t, l) => (s(), n("line", {
            x1: r.value.left,
            x2: r.value.left - 6,
            y1: t.y,
            y2: t.y,
            stroke: e.value.style.chart.grid.x.axisColor,
            "stroke-width": 1
          }, null, 8, fa))), 256)),
          (s(!0), n(h, null, f(N.value, (t, l) => (s(), n("text", {
            x: t.x,
            y: t.y + e.value.style.chart.grid.y.axisLabels.fontSize / 3,
            "font-size": e.value.style.chart.grid.y.axisLabels.fontSize,
            "font-weight": e.value.style.chart.grid.y.axisLabels.bold ? "bold" : "normal",
            fill: e.value.style.chart.grid.y.axisLabels.color,
            "text-anchor": "end"
          }, S(z(B)({
            p: e.value.style.chart.bars.dataLabels.prefix,
            v: t.value,
            s: e.value.style.chart.bars.dataLabels.suffix,
            r: e.value.style.chart.grid.y.axisLabels.rounding
          })), 9, ma))), 256))
        ], 64)) : v("", !0),
        e.value.style.chart.grid.y.axisLabels.show && !e.value.style.chart.bars.distributed && e.value.orientation === "horizontal" ? (s(), n(h, { key: 12 }, [
          (s(!0), n(h, null, f(N.value, (t, l) => (s(), n("line", {
            x1: t.horizontal_x,
            x2: t.horizontal_x,
            y1: r.value.bottom,
            y2: r.value.bottom + 6,
            stroke: e.value.style.chart.grid.x.axisColor,
            "stroke-width": 1,
            "stroke-linecap": "round"
          }, null, 8, pa))), 256)),
          (s(!0), n(h, null, f(N.value, (t, l) => (s(), n("text", {
            "font-size": e.value.style.chart.grid.x.timeLabels.fontSize,
            "font-weight": e.value.style.chart.grid.y.axisLabels.bold ? "bold" : "normal",
            fill: e.value.style.chart.grid.y.axisLabels.color,
            "text-anchor": e.value.style.chart.grid.x.timeLabels.rotation > 0 ? "start" : e.value.style.chart.grid.x.timeLabels.rotation < 0 ? "end" : "middle",
            transform: `translate(${t.horizontal_x}, ${r.value.bottom + e.value.style.chart.grid.x.timeLabels.fontSize * 1.3 + e.value.style.chart.grid.x.timeLabels.offsetY}), rotate(${e.value.style.chart.grid.x.timeLabels.rotation})`
          }, S(z(B)({
            p: e.value.style.chart.bars.dataLabels.prefix,
            v: t.value,
            s: e.value.style.chart.bars.dataLabels.suffix,
            r: e.value.style.chart.grid.y.axisLabels.rounding
          })), 9, xa))), 256))
        ], 64)) : v("", !0),
        e.value.style.chart.grid.x.timeLabels.show && e.value.orientation === "vertical" ? (s(!0), n(h, { key: 13 }, f(Z.value, (t, l) => (s(), n("text", {
          "text-anchor": e.value.style.chart.grid.x.timeLabels.rotation > 0 ? "start" : e.value.style.chart.grid.x.timeLabels.rotation < 0 ? "end" : "middle",
          "font-size": e.value.style.chart.grid.x.timeLabels.fontSize,
          "font-weight": e.value.style.chart.grid.x.timeLabels.bold ? "bold" : "normal",
          fill: e.value.style.chart.grid.x.timeLabels.color,
          transform: `translate(${r.value.left + d.value * l + d.value / 2}, ${r.value.bottom + e.value.style.chart.grid.x.timeLabels.fontSize * 1.3 + e.value.style.chart.grid.x.timeLabels.offsetY}), rotate(${e.value.style.chart.grid.x.timeLabels.rotation})`
        }, S(t), 9, ka))), 256)) : v("", !0),
        e.value.style.chart.grid.x.timeLabels.show && e.value.orientation === "horizontal" ? (s(!0), n(h, { key: 14 }, f(Z.value, (t, l) => (s(), n("text", {
          "text-anchor": "end",
          "font-size": e.value.style.chart.grid.y.axisLabels.fontSize,
          "font-weight": e.value.style.chart.grid.y.axisLabels.bold ? "bold" : "normal",
          fill: e.value.style.chart.grid.y.axisLabels.color,
          x: r.value.left - 8,
          y: r.value.top + d.value * l + d.value / 2 + e.value.style.chart.grid.y.axisLabels.fontSize / 3
        }, S(t), 9, wa))), 256)) : v("", !0),
        _.value.showTooltip && e.value.orientation === "vertical" ? (s(!0), n(h, { key: 15 }, f(c.value.end - c.value.start, (t, l) => (s(), n("rect", {
          x: r.value.left + l * d.value,
          y: r.value.top,
          width: d.value,
          height: r.value.height < 0 ? 0 : r.value.height,
          onClick: (i) => Ae(l),
          onMouseenter: (i) => Re(l),
          onMouseleave: o[0] || (o[0] = (i) => {
            G.value = null, j.value = !1;
          }),
          fill: l === G.value ? e.value.style.chart.highlighter.color : "transparent",
          style: U({ opacity: e.value.style.chart.highlighter.opacity / 100 })
        }, null, 44, Ca))), 256)) : v("", !0),
        _.value.showTooltip && e.value.orientation === "horizontal" ? (s(!0), n(h, { key: 16 }, f(c.value.end - c.value.start, (t, l) => (s(), n("rect", {
          x: r.value.left,
          y: r.value.top + l * d.value,
          width: r.value.width < 0 ? 0 : r.value.width,
          height: d.value,
          onClick: (i) => Ae(l),
          onMouseenter: (i) => Re(l),
          onMouseleave: o[1] || (o[1] = (i) => {
            G.value = null, j.value = !1;
          }),
          fill: l === G.value ? e.value.style.chart.highlighter.color : "transparent",
          style: U({ opacity: e.value.style.chart.highlighter.opacity / 100 })
        }, null, 44, _a))), 256)) : v("", !0),
        k(a.$slots, "svg", D(E({ ...r.value })), void 0, !0)
      ], 12, qt)) : v("", !0),
      a.$slots.watermark ? (s(), n("div", za, [
        k(a.$slots, "watermark", D(E({ isPrinting: z(ze) || z(Le) })), void 0, !0)
      ])) : v("", !0),
      W.value ? v("", !0) : (s(), Y(Xt, {
        key: 5,
        config: {
          type: "bar",
          style: {
            backgroundColor: e.value.style.chart.backgroundColor,
            bar: {
              axis: {
                color: "#CCCCCC"
              },
              color: "#CCCCCC"
            }
          }
        }
      }, null, 8, ["config"])),
      H("div", {
        ref_key: "chartSlicer",
        ref: ke,
        style: U(`width:100%;background:${e.value.style.chart.backgroundColor}`),
        "data-html2canvas-ignore": ""
      }, [
        e.value.style.chart.zoom.show && A.value > 1 ? (s(), Y(Vt, {
          key: `slicer_${Ce.value}`,
          background: e.value.style.chart.zoom.color,
          borderColor: e.value.style.chart.backgroundColor,
          fontSize: e.value.style.chart.zoom.fontSize,
          useResetSlot: e.value.style.chart.zoom.useResetSlot,
          labelLeft: e.value.style.chart.grid.x.timeLabels.values[c.value.start] ? e.value.style.chart.grid.x.timeLabels.values[c.value.start] : "",
          labelRight: e.value.style.chart.grid.x.timeLabels.values[c.value.end - 1] ? e.value.style.chart.grid.x.timeLabels.values[c.value.end - 1] : "",
          textColor: e.value.style.chart.color,
          inputColor: e.value.style.chart.zoom.color,
          selectColor: e.value.style.chart.zoom.highlightColor,
          max: Math.max(...ge.dataset.map((t) => t.series.length)),
          min: 0,
          valueStart: c.value.start,
          valueEnd: c.value.end,
          start: c.value.start,
          "onUpdate:start": o[2] || (o[2] = (t) => c.value.start = t),
          end: c.value.end,
          "onUpdate:end": o[3] || (o[3] = (t) => c.value.end = t),
          onReset: Ne
        }, {
          "reset-action": C(({ reset: t }) => [
            k(a.$slots, "reset-action", D(E({ reset: t })), void 0, !0)
          ]),
          _: 3
        }, 8, ["background", "borderColor", "fontSize", "useResetSlot", "labelLeft", "labelRight", "textColor", "inputColor", "selectColor", "max", "valueStart", "valueEnd", "start", "end"])) : v("", !0)
      ], 4),
      se(Dt, {
        show: _.value.showTooltip && j.value,
        backgroundColor: e.value.style.chart.tooltip.backgroundColor,
        color: e.value.style.chart.tooltip.color,
        fontSize: e.value.style.chart.tooltip.fontSize,
        borderRadius: e.value.style.chart.tooltip.borderRadius,
        borderColor: e.value.style.chart.tooltip.borderColor,
        borderWidth: e.value.style.chart.tooltip.borderWidth,
        backgroundOpacity: e.value.style.chart.tooltip.backgroundOpacity,
        position: e.value.style.chart.tooltip.position,
        offsetY: e.value.style.chart.tooltip.offsetY,
        parent: X.value,
        content: ce.value,
        isCustom: z(Qe)(e.value.style.chart.tooltip.customFormat)
      }, {
        "tooltip-before": C(() => [
          k(a.$slots, "tooltip-before", D(E({ ...fe.value })), void 0, !0)
        ]),
        "tooltip-after": C(() => [
          k(a.$slots, "tooltip-after", D(E({ ...fe.value })), void 0, !0)
        ]),
        _: 3
      }, 8, ["show", "backgroundColor", "color", "fontSize", "borderRadius", "borderColor", "borderWidth", "backgroundOpacity", "position", "offsetY", "parent", "content", "isCustom"]),
      H("div", {
        ref_key: "chartLegend",
        ref: xe
      }, [
        e.value.style.chart.legend.show && W.value ? (s(), Y(Ht, {
          key: 0,
          legendSet: He.value,
          config: vt.value,
          onClickMarker: o[4] || (o[4] = ({ legend: t }) => t.segregate())
        }, {
          item: C(({ legend: t }) => [
            H("div", {
              onClick: (l) => t.segregate(),
              style: U(`opacity:${L.value.includes(t.id) ? 0.5 : 1}`)
            }, S(t.name), 13, La)
          ]),
          _: 1
        }, 8, ["legendSet", "config"])) : k(a.$slots, "legend", {
          key: 1,
          legend: He.value
        }, void 0, !0)
      ], 512),
      a.$slots.source ? (s(), n("div", {
        key: 6,
        ref_key: "source",
        ref: we,
        dir: "auto"
      }, [
        k(a.$slots, "source", {}, void 0, !0)
      ], 512)) : v("", !0),
      c.value.end - c.value.start < 200 ? (s(), Y(Bt, {
        key: 7,
        hideDetails: "",
        config: {
          open: _.value.showTable,
          maxHeight: 1e4,
          body: {
            backgroundColor: e.value.style.chart.backgroundColor,
            color: e.value.style.chart.color
          },
          head: {
            backgroundColor: e.value.style.chart.backgroundColor,
            color: e.value.style.chart.color
          }
        }
      }, {
        content: C(() => [
          se(Wt, {
            colNames: le.value.colNames,
            head: le.value.head,
            body: le.value.body,
            config: le.value.config,
            title: `${e.value.style.chart.title.text}${e.value.style.chart.title.subtitle.text ? ` : ${e.value.style.chart.title.subtitle.text}` : ""}`,
            onClose: o[5] || (o[5] = (t) => _.value.showTable = !1)
          }, {
            th: C(({ th: t }) => [
              H("div", { innerHTML: t }, null, 8, Sa)
            ]),
            td: C(({ td: t }) => [
              kt(S(isNaN(Number(t)) ? t : z(B)({
                p: e.value.style.chart.bars.dataLabels.prefix,
                v: t,
                s: e.value.style.chart.bars.dataLabels.suffix,
                r: e.value.table.td.roundingValue
              })), 1)
            ]),
            _: 1
          }, 8, ["colNames", "head", "body", "config", "title"])
        ]),
        _: 1
      }, 8, ["config"])) : v("", !0)
    ], 14, Jt));
  }
}, Xa = /* @__PURE__ */ Gt($a, [["__scopeId", "data-v-d80dd138"]]);
export {
  Xa as default
};
