import { computed as g, ref as c, watch as Ge, onMounted as He, onBeforeUnmount as Xe, openBlock as u, createElementBlock as i, normalizeClass as U, normalizeStyle as T, unref as b, createBlock as z, createCommentVNode as m, createSlots as Ye, withCtx as k, renderSlot as x, normalizeProps as W, guardReactiveProps as V, createVNode as _e, Fragment as w, renderList as I, createElementVNode as F, toDisplayString as D, createTextVNode as qe } from "vue";
import { u as Qe, c as Z, t as Je, a as Ke, p as G, o as Ze, e as Me, g as et, b as tt, d as at, D as lt, Q as ot, R as st, S as nt, X as ut, x as ze, i as Ie, f as Fe, y as it, q as rt, r as ct, F as H } from "./index-BbPeL8Gp.js";
import { t as vt, u as dt } from "./useResponsive-CoxXLe23.js";
import { _ as ht } from "./Title-aSAft5dl.js";
import { L as pt } from "./Legend-BLaZxMge.js";
import { _ as mt } from "./Tooltip-smutPF--.js";
import { _ as yt } from "./Shape-DIKzzpFm.js";
import { u as ft, U as gt } from "./usePrinter-DaybDVqP.js";
import { D as bt } from "./DataTable-DGf6RrOJ.js";
import xt from "./vue-ui-accordion-5d5iVpr7.js";
import kt from "./vue-ui-skeleton-Bniq21d9.js";
import { u as Pe } from "./useNestedProp-BN8claGG.js";
import { _ as Ct } from "./PackageVersion-CxJghxYD.js";
import { P as wt } from "./PenAndPaper-ZdZEumki.js";
import { u as $t } from "./useUserOptionState-BIvW1Kz7.js";
import { _ as At } from "./_plugin-vue_export-helper-CHgC5LLL.js";
const Tt = ["id"], _t = ["xmlns", "viewBox"], Mt = { style: { "pointer-events": "none" } }, zt = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], It = ["x", "y", "fill", "font-size", "font-weight"], Ft = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], Pt = ["x", "y", "fill", "font-size", "font-weight"], Nt = { key: 0 }, St = ["x", "y", "font-size", "fill"], Lt = ["width", "x", "y"], Ot = { style: { width: "100%" } }, Dt = ["x", "y", "fill", "font-weight", "font-size", "onMouseenter"], Ut = ["d", "stroke", "stroke-width", "onMouseenter"], Wt = ["d", "onMouseenter"], Vt = {
  key: 5,
  class: "vue-data-ui-watermark"
}, Bt = ["onClick"], Et = ["innerHTML"], Rt = {
  __name: "vue-ui-parallel-coordinate-plot",
  props: {
    config: {
      type: Object,
      default() {
        return {};
      }
    },
    dataset: {
      type: Array,
      default() {
        return [];
      }
    }
  },
  emits: ["selectLegend", "selectDatapoint"],
  setup(Ne, { expose: Se, emit: ee }) {
    const _ = Ne, { vue_ui_parallel_coordinate_plot: Le } = Qe(), P = g({
      get() {
        return !!_.dataset && _.dataset.length;
      },
      set(t) {
        return t;
      }
    }), te = c(0), N = c(null), ae = c(null), le = c(null), oe = c(null), se = c(null), ne = c(0), ue = c(0), ie = c(0), X = c(Z()), S = c(!1);
    function Oe(t) {
      S.value = t, te.value += 1;
    }
    const e = g({
      get: () => de(),
      set: (t) => t
    }), { userOptionsVisible: re, setUserOptionsVisibility: ce, keepUserOptionState: ve } = $t({ config: e.value });
    function de() {
      const t = Pe({
        userConfig: _.config,
        defaultConfig: Le
      });
      return t.theme ? {
        ...Pe({
          userConfig: Je.vue_ui_parallel_coordinate_plot[t.theme] || _.config,
          defaultConfig: t
        }),
        customPalette: Ke[t.theme] || G
      } : t;
    }
    Ge(() => _.config, (t) => {
      e.value = de(), he(), ne.value += 1, ie.value += 1, ue.value += 1;
    }, { deep: !0 });
    const B = c(null);
    He(() => {
      he();
    });
    function he() {
      if (Ze(_.dataset) ? Me({
        componentName: "VueUiParallelCoordinatePlot",
        type: "dataset"
      }) : _.dataset.forEach((t, l) => {
        et({
          datasetObject: t,
          requiredAttributes: ["name", "series"]
        }).forEach((a) => {
          P.value = !1, Me({
            componentName: "VueUiParallelCoordinatePlot",
            type: "datasetSerieAttribute",
            property: a,
            index: l
          });
        });
      }), e.value.responsive) {
        const t = vt(() => {
          const { width: l, height: a } = dt({
            chart: N.value,
            title: e.value.style.chart.title.text ? ae.value : null,
            legend: e.value.style.chart.legend.show ? le.value : null,
            source: oe.value,
            noTitle: se.value
          });
          v.value.width = l, v.value.height = a, v.value.plotSize = H({
            relator: Math.min(l, a),
            adjuster: 600,
            source: e.value.style.chart.plots.radius,
            threshold: 2,
            fallback: 2
          }), v.value.ticksFontSize = H({
            relator: Math.min(l, a),
            adjuster: 600,
            source: e.value.style.chart.yAxis.labels.ticks.fontSize,
            threshold: 10,
            fallback: 10
          }), v.value.datapointFontSize = H({
            relator: Math.min(l, a),
            adjuster: 600,
            source: e.value.style.chart.yAxis.labels.datapoints.fontSize,
            threshold: 10,
            fallback: 10
          }), v.value.axisNameFontSize = H({
            relator: Math.min(l, a),
            adjuster: 600,
            source: e.value.style.chart.yAxis.labels.axisNamesFontSize,
            threshold: 12,
            fallback: 12
          });
        });
        B.value = new ResizeObserver(t), B.value.observe(N.value.parentNode);
      }
    }
    Xe(() => {
      B.value && B.value.disconnect();
    });
    const { isPrinting: pe, isImaging: me, generatePdf: ye, generateImage: fe } = ft({
      elementId: `pcp_${X.value}`,
      fileName: e.value.style.chart.title.text || "vue-ui-parallel-coordinate-plot"
    }), De = g(() => e.value.userOptions.show && !e.value.style.chart.title.text), v = c({
      height: e.value.style.chart.height,
      width: e.value.style.chart.width,
      plotSize: e.value.style.chart.plots.radius,
      // ratio 100
      ticksFontSize: e.value.style.chart.yAxis.labels.ticks.fontSize,
      // ratio 42.85
      datapointFontSize: e.value.style.chart.yAxis.labels.datapoints.fontSize,
      axisNameFontSize: e.value.style.chart.yAxis.labels.axisNamesFontSize
    }), d = g(() => {
      const { top: t, right: l, bottom: a, left: o } = e.value.style.chart.padding, n = v.value.height, s = v.value.width;
      return {
        chartHeight: n,
        chartWidth: s,
        height: n - t - a,
        width: s - o - l,
        top: t,
        left: o,
        right: s - l,
        bottom: n - a
      };
    }), Ue = g(() => tt(e.value.customPalette)), y = c({
      dataLabels: {
        show: e.value.style.chart.yAxis.labels.datapoints.show
      },
      showTable: e.value.table.show,
      showTooltip: e.value.style.chart.tooltip.show
    }), $ = c([]);
    function ge(t) {
      $.value.includes(t) ? $.value = $.value.filter((l) => l !== t) : $.value.push(t);
    }
    const M = g(() => _.dataset.map((t, l) => {
      const a = at(t.color) || Ue.value[l] || G[l] || G[l % G.length];
      return {
        ...t,
        series: t.series.map((o) => ({
          ...o,
          id: Z(),
          color: a
        })),
        seriesIndex: l,
        color: a,
        id: Z(),
        shape: t.shape || "circle"
      };
    })), We = g(() => M.value.map((t) => ({
      ...t,
      opacity: $.value.includes(t.id) ? 0.5 : 1,
      segregate: () => ge(t.id),
      isSegregated: $.value.includes(t.id)
    }))), Ve = g(() => ({
      cy: "pcp-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,
      fontWeight: e.value.style.chart.legend.bold ? "bold" : ""
    })), be = g(() => Math.max(
      ...M.value.filter((t) => !$.value.includes(t.id)).map((t) => Math.max(...t.series.flatMap((l) => l.values.length)))
    )), C = g(() => d.value.width / be.value), Y = g(() => M.value.filter((t) => !$.value.includes(t.id))), f = g(() => {
      let t = [];
      for (let l = 0; l < be.value; l += 1) {
        const a = Math.min(...Y.value.flatMap((h) => h.series.map((j) => j.values[l] || 0) || 0)), o = Math.max(...Y.value.flatMap((h) => h.series.map((j) => j.values[l] || 0) || 0)), n = o === a ? a / 4 : a, s = o === a ? o * 2 : o, r = lt(n, s, e.value.style.chart.yAxis.scaleTicks), A = r.ticks.map((h, j) => {
          const Re = r.min < 0 ? h + Math.abs(r.min) : h - Math.abs(r.min), je = r.min < 0 ? r.max + Math.abs(r.min) : r.max - Math.abs(r.min);
          return {
            y: d.value.bottom - d.value.height * (Re / je),
            x: d.value.left + C.value * l + C.value / 2,
            value: h
          };
        });
        t.push({
          scale: r,
          ticks: A,
          name: e.value.style.chart.yAxis.labels.axisNames[l] || `Y-${l + 1}`
        });
      }
      return t;
    }), q = g(() => Y.value.map((t, l) => ({
      ...t,
      series: t.series.map((a, o) => ({
        ...a,
        datapoints: a.values.map((n, s) => {
          const r = f.value[s].scale.min < 0 ? (n || 0) + Math.abs(f.value[s].scale.min) : (n || 0) - Math.abs(f.value[s].scale.min), A = f.value[s].scale.min < 0 ? f.value[s].scale.max + Math.abs(f.value[s].scale.min) : f.value[s].scale.max - Math.abs(f.value[s].scale.min);
          return {
            name: a.name,
            seriesName: t.name,
            axisIndex: s,
            datapointIndex: o,
            seriesIndex: l,
            value: n || 0,
            x: d.value.left + C.value * s + C.value / 2,
            y: d.value.bottom - d.value.height * (r / A),
            comment: a.comments && a.comments[s] || ""
          };
        })
      }))
    })).map((t) => ({
      ...t,
      series: t.series.map((l) => {
        const a = ot(l.datapoints), o = st(l.datapoints), n = nt(e.value.style.chart.lines.smooth ? `M ${o}` : `M ${a}`);
        return {
          ...l,
          smoothPath: o,
          straightPath: a,
          pathLength: n
        };
      })
    })));
    function xe({ value: t, index: l, datapoint: a }) {
      return Ie(
        e.value.style.chart.yAxis.labels.formatters[l] || null,
        t,
        Fe({
          p: e.value.style.chart.yAxis.labels.prefixes[l] || "",
          v: t,
          s: e.value.style.chart.yAxis.labels.suffixes[l] || "",
          r: e.value.style.chart.yAxis.labels.roundings[l] || 0
        }),
        { datapoint: a, seriesIndex: l }
      );
    }
    const p = c(null), Q = c(null), L = c(!1), J = c("");
    function E({ shape: t, serieName: l, serie: a, relativeIndex: o, seriesIndex: n }) {
      Q.value = { serie: a, relativeIndex: o, seriesIndex: n, series: M.value, scales: f.value }, L.value = !0, p.value = a.id;
      let s = "";
      const r = e.value.style.chart.tooltip.customFormat;
      ze(r) && it(() => r({
        serie: a,
        seriesIndex: a.seriesIndex,
        series: M.value,
        config: e.value,
        scales: f.value
      })) ? J.value = r({
        serie: a,
        seriesIndex: a.seriesIndex,
        series: M.value,
        config: e.value,
        scales: f.value
      }) : (s += `<div style="width:100%;text-align:center;border-bottom:1px solid ${e.value.style.chart.tooltip.borderColor};padding-bottom:6px;margin-bottom:3px;">${l ? l + " - " : ""}${a.name}</div>`, f.value.map((A) => A.name).forEach((A, h) => {
        s += `
                <div class="vue-ui-tooltip-item" style="text-align:left">
                    <span>${A}: </span>
                    <span>
                        ${Ie(
          e.value.style.chart.yAxis.labels.formatters[h] || null,
          a.datapoints[h].value,
          Fe({
            p: e.value.style.chart.yAxis.labels.prefixes[h] || "",
            v: a.datapoints[h].value,
            s: e.value.style.chart.yAxis.labels.suffixes[h] || "",
            r: e.value.style.chart.yAxis.labels.roundings[h] || ""
          }),
          { datapoint: a.datapoints[h], seriesIndex: h }
        )}    
                    </span>
                </div>
            `, e.value.style.chart.comments.showInTooltip && a.datapoints[h].comment && (s += `<div class="vue-data-ui-tooltip-comment" style="background:${a.color}20; padding: 6px; margin-bottom: 6px; border-left: 1px solid ${a.color}">${a.datapoints[h].comment}</div>`);
      }), J.value = `<div>${s}</div>`);
    }
    function Be() {
      return M.value;
    }
    const O = g(() => {
      const t = [e.value.table.columnNames.series].concat([e.value.table.columnNames.item]).concat(f.value.map((n) => n.name)), l = q.value.flatMap((n, s) => n.series.map((r) => [n.name].concat([r.name]).concat(r.values))), a = {
        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
      }, o = [e.value.table.columnNames.series].concat([e.value.table.columnNames.item]).concat(f.value.map((n) => n.name));
      return {
        body: l,
        head: t,
        config: a,
        colNames: o
      };
    }), ke = g(() => q.value.length === 0 ? { head: [], body: [], config: {}, columnNames: [] } : {
      head: O.value.head,
      body: O.value.body
    });
    function Ce() {
      const t = [[e.value.style.chart.title.text], [e.value.style.chart.title.subtitle.text], [""]], l = ke.value.head, a = ke.value.body, o = t.concat([l]).concat(a), n = rt(o);
      ct({ csvContent: n, title: e.value.style.chart.title.text || "vue-ui-parallel-coordinate-plot" });
    }
    function Ee(t) {
      ee("selectDatapoint", t);
    }
    function we(t) {
      ee("selectLegend", {
        ...t,
        isSegregated: !t.isSegregated,
        opacity: t.isSegregated ? 1 : 0.5
      });
    }
    function $e() {
      y.value.showTable = !y.value.showTable;
    }
    function Ae() {
      y.value.dataLabels.show = !y.value.dataLabels.show;
    }
    function Te() {
      y.value.showTooltip = !y.value.showTooltip;
    }
    const R = c(!1);
    function K() {
      R.value = !R.value;
    }
    return Se({
      getData: Be,
      generateCsv: Ce,
      generatePdf: ye,
      generateImage: fe,
      toggleTable: $e,
      toggleLabels: Ae,
      toggleTooltip: Te,
      toggleAnnotator: K
    }), (t, l) => (u(), i("div", {
      ref_key: "pcpChart",
      ref: N,
      class: U(`vue-ui-pcp ${S.value ? "vue-data-ui-wrapper-fullscreen" : ""} ${e.value.useCssAnimation ? "" : "vue-ui-dna"}`),
      style: T(`font-family:${e.value.style.fontFamily};width:100%; text-align:center;background:${e.value.style.chart.backgroundColor};${e.value.responsive ? "height:100%" : ""}`),
      id: `pcp_${X.value}`,
      onMouseenter: l[6] || (l[6] = () => b(ce)(!0)),
      onMouseleave: l[7] || (l[7] = () => b(ce)(!1))
    }, [
      e.value.userOptions.buttons.annotator ? (u(), z(wt, {
        key: 0,
        parent: N.value,
        backgroundColor: e.value.style.chart.backgroundColor,
        color: e.value.style.chart.color,
        active: R.value,
        onClose: K
      }, null, 8, ["parent", "backgroundColor", "color", "active"])) : m("", !0),
      De.value ? (u(), i("div", {
        key: 1,
        ref_key: "noTitle",
        ref: se,
        class: "vue-data-ui-no-title-space",
        style: "height:36px; width: 100%;background:transparent"
      }, null, 512)) : m("", !0),
      e.value.style.chart.title.text ? (u(), i("div", {
        key: 2,
        ref_key: "chartTitle",
        ref: ae,
        style: "width:100%;background:transparent;padding-bottom:24px"
      }, [
        (u(), z(ht, {
          key: `title_${ne.value}`,
          config: {
            title: {
              cy: "pcp-div-title",
              ...e.value.style.chart.title
            },
            subtitle: {
              cy: "pcp-div-subtitle",
              ...e.value.style.chart.title.subtitle
            }
          }
        }, null, 8, ["config"]))
      ], 512)) : m("", !0),
      e.value.userOptions.show && P.value && (b(ve) || b(re)) ? (u(), z(gt, {
        ref: "details",
        key: `user_options_${te.value}`,
        backgroundColor: e.value.style.chart.backgroundColor,
        color: e.value.style.chart.color,
        isPrinting: b(pe),
        isImaging: b(me),
        uid: X.value,
        hasTooltip: e.value.userOptions.buttons.tooltip && e.value.style.chart.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,
        hasLabel: e.value.userOptions.buttons.labels,
        hasFullscreen: e.value.userOptions.buttons.fullscreen,
        isFullscreen: S.value,
        isTooltip: y.value.showTooltip,
        titles: { ...e.value.userOptions.buttonTitles },
        chartElement: N.value,
        position: e.value.userOptions.position,
        hasAnnotator: e.value.userOptions.buttons.annotator,
        isAnnotation: R.value,
        onToggleFullscreen: Oe,
        onGeneratePdf: b(ye),
        onGenerateCsv: Ce,
        onGenerateImage: b(fe),
        onToggleTable: $e,
        onToggleLabels: Ae,
        onToggleTooltip: Te,
        onToggleAnnotator: K,
        style: T({
          visibility: b(ve) ? b(re) ? "visible" : "hidden" : "visible"
        })
      }, Ye({ _: 2 }, [
        t.$slots.optionPdf ? {
          name: "optionPdf",
          fn: k(() => [
            x(t.$slots, "optionPdf", {}, void 0, !0)
          ]),
          key: "0"
        } : void 0,
        t.$slots.optionCsv ? {
          name: "optionCsv",
          fn: k(() => [
            x(t.$slots, "optionCsv", {}, void 0, !0)
          ]),
          key: "1"
        } : void 0,
        t.$slots.optionImg ? {
          name: "optionImg",
          fn: k(() => [
            x(t.$slots, "optionImg", {}, void 0, !0)
          ]),
          key: "2"
        } : void 0,
        t.$slots.optionTable ? {
          name: "optionTable",
          fn: k(() => [
            x(t.$slots, "optionTable", {}, void 0, !0)
          ]),
          key: "3"
        } : void 0,
        t.$slots.optionLabels ? {
          name: "optionLabels",
          fn: k(() => [
            x(t.$slots, "optionLabels", {}, void 0, !0)
          ]),
          key: "4"
        } : void 0,
        t.$slots.optionFullscreen ? {
          name: "optionFullscreen",
          fn: k(({ toggleFullscreen: a, isFullscreen: o }) => [
            x(t.$slots, "optionFullscreen", W(V({ toggleFullscreen: a, isFullscreen: o })), void 0, !0)
          ]),
          key: "5"
        } : void 0,
        t.$slots.optionAnnotator ? {
          name: "optionAnnotator",
          fn: k(({ toggleAnnotator: a, isAnnotator: o }) => [
            x(t.$slots, "optionAnnotator", W(V({ toggleAnnotator: a, isAnnotator: o })), void 0, !0)
          ]),
          key: "6"
        } : void 0
      ]), 1032, ["backgroundColor", "color", "isPrinting", "isImaging", "uid", "hasTooltip", "hasPdf", "hasXls", "hasImg", "hasTable", "hasLabel", "hasFullscreen", "isFullscreen", "isTooltip", "titles", "chartElement", "position", "hasAnnotator", "isAnnotation", "onGeneratePdf", "onGenerateImage", "style"])) : m("", !0),
      P.value ? (u(), i("svg", {
        key: 4,
        xmlns: b(ut),
        class: U({ "vue-data-ui-fullscreen--on": S.value, "vue-data-ui-fulscreen--off": !S.value }),
        viewBox: `0 0 ${d.value.chartWidth <= 0 ? 10 : d.value.chartWidth} ${d.value.chartHeight <= 0 ? 10 : d.value.chartHeight}`,
        style: T(`max-width:100%; overflow: visible; background:transparent;color:${e.value.style.chart.color}`)
      }, [
        _e(Ct),
        (u(!0), i(w, null, I(f.value, (a, o) => (u(), i("g", Mt, [
          F("line", {
            x1: d.value.left + C.value * o + C.value / 2,
            x2: d.value.left + C.value * o + C.value / 2,
            y1: d.value.top,
            y2: d.value.bottom,
            stroke: e.value.style.chart.yAxis.stroke,
            "stroke-width": e.value.style.chart.yAxis.strokeWidth
          }, null, 8, zt),
          F("text", {
            x: d.value.left + C.value * o + C.value / 2,
            y: d.value.top - 24,
            fill: e.value.style.chart.yAxis.labels.axisNamesColor,
            "font-size": v.value.axisNameFontSize,
            "font-weight": e.value.style.chart.yAxis.labels.axisNamesBold ? "bold" : "",
            "text-anchor": "middle"
          }, D(a.name), 9, It),
          e.value.style.chart.yAxis.labels.ticks.show ? (u(), i(w, { key: 0 }, [
            (u(!0), i(w, null, I(a.ticks, (n) => (u(), i("line", {
              x1: n.x,
              x2: n.x - 10,
              y1: n.y,
              y2: n.y,
              stroke: e.value.style.chart.yAxis.stroke,
              "stroke-width": e.value.style.chart.yAxis.strokeWidth,
              style: T(`opacity:${p.value && !y.value.showTooltip ? 0.2 : 1}`)
            }, null, 12, Ft))), 256)),
            (u(!0), i(w, null, I(a.ticks, (n) => (u(), i("text", {
              x: n.x - 12 + e.value.style.chart.yAxis.labels.ticks.offsetX,
              y: n.y + e.value.style.chart.yAxis.labels.ticks.offsetY + v.value.ticksFontSize / 3,
              fill: e.value.style.chart.yAxis.labels.ticks.color,
              "text-anchor": "end",
              "font-size": v.value.ticksFontSize,
              "font-weight": e.value.style.chart.yAxis.labels.ticks.bold ? "bold" : "normal",
              style: T(`opacity:${p.value && !y.value.showTooltip ? 0.2 : 1}`)
            }, D(xe({ value: n.value, index: o, datapoint: n })), 13, Pt))), 256))
          ], 64)) : m("", !0)
        ]))), 256)),
        (u(!0), i(w, null, I(q.value, (a) => (u(), i("g", null, [
          (u(!0), i(w, null, I(a.series, (o, n) => (u(), i("g", null, [
            e.value.style.chart.plots.show ? (u(), i("g", Nt, [
              (u(!0), i(w, null, I(o.datapoints, (s) => (u(), z(yt, {
                plot: { x: s.x, y: s.y },
                color: a.color,
                shape: a.shape,
                radius: a.shape === "triangle" ? v.value.plotSize * 1.2 : v.value.plotSize,
                stroke: e.value.style.chart.backgroundColor,
                strokeWidth: 0.5,
                onMouseenter: (r) => E({
                  shape: a.shape,
                  serieName: a.name,
                  serie: o,
                  relativeIndex: n,
                  seriesIndex: o.seriesIndex
                }),
                onMouseleave: l[0] || (l[0] = (r) => {
                  p.value = null, L.value = !1;
                }),
                style: T(`opacity:${p.value ? p.value === o.id ? e.value.style.chart.plots.opacity : 0.2 : e.value.style.chart.plots.opacity}`),
                onClick: () => Ee(s)
              }, null, 8, ["plot", "color", "shape", "radius", "stroke", "onMouseenter", "style", "onClick"]))), 256)),
              y.value.showTooltip ? m("", !0) : (u(), i(w, { key: 0 }, [
                p.value && p.value === o.id && o.datapoints.length ? (u(), i("text", {
                  key: 0,
                  x: o.datapoints[0].x - v.value.ticksFontSize,
                  y: o.datapoints[0].y + v.value.ticksFontSize / 3,
                  "text-anchor": "end",
                  "font-size": v.value.ticksFontSize,
                  fill: a.color,
                  "font-weight": "bold"
                }, D(o.name), 9, St)) : m("", !0)
              ], 64)),
              e.value.style.chart.comments.show ? (u(!0), i(w, { key: 1 }, I(o.datapoints, (s) => (u(), i("g", null, [
                s.comment ? (u(), i("foreignObject", {
                  key: 0,
                  style: { overflow: "visible" },
                  height: "12",
                  width: e.value.style.chart.comments.width,
                  x: s.x - e.value.style.chart.comments.width / 2 + e.value.style.chart.comments.offsetX,
                  y: s.y + e.value.style.chart.comments.offsetY + 6
                }, [
                  F("div", Ot, [
                    x(t.$slots, "plot-comment", {
                      plot: { ...s, color: a.color }
                    }, void 0, !0)
                  ])
                ], 8, Lt)) : m("", !0)
              ]))), 256)) : m("", !0)
            ])) : m("", !0),
            y.value.dataLabels.show || p.value && p.value === o.id ? (u(!0), i(w, { key: 1 }, I(o.datapoints, (s, r) => (u(), i("text", {
              x: s.x + 12 + e.value.style.chart.yAxis.labels.datapoints.offsetX,
              y: s.y + e.value.style.chart.yAxis.labels.datapoints.offsetY + v.value.datapointFontSize / 3,
              fill: e.value.style.chart.yAxis.labels.datapoints.useSerieColor ? a.color : e.value.style.chart.yAxis.labels.datapoints.color,
              "text-anchor": "start",
              "font-weight": e.value.style.chart.yAxis.labels.datapoints.bold ? "bold" : "normal",
              class: U({ "vue-ui-pcp-animated": !1, "vue-ui-pcp-transition": !0 }),
              "font-size": v.value.datapointFontSize,
              onMouseenter: (A) => E({
                shape: a.shape,
                serieName: a.name,
                serie: o,
                relativeIndex: n,
                seriesIndex: o.seriesIndex
              }),
              onMouseleave: l[1] || (l[1] = (A) => {
                p.value = null, L.value = !1;
              }),
              style: T(`opacity:${p.value ? p.value === o.id ? 1 : 0.2 : 1}`)
            }, D(xe({ value: s.value, index: r, datapoint: s })), 45, Dt))), 256)) : m("", !0),
            F("path", {
              d: `M${e.value.style.chart.lines.smooth ? o.smoothPath : o.straightPath}`,
              stroke: a.color,
              "stroke-width": e.value.style.chart.lines.strokeWidth,
              fill: "none",
              class: U({ "vue-ui-pcp-animated vue-data-ui-line-animated": e.value.useCssAnimation, "vue-ui-pcp-transition": !0 }),
              onMouseenter: (s) => E({
                shape: a.shape,
                serieName: a.name,
                serie: o,
                relativeIndex: n,
                seriesIndex: o.seriesIndex
              }),
              onMouseleave: l[2] || (l[2] = (s) => {
                p.value = null, L.value = !1;
              }),
              style: T(`opacity:${p.value ? p.value === o.id ? e.value.style.chart.lines.opacity : 0.2 : e.value.style.chart.lines.opacity}; stroke-dasharray:${o.pathLength}; stroke-dashoffset: ${e.value.useCssAnimation ? o.pathLength : 0}`)
            }, null, 46, Ut),
            y.value.showTooltip ? (u(), i("path", {
              key: 2,
              d: `M${e.value.style.chart.lines.smooth ? o.smoothPath : o.straightPath}`,
              stroke: "transparent",
              "stroke-width": 12,
              fill: "none",
              class: U({ "vue-ui-pcp-animated vue-data-ui-line-animated": e.value.useCssAnimation, "vue-ui-pcp-transition": !0 }),
              onMouseenter: (s) => E({
                shape: a.shape,
                serieName: a.name,
                serie: o,
                relativeIndex: n,
                seriesIndex: o.seriesIndex
              }),
              onMouseleave: l[3] || (l[3] = (s) => {
                p.value = null, L.value = !1;
              }),
              style: { opacity: "0" }
            }, null, 42, Wt)) : m("", !0)
          ]))), 256))
        ]))), 256)),
        x(t.$slots, "svg", { svg: d.value }, void 0, !0)
      ], 14, _t)) : m("", !0),
      t.$slots.watermark ? (u(), i("div", Vt, [
        x(t.$slots, "watermark", W(V({ isPrinting: b(pe) || b(me) })), void 0, !0)
      ])) : m("", !0),
      P.value ? m("", !0) : (u(), z(kt, {
        key: 6,
        config: {
          type: "parallelCoordinatePlot",
          style: {
            backgroundColor: e.value.style.chart.backgroundColor
          }
        }
      }, null, 8, ["config"])),
      F("div", {
        ref_key: "chartLegend",
        ref: le
      }, [
        e.value.style.chart.legend.show && P.value ? (u(), z(pt, {
          key: `legend_${ue.value}`,
          legendSet: We.value,
          config: Ve.value,
          onClickMarker: l[4] || (l[4] = ({ legend: a }) => {
            ge(a.id), we(a);
          })
        }, {
          item: k(({ legend: a, index: o }) => [
            F("div", {
              onClick: (n) => {
                a.segregate(), we(a);
              },
              style: T(`opacity:${$.value.includes(a.id) ? 0.5 : 1}`)
            }, D(a.name), 13, Bt)
          ]),
          _: 1
        }, 8, ["legendSet", "config"])) : x(t.$slots, "legend", {
          key: 1,
          legend: M.value
        }, void 0, !0)
      ], 512),
      t.$slots.source ? (u(), i("div", {
        key: 7,
        ref_key: "source",
        ref: oe,
        dir: "auto"
      }, [
        x(t.$slots, "source", {}, void 0, !0)
      ], 512)) : m("", !0),
      _e(mt, {
        show: y.value.showTooltip && L.value,
        backgroundColor: e.value.style.chart.tooltip.backgroundColor,
        color: e.value.style.chart.tooltip.color,
        fontSize: e.value.style.chart.tooltip.fontSize,
        borderRadius: e.value.style.chart.tooltip.borderRadius,
        borderColor: e.value.style.chart.tooltip.borderColor,
        borderWidth: e.value.style.chart.tooltip.borderWidth,
        backgroundOpacity: e.value.style.chart.tooltip.backgroundOpacity,
        position: e.value.style.chart.tooltip.position,
        offsetY: e.value.style.chart.tooltip.offsetY,
        parent: N.value,
        content: J.value,
        isFullscreen: S.value,
        isCustom: b(ze)(e.value.style.chart.tooltip.customFormat)
      }, {
        "tooltip-before": k(() => [
          x(t.$slots, "tooltip-before", W(V({ ...Q.value })), void 0, !0)
        ]),
        "tooltip-after": k(() => [
          x(t.$slots, "tooltip-after", W(V({ ...Q.value })), void 0, !0)
        ]),
        _: 3
      }, 8, ["show", "backgroundColor", "color", "fontSize", "borderRadius", "borderColor", "borderWidth", "backgroundOpacity", "position", "offsetY", "parent", "content", "isFullscreen", "isCustom"]),
      P.value ? (u(), z(xt, {
        key: 8,
        hideDetails: "",
        config: {
          open: y.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: k(() => [
          (u(), z(bt, {
            key: `table_${ie.value}`,
            colNames: O.value.colNames,
            head: O.value.head,
            body: O.value.body,
            config: O.value.config,
            title: `${e.value.style.chart.title.text}${e.value.style.chart.title.subtitle.text ? ` : ${e.value.style.chart.title.subtitle.text}` : ""}`,
            onClose: l[5] || (l[5] = (a) => y.value.showTable = !1)
          }, {
            th: k(({ th: a }) => [
              F("div", { innerHTML: a }, null, 8, Et)
            ]),
            td: k(({ td: a }) => [
              qe(D(a), 1)
            ]),
            _: 1
          }, 8, ["colNames", "head", "body", "config", "title"]))
        ]),
        _: 1
      }, 8, ["config"])) : m("", !0)
    ], 46, Tt));
  }
}, na = /* @__PURE__ */ At(Rt, [["__scopeId", "data-v-47848eab"]]);
export {
  na as default
};
