import * as p from "react";
import { composeEventHandlers as w } from "../../../../../@radix-ui_primitive@1.1.0/node_modules/@radix-ui/primitive/dist/index.js";
import { composeRefs as k } from "../../../../../@radix-ui_react-compose-refs@1.1.0_@types_react@18.3.3_react@18.3.0-canary-3d9b20132-20240124/node_modules/@radix-ui/react-compose-refs/dist/index.js";
import { createContextScope as L } from "../../../../../@radix-ui_react-context@1.1.0_@types_react@18.3.3_react@18.3.0-canary-3d9b20132-20240124/node_modules/@radix-ui/react-context/dist/index.js";
import { useControllableState as K } from "../../../../../@radix-ui_react-use-controllable-state@1.1.0_@types_react@18.3.3_react@18.3.0-canary-3d9b20132-20240124/node_modules/@radix-ui/react-use-controllable-state/dist/index.js";
import { Primitive as U } from "../../../../../@radix-ui_react-primitive@2.0.0_@types_react-dom@18.3.6_@types_react@18.3.3__@types_rea_bdcf182289a3a76356f07e550726e479/node_modules/@radix-ui/react-primitive/dist/index.js";
import { createMenuScope as g, Root as B, Anchor as F, Portal as H, Content as W, Group as $, Label as X, Item as q, Separator as z, CheckboxItem as J, ItemIndicator as Q, RadioGroup as V, RadioItem as Y, Arrow as Z, SubTrigger as oo, SubContent as ro } from "../../../../../@radix-ui_react-menu@2.1.1_@types_react-dom@18.3.6_@types_react@18.3.3__@types_react@18_d68f633f95cb3c1aee032b2e732ad31d/node_modules/@radix-ui/react-menu/dist/index.js";
import { useId as M } from "../../../../../@radix-ui_react-id@1.1.0_@types_react@18.3.3_react@18.3.0-canary-3d9b20132-20240124/node_modules/@radix-ui/react-id/dist/index.js";
import { j as t } from "../../../../../../../_virtual/jsx-runtime.js";
var v = "DropdownMenu", [eo, So] = L(
  v,
  [g]
), s = g(), [no, D] = eo(v), x = (o) => {
  const {
    __scopeDropdownMenu: n,
    children: e,
    dir: r,
    open: a,
    defaultOpen: i,
    onOpenChange: u,
    modal: d = !0
  } = o, c = s(n), f = p.useRef(null), [l = !1, m] = K({
    prop: a,
    defaultProp: i,
    onChange: u
  });
  return /* @__PURE__ */ t.jsx(
    no,
    {
      scope: n,
      triggerId: M(),
      triggerRef: f,
      contentId: M(),
      open: l,
      onOpenChange: m,
      onOpenToggle: p.useCallback(() => m((G) => !G), [m]),
      modal: d,
      children: /* @__PURE__ */ t.jsx(B, { ...c, open: l, onOpenChange: m, dir: r, modal: d, children: e })
    }
  );
};
x.displayName = v;
var R = "DropdownMenuTrigger", _ = p.forwardRef(
  (o, n) => {
    const { __scopeDropdownMenu: e, disabled: r = !1, ...a } = o, i = D(R, e), u = s(e);
    return /* @__PURE__ */ t.jsx(F, { asChild: !0, ...u, children: /* @__PURE__ */ t.jsx(
      U.button,
      {
        type: "button",
        id: i.triggerId,
        "aria-haspopup": "menu",
        "aria-expanded": i.open,
        "aria-controls": i.open ? i.contentId : void 0,
        "data-state": i.open ? "open" : "closed",
        "data-disabled": r ? "" : void 0,
        disabled: r,
        ...a,
        ref: k(n, i.triggerRef),
        onPointerDown: w(o.onPointerDown, (d) => {
          !r && d.button === 0 && d.ctrlKey === !1 && (i.onOpenToggle(), i.open || d.preventDefault());
        }),
        onKeyDown: w(o.onKeyDown, (d) => {
          r || (["Enter", " "].includes(d.key) && i.onOpenToggle(), d.key === "ArrowDown" && i.onOpenChange(!0), ["Enter", " ", "ArrowDown"].includes(d.key) && d.preventDefault());
        })
      }
    ) });
  }
);
_.displayName = R;
var ao = "DropdownMenuPortal", h = (o) => {
  const { __scopeDropdownMenu: n, ...e } = o, r = s(n);
  return /* @__PURE__ */ t.jsx(H, { ...r, ...e });
};
h.displayName = ao;
var I = "DropdownMenuContent", b = p.forwardRef(
  (o, n) => {
    const { __scopeDropdownMenu: e, ...r } = o, a = D(I, e), i = s(e), u = p.useRef(!1);
    return /* @__PURE__ */ t.jsx(
      W,
      {
        id: a.contentId,
        "aria-labelledby": a.triggerId,
        ...i,
        ...r,
        ref: n,
        onCloseAutoFocus: w(o.onCloseAutoFocus, (d) => {
          u.current || a.triggerRef.current?.focus(), u.current = !1, d.preventDefault();
        }),
        onInteractOutside: w(o.onInteractOutside, (d) => {
          const c = d.detail.originalEvent, f = c.button === 0 && c.ctrlKey === !0, l = c.button === 2 || f;
          (!a.modal || l) && (u.current = !0);
        }),
        style: {
          ...o.style,
          "--radix-dropdown-menu-content-transform-origin": "var(--radix-popper-transform-origin)",
          "--radix-dropdown-menu-content-available-width": "var(--radix-popper-available-width)",
          "--radix-dropdown-menu-content-available-height": "var(--radix-popper-available-height)",
          "--radix-dropdown-menu-trigger-width": "var(--radix-popper-anchor-width)",
          "--radix-dropdown-menu-trigger-height": "var(--radix-popper-anchor-height)"
        }
      }
    );
  }
);
b.displayName = I;
var to = "DropdownMenuGroup", S = p.forwardRef(
  (o, n) => {
    const { __scopeDropdownMenu: e, ...r } = o, a = s(e);
    return /* @__PURE__ */ t.jsx($, { ...a, ...r, ref: n });
  }
);
S.displayName = to;
var po = "DropdownMenuLabel", C = p.forwardRef(
  (o, n) => {
    const { __scopeDropdownMenu: e, ...r } = o, a = s(e);
    return /* @__PURE__ */ t.jsx(X, { ...a, ...r, ref: n });
  }
);
C.displayName = po;
var so = "DropdownMenuItem", N = p.forwardRef(
  (o, n) => {
    const { __scopeDropdownMenu: e, ...r } = o, a = s(e);
    return /* @__PURE__ */ t.jsx(q, { ...a, ...r, ref: n });
  }
);
N.displayName = so;
var io = "DropdownMenuCheckboxItem", A = p.forwardRef((o, n) => {
  const { __scopeDropdownMenu: e, ...r } = o, a = s(e);
  return /* @__PURE__ */ t.jsx(J, { ...a, ...r, ref: n });
});
A.displayName = io;
var uo = "DropdownMenuRadioGroup", E = p.forwardRef((o, n) => {
  const { __scopeDropdownMenu: e, ...r } = o, a = s(e);
  return /* @__PURE__ */ t.jsx(V, { ...a, ...r, ref: n });
});
E.displayName = uo;
var co = "DropdownMenuRadioItem", P = p.forwardRef((o, n) => {
  const { __scopeDropdownMenu: e, ...r } = o, a = s(e);
  return /* @__PURE__ */ t.jsx(Y, { ...a, ...r, ref: n });
});
P.displayName = co;
var lo = "DropdownMenuItemIndicator", y = p.forwardRef((o, n) => {
  const { __scopeDropdownMenu: e, ...r } = o, a = s(e);
  return /* @__PURE__ */ t.jsx(Q, { ...a, ...r, ref: n });
});
y.displayName = lo;
var mo = "DropdownMenuSeparator", O = p.forwardRef((o, n) => {
  const { __scopeDropdownMenu: e, ...r } = o, a = s(e);
  return /* @__PURE__ */ t.jsx(z, { ...a, ...r, ref: n });
});
O.displayName = mo;
var wo = "DropdownMenuArrow", fo = p.forwardRef(
  (o, n) => {
    const { __scopeDropdownMenu: e, ...r } = o, a = s(e);
    return /* @__PURE__ */ t.jsx(Z, { ...a, ...r, ref: n });
  }
);
fo.displayName = wo;
var vo = "DropdownMenuSubTrigger", T = p.forwardRef((o, n) => {
  const { __scopeDropdownMenu: e, ...r } = o, a = s(e);
  return /* @__PURE__ */ t.jsx(oo, { ...a, ...r, ref: n });
});
T.displayName = vo;
var Mo = "DropdownMenuSubContent", j = p.forwardRef((o, n) => {
  const { __scopeDropdownMenu: e, ...r } = o, a = s(e);
  return /* @__PURE__ */ t.jsx(
    ro,
    {
      ...a,
      ...r,
      ref: n,
      style: {
        ...o.style,
        "--radix-dropdown-menu-content-transform-origin": "var(--radix-popper-transform-origin)",
        "--radix-dropdown-menu-content-available-width": "var(--radix-popper-available-width)",
        "--radix-dropdown-menu-content-available-height": "var(--radix-popper-available-height)",
        "--radix-dropdown-menu-trigger-width": "var(--radix-popper-anchor-width)",
        "--radix-dropdown-menu-trigger-height": "var(--radix-popper-anchor-height)"
      }
    }
  );
});
j.displayName = Mo;
var Co = x, No = _, Ao = h, Eo = b, Po = S, yo = C, Oo = N, To = A, jo = E, Go = P, ko = y, Lo = O, Ko = T, Uo = j;
export {
  To as CheckboxItem,
  Eo as Content,
  x as DropdownMenu,
  fo as DropdownMenuArrow,
  A as DropdownMenuCheckboxItem,
  b as DropdownMenuContent,
  S as DropdownMenuGroup,
  N as DropdownMenuItem,
  y as DropdownMenuItemIndicator,
  C as DropdownMenuLabel,
  h as DropdownMenuPortal,
  E as DropdownMenuRadioGroup,
  P as DropdownMenuRadioItem,
  O as DropdownMenuSeparator,
  j as DropdownMenuSubContent,
  T as DropdownMenuSubTrigger,
  _ as DropdownMenuTrigger,
  Po as Group,
  Oo as Item,
  ko as ItemIndicator,
  yo as Label,
  Ao as Portal,
  jo as RadioGroup,
  Go as RadioItem,
  Co as Root,
  Lo as Separator,
  Uo as SubContent,
  Ko as SubTrigger,
  No as Trigger,
  So as createDropdownMenuScope
};
//# sourceMappingURL=index.js.map
