"use client";
import { cn } from "../../lib/utils.js";
import { motion } from "../../node_modules/motion/dist/es/react.js";
import { c } from "react/compiler-runtime";
import { memo, useMemo } from "react";
import { jsx } from "react/jsx-runtime";
const Shimmer = memo((i) => {
	let a = c(16), { children: o, as: s, className: l, duration: u, spread: d } = i, f = s === void 0 ? "p" : s, p = u === void 0 ? 2 : u, m = d === void 0 ? 2 : d, h;
	a[0] === f ? h = a[1] : (h = motion.create(f), a[0] = f, a[1] = h);
	let g = h, _ = (o?.length ?? 0) * m, v;
	a[2] === Symbol.for("react.memo_cache_sentinel") ? (v = { backgroundPosition: "0% center" }, a[2] = v) : v = a[2];
	let y;
	a[3] === l ? y = a[4] : (y = cn("relative inline-block bg-[length:250%_100%,auto] bg-clip-text text-transparent", "[background-repeat:no-repeat,padding-box] [--bg:linear-gradient(90deg,#0000_calc(50%-var(--spread)),var(--color-background),#0000_calc(50%+var(--spread)))]", l), a[3] = l, a[4] = y);
	let b;
	a[5] === Symbol.for("react.memo_cache_sentinel") ? (b = { backgroundPosition: "100% center" }, a[5] = b) : b = a[5];
	let x = `${_}px`, S;
	a[6] === x ? S = a[7] : (S = {
		"--spread": x,
		backgroundImage: "var(--bg), linear-gradient(var(--color-muted-foreground), var(--color-muted-foreground))"
	}, a[6] = x, a[7] = S);
	let C = S, w;
	a[8] === p ? w = a[9] : (w = {
		repeat: Infinity,
		duration: p,
		ease: "linear"
	}, a[8] = p, a[9] = w);
	let T;
	return a[10] !== g || a[11] !== o || a[12] !== C || a[13] !== w || a[14] !== y ? (T = /* @__PURE__ */ jsx(g, {
		animate: v,
		className: y,
		initial: b,
		style: C,
		transition: w,
		children: o
	}), a[10] = g, a[11] = o, a[12] = C, a[13] = w, a[14] = y, a[15] = T) : T = a[15], T;
});
export { Shimmer };
