import { jsx as n, jsxs as l } from "react/jsx-runtime";
import { cn as a } from "../../../lib/utils.js";
function m({
  className: i,
  size: e = "md"
}) {
  return /* @__PURE__ */ n(
    "div",
    {
      className: a(
        "animate-spin rounded-full border-2 border-primary border-t-transparent",
        { sm: "size-4", md: "size-5", lg: "size-6" }[e],
        i
      ),
      children: /* @__PURE__ */ n("span", { className: "sr-only", children: "Loading" })
    }
  );
}
const c = {
  sm: "-0.75px",
  md: "-1px",
  lg: "-1.25px"
}, u = {
  sm: "0.75px",
  md: "1px",
  lg: "1.25px"
}, h = {
  sm: "10px",
  md: "12px",
  lg: "14px"
};
function g({
  className: i,
  size: e = "md"
}) {
  const t = { sm: "size-4", md: "size-5", lg: "size-6" }, s = {
    sm: { height: "6px", width: "1.5px" },
    md: { height: "8px", width: "2px" },
    lg: { height: "10px", width: "2.5px" }
  };
  return /* @__PURE__ */ l("div", { className: a("relative", t[e], i), children: [
    /* @__PURE__ */ n("div", { className: "absolute h-full w-full", children: Array.from({ length: 12 }, (d, r) => /* @__PURE__ */ n(
      "div",
      {
        className: "absolute animate-[spinner-fade_1.2s_linear_infinite] rounded-full bg-primary",
        style: {
          top: "0",
          left: "50%",
          marginLeft: c[e],
          transformOrigin: `${u[e]} ${h[e]}`,
          transform: `rotate(${r * 30}deg)`,
          opacity: 0,
          animationDelay: `${r * 0.1}s`,
          height: s[e].height,
          width: s[e].width
        }
      },
      r
    )) }),
    /* @__PURE__ */ n("span", { className: "sr-only", children: "Loading" })
  ] });
}
function p({
  className: i,
  size: e = "md"
}) {
  return /* @__PURE__ */ l("div", { className: a("relative", { sm: "size-4", md: "size-5", lg: "size-6" }[e], i), children: [
    /* @__PURE__ */ n("div", { className: "absolute inset-0 animate-[thin-pulse_1.5s_ease-in-out_infinite] rounded-full border-2 border-primary" }),
    /* @__PURE__ */ n("span", { className: "sr-only", children: "Loading" })
  ] });
}
function x({
  className: i,
  size: e = "md"
}) {
  return /* @__PURE__ */ n(
    "div",
    {
      className: a(
        "animate-[pulse-dot_1.2s_ease-in-out_infinite] rounded-full bg-primary",
        { sm: "size-1", md: "size-2", lg: "size-3" }[e],
        i
      ),
      children: /* @__PURE__ */ n("span", { className: "sr-only", children: "Loading" })
    }
  );
}
function f({
  className: i,
  size: e = "md"
}) {
  const t = { sm: "h-1.5 w-1.5", md: "h-2 w-2", lg: "h-2.5 w-2.5" };
  return /* @__PURE__ */ l(
    "div",
    {
      className: a(
        "flex items-center space-x-1",
        { sm: "h-4", md: "h-5", lg: "h-6" }[e],
        i
      ),
      children: [
        Array.from({ length: 3 }, (d, r) => /* @__PURE__ */ n(
          "div",
          {
            className: a(
              "animate-[bounce-dots_1.4s_ease-in-out_infinite] rounded-full bg-primary",
              t[e]
            ),
            style: { animationDelay: `${r * 160}ms` }
          },
          r
        )),
        /* @__PURE__ */ n("span", { className: "sr-only", children: "Loading" })
      ]
    }
  );
}
function _({
  className: i,
  size: e = "md"
}) {
  const t = { sm: "h-1 w-1", md: "h-1.5 w-1.5", lg: "h-2 w-2" };
  return /* @__PURE__ */ l(
    "div",
    {
      className: a(
        "flex items-center space-x-1",
        { sm: "h-4", md: "h-5", lg: "h-6" }[e],
        i
      ),
      children: [
        Array.from({ length: 3 }, (d, r) => /* @__PURE__ */ n(
          "div",
          {
            className: a(
              "animate-[typing_1s_infinite] rounded-full bg-primary",
              t[e]
            ),
            style: { animationDelay: `${r * 250}ms` }
          },
          r
        )),
        /* @__PURE__ */ n("span", { className: "sr-only", children: "Loading" })
      ]
    }
  );
}
function y({
  className: i,
  size: e = "md"
}) {
  const t = { sm: "w-0.5", md: "w-0.5", lg: "w-1" }, s = { sm: "h-4", md: "h-5", lg: "h-6" }, d = {
    sm: ["6px", "9px", "12px", "9px", "6px"],
    md: ["8px", "12px", "16px", "12px", "8px"],
    lg: ["10px", "15px", "20px", "15px", "10px"]
  };
  return /* @__PURE__ */ l(
    "div",
    {
      className: a(
        "flex items-center gap-0.5",
        s[e],
        i
      ),
      children: [
        Array.from({ length: 5 }, (r, o) => /* @__PURE__ */ n(
          "div",
          {
            className: a(
              "animate-[wave_1s_ease-in-out_infinite] rounded-full bg-primary",
              t[e]
            ),
            style: {
              animationDelay: `${o * 100}ms`,
              height: d[e][o]
            }
          },
          o
        )),
        /* @__PURE__ */ n("span", { className: "sr-only", children: "Loading" })
      ]
    }
  );
}
function b({
  className: i,
  size: e = "md"
}) {
  const t = { sm: "w-1", md: "w-1.5", lg: "w-2" };
  return /* @__PURE__ */ l("div", { className: a("flex", {
    sm: "h-4 gap-1",
    md: "h-5 gap-1.5",
    lg: "h-6 gap-2"
  }[e], i), children: [
    Array.from({ length: 3 }, (d, r) => /* @__PURE__ */ n(
      "div",
      {
        className: a(
          "h-full animate-[wave-bars_1.2s_ease-in-out_infinite] bg-primary",
          t[e]
        ),
        style: { animationDelay: `${r * 0.2}s` }
      },
      r
    )),
    /* @__PURE__ */ n("span", { className: "sr-only", children: "Loading" })
  ] });
}
function v({
  className: i,
  size: e = "md"
}) {
  const t = { sm: "h-3 w-1.5", md: "h-4 w-2", lg: "h-5 w-2.5" }, s = { sm: "text-xs", md: "text-sm", lg: "text-base" };
  return /* @__PURE__ */ l(
    "div",
    {
      className: a(
        "flex items-center space-x-1",
        { sm: "h-4", md: "h-5", lg: "h-6" }[e],
        i
      ),
      children: [
        /* @__PURE__ */ n("span", { className: a("font-mono text-primary", s[e]), children: ">" }),
        /* @__PURE__ */ n(
          "div",
          {
            className: a(
              "animate-[blink_1s_step-end_infinite] bg-primary",
              t[e]
            )
          }
        ),
        /* @__PURE__ */ n("span", { className: "sr-only", children: "Loading" })
      ]
    }
  );
}
function L({
  text: i = "Thinking",
  className: e,
  size: t = "md"
}) {
  return /* @__PURE__ */ n(
    "div",
    {
      className: a(
        "animate-[text-blink_2s_ease-in-out_infinite] font-medium",
        { sm: "text-xs", md: "text-sm", lg: "text-base" }[t],
        e
      ),
      children: i
    }
  );
}
function N({
  text: i = "Thinking",
  className: e,
  size: t = "md"
}) {
  return /* @__PURE__ */ n(
    "div",
    {
      className: a(
        "bg-[linear-gradient(to_right,var(--muted-foreground)_40%,var(--foreground)_60%,var(--muted-foreground)_80%)]",
        "bg-size-[200%_auto] bg-clip-text font-medium text-transparent",
        "animate-[shimmer_4s_infinite_linear]",
        { sm: "text-xs", md: "text-sm", lg: "text-base" }[t],
        e
      ),
      children: i
    }
  );
}
function S({
  className: i,
  text: e = "Thinking",
  size: t = "md"
}) {
  const s = { sm: "text-xs", md: "text-sm", lg: "text-base" };
  return /* @__PURE__ */ l("div", { className: a("inline-flex items-center", i), children: [
    /* @__PURE__ */ n(
      "span",
      {
        className: a("font-medium text-muted-foreground", s[t]),
        children: e
      }
    ),
    /* @__PURE__ */ l("span", { className: "inline-flex", children: [
      /* @__PURE__ */ n("span", { className: "animate-[loading-dots_1.4s_infinite_0.2s] text-muted-foreground", children: "." }),
      /* @__PURE__ */ n("span", { className: "animate-[loading-dots_1.4s_infinite_0.4s] text-muted-foreground", children: "." }),
      /* @__PURE__ */ n("span", { className: "animate-[loading-dots_1.4s_infinite_0.6s] text-muted-foreground", children: "." })
    ] })
  ] });
}
function w({
  className: i,
  size: e = "md",
  text: t
}) {
  const s = { sm: "text-sm", md: "text-base", lg: "text-lg" }, d = { sm: "text-xs", md: "text-sm", lg: "text-base" };
  return /* @__PURE__ */ l("div", { className: a("inline-flex items-center gap-1.5", i), children: [
    /* @__PURE__ */ n(
      "span",
      {
        "aria-hidden": "true",
        className: a(
          "before:animate-[braille-spin_0.8s_steps(10,end)_infinite] before:content-['⠋']",
          "font-mono text-primary leading-none",
          s[e]
        )
      }
    ),
    t && /* @__PURE__ */ n(
      "span",
      {
        className: a("text-muted-foreground leading-none", d[e]),
        children: t
      }
    ),
    !t && /* @__PURE__ */ n("span", { className: "sr-only", children: "Loading" })
  ] });
}
function A({
  variant: i = "circular",
  size: e = "md",
  text: t,
  className: s
}) {
  switch (i) {
    case "circular":
      return /* @__PURE__ */ n(m, { className: s, size: e });
    case "classic":
      return /* @__PURE__ */ n(g, { className: s, size: e });
    case "pulse":
      return /* @__PURE__ */ n(p, { className: s, size: e });
    case "pulse-dot":
      return /* @__PURE__ */ n(x, { className: s, size: e });
    case "dots":
      return /* @__PURE__ */ n(f, { className: s, size: e });
    case "typing":
      return /* @__PURE__ */ n(_, { className: s, size: e });
    case "wave":
      return /* @__PURE__ */ n(y, { className: s, size: e });
    case "bars":
      return /* @__PURE__ */ n(b, { className: s, size: e });
    case "terminal":
      return /* @__PURE__ */ n(v, { className: s, size: e });
    case "text-blink":
      return /* @__PURE__ */ n(L, { className: s, size: e, text: t });
    case "text-shimmer":
      return /* @__PURE__ */ n(N, { className: s, size: e, text: t });
    case "loading-dots":
      return /* @__PURE__ */ n(S, { className: s, size: e, text: t });
    case "braille":
      return /* @__PURE__ */ n(w, { className: s, size: e, text: t });
    default:
      return /* @__PURE__ */ n(m, { className: s, size: e });
  }
}
export {
  A as Loader
};
