UNPKG

shadcn-react

Version:
1,922 lines (1,921 loc) 630 kB
import { jsx as x, jsxs as Se, Fragment as Wt } from "react/jsx-runtime"; import * as w from "react"; import _, { createContext as wt, useMemo as Jt, createElement as y, useContext as St, useCallback as ve, forwardRef as k, Children as Pn, isValidElement as Fo, cloneElement as Js, Fragment as gn, useRef as ee, useEffect as pe, useState as ue, useLayoutEffect as ra, useReducer as Il } from "react"; import { d as Ll, a as dr, E as Fl, e as Xr, c as oa, C as Vl, A as Ph, f as Eh, X as zl, S as Dh, M as Nh, G as Mh, b as Th, g as Ah } from "./x-lidj0hpJ.js"; import { c as Rh, R as kh, T as Oh, L as Ih } from "./ResponsiveContainer-Fx4iosBf.js"; import * as Lh from "react-dom"; import Bl, { flushSync as Wl, createPortal as Hl } from "react-dom"; function N() { return N = Object.assign ? Object.assign.bind() : function(e) { for (var n = 1; n < arguments.length; n++) { var t = arguments[n]; for (var r in t) Object.prototype.hasOwnProperty.call(t, r) && (e[r] = t[r]); } return e; }, N.apply(this, arguments); } function Fh(e, n) { const t = /* @__PURE__ */ wt(n); function r(a) { const { children: s, ...i } = a, c = Jt( () => i, Object.values(i) ); return /* @__PURE__ */ y(t.Provider, { value: c }, s); } function o(a) { const s = St(t); if (s) return s; if (n !== void 0) return n; throw new Error(`\`${a}\` must be used within \`${e}\``); } return r.displayName = e + "Provider", [ r, o ]; } function Ge(e, n = []) { let t = []; function r(a, s) { const i = /* @__PURE__ */ wt(s), c = t.length; t = [ ...t, s ]; function l(d) { const { scope: f, children: p, ...m } = d, h = (f == null ? void 0 : f[e][c]) || i, v = Jt( () => m, Object.values(m) ); return /* @__PURE__ */ y(h.Provider, { value: v }, p); } function u(d, f) { const p = (f == null ? void 0 : f[e][c]) || i, m = St(p); if (m) return m; if (s !== void 0) return s; throw new Error(`\`${d}\` must be used within \`${a}\``); } return l.displayName = a + "Provider", [ l, u ]; } const o = () => { const a = t.map((s) => /* @__PURE__ */ wt(s)); return function(i) { const c = (i == null ? void 0 : i[e]) || a; return Jt( () => ({ [`__scope${e}`]: { ...i, [e]: c } }), [ i, c ] ); }; }; return o.scopeName = e, [ r, Vh(o, ...n) ]; } function Vh(...e) { const n = e[0]; if (e.length === 1) return n; const t = () => { const r = e.map( (o) => ({ useScope: o(), scopeName: o.scopeName }) ); return function(a) { const s = r.reduce((i, { useScope: c, scopeName: l }) => { const d = c(a)[`__scope${l}`]; return { ...i, ...d }; }, {}); return Jt( () => ({ [`__scope${n.scopeName}`]: s }), [ s ] ); }; }; return t.scopeName = n.scopeName, t; } function zh(e, n) { typeof e == "function" ? e(n) : e != null && (e.current = n); } function aa(...e) { return (n) => e.forEach( (t) => zh(t, n) ); } function $e(...e) { return ve(aa(...e), e); } const kt = /* @__PURE__ */ k((e, n) => { const { children: t, ...r } = e, o = Pn.toArray(t), a = o.find(Bh); if (a) { const s = a.props.children, i = o.map((c) => c === a ? Pn.count(s) > 1 ? Pn.only(null) : /* @__PURE__ */ Fo(s) ? s.props.children : null : c); return /* @__PURE__ */ y(ys, N({}, r, { ref: n }), /* @__PURE__ */ Fo(s) ? /* @__PURE__ */ Js(s, void 0, i) : null); } return /* @__PURE__ */ y(ys, N({}, r, { ref: n }), t); }); kt.displayName = "Slot"; const ys = /* @__PURE__ */ k((e, n) => { const { children: t, ...r } = e; return /* @__PURE__ */ Fo(t) ? /* @__PURE__ */ Js(t, { ...Wh(r, t.props), ref: n ? aa(n, t.ref) : t.ref }) : Pn.count(t) > 1 ? Pn.only(null) : null; }); ys.displayName = "SlotClone"; const Zs = ({ children: e }) => /* @__PURE__ */ y(gn, null, e); function Bh(e) { return /* @__PURE__ */ Fo(e) && e.type === Zs; } function Wh(e, n) { const t = { ...n }; for (const r in n) { const o = e[r], a = n[r]; /^on[A-Z]/.test(r) ? o && a ? t[r] = (...i) => { a(...i), o(...i); } : o && (t[r] = o) : r === "style" ? t[r] = { ...o, ...a } : r === "className" && (t[r] = [ o, a ].filter(Boolean).join(" ")); } return { ...e, ...t }; } function ur(e) { const n = e + "CollectionProvider", [t, r] = Ge(n), [o, a] = t(n, { collectionRef: { current: null }, itemMap: /* @__PURE__ */ new Map() }), s = (p) => { const { scope: m, children: h } = p, v = _.useRef(null), g = _.useRef(/* @__PURE__ */ new Map()).current; return /* @__PURE__ */ _.createElement(o, { scope: m, itemMap: g, collectionRef: v }, h); }, i = e + "CollectionSlot", c = /* @__PURE__ */ _.forwardRef((p, m) => { const { scope: h, children: v } = p, g = a(i, h), b = $e(m, g.collectionRef); return /* @__PURE__ */ _.createElement(kt, { ref: b }, v); }), l = e + "CollectionItemSlot", u = "data-radix-collection-item", d = /* @__PURE__ */ _.forwardRef((p, m) => { const { scope: h, children: v, ...g } = p, b = _.useRef(null), $ = $e(m, b), C = a(l, h); return _.useEffect(() => (C.itemMap.set(b, { ref: b, ...g }), () => void C.itemMap.delete(b))), /* @__PURE__ */ _.createElement(kt, { [u]: "", ref: $ }, v); }); function f(p) { const m = a(e + "CollectionConsumer", p); return _.useCallback(() => { const v = m.collectionRef.current; if (!v) return []; const g = Array.from(v.querySelectorAll(`[${u}]`)); return Array.from(m.itemMap.values()).sort( (C, S) => g.indexOf(C.ref.current) - g.indexOf(S.ref.current) ); }, [ m.collectionRef, m.itemMap ]); } return [ { Provider: s, Slot: c, ItemSlot: d }, f, r ]; } function Q(e, n, { checkForDefaultPrevented: t = !0 } = {}) { return function(o) { if (e == null || e(o), t === !1 || !o.defaultPrevented) return n == null ? void 0 : n(o); }; } function Xe(e) { const n = ee(e); return pe(() => { n.current = e; }), Jt( () => (...t) => { var r; return (r = n.current) === null || r === void 0 ? void 0 : r.call(n, ...t); }, [] ); } function qe({ prop: e, defaultProp: n, onChange: t = () => { } }) { const [r, o] = Hh({ defaultProp: n, onChange: t }), a = e !== void 0, s = a ? e : r, i = Xe(t), c = ve((l) => { if (a) { const d = typeof l == "function" ? l(e) : l; d !== e && i(d); } else o(l); }, [ a, e, o, i ]); return [ s, c ]; } function Hh({ defaultProp: e, onChange: n }) { const t = ue(e), [r] = t, o = ee(r), a = Xe(n); return pe(() => { o.current !== r && (a(r), o.current = r); }, [ r, o, a ]), t; } const jh = [ "a", "button", "div", "form", "h2", "h3", "img", "input", "label", "li", "nav", "ol", "p", "span", "svg", "ul" ], ce = jh.reduce((e, n) => { const t = /* @__PURE__ */ k((r, o) => { const { asChild: a, ...s } = r, i = a ? kt : n; return pe(() => { window[Symbol.for("radix-ui")] = !0; }, []), /* @__PURE__ */ y(i, N({}, s, { ref: o })); }); return t.displayName = `Primitive.${n}`, { ...e, [n]: t }; }, {}); function jl(e, n) { e && Wl( () => e.dispatchEvent(n) ); } const at = globalThis != null && globalThis.document ? ra : () => { }; function Gh(e, n) { return Il((t, r) => { const o = n[t][r]; return o ?? t; }, e); } const Ze = (e) => { const { present: n, children: t } = e, r = Uh(n), o = typeof t == "function" ? t({ present: r.isPresent }) : Pn.only(t), a = $e(r.ref, o.ref); return typeof t == "function" || r.isPresent ? /* @__PURE__ */ Js(o, { ref: a }) : null; }; Ze.displayName = "Presence"; function Uh(e) { const [n, t] = ue(), r = ee({}), o = ee(e), a = ee("none"), s = e ? "mounted" : "unmounted", [i, c] = Gh(s, { mounted: { UNMOUNT: "unmounted", ANIMATION_OUT: "unmountSuspended" }, unmountSuspended: { MOUNT: "mounted", ANIMATION_END: "unmounted" }, unmounted: { MOUNT: "mounted" } }); return pe(() => { const l = vo(r.current); a.current = i === "mounted" ? l : "none"; }, [ i ]), at(() => { const l = r.current, u = o.current; if (u !== e) { const f = a.current, p = vo(l); e ? c("MOUNT") : p === "none" || (l == null ? void 0 : l.display) === "none" ? c("UNMOUNT") : c(u && f !== p ? "ANIMATION_OUT" : "UNMOUNT"), o.current = e; } }, [ e, c ]), at(() => { if (n) { const l = (d) => { const p = vo(r.current).includes(d.animationName); d.target === n && p && Wl( () => c("ANIMATION_END") ); }, u = (d) => { d.target === n && (a.current = vo(r.current)); }; return n.addEventListener("animationstart", u), n.addEventListener("animationcancel", l), n.addEventListener("animationend", l), () => { n.removeEventListener("animationstart", u), n.removeEventListener("animationcancel", l), n.removeEventListener("animationend", l); }; } else c("ANIMATION_END"); }, [ n, c ]), { isPresent: [ "mounted", "unmountSuspended" ].includes(i), ref: ve((l) => { l && (r.current = getComputedStyle(l)), t(l); }, []) }; } function vo(e) { return (e == null ? void 0 : e.animationName) || "none"; } const Yh = w.useId || (() => { }); let Kh = 0; function tt(e) { const [n, t] = w.useState(Yh()); return at(() => { e || t( (r) => r ?? String(Kh++) ); }, [ e ]), e || (n ? `radix-${n}` : ""); } const Gl = "Collapsible", [qh, Ul] = Ge(Gl), [Xh, ei] = qh(Gl), Qh = /* @__PURE__ */ k((e, n) => { const { __scopeCollapsible: t, open: r, defaultOpen: o, disabled: a, onOpenChange: s, ...i } = e, [c = !1, l] = qe({ prop: r, defaultProp: o, onChange: s }); return /* @__PURE__ */ y(Xh, { scope: t, disabled: a, contentId: tt(), open: c, onOpenToggle: ve( () => l( (u) => !u ), [ l ] ) }, /* @__PURE__ */ y(ce.div, N({ "data-state": ti(c), "data-disabled": a ? "" : void 0 }, i, { ref: n }))); }), Jh = "CollapsibleTrigger", Yl = /* @__PURE__ */ k((e, n) => { const { __scopeCollapsible: t, ...r } = e, o = ei(Jh, t); return /* @__PURE__ */ y(ce.button, N({ type: "button", "aria-controls": o.contentId, "aria-expanded": o.open || !1, "data-state": ti(o.open), "data-disabled": o.disabled ? "" : void 0, disabled: o.disabled }, r, { ref: n, onClick: Q(e.onClick, o.onOpenToggle) })); }), Kl = "CollapsibleContent", ql = /* @__PURE__ */ k((e, n) => { const { forceMount: t, ...r } = e, o = ei(Kl, e.__scopeCollapsible); return /* @__PURE__ */ y( Ze, { present: t || o.open }, ({ present: a }) => /* @__PURE__ */ y(Zh, N({}, r, { ref: n, present: a })) ); }), Zh = /* @__PURE__ */ k((e, n) => { const { __scopeCollapsible: t, present: r, children: o, ...a } = e, s = ei(Kl, t), [i, c] = ue(r), l = ee(null), u = $e(n, l), d = ee(0), f = d.current, p = ee(0), m = p.current, h = s.open || i, v = ee(h), g = ee(); return pe(() => { const b = requestAnimationFrame( () => v.current = !1 ); return () => cancelAnimationFrame(b); }, []), at(() => { const b = l.current; if (b) { g.current = g.current || { transitionDuration: b.style.transitionDuration, animationName: b.style.animationName }, b.style.transitionDuration = "0s", b.style.animationName = "none"; const $ = b.getBoundingClientRect(); d.current = $.height, p.current = $.width, v.current || (b.style.transitionDuration = g.current.transitionDuration, b.style.animationName = g.current.animationName), c(r); } }, [ s.open, r ]), /* @__PURE__ */ y(ce.div, N({ "data-state": ti(s.open), "data-disabled": s.disabled ? "" : void 0, id: s.contentId, hidden: !h }, a, { ref: u, style: { "--radix-collapsible-content-height": f ? `${f}px` : void 0, "--radix-collapsible-content-width": m ? `${m}px` : void 0, ...e.style } }), h && o); }); function ti(e) { return e ? "open" : "closed"; } const Xl = Qh, eg = Yl, tg = ql, ng = /* @__PURE__ */ wt(void 0); function Gt(e) { const n = St(ng); return e || n || "ltr"; } const bn = "Accordion", rg = [ "Home", "End", "ArrowDown", "ArrowUp", "ArrowLeft", "ArrowRight" ], [ni, og, ag] = ur(bn), [sa, UE] = Ge(bn, [ ag, Ul ]), ri = Ul(), Ql = /* @__PURE__ */ _.forwardRef((e, n) => { const { type: t, ...r } = e, o = r, a = r; return /* @__PURE__ */ _.createElement(ni.Provider, { scope: e.__scopeAccordion }, t === "multiple" ? /* @__PURE__ */ _.createElement(lg, N({}, a, { ref: n })) : /* @__PURE__ */ _.createElement(cg, N({}, o, { ref: n }))); }); Ql.propTypes = { type(e) { const n = e.value || e.defaultValue; return e.type && ![ "single", "multiple" ].includes(e.type) ? new Error("Invalid prop `type` supplied to `Accordion`. Expected one of `single | multiple`.") : e.type === "multiple" && typeof n == "string" ? new Error("Invalid prop `type` supplied to `Accordion`. Expected `single` when `defaultValue` or `value` is type `string`.") : e.type === "single" && Array.isArray(n) ? new Error("Invalid prop `type` supplied to `Accordion`. Expected `multiple` when `defaultValue` or `value` is type `string[]`.") : null; } }; const [Jl, sg] = sa(bn), [Zl, ig] = sa(bn, { collapsible: !1 }), cg = /* @__PURE__ */ _.forwardRef((e, n) => { const { value: t, defaultValue: r, onValueChange: o = () => { }, collapsible: a = !1, ...s } = e, [i, c] = qe({ prop: t, defaultProp: r, onChange: o }); return /* @__PURE__ */ _.createElement(Jl, { scope: e.__scopeAccordion, value: i ? [ i ] : [], onItemOpen: c, onItemClose: _.useCallback( () => a && c(""), [ a, c ] ) }, /* @__PURE__ */ _.createElement(Zl, { scope: e.__scopeAccordion, collapsible: a }, /* @__PURE__ */ _.createElement(ed, N({}, s, { ref: n })))); }), lg = /* @__PURE__ */ _.forwardRef((e, n) => { const { value: t, defaultValue: r, onValueChange: o = () => { }, ...a } = e, [s = [], i] = qe({ prop: t, defaultProp: r, onChange: o }), c = _.useCallback( (u) => i( (d = []) => [ ...d, u ] ), [ i ] ), l = _.useCallback( (u) => i( (d = []) => d.filter( (f) => f !== u ) ), [ i ] ); return /* @__PURE__ */ _.createElement(Jl, { scope: e.__scopeAccordion, value: s, onItemOpen: c, onItemClose: l }, /* @__PURE__ */ _.createElement(Zl, { scope: e.__scopeAccordion, collapsible: !0 }, /* @__PURE__ */ _.createElement(ed, N({}, a, { ref: n })))); }), [dg, ia] = sa(bn), ed = /* @__PURE__ */ _.forwardRef((e, n) => { const { __scopeAccordion: t, disabled: r, dir: o, orientation: a = "vertical", ...s } = e, i = _.useRef(null), c = $e(i, n), l = og(t), d = Gt(o) === "ltr", f = Q(e.onKeyDown, (p) => { var m; if (!rg.includes(p.key)) return; const h = p.target, v = l().filter((M) => { var z; return !((z = M.ref.current) !== null && z !== void 0 && z.disabled); }), g = v.findIndex( (M) => M.ref.current === h ), b = v.length; if (g === -1) return; p.preventDefault(); let $ = g; const C = 0, S = b - 1, P = () => { $ = g + 1, $ > S && ($ = C); }, E = () => { $ = g - 1, $ < C && ($ = S); }; switch (p.key) { case "Home": $ = C; break; case "End": $ = S; break; case "ArrowRight": a === "horizontal" && (d ? P() : E()); break; case "ArrowDown": a === "vertical" && P(); break; case "ArrowLeft": a === "horizontal" && (d ? E() : P()); break; case "ArrowUp": a === "vertical" && E(); break; } const T = $ % b; (m = v[T].ref.current) === null || m === void 0 || m.focus(); }); return /* @__PURE__ */ _.createElement(dg, { scope: t, disabled: r, direction: o, orientation: a }, /* @__PURE__ */ _.createElement(ni.Slot, { scope: t }, /* @__PURE__ */ _.createElement(ce.div, N({}, s, { "data-orientation": a, ref: c, onKeyDown: r ? void 0 : f })))); }), $s = "AccordionItem", [ug, oi] = sa($s), fg = /* @__PURE__ */ _.forwardRef((e, n) => { const { __scopeAccordion: t, value: r, ...o } = e, a = ia($s, t), s = sg($s, t), i = ri(t), c = tt(), l = r && s.value.includes(r) || !1, u = a.disabled || e.disabled; return /* @__PURE__ */ _.createElement(ug, { scope: t, open: l, disabled: u, triggerId: c }, /* @__PURE__ */ _.createElement(Xl, N({ "data-orientation": a.orientation, "data-state": td(l) }, i, o, { ref: n, disabled: u, open: l, onOpenChange: (d) => { d ? s.onItemOpen(r) : s.onItemClose(r); } }))); }), pg = "AccordionHeader", mg = /* @__PURE__ */ _.forwardRef((e, n) => { const { __scopeAccordion: t, ...r } = e, o = ia(bn, t), a = oi(pg, t); return /* @__PURE__ */ _.createElement(ce.h3, N({ "data-orientation": o.orientation, "data-state": td(a.open), "data-disabled": a.disabled ? "" : void 0 }, r, { ref: n })); }), $c = "AccordionTrigger", hg = /* @__PURE__ */ _.forwardRef((e, n) => { const { __scopeAccordion: t, ...r } = e, o = ia(bn, t), a = oi($c, t), s = ig($c, t), i = ri(t); return /* @__PURE__ */ _.createElement(ni.ItemSlot, { scope: t }, /* @__PURE__ */ _.createElement(eg, N({ "aria-disabled": a.open && !s.collapsible || void 0, "data-orientation": o.orientation, id: a.triggerId }, i, r, { ref: n }))); }), gg = "AccordionContent", bg = /* @__PURE__ */ _.forwardRef((e, n) => { const { __scopeAccordion: t, ...r } = e, o = ia(bn, t), a = oi(gg, t), s = ri(t); return /* @__PURE__ */ _.createElement(tg, N({ role: "region", "aria-labelledby": a.triggerId, "data-orientation": o.orientation }, s, r, { ref: n, style: { "--radix-accordion-content-height": "var(--radix-collapsible-content-height)", "--radix-accordion-content-width": "var(--radix-collapsible-content-width)", ...e.style } })); }); function td(e) { return e ? "open" : "closed"; } const vg = Ql, yg = fg, $g = mg, nd = hg, rd = bg, ai = "-"; function xg(e) { const n = Cg(e), { conflictingClassGroups: t, conflictingClassGroupModifiers: r } = e; function o(s) { const i = s.split(ai); return i[0] === "" && i.length !== 1 && i.shift(), od(i, n) || wg(s); } function a(s, i) { const c = t[s] || []; return i && r[s] ? [...c, ...r[s]] : c; } return { getClassGroupId: o, getConflictingClassGroupIds: a }; } function od(e, n) { var s; if (e.length === 0) return n.classGroupId; const t = e[0], r = n.nextPart.get(t), o = r ? od(e.slice(1), r) : void 0; if (o) return o; if (n.validators.length === 0) return; const a = e.join(ai); return (s = n.validators.find(({ validator: i }) => i(a))) == null ? void 0 : s.classGroupId; } const xc = /^\[(.+)\]$/; function wg(e) { if (xc.test(e)) { const n = xc.exec(e)[1], t = n == null ? void 0 : n.substring(0, n.indexOf(":")); if (t) return "arbitrary.." + t; } } function Cg(e) { const { theme: n, prefix: t } = e, r = { nextPart: /* @__PURE__ */ new Map(), validators: [] }; return _g(Object.entries(e.classGroups), t).forEach(([a, s]) => { xs(s, r, a, n); }), r; } function xs(e, n, t, r) { e.forEach((o) => { if (typeof o == "string") { const a = o === "" ? n : wc(n, o); a.classGroupId = t; return; } if (typeof o == "function") { if (Sg(o)) { xs(o(r), n, t, r); return; } n.validators.push({ validator: o, classGroupId: t }); return; } Object.entries(o).forEach(([a, s]) => { xs(s, wc(n, a), t, r); }); }); } function wc(e, n) { let t = e; return n.split(ai).forEach((r) => { t.nextPart.has(r) || t.nextPart.set(r, { nextPart: /* @__PURE__ */ new Map(), validators: [] }), t = t.nextPart.get(r); }), t; } function Sg(e) { return e.isThemeGetter; } function _g(e, n) { return n ? e.map(([t, r]) => { const o = r.map((a) => typeof a == "string" ? n + a : typeof a == "object" ? Object.fromEntries(Object.entries(a).map(([s, i]) => [n + s, i])) : a); return [t, o]; }) : e; } function Pg(e) { if (e < 1) return { get: () => { }, set: () => { } }; let n = 0, t = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map(); function o(a, s) { t.set(a, s), n++, n > e && (n = 0, r = t, t = /* @__PURE__ */ new Map()); } return { get(a) { let s = t.get(a); if (s !== void 0) return s; if ((s = r.get(a)) !== void 0) return o(a, s), s; }, set(a, s) { t.has(a) ? t.set(a, s) : o(a, s); } }; } const ad = "!"; function Eg(e) { const n = e.separator, t = n.length === 1, r = n[0], o = n.length; return function(s) { const i = []; let c = 0, l = 0, u; for (let h = 0; h < s.length; h++) { let v = s[h]; if (c === 0) { if (v === r && (t || s.slice(h, h + o) === n)) { i.push(s.slice(l, h)), l = h + o; continue; } if (v === "/") { u = h; continue; } } v === "[" ? c++ : v === "]" && c--; } const d = i.length === 0 ? s : s.substring(l), f = d.startsWith(ad), p = f ? d.substring(1) : d, m = u && u > l ? u - l : void 0; return { modifiers: i, hasImportantModifier: f, baseClassName: p, maybePostfixModifierPosition: m }; }; } function Dg(e) { if (e.length <= 1) return e; const n = []; let t = []; return e.forEach((r) => { r[0] === "[" ? (n.push(...t.sort(), r), t = []) : t.push(r); }), n.push(...t.sort()), n; } function Ng(e) { return { cache: Pg(e.cacheSize), splitModifiers: Eg(e), ...xg(e) }; } const Mg = /\s+/; function Tg(e, n) { const { splitModifiers: t, getClassGroupId: r, getConflictingClassGroupIds: o } = n, a = /* @__PURE__ */ new Set(); return e.trim().split(Mg).map((s) => { const { modifiers: i, hasImportantModifier: c, baseClassName: l, maybePostfixModifierPosition: u } = t(s); let d = r(u ? l.substring(0, u) : l), f = !!u; if (!d) { if (!u) return { isTailwindClass: !1, originalClassName: s }; if (d = r(l), !d) return { isTailwindClass: !1, originalClassName: s }; f = !1; } const p = Dg(i).join(":"); return { isTailwindClass: !0, modifierId: c ? p + ad : p, classGroupId: d, originalClassName: s, hasPostfixModifier: f }; }).reverse().filter((s) => { if (!s.isTailwindClass) return !0; const { modifierId: i, classGroupId: c, hasPostfixModifier: l } = s, u = i + c; return a.has(u) ? !1 : (a.add(u), o(c, l).forEach((d) => a.add(i + d)), !0); }).reverse().map((s) => s.originalClassName).join(" "); } function Ag() { let e = 0, n, t, r = ""; for (; e < arguments.length; ) (n = arguments[e++]) && (t = sd(n)) && (r && (r += " "), r += t); return r; } function sd(e) { if (typeof e == "string") return e; let n, t = ""; for (let r = 0; r < e.length; r++) e[r] && (n = sd(e[r])) && (t && (t += " "), t += n); return t; } function Rg(e, ...n) { let t, r, o, a = s; function s(c) { const l = n.reduce((u, d) => d(u), e()); return t = Ng(l), r = t.cache.get, o = t.cache.set, a = i, i(c); } function i(c) { const l = r(c); if (l) return l; const u = Tg(c, t); return o(c, u), u; } return function() { return a(Ag.apply(null, arguments)); }; } function He(e) { const n = (t) => t[e] || []; return n.isThemeGetter = !0, n; } const id = /^\[(?:([a-z-]+):)?(.+)\]$/i, kg = /^\d+\/\d+$/, Og = /* @__PURE__ */ new Set(["px", "full", "screen"]), Ig = /^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/, Lg = /\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/, Fg = /^-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/, Vg = /^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/; function Kt(e) { return Cn(e) || Og.has(e) || kg.test(e); } function sn(e) { return fr(e, "length", Yg); } function Cn(e) { return !!e && !Number.isNaN(Number(e)); } function yo(e) { return fr(e, "number", Cn); } function Cr(e) { return !!e && Number.isInteger(Number(e)); } function zg(e) { return e.endsWith("%") && Cn(e.slice(0, -1)); } function Ee(e) { return id.test(e); } function cn(e) { return Ig.test(e); } const Bg = /* @__PURE__ */ new Set(["length", "size", "percentage"]); function Wg(e) { return fr(e, Bg, cd); } function Hg(e) { return fr(e, "position", cd); } const jg = /* @__PURE__ */ new Set(["image", "url"]); function Gg(e) { return fr(e, jg, qg); } function Ug(e) { return fr(e, "", Kg); } function Sr() { return !0; } function fr(e, n, t) { const r = id.exec(e); return r ? r[1] ? typeof n == "string" ? r[1] === n : n.has(r[1]) : t(r[2]) : !1; } function Yg(e) { return Lg.test(e); } function cd() { return !1; } function Kg(e) { return Fg.test(e); } function qg(e) { return Vg.test(e); } function Xg() { const e = He("colors"), n = He("spacing"), t = He("blur"), r = He("brightness"), o = He("borderColor"), a = He("borderRadius"), s = He("borderSpacing"), i = He("borderWidth"), c = He("contrast"), l = He("grayscale"), u = He("hueRotate"), d = He("invert"), f = He("gap"), p = He("gradientColorStops"), m = He("gradientColorStopPositions"), h = He("inset"), v = He("margin"), g = He("opacity"), b = He("padding"), $ = He("saturate"), C = He("scale"), S = He("sepia"), P = He("skew"), E = He("space"), T = He("translate"), M = () => ["auto", "contain", "none"], z = () => ["auto", "hidden", "clip", "visible", "scroll"], V = () => ["auto", Ee, n], R = () => [Ee, n], H = () => ["", Kt, sn], I = () => ["auto", Cn, Ee], X = () => ["bottom", "center", "left", "left-bottom", "left-top", "right", "right-bottom", "right-top", "top"], te = () => ["solid", "dashed", "dotted", "double", "none"], G = () => ["normal", "multiply", "screen", "overlay", "darken", "lighten", "color-dodge", "color-burn", "hard-light", "soft-light", "difference", "exclusion", "hue", "saturation", "color", "luminosity", "plus-lighter"], W = () => ["start", "end", "center", "between", "around", "evenly", "stretch"], q = () => ["", "0", Ee], se = () => ["auto", "avoid", "all", "avoid-page", "page", "left", "right", "column"], Y = () => [Cn, yo], A = () => [Cn, Ee]; return { cacheSize: 500, separator: ":", theme: { colors: [Sr], spacing: [Kt, sn], blur: ["none", "", cn, Ee], brightness: Y(), borderColor: [e], borderRadius: ["none", "", "full", cn, Ee], borderSpacing: R(), borderWidth: H(), contrast: Y(), grayscale: q(), hueRotate: A(), invert: q(), gap: R(), gradientColorStops: [e], gradientColorStopPositions: [zg, sn], inset: V(), margin: V(), opacity: Y(), padding: R(), saturate: Y(), scale: Y(), sepia: q(), skew: A(), space: R(), translate: R() }, classGroups: { // Layout /** * Aspect Ratio * @see https://tailwindcss.com/docs/aspect-ratio */ aspect: [{ aspect: ["auto", "square", "video", Ee] }], /** * Container * @see https://tailwindcss.com/docs/container */ container: ["container"], /** * Columns * @see https://tailwindcss.com/docs/columns */ columns: [{ columns: [cn] }], /** * Break After * @see https://tailwindcss.com/docs/break-after */ "break-after": [{ "break-after": se() }], /** * Break Before * @see https://tailwindcss.com/docs/break-before */ "break-before": [{ "break-before": se() }], /** * Break Inside * @see https://tailwindcss.com/docs/break-inside */ "break-inside": [{ "break-inside": ["auto", "avoid", "avoid-page", "avoid-column"] }], /** * Box Decoration Break * @see https://tailwindcss.com/docs/box-decoration-break */ "box-decoration": [{ "box-decoration": ["slice", "clone"] }], /** * Box Sizing * @see https://tailwindcss.com/docs/box-sizing */ box: [{ box: ["border", "content"] }], /** * Display * @see https://tailwindcss.com/docs/display */ display: ["block", "inline-block", "inline", "flex", "inline-flex", "table", "inline-table", "table-caption", "table-cell", "table-column", "table-column-group", "table-footer-group", "table-header-group", "table-row-group", "table-row", "flow-root", "grid", "inline-grid", "contents", "list-item", "hidden"], /** * Floats * @see https://tailwindcss.com/docs/float */ float: [{ float: ["right", "left", "none", "start", "end"] }], /** * Clear * @see https://tailwindcss.com/docs/clear */ clear: [{ clear: ["left", "right", "both", "none", "start", "end"] }], /** * Isolation * @see https://tailwindcss.com/docs/isolation */ isolation: ["isolate", "isolation-auto"], /** * Object Fit * @see https://tailwindcss.com/docs/object-fit */ "object-fit": [{ object: ["contain", "cover", "fill", "none", "scale-down"] }], /** * Object Position * @see https://tailwindcss.com/docs/object-position */ "object-position": [{ object: [...X(), Ee] }], /** * Overflow * @see https://tailwindcss.com/docs/overflow */ overflow: [{ overflow: z() }], /** * Overflow X * @see https://tailwindcss.com/docs/overflow */ "overflow-x": [{ "overflow-x": z() }], /** * Overflow Y * @see https://tailwindcss.com/docs/overflow */ "overflow-y": [{ "overflow-y": z() }], /** * Overscroll Behavior * @see https://tailwindcss.com/docs/overscroll-behavior */ overscroll: [{ overscroll: M() }], /** * Overscroll Behavior X * @see https://tailwindcss.com/docs/overscroll-behavior */ "overscroll-x": [{ "overscroll-x": M() }], /** * Overscroll Behavior Y * @see https://tailwindcss.com/docs/overscroll-behavior */ "overscroll-y": [{ "overscroll-y": M() }], /** * Position * @see https://tailwindcss.com/docs/position */ position: ["static", "fixed", "absolute", "relative", "sticky"], /** * Top / Right / Bottom / Left * @see https://tailwindcss.com/docs/top-right-bottom-left */ inset: [{ inset: [h] }], /** * Right / Left * @see https://tailwindcss.com/docs/top-right-bottom-left */ "inset-x": [{ "inset-x": [h] }], /** * Top / Bottom * @see https://tailwindcss.com/docs/top-right-bottom-left */ "inset-y": [{ "inset-y": [h] }], /** * Start * @see https://tailwindcss.com/docs/top-right-bottom-left */ start: [{ start: [h] }], /** * End * @see https://tailwindcss.com/docs/top-right-bottom-left */ end: [{ end: [h] }], /** * Top * @see https://tailwindcss.com/docs/top-right-bottom-left */ top: [{ top: [h] }], /** * Right * @see https://tailwindcss.com/docs/top-right-bottom-left */ right: [{ right: [h] }], /** * Bottom * @see https://tailwindcss.com/docs/top-right-bottom-left */ bottom: [{ bottom: [h] }], /** * Left * @see https://tailwindcss.com/docs/top-right-bottom-left */ left: [{ left: [h] }], /** * Visibility * @see https://tailwindcss.com/docs/visibility */ visibility: ["visible", "invisible", "collapse"], /** * Z-Index * @see https://tailwindcss.com/docs/z-index */ z: [{ z: ["auto", Cr, Ee] }], // Flexbox and Grid /** * Flex Basis * @see https://tailwindcss.com/docs/flex-basis */ basis: [{ basis: V() }], /** * Flex Direction * @see https://tailwindcss.com/docs/flex-direction */ "flex-direction": [{ flex: ["row", "row-reverse", "col", "col-reverse"] }], /** * Flex Wrap * @see https://tailwindcss.com/docs/flex-wrap */ "flex-wrap": [{ flex: ["wrap", "wrap-reverse", "nowrap"] }], /** * Flex * @see https://tailwindcss.com/docs/flex */ flex: [{ flex: ["1", "auto", "initial", "none", Ee] }], /** * Flex Grow * @see https://tailwindcss.com/docs/flex-grow */ grow: [{ grow: q() }], /** * Flex Shrink * @see https://tailwindcss.com/docs/flex-shrink */ shrink: [{ shrink: q() }], /** * Order * @see https://tailwindcss.com/docs/order */ order: [{ order: ["first", "last", "none", Cr, Ee] }], /** * Grid Template Columns * @see https://tailwindcss.com/docs/grid-template-columns */ "grid-cols": [{ "grid-cols": [Sr] }], /** * Grid Column Start / End * @see https://tailwindcss.com/docs/grid-column */ "col-start-end": [{ col: ["auto", { span: ["full", Cr, Ee] }, Ee] }], /** * Grid Column Start * @see https://tailwindcss.com/docs/grid-column */ "col-start": [{ "col-start": I() }], /** * Grid Column End * @see https://tailwindcss.com/docs/grid-column */ "col-end": [{ "col-end": I() }], /** * Grid Template Rows * @see https://tailwindcss.com/docs/grid-template-rows */ "grid-rows": [{ "grid-rows": [Sr] }], /** * Grid Row Start / End * @see https://tailwindcss.com/docs/grid-row */ "row-start-end": [{ row: ["auto", { span: [Cr, Ee] }, Ee] }], /** * Grid Row Start * @see https://tailwindcss.com/docs/grid-row */ "row-start": [{ "row-start": I() }], /** * Grid Row End * @see https://tailwindcss.com/docs/grid-row */ "row-end": [{ "row-end": I() }], /** * Grid Auto Flow * @see https://tailwindcss.com/docs/grid-auto-flow */ "grid-flow": [{ "grid-flow": ["row", "col", "dense", "row-dense", "col-dense"] }], /** * Grid Auto Columns * @see https://tailwindcss.com/docs/grid-auto-columns */ "auto-cols": [{ "auto-cols": ["auto", "min", "max", "fr", Ee] }], /** * Grid Auto Rows * @see https://tailwindcss.com/docs/grid-auto-rows */ "auto-rows": [{ "auto-rows": ["auto", "min", "max", "fr", Ee] }], /** * Gap * @see https://tailwindcss.com/docs/gap */ gap: [{ gap: [f] }], /** * Gap X * @see https://tailwindcss.com/docs/gap */ "gap-x": [{ "gap-x": [f] }], /** * Gap Y * @see https://tailwindcss.com/docs/gap */ "gap-y": [{ "gap-y": [f] }], /** * Justify Content * @see https://tailwindcss.com/docs/justify-content */ "justify-content": [{ justify: ["normal", ...W()] }], /** * Justify Items * @see https://tailwindcss.com/docs/justify-items */ "justify-items": [{ "justify-items": ["start", "end", "center", "stretch"] }], /** * Justify Self * @see https://tailwindcss.com/docs/justify-self */ "justify-self": [{ "justify-self": ["auto", "start", "end", "center", "stretch"] }], /** * Align Content * @see https://tailwindcss.com/docs/align-content */ "align-content": [{ content: ["normal", ...W(), "baseline"] }], /** * Align Items * @see https://tailwindcss.com/docs/align-items */ "align-items": [{ items: ["start", "end", "center", "baseline", "stretch"] }], /** * Align Self * @see https://tailwindcss.com/docs/align-self */ "align-self": [{ self: ["auto", "start", "end", "center", "stretch", "baseline"] }], /** * Place Content * @see https://tailwindcss.com/docs/place-content */ "place-content": [{ "place-content": [...W(), "baseline"] }], /** * Place Items * @see https://tailwindcss.com/docs/place-items */ "place-items": [{ "place-items": ["start", "end", "center", "baseline", "stretch"] }], /** * Place Self * @see https://tailwindcss.com/docs/place-self */ "place-self": [{ "place-self": ["auto", "start", "end", "center", "stretch"] }], // Spacing /** * Padding * @see https://tailwindcss.com/docs/padding */ p: [{ p: [b] }], /** * Padding X * @see https://tailwindcss.com/docs/padding */ px: [{ px: [b] }], /** * Padding Y * @see https://tailwindcss.com/docs/padding */ py: [{ py: [b] }], /** * Padding Start * @see https://tailwindcss.com/docs/padding */ ps: [{ ps: [b] }], /** * Padding End * @see https://tailwindcss.com/docs/padding */ pe: [{ pe: [b] }], /** * Padding Top * @see https://tailwindcss.com/docs/padding */ pt: [{ pt: [b] }], /** * Padding Right * @see https://tailwindcss.com/docs/padding */ pr: [{ pr: [b] }], /** * Padding Bottom * @see https://tailwindcss.com/docs/padding */ pb: [{ pb: [b] }], /** * Padding Left * @see https://tailwindcss.com/docs/padding */ pl: [{ pl: [b] }], /** * Margin * @see https://tailwindcss.com/docs/margin */ m: [{ m: [v] }], /** * Margin X * @see https://tailwindcss.com/docs/margin */ mx: [{ mx: [v] }], /** * Margin Y * @see https://tailwindcss.com/docs/margin */ my: [{ my: [v] }], /** * Margin Start * @see https://tailwindcss.com/docs/margin */ ms: [{ ms: [v] }], /** * Margin End * @see https://tailwindcss.com/docs/margin */ me: [{ me: [v] }], /** * Margin Top * @see https://tailwindcss.com/docs/margin */ mt: [{ mt: [v] }], /** * Margin Right * @see https://tailwindcss.com/docs/margin */ mr: [{ mr: [v] }], /** * Margin Bottom * @see https://tailwindcss.com/docs/margin */ mb: [{ mb: [v] }], /** * Margin Left * @see https://tailwindcss.com/docs/margin */ ml: [{ ml: [v] }], /** * Space Between X * @see https://tailwindcss.com/docs/space */ "space-x": [{ "space-x": [E] }], /** * Space Between X Reverse * @see https://tailwindcss.com/docs/space */ "space-x-reverse": ["space-x-reverse"], /** * Space Between Y * @see https://tailwindcss.com/docs/space */ "space-y": [{ "space-y": [E] }], /** * Space Between Y Reverse * @see https://tailwindcss.com/docs/space */ "space-y-reverse": ["space-y-reverse"], // Sizing /** * Width * @see https://tailwindcss.com/docs/width */ w: [{ w: ["auto", "min", "max", "fit", "svw", "lvw", "dvw", Ee, n] }], /** * Min-Width * @see https://tailwindcss.com/docs/min-width */ "min-w": [{ "min-w": [Ee, n, "min", "max", "fit"] }], /** * Max-Width * @see https://tailwindcss.com/docs/max-width */ "max-w": [{ "max-w": [Ee, n, "none", "full", "min", "max", "fit", "prose", { screen: [cn] }, cn] }], /** * Height * @see https://tailwindcss.com/docs/height */ h: [{ h: [Ee, n, "auto", "min", "max", "fit", "svh", "lvh", "dvh"] }], /** * Min-Height * @see https://tailwindcss.com/docs/min-height */ "min-h": [{ "min-h": [Ee, n, "min", "max", "fit", "svh", "lvh", "dvh"] }], /** * Max-Height * @see https://tailwindcss.com/docs/max-height */ "max-h": [{ "max-h": [Ee, n, "min", "max", "fit", "svh", "lvh", "dvh"] }], /** * Size * @see https://tailwindcss.com/docs/size */ size: [{ size: [Ee, n, "auto", "min", "max", "fit"] }], // Typography /** * Font Size * @see https://tailwindcss.com/docs/font-size */ "font-size": [{ text: ["base", cn, sn] }], /** * Font Smoothing * @see https://tailwindcss.com/docs/font-smoothing */ "font-smoothing": ["antialiased", "subpixel-antialiased"], /** * Font Style * @see https://tailwindcss.com/docs/font-style */ "font-style": ["italic", "not-italic"], /** * Font Weight * @see https://tailwindcss.com/docs/font-weight */ "font-weight": [{ font: ["thin", "extralight", "light", "normal", "medium", "semibold", "bold", "extrabold", "black", yo] }], /** * Font Family * @see https://tailwindcss.com/docs/font-family */ "font-family": [{ font: [Sr] }], /** * Font Variant Numeric * @see https://tailwindcss.com/docs/font-variant-numeric */ "fvn-normal": ["normal-nums"], /** * Font Variant Numeric * @see https://tailwindcss.com/docs/font-variant-numeric */ "fvn-ordinal": ["ordinal"], /** * Font Variant Numeric * @see https://tailwindcss.com/docs/font-variant-numeric */ "fvn-slashed-zero": ["slashed-zero"], /** * Font Variant Numeric * @see https://tailwindcss.com/docs/font-variant-numeric */ "fvn-figure": ["lining-nums", "oldstyle-nums"], /** * Font Variant Numeric * @see https://tailwindcss.com/docs/font-variant-numeric */ "fvn-spacing": ["proportional-nums", "tabular-nums"], /** * Font Variant Numeric * @see https://tailwindcss.com/docs/font-variant-numeric */ "fvn-fraction": ["diagonal-fractions", "stacked-fractons"], /** * Letter Spacing * @see https://tailwindcss.com/docs/letter-spacing */ tracking: [{ tracking: ["tighter", "tight", "normal", "wide", "wider", "widest", Ee] }], /** * Line Clamp * @see https://tailwindcss.com/docs/line-clamp */ "line-clamp": [{ "line-clamp": ["none", Cn, yo] }], /** * Line Height * @see https://tailwindcss.com/docs/line-height */ leading: [{ leading: ["none", "tight", "snug", "normal", "relaxed", "loose", Kt, Ee] }], /** * List Style Image * @see https://tailwindcss.com/docs/list-style-image */ "list-image": [{ "list-image": ["none", Ee] }], /** * List Style Type * @see https://tailwindcss.com/docs/list-style-type */ "list-style-type": [{ list: ["none", "disc", "decimal", Ee] }], /** * List Style Position * @see https://tailwindcss.com/docs/list-style-position */ "list-style-position": [{ list: ["inside", "outside"] }], /** * Placeholder Color * @deprecated since Tailwind CSS v3.0.0 * @see https://tailwindcss.com/docs/placeholder-color */ "placeholder-color": [{ placeholder: [e] }], /** * Placeholder Opacity * @see https://tailwindcss.com/docs/placeholder-opacity */ "placeholder-opacity": [{ "placeholder-opacity": [g] }], /** * Text Alignment * @see https://tailwindcss.com/docs/text-align */ "text-alignment": [{ text: ["left", "center", "right", "justify", "start", "end"] }], /** * Text Color * @see https://tailwindcss.com/docs/text-color */ "text-color": [{ text: [e] }], /** * Text Opacity * @see https://tailwindcss.com/docs/text-opacity */ "text-opacity": [{ "text-opacity": [g] }], /** * Text Decoration * @see https://tailwindcss.com/docs/text-decoration */ "text-decoration": ["underline", "overline", "line-through", "no-underline"], /** * Text Decoration Style * @see https://tailwindcss.com/docs/text-decoration-style */ "text-decoration-style": [{ decoration: [...te(), "wavy"] }], /** * Text Decoration Thickness * @see https://tailwindcss.com/docs/text-decoration-thickness */ "text-decoration-thickness": [{ decoration: ["auto", "from-font", Kt, sn] }], /** * Text Underline Offset * @see https://tailwindcss.com/docs/text-underline-offset */ "underline-offset": [{ "underline-offset": ["auto", Kt, Ee] }], /** * Text Decoration Color * @see https://tailwindcss.com/docs/text-decoration-color */ "text-decoration-color": [{ decoration: [e] }], /** * Text Transform * @see https://tailwindcss.com/docs/text-transform */ "text-transform": ["uppercase", "lowercase", "capitalize", "normal-case"], /** * Text Overflow * @see https://tailwindcss.com/docs/text-overflow */ "text-overflow": ["truncate", "text-ellipsis", "text-clip"], /** * Text Wrap * @see https://tailwindcss.com/docs/text-wrap */ "text-wrap": [{ text: ["wrap", "nowrap", "balance", "pretty"] }], /** * Text Indent * @see https://tailwindcss.com/docs/text-indent */ indent: [{ indent: R() }], /** * Vertical Alignment * @see https://tailwindcss.com/docs/vertical-align */ "vertical-align": [{ align: ["baseline", "top", "middle", "bottom", "text-top", "text-bottom", "sub", "super", Ee] }], /** * Whitespace * @see https://tailwindcss.com/docs/whitespace */ whitespace: [{ whitespace: ["normal", "nowrap", "pre", "pre-line", "pre-wrap", "break-spaces"] }], /** * Word Break * @see https://tailwindcss.com/docs/word-break */ break: [{ break: ["normal", "words", "all", "keep"] }], /** * Hyphens * @see https://tailwindcss.com/docs/hyphens */ hyphens: [{ hyphens: ["none", "manual", "auto"] }], /** * Content * @see https://tailwindcss.com/docs/content */ content: [{ content: ["none", Ee] }], // Backgrounds /** * Background Attachment * @see https://tailwindcss.com/docs/background-attachment */ "bg-attachment": [{ bg: ["fixed", "local", "scroll"] }], /** * Background Clip * @see https://tailwindcss.com/docs/background-clip */