@opengis/bi
Version:
BI data visualization module
1,213 lines • 245 kB
JavaScript
var vs = Object.defineProperty;
var ws = (t, e, s) => e in t ? vs(t, e, { enumerable: !0, configurable: !0, writable: !0, value: s }) : t[e] = s;
var J = (t, e, s) => ws(t, typeof e != "symbol" ? e + "" : e, s);
import { h as Ue, defineComponent as be, ref as S, computed as A, onUnmounted as Oe, openBlock as u, createElementBlock as f, Fragment as Y, createElementVNode as d, createTextVNode as oe, toDisplayString as P, renderList as ae, createCommentVNode as U, useModel as ts, normalizeClass as se, withDirectives as He, vModelCheckbox as ks, mergeModels as Ge, defineAsyncComponent as te, onMounted as me, watch as ie, normalizeStyle as et, withModifiers as it, createVNode as W, unref as H, createBlock as F, resolveDynamicComponent as ct, createStaticVNode as _s, mergeProps as $e, resolveComponent as ue, withCtx as G, Teleport as $s, Transition as Ds, renderSlot as Vt, getCurrentInstance as Te, onErrorCaptured as Cs, inject as ss, reactive as Ts, createApp as zs, onBeforeUnmount as Is, vShow as Ss, vModelText as Ls, vModelSelect as Es, provide as at, readonly as Ws } from "vue";
import { useRouter as Le, useRoute as as } from "vue-router";
/**
* @license lucide-vue-next v0.577.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
const Rs = (t) => {
for (const e in t)
if (e.startsWith("aria-") || e === "role" || e === "title")
return !0;
return !1;
};
/**
* @license lucide-vue-next v0.577.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
const Nt = (t) => t === "";
/**
* @license lucide-vue-next v0.577.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
const js = (...t) => t.filter((e, s, a) => !!e && e.trim() !== "" && a.indexOf(e) === s).join(" ").trim();
/**
* @license lucide-vue-next v0.577.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
const Pt = (t) => t.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
/**
* @license lucide-vue-next v0.577.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
const Vs = (t) => t.replace(
/^([A-Z])|[\s-_]+(\w)/g,
(e, s, a) => a ? a.toUpperCase() : s.toLowerCase()
);
/**
* @license lucide-vue-next v0.577.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
const Ns = (t) => {
const e = Vs(t);
return e.charAt(0).toUpperCase() + e.slice(1);
};
/**
* @license lucide-vue-next v0.577.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
var Ee = {
xmlns: "http://www.w3.org/2000/svg",
width: 24,
height: 24,
viewBox: "0 0 24 24",
fill: "none",
stroke: "currentColor",
"stroke-width": 2,
"stroke-linecap": "round",
"stroke-linejoin": "round"
};
/**
* @license lucide-vue-next v0.577.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
const Ps = ({
name: t,
iconNode: e,
absoluteStrokeWidth: s,
"absolute-stroke-width": a,
strokeWidth: r,
"stroke-width": o,
size: n = Ee.width,
color: i = Ee.stroke,
...l
}, { slots: c }) => Ue(
"svg",
{
...Ee,
...l,
width: n,
height: n,
stroke: i,
"stroke-width": Nt(s) || Nt(a) || s === !0 || a === !0 ? Number(r || o || Ee["stroke-width"]) * 24 / Number(n) : r || o || Ee["stroke-width"],
class: js(
"lucide",
l.class,
...t ? [`lucide-${Pt(Ns(t))}-icon`, `lucide-${Pt(t)}`] : ["lucide-icon"]
),
...!c.default && !Rs(l) && { "aria-hidden": "true" }
},
[...e.map((p) => Ue(...p)), ...c.default ? [c.default()] : []]
);
/**
* @license lucide-vue-next v0.577.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
const pe = (t, e) => (s, { slots: a, attrs: r }) => Ue(
Ps,
{
...r,
...s,
iconNode: e,
name: t
},
a
);
/**
* @license lucide-vue-next v0.577.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
const Os = pe("arrow-up-down", [
["path", { d: "m21 16-4 4-4-4", key: "f6ql7i" }],
["path", { d: "M17 20V4", key: "1ejh1v" }],
["path", { d: "m3 8 4-4 4 4", key: "11wl7u" }],
["path", { d: "M7 4v16", key: "1glfcx" }]
]);
/**
* @license lucide-vue-next v0.577.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
const Bs = pe("chevron-right", [
["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }]
]);
/**
* @license lucide-vue-next v0.577.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
const Ms = pe("download", [
["path", { d: "M12 15V3", key: "m9g1x1" }],
["path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4", key: "ih7n3h" }],
["path", { d: "m7 10 5 5 5-5", key: "brsn70" }]
]);
/**
* @license lucide-vue-next v0.577.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
const rs = pe("ellipsis-vertical", [
["circle", { cx: "12", cy: "12", r: "1", key: "41hilf" }],
["circle", { cx: "12", cy: "5", r: "1", key: "gxeob9" }],
["circle", { cx: "12", cy: "19", r: "1", key: "lyex9k" }]
]);
/**
* @license lucide-vue-next v0.577.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
const As = pe("funnel", [
[
"path",
{
d: "M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z",
key: "sc7q7i"
}
]
]);
/**
* @license lucide-vue-next v0.577.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
const Fs = pe("layout-dashboard", [
["rect", { width: "7", height: "9", x: "3", y: "3", rx: "1", key: "10lvy0" }],
["rect", { width: "7", height: "5", x: "14", y: "3", rx: "1", key: "16une8" }],
["rect", { width: "7", height: "9", x: "14", y: "12", rx: "1", key: "1hutg5" }],
["rect", { width: "7", height: "5", x: "3", y: "16", rx: "1", key: "ldoo1y" }]
]);
/**
* @license lucide-vue-next v0.577.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
const qs = pe("layout-grid", [
["rect", { width: "7", height: "7", x: "3", y: "3", rx: "1", key: "1g98yp" }],
["rect", { width: "7", height: "7", x: "14", y: "3", rx: "1", key: "6d4xhi" }],
["rect", { width: "7", height: "7", x: "14", y: "14", rx: "1", key: "nxv5o0" }],
["rect", { width: "7", height: "7", x: "3", y: "14", rx: "1", key: "1bb6yr" }]
]);
/**
* @license lucide-vue-next v0.577.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
const Us = pe("pencil", [
[
"path",
{
d: "M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",
key: "1a8usu"
}
],
["path", { d: "m15 5 4 4", key: "1mk7zo" }]
]);
/**
* @license lucide-vue-next v0.577.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
const ns = pe("plus", [
["path", { d: "M5 12h14", key: "1ays0h" }],
["path", { d: "M12 5v14", key: "s699le" }]
]);
/**
* @license lucide-vue-next v0.577.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
const Hs = pe("save", [
[
"path",
{
d: "M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",
key: "1c8476"
}
],
["path", { d: "M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7", key: "1ydtos" }],
["path", { d: "M7 3v4a1 1 0 0 0 1 1h7", key: "t51u73" }]
]);
/**
* @license lucide-vue-next v0.577.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
const Ot = pe("search", [
["path", { d: "m21 21-4.34-4.34", key: "14j7rj" }],
["circle", { cx: "11", cy: "11", r: "8", key: "4ej97u" }]
]);
/**
* @license lucide-vue-next v0.577.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
const Gs = pe("table-2", [
[
"path",
{
d: "M9 3H5a2 2 0 0 0-2 2v4m6-6h10a2 2 0 0 1 2 2v4M9 3v18m0 0h10a2 2 0 0 0 2-2V9M9 21H5a2 2 0 0 1-2-2V9m0 0h18",
key: "gugj83"
}
]
]);
/**
* @license lucide-vue-next v0.577.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
const Zs = pe("trash-2", [
["path", { d: "M10 11v6", key: "nco0om" }],
["path", { d: "M14 11v6", key: "outv1u" }],
["path", { d: "M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6", key: "miytrc" }],
["path", { d: "M3 6h18", key: "d0wm0j" }],
["path", { d: "M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2", key: "e791ji" }]
]);
/**
* @license lucide-vue-next v0.577.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
const Qs = pe("x", [
["path", { d: "M18 6 6 18", key: "1bl5f8" }],
["path", { d: "m6 6 12 12", key: "d8bk6v" }]
]), rt = {
week: "Тиждень",
month: "Місяць",
quarter: "Квартал",
year: "Рік"
}, Xs = ["onClick"], Js = { class: "flex items-center justify-between w-full" }, Ks = { key: 0 }, Ys = /* @__PURE__ */ be({
__name: "vs-bi-dropdown",
props: {
title: {},
options: {},
value: { default: null }
},
emits: ["selected"],
setup(t, { emit: e }) {
const s = t, a = e, r = S(!1), o = S(s.value ?? null), n = S(null), i = A(() => {
const m = s.options;
return typeof m == "string" ? m.split(",").map((b, k) => ({ id: k, text: b.trim() })) : Array.isArray(m) ? m : [];
}), l = A(() => {
const m = i.value.find(
(b) => (b.id ?? b) === o.value
);
return m ? m.text ?? String(m) : s.title ?? "";
}), c = (m) => {
const b = (m == null ? void 0 : m.id) ?? m;
o.value = b, r.value = !1, a("selected", b), document.removeEventListener("click", p);
}, p = (m) => {
n.value && !n.value.contains(m.target) && (r.value = !1, document.removeEventListener("click", p));
}, h = () => {
r.value = !r.value, r.value ? setTimeout(() => {
document.addEventListener("click", p);
}, 200) : document.removeEventListener("click", p);
}, x = (m) => (rt == null ? void 0 : rt[m]) ?? m;
return Oe(() => {
document.removeEventListener("click", p);
}), (m, b) => (u(), f(Y, null, [
d("button", {
type: "button",
"aria-expanded": "true",
class: "hs-select-disabled:pointer-events-none hs-select-disabled:opacity-50 relative group pr-2 -ms-2 py-1.5 pl-2.5 inline-flex shrink-0 justify-center items-center gap-x-1.5 text-sm text-gray-800 rounded-lg hover:bg-gray-100 focus:outline-none focus:bg-gray-100 before:absolute before:inset-0 before:z-[1] dark:text-neutral-400 dark:hover:bg-neutral-800 dark:focus:bg-neutral-700",
onClick: h
}, [
oe(P(x(l.value)) + " ", 1),
b[0] || (b[0] = d("svg", {
class: "shrink-0 size-3.5 text-gray-600 dark:text-neutral-400",
xmlns: "http://www.w3.org/2000/svg",
width: "16",
height: "16",
viewBox: "0 0 24 24",
fill: "none",
stroke: "currentColor",
"stroke-width": "2",
"stroke-linecap": "round",
"stroke-linejoin": "round"
}, [
d("path", { d: "m6 9 6 6 6-6" })
], -1))
]),
r.value ? (u(), f("div", {
key: 0,
ref_key: "biDropdown",
ref: n,
"data-hs-select-dropdown": "",
class: "absolute mt-2 z-50 w-48 p-1 space-y-0.5 bg-white rounded-xl shadow-[0_10px_40px_10px_rgba(0,0,0,0.08)] dark:bg-neutral-950 opened",
role: "listbox",
tabindex: "-1",
"aria-orientation": "vertical",
style: { "margin-top": "10px" }
}, [
(u(!0), f(Y, null, ae(i.value, (k) => (u(), f("div", {
key: k.id || k,
class: "cursor-pointer selected hs-selected:bg-gray-100 dark:hs-selected:bg-neutral-800 py-1.5 px-2 w-full text-[13px] text-gray-800 rounded-lg hover:bg-gray-100 focus:outline-none focus:bg-gray-100 dark:text-neutral-300 dark:hover:bg-neutral-700 dark:focus:bg-neutral-700",
onClick: (y) => c(k)
}, [
d("div", Js, [
d("span", null, P(x(k.text || k)), 1),
o.value === (k.id || k) ? (u(), f("span", Ks, [...b[1] || (b[1] = [
d("svg", {
class: "shrink-0 h-3.5 w-3.5 text-gray-800 dark:text-neutral-200",
xmlns: "http:.w3.org/2000/svg",
width: "24",
height: "24",
viewBox: "0 0 24 24",
fill: "none",
stroke: "currentColor",
"stroke-width": "2",
"stroke-linecap": "round",
"stroke-linejoin": "round"
}, [
d("polyline", { points: "20 6 9 17 4 12" })
], -1)
])])) : U("", !0)
])
], 8, Xs))), 128))
], 512)) : U("", !0)
], 64));
}
}), ea = { class: "flex items-center space-x-2" }, ta = /* @__PURE__ */ be({
__name: "vs-bi-switch",
props: /* @__PURE__ */ Ge({
leftLabel: {},
rightLabel: {},
modelValue: { type: Boolean }
}, {
modelValue: {
default: () => !1,
type: Boolean
},
modelModifiers: {}
}),
emits: /* @__PURE__ */ Ge(["update:is-enabled"], ["update:modelValue"]),
setup(t, { emit: e }) {
const s = e, a = ts(t, "modelValue"), r = () => {
s("update:is-enabled", a);
};
return (o, n) => (u(), f("div", ea, [
t.leftLabel ? (u(), f("div", {
key: 0,
class: se(["transition-colors", { "text-blue-500": !a.value }])
}, P(t.leftLabel), 3)) : U("", !0),
He(d("input", {
"onUpdate:modelValue": n[0] || (n[0] = (i) => a.value = i),
type: "checkbox",
class: "relative w-11 h-6 p-px bg-gray-100 border-transparent text-transparent rounded-full cursor-pointer transition-colors ease-in-out duration-200 focus:ring-blue-600 disabled:opacity-50 disabled:pointer-events-none checked:bg-none checked:text-blue-600 checked:border-blue-600 focus:checked:border-blue-600 dark:bg-neutral-800 dark:border-neutral-700 dark:checked:bg-blue-500 dark:checked:border-blue-500 dark:focus:ring-offset-gray-600 before:inline-block before:size-5 before:bg-white checked:before:bg-blue-200 before:translate-x-0 checked:before:translate-x-full before:rounded-full before:shadow before:h-5 before:w-5 before:transform before:ring-0 before:transition before:ease-in-out before:duration-200 dark:before:bg-neutral-400 dark:checked:before:bg-blue-200",
onChange: r
}, null, 544), [
[ks, a.value]
]),
t.rightLabel ? (u(), f("div", {
key: 1,
class: se(["transition-colors", { "text-blue-500": a.value }])
}, P(t.rightLabel), 3)) : U("", !0)
]));
}
}), de = (t, e) => {
const s = t.__vccOpts || t;
for (const [a, r] of e)
s[a] = r;
return s;
}, sa = {}, aa = { class: "flex items-center justify-center h-full" };
function ra(t, e) {
return u(), f("div", aa, [...e[0] || (e[0] = [
d("div", { class: "text-center text-gray-500" }, [
d("h2", { class: "text-2xl font-bold" }, "No data available")
], -1)
])]);
}
const na = /* @__PURE__ */ de(sa, [["render", ra]]), Bt = {
"bi-bar": te(() => Promise.resolve().then(() => Ci)),
"bi-number": te(() => import("./vs-number-CzonlFLD.js")),
"bi-text": te(() => import("./vs-text-DMXTmQKi.js")),
"bi-listbar": te(() => Promise.resolve().then(() => Dl)),
"bi-pie": te(() => Promise.resolve().then(() => Vi)),
"bi-donut": te(() => Promise.resolve().then(() => Li)),
"bi-line": te(() => Promise.resolve().then(() => Mi)),
"bi-stat": te(() => Promise.resolve().then(() => al)),
"bi-pivot": te(() => Promise.resolve().then(() => Al)),
"bi-progress": te(() => Promise.resolve().then(() => ml)),
"bi-funnel": te(() => import("./vs-funnel-bar-DaSadldj.js")),
"bi-map": te(() => import("./vs-map-14QHciFK.js")),
"bi-cluster": te(() => import("./vs-map-cluster-B_bci3OY.js")),
"bi-table": te(() => import("./vs-table-xK1TIBZy.js"))
};
let os = "/api";
function tt(t) {
os = t || "/api";
}
function oa(t, e) {
const s = os.replace(/\/$/, ""), r = t.startsWith("http") || t.startsWith("//") || s && t.startsWith(s) ? t : `${s}${t.startsWith("/") ? t : `/${t}`}`;
if (!e || !Object.keys(e).length) return r;
const o = new URLSearchParams();
Object.entries(e).forEach(([i, l]) => {
l !== void 0 && l !== "" && o.set(i, String(l));
});
const n = o.toString();
return n ? `${r}${r.includes("?") ? "&" : "?"}${n}` : r;
}
async function Ae(t, e = {}) {
const { params: s, ...a } = e, r = oa(t, s), o = {
...a.headers
};
a.body != null && (o["Content-Type"] = o["Content-Type"] ?? "application/json");
const n = await fetch(r, { ...a, headers: o });
if (!n.ok) {
const l = new Error(n.statusText);
throw l.status = n.status, l;
}
const i = await n.text();
if (i)
try {
return JSON.parse(i);
} catch {
return i;
}
}
const re = {
get(t, e) {
return Ae(t, { ...e, method: "GET" });
},
post(t, e) {
return Ae(t, { method: "POST", body: e != null ? JSON.stringify(e) : void 0 });
},
put(t, e) {
return Ae(t, { method: "PUT", body: e != null ? JSON.stringify(e) : void 0 });
},
delete(t) {
return Ae(t, { method: "DELETE" });
}
};
function Mt(t) {
if (t == null) return "";
const e = String(t);
return /[",\n\r]/.test(e) ? `"${e.replace(/"/g, '""')}"` : e;
}
function ia(t, e) {
const s = e.map(Mt).join(","), a = t.map((r) => e.map((o) => Mt(r[o])).join(",")).join(`\r
`);
return `${s}\r
${a}`;
}
function At(t, e, s) {
const a = new Blob([e], { type: `${s};charset=utf-8` }), r = URL.createObjectURL(a), o = document.createElement("a");
o.href = r, o.download = t, document.body.appendChild(o), o.click(), document.body.removeChild(o), URL.revokeObjectURL(r);
}
function Ft(t, e) {
return ((t || e).replace(/[<>:"/\\|?*\u0000-\u001f]/g, "_").trim() || e).slice(0, 120);
}
function ye(t, e) {
const s = t && typeof t == "object" && "value" in t ? t.value : t;
if (s == null) return "";
const a = Number(s);
return Number.isNaN(a) ? String(s) : new Intl.NumberFormat("en", e ?? { notation: "compact" }).format(a);
}
function ut(t) {
if (!(t != null && t.includes("T"))) return t ?? "";
const [e, s, a] = t.split("T")[0].split("-");
return `${a}.${s}.${e}`;
}
const qt = {
year: "numeric",
month: "short",
day: "numeric",
hour: "2-digit",
minute: "2-digit"
};
function lt(t) {
if (t == null || t === "") return "";
if (t instanceof Date && !Number.isNaN(t.getTime()))
return new Intl.DateTimeFormat("uk-UA", qt).format(t);
const e = String(t).trim(), s = e.includes("T") ? e : e.replace(/^(\d{4}-\d{2}-\d{2}) (\d{2}:\d{2}:\d{2})/, "$1T$2"), a = new Date(s);
return Number.isNaN(a.getTime()) ? e : new Intl.DateTimeFormat("uk-UA", qt).format(a);
}
function Hl(t) {
return Intl.NumberFormat("en").format(t ?? 0);
}
const la = {
key: 0,
class: "text-[16px] flex max-w-full items-center min-h-0 justify-between h-fit shrink-0"
}, da = { class: "flex items-center justify-between w-full gap-2" }, ca = { class: "flex flex-col gap-0.5 min-w-0" }, ua = { class: "text-gray-800 inline-block line-clamp-1 font-semibold" }, pa = {
key: 0,
class: "text-xs text-gray-400 font-normal line-clamp-1"
}, ha = { class: "flex items-center gap-1 shrink-0" }, fa = ["aria-expanded"], ga = {
key: 0,
class: "absolute right-0 mt-1 z-50 min-w-[180px] p-1 bg-white rounded-xl shadow-[0_10px_40px_10px_rgba(0,0,0,0.08)] border border-gray-100",
role: "menu"
}, ma = { class: "flex flex-col justify-end" }, ba = {
key: 0,
class: "flex items-center justify-end w-full gap-2"
}, xa = {
key: 1,
class: "text-xs text-gray-400 mb-2 shrink-0"
}, ya = "Експорт даних віджета", va = "Завантажити CSV", wa = "Завантажити JSON", ka = "Експорт зображення (PNG)", Ze = /* @__PURE__ */ be({
__name: "vs-widget",
props: {
config: { default: null },
data: { default: null },
dashboard: {},
prefix: { default: "" },
widget: {},
height: {},
filterURl: {},
dashboardWidgets: {},
selectedWidget: {},
prefetchedData: { default: null }
},
emits: ["update:current-widget-data"],
setup(t, { emit: e }) {
function s(g) {
if (g == null || g === "") return null;
if (g instanceof Date) return g;
if (typeof g == "object") {
const _ = g.widget, w = g.dashboard;
return _ != null && _ !== "" ? _ : w != null && w !== "" ? w : null;
}
return g;
}
const a = t, r = e, o = S(null), n = S(null), i = S(null), l = S({}), c = S([]), p = S(!1), h = S(null), x = A(() => {
const g = a.config;
return a.widget || (g == null ? void 0 : g.widget) || (g == null ? void 0 : g.widgetId) || (g == null ? void 0 : g.id) || (g == null ? void 0 : g.name) || "";
}), m = A(() => {
const g = a.config;
return a.dashboard || (g == null ? void 0 : g.dashboard) || (g == null ? void 0 : g.dashboardId) || "";
}), b = A(() => {
var g;
return a.prefix || ((g = a.config) == null ? void 0 : g.prefix) || "";
}), k = A(() => a.data || a.prefetchedData || null);
function y(g) {
const _ = g.source;
if (Array.isArray(_) && _[0] && typeof _[0] == "object")
return Object.keys(_[0]);
const w = g.columns;
return Array.isArray(w) && w.length ? w.map((j) => typeof j == "string" ? j : (j == null ? void 0 : j.name) ?? "").filter(Boolean) : [];
}
const z = A(() => {
const g = l.value;
if ((g == null ? void 0 : g.status) != null && g.status >= 400) return !1;
const _ = g == null ? void 0 : g.source;
return Array.isArray(_) && _.length > 0 && y(g).length > 0;
});
function $() {
p.value = !1, document.removeEventListener("click", v);
}
function v(g) {
const _ = h.value;
_ && !_.contains(g.target) && $();
}
function R() {
p.value = !p.value, p.value ? setTimeout(() => document.addEventListener("click", v), 0) : document.removeEventListener("click", v);
}
function M() {
const g = l.value, _ = g == null ? void 0 : g.source;
if (!Array.isArray(_) || !_.length) return;
const w = y(g);
if (!w.length) return;
const j = ia(_, w), K = Ft(D.value || x.value || "widget", "widget");
At(`${K}.csv`, `\uFEFF${j}`, "text/csv"), $();
}
function I(g, _) {
return g.map((w) => {
const j = {};
for (const K of _)
K in w && (j[K] = w[K]);
return j;
});
}
function T() {
const g = l.value, _ = g == null ? void 0 : g.source;
if (!Array.isArray(_) || !_.length) return;
const w = y(g), j = I(_, w), K = { title: D.value, widget: x.value, columns: w, source: j }, E = Ft(D.value || x.value || "widget", "widget");
At(`${E}.json`, JSON.stringify(K, null, 2), "application/json"), $();
}
const D = A(() => {
var _, w, j;
const g = (_ = a.dashboardWidgets) == null ? void 0 : _.find((K) => K.name === x.value);
return ((w = g == null ? void 0 : g.data) == null ? void 0 : w.title) ?? (g == null ? void 0 : g.title) ?? ((j = a.config) == null ? void 0 : j.title) ?? "";
}), V = A(() => {
var E, we, ke;
const g = s((E = l.value) == null ? void 0 : E.last_update), _ = s(
(we = k.value) == null ? void 0 : we.last_update
), w = g ?? _;
if (w != null) return lt(w);
const j = (ke = a.dashboardWidgets) == null ? void 0 : ke.find((_e) => _e.name === x.value), K = s(j == null ? void 0 : j.last_update) ?? (j == null ? void 0 : j.updated_at) ?? null;
return lt(K);
}), O = A(() => {
var w, j, K;
const g = (w = a.dashboardWidgets) == null ? void 0 : w.find((E) => E.name === x.value), _ = (j = k.value) == null ? void 0 : j.type;
return (g == null ? void 0 : g.type) ?? ((K = a.config) == null ? void 0 : K.type) ?? _ ?? "text";
}), ee = A(() => {
var g, _, w;
return a.height || ((g = a.config) == null ? void 0 : g.height) || ((w = (_ = l.value) == null ? void 0 : _.style) == null ? void 0 : w.height) || 480;
}), ne = A(() => {
var _;
const g = (_ = l.value) == null ? void 0 : _.controls;
return !g || typeof g == "boolean" ? [] : Object.keys(g).map((w) => ({
name: w,
options: g[w]
}));
}), le = A(() => {
const g = O.value ? `bi-${O.value}` : "";
return g && g in Bt ? Bt[g] : null;
});
function L(g, _) {
var w, j;
(j = (w = n.value) == null ? void 0 : w.changeStyle) == null || j.call(w, g, _);
}
function C(g, _) {
const w = c.value.find((j) => j.name === _);
w ? w.option = g : c.value.push({ name: _, option: g }), B();
}
function B() {
var _, w;
let g = `/bi-data?dashboard=${m.value}&widget=${x.value}`;
c.value.forEach((j) => {
g += `&${j.name}=${j.option}`;
}), (w = (_ = n.value) == null ? void 0 : _.getDataFromURL) == null || w.call(_, g);
}
function Z() {
const g = i.value;
if (g != null && g.getDataURL) {
const _ = g.getDataURL({
type: "png",
pixelRatio: 2,
backgroundColor: "#ffffff"
}), w = document.createElement("a");
w.href = _, w.download = "chart.png", document.body.appendChild(w), w.click(), document.body.removeChild(w);
}
}
return me(() => {
b.value && tt(b.value);
}), Oe(() => {
document.removeEventListener("click", v);
}), ie(
() => a.filterURl,
(g) => {
var _, w;
g && ((w = (_ = n.value) == null ? void 0 : _.setFilter) == null || w.call(_, g));
}
), ie(
() => a.selectedWidget,
(g, _) => {
var w;
g !== _ && g === ((w = l.value) == null ? void 0 : w.id) && r("update:current-widget-data", l.value);
}
), ie(
l,
(g, _) => {
(g == null ? void 0 : g.id) !== (_ == null ? void 0 : _.id) && r("update:current-widget-data", g);
},
{ deep: !0 }
), (g, _) => {
var w, j, K;
return u(), f("div", {
ref_key: "widgetRef",
ref: o,
class: "box-border relative p-4 bg-white border border-gray-200 rounded-xl shadow-sm select-auto overflow-hidden mb-2 last:mb-0 flex flex-col min-h-0",
style: et({ height: ee.value + "px", maxHeight: ee.value + "px" })
}, [
["text", "cluster", "map"].includes(O.value) ? V.value ? (u(), f("p", xa, " Оновлено: " + P(V.value), 1)) : U("", !0) : (u(), f("div", la, [
d("div", da, [
d("div", ca, [
d("span", ua, P(D.value), 1),
V.value ? (u(), f("span", pa, " Оновлено: " + P(V.value), 1)) : U("", !0)
]),
d("div", ha, [
z.value ? (u(), f("div", {
key: 0,
ref_key: "dataExportRootRef",
ref: h,
class: "relative"
}, [
d("button", {
type: "button",
class: "h-[32px] w-[32px] rounded-lg hover:bg-gray-100 duration-100 flex items-center justify-center",
title: ya,
"aria-haspopup": "menu",
"aria-expanded": p.value,
onClick: it(R, ["stop"])
}, [
W(H(rs), {
size: 16,
class: "text-gray-800"
})
], 8, fa),
p.value ? (u(), f("div", ga, [
d("button", {
type: "button",
role: "menuitem",
class: "w-full text-left py-1.5 px-2 text-[13px] text-gray-800 rounded-lg hover:bg-gray-100",
onClick: M
}, P(va)),
d("button", {
type: "button",
role: "menuitem",
class: "w-full text-left py-1.5 px-2 text-[13px] text-gray-800 rounded-lg hover:bg-gray-100",
onClick: T
}, P(wa))
])) : U("", !0)
], 512)) : U("", !0),
d("div", ma, [
(w = ne.value) != null && w.length ? (u(), f("span", ba, [
(u(!0), f(Y, null, ae((j = ne.value) == null ? void 0 : j.filter(
(E) => (E == null ? void 0 : E.options) && (E == null ? void 0 : E.name) !== "export"
), (E) => {
var we, ke;
return u(), f("div", {
key: E == null ? void 0 : E.name
}, [
Array.isArray(E == null ? void 0 : E.options) ? (u(), F(Ys, {
key: 0,
title: E == null ? void 0 : E.name,
options: E == null ? void 0 : E.options,
value: ((ke = (we = l.value) == null ? void 0 : we.data) == null ? void 0 : ke[E == null ? void 0 : E.name]) ?? null,
onSelected: (_e) => C(_e, E == null ? void 0 : E.name)
}, null, 8, ["title", "options", "value", "onSelected"])) : typeof E.options == "boolean" ? (u(), F(ta, {
key: 1,
"left-label": E == null ? void 0 : E.name,
"model-value": !!(E != null && E.options),
"onUpdate:isEnabled": (_e) => L(E == null ? void 0 : E.name, _e)
}, null, 8, ["left-label", "model-value", "onUpdate:isEnabled"])) : U("", !0)
]);
}), 128)),
(K = ne.value) != null && K.some((E) => (E == null ? void 0 : E.name) === "export") ? (u(), f("button", {
key: 0,
type: "button",
class: "h-[32px] w-[32px] rounded-lg hover:bg-gray-100 duration-100 flex items-center justify-center",
title: ka,
onClick: Z
}, [
W(H(Ms), {
size: 16,
class: "text-gray-800"
})
])) : U("", !0)
])) : U("", !0)
])
])
])
])),
d("div", {
class: "w-full flex-1 min-h-0",
onClick: _[2] || (_[2] = it(() => {
}, ["stop"]))
}, [
le.value ? (u(), F(ct(le.value), {
key: 0,
ref_key: "chartRef",
ref: n,
"current-widget": i.value,
"onUpdate:currentWidget": _[0] || (_[0] = (E) => i.value = E),
"widget-data": l.value,
"onUpdate:widgetData": _[1] || (_[1] = (E) => l.value = E),
config: t.config,
dashboard: m.value,
title: D.value,
widget: x.value,
prefix: b.value,
"prefetched-data": k.value
}, null, 40, ["current-widget", "widget-data", "config", "dashboard", "title", "widget", "prefix", "prefetched-data"])) : (u(), F(na, {
key: 1,
class: "w-full h-full"
}))
])
], 4);
};
}
}), _a = { class: "w-full overflow-hidden rounded vs-table-interface__table-wrp h-fit" }, $a = { class: "p-5 min-h-[500px] flex flex-col justify-center items-center text-center" }, Da = { class: "max-w-sm mx-auto mt-6" }, Ca = { class: "font-medium text-gray-800 dark:text-neutral-200" }, Ta = { class: "mt-2 text-sm text-gray-500 dark:text-neutral-500" }, Qe = /* @__PURE__ */ be({
__name: "vs-new-nodata",
props: {
title: { default: "Дані для відображення відсутні" },
text: { default: "Змініть параметри пошуку або спробуйте пізніше" }
},
setup(t) {
return (e, s) => (u(), f("div", _a, [
d("div", null, [
d("div", $a, [
s[0] || (s[0] = _s('<svg class="w-48 mx-auto" viewBox="0 0 178 90" fill="none" xmlns="http://www.w3.org/2000/svg"><rect x="27" y="50.5" width="124" height="39" rx="7.5" fill="currentColor" class="fill-white dark:fill-neutral-800"></rect><rect x="27" y="50.5" width="124" height="39" rx="7.5" stroke="currentColor" class="stroke-gray-50 dark:stroke-neutral-700/10"></rect><rect x="34.5" y="58" width="24" height="24" rx="4" fill="currentColor" class="fill-gray-50 dark:fill-neutral-700/30"></rect><rect x="66.5" y="61" width="60" height="6" rx="3" fill="currentColor" class="fill-gray-50 dark:fill-neutral-700/30"></rect><rect x="66.5" y="73" width="77" height="6" rx="3" fill="currentColor" class="fill-gray-50 dark:fill-neutral-700/30"></rect><rect x="19.5" y="28.5" width="139" height="39" rx="7.5" fill="currentColor" class="fill-white dark:fill-neutral-800"></rect><rect x="19.5" y="28.5" width="139" height="39" rx="7.5" stroke="currentColor" class="stroke-gray-100 dark:stroke-neutral-700/30"></rect><rect x="27" y="36" width="24" height="24" rx="4" fill="currentColor" class="fill-gray-100 dark:fill-neutral-700/70"></rect><rect x="59" y="39" width="60" height="6" rx="3" fill="currentColor" class="fill-gray-100 dark:fill-neutral-700/70"></rect><rect x="59" y="51" width="92" height="6" rx="3" fill="currentColor" class="fill-gray-100 dark:fill-neutral-700/70"></rect><g filter="url(#filter1)"><rect x="12" y="6" width="154" height="40" rx="8" fill="currentColor" class="fill-white dark:fill-neutral-800" shape-rendering="crispEdges"></rect><rect x="12.5" y="6.5" width="153" height="39" rx="7.5" stroke="currentColor" class="stroke-gray-100 dark:stroke-neutral-700/60" shape-rendering="crispEdges"></rect><rect x="20" y="14" width="24" height="24" rx="4" fill="currentColor" class="fill-gray-200 dark:fill-neutral-700"></rect><rect x="52" y="17" width="60" height="6" rx="3" fill="currentColor" class="fill-gray-200 dark:fill-neutral-700"></rect><rect x="52" y="29" width="106" height="6" rx="3" fill="currentColor" class="fill-gray-200 dark:fill-neutral-700"></rect></g><defs><filter id="filter1" x="0" y="0" width="178" height="64" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB"><feFlood flood-opacity="0" result="BackgroundImageFix"></feFlood><feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"></feColorMatrix><feOffset dy="6"></feOffset><feGaussianBlur stdDeviation="6"></feGaussianBlur><feComposite in2="hardAlpha" operator="out"></feComposite><feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.03 0"></feColorMatrix><feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_1187_14810"></feBlend><feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_1187_14810" result="shape"></feBlend></filter></defs></svg>', 1)),
d("div", Da, [
d("p", Ca, P(t.title), 1),
d("p", Ta, P(t.text), 1)
])
])
])
]));
}
}), za = {
__name: "filter",
setup(t) {
return (e, s) => (u(), F(H(As), $e(e.$attrs, { size: 24 }), null, 16));
}
}, Ia = {
components: { filterIcon: za },
props: ["filterScheme"],
emits: ["filters:changed"]
}, Sa = { class: "flex items-center" }, La = {
key: 0,
type: "button",
class: "py-2 px-2.5 ml-3 h-[38px] inline-flex items-center gap-x-1.5 text-xs font-medium rounded-lg border border-gray-200 bg-white text-gray-800 hover:bg-gray-50 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-gray-50 opacity-60 cursor-not-allowed",
disabled: "",
title: "Фільтри вимкнено (v3-filter видалено)"
};
function Ea(t, e, s, a, r, o) {
const n = ue("filterIcon");
return u(), f("div", Sa, [
s.filterScheme ? (u(), f("button", La, [
W(n),
e[0] || (e[0] = oe(" Фільтри ", -1))
])) : U("", !0)
]);
}
const Wa = /* @__PURE__ */ de(Ia, [["render", Ea]]), Ra = {
components: { VsFilterHeader: Wa },
props: {
dashboardData: { type: Object, default: null },
filters: { type: Array, default: null }
}
}, ja = { class: "bg-white px-5 flex gap-4 h-[90px] border border-gray-200 rounded-xl mb-2 pt-[3px] justify-between items-center" }, Va = { class: "grow" }, Na = { class: "text-lg font-semibold text-stone-800 dark:text-neutral-200" }, Pa = {
key: 0,
class: "inline-flex items-center text-sm gap-x-2 text-stone-800 hover:text-stone-500 focus:outline-none focus:text-stone-500 dark:text-neutral-200 dark:hover:text-neutral-400 dark:focus:text-neutral-400"
}, Oa = {
key: 0,
class: "flex items-center gap-3"
};
function Ba(t, e, s, a, r, o) {
var i, l, c;
const n = ue("VsFilterHeader");
return u(), f("div", ja, [
d("div", Va, [
d("h1", Na, P((i = s.dashboardData) == null ? void 0 : i.title), 1),
(l = s.dashboardData) != null && l.description ? (u(), f("button", Pa, P((c = s.dashboardData) == null ? void 0 : c.description), 1)) : U("", !0)
]),
s.filters ? (u(), f("div", Oa, [
W(n, {
filterScheme: s.filters,
"onFilters:changed": e[0] || (e[0] = (p) => t.$emit("filters:changed", p))
}, null, 8, ["filterScheme"])
])) : U("", !0)
]);
}
const Ma = /* @__PURE__ */ de(Ra, [["render", Ba]]), Aa = {
key: 0,
class: "text-gray-400 shrink-0"
}, Fa = ["onClick"], qa = ["onClick"], Ua = {
key: 4,
class: "text-gray-900 font-medium truncate"
}, is = {
__name: "vs-breadcrumbs",
props: {
items: {
type: Array,
default: () => []
/** Array of { label: string, to?: string, onClick?: () => void } */
},
compact: { type: Boolean, default: !1 }
},
setup(t) {
const e = t, s = Le(), a = A(() => Array.isArray(e.items) ? e.items : []);
function r(o) {
s != null && s.push ? s.push(o) : typeof o == "string" && (window != null && window.location) && (window.location.href = o);
}
return (o, n) => {
const i = ue("router-link");
return u(), f("nav", {
class: se(["flex items-center gap-2 text-sm text-gray-600", t.compact ? "py-1" : "py-6"]),
"aria-label": "Breadcrumb"
}, [
(u(!0), f(Y, null, ae(a.value, (l, c) => (u(), f(Y, { key: c }, [
c > 0 ? (u(), f("span", Aa, [
W(H(Bs), { class: "w-4 h-4" })
])) : U("", !0),
typeof l.onClick == "function" ? (u(), f("span", {
key: 1,
class: "hover:text-gray-900 transition-colors cursor-pointer",
onClick: (p) => l.onClick()
}, P(l.label), 9, Fa)) : H(s) && l.to ? (u(), F(i, {
key: 2,
to: l.to,
class: "hover:text-gray-900 transition-colors"
}, {
default: G(() => [
oe(P(l.label), 1)
]),
_: 2
}, 1032, ["to"])) : l.to ? (u(), f("span", {
key: 3,
class: "hover:text-gray-900 transition-colors cursor-pointer",
onClick: (p) => r(l.to)
}, P(l.label), 9, qa)) : (u(), f("span", Ua, P(l.label), 1))
], 64))), 128))
], 2);
};
}
}, Ha = {
components: { VsWidget: Ze, VsNewNodata: Qe, VsHeader: Ma, VsBreadcrumbs: is },
props: {
id: { type: String, default: "" },
prefix: { type: String, default: "" },
config: { type: Object, default: null },
data: { type: Object, default: null }
},
data() {
return {
widgets: [],
panels: [],
error: !1,
selectedPanel: "",
filterURl: null,
dashboardData: null
};
},
computed: {
resolvedDashboardId() {
var t, e, s;
return this.id || ((t = this.config) == null ? void 0 : t.dashboard) || ((e = this.config) == null ? void 0 : e.dashboardId) || ((s = this.config) == null ? void 0 : s.id) || "";
},
resolvedPrefix() {
var t;
return this.prefix || ((t = this.config) == null ? void 0 : t.prefix) || "/api";
},
resolvedDashboardData() {
var t;
return this.data ? (t = this.data) != null && t.dashboardData && typeof this.data.dashboardData == "object" ? this.data.dashboardData : this.data : this.dashboardData;
},
widgetPrefetchedMap() {
return !this.data || typeof this.data != "object" ? null : [
this.data.widgetResponses,
this.data.widgetsData,
this.data.prefetchedData,
this.data.data
].find((e) => e && typeof e == "object" && !Array.isArray(e)) || null;
}
},
watch: {
data: {
immediate: !0,
handler(t) {
t && (this.dashboardData = t, this.error = !1);
}
},
resolvedPrefix: {
immediate: !0,
handler(t) {
tt(t || "/api");
}
},
async resolvedDashboardId(t, e) {
!this.data && t && t !== e && await this.fetchData();
}
},
async mounted() {
if (this.data) {
this.dashboardData = this.data;
return;
}
await this.fetchData();
},
methods: {
async fetchData() {
if (!(this.data || !this.resolvedDashboardId))
try {
const t = await re.get(`/bi-dashboard/${this.resolvedDashboardId}`);
this.dashboardData = t, this.error = !1;
} catch (t) {
this.error = !0, console.error(t);
}
},
columnClass(t) {
const e = t != null && t.col ? t == null ? void 0 : t.col : 12;
return {
1: "md:w-1/12 sm:w-full",
2: "md:w-1/6 sm:w-full",
3: "md:w-1/4 sm:w-full",
4: "md:w-1/3 sm:w-full",
6: "md:w-1/2 sm:w-full",
8: "md:w-2/3 sm:w-full",
10: "md:w-5/6 sm:w-full",
12: "w-full"
}[e] || "w-full";
},
async filterHandler(t) {
var s;
this.filterURl = "";
let e = "&filter=";
(s = t == null ? void 0 : t.url) != null && s.length && (t.url.split("|").forEach((r) => {
const o = r.split("=");
e += `${o[0]}=${o[1]}`;
}), this.filterURl += e);
},
getPrefetchedWidgetData(t) {
return !t || !this.widgetPrefetchedMap ? null : this.widgetPrefetchedMap[t] || null;
}
}
}, Ga = { class: "w-full pb-8 overflow-y-auto mx-auto" }, Za = { class: "grid flex-grow w-full grid-cols-12 gap-4 h-fit" };
function Qa(t, e, s, a, r, o) {
var l;
const n = ue("VsNewNodata"), i = ue("VsWidget");
return u(), f("div", Ga, [
d("div", Za, [
r.error || !o.resolvedDashboardData ? (u(), F(n, {
key: 0,
class: "col-span-12"
})) : U("", !0),
(u(!0), f(Y, null, ae(((l = o.resolvedDashboardData) == null ? void 0 : l.panels) || [], (c, p) => {
var h, x;
return u(), f("div", {
key: c.widget || ((h = c.widgets) == null ? void 0 : h.join("-")) || p,
class: se([`col-span-12 lg:col-span-${c.col || 12}`, "flex flex-col gap-[10px]"])
}, [
(x = c.widgets) != null && x.length ? (u(!0), f(Y, { key: 0 }, ae(c.widgets, (m) => (u(), F(i, {
key: m,
dashboard: o.resolvedDashboardId,
widget: m,
"dashboard-widgets": o.resolvedDashboardData.widgets,
"prefetched-data": o.getPrefetchedWidgetData(m),
"filter-u-rl": r.filterURl,
height: c.height
}, null, 8, ["dashboard", "widget", "dashboard-widgets", "prefetched-data", "filter-u-rl", "height"]))), 128)) : (u(), F(i, {
key: 1,
class: "flex flex-col",
dashboard: o.resolvedDashboardId,
widget: c.widget,
"dashboard-widgets": o.resolvedDashboardData.widgets,
"prefetched-data": o.getPrefetchedWidgetData(c.widget),
height: c.height,
"filter-u-rl": r.filterURl
}, null, 8, ["dashboard", "widget", "dashboard-widgets", "prefetched-data", "height", "filter-u-rl"]))
], 2);
}), 128))
])
]);
}
const Gl = /* @__PURE__ */ de(Ha, [["render", Qa]]);
var Xa = /* @__PURE__ */ ((t) => (t.Dashboard = "/dashboard", t.BiPlatform = "/bi-platform", t.EditorBase = "/editor", t.AllDashboards = "/dashboards", t.DashboardByName = "/dashboards/:name", t))(Xa || {}), Ut;
((t) => {
((e) => {
e.Bar = "bar", e.ListBar = "listbar", e.Number = "number", e.Text = "text", e.Pie = "pie", e.Heatmap = "heatmap", e.Calendar = "calendar", e.Line = "line", e.Stat = "stat", e.Pivot = "pivot", e.Funnel = "funnel", e.Progress = "progress";
})(t.Types || (t.Types = {}));
})(Ut || (Ut = {}));
var ce = /* @__PURE__ */ ((t) => (t.AllDashboards = "all-dashboards", t.BiPlatform = "bi-platform", t.Dashboard = "dashboard", t.Erobota = "erobota", t.Datatest = "datatest", t.Sourcedate = "sourcedate", t.Widgetwidget = "widgetwidget", t.Test = "test", t.Demo = "demo", t.Crm = "crm", t.Editor = "editor-all-dashboards", t.EditorDashboard = "editor-dashboard", t.EditorWidget = "editor-widget", t.Editordetails = "editordetails", t.Dbtables = "dbtables", t.Biviewer = "biviewer", t.Biviewerinner = "biviewerinner", t.Bieditor = "bieditor", t.Bieditorinner = "bieditorinner", t))(ce || {});
const Ja = {
key: 0,
class: "vs-modal-wrapper fixed inset-0 flex items-center justify-center p-4"
}, Ka = { class: "flex items-center justify-between shrink-0 py-2.5 px-4 border-b border-gray-200 dark:border-[#454545]" }, Ya = { class: "font-medium text-gray-800 dark:text-white" }, er = { class: "vs-modal-content flex-1 min-h-0 overflow-auto p-4" }, tr = {
key: 0,
class: "shrink-0 border-t border-gray-200 dark:border-neutral-700"
}, sr = {
__name: "vs-modal",
props: {
visible: { type: Boolean, default: !1 },
title: { type: String, default: "" },
size: { type: String, default: "medium" },
closeClickBack: { type: Boolean, default: !1 },
teleport: { type: String, default: "#modal" }
},
emits: ["close", "update:visible"],
setup(t, { emit: e }) {
const s = t, a = e, r = A(() => s.size === "small" ? "md:max-w-[40%] w-full max-w-md" : s.size === "lg" ? "md:max-w-[70%] w-full max-w-4xl" : "md:max-w-[80%] lg:max-w-[50%] w-full max-w-lg");
function o() {
a("update:visible", !1), a("close");
}
function n(i) {
i.key === "Escape" && o();
}
return me(() => {
window.addEventListener("keydown", n);
}), Oe(() => {
window.removeEventListener("keydown", n);
}), (i, l) => (u(), F($s, { to: t.teleport }, [
t.visible ? (u(), f("div", Ja, [
d("div", {
class: "absolute inset-0 bg-black/50",
"aria-hidden": "true",
onMousedown: l[0] || (l[0] = (c) => t.closeClickBack && c.target === c.currentTarget && o())
}, null, 32),
W(Ds, {
name: "vs-modal",
appear: ""
}, {
default: G(() => [
t.visible ? (u(), f("div", {
key: 0,
class: se(["vs-modal-panel relative flex flex-col bg-white dark:bg-[#1A1A1A] rounded-xl shadow-xl max-h-[85vh] min-w-0 border border-gray-200 dark:border-[#454545]", r.value]),
role: "dialog",
"aria-modal": "true",
onMousedown: l[1] || (l[1] = it(() => {
}, ["stop"]))
}, [
d("div", Ka, [
d("h3", Ya, P(t.title), 1),
d("button", {
type: "button",
class: "size-8 inline-flex justify-center items-center rounded-full bg-gray-100 text-gray-800 hover:bg-gray-200 dark:bg-neutral-700 dark:hover:bg-neutral-600 dark:text-neutral-300",
"aria-label": "Закрити",
onClick: o
}, [...l[2] || (l[2] = [
d("svg", {
class: "w-4 h-4",
xmlns: "http://www.w3.org/2000/svg",
fill: "none",
viewBox: "0 0 24 24",
stroke: "currentColor",
"stroke-width": "2"
}, [
d("path", {
"stroke-linecap": "round",
"stroke-linejoin": "round",
d: "M6 18L18 6M6 6l12 12"
})
], -1)
])])
]),
d("div", er, [
Vt(i.$slots, "default", {}, void 0, !0)
]),
i.$slots.footer ? (u(), f("div", tr, [
Vt(i.$slots, "footer", {}, void 0, !0)
])) : U("", !0)
], 34)) : U("", !0)
]),
_: 3
})
])) : U("", !0)
], 8, ["to"]));
}
}, Ne = /* @__PURE__ */ de(sr, [["__scopeId", "data-v-e08bae19"]]), ar = {
__name: "icon-plus",
setup(t) {
return (e, s) => (u(), F(H(ns), $e(e.$attrs, { size: 24 }), null, 16));
}
}, rr = { class: "mb-4 overflow-auto scrollbar max-h-96" }, nr = {
__name: "vs-editor-create-widget",
props: {
columns: {
type: Array,
default: () => []
},
selectedDashboard: String,
/** When true, only modal