"use client";
import { clsx } from 'clsx';
import { twMerge } from 'tailwind-merge';
import * as React from 'react';
import { Icon } from '@page-speed/icon';
import { jsx } from 'react/jsx-runtime';

function cn(...inputs) {
  return twMerge(clsx(inputs));
}
var DEFAULT_ICON_API_KEY = "au382bi7fsh96w9h9xlrnat2jglx";
var DynamicIcon = React.memo(function DynamicIcon2({
  apiKey,
  ...props
}) {
  return /* @__PURE__ */ jsx(Icon, { ...props, apiKey: apiKey ?? DEFAULT_ICON_API_KEY });
});
DynamicIcon.displayName = "DynamicIcon";
var paymentIconMap = {
  visa: "cib/cc-visa",
  mastercard: "cib/cc-mastercard",
  amex: "cib/cc-amex",
  apple: "cib/apple-pay",
  google: "cib/google-pay",
  paypal: "cib/cc-paypal",
  amazon: "cib/cc-amazon-pay",
  samsung: "cib/samsung-pay",
  upi: "material-symbols/upi-pay",
  afterpay: "simple-icons/afterpay",
  venmo: "cib/venmo",
  cashapp: "cib/cashapp",
  bitcoin: "cib/bitcoin",
  contactless: "mdi/contactless-payment-circle",
  square: "logos/square",
  unknown: "majesticons/creditcard"
};
function PaymentPlatformIcon({
  platform,
  size = 28,
  color,
  className,
  iconClassName
}) {
  const iconName = paymentIconMap[platform] || paymentIconMap.unknown;
  return /* @__PURE__ */ jsx(
    "span",
    {
      className: cn("inline-flex items-center justify-center", className),
      "aria-label": platform,
      children: /* @__PURE__ */ jsx(
        DynamicIcon,
        {
          name: iconName,
          size,
          color,
          className: iconClassName,
          alt: platform
        }
      )
    }
  );
}

export { PaymentPlatformIcon };
