import { computed as m, ref as v, watch as ye, onMounted as fe, onBeforeUnmount as Oe, openBlock as o, createElementBlock as r, normalizeClass as be, normalizeStyle as F, unref as u, createBlock as L, createCommentVNode as y, createSlots as Ge, withCtx as _, renderSlot as k, normalizeProps as W, guardReactiveProps as U, createVNode as Me, Fragment as w, renderList as $, createElementVNode as i, toDisplayString as A, createTextVNode as ge, nextTick as De } from "vue";
import { u as Ie, c as pe, t as Fe, o as Ve, e as me, g as Ee, v as _e, D as He, f as z, X as ke, i as R, l as xe, h as Ce, q as We, r as Ue } from "./index-BbPeL8Gp.js";
import { t as Re, u as Be } from "./useResponsive-CoxXLe23.js";
import { _ as je } from "./Title-aSAft5dl.js";
import { u as qe, U as Ye } from "./usePrinter-DaybDVqP.js";
import { D as Ze } from "./DataTable-DGf6RrOJ.js";
import Je from "./vue-ui-skeleton-Bniq21d9.js";
import { L as Ke } from "./Legend-BLaZxMge.js";
import Qe from "./vue-ui-accordion-5d5iVpr7.js";
import { u as we } from "./useNestedProp-BN8claGG.js";
import { _ as et } from "./PackageVersion-CxJghxYD.js";
import { P as tt } from "./PenAndPaper-ZdZEumki.js";
import { u as lt } from "./useUserOptionState-BIvW1Kz7.js";
import { _ as at } from "./_plugin-vue_export-helper-CHgC5LLL.js";
const st = ["id"], ot = ["xmlns", "viewBox"], rt = { key: 0 }, nt = ["x1", "x2", "y1", "y2", "stroke", "stroke-width", "stroke-dasharray"], ut = { key: 1 }, it = ["x1", "x2", "y1", "y2", "stroke", "stroke-width", "stroke-dasharray"], ct = ["x1", "x2", "y1", "y2", "stroke", "stroke-width", "stroke-dasharray"], dt = { key: 2 }, vt = ["x", "y", "font-size", "fill", "font-weight"], ht = ["x", "y", "font-size", "fill"], yt = { key: 3 }, ft = ["x", "y", "font-size", "fill", "font-weight"], bt = ["id"], gt = ["stop-color"], pt = ["stop-color"], mt = ["stop-color"], _t = ["id"], kt = ["stop-color"], xt = ["stop-color"], Ct = ["stop-color"], wt = ["id"], $t = ["stop-color"], Lt = ["stop-color"], At = ["id"], zt = ["stop-color"], St = ["stop-color"], Xt = { key: 0 }, Nt = ["d", "fill"], Tt = { key: 1 }, Pt = ["x", "y", "height", "width", "fill"], Ot = ["cx", "cy", "r", "fill", "stroke", "stroke-width"], Gt = ["cx", "cy", "r", "fill", "stroke", "stroke-width"], Mt = { key: 2 }, Dt = ["x", "y", "fill", "font-size"], It = { key: 3 }, Ft = ["x", "y", "fill", "font-size"], Vt = {
  key: 5,
  class: "vue-data-ui-watermark"
}, Et = ["xmlns", "height", "width"], Ht = ["fill"], Wt = ["innerHTML"], Ut = {
  __name: "vue-ui-dumbbell",
  props: {
    config: {
      type: Object,
      default() {
        return {};
      }
    },
    dataset: {
      type: Array,
      default() {
        return [];
      }
    }
  },
  emits: ["selectDatapoint"],
  setup($e, { expose: Le, emit: Rt }) {
    const p = $e, { vue_ui_dumbbell: Ae } = Ie(), S = m({
      get() {
        return !!p.dataset && p.dataset.length;
      },
      set(l) {
        return l;
      }
    }), f = v(pe()), B = v(0), X = v(null), j = v(null), q = v(null), Y = v(null), Z = v(null), J = v(0), K = v(0), Q = v(0), e = m({
      get: () => ae(),
      set: (l) => l
    }), { userOptionsVisible: ee, setUserOptionsVisibility: te, keepUserOptionState: le } = lt({ config: e.value });
    function ae() {
      const l = we({
        userConfig: p.config,
        defaultConfig: Ae
      });
      return l.theme ? {
        ...we({
          userConfig: Fe.vue_ui_dumbbell[l.theme] || p.config,
          defaultConfig: l
        })
      } : l;
    }
    ye(() => p.config, (l) => {
      e.value = ae(), se(), J.value += 1, K.value += 1, Q.value += 1, h.value = e.value.style.chart.rowHeight, N.value = e.value.style.chart.width;
    }, { deep: !0 }), ye(() => p.dataset, (l) => {
      ce();
    }, { deep: !0 });
    const P = v(null);
    fe(() => {
      se();
    });
    function se() {
      if (Ve(p.dataset) ? me({
        componentName: "VueUiDumbbell",
        type: "dataset"
      }) : p.dataset.forEach((l, n) => {
        Ee({
          datasetObject: l,
          requiredAttributes: ["name", "start", "end"]
        }).forEach((t) => {
          S.value = !1, me({
            componentName: "VueUiDumbbell",
            type: "datasetSerieAttribute",
            property: t,
            index: n
          });
        });
      }), e.value.responsive) {
        const l = Re(() => {
          const { width: n, height: t } = Be({
            chart: X.value,
            title: e.value.style.chart.title.text ? j.value : null,
            legend: e.value.style.chart.legend.show ? q.value : null,
            source: Y.value,
            noTitle: Z.value
          });
          N.value = n, h.value = t / p.dataset.length, b.value = G();
        });
        P.value = new ResizeObserver(l), P.value.observe(X.value.parentNode);
      }
    }
    Oe(() => {
      P.value && P.value.disconnect();
    });
    const { isPrinting: oe, isImaging: re, generatePdf: ne, generateImage: ue } = qe({
      elementId: `dumbbell_${f.value}`,
      fileName: e.value.style.chart.title.text || "vue-ui-dumbbell"
    }), ze = m(() => e.value.userOptions.show && !e.value.style.chart.title.text), O = v({
      showTable: e.value.table.show
    }), x = m(() => p.dataset.map((l, n) => ({
      ...l,
      start: _e(l.start),
      end: _e(l.end),
      id: pe()
    }))), V = m(() => ({
      max: Math.max(...x.value.flatMap((l) => [l.start, l.end])),
      min: Math.min(...x.value.flatMap((l) => [l.start, l.end]))
    })), d = m(() => He(V.value.min < 0 ? V.value.min : 0, V.value.max, e.value.style.chart.grid.scaleSteps)), h = v(e.value.style.chart.rowHeight), N = v(e.value.style.chart.width), s = m(() => {
      const l = h.value, n = e.value.style.chart.padding.left + e.value.style.chart.padding.right + N.value, t = e.value.style.chart.padding.top + e.value.style.chart.padding.bottom + l * p.dataset.length, a = d.value.ticks.length * (N.value / d.value.ticks.length);
      return {
        left: e.value.style.chart.padding.left,
        right: n - e.value.style.chart.padding.right,
        top: e.value.style.chart.padding.top,
        bottom: t - e.value.style.chart.padding.bottom,
        width: N.value,
        height: l * p.dataset.length,
        rowHeight: l,
        absoluteHeight: t,
        absoluteWidth: n,
        widthPlotReference: a
      };
    });
    function G() {
      return x.value.map((l, n) => {
        const t = s.value.left + (l.start + Math.abs(d.value.min)) / (d.value.max + Math.abs(d.value.min)) * s.value.widthPlotReference, a = s.value.left + (l.end + Math.abs(d.value.min)) / (d.value.max + Math.abs(d.value.min)) * s.value.widthPlotReference, c = t + (a - t) / 2;
        return {
          ...l,
          startX: t,
          endX: a,
          centerX: c,
          y: s.value.top + n * h.value + h.value / 2,
          endVal: l.start
        };
      });
    }
    const b = v([]), ie = v(null), Se = m(() => x.value.map((l) => l.end).reduce((l, n) => l + n, 0));
    fe(() => {
      ce();
    });
    function ce() {
      b.value = G();
      let l = b.value.map((t) => t.start).reduce((t, a) => t + a, 0);
      function n() {
        const t = x.value.map((a) => a.end - a.start);
        l >= Se.value ? (cancelAnimationFrame(ie.value), b.value = G()) : (b.value = b.value.map((a, c) => {
          a.endVal += t[c] * (e.value.animationSpeed / 100);
          const g = s.value.left + (a.start + Math.abs(d.value.min)) / (d.value.max + Math.abs(d.value.min)) * s.value.widthPlotReference, I = s.value.left + (a.endVal + Math.abs(d.value.min)) / (d.value.max + Math.abs(d.value.min)) * s.value.widthPlotReference, H = g + (I - g) / 2;
          return {
            ...a,
            startX: g,
            endX: I,
            centerX: H,
            y: s.value.top + c * h.value + h.value / 2,
            endVal: a.endVal
          };
        }), l = b.value.map((a) => a.endVal).reduce((a, c) => a + c, 0), ie.value = requestAnimationFrame(n));
      }
      e.value.useAnimation ? n() : b.value = G();
    }
    const de = m(() => [
      { name: e.value.style.chart.legend.labelStart, color: e.value.style.chart.plots.gradient.show ? `url(#start_grad_${f.value})` : e.value.style.chart.plots.startColor },
      { name: e.value.style.chart.legend.labelEnd, color: e.value.style.chart.plots.gradient.show ? `url(#end_grad_${f.value})` : e.value.style.chart.plots.endColor }
    ]), Xe = m(() => ({
      cy: "donut-div-legend",
      backgroundColor: e.value.style.chart.legend.backgroundColor,
      color: e.value.style.chart.legend.color,
      fontSize: e.value.style.chart.legend.fontSize,
      paddingBottom: 12,
      paddingTop: 12,
      fontWeight: e.value.style.chart.legend.bold ? "bold" : ""
    })), C = m(() => {
      const l = b.value.map((t) => ({
        name: t.name
      })), n = b.value.map((t) => ({
        start: t.start,
        end: t.end
      }));
      return { head: l, body: n };
    }), M = m(() => {
      const l = [
        e.value.table.columnNames.series,
        e.value.table.columnNames.start,
        e.value.table.columnNames.end,
        e.value.table.columnNames.progression
      ], n = C.value.head.map((c, g) => {
        const I = z({
          p: e.value.style.chart.labels.prefix,
          v: C.value.body[g].start,
          s: e.value.style.chart.labels.suffix,
          r: e.value.table.td.roundingValue
        }), H = z({
          p: e.value.style.chart.labels.prefix,
          v: C.value.body[g].end,
          s: e.value.style.chart.labels.suffix,
          r: e.value.table.td.roundingValue
        }), Pe = z({
          v: 100 * (C.value.body[g].end / C.value.body[g].start - 1),
          s: "%",
          r: e.value.table.td.roundingPercentage
        });
        return [
          { name: c.name },
          I,
          H,
          Pe
        ];
      }), 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
      };
      return {
        colNames: [
          e.value.table.columnNames.series,
          e.value.table.columnNames.start,
          e.value.table.columnNames.end,
          e.value.table.columnNames.progression
        ],
        head: l,
        body: n,
        config: t
      };
    });
    function ve() {
      De(() => {
        const l = C.value.head.map((a, c) => [[
          a.name
        ], [C.value.body[c].start], [C.value.body[c].end]]), n = [[e.value.style.chart.title.text], [e.value.style.chart.title.subtitle.text], [[e.value.table.columnNames.series], [e.value.table.columnNames.start], [e.value.table.columnNames.end]]].concat(l), t = We(n);
        Ue({ csvContent: t, title: e.value.style.chart.title.text || "vue-ui-dumbbell" });
      });
    }
    const T = v(!1);
    function Ne(l) {
      T.value = l, B.value += 1;
    }
    function Te() {
      return b.value;
    }
    function he() {
      O.value.showTable = !O.value.showTable;
    }
    const D = v(!1);
    function E() {
      D.value = !D.value;
    }
    return Le({
      getData: Te,
      generatePdf: ne,
      generateCsv: ve,
      generateImage: ue,
      toggleTable: he,
      toggleAnnotator: E
    }), (l, n) => (o(), r("div", {
      ref_key: "dumbbellChart",
      ref: X,
      class: be(`vue-ui-dumbbell ${T.value ? "vue-data-ui-wrapper-fullscreen" : ""}`),
      style: F(`font-family:${e.value.style.fontFamily};width:100%; text-align:center;background:${e.value.style.chart.backgroundColor};${e.value.responsive ? "height:100%" : ""}`),
      id: `dumbbell_${f.value}`,
      onMouseenter: n[1] || (n[1] = () => u(te)(!0)),
      onMouseleave: n[2] || (n[2] = () => u(te)(!1))
    }, [
      e.value.userOptions.buttons.annotator ? (o(), L(tt, {
        key: 0,
        parent: X.value,
        backgroundColor: e.value.style.chart.backgroundColor,
        color: e.value.style.chart.color,
        active: D.value,
        onClose: E
      }, null, 8, ["parent", "backgroundColor", "color", "active"])) : y("", !0),
      ze.value ? (o(), r("div", {
        key: 1,
        ref_key: "noTitle",
        ref: Z,
        class: "vue-data-ui-no-title-space",
        style: "height:36px; width: 100%;background:transparent"
      }, null, 512)) : y("", !0),
      e.value.style.chart.title.text ? (o(), r("div", {
        key: 2,
        ref_key: "chartTitle",
        ref: j,
        style: "width:100%;background:transparent;padding-bottom:24px"
      }, [
        (o(), L(je, {
          key: `title_${J.value}`,
          config: {
            title: {
              cy: "donut-div-title",
              ...e.value.style.chart.title
            },
            subtitle: {
              cy: "donut-div-subtitle",
              ...e.value.style.chart.title.subtitle
            }
          }
        }, null, 8, ["config"]))
      ], 512)) : y("", !0),
      e.value.userOptions.show && S.value && (u(le) || u(ee)) ? (o(), L(Ye, {
        ref: "details",
        key: `user_option_${B.value}`,
        backgroundColor: e.value.style.chart.backgroundColor,
        color: e.value.style.chart.color,
        isPrinting: u(oe),
        isImaging: u(re),
        uid: f.value,
        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: T.value,
        titles: { ...e.value.userOptions.buttonTitles },
        chartElement: X.value,
        position: e.value.userOptions.position,
        hasAnnotator: e.value.userOptions.buttons.annotator,
        isAnnotation: D.value,
        onToggleFullscreen: Ne,
        onGeneratePdf: u(ne),
        onGenerateCsv: ve,
        onGenerateImage: u(ue),
        onToggleTable: he,
        onToggleAnnotator: E,
        style: F({
          visibility: u(le) ? u(ee) ? "visible" : "hidden" : "visible"
        })
      }, Ge({ _: 2 }, [
        l.$slots.optionPdf ? {
          name: "optionPdf",
          fn: _(() => [
            k(l.$slots, "optionPdf", {}, void 0, !0)
          ]),
          key: "0"
        } : void 0,
        l.$slots.optionCsv ? {
          name: "optionCsv",
          fn: _(() => [
            k(l.$slots, "optionCsv", {}, void 0, !0)
          ]),
          key: "1"
        } : void 0,
        l.$slots.optionImg ? {
          name: "optionImg",
          fn: _(() => [
            k(l.$slots, "optionImg", {}, void 0, !0)
          ]),
          key: "2"
        } : void 0,
        l.$slots.optionTable ? {
          name: "optionTable",
          fn: _(() => [
            k(l.$slots, "optionTable", {}, void 0, !0)
          ]),
          key: "3"
        } : void 0,
        l.$slots.optionFullscreen ? {
          name: "optionFullscreen",
          fn: _(({ toggleFullscreen: t, isFullscreen: a }) => [
            k(l.$slots, "optionFullscreen", W(U({ toggleFullscreen: t, isFullscreen: a })), void 0, !0)
          ]),
          key: "4"
        } : void 0,
        l.$slots.optionAnnotator ? {
          name: "optionAnnotator",
          fn: _(({ toggleAnnotator: t, isAnnotator: a }) => [
            k(l.$slots, "optionAnnotator", W(U({ toggleAnnotator: t, isAnnotator: a })), void 0, !0)
          ]),
          key: "5"
        } : void 0
      ]), 1032, ["backgroundColor", "color", "isPrinting", "isImaging", "uid", "hasPdf", "hasXls", "hasImg", "hasTable", "hasFullscreen", "isFullscreen", "titles", "chartElement", "position", "hasAnnotator", "isAnnotation", "onGeneratePdf", "onGenerateImage", "style"])) : y("", !0),
      S.value ? (o(), r("svg", {
        key: 4,
        xmlns: u(ke),
        class: be({ "vue-data-ui-fullscreen--on": T.value, "vue-data-ui-fulscreen--off": !T.value }),
        viewBox: `0 0 ${s.value.absoluteWidth <= 0 ? 10 : s.value.absoluteWidth} ${s.value.absoluteHeight <= 0 ? 10 : s.value.absoluteHeight}`,
        style: F(`max-width:100%; overflow: visible; background:transparent;color:${e.value.style.chart.color}`)
      }, [
        Me(et),
        e.value.style.chart.grid.verticalGrid.show ? (o(), r("g", rt, [
          (o(!0), r(w, null, $(d.value.ticks, (t, a) => (o(), r("line", {
            x1: s.value.left + a * s.value.width / (d.value.ticks.length - 1),
            x2: s.value.left + a * s.value.width / (d.value.ticks.length - 1),
            y1: s.value.top,
            y2: s.value.bottom,
            stroke: e.value.style.chart.grid.verticalGrid.stroke,
            "stroke-width": e.value.style.chart.grid.verticalGrid.strokeWidth,
            "stroke-dasharray": e.value.style.chart.grid.verticalGrid.strokeDasharray
          }, null, 8, nt))), 256))
        ])) : y("", !0),
        e.value.style.chart.grid.horizontalGrid.show ? (o(), r("g", ut, [
          (o(!0), r(w, null, $(x.value, (t, a) => (o(), r("line", {
            x1: s.value.left,
            x2: s.value.right,
            y1: s.value.top + a * h.value,
            y2: s.value.top + a * h.value,
            stroke: e.value.style.chart.grid.horizontalGrid.stroke,
            "stroke-width": e.value.style.chart.grid.horizontalGrid.strokeWidth,
            "stroke-dasharray": e.value.style.chart.grid.horizontalGrid.strokeDasharray
          }, null, 8, it))), 256)),
          i("line", {
            x1: s.value.left,
            x2: s.value.right,
            y1: s.value.bottom,
            y2: s.value.bottom,
            stroke: e.value.style.chart.grid.horizontalGrid.stroke,
            "stroke-width": e.value.style.chart.grid.horizontalGrid.strokeWidth,
            "stroke-dasharray": e.value.style.chart.grid.horizontalGrid.strokeDasharray
          }, null, 8, ct)
        ])) : y("", !0),
        e.value.style.chart.labels.yAxisLabels.show ? (o(), r("g", dt, [
          (o(!0), r(w, null, $(x.value, (t, a) => (o(), r("text", {
            x: s.value.left - 6 + e.value.style.chart.labels.yAxisLabels.offsetX,
            y: s.value.top + a * h.value + (e.value.style.chart.labels.yAxisLabels.showProgression ? h.value / 3 : h.value / 2) + e.value.style.chart.labels.yAxisLabels.fontSize / 3,
            "font-size": e.value.style.chart.labels.yAxisLabels.fontSize,
            fill: e.value.style.chart.labels.yAxisLabels.color,
            "font-weight": e.value.style.chart.labels.yAxisLabels.bold ? "bold" : "normal",
            "text-anchor": "end"
          }, A(t.name), 9, vt))), 256)),
          e.value.style.chart.labels.yAxisLabels.showProgression ? (o(!0), r(w, { key: 0 }, $(x.value, (t, a) => (o(), r("text", {
            x: s.value.left - 6 + e.value.style.chart.labels.yAxisLabels.offsetX,
            y: s.value.top + a * h.value + h.value / 1.3 + e.value.style.chart.labels.yAxisLabels.fontSize / 3,
            "font-size": e.value.style.chart.labels.yAxisLabels.fontSize,
            fill: e.value.style.chart.labels.yAxisLabels.color,
            "text-anchor": "end"
          }, A(u(z)({
            v: 100 * (t.end / t.start - 1),
            s: "%",
            r: e.value.style.chart.labels.yAxisLabels.rounding
          })), 9, ht))), 256)) : y("", !0)
        ])) : y("", !0),
        e.value.style.chart.labels.xAxisLabels.show ? (o(), r("g", yt, [
          (o(!0), r(w, null, $(d.value.ticks, (t, a) => (o(), r("text", {
            x: s.value.left + a * (s.value.width / (d.value.ticks.length - 1)),
            y: s.value.bottom + e.value.style.chart.labels.xAxisLabels.fontSize + e.value.style.chart.labels.xAxisLabels.offsetY,
            "font-size": e.value.style.chart.labels.xAxisLabels.fontSize,
            fill: e.value.style.chart.labels.xAxisLabels.color,
            "font-weight": e.value.style.chart.labels.xAxisLabels.bold ? "bold" : "normal",
            "text-anchor": "middle"
          }, A(u(R)(
            e.value.style.chart.labels.formatter,
            t,
            u(z)({
              p: e.value.style.chart.labels.prefix,
              v: t,
              s: e.value.style.chart.labels.suffix,
              r: e.value.style.chart.labels.xAxisLabels.rounding
            }),
            { datapoint: t, seriesIndex: a }
          )), 9, ft))), 256))
        ])) : y("", !0),
        i("defs", null, [
          i("radialGradient", {
            id: `start_grad_${f.value}`,
            fy: "30%"
          }, [
            i("stop", {
              offset: "10%",
              "stop-color": u(xe)(e.value.style.chart.plots.startColor, e.value.style.chart.plots.gradient.intensity / 100)
            }, null, 8, gt),
            i("stop", {
              offset: "90%",
              "stop-color": u(Ce)(e.value.style.chart.plots.startColor, 0.1)
            }, null, 8, pt),
            i("stop", {
              offset: "100%",
              "stop-color": e.value.style.chart.plots.startColor
            }, null, 8, mt)
          ], 8, bt),
          i("radialGradient", {
            id: `end_grad_${f.value}`,
            fy: "30%"
          }, [
            i("stop", {
              offset: "10%",
              "stop-color": u(xe)(e.value.style.chart.plots.endColor, e.value.style.chart.plots.gradient.intensity / 100)
            }, null, 8, kt),
            i("stop", {
              offset: "90%",
              "stop-color": u(Ce)(e.value.style.chart.plots.endColor, 0.1)
            }, null, 8, xt),
            i("stop", {
              offset: "100%",
              "stop-color": e.value.style.chart.plots.endColor
            }, null, 8, Ct)
          ], 8, _t)
        ]),
        (o(!0), r(w, null, $(b.value, (t, a) => (o(), r("g", null, [
          i("defs", null, [
            i("linearGradient", {
              id: `grad_positive_${f.value}`,
              x1: "0%",
              x2: "100%",
              y1: "0%",
              y2: "0%"
            }, [
              i("stop", {
                offset: "0%",
                "stop-color": e.value.style.chart.plots.startColor
              }, null, 8, $t),
              i("stop", {
                offset: "100%",
                "stop-color": e.value.style.chart.plots.endColor
              }, null, 8, Lt)
            ], 8, wt),
            i("linearGradient", {
              id: `grad_negative_${f.value}`,
              x1: "0%",
              x2: "100%",
              y1: "0%",
              y2: "0%"
            }, [
              i("stop", {
                offset: "0%",
                "stop-color": e.value.style.chart.plots.endColor
              }, null, 8, zt),
              i("stop", {
                offset: "100%",
                "stop-color": e.value.style.chart.plots.startColor
              }, null, 8, St)
            ], 8, At)
          ]),
          e.value.style.chart.plots.link.type === "curved" ? (o(), r("g", Xt, [
            i("path", {
              d: `M 
                            ${t.startX},${t.y + e.value.style.chart.plots.radius / 2} 
                            C ${t.centerX},${t.y} ${t.centerX},${t.y} 
                            ${t.endX},${t.y + e.value.style.chart.plots.radius / 2}
                            L ${t.endX},${t.y - e.value.style.chart.plots.radius / 2}
                            C ${t.centerX},${t.y} ${t.centerX},${t.y}
                            ${t.startX},${t.y - e.value.style.chart.plots.radius / 2}
                            Z
                        `,
              fill: t.endX > t.startX ? `url(#grad_positive_${f.value})` : `url(#grad_negative_${f.value})`
            }, null, 8, Nt)
          ])) : (o(), r("g", Tt, [
            i("rect", {
              x: t.endX > t.startX ? t.startX : t.endX,
              y: t.y - e.value.style.chart.plots.link.strokeWidth / 2,
              height: e.value.style.chart.plots.link.strokeWidth,
              width: Math.abs(t.endX - t.startX),
              fill: t.endX > t.startX ? `url(#grad_positive_${f.value})` : `url(#grad_negative_${f.value})`
            }, null, 8, Pt)
          ])),
          i("circle", {
            cx: t.startX,
            cy: t.y,
            r: e.value.style.chart.plots.radius,
            fill: e.value.style.chart.plots.gradient.show ? `url(#start_grad_${f.value})` : e.value.style.chart.plots.startColor,
            stroke: e.value.style.chart.plots.stroke,
            "stroke-width": e.value.style.chart.plots.strokeWidth
          }, null, 8, Ot),
          i("circle", {
            cx: t.endX,
            cy: t.y,
            r: e.value.style.chart.plots.radius,
            fill: e.value.style.chart.plots.gradient.show ? `url(#end_grad_${f.value})` : e.value.style.chart.plots.endColor,
            stroke: e.value.style.chart.plots.stroke,
            "stroke-width": e.value.style.chart.plots.strokeWidth
          }, null, 8, Gt),
          e.value.style.chart.labels.startLabels.show ? (o(), r("g", Mt, [
            (o(!0), r(w, null, $(b.value, (c, g) => (o(), r("text", {
              x: c.startX,
              y: s.value.top + (g + 1) * h.value - e.value.style.chart.labels.startLabels.fontSize / 3 + e.value.style.chart.labels.startLabels.offsetY,
              fill: e.value.style.chart.labels.startLabels.useStartColor ? e.value.style.chart.plots.startColor : e.value.style.chart.labels.startLabels.color,
              "font-size": e.value.style.chart.labels.startLabels.fontSize,
              "text-anchor": "middle"
            }, A(u(R)(
              e.value.style.chart.labels.formatter,
              c.start,
              u(z)({
                p: e.value.style.chart.labels.prefix,
                v: c.start,
                s: e.value.style.chart.labels.suffix,
                r: e.value.style.chart.labels.startLabels.rounding
              }),
              { datapoint: c, seriesIndex: g }
            )), 9, Dt))), 256))
          ])) : y("", !0),
          e.value.style.chart.labels.endLabels.show ? (o(), r("g", It, [
            (o(!0), r(w, null, $(b.value, (c, g) => (o(), r("text", {
              x: c.endX,
              y: s.value.top + g * h.value + e.value.style.chart.labels.endLabels.fontSize + e.value.style.chart.labels.endLabels.offsetY,
              fill: e.value.style.chart.labels.endLabels.useEndColor ? e.value.style.chart.plots.endColor : e.value.style.chart.labels.endLabels.color,
              "font-size": e.value.style.chart.labels.endLabels.fontSize,
              "text-anchor": "middle"
            }, A(u(R)(
              e.value.style.chart.labels.formatter,
              c.end,
              u(z)({
                p: e.value.style.chart.labels.prefix,
                v: c.end,
                s: e.value.style.chart.labels.suffix,
                r: e.value.style.chart.labels.endLabels.rounding
              }),
              { datapoint: c, seriesIndex: g }
            )), 9, Ft))), 256))
          ])) : y("", !0)
        ]))), 256)),
        k(l.$slots, "svg", { svg: s.value }, void 0, !0)
      ], 14, ot)) : y("", !0),
      l.$slots.watermark ? (o(), r("div", Vt, [
        k(l.$slots, "watermark", W(U({ isPrinting: u(oe) || u(re) })), void 0, !0)
      ])) : y("", !0),
      S.value ? y("", !0) : (o(), L(Je, {
        key: 6,
        config: {
          type: "dumbbell",
          style: {
            backgroundColor: e.value.style.chart.backgroundColor,
            dumbbell: {
              color: "#CCCCCC"
            }
          }
        }
      }, null, 8, ["config"])),
      i("div", {
        ref_key: "chartLegend",
        ref: q
      }, [
        e.value.style.chart.legend.show && S.value ? (o(), L(Ke, {
          key: `legend_${Q.value}`,
          legendSet: de.value,
          config: Xe.value
        }, {
          item: _(({ legend: t }) => [
            i("div", {
              style: F(`display:flex;align-items:center;gap:4px;font-size:${e.value.style.chart.legend.fontSize}px`)
            }, [
              (o(), r("svg", {
                xmlns: u(ke),
                viewBox: "0 0 20 20",
                height: e.value.style.chart.legend.fontSize,
                width: e.value.style.chart.legend.fontSize
              }, [
                i("circle", {
                  cx: 10,
                  cy: 10,
                  r: 9,
                  fill: t.color
                }, null, 8, Ht)
              ], 8, Et)),
              ge(" " + A(t.name), 1)
            ], 4)
          ]),
          _: 1
        }, 8, ["legendSet", "config"])) : k(l.$slots, "legend", {
          key: 1,
          legend: de.value
        }, void 0, !0)
      ], 512),
      l.$slots.source ? (o(), r("div", {
        key: 7,
        ref_key: "source",
        ref: Y,
        dir: "auto"
      }, [
        k(l.$slots, "source", {}, void 0, !0)
      ], 512)) : y("", !0),
      S.value ? (o(), L(Qe, {
        key: 8,
        hideDetails: "",
        config: {
          open: O.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: _(() => [
          (o(), L(Ze, {
            key: `table_${K.value}`,
            colNames: M.value.colNames,
            head: M.value.head,
            body: M.value.body,
            config: M.value.config,
            title: `${e.value.style.chart.title.text}${e.value.style.chart.title.subtitle.text ? ` : ${e.value.style.chart.title.subtitle.text}` : ""}`,
            onClose: n[0] || (n[0] = (t) => O.value.showTable = !1)
          }, {
            th: _(({ th: t }) => [
              i("div", {
                innerHTML: t,
                style: { display: "flex", "align-items": "center" }
              }, null, 8, Wt)
            ]),
            td: _(({ td: t }) => [
              ge(A(t.name || t), 1)
            ]),
            _: 1
          }, 8, ["colNames", "head", "body", "config", "title"]))
        ]),
        _: 1
      }, 8, ["config"])) : y("", !0)
    ], 46, st));
  }
}, rl = /* @__PURE__ */ at(Ut, [["__scopeId", "data-v-4603ff8d"]]);
export {
  rl as default
};
