"use client";
'use strict';

var menu = require('@base-ui/react/menu');
var clsx = require('clsx');
var tailwindMerge = require('tailwind-merge');
var lucideReact = require('lucide-react');
var jsxRuntime = require('react/jsx-runtime');

var __defProp = Object.defineProperty;
var __defProps = Object.defineProperties;
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __propIsEnum = Object.prototype.propertyIsEnumerable;
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
var __spreadValues = (a, b) => {
  for (var prop in b || (b = {}))
    if (__hasOwnProp.call(b, prop))
      __defNormalProp(a, prop, b[prop]);
  if (__getOwnPropSymbols)
    for (var prop of __getOwnPropSymbols(b)) {
      if (__propIsEnum.call(b, prop))
        __defNormalProp(a, prop, b[prop]);
    }
  return a;
};
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
var __objRest = (source, exclude) => {
  var target = {};
  for (var prop in source)
    if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
      target[prop] = source[prop];
  if (source != null && __getOwnPropSymbols)
    for (var prop of __getOwnPropSymbols(source)) {
      if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
        target[prop] = source[prop];
    }
  return target;
};
function cn(...inputs) {
  return tailwindMerge.twMerge(clsx.clsx(inputs));
}
function DropdownMenu(_a) {
  var props = __objRest(_a, []);
  return /* @__PURE__ */ jsxRuntime.jsx(menu.Menu.Root, __spreadValues({ "data-slot": "dropdown-menu" }, props));
}
function DropdownMenuPortal(_a) {
  var props = __objRest(_a, []);
  return /* @__PURE__ */ jsxRuntime.jsx(menu.Menu.Portal, __spreadValues({ "data-slot": "dropdown-menu-portal" }, props));
}
function DropdownMenuTrigger(_a) {
  var props = __objRest(_a, []);
  return /* @__PURE__ */ jsxRuntime.jsx(menu.Menu.Trigger, __spreadValues({ "data-slot": "dropdown-menu-trigger" }, props));
}
function DropdownMenuContent(_a) {
  var _b = _a, {
    align = "start",
    alignOffset = 0,
    side = "bottom",
    sideOffset = 4,
    className
  } = _b, props = __objRest(_b, [
    "align",
    "alignOffset",
    "side",
    "sideOffset",
    "className"
  ]);
  return /* @__PURE__ */ jsxRuntime.jsx(menu.Menu.Portal, { children: /* @__PURE__ */ jsxRuntime.jsx(
    menu.Menu.Positioner,
    {
      className: "isolate z-50 outline-none",
      align,
      alignOffset,
      side,
      sideOffset,
      children: /* @__PURE__ */ jsxRuntime.jsx(
        menu.Menu.Popup,
        __spreadValues({
          "data-slot": "dropdown-menu-content",
          className: cn("z-50 max-h-(--available-height) min-w-(--anchor-width) origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-sm bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 outline-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:overflow-hidden data-closed:fade-out-0 data-closed:zoom-out-95", className)
        }, props)
      )
    }
  ) });
}
function DropdownMenuGroup(_a) {
  var props = __objRest(_a, []);
  return /* @__PURE__ */ jsxRuntime.jsx(menu.Menu.Group, __spreadValues({ "data-slot": "dropdown-menu-group" }, props));
}
function DropdownMenuLabel(_a) {
  var _b = _a, {
    className,
    inset
  } = _b, props = __objRest(_b, [
    "className",
    "inset"
  ]);
  return /* @__PURE__ */ jsxRuntime.jsx(
    menu.Menu.GroupLabel,
    __spreadValues({
      "data-slot": "dropdown-menu-label",
      "data-inset": inset,
      className: cn(
        "px-1.5 py-1 text-xs font-medium text-muted-foreground data-inset:pl-7",
        className
      )
    }, props)
  );
}
function DropdownMenuItem(_a) {
  var _b = _a, {
    className,
    inset,
    variant = "default"
  } = _b, props = __objRest(_b, [
    "className",
    "inset",
    "variant"
  ]);
  return /* @__PURE__ */ jsxRuntime.jsx(
    menu.Menu.Item,
    __spreadValues({
      "data-slot": "dropdown-menu-item",
      "data-inset": inset,
      "data-variant": variant,
      className: cn(
        "group/dropdown-menu-item relative flex cursor-pointer items-center gap-1.5 rounded-xs px-1.5 py-1 text-sm whitespace-nowrap outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-7 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-[variant=destructive]:*:[svg]:text-destructive",
        className
      )
    }, props)
  );
}
function DropdownMenuSub(_a) {
  var props = __objRest(_a, []);
  return /* @__PURE__ */ jsxRuntime.jsx(menu.Menu.SubmenuRoot, __spreadValues({ "data-slot": "dropdown-menu-sub" }, props));
}
function DropdownMenuSubTrigger(_a) {
  var _b = _a, {
    className,
    inset,
    children
  } = _b, props = __objRest(_b, [
    "className",
    "inset",
    "children"
  ]);
  return /* @__PURE__ */ jsxRuntime.jsxs(
    menu.Menu.SubmenuTrigger,
    __spreadProps(__spreadValues({
      "data-slot": "dropdown-menu-sub-trigger",
      "data-inset": inset,
      className: cn(
        "flex cursor-pointer items-center gap-1.5 rounded-xs px-1.5 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-7 data-popup-open:bg-accent data-popup-open:text-accent-foreground data-open:bg-accent data-open:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
        className
      )
    }, props), {
      children: [
        children,
        /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronRightIcon, { className: "ml-auto" })
      ]
    })
  );
}
function DropdownMenuSubContent(_a) {
  var _b = _a, {
    align = "start",
    alignOffset = -3,
    side = "right",
    sideOffset = 0,
    className
  } = _b, props = __objRest(_b, [
    "align",
    "alignOffset",
    "side",
    "sideOffset",
    "className"
  ]);
  return /* @__PURE__ */ jsxRuntime.jsx(
    DropdownMenuContent,
    __spreadValues({
      "data-slot": "dropdown-menu-sub-content",
      className: cn("w-auto min-w-[96px] rounded-sm bg-popover p-1 text-popover-foreground shadow-lg ring-1 ring-foreground/10 duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95", className),
      align,
      alignOffset,
      side,
      sideOffset
    }, props)
  );
}
function DropdownMenuCheckboxItem(_a) {
  var _b = _a, {
    className,
    children,
    checked,
    inset
  } = _b, props = __objRest(_b, [
    "className",
    "children",
    "checked",
    "inset"
  ]);
  return /* @__PURE__ */ jsxRuntime.jsxs(
    menu.Menu.CheckboxItem,
    __spreadProps(__spreadValues({
      "data-slot": "dropdown-menu-checkbox-item",
      "data-inset": inset,
      className: cn(
        "relative flex cursor-pointer items-center gap-1.5 rounded-xs py-1 pr-8 pl-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground data-inset:pl-7 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
        className
      ),
      checked
    }, props), {
      children: [
        /* @__PURE__ */ jsxRuntime.jsx(
          "span",
          {
            className: "pointer-events-none absolute right-2 flex items-center justify-center",
            "data-slot": "dropdown-menu-checkbox-item-indicator",
            children: /* @__PURE__ */ jsxRuntime.jsx(menu.Menu.CheckboxItemIndicator, { children: /* @__PURE__ */ jsxRuntime.jsx(
              lucideReact.CheckIcon,
              {}
            ) })
          }
        ),
        children
      ]
    })
  );
}
function DropdownMenuRadioGroup(_a) {
  var props = __objRest(_a, []);
  return /* @__PURE__ */ jsxRuntime.jsx(
    menu.Menu.RadioGroup,
    __spreadValues({
      "data-slot": "dropdown-menu-radio-group"
    }, props)
  );
}
function DropdownMenuRadioItem(_a) {
  var _b = _a, {
    className,
    children,
    inset
  } = _b, props = __objRest(_b, [
    "className",
    "children",
    "inset"
  ]);
  return /* @__PURE__ */ jsxRuntime.jsxs(
    menu.Menu.RadioItem,
    __spreadProps(__spreadValues({
      "data-slot": "dropdown-menu-radio-item",
      "data-inset": inset,
      className: cn(
        "relative flex cursor-pointer items-center gap-1.5 rounded-xs py-1 pr-8 pl-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground data-inset:pl-7 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
        className
      )
    }, props), {
      children: [
        /* @__PURE__ */ jsxRuntime.jsx(
          "span",
          {
            className: "pointer-events-none absolute right-2 flex items-center justify-center",
            "data-slot": "dropdown-menu-radio-item-indicator",
            children: /* @__PURE__ */ jsxRuntime.jsx(menu.Menu.RadioItemIndicator, { children: /* @__PURE__ */ jsxRuntime.jsx(
              lucideReact.CheckIcon,
              {}
            ) })
          }
        ),
        children
      ]
    })
  );
}
function DropdownMenuSeparator(_a) {
  var _b = _a, {
    className
  } = _b, props = __objRest(_b, [
    "className"
  ]);
  return /* @__PURE__ */ jsxRuntime.jsx(
    menu.Menu.Separator,
    __spreadValues({
      "data-slot": "dropdown-menu-separator",
      className: cn("-mx-1 my-1 h-px bg-border", className)
    }, props)
  );
}
function DropdownMenuShortcut(_a) {
  var _b = _a, {
    className
  } = _b, props = __objRest(_b, [
    "className"
  ]);
  return /* @__PURE__ */ jsxRuntime.jsx(
    "span",
    __spreadValues({
      "data-slot": "dropdown-menu-shortcut",
      className: cn(
        "ml-auto text-xs tracking-widest text-muted-foreground group-focus/dropdown-menu-item:text-accent-foreground",
        className
      )
    }, props)
  );
}
function DropdownMenuItemRow(_a) {
  var _b = _a, {
    className,
    variant = "default",
    hoverTone = "default",
    leadIcon,
    avatar,
    label,
    caption,
    badge,
    tailIcon,
    disabled
  } = _b, props = __objRest(_b, [
    "className",
    "variant",
    "hoverTone",
    "leadIcon",
    "avatar",
    "label",
    "caption",
    "badge",
    "tailIcon",
    "disabled"
  ]);
  const isLarge = variant === "large";
  const isNeutralHover = hoverTone === "neutral";
  return /* @__PURE__ */ jsxRuntime.jsxs(
    menu.Menu.Item,
    __spreadProps(__spreadValues({
      "data-slot": "dropdown-menu-item-row",
      "data-variant": variant,
      "data-hover-tone": hoverTone,
      disabled,
      className: cn(
        "group/dropdown-menu-item relative flex cursor-pointer items-center rounded-xs px-1 text-sm outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50",
        isNeutralHover ? "focus:bg-muted focus:text-foreground" : "focus:bg-accent focus:text-accent-foreground",
        isLarge ? "gap-2 px-2 py-1.5" : "gap-1 p-1.5",
        className
      )
    }, props), {
      children: [
        leadIcon && !avatar && /* @__PURE__ */ jsxRuntime.jsx(
          "span",
          {
            "data-slot": "dropdown-menu-item-lead-icon",
            className: cn(
              "flex shrink-0 items-center justify-center [&_svg]:pointer-events-none [&_svg]:shrink-0",
              isLarge ? "size-9 rounded-full bg-muted [&_svg:not([class*='size-'])]:size-4" : "size-5 [&_svg:not([class*='size-'])]:size-4"
            ),
            children: leadIcon
          }
        ),
        avatar && /* @__PURE__ */ jsxRuntime.jsx(
          "span",
          {
            "data-slot": "dropdown-menu-item-avatar",
            className: "flex shrink-0 items-center",
            children: avatar
          }
        ),
        /* @__PURE__ */ jsxRuntime.jsxs(
          "span",
          {
            className: cn(
              "flex min-w-0 flex-1 items-center gap-1",
              isLarge ? "flex-col items-start gap-0.5 px-1" : "px-1"
            ),
            children: [
              /* @__PURE__ */ jsxRuntime.jsx("span", { className: cn(
                "truncate",
                isLarge ? "text-sm font-medium" : "text-sm"
              ), children: label }),
              caption && /* @__PURE__ */ jsxRuntime.jsx("span", { className: cn(
                "truncate text-muted-foreground",
                isLarge ? "text-xs" : "text-xs"
              ), children: caption })
            ]
          }
        ),
        badge && /* @__PURE__ */ jsxRuntime.jsx("span", { "data-slot": "dropdown-menu-item-badge", className: "shrink-0", children: badge }),
        tailIcon && /* @__PURE__ */ jsxRuntime.jsx(
          "span",
          {
            "data-slot": "dropdown-menu-item-tail-icon",
            className: "flex shrink-0 items-center justify-center size-5 text-muted-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
            children: tailIcon
          }
        )
      ]
    })
  );
}
function DropdownMenuUserbar(_a) {
  var _b = _a, {
    className,
    avatar,
    name,
    email,
    badge
  } = _b, props = __objRest(_b, [
    "className",
    "avatar",
    "name",
    "email",
    "badge"
  ]);
  return /* @__PURE__ */ jsxRuntime.jsxs(
    "div",
    __spreadProps(__spreadValues({
      "data-slot": "dropdown-menu-userbar",
      className: cn(
        "flex items-center gap-2 px-3 py-1",
        className
      )
    }, props), {
      children: [
        avatar && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex shrink-0 items-center", children: avatar }),
        /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "flex min-w-0 flex-1 flex-col", children: [
          /* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate text-sm font-medium", children: name }),
          email && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate text-xs text-muted-foreground", children: email })
        ] }),
        badge && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "shrink-0", children: badge })
      ]
    })
  );
}
function DropdownMenuCaption(_a) {
  var _b = _a, {
    className,
    label,
    description,
    tone = "default"
  } = _b, props = __objRest(_b, [
    "className",
    "label",
    "description",
    "tone"
  ]);
  const isSection = tone === "section";
  return /* @__PURE__ */ jsxRuntime.jsxs(
    "div",
    __spreadProps(__spreadValues({
      "data-slot": "dropdown-menu-caption",
      "data-tone": tone,
      className: cn(
        "flex flex-col gap-0.5 py-1",
        isSection ? "px-1" : "px-3",
        className
      )
    }, props), {
      children: [
        /* @__PURE__ */ jsxRuntime.jsx(
          "span",
          {
            className: cn(
              isSection ? "text-xs font-medium text-[var(--theme-text-secondary)]" : "text-sm text-foreground"
            ),
            children: label
          }
        ),
        description && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs text-muted-foreground", children: description })
      ]
    })
  );
}
function DropdownMenuSearchInput(_a) {
  var _b = _a, {
    className,
    value,
    onChange,
    placeholder = "Search"
  } = _b, props = __objRest(_b, [
    "className",
    "value",
    "onChange",
    "placeholder"
  ]);
  return /* @__PURE__ */ jsxRuntime.jsxs(
    "div",
    {
      "data-slot": "dropdown-menu-search-input",
      className: cn(
        "flex items-center gap-1.5 border-b border-border px-2",
        className
      ),
      children: [
        /* @__PURE__ */ jsxRuntime.jsx(lucideReact.SearchIcon, { className: "size-4 shrink-0 text-muted-foreground" }),
        /* @__PURE__ */ jsxRuntime.jsx(
          "input",
          __spreadValues({
            type: "text",
            role: "searchbox",
            "aria-label": placeholder,
            className: "h-9 min-h-[36px] w-full bg-transparent text-sm outline-none placeholder:text-muted-foreground/50",
            value,
            onChange,
            placeholder
          }, props)
        )
      ]
    }
  );
}
function DropdownMenuFooterAction(_a) {
  var _b = _a, {
    className,
    icon,
    label,
    onClick
  } = _b, props = __objRest(_b, [
    "className",
    "icon",
    "label",
    "onClick"
  ]);
  return /* @__PURE__ */ jsxRuntime.jsx(
    "div",
    {
      "data-slot": "dropdown-menu-footer",
      className: "border-t border-border",
      children: /* @__PURE__ */ jsxRuntime.jsxs(
        "button",
        __spreadProps(__spreadValues({
          type: "button",
          className: cn(
            "flex w-full cursor-pointer items-center justify-center gap-1 px-2.5 py-2 text-sm font-medium text-foreground outline-hidden hover:bg-accent focus-visible:bg-accent [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
            className
          ),
          onClick
        }, props), {
          children: [
            icon != null ? icon : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.PlusIcon, {}),
            /* @__PURE__ */ jsxRuntime.jsx("span", { className: "px-0.5", children: label })
          ]
        })
      )
    }
  );
}
function DropdownMenuButtonRow(_a) {
  var _b = _a, {
    className,
    children
  } = _b, props = __objRest(_b, [
    "className",
    "children"
  ]);
  return /* @__PURE__ */ jsxRuntime.jsx(
    "div",
    __spreadProps(__spreadValues({
      "data-slot": "dropdown-menu-button-row",
      className: cn(
        "flex items-center gap-2 px-3 py-2",
        className
      )
    }, props), {
      children
    })
  );
}

exports.DropdownMenu = DropdownMenu;
exports.DropdownMenuButtonRow = DropdownMenuButtonRow;
exports.DropdownMenuCaption = DropdownMenuCaption;
exports.DropdownMenuCheckboxItem = DropdownMenuCheckboxItem;
exports.DropdownMenuContent = DropdownMenuContent;
exports.DropdownMenuFooterAction = DropdownMenuFooterAction;
exports.DropdownMenuGroup = DropdownMenuGroup;
exports.DropdownMenuItem = DropdownMenuItem;
exports.DropdownMenuItemRow = DropdownMenuItemRow;
exports.DropdownMenuLabel = DropdownMenuLabel;
exports.DropdownMenuPortal = DropdownMenuPortal;
exports.DropdownMenuRadioGroup = DropdownMenuRadioGroup;
exports.DropdownMenuRadioItem = DropdownMenuRadioItem;
exports.DropdownMenuSearchInput = DropdownMenuSearchInput;
exports.DropdownMenuSeparator = DropdownMenuSeparator;
exports.DropdownMenuShortcut = DropdownMenuShortcut;
exports.DropdownMenuSub = DropdownMenuSub;
exports.DropdownMenuSubContent = DropdownMenuSubContent;
exports.DropdownMenuSubTrigger = DropdownMenuSubTrigger;
exports.DropdownMenuTrigger = DropdownMenuTrigger;
exports.DropdownMenuUserbar = DropdownMenuUserbar;
//# sourceMappingURL=dropdown-menu.cjs.map
//# sourceMappingURL=dropdown-menu.cjs.map