import { computed as b, ref as y, onMounted as fe, openBlock as i, createElementBlock as r, normalizeClass as le, normalizeStyle as B, createVNode as E, createCommentVNode as h, createBlock as W, unref as d, createSlots as ce, withCtx as g, renderSlot as p, normalizeProps as P, guardReactiveProps as N, createElementVNode as n, Fragment as L, renderList as I, toDisplayString as w, createTextVNode as ae, nextTick as ge } from "vue";
import { u as pe, c as be, t as xe, o as me, e as we, s as v, X as ke, v as oe, w as X, i as k, f as _, x as _e, y as $e, q as Ce, r as Te } from "./index-CguVaFlt.js";
import { t as Le, u as Ae } from "./useResponsive-NZB-WLRF.js";
import { _ as Se } from "./Title-DbTGPg4G.js";
import { u as ze, U as Ie } from "./usePrinter-ClsMRVJG.js";
import { _ as Fe } from "./Tooltip-u79R5W5y.js";
import { D as Me } from "./DataTable-BwHWRlRZ.js";
import Oe from "./vue-ui-skeleton-ChHLL5Hw.js";
import Pe from "./vue-ui-accordion-w15FGKRN.js";
import { u as se } from "./useNestedProp-BbEbJmgv.js";
import { _ as Ne } from "./_plugin-vue_export-helper-CHgC5LLL.js";
const Re = ["id"], De = ["xmlns", "viewBox"], Ge = ["id"], Be = ["stop-color"], Ee = ["stop-color"], We = ["id"], Xe = ["stop-color"], Ue = ["stop-color"], Ve = ["x", "y", "width", "height", "fill", "rx"], Ye = ["x", "y", "width", "height", "fill", "rx"], je = ["x", "y", "width", "height", "fill", "rx"], He = ["x", "y", "width", "height", "fill", "rx"], qe = { key: 0 }, Je = ["x", "y", "fill", "font-size", "font-weight"], Ke = ["x", "y", "fill", "font-size", "font-weight"], Qe = { key: 1 }, Ze = ["x", "y", "font-size", "fill", "font-weight"], et = { key: 2 }, tt = { key: 0 }, lt = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], at = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], ot = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], st = ["x", "y", "font-size", "fill", "font-weight"], it = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], ut = ["x", "y", "font-size", "fill", "font-weight"], rt = ["x", "y", "font-size", "fill", "font-weight"], nt = ["x", "y", "width", "height", "fill", "onMouseover"], dt = {
  key: 3,
  class: "vue-data-ui-watermark"
}, vt = {
  __name: "vue-ui-age-pyramid",
  props: {
    config: {
      type: Object,
      default() {
        return {};
      }
    },
    dataset: {
      type: Array,
      default() {
        return [];
      }
    }
  },
  setup(U, { expose: ie }) {
    const c = U, { vue_ui_age_pyramid: ue } = pe(), F = b(() => !!c.dataset && c.dataset.length), x = y(be()), re = y(null), R = y(!1), D = y(""), M = y(null), V = y(0), A = y(null), Y = y(null), e = b(() => {
      const t = se({
        userConfig: c.config,
        defaultConfig: ue
      });
      return t.theme ? {
        ...se({
          userConfig: xe.vue_ui_age_pyramid[t.theme] || c.config,
          defaultConfig: t
        })
      } : t;
    }), j = y(null);
    fe(() => {
      if (me(c.dataset) && we({
        componentName: "VueUiAgePyramid",
        type: "dataset"
      }), e.value.responsive) {
        const t = Le(() => {
          const { width: s, height: l } = Ae({
            chart: A.value,
            title: e.value.style.title.text ? Y.value : null
          });
          f.value.width = s, f.value.height = l;
        });
        j.value = new ResizeObserver(t), j.value.observe(A.value.parentNode);
      }
    });
    const { isPrinting: H, isImaging: q, generatePdf: J, generateImage: K } = ze({
      elementId: `vue-ui-age-pyramid_${x.value}`,
      fileName: e.value.style.title.text || "vue-ui-age-pyramid"
    }), m = y({
      showTable: e.value.table.show,
      showTooltip: e.value.style.tooltip.show
    }), f = y({
      height: e.value.style.height,
      width: e.value.style.width
    }), o = b(() => {
      const t = f.value.width - e.value.style.layout.padding.right - e.value.style.layout.padding.left, s = e.value.style.layout.padding.left, l = f.value.width - e.value.style.layout.padding.right;
      return {
        top: e.value.style.layout.padding.top,
        left: s,
        right: l,
        bottom: f.value.height - e.value.style.layout.padding.bottom,
        width: t,
        height: f.value.height - e.value.style.layout.padding.top - e.value.style.layout.padding.bottom,
        centerX: e.value.style.layout.padding.left + t / 2,
        leftChart: {
          width: t / 2 - e.value.style.layout.centerSlit.width,
          right: s + t / 2 - e.value.style.layout.centerSlit.width
        },
        rightChart: {
          width: t / 2 - e.value.style.layout.centerSlit.width,
          left: s + t / 2 + e.value.style.layout.centerSlit.width
        }
      };
    }), ne = b(() => c.dataset.map((t) => e.value.style.layout.dataLabels.yAxis.display === "age" ? t[1] : t[0])), $ = b(() => {
      const t = de(S.value / 5), s = [], l = [];
      for (let a = 0; a <= 5; a += 1) {
        const u = t * a, te = t * (a - 5);
        s.push({
          value: u,
          x: o.value.left + o.value.width / 2 + e.value.style.layout.centerSlit.width + u / S.value * o.value.leftChart.width
        }), l.push({
          value: Math.abs(te),
          x: o.value.left + o.value.width / 2 + te / S.value * o.value.leftChart.width - e.value.style.layout.centerSlit.width
        });
      }
      return {
        right: s,
        left: l
      };
    });
    function de(t) {
      if (t === 0) return 0;
      const l = 10 ** Math.floor(Math.log10(Math.abs(t)));
      let a;
      return t < 0, a = Math.round(t / l) * l, a;
    }
    const S = b(() => Math.max(...c.dataset.flatMap((t) => t.slice(-2).map((s) => v(s))))), C = b(() => c.dataset.length), ve = b(() => c.dataset.map((t) => ({
      segment: t[0],
      age: t[1],
      left: {
        value: t[2],
        proportionToMax: t[2] / S.value
      },
      right: {
        value: t[3],
        proportionToMax: t[3] / S.value
      }
    }))), T = b(() => ve.value.map((t, s) => {
      const l = o.value.top + o.value.height / C.value * s, a = o.value.height / C.value - e.value.style.layout.bars.gap;
      return {
        segment: t.segment,
        age: t.age,
        left: {
          ...t.left,
          y: l,
          color: e.value.style.layout.bars.left.color,
          x: o.value.leftChart.right - t.left.proportionToMax * o.value.leftChart.width,
          width: v(t.left.proportionToMax * o.value.leftChart.width),
          height: a
        },
        right: {
          ...t.right,
          y: l,
          color: e.value.style.layout.bars.right.color,
          x: o.value.rightChart.left,
          width: v(t.right.proportionToMax * o.value.rightChart.width),
          height: a
        }
      };
    })), G = y(null);
    function ye(t, s) {
      M.value = t, G.value = {
        datapoint: s,
        seriesIndex: t,
        series: T.value,
        config: e.value
      };
      const l = e.value.style.tooltip.customFormat;
      if (_e(l) && $e(() => l({
        seriesIndex: t,
        datapoint: {
          segment: s[0],
          index: s[1],
          left: s[2],
          right: s[3]
        },
        series: T.value,
        config: e.value
      })))
        D.value = l({
          seriesIndex: t,
          datapoint: {
            segment: s[0],
            index: s[1],
            left: s[2],
            right: s[3]
          },
          series: T.value,
          config: e.value
        });
      else {
        let a = "";
        const u = T.value[t];
        a += `<div><b>${u.segment}</b></div>`, a += `<div>${e.value.translations.age}: ${k(
          e.value.style.layout.dataLabels.yAxis.formatter,
          v(u.age),
          _({ v: v(u.age) }),
          { datapoint: s, seriesIndex: t }
        )}</div>`, a += `<div style="margin-top:6px;padding-top:6px;border-top:1px solid ${e.value.style.tooltip.borderColor}">`, a += '<div style="display:flex; flex-direction:row;gap:12px">', a += `<div style="display:flex;flex-direction:column;align-items:center;justify-content:center"><svg viewBox="0 0 12 12" height="12" width="12"><rect stroke="none" x="0" y="0" height="12" width="12" rx="2" fill="${e.value.style.layout.bars.gradient.underlayer}"/><rect stroke="none" x="0" y="0" height="12" width="12" rx="2" fill="${e.value.style.layout.bars.gradient.show ? `url(#age_pyramid_left_${x.value})` : e.value.style.layout.bars.left.color}"/></svg><div>${e.value.translations.female}</div><div><b>${k(
          e.value.style.layout.dataLabels.xAxis.formatter,
          v(u.left.value),
          _({ v: v(u.left.value) }),
          { datapoint: s, seriesIndex: t }
        )}</b></div></div>`, a += `<div style="display:flex;flex-direction:column;align-items:center;justify-content:center"><svg viewBox="0 0 12 12" height="12" width="12"><rect stroke="none" x="0" y="0" height="12" width="12" rx="2" fill="${e.value.style.layout.bars.gradient.underlayer}"/><rect stroke="none" x="0" y="0" height="12" width="12" rx="2" fill="${e.value.style.layout.bars.gradient.show ? `url(#age_pyramid_right_${x.value})` : e.value.style.layout.bars.right.color}"/></svg><div>${e.value.translations.male}</div><div><b>${k(
          e.value.style.layout.dataLabels.xAxis.formatter,
          v(u.right.value),
          _({ v: v(u.right.value) }),
          { datapoint: s, seriesIndex: t }
        )}</b></div></div>`, a += "</div>", a += `<div style="margin-top:6px;padding-top:6px;border-top:1px solid ${e.value.style.tooltip.borderColor}"><div>${e.value.translations.total}</div><div><b>${k(
          e.value.style.layout.dataLabels.xAxis.formatter,
          v(u.right.value) + v(u.left.value),
          _({ v: v(u.right.value) + v(u.left.value) }),
          { datapoint: s, seriesIndex: t }
        )}</b></div></div>`, a += "</div>", D.value = `<div>${a}</div>`;
      }
      R.value = !0;
    }
    function Q() {
      ge(() => {
        const t = [e.value.translations.year, e.value.translations.age, e.value.translations.female, e.value.translations.male, e.value.translations.total], s = c.dataset.map((u) => [
          u[0],
          u[1],
          u[2],
          u[3],
          u[2] + u[3]
        ]), l = [[e.value.style.title.text], [e.value.style.title.subtitle.text], [[""], [""], [""]]].concat([t]).concat(s), a = Ce(l);
        Te({ csvContent: a, title: e.value.style.title.text || "vue-ui-heatmap" });
      });
    }
    const O = b(() => {
      const t = [
        e.value.translations.year,
        e.value.translations.age,
        e.value.translations.female,
        e.value.translations.male,
        e.value.translations.total
      ], s = c.dataset.map((a) => [
        a[0],
        a[1],
        a[2].toLocaleString(),
        a[3].toLocaleString(),
        (a[2] + a[3]).toLocaleString()
      ]), l = {
        th: {
          backgroundColor: e.value.table.th.backgroundColor,
          color: e.value.table.th.color,
          outline: e.value.table.th.outline
        },
        td: {
          backgroundColor: e.value.table.td.backgroundColor,
          color: e.value.table.td.color,
          outline: e.value.table.td.outline
        },
        breakpoint: e.value.table.responsiveBreakpoint
      };
      return { head: t, body: s, config: l, colNames: t };
    }), z = y(!1);
    function he(t) {
      z.value = t, V.value += 1;
    }
    function Z() {
      m.value.showTable = !m.value.showTable;
    }
    function ee() {
      m.value.showTooltip = !m.value.showTooltip;
    }
    return ie({
      generatePdf: J,
      generateCsv: Q,
      generateImage: K,
      toggleTable: Z,
      toggleTooltip: ee
    }), (t, s) => (i(), r("div", {
      class: le(`vue-ui-age-pyramid ${z.value ? "vue-data-ui-wrapper-fullscreen" : ""}`),
      ref_key: "agePyramid",
      ref: A,
      id: `vue-ui-age-pyramid_${x.value}`,
      style: B(`font-family:${e.value.style.fontFamily};width:100%; text-align:center;${e.value.style.title.text ? "" : "padding-top:36px"};background:${e.value.style.backgroundColor};${e.value.responsive ? "height:100%" : ""}`)
    }, [
      e.value.style.title.text ? (i(), r("div", {
        key: 0,
        ref_key: "chartTitle",
        ref: Y,
        style: B(`width:100%;background:${e.value.style.backgroundColor}`)
      }, [
        E(Se, {
          config: {
            title: {
              cy: "pyramid-div-title",
              ...e.value.style.title
            },
            subtitle: {
              cy: "pyramid-div-subtitle",
              ...e.value.style.title.subtitle
            }
          }
        }, null, 8, ["config"])
      ], 4)) : h("", !0),
      e.value.userOptions.show && F.value ? (i(), W(Ie, {
        ref_key: "details",
        ref: re,
        key: `user_options_${V.value}`,
        backgroundColor: e.value.style.backgroundColor,
        color: e.value.style.color,
        isImaging: d(q),
        isPrinting: d(H),
        uid: x.value,
        hasTooltip: e.value.userOptions.buttons.tooltip && e.value.style.tooltip.show,
        hasPdf: e.value.userOptions.buttons.pdf,
        hasXls: e.value.userOptions.buttons.csv,
        hasImg: e.value.userOptions.buttons.img,
        hasTable: e.value.userOptions.buttons.table,
        hasFullscreen: e.value.userOptions.buttons.fullscreen,
        isFullscreen: z.value,
        isTooltip: m.value.showTooltip,
        titles: { ...e.value.userOptions.buttonTitles },
        chartElement: A.value,
        onToggleFullscreen: he,
        onGeneratePdf: d(J),
        onGenerateCsv: Q,
        onGenerateImage: d(K),
        onToggleTable: Z,
        onToggleTooltip: ee
      }, ce({ _: 2 }, [
        t.$slots.optionTooltip ? {
          name: "optionTooltip",
          fn: g(() => [
            p(t.$slots, "optionTooltip", {}, void 0, !0)
          ]),
          key: "0"
        } : void 0,
        t.$slots.optionPdf ? {
          name: "optionPdf",
          fn: g(() => [
            p(t.$slots, "optionPdf", {}, void 0, !0)
          ]),
          key: "1"
        } : void 0,
        t.$slots.optionCsv ? {
          name: "optionCsv",
          fn: g(() => [
            p(t.$slots, "optionCsv", {}, void 0, !0)
          ]),
          key: "2"
        } : void 0,
        t.$slots.optionImg ? {
          name: "optionImg",
          fn: g(() => [
            p(t.$slots, "optionImg", {}, void 0, !0)
          ]),
          key: "3"
        } : void 0,
        t.$slots.optionTable ? {
          name: "optionTable",
          fn: g(() => [
            p(t.$slots, "optionTable", {}, void 0, !0)
          ]),
          key: "4"
        } : void 0,
        t.$slots.optionFullscreen ? {
          name: "optionFullscreen",
          fn: g(({ toggleFullscreen: l, isFullscreen: a }) => [
            p(t.$slots, "optionFullscreen", P(N({ toggleFullscreen: l, isFullscreen: a })), void 0, !0)
          ]),
          key: "5"
        } : void 0
      ]), 1032, ["backgroundColor", "color", "isImaging", "isPrinting", "uid", "hasTooltip", "hasPdf", "hasXls", "hasImg", "hasTable", "hasFullscreen", "isFullscreen", "isTooltip", "titles", "chartElement", "onGeneratePdf", "onGenerateImage"])) : h("", !0),
      F.value ? (i(), r("svg", {
        key: 2,
        xmlns: d(ke),
        class: le({ "vue-data-ui-fullscreen--on": z.value, "vue-data-ui-fulscreen--off": !z.value }),
        viewBox: `0 0 ${f.value.width <= 0 ? 10 : f.value.width} ${f.value.height <= 0 ? 10 : f.value.height}`,
        style: B(`max-width:100%;overflow:visible;background:${e.value.style.backgroundColor};color:${e.value.style.color}`)
      }, [
        n("defs", null, [
          n("linearGradient", {
            id: `age_pyramid_left_${x.value}`,
            x1: "0%",
            y1: "0%",
            x2: "100%",
            y2: "0%"
          }, [
            n("stop", {
              offset: "0%",
              "stop-color": e.value.style.layout.bars.left.color
            }, null, 8, Be),
            n("stop", {
              offset: "100%",
              "stop-color": `${d(oe)(e.value.style.layout.bars.left.color, e.value.style.layout.bars.gradient.shiftHue)}${d(X)[100 - e.value.style.layout.bars.gradient.intensity]}`
            }, null, 8, Ee)
          ], 8, Ge),
          n("linearGradient", {
            id: `age_pyramid_right_${x.value}`,
            x1: "0%",
            y1: "0%",
            x2: "100%",
            y2: "0%"
          }, [
            n("stop", {
              offset: "0%",
              "stop-color": `${d(oe)(e.value.style.layout.bars.right.color, e.value.style.layout.bars.gradient.shiftHue)}${d(X)[100 - e.value.style.layout.bars.gradient.intensity]}`
            }, null, 8, Xe),
            n("stop", {
              offset: "100%",
              "stop-color": e.value.style.layout.bars.right.color
            }, null, 8, Ue)
          ], 8, We)
        ]),
        (i(!0), r(L, null, I(T.value, (l, a) => (i(), r("g", null, [
          n("rect", {
            x: l.left.x,
            y: l.left.y,
            width: d(v)(l.left.width <= 0 ? 1e-4 : l.left.width),
            height: l.left.height <= 0 ? 1e-4 : l.left.height,
            fill: e.value.style.layout.bars.gradient.underlayer,
            rx: e.value.style.layout.bars.borderRadius
          }, null, 8, Ve),
          n("rect", {
            x: l.left.x,
            y: l.left.y,
            width: l.left.width <= 0 ? 1e-4 : l.left.width,
            height: l.left.height <= 0 ? 1e-4 : l.left.height,
            fill: e.value.style.layout.bars.gradient.show ? `url(#age_pyramid_left_${x.value})` : l.left.color,
            rx: e.value.style.layout.bars.borderRadius
          }, null, 8, Ye),
          n("rect", {
            x: l.right.x,
            y: l.right.y,
            width: l.right.width <= 0 ? 1e-4 : l.right.width,
            height: l.right.height <= 0 ? 1e-4 : l.right.height,
            fill: e.value.style.layout.bars.gradient.underlayer,
            rx: e.value.style.layout.bars.borderRadius
          }, null, 8, je),
          n("rect", {
            x: l.right.x,
            y: l.right.y,
            width: l.right.width <= 0 ? 1e-4 : l.right.width,
            height: l.right.height <= 0 ? 1e-4 : l.right.height,
            fill: e.value.style.layout.bars.gradient.show ? `url(#age_pyramid_right_${x.value})` : l.right.color,
            rx: e.value.style.layout.bars.borderRadius
          }, null, 8, He)
        ]))), 256)),
        n("g", null, [
          e.value.style.layout.dataLabels.sideTitles.show ? (i(), r("g", qe, [
            n("text", {
              x: o.value.left,
              y: o.value.top + e.value.style.layout.dataLabels.sideTitles.offsetY,
              fill: e.value.style.layout.dataLabels.sideTitles.useSideColor ? e.value.style.layout.bars.left.color : e.value.style.layout.dataLabels.sideTitles.color,
              "font-size": e.value.style.layout.dataLabels.sideTitles.fontSize,
              "text-anchor": "start",
              "font-weight": e.value.style.layout.dataLabels.sideTitles.bold ? "bold" : "normal"
            }, w(e.value.translations.female), 9, Je),
            n("text", {
              x: o.value.right,
              y: o.value.top + e.value.style.layout.dataLabels.sideTitles.offsetY,
              fill: e.value.style.layout.dataLabels.sideTitles.useSideColor ? e.value.style.layout.bars.right.color : e.value.style.layout.dataLabels.sideTitles.color,
              "font-size": e.value.style.layout.dataLabels.sideTitles.fontSize,
              "text-anchor": "end",
              "font-weight": e.value.style.layout.dataLabels.sideTitles.bold ? "bold" : "normal"
            }, w(e.value.translations.male), 9, Ke)
          ])) : h("", !0),
          e.value.style.layout.dataLabels.yAxis.show ? (i(), r("g", Qe, [
            (i(!0), r(L, null, I(ne.value, (l, a) => (i(), r(L, null, [
              a % e.value.style.layout.dataLabels.yAxis.showEvery === 0 ? (i(), r("text", {
                key: 0,
                x: o.value.centerX,
                y: o.value.top + o.value.height / C.value * a + e.value.style.layout.dataLabels.yAxis.fontSize / 3,
                "text-anchor": "middle",
                "font-size": e.value.style.layout.dataLabels.yAxis.fontSize,
                fill: e.value.style.layout.dataLabels.yAxis.color,
                "font-weight": e.value.style.layout.dataLabels.yAxis.bold ? "bold" : "normal"
              }, w(d(k)(
                e.value.style.layout.dataLabels.yAxis.formatter,
                l,
                d(_)({ v: l }),
                { datapoint: l, seriesIndex: a }
              )), 9, Ze)) : h("", !0)
            ], 64))), 256))
          ])) : h("", !0),
          e.value.style.layout.dataLabels.xAxis.show ? (i(), r("g", et, [
            e.value.style.layout.grid.show ? (i(), r("g", tt, [
              n("line", {
                x1: $.value.right[0].x,
                x2: $.value.right.at(-1).x,
                y1: o.value.bottom + e.value.style.layout.dataLabels.xAxis.fontSize / 2,
                y2: o.value.bottom + e.value.style.layout.dataLabels.xAxis.fontSize / 2,
                stroke: e.value.style.layout.grid.stroke,
                "stroke-width": e.value.style.layout.grid.strokeWidth,
                "stroke-linecap": "round"
              }, null, 8, lt),
              n("line", {
                x1: $.value.left[0].x,
                x2: $.value.left.at(-1).x,
                y1: o.value.bottom + e.value.style.layout.dataLabels.xAxis.fontSize / 2,
                y2: o.value.bottom + e.value.style.layout.dataLabels.xAxis.fontSize / 2,
                stroke: e.value.style.layout.grid.stroke,
                "stroke-width": e.value.style.layout.grid.strokeWidth,
                "stroke-linecap": "round"
              }, null, 8, at)
            ])) : h("", !0),
            (i(!0), r(L, null, I($.value.right, (l, a) => (i(), r("g", null, [
              e.value.style.layout.grid.show ? (i(), r("line", {
                key: 0,
                x1: l.x,
                x2: l.x,
                y1: o.value.bottom + e.value.style.layout.dataLabels.xAxis.fontSize / 2,
                y2: o.value.bottom + e.value.style.layout.dataLabels.xAxis.fontSize / 4,
                stroke: e.value.style.layout.grid.stroke,
                "stroke-width": e.value.style.layout.grid.strokeWidth,
                "stroke-linecap": "round"
              }, null, 8, ot)) : h("", !0),
              n("text", {
                x: l.x,
                y: o.value.bottom + e.value.style.layout.dataLabels.xAxis.fontSize * 2,
                "font-size": e.value.style.layout.dataLabels.xAxis.fontSize,
                fill: e.value.style.layout.dataLabels.xAxis.color,
                "text-anchor": "middle",
                "font-weight": e.value.style.layout.dataLabels.xAxis.bold ? "bold" : "normal"
              }, w(d(k)(
                e.value.style.layout.dataLabels.xAxis.formatter,
                l.value / e.value.style.layout.dataLabels.xAxis.scale,
                d(_)({
                  v: l.value / e.value.style.layout.dataLabels.xAxis.scale
                }),
                { datapoint: l, seriesIndex: a }
              )), 9, st)
            ]))), 256)),
            (i(!0), r(L, null, I($.value.left, (l, a) => (i(), r("g", null, [
              e.value.style.layout.grid.show ? (i(), r("line", {
                key: 0,
                x1: l.x,
                x2: l.x,
                y1: o.value.bottom + e.value.style.layout.dataLabels.xAxis.fontSize / 2,
                y2: o.value.bottom + e.value.style.layout.dataLabels.xAxis.fontSize / 4,
                stroke: e.value.style.layout.grid.stroke,
                "stroke-width": e.value.style.layout.grid.strokeWidth,
                "stroke-linecap": "round"
              }, null, 8, it)) : h("", !0),
              n("text", {
                x: l.x,
                y: o.value.bottom + e.value.style.layout.dataLabels.xAxis.fontSize * 2,
                "font-size": e.value.style.layout.dataLabels.xAxis.fontSize,
                fill: e.value.style.layout.dataLabels.xAxis.color,
                "text-anchor": "middle",
                "font-weight": e.value.style.layout.dataLabels.xAxis.bold ? "bold" : "normal"
              }, w(d(k)(
                e.value.style.layout.dataLabels.xAxis.formatter,
                l.value / e.value.style.layout.dataLabels.xAxis.scale,
                d(_)({
                  v: l.value / e.value.style.layout.dataLabels.xAxis.scale
                }),
                { datapoint: l, seriesIndex: a }
              )), 9, ut)
            ]))), 256)),
            n("text", {
              x: o.value.right,
              y: f.value.height,
              "text-anchor": "end",
              "font-size": e.value.style.layout.dataLabels.xAxis.fontSize,
              fill: e.value.style.layout.dataLabels.xAxis.color,
              "font-weight": e.value.style.layout.dataLabels.xAxis.bold ? "bold" : "normal"
            }, w(e.value.style.layout.dataLabels.xAxis.translation), 9, rt)
          ])) : h("", !0)
        ]),
        (i(!0), r(L, null, I(U.dataset, (l, a) => (i(), r("g", null, [
          n("rect", {
            x: o.value.left,
            y: o.value.top + o.value.height / C.value * a - e.value.style.layout.bars.gap / 2,
            width: o.value.width <= 0 ? 1e-4 : o.value.width,
            height: o.value.height / C.value <= 0 ? 1e-4 : o.value.height / C.value,
            fill: M.value !== null && M.value === a ? `${e.value.style.highlighter.color}${d(X)[e.value.style.highlighter.opacity]}` : "transparent",
            onMouseover: (u) => ye(a, l),
            onMouseleave: s[0] || (s[0] = (u) => {
              M.value = null, R.value = !1;
            })
          }, null, 40, nt)
        ]))), 256)),
        p(t.$slots, "svg", { svg: f.value }, void 0, !0)
      ], 14, De)) : h("", !0),
      t.$slots.watermark ? (i(), r("div", dt, [
        p(t.$slots, "watermark", P(N({ isPrinting: d(H) || d(q) })), void 0, !0)
      ])) : h("", !0),
      F.value ? h("", !0) : (i(), W(Oe, {
        key: 4,
        config: {
          type: "pyramid",
          style: {
            backgroundColor: e.value.style.backgroundColor,
            pyramid: {
              color: "#CCCCCC"
            }
          }
        }
      }, null, 8, ["config"])),
      p(t.$slots, "legend", { legend: T.value }, void 0, !0),
      E(Fe, {
        show: m.value.showTooltip && R.value,
        backgroundColor: e.value.style.tooltip.backgroundColor,
        color: e.value.style.tooltip.color,
        borderRadius: e.value.style.tooltip.borderRadius,
        borderColor: e.value.style.tooltip.borderColor,
        borderWidth: e.value.style.tooltip.borderWidth,
        fontSize: e.value.style.tooltip.fontSize,
        backgroundOpacity: e.value.style.tooltip.backgroundOpacity,
        position: e.value.style.tooltip.position,
        offsetY: e.value.style.tooltip.offsetY,
        parent: A.value,
        content: D.value,
        isCustom: e.value.style.tooltip.customFormat && typeof e.value.style.tooltip.customFormat == "function"
      }, {
        "tooltip-before": g(() => [
          p(t.$slots, "tooltip-before", P(N({ ...G.value })), void 0, !0)
        ]),
        "tooltip-after": g(() => [
          p(t.$slots, "tooltip-after", P(N({ ...G.value })), void 0, !0)
        ]),
        _: 3
      }, 8, ["show", "backgroundColor", "color", "borderRadius", "borderColor", "borderWidth", "fontSize", "backgroundOpacity", "position", "offsetY", "parent", "content", "isCustom"]),
      F.value ? (i(), W(Pe, {
        key: 5,
        hideDetails: "",
        config: {
          open: m.value.showTable,
          maxHeight: 1e4,
          body: {
            backgroundColor: e.value.style.backgroundColor,
            color: e.value.style.color
          },
          head: {
            backgroundColor: e.value.style.backgroundColor,
            color: e.value.style.color
          }
        }
      }, {
        content: g(() => [
          E(Me, {
            colNames: O.value.colNames,
            head: O.value.head,
            body: O.value.body,
            config: O.value.config,
            title: `${e.value.style.title.text}${e.value.style.title.subtitle.text ? ` : ${e.value.style.title.subtitle.text}` : ""}`,
            onClose: s[1] || (s[1] = (l) => m.value.showTable = !1)
          }, {
            th: g(({ th: l }) => [
              ae(w(l), 1)
            ]),
            td: g(({ td: l }) => [
              ae(w(l), 1)
            ]),
            _: 1
          }, 8, ["colNames", "head", "body", "config", "title"])
        ]),
        _: 1
      }, 8, ["config"])) : h("", !0)
    ], 14, Re));
  }
}, _t = /* @__PURE__ */ Ne(vt, [["__scopeId", "data-v-4660f4e6"]]);
export {
  _t as default
};
