"use client";
import { jsx as o, jsxs as u, Fragment as F } from "react/jsx-runtime";
import * as d from "react";
import { c as i } from "./cn-ct4n7r74mh8y0f48.js";
import { u as K } from "./link-provider-mn2voeohon7cj9o4.js";
import { CheckIcon as f, CaretRightIcon as U } from "@phosphor-icons/react";
import { ax as W, ay as B, az as H, aA as J, aB as w, S as M, aC as N, aD as q, aE as Q, aF as k, aG as X, aH as Y, aI as y, aJ as Z, aK as $, aL as R, aM as ee } from "./vendor-base-ui-ccr5l0ynrievzzv3.js";
const te = {
  variant: {
    default: {
      classes: "",
      description: "Default dropdown item appearance"
    },
    danger: {
      classes: "text-kumo-danger data-highlighted:bg-kumo-danger/5 data-highlighted:text-kumo-danger",
      description: "Destructive action item"
    }
  }
}, ae = {
  variant: "default"
};
function D({
  variant: e = ae.variant
} = {}) {
  return i(te.variant[e].classes);
}
const I = d.forwardRef(({ className: e, inset: t, children: a, icon: n, ...r }, s) => /* @__PURE__ */ u(
  R,
  {
    ref: s,
    className: i(
      "flex cursor-default items-center rounded-sm text-base outline-hidden select-none",
      // base styles
      "px-2 py-1.5",
      // spacing
      "focus:bg-kumo-tint",
      // focus state
      "data-[state=open]:bg-kumo-tint",
      // open state
      t && "pl-8",
      // conditional inset
      e
    ),
    ...r,
    children: [
      n && /* @__PURE__ */ o(n, { className: "mr-2 h-4 w-4" }),
      a,
      /* @__PURE__ */ o(U, { className: "ml-auto h-4 w-4" })
    ]
  }
));
I.displayName = R.displayName;
const x = d.forwardRef(({ className: e, sideOffset: t = 8, children: a, ...n }, r) => /* @__PURE__ */ o(w, { children: /* @__PURE__ */ o(
  Z,
  {
    ref: r,
    sideOffset: t,
    ...n,
    children: /* @__PURE__ */ o(
      $,
      {
        className: i(
          "overflow-hidden bg-kumo-control text-kumo-default",
          // background
          "rounded-lg shadow-lg ring ring-kumo-line",
          // border part
          "min-w-36 p-1.5",
          // spacing
          "data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95",
          // open animation
          "data-[side=bottom]:slide-in-from-top-2",
          // bottom side animation
          "data-[side=left]:slide-in-from-right-2",
          // left side animation
          "data-[side=right]:slide-in-from-left-2",
          // right side animation
          "data-[side=top]:slide-in-from-bottom-2",
          // top side animation
          "data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95",
          // close animation
          e
        ),
        children: a
      }
    )
  }
) })), g = (e) => e ? d.isValidElement(e) ? e : /* @__PURE__ */ o(e, { className: "mr-2 h-4 w-4" }) : null, v = d.forwardRef(
  ({
    className: e,
    inset: t,
    icon: a,
    children: n,
    selected: r,
    render: s,
    href: l,
    variant: c = "default",
    ...G
  }, _) => {
    const h = K(), m = d.useMemo(
      () => /* @__PURE__ */ u(F, { children: [
        a && g(a),
        n,
        r && /* @__PURE__ */ o("span", { className: "inline-flex", children: /* @__PURE__ */ o(f, {}) })
      ] }),
      [a, n, r]
    ), V = d.useMemo(() => {
      if (!l) return;
      const z = /^(https?:)?\/\//.test(l), b = i(
        "flex items-center",
        c === "danger" && "text-kumo-danger data-highlighted:bg-kumo-danger/5 data-highlighted:text-kumo-danger"
      );
      return z ? /* @__PURE__ */ o(
        "a",
        {
          className: i(b, "w-full text-inherit! no-underline!"),
          href: l,
          target: "_blank",
          rel: "noreferrer",
          onClick: (p) => p.stopPropagation(),
          children: m
        }
      ) : /* @__PURE__ */ o(
        h,
        {
          className: i(b, "w-full text-inherit! no-underline!"),
          href: l,
          to: l,
          onClick: (p) => p.stopPropagation(),
          children: m
        }
      );
    }, [l, m, c, h]), j = l || s;
    return /* @__PURE__ */ o(
      y,
      {
        ref: _,
        className: i(
          "relative flex cursor-default items-center rounded-md px-2 py-1.5 text-base outline-hidden select-none focus:text-kumo-default data-disabled:pointer-events-none data-disabled:opacity-50 data-highlighted:bg-kumo-overlay",
          t && "pl-8",
          D({ variant: c }),
          e
        ),
        render: l ? V : s,
        ...G,
        children: j ? void 0 : m
      }
    );
  }
);
v.displayName = y.displayName;
const S = d.forwardRef(
  ({
    className: e,
    inset: t,
    icon: a,
    children: n,
    variant: r = "default",
    ...s
  }, l) => /* @__PURE__ */ u(
    Y,
    {
      ref: l,
      className: i(
        "relative flex cursor-default items-center rounded-md px-2 py-1.5 text-base outline-hidden select-none",
        "focus:text-kumo-default data-disabled:pointer-events-none data-disabled:opacity-50 data-highlighted:bg-kumo-overlay",
        "text-inherit no-underline",
        t && "pl-8",
        D({ variant: r }),
        e
      ),
      ...s,
      children: [
        a && g(a),
        n
      ]
    }
  )
);
S.displayName = "DropdownMenuLinkItem";
const L = d.forwardRef(({ className: e, children: t, checked: a, ...n }, r) => /* @__PURE__ */ u(
  k,
  {
    ref: r,
    className: i(
      "relative flex cursor-default items-center rounded-sm py-1.5 pr-2 pl-8 text-base outline-hidden transition-colors select-none focus:bg-kumo-tint focus:text-kumo-default data-disabled:pointer-events-none data-disabled:opacity-50",
      e
    ),
    checked: a,
    ...n,
    children: [
      /* @__PURE__ */ o(X, { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center text-inherit", children: /* @__PURE__ */ o(f, { weight: "bold", size: 12 }) }),
      t
    ]
  }
));
L.displayName = k.displayName;
const C = d.forwardRef(({ className: e, inset: t, ...a }, n) => /* @__PURE__ */ o(
  N,
  {
    ref: n,
    className: i(
      "px-2 py-1.5 text-base font-semibold",
      t && "pl-8",
      e
    ),
    ...a
  }
));
C.displayName = N.displayName;
const T = d.forwardRef(({ className: e, ...t }, a) => /* @__PURE__ */ o(
  M,
  {
    ref: a,
    className: i("-mx-1 my-1 h-px bg-kumo-line", e),
    ...t
  }
));
T.displayName = M.displayName;
const P = ({
  className: e,
  ...t
}) => /* @__PURE__ */ o(
  "span",
  {
    className: i("ml-auto text-xs tracking-widest opacity-60", e),
    ...t
  }
);
P.displayName = "DropdownMenuShortcut";
const O = d.forwardRef(({ className: e, children: t, inset: a, icon: n, ...r }, s) => /* @__PURE__ */ u(
  Q,
  {
    ref: s,
    className: i(
      "relative flex cursor-default items-center rounded-md px-2 py-1.5 text-base outline-hidden select-none",
      "data-disabled:pointer-events-none data-disabled:opacity-50 data-highlighted:bg-kumo-tint",
      a && "pl-8",
      e
    ),
    ...r,
    children: [
      n && g(n),
      t
    ]
  }
));
O.displayName = "DropdownMenuRadioItem";
const A = d.forwardRef(({ className: e, children: t, ...a }, n) => /* @__PURE__ */ o(
  q,
  {
    ref: n,
    className: i("ml-auto", e),
    ...a,
    children: t ?? /* @__PURE__ */ o(f, { className: "h-4 w-4" })
  }
));
A.displayName = "DropdownMenuRadioItemIndicator";
const E = d.forwardRef(({ children: e, render: t, ...a }, n) => {
  const r = d.isValidElement(e) ? e : null, s = t ?? r;
  return /* @__PURE__ */ o(
    ee,
    {
      ref: n,
      ...a,
      ...s && {
        render: s
      },
      children: r ? void 0 : e
    }
  );
});
E.displayName = "DropdownMenuTrigger";
const se = Object.assign(W, {
  Trigger: E,
  Portal: w,
  Sub: J,
  SubTrigger: I,
  SubContent: x,
  Content: x,
  Item: v,
  LinkItem: S,
  CheckboxItem: L,
  RadioGroup: H,
  RadioItem: O,
  RadioItemIndicator: A,
  Label: C,
  Separator: T,
  Shortcut: P,
  Group: B
});
export {
  se as D
};
//# sourceMappingURL=dropdown-icy3xatdwhzr4une.js.map
