"use client";
import { jsx as t, jsxs as A } from "react/jsx-runtime";
import { CheckIcon as g } from "@phosphor-icons/react";
import { K as c, i as y } from "./input-lpa5fc75tgrraafv.js";
import { c as s } from "./cn-ct4n7r74mh8y0f48.js";
import { F as C } from "./field-lnj619xpe8zjd26r.js";
import { a6 as I, ab as T, bu as k, a8 as v, S as G, a9 as L, aa as O, bt as P, am as _, an as w, ao as z, ac as E } from "./vendor-base-ui-ie71jahf0czyf58j.js";
const D = {
  size: c.size
}, u = {
  size: "base"
};
function $({
  size: o = u.size
} = {}) {
  return s(c.size[o].classes);
}
function p({
  label: o,
  required: e,
  labelTooltip: r,
  description: m,
  error: a,
  children: n,
  ...i
}) {
  const l = /* @__PURE__ */ t(k, { ...i, children: n });
  return o ? /* @__PURE__ */ t(
    C,
    {
      label: o,
      required: e,
      labelTooltip: r,
      description: m,
      error: a ? typeof a == "string" ? { message: a, match: !0 } : a : void 0,
      children: l
    }
  ) : l;
}
function d({
  className: o,
  size: e = u.size,
  placeholder: r
}) {
  return /* @__PURE__ */ t(
    E,
    {
      className: s(
        y({ size: e, focusIndicator: !0 }),
        "w-full",
        o
      ),
      placeholder: r
    }
  );
}
function b({
  children: o,
  className: e,
  align: r = "start",
  sideOffset: m = 4,
  alignOffset: a,
  side: n
}) {
  return /* @__PURE__ */ t(_, { children: /* @__PURE__ */ t(
    w,
    {
      className: "outline-none",
      align: r,
      sideOffset: m,
      alignOffset: a,
      side: n,
      children: /* @__PURE__ */ t(
        z,
        {
          className: (i) => s(
            "flex flex-col",
            "max-h-[min(var(--available-height),24rem)] max-w-(--available-width) min-w-(--anchor-width) py-1.5",
            "bg-kumo-control text-kumo-default",
            "rounded-lg shadow-lg ring ring-kumo-line",
            i.empty && "hidden",
            e
          ),
          children: o
        }
      )
    }
  ) });
}
function S({
  className: o,
  ...e
}) {
  return /* @__PURE__ */ t(
    v,
    {
      ...e,
      className: s(
        "min-h-0 flex-1 overflow-y-auto overscroll-contain scroll-pt-2 scroll-pb-2",
        o
      )
    }
  );
}
function f({ children: o, ...e }) {
  return /* @__PURE__ */ A(
    P,
    {
      ...e,
      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 data-selected:font-medium",
      children: [
        /* @__PURE__ */ t("div", { className: "col-start-1", children: o }),
        /* @__PURE__ */ t("span", { className: "col-start-2 hidden items-center group-data-selected:flex", children: /* @__PURE__ */ t(g, { size: 14 }) })
      ]
    }
  );
}
function x(o) {
  return /* @__PURE__ */ t(
    O,
    {
      ...o,
      className: s(
        "mx-1.5 px-2 py-1.5 text-sm text-kumo-strong",
        o.className
      )
    }
  );
}
function N(o) {
  return /* @__PURE__ */ t(
    L,
    {
      ...o,
      className: "border-t border-kumo-line mt-2 pt-2 first:border-t-0 first:mt-0 first:pt-0"
    }
  );
}
function h(o) {
  return /* @__PURE__ */ t(
    G,
    {
      ...o,
      className: s("mx-0 my-1 h-px bg-kumo-line", o.className)
    }
  );
}
p.displayName = "Autocomplete.Root";
d.displayName = "Autocomplete.InputGroup";
b.displayName = "Autocomplete.Content";
f.displayName = "Autocomplete.Item";
x.displayName = "Autocomplete.GroupLabel";
N.displayName = "Autocomplete.Group";
h.displayName = "Autocomplete.Separator";
const q = Object.assign(p, {
  // Styled compound sub-components
  InputGroup: d,
  Content: b,
  Item: f,
  GroupLabel: x,
  Group: N,
  Separator: h,
  List: S,
  // Pass-through Base UI sub-components
  Empty: T,
  Collection: I
});
export {
  q as A,
  D as K,
  $ as a,
  u as b
};
//# sourceMappingURL=autocomplete-cs3fwy6lwzlyirpq.js.map
