UNPKG

vlossom

Version:
1,700 lines (1,699 loc) 359 kB
import { ref as E, readonly as Nn, computed as m, getCurrentScope as mr, onScopeDispose as hr, watch as H, toValue as io, shallowRef as ks, getCurrentInstance as gr, onMounted as It, inject as Me, onBeforeUnmount as Zt, onBeforeMount as ho, nextTick as nt, onUnmounted as Is, provide as qt, defineComponent as Y, createElementBlock as N, openBlock as b, Fragment as ze, renderList as Xe, createBlock as U, Teleport as Yl, resolveDynamicComponent as lt, createApp as yr, h as Ae, toRefs as te, normalizeStyle as R, normalizeClass as Z, withCtx as T, renderSlot as D, Transition as Es, createCommentVNode as x, createElementVNode as j, resolveComponent as B, withKeys as Bn, withModifiers as G, createVNode as oe, useTemplateRef as Pe, resolveDirective as br, withDirectives as ft, createSlots as Ye, createStaticVNode as Sr, toDisplayString as Le, createTextVNode as pt, vShow as yt, cloneVNode as $r, watchEffect as Vs, Comment as wr, KeepAlive as Cr, TransitionGroup as Os, mergeProps as go, normalizeProps as Dt, guardReactiveProps as Rt, reactive as kr, markRaw as _l } from "vue"; function Ir(e, t) { function n(a) { const l = a.target; e.some((r) => l.closest(r)) || t(); } function o() { document.addEventListener("click", n, !0); } function s() { document.removeEventListener("click", n, !0); } return { addClickOutsideListener: o, removeClickOutsideListener: s }; } class Kl { _map = E(/* @__PURE__ */ new Map()); map = Nn(this._map); get size() { return this._map.value.size; } has(t) { return this._map.value.has(t); } get(t) { return this._map.value.get(t) || []; } set(t, n) { this._map.value.set(t, n); } push(t, n) { const o = this._map.value.get(t) || []; this._map.value.set(t, [...o, n]); } remove(t, n) { const o = this._map.value.get(t); if (!o) return; const s = o.filter((a) => a.id !== n); this._updateOrDelete(t, s); } pop(t) { const n = this._map.value.get(t); if (!n || n.length === 0) return; const o = n.slice(0, -1); this._updateOrDelete(t, o); } delete(t) { this._map.value.delete(t); } clear() { this._map.value.clear(); } _updateOrDelete(t, n) { n.length === 0 ? this._map.value.delete(t) : this._map.value.set(t, n); } } class yo { _disabled = E(!1); _readonly = E(!1); _changedObj = E({}); _validObj = E({}); _validateFlag = E(!1); _clearFlag = E(!1); _resetFlag = E(!1); static getDefaultFormStore() { return new yo(); } disabled = m(() => this._disabled.value); setDisabled(t) { this._disabled.value = t; } readonly = m(() => this._readonly.value); setReadonly(t) { this._readonly.value = t; } changedObj = m(() => this._changedObj.value); updateChanged(t, n) { this._changedObj.value[t] = n; } validObj = m(() => this._validObj.value); updateValid(t, n) { this._validObj.value[t] = n; } removeFromForm(t) { delete this._changedObj.value[t], delete this._validObj.value[t]; } validateFlag = m(() => this._validateFlag.value); toggleValidateFlag() { this._validateFlag.value = !this._validateFlag.value; } clearFlag = m(() => this._clearFlag.value); toggleClearFlag() { this._clearFlag.value = !this._clearFlag.value; } resetFlag = m(() => this._resetFlag.value); toggleResetFlag() { this._resetFlag.value = !this._resetFlag.value; } } const De = { error(e, t) { console.error(`[Vlossom] ${e}: ${t}`); }, warning(e, t) { console.warn(`[Vlossom] ${e}: ${t}`); }, propError(e, t, n) { this.error(`${e} property ${t}`, n); }, propWarning(e, t, n) { this.warning(`${e} property ${t}`, n); } }, Er = { async copy(e) { try { return navigator.clipboard ? (await navigator.clipboard.writeText(e), !0) : (De.error("clipboard-util", "Clipboard API is not supported"), !1); } catch (t) { return De.error("clipboard-util", `Failed to copy to clipboard: ${t}`), !1; } } }; function Vr(e, t) { return e === null && t === null ? 0 : e === null ? 1 : t === null ? -1 : typeof e != typeof t ? 0 : typeof e == "string" && typeof t == "string" ? e.localeCompare(t) : typeof e == "number" && typeof t == "number" ? e - t : e instanceof Date && t instanceof Date ? e.getTime() - t.getTime() : typeof e == "boolean" && typeof t == "boolean" ? Number(e) - Number(t) : typeof e == "object" && typeof t == "object" ? JSON.stringify(e).localeCompare(JSON.stringify(t)) : 0; } const Or = { compareValues: Vr }, Tr = { isTouchDevice: () => "ontouchstart" in window || navigator.maxTouchPoints > 0 || navigator.msMaxTouchPoints > 0 || window.matchMedia("(pointer: coarse)").matches }, pn = { isBrowser() { return typeof window < "u"; }, getClientRect(e) { return e.getBoundingClientRect(); }, isScrollableX(e) { const n = getComputedStyle(e).overflowX; return n === "scroll" ? !0 : n === "auto" ? e.scrollWidth > e.clientWidth : !1; }, isScrollableY(e) { const n = getComputedStyle(e).overflowY; return n === "scroll" ? !0 : n === "auto" ? e.scrollHeight > e.clientHeight : !1; } }, Dr = (e) => !!e && e.constructor === Symbol, Rr = Array.isArray, Ts = (e) => !!e && e.constructor === Object, Ar = (e) => e == null || typeof e != "object" && typeof e != "function", Nr = (e) => !!(e && e.constructor && e.call && e.apply), Oo = (e) => { try { return Number(e) === e; } catch { return !1; } }, Br = (e) => Object.prototype.toString.call(e) === "[object Date]", Lr = (e) => { if (e === !0 || e === !1 || e == null) return !0; if (Oo(e)) return e === 0; if (Br(e)) return isNaN(e.getTime()); if (Nr(e) || Dr(e)) return !1; const t = e.length; if (Oo(t)) return t === 0; const n = e.size; return Oo(n) ? n === 0 : Object.keys(e).length === 0; }, Gl = (e, t) => { if (Object.is(e, t)) return !0; if (e instanceof Date && t instanceof Date) return e.getTime() === t.getTime(); if (e instanceof RegExp && t instanceof RegExp) return e.toString() === t.toString(); if (typeof e != "object" || e === null || typeof t != "object" || t === null) return !1; const n = Reflect.ownKeys(e), o = Reflect.ownKeys(t); if (n.length !== o.length) return !1; for (let s = 0; s < n.length; s++) if (!Reflect.has(t, n[s]) || !Gl(e[n[s]], t[n[s]])) return !1; return !0; }, Mr = (e, t, n = (o) => o) => e.reduce((o, s) => (o[t(s)] = n(s), o), {}), Pr = ({ delay: e }, t) => { let n, o = !0; const s = (...a) => { o ? (clearTimeout(n), n = setTimeout(() => { o && t(...a), n = void 0; }, e)) : t(...a); }; return s.isPending = () => n !== void 0, s.cancel = () => { o = !1; }, s.flush = (...a) => t(...a), s; }, zr = ({ interval: e }, t) => { let n = !0, o; const s = (...a) => { n && (t(...a), n = !1, o = setTimeout(() => { n = !0, o = void 0; }, e)); }; return s.isThrottled = () => o !== void 0, s; }, Fr = (e, t = (n) => n === void 0) => e ? Object.keys(e).reduce((o, s) => (t(e[s]) || (o[s] = e[s]), o), {}) : {}, jr = (e) => { if (Ar(e)) return e; if (typeof e == "function") return e.bind({}); const t = new e.constructor(); return Object.getOwnPropertyNames(e).forEach((n) => { t[n] = e[n]; }), t; }, qr = (e, t) => e ? !t || t.length === 0 ? e : t.reduce( (n, o) => (delete n[o], n), { ...e } ) : {}, Zl = (e, t, n) => { const o = t.split(/[\.\[\]]/g); let s = e; for (const a of o) { if (s === null || s === void 0) return n; const l = a.replace(/['"]/g, ""); l.trim() !== "" && (s = s[l]); } return s === void 0 ? n : s; }, Jl = (e, t) => !e || !t ? e ?? t ?? {} : Object.entries({ ...e, ...t }).reduce( (n, [o, s]) => ({ ...n, [o]: Ts(e[o]) ? Jl(e[o], s) : s }), {} ), Wr = (e) => { if (!e) return []; const t = (n, o) => Ts(n) ? Object.entries(n).flatMap( ([s, a]) => t(a, [...o, s]) ) : Rr(n) ? n.flatMap((s, a) => t(s, [...o, `${a}`])) : [o.join(".")]; return t(e, []); }, Ur = (e) => e ? Mr( Wr(e), (t) => t, (t) => Zl(e, t) ) : {}; function Hr(e) { return e === void 0 ? () => { } : typeof e == "function" ? e : () => e; } const un = { throttle: zr, debounce: Pr, toCallable: Hr }; function Ql(e, t) { return mr() ? (hr(e, t), !0) : !1; } const Xr = typeof window < "u" && typeof document < "u"; typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope; const Yr = (e) => e != null, _r = (e, t, n) => Math.min(n, Math.max(t, e)), To = () => { }; function Kr(e) { return Array.isArray(e) ? e : [e]; } const xl = Xr ? window : void 0; function En(e) { var t; const n = io(e); return (t = n?.$el) !== null && t !== void 0 ? t : n; } // @__NO_SIDE_EFFECTS__ function Gr() { const e = ks(!1), t = gr(); return t && It(() => { e.value = !0; }, t), e; } // @__NO_SIDE_EFFECTS__ function ea(e) { const t = /* @__PURE__ */ Gr(); return m(() => (t.value, !!e())); } function Zr(e, t, n = {}) { const { window: o = xl, ...s } = n; let a; const l = /* @__PURE__ */ ea(() => o && "ResizeObserver" in o), r = () => { a && (a.disconnect(), a = void 0); }, i = H(m(() => { const c = io(e); return Array.isArray(c) ? c.map((d) => En(d)) : [En(c)]; }), (c) => { if (r(), l.value && o) { a = new ResizeObserver(t); for (const d of c) d && a.observe(d, s); } }, { immediate: !0, flush: "post" }), u = () => { r(), i(); }; return Ql(u), { isSupported: l, stop: u }; } function ta(e, t, n = {}) { const { root: o, rootMargin: s, threshold: a = 0, window: l = xl, immediate: r = !0 } = n, i = /* @__PURE__ */ ea(() => l && "IntersectionObserver" in l), u = m(() => Kr(io(e)).map(En).filter(Yr)); let c = To; const d = ks(r), f = i.value ? H(() => [ u.value, En(o), io(s), d.value ], ([h, v, S]) => { if (c(), !d.value || !h.length) return; const y = new IntersectionObserver(t, { root: En(v), rootMargin: S, threshold: a }); h.forEach(($) => $ && y.observe($)), c = () => { y.disconnect(), c = To; }; }, { immediate: r, flush: "post" }) : To, p = () => { c(), f(), d.value = !1; }; return Ql(p), { isSupported: i, isActive: d, pause() { c(), d.value = !1; }, resume() { d.value = !0; }, stop: p }; } const hs = { clamp(e, t, n) { return isNaN(e) ? t : _r(e, t, n); } }, X = { assign: Jl, clone: jr, crush: Ur, get: Zl, isEmpty: Lr, isEqual: Gl, isObject: Ts, omit: qr, shake: Fr }, al = { checkValidNumber(e, t, n) { const o = Number(n), s = !isNaN(o) && o >= Number.MIN_SAFE_INTEGER && o <= Number.MAX_SAFE_INTEGER; return s || De.propError(e, t, `invalid ${t} value`), s; } }, Jr = new RegExp("([\\p{Ll}\\d])(\\p{Lu})", "gu"), Qr = new RegExp("(\\p{Lu})([\\p{Lu}][\\p{Ll}])", "gu"), xr = new RegExp("(\\d)\\p{Ll}|(\\p{L})\\d", "u"), ei = /[^\p{L}\d]+/giu, rl = "$1\0$2", il = ""; function na(e) { let t = e.trim(); t = t.replace(Jr, rl).replace(Qr, rl), t = t.replace(ei, "\0"); let n = 0, o = t.length; for (; t.charAt(n) === "\0"; ) n++; if (n === o) return []; for (; t.charAt(o - 1) === "\0"; ) o--; return t.slice(n, o).split(/\0/g); } function ti(e) { const t = na(e); for (let n = 0; n < t.length; n++) { const o = t[n], s = xr.exec(o); if (s) { const a = s.index + (s[1] ?? s[2]).length; t.splice(n, 1, o.slice(0, a), o.slice(a)); } } return t; } function ni(e, t) { const [n, o, s] = li(e, t); return n + o.map(si(t?.locale)).join(t?.delimiter ?? " ") + s; } function oi(e, t) { return ni(e, { delimiter: "-", ...t }); } function si(e) { return e === !1 ? (t) => t.toLowerCase() : (t) => t.toLocaleLowerCase(e); } function li(e, t = {}) { const n = t.split ?? (t.separateNumbers ? ti : na), o = t.prefixCharacters ?? il, s = t.suffixCharacters ?? il; let a = 0, l = e.length; for (; a < e.length; ) { const r = e.charAt(a); if (!o.includes(r)) break; a++; } for (; l > a; ) { const r = l - 1, i = e.charAt(r); if (!s.includes(i)) break; l = r; } return [ e.slice(0, a), n(e.slice(a, l)), e.slice(l) ]; } let ai = (e) => crypto.getRandomValues(new Uint8Array(e)), ri = (e, t, n) => { let o = 256 - 256 % e.length; if (o === 256) { let a = e.length - 1; return (l = t) => { if (!l) return ""; let r = ""; for (; ; ) { let i = n(l), u = l; for (; u--; ) if (r += e[i[u] & a], r.length >= l) return r; } }; } let s = Math.ceil(1.6 * 256 * t / o); return (a = t) => { if (!a) return ""; let l = ""; for (; ; ) { let r = n(s), i = s; for (; i--; ) if (r[i] < o && (l += e[r[i] % e.length], l.length >= a)) return l; } }; }, ii = (e, t = 21) => ri(e, t | 0, ai); const ie = { createID(e = 10) { return ii("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz", e)(); }, convertToString(e) { return typeof e == "string" ? e : typeof e == "object" ? JSON.stringify(e) : String(e); }, toStringSize(e) { const t = String(e); return /^\d+(\.\d+)?$/.test(t) ? `${t}px` : t; }, toFileSizeFormat(e) { if (e === 0) return "0 Bytes"; const t = 1024, n = ["Bytes", "KB", "MB", "GB", "TB"], o = Math.floor(Math.log(e) / Math.log(t)); return `${Math.round(e / Math.pow(t, o) * 100) / 100} ${n[o]}`; }, hash(e) { let t = 0; for (let n = 0; n < e.length; n++) { const o = e.charCodeAt(n); t = (t << 5) - t + o, t = t & t; } return `vs-${Math.abs(t).toString(36)}`; }, kebabCase: oi }; class Jt { _header = E({ position: "relative", height: "" }); _footer = E({ position: "relative", height: "" }); _drawers = E({ left: { isOpen: !1, pushContainer: !1, placement: "left", size: "" }, top: { isOpen: !1, pushContainer: !1, placement: "top", size: "" }, right: { isOpen: !1, pushContainer: !1, placement: "right", size: "" }, bottom: { isOpen: !1, pushContainer: !1, placement: "bottom", size: "" } }); static getDefaultLayoutStore() { return new Jt(); } header = m(() => this._header.value); setHeader(t) { X.isEqual(this._header.value, t) || (this._header.value = t); } footer = m(() => this._footer.value); setFooter(t) { X.isEqual(this._footer.value, t) || (this._footer.value = t); } drawers = m(() => this._drawers.value); setDrawers(t) { this._drawers.value = t; } setDrawer(t) { const n = this._drawers.value[t.placement]; X.isEqual(n, t) || (this._drawers.value = { ...this._drawers.value, [t.placement]: t }); } } class ui { _colorScheme = E({}); _styleSet = E({}); _theme = E("light"); _radiusRatio = E(1); colorScheme = m(() => this._colorScheme.value); setColorScheme(t) { this._colorScheme.value = t; } styleSet = m(() => this._styleSet.value); setStyleSet(t) { this._styleSet.value = t; } theme = m(() => this._theme.value); setTheme(t) { this._theme.value = t; } radiusRatio = m(() => this._radiusRatio.value); setRadiusRatio(t) { isNaN(t) && De.warning("OptionsStore", "Radius ratio should be a number"), (t < 0 || t > 1) && De.warning("OptionsStore", "Radius ratio should be in the range of 0 to 1"), this._radiusRatio.value = hs.clamp(t, 0, 1); } getComponentStyleSet(t, n) { return this._styleSet.value[t]?.[n] || {}; } } const ul = "vlossom:theme-mode", Pn = "vlossom:layout-store", gs = "vlossom:layout-provided", oa = "vlossom:form-store", sa = "vlossom:overlay-open", Nt = "vlossom:overlay-close", cl = "vlossom:alert-ok", dl = "vlossom:confirm-ok", pl = "vlossom:confirm-cancel", fl = "vlossom:prompt-ok", vl = "vlossom:prompt-cancel", Ds = 300, Rs = [ "brown", "red", "orange", "amber", "yellow", "lime", "green", "emerald", "teal", "cyan", "sky", "blue", "indigo", "violet", "purple", "fuchsia", "pink", "rose", "gray" ], gm = [...Rs, "none"], la = ["xs", "sm", "md", "lg", "xl"], ym = ["top", "right", "bottom", "left", "middle"], bm = ["start", "center", "end"], Sm = ["left", "center", "right"], $m = ["top", "middle", "bottom"], Ot = -1; var J = /* @__PURE__ */ ((e) => (e.VsAccordion = "VsAccordion", e.VsAlert = "VsAlert", e.VsAvatar = "VsAvatar", e.VsBar = "VsBar", e.VsBlock = "VsBlock", e.VsButton = "VsButton", e.VsCheckbox = "VsCheckbox", e.VsCheckboxSet = "VsCheckboxSet", e.VsChip = "VsChip", e.VsConfirm = "VsConfirm", e.VsContainer = "VsContainer", e.VsDatePicker = "VsDatePicker", e.VsDimmed = "VsDimmed", e.VsDivider = "VsDivider", e.VsDrawer = "VsDrawer", e.VsExpandable = "VsExpandable", e.VsFileDrop = "VsFileDrop", e.VsFloating = "VsFloating", e.VsFocusTrap = "VsFocusTrap", e.VsFooter = "VsFooter", e.VsForm = "VsForm", e.VsGrid = "VsGrid", e.VsHeader = "VsHeader", e.VsImage = "VsImage", e.VsIndexView = "VsIndexView", e.VsInnerScroll = "VsInnerScroll", e.VsInput = "VsInput", e.VsInputWrapper = "VsInputWrapper", e.VsLabelValue = "VsLabelValue", e.VsLayout = "VsLayout", e.VsLoading = "VsLoading", e.VsMessage = "VsMessage", e.VsModal = "VsModal", e.VsModalNode = "VsModalNode", e.VsModalView = "VsModalView", e.VsGroupedList = "VsGroupedList", e.VsPage = "VsPage", e.VsPagination = "VsPagination", e.VsProgress = "VsProgress", e.VsPrompt = "VsPrompt", e.VsRadio = "VsRadio", e.VsRadioSet = "VsRadioSet", e.VsRender = "VsRender", e.VsResponsive = "VsResponsive", e.VsSearchInput = "VsSearchInput", e.VsSelect = "VsSelect", e.VsSkeleton = "VsSkeleton", e.VsSteps = "VsSteps", e.VsSwitch = "VsSwitch", e.VsTable = "VsTable", e.VsTabs = "VsTabs", e.VsTextarea = "VsTextarea", e.VsTextWrap = "VsTextWrap", e.VsThemeButton = "VsThemeButton", e.VsToast = "VsToast", e.VsToastView = "VsToastView", e.VsToggle = "VsToggle", e.VsTooltip = "VsTooltip", e.VsVisibleRender = "VsVisibleRender", e))(J || {}); class ci { // overlay tuple: [id, { [eventName: callback }] _overlays = E([]); overlays = Nn(this._overlays); constructor() { this.addOverlayCallbackKeyEventListener(); } addOverlayCallbackKeyEventListener() { document.addEventListener("keydown", (t) => { if (this.overlays.value.length === 0) return; const n = this.getLastOverlay(); if (!n) return; const o = `key-${t.code}`, [s, a] = n; a.value[o] && this.run(s, o, t); }); } getLastOverlay() { return this._overlays.value.length > 0 ? this._overlays.value[this._overlays.value.length - 1] : null; } getLastOverlayId() { const t = this.getLastOverlay(); return t ? t[0] : ""; } async run(t, n, ...o) { const s = this._overlays.value.findIndex(([l]) => l === t); if (s === -1) return; const [, a] = this._overlays.value[s]; return await a.value[n]?.(...o); } push(t, n) { return this._overlays.value.push([t, n]), this.run(t, sa), this.run(t, "open"); } pop(...t) { const n = this.getLastOverlay(); if (!n) return; const [o] = n; this.run(o, Nt, ...t); const s = this.run(o, "close", ...t); return this._overlays.value.pop(), s; } remove(t, ...n) { const o = this._overlays.value.findIndex(([l]) => l === t); if (o === -1) return; const [s] = this._overlays.value[o]; this.run(s, Nt, ...n); const a = this.run(s, "close", ...n); return this._overlays.value.splice(o, 1), a; } clear(...t) { for (; this._overlays.value.length > 0; ) this.pop(...t); } } class di { _overlayViewMap = E(/* @__PURE__ */ new Map()); overlayViewMap = Nn(this._overlayViewMap); push(t, n, o) { this._overlayViewMap.value.has(t) || this._overlayViewMap.value.set(t, { container: n, component: o }); } clear() { this._overlayViewMap.value.clear(); } delete(t) { this._overlayViewMap.value.delete(t); } } const ml = "8px"; class pi { _locks = /* @__PURE__ */ new Map(); lock(t, n) { const o = this._locks.get(n); if (o) { o.owners.add(t); return; } const s = { owners: /* @__PURE__ */ new Set([t]), original: this._capture(n) }; this._locks.set(n, s), this._apply(n); } unlock(t, n) { const o = this._locks.get(n); o && (o.owners.delete(t), !(o.owners.size > 0) && (this._locks.delete(n), this._restore(n, o.original))); } clear() { this._locks.clear(); } _capture(t) { return { overflow: t.style.overflow, paddingRight: t.style.paddingRight, paddingBottom: t.style.paddingBottom }; } _apply(t) { t.style.overflow = "hidden", !(pn.isBrowser() && Tr.isTouchDevice()) && (t.scrollHeight >= t.clientHeight && (t.style.paddingRight = ml), t.scrollWidth >= t.clientWidth && (t.style.paddingBottom = ml)); } _restore(t, n) { t.style.overflow = n.overflow, t.style.paddingRight = n.paddingRight, t.style.paddingBottom = n.paddingBottom; } } const fi = new ui(), vi = new ci(), mi = new di(), hi = new pi(), gi = new Kl(), yi = new Kl(); function aa() { return gi; } function As() { return fi; } function zn() { return vi; } function Ns() { return mi; } function bi() { return hi; } function no() { return yi; } function Ie(e, t) { const n = As(), o = m(() => { if (t.value !== "none") return t.value || n.colorScheme.value[e] || n.colorScheme.value.default || void 0; }), s = m(() => `vs-cs-${o.value || "default"}`); return { computedColorScheme: o, colorSchemeClass: s }; } function Si(e) { const t = E(-1), n = E(null); function o() { const u = e.value?.querySelectorAll("[data-focusable]"); return u ? Array.from(u) : []; } function s(u) { if (u < 0) { t.value = -1; return; } const c = o(); if (u >= c.length) { t.value = c.length - 1; return; } t.value = u; } function a(u) { if (!e.value) return; const c = u.target.closest("[data-focusable]"); if (!c || c === n.value) return; const f = o().indexOf(c); f !== -1 && s(f); } const l = un.throttle({ interval: 25 }, a); function r() { e.value?.addEventListener("mousemove", l); } function i() { e.value?.removeEventListener("mousemove", l); } return H(t, () => { if (!e.value) return; if (n.value && n.value.classList.remove("vs-focusable-active"), t.value === -1) { n.value = null; return; } const u = o(); if (u.length === 0) return; const c = u[t.value]; c && (c.classList.add("vs-focusable-active"), n.value = c); }), { focusIndex: Nn(t), currentFocusableElement: Nn(n), updateFocusIndex: s, getFocusableElements: o, addMouseMoveListener: r, removeMouseMoveListener: i }; } function $i(e, t, n, o, s, a) { const l = Me( oa, yo.getDefaultFormStore() // for no provide error ); return H(n, () => { l.updateChanged(e.value, n.value); }), H(t, () => { l.updateValid(e.value, t.value); }), H(l.validateFlag, o), H(l.clearFlag, s), H(l.resetFlag, a), It(() => { l.updateChanged(e.value, n.value), l.updateValid(e.value, t.value); }), H(e, (r, i) => { l.removeFromForm(i), l.updateChanged(r, n.value), l.updateValid(r, t.value); }), Zt(() => { l.removeFromForm(e.value); }), { formDisabled: l.disabled, formReadonly: l.readonly }; } function wi(e, t, n) { const o = E([]), s = E(!1); async function a() { o.value = []; const r = []; if (t.value.forEach((u) => { if (typeof u == "function") { const c = u(e.value); c instanceof Promise ? r.push(c) : o.value.push(c); } else o.value.push(u); }), r.length === 0) return; const i = await Promise.all(r); o.value.push(...i); } H(t, a, { deep: !0 }); const l = m(() => s.value ? [...o.value, ...n.value] : o.value); return { showRuleMessages: s, computedMessages: l, checkMessages: a }; } function Ci(e, t, n, o) { const s = m(() => o.value ? t.value : [...n.value, ...t.value]), a = E([]); async function l() { a.value = []; const r = []; if (s.value.forEach((u) => { const c = u(e.value); c && (c instanceof Promise ? r.push(c) : a.value.push({ state: "error", text: c })); }), r.length === 0) return; const i = (await Promise.all(r)).reduce((u, c) => (c && u.push({ state: "error", text: c }), u), []); a.value.push(...i); } return H(s, l, { deep: !0 }), { ruleMessages: a, checkRules: l }; } function Et(e, t) { const { emit: n } = e, { inputValue: o, modelValue: s, id: a = E(""), disabled: l = E(!1), readonly: r = E(!1), messages: i = E([]), rules: u = E([]), defaultRules: c = E([]), noDefaultRules: d = E(!1), state: f = E("idle"), callbacks: p = {} } = t, h = `vs-input-${ie.createID()}`, v = m(() => a.value || h), S = E(!1), y = ks(o.value), { ruleMessages: $, checkRules: g } = Ci(o, u, c, d), { computedMessages: w, checkMessages: O, showRuleMessages: I } = wi(o, i, $); function P(q, ne) { return q instanceof File && ne instanceof File ? q === ne : Array.isArray(q) && Array.isArray(ne) && q.some((ce) => ce instanceof File) ? q.length !== ne.length ? !1 : q.every((ce, Ee) => ce === ne[Ee]) : X.isEqual(q, ne); } const k = m(() => S.value && !P(o.value, y.value)); H( o, (q, ne) => { P(q, ne) || (n("update:modelValue", q), p.onChange && p.onChange(q, ne), O(), g(), S.value && (I.value = !0, n("change", q))); }, { deep: !0 } ), H( s, (q) => { P(q, o.value) || (o.value = q); }, { deep: !0 } ); const C = m(() => $.value.length === 0); H(C, () => { n("update:valid", C.value); }), ho(() => { p.onBeforeMount && p.onBeforeMount(); }), It(() => { p.onMounted && p.onMounted(), O(), g(), nt(() => { y.value = X.clone(o.value), S.value = !0; }); }), Zt(() => { p.onBeforeUnmount && p.onBeforeUnmount(); }), Is(() => { p.onUnmounted && p.onUnmounted(); }); const L = E(!1); function M() { return I.value = !0, C.value || (L.value = !L.value), C.value; } function V() { const q = o.value; p.onClear && p.onClear(), n("clear", q), nt(() => { I.value = !1; }); } function A() { o.value = X.clone(y.value), nt(() => { I.value = !1; }); } const { formDisabled: F, formReadonly: Q } = $i(v, C, k, M, V, A), se = m(() => l.value || F.value), de = m(() => r.value || Q.value); H(k, () => { n("update:changed", k.value); }); const W = m(() => I.value && !C.value ? "error" : f.value); return { changed: k, valid: C, shake: L, computedMessages: w, showRuleMessages: I, validate: M, clear: V, reset: A, computedId: v, computedDisabled: se, computedReadonly: de, computedState: W }; } function ra(e, t) { function n(s) { if (X.isObject(s)) { if (e.value) { const a = X.get(s, e.value); return a ? typeof a == "string" ? a : JSON.stringify(a) : (De.error( "option-label", `${e.value} is not found in option: ${JSON.stringify(s)}` ), JSON.stringify(s)); } return JSON.stringify(s); } return s + ""; } function o(s) { if (X.isObject(s) && t.value) { const a = X.get(s, t.value); return a === void 0 ? (De.error("option-value", `${t.value} is not found in option: ${JSON.stringify(s)}`), s) : a; } return s; } return { getOptionLabel: n, getOptionValue: o }; } function Bs(e, t, n, o, s = E(!1)) { const { getOptionLabel: a, getOptionValue: l } = ra(n, o); return H(t, (r, i) => { X.isEqual(r, i) || (s.value && Array.isArray(e.value) ? e.value = e.value.filter((u) => r.some((c) => X.isEqual(l(c), u))) : r.find((c) => X.isEqual(l(c), e.value)) || (e.value = null)); }), { getOptionLabel: a, getOptionValue: l }; } function bo(e) { const t = Me(gs, !1); return qt(gs, !1), { isLayoutChild: m(() => e.value && t) }; } function Ls(e, t) { const n = E(0); function o(v) { return v < 0 || v > e.value.length - 1; } function s(v) { return n.value === v; } function a(v) { return !t || t.value === void 0 ? !1 : typeof t.value == "boolean" ? t.value : t.value(e.value[v], v); } function l(v) { return v < n.value; } function r() { return !t || t.value === void 0 ? !1 : typeof t.value == "boolean" ? t.value : e.value.every((v, S) => a(S)); } function i(v) { if (o(v)) return Ot; if (!a(v)) return v; for (let S = v + 1; S < e.value.length; S++) if (!a(S)) return S; return Ot; } function u(v) { if (o(v)) return Ot; if (!a(v)) return v; for (let S = v - 1; S >= 0; S--) if (!a(S)) return S; return Ot; } function c(v) { if (o(v)) { n.value = Ot; return; } r() || a(v) || (n.value = v); } function d(v) { o(v) ? n.value = Ot : n.value = v; } const f = m(() => { const v = i(0); return n.value === v; }), p = m(() => { const v = u(e.value.length - 1); return n.value === v; }); function h(v, S) { const y = { prev: S ? "ArrowUp" : "ArrowLeft", next: S ? "ArrowDown" : "ArrowRight" }; if (v.key === y.prev) { if (f.value) return; v.preventDefault(), c(u(n.value - 1)); } else if (v.key === y.next) { if (p.value) return; v.preventDefault(), c(i(n.value + 1)); } else v.key === "Home" ? (v.preventDefault(), c(i(0))) : v.key === "End" && (v.preventDefault(), c(u(e.value.length - 1))); } return H( () => e.value.length, () => { o(n.value) && (n.value = Ot); } ), { selectedIndex: n, isSelected: s, isDisabled: a, isAllDisabled: r, isPrevious: l, findActiveIndexForwardFrom: i, findActiveIndexBackwardFrom: u, selectIndex: c, syncIndex: d, handleKeydown: h, isFirstEdge: f, isLastEdge: p }; } function ki(e, t, n, o) { const { getOptionLabel: s, getOptionValue: a } = ra(t, n); return { computedOptions: m(() => e.value.map((r, i) => { const u = s(r), c = a(r); return { id: ie.hash(u + i), // unique id for each option item: r, label: u, value: c, index: i, disabled: typeof o.value == "function" ? o.value(r, i, e.value) : o.value }; })) }; } function So(e, t = E({})) { const n = ie.createID(), o = m(() => e.value || n), s = zn(), a = E(!1), l = E(!1); function r() { a.value = !0; } function i() { a.value = !1; } return H(a, (u) => { u ? s.push(o.value, t) : (l.value = !0, s.remove(o.value), setTimeout(() => { l.value = !1; }, Ds)); }), { overlayId: o, isActivated: a, isUnmounting: l, activate: r, deactivate: i }; } function Ii() { function e(n, o = {}) { const s = document.createElement("div"); return s.setAttribute("id", n), s.style.position = "absolute", s.style.top = "0", s.style.left = "0", s.style.width = o.width ?? "100%", s.style.height = o.height ?? "100%", s.style.pointerEvents = o.pointerEvents ?? "none", s.style.zIndex = (o.zIndex ?? 5e3).toString(), s; } function t(n, o, s = {}) { const a = n.querySelector(o); if (a) return a; const l = e(o.replace("#", ""), s); return n.appendChild(l), l; } return { appendOverlayDom: t }; } function Ei(e, t) { const n = E(!1), o = E(null); let s = null, a = null; function l(d, f, p, h, v) { switch (d) { case "start": return f; case "end": return p - v; case "center": return f + h / 2 - v / 2; default: throw Error("Align is Invalid Value"); } } function r(d, f, p, h, v) { switch (d) { case "start": return f; case "end": return p - v; case "center": return f + h / 2 - v / 2; default: throw Error("Align is Invalid Value"); } } function i({ placement: d = "top", align: f = "center", margin: p = 0, followWidth: h = !1 }) { const v = document.querySelector(e); if (!v || !t.value) return; const { top: S, right: y, bottom: $, left: g, width: w, height: O } = pn.getClientRect(v), { width: I, height: P } = pn.getClientRect(t.value); d === "bottom" && $ + P > window.innerHeight ? o.value = window.innerHeight - $ < S ? "top" : "bottom" : d === "top" && S - P < 0 ? o.value = window.innerHeight - $ > S ? "bottom" : "top" : d === "left" && g - I < 0 ? o.value = window.innerWidth - y > g ? "right" : "left" : d === "right" && y + I > window.innerWidth ? o.value = window.innerWidth - y < g ? "left" : "right" : d === "middle" ? o.value = "middle" : o.value = d; let k, C; switch (o.value) { case "top": k = l(f, g, y, w, I), C = S - P - p; break; case "right": k = y + p, C = r(f, S, $, O, P); break; case "bottom": k = l(f, g, y, w, I), C = $ + p; break; case "left": k = g - I - p, C = r(f, S, $, O, P); break; case "middle": k = l(f, g, y, w, I), C = S + O / 2 - P / 2; break; default: throw Error("Placement is Invalid Value"); } const L = window.scrollX || document.documentElement.scrollLeft || 0, M = window.scrollY || document.documentElement.scrollTop || 0; t.value.style.left = `${k + L}px`, t.value.style.top = `${C + M}px`, h && (t.value.style.width = `${w}px`); } function u(d = {}) { n.value || (n.value = !0, nt(() => { try { const f = document.querySelector(e); if (!f || !t.value) return; t.value.style.display = "block", t.value.style.position = "absolute", i(d), s = un.throttle( { interval: 30 }, i.bind(null, d) ), window && window.ResizeObserver !== void 0 && (a = new ResizeObserver(s), a.observe(f), a.observe(t.value)), document.addEventListener("scroll", s, !0), window.addEventListener("resize", s, !0); } catch (f) { De.error("targetElement positioning", f); } })); } function c() { n.value && (s && (a?.disconnect(), document.removeEventListener("scroll", s, !0), window.removeEventListener("resize", s, !0)), n.value = !1); } return { isVisible: n, computedPlacement: o, appear: u, disappear: c }; } function Vi(e = "body") { const t = document.querySelector(e), n = ie.createID(), o = bi(), s = E(!1); function a() { !t || s.value || (s.value = !0, o.lock(n, t)); } function l() { !t || !s.value || (s.value = !1, o.unlock(n, t)); } return { isLocked: s, lock: a, unlock: l }; } function et(e) { return { sizeClass: m(() => e.value ? `vs-${e.value}` : "") }; } function Ht(e) { const t = m(() => ["info", "success", "error", "warning"].includes(e.value)), n = m(() => t.value ? { "vs-stated": t.value, [`vs-state-${e.value}`]: t.value } : {}), o = m(() => t.value ? { "vs-state-box": t.value, ...n.value } : {}); return { isStated: t, stateClasses: n, stateBoxClasses: o }; } function ia(e) { function t(n) { if (Object.keys(e.value).length === 0) return n; let o = n; return e.value.capitalize && (o = n.charAt(0).toUpperCase() + n.slice(1)), e.value.lower && (o = n.toLowerCase()), e.value.upper && (o = n.toUpperCase()), o; } return { modifyStringValue: t }; } function re(e, t, n = E({}), o = E({})) { const s = m(() => { let r = {}; t.value && (typeof t.value == "string" ? r = As().getComponentStyleSet(t.value, e) : r = t.value); const i = X.shake(n.value), u = X.shake(o.value), c = X.assign(i, r); return X.assign(c, u); }), a = m(() => { const r = ie.kebabCase(e), i = {}; for (const [u, c] of Object.entries(s.value)) !u.startsWith("$") || X.isObject(c) || c != null && (i[`--${r}-${u.slice(1)}`] = c); return i; }), l = m(() => { const r = {}; for (const [i, u] of Object.entries(s.value)) i.startsWith("$") || u != null && (r[i] = u); return r; }); return { componentStyleSet: s, styleSetVariables: a, componentInlineStyle: l }; } function ua(e, t, n, o) { const s = m(() => !Array.isArray(t.value)); function a() { return s.value ? [] : t.value; } function l(p, h) { return X.isEqual(p, h); } function r(p) { return p.some((h) => l(h, n.value)); } const i = m(() => e.value ? s.value ? !1 : r(t.value) : l(t.value, n.value)); function u() { return e.value ? a() : l(t.value, n.value) ? n.value : o.value; } function c() { if (e.value) { if (s.value) { De.warning("vaalue-matcher", "modelValue is not array"); return; } r(t.value) || t.value.push(n.value); } } function d(p) { if (e.value) { const h = a(); return p ? r(h) ? h : [...h, n.value] : h.filter((v) => !l(v, n.value)); } return p ? n.value : o.value; } function f() { return e.value ? [] : o.value; } return { isMatched: i, getInitialValue: u, getUpdatedValue: d, getClearedValue: f, addTrueValue: c }; } const ca = "vs-scroll-shadow", Do = "scroll-state", ys = /* @__PURE__ */ new WeakMap(); function hl(e) { return !!(pn.isScrollableX(e) || pn.isScrollableY(e)); } function gl(e) { const t = e.style.containerType, n = getComputedStyle(e).getPropertyValue("container-type").trim(); if (ys.set(e, t), !n.includes(Do)) { const o = n && n !== "normal" ? `${n} ${Do}` : Do; e.style.containerType = o; } e.classList.add(ca); } function yl(e) { e.classList.remove(ca); const t = ys.get(e); t ? e.style.containerType = t : e.style.removeProperty("container-type"), ys.delete(e); } const Oi = { mounted(e, t) { t.value !== !1 && hl(e) && gl(e); }, updated(e, t) { if (t.value !== t.oldValue) { if (t.value === !1) { yl(e); return; } hl(e) && gl(e); } }, unmounted(e) { yl(e); } }, Ti = Y({ name: "OverlayWrapper", setup() { const e = Ns(); return { overlayViews: m(() => Array.from(e.overlayViewMap.value.values())) }; } }), ee = (e, t) => { const n = e.__vccOpts || e; for (const [o, s] of t) n[o] = s; return n; }, Di = { id: "vs-overlay-wrapper" }; function Ri(e, t, n, o, s, a) { return b(), N("div", Di, [ (b(!0), N(ze, null, Xe(e.overlayViews, (l) => (b(), U(Yl, { key: l.container, to: l.container }, [ (b(), U(lt(l.component), { container: l.container }, null, 8, ["container"])) ], 8, ["to"]))), 128)) ]); } const Ai = /* @__PURE__ */ ee(Ti, [["render", Ri]]); let Hn = null; function Ni(e) { if (Hn) return; const t = document.createElement("div"); t.id = "vs-overlay-container", t.style.position = "absolute", t.style.top = "0", t.style.left = "0", t.style.width = "0", t.style.height = "0", document.body.appendChild(t), Hn = yr({ name: "OverlayApp", setup() { return () => Ae(Ai); } }), Bi(e, Hn), Hn.mount(t); } function Bi(e, t) { const n = e?._context, o = t?._context; if (!o || !n) return; o.components = Object.create(n.components), o.directives = Object.create(n.directives), o.provides = Object.create(n.provides); const s = o.config.globalProperties; o.config.globalProperties = new Proxy(s, { get(a, l, r) { return Reflect.has(a, l) ? Reflect.get(a, l, r) : Reflect.get(n.config.globalProperties, l); }, has(a, l) { return Reflect.has(a, l) || Reflect.has(n.config.globalProperties, l); }, set(a, l, r, i) { return Reflect.set(a, l, r, i); }, getOwnPropertyDescriptor(a, l) { return Object.getOwnPropertyDescriptor(a, l) ?? Object.getOwnPropertyDescriptor(n.config.globalProperties, l); }, ownKeys(a) { return Array.from( /* @__PURE__ */ new Set([...Reflect.ownKeys(a), ...Reflect.ownKeys(n.config.globalProperties)]) ); } }), Object.defineProperty(t.config, "errorHandler", { configurable: !0, enumerable: !0, get: () => e.config.errorHandler, set: () => { } }), Object.defineProperty(t.config, "warnHandler", { configurable: !0, enumerable: !0, get: () => e.config.warnHandler, set: () => { } }); } function Ms() { return { circle: { type: Boolean, default: !1 }, disabled: { type: Boolean, default: !1 }, ghost: { type: Boolean, default: !1 }, loading: { type: Boolean, default: !1 }, outline: { type: Boolean, default: !1 }, primary: { type: Boolean, default: !1 }, responsive: { type: Boolean, default: !1 }, size: { type: String, default: "md" }, type: { type: String, default: "button" } }; } function da(e = { placement: "bottom", align: "start", margin: 5 }) { return { target: { type: String, required: !0, default: "" }, align: { type: String, default: e.align }, disabled: { type: Boolean, default: !1 }, enterDelay: { type: [String, Number], default: 0 }, leaveDelay: { type: [String, Number], default: 0 }, margin: { type: [String, Number], default: e.margin }, noAnimation: { type: Boolean, default: !1 }, placement: { type: String, default: e.placement } }; } function pa() { return { disabled: { type: Boolean, default: !1 }, hidden: { type: Boolean, default: !1 }, id: { type: String, default: "" }, label: { type: String, default: "" }, noLabel: { type: Boolean, default: !1 }, noMessages: { type: Boolean, default: !1 }, required: { type: Boolean, default: !1 } }; } function Vt(...e) { return X.omit( { ...pa(), messages: { type: Array, default: () => [] }, name: { type: String, default: "" }, noDefaultRules: { type: Boolean, default: !1 }, placeholder: { type: String, default: "" }, readonly: { type: Boolean, default: !1 }, rules: { type: Array, default: () => [] }, state: { type: String, default: "idle" }, // v-model changed: { type: Boolean, default: !1 }, valid: { type: Boolean, default: !1 } }, e ); } function $o() { return { layout: { type: Boolean, default: !1 } }; } function Fn(e, t = {}) { const { minDefault: n = 0, maxDefault: o = Number.MAX_SAFE_INTEGER } = t; return { min: { type: [Number, String], default: n, validator: (s) => al.checkValidNumber(e, "min", s) }, max: { type: [Number, String], default: o, validator: (s) => al.checkValidNumber(e, "max", s) } }; } function Ps() { return { options: { type: Array, default: () => [] }, optionLabel: { type: String, default: "" }, optionValue: { type: String, default: "" } }; } function fa() { return { groupBy: { type: Function, default: null }, groupOrder: { type: Array, default: () => [] } }; } function zs() { return { callbacks: { type: Object, default: () => ({}) }, dimClose: { type: Boolean, default: !1 }, dimmed: { type: Boolean, default: !1 }, escClose: { type: Boolean, default: !1 }, focusLock: { type: Boolean, default: !1 }, hideScroll: { type: Boolean, default: !1 }, id: { type: String, default: "" } }; } function Fs() { return { position: { type: String } }; } function Ge() { return { width: { type: [String, Number, Object] }, grid: { type: [String, Number, Object] } }; } function va() { return { gridSize: { type: [Number, String] }, columnGap: { type: [Number, String] }, rowGap: { type: [Number, String] } }; } function ma() { return { search: { type: [Boolean, Object], default: !1, validator: (e) => typeof e == "boolean" ? !0 : !X.isEmpty(e) } }; } function $e() { return { colorScheme: { type: String } }; } function ue() { return { styleSet: { type: [String, Object] } }; } function qe(e) { return e != null && e !== ""; } function Li(e, t) { const n = m(() => { const s = []; if (qe(e.value) && X.isObject(e.value)) { const { sm: a, md: l, lg: r, xl: i } = e.value, u = [ ...qe(a) ? ["vs-width-sm"] : [], ...qe(l) ? ["vs-width-md"] : [], ...qe(r) ? ["vs-width-lg"] : [], ...qe(i) ? ["vs-width-xl"] : [] ]; s.push(...u); } if (qe(t.value) && X.isObject(t.value)) { const { sm: a, md: l, lg: r, xl: i } = t.value, u = [ ...qe(a) ? ["vs-grid-sm"] : [], ...qe(l) ? ["vs-grid-md"] : [], ...qe(r) ? ["vs-grid-lg"] : [], ...qe(i) ? ["vs-grid-xl"] : [] ]; s.push(...u); } return s; }), o = m(() => { const s = {}; if (qe(e.value)) if (X.isObject(e.value)) { const { xs: a, sm: l, md: r, lg: i, xl: u } = e.value, c = { ...qe(a) && { "--vs-width-xs": ie.toStringSize(a) }, ...qe(l) && { "--vs-width-sm": ie.toStringSize(l) }, ...qe(r) && { "--vs-width-md": ie.toStringSize(r) }, ...qe(i) && { "--vs-width-lg": ie.toStringSize(i) }, ...qe(u) && { "--vs-width-xl": ie.toStringSize(u) } }; Object.assign(s, c); } else s.width = ie.toStringSize(e.value); if (qe(t.value)) if (X.isObject(t.value)) { const { xs: a, sm: l, md: r, lg: i, xl: u } = t.value, c = { ...qe(a) && { "--vs-grid-xs": a?.toString() }, ...qe(l) && { "--vs-grid-sm": l?.toString() }, ...qe(r) && { "--vs-grid-md": r?.toString() }, ...qe(i) && { "--vs-grid-lg": i?.toString() }, ...qe(u) && { "--vs-grid-xl": u?.toString() } }; Object.assign(s, c); } else { const a = { "--vs-grid-xs": t.value?.toString() }; Object.assign(s, a); } return s; }); return { responsiveClasses: n, responsiveStyles: o }; } const Mi = J.VsResponsive, Pi = Y({ name: Mi, props: { ...Ge(), tag: { type: String, default: "div" } }, setup(e) { const { width: t, grid: n } = te(e), { responsiveClasses: o, responsiveStyles: s } = Li(t, n); return { responsiveClasses: o, responsiveStyles: s }; } }); function zi(e, t, n, o, s, a) { return b(), U(lt(e.tag), { class: Z(["vs-responsive", e.responsiveClasses]), style: R(e.responsiveStyles) }, { default: T(() => [ D(e.$slots, "default") ]), _: 3 }, 8, ["class", "style"]); } const Lt = /* @__PURE__ */ ee(Pi, [["render", zi]]), Xn = J.VsExpandable, Fi = Y({ name: Xn, props: { ...ue(), open: { type: Boolean, required: !0, default: !1 }, size: { type: String, default: "md" } }, setup(e) { const { styleSet: t, size: n } = te(e), { componentInlineStyle: o } = re(Xn, t), { sizeClass: s } = et(n); function a(u) { const c = u; c.style.height = "0", c.style.opacity = "0"; } function l(u, c) { const d = u, f = d.querySelector(".vs-expandable-content"); if (!f) { De.warning(Xn, "content element not found"), c(); return; } d.style.height = f.offsetHeight + "px", d.style.opacity = "1"; function p() { d.removeEventListener("transitionend", p), d.style.height = "auto", c(); } d.addEventListener("transitionend", p); } function r(u) { const c = u, d = c.querySelector(".vs-expandable-content"); if (!d) { De.warning(Xn, "content element not found"); return; } c.style.height = d.offsetHeight + "px"; } function i(u, c) { const d = u; d.offsetHeight, d.style.height = "0", d.style.opacity = "0"; function f() { d.removeEventListener("transitionend", f), c(); } d.addEventListener("transitionend", f); } return { sizeClass: s, componentInlineStyle: o, beforeEnter: a, enter: l, beforeLeave: r, leave: i }; } }); function ji(e, t, n, o, s, a) { return b(), U(Es, { name: "vs-expand", onBeforeEnter: e.beforeEnter, onEnter: e.enter, onBeforeLeave: e.beforeLeave, onLeave: e.leave }, { default: T(() => [ e.open ? (b(), N("div", { key: 0, class: Z(["vs-expandable-wrapper", e.sizeClass]) }, [ j("div", { class: "vs-expandable-content", style: R(e.componentInlineStyle) }, [ D(e.$slots, "default") ], 4) ], 2)) : x("", !0) ]), _: 3 }, 8, ["onBeforeEnter", "onEnter", "onBeforeLeave", "onLeave"]); } const js = /* @__PURE__ */ ee(Fi, [["render", ji]]), Ro = J.VsAccordion, qi = Y({ name: Ro, components: { VsResponsive: Lt, VsExpandable: js }, props: { ...$e(), ...Ge(), ...ue(), disabled: { type: Boolean, default: !1 }, open: { type: Boolean, default: !1 }, primary: { type: Boolean, default: !1 }, size: { type: String, default: "md" }, // v-model modelValue: { type: Boolean, default: !1 } }, emits: ["update:modelValue", "toggle"], // expose: ['toggle'], setup(e, { emit: t }) { const { colorScheme: n, styleSet: o, open: s, modelValue: a, disabled: l, primary: r, size: i } = te(e), { colorSchemeClass: u } = Ie(Ro, n), { componentStyleSet: c, styleSetVariables: d, componentInlineStyle: f } = re( Ro, o ), p = E(s.value || a.value), { sizeClass: h } = et(i), v = m(() => ({ "vs-focus-visible": !l.value, "vs-disabled": l.value, "vs-primary": r.value, [h.value]: !!h.value })); function S() { l.value || (p.value = !p.value); } return H(a, (y) => { p.value = y; }), H(p, (y) => {