import { toRefs as J, defineAsyncComponent as e, computed as c, ref as o, onMounted as Y, watch as O, shallowReactive as Z, openBlock as F, createElementBlock as R, createElementVNode as w, createVNode as tt, createTextVNode as et, toDisplayString as ot, unref as it, createBlock as at, resolveDynamicComponent as nt, mergeProps as rt, toHandlers as lt, createSlots as ut, renderList as st, withCtx as ct, renderSlot as gt, normalizeProps as pt, guardReactiveProps as mt } from "vue";
import dt from "./BaseIcon-DpaRUsHC.js";
const Vt = {
  key: 0,
  style: { width: "100%", display: "flex", gap: "6px", "align-items": "center", color: "#FF0000" }
}, Ut = { style: { width: "36px" } }, ht = {
  __name: "vue-data-ui",
  props: {
    component: { type: String },
    dataset: { type: [Object, Array, Number, String] },
    config: { type: Object }
  },
  emits: [
    "selectLegend",
    "selectDatapoint",
    "toggleOpenState",
    "saveAnnotations",
    "selectRoot",
    "selectBranch",
    "selectNut",
    "change",
    "selectPlot",
    "selectSide",
    "rate",
    "postImage",
    "hoverIndex",
    "selectX",
    "toggleLock",
    "toggleTooltip",
    "start",
    "play",
    "pause",
    "reset",
    "restart",
    "lap",
    "toggleAnnotator"
  ],
  setup(N, { expose: G, emit: M }) {
    const n = N, { component: W, dataset: X, config: Q } = J(n), u = {
      VueUi3dBar: e(() => import("./vue-ui-3d-bar-mxTzin_H.js")),
      VueUiAgePyramid: e(() => import("./vue-ui-age-pyramid-DFBuvQgd.js")),
      VueUiAnnotator: e(() => import("./vue-ui-annotator-XbCqxBQ0.js")),
      VueUiCandlestick: e(() => import("./vue-ui-candlestick-C8mUQTPF.js")),
      VueUiChestnut: e(() => import("./vue-ui-chestnut-BqGCLMiu.js")),
      VueUiDashboard: e(() => import("./vue-ui-dashboard-zrJGrAmc.js")),
      VueUiDigits: e(() => import("./vue-ui-digits-B5P9UheE.js")),
      VueUiDonut: e(() => import("./vue-ui-donut-7tNjrx1E.js")),
      VueUiDonutEvolution: e(() => import("./vue-ui-donut-evolution-C7FpJ59u.js")),
      VueUiGalaxy: e(() => import("./vue-ui-galaxy-2SRA_RYP.js")),
      VueUiGauge: e(() => import("./vue-ui-gauge-Cpvg4BBS.js")),
      VueUiHeatmap: e(() => import("./vue-ui-heatmap-dNeKqLC0.js")),
      VueUiKpi: e(() => import("./vue-ui-kpi-HyZOfh63.js")),
      VueUiMiniLoader: e(() => import("./vue-ui-mini-loader-Dp7zc34Q.js")),
      VueUiMolecule: e(() => import("./vue-ui-molecule-Oim4-hUn.js")),
      VueUiMoodRadar: e(() => import("./vue-ui-mood-radar-DsSO6gfa.js")),
      VueUiNestedDonuts: e(() => import("./vue-ui-nested-donuts-B5NPJfg6.js")),
      VueUiOnion: e(() => import("./vue-ui-onion-CID0DNSa.js")),
      VueUiQuadrant: e(() => import("./vue-ui-quadrant-063Cq0di.js")),
      VueUiRadar: e(() => import("./vue-ui-radar-BmY47r3J.js")),
      VueUiRating: e(() => import("./vue-ui-rating-b2SThMJw.js")),
      VueUiRelationCircle: e(() => import("./vue-ui-relation-circle-B0Q2FdDW.js")),
      VueUiRings: e(() => import("./vue-ui-rings-DlsKpDkQ.js")),
      VueUiScatter: e(() => import("./vue-ui-scatter-E_WveJ4p.js")),
      VueUiScreenshot: e(() => import("./vue-ui-screenshot-CbLsOjZv.js")),
      VueUiSkeleton: e(() => import("./vue-ui-skeleton-Bgf16k10.js")),
      VueUiSmiley: e(() => import("./vue-ui-smiley-ne5pBMum.js")),
      VueUiSparkbar: e(() => import("./vue-ui-sparkbar--Q2alJoW.js")),
      VueUiSparkgauge: e(() => import("./vue-ui-sparkgauge-BOcEbdij.js")),
      VueUiSparkHistogram: e(() => import("./vue-ui-sparkhistogram-CIJmWjb4.js")),
      VueUiSparkline: e(() => import("./vue-ui-sparkline-lY0wS6kU.js")),
      VueUiSparkStackbar: e(() => import("./vue-ui-sparkstackbar-GHM4EY7-.js")),
      VueUiTable: e(() => import("./vue-ui-table-DZV-uDG2.js")),
      VueUiTableSparkline: e(() => import("./vue-ui-table-sparkline-wWAVQ0es.js")),
      VueUiThermometer: e(() => import("./vue-ui-thermometer-DRZWIAFj.js")),
      VueUiTiremarks: e(() => import("./vue-ui-tiremarks-CdX2b-Fq.js")),
      VueUiTreemap: e(() => import("./vue-ui-treemap-CgzgE20q.js")),
      VueUiVerticalBar: e(() => import("./vue-ui-vertical-bar-v9LvL35a.js")),
      VueUiWaffle: e(() => import("./vue-ui-waffle-0mHE8fud.js")),
      VueUiWheel: e(() => import("./vue-ui-wheel-BWL-td7-.js")),
      VueUiXy: e(() => import("./vue-ui-xy-C8E2WzGt.js")),
      VueUiTableHeatmap: e(() => import("./vue-ui-table-heatmap-DQBm_9Z3.js")),
      VueUiAccordion: e(() => import("./vue-ui-accordion-GNblUy42.js")),
      VueUiQuickChart: e(() => import("./vue-ui-quick-chart-DCPwhpbx.js")),
      VueUiCursor: e(() => import("./vue-ui-cursor-BysQ-bDH.js")),
      VueUiSparkTrend: e(() => import("./vue-ui-spark-trend-BkiRBoVD.js")),
      VueUiStripPlot: e(() => import("./vue-ui-strip-plot-CNFrYVZ6.js")),
      VueUiDumbbell: e(() => import("./vue-ui-dumbbell-CdxHbLz6.js")),
      VueUiWordCloud: e(() => import("./vue-ui-word-cloud-OkAF9hSC.js")),
      VueUiXyCanvas: e(() => import("./vue-ui-xy-canvas-C_0c8FlA.js")),
      VueUiFlow: e(() => import("./vue-ui-flow-cKQSDKfP.js")),
      VueUiParallelCoordinatePlot: e(() => import("./vue-ui-parallel-coordinate-plot-DAfBgYbI.js")),
      VueUiTimer: e(() => import("./vue-ui-timer-D2_1bbpl.js")),
      VueUiCarouselTable: e(() => import("./vue-ui-carousel-table-D5iLQe38.js")),
      VueUiGizmo: e(() => import("./vue-ui-gizmo-B5v0g_Ly.js")),
      VueUiStackbar: e(() => import("./vue-ui-stackbar-uR3T6rG4.js")),
      VueUiBullet: e(() => import("./vue-ui-bullet-D_CS85II.js")),
      VueUiFunnel: e(() => import("./vue-ui-funnel-qPYVhQpD.js")),
      VueUiHistoryPlot: e(() => import("./vue-ui-history-plot-COtfhHw8.js"))
    }, $ = {
      VueUi3dBar: ["config", "dataset"],
      VueUiAgePyramid: ["config", "dataset"],
      VueUiAnnotator: ["config", "dataset"],
      VueUiCandlestick: ["config", "dataset"],
      VueUiChestnut: ["config", "dataset"],
      VueUiDashboard: ["config", "dataset"],
      VueUiDigits: ["config", "dataset"],
      VueUiDonut: ["config", "dataset"],
      VueUiDonutEvolution: ["config", "dataset"],
      VueUiGalaxy: ["config", "dataset"],
      VueUiGauge: ["config", "dataset"],
      VueUiHeatmap: ["config", "dataset"],
      VueUiKpi: ["config", "dataset"],
      VueUiMiniLoader: ["config"],
      VueUiMolecule: ["config", "dataset"],
      VueUiMoodRadar: ["config", "dataset"],
      VueUiNestedDonuts: ["config", "dataset"],
      VueUiOnion: ["config", "dataset"],
      VueUiQuadrant: ["config", "dataset"],
      VueUiRadar: ["config", "dataset"],
      VueUiRating: ["config", "dataset"],
      VueUiRelationCircle: ["config", "dataset"],
      VueUiRings: ["config", "dataset"],
      VueUiScatter: ["config", "dataset"],
      VueUiScreenshot: ["config"],
      VueUiSkeleton: ["config"],
      VueUiSmiley: ["config", "dataset"],
      VueUiSparkbar: ["config", "dataset"],
      VueUiSparkgauge: ["config", "dataset"],
      VueUiSparkHistogram: ["config", "dataset"],
      VueUiSparkline: ["config", "dataset"],
      VueUiSparkStackbar: ["config", "dataset"],
      VueUiTable: ["config", "dataset"],
      VueUiTableSparkline: ["config", "dataset"],
      VueUiThermometer: ["config", "dataset"],
      VueUiTiremarks: ["config", "dataset"],
      VueUiTreemap: ["config", "dataset"],
      VueUiVerticalBar: ["config", "dataset"],
      VueUiWaffle: ["config", "dataset"],
      VueUiWheel: ["config", "dataset"],
      VueUiXy: ["config", "dataset"],
      VueUiTableHeatmap: ["config", "dataset"],
      VueUiAccordion: ["config"],
      VueUiQuickChart: ["config", "dataset"],
      VueUiCursor: ["config"],
      VueUiSparkTrend: ["config", "dataset"],
      VueUiStripPlot: ["config", "dataset"],
      VueUiDumbbell: ["config", "dataset"],
      VueUiWordCloud: ["config", "dataset"],
      VueUiXyCanvas: ["config", "dataset"],
      VueUiFlow: ["config", "dataset"],
      VueUiParallelCoordinatePlot: ["config", "dataset"],
      VueUiTimer: ["config"],
      VueUiCarouselTable: ["config", "dataset"],
      VueUiGizmo: ["config", "dataset"],
      VueUiStackbar: ["config", "dataset"],
      VueUiBullet: ["config", "dataset"],
      VueUiFunnel: ["config", "dataset"],
      VueUiHistoryPlot: ["config", "dataset"]
    }, g = c(() => !u[n.component]), j = c(() => u[n.component] || null), i = o(null), z = c(() => {
      const t = $[n.component] || [], a = {};
      return t.includes("config") && (a.config = Q.value), t.includes("dataset") && (a.dataset = X.value), a;
    }), p = o(() => null), m = o(() => null), d = o(() => null), V = o(() => null), U = o(() => null), f = o(() => null), v = o(() => null), h = o(() => null), k = o(() => null), S = o(() => null), y = o(() => null), b = o(() => null), T = o(() => null), A = o(() => null), C = o(() => null), P = o(() => null), D = o(() => null), x = o(() => null), H = o(() => null), L = o(() => null), _ = o(() => null), B = o(() => null), I = o(() => null), E = o(() => null);
    Y(() => {
      if (g.value)
        throw new Error(`

Vue Data UI exception:
The provided component "${n.component}" does not exist. Check the spelling.

Available components:

${Object.keys(u).map((t) => `. ${t}
`).join("")}`);
    }), O(i, async (t) => {
      t && (t.generatePdf && (p.value = t.generatePdf), t.generateImage && (d.value = t.generateImage), t.generateCsv && (m.value = t.generateCsv), t.getItemsPositions && (V.value = t.getItemsPositions), t.toggleReadonly && (U.value = t.toggleReadonly), t.shoot && (f.value = t.shoot), t.close && (v.value = t.close), t.restoreOrder && (h.value = t.restoreOrder), t.recalculateHeight && (k.value = t.recalculateHeight), t.toggleLock && (S.value = t.toggleLock), t.toggleTable && (y.value = t.toggleTable), t.toggleLabels && (b.value = t.toggleLabels), t.toggleSort && (T.value = t.toggleSort), t.toggleStack && (A.value = t.toggleStack), t.toggleTooltip && (C.value = t.toggleTooltip), t.start && (P.value = t.start), t.pause && (D.value = t.pause), t.reset && (x.value = t.reset), t.restart && (H.value = t.restart), t.lap && (L.value = t.lap), t.toggleAnimation && (_.value = t.toggleAnimation), t.pauseAnimation && (B.value = t.pauseAnimation), t.resumeAnimation && (I.value = t.resumeAnimation), t.toggleAnnotator && (E.value = t.toggleAnnotator));
    });
    const K = () => {
      const t = [
        "selectLegend",
        "selectDatapoint",
        "toggleOpenState",
        "saveAnnotations",
        "selectRoot",
        "selectBranch",
        "selectNut",
        "change",
        "selectPlot",
        "selectSide",
        "rate",
        "postImage",
        "hoverIndex",
        "selectX",
        "toggleLock",
        "toggleTooltip",
        "start",
        "pause",
        "reset",
        "restart",
        "lap",
        "toggleAnimation",
        "pauseAnimation",
        "resumeAnimation",
        "toggleAnnotator"
      ], a = {};
      return t.forEach((s) => {
        a[s] = (...l) => M(s, ...l);
      }), a;
    }, r = Z([]);
    return O([r, i], () => {
      if (i.value)
        for (; r.length; ) {
          const [t, ...a] = r.shift();
          typeof i.value[t] == "function" && i.value[t](...a);
        }
    }), G({
      getData: (...t) => i.value && typeof i.value.getData == "function" ? i.value.getData() : r.push(["getData", ...t]),
      generatePdf: p,
      generateCsv: m,
      generateImage: d,
      getItemsPositions: V,
      toggleReadonly: U,
      shoot: f,
      close: v,
      restoreOrder: h,
      recalculateHeight: k,
      toggleLock: S,
      toggleTable: y,
      toggleLabels: b,
      toggleSort: T,
      toggleStack: A,
      toggleTooltip: C,
      start: P,
      pause: D,
      reset: x,
      restart: H,
      lap: L,
      pauseAnimation: B,
      resumeAnimation: I,
      toggleAnimation: _,
      toggleAnnotator: E
    }), (t, a) => g.value ? (F(), R("div", Vt, [
      w("div", Ut, [
        tt(dt, {
          name: "moodFlat",
          stroke: "#FF0000"
        })
      ]),
      et(' The provided component "' + ot(it(W)) + '" does not exist ', 1)
    ])) : (F(), at(nt(j.value), rt({
      key: 1,
      ref_key: "currentComponentRef",
      ref: i
    }, z.value, lt(K())), ut({ _: 2 }, [
      st(t.$slots, (s, l) => ({
        name: l,
        fn: ct((q) => [
          gt(t.$slots, l, pt(mt(q)))
        ])
      }))
    ]), 1040));
  }
};
export {
  ht as default
};
