@devkitvue/filemanager
Version:
Devkit Base Components is a Vue plugin offering a collection of reusable, headless components designed to streamline your Vue.js development workflow. Built for flexibility and maintainability, this library gives you complete control over styling and beha
1,364 lines • 1.29 MB
JavaScript
import { defineComponent as Le, ref as ie, h as de, watch as Qe, reactive as bb, provide as yb, onMounted as Yt, onBeforeUnmount as $i, mergeProps as C, inject as to, readonly as Gh, getCurrentInstance as xa, nextTick as Wh, computed as qe, useSlots as qh, withAsyncContext as Xh, resolveComponent as Z, createElementBlock as I, openBlock as y, Fragment as re, createVNode as ve, unref as Q, withCtx as ee, createCommentVNode as B, createBlock as M, renderSlot as G, createElementVNode as W, renderList as Te, createSlots as To, resolveDynamicComponent as ne, toDisplayString as Re, createTextVNode as _n, normalizeProps as Ei, guardReactiveProps as vb, useId as wb, Suspense as xb, Teleport as kb, resolveDirective as Zt, normalizeClass as ue, Transition as hu, withDirectives as Qt, withModifiers as fu, normalizeStyle as Sb, toHandlers as Li, withKeys as ns } from "vue";
import { useToast as mu, Dialog as Cb, Column as zi, ToggleSwitch as Pb, IconField as _b, InputIcon as Ob, InputText as Rb, useDialog as Ib, Panel as $b } from "primevue";
import { defineStore as Yh, getActivePinia as Eb } from "pinia";
import { ObjectKeys as Xn, ObjectEntries as Fo, resolveApiEndpoint as ka } from "@devkitvue/apiclient";
import { useQuery as Tb, keepPreviousData as Fb, useQueryClient as Zh, useMutation as Qh } from "@tanstack/vue-query";
import { useFormKitNodeById as gu, useFormKitContextById as Jh } from "@formkit/vue";
import { makeGridWrapperClassName as ef, AppBtn as Ft, AppDialog as Db } from "@devkitvue/base-components";
import { useRouter as tf, useRoute as Mb } from "vue-router";
import Ab from "dexie";
import { useI18n as nf } from "vue-i18n";
var Lb = Object.defineProperty, zb = (e, t, n) => t in e ? Lb(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, sn = (e, t, n) => zb(e, typeof t != "symbol" ? t + "" : t, n);
function Xe(...e) {
if (e) {
let t = [];
for (let n = 0; n < e.length; n++) {
const o = e[n];
if (!o)
continue;
const i = typeof o;
if (i === "string" || i === "number")
t.push(o);
else if (i === "object") {
const r = Array.isArray(o) ? [Xe(...o)] : Object.entries(o).map(([a, s]) => s ? a : void 0);
t = r.length ? t.concat(r.filter((a) => !!a)) : t;
}
}
return t.join(" ").trim();
}
}
function Bb(e, t) {
return e ? e.classList ? e.classList.contains(t) : new RegExp("(^| )" + t + "( |$)", "gi").test(e.className) : !1;
}
function br(e, t) {
if (e && t) {
const n = (o) => {
Bb(e, o) || (e.classList ? e.classList.add(o) : e.className += " " + o);
};
[t].flat().filter(Boolean).forEach((o) => o.split(" ").forEach(n));
}
}
function jb(e) {
if (e) {
const t = document.createElement("a");
if (t.download !== void 0) {
const { name: n, src: o } = e;
return t.setAttribute("href", o), t.setAttribute("download", n), t.style.display = "none", document.body.appendChild(t), t.click(), document.body.removeChild(t), !0;
}
}
return !1;
}
function Nb(e, t) {
const n = new Blob([e], {
type: "application/csv;charset=utf-8;"
});
window.navigator.msSaveOrOpenBlob ? navigator.msSaveOrOpenBlob(n, t + ".csv") : jb({ name: t + ".csv", src: URL.createObjectURL(n) }) || (e = "data:text/csv;charset=utf-8," + e, window.open(encodeURI(e)));
}
function xn(e, t) {
if (e && t) {
const n = (o) => {
e.classList ? e.classList.remove(o) : e.className = e.className.replace(new RegExp("(^|\\b)" + o.split(" ").join("|") + "(\\b|$)", "gi"), " ");
};
[t].flat().filter(Boolean).forEach((o) => o.split(" ").forEach(n));
}
}
function Sa(e) {
for (const t of document == null ? void 0 : document.styleSheets)
try {
for (const n of t == null ? void 0 : t.cssRules)
for (const o of n == null ? void 0 : n.style)
if (e.test(o))
return { name: o, value: n.style.getPropertyValue(o).trim() };
} catch {
}
return null;
}
function of(e) {
const t = { width: 0, height: 0 };
return e && (e.style.visibility = "hidden", e.style.display = "block", t.width = e.offsetWidth, t.height = e.offsetHeight, e.style.display = "none", e.style.visibility = "visible"), t;
}
function rf() {
const e = window, t = document, n = t.documentElement, o = t.getElementsByTagName("body")[0], i = e.innerWidth || n.clientWidth || o.clientWidth, r = e.innerHeight || n.clientHeight || o.clientHeight;
return { width: i, height: r };
}
function ll(e) {
return e ? Math.abs(e.scrollLeft) : 0;
}
function Ub() {
const e = document.documentElement;
return (window.pageXOffset || ll(e)) - (e.clientLeft || 0);
}
function Vb() {
const e = document.documentElement;
return (window.pageYOffset || e.scrollTop) - (e.clientTop || 0);
}
function af(e) {
return e ? getComputedStyle(e).direction === "rtl" : !1;
}
function bu(e, t, n = !0) {
var o, i, r, a;
if (e) {
const s = e.offsetParent ? { width: e.offsetWidth, height: e.offsetHeight } : of(e), u = s.height, l = s.width, d = t.offsetHeight, c = t.offsetWidth, h = t.getBoundingClientRect(), p = Vb(), w = Ub(), v = rf();
let g, b, m = "top";
h.top + d + u > v.height ? (g = h.top + p - u, m = "bottom", g < 0 && (g = p)) : g = d + h.top + p, h.left + l > v.width ? b = Math.max(0, h.left + w + c - l) : b = h.left + w, af(e) ? e.style.insetInlineEnd = b + "px" : e.style.insetInlineStart = b + "px", e.style.top = g + "px", e.style.transformOrigin = m, n && (e.style.marginTop = m === "bottom" ? `calc(${(i = (o = Sa(/-anchor-gutter$/)) == null ? void 0 : o.value) != null ? i : "2px"} * -1)` : (a = (r = Sa(/-anchor-gutter$/)) == null ? void 0 : r.value) != null ? a : "");
}
}
function Dr(e, t) {
e && (typeof t == "string" ? e.style.cssText = t : Object.entries(t || {}).forEach(([n, o]) => e.style[n] = o));
}
function Ye(e, t) {
return e instanceof HTMLElement ? e.offsetWidth : 0;
}
function Hb(e, t, n = !0) {
var o, i, r, a;
if (e) {
const s = e.offsetParent ? { width: e.offsetWidth, height: e.offsetHeight } : of(e), u = t.offsetHeight, l = t.getBoundingClientRect(), d = rf();
let c, h, p = "top";
l.top + u + s.height > d.height ? (c = -1 * s.height, p = "bottom", l.top + c < 0 && (c = -1 * l.top)) : c = u, s.width > d.width ? h = l.left * -1 : l.left + s.width > d.width ? h = (l.left + s.width - d.width) * -1 : h = 0, e.style.top = c + "px", e.style.insetInlineStart = h + "px", e.style.transformOrigin = p, n && (e.style.marginTop = p === "bottom" ? `calc(${(i = (o = Sa(/-anchor-gutter$/)) == null ? void 0 : o.value) != null ? i : "2px"} * -1)` : (a = (r = Sa(/-anchor-gutter$/)) == null ? void 0 : r.value) != null ? a : "");
}
}
function yu(e) {
if (e) {
let t = e.parentNode;
return t && t instanceof ShadowRoot && t.host && (t = t.host), t;
}
return null;
}
function Kb(e) {
return !!(e !== null && typeof e < "u" && e.nodeName && yu(e));
}
function lo(e) {
return typeof Element < "u" ? e instanceof Element : e !== null && typeof e == "object" && e.nodeType === 1 && typeof e.nodeName == "string";
}
function ha() {
if (window.getSelection) {
const e = window.getSelection() || {};
e.empty ? e.empty() : e.removeAllRanges && e.rangeCount > 0 && e.getRangeAt(0).getClientRects().length > 0 && e.removeAllRanges();
}
}
function Ca(e, t = {}) {
if (lo(e)) {
const n = (o, i) => {
var r, a;
const s = (r = e == null ? void 0 : e.$attrs) != null && r[o] ? [(a = e == null ? void 0 : e.$attrs) == null ? void 0 : a[o]] : [];
return [i].flat().reduce((u, l) => {
if (l != null) {
const d = typeof l;
if (d === "string" || d === "number")
u.push(l);
else if (d === "object") {
const c = Array.isArray(l) ? n(o, l) : Object.entries(l).map(([h, p]) => o === "style" && (p || p === 0) ? `${h.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase()}:${p}` : p ? h : void 0);
u = c.length ? u.concat(c.filter((h) => !!h)) : u;
}
}
return u;
}, s);
};
Object.entries(t).forEach(([o, i]) => {
if (i != null) {
const r = o.match(/^on(.+)/);
r ? e.addEventListener(r[1].toLowerCase(), i) : o === "p-bind" || o === "pBind" ? Ca(e, i) : (i = o === "class" ? [...new Set(n("class", i))].join(" ").trim() : o === "style" ? n("style", i).join(";").trim() : i, (e.$attrs = e.$attrs || {}) && (e.$attrs[o] = i), e.setAttribute(o, i));
}
});
}
}
function sf(e, t = {}, ...n) {
{
const o = document.createElement(e);
return Ca(o, t), o.append(...n), o;
}
}
function Ut(e, t) {
return lo(e) ? Array.from(e.querySelectorAll(t)) : [];
}
function Kt(e, t) {
return lo(e) ? e.matches(t) ? e : e.querySelector(t) : null;
}
function Ne(e, t) {
e && document.activeElement !== e && e.focus(t);
}
function Be(e, t) {
if (lo(e)) {
const n = e.getAttribute(t);
return isNaN(n) ? n === "true" || n === "false" ? n === "true" : n : +n;
}
}
function vu(e, t = "") {
const n = Ut(
e,
`button:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${t},
[href][clientHeight][clientWidth]:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${t},
input:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${t},
select:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${t},
textarea:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${t},
[tabIndex]:not([tabIndex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${t},
[contenteditable]:not([tabIndex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${t}`
), o = [];
for (const i of n)
getComputedStyle(i).display != "none" && getComputedStyle(i).visibility != "hidden" && o.push(i);
return o;
}
function Un(e, t) {
const n = vu(e, t);
return n.length > 0 ? n[0] : null;
}
function Vn(e) {
if (e) {
let t = e.offsetHeight;
const n = getComputedStyle(e);
return t -= parseFloat(n.paddingTop) + parseFloat(n.paddingBottom) + parseFloat(n.borderTopWidth) + parseFloat(n.borderBottomWidth), t;
}
return 0;
}
function Gb(e) {
if (e) {
e.style.visibility = "hidden", e.style.display = "block";
const t = e.offsetHeight;
return e.style.display = "none", e.style.visibility = "visible", t;
}
return 0;
}
function Wb(e) {
if (e) {
e.style.visibility = "hidden", e.style.display = "block";
const t = e.offsetWidth;
return e.style.display = "none", e.style.visibility = "visible", t;
}
return 0;
}
function fa(e) {
var t;
if (e) {
const n = (t = yu(e)) == null ? void 0 : t.childNodes;
let o = 0;
if (n)
for (let i = 0; i < n.length; i++) {
if (n[i] === e) return o;
n[i].nodeType === 1 && o++;
}
}
return -1;
}
function lf(e, t) {
const n = vu(e, t);
return n.length > 0 ? n[n.length - 1] : null;
}
function Aa(e, t) {
let n = e.nextElementSibling;
for (; n; ) {
if (n.matches(t))
return n;
n = n.nextElementSibling;
}
return null;
}
function go(e) {
if (e) {
const t = e.getBoundingClientRect();
return {
top: t.top + (window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0),
left: t.left + (window.pageXOffset || ll(document.documentElement) || ll(document.body) || 0)
};
}
return {
top: "auto",
left: "auto"
};
}
function Pa(e, t) {
return e ? e.offsetHeight : 0;
}
function uf(e, t = []) {
const n = yu(e);
return n === null ? t : uf(n, t.concat([n]));
}
function La(e, t) {
let n = e.previousElementSibling;
for (; n; ) {
if (n.matches(t))
return n;
n = n.previousElementSibling;
}
return null;
}
function qb(e) {
const t = [];
if (e) {
const n = uf(e), o = /(auto|scroll)/, i = (r) => {
try {
const a = window.getComputedStyle(r, null);
return o.test(a.getPropertyValue("overflow")) || o.test(a.getPropertyValue("overflowX")) || o.test(a.getPropertyValue("overflowY"));
} catch {
return !1;
}
};
for (const r of n) {
const a = r.nodeType === 1 && r.dataset.scrollselectors;
if (a) {
const s = a.split(",");
for (const u of s) {
const l = Kt(r, u);
l && i(l) && t.push(l);
}
}
r.nodeType !== 9 && i(r) && t.push(r);
}
}
return t;
}
function dd() {
if (window.getSelection) return window.getSelection().toString();
if (document.getSelection) return document.getSelection().toString();
}
function Hn(e) {
if (e) {
let t = e.offsetWidth;
const n = getComputedStyle(e);
return t -= parseFloat(n.paddingLeft) + parseFloat(n.paddingRight) + parseFloat(n.borderLeftWidth) + parseFloat(n.borderRightWidth), t;
}
return 0;
}
function cd(e, t, n) {
const o = e[t];
typeof o == "function" && o.apply(e, []);
}
function Xb() {
return /(android)/i.test(navigator.userAgent);
}
function os(e) {
if (e) {
const t = e.nodeName, n = e.parentElement && e.parentElement.nodeName;
return t === "INPUT" || t === "TEXTAREA" || t === "BUTTON" || t === "A" || n === "INPUT" || n === "TEXTAREA" || n === "BUTTON" || n === "A" || !!e.closest(".p-button, .p-checkbox, .p-radiobutton");
}
return !1;
}
function df() {
return !!(typeof window < "u" && window.document && window.document.createElement);
}
function pd(e, t = "") {
return lo(e) ? e.matches(`button:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${t},
[href][clientHeight][clientWidth]:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${t},
input:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${t},
select:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${t},
textarea:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${t},
[tabIndex]:not([tabIndex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${t},
[contenteditable]:not([tabIndex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${t}`) : !1;
}
function _a(e) {
return !!(e && e.offsetParent != null);
}
function wu() {
return "ontouchstart" in window || navigator.maxTouchPoints > 0 || navigator.msMaxTouchPoints > 0;
}
function xu(e, t = "", n) {
lo(e) && n !== null && n !== void 0 && e.setAttribute(t, n);
}
function ku() {
const e = /* @__PURE__ */ new Map();
return {
on(t, n) {
let o = e.get(t);
return o ? o.push(n) : o = [n], e.set(t, o), this;
},
off(t, n) {
const o = e.get(t);
return o && o.splice(o.indexOf(n) >>> 0, 1), this;
},
emit(t, n) {
const o = e.get(t);
o && o.forEach((i) => {
i(n);
});
},
clear() {
e.clear();
}
};
}
function Mt(e) {
return e == null || e === "" || Array.isArray(e) && e.length === 0 || !(e instanceof Date) && typeof e == "object" && Object.keys(e).length === 0;
}
function Yb(e, t, n, o = 1) {
let i = -1;
const r = Mt(e), a = Mt(t);
return r && a ? i = 0 : r ? i = o : a ? i = -o : typeof e == "string" && typeof t == "string" ? i = n(e, t) : i = e < t ? -1 : e > t ? 1 : 0, i;
}
function ul(e, t, n = /* @__PURE__ */ new WeakSet()) {
if (e === t) return !0;
if (!e || !t || typeof e != "object" || typeof t != "object" || n.has(e) || n.has(t)) return !1;
n.add(e).add(t);
const o = Array.isArray(e), i = Array.isArray(t);
let r, a, s;
if (o && i) {
if (a = e.length, a != t.length) return !1;
for (r = a; r-- !== 0; ) if (!ul(e[r], t[r], n)) return !1;
return !0;
}
if (o != i) return !1;
const u = e instanceof Date, l = t instanceof Date;
if (u != l) return !1;
if (u && l) return e.getTime() == t.getTime();
const d = e instanceof RegExp, c = t instanceof RegExp;
if (d != c) return !1;
if (d && c) return e.toString() == t.toString();
const h = Object.keys(e);
if (a = h.length, a !== Object.keys(t).length) return !1;
for (r = a; r-- !== 0; ) if (!Object.prototype.hasOwnProperty.call(t, h[r])) return !1;
for (r = a; r-- !== 0; )
if (s = h[r], !ul(e[s], t[s], n)) return !1;
return !0;
}
function Zb(e, t) {
return ul(e, t);
}
function za(e) {
return typeof e == "function" && "call" in e && "apply" in e;
}
function ae(e) {
return !Mt(e);
}
function fe(e, t) {
if (!e || !t)
return null;
try {
const n = e[t];
if (ae(n)) return n;
} catch {
}
if (Object.keys(e).length) {
if (za(t))
return t(e);
if (t.indexOf(".") === -1)
return e[t];
{
const n = t.split(".");
let o = e;
for (let i = 0, r = n.length; i < r; ++i) {
if (o == null)
return null;
o = o[n[i]];
}
return o;
}
}
return null;
}
function uo(e, t, n) {
return n ? fe(e, n) === fe(t, n) : Zb(e, t);
}
function Qb(e, t) {
if (e != null && t && t.length) {
for (const n of t)
if (uo(e, n)) return !0;
}
return !1;
}
function no(e, t = !0) {
return e instanceof Object && e.constructor === Object && (t || Object.keys(e).length !== 0);
}
function rs(e, t) {
let n = -1;
if (t) {
for (let o = 0; o < t.length; o++)
if (t[o] === e) {
n = o;
break;
}
}
return n;
}
function hd(e, t) {
let n = -1;
if (ae(e))
try {
n = e.findLastIndex(t);
} catch {
n = e.lastIndexOf([...e].reverse().find(t));
}
return n;
}
function lt(e, ...t) {
return za(e) ? e(...t) : e;
}
function bt(e, t = !0) {
return typeof e == "string" && (t || e !== "");
}
function Vt(e) {
return bt(e) ? e.replace(/(-|_)/g, "").toLowerCase() : e;
}
function Su(e, t = "", n = {}) {
const o = Vt(t).split("."), i = o.shift();
if (i) {
if (no(e)) {
const r = Object.keys(e).find((a) => Vt(a) === i) || "";
return Su(lt(e[r], n), o.join("."), n);
}
return;
}
return lt(e, n);
}
function cf(e, t = !0) {
return Array.isArray(e) && (t || e.length !== 0);
}
function Jb(e) {
return ae(e) && !isNaN(e);
}
function ey(e = "") {
return ae(e) && e.length === 1 && !!e.match(/\S| /);
}
function fd() {
return new Intl.Collator(void 0, { numeric: !0 }).compare;
}
function _o(e, t) {
if (t) {
const n = t.test(e);
return t.lastIndex = 0, n;
}
return !1;
}
function Cr(e) {
return e && e.replace(/\/\*(?:(?!\*\/)[\s\S])*\*\/|[\r\n\t]+/g, "").replace(/ {2,}/g, " ").replace(/ ([{:}]) /g, "$1").replace(/([;,]) /g, "$1").replace(/ !/g, "!").replace(/: /g, ":").trim();
}
function yt(e) {
if (e && /[\xC0-\xFF\u0100-\u017E]/.test(e)) {
const t = {
A: /[\xC0-\xC5\u0100\u0102\u0104]/g,
AE: /[\xC6]/g,
C: /[\xC7\u0106\u0108\u010A\u010C]/g,
D: /[\xD0\u010E\u0110]/g,
E: /[\xC8-\xCB\u0112\u0114\u0116\u0118\u011A]/g,
G: /[\u011C\u011E\u0120\u0122]/g,
H: /[\u0124\u0126]/g,
I: /[\xCC-\xCF\u0128\u012A\u012C\u012E\u0130]/g,
IJ: /[\u0132]/g,
J: /[\u0134]/g,
K: /[\u0136]/g,
L: /[\u0139\u013B\u013D\u013F\u0141]/g,
N: /[\xD1\u0143\u0145\u0147\u014A]/g,
O: /[\xD2-\xD6\xD8\u014C\u014E\u0150]/g,
OE: /[\u0152]/g,
R: /[\u0154\u0156\u0158]/g,
S: /[\u015A\u015C\u015E\u0160]/g,
T: /[\u0162\u0164\u0166]/g,
U: /[\xD9-\xDC\u0168\u016A\u016C\u016E\u0170\u0172]/g,
W: /[\u0174]/g,
Y: /[\xDD\u0176\u0178]/g,
Z: /[\u0179\u017B\u017D]/g,
a: /[\xE0-\xE5\u0101\u0103\u0105]/g,
ae: /[\xE6]/g,
c: /[\xE7\u0107\u0109\u010B\u010D]/g,
d: /[\u010F\u0111]/g,
e: /[\xE8-\xEB\u0113\u0115\u0117\u0119\u011B]/g,
g: /[\u011D\u011F\u0121\u0123]/g,
i: /[\xEC-\xEF\u0129\u012B\u012D\u012F\u0131]/g,
ij: /[\u0133]/g,
j: /[\u0135]/g,
k: /[\u0137,\u0138]/g,
l: /[\u013A\u013C\u013E\u0140\u0142]/g,
n: /[\xF1\u0144\u0146\u0148\u014B]/g,
p: /[\xFE]/g,
o: /[\xF2-\xF6\xF8\u014D\u014F\u0151]/g,
oe: /[\u0153]/g,
r: /[\u0155\u0157\u0159]/g,
s: /[\u015B\u015D\u015F\u0161]/g,
t: /[\u0163\u0165\u0167]/g,
u: /[\xF9-\xFC\u0169\u016B\u016D\u016F\u0171\u0173]/g,
w: /[\u0175]/g,
y: /[\xFD\xFF\u0177]/g,
z: /[\u017A\u017C\u017E]/g
};
for (const n in t)
e = e.replace(t[n], n);
}
return e;
}
function md(e, t, n) {
e && t !== n && (n >= e.length && (n %= e.length, t %= e.length), e.splice(n, 0, e.splice(t, 1)[0]));
}
function gd(e, t, n = 1, o, i = 1) {
const r = Yb(e, t, o, n);
let a = n;
return (Mt(e) || Mt(t)) && (a = i === 1 ? n : i), a * r;
}
function ty(e) {
return bt(e, !1) ? e[0].toUpperCase() + e.slice(1) : e;
}
function pf(e) {
return bt(e) ? e.replace(/(_)/g, "-").replace(/[A-Z]/g, (t, n) => n === 0 ? t : "-" + t.toLowerCase()).toLowerCase() : e;
}
var Bi = {};
function ny(e = "pui_id_") {
return Object.hasOwn(Bi, e) || (Bi[e] = 0), Bi[e]++, `${e}${Bi[e]}`;
}
function oy() {
let e = [];
const t = (a, s, u = 999) => {
const l = i(a, s, u), d = l.value + (l.key === a ? 0 : u) + 1;
return e.push({ key: a, value: d }), d;
}, n = (a) => {
e = e.filter((s) => s.value !== a);
}, o = (a, s) => i(a).value, i = (a, s, u = 0) => [...e].reverse().find((l) => !0) || { key: a, value: u }, r = (a) => a && parseInt(a.style.zIndex, 10) || 0;
return {
get: r,
set: (a, s, u) => {
s && (s.style.zIndex = String(t(a, !0, u)));
},
clear: (a) => {
a && (n(r(a)), a.style.zIndex = "");
},
getCurrent: (a) => o(a)
};
}
var gn = oy(), bd = {
STARTS_WITH: "startsWith",
CONTAINS: "contains"
}, Oa = {
AND: "and",
OR: "or"
};
function yd(e, t) {
var n = typeof Symbol < "u" && e[Symbol.iterator] || e["@@iterator"];
if (!n) {
if (Array.isArray(e) || (n = ry(e)) || t) {
n && (e = n);
var o = 0, i = function() {
};
return { s: i, n: function() {
return o >= e.length ? { done: !0 } : { done: !1, value: e[o++] };
}, e: function(u) {
throw u;
}, f: i };
}
throw new TypeError(`Invalid attempt to iterate non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
}
var r, a = !0, s = !1;
return { s: function() {
n = n.call(e);
}, n: function() {
var u = n.next();
return a = u.done, u;
}, e: function(u) {
s = !0, r = u;
}, f: function() {
try {
a || n.return == null || n.return();
} finally {
if (s) throw r;
}
} };
}
function ry(e, t) {
if (e) {
if (typeof e == "string") return vd(e, t);
var n = {}.toString.call(e).slice(8, -1);
return n === "Object" && e.constructor && (n = e.constructor.name), n === "Map" || n === "Set" ? Array.from(e) : n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) ? vd(e, t) : void 0;
}
}
function vd(e, t) {
(t == null || t > e.length) && (t = e.length);
for (var n = 0, o = Array(t); n < t; n++) o[n] = e[n];
return o;
}
var dl = {
filter: function(e, t, n, o, i) {
var r = [];
if (!e)
return r;
var a = yd(e), s;
try {
for (a.s(); !(s = a.n()).done; ) {
var u = s.value;
if (typeof u == "string") {
if (this.filters[o](u, n, i)) {
r.push(u);
continue;
}
} else {
var l = yd(t), d;
try {
for (l.s(); !(d = l.n()).done; ) {
var c = d.value, h = fe(u, c);
if (this.filters[o](h, n, i)) {
r.push(u);
break;
}
}
} catch (p) {
l.e(p);
} finally {
l.f();
}
}
}
} catch (p) {
a.e(p);
} finally {
a.f();
}
return r;
},
filters: {
startsWith: function(e, t, n) {
if (t == null || t === "")
return !0;
if (e == null)
return !1;
var o = yt(t.toString()).toLocaleLowerCase(n), i = yt(e.toString()).toLocaleLowerCase(n);
return i.slice(0, o.length) === o;
},
contains: function(e, t, n) {
if (t == null || t === "")
return !0;
if (e == null)
return !1;
var o = yt(t.toString()).toLocaleLowerCase(n), i = yt(e.toString()).toLocaleLowerCase(n);
return i.indexOf(o) !== -1;
},
notContains: function(e, t, n) {
if (t == null || t === "")
return !0;
if (e == null)
return !1;
var o = yt(t.toString()).toLocaleLowerCase(n), i = yt(e.toString()).toLocaleLowerCase(n);
return i.indexOf(o) === -1;
},
endsWith: function(e, t, n) {
if (t == null || t === "")
return !0;
if (e == null)
return !1;
var o = yt(t.toString()).toLocaleLowerCase(n), i = yt(e.toString()).toLocaleLowerCase(n);
return i.indexOf(o, i.length - o.length) !== -1;
},
equals: function(e, t, n) {
return t == null || t === "" ? !0 : e == null ? !1 : e.getTime && t.getTime ? e.getTime() === t.getTime() : yt(e.toString()).toLocaleLowerCase(n) == yt(t.toString()).toLocaleLowerCase(n);
},
notEquals: function(e, t, n) {
return t == null || t === "" ? !1 : e == null ? !0 : e.getTime && t.getTime ? e.getTime() !== t.getTime() : yt(e.toString()).toLocaleLowerCase(n) != yt(t.toString()).toLocaleLowerCase(n);
},
in: function(e, t) {
if (t == null || t.length === 0)
return !0;
for (var n = 0; n < t.length; n++)
if (uo(e, t[n]))
return !0;
return !1;
},
between: function(e, t) {
return t == null || t[0] == null || t[1] == null ? !0 : e == null ? !1 : e.getTime ? t[0].getTime() <= e.getTime() && e.getTime() <= t[1].getTime() : t[0] <= e && e <= t[1];
},
lt: function(e, t) {
return t == null ? !0 : e == null ? !1 : e.getTime && t.getTime ? e.getTime() < t.getTime() : e < t;
},
lte: function(e, t) {
return t == null ? !0 : e == null ? !1 : e.getTime && t.getTime ? e.getTime() <= t.getTime() : e <= t;
},
gt: function(e, t) {
return t == null ? !0 : e == null ? !1 : e.getTime && t.getTime ? e.getTime() > t.getTime() : e > t;
},
gte: function(e, t) {
return t == null ? !0 : e == null ? !1 : e.getTime && t.getTime ? e.getTime() >= t.getTime() : e >= t;
},
dateIs: function(e, t) {
return t == null ? !0 : e == null ? !1 : e.toDateString() === t.toDateString();
},
dateIsNot: function(e, t) {
return t == null ? !0 : e == null ? !1 : e.toDateString() !== t.toDateString();
},
dateBefore: function(e, t) {
return t == null ? !0 : e == null ? !1 : e.getTime() < t.getTime();
},
dateAfter: function(e, t) {
return t == null ? !0 : e == null ? !1 : e.getTime() > t.getTime();
}
},
register: function(e, t) {
this.filters[e] = t;
}
};
function Mr(e) {
"@babel/helpers - typeof";
return Mr = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(t) {
return typeof t;
} : function(t) {
return t && typeof Symbol == "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
}, Mr(e);
}
function iy(e, t) {
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function");
}
function ay(e, t) {
for (var n = 0; n < t.length; n++) {
var o = t[n];
o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, ly(o.key), o);
}
}
function sy(e, t, n) {
return t && ay(e.prototype, t), Object.defineProperty(e, "prototype", { writable: !1 }), e;
}
function ly(e) {
var t = uy(e, "string");
return Mr(t) == "symbol" ? t : t + "";
}
function uy(e, t) {
if (Mr(e) != "object" || !e) return e;
var n = e[Symbol.toPrimitive];
if (n !== void 0) {
var o = n.call(e, t);
if (Mr(o) != "object") return o;
throw new TypeError("@@toPrimitive must return a primitive value.");
}
return String(e);
}
var Cu = /* @__PURE__ */ function() {
function e(t) {
var n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : function() {
};
iy(this, e), this.element = t, this.listener = n;
}
return sy(e, [{
key: "bindScrollListener",
value: function() {
this.scrollableParents = qb(this.element);
for (var t = 0; t < this.scrollableParents.length; t++)
this.scrollableParents[t].addEventListener("scroll", this.listener);
}
}, {
key: "unbindScrollListener",
value: function() {
if (this.scrollableParents)
for (var t = 0; t < this.scrollableParents.length; t++)
this.scrollableParents[t].removeEventListener("scroll", this.listener);
}
}, {
key: "destroy",
value: function() {
this.unbindScrollListener(), this.element = null, this.listener = null, this.scrollableParents = null;
}
}]);
}();
function Ar(e) {
"@babel/helpers - typeof";
return Ar = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(t) {
return typeof t;
} : function(t) {
return t && typeof Symbol == "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
}, Ar(e);
}
function dy(e) {
return fy(e) || hy(e) || py(e) || cy();
}
function cy() {
throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
}
function py(e, t) {
if (e) {
if (typeof e == "string") return cl(e, t);
var n = {}.toString.call(e).slice(8, -1);
return n === "Object" && e.constructor && (n = e.constructor.name), n === "Map" || n === "Set" ? Array.from(e) : n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) ? cl(e, t) : void 0;
}
}
function hy(e) {
if (typeof Symbol < "u" && e[Symbol.iterator] != null || e["@@iterator"] != null) return Array.from(e);
}
function fy(e) {
if (Array.isArray(e)) return cl(e);
}
function cl(e, t) {
(t == null || t > e.length) && (t = e.length);
for (var n = 0, o = Array(t); n < t; n++) o[n] = e[n];
return o;
}
function my(e, t) {
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function");
}
function gy(e, t) {
for (var n = 0; n < t.length; n++) {
var o = t[n];
o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, hf(o.key), o);
}
}
function by(e, t, n) {
return t && gy(e.prototype, t), Object.defineProperty(e, "prototype", { writable: !1 }), e;
}
function wd(e, t, n) {
return (t = hf(t)) in e ? Object.defineProperty(e, t, { value: n, enumerable: !0, configurable: !0, writable: !0 }) : e[t] = n, e;
}
function hf(e) {
var t = yy(e, "string");
return Ar(t) == "symbol" ? t : t + "";
}
function yy(e, t) {
if (Ar(e) != "object" || !e) return e;
var n = e[Symbol.toPrimitive];
if (n !== void 0) {
var o = n.call(e, t);
if (Ar(o) != "object") return o;
throw new TypeError("@@toPrimitive must return a primitive value.");
}
return String(e);
}
var Do = /* @__PURE__ */ function() {
function e(t) {
var n = t.init, o = t.type;
my(this, e), wd(this, "helpers", void 0), wd(this, "type", void 0), this.helpers = new Set(n), this.type = o;
}
return by(e, [{
key: "add",
value: function(t) {
this.helpers.add(t);
}
}, {
key: "update",
value: function() {
}
}, {
key: "delete",
value: function(t) {
this.helpers.delete(t);
}
}, {
key: "clear",
value: function() {
this.helpers.clear();
}
}, {
key: "get",
value: function(t, n) {
var o = this._get(t, n), i = o ? this._recursive(dy(this.helpers), o) : null;
return ae(i) ? i : null;
}
}, {
key: "_isMatched",
value: function(t, n) {
var o, i = t == null ? void 0 : t.parent;
return (i == null || (o = i.vnode) === null || o === void 0 ? void 0 : o.key) === n || i && this._isMatched(i, n) || !1;
}
}, {
key: "_get",
value: function(t, n) {
var o, i;
return ((o = n || (t == null ? void 0 : t.$slots)) === null || o === void 0 || (i = o.default) === null || i === void 0 ? void 0 : i.call(o)) || null;
}
}, {
key: "_recursive",
value: function() {
var t = this, n = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [], o = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : [], i = [];
return o.forEach(function(r) {
r.children instanceof Array ? i = i.concat(t._recursive(i, r.children)) : r.type.name === t.type ? i.push(r) : ae(r.key) && (i = i.concat(n.filter(function(a) {
return t._isMatched(a, r.key);
}).map(function(a) {
return a.vnode;
})));
}), i;
}
}]);
}();
function Rn(e, t) {
if (e) {
var n = e.props;
if (n) {
var o = t.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase(), i = Object.prototype.hasOwnProperty.call(n, o) ? o : t;
return e.type.extends.props[t].type === Boolean && n[i] === "" ? !0 : n[i];
}
}
return null;
}
var vy = Object.defineProperty, wy = Object.defineProperties, xy = Object.getOwnPropertyDescriptors, Ra = Object.getOwnPropertySymbols, ff = Object.prototype.hasOwnProperty, mf = Object.prototype.propertyIsEnumerable, xd = (e, t, n) => t in e ? vy(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, Rt = (e, t) => {
for (var n in t || (t = {}))
ff.call(t, n) && xd(e, n, t[n]);
if (Ra)
for (var n of Ra(t))
mf.call(t, n) && xd(e, n, t[n]);
return e;
}, is = (e, t) => wy(e, xy(t)), Jt = (e, t) => {
var n = {};
for (var o in e)
ff.call(e, o) && t.indexOf(o) < 0 && (n[o] = e[o]);
if (e != null && Ra)
for (var o of Ra(e))
t.indexOf(o) < 0 && mf.call(e, o) && (n[o] = e[o]);
return n;
}, ky = ku(), nt = ky, pl = /{([^}]*)}/g, Sy = /(\d+\s+[\+\-\*\/]\s+\d+)/g, Cy = /var\([^)]+\)/g;
function Py(e) {
return no(e) && e.hasOwnProperty("$value") && e.hasOwnProperty("$type") ? e.$value : e;
}
function _y(e) {
return e.replaceAll(/ /g, "").replace(/[^\w]/g, "-");
}
function hl(e = "", t = "") {
return _y(`${bt(e, !1) && bt(t, !1) ? `${e}-` : e}${t}`);
}
function gf(e = "", t = "") {
return `--${hl(e, t)}`;
}
function Oy(e = "") {
const t = (e.match(/{/g) || []).length, n = (e.match(/}/g) || []).length;
return (t + n) % 2 !== 0;
}
function bf(e, t = "", n = "", o = [], i) {
if (bt(e)) {
const r = e.trim();
if (Oy(r))
return;
if (_o(r, pl)) {
const a = r.replaceAll(pl, (s) => {
const u = s.replace(/{|}/g, "").split(".").filter((l) => !o.some((d) => _o(l, d)));
return `var(${gf(n, pf(u.join("-")))}${ae(i) ? `, ${i}` : ""})`;
});
return _o(a.replace(Cy, "0"), Sy) ? `calc(${a})` : a;
}
return r;
} else if (Jb(e))
return e;
}
function Ry(e, t, n) {
bt(t, !1) && e.push(`${t}:${n};`);
}
function bo(e, t) {
return e ? `${e}{${t}}` : "";
}
function yf(e, t) {
if (e.indexOf("dt(") === -1) return e;
function n(a, s) {
const u = [];
let l = 0, d = "", c = null, h = 0;
for (; l <= a.length; ) {
const p = a[l];
if ((p === '"' || p === "'" || p === "`") && a[l - 1] !== "\\" && (c = c === p ? null : p), !c && (p === "(" && h++, p === ")" && h--, (p === "," || l === a.length) && h === 0)) {
const w = d.trim();
w.startsWith("dt(") ? u.push(yf(w, s)) : u.push(o(w)), d = "", l++;
continue;
}
p !== void 0 && (d += p), l++;
}
return u;
}
function o(a) {
const s = a[0];
if ((s === '"' || s === "'" || s === "`") && a[a.length - 1] === s)
return a.slice(1, -1);
const u = Number(a);
return isNaN(u) ? a : u;
}
const i = [], r = [];
for (let a = 0; a < e.length; a++)
if (e[a] === "d" && e.slice(a, a + 3) === "dt(")
r.push(a), a += 2;
else if (e[a] === ")" && r.length > 0) {
const s = r.pop();
r.length === 0 && i.push([s, a]);
}
if (!i.length) return e;
for (let a = i.length - 1; a >= 0; a--) {
const [s, u] = i[a], l = e.slice(s + 3, u), d = n(l, t), c = t(...d);
e = e.slice(0, s) + c + e.slice(u + 1);
}
return e;
}
var Jn = (...e) => Iy(Pe.getTheme(), ...e), Iy = (e = {}, t, n, o) => {
if (t) {
const { variable: i, options: r } = Pe.defaults || {}, { prefix: a, transform: s } = (e == null ? void 0 : e.options) || r || {}, u = _o(t, pl) ? t : `{${t}}`;
return o === "value" || Mt(o) && s === "strict" ? Pe.getTokenValue(t) : bf(u, void 0, a, [i.excludedKeyRegex], n);
}
return "";
};
function ji(e, ...t) {
if (e instanceof Array) {
const n = e.reduce((o, i, r) => {
var a;
return o + i + ((a = lt(t[r], { dt: Jn })) != null ? a : "");
}, "");
return yf(n, Jn);
}
return lt(e, { dt: Jn });
}
function $y(e, t = {}) {
const n = Pe.defaults.variable, { prefix: o = n.prefix, selector: i = n.selector, excludedKeyRegex: r = n.excludedKeyRegex } = t, a = [], s = [], u = [{ node: e, path: o }];
for (; u.length; ) {
const { node: d, path: c } = u.pop();
for (const h in d) {
const p = d[h], w = Py(p), v = _o(h, r) ? hl(c) : hl(c, pf(h));
if (no(w))
u.push({ node: w, path: v });
else {
const g = gf(v), b = bf(w, v, o, [r]);
Ry(s, g, b);
let m = v;
o && m.startsWith(o + "-") && (m = m.slice(o.length + 1)), a.push(m.replace(/-/g, "."));
}
}
}
const l = s.join("");
return {
value: s,
tokens: a,
declarations: l,
css: bo(i, l)
};
}
var kt = {
regex: {
rules: {
class: {
pattern: /^\.([a-zA-Z][\w-]*)$/,
resolve(e) {
return { type: "class", selector: e, matched: this.pattern.test(e.trim()) };
}
},
attr: {
pattern: /^\[(.*)\]$/,
resolve(e) {
return { type: "attr", selector: `:root${e}`, matched: this.pattern.test(e.trim()) };
}
},
media: {
pattern: /^@media (.*)$/,
resolve(e) {
return { type: "media", selector: `${e}{:root{[CSS]}}`, matched: this.pattern.test(e.trim()) };
}
},
system: {
pattern: /^system$/,
resolve(e) {
return { type: "system", selector: "@media (prefers-color-scheme: dark){:root{[CSS]}}", matched: this.pattern.test(e.trim()) };
}
},
custom: {
resolve(e) {
return { type: "custom", selector: e, matched: !0 };
}
}
},
resolve(e) {
const t = Object.keys(this.rules).filter((n) => n !== "custom").map((n) => this.rules[n]);
return [e].flat().map((n) => {
var o;
return (o = t.map((i) => i.resolve(n)).find((i) => i.matched)) != null ? o : this.rules.custom.resolve(n);
});
}
},
_toVariables(e, t) {
return $y(e, { prefix: t == null ? void 0 : t.prefix });
},
getCommon({ name: e = "", theme: t = {}, params: n, set: o, defaults: i }) {
var r, a, s, u, l, d, c;
const { preset: h, options: p } = t;
let w, v, g, b, m, k, _;
if (ae(h) && p.transform !== "strict") {
const { primitive: x, semantic: $, extend: O } = h, D = $ || {}, { colorScheme: E } = D, U = Jt(D, ["colorScheme"]), q = O || {}, { colorScheme: j } = q, T = Jt(q, ["colorScheme"]), H = E || {}, { dark: Y } = H, P = Jt(H, ["dark"]), S = j || {}, { dark: R } = S, A = Jt(S, ["dark"]), F = ae(x) ? this._toVariables({ primitive: x }, p) : {}, V = ae(U) ? this._toVariables({ semantic: U }, p) : {}, z = ae(P) ? this._toVariables({ light: P }, p) : {}, X = ae(Y) ? this._toVariables({ dark: Y }, p) : {}, L = ae(T) ? this._toVariables({ semantic: T }, p) : {}, N = ae(A) ? this._toVariables({ light: A }, p) : {}, J = ae(R) ? this._toVariables({ dark: R }, p) : {}, [te, ke] = [(r = F.declarations) != null ? r : "", F.tokens], [He, xt] = [(a = V.declarations) != null ? a : "", V.tokens || []], [Lt, En] = [(s = z.declarations) != null ? s : "", z.tokens || []], [Vo, Ka] = [(u = X.declarations) != null ? u : "", X.tokens || []], [Ga, Wa] = [(l = L.declarations) != null ? l : "", L.tokens || []], [qa, Xa] = [(d = N.declarations) != null ? d : "", N.tokens || []], [Ya, Za] = [(c = J.declarations) != null ? c : "", J.tokens || []];
w = this.transformCSS(e, te, "light", "variable", p, o, i), v = ke;
const Qa = this.transformCSS(e, `${He}${Lt}`, "light", "variable", p, o, i), Ja = this.transformCSS(e, `${Vo}`, "dark", "variable", p, o, i);
g = `${Qa}${Ja}`, b = [.../* @__PURE__ */ new Set([...xt, ...En, ...Ka])];
const es = this.transformCSS(e, `${Ga}${qa}color-scheme:light`, "light", "variable", p, o, i), ts = this.transformCSS(e, `${Ya}color-scheme:dark`, "dark", "variable", p, o, i);
m = `${es}${ts}`, k = [.../* @__PURE__ */ new Set([...Wa, ...Xa, ...Za])], _ = lt(h.css, { dt: Jn });
}
return {
primitive: {
css: w,
tokens: v
},
semantic: {
css: g,
tokens: b
},
global: {
css: m,
tokens: k
},
style: _
};
},
getPreset({ name: e = "", preset: t = {}, options: n, params: o, set: i, defaults: r, selector: a }) {
var s, u, l;
let d, c, h;
if (ae(t) && n.transform !== "strict") {
const p = e.replace("-directive", ""), w = t, { colorScheme: v, extend: g, css: b } = w, m = Jt(w, ["colorScheme", "extend", "css"]), k = g || {}, { colorScheme: _ } = k, x = Jt(k, ["colorScheme"]), $ = v || {}, { dark: O } = $, D = Jt($, ["dark"]), E = _ || {}, { dark: U } = E, q = Jt(E, ["dark"]), j = ae(m) ? this._toVariables({ [p]: Rt(Rt({}, m), x) }, n) : {}, T = ae(D) ? this._toVariables({ [p]: Rt(Rt({}, D), q) }, n) : {}, H = ae(O) ? this._toVariables({ [p]: Rt(Rt({}, O), U) }, n) : {}, [Y, P] = [(s = j.declarations) != null ? s : "", j.tokens || []], [S, R] = [(u = T.declarations) != null ? u : "", T.tokens || []], [A, F] = [(l = H.declarations) != null ? l : "", H.tokens || []], V = this.transformCSS(p, `${Y}${S}`, "light", "variable", n, i, r, a), z = this.transformCSS(p, A, "dark", "variable", n, i, r, a);
d = `${V}${z}`, c = [.../* @__PURE__ */ new Set([...P, ...R, ...F])], h = lt(b, { dt: Jn });
}
return {
css: d,
tokens: c,
style: h
};
},
getPresetC({ name: e = "", theme: t = {}, params: n, set: o, defaults: i }) {
var r;
const { preset: a, options: s } = t, u = (r = a == null ? void 0 : a.components) == null ? void 0 : r[e];
return this.getPreset({ name: e, preset: u, options: s, params: n, set: o, defaults: i });
},
// @deprecated - use getPresetC instead
getPresetD({ name: e = "", theme: t = {}, params: n, set: o, defaults: i }) {
var r, a;
const s = e.replace("-directive", ""), { preset: u, options: l } = t, d = ((r = u == null ? void 0 : u.components) == null ? void 0 : r[s]) || ((a = u == null ? void 0 : u.directives) == null ? void 0 : a[s]);
return this.getPreset({ name: s, preset: d, options: l, params: n, set: o, defaults: i });
},
applyDarkColorScheme(e) {
return !(e.darkModeSelector === "none" || e.darkModeSelector === !1);
},
getColorSchemeOption(e, t) {
var n;
return this.applyDarkColorScheme(e) ? this.regex.resolve(e.darkModeSelector === !0 ? t.options.darkModeSelector : (n = e.darkModeSelector) != null ? n : t.options.darkModeSelector) : [];
},
getLayerOrder(e, t = {}, n, o) {
const { cssLayer: i } = t;
return i ? `@layer ${lt(i.order || "primeui", n)}` : "";
},
getCommonStyleSheet({ name: e = "", theme: t = {}, params: n, props: o = {}, set: i, defaults: r }) {
const a = this.getCommon({ name: e, theme: t, params: n, set: i, defaults: r }), s = Object.entries(o).reduce((u, [l, d]) => u.push(`${l}="${d}"`) && u, []).join(" ");
return Object.entries(a || {}).reduce((u, [l, d]) => {
if (no(d) && Object.hasOwn(d, "css")) {
const c = Cr(d.css), h = `${l}-variables`;
u.push(`<style type="text/css" data-primevue-style-id="${h}" ${s}>${c}</style>`);
}
return u;
}, []).join("");
},
getStyleSheet({ name: e = "", theme: t = {}, params: n, props: o = {}, set: i, defaults: r }) {
var a;
const s = { name: e, theme: t, params: n, set: i, defaults: r }, u = (a = e.includes("-directive") ? this.getPresetD(s) : this.getPresetC(s)) == null ? void 0 : a.css, l = Object.entries(o).reduce((d, [c, h]) => d.push(`${c}="${h}"`) && d, []).join(" ");
return u ? `<style type="text/css" data-primevue-style-id="${e}-variables" ${l}>${Cr(u)}</style>` : "";
},
createTokens(e = {}, t, n = "", o = "", i = {}) {
return {};
},
getTokenValue(e, t, n) {
var o;
const i = ((s) => s.split(".").filter((u) => !_o(u.toLowerCase(), n.variable.excludedKeyRegex)).join("."))(t), r = t.includes("colorScheme.light") ? "light" : t.includes("colorScheme.dark") ? "dark" : void 0, a = [(o = e[i]) == null ? void 0 : o.computed(r)].flat().filter((s) => s);
return a.length === 1 ? a[0].value : a.reduce((s = {}, u) => {
const l = u, { colorScheme: d } = l, c = Jt(l, ["colorScheme"]);
return s[d] = c, s;
}, void 0);
},
getSelectorRule(e, t, n, o) {
return n === "class" || n === "attr" ? bo(ae(t) ? `${e}${t},${e} ${t}` : e, o) : bo(e, ae(t) ? bo(t, o) : o);
},
transformCSS(e, t, n, o, i = {}, r, a, s) {
if (ae(t)) {
const { cssLayer: u } = i;
if (o !== "style") {
const l = this.getColorSchemeOption(i, a);
t = n === "dark" ? l.reduce((d, { type: c, selector: h }) => (ae(h) && (d += h.includes("[CSS]") ? h.replace("[CSS]", t) : this.getSelectorRule(h, s, c, t)), d), "") : bo(s ?? ":root", t);
}
if (u) {
const l = {
name: "primeui"
};
no(u) && (l.name = lt(u.name, { name: e, type: o })), ae(l.name) && (t = bo(`@layer ${l.name}`, t), r == null || r.layerNames(l.name));
}
return t;
}
return "";
}
}, Pe = {
defaults: {
variable: {
prefix: "p",
selector: ":root",
excludedKeyRegex: /^(primitive|semantic|components|directives|variables|colorscheme|light|dark|common|root|states|extend|css)$/gi
},
options: {
prefix: "p",
darkModeSelector: "system",
cssLayer: !1
}
},
_theme: void 0,
_layerNames: /* @__PURE__ */ new Set(),
_loadedStyleNames: /* @__PURE__ */ new Set(),
_loadingStyles: /* @__PURE__ */ new Set(),
_tokens: {},
update(e = {}) {
const { theme: t } = e;
t && (this._theme = is(Rt({}, t), {
options: Rt(Rt({}, this.defaults.options), t.options)
}), this._tokens = kt.createTokens(this.preset, this.defaults), this.clearLoadedStyleNames());
},
get theme() {
return this._theme;
},
get preset() {
var e;
return ((e = this.theme) == null ? void 0 : e.preset) || {};
},
get options() {
var e;
return ((e = this.theme) == null ? void 0 : e.options) || {};
},
get tokens() {
return this._tokens;
},
getTheme() {
return this.theme;
},
setTheme(e) {
this.update({ theme: e }), nt.emit("theme:change", e);
},
getPreset() {
return this.preset;
},
setPreset(e) {
this._theme = is(Rt({}, this.theme), { preset: e }), this._tokens = kt.createTokens(e, this.defaults), this.clearLoadedStyleNames(), nt.emit("preset:change", e), nt.emit("theme:change", this.theme);
},
getOptions() {
return this.options;
},
setOptions(e) {
this._theme = is(Rt({}, this.theme), { options: e }), this.clearLoadedStyleNames(), nt.emit("options:change", e), nt.emit("theme:change", this.theme);
},
getLayerNames() {
return [...this._layerNames];
},
setLayerNames(e) {
this._layerNames.add(e);
},
getLoadedStyleNames() {
return this._loadedStyleNames;
},
isStyleNameLoaded(e) {
return this._loadedStyleNames.has(e);
},
setLoadedStyleName(e) {
this._loadedStyleNames.add(e);
},
deleteLoadedStyleName(e) {
this._loadedStyleNames.delete(e);
},
clearLoadedStyleNames() {
this._loadedStyleNames.clear();
},
getTokenValue(e) {
return kt.getTokenValue(this.tokens, e, this.defaults);
},
getCommon(e = "", t) {
return kt.getCommon({ name: e, theme: this.theme, params: t, defaults: this.defaults, set: { layerNames: this.setLayerNames.bind(this) } });
},
getComponent(e = "", t) {
const n = { name: e, theme: this.theme, params: t, defaults: this.defaults, set: { layerNames: this.setLayerNames.bind(this) } };
return kt.getPresetC(n);
},
// @deprecated - use getComponent instead
getDirective(e = "", t) {
const n = { name: e, theme: this.theme, params: t, defaults: this.defaults, set: { layerNames: this.setLayerNames.bind(this) } };
return kt.getPresetD(n);
},
getCustomPreset(e = "", t, n, o) {
const i = { name: e, preset: t, options: this.options, selector: n, params: o, defaults: this.defaults, set: { layerNames: this.setLayerNames.bind(this) } };
return kt.getPreset(i);
},
getLayerOrderCSS(e = "") {
return kt.getLayerOrder(e, this.options, { names: this.getLayerNames() }, this.defaults);
},
transformCSS(e = "", t, n = "style", o) {
return kt.transformCSS(e, t, o, n, this.options, { layerNames: this.setLayerNames.bind(this) }, this.defaults);
},
getCommonStyleSheet(e = "", t, n = {}) {
return kt.getCommonStyleSheet({ name: e, theme: this.theme, params: t, props: n, defaults: this.defaults, set: { layerNames: this.setLayerNames.bind(this) } });
},
getStyleSheet(e, t, n = {}) {
return kt.getStyleSheet({ name: e, theme: this.theme, params: t, props: n, defaults: this.defaults, set: { layerNames: this.setLayerNames.bind(this) } });
},
onStyleMounted(e) {
this._loadingStyle