import { computed as y, ref as f, watch as pe, onMounted as Ge, onBeforeUnmount as Ee, createElementBlock as u, openBlock as r, unref as i, normalizeStyle as L, normalizeClass as ge, createBlock as G, createCommentVNode as c, createElementVNode as p, withCtx as N, toDisplayString as O, createSlots as Ue, renderSlot as w, normalizeProps as D, guardReactiveProps as B, createVNode as We, Fragment as g, renderList as S, mergeProps as X } from "vue";
import { u as je, c as Te, t as Le, p as ke, a as De, b as Be, o as be, d as Ve, e as E, g as _e, m as V, I as z, N as qe, X as He, s as q, n as Ze, i as H, f as Z, F as J } from "./index-CTpA678x.js";
import { t as Je, u as Ke } from "./useResponsive-BWapHhVH.js";
import { u as Qe, U as et } from "./usePrinter-WPNAmU6x.js";
import tt from "./vue-ui-skeleton-CU4p-C4n.js";
import { _ as at } from "./Title-Dp1KpSLT.js";
import { u as xe } from "./useNestedProp-B95uADZw.js";
import { _ as lt } from "./PackageVersion-DqLLMNcj.js";
import { P as rt } from "./PenAndPaper-b7rqpk80.js";
import { u as st } from "./useUserOptionState-BIvW1Kz7.js";
import { u as ot } from "./useChartAccessibility-BWojgys7.js";
import { _ as ut } from "./_plugin-vue_export-helper-CHgC5LLL.js";
const nt = ["id"], it = { key: 0 }, ct = ["xmlns", "viewBox"], vt = ["width", "height"], ht = ["id"], dt = ["stop-color"], yt = ["stop-color"], ft = ["stop-color"], mt = ["id"], pt = ["stdDeviation"], gt = { key: 1 }, kt = ["d", "fill", "stroke"], bt = ["d", "fill", "stroke"], _t = ["d", "fill"], xt = ["id", "d"], wt = ["fill", "font-size", "font-weight"], St = ["href", "startOffset"], $t = ["x", "y", "text-anchor", "fill", "font-size", "font-weight"], zt = ["d", "filter"], Ft = ["stroke", "stroke-width"], Ct = ["stroke", "stroke-width"], Ot = ["stroke", "stroke-width"], Mt = ["stroke", "stroke-width"], Pt = { key: 8 }, Nt = ["x", "y", "text-anchor", "font-size", "font-weight", "fill"], Xt = ["x", "y", "font-size", "font-weight", "fill"], It = { key: 0 }, Yt = ["x1", "y1", "x2", "y2", "stroke", "stroke-width"], At = ["x1", "y1", "x2", "y2", "stroke", "stroke-width"], Rt = ["x1", "y1", "x2", "y2", "stroke-width", "filter"], Gt = { key: 1 }, Et = ["d", "fill", "stroke", "stroke-width"], Ut = ["cx", "cy", "fill", "r", "stroke-width", "stroke"], Wt = ["x", "y", "font-size", "fill"], jt = {
  key: 5,
  class: "vue-data-ui-watermark"
}, Tt = {
  __name: "vue-ui-gauge",
  props: {
    config: {
      type: Object,
      default() {
        return {};
      }
    },
    dataset: {
      type: Object,
      default() {
        return {};
      }
    }
  },
  setup(U, { expose: we }) {
    const { vue_ui_gauge: Se } = je(), h = U, I = y(() => !!h.dataset && Object.keys(h.dataset).length > 0 && h.dataset.series && h.dataset.series.length), b = f(Te()), $e = f(null), K = f(0), Y = f(null), Q = f(null), ee = f(null), te = f(null), ae = f(null), le = f(0), e = y({
      get: () => ue(),
      set: (t) => t
    }), { userOptionsVisible: W, setUserOptionsVisibility: re, keepUserOptionState: se } = st({ config: e.value }), { svgRef: oe } = ot({ config: e.value.style.chart.title });
    pe(() => h.config, (t) => {
      e.value = ue(), W.value = !e.value.userOptions.showOnChartHover, de(), le.value += 1;
    }, { deep: !0 });
    function ue() {
      const t = xe({
        userConfig: h.config,
        defaultConfig: Se
      });
      return t.theme ? {
        ...xe({
          userConfig: De.vue_ui_gauge[t.theme] || h.config,
          defaultConfig: t
        }),
        customPalette: Le[t.theme] || ke
      } : t;
    }
    const { isPrinting: ne, isImaging: ie, generatePdf: ce, generateImage: ve } = Qe({
      elementId: `vue-ui-gauge_${b.value}`,
      fileName: e.value.style.chart.title.text || "vue-ui-gauge"
    }), ze = y(() => e.value.userOptions.show && !e.value.style.chart.title.text), Fe = y(() => Be(e.value.customPalette)), F = y(() => {
      if (!I.value || be(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: Ve(a.color) || Fe.value[s] || ke[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
    );
    pe(() => h.dataset.value, () => {
      ye(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)
      };
    }), he = 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, Ie = t + x * Math.cos(a + Math.PI / 2), Ye = o + x * Math.sin(a + Math.PI / 2), Ae = t + x * Math.cos(a - Math.PI / 2), Re = o + x * Math.sin(a - Math.PI / 2);
      return isNaN(s) ? null : `M ${s},${_} ${Ie},${Ye} ${Ae},${Re} Z`;
    }), j = 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";
    }), A = f(null);
    function de() {
      if (be(h.dataset) ? E({
        componentName: "VueUiGauge",
        type: "dataset"
      }) : (_e({
        datasetObject: h.dataset,
        requiredAttributes: ["value", "series"]
      }).forEach((t) => {
        E({
          componentName: "VueUiGauge",
          type: "datasetAttribute",
          property: t
        });
      }), Object.hasOwn(h.dataset, "series") && (h.dataset.series.length ? h.dataset.series.forEach((t, o) => {
        _e({
          datasetObject: t,
          requiredAttributes: ["from", "to"]
        }).forEach((a) => {
          E({
            componentName: "VueUiGauge",
            type: "datasetSerieAttribute",
            property: a,
            index: o
          });
        });
      }) : E({
        componentName: "VueUiGauge",
        type: "datasetAttributeEmpty",
        property: "series"
      }))), ye(h.dataset.value || 0), e.value.responsive) {
        const t = Je(() => {
          const { width: o, height: a } = Ke({
            chart: Y.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
            });
          });
        });
        A.value = new ResizeObserver(t), A.value.observe(Y.value.parentNode);
      }
    }
    Ge(() => {
      de();
    }), Ee(() => {
      A.value && A.value.disconnect();
    });
    function ye(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
    )), Ce = 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))), fe = 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 };
    }), me = 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 Oe(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 Me = y(() => Oe(d.value.map((t) => t.proportion * 100))), Pe = 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
    )), Ne = y(() => {
      const t = $.value >= 0 ? -$.value : Math.abs($.value);
      return qe(
        {
          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)
        }
      );
    }), P = f(!1);
    function Xe(t) {
      P.value = t, K.value += 1;
    }
    const R = f(!1);
    function T() {
      R.value = !R.value;
    }
    return we({
      generatePdf: ce,
      generateImage: ve,
      toggleAnnotator: T
    }), (t, o) => (r(), u("div", {
      class: ge(`vue-ui-gauge ${P.value ? "vue-data-ui-wrapper-fullscreen" : ""}`),
      ref_key: "gaugeChart",
      ref: Y,
      id: `vue-ui-gauge_${b.value}`,
      style: L(`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(), G(rt, {
        key: 0,
        svgRef: i(oe),
        backgroundColor: e.value.style.chart.backgroundColor,
        color: e.value.style.chart.color,
        active: R.value,
        onClose: T
      }, null, 8, ["svgRef", "backgroundColor", "color", "active"])) : c("", !0),
      ze.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(), G(at, {
          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: N(() => [
            e.value.translations.base && U.dataset.base ? (r(), u("span", it, O(e.value.translations.base) + ": " + O(U.dataset.base), 1)) : c("", !0)
          ]),
          _: 1
        }, 8, ["config"]))
      ], 512)) : c("", !0),
      e.value.userOptions.show && I.value && (i(se) || i(W)) ? (r(), G(et, {
        ref_key: "details",
        ref: $e,
        key: `user_options_${K.value}`,
        backgroundColor: e.value.style.chart.backgroundColor,
        color: e.value.style.chart.color,
        isImaging: i(ie),
        isPrinting: i(ne),
        uid: b.value,
        hasXls: !1,
        hasPdf: e.value.userOptions.buttons.pdf,
        hasImg: e.value.userOptions.buttons.img,
        hasFullscreen: e.value.userOptions.buttons.fullscreen,
        isFullscreen: P.value,
        titles: { ...e.value.userOptions.buttonTitles },
        chartElement: Y.value,
        position: e.value.userOptions.position,
        hasAnnotator: e.value.userOptions.buttons.annotator,
        isAnnotation: R.value,
        onToggleFullscreen: Xe,
        onGeneratePdf: i(ce),
        onGenerateImage: i(ve),
        onToggleAnnotator: T,
        style: L({
          visibility: i(se) ? i(W) ? "visible" : "hidden" : "visible"
        })
      }, Ue({ _: 2 }, [
        t.$slots.optionPdf ? {
          name: "optionPdf",
          fn: N(() => [
            w(t.$slots, "optionPdf", {}, void 0, !0)
          ]),
          key: "0"
        } : void 0,
        t.$slots.optionImg ? {
          name: "optionImg",
          fn: N(() => [
            w(t.$slots, "optionImg", {}, void 0, !0)
          ]),
          key: "1"
        } : void 0,
        t.$slots.optionFullscreen ? {
          name: "optionFullscreen",
          fn: N(({ toggleFullscreen: a, isFullscreen: s }) => [
            w(t.$slots, "optionFullscreen", D(B({ toggleFullscreen: a, isFullscreen: s })), void 0, !0)
          ]),
          key: "2"
        } : void 0,
        t.$slots.optionAnnotator ? {
          name: "optionAnnotator",
          fn: N(({ toggleAnnotator: a, isAnnotator: s }) => [
            w(t.$slots, "optionAnnotator", D(B({ 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,
        ref_key: "svgRef",
        ref: oe,
        xmlns: i(He),
        class: ge({ "vue-data-ui-fullscreen--on": P.value, "vue-data-ui-fulscreen--off": !P.value }),
        viewBox: `0 0 ${l.value.width <= 0 ? 10 : l.value.width} ${l.value.height <= 0 ? 10 : l.value.height}`,
        style: L(`max-width:100%;overflow:hidden !important;background:transparent;color:${e.value.style.chart.color}`)
      }, [
        We(lt),
        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, vt)) : 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, dt),
            p("stop", {
              offset: "80%",
              "stop-color": i(q)("#FFFFFF", e.value.style.chart.layout.track.gradientIntensity)
            }, null, 8, yt),
            p("stop", {
              offset: "100%",
              "stop-color": i(q)("#FFFFFF", 1)
            }, null, 8, ft)
          ], 8, ht)
        ]),
        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, pt)
          ], 8, mt)
        ]),
        t.$slots.pattern ? (r(), u("g", gt, [
          (r(!0), u(g, null, S(d.value, (a, s) => (r(), u("defs", null, [
            w(t.$slots, "pattern", X({ ref_for: !0 }, { 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, kt))), 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, bt))), 128)) : c("", !0),
        e.value.style.chart.layout.indicatorArc.show ? (r(), u("path", {
          key: 3,
          d: Ne.value,
          fill: e.value.style.chart.layout.indicatorArc.fill
        }, null, 8, _t)) : 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, xt))), 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: Me.value[s]
            }, O(a.name || ""), 9, St)
          ], 8, wt))), 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(Ce.value, (a, s) => (r(), u("text", {
          x: a.center.endX,
          y: a.center.endY,
          "text-anchor": i(Ze)(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, $t))), 256)) : c("", !0),
        e.value.style.chart.layout.track.useGradient ? (r(!0), u(g, { key: 6 }, S(Pe.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, zt))), 128)) : c("", !0),
        e.value.style.chart.layout.segmentSeparators.show ? (r(), u(g, { key: 7 }, [
          p("line", X(fe.value, {
            stroke: e.value.style.chart.backgroundColor,
            "stroke-width": e.value.style.chart.layout.segmentSeparators.strokeWidth + 2,
            "stroke-linecap": "round"
          }), null, 16, Ft),
          p("line", X(fe.value, {
            stroke: e.value.style.chart.layout.segmentSeparators.stroke,
            "stroke-width": e.value.style.chart.layout.segmentSeparators.strokeWidth,
            "stroke-linecap": "round"
          }), null, 16, Ct),
          (r(!0), u(g, null, S(me.value, (a) => (r(), u("line", X({ ref_for: !0 }, a, {
            stroke: e.value.style.chart.backgroundColor,
            "stroke-width": e.value.style.chart.layout.segmentSeparators.strokeWidth + 2,
            "stroke-linecap": "round"
          }), null, 16, Ot))), 256)),
          (r(!0), u(g, null, S(me.value, (a) => (r(), u("line", X({ ref_for: !0 }, a, {
            stroke: e.value.style.chart.layout.segmentSeparators.stroke,
            "stroke-width": e.value.style.chart.layout.segmentSeparators.strokeWidth,
            "stroke-linecap": "round"
          }), null, 16, Mt))), 256))
        ], 64)) : c("", !0),
        e.value.style.chart.layout.markers.show ? (r(), u("g", Pt, [
          (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, Nt))), 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, Xt)) : 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", It, [
            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, Yt)),
            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 ? j.value : e.value.style.chart.layout.pointer.color,
              "stroke-linecap": "round",
              "stroke-width": l.value.pointerStrokeWidth * 0.7
            }, null, 8, At)),
            !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, Rt)) : c("", !0)
          ])) : (r(), u("g", Gt, [
            he.value ? (r(), u("path", {
              key: 0,
              d: he.value,
              fill: e.value.style.chart.layout.pointer.useRatingColor ? j.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, Et)) : 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, Ut)
        ], 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 ? j.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, Wt)) : c("", !0),
        w(t.$slots, "svg", { svg: l.value }, void 0, !0)
      ], 14, ct)) : c("", !0),
      t.$slots.watermark ? (r(), u("div", jt, [
        w(t.$slots, "watermark", D(B({ isPrinting: i(ne) || i(ie) })), void 0, !0)
      ])) : c("", !0),
      I.value ? c("", !0) : (r(), G(tt, {
        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, nt));
  }
}, aa = /* @__PURE__ */ ut(Tt, [["__scopeId", "data-v-bd4e65a5"]]);
export {
  aa as default
};
