import { computed as y, ref as f, watch as me, onMounted as Re, onBeforeUnmount as Ge, openBlock as r, createElementBlock as u, normalizeClass as pe, normalizeStyle as B, unref as i, createBlock as R, createCommentVNode as c, withCtx as X, toDisplayString as O, createSlots as Ee, renderSlot as w, normalizeProps as G, guardReactiveProps as E, createVNode as Ue, createElementVNode as p, Fragment as g, renderList as S, mergeProps as U } from "vue";
import { u as We, c as je, t as Te, a as Le, p as ge, b as De, o as ke, d as Be, e as W, g as be, m as V, I as z, N as Ve, X as qe, s as q, k as He, i as H, f as Z, F as J } from "./index-OhfEeW2N.js";
import { t as Ze, u as Je } from "./useResponsive-CoxXLe23.js";
import { u as Ke, U as Qe } from "./usePrinter-stvkbwgz.js";
import et from "./vue-ui-skeleton-CZBWPZpy.js";
import { _ as tt } from "./Title-hfEOmPlv.js";
import { u as _e } from "./useNestedProp-Cwjz-hIm.js";
import { _ as at } from "./PackageVersion-DBbbI7TU.js";
import { P as lt } from "./PenAndPaper-tV-SbWUa.js";
import { u as rt } from "./useUserOptionState-BIvW1Kz7.js";
import { _ as st } from "./_plugin-vue_export-helper-CHgC5LLL.js";
const ot = ["id"], ut = { key: 0 }, nt = ["xmlns", "viewBox"], it = ["width", "height"], ct = ["id"], vt = ["stop-color"], ht = ["stop-color"], dt = ["stop-color"], yt = ["id"], ft = ["stdDeviation"], mt = { key: 1 }, pt = ["d", "fill", "stroke"], gt = ["d", "fill", "stroke"], kt = ["d", "fill"], bt = ["id", "d"], _t = ["fill", "font-size", "font-weight"], xt = ["href", "startOffset"], wt = ["x", "y", "text-anchor", "fill", "font-size", "font-weight"], St = ["d", "filter"], $t = ["stroke", "stroke-width"], zt = ["stroke", "stroke-width"], Ft = ["stroke", "stroke-width"], Ct = ["stroke", "stroke-width"], Ot = { key: 8 }, Mt = ["x", "y", "text-anchor", "font-size", "font-weight", "fill"], Pt = ["x", "y", "font-size", "font-weight", "fill"], Nt = { key: 0 }, Xt = ["x1", "y1", "x2", "y2", "stroke", "stroke-width"], It = ["x1", "y1", "x2", "y2", "stroke", "stroke-width"], Yt = ["x1", "y1", "x2", "y2", "stroke-width", "filter"], At = { key: 1 }, Rt = ["d", "fill", "stroke", "stroke-width"], Gt = ["cx", "cy", "fill", "r", "stroke-width", "stroke"], Et = ["x", "y", "font-size", "fill"], Ut = {
  key: 5,
  class: "vue-data-ui-watermark"
}, Wt = {
  __name: "vue-ui-gauge",
  props: {
    config: {
      type: Object,
      default() {
        return {};
      }
    },
    dataset: {
      type: Object,
      default() {
        return {};
      }
    }
  },
  setup(j, { expose: xe }) {
    const h = j, { vue_ui_gauge: we } = We(), I = y(() => !!h.dataset && Object.keys(h.dataset).length > 0 && h.dataset.series && h.dataset.series.length), b = f(je()), Se = f(null), K = f(0), P = f(null), Q = f(null), ee = f(null), te = f(null), ae = f(null), le = f(0), e = y({
      get: () => oe(),
      set: (t) => t
    }), { userOptionsVisible: T, setUserOptionsVisibility: re, keepUserOptionState: se } = rt({ config: e.value });
    me(() => h.config, (t) => {
      e.value = oe(), T.value = !e.value.userOptions.showOnChartHover, he(), le.value += 1;
    }, { deep: !0 });
    function oe() {
      const t = _e({
        userConfig: h.config,
        defaultConfig: we
      });
      return t.theme ? {
        ..._e({
          userConfig: Te.vue_ui_gauge[t.theme] || h.config,
          defaultConfig: t
        }),
        customPalette: Le[t.theme] || ge
      } : t;
    }
    const { isPrinting: ue, isImaging: ne, generatePdf: ie, generateImage: ce } = Ke({
      elementId: `vue-ui-gauge_${b.value}`,
      fileName: e.value.style.chart.title.text || "vue-ui-gauge"
    }), $e = y(() => e.value.userOptions.show && !e.value.style.chart.title.text), ze = y(() => De(e.value.customPalette)), F = y(() => {
      if (!I.value || ke(h.dataset.series || {}))
        return {
          value: 0,
          series: [
            {
              from: 0,
              to: 0
            }
          ]
        };
      const t = [];
      (h.dataset.series || []).forEach((a) => {
        t.push(a.from || 1e-7), t.push(a.to || 1e-7);
      });
      const o = Math.max(...t);
      return {
        ...h.dataset,
        series: (h.dataset.series || []).map((a, s) => ({
          ...a,
          color: Be(a.color) || ze.value[s] || ge[s],
          value: ((a.to || 0) - (a.from || 0)) / o * 100
        }))
      };
    }), k = f(512), l = f({
      height: 358.4,
      width: k.value,
      top: 0,
      bottom: 358.4,
      centerX: 179.2,
      centerY: k.value / 2,
      labelFontSize: 18,
      legendFontSize: e.value.style.chart.legend.fontSize,
      pointerRadius: e.value.style.chart.layout.pointer.circle.radius,
      trackSize: e.value.style.chart.layout.track.size,
      pointerSize: e.value.style.chart.layout.pointer.size,
      pointerStrokeWidth: e.value.style.chart.layout.pointer.strokeWidth,
      markerOffset: e.value.style.chart.layout.markers.offsetY + 3,
      segmentFontSize: e.value.style.chart.layout.segmentNames.fontSize
    }), M = f(0), $ = f(0), m = f(
      e.value.style.chart.animation.use ? Math.min(...h.dataset.series.map((t) => t.from)) : h.dataset.value
    );
    me(() => h.dataset.value, () => {
      de(h.dataset.value);
    });
    const n = y(() => {
      const t = l.value.width / 2, o = v.value.base, a = Math.PI * ((m.value + 0 - $.value) / (M.value - $.value)) + Math.PI;
      return {
        x1: t,
        y1: o,
        x2: t + v.value.pointerSize * l.value.pointerSize * 0.9 * Math.cos(a),
        y2: o + v.value.pointerSize * l.value.pointerSize * 0.9 * Math.sin(a)
      };
    }), ve = y(() => {
      const t = l.value.width / 2, o = v.value.base, a = Math.PI * ((m.value + 0 - $.value) / (M.value - $.value)) + Math.PI, s = t + v.value.pointerSize * l.value.pointerSize * 0.9 * Math.cos(a), _ = o + v.value.pointerSize * l.value.pointerSize * 0.9 * Math.sin(a), x = l.value.pointerRadius, Xe = t + x * Math.cos(a + Math.PI / 2), Ie = o + x * Math.sin(a + Math.PI / 2), Ye = t + x * Math.cos(a - Math.PI / 2), Ae = o + x * Math.sin(a - Math.PI / 2);
      return isNaN(s) ? null : `M ${s},${_} ${Xe},${Ie} ${Ye},${Ae} Z`;
    }), L = y(() => {
      for (let t = 0; t < F.value.series.length; t += 1) {
        const { color: o, from: a, to: s } = F.value.series[t];
        if (m.value >= a && m.value <= s)
          return o;
      }
      return "#2D353C";
    }), Y = f(null);
    function he() {
      if (ke(h.dataset) ? W({
        componentName: "VueUiGauge",
        type: "dataset"
      }) : (be({
        datasetObject: h.dataset,
        requiredAttributes: ["value", "series"]
      }).forEach((t) => {
        W({
          componentName: "VueUiGauge",
          type: "datasetAttribute",
          property: t
        });
      }), Object.hasOwn(h.dataset, "series") && (h.dataset.series.length ? h.dataset.series.forEach((t, o) => {
        be({
          datasetObject: t,
          requiredAttributes: ["from", "to"]
        }).forEach((a) => {
          W({
            componentName: "VueUiGauge",
            type: "datasetSerieAttribute",
            property: a,
            index: o
          });
        });
      }) : W({
        componentName: "VueUiGauge",
        type: "datasetAttributeEmpty",
        property: "series"
      }))), de(h.dataset.value || 0), e.value.responsive) {
        const t = Ze(() => {
          const { width: o, height: a } = Je({
            chart: P.value,
            title: e.value.style.chart.title.text ? Q.value : null,
            legend: ee.value,
            source: te.value,
            noTitle: ae.value
          });
          requestAnimationFrame(() => {
            l.value.width = o, l.value.height = a, l.value.centerX = o / 2, l.value.centerY = k.value / 2 / 358.4 * a, l.value.bottom = a, l.value.labelFontSize = 18 / k.value * Math.min(a, o) < 10 ? 10 : 18 / k.value * Math.min(a, o), l.value.legendFontSize = e.value.style.chart.legend.fontSize / k.value * Math.min(a, o) < 14 ? 14 : e.value.style.chart.legend.fontSize / k.value * Math.min(a, o), l.value.pointerRadius = e.value.style.chart.layout.pointer.circle.radius / k.value * Math.min(a, o), l.value.trackSize = e.value.style.chart.layout.track.size / k.value * Math.min(a, o), l.value.pointerStrokeWidth = J({
              relator: Math.min(o, a),
              adjuster: k.value,
              source: e.value.style.chart.layout.pointer.strokeWidth,
              threshold: 2,
              fallback: 2
            }), l.value.markerOffset = J({
              relator: Math.max(o, a),
              adjuster: k.value,
              source: e.value.style.chart.layout.markers.offsetY + 3,
              threshold: 2,
              fallback: 2
            }), l.value.segmentFontSize = J({
              relator: Math.min(o, a),
              adjuster: k.value,
              source: e.value.style.chart.layout.segmentNames.fontSize,
              threshold: 8,
              fallback: 8
            });
          });
        });
        Y.value = new ResizeObserver(t), Y.value.observe(P.value.parentNode);
      }
    }
    Re(() => {
      he();
    }), Ge(() => {
      Y.value && Y.value.disconnect();
    });
    function de(t) {
      const o = [];
      (F.value.series || []).forEach((x) => {
        o.push(x.from || 0), o.push(x.to || 0);
      }), M.value = Math.max(...o), $.value = Math.min(...o);
      let a = e.value.style.chart.animation.speed;
      const s = Math.abs(t - m.value) / (a * 60);
      function _() {
        m.value < t ? m.value = Math.min(m.value + s, t) : m.value > t && (m.value = Math.max(m.value - s, t)), m.value !== t && requestAnimationFrame(_);
      }
      _();
    }
    const v = y(() => {
      const t = e.value.responsive ? Math.min(l.value.width, l.value.height) : l.value.width, o = 2.5 / e.value.style.chart.layout.radiusRatio;
      return {
        arcs: t / o,
        gradients: t / (o * 1.1),
        base: e.value.responsive ? l.value.height / 2 : l.value.height * 0.7,
        ratingBase: e.value.responsive ? l.value.height / 2 + l.value.height / 4 : l.value.height * 0.9,
        pointerSize: e.value.responsive ? Math.min(l.value.width, l.value.height) / 3 : l.value.width / 3.2
      };
    }), d = y(() => V(
      { series: F.value.series },
      l.value.width / 2,
      v.value.base,
      v.value.arcs,
      v.value.arcs,
      1,
      1,
      1,
      180,
      109.9495,
      40 * l.value.trackSize
    )), Fe = y(() => V(
      { series: F.value.series },
      l.value.width / 2,
      v.value.base,
      v.value.arcs * e.value.style.chart.layout.segmentNames.offsetRatio,
      v.value.arcs * e.value.style.chart.layout.segmentNames.offsetRatio,
      1,
      1,
      1,
      180,
      109.9495,
      40 * l.value.trackSize
    )), C = y(() => d.value.map((t) => v.value.arcs * e.value.style.chart.layout.segmentNames.offsetRatio * (t.nameOffsetRatio || 1))), ye = y(() => {
      const { x: t, y: o } = z({
        initX: d.value[0].firstSeparator.x,
        initY: d.value[0].firstSeparator.y,
        centerX: n.value.x1,
        centerY: n.value.y1,
        offset: -e.value.style.chart.layout.segmentSeparators.offsetIn
      }), { x: a, y: s } = z({
        initX: d.value[0].startX,
        initY: d.value[0].startY,
        centerX: n.value.x1,
        centerY: n.value.y1,
        offset: e.value.style.chart.layout.segmentSeparators.offsetOut
      });
      return { x1: t, y1: o, x2: a, y2: s };
    }), fe = y(() => d.value.map((t) => {
      const { x: o, y: a } = z({
        initX: t.separator.x,
        initY: t.separator.y,
        centerX: n.value.x1,
        centerY: n.value.y1,
        offset: -e.value.style.chart.layout.segmentSeparators.offsetIn
      }), { x: s, y: _ } = z({
        initX: t.endX,
        initY: t.endY,
        centerX: n.value.x1,
        centerY: n.value.y1,
        offset: e.value.style.chart.layout.segmentSeparators.offsetOut
      });
      return { x1: o, y1: a, x2: s, y2: _ };
    }));
    function Ce(t) {
      if (t.reduce((_, x) => _ + x, 0) > 100)
        throw new Error("Total % must not exceed 100");
      const a = 50;
      let s = 0;
      return t.map((_) => (s += _, `${s / 100 * a - _ / 4}%`));
    }
    const Oe = y(() => Ce(d.value.map((t) => t.proportion * 100))), Me = y(() => V(
      { series: F.value.series },
      l.value.width / 2,
      v.value.base,
      v.value.gradients,
      v.value.gradients,
      0.95,
      1,
      1,
      180,
      110.02,
      2 * l.value.trackSize
    )), Pe = y(() => {
      const t = $.value >= 0 ? -$.value : Math.abs($.value);
      return Ve(
        {
          radius: e.value.style.chart.layout.indicatorArc.radius * l.value.trackSize,
          centerX: l.value.width / 2,
          centerY: v.value.base,
          percentage: (m.value + t) / (M.value + t)
        }
      );
    }), N = f(!1);
    function Ne(t) {
      N.value = t, K.value += 1;
    }
    const A = f(!1);
    function D() {
      A.value = !A.value;
    }
    return xe({
      generatePdf: ie,
      generateImage: ce,
      toggleAnnotator: D
    }), (t, o) => (r(), u("div", {
      class: pe(`vue-ui-gauge ${N.value ? "vue-data-ui-wrapper-fullscreen" : ""}`),
      ref_key: "gaugeChart",
      ref: P,
      id: `vue-ui-gauge_${b.value}`,
      style: B(`font-family:${e.value.style.fontFamily};width:100%; text-align:center;background:${e.value.style.chart.backgroundColor};${e.value.responsive ? "height: 100%" : ""}`),
      onMouseenter: o[0] || (o[0] = () => i(re)(!0)),
      onMouseleave: o[1] || (o[1] = () => i(re)(!1))
    }, [
      e.value.userOptions.buttons.annotator ? (r(), R(lt, {
        key: 0,
        parent: P.value,
        backgroundColor: e.value.style.chart.backgroundColor,
        color: e.value.style.chart.color,
        active: A.value,
        onClose: D
      }, null, 8, ["parent", "backgroundColor", "color", "active"])) : c("", !0),
      $e.value ? (r(), u("div", {
        key: 1,
        ref_key: "noTitle",
        ref: ae,
        class: "vue-data-ui-no-title-space",
        style: "height:36px; width: 100%;background:transparent"
      }, null, 512)) : c("", !0),
      e.value.style.chart.title.text ? (r(), u("div", {
        key: 2,
        ref_key: "chartTitle",
        ref: Q,
        style: "width:100%;background:transparent;padding-bottom:12px"
      }, [
        (r(), R(tt, {
          key: `title_${le.value}`,
          config: {
            title: {
              cy: "gauge-div-title",
              ...e.value.style.chart.title
            },
            subtitle: {
              cy: "gauge-div-subtitle",
              ...e.value.style.chart.title.subtitle
            }
          }
        }, {
          default: X(() => [
            e.value.translations.base && j.dataset.base ? (r(), u("span", ut, O(e.value.translations.base) + ": " + O(j.dataset.base), 1)) : c("", !0)
          ]),
          _: 1
        }, 8, ["config"]))
      ], 512)) : c("", !0),
      e.value.userOptions.show && I.value && (i(se) || i(T)) ? (r(), R(Qe, {
        ref_key: "details",
        ref: Se,
        key: `user_options_${K.value}`,
        backgroundColor: e.value.style.chart.backgroundColor,
        color: e.value.style.chart.color,
        isImaging: i(ne),
        isPrinting: i(ue),
        uid: b.value,
        hasXls: !1,
        hasPdf: e.value.userOptions.buttons.pdf,
        hasImg: e.value.userOptions.buttons.img,
        hasFullscreen: e.value.userOptions.buttons.fullscreen,
        isFullscreen: N.value,
        titles: { ...e.value.userOptions.buttonTitles },
        chartElement: P.value,
        position: e.value.userOptions.position,
        hasAnnotator: e.value.userOptions.buttons.annotator,
        isAnnotation: A.value,
        onToggleFullscreen: Ne,
        onGeneratePdf: i(ie),
        onGenerateImage: i(ce),
        onToggleAnnotator: D,
        style: B({
          visibility: i(se) ? i(T) ? "visible" : "hidden" : "visible"
        })
      }, Ee({ _: 2 }, [
        t.$slots.optionPdf ? {
          name: "optionPdf",
          fn: X(() => [
            w(t.$slots, "optionPdf", {}, void 0, !0)
          ]),
          key: "0"
        } : void 0,
        t.$slots.optionImg ? {
          name: "optionImg",
          fn: X(() => [
            w(t.$slots, "optionImg", {}, void 0, !0)
          ]),
          key: "1"
        } : void 0,
        t.$slots.optionFullscreen ? {
          name: "optionFullscreen",
          fn: X(({ toggleFullscreen: a, isFullscreen: s }) => [
            w(t.$slots, "optionFullscreen", G(E({ toggleFullscreen: a, isFullscreen: s })), void 0, !0)
          ]),
          key: "2"
        } : void 0,
        t.$slots.optionAnnotator ? {
          name: "optionAnnotator",
          fn: X(({ toggleAnnotator: a, isAnnotator: s }) => [
            w(t.$slots, "optionAnnotator", G(E({ toggleAnnotator: a, isAnnotator: s })), void 0, !0)
          ]),
          key: "3"
        } : void 0
      ]), 1032, ["backgroundColor", "color", "isImaging", "isPrinting", "uid", "hasPdf", "hasImg", "hasFullscreen", "isFullscreen", "titles", "chartElement", "position", "hasAnnotator", "isAnnotation", "onGeneratePdf", "onGenerateImage", "style"])) : c("", !0),
      I.value ? (r(), u("svg", {
        key: 4,
        xmlns: i(qe),
        class: pe({ "vue-data-ui-fullscreen--on": N.value, "vue-data-ui-fulscreen--off": !N.value }),
        viewBox: `0 0 ${l.value.width <= 0 ? 10 : l.value.width} ${l.value.height <= 0 ? 10 : l.value.height}`,
        style: B(`max-width:100%;overflow:hidden !important;background:transparent;color:${e.value.style.chart.color}`)
      }, [
        Ue(at),
        t.$slots["chart-background"] ? (r(), u("foreignObject", {
          key: 0,
          x: 0,
          y: 0,
          width: l.value.width <= 0 ? 10 : l.value.width,
          height: l.value.height <= 0 ? 10 : l.value.height,
          style: {
            pointerEvents: "none"
          }
        }, [
          w(t.$slots, "chart-background", {}, void 0, !0)
        ], 8, it)) : c("", !0),
        p("defs", null, [
          p("radialGradient", {
            id: `gradient_${b.value}`,
            cx: "50%",
            cy: "50%",
            r: "50%",
            fx: "50%",
            fy: "50%"
          }, [
            p("stop", {
              offset: "0%",
              "stop-color": i(q)("#FFFFFF", 1)
            }, null, 8, vt),
            p("stop", {
              offset: "80%",
              "stop-color": i(q)("#FFFFFF", e.value.style.chart.layout.track.gradientIntensity)
            }, null, 8, ht),
            p("stop", {
              offset: "100%",
              "stop-color": i(q)("#FFFFFF", 1)
            }, null, 8, dt)
          ], 8, ct)
        ]),
        p("defs", null, [
          p("filter", {
            id: `blur_${b.value}`,
            x: "-50%",
            y: "-50%",
            width: "200%",
            height: "200%"
          }, [
            p("feGaussianBlur", {
              in: "SourceGraphic",
              stdDeviation: 100 / e.value.style.chart.layout.track.gradientIntensity
            }, null, 8, ft)
          ], 8, yt)
        ]),
        t.$slots.pattern ? (r(), u("g", mt, [
          (r(!0), u(g, null, S(d.value, (a, s) => (r(), u("defs", null, [
            w(t.$slots, "pattern", G(E({ seriesIndex: s, patternId: `pattern_${b.value}_${s}` })), void 0, !0)
          ]))), 256))
        ])) : c("", !0),
        (r(!0), u(g, null, S(d.value, (a, s) => (r(), u("path", {
          key: `arc_${s}`,
          d: a.arcSlice,
          fill: a.color,
          stroke: e.value.style.chart.backgroundColor,
          "stroke-linecap": "round"
        }, null, 8, pt))), 128)),
        t.$slots.pattern ? (r(!0), u(g, { key: 2 }, S(d.value, (a, s) => (r(), u("path", {
          key: `arc_${s}`,
          d: a.arcSlice,
          fill: `url(#pattern_${b.value}_${s})`,
          stroke: e.value.style.chart.backgroundColor,
          "stroke-linecap": "round"
        }, null, 8, gt))), 128)) : c("", !0),
        e.value.style.chart.layout.indicatorArc.show ? (r(), u("path", {
          key: 3,
          d: Pe.value,
          fill: e.value.style.chart.layout.indicatorArc.fill
        }, null, 8, kt)) : c("", !0),
        e.value.style.chart.layout.segmentNames.show && e.value.style.chart.layout.segmentNames.curved ? (r(), u(g, { key: 4 }, [
          (r(!0), u(g, null, S(d.value, (a, s) => (r(), u("path", {
            id: `curve_${b.value}_${s}`,
            d: `M ${n.value.x1},${n.value.y1} m -${C.value[s]},0 a ${C.value[s]},${C.value[s]} 0 1,1 ${2 * C.value[s]},0 a ${C.value[s]},${C.value[s]} 0 1,1 -${2 * C.value[s]},0`,
            fill: "transparent"
          }, null, 8, bt))), 256)),
          (r(!0), u(g, null, S(d.value, (a, s) => (r(), u("text", {
            fill: e.value.style.chart.layout.segmentNames.useSerieColor ? a.color : e.value.style.chart.layout.segmentNames.color,
            "font-size": l.value.segmentFontSize,
            "font-weight": e.value.style.chart.layout.segmentNames.bold ? "bold" : "normal",
            "text-anchor": "middle"
          }, [
            p("textPath", {
              href: `#curve_${b.value}_${s}`,
              startOffset: Oe.value[s]
            }, O(a.name || ""), 9, xt)
          ], 8, _t))), 256))
        ], 64)) : c("", !0),
        e.value.style.chart.layout.segmentNames.show && !e.value.style.chart.layout.segmentNames.curved ? (r(!0), u(g, { key: 5 }, S(Fe.value, (a, s) => (r(), u("text", {
          x: a.center.endX,
          y: a.center.endY,
          "text-anchor": i(He)(a, !1, 12).anchor,
          fill: e.value.style.chart.layout.segmentNames.useSerieColor ? a.color : e.value.style.chart.layout.segmentNames.color,
          "font-size": l.value.segmentFontSize,
          "font-weight": e.value.style.chart.layout.segmentNames.bold ? "bold" : "normal"
        }, O(a.name || ""), 9, wt))), 256)) : c("", !0),
        e.value.style.chart.layout.track.useGradient ? (r(!0), u(g, { key: 6 }, S(Me.value, (a, s) => (r(), u("path", {
          key: `arc_${s}`,
          d: a.arcSlice,
          fill: "#FFFFFF",
          stroke: "none",
          "stroke-linecap": "round",
          filter: `url(#blur_${b.value})`
        }, null, 8, St))), 128)) : c("", !0),
        e.value.style.chart.layout.segmentSeparators.show ? (r(), u(g, { key: 7 }, [
          p("line", U(ye.value, {
            stroke: e.value.style.chart.backgroundColor,
            "stroke-width": e.value.style.chart.layout.segmentSeparators.strokeWidth + 2,
            "stroke-linecap": "round"
          }), null, 16, $t),
          p("line", U(ye.value, {
            stroke: e.value.style.chart.layout.segmentSeparators.stroke,
            "stroke-width": e.value.style.chart.layout.segmentSeparators.strokeWidth,
            "stroke-linecap": "round"
          }), null, 16, zt),
          (r(!0), u(g, null, S(fe.value, (a) => (r(), u("line", U(a, {
            stroke: e.value.style.chart.backgroundColor,
            "stroke-width": e.value.style.chart.layout.segmentSeparators.strokeWidth + 2,
            "stroke-linecap": "round"
          }), null, 16, Ft))), 256)),
          (r(!0), u(g, null, S(fe.value, (a) => (r(), u("line", U(a, {
            stroke: e.value.style.chart.layout.segmentSeparators.stroke,
            "stroke-width": e.value.style.chart.layout.segmentSeparators.strokeWidth,
            "stroke-linecap": "round"
          }), null, 16, Ct))), 256))
        ], 64)) : c("", !0),
        e.value.style.chart.layout.markers.show ? (r(), u("g", Ot, [
          (r(!0), u(g, null, S(d.value, (a, s) => (r(), u("text", {
            x: i(z)({
              centerX: n.value.x1,
              centerY: v.value.base,
              initX: a.center.startX,
              initY: a.center.startY,
              offset: l.value.markerOffset
            }).x,
            y: i(z)({
              centerX: n.value.x1,
              centerY: v.value.base,
              initX: a.center.startX,
              initY: a.center.startY,
              offset: l.value.markerOffset
            }).y,
            "text-anchor": a.center.startX < n.value.x1 - 5 ? "end" : a.center.startX > n.value.x1 + 5 ? "start" : "middle",
            "font-size": l.value.labelFontSize * e.value.style.chart.layout.markers.fontSizeRatio,
            "font-weight": `${e.value.style.chart.layout.markers.bold ? "bold" : "normal"}`,
            fill: e.value.style.chart.layout.markers.color
          }, O(i(H)(
            e.value.style.chart.layout.markers.formatter,
            a.from,
            i(Z)({
              p: e.value.style.chart.layout.markers.prefix,
              v: a.from,
              s: e.value.style.chart.layout.markers.suffix,
              r: e.value.style.chart.layout.markers.roundingValue
            })
          )), 9, Mt))), 256))
        ])) : c("", !0),
        e.value.style.chart.layout.markers.show ? (r(), u("text", {
          key: 9,
          x: i(z)({
            centerX: l.value.width / 2,
            centerY: v.value.base,
            initX: d.value.at(-1).endX,
            initY: d.value.at(-1).endY,
            offset: l.value.markerOffset
          }).x,
          y: i(z)({
            centerX: l.value.width / 2,
            centerY: v.value.base,
            initX: d.value.at(-1).endX,
            initY: d.value.at(-1).endY,
            offset: l.value.markerOffset
          }).y,
          "text-anchor": "start",
          "font-size": l.value.labelFontSize * e.value.style.chart.layout.markers.fontSizeRatio,
          "font-weight": `${e.value.style.chart.layout.markers.bold ? "bold" : "normal"}`,
          fill: e.value.style.chart.layout.markers.color
        }, O(i(H)(
          e.value.style.chart.layout.markers.formatter,
          M.value,
          i(Z)({
            p: e.value.style.chart.layout.markers.prefix,
            v: M.value,
            s: e.value.style.chart.layout.markers.suffix,
            r: e.value.style.chart.layout.markers.roundingValue
          })
        )), 9, Pt)) : c("", !0),
        e.value.style.chart.layout.pointer.show ? (r(), u(g, { key: 10 }, [
          e.value.style.chart.layout.pointer.type === "rounded" ? (r(), u("g", Nt, [
            isNaN(n.value.x2) ? c("", !0) : (r(), u("line", {
              key: 0,
              x1: n.value.x1,
              y1: n.value.y1,
              x2: n.value.x2,
              y2: n.value.y2,
              stroke: e.value.style.chart.layout.pointer.stroke,
              "stroke-width": l.value.pointerStrokeWidth,
              "stroke-linecap": "round"
            }, null, 8, Xt)),
            isNaN(n.value.x2) ? c("", !0) : (r(), u("line", {
              key: 1,
              x1: n.value.x1,
              y1: n.value.y1,
              x2: n.value.x2,
              y2: n.value.y2,
              stroke: e.value.style.chart.layout.pointer.useRatingColor ? L.value : e.value.style.chart.layout.pointer.color,
              "stroke-linecap": "round",
              "stroke-width": l.value.pointerStrokeWidth * 0.7
            }, null, 8, It)),
            !isNaN(n.value.x2) && e.value.style.chart.layout.track.useGradient ? (r(), u("line", {
              key: 2,
              x1: n.value.x1,
              y1: n.value.y1,
              x2: n.value.x2,
              y2: n.value.y2,
              stroke: "white",
              "stroke-linecap": "round",
              "stroke-width": l.value.pointerStrokeWidth * 0.3,
              filter: `url(#blur_${b.value})`
            }, null, 8, Yt)) : c("", !0)
          ])) : (r(), u("g", At, [
            ve.value ? (r(), u("path", {
              key: 0,
              d: ve.value,
              fill: e.value.style.chart.layout.pointer.useRatingColor ? L.value : e.value.style.chart.layout.pointer.color,
              stroke: e.value.style.chart.layout.pointer.stroke,
              "stroke-width": e.value.style.chart.layout.pointer.circle.strokeWidth,
              "stroke-linejoin": "round"
            }, null, 8, Rt)) : c("", !0)
          ])),
          p("circle", {
            cx: l.value.width / 2,
            cy: v.value.base,
            fill: e.value.style.chart.layout.pointer.circle.color,
            r: l.value.pointerRadius <= 0 ? 1e-4 : l.value.pointerRadius,
            "stroke-width": e.value.style.chart.layout.pointer.circle.strokeWidth,
            stroke: e.value.style.chart.layout.pointer.circle.stroke
          }, null, 8, Gt)
        ], 64)) : c("", !0),
        e.value.style.chart.legend.show ? (r(), u("text", {
          key: 11,
          x: l.value.width / 2,
          y: v.value.ratingBase,
          "text-anchor": "middle",
          "font-size": l.value.legendFontSize,
          "font-weight": "bold",
          fill: e.value.style.chart.legend.useRatingColor ? L.value : e.value.style.chart.legend.color
        }, O(i(H)(
          e.value.style.chart.legend.formatter,
          m.value,
          i(Z)({
            p: e.value.style.chart.legend.prefix + (e.value.style.chart.legend.showPlusSymbol && m.value > 0 ? "+" : ""),
            v: m.value,
            s: e.value.style.chart.legend.suffix,
            r: e.value.style.chart.legend.roundingValue
          })
        )), 9, Et)) : c("", !0),
        w(t.$slots, "svg", { svg: l.value }, void 0, !0)
      ], 14, nt)) : c("", !0),
      t.$slots.watermark ? (r(), u("div", Ut, [
        w(t.$slots, "watermark", G(E({ isPrinting: i(ue) || i(ne) })), void 0, !0)
      ])) : c("", !0),
      I.value ? c("", !0) : (r(), R(et, {
        key: 6,
        config: {
          type: "gauge",
          style: {
            backgroundColor: e.value.style.chart.backgroundColor,
            gauge: {
              color: "#CCCCCC"
            }
          }
        }
      }, null, 8, ["config"])),
      p("div", {
        ref_key: "chartLegend",
        ref: ee
      }, [
        w(t.$slots, "legend", { legend: F.value }, void 0, !0)
      ], 512),
      t.$slots.source ? (r(), u("div", {
        key: 7,
        ref_key: "source",
        ref: te,
        dir: "auto"
      }, [
        w(t.$slots, "source", {}, void 0, !0)
      ], 512)) : c("", !0)
    ], 46, ot));
  }
}, Qt = /* @__PURE__ */ st(Wt, [["__scopeId", "data-v-dbac9b9f"]]);
export {
  Qt as default
};
