devkit-base-components
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,367 lines (1,346 loc) • 288 kB
JavaScript
var Co = Object.defineProperty;
var So = (t, e, n) => e in t ? Co(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
var we = (t, e, n) => So(t, typeof e != "symbol" ? e + "" : e, n);
import Po from "dexie";
import { useI18n as dn } from "vue-i18n";
import { ref as Se, readonly as $o, getCurrentInstance as xo, onMounted as Lo, nextTick as Oo, watch as _o, mergeProps as f, openBlock as p, createElementBlock as g, createElementVNode as x, renderSlot as $, createBlock as O, Teleport as Ao, createCommentVNode as w, createTextVNode as ht, toDisplayString as G, resolveDynamicComponent as j, normalizeClass as F, resolveComponent as D, Fragment as J, renderList as mn, createVNode as K, resolveDirective as Be, withDirectives as se, withCtx as Q, Transition as en, vShow as xn, normalizeProps as Ce, guardReactiveProps as Ae, normalizeStyle as gt, defineComponent as ue, inject as Fe, useSlots as fn, computed as vt, h as B, useAttrs as yt, unref as Ke, withModifiers as To } from "vue";
import { RouterLink as jn, useRouter as Eo, useRoute as Bo } from "vue-router";
import { resolveApiEndpoint as Do } from "devkit-apiclient";
class jo {
constructor(e) {
we(this, "table");
this.table = e;
}
async getValue(e) {
const n = await this.table.get(e);
return n == null ? void 0 : n.value;
}
async setValue(e, n) {
await this.table.put({ key: e, value: n });
}
async setLocale(e) {
await this.setValue("locale", e);
}
async getLocale() {
return await this.getValue("locale") ?? "en";
}
async setIsDark(e) {
await this.setValue("isDark", e);
}
}
class Ko {
constructor(e) {
we(this, "table");
this.table = e;
}
async iconFind(e) {
const n = await this.table.get(e);
return n == null ? void 0 : n.value;
}
async iconCreate(e, n) {
console.log("put the icon"), await this.table.put({ key: e, value: n });
}
}
class Mo extends Po {
constructor() {
super("DEVKIT_BASE");
we(this, "cache");
we(this, "iconHelper");
we(this, "cacheHelper");
we(this, "icon");
this.version(1).stores({
cacheHelper: "key",
icon: "key"
}), this.iconHelper = new Ko(this.icon), this.cache = new jo(this.cacheHelper);
}
}
const zo = (t) => t == "en" ? { dir: "rtl", language: "ar" } : { dir: "ltr", language: "en" }, It = async ({ i18n: t, cacheHelper: e }) => {
const { dir: n, language: o } = zo(t.locale.value);
console.log("toggle", n, o), document.documentElement.setAttribute("dir", n), t.locale.value = o, await e.setLocale(o);
};
function Vo(t, e) {
return t ? t.classList ? t.classList.contains(e) : new RegExp("(^| )" + e + "( |$)", "gi").test(t.className) : !1;
}
function pn(t, e) {
if (t && e) {
const n = (o) => {
Vo(t, o) || (t.classList ? t.classList.add(o) : t.className += " " + o);
};
[e].flat().filter(Boolean).forEach((o) => o.split(" ").forEach(n));
}
}
function Fo() {
return window.innerWidth - document.documentElement.offsetWidth;
}
function kt(t) {
for (const e of document == null ? void 0 : document.styleSheets)
try {
for (const n of e == null ? void 0 : e.cssRules)
for (const o of n == null ? void 0 : n.style)
if (t.test(o))
return { name: o, value: n.style.getPropertyValue(o).trim() };
} catch {
}
return null;
}
function wt(t = "p-overflow-hidden") {
const e = kt(/-scrollbar-width$/);
e != null && e.name && document.body.style.setProperty(e.name, Fo() + "px"), pn(document.body, t);
}
function rn(t, e) {
if (t && e) {
const n = (o) => {
t.classList ? t.classList.remove(o) : t.className = t.className.replace(new RegExp("(^|\\b)" + o.split(" ").join("|") + "(\\b|$)", "gi"), " ");
};
[e].flat().filter(Boolean).forEach((o) => o.split(" ").forEach(n));
}
}
function kn(t = "p-overflow-hidden") {
const e = kt(/-scrollbar-width$/);
e != null && e.name && document.body.style.removeProperty(e.name), rn(document.body, t);
}
function Ro(t, e) {
return t instanceof HTMLElement ? t.offsetWidth : 0;
}
function Pe(t) {
return typeof HTMLElement == "object" ? t instanceof HTMLElement : t && typeof t == "object" && t !== null && t.nodeType === 1 && typeof t.nodeName == "string";
}
function an(t, e = {}) {
if (Pe(t)) {
const n = (o, a) => {
var r, u;
const s = (r = t == null ? void 0 : t.$attrs) != null && r[o] ? [(u = t == null ? void 0 : t.$attrs) == null ? void 0 : u[o]] : [];
return [a].flat().reduce((i, c) => {
if (c != null) {
const l = typeof c;
if (l === "string" || l === "number")
i.push(c);
else if (l === "object") {
const m = Array.isArray(c) ? n(o, c) : Object.entries(c).map(([d, b]) => o === "style" && (b || b === 0) ? `${d.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase()}:${b}` : b ? d : void 0);
i = m.length ? i.concat(m.filter((d) => !!d)) : i;
}
}
return i;
}, s);
};
Object.entries(e).forEach(([o, a]) => {
if (a != null) {
const r = o.match(/^on(.+)/);
r ? t.addEventListener(r[1].toLowerCase(), a) : o === "p-bind" || o === "pBind" ? an(t, a) : (a = o === "class" ? [...new Set(n("class", a))].join(" ").trim() : o === "style" ? n("style", a).join(";").trim() : a, (t.$attrs = t.$attrs || {}) && (t.$attrs[o] = a), t.setAttribute(o, a));
}
});
}
}
function Ct(t, e = {}, ...n) {
{
const o = document.createElement(t);
return an(o, e), o.append(...n), o;
}
}
function No(t, e) {
return Pe(t) ? Array.from(t.querySelectorAll(e)) : [];
}
function R(t, e) {
return Pe(t) ? t.matches(e) ? t : t.querySelector(e) : null;
}
function z(t, e) {
t && document.activeElement !== t && t.focus(e);
}
function Ee(t, e) {
if (Pe(t)) {
const n = t.getAttribute(e);
return isNaN(n) ? n === "true" || n === "false" ? n === "true" : n : +n;
}
}
function St(t, e = "") {
let n = No(
t,
`button:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${e},
[href][clientHeight][clientWidth]:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${e},
input:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${e},
select:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${e},
textarea:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${e},
[tabIndex]:not([tabIndex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${e},
[contenteditable]:not([tabIndex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${e}`
), o = [];
for (let a of n)
getComputedStyle(a).display != "none" && getComputedStyle(a).visibility != "hidden" && o.push(a);
return o;
}
function De(t, e) {
const n = St(t, e);
return n.length > 0 ? n[0] : null;
}
function Kn(t) {
if (t) {
let e = t.offsetHeight, n = getComputedStyle(t);
return e -= parseFloat(n.paddingTop) + parseFloat(n.paddingBottom) + parseFloat(n.borderTopWidth) + parseFloat(n.borderBottomWidth), e;
}
return 0;
}
function Ho(t) {
if (t) {
let e = t.parentNode;
return e && e instanceof ShadowRoot && e.host && (e = e.host), e;
}
return null;
}
function Uo(t, e) {
const n = St(t, e);
return n.length > 0 ? n[n.length - 1] : null;
}
function Zo(t) {
if (t) {
let e = t.getBoundingClientRect();
return {
top: e.top + (window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0),
left: e.left + (window.pageXOffset || document.documentElement.scrollLeft || document.body.scrollLeft || 0)
};
}
return {
top: "auto",
left: "auto"
};
}
function Go(t, e) {
return t ? t.offsetHeight : 0;
}
function Wo(t) {
return !!(t !== null && typeof t < "u" && t.nodeName && Ho(t));
}
function Mn(t) {
if (t) {
let e = t.offsetWidth, n = getComputedStyle(t);
return e -= parseFloat(n.paddingLeft) + parseFloat(n.paddingRight) + parseFloat(n.borderLeftWidth) + parseFloat(n.borderRightWidth), e;
}
return 0;
}
function qo(t, e, n) {
return Pe(t) ? Ee(t, e) === n : !1;
}
function Ln() {
return !!(typeof window < "u" && window.document && window.document.createElement);
}
function zn(t, e = "") {
return Pe(t) ? t.matches(`button:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${e},
[href][clientHeight][clientWidth]:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${e},
input:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${e},
select:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${e},
textarea:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${e},
[tabIndex]:not([tabIndex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${e},
[contenteditable]:not([tabIndex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${e}`) : !1;
}
function Yo() {
return "ontouchstart" in window || navigator.maxTouchPoints > 0 || navigator.msMaxTouchPoints > 0;
}
function Xo(t, e = "", n) {
Pe(t) && n !== null && n !== void 0 && t.setAttribute(e, n);
}
function Re(t) {
"@babel/helpers - typeof";
return Re = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
return typeof e;
} : function(e) {
return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
}, Re(t);
}
function Vn(t, e) {
var n = Object.keys(t);
if (Object.getOwnPropertySymbols) {
var o = Object.getOwnPropertySymbols(t);
e && (o = o.filter(function(a) {
return Object.getOwnPropertyDescriptor(t, a).enumerable;
})), n.push.apply(n, o);
}
return n;
}
function Fn(t) {
for (var e = 1; e < arguments.length; e++) {
var n = arguments[e] != null ? arguments[e] : {};
e % 2 ? Vn(Object(n), !0).forEach(function(o) {
Jo(t, o, n[o]);
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) : Vn(Object(n)).forEach(function(o) {
Object.defineProperty(t, o, Object.getOwnPropertyDescriptor(n, o));
});
}
return t;
}
function Jo(t, e, n) {
return (e = Qo(e)) in t ? Object.defineProperty(t, e, { value: n, enumerable: !0, configurable: !0, writable: !0 }) : t[e] = n, t;
}
function Qo(t) {
var e = er(t, "string");
return Re(e) == "symbol" ? e : e + "";
}
function er(t, e) {
if (Re(t) != "object" || !t) return t;
var n = t[Symbol.toPrimitive];
if (n !== void 0) {
var o = n.call(t, e || "default");
if (Re(o) != "object") return o;
throw new TypeError("@@toPrimitive must return a primitive value.");
}
return (e === "string" ? String : Number)(t);
}
function nr(t) {
var e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !0;
xo() ? Lo(t) : e ? t() : Oo(t);
}
var tr = 0;
function or(t) {
var e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, n = Se(!1), o = Se(t), a = Se(null), r = Ln() ? window.document : void 0, u = e.document, s = u === void 0 ? r : u, i = e.immediate, c = i === void 0 ? !0 : i, l = e.manual, m = l === void 0 ? !1 : l, d = e.name, b = d === void 0 ? "style_".concat(++tr) : d, h = e.id, y = h === void 0 ? void 0 : h, C = e.media, A = C === void 0 ? void 0 : C, S = e.nonce, v = S === void 0 ? void 0 : S, k = e.first, M = k === void 0 ? !1 : k, U = e.onMounted, ce = U === void 0 ? void 0 : U, le = e.onUpdated, de = le === void 0 ? void 0 : le, he = e.onLoad, me = he === void 0 ? void 0 : he, ge = e.props, ve = ge === void 0 ? {} : ge, fe = function() {
}, ye = function(xe) {
var Le = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
if (s) {
var te = Fn(Fn({}, ve), Le), ee = te.name || b, ke = te.id || y, nn = te.nonce || v;
a.value = s.querySelector('style[data-primevue-style-id="'.concat(ee, '"]')) || s.getElementById(ke) || s.createElement("style"), a.value.isConnected || (o.value = xe || t, an(a.value, {
type: "text/css",
id: ke,
media: A,
nonce: nn
}), M ? s.head.prepend(a.value) : s.head.appendChild(a.value), Xo(a.value, "data-primevue-style-id", ee), an(a.value, te), a.value.onload = function(Oe) {
return me == null ? void 0 : me(Oe, {
name: ee
});
}, ce == null || ce(ee)), !n.value && (fe = _o(o, function(Oe) {
a.value.textContent = Oe, de == null || de(ee);
}, {
immediate: !0
}), n.value = !0);
}
}, $e = function() {
!s || !n.value || (fe(), Wo(a.value) && s.head.removeChild(a.value), n.value = !1);
};
return c && !m && nr(ye), {
id: y,
name: b,
el: a,
css: o,
unload: $e,
load: ye,
isLoaded: $o(n)
};
}
function Pt() {
const t = /* @__PURE__ */ new Map();
return {
on(e, n) {
let o = t.get(e);
return o ? o.push(n) : o = [n], t.set(e, o), this;
},
off(e, n) {
let o = t.get(e);
return o && o.splice(o.indexOf(n) >>> 0, 1), this;
},
emit(e, n) {
let o = t.get(e);
o && o.slice().map((a) => {
a(n);
});
},
clear() {
t.clear();
}
};
}
function N(t) {
return t == null || t === "" || Array.isArray(t) && t.length === 0 || !(t instanceof Date) && typeof t == "object" && Object.keys(t).length === 0;
}
function wn(t, e, n = /* @__PURE__ */ new WeakSet()) {
if (t === e) return !0;
if (!t || !e || typeof t != "object" || typeof e != "object" || n.has(t) || n.has(e)) return !1;
n.add(t).add(e);
let o = Array.isArray(t), a = Array.isArray(e), r, u, s;
if (o && a) {
if (u = t.length, u != e.length) return !1;
for (r = u; r-- !== 0; ) if (!wn(t[r], e[r], n)) return !1;
return !0;
}
if (o != a) return !1;
let i = t instanceof Date, c = e instanceof Date;
if (i != c) return !1;
if (i && c) return t.getTime() == e.getTime();
let l = t instanceof RegExp, m = e instanceof RegExp;
if (l != m) return !1;
if (l && m) return t.toString() == e.toString();
let d = Object.keys(t);
if (u = d.length, u !== Object.keys(e).length) return !1;
for (r = u; r-- !== 0; ) if (!Object.prototype.hasOwnProperty.call(e, d[r])) return !1;
for (r = u; r-- !== 0; )
if (s = d[r], !wn(t[s], e[s], n)) return !1;
return !0;
}
function rr(t, e) {
return wn(t, e);
}
function On(t) {
return !!(t && t.constructor && t.call && t.apply);
}
function I(t) {
return !N(t);
}
function _e(t, e, n) {
return rr(t, e);
}
function Rn(t, e) {
let n;
if (I(t))
try {
n = t.findLast(e);
} catch {
n = [...t].reverse().find(e);
}
return n;
}
function Nn(t, e) {
let n = -1;
if (I(t))
try {
n = t.findLastIndex(e);
} catch {
n = t.lastIndexOf([...t].reverse().find(e));
}
return n;
}
function be(t, e = !0) {
return t instanceof Object && t.constructor === Object && (e || Object.keys(t).length !== 0);
}
function V(t, ...e) {
return On(t) ? t(...e) : t;
}
function H(t, e = !0) {
return typeof t == "string" && (e || t !== "");
}
function Y(t) {
return H(t) ? t.replace(/(-|_)/g, "").toLowerCase() : t;
}
function _n(t, e = "", n = {}) {
const o = Y(e).split("."), a = o.shift();
return a ? be(t) ? _n(V(t[Object.keys(t).find((r) => Y(r) === a) || ""], n), o.join("."), n) : void 0 : V(t, n);
}
function bn(t, e = !0) {
return Array.isArray(t) && (e || t.length !== 0);
}
function ar(t) {
return I(t) && !isNaN(t);
}
function $t(t = "") {
return I(t) && t.length === 1 && !!t.match(/\S| /);
}
function ae(t, e) {
if (e) {
const n = e.test(t);
return e.lastIndex = 0, n;
}
return !1;
}
function ze(t) {
return t && t.replace(/\/\*(?:(?!\*\/)[\s\S])*\*\/|[\r\n\t]+/g, "").replace(/ {2,}/g, " ").replace(/ ([{:}]) /g, "$1").replace(/([;,]) /g, "$1").replace(/ !/g, "!").replace(/: /g, ":");
}
function ir(t) {
return H(t, !1) ? t[0].toUpperCase() + t.slice(1) : t;
}
function xt(t) {
return H(t) ? t.replace(/(_)/g, "-").replace(/[A-Z]/g, (e, n) => n === 0 ? e : "-" + e.toLowerCase()).toLowerCase() : t;
}
function Hn(t) {
return H(t) ? t.replace(/[A-Z]/g, (e, n) => n === 0 ? e : "." + e.toLowerCase()).toLowerCase() : t;
}
var tn = {};
function An(t = "pui_id_") {
return tn.hasOwnProperty(t) || (tn[t] = 0), tn[t]++, `${t}${tn[t]}`;
}
function sr() {
let t = [];
const e = (u, s, i = 999) => {
const c = a(u, s, i), l = c.value + (c.key === u ? 0 : i) + 1;
return t.push({ key: u, value: l }), l;
}, n = (u) => {
t = t.filter((s) => s.value !== u);
}, o = (u, s) => a(u).value, a = (u, s, i = 0) => [...t].reverse().find((c) => !0) || { key: u, value: i }, r = (u) => u && parseInt(u.style.zIndex, 10) || 0;
return {
get: r,
set: (u, s, i) => {
s && (s.style.zIndex = String(e(u, !0, i)));
},
clear: (u) => {
u && (n(r(u)), u.style.zIndex = "");
},
getCurrent: (u) => o(u)
};
}
var ie = sr();
function sn() {
var t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "pv_id_";
return An(t);
}
var ur = Object.defineProperty, cr = Object.defineProperties, lr = Object.getOwnPropertyDescriptors, un = Object.getOwnPropertySymbols, Lt = Object.prototype.hasOwnProperty, Ot = Object.prototype.propertyIsEnumerable, Un = (t, e, n) => e in t ? ur(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n, X = (t, e) => {
for (var n in e || (e = {}))
Lt.call(e, n) && Un(t, n, e[n]);
if (un)
for (var n of un(e))
Ot.call(e, n) && Un(t, n, e[n]);
return t;
}, yn = (t, e) => cr(t, lr(e)), oe = (t, e) => {
var n = {};
for (var o in t)
Lt.call(t, o) && e.indexOf(o) < 0 && (n[o] = t[o]);
if (t != null && un)
for (var o of un(t))
e.indexOf(o) < 0 && Ot.call(t, o) && (n[o] = t[o]);
return n;
}, dr = Pt(), re = dr;
function Zn(t, e) {
bn(t) ? t.push(...e || []) : be(t) && Object.assign(t, e);
}
function mr(t) {
return be(t) && t.hasOwnProperty("value") && t.hasOwnProperty("type") ? t.value : t;
}
function fr(t) {
return t.replaceAll(/ /g, "").replace(/[^\w]/g, "-");
}
function Cn(t = "", e = "") {
return fr(`${H(t, !1) && H(e, !1) ? `${t}-` : t}${e}`);
}
function _t(t = "", e = "") {
return `--${Cn(t, e)}`;
}
function pr(t = "") {
const e = (t.match(/{/g) || []).length, n = (t.match(/}/g) || []).length;
return (e + n) % 2 !== 0;
}
function At(t, e = "", n = "", o = [], a) {
if (H(t)) {
const r = /{([^}]*)}/g, u = t.trim();
if (pr(u))
return;
if (ae(u, r)) {
const s = u.replaceAll(r, (l) => {
const d = l.replace(/{|}/g, "").split(".").filter((b) => !o.some((h) => ae(b, h)));
return `var(${_t(n, xt(d.join("-")))}${I(a) ? `, ${a}` : ""})`;
}), i = /(\d+\s+[\+\-\*\/]\s+\d+)/g, c = /var\([^)]+\)/g;
return ae(s.replace(c, "0"), i) ? `calc(${s})` : s;
}
return u;
} else if (ar(t))
return t;
}
function br(t, e, n) {
H(e, !1) && t.push(`${e}:${n};`);
}
function Te(t, e) {
return t ? `${t}{${e}}` : "";
}
var Ve = (...t) => hr(T.getTheme(), ...t), hr = (t = {}, e, n, o) => {
if (e) {
const { variable: a, options: r } = T.defaults || {}, { prefix: u, transform: s } = (t == null ? void 0 : t.options) || r || {}, c = ae(e, /{([^}]*)}/g) ? e : `{${e}}`;
return o === "value" || N(o) && s === "strict" ? T.getTokenValue(e) : At(c, void 0, u, [a.excludedKeyRegex], n);
}
return "";
};
function gr(t, e = {}) {
const n = T.defaults.variable, { prefix: o = n.prefix, selector: a = n.selector, excludedKeyRegex: r = n.excludedKeyRegex } = e, u = (c, l = "") => Object.entries(c).reduce(
(m, [d, b]) => {
const h = ae(d, r) ? Cn(l) : Cn(l, xt(d)), y = mr(b);
if (be(y)) {
const { variables: C, tokens: A } = u(y, h);
Zn(m.tokens, A), Zn(m.variables, C);
} else
m.tokens.push((o ? h.replace(`${o}-`, "") : h).replaceAll("-", ".")), br(m.variables, _t(h), At(y, h, o, [r]));
return m;
},
{ variables: [], tokens: [] }
), { variables: s, tokens: i } = u(t, o);
return {
value: s,
tokens: i,
declarations: s.join(""),
css: Te(a, s.join(""))
};
}
var q = {
regex: {
rules: {
class: {
pattern: /^\.([a-zA-Z][\w-]*)$/,
resolve(t) {
return { type: "class", selector: t, matched: this.pattern.test(t.trim()) };
}
},
attr: {
pattern: /^\[(.*)\]$/,
resolve(t) {
return { type: "attr", selector: `:root${t}`, matched: this.pattern.test(t.trim()) };
}
},
media: {
pattern: /^@media (.*)$/,
resolve(t) {
return { type: "media", selector: `${t}{:root{[CSS]}}`, matched: this.pattern.test(t.trim()) };
}
},
system: {
pattern: /^system$/,
resolve(t) {
return { type: "system", selector: "@media (prefers-color-scheme: dark){:root{[CSS]}}", matched: this.pattern.test(t.trim()) };
}
},
custom: {
resolve(t) {
return { type: "custom", selector: t, matched: !0 };
}
}
},
resolve(t) {
const e = Object.keys(this.rules).filter((n) => n !== "custom").map((n) => this.rules[n]);
return [t].flat().map((n) => {
var o;
return (o = e.map((a) => a.resolve(n)).find((a) => a.matched)) != null ? o : this.rules.custom.resolve(n);
});
}
},
_toVariables(t, e) {
return gr(t, { prefix: e == null ? void 0 : e.prefix });
},
getCommon({ name: t = "", theme: e = {}, params: n, set: o, defaults: a }) {
var r, u, s, i, c, l, m;
const { preset: d, options: b } = e;
let h, y, C, A, S, v, k;
if (I(d) && b.transform !== "strict") {
const { primitive: M, semantic: U, extend: ce } = d, le = U || {}, { colorScheme: de } = le, he = oe(le, ["colorScheme"]), me = ce || {}, { colorScheme: ge } = me, ve = oe(me, ["colorScheme"]), fe = de || {}, { dark: ye } = fe, $e = oe(fe, ["dark"]), Ie = ge || {}, { dark: xe } = Ie, Le = oe(Ie, ["dark"]), te = I(M) ? this._toVariables({ primitive: M }, b) : {}, ee = I(he) ? this._toVariables({ semantic: he }, b) : {}, ke = I($e) ? this._toVariables({ light: $e }, b) : {}, nn = I(ye) ? this._toVariables({ dark: ye }, b) : {}, Oe = I(ve) ? this._toVariables({ semantic: ve }, b) : {}, Bn = I(Le) ? this._toVariables({ light: Le }, b) : {}, Dn = I(xe) ? this._toVariables({ dark: xe }, b) : {}, [ro, ao] = [(r = te.declarations) != null ? r : "", te.tokens], [io, so] = [(u = ee.declarations) != null ? u : "", ee.tokens || []], [uo, co] = [(s = ke.declarations) != null ? s : "", ke.tokens || []], [lo, mo] = [(i = nn.declarations) != null ? i : "", nn.tokens || []], [fo, po] = [(c = Oe.declarations) != null ? c : "", Oe.tokens || []], [bo, ho] = [(l = Bn.declarations) != null ? l : "", Bn.tokens || []], [go, vo] = [(m = Dn.declarations) != null ? m : "", Dn.tokens || []];
h = this.transformCSS(t, ro, "light", "variable", b, o, a), y = ao;
const yo = this.transformCSS(t, `${io}${uo}`, "light", "variable", b, o, a), Io = this.transformCSS(t, `${lo}`, "dark", "variable", b, o, a);
C = `${yo}${Io}`, A = [.../* @__PURE__ */ new Set([...so, ...co, ...mo])];
const ko = this.transformCSS(t, `${fo}${bo}color-scheme:light`, "light", "variable", b, o, a), wo = this.transformCSS(t, `${go}color-scheme:dark`, "dark", "variable", b, o, a);
S = `${ko}${wo}`, v = [.../* @__PURE__ */ new Set([...po, ...ho, ...vo])], k = V(d.css, { dt: Ve });
}
return {
primitive: {
css: h,
tokens: y
},
semantic: {
css: C,
tokens: A
},
global: {
css: S,
tokens: v
},
style: k
};
},
getPreset({ name: t = "", preset: e = {}, options: n, params: o, set: a, defaults: r, selector: u }) {
var s, i, c;
let l, m, d;
if (I(e) && n.transform !== "strict") {
const b = t.replace("-directive", ""), h = e, { colorScheme: y, extend: C, css: A } = h, S = oe(h, ["colorScheme", "extend", "css"]), v = C || {}, { colorScheme: k } = v, M = oe(v, ["colorScheme"]), U = y || {}, { dark: ce } = U, le = oe(U, ["dark"]), de = k || {}, { dark: he } = de, me = oe(de, ["dark"]), ge = I(S) ? this._toVariables({ [b]: X(X({}, S), M) }, n) : {}, ve = I(le) ? this._toVariables({ [b]: X(X({}, le), me) }, n) : {}, fe = I(ce) ? this._toVariables({ [b]: X(X({}, ce), he) }, n) : {}, [ye, $e] = [(s = ge.declarations) != null ? s : "", ge.tokens || []], [Ie, xe] = [(i = ve.declarations) != null ? i : "", ve.tokens || []], [Le, te] = [(c = fe.declarations) != null ? c : "", fe.tokens || []], ee = this.transformCSS(b, `${ye}${Ie}`, "light", "variable", n, a, r, u), ke = this.transformCSS(b, Le, "dark", "variable", n, a, r, u);
l = `${ee}${ke}`, m = [.../* @__PURE__ */ new Set([...$e, ...xe, ...te])], d = V(A, { dt: Ve });
}
return {
css: l,
tokens: m,
style: d
};
},
getPresetC({ name: t = "", theme: e = {}, params: n, set: o, defaults: a }) {
var r;
const { preset: u, options: s } = e, i = (r = u == null ? void 0 : u.components) == null ? void 0 : r[t];
return this.getPreset({ name: t, preset: i, options: s, params: n, set: o, defaults: a });
},
getPresetD({ name: t = "", theme: e = {}, params: n, set: o, defaults: a }) {
var r;
const u = t.replace("-directive", ""), { preset: s, options: i } = e, c = (r = s == null ? void 0 : s.directives) == null ? void 0 : r[u];
return this.getPreset({ name: u, preset: c, options: i, params: n, set: o, defaults: a });
},
applyDarkColorScheme(t) {
return !(t.darkModeSelector === "none" || t.darkModeSelector === !1);
},
getColorSchemeOption(t, e) {
var n;
return this.applyDarkColorScheme(t) ? this.regex.resolve(t.darkModeSelector === !0 ? e.options.darkModeSelector : (n = t.darkModeSelector) != null ? n : e.options.darkModeSelector) : [];
},
getLayerOrder(t, e = {}, n, o) {
const { cssLayer: a } = e;
return a ? `@layer ${V(a.order || "primeui", n)}` : "";
},
getCommonStyleSheet({ name: t = "", theme: e = {}, params: n, props: o = {}, set: a, defaults: r }) {
const u = this.getCommon({ name: t, theme: e, params: n, set: a, defaults: r }), s = Object.entries(o).reduce((i, [c, l]) => i.push(`${c}="${l}"`) && i, []).join(" ");
return Object.entries(u || {}).reduce((i, [c, l]) => {
if (l != null && l.css) {
const m = ze(l == null ? void 0 : l.css), d = `${c}-variables`;
i.push(`<style type="text/css" data-primevue-style-id="${d}" ${s}>${m}</style>`);
}
return i;
}, []).join("");
},
getStyleSheet({ name: t = "", theme: e = {}, params: n, props: o = {}, set: a, defaults: r }) {
var u;
const s = { name: t, theme: e, params: n, set: a, defaults: r }, i = (u = t.includes("-directive") ? this.getPresetD(s) : this.getPresetC(s)) == null ? void 0 : u.css, c = Object.entries(o).reduce((l, [m, d]) => l.push(`${m}="${d}"`) && l, []).join(" ");
return i ? `<style type="text/css" data-primevue-style-id="${t}-variables" ${c}>${ze(i)}</style>` : "";
},
createTokens(t = {}, e, n = "", o = "", a = {}) {
return Object.entries(t).forEach(([r, u]) => {
const s = ae(r, e.variable.excludedKeyRegex) ? n : n ? `${n}.${Hn(r)}` : Hn(r), i = o ? `${o}.${r}` : r;
be(u) ? this.createTokens(u, e, s, i, a) : (a[s] || (a[s] = {
paths: [],
computed(c, l = {}) {
var m, d;
return this.paths.length === 1 ? (m = this.paths[0]) == null ? void 0 : m.computed(this.paths[0].scheme, l.binding) : c && c !== "none" ? (d = this.paths.find((b) => b.scheme === c)) == null ? void 0 : d.computed(c, l.binding) : this.paths.map((b) => b.computed(b.scheme, l[b.scheme]));
}
}), a[s].paths.push({
path: i,
value: u,
scheme: i.includes("colorScheme.light") ? "light" : i.includes("colorScheme.dark") ? "dark" : "none",
computed(c, l = {}) {
const m = /{([^}]*)}/g;
let d = u;
if (l.name = this.path, l.binding || (l.binding = {}), ae(u, m)) {
const h = u.trim().replaceAll(m, (A) => {
var S;
const v = A.replace(/{|}/g, ""), k = (S = a[v]) == null ? void 0 : S.computed(c, l);
return bn(k) && k.length === 2 ? `light-dark(${k[0].value},${k[1].value})` : k == null ? void 0 : k.value;
}), y = /(\d+\w*\s+[\+\-\*\/]\s+\d+\w*)/g, C = /var\([^)]+\)/g;
d = ae(h.replace(C, "0"), y) ? `calc(${h})` : h;
}
return N(l.binding) && delete l.binding, {
colorScheme: c,
path: this.path,
paths: l,
value: d.includes("undefined") ? void 0 : d
};
}
}));
}), a;
},
getTokenValue(t, e, n) {
var o;
const r = ((i) => i.split(".").filter((l) => !ae(l.toLowerCase(), n.variable.excludedKeyRegex)).join("."))(e), u = e.includes("colorScheme.light") ? "light" : e.includes("colorScheme.dark") ? "dark" : void 0, s = [(o = t[r]) == null ? void 0 : o.computed(u)].flat().filter((i) => i);
return s.length === 1 ? s[0].value : s.reduce((i = {}, c) => {
const l = c, { colorScheme: m } = l, d = oe(l, ["colorScheme"]);
return i[m] = d, i;
}, void 0);
},
getSelectorRule(t, e, n, o) {
return n === "class" || n === "attr" ? Te(I(e) ? `${t}${e},${t} ${e}` : t, o) : Te(t, I(e) ? Te(e, o) : o);
},
transformCSS(t, e, n, o, a = {}, r, u, s) {
if (I(e)) {
const { cssLayer: i } = a;
if (o !== "style") {
const c = this.getColorSchemeOption(a, u);
e = n === "dark" ? c.reduce((l, { type: m, selector: d }) => (I(d) && (l += d.includes("[CSS]") ? d.replace("[CSS]", e) : this.getSelectorRule(d, s, m, e)), l), "") : Te(s ?? ":root", e);
}
if (i) {
const c = {
name: "primeui",
order: "primeui"
};
be(i) && (c.name = V(i.name, { name: t, type: o })), I(c.name) && (e = Te(`@layer ${c.name}`, e), r == null || r.layerNames(c.name));
}
return e;
}
return "";
}
}, T = {
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(t = {}) {
const { theme: e } = t;
e && (this._theme = yn(X({}, e), {
options: X(X({}, this.defaults.options), e.options)
}), this._tokens = q.createTokens(this.preset, this.defaults), this.clearLoadedStyleNames());
},
get theme() {
return this._theme;
},
get preset() {
var t;
return ((t = this.theme) == null ? void 0 : t.preset) || {};
},
get options() {
var t;
return ((t = this.theme) == null ? void 0 : t.options) || {};
},
get tokens() {
return this._tokens;
},
getTheme() {
return this.theme;
},
setTheme(t) {
this.update({ theme: t }), re.emit("theme:change", t);
},
getPreset() {
return this.preset;
},
setPreset(t) {
this._theme = yn(X({}, this.theme), { preset: t }), this._tokens = q.createTokens(t, this.defaults), this.clearLoadedStyleNames(), re.emit("preset:change", t), re.emit("theme:change", this.theme);
},
getOptions() {
return this.options;
},
setOptions(t) {
this._theme = yn(X({}, this.theme), { options: t }), this.clearLoadedStyleNames(), re.emit("options:change", t), re.emit("theme:change", this.theme);
},
getLayerNames() {
return [...this._layerNames];
},
setLayerNames(t) {
this._layerNames.add(t);
},
getLoadedStyleNames() {
return this._loadedStyleNames;
},
isStyleNameLoaded(t) {
return this._loadedStyleNames.has(t);
},
setLoadedStyleName(t) {
this._loadedStyleNames.add(t);
},
deleteLoadedStyleName(t) {
this._loadedStyleNames.delete(t);
},
clearLoadedStyleNames() {
this._loadedStyleNames.clear();
},
getTokenValue(t) {
return q.getTokenValue(this.tokens, t, this.defaults);
},
getCommon(t = "", e) {
return q.getCommon({ name: t, theme: this.theme, params: e, defaults: this.defaults, set: { layerNames: this.setLayerNames.bind(this) } });
},
getComponent(t = "", e) {
const n = { name: t, theme: this.theme, params: e, defaults: this.defaults, set: { layerNames: this.setLayerNames.bind(this) } };
return q.getPresetC(n);
},
getDirective(t = "", e) {
const n = { name: t, theme: this.theme, params: e, defaults: this.defaults, set: { layerNames: this.setLayerNames.bind(this) } };
return q.getPresetD(n);
},
getCustomPreset(t = "", e, n, o) {
const a = { name: t, preset: e, options: this.options, selector: n, params: o, defaults: this.defaults, set: { layerNames: this.setLayerNames.bind(this) } };
return q.getPreset(a);
},
getLayerOrderCSS(t = "") {
return q.getLayerOrder(t, this.options, { names: this.getLayerNames() }, this.defaults);
},
transformCSS(t = "", e, n = "style", o) {
return q.transformCSS(t, e, o, n, this.options, { layerNames: this.setLayerNames.bind(this) }, this.defaults);
},
getCommonStyleSheet(t = "", e, n = {}) {
return q.getCommonStyleSheet({ name: t, theme: this.theme, params: e, props: n, defaults: this.defaults, set: { layerNames: this.setLayerNames.bind(this) } });
},
getStyleSheet(t, e, n = {}) {
return q.getStyleSheet({ name: t, theme: this.theme, params: e, props: n, defaults: this.defaults, set: { layerNames: this.setLayerNames.bind(this) } });
},
onStyleMounted(t) {
this._loadingStyles.add(t);
},
onStyleUpdated(t) {
this._loadingStyles.add(t);
},
onStyleLoaded(t, { name: e }) {
this._loadingStyles.size && (this._loadingStyles.delete(e), re.emit(`theme:${e}:load`, t), !this._loadingStyles.size && re.emit("theme:load"));
}
}, pe = {
_loadedStyleNames: /* @__PURE__ */ new Set(),
getLoadedStyleNames: function() {
return this._loadedStyleNames;
},
isStyleNameLoaded: function(e) {
return this._loadedStyleNames.has(e);
},
setLoadedStyleName: function(e) {
this._loadedStyleNames.add(e);
},
deleteLoadedStyleName: function(e) {
this._loadedStyleNames.delete(e);
},
clearLoadedStyleNames: function() {
this._loadedStyleNames.clear();
}
};
function Ne(t) {
"@babel/helpers - typeof";
return Ne = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
return typeof e;
} : function(e) {
return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
}, Ne(t);
}
function Gn(t, e) {
return kr(t) || Ir(t, e) || yr(t, e) || vr();
}
function vr() {
throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
}
function yr(t, e) {
if (t) {
if (typeof t == "string") return Wn(t, e);
var n = {}.toString.call(t).slice(8, -1);
return n === "Object" && t.constructor && (n = t.constructor.name), n === "Map" || n === "Set" ? Array.from(t) : n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) ? Wn(t, e) : void 0;
}
}
function Wn(t, e) {
(e == null || e > t.length) && (e = t.length);
for (var n = 0, o = Array(e); n < e; n++) o[n] = t[n];
return o;
}
function Ir(t, e) {
var n = t == null ? null : typeof Symbol < "u" && t[Symbol.iterator] || t["@@iterator"];
if (n != null) {
var o, a, r, u, s = [], i = !0, c = !1;
try {
if (r = (n = n.call(t)).next, e !== 0) for (; !(i = (o = r.call(n)).done) && (s.push(o.value), s.length !== e); i = !0) ;
} catch (l) {
c = !0, a = l;
} finally {
try {
if (!i && n.return != null && (u = n.return(), Object(u) !== u)) return;
} finally {
if (c) throw a;
}
}
return s;
}
}
function kr(t) {
if (Array.isArray(t)) return t;
}
function qn(t, e) {
var n = Object.keys(t);
if (Object.getOwnPropertySymbols) {
var o = Object.getOwnPropertySymbols(t);
e && (o = o.filter(function(a) {
return Object.getOwnPropertyDescriptor(t, a).enumerable;
})), n.push.apply(n, o);
}
return n;
}
function In(t) {
for (var e = 1; e < arguments.length; e++) {
var n = arguments[e] != null ? arguments[e] : {};
e % 2 ? qn(Object(n), !0).forEach(function(o) {
wr(t, o, n[o]);
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) : qn(Object(n)).forEach(function(o) {
Object.defineProperty(t, o, Object.getOwnPropertyDescriptor(n, o));
});
}
return t;
}
function wr(t, e, n) {
return (e = Cr(e)) in t ? Object.defineProperty(t, e, { value: n, enumerable: !0, configurable: !0, writable: !0 }) : t[e] = n, t;
}
function Cr(t) {
var e = Sr(t, "string");
return Ne(e) == "symbol" ? e : e + "";
}
function Sr(t, e) {
if (Ne(t) != "object" || !t) return t;
var n = t[Symbol.toPrimitive];
if (n !== void 0) {
var o = n.call(t, e || "default");
if (Ne(o) != "object") return o;
throw new TypeError("@@toPrimitive must return a primitive value.");
}
return (e === "string" ? String : Number)(t);
}
var Pr = function(e) {
var n = e.dt;
return `
*,
::before,
::after {
box-sizing: border-box;
}
/* Non vue overlay animations */
.p-connected-overlay {
opacity: 0;
transform: scaleY(0.8);
transition: transform 0.12s cubic-bezier(0, 0, 0.2, 1),
opacity 0.12s cubic-bezier(0, 0, 0.2, 1);
}
.p-connected-overlay-visible {
opacity: 1;
transform: scaleY(1);
}
.p-connected-overlay-hidden {
opacity: 0;
transform: scaleY(1);
transition: opacity 0.1s linear;
}
/* Vue based overlay animations */
.p-connected-overlay-enter-from {
opacity: 0;
transform: scaleY(0.8);
}
.p-connected-overlay-leave-to {
opacity: 0;
}
.p-connected-overlay-enter-active {
transition: transform 0.12s cubic-bezier(0, 0, 0.2, 1),
opacity 0.12s cubic-bezier(0, 0, 0.2, 1);
}
.p-connected-overlay-leave-active {
transition: opacity 0.1s linear;
}
/* Toggleable Content */
.p-toggleable-content-enter-from,
.p-toggleable-content-leave-to {
max-height: 0;
}
.p-toggleable-content-enter-to,
.p-toggleable-content-leave-from {
max-height: 1000px;
}
.p-toggleable-content-leave-active {
overflow: hidden;
transition: max-height 0.45s cubic-bezier(0, 1, 0, 1);
}
.p-toggleable-content-enter-active {
overflow: hidden;
transition: max-height 1s ease-in-out;
}
.p-disabled,
.p-disabled * {
cursor: default;
pointer-events: none;
user-select: none;
}
.p-disabled,
.p-component:disabled {
opacity: `.concat(n("disabled.opacity"), `;
}
.pi {
font-size: `).concat(n("icon.size"), `;
}
.p-icon {
width: `).concat(n("icon.size"), `;
height: `).concat(n("icon.size"), `;
}
.p-overlay-mask {
background: `).concat(n("mask.background"), `;
color: `).concat(n("mask.color"), `;
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
.p-overlay-mask-enter {
animation: p-overlay-mask-enter-animation `).concat(n("mask.transition.duration"), ` forwards;
}
.p-overlay-mask-leave {
animation: p-overlay-mask-leave-animation `).concat(n("mask.transition.duration"), ` forwards;
}
@keyframes p-overlay-mask-enter-animation {
from {
background: transparent;
}
to {
background: `).concat(n("mask.background"), `;
}
}
@keyframes p-overlay-mask-leave-animation {
from {
background: `).concat(n("mask.background"), `;
}
to {
background: transparent;
}
}
`);
}, $r = function(e) {
var n = e.dt;
return `
.p-hidden-accessible {
border: 0;
clip: rect(0 0 0 0);
height: 1px;
margin: -1px;
overflow: hidden;
padding: 0;
position: absolute;
width: 1px;
}
.p-hidden-accessible input,
.p-hidden-accessible select {
transform: scale(0);
}
.p-overflow-hidden {
overflow: hidden;
padding-right: `.concat(n("scrollbar.width"), `;
}
`);
}, xr = {}, Lr = {}, E = {
name: "base",
css: $r,
theme: Pr,
classes: xr,
inlineStyles: Lr,
load: function(e) {
var n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, o = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : function(r) {
return r;
}, a = o(V(e, {
dt: Ve
}));
return I(a) ? or(ze(a), In({
name: this.name
}, n)) : {};
},
loadCSS: function() {
var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
return this.load(this.css, e);
},
loadTheme: function() {
var e = this, n = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, o = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "";
return this.load(this.theme, n, function() {
var a = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "";
return T.transformCSS(n.name || e.name, "".concat(a).concat(o));
});
},
getCommonTheme: function(e) {
return T.getCommon(this.name, e);
},
getComponentTheme: function(e) {
return T.getComponent(this.name, e);
},
getDirectiveTheme: function(e) {
return T.getDirective(this.name, e);
},
getPresetTheme: function(e, n, o) {
return T.getCustomPreset(this.name, e, n, o);
},
getLayerOrderThemeCSS: function() {
return T.getLayerOrderCSS(this.name);
},
getStyleSheet: function() {
var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "", n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
if (this.css) {
var o = V(this.css, {
dt: Ve
}) || "", a = ze("".concat(o).concat(e)), r = Object.entries(n).reduce(function(u, s) {
var i = Gn(s, 2), c = i[0], l = i[1];
return u.push("".concat(c, '="').concat(l, '"')) && u;
}, []).join(" ");
return I(a) ? '<style type="text/css" data-primevue-style-id="'.concat(this.name, '" ').concat(r, ">").concat(a, "</style>") : "";
}
return "";
},
getCommonThemeStyleSheet: function(e) {
var n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
return T.getCommonStyleSheet(this.name, e, n);
},
getThemeStyleSheet: function(e) {
var n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, o = [T.getStyleSheet(this.name, e, n)];
if (this.theme) {
var a = this.name === "base" ? "global-style" : "".concat(this.name, "-style"), r = V(this.theme, {
dt: Ve
}), u = ze(T.transformCSS(a, r)), s = Object.entries(n).reduce(function(i, c) {
var l = Gn(c, 2), m = l[0], d = l[1];
return i.push("".concat(m, '="').concat(d, '"')) && i;
}, []).join(" ");
I(u) && o.push('<style type="text/css" data-primevue-style-id="'.concat(a, '" ').concat(s, ">").concat(u, "</style>"));
}
return o.join("");
},
extend: function(e) {
return In(In({}, this), {}, {
css: void 0,
theme: void 0
}, e);
}
}, Yn = E.extend({
name: "common"
});
function He(t) {
"@babel/helpers - typeof";
return He = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
return typeof e;
} : function(e) {
return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
}, He(t);
}
function Or(t) {
return Bt(t) || _r(t) || Et(t) || Tt();
}
function _r(t) {
if (typeof Symbol < "u" && t[Symbol.iterator] != null || t["@@iterator"] != null) return Array.from(t);
}
function je(t, e) {
return Bt(t) || Ar(t, e) || Et(t, e) || Tt();
}
function Tt() {
throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
}
function Et(t, e) {
if (t) {
if (typeof t == "string") return Xn(t, e);
var n = {}.toString.call(t).slice(8, -1);
return n === "Object" && t.constructor && (n = t.constructor.name), n === "Map" || n === "Set" ? Array.from(t) : n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) ? Xn(t, e) : void 0;
}
}
function Xn(t, e) {
(e == null || e > t.length) && (e = t.length);
for (var n = 0, o = Array(e); n < e; n++) o[n] = t[n];
return o;
}
function Ar(t, e) {
var n = t == null ? null : typeof Symbol < "u" && t[Symbol.iterator] || t["@@iterator"];
if (n != null) {
var o, a, r, u, s = [], i = !0, c = !1;
try {
if (r = (n = n.call(t)).next, e === 0) {
if (Object(n) !== n) return;
i = !1;
} else for (; !(i = (o = r.call(n)).done) && (s.push(o.value), s.length !== e); i = !0) ;
} catch (l) {
c = !0, a = l;
} finally {
try {
if (!i && n.return != null && (u = n.return(), Object(u) !== u)) return;
} finally {
if (c) throw a;
}
}
return s;
}
}
function Bt(t) {
if (Array.isArray(t)) return t;
}
function Jn(t, e) {
var n = Object.keys(t);
if (Object.getOwnPropertySymbols) {
var o = Object.getOwnPropertySymbols(t);
e && (o = o.filter(function(a) {
return Object.getOwnPropertyDescriptor(t, a).enumerable;
})), n.push.apply(n, o);
}
return n;
}
function L(t) {
for (var e = 1; e < arguments.length; e++) {
var n = arguments[e] != null ? arguments[e] : {};
e % 2 ? Jn(Object(n), !0).forEach(function(o) {
Me(t, o, n[o]);
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) : Jn(Object(n)).forEach(function(o) {
Object.defineProperty(t, o, Object.getOwnPropertyDescriptor(n, o));
});
}
return t;
}
function Me(t, e, n) {
return (e = Tr(e)) in t ? Object.defineProperty(t, e, { value: n, enumerable: !0, configurable: !0, writable: !0 }) : t[e] = n, t;
}
function Tr(t) {
var e = Er(t, "string");
return He(e) == "symbol" ? e : e + "";
}
function Er(t, e) {
if (He(t) != "object" || !t) return t;
var n = t[Symbol.toPrimitive];
if (n !== void 0) {
var o = n.call(t, e || "default");
if (He(o) != "object") return o;
throw new TypeError("@@toPrimitive must return a primitive value.");
}
return (e === "string" ? String : Number)(t);
}
var Z = {
name: "BaseComponent",
props: {
pt: {
type: Object,
default: void 0
},
ptOptions: {
type: Object,
default: void 0
},
unstyled: {
type: Boolean,
default: void 0
},
dt: {
type: Object,
default: void 0
}
},
inject: {
$parentInstance: {
default: void 0
}
},
watch: {
isUnstyled: {
immediate: !0,
handler: function(e) {
e || (this._loadCoreStyles(), this._themeChangeListener(this._loadCoreStyles));
}
},
dt: {
immediate: !0,
handler: function(e) {
var n = this;
e ? (this._loadScopedThemeStyles(e), this._themeChangeListener(function() {
return n._loadScopedThemeStyles(e);
})) : this._unloadScopedThemeStyles();
}
}
},
scopedStyleEl: void 0,
rootEl: void 0,
$attrSelector: void 0,
beforeCreate: function() {
var e, n, o, a, r, u, s, i, c, l, m, d = (e = this.pt) === null || e === void 0 ? void 0 : e._usept, b = d ? (n = this.pt) === null || n === void 0 || (n = n.originalValue) === null || n === void 0 ? void 0 : n[this.$.type.name] : void 0, h = d ? (o = this.pt) === null || o === void 0 || (o = o.value) === null || o === void 0 ? void 0 : o[this.$.type.name] : this.pt;
(a = h || b) === null || a === void 0 || (a = a.hooks) === null || a === void 0 || (r = a.onBeforeCreate) === null || r === void 0 || r.call(a);
var y = (u = this.$primevueConfig) === null || u === void 0 || (u = u.pt) === null || u === void 0 ? void 0 : u._usept, C = y ? (s = this.$primevue) === null || s === void 0 || (s = s.config) === null || s === void 0 || (s = s.pt) === null || s === void 0 ? void 0 : s.originalValue : void 0, A = y ? (i = this.$primevue) === null || i === void 0 || (i = i.config) === null || i === void 0 || (i = i.pt) === null || i === void 0 ? void 0 : i.value : (c = this.$primevue) === null || c === void 0 || (c = c.config) === null || c === void 0 ? void 0 : c.pt;
(l = A || C) === null || l === void 0 || (l = l[this.$.type.name]) === null || l === void 0 || (l = l.hooks) === null || l === void 0 || (m = l.onBeforeCreate) === null || m === void 0 || m.call(l), this.$attrSelector = An("pc");
},
created: function() {
this._hook("onCreated");
},
beforeMount: function() {
this.rootEl = R(this.$el, '[data-pc-name="'.concat(Y(this.$.type.name), '"]')), this.rootEl && (this.$attrSelector && !this.rootEl.hasAttribute(this.$attrSelector) && this.rootEl.setAttribute(this.$attrSelector, ""), this.rootEl.$pc = L({
name: this.$.type.name,
attrSelector: this.$attrSelector
}, this.$params)), this._loadStyles(), this._hook("onBeforeMount");
},
mounted: function() {
this._hook("onMounted");
},
beforeUpdate: function() {
this._hook("onBeforeUpdate");
},
updated: function() {
this._hook("onUpdated");
},
beforeUnmount: function() {
this._hook("onBeforeUnmount");
},
unmounted: function() {
this._unloadScopedThemeStyles(), this._hook("onUnmounted");
},
methods: {
_hook: function(e) {
if (!this.$options.hostName) {
var n = this._use