"use client";
import { jsx as e, jsxs as i } from "react/jsx-runtime";
import { CheckIcon as I, XIcon as p, CaretDownIcon as x } from "@phosphor-icons/react";
import { Fragment as T } from "react";
import { i as b } from "./input-DCzpefuq.js";
import { c as t } from "./cn-Bhsu1vx2.js";
import { F as R } from "./field-B8xISAuX.js";
import { a5 as j, a6 as G, a7 as L, a8 as V, a9 as F, aa as P, ab as u, ac as E, ad as M, ae as W, af as z, ag as D, ah as d, ai as O, aj as h, ak as f, al as X, am as _, an as q } from "./vendor-base-ui-Bsg5ebHI.js";
function g({
  label: o,
  required: a,
  labelTooltip: s,
  description: n,
  error: r,
  children: l,
  ...m
}) {
  const c = /* @__PURE__ */ e(G, { ...m, children: l });
  return o ? /* @__PURE__ */ e(
    R,
    {
      label: o,
      required: a,
      labelTooltip: s,
      description: n,
      error: r ? typeof r == "string" ? { message: r, match: !0 } : r : void 0,
      children: c
    }
  ) : c;
}
function C({
  children: o,
  className: a,
  align: s = "start",
  sideOffset: n = 4,
  alignOffset: r,
  side: l
}) {
  return /* @__PURE__ */ e(X, { children: /* @__PURE__ */ e(
    _,
    {
      className: "outline-none",
      align: s,
      sideOffset: n,
      alignOffset: r,
      side: l,
      children: /* @__PURE__ */ e(
        q,
        {
          className: t(
            "flex flex-col",
            // flexbox layout for sticky input + scrollable list
            "max-h-[min(var(--available-height),24rem)] max-w-(--available-width) min-w-(--anchor-width) py-1.5",
            "bg-kumo-control text-kumo-default",
            // background
            "rounded-lg shadow-lg ring ring-kumo-line",
            // border part
            a
          ),
          children: o
        }
      )
    }
  ) });
}
function N({
  className: o,
  ...a
}) {
  return /* @__PURE__ */ i(
    h,
    {
      className: t(
        b(),
        "relative flex items-center pr-8",
        o
      ),
      children: [
        /* @__PURE__ */ e(d, { children: a.children }),
        /* @__PURE__ */ e(f, { className: "absolute top-1/2 right-2 -translate-y-1/2", children: /* @__PURE__ */ e(x, { className: "fill-kumo-ring" }) })
      ]
    }
  );
}
function y(o) {
  return /* @__PURE__ */ i(
    "div",
    {
      className: t("relative inline-block w-full max-w-xs", o.className),
      children: [
        /* @__PURE__ */ e(
          u,
          {
            ...o,
            className: t(b(), "w-full pr-12")
          }
        ),
        /* @__PURE__ */ e(O, { className: "absolute top-1/2 right-8 flex -translate-y-1/2 cursor-pointer bg-transparent p-0", children: /* @__PURE__ */ e(p, {}) }),
        /* @__PURE__ */ e(h, { className: "p-0", children: /* @__PURE__ */ e(f, { className: "absolute top-1/2 right-2 flex -translate-y-1/2 cursor-pointer", children: /* @__PURE__ */ e(x, { className: "fill-kumo-ring" }) }) })
      ]
    }
  );
}
function v({ children: o, ...a }) {
  return /* @__PURE__ */ i(
    E,
    {
      ...a,
      className: "group mx-1.5 grid cursor-pointer grid-cols-[1fr_16px] gap-2 rounded px-2 py-1.5 text-base data-highlighted:bg-kumo-overlay",
      children: [
        /* @__PURE__ */ e("div", { className: "col-start-1", children: o }),
        /* @__PURE__ */ e(M, { className: "col-start-2 flex items-center", children: /* @__PURE__ */ e(I, {}) })
      ]
    }
  );
}
function A(o) {
  return /* @__PURE__ */ e(
    P,
    {
      ...o,
      className: t(
        "mx-1.5 shrink-0 px-4 py-2 text-[0.925rem] leading-4 text-kumo-subtle empty:m-0 empty:p-0"
      ),
      children: o.children ?? "No labels found."
    }
  );
}
function B(o) {
  return /* @__PURE__ */ e(
    u,
    {
      ...o,
      className: t(
        b(),
        "mx-1.5 w-[calc(100%-0.75rem)] shrink-0 first:mb-2",
        o.className
      )
    }
  );
}
function H({
  className: o,
  ...a
}) {
  return /* @__PURE__ */ e(
    L,
    {
      ...a,
      className: t(
        "min-h-0 flex-1 overflow-y-auto overscroll-contain scroll-pt-2 scroll-pb-2",
        o
      )
    }
  );
}
function J(o) {
  return /* @__PURE__ */ e(
    F,
    {
      ...o,
      className: "mx-1.5 px-4 py-1.5 text-sm font-medium"
    }
  );
}
function K(o) {
  return /* @__PURE__ */ e(V, { ...o, className: "mt-2 first:mt-0" });
}
function w(o) {
  return /* @__PURE__ */ i(
    W,
    {
      ...o,
      className: "flex items-center gap-1 rounded-md bg-kumo-overlay px-2 py-1",
      children: [
        o.children,
        /* @__PURE__ */ e(z, { className: "cursor-pointer rounded-md p-1 hover:bg-kumo-fill-hover", children: /* @__PURE__ */ e(p, { size: 12, weight: "bold" }) })
      ]
    }
  );
}
function k({
  placeholder: o,
  renderItem: a,
  className: s,
  inputSide: n = "right",
  value: r
}) {
  const l = r;
  return /* @__PURE__ */ i(
    D,
    {
      className: t(
        b(),
        t("flex flex-col", "gap-1 p-1", "min-h-9", "h-auto"),
        s
      ),
      children: [
        n === "top" && /* @__PURE__ */ e(
          u,
          {
            placeholder: o,
            className: "w-full px-2 py-1 outline-none"
          }
        ),
        /* @__PURE__ */ i("div", { className: "flex flex-wrap gap-1", children: [
          l !== void 0 && l.length > 0 && l.map((m) => a(m)),
          /* @__PURE__ */ e(d, { children: (m) => l !== void 0 ? null : /* @__PURE__ */ e(T, { children: m.map((c) => a(c)) }) }),
          n === "right" && /* @__PURE__ */ e(
            u,
            {
              placeholder: o,
              className: "min-w-[100px] flex-1 px-2 py-1 outline-none"
            }
          )
        ] })
      ]
    }
  );
}
g.displayName = "Combobox.Root";
C.displayName = "Combobox.Content";
N.displayName = "Combobox.TriggerValue";
y.displayName = "Combobox.TriggerInput";
v.displayName = "Combobox.Item";
w.displayName = "Combobox.Chip";
k.displayName = "Combobox.TriggerMultipleWithInput";
const eo = Object.assign(g, {
  // Helper components
  Content: C,
  TriggerValue: N,
  TriggerInput: y,
  TriggerMultipleWithInput: k,
  // Slightly modified BaseUI
  Chip: w,
  Item: v,
  // Styled BaseUI
  Input: B,
  Empty: A,
  GroupLabel: J,
  Group: K,
  // Styled BaseUI
  List: H,
  // BaseUI
  Collection: j
});
export {
  eo as C
};
//# sourceMappingURL=combobox-vnvi22pn.js.map
