"use client";
import * as React from 'react';
import * as AccordionPrimitive from '@radix-ui/react-accordion';
import { clsx } from 'clsx';
import { twMerge } from 'tailwind-merge';
import { jsx, jsxs } from 'react/jsx-runtime';

function cn(...inputs) {
  return twMerge(clsx(inputs));
}
var Accordion = AccordionPrimitive.Root;
var AccordionItem = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(AccordionPrimitive.Item, { ref, className: cn("border-b border-b-foreground/[0.08]", className), ...props }));
AccordionItem.displayName = "AccordionItem";
var AccordionTrigger = React.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsx(AccordionPrimitive.Header, { className: "flex", children: /* @__PURE__ */ jsxs(
  AccordionPrimitive.Trigger,
  {
    ref,
    className: cn(
      "flex flex-1 items-center justify-between py-[var(--space-4,1rem)] font-medium",
      "transition-all duration-[var(--duration-normal,200ms)] ease-out",
      "hover:underline",
      "[&[data-state=open]>svg]:rotate-180",
      className
    ),
    ...props,
    children: [
      children,
      /* @__PURE__ */ jsx(
        "svg",
        {
          xmlns: "http://www.w3.org/2000/svg",
          width: "24",
          height: "24",
          viewBox: "0 0 24 24",
          fill: "none",
          stroke: "currentColor",
          strokeWidth: "2",
          strokeLinecap: "round",
          strokeLinejoin: "round",
          className: "h-4 w-4 shrink-0 transition-transform duration-[var(--duration-normal,200ms)]",
          "aria-hidden": "true",
          children: /* @__PURE__ */ jsx("polyline", { points: "6 9 12 15 18 9" })
        }
      )
    ]
  }
) }));
AccordionTrigger.displayName = "AccordionTrigger";
var AccordionContent = React.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsx(
  AccordionPrimitive.Content,
  {
    ref,
    className: "overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",
    ...props,
    children: /* @__PURE__ */ jsx("div", { className: cn("pb-[var(--space-4,1rem)] pt-0", className), children })
  }
));
AccordionContent.displayName = "AccordionContent";
function MarketingFaq({
  items,
  eyebrow,
  title,
  description,
  type = "single",
  defaultValue,
  className
}) {
  const hasHeading = Boolean(eyebrow || title || description);
  return /* @__PURE__ */ jsx("section", { className: cn("bg-background py-24 sm:py-32", className), children: /* @__PURE__ */ jsxs("div", { className: "mx-auto max-w-3xl px-6 lg:px-8", children: [
    hasHeading ? /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center gap-4 text-center", children: [
      eyebrow ? /* @__PURE__ */ jsx("p", { className: "text-sm font-semibold uppercase tracking-wide text-primary", children: eyebrow }) : null,
      title ? /* @__PURE__ */ jsx("h2", { className: "text-balance text-3xl font-semibold tracking-tight text-foreground sm:text-4xl", children: title }) : null,
      description ? /* @__PURE__ */ jsx("p", { className: "text-pretty text-lg text-muted-foreground", children: description }) : null
    ] }) : null,
    type === "single" ? /* @__PURE__ */ jsx(
      Accordion,
      {
        type: "single",
        collapsible: true,
        defaultValue: typeof defaultValue === "string" ? defaultValue : void 0,
        className: cn(hasHeading && "mt-12"),
        children: items.map((item, index) => {
          const value = `item-${index + 1}`;
          return /* @__PURE__ */ jsxs(AccordionItem, { value, children: [
            /* @__PURE__ */ jsx(AccordionTrigger, { children: item.question }),
            /* @__PURE__ */ jsx(AccordionContent, { children: item.answer })
          ] }, value);
        })
      }
    ) : /* @__PURE__ */ jsx(
      Accordion,
      {
        type: "multiple",
        defaultValue: Array.isArray(defaultValue) ? defaultValue : void 0,
        className: cn(hasHeading && "mt-12"),
        children: items.map((item, index) => {
          const value = `item-${index + 1}`;
          return /* @__PURE__ */ jsxs(AccordionItem, { value, children: [
            /* @__PURE__ */ jsx(AccordionTrigger, { children: item.question }),
            /* @__PURE__ */ jsx(AccordionContent, { children: item.answer })
          ] }, value);
        })
      }
    )
  ] }) });
}

export { MarketingFaq };
//# sourceMappingURL=marketing-faq.js.map
//# sourceMappingURL=marketing-faq.js.map