UNPKG

buildkit-primevue

Version:

FormKit components and helpers built on PrimeVue v4 with Tailwind CSS

1,239 lines (1,219 loc) 137 kB
import { defineComponent as Ae, inject as Ne, computed as N, createElementBlock as z, openBlock as O, renderSlot as G, createCommentVNode as ye, onMounted as kt, ref as B, onUnmounted as Ge, provide as wt, withDirectives as cn, createBlock as A, unref as T, normalizeClass as Y, withCtx as fe, createElementVNode as S, createVNode as Te, createTextVNode as pn, toDisplayString as Ve, vShow as fn, readonly as mn, getCurrentInstance as Xe, nextTick as hn, watch as je, useId as qn, mergeProps as w, normalizeProps as $t, guardReactiveProps as St, Fragment as Be, renderList as Re, resolveDynamicComponent as qe, mergeModels as et, useModel as bn, normalizeStyle as vn } from "vue"; import gn from "@primevue/forms/form"; import yn from "@primevue/forms/formfield"; import { resolve as tt, isNotEmpty as Ke, cn as kn, isObject as wn } from "@primeuix/utils"; import * as Ie from "primevue"; import $n from "axios"; import { useResizeObserver as Sn } from "@vueuse/core"; import { z as y } from "zod"; const xn = "0.1.68", _n = ["for"], On = { key: 0, class: "bk-text-error" }, xt = /* @__PURE__ */ Ae({ __name: "FormKitLabel", setup(e) { const t = Ne("$fcDynamicFormField", void 0), n = N(() => t?.inputId), l = N(() => t?.required); return (o, u) => (O(), z("label", { for: n.value, class: "bk-label" }, [ G(o.$slots, "default"), l.value ? (O(), z("span", On, "*")) : ye("", !0) ], 8, _n)); } }); function ce(e, t) { if (typeof t != "string") return t; switch (Array.isArray(e) ? e.length ? typeof e[0] : "string" : typeof e) { case "boolean": return /^(true|false)$/i.test(t) ? t.toLowerCase() === "true" : t === "1" ? !0 : t === "0" ? !1 : !!t; case "number": { const l = Number(t); return Number.isFinite(l) ? l : t; } case "string": default: return t; } } function ze(e, t) { if (Array.isArray(t)) { const l = t.map((o) => ce(e, o)); return Array.isArray(e) ? e.some((o) => l.includes(o)) : l.includes(e); } if (Array.isArray(e)) { const l = ce(e, t); return e.includes(l); } const n = ce(e, t); return e === n; } function Le(e, t) { const n = Array.isArray(t) ? t : [t]; if (Array.isArray(e)) return n.some((l) => e.includes(ce(e, l))); if (typeof e == "string") { const l = e.trim().toLowerCase(); return n.some((o) => { const u = ce(e, o); return typeof u == "string" ? l.includes(u.trim().toLowerCase()) : e === u; }); } return n.some((l) => { const o = ce(e, l); return e === o; }); } const Cn = { class: "bk-flex-col bk-gap-2" }, Pn = ["innerHTML"], jn = { key: 1, class: "bk-text-xs bk-text-error" }, _t = /* @__PURE__ */ Ae({ __name: "FormKitField", props: { name: {}, inputId: {}, required: { type: Boolean, default: !1 }, label: { default: "" }, help: {}, rest: { default: () => ({}) }, formApi: { default: () => { } } }, setup(e) { kt(() => { if (o.value?.field && t?.watchFieldValue) { try { r.value = t?.getFieldValue?.(o.value.field) ?? r.value; } catch { } const c = t.watchFieldValue(o.value.field, (b) => { r.value = b; }); typeof c == "function" && s.push(c); } if (u.value?.field && t?.watchFieldValue) { try { i.value = t?.getFieldValue?.(u.value.field) ?? i.value; } catch { } const c = t.watchFieldValue(u.value.field, (b) => { i.value = b; }); typeof c == "function" && s.push(c); } }), Ge(() => { s.forEach((c) => { try { c(); } catch { } }); }), wt("$fcDynamicFormField", { name: e.name, inputId: e.inputId, required: e.required }); const t = Ne("$fcDynamicForm", void 0) ?? e.formApi, n = N(() => [e.rest.class || "", e.rest.className || ""]), l = N(() => ({ "bk-flex bk-gap-2 bk-row-reverse bk-items-center": e.rest?.as === "Checkbox", "bk-flex bk-flex-col bk-gap-2": e.rest?.as !== "Checkbox" })), o = N(() => e.rest?.showWhen), u = N(() => e.rest?.hideWhen), r = B(void 0), i = B(void 0), s = [], p = N(() => { const c = !!o.value?.field, b = !!u.value?.field; let a = !0; if (c) { const d = o.value; d?.includes !== void 0 ? a = Le(r.value, d.includes) : a = ze(r.value, d?.equals); } if (b) { const d = u.value; let h = !1; d?.includes !== void 0 ? h = Le(i.value, d.includes) : h = ze(i.value, d?.equals), h && (a = !1); } return a; }); return (c, b) => cn((O(), A(T(yn), { name: String(e.name), class: Y(["bk-field", n.value]) }, { default: fe(({ error: a }) => [ S("div", { class: Y(l.value) }, [ Te(xt, null, { default: fe(() => [ pn(Ve(e.label), 1) ]), _: 1 }), G(c.$slots, "default") ], 2), S("div", Cn, [ e.help ? (O(), z("small", { key: 0, innerHTML: e.help, class: "bk-text-xs bk-text-muted" }, null, 8, Pn)) : ye("", !0), e.formApi[e.name]?.error ? (O(), z("small", jn, Ve(typeof a == "string" ? a : a?.message ?? ""), 1)) : ye("", !0) ]) ]), _: 3 }, 8, ["name", "class"])), [ [fn, p.value] ]); } }); function Ze(e) { return e == null || e === "" || Array.isArray(e) && e.length === 0 || !(e instanceof Date) && typeof e == "object" && Object.keys(e).length === 0; } function Ot(e) { return typeof e == "function" && "call" in e && "apply" in e; } function C(e) { return !Ze(e); } function pe(e, t = !0) { return e instanceof Object && e.constructor === Object && (t || Object.keys(e).length !== 0); } function K(e, ...t) { return Ot(e) ? e(...t) : e; } function U(e, t = !0) { return typeof e == "string" && (t || e !== ""); } function le(e) { return U(e) ? e.replace(/(-|_)/g, "").toLowerCase() : e; } function Ct(e, t = "", n = {}) { let l = le(t).split("."), o = l.shift(); if (o) { if (pe(e)) { let u = Object.keys(e).find((r) => le(r) === o) || ""; return Ct(K(e[u], n), l.join("."), n); } return; } return K(e, n); } function Nn(e, t = !0) { return Array.isArray(e) && (t || e.length !== 0); } function Tn(e) { return C(e) && !isNaN(e); } function oe(e, t) { if (t) { let n = t.test(e); return t.lastIndex = 0, n; } return !1; } function ge(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 Pt(e) { return U(e) ? e.replace(/(_)/g, "-").replace(/[A-Z]/g, (t, n) => n === 0 ? t : "-" + t.toLowerCase()).toLowerCase() : e; } function Vn() { let e = /* @__PURE__ */ new Map(); return { on(t, n) { let l = e.get(t); return l ? l.push(n) : l = [n], e.set(t, l), this; }, off(t, n) { let l = e.get(t); return l && l.splice(l.indexOf(n) >>> 0, 1), this; }, emit(t, n) { let l = e.get(t); l && l.forEach((o) => { o(n); }); }, clear() { e.clear(); } }; } var zn = Object.defineProperty, Ln = Object.defineProperties, Fn = Object.getOwnPropertyDescriptors, Fe = Object.getOwnPropertySymbols, jt = Object.prototype.hasOwnProperty, Nt = Object.prototype.propertyIsEnumerable, nt = (e, t, n) => t in e ? zn(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, M = (e, t) => { for (var n in t || (t = {})) jt.call(t, n) && nt(e, n, t[n]); if (Fe) for (var n of Fe(t)) Nt.call(t, n) && nt(e, n, t[n]); return e; }, De = (e, t) => Ln(e, Fn(t)), W = (e, t) => { var n = {}; for (var l in e) jt.call(e, l) && t.indexOf(l) < 0 && (n[l] = e[l]); if (e != null && Fe) for (var l of Fe(e)) t.indexOf(l) < 0 && Nt.call(e, l) && (n[l] = e[l]); return n; }, An = Vn(), E = An, ke = /{([^}]*)}/g, Tt = /(\d+\s+[\+\-\*\/]\s+\d+)/g, Vt = /var\([^)]+\)/g; function lt(e) { return U(e) ? e.replace(/[A-Z]/g, (t, n) => n === 0 ? t : "." + t.toLowerCase()).toLowerCase() : e; } function En(e) { return pe(e) && e.hasOwnProperty("$value") && e.hasOwnProperty("$type") ? e.$value : e; } function In(e) { return e.replaceAll(/ /g, "").replace(/[^\w]/g, "-"); } function Ue(e = "", t = "") { return In(`${U(e, !1) && U(t, !1) ? `${e}-` : e}${t}`); } function zt(e = "", t = "") { return `--${Ue(e, t)}`; } function Dn(e = "") { let t = (e.match(/{/g) || []).length, n = (e.match(/}/g) || []).length; return (t + n) % 2 !== 0; } function Lt(e, t = "", n = "", l = [], o) { if (U(e)) { let u = e.trim(); if (Dn(u)) return; if (oe(u, ke)) { let r = u.replaceAll(ke, (i) => { let s = i.replace(/{|}/g, "").split(".").filter((p) => !l.some((c) => oe(p, c))); return `var(${zt(n, Pt(s.join("-")))}${C(o) ? `, ${o}` : ""})`; }); return oe(r.replace(Vt, "0"), Tt) ? `calc(${r})` : r; } return u; } else if (Tn(e)) return e; } function Mn(e, t, n) { U(t, !1) && e.push(`${t}:${n};`); } function ue(e, t) { return e ? `${e}{${t}}` : ""; } function Ft(e, t) { if (e.indexOf("dt(") === -1) return e; function n(r, i) { let s = [], p = 0, c = "", b = null, a = 0; for (; p <= r.length; ) { let d = r[p]; if ((d === '"' || d === "'" || d === "`") && r[p - 1] !== "\\" && (b = b === d ? null : d), !b && (d === "(" && a++, d === ")" && a--, (d === "," || p === r.length) && a === 0)) { let h = c.trim(); h.startsWith("dt(") ? s.push(Ft(h, i)) : s.push(l(h)), c = "", p++; continue; } d !== void 0 && (c += d), p++; } return s; } function l(r) { let i = r[0]; if ((i === '"' || i === "'" || i === "`") && r[r.length - 1] === i) return r.slice(1, -1); let s = Number(r); return isNaN(s) ? r : s; } let o = [], u = []; for (let r = 0; r < e.length; r++) if (e[r] === "d" && e.slice(r, r + 3) === "dt(") u.push(r), r += 2; else if (e[r] === ")" && u.length > 0) { let i = u.pop(); u.length === 0 && o.push([i, r]); } if (!o.length) return e; for (let r = o.length - 1; r >= 0; r--) { let [i, s] = o[r], p = e.slice(i + 3, s), c = n(p, t), b = t(...c); e = e.slice(0, i) + b + e.slice(s + 1); } return e; } var re = (...e) => Bn(V.getTheme(), ...e), Bn = (e = {}, t, n, l) => { if (t) { let { variable: o, options: u } = V.defaults || {}, { prefix: r, transform: i } = e?.options || u || {}, s = oe(t, ke) ? t : `{${t}}`; return l === "value" || Ze(l) && i === "strict" ? V.getTokenValue(t) : Lt(s, void 0, r, [o.excludedKeyRegex], n); } return ""; }; function Ce(e, ...t) { if (e instanceof Array) { let n = e.reduce((l, o, u) => { var r; return l + o + ((r = tt(t[u], { dt: re })) != null ? r : ""); }, ""); return Ft(n, re); } return tt(e, { dt: re }); } function Rn(e, t = {}) { let n = V.defaults.variable, { prefix: l = n.prefix, selector: o = n.selector, excludedKeyRegex: u = n.excludedKeyRegex } = t, r = [], i = [], s = [{ node: e, path: l }]; for (; s.length; ) { let { node: c, path: b } = s.pop(); for (let a in c) { let d = c[a], h = En(d), f = oe(a, u) ? Ue(b) : Ue(b, Pt(a)); if (pe(h)) s.push({ node: h, path: f }); else { let q = zt(f), k = Lt(h, f, l, [u]); Mn(i, q, k); let g = f; l && g.startsWith(l + "-") && (g = g.slice(l.length + 1)), r.push(g.replace(/-/g, ".")); } } } let p = i.join(""); return { value: i, tokens: r, declarations: p, css: ue(o, p) }; } var D = { 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,:host${e}`, matched: this.pattern.test(e.trim()) }; } }, media: { pattern: /^@media (.*)$/, resolve(e) { return { type: "media", selector: e, matched: this.pattern.test(e.trim()) }; } }, system: { pattern: /^system$/, resolve(e) { return { type: "system", selector: "@media (prefers-color-scheme: dark)", matched: this.pattern.test(e.trim()) }; } }, custom: { resolve(e) { return { type: "custom", selector: e, matched: !0 }; } } }, resolve(e) { let t = Object.keys(this.rules).filter((n) => n !== "custom").map((n) => this.rules[n]); return [e].flat().map((n) => { var l; return (l = t.map((o) => o.resolve(n)).find((o) => o.matched)) != null ? l : this.rules.custom.resolve(n); }); } }, _toVariables(e, t) { return Rn(e, { prefix: t?.prefix }); }, getCommon({ name: e = "", theme: t = {}, params: n, set: l, defaults: o }) { var u, r, i, s, p, c, b; let { preset: a, options: d } = t, h, f, q, k, g, m, v; if (C(a) && d.transform !== "strict") { let { primitive: $, semantic: j, extend: _ } = a, L = j || {}, { colorScheme: P } = L, F = W(L, ["colorScheme"]), Z = _ || {}, { colorScheme: J } = Z, X = W(Z, ["colorScheme"]), Q = P || {}, { dark: ee } = Q, ie = W(Q, ["dark"]), te = J || {}, { dark: ae } = te, se = W(te, ["dark"]), H = C($) ? this._toVariables({ primitive: $ }, d) : {}, R = C(F) ? this._toVariables({ semantic: F }, d) : {}, ne = C(ie) ? this._toVariables({ light: ie }, d) : {}, Oe = C(ee) ? this._toVariables({ dark: ee }, d) : {}, de = C(X) ? this._toVariables({ semantic: X }, d) : {}, Ye = C(se) ? this._toVariables({ light: se }, d) : {}, Je = C(ae) ? this._toVariables({ dark: ae }, d) : {}, [Ht, Wt] = [(u = H.declarations) != null ? u : "", H.tokens], [Gt, Zt] = [(r = R.declarations) != null ? r : "", R.tokens || []], [Qt, Yt] = [(i = ne.declarations) != null ? i : "", ne.tokens || []], [Jt, Xt] = [(s = Oe.declarations) != null ? s : "", Oe.tokens || []], [en, tn] = [(p = de.declarations) != null ? p : "", de.tokens || []], [nn, ln] = [(c = Ye.declarations) != null ? c : "", Ye.tokens || []], [on, rn] = [(b = Je.declarations) != null ? b : "", Je.tokens || []]; h = this.transformCSS(e, Ht, "light", "variable", d, l, o), f = Wt; let an = this.transformCSS(e, `${Gt}${Qt}`, "light", "variable", d, l, o), sn = this.transformCSS(e, `${Jt}`, "dark", "variable", d, l, o); q = `${an}${sn}`, k = [.../* @__PURE__ */ new Set([...Zt, ...Yt, ...Xt])]; let dn = this.transformCSS(e, `${en}${nn}color-scheme:light`, "light", "variable", d, l, o), un = this.transformCSS(e, `${on}color-scheme:dark`, "dark", "variable", d, l, o); g = `${dn}${un}`, m = [.../* @__PURE__ */ new Set([...tn, ...ln, ...rn])], v = K(a.css, { dt: re }); } return { primitive: { css: h, tokens: f }, semantic: { css: q, tokens: k }, global: { css: g, tokens: m }, style: v }; }, getPreset({ name: e = "", preset: t = {}, options: n, params: l, set: o, defaults: u, selector: r }) { var i, s, p; let c, b, a; if (C(t) && n.transform !== "strict") { let d = e.replace("-directive", ""), h = t, { colorScheme: f, extend: q, css: k } = h, g = W(h, ["colorScheme", "extend", "css"]), m = q || {}, { colorScheme: v } = m, $ = W(m, ["colorScheme"]), j = f || {}, { dark: _ } = j, L = W(j, ["dark"]), P = v || {}, { dark: F } = P, Z = W(P, ["dark"]), J = C(g) ? this._toVariables({ [d]: M(M({}, g), $) }, n) : {}, X = C(L) ? this._toVariables({ [d]: M(M({}, L), Z) }, n) : {}, Q = C(_) ? this._toVariables({ [d]: M(M({}, _), F) }, n) : {}, [ee, ie] = [(i = J.declarations) != null ? i : "", J.tokens || []], [te, ae] = [(s = X.declarations) != null ? s : "", X.tokens || []], [se, H] = [(p = Q.declarations) != null ? p : "", Q.tokens || []], R = this.transformCSS(d, `${ee}${te}`, "light", "variable", n, o, u, r), ne = this.transformCSS(d, se, "dark", "variable", n, o, u, r); c = `${R}${ne}`, b = [.../* @__PURE__ */ new Set([...ie, ...ae, ...H])], a = K(k, { dt: re }); } return { css: c, tokens: b, style: a }; }, getPresetC({ name: e = "", theme: t = {}, params: n, set: l, defaults: o }) { var u; let { preset: r, options: i } = t, s = (u = r?.components) == null ? void 0 : u[e]; return this.getPreset({ name: e, preset: s, options: i, params: n, set: l, defaults: o }); }, getPresetD({ name: e = "", theme: t = {}, params: n, set: l, defaults: o }) { var u, r; let i = e.replace("-directive", ""), { preset: s, options: p } = t, c = ((u = s?.components) == null ? void 0 : u[i]) || ((r = s?.directives) == null ? void 0 : r[i]); return this.getPreset({ name: i, preset: c, options: p, params: n, set: l, defaults: o }); }, 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, l) { let { cssLayer: o } = t; return o ? `@layer ${K(o.order || o.name || "primeui", n)}` : ""; }, getCommonStyleSheet({ name: e = "", theme: t = {}, params: n, props: l = {}, set: o, defaults: u }) { let r = this.getCommon({ name: e, theme: t, params: n, set: o, defaults: u }), i = Object.entries(l).reduce((s, [p, c]) => s.push(`${p}="${c}"`) && s, []).join(" "); return Object.entries(r || {}).reduce((s, [p, c]) => { if (pe(c) && Object.hasOwn(c, "css")) { let b = ge(c.css), a = `${p}-variables`; s.push(`<style type="text/css" data-primevue-style-id="${a}" ${i}>${b}</style>`); } return s; }, []).join(""); }, getStyleSheet({ name: e = "", theme: t = {}, params: n, props: l = {}, set: o, defaults: u }) { var r; let i = { name: e, theme: t, params: n, set: o, defaults: u }, s = (r = e.includes("-directive") ? this.getPresetD(i) : this.getPresetC(i)) == null ? void 0 : r.css, p = Object.entries(l).reduce((c, [b, a]) => c.push(`${b}="${a}"`) && c, []).join(" "); return s ? `<style type="text/css" data-primevue-style-id="${e}-variables" ${p}>${ge(s)}</style>` : ""; }, createTokens(e = {}, t, n = "", l = "", o = {}) { let u = function(i, s = {}, p = []) { if (p.includes(this.path)) return console.warn(`Circular reference detected at ${this.path}`), { colorScheme: i, path: this.path, paths: s, value: void 0 }; p.push(this.path), s.name = this.path, s.binding || (s.binding = {}); let c = this.value; if (typeof this.value == "string" && ke.test(this.value)) { let b = this.value.trim().replace(ke, (a) => { var d; let h = a.slice(1, -1), f = this.tokens[h]; if (!f) return console.warn(`Token not found for path: ${h}`), "__UNRESOLVED__"; let q = f.computed(i, s, p); return Array.isArray(q) && q.length === 2 ? `light-dark(${q[0].value},${q[1].value})` : (d = q?.value) != null ? d : "__UNRESOLVED__"; }); c = Tt.test(b.replace(Vt, "0")) ? `calc(${b})` : b; } return Ze(s.binding) && delete s.binding, p.pop(), { colorScheme: i, path: this.path, paths: s, value: c.includes("__UNRESOLVED__") ? void 0 : c }; }, r = (i, s, p) => { Object.entries(i).forEach(([c, b]) => { let a = oe(c, t.variable.excludedKeyRegex) ? s : s ? `${s}.${lt(c)}` : lt(c), d = p ? `${p}.${c}` : c; pe(b) ? r(b, a, d) : (o[a] || (o[a] = { paths: [], computed: (h, f = {}, q = []) => { if (o[a].paths.length === 1) return o[a].paths[0].computed(o[a].paths[0].scheme, f.binding, q); if (h && h !== "none") for (let k = 0; k < o[a].paths.length; k++) { let g = o[a].paths[k]; if (g.scheme === h) return g.computed(h, f.binding, q); } return o[a].paths.map((k) => k.computed(k.scheme, f[k.scheme], q)); } }), o[a].paths.push({ path: d, value: b, scheme: d.includes("colorScheme.light") ? "light" : d.includes("colorScheme.dark") ? "dark" : "none", computed: u, tokens: o })); }); }; return r(e, n, l), o; }, getTokenValue(e, t, n) { var l; let o = ((i) => i.split(".").filter((s) => !oe(s.toLowerCase(), n.variable.excludedKeyRegex)).join("."))(t), u = t.includes("colorScheme.light") ? "light" : t.includes("colorScheme.dark") ? "dark" : void 0, r = [(l = e[o]) == null ? void 0 : l.computed(u)].flat().filter((i) => i); return r.length === 1 ? r[0].value : r.reduce((i = {}, s) => { let p = s, { colorScheme: c } = p, b = W(p, ["colorScheme"]); return i[c] = b, i; }, void 0); }, getSelectorRule(e, t, n, l) { return n === "class" || n === "attr" ? ue(C(t) ? `${e}${t},${e} ${t}` : e, l) : ue(e, ue(t ?? ":root,:host", l)); }, transformCSS(e, t, n, l, o = {}, u, r, i) { if (C(t)) { let { cssLayer: s } = o; if (l !== "style") { let p = this.getColorSchemeOption(o, r); t = n === "dark" ? p.reduce((c, { type: b, selector: a }) => (C(a) && (c += a.includes("[CSS]") ? a.replace("[CSS]", t) : this.getSelectorRule(a, i, b, t)), c), "") : ue(i ?? ":root,:host", t); } if (s) { let p = { name: "primeui" }; pe(s) && (p.name = K(s.name, { name: e, type: l })), C(p.name) && (t = ue(`@layer ${p.name}`, t), u?.layerNames(p.name)); } return t; } return ""; } }, V = { defaults: { variable: { prefix: "p", selector: ":root,:host", 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 = {}) { let { theme: t } = e; t && (this._theme = De(M({}, t), { options: M(M({}, this.defaults.options), t.options) }), this._tokens = D.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 }), E.emit("theme:change", e); }, getPreset() { return this.preset; }, setPreset(e) { this._theme = De(M({}, this.theme), { preset: e }), this._tokens = D.createTokens(e, this.defaults), this.clearLoadedStyleNames(), E.emit("preset:change", e), E.emit("theme:change", this.theme); }, getOptions() { return this.options; }, setOptions(e) { this._theme = De(M({}, this.theme), { options: e }), this.clearLoadedStyleNames(), E.emit("options:change", e), E.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 D.getTokenValue(this.tokens, e, this.defaults); }, getCommon(e = "", t) { return D.getCommon({ name: e, theme: this.theme, params: t, defaults: this.defaults, set: { layerNames: this.setLayerNames.bind(this) } }); }, getComponent(e = "", t) { let n = { name: e, theme: this.theme, params: t, defaults: this.defaults, set: { layerNames: this.setLayerNames.bind(this) } }; return D.getPresetC(n); }, getDirective(e = "", t) { let n = { name: e, theme: this.theme, params: t, defaults: this.defaults, set: { layerNames: this.setLayerNames.bind(this) } }; return D.getPresetD(n); }, getCustomPreset(e = "", t, n, l) { let o = { name: e, preset: t, options: this.options, selector: n, params: l, defaults: this.defaults, set: { layerNames: this.setLayerNames.bind(this) } }; return D.getPreset(o); }, getLayerOrderCSS(e = "") { return D.getLayerOrder(e, this.options, { names: this.getLayerNames() }, this.defaults); }, transformCSS(e = "", t, n = "style", l) { return D.transformCSS(e, t, l, n, this.options, { layerNames: this.setLayerNames.bind(this) }, this.defaults); }, getCommonStyleSheet(e = "", t, n = {}) { return D.getCommonStyleSheet({ name: e, theme: this.theme, params: t, props: n, defaults: this.defaults, set: { layerNames: this.setLayerNames.bind(this) } }); }, getStyleSheet(e, t, n = {}) { return D.getStyleSheet({ name: e, theme: this.theme, params: t, props: n, defaults: this.defaults, set: { layerNames: this.setLayerNames.bind(this) } }); }, onStyleMounted(e) { this._loadingStyles.add(e); }, onStyleUpdated(e) { this._loadingStyles.add(e); }, onStyleLoaded(e, { name: t }) { this._loadingStyles.size && (this._loadingStyles.delete(t), E.emit(`theme:${t}:load`, e), !this._loadingStyles.size && E.emit("theme:load")); } }; function Kn(e) { if (e) { let t = e.parentNode; return t && t instanceof ShadowRoot && t.host && (t = t.host), t; } return null; } function At(e) { return !!(e !== null && typeof e < "u" && e.nodeName && Kn(e)); } function Ee(e) { return typeof Element < "u" ? e instanceof Element : e !== null && typeof e == "object" && e.nodeType === 1 && typeof e.nodeName == "string"; } function He(e, t = {}) { if (Ee(e)) { let n = (l, o) => { var u, r; let i = (u = e?.$attrs) != null && u[l] ? [(r = e?.$attrs) == null ? void 0 : r[l]] : []; return [o].flat().reduce((s, p) => { if (p != null) { let c = typeof p; if (c === "string" || c === "number") s.push(p); else if (c === "object") { let b = Array.isArray(p) ? n(l, p) : Object.entries(p).map(([a, d]) => l === "style" && (d || d === 0) ? `${a.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase()}:${d}` : d ? a : void 0); s = b.length ? s.concat(b.filter((a) => !!a)) : s; } } return s; }, i); }; Object.entries(t).forEach(([l, o]) => { if (o != null) { let u = l.match(/^on(.+)/); u ? e.addEventListener(u[1].toLowerCase(), o) : l === "p-bind" || l === "pBind" ? He(e, o) : (o = l === "class" ? [...new Set(n("class", o))].join(" ").trim() : l === "style" ? n("style", o).join(";").trim() : o, (e.$attrs = e.$attrs || {}) && (e.$attrs[l] = o), e.setAttribute(l, o)); } }); } } function Un(e, t) { return Ee(e) ? e.matches(t) ? e : e.querySelector(t) : null; } function Hn() { return !!(typeof window < "u" && window.document && window.document.createElement); } function Wn(e, t = "", n) { Ee(e) && n !== null && n !== void 0 && e.setAttribute(t, n); } var me = { _loadedStyleNames: /* @__PURE__ */ new Set(), getLoadedStyleNames: function() { return this._loadedStyleNames; }, isStyleNameLoaded: function(t) { return this._loadedStyleNames.has(t); }, setLoadedStyleName: function(t) { this._loadedStyleNames.add(t); }, deleteLoadedStyleName: function(t) { this._loadedStyleNames.delete(t); }, clearLoadedStyleNames: function() { this._loadedStyleNames.clear(); } }, Gn = ` *, ::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: dt('disabled.opacity'); } .pi { font-size: dt('icon.size'); } .p-icon { width: dt('icon.size'); height: dt('icon.size'); } .p-overlay-mask { background: dt('mask.background'); color: dt('mask.color'); position: fixed; top: 0; left: 0; width: 100%; height: 100%; } .p-overlay-mask-enter { animation: p-overlay-mask-enter-animation dt('mask.transition.duration') forwards; } .p-overlay-mask-leave { animation: p-overlay-mask-leave-animation dt('mask.transition.duration') forwards; } @keyframes p-overlay-mask-enter-animation { from { background: transparent; } to { background: dt('mask.background'); } } @keyframes p-overlay-mask-leave-animation { from { background: dt('mask.background'); } to { background: transparent; } } `; function we(e) { "@babel/helpers - typeof"; return we = 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; }, we(e); } function ot(e, t) { var n = Object.keys(e); if (Object.getOwnPropertySymbols) { var l = Object.getOwnPropertySymbols(e); t && (l = l.filter(function(o) { return Object.getOwnPropertyDescriptor(e, o).enumerable; })), n.push.apply(n, l); } return n; } function rt(e) { for (var t = 1; t < arguments.length; t++) { var n = arguments[t] != null ? arguments[t] : {}; t % 2 ? ot(Object(n), !0).forEach(function(l) { Zn(e, l, n[l]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : ot(Object(n)).forEach(function(l) { Object.defineProperty(e, l, Object.getOwnPropertyDescriptor(n, l)); }); } return e; } function Zn(e, t, n) { return (t = Qn(t)) in e ? Object.defineProperty(e, t, { value: n, enumerable: !0, configurable: !0, writable: !0 }) : e[t] = n, e; } function Qn(e) { var t = Yn(e, "string"); return we(t) == "symbol" ? t : t + ""; } function Yn(e, t) { if (we(e) != "object" || !e) return e; var n = e[Symbol.toPrimitive]; if (n !== void 0) { var l = n.call(e, t); if (we(l) != "object") return l; throw new TypeError("@@toPrimitive must return a primitive value."); } return (t === "string" ? String : Number)(e); } function Jn(e) { var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !0; Xe() && Xe().components ? kt(e) : t ? e() : hn(e); } var Xn = 0; function el(e) { var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, n = B(!1), l = B(e), o = B(null), u = Hn() ? window.document : void 0, r = t.document, i = r === void 0 ? u : r, s = t.immediate, p = s === void 0 ? !0 : s, c = t.manual, b = c === void 0 ? !1 : c, a = t.name, d = a === void 0 ? "style_".concat(++Xn) : a, h = t.id, f = h === void 0 ? void 0 : h, q = t.media, k = q === void 0 ? void 0 : q, g = t.nonce, m = g === void 0 ? void 0 : g, v = t.first, $ = v === void 0 ? !1 : v, j = t.onMounted, _ = j === void 0 ? void 0 : j, L = t.onUpdated, P = L === void 0 ? void 0 : L, F = t.onLoad, Z = F === void 0 ? void 0 : F, J = t.props, X = J === void 0 ? {} : J, Q = function() { }, ee = function(ae) { var se = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}; if (i) { var H = rt(rt({}, X), se), R = H.name || d, ne = H.id || f, Oe = H.nonce || m; o.value = i.querySelector('style[data-primevue-style-id="'.concat(R, '"]')) || i.getElementById(ne) || i.createElement("style"), o.value.isConnected || (l.value = ae || e, He(o.value, { type: "text/css", id: ne, media: k, nonce: Oe }), $ ? i.head.prepend(o.value) : i.head.appendChild(o.value), Wn(o.value, "data-primevue-style-id", R), He(o.value, H), o.value.onload = function(de) { return Z?.(de, { name: R }); }, _?.(R)), !n.value && (Q = je(l, function(de) { o.value.textContent = de, P?.(R); }, { immediate: !0 }), n.value = !0); } }, ie = function() { !i || !n.value || (Q(), At(o.value) && i.head.removeChild(o.value), n.value = !1, o.value = null); }; return p && !b && Jn(ee), { id: f, name: d, el: o, css: l, unload: ie, load: ee, isLoaded: mn(n) }; } function $e(e) { "@babel/helpers - typeof"; return $e = 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; }, $e(e); } var it, at, st, dt; function ut(e, t) { return ol(e) || ll(e, t) || nl(e, t) || tl(); } function tl() { 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 nl(e, t) { if (e) { if (typeof e == "string") return ct(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) ? ct(e, t) : void 0; } } function ct(e, t) { (t == null || t > e.length) && (t = e.length); for (var n = 0, l = Array(t); n < t; n++) l[n] = e[n]; return l; } function ll(e, t) { var n = e == null ? null : typeof Symbol < "u" && e[Symbol.iterator] || e["@@iterator"]; if (n != null) { var l, o, u, r, i = [], s = !0, p = !1; try { if (u = (n = n.call(e)).next, t !== 0) for (; !(s = (l = u.call(n)).done) && (i.push(l.value), i.length !== t); s = !0) ; } catch (c) { p = !0, o = c; } finally { try { if (!s && n.return != null && (r = n.return(), Object(r) !== r)) return; } finally { if (p) throw o; } } return i; } } function ol(e) { if (Array.isArray(e)) return e; } function pt(e, t) { var n = Object.keys(e); if (Object.getOwnPropertySymbols) { var l = Object.getOwnPropertySymbols(e); t && (l = l.filter(function(o) { return Object.getOwnPropertyDescriptor(e, o).enumerable; })), n.push.apply(n, l); } return n; } function Me(e) { for (var t = 1; t < arguments.length; t++) { var n = arguments[t] != null ? arguments[t] : {}; t % 2 ? pt(Object(n), !0).forEach(function(l) { rl(e, l, n[l]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : pt(Object(n)).forEach(function(l) { Object.defineProperty(e, l, Object.getOwnPropertyDescriptor(n, l)); }); } return e; } function rl(e, t, n) { return (t = il(t)) in e ? Object.defineProperty(e, t, { value: n, enumerable: !0, configurable: !0, writable: !0 }) : e[t] = n, e; } function il(e) { var t = al(e, "string"); return $e(t) == "symbol" ? t : t + ""; } function al(e, t) { if ($e(e) != "object" || !e) return e; var n = e[Symbol.toPrimitive]; if (n !== void 0) { var l = n.call(e, t); if ($e(l) != "object") return l; throw new TypeError("@@toPrimitive must return a primitive value."); } return (t === "string" ? String : Number)(e); } function Pe(e, t) { return t || (t = e.slice(0)), Object.freeze(Object.defineProperties(e, { raw: { value: Object.freeze(t) } })); } var sl = function(t) { var n = t.dt; return ` .p-hidden-accessible { border: 0; clip: rect(0 0 0 0); height: 1px; margin: -1px; opacity: 0; overflow: hidden; padding: 0; pointer-events: none; position: absolute; white-space: nowrap; width: 1px; } .p-overflow-hidden { overflow: hidden; padding-right: `.concat(n("scrollbar.width"), `; } `); }, dl = {}, ul = {}, I = { name: "base", css: sl, style: Gn, classes: dl, inlineStyles: ul, load: function(t) { var n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, l = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : function(u) { return u; }, o = l(Ce(it || (it = Pe(["", ""])), t)); return C(o) ? el(ge(o), Me({ name: this.name }, n)) : {}; }, loadCSS: function() { var t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}; return this.load(this.css, t); }, loadStyle: function() { var t = this, n = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, l = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : ""; return this.load(this.style, n, function() { var o = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : ""; return V.transformCSS(n.name || t.name, "".concat(o).concat(Ce(at || (at = Pe(["", ""])), l))); }); }, getCommonTheme: function(t) { return V.getCommon(this.name, t); }, getComponentTheme: function(t) { return V.getComponent(this.name, t); }, getDirectiveTheme: function(t) { return V.getDirective(this.name, t); }, getPresetTheme: function(t, n, l) { return V.getCustomPreset(this.name, t, n, l); }, getLayerOrderThemeCSS: function() { return V.getLayerOrderCSS(this.name); }, getStyleSheet: function() { var t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "", n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}; if (this.css) { var l = K(this.css, { dt: re }) || "", o = ge(Ce(st || (st = Pe(["", "", ""])), l, t)), u = Object.entries(n).reduce(function(r, i) { var s = ut(i, 2), p = s[0], c = s[1]; return r.push("".concat(p, '="').concat(c, '"')) && r; }, []).join(" "); return C(o) ? '<style type="text/css" data-primevue-style-id="'.concat(this.name, '" ').concat(u, ">").concat(o, "</style>") : ""; } return ""; }, getCommonThemeStyleSheet: function(t) { var n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}; return V.getCommonStyleSheet(this.name, t, n); }, getThemeStyleSheet: function(t) { var n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, l = [V.getStyleSheet(this.name, t, n)]; if (this.style) { var o = this.name === "base" ? "global-style" : "".concat(this.name, "-style"), u = Ce(dt || (dt = Pe(["", ""])), K(this.style, { dt: re })), r = ge(V.transformCSS(o, u)), i = Object.entries(n).reduce(function(s, p) { var c = ut(p, 2), b = c[0], a = c[1]; return s.push("".concat(b, '="').concat(a, '"')) && s; }, []).join(" "); C(r) && l.push('<style type="text/css" data-primevue-style-id="'.concat(o, '" ').concat(i, ">").concat(r, "</style>")); } return l.join(""); }, extend: function(t) { return Me(Me({}, this), {}, { css: void 0, style: void 0 }, t); } }; function cl() { var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "pc", t = qn(); return "".concat(e).concat(t.replace("v-", "").replaceAll("-", "_")); } var ft = I.extend({ name: "common" }); function Se(e) { "@babel/helpers - typeof"; return Se = 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; }, Se(e); } function pl(e) { return Dt(e) || fl(e) || It(e) || Et(); } function fl(e) { if (typeof Symbol < "u" && e[Symbol.iterator] != null || e["@@iterator"] != null) return Array.from(e); } function he(e, t) { return Dt(e) || ml(e, t) || It(e, t) || Et(); } function Et() { 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 It(e, t) { if (e) { if (typeof e == "string") return mt(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) ? mt(e, t) : void 0; } } function mt(e, t) { (t == null || t > e.length) && (t = e.length); for (var n = 0, l = Array(t); n < t; n++) l[n] = e[n]; return l; } function ml(e, t) { var n = e == null ? null : typeof Symbol < "u" && e[Symbol.iterator] || e["@@iterator"]; if (n != null) { var l, o, u, r, i = [], s = !0, p = !1; try { if (u = (n = n.call(e)).next, t === 0) { if (Object(n) !== n) return; s = !1; } else for (; !(s = (l = u.call(n)).done) && (i.push(l.value), i.length !== t); s = !0) ; } catch (c) { p = !0, o = c; } finally { try { if (!s && n.return != null && (r = n.return(), Object(r) !== r)) return; } finally { if (p) throw o; } } return i; } } function Dt(e) { if (Array.isArray(e)) return e; } function ht(e, t) { var n = Object.keys(e); if (Object.getOwnPropertySymbols) { var l = Object.getOwnPropertySymbols(e); t && (l = l.filter(function(o) { return Object.getOwnPropertyDescriptor(e, o).enumerable; })), n.push.apply(n, l); } return n; } function x(e) { for (var t = 1; t < arguments.length; t++) { var n = arguments[t] != null ? arguments[t] : {}; t % 2 ? ht(Object(n), !0).forEach(function(l) { be(e, l, n[l]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : ht(Object(n)).forEach(function(l) { Object.defineProperty(e, l, Object.getOwnPropertyDescriptor(n, l)); }); } return e; } function be(e, t, n) { return (t = hl(t)) in e ? Object.defineProperty(e, t, { value: n, enumerable: !0, configurable: !0, writable: !0 }) : e[t] = n, e; } function hl(e) { var t = ql(e, "string"); return Se(t) == "symbol" ? t : t + ""; } function ql(e, t) { if (Se(e) != "object" || !e) return e; var n = e[Symbol.toPrimitive]; if (n !== void 0) { var l = n.call(e, t); if (Se(l) != "object") return l; throw new TypeError("@@toPrimitive must return a primitive value."); } return (t === "string" ? String : Number)(e); } var Qe = { 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(t) { E.off("theme:change", this._loadCoreStyles), t || (this._loadCoreStyles(), this._themeChangeListener(this._loadCoreStyles)); } }, dt: { immediate: !0, handler: function(t, n) { var l = this; E.off("theme:change", this._themeScopedListener), t ? (this._loadScopedThemeStyles(t), this._themeScopedListener = function() { return l._loadScopedThemeStyles(t); }, this._themeChangeListener(this._themeScopedListener)) : this._unloadScopedThemeStyles(); } } }, scopedStyleEl: void 0, rootEl: void 0, uid: void 0, $attrSelector: void 0, beforeCreate: function() { var t, n, l, o, u, r, i, s, p, c, b, a = (t = this.pt) === null || t === void 0 ? void 0 : t._usept, d = a ? (n = this.pt) === null || n === void 0 || (n = n.originalValue) === null || n === void 0 ? void 0 : n[this.$.type.name] : void 0, h = a ? (l = this.pt) === null || l === void 0 || (l = l.value) === null || l === void 0 ? void 0 : l[this.$.type.name] : this.pt; (o = h || d) === null || o === void 0 || (o = o.hooks) === null || o === void 0 || (u = o.onBeforeCreate) === null || u === void 0 || u.call(o); var f = (r = this.$primevueConfig) === null || r === void 0 || (r = r.pt) === null || r === void 0 ? void 0 : r._usept, q = f ? (i = this.$primevue) === null || i === void 0 || (i = i.config) === null || i === void 0 || (i = i.pt) === null || i === void 0 ? void 0 : i.originalValue : void 0, k = f ? (s = this.$primevue) === null || s === void 0 || (s = s.config) === null || s === void 0 || (s = s.pt) === null || s === void 0 ? void 0 : s.value : (p = this.$primevue) === null || p === void 0 || (p = p.config) === null || p === void 0 ? void 0 : p.pt; (c = k || q) === null || c === void 0 || (c = c[this.$.type.name]) === null || c === void 0 || (c = c.hooks) === null || c === void 0 || (b = c.onBeforeCreate) === null || b === void 0 || b.call(c), this.$attrSelector = cl(), this.uid = this.$attrs.id || this.$attrSelector.replace("pc", "pv_id_"); }, created: function() { this._hook("onCreated"); }, beforeMount: function() { var t; this.rootEl = Un(Ee(this.$el) ? this.$el : (t = this.$el) === null || t === void 0 ? void 0 : t.parentElement, "[".concat(this.$attrSelector, "]")), this.rootEl && (this.rootEl.$pc = x({ 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._removeThemeListeners(), this._unloadScopedThemeStyles(), this._hook("onUnmounted"); }, methods: { _hook: function(t) { if (!this.$options.hostName) { var n = this._usePT(this._getPT(this.pt, this.$.type.name), this._getOptionValue, "hooks.".concat(t)), l = this._useDefaultPT(this._getOptionValue, "hooks.".concat(t)); n?.(), l?.(); } }, _mergeProps: function(t) { for (var n = arguments.length, l = new Array(n > 1 ? n - 1 : 0), o = 1; o < n; o++) l[o - 1] = arguments[o]; return Ot(t) ? t.apply(void 0, l) : w.apply(void 0, l); }, _load: function() { me.isStyleNameLoaded("base") || (I.loadCSS(this.$styleOptions), this._loadGlobalStyles(), me.setLoadedStyleName("base")), this._loadThemeStyles(); }, _loadStyles: function() { this._load(), this._themeChangeListener(this._load); }, _loadCoreStyles: function() { var t, n; !me.isStyleNameLoaded((t = this.$style) === null || t === void 0 ? void 0 : t.name) && (n = this.$style) !== null && n !== void 0 && n.name && (ft.loadCSS(this.$styleOptions), this.$options.style && this.$style.loadCSS(this.$styleOptions), me.setLoadedStyleName(this.$style.name)); }, _loadGlobalStyles: function() { var t = this._useGlobalPT(this._getOptionValue, "global.css", this.$params); C(t) && I.load(t, x({ name: "global" }, this.$styleOptions)); }, _loadThemeStyles: function() { var t, n; if (!(this.isUnstyled || this.$theme === "none")) { if (!V.isStyleNameLoaded("common")) { var l, o, u = ((l = this.$style) === null || l === void 0 || (o = l.getCommonTheme) === null || o === void 0 ? void 0 : o.call(l)) || {}, r = u.primitive, i = u.semantic, s = u.global, p = u.style; I.load(r?.css, x({ name: "primitive-variables" }, this.$styleOptions)), I.load(i?.css, x({ name: "semantic-variables" }, this.$styleOptions)), I.load(s?.css, x({ name: "global-variables" }, this.$styleOptions)), I.loadStyle(x({ name: "global-style" }, this.$styleOptions), p), V.setLoadedStyleName("common"); } if (!V.isStyleNameLoaded((t = this.$style) === null || t === void 0 ? void 0 : t.name) && (n = this.$style) !== null && n !== void 0 && n.name) { var c, b, a, d, h = ((c = this.$style) === null || c === void 0 || (b = c.getComponentTheme) === null || b === void 0 ? void 0 : b.call(c)) || {}, f = h.css, q = h.style; (a = this.$style) === null || a === void 0 || a.load(f, x({ name: "".concat(this.$style.name, "-variables") }, this.$styleOptions)), (d = this.$style) === null || d === void 0 || d.loadStyle(x({ name: "".concat(this.$style.name, "-style") }, this.$styleOptions), q), V.setLoadedStyleName(this.$style.name); } if (!V.isStyleNameLoaded("layer-order")) { var k, g, m = (k = this.$style) === null || k === void 0 || (g = k.getLayerOrderThemeCSS) === null || g === void 0 ? void 0 : g.call(k); I.load(m, x({ name: "layer-order", first: !0 }, this.$styleOptions)), V.setLoadedStyleName("layer-order"); } } }, _loadScopedThemeStyles: function(t) { var n, l, o, u = ((n = this.$style) === null || n === void 0 || (l = n.getPresetTheme) === null || l === void