"use client";
import { clsx } from 'clsx';
import { twMerge } from 'tailwind-merge';
import { Img } from '@page-speed/img';
import { jsx, jsxs } from 'react/jsx-runtime';

// lib/utils.ts
function cn(...inputs) {
  return twMerge(clsx(inputs));
}
function AboutMissionFeatures({
  title,
  description,
  missionLabel,
  missionText,
  mainImage,
  missionBackgroundImage,
  featuresTitle,
  featuresDescription,
  features,
  featuresSlot,
  className,
  containerClassName,
  titleClassName,
  descriptionClassName,
  missionLabelClassName,
  missionTextClassName,
  mainImageClassName,
  missionSectionClassName,
  featuresTitleClassName,
  featuresDescriptionClassName,
  featuresClassName,
  optixFlowConfig
}) {
  const renderFeatures = () => {
    if (featuresSlot) return featuresSlot;
    if (!features || features.length === 0) return null;
    return features.map((feature, idx) => /* @__PURE__ */ jsxs("div", { className: "flex flex-col", children: [
      /* @__PURE__ */ jsx("div", { className: cn("mb-5 flex size-12 items-center justify-center rounded-2xl bg-accent", feature.iconBgClass), children: feature.icon }),
      feature.title && (typeof feature.title === "string" ? /* @__PURE__ */ jsx("h3", { className: "mt-2 mb-3 text-lg font-semibold", children: feature.title }) : feature.title),
      feature.description && (typeof feature.description === "string" ? /* @__PURE__ */ jsx("p", { className: "text-muted-foreground", children: feature.description }) : feature.description)
    ] }, idx));
  };
  return /* @__PURE__ */ jsx("section", { className: cn("py-32", className), children: /* @__PURE__ */ jsxs("div", { className: cn("container flex flex-col gap-16 lg:gap-28", containerClassName), children: [
    /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-4 lg:gap-8", children: [
      title && (typeof title === "string" ? /* @__PURE__ */ jsx("h1", { className: cn("text-4xl font-semibold tracking-tighter lg:text-7xl", titleClassName), children: title }) : /* @__PURE__ */ jsx("div", { className: titleClassName, children: title })),
      description && (typeof description === "string" ? /* @__PURE__ */ jsx("p", { className: cn("max-w-xl text-xl", descriptionClassName), children: description }) : /* @__PURE__ */ jsx("div", { className: descriptionClassName, children: description }))
    ] }),
    /* @__PURE__ */ jsxs("div", { className: "grid gap-6 md:grid-cols-2", children: [
      mainImage && /* @__PURE__ */ jsx(
        Img,
        {
          src: mainImage.src,
          alt: mainImage.alt,
          className: cn("size-full max-h-96 rounded-2xl object-cover", mainImageClassName),
          optixFlowConfig
        }
      ),
      /* @__PURE__ */ jsxs(
        "div",
        {
          className: cn("flex flex-col justify-between gap-10 rounded-2xl bg-muted p-10", missionSectionClassName),
          style: missionBackgroundImage ? {
            backgroundImage: `url(${missionBackgroundImage.src})`,
            backgroundSize: "cover",
            backgroundPosition: "center"
          } : void 0,
          children: [
            missionLabel && (typeof missionLabel === "string" ? /* @__PURE__ */ jsx("p", { className: cn("text-sm font-semibold text-white", missionLabelClassName), children: missionLabel }) : /* @__PURE__ */ jsx("div", { className: missionLabelClassName, children: missionLabel })),
            missionText && (typeof missionText === "string" ? /* @__PURE__ */ jsx("p", { className: cn("text-lg font-medium text-white", missionTextClassName), children: missionText }) : /* @__PURE__ */ jsx("div", { className: missionTextClassName, children: missionText }))
          ]
        }
      )
    ] }),
    /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-6 md:gap-20", children: [
      /* @__PURE__ */ jsxs("div", { className: "max-w-xl", children: [
        featuresTitle && (typeof featuresTitle === "string" ? /* @__PURE__ */ jsx("h2", { className: cn("mb-4 text-3xl font-semibold tracking-tight md:text-5xl", featuresTitleClassName), children: featuresTitle }) : /* @__PURE__ */ jsx("div", { className: featuresTitleClassName, children: featuresTitle })),
        featuresDescription && (typeof featuresDescription === "string" ? /* @__PURE__ */ jsx("p", { className: cn("text-lg text-muted-foreground", featuresDescriptionClassName), children: featuresDescription }) : /* @__PURE__ */ jsx("div", { className: featuresDescriptionClassName, children: featuresDescription }))
      ] }),
      /* @__PURE__ */ jsx("div", { className: cn("grid gap-10 md:grid-cols-3", featuresClassName), children: renderFeatures() })
    ] })
  ] }) });
}

export { AboutMissionFeatures };
