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

function cn(...inputs) {
  return twMerge(clsx(inputs));
}
var SIZE_CLASSES = {
  sm: "max-h-6 sm:max-h-7",
  md: "max-h-8 sm:max-h-9 lg:max-h-10",
  lg: "max-h-10 sm:max-h-12 lg:max-h-14",
  xl: "max-h-12 sm:max-h-14 lg:max-h-16"
};
var BrandLogo = ({
  logo,
  logoSlot,
  logoClassName,
  size = "md",
  optixFlowConfig
}) => {
  if (logoSlot) return /* @__PURE__ */ jsx(Fragment, { children: logoSlot });
  if (!logo || !logo.src) return null;
  const imgElement = /* @__PURE__ */ jsx(
    Img,
    {
      src: logo.src,
      className: cn(
        "w-auto object-contain",
        SIZE_CLASSES[size],
        logo.className
      ),
      alt: logo.alt || "Logo",
      optixFlowConfig,
      loading: "eager"
    }
  );
  if (logo.url) {
    return /* @__PURE__ */ jsx(
      Pressable,
      {
        href: logo.url,
        className: cn("flex items-center", logoClassName),
        children: imgElement
      }
    );
  }
  return /* @__PURE__ */ jsx("div", { className: cn("flex items-center", logoClassName), children: imgElement });
};
var brand_logo_default = BrandLogo;

export { BrandLogo, brand_logo_default as default };
