dgz-ui-shared
Version:
Custom ui library using React.js, Shadcn/ui, TailwindCSS, Typescript, dgz-ui library
770 lines (764 loc) • 24.7 kB
JavaScript
import * as i from "react";
import { useState as be, forwardRef as ue, createElement as U } from "react";
import { w as Ee, a as ie, h as le, n as q, x as Se } from "./index-DqTIeHVj-CYOpXZHK.js";
import Ce from "react-dom";
var F = "focusScope.autoFocusOnMount", B = "focusScope.autoFocusOnUnmount", J = { bubbles: !1, cancelable: !0 }, ke = "FocusScope", Ne = i.forwardRef((e, t) => {
const {
loop: n = !1,
trapped: r = !1,
onMountAutoFocus: c,
onUnmountAutoFocus: u,
...s
} = e, [o, w] = i.useState(null), y = q(c), v = q(u), d = i.useRef(null), f = Se(t, (a) => w(a)), p = i.useRef({
paused: !1,
pause() {
this.paused = !0;
},
resume() {
this.paused = !1;
}
}).current;
i.useEffect(() => {
if (r) {
let a = function(h) {
if (p.paused || !o) return;
const g = h.target;
o.contains(g) ? d.current = g : N(d.current, { select: !0 });
}, l = function(h) {
if (p.paused || !o) return;
const g = h.relatedTarget;
g !== null && (o.contains(g) || N(d.current, { select: !0 }));
}, m = function(h) {
if (document.activeElement === document.body)
for (const g of h)
g.removedNodes.length > 0 && N(o);
};
document.addEventListener("focusin", a), document.addEventListener("focusout", l);
const b = new MutationObserver(m);
return o && b.observe(o, { childList: !0, subtree: !0 }), () => {
document.removeEventListener("focusin", a), document.removeEventListener("focusout", l), b.disconnect();
};
}
}, [r, o, p.paused]), i.useEffect(() => {
if (o) {
V.add(p);
const a = document.activeElement;
if (!o.contains(a)) {
const l = new CustomEvent(F, J);
o.addEventListener(F, y), o.dispatchEvent(l), l.defaultPrevented || (Ae(Te(se(o)), { select: !0 }), document.activeElement === a && N(o));
}
return () => {
o.removeEventListener(F, y), setTimeout(() => {
const l = new CustomEvent(B, J);
o.addEventListener(B, v), o.dispatchEvent(l), l.defaultPrevented || N(a ?? document.body, { select: !0 }), o.removeEventListener(B, v), V.remove(p);
}, 0);
};
}
}, [o, y, v, p]);
const S = i.useCallback(
(a) => {
if (!n && !r || p.paused) return;
const l = a.key === "Tab" && !a.altKey && !a.ctrlKey && !a.metaKey, m = document.activeElement;
if (l && m) {
const b = a.currentTarget, [h, g] = Re(b);
h && g ? !a.shiftKey && m === g ? (a.preventDefault(), n && N(h, { select: !0 })) : a.shiftKey && m === h && (a.preventDefault(), n && N(g, { select: !0 })) : m === b && a.preventDefault();
}
},
[n, r, p.paused]
);
return /* @__PURE__ */ ie.jsx(le.div, { tabIndex: -1, ...s, ref: f, onKeyDown: S });
});
Ne.displayName = ke;
function Ae(e, { select: t = !1 } = {}) {
const n = document.activeElement;
for (const r of e)
if (N(r, { select: t }), document.activeElement !== n) return;
}
function Re(e) {
const t = se(e), n = Q(t, e), r = Q(t.reverse(), e);
return [n, r];
}
function se(e) {
const t = [], n = document.createTreeWalker(e, NodeFilter.SHOW_ELEMENT, {
acceptNode: (r) => {
const c = r.tagName === "INPUT" && r.type === "hidden";
return r.disabled || r.hidden || c ? NodeFilter.FILTER_SKIP : r.tabIndex >= 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
}
});
for (; n.nextNode(); ) t.push(n.currentNode);
return t;
}
function Q(e, t) {
for (const n of e)
if (!Le(n, { upTo: t })) return n;
}
function Le(e, { upTo: t }) {
if (getComputedStyle(e).visibility === "hidden") return !0;
for (; e; ) {
if (t !== void 0 && e === t) return !1;
if (getComputedStyle(e).display === "none") return !0;
e = e.parentElement;
}
return !1;
}
function xe(e) {
return e instanceof HTMLInputElement && "select" in e;
}
function N(e, { select: t = !1 } = {}) {
if (e && e.focus) {
const n = document.activeElement;
e.focus({ preventScroll: !0 }), e !== n && xe(e) && t && e.select();
}
}
var V = Me();
function Me() {
let e = [];
return {
add(t) {
const n = e[0];
t !== n && (n == null || n.pause()), e = G(e, t), e.unshift(t);
},
remove(t) {
var n;
e = G(e, t), (n = e[0]) == null || n.resume();
}
};
}
function G(e, t) {
const n = [...e], r = n.indexOf(t);
return r !== -1 && n.splice(r, 1), n;
}
function Te(e) {
return e.filter((t) => t.tagName !== "A");
}
var Pe = "Portal", We = i.forwardRef((e, t) => {
var n;
const { container: r, ...c } = e, [u, s] = i.useState(!1);
Ee(() => s(!0), []);
const o = r || u && ((n = globalThis == null ? void 0 : globalThis.document) == null ? void 0 : n.body);
return o ? Ce.createPortal(/* @__PURE__ */ ie.jsx(le.div, { ...c, ref: t }), o) : null;
});
We.displayName = Pe;
var D = 0;
function Lt() {
i.useEffect(() => {
const e = document.querySelectorAll("[data-radix-focus-guard]");
return document.body.insertAdjacentElement("afterbegin", e[0] ?? ee()), document.body.insertAdjacentElement("beforeend", e[1] ?? ee()), D++, () => {
D === 1 && document.querySelectorAll("[data-radix-focus-guard]").forEach((t) => t.remove()), D--;
};
}, []);
}
function ee() {
const e = document.createElement("span");
return e.setAttribute("data-radix-focus-guard", ""), e.tabIndex = 0, e.style.outline = "none", e.style.opacity = "0", e.style.position = "fixed", e.style.pointerEvents = "none", e;
}
var C = function() {
return C = Object.assign || function(e) {
for (var t, n = 1, r = arguments.length; n < r; n++) {
t = arguments[n];
for (var c in t) Object.prototype.hasOwnProperty.call(t, c) && (e[c] = t[c]);
}
return e;
}, C.apply(this, arguments);
};
function de(e, t) {
var n = {};
for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && t.indexOf(r) < 0 && (n[r] = e[r]);
if (e != null && typeof Object.getOwnPropertySymbols == "function")
for (var c = 0, r = Object.getOwnPropertySymbols(e); c < r.length; c++)
t.indexOf(r[c]) < 0 && Object.prototype.propertyIsEnumerable.call(e, r[c]) && (n[r[c]] = e[r[c]]);
return n;
}
function Oe(e, t, n) {
for (var r = 0, c = t.length, u; r < c; r++)
(u || !(r in t)) && (u || (u = Array.prototype.slice.call(t, 0, r)), u[r] = t[r]);
return e.concat(u || Array.prototype.slice.call(t));
}
var _ = "right-scroll-bar-position", j = "width-before-scroll-bar", Ie = "with-scroll-bars-hidden", _e = "--removed-body-scroll-bar-size";
function K(e, t) {
return typeof e == "function" ? e(t) : e && (e.current = t), e;
}
function je(e, t) {
var n = be(function() {
return {
// value
value: e,
// last callback
callback: t,
// "memoized" public interface
facade: {
get current() {
return n.value;
},
set current(r) {
var c = n.value;
c !== r && (n.value = r, n.callback(r, c));
}
}
};
})[0];
return n.callback = t, n.facade;
}
var $e = typeof window < "u" ? i.useLayoutEffect : i.useEffect, te = /* @__PURE__ */ new WeakMap();
function Fe(e, t) {
var n = je(null, function(r) {
return e.forEach(function(c) {
return K(c, r);
});
});
return $e(function() {
var r = te.get(n);
if (r) {
var c = new Set(r), u = new Set(e), s = n.current;
c.forEach(function(o) {
u.has(o) || K(o, null);
}), u.forEach(function(o) {
c.has(o) || K(o, s);
});
}
te.set(n, e);
}, [e]), n;
}
function Be(e) {
return e;
}
function De(e, t) {
t === void 0 && (t = Be);
var n = [], r = !1, c = {
read: function() {
if (r)
throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");
return n.length ? n[n.length - 1] : e;
},
useMedium: function(u) {
var s = t(u, r);
return n.push(s), function() {
n = n.filter(function(o) {
return o !== s;
});
};
},
assignSyncMedium: function(u) {
for (r = !0; n.length; ) {
var s = n;
n = [], s.forEach(u);
}
n = {
push: function(o) {
return u(o);
},
filter: function() {
return n;
}
};
},
assignMedium: function(u) {
r = !0;
var s = [];
if (n.length) {
var o = n;
n = [], o.forEach(u), s = n;
}
var w = function() {
var v = s;
s = [], v.forEach(u);
}, y = function() {
return Promise.resolve().then(w);
};
y(), n = {
push: function(v) {
s.push(v), y();
},
filter: function(v) {
return s = s.filter(v), n;
}
};
}
};
return c;
}
function Ke(e) {
e === void 0 && (e = {});
var t = De(null);
return t.options = C({ async: !0, ssr: !1 }, e), t;
}
var fe = function(e) {
var t = e.sideCar, n = de(e, ["sideCar"]);
if (!t)
throw new Error("Sidecar: please provide `sideCar` property to import the right car");
var r = t.read();
if (!r)
throw new Error("Sidecar medium not found");
return i.createElement(r, C({}, n));
};
fe.isSideCarExport = !0;
function Xe(e, t) {
return e.useMedium(t), fe;
}
var ve = Ke(), X = function() {
}, $ = i.forwardRef(function(e, t) {
var n = i.useRef(null), r = i.useState({
onScrollCapture: X,
onWheelCapture: X,
onTouchMoveCapture: X
}), c = r[0], u = r[1], s = e.forwardProps, o = e.children, w = e.className, y = e.removeScrollBar, v = e.enabled, d = e.shards, f = e.sideCar, p = e.noRelative, S = e.noIsolation, a = e.inert, l = e.allowPinchZoom, m = e.as, b = m === void 0 ? "div" : m, h = e.gapMode, g = de(e, ["forwardProps", "children", "className", "removeScrollBar", "enabled", "shards", "sideCar", "noRelative", "noIsolation", "inert", "allowPinchZoom", "as", "gapMode"]), E = f, A = Fe([n, t]), k = C(C({}, g), c);
return i.createElement(
i.Fragment,
null,
v && i.createElement(E, { sideCar: ve, removeScrollBar: y, shards: d, noRelative: p, noIsolation: S, inert: a, setCallbacks: u, allowPinchZoom: !!l, lockRef: n, gapMode: h }),
s ? i.cloneElement(i.Children.only(o), C(C({}, k), { ref: A })) : i.createElement(b, C({}, k, { className: w, ref: A }), o)
);
});
$.defaultProps = {
enabled: !0,
removeScrollBar: !0,
inert: !1
};
$.classNames = {
fullWidth: j,
zeroRight: _
};
var Ye = function() {
if (typeof __webpack_nonce__ < "u")
return __webpack_nonce__;
};
function Ze() {
if (!document)
return null;
var e = document.createElement("style");
e.type = "text/css";
var t = Ye();
return t && e.setAttribute("nonce", t), e;
}
function Ue(e, t) {
e.styleSheet ? e.styleSheet.cssText = t : e.appendChild(document.createTextNode(t));
}
function ze(e) {
var t = document.head || document.getElementsByTagName("head")[0];
t.appendChild(e);
}
var He = function() {
var e = 0, t = null;
return {
add: function(n) {
e == 0 && (t = Ze()) && (Ue(t, n), ze(t)), e++;
},
remove: function() {
e--, !e && t && (t.parentNode && t.parentNode.removeChild(t), t = null);
}
};
}, qe = function() {
var e = He();
return function(t, n) {
i.useEffect(function() {
return e.add(t), function() {
e.remove();
};
}, [t && n]);
};
}, pe = function() {
var e = qe(), t = function(n) {
var r = n.styles, c = n.dynamic;
return e(r, c), null;
};
return t;
}, Je = {
left: 0,
top: 0,
right: 0,
gap: 0
}, Y = function(e) {
return parseInt(e || "", 10) || 0;
}, Qe = function(e) {
var t = window.getComputedStyle(document.body), n = t[e === "padding" ? "paddingLeft" : "marginLeft"], r = t[e === "padding" ? "paddingTop" : "marginTop"], c = t[e === "padding" ? "paddingRight" : "marginRight"];
return [Y(n), Y(r), Y(c)];
}, Ve = function(e) {
if (e === void 0 && (e = "margin"), typeof window > "u")
return Je;
var t = Qe(e), n = document.documentElement.clientWidth, r = window.innerWidth;
return {
left: t[0],
top: t[1],
right: t[2],
gap: Math.max(0, r - n + t[2] - t[0])
};
}, Ge = pe(), M = "data-scroll-locked", et = function(e, t, n, r) {
var c = e.left, u = e.top, s = e.right, o = e.gap;
return n === void 0 && (n = "margin"), `
.`.concat(Ie, ` {
overflow: hidden `).concat(r, `;
padding-right: `).concat(o, "px ").concat(r, `;
}
body[`).concat(M, `] {
overflow: hidden `).concat(r, `;
overscroll-behavior: contain;
`).concat([
t && "position: relative ".concat(r, ";"),
n === "margin" && `
padding-left: `.concat(c, `px;
padding-top: `).concat(u, `px;
padding-right: `).concat(s, `px;
margin-left:0;
margin-top:0;
margin-right: `).concat(o, "px ").concat(r, `;
`),
n === "padding" && "padding-right: ".concat(o, "px ").concat(r, ";")
].filter(Boolean).join(""), `
}
.`).concat(_, ` {
right: `).concat(o, "px ").concat(r, `;
}
.`).concat(j, ` {
margin-right: `).concat(o, "px ").concat(r, `;
}
.`).concat(_, " .").concat(_, ` {
right: 0 `).concat(r, `;
}
.`).concat(j, " .").concat(j, ` {
margin-right: 0 `).concat(r, `;
}
body[`).concat(M, `] {
`).concat(_e, ": ").concat(o, `px;
}
`);
}, ne = function() {
var e = parseInt(document.body.getAttribute(M) || "0", 10);
return isFinite(e) ? e : 0;
}, tt = function() {
i.useEffect(function() {
return document.body.setAttribute(M, (ne() + 1).toString()), function() {
var e = ne() - 1;
e <= 0 ? document.body.removeAttribute(M) : document.body.setAttribute(M, e.toString());
};
}, []);
}, nt = function(e) {
var t = e.noRelative, n = e.noImportant, r = e.gapMode, c = r === void 0 ? "margin" : r;
tt();
var u = i.useMemo(function() {
return Ve(c);
}, [c]);
return i.createElement(Ge, { styles: et(u, !t, c, n ? "" : "!important") });
}, z = !1;
if (typeof window < "u")
try {
var P = Object.defineProperty({}, "passive", {
get: function() {
return z = !0, !0;
}
});
window.addEventListener("test", P, P), window.removeEventListener("test", P, P);
} catch {
z = !1;
}
var R = z ? { passive: !1 } : !1, rt = function(e) {
return e.tagName === "TEXTAREA";
}, me = function(e, t) {
if (!(e instanceof Element))
return !1;
var n = window.getComputedStyle(e);
return (
// not-not-scrollable
n[t] !== "hidden" && // contains scroll inside self
!(n.overflowY === n.overflowX && !rt(e) && n[t] === "visible")
);
}, ot = function(e) {
return me(e, "overflowY");
}, at = function(e) {
return me(e, "overflowX");
}, re = function(e, t) {
var n = t.ownerDocument, r = t;
do {
typeof ShadowRoot < "u" && r instanceof ShadowRoot && (r = r.host);
var c = he(e, r);
if (c) {
var u = ge(e, r), s = u[1], o = u[2];
if (s > o)
return !0;
}
r = r.parentNode;
} while (r && r !== n.body);
return !1;
}, ct = function(e) {
var t = e.scrollTop, n = e.scrollHeight, r = e.clientHeight;
return [
t,
n,
r
];
}, ut = function(e) {
var t = e.scrollLeft, n = e.scrollWidth, r = e.clientWidth;
return [
t,
n,
r
];
}, he = function(e, t) {
return e === "v" ? ot(t) : at(t);
}, ge = function(e, t) {
return e === "v" ? ct(t) : ut(t);
}, it = function(e, t) {
return e === "h" && t === "rtl" ? -1 : 1;
}, lt = function(e, t, n, r, c) {
var u = it(e, window.getComputedStyle(t).direction), s = u * r, o = n.target, w = t.contains(o), y = !1, v = s > 0, d = 0, f = 0;
do {
var p = ge(e, o), S = p[0], a = p[1], l = p[2], m = a - l - u * S;
(S || m) && he(e, o) && (d += m, f += S), o = o.parentNode.host || o.parentNode;
} while (
// portaled content
!w && o !== document.body || // self content
w && (t.contains(o) || t === o)
);
return (v && Math.abs(d) < 1 || !v && Math.abs(f) < 1) && (y = !0), y;
}, W = function(e) {
return "changedTouches" in e ? [e.changedTouches[0].clientX, e.changedTouches[0].clientY] : [0, 0];
}, oe = function(e) {
return [e.deltaX, e.deltaY];
}, ae = function(e) {
return e && "current" in e ? e.current : e;
}, st = function(e, t) {
return e[0] === t[0] && e[1] === t[1];
}, dt = function(e) {
return `
.block-interactivity-`.concat(e, ` {pointer-events: none;}
.allow-interactivity-`).concat(e, ` {pointer-events: all;}
`);
}, ft = 0, L = [];
function vt(e) {
var t = i.useRef([]), n = i.useRef([0, 0]), r = i.useRef(), c = i.useState(ft++)[0], u = i.useState(pe)[0], s = i.useRef(e);
i.useEffect(function() {
s.current = e;
}, [e]), i.useEffect(function() {
if (e.inert) {
document.body.classList.add("block-interactivity-".concat(c));
var a = Oe([e.lockRef.current], (e.shards || []).map(ae)).filter(Boolean);
return a.forEach(function(l) {
return l.classList.add("allow-interactivity-".concat(c));
}), function() {
document.body.classList.remove("block-interactivity-".concat(c)), a.forEach(function(l) {
return l.classList.remove("allow-interactivity-".concat(c));
});
};
}
}, [e.inert, e.lockRef.current, e.shards]);
var o = i.useCallback(function(a, l) {
if ("touches" in a && a.touches.length === 2 || a.type === "wheel" && a.ctrlKey)
return !s.current.allowPinchZoom;
var m = W(a), b = n.current, h = "deltaX" in a ? a.deltaX : b[0] - m[0], g = "deltaY" in a ? a.deltaY : b[1] - m[1], E, A = a.target, k = Math.abs(h) > Math.abs(g) ? "h" : "v";
if ("touches" in a && k === "h" && A.type === "range")
return !1;
var T = re(k, A);
if (!T)
return !0;
if (T ? E = k : (E = k === "v" ? "h" : "v", T = re(k, A)), !T)
return !1;
if (!r.current && "changedTouches" in a && (h || g) && (r.current = E), !E)
return !0;
var H = r.current || E;
return lt(H, l, a, H === "h" ? h : g);
}, []), w = i.useCallback(function(a) {
var l = a;
if (!(!L.length || L[L.length - 1] !== u)) {
var m = "deltaY" in l ? oe(l) : W(l), b = t.current.filter(function(E) {
return E.name === l.type && (E.target === l.target || l.target === E.shadowParent) && st(E.delta, m);
})[0];
if (b && b.should) {
l.cancelable && l.preventDefault();
return;
}
if (!b) {
var h = (s.current.shards || []).map(ae).filter(Boolean).filter(function(E) {
return E.contains(l.target);
}), g = h.length > 0 ? o(l, h[0]) : !s.current.noIsolation;
g && l.cancelable && l.preventDefault();
}
}
}, []), y = i.useCallback(function(a, l, m, b) {
var h = { name: a, delta: l, target: m, should: b, shadowParent: pt(m) };
t.current.push(h), setTimeout(function() {
t.current = t.current.filter(function(g) {
return g !== h;
});
}, 1);
}, []), v = i.useCallback(function(a) {
n.current = W(a), r.current = void 0;
}, []), d = i.useCallback(function(a) {
y(a.type, oe(a), a.target, o(a, e.lockRef.current));
}, []), f = i.useCallback(function(a) {
y(a.type, W(a), a.target, o(a, e.lockRef.current));
}, []);
i.useEffect(function() {
return L.push(u), e.setCallbacks({
onScrollCapture: d,
onWheelCapture: d,
onTouchMoveCapture: f
}), document.addEventListener("wheel", w, R), document.addEventListener("touchmove", w, R), document.addEventListener("touchstart", v, R), function() {
L = L.filter(function(a) {
return a !== u;
}), document.removeEventListener("wheel", w, R), document.removeEventListener("touchmove", w, R), document.removeEventListener("touchstart", v, R);
};
}, []);
var p = e.removeScrollBar, S = e.inert;
return i.createElement(
i.Fragment,
null,
S ? i.createElement(u, { styles: dt(c) }) : null,
p ? i.createElement(nt, { noRelative: e.noRelative, gapMode: e.gapMode }) : null
);
}
function pt(e) {
for (var t = null; e !== null; )
e instanceof ShadowRoot && (t = e.host, e = e.host), e = e.parentNode;
return t;
}
const mt = Xe(ve, vt);
var ht = i.forwardRef(function(e, t) {
return i.createElement($, C({}, e, { ref: t, sideCar: mt }));
});
ht.classNames = $.classNames;
var gt = function(e) {
if (typeof document > "u")
return null;
var t = Array.isArray(e) ? e[0] : e;
return t.ownerDocument.body;
}, x = /* @__PURE__ */ new WeakMap(), O = /* @__PURE__ */ new WeakMap(), I = {}, Z = 0, ye = function(e) {
return e && (e.host || ye(e.parentNode));
}, yt = function(e, t) {
return t.map(function(n) {
if (e.contains(n))
return n;
var r = ye(n);
return r && e.contains(r) ? r : (console.error("aria-hidden", n, "in not contained inside", e, ". Doing nothing"), null);
}).filter(function(n) {
return !!n;
});
}, wt = function(e, t, n, r) {
var c = yt(t, Array.isArray(e) ? e : [e]);
I[n] || (I[n] = /* @__PURE__ */ new WeakMap());
var u = I[n], s = [], o = /* @__PURE__ */ new Set(), w = new Set(c), y = function(d) {
!d || o.has(d) || (o.add(d), y(d.parentNode));
};
c.forEach(y);
var v = function(d) {
!d || w.has(d) || Array.prototype.forEach.call(d.children, function(f) {
if (o.has(f))
v(f);
else
try {
var p = f.getAttribute(r), S = p !== null && p !== "false", a = (x.get(f) || 0) + 1, l = (u.get(f) || 0) + 1;
x.set(f, a), u.set(f, l), s.push(f), a === 1 && S && O.set(f, !0), l === 1 && f.setAttribute(n, "true"), S || f.setAttribute(r, "true");
} catch (m) {
console.error("aria-hidden: cannot operate on ", f, m);
}
});
};
return v(t), o.clear(), Z++, function() {
s.forEach(function(d) {
var f = x.get(d) - 1, p = u.get(d) - 1;
x.set(d, f), u.set(d, p), f || (O.has(d) || d.removeAttribute(r), O.delete(d)), p || d.removeAttribute(n);
}), Z--, Z || (x = /* @__PURE__ */ new WeakMap(), x = /* @__PURE__ */ new WeakMap(), O = /* @__PURE__ */ new WeakMap(), I = {});
};
}, xt = function(e, t, n) {
n === void 0 && (n = "data-aria-hidden");
var r = Array.from(Array.isArray(e) ? e : [e]), c = gt(e);
return c ? (r.push.apply(r, Array.from(c.querySelectorAll("[aria-live], script"))), wt(r, c, n, "aria-hidden")) : function() {
return null;
};
};
/**
* @license lucide-react v0.511.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
const bt = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), Et = (e) => e.replace(
/^([A-Z])|[\s-_]+(\w)/g,
(t, n, r) => r ? r.toUpperCase() : n.toLowerCase()
), ce = (e) => {
const t = Et(e);
return t.charAt(0).toUpperCase() + t.slice(1);
}, we = (...e) => e.filter((t, n, r) => !!t && t.trim() !== "" && r.indexOf(t) === n).join(" ").trim(), St = (e) => {
for (const t in e)
if (t.startsWith("aria-") || t === "role" || t === "title")
return !0;
};
/**
* @license lucide-react v0.511.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
var Ct = {
xmlns: "http://www.w3.org/2000/svg",
width: 24,
height: 24,
viewBox: "0 0 24 24",
fill: "none",
stroke: "currentColor",
strokeWidth: 2,
strokeLinecap: "round",
strokeLinejoin: "round"
};
/**
* @license lucide-react v0.511.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
const kt = ue(
({
color: e = "currentColor",
size: t = 24,
strokeWidth: n = 2,
absoluteStrokeWidth: r,
className: c = "",
children: u,
iconNode: s,
...o
}, w) => U(
"svg",
{
ref: w,
...Ct,
width: t,
height: t,
stroke: e,
strokeWidth: r ? Number(n) * 24 / Number(t) : n,
className: we("lucide", c),
...!u && !St(o) && { "aria-hidden": "true" },
...o
},
[
...s.map(([y, v]) => U(y, v)),
...Array.isArray(u) ? u : [u]
]
)
);
/**
* @license lucide-react v0.511.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
const Mt = (e, t) => {
const n = ue(
({ className: r, ...c }, u) => U(kt, {
ref: u,
iconNode: t,
className: we(
`lucide-${bt(ce(e))}`,
`lucide-${e}`,
r
),
...c
})
);
return n.displayName = ce(e), n;
};
export {
Lt as C,
We as M,
xt as R,
Ne as S,
ht as d,
Mt as k
};