"use client";
'use strict';

var React = require('react');
var framerMotion = require('framer-motion');
var clsx = require('clsx');
var tailwindMerge = require('tailwind-merge');
var jsxRuntime = require('react/jsx-runtime');
var lucideReact = require('lucide-react');
var reactSlot = require('@radix-ui/react-slot');
var classVarianceAuthority = require('class-variance-authority');

function _interopNamespace(e) {
  if (e && e.__esModule) return e;
  var n = Object.create(null);
  if (e) {
    Object.keys(e).forEach(function (k) {
      if (k !== 'default') {
        var d = Object.getOwnPropertyDescriptor(e, k);
        Object.defineProperty(n, k, d.get ? d : {
          enumerable: true,
          get: function () { return e[k]; }
        });
      }
    });
  }
  n.default = e;
  return Object.freeze(n);
}

var React__namespace = /*#__PURE__*/_interopNamespace(React);

var __defProp = Object.defineProperty;
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
function cn(...inputs) {
  return tailwindMerge.twMerge(clsx.clsx(inputs));
}
__name(cn, "cn");
var DockContext = React__namespace.createContext({
  magnification: 60,
  distance: 140
});
var Dock = React__namespace.forwardRef(
  ({
    className,
    children,
    position = "bottom",
    magnification = 60,
    distance = 140
  }, ref) => {
    const positionClasses = {
      bottom: "bottom-0 left-1/2 -translate-x-1/2 flex-row",
      left: "left-0 top-1/2 -translate-y-1/2 flex-col",
      right: "right-0 top-1/2 -translate-y-1/2 flex-col"
    };
    return /* @__PURE__ */ jsxRuntime.jsx(DockContext.Provider, { value: { magnification, distance }, children: /* @__PURE__ */ jsxRuntime.jsx(
      "div",
      {
        ref,
        className: cn(
          "fixed z-50 flex items-end gap-1 rounded-2xl border border-white/10 bg-black/10 p-2 backdrop-blur-xl",
          "shadow-2xl shadow-black/20",
          "before:absolute before:inset-0 before:rounded-2xl before:bg-gradient-to-b before:from-white/10 before:to-transparent before:opacity-50",
          positionClasses[position],
          className
        ),
        children
      }
    ) });
  }
);
Dock.displayName = "Dock";
var DockItem = React__namespace.forwardRef(
  ({
    className,
    children,
    onClick,
    tooltip,
    magnification: itemMagnification,
    distance: itemDistance
  }, ref) => {
    const buttonRef = React__namespace.useRef(null);
    const { magnification: contextMagnification, distance: contextDistance } = React__namespace.useContext(DockContext);
    const magnification = itemMagnification ?? contextMagnification;
    const distance = itemDistance ?? contextDistance;
    const [isHovered, setIsHovered] = React__namespace.useState(false);
    const mouseX = framerMotion.useMotionValue(Infinity);
    const springConfig = { mass: 0.1, stiffness: 150, damping: 12 };
    const size = framerMotion.useSpring(
      framerMotion.useTransform(
        mouseX,
        [-distance, 0, distance],
        [48, 48 + magnification, 48]
      ),
      springConfig
    );
    const handleMouseMove = /* @__PURE__ */ __name((e) => {
      if (!buttonRef.current) return;
      const rect = buttonRef.current.getBoundingClientRect();
      const centerX = rect.left + rect.width / 2;
      mouseX.set(e.clientX - centerX);
    }, "handleMouseMove");
    const handleMouseLeave = /* @__PURE__ */ __name(() => {
      mouseX.set(Infinity);
      setIsHovered(false);
    }, "handleMouseLeave");
    return /* @__PURE__ */ jsxRuntime.jsxs(
      framerMotion.motion.div,
      {
        className: "relative",
        onMouseMove: handleMouseMove,
        onMouseLeave: handleMouseLeave,
        onMouseEnter: () => setIsHovered(true),
        children: [
          tooltip && isHovered && /* @__PURE__ */ jsxRuntime.jsxs(
            framerMotion.motion.div,
            {
              initial: { opacity: 0, y: 10, scale: 0.9 },
              animate: { opacity: 1, y: 0, scale: 1 },
              exit: { opacity: 0, y: 5, scale: 0.95 },
              transition: { duration: 0.15 },
              className: "absolute bottom-full left-1/2 mb-2 -translate-x-1/2 whitespace-nowrap rounded-lg bg-black/80 px-2 py-1 text-xs text-white backdrop-blur-md",
              children: [
                tooltip,
                /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute -bottom-1 left-1/2 h-2 w-2 -translate-x-1/2 rotate-45 bg-black/80" })
              ]
            }
          ),
          /* @__PURE__ */ jsxRuntime.jsxs(
            framerMotion.motion.button,
            {
              ref: buttonRef,
              style: {
                width: size,
                height: size
              },
              whileTap: { scale: 0.9 },
              onClick,
              className: cn(
                "relative flex items-center justify-center rounded-xl bg-white/10 backdrop-blur-md transition-colors",
                "hover:bg-white/20",
                "focus:outline-none focus-visible:ring-2 focus-visible:ring-white/50",
                className
              ),
              children: [
                /* @__PURE__ */ jsxRuntime.jsx(
                  framerMotion.motion.div,
                  {
                    style: {
                      width: size,
                      height: size
                    },
                    className: "flex items-center justify-center",
                    children
                  }
                ),
                /* @__PURE__ */ jsxRuntime.jsx(
                  framerMotion.motion.div,
                  {
                    className: "absolute inset-0 rounded-xl",
                    style: {
                      background: "linear-gradient(135deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0) 100%)"
                    }
                  }
                )
              ]
            }
          )
        ]
      }
    );
  }
);
DockItem.displayName = "DockItem";
var DockContext2 = React__namespace.createContext({
  magnification: 60,
  distance: 140,
  mouseX: null
});
var Dock2 = React__namespace.forwardRef(
  ({ className, children, magnification = 60, distance = 140 }, ref) => {
    const mouseX = framerMotion.useMotionValue(Infinity);
    return /* @__PURE__ */ jsxRuntime.jsx(DockContext2.Provider, { value: { magnification, distance, mouseX }, children: /* @__PURE__ */ jsxRuntime.jsx(
      framerMotion.motion.div,
      {
        ref,
        onMouseMove: (e) => mouseX.set(e.pageX),
        onMouseLeave: () => mouseX.set(Infinity),
        className: cn(
          "mx-auto flex h-16 items-end gap-2 rounded-2xl border border-white/10 bg-black/10 px-3 pb-2 backdrop-blur-xl",
          "shadow-2xl shadow-black/20",
          "before:absolute before:inset-0 before:rounded-2xl before:bg-gradient-to-b before:from-white/10 before:to-transparent before:opacity-50",
          className
        ),
        children
      }
    ) });
  }
);
Dock2.displayName = "Dock";
var DockItem2 = React__namespace.forwardRef(
  ({ className, children, onClick, tooltip }, ref) => {
    const buttonRef = React__namespace.useRef(null);
    const { magnification, distance, mouseX } = React__namespace.useContext(DockContext2);
    const [isHovered, setIsHovered] = React__namespace.useState(false);
    const distanceCalc = framerMotion.useTransform(mouseX, (val) => {
      const bounds = buttonRef.current?.getBoundingClientRect() ?? {
        x: 0,
        width: 0
      };
      return val - bounds.x - bounds.width / 2;
    });
    const widthSync = framerMotion.useTransform(
      distanceCalc,
      [-distance, 0, distance],
      [48, 48 + magnification, 48]
    );
    const width = framerMotion.useSpring(widthSync, {
      mass: 0.1,
      stiffness: 150,
      damping: 12
    });
    return /* @__PURE__ */ jsxRuntime.jsxs(
      framerMotion.motion.div,
      {
        className: "relative",
        onMouseEnter: () => setIsHovered(true),
        onMouseLeave: () => setIsHovered(false),
        children: [
          tooltip && isHovered && /* @__PURE__ */ jsxRuntime.jsxs(
            framerMotion.motion.div,
            {
              initial: { opacity: 0, y: 10, scale: 0.9 },
              animate: { opacity: 1, y: 0, scale: 1 },
              exit: { opacity: 0, y: 5, scale: 0.95 },
              transition: { duration: 0.15 },
              className: "absolute bottom-full left-1/2 mb-2 -translate-x-1/2 whitespace-nowrap rounded-lg bg-black/80 px-2 py-1 text-xs text-white backdrop-blur-md",
              children: [
                tooltip,
                /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute -bottom-1 left-1/2 h-2 w-2 -translate-x-1/2 rotate-45 bg-black/80" })
              ]
            }
          ),
          /* @__PURE__ */ jsxRuntime.jsxs(
            framerMotion.motion.button,
            {
              ref: buttonRef,
              style: { width },
              whileTap: { scale: 0.95 },
              onClick,
              className: cn(
                "aspect-square w-12 rounded-xl bg-white/10 backdrop-blur-md transition-colors",
                "hover:bg-white/20",
                "focus:outline-none focus-visible:ring-2 focus-visible:ring-white/50",
                "relative overflow-hidden",
                className
              ),
              children: [
                /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex h-full w-full items-center justify-center", children }),
                /* @__PURE__ */ jsxRuntime.jsx(
                  "div",
                  {
                    className: "pointer-events-none absolute inset-0 rounded-xl",
                    style: {
                      background: "linear-gradient(135deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0) 100%)"
                    }
                  }
                )
              ]
            }
          )
        ]
      }
    );
  }
);
DockItem2.displayName = "DockItem";
var buttonVariants = classVarianceAuthority.cva(
  "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
  {
    variants: {
      variant: {
        default: "bg-primary text-primary-foreground shadow hover:bg-primary/90",
        destructive: "bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",
        outline: "border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",
        secondary: "bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",
        ghost: "hover:bg-accent hover:text-accent-foreground",
        link: "text-primary underline-offset-4 hover:underline",
        // Keep the additional Hanzo variants for backward compatibility
        primary: "bg-primary text-primary-foreground shadow hover:bg-primary/90",
        linkFG: "text-primary underline-offset-4 hover:underline",
        linkMuted: "text-muted-foreground underline-offset-4 hover:underline hover:text-foreground"
      },
      size: {
        default: "h-9 px-4 py-2",
        sm: "h-8 rounded-md px-3 text-xs",
        lg: "h-10 rounded-md px-8",
        icon: "h-9 w-9"
      }
    },
    defaultVariants: {
      variant: "default",
      size: "default"
    }
  }
);
var Button = React__namespace.forwardRef(
  ({ className, variant, size, asChild = false, isLoading = false, children, ...props }, ref) => {
    const Comp = asChild ? reactSlot.Slot : "button";
    return /* @__PURE__ */ jsxRuntime.jsxs(
      Comp,
      {
        className: cn(buttonVariants({ variant, size, className })),
        ref,
        ...props,
        children: [
          isLoading ? /* @__PURE__ */ jsxRuntime.jsx(
            lucideReact.Loader2,
            {
              className: cn("h-4 w-4 animate-spin", size !== "icon" && "mr-2")
            }
          ) : null,
          isLoading && size === "icon" ? null : children
        ]
      }
    );
  }
);
Button.displayName = "Button";
var badgeVariants = classVarianceAuthority.cva(
  "focus:ring-ring border-divider inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:ring-2 focus:ring-offset-2 focus:outline-hidden",
  {
    variants: {
      variant: {
        default: "bg-primary text-primary-foreground hover:bg-primary/80 border-transparent shadow",
        secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80 border-transparent",
        destructive: "bg-destructive text-destructive-foreground hover:bg-destructive/80 border-transparent shadow",
        outline: "hover:bg-bg-secondary text-text-secondary hover:text-text-default border border-gray-500 bg-transparent shadow-xs",
        inputAdornment: "bg-gray-600 px-2 font-medium text-white",
        tags: "text-text-secondary border-divider bg-bg-quaternary rounded-lg px-2 py-1 font-normal capitalize"
      }
    },
    defaultVariants: {
      variant: "default"
    }
  }
);
var Badge = React__namespace.forwardRef(
  ({ className, variant, ...props }, ref) => {
    return /* @__PURE__ */ jsxRuntime.jsx("div", { ref, className: cn(badgeVariants({ variant }), className), ...props });
  }
);
Badge.displayName = "Badge";
var Input = /* @__PURE__ */ __name(({
  className,
  type,
  startAdornment,
  endAdornment,
  hidePasswordToggle,
  ref,
  ...props
}) => {
  const inputRef = React.useRef(null);
  const startAdornmentRef = React.useRef(null);
  const endAdornmentRef = React.useRef(null);
  const [showPassword, setShowPassword] = React__namespace.useState(false);
  const togglePasswordVisibility = /* @__PURE__ */ __name(() => {
    setShowPassword(!showPassword);
  }, "togglePasswordVisibility");
  const style = {};
  if (startAdornment) {
    style.paddingLeft = `${(startAdornmentRef?.current?.offsetWidth ?? 0) + 20}px`;
  }
  if (endAdornment) {
    style.paddingRight = `${(endAdornmentRef?.current?.offsetWidth ?? 0) + 20}px`;
  }
  React.useImperativeHandle(ref, () => inputRef.current, []);
  React.useEffect(() => {
    if (props.autoFocus) {
      setTimeout(() => {
        inputRef?.current?.focus();
      }, 0);
    }
  }, [props.autoFocus]);
  const inputType = type === "password" && showPassword ? "text" : type;
  return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
    /* @__PURE__ */ jsxRuntime.jsx(
      "input",
      {
        className: cn(
          "h-input border-border-input bg-bg-secondary focus:border-border-input-focus disabled:bg-bg-input-disabled peer placeholder-shown:border-border-input text-text-default w-full rounded-lg border px-4 py-3 pt-8 text-sm font-medium placeholder-transparent outline outline-0 transition-all placeholder-shown:border focus:border focus:outline-0 disabled:border-0 disabled:text-gray-400",
          startAdornment && "pl-[var(--custom-padding-left-input)]",
          endAdornment && "pr-[var(--custom-padding-right-input)]",
          type === "password" && "pr-[60px]",
          className
        ),
        placeholder: " ",
        ref: inputRef,
        spellCheck: false,
        style,
        type: inputType,
        ...props
      }
    ),
    startAdornment ? /* @__PURE__ */ jsxRuntime.jsx(
      Badge,
      {
        className: "peer/adornment adornment absolute top-[30px] left-4",
        ref: startAdornmentRef,
        variant: "inputAdornment",
        children: startAdornment
      }
    ) : null,
    endAdornment && typeof endAdornment === "string" ? /* @__PURE__ */ jsxRuntime.jsx(
      Badge,
      {
        className: "peer/adornment adornment absolute top-[30px] right-4",
        ref: endAdornmentRef,
        variant: "inputAdornment",
        children: endAdornment
      }
    ) : null,
    endAdornment && typeof endAdornment !== "string" && React__namespace.isValidElement(endAdornment) ? React__namespace.cloneElement(endAdornment, {
      ref: endAdornmentRef
    }) : null,
    type === "password" && !hidePasswordToggle && /* @__PURE__ */ jsxRuntime.jsx(
      Button,
      {
        "aria-label": showPassword ? "Hide password" : "Show password",
        className: "absolute top-3 right-3",
        onClick: togglePasswordVisibility,
        size: "icon",
        type: "button",
        variant: "ghost",
        children: showPassword ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.EyeOffIcon, { "aria-hidden": "true", className: "h-4 w-4" }) : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.EyeIcon, { "aria-hidden": "true", className: "h-4 w-4" })
      }
    )
  ] });
}, "Input");
Input.displayName = "Input";
var LimelightNav = React__namespace.forwardRef(
  ({ className, items = [], ...props }, ref) => {
    const [isOpen, setIsOpen] = React__namespace.useState(false);
    const [search, setSearch] = React__namespace.useState("");
    React__namespace.useEffect(() => {
      const down = /* @__PURE__ */ __name((e) => {
        if (e.key === "k" && (e.metaKey || e.ctrlKey)) {
          e.preventDefault();
          setIsOpen((open) => !open);
        }
      }, "down");
      document.addEventListener("keydown", down);
      return () => document.removeEventListener("keydown", down);
    }, []);
    const filteredItems = items.filter(
      (item) => item.label.toLowerCase().includes(search.toLowerCase())
    );
    return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
      /* @__PURE__ */ jsxRuntime.jsxs(
        "nav",
        {
          ref,
          className: cn("flex items-center gap-4", className),
          ...props,
          children: [
            /* @__PURE__ */ jsxRuntime.jsxs(
              Button,
              {
                variant: "outline",
                onClick: () => setIsOpen(true),
                className: "relative w-64 justify-start",
                children: [
                  /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Search, { className: "mr-2 h-4 w-4" }),
                  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground", children: "Search..." }),
                  /* @__PURE__ */ jsxRuntime.jsxs("kbd", { className: "pointer-events-none absolute right-2 hidden h-5 select-none items-center gap-1 rounded border bg-muted px-1.5 font-mono text-[10px] font-medium opacity-100 sm:flex", children: [
                    /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Command, { className: "h-3 w-3" }),
                    "K"
                  ] })
                ]
              }
            ),
            items.slice(0, 4).map((item) => /* @__PURE__ */ jsxRuntime.jsx(
              "a",
              {
                href: item.href,
                className: "text-sm font-medium transition-colors hover:text-primary",
                children: item.label
              },
              item.href
            ))
          ]
        }
      ),
      isOpen && /* @__PURE__ */ jsxRuntime.jsx(
        "div",
        {
          className: "fixed inset-0 z-50 bg-background/80 backdrop-blur-sm",
          onClick: () => setIsOpen(false),
          children: /* @__PURE__ */ jsxRuntime.jsxs(
            "div",
            {
              className: "fixed left-1/2 top-1/2 z-50 w-full max-w-lg -translate-x-1/2 -translate-y-1/2 rounded-lg border bg-card p-6 shadow-lg",
              onClick: (e) => e.stopPropagation(),
              children: [
                /* @__PURE__ */ jsxRuntime.jsx(
                  Input,
                  {
                    placeholder: "Search navigation...",
                    value: search,
                    onChange: (e) => setSearch(e.target.value),
                    autoFocus: true,
                    className: "mb-4"
                  }
                ),
                /* @__PURE__ */ jsxRuntime.jsx("div", { className: "max-h-96 space-y-1 overflow-auto", children: filteredItems.map((item) => /* @__PURE__ */ jsxRuntime.jsx(
                  "a",
                  {
                    href: item.href,
                    className: "block rounded-md px-4 py-2 hover:bg-accent",
                    onClick: () => setIsOpen(false),
                    children: item.label
                  },
                  item.href
                )) })
              ]
            }
          )
        }
      )
    ] });
  }
);
LimelightNav.displayName = "LimelightNav";
var MenuDock = React__namespace.forwardRef(
  ({ className, items, orientation = "horizontal", ...props }, ref) => {
    return /* @__PURE__ */ jsxRuntime.jsx(
      "div",
      {
        ref,
        className: cn(
          "flex gap-2 rounded-full border bg-background/95 p-2 shadow-lg backdrop-blur",
          orientation === "vertical" ? "flex-col" : "flex-row",
          className
        ),
        ...props,
        children: items.map((item, index) => /* @__PURE__ */ jsxRuntime.jsxs(
          "button",
          {
            onClick: item.onClick,
            className: cn(
              "group relative flex items-center justify-center rounded-full p-3 transition-colors hover:bg-accent",
              item.active && "bg-primary text-primary-foreground hover:bg-primary/90"
            ),
            title: item.label,
            children: [
              item.icon,
              /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: item.label }),
              /* @__PURE__ */ jsxRuntime.jsx("span", { className: "absolute -top-8 left-1/2 -translate-x-1/2 whitespace-nowrap rounded bg-popover px-2 py-1 text-xs text-popover-foreground opacity-0 transition-opacity group-hover:opacity-100", children: item.label })
            ]
          },
          index
        ))
      }
    );
  }
);
MenuDock.displayName = "MenuDock";
var MessageDock = React__namespace.forwardRef(
  ({ className, messages, onClose, position = "bottom-right", ...props }, ref) => {
    const positionClasses = {
      top: "top-4 left-1/2 -translate-x-1/2",
      bottom: "bottom-4 left-1/2 -translate-x-1/2",
      "top-right": "top-4 right-4",
      "bottom-right": "bottom-4 right-4"
    };
    return /* @__PURE__ */ jsxRuntime.jsx(
      "div",
      {
        ref,
        className: cn(
          "fixed z-50 flex flex-col gap-2",
          positionClasses[position],
          className
        ),
        ...props,
        children: messages.map((message) => /* @__PURE__ */ jsxRuntime.jsx(
          "div",
          {
            className: cn(
              "min-w-[300px] rounded-lg border p-4 shadow-lg",
              message.type === "success" && "border-green-500 bg-green-50 dark:bg-green-950",
              message.type === "warning" && "border-yellow-500 bg-yellow-50 dark:bg-yellow-950",
              message.type === "error" && "border-red-500 bg-red-50 dark:bg-red-950",
              message.type === "info" && "border-blue-500 bg-blue-50 dark:bg-blue-950",
              !message.type && "bg-background"
            ),
            children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start justify-between gap-4", children: [
              /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex-1", children: [
                /* @__PURE__ */ jsxRuntime.jsx("h4", { className: "font-medium", children: message.title }),
                message.description && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "mt-1 text-sm text-muted-foreground", children: message.description })
              ] }),
              onClose && /* @__PURE__ */ jsxRuntime.jsx(
                Button,
                {
                  variant: "ghost",
                  size: "icon",
                  className: "h-6 w-6",
                  onClick: () => onClose(message.id),
                  children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "h-4 w-4" })
                }
              )
            ] })
          },
          message.id
        ))
      }
    );
  }
);
MessageDock.displayName = "MessageDock";

exports.Dock = Dock;
exports.DockItem = DockItem;
exports.LimelightNav = LimelightNav;
exports.MacDock = Dock2;
exports.MacDockItem = DockItem2;
exports.MenuDock = MenuDock;
exports.MessageDock = MessageDock;
