"use client";
import * as React from 'react';
import { clsx } from 'clsx';
import { twMerge } from 'tailwind-merge';
import { jsxs, jsx } from 'react/jsx-runtime';

var __defProp = Object.defineProperty;
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
function cn(...inputs) {
  return twMerge(clsx(inputs));
}
__name(cn, "cn");
var Cursor = React.forwardRef(
  ({ className, children, cursorText, cursorSize = 20, ...props }, ref) => {
    const [position, setPosition] = React.useState({ x: 0, y: 0 });
    const [isHovered, setIsHovered] = React.useState(false);
    const handleMouseMove = /* @__PURE__ */ __name((e) => {
      const rect = e.currentTarget.getBoundingClientRect();
      setPosition({
        x: e.clientX - rect.left,
        y: e.clientY - rect.top
      });
    }, "handleMouseMove");
    return /* @__PURE__ */ jsxs(
      "div",
      {
        ref,
        className: cn("relative cursor-none", className),
        onMouseMove: handleMouseMove,
        onMouseEnter: () => setIsHovered(true),
        onMouseLeave: () => setIsHovered(false),
        ...props,
        children: [
          children,
          isHovered && /* @__PURE__ */ jsx(
            "div",
            {
              className: "pointer-events-none absolute z-50 flex items-center justify-center rounded-full bg-primary/20 backdrop-blur-sm transition-transform",
              style: {
                left: position.x,
                top: position.y,
                width: cursorSize,
                height: cursorSize,
                transform: "translate(-50%, -50%)"
              },
              children: cursorText && /* @__PURE__ */ jsx("span", { className: "text-xs font-medium text-primary", children: cursorText })
            }
          )
        ]
      }
    );
  }
);
Cursor.displayName = "Cursor";

export { Cursor };
