import { toRef as he, resolveComponent as fe, createElementBlock as d, openBlock as s, Fragment as k, renderList as M, createCommentVNode as m, createBlock as R, createElementVNode as W, withModifiers as Ge, renderSlot as w, mergeProps as xe, withCtx as P, toDisplayString as Se, ref as p, onMounted as Ae, onUnmounted as Ve, watchEffect as We, computed as _, watch as Xe, unref as b, normalizeStyle as ve, normalizeClass as Pe, createVNode as ae, createSlots as je, normalizeProps as G, guardReactiveProps as V, createTextVNode as Ye, nextTick as Ze } from "vue";
import { u as qe, o as Qe, e as Je, c as Te, t as Ke, p as Fe, a as et, b as tt, P as ot, X as lt, l as st, Q as nt, d as Le, q as at, r as rt, x as it, y as ut } from "./index-BdV23M_4.js";
import { _ as ct } from "./Title-Dr0O3Ohb.js";
import { u as dt, U as vt } from "./usePrinter-TFomTfxX.js";
import { D as ht } from "./DataTable-D9wdDVT6.js";
import { _ as ft } from "./Tooltip-C8mLFDBp.js";
import yt from "./vue-ui-skeleton-CVnkLuNk.js";
import pt from "./vue-ui-accordion-2_hSAOvX.js";
import { u as Ee } from "./useNestedProp-DyW-iWus.js";
import { _ as mt } from "./PackageVersion-DR6SOSy8.js";
import { P as gt } from "./PenAndPaper-DxsKkGjV.js";
import { u as bt } from "./useUserOptionState-BIvW1Kz7.js";
import { u as kt } from "./useChartAccessibility-BWojgys7.js";
import { _ as Ct } from "./_plugin-vue_export-helper-CHgC5LLL.js";
const $t = ["cx", "cy", "r", "fill", "stroke", "stroke-width", "onClick", "onMouseover"], wt = ["x", "y", "height", "width", "onClick", "onMouseover"], xt = {
  __name: "RecursiveCircles",
  props: {
    color: {
      type: String,
      default: "#000000"
    },
    dataset: {
      type: Array,
      default: () => []
    },
    hoveredUid: {
      type: String,
      default: null
    },
    linkColor: {
      type: String,
      default: "#CCCCCC"
    },
    stroke: {
      type: String,
      default: "#FFFFFF"
    },
    strokeHovered: {
      type: String,
      default: "#000000"
    }
  },
  emits: ["click", "hover"],
  setup(r, { emit: z }) {
    const H = r, E = z;
    function a(n) {
      E("click", n);
    }
    function C(n) {
      E("hover", n);
    }
    return he(H, "dataset").value.forEach((n) => {
      n.nodes && n.nodes.length > 0 && n.nodes.forEach((f) => {
        f.ancestor = n;
      });
    }), (n, f) => {
      const B = fe("RecursiveCircles", !0);
      return s(!0), d(k, null, M(r.dataset, (i) => (s(), d(k, null, [
        i.polygonPath && i.polygonPath.coordinates ? (s(), d(k, { key: 0 }, [
          (s(!0), d(k, null, M(i.polygonPath.coordinates, (x, U) => (s(), d(k, null, [
            W("circle", {
              cx: x.x,
              cy: x.y,
              r: i.circleRadius,
              fill: `url(#gradient_${i.color})`,
              stroke: r.hoveredUid && r.hoveredUid === i.uid ? r.strokeHovered : r.stroke,
              "stroke-width": r.hoveredUid && r.hoveredUid === i.uid ? i.circleRadius / 6 : i.circleRadius / 12,
              style: { cursor: "pointer" },
              onClick: (S) => a(i),
              onMouseover: (S) => C(i),
              onMouseleave: f[0] || (f[0] = (S) => C(null))
            }, null, 40, $t),
            n.$slots.node ? (s(), d("foreignObject", {
              key: 0,
              x: x.x - i.circleRadius,
              y: x.y - i.circleRadius,
              height: i.circleRadius * 2,
              width: i.circleRadius * 2,
              style: { overflow: "visible" },
              onClick: Ge((S) => a(i), ["stop"]),
              onMouseover: (S) => C(i),
              onMouseleave: f[1] || (f[1] = (S) => C(null))
            }, [
              w(n.$slots, "node", xe({ ref_for: !0 }, { node: i }))
            ], 40, wt)) : m("", !0)
          ], 64))), 256)),
          i.nodes && i.nodes.length > 0 ? (s(), R(B, {
            key: 0,
            dataset: i.nodes,
            color: r.color,
            stroke: r.stroke,
            strokeHovered: r.strokeHovered,
            hoveredUid: r.hoveredUid,
            onClick: a,
            onHover: C
          }, {
            node: P(({ node: x }) => [
              w(n.$slots, "node", xe({ ref_for: !0 }, { node: x }))
            ]),
            _: 2
          }, 1032, ["dataset", "color", "stroke", "strokeHovered", "hoveredUid"])) : m("", !0)
        ], 64)) : m("", !0)
      ], 64))), 256);
    };
  }
}, Pt = ["x1", "y1", "x2", "y2", "stroke", "stroke-width"], Tt = ["x1", "y1", "x2", "y2", "stroke", "stroke-width"], Ft = {
  __name: "RecursiveLinks",
  props: {
    dataset: {
      type: Array,
      default: () => []
    },
    color: {
      type: String,
      default: "#DDDDDD"
    },
    backgroundColor: {
      type: String,
      default: "#FFFFFF"
    }
  },
  setup(r) {
    return he(r, "dataset").value.forEach((E) => {
      E.nodes && E.nodes.length > 0 && E.nodes.forEach((a) => {
        a.ancestor = E;
      });
    }), (E, a) => {
      const C = fe("RecursiveLinks", !0);
      return s(), d(k, null, [
        (s(!0), d(k, null, M(r.dataset, (u) => (s(), d(k, null, [
          u.polygonPath && u.polygonPath.coordinates ? (s(!0), d(k, { key: 0 }, M(u.polygonPath.coordinates, (n, f) => (s(), d(k, null, [
            u.ancestor && u.ancestor.polygonPath ? (s(), d(k, { key: 0 }, [
              W("line", {
                x1: n.x,
                y1: n.y,
                x2: u.ancestor.polygonPath.coordinates[0].x,
                y2: u.ancestor.polygonPath.coordinates[0].y,
                stroke: r.backgroundColor,
                "stroke-width": u.circleRadius / 1.5
              }, null, 8, Pt),
              W("line", {
                x1: n.x,
                y1: n.y,
                x2: u.ancestor.polygonPath.coordinates[0].x,
                y2: u.ancestor.polygonPath.coordinates[0].y,
                stroke: r.color,
                "stroke-width": u.circleRadius / 2
              }, null, 8, Tt)
            ], 64)) : m("", !0)
          ], 64))), 256)) : m("", !0)
        ], 64))), 256)),
        (s(!0), d(k, null, M(r.dataset, (u) => (s(), d(k, null, [
          u.polygonPath && u.polygonPath.coordinates ? (s(), d(k, { key: 0 }, [
            u.nodes && u.nodes.length > 0 ? (s(), R(C, {
              key: 0,
              dataset: u.nodes,
              color: r.color,
              backgroundColor: r.backgroundColor
            }, null, 8, ["dataset", "color", "backgroundColor"])) : m("", !0)
          ], 64)) : m("", !0)
        ], 64))), 256))
      ], 64);
    };
  }
}, Lt = ["x", "y", "fill", "font-size"], Et = {
  __name: "RecursiveLabels",
  props: {
    color: {
      type: String,
      default: "#000000"
    },
    dataset: {
      type: Array,
      default: () => []
    },
    hoveredUid: {
      type: String,
      default: null
    }
  },
  emits: ["zoom", "hover"],
  setup(r, { emit: z }) {
    return he(r, "dataset").value.forEach((a) => {
      a.nodes && a.nodes.length > 0 && a.nodes.forEach((C) => {
        C.ancestor = a;
      });
    }), (a, C) => {
      const u = fe("RecursiveLabels", !0);
      return s(!0), d(k, null, M(r.dataset, (n) => (s(), d(k, null, [
        n.polygonPath && n.polygonPath.coordinates ? (s(), d(k, { key: 0 }, [
          (s(!0), d(k, null, M(n.polygonPath.coordinates, (f) => (s(), d("text", {
            x: f.x,
            y: f.y + n.circleRadius * 2,
            fill: r.color,
            "font-size": n.circleRadius,
            "text-anchor": "middle",
            style: { opacity: "0.8", "pointer-events": "none" }
          }, Se(n.name), 9, Lt))), 256)),
          n.nodes && n.nodes.length > 0 ? (s(), R(u, {
            key: 0,
            dataset: n.nodes,
            color: r.color,
            hoveredUid: r.hoveredUid
          }, null, 8, ["dataset", "color", "hoveredUid"])) : m("", !0)
        ], 64)) : m("", !0)
      ], 64))), 256);
    };
  }
};
function St(r, z = { x: 0, y: 0, width: 100, height: 100 }, H = 1, E) {
  const a = p({ ...z }), C = p(1), u = p(!1), n = p({ x: 0, y: 0 });
  let f = { x: 0, y: 0 }, B = null, i = null;
  function x(o) {
    var D;
    const v = r.value;
    if (!v) return { x: 0, y: 0 };
    const g = v.createSVGPoint();
    g.x = o.clientX, g.y = o.clientY;
    const T = (D = v.getScreenCTM()) == null ? void 0 : D.inverse();
    return T ? g.matrixTransform(T) : { x: 0, y: 0 };
  }
  function U(o) {
    u.value = !0;
    const v = x(o.touches ? o.touches[0] : o);
    n.value = { x: v.x, y: v.y }, f = { x: 0, y: 0 };
  }
  function S(o) {
    if (!u.value) return;
    const v = x(o.touches ? o.touches[0] : o);
    let g = v.x - n.value.x, T = v.y - n.value.y;
    Math.abs(g) < 0.3 && Math.abs(T) < 0.3 || (f.x = g * 0.8 + f.x * 0.2, f.y = T * 0.8 + f.y * 0.2, n.value = v, B || (B = requestAnimationFrame(oe)));
  }
  function oe() {
    a.value.x -= f.x, a.value.y -= f.y, B = null;
  }
  function I() {
    u.value = !1;
  }
  function e(o) {
    o.preventDefault();
    const v = o.deltaY > 0 ? 0.9 : 1.1;
    j(v, x(o));
  }
  function X(o) {
    o.preventDefault();
    const v = x(o), g = 1.02 * (1 + H / 100);
    le(g, v);
  }
  function le(o, v) {
    i && cancelAnimationFrame(i);
    let g = C.value, T = g * o, D = 0;
    const $ = () => {
      D += 0.02;
      let Z = g + (T - g) * se(D);
      if (D >= 1) {
        C.value = T, i = null;
        return;
      }
      j(Z / g, v), i = requestAnimationFrame($);
    };
    $();
  }
  const se = (o) => o < 0.5 ? 2 * o * o : -1 + (4 - 2 * o) * o;
  function j(o, v) {
    const g = C.value * o, T = g / C.value, D = a.value.width / T, $ = a.value.height / T, Z = (v.x - a.value.x) * (1 - 1 / T), re = (v.y - a.value.y) * (1 - 1 / T);
    a.value.x += Z, a.value.y += re, a.value.width = D, a.value.height = $, C.value = g;
  }
  Ae(J), Ve(Y);
  function J() {
    const o = r.value;
    o && (o.addEventListener("mousedown", U), o.addEventListener("mousemove", S), o.addEventListener("mouseup", I), o.addEventListener("mouseleave", I), o.addEventListener("wheel", e, { passive: !1 }), o.addEventListener("dblclick", X), o.addEventListener("touchstart", (v) => {
      v.preventDefault(), U(v);
    }, { passive: !1 }), o.addEventListener("touchmove", (v) => {
      v.preventDefault(), S(v);
    }, { passive: !1 }), o.addEventListener("touchend", I));
  }
  function Y() {
    const o = r.value;
    o && (o.removeEventListener("mousedown", U), o.removeEventListener("mousemove", S), o.removeEventListener("mouseup", I), o.removeEventListener("mouseleave", I), o.removeEventListener("wheel", e), o.removeEventListener("dblclick", X), o.removeEventListener("touchstart", U), o.removeEventListener("touchmove", S), o.removeEventListener("touchend", I));
  }
  return We(() => (E.value ? J() : Y(), () => {
    Y();
  })), { viewBox: a };
}
const At = ["id"], Ot = {
  key: 1,
  ref: "noTitle",
  class: "vue-data-ui-no-title-space",
  style: "height:36px; width: 100%;background:transparent"
}, Dt = {
  key: 2,
  style: "width:100%;background:transparent;"
}, Rt = ["xmlns", "viewBox"], Ut = ["width", "height"], It = ["id"], Nt = ["stop-color"], _t = ["stop-color"], Mt = {
  key: 5,
  class: "vue-data-ui-watermark"
}, zt = {
  key: 7,
  ref: "source",
  dir: "auto"
}, Ht = ["innerHTML"], Bt = {
  __name: "vue-ui-molecule",
  props: {
    config: {
      type: Object,
      default() {
        return {};
      }
    },
    dataset: {
      type: Array,
      default() {
        return [];
      }
    }
  },
  emits: ["selectNode"],
  setup(r, { expose: z, emit: H }) {
    const { vue_ui_molecule: E } = qe(), a = r, C = H, u = _(() => !!a.dataset && a.dataset.length);
    Ae(() => {
      n();
    });
    function n() {
      Qe(a.dataset) && Je({
        componentName: "VueUiMolecule",
        type: "dataset"
      });
    }
    const f = p(Te()), B = p(null), i = p(!1), x = p(""), U = p(null), S = p(0), oe = p(0), I = p(0), e = _({
      get: () => J(),
      set: (t) => t
    }), { userOptionsVisible: X, setUserOptionsVisibility: le, keepUserOptionState: se } = bt({ config: e.value }), { svgRef: j } = kt({ config: e.value.style.chart.title });
    function J() {
      const t = Ee({
        userConfig: a.config,
        defaultConfig: E
      });
      return t.theme ? {
        ...Ee({
          userConfig: et.vue_ui_molecule[t.theme] || a.config,
          defaultConfig: t
        }),
        customPalette: Ke[t.theme] || Fe
      } : t;
    }
    Xe(() => a.config, (t) => {
      e.value = J(), X.value = !e.value.userOptions.showOnChartHover, n(), oe.value += 1, I.value += 1, $.value.showTable = e.value.table.show, $.value.showTooltip = e.value.style.chart.tooltip.show;
    }, { deep: !0 });
    const { isPrinting: Y, isImaging: o, generatePdf: v, generateImage: g } = dt({
      elementId: `cluster_${f.value}`,
      fileName: e.value.style.chart.title.text || "vue-ui-molecule",
      options: e.value.userOptions.print
    }), T = _(() => e.value.userOptions.show && !e.value.style.chart.title.text), D = _(() => tt(e.value.customPalette)), $ = p({
      showTable: e.value.table.show,
      showDataLabels: !0,
      showTooltip: e.value.style.chart.tooltip.show
    });
    function Z(t, c = 0) {
      return Array.isArray(t) && t.length > 0 && t[0].nodes ? Z(t[0].nodes, c + 1) : c;
    }
    function re() {
      const t = Z(a.dataset);
      let c = 100, l = c;
      for (let y = 0; y < t; y += 1)
        c /= 1, l += c;
      return {
        height: l,
        width: l
      };
    }
    const L = p(re());
    p(`0 0 ${L.value.width} ${L.value.height}`);
    function ye(t, c = { x: -L.value.width / 2.43, y: L.value.height / 2 }, l = L.value.width / 1.1, y = 24, h = 0, F = 0, A = "#BBBBBB", ce = 0) {
      if (!Array.isArray(t) || t.length === 0) return t;
      const Be = nt({
        plot: c,
        radius: l,
        sides: t.length,
        rotation: h
      });
      return t.forEach((O, Ce) => {
        const $e = Be.coordinates[Ce], we = O.color ? (() => {
          let de = Le(O.color);
          return de.startsWith("#") ? de : `#${de}`;
        })() : null;
        let Q;
        we ? Q = we : ce === 0 ? Q = A : ce === 1 ? (Q = D.value[F] || Fe[F] || A, F += 1) : Q = A, O.polygonPath = { coordinates: [$e] }, O.circleRadius = y, O.color = Q, O.uid = Te(), Array.isArray(O.nodes) && O.nodes.length && (O.nodes = ye(
          O.nodes,
          $e,
          l / 2.9,
          y / 2.2,
          h + Math.PI * Ce / O.nodes.length,
          F,
          Q,
          ce + 1
        ));
      }), t;
    }
    function Oe(t) {
      const c = /* @__PURE__ */ new Set();
      function l(h) {
        h.forEach((F) => {
          if (!F.color) return;
          let A = F.color;
          /^#?[0-9A-F]{6}$/i.test(A) || (A = Le(A)), A.startsWith("#") || (A = `#${A}`), c.add(A), Array.isArray(F.nodes) && F.nodes.length && l(F.nodes);
        });
      }
      l(t);
      const y = {};
      return Array.from(c).forEach((h) => {
        const F = h.slice(1);
        y[h] = `gradient_${F}`;
      }), y;
    }
    const De = _(() => Oe(N.value)), N = _(() => {
      const t = ot(a.dataset);
      return ye(t);
    }), ie = p(null);
    function Re(t) {
      ie.value = {
        datapoint: t,
        seriesIndex: -1,
        series: N.value,
        config: e.value
      };
      const c = e.value.style.chart.tooltip.customFormat;
      if (it(c) && ut(() => c({
        seriesIndex: -1,
        datapoint: t,
        series: N.value,
        config: e.value
      })))
        x.value = c({
          seriesIndex: -1,
          // well, ok
          datapoint: t,
          series: N.value,
          config: e.value
        });
      else {
        let l = "";
        l += `<div style="display:flex;align-items:center;gap:3px"><div style="color:${t.color}">⬤</div><div>${t.name}</div></div>`, t.details && (l += `<div style="width:100%;border-top:1px solid ${e.value.style.chart.tooltip.borderColor};margin-top: 2px">${t.details}</div>`), x.value = `<div style="font-family:inherit">${l}</div>`;
      }
    }
    const pe = p(null), K = p(null);
    function Ue(t) {
      pe.value = t, t ? (i.value = !0, Re(t), K.value = t.uid) : (i.value = !1, x.value = "", K.value = null);
    }
    function Ie(t) {
      const c = [];
      function l(y) {
        y.forEach((h) => {
          const F = {
            name: h.name,
            details: h.details || "-",
            ancestor: h.ancestor && h.ancestor.name || "-",
            color: h.color || ""
          };
          c.push(F), h.nodes && h.nodes.length > 0 && l(h.nodes, h.name);
        });
      }
      return l(t), c;
    }
    const Ne = _(() => Ie(N.value)), q = _(() => {
      const t = [
        e.value.table.translations.nodeName,
        e.value.table.translations.details,
        e.value.table.translations.ancestor
      ], c = Ne.value.map((h, F) => [
        {
          color: h.color,
          name: h.name
        },
        h.details,
        h.ancestor || ""
      ]), l = {
        th: {
          backgroundColor: e.value.table.th.backgroundColor,
          color: e.value.table.th.color,
          outline: e.value.table.th.outline
        },
        td: {
          backgroundColor: e.value.table.td.backgroundColor,
          color: e.value.table.td.color,
          outline: e.value.table.td.outline
        },
        breakpoint: e.value.table.responsiveBreakpoint
      }, y = [
        e.value.table.translations.nodeName,
        e.value.table.translations.details,
        e.value.table.translations.ancestor
      ];
      return {
        head: t,
        body: c,
        config: l,
        colNames: y
      };
    });
    function me() {
      Ze(() => {
        const t = q.value.body.map((y, h) => [[y[0].name], [y[1]], [y[2]]]), c = [[e.value.style.chart.title.text], [e.value.style.chart.title.subtitle.text], [[...q.value.head]]].concat(t), l = at(c);
        rt({ csvContent: l, title: e.value.style.chart.title.text || "vue-ui-molecule" });
      });
    }
    function _e() {
      return N.value;
    }
    const ee = p(!1);
    function Me(t) {
      ee.value = t, S.value += 1;
    }
    function ge() {
      $.value.showTable = !$.value.showTable;
    }
    function be() {
      $.value.showDataLabels = !$.value.showDataLabels;
    }
    function ke() {
      $.value.showTooltip = !$.value.showTooltip;
    }
    const te = p(!1);
    function ue() {
      te.value = !te.value;
    }
    const ze = _(() => !te.value), { viewBox: ne } = St(j, {
      x: 0,
      y: 0,
      width: L.value.width <= 0 ? 10 : L.value.width,
      height: L.value.height <= 0 ? 10 : L.value.height
    }, e.value.style.chart.zoom.speed, ze);
    function He(t) {
      C("selectNode", t);
    }
    return z({
      getData: _e,
      generatePdf: v,
      generateCsv: me,
      generateImage: g,
      toggleTable: ge,
      toggleLabels: be,
      toggleTooltip: ke,
      toggleAnnotator: ue
    }), (t, c) => (s(), d("div", {
      ref_key: "moleculeChart",
      ref: U,
      class: Pe(`vue-ui-molecule ${ee.value ? "vue-data-ui-wrapper-fullscreen" : ""}`),
      style: ve(`font-family:${e.value.style.fontFamily};width:100%; text-align:center;background:${e.value.style.chart.backgroundColor}`),
      id: `cluster_${f.value}`,
      onMouseleave: c[1] || (c[1] = (l) => {
        pe.value = null, K.value = null, b(le)(!1);
      }),
      onMouseenter: c[2] || (c[2] = () => b(le)(!0))
    }, [
      e.value.userOptions.buttons.annotator ? (s(), R(gt, {
        key: 0,
        svgRef: b(j),
        backgroundColor: e.value.style.chart.backgroundColor,
        color: e.value.style.chart.color,
        active: te.value,
        onClose: ue
      }, null, 8, ["svgRef", "backgroundColor", "color", "active"])) : m("", !0),
      T.value ? (s(), d("div", Ot, null, 512)) : m("", !0),
      e.value.style.chart.title.text ? (s(), d("div", Dt, [
        (s(), R(ct, {
          key: `title_${oe.value}`,
          config: {
            title: {
              cy: "molecule-div-title",
              ...e.value.style.chart.title
            },
            subtitle: {
              cy: "molecule-div-subtitle",
              ...e.value.style.chart.title.subtitle
            }
          }
        }, null, 8, ["config"]))
      ])) : m("", !0),
      e.value.userOptions.show && u.value && (b(se) || b(X)) ? (s(), R(vt, {
        ref_key: "details",
        ref: B,
        key: `user_options_${S.value}`,
        backgroundColor: e.value.style.chart.backgroundColor,
        color: e.value.style.chart.color,
        isPrinting: b(Y),
        isImaging: b(o),
        uid: f.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,
        isTooltip: $.value.showTooltip,
        titles: { ...e.value.userOptions.buttonTitles },
        chartElement: U.value,
        position: e.value.userOptions.position,
        hasAnnotator: e.value.userOptions.buttons.annotator,
        isAnnotation: te.value,
        onToggleFullscreen: Me,
        onGeneratePdf: b(v),
        onGenerateCsv: me,
        onGenerateImage: b(g),
        onToggleTable: ge,
        onToggleLabels: be,
        onToggleTooltip: ke,
        onToggleAnnotator: ue,
        style: ve({
          visibility: b(se) ? b(X) ? "visible" : "hidden" : "visible"
        })
      }, je({ _: 2 }, [
        t.$slots.menuIcon ? {
          name: "menuIcon",
          fn: P(({ isOpen: l, color: y }) => [
            w(t.$slots, "menuIcon", G(V({ isOpen: l, color: y })), void 0, !0)
          ]),
          key: "0"
        } : void 0,
        t.$slots.optionTooltip ? {
          name: "optionTooltip",
          fn: P(() => [
            w(t.$slots, "optionTooltip", {}, void 0, !0)
          ]),
          key: "1"
        } : void 0,
        t.$slots.optionPdf ? {
          name: "optionPdf",
          fn: P(() => [
            w(t.$slots, "optionPdf", {}, void 0, !0)
          ]),
          key: "2"
        } : void 0,
        t.$slots.optionCsv ? {
          name: "optionCsv",
          fn: P(() => [
            w(t.$slots, "optionCsv", {}, void 0, !0)
          ]),
          key: "3"
        } : void 0,
        t.$slots.optionImg ? {
          name: "optionImg",
          fn: P(() => [
            w(t.$slots, "optionImg", {}, void 0, !0)
          ]),
          key: "4"
        } : void 0,
        t.$slots.optionTable ? {
          name: "optionTable",
          fn: P(() => [
            w(t.$slots, "optionTable", {}, void 0, !0)
          ]),
          key: "5"
        } : void 0,
        t.$slots.optionLabels ? {
          name: "optionLabels",
          fn: P(() => [
            w(t.$slots, "optionLabels", {}, void 0, !0)
          ]),
          key: "6"
        } : void 0,
        t.$slots.optionFullscreen ? {
          name: "optionFullscreen",
          fn: P(({ toggleFullscreen: l, isFullscreen: y }) => [
            w(t.$slots, "optionFullscreen", G(V({ toggleFullscreen: l, isFullscreen: y })), void 0, !0)
          ]),
          key: "7"
        } : void 0,
        t.$slots.optionAnnotator ? {
          name: "optionAnnotator",
          fn: P(({ toggleAnnotator: l, isAnnotator: y }) => [
            w(t.$slots, "optionAnnotator", G(V({ toggleAnnotator: l, isAnnotator: y })), void 0, !0)
          ]),
          key: "8"
        } : void 0
      ]), 1032, ["backgroundColor", "color", "isPrinting", "isImaging", "uid", "hasTooltip", "hasPdf", "hasXls", "hasImg", "hasTable", "hasLabel", "hasFullscreen", "isTooltip", "titles", "chartElement", "position", "hasAnnotator", "isAnnotation", "onGeneratePdf", "onGenerateImage", "style"])) : m("", !0),
      u.value ? (s(), d("svg", {
        key: 4,
        ref_key: "svgRef",
        ref: j,
        xmlns: b(lt),
        viewBox: `${b(ne).x} ${b(ne).y} ${b(ne).width} ${b(ne).height}`,
        class: Pe({ "vue-data-ui-fullscreen--on": ee.value, "vue-data-ui-fulscreen--off": !ee.value }),
        style: ve(`overflow: hidden; background:transparent;color:${e.value.style.chart.color}`)
      }, [
        ae(mt),
        t.$slots["chart-background"] ? (s(), d("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, Ut)) : m("", !0),
        W("defs", null, [
          (s(!0), d(k, null, M(Object.keys(De.value), (l) => (s(), d("radialGradient", {
            id: `gradient_${l}`,
            cx: "50%",
            cy: "30%",
            r: "50%",
            fx: "50%",
            fy: "50%"
          }, [
            W("stop", {
              offset: "0%",
              "stop-color": b(st)(l, 0.5)
            }, null, 8, Nt),
            W("stop", {
              offset: "100%",
              "stop-color": l
            }, null, 8, _t)
          ], 8, It))), 256))
        ]),
        ae(Ft, {
          dataset: N.value,
          color: e.value.style.chart.links.stroke,
          backgroundColor: e.value.style.chart.backgroundColor
        }, null, 8, ["dataset", "color", "backgroundColor"]),
        ae(xt, {
          dataset: N.value,
          hoveredUid: K.value,
          stroke: e.value.style.chart.nodes.stroke,
          strokeHovered: e.value.style.chart.nodes.strokeHovered,
          onClick: He,
          onHover: Ue
        }, {
          node: P(({ node: l }) => [
            w(t.$slots, "node", G(V({ node: l })), void 0, !0)
          ]),
          _: 3
        }, 8, ["dataset", "hoveredUid", "stroke", "strokeHovered"]),
        $.value.showDataLabels ? (s(), R(Et, {
          key: 1,
          dataset: N.value,
          color: e.value.style.chart.color,
          hoveredUid: K.value
        }, null, 8, ["dataset", "color", "hoveredUid"])) : m("", !0),
        w(t.$slots, "svg", { svg: L.value }, void 0, !0)
      ], 14, Rt)) : m("", !0),
      t.$slots.watermark ? (s(), d("div", Mt, [
        w(t.$slots, "watermark", G(V({ isPrinting: b(Y) || b(o) })), void 0, !0)
      ])) : m("", !0),
      u.value ? m("", !0) : (s(), R(yt, {
        key: 6,
        config: {
          type: "molecule",
          style: {
            backgroundColor: e.value.style.chart.backgroundColor,
            molecule: {
              color: "#CCCCCC"
            }
          }
        }
      }, null, 8, ["config"])),
      t.$slots.source ? (s(), d("div", zt, [
        w(t.$slots, "source", {}, void 0, !0)
      ], 512)) : m("", !0),
      ae(ft, {
        show: $.value.showTooltip && i.value,
        backgroundColor: e.value.style.chart.tooltip.backgroundColor,
        color: e.value.style.chart.tooltip.color,
        borderRadius: e.value.style.chart.tooltip.borderRadius,
        borderColor: e.value.style.chart.tooltip.borderColor,
        borderWidth: e.value.style.chart.tooltip.borderWidth,
        fontSize: e.value.style.chart.tooltip.fontSize,
        backgroundOpacity: e.value.style.chart.tooltip.backgroundOpacity,
        position: e.value.style.chart.tooltip.position,
        offsetY: e.value.style.chart.tooltip.offsetY,
        parent: U.value,
        content: x.value,
        isFullscreen: ee.value,
        isCustom: e.value.style.chart.tooltip.customFormat && typeof e.value.style.chart.tooltip.customFormat == "function"
      }, {
        "tooltip-before": P(() => [
          w(t.$slots, "tooltip-before", G(V({ ...ie.value })), void 0, !0)
        ]),
        "tooltip-after": P(() => [
          w(t.$slots, "tooltip-after", G(V({ ...ie.value })), void 0, !0)
        ]),
        _: 3
      }, 8, ["show", "backgroundColor", "color", "borderRadius", "borderColor", "borderWidth", "fontSize", "backgroundOpacity", "position", "offsetY", "parent", "content", "isFullscreen", "isCustom"]),
      u.value ? (s(), R(pt, {
        key: 8,
        hideDetails: "",
        config: {
          open: $.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: P(() => [
          (s(), R(ht, {
            key: `table_${I.value}`,
            colNames: q.value.colNames,
            head: q.value.head,
            body: q.value.body,
            config: q.value.config,
            title: `${e.value.style.chart.title.text}${e.value.style.chart.title.subtitle.text ? ` : ${e.value.style.chart.title.subtitle.text}` : ""}`,
            onClose: c[0] || (c[0] = (l) => $.value.showTable = !1)
          }, {
            th: P(({ th: l }) => [
              W("div", {
                innerHTML: l,
                style: { display: "flex", "align-items": "center" }
              }, null, 8, Ht)
            ]),
            td: P(({ td: l }) => [
              Ye(Se(l.name || l), 1)
            ]),
            _: 1
          }, 8, ["colNames", "head", "body", "config", "title"]))
        ]),
        _: 1
      }, 8, ["config"])) : m("", !0)
    ], 46, At));
  }
}, lo = /* @__PURE__ */ Ct(Bt, [["__scopeId", "data-v-d296dc0b"]]);
export {
  lo as default
};
